Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id C9BA5431FBC for ; Wed, 25 Nov 2009 01:13:30 -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 cNq2qSC24vEJ for ; Wed, 25 Nov 2009 01:13:30 -0800 (PST) Received: from mail-pz0-f197.google.com (mail-pz0-f197.google.com [209.85.222.197]) by olra.theworths.org (Postfix) with ESMTP id 63482431FAE for ; Wed, 25 Nov 2009 01:13:30 -0800 (PST) Received: by pzk35 with SMTP id 35so5509871pzk.22 for ; Wed, 25 Nov 2009 01:13:29 -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:cc:subject :date:message-id:x-mailer; bh=yZemcT8bYLJUUcAjNWGBRdXgldYyL6r+qcUSx8BkJe0=; b=E+WYkutOPqzJS5SQu3Ttr7qyHaFcqHemTkprY9VtX72vT63ITKQ1HAMxX6+58So8dF gttZox8gIWK3rbqkxcZYcKtZ72kAYtgHnjJBS3o5TjPq9PIvYI1dh5kGvYi8Wt+KQ8o5 EO/z/upvODJDV67w/NT022ZvuRzaVdX4DnU28= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=A6KJSB+piXc8MpFnKTN+uyrEtYcYbumIBmmIxbZAKFbQquP9KHqLURx+j0EaAsgi6t Ij2POwcubQACFCD+hEf0bT4DUqoA7SDhqAiFAzmW8QjZgKURYEJrKMotKP2HpGm4ibgO 3Bc5a/b3CpiA6eAfw1Am9sMwfuNY96DUeOqhA= Received: by 10.115.39.11 with SMTP id r11mr14926929waj.152.1259140409700; Wed, 25 Nov 2009 01:13:29 -0800 (PST) Received: from fortitudo (70-36-144-85.dsl.dynamic.sonic.net [70.36.144.85]) by mx.google.com with ESMTPS id 21sm3823901pxi.4.2009.11.25.01.13.28 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 25 Nov 2009 01:13:29 -0800 (PST) Received: from alexbl (uid 1001) (envelope-from alexbl@fortitudo) id 710b by fortitudo (DragonFly Mail Agent) Wed, 25 Nov 2009 01:13:34 -0800 From: Alexander Botero-Lowry To: notmuch@notmuchmail.org Date: Wed, 25 Nov 2009 01:13:32 -0800 Message-Id: <1259140413-16278-1-git-send-email-alex.boterolowry@gmail.com> X-Mailer: git-send-email 1.6.5.2 Subject: [notmuch] [PATCH 1/2] add functions to toggle the nearest backwards button of a given type 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: Wed, 25 Nov 2009 09:13:31 -0000 It was noted that though local expansion was nice, it was also pretty nice to have an easy way to just open the headers without moving to the header button. So this exposes a number of symbols which search backwards in the buffer for the nearest button of the desire type and push it --- notmuch.el | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-) diff --git a/notmuch.el b/notmuch.el index 551048a..1853762 100644 --- a/notmuch.el +++ b/notmuch.el @@ -771,6 +771,39 @@ thread from that buffer can be show when done with this one)." )))) ))) +(defun notmuch-toggle-hidden-section (section-button-type) + (save-excursion + (let ((btn (forward-button -1))) + (while btn + (if (button-has-type-p btn section-button-type) + (progn (push-button) + (setq btn nil)) + (condition-case err + (setq btn (forward-button -1)) + (error (setq btn nil)))))) + ) +) + +(defun notmuch-toggle-hidden-headers () + (interactive) + (notmuch-toggle-hidden-section 'notmuch-button-headers-toggle-type) +) + +(defun notmuch-toggle-hidden-body () + (interactive) + (notmuch-toggle-hidden-section 'notmuch-button-body-toggle-type) +) + +(defun notmuch-toggle-hidden-citation () + (interactive) + (notmuch-toggle-hidden-section 'notmuch-button-citation-toggle-type) +) + +(defun notmuch-toggle-hidden-signature () + (interactive) + (notmuch-toggle-hidden-section 'notmuch-button-signature-toggle-type) +) + (defvar notmuch-search-authors-width 40 "Number of columns to use to display authors in a notmuch-search buffer.") -- 1.6.5.2