From a5fe45e8db98f2405b6ec3d325d9d4366434faa7 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 21 May 2021 10:48:05 -0500 Subject: 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. --- lisp/acdw.el | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'lisp/acdw.el') 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 file nil))) -(defmacro hook-defun (name hooks &rest forms) - "Define a function NAME that executes FORMS, and add it to -each hook in HOOKS." - (declare (indent 2)) - (let ((func-name (intern (concat "hook-defun-" (symbol-name name)))) - (hook-list (if (consp hooks) hooks (list hooks))) - (hook-defun-add-hook-list)) - `(progn - (defun ,func-name () "Defined by `hook-defun'." ,@forms) - ,@(dolist (hook hook-list hook-defun-add-hook-list) - (push `(add-hook ',hook #',func-name) hook-defun-add-hook-list))))) +;; (defmacro hook-defun (name hooks &rest forms) +;; "Define a function NAME that executes FORMS, and add it to +;; each hook in HOOKS." +;; (declare (indent 2)) +;; (let ((func-name (intern (concat "hook-defun-" (symbol-name name)))) +;; (hook-list (if (consp hooks) hooks (list hooks))) +;; (hook-defun-add-hook-list)) +;; `(progn +;; (defun ,func-name () "Defined by `hook-defun'." ,@forms) +;; ,@(dolist (hook hook-list hook-defun-add-hook-list) +;; (push `(add-hook ',hook #',func-name) hook-defun-add-hook-list))))) (defun kill-region-or-backward-word (arg) "Kill region if active, or backward word if not." -- cgit 1.4.1-21-gabe81