emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] scratch/package.el-async-refresh bc0fc5e: Implement as


From: Stefan Monnier
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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> +(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 via email to

[Prev in Thread] Current Thread [Next in Thread]