bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#1077: 23.0.60; x-create-frame: (wrong-type-argument number-or-marker


From: Drew Adams
Subject: bug#1077: 23.0.60; x-create-frame: (wrong-type-argument number-or-marker-p nil)
Date: Tue, 30 Nov 2010 07:42:50 -0800

> Btw, the code which injects this nil into the frame parameters is no
> other than oneonone.el itself.  It has this part:
> 
>     (defcustom 1on1-minibuffer-frame-alist
>       (list
>        (or (assq 'foreground-color minibuffer-frame-alist)
>          (cons 'foreground-color 1on1-minibuffer-frame-foreground))
>        [...]
>        (or (assq 'menu-bar-lines minibuffer-frame-alist)
>          (cons 'menu-bar-lines nil))
>             ^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> If I replace this with `(cons 'menu-bar-lines 0)', the original
> problem goes away without any changes in menu-bar.el.
> 
> Drew, any reason not to make that change in your package?

OK, I've made that change.

However, Emacs has the _general convention_ that a nil-valued frame parameter is
the same as an absence of that parameter.  Not having parameter `foo' present as
one of a frame's parameters is the same as having `(foo)' as the parameter cons.
This is true (should be true) for predefined parameters and for user-defined
frame parameters.  It is general behavior, and should just work (IMO).

And note that the doc Martin cites, in the Elisp manual, was explicitly _added_
for Emacs 21, presumably because this is important (not to be missed) - it is
not present in the Emacs 20 Elisp manual:

Elisp 20 manual:

`menu-bar-lines'
     The number of lines to allocate at the top of the frame for a menu
     bar.  The default is 1.  *Note Menu Bar::.  (In Emacs versions
     that use the X toolkit, there is only one menu bar line; all that
     matters about the number you specify is whether it is greater than
     zero.)

Elisp 21 manual:

menu-bar-lines
The number of lines to allocate at the top of the frame for a menu bar. The
default is 1. A value of nil means don't display a menu bar. See Menu Bar. (The
X toolkit and GTK allow at most one menu bar line; they treat larger values as
1.) 

FWIW (not much), I have this change-log comment in oneonone.el from 2005/05/28:
;;     Corrected 1on1-minibuffer-frame-alist and
;;     1on1-special-display-frame-alist for menu-bar-lines (nil).
Dunno what that was a change _from_, unfortunately. ;-)

Thanks for fixing this.  I do think that a value of nil should behave normally,
however, i.e., behave the same as a missing `menu-bar-lines' entry, which also
means the same as a `(menu-bar-lines . 0)' entry.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]