diff options
| author | Dan Nicolaescu | 2010-10-03 17:26:41 -0700 |
|---|---|---|
| committer | Dan Nicolaescu | 2010-10-03 17:26:41 -0700 |
| commit | 82fb8701c275cccf4c06e6b7b0a9364ae2072803 (patch) | |
| tree | a0fb4a919813353d000c1f93ba839835cbc48076 | |
| parent | a41c2e6d330243fa7b5d1537d5efb211f1c0d30c (diff) | |
| download | emacs-82fb8701c275cccf4c06e6b7b0a9364ae2072803.tar.gz emacs-82fb8701c275cccf4c06e6b7b0a9364ae2072803.zip | |
Make 'g' (AKA revert-buffer) rerun the VC log, log-incoming and
log-outgoing commands.
* lisp/vc/vc.el (vc-log-internal-common): Add a new argument and use it
to create a buffer local revert-buffer-function variable.
(vc-print-log-internal, vc-log-incoming, vc-log-outgoing): Pass a
revert-buffer-function lambda.
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/vc/vc.el | 36 |
2 files changed, 37 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8bafd2b7713..796e7753397 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2010-10-03 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 2 | |||
| 3 | Make 'g' (AKA revert-buffer) rerun the VC log, log-incoming and | ||
| 4 | log-outgoing commands. | ||
| 5 | * vc/vc.el (vc-log-internal-common): Add a new argument and use it | ||
| 6 | to create a buffer local revert-buffer-function variable. | ||
| 7 | (vc-print-log-internal, vc-log-incoming, vc-log-outgoing): Pass a | ||
| 8 | revert-buffer-function lambda. | ||
| 9 | |||
| 1 | 2010-10-03 Teodor Zlatanov <tzz@lifelogs.com> | 10 | 2010-10-03 Teodor Zlatanov <tzz@lifelogs.com> |
| 2 | 11 | ||
| 3 | * net/gnutls.el (starttls-negotiate): Use the plist interface to | 12 | * net/gnutls.el (starttls-negotiate): Use the plist interface to |
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 8b6fc602a2c..665dafb10df 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el | |||
| @@ -2027,8 +2027,10 @@ Not all VC backends support short logs!") | |||
| 2027 | (setq type (if vc-short-log 'short 'long)) | 2027 | (setq type (if vc-short-log 'short 'long)) |
| 2028 | (lexical-let | 2028 | (lexical-let |
| 2029 | ((working-revision working-revision) | 2029 | ((working-revision working-revision) |
| 2030 | (backend backend) | ||
| 2030 | (limit limit) | 2031 | (limit limit) |
| 2031 | (shortlog vc-short-log) | 2032 | (shortlog vc-short-log) |
| 2033 | (files files) | ||
| 2032 | (is-start-revision is-start-revision)) | 2034 | (is-start-revision is-start-revision)) |
| 2033 | (vc-log-internal-common | 2035 | (vc-log-internal-common |
| 2034 | backend buffer-name files type | 2036 | backend buffer-name files type |
| @@ -2039,7 +2041,9 @@ Not all VC backends support short logs!") | |||
| 2039 | (vc-print-log-setup-buttons working-revision | 2041 | (vc-print-log-setup-buttons working-revision |
| 2040 | is-start-revision limit ret)) | 2042 | is-start-revision limit ret)) |
| 2041 | (lambda (bk) | 2043 | (lambda (bk) |
| 2042 | (vc-call-backend bk 'show-log-entry working-revision)))))) | 2044 | (vc-call-backend bk 'show-log-entry working-revision)) |
| 2045 | (lambda (ignore-auto noconfirm) | ||
| 2046 | (vc-print-log-internal backend files working-revision is-start-revision limit)))))) | ||
| 2043 | 2047 | ||
| 2044 | (defvar vc-log-view-type nil | 2048 | (defvar vc-log-view-type nil |
| 2045 | "Set this to differentiate the different types of logs.") | 2049 | "Set this to differentiate the different types of logs.") |
| @@ -2051,7 +2055,8 @@ Not all VC backends support short logs!") | |||
| 2051 | type | 2055 | type |
| 2052 | backend-func | 2056 | backend-func |
| 2053 | setup-buttons-func | 2057 | setup-buttons-func |
| 2054 | goto-location-func) | 2058 | goto-location-func |
| 2059 | rev-buff-func) | ||
| 2055 | (let (retval) | 2060 | (let (retval) |
| 2056 | (with-current-buffer (get-buffer-create buffer-name) | 2061 | (with-current-buffer (get-buffer-create buffer-name) |
| 2057 | (set (make-local-variable 'vc-log-view-type) type)) | 2062 | (set (make-local-variable 'vc-log-view-type) type)) |
| @@ -2062,7 +2067,9 @@ Not all VC backends support short logs!") | |||
| 2062 | ;; to t, so let's keep doing it, just in case. | 2067 | ;; to t, so let's keep doing it, just in case. |
| 2063 | (vc-call-backend backend 'log-view-mode) | 2068 | (vc-call-backend backend 'log-view-mode) |
| 2064 | (set (make-local-variable 'log-view-vc-backend) backend) | 2069 | (set (make-local-variable 'log-view-vc-backend) backend) |
| 2065 | (set (make-local-variable 'log-view-vc-fileset) files)) | 2070 | (set (make-local-variable 'log-view-vc-fileset) files) |
| 2071 | (set (make-local-variable 'revert-buffer-function) | ||
| 2072 | rev-buff-func)) | ||
| 2066 | (vc-exec-after | 2073 | (vc-exec-after |
| 2067 | `(let ((inhibit-read-only t)) | 2074 | `(let ((inhibit-read-only t)) |
| 2068 | (funcall ',setup-buttons-func ',backend ',files ',retval) | 2075 | (funcall ',setup-buttons-func ',backend ',files ',retval) |
| @@ -2080,7 +2087,14 @@ Not all VC backends support short logs!") | |||
| 2080 | (vc-call-backend bk type-arg buf remote-location))) | 2087 | (vc-call-backend bk type-arg buf remote-location))) |
| 2081 | (lambda (bk files-arg ret)) | 2088 | (lambda (bk files-arg ret)) |
| 2082 | (lambda (bk) | 2089 | (lambda (bk) |
| 2083 | (goto-char (point-min))))) | 2090 | (goto-char (point-min))) |
| 2091 | (lexical-let | ||
| 2092 | ((backend backend) | ||
| 2093 | (remote-location remote-location) | ||
| 2094 | (buffer-name buffer-name) | ||
| 2095 | (type type)) | ||
| 2096 | (lambda (ignore-auto noconfirm) | ||
| 2097 | (vc-incoming-outgoing-internal backend remote-location buffer-name type))))) | ||
| 2084 | 2098 | ||
| 2085 | ;;;###autoload | 2099 | ;;;###autoload |
| 2086 | (defun vc-print-log (&optional working-revision limit) | 2100 | (defun vc-print-log (&optional working-revision limit) |
| @@ -2140,8 +2154,11 @@ When called interactively with a prefix argument, prompt for LIMIT." | |||
| 2140 | 2154 | ||
| 2141 | ;;;###autoload | 2155 | ;;;###autoload |
| 2142 | (defun vc-log-incoming (&optional remote-location) | 2156 | (defun vc-log-incoming (&optional remote-location) |
| 2143 | "Show a log of changes that will be received with a pull operation from REMOTE-LOCATION." | 2157 | "Show a log of changes that will be received with a pull operation from REMOTE-LOCATION. |
| 2144 | (interactive "sRemote location (empty for default): ") | 2158 | When called interactively with a prefix argument, prompt for REMOTE-LOCATION.." |
| 2159 | (interactive | ||
| 2160 | (when current-prefix-arg | ||
| 2161 | (list (read-string "Remote location (empty for default): ")))) | ||
| 2145 | (let ((backend (vc-deduce-backend)) | 2162 | (let ((backend (vc-deduce-backend)) |
| 2146 | rootdir working-revision) | 2163 | rootdir working-revision) |
| 2147 | (unless backend | 2164 | (unless backend |
| @@ -2150,8 +2167,11 @@ When called interactively with a prefix argument, prompt for LIMIT." | |||
| 2150 | 2167 | ||
| 2151 | ;;;###autoload | 2168 | ;;;###autoload |
| 2152 | (defun vc-log-outgoing (&optional remote-location) | 2169 | (defun vc-log-outgoing (&optional remote-location) |
| 2153 | "Show a log of changes that will be sent with a push operation to REMOTE-LOCATION." | 2170 | "Show a log of changes that will be sent with a push operation to REMOTE-LOCATION. |
| 2154 | (interactive "sRemote location (empty for default): ") | 2171 | When called interactively with a prefix argument, prompt for REMOTE-LOCATION." |
| 2172 | (interactive | ||
| 2173 | (when current-prefix-arg | ||
| 2174 | (list (read-string "Remote location (empty for default): ")))) | ||
| 2155 | (let ((backend (vc-deduce-backend)) | 2175 | (let ((backend (vc-deduce-backend)) |
| 2156 | rootdir working-revision) | 2176 | rootdir working-revision) |
| 2157 | (unless backend | 2177 | (unless backend |