all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ian Dunn <dunni@gnu.org>
To: emacs-devel@gnu.org
Subject: [ELPA] New package: hook-helpers.el
Date: Sun, 12 Jun 2016 14:57:54 -0400 (2 minutes, 34 seconds ago)	[thread overview]
Message-ID: <878tya6xfg.fsf@gnu.org> (raw)


    As no one has made any other objections, I'll officially submit this to GNU ELPA.

    It's currently maintained on Savannah, so I've included the patch for adding hook-helpers to the externals-list file.  I apologize if I've done this incorrectly.

Official Description:

Often times, I see people define a function to be used once in a hook.  If they don’t do this, then it will be an anonymous function.  If the anonymous function is modified, then the function can’t be removed.  With a function outside of the ‘add-hook’ call, it looks messy.

The ‘define-hook-helper’ macro is a solution to this.  Think of it as an 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.

diff --git a/externals-list b/externals-list
index 169cb11..6876140 100644
--- a/externals-list
+++ b/externals-list
@@ -55,6 +55,7 @@
  ("ggtags"             :subtree "https://github.com/leoliu/ggtags")
  ("gnome-c-style"      :subtree "https://github.com/ueno/gnome-c-style.git")
  ("gnorb"               :subtree "https://github.com/girzel/gnorb")
+ ("hook-helpers"        :subtree "git://git.sv.gnu.org/hook-helpers-el.git")
  ("ioccur"             :subtree "https://github.com/thierryvolpiatto/ioccur.git")
  ("js2-mode"           :subtree "https://github.com/mooz/js2-mode.git")
  ("let-alist" :core "lisp/emacs-lisp/let-alist.el")

-- 
Ian Dunn



                 reply	other threads:[~2016-06-12 18:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878tya6xfg.fsf@gnu.org \
    --to=dunni@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.