Re: Cannot Start Notmuch (invalid-read-syntax "#")

Subject: Re: Cannot Start Notmuch (invalid-read-syntax "#")

Date: Tue, 14 Sep 2021 00:32:07 +0300

To: Charles-André Roy, David Bremner


From: Tomi Ollila

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

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


> Thank you !
> Charles
notmuch mailing list --
To unsubscribe send an email to