]> granicus.if.org Git - neomutt/commitdiff
add notmuch::// uri
authorKarel Zak <kzak@redhat.com>
Wed, 14 Dec 2011 12:40:26 +0000 (13:40 +0100)
committerRichard Russon <rich@flatcap.org>
Mon, 14 Mar 2016 23:11:40 +0000 (23:11 +0000)
Signed-off-by: Karel Zak <kzak@redhat.com>
README.notmuch
url.c
url.h

index 1a5f3b75968d2841b8010004bda23ec61ece305d..03905c0f9c3bea701d3cefb3609f5d750b8e16f1 100644 (file)
@@ -14,6 +14,33 @@ notmuch support for mutt
   $ ./configure --enable-notmuch
   $ make
 
+ * folders URI
+
+   notmuch:///<path>[?<item>=<name>[& ...]]
+
+   The <path> is absolute path to the the directory where is notmuch database
+   as returned by 'notmuch config get database.path' command. Note that the
+   <path> should NOT include .notmuch directory name.
+
+   Items:
+
+      query=<string>
+
+        See SEARCH SYNTAX in notmuch man page. Don't forget to use "and" and
+         "or" operators in your queries.
+
+      Note that proper URI should not contain blank space and all "bad" chars
+      should be encoded, for example
+
+        "tag:AAA and tag:BBB" --encoding-> tag:AAA%20and%20tag:BBB
+
+      but mutt config file parser is smart enough to accept space in quoted
+      strings. It means that you can use
+
+         "notmuch:///foo?query=tag:AAA and tag:BBB"
+
+      in your config files to keep things readable.
+
 
  * virtual mailboxes
 
diff --git a/url.c b/url.c
index 988cf59ee62119a5418bcab1d8412e8b82a826fa..dbde272b60cee3cf56deef1cd884f7f68b1850dc 100644 (file)
--- a/url.c
+++ b/url.c
@@ -40,12 +40,15 @@ static const struct mapping_t UrlMap[] =
   { "pop",     U_POP },
   { "pops",    U_POPS },
   { "mailto",  U_MAILTO },
+#ifdef USE_NOTMUCH
+  { "notmuch",  U_NOTMUCH },
+#endif
   { "smtp",     U_SMTP },
   { "smtps",    U_SMTPS },
   { NULL,      U_UNKNOWN }
 };
 
-static int url_pct_decode (char *s)
+int url_pct_decode (char *s)
 {
   char *d;
 
diff --git a/url.h b/url.h
index 926416e743e369510f092d2f9136625eb70c9067..bb54c657daa78d3c449bc96eb724918f55f3fd3d 100644 (file)
--- a/url.h
+++ b/url.h
@@ -11,6 +11,9 @@ typedef enum url_scheme
   U_SMTP,
   U_SMTPS,
   U_MAILTO,
+#ifdef USE_NOTMUCH
+  U_NOTMUCH,
+#endif
   U_UNKNOWN
 }
 url_scheme_t;
@@ -34,5 +37,6 @@ int url_parse_file (char *d, const char *src, size_t dl);
 int url_parse_ciss (ciss_url_t *ciss, char *src);
 int url_ciss_tostring (ciss_url_t* ciss, char* dest, size_t len, int flags);
 int url_parse_mailto (ENVELOPE *e, char **body, const char *src);
+int url_pct_decode (char *s);
 
 #endif