[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/isearch-character-group-folding 1e60125 1/4: (isea
From: |
Artur Malabarba |
Subject: |
[Emacs-diffs] scratch/isearch-character-group-folding 1e60125 1/4: (isearch-fold-groups isearch-groups-alist): New variables. |
Date: |
Tue, 27 Jan 2015 16:13:25 +0000 |
branch: scratch/isearch-character-group-folding
commit 1e60125ff323e1a750d289def147061c280326bd
Author: Artur Malabarba <address@hidden>
Commit: Artur Malabarba <address@hidden>
(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.
---
lisp/isearch.el | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 99ca73f..86850db 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