Discussion:
XEmacs nox11 startup issue
Hauke Fath
2015-11-09 12:04:14 UTC
Permalink
All,

on a machine without X11 installation, I have upgraded XEmacs to
21.4.23 and the packages. Now, xemacs (compiled without X11 support)
gives me a

Symbol's value as variable is void: default-menubar

unless started with either -vanilla or -no-init-file. OTOH,
-no-site-file doesn't help, and -debug-init comes up empty. The
constant 'default-menubar' shows up only in a few places

% find ./xemacs* -name "*.el" -exec fgrep -l 'default-menubar' \{\} \;
./xemacs/xemacs-packages/lisp/Sun/sunpro-menubar.el
./xemacs/xemacs-packages/lisp/ediff/ediff-wind.el
./xemacs/xemacs-packages/lisp/guided-tour/guided-tour.el
./xemacs/xemacs-packages/lisp/ispell/ispell.el
./xemacs/xemacs-packages/lisp/w3/w3-menu.el
./xemacs-21.4.23/lisp/menubar-items.el
./xemacs-21.4.23/lisp/menubar.el
%

Where do I look next?

Cheerio,
Hauke
--
The ASCII Ribbon Campaign Hauke Fath
() No HTML/RTF in email Institut für Nachrichtentechnik
/\ No Word docs in email TU Darmstadt
Respect for open standards Ruf +49-6151-16-3281
Hauke Fath
2015-11-09 13:52:01 UTC
Permalink
The problem lies with your startup script (either .emacs or
.xemacs/init.el).
There isn't any:

% ls ~/.{,x}emacs*
ls: No match.
%

Cheerio,
hauke
--
The ASCII Ribbon Campaign Hauke Fath
() No HTML/RTF in email Institut für Nachrichtentechnik
/\ No Word docs in email TU Darmstadt
Respect for open standards Ruf +49-6151-16-3281
Vin Shelton
2015-11-09 15:29:52 UTC
Permalink
Dear Hauke,
Post by Hauke Fath
The problem lies with your startup script (either .emacs or
.xemacs/init.el).
% ls ~/.{,x}emacs*
ls: No match.
%
OK, so I guess the problem is with autoloads, probably in
guided-tour.el, according to your previous sleuthing.

- Vin
Hauke Fath
2015-11-09 15:48:53 UTC
Permalink
Post by Vin Shelton
OK, so I guess the problem is with autoloads, probably in
guided-tour.el, according to your previous sleuthing.
A ktrace confirmed that, indeed, guided-tour is the last thing loaded
before the error message.

I am scraping together what little elisp fu I have for a workaround...

Cheerio,
hauke
--
The ASCII Ribbon Campaign Hauke Fath
() No HTML/RTF in email Institut für Nachrichtentechnik
/\ No Word docs in email TU Darmstadt
Respect for open standards Ruf +49-6151-16-3281
Hauke Fath
2015-11-09 16:41:11 UTC
Permalink
Post by Vin Shelton
OK, so I guess the problem is with autoloads, probably in
guided-tour.el, according to your previous sleuthing.
Hm. It appears to boil down to this little gem from guided-tour.el:

;; #### this probably should move to help.el or menubar-items.el
(defun guided-tour-find-menubar-help-menu (&optional menubar)
"Return the Help submenu for MENUBAR if present, else nil."
(assoc "%_Help" (or menubar default-menubar)))

which does not like default-menubar to be undefined (or evaluating to
nil, if previously defvar'ed).

At the top of the file, I

(setq debug-on-error t)

and then tried something along the lines of

(defun guided-tour-find-menubar-help-menu (&optional menubar)
(when (boundp 'default-menubar)
((assoc "%_Help" (or menubar default-menubar))))

but all I get is a (wrong-type-argument consp nil).

Any ideas?

Cheerio,
hauke
--
The ASCII Ribbon Campaign Hauke Fath
() No HTML/RTF in email Institut für Nachrichtentechnik
/\ No Word docs in email TU Darmstadt
Respect for open standards Ruf +49-6151-16-3281
Henry S. Thompson
2015-11-09 17:07:26 UTC
Permalink
Post by Hauke Fath
Post by Vin Shelton
OK, so I guess the problem is with autoloads, probably in
guided-tour.el, according to your previous sleuthing.
;; #### this probably should move to help.el or menubar-items.el
(defun guided-tour-find-menubar-help-menu (&optional menubar)
"Return the Help submenu for MENUBAR if present, else nil."
(assoc "%_Help" (or menubar default-menubar)))
which does not like default-menubar to be undefined (or evaluating to
nil, if previously defvar'ed).
At the top of the file, I
(setq debug-on-error t)
and then tried something along the lines of
(defun guided-tour-find-menubar-help-menu (&optional menubar)
(when (boundp 'default-menubar)
((assoc "%_Help" (or menubar default-menubar))))
but all I get is a (wrong-type-argument consp nil).
One too many pairs of parens, I'm guessing. You want

(defun guided-tour-find-menubar-help-menu (&optional menubar)
(when (boundp 'default-menubar)
(assoc "%_Help" (or menubar default-menubar))))

ht
--
Henry S. Thompson, School of Informatics, University of Edinburgh
10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: ***@inf.ed.ac.uk
URL: http://www.ltg.ed.ac.uk/~ht/
[mail from me _always_ has a .sig like this -- mail without it is forged spam]
Hauke Fath
2015-11-09 19:22:14 UTC
Permalink
Post by Henry S. Thompson
Post by Hauke Fath
(defun guided-tour-find-menubar-help-menu (&optional menubar)
(when (boundp 'default-menubar)
((assoc "%_Help" (or menubar default-menubar))))
but all I get is a (wrong-type-argument consp nil).
One too many pairs of parens, I'm guessing. You want
(defun guided-tour-find-menubar-help-menu (&optional menubar)
(when (boundp 'default-menubar)
(assoc "%_Help" (or menubar default-menubar))))
... this is what I have - I copied from memory, sorry. I am not even
clear what exactly triggers the error

Debugger entered--Lisp error: (wrong-type-argument consp nil)
signal(wrong-type-argument (consp nil))
signal-error(wrong-type-argument (consp nil))
normal-top-level()

-- is there any way to find out in the elisp debugger? Since edebug
needs "instrumenting", I guess it won't work for debugging startup, and
I have not been able to trigger the issue by loading guided-tour.el
into a vanill axemacs.

Cheerio,
hauke
--
The ASCII Ribbon Campaign Hauke Fath
() No HTML/RTF in email Institut für Nachrichtentechnik
/\ No Word docs in email TU Darmstadt
Respect for open standards Ruf +49-6151-16-3281
Vin Shelton
2015-11-09 21:11:59 UTC
Permalink
I believe that your symptoms indicate that the problem is caused by an

;;; autoload

statement somewhere in guided-tour.el.

Please look in the generated auto-autoloads.el file for the code which
is causing the error.

I am sorry that I am away from my development environment ATM and
cannot investigate further at this time.

- Vin
Post by Hauke Fath
Post by Henry S. Thompson
Post by Hauke Fath
(defun guided-tour-find-menubar-help-menu (&optional menubar)
(when (boundp 'default-menubar)
((assoc "%_Help" (or menubar default-menubar))))
but all I get is a (wrong-type-argument consp nil).
One too many pairs of parens, I'm guessing. You want
(defun guided-tour-find-menubar-help-menu (&optional menubar)
(when (boundp 'default-menubar)
(assoc "%_Help" (or menubar default-menubar))))
... this is what I have - I copied from memory, sorry. I am not even
clear what exactly triggers the error
Debugger entered--Lisp error: (wrong-type-argument consp nil)
signal(wrong-type-argument (consp nil))
signal-error(wrong-type-argument (consp nil))
normal-top-level()
-- is there any way to find out in the elisp debugger? Since edebug
needs "instrumenting", I guess it won't work for debugging startup, and
I have not been able to trigger the issue by loading guided-tour.el
into a vanill axemacs.
Cheerio,
hauke
--
The ASCII Ribbon Campaign Hauke Fath
() No HTML/RTF in email Institut für Nachrichtentechnik
/\ No Word docs in email TU Darmstadt
Respect for open standards Ruf +49-6151-16-3281
_______________________________________________
XEmacs-Beta mailing list
http://lists.xemacs.org/mailman/listinfo/xemacs-beta
Henry S. Thompson
2015-11-09 13:25:19 UTC
Permalink
Post by Hauke Fath
on a machine without X11 installation, I have upgraded XEmacs to
21.4.23 and the packages. Now, xemacs (compiled without X11 support)
gives me a
Symbol's value as variable is void: default-menubar
menubar-items defines this. menubar-items should have been loaded at
xemacs build time, unless you turn it off explicitly by saying
--without-menubars or some such.

What is the value of

Installation-string

?
--
Henry S. Thompson, School of Informatics, University of Edinburgh
10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: ***@inf.ed.ac.uk
URL: http://www.ltg.ed.ac.uk/~ht/
[mail from me _always_ has a .sig like this -- mail without it is forged spam]
Hauke Fath
2015-11-09 14:15:50 UTC
Permalink
Post by Henry S. Thompson
Post by Hauke Fath
on a machine without X11 installation, I have upgraded XEmacs to
21.4.23 and the packages. Now, xemacs (compiled without X11 support)
gives me a
Symbol's value as variable is void: default-menubar
menubar-items defines this. menubar-items should have been loaded at
xemacs build time, unless you turn it off explicitly by saying
--without-menubars or some such.
That might be worth a try. OTOH, I have in the meantime updated
(pkgsrc) editors/xemacs while holding back editors/xemacs-packages and
found that this configuration works fine. This appears to tell me the
problem is in the updated xemacs packages (the previous stand of
xemacs-packages was _really_ old even on an xemacs scale) rather than
the xemacs build-time preloads.

Comparing old and new package sets, there is one addition in the new
set:

% find /usr/pkg/lib/xemacs* -name "*.el" -exec fgrep -H
'default-menubar' \{\} \;
[...]
/usr/pkg/lib/xemacs/xemacs-packages/lisp/guided-tour/guided-tour.el:
(assoc "%_Help" (or menubar default-menubar)))
[...]
%

which, unlike most of the other files, does not defvar or defconst
'default-menubar'. I don't see, though, that guided-tour.el would be
invoked during a regular startup.
Post by Henry S. Thompson
What is the value of
Installation-string
Output of
% xemacs -vanilla -batch -eval '(princ Installation-string)' >
xemacs-21_4_23.Installation

attached. (This is with the old package set).

Cheerio,
hauke
--
The ASCII Ribbon Campaign Hauke Fath
() No HTML/RTF in email Institut für Nachrichtentechnik
/\ No Word docs in email TU Darmstadt
Respect for open standards Ruf +49-6151-16-3281
Stephen J. Turnbull
2015-11-10 07:28:22 UTC
Permalink
Post by Hauke Fath
(assoc "%_Help" (or menubar default-menubar)))
which, unlike most of the other files, does not defvar or defconst
'default-menubar'. I don't see, though, that guided-tour.el would be
invoked during a regular startup.
There are autoloads, and that action (it's more than a mere
definition) is autoloaded. I'm surprised that -vanilla suppresses the
problem (I would think you need -no-autoloads), but I'll take a look
at that later. This is bad (guided-tour is ill-behaved because it
initializes itself at XEmacs startup rather than on invocation[1] and
I didn't check that it worked in --without-x11 builds). At present, I
doubt XEmacs is getting a lot of newbies so you could just omit
guided-tour from your packages.

If you want to include it, try the appended patch.

I'll take a closer look later (and check for other optional but
"normally present" resources it uses), but "later" may very well mean
"Saturday".

Steve

Footnotes:
[1] By design -- it's a feature you want newbies to know about if
it's available but they won't be able to find it easily if it's not in
the Help menu.

--- guided-tour.el~ 2014-10-25 17:20:02.000000000 +0900
+++ guided-tour.el 2015-11-10 15:13:23.000000000 +0900
@@ -80,7 +80,7 @@
;; #### this probably should move to help.el or menubar-items.el
(defun guided-tour-find-menubar-help-menu (&optional menubar)
"Return the Help submenu for MENUBAR if present, else nil."
- (assoc "%_Help" (or menubar default-menubar)))
+ (assoc "%_Help" (or menubar (if-boundp 'default-menubar default-menubar))))

(defun guided-tour-about-xemacs-index (menu)
"Return the (zero-based) index of the About XEmacs item in MENU.
Hauke Fath
2015-11-10 09:45:40 UTC
Permalink
Post by Stephen J. Turnbull
If you want to include it, try the appended patch.
'if-boundp' is not known to 21.4...

I guess

(assoc "%_Help" (or menubar (and (boundp 'default-menubar)
default-menubar))))

would be equivalent. But it doesn't help, since assoc objects to being
given nil as an association list (assuming
<http://www.gnu.org/software/emacs/manual/html_node/elisp/Association-Lists.html>
applies to XEmacs).

Cheerio,
Hauke
--
The ASCII Ribbon Campaign Hauke Fath
() No HTML/RTF in email Institut für Nachrichtentechnik
/\ No Word docs in email TU Darmstadt
Respect for open standards Ruf +49-6151-16-3281
Hauke Fath
2015-11-10 12:42:57 UTC
Permalink
Post by Hauke Fath
But it doesn't help, since assoc objects to being
given nil as an association list (assuming
<http://www.gnu.org/software/emacs/manual/html_node/elisp/Association-Lists.html>
Post by Hauke Fath
applies to XEmacs).
No, it's not assoc... it blows up half way down through
frame-notice-user-settings (frame.el).

Is there a way to make XEmacs ignore the build-time dumped,
byte-compiled code, and go to xemacs-21.4.23/lisp/*.el first?

Cheerio,
hauke
--
The ASCII Ribbon Campaign Hauke Fath
() No HTML/RTF in email Institut für Nachrichtentechnik
/\ No Word docs in email TU Darmstadt
Respect for open standards Ruf +49-6151-16-3281
Stephen J. Turnbull
2015-11-10 17:59:16 UTC
Permalink
Post by Hauke Fath
Is there a way to make XEmacs ignore the build-time dumped,
byte-compiled code, and go to xemacs-21.4.23/lisp/*.el first?
If you want to debug uncompiled sources, then I think that you could
remove all the .elc files and run "make runtemacs" or perhaps "make
run-temacs" in the src directory. If you are building with the
"portable" dumper then I think "./xemacs -nd -l ../lisp/loadup.el"
will do the trick, but you can go out for dinner while it's loading
up, and XEmacs will be as slow as you can imagine for most operations.

However I suspect it will be more effective and less painful to just
post the error and the Lisp backtrace here (and if it crashed, which I
don't think it should do at that point, the C backtrace) here.
Hauke Fath
2015-11-10 19:56:57 UTC
Permalink
Post by Stephen J. Turnbull
However I suspect it will be more effective and less painful to just
post the error and the Lisp backtrace here (and if it crashed, which I
don't think it should do at that point, the C backtrace) here.
It didn't crash. I added a

(debug)

to guided-tour-find-menubar-help-menu, and traced from there, and
(after dealing with the empty menubar and default-menubar vars)
eventually ran into the mentioned

Debugger entered--Lisp error: (wrong-type-argument consp nil)
signal(wrong-type-argument (consp nil))
signal-error(wrong-type-argument (consp nil))
normal-top-level()

around frame.el:392 (set-frame-properties frame-initial-frame newprops)

I figured that slipping a (debug) in frame.el might speed up things,
and then found that it gets dumped with xemacs.

Cheerio,
Hauke
--
The ASCII Ribbon Campaign Hauke Fath
() No HTML/RTF in email Institut für Nachrichtentechnik
/\ No Word docs in email TU Darmstadt
Respect for open standards Ruf +49-6151-16-3281
Stephen J. Turnbull
2015-11-11 00:31:46 UTC
Permalink
around frame.el:392 (set-frame-properties frame-initial-frame newprops)
If you're in the debugger at this point, check for `(listp newprops)'
and that `(length newprops)' is even. What's most likely happening is
that when `set-frame-properties' applies check-valid-plist to
`newprops' that error is thrown, which happens when the length of the
plist is odd. If so, the problem is in the code that creates
`newprops'.

BTW, changing the code and redumping is probably the most efficient
way to put in the `(debug)'. It shouldn't take very long, and I
believe 21.4 already had the configure --quick-build option which
prevents the build sytem from rebuilding Info files and the like.

I'm setting up XEmacs 21.4 for a build (on Mac, though, no NetBSD/
pkgsrc system available) now, maybe I can reproduce.
Julian Bradfield
2015-11-11 08:59:16 UTC
Permalink
Post by Stephen J. Turnbull
BTW, changing the code and redumping is probably the most efficient
way to put in the `(debug)'. It shouldn't take very long, and I
believe 21.4 already had the configure --quick-build option which
prevents the build sytem from rebuilding Info files and the like.
Why bother?
On my current desktop, a full build from clean source takes 29
seconds. (Or 39 seconds if you run configure first.)
Stephen J. Turnbull
2015-11-11 10:48:23 UTC
Permalink
Post by Stephen J. Turnbull
I'm setting up XEmacs 21.4 for a build (on Mac, though, no NetBSD/
pkgsrc system available) now, maybe I can reproduce.
OK, I've reproduced the original problem, but making further progress
will probably have to wait until the weekend.
Hauke Fath
2015-11-11 16:17:25 UTC
Permalink
Post by Stephen J. Turnbull
What's most likely happening is
that when `set-frame-properties' applies check-valid-plist to
`newprops' that error is thrown, which happens when the length of the
plist is odd.
What I have committed now is

<http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/editors/xemacs-packages/patches/patch-lisp_guided-tour_guided-tour.el?rev=1.1&content-type=text/x-cvsweb-markup>

Cheerio,
hauke
--
The ASCII Ribbon Campaign Hauke Fath
() No HTML/RTF in email Institut für Nachrichtentechnik
/\ No Word docs in email TU Darmstadt
Respect for open standards Ruf +49-6151-16-3281
Julian Bradfield
2015-11-09 14:18:44 UTC
Permalink
Post by Hauke Fath
21.4.23 and the packages. Now, xemacs (compiled without X11 support)
gives me a
Symbol's value as variable is void: default-menubar
...
Post by Hauke Fath
Where do I look next?
Start with -no-init-file, then
(setq debug-on-error t)
(load-init-file)

perhaps?
Loading...