From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id C2681429E21 for ; Fri, 28 Oct 2011 17:32:20 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Xlx9IOP-AVaY for ; Fri, 28 Oct 2011 17:32:20 -0700 (PDT) Received: from mail-qw0-f53.google.com (mail-qw0-f53.google.com [209.85.216.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 1F0AC431FB6 for ; Fri, 28 Oct 2011 17:32:20 -0700 (PDT) Received: by qadc1 with SMTP id c1so5303933qad.26 for ; Fri, 28 Oct 2011 17:32:19 -0700 (PDT) Received: by 10.224.177.68 with SMTP id bh4mr4873940qab.48.1319848339533; Fri, 28 Oct 2011 17:32:19 -0700 (PDT) Received: from localhost (209-6-79-248.c3-0.abr-ubr1.sbo-abr.ma.cable.rcn.com. [209.6.79.248]) by mx.google.com with ESMTPS id do8sm17237075qab.17.2011.10.28.17.32.18 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 28 Oct 2011 17:32:19 -0700 (PDT) From: Ivy Foster To: notmuch@notmuchmail.org Subject: [Patch] Fix Emacs interface bug dealing with invisible text Date: Fri, 28 Oct 2011 20:29:49 -0400 Message-ID: <878vo47i82.fsf@nausicaa.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Oct 2011 00:32:20 -0000 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 >From 61ac45b32b70f2e789004359e219bfe6b77c701e Mon Sep 17 00:00:00 2001 From: Ivy Foster 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? ]