These snippets make use of a lot of tab-navigation placeholders containing smaller nested placeholders, wherever there's something optional that you might not want to have to fill in. The idea is, if you don't need the optional things (for instance the optional arguments to autoload
) you just hit C-d
to remove (in this case) both of them, otherwise you tab again to get "inside" the group and edit the first one -- in this case, presumably, to specify 'interactive
.
Easier to demo than explain:
(autoload #'FUNCTION FILE &optional "DOCSTRING" INTERACTIVE TYPE)
has the following tab-navigation placeholders, which you can just tab to and type to replace:
FUNCTION
FILE
then:
- Everything after
FILE
, including the space character before&optional
. Tab to this and hitC-d
if you want to just remove all the optional stuff (the most common use case). - Alternatively, tab "in" to select "
&optional
", and hitC-d
to delete it, then tab again to select"DOCSTRING"
(including the quotes). - Now, either type
nil
to replace"DOCSTRING"
, meaning no documentation string is specified, or tab "in" to selectDOCSTRING
(without the quotes) and type your documentation string. - Tab again. Again, you can now delete the remaining parameters with
C-d
. Or tab "in" to selectINTERACTIVE
. Choose from the interactive menu, in this case offering you the choice ofnil
or'interactive
. - Tab again. Again, you can delete the last parameter with
C-d
. Or tab "in" to selectTYPE
and choose from the interactive menu offering younil
,'keymap
, or'macro
.
I use C-style outdenting. That's right: closing parens on their own lines. Block structuring, visually represented. The AST, visually represented. Sexp nesting, visually represented. The right way, I claim. Making the most of the visual real estate available on a great big portrait display, which I highly recommend to any serious coder.
If you hate it, I understand. Why not fork this repo? If you do, please keep me posted, and I'll link to you.
All other PRs very gratefully received.