diff options
author | Vincent Belaïche <vincentb1@users.sourceforge.net> | 2017-09-15 23:52:24 +0200 |
---|---|---|
committer | Vincent Belaïche <vincentb1@users.sourceforge.net> | 2017-09-15 23:52:24 +0200 |
commit | 767b3a7429d94d1565256565fda2060c95ca4f73 (patch) | |
tree | 51ea759d20769230bd57fd6a93f0c98d261063b0 /lisp/emacs-lisp/cl-macs.el | |
parent | d1458d0f40f481e0ac55a55e7567d6e51438b583 (diff) | |
parent | 9785d3513741c598ae53aecafacbb9bca3e53e48 (diff) | |
download | emacs-767b3a7429d94d1565256565fda2060c95ca4f73.tar.gz emacs-767b3a7429d94d1565256565fda2060c95ca4f73.tar.bz2 emacs-767b3a7429d94d1565256565fda2060c95ca4f73.zip |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'lisp/emacs-lisp/cl-macs.el')
-rw-r--r-- | lisp/emacs-lisp/cl-macs.el | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index eee5953882d..d90e70d3d8b 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -20,7 +20,7 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. +;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. ;;; Commentary: @@ -161,9 +161,16 @@ whether X is known at compile time, macroexpand it completely in ;;; Symbols. -(defvaralias 'cl--gensym-counter 'gensym-counter) +(defvar cl--gensym-counter 0) ;;;###autoload -(cl--defalias 'cl-gensym 'gensym) +(defun cl-gensym (&optional prefix) + "Generate a new uninterned symbol. +The name is made by appending a number to PREFIX, default \"G\"." + (let ((pfix (if (stringp prefix) prefix "G")) + (num (if (integerp prefix) prefix + (prog1 cl--gensym-counter + (setq cl--gensym-counter (1+ cl--gensym-counter)))))) + (make-symbol (format "%s%d" pfix num)))) (defvar cl--gentemp-counter 0) ;;;###autoload |