This bug report will be sent to the XEmacs Development Team,
not to your local site managers!!
Please write in English, because the XEmacs maintainers do not have
translators to read other languages for them.
Please describe as succinctly as possible:
- What happened.
- What you thought should have happened.
- Precisely what you were doing at the time.
Please also include any C or lisp back-traces that you may have.
================================================================
Dear Bug Team!
I believe I have found a bug in the minibuffer completion functions
where minibuffer-complete will crash because of a read-before-bind
error wrt the variable last-exact-completion.
I stumbled upon this bug through using ILISP. Here's what I sent the
ilisp maintainers. Possibly it was wrong to do so, but the crash
impairs the function of their package.
Here's the bug, with backtrace adn what I hope is a fix:
I am not sure that this is properly your purview, so I have also
submitted this as an xemacs bug. The bug appears in the use of
minibuffer completion functions.
I BELIEVE that ilisp-cmp has a bug in ilisp-read-symbol, particularly
in the way it uses the minibuffer. I was finding that this crashed in
my copy of ilisp (ilisp-cmp.el,v 1.4) on Xemacs 21.1.14, linux.
When using meta-dot to find a function definition, I was getting
completion crashes with the error that LAST-EXACT-COMPLETION was
unbound.
That variable is defined in minibuf.el (no version number available in
my copy :-<), but not bound.
When one calls SOME minibuffer completion function, it seems to behave in
a well-balanced way: the function first binds last-exact-completion
to nil, then starts functioning.
However, if one calls minibuffer-complete, as completer-complete in
ilisp-read-symbol does, last-exact-completion is not bound.
The head of minibuffer-do-completion has the following in it:
(defun minibuffer-do-completion (buffer-string)
(let* ((completion (try-completion buffer-string
minibuffer-completion-table
minibuffer-completion-predicate))
(status (minibuffer-do-completion-1 buffer-string completion))
(last last-exact-completion))
...note that this assumes last-exact-completion is bound on entry to
the function.
Since minibuffer-complete is interactive, and thus can be called
directly, I BELIEVE that the appropriate patch is to modify
minibuffer-complete as follows:
OLD version:
(defun minibuffer-complete ()
"Complete the minibuffer contents as far as possible.
Return nil if there is no valid completion, else t.
If no characters can be completed, display a list of possible completions.
If you repeat this command after it displayed such a list,
scroll the window of possible completions."
(interactive)
;; If the previous command was not this, then mark the completion
;; buffer obsolete.
(or (eq last-command this-command)
(setq minibuffer-scroll-window nil))
(let ((window minibuffer-scroll-window))
(if (and window (windowp window) (window-buffer window)
(buffer-name (window-buffer window)))
;; If there's a fresh completion window with a live buffer
;; and this command is repeated, scroll that window.
(let ((obuf (current-buffer)))
(unwind-protect
(progn
(set-buffer (window-buffer window))
(if (pos-visible-in-window-p (point-max) window)
;; If end is in view, scroll up to the beginning.
(set-window-start window (point-min))
;; Else scroll down one frame.
(scroll-other-window)))
(set-buffer obuf))
nil)
(let ((status (minibuffer-do-completion (buffer-string))))
(if (eq status 'none)
nil
(progn
(cond ((eq status 'unique)
(temp-minibuffer-message
" [Sole completion]"))
((eq status 'exact)
(temp-minibuffer-message
" [Complete, but not unique]")))
t))))))
NEW version:
(defun minibuffer-complete ()
"Complete the minibuffer contents as far as possible.
Return nil if there is no valid completion, else t.
If no characters can be completed, display a list of possible completions.
If you repeat this command after it displayed such a list,
scroll the window of possible completions."
(interactive)
;; If the previous command was not this, then mark the completion
;; buffer obsolete.
(cond ((not (eq last-command this-command))
(setq minibuffer-scroll-window nil)
(setq last-exact-completion nil)))
(let ((window minibuffer-scroll-window))
(if (and window (windowp window) (window-buffer window)
(buffer-name (window-buffer window)))
;; If there's a fresh completion window with a live buffer
;; and this command is repeated, scroll that window.
(let ((obuf (current-buffer)))
(unwind-protect
(progn
(set-buffer (window-buffer window))
(if (pos-visible-in-window-p (point-max) window)
;; If end is in view, scroll up to the beginning.
(set-window-start window (point-min))
;; Else scroll down one frame.
(scroll-other-window)))
(set-buffer obuf))
nil)
(let ((status (minibuffer-do-completion (buffer-string))))
(if (eq status 'none)
nil
(progn
(cond ((eq status 'unique)
(temp-minibuffer-message
" [Sole completion]"))
((eq status 'exact)
(temp-minibuffer-message
" [Complete, but not unique]")))
t))))))
Backtrace:
minibuffer-do-completion("defs")
minibuffer-complete()
completer-new-cmd(minibuffer-complete)
completer-complete()
#<compiled-function nil "...(9)" [ilisp-completion ilisp-current-choice
ilisp-restore-prefix] 1
("/usr/lib/xemacs/xemacs-packages/lisp/ilisp/ilisp-cmp.elc" . 3679) nil>()
call-interactively(ilisp-completion)
read-minibuffer-internal("Edit Definition [defparameter]: ")
byte-code("..." [recursion-depth minibuffer-depth t standard-input
standard-output read-minibuffer-internal prompt] 2)
read-from-minibuffer("Edit Definition [defparameter]: " nil #<keymap 13
entries 0x2b2a>)
ilisp-read-symbol("Edit Definition [defparameter]: "
("COMMON-LISP-USER" "::" "defparameter") nil t)
(list (ilisp-read-symbol (format "Edit Definition [%s]: " symbol) function nil
t) (if types (ilisp-completing-read ... types default)))
)
(if (lisp-minus-prefix) (list function default) (list (ilisp-read-symbol ... function
nil t) (if types ...)))
)
(let* ((types ...) (default ...) (function ...) (symbol ...)) (if (lisp-minus-prefix)
(list function default) (list ... ...)))
)
call-interactively(edit-definitions-lisp)
================================================================
System Info to help track down your bug:
---------------------------------------
uname -a: Linux tsathoggua.mydomain 2.4.18-6mdksmp #1 SMP Fri Mar 15 01:24:36 CET 2002
i686 unknown
./configure '--prefix=/usr' '--ldflags=-z nocombreloc'
XEmacs 21.1.14 "Cuyahoga Valley" configured for `i686-pc-linux'.
Where should the build process find the source code?
/home/rpg/src/xemacs/xemacs-21.1.14
What installation prefix should install use? /usr
What operating system and machine description files should XEmacs use?
`s/linux.h' and `m/intel386.h'
What compiler should XEmacs be built with? gcc -g -O3 -Wall -Wno-switch
Should XEmacs use the GNU version of malloc? yes
(Using Doug Lea's new malloc from the GNU C Library.)
Should XEmacs use the relocating allocator for buffers? yes
What window system should XEmacs use? x11
Where do we find X Windows header files? /usr/X11R6/include
Where do we find X Windows libraries? /usr/X11R6/lib
Compiling in support for XAUTH.
Compiling in support for XPM images.
Compiling in support for PNG image handling.
Compiling in support for (builtin) GIF image handling.
Compiling in support for JPEG image handling.
Compiling in support for TIFF image handling.
Compiling in support for X-Face message headers.
Compiling in native sound support.
Compiling in support for ncurses.
Compiling in support for proper session-management.
Using Lucid menubars.
Using Lucid scrollbars.
Using Athena dialog boxes.
Compiling in DLL support.
movemail will use "dot-locking" for locking mail spool files.
Using Lisp_Objects with minimal tagbits.
Load-Path Lisp Shadows:
----------------------
(/home/rpg/emacs/smime /usr/lib/xemacs/xemacs-packages/lisp/gnus/smime
/usr/lib/xemacs/xemacs-packages/lisp/xemacs-base/xpm-button
/usr/lib/xemacs-21.1.14/lisp/xpm-button)
Installed XEmacs Packages:
-------------------------
((xslide:version 1.03 :type regular)
(xemacs-devel :version 1.48 :type single-file)
(xemacs-base :version 1.67 :type regular)
(w3 :version 1.25 :type regular)
(vm :version 7.07 :type regular)
(view-process :version 1.11 :type regular)
(vhdl :version 1.15 :type regular)
(vc :version 1.33 :type regular)
(time :version 1.11 :type regular)
(textools :version 1.12 :type regular)
(text-modes :version 1.51 :type single-file)
(texinfo :version 1.2 :type regular)
(supercite :version 1.19 :type regular)
(strokes :version 1.08 :type regular)
(speedbar :version 1.23 :type regular)
(slider :version 1.13 :type regular)
(sh-script :version 1.15 :type regular)
(sgml :version 1.08 :type regular)
(semantic :version 1.12 :type regular)
(scheme :version 1.11 :type regular)
(reftex :version 1.26 :type regular)
(psgml :version 1.29 :type regular)
(ps-print :version 1.07 :type regular)
(prog-modes
:version
1
.63
:type
single-file)
(pcomplete :version 1.01 :type regular)
(pcl-cvs :version 1.64 :type regular)
(pc :version 1.25 :type single-file)
(os-utils :version 1.28 :type single-file)
(net-utils :version 1.27 :type single-file)
(mmm-mode :version 1.0 :type regular)
(mailcrypt :version 2.11 :type regular)
(mail-lib :version 1.48 :type regular)
(jde :version 1.35 :type regular)
(ispell :version 1.24 :type regular)
(ilisp :version 1.27 :type regular)
(igrep :version 1.08 :type regular)
(ibuffer :version 1.08 :type regular)
(hm--html-menus :version 1.18 :type regular)
(haskell-mode :version 1.03 :type regular)
(gnus :version 1.62 :type regular)
(gnats :version 1.15 :type regular)
(fsf-compat :version 1.11 :type single-file)
(frame-icon :version 1.09 :type regular)
(footnote :version 1.15 :type regular)
(eudc :version 1.36 :type regular)
(eterm :version 1.13 :type regular)
(eshell :version 1.03 :type regular)
(emerge :version 1.09 :type regular)
(elib :version 1.1 :type single-file)
(eieio :version 1.02 :type regular)
(efs :version 1.29 :type regular)
(edit-utils :version 1.9 :type single-file)
(ediff :version 1.41 :type regular)
(edebug :version 1.14 :type regular)
(dired :version 1.12 :type regular)
(debug :version 1.15 :type regular)
(cookie :version 1.14 :type regular)
(cc-mode :version 1.29 :type regular)
(calendar :version 1.18 :type regular)
(calc :version 1.23 :type regular)
(c-support :version 1.16 :type single-file)
(bbdb :version 1.21 :type regular)
(auctex :version 1.32 :type regular)
(apel :version 1.25 :type regular))
Features:
--------
(xemacsbug shadow bbdb-hooks vm-virtual insert-date-stamp stardate
string tags etags info man vm-minibuf vm-macro vm-delete
atomic-extents vm-sort vm-undo bbdb-gui vm-page vm-mime vm-save
vm-toolbar vm-summary tapestry vm-motion vm-message vm-menu vm-folder
vm-misc vm-mouse vm-window smiley messagexmas nnheader nnheaderxm
mm-util mail-prsvr mail-utils vm-pcrisis advice advice-preload
vm-reply mailcrypt bbdb-vm bbdb-snarf mail-extr bbdb-com mail-abbrevs
sendmail rfc822 bbdb timezone vm-autoload highlight-headers vm-vars
vm-version vm vm-startup find-func debug annotations xpm-button
view-less view ilisp imenu ilisp-ccl ilisp-lw ilisp-chs ilisp-ext
ilisp-key cltl2 bridge comint-ipc ilcompat il-luc19 comint efs-cu
completer ilisp-cl-easy-menu hyperspec thingatpt browse-url vc ring
vc-hooks tex-site completion gnuserv cus-face xslide-autoloads
xemacs-devel-autoloads xemacs-base-autoloads w3-autoloads vm-autoloads
view-process-autoloads vhdl-autoloads vc-autoloads time-autoloads
textools-autoloads text-modes-autoloads texinfo-autoloads
supercite-autoloads strokes-autoloads speedbar-autoloads
slider-autoloads sh-script-autoloads sgml-autoloads semantic-autoloads
scheme-autoloads reftex-autoloads psgml-autoloads ps-print-autoloads
prog-modes-autoloads pcomplete-autoloads pcl-cvs-autoloads
pc-autoloads os-utils-autoloads net-utils-autoloads mmm-mode-autoloads
mailcrypt-autoloads mail-lib-autoloads jde-autoloads ispell-autoloads
ilisp-autoloads igrep-autoloads ibuffer-autoloads
hm--html-menus-autoloads haskell-mode-autoloads gnus-autoloads
gnats-autoloads fsf-compat-autoloads frame-icon-autoloads
footnote-autoloads eudc-autoloads eterm-autoloads eshell-autoloads
emerge-autoloads elib-autoloads eieio-autoloads efs-autoloads
edit-utils-autoloads ediff-autoloads edebug-autoloads dired-autoloads
debug-autoloads cookie-autoloads cc-mode-autoloads calendar-autoloads
calc-autoloads c-support-autoloads bbdb-autoloads auctex-autoloads
apel-autoloads Standard-autoloads loadhist auto-show fontl-hooks
x-iso8859-1 menubar-items x-menubar mouse mode-motion itimer auto-save
lisp-mode easymenu iso8859-1 page buff-menu lib-complete help-nomule
derived frame text-props cus-start custom widget cl-extra mini-cl cl
cl-19 packages backquote very-early-lisp lucid-scrollbars cut-buffer
lucid-menubars xface athena-dialogs x tty-frames tty toolbar
native-sound scrollbar unix-processes multicast network-streams
subprocesses menubar md5 xemacs tiff png gif jpeg xpm lisp-float-type
linux dialog devices window-system c-balloon-help)
Recent keystrokes:
-----------------
m o d i f y SPC i t SPC a s SPC f o l l o w s : RET
RET button1 button1up g y y SPC button1 button1up button1
button1up C-s m i n i b u f f e r = c BS BS - c o m
p l e t e C-s C-s C-s C-s C-x C-g q C-n C-n C-n C-n
C-n C-n C-n C-n C-n C-n C-x 1 C-p C-p C-n C-n C-p C-e
C-p C-p C-n C-n button1 button1up M-x r e p o r t -
x e TAB RET
Recent messages (most recent first):
-----------------------------------
Loading xemacsbug...done
Loading xemacsbug...
Entering debugger...
End of message 212 from John Meisner
212 messages, 1 new, 19 unread, 0 deleted
Updating of BBDB records finished
Loading bbdb-hooks...done
Loading bbdb-hooks...
noticed John Meisner's address "jmeisner(a)sift.info"
Make "jmeisner(a)sift.info" the primary address? (y or n) Yes
Make "jmeisner(a)sift.info" the primary address? (y or n)
Add address "jmeisner(a)sift.info" to "jmeisner(a)siftech.com,
jmeisner(a)qwest.net"? (y or n) Yes
Add address "jmeisner(a)sift.info" to "jmeisner(a)siftech.com,
jmeisner(a)qwest.net"? (y or n)
212 messages, 1 new, 19 unread, 0 deleted
Got mail from /var/mail/rpg.
Wrote /home/rpg/vm/inbox
Checking for new mail for /home/rpg/vm/inbox...
Quit
Show replies by date