]> code.delx.au - gnu-emacs/blobdiff - lisp/pcmpl-gnu.el
Add advertised calling convention for redirect-frame-focus (Bug#12030).
[gnu-emacs] / lisp / pcmpl-gnu.el
index b2c8de6ec2fbc34e6c276251e4afbf7784000a43..da72c81c44a50cc18912a20cd8b6f4c5520d7b12 100644 (file)
@@ -1,6 +1,6 @@
 ;;; pcmpl-gnu.el --- completions for GNU project tools -*- lexical-binding: t -*-
 
-;; Copyright (C) 1999-2011 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2012 Free Software Foundation, Inc.
 
 ;; Package: pcomplete
 
@@ -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)
   "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."
   "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))))
                    "--volno-file=")))
           (pcomplete-opt "01234567ABCFGKLMNOPRSTUVWXZbcdfghiklmoprstuvwxz"))
         (cond
+         ((pcomplete-match "\\`-\\'" 0)
+          (pcomplete-here*))
          ((pcomplete-match "\\`--after-date=" 0)
           (pcomplete-here*))
          ((pcomplete-match "\\`--backup=" 0)
                      (let* ((fa (file-attributes (pcomplete-arg 1)))
                             (size (nth 7 fa)))
                        (and (numberp size)
-                            (< size large-file-warning-threshold))))
+                            (or (null large-file-warning-threshold)
+                                (< size large-file-warning-threshold)))))
                 (let ((file (pcomplete-arg 1)))
                   (completion-table-dynamic
                    (lambda (_string)