From f4995e7d36b576d9ed629b45dd3b09ba6d28cce7 Mon Sep 17 00:00:00 2001 From: Philipp Stephani Date: Sat, 17 Jun 2017 00:13:51 +0200 Subject: [PATCH] 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 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. -- 2.39.5