aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias EngdegÄrd2023-05-30 17:09:45 +0200
committerMattias EngdegÄrd2023-05-30 17:46:06 +0200
commit49c56f333524b2caa34151e44c14ca0dee8d8942 (patch)
tree58dfd77057070fe34e27ac6ec54d0c76bf278668
parent27d68d790f7d600df0918eb9b95b1078fd6185f6 (diff)
downloademacs-49c56f333524b2caa34151e44c14ca0dee8d8942.tar.gz
emacs-49c56f333524b2caa34151e44c14ca0dee8d8942.zip
Add function declarations
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Add get-byte, string-width, unibyte-string, special-variable-p, frexp, buffer-hash, buffer-line-statistics, load-average, md5, secure-hash, string-collate-equalp, string-collate-lessp, string-to-unibyte, string-version-lessp, current-cpu-time. (side-effect-and-error-free-fns): Add equal-including-properties. (pure-fns): Add equal-including-properties, string-version-lessp. * lisp/emacs-lisp/bytecomp.el (important-return-value-fns): Add match-data. * lisp/subr.el (buffer-local-boundp, subr-primitive-p, gensym) (frame-configuration-p, apply-partially, make-composed-keymap) (keymap-canonicalize, listify-key-sequence, event-modifiers) (event-basic-type, mouse-event-p, event-start, event-end) (event-click-count, event-line-count, posnp, posn-window, posn-area) (posn-point, posn-x-y, posn-col-row, posn-actual-col-row) (posn-timestamp, posn-string, posn-image, posn-object) (posn-object-x-y, posn-object-width-height, provided-mode-derived-p) (derived-mode-p, autoloadp, locate-eln-file, symbol-file) (process-lines-handling-status, process-lines) (process-lines-ignore-status, process-get) (copy-overlay, shell-quote-argument, field-at-pos): Add appropriate function declarations.
-rw-r--r--lisp/emacs-lisp/byte-opt.el29
-rw-r--r--lisp/emacs-lisp/bytecomp.el2
-rw-r--r--lisp/subr.el40
3 files changed, 62 insertions, 9 deletions
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
index 8fe5066c49e..562f21aa751 100644
--- a/lisp/emacs-lisp/byte-opt.el
+++ b/lisp/emacs-lisp/byte-opt.el
@@ -1685,7 +1685,8 @@ See Info node `(elisp) Integer Basics'."
1685 category-docstring category-set-mnemonics char-category-set 1685 category-docstring category-set-mnemonics char-category-set
1686 copy-category-table get-unused-category make-category-set 1686 copy-category-table get-unused-category make-category-set
1687 ;; character.c 1687 ;; character.c
1688 char-width multibyte-char-to-unibyte string unibyte-char-to-multibyte 1688 char-width get-byte multibyte-char-to-unibyte string string-width
1689 unibyte-char-to-multibyte unibyte-string
1689 ;; charset.c 1690 ;; charset.c
1690 decode-char encode-char 1691 decode-char encode-char
1691 ;; chartab.c 1692 ;; chartab.c
@@ -1715,6 +1716,8 @@ See Info node `(elisp) Integer Basics'."
1715 line-beginning-position line-end-position ngettext pos-bol pos-eol 1716 line-beginning-position line-end-position ngettext pos-bol pos-eol
1716 propertize region-beginning region-end string-to-char 1717 propertize region-beginning region-end string-to-char
1717 user-full-name user-login-name 1718 user-full-name user-login-name
1719 ;; eval.c
1720 special-variable-p
1718 ;; fileio.c 1721 ;; fileio.c
1719 car-less-than-car directory-name-p file-directory-p file-exists-p 1722 car-less-than-car directory-name-p file-directory-p file-exists-p
1720 file-name-absolute-p file-name-concat file-newer-than-file-p 1723 file-name-absolute-p file-name-concat file-newer-than-file-p
@@ -1723,23 +1726,28 @@ See Info node `(elisp) Integer Basics'."
1723 file-locked-p 1726 file-locked-p
1724 ;; floatfns.c 1727 ;; floatfns.c
1725 abs acos asin atan ceiling copysign cos exp expt fceiling ffloor 1728 abs acos asin atan ceiling copysign cos exp expt fceiling ffloor
1726 float floor fround ftruncate isnan ldexp log logb round sin sqrt tan 1729 float floor frexp fround ftruncate isnan ldexp log logb round
1730 sin sqrt tan
1727 truncate 1731 truncate
1728 ;; fns.c 1732 ;; fns.c
1729 append assq 1733 append assq
1730 base64-decode-string base64-encode-string base64url-encode-string 1734 base64-decode-string base64-encode-string base64url-encode-string
1735 buffer-hash buffer-line-statistics
1731 compare-strings concat copy-alist copy-hash-table copy-sequence elt 1736 compare-strings concat copy-alist copy-hash-table copy-sequence elt
1732 featurep get 1737 featurep get
1733 gethash hash-table-count hash-table-rehash-size 1738 gethash hash-table-count hash-table-rehash-size
1734 hash-table-rehash-threshold hash-table-size hash-table-test 1739 hash-table-rehash-threshold hash-table-size hash-table-test
1735 hash-table-weakness 1740 hash-table-weakness
1736 length length< length= length> 1741 length length< length= length>
1737 line-number-at-pos locale-info make-hash-table 1742 line-number-at-pos load-average locale-info make-hash-table md5
1738 member memq memql nth nthcdr 1743 member memq memql nth nthcdr
1739 object-intervals rassoc rassq reverse 1744 object-intervals rassoc rassq reverse secure-hash
1740 string-as-multibyte string-as-unibyte string-bytes string-distance 1745 string-as-multibyte string-as-unibyte string-bytes
1746 string-collate-equalp string-collate-lessp string-distance
1741 string-equal string-lessp string-make-multibyte string-make-unibyte 1747 string-equal string-lessp string-make-multibyte string-make-unibyte
1742 string-search string-to-multibyte substring substring-no-properties 1748 string-search string-to-multibyte string-to-unibyte
1749 string-version-lessp
1750 substring substring-no-properties
1743 sxhash-eq sxhash-eql sxhash-equal sxhash-equal-including-properties 1751 sxhash-eq sxhash-eql sxhash-equal sxhash-equal-including-properties
1744 take vconcat 1752 take vconcat
1745 ;; frame.c 1753 ;; frame.c
@@ -1799,6 +1807,7 @@ See Info node `(elisp) Integer Basics'."
1799 all-threads condition-mutex condition-name mutex-name thread-live-p 1807 all-threads condition-mutex condition-name mutex-name thread-live-p
1800 thread-name 1808 thread-name
1801 ;; timefns.c 1809 ;; timefns.c
1810 current-cpu-time
1802 current-time-string current-time-zone decode-time encode-time 1811 current-time-string current-time-zone decode-time encode-time
1803 float-time format-time-string time-add time-convert time-equal-p 1812 float-time format-time-string time-add time-convert time-equal-p
1804 time-less-p time-subtract 1813 time-less-p time-subtract
@@ -1858,7 +1867,8 @@ See Info node `(elisp) Integer Basics'."
1858 ;; fileio.c 1867 ;; fileio.c
1859 default-file-modes 1868 default-file-modes
1860 ;; fns.c 1869 ;; fns.c
1861 eql equal hash-table-p identity proper-list-p safe-length 1870 eql equal equal-including-properties
1871 hash-table-p identity proper-list-p safe-length
1862 secure-hash-algorithms 1872 secure-hash-algorithms
1863 ;; frame.c 1873 ;; frame.c
1864 frame-list frame-live-p framep last-nonminibuffer-frame 1874 frame-list frame-live-p framep last-nonminibuffer-frame
@@ -1936,10 +1946,11 @@ See Info node `(elisp) Integer Basics'."
1936 isnan ldexp logb round sqrt truncate 1946 isnan ldexp logb round sqrt truncate
1937 ;; fns.c 1947 ;; fns.c
1938 assq base64-decode-string base64-encode-string base64url-encode-string 1948 assq base64-decode-string base64-encode-string base64url-encode-string
1939 concat elt eql equal hash-table-p identity length length< length= 1949 concat elt eql equal equal-including-properties
1950 hash-table-p identity length length< length=
1940 length> member memq memql nth nthcdr proper-list-p rassoc rassq 1951 length> member memq memql nth nthcdr proper-list-p rassoc rassq
1941 safe-length string-bytes string-distance string-equal string-lessp 1952 safe-length string-bytes string-distance string-equal string-lessp
1942 string-search take 1953 string-search string-version-lessp take
1943 ;; search.c 1954 ;; search.c
1944 regexp-quote 1955 regexp-quote
1945 ;; syntax.c 1956 ;; syntax.c
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index aea50fc8e57..b7ae45a0610 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -3566,6 +3566,8 @@ lambda-expression."
3566 ;; when used on arrays, but most calls pass lists. 3566 ;; when used on arrays, but most calls pass lists.
3567 nreverse sort 3567 nreverse sort
3568 3568
3569 match-data
3570
3569 ;; Adding these functions causes many warnings; 3571 ;; Adding these functions causes many warnings;
3570 ;; evaluate how many of them are false first. 3572 ;; evaluate how many of them are false first.
3571 delq delete 3573 delq delete
diff --git a/lisp/subr.el b/lisp/subr.el
index 95d3bc03544..cef631a69c3 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -205,6 +205,7 @@ buffer-local wherever it is set."
205(defun buffer-local-boundp (symbol buffer) 205(defun buffer-local-boundp (symbol buffer)
206 "Return non-nil if SYMBOL is bound in BUFFER. 206 "Return non-nil if SYMBOL is bound in BUFFER.
207Also see `local-variable-p'." 207Also see `local-variable-p'."
208 (declare (side-effect-free t))
208 (condition-case nil 209 (condition-case nil
209 (buffer-local-value symbol buffer) 210 (buffer-local-value symbol buffer)
210 (:success t) 211 (:success t)
@@ -298,6 +299,7 @@ value of last one, or nil if there are none."
298 299
299(defsubst subr-primitive-p (object) 300(defsubst subr-primitive-p (object)
300 "Return t if OBJECT is a built-in primitive function." 301 "Return t if OBJECT is a built-in primitive function."
302 (declare (side-effect-free error-free))
301 (and (subrp object) 303 (and (subrp object)
302 (not (subr-native-elisp-p object)))) 304 (not (subr-native-elisp-p object))))
303 305
@@ -415,6 +417,7 @@ The CONDITION argument is not evaluated. Do not quote it."
415 "Return a new uninterned symbol. 417 "Return a new uninterned symbol.
416The name is made by appending `gensym-counter' to PREFIX. 418The name is made by appending `gensym-counter' to PREFIX.
417PREFIX is a string, and defaults to \"g\"." 419PREFIX is a string, and defaults to \"g\"."
420 (declare (important-return-value t))
418 (let ((num (prog1 gensym-counter 421 (let ((num (prog1 gensym-counter
419 (setq gensym-counter (1+ gensym-counter))))) 422 (setq gensym-counter (1+ gensym-counter)))))
420 (make-symbol (format "%s%d" (or prefix "g") num)))) 423 (make-symbol (format "%s%d" (or prefix "g") num))))
@@ -497,6 +500,7 @@ Defaults to `error'."
497 "Return non-nil if OBJECT seems to be a frame configuration. 500 "Return non-nil if OBJECT seems to be a frame configuration.
498Any list whose car is `frame-configuration' is assumed to be a frame 501Any list whose car is `frame-configuration' is assumed to be a frame
499configuration." 502configuration."
503 (declare (pure t) (side-effect-free error-free))
500 (and (consp object) 504 (and (consp object)
501 (eq (car object) 'frame-configuration))) 505 (eq (car object) 'frame-configuration)))
502 506
@@ -506,6 +510,7 @@ ARGS is a list of the first N arguments to pass to FUN.
506The result is a new function which does the same as FUN, except that 510The result is a new function which does the same as FUN, except that
507the first N arguments are fixed at the values with which this function 511the first N arguments are fixed at the values with which this function
508was called." 512was called."
513 (declare (side-effect-free error-free))
509 (lambda (&rest args2) 514 (lambda (&rest args2)
510 (apply fun (append args args2)))) 515 (apply fun (append args args2))))
511 516
@@ -1076,6 +1081,7 @@ any corresponding binding in PARENT, but it does not override corresponding
1076bindings in other keymaps of MAPS. 1081bindings in other keymaps of MAPS.
1077MAPS can be a list of keymaps or a single keymap. 1082MAPS can be a list of keymaps or a single keymap.
1078PARENT if non-nil should be a keymap." 1083PARENT if non-nil should be a keymap."
1084 (declare (side-effect-free t))
1079 `(keymap 1085 `(keymap
1080 ,@(if (keymapp maps) (list maps) maps) 1086 ,@(if (keymapp maps) (list maps) maps)
1081 ,@parent)) 1087 ,@parent))
@@ -1216,6 +1222,7 @@ This resolves inheritance and redefinitions. The returned keymap
1216should behave identically to a copy of KEYMAP w.r.t `lookup-key' 1222should behave identically to a copy of KEYMAP w.r.t `lookup-key'
1217and use in active keymaps and menus. 1223and use in active keymaps and menus.
1218Subkeymaps may be modified but are not canonicalized." 1224Subkeymaps may be modified but are not canonicalized."
1225 (declare (important-return-value t))
1219 ;; FIXME: Problem with the difference between a nil binding 1226 ;; FIXME: Problem with the difference between a nil binding
1220 ;; that hides a binding in an inherited map and a nil binding that's ignored 1227 ;; that hides a binding in an inherited map and a nil binding that's ignored
1221 ;; to let some further binding visible. Currently a nil binding hides all. 1228 ;; to let some further binding visible. Currently a nil binding hides all.
@@ -1538,6 +1545,7 @@ See also `current-global-map'.")
1538 1545
1539(defun listify-key-sequence (key) 1546(defun listify-key-sequence (key)
1540 "Convert a key sequence to a list of events." 1547 "Convert a key sequence to a list of events."
1548 (declare (side-effect-free t))
1541 (if (vectorp key) 1549 (if (vectorp key)
1542 (append key nil) 1550 (append key nil)
1543 (mapcar (lambda (c) 1551 (mapcar (lambda (c)
@@ -1565,6 +1573,7 @@ EVENT may be an event or an event type. If EVENT is a symbol
1565that has never been used in an event that has been read as input 1573that has never been used in an event that has been read as input
1566in the current Emacs session, then this function may fail to include 1574in the current Emacs session, then this function may fail to include
1567the `click' modifier." 1575the `click' modifier."
1576 (declare (side-effect-free t))
1568 (unless (stringp event) 1577 (unless (stringp event)
1569 (let ((type event)) 1578 (let ((type event))
1570 (if (listp type) 1579 (if (listp type)
@@ -1598,6 +1607,7 @@ The value is a printing character (not upper case) or a symbol.
1598EVENT may be an event or an event type. If EVENT is a symbol 1607EVENT may be an event or an event type. If EVENT is a symbol
1599that has never been used in an event that has been read as input 1608that has never been used in an event that has been read as input
1600in the current Emacs session, then this function may return nil." 1609in the current Emacs session, then this function may return nil."
1610 (declare (side-effect-free t))
1601 (unless (stringp event) 1611 (unless (stringp event)
1602 (if (consp event) 1612 (if (consp event)
1603 (setq event (car event))) 1613 (setq event (car event)))
@@ -1618,6 +1628,7 @@ in the current Emacs session, then this function may return nil."
1618 1628
1619(defun mouse-event-p (object) 1629(defun mouse-event-p (object)
1620 "Return non-nil if OBJECT is a mouse click event." 1630 "Return non-nil if OBJECT is a mouse click event."
1631 (declare (side-effect-free t))
1621 ;; is this really correct? maybe remove mouse-movement? 1632 ;; is this really correct? maybe remove mouse-movement?
1622 (memq (event-basic-type object) '(mouse-1 mouse-2 mouse-3 mouse-movement))) 1633 (memq (event-basic-type object) '(mouse-1 mouse-2 mouse-3 mouse-movement)))
1623 1634
@@ -1663,6 +1674,7 @@ nil or (STRING . POSITION)'.
1663`posn-timestamp': The time the event occurred, in milliseconds. 1674`posn-timestamp': The time the event occurred, in milliseconds.
1664 1675
1665For more information, see Info node `(elisp)Click Events'." 1676For more information, see Info node `(elisp)Click Events'."
1677 (declare (side-effect-free t))
1666 (or (and (consp event) (nth 1 event)) 1678 (or (and (consp event) (nth 1 event))
1667 (event--posn-at-point))) 1679 (event--posn-at-point)))
1668 1680
@@ -1671,17 +1683,20 @@ For more information, see Info node `(elisp)Click Events'."
1671EVENT should be a click, drag, or key press event. 1683EVENT should be a click, drag, or key press event.
1672 1684
1673See `event-start' for a description of the value returned." 1685See `event-start' for a description of the value returned."
1686 (declare (side-effect-free t))
1674 (or (and (consp event) (nth (if (consp (nth 2 event)) 2 1) event)) 1687 (or (and (consp event) (nth (if (consp (nth 2 event)) 2 1) event))
1675 (event--posn-at-point))) 1688 (event--posn-at-point)))
1676 1689
1677(defsubst event-click-count (event) 1690(defsubst event-click-count (event)
1678 "Return the multi-click count of EVENT, a click or drag event. 1691 "Return the multi-click count of EVENT, a click or drag event.
1679The return value is a positive integer." 1692The return value is a positive integer."
1693 (declare (side-effect-free t))
1680 (if (and (consp event) (integerp (nth 2 event))) (nth 2 event) 1)) 1694 (if (and (consp event) (integerp (nth 2 event))) (nth 2 event) 1))
1681 1695
1682(defsubst event-line-count (event) 1696(defsubst event-line-count (event)
1683 "Return the line count of EVENT, a mousewheel event. 1697 "Return the line count of EVENT, a mousewheel event.
1684The return value is a positive integer." 1698The return value is a positive integer."
1699 (declare (side-effect-free t))
1685 (if (and (consp event) (integerp (nth 3 event))) (nth 3 event) 1)) 1700 (if (and (consp event) (integerp (nth 3 event))) (nth 3 event) 1))
1686 1701
1687;;;; Extracting fields of the positions in an event. 1702;;;; Extracting fields of the positions in an event.
@@ -1691,6 +1706,7 @@ The return value is a positive integer."
1691A `posn' object is returned from functions such as `event-start'. 1706A `posn' object is returned from functions such as `event-start'.
1692If OBJ is a valid `posn' object, but specifies a frame rather 1707If OBJ is a valid `posn' object, but specifies a frame rather
1693than a window, return nil." 1708than a window, return nil."
1709 (declare (side-effect-free error-free))
1694 ;; FIXME: Correct the behavior of this function so that all valid 1710 ;; FIXME: Correct the behavior of this function so that all valid
1695 ;; `posn' objects are recognized, after updating other code that 1711 ;; `posn' objects are recognized, after updating other code that
1696 ;; depends on its present behavior. 1712 ;; depends on its present behavior.
@@ -1704,12 +1720,14 @@ than a window, return nil."
1704If POSITION is outside the frame where the event was initiated, 1720If POSITION is outside the frame where the event was initiated,
1705return that frame instead. POSITION should be a list of the form 1721return that frame instead. POSITION should be a list of the form
1706returned by the `event-start' and `event-end' functions." 1722returned by the `event-start' and `event-end' functions."
1723 (declare (side-effect-free t))
1707 (nth 0 position)) 1724 (nth 0 position))
1708 1725
1709(defsubst posn-area (position) 1726(defsubst posn-area (position)
1710 "Return the window area recorded in POSITION, or nil for the text area. 1727 "Return the window area recorded in POSITION, or nil for the text area.
1711POSITION should be a list of the form returned by the `event-start' 1728POSITION should be a list of the form returned by the `event-start'
1712and `event-end' functions." 1729and `event-end' functions."
1730 (declare (side-effect-free t))
1713 (let ((area (if (consp (nth 1 position)) 1731 (let ((area (if (consp (nth 1 position))
1714 (car (nth 1 position)) 1732 (car (nth 1 position))
1715 (nth 1 position)))) 1733 (nth 1 position))))
@@ -1721,6 +1739,7 @@ POSITION should be a list of the form returned by the `event-start'
1721and `event-end' functions. 1739and `event-end' functions.
1722Returns nil if POSITION does not correspond to any buffer location (e.g. 1740Returns nil if POSITION does not correspond to any buffer location (e.g.
1723a click on a scroll bar)." 1741a click on a scroll bar)."
1742 (declare (side-effect-free t))
1724 (or (nth 5 position) 1743 (or (nth 5 position)
1725 (let ((pt (nth 1 position))) 1744 (let ((pt (nth 1 position)))
1726 (or (car-safe pt) 1745 (or (car-safe pt)
@@ -1746,6 +1765,7 @@ Select the corresponding window as well."
1746The return value has the form (X . Y), where X and Y are given in 1765The return value has the form (X . Y), where X and Y are given in
1747pixels. POSITION should be a list of the form returned by 1766pixels. POSITION should be a list of the form returned by
1748`event-start' and `event-end'." 1767`event-start' and `event-end'."
1768 (declare (side-effect-free t))
1749 (nth 2 position)) 1769 (nth 2 position))
1750 1770
1751(declare-function scroll-bar-scale "scroll-bar" (num-denom whole)) 1771(declare-function scroll-bar-scale "scroll-bar" (num-denom whole))
@@ -1765,6 +1785,7 @@ corresponds to the vertical position of the click in the scroll bar.
1765 1785
1766POSITION should be a list of the form returned by the `event-start' 1786POSITION should be a list of the form returned by the `event-start'
1767and `event-end' functions." 1787and `event-end' functions."
1788 (declare (side-effect-free t))
1768 (let* ((pair (posn-x-y position)) 1789 (let* ((pair (posn-x-y position))
1769 (frame-or-window (posn-window position)) 1790 (frame-or-window (posn-window position))
1770 (frame (if (framep frame-or-window) 1791 (frame (if (framep frame-or-window)
@@ -1810,12 +1831,14 @@ This function does not account for the width on display, like the
1810number of visual columns taken by a TAB or image. If you need 1831number of visual columns taken by a TAB or image. If you need
1811the coordinates of POSITION in character units, you should use 1832the coordinates of POSITION in character units, you should use
1812`posn-col-row', not this function." 1833`posn-col-row', not this function."
1834 (declare (side-effect-free t))
1813 (nth 6 position)) 1835 (nth 6 position))
1814 1836
1815(defsubst posn-timestamp (position) 1837(defsubst posn-timestamp (position)
1816 "Return the timestamp of POSITION. 1838 "Return the timestamp of POSITION.
1817POSITION should be a list of the form returned by the `event-start' 1839POSITION should be a list of the form returned by the `event-start'
1818and `event-end' functions." 1840and `event-end' functions."
1841 (declare (side-effect-free t))
1819 (nth 3 position)) 1842 (nth 3 position))
1820 1843
1821(defun posn-string (position) 1844(defun posn-string (position)
@@ -1823,6 +1846,7 @@ and `event-end' functions."
1823Value is a cons (STRING . STRING-POS), or nil if not a string. 1846Value is a cons (STRING . STRING-POS), or nil if not a string.
1824POSITION should be a list of the form returned by the `event-start' 1847POSITION should be a list of the form returned by the `event-start'
1825and `event-end' functions." 1848and `event-end' functions."
1849 (declare (side-effect-free t))
1826 (let ((x (nth 4 position))) 1850 (let ((x (nth 4 position)))
1827 ;; Apparently this can also be `handle' or `below-handle' (bug#13979). 1851 ;; Apparently this can also be `handle' or `below-handle' (bug#13979).
1828 (when (consp x) x))) 1852 (when (consp x) x)))
@@ -1832,6 +1856,7 @@ and `event-end' functions."
1832Value is a list (image ...), or nil if not an image. 1856Value is a list (image ...), or nil if not an image.
1833POSITION should be a list of the form returned by the `event-start' 1857POSITION should be a list of the form returned by the `event-start'
1834and `event-end' functions." 1858and `event-end' functions."
1859 (declare (side-effect-free t))
1835 (nth 7 position)) 1860 (nth 7 position))
1836 1861
1837(defsubst posn-object (position) 1862(defsubst posn-object (position)
@@ -1840,6 +1865,7 @@ Value is a list (image ...) for an image object, a cons cell
1840\(STRING . STRING-POS) for a string object, and nil for a buffer position. 1865\(STRING . STRING-POS) for a string object, and nil for a buffer position.
1841POSITION should be a list of the form returned by the `event-start' 1866POSITION should be a list of the form returned by the `event-start'
1842and `event-end' functions." 1867and `event-end' functions."
1868 (declare (side-effect-free t))
1843 (or (posn-image position) (posn-string position))) 1869 (or (posn-image position) (posn-string position)))
1844 1870
1845(defsubst posn-object-x-y (position) 1871(defsubst posn-object-x-y (position)
@@ -1848,12 +1874,14 @@ The return value has the form (DX . DY), where DX and DY are
1848given in pixels, and they are relative to the top-left corner of 1874given in pixels, and they are relative to the top-left corner of
1849the clicked glyph of object at POSITION. POSITION should be a 1875the clicked glyph of object at POSITION. POSITION should be a
1850list of the form returned by `event-start' and `event-end'." 1876list of the form returned by `event-start' and `event-end'."
1877 (declare (side-effect-free t))
1851 (nth 8 position)) 1878 (nth 8 position))
1852 1879
1853(defsubst posn-object-width-height (position) 1880(defsubst posn-object-width-height (position)
1854 "Return the pixel width and height of the object of POSITION. 1881 "Return the pixel width and height of the object of POSITION.
1855The return value has the form (WIDTH . HEIGHT). POSITION should 1882The return value has the form (WIDTH . HEIGHT). POSITION should
1856be a list of the form returned by `event-start' and `event-end'." 1883be a list of the form returned by `event-start' and `event-end'."
1884 (declare (side-effect-free t))
1857 (nth 9 position)) 1885 (nth 9 position))
1858 1886
1859(defun values--store-value (value) 1887(defun values--store-value (value)
@@ -2614,6 +2642,7 @@ The variable list SPEC is the same as in `if-let*'."
2614Uses the `derived-mode-parent' property of the symbol to trace backwards. 2642Uses the `derived-mode-parent' property of the symbol to trace backwards.
2615If you just want to check `major-mode', use `derived-mode-p'." 2643If you just want to check `major-mode', use `derived-mode-p'."
2616 ;; If MODE is an alias, then look up the real mode function first. 2644 ;; If MODE is an alias, then look up the real mode function first.
2645 (declare (side-effect-free t))
2617 (when-let ((alias (symbol-function mode))) 2646 (when-let ((alias (symbol-function mode)))
2618 (when (symbolp alias) 2647 (when (symbolp alias)
2619 (setq mode alias))) 2648 (setq mode alias)))
@@ -2628,6 +2657,7 @@ If you just want to check `major-mode', use `derived-mode-p'."
2628(defun derived-mode-p (&rest modes) 2657(defun derived-mode-p (&rest modes)
2629 "Non-nil if the current major mode is derived from one of MODES. 2658 "Non-nil if the current major mode is derived from one of MODES.
2630Uses the `derived-mode-parent' property of the symbol to trace backwards." 2659Uses the `derived-mode-parent' property of the symbol to trace backwards."
2660 (declare (side-effect-free t))
2631 (apply #'provided-mode-derived-p major-mode modes)) 2661 (apply #'provided-mode-derived-p major-mode modes))
2632 2662
2633(defvar-local major-mode--suspended nil) 2663(defvar-local major-mode--suspended nil)
@@ -2751,6 +2781,7 @@ If TOGGLE has a `:menu-tag', that is used for the menu item's label."
2751 2781
2752(defsubst autoloadp (object) 2782(defsubst autoloadp (object)
2753 "Non-nil if OBJECT is an autoload." 2783 "Non-nil if OBJECT is an autoload."
2784 (declare (side-effect-free error-free))
2754 (eq 'autoload (car-safe object))) 2785 (eq 'autoload (car-safe object)))
2755 2786
2756;; (defun autoload-type (object) 2787;; (defun autoload-type (object)
@@ -2795,6 +2826,7 @@ This is to `put' what `defalias' is to `fset'."
2795(defun locate-eln-file (eln-file) 2826(defun locate-eln-file (eln-file)
2796 "Locate a natively-compiled ELN-FILE by searching its load path. 2827 "Locate a natively-compiled ELN-FILE by searching its load path.
2797This function looks in directories named by `native-comp-eln-load-path'." 2828This function looks in directories named by `native-comp-eln-load-path'."
2829 (declare (important-return-value t))
2798 (or (locate-file-internal (concat comp-native-version-dir "/" eln-file) 2830 (or (locate-file-internal (concat comp-native-version-dir "/" eln-file)
2799 native-comp-eln-load-path) 2831 native-comp-eln-load-path)
2800 (locate-file-internal 2832 (locate-file-internal
@@ -2826,6 +2858,7 @@ instead.
2826This function only works for symbols defined in Lisp files. For 2858This function only works for symbols defined in Lisp files. For
2827symbols that are defined in C files, use `help-C-file-name' 2859symbols that are defined in C files, use `help-C-file-name'
2828instead." 2860instead."
2861 (declare (important-return-value t))
2829 (if (and (or (null type) (eq type 'defun)) 2862 (if (and (or (null type) (eq type 'defun))
2830 (symbolp symbol) 2863 (symbolp symbol)
2831 (autoloadp (symbol-function symbol))) 2864 (autoloadp (symbol-function symbol)))
@@ -2952,6 +2985,7 @@ argument, which will be called with the exit status of the
2952program before the output is collected. If STATUS-HANDLER is 2985program before the output is collected. If STATUS-HANDLER is
2953nil, an error is signaled if the program returns with a non-zero 2986nil, an error is signaled if the program returns with a non-zero
2954exit status." 2987exit status."
2988 (declare (important-return-value t))
2955 (with-temp-buffer 2989 (with-temp-buffer
2956 (let ((status (apply #'call-process program nil (current-buffer) nil args))) 2990 (let ((status (apply #'call-process program nil (current-buffer) nil args)))
2957 (if status-handler 2991 (if status-handler
@@ -2972,12 +3006,14 @@ exit status."
2972 "Execute PROGRAM with ARGS, returning its output as a list of lines. 3006 "Execute PROGRAM with ARGS, returning its output as a list of lines.
2973Signal an error if the program returns with a non-zero exit status. 3007Signal an error if the program returns with a non-zero exit status.
2974Also see `process-lines-ignore-status'." 3008Also see `process-lines-ignore-status'."
3009 (declare (important-return-value t))
2975 (apply #'process-lines-handling-status program nil args)) 3010 (apply #'process-lines-handling-status program nil args))
2976 3011
2977(defun process-lines-ignore-status (program &rest args) 3012(defun process-lines-ignore-status (program &rest args)
2978 "Execute PROGRAM with ARGS, returning its output as a list of lines. 3013 "Execute PROGRAM with ARGS, returning its output as a list of lines.
2979The exit status of the program is ignored. 3014The exit status of the program is ignored.
2980Also see `process-lines'." 3015Also see `process-lines'."
3016 (declare (important-return-value t))
2981 (apply #'process-lines-handling-status program #'ignore args)) 3017 (apply #'process-lines-handling-status program #'ignore args))
2982 3018
2983(defun process-live-p (process) 3019(defun process-live-p (process)
@@ -3006,6 +3042,7 @@ process."
3006(defun process-get (process propname) 3042(defun process-get (process propname)
3007 "Return the value of PROCESS' PROPNAME property. 3043 "Return the value of PROCESS' PROPNAME property.
3008This is the last value stored with `(process-put PROCESS PROPNAME VALUE)'." 3044This is the last value stored with `(process-put PROCESS PROPNAME VALUE)'."
3045 (declare (side-effect-free t))
3009 (plist-get (process-plist process) propname)) 3046 (plist-get (process-plist process) propname))
3010 3047
3011(defun process-put (process propname value) 3048(defun process-put (process propname value)
@@ -3924,6 +3961,7 @@ If MESSAGE is nil, instructions to type EXIT-CHAR are displayed there."
3924 3961
3925(defun copy-overlay (o) 3962(defun copy-overlay (o)
3926 "Return a copy of overlay O." 3963 "Return a copy of overlay O."
3964 (declare (important-return-value t))
3927 (let ((o1 (if (overlay-buffer o) 3965 (let ((o1 (if (overlay-buffer o)
3928 (make-overlay (overlay-start o) (overlay-end o) 3966 (make-overlay (overlay-start o) (overlay-end o)
3929 ;; FIXME: there's no easy way to find the 3967 ;; FIXME: there's no easy way to find the
@@ -4133,6 +4171,7 @@ See Info node `(elisp)Security Considerations'.
4133If the optional POSIX argument is non-nil, ARGUMENT is quoted 4171If the optional POSIX argument is non-nil, ARGUMENT is quoted
4134according to POSIX shell quoting rules, regardless of the 4172according to POSIX shell quoting rules, regardless of the
4135system's shell." 4173system's shell."
4174 (declare (important-return-value t))
4136 (cond 4175 (cond
4137 ((and (not posix) (eq system-type 'ms-dos)) 4176 ((and (not posix) (eq system-type 'ms-dos))
4138 ;; Quote using double quotes, but escape any existing quotes in 4177 ;; Quote using double quotes, but escape any existing quotes in
@@ -4250,6 +4289,7 @@ or byte-code."
4250 4289
4251(defun field-at-pos (pos) 4290(defun field-at-pos (pos)
4252 "Return the field at position POS, taking stickiness etc into account." 4291 "Return the field at position POS, taking stickiness etc into account."
4292 (declare (important-return-value t))
4253 (let ((raw-field (get-char-property (field-beginning pos) 'field))) 4293 (let ((raw-field (get-char-property (field-beginning pos) 'field)))
4254 (if (eq raw-field 'boundary) 4294 (if (eq raw-field 'boundary)
4255 (get-char-property (1- (field-end pos)) 'field) 4295 (get-char-property (1- (field-end pos)) 'field)