From 8f76c7b9e26967dad1f12636f0e7c6540c5f9ac4 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 2c635ffa50..54fd834839 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -699,6 +699,9 @@ describe-function-1 (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 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.13.1