APPROVE COMMIT mule-base
As per the conversation on xemacs-beta about crashes when clicking on
the menubar, this patch removes the functions that lead to a Lisp
error that leads to the reported crash. These functions have been
defined in subr.el for several years, but we overlooked the fact that
these bitrotted versions were still in mule-util.el.
NOTE: This patch masks the fact that something in menubar-x.c is
causing a crash when there is a Lisp error in the menubar. There is a
report that a Lisp error is reported correctly on Windows, so
menubar-msw.c apparently gets this right. We need to fix menubar-x.c.
Index: mule-packages/mule-base/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/mule-packages/mule-base/ChangeLog,v
retrieving revision 1.66
diff -d -u -r1.66 ChangeLog
--- mule-packages/mule-base/ChangeLog 9 Aug 2008 12:41:17 -0000 1.66
+++ mule-packages/mule-base/ChangeLog 1 Sep 2009 18:56:15 -0000
@@ -1,3 +1,10 @@
+2009-09-01 Jerry James <james(a)xemacs.org>
+
+ * mule-util.el (store-substring): Remove older version of a
+ function that is now defined in subr.el.
+ (truncate-string-to-width): Ditto.
+ (truncate-string): Ditto.
+
2008-08-09 Norbert Koch <viteno(a)xemacs.org>
* Makefile (VERSION): XEmacs package 1.53 released.
Index: mule-packages/mule-base/mule-util.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/mule-packages/mule-base/mule-util.el,v
retrieving revision 1.3
diff -d -u -r1.3 mule-util.el
--- mule-packages/mule-base/mule-util.el 20 May 2007 19:32:53 -0000 1.3
+++ mule-packages/mule-base/mule-util.el 1 Sep 2009 18:56:15 -0000
@@ -68,75 +68,6 @@
;; "Return a vector of characters in STRING."
;; (string-to-sequence string 'vector))
-;;;###autoload
-(defun store-substring (string idx obj)
- "Embed OBJ (string or character) at index IDX of STRING."
- (if (characterp obj)
- (aset string idx obj)
- (let ((len1 (length obj))
- (len2 (length string))
- (i 0))
- (while (< i len1)
- (aset string (+ idx i) (aref obj i))
- (setq i (1+ i)))))
- string)
-
-;;;###autoload
-(defun truncate-string-to-width (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))))
-
-;;; For backward compatibility ...
-;;;###autoload
-(defalias 'truncate-string 'truncate-string-to-width)
-(make-obsolete 'truncate-string 'truncate-string-to-width)
;;; Nested alist handler. Nested alist is alist whose elements are
;;; also nested alist.
--
Jerry James
http://www.jamezone.org/
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches