priorities for 0.13

2012-04-25 Thread Mark Walters

On Wed, 25 Apr 2012, David Bremner  wrote:
> Hi All;
>
> I'd like to have a feature freeze for 0.13 sometime in the first week of
> May.  What do people feel are priorities to try to get reviewed and
> pushed for 0.13?

I would like
id:"1331836090-30560-1-git-send-email-markwalters1009 at gmail.com" as I
think that is pretty close to the final piece for the exclude stuff.

I also think that
id:"1334431301-27303-1-git-send-email-markwalters1009 at gmail.com" (which
doesn't apply to master but I have a rebased version) makes excludes
rather nicer. If anyone thinks that might be plausible I will post the
rebased version.

Finally, I agree that I would like to see the html reply stuff.

Best wishes

Mark


[PATCH v2 2/2] emacs: Bind filter in search to 'l'

2012-04-25 Thread Mark Walters
Change the key binding for filter (or "limit") in search-mode. This
gives consistency with the new filter in show-mode, and frees 'f' for
forward-thread in the future.
---
 emacs/notmuch.el |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 736d00f..3df826c 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -286,7 +286,7 @@ For a mouse binding, return nil."
 (define-key map "=" 'notmuch-search-refresh-view)
 (define-key map "G" 'notmuch-search-poll-and-refresh-view)
 (define-key map "t" 'notmuch-search-filter-by-tag)
-(define-key map "f" 'notmuch-search-filter)
+(define-key map "l" 'notmuch-search-filter)
 (define-key map [mouse-1] 'notmuch-search-show-thread)
 (define-key map "*" 'notmuch-search-tag-all)
 (define-key map "a" 'notmuch-search-archive-thread)
@@ -1095,7 +1095,7 @@ search."
   (notmuch-search-refresh-view))

 (defun notmuch-search-filter (query)
-  "Filter the current search results based on an additional query string.
+  "Filter or LIMIT the current search results based on an additional query 
string.

 Runs a new search matching only messages that match both the
 current search results AND the additional query string provided."
-- 
1.7.9.1



[PATCH v2 0/2] Add filter to emacs show mode

2012-04-25 Thread Mark Walters
This is a new version of
id:"1335309421-18893-1-git-send-email-markwalters1009 at gmail.com" which
provides filtering or "limiting" function in emacs show mode.

Changes from the last version: move the binding to 'l' (mnemonic
"limit"), fixed an error if no new query string entered.

The second patch moves the keybinding for filter in search mode to 'l'
for consistency (let the bikeshedding begin!).

Best wishes

Mark




Mark Walters (2):
  emacs: add a filter option to show
  emacs: Bind filter in search to 'l'

 emacs/notmuch-show.el |   12 
 emacs/notmuch.el  |4 ++--
 2 files changed, 14 insertions(+), 2 deletions(-)

-- 
1.7.9.1



priorities for 0.13

2012-04-25 Thread Jameson Graef Rollins
On Wed, Apr 25 2012, David Bremner  wrote:
> I'd like to have a feature freeze for 0.13 sometime in the first week
> of May.  What do people feel are priorities to try to get reviewed and
> pushed for 0.13?

Here are things that I would like to see, and I think are ready to be
applied.  Pretty much everything here has either been reviewed or is
simple enough to not really need review (documentation change for
instance).

config list
id:"1334367666-10954-1-git-send-email-novalazy at gmail.com"

emacs-show: open excluded matches if no other matches
id:"1331836090-30560-1-git-send-email-markwalters1009 at gmail.com" 

emacs: fix archive thread/message function documentation.
id:"1326825796-8358-1-git-send-email-jrollins at finestructure.net"

emacs tagging cleanup, v3
id:"1334429574-12918-1-git-send-email-jrollins at finestructure.net"

emacs: Let the user choose where to compose new mails
id:"1334434815-7657-1-git-send-email-jrollins at finestructure.net" 

emacs: do not modify subject in search or show
id:"1334456272-10376-1-git-send-email-jrollins at finestructure.net" 

jamie.
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20120425/23811363/attachment.pgp>


[PATCH 1/7] Split notmuch_database_close into two functions

2012-04-25 Thread Justus Winter
Formerly notmuch_database_close closed the xapian database and
destroyed the talloc structure associated with the notmuch database
object. Split notmuch_database_close into notmuch_database_close and
notmuch_database_destroy.

This makes it possible for long running programs to close the xapian
database and thus release the lock associated with it without
destroying the data structures obtained from it.

This also makes the api more consistent since every other data
structure has a destructor function.

The comments in notmuch.h are a courtesy of Austin Clements.

Signed-off-by: Justus Winter <4winter at informatik.uni-hamburg.de>
---
 lib/database.cc |   14 --
 lib/notmuch.h   |   22 ++
 2 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/lib/database.cc b/lib/database.cc
index 16c4354..2fefcad 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -642,7 +642,7 @@ notmuch_database_open (const char *path,
 "   read-write mode.\n",
 notmuch_path, version, NOTMUCH_DATABASE_VERSION);
notmuch->mode = NOTMUCH_DATABASE_MODE_READ_ONLY;
-   notmuch_database_close (notmuch);
+   notmuch_database_destroy (notmuch);
notmuch = NULL;
goto DONE;
}
@@ -702,7 +702,7 @@ notmuch_database_open (const char *path,
 } catch (const Xapian::Error ) {
fprintf (stderr, "A Xapian exception occurred opening database: %s\n",
 error.get_msg().c_str());
-   notmuch_database_close (notmuch);
+   notmuch_database_destroy (notmuch);
notmuch = NULL;
 }

@@ -738,9 +738,19 @@ notmuch_database_close (notmuch_database_t *notmuch)
 }

 delete notmuch->term_gen;
+notmuch->term_gen = NULL;
 delete notmuch->query_parser;
+notmuch->query_parser = NULL;
 delete notmuch->xapian_db;
+notmuch->xapian_db = NULL;
 delete notmuch->value_range_processor;
+notmuch->value_range_processor = NULL;
+}
+
+void
+notmuch_database_destroy (notmuch_database_t *notmuch)
+{
+notmuch_database_close (notmuch);
 talloc_free (notmuch);
 }

diff --git a/lib/notmuch.h b/lib/notmuch.h
index 673c423..7d9e092 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -133,7 +133,7 @@ typedef struct _notmuch_filenames notmuch_filenames_t;
  *
  * After a successful call to notmuch_database_create, the returned
  * database will be open so the caller should call
- * notmuch_database_close when finished with it.
+ * notmuch_database_destroy when finished with it.
  *
  * The database will not yet have any data in it
  * (notmuch_database_create itself is a very cheap function). Messages
@@ -165,7 +165,7 @@ typedef enum {
  * An existing notmuch database can be identified by the presence of a
  * directory named ".notmuch" below 'path'.
  *
- * The caller should call notmuch_database_close when finished with
+ * The caller should call notmuch_database_destroy when finished with
  * this database.
  *
  * In case of any failure, this function returns NULL, (after printing
@@ -175,11 +175,25 @@ notmuch_database_t *
 notmuch_database_open (const char *path,
   notmuch_database_mode_t mode);

-/* Close the given notmuch database, freeing all associated
- * resources. See notmuch_database_open. */
+/* Close the given notmuch database.
+ *
+ * After notmuch_database_close has been called, calls to other
+ * functions on objects derived from this database may either behave
+ * as if the database had not been closed (e.g., if the required data
+ * has been cached) or may fail with a
+ * NOTMUCH_STATUS_XAPIAN_EXCEPTION.
+ *
+ * notmuch_database_close can be called multiple times.  Later calls
+ * have no effect.
+ */
 void
 notmuch_database_close (notmuch_database_t *database);

+/* Destroy the notmuch database, closing it if necessary and freeing
+* all associated resources. */
+void
+notmuch_database_destroy (notmuch_database_t *database);
+
 /* Return the database path of the given database.
  *
  * The return value is a string owned by notmuch so should not be
-- 
1.7.10



priorities for 0.13

2012-04-25 Thread Daniel Kahn Gillmor
On 04/25/2012 08:31 AM, David Bremner wrote:
> I'd like to have a feature freeze for 0.13 sometime in the first week of
> May.  What do people feel are priorities to try to get reviewed and
> pushed for 0.13?

I'd love it if Someone? would get S/MIME implemented, tested, and
reviewed, but it certainly won't be me before the first week of May.

--dkg

-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1030 bytes
Desc: OpenPGP digital signature
URL: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20120425/155ccdeb/attachment.pgp>


[PATCH 6/7] ruby: Use notmuch_database_destroy instead of notmuch_database_close

2012-04-25 Thread Austin Clements
On Mon, 23 Apr 2012, Justus Winter <4winter at informatik.uni-hamburg.de> wrote:
> Quoting Felipe Contreras (2012-04-23 14:36:33)
>> I don't think this is the right approach. If database_destroy truly
>> destroys the object, then we would want to do it only at garbage
>> collection, when it's not accessible any more. What if I want to
>> re-use the database from the Ruby code?
>> 
>> This would probably be better:
>> 
>>[...]
>
> You're probably right, I don't know the ruby bindings at all, I just
> wanted to preserve the old behavior. You are welcome to refine the
> ruby bindings later (or maintain them, I *believe* they are
> unmaintained, the last change was back in october 2011), but let's get
> this patch series in first.

I just marked this series ready, but I wasn't clear on what the
conclusion here was.  Feel free to mark it moreinfo again if it's not
actually ready (maybe mark just this patch?  it's a bit confusing since
the patches aren't quite all together.)


[PATCH 1/7] Split notmuch_database_close into two functions

2012-04-25 Thread Austin Clements
LGTM.

On Wed, 25 Apr 2012, Justus Winter <4winter at informatik.uni-hamburg.de> wrote:
> Formerly notmuch_database_close closed the xapian database and
> destroyed the talloc structure associated with the notmuch database
> object. Split notmuch_database_close into notmuch_database_close and
> notmuch_database_destroy.
>
> This makes it possible for long running programs to close the xapian
> database and thus release the lock associated with it without
> destroying the data structures obtained from it.
>
> This also makes the api more consistent since every other data
> structure has a destructor function.
>
> The comments in notmuch.h are a courtesy of Austin Clements.
>
> Signed-off-by: Justus Winter <4winter at informatik.uni-hamburg.de>


priorities for 0.13

2012-04-25 Thread David Bremner

Hi All;

I'd like to have a feature freeze for 0.13 sometime in the first week of
May.  What do people feel are priorities to try to get reviewed and
pushed for 0.13?

d


[PATCH v4 0/6] Config-related patches

2012-04-25 Thread Mark Walters

On Sat, 14 Apr 2012, Mark Walters  wrote:
> On Sat, 14 Apr 2012, Peter Wang  wrote:
>> Changes from v3:
>> - rephrase part of the 'list' implementation as a separate patch
>> - test 'set' on an extant key
>> - test removing keys
>
> This looks good to me. +1
>
> Two minor comments which you might like to consider (but definitely are
> not required):
> 1) You could check that there are no further arguments when the user
> calls `notmuch config list'
> 2) In the man page you could explicitly say what the output is for a
> configuration item which has not been set.
>
> Best wishes
>
> Mark

Just to make it completely clear the above was not meant to delay
acceptance of this series: I am quite happy with it as is.

Best wishes

Mark


[PATCH] emacs: add a filter option to show

2012-04-25 Thread David Bremner
Austin Clements  writes:
>
> I do have one request, though.  Could we bind this to 'l' for "limit"?
> Generally we've been quite good at making the shift key a modifier to
> the functionality of the lower-case binding, which argues against 'F'.
> It would also make sense to switch away from 'f' for filtering
> (limiting) in search-view; 'f' is one of the few bindings that's used
> in both search and show mode with completely different meanings and
> 'l' would be a good candidate for the related functionality in both
> views.

This sounds reasonable to me.

d


[PATCH] emacs: add a filter option to show

2012-04-25 Thread Mark Walters
On Wed, 25 Apr 2012, Austin Clements  wrote:
> LGTM.  I've been wanting this functionality for a while, but have been
> too lazy to implement it myself.
>
> I do have one request, though.  Could we bind this to 'l' for "limit"?
> Generally we've been quite good at making the shift key a modifier to
> the functionality of the lower-case binding, which argues against 'F'.
> It would also make sense to switch away from 'f' for filtering
> (limiting) in search-view; 'f' is one of the few bindings that's used
> in both search and show mode with completely different meanings and
> 'l' would be a good candidate for the related functionality in both
> views.

Yes I think that is a good idea. I will wait a little for other replies
and then send a new version. 

I think 'f' in search view should do a "forward-thread" functionality
which could also be linked from 'F' in show mode. I know we don't have
this functionality yet but unless people think it is not worth
supporting I think reserving the natural key is worth while.

Best wishes

Mark



priorities for 0.13

2012-04-25 Thread Adam Wolfe Gordon
Hi David,

On Wed, Apr 25, 2012 at 06:31, David Bremner  wrote:
> I'd like to have a feature freeze for 0.13 sometime in the first week of
> May. ?What do people feel are priorities to try to get reviewed and
> pushed for 0.13?

I would like to get the HTML reply series [1] in before 0.13, since
otherwise the reply stuff that's already pushed can cause some ugly
(but not buggy) behavior, quoting raw HTML in reply. There's been one
review, and it's a small patch, but I think it could use another set
of eyes.

[1] id:"1335056093-17621-1-git-send-email-awg+notmuch at xvx.ca"

-- Adam


[PATCH] emacs: add a filter option to show

2012-04-25 Thread Mark Walters
Show the current thread with a different filter (i.e., open messages
in the thread matching the new query).

Currently bound to 'F'.

Note that it is not the same as filter in search as it replaces the
existing query rather than ANDing with it (but it does keep the
threadid part of the query).
---

I think filtering (i.e. refining current query) is not ideal as one
might want to remove some aspects of the query. Hence this patch
replaces the query-context. 

Note does not fully work with excludes pending
id:"1331836090-30560-1-git-send-email-markwalters1009 at gmail.com"

Best wishes

Mark

 emacs/notmuch-show.el |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 30b26d1..4a5b8b1 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -42,6 +42,7 @@
 (declare-function notmuch-search-next-thread "notmuch" nil)
 (declare-function notmuch-search-show-thread "notmuch" nil)
 (declare-function notmuch-update-tags "notmuch" (current-tags tag-changes))
+(declare-function notmuch-read-query "notmuch" (prompt))

 (defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date")
   "Headers that should be shown in a message, in this order.
@@ -1157,6 +1158,7 @@ reset based on the original query."
(define-key map "s" 'notmuch-search)
(define-key map "m" 'notmuch-mua-new-mail)
(define-key map "f" 'notmuch-show-forward-message)
+   (define-key map "F" 'notmuch-show-filter-thread)
(define-key map "r" 'notmuch-show-reply-sender)
(define-key map "R" 'notmuch-show-reply)
(define-key map "|" 'notmuch-show-pipe-message)
@@ -1399,6 +1401,12 @@ current thread."
   "Mark the current message as read."
   (notmuch-show-tag-message "-unread"))

+(defun notmuch-show-filter-thread ()
+  "Show the current thread with a different filter"
+  (interactive)
+  (setq notmuch-show-query-context (notmuch-read-query "Filter thread: "))
+  (notmuch-show-refresh-view t))
+
 ;; Functions for getting attributes of several messages in the current
 ;; thread.

-- 
1.7.9.1



[PATCH 2/3] Moved global defvar of notmuch-hello-target to function local

2012-04-25 Thread Tomi Ollila
From: Tomi Ollila 

The global defvar notmuch-hello-target was used to silence compiler
'free variable' warning. Actually the variable (when used) was always
defined in (let...), shadowing the global in when dynamically scoped.
"Moving" the defvar in function (possibly functions in future) where it
is referenced is somewhat cleaner solution.

---
 emacs/notmuch-hello.el |9 +
 1 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 8ae0aca..c2cda19 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -235,14 +235,6 @@ supported for \"Customized queries section\" items."
notmuch-hello-query-section
(function :tag "Custom section"

-(defvar notmuch-hello-target nil
-  "Button text at position of point before rebuilding the notmuch-buffer.
-
-This variable contains the text of the button, if any, the
-point was positioned at before the notmuch-hello buffer was
-rebuilt. This should never actually be global and is defined as a
-defvar only for documentation purposes and to avoid a compiler
-warning about it occurring as a free variable.")

 (defvar notmuch-hello-hidden-sections nil
   "List of sections titles whose contents are hidden")
@@ -421,6 +413,7 @@ SEARCHES must be a list containing lists of the form (NAME 
QUERY COUNT), where
 QUERY is the query to start when the button for the corresponding entry is
 activated. COUNT should be the number of messages matching the query.
 Such a list can be computed with `notmuch-hello-query-counts'."
+  (defvar notmuch-hello-target) ;; dynamically bound in call path (or nil)
   (let* ((widest (notmuch-hello-longest-label searches))
 (tags-and-width (notmuch-hello-tags-per-line widest))
 (tags-per-line (car tags-and-width))
-- 
1.7.7.6



[PATCH 1/3] Removed variable notmuch-hello-search-pos

2012-04-25 Thread Tomi Ollila
From: Tomi Ollila 

Variable 'notmuch-hello-search-pos' was used to locate cursor to
the search bar in case no other location where to put it was known.
(In case search bar is shown -- if not cursor will be at the end
of buffer). More generic & versatile way to locace cursor follows. 

---
 emacs/notmuch-hello.el |   11 +--
 1 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 71d37b8..8ae0aca 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -154,11 +154,6 @@ International Bureau of Weights and Measures."
 (defvar notmuch-hello-url "http://notmuchmail.org;
   "The `notmuch' web site.")

-(defvar notmuch-hello-search-pos nil
-  "Position of search widget, if any.
-
-This should only be set by `notmuch-hello-insert-search'.")
-
 (defvar notmuch-hello-custom-section-options
   '((:filter (string :tag "Filter for each tag"))
 (:filter-count (string :tag "Different filter to generate message counts"))
@@ -589,7 +584,6 @@ Complete list of currently available key bindings:
 (defun notmuch-hello-insert-search ()
   "Insert a search widget."
   (widget-insert "Search: ")
-  (setq notmuch-hello-search-pos (point-marker))
   (widget-create 'editable-field
 ;; Leave some space at the start and end of the
 ;; search boxes.
@@ -807,11 +801,8 @@ following:
   (when final-target-pos
(goto-char final-target-pos)
(unless (widget-at)
- (widget-forward 1)))
+ (widget-forward 1)

-  (unless (widget-at)
-   (when notmuch-hello-search-pos
- (goto-char notmuch-hello-search-pos)
   (run-hooks 'notmuch-hello-refresh-hook)
   (setq notmuch-hello-first-run nil))

-- 
1.7.7.6



[PATCH 1/3] emacs: modify help message for notmuch-search-line-faces to reflect preferred "deleted" tag name.

2012-04-25 Thread David Bremner
Jameson Graef Rollins  writes:

> No functional change here.  The help message previously referred to
> the "delete" tag, but "deleted" is now preferred, so hopefully this
> will reduce any potential confusion.

I pushed this one patch from the series.

d


[PATCH v4 1/6] config: Fix free in 'config get' implementation.

2012-04-25 Thread David Bremner
Peter Wang  writes:

> The array returned by g_key_file_get_string_list() should be freed with
> g_strfreev(), not free().

Pushed this one patch from the series.

d


[PATCH] emacs: Put notmuch-hello-sections in custom group notmuch-hello

2012-04-25 Thread David Bremner

Pushed, 

d


[PATCH] emacs: Put notmuch-print-mechanism in custom group notmuch-show

2012-04-25 Thread David Bremner

Pushed, 

d


[PATCH v3 1/4] new: Consistently treat fatal errors as fatal

2012-04-25 Thread David Bremner
Austin Clements  writes:

> Previously, fatal errors in add_files_recursive were not treated as
> fatal by its callers (including itself!).  This makes
> add_files_recursive errors consistently fatal and updates all callers
> to treat them as fatal.

series pushed.

d


Re: [PATCH] emacs: add a filter option to show

2012-04-25 Thread Mark Walters
On Wed, 25 Apr 2012, Austin Clements amdra...@mit.edu wrote:
 LGTM.  I've been wanting this functionality for a while, but have been
 too lazy to implement it myself.

 I do have one request, though.  Could we bind this to 'l' for limit?
 Generally we've been quite good at making the shift key a modifier to
 the functionality of the lower-case binding, which argues against 'F'.
 It would also make sense to switch away from 'f' for filtering
 (limiting) in search-view; 'f' is one of the few bindings that's used
 in both search and show mode with completely different meanings and
 'l' would be a good candidate for the related functionality in both
 views.

Yes I think that is a good idea. I will wait a little for other replies
and then send a new version. 

I think 'f' in search view should do a forward-thread functionality
which could also be linked from 'F' in show mode. I know we don't have
this functionality yet but unless people think it is not worth
supporting I think reserving the natural key is worth while.

Best wishes

Mark

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


Re: [PATCH] emacs: add a filter option to show

2012-04-25 Thread David Bremner
Austin Clements amdra...@mit.edu writes:

 I do have one request, though.  Could we bind this to 'l' for limit?
 Generally we've been quite good at making the shift key a modifier to
 the functionality of the lower-case binding, which argues against 'F'.
 It would also make sense to switch away from 'f' for filtering
 (limiting) in search-view; 'f' is one of the few bindings that's used
 in both search and show mode with completely different meanings and
 'l' would be a good candidate for the related functionality in both
 views.

This sounds reasonable to me.

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


priorities for 0.13

2012-04-25 Thread David Bremner

Hi All;

I'd like to have a feature freeze for 0.13 sometime in the first week of
May.  What do people feel are priorities to try to get reviewed and
pushed for 0.13?

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


Re: priorities for 0.13

2012-04-25 Thread Adam Wolfe Gordon
Hi David,

On Wed, Apr 25, 2012 at 06:31, David Bremner da...@tethera.net wrote:
 I'd like to have a feature freeze for 0.13 sometime in the first week of
 May.  What do people feel are priorities to try to get reviewed and
 pushed for 0.13?

I would like to get the HTML reply series [1] in before 0.13, since
otherwise the reply stuff that's already pushed can cause some ugly
(but not buggy) behavior, quoting raw HTML in reply. There's been one
review, and it's a small patch, but I think it could use another set
of eyes.

[1] id:1335056093-17621-1-git-send-email-awg+notm...@xvx.ca

-- Adam
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 1/7] Split notmuch_database_close into two functions

2012-04-25 Thread Justus Winter
Formerly notmuch_database_close closed the xapian database and
destroyed the talloc structure associated with the notmuch database
object. Split notmuch_database_close into notmuch_database_close and
notmuch_database_destroy.

This makes it possible for long running programs to close the xapian
database and thus release the lock associated with it without
destroying the data structures obtained from it.

This also makes the api more consistent since every other data
structure has a destructor function.

The comments in notmuch.h are a courtesy of Austin Clements.

Signed-off-by: Justus Winter 4win...@informatik.uni-hamburg.de
---
 lib/database.cc |   14 --
 lib/notmuch.h   |   22 ++
 2 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/lib/database.cc b/lib/database.cc
index 16c4354..2fefcad 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -642,7 +642,7 @@ notmuch_database_open (const char *path,
read-write mode.\n,
 notmuch_path, version, NOTMUCH_DATABASE_VERSION);
notmuch-mode = NOTMUCH_DATABASE_MODE_READ_ONLY;
-   notmuch_database_close (notmuch);
+   notmuch_database_destroy (notmuch);
notmuch = NULL;
goto DONE;
}
@@ -702,7 +702,7 @@ notmuch_database_open (const char *path,
 } catch (const Xapian::Error error) {
fprintf (stderr, A Xapian exception occurred opening database: %s\n,
 error.get_msg().c_str());
-   notmuch_database_close (notmuch);
+   notmuch_database_destroy (notmuch);
notmuch = NULL;
 }
 
@@ -738,9 +738,19 @@ notmuch_database_close (notmuch_database_t *notmuch)
 }
 
 delete notmuch-term_gen;
+notmuch-term_gen = NULL;
 delete notmuch-query_parser;
+notmuch-query_parser = NULL;
 delete notmuch-xapian_db;
+notmuch-xapian_db = NULL;
 delete notmuch-value_range_processor;
+notmuch-value_range_processor = NULL;
+}
+
+void
+notmuch_database_destroy (notmuch_database_t *notmuch)
+{
+notmuch_database_close (notmuch);
 talloc_free (notmuch);
 }
 
diff --git a/lib/notmuch.h b/lib/notmuch.h
index 673c423..7d9e092 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -133,7 +133,7 @@ typedef struct _notmuch_filenames notmuch_filenames_t;
  *
  * After a successful call to notmuch_database_create, the returned
  * database will be open so the caller should call
- * notmuch_database_close when finished with it.
+ * notmuch_database_destroy when finished with it.
  *
  * The database will not yet have any data in it
  * (notmuch_database_create itself is a very cheap function). Messages
@@ -165,7 +165,7 @@ typedef enum {
  * An existing notmuch database can be identified by the presence of a
  * directory named .notmuch below 'path'.
  *
- * The caller should call notmuch_database_close when finished with
+ * The caller should call notmuch_database_destroy when finished with
  * this database.
  *
  * In case of any failure, this function returns NULL, (after printing
@@ -175,11 +175,25 @@ notmuch_database_t *
 notmuch_database_open (const char *path,
   notmuch_database_mode_t mode);
 
-/* Close the given notmuch database, freeing all associated
- * resources. See notmuch_database_open. */
+/* Close the given notmuch database.
+ *
+ * After notmuch_database_close has been called, calls to other
+ * functions on objects derived from this database may either behave
+ * as if the database had not been closed (e.g., if the required data
+ * has been cached) or may fail with a
+ * NOTMUCH_STATUS_XAPIAN_EXCEPTION.
+ *
+ * notmuch_database_close can be called multiple times.  Later calls
+ * have no effect.
+ */
 void
 notmuch_database_close (notmuch_database_t *database);
 
+/* Destroy the notmuch database, closing it if necessary and freeing
+* all associated resources. */
+void
+notmuch_database_destroy (notmuch_database_t *database);
+
 /* Return the database path of the given database.
  *
  * The return value is a string owned by notmuch so should not be
-- 
1.7.10

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


Re: [PATCH 1/7] Split notmuch_database_close into two functions

2012-04-25 Thread Austin Clements
LGTM.

On Wed, 25 Apr 2012, Justus Winter 4win...@informatik.uni-hamburg.de wrote:
 Formerly notmuch_database_close closed the xapian database and
 destroyed the talloc structure associated with the notmuch database
 object. Split notmuch_database_close into notmuch_database_close and
 notmuch_database_destroy.

 This makes it possible for long running programs to close the xapian
 database and thus release the lock associated with it without
 destroying the data structures obtained from it.

 This also makes the api more consistent since every other data
 structure has a destructor function.

 The comments in notmuch.h are a courtesy of Austin Clements.

 Signed-off-by: Justus Winter 4win...@informatik.uni-hamburg.de
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: priorities for 0.13

2012-04-25 Thread Daniel Kahn Gillmor
On 04/25/2012 08:31 AM, David Bremner wrote:
 I'd like to have a feature freeze for 0.13 sometime in the first week of
 May.  What do people feel are priorities to try to get reviewed and
 pushed for 0.13?

I'd love it if Someone™ would get S/MIME implemented, tested, and
reviewed, but it certainly won't be me before the first week of May.

--dkg



signature.asc
Description: OpenPGP digital signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: priorities for 0.13

2012-04-25 Thread Tomi Ollila
On Wed, Apr 25 2012, Adam Wolfe Gordon awg+notm...@xvx.ca wrote:

 Hi David,

 On Wed, Apr 25, 2012 at 06:31, David Bremner da...@tethera.net wrote:
 I'd like to have a feature freeze for 0.13 sometime in the first week of
 May.  What do people feel are priorities to try to get reviewed and
 pushed for 0.13?

 I would like to get the HTML reply series [1] in before 0.13, since
 otherwise the reply stuff that's already pushed can cause some ugly
 (but not buggy) behavior, quoting raw HTML in reply. There's been one
 review, and it's a small patch, but I think it could use another set
 of eyes.

 [1] id:1335056093-17621-1-git-send-email-awg+notm...@xvx.ca

Yes I agree on this -- I've been hand-adding text from html-only email
to my reply buffers for now. Is there anything to comment on Mark's 
thoughts there ?

I browsed through http://nmbug.tethera.net/status/ ; personally I'd like to
see id:1327996914-9644-3-git-send-email-...@dme.org.

Also the 'Maybe Ready' queue looks good (as it should be). And the few
(trivial) patches Austin is going to send (and we have reviewed) that
are good to get before SONAME change are good to have.

 -- Adam

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


[PATCH v2 0/2] Add filter to emacs show mode

2012-04-25 Thread Mark Walters
This is a new version of
id:1335309421-18893-1-git-send-email-markwalters1...@gmail.com which
provides filtering or limiting function in emacs show mode.

Changes from the last version: move the binding to 'l' (mnemonic
limit), fixed an error if no new query string entered.

The second patch moves the keybinding for filter in search mode to 'l'
for consistency (let the bikeshedding begin!).

Best wishes

Mark




Mark Walters (2):
  emacs: add a filter option to show
  emacs: Bind filter in search to 'l'

 emacs/notmuch-show.el |   12 
 emacs/notmuch.el  |4 ++--
 2 files changed, 14 insertions(+), 2 deletions(-)

-- 
1.7.9.1

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


[PATCH v2 1/2] emacs: add a filter option to show

2012-04-25 Thread Mark Walters
Show the current thread with a different filter (i.e., open messages
in the thread matching the new query).

Bound to 'l' for limit.

Note that it is not the same as filter in search mode as it replaces
the existing query rather than ANDing with it (but it does keep the
thread-id part of the query).
---
 emacs/notmuch-show.el |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 30b26d1..4b4d663 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -42,6 +42,7 @@
 (declare-function notmuch-search-next-thread notmuch nil)
 (declare-function notmuch-search-show-thread notmuch nil)
 (declare-function notmuch-update-tags notmuch (current-tags tag-changes))
+(declare-function notmuch-read-query notmuch (prompt))
 
 (defcustom notmuch-message-headers '(Subject To Cc Date)
   Headers that should be shown in a message, in this order.
@@ -1157,6 +1158,7 @@ reset based on the original query.
(define-key map s 'notmuch-search)
(define-key map m 'notmuch-mua-new-mail)
(define-key map f 'notmuch-show-forward-message)
+   (define-key map l 'notmuch-show-filter-thread)
(define-key map r 'notmuch-show-reply-sender)
(define-key map R 'notmuch-show-reply)
(define-key map | 'notmuch-show-pipe-message)
@@ -1399,6 +1401,16 @@ current thread.
   Mark the current message as read.
   (notmuch-show-tag-message -unread))
 
+(defun notmuch-show-filter-thread ()
+  Filter or LIMIT the current thread based on a new query string.
+
+Reshows the current thread with matches defined by the new query-string.
+  (interactive)
+  (setq notmuch-show-query-context (notmuch-read-query Filter thread: ))
+  (when (string= notmuch-show-query-context )
+(setq notmuch-show-query-context nil))
+  (notmuch-show-refresh-view t))
+
 ;; Functions for getting attributes of several messages in the current
 ;; thread.
 
-- 
1.7.9.1

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


[PATCH v2 2/2] emacs: Bind filter in search to 'l'

2012-04-25 Thread Mark Walters
Change the key binding for filter (or limit) in search-mode. This
gives consistency with the new filter in show-mode, and frees 'f' for
forward-thread in the future.
---
 emacs/notmuch.el |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 736d00f..3df826c 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -286,7 +286,7 @@ For a mouse binding, return nil.
 (define-key map = 'notmuch-search-refresh-view)
 (define-key map G 'notmuch-search-poll-and-refresh-view)
 (define-key map t 'notmuch-search-filter-by-tag)
-(define-key map f 'notmuch-search-filter)
+(define-key map l 'notmuch-search-filter)
 (define-key map [mouse-1] 'notmuch-search-show-thread)
 (define-key map * 'notmuch-search-tag-all)
 (define-key map a 'notmuch-search-archive-thread)
@@ -1095,7 +1095,7 @@ search.
   (notmuch-search-refresh-view))
 
 (defun notmuch-search-filter (query)
-  Filter the current search results based on an additional query string.
+  Filter or LIMIT the current search results based on an additional query 
string.
 
 Runs a new search matching only messages that match both the
 current search results AND the additional query string provided.
-- 
1.7.9.1

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


Re: priorities for 0.13

2012-04-25 Thread Mark Walters

On Wed, 25 Apr 2012, David Bremner da...@tethera.net wrote:
 Hi All;

 I'd like to have a feature freeze for 0.13 sometime in the first week of
 May.  What do people feel are priorities to try to get reviewed and
 pushed for 0.13?

I would like
id:1331836090-30560-1-git-send-email-markwalters1...@gmail.com as I
think that is pretty close to the final piece for the exclude stuff.

I also think that
id:1334431301-27303-1-git-send-email-markwalters1...@gmail.com (which
doesn't apply to master but I have a rebased version) makes excludes
rather nicer. If anyone thinks that might be plausible I will post the
rebased version.

Finally, I agree that I would like to see the html reply stuff.

Best wishes

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


Re: [PATCH] ruby: make sure the database is closed

2012-04-25 Thread Ali Polatel
2012/4/24 Felipe Contreras felipe.contre...@gmail.com:
 On Tue, Apr 24, 2012 at 4:15 AM, Austin Clements amdra...@mit.edu wrote:
 Quoth Felipe Contreras on Apr 24 at  3:45 am:
 On Tue, Apr 24, 2012 at 2:46 AM, Ali Polatel a...@exherbo.org wrote:
  2012/4/24 Felipe Contreras felipe.contre...@gmail.com:

  Personally I don't see why an object, like say a query would remain
  working correctly after the database is gone, either by calling
  .close() directly, or just loosing the pointer to the original object.
  I don't think users would expect that, or, even if they somehow found
  it useful, that most likely would be very seldom, and hardly worth
  worrying about it.
 
  Working correctly is not expected but wouldn't it be more appropriate
  to throw an exception rather than dumping core or printing on standard 
  error?

 Sure, if that was possible.

  I wonder whether we can make both work somehow.
  Maybe by using talloc explicitly and keeping reference pointers?
  I don't know whether it's worth bothering.

 Maybe, I don't see how, that's just not how C works. Maybe talloc does
 have some way to figure out if a pointer has been freed, but I doubt
 that, and I can't find it by grepping through the API.

 Another option would be hook into talloc's destructor so we know when
 an object is freed and taint it, but then we would be overriding
 notmuch's destructor, and there's no way around that (unless we tap
 into talloc's internal structures). A way to workaround that would be
 to modify notmuch's API so that we can specify a destructor for
 notmuch objects, but that would be tedious, and I doubt a lof people
 beside us would benefit from that.

 I believe (though I might be wrong) that bindings could simply
 maintain their own talloc references to C objects returned by
 libnotmuch to prevent them from being freed until the wrapper object
 is garbage collected.  This would require modifying all of the
 library's _destroy functions to use talloc_find_parent_bytype and
 talloc_unlink instead of simply calling talloc_free, but I don't think
 this change would be particularly invasive and it certainly wouldn't
 affect the library interface.

 That might work, but still, I don't see why this patch can't be applied.

I don't have anything against applying this patch.
If this fix has a kind of urgency -and I doubt it does- please get
someone to push the patch.
Below is my confirmation to accept the consequences:
LGTM

Otherwise, I'd rather we fix it properly most probably using the
method described in Austin's previous mail.

 Cheers.

 --
 Felipe Contreras

-alip
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [ANN] New awesome vim plug-in using Ruby bindings

2012-04-25 Thread Felipe Contreras
2012/4/23 Felipe Contreras felipe.contre...@gmail.com:
 So, since I'm a big fan of Ruby, I decided to try my luck writing a
 plug-in from scratch. It took me one weekend, but I'm pretty happy
 with the result. This plug-in has already essentially all the
 functionality of the current one, but it's much, *much* simpler (only
 600) lines of code.

 And in addition has many more features:

  * Gradual searches; you don't have to wait for the whole search to finish,
   sort of like the 'less' command
  * Proper multi-part handling; finds out if there's text/plain, or if
   text/html, converts it using elinks
  * Extract all attachments
  * Open message with mutt (or any external application that can open an mbox)
  * More proper UTF-8 handling
  * Configurable key mappings
  * Much simpler, cleaner, beautiful, and extensible code (only 600 lines!)

In case anybody is interested, here's a screencast showing some of the
features :)
http://youtu.be/JGD7IbZmnIs

Cheers.

-- 
Felipe Contreras
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: priorities for 0.13

2012-04-25 Thread Jameson Graef Rollins
On Wed, Apr 25 2012, David Bremner da...@tethera.net wrote:
 I'd like to have a feature freeze for 0.13 sometime in the first week
 of May.  What do people feel are priorities to try to get reviewed and
 pushed for 0.13?

Here are things that I would like to see, and I think are ready to be
applied.  Pretty much everything here has either been reviewed or is
simple enough to not really need review (documentation change for
instance).

config list
id:1334367666-10954-1-git-send-email-noval...@gmail.com

emacs-show: open excluded matches if no other matches
id:1331836090-30560-1-git-send-email-markwalters1...@gmail.com 

emacs: fix archive thread/message function documentation.
id:1326825796-8358-1-git-send-email-jroll...@finestructure.net

emacs tagging cleanup, v3
id:1334429574-12918-1-git-send-email-jroll...@finestructure.net

emacs: Let the user choose where to compose new mails
id:1334434815-7657-1-git-send-email-jroll...@finestructure.net 

emacs: do not modify subject in search or show
id:1334456272-10376-1-git-send-email-jroll...@finestructure.net 

jamie.


pgpcHVTis5rL9.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch