Re: [PATCH] emacs: add mimetype completions to searches

2016-10-22 Thread Jani Nikula
On Sat, 22 Oct 2016, Keith Amidon  wrote:
> On Sat, 2016-10-22 at 12:55 +0300, Jani Nikula wrote:
>> Any ideas how to get a list of mime types in shell, so I could do the
>> same in bash completion without hard-coding some limited list?
>
> Not sure if this is really what you're looking for, but on my archlinux
> system, the file /etc/mime.types is installed by a package called mime-
> types, which lists this gentoo package as its upstream:
>
> http://packages.gentoo.org/package/app-misc/mime-types
>
> It's pulled in as a dependency of installing firefox, so presumably
> some version of this is pretty ubiquitous on Linux systems.

Thanks. I did look at it before, but dismissed it because the package
doesn't seem to provide a tool for parsing the file. I ended up parsing
it using a sed one-liner [1]. Oh well.

BR,
Jani.


[1] id:1477162534-7814-1-git-send-email-j...@nikula.org
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] emacs: add mimetype completions to searches

2016-10-22 Thread Keith Amidon
On Sat, 2016-10-22 at 12:55 +0300, Jani Nikula wrote:
> Any ideas how to get a list of mime types in shell, so I could do the
> same in bash completion without hard-coding some limited list?

Not sure if this is really what you're looking for, but on my archlinux
system, the file /etc/mime.types is installed by a package called mime-
types, which lists this gentoo package as its upstream:

http://packages.gentoo.org/package/app-misc/mime-types

It's pulled in as a dependency of installing firefox, so presumably
some version of this is pretty ubiquitous on Linux systems.

  --- Keith


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


Re: [PATCH] emacs: add mimetype completions to searches

2016-10-22 Thread Jani Nikula
On Tue, 27 Sep 2016, Mark Walters  wrote:
> When doing the patch for commit
> f94921520778ae4005500f5d1b943e2d4ddd3b2a emacs: show: let the user
> override the mime-type of an attachment, I discovered how to do
> mimetype completion (in particular where to get a list of mimetypes),
> so we may as well add this completion for searches too.

Any ideas how to get a list of mime types in shell, so I could do the
same in bash completion without hard-coding some limited list?

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


Re: [PATCH] emacs: add mimetype completions to searches

2016-10-09 Thread David Bremner
Mark Walters  writes:

pushed

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


Re: [PATCH] emacs: add mimetype completions to searches

2016-09-28 Thread David Bremner
David Bremner  writes:

>
> Did you mean to have an empty commit message?
>

I'm on the fence about this. I'll revisit the patch after 0.23 release.

>> emacs/notmuch.el | 5 +++--
>>  1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/emacs/notmuch.el b/emacs/notmuch.el
>
> I don't seem to have the variable mailcap-mime-types in this emacs
> session, with notmuch loaded.

Oops, my mistake. mailcap-mime-types is (evidently) a function.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] emacs: add mimetype completions to searches

2016-09-27 Thread David Bremner
Mark Walters  writes:

> ---
>
> When doing the patch for commit
> f94921520778ae4005500f5d1b943e2d4ddd3b2a emacs: show: let the user
> override the mime-type of an attachment, I discovered how to do
> mimetype completion (in particular where to get a list of mimetypes),
> so we may as well add this completion for searches too.
>
> Best wishes
>
> Mark

Did you mean to have an empty commit message?

> emacs/notmuch.el | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/emacs/notmuch.el b/emacs/notmuch.el
> index 8e14692..29afd45 100644
> --- a/emacs/notmuch.el
> +++ b/emacs/notmuch.el
> @@ -891,9 +891,10 @@ PROMPT is the string to prompt with."
>  (process-lines notmuch-command "search" "--output=tags" 
> "*")))
> (completions
>(append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:"
> -"subject:" "attachment:" "mimetype:")
> +"subject:" "attachment:")
>(mapcar (lambda (tag) (concat "tag:" tag)) all-tags)
> -  (mapcar (lambda (tag) (concat "is:" tag)) all-tags
> +  (mapcar (lambda (tag) (concat "is:" tag)) all-tags)
> +  (mapcar (lambda (mimetype) (concat "mimetype:" mimetype)) 
> (mailcap-mime-types)
>  (let ((keymap (copy-keymap minibuffer-local-map))
> (current-query (case major-mode
>  (notmuch-search-mode (notmuch-search-get-query))

I don't seem to have the variable mailcap-mime-types in this emacs
session, with notmuch loaded.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] emacs: add mimetype completions to searches

2016-09-27 Thread Mark Walters
---

When doing the patch for commit
f94921520778ae4005500f5d1b943e2d4ddd3b2a emacs: show: let the user
override the mime-type of an attachment, I discovered how to do
mimetype completion (in particular where to get a list of mimetypes),
so we may as well add this completion for searches too.

Best wishes

Mark



emacs/notmuch.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 8e14692..29afd45 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -891,9 +891,10 @@ PROMPT is the string to prompt with."
 (process-lines notmuch-command "search" "--output=tags" "*")))
(completions
 (append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:"
-  "subject:" "attachment:" "mimetype:")
+  "subject:" "attachment:")
 (mapcar (lambda (tag) (concat "tag:" tag)) all-tags)
-(mapcar (lambda (tag) (concat "is:" tag)) all-tags
+(mapcar (lambda (tag) (concat "is:" tag)) all-tags)
+(mapcar (lambda (mimetype) (concat "mimetype:" mimetype)) 
(mailcap-mime-types)
 (let ((keymap (copy-keymap minibuffer-local-map))
  (current-query (case major-mode
   (notmuch-search-mode (notmuch-search-get-query))
-- 
2.1.4

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