sanitization of args notmuch-cli in notmuch-emacs

2014-02-03 Thread Tomi Ollila
On Mon, Feb 03 2014, Tomi Ollila wrote: > On Mon, Feb 03 2014, David Bremner wrote: > >> Antoine Beaupr? found a bug when notmuch-saved-searches contains >> newlines: >> >> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=737496 >> >> We can remove newlines with something like >>

[PATCH 00/17] nmbug-status: Python-3-compabitility and general refactoring

2014-02-03 Thread Tomi Ollila
On Mon, Feb 03 2014, "W. Trevor King" wrote: > I noticed that nmbug-status was written in Python :), but not > compatible with Python 3 :(. I started cleaning up a few print > statements, but this quickly turned into a more general refactoring. > Let me know if this is too much to bite off at on

[PATCH 2/2] emacs: Prefer Content-Description over filename for part buttons

2014-02-03 Thread Tomi Ollila
On Mon, Feb 03 2014, "W. Trevor King" wrote: > On the rss2email list, Victor Orlikowski pointed out [1] that a number > of MUAs don't use the Subject header of attached message/rfc822 parts > to label multipart/digest subparts [2]. Instead, notmuch and several > other MUAs use the filename param

sanitization of args notmuch-cli in notmuch-emacs

2014-02-03 Thread Tomi Ollila
On Mon, Feb 03 2014, David Bremner wrote: > Antoine Beaupr? found a bug when notmuch-saved-searches contains > newlines: > > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=737496 > > We can remove newlines with something like > > (mapcar (lambda (arg) > (replace-reg

notmuch killed due to out of memory - how to move forward

2014-02-03 Thread Hamish Downer
Hello I recently deleted almost 3 old messages from my maildirs, and since I did that, notmuch new has not managed to complete. I have it running on a server with 1 GB of RAM, and the output is telling me Cleaned up 25515 of 29803 messages (1m 10s remaining). at the point it is killed.

[PATCH v3 6/6] lib: parse messages only once

2014-02-03 Thread Jani Nikula
Use the previously parsed gmime message for indexing instead of running an extra parsing pass. After this change, we'll only do unnecessary parsing of the message body for duplicates and non-messages. For regular non-duplicate messages, we have now shaved off an extra header parsing round during i

[PATCH v3 5/6] lib: replace the header parser with gmime

2014-02-03 Thread Jani Nikula
The notmuch library includes a full blown message header parser. Yet the same message headers are parsed by gmime during indexing. Switch to gmime parsing completely. These are the main differences between the parsers: * Gmime stops header parsing at the first invalid header, and presumes the m

[PATCH v3 4/6] cli: sanitize the received header before scanning for replies

2014-02-03 Thread Jani Nikula
This makes the from guessing agnostic to header folding by spaces or tabs. --- notmuch-reply.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/notmuch-reply.c b/notmuch-reply.c index 47993d2..3f7021e 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -21,6 +21,

[PATCH v3 3/6] util: make sanitize string available in string util for reuse

2014-02-03 Thread Jani Nikula
No functional changes. --- notmuch-search.c | 19 --- util/string-util.c | 22 ++ util/string-util.h | 7 +++ 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/notmuch-search.c b/notmuch-search.c index 0262eb3..bc9be45 100644 --- a/notmuch-

[PATCH v3 2/6] cli: refactor reply from guessing

2014-02-03 Thread Jani Nikula
The guess_from_received_header() function had grown quite big. Chop it up into smaller functions. No functional changes. --- notmuch-reply.c | 198 ++-- 1 file changed, 122 insertions(+), 76 deletions(-) diff --git a/notmuch-reply.c b/notmuch-r

[PATCH v3 1/6] cli: sanitize tabs and newlines to spaces in notmuch search

2014-02-03 Thread Jani Nikula
Sanitize tabs and newlines to spaces rather than question marks in --output=summary --format=text output. This will also hide any difference in unfolding a header that has been folded with a tab. Our own header parser replaces tabs with spaces, while gmime would retain the tab. --- notmuch-search

[PATCH v3 0/6] lib: replace the message header parser with gmime

2014-02-03 Thread Jani Nikula
This is v3 of id:cover.1385825425.git.jani at nikula.org As before, patches 1-4 are prep work that could be merged on their own, and patches 5-6 actually make the change. The only changes since v2 are cosmetic: rebase, changes in comments, function names, and commit messages. BR, Jani. Jani Ni

[PATCH 2/2] emacs: Prefer Content-Description over filename for part buttons

2014-02-03 Thread Mark Walters
On Mon, 03 Feb 2014, "W. Trevor King" wrote: > On the rss2email list, Victor Orlikowski pointed out [1] that a number > of MUAs don't use the Subject header of attached message/rfc822 parts > to label multipart/digest subparts [2]. Instead, notmuch and several > other MUAs use the filename param

notmuch killed by out of memory - how to move forward

2014-02-03 Thread Hamish D
Hello I recently deleted almost 3 old messages from my maildirs, and since I did that, notmuch new has not managed to complete. I have it running on a server with 1 GB of RAM, and the output is telling me Cleaned up 25515 of 29803 messages (1m 10s remaining). at the point it is killed.

notmuch new crashing due to out of memory - how to deal with it

2014-02-03 Thread Hamish D
Hello I recently deleted almost 3 old messages from my maildirs, and since I did that, notmuch new has not managed to complete. I have it running on a server with 1 GB of RAM, and the output is telling me Cleaned up 25515 of 29803 messages (1m 10s remaining). at the point it is killed.

Re: [PATCH 2/2] emacs: Prefer Content-Description over filename for part buttons

2014-02-03 Thread W. Trevor King
On Mon, Feb 03, 2014 at 12:34:18PM -0800, W. Trevor King wrote: > On Mon, Feb 03, 2014 at 08:15:35PM +, Mark Walters wrote: > > I think we should only display/use the content-description if it > > exists and is non-empty. > > Sounds good to me. I'll queue this and a test for v2. Rather than

[PATCH 2/2] emacs: Prefer Content-Description over filename for part buttons

2014-02-03 Thread W. Trevor King
Type: application/pgp-signature Size: 836 bytes Desc: OpenPGP digital signature URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20140203/9ba222ab/attachment-0001.pgp>

Re: [PATCH 00/17] nmbug-status: Python-3-compabitility and general refactoring

2014-02-03 Thread W. Trevor King
On Mon, Feb 03, 2014 at 11:10:23PM +0200, Tomi Ollila wrote: > data['message-id-term'] = 'id:"{}"'.format(value) > ValueError: zero length field name in format Oops, Python 2.6 still needs explicit indexes ('{0}', not '{}'). It's an easy fix, so I'll queue it for v2. You're still going to ne

[PATCH 00/17] nmbug-status: Python-3-compabitility and general refactoring

2014-02-03 Thread W. Trevor King
on-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: OpenPGP digital signature URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20140203/a4a76b54/attachment.pgp>

[PATCH v3 6/6] lib: parse messages only once

2014-02-03 Thread Austin Clements
Quoth Jani Nikula on Feb 03 at 9:51 pm: > Use the previously parsed gmime message for indexing instead of > running an extra parsing pass. > > After this change, we'll only do unnecessary parsing of the message > body for duplicates and non-messages. For regular non-duplicate > messages, we have

[PATCH v3 5/6] lib: replace the header parser with gmime

2014-02-03 Thread Austin Clements
Quoth Jani Nikula on Feb 03 at 9:51 pm: > The notmuch library includes a full blown message header parser. Yet > the same message headers are parsed by gmime during indexing. Switch > to gmime parsing completely. > > These are the main differences between the parsers: > > * Gmime stops header pa

[PATCH 1/1] emacs: initialize ido(-completing-read) in emacs 23.[123]

2014-02-03 Thread David Bremner
Tomi Ollila writes: > Otherwise `ido-completing-read' will freeze after PROMPT is displayed. > --- pushed. d

[PATCH] completion: bash completion for notmuch new --quiet option

2014-02-03 Thread David Bremner
Jani Nikula writes: > notmuch new now has --quiet option, complete it too. pushed, but uh not tested. Now I feel like a bad person. d

[PATCH] configure: only install bash completion if supported

2014-02-03 Thread David Bremner
Jani Nikula writes: > Our bash completion depends on bash-completion 1.90 or later. Only > install where available. pushed. d

Re: [PATCH 2/2] emacs: Prefer Content-Description over filename for part buttons

2014-02-03 Thread W. Trevor King
On Mon, Feb 03, 2014 at 10:44:39PM +0200, Tomi Ollila wrote: > having notmuch patch email as expected test output feels a bit > confusing to me -- especially as 'git grep' may catch some of the > (possibly future-outdated) content... There were two very similar patches with filename attachments in

[PATCH 2/2] emacs: Prefer Content-Description over filename for part buttons

2014-02-03 Thread W. Trevor King
://en.wikipedia.org/wiki/Pretty_Good_Privacy -- next part -- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: OpenPGP digital signature URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20140203/91f518cd/attachment.pgp>

[PATCH v3 4/6] cli: sanitize the received header before scanning for replies

2014-02-03 Thread Austin Clements
Quoth Jani Nikula on Feb 03 at 9:51 pm: > This makes the from guessing agnostic to header folding by spaces or > tabs. > --- > notmuch-reply.c | 12 ++-- > 1 file changed, 10 insertions(+), 2 deletions(-) > > diff --git a/notmuch-reply.c b/notmuch-reply.c > index 47993d2..3f7021e 100644

sanitization of args notmuch-cli in notmuch-emacs

2014-02-03 Thread David Bremner
Antoine Beaupr? found a bug when notmuch-saved-searches contains newlines: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=737496 We can remove newlines with something like (mapcar (lambda (arg) (replace-regexp-in-string "\n" " " arg)) args) I wonder if we should d

notmuch killed due to out of memory - how to move forward

2014-02-03 Thread Hamish Downer
Hello I recently deleted almost 3 old messages from my maildirs, and since I did that, notmuch new has not managed to complete. I have it running on a server with 1 GB of RAM, and the output is telling me Cleaned up 25515 of 29803 messages (1m 10s remaining). at the point it is killed.

Re: [PATCH v3 6/6] lib: parse messages only once

2014-02-03 Thread Austin Clements
Quoth Jani Nikula on Feb 03 at 9:51 pm: > Use the previously parsed gmime message for indexing instead of > running an extra parsing pass. > > After this change, we'll only do unnecessary parsing of the message > body for duplicates and non-messages. For regular non-duplicate > messages, we have

Re: [PATCH v3 5/6] lib: replace the header parser with gmime

2014-02-03 Thread Austin Clements
Quoth Jani Nikula on Feb 03 at 9:51 pm: > The notmuch library includes a full blown message header parser. Yet > the same message headers are parsed by gmime during indexing. Switch > to gmime parsing completely. > > These are the main differences between the parsers: > > * Gmime stops header pa

Re: sanitization of args notmuch-cli in notmuch-emacs

2014-02-03 Thread Tomi Ollila
On Mon, Feb 03 2014, Tomi Ollila wrote: > On Mon, Feb 03 2014, David Bremner wrote: > >> Antoine Beaupré found a bug when notmuch-saved-searches contains >> newlines: >> >> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=737496 >> >> We can remove newlines with something like >>

Re: [PATCH 00/17] nmbug-status: Python-3-compabitility and general refactoring

2014-02-03 Thread Tomi Ollila
On Mon, Feb 03 2014, "W. Trevor King" wrote: > I noticed that nmbug-status was written in Python :), but not > compatible with Python 3 :(. I started cleaning up a few print > statements, but this quickly turned into a more general refactoring. > Let me know if this is too much to bite off at on

Re: [PATCH v3 4/6] cli: sanitize the received header before scanning for replies

2014-02-03 Thread Austin Clements
Quoth Jani Nikula on Feb 03 at 9:51 pm: > This makes the from guessing agnostic to header folding by spaces or > tabs. > --- > notmuch-reply.c | 12 ++-- > 1 file changed, 10 insertions(+), 2 deletions(-) > > diff --git a/notmuch-reply.c b/notmuch-reply.c > index 47993d2..3f7021e 100644

Re: sanitization of args notmuch-cli in notmuch-emacs

2014-02-03 Thread Tomi Ollila
On Mon, Feb 03 2014, David Bremner wrote: > Antoine Beaupré found a bug when notmuch-saved-searches contains > newlines: > > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=737496 > > We can remove newlines with something like > > (mapcar (lambda (arg) > (replace-reg

Re: [PATCH 2/2] emacs: Prefer Content-Description over filename for part buttons

2014-02-03 Thread W. Trevor King
On Mon, Feb 03, 2014 at 08:15:35PM +, Mark Walters wrote: > I think we should only display/use the content-description if it > exists and is non-empty. Sounds good to me. I'll queue this and a test for v2. > My only other comment on the series is that you should update > devel/schemata in th

[PATCH 2/2] emacs: Prefer Content-Description over filename for part buttons

2014-02-03 Thread W. Trevor King
/pipermail/notmuch/attachments/20140203/205db4d3/attachment.pgp>

Re: [PATCH 1/1] emacs: initialize ido(-completing-read) in emacs 23.[123]

2014-02-03 Thread David Bremner
Tomi Ollila writes: > Otherwise `ido-completing-read' will freeze after PROMPT is displayed. > --- pushed. d ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch

Re: [PATCH] completion: bash completion for notmuch new --quiet option

2014-02-03 Thread David Bremner
Jani Nikula writes: > notmuch new now has --quiet option, complete it too. pushed, but uh not tested. Now I feel like a bad person. d ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch

Re: [PATCH] configure: only install bash completion if supported

2014-02-03 Thread David Bremner
Jani Nikula writes: > Our bash completion depends on bash-completion 1.90 or later. Only > install where available. pushed. d ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch

[PATCH v3 6/6] lib: parse messages only once

2014-02-03 Thread Jani Nikula
Use the previously parsed gmime message for indexing instead of running an extra parsing pass. After this change, we'll only do unnecessary parsing of the message body for duplicates and non-messages. For regular non-duplicate messages, we have now shaved off an extra header parsing round during i

[PATCH v3 2/6] cli: refactor reply from guessing

2014-02-03 Thread Jani Nikula
The guess_from_received_header() function had grown quite big. Chop it up into smaller functions. No functional changes. --- notmuch-reply.c | 198 ++-- 1 file changed, 122 insertions(+), 76 deletions(-) diff --git a/notmuch-reply.c b/notmuch-r

[PATCH v3 5/6] lib: replace the header parser with gmime

2014-02-03 Thread Jani Nikula
The notmuch library includes a full blown message header parser. Yet the same message headers are parsed by gmime during indexing. Switch to gmime parsing completely. These are the main differences between the parsers: * Gmime stops header parsing at the first invalid header, and presumes the m

[PATCH v3 0/6] lib: replace the message header parser with gmime

2014-02-03 Thread Jani Nikula
This is v3 of id:cover.1385825425.git.j...@nikula.org As before, patches 1-4 are prep work that could be merged on their own, and patches 5-6 actually make the change. The only changes since v2 are cosmetic: rebase, changes in comments, function names, and commit messages. BR, Jani. Jani Nikul

[PATCH v3 1/6] cli: sanitize tabs and newlines to spaces in notmuch search

2014-02-03 Thread Jani Nikula
Sanitize tabs and newlines to spaces rather than question marks in --output=summary --format=text output. This will also hide any difference in unfolding a header that has been folded with a tab. Our own header parser replaces tabs with spaces, while gmime would retain the tab. --- notmuch-search

[PATCH v3 3/6] util: make sanitize string available in string util for reuse

2014-02-03 Thread Jani Nikula
No functional changes. --- notmuch-search.c | 19 --- util/string-util.c | 22 ++ util/string-util.h | 7 +++ 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/notmuch-search.c b/notmuch-search.c index 0262eb3..bc9be45 100644 --- a/notmuch-

[PATCH v3 4/6] cli: sanitize the received header before scanning for replies

2014-02-03 Thread Jani Nikula
This makes the from guessing agnostic to header folding by spaces or tabs. --- notmuch-reply.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/notmuch-reply.c b/notmuch-reply.c index 47993d2..3f7021e 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -21,6 +21,

sanitization of args notmuch-cli in notmuch-emacs

2014-02-03 Thread David Bremner
Antoine Beaupré found a bug when notmuch-saved-searches contains newlines: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=737496 We can remove newlines with something like (mapcar (lambda (arg) (replace-regexp-in-string "\n" " " arg)) args) I wonder if w

[PATCH 0/2]

2014-02-03 Thread David Bremner
"W. Trevor King" writes: > > p.s. I checked a few earlier patches on the list and didn't see > reviewer CCs. On the other hand, I didn't see any Reply-To headers > either, so I'm CCing my reviewers to be safe ;). Let me know if the > convention is to not CC reviewers, and I'll restrict future >

show inline html images as attachments in emacs notmuch-show

2014-02-03 Thread David Belohrad
Hi Mark, thanks for info. I correct myself. The CID images in my case do not link correctly when email opened as text/plain. They do however work when email is opened as text/html. In case of text/html they nicely are shown inline. In case of text/plain the link is somehow live, but cid: is in di

show inline html images as attachments in emacs notmuch-show

2014-02-03 Thread David Belohrad
Hi all, I can confirm this behaviour as well. With certain emails the CID images are not displayed, and there is no means how to show them except writing on disk and view externally. i have reported this problem some times ago, but I haven't find any solution yet. http://notmuchmail.org/pipermai

show inline html images as attachments in emacs notmuch-show

2014-02-03 Thread Mark Walters
Hi On Mon, 03 Feb 2014, David Belohrad wrote: > Hi all, > > I can confirm this behaviour as well. With certain emails the CID images > are not displayed, and there is no means how to show them except writing > on disk and view externally. > > i have reported this problem some times ago, but I ha

[RFC] Content-Description when naming MIME parts in Emacs mode

2014-02-03 Thread Mark Walters
On Sun, 02 Feb 2014, "W. Trevor King" wrote: > On the rss2email list, Victor Orlikowski pointed out [1] that a number > of MUAs don't use the Subject header of attached message/rfc822 parts > to label multipart/digest subparts [2]. Instead, notmuch and several > other MUAs use the filename parame

Re: [PATCH 0/2]

2014-02-03 Thread David Bremner
"W. Trevor King" writes: > > p.s. I checked a few earlier patches on the list and didn't see > reviewer CCs. On the other hand, I didn't see any Reply-To headers > either, so I'm CCing my reviewers to be safe ;). Let me know if the > convention is to not CC reviewers, and I'll restrict future >

[PATCH 10/17] nmbug-status: Add Page and HtmlPage for modular rendering

2014-02-03 Thread W. Trevor King
I was having trouble understanding the logic of the longish print_view function, so I refactored the output generation into modular bits. The basic text rendering is handled by Page, which has enough hooks that HtmlPage can borrow the logic and slot-in HTML generators. By modularizing the logic it

[PATCH 06/17] nmbug-status: Consolidate functions and main code

2014-02-03 Thread W. Trevor King
The definitions of Thread, output_with_separator, and print_view were between the main argparse and view-printing code. Group them together with our existing read_config at the top of the module, which makes for easier reading in the main section. I also: * Made 'headers' a print_view argument i

[PATCH 16/17] nmbug-status: Use and markup where appropriate

2014-02-03 Thread W. Trevor King
* Wrap free text in tags. * Convert to for query strings. * Wrap message-id-term (id:"...") in . The tags get nicer default markup (smaller monospace font) for notmuch query terms [1]. The tags don't have much effect without attached CSS, but bare text (phrasing content [2]) in (which expec

[PATCH 13/17] nmbug-status: Encode output using the user's locale

2014-02-03 Thread W. Trevor King
Instead of always writing UTF-8, allow the user to configure the output encoding using their locale. This is useful for previewing output in the terminal, for poor souls that don't use UTF-8 locales ;). --- devel/nmbug/nmbug-status | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) dif

[PATCH 15/17] nmbug-status: Quote the title when using it as an id

2014-02-03 Thread W. Trevor King
Also allow manual id overrides from the JSON config. Quoting avoids errors like: Bad value '#Possible bugs' for attribute href on element a: Whitespace in fragment component. Use %20 in place of spaces. from http://validator.w3.org. --- devel/nmbug/nmbug-status | 6 -- 1 file changed,

[PATCH 09/17] nmbug-status: Add a Python-3-compatible urllib.parse.quote import

2014-02-03 Thread W. Trevor King
Python 2's urllib.quote [1] has moved to urllib.parse.quote in Python 3 [2]. [1]: http://docs.python.org/2/library/urllib.html#urllib.quote [2]: http://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote --- devel/nmbug/nmbug-status | 9 ++--- 1 file changed, 6 insertions(+), 3 del

[PATCH 08/17] nmbug-status: Consolidate HTML header printing

2014-02-03 Thread W. Trevor King
Make this all one big string, using '...{date}...'.format(date=...) to inject the date [1]. This syntax was added in Python 2.6, and is preferred to %-formatting in Python 3 [1]. [1]: http://docs.python.org/2/library/stdtypes.html#str.format --- devel/nmbug/nmbug-status | 13 ++--- 1 fil

[PATCH 01/17] nmbug-status: Convert to Python-3-compatible print functions

2014-02-03 Thread W. Trevor King
We shouldn't require folks to install Python 2 to run nmbug-status. --- devel/nmbug/nmbug-status | 44 +++- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status index 934c895..b1feee9 100755 ---

[PATCH 07/17] nmbug-status: Don't require write access

2014-02-03 Thread W. Trevor King
The database in only used for notmuch.Query, so there's no need for write access. This allows nmbug-status to run while the database is being updated, without raising: A Xapian exception occurred opening database: Unable to get write lock on …: already locked Traceback (most recent call last

[PATCH 17/17] nmbug-status: Color threads in HTML output

2014-02-03 Thread W. Trevor King
Add tbody sections so we don't have to color every row. Multiple tbody sections are allowed [1]. Use CSS 3's nth-child to handle even/odd coloring (skipping the spacer rows) [2], which is supported on the major browsers [3]. border-spacing is from CCS 2.1 [4,5]. I'm using it to avoid whitespace

[PATCH 12/17] nmbug-status: Convert from XHTML 1.0 to HTML 5

2014-02-03 Thread W. Trevor King
HTML 5 for the win :). I also de-namespaced the language; the HTML 5 spec allows a vestigial xml:lang attribute, but it's a no-op [1], so I stripped it. This shouldn't break anything at tethera, which already serves the status as text/html: $ wget -S http://nmbug.tethera.net/status/ --2014-0

[PATCH 14/17] nmbug-status: Anchor with h3 ids instead of a names

2014-02-03 Thread W. Trevor King
HTML 5 allows id attributes on all HTML elements [1], but restricts names to particular cases [2]. Attaching the id attribute to the h3 element allows us to drop the anchor a element altogether. [1]: http://www.w3.org/TR/html5/dom.html#the-id-attribute [2]: http://www.w3.org/TR/html5/index.html#a

[PATCH 11/17] nmbug-status: Normalize table HTML indentation

2014-02-03 Thread W. Trevor King
I don't think I've ever seen '{value}\n' before :p. The new formatting avoids mixing tag levels and content across lines. --- devel/nmbug/nmbug-status | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status index 77780

[PATCH 05/17] nmbug-status: Add metavars for --config and --get-query

2014-02-03 Thread W. Trevor King
Now the suggested usage (listed by 'nmbug-status --help') is: usage: nmbug-status [-h] [--text] [--config PATH] [--list-views] [--get-query VIEW] instead of the less obvious: usage: nmbug-status [-h] [--text] [--config CONFIG] [--list-views] [--get

[PATCH 00/17] nmbug-status: Python-3-compabitility and general refactoring

2014-02-03 Thread W. Trevor King
I noticed that nmbug-status was written in Python :), but not compatible with Python 3 :(. I started cleaning up a few print statements, but this quickly turned into a more general refactoring. Let me know if this is too much to bite off at once. I tried to keep each patch fairly contained, but t

[PATCH 04/17] nmbug-status: Factor config-loading out into read_config

2014-02-03 Thread W. Trevor King
By isolating this peripheral handling, we make the core logic of nmbug-status easier to read. --- devel/nmbug/nmbug-status | 45 + 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status index a

[PATCH 03/17] nmbug-status: Decode Popen output using the user's locale

2014-02-03 Thread W. Trevor King
Avoid: $ ./nmbug-status --list-views Traceback (most recent call last): File "./nmbug-status", line 47, in 'cat-file', 'blob', sha1+':status-config.json'], TypeError: can't concat bytes to str by explicitly converting the byte-stream read from Popen into a Unicode string. On Pyt

[PATCH 02/17] nmbug-status: Use email.utils instead of rfc822

2014-02-03 Thread W. Trevor King
rfc822 has been deprecated since Python 2.3, and it's gone in Python 3 [1]. [1]: http://docs.python.org/2/library/rfc822.html --- devel/nmbug/nmbug-status | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status index b1feee9..652

[PATCH 17/17] nmbug-status: Color threads in HTML output

2014-02-03 Thread W. Trevor King
Add tbody sections so we don't have to color every row. Multiple tbody sections are allowed [1]. Use CSS 3's nth-child to handle even/odd coloring (skipping the spacer rows) [2], which is supported on the major browsers [3]. border-spacing is from CCS 2.1 [4,5]. I'm using it to avoid whitespace

[PATCH 16/17] nmbug-status: Use and markup where appropriate

2014-02-03 Thread W. Trevor King
* Wrap free text in tags. * Convert to for query strings. * Wrap message-id-term (id:"...") in . The tags get nicer default markup (smaller monospace font) for notmuch query terms [1]. The tags don't have much effect without attached CSS, but bare text (phrasing content [2]) in (which expec

[PATCH 15/17] nmbug-status: Quote the title when using it as an id

2014-02-03 Thread W. Trevor King
Also allow manual id overrides from the JSON config. Quoting avoids errors like: Bad value '#Possible bugs' for attribute href on element a: Whitespace in fragment component. Use %20 in place of spaces. from http://validator.w3.org. --- devel/nmbug/nmbug-status | 6 -- 1 file changed,

[PATCH 14/17] nmbug-status: Anchor with h3 ids instead of a names

2014-02-03 Thread W. Trevor King
HTML 5 allows id attributes on all HTML elements [1], but restricts names to particular cases [2]. Attaching the id attribute to the h3 element allows us to drop the anchor a element altogether. [1]: http://www.w3.org/TR/html5/dom.html#the-id-attribute [2]: http://www.w3.org/TR/html5/index.html#a

[PATCH 13/17] nmbug-status: Encode output using the user's locale

2014-02-03 Thread W. Trevor King
Instead of always writing UTF-8, allow the user to configure the output encoding using their locale. This is useful for previewing output in the terminal, for poor souls that don't use UTF-8 locales ;). --- devel/nmbug/nmbug-status | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) dif

[PATCH 12/17] nmbug-status: Convert from XHTML 1.0 to HTML 5

2014-02-03 Thread W. Trevor King
HTML 5 for the win :). I also de-namespaced the language; the HTML 5 spec allows a vestigial xml:lang attribute, but it's a no-op [1], so I stripped it. This shouldn't break anything at tethera, which already serves the status as text/html: $ wget -S http://nmbug.tethera.net/status/ --2014-0

[PATCH 11/17] nmbug-status: Normalize table HTML indentation

2014-02-03 Thread W. Trevor King
I don't think I've ever seen '{value}\n' before :p. The new formatting avoids mixing tag levels and content across lines. --- devel/nmbug/nmbug-status | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status index 77780

[PATCH 10/17] nmbug-status: Add Page and HtmlPage for modular rendering

2014-02-03 Thread W. Trevor King
I was having trouble understanding the logic of the longish print_view function, so I refactored the output generation into modular bits. The basic text rendering is handled by Page, which has enough hooks that HtmlPage can borrow the logic and slot-in HTML generators. By modularizing the logic it

[PATCH 09/17] nmbug-status: Add a Python-3-compatible urllib.parse.quote import

2014-02-03 Thread W. Trevor King
Python 2's urllib.quote [1] has moved to urllib.parse.quote in Python 3 [2]. [1]: http://docs.python.org/2/library/urllib.html#urllib.quote [2]: http://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote --- devel/nmbug/nmbug-status | 9 ++--- 1 file changed, 6 insertions(+), 3 del

[PATCH 08/17] nmbug-status: Consolidate HTML header printing

2014-02-03 Thread W. Trevor King
Make this all one big string, using '...{date}...'.format(date=...) to inject the date [1]. This syntax was added in Python 2.6, and is preferred to %-formatting in Python 3 [1]. [1]: http://docs.python.org/2/library/stdtypes.html#str.format --- devel/nmbug/nmbug-status | 13 ++--- 1 fil

[PATCH 07/17] nmbug-status: Don't require write access

2014-02-03 Thread W. Trevor King
The database in only used for notmuch.Query, so there's no need for write access. This allows nmbug-status to run while the database is being updated, without raising: A Xapian exception occurred opening database: Unable to get write lock on ?: already locked Traceback (most recent call last

[PATCH 06/17] nmbug-status: Consolidate functions and main code

2014-02-03 Thread W. Trevor King
The definitions of Thread, output_with_separator, and print_view were between the main argparse and view-printing code. Group them together with our existing read_config at the top of the module, which makes for easier reading in the main section. I also: * Made 'headers' a print_view argument i

[PATCH 05/17] nmbug-status: Add metavars for --config and --get-query

2014-02-03 Thread W. Trevor King
Now the suggested usage (listed by 'nmbug-status --help') is: usage: nmbug-status [-h] [--text] [--config PATH] [--list-views] [--get-query VIEW] instead of the less obvious: usage: nmbug-status [-h] [--text] [--config CONFIG] [--list-views] [--get

[PATCH 04/17] nmbug-status: Factor config-loading out into read_config

2014-02-03 Thread W. Trevor King
By isolating this peripheral handling, we make the core logic of nmbug-status easier to read. --- devel/nmbug/nmbug-status | 45 + 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status index a

[PATCH 03/17] nmbug-status: Decode Popen output using the user's locale

2014-02-03 Thread W. Trevor King
Avoid: $ ./nmbug-status --list-views Traceback (most recent call last): File "./nmbug-status", line 47, in 'cat-file', 'blob', sha1+':status-config.json'], TypeError: can't concat bytes to str by explicitly converting the byte-stream read from Popen into a Unicode string. On Pyt

[PATCH 02/17] nmbug-status: Use email.utils instead of rfc822

2014-02-03 Thread W. Trevor King
rfc822 has been deprecated since Python 2.3, and it's gone in Python 3 [1]. [1]: http://docs.python.org/2/library/rfc822.html --- devel/nmbug/nmbug-status | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status index b1feee9..652

[PATCH 01/17] nmbug-status: Convert to Python-3-compatible print functions

2014-02-03 Thread W. Trevor King
We shouldn't require folks to install Python 2 to run nmbug-status. --- devel/nmbug/nmbug-status | 44 +++- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status index 934c895..b1feee9 100755 ---

[PATCH 00/17] nmbug-status: Python-3-compabitility and general refactoring

2014-02-03 Thread W. Trevor King
I noticed that nmbug-status was written in Python :), but not compatible with Python 3 :(. I started cleaning up a few print statements, but this quickly turned into a more general refactoring. Let me know if this is too much to bite off at once. I tried to keep each patch fairly contained, but t

[PATCH 0/2]

2014-02-03 Thread W. Trevor King
On Mon, Feb 03, 2014 at 08:04:21AM +, Mark Walters wrote: > I think notmuch-show.c gets most of the header and related > information directly from the mail file not from the database > directly. I think we use gmime for that parsing so adding an extra > output pair for content-description there

[PATCH 2/2] emacs: Prefer Content-Description over filename for part buttons

2014-02-03 Thread W. Trevor King
On the rss2email list, Victor Orlikowski pointed out [1] that a number of MUAs don't use the Subject header of attached message/rfc822 parts to label multipart/digest subparts [2]. Instead, notmuch and several other MUAs use the filename parameter [3] as a content hint. Using the filename paramet

[PATCH 1/2] notmuch-show: Add content-description output pair

2014-02-03 Thread W. Trevor King
Parse and display the Content-Description header [1,2] so UIs rendering message parts have easy access to description strings. Extracting the value is a two-step process (extract [3] and decode [4]). [1]: http://tools.ietf.org/html/rfc2045#section-8 [2]: http://tools.ietf.org/html/rfc2183#section-

[PATCH 0/2]

2014-02-03 Thread W. Trevor King
On Mon, Feb 03, 2014 at 08:04:21AM +, Mark Walters wrote: > I think notmuch-show.c gets most of the header and related > information directly from the mail file not from the database > directly. I think we use gmime for that parsing so adding an extra > output pair for content-description there

Re: show inline html images as attachments in emacs notmuch-show

2014-02-03 Thread David Belohrad
Hi Mark, thanks for info. I correct myself. The CID images in my case do not link correctly when email opened as text/plain. They do however work when email is opened as text/html. In case of text/html they nicely are shown inline. In case of text/plain the link is somehow live, but cid: is in di

Re: show inline html images as attachments in emacs notmuch-show

2014-02-03 Thread Mark Walters
Hi On Mon, 03 Feb 2014, David Belohrad wrote: > Hi all, > > I can confirm this behaviour as well. With certain emails the CID images > are not displayed, and there is no means how to show them except writing > on disk and view externally. > > i have reported this problem some times ago, but I ha

Re: [RFC] Content-Description when naming MIME parts in Emacs mode

2014-02-03 Thread Mark Walters
On Sun, 02 Feb 2014, "W. Trevor King" wrote: > On the rss2email list, Victor Orlikowski pointed out [1] that a number > of MUAs don't use the Subject header of attached message/rfc822 parts > to label multipart/digest subparts [2]. Instead, notmuch and several > other MUAs use the filename parame