From 6b9b4783f71abbaf0a9a19c59be49bf23713f39b Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Mon, 14 Aug 2023 18:36:26 +1000 Subject: [emacs] extend tempel template header to lisp --- emacs/.emacs.d/tempel-templates | 62 ++++++++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 26 deletions(-) (limited to 'emacs/.emacs.d') 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 . -") - 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 . +") + (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) -- cgit v1.2.3