mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-01 11:14:55 +00:00
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.
This commit is contained in:
parent
a3d4dd872c
commit
4582a01c70
@ -1,5 +1,15 @@
|
||||
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.
|
||||
(ert--cl-do-remf, ert--remprop, ert--remove-if-not)
|
||||
(ert--intersection, ert--set-difference, ert--set-difference-eq)
|
||||
@ -691,7 +701,7 @@
|
||||
* emacs-lock.el (emacs-lock-mode, emacs-lock--old-mode)
|
||||
(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.
|
||||
|
||||
@ -1157,7 +1167,7 @@
|
||||
|
||||
* 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.
|
||||
|
||||
|
@ -53,7 +53,7 @@
|
||||
;;; Code:
|
||||
|
||||
(require 'macroexp)
|
||||
(eval-when-compile (require 'cl-lib))
|
||||
(require 'cl-lib)
|
||||
(eval-when-compile (require 'pcase))
|
||||
|
||||
;;; Options
|
||||
@ -263,26 +263,6 @@ An extant spec symbol is a symbol that is not a function and has a
|
||||
|
||||
;;; 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)
|
||||
"Return t if OBJECT is a lambda list keyword.
|
||||
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?"
|
||||
;; Uses the dynamically bound vars edebug-def-name and edebug-def-args.
|
||||
;; Do this after parsing since that may find a 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
|
||||
(quote ,edebug-def-name)
|
||||
,(if edebug-inside-func
|
||||
@ -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.
|
||||
(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.
|
||||
'(if (and edebug-containing-def-name
|
||||
|
@ -57,6 +57,7 @@
|
||||
;;; Code:
|
||||
|
||||
(require 'dired)
|
||||
(require 'cl-lib) ; for cl-gensym
|
||||
|
||||
;; CUSTOMIZATIONS
|
||||
|
||||
@ -179,21 +180,6 @@ this value can let another user see some of your images."
|
||||
(make-variable-buffer-local 'thumbs-marked-list)
|
||||
(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 ()
|
||||
(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\"."
|
||||
(format "%s%s-%s.jpg"
|
||||
(thumbs-temp-dir)
|
||||
thumbs-temp-prefix
|
||||
(thumbs-gensym "T")))
|
||||
(cl-gensym "T")))
|
||||
|
||||
(defun thumbs-thumbsdir ()
|
||||
"Return the current thumbnails directory (from `thumbs-thumbsdir').
|
||||
|
Loading…
Reference in New Issue
Block a user