diff options
author | Case Duckworth | 2021-05-21 10:48:05 -0500 |
---|---|---|
committer | Case Duckworth | 2021-05-21 10:57:58 -0500 |
commit | a5fe45e8db98f2405b6ec3d325d9d4366434faa7 (patch) | |
tree | a10665b4197b1417eb5cc2af865460f3ad025b84 /lisp | |
parent | Fix `acdw/system' argument parsing (diff) | |
download | emacs-a5fe45e8db98f2405b6ec3d325d9d4366434faa7.tar.gz emacs-a5fe45e8db98f2405b6ec3d325d9d4366434faa7.zip |
Comment out `hook-defun'
The only plus `hook-defun' has over (add-hook 'hook (defun name ... )) is the ability to add the same function to multiple hooks at once. My init files don't use that functionality, so I've retired this macro for now. I'm thinking, honestly, that if a function is used in more than one hook, it should be defined separately and added to each hook in turn ... you know, like Emacs does it by default.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/acdw.el | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lisp/acdw.el b/lisp/acdw.el index 4a7d4b3..c48c4e3 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el | |||
@@ -65,17 +65,17 @@ ARG). When called with multiple arguments or a list, it returns | |||
65 | file | 65 | file |
66 | nil))) | 66 | nil))) |
67 | 67 | ||
68 | (defmacro hook-defun (name hooks &rest forms) | 68 | ;; (defmacro hook-defun (name hooks &rest forms) |
69 | "Define a function NAME that executes FORMS, and add it to | 69 | ;; "Define a function NAME that executes FORMS, and add it to |
70 | each hook in HOOKS." | 70 | ;; each hook in HOOKS." |
71 | (declare (indent 2)) | 71 | ;; (declare (indent 2)) |
72 | (let ((func-name (intern (concat "hook-defun-" (symbol-name name)))) | 72 | ;; (let ((func-name (intern (concat "hook-defun-" (symbol-name name)))) |
73 | (hook-list (if (consp hooks) hooks (list hooks))) | 73 | ;; (hook-list (if (consp hooks) hooks (list hooks))) |
74 | (hook-defun-add-hook-list)) | 74 | ;; (hook-defun-add-hook-list)) |
75 | `(progn | 75 | ;; `(progn |
76 | (defun ,func-name () "Defined by `hook-defun'." ,@forms) | 76 | ;; (defun ,func-name () "Defined by `hook-defun'." ,@forms) |
77 | ,@(dolist (hook hook-list hook-defun-add-hook-list) | 77 | ;; ,@(dolist (hook hook-list hook-defun-add-hook-list) |
78 | (push `(add-hook ',hook #',func-name) hook-defun-add-hook-list))))) | 78 | ;; (push `(add-hook ',hook #',func-name) hook-defun-add-hook-list))))) |
79 | 79 | ||
80 | (defun kill-region-or-backward-word (arg) | 80 | (defun kill-region-or-backward-word (arg) |
81 | "Kill region if active, or backward word if not." | 81 | "Kill region if active, or backward word if not." |