branch: elpa/helm commit bf915cc9dae70e2a333e00cd85666f1501769701 Author: Thierry Volpiatto <thie...@posteo.net> Commit: Thierry Volpiatto <thie...@posteo.net>
Comments only --- helm-core.el | 7 +++++-- helm-multi-match.el | 8 +++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/helm-core.el b/helm-core.el index a8a4620adf..ce097d9551 100644 --- a/helm-core.el +++ b/helm-core.el @@ -6968,7 +6968,7 @@ To customize `helm-candidates-in-buffer' behaviour, use `search', (not (consp pos-lst))) ;; If match-part attr is present, or if SEARCHER fn ;; returns a cons cell, collect PATTERN only if it - ;; match the part of CAND specified by + ;; matches the part of CAND specified by ;; the match-part func. (helm-search-match-part cand pattern diacritics))) do (progn @@ -6993,14 +6993,17 @@ computed by match-part-fn and stored in the match-part property." (t 'string-match)))) (condition-case _err (if (string-match " " pattern) + ;; FIXME use helm-mm-3-match here. (cl-loop for i in (helm-mm-split-pattern pattern) always (if (string-match "\\`!" i) (not (funcall matchfn (substring i 1) part)) (funcall matchfn i part))) + ;; A pattern with no spaces that starts with "!". (if (string-match "\\`!" pattern) (if helm--in-fuzzy ;; Fuzzy regexp have already been - ;; computed with substring 1. + ;; computed with substring 1 i.e. the leading "!" has been + ;; removed. (not (string-match fuzzy-regexp part)) (not (funcall matchfn (substring pattern 1) part))) (funcall matchfn (if helm--in-fuzzy fuzzy-regexp pattern) part))) diff --git a/helm-multi-match.el b/helm-multi-match.el index ae504afcc6..22c48d5de1 100644 --- a/helm-multi-match.el +++ b/helm-multi-match.el @@ -254,16 +254,19 @@ i.e (identity (re-search-forward \"foo\" (pos-eol) t)) => t." (not (helm-mm-regexp-p regex))) (char-fold-to-regexp regex) regex) + ;; First pattern is a negation. when (eq (caar pat) 'not) return ;; Pass the job to `helm-search-match-part'. - ;; We now forward-line from helm-search-from-candidate-buffer, see + ;; We now forward-line from `helm-search-from-candidate-buffer', see ;; comments about bug#2650 there. (list (pos-bol) (pos-eol)) + ;; Start searching the first pattern [1]. while (condition-case _err (funcall searchfn1 (or regex1 "") nil t) (invalid-regexp nil)) for bol = (pos-bol) for eol = (pos-eol) + ;; Now search subsequent patterns on this line. if (cl-loop for (pred . str) in (cdr pat) for regexp = (if (and helm-mm--match-on-diacritics (not (helm-mm-regexp-p str))) @@ -274,7 +277,10 @@ i.e (identity (re-search-forward \"foo\" (pos-eol) t)) => t." (funcall pred (condition-case _err (funcall searchfn2 regexp eol t) (invalid-regexp nil))))) + ;; When all patterns match on line move at eol or next line and exit + ;; with t. do (helm-mm-3--search-move-forward bol eol) and return t + ;; if no matches continue [1] until the next matching line and so on. else do (helm-mm-3--search-move-forward bol eol) finally return nil))