Merge pull request #2537 from licebmi/develop

Fix `+file-template-p` to use `:when` keyword
This commit is contained in:
Henrik Lissner 2020-02-14 17:31:25 -05:00 committed by GitHub
commit 3259907ab7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -118,11 +118,14 @@ information.")
"Return t if RULE applies to the current buffer."
(let ((pred (car rule))
(plist (cdr rule)))
(and (cond ((symbolp pred) (eq major-mode pred))
((and (stringp pred) buffer-file-name)
(string-match-p pred buffer-file-name))
((not (plist-member plist :when)) t)
((funcall (plist-get plist :when) buffer-file-name)))
(and (or (and (symbolp pred)
(eq major-mode pred))
(and (stringp pred)
(stringp 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)))
(defun +file-templates-check-h ()