emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: next-error-follow-minor-mode selects location window until next keys


From: Juri Linkov
Subject: Re: next-error-follow-minor-mode selects location window until next keystroke
Date: Wed, 23 Mar 2005 21:43:12 +0200
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/22.0.50 (gnu/linux)

JUAN-LEON Lahoz Garcia <address@hidden> writes:
> (setq next-error-highlight-no-select 2.0)
>
> In the following please suppose that I have activated
> `next-error-follow-minor-mode'.
>
> If in a grep or compilation buffer I move the cursor, the hit location
> buffer is shown in another window. Problem, IMHO, it that this window
> seems to be the selected one (cursor is not hollow and modeline shows
> it as selected window) until next keystroke (that is sent to grep or
> compilation buffer). This is quite confusing for me (specially now
> that great `mode-line-inactive' feature allows a faster visual
> recognition of witch is the selected window).
>
> OTHO, while `next-error-highlight-no-select' works great on
> compilation and grep buffers (and I really like it), occur buffers
> seems to ignore this variable (and also `next-error-highlight').

Does the following patch produce good results for you?  If yes,
it could be also implemented for occur buffers too.

BTW, `next-error-follow-minor-mode' should be renamed to
`next-error-follow-mode' to follow Emacs naming conventions.

Index: lisp/progmodes/compile.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/compile.el,v
retrieving revision 1.347
diff -u -r1.347 compile.el
--- lisp/progmodes/compile.el   3 Mar 2005 20:08:21 -0000       1.347
+++ lisp/progmodes/compile.el   23 Mar 2005 19:38:54 -0000
@@ -1613,6 +1613,8 @@
     (compilation-set-window-height w)
 
     (when highlight-regexp
+      (if (timerp next-error-highlight-timer)
+         (cancel-timer next-error-highlight-timer))
       (unless compilation-highlight-overlay
        (setq compilation-highlight-overlay
              (make-overlay (point-min) (point-min)))
@@ -1632,12 +1634,18 @@
              (move-overlay compilation-highlight-overlay
                            (point) end (current-buffer)))
            (if (numberp next-error-highlight)
-               (sit-for next-error-highlight))
-           (if (not (eq next-error-highlight t))
+               (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))))))
     (when (and (eq next-error-highlight 'fringe-arrow))
       (set (make-local-variable 'overlay-arrow-position)
           (copy-marker (line-beginning-position))))))
+
+(defvar next-error-highlight-timer nil)
+
 
 (defun compilation-find-file (marker filename dir &rest formats)
   "Find a buffer for file FILENAME.

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]