Commit 4582a01c authored by Glenn Morris's avatar Glenn Morris
Browse files

Remove some reimplementations of cl-gensym

* lisp/thumbs.el: Require cl-lib at run-time too.
(thumbs-gensym-counter, thumbs-gensym):
Remove reimplementation of cl-gensym.
(thumbs-temp-file): Use cl-gensym.

* lisp/emacs-lisp/edebug.el: Require cl-lib at run-time too.
(edebug-gensym-index, edebug-gensym):
Remove reimplementation of cl-gensym.
(edebug-make-enter-wrapper, edebug-make-form-wrapper): Use cl-gensym.
parent a3d4dd87
2013-07-11 Glenn Morris <rgm@gnu.org> 2013-07-11 Glenn Morris <rgm@gnu.org>
* emacs-lisp/edebug.el: Require cl-lib at run-time too.
(edebug-gensym-index, edebug-gensym):
Remove reimplementation of cl-gensym.
(edebug-make-enter-wrapper, edebug-make-form-wrapper): Use cl-gensym.
* thumbs.el: Require cl-lib at run-time too.
(thumbs-gensym-counter, thumbs-gensym):
Remove reimplementation of cl-gensym.
(thumbs-temp-file): Use cl-gensym.
* emacs-lisp/ert.el: Require cl-lib at runtime too. * emacs-lisp/ert.el: Require cl-lib at runtime too.
(ert--cl-do-remf, ert--remprop, ert--remove-if-not) (ert--cl-do-remf, ert--remprop, ert--remove-if-not)
(ert--intersection, ert--set-difference, ert--set-difference-eq) (ert--intersection, ert--set-difference, ert--set-difference-eq)
...@@ -691,7 +701,7 @@ ...@@ -691,7 +701,7 @@
* emacs-lock.el (emacs-lock-mode, emacs-lock--old-mode) * emacs-lock.el (emacs-lock-mode, emacs-lock--old-mode)
(emacs-lock--try-unlocking): Make defvar-local. (emacs-lock--try-unlocking): Make defvar-local.
2013-06-22 Glenn Morris <rgm@fencepost.gnu.org> 2013-06-22 Glenn Morris <rgm@gnu.org>
* play/cookie1.el (cookie-apropos): Minor simplification. * play/cookie1.el (cookie-apropos): Minor simplification.
...@@ -1157,7 +1167,7 @@ ...@@ -1157,7 +1167,7 @@
* net/shr.el (shr-map): Bind [down-mouse-1] to browse URLs. * net/shr.el (shr-map): Bind [down-mouse-1] to browse URLs.
2013-06-19 Glenn Morris <rgm@fencepost.gnu.org> 2013-06-19 Glenn Morris <rgm@gnu.org>
* emacs-lisp/eieio.el (defclass): Make it eval-and-compile once more. * emacs-lisp/eieio.el (defclass): Make it eval-and-compile once more.
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
;;; Code: ;;; Code:
(require 'macroexp) (require 'macroexp)
(eval-when-compile (require 'cl-lib)) (require 'cl-lib)
(eval-when-compile (require 'pcase)) (eval-when-compile (require 'pcase))
;;; Options ;;; Options
...@@ -263,26 +263,6 @@ An extant spec symbol is a symbol that is not a function and has a ...@@ -263,26 +263,6 @@ An extant spec symbol is a symbol that is not a function and has a
;;; Utilities ;;; Utilities
;; Define edebug-gensym - from old cl.el
(defvar edebug-gensym-index 0
"Integer used by `edebug-gensym' to produce new names.")
(defun edebug-gensym (&optional prefix)
"Generate a fresh uninterned symbol.
There is an optional argument, PREFIX. PREFIX is the string
that begins the new name. Most people take just the default,
except when debugging needs suggest otherwise."
(if (null prefix)
(setq prefix "G"))
(let ((newsymbol nil)
(newname ""))
(while (not newsymbol)
(setq newname (concat prefix (int-to-string edebug-gensym-index)))
(setq edebug-gensym-index (+ edebug-gensym-index 1))
(if (not (intern-soft newname))
(setq newsymbol (make-symbol newname))))
newsymbol))
(defun edebug-lambda-list-keywordp (object) (defun edebug-lambda-list-keywordp (object)
"Return t if OBJECT is a lambda list keyword. "Return t if OBJECT is a lambda list keyword.
A lambda list keyword is a symbol that starts with `&'." A lambda list keyword is a symbol that starts with `&'."
...@@ -1186,7 +1166,7 @@ Maybe clear the markers and delete the symbol's edebug property?" ...@@ -1186,7 +1166,7 @@ Maybe clear the markers and delete the symbol's edebug property?"
;; Uses the dynamically bound vars edebug-def-name and edebug-def-args. ;; Uses the dynamically bound vars edebug-def-name and edebug-def-args.
;; Do this after parsing since that may find a name. ;; Do this after parsing since that may find a name.
(setq edebug-def-name (setq edebug-def-name
(or edebug-def-name edebug-old-def-name (edebug-gensym "edebug-anon"))) (or edebug-def-name edebug-old-def-name (cl-gensym "edebug-anon")))
`(edebug-enter `(edebug-enter
(quote ,edebug-def-name) (quote ,edebug-def-name)
,(if edebug-inside-func ,(if edebug-inside-func
...@@ -1299,7 +1279,7 @@ expressions; a `progn' form will be returned enclosing these forms." ...@@ -1299,7 +1279,7 @@ expressions; a `progn' form will be returned enclosing these forms."
;; Set the name here if it was not set by edebug-make-enter-wrapper. ;; Set the name here if it was not set by edebug-make-enter-wrapper.
(setq edebug-def-name (setq edebug-def-name
(or edebug-def-name edebug-old-def-name (edebug-gensym "edebug-anon"))) (or edebug-def-name edebug-old-def-name (cl-gensym "edebug-anon")))
;; Add this def as a dependent of containing def. Buggy. ;; Add this def as a dependent of containing def. Buggy.
'(if (and edebug-containing-def-name '(if (and edebug-containing-def-name
......
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
;;; Code: ;;; Code:
(require 'dired) (require 'dired)
(require 'cl-lib) ; for cl-gensym
;; CUSTOMIZATIONS ;; CUSTOMIZATIONS
...@@ -179,21 +180,6 @@ this value can let another user see some of your images." ...@@ -179,21 +180,6 @@ this value can let another user see some of your images."
(make-variable-buffer-local 'thumbs-marked-list) (make-variable-buffer-local 'thumbs-marked-list)
(put 'thumbs-marked-list 'permanent-local t) (put 'thumbs-marked-list 'permanent-local t)
(defalias 'thumbs-gensym
(if (fboundp 'gensym)
'gensym
;; Copied from cl-macs.el
(defvar thumbs-gensym-counter 0)
(lambda (&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 thumbs-gensym-counter
(setq thumbs-gensym-counter
(1+ thumbs-gensym-counter))))))
(make-symbol (format "%s%d" pfix num))))))
(defsubst thumbs-temp-dir () (defsubst thumbs-temp-dir ()
(file-name-as-directory (expand-file-name thumbs-temp-dir))) (file-name-as-directory (expand-file-name thumbs-temp-dir)))
...@@ -202,7 +188,7 @@ The name is made by appending a number to PREFIX, default \"G\"." ...@@ -202,7 +188,7 @@ The name is made by appending a number to PREFIX, default \"G\"."
(format "%s%s-%s.jpg" (format "%s%s-%s.jpg"
(thumbs-temp-dir) (thumbs-temp-dir)
thumbs-temp-prefix thumbs-temp-prefix
(thumbs-gensym "T"))) (cl-gensym "T")))
(defun thumbs-thumbsdir () (defun thumbs-thumbsdir ()
"Return the current thumbnails directory (from `thumbs-thumbsdir'). "Return the current thumbnails directory (from `thumbs-thumbsdir').
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment