summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/cl-macs.el
diff options
context:
space:
mode:
authorVincent Belaïche <vincentb1@users.sourceforge.net>2017-09-15 23:52:24 +0200
committerVincent Belaïche <vincentb1@users.sourceforge.net>2017-09-15 23:52:24 +0200
commit767b3a7429d94d1565256565fda2060c95ca4f73 (patch)
tree51ea759d20769230bd57fd6a93f0c98d261063b0 /lisp/emacs-lisp/cl-macs.el
parentd1458d0f40f481e0ac55a55e7567d6e51438b583 (diff)
parent9785d3513741c598ae53aecafacbb9bca3e53e48 (diff)
downloademacs-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.el13
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