all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Philipp Stephani <p.stephani2@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 24372@debbugs.gnu.org
Subject: bug#24372: 25.1.50; After losing focus, cursor is hidden when moving point
Date: Sun, 11 Sep 2016 17:37:36 +0000	[thread overview]
Message-ID: <CAArVCkTnYYx+40U2ojoZRro9KY7WKFeFafC32QfQx7w2BBeMGg@mail.gmail.com> (raw)
In-Reply-To: <8360q2be2b.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 3813 bytes --]

Eli Zaretskii <eliz@gnu.org> schrieb am So., 11. Sep. 2016 um 18:23 Uhr:

> > From: Philipp Stephani <p.stephani2@gmail.com>
> > Date: Sun, 11 Sep 2016 09:15:49 +0000
> > Cc: 24372@debbugs.gnu.org
> >
> >  > OK, I guess one issue is that setting blink-cursor-delay doesn't
> restart blink-cursor-idle-timer.
> >  (Similarly,
> >  > changing blink-cursor-interval doesn't restart blink-cursor-timer.)
> While obviously we can't fix that
> >  when using
> >  > setq, I'd suggest adding custom setters to the variables nevertheless.
> >
> > I've attached a patch for this. It shouldn't be controversial because it
> only reduces the possibility for surprises,
> > but doesn't change any behavior.
>
> Using the maximum of blink-cursor-delay and blink-cursor-interval
> effectively removes the user's ability of controlling the delay before
> the cursor starts blinking when Emacs becomes idle, doesn't it?


Yes. I tried to figure out what the intention of blink-cursor-delay was,
but couldn't find anything (the commit where it was introduced doesn't
provide any motivation). I don't think that blink-cursor-delay <
blink-cursor-interval ever makes sense. The other way round (delay >
interval) is useful if you want to keep the cursor visible for a bit longer
after a command.


>   If
> so, I don't think this could qualify as not changing any behavior.
>

My comment is about the other patch, the one that fixes the customization
options.


> Plus, if the user sets the interval to a very small value, we have the
> same problem again.
>

True, but so far that hasn't happened. Also it seems less surprising: if
you increase the frequency, the cursor blinks faster, as expected.


>
> How about a variant of this below?  It uses a fixed limitation from
> below on the delay, but only for the first blink.  (The value 0.2 was
> found by experimentation, not sure if we need to add yet another
> defcustom for that.)
>

I don't think we should introduce magic numbers or further customization
options. (TBH, I already doubt the usefulness of blink-cursor-delay, but
that's already there.)


>
> > It does introduce the adverse side effect that now the first blink takes
> one second (the sum of
> > cursor-blink-delay and cursor-blink-interval).
>
> Right.
>
> > I've attached another patch with the change I have in mind.
>
> This has a disadvantage of creating a new timer object each time,
> which I think we'd like to avoid: too much consing.  (Also, don't you
> need to set the timer variable to nil when the timer is disabled?)
>

I don't understand - the patch doesn't create any additional timers, it
only changes the initial delay of the idle-timer.


>
> I'd prefer something along the lines of the first idea, the patch
> below or some variant of it.  It is simpler.
>
> diff --git a/lisp/frame.el b/lisp/frame.el
> index cfd40bf..4540172 100644
> --- a/lisp/frame.el
> +++ b/lisp/frame.el
> @@ -2114,7 +2114,7 @@ blink-cursor-check
>              (not blink-cursor-idle-timer))
>      (remove-hook 'post-command-hook 'blink-cursor-check)
>      (setq blink-cursor-idle-timer
> -          (run-with-idle-timer blink-cursor-delay
> +          (run-with-idle-timer (max 0.2 blink-cursor-delay)
>                                 blink-cursor-delay
>                                 'blink-cursor-start))))
>
> @@ -2148,7 +2148,7 @@ blink-cursor-mode
>      (add-hook 'focus-in-hook #'blink-cursor-check)
>      (add-hook 'focus-out-hook #'blink-cursor-suspend)
>      (setq blink-cursor-idle-timer
> -          (run-with-idle-timer blink-cursor-delay
> +          (run-with-idle-timer (max 0.2 blink-cursor-delay)
>                                 blink-cursor-delay
>                                 #'blink-cursor-start))))
>
>
My patch is identical, except is uses blink-cursor-interval as lower bound.

[-- Attachment #2: Type: text/html, Size: 6554 bytes --]

  reply	other threads:[~2016-09-11 17:37 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-05 19:16 bug#24372: 25.1.50; After losing focus, cursor is hidden when moving point Philipp Stephani
2016-09-05 21:29 ` Clément Pit--Claudel
2016-09-06 16:03 ` Eli Zaretskii
2016-09-09 15:59   ` Philipp Stephani
2016-09-09 16:07     ` Eli Zaretskii
2016-09-09 16:20       ` Philipp Stephani
2016-09-09 16:29         ` Philipp Stephani
2016-09-09 17:18           ` Philipp Stephani
2016-09-09 18:59             ` Philipp Stephani
2016-09-10  7:21             ` Eli Zaretskii
2016-09-11  9:15               ` Philipp Stephani
2016-09-11 16:23                 ` Eli Zaretskii
2016-09-11 17:37                   ` Philipp Stephani [this message]
2016-09-11 19:18                     ` Eli Zaretskii
2016-09-23 14:28                       ` Eli Zaretskii
2016-09-25 19:09                       ` Philipp Stephani
2016-10-01  8:25                         ` Eli Zaretskii
2016-10-01 16:11                           ` Philipp Stephani
2016-10-01 17:29                             ` Eli Zaretskii
2016-10-01 18:10                               ` Philipp Stephani
2016-10-02  7:12                                 ` Eli Zaretskii
2016-10-01 18:16                             ` Philipp Stephani
2016-10-02  7:14                               ` Eli Zaretskii
2016-10-02 17:56                                 ` Philipp Stephani

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=CAArVCkTnYYx+40U2ojoZRro9KY7WKFeFafC32QfQx7w2BBeMGg@mail.gmail.com \
    --to=p.stephani2@gmail.com \
    --cc=24372@debbugs.gnu.org \
    --cc=eliz@gnu.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.