about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--lisp/acdw.el22
1 files changed, 11 insertions, 11 deletions
diff --git a/lisp/acdw.el b/lisp/acdw.el index a1c364d..4a7d4b3 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -28,21 +28,21 @@
28 (_ :other)) 28 (_ :other))
29 "Which computer system is currently being used.") 29 "Which computer system is currently being used.")
30 30
31(defmacro acdw/system (&rest arg) 31(defmacro acdw/system (&rest args)
32 "Convenience macro for interfacing with `acdw/system'. 32 "Convenience macro for interfacing with `acdw/system'.
33 33
34When called without arguments, it returns `acdw/system'. 34When called without arguments, it returns `acdw/system'. When
35When called with one argument, it returns (eq acdw/system ARG). 35called with one (symbol) argument, it returns (eq acdw/system
36When called with multiple arguments, it returns `pcase' over each argument." 36ARG). When called with multiple arguments or a list, it returns
37`pcase' over each argument."
37 (cond 38 (cond
38 ((not arg) acdw/system) 39 ((null args) acdw/system)
39 ((not (cdr arg)) 40 ((atom (car args))
40 `(when (eq acdw/system ,(car arg)) 41 `(when (eq acdw/system ,(car args))
41 ,(car arg))) 42 ,(car args)))
42 ((cdr arg) 43 (t
43 `(pcase acdw/system 44 `(pcase acdw/system
44 ,@arg)) 45 ,@args))))
45 (t (error "Wrong argument type: %s" (type-of arg)))))
46 46
47 47
48;;; Utility functions 48;;; Utility functions