unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 1/2] completion: complete notmuch emacs-mua
@ 2017-02-25  9:25 Jani Nikula
  2017-02-25  9:25 ` [PATCH 2/2] emacs/desktop: update to use notmuch-emacs-mua and handle mailto Jani Nikula
  2017-03-01 23:43 ` [PATCH 1/2] completion: complete notmuch emacs-mua David Bremner
  0 siblings, 2 replies; 3+ messages in thread
From: Jani Nikula @ 2017-02-25  9:25 UTC (permalink / raw)
  To: notmuch

With subcommand handling for external commands we can easily complete
'notmuch emacs-mua' using the existing completion system.

---

v3: complete --hello option
---
 completion/notmuch-completion.bash | 34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/completion/notmuch-completion.bash b/completion/notmuch-completion.bash
index d44b2a2811f0..40012eaaffd9 100644
--- a/completion/notmuch-completion.bash
+++ b/completion/notmuch-completion.bash
@@ -236,6 +236,38 @@ _notmuch_dump()
     esac
 }
 
+_notmuch_emacs_mua()
+{
+    local cur prev words cword split
+    _init_completion -s || return
+
+    $split &&
+    case "${prev}" in
+	--to|--cc|--bcc)
+	    COMPREPLY=( $(compgen -W "`_notmuch_email to:${cur}`" -- ${cur}) )
+	    return
+	    ;;
+	--body)
+	    _filedir
+	    return
+	    ;;
+    esac
+
+    ! $split &&
+    case "${cur}" in
+        -*)
+	    local options="--subject= --to= --cc= --bcc= --body= --no-window-system --client --auto-daemon --create-frame --print --help --hello"
+
+	    compopt -o nospace
+	    COMPREPLY=( $(compgen -W "$options" -- ${cur}) )
+	    ;;
+	*)
+	    COMPREPLY=( $(compgen -W "`_notmuch_email to:${cur}`" -- ${cur}) )
+	    return
+	    ;;
+    esac
+}
+
 _notmuch_insert()
 {
     local cur prev words cword split
@@ -496,7 +528,7 @@ _notmuch_tag()
 
 _notmuch()
 {
-    local _notmuch_commands="compact config count dump help insert new reply restore search address setup show tag"
+    local _notmuch_commands="compact config count dump help insert new reply restore search address setup show tag emacs-mua"
     local arg cur prev words cword split
 
     # require bash-completion with _init_completion
-- 
2.11.0

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

* [PATCH 2/2] emacs/desktop: update to use notmuch-emacs-mua and handle mailto
  2017-02-25  9:25 [PATCH 1/2] completion: complete notmuch emacs-mua Jani Nikula
@ 2017-02-25  9:25 ` Jani Nikula
  2017-03-01 23:43 ` [PATCH 1/2] completion: complete notmuch emacs-mua David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: Jani Nikula @ 2017-02-25  9:25 UTC (permalink / raw)
  To: notmuch

With the mailto: handling in notmuch-emacs-mua, we can update the
desktop file to advertize we can be set as the default application to
handle email. While at it, add GenericName and Comment to be more
informative.

With --hello, notmuch-emacs-mua will run (notmuch) if mailto: url is
not given.
---
 emacs/notmuch-emacs-mua.desktop | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/emacs/notmuch-emacs-mua.desktop b/emacs/notmuch-emacs-mua.desktop
index f1600473bf60..0d9af2a4cf39 100644
--- a/emacs/notmuch-emacs-mua.desktop
+++ b/emacs/notmuch-emacs-mua.desktop
@@ -1,6 +1,9 @@
 [Desktop Entry]
 Name=Notmuch (emacs interface)
-Exec=emacs -f notmuch
+GenericName=Email Client
+Comment=Emacs based email client
+Exec=notmuch-emacs-mua --hello %u
+MimeType=x-scheme-handler/mailto;
 Icon=emblem-mail
 Terminal=false
 Type=Application
-- 
2.11.0

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

* Re: [PATCH 1/2] completion: complete notmuch emacs-mua
  2017-02-25  9:25 [PATCH 1/2] completion: complete notmuch emacs-mua Jani Nikula
  2017-02-25  9:25 ` [PATCH 2/2] emacs/desktop: update to use notmuch-emacs-mua and handle mailto Jani Nikula
@ 2017-03-01 23:43 ` David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: David Bremner @ 2017-03-01 23:43 UTC (permalink / raw)
  To: Jani Nikula, notmuch

Jani Nikula <jani@nikula.org> writes:

> With subcommand handling for external commands we can easily complete
> 'notmuch emacs-mua' using the existing completion system.
>

series pushed to master

d

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

end of thread, other threads:[~2017-03-01 23:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-25  9:25 [PATCH 1/2] completion: complete notmuch emacs-mua Jani Nikula
2017-02-25  9:25 ` [PATCH 2/2] emacs/desktop: update to use notmuch-emacs-mua and handle mailto Jani Nikula
2017-03-01 23:43 ` [PATCH 1/2] completion: complete notmuch emacs-mua 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).