Mercurial > emacs
comparison 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 |
comparison
equal
deleted
inserted
replaced
55226:e3dae0e8c99e | 55227:193a4c332536 |
---|---|
1471 (setcdr (cddr loc) (list marker)) | 1471 (setcdr (cddr loc) (list marker)) |
1472 (setcdr loc (list line file marker))) | 1472 (setcdr loc (list line file marker))) |
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 | 1477 If 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) |
1490 "Jump to an error corresponding to MSG at MK. | 1492 "Jump to an error corresponding to MSG at MK. |
1491 All arguments are markers. If END-MK is non nil, mark is set there." | 1493 All arguments are markers. If END-MK is non nil, mark is set there." |