unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Address Completion No Longer Working
@ 2018-03-11 23:33 david wen riccardi-zhu
  2018-03-12 10:23 ` Tomi Ollila
  2018-03-12 10:47 ` David Bremner
  0 siblings, 2 replies; 9+ messages in thread
From: david wen riccardi-zhu @ 2018-03-11 23:33 UTC (permalink / raw)
  To: notmuch

Address completion worked out of the box for me with notmuch and 
Emacs. Recently, it's stopped working. I've tried setting 
notmuch-address-command to internal, as well as toggling 
notmuch-address-toggle-internal-completion, but neither has been 
able to return the functionality.

I am able to get notmuch address to work on the command line.

I use:
Arch Linux X86-64, Kernel 4.15.7-1-ARCH
fish shell
notmuch 0.26
Emacs 25.3.1
company-mode

Any insights on how I might get autocompletion working again?
--
dwrz|朱为文

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

* Re: Address Completion No Longer Working
  2018-03-11 23:33 Address Completion No Longer Working david wen riccardi-zhu
@ 2018-03-12 10:23 ` Tomi Ollila
  2018-03-13  2:17   ` david wen riccardi-zhu
  2018-03-12 10:47 ` David Bremner
  1 sibling, 1 reply; 9+ messages in thread
From: Tomi Ollila @ 2018-03-12 10:23 UTC (permalink / raw)
  To: david wen riccardi-zhu, notmuch

On Sun, Mar 11 2018, david wen riccardi-zhu wrote:

> Address completion worked out of the box for me with notmuch and 
> Emacs. Recently, it's stopped working. I've tried setting 
> notmuch-address-command to internal, as well as toggling 
> notmuch-address-toggle-internal-completion, but neither has been 
> able to return the functionality.
>
> I am able to get notmuch address to work on the command line.
>
> I use:
> Arch Linux X86-64, Kernel 4.15.7-1-ARCH
> fish shell
> notmuch 0.26
> Emacs 25.3.1
> company-mode
>
> Any insights on how I might get autocompletion working again?

Try running emacs -Q to remove the potential effect of your own
configuration files (if you have notmuch cloned you can also
try to execude ./devel/try-emacs-mua to do that).

If problem persists, resend your issue w/ updated information.

Tomi

> --
> dwrz|朱为文

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

* Re: Address Completion No Longer Working
  2018-03-11 23:33 Address Completion No Longer Working david wen riccardi-zhu
  2018-03-12 10:23 ` Tomi Ollila
@ 2018-03-12 10:47 ` David Bremner
  2018-03-12 17:48   ` Tomi Ollila
  2018-03-13  2:11   ` david wen riccardi-zhu
  1 sibling, 2 replies; 9+ messages in thread
From: David Bremner @ 2018-03-12 10:47 UTC (permalink / raw)
  To: david wen riccardi-zhu, notmuch

david wen riccardi-zhu <dwrz@dwrz.net> writes:

> Address completion worked out of the box for me with notmuch and 
> Emacs. Recently, it's stopped working. I've tried setting 
> notmuch-address-command to internal, as well as toggling 
> notmuch-address-toggle-internal-completion, but neither has been 
> able to return the functionality.

"stopped working" usually suggests some configuration change to me. It
would be helpful to know what precisely changed.

As far as debugging, I had two ideas to try.

- try running (notmuch-address-matching "dwrz") in *scratch* (or IELM,
  or M-:) ; this will eliminate company-mode as a suspect, and
  potentially give you a traceback if something is going wrong.

- have a look at the variable notmuch-address-save-filename. Potentially
  set it (back) to nil to disable persistent caching. If that fixes it,
  have a look at the corresponding file, see if something corrupted it.

> I use:
> Arch Linux X86-64, Kernel 4.15.7-1-ARCH
> fish shell

fish breaks lots of assumptions for shells, but I guess you didn't just switch.

> notmuch 0.26

some subtle things changed with respect to starting external processes
in notmuch 0.26; if your recent configuration change was upgrading
notmuch, that might be worth further investigation.

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

* Re: Address Completion No Longer Working
  2018-03-12 10:47 ` David Bremner
@ 2018-03-12 17:48   ` Tomi Ollila
  2018-03-13  2:11   ` david wen riccardi-zhu
  1 sibling, 0 replies; 9+ messages in thread
From: Tomi Ollila @ 2018-03-12 17:48 UTC (permalink / raw)
  To: David Bremner, david wen riccardi-zhu, notmuch

On Mon, Mar 12 2018, David Bremner wrote:

> david wen riccardi-zhu <dwrz@dwrz.net> writes:
>
>> Address completion worked out of the box for me with notmuch and 
>> Emacs. Recently, it's stopped working. I've tried setting 
>> notmuch-address-command to internal, as well as toggling 
>> notmuch-address-toggle-internal-completion, but neither has been 
>> able to return the functionality.
>
> "stopped working" usually suggests some configuration change to me. It
> would be helpful to know what precisely changed.
>
> As far as debugging, I had two ideas to try.
>
> - try running (notmuch-address-matching "dwrz") in *scratch* (or IELM,
>   or M-:) ; this will eliminate company-mode as a suspect, and
>   potentially give you a traceback if something is going wrong.
>
> - have a look at the variable notmuch-address-save-filename. Potentially
>   set it (back) to nil to disable persistent caching. If that fixes it,
>   have a look at the corresponding file, see if something corrupted it.
>
>> I use:
>> Arch Linux X86-64, Kernel 4.15.7-1-ARCH
>> fish shell
>
> fish breaks lots of assumptions for shells, but I guess you didn't just
> switch.

Notmuch Emacs MUA should not rely using any particular $SHELL in any case.
It still uses amdragon's brilliant 
"/bin/sh" "-c" "exec 2>\"$1\"; shift; exec \"$0\" \"$@\"" before emacs 25
and according to make-process' docstring it doesn't use shell (either)...

Also, I tested

$ SHELL=/bin/false ./devel/try-emacs-mua -q

and tried (built-in!) address completion (slow >;), and it worked fine.

>> notmuch 0.26
>
> some subtle things changed with respect to starting external processes
> in notmuch 0.26; if your recent configuration change was upgrading
> notmuch, that might be worth further investigation.

If that is (finally) the case, I'd be interested to know.

Tomi

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

* Re: Address Completion No Longer Working
  2018-03-12 10:47 ` David Bremner
  2018-03-12 17:48   ` Tomi Ollila
@ 2018-03-13  2:11   ` david wen riccardi-zhu
  2018-03-15  2:00     ` David Bremner
  1 sibling, 1 reply; 9+ messages in thread
From: david wen riccardi-zhu @ 2018-03-13  2:11 UTC (permalink / raw)
  To: David Bremner, notmuch

Thanks so much for your time and the suggestions.

> - try running (notmuch-address-matching "dwrz") in *scratch* (or 
> IELM, 
>   or M-:) ; this will eliminate company-mode as a suspect, and 
>   potentially give you a traceback if something is going wrong. 

I can confirm this works in IELM and M-:.

> - have a look at the variable notmuch-address-save-filename. 
> Potentially 
>   set it (back) to nil to disable persistent caching. If that 
>   fixes it, have a look at the corresponding file, see if 
>   something corrupted it.

This was not set to anything, but set or unset, it seems to make 
no difference.

What does seem to make a difference is toggling 
notmuch-address-use-company. Without it, tab completion seems to 
work in message mode, although it's not very useful. With it on, I 
get no completion.

Is what I'm seeing potentially a misconfiguration, or bug in 
company-mode?

The last customizations I made to my init was editing my 
text-mode-hook (where I did specify some company-backends) and 
then just some minor counsel and ripgrep related changes. I 
haven't touched my notmuch-related config in some time. However I 
don't have my init under version control, and it is a mess, so 
perhaps I'm missing something. : ( FWIW, fish is also not a recent 
development.

David Bremner <david@tethera.net> writes:

> david wen riccardi-zhu <dwrz@dwrz.net> writes: 
> 
>> Address completion worked out of the box for me with notmuch 
>> and Emacs. Recently, it's stopped working. I've tried setting 
>> notmuch-address-command to internal, as well as toggling 
>> notmuch-address-toggle-internal-completion, but neither has 
>> been able to return the functionality. 
> 
> "stopped working" usually suggests some configuration change to 
> me. It would be helpful to know what precisely changed. 
> 
> As far as debugging, I had two ideas to try. 
> 
> - try running (notmuch-address-matching "dwrz") in *scratch* (or 
> IELM, 
>   or M-:) ; this will eliminate company-mode as a suspect, and 
>   potentially give you a traceback if something is going wrong. 
> 
> - have a look at the variable notmuch-address-save-filename. 
> Potentially 
>   set it (back) to nil to disable persistent caching. If that 
>   fixes it, have a look at the corresponding file, see if 
>   something corrupted it. 
> 
>> I use: Arch Linux X86-64, Kernel 4.15.7-1-ARCH fish shell 
> 
> fish breaks lots of assumptions for shells, but I guess you 
> didn't just switch. 
> 
>> notmuch 0.26 
> 
> some subtle things changed with respect to starting external 
> processes in notmuch 0.26; if your recent configuration change 
> was upgrading notmuch, that might be worth further 
> investigation. 
> 

--
dwrz|朱为文

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

* Re: Address Completion No Longer Working
  2018-03-12 10:23 ` Tomi Ollila
@ 2018-03-13  2:17   ` david wen riccardi-zhu
  0 siblings, 0 replies; 9+ messages in thread
From: david wen riccardi-zhu @ 2018-03-13  2:17 UTC (permalink / raw)
  To: Tomi Ollila, notmuch

Thanks, Tomi. So far, I can confirm that completion works with 
emacs -Q, but not with company. I'm looking into that more now.

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

> On Sun, Mar 11 2018, david wen riccardi-zhu wrote: 
> 
>> Address completion worked out of the box for me with notmuch 
>> and Emacs. Recently, it's stopped working. I've tried setting 
>> notmuch-address-command to internal, as well as toggling 
>> notmuch-address-toggle-internal-completion, but neither has 
>> been able to return the functionality. 
>> 
>> I am able to get notmuch address to work on the command line. 
>> 
>> I use: Arch Linux X86-64, Kernel 4.15.7-1-ARCH fish shell 
>> notmuch 0.26 Emacs 25.3.1 company-mode 
>> 
>> Any insights on how I might get autocompletion working again? 
> 
> Try running emacs -Q to remove the potential effect of your own 
> configuration files (if you have notmuch cloned you can also try 
> to execude ./devel/try-emacs-mua to do that). 
> 
> If problem persists, resend your issue w/ updated information. 
> 
> Tomi 
> 
>> -- dwrz|朱为文 

--
dwrz|朱为文

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

* Re: Address Completion No Longer Working
  2018-03-13  2:11   ` david wen riccardi-zhu
@ 2018-03-15  2:00     ` David Bremner
  2018-03-16  2:12       ` david wen riccardi-zhu
  0 siblings, 1 reply; 9+ messages in thread
From: David Bremner @ 2018-03-15  2:00 UTC (permalink / raw)
  To: david wen riccardi-zhu, notmuch

[-- Attachment #1: Type: text/plain, Size: 731 bytes --]

david wen riccardi-zhu <dwrz@dwrz.net> writes:

>
> Is what I'm seeing potentially a misconfiguration, or bug in 
> company-mode?
>
> The last customizations I made to my init was editing my 
> text-mode-hook (where I did specify some company-backends) and 
> then just some minor counsel and ripgrep related changes. I 
> haven't touched my notmuch-related config in some time. However I 
> don't have my init under version control, and it is a mess, so 
> perhaps I'm missing something. : ( FWIW, fish is also not a recent 
> development.

The obvious thing to try is try-emacs-mua script from the source
(attached)

This will let you use company without any of your personal
configuration. Run as e.g. "sh ./try-emacs-mua -q"



[-- Attachment #2: try-emacs-mua --]
[-- Type: application/octet-stream, Size: 6093 bytes --]

#!/bin/sh
:; set -x; exec "${EMACS:-emacs}" --debug-init --load "$0" "$@"; exit
;;
;; Try the notmuch emacs client located in ../emacs/ directory
;;
;; Run this without arguments; emacs window opens with some usage information
;;
;; Authors: Tomi Ollila <tomi.ollila@iki.fi>
;;
;; https://www.emacswiki.org/emacs/EmacsScripts was a useful starting point...
;;
;; Licence: GPLv3+
;;

(message "Starting '%s'" load-file-name)

(set-buffer "*scratch*")

(setq initial-buffer-choice nil
      inhibit-startup-screen t)

(when (featurep 'notmuch)
  (insert "
Notmuch has been loaded to this emacs (during processing of the init file)
which means it is (most probably) loaded from different source than expected.

Please run \"" (file-name-nondirectory load-file-name)
"\" with '-q' (or '-Q') as an argument, to disable
processing of the init file -- you can load it after emacs has started\n
exit emacs (y or n)? ")
  (if (y-or-n-p "exit emacs")
      (kill-emacs)
    (error "Stopped reading %s" load-file-name)))

(let ((pdir (file-name-directory
	     (directory-file-name (file-name-directory load-file-name)))))
  (unless (file-exists-p (concat pdir "emacs/notmuch-lib.el"))
    (insert "Cannot find notmuch-emacs source directory
while looking at: " pdir "emacs\n\nexit emacs (y or n)? ")
    (if (y-or-n-p "exit emacs")
	(kill-emacs)
      (error "Stopped reading %s" load-file-name)))
  (setq try-notmuch-source-directory (directory-file-name pdir)
	try-notmuch-emacs-directory (concat pdir "emacs/")
	load-path (cons try-notmuch-emacs-directory load-path)))

;; they say advice doesn't work for primitives (functions from c source)
;; well, these 'before' advice works for emacs 23.1 - 24.5 (at least)
;; ...and for our purposes 24.3 is enough (there is no load-prefer-newer there)
;; note also that the old, "obsolete" defadvice mechanism was used, but that
;; is the only one available for emacs 23 and 24 up to 24.3.

(if (boundp 'load-prefer-newer)
    (defadvice require (before before-require activate)
      (unless (featurep feature)
	(message "require: %s" feature)))
  ;; else: special require "short-circuit"; after load feature is provided...
  ;; ... in notmuch sources we always use require and there are no loops
  (defadvice require (before before-require activate)
    (unless (featurep feature)
      (message "require: %s" feature)
      (let ((name (symbol-name feature)))
	(if (and (string-match "^notmuch" name)
		 (file-newer-than-file-p
		  (concat try-notmuch-emacs-directory name ".el")
		  (concat try-notmuch-emacs-directory name ".elc")))
	    (load (concat try-notmuch-emacs-directory name ".el") nil nil t t)
	  )))))

(insert "Found notmuch emacs client in " try-notmuch-emacs-directory "\n")

(let ((notmuch-path (executable-find "notmuch")))
  (insert "Notmuch CLI executable "
	  (if notmuch-path (concat "is " notmuch-path) "not found!") "\n"))

(condition-case err
;; "opportunistic" load-prefer-newer -- will be effective since emacs 24.4
    (let ((load-prefer-newer t)
	  (force-load-messages t))
      (require 'notmuch))
  ;; specifying `debug' here lets the debugger run
  ;; if `debug-on-error' is non-nil.
  ((debug error)
   (let ((error-message-string (error-message-string err)))
     (insert "\nLoading notmuch failed: " error-message-string "\n")
     (message "Loading notmuch failed: %s" error-message-string)
     (insert "See *Messages* buffer for more information.\n")
     (if init-file-user
	 (message "Hint: %s -q (or -Q) may help" load-file-name))
     (pop-to-buffer "*Messages*")
     (error "Stopped reading %s" load-file-name))))

(insert "
Go to the end of the following lines and type C-x C-e to evaluate
(or C-j which is shorter but inserts evaluation results into buffer)

To \"disable\" mail sending, evaluate
* (setq message-send-mail-function (lambda () t))
")

(if (file-exists-p (concat try-notmuch-source-directory "/notmuch"))
    (insert "
To use accompanied notmuch binary from the same source, evaluate
* (setq exec-path (cons \"" try-notmuch-source-directory  "\" exec-path))
Note: Evaluating the above may be followed by unintended database
upgrade and getting back to old version may require dump & restore.
"))

(if init-file-user ;; nil, if '-q' or '-Q' is given, but no '-u' 'USER'
    (insert "
Your init file was processed during emacs startup. If you want to test
notmuch emacs mail client without your emacs init file interfering, Run\n\""
(file-name-nondirectory load-file-name) "\" with '-q' (or '-Q') as an argument.
")
  (let ((emacs-init-file-name) (notmuch-init-file-name))
    ;; determining init file name in startup.el/command-line is too complicated
    ;; to be duplicated here; these 3 file names covers most of the users
    (mapc (lambda (fn) (if (file-exists-p fn) (setq emacs-init-file-name fn)))
	  '("~/.emacs.d/init.el" "~/.emacs" "~/.emacs.el"))
    (setq notmuch-init-file-name "~/.emacs.d/notmuch-config.el")
    (unless (file-exists-p notmuch-init-file-name)
	(setq notmuch-init-file-name nil))
    (if (and emacs-init-file-name notmuch-init-file-name)
	(insert "
If you want to load your initialization files now, evaluate\n* (progn")
      (if (or emacs-init-file-name notmuch-init-file-name)
	  (insert "
If you want to load your initialization file now, evaluate\n*")))
    (if emacs-init-file-name
	(insert " (load \"" emacs-init-file-name "\")"))
    (if notmuch-init-file-name
	(insert " (load \"" notmuch-init-file-name "\")"))
    (if (and emacs-init-file-name notmuch-init-file-name)
	(insert ")"))
    (if (or emacs-init-file-name notmuch-init-file-name)
	(insert "\n")))
  (if (>= emacs-major-version 24)
      (insert "
If you want to use packages (e.g. company from elpa) evaluate
* (progn (require 'package) (package-initialize))
")))

(insert "
To start notmuch (hello) screen, evaluate
* (notmuch-hello)")

(add-hook 'emacs-startup-hook
	  (lambda ()
	    (with-current-buffer "*scratch*"
	      (lisp-interaction-mode)
	      (goto-char (point-min))
	      (forward-line 2)
	      (set-buffer-modified-p nil))))

;; Local Variables:
;; mode: emacs-lisp
;; End:

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

* Re: Address Completion No Longer Working
  2018-03-15  2:00     ` David Bremner
@ 2018-03-16  2:12       ` david wen riccardi-zhu
  2018-03-16 11:06         ` David Bremner
  0 siblings, 1 reply; 9+ messages in thread
From: david wen riccardi-zhu @ 2018-03-16  2:12 UTC (permalink / raw)
  To: David Bremner, notmuch

Hi David,

My apologies if I am missing something obvious, but I'm getting 
the following:

Cannot find notmuch-emacs source directory

I've tried running the script from both my home directory and my 
.emacs.d. The script states:

;; Try the notmuch emacs client located in ../emacs/ directory

I'm not sure which directory this is referring to.

Thanks again for your time!
David

David Bremner <david@tethera.net> writes:

> david wen riccardi-zhu <dwrz@dwrz.net> writes: 
> 
>> 
>> Is what I'm seeing potentially a misconfiguration, or bug in 
>> company-mode? 
>> 
>> The last customizations I made to my init was editing my 
>> text-mode-hook (where I did specify some company-backends) and 
>> then just some minor counsel and ripgrep related changes. I 
>> haven't touched my notmuch-related config in some time. However 
>> I don't have my init under version control, and it is a mess, 
>> so perhaps I'm missing something. : ( FWIW, fish is also not a 
>> recent development. 
> 
> The obvious thing to try is try-emacs-mua script from the source 
> (attached) 
> 
> This will let you use company without any of your personal 
> configuration. Run as e.g. "sh ./try-emacs-mua -q" 
>  

--
dwrz|朱为文

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

* Re: Address Completion No Longer Working
  2018-03-16  2:12       ` david wen riccardi-zhu
@ 2018-03-16 11:06         ` David Bremner
  0 siblings, 0 replies; 9+ messages in thread
From: David Bremner @ 2018-03-16 11:06 UTC (permalink / raw)
  To: david wen riccardi-zhu, notmuch

david wen riccardi-zhu <dwrz@dwrz.net> writes:

> Hi David,
>
> My apologies if I am missing something obvious, but I'm getting 
> the following:
>
> Cannot find notmuch-emacs source directory
>
> I've tried running the script from both my home directory and my 
> .emacs.d. The script states:
>
> ;; Try the notmuch emacs client located in ../emacs/ directory
>

I guess you need an unpacked copy of the source to run this. Sorry, I
didn't think that through.

d

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

end of thread, other threads:[~2018-03-16 11:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-11 23:33 Address Completion No Longer Working david wen riccardi-zhu
2018-03-12 10:23 ` Tomi Ollila
2018-03-13  2:17   ` david wen riccardi-zhu
2018-03-12 10:47 ` David Bremner
2018-03-12 17:48   ` Tomi Ollila
2018-03-13  2:11   ` david wen riccardi-zhu
2018-03-15  2:00     ` David Bremner
2018-03-16  2:12       ` david wen riccardi-zhu
2018-03-16 11:06         ` 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).