1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Don't call purecopy in emacs-lisp/*.el

* lisp/emacs-lisp/byte-run.el (define-obsolete-face-alias)
(make-obsolete-variable, make-obsolete):
* lisp/emacs-lisp/cl-extra.el (cl-type-definition):
* lisp/emacs-lisp/cl-preloaded.el (cl-assertion-failed):
* lisp/emacs-lisp/cl-print.el (help-byte-code):
* lisp/emacs-lisp/derived.el (define-derived-mode):
* lisp/emacs-lisp/easy-mmode.el (define-minor-mode):
* lisp/emacs-lisp/eldoc.el (eldoc-minor-mode-string):
* lisp/emacs-lisp/gv.el (make-obsolete-generalized-variable):
* lisp/emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression):
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--parse-file):
* lisp/emacs-lisp/warnings.el (warning-type-format):
Remove calls to purecopy.
This commit is contained in:
Stefan Kangas 2024-12-09 21:17:09 +01:00
parent b0afe306b7
commit 8da7086be6
11 changed files with 69 additions and 69 deletions

View file

@ -543,7 +543,7 @@ was first made obsolete, for example a date or a release number."
(put obsolete-name 'byte-obsolete-info
;; The second entry used to hold the `byte-compile' handler, but
;; is not used any more nowadays.
(purecopy (list current-name nil when)))
(list current-name nil when))
obsolete-name)
(defmacro define-obsolete-function-alias ( obsolete-name current-name when
@ -578,7 +578,7 @@ ACCESS-TYPE if non-nil should specify the kind of access that will trigger
obsolescence warnings; it can be either `get' or `set'."
(byte-run--constant-obsolete-warning obsolete-name)
(put obsolete-name 'byte-obsolete-variable
(purecopy (list current-name access-type when)))
(list current-name access-type when))
obsolete-name)
(defmacro define-obsolete-variable-alias ( obsolete-name current-name when
@ -633,7 +633,7 @@ obsolete, for example a date or a release number."
`(progn
(put ,obsolete-face 'face-alias ,current-face)
;; Used by M-x describe-face.
(put ,obsolete-face 'obsolete-face (or (purecopy ,when) t))))
(put ,obsolete-face 'obsolete-face (or ,when t))))
(defmacro dont-compile (&rest body)
"Like `progn', but the body always runs interpreted (not compiled).

View file

@ -722,7 +722,7 @@ PROPLIST is a list of the sort returned by `symbol-plist'.
(define-button-type 'cl-type-definition
:supertype 'help-function-def
'help-echo (purecopy "mouse-2, RET: find type definition"))
'help-echo "mouse-2, RET: find type definition")
(declare-function help-fns-short-filename "help-fns" (filename))

View file

@ -41,7 +41,7 @@
;; The `assert' macro from the cl package signals
;; `cl-assertion-failed' at runtime so always define it.
(define-error 'cl-assertion-failed (purecopy "Assertion failed"))
(define-error 'cl-assertion-failed "Assertion failed")
(defun cl--assertion-failed (form &optional string sargs args)
(if debug-on-error

View file

@ -160,7 +160,7 @@ Print the contents hidden by the ellipsis to STREAM."
'follow-link t
'action (lambda (button)
(disassemble (button-get button 'byte-code-function)))
'help-echo (purecopy "mouse-2, RET: disassemble this function"))
'help-echo "mouse-2, RET: disassemble this function")
(defvar cl-print-compiled nil
"Control how to print byte-compiled functions.

View file

@ -220,7 +220,7 @@ No problems result if this variable is not bound.
(with-no-warnings (defvar ,map (make-sparse-keymap)))
(unless (get ',map 'variable-documentation)
(put ',map 'variable-documentation
(purecopy ,(format "Keymap for `%s'." child))))
,(format "Keymap for `%s'." child)))
,(if declare-syntax
`(progn
(defvar ,syntax)
@ -229,7 +229,7 @@ No problems result if this variable is not bound.
(defvar ,syntax (make-syntax-table)))
(unless (get ',syntax 'variable-documentation)
(put ',syntax 'variable-documentation
(purecopy ,(format "Syntax table for `%s'." child))))))
,(format "Syntax table for `%s'." child)))))
,(if declare-abbrev
`(progn
(defvar ,abbrev)
@ -239,7 +239,7 @@ No problems result if this variable is not bound.
(progn (define-abbrev-table ',abbrev nil) ,abbrev)))
(unless (get ',abbrev 'variable-documentation)
(put ',abbrev 'variable-documentation
(purecopy ,(format "Abbrev table for `%s'." child))))))
,(format "Abbrev table for `%s'." child)))))
(if (fboundp 'derived-mode-set-parent) ;; Emacs≥30.1
(derived-mode-set-parent ',child ',parent)
(put ',child 'derived-mode-parent ',parent))

View file

@ -269,7 +269,7 @@ INIT-VALUE LIGHTER KEYMAP.
(setq body (cdr body))
(pcase keyw
(:init-value (setq init-value (pop body)))
(:lighter (setq lighter (purecopy (pop body))))
(:lighter (setq lighter (pop body)))
(:global (setq globalp (pop body))
(when (and globalp (symbolp mode))
(setq setter `(setq-default ,mode))

View file

@ -78,7 +78,7 @@ If nil, truncated messages will just have \"...\" to indicate truncation."
:version "28.1")
;;;###autoload
(defcustom eldoc-minor-mode-string (purecopy " ElDoc")
(defcustom eldoc-minor-mode-string " ElDoc"
"String to display in mode line when ElDoc Mode is enabled; nil for none."
:type '(choice string (const :tag "None" nil)))

View file

@ -182,7 +182,7 @@ If CURRENT-NAME is a string, that is the `use instead' message.
WHEN should be a string indicating when the variable was first
made obsolete, for example a date or a release number."
(put obsolete-name 'byte-obsolete-generalized-variable
(purecopy (list current-name when)))
(list current-name when))
obsolete-name)
;; Additions for `declare'. We specify the values as named aliases so

View file

@ -94,68 +94,68 @@
(defvar lisp-imenu-generic-expression
(list
(list nil
(purecopy (concat "^\\s-*("
(regexp-opt
'("defun" "defmacro"
;; Elisp.
"defun*" "defsubst" "define-inline"
"define-advice" "defadvice" "define-skeleton"
"define-compilation-mode" "define-minor-mode"
"define-global-minor-mode"
"define-globalized-minor-mode"
"define-derived-mode" "define-generic-mode"
"ert-deftest"
"cl-defun" "cl-defsubst" "cl-defmacro"
"cl-define-compiler-macro" "cl-defgeneric"
"cl-defmethod"
;; CL.
"define-compiler-macro" "define-modify-macro"
"defsetf" "define-setf-expander"
"define-method-combination"
;; CLOS and EIEIO
"defgeneric" "defmethod")
t)
"\\s-+\\(" (rx lisp-mode-symbol) "\\)"))
(concat "^\\s-*("
(regexp-opt
'("defun" "defmacro"
;; Elisp.
"defun*" "defsubst" "define-inline"
"define-advice" "defadvice" "define-skeleton"
"define-compilation-mode" "define-minor-mode"
"define-global-minor-mode"
"define-globalized-minor-mode"
"define-derived-mode" "define-generic-mode"
"ert-deftest"
"cl-defun" "cl-defsubst" "cl-defmacro"
"cl-define-compiler-macro" "cl-defgeneric"
"cl-defmethod"
;; CL.
"define-compiler-macro" "define-modify-macro"
"defsetf" "define-setf-expander"
"define-method-combination"
;; CLOS and EIEIO
"defgeneric" "defmethod")
t)
"\\s-+\\(" (rx lisp-mode-symbol) "\\)")
2)
;; Like the previous, but uses a quoted symbol as the name.
(list nil
(purecopy (concat "^\\s-*("
(regexp-opt
'("defalias" "define-obsolete-function-alias")
t)
"\\s-+'\\(" (rx lisp-mode-symbol) "\\)"))
(concat "^\\s-*("
(regexp-opt
'("defalias" "define-obsolete-function-alias")
t)
"\\s-+'\\(" (rx lisp-mode-symbol) "\\)")
2)
(list (purecopy "Variables")
(purecopy (concat "^\\s-*("
(regexp-opt
'(;; Elisp
"defconst" "defcustom" "defvar-keymap"
;; CL
"defconstant"
"defparameter" "define-symbol-macro")
t)
"\\s-+\\(" (rx lisp-mode-symbol) "\\)"))
(list "Variables"
(concat "^\\s-*("
(regexp-opt
'(;; Elisp
"defconst" "defcustom" "defvar-keymap"
;; CL
"defconstant"
"defparameter" "define-symbol-macro")
t)
"\\s-+\\(" (rx lisp-mode-symbol) "\\)")
2)
;; For `defvar'/`defvar-local', we ignore (defvar FOO) constructs.
(list (purecopy "Variables")
(purecopy (concat "^\\s-*(defvar\\(?:-local\\)?\\s-+\\("
(rx lisp-mode-symbol) "\\)"
"[[:space:]\n]+[^)]"))
(list "Variables"
(concat "^\\s-*(defvar\\(?:-local\\)?\\s-+\\("
(rx lisp-mode-symbol) "\\)"
"[[:space:]\n]+[^)]")
1)
(list (purecopy "Types")
(purecopy (concat "^\\s-*("
(regexp-opt
'(;; Elisp
"defgroup" "deftheme"
"define-widget" "define-error"
"defface" "cl-deftype" "cl-defstruct"
;; CL
"deftype" "defstruct"
"define-condition" "defpackage"
;; CLOS and EIEIO
"defclass")
t)
"\\s-+'?\\(" (rx lisp-mode-symbol) "\\)"))
(list "Types"
(concat "^\\s-*("
(regexp-opt
'(;; Elisp
"defgroup" "deftheme"
"define-widget" "define-error"
"defface" "cl-deftype" "cl-defstruct"
;; CL
"deftype" "defstruct"
"define-condition" "defpackage"
;; CLOS and EIEIO
"defclass")
t)
"\\s-+'?\\(" (rx lisp-mode-symbol) "\\)")
2))
"Imenu generic expression for Lisp mode. See `imenu-generic-expression'.")

View file

@ -441,7 +441,7 @@ don't include."
(file-name-sans-extension
(file-name-nondirectory file)))))
(push (list (or local-outfile main-outfile) file
`(push (purecopy ',(cons (intern package) version))
`(push ',(cons (intern package) version)
package--builtin-versions))
defs))))

View file

@ -172,7 +172,7 @@ also call that function before the next warning.")
;; safely, testing the existing value, before they call one of the
;; warnings functions.
;;;###autoload
(defvar warning-type-format (purecopy " (%s)")
(defvar warning-type-format " (%s)"
"Format for displaying the warning type in the warning message.
The result of formatting the type this way gets included in the
message under the control of the string in `warning-levels'.")