Article View: gnu.emacs.bug
Article #87454X resource for menu-bar-lines is unobserved. fix included.
From: rodrigo vanegas
Date: Thu, 15 Sep 1994 08:15
Date: Thu, 15 Sep 1994 08:15
110 lines
5126 bytes
5126 bytes
In my unending quest for a GUI-less GNU Emacs 19, i have endeavored
to find a way to startup my emacs without the nuisance (subjectivity
alert!) of the menu bar and the scroll bar.
My first attempt at configuring Emacs to my will, was the setting of
the "default-frame-alist" to "((menu-bar-lines . 0)
(vertical-scroll-bars . nil))". This had the desired effect of
creating a frame without the new GUI widgets... NOT.
Actually, the frame was drawn with both the menu and the scroll bar
painted only to be removed a 1/4 second later as Emacs began to read
my ".emacs". This is ugly and should be unecessary.
My next attempt was to find X resources which would allow me to set my
preferences before the initial frame is drawn. Nothing turned up in
the info pages, but rooting through the source i found a couple of
undocumented resources which seemed to be exactly what i wanted:
"menuBarLines" and "verticalScrollBars". So the following lines in my
"~/.Xdefaults", it would seem, should have produced the desired effect
Emacs.verticalScrollBars: false
Emacs.menuBarLines: 0
The bug i am reporting is just that although the former of these two
set resources is observed, the latter is not.
Here's a fix,
/----------------------------------------------------------------------\
diff -r -P -c emacs-old/lisp/term/x-win.el emacs-new/lisp/term/x-win.el
*** emacs-old/lisp/term/x-win.el Sun May 22 18:13:53 1994
--- emacs-new/lisp/term/x-win.el Wed Sep 14 03:28:16 1994
***************
*** 613,619 ****
(while (setq i (string-match "[.*]" x-resource-name))
(aset x-resource-name i ?-))))
! (menu-bar-mode t)
(x-open-connection (or x-display-name
(setq x-display-name (getenv "DISPLAY")))
--- 613,619 ----
(while (setq i (string-match "[.*]" x-resource-name))
(aset x-resource-name i ?-))))
! ;; (menu-bar-mode t)
(x-open-connection (or x-display-name
(setq x-display-name (getenv "DISPLAY")))
diff -r -P -c emacs-old/src/xfns.c emacs-new/src/xfns.c
*** emacs-old/src/xfns.c Wed May 25 18:01:32 1994
--- emacs-new/src/xfns.c Wed Sep 14 03:28:49 1994
***************
*** 2306,2312 ****
x_default_parameter (f, parms, Qborder_color, build_string ("black"),
"borderColor", "BorderColor", string);
! x_default_parameter (f, parms, Qmenu_bar_lines, make_number (0),
"menuBarLines", "MenuBarLines", number);
f->display.x->parent_desc = ROOT_WINDOW;
--- 2306,2312 ----
x_default_parameter (f, parms, Qborder_color, build_string ("black"),
"borderColor", "BorderColor", string);
! x_default_parameter (f, parms, Qmenu_bar_lines, make_number (1),
"menuBarLines", "MenuBarLines", number);
f->display.x->parent_desc = ROOT_WINDOW;
\----------------------------------------------------------------------/
The idea is that "lisp/term/x-win.el" is turning on the menu bars
explicitly and independently of the user settings. But this is
unecessary because in "src/xfns.c", the menu-bar-lines frame parameter
has already received a default value. It may be the case that since
the default value actually assigned to menu-bar-lines was 0, whoever
was writing the lisp code decided to make menu-bar-mode "on" the
default without realizing that this would clobber the effect of the
corresponding X resource.
Anyhow, my patch removes the clobber, but then resets the default to 1
so that the vanilla configuration continues to have menus by default.
Here is the specific information requested by the "Checklist for Bug
Reports" node of the info pages.
- Emacs v19.25 (because 19.26 won't compile on my system)
- Sparc10, Solaris 2.3 (SunOs 5.3).
- ./configure sparc-sunos5.3 --with-x11 --with-x-toolkit=lucid \
--run-in-place --with-gcc
- the above patch is with respect to a clean 19.25
And here are the submitted ChangeLog entries.
|
| Thu Sep 15 03:51:01 1994 rodrigo vanegas (rv@cs.brown.edu)
|
| * term/x-win.el: Don't turn on menu-bar-mode. Achieve same effect
| in ../src/xfns.c instead.
|
| Thu Sep 15 03:54:23 1994 rodrigo vanegas (rv@cs.brown.edu)
|
| * xfns.c: Change default value of menuBarLines frame parameter
| from 0 to 1.
|
rodrigo vanegas
rv@cs.brown.edu
Technical Details
Message-ID:
<199409150808.EAA13581@fiji>Path:
arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!deathstar.cris.com!news1.oakland.edu!vtc.tacom.army.mil!ulowell!europa.eng.gtefsd.com!MathWorks.Com!panix!ddsw1!news.cic.net!magnus.acs.ohio-state.edu!cis.ohio-state.edu!cs.brown.edu!rvShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,a3f82db25cc33eee,start X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1994-09-16 14:28:36 PST Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!deathstar.cris.com!news1.oakland.edu!vtc.tacom.army.mil!ulowell!europa.eng.gtefsd.com!MathWorks.Com!panix!ddsw1!news.cic.net!magnus.acs.ohio-state.edu!cis.ohio-state.edu!cs.brown.edu!rv From: rv@cs.brown.edu (rodrigo vanegas) Newsgroups: gnu.emacs.bug Subject: X resource for menu-bar-lines is unobserved. fix included. Date: 15 Sep 1994 04:15:04 -0400 Organization: GNUs Not Usenet Lines: 111 Sender: daemon@cis.ohio-state.edu Approved: bug-gnu-emacs@prep.ai.mit.edu Distribution: gnu Message-ID: <199409150808.EAA13581@fiji>