all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Xue Fuqiao <xfq.free@gmail.com>
To: 15754@debbugs.gnu.org
Cc: politza@hochschule-trier.de, dgutov@yandex.ru
Subject: bug#15754: 24.3.50; [PATCH] vc-ignore makes no sense
Date: Wed, 25 Dec 2013 10:35:05 +0800	[thread overview]
Message-ID: <CAAF+z6F9G8aGjmZ0uQfpTi+q9SsGjbc0J9Y+9xVXoHweUbusig@mail.gmail.com> (raw)
In-Reply-To: <87a9hrrl0p.fsf@hochschule-trier.de>

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/





  parent reply	other threads:[~2013-12-25  2:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-30 12:38 bug#15754: 24.3.50; [PATCH] vc-ignore makes no sense Andreas Politz
2013-12-07  3:07 ` Dmitry Gutov
2013-12-25  2:35 ` Xue Fuqiao [this message]
2013-12-25 17:37   ` Dmitry Gutov
2013-12-25 23:09 ` Xue Fuqiao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAF+z6F9G8aGjmZ0uQfpTi+q9SsGjbc0J9Y+9xVXoHweUbusig@mail.gmail.com \
    --to=xfq.free@gmail.com \
    --cc=15754@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=politza@hochschule-trier.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.