[PATCH v2] emacs: Added "is:" style completion to notmuch-read-query.

2014-12-01 Thread David Bremner
Charles Celerier  writes:

> Can the variables in the varlist depend on the definition of variables
> that precede them in the list? I believe I tried your suggestion, but
> quickly gave up as Emacs gave me an error claiming that all-tags was
> void.

That's the point of lexical-let* vs lexical-let

d


[PATCH v2] emacs: Added "is:" style completion to notmuch-read-query.

2014-12-01 Thread Lele Gaifax
Charles Celerier 
writes:

> Can the variables in the varlist depend on the definition of variables
> that precede them in the list? I believe I tried your suggestion, but
> quickly gave up as Emacs gave me an error claiming that all-tags was
> void.

Yes, with the let*/lexical-let* variants of let/lexical-let. This is
stated in the let* documentation (that is, C-h f let* RET).

ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivr? di quello che ho pensato ieri
real: Emanuele Gaifas | comincer? ad aver paura di chi mi copia.
lele at metapensiero.it  | -- Fortunato Depero, 1929.



[PATCH v2] emacs: Added "is:" style completion to notmuch-read-query.

2014-12-01 Thread Charles Celerier
I see now. I tried using lexical-let*, but now it appears that pulling
the assignment of minibuffer-completion-table into the lexical-let*
breaks the function, while pulling all the other assigments in works
fine. I'm not sure why that happens. I am not a very skilled emacs-lisp
programmer, so I am afraid something funny is happening here that is
beyond my understanding.

charles

David Bremner  writes:

> Charles Celerier  writes:
>
>> Can the variables in the varlist depend on the definition of variables
>> that precede them in the list? I believe I tried your suggestion, but
>> quickly gave up as Emacs gave me an error claiming that all-tags was
>> void.
>
> That's the point of lexical-let* vs lexical-let
>
> d
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 480 bytes
Desc: not available
URL: 



[PATCH v2] emacs: Added "is:" style completion to notmuch-read-query.

2014-12-01 Thread Charles Celerier
Can the variables in the varlist depend on the definition of variables
that precede them in the list? I believe I tried your suggestion, but
quickly gave up as Emacs gave me an error claiming that all-tags was
void.

charles

David Edmondson  writes:

> On Sat, Nov 29 2014, Charles Celerier wrote:
>> The notmuch-search-terms man page states that "tag:" is equivalent
>> to "is:". Completion for "is:" style searches is now supported
>> in the Emacs interface.
>>
>> Signed-off-by: Charles Celerier 
>> ---
>>  emacs/notmuch.el | 11 +++
>>  1 file changed, 7 insertions(+), 4 deletions(-)
>>
>> diff --git a/emacs/notmuch.el b/emacs/notmuch.el
>> index 218486a..d29499c 100644
>> --- a/emacs/notmuch.el
>> +++ b/emacs/notmuch.el
>> @@ -856,12 +856,15 @@ See `notmuch-tag' for information on the format of 
>> TAG-CHANGES."
>>  
>>  PROMPT is the string to prompt with."
>>(lexical-let
>> +(( all-tags
>> +(mapcar (lambda (tag) (notmuch-escape-boolean-term tag))
>> +(process-lines notmuch-command "search" "--output=tags" 
>> "*"
>> +  (let
>
> I think that David's suggestion was that you would have only one `let'
> form, so something like:
>
>  (lexical-let*
>((all-tags (mapcar ...))
> (completions (append ...))
> (keymap (copy-keymap ...))
> (current-query ...))
>  ...)
>
>>((completions
>>  (append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:"
>>"subject:" "attachment:")
>> -(mapcar (lambda (tag)
>> -  (concat "tag:" (notmuch-escape-boolean-term tag)))
>> -(process-lines notmuch-command "search" "--output=tags" 
>> "*")
>> +(mapcar (lambda (tag) (concat "tag:" tag)) all-tags)
>> +(mapcar (lambda (tag) (concat "is:" tag)) all-tags
>>  (let ((keymap (copy-keymap minibuffer-local-map))
>>(current-query (case major-mode
>> (notmuch-search-mode (notmuch-search-get-query))
>> @@ -884,7 +887,7 @@ PROMPT is the string to prompt with."
>>(define-key keymap (kbd "TAB") 'minibuffer-complete)
>>(let ((history-delete-duplicates t))
>>  (read-from-minibuffer prompt nil keymap nil
>> -  'notmuch-search-history current-query nil)
>> +  'notmuch-search-history current-query nil))
>>  
>>  (defun notmuch-search-get-query ()
>>"Return the current query in this search buffer"
>> -- 
>> 2.1.2
>>
>> ___
>> notmuch mailing list
>> notmuch at notmuchmail.org
>> http://notmuchmail.org/mailman/listinfo/notmuch
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 480 bytes
Desc: not available
URL: 



Re: [PATCH v2] emacs: Added "is:" style completion to notmuch-read-query.

2014-12-01 Thread Charles Celerier
I see now. I tried using lexical-let*, but now it appears that pulling
the assignment of minibuffer-completion-table into the lexical-let*
breaks the function, while pulling all the other assigments in works
fine. I'm not sure why that happens. I am not a very skilled emacs-lisp
programmer, so I am afraid something funny is happening here that is
beyond my understanding.

charles

David Bremner  writes:

> Charles Celerier  writes:
>
>> Can the variables in the varlist depend on the definition of variables
>> that precede them in the list? I believe I tried your suggestion, but
>> quickly gave up as Emacs gave me an error claiming that all-tags was
>> void.
>
> That's the point of lexical-let* vs lexical-let
>
> d


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


Re: [PATCH v2] emacs: Added "is:" style completion to notmuch-read-query.

2014-12-01 Thread David Bremner
Charles Celerier  writes:

> Can the variables in the varlist depend on the definition of variables
> that precede them in the list? I believe I tried your suggestion, but
> quickly gave up as Emacs gave me an error claiming that all-tags was
> void.

That's the point of lexical-let* vs lexical-let

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


Re: [PATCH v2] emacs: Added "is:" style completion to notmuch-read-query.

2014-12-01 Thread Lele Gaifax
Charles Celerier 
writes:

> Can the variables in the varlist depend on the definition of variables
> that precede them in the list? I believe I tried your suggestion, but
> quickly gave up as Emacs gave me an error claiming that all-tags was
> void.

Yes, with the let*/lexical-let* variants of let/lexical-let. This is
stated in the let* documentation (that is, C-h f let* RET).

ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  | -- Fortunato Depero, 1929.

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


Re: [PATCH v2] emacs: Added "is:" style completion to notmuch-read-query.

2014-12-01 Thread Charles Celerier
Can the variables in the varlist depend on the definition of variables
that precede them in the list? I believe I tried your suggestion, but
quickly gave up as Emacs gave me an error claiming that all-tags was
void.

charles

David Edmondson  writes:

> On Sat, Nov 29 2014, Charles Celerier wrote:
>> The notmuch-search-terms man page states that "tag:" is equivalent
>> to "is:". Completion for "is:" style searches is now supported
>> in the Emacs interface.
>>
>> Signed-off-by: Charles Celerier 
>> ---
>>  emacs/notmuch.el | 11 +++
>>  1 file changed, 7 insertions(+), 4 deletions(-)
>>
>> diff --git a/emacs/notmuch.el b/emacs/notmuch.el
>> index 218486a..d29499c 100644
>> --- a/emacs/notmuch.el
>> +++ b/emacs/notmuch.el
>> @@ -856,12 +856,15 @@ See `notmuch-tag' for information on the format of 
>> TAG-CHANGES."
>>  
>>  PROMPT is the string to prompt with."
>>(lexical-let
>> +(( all-tags
>> +(mapcar (lambda (tag) (notmuch-escape-boolean-term tag))
>> +(process-lines notmuch-command "search" "--output=tags" 
>> "*"
>> +  (let
>
> I think that David's suggestion was that you would have only one `let'
> form, so something like:
>
>  (lexical-let*
>((all-tags (mapcar ...))
> (completions (append ...))
> (keymap (copy-keymap ...))
> (current-query ...))
>  ...)
>
>>((completions
>>  (append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:"
>>"subject:" "attachment:")
>> -(mapcar (lambda (tag)
>> -  (concat "tag:" (notmuch-escape-boolean-term tag)))
>> -(process-lines notmuch-command "search" "--output=tags" 
>> "*")
>> +(mapcar (lambda (tag) (concat "tag:" tag)) all-tags)
>> +(mapcar (lambda (tag) (concat "is:" tag)) all-tags
>>  (let ((keymap (copy-keymap minibuffer-local-map))
>>(current-query (case major-mode
>> (notmuch-search-mode (notmuch-search-get-query))
>> @@ -884,7 +887,7 @@ PROMPT is the string to prompt with."
>>(define-key keymap (kbd "TAB") 'minibuffer-complete)
>>(let ((history-delete-duplicates t))
>>  (read-from-minibuffer prompt nil keymap nil
>> -  'notmuch-search-history current-query nil)
>> +  'notmuch-search-history current-query nil))
>>  
>>  (defun notmuch-search-get-query ()
>>"Return the current query in this search buffer"
>> -- 
>> 2.1.2
>>
>> ___
>> notmuch mailing list
>> notmuch@notmuchmail.org
>> http://notmuchmail.org/mailman/listinfo/notmuch


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


[PATCH v2] emacs: Added "is:" style completion to notmuch-read-query.

2014-12-01 Thread David Edmondson
On Sat, Nov 29 2014, Charles Celerier wrote:
> The notmuch-search-terms man page states that "tag:" is equivalent
> to "is:". Completion for "is:" style searches is now supported
> in the Emacs interface.
>
> Signed-off-by: Charles Celerier 
> ---
>  emacs/notmuch.el | 11 +++
>  1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/emacs/notmuch.el b/emacs/notmuch.el
> index 218486a..d29499c 100644
> --- a/emacs/notmuch.el
> +++ b/emacs/notmuch.el
> @@ -856,12 +856,15 @@ See `notmuch-tag' for information on the format of 
> TAG-CHANGES."
>  
>  PROMPT is the string to prompt with."
>(lexical-let
> +(( all-tags
> +(mapcar (lambda (tag) (notmuch-escape-boolean-term tag))
> +(process-lines notmuch-command "search" "--output=tags" 
> "*"
> +  (let

I think that David's suggestion was that you would have only one `let'
form, so something like:

 (lexical-let*
   ((all-tags (mapcar ...))
(completions (append ...))
(keymap (copy-keymap ...))
(current-query ...))
 ...)

>((completions
>   (append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:"
> "subject:" "attachment:")
> - (mapcar (lambda (tag)
> -   (concat "tag:" (notmuch-escape-boolean-term tag)))
> - (process-lines notmuch-command "search" "--output=tags" 
> "*")
> + (mapcar (lambda (tag) (concat "tag:" tag)) all-tags)
> + (mapcar (lambda (tag) (concat "is:" tag)) all-tags
>  (let ((keymap (copy-keymap minibuffer-local-map))
> (current-query (case major-mode
>  (notmuch-search-mode (notmuch-search-get-query))
> @@ -884,7 +887,7 @@ PROMPT is the string to prompt with."
>(define-key keymap (kbd "TAB") 'minibuffer-complete)
>(let ((history-delete-duplicates t))
>   (read-from-minibuffer prompt nil keymap nil
> -   'notmuch-search-history current-query nil)
> +   'notmuch-search-history current-query nil))
>  
>  (defun notmuch-search-get-query ()
>"Return the current query in this search buffer"
> -- 
> 2.1.2
>
> ___
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH v2] emacs: Added "is:" style completion to notmuch-read-query.

2014-11-30 Thread David Edmondson
On Sat, Nov 29 2014, Charles Celerier wrote:
> The notmuch-search-terms man page states that "tag:" is equivalent
> to "is:". Completion for "is:" style searches is now supported
> in the Emacs interface.
>
> Signed-off-by: Charles Celerier 
> ---
>  emacs/notmuch.el | 11 +++
>  1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/emacs/notmuch.el b/emacs/notmuch.el
> index 218486a..d29499c 100644
> --- a/emacs/notmuch.el
> +++ b/emacs/notmuch.el
> @@ -856,12 +856,15 @@ See `notmuch-tag' for information on the format of 
> TAG-CHANGES."
>  
>  PROMPT is the string to prompt with."
>(lexical-let
> +(( all-tags
> +(mapcar (lambda (tag) (notmuch-escape-boolean-term tag))
> +(process-lines notmuch-command "search" "--output=tags" 
> "*"
> +  (let

I think that David's suggestion was that you would have only one `let'
form, so something like:

 (lexical-let*
   ((all-tags (mapcar ...))
(completions (append ...))
(keymap (copy-keymap ...))
(current-query ...))
 ...)

>((completions
>   (append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:"
> "subject:" "attachment:")
> - (mapcar (lambda (tag)
> -   (concat "tag:" (notmuch-escape-boolean-term tag)))
> - (process-lines notmuch-command "search" "--output=tags" 
> "*")
> + (mapcar (lambda (tag) (concat "tag:" tag)) all-tags)
> + (mapcar (lambda (tag) (concat "is:" tag)) all-tags
>  (let ((keymap (copy-keymap minibuffer-local-map))
> (current-query (case major-mode
>  (notmuch-search-mode (notmuch-search-get-query))
> @@ -884,7 +887,7 @@ PROMPT is the string to prompt with."
>(define-key keymap (kbd "TAB") 'minibuffer-complete)
>(let ((history-delete-duplicates t))
>   (read-from-minibuffer prompt nil keymap nil
> -   'notmuch-search-history current-query nil)
> +   'notmuch-search-history current-query nil))
>  
>  (defun notmuch-search-get-query ()
>"Return the current query in this search buffer"
> -- 
> 2.1.2
>
> ___
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH v2] emacs: Added "is:" style completion to notmuch-read-query.

2014-11-29 Thread Charles Celerier
The notmuch-search-terms man page states that "tag:" is equivalent
to "is:". Completion for "is:" style searches is now supported
in the Emacs interface.

Signed-off-by: Charles Celerier 
---
 emacs/notmuch.el | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 218486a..d29499c 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -856,12 +856,15 @@ See `notmuch-tag' for information on the format of 
TAG-CHANGES."

 PROMPT is the string to prompt with."
   (lexical-let
+(( all-tags
+(mapcar (lambda (tag) (notmuch-escape-boolean-term tag))
+(process-lines notmuch-command "search" "--output=tags" "*"
+  (let
   ((completions
(append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:"
  "subject:" "attachment:")
-   (mapcar (lambda (tag)
- (concat "tag:" (notmuch-escape-boolean-term tag)))
-   (process-lines notmuch-command "search" "--output=tags" 
"*")
+   (mapcar (lambda (tag) (concat "tag:" tag)) all-tags)
+   (mapcar (lambda (tag) (concat "is:" tag)) all-tags
 (let ((keymap (copy-keymap minibuffer-local-map))
  (current-query (case major-mode
   (notmuch-search-mode (notmuch-search-get-query))
@@ -884,7 +887,7 @@ PROMPT is the string to prompt with."
   (define-key keymap (kbd "TAB") 'minibuffer-complete)
   (let ((history-delete-duplicates t))
(read-from-minibuffer prompt nil keymap nil
- 'notmuch-search-history current-query nil)
+ 'notmuch-search-history current-query nil))

 (defun notmuch-search-get-query ()
   "Return the current query in this search buffer"
-- 
2.1.2



[PATCH v2] emacs: Added "is:" style completion to notmuch-read-query.

2014-11-29 Thread Charles Celerier
The notmuch-search-terms man page states that "tag:" is equivalent
to "is:". Completion for "is:" style searches is now supported
in the Emacs interface.

Signed-off-by: Charles Celerier 
---
 emacs/notmuch.el | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 218486a..d29499c 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -856,12 +856,15 @@ See `notmuch-tag' for information on the format of 
TAG-CHANGES."
 
 PROMPT is the string to prompt with."
   (lexical-let
+(( all-tags
+(mapcar (lambda (tag) (notmuch-escape-boolean-term tag))
+(process-lines notmuch-command "search" "--output=tags" "*"
+  (let
   ((completions
(append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:"
  "subject:" "attachment:")
-   (mapcar (lambda (tag)
- (concat "tag:" (notmuch-escape-boolean-term tag)))
-   (process-lines notmuch-command "search" "--output=tags" 
"*")
+   (mapcar (lambda (tag) (concat "tag:" tag)) all-tags)
+   (mapcar (lambda (tag) (concat "is:" tag)) all-tags
 (let ((keymap (copy-keymap minibuffer-local-map))
  (current-query (case major-mode
   (notmuch-search-mode (notmuch-search-get-query))
@@ -884,7 +887,7 @@ PROMPT is the string to prompt with."
   (define-key keymap (kbd "TAB") 'minibuffer-complete)
   (let ((history-delete-duplicates t))
(read-from-minibuffer prompt nil keymap nil
- 'notmuch-search-history current-query nil)
+ 'notmuch-search-history current-query nil))
 
 (defun notmuch-search-get-query ()
   "Return the current query in this search buffer"
-- 
2.1.2

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