From d5bf26f488b7968feed9f43e612a90da2aab15a8 Mon Sep 17 00:00:00 2001 From: Mattias EngdegÄrd Date: Fri, 17 Feb 2023 14:38:50 +0100 Subject: Move side-effect-free and pure declarations to function definitions Some Lisp functions still had their `side-effect-free` and `pure` properties declared in byte-opt.el; do it at their definition instead. The lists in byte-opt.el now only contain functions implemented in C and function aliases. * lisp/emacs-lisp/byte-opt.el (side-effect-free-fns) (side-effect-and-error-free-fns, pure-fns): Remove functions whose properties are now declared elsewhere and some obsolete entries. * lisp/custom.el (custom-variable-p): * lisp/emacs-lisp/lisp.el (buffer-end): * lisp/emacs-lisp/regexp-opt.el (regexp-opt): * lisp/env.el (getenv): * lisp/simple.el (count-lines, mark, string-empty-p, lax-plist-get): * lisp/subr.el (ignore, always, zerop, fixnump, bignump, lsh, last) (eventp, mouse-movement-p, log10, memory-limit, string-greaterp) (interactive-p): * lisp/window.el (get-lru-window, get-largest-window, (window-edges) (window-body-edges, window-pixel-edges, window-body-pixel-edges) (window-absolute-pixel-edges, window-absolute-body-pixel-edges) (one-window-p): Declare functions `side-effect-free` and/or `pure` as appropriate. --- lisp/emacs-lisp/byte-opt.el | 57 +++++++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 33 deletions(-) (limited to 'lisp/emacs-lisp/byte-opt.el') diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index b578b99954c..a9630b6f7c2 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -1647,7 +1647,7 @@ See Info node `(elisp) Integer Basics'." capitalize car-less-than-car car cdr ceiling char-after char-before char-equal char-to-string char-width compare-strings window-configuration-equal-p concat coordinates-in-window-p - copy-alist copy-sequence copy-marker copysign cos count-lines + copy-alist copy-sequence copy-marker copysign cos current-time-string current-time-zone decode-char decode-time default-boundp default-value documentation downcase @@ -1659,26 +1659,24 @@ See Info node `(elisp) Integer Basics'." float float-time floor format format-time-string frame-first-window frame-root-window frame-selected-window frame-visible-p fround ftruncate - get gethash get-buffer get-buffer-window getenv get-file-buffer + get gethash get-buffer get-buffer-window get-file-buffer hash-table-count int-to-string intern-soft isnan keymap-parent - lax-plist-get ldexp + ldexp length length< length> length= line-beginning-position line-end-position pos-bol pos-eol local-variable-if-set-p local-variable-p locale-info - log log10 logand logb logcount logior lognot logxor lsh - make-byte-code make-list make-string make-symbol mark marker-buffer max + log logand logb logcount logior lognot logxor + make-byte-code make-list make-string make-symbol marker-buffer max match-beginning match-end member memq memql min minibuffer-selected-window minibuffer-window mod multibyte-char-to-unibyte next-window nth nthcdr number-to-string - parse-colon-path prefix-numeric-value previous-window prin1-to-string propertize - degrees-to-radians - radians-to-degrees rassq rassoc read-from-string regexp-opt + rassq rassoc read-from-string regexp-quote region-beginning region-end reverse round sin sqrt string string< string= string-equal string-lessp - string> string-greaterp string-empty-p string-blank-p + string> string-search string-to-char string-to-number string-to-syntax substring sxhash sxhash-equal sxhash-eq sxhash-eql @@ -1687,45 +1685,40 @@ See Info node `(elisp) Integer Basics'." string-to-multibyte take tan time-convert truncate unibyte-char-to-multibyte upcase user-full-name - user-login-name user-original-login-name custom-variable-p + user-login-name user-original-login-name vconcat - window-absolute-pixel-edges window-at window-body-height + window-at window-body-height window-body-width window-buffer window-dedicated-p window-display-table - window-combination-limit window-edges window-frame window-fringes + window-combination-limit window-frame window-fringes window-height window-hscroll window-inside-edges window-inside-absolute-pixel-edges window-inside-pixel-edges window-left-child window-left-column window-margins window-minibuffer-p window-next-buffers window-next-sibling window-new-normal window-new-total window-normal-size window-parameter window-parameters - window-parent window-pixel-edges window-point window-prev-buffers + window-parent window-point window-prev-buffers window-prev-sibling window-scroll-bars window-start window-text-height window-top-child window-top-line window-total-height window-total-width window-use-time window-vscroll - window-width zerop)) + window-width)) (side-effect-and-error-free-fns - '(always arrayp atom - bignump bobp bolp bool-vector-p - buffer-end buffer-list buffer-size buffer-string bufferp + '(arrayp atom + bobp bolp bool-vector-p + buffer-list buffer-size buffer-string bufferp car-safe case-table-p cdr-safe char-or-string-p characterp charsetp commandp cons consp current-buffer current-global-map current-indentation current-local-map current-minor-mode-maps current-time - eobp eolp eq equal eventp - fixnump floatp following-char framep - get-largest-window get-lru-window + eobp eolp eq equal + floatp following-char framep hash-table-p - ;; `ignore' isn't here because we don't want calls to it elided; - ;; see `byte-compile-ignore'. - identity integerp integer-or-marker-p interactive-p + identity integerp integer-or-marker-p invocation-directory invocation-name keymapp keywordp list listp make-marker mark-marker markerp max-char - memory-limit - mouse-movement-p natnump nlistp not null number-or-marker-p numberp - one-window-p overlayp - point point-marker point-min point-max preceding-char primary-charset + overlayp + point point-marker point-min point-max preceding-char processp proper-list-p recent-keys recursion-depth safe-length selected-frame selected-window sequencep @@ -1761,7 +1754,7 @@ See Info node `(elisp) Integer Basics'." ;; values if a marker is moved. (let ((pure-fns - '(concat regexp-opt regexp-quote + '(concat regexp-quote string-to-char string-to-syntax symbol-name eq eql = /= < <= >= > min max @@ -1770,8 +1763,7 @@ See Info node `(elisp) Integer Basics'." copysign isnan ldexp float logb floor ceiling round truncate ffloor fceiling fround ftruncate - string= string-equal string< string-lessp string> string-greaterp - string-empty-p string-blank-p + string= string-equal string< string-lessp string> string-search consp atom listp nlistp proper-list-p sequencep arrayp vectorp stringp bool-vector-p hash-table-p @@ -1780,20 +1772,19 @@ See Info node `(elisp) Integer Basics'." integer-or-marker-p number-or-marker-p char-or-string-p symbolp keywordp type-of - identity ignore + identity ;; The following functions are pure up to mutation of their ;; arguments. This is pure enough for the purposes of ;; constant folding, but not necessarily for all kinds of ;; code motion. - car cdr car-safe cdr-safe nth nthcdr last take + car cdr car-safe cdr-safe nth nthcdr take equal length safe-length memq memql member ;; `assoc' and `assoc-default' are excluded since they are ;; impure if the test function is (consider `string-match'). assq rassq rassoc - lax-plist-get aref elt base64-decode-string base64-encode-string base64url-encode-string bool-vector-subsetp -- cgit v1.2.3