summaryrefslogtreecommitdiff
path: root/lisp/pcmpl-gnu.el
diff options
context:
space:
mode:
authorJoakim Verona <joakim@verona.se>2011-12-28 11:34:15 +0100
committerJoakim Verona <joakim@verona.se>2011-12-28 11:34:15 +0100
commit2f74c36bf173b5ad01f99e0d1b31b9b8fa5c8f2f (patch)
tree034e65ef002631d0aba8fc1a41e9984fc557e630 /lisp/pcmpl-gnu.el
parentbb29f044aa967831cd664c54eba0de0c701436ce (diff)
parentd23ab8e8726ecb7e3554644857b4a58e5f7408f1 (diff)
downloademacs-2f74c36bf173b5ad01f99e0d1b31b9b8fa5c8f2f.tar.gz
emacs-2f74c36bf173b5ad01f99e0d1b31b9b8fa5c8f2f.tar.bz2
emacs-2f74c36bf173b5ad01f99e0d1b31b9b8fa5c8f2f.zip
upstream
Diffstat (limited to 'lisp/pcmpl-gnu.el')
-rw-r--r--lisp/pcmpl-gnu.el17
1 files changed, 11 insertions, 6 deletions
diff --git a/lisp/pcmpl-gnu.el b/lisp/pcmpl-gnu.el
index 608a9dc2e88..3b2a944f5bb 100644
--- a/lisp/pcmpl-gnu.el
+++ b/lisp/pcmpl-gnu.el
@@ -35,7 +35,7 @@
;; User Variables:
(defcustom pcmpl-gnu-makefile-regexps
- '("\\`GNUmakefile" "\\`Makefile" "\\.mak\\'")
+ '("\\`GNUmakefile" "\\`[Mm]akefile" "\\.ma?k\\'")
"A list of regexps that will match Makefile names."
:type '(repeat regexp)
:group 'pcmpl-gnu)
@@ -99,7 +99,10 @@
"Completion for GNU `make'."
(let ((pcomplete-help "(make)Top"))
(pcomplete-opt "bmC/def(pcmpl-gnu-makefile-names)hiI/j?kl?no.pqrsStvwW.")
- (while (pcomplete-here (pcmpl-gnu-make-rule-names) nil 'identity))))
+ (while (pcomplete-here (completion-table-in-turn
+ (pcmpl-gnu-make-rule-names)
+ (pcomplete-entries))
+ nil 'identity))))
(defun pcmpl-gnu-makefile-names ()
"Return a list of possible makefile names."
@@ -109,14 +112,16 @@
"Return a list of possible make rule names in MAKEFILE."
(let* ((minus-f (member "-f" pcomplete-args))
(makefile (or (cadr minus-f)
- (if (file-exists-p "GNUmakefile")
- "GNUmakefile"
- "Makefile")))
+ (cond
+ ((file-exists-p "GNUmakefile") "GNUmakefile")
+ ((file-exists-p "makefile") "makefile")
+ (t "Makefile"))))
rules)
(if (not (file-readable-p makefile))
(unless minus-f (list "-f"))
(with-temp-buffer
- (insert-file-contents-literally makefile)
+ (ignore-errors ;Could be a directory or something.
+ (insert-file-contents makefile))
(while (re-search-forward
(concat "^\\s-*\\([^\n#%.$][^:=\n]*\\)\\s-*:[^=]") nil t)
(setq rules (append (split-string (match-string 1)) rules))))