How to have multiple columns/have non-searchable entries #2493
Replies: 1 comment
-
Nselm ***@***.***> writes:
1. ( ) text/plain (*) text/html
How can you do multiple columns in a helm source? For example,
helm-mini shows file size,name, absolute path etc., all in different
columns.
You can use a cons cell => (DISPLAY . REAL)
where DISPLAY is the candidate displayed with columns, colors,
whatever... and REAL the real value of the candidate e.g. a buffer in
your example.
Here an example with numbers:
(helm :sources (helm-build-sync-source "helm test"
:candidates '(("Un" . 1)
("Deux" . 2)
("Trois" . 3)
("Quatre" . 4)
("Cinq" . 5))
:action (lambda (_c)
(let ((mkd (helm-marked-candidates)))
(apply #'+ mkd))))
:buffer "*helm test*")
How can you show something, but not make it searchable.
There is several ways to do this.
1) Use a display property to display what you want to show.
2) Use the match-on-real attribute to match on the REAL part of
candidate instead of DISPLAY.
3) Use the match-part attribute.
Perhaps others I have not in mind yet.
Say I have a special source for various user-defined commands, and I
want to provide not only the name, but also a short description of it,
or its keybindings etc, without including them in the filtering, like
helm-M-x does.
Here an example with :match-part:
(helm :sources (helm-build-sync-source "helm test"
:candidates '("deux un" "trois un" "un trois" "un deux")
:match-part (lambda (candidate)
(car (split-string candidate))))
:buffer "*helm test*")
If you type "un" only two candidates will be shown.
IIRC I used a display property to show bindings in helm-M-x.
…--
Thierry
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
thierryvolpiatto
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
How can you do multiple columns in a helm source? For example, helm-mini shows file size,name, absolute path etc., all in different columns.
How can you show something, but not make it searchable. Say I have a special source for various user-defined commands, and I want to provide not only the name, but also a short description of it, or its keybindings etc, without including them in the filtering, like helm-M-x does.
Beta Was this translation helpful? Give feedback.
All reactions