emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r106638: * lisp/pcmpl-gnu.el: Don't f


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r106638: * lisp/pcmpl-gnu.el: Don't fail when there is no Makefile nor -f arg.
Date: Thu, 08 Dec 2011 08:20:20 -0500
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 106638
fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10116
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Thu 2011-12-08 08:20:20 -0500
message:
  * lisp/pcmpl-gnu.el: Don't fail when there is no Makefile nor -f arg.
  (pcmpl-gnu-makefile-regexps): Accept "makefile" as well as files that
  end in ".mk".
  (pcmpl-gnu-make-rule-names): Check "makefile" and ignore errors
  when reading the makefile.
modified:
  lisp/ChangeLog
  lisp/pcmpl-gnu.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-12-06 22:14:32 +0000
+++ b/lisp/ChangeLog    2011-12-08 13:20:20 +0000
@@ -1,3 +1,11 @@
+2011-12-08  Stefan Monnier  <address@hidden>
+
+       * pcmpl-gnu.el: Don't fail when there is no Makefile nor -f arg.
+       (pcmpl-gnu-makefile-regexps): Accept "makefile" as well as files that
+       end in ".mk".
+       (pcmpl-gnu-make-rule-names): Check "makefile" and ignore errors
+       when reading the makefile (bug#10116).
+
 2011-12-06  Stefan Monnier  <address@hidden>
 
        * pcmpl-gnu.el (pcomplete/make): Also allow filename arguments

=== modified file 'lisp/pcmpl-gnu.el'
--- a/lisp/pcmpl-gnu.el 2011-12-06 22:14:32 +0000
+++ b/lisp/pcmpl-gnu.el 2011-12-08 13:20:20 +0000
@@ -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)
@@ -112,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))))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]