Skip to content

Commit 7bdd434

Browse files
Change prefix arg behavior of helm-show-all-candidates-in-source
1 parent dda7147 commit 7bdd434

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

NEWS.org

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
* NEWS
44
** Version 3.9.9-pre
5-
5+
*** Change prefix arg behavior of helm-show-all-candidates-in-source
6+
With a prefix arg show all candidates, with a numeric prefix arg show
7+
ARG number of candidates, and with no prefix arg show only
8+
helm-candidate-number-limit of candidates.
69
*** Get rid of popup.el dependency
710
*** helm-completion-styles-alist accepts commands for completion-in-region
811
*** Minibuffer-contents change color in HFF when updating

helm-core.el

+10-6
Original file line numberDiff line numberDiff line change
@@ -2351,11 +2351,11 @@ If NO-UPDATE is non-nil, skip executing `helm-update'."
23512351
(unless no-update (helm-update)))
23522352

23532353
(defun helm-show-all-candidates-in-source (arg)
2354-
"Toggle all or only candidate-number-limit cands in current source.
2355-
With a numeric prefix arg show only the ARG number of candidates.
2356-
The prefix arg has no effect when toggling to only
2357-
candidate-number-limit."
2358-
(interactive "p")
2354+
"Toggle all sources or only current source visibility.
2355+
With a prefix arg show all candidates in current source
2356+
disregarding candidate-number-limit and with a numeric prefix arg
2357+
show ARG number of candidates."
2358+
(interactive "P")
23592359
(with-helm-alive-p
23602360
(with-helm-buffer
23612361
(if helm-source-filter
@@ -2364,7 +2364,11 @@ candidate-number-limit."
23642364
(default-value 'helm-candidate-number-limit))
23652365
(helm-set-source-filter nil))
23662366
(with-helm-default-directory (helm-default-directory)
2367-
(setq-local helm-candidate-number-limit (and (> arg 1) arg))
2367+
(setq-local helm-candidate-number-limit
2368+
(helm-acase arg
2369+
((guard (consp arg)) nil)
2370+
((guard (numberp arg)) it)
2371+
(t (default-value 'helm-candidate-number-limit))))
23682372
(helm-set-source-filter
23692373
(list (helm-get-current-source))))))))
23702374
(put 'helm-show-all-candidates-in-source 'helm-only t)

0 commit comments

Comments
 (0)