diff options
author | Case Duckworth | 2021-09-03 12:20:21 -0500 |
---|---|---|
committer | Case Duckworth | 2021-09-03 12:20:21 -0500 |
commit | ea2a02f4a5d739bf0889c6ad4c24f92021c571dc (patch) | |
tree | 83f9e21af1f31a33e484fffc5f625f48ca53bd91 /lisp | |
parent | Comment out reb-builder stuff, for now (diff) | |
download | emacs-ea2a02f4a5d739bf0889c6ad4c24f92021c571dc.tar.gz emacs-ea2a02f4a5d739bf0889c6ad4c24f92021c571dc.zip |
Refactor `safely'
I'm still not sure if this is like, at all necessary...
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/acdw-compat.el | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/lisp/acdw-compat.el b/lisp/acdw-compat.el index 0a1a037..353a1f1 100644 --- a/lisp/acdw-compat.el +++ b/lisp/acdw-compat.el | |||
@@ -27,27 +27,29 @@ | |||
27 | Is it necessary? Who knows!!" | 27 | Is it necessary? Who knows!!" |
28 | (let (output) | 28 | (let (output) |
29 | (dolist (form defines) | 29 | (dolist (form defines) |
30 | (let ((test (cond ((memq (car form) | 30 | ;; this is one part where elisp being a lisp-2 bites us... |
31 | '(define-global-minor-mode | 31 | (push (cond ((memq (car form) |
32 | define-globalized-minor-mode | 32 | '(;; makes functions |
33 | define-minor-mode | 33 | define-global-minor-mode |
34 | defmacro | 34 | define-globalized-minor-mode |
35 | defsubst | 35 | define-minor-mode |
36 | defun)) | 36 | defmacro |
37 | #'fboundp) | 37 | defsubst |
38 | ((memq (car form) | 38 | defun)) |
39 | '(defcustom | 39 | `(unless (fboundp ',(cadr form)) |
40 | defvar | 40 | ,form)) |
41 | defvar | 41 | ((memq (car form) |
42 | defvar-local | 42 | '(;; makes variables |
43 | defvar-mode-local | 43 | defcustom |
44 | defvaralias)) | 44 | defvar |
45 | #'boundp)))) | 45 | defvar |
46 | (push (if test | 46 | defvar-local |
47 | `(unless (,test ',(cadr form)) | 47 | defvar-mode-local |
48 | ,form) | 48 | defvaralias)) |
49 | form) | 49 | `(unless (boundp ',(cadr form)) |
50 | output))) | 50 | ,form)) |
51 | (t form)) | ||
52 | output)) | ||
51 | `(progn ,@(nreverse output)))) | 53 | `(progn ,@(nreverse output)))) |
52 | 54 | ||
53 | 55 | ||