branch: elpa/helm
commit 60e504a5c6fc8ce77d9f6ed4795679d6ead31c26
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>

    Let Emacs style using improved affix fns
---
 helm-core.el | 10 ++++++----
 helm-mode.el | 20 +++++++++++++++++---
 2 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/helm-core.el b/helm-core.el
index be071c5bc2..309344a3c0 100644
--- a/helm-core.el
+++ b/helm-core.el
@@ -6994,10 +6994,12 @@ of `helm-source-in-buffer' by 
`helm-init-candidates-in-buffer' , otherwise
 LONGEST can be used to specify longest candidate."
   (let ((lgst (or longest (helm-in-buffer-get-longest-candidate)))
         (len  (length cand)))
-    (make-string (1+ (if (>= lgst len)
-                         (- lgst len)
-                       0))
-                 ? )))
+    (if (zerop lgst)
+        " -- "
+      (make-string (1+ (if (>= lgst len)
+                             (- lgst len)
+                           0))
+                     ? ))))
 
 (defun helm-init-candidates-in-buffer (buffer-spec data &optional 
force-longest)
   "Register BUFFER-SPEC with DATA for a helm candidates-in-buffer session.
diff --git a/helm-mode.el b/helm-mode.el
index f307392ded..6a0434b77b 100644
--- a/helm-mode.el
+++ b/helm-mode.el
@@ -1193,7 +1193,7 @@ is used."
            (max-len (and (memq helm-completion-style '(helm helm-fuzzy))
                          (helm-in-buffer-get-longest-candidate)))
            (sep (if (or (null max-len) (zerop max-len))
-                    " --"               ; Default separator.
+                    " -- "               ; Default separator.
                   (helm-make-separator comp max-len)))
            (doc (ignore-errors
                   (helm-get-first-line-documentation sym)))
@@ -1538,7 +1538,20 @@ This handler uses dynamic matching which allows 
honouring `completion-styles'."
             (if (or helm-completion--sorting-done
                     (string= helm-pattern ""))
                 candidates
-              (sort candidates 'helm-generic-sort-fn)))))
+              (sort candidates 'helm-generic-sort-fn))))
+         flags)
+    (helm-aif (and (null category)
+                   (assoc-default name 
helm-completing-read-command-categories))
+        (setq metadata `(metadata (category . ,it))
+              category it))
+    (helm-aif (and (or (and (boundp 'completions-detailed) 
completions-detailed)
+                       helm-completions-detailed)
+                   (assoc-default category 
helm-completing-read-extra-metadata))
+        (progn
+          (setq metadata it)
+          (setq afun (completion-metadata-get metadata 'annotation-function)
+                afix (completion-metadata-get metadata 'affixation-function)
+                flags (completion-metadata-get metadata 'flags))))
     (unwind-protect
         (helm-comp-read
          ;; Completion-at-point and friends have no prompt.
@@ -1567,7 +1580,8 @@ This handler uses dynamic matching which allows honouring 
`completion-styles'."
          :exec-when-only-one exec-when-only-one
          :quit-when-no-cand (eq require-match t)
          :must-match require-match)
-      (setq helm-completion--sorting-done nil))))
+      (setq helm-completion--sorting-done nil)
+      (dolist (f flags) (set f nil)))))
 
 (defun helm-mode-all-the-icons-handler (prompt collection test require-match
                                         init hist default inherit-input-method

Reply via email to