Fix +file-template-p
to use :when
keyword
This commit is contained in:
parent
21db1b7c91
commit
7b40e80a8f
1 changed files with 8 additions and 5 deletions
|
@ -118,11 +118,14 @@ information.")
|
||||||
"Return t if RULE applies to the current buffer."
|
"Return t if RULE applies to the current buffer."
|
||||||
(let ((pred (car rule))
|
(let ((pred (car rule))
|
||||||
(plist (cdr rule)))
|
(plist (cdr rule)))
|
||||||
(and (cond ((symbolp pred) (eq major-mode pred))
|
(and (or (and (symbolp pred)
|
||||||
((and (stringp pred) buffer-file-name)
|
(eq major-mode pred))
|
||||||
(string-match-p pred buffer-file-name))
|
(and (stringp pred)
|
||||||
((not (plist-member plist :when)) t)
|
(stringp buffer-file-name)
|
||||||
((funcall (plist-get plist :when) buffer-file-name)))
|
(string-match-p pred buffer-file-name)
|
||||||
|
(or (not (plist-member plist :when))
|
||||||
|
(funcall (plist-get plist :when)
|
||||||
|
buffer-file-name))))
|
||||||
rule)))
|
rule)))
|
||||||
|
|
||||||
(defun +file-templates-check-h ()
|
(defun +file-templates-check-h ()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue