]> git.notmuchmail.org Git - notmuch/commitdiff
notmuch.el: Avoid infinite loop marking up message with no parts.
authorCarl Worth <cworth@cworth.org>
Wed, 10 Feb 2010 19:40:56 +0000 (11:40 -0800)
committerCarl Worth <cworth@cworth.org>
Wed, 10 Feb 2010 19:44:15 +0000 (11:44 -0800)
The infinite loop was triggered by a message consisting of a single
attachment within the body, (and no "part") tags.

We need to do things in response to this bug (beyond this specific
fix):

1. Create a test suite that exercises our emacs frontend so that bugs
   like this do not come back to haunt us after we fix them once.

2. Switch from our ad-hoc regexp based search of message-part delimeters
   to known-good code for parsing a structured document, (for example,
   the outstanding JSON patches).

notmuch.el

index c0bb55274943832b187a44cf04e6acbb009ba0dc..ff4a0bd0205a1afa58837e1054205600917580b2 100644 (file)
@@ -752,7 +752,8 @@ is what to put on the button."
               ; determine whether we've left the current message.
               (if (re-search-forward notmuch-show-part-begin-regexp nil t)
                   (beginning-of-line)))))
-        (goto-char end))))
+        (goto-char end))
+    (goto-char end)))
 
 (defun notmuch-show-markup-parts-region (beg end depth)
   (save-excursion