Mercurial > emacs
diff lisp/progmodes/compile.el @ 55227:193a4c332536
(compilation-context-lines): Add nil option to disable compilation output window scrolling.
(compilation-set-window): Use it.
author | Juri Linkov <juri@jurta.org> |
---|---|
date | Thu, 29 Apr 2004 15:31:38 +0000 |
parents | 9c215b4c9a6d |
children | 37068e6cd644 |
line wrap: on
line diff
--- a/lisp/progmodes/compile.el Thu Apr 29 15:28:55 2004 +0000 +++ b/lisp/progmodes/compile.el Thu Apr 29 15:31:38 2004 +0000 @@ -1473,17 +1473,19 @@ loc)) (defcustom compilation-context-lines 0 - "*Display this many lines of leading context before message." - :type 'integer + "*Display this many lines of leading context before message. +If nil, don't scroll the compilation output window." + :type '(choice integer (const :tag "No window scrolling" nil)) :group 'compilation :version "21.4") (defsubst compilation-set-window (w mk) "Align the compilation output window W with marker MK near top." - (set-window-start w (save-excursion - (goto-char mk) - (beginning-of-line (- 1 compilation-context-lines)) - (point))) + (if (integerp compilation-context-lines) + (set-window-start w (save-excursion + (goto-char mk) + (beginning-of-line (- 1 compilation-context-lines)) + (point)))) (set-window-point w mk)) (defun compilation-goto-locus (msg mk end-mk)