summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2022-08-21 16:17:45 +0200
committerMattias EngdegÄrd <mattiase@acm.org>2022-08-21 16:26:59 +0200
commit965fad0d36f7fe9392736c66c8ccd39b83ce6713 (patch)
tree123c03bd183ef3e4aecd680c9e4a539bf1ebc9c5 /lisp/emacs-lisp
parent563ec6abc4f194eb8d89cc2f5adefb7f68017149 (diff)
downloademacs-965fad0d36f7fe9392736c66c8ccd39b83ce6713.tar.gz
emacs-965fad0d36f7fe9392736c66c8ccd39b83ce6713.tar.bz2
emacs-965fad0d36f7fe9392736c66c8ccd39b83ce6713.zip
Update function properties and optimisations
* lisp/emacs-lisp/byte-opt.el (byte-opt--bool-value-form): Recognise boolean identity in aset, put, function-put and puthash. * lisp/emacs-lisp/byte-opt.el (byte-compile-trueconstp): Mark more functins as non-nil-returning, including the new pos-bol and pos-eol. * lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Mark pos-bol and pos-eol as side-effect-free.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/byte-opt.el20
1 files changed, 13 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
index 2467b468a46..27b0d33d3ef 100644
--- a/lisp/emacs-lisp/byte-opt.el
+++ b/lisp/emacs-lisp/byte-opt.el
@@ -728,17 +728,20 @@ for speeding up processing.")
(while (let ((head (car-safe form)))
(cond ((memq head '( progn inline save-excursion save-restriction
save-current-buffer))
- (setq form (car (last form)))
+ (setq form (car (last (cdr form))))
t)
- ((memq head '(let let* setq setcar setcdr))
+ ((memq head '(let let*))
(setq form (car (last (cddr form))))
t)
((memq head '( prog1 unwind-protect copy-sequence identity
reverse nreverse sort))
(setq form (nth 1 form))
t)
- ((eq head 'mapc)
+ ((memq head '(mapc setq setcar setcdr puthash))
(setq form (nth 2 form))
+ t)
+ ((memq head '(aset put function-put))
+ (setq form (nth 3 form))
t))))
form)
@@ -757,17 +760,18 @@ for speeding up processing.")
format format-message
substring substring-no-properties string-replace
replace-regexp-in-string symbol-name make-symbol
- compare-strings
+ compare-strings string-distance
mapconcat
vector make-vector vconcat make-record record
regexp-quote regexp-opt
buffer-string buffer-substring
buffer-substring-no-properties
- current-buffer buffer-size
+ current-buffer buffer-size get-buffer-create
point point-min point-max buffer-end count-lines
- following-char preceding-char max-char
+ following-char preceding-char get-byte max-char
region-beginning region-end
line-beginning-position line-end-position
+ pos-bol pos-eol
+ - * / % 1+ 1- min max abs mod expt logb
logand logior logxor lognot ash logcount
floor ceiling round truncate
@@ -783,11 +787,13 @@ for speeding up processing.")
string-as-multibyte string-as-unibyte
string-to-multibyte string-to-unibyte
string-make-multibyte string-make-unibyte
+ string-width char-width
make-hash-table hash-table-count
unibyte-char-to-multibyte multibyte-char-to-unibyte
sxhash sxhash-equal sxhash-eq sxhash-eql
sxhash-equal-including-properties
make-marker copy-marker point-marker mark-marker
+ kbd key-description
always))
t)
((eq head 'if)
@@ -1586,7 +1592,7 @@ See Info node `(elisp) Integer Basics'."
keymap-parent
lax-plist-get ldexp
length length< length> length=
- line-beginning-position line-end-position
+ 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