aboutsummaryrefslogtreecommitdiffstats
path: root/.emacs.d/lisp/et-utils.el
diff options
context:
space:
mode:
authorEugene Triguba <hello@eugenetriguba.com>2026-04-06 07:34:05 -0400
committerEugene Triguba <hello@eugenetriguba.com>2026-04-06 07:34:05 -0400
commitd4f779d7d43bef2c655c1b3c44e5d92644989dca (patch)
treeb893c9da85b9d76414000095f6b476c527a0488b /.emacs.d/lisp/et-utils.el
parentReplace slime with sly (diff)
downloaddotfiles-d4f779d7d43bef2c655c1b3c44e5d92644989dca.zip
Update emacs config to use project.el
Diffstat (limited to '.emacs.d/lisp/et-utils.el')
-rw-r--r--.emacs.d/lisp/et-utils.el35
1 files changed, 35 insertions, 0 deletions
diff --git a/.emacs.d/lisp/et-utils.el b/.emacs.d/lisp/et-utils.el
new file mode 100644
index 0000000..d14bc17
--- /dev/null
+++ b/.emacs.d/lisp/et-utils.el
@@ -0,0 +1,35 @@
+;;; et-utils.el --- Utilities for my Emacs configuration -*- lexical-binding: t; -*-
+;;
+;;; Commentary:
+;;
+;;; Code:
+
+(defun et-is-desktop-p ()
+ "Check if the current system is my desktop system."
+ (string-match-p "desktop" (system-name)))
+
+(defun et-insert-elisp-template (summary)
+ "Insert a elisp template into the buffer.
+
+SUMMARY will be inserted into the header docstring
+as the file summary."
+ (interactive (list (read-string "summary: ")))
+ (let ((move-to-center-of-code-section (lambda () (forward-line -3)))
+ (get-current-file-name (lambda () (file-name-sans-extension (file-name-nondirectory buffer-file-name))))
+ (get-module-template (lambda (module-name summary)
+ (format ";;; %s.el --- %s -*- lexical-binding: t; -*-
+;;; Commentary:
+;;; Code:
+
+
+
+(provide '%s)
+;;; %s.el ends here" module-name summary module-name module-name))))
+ (if (not (buffer-file-name))
+ (message "No file visited.")
+ (progn
+ (insert (funcall get-module-template (funcall get-current-file-name) summary))
+ (funcall move-to-center-of-code-section)))))
+
+(provide 'et-utils)
+;;; et-utils.el ends here