Mercurial > hg > xemacs-beta
diff lisp/obsolete.el @ 771:943eaba38521
[xemacs-hg @ 2002-03-13 08:51:24 by ben]
The big ben-mule-21-5 check-in!
Various files were added and deleted. See CHANGES-ben-mule.
There are still some test suite failures. No crashes, though.
Many of the failures have to do with problems in the test suite itself
rather than in the actual code. I'll be addressing these in the next
day or so -- none of the test suite failures are at all critical.
Meanwhile I'll be trying to address the biggest issues -- i.e. build
or run failures, which will almost certainly happen on various platforms.
All comments should be sent to ben@xemacs.org -- use a Cc: if necessary
when sending to mailing lists. There will be pre- and post- tags,
something like
pre-ben-mule-21-5-merge-in, and
post-ben-mule-21-5-merge-in.
author | ben |
---|---|
date | Wed, 13 Mar 2002 08:54:06 +0000 |
parents | 29e4e3036b4e |
children | e65d9cf16707 |
line wrap: on
line diff
--- a/lisp/obsolete.el Fri Mar 08 13:33:14 2002 +0000 +++ b/lisp/obsolete.el Wed Mar 13 08:54:06 2002 +0000 @@ -317,73 +317,6 @@ (make-obsolete 'following-char 'char-after) (make-obsolete 'preceding-char 'char-before) - -;; The following several functions are useful in GNU Emacs 20 because -;; of the multibyte "characters" the internal representation of which -;; leaks into Lisp. In XEmacs/Mule they are trivial and unnecessary. -;; We provide them for compatibility reasons solely. - -(defun string-to-sequence (string type) - "Convert STRING to a sequence of TYPE which contains characters in STRING. -TYPE should be `list' or `vector'. -Multibyte characters are concerned." - (ecase type - (list - (mapcar #'identity string)) - (vector - (mapvector #'identity string)))) - -(defun string-to-list (string) - "Return a list of characters in STRING." - (mapcar #'identity string)) - -(defun string-to-vector (string) - "Return a vector of characters in STRING." - (mapvector #'identity string)) - -(defun store-substring (string idx object) - "Embed OBJECT (string or character) at index IDX of STRING." - (let* ((str (cond ((stringp object) object) - ((characterp object) (char-to-string object)) - (t (error - "Invalid argument (should be string or character): %s" - object)))) - (string-len (length string)) - (len (length str)) - (i 0)) - (while (and (< i len) (< idx string-len)) - (aset string idx (aref str i)) - (setq idx (1+ idx) i (1+ i))) - string)) - -;; #### This function is not compatible with FSF in some cases. Hard -;; to fix, because it is hard to trace the logic of the FSF function. -;; In case we need the exact behavior, we can always copy the FSF -;; version, which is very long and does lots of unnecessary stuff. -(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))) - (concat (substring str (min start-column len) (min end-column len)) - (and padding (> end-column len) - (make-string (- end-column len) padding))))) - -(defalias 'truncate-string 'truncate-string-to-width) -(make-obsolete 'truncate-string 'truncate-string-to-width) - ;; Keywords already do The Right Thing in XEmacs (make-compatible 'define-widget-keywords "Just use them")