emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r115751: Some fixes for vc-ignore (Bug#15754).


From: Xue Fuqiao
Subject: [Emacs-diffs] trunk r115751: Some fixes for vc-ignore (Bug#15754).
Date: Wed, 25 Dec 2013 22:57:06 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115751 [merge]
revision-id: address@hidden
parent: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/15754
committer: Xue Fuqiao <address@hidden>
branch nick: trunk
timestamp: Thu 2013-12-26 06:57:00 +0800
message:
  Some fixes for vc-ignore (Bug#15754).
  
  Inspired by Andreas Politz and Dmitry Gutov.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/vc/vc.el                  vc.el-20091113204419-o5vbwnq5f7feedwu-502
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-12-25 22:53:57 +0000
+++ b/lisp/ChangeLog    2013-12-25 22:57:00 +0000
@@ -1,3 +1,8 @@
+2013-12-25  Xue Fuqiao  <address@hidden>
+
+       * vc/vc.el (vc-ignore): Use `vc-responsible-backend'.
+       Fix interactive spec.  Doc fix.  (Bug#15754)
+
 2013-12-25  Katsumi Yamaoka  <address@hidden>
 
        * emacs-lisp/byte-run.el (eval-when-compile):

=== modified file 'lisp/vc/vc.el'
--- a/lisp/vc/vc.el     2013-11-26 19:17:55 +0000
+++ b/lisp/vc/vc.el     2013-12-25 22:24:37 +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, prompt for a FILE to ignore, 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: ")
-        (completing-read
-         "The file to remove: "
-         (vc-call-backend
-          (vc-backend default-directory)
-          'ignore-completion-table default-directory))))
+   (list
+    (if (not current-prefix-arg)
+        (read-file-name "File to ignore: ")
+      (completing-read
+       "File to remove: "
+       (vc-call-backend
+        (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)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]