aboutsummaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
authorYuchen Pei <id@ypei.org>2023-08-14 18:36:26 +1000
committerYuchen Pei <id@ypei.org>2023-08-14 18:36:26 +1000
commit6b9b4783f71abbaf0a9a19c59be49bf23713f39b (patch)
treefb39986ae971e1592e1c1a16740c4bc7acd78e8e /emacs
parenta963e0e9c50b4673610c80566b647452c70bcbca (diff)
[emacs] extend tempel template header to lisp
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.emacs.d/tempel-templates62
1 files changed, 36 insertions, 26 deletions
diff --git a/emacs/.emacs.d/tempel-templates b/emacs/.emacs.d/tempel-templates
index 0613c00..53e437f 100644
--- a/emacs/.emacs.d/tempel-templates
+++ b/emacs/.emacs.d/tempel-templates
@@ -23,30 +23,6 @@ emacs-lisp-mode
(dotimes "(dotimes (" p ")" n> r> ")")
(dolist "(dolist (" p ")" n> r> ")")
-(agpl
- ";; Copyright (C) " (p (format-time-string "%Y" (current-time)) year) " Free Software Foundation.
-
-;; Author: " (p user-full-name) " <" (p user-mail-address) ">
-;; Package-Requires: " (format "((emacs \"%d.%d\"))"
- emacs-major-version
- emacs-minor-version) "
-
-;; This file is part of " (p (file-name-nondirectory (directory-file-name (project-root (project-current)))) project) ".
-
-;; " (s project) " is free software: you can redistribute it and/or modify it under
-;; the terms of the GNU Affero General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; " (s project) " is distributed in the hope that it will be useful, but WITHOUT
-;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General
-;; Public License for more details.
-
-;; You should have received a copy of the GNU Affero General Public
-;; License along with " (s project) ". If not, see <https://www.gnu.org/licenses/>.
-")
-
fundamental-mode ;; Available everywhere
(today (format-time-string "%Y-%m-%d %a"))
@@ -102,8 +78,42 @@ texinfo-mode
lisp-mode emacs-lisp-mode ;; Specify multiple modes
+(agpl
+ ";; Copyright (C) " (p (format-time-string "%Y" (current-time)) year) " Free Software Foundation.
+
+;; Author: " (p user-full-name) " <" (p user-mail-address) ">
+;; Package-Requires: " (format "((emacs \"%d.%d\"))"
+ emacs-major-version
+ emacs-minor-version) "
+
+;; This file is part of " (p (file-name-nondirectory (directory-file-name (project-root (project-current)))) project) ".
+
+;; " (s project) " is free software: you can redistribute it and/or modify it under
+;; the terms of the GNU Affero General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; " (s project) " is distributed in the hope that it will be useful, but WITHOUT
+;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General
+;; Public License for more details.
+
+;; You should have received a copy of the GNU Affero General Public
+;; License along with " (s project) ". If not, see <https://www.gnu.org/licenses/>.
+")
+
(lambda "(lambda (" p ")" n> r> ")")
+lisp-mode
+
+(header ";;; " (file-name-nondirectory (or (buffer-file-name) (buffer-name)))
+ " -- " (p "short-desc" short-desc) n n
+ (i agpl) n
+ ";;; Commentary:
+
+;; " (s short-desc) "." p n n
+ ";;; Code:" n n)
+
emacs-lisp-mode
(autoload ";;;###autoload")
@@ -136,6 +146,8 @@ emacs-lisp-mode
(advice "(defun " (p "adv" name) " (&rest app)" n> p n> "(apply app))" n>
"(advice-add #'" (p "fun") " " (p ":around") " #'" (s name) ")")
+(lb ";; -*- lexical-binding: t; -*-" n n)
+
(header ";;; " (file-name-nondirectory (or (buffer-file-name) (buffer-name)))
" -- " (p "short-desc" short-desc) " -*- lexical-binding: t -*-" n n
(i agpl) n
@@ -144,8 +156,6 @@ emacs-lisp-mode
;; " (s short-desc) "." p n n
";;; Code:" n n)
-(lb ";; -*- lexical-binding: t; -*-" n n)
-
(provide "(provide '" (file-name-base (or (buffer-file-name) (buffer-name))) ")" n
";;; " (file-name-nondirectory (or (buffer-file-name) (buffer-name)))
" ends here" n)