emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/tempel 650e8129a5 1/2: Require Emacs 28.1


From: ELPA Syncer
Subject: [elpa] externals/tempel 650e8129a5 1/2: Require Emacs 28.1
Date: Sun, 8 Sep 2024 15:59:08 -0400 (EDT)

branch: externals/tempel
commit 650e8129a570fbc827d43ad60f25299179041102
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Require Emacs 28.1
---
 README.org |  2 +-
 tempel.el  | 26 ++++++++++++++------------
 2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/README.org b/README.org
index 93d8072254..0342a05573 100644
--- a/README.org
+++ b/README.org
@@ -14,7 +14,7 @@
 #+html: <img 
src="https://upload.wikimedia.org/wikipedia/commons/thumb/3/38/Temple_of_Hephaestus_%28Southwest%29%2C_Athens_-_20070711b.jpg/1920px-Temple_of_Hephaestus_%28Southwest%29%2C_Athens_-_20070711b.jpg";
 align="right" width="30%">
 
 Tempel is a tiny template package for Emacs, which uses the syntax of the Emacs
-Tempo library. Tempo is an ancient temple of the church of Emacs. It is 27 
years
+Tempo library. Tempo is an ancient temple of the church of Emacs. It is 30 
years
 old, but still in good shape since it successfully resisted change over the
 decades. However it may look a bit dusty here and there. Therefore we present
 Tempel, a new implementation of Tempo with inline expansion and integration 
with
diff --git a/tempel.el b/tempel.el
index 32ac6e245b..9491986c07 100644
--- a/tempel.el
+++ b/tempel.el
@@ -6,7 +6,7 @@
 ;; Maintainer: Daniel Mendler <mail@daniel-mendler.de>
 ;; Created: 2022
 ;; Version: 1.2
-;; Package-Requires: ((emacs "27.1") (compat "30"))
+;; Package-Requires: ((emacs "28.1") (compat "30"))
 ;; Homepage: https://github.com/minad/tempel
 ;; Keywords: abbrev, languages, tools, text
 
@@ -76,11 +76,11 @@ trigger completion."
 
 (defcustom tempel-insert-annotation 40
   "Annotation width for `tempel-insert'."
-  :type '(choice (const nil natnum)))
+  :type '(choice (const nil) natnum))
 
 (defcustom tempel-complete-annotation 20
   "Annotation width for `tempel-complete'."
-  :type '(choice (const nil natnum)))
+  :type '(choice (const nil) natnum))
 
 (defcustom tempel-user-elements nil
   "List of user element handler functions.
@@ -537,14 +537,20 @@ This is meant to be a source in 
`tempel-template-sources'."
            ((and (< dir 0) (< stop pt))
             (setq next (max (or next -1) stop)))))))))
 
+(defun tempel--active-p (_sym buffer)
+  "Return non-nil if Tempel is active in BUFFER."
+  (buffer-local-value 'tempel--active buffer))
+
 (defun tempel-beginning ()
   "Move to beginning of the template."
+  (declare (completion tempel--active-p))
   (interactive)
   (when-let ((pos (tempel--beginning)))
     (if (= pos (point)) (tempel-done) (goto-char pos))))
 
 (defun tempel-end ()
   "Move to end of the template."
+  (declare (completion tempel--active-p))
   (interactive)
   (when-let ((pos (tempel--end)))
     (if (= pos (point)) (tempel-done) (goto-char pos))))
@@ -560,6 +566,7 @@ This is meant to be a source in `tempel-template-sources'."
 
 (defun tempel-kill ()
   "Kill the field contents."
+  (declare (completion tempel--active-p))
   (interactive)
   (if-let ((ov (tempel--field-at-point)))
       (kill-region (overlay-start ov) (overlay-end ov))
@@ -567,6 +574,7 @@ This is meant to be a source in `tempel-template-sources'."
 
 (defun tempel-next (arg)
   "Move ARG fields forward and quit at the end."
+  (declare (completion tempel--active-p))
   (interactive "p")
   (cl-loop for i below (abs arg) do
            (if-let ((next (tempel--find arg)))
@@ -580,6 +588,7 @@ This is meant to be a source in `tempel-template-sources'."
 
 (defun tempel-previous (arg)
   "Move ARG fields backward and quit at the beginning."
+  (declare (completion tempel--active-p))
   (interactive "p")
   (tempel-next (- arg)))
 
@@ -595,6 +604,7 @@ This is meant to be a source in `tempel-template-sources'."
 
 (defun tempel-abort ()
   "Abort template insertion."
+  (declare (completion tempel--active-p))
   (interactive)
   ;; TODO abort only the topmost template?
   (while-let ((st (car tempel--active)))
@@ -615,6 +625,7 @@ This is meant to be a source in `tempel-template-sources'."
 
 (defun tempel-done ()
   "Template completion is done."
+  (declare (completion tempel--active-p))
   (interactive)
   ;; TODO disable only the topmost template?
   (while tempel--active (tempel--done)))
@@ -799,14 +810,5 @@ If called interactively, select a template with 
`completing-read'."
   (unless (or noninteractive (eq (aref (buffer-name) 0) ?\s))
     (tempel-abbrev-mode 1)))
 
-;; Emacs 28: Do not show Tempel commands in M-X
-(dolist (sym (list #'tempel-next #'tempel-previous #'tempel-beginning
-                   #'tempel-end #'tempel-kill #'tempel-done #'tempel-abort))
-  (put sym 'completion-predicate #'tempel--command-p))
-
-(defun tempel--command-p (_sym buffer)
-  "Return non-nil if Tempel is active in BUFFER."
-  (buffer-local-value 'tempel--active buffer))
-
 (provide 'tempel)
 ;;; tempel.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]