aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2004-04-29 15:31:38 +0000
committerJuri Linkov2004-04-29 15:31:38 +0000
commita3a9c080fa248a99132597d78b72ebe02644ae8c (patch)
tree7d600db0d1018295d2f43b65306358badf6b2203
parent35904fd3554171219c7edda7e82cac3e622b5b75 (diff)
downloademacs-a3a9c080fa248a99132597d78b72ebe02644ae8c.tar.gz
emacs-a3a9c080fa248a99132597d78b72ebe02644ae8c.zip
(compilation-context-lines): Add nil option to disable compilation output window scrolling.
(compilation-set-window): Use it.
-rw-r--r--lisp/progmodes/compile.el14
1 files 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."
1473 loc)) 1473 loc))
1474 1474
1475(defcustom compilation-context-lines 0 1475(defcustom compilation-context-lines 0
1476 "*Display this many lines of leading context before message." 1476 "*Display this many lines of leading context before message.
1477 :type 'integer 1477If nil, don't scroll the compilation output window."
1478 :type '(choice integer (const :tag "No window scrolling" nil))
1478 :group 'compilation 1479 :group 'compilation
1479 :version "21.4") 1480 :version "21.4")
1480 1481
1481(defsubst compilation-set-window (w mk) 1482(defsubst compilation-set-window (w mk)
1482 "Align the compilation output window W with marker MK near top." 1483 "Align the compilation output window W with marker MK near top."
1483 (set-window-start w (save-excursion 1484 (if (integerp compilation-context-lines)
1484 (goto-char mk) 1485 (set-window-start w (save-excursion
1485 (beginning-of-line (- 1 compilation-context-lines)) 1486 (goto-char mk)
1486 (point))) 1487 (beginning-of-line (- 1 compilation-context-lines))
1488 (point))))
1487 (set-window-point w mk)) 1489 (set-window-point w mk))
1488 1490
1489(defun compilation-goto-locus (msg mk end-mk) 1491(defun compilation-goto-locus (msg mk end-mk)