GNU bug report logs - #15754
24.3.50; [PATCH] vc-ignore makes no sense

Previous Next

Package: emacs;

Reported by: Andreas Politz <politza <at> hochschule-trier.de>

Date: Wed, 30 Oct 2013 12:40:01 UTC

Severity: normal

Tags: patch

Found in version 24.3.50

Done: Xue Fuqiao <xfq.free <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Xue Fuqiao <xfq.free <at> gmail.com>
To: 15754 <at> debbugs.gnu.org
Cc: politza <at> hochschule-trier.de, dgutov <at> yandex.ru
Subject: bug#15754: 24.3.50; [PATCH] vc-ignore makes no sense
Date: Wed, 25 Dec 2013 10:35:05 +0800
I reorganized the doc string.  Here's the new patch:

=== modified file 'lisp/vc/vc.el'
--- lisp/vc/vc.el 2013-11-26 19:17:55 +0000
+++ lisp/vc/vc.el 2013-12-25 02:28:57 +0000
@@ -1343,23 +1343,33 @@
   (let ((vc-handled-backends (list backend)))
     (call-interactively 'vc-register)))

-(defun vc-ignore (file &optional directory)
-  "Ignore FILE under the VCS of DIRECTORY (default is `default-directory').
-FILE is a file wildcard.
-When called interactively and with a prefix argument, remove FILE
-from ignored files.
-When called from Lisp code, if DIRECTORY is non-nil, the
-repository to use will be deduced by DIRECTORY."
+(defun vc-ignore (file &optional directory remove)
+  "Ignore FILE under the VCS of DIRECTORY.
+
+Normally, FILE is a wildcard specification that matches the files
+to be ignored.  When REMOVE is non-nil, remove FILE from the list
+of ignored files.
+
+DIRECTORY defaults to `default-directory' and is used to
+determine the responsible VC backend.
+
+When called interactively, ignore FILE, unless a prefix argument
+is given, in which case prompt for a file FILE to remove from the
+list of ignored files."
   (interactive
-   (list (read-file-name "The file to ignore: ")
+   (list
+    (if (not current-prefix-arg)
+        (read-file-name "File to ignore: ")
  (completing-read
-  "The file to remove: "
+       "File to remove: "
   (vc-call-backend
-   (vc-backend default-directory)
-   'ignore-completion-table default-directory))))
+        (or (vc-responsible-backend default-directory)
+            (error "Unknown backend"))
+        'ignore-completion-table default-directory)))
+    nil current-prefix-arg))
   (let* ((directory (or directory default-directory))
- (backend (vc-backend default-directory))
- (remove current-prefix-arg))
+ (backend (or (vc-responsible-backend default-directory)
+                      (error "Unknown backend"))))
     (vc-call-backend backend 'ignore file directory remove)))

 (defun vc-default-ignore (backend file &optional directory remove)


-- 
http://www.gnu.org/software/emacs/




This bug report was last modified 11 years and 146 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.