unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Tomi Ollila <tomi.ollila@iki.fi>
To: "Charles-André Roy" <caroy47@videotron.ca>,
	"David Bremner" <david@tethera.net>
Cc: notmuch@notmuchmail.org
Subject: Re: Cannot Start Notmuch (invalid-read-syntax "#")
Date: Tue, 14 Sep 2021 00:32:07 +0300	[thread overview]
Message-ID: <m2lf40p3fs.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <87lf408do3.fsf@>

On Mon, Sep 13 2021, Charles-André Roy wrote:

> Hello David,
>
> I have removed and purged the notmuch-emacs package.
>
> elpa-notmuch/stable,now 0.31.4-2 was already installed.
>
> On the notmuchmail.org Web site, I looked at the pages "Notmuch Emacs
> Interface" and "Tips and Tricks".  The only configuration file mentioned
> on these pages is ~/.emacs.d/notmuch-config.el
>
> And I agree with you that the backtrace reports a Lisp reading error. I
> created an empty ~/.emacs.d/notmuch-config.el, tried to start Notmuch
> and it WORKED.  I could see the beautiful notmuch-hello screen again.
>
> I wanted to make sure it was a steady fix.  I closed all my opened Emacs
> and started them again.  On the first try I got the same *Backtrace*.
> On the second try it worked.  So the fix does not seem too stable.
>
> In one session, does Notmuch en Emacs first try to look at the file in
> ~/.  On another try, does it skip that step and go directly to the
> programme ?  That would also explain why some time ago a small
> change in the file made a difference.  The change in the file would not have made the difference but
> the second try would.  I wonder ?
>
> I am wondering also how come I did not have a the
> ~/.emacs.d/notmuch-config.el Notmuch is trying to read.
>
> In trying to solve the problem I deleted the ~/.notmuch-config file.
> Notmuch produced the message that it was not setup.  I did the command
> "notmuch setup" in a terminal.  It created again the config file that
> starts with the character # and placed it in ~/.
>
> C-h a did not show any setup command inside Emacs, how is the
> notmuch-config.el file created and what goes in it ?  Is it what I put
> about Notmuch in my .emacs file ?


The notmuch-config.el file is created by user; if it exists, notmuch emacs
mua loads it.

The following defines it (no notmuch.el)

(defcustom notmuch-init-file (locate-user-emacs-file "notmuch-config")
 ...)

In this case (locate-user-emacs-file new-file) tries to look notmuch-config
files in user-emacs-directory (being ~/.emacs.d by default).

As an example: when I tried: (locate-user-emacs-file ".zshrc") emacs
printed "~/.emacs.d/.zshrc".

... anyway, whatever the user-emacs-directory is defined the combination
of it and "notmuch-config" cannot resolve to ~/.notmuch-config...

(I tried:
   (setq user-emacs-directory ".")
   (locate-user-emacs-file "zshrc")
 output was "~/zshrc"  -- no . there)


At the end of notmuch.el notmuch-config.el is attempted to be read with

(when init-file-user ; don't load init file if the -q option was used.
  (load notmuch-init-file t t nil t))

load defined as:
  (load FILE &optional NOERROR NOMESSAGE NOSUFFIX MUST-SUFFIX)

which, if I understand(*) correctly, wants the .el or .elc suffix

(*) and understood correctly, 2014-03-29 when I added this feature


The purpose of notmuch-config.el is to put notmuch emacs configuration
so that only those instances of emacs that load notmuch will configure.
Also, notmuch-config.el is loaded *after* notmuch is loaded (so one
can e.g. overwrite functions (which I have done...)).


Tomi


>
> Thank you !
>
>
> Charles

  reply	other threads:[~2021-09-13 21:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13 19:43 Cannot Start Notmuch (invalid-read-syntax "#") Charles-André Roy
2021-09-13 21:32 ` Tomi Ollila [this message]
2021-09-14 12:16   ` David Bremner
2021-09-14 14:47     ` Charles-André Roy
  -- strict thread matches above, loose matches on Subject: below --
2021-09-13 15:43 Charles-André Roy
2021-09-13 16:50 ` David Bremner
2021-09-13  1:37 Charles-André Roy
2021-09-13 11:45 ` David Bremner
2021-09-13 11:51   ` David Bremner

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://notmuchmail.org/

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

  git send-email \
    --in-reply-to=m2lf40p3fs.fsf@guru.guru-group.fi \
    --to=tomi.ollila@iki.fi \
    --cc=caroy47@videotron.ca \
    --cc=david@tethera.net \
    --cc=notmuch@notmuchmail.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://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).