\f
* Incompatible changes in Emacs 29.1
+---
+** Isearch in *Help* and *info* now char-folds quote characters by default.
+This means that you can say 'C-s `foo' (GRAVE ACCENT) if the buffer
+contains "‘foo" (LEFT SINGLE QUOTATION MARK) and the like. These
+quotation characters look somewhat similar in some fonts. To switch
+this off, disable the new 'isearch-fold-quotes-mode' minor mode.
+
---
** Sorting commands no longer necessarily change modification status.
In earlier Emacs versions, commands like 'M-x sort-lines' would always
\f
* Lisp Changes in Emacs 29.1
+---
+*** New minor mode 'isearch-fold-quotes-mode'.
+This sets up 'search-default-mode' so that quote characters are
+char-folded into each other. It is used, by default, in *Help* and
+*info* buffers.
+
+++
** New macro 'buffer-local-set-state'.
This is a helper macro to be used by minor modes that wish to restore
help-mode-tool-bar-map)
(setq-local help-mode--current-data nil)
(setq-local bookmark-make-record-function
- #'help-bookmark-make-record))
+ #'help-bookmark-make-record)
+ (isearch-fold-quotes-mode))
;;;###autoload
(defun help-mode-setup ()
(setq-local revert-buffer-function #'Info-revert-buffer-function)
(setq-local font-lock-defaults '(Info-mode-font-lock-keywords t t))
(Info-set-mode-line)
- (setq-local bookmark-make-record-function #'Info-bookmark-make-record))
+ (setq-local bookmark-make-record-function #'Info-bookmark-make-record)
+ (isearch-fold-quotes-mode))
;; When an Info buffer is killed, make sure the associated tags buffer
;; is killed too.
(isearch-search)
(isearch-update))
+\f
+
+(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