aboutsummaryrefslogtreecommitdiffhomepage
Commit message (Collapse)AuthorAge
...
* util: make sanitize string available in string util for reuseGravatar Jani Nikula2014-03-09
| | | | No functional changes.
* cli: refactor reply from guessingGravatar Jani Nikula2014-03-09
| | | | | | | The guess_from_received_header() function had grown quite big. Chop it up into smaller functions. No functional changes.
* cli: sanitize tabs and newlines to spaces in notmuch searchGravatar Jani Nikula2014-03-09
| | | | | | | | | 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.
* support for generating decreasing dates in bash 4.0 and 4.1Gravatar Tomi Ollila2014-03-09
| | | | | | | | The printf builtin "%(fmt)T" specifier (which allows time values to use strftime-like formatting) is introduced in bash 4.2. Trying to execute this in pre-4.2 bash will fail -- and if this happens execute the fallback piece of perl code to do the same thing.
* test: NOTMUCH_SKIP_TESTS accepts test names with or without Tddd- prefixGravatar Tomi Ollila2014-03-09
| | | | | | | | | | The test names assigned to NOTMUCH_SKIP_TESTS variable can now be given with or without the Tddd- prefix for tester convenience: The test name without Tddd -prefix stays constant even when test filenames are renumbered. The test name with Tddd -prefix is printed out when tests run.
* test: don't use $(dir) in recipes.Gravatar David Bremner2014-03-09
| | | | | | | According the semantics of make, the expansion of $(dir) in recipes uses dynamic scope, i.e. the value at the time the recipe is run. This means if test/Makefile.local is not the last sub-makefile included, all heck breaks loose.
* debian: add dependency on bash-completionGravatar David Bremner2014-03-07
| | | | | | At some point we decided to only install bash completion for notmuch if the bash-completion file was present. Add the corresponding debian build dependency.
* test: Print the number of the test along with its nameGravatar Austin Clements2014-03-06
| | | | | | | Previously, we stripped the "Tnnn-" part from the test name when printing its description at the beginning of each test. However, this makes it difficult to find the source script for a test (e.g., when a test fails). Put this prefix back.
* cli: add missing \n in error messageGravatar Jani Nikula2014-03-06
| | | | The error messages returned by illegal_tag() don't contain newlines.
* test: add tests for invalid new.tagsGravatar Jani Nikula2014-03-06
| | | | Similar tests for both notmuch new and insert.
* cli: make sure notmuch new and insert don't add invalid tagsGravatar Jani Nikula2014-03-06
| | | | | Check new.tags configuration values before doing anything, and bail out on invalid values.
* cli: export function for illegal tag checkingGravatar Jani Nikula2014-03-06
| | | | | This lets us check for forbidden tags consistently across the cli. No functional changes.
* emacs: use the originating buffer's working directory for pipeGravatar Jani Nikula2014-03-04
| | | | | | | | | | | | | Currently notmuch-show-pipe-message runs the command in the working directory of the *notmuch-pipe* buffer if it exists, and the current buffer's working directory (which is inherited to the new *notmuch-pipe* buffer) otherwise. This is all very surprising to the user, and it's difficult to know or change where the command will be run. Always use the current show buffer's working directory for piping. The user can check that with M-x pwd and change it with M-x cd. This is consistent with notmuch-show-pipe-part.
* emacs: Simplify and fix `notmuch-mua-prompt-for-sender'Gravatar Austin Clements2014-03-04
| | | | | | | | | | | | | | | | | | | | `notmuch-mua-prompt-for-sender' is over-engineered and often wrong. It attempts to detect when all identities have the same name and specialize the prompt to just the email address part. However, to do this it uses `mail-extract-address-components', which is meant for displaying email addresses, not general-purpose parsing, and hence performs many canonicalizations that can interfere with this use. For example, configuring notmuch-identities to ("Austin <austin@example.com>"), will cause `notmuch-mua-prompt-for-sender' to lose the name part entirely and return " <austin@example.com>". This patch rewrites `notmuch-mua-prompt-for-sender' to simply prompt for a full identity when notmuch-identities is configured, or to prompt for a sender address when it isn't. The original code also did several strange things, like using `eval' and specifying that this function was interactive. As a side-effect, this patch fixes these problems. And it adds a docstring.
* NEWS: note closing of id:87ty19pi85.fsf@zancas.localnetGravatar David Bremner2014-03-03
| | | | Also close the original debian bug.
* debian: note closing of debian bug 739556Gravatar David Bremner2014-03-03
| | | | This one doesn't seem NEWS-worthy.
* NEWS: note closing of bug id:87wqhcxb5j.fsf@maritornes.cs.unb.caGravatar David Bremner2014-03-03
| | | | This is also/originally Debian bug 737496, so close that too.
* Merge tag 'debian/0.17-5'Gravatar David Bremner2014-03-03
|\ | | | | | | uploaded to unstable
| * debian: fix typo in postinst (Debian bug 740325), clean up empty directoryGravatar David Bremner2014-03-03
| | | | | | | | | | Try to remove the directory /0755 ; if that fails assume it has something in it to preserve.
* | test: Simplify CLEAN list constructionGravatar Austin Clements2014-02-25
| | | | | | | | | | Construct as much of the CLEAN list from TEST_BINARIES as possible, rather than duplicating this information by hand.
* | cli: command line option parser cleanupGravatar Jani Nikula2014-02-25
| | | | | | | | Reduce the indentation for clarity. No functional changes.
* | emacs: remove newlines from input to notmuch count --batchGravatar David Bremner2014-02-25
| | | | | | | | | | | | | | | | | | | | | | Since a newline starts a new query in batch mode, this causes mysterious crashes in the emacs interface if saved searches contain newlines. See the discussion at id:87wqhcxb5j.fsf@maritornes.cs.unb.ca In general newlines seem to be just whitespace to the xapian query parser, so this should be mainly harmless.
* | man: escape backslash in notmuch-tag exampleGravatar David Bremner2014-02-23
| | | | | | | | | | | | | | | | The example was originally intended to have a literal backslash in it, but '\ ' is interpreted by nroff as a non-breaking space. It doesn't make much difference to the example, but the non-breaking space triggers a bug in doclifter.
* | emacs: Fix `notmuch-user-other-email' when no other emails are configuredGravatar Austin Clements2014-02-22
| | | | | | | | | | | | Thanks to the previous patch, this no longer crashes in this situation, but now would return (""). Fix it to return () when no emails are configured.
* | emacs: Fix exception when fetching empty or unconfigured settingsGravatar Austin Clements2014-02-22
| | | | | | | | | | | | | | | | | | | | | | | | When "notmuch config" is called with the name of an empty or unconfigured setting, it prints nothing (not even a new line). Previously, `notmuch-config-get' assumed it would always print a newline. As a result, when `notmuch-config-get' was called with the name of an empty of unconfigured setting, it would attempt to (substring "" 0 -1) to strip the newline, which would fail with a (args-out-of-range "" 0 -1) exception. Fix this by only stripping the newline if there actually is one.
* | emacs: Build forwarded message buffer more directlyGravatar Austin Clements2014-02-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we used `message-forward' to build forwarded messages, but this function is simply too high-level to be a good fit for some of what we do. First, since `message-forward' builds a full forward message buffer given the message to forward, we have to duplicate much of the logic in `notmuch-mua-mail' to patch the notmuch-y things into the built buffer. Second, `message-forward' constructs the From header from user-full-name and user-mail-address. As a result, if we prompt the user for an identity, we have to parse it into name and address components, just to have it put back together by `message-forward'. This process is not entirely loss-less because `mail-extract-address-components' does a lot of canonicalization (since it's intended for displaying addresses, not for parsing them). To fix these problems, don't use `message-forward' at all. `message-forward' itself is basically just a call to `message-mail' and `message-forward-make-body'. Do this ourselves, but call `notmuch-mua-mail' instead of `message-mail' so we can directly build a notmuch-y message and control the From header. This also fixes a bug that was a direct consequence of our use of `mail-extract-address-components': if the user chose an identity that had no name part (or the name part matched the mailbox), we would bind user-full-name to nil, which would cause an exception in the bowels of message-mode because user-full-name is expected to always be a string (even if it's just "").
* | man: fix typo in notmuch.1Gravatar David Bremner2014-02-21
| | | | | | | | Fix for Debian bug 739556
* | ruby bindings message: docstring typoGravatar Gaute Hope2014-02-21
| |
* | nmbug-status: replace __values__() with values() in OrderedDict stubGravatar Tomi Ollila2014-02-21
| | | | | | | | | | | | | | | | Python dict() object does not have __values__() function which OrderedDict().values() (the stub provided in nmbug-status) could call to provide ordered list of values. By renaming this thinko to values() will make our stub work as expected -- dict items listed out in order those were added to the dictionary.
* | emacs: Avoid rebuilding .eldeps even when there's nothing to doGravatar Austin Clements2014-02-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we updated .eldeps only if the file contents actually needed to change. This was done to avoid unnecessary make restarts (if the .eldeps rule changes the mtime of .eldeps, make has to restart to collect the new dependencies). However, this meant that, after a modification to any .el file that did not change dependencies, .eldeps would always be out of date, so every make invocation would run the .eldeps rule, which is both expensive because it starts up Emacs and noisy. This was true even when there was nothing to do. E.g., $ make clean && make ... $ touch emacs/notmuch-lib.el && make ... $ make Use "make V=1" to see the verbose compile lines. EMACS emacs/.eldeps make: Nothing to be done for `all'. $ make Use "make V=1" to see the verbose compile lines. EMACS emacs/.eldeps make: Nothing to be done for `all'. Fix this by replacing .eldeps with two files with identical content. One tracks the mtime of the dependency information and triggers the Emacs call to rebuild dependencies only when it may be necessary. The other tracks the content only; this rule over-triggers in the same way the old rule did, but this rule is cheap and quiet.
* | Merge tag 'debian/0.17-4'Gravatar David Bremner2014-02-21
|\| | | | | | | uploaded to Debian unstable
| * changelog stanza for 0.17-4Gravatar David Bremner2014-02-18
| |
| * debian: update ruby binary extension install pathGravatar David Bremner2014-02-18
| | | | | | | | | | | | | | | | | | | | | | | | From Christian Hofstaedler, Debian bug 739120: When ruby-defaults > 1:2.0 will be uploaded to sid, the version of Ruby provided by the 'ruby' and 'ruby-dev' packages will change to version 2.0. This version change includes a change to the path for binary extensions. This patch works for Ruby 1.9.1 as well as Ruby 2.0, so it's safe to apply now.
* | emacs: update alist for mail-archive.com API changeGravatar Jed Brown2014-02-16
| | | | | | | | | | | | | | | | Searching by Message-Id no longer works via the old mail-archive.com API, though I have contacted them in hopes that they restore it to prevent dead links. Anyway, the new API is cleaner. Acked-by: Austin Clements <amdragon@MIT.EDU>
* | nmbug-status: Hardcode UTF-8 instead of using the user's localeGravatar W. Trevor King2014-02-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | David [1] and Tomi [2] both feel that the user's choice of LANG is not explicit enough to have such a strong effect on nmbug-status. For example, cron jobs usually default to LANG=C, and that is going to give you ASCII output: $ LANG=C python -c 'import locale; print(locale.getpreferredencoding())' ANSI_X3.4-1968 Trying to print Unicode author names (and other strings) in that encoding would crash nmbug-status with a UnicodeEncodeError. To avoid that, this patch hardcodes UTF-8, which can handle generic Unicode, and is the preferred encoding (regardless of LANG settings) for everyone who has chimed in on the list so far. I'd prefer trusting LANG, but in the absence of any users that prefer non-UTF-8 encodings I'm fine with this approach. While we could achieve the same effect on the output content by dropping the previous patch (nmbug-status: Encode output using the user's locale), Tomi also wanted UTF-8 hardcoded as the config-file encoding [2]. Keeping the output encoding patch and then adding this to hardcode both the config-file and output encodings at once seems the easiest route, now that fd29d3f (nmbug-status: Decode Popen output using the user's locale, 2014-02-10) has landed in master. [1]: id="877g8z4v4x.fsf@zancas.localnet" http://article.gmane.org/gmane.mail.notmuch.general/17202 [2]: id="m2vbwj79lu.fsf@guru.guru-group.fi" http://article.gmane.org/gmane.mail.notmuch.general/17209
* | nmbug-status: Encode output using the user's localeGravatar W. Trevor King2014-02-14
| | | | | | | | | | | | | | 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 ;).
* | nmbug-status: Add inter-message paddingGravatar W. Trevor King2014-02-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We already had the tbody with a blank row separating threads (which is not colored); this commit adds a bit of spacing to separate messages within a thread. It will also add a bit of colored padding above the first message and below the final message, but the main goal is to add padding *between* two-row message blocks. <--- new padding thread-1, message-1, row-1 (class="message-first") thread-1, message-1, row-2 (class="message-last") <--- new padding spacer tbody with a blank row <--- new padding thread-2, message-1, row-1 (class="message-first") thread-2, message-1, row-2 (class="message-last") <--- new padding <--- new padding thread-2, message-2, row-1 (class="message-first") thread-2, message-2, row-2 (class="message-last") <--- new padding
* | nmbug-status: Color threads in HTML outputGravatar W. Trevor King2014-02-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 between td cells. border-radius is from CCS 3 [6,7]. I'm using it to make the colored sections a bit less harsh. I tried adding rounded borders to the tbody itself doesn't work, but I couldn't get that to work without setting the tbody's display to 'block'. That rounded the corners, but collapsed the cell spacing (e.g. columns were no longer aligned). This commit's by-corner-td approach is not particularly elegant, but it works. The td padding entries just ensure that the cell body is suitably far from the edges that it doesn't fall outside of the rounded corners. The doubled-braces are escapes from Python's str.format. [1]: http://www.w3.org/TR/html5/tabular-data.html#the-table-element [2]: http://www.w3.org/TR/css3-selectors/#nth-child-pseudo [3]: https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-child#Browser_compatibility [4]: http://www.w3.org/TR/CSS2/tables.html#propdef-border-spacing [5]: https://developer.mozilla.org/en-US/docs/Web/CSS/border-spacing#Browser_compatibility [6]: http://www.w3.org/TR/css3-background/#the-border-radius [7]: https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius#Browser_compatibility
* | new: Detect dirent.d_type support at configure timeGravatar Austin Clements2014-02-14
| | | | | | | | | | | | | | | | Support for dirent.d_type is OS-specific. Previously, we used _DIRENT_HAVE_D_TYPE to detect support for this, but this is apparently a glic-ism (FreeBSD, for example, supports d_type, but does not define this). Since there's no cross-platform way to detect support for dirent.d_type, detect it using a test compile at configure time.
* | nmbug-status: Escape &, <, and > in HTML display dataGravatar W. Trevor King2014-02-14
| | | | | | | | | | | | | | | | | | | | | | | | 'message-id' and 'from' now have sensitive characters escaped using xml.sax.saxutils.escape [1]. The 'subject' data was already being converted to a link into Gmane; I've escape()d that too, so it doesn't need to be handled ain the same block as 'message-id' and 'from'. This prevents broken HTML by if subjects etc. contain characters that would otherwise be interpreted as HTML markup. [1]: http://docs.python.org/3/library/xml.sax.utils.html#xml.sax.saxutils.escape
* | nmbug-status: Use <code> and <p> markup where appropriateGravatar W. Trevor King2014-02-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Wrap free text in <p> tags. * Convert <blockquote> to <p><code> for query strings. * Wrap message-id-term (id:"...") in <code>. The <code> tags get nicer default markup (smaller monospace font) for notmuch query terms [1]. The <p> tags don't have much effect without attached CSS, but bare text (phrasing content [2]) in <body> (which expects flow content [3,4]) feels wrong. [1]: http://www.w3.org/TR/html5/text-level-semantics.html#the-code-element [2]: http://www.w3.org/TR/html5/dom.html#phrasing-content-1 [3]: http://www.w3.org/TR/html5/dom.html#flow-content-1 [4]: http://www.w3.org/TR/html5/sections.html#the-body-element
* | nmbug-status: Slug the title when using it as an idGravatar W. Trevor King2014-02-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also allow manual id overrides from the JSON config. Sluggin 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. I tried just quoting the titles (e.g. 'Possible%20bugs'), but that didn't work (at least with Firefox 24.2.0). Slugging avoids any ambiguity over when the quotes are expanded in the client. The specs are unclear about quoting, saying only [1]: Value: Any string, with the following restrictions: must be at least one character long must not contain any space characters [1]: http://dev.w3.org/html5/markup/global-attributes.html#common.attrs.id
* | nmbug-status: Anchor with h3 ids instead of a namesGravatar W. Trevor King2014-02-13
| | | | | | | | | | | | | | | | | | 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#attributes-1
* | doc: notmuch_result_move_to_next -> notmuch_tags_move_to_nextGravatar Gaute Hope2014-02-13
| | | | | | | | Fix typo in docs.
* | nmbug-status: Convert from XHTML 1.0 to HTML 5Gravatar W. Trevor King2014-02-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-02-02 21:20:39-- http://nmbug.tethera.net/status/ Resolving nmbug.tethera.net... 87.98.215.224 Connecting to nmbug.tethera.net|87.98.215.224|:80... connected. HTTP request sent, awaiting response... HTTP/1.1 200 OK Vary: Accept-Encoding Content-Type: text/html ... This also matches the Content-Type in the generated HTML's http-equiv meta. [1]: http://www.w3.org/TR/html5/dom.html#the-lang-and-xml:lang-attributes
* | nmbug-status: Normalize table HTML indentationGravatar W. Trevor King2014-02-10
| | | | | | | | | | I don't think I've ever seen '</td><td>{value}\n' before :p. The new formatting avoids mixing tag levels and content across lines.
* | nmbug-status: Add an OrderedDict stub for Python 2.6Gravatar W. Trevor King2014-02-10
| | | | | | | | | | | | | | | | | | | | | | | | Tomi Ollila and David Bremner (and presumably others) are running Python 2.6 on their nmbug-status boxes, so it makes sense to keep support for that version. This commit adds a really minimal OrderedDict stub (e.g. it doesn't handle key removal), but it gets the job done for Page._get_threads. Once we reach a point where Python 2.6 is no longer important (it's already out of it's security-fix window [1]), we can pull this stub back out. [1]: http://www.python.org/download/releases/2.6.9/
* | nmbug-status: Add Page and HtmlPage for modular renderingGravatar W. Trevor King2014-02-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 should also be easier to build other renderers if folks want to customize the layout for other projects. Timezones ========= This commit has not effect on the output, except that some dates have been converted from the sender's timezone to UTC due to: - val = m.get_header(header) - ... - if header == 'date': - val = str.join(' ', val.split(None)[1:4]) - val = str(datetime.datetime.strptime(val, '%d %b %Y').date()) ... + value = str(datetime.datetime.utcfromtimestamp( + message.get_date()).date()) I also tweaked the HTML header date to be utcnow instead of the local now() to make all times independent of the generator's local time. This matches Gmane, which converts all Date headers to UTC (although they use a 'GMT' suffix). Notmuch uses g_mime_utils_header_decode_date to calculate the UTC timestamps, but uses a NULL tz_offset which drops the information we'd need to get back to the sender's local time [1]. With the generator's local time arbitrarily different from the sender's and viewer's local time, sticking with UTC seems the best bet. [1]: https://developer.gnome.org/gmime/stable/gmime-gmime-utils.html#g-mime-utils-header-decode-date
* | nmbug-status: Add a Python-3-compatible urllib.parse.quote importGravatar W. Trevor King2014-02-10
| | | | | | | | | | | | | | | | 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
* | nmbug-status: Consolidate HTML header printingGravatar W. Trevor King2014-02-10
| | | | | | | | | | | | | | | | 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