tab completion and non-consecutive letter matching

212 views
Skip to first unread message

rizumu

unread,
Jul 12, 2012, 1:06:12 PM7/12/12
to emacs...@googlegroups.com
Hi,
I have helm-mode activated in my init.el and I also have smart-tab installed, but I am unfamiliar with helm and unsure what the expected behavior should be in the following two situations.

1. I expected that tab completion would work in helm, but when I press tab nothing happens and the minibuffer says:
   Sole action: action-fn

2. Also about matching on non-consecutive letters. For example, for helm to match the M-x command "org-mobile-push". I expected to be able to type "rgmobpu" but instead I have to type "rg-mobile-pu" to achieve the same.

Thanks for the help.

best,
Tom

Thierry Volpiatto

unread,
Jul 12, 2012, 5:05:00 PM7/12/12
to emacs...@googlegroups.com
Hi Tom,

rizumu <funk...@gmail.com> writes:

> Hi,
> I have helm-mode activated in my init.el and I also have smart-tab
> installed, but I am unfamiliar with helm and unsure what the expected
> behavior should be in the following two situations.
I don't know what is smart-tab and don't know if it works with helm.

> 1. I expected that tab completion would work in helm, but when I press tab
> nothing happens and the minibuffer says:
> Sole action: action-fn
Depend which completion you want; helm handle well elisp completion, for
tab to work use:

(define-key lisp-interaction-mode-map [remap indent-for-tab-command] 'helm-lisp-completion-at-point-or-indent)
(define-key emacs-lisp-mode-map [remap indent-for-tab-command] 'helm-lisp-completion-at-point-or-indent)

first hit on TAB will indent your code, second hit (fast [1]) will
complete.
[1] You can set this delay, see `helm-lisp-completion-or-indent-delay'.


> 2. Also about matching on non-consecutive letters. For example, for helm to
> match the M-x command "org-mobile-push". I expected to be able to type
> "rgmobpu" but instead I have to type "rg-mobile-pu" to achieve the same.
Type "rg mob pu" (notice the spaces)
Which give me here two candidate:
org-mobile-pull/push
You can type also this:
"rg mob pu !sh"
Which will remove the org-mobile-push candidate.

--
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997

rizumu

unread,
Jul 13, 2012, 8:11:49 AM7/13/12
to emacs...@googlegroups.com
Hi Thierry,

Thanks for the reply. What you've said works great, but I didn't explain myself clearly about the tab completion part. I'd like to know how it works inside of the helm mini-buffer, not a code file, but that is useful to know as well.

If I have helm-mode enabled and type "M-x eval-b <tab>" nothing happens, I just get the "Sole action: action-fn" message in the minibuffer. Since there are no other completions for "eval-b" except for "eval-buffer" I thought it would tab complete and select this command. Instead I have to press enter.

Similarly for "M-x find-file ~/.emacs.d/ini <tab>" I expected it to tab complete and open init.el. And on that note, if there is a match such as two folders "~/file1.el" "~/file2.el" typing "~/fi <tab>" should complete up until to "~/file" and wait for me to type a 1 or 2, press tab again, and then open that file.

Probably I'm missing something simple, but thats how bash completion works, so I'd like to achieve the same behavior inside of helm.

best,
Tom

Thierry Volpiatto

unread,
Jul 13, 2012, 11:48:01 AM7/13/12
to emacs...@googlegroups.com
rizumu <funk...@gmail.com> writes:

> Hi Thierry,
>
> Thanks for the reply. What you've said works great, but I didn't explain
> myself clearly about the tab completion part. I'd like to know how it works
> inside of the helm mini-buffer, not a code file, but that is useful to know
> as well.
>
> If I have helm-mode enabled and type "M-x eval-b <tab>" nothing happens, I
> just get the "Sole action: action-fn" message in the minibuffer. Since
> there are no other completions for "eval-b" except for "eval-buffer" I
> thought it would tab complete and select this command. Instead I have to
> press enter.
>
> Similarly for "M-x find-file ~/.emacs.d/ini <tab>" I expected it to tab
> complete and open init.el. And on that note, if there is a match such as
> two folders "~/file1.el" "~/file2.el" typing "~/fi <tab>" should complete
> up until to "~/file" and wait for me to type a 1 or 2, press tab again, and
> then open that file.
>
> Probably I'm missing something simple, but thats how bash completion works,
> so I'd like to achieve the same behavior inside of helm.
In helm <TAB> open the action buffer if the source have more than one
action.
helm-M-x have only one action, if you use helm-mode the regular M-x
command will have only one action also.

A typical use of helm is typing something in minibuffer to narrow down
the completion buffer and moving in this buffer with arrow keys or C-n/p
to select the candidate you need.

So to reply to your question, there is no TAB completion in helm because
the helm-buffer is the completion result itself.

rizumu

unread,
Jul 18, 2012, 7:02:07 AM7/18/12
to emacs...@googlegroups.com
Sorry for the delayed reply. It all makes sense now, thank you for the explanation.

best,
Tom
Reply all
Reply to author
Forward
0 new messages