summaryrefslogtreecommitdiff
path: root/lisp/isearch.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-05-06 13:28:20 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2022-05-06 13:28:20 +0200
commit16dc1d597b70524782da58677a88135d20c1a617 (patch)
treee1aece04654b7747514678a9efd7e8719dbdcf84 /lisp/isearch.el
parent3b088bbed217f4387dfd75df32ec8e92adc9da1d (diff)
downloademacs-16dc1d597b70524782da58677a88135d20c1a617.tar.gz
Char-fold quotation characters in *info* and *Help*
* lisp/info.el (Info-mode): * lisp/help-mode.el (help-mode): Use it. * lisp/isearch.el (isearch-fold-quotes-mode): New minor mode (bug#24510).
Diffstat (limited to 'lisp/isearch.el')
-rw-r--r--lisp/isearch.el17
1 files changed, 17 insertions, 0 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 8397bb95c6b..b404efd42a1 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -4466,6 +4466,23 @@ CASE-FOLD non-nil means the search was case-insensitive."
(isearch-search)
(isearch-update))
+
+
+(defvar isearch-fold-quotes-mode--state)
+(define-minor-mode isearch-fold-quotes-mode
+ "Minor mode to aid searching for \\=` characters in help modes."
+ :lighter ""
+ (if isearch-fold-quotes-mode
+ (setq-local isearch-fold-quotes-mode--state
+ (buffer-local-set-state
+ search-default-mode
+ (lambda (string &optional _lax)
+ (thread-last
+ (regexp-quote string)
+ (replace-regexp-in-string "`" "[`‘]")
+ (replace-regexp-in-string "'" "['’]")))))
+ (buffer-local-restore-state isearch-fold-quotes-mode--state)))
+
(provide 'isearch)
;;; isearch.el ends here