aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Steingold2008-05-02 18:37:07 +0000
committerSam Steingold2008-05-02 18:37:07 +0000
commit5f3ca1ba63892e9c3e95f591a8d551ec80d6782a (patch)
tree95f3fc1fae67c06ecc8cc2180b2945f8cdf855f3
parent7210c33ff83136d924d23afa0087d6583117f47e (diff)
downloademacs-5f3ca1ba63892e9c3e95f591a8d551ec80d6782a.tar.gz
emacs-5f3ca1ba63892e9c3e95f591a8d551ec80d6782a.zip
* progmodes/compile.el (compilation-start): Move setting of
compilation-directory after (funcall mode) as that resets local variables, this fixes recompile in grep buffers. * grep.el (grep-mode-map): Bind "g" to recompile (like in dired &c).
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/progmodes/compile.el9
-rw-r--r--lisp/progmodes/grep.el7
3 files changed, 16 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4e158093b2d..9d1def1ec9f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12008-05-02 Sam Steingold <sds@gnu.org>
2
3 * progmodes/compile.el (compilation-start): Move setting of
4 compilation-directory after (funcall mode) as that resets local
5 variables, this fixes recompile in grep buffers.
6 * grep.el (grep-mode-map): Bind "g" to recompile (like in dired &c).
7
12008-05-02 Eric S. Raymond <esr@snark.thyrsus.com> 82008-05-02 Eric S. Raymond <esr@snark.thyrsus.com>
2 9
3 * vc-arch.el, vc-bzr.el, vc-cvs.el, vc-git.el, vc-hg.el, 10 * vc-arch.el, vc-bzr.el, vc-cvs.el, vc-git.el, vc-hg.el,
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 89e9dedb69d..10ac627ed91 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1159,10 +1159,6 @@ Returns the compilation buffer created."
1159 (buffer-disable-undo (current-buffer)) 1159 (buffer-disable-undo (current-buffer))
1160 ;; first transfer directory from where M-x compile was called 1160 ;; first transfer directory from where M-x compile was called
1161 (setq default-directory thisdir) 1161 (setq default-directory thisdir)
1162 ;; Remember the original dir, so we can use it when we recompile.
1163 ;; default-directory' can't be used reliably for that because it may be
1164 ;; affected by the special handling of "cd ...;".
1165 (set (make-local-variable 'compilation-directory) thisdir)
1166 ;; Make compilation buffer read-only. The filter can still write it. 1162 ;; Make compilation buffer read-only. The filter can still write it.
1167 ;; Clear out the compilation buffer. 1163 ;; Clear out the compilation buffer.
1168 (let ((inhibit-read-only t) 1164 (let ((inhibit-read-only t)
@@ -1182,6 +1178,11 @@ Returns the compilation buffer created."
1182 (setq buffer-read-only nil) 1178 (setq buffer-read-only nil)
1183 (with-no-warnings (comint-mode)) 1179 (with-no-warnings (comint-mode))
1184 (compilation-shell-minor-mode)) 1180 (compilation-shell-minor-mode))
1181 ;; Remember the original dir, so we can use it when we recompile.
1182 ;; default-directory' can't be used reliably for that because it may be
1183 ;; affected by the special handling of "cd ...;".
1184 ;; NB: must be fone after (funcall mode) as that resets local variables
1185 (set (make-local-variable 'compilation-directory) thisdir)
1185 (if highlight-regexp 1186 (if highlight-regexp
1186 (set (make-local-variable 'compilation-highlight-regexp) 1187 (set (make-local-variable 'compilation-highlight-regexp)
1187 highlight-regexp)) 1188 highlight-regexp))
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 5d56e3ab5a0..55d77f04d95 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -187,6 +187,7 @@ See `compilation-error-screen-columns'"
187 (define-key map "\r" 'compile-goto-error) ;; ? 187 (define-key map "\r" 'compile-goto-error) ;; ?
188 (define-key map "n" 'next-error-no-select) 188 (define-key map "n" 'next-error-no-select)
189 (define-key map "p" 'previous-error-no-select) 189 (define-key map "p" 'previous-error-no-select)
190 (define-key map "g" 'recompile) ; revert
190 (define-key map "{" 'compilation-previous-file) 191 (define-key map "{" 'compilation-previous-file)
191 (define-key map "}" 'compilation-next-file) 192 (define-key map "}" 'compilation-next-file)
192 (define-key map "\t" 'compilation-next-error) 193 (define-key map "\t" 'compilation-next-error)
@@ -230,7 +231,7 @@ See `compilation-error-screen-columns'"
230 (if (display-graphic-p) 231 (if (display-graphic-p)
231 (let ((map (butlast (copy-keymap tool-bar-map))) 232 (let ((map (butlast (copy-keymap tool-bar-map)))
232 (help (last tool-bar-map))) ;; Keep Help last in tool bar 233 (help (last tool-bar-map))) ;; Keep Help last in tool bar
233 (tool-bar-local-item 234 (tool-bar-local-item
234 "left-arrow" 'previous-error-no-select 'previous-error-no-select map 235 "left-arrow" 'previous-error-no-select 'previous-error-no-select map
235 :rtl "right-arrow" 236 :rtl "right-arrow"
236 :help "Goto previous match") 237 :help "Goto previous match")
@@ -238,12 +239,12 @@ See `compilation-error-screen-columns'"
238 "right-arrow" 'next-error-no-select 'next-error-no-select map 239 "right-arrow" 'next-error-no-select 'next-error-no-select map
239 :rtl "left-arrow" 240 :rtl "left-arrow"
240 :help "Goto next match") 241 :help "Goto next match")
241 (tool-bar-local-item 242 (tool-bar-local-item
242 "cancel" 'kill-compilation 'kill-compilation map 243 "cancel" 'kill-compilation 'kill-compilation map
243 :enable '(let ((buffer (compilation-find-buffer))) 244 :enable '(let ((buffer (compilation-find-buffer)))
244 (get-buffer-process buffer)) 245 (get-buffer-process buffer))
245 :help "Stop grep") 246 :help "Stop grep")
246 (tool-bar-local-item 247 (tool-bar-local-item
247 "refresh" 'recompile 'recompile map 248 "refresh" 'recompile 'recompile map
248 :help "Restart grep") 249 :help "Restart grep")
249 (append map help)))) 250 (append map help))))