emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master f4995e7: Say that side effect-free functions don't


From: Philipp Stephani
Subject: [Emacs-diffs] master f4995e7: Say that side effect-free functions don't change the matchd data
Date: Sun, 8 Oct 2017 11:55:59 -0400 (EDT)

branch: master
commit f4995e7d36b576d9ed629b45dd3b09ba6d28cce7
Author: Philipp Stephani <address@hidden>
Commit: Philipp Stephani <address@hidden>

    Say that side effect-free functions don't change the matchd data
    
    * lisp/help-fns.el (describe-function-1): Add note if a function is
    known not to change the match data.
---
 lisp/help-fns.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index d75fec2..788c03e 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -709,6 +709,10 @@ Returns a list of the form (REAL-FUNCTION DEF ALIASED 
REAL-DEF)."
                   real-function key-bindings-buffer)))
         (run-hook-with-args 'help-fns-describe-function-functions function)
         (insert "\n" (or doc "Not documented.")))
+      (when (or (function-get function 'pure)
+                (function-get function 'side-effect-free))
+        (insert "\nThis function does not change global state, "
+                "including the match data."))
       ;; Avoid asking the user annoying questions if she decides
       ;; to save the help buffer, when her locale's codeset
       ;; isn't UTF-8.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]