summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuri Linkov <juri@jurta.org>2004-09-02 16:35:17 +0000
committerJuri Linkov <juri@jurta.org>2004-09-02 16:35:17 +0000
commitaa06eb19f8d31a88eb3ac8ed63887a97b9967c4a (patch)
tree2f24dc6543f5c0ebf0e09f4cf6a6584b3c7880b6
parent7c3a90e72a53c2bb025db92c38eb849dd0802b00 (diff)
downloademacs-aa06eb19f8d31a88eb3ac8ed63887a97b9967c4a.tar.gz
(compilation-error-properties): Allow to funcall col and end-col.
(compilation-mode-font-lock-keywords): Check col and end-col by `integerp'. (compilation-goto-locus): If end-mk is non-nil in transient mark mode don't activate the mark (and don't display message in push-mark), but highlight overlay between mk and end-mk.
-rw-r--r--lisp/progmodes/compile.el33
1 files changed, 19 insertions, 14 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 7a0aa42faff..ea174233289 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -579,12 +579,17 @@ Faces `compilation-error-face', `compilation-warning-face',
(and end-line
(setq end-line (match-string-no-properties end-line))
(setq end-line (string-to-number end-line)))
- (and col
- (setq col (match-string-no-properties col))
- (setq col (- (string-to-number col) compilation-first-column)))
- (if (and end-col (setq end-col (match-string-no-properties end-col)))
- (setq end-col (- (string-to-number end-col) compilation-first-column -1))
- (if end-line (setq end-col -1)))
+ (if col
+ (if (functionp col)
+ (setq col (funcall col))
+ (and
+ (setq col (match-string-no-properties col))
+ (setq col (- (string-to-number col) compilation-first-column)))))
+ (if (and end-col (functionp end-col))
+ (setq end-col (funcall end-col))
+ (if (and end-col (setq end-col (match-string-no-properties end-col)))
+ (setq end-col (- (string-to-number end-col) compilation-first-column -1))
+ (if end-line (setq end-col -1))))
(if (consp type) ; not a static type, check what it is.
(setq type (or (and (car type) (match-end (car type)) 1)
(and (cdr type) (match-end (cdr type)) 0)
@@ -726,9 +731,9 @@ FILE should be (ABSOLUTE-FILENAME) or (RELATIVE-FILENAME . DIRNAME) or nil."
,@(when end-line
`((,end-line compilation-line-face nil t)))
- ,@(when col
+ ,@(when (integerp col)
`((,col compilation-column-face nil t)))
- ,@(when end-col
+ ,@(when (integerp end-col)
`((,end-col compilation-column-face nil t)))
,@(nthcdr 6 item)
@@ -1524,7 +1529,8 @@ If nil, don't scroll the compilation output window."
(defun compilation-goto-locus (msg mk end-mk)
"Jump to an error corresponding to MSG at MK.
-All arguments are markers. If END-MK is non-nil, mark is set there."
+All arguments are markers. If END-MK is non-nil, mark is set there
+and overlay is highlighted between MK and END-MK."
(if (eq (window-buffer (selected-window))
(marker-buffer msg))
;; If the compilation buffer window is selected,
@@ -1540,7 +1546,7 @@ All arguments are markers. If END-MK is non-nil, mark is set there."
(widen)
(goto-char mk))
(if end-mk
- (push-mark end-mk nil t)
+ (push-mark end-mk t)
(if mark-active (setq mark-active)))
;; If hideshow got in the way of
;; seeing the right place, open permanently.
@@ -1561,17 +1567,16 @@ All arguments are markers. If END-MK is non-nil, mark is set there."
compilation-highlight-regexp)))
(compilation-set-window-height w)
- (when (and highlight-regexp
- (not (and end-mk transient-mark-mode)))
+ (when highlight-regexp
(unless compilation-highlight-overlay
(setq compilation-highlight-overlay
(make-overlay (point-min) (point-min)))
(overlay-put compilation-highlight-overlay 'face 'next-error))
(with-current-buffer (marker-buffer mk)
(save-excursion
- (end-of-line)
+ (if end-mk (goto-char end-mk) (end-of-line))
(let ((end (point)))
- (beginning-of-line)
+ (if mk (goto-char mk) (beginning-of-line))
(if (and (stringp highlight-regexp)
(re-search-forward highlight-regexp end t))
(progn