all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] vc-dir-hide-some-states: New command
@ 2012-08-08 14:56 Jambunathan K
  2012-08-08 15:15 ` Jambunathan K
  0 siblings, 1 reply; 2+ messages in thread
From: Jambunathan K @ 2012-08-08 14:56 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 68 bytes --]


I am attaching a bzr bundle.  Can someone review and commit this?


[-- Attachment #2: vc-dir-hide-some-states.txt --]
[-- Type: text/plain, Size: 9890 bytes --]

# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: kjambunathan@gmail.com-20120808144428-8msbw7xveglogy9b
# target_branch: bzr://bzr.savannah.gnu.org/emacs/trunk/
# testament_sha1: 0a43bb0d585f74c15f549d63dc6a08fa44154d2d
# timestamp: 2012-08-08 20:17:20 +0530
# source_branch: bzr://bzr.savannah.gnu.org/emacs/trunk
# base_revision_id: michael.albinus@gmx.de-20120808134045-\
#   t26l1voivvzfypey
# 
# Begin patch
=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog	2012-08-08 13:40:45 +0000
+++ lisp/ChangeLog	2012-08-08 14:44:28 +0000
@@ -1,3 +1,11 @@
+2012-08-08  Jambunathan K  <kjambunathan@gmail.com>
+
+	* vc/vc-dir.el (vc-dir-hide-these-states): New custom variable.
+	(vc-dir-hide-some-states): New command.
+	(vc-dir-hide-up-to-date): Use `vc-dir-hide-vc-states'.
+	(vc-dir-mode-map): Map "x" to `vc-dir-hide-vc-states' instead of
+	`vc-dir-hide-up-to-date'.
+
 2012-08-08  Michael Albinus  <michael.albinus@gmx.de>
 
 	* net/tramp-sh.el (tramp-find-file-exists-command): Protect the

=== modified file 'lisp/vc/vc-dir.el'
--- lisp/vc/vc-dir.el	2012-07-11 23:13:41 +0000
+++ lisp/vc/vc-dir.el	2012-08-08 14:44:28 +0000
@@ -51,6 +51,25 @@
   :type 'hook
   :group 'vc)
 
+(defcustom vc-dir-hide-these-states '("up-to-date")
+  "States hidden by `vc-dir-hide-some-states'."
+  :type '(choice
+	  (const :tag "None")
+	  (set :tag "Choices"
+	       (string :tag "VC State" "added")
+	       (string :tag "VC State" "conflict")
+	       (string :tag "VC State" "edited")
+	       (string :tag "VC State" "ignored")
+	       (string :tag "VC State" "missing")
+	       (string :tag "VC State" "needs-merge")
+	       (string :tag "VC State" "needs-update")
+	       (string :tag "VC State" "removed")
+	       (string :tag "VC State" "unlocked-changes")
+	       (string :tag "VC State" "unregistered")
+	       (string :tag "VC State" "up-to-date")))
+  :group 'vc
+  :version "24.2")
+
 ;; Used to store information for the files displayed in the directory buffer.
 ;; Each item displayed corresponds to one of these defstructs.
 (cl-defstruct (vc-dir-fileinfo
@@ -271,7 +290,7 @@
     (define-key map [down-mouse-3] 'vc-dir-menu)
     (define-key map [mouse-2] 'vc-dir-toggle-mark)
     (define-key map [follow-link] 'mouse-face)
-    (define-key map "x" 'vc-dir-hide-up-to-date)
+    (define-key map "x" 'vc-dir-hide-some-states)
     (define-key map [?\C-k] 'vc-dir-kill-line)
     (define-key map "S" 'vc-dir-search) ;; FIXME: Maybe use A like dired?
     (define-key map "Q" 'vc-dir-query-replace-regexp)
@@ -1106,20 +1125,56 @@
   (interactive "fShow file: ")
   (vc-dir-update (list (list (file-relative-name file) (vc-state file))) (current-buffer)))
 
-(defun vc-dir-hide-up-to-date ()
-  "Hide up-to-date items from display."
-  (interactive)
-  (let ((crt (ewoc-nth vc-ewoc -1))
-	(first (ewoc-nth vc-ewoc 0)))
-    ;; Go over from the last item to the first and remove the
-    ;; up-to-date files and directories with no child files.
-    (while (not (eq crt first))
-      (let* ((data (ewoc-data crt))
-	     (dir (vc-dir-fileinfo->directory data))
-	     (next (ewoc-next vc-ewoc crt))
-	     (prev (ewoc-prev vc-ewoc crt))
-	     ;; ewoc-delete does not work without this...
-	     (inhibit-read-only t))
+(defun vc-dir-hide-some-states (&optional states)
+  "Hide items that are in STATES from display.
+STATES is a list of vc states (see`vc-state') specified as a
+string.
+
+If STATES is null, use `vc-dir-hide-these-states'.
+
+In interactive mode, if you provide a prefix argument or if
+`vc-dir-hide-these-states' is nil, you will be queried for a state
+to hide."
+  (interactive
+   ;; Interactive use.
+   (list
+    (or (and (not current-prefix-arg) vc-dir-hide-these-states)
+	;; No prefix arg or `vc-dir-hide-these-states' is nil.  Prompt
+	;; for a state to hide.
+	(let ((crt (ewoc-nth vc-ewoc -1))
+	      (first (ewoc-nth vc-ewoc 0))
+	      displayed-states)
+	  ;; Collect all the states that are on display.
+	  (while (not (eq crt first))
+	    (let* ((data (ewoc-data crt))
+		   (dir (vc-dir-fileinfo->directory data))
+		   (prev (ewoc-prev vc-ewoc crt)))
+	      (when (not dir)
+		(let ((s (vc-dir-fileinfo->state data)))
+		  (unless (member s displayed-states)
+		    (push (format "%s" s) displayed-states))))
+	      (setq crt prev)))
+	  ;; Query the user for a state to hide.
+	  (when displayed-states
+	    (list (completing-read "States to hide: "
+				   displayed-states nil t)))))))
+
+  ;; Non-interactive use.
+  (unless (called-interactively-p 'any)
+    (setq states (or states vc-dir-hide-these-states)))
+
+  (when states
+    (let ((crt (ewoc-nth vc-ewoc -1))
+	  (first (ewoc-nth vc-ewoc 0)))
+      ;; Go over from the last item to the first and remove the
+      ;; up-to-date files and directories with no child files.
+      (while (not (eq crt first))
+	(let* ((data (ewoc-data crt))
+	       (dir (vc-dir-fileinfo->directory data))
+	       (next (ewoc-next vc-ewoc crt))
+	       (prev (ewoc-prev vc-ewoc crt))
+	       ;; ewoc-delete does not work without this...
+	       (inhibit-read-only t))
 	  (when (or
 		 ;; Remove directories with no child files.
 		 (and dir
@@ -1128,10 +1183,15 @@
 		       (not next)
 		       ;; Next item is a directory.
 		       (vc-dir-fileinfo->directory (ewoc-data next))))
-		 ;; Remove files in the up-to-date state.
-		 (eq (vc-dir-fileinfo->state data) 'up-to-date))
+		 ;; Remove files that are to be hidden.
+		 (member (format "%s" (vc-dir-fileinfo->state data)) states))
 	    (ewoc-delete vc-ewoc crt))
-	  (setq crt prev)))))
+	  (setq crt prev))))))
+
+(defun vc-dir-hide-up-to-date ()
+  "Hide up-to-date items from display."
+  (interactive)
+  (vc-dir-hide-some-states '("up-to-date")))
 
 (defun vc-dir-kill-line ()
   "Remove the current line from display."

# Begin bundle
IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWULZDS4ACD1fgFgwU/f//3r/
fwD////wYA2910rPdveG991oPR8iyZTnl7nbevV9989XtGoo7Z9rM5gfcQkoJoAQyZJPBqbVP1MU
DQAAAAAEoSaMIGk0TaJpANAAGgAAaGgDEERKbNJPSeE9UZGIAaDAgxGAEYEmpE0ingKmnqeKP1TJ
+UT1PU00MTQBo0D1AAIoimTQNBGlP2kyT01R6nkmTT1GgGgAGmagRSJoAJo0CaSbJPKnqfoU9T1P
U8oBo0AA0ar4ApkUAqYIKEEQUEVgZ3DdkYdasRhCUSP0hogMEsrG1+zi2ZpIucaBr21NAKSoiZW1
8e7h+B4K5L6i1uTstN57Xf37nopoydxfTerFX+/dbXXgMBcvW1uV0mrLeJggqCEVBNY15JZ6csmp
RiYz1Yb9WJU0z7+HGEkLziKsYkBXihVmiiihRVjVV6NfDLs6Tu43FPXUh7chzpxpgw4cQOUV/5qd
EUyFQ6Bz/qxtXVCJfg4eqw0Gy1v3QwcjKDPdmqpApVWJp7pJfxb8sS5ZhmRF5WsxCksXMCLDFkwt
dqhxIVYaqNVIpFVEoOMOAZyQwORXn6FrgLyHDoPsbxInvz6PdFMCauikB5GFu/MT5B7w8xwbq5zO
UyXe8jZo89vRC2LAalX8mnPF8GFoDuaNXmxwi4W56ZWjddC5OwpOx/BrrrCGwQO+tlABVZKm7MM1
lRnFcbWgi40xZ5pdWhrC91zE7ZW2iMceY0hPyOd0euKenZF2wrSNw7Hr583NTDwzrKur8Ez9Hlcz
djwvLZvOffTRwK1tb0PsmaBjbttLyAgqMIk+qNAz3ix3pYNFLKDsiQUuHm84y3pZD6GUz5clapLI
UlNYoyS15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[PATCH] vc-dir-hide-some-states: New command
  2012-08-08 14:56 [PATCH] vc-dir-hide-some-states: New command Jambunathan K
@ 2012-08-08 15:15 ` Jambunathan K
  0 siblings, 0 replies; 2+ messages in thread
From: Jambunathan K @ 2012-08-08 15:15 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 442 bytes --]

Jambunathan K <kjambunathan@gmail.com> writes:

> I am attaching a bzr bundle.  Can someone review and commit this?

There were some typos in the changelog.  I am attaching the revised
bundle.  It has 4 revisions.

In git world, I would have preferred to do this:

  git reset --soft origin/master # squash all the commits
  git format-patch

so as to show only my good face to the world.

Looks like bzr is working against my intentions.
  

[-- Attachment #2: vc-dir-hide-some-states.txt --]
[-- Type: text/plain, Size: 10251 bytes --]

# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: kjambunathan@gmail.com-20120808150232-cvekujrpotm9qlwa
# target_branch: bzr://bzr.savannah.gnu.org/emacs/trunk/
# testament_sha1: 467acf56b28d7d9ee4be3368d2467cea25251eac
# timestamp: 2012-08-08 20:34:32 +0530
# source_branch: bzr://bzr.savannah.gnu.org/emacs/trunk
# base_revision_id: michael.albinus@gmx.de-20120808134045-\
#   t26l1voivvzfypey
# 
# Begin patch
=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog	2012-08-08 13:40:45 +0000
+++ lisp/ChangeLog	2012-08-08 15:02:32 +0000
@@ -1,3 +1,11 @@
+2012-08-08  Jambunathan K  <kjambunathan@gmail.com>
+
+	* vc/vc-dir.el (vc-dir-hide-these-states): New custom variable.
+	(vc-dir-hide-some-states): New command.
+	(vc-dir-hide-up-to-date): Use `vc-dir-hide-some-states'.
+	(vc-dir-mode-map): Map "x" to `vc-dir-hide-some-states' instead of
+	`vc-dir-hide-up-to-date'.
+
 2012-08-08  Michael Albinus  <michael.albinus@gmx.de>
 
 	* net/tramp-sh.el (tramp-find-file-exists-command): Protect the

=== modified file 'lisp/vc/vc-dir.el'
--- lisp/vc/vc-dir.el	2012-07-11 23:13:41 +0000
+++ lisp/vc/vc-dir.el	2012-08-08 14:44:28 +0000
@@ -51,6 +51,25 @@
   :type 'hook
   :group 'vc)
 
+(defcustom vc-dir-hide-these-states '("up-to-date")
+  "States hidden by `vc-dir-hide-some-states'."
+  :type '(choice
+	  (const :tag "None")
+	  (set :tag "Choices"
+	       (string :tag "VC State" "added")
+	       (string :tag "VC State" "conflict")
+	       (string :tag "VC State" "edited")
+	       (string :tag "VC State" "ignored")
+	       (string :tag "VC State" "missing")
+	       (string :tag "VC State" "needs-merge")
+	       (string :tag "VC State" "needs-update")
+	       (string :tag "VC State" "removed")
+	       (string :tag "VC State" "unlocked-changes")
+	       (string :tag "VC State" "unregistered")
+	       (string :tag "VC State" "up-to-date")))
+  :group 'vc
+  :version "24.2")
+
 ;; Used to store information for the files displayed in the directory buffer.
 ;; Each item displayed corresponds to one of these defstructs.
 (cl-defstruct (vc-dir-fileinfo
@@ -271,7 +290,7 @@
     (define-key map [down-mouse-3] 'vc-dir-menu)
     (define-key map [mouse-2] 'vc-dir-toggle-mark)
     (define-key map [follow-link] 'mouse-face)
-    (define-key map "x" 'vc-dir-hide-up-to-date)
+    (define-key map "x" 'vc-dir-hide-some-states)
     (define-key map [?\C-k] 'vc-dir-kill-line)
     (define-key map "S" 'vc-dir-search) ;; FIXME: Maybe use A like dired?
     (define-key map "Q" 'vc-dir-query-replace-regexp)
@@ -1106,20 +1125,56 @@
   (interactive "fShow file: ")
   (vc-dir-update (list (list (file-relative-name file) (vc-state file))) (current-buffer)))
 
-(defun vc-dir-hide-up-to-date ()
-  "Hide up-to-date items from display."
-  (interactive)
-  (let ((crt (ewoc-nth vc-ewoc -1))
-	(first (ewoc-nth vc-ewoc 0)))
-    ;; Go over from the last item to the first and remove the
-    ;; up-to-date files and directories with no child files.
-    (while (not (eq crt first))
-      (let* ((data (ewoc-data crt))
-	     (dir (vc-dir-fileinfo->directory data))
-	     (next (ewoc-next vc-ewoc crt))
-	     (prev (ewoc-prev vc-ewoc crt))
-	     ;; ewoc-delete does not work without this...
-	     (inhibit-read-only t))
+(defun vc-dir-hide-some-states (&optional states)
+  "Hide items that are in STATES from display.
+STATES is a list of vc states (see`vc-state') specified as a
+string.
+
+If STATES is null, use `vc-dir-hide-these-states'.
+
+In interactive mode, if you provide a prefix argument or if
+`vc-dir-hide-these-states' is nil, you will be queried for a state
+to hide."
+  (interactive
+   ;; Interactive use.
+   (list
+    (or (and (not current-prefix-arg) vc-dir-hide-these-states)
+	;; No prefix arg or `vc-dir-hide-these-states' is nil.  Prompt
+	;; for a state to hide.
+	(let ((crt (ewoc-nth vc-ewoc -1))
+	      (first (ewoc-nth vc-ewoc 0))
+	      displayed-states)
+	  ;; Collect all the states that are on display.
+	  (while (not (eq crt first))
+	    (let* ((data (ewoc-data crt))
+		   (dir (vc-dir-fileinfo->directory data))
+		   (prev (ewoc-prev vc-ewoc crt)))
+	      (when (not dir)
+		(let ((s (vc-dir-fileinfo->state data)))
+		  (unless (member s displayed-states)
+		    (push (format "%s" s) displayed-states))))
+	      (setq crt prev)))
+	  ;; Query the user for a state to hide.
+	  (when displayed-states
+	    (list (completing-read "States to hide: "
+				   displayed-states nil t)))))))
+
+  ;; Non-interactive use.
+  (unless (called-interactively-p 'any)
+    (setq states (or states vc-dir-hide-these-states)))
+
+  (when states
+    (let ((crt (ewoc-nth vc-ewoc -1))
+	  (first (ewoc-nth vc-ewoc 0)))
+      ;; Go over from the last item to the first and remove the
+      ;; up-to-date files and directories with no child files.
+      (while (not (eq crt first))
+	(let* ((data (ewoc-data crt))
+	       (dir (vc-dir-fileinfo->directory data))
+	       (next (ewoc-next vc-ewoc crt))
+	       (prev (ewoc-prev vc-ewoc crt))
+	       ;; ewoc-delete does not work without this...
+	       (inhibit-read-only t))
 	  (when (or
 		 ;; Remove directories with no child files.
 		 (and dir
@@ -1128,10 +1183,15 @@
 		       (not next)
 		       ;; Next item is a directory.
 		       (vc-dir-fileinfo->directory (ewoc-data next))))
-		 ;; Remove files in the up-to-date state.
-		 (eq (vc-dir-fileinfo->state data) 'up-to-date))
+		 ;; Remove files that are to be hidden.
+		 (member (format "%s" (vc-dir-fileinfo->state data)) states))
 	    (ewoc-delete vc-ewoc crt))
-	  (setq crt prev)))))
+	  (setq crt prev))))))
+
+(defun vc-dir-hide-up-to-date ()
+  "Hide up-to-date items from display."
+  (interactive)
+  (vc-dir-hide-some-states '("up-to-date")))
 
 (defun vc-dir-kill-line ()
   "Remove the current line from display."

# Begin bundle
IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWcpGCo8ACZVfgFgwU/f//3v/
fwD////wYA9fds81t4s433dV6QkpSqdsTvU862epfdnT6+etrLW9l21ToGd3owkhTRGRko/VPE9U
8nqjbSam0mg0GgAA0NDQJKCYmE0JijJPUZQ0AAxAAAAZA0UzUp6noAAAAAAAAAAAAkKaUTQ0ZqjJ
psoDJ6mQMhoAADQACKSajVPPUnqT9TageiHqjxIDINBoNAAAAkSCAJoAEApmEJBptT1A0AAPUGE6
gQ0mwCFUQ2CGMGwY20iyYaoDA7G0ZLMIZENJiMsMAzhtKA/199dBP5A8UI0k5jbQKAdhwYYniunh
6a/idx/cNsZveTRmbDNMp7Tgz29ltMOCj2E8Jz2un7uzKtcSBGU8+M3NxfFhjwhFzAVzSXAjNXvC
6lHAQVCtlMG586q6QNbd+zsQki60jbaaYgbelhLOEIQbG205J48uF9W8c+mhs+ESNCR9g6i24WLG
sah3/FWyDMBo/ZEvs5c1uLGV2QSZkYjLEflgnNhITBeFToRBttjTMnOgK3818QUEh0mjQn1Yh3CK
wOZ3Uum07qzffFpIoO1zdjVjoVnbO2UVZIzwLkhxdptYeJPmRrFBDEbPOkSO92+vU8NGoeZVwweo
7o+Ko31BL0h4HjU8LFh1J+kZyv7sc9mgSZiNu/01D+J4SaM1B3oxf5zTPFwy2C5VG+UVl7LChHDq
295CbN56oygIizaKv2nbKJzI5txBXUMueELxIKMOx2hlGux8lBB6DOFW85dFGqVWX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BNjbYFhXMzSWpI7Yv6a8jJRvPpUkU
pHNyVShIygxtpZOrT1Q7i1GepLsvxCgoBQBbmhXoP5JDSGMbBKYXsBVCRejcFyUqJCMQXvBDAHpA
ngWAY9wXsFgK30JpqUBRMUasKCLICCiCxBjgTJhRolUKiH1PaAnTAafH15ToFVtDgQuDihbkgTZA
1G4sq0EA4XbN+LFxhuzOtWjlekTgGbX2wD3yyFiS/zOq+dJqzkUiq1hnnzlkr5UEoo3Vp2WNrvTs
gsBnnBnZFoh1LiXoWodYl4OrWNybjqExAFaBVqANwSjnCO6uN5jSjI3YAOoGKHGMjblvSkFrATXU
D6maWl2pdU7V31yBZaeM/4u5IpwoSGUjBUeA

[-- Attachment #3: Type: text/plain, Size: 4 bytes --]

-- 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-08-08 15:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-08 14:56 [PATCH] vc-dir-hide-some-states: New command Jambunathan K
2012-08-08 15:15 ` Jambunathan K

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.