]> git.notmuchmail.org Git - notmuch/commit
emacs: fix `notmuch-wash-region-to-button' to work at beginning of buffer
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Sat, 4 Feb 2012 07:36:37 +0000 (11:36 +0400)
committerDavid Bremner <bremner@debian.org>
Sat, 4 Feb 2012 12:33:18 +0000 (07:33 -0500)
commit8281430558c1b2eafc847620cd84f5ce40bf6741
tree8b7a20fdcae0a08651b174efb09e49aed7a9f180
parent69adeb52b1c095f570f590e8a8db7f219b875b35
emacs: fix `notmuch-wash-region-to-button' to work at beginning of buffer

`Notmuch-wash-region-to-button' is the function that creates hidden
regions with buttons for signatures, citations and original messages.
Before the change, it did not work correctly if the to-be-hidden
region started at the beginning of a message: the visibility toggle
button was hidden as well.  The patch fixes this.  There are two parts
in the fix:

* Use `insert-before-markers' instead of `insert' for creating the
  button, so that it does not get added to the hidden overlay.

* Stop using PREFIX argument for adding a newline before the button.
  The newline should not be added before a button at the beginning of
  buffer.

The corresponding test is fixed now.
emacs/notmuch-wash.el
test/emacs-show