flake-update-20260201
1;;; init-func.el --- -*- lexical-binding: t -*-
2;;
3
4;;;###autoload
5(defmacro vde/run-and-delete-frame (name &rest body)
6 "Define a function NAME that executes BODY and then closes the current frame.
7 Intended for use with emacsclient -c -e."
8 `(defun ,name ()
9 ,(format "Performs a task and then closes the current frame for %S." name)
10 (interactive)
11 ,@body
12 (delete-frame)))
13
14;;;###autoload
15(defun vde/el-load-dir (dir)
16 "Load el files from the given folder `DIR'."
17 (let ((files (directory-files dir nil "\.el$")))
18 (while files
19 (load-file (concat dir (pop files))))))
20
21;;;###autoload
22(defun vde/short-hostname ()
23 "Return hostname in short (aka wakasu.local -> wakasu)."
24 (string-match "[0-9A-Za-z-]+" system-name)
25 (substring system-name (match-beginning 0) (match-end 0)))
26
27
28(provide 'init-func)
29;;; init-func.el ends here