summary refs log tree commit diff stats
path: root/lisp
diff options
context:
space:
mode:
authorCase Duckworth2021-05-12 19:31:14 -0500
committerCase Duckworth2021-05-12 19:31:14 -0500
commit5b978fb0e39e9a286c5075796270c84e0adbcf08 (patch)
tree9cc5d0a0c30d0188cc0638fe9ee17d21ad38cd03 /lisp
parentChange common-lisp-ide -> sly (diff)
parentRemove INBOX from groups.txt (diff)
downloademacs-5b978fb0e39e9a286c5075796270c84e0adbcf08.tar.gz
emacs-5b978fb0e39e9a286c5075796270c84e0adbcf08.zip
Merge branch 'main' of https://tildegit.org/acdw/emacs
Diffstat (limited to 'lisp')
-rw-r--r--lisp/acdw.el35
1 files changed, 26 insertions, 9 deletions
diff --git a/lisp/acdw.el b/lisp/acdw.el index a798069..a1c364d 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -21,12 +21,29 @@
21 21
22;;; Variables 22;;; Variables
23 23
24(defconst acdw/system (pcase system-type 24(defconst acdw/system
25 ('gnu/linux :home) 25 (pcase system-type
26 ((or 'msdos 'windows-nt) :work) 26 ('gnu/linux :home)
27 (_ :other)) 27 ((or 'msdos 'windows-nt) :work)
28 (_ :other))
28 "Which computer system is currently being used.") 29 "Which computer system is currently being used.")
29 30
31(defmacro acdw/system (&rest arg)
32 "Convenience macro for interfacing with `acdw/system'.
33
34When called without arguments, it returns `acdw/system'.
35When called with one argument, it returns (eq acdw/system ARG).
36When called with multiple arguments, it returns `pcase' over each argument."
37 (cond
38 ((not arg) acdw/system)
39 ((not (cdr arg))
40 `(when (eq acdw/system ,(car arg))
41 ,(car arg)))
42 ((cdr arg)
43 `(pcase acdw/system
44 ,@arg))
45 (t (error "Wrong argument type: %s" (type-of arg)))))
46
30 47
31;;; Utility functions 48;;; Utility functions
32;; I don't prefix these because ... reasons. Honestly I probably should prefix 49;; I don't prefix these because ... reasons. Honestly I probably should prefix
@@ -162,11 +179,11 @@ if MAKE-DIRECTORY is non-nil."
162 179
163(defun acdw/find-emacs-source () 180(defun acdw/find-emacs-source ()
164 "Find where Emacs keeps its source tree." 181 "Find where Emacs keeps its source tree."
165 (pcase acdw/system 182 (acdw/system
166 (:work (expand-file-name 183 (:work (expand-file-name
167 (concat "~/src/emacs-" emacs-version "/src"))) 184 (concat "~/src/emacs-" emacs-version "/src")))
168 (:home (expand-file-name "~/src/pkg/emacs/src/emacs-git/src")) 185 (:home (expand-file-name "~/src/pkg/emacs/src/emacs-git/src"))
169 (:other nil))) 186 (:other nil)))
170 187
171(defun acdw/gc-disable () 188(defun acdw/gc-disable ()
172 "Functionally disable the Garbage collector." 189 "Functionally disable the Garbage collector."