all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: storm@cua.dk (Kim F. Storm)
Cc: Hrvoje Niksic <hniksic@xemacs.org>, emacs-devel@gnu.org
Subject: Re: Setting cursor-type does not trigger redisplay of cursor
Date: Wed, 09 Nov 2005 17:08:49 +0100	[thread overview]
Message-ID: <m3y83xiz1q.fsf@kfs-l.imdomain.dk> (raw)
In-Reply-To: <E1EYXhS-0001ks-Nh@fencepost.gnu.org> (Richard M. Stallman's message of "Sat, 05 Nov 2005 18:43:54 -0500")

"Richard M. Stallman" <rms@gnu.org> writes:

>     > Right now, what is it that you need to do to make Emacs really
>     > display the new cursor type?
>
>     In Emacs 21, I need to call (sit-for 0) to force a redisplay.  In
>     Emacs 22 CVS, I am told, that doesn't work.
>
> That is clearly a bug.
>
> It seems to me that it should not be terribly hard to make redisplay
> record the last cursor-type used for redisplay in a given frame, and
> DTRT when it has changed.  So why do anything less convenient?
>
> Would someone like to implement that, please?

I looked at the bug, and the reason why it works for right-left and
down movement, but not for up movement (sometimes) is the call to
sit-for in line-move:

	  (when (line-move-1 arg noerror to-end)
	    (when (not forward)
	      ;; Update display before calling pos-visible-in-window-p,
	      ;; because it depends on window-start being up-to-date.
	      (sit-for 0)


The reason for this update is to handle scrolling in large images.
(This is something which need to be improved after the release).

The problem is that the sit-for runs redisplay before the
post-command-hook, so the cursor type is displayed based on the
previous buffer position rather than the current position when moving
the cursor upwards.

The simple "fix" is to explicitly call force-window-update when
changing the cursor type in the post-command-hook.  IMO, that
work-around is ok for 22.1:

  (defun set-cursor-adaptive ()
    (let ((ocursor cursor-type))
      (setq cursor-type (if (eq (char-after (point)) ?\n) '(bar . 5) t))
      (if (not (equal ocursor cursor-type))
        (force-window-update (current-buffer)))))


-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

  reply	other threads:[~2005-11-09 16:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-31 15:49 Setting cursor-type does not trigger redisplay of cursor Hrvoje Niksic
2005-11-01  9:18 ` Juri Linkov
2005-11-01 13:51   ` Hrvoje Niksic
2005-11-01 20:03     ` Juri Linkov
2005-11-01 21:07       ` Hrvoje Niksic
2005-11-01 22:08         ` Juri Linkov
2005-11-02 10:27   ` Richard M. Stallman
2005-11-02 14:18     ` Hrvoje Niksic
2005-11-03  7:54       ` Juri Linkov
2005-11-03 13:50       ` Richard M. Stallman
2005-11-03 18:04         ` Hrvoje Niksic
2005-11-05 23:43           ` Richard M. Stallman
2005-11-09 16:08             ` Kim F. Storm [this message]
2005-11-09 17:59               ` Juri Linkov
2005-11-10  2:09               ` Richard M. Stallman
2005-11-10  8:30                 ` Kim F. Storm
2005-11-10 20:49                   ` Richard M. Stallman
2005-11-03  7:54     ` Juri Linkov
2005-11-03 21:41       ` Richard M. Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3y83xiz1q.fsf@kfs-l.imdomain.dk \
    --to=storm@cua.dk \
    --cc=emacs-devel@gnu.org \
    --cc=hniksic@xemacs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.