Jerry James wrote:
Okay, I lied. I had a few more minutes. Now I've got it down to this recipe:
1. xemacs --vanilla
2. M-x find-library mule-util
3. Evaluate (defun truncate-string-to-width ...) in that file.
4. Click on the menubar
So something is funny with the mule-util.el version of
truncate-string-to-width. Does anybody know why there are versions of
that function in both subr.el and mule-util.el? There are versions of
store-substring in both places, too.
On Windows XP Pro SP3, I don't get a crash, but I do get:
(event/warning) Error during menu handling: (wrong-number-of-arguments
((lambda (str end-column &optional start-column padding) Truncate string
STR to end at column END-COLUMN.
The optional 2nd arg START-COLUMN, if non-nil, specifies
the starting column; that means to return the characters occupying
columns START-COLUMN ... END-COLUMN of STR.
The optional 3rd arg PADDING, if non-nil, specifies a padding character
to add at the end of the result if STR doesn't reach column END-COLUMN,
or if END-COLUMN comes in the middle of a character in STR.
PADDING is also added at the beginning of the result
if column START-COLUMN appears in the middle of a character in STR.
If PADDING is nil, no padding is added in these cases, so
the resulting string may be narrower than END-COLUMN. (or start-column
(setq start-column 0)) (let ((len (length str)) (idx 0) (column 0)
(head-padding ) (tail-padding ) ch last-column last-idx from-idx)
(condition-case nil (while (< column start-column) (setq ch (aref str
idx) column (+ column (char-width ch)) idx (1+ idx))) (args-out-of-range
(setq idx len))) (if (< column start-column) (if padding (make-string
end-column padding) ) (if (and padding (> column start-column)) (setq
head-padding (make-string (- column start-column) padding))) (setq
from-idx idx) (if (< end-column column) (setq idx from-idx)
(condition-case nil (while (< column end-column) (setq last-column
column last-idx idx ch (aref str idx) column (+ column (char-width ch))
idx (1+ idx))) (args-out-of-range (setq idx len))) (if (> column
end-column) (setq column last-column idx last-idx)) (if (and padding (<
column end-column)) (setq tail-padding (make-string (- end-column
column) padding)))) (setq str (substring str from-idx idx)) (if padding
(concat head-padding str tail-padding) str)))) 5))
Backtrace follows:
# bind (inhibit-quit padding start-column end-column str)
truncate-string-to-width("str))))" 40 nil nil t)
# (unwind-protect ...)
# (catch #<INTERNAL OBJECT (XEmacs bug?) (opaque, size=0) 0x17e3da8> ...)
# (unwind-protect ...)
# bind (inhibit-quit)
# (unwind-protect ...)
# (unwind-protect ...)
("next_event_internal()" "[internal]")
# (unwind-protect ...)
# bind (inhibit-quit)
(next-event "[internal]")
# (condition-case ... . error)
# (catch top-level ...)
Rodney
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta