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

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

Re: fringe arrow conflict between compile and gud?


From: Juri Linkov
Subject: Re: fringe arrow conflict between compile and gud?
Date: Fri, 01 Apr 2005 07:02:46 +0300
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/22.0.50 (gnu/linux)

>> I see no problem with the fringe arrow in the compilation buffer,
>> because other packages don't try to set their own arrows here,
>> so there are no conflicts in the compilation buffer.
>
> and:
>
>> Perhaps Edebug should be fixed too in the same way as you fixed GUD?
>> Edebug currently uses the global arrow and steals it from other packages
>> (e.g. from Gnus).
>
> Using your reasoning for the compilation buffer, it would presumably
> be enough to make overlay-arrow-position a local variable in Gnus.

Yes, making overlay-arrow-position a local variable in Gnus would be good,
but only if the overlay-arrow-string will be visible on text-only terminals.

> Have you tried your patch?

The previous version of the patch doesn't work on text-only terminals.

> It look wrong to me. It shouldn't need a local variable:
>
> (defvar next-error-overlay-arrow-position nil)
> (put 'next-error-overlay-arrow-position 'overlay-arrow-string "=>")

Thanks for the suggestion to put "=>" on the overlay-arrow-string
property.  But I wonder why Emacs can't use "=>" by default
on text-only terminals when this property is nil?

> (add-to-list 'overlay-arrow-variable-list 'next-error-overlay-arrow-position)
> etc
>
> and replace (one) overlay-arrow-position
> with next-error-overlay-arrow-position.

There are two different arrows related to compilation and grep:
one is displayed in the compilation buffer, and another indicates
the line found by `next-error' in the source buffer.

The latter can be displayed in any buffer and so should be
added to overlay-arrow-variable-list to avoid conflicts.
The former can appear only in the compilation buffer and so it
is sufficient to make it a local variable.  To display the arrow
in the compilation buffer on text-only terminals and to not share
the variable overlay-arrow-string with other packages, it could be
made local too.

It seems everything works with the following patch:

Index: lisp/simple.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/simple.el,v
retrieving revision 1.705
diff -u -r1.705 simple.el
--- lisp/simple.el      29 Mar 2005 23:17:30 -0000      1.705
+++ lisp/simple.el      1 Apr 2005 02:48:10 -0000
@@ -114,6 +114,9 @@
 
 (defvar next-error-highlight-timer nil)
 
+(defvar next-error-overlay-arrow-position nil)
+(put 'next-error-overlay-arrow-position 'overlay-arrow-string "=>")
+
 (defvar next-error-last-buffer nil
   "The most recent next-error buffer.
 A buffer becomes most recent when its compilation, grep, or

Index: lisp/progmodes/compile.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/compile.el,v
retrieving revision 1.348
diff -u -r1.348 compile.el
--- lisp/progmodes/compile.el   29 Mar 2005 04:56:44 -0000      1.348
+++ lisp/progmodes/compile.el   1 Apr 2005 02:52:30 -0000
@@ -1233,6 +1233,9 @@
   (make-local-variable 'compilation-messages-start)
   (make-local-variable 'compilation-error-screen-columns)
   (make-local-variable 'overlay-arrow-position)
+  (set (make-local-variable 'overlay-arrow-string) "=>")
+  (setq next-error-overlay-arrow-position nil)
+  (add-to-list 'overlay-arrow-variable-list 'next-error-overlay-arrow-position)
   ;; Note that compilation-next-error-function is for interfacing
   ;; with the next-error function in simple.el, and it's only
   ;; coincidentally named similarly to compilation-next-error.
@@ -1641,8 +1644,9 @@
                         (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))))))
+      (setq next-error-overlay-arrow-position
+           (copy-marker (line-beginning-position))))))
+
 
 (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]