bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#43383: 26.3; `toggle-menu-bar-mode-from-frame'


From: Drew Adams
Subject: bug#43383: 26.3; `toggle-menu-bar-mode-from-frame'
Date: Mon, 14 Sep 2020 00:00:37 +0000 (UTC)

> > I don't understand the doc string:
> >
> >  Toggle menu bar on or off, based on the status of the current frame.
> >  See `menu-bar-mode' for more information.
> >
> > I have no idea what is meant by "based on the status of the current
> > frame".  Is the status whether it shows the menu-bar?
> >
> > Furthermore, this seems to be used only in menu Options > Show/Hide.
> > Which means it's only visible when the menu-bar is visible, right?
> 
> It's very confusing indeed, but the patch that introduces this has a
> long essay about why it was added.
> 
> It's something to do with...  multi-tty?  Which clarifies the meaning of
> "Toggle menu bar on or off, based on the status of the current frame."
> somewhat, since the exegesis says that the (global) status may be...
> wrong?
> 
> That sounds like a bug, doesn't it?

Sorry, but I still don't understand it.  I don't
really care about this, so I'll leave it up to
others (e.g. you, if you want) to figure out what,
if anything, should be done about it.

I suspect that even the command name is bad.

----

FWIW, I have a similarly named command, but it does
what I'd expect a command with such a name to do:

(defun toggle-menu-bar-for-frame (&optional frame)
  "Toggle showing the menu-bar for selected frame.
When called from Lisp, optional arg FRAME is used instead of the
selected frame."
  (interactive)
  (let ((now  (or (frame-parameter frame 'menu-bar-lines)  0)))
    (set-frame-parameter frame 'menu-bar-lines (if (zerop now) 1 0))))

IOW, instead of toggling all existing and future frames,
which is what `menu-bar-mode' does, it toggles only the
selected frame.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]