Commits

james  committed 71c1609

Remove bitrotted versions of store-substring and truncate-string-to-width. See
<870180fe0909011203n69fff6iaa40150ef32d3c70@mail.gmail.com> on xemacs-patches.

  • Participants
  • Parent commits 9341609

Comments (0)

Files changed (2)

+2009-09-01  Jerry James  <james@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@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.53 released.

File mule-util.el

 ;;   "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.