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.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 6037 in the body.
You can then email your comments to 6037 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#6037
; Package
emacs
.
(Mon, 26 Apr 2010 11:11:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Joseph Brenner <doom <at> kzsu.stanford.edu>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Mon, 26 Apr 2010 11:11:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
The menu-bar-mode function is not working as a toggle.
Running this will turn on the menu bar, but running it again
will not turn it off:
(menu-bar-mode)
This does work to turn it off:
(menu-bar-mode -1)
This turns it on, as documented:
(menu-bar-mode 1)
Note that running scroll-bar-mode repeatedly does work as a toggle, as
expected for menu-bar-mode:
(scroll-bar-mode)
I used to use this code, and it *did* work as a toggle (possibly in error):
(menu-bar-mode nil)
I've verified this bug with when invoked with -Q.
In GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.16.1)
of 2010-04-25 on fineline
Windowing system distributor `The X.Org Foundation', version 11.0.10600000
configured using `configure '--prefix' '/usr/local/emacs/bzr-042510''
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: nil
value of $LC_CTYPE: nil
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: nil
locale-coding-system: utf-8-unix
default enable-multibyte-characters: t
Major mode: Emacs-Lisp
Minor modes in effect:
global-semanticdb-minor-mode: t
semantic-mode: t
global-ede-mode: t
shell-dirtrack-mode: t
show-paren-mode: t
display-time-mode: t
tooltip-mode: t
mouse-wheel-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-encryption-mode: t
auto-compression-mode: t
column-number-mode: t
line-number-mode: t
transient-mark-mode: t
Recent input:
<return> C-x C-p M-f M-f M-f M-f M-b M-d - 1 C-x C-e
C-e C-x C-e C-x C-e C-n M-b M-d - 1 C-e C-x C-e C-x
C-e C-p C-n C-n C-n C-n M-f M-b M-d - <backspace> n
i l C-x C-s C-a C-n C-l C-p C-p C-p C-l C-n C-n C-p
C-p M-f M-f M-f M-f M-b M-d - 1 C-f C-x C-e C-a C-n
C-x C-s C-p C-p C-l C-x 1 C-n C-k C-x C-o C-x C-s C-p
C-p C-p C-p C-p C-p C-n M-f M-f M-f C-f C-k C-a C-n
C-x C-s C-p C-p C-SPC C-n C-n C-n C-n C-n C-n C-n C-n
C-n M-w C-p C-e C-x C-e <f12> <f12> <f12> <f12> C-p
C-p C-p C-p C-e C-b <backspace> <backspace> <backspace>
C-n C-e C-b <backspace> <backspace> <backspace> C-n
C-n C-n C-x C-e <f12> <f12> <f12> <f12> <f12> <f12>
<f12> <f12> C-p C-p C-p C-p M-b C-e C-b SPC - 1 C-e
C-x C-e C-n C-n C-n C-n C-n C-p C-x C-e <f12> <f12>
C-p C-p C-p C-p C-e SPC ; ; SPC T O D O S-SPC b u g
: SPC w o n ' t SPC t o g g l e C-x C-s C-a C-k C-y
C-x C-s C-n M-x e m a v <backspace> c s SPC v e r SPC
<return> M-x b u g SPC e m SPC <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> e m
a SPC b u SPC <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> b u
g SPC SPC SPC C-g C-x C-g M-h i C-a C-n C-x b <return>
M-x a p r SPC <return> b u g <return> C-x o C-n C-s
r e p o r t C-s C-s C-s C-s C-s C-a C-SPC C-e M-w C-x
C-p M-x C-y <return>
Recent messages:
Saving file /home/doom/lib/emacs/Dots/emacs-setup.el...
Wrote /home/doom/lib/emacs/Dots/emacs-setup.el
Mark set
Saving file /home/doom/lib/emacs/Dots/emacs-setup.el...
Wrote /home/doom/lib/emacs/Dots/emacs-setup.el
GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.16.1) of 2010-04-25 on fineline
Making completion list...
Quit
Mark saved where search started
Mark set
Load-path shadows:
/home/doom/End/Cave/DesktopAutosave/lib/emacs/desktop-recover-setup hides /home/doom/lib/emacs/Dots/desktop-recover-setup
/home/doom/End/Cave/DiredExternalApps/lib/emacs/image-dired hides /home/doom/lib/emacs/image-dired
/home/doom/End/Cave/DiredExternalApps/lib/emacs/dired-external-apps hides /home/doom/lib/emacs/dired-external-apps
/home/doom/lib/emacs/Dots/setup-colors-dark hides /home/doom/lib/emacs/setup-colors-dark
/home/doom/End/Cave/DiredExternalApps/lib/emacs/image-dired hides /usr/local/emacs/bzr-042510/share/emacs/24.0.50/lisp/image-dired
/home/doom/lib/emacs/Dots/strokes hides /usr/local/emacs/bzr-042510/share/emacs/24.0.50/lisp/strokes
/usr/local/emacs/cvs-040510/share/emacs/23.1.90/lisp/mh-e/mh-thread hides /usr/local/emacs/bzr-042510/share/emacs/24.0.50/lisp/mh-e/mh-thread
/usr/local/emacs/cvs-040510/share/emacs/23.1.90/lisp/mh-e/mh-funcs hides /usr/local/emacs/bzr-042510/share/emacs/24.0.50/lisp/mh-e/mh-funcs
/usr/local/emacs/cvs-040510/share/emacs/23.1.90/lisp/mh-e/mh-alias hides /usr/local/emacs/bzr-042510/share/emacs/24.0.50/lisp/mh-e/mh-alias
/usr/local/emacs/cvs-040510/share/emacs/23.1.90/lisp/mh-e/mh-letter hides /usr/local/emacs/bzr-042510/share/emacs/24.0.50/lisp/mh-e/mh-letter
/usr/local/emacs/cvs-040510/share/emacs/23.1.90/lisp/mh-e/mh-buffers hides /usr/local/emacs/bzr-042510/share/emacs/24.0.50/lisp/mh-e/mh-buffers
/usr/local/emacs/cvs-040510/share/emacs/23.1.90/lisp/mh-e/mh-print hides /usr/local/emacs/bzr-042510/share/emacs/24.0.50/lisp/mh-e/mh-print
/usr/local/emacs/cvs-040510/share/emacs/23.1.90/lisp/mh-e/mh-mime hides /usr/local/emacs/bzr-042510/share/emacs/24.0.50/lisp/mh-e/mh-mime
/usr/local/emacs/cvs-040510/share/emacs/23.1.90/lisp/mh-e/mh-xface hides /usr/local/emacs/bzr-042510/share/emacs/24.0.50/lisp/mh-e/mh-xface
/usr/local/emacs/cvs-040510/share/emacs/23.1.90/lisp/mh-e/mh-junk hides /usr/local/emacs/bzr-042510/share/emacs/24.0.50/lisp/mh-e/mh-junk
/usr/local/emacs/cvs-040510/share/emacs/23.1.90/lisp/mh-e/mh-identity hides /usr/local/emacs/bzr-042510/share/emacs/24.0.50/lisp/mh-e/mh-identity
/usr/local/emacs/cvs-040510/share/emacs/23.1.90/lisp/mh-e/mh-tool-bar hides /usr/local/emacs/bzr-042510/share/emacs/24.0.50/lisp/mh-e/mh-tool-bar
/usr/local/emacs/cvs-040510/share/emacs/23.1.90/lisp/mh-e/mh-gnus hides /usr/local/emacs/bzr-042510/share/emacs/24.0.50/lisp/mh-e/mh-gnus
/usr/local/emacs/cvs-040510/share/emacs/23.1.90/lisp/mh-e/mh-limit hides /usr/local/emacs/bzr-042510/share/emacs/24.0.50/lisp/mh-e/mh-limit
/usr/local/emacs/cvs-040510/share/emacs/23.1.90/lisp/mh-e/mh-scan hides /usr/local/emacs/bzr-042510/share/emacs/24.0.50/lisp/mh-e/mh-scan
/usr/local/emacs/cvs-040510/share/emacs/23.1.90/lisp/mh-e/mh-loaddefs hides /usr/local/emacs/bzr-042510/share/emacs/24.0.50/lisp/mh-e/mh-loaddefs
/usr/local/emacs/cvs-040510/share/emacs/23.1.90/lisp/mh-e/mh-show hides /usr/local/emacs/bzr-042510/share/emacs/24.0.50/lisp/mh-e/mh-show
/usr/local/emacs/cvs-040510/share/emacs/23.1.90/lisp/mh-e/mh-folder hides /usr/local/emacs/bzr-042510/share/emacs/24.0.50/lisp/mh-e/mh-folder
/usr/local/emacs/cvs-040510/share/emacs/23.1.90/lisp/mh-e/mh-search hides /usr/local/emacs/bzr-042510/share/emacs/24.0.50/lisp/mh-e/mh-search
/usr/local/emacs/cvs-040510/share/emacs/23.1.90/lisp/mh-e/mh-seq hides /usr/local/emacs/bzr-042510/share/emacs/24.0.50/lisp/mh-e/mh-seq
/usr/local/emacs/cvs-040510/share/emacs/23.1.90/lisp/mh-e/mh-e hides /usr/local/emacs/bzr-042510/share/emacs/24.0.50/lisp/mh-e/mh-e
/usr/local/emacs/cvs-040510/share/emacs/23.1.90/lisp/mh-e/mh-comp hides /usr/local/emacs/bzr-042510/share/emacs/24.0.50/lisp/mh-e/mh-comp
/usr/local/emacs/cvs-040510/share/emacs/23.1.90/lisp/mh-e/mh-compat hides /usr/local/emacs/bzr-042510/share/emacs/24.0.50/lisp/mh-e/mh-compat
/usr/local/emacs/cvs-040510/share/emacs/23.1.90/lisp/mh-e/mh-utils hides /usr/local/emacs/bzr-042510/share/emacs/24.0.50/lisp/mh-e/mh-utils
/usr/local/emacs/cvs-040510/share/emacs/23.1.90/lisp/mh-e/mh-inc hides /usr/local/emacs/bzr-042510/share/emacs/24.0.50/lisp/mh-e/mh-inc
/usr/local/emacs/cvs-040510/share/emacs/23.1.90/lisp/mh-e/mh-speed hides /usr/local/emacs/bzr-042510/share/emacs/24.0.50/lisp/mh-e/mh-speed
/usr/local/emacs/cvs-040510/share/emacs/23.1.90/lisp/mh-e/mh-acros hides /usr/local/emacs/bzr-042510/share/emacs/24.0.50/lisp/mh-e/mh-acros
/home/doom/lib/emacs/Dots/gnus-setup hides /usr/local/emacs/bzr-042510/share/emacs/24.0.50/lisp/gnus/gnus-setup
Features:
(shadow sort mail-extr message rfc822 mail-utils gmm-utils mailheader
warnings emacsbug apropos pp help-mode view grep mule-util sql inversion
semantic/db-file cedet-files semantic/bovine/c semantic/decorate/include
semantic/db-find semantic/db-ref semantic/decorate/mode
semantic/decorate pulse semantic/bovine/c-by semantic/lex-spp
semantic/bovine/gcc semantic/dep semantic/analyze semantic/sort
semantic/scope semantic/analyze/fcn nroff-mode ede/dired vc-git vc-bzr
sha1 hex-util html-mode jsp-html-helper-mode asp-html-helper-mode
php-html-helper-mode html-helper-mode tempo cc-mode cc-fonts cc-menus
cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs sgml-mode sh-script
executable info flymake compile vc-rcs multi-isearch thingatpt desktop
desktop-recover desktop-recover-setup doom-fineline ansi-color
registers-defined image-mode junk-dired junk-setup datestamps
live-dangerously strokes macroman doom-filters find_and_replace doom-mh
mh-comp sendmail mh-scan mh-gnus mml mml-sec mm-view smime
password-cache dig mailcap mm-decode mm-bodies mm-encode mail-parse
rfc2231 rfc2047 rfc2045 ietf-drums mm-util mail-prsvr gnus-util mh-e
mh-compat mailabbrev mh-acros mh-buffers mh-loaddefs mhe-setup
fugly-keystroke-macros dired-imagery-doomery-keystroke-macros
image-dired thinknow picture doomfile doomfiles-hacking-setup
caving-setup w3m-load html-setup perlnow-x perlnow template
perlnow-setup sepia sepia-cpan sepia-ido ido sepia-tree tree-widget
sepia-w3m w3m-perldoc w3m browse-url timezone w3m-hist w3m-e22 w3m-ccl
ccl w3m-fsf w3m-favicon w3m-image w3m-proc w3m-util gud easy-mmode
cperl-mode sepia-setup semantic/db-mode semantic/db semantic/idle
semantic/format semantic/tag-ls semantic/ctxt semantic/util-modes
semantic/util semantic semantic/tag semantic/lex semantic/fw mode-local
ede/linux ede/emacs ede/cpp-root ede/speedbar ede/files ede ede/source
eieio-base eieio-speedbar speedbar sb-image ezimage dframe easymenu
assoc eieio-custom wid-edit eieio cedet apache-dev perl-setup
elisp-hacking-setup doom-print printer-setup shell-setup perlups derived
byte-opt bytecomp byte-compile jka-compr find-func timeclock-x timeclock
timeclock-setup shell comint ring dired-external-apps dired-setup
save-to-registers basic-keymap-changes paracide redroot
simple-color-change setup-colors-dark man-apropos edmacro kmacro
zoom-frm frame-cmds frame-fns avoid zoom-frm-setup text-setup dired-x
dired-aux dired regexp-opt paren uniquify advice help-fns advice-preload
server time emacs-setup cl cl-19 load-path-setup tooltip ediff-hook
vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image
fringe lisp-mode register page menu-bar rfn-eshadow timer select
scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core
frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help
simple abbrev loaddefs button minibuffer faces cus-face files
text-properties overlay md5 base64 format env code-pages mule custom
widget hashtable-print-readable backquote make-network-process dbusbind
dynamic-setting system-font-setting font-render-setting gtk x-toolkit x
multi-tty emacs)
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#6037
; Package
emacs
.
(Mon, 26 Apr 2010 13:43:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 6037 <at> debbugs.gnu.org (full text, mbox):
> The menu-bar-mode function is not working as a toggle.
See etc/NEWS.
If you really want to toggle (I've never seen such a case from Elisp),
just do (menu-bar-mode 'toggle).
> Note that running scroll-bar-mode repeatedly does work as a toggle, as
> expected for menu-bar-mode:
> (scroll-bar-mode)
Yes, that's a bug that I hope to fix before Emacs-24.
I.e. better not rely on it.
Stefan
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#6037
; Package
emacs
.
(Mon, 26 Apr 2010 14:14:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 6037 <at> debbugs.gnu.org (full text, mbox):
On Mon, Apr 26, 2010 at 3:42 PM, Stefan Monnier
<monnier <at> iro.umontreal.ca> wrote:
>> The menu-bar-mode function is not working as a toggle.
>
> See etc/NEWS.
> If you really want to toggle (I've never seen such a case from Elisp),
> just do (menu-bar-mode 'toggle).
Aren't they common in menus?
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#6037
; Package
emacs
.
(Mon, 26 Apr 2010 17:40:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 6037 <at> debbugs.gnu.org (full text, mbox):
>>> The menu-bar-mode function is not working as a toggle.
>> See etc/NEWS.
>> If you really want to toggle (I've never seen such a case from Elisp),
>> just do (menu-bar-mode 'toggle).
> Aren't they common in menus?
In that case, they're not called from Elisp, AFAIK.
I.e. it will go through the `interactive' spec which will provide the
`toggle' arg.
Stefan
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#6037
; Package
emacs
.
(Mon, 26 Apr 2010 17:57:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 6037 <at> debbugs.gnu.org (full text, mbox):
Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:
> > The menu-bar-mode function is not working as a toggle.
>
> See etc/NEWS.
So I gather you're referring to this:
* Incompatible Lisp Changes in Emacs 24.1
** Test for special mode-class was moved from view-file to view-buffer.
** Passing a nil argument to a minor mode function now turns the mode
ON unconditionally.
You're of the opinion that using "nil" to turn on a minor-mode is actually
correct behavior?
And the important justification for breaking long-standing behavior
was... ?
> If you really want to toggle (I've never seen such a case from Elisp),
> just do (menu-bar-mode 'toggle).
Okay, thanks for the hint. Is that documented anywhere?
If you'd like a use-case in elisp, I've been doing this in some form
of or another for quite some time:
;------------
; luddite mode
(tool-bar-mode -1)
(global-set-key [f12] '(lambda ()
(interactive)
(menu-bar-mode -1)
(scroll-bar-mode)
(setq use-dialog-box nil)
))
> > Note that running scroll-bar-mode repeatedly does work as a toggle, as
> > expected for menu-bar-mode:
> > (scroll-bar-mode)
>
> Yes, that's a bug that I hope to fix before Emacs-24.
> I.e. better not rely on it.
Allow me to quote the documentation for menu-bar-mode:
"Toggle display of a menu bar on each frame."
And again for scroll-bar-mode:
"Toggle display of vertical scroll bars on all frames."
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#6037
; Package
emacs
.
(Tue, 27 Apr 2010 03:06:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 6037 <at> debbugs.gnu.org (full text, mbox):
> You're of the opinion that using "nil" to turn on a minor-mode is actually
> correct behavior?
Yes.
> And the important justification for breaking long-standing behavior
> was... ?
It fixes a lot of
(add-hook 'foo-mode 'toto-minor-mode)
where the coder assumed unconsciously that toto-minor-mode was not
yet enabled.
>> If you really want to toggle (I've never seen such a case from Elisp),
>> just do (menu-bar-mode 'toggle).
> Okay, thanks for the hint. Is that documented anywhere?
Not yet.
> If you'd like a use-case in elisp, I've been doing this in some form
> of or another for quite some time:
> ;------------
> ; luddite mode
> (tool-bar-mode -1)
> (global-set-key [f12] '(lambda ()
> (interactive)
> (menu-bar-mode -1)
> (scroll-bar-mode)
> (setq use-dialog-box nil)
> ))
I don't know what this is meant to do, so I don't see where you need the
toggle behavior.
Note that in Emacs-23, when calling a minor-mode with nil (or no)
argument to turn it off, it usually outputted a warning (because
practice showed that such calls are usually erroneous).
> Allow me to quote the documentation for menu-bar-mode:
> "Toggle display of a menu bar on each frame."
> And again for scroll-bar-mode:
> "Toggle display of vertical scroll bars on all frames."
And indeed M-x menu-bar-mode toggles, just like M-x scroll-bar-mode.
Only the non-interactive calls are affected.
Stefan
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#6037
; Package
emacs
.
(Tue, 27 Apr 2010 06:40:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 6037 <at> debbugs.gnu.org (full text, mbox):
Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:
> > If you'd like a use-case in elisp, I've been doing this in some form
> > of or another for quite some time:
>
> > ;------------
> > ; luddite mode
> > (tool-bar-mode -1)
> > (global-set-key [f12] '(lambda ()
> > (interactive)
> > (menu-bar-mode -1)
> > (scroll-bar-mode)
> > (setq use-dialog-box nil)
> > ))
>
> I don't know what this is meant to do, so I don't see where you need the
> toggle behavior.
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:
;------------
; luddite mode
(tool-bar-mode -1)
(menu-bar-mode -1)
(scroll-bar-mode -1)
(setq use-dialog-box nil)
; toggles luddite mode
(global-set-key [f12] '(lambda ()
(interactive)
(menu-bar-mode 'toggle)
(scroll-bar-mode 'toggle)
(doom-toggle-use-dialog-box)
))
(defun doom-toggle-use-dialog-box ()
"Toggle the use-dialog-box setting"
(interactive)
(setq use-dialog-box
(cond (use-dialog-box
nil)
(t
nil)
)))
> Note that in Emacs-23, when calling a minor-mode with nil (or no)
> argument to turn it off, it usually outputted a warning (because
> practice showed that such calls are usually erroneous).
I've never noticed this with (menu-bar-mode) or (scroll-bar-mode).
> > Allow me to quote the documentation for menu-bar-mode:
> > "Toggle display of a menu bar on each frame."
> > And again for scroll-bar-mode:
> > "Toggle display of vertical scroll bars on all frames."
>
> And indeed M-x menu-bar-mode toggles, just like M-x scroll-bar-mode.
> Only the non-interactive calls are affected.
And indeed, that difference is (a) not documented and (b) not the way it
used to behave.
But hey, what do I know, I'm only a mere user, I should know better than
to argue with our glorious masters. It's no doubt very silly of me to
think that the code inferace for emacs might've settled down around
version 23.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#6037
; Package
emacs
.
(Tue, 27 Apr 2010 13:43:02 GMT)
Full text and
rfc822 format available.
Message #26 received at 6037 <at> debbugs.gnu.org (full text, mbox):
> 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.
- 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.
- You'll get a minibuffer messages about the menu-bar-mode being
enabled/disabled.
- 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).
Stefan
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#6037
; Package
emacs
.
(Tue, 27 Apr 2010 15:28:01 GMT)
Full text and
rfc822 format available.
Message #29 received at 6037 <at> debbugs.gnu.org (full text, mbox):
> > (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.
> - 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.
> - You'll get a minibuffer messages about the menu-bar-mode being
> enabled/disabled.
> - 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).
This is the kind of thing that should be added to the doc. Many users will make
use of something like this in their init files. They need to be aware of pretty
much all of the things you point out.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#6037
; Package
emacs
.
(Wed, 28 Apr 2010 05:43:02 GMT)
Full text and
rfc822 format available.
Message #32 received at submit <at> debbugs.gnu.org (full text, mbox):
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
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#6037
; Package
emacs
.
(Wed, 28 Apr 2010 14:44:02 GMT)
Full text and
rfc822 format available.
Message #35 received at submit <at> debbugs.gnu.org (full text, mbox):
>> - 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?
No direct connect, but minor modes defined with define-minor-mode will
check if they're called via call-interactively to decide whether to tell
customize about the change (if not called interactively, there's no way
for Customize to know whether the change could interfere with Customize
or not).
>> - 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.
Hmm... you might be right.
>> - You'll get a minibuffer messages about the menu-bar-mode being
>> enabled/disabled.
> Why doesn't scroll-bar-mode display the same messages?
Because there's only one minibuffer, so you only see one of
the messages.
In this case it happens to be the first rather than the second.
>> - 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)
No, for Emacs-24 it will not toggle.
Stefan
Added tag(s) notabug.
Request was from
Lars Magne Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Wed, 21 Sep 2011 19:42:01 GMT)
Full text and
rfc822 format available.
bug closed, send any further explanations to
6037 <at> debbugs.gnu.org and Joseph Brenner <doom <at> kzsu.stanford.edu>
Request was from
Lars Magne Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Wed, 21 Sep 2011 19:42:01 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#6037
; Package
emacs
.
(Wed, 21 Sep 2011 19:45:02 GMT)
Full text and
rfc822 format available.
Message #42 received at 6037 <at> debbugs.gnu.org (full text, mbox):
Joseph Brenner <doom <at> kzsu.stanford.edu> writes:
> The menu-bar-mode function is not working as a toggle.
> Running this will turn on the menu bar, but running it again
> will not turn it off:
>
> (menu-bar-mode)
>
> This does work to turn it off:
> (menu-bar-mode -1)
>
> This turns it on, as documented:
> (menu-bar-mode 1)
>
> Note that running scroll-bar-mode repeatedly does work as a toggle, as
> expected for menu-bar-mode:
>
> (scroll-bar-mode)
>
> I used to use this code, and it *did* work as a toggle (possibly in error):
>
> (menu-bar-mode nil)
>
> I've verified this bug with when invoked with -Q.
This seems to be intended behaviour and isn't a bug, so I'm closing this
report.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Thu, 20 Oct 2011 11:24:05 GMT)
Full text and
rfc822 format available.
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.