(vc-ignore (vc-dir-fileinfo->name filearg))
t))
vc-ewoc)
- (vc-ignore
- (file-relative-name (vc-dir-current-file))
- default-directory)))
+ (let ((rel-dir (vc--ignore-base-dir)))
+ (vc-ignore
+ (file-relative-name (vc-dir-current-file) rel-dir)
+ rel-dir))))
(defun vc-dir-current-file ()
(let ((node (ewoc-locate vc-ewoc)))
prefix argument is given, in which case prompt for a file FILE to
remove from the list of ignored files."
(interactive
- (let* ((backend (vc-responsible-backend default-directory))
- (rel-dir
- (condition-case nil
- (file-name-directory
- (vc-call-backend backend 'find-ignore-file
- default-directory))
- (vc-not-supported
- default-directory)))
+ (let* ((rel-dir (vc--ignore-base-dir))
(file (read-file-name "File to ignore: ")))
(when (and (file-name-absolute-p file)
(file-in-directory-p file rel-dir))
(error "Unknown backend"))))
(vc-call-backend backend 'ignore file directory remove)))
+(defun vc--ignore-base-dir ()
+ (let ((backend (vc-responsible-backend default-directory)))
+ (condition-case nil
+ (file-name-directory
+ (vc-call-backend backend 'find-ignore-file
+ default-directory))
+ (vc-not-supported
+ default-directory))))
+
(defun vc-default-ignore (backend file &optional directory remove)
"Ignore FILE under DIRECTORY (default is `default-directory').
FILE is a wildcard specification relative to DIRECTORY.