help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Box cursor at EoL


From: Marcus Harnisch
Subject: Re: Box cursor at EoL
Date: Thu, 6 Oct 2022 22:09:05 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1

On 06/10/2022 21.34, Stefan Monnier via Users list for the GNU Emacs text editor wrote:
I suspect the `while-no-input` makes no difference here.
And the next three lines can be simplified to:

     (setq cursor-type
           (if (eolp) cursor-type-at-eol (default-value 'cursor-type)))

;; Oddly this doesn't seem to always work with Emacs 27.1. Never
;; noticed any problem with 26.3.
(add-hook 'post-command-hook 'change-cursor-at-end-of-line)

Nowadays you could also use the `pre-redisplay-function` hook which
could have some advantages, but in any case the limit of the above
approach is that it can't correctly account for all the cases where the
buffer is displayed in several windows, with some windows' cursor at
EOL and others not :-(

Thank you very much for your advice. I see the issue with same buffer/multiple windows but that is a situation that is rarely part of my work pattern. When it is, I am usually not worried about trailing whitespace at the same time :)






reply via email to

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