comparison lisp/progmodes/compile.el @ 62381:30c05755e6b5

(compilation-setup): Set local value of overlay-arrow-string to "" always. (compilation-set-window): Left fringe then don't scroll. No left fringe then no arrow and scroll message to top. (compilation-context-lines): Adjust doc string accordingly.
author Nick Roberts <nickrob@snap.net.nz>
date Mon, 16 May 2005 00:01:46 +0000
parents 70963b3d0aa7
children 88b93ce112d1
comparison
equal deleted inserted replaced
62380:602fb25a831a 62381:30c05755e6b5
1245 `compilation-minor-mode'." 1245 `compilation-minor-mode'."
1246 (make-local-variable 'compilation-current-error) 1246 (make-local-variable 'compilation-current-error)
1247 (make-local-variable 'compilation-messages-start) 1247 (make-local-variable 'compilation-messages-start)
1248 (make-local-variable 'compilation-error-screen-columns) 1248 (make-local-variable 'compilation-error-screen-columns)
1249 (make-local-variable 'overlay-arrow-position) 1249 (make-local-variable 'overlay-arrow-position)
1250 (set (make-local-variable 'overlay-arrow-string) 1250 (set (make-local-variable 'overlay-arrow-string) "")
1251 (if (display-graphic-p) "=>" ""))
1252 (setq next-error-overlay-arrow-position nil) 1251 (setq next-error-overlay-arrow-position nil)
1253 (add-hook 'kill-buffer-hook 1252 (add-hook 'kill-buffer-hook
1254 (lambda () (setq next-error-overlay-arrow-position nil)) nil t) 1253 (lambda () (setq next-error-overlay-arrow-position nil)) nil t)
1255 ;; Note that compilation-next-error-function is for interfacing 1254 ;; Note that compilation-next-error-function is for interfacing
1256 ;; with the next-error function in simple.el, and it's only 1255 ;; with the next-error function in simple.el, and it's only
1573 (if (cdr loc) 1572 (if (cdr loc)
1574 (setcdr (cddr loc) (list marker)) 1573 (setcdr (cddr loc) (list marker))
1575 (setcdr loc (list line file marker))) 1574 (setcdr loc (list line file marker)))
1576 loc)) 1575 loc))
1577 1576
1578 (defcustom compilation-context-lines 0 1577 (defcustom compilation-context-lines nil
1579 "*Display this many lines of leading context before message. 1578 "Display this many lines of leading context before the current message.
1580 If nil, don't scroll the compilation output window." 1579 If nil and the left fringe is displayed, don't scroll the
1580 compilation output window; an arrow in the left fringe points to
1581 the current message. If nil and there is no left fringe, the message
1582 displays at the top of the window; there is no arrow."
1581 :type '(choice integer (const :tag "No window scrolling" nil)) 1583 :type '(choice integer (const :tag "No window scrolling" nil))
1582 :group 'compilation 1584 :group 'compilation
1583 :version "22.1") 1585 :version "22.1")
1584 1586
1585 (defsubst compilation-set-window (w mk) 1587 (defsubst compilation-set-window (w mk)
1586 "Align the compilation output window W with marker MK near top." 1588 "Align the compilation output window W with marker MK near top."
1587 (if (integerp compilation-context-lines) 1589 (if (integerp compilation-context-lines)
1588 (set-window-start w (save-excursion 1590 (set-window-start w (save-excursion
1589 (goto-char mk) 1591 (goto-char mk)
1590 (beginning-of-line (- 1 compilation-context-lines)) 1592 (beginning-of-line
1591 (point)))) 1593 (- 1 compilation-context-lines))
1592 (set-window-point w mk)) 1594 (point)))
1595 (if (left-fringe-p)
1596 (set-window-start w (save-excursion
1597 (goto-char mk)
1598 (beginning-of-line 1)
1599 (point)))))
1600 (set-window-point w mk))
1593 1601
1594 (defvar next-error-highlight-timer) 1602 (defvar next-error-highlight-timer)
1595 1603
1596 (defun compilation-goto-locus (msg mk end-mk) 1604 (defun compilation-goto-locus (msg mk end-mk)
1597 "Jump to an error corresponding to MSG at MK. 1605 "Jump to an error corresponding to MSG at MK.