From 2f990ea257a24dff9340927e10644243042addf0 Mon Sep 17 00:00:00 2001 From: "H. Dieter Wilhelm" <dieter@duenenhof-wilhelm.de> Date: Wed, 1 Oct 2014 20:41:10 -0500 Subject: [PATCH] calc/calc-help.el (calc-describe-thing): Quote strings which could look like regexps. --- lisp/ChangeLog | 5 +++++ lisp/calc/calc-help.el | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1ea03b7630c..d05add5ab6b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-10-02 + + * calc/calc-help.el (calc-describe-thing): Quote strings + which could look like regexps. + 2014-10-01 Stefan Monnier <monnier@iro.umontreal.ca> Consolidate x-select-text. diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el index be04e5a12c0..dfd29230fe5 100644 --- a/lisp/calc/calc-help.el +++ b/lisp/calc/calc-help.el @@ -366,9 +366,9 @@ C-w Describe how there is no warranty for Calc." (Info-goto-node (buffer-substring (match-beginning 1) (match-end 1)))) (or (let ((case-fold-search nil)) (or (re-search-forward (format "\\[`%s'\\]\\|(`%s')\\|\\<The[ \n]`%s'" - (or target thing) - (or target thing) - (or target thing)) nil t) + (or target (regexp-quote thing)) + (or target (regexp-quote thing)) + (or target (regexp-quote thing))) nil t) (and not-quoted (let ((case-fold-search t)) (search-forward (or target thing) nil t))) @@ -376,9 +376,9 @@ C-w Describe how there is no warranty for Calc." (search-forward (or target thing) nil t))) (let ((case-fold-search t)) (or (re-search-forward (format "\\[`%s'\\]\\|(`%s')\\|\\<The[ \n]`%s'" - (or target thing) - (or target thing) - (or target thing)) nil t) + (or target (regexp-quote thing)) + (or target (regexp-quote thing)) + (or target (regexp-quote thing))) nil t) (search-forward (format "`%s'" (or target thing)) nil t) (search-forward (or target thing) nil t)))) (beginning-of-line) -- 2.39.5