newbie questions about notmuch.el

classic Classic list List threaded Threaded
9 messages Options
Julien Cubizolles Julien Cubizolles
Reply | Threaded
Open this post in threaded view
|

newbie questions about notmuch.el

I'm using notmuch.el in emacs. In a notmuch search buffer, how can I:

+ set or remove the flag mark on a given message
+ select several messages to add, for instance, the same tag

Julien.
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Jani Nikula Jani Nikula
Reply | Threaded
Open this post in threaded view
|

Re: newbie questions about notmuch.el

On Tue, Sep 5, 2017 at 1:03 PM, Julien Cubizolles <[hidden email]> wrote:
> I'm using notmuch.el in emacs. In a notmuch search buffer, how can I:

In general, hit '?' to get a help page for the Notmuch buffer you're in.

> + set or remove the flag mark on a given message

What is the flag mark? There is no "mark" feature.

In the search buffer, you can only operate on threads, not messages.
Hit '+' or '-' to tag/untag the highlighted thread.

In the tree view (try 'z') you can also operate on messages. '+' and
'-' work there too.

> + select several messages to add, for instance, the same tag

In the search buffer, select a region of threads to tag, and hit '+' or '-'.

BR,
Jani.
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Tom Hirschowitz-2 Tom Hirschowitz-2
Reply | Threaded
Open this post in threaded view
|

Re: newbie questions about notmuch.el


I think Julien meant the 'flagged' tag: just press the space bar to
switch it on and off.

Regarding the second question, you may filter your search (e.g., by the
'flagged' tag) and then tag all messages by pressing *. IIRC there is no
shortcut for filtering by default. I have this

(define-key notmuch-show-mode-map (kbd "l") 'notmuch-search-filter)
(define-key notmuch-search-mode-map (kbd "l") 'notmuch-search-filter)
(define-key notmuch-tree-mode-map (kbd "l") 'notmuch-search-filter)

somewhere in my emacs files, but perhaps there is a cleaner way.

> On Tue, Sep 5, 2017 at 1:03 PM, Julien Cubizolles <[hidden email]> wrote:
>> I'm using notmuch.el in emacs. In a notmuch search buffer, how can I:
>
> In general, hit '?' to get a help page for the Notmuch buffer you're in.
>
>> + set or remove the flag mark on a given message
>
> What is the flag mark? There is no "mark" feature.
>
> In the search buffer, you can only operate on threads, not messages.
> Hit '+' or '-' to tag/untag the highlighted thread.
>
> In the tree view (try 'z') you can also operate on messages. '+' and
> '-' work there too.
>
>> + select several messages to add, for instance, the same tag
>
> In the search buffer, select a region of threads to tag, and hit '+' or '-'.
>
> BR,
> Jani.
> _______________________________________________
> notmuch mailing list
> [hidden email]
> https://notmuchmail.org/mailman/listinfo/notmuch
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Jani Nikula Jani Nikula
Reply | Threaded
Open this post in threaded view
|

Re: newbie questions about notmuch.el

On Wed, Sep 6, 2017 at 11:42 AM, Tom Hirschowitz
<[hidden email]> wrote:
>
> I think Julien meant the 'flagged' tag: just press the space bar to
> switch it on and off.

I don't know what you have configured, but the default is:

c-h k SPC
"SPC runs the command notmuch-search-scroll-up"

> Regarding the second question, you may filter your search (e.g., by the
> 'flagged' tag) and then tag all messages by pressing *. IIRC there is no
> shortcut for filtering by default. I have this

'l' to filter by query, 't' to filter by tag.

BR,
Jani.
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Julien Cubizolles Julien Cubizolles
Reply | Threaded
Open this post in threaded view
|

Re: newbie questions about notmuch.el


Thanks for these answers.

>> I think Julien meant the 'flagged' tag: just press the space bar to
>> switch it on and off.

> I don't know what you have configured, but the default is:
>
> c-h k SPC
> "SPC runs the command notmuch-search-scroll-up"

That's what I have too. But from your message, I realized that I only
have to do  +flagged :-) Tom, do you have a function defined for thisĀ ?

>> Regarding the second question, you may filter your search (e.g., by the
>> 'flagged' tag) and then tag all messages by pressing *. IIRC there is no
>> shortcut for filtering by default. I have this
>
> 'l' to filter by query, 't' to filter by tag.

Works for me. I was looking for something like the "process-mark" in
Gnus but filtering is fine.

Julien.
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Julien Cubizolles Julien Cubizolles
Reply | Threaded
Open this post in threaded view
|

Re: newbie questions about notmuch.el

Julien Cubizolles <[hidden email]> writes:

> Thanks for these answers.
>
>>> I think Julien meant the 'flagged' tag: just press the space bar to
>>> switch it on and off.

I just noticed that k f also adds the 'flagged' tag.

Julien.
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Julien Cubizolles Julien Cubizolles
Reply | Threaded
Open this post in threaded view
|

Re: newbie questions about notmuch.el

In reply to this post by Tom Hirschowitz-2
Tom Hirschowitz <[hidden email]> writes:

> I think Julien meant the 'flagged' tag: just press the space bar to
> switch it on and off.
>
> Regarding the second question, you may filter your search (e.g., by the
> 'flagged' tag) and then tag all messages by pressing *. IIRC there is no
> shortcut for filtering by default. I have this
>
> (define-key notmuch-show-mode-map (kbd "l") 'notmuch-search-filter)
> (define-key notmuch-search-mode-map (kbd "l") 'notmuch-search-filter)
> (define-key notmuch-tree-mode-map (kbd "l") 'notmuch-search-filter)

notmuch-search-filter doesn't seem to work in tree mode: I get

--8<---------------cut here---------------start------------->8---
(void-variable notmuch-search-query-string)
  notmuch-search-filter-by-tag("+unread")
--8<---------------cut here---------------end--------------->8---
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

Re: newbie questions about notmuch.el

Julien Cubizolles <[hidden email]> writes:

> Tom Hirschowitz <[hidden email]> writes:
>
>> I think Julien meant the 'flagged' tag: just press the space bar to
>> switch it on and off.
>>
>> Regarding the second question, you may filter your search (e.g., by the
>> 'flagged' tag) and then tag all messages by pressing *. IIRC there is no
>> shortcut for filtering by default. I have this
>>
>> (define-key notmuch-show-mode-map (kbd "l") 'notmuch-search-filter)
>> (define-key notmuch-search-mode-map (kbd "l") 'notmuch-search-filter)
>> (define-key notmuch-tree-mode-map (kbd "l") 'notmuch-search-filter)
>
> notmuch-search-filter doesn't seem to work in tree mode: I get
>
> --8<---------------cut here---------------start------------->8---
> (void-variable notmuch-search-query-string)
>   notmuch-search-filter-by-tag("+unread")
> --8<---------------cut here---------------end--------------->8---

Yes, I think there has to be some mistake in what Tom quoted (or Tom is
using a heavily modified version of notmuch), since
notmuch-search-filter doesn't work in notmuch-show-mode either. The
prefix is a  a hint why that might be: notmuch-search-foo is
generally intended to be called in notmuch-search mode.  As was already
mentioned, 'l' is bound by default to filter in both notmuch-show and
notmuch-search mode. There's no direct equivalent in tree-mode
currently, but you can use the following workaround

S - switch to search view of same query
l - limit search
Z - switch back to tree view.

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Tom Hirschowitz-2 Tom Hirschowitz-2
Reply | Threaded
Open this post in threaded view
|

Re: newbie questions about notmuch.el


> Yes, I think there has to be some mistake in what Tom quoted

Indeed :)

Regarding Julien's question:

> Tom, do you have a function defined for this ?

Yes, probably utterly naive, wrong, etc. Would be happy to be corrected, in particular about how to avoid code triplication.
There you go:

(defun notmuch-show-flag  ()
  "Switch the flagged tag for the current thread or region."
  (interactive)
  (let ((tag-changes (if (member "flagged" (notmuch-show-get-tags)) (list "-flagged") (list "+flagged"))))
    (notmuch-show-tag tag-changes)))

(defun notmuch-search-flag  (&optional beg end)
  "Switch the flagged tag for the current thread or region."
  (interactive)
  (let ((tag-changes (if (member "flagged" (notmuch-search-get-tags)) (list "-flagged") (list "+flagged"))))
    (notmuch-search-tag tag-changes beg end)))

(defun notmuch-tree-flag ()
  "Switch the flagged tag for the current thread or region."
  (interactive)
  (let ((tag-changes (if (member "flagged" (notmuch-tree-get-tags)) (list "-flagged") (list "+flagged"))))
    (notmuch-tree-tag tag-changes)))

(define-key notmuch-show-mode-map (kbd "SPC") 'notmuch-show-flag)
(define-key notmuch-search-mode-map (kbd "SPC") 'notmuch-search-flag)
(define-key notmuch-tree-mode-map (kbd "SPC") 'notmuch-tree-flag)
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch