Skip to content

How to write an function which exands or jumps? #142

Answered by tbdcit
tbdcit asked this question in Q&A
Discussion options

You must be logged in to vote

The following seems to work well.

(defun my/tempel-expand-or-jump ()
  (interactive)
    (if-let ((templates (tempel--templates))
             (bounds (tempel--prefix-bounds))
             (name (buffer-substring-no-properties
                    (car bounds) (cdr bounds)))
             (sym (intern-soft name))
             (template (assq sym templates)))
    (tempel-expand template)
  (tempel-next 1)))

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tbdcit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant