From f6f8aa125110ed71a4601c661facfe9150322f0a Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 28 Mar 2010 15:51:55 -0400 Subject: [PATCH] Fix for `compile' (Bug#5771). * progmodes/compile.el (compilation-start): Fix regexp detection of initial cd command (Bug#5771). --- lisp/ChangeLog | 5 +++++ lisp/progmodes/compile.el | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6098c2fc3a1..25dd9c35228 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-03-28 Chong Yidong + + * progmodes/compile.el (compilation-start): Fix regexp detection + of initial cd command (Bug#5771). + 2010-03-28 Stefan Guath (tiny change) * find-dired.el (find-dired): Use read-directory-name (Bug#5777). diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 20fe89937bc..51e42809153 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1220,7 +1220,8 @@ Returns the compilation buffer created." ;; Then evaluate a cd command if any, but don't perform it yet, else ;; start-command would do it again through the shell: (cd "..") AND ;; sh -c "cd ..; make" - (cd (if (string-match "^\\s *cd\\(?:\\s +\\(\\S +?\\)\\)?\\s *[;&\n]" command) + (cd (if (string-match "\\`\\s *cd\\(?:\\s +\\(\\S +?\\)\\)?\\s *[;&\n]" + command) (if (match-end 1) (substitute-env-vars (match-string 1 command)) "~") -- 2.39.2