From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [elpa] externals/org 46da64c 4/6: org-persist.el: Fix `add-hook' priority argument Date: Tue, 19 Oct 2021 09:14:40 -0400 Message-ID: References: <20211019125722.17993.60001@vcs0.savannah.gnu.org> <20211019125725.EA9CF209AA@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2048"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Ihor Radchenko Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Oct 19 15:17:25 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mcozc-0000Ge-W9 for ged-emacs-devel@m.gmane-mx.org; Tue, 19 Oct 2021 15:17:25 +0200 Original-Received: from localhost ([::1]:49182 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mcozb-00071N-B6 for ged-emacs-devel@m.gmane-mx.org; Tue, 19 Oct 2021 09:17:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50096) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mcox9-0004u4-QX for emacs-devel@gnu.org; Tue, 19 Oct 2021 09:14:51 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:35523) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mcox5-0008L4-Io for emacs-devel@gnu.org; Tue, 19 Oct 2021 09:14:50 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id AF3F4440C77; Tue, 19 Oct 2021 09:14:42 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 6686D440BF2; Tue, 19 Oct 2021 09:14:41 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1634649281; bh=RoI6MM7BSmdF76Lg4lCIRxFsRm+B7dKOhnhzo+Mo0ws=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=KwLJ9q3NbFQ9v0tkLpTAYLIvfFn70w0JCAMYYuMTkpm5lqB//QL3GvPxUFrppu7oJ 8UOfoGxwZhisAZdj4M+ueMuavdAywNtAUg1GZjZDGO3JYknwJ3X2bHAUH/8qImhTvL 7E4vDsWEVdm80Q2tMDUKM8C52ZrmkbYIoHwpxvoCq1mdl2yI0K+/EiuPjPw07ZDxDY 5pNxQOBfAxGOYPgWzDTNVgngogY8gFLjaDViWOiHOOoGhdSSsnhJuXzOAntdIjFwnR hX5TGq+Weq1/FAewW5mZEIMFlPl+Rb+IniDwAhl6KBr059IG1DG7bqUvC9w5E3rIlW eT9f7MI8vSvNA== Original-Received: from pastel (unknown [45.72.241.23]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 215EE1201C1; Tue, 19 Oct 2021 09:14:41 -0400 (EDT) In-Reply-To: <20211019125725.EA9CF209AA@vcs0.savannah.gnu.org> (ELPA Syncer's message of "Tue, 19 Oct 2021 08:57:25 -0400 (EDT)") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:277357 Archived-At: Hi Ihor, > org-persist.el: Fix `add-hook' priority argument > --- > lisp/org-persist.el | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lisp/org-persist.el b/lisp/org-persist.el > index 9885386..e518974 100644 > --- a/lisp/org-persist.el > +++ b/lisp/org-persist.el > @@ -278,7 +278,7 @@ When BUFFER is `all', unregister VAR in all buffers." > (setq org-persist--index (nreverse new-index)))) > > (add-hook 'kill-emacs-hook #'org-persist-gc) > -(add-hook 'kill-emacs-hook #'org-persist-write-all 1000) > +(add-hook 'kill-emacs-hook #'org-persist-write-all 100) The docstring also says: Since nothing is \"always\" true, don't use 100 nor -100. 100 means that nothing will *ever* want to come later. I.e. you claim to be the one and only function that will ever deserve to always be the last one on this hook, which is rather presumptuous, I think. AFAICT the only thing that actually matters is that it should come after `org-persist-gc`, so even just 0.01 would be good enough. No need to get anywhere near 100 (tho it would make sense to leave room for other hooks that might need to come between `org-persist-gc` and `org-persist-write-all`). Also, I'd recommend you add a comment explaining the constraints that were considered when choosing this depth (e.g "Make sure it comes after `org-persist-gc`"). Stefan