From: Philipp Stephani Date: Fri, 16 Jun 2017 22:13:51 +0000 (+0200) Subject: Say that side effect-free functions don't change the matchd data X-Git-Tag: emacs-27.0.90~6262 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f4995e7d36b576d9ed629b45dd3b09ba6d28cce7;p=emacs.git 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. --- diff --git a/lisp/help-fns.el b/lisp/help-fns.el index d75fec2b564..788c03e9bf5 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.