diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2022-05-06 13:28:20 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2022-05-06 13:28:20 +0200 |
commit | 16dc1d597b70524782da58677a88135d20c1a617 (patch) | |
tree | e1aece04654b7747514678a9efd7e8719dbdcf84 /lisp/isearch.el | |
parent | 3b088bbed217f4387dfd75df32ec8e92adc9da1d (diff) | |
download | emacs-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.el | 17 |
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 |