summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-01-27 14:08:01 -0200
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-01-27 14:08:01 -0200
commit1e60125ff323e1a750d289def147061c280326bd (patch)
tree7335e90a58166fc47530db498314d96e62f4898b /lisp
parent98715c6c242618e18fa11535b2a36e7cf1b461b1 (diff)
downloademacs-1e60125ff323e1a750d289def147061c280326bd.tar.gz
(isearch-fold-groups isearch-groups-alist): New variables.
When `isearch-fold-groups' is non-nil `isearch-groups-alist' determines which characters are replaced with regexps during isearch.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/isearch.el17
1 files changed, 17 insertions, 0 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 99ca73f9f54..86850dbd6cc 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -272,6 +272,23 @@ Default value, nil, means edit the string instead."
:version "23.1"
:group 'isearch)
+(defcustom isearch-fold-groups t
+ "Whether regular isearch should do group folding.
+This means some characters will match entire groups of charactes,
+such as \" matching ”, for instance."
+ :type 'boolean
+ :group 'isearch
+ :version "25.1")
+
+(defvar isearch-groups-alist
+ ;; FIXME: Add all the latin accented letters like Ã.
+ '((?\" . "[\""“””„⹂〞‟‟❞❝❠“„〝〟🙷🙶🙸❮❯«»‹›󠀢]")
+ (?' . "[`'❟❛❜‘’’‚‛‛‚‘󠀢❮❯«»‹›]")
+ ;; `isearch-fold-groups' doesn't interact with
+ ;; `isearch-lax-whitespace' yet. So we need to add this here.
+ (?\s . "[ \r\n]+"))
+ "Alist of groups to use when `isearch-fold-groups' is non-nil.")
+
(defcustom isearch-lazy-highlight t
"Controls the lazy-highlighting during incremental search.
When non-nil, all text in the buffer matching the current search