From: David Bremner Date: Sun, 10 Jul 2011 19:50:09 +0000 (-0300) Subject: Merge commit '0.6' X-Git-Tag: 0.7_rc1~16 X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=commitdiff_plain;h=22472d9def2f6525a9aac62e6481d8d4fa7db5d0;hp=6bd02fb4dbee9e0fc372661af573a2ac380fed8a Merge commit '0.6' --- diff --git a/.dir-locals.el b/.dir-locals.el index cbdb1f97..aea630bd 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -1,7 +1,23 @@ ; emacs local configuration settings for notmuch source ; surmised by dkg on 2010-11-23 13:43:18-0500 +; amended by amdragon on 2011-06-06 -((c-mode . ((indent-tabs-mode . t) - (tab-width . 8) - (c-basic-offset . 4) - (c-file-style . "linux")))) +((c-mode + (indent-tabs-mode . t) + (tab-width . 8) + (c-basic-offset . 4) + (c-file-style . "linux")) + (c++-mode + (indent-tabs-mode . t) + (tab-width . 8) + (c-basic-offset . 4) + (c-file-style . "linux")) + (emacs-lisp-mode + (indent-tabs-mode . t) + (tab-width . 8)) + (shell-mode + (indent-tabs-mode . t) + (tab-width . 8) + (sh-basic-offset . 4) + (sh-indentation . 4)) + ) diff --git a/.gitignore b/.gitignore index 217440d5..02ab0044 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ tags *cscope* .deps notmuch +notmuch.sym notmuch-shared notmuch.1.gz libnotmuch.so* diff --git a/TODO b/TODO index 260ffe18..4dda6f46 100644 --- a/TODO +++ b/TODO @@ -15,7 +15,9 @@ result.) This may require removing the outer array from the current "notmuch search --format=json" results. Fix '*' to work by simply calling '+' or '-' on a region consisting of -the entire buffer. +the entire buffer, (this would avoid one race condition---while still +leaving other race conditions---but could also potentially make '*' a +very expensive operation). Add a global keybinding table for notmuch, and then view-specific tables that add to it. @@ -29,7 +31,7 @@ Make 'notmuch-show-pipe-message have a private history. Add support for a delete keybinding that adds a "deleted" tag to the current message/thread and make searches not return deleted messages -by default, (unless the user asks explicitly for deleted messags in +by default, (unless the user asks explicitly for deleted messages in the search query). Add keybindings for next/previous thread. @@ -119,7 +121,7 @@ Allow configuration for filename patterns that should be ignored when indexing. Replace the "notmuch part --part=id" command with "notmuch show ---part=id", (David Edmonson wants to rewrite some of "notmuch show" to +--part=id", (David Edmondson wants to rewrite some of "notmuch show" to provide more MIME-structure information in its output first). Replace the "notmuch search-tags" command with "notmuch search @@ -265,6 +267,9 @@ large so the detection could be potentially slow). 2. A "notmuch search" syntax could be added to allow the user to find these files, (and perhaps delete them or move them away as appropriate). +Fix filesystem/notmuch-new race condition by not updating database +mtime for a directory if it is the same as the current mtime. + Test suite ---------- Achieve 100% test coverage with the test suite. diff --git a/bindings/python/notmuch/database.py b/bindings/python/notmuch/database.py index 5deb2a5d..3770b132 100644 --- a/bindings/python/notmuch/database.py +++ b/bindings/python/notmuch/database.py @@ -195,7 +195,7 @@ class Database(object): # Raise a NotmuchError if not initialized self._verify_initialized_db() - return notmuch_database_needs_upgrade(self._db) + return nmlib.notmuch_database_needs_upgrade(self._db) def upgrade(self): """Upgrades the current database diff --git a/compat/README b/compat/README index cd32c56f..38e2e146 100644 --- a/compat/README +++ b/compat/README @@ -1,4 +1,4 @@ -notmuch/comapt +notmuch/compat This directory consists of two things: diff --git a/completion/Makefile b/completion/Makefile index b6859eac..de492a7c 100644 --- a/completion/Makefile +++ b/completion/Makefile @@ -1,4 +1,4 @@ -# See Makfefile.local for the list of files to be compiled in this +# See Makefile.local for the list of files to be compiled in this # directory. all: $(MAKE) -C .. all diff --git a/configure b/configure index cf525c9f..3999ce8f 100755 --- a/configure +++ b/configure @@ -22,7 +22,7 @@ if [ "$srcdir" != "." ]; then fi # Set several defaults (optionally specified by the user in -# environemnt variables) +# environment variables) CC=${CC:-gcc} CXX=${CXX:-g++} CFLAGS=${CFLAGS:--O2} @@ -608,7 +608,7 @@ includedir = ${INCLUDEDIR:=\$(prefix)/include} # The directory to which man pages should be installed mandir = ${MANDIR:=\$(prefix)/share/man} -# The directory to which read-only (configuration) filesshould be installed +# The directory to which read-only (configuration) files should be installed sysconfdir = ${SYSCONFDIR:=\$(prefix)/etc} # The directory to which emacs lisp files should be installed diff --git a/emacs/Makefile b/emacs/Makefile index b6859eac..de492a7c 100644 --- a/emacs/Makefile +++ b/emacs/Makefile @@ -1,4 +1,4 @@ -# See Makfefile.local for the list of files to be compiled in this +# See Makefile.local for the list of files to be compiled in this # directory. all: $(MAKE) -C .. all diff --git a/emacs/Makefile.local b/emacs/Makefile.local index 10227777..ce0c3f00 100644 --- a/emacs/Makefile.local +++ b/emacs/Makefile.local @@ -20,7 +20,7 @@ emacs_images := \ emacs_bytecode = $(emacs_sources:.el=.elc) -%.elc: %.el +%.elc: %.el $(global_deps) $(call quiet,EMACS) --directory emacs -batch -f batch-byte-compile $< ifeq ($(WITH_EMACS),1) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index 916cda1c..65fde75a 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -428,7 +428,7 @@ Complete list of currently available key bindings: (let ((found-target-pos nil) (final-target-pos nil)) (let* ((saved-alist - ;; Filter out empty saved seaches if required. + ;; Filter out empty saved searches if required. (if notmuch-show-empty-saved-searches notmuch-saved-searches (loop for elem in notmuch-saved-searches diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index a21dc145..f93c957d 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -88,7 +88,7 @@ the user hasn't set this variable with the old or new value." (notmuch-config-get "user.primary_email")) (defun notmuch-user-other-email () - "Return the user.primary_email value (as a list) from the notmuch configuration." + "Return the user.other_email value (as a list) from the notmuch configuration." (split-string (notmuch-config-get "user.other_email") "\n")) (defun notmuch-kill-this-buffer () diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el index b6c6e2a7..e6788685 100644 --- a/emacs/notmuch-maildir-fcc.el +++ b/emacs/notmuch-maildir-fcc.el @@ -163,7 +163,7 @@ will NOT be removed or replaced." (make-directory (concat path "/new/") t) (make-directory (concat path "/tmp/") t)) ((file-regular-p path) - (error "%s is a file. Can't creat maildir." path)) + (error "%s is a file. Can't create maildir." path)) (t (error "I don't know how to create a maildir here")))) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 45298783..f96743b0 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -110,7 +110,7 @@ any given message." "Use external viewers to view all attachments from the current message." (interactive) (with-current-notmuch-show-message - ; We ovverride the mm-inline-media-tests to indicate which message + ; We override the mm-inline-media-tests to indicate which message ; parts are already sufficiently handled by the original ; presentation of the message in notmuch-show mode. These parts ; will be inserted directly into the temporary buffer of @@ -791,7 +791,7 @@ The optional QUERY-CONTEXT is a notmuch search term. Only messages from the thread matching this search term are shown if non-nil. -The optional BUFFER-NAME provides the neame of the buffer in +The optional BUFFER-NAME provides the name of the buffer in which the message thread is shown. If it is nil (which occurs when the command is called interactively) the argument to the function is used. " @@ -909,7 +909,7 @@ more selectively, (such as '\\[notmuch-show-next-message]' and '\\[notmuch-show- without removing any tags, and '\\[notmuch-show-archive-thread]' to archive an entire thread without scrolling through with \\[notmuch-show-advance-and-archive]). -You can add or remove arbitary tags from the current message with +You can add or remove arbitrary tags from the current message with '\\[notmuch-show-add-tag]' or '\\[notmuch-show-remove-tag]'. All currently available key bindings: diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el index 92f07c50..1f420b25 100644 --- a/emacs/notmuch-wash.el +++ b/emacs/notmuch-wash.el @@ -137,7 +137,7 @@ collapse the remaining lines into a button.") (format label-format lines-count))) (defun notmuch-wash-region-to-button (msg beg end type prefix) - "Auxilary function to do the actual making of overlays and buttons + "Auxiliary function to do the actual making of overlays and buttons BEG and END are buffer locations. TYPE should a string, either \"citation\" or \"signature\". PREFIX is some arbitrary text to diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 3311fe8b..f11ec24e 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -64,7 +64,7 @@ ("authors" . "%-20s ") ("subject" . "%s ") ("tags" . "(%s)")) - "Search result formating. Supported fields are: + "Search result formatting. Supported fields are: date, count, authors, subject, tags For example: (setq notmuch-search-result-format \(\(\"authors\" . \"%-40s\"\) @@ -493,7 +493,7 @@ the messages that are about to be tagged" :group 'notmuch) (defcustom notmuch-after-tag-hook nil - "Hooks that are run before tags of a message are modified. + "Hooks that are run after tags of a message are modified. 'tags' will contain the tags that were added or removed as a list of strings of the form \"+TAG\" or \"-TAG\". @@ -836,7 +836,7 @@ non-authors is found, assume that all of the authors match." (defun notmuch-search-operate-all (action) "Add/remove tags from all matching messages. -Tis command adds or removes tags from all messages matching the +This command adds or removes tags from all messages matching the current search terms. When called interactively, this command will prompt for tags to be added or removed. Tags prefixed with '+' will be added and tags prefixed with '-' will be removed. diff --git a/gmime-filter-headers.h b/gmime-filter-headers.h index 47d1d456..1d1a3ebb 100644 --- a/gmime-filter-headers.h +++ b/gmime-filter-headers.h @@ -39,7 +39,7 @@ typedef struct _GMimeFilterHeadersClass GMimeFilterHeadersClass; * @parent_object: parent #GMimeFilter * @saw_nl: previous char was a \n * @line: temporary buffer for line unfolding - * @line_size: size of currently allocated nemory for @line + * @line_size: size of currently allocated memory for @line * @lineptr: pointer to the first unused character in @line * * A filter to decode rfc2047 encoded headers diff --git a/lib/Makefile b/lib/Makefile index b6859eac..de492a7c 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -1,4 +1,4 @@ -# See Makfefile.local for the list of files to be compiled in this +# See Makefile.local for the list of files to be compiled in this # directory. all: $(MAKE) -C .. all diff --git a/lib/Makefile.local b/lib/Makefile.local index 7e2bc87b..88d8debc 100644 --- a/lib/Makefile.local +++ b/lib/Makefile.local @@ -72,12 +72,11 @@ $(dir)/libnotmuch.a: $(libnotmuch_modules) $(call quiet,AR) rcs $@ $^ $(dir)/$(LIBNAME): $(libnotmuch_modules) notmuch.sym - echo $(libnotmuch_modules) $(call quiet,CXX $(CXXFLAGS)) $(libnotmuch_modules) $(FINAL_LIBNOTMUCH_LDFLAGS) $(LIBRARY_LINK_FLAG) -o $@ notmuch.sym: lib/notmuch.h printf "{\nglobal:\n" > notmuch.sym - sed -n 's/^\s*\(notmuch_[a-z_]*\)\s*(.*/\t\1;/p' $< >> notmuch.sym + sed -n 's/^[[:space:]]*\(notmuch_[a-z_]*\)[[:space:]]*(.*/'"`printf "\t"`"'\1;/p' $< >> notmuch.sym printf "local: *;\n};\n" >> notmuch.sym $(dir)/$(SONAME): $(dir)/$(LIBNAME) @@ -88,7 +87,7 @@ $(dir)/$(LINKER_NAME): $(dir)/$(SONAME) install: install-$(dir) -# The (often-reused) $dir works fine within targets/pre-requisites, +# The (often-reused) $dir works fine within targets/prerequisites, # but cannot be used reliably within commands, so copy its value to a # variable that is not reused. lib := $(dir) @@ -102,4 +101,6 @@ install-$(dir): $(dir)/$(LIBNAME) $(LIBRARY_INSTALL_POST_COMMAND) SRCS := $(SRCS) $(libnotmuch_c_srcs) $(libnotmuch_cxx_srcs) -CLEAN := $(CLEAN) $(libnotmuch_modules) $(dir)/$(SONAME) $(dir)/$(LINKER_NAME) $(dir)$(LIBNAME) libnotmuch.a notmuch.sym +CLEAN += $(libnotmuch_modules) $(dir)/$(SONAME) $(dir)/$(LINKER_NAME) +CLEAN += $(dir)/$(LIBNAME) $(dir)/libnotmuch.a notmuch.sym +CLEAN += $(dir)/notmuch.h.gch diff --git a/lib/database.cc b/lib/database.cc index 7f79cf47..9c2f4ecd 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -69,7 +69,7 @@ typedef struct { * * Multiple terms of given prefix: * - * reference: All message IDs from In-Reply-To and Re ferences + * reference: All message IDs from In-Reply-To and References * headers in the message. * * tag: Any tags associated with this message by the user. @@ -137,7 +137,7 @@ typedef struct { * ASCII integer. The initial database version * was 1, (though a schema existed before that * were no "version" database value existed at - * all). Succesive versions are allocated as + * all). Successive versions are allocated as * changes are made to the database (such as by * indexing new fields). * @@ -148,7 +148,7 @@ typedef struct { * incremented for each thread ID. * * thread_id_* A pre-allocated thread ID for a particular - * message. This is actually an arbitarily large + * message. This is actually an arbitrarily large * family of metadata name. Any particular name is * formed by concatenating "thread_id_" with a message * ID (or the SHA1 sum of a message ID if it is very @@ -422,7 +422,7 @@ skip_space_and_comments (const char **str) } /* Parse an RFC 822 message-id, discarding whitespace, any RFC 822 - * comments, and the '<' and '>' delimeters. + * comments, and the '<' and '>' delimiters. * * If not NULL, then *next will be made to point to the first character * not parsed, (possibly pointing to the final '\0' terminator. @@ -1149,7 +1149,7 @@ _notmuch_database_filename_to_direntry (void *ctx, /* Given a legal 'path' for the database, return the relative path. * - * The return value will be a pointer to the originl path contents, + * The return value will be a pointer to the original path contents, * and will be either the original string (if 'path' was relative) or * a portion of the string (if path was absolute and begins with the * database path). @@ -1476,7 +1476,7 @@ _notmuch_database_link_message_to_children (notmuch_database_t *notmuch, * In all cases, we assign to the current message the first thread_id * found (through either parent or child). We will also merge any * existing, distinct threads where this message belongs to both, - * (which is not uncommon when mesages are processed out of order). + * (which is not uncommon when messages are processed out of order). * * Finally, if no thread ID has been found through parent or child, we * call _notmuch_message_generate_thread_id to generate a new thread diff --git a/lib/libsha1.c b/lib/libsha1.c index c39a5a17..5d16f6ab 100644 --- a/lib/libsha1.c +++ b/lib/libsha1.c @@ -174,7 +174,7 @@ void sha1_hash(const unsigned char data[], unsigned long len, sha1_ctx ctx[1]) if((ctx->count[0] += len) < len) ++(ctx->count[1]); - while(len >= space) /* tranfer whole blocks if possible */ + while(len >= space) /* transfer whole blocks if possible */ { memcpy(((unsigned char*)ctx->wbuf) + pos, sp, space); sp += space; len -= space; space = SHA1_BLOCK_SIZE; pos = 0; diff --git a/lib/libsha1.h b/lib/libsha1.h index c1c848fc..56f445a9 100644 --- a/lib/libsha1.h +++ b/lib/libsha1.h @@ -38,7 +38,7 @@ extern "C" { #endif #if 0 -} /* Appleasing Emacs */ +} /* Appeasing Emacs */ #endif #include diff --git a/lib/message.cc b/lib/message.cc index 2a4954dd..d993cde8 100644 --- a/lib/message.cc +++ b/lib/message.cc @@ -862,7 +862,7 @@ _notmuch_message_add_term (notmuch_message_t *message, /* Parse 'text' and add a term to 'message' for each parsed word. Each * term will be added both prefixed (if prefix_name is not NULL) and - * also unprefixed). */ + * also non-prefixed). */ notmuch_private_status_t _notmuch_message_gen_terms (notmuch_message_t *message, const char *prefix_name, diff --git a/lib/notmuch.h b/lib/notmuch.h index e508309e..974be8d1 100644 --- a/lib/notmuch.h +++ b/lib/notmuch.h @@ -103,7 +103,7 @@ typedef enum _notmuch_status { /* Get a string representation of a notmuch_status_t value. * - * The result is readonly. + * The result is read-only. */ const char * notmuch_status_to_string (notmuch_status_t status); @@ -510,7 +510,7 @@ notmuch_threads_move_to_next (notmuch_threads_t *threads); * * It's not strictly necessary to call this function. All memory from * the notmuch_threads_t object will be reclaimed when the - * containg query object is destroyed. + * containing query object is destroyed. */ void notmuch_threads_destroy (notmuch_threads_t *threads); diff --git a/notmuch-config.c b/notmuch-config.c index 6e4c5c4c..485fa72a 100644 --- a/notmuch-config.c +++ b/notmuch-config.c @@ -69,7 +69,7 @@ static const char maildir_config_comment[] = "\tsynchronize_flags Valid values are true and false.\n" "\n" "\tIf true, then the following maildir flags (in message filenames)\n" - "\twill be syncrhonized with the corresponding notmuch tags:\n" + "\twill be synchronized with the corresponding notmuch tags:\n" "\n" "\t\tFlag Tag\n" "\t\t---- -------\n" diff --git a/notmuch-new.c b/notmuch-new.c index 744f4ca3..7d17793b 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -213,6 +213,7 @@ _entries_resemble_maildir (struct dirent **entries, int count) * information is lost from the database). * * o Tell the database to update its time of 'path' to 'fs_mtime' + * if fs_mtime isn't the current wall-clock time. */ static notmuch_status_t add_files_recursive (notmuch_database_t *notmuch, @@ -230,6 +231,7 @@ add_files_recursive (notmuch_database_t *notmuch, notmuch_directory_t *directory; notmuch_filenames_t *db_files = NULL; notmuch_filenames_t *db_subdirs = NULL; + time_t stat_time; struct stat st; notmuch_bool_t is_maildir, new_directory; const char **tag; @@ -239,6 +241,7 @@ add_files_recursive (notmuch_database_t *notmuch, path, strerror (errno)); return NOTMUCH_STATUS_FILE_ERROR; } + stat_time = time (NULL); /* This is not an error since we may have recursed based on a * symlink to a regular file, not a directory, and we don't know @@ -253,6 +256,25 @@ add_files_recursive (notmuch_database_t *notmuch, new_directory = db_mtime ? FALSE : TRUE; + /* XXX This is a temporary workaround. If we don't update the + * database mtime until after processing messages in this + * directory, then a 0 mtime is *not* sufficient to indicate that + * this directory has no messages or subdirs in the database (for + * example, if an earlier run skipped the mtime update because + * fs_mtime == stat_time, or was interrupted before updating the + * mtime at the end). To address this, we record a (bogus) + * non-zero value before processing any child messages so that a + * later run won't mistake this for a new directory (and, for + * example, fail to detect removed files and subdirs). + * + * A better solution would be for notmuch_database_get_directory + * to indicate if it really created a new directory or not, either + * by a new out-argument, or by recording this information and + * providing an accessor. + */ + if (new_directory) + notmuch_directory_set_mtime (directory, -1); + /* If the database knows about this directory, then we sort based * on strcmp to match the database sorting. Otherwise, we can do * inode-based sorting for faster filesystem operation. */ @@ -373,7 +395,7 @@ add_files_recursive (notmuch_database_t *notmuch, /* If we're looking at a symlink, we only want to add it if it * links to a regular file, (and not to a directory, say). * - * Similarly, if the file is of unknown type (due to filesytem + * Similarly, if the file is of unknown type (due to filesystem * limitations), then we also need to look closer. * * In either case, a stat does the trick. @@ -509,7 +531,12 @@ add_files_recursive (notmuch_database_t *notmuch, notmuch_filenames_move_to_next (db_subdirs); } - if (! interrupted) { + /* If the directory's mtime is the same as the wall-clock time + * when we stat'ed the directory, we skip updating the mtime in + * the database because a message could be delivered later in this + * same second. This may lead to unnecessary re-scans, but it + * avoids overlooking messages. */ + if (! interrupted && fs_mtime != stat_time) { status = notmuch_directory_set_mtime (directory, fs_mtime); if (status && ret == NOTMUCH_STATUS_SUCCESS) ret = status; diff --git a/notmuch-reply.c b/notmuch-reply.c index 27ef37bd..362e1987 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -278,7 +278,7 @@ add_recipients_from_message (GMimeMessage *reply, * The munging is easy to detect, because it results in a * redundant reply-to header, (with an address that already exists * in either To or Cc). So in this case, we ignore the Reply-To - * field and use the From header. Thie ensures the original sender + * field and use the From header. This ensures the original sender * will get the reply even if not subscribed to the list. Note * that the address in the Reply-To header will always appear in * the reply. @@ -362,7 +362,7 @@ guess_from_received_header (notmuch_config_t *config, notmuch_message_t *message * them indications to which email address this message was * delivered. * The Received: header is special in our get_header function - * and is always concated. + * and is always concatenated. */ received = notmuch_message_get_header (message, "received"); if (received == NULL) diff --git a/notmuch-show.c b/notmuch-show.c index dda83a10..fb743008 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -454,19 +454,21 @@ format_part_start_text (GMimeObject *part, int *part_count) static void format_part_content_text (GMimeObject *part) { - GMimeContentDisposition *disposition = g_mime_object_get_content_disposition (part); + const char *cid = g_mime_object_get_content_id (part); GMimeContentType *content_type = g_mime_object_get_content_type (GMIME_OBJECT (part)); - printf (", Content-type: %s\n", g_mime_content_type_to_string (content_type)); - - if (disposition && - strcmp (disposition->disposition, GMIME_DISPOSITION_ATTACHMENT) == 0) + if (GMIME_IS_PART (part)) { const char *filename = g_mime_part_get_filename (GMIME_PART (part)); - printf ("Attachment: %s (%s)\n", filename, - g_mime_content_type_to_string (content_type)); + if (filename) + printf (", Filename: %s", filename); } + if (cid) + printf (", Content-id: %s", cid); + + printf (", Content-type: %s\n", g_mime_content_type_to_string (content_type)); + if (g_mime_content_type_is_type (content_type, "text", "*") && !g_mime_content_type_is_type (content_type, "text", "html")) { @@ -591,7 +593,6 @@ format_part_content_json (GMimeObject *part) GMimeStream *stream_memory = g_mime_stream_mem_new (); const char *cid = g_mime_object_get_content_id (part); void *ctx = talloc_new (NULL); - GMimeContentDisposition *disposition = g_mime_object_get_content_disposition (part); GByteArray *part_content; printf (", \"content-type\": %s", @@ -600,12 +601,11 @@ format_part_content_json (GMimeObject *part) if (cid != NULL) printf(", \"content-id\": %s", json_quote_str (ctx, cid)); - if (disposition && - strcmp (disposition->disposition, GMIME_DISPOSITION_ATTACHMENT) == 0) + if (GMIME_IS_PART (part)) { const char *filename = g_mime_part_get_filename (GMIME_PART (part)); - - printf (", \"filename\": %s", json_quote_str (ctx, filename)); + if (filename) + printf (", \"filename\": %s", json_quote_str (ctx, filename)); } if (g_mime_content_type_is_type (content_type, "text", "*") && diff --git a/notmuch.1 b/notmuch.1 index c1aa4e32..5a8c83dc 100644 --- a/notmuch.1 +++ b/notmuch.1 @@ -484,7 +484,7 @@ sup calls them). The .B part -command can used to output a single part of a multi-part MIME message. +command can used to output a single part of a multipart MIME message. .RS 4 .TP 4 @@ -641,13 +641,13 @@ expression). Finally, results can be restricted to only messages within a particular time range, (based on the Date: header) with a syntax of: - .. + .. Each timestamp is a number representing the number of seconds since 1970\-01\-01 00:00:00 UTC. This is not the most convenient means of expressing date ranges, but until notmuch is fixed to accept a more convenient form, one can use the date program to construct -timestamps. For example, with the bash shell the folowing syntax would +timestamps. For example, with the bash shell the following syntax would specify a date range to return messages from 2009\-10\-01 until the current time: diff --git a/notmuch.c b/notmuch.c index 93f31944..3973e350 100644 --- a/notmuch.c +++ b/notmuch.c @@ -48,7 +48,7 @@ static int notmuch_help_command (void *ctx, int argc, char *argv[]); static const char search_terms_help[] = - "\tSeveral notmuch commands accept a comman syntax for search\n" + "\tSeveral notmuch commands accept a common syntax for search\n" "\tterms.\n" "\n" "\tThe search terms can consist of free-form text (and quoted\n" diff --git a/packaging/debian b/packaging/debian index a5866601..c8e8ddd4 100644 --- a/packaging/debian +++ b/packaging/debian @@ -1,2 +1,2 @@ -The debian packaging exists in the top-level "debian" directory within -this source-code respository. +The Debian packaging exists in the top-level "debian" directory within +this source-code repository. diff --git a/test/Makefile b/test/Makefile index b6859eac..de492a7c 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,4 +1,4 @@ -# See Makfefile.local for the list of files to be compiled in this +# See Makefile.local for the list of files to be compiled in this # directory. all: $(MAKE) -C .. all diff --git a/test/README b/test/README index 07da480b..f9ac6073 100644 --- a/test/README +++ b/test/README @@ -41,6 +41,15 @@ The following command-line options are available when running tests: As the names depend on the tests' file names, it is safe to run the tests with this option in parallel. +--root=:: + This runs the testsuites specified under a seperate directory. + However, caution is advised, as not all tests are maintained + with this relocation in mind, so some tests may behave + differently. + + Pointing this argument at a tmpfs filesystem can improve the + speed of the test suite for some users. + When invoking the test suite via "make test" any of the above options can be specified as follows: @@ -147,11 +156,18 @@ library for your script to use. will generate a failure and print the difference of the two strings. + test_expect_equal_file + + Identical to test_exepect_equal, except that and + are files instead of strings. This is a much more + robust method to compare formatted textual information, since it + also notices whitespace and closing newline differences. + test_expect_equal_failure This works similar to test_expect_equal (see above) but is used to mark a test that demonstrates a known breakage, (that is, the - author of the test expectes "output" and "expected" to differ until + author of the test expects "output" and "expected" to differ until the breakage is fixed). See test_expect_failure for details. test_debug