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 194E8431FBC for ; Fri, 20 Nov 2009 00:26:36 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org 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 kqo8Kvv93fUt for ; Fri, 20 Nov 2009 00:26:35 -0800 (PST) Received: from mail-gx0-f221.google.com (mail-gx0-f221.google.com [209.85.217.221]) by olra.theworths.org (Postfix) with ESMTP id 08BE0431FAE for ; Fri, 20 Nov 2009 00:26:34 -0800 (PST) Received: by gxk21 with SMTP id 21so2777245gxk.10 for ; Fri, 20 Nov 2009 00:26:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:to:subject:date :message-id:mime-version:content-type; bh=iHTsHuix2LBK8/vR0wCnp53HdBz5w3m9zkRqaLQlnhc=; b=LlthhjX8MWk9Qa+J+FrL67iUED+wp7/OTF7vyh/FQjDrZ3rs1beu1Z5iKbF6oSG94I 6VHYSiVc6ydhAbL0iNjFvrigWKYnFkaRI2fHDbGJH6vClR+AMtVXc8Z0fNCi+BPSxaRm kDn98mEFB3tAmxJsw6U97eEgGBV6KLXZA/05o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:mime-version:content-type; b=JOPk3uNbWB49ldjee15FlKQVVLVTti5rwSzdSveL0rzN/BNokX7zaXcW5oKp0+ZAVy 4+abbImyVf6g9kE1dC4UF8+uOnivYNyoMEJg/YIohTMiOJJGztQ94/91Y/5bwhbMRQZt X8Pu9glA3xwF+g+7W/7lchEl08DJoseay/Qdc= Received: by 10.150.19.5 with SMTP id 5mr2098693ybs.103.1258705594592; Fri, 20 Nov 2009 00:26:34 -0800 (PST) Received: from fortitudo (70-36-144-85.dsl.dynamic.sonic.net [70.36.144.85]) by mx.google.com with ESMTPS id 14sm695028gxk.6.2009.11.20.00.26.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 20 Nov 2009 00:26:33 -0800 (PST) Received: from alexbl (uid 1001) (envelope-from alexbl@fortitudo.i-did-not-set--mail-host-address--so-tickle-me) id 7053 by fortitudo (DragonFly Mail Agent) Fri, 20 Nov 2009 00:26:33 -0800 From: Alexander Botero-Lowry To: notmuch@notmuchmail.org Date: Fri, 20 Nov 2009 00:26:33 -0800 Message-ID: <86ws1lioue.fsf@fortitudo.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: lots of emacs mode enhancements X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 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: Fri, 20 Nov 2009 08:26:36 -0000 I've just been diving into the elisp, and have added a bunch of useful features. 1) buttonized citation and signature expanders and made them locally collapsable instead of globally (this could take some cleanup to remove the global key-map binding or make it work again) 2) fixed an annoying warning about cons not being a face name 3) made header names bold to make it easier to distingush them from their value My next target is to carry the buttonization through to threads and headers, and then I'm going to look into doing better mime-handling in general. also, RFP includes a -p argument that gives a patch :) alex ---- The following changes since commit 9b560fb3eb87b2a4f9d092bc1b124ccb6d11c975: Alexander Botero-Lowry (1): Checkin some command-only tcsh completions are available in the git repository at: git://alexbl.net/notmuch.git master Alexander Botero-Lowry (5): Buttonize citation expander. buttonize signatures as well fix the message about cons not being a valid face attribute Make expanding/collapsing signatures and citations local to them make header names bold in show-mode notmuch.el | 72 +++++++++++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 57 insertions(+), 15 deletions(-) diff --git a/notmuch.el b/notmuch.el index 1fc54c3..bb69aa3 100644 --- a/notmuch.el +++ b/notmuch.el @@ -440,6 +440,14 @@ which this thread was originally shown." (if last (notmuch-show-archive-thread)))))) +(defun notmuch-toggle-invisible-action (cite-button) + (let ((invis-spec (button-get button 'invisibility-spec))) + (if (invisible-p invis-spec) + (remove-from-invisibility-spec invis-spec) + (add-to-invisibility-spec invis-spec) + )) + (goto-char (button-end cite-button))) + (defun notmuch-show-markup-citations-region (beg end depth) (goto-char beg) (beginning-of-line) @@ -451,25 +459,51 @@ which this thread was originally shown." (progn (while (looking-at citation) (forward-line)) - (let ((overlay (make-overlay beg-sub (point)))) - (overlay-put overlay 'invisible 'notmuch-show-citation) - (overlay-put overlay 'before-string - (concat indent - "[" (number-to-string (count-lines beg-sub (point))) - "-line citation. Press 'c' to show.]\n"))))) + (let ((overlay (make-overlay beg-sub (point))) + (invis-spec (make-symbol "notmuch-citation-region"))) + (add-to-invisibility-spec invis-spec) + (overlay-put overlay 'invisible invis-spec) + (let ( + (p (point)) + (cite-button-text + (concat "[" (number-to-string (count-lines beg-sub (point))) + "-line citation.]")) + ) + (goto-char (- beg-sub 1)) + (insert (concat "\n" indent)) + (let ((cite-button (insert-button cite-button-text))) + (button-put cite-button 'invisibility-spec invis-spec) + (button-put cite-button 'action 'notmuch-toggle-invisible-action) + (button-put cite-button 'help-echo + "mouse-2, RET: Show citation") + + ) + (insert "\n") + (goto-char (+ (length cite-button-text) p)) + )))) (move-to-column depth) (if (looking-at notmuch-show-signature-regexp) (let ((sig-lines (- (count-lines beg-sub end) 1))) (if (<= sig-lines notmuch-show-signature-lines-max) (progn - (overlay-put (make-overlay beg-sub end) - 'invisible 'notmuch-show-signature) - (overlay-put (make-overlay beg (- beg-sub 1)) - 'after-string - (concat "\n" indent - "[" (number-to-string sig-lines) - "-line signature. Press 's' to show.]")) - (goto-char end))))) + (let ((invis-spec (make-symbol "notmuch-signature-region"))) + (add-to-invisibility-spec invis-spec) + (overlay-put (make-overlay beg-sub end) + 'invisible invis-spec) + + (goto-char (- beg-sub 1)) + (insert (concat "\n" indent)) + (let ((sig-button (insert-button + (concat "[" (number-to-string sig-lines) + "-line signature.]")))) + (button-put sig-button 'invisibility-spec invis-spec) + (button-put sig-button 'action + 'notmuch-toggle-invisible-action) + (button-put sig-button 'help-echo + "mouse-2, RET: Show signature") + ) + (insert "\n") + (goto-char end)))))) (forward-line)))) (defun notmuch-show-markup-part (beg end depth) @@ -516,12 +550,20 @@ which this thread was originally shown." (let ((beg (point-marker))) (end-of-line) ; Inverse video for subject - (overlay-put (make-overlay beg (point)) 'face '((cons :inverse-video t))) + (overlay-put (make-overlay beg (point)) 'face '(:inverse-video t)) (forward-line 2) (let ((beg-hidden (point-marker))) (re-search-forward notmuch-show-header-end-regexp) (beginning-of-line) (let ((end (point-marker))) + (goto-char beg) + (forward-line) + (while (looking-at "[A-Za-z][-A-Za-z0-9]*:") + (beginning-of-line) + (overlay-put (make-overlay (point) (re-search-forward ":")) + 'face 'bold) + (forward-line) + ) (indent-rigidly beg end depth) (overlay-put (make-overlay beg-hidden end) 'invisible 'notmuch-show-header)