]> git.notmuchmail.org Git - notmuch-wiki/commitdiff
A new howto document, as this is not really emacstips specific
authorSebastian Spaeth <Sebastian@SSpaeth.de>
Tue, 18 May 2010 22:14:18 +0000 (15:14 -0700)
committerSebastian Spaeth <Sebastian@SSpaeth.de>
Tue, 18 May 2010 22:14:18 +0000 (15:14 -0700)
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
howto.mdwn [new file with mode: 0644]

diff --git a/howto.mdwn b/howto.mdwn
new file mode 100644 (file)
index 0000000..30e8134
--- /dev/null
@@ -0,0 +1,13 @@
+[[!img notmuch-logo.png alt="Notmuch logo" class="left"]]
+#How to...
+
+##<span id="print_filenames">.. print only filenames of a search</span>
+
+Given you have the python bindings installed (or simply set your PYTHONPATH environment variable to point to the .../bindings/python directory), this script will print the filenames of a matching search:
+
+                                #!/usr/bin/env python
+                                import sys
+                                import notmuch
+                                
+                                q = notmuch.Database().create_query(" ".join(sys.argv[1:]))
+                                for m in q.search_messages(): print m.get_filename()