comparison lisp/obsolete.el @ 444:576fb035e263 r21-2-37

Import from CVS: tag r21-2-37
author cvs
date Mon, 13 Aug 2007 11:36:19 +0200
parents abe6d1db359e
children 29e4e3036b4e
comparison
equal deleted inserted replaced
443:a8296e22da4e 444:576fb035e263
55 "Define OLDVAR as an obsolete alias for variable NEWVAR. 55 "Define OLDVAR as an obsolete alias for variable NEWVAR.
56 This makes referencing or setting OLDVAR equivalent to referencing or 56 This makes referencing or setting OLDVAR equivalent to referencing or
57 setting NEWVAR and marks OLDVAR as obsolete. 57 setting NEWVAR and marks OLDVAR as obsolete.
58 If OLDVAR was bound and NEWVAR was not, Set NEWVAR to OLDVAR. 58 If OLDVAR was bound and NEWVAR was not, Set NEWVAR to OLDVAR.
59 59
60 Note: Use this before any other references (defvar/defcustom) to NEWVAR" 60 Note: Use this before any other references (defvar/defcustom) to NEWVAR."
61 (let ((needs-setting (and (boundp oldvar) (not (boundp newvar)))) 61 (let ((needs-setting (and (boundp oldvar) (not (boundp newvar))))
62 (value (and (boundp oldvar) (symbol-value oldvar)))) 62 (value (and (boundp oldvar) (symbol-value oldvar))))
63 (defvaralias oldvar newvar) 63 (defvaralias oldvar newvar)
64 (make-obsolete-variable oldvar newvar) 64 (make-obsolete-variable oldvar newvar)
65 (and needs-setting (set newvar value)))) 65 (and needs-setting (set newvar value))))
336 336
337 (defun string-to-vector (string) 337 (defun string-to-vector (string)
338 "Return a vector of characters in STRING." 338 "Return a vector of characters in STRING."
339 (mapvector #'identity string)) 339 (mapvector #'identity string))
340 340
341 (defun store-substring (string idx obj) 341 (defun store-substring (string idx object)
342 "Embed OBJ (string or character) at index IDX of STRING." 342 "Embed OBJECT (string or character) at index IDX of STRING."
343 (let* ((str (cond ((stringp obj) obj) 343 (let* ((str (cond ((stringp object) object)
344 ((characterp obj) (char-to-string obj)) 344 ((characterp object) (char-to-string object))
345 (t (error 345 (t (error
346 "Invalid argument (should be string or character): %s" 346 "Invalid argument (should be string or character): %s"
347 obj)))) 347 object))))
348 (string-len (length string)) 348 (string-len (length string))
349 (len (length str)) 349 (len (length str))
350 (i 0)) 350 (i 0))
351 (while (and (< i len) (< idx string-len)) 351 (while (and (< i len) (< idx string-len))
352 (aset string idx (aref str i)) 352 (aset string idx (aref str i))