GNU bug report logs -
#24153
25.1; Feature request: per-buffer cursor-color variable
Previous Next
To reply to this bug, email your comments to 24153 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24153
; Package
emacs
.
(Thu, 04 Aug 2016 15:28:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Tej Chajed <tchajed <at> mit.edu>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Thu, 04 Aug 2016 15:28:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Currently there's a per-buffer cursor-type variable that is respected
per window and a single cursor-color variable that applies to the
entire frame.
Evil emulates a per-window cursor color in order to have the cursor
color of the active window reflect the buffer state (eg,
distinguishing insert and normal mode). It does so by advising
set-window and calling set-cursor-color if necessary; this can lead to
slowdowns when code calls set-window repeatedly (eg, through
with-selected-window).
It seems like the right way for evil to manage the cursor color is to
have an analogous per-buffer cursor-color variable natively provided
by emacs. Is this a doable feature?
Thanks!
Tej
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24153
; Package
emacs
.
(Thu, 04 Aug 2016 17:15:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 24153 <at> debbugs.gnu.org (full text, mbox):
> From: Tej Chajed <tchajed <at> mit.edu>
> Date: Thu, 4 Aug 2016 11:08:12 -0400
>
> It seems like the right way for evil to manage the cursor color is to
> have an analogous per-buffer cursor-color variable natively provided
> by emacs. Is this a doable feature?
I don't see up front why not. Patches welcome.
Thanks.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24153
; Package
emacs
.
(Fri, 05 Aug 2016 01:22:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 24153 <at> debbugs.gnu.org (full text, mbox):
Tej Chajed <tchajed <at> mit.edu> writes:
>
> Evil emulates a per-window cursor color in order to have the cursor
> color of the active window reflect the buffer state (eg,
> distinguishing insert and normal mode). It does so by advising
> set-window and calling set-cursor-color if necessary; this can lead to
> slowdowns when code calls set-window repeatedly (eg, through
> with-selected-window).
There's no `set-window' function, did you mean `select-window'? I find
in the docstring for that function:
Selections that "really count" are those causing a visible change in
the next redisplay of WINDOW’s frame and should be always recorded.
So if you think of running a function each time a window gets
selected put it on ‘buffer-list-update-hook’.
Perhaps using ‘buffer-list-update-hook’ instead of advising
`select-window' would help?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24153
; Package
emacs
.
(Fri, 05 Aug 2016 02:18:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 24153 <at> debbugs.gnu.org (full text, mbox):
On Thu, Aug 4, 2016 at 9:21 PM, <npostavs <at> users.sourceforge.net> wrote:
> Tej Chajed <tchajed <at> mit.edu> writes:
>>
>> Evil emulates a per-window cursor color in order to have the cursor
>> color of the active window reflect the buffer state (eg,
>> distinguishing insert and normal mode). It does so by advising
>> set-window and calling set-cursor-color if necessary; this can lead to
>> slowdowns when code calls set-window repeatedly (eg, through
>> with-selected-window).
>
> There's no `set-window' function, did you mean `select-window'?
Yes, my mistake - the advice is on select-window.
>
> Perhaps using ‘buffer-list-update-hook’ instead of advising
> `select-window' would help?
I haven't fully debugged this alternative, but it doesn't seem to
work. company-coq still uses save-window-excursion in
company-coq-ask-prover, which triggers the buffer-list-update-hook. In
addition, even with company-coq disabled this somehow doesn't call
evil-refresh-cursor enough; starting from insert mode, after the first
proof command, the color gets stuck on the normal mode color, and then
doesn't change until some other buffer list update.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24153
; Package
emacs
.
(Fri, 05 Aug 2016 02:50:01 GMT)
Full text and
rfc822 format available.
Message #17 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 2016-08-04 21:21, npostavs <at> users.sourceforge.net wrote:
> Perhaps using ‘buffer-list-update-hook’ instead of advising
> `select-window' would help?
Hmmm. I don't think that would work.
Assume there are two windows, one showing a buffer in evil's normal editing mode, and one showing a buffer in evil's edit mode. If the user has configured evil to show the normal-mode cursor in green and the insert-mode cursor in purple, then evil needs to change the cursor color every time the user switches between these two windows, and (I don't think that) buffer-list-update-hook won't be sufficient for that.
Cheers,
Clément.
[signature.asc (application/pgp-signature, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24153
; Package
emacs
.
(Fri, 05 Aug 2016 16:38:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 24153 <at> debbugs.gnu.org (full text, mbox):
>>> Evil emulates a per-window cursor color in order to have the cursor
>>> color of the active window reflect the buffer state (eg,
>>> distinguishing insert and normal mode). It does so by advising
>>> set-window and calling set-cursor-color if necessary; this can lead to
>>> slowdowns when code calls set-window repeatedly (eg, through
>>> with-selected-window).
>>
>> There's no `set-window' function, did you mean `select-window'?
>
> Yes, my mistake - the advice is on select-window.
>
>>
>> Perhaps using ‘buffer-list-update-hook’ instead of advising
>> `select-window' would help?
>
> I haven't fully debugged this alternative, but it doesn't seem to
> work. company-coq still uses save-window-excursion in
> company-coq-ask-prover, which triggers the buffer-list-update-hook.
Please tell us more about where and why ‘buffer-list-update-hook’
doesn't work in any of your use cases. From what you say here you
expect ‘save-window-excursion’ to _not_ run ‘buffer-list-update-hook’.
Is that correct?
> In
> addition, even with company-coq disabled this somehow doesn't call
> evil-refresh-cursor enough; starting from insert mode, after the first
> proof command, the color gets stuck on the normal mode color, and then
> doesn't change until some other buffer list update.
But IIUC you do not set the buffer of any window in these steps, so why
would you expect ‘buffer-list-update-hook’ to run?
martin
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24153
; Package
emacs
.
(Fri, 05 Aug 2016 16:38:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 24153 <at> debbugs.gnu.org (full text, mbox):
> Assume there are two windows, one showing a buffer in evil's normal
> editing mode, and one showing a buffer in evil's edit mode. If the
> user has configured evil to show the normal-mode cursor in green and
> the insert-mode cursor in purple, then evil needs to change the cursor
> color every time the user switches between these two windows, and (I
> don't think that) buffer-list-update-hook won't be sufficient for
> that.
This would be a bug. ‘select-window’ should always run
‘buffer-list-update-hook’ when NORECORD is nil.
martin
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24153
; Package
emacs
.
(Sat, 06 Aug 2016 02:00:03 GMT)
Full text and
rfc822 format available.
Message #26 received at 24153 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 2016-08-05 12:37, martin rudalics wrote:
>> Assume there are two windows, one showing a buffer in evil's normal
>> editing mode, and one showing a buffer in evil's edit mode. If the
>> user has configured evil to show the normal-mode cursor in green and
>> the insert-mode cursor in purple, then evil needs to change the cursor
>> color every time the user switches between these two windows, and (I
>> don't think that) buffer-list-update-hook won't be sufficient for
>> that.
>
> This would be a bug. ‘select-window’ should always run
> ‘buffer-list-update-hook’ when NORECORD is nil.
I see; thanks for clarifying!
[signature.asc (application/pgp-signature, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24153
; Package
emacs
.
(Sat, 06 Aug 2016 02:11:02 GMT)
Full text and
rfc822 format available.
Message #29 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 2016-08-04 22:17, Tej Chajed wrote:
>>> Perhaps using ‘buffer-list-update-hook’ instead of advising
>>> `select-window' would help?
>
> I haven't fully debugged this alternative, but it doesn't seem to
> work. company-coq still uses save-window-excursion in
> company-coq-ask-prover, which triggers the buffer-list-update-hook.
IIRC I added this save-window-excursion call to work a Proof General issue, back when I didn't know much about PG. Now that I have commit rights there, I could probably move the fix upstream and remove the save-window-excursion call.
Clément.
[signature.asc (application/pgp-signature, attachment)]
This bug report was last modified 9 years and 32 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.