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#23026: 25.0.92; menu-bar bug? Date: Wed, 16 Mar 2016 17:36:47 +0200 Message-ID: <83y49ia0z4.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1458142706 24465 80.91.229.3 (16 Mar 2016 15:38:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Mar 2016 15:38:26 +0000 (UTC) Cc: 23026@debbugs.gnu.org To: Leo Liu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 16 16:38:14 2016 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 1agDWV-00026Q-DO for geb-bug-gnu-emacs@m.gmane.org; Wed, 16 Mar 2016 16:38:11 +0100 Original-Received: from localhost ([::1]:57067 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agDWU-0003QS-Qr for geb-bug-gnu-emacs@m.gmane.org; Wed, 16 Mar 2016 11:38:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34863) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agDWP-0003LD-8w for bug-gnu-emacs@gnu.org; Wed, 16 Mar 2016 11:38:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1agDWM-0003PR-0m for bug-gnu-emacs@gnu.org; Wed, 16 Mar 2016 11:38:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53214) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agDWL-0003PM-Uh for bug-gnu-emacs@gnu.org; Wed, 16 Mar 2016 11:38:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1agDWL-0001vp-Nd for bug-gnu-emacs@gnu.org; Wed, 16 Mar 2016 11:38: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: Wed, 16 Mar 2016 15:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23026 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23026-submit@debbugs.gnu.org id=B23026.14581426417376 (code B ref 23026); Wed, 16 Mar 2016 15:38:01 +0000 Original-Received: (at 23026) by debbugs.gnu.org; 16 Mar 2016 15:37:21 +0000 Original-Received: from localhost ([127.0.0.1]:50341 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1agDVg-0001uu-Qc for submit@debbugs.gnu.org; Wed, 16 Mar 2016 11:37:20 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:43674) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1agDVg-0001uh-05 for 23026@debbugs.gnu.org; Wed, 16 Mar 2016 11:37:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1agDVX-0003Hr-2o for 23026@debbugs.gnu.org; Wed, 16 Mar 2016 11:37:14 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34943) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agDVW-0003Hn-VS; Wed, 16 Mar 2016 11:37:11 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1211 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1agDVV-0000JA-O7; Wed, 16 Mar 2016 11:37:10 -0400 In-reply-to: (message from Leo Liu on Wed, 16 Mar 2016 13:38:20 +0800) 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:114973 Archived-At: > From: Leo Liu > Date: Wed, 16 Mar 2016 13:38:20 +0800 > > 1. Start a GUI emacs with -q > 2. load the attached t.el file > 3. M-x test > 4. look at the menu-bar and notice there is `Test' menu > 5. mouse-click the first line and notice `Test' is gone > 6. mouse-click the second line so that `Test' reappears > 7. C-p to move to first line and notice `Test' doesn't disappear > > The difference between 5 and 7 is puzzling. Is this a bug? No, it's a redisplay optimization: Emacs doesn't redraw the menu bar when all that's changed is cursor position. In 99.999% of cases, cursor motion doesn't require any changes in the menu-bar items, so redrawing the menu bar after each movement of point would just slow down cursor motion and cause annoying flickering of the menu bar. Therefore, we don't do it. I'm not sure I understand what's special about this use case that we'd want to disable this optimization. By contrast, a mouse click potentially activates/deactivates the mark and extends or removes the region highlight, so many redisplay optimizations are disabled when we process the click -- it isn't just moving point. > How to make the two behave consistently? By "consistently" I believe you mean you'd like the menu bar updated when point moves via keyboard commands, yes? If so, you should force a more thorough redisplay, e.g. by calling force-mode-line-update, when point moves in a way that requires a change in the menu bar. How exactly to do that depends on your real-life use case -- it could be a post-command-hook, or a special binding in the keymap which you put in the property, or a function in cursor-sensor-functions property, or something else.