Subject: Bug#4356: menu-bar-mode flag argument is inconsistent with universe

From: Ian Jackson <[email-masked]>
Date: Sun, 1 Sep 96 17:24 BST

Mark W. Eichin writes ("Re: Bug#4356: menu-bar-mode flag argument is inconsistent with universe"):
> > In 19.31 this has changed so that `nil' doesn't have the desired
> > effect.  Instead, you have to supply a negative number !
> 
> Hmm. The way elisp "optional arguments" work, you can't distinguish
> between (menu-bar-mode nil) and (menu-bar-mode), and both are
> equivalent to "M-x menu-bar-mode" which a user might actually type.
> scroll-bar-mode works the same way -- no arg (or nil) means *toggle*,
> positive arg means turn on, negative arg means turn off.
> (auto-compression-mode is another example)

I've just done some experiments and with the function
  (defun spong (&optional x)
    (interactive "p")
    (message (prin1-to-string x)))
calling it interactively with no prefix arg gives x=1.  With a prefix
arg x is the prefix arg.  You can call it non-interactively with `nil'
or `t'.

Ian.

---

From: [email-masked] (Mark W. Eichin)
Date: 01 Sep 1996 17:53:07 -0400

That's because (interactive "p") converts to a number. Not sure why
that's relevant, since menu-bar-mode uses (interactive "P"):
	p -- Prefix arg converted to number.  Does not do I/O.
	P -- Prefix arg in raw form.  Does not do I/O.
which, as I suggested earlier, passes nil for no argument.

---

From: Ian Jackson <[email-masked]>
Date: Mon, 2 Sep 96 00:30 BST

> which, as I suggested earlier, passes nil for no argument.

Forgive my ignorance, but could it not use `p' rather than `P' ?

Ian.