]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/progmodes/compile.el (compilation-start): Try globbing the arg to `cd'.
authorKevin Rodgers <kevin.d.rodgers@gmail.com>
Wed, 2 Oct 2013 23:33:48 +0000 (19:33 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 2 Oct 2013 23:33:48 +0000 (19:33 -0400)
Fixes: debbugs:15417
lisp/ChangeLog
lisp/progmodes/compile.el

index 14d6f8503f62f89b201ad72e914afc90838bdc28..e1aab1a78bf6a0ee00882e77e470a4298abc5e02 100644 (file)
@@ -1,3 +1,8 @@
+2013-10-02  Kevin Rodgers  <kevin.d.rodgers@gmail.com>
+
+       * progmodes/compile.el (compilation-start): Try globbing the arg to
+       `cd' (bug#15417).
+
 2013-10-02  Michael Albinus  <michael.albinus@gmx.de>
 
        Sync with Tramp 2.2.8.
index 8c981b36e567e1583dbdf08bf46e142758b3cc65..e25be05fb09710553ea536fcf2c2601ade2f0fc8 100644 (file)
@@ -1583,7 +1583,16 @@ Returns the compilation buffer created."
                "\\\\\\(.\\)" "\\1"
                (substring command (1+ (match-beginning 1))
                           (1- (match-end 1)))))
-             (t (substitute-env-vars (match-string 1 command)))))
+             ;; Try globbing as well (bug#15417).
+             (t (let* ((substituted-dir
+                        (substitute-env-vars (match-string 1 command)))
+                       ;; FIXME: This also tries to expand `*' that were
+                       ;; introduced by the envvar expansion!
+                       (expanded-dir
+                        (file-expand-wildcards substituted-dir)))
+                  (if (= (length expanded-dir) 1)
+                      (car expanded-dir)
+                    substituted-dir)))))
        (erase-buffer)
        ;; Select the desired mode.
        (if (not (eq mode t))