From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#24372: 25.1.50; After losing focus, cursor is hidden when moving point Date: Sun, 11 Sep 2016 19:23:40 +0300 Message-ID: <8360q2be2b.fsf@gnu.org> References: <83a8flaud3.fsf@gnu.org> <831t0t83br.fsf@gnu.org> <83mvjg8bk2.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1473611068 25633 195.159.176.226 (11 Sep 2016 16:24:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Sep 2016 16:24:28 +0000 (UTC) Cc: 24372@debbugs.gnu.org To: Philipp Stephani Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 11 18:24:22 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bj7YE-0004wW-5A for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Sep 2016 18:24:14 +0200 Original-Received: from localhost ([::1]:38267 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bj7YC-0004h6-42 for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Sep 2016 12:24:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bj7Y7-0004gx-4A for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2016 12:24:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bj7Y2-0001O1-1Y for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2016 12:24:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58880) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bj7Y1-0001Nv-Tt for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2016 12:24:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bj7Y1-0002X7-Nn for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2016 12:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Sep 2016 16:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24372 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24372-submit@debbugs.gnu.org id=B24372.14736110329720 (code B ref 24372); Sun, 11 Sep 2016 16:24:01 +0000 Original-Received: (at 24372) by debbugs.gnu.org; 11 Sep 2016 16:23:52 +0000 Original-Received: from localhost ([127.0.0.1]:56592 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bj7Xr-0002Wi-Ng for submit@debbugs.gnu.org; Sun, 11 Sep 2016 12:23:51 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bj7Xq-0002WU-FU for 24372@debbugs.gnu.org; Sun, 11 Sep 2016 12:23:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bj7Xh-0001Ex-Fb for 24372@debbugs.gnu.org; Sun, 11 Sep 2016 12:23:45 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49915) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bj7Xh-0001EZ-C8; Sun, 11 Sep 2016 12:23:41 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1242 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bj7Xf-000873-KN; Sun, 11 Sep 2016 12:23:40 -0400 In-reply-to: (message from Philipp Stephani on Sun, 11 Sep 2016 09:15:49 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:123178 Archived-At: > From: Philipp Stephani > 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? If so, I don't think this could qualify as not changing any behavior. Plus, if the user sets the interval to a very small value, we have the same problem again. 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.) > 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'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))))