Commit c8d4f1a0 authored by Eric S. Raymond's avatar Eric S. Raymond
Browse files

More decoupling of vc-dispatcher.el from vc.el.

parent 5509c6ad
2008-05-06 Eric S. Raymond <esr@snark.thyrsus.com>
* vc-hooks.el (vc-find-file-hook),
vc-dispatcher.el (vc-resynch-window): Decouple vc-dispatcher
further from vc.el.
2008-05-06 Wilson Snyder <wsnyder@wsnyder.org> 2008-05-06 Wilson Snyder <wsnyder@wsnyder.org>
   
* verilog-mode.el (verilog-getopt-file): Cleanup warning message format. * verilog-mode.el (verilog-getopt-file): Cleanup warning message format.
......
...@@ -102,7 +102,13 @@ ...@@ -102,7 +102,13 @@
;; (vc-dir) sets up a dispatcher browsing buffer; (vc-dispatcher-selection-set) ;; (vc-dir) sets up a dispatcher browsing buffer; (vc-dispatcher-selection-set)
;; returns a selection set of files, either the marked files in a browsing ;; returns a selection set of files, either the marked files in a browsing
;; buffer or the singleton set consisting of the file visited by the current ;; buffer or the singleton set consisting of the file visited by the current
;; buffer (when that is appropriate). ;; buffer (when that is appropriate). It also does what is needed to ensure
;; that on-disk files and the contents of their visiting Emacs buffers
;; coincide.
;;
;; When the client mode adds a local mode-line-hook to a buffer, it
;; will be called with the buffer file name as argument whenever the
;; dispatcher resynchs the buffer.
;; To do: ;; To do:
;; ;;
...@@ -550,8 +556,7 @@ editing!" ...@@ -550,8 +556,7 @@ editing!"
(and (not view-mode) (and (not view-mode)
(not (eq (get major-mode 'mode-class) 'special)) (not (eq (get major-mode 'mode-class) 'special))
(view-mode-enter)))) (view-mode-enter))))
;; FIXME: Call into vc.el (run-hook-with-args 'modeline-hook buffer-file-name))
(vc-mode-line buffer-file-name))
(kill-buffer (current-buffer))))) (kill-buffer (current-buffer)))))
(defun vc-resynch-buffer (file &optional keep noquery) (defun vc-resynch-buffer (file &optional keep noquery)
...@@ -1640,7 +1645,7 @@ NOT-URGENT means it is ok to continue if the user says not to save." ...@@ -1640,7 +1645,7 @@ NOT-URGENT means it is ok to continue if the user says not to save."
(defun vc-dispatcher-selection-set (eligible (defun vc-dispatcher-selection-set (eligible
&optional &optional
allow-directory-wildcard allow-directory-wildcard
allow-inegible allow-ineligible
include-files-not-directories) include-files-not-directories)
"Deduce a set of files to which to apply an operation. Return the fileset. "Deduce a set of files to which to apply an operation. Return the fileset.
If we're in VC-dired mode, the fileset is the list of marked files. If we're in VC-dired mode, the fileset is the list of marked files.
...@@ -1678,7 +1683,7 @@ Otherwise, throw an error." ...@@ -1678,7 +1683,7 @@ Otherwise, throw an error."
(vc-dispatcher-browsing)))) (vc-dispatcher-browsing))))
(progn (progn
(set-buffer vc-parent-buffer) (set-buffer vc-parent-buffer)
(vc-dispatcher-selection-set))) (vc-dispatcher-selection-set eligible)))
;; No parent buffer, we may want to select entire directory ;; No parent buffer, we may want to select entire directory
;; ;;
;; This is guarded by an enabling arg so users won't potentially ;; This is guarded by an enabling arg so users won't potentially
......
...@@ -901,6 +901,7 @@ current, and kill the buffer that visits the link." ...@@ -901,6 +901,7 @@ current, and kill the buffer that visits the link."
(setq vc-mode nil)) (setq vc-mode nil))
(when buffer-file-name (when buffer-file-name
(vc-file-clearprops buffer-file-name) (vc-file-clearprops buffer-file-name)
(add-hook 'mode-line-hook 'vc-mode-line nil t)
(cond (cond
((with-demoted-errors (vc-backend buffer-file-name)) ((with-demoted-errors (vc-backend buffer-file-name))
;; Compute the state and put it in the modeline. ;; Compute the state and put it in the modeline.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment