summaryrefslogtreecommitdiff
path: root/lisp/pcmpl-cvs.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2015-05-23 12:06:23 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2015-05-23 12:06:23 -0400
commit2b0459cd8ed400ae9b2a993d2771055f227f9b55 (patch)
tree98d52bade8c6e6f424e6177845397bcc27fdd864 /lisp/pcmpl-cvs.el
parent8994590317556a15be6bbb9a5c15227ceda189db (diff)
downloademacs-2b0459cd8ed400ae9b2a993d2771055f227f9b55.tar.gz
* lisp/pcmpl-cvs.el (pcmpl-cvs-entries): Don't assume CVS/Entries exists.
Diffstat (limited to 'lisp/pcmpl-cvs.el')
-rw-r--r--lisp/pcmpl-cvs.el35
1 files changed, 18 insertions, 17 deletions
diff --git a/lisp/pcmpl-cvs.el b/lisp/pcmpl-cvs.el
index 458e42028f0..6b6369587a4 100644
--- a/lisp/pcmpl-cvs.el
+++ b/lisp/pcmpl-cvs.el
@@ -164,27 +164,28 @@ operation character applies, as displayed by 'cvs -n update'."
(with-temp-buffer
(and dir (cd dir))
(call-process pcmpl-cvs-binary nil t nil
- "-q" "-n" "-f" "update"); "-l")
+ "-q" "-n" "-f" "update") ; "-l")
(goto-char (point-min))
(while (re-search-forward "^\\(.\\) \\(.+\\)$" nil t)
(if (memq (string-to-char (match-string 1)) opers)
(setq entries (cons (match-string 2) entries)))))
- (with-temp-buffer
- (insert-file-contents (concat dir "CVS/Entries"))
- (goto-char (point-min))
- (while (not (eobp))
- ;; Normal file: /NAME -> "" "NAME"
- ;; Directory : D/NAME -> "D" "NAME"
- (let* ((fields (split-string (buffer-substring
- (line-beginning-position)
- (line-end-position))
- "/"))
- (text (nth 1 fields)))
- (when text
- (if (string= (nth 0 fields) "D")
- (setq text (file-name-as-directory text)))
- (setq entries (cons text entries))))
- (forward-line))))
+ (when (file-exists-p (expand-file-name "CVS/Entries" dir))
+ (with-temp-buffer
+ (insert-file-contents (expand-file-name "CVS/Entries" dir))
+ (goto-char (point-min))
+ (while (not (eobp))
+ ;; Normal file: /NAME -> "" "NAME"
+ ;; Directory : D/NAME -> "D" "NAME"
+ (let* ((fields (split-string (buffer-substring
+ (line-beginning-position)
+ (line-end-position))
+ "/"))
+ (text (nth 1 fields)))
+ (when text
+ (if (string= (nth 0 fields) "D")
+ (setq text (file-name-as-directory text)))
+ (setq entries (cons text entries))))
+ (forward-line)))))
(setq pcomplete-stub nondir)
(pcomplete-uniqify-list entries)))