aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2014-11-10 03:29:58 +0200
committerDmitry Gutov2014-11-10 03:29:58 +0200
commit91982ede583f0575844feb8b4c73de9529bb0876 (patch)
tree66b3e8f87e762ef36eb3e2a27826f2e5ff4de9e5
parentf452367d4a90ac098070a37f20e551984f12e5c2 (diff)
downloademacs-91982ede583f0575844feb8b4c73de9529bb0876.tar.gz
emacs-91982ede583f0575844feb8b4c73de9529bb0876.zip
Fix bug#18964
* lisp/vc/vc-dir.el (vc-dir-hide-state): Also hide `ignored' items when no state is specified.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/vc/vc-dir.el16
2 files changed, 14 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a01dadad706..572de2ed950 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12014-11-10 Dmitry Gutov <dgutov@yandex.ru>
2
3 * vc/vc-dir.el (vc-dir-hide-state): Also hide `ignored' items when
4 no state is specified. (Bug#18964)
5
12014-11-09 Eric Ludlam <zappo@gnu.org> 62014-11-09 Eric Ludlam <zappo@gnu.org>
2 7
3 * emacs-lisp/eieio-custom.el (eieio-customize-object): Set 8 * emacs-lisp/eieio-custom.el (eieio-customize-object): Set
diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index be3b1fa94b5..a26287aa0f7 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -1125,18 +1125,18 @@ outside of VC) and one wants to do some operation on it."
1125 "Hide items that are in STATE from display. 1125 "Hide items that are in STATE from display.
1126See `vc-state' for valid values of STATE. 1126See `vc-state' for valid values of STATE.
1127 1127
1128If STATE is nil, default it to up-to-date. 1128If STATE is nil, hide both `up-to-date' and `ignored' items.
1129 1129
1130Interactively, if `current-prefix-arg' is non-nil, set STATE to 1130Interactively, if `current-prefix-arg' is non-nil, set STATE to
1131state of item at point. Otherwise, set STATE to up-to-date." 1131state of item at point, if any."
1132 (interactive (list 1132 (interactive (list
1133 (and current-prefix-arg 1133 (and current-prefix-arg
1134 ;; Command is prefixed. Infer STATE from point. 1134 ;; Command is prefixed. Infer STATE from point.
1135 (let ((node (ewoc-locate vc-ewoc))) 1135 (let ((node (ewoc-locate vc-ewoc)))
1136 (and node (vc-dir-fileinfo->state (ewoc-data node))))))) 1136 (and node (vc-dir-fileinfo->state (ewoc-data node)))))))
1137 ;; If STATE is un-specified, use up-to-date. 1137 (if state
1138 (setq state (or state 'up-to-date)) 1138 (message "Hiding items in state \"%s\"" state)
1139 (message "Hiding items in state \"%s\"" state) 1139 (message "Hiding up-to-date and ignored items"))
1140 (let ((crt (ewoc-nth vc-ewoc -1)) 1140 (let ((crt (ewoc-nth vc-ewoc -1))
1141 (first (ewoc-nth vc-ewoc 0))) 1141 (first (ewoc-nth vc-ewoc 0)))
1142 ;; Go over from the last item to the first and remove the 1142 ;; Go over from the last item to the first and remove the
@@ -1157,8 +1157,10 @@ state of item at point. Otherwise, set STATE to up-to-date."
1157 ;; Next item is a directory. 1157 ;; Next item is a directory.
1158 (vc-dir-fileinfo->directory (ewoc-data next)))) 1158 (vc-dir-fileinfo->directory (ewoc-data next))))
1159 ;; Remove files in specified STATE. STATE can be a 1159 ;; Remove files in specified STATE. STATE can be a
1160 ;; symbol or a user-name. 1160 ;; symbol, a user-name, or nil.
1161 (equal (vc-dir-fileinfo->state data) state)) 1161 (if state
1162 (equal (vc-dir-fileinfo->state data) state)
1163 (memq (vc-dir-fileinfo->state data) '(up-to-date ignored))))
1162 (ewoc-delete vc-ewoc crt)) 1164 (ewoc-delete vc-ewoc crt))
1163 (setq crt prev))))) 1165 (setq crt prev)))))
1164 1166