unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Cannot Start Notmuch (invalid-read-syntax "#")
@ 2021-09-13  1:37 Charles-André Roy
  2021-09-13 11:45 ` David Bremner
  0 siblings, 1 reply; 9+ messages in thread
From: Charles-André Roy @ 2021-09-13  1:37 UTC (permalink / raw)
  To: notmuch

Hi,

I am using Debian.  I recently installed Bullseye with Emacs 27.1.  Now
I cannot start Notmuch in emacs anymore.  I can download my mail and
send them.  The commands in the terminal work as usual.

At first I would open the .notmuch-config file and make a little change
in the buffer than cancel that change and save the file and Notmuch
would start.  Now it does not start anymore.

I also have a problem with "cl library deprecated" but judging from my
searches on the Web this would be a different issue.

I tried changing the coding system of .notmuch-config but that did not
change the situation.

In my .emacs file I moved up the line

(autoload 'notmuch "notmuch" "notmuch mail" t)

close to the beginning but there was no change.

Any suggestions ?


Charles




Debugger entered--Lisp error: (invalid-read-syntax "#")
  read(#<buffer  *load*>)
  eval-buffer(#<buffer  *load*> nil "/home/charles/.notmuch-config" nil t)  ; Reading at buffer position 2
  load-with-code-conversion("/home/charles/.notmuch-config" "/home/charles/.notmuch-config" t t)
  load("~/.notmuch-config" t t nil t)
  byte-code("\303\20\304\305!\210\11\203\22\0\306\n\307\211\310\307%\210\310\207" [mail-user-agent init-file-user notmuch-init-file notmuch-user-agent provide notmuch load t nil] 6)
  autoload-do-load((autoload "notmuch" "notmuch mail" t nil) notmuch)
  command-execute(notmuch record)
  execute-extended-command(nil "notmuch")
  smex-read-and-run(("notmuch" "byte-compile-file" "package-delete" "list-packages" "man" "shell" "package-list-packages" "eshell" "nomPrenom" "spam" "battery" "olivetti-mode" "lbdb" "locate" "widen" "replace-string" "info" "emojify-mode" "count-matches" "séparateur" "eww" "calendar" "query-replace" "emms" "Info-menu" "now" "org-sort" "goto-char" "lisp-interaction-mode" "car--nettoyerFicheCarnetAdresses" "abbrev-mode" "sunrise-sunset" "insert-kbd-macro" "tramp-unload-tramp" "pdf-tools-customize" "org-element-update-syntax" "customize" "suiviPortions" "package-autoremove" "transient-mark-mode" "variable-pitch-mode" "term" "dired" "compile" "bookmark-set" "lunar-phases" "bookmark-save" "epa-list-keys" "2C-two-columns" "pdf-tools-help" ...))
  smex()
  funcall-interactively(smex)
  call-interactively(smex nil nil)
  command-execute(smex)

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

* Re: Cannot Start Notmuch (invalid-read-syntax "#")
  2021-09-13  1:37 Cannot Start Notmuch (invalid-read-syntax "#") Charles-André Roy
@ 2021-09-13 11:45 ` David Bremner
  2021-09-13 11:51   ` David Bremner
  0 siblings, 1 reply; 9+ messages in thread
From: David Bremner @ 2021-09-13 11:45 UTC (permalink / raw)
  To: Charles-André Roy, notmuch

Charles-André Roy <caroy47@videotron.ca> writes:

> I am using Debian.  I recently installed Bullseye with Emacs 27.1.  Now
> I cannot start Notmuch in emacs anymore.  I can download my mail and
> send them.  The commands in the terminal work as usual.

How is notmuch installed? Have you installed both CLI and emacs
front-end from source?

> I also have a problem with "cl library deprecated" but judging from my
> searches on the Web this would be a different issue.

I don't think those messages are notmuch related, since (current)
notmuch uses cl the "modern" way by requiring cl-lib. One possibility is
old .elc files. 

> Debugger entered--Lisp error: (invalid-read-syntax "#")
>   read(#<buffer  *load*>)
>   eval-buffer(#<buffer  *load*> nil "/home/charles/.notmuch-config" nil t)  ; Reading at buffer position 2
>   load-with-code-conversion("/home/charles/.notmuch-config" "/home/charles/.notmuch-config" t t)
>   load("~/.notmuch-config" t t nil t)

The emacs function load is for lisp files. $HOME/.notmuch-config is an
INI style config file, which does indeed have many '#' in it by
default. Why emacs is trying to run .notmuch-config as lisp is currently
a mystery to me.

>   byte-code("\303\20\304\305!\210\11\203\22\0\306\n\307\211\310\307%\210\310\207" [mail-user-agent init-file-user notmuch-init-file notmuch-user-agent provide notmuch load t nil] 6)
>   autoload-do-load((autoload "notmuch" "notmuch mail" t nil) notmuch)
>   command-execute(notmuch record)
>   execute-extended-command(nil "notmuch")
>   smex-read-and-run(("notmuch" "byte-compile-file" "package-delete" "list-packages" "man" "shell" "package-list-packages" "eshell" "nomPrenom" "spam" "battery" "olivetti-mode" "lbdb" "locate" "widen" "replace-string" "info" "emojify-mode" "count-matches" "séparateur" "eww" "calendar" "query-replace" "emms" "Info-menu" "now" "org-sort" "goto-char" "lisp-interaction-mode" "car--nettoyerFicheCarnetAdresses" "abbrev-mode" "sunrise-sunset" "insert-kbd-macro" "tramp-unload-tramp" "pdf-tools-customize" "org-element-update-syntax" "customize" "suiviPortions" "package-autoremove" "transient-mark-mode" "variable-pitch-mode" "term" "dired" "compile" "bookmark-set" "lunar-phases" "bookmark-save" "epa-list-keys" "2C-two-columns" "pdf-tools-help" ...))
>   smex()
>   funcall-interactively(smex)
>   call-interactively(smex nil nil)
>   command-execute(smex)

To narrow things down, can you try without smex? It's probably not the
issue, but it might simplify the backtrace.

David

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

* Re: Cannot Start Notmuch (invalid-read-syntax "#")
  2021-09-13 11:45 ` David Bremner
@ 2021-09-13 11:51   ` David Bremner
  0 siblings, 0 replies; 9+ messages in thread
From: David Bremner @ 2021-09-13 11:51 UTC (permalink / raw)
  To: Charles-André Roy, notmuch

David Bremner <david@tethera.net> writes:

>> Debugger entered--Lisp error: (invalid-read-syntax "#")
>>   read(#<buffer  *load*>)
>>   eval-buffer(#<buffer  *load*> nil "/home/charles/.notmuch-config" nil t)  ; Reading at buffer position 2
>>   load-with-code-conversion("/home/charles/.notmuch-config" "/home/charles/.notmuch-config" t t)
>>   load("~/.notmuch-config" t t nil t)
>
> The emacs function load is for lisp files. $HOME/.notmuch-config is an
> INI style config file, which does indeed have many '#' in it by
> default. Why emacs is trying to run .notmuch-config as lisp is currently
> a mystery to me.

Oh, I might know what is happening. notmuch-emacs is trying to load
.notmuch-config.el, and you (maybe?) have $HOME in your emacs load-path.
I guess I would pretty strongly recommmend not having $HOME in your
emacs load-path (at least I just end up with random files in my $HOME).
If it's important to you to have $HOME in your load-path, you can use
the XDG location for your config file: put it in
$HOME/.config/notmuch/default/config.

d

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

* Re: Cannot Start Notmuch (invalid-read-syntax "#")
@ 2021-09-13 15:43 Charles-André Roy
  2021-09-13 16:50 ` David Bremner
  0 siblings, 1 reply; 9+ messages in thread
From: Charles-André Roy @ 2021-09-13 15:43 UTC (permalink / raw)
  To: David Bremner; +Cc: notmuch

Hello David,

Thank you for your responses !

1. I looked at the load-path variable and the $HOME directory per se is
not in it.  There are many directories in $HOME/.emacs.d leading to
packages I have installed.

2. I installed notmuch-emacs through the Debian packages
apt list gives notmuch-emacs/now 0.28.4-1 all  [installé, local]
apt list also gives notmuch/stable,now 0.31.4-2 amd64  [installé]

3. After an updatedb I did a locate command and there is no
.notmuch-config.el file on my system.

4. Here is the backtrace of the M-notmuch command with smex turned off.
It is shorter.

==============================

Debugger entered--Lisp error: (invalid-read-syntax "#")
  read(#<buffer  *load*>)
  eval-buffer(#<buffer  *load*> nil "/home/charles/.notmuch-config" nil t)  ; Reading at buffer position 2
  load-with-code-conversion("/home/charles/.notmuch-config" "/home/charles/.notmuch-config" t t)
  load("~/.notmuch-config" t t nil t)
  byte-code("\303\20\304\305!\210\11\203\22\0\306\n\307\211\310\307%\210\310\207" [mail-user-agent init-file-user notmuch-init-file notmuch-user-agent provide notmuch load t nil] 6)
  autoload-do-load((autoload "notmuch" "notmuch mail" t nil) notmuch)
  command-execute(notmuch record)
  execute-extended-command(nil "notmuch" "notmuch")
  funcall-interactively(execute-extended-command nil "notmuch" "notmuch")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

==============================

Regards,


Charles


Date: Mon, 13 Sep 2021 08:51:04 -0300
\fheader}
\fbody{
\fpart{ ID: 1, Content-type: text/plain
David Bremner <david@tethera.net> writes:

>> Debugger entered--Lisp error: (invalid-read-syntax "#")
>>   read(#<buffer  *load*>)
>>   eval-buffer(#<buffer  *load*> nil "/home/charles/.notmuch-config" nil t)  ; Reading at buffer position 2
>>   load-with-code-conversion("/home/charles/.notmuch-config" "/home/charles/.notmuch-config" t t)
>>   load("~/.notmuch-config" t t nil t)
>
> The emacs function load is for lisp files. $HOME/.notmuch-config is an
> INI style config file, which does indeed have many '#' in it by
> default. Why emacs is trying to run .notmuch-config as lisp is currently
> a mystery to me.

Oh, I might know what is happening. notmuch-emacs is trying to load
.notmuch-config.el, and you (maybe?) have $HOME in your emacs load-path.
I guess I would pretty strongly recommmend not having $HOME in your
emacs load-path (at least I just end up with random files in my $HOME).
If it's important to you to have $HOME in your load-path, you can use
the XDG location for your config file: put it in
$HOME/.config/notmuch/default/config.

d

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

* Re: Cannot Start Notmuch (invalid-read-syntax "#")
  2021-09-13 15:43 Charles-André Roy
@ 2021-09-13 16:50 ` David Bremner
  0 siblings, 0 replies; 9+ messages in thread
From: David Bremner @ 2021-09-13 16:50 UTC (permalink / raw)
  To: Charles-André Roy; +Cc: notmuch

Charles-André Roy <caroy47@videotron.ca> writes:

> Hello David,
>
> Thank you for your responses !
>
> 1. I looked at the load-path variable and the $HOME directory per se is
> not in it.  There are many directories in $HOME/.emacs.d leading to
> packages I have installed.
>
> 2. I installed notmuch-emacs through the Debian packages
> apt list gives notmuch-emacs/now 0.28.4-1 all  [installé, local]

That is quite old (from buster I guess?). Can you try elpa-notmuch 0.31.4-2
from bullseye?  That version you have of notmuch-emacs should be a dummy package
depending on elpa-notmuch, so safe to remove.

> apt list also gives notmuch/stable,now 0.31.4-2 amd64  [installé]

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

* Re: Cannot Start Notmuch (invalid-read-syntax "#")
@ 2021-09-13 19:43 Charles-André Roy
  2021-09-13 21:32 ` Tomi Ollila
  0 siblings, 1 reply; 9+ messages in thread
From: Charles-André Roy @ 2021-09-13 19:43 UTC (permalink / raw)
  To: David Bremner; +Cc: notmuch

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 ?

Thank you !


Charles





David Bremner <david@tethera.net> (Today 12:50) (inbox unread)
Subject: Re: Cannot Start Notmuch (invalid-read-syntax "#")
From: David Bremner <david@tethera.net>
To: Charles-André Roy <caroy47@videotron.ca>
Cc: notmuch@notmuchmail.org
Date: Mon, 13 Sep 2021 13:50:22 -0300
\fheader}
\fbody{
\fpart{ ID: 1, Content-type: text/plain
Charles-André Roy <caroy47@videotron.ca> writes:

> Hello David,
>
> Thank you for your responses !
>
> 1. I looked at the load-path variable and the $HOME directory per se is
> not in it.  There are many directories in $HOME/.emacs.d leading to
> packages I have installed.
>
> 2. I installed notmuch-emacs through the Debian packages
> apt list gives notmuch-emacs/now 0.28.4-1 all  [installé, local]

That is quite old (from buster I guess?). Can you try elpa-notmuch 0.31.4-2
from bullseye?  That version you have of notmuch-emacs should be a dummy package
depending on elpa-notmuch, so safe to remove.

> apt list also gives notmuch/stable,now 0.31.4-2 amd64  [installé]\r

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

* Re: Cannot Start Notmuch (invalid-read-syntax "#")
  2021-09-13 19:43 Charles-André Roy
@ 2021-09-13 21:32 ` Tomi Ollila
  2021-09-14 12:16   ` David Bremner
  0 siblings, 1 reply; 9+ messages in thread
From: Tomi Ollila @ 2021-09-13 21:32 UTC (permalink / raw)
  To: Charles-André Roy, David Bremner; +Cc: notmuch

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

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

* Re: Cannot Start Notmuch (invalid-read-syntax "#")
  2021-09-13 21:32 ` Tomi Ollila
@ 2021-09-14 12:16   ` David Bremner
  2021-09-14 14:47     ` Charles-André Roy
  0 siblings, 1 reply; 9+ messages in thread
From: David Bremner @ 2021-09-14 12:16 UTC (permalink / raw)
  To: Tomi Ollila, Charles-André Roy; +Cc: notmuch

Tomi Ollila <tomi.ollila@iki.fi> writes:

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

A few more questions based on Tomi's experiments / observations.

1) Can you try starting "emacs -q", then evaluate "(require 'notmuch)" in
   *scratch*.  If notmuch starts after this we have confirmed it is
   something specific to your emacs configuration. The usual approach is
   then to bisect your init.el

2) Check in .emacs.d/elpa for any residual notmuch-* directories

\r

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

* Re: Cannot Start Notmuch (invalid-read-syntax "#")
  2021-09-14 12:16   ` David Bremner
@ 2021-09-14 14:47     ` Charles-André Roy
  0 siblings, 0 replies; 9+ messages in thread
From: Charles-André Roy @ 2021-09-14 14:47 UTC (permalink / raw)
  To: David Bremner, Tomi Ollila; +Cc: notmuch

Hello David,

It worked.  Problem solved.  I have tried twice to make sure and both
times it did work.

Tomi Ollila's message was very helpful, even if it was a bit too
technical for me.  It made me understand the difference between
~/.notmuch-config and ~/.emacs.d/notmuch-config.el.  I also reread the
Web pages more carefully.

This morning I thought I must have specified somewhere that
~/.notmuch-config is the configuration file for Emacs.  I looked in M-x
customize and did not find anything there.  I thought about my init.file
but your message came in before I had the chance to look at it.

I did what you suggested, emacs -q, and notmuch started immeidiately.

I then went in my .emacs file and did a search for .notmuch-config.  I
found it as the notmuch-init-file.  I changed that variable to
~/.emacs.d/notmuch-config.el and that has done the job.

Thank you so much David and Tomi for your support and patience to deal
with basic questions like the one I had.  But as you well know, even a
basic question can paralyze your system.

Best regards,


Charles




Le mar, 14 sep 2021, à 09:16, David Bremner <david@tethera.net> a écrit
:
> Tomi Ollila <tomi.ollila@iki.fi> writes:
>
>> 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.
>>>
>>
>> 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")
>>  ...)
>
> A few more questions based on Tomi's experiments / observations.
>
> 1) Can you try starting "emacs -q", then evaluate "(require 'notmuch)" in
>    *scratch*.  If notmuch starts after this we have confirmed it is
>    something specific to your emacs configuration. The usual approach is
>    then to bisect your init.el
>
> 2) Check in .emacs.d/elpa for any residual notmuch-* directories

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

end of thread, other threads:[~2021-09-14 14:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-13  1:37 Cannot Start Notmuch (invalid-read-syntax "#") Charles-André Roy
2021-09-13 11:45 ` David Bremner
2021-09-13 11:51   ` David Bremner
  -- 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 19:43 Charles-André Roy
2021-09-13 21:32 ` Tomi Ollila
2021-09-14 12:16   ` David Bremner
2021-09-14 14:47     ` Charles-André Roy

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