Dear Bug Team!
I started XEmacs with
xemacs test.tex&
(Init file and test.tex is included below.)
I tried to insert several references using RefTeX: I typed C-c ). I
typed s to select the section label type. A new buffer appeared at
the bottom with the list of the sections. I pressed down to move to
the first section, which was highlighted with a light green
background. I pressed m to mark the reference for insertion. The
entry for the first section appeared in bold and on the top a new
buffer *Backtrace* whose content is included below.
I expected that after pressing m, there is no error and *1* appears
after > in the marked entry and not in the error message. Otherwise,
XEmacs behaved as I expected.
I think the problem is a missing string to glyph conversion in
reftex-select-mark (supported by the wrong type argument error on the
top of the backtrace) when ir calls reftex-overlay-put. I haven't
found any shorter way for the conversion than
(make-glyph (vector 'string ':data STRING))
where STRING is a Lisp expression evaluating to a string.
I suggest the following patch, which adds the above string to glyph
conversion (also for reftex-select-unmark for completeness):
--- /usr/local/lib/xemacs/xemacs-packages/lisp/reftex/reftex-sel.el 2004-03-15 16:50:20.000000000 +0100
+++ /home/gabor/.xemacs-igazi/xemacs-packages/lisp/reftex/reftex-sel.el 2006-03-07 16:23:35.000000000 +0100
@@ -609,10 +609,11 @@
(reftex-overlay-put ovl 'face reftex-select-mark-face)
(if (featurep 'xemacs)
(reftex-overlay-put ovl 'begin-glyph
+ (make-glyph (vector 'string ':data
(if separator
(format "*%c%d* " separator
(length reftex-select-marked))
- (format "*%d* " (length reftex-select-marked)))))
+ (format "*%d* " (length reftex-select-marked)))))))
(message "Entry has mark no. %d" (length reftex-select-marked))))
(defun reftex-select-mark-comma ()
@@ -646,9 +647,10 @@
(mapcar (lambda (c)
(setq sep (nth 2 c))
(reftex-overlay-put (nth 1 c) 'begin-glyph
+ (make-glyph (vector 'string ':data
(if sep
(format "*%c%d* " sep (decf cnt))
- (format "*%d* " (decf cnt)))))
+ (format "*%d* " (decf cnt)))))))
reftex-select-marked)))
(message "Entry no longer marked")))
I have tried the patch and seems to fix the problem.
Files for reproducing the bug:
Lines starting with --- mark the beginning and end of file but do not
belong to the file.
--- ~/.xemacs/init.el
(setq debug-on-error t)
(require 'tex-site) ;AUCTeX
(setq TeX-parse-self t
TeX-auto-save t)
;;RefTeX
(add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode
(add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode
(setq reftex-plug-into-AUCTeX t) ; RefTeX -> AUCTeX
--- End of ~/.xemacs/init.el
--- test.tex
\documentclass{article}
\begin{document}
\section{First section}
\label{sec:first-section}
\section{Second section}
\label{sec:second-section}
\end{document}
-- End of test.tex
--- Buffer *Backtrace*
Debugger entered--Lisp error: (wrong-type-argument glyphp "*1* ")
reftex-overlay-put(#<extent [22, 101) 0x88d7f54 in buffer *RefTeX Select*> begin-glyph "*1* ")
#<compiled-function (&optional separator) "...(96)" [separator eoe boe data ovl reftex-select-marked get-text-property :data nil error "No entry to mark at point" "Entry is already marked" previous-single-property-change next-single-property-change reftex-make-overlay reftex-overlay-put face featurep xemacs begin-glyph format "*%c%d* " "*%d* " message "Entry has mark no. %d" reftex-select-mark-face] 8 ("/usr/local/lib/xemacs/xemacs-packages/lisp/reftex/reftex-sel.elc" . 10843) nil>()
call-interactively(reftex-select-mark)
recursive-edit()
byte-code("..." [prompt keymap reftex-last-line reftex-last-data offset truncate-lines t reftex-find-start-point 0 make-local-variable reftex-last-follow-point ((byte-code "\nà qÄÃ!ÅÆÇÈ#ÅÉÊÈ#)ËÌ\"" ... 4)) use-local-map add-hook pre-command-hook reftex-select-pre-command-hook nil post-command-hook reftex-select-post-command-hook princ featurep xemacs run-hooks recursive-edit reftex-recursive-edit-marker] 5)
byte-code("..." [((byte-code "ÆÇe\n$ÈyÉÊ!`LËÌ !ÍÎÏÐÆ$ÍÑÒÐÆ$Ó!`ÐÔÕ!«ÖÑ!× )" ... 5))] 1)
reftex-select-item("Select: [n]ext [p]revious [r]escan [ ]context e[x]tern [q]uit RET [?]HELP+more" " n / p Go to next/previous label (Cursor motion works as well)\n C-c C-n/p Go to next/previous section heading.\n b / l Jump back to previous selection / Reuse last referenced label.\n z Jump to a specific section, e.g. '3 z' jumps to section 3.\n g / s Update menu / Switch label type.\n r / C-u r Reparse document / Reparse entire document.\n x Switch to label menu of external document (with LaTeX package `xr').\n F t c Toggle: [F]ile borders, [t]able of contents, [c]ontext\n # % Toggle: [#] label counters, [%] labels in comments\n SPC / f Show full context in other window / Toggle follow mode.\n . Show insertion point in other window.\n v / V Toggle \\ref <-> \\vref / Rotate \\ref <=> \\fref <=> \\Fref\n TAB Enter a label with completion.\n m , - + Mark entry. `,-+' also assign a separator.!
\n a / A Put all marked entries into one/many \\ref commands.\n q / RET Quit without referencing / Accept current label (also on mouse-2)." #<keymap size 52 0x1fd0> (toc "toc" " 1 First section" "/home/gabor/tmp/reftex/test.tex" #<marker at 43 in test.tex 0x8956c54> 2 "1" "\\section{First section}" 43) reftex-show-label-location nil)
byte-code("..." [here-I-am typekey offset buf entries key delete-other-windows syntax-table reftex-select-label-mode switch-to-buffer-other-window reftex-make-selection-buffer-name "*RefTeX Select*" reftex-erase-buffer add-to-list selection-buffers t "---- " mode-line-buffer-identification " " global-mode-string " (" ")" " S<" refstyle ">" " -%-" 0 buffer-size nil message "Creating Selection Buffer..." reftex-insert-docstruct reftex-get-offset reftex-select-item reftex-show-label-location 2 throw exit ?g ?r ?R reftex-reparse-document ?c ?s reftex-query-label-type ?t prefix-numeric-value ?F ?\# ?% ...] 13)
byte-code("..." [((byte-code "Æ NÇ OÈPQ«ÉqÊ !)!ªÉË!Ì )RÈa¬È ÍÎp\"ÏSÐÑÒÓÔTÕÖ×ØÙ¯UÚÛ U«¢ÜIÝÞ!ß@ ÜABCD®\nJÜ&)ª«à #ªÏÏI\n®ÏÜáVWX\nâY&E@EA@FãE8KÏ
¬
äåÜ\"
æa«Ì Ñ
ça¬
èa«G«èÌ éK
#Ñ
êa«Ì B?BÑ
ëa«Zì Ñ
ía«Ì G«îG![Ñ@?@Ñ
ïa«Ì A?AÑ
ða«Ì C?CÑ
ña«Ì D?DÑ
òa«LäåÏ\"Ñ
óa«©ôH?\"?õ?H8A!®ö÷!?H8@®øJqù ªÒ
;«ú
\\J\"®
DCCäåÏ\"ª¹
ûs«°M«MªF«FCCªÜ«
ük«ýBLqäåÏ\"ªöþ!Ü" ... 13))] 1)
reftex-offer-label-menu("s")
#<compiled-function (&optional type no-insert cut) "...(270)" [cut label reftex-format-ref-function form type labels reftex-check-recursive-edit reftex-access-scan-info reftex-guess-label-type reftex-query-label-type reftex-typekey-check "\\vref" "\\fref" "\\ref" "\\ref{%s}" nil reftex-offer-label-menu reftex-ensure-compiled-variables concat mapconcat car "," assoc message "Quit" 2 backward-delete-char ?~ string-to-char (?\ ?\t ?\n ?\. ?~) 1 reftex-format-vref reftex-format-fref "\\Fref" reftex-format-Fref format "" refstyle sep1 sep reftex-select-return-marker current-prefix-arg reftex-vref-is-default reftex-fref-is-default reftex-typekey-to-format-alist no-insert reftex-multiref-punctuation] 5 ("/usr/local/lib/xemacs/xemacs-packages/lisp/reftex/reftex-ref.elc" . 7672) nil>()
call-interactively(reftex-reference)
--- End of *Backtrace*
Best wishes,
Gabor Braun
================================================================
System Info to help track down your bug:
---------------------------------------
uname -a: Linux gabor 2.6.15-1-686 #1 Tue Feb 21 20:25:22 UTC 2006 i686 GNU/Linux
./configure '--dynamic' '--with-msw=no' '--with-widgets=athena' '--with-athena=3d' '--with-sound=esd,native' '--with-mule' '--with-xfs' '--pdump' '--with-file-coding'
XEmacs 21.4.19 "Constant Variable" configured for `i686-pc-linux'.
Compilation / Installation:
Source code location: /home/gabor/xemacs-21.4.19
Installation prefix: /usr/local
Operating system description file: `s/linux.h'
Machine description file: `m/intel386.h'
Compiler: gcc -g -O3 -Wall -Wno-switch -Winline -Wmissing-prototypes -Wsign-compare -fno-strict-aliasing -Wshadow
Compiler version: gcc (GCC) 3.3.5 (Debian 1:3.3.5-13)
Compiler specs file: /usr/lib/gcc-lib/i486-linux/3.3.5/specs
Relocating allocator for buffers: no
GNU version of malloc: yes
- Using Doug Lea's new malloc from the GNU C Library.
Need to guess glibc1/2/etc here
Window System:
Compiling in support for the X window system:
- X Windows headers location: /usr/X11R6/include
- X Windows libraries location: /usr/X11R6/lib
- Handling WM_COMMAND properly.
Compiling in support for the Athena widget set:
- Athena headers location: X11/Xaw3d
- Athena library to link: Xaw3d
Using Lucid menubars.
Using Lucid scrollbars.
Using Athena dialog boxes.
Using Athena native widgets.
TTY:
Compiling in support for ncurses.
Images:
Compiling in support for GIF images (builtin).
Compiling in support for XPM images.
Compiling in support for PNG images.
Compiling in support for JPEG images.
Compiling in support for TIFF images.
Sound:
Compiling in support for sound (native).
Compiling in support for ESD (Enlightened Sound Daemon).
Databases:
Internationalization:
Compiling in support for Mule (multi-lingual Emacs).
Compiling in support for file coding.
Compiling in support for XIM (X11R5+ I18N input method).
- Using raw Xlib to provide XIM support.
- Using XFontSet to provide bilingual menubar.
Mail:
Compiling in support for "dot-locking" mail spool file locking method.
Other Features:
Inhibiting IPv6 canonicalization at startup.
Compiling in support for dynamic shared object modules.
Using the new portable dumper.
Load-Path Lisp Shadows:
----------------------
nil
Installed XEmacs Packages:
-------------------------
(xslide ver: 1.09 upstream: 0.2.2)
(xlib ver: 1.14 upstream: lg(a)xwem.org--2005/xlib--main--2.1--version-0)
(xemacs-devel ver: 1.72 upstream: No-Upstream-Ver)
(xemacs-base ver: 2.01 upstream: No-Upstream-Ver)
(x-symbol ver: 1.1 upstream: 4.5.1)
(w3 ver: 1.32 upstream: 4.0pre47)
(vm ver: 7.22 upstream: 7.17)
(vc ver: 1.41 upstream: No-Upstream-Ver)
(tramp ver: 1.28 upstream: 2.0.51)
(textools ver: 1.15 upstream: No-Upstream-Ver)
(text-modes ver: 1.9 upstream: No-Upstream-Ver)
(texinfo ver: 1.3 upstream: No-Upstream-Ver)
(supercite ver: 1.21 upstream: 3.55x3)
(strokes ver: 1.1 upstream: No-Upstream-Ver)
(speedbar ver: 1.28 upstream: 0.14beta4)
(sounds-wav ver: 1.12 upstream: No-Upstream-Ver)
(sh-script ver: 1.21 upstream: 2.0f)
(sasl ver: 1.16 upstream: 1.14.4)
(reftex ver: 1.34 upstream: 4.21)
(re-builder ver: 1.05 upstream: 1.20)
(python-modes ver: 1.07 upstream: No-Upstream-Ver)
(psgml ver: 1.44 upstream: 1.3.1)
(ps-print ver: 1.11 upstream: 6.5.6)
(prog-modes ver: 2.06 upstream: No-Upstream-Ver)
(pgg ver: 1.06 upstream: 0.1)
(perl-modes ver: 1.08 upstream: No-Upstream-Ver)
(pcomplete ver: 1.04 upstream: 1.1.6)
(pcl-cvs ver: 1.66 upstream: R-2_9_9)
(pc ver: 1.28 upstream: No-Upstream-Ver)
(os-utils ver: 1.36 upstream: No-Upstream-Ver)
(net-utils ver: 1.48 upstream: N/A)
(mmm-mode ver: 1.02 upstream: 0.4.7)
(mail-lib ver: 1.75 upstream: No-Upstream-Ver)
(ispell ver: 1.32 upstream: 3.6)
(ilisp ver: 1.33 upstream: 5.12.0)
(igrep ver: 1.14 upstream: 2.111)
(ibuffer ver: 1.09 upstream: No-Upstream-Ver)
(hm--html-menus ver: 1.23 upstream: 5.9)
(gnats ver: 1.17 upstream: 3.101)
(general-docs ver: 1.04 upstream: No-Upstream-Ver)
(fsf-compat ver: 1.15 upstream: No-Upstream-Ver)
(frame-icon ver: 1.11 upstream: No-Upstream-Ver)
(eterm ver: 1.17 upstream: No-Upstream-Ver)
(eshell ver: 1.1 upstream: 2.4.1)
(escreen ver: 1.01 upstream: 1.16)
(emerge ver: 1.11 upstream: No-Upstream-Ver)
(elib ver: 1.11 upstream: 1.0)
(eieio ver: 1.05 upstream: 0.17)
(efs ver: 1.33 upstream: 1.23)
(edit-utils ver: 2.32 upstream: No-Upstream-Ver)
(ediff ver: 1.6 upstream: 2.75)
(edebug ver: 1.21 upstream: No-Upstream-Ver)
(ecrypto ver: 0.2 upstream: 2.0)
(ecb ver: 1.22 upstream: 2.31)
(docbookide ver: 0.07000000000000001 upstream: 0.1)
(dired ver: 1.17 upstream: 7.13)
(debug ver: 1.17 upstream: No-Upstream-Ver)
(cc-mode ver: 1.45 upstream: 5.30.10)
(c-support ver: 1.22 upstream: No-Upstream-Ver)
(bbdb ver: 1.29 upstream: 2.34)
(auctex ver: 1.46 upstream: 11.55)
(apel ver: 1.32 upstream: 10.6)
(mule-ucs ver: 1.14 upstream: 0.84)
(mule-base ver: 1.47 upstream: No-Upstream-Ver)
(lookup ver: 1.15 upstream: 1.0)
(locale ver: 1.22 upstream: No-Upstream-Ver)
(leim ver: 1.22 upstream: No-Upstream-Ver)
(latin-unity ver: 1.16 upstream: 1.16)
(latin-euro-standards ver: 1.07 upstream: 1.07)
Installed Modules:
-----------------
Features:
--------
(mail-abbrevs xemacsbug shadow sendmail rfc822 debug reftex-sel
reftex-parse reftex-ref reftex-vcr reftex-dcr reftex-auc reftex
reftex-vars outline font-latex font disp-table font-lock cus-face
latex tex advice advice-preload regexp-opt efs-cu tex-site
xslide-autoloads xlib-autoloads xemacs-devel-autoloads
xemacs-base-autoloads x-symbol-autoloads w3-autoloads vm-autoloads
vc-autoloads tramp-autoloads textools-autoloads text-modes-autoloads
texinfo-autoloads supercite-autoloads strokes-autoloads
speedbar-autoloads sounds-wav-autoloads sh-script-autoloads
sasl-autoloads reftex-autoloads re-builder-autoloads
python-modes-autoloads psgml-autoloads ps-print-autoloads
prog-modes-autoloads pgg-autoloads perl-modes-autoloads
pcomplete-autoloads pcl-cvs-autoloads pc-autoloads os-utils-autoloads
net-utils-autoloads mmm-mode-autoloads mail-lib-autoloads
ispell-autoloads ilisp-autoloads igrep-autoloads ibuffer-autoloads
hm--html-menus-autoloads gnats-autoloads general-docs-autoloads
fsf-compat-autoloads frame-icon-autoloads eterm-autoloads
eshell-autoloads escreen-autoloads emerge-autoloads elib-autoloads
eieio-autoloads efs-autoloads edit-utils-autoloads ediff-autoloads
edebug-autoloads ecrypto-autoloads ecb-autoloads docbookide-autoloads
dired-autoloads debug-autoloads cc-mode-autoloads c-support-autoloads
bbdb-autoloads auctex-autoloads apel-autoloads mule-ucs-autoloads
mule-base-autoloads lookup-autoloads locale-autoloads leim-autoloads
latin-unity-autoloads latin-euro-standards-autoloads lisp-autoloads
loadhist auto-show fontl-hooks x-iso8859-1 slovenian czech romanian
ccl mule-help code-cmds gutter-items menubar-items x-menubar
mode-motion mouse itimer auto-save lisp-mode easymenu iso8859-1 page
buff-menu lib-complete cus-file derived frame text-props obsolete
cus-start custom widget cl-extra mini-cl cl cl-19 packages backquote
very-early-lisp file-coding mule lucid-scrollbars cut-buffer
lucid-menubars athena-dialogs x c-balloon-help tty-frames tty toolbar
esd-sound native-sound scrollbar unix-processes multicast
network-streams subprocesses modules menu-accelerator-support menubar
md5 xemacs xim gutter tiff png gif jpeg xpm xbm lisp-float-type linux
dialog devices window-system base64)
Recent keystrokes:
-----------------
C-c ) s down m misc-user
Recent messages (most recent first):
-----------------------------------
Loading xemacsbug...done
Loading xemacsbug...
Entering debugger...
Loading debug...done
Loading debug...
Select: [n]ext [p]revious [r]escan [ ]context e[x]tern [q]uit RET [?]HELP+more
Select: [n]ext [p]revious [r]escan [ ]context e[x]tern [q]uit RET [?]HELP+more
Creating Selection Buffer...
Loading reftex-sel...done
Loading reftex-sel...
Label type: [ efinNst]
Label type: [ efinNst] (?=Help)
Scanning document... done
Scanning section 2 ...
Scanning section 1 ...
Scanning file /home/gabor/tmp/reftex/test.tex
Scanning entire document...
Loading reftex-parse...done
Loading reftex-parse...
Compiling label environment definitions...done