From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#20285: 25.0.50; blink-cursor-mode sometimes stops blinking Date: Fri, 10 Apr 2015 15:42:01 +0300 Message-ID: <83h9sotasm.fsf@gnu.org> References: <8761954apb.fsf@gnu.org> <831tjtfijq.fsf@gnu.org> <83zj6he14h.fsf@gnu.org> <87wq1kmnmh.fsf@gnu.org> <83d23cv2hj.fsf@gnu.org> <87sic8miwb.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1428669805 4418 80.91.229.3 (10 Apr 2015 12:43:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 Apr 2015 12:43:25 +0000 (UTC) Cc: 20285@debbugs.gnu.org To: Tassilo Horn Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Apr 10 14:43:13 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YgYHA-0001Hr-Ir for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Apr 2015 14:43:12 +0200 Original-Received: from localhost ([::1]:39164 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YgYH9-0004R0-T8 for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Apr 2015 08:43:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53817) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YgYH6-0004Qi-9J for bug-gnu-emacs@gnu.org; Fri, 10 Apr 2015 08:43:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YgYH1-0005nh-AI for bug-gnu-emacs@gnu.org; Fri, 10 Apr 2015 08:43:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33915) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YgYH1-0005nX-6z for bug-gnu-emacs@gnu.org; Fri, 10 Apr 2015 08:43:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YgYH0-0005rJ-J6 for bug-gnu-emacs@gnu.org; Fri, 10 Apr 2015 08:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Apr 2015 12:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20285 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20285-submit@debbugs.gnu.org id=B20285.142866973222442 (code B ref 20285); Fri, 10 Apr 2015 12:43:02 +0000 Original-Received: (at 20285) by debbugs.gnu.org; 10 Apr 2015 12:42:12 +0000 Original-Received: from localhost ([127.0.0.1]:51924 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YgYGB-0005pu-Ot for submit@debbugs.gnu.org; Fri, 10 Apr 2015 08:42:12 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:44575) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YgYG8-0005pd-4w for 20285@debbugs.gnu.org; Fri, 10 Apr 2015 08:42:09 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0NML00500CA4GG00@a-mtaout21.012.net.il> for 20285@debbugs.gnu.org; Fri, 10 Apr 2015 15:42:01 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NML0059CCM1FI20@a-mtaout21.012.net.il>; Fri, 10 Apr 2015 15:42:01 +0300 (IDT) In-reply-to: <87sic8miwb.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:101378 Archived-At: > From: Tassilo Horn > Cc: 20285@debbugs.gnu.org > Date: Fri, 10 Apr 2015 11:28:52 +0200 > > I think that it should be generically possible from Lisp to check if a > redisplay has been performed within a given time frame. That might be > useful for other stuff next to `blink-cursor-mode', too. > > That could be achieved by `redisplay' increasing some integer > redisplay_counter variable whose value can be accessed from Lisp. But "was redisplay performed?" does not have a simple yes/no answer. Depending on the circumstances, the display engine can decide to redisplay one or more windows on one or more frames. By contrast, you (in this case) are only interested in the selected window on the selected frame. So I don't think a simple counter will cut it; you might need a counter per window or some such. And other use cases might want something even more fine-granular, perhaps. > Then `blink-cursor-timer-function' could check if the invisibility of > the cursor has really been manifested (on the glass) and force a > redisplay when toggling it visible again. > > --8<---------------cut here---------------start------------->8--- > (defvar blink-cursor-redisplay-counter nil) > > (defun blink-cursor-timer-function () > "Timer function of timer `blink-cursor-timer'." > (let ((cursor-shown (internal-show-cursor-p))) > (internal-show-cursor nil (not cursor-shown)) > ;; If the cursor was invisible in the last cycle and a redisplay has been > ;; performed there, ensure a redisplay now so that it won't end up > ;; invisible for an indefinite amount of time. > (unless (or cursor-shown > (= blink-cursor-redisplay-counter > redisplay-counter)) > (redisplay 'force)) > (setq blink-cursor-redisplay-counter redisplay-counter)) What happens if the blink-cursor timer doesn't get run? > The effect would be that if a timer running too long or processing input > stops the blinking of the cursor, that would at happen at least in the > visible cursor state. If it started with the cursor visible, yes. But what if the heavy processing started with the cursor blinked off, and the timer function didn't get to run for a long time?