aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2010-06-08 21:12:53 -0400
committerStefan Monnier2010-06-08 21:12:53 -0400
commit8c6eab5a27df2983c403e6737a4f50d835408d8a (patch)
tree0aa12ddf114d9d011cf30a3319b614d0a23dde7d
parent373bf2b76c9ee3ddefa55aae26134ddadf9cf544 (diff)
downloademacs-8c6eab5a27df2983c403e6737a4f50d835408d8a.tar.gz
emacs-8c6eab5a27df2983c403e6737a4f50d835408d8a.zip
* lisp/vc-dispatcher.el: Rename mode-line-hook to vc-mode-line-hook;
declare it, make it buffer-local, and permanent-local. (vc-resynch-window): Adjust name. * lisp/vc-hooks.el (vc-find-file-hook): Adjust name. Fixes: debbugs:6324
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/vc-dispatcher.el9
-rw-r--r--lisp/vc-hooks.el3
3 files changed, 16 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a36b5be3f02..57115bba400 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12010-06-09 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * vc-dispatcher.el: Rename mode-line-hook to vc-mode-line-hook;
4 declare it, make it buffer-local and permanent-local (bug#6324).
5 (vc-resynch-window): Adjust name.
6 * vc-hooks.el (vc-find-file-hook): Adjust name.
7
12010-06-07 Jonathan Rockway <jon@jrock.us> 82010-06-07 Jonathan Rockway <jon@jrock.us>
2 9
3 * net/rcirc.el: Add support for password authentication. 10 * net/rcirc.el: Add support for password authentication.
diff --git a/lisp/vc-dispatcher.el b/lisp/vc-dispatcher.el
index 40223c9010d..0c3820bc529 100644
--- a/lisp/vc-dispatcher.el
+++ b/lisp/vc-dispatcher.el
@@ -101,7 +101,7 @@
101;; that on-disk files and the contents of their visiting Emacs buffers 101;; that on-disk files and the contents of their visiting Emacs buffers
102;; coincide. 102;; coincide.
103;; 103;;
104;; When the client mode adds a local mode-line-hook to a buffer, it 104;; When the client mode adds a local vc-mode-line-hook to a buffer, it
105;; will be called with the buffer file name as argument whenever the 105;; will be called with the buffer file name as argument whenever the
106;; dispatcher resynchs the buffer. 106;; dispatcher resynchs the buffer.
107 107
@@ -454,6 +454,10 @@ ARG and NO-CONFIRM are passed on to `revert-buffer'."
454 (revert-buffer arg no-confirm t)) 454 (revert-buffer arg no-confirm t))
455 (vc-restore-buffer-context context))) 455 (vc-restore-buffer-context context)))
456 456
457(defvar vc-mode-line-hook nil)
458(make-variable-buffer-local 'vc-mode-line-hook)
459(put 'vc-mode-line-hook 'permanent-local t)
460
457(defun vc-resynch-window (file &optional keep noquery) 461(defun vc-resynch-window (file &optional keep noquery)
458 "If FILE is in the current buffer, either revert or unvisit it. 462 "If FILE is in the current buffer, either revert or unvisit it.
459The choice between revert (to see expanded keywords) and unvisit 463The choice between revert (to see expanded keywords) and unvisit
@@ -479,7 +483,8 @@ editing!"
479 (not (eq (get major-mode 'mode-class) 'special)) 483 (not (eq (get major-mode 'mode-class) 'special))
480 (view-mode-enter)))) 484 (view-mode-enter))))
481 485
482 (run-hook-with-args 'mode-line-hook buffer-file-name)) 486 ;; FIXME: Why use a hook? Why pass it buffer-file-name?
487 (run-hook-with-args 'vc-mode-line-hook buffer-file-name))
483 (kill-buffer (current-buffer))))) 488 (kill-buffer (current-buffer)))))
484 489
485(declare-function vc-dir-resynch-file "vc-dir" (&optional fname)) 490(declare-function vc-dir-resynch-file "vc-dir" (&optional fname))
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el
index 01c1dc822df..70369df06fe 100644
--- a/lisp/vc-hooks.el
+++ b/lisp/vc-hooks.el
@@ -880,7 +880,8 @@ current, and kill the buffer that visits the link."
880 (setq vc-mode nil)) 880 (setq vc-mode nil))
881 (when buffer-file-name 881 (when buffer-file-name
882 (vc-file-clearprops buffer-file-name) 882 (vc-file-clearprops buffer-file-name)
883 (add-hook 'mode-line-hook 'vc-mode-line nil t) 883 ;; FIXME: Why use a hook? Why pass it buffer-file-name?
884 (add-hook 'vc-mode-line-hook 'vc-mode-line nil t)
884 (let (backend) 885 (let (backend)
885 (cond 886 (cond
886 ((setq backend (with-demoted-errors (vc-backend buffer-file-name))) 887 ((setq backend (with-demoted-errors (vc-backend buffer-file-name)))