unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Cc: Artur Malabarba <bruce.connor.am@gmail.com>
Subject: Re: [Emacs-diffs] scratch/package.el-async-refresh bc0fc5e: Implement async refreshing in package-refresh-contents
Date: Mon, 30 Mar 2015 21:46:49 -0400	[thread overview]
Message-ID: <jwvego69c4r.fsf-monnier+emacsdiffs@gnu.org> (raw)
In-Reply-To: <E1Ycjva-00017J-Il@vcs.savannah.gnu.org> (Artur Malabarba's message of "Tue, 31 Mar 2015 00:21:10 +0000")

> +(defvar package--post-download-archives-hook nil
> +  "Hook run after the archive contents are downloaded.")
> +(put 'package--post-download-archives-hook 'risky-local-variable t)

> +(add-hook 'package--post-download-archives-hook #'package--notify-done)
> +(add-hook 'package--post-download-archives-hook #'package--build-compatibility-table)
> +(add-hook 'package--post-download-archives-hook #'package-read-all-archive-contents)

I think this is one of those places where the default value can directly
be placed in the defvar.  After all, this is an internal hook, so it
doesn't need to be easy to use.

I personally would only place a single function on it, tho (which then
calls the above 3 functions).  Or I would keep it nil by default, and
just put a call to that (new) function wherever you currently run
package--post-download-archives-hook.

> +  (add-hook 'package--post-download-archives-hook
> +            #'package-menu--populate-new-package-list 'append)
> +  (add-hook 'package--post-download-archives-hook
> +            #'package-menu--revert 'append)
> +  (add-hook 'package--post-download-archives-hook
> +            #'package-menu--find-and-notify-upgrades 'append)

Similarly, here I'd put a single function on the hook which then calls
those 3.


        Stefan



       reply	other threads:[~2015-03-31  1:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20150331002109.4237.29402@vcs.savannah.gnu.org>
     [not found] ` <E1Ycjva-00017J-Il@vcs.savannah.gnu.org>
2015-03-31  1:46   ` Stefan Monnier [this message]
2015-03-31 10:02     ` [Emacs-diffs] scratch/package.el-async-refresh bc0fc5e: Implement async refreshing in package-refresh-contents Artur Malabarba

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=jwvego69c4r.fsf-monnier+emacsdiffs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=bruce.connor.am@gmail.com \
    --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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).