emacs-devel
[Top][All Lists]
Advanced

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

Re: `overlay-arrow-position' should be automatically buffer-local


From: Nick Roberts
Subject: Re: `overlay-arrow-position' should be automatically buffer-local
Date: Wed, 19 Oct 2005 19:13:48 +1300

 >    I believe the variable `overlay-arrow-position' should
 >    automatically become buffer-local whenever it is set.
 > 
 >    It appears that Gnus fails to do this manually, instead
 >    ending up setting the global value to a marker that refers
 >    to the Gnus summary buffer, which doesn't make sense.
 > 
 >    In fact, I see no reason to ever set the global value of
 >    this variable.  In any case, it should not be the default.

Have you found this a problem in practice?

I think Gnus and Edebug are the only two features that now use the global
values of overlay-arrow-position (so they would steal the arrow from each
other if they were both active at the same time).

 > I recently noticed when adding an overlay arrow to rcirc that making
 > it `overlay-arrow-position' buffer local *does* work (you can get an
 > arrow in multiple buffers), even though (elisp)Overlay Arrow says:
 > 
 >  - Variable: overlay-arrow-position
 > 
 >      [...]
 > 
 >      The overlay string is displayed only in the buffer that this marker
 >      points into.  Thus, only one buffer can have an overlay arrow at
 >      any given time.
 > 
 > Which I think was true in 21.

I think you've always been able to make overlay-arrow-position buffer-local.
The problem arises when two arrows try to display in the _same_ buffer, then
the local value masks the global value.  Perhaps this will never happen in
Gnus, but in case it does, a good way is to use overlay-arrow-variable-list
(which _is_ new to to Emacs 22):

(defvar gnus-overlay-arrow-position nil)

At startup:

(setq gnus-overlay-arrow-position nil)
(add-to-list 'overlay-arrow-variable-list 'gnus-overlay-arrow-position)

On finishing:

(delq 'gnus-overlay-arrow-position overlay-arrow-variable-list))

Nick




reply via email to

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