unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Gerd Möllmann" <gerd.moellmann@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 56155@debbugs.gnu.org
Subject: bug#56155: 29.0.50; Options menu, toggle menu items not updated
Date: Tue, 28 Jun 2022 14:06:22 +0200	[thread overview]
Message-ID: <12D696D2-1502-48DC-8FD7-20183C47EDAD@gmail.com> (raw)
In-Reply-To: <83pmizele6.fsf@gnu.org>


[-- Attachment #1.1: Type: text/plain, Size: 1442 bytes --]



> On 2022-06-23,, at 12:15 , Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> From: Gerd Möllmann <gerd.moellmann@gmail.com>
>> Date: Thu, 23 Jun 2022 11:09:16 +0200
>> 
>> 1. emacs -Q
>> 2. From the Options menu, select Save Places in Files...
>> 3. The toggle mark on the menu item remains unchanged
>> 
>> This seems to work for some menu items, but not for others.  Maybe NS
>> specific, I don't know.
> 
> I don't see it here, so it's probably NS specific, yes.

I think I have it.

Some toggle menu items lead to a force-mode-line-update, others don't.  For instance, Options -> Hightlight Active Region does lead to a f-m-l-u, Options -> Enter Debugger on Error doesn't.  Consequently, the next redisplay after selecting the toggle either decides to call set_frame_menubar or not.  If it isn't run, the toggle marks are not updated in the menu.

What I don't know is if this can only be seen on macOS.  On macOS, one can select an option from the menu bar, re-open the Options menu and select another, wihout Emacs running anything in between the two selections that can itself set update_mode_lines.  If anything else sets update_mode_lines, the ill effect will not show up.  Just clicking in the text area runs a command...

A possible fix that works for me is attached.

Passing t to force-mode-line-update in the patch is be a bit brutal, perhaps.  I didn't want to play games after some brutal debugging.



[-- Attachment #1.2: 0001-Ensure-correct-toggle-menu-item-display.patch --]
[-- Type: application/octet-stream, Size: 1337 bytes --]

From 625b0ea76630314d3c88b31ad9aab0d159d2873c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= <gerd@gnu.org>
Date: Tue, 28 Jun 2022 13:55:35 +0200
Subject: [PATCH] Ensure correct toggle menu item display

* lisp/menu-bar.el (menu-bar-make-toggle-command): Call
force-mode-line-update. (Bug#56155)
---
 lisp/menu-bar.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 4a943d2528..92989fcfb2 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -749,7 +749,11 @@ menu-bar-make-toggle-command
        ;; interactively, because the purpose is to mark the variable as a
        ;; candidate for `Save Options', and we do not want to save options that
        ;; the user has already set explicitly in the init file.
-       (when interactively (customize-mark-as-set ',variable)))
+       (when interactively
+         (customize-mark-as-set ',variable))
+       ;; Toggle menu items must make sure that the menu is updated so
+       ;; that toggle marks are drawn in the right state.
+       (force-mode-line-update t))
      '(menu-item ,item-name ,command :help ,help
                  :button (:toggle . (and (default-boundp ',variable)
                                          (default-value ',variable)))
-- 
2.36.1


[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 874 bytes --]

  reply	other threads:[~2022-06-28 12:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-23  9:09 bug#56155: 29.0.50; Options menu, toggle menu items not updated Gerd Möllmann
2022-06-23 10:15 ` Eli Zaretskii
2022-06-28 12:06   ` Gerd Möllmann [this message]
2022-06-28 21:21     ` Stefan Kangas
2022-06-28 23:38       ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-29  5:32         ` Gerd Möllmann
2022-06-29  6:12         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-29  8:44           ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-29  8:53             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-29  6:04   ` Gerd Möllmann
2022-06-29 10:16     ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=12D696D2-1502-48DC-8FD7-20183C47EDAD@gmail.com \
    --to=gerd.moellmann@gmail.com \
    --cc=56155@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).