all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: [Emacs-diffs] scratch/package.el-async-refresh bc0fc5e: Implement async refreshing in package-refresh-contents
       [not found] ` <E1Ycjva-00017J-Il@vcs.savannah.gnu.org>
@ 2015-03-31  1:46   ` Stefan Monnier
  2015-03-31 10:02     ` Artur Malabarba
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Monnier @ 2015-03-31  1:46 UTC (permalink / raw)
  To: emacs-devel; +Cc: Artur Malabarba

> +(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



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Emacs-diffs] scratch/package.el-async-refresh bc0fc5e: Implement async refreshing in package-refresh-contents
  2015-03-31  1:46   ` [Emacs-diffs] scratch/package.el-async-refresh bc0fc5e: Implement async refreshing in package-refresh-contents Stefan Monnier
@ 2015-03-31 10:02     ` Artur Malabarba
  0 siblings, 0 replies; 2+ messages in thread
From: Artur Malabarba @ 2015-03-31 10:02 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

> 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.

Yes, I've changed it to this last one. Makes more sense here.

>
>> +  (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.

Done.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-31 10:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20150331002109.4237.29402@vcs.savannah.gnu.org>
     [not found] ` <E1Ycjva-00017J-Il@vcs.savannah.gnu.org>
2015-03-31  1:46   ` [Emacs-diffs] scratch/package.el-async-refresh bc0fc5e: Implement async refreshing in package-refresh-contents Stefan Monnier
2015-03-31 10:02     ` Artur Malabarba

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.