Recent versions of emacs come with package.el built in and provide the abbreviation M-x l-pac. However, l-pac is not recognized by smex or helm-M-x. M-: (l-pac) also does not work and the help functions do not seem to know about l-pac either, so it does not seem to be a an emacs function.

Where/How is l-pac defined?


l-pac is not a defined abbreviation. Completion for it is provided; that's all.

This comes from user option completion-styles, which you can customize. The default value (in Emacs 25.1, for example) is (basic partial-completion emacs22), which means try to complete input using, first, basic completion, then, partial completion, and finally, emacs22 completion.

It is partial-completion that is completing l-pac as you see. See the Emacs manual, node Completion Styles. There you see this:


This aggressive completion style divides the minibuffer text into
 words separated by hyphens or spaces, and completes each word
 separately.  (For example, when completing command names, `em-l-m`
 completes to `emacs-lisp-mode`.)

 Furthermore, a `*` in the minibuffer text is treated as a
 “wildcard”—it matches any character at the corresponding position
 in the completion alternative.

Perhaps smex and helm-M-x do not support this kind of completion? Or perhaps you need to look at their doc/help to see how they support it.

M-: (l-pac) does not work because l-pac is not a defined function. But if you use M-: (l-pac TAB then it should be completed OK to (list-packages. (You then need to add ).)

| improve this answer | |

Your Answer

