unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [Patch] Fix Emacs interface bug dealing with invisible text
@ 2011-10-29  0:29 Ivy Foster
  2011-10-30  9:58 ` Thomas Jost
  0 siblings, 1 reply; 3+ messages in thread
From: Ivy Foster @ 2011-10-29  0:29 UTC (permalink / raw)
  To: notmuch

Hey, folks,

I'm new to notmuch, but like much of what I've tried so far.
Thanks to all the contributors!

The following patch fixes a bug I've noticed in Emacs's
notmuch-show mode. Specifically, if you:

    - have certain kinds of washing turned on (I've noticed
      it with signature hiding), and

    - are looking at the last or only message in a thread

If you then hit Space (`notmuch-show-advance-or-archive') to
move on, Emacs will fail to advance and/or archive the
message, due to being kicked out of area of the invisible
text before it can do what it's gotta do.

The patch should fix the problem at the root, which seems to
be with notmuch-show-move-past-invisible-[forward|backward].

So far, I'm the only tester. However, I have added a
signature to the end of this message for your convenience.
(-:

Share & Enjoy!

Signed-off-by: Ivy Foster <joyfulgirl@archlinux.us>
From 61ac45b32b70f2e789004359e219bfe6b77c701e Mon Sep 17 00:00:00 2001
From: Ivy Foster <joyfulgirl@archlinux.us>
Date: Fri, 28 Oct 2011 19:30:45 -0400
Subject: [PATCH 1/1] Move past invisible text properly in Emacs

    move-past-invisible-text-* in notmuch-show were
    interacting oddly with hidden text at the end of
    a thread, such as a washed signature block.
---
 emacs/notmuch-show.el |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 440e089..f14696b 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1017,12 +1017,16 @@ All currently available key bindings:
     t))

 (defun notmuch-show-move-past-invisible-forward ()
-  (while (point-invisible-p)
-    (forward-char)))
+  (let ((disable-point-adjustment t))
+    (goto-char (1+ (point)))
+    (while (invisible-p (point))
+      (goto-char (1+ (point))))))

 (defun notmuch-show-move-past-invisible-backward ()
-  (while (point-invisible-p)
-    (backward-char)))
+  (let ((disable-point-adjustment t))
+    (goto-char (1- (point)))
+    (while (invisible-p (point))
+      (goto-char (1- (point))))))

 ;; Functions relating to the visibility of messages and their
 ;; components.
@@ -1160,7 +1164,7 @@ which this thread was originally shown."
      ;; go to the end, walk back over invisible text and then see if
      ;; point is visible.
      ((save-excursion
-	(goto-char (- end-of-this-message 1))
+	(goto-char end-of-this-message)
        (notmuch-show-move-past-invisible-backward)
        (> (point) (window-end)))
       ;; The bottom of this message is not visible - scroll.
-- 
1.7.7.1

P.S.: I also tried this with (point-invisible-p) instead of
      (invisible-p (point)), but for whatever reason, it
      didn't work. That may be something to look into as
      well.

-- 
Quid me anxius sum?
[ What? Me, worry? ]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-10-30 15:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-29  0:29 [Patch] Fix Emacs interface bug dealing with invisible text Ivy Foster
2011-10-30  9:58 ` Thomas Jost
2011-10-30 15:44   ` Ivy Foster

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).