;; the last line tries to rule out message where the info after the
;; line number starts with "SS". --Stef
"^\\(?:[[:alpha:]][-[:alnum:].]+: ?\\)?\
-\\([0-9]*[^0-9\n].*?\\): ?\
+\\([0-9]*[^0-9\n]\\(?:[^\n ]\\| [^-\n]\\)*?\\): ?\
\\([0-9]+\\)\\(?:\\([.:]\\)\\([0-9]+\\)\\)?\
\\(?:-\\([0-9]+\\)?\\(?:\\3\\([0-9]+\\)\\)?\\)?:\
\\(?: *\\(\\(?:Future\\|Runtime\\)?[Ww]arning\\|W:\\)\\|\
(defvar compilation-directory-matcher
'("\\(?:Entering\\|Leavin\\(g\\)\\) directory `\\(.+\\)'$" (2 . 1))
"A list for tracking when directories are entered or left.
-Nil means not to track directories, e.g. if all file names are absolute. The
+If nil, do not track directories, e.g. if all file names are absolute. The
first element is the REGEXP matching these messages. It can match any number
of variants, e.g. different languages. The remaining elements are all of the
form (DIR . LEAVE). If for any one of these the DIR'th subexpression
(window-width))))
;; Set the EMACS variable, but
;; don't override users' setting of $EMACS.
- (unless (getenv "EMACS") '("EMACS=t"))
+ (unless (getenv "EMACS")
+ (list (concat "EMACS=" invocation-directory invocation-name)))
(copy-sequence process-environment))))
(set (make-local-variable 'compilation-arguments)
(list command mode name-function highlight-regexp))
(current-buffer)))
(move-overlay compilation-highlight-overlay
(point) end (current-buffer)))
- (if (numberp next-error-highlight)
- (setq next-error-highlight-timer
- (run-at-time next-error-highlight nil 'delete-overlay
- compilation-highlight-overlay)))
- (if (not (or (eq next-error-highlight t)
- (numberp next-error-highlight)))
- (delete-overlay compilation-highlight-overlay))))))
+ (if (or (eq next-error-highlight t)
+ (numberp next-error-highlight))
+ ;; We want highlighting: delete overlay on next input.
+ (add-hook 'pre-command-hook
+ 'compilation-goto-locus-delete-o)
+ ;; We don't want highlighting: delete overlay now.
+ (delete-overlay compilation-highlight-overlay))
+ ;; We want highlighting for a limited time:
+ ;; set up a timer to delete it.
+ (when (numberp next-error-highlight)
+ (setq next-error-highlight-timer
+ (run-at-time next-error-highlight nil
+ 'compilation-goto-locus-delete-o)))))))
(when (and (eq next-error-highlight 'fringe-arrow))
+ ;; We want a fringe arrow (instead of highlighting).
(setq next-error-overlay-arrow-position
(copy-marker (line-beginning-position))))))
+(defun compilation-goto-locus-delete-o ()
+ (delete-overlay compilation-highlight-overlay)
+ ;; Get rid of timer and hook that would try to do this again.
+ (if (timerp next-error-highlight-timer)
+ (cancel-timer next-error-highlight-timer))
+ (remove-hook 'pre-command-hook
+ 'compilation-goto-locus-delete-o))
\f
(defun compilation-find-file (marker filename directory &rest formats)
"Find a buffer for file FILENAME.