GNU bug report logs - #6037
24.0.50; menu-bar-mode function doesn't toggle

Previous Next

Package: emacs;

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

From: Joe Brenner <doom <at> kzsu.stanford.edu>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 6037 <at> debbugs.gnu.org
Subject: bug#6037: 24.0.50; menu-bar-mode function doesn't toggle
Date: Mon, 26 Apr 2010 23:38:59 -0700
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.







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.