emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r101194: server.el (server-visit-file


From: David Reitter
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r101194: server.el (server-visit-files): Run pre-command-hook and
Date: Thu, 26 Aug 2010 09:46:19 -0400
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 101194
committer: David Reitter <address@hidden>
branch nick: trunk
timestamp: Thu 2010-08-26 09:46:19 -0400
message:
  server.el (server-visit-files): Run pre-command-hook and
  post-command-hook for each buffer while it is current
  (Bug#6910).
  (server-execute): Do not run hooks here.
modified:
  lisp/ChangeLog
  lisp/server.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-08-26 07:33:16 +0000
+++ b/lisp/ChangeLog    2010-08-26 13:46:19 +0000
@@ -1,3 +1,10 @@
+2010-08-26  David Reitter  <address@hidden>
+
+       * server.el (server-visit-files): Run pre-command-hook and
+       post-command-hook for each buffer while it is current
+       (Bug#6910).
+       (server-execute): Do not run hooks here.
+
 2010-08-26  Michael Albinus  <address@hidden>
 
        Sync with Tramp 2.1.19.

=== modified file 'lisp/server.el'
--- a/lisp/server.el    2010-08-08 21:12:29 +0000
+++ b/lisp/server.el    2010-08-26 13:46:19 +0000
@@ -1093,9 +1093,7 @@
     (condition-case err
         (let* ((buffers
                 (when files
-                  (run-hooks 'pre-command-hook)
-                  (prog1 (server-visit-files files proc nowait)
-                    (run-hooks 'post-command-hook)))))
+                  (server-visit-files files proc nowait))))
 
           (mapc 'funcall (nreverse commands))
 
@@ -1166,8 +1164,13 @@
               (obuf (get-file-buffer filen)))
          (add-to-history 'file-name-history filen)
          (if (null obuf)
-              (set-buffer (find-file-noselect filen))
+             (progn
+               (run-hooks 'pre-command-hook)  
+               (set-buffer (find-file-noselect filen)))
             (set-buffer obuf)
+           ;; separately for each file, in sync with post-command hooks,
+           ;; with the new buffer current:
+           (run-hooks 'pre-command-hook)  
             (cond ((file-exists-p filen)
                    (when (not (verify-visited-file-modtime obuf))
                      (revert-buffer t nil)))
@@ -1179,7 +1182,9 @@
             (unless server-buffer-clients
               (setq server-existing-buffer t)))
           (server-goto-line-column (cdr file))
-          (run-hooks 'server-visit-hook))
+          (run-hooks 'server-visit-hook)
+         ;; hooks may be specific to current buffer:
+         (run-hooks 'post-command-hook)) 
        (unless nowait
          ;; When the buffer is killed, inform the clients.
          (add-hook 'kill-buffer-hook 'server-kill-buffer nil t)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]