From a3a9c080fa248a99132597d78b72ebe02644ae8c Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 29 Apr 2004 15:31:38 +0000 Subject: [PATCH] (compilation-context-lines): Add nil option to disable compilation output window scrolling. (compilation-set-window): Use it. --- lisp/progmodes/compile.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index d85bb79064f..bb565a1ba51 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1473,17 +1473,19 @@ region and the first line of the next region." 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)