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

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



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.



Reply to: