Re: [PATCH] test: Unset ALTERNATE_EDITOR before running emacsclient

2015-12-28 Thread Tomi Ollila
On Mon, Dec 28 2015, Michal Sojka  wrote:

> ALTERNATE_EDITOR causes emacsclient to run an alternate editor if the
> emacs server is not ready. This can collide with intended
> functionality in test-lib.sh.
>
> If the ALTERNATE_EDITOR is set but empty, emacsclient runs emacs
> daemon and tries to connect to it. When this happens the emacs run by
> test-lib.sh fails to start the server and the subsequent attempts to
> use the server fail because the daemon started by emacsclient does not
> know about notmuch-test-progn. This leads to test suite failure due to
> time out on any emacs test.
> ---

Looks good to me -- just that should the unsetting be done in the same
place as (most) other environment variables are handled... in the
region starting from line 64 of that same file.

Tomi


>  test/test-lib.sh | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/test/test-lib.sh b/test/test-lib.sh
> index 126911f..0f6a6cf 100644
> --- a/test/test-lib.sh
> +++ b/test/test-lib.sh
> @@ -1152,6 +1152,7 @@ test_emacs () {
>   rm -f OUTPUT
>   touch OUTPUT
>  
> + unset ALTERNATE_EDITOR
>   ${TEST_EMACSCLIENT} --socket-name="$EMACS_SERVER" --eval 
> "(notmuch-test-progn $@)"
>  }
>  
> -- 
> 2.6.4
>
> ___
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] test: Unset ALTERNATE_EDITOR before running emacsclient

2015-12-28 Thread Michal Sojka
ALTERNATE_EDITOR causes emacsclient to run an alternate editor if the
emacs server is not ready. This can collide with intended
functionality in test-lib.sh.

If the ALTERNATE_EDITOR is set but empty, emacsclient runs emacs
daemon and tries to connect to it. When this happens the emacs run by
test-lib.sh fails to start the server and the subsequent attempts to
use the server fail because the daemon started by emacsclient does not
know about notmuch-test-progn. This leads to test suite failure due to
time out on any emacs test.
---
 test/test-lib.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/test/test-lib.sh b/test/test-lib.sh
index 126911f..0f6a6cf 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -1152,6 +1152,7 @@ test_emacs () {
rm -f OUTPUT
touch OUTPUT
 
+   unset ALTERNATE_EDITOR
${TEST_EMACSCLIENT} --socket-name="$EMACS_SERVER" --eval 
"(notmuch-test-progn $@)"
 }
 
-- 
2.6.4

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] emacs: address completion, allow sender/recipient and filters

2015-12-28 Thread Michal Sojka
Hi Mark,

I tried this patch. When I set the variable to 'received, first
completion candidates are generated incorrectly. The query looked as
"(to:sojk...@fel.cvut.cz) and (to:prefix*)". It should be "...
(from:prefix*)". This "to:" comes from notmuch-address-options or from
notmuch-company so these should be changes as well.

Other minor comments are below.

Thanks.
-Michal

On Sun, Dec 20 2015, Mark Walters wrote:
> This commit lets the user customize the address completion.
>
> The first change controls whether to build the address completion list
> based on messages you have sent or you have received (the latter is
> much faster).
>
> The second change add a possible filter query to limit the messages
> used -- for example, setting this to date:1y..  would limit the
> address completions to addresses used in the last year. This speeds up
> the address harvest and may also make the search less cluttered as old
> addresses may well no longer be valid.
> ---
>
> There was some discussion on irc about the address completion harvest
> taking a long time. This patch makes is possible to tune this
> behaviour. It may be that this complicates the customize variable too
> much -- but if nothing else its a patch that anyone who experiences
> problems can try.
>
> Best wishes
>
> Mark
>
> emacs/notmuch-address.el | 64 +---
>  1 file changed, 44 insertions(+), 20 deletions(-)
>
> diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
> index 49e2402..8942fe4 100644
> --- a/emacs/notmuch-address.el
> +++ b/emacs/notmuch-address.el
> @@ -26,15 +26,40 @@
>  ;;
>  (declare-function company-manual-begin "company")
>
> +(defvar notmuch-address-last-harvest 0
> +  "Time of last address harvest")
> +
> +(defvar notmuch-address-completions (make-hash-table :test 'equal)
> +  "Hash of email addresses for completion during email composition.
> +  This variable is set by calling `notmuch-address-harvest'.")
> +
> +(defvar notmuch-address-full-harvest-finished nil
> +  "t indicates that full completion address harvesting has been
> +finished")
> +
>  (defcustom notmuch-address-command 'internal

Default value should be changed to something matching the :type. Perhaps
'(sent nil).

>"The command which generates possible addresses. It must take a
>  single argument and output a list of possible matches, one per
>  line. The default value of `internal' uses built-in address
>  completion."

Doc text can be updated as well.

>:type '(radio
> -   (const :tag "Use internal address completion" internal)
> +   (list :tag "Use internal address completion"
> + (radio
> +  :tag "Build list based on messages you have"
> +  :value sent
> +  (const :tag "sent" sent)
> +  (const :tag "received" received))

I would mention that received is faster here.

> + (radio :tag "Filter messages used for completion"
> +(const :tag "Use all messages" nil)
> +(string :tag "Filter query")))
> (const :tag "Disable address completion" nil)
> -   (string :tag "Use external completion command" "notmuch-addresses"))
> +   (string :tag "Use external completion command"))
> +  ;; We override set so that we can clear the cache when this changes
> +  :set (lambda (symbol value)
> +  (set-default symbol value)
> +  (setq notmuch-address-last-harvest 0)
> +  (setq notmuch-address-completions (clrhash 
> notmuch-address-completions))
> +  (setq notmuch-address-full-harvest-finished nil))
>:group 'notmuch-send
>:group 'notmuch-external)
>
> @@ -49,17 +74,6 @@ to know how address selection is made by default."
>:group 'notmuch-send
>:group 'notmuch-external)
>
> -(defvar notmuch-address-last-harvest 0
> -  "Time of last address harvest")
> -
> -(defvar notmuch-address-completions (make-hash-table :test 'equal)
> -  "Hash of email addresses for completion during email composition.
> -  This variable is set by calling `notmuch-address-harvest'.")
> -
> -(defvar notmuch-address-full-harvest-finished nil
> -  "t indicates that full completion address harvesting has been
> -finished")
> -
>  (defun notmuch-address-selection-function (prompt collection initial-input)
>"Call (`completing-read'
>PROMPT COLLECTION nil nil INITIAL-INPUT 'notmuch-address-history)"
> @@ -81,7 +95,8 @@ finished")
>
>  (defun notmuch-address-setup ()
>(let* ((use-company (and notmuch-address-use-company
> -(eq notmuch-address-command 'internal)
> +notmuch-address-command
> +(listp notmuch-address-command)
>  (require 'company nil t)))
>(pair (cons notmuch-address-completion-headers-regexp
>(if use-company
> @@ -109,7 +124,7 @@ The candidates are taken from 
> `notmuch-address-completions'."
>  elisp-based implementation or older 

Re: file-error "not a regular file"

2015-12-28 Thread David Bremner
fauno  writes:

> Peter Salazar  writes:
>
>> Hello,
>>
>> I'm using notmuch-mode from within Emacs to send email using async/mbsync
>> through Gmail. However, every time I send email from within Emacs, I get
>> this error:
>
> i got this message too for fcc with default values, i'm on emacs 24.5
> with notmuch 0.21
>

Can either of you replicate the problem with a minimal configuration,
ideally with "emacs -q", followed by "M-x load-library 
notmuch"?

If so, does the path in the Fcc header exist? If so, what is it? a file,
a directory, a symlink?

For me, in emacs 24.5 / notmuch 0.21, with emacs -q, if that path is
missing I am prompted to create it. If I refuse, then I later get a
message about not being a maildir.

I guess the tl;dr is that I can't duplicate this problem. Looking at the
traceback Peter provided, it looks like he is using
"send-message-without-bullets" to send the message. Since this isn't a
notmuch function, it's likely bypassing the notmuch fcc setup that
notmuch-mua-send and notmuch-mua-send-and-exit do.


d

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: file-error "not a regular file"

2015-12-28 Thread Peter Salazar
Hi David,

Thanks for looking into this. Much appreciated.

Yes, following your steps, emacs -q followed by "M-x load-library 
notmuch", I was able to send an email without the error. It prompted me for
my smtp server, username, and password, then returned this:

Sending email
Sending email done
Invalid image size (see `max-image-size')
Mark set
Saving file
/Users/peter/Dropbox/mail/gmail/sent/tmp/1451367804.6837_72197_1.Infinity.local...
Wrote
/Users/peter/Dropbox/mail/gmail/sent/tmp/1451367804.6837_72197_1.Infinity.local
Sending...done

To answer your other question, yes, there is an Fcc: header when I try to
send email from my regular Emacs configuration. It's the same header I saw
when I sent email from the minimal configuration:

Fcc: /Users/peter/Dropbox/mail/gmail/sent

That directory does indeed exist:

drwxr-xr-x@ 9 peter  staff  306 Dec 27 21:54 *sent*
And it contains:

.DS_Store.mbsyncstate *.nnmaildir*   .uidvalidity *cur*  *new*
*tmp*
Does this give us any leads?

Thanks again.

On Mon, Dec 28, 2015 at 9:46 AM, David Bremner  wrote:

> fauno  writes:
>
> > Peter Salazar  writes:
> >
> >> Hello,
> >>
> >> I'm using notmuch-mode from within Emacs to send email using
> async/mbsync
> >> through Gmail. However, every time I send email from within Emacs, I get
> >> this error:
> >
> > i got this message too for fcc with default values, i'm on emacs 24.5
> > with notmuch 0.21
> >
>
> Can either of you replicate the problem with a minimal configuration,
> ideally with "emacs -q", followed by "M-x load-library 
> notmuch"?
>
> If so, does the path in the Fcc header exist? If so, what is it? a file,
> a directory, a symlink?
>
> For me, in emacs 24.5 / notmuch 0.21, with emacs -q, if that path is
> missing I am prompted to create it. If I refuse, then I later get a
> message about not being a maildir.
>
> I guess the tl;dr is that I can't duplicate this problem. Looking at the
> traceback Peter provided, it looks like he is using
> "send-message-without-bullets" to send the message. Since this isn't a
> notmuch function, it's likely bypassing the notmuch fcc setup that
> notmuch-mua-send and notmuch-mua-send-and-exit do.
>
>
> d
>
>
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: file-error "not a regular file"

2015-12-28 Thread fauno
David Bremner  writes:

> I guess the tl;dr is that I can't duplicate this problem. Looking at the
> traceback Peter provided, it looks like he is using
> "send-message-without-bullets" to send the message. Since this isn't a
> notmuch function, it's likely bypassing the notmuch fcc setup that
> notmuch-mua-send and notmuch-mua-send-and-exit do.

i've found the issue.  i'm using jl-encrypt that expects email written
in message-mode, and since notmuch is now a minor mode some functions
that were expected to be there didn't work anymore.

-- 
:O


signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch