branch: externals/tempel commit 517b9faa81ed470ab6c68766941cf4bf81f8055a Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
Rename :condition to :when --- README.org | 4 ++-- tempel.el | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.org b/README.org index 16dc5f11f2..7d33c9d3be 100644 --- a/README.org +++ b/README.org @@ -103,7 +103,7 @@ on =use-package=. The templates are defined in a Lisp file configured by ~tempel-path~. By default the file =~/.config/emacs/templates= is used. The templates are grouped by major -mode with an optional ~:condition~. Each template is a list in the concise form of +mode with an optional ~:when~ condition. Each template is a list in the concise form of the Emacs Tempo syntax. The first element of each list is the name of the template. Behind the name, the Tempo syntax elements follow. Pre- and post-expansion operations can be specified per template by the optional keys @@ -177,7 +177,7 @@ post-expansion operations can be specified per template by the optional keys (class "public class " (p (file-name-base (or (buffer-file-name) (buffer-name)))) " {" n> r> n "}") - c-mode :condition (re-search-backward "^\\w*$" (line-beginning-position) 'noerror) + c-mode :when (re-search-backward "^\\w*$" (line-beginning-position) 'noerror) (inc "#include <" (p (concat (file-name-base (or (buffer-file-name) (buffer-name))) ".h")) ">") (incc "#include \"" (p (concat (file-name-base (or (buffer-file-name) (buffer-name))) ".h")) "\"") diff --git a/tempel.el b/tempel.el index c82a2f9050..67eb44133d 100644 --- a/tempel.el +++ b/tempel.el @@ -456,11 +456,11 @@ This is meant to be a source in `tempel-template-sources'." for m in modes thereis (or (eq m #'fundamental-mode) (derived-mode-p m))) - (or (not (plist-member plist :condition)) + (or (not (plist-member plist :when)) (save-excursion (save-restriction (save-match-data - (eval (plist-get plist :condition) 'lexical))))))) + (eval (plist-get plist :when) 'lexical))))))) (defun tempel--templates () "Return templates for current mode."