branch: elpa/helm
commit aa560fa3c1808ae9e6f65d18751ec8a96c98ebf3
Author: Thierry Volpiatto <thie...@posteo.net>
Commit: Thierry Volpiatto <thie...@posteo.net>

    Allow ignoring diacritics in HFF #2470
    
    New user var helm-find-files-ignore-diacritics.
---
 helm-files.el | 15 +++++++++++++++
 helm-mode.el  |  1 +
 2 files changed, 16 insertions(+)

diff --git a/helm-files.el b/helm-files.el
index 8ce7cd573f..f4b41dea11 100644
--- a/helm-files.el
+++ b/helm-files.el
@@ -959,6 +959,19 @@ working only when dropping on an external application 
(only thunar tested)."
           (const :tag "Copy" copy)
           (const :tag "Move" move)
           (const :tag "Link" link)))
+
+(defcustom helm-find-files-ignore-diacritics nil
+  "Ignore diacritics on basename of files when non nil.
+Note that this happens only when switching to multimatch, i.e. adding spaces in
+pattern, this may slowdown a little matching of candidates when non nil.
+Setting this with `setq' may have no effect on this variable, use
+`customize-set-variable'.  This variable affects as well `read-file-name'."
+  :type 'boolean
+  :set (lambda (var val)
+         (set var val)
+         ;; Force rebuilding the source to pass diacritics fn to diacritics
+         ;; slot.
+         (setq helm-source-find-files nil)))
 
 ;;; Faces
 ;;
@@ -1147,6 +1160,8 @@ Used when showing tramp host completions."
                        (remhash helm-ff-default-directory
                                 helm-ff--list-directory-cache)))
    (match-on-real :initform t)
+   (diacritics :initform (and helm-find-files-ignore-diacritics
+                              'helm-mm-3f-match-on-diacritics))
    (filtered-candidate-transformer
     :initform '(helm-ff-fct
                 helm-ff-maybe-show-thumbnails
diff --git a/helm-mode.el b/helm-mode.el
index 5f987ed1eb..31b7de41ec 100644
--- a/helm-mode.el
+++ b/helm-mode.el
@@ -2220,6 +2220,7 @@ Keys description:
                        (remhash helm-ff-default-directory
                                 helm-ff--list-directory-cache))
              :match-on-real t
+             :diacritics helm-find-files-ignore-diacritics
              :filtered-candidate-transformer '(helm-ff-fct
                                                helm-ff-maybe-show-thumbnails
                                                helm-ff-sort-candidates)

Reply via email to