Commit 5f3ca1ba authored by Sam Steingold's avatar Sam Steingold
Browse files

* 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).
parent 7210c33f
2008-05-02 Sam Steingold <sds@gnu.org>
* 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).
2008-05-02 Eric S. Raymond <esr@snark.thyrsus.com> 2008-05-02 Eric S. Raymond <esr@snark.thyrsus.com>
   
* vc-arch.el, vc-bzr.el, vc-cvs.el, vc-git.el, vc-hg.el, * vc-arch.el, vc-bzr.el, vc-cvs.el, vc-git.el, vc-hg.el,
......
...@@ -1159,10 +1159,6 @@ Returns the compilation buffer created." ...@@ -1159,10 +1159,6 @@ Returns the compilation buffer created."
(buffer-disable-undo (current-buffer)) (buffer-disable-undo (current-buffer))
;; first transfer directory from where M-x compile was called ;; first transfer directory from where M-x compile was called
(setq default-directory thisdir) (setq default-directory thisdir)
;; Remember the original dir, so we can use it when we recompile.
;; default-directory' can't be used reliably for that because it may be
;; affected by the special handling of "cd ...;".
(set (make-local-variable 'compilation-directory) thisdir)
;; Make compilation buffer read-only. The filter can still write it. ;; Make compilation buffer read-only. The filter can still write it.
;; Clear out the compilation buffer. ;; Clear out the compilation buffer.
(let ((inhibit-read-only t) (let ((inhibit-read-only t)
...@@ -1182,6 +1178,11 @@ Returns the compilation buffer created." ...@@ -1182,6 +1178,11 @@ Returns the compilation buffer created."
(setq buffer-read-only nil) (setq buffer-read-only nil)
(with-no-warnings (comint-mode)) (with-no-warnings (comint-mode))
(compilation-shell-minor-mode)) (compilation-shell-minor-mode))
;; Remember the original dir, so we can use it when we recompile.
;; default-directory' can't be used reliably for that because it may be
;; affected by the special handling of "cd ...;".
;; NB: must be fone after (funcall mode) as that resets local variables
(set (make-local-variable 'compilation-directory) thisdir)
(if highlight-regexp (if highlight-regexp
(set (make-local-variable 'compilation-highlight-regexp) (set (make-local-variable 'compilation-highlight-regexp)
highlight-regexp)) highlight-regexp))
......
...@@ -187,6 +187,7 @@ See `compilation-error-screen-columns'" ...@@ -187,6 +187,7 @@ See `compilation-error-screen-columns'"
(define-key map "\r" 'compile-goto-error) ;; ? (define-key map "\r" 'compile-goto-error) ;; ?
(define-key map "n" 'next-error-no-select) (define-key map "n" 'next-error-no-select)
(define-key map "p" 'previous-error-no-select) (define-key map "p" 'previous-error-no-select)
(define-key map "g" 'recompile) ; revert
(define-key map "{" 'compilation-previous-file) (define-key map "{" 'compilation-previous-file)
(define-key map "}" 'compilation-next-file) (define-key map "}" 'compilation-next-file)
(define-key map "\t" 'compilation-next-error) (define-key map "\t" 'compilation-next-error)
...@@ -230,7 +231,7 @@ See `compilation-error-screen-columns'" ...@@ -230,7 +231,7 @@ See `compilation-error-screen-columns'"
(if (display-graphic-p) (if (display-graphic-p)
(let ((map (butlast (copy-keymap tool-bar-map))) (let ((map (butlast (copy-keymap tool-bar-map)))
(help (last tool-bar-map))) ;; Keep Help last in tool bar (help (last tool-bar-map))) ;; Keep Help last in tool bar
(tool-bar-local-item (tool-bar-local-item
"left-arrow" 'previous-error-no-select 'previous-error-no-select map "left-arrow" 'previous-error-no-select 'previous-error-no-select map
:rtl "right-arrow" :rtl "right-arrow"
:help "Goto previous match") :help "Goto previous match")
...@@ -238,12 +239,12 @@ See `compilation-error-screen-columns'" ...@@ -238,12 +239,12 @@ See `compilation-error-screen-columns'"
"right-arrow" 'next-error-no-select 'next-error-no-select map "right-arrow" 'next-error-no-select 'next-error-no-select map
:rtl "left-arrow" :rtl "left-arrow"
:help "Goto next match") :help "Goto next match")
(tool-bar-local-item (tool-bar-local-item
"cancel" 'kill-compilation 'kill-compilation map "cancel" 'kill-compilation 'kill-compilation map
:enable '(let ((buffer (compilation-find-buffer))) :enable '(let ((buffer (compilation-find-buffer)))
(get-buffer-process buffer)) (get-buffer-process buffer))
:help "Stop grep") :help "Stop grep")
(tool-bar-local-item (tool-bar-local-item
"refresh" 'recompile 'recompile map "refresh" 'recompile 'recompile map
:help "Restart grep") :help "Restart grep")
(append map help)))) (append map help))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment