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 40B01431FBC for ; Thu, 13 Dec 2012 01:31:54 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0.201 X-Spam-Level: X-Spam-Status: No, score=0.201 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001, 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 6ru7d9T3GDQI for ; Thu, 13 Dec 2012 01:31:53 -0800 (PST) Received: from mail-we0-f181.google.com (mail-we0-f181.google.com [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 9D932431FB6 for ; Thu, 13 Dec 2012 01:31:53 -0800 (PST) Received: by mail-we0-f181.google.com with SMTP id t11so732335wey.26 for ; Thu, 13 Dec 2012 01:31:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=zZi4Q4pN9nuZE/w+RE15AonEb0+ty+rkLlY6/fsN16c=; b=PNe9tVeskhyhBCdNB2PEbVfw2aAX29+yE7duVkQ/g1YixaDp/8fw3oy7nJe6p2ob0E VF7bhRMqzLbp4CkPu79Ju/nCOJTrYhIz1J5/j7rPbte/ClNcqMcXlWfge8+JSdCWxzFe mEBlWvdsw2QCk5UBiFjpNQ2iRYQPJ9NE2kjkAK4N2tEJn3o2zXg3vhMpqjsDh0ajKlqO CAZScy5GwGKg0+PHb6PsrRKNhuOAsZYa+K60xBdBTmc1ePyKwvxgU8VqmPFJ2cJu4TWz 5MejubTmTnvCNG7Nsh8sUK4GwO2ymo20jQZuho3dWBTlHJ0vctpmac/5aE4KOofgeO1j okWw== Received: by 10.180.107.72 with SMTP id ha8mr471037wib.21.1355391112560; Thu, 13 Dec 2012 01:31:52 -0800 (PST) Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) by mx.google.com with ESMTPS id gz3sm6920261wib.2.2012.12.13.01.31.50 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 13 Dec 2012 01:31:51 -0800 (PST) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH (draft)] contrib: pick: close message pane when quitting from show in the message pane Date: Thu, 13 Dec 2012 09:31:49 +0000 Message-Id: <1355391109-4150-1-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.9.1 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: Thu, 13 Dec 2012 09:31:54 -0000 This is a way of trying to make sure notmuch-pick cleans up the split buffer after itself. --- Currently if the focus gets into the message pane and then the user quits from that pane the display stays split. This is an attempt to fix that. This seems to work but I don't know if there is a better solution. However, I would welcome any feedback on the user experience with this patch applied. Best wishes Mark contrib/notmuch-pick/notmuch-pick.el | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el index 043e9e7..79ef319 100644 --- a/contrib/notmuch-pick/notmuch-pick.el +++ b/contrib/notmuch-pick/notmuch-pick.el @@ -160,6 +160,9 @@ (defvar notmuch-pick-message-window nil) (make-variable-buffer-local 'notmuch-pick-message-window) (put 'notmuch-pick-message-window 'permanent-local t) +(defvar notmuch-show-message-window nil) +(make-variable-buffer-local 'notmuch-show-message-window) +(put 'notmuch-show-message-window 'permanent-local t) (defvar notmuch-pick-message-buffer nil) (make-variable-buffer-local 'notmuch-pick-message-buffer-name) (put 'notmuch-pick-message-buffer-name 'permanent-local t) @@ -389,6 +392,16 @@ Does NOT change the database." (notmuch-prettify-subject (notmuch-search-find-subject))) (notmuch-pick-show-match-message-with-wait)) +;;over-ride this function to try and kill off message panes +(defun notmuch-kill-this-buffer () + "Kill the current buffer." + (interactive) + (let ((buffer (current-buffer))) + (when (and (window-live-p notmuch-show-message-window) + (eq (window-buffer notmuch-show-message-window) buffer)) + (delete-window notmuch-show-message-window)) + (kill-buffer buffer))) + (defun notmuch-pick-show-message () "Show the current message (in split-pane)." (interactive) @@ -406,6 +419,10 @@ Does NOT change the database." (let ((notmuch-show-indent-messages-width 0)) (setq current-prefix-arg '(4)) (setq buffer (notmuch-show id nil nil nil)))) + ;; We need the let as notmuch-pick-message-window is buffer local. + (let ((window notmuch-pick-message-window)) + (with-current-buffer buffer + (setq notmuch-show-message-window window))) (notmuch-pick-tag-update-display (list "-unread")) (setq notmuch-pick-message-buffer buffer)))) -- 1.7.9.1