[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] scratch/hook-helpers 3bb2282 09/19: Updated README, removing defi
From: |
Ian Dunn |
Subject: |
[elpa] scratch/hook-helpers 3bb2282 09/19: Updated README, removing define-mode-hook-helper. |
Date: |
Sun, 23 Apr 2017 12:50:39 -0400 (EDT) |
branch: scratch/hook-helpers
commit 3bb228257889ee6e2ad777b53a766c91a673836d
Author: Ian Dunn <address@hidden>
Commit: Ian Dunn <address@hidden>
Updated README, removing define-mode-hook-helper.
---
README.org | 33 ++++++++-------------------------
1 file changed, 8 insertions(+), 25 deletions(-)
diff --git a/README.org b/README.org
index e5c2216..9da1813 100644
--- a/README.org
+++ b/README.org
@@ -33,20 +33,25 @@ anaphoric ~add-hook~, but one that can be called many times
without risking
redundant hook functions. It gives a cleaner look and feel to Emacs
configuration files, and could even be used in actual libraries.
-The purpose of this package is to build upon add-hook and remove-hook. When
you have something like the following:
+The purpose of this package is to build upon add-hook and remove-hook. When
you
+have something like the following:
#+BEGIN_SRC emacs-lisp
(defun my/after-init-hook ()
(set-scroll-bar-mode nil))
#+END_SRC
-You've got to remember to actually add this to the after-init-hook variable.
Alternatively, you can use a lambda function:
+You've got to remember to actually add this to the after-init-hook variable.
+Alternatively, you can use a lambda function:
#+BEGIN_SRC emacs-lisp
(add-hook 'after-init-hook (lambda () (set-scroll-bar-mode nil)))
#+END_SRC
-But then if you want to modify the function, it's permanently stuck on the
after-init-hook variable, and you have to deal with it. It's not a problem for
after-init-hook, which is used once, but would be a problem for a mode hook,
like text-mode-hook.
+But then if you want to modify the function, it's permanently stuck on the
+after-init-hook variable, and you have to deal with it. It's not a problem for
+after-init-hook, which is used once, but would be a problem for a mode hook,
+like text-mode-hook.
Instead, hook-helpers can do the following:
@@ -102,28 +107,6 @@ helper to the variable ~after-make-frame-functions~
instead of
~after-make-frame-hook~. The arguments tells it to create a function with
one argument, ~frame~.
-** Mode hooks
-
-The primary use case for ~define-hook-helper~ is mode hooks, so there is a
-specialized form for mode hooks, cleverly named ~define-mode-hook-helper~.
-This macro will take the name of a mode (sans the word 'mode'), and runs
-~define-hook-helper~.
-
-#+BEGIN_SRC emacs-lisp
-(define-mode-hook-helper text ()
- (visual-line-mode 1))
-#+END_SRC
-
-As above, this creates the function ~hook-helper--text-mode~ like so:
-
-#+BEGIN_SRC emacs-lisp
-(defun defined-hooks--text-mode ()
- (visual-line-mode 1))
-#+END_SRC
-
-All ~define-mode-hook-helper~ does is add "mode" to the end of the mode its
-passed, then passes all other arguments to ~define-hook-helper~. This means
-that ~define-mode-hook-helper~ also takes the name and append keywords.
** Removing the Function
To remove the new function from the hook, you can use the function
~remove-hook-helper~. It works just as ~define-hook-helper~:
- [elpa] branch scratch/hook-helpers created (now 365d8de), Ian Dunn, 2017/04/23
- [elpa] scratch/hook-helpers 597fce1 03/19: Updated README to include savannah project link., Ian Dunn, 2017/04/23
- [elpa] scratch/hook-helpers 7981caf 06/19: Removed docstring argument from `hook-helpers'., Ian Dunn, 2017/04/23
- [elpa] scratch/hook-helpers 17f7d5d 07/19: Restored docstring argument in `define-hook-helper'., Ian Dunn, 2017/04/23
- [elpa] scratch/hook-helpers b373c79 08/19: Removed define-mode-hook-helpers, since it only moves the word "mode" around., Ian Dunn, 2017/04/23
- [elpa] scratch/hook-helpers f1409ec 05/19: Updated README to include new usage., Ian Dunn, 2017/04/23
- [elpa] scratch/hook-helpers 73d0cb5 13/19: Added gitignore file, Ian Dunn, 2017/04/23
- [elpa] scratch/hook-helpers e253e03 11/19: Implemented new design for anonymous helpers, Ian Dunn, 2017/04/23
- [elpa] scratch/hook-helpers 5e4a3a8 02/19: Added remove-hook-helper to README., Ian Dunn, 2017/04/23
- [elpa] scratch/hook-helpers 706af98 15/19: Clean up describe-hook-helpers, Ian Dunn, 2017/04/23
- [elpa] scratch/hook-helpers 3bb2282 09/19: Updated README, removing define-mode-hook-helper.,
Ian Dunn <=
- [elpa] scratch/hook-helpers 7f1eccf 16/19: Fixed bug in hkhlp-normalize-hook-spec, Ian Dunn, 2017/04/23
- [elpa] scratch/hook-helpers 0386e23 04/19: Modified define-hook-helper to more closely match defun., Ian Dunn, 2017/04/23
- [elpa] scratch/hook-helpers 0fc0b3d 14/19: Fixed bug in define-hook-helper, Ian Dunn, 2017/04/23
- [elpa] scratch/hook-helpers dff9910 10/19: Added `define-hook-function' to allow defining a function to be added to multiple hooks., Ian Dunn, 2017/04/23
- [elpa] scratch/hook-helpers a46803b 17/19: Fixed failing tests, Ian Dunn, 2017/04/23
- [elpa] scratch/hook-helpers 93ae501 12/19: Finished last commit., Ian Dunn, 2017/04/23
- [elpa] scratch/hook-helpers 7970dcf 01/19: Initial commit., Ian Dunn, 2017/04/23
- [elpa] scratch/hook-helpers ff95f49 18/19: Preparations to push to ELPA, Ian Dunn, 2017/04/23
- [elpa] scratch/hook-helpers 365d8de 19/19: Add 'packages/hook-helpers/' from commit 'ff95f4944f3d6d1a43aca141cb7fa36a9043704d', Ian Dunn, 2017/04/23