Browse Source

edit-server.el: add edit-server-edit-mode-hook (#91, #94)

This provides a late hook for once every thing is set-up and the user
may want to mess with the display. You shouldn't use this hook for
setting modes as this will likely confuse the minor mode magic we are
using.
Alex Bennée 10 năm trước cách đây
mục cha
commit
bb447b2204
1 tập tin đã thay đổi với 14 bổ sung1 xóa
  1. 14 1
      edit-server.el

+ 14 - 1
edit-server.el

@@ -105,6 +105,15 @@ buffer-specific modes or add key bindings."
   :group 'edit-server
   :type 'hook)
 
+(defcustom edit-server-edit-mode-hook nil
+  "Hook run when we enter edit-server-edit-mode.  This is the final step of
+an edit session and is called when all frames and displays have been
+set-up.  You should not set any additional major modes here though as they
+may conflict with the edit-server-edit-mode, use the
+edit-server-start-hook instead."
+  :group 'edit-server
+  :type 'hook)
+
 ;; frame options
 
 (defcustom edit-server-new-frame t
@@ -252,7 +261,11 @@ send a response back to the client."
   :group 'edit-server
   :lighter " EditSrv"
   :init-value nil
-  :keymap edit-server-edit-mode-map)
+  :keymap edit-server-edit-mode-map
+  (when (and
+         (numberp arg)
+         (> arg 0))
+    (run-hooks 'edit-server-edit-mode-hook)))
 
 (defun turn-on-edit-server-edit-mode-if-server ()
   "Turn on `edit-server-edit-mode' if in an edit-server buffer."