]> code.delx.au - gnu-emacs/commitdiff
Make sure that the ignore file exists origin/project-next
authorDmitry Gutov <dgutov@yandex.ru>
Mon, 9 Nov 2015 02:32:36 +0000 (04:32 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Mon, 9 Nov 2015 02:32:36 +0000 (04:32 +0200)
* lisp/vc/vc.el (vc-default-ignore-completion-table):
Make sure that the ignore file exists.

lisp/vc/vc.el

index f08e562efe5a3e2a0365d394ffc4f2b6279fb234..0a2169534e569565427b44af289e1ec92a18e424 100644 (file)
@@ -1433,8 +1433,9 @@ Argument BACKEND is the backend you are using."
    (lambda (str)
      ;; Commented or empty lines.
      (string-match-p "\\`\\(?:#\\|[ \t\r\n]*\\'\\)" str))
-   (vc--read-lines
-    (vc-call-backend backend 'find-ignore-file file))))
+   (let ((file (vc-call-backend backend 'find-ignore-file file)))
+     (and (file-exists-p file)
+          (vc--read-lines file)))))
 
 (defun vc--read-lines (file)
   "Return a list of lines of FILE."