Mercurial > emacs
comparison lisp/vc-dispatcher.el @ 94692:891cb8f8888f
More decoupling of vc-dispatcher.el from vc.el.
author | Eric S. Raymond <esr@snark.thyrsus.com> |
---|---|
date | Tue, 06 May 2008 16:00:54 +0000 |
parents | 1cd9c5b2b68a |
children | f46fc59d6e9e |
comparison
equal
deleted
inserted
replaced
94691:54ad2e16eccb | 94692:891cb8f8888f |
---|---|
100 ;; The interface to the upper level has the two main entry points (vc-dir) | 100 ;; The interface to the upper level has the two main entry points (vc-dir) |
101 ;; and (vc-dispatcher-selection-set) and a couple of convenience functions. | 101 ;; and (vc-dispatcher-selection-set) and a couple of convenience functions. |
102 ;; (vc-dir) sets up a dispatcher browsing buffer; (vc-dispatcher-selection-set) | 102 ;; (vc-dir) sets up a dispatcher browsing buffer; (vc-dispatcher-selection-set) |
103 ;; returns a selection set of files, either the marked files in a browsing | 103 ;; returns a selection set of files, either the marked files in a browsing |
104 ;; buffer or the singleton set consisting of the file visited by the current | 104 ;; buffer or the singleton set consisting of the file visited by the current |
105 ;; buffer (when that is appropriate). | 105 ;; buffer (when that is appropriate). It also does what is needed to ensure |
106 ;; that on-disk files and the contents of their visiting Emacs buffers | |
107 ;; coincide. | |
108 ;; | |
109 ;; When the client mode adds a local mode-line-hook to a buffer, it | |
110 ;; will be called with the buffer file name as argument whenever the | |
111 ;; dispatcher resynchs the buffer. | |
106 | 112 |
107 ;; To do: | 113 ;; To do: |
108 ;; | 114 ;; |
109 ;; - vc-dir-kill-dir-status-process should not be specific to dir-status, | 115 ;; - vc-dir-kill-dir-status-process should not be specific to dir-status, |
110 ;; it should work for other async commands as well (pull/push/...). | 116 ;; it should work for other async commands as well (pull/push/...). |
548 (let ((view-old-buffer-read-only nil)) | 554 (let ((view-old-buffer-read-only nil)) |
549 (view-mode-exit))) | 555 (view-mode-exit))) |
550 (and (not view-mode) | 556 (and (not view-mode) |
551 (not (eq (get major-mode 'mode-class) 'special)) | 557 (not (eq (get major-mode 'mode-class) 'special)) |
552 (view-mode-enter)))) | 558 (view-mode-enter)))) |
553 ;; FIXME: Call into vc.el | 559 (run-hook-with-args 'modeline-hook buffer-file-name)) |
554 (vc-mode-line buffer-file-name)) | |
555 (kill-buffer (current-buffer))))) | 560 (kill-buffer (current-buffer))))) |
556 | 561 |
557 (defun vc-resynch-buffer (file &optional keep noquery) | 562 (defun vc-resynch-buffer (file &optional keep noquery) |
558 "If FILE is currently visited, resynch its buffer." | 563 "If FILE is currently visited, resynch its buffer." |
559 (if (string= buffer-file-name file) | 564 (if (string= buffer-file-name file) |
1638 (or vc-dired-mode (eq major-mode 'vc-dir-mode))) | 1643 (or vc-dired-mode (eq major-mode 'vc-dir-mode))) |
1639 | 1644 |
1640 (defun vc-dispatcher-selection-set (eligible | 1645 (defun vc-dispatcher-selection-set (eligible |
1641 &optional | 1646 &optional |
1642 allow-directory-wildcard | 1647 allow-directory-wildcard |
1643 allow-inegible | 1648 allow-ineligible |
1644 include-files-not-directories) | 1649 include-files-not-directories) |
1645 "Deduce a set of files to which to apply an operation. Return the fileset. | 1650 "Deduce a set of files to which to apply an operation. Return the fileset. |
1646 If we're in VC-dired mode, the fileset is the list of marked files. | 1651 If we're in VC-dired mode, the fileset is the list of marked files. |
1647 Otherwise, if we're looking at a buffer for which ELIGIBLE returns non-NIL, | 1652 Otherwise, if we're looking at a buffer for which ELIGIBLE returns non-NIL, |
1648 the fileset is a singleton containing this file. | 1653 the fileset is a singleton containing this file. |
1676 ((and vc-parent-buffer (or (buffer-file-name vc-parent-buffer) | 1681 ((and vc-parent-buffer (or (buffer-file-name vc-parent-buffer) |
1677 (with-current-buffer vc-parent-buffer | 1682 (with-current-buffer vc-parent-buffer |
1678 (vc-dispatcher-browsing)))) | 1683 (vc-dispatcher-browsing)))) |
1679 (progn | 1684 (progn |
1680 (set-buffer vc-parent-buffer) | 1685 (set-buffer vc-parent-buffer) |
1681 (vc-dispatcher-selection-set))) | 1686 (vc-dispatcher-selection-set eligible))) |
1682 ;; No parent buffer, we may want to select entire directory | 1687 ;; No parent buffer, we may want to select entire directory |
1683 ;; | 1688 ;; |
1684 ;; This is guarded by an enabling arg so users won't potentially | 1689 ;; This is guarded by an enabling arg so users won't potentially |
1685 ;; shoot themselves in the foot by modifying a fileset they can't | 1690 ;; shoot themselves in the foot by modifying a fileset they can't |
1686 ;; verify by eyeball. Allow it for nondestructive commands like | 1691 ;; verify by eyeball. Allow it for nondestructive commands like |