]> git.eshelyaron.com Git - emacs.git/commitdiff
Say that side effect-free functions don't change the matchd data
authorPhilipp Stephani <phst@google.com>
Fri, 16 Jun 2017 22:13:51 +0000 (00:13 +0200)
committerPhilipp Stephani <phst@google.com>
Sun, 8 Oct 2017 15:43:54 +0000 (17:43 +0200)
* lisp/help-fns.el (describe-function-1): Add note if a function is
known not to change the match data.

lisp/help-fns.el

index d75fec2b56471dff4150f67f7741a9a60188bb09..788c03e9bf5142b519a52b539e509e11069a4e27 100644 (file)
@@ -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.