summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/byte-opt.el
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2023-12-22 14:53:04 +0100
committerMattias EngdegÄrd <mattiase@acm.org>2023-12-22 14:53:04 +0100
commit61190b5146abfda05d2c756af99867d6b1278f2c (patch)
treeecbd608f70cc33c1b98352d9b98d86d291916a2f /lisp/emacs-lisp/byte-opt.el
parent1ece474c69cfcf6f8ef14d54e469eb387a7a6983 (diff)
downloademacs-61190b5146abfda05d2c756af99867d6b1278f2c.tar.gz
emacs-61190b5146abfda05d2c756af99867d6b1278f2c.tar.bz2
emacs-61190b5146abfda05d2c756af99867d6b1278f2c.zip
* lisp/emacs-lisp/byte-opt.el (byte-compile-nilconstp): Extend list.
Diffstat (limited to 'lisp/emacs-lisp/byte-opt.el')
-rw-r--r--lisp/emacs-lisp/byte-opt.el25
1 files changed, 23 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
index 5a72011c609..a9fe1d06275 100644
--- a/lisp/emacs-lisp/byte-opt.el
+++ b/lisp/emacs-lisp/byte-opt.el
@@ -810,8 +810,29 @@ There can be multiple entries for the same NAME if it has several aliases.")
(or (not form) ; assume (quote nil) always being normalized to nil
(and (consp form)
(let ((head (car form)))
- ;; FIXME: There are many other expressions that are statically nil.
- (cond ((memq head '(while ignore)) t)
+ (cond ((memq head
+ ;; Some forms that are statically nil.
+ ;; FIXME: Replace with a function property?
+ '( while ignore
+ insert insert-and-inherit insert-before-markers
+ insert-before-markers-and-inherit
+ insert-char insert-byte insert-buffer-substring
+ delete-region delete-char
+ widen narrow-to-region transpose-regions
+ forward-char backward-char
+ beginning-of-line end-of-line
+ erase-buffer buffer-swap-text
+ delete-overlay delete-all-overlays
+ remhash
+ maphash
+ map-charset-chars map-char-table
+ mapbacktrace
+ mapatoms
+ ding beep sleep-for
+ json-insert
+ set-match-data
+ ))
+ t)
((eq head 'if)
(and (byte-compile-nilconstp (nth 2 form))
(byte-compile-nilconstp (car (last (cdddr form))))))