Jelajahi Sumber

Minimize the UI noise of the emacs frame.

Wei Hu 15 tahun lalu
induk
melakukan
07490d7e7f
2 mengubah file dengan 33 tambahan dan 2 penghapusan
  1. 9 0
      README
  2. 24 2
      edit-server.el

+ 9 - 0
README

@@ -42,3 +42,12 @@ The optional URL allows the edit server to create more identifiable
 names for the buffers/temp files to help the user keep track. We may
 expand the information passed in future as additional HTTP GET style
 parameters.
+
+Customizing the look of Emacs
+============
+
+By default, Emacs opens up a new frame upon an edit request. All the
+UI elements are removed to better mimic a bare text box. You can
+customize the default behavior by `M-x customize-group [RET]
+edit-server [RET]`. Or you can set the variables' values directly in
+your ~/.emacs.

+ 24 - 2
edit-server.el

@@ -48,6 +48,21 @@ Current buffer holds the text that is about to be sent back to the client."
   :group 'edit-server
   :type 'hook)
 
+(defcustom edit-server-new-frame-minibuffer nil
+  "Show the emacs frame's minibuffer if set to t; hide if nil."
+  :group 'edit-server
+  :type 'boolean)
+
+(defcustom edit-server-new-frame-menu-bar 0
+  "Show the emacs frame's menu-bar if set to 1; hide if 0."
+  :group 'edit-server
+  :type 'integer)
+
+(defcustom edit-server-new-frame-no-mode-line t
+  "Hide the emacs frame's mode-line."
+  :group 'edit-server
+  :type 'integer)
+
 ;; Vars
 (defconst edit-server-process-buffer-name " *edit-server*"
   "Template name of the edit-server process buffers.")
@@ -260,10 +275,17 @@ If `edit-server-verbose' is non-nil, then STRING is also echoed to the message l
       (set (make-local-variable 'edit-server-frame) 
            (if edit-server-new-frame
                (make-frame-on-display (getenv "DISPLAY")
-                 `((name . ,edit-server-new-frame-title) (width . ,edit-server-new-frame-width) (height . ,edit-server-new-frame-height)))
+                 `((name . ,edit-server-new-frame-title)
+                   (width . ,edit-server-new-frame-width)
+                   (height . ,edit-server-new-frame-height)
+                   (minibuffer . ,edit-server-new-frame-minibuffer)
+                   (menu-bar-lines . ,edit-server-new-frame-menu-bar)))
              nil))
       (if edit-server-new-frame
-          (raise-frame edit-server-frame)
+        (progn
+          (if edit-server-new-frame-no-mode-line
+            (setq mode-line-format nil))
+          (raise-frame edit-server-frame))
         (pop-to-buffer buffer)))))
 
 (defun edit-server-send-response (proc &optional body close)