[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/helm 80326dc90e 2/6: No need to calculate lgst len in helm
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/helm 80326dc90e 2/6: No need to calculate lgst len in helm-lisp-completion-at-point |
Date: |
Tue, 27 Feb 2024 13:04:38 -0500 (EST) |
branch: elpa/helm
commit 80326dc90e279782a3fd87a0571d2dace2b8a24e
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>
No need to calculate lgst len in helm-lisp-completion-at-point
---
helm-elisp.el | 31 +++++++++++--------------------
1 file changed, 11 insertions(+), 20 deletions(-)
diff --git a/helm-elisp.el b/helm-elisp.el
index c8bee2fd36..7ee501c13a 100644
--- a/helm-elisp.el
+++ b/helm-elisp.el
@@ -297,13 +297,10 @@ Return a cons (beg . end)."
(when (and pos (< (point) pos))
(push-mark pos t t))))
-(defvar helm-lisp-completion--cache nil)
-(defvar helm-lgst-len nil)
;;;###autoload
(defun helm-lisp-completion-at-point ()
"Preconfigured Helm for Lisp symbol completion at point."
(interactive)
- (setq helm-lgst-len 0)
(let* ((target (helm-thing-before-point))
(beg (car (helm-bounds-of-thing-before-point)))
(end (point))
@@ -316,17 +313,12 @@ Return a cons (beg . end)."
(helm-quit-if-no-candidate t)
(helm-execute-action-at-once-if-one t)
(enable-recursive-minibuffers t))
- (setq helm-lisp-completion--cache (cl-loop for sym in candidates
- for len = (length sym)
- when (> len helm-lgst-len)
- do (setq helm-lgst-len len)
- collect sym))
(if candidates
(with-helm-show-completion beg end
;; Overlay is initialized now in helm-current-buffer.
(helm
:sources (helm-build-in-buffer-source "Lisp completion"
- :data helm-lisp-completion--cache
+ :data candidates
:persistent-action
`(helm-lisp-completion-persistent-action .
,(and (eq helm-elisp-help-function
'helm-elisp-show-doc-modeline)
@@ -399,17 +391,16 @@ the same time to variable and a function."
(defun helm-lisp-completion-transformer (candidates _source)
"Helm candidates transformer for Lisp completion."
(cl-loop for c in candidates
- for sym = (intern c)
- for annot = (pcase sym
- ((pred commandp) " (Com)")
- ((pred class-p) " (Class)")
- ((pred cl-generic-p) " (Gen)")
- ((pred fboundp) " (Fun)")
- ((pred boundp) " (Var)")
- ((pred facep) " (Face)"))
- for spaces = (make-string (- helm-lgst-len (length c)) ? )
- collect (cons (concat c spaces annot) c) into lst
- finally return (sort lst #'helm-generic-sort-fn)))
+ for sym = (intern c)
+ for annot = (pcase sym
+ ((pred commandp) " (Com)")
+ ((pred class-p) " (Class)")
+ ((pred cl-generic-p) " (Gen)")
+ ((pred fboundp) " (Fun)")
+ ((pred boundp) " (Var)")
+ ((pred facep) " (Face)"))
+ collect (cons (concat c (helm-make-separator c) annot) c) into lst
+ finally return (sort lst #'helm-generic-sort-fn)))
;;;###autoload
(cl-defun helm-get-first-line-documentation (sym &optional
- [nongnu] elpa/helm updated (9ad587f3cf -> d290f3adcc), ELPA Syncer, 2024/02/27
- [nongnu] elpa/helm 00d1679561 1/6: Rewrite helm-info-lookup-fallback-source, ELPA Syncer, 2024/02/27
- [nongnu] elpa/helm d290f3adcc 6/6: Use helm-acase in more places, ELPA Syncer, 2024/02/27
- [nongnu] elpa/helm 4657367e25 3/6: Use cl-multiple-value-bind in helm-mode, ELPA Syncer, 2024/02/27
- [nongnu] elpa/helm 80326dc90e 2/6: No need to calculate lgst len in helm-lisp-completion-at-point,
ELPA Syncer <=
- [nongnu] elpa/helm 385a4c48a1 4/6: Cleanup helm-elisp--show-help-1, ELPA Syncer, 2024/02/27
- [nongnu] elpa/helm b24f676798 5/6: Use helm-acase in helm-completing-read-default-1/2, ELPA Syncer, 2024/02/27