unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: Respect `load-prefer-newer` when loading `notmuch-init-file'
@ 2020-06-01  6:17 Sean Whitton
  2020-06-01  8:16 ` David Edmondson
  0 siblings, 1 reply; 3+ messages in thread
From: Sean Whitton @ 2020-06-01  6:17 UTC (permalink / raw)
  To: notmuch

Before this change, `load-prefer-newer' was ignored.

Set NOERROR and MUST-SUFFIX arguments of `load' to t, and NOSUFFIX
argument to nil, to preserve the behaviour of the deleted `let' form.
---
I've observed that the way that the code at the end of notmuch.el
loads the user's notmuch-init-file means that the variable
load-prefer-newer is effectively ignored: notmuch.el will always load
notmuch-config.elc in preference to notmuch-config.el, even if the
latter is newer than the former.  This patch should fix the problem
without changing anything else.

 emacs/notmuch.el | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index a980c7a2..5a24d8a7 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -1148,8 +1148,6 @@ beginning of the line."
 
 ;; After provide to avoid loops if notmuch was require'd via notmuch-init-file.
 (if init-file-user ; don't load init file if the -q option was used.
-    (let ((init-file (locate-file notmuch-init-file '("/")
-				  (get-load-suffixes))))
-      (if init-file (load init-file nil t t))))
+    (load notmuch-init-file t t nil t))
 
 ;;; notmuch.el ends here
-- 
2.26.2

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

* Re: [PATCH] emacs: Respect `load-prefer-newer` when loading `notmuch-init-file'
  2020-06-01  6:17 [PATCH] emacs: Respect `load-prefer-newer` when loading `notmuch-init-file' Sean Whitton
@ 2020-06-01  8:16 ` David Edmondson
  2020-06-01 10:59   ` David Bremner
  0 siblings, 1 reply; 3+ messages in thread
From: David Edmondson @ 2020-06-01  8:16 UTC (permalink / raw)
  To: Sean Whitton, notmuch

On Sunday, 2020-05-31 at 23:17:04 -07, Sean Whitton wrote:

> Before this change, `load-prefer-newer' was ignored.
>
> Set NOERROR and MUST-SUFFIX arguments of `load' to t, and NOSUFFIX
> argument to nil, to preserve the behaviour of the deleted `let' form.

Reviewed-by: David Edmondson <dme@dme.org>

> ---
> I've observed that the way that the code at the end of notmuch.el
> loads the user's notmuch-init-file means that the variable
> load-prefer-newer is effectively ignored: notmuch.el will always load
> notmuch-config.elc in preference to notmuch-config.el, even if the
> latter is newer than the former.  This patch should fix the problem
> without changing anything else.
>
>  emacs/notmuch.el | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/emacs/notmuch.el b/emacs/notmuch.el
> index a980c7a2..5a24d8a7 100644
> --- a/emacs/notmuch.el
> +++ b/emacs/notmuch.el
> @@ -1148,8 +1148,6 @@ beginning of the line."
>  
>  ;; After provide to avoid loops if notmuch was require'd via notmuch-init-file.
>  (if init-file-user ; don't load init file if the -q option was used.
> -    (let ((init-file (locate-file notmuch-init-file '("/")
> -				  (get-load-suffixes))))
> -      (if init-file (load init-file nil t t))))
> +    (load notmuch-init-file t t nil t))
>  
>  ;;; notmuch.el ends here
> -- 
> 2.26.2
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch

dme.
-- 
I went starin' out of my window, been caught doin' it once or twice.

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

* Re: [PATCH] emacs: Respect `load-prefer-newer` when loading `notmuch-init-file'
  2020-06-01  8:16 ` David Edmondson
@ 2020-06-01 10:59   ` David Bremner
  0 siblings, 0 replies; 3+ messages in thread
From: David Bremner @ 2020-06-01 10:59 UTC (permalink / raw)
  To: David Edmondson, Sean Whitton, notmuch

David Edmondson <dme@dme.org> writes:

> On Sunday, 2020-05-31 at 23:17:04 -07, Sean Whitton wrote:
>
>> Before this change, `load-prefer-newer' was ignored.
>>
>> Set NOERROR and MUST-SUFFIX arguments of `load' to t, and NOSUFFIX
>> argument to nil, to preserve the behaviour of the deleted `let' form.
>
> Reviewed-by: David Edmondson <dme@dme.org>
>
>> ---

pushed.

d

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

end of thread, other threads:[~2020-06-01 11:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-01  6:17 [PATCH] emacs: Respect `load-prefer-newer` when loading `notmuch-init-file' Sean Whitton
2020-06-01  8:16 ` David Edmondson
2020-06-01 10:59   ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.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).