X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fcl.el;h=8150e1d83898cb32f200b44ec27df94d6fdfc897;hb=126b1c706cde7fda7e1cf5f1851371a25400d5a4;hp=33c554c9cf9429e8397e6c2b13646a127d9c9a85;hpb=82f6d62ee211b1d36e8f45fed3ee3edde82b6916;p=chise%2Fxemacs-chise.git.1 diff --git a/lisp/cl.el b/lisp/cl.el index 33c554c..8150e1d 100644 --- a/lisp/cl.el +++ b/lisp/cl.el @@ -217,7 +217,7 @@ Keywords supported: :test :test-not :key" (defun cl-set-substring (str start end val) (if end (if (< end 0) (incf end (length str))) (setq end (length str))) - (if (< start 0) (incf start str)) + (if (< start 0) (incf start (length str))) (concat (and (> start 0) (substring str 0 start)) val (and (< end (length str)) (substring str end)))) @@ -319,7 +319,10 @@ definitions to shadow the loaded ones for use in file byte-compilation." (defun gensym (&optional arg) "Generate a new uninterned symbol. -The name is made by appending a number to PREFIX, default \"G\"." +The name is made by appending a number to a prefix. If ARG is a string, it +is the prefix, otherwise the prefix defaults to \"G\". If ARG is an integer, +the internal counter is reset to that number before creating the name. +There is no way to specify both using this function." (let ((prefix (if (stringp arg) arg "G")) (num (if (integerp arg) arg (prog1 *gensym-counter* @@ -328,7 +331,8 @@ The name is made by appending a number to PREFIX, default \"G\"." (defun gentemp (&optional arg) "Generate a new interned symbol with a unique name. -The name is made by appending a number to PREFIX, default \"G\"." +The name is made by appending a number to ARG, default \"G\". +If ARG is not a string, it is ignored." (let ((prefix (if (stringp arg) arg "G")) name) (while (intern-soft (setq name (format "%s%d" prefix *gensym-counter*)))