summaryrefslogtreecommitdiff
path: root/lisp/env.el
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2023-05-26 12:28:15 +0200
committerMattias EngdegÄrd <mattiase@acm.org>2023-05-26 13:57:02 +0200
commitef778f5143f04c6b5c0561ad38c04a08bb2cb701 (patch)
treefdadab66bcfd1b7f6924431ebc73b6cec639e370 /lisp/env.el
parent54ac1165bc3f6012201689b7f23d7edba2926f6d (diff)
downloademacs-ef778f5143f04c6b5c0561ad38c04a08bb2cb701.tar.gz
Add more function declarations
* lisp/subr.el (buffer-narrowed-p, sha1, match-substitute-replacement) (version-to-list, version<, version<=, version=) (function-get, subregexp-context-p, split-string) (combine-and-quote-strings, split-string-and-unquote) (replace-regexp-in-string, syntax-after) (string-trim-left, string-trim): * lisp/emacs-lisp/subr-x.el (hash-table-empty-p, hash-table-keys) (hash-table-values, string-glyph-split) (string-clean-whitespace, string-fill, string-limit) (string-pixel-width): * lisp/env.el (substitute-env-vars, substitute-env-in-file-name) (setenv-internal): * lisp/emacs-lisp/rx.el (rx-to-string): * lisp/emacs-lisp/regexp-opt.el (regexp-opt-depth) (regexp-opt-charset): Add appropriate declarations: pure, side-effect-free, and/or important-return-value.
Diffstat (limited to 'lisp/env.el')
-rw-r--r--lisp/env.el3
1 files changed, 3 insertions, 0 deletions
diff --git a/lisp/env.el b/lisp/env.el
index faafcb6250f..281934af054 100644
--- a/lisp/env.el
+++ b/lisp/env.el
@@ -76,6 +76,7 @@ If it is non-nil and not a function, references to undefined variables are
left unchanged.
Use `$$' to insert a single dollar sign."
+ (declare (important-return-value t))
(let ((start 0))
(while (string-match env--substitute-vars-regexp string start)
(cond ((match-beginning 1)
@@ -94,6 +95,7 @@ Use `$$' to insert a single dollar sign."
string))
(defun substitute-env-in-file-name (filename)
+ (declare (important-return-value t))
(substitute-env-vars filename
;; How 'bout we lookup other tables than the env?
;; E.g. we could accept bookmark names as well!
@@ -104,6 +106,7 @@ Use `$$' to insert a single dollar sign."
(defun setenv-internal (env variable value keep-empty)
"Set VARIABLE to VALUE in ENV, adding empty entries if KEEP-EMPTY.
Changes ENV by side-effect, and returns its new value."
+ (declare (important-return-value t))
(let ((pattern (concat "\\`" (regexp-quote variable) "\\(=\\|\\'\\)"))
(case-fold-search nil)
(scan env)