aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2015-05-23 12:06:23 -0400
committerStefan Monnier2015-05-23 12:06:23 -0400
commit2b0459cd8ed400ae9b2a993d2771055f227f9b55 (patch)
tree98d52bade8c6e6f424e6177845397bcc27fdd864
parent8994590317556a15be6bbb9a5c15227ceda189db (diff)
downloademacs-2b0459cd8ed400ae9b2a993d2771055f227f9b55.tar.gz
emacs-2b0459cd8ed400ae9b2a993d2771055f227f9b55.zip
* lisp/pcmpl-cvs.el (pcmpl-cvs-entries): Don't assume CVS/Entries exists.
-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'."
164 (with-temp-buffer 164 (with-temp-buffer
165 (and dir (cd dir)) 165 (and dir (cd dir))
166 (call-process pcmpl-cvs-binary nil t nil 166 (call-process pcmpl-cvs-binary nil t nil
167 "-q" "-n" "-f" "update"); "-l") 167 "-q" "-n" "-f" "update") ; "-l")
168 (goto-char (point-min)) 168 (goto-char (point-min))
169 (while (re-search-forward "^\\(.\\) \\(.+\\)$" nil t) 169 (while (re-search-forward "^\\(.\\) \\(.+\\)$" nil t)
170 (if (memq (string-to-char (match-string 1)) opers) 170 (if (memq (string-to-char (match-string 1)) opers)
171 (setq entries (cons (match-string 2) entries))))) 171 (setq entries (cons (match-string 2) entries)))))
172 (with-temp-buffer 172 (when (file-exists-p (expand-file-name "CVS/Entries" dir))
173 (insert-file-contents (concat dir "CVS/Entries")) 173 (with-temp-buffer
174 (goto-char (point-min)) 174 (insert-file-contents (expand-file-name "CVS/Entries" dir))
175 (while (not (eobp)) 175 (goto-char (point-min))
176 ;; Normal file: /NAME -> "" "NAME" 176 (while (not (eobp))
177 ;; Directory : D/NAME -> "D" "NAME" 177 ;; Normal file: /NAME -> "" "NAME"
178 (let* ((fields (split-string (buffer-substring 178 ;; Directory : D/NAME -> "D" "NAME"
179 (line-beginning-position) 179 (let* ((fields (split-string (buffer-substring
180 (line-end-position)) 180 (line-beginning-position)
181 "/")) 181 (line-end-position))
182 (text (nth 1 fields))) 182 "/"))
183 (when text 183 (text (nth 1 fields)))
184 (if (string= (nth 0 fields) "D") 184 (when text
185 (setq text (file-name-as-directory text))) 185 (if (string= (nth 0 fields) "D")
186 (setq entries (cons text entries)))) 186 (setq text (file-name-as-directory text)))
187 (forward-line)))) 187 (setq entries (cons text entries))))
188 (forward-line)))))
188 (setq pcomplete-stub nondir) 189 (setq pcomplete-stub nondir)
189 (pcomplete-uniqify-list entries))) 190 (pcomplete-uniqify-list entries)))
190 191