GNU bug report logs -
#6037
24.0.50; menu-bar-mode function doesn't toggle
Previous Next
Reported by: Joseph Brenner <doom <at> kzsu.stanford.edu>
Date: Mon, 26 Apr 2010 11:11:02 UTC
Severity: normal
Tags: notabug
Done: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Stefan Monnier wrote:
>> Well the ideal is that hitting f12 should enable or disable the various
>> gui features that I typically don't care about such as the menu-bar and
>> so on. Admittedly, the above code is a hack in an inbetween state.
>> Currently I have it revised like so:
>
>> (global-set-key [f12] '(lambda ()
>> (interactive)
>> (menu-bar-mode 'toggle)
>> (scroll-bar-mode 'toggle)
>> (doom-toggle-use-dialog-box)
>> ))
>
> That makes sense. But then I'd recommend the code below instead:
>
>> (global-set-key [f12] (lambda ()
>> (interactive)
>> (call-interactively 'menu-bar-mode)
>> (call-interactively 'scroll-bar-mode)
>> (doom-toggle-use-dialog-box)))
>
> which will have the following impact:
> - it will tell customize about those changes (so "M-x customize-variable
> RET menu-bar-mode" will not complain about a variable set from
> outside, and it will let you save the current state.
Really? What is the connection between call-interactively and customize?
> - You should be able to do C-u -1 f12 to forcibly turn off
> and C-u 1 f12 to forcibly turn on those GUI elements.
Really? In the past I've had to bind prefix-arg to the value of
current-prefix-arg around call-interactively, to get the "interior"
command to inherit the prefix arg of the exterior command.
> - You'll get a minibuffer messages about the menu-bar-mode being
> enabled/disabled.
Why doesn't scroll-bar-mode display the same messages?
> - It will work across "all" Emacs versions (the above code will already
> work with emacs-2[234] and I'm not sure which other versions have
> menu-bar-mode and scroll-bar-mode, so maybe it's not that big
> a difference).
(FOO-bar-mode nil) should also toggle across those versions (and older versions)
-- but does it?
--
Kevin Rodgers
Denver, Colorado, USA
This bug report was last modified 13 years and 303 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.