emacsexpansionabbreviationpabbrev

how to control cursor placement in Emacs abbrev expansion?


In Emacs, is there a way control where the cursor/point gets placed in abbrev-mode expansion?

You know, something like this?

("orgfootnote" "[fn:: %?]" nil 0)

Solution

  • Abbrev do not offer this feature themselves, but they offer enough hooks to do it externally. E.g.

    (define-skeleton my-orgfootnote "Docstring." nil
      "fn::" _ "]")
    

    and then use an abbrev like

    ("orgfootnote" "" 'my-orgfootnote)