Skip to content

Commit

Permalink
Shorten template keys to avoid real word replacement in emacs-lisp-mo…
Browse files Browse the repository at this point in the history
…de (Crandel#54)
  • Loading branch information
Crandel authored and alexforsale committed Aug 6, 2024
1 parent 29b7987 commit d196ce1
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions templates/emacs-lisp.eld
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
emacs-lisp-mode

(autoload & ";;;###autoload")
(atload & ";;;###autoload")
(pt "(point)")
(var "(defvar " p "\n \"" p "\")")
(local "(defvar-local " p "\n \"" p "\")")
(const "(defconst " p "\n \"" p "\")")
(custom "(defcustom " p "\n \"" p "\"" n> ":type '" p ")")
(face "(defface " p " '((t :inherit " p "))\n \"" p "\")")
(group "(defgroup " p " nil\n \"" p "\"" n> ":group '" p n> ":prefix \"" p "-\")")
(macro "(defmacro " p " (" p ")\n \"" p "\"" n> r> ")")
(alias "(defalias '" p " '" p ")")
(fun "(defun " p " (" p ")\n \"" p "\"" n> r> ")")
(vr "(defvar " p "\n \"" p "\")")
(lcl "(defvar-local " p "\n \"" p "\")")
(cnst "(defconst " p "\n \"" p "\")")
(cstom "(defcustom " p "\n \"" p "\"" n> ":type '" p ")")
(fce "(defface " p " '((t :inherit " p "))\n \"" p "\")")
(grp "(defgroup " p " nil\n \"" p "\"" n> ":group '" p n> ":prefix \"" p "-\")")
(mcr "(defmacro " p " (" p ")\n \"" p "\"" n> r> ")")
(als "(defalias '" p " '" p ")")
(fn "(defun " p " (" p ")\n \"" p "\"" n> r> ")")
(iflet "(if-let (" p ")" n> r> ")")
(whenlet "(when-let (" p ")" n> r> ")")
(iflet* "(if-let* (" p ")" n> r> ")")
(whenlet* "(when-let* (" p ")" n> r> ")")
(andlet* "(and-let* (" p ")" n> r> ")")
(cond "(cond" n "(" q "))" >)
(whnlt "(when-let (" p ")" n> r> ")")
(iflt* "(if-let* (" p ")" n> r> ")")
(whnlt* "(when-let* (" p ")" n> r> ")")
(andlt* "(and-let* (" p ")" n> r> ")")
(cnd "(cond" n "(" q "))" >)
(pcase "(pcase " (p "scrutinee") n "(" q "))" >)
(let "(let (" p ")" n> r> ")")
(let* "(let* (" p ")" n> r> ")")
(rec "(letrec (" p ")" n> r> ")")
(dotimes "(dotimes (" p ")" n> r> ")")
(dolist "(dolist (" p ")" n> r> ")")
(loop "(cl-loop for " p " in " p " do" n> r> ")")
(command "(defun " p " (" p ")\n \"" p "\"" n> "(interactive" p ")" n> r> ")")
(advice "(defun " (p "adv" name) " (&rest app)" n> p n> "(apply app))" n>
(lt "(let (" p ")" n> r> ")")
(lt* "(let* (" p ")" n> r> ")")
(rc "(letrec (" p ")" n> r> ")")
(dtimes "(dotimes (" p ")" n> r> ")")
(dlist "(dolist (" p ")" n> r> ")")
(lp "(cl-loop for " p " in " p " do" n> r> ")")
(cmmnd "(defun " p " (" p ")\n \"" p "\"" n> "(interactive" p ")" n> r> ")")
(advce "(defun " (p "adv" name) " (&rest app)" n> p n> "(apply app))" n>
"(advice-add #'" (p "fun") " " (p ":around") " #'" (s name) ")")
(provide "(provide '" (file-name-base (or (buffer-file-name) (buffer-name))) ")" n
(prvide "(provide '" (file-name-base (or (buffer-file-name) (buffer-name))) ")" n
";;; " (file-name-nondirectory (or (buffer-file-name) (buffer-name))) " ends here" n)
(log "(message \"LOG %s " (s sexp) ": %S"
(lg "(message \"LOG %s " (s sexp) ": %S"
"\" (format-time-string \"%X\") " sexp ")")
(package-header ";;; " (p (file-name-base (or (buffer-file-name) (buffer-name))) file) ".el --- " (p "summary" summary) " -*- lexical-binding: t -*-" n n

Expand All @@ -42,7 +42,7 @@ emacs-lisp-mode
";; This file is not part of GNU Emacs" n n

(p (concat
";; This program is free software: you can redistribute it and/or modify\n"
";; This program is free software: you can redistribute it and/or modify\n"
";; it under the terms of the GNU General Public License as published by\n"
";; the Free Software Foundation, either version 3 of the License, or\n"
";; (at your option) any later version.\n\n"
Expand All @@ -58,7 +58,7 @@ emacs-lisp-mode
n n

";;; Commentary:" n n

";; " (p "commentary") n n

";;; Code:" n n
Expand Down

0 comments on commit d196ce1

Please sign in to comment.