From: Austin Clements Date: Tue, 3 Sep 2013 21:45:16 +0000 (+2000) Subject: [PATCH v2 0/9] emacs: Unify common key bindings and lots more X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4a993ff8a191e352a8dbbd64a2a1aa2c6ad5ff52;p=notmuch-archives.git [PATCH v2 0/9] emacs: Unify common key bindings and lots more --- diff --git a/9a/b947381863bdb8600583d8bc444ba80729898f b/9a/b947381863bdb8600583d8bc444ba80729898f new file mode 100644 index 000000000..31804697d --- /dev/null +++ b/9a/b947381863bdb8600583d8bc444ba80729898f @@ -0,0 +1,139 @@ +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 672DA431FDA + for ; Tue, 3 Sep 2013 14:45:52 -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 yTAopbGEJZ1b for ; + Tue, 3 Sep 2013 14:45:44 -0700 (PDT) +Received: from dmz-mailsec-scanner-6.mit.edu (dmz-mailsec-scanner-6.mit.edu + [18.7.68.35]) + by olra.theworths.org (Postfix) with ESMTP id 891E3431FDD + for ; Tue, 3 Sep 2013 14:45:33 -0700 (PDT) +X-AuditID: 12074423-b7f168e00000095a-8e-5226587c2075 +Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) + by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP + id 92.0E.02394.C7856225; Tue, 3 Sep 2013 17:45:32 -0400 (EDT) +Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) + by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id r83LjUoU025405; + Tue, 3 Sep 2013 17:45:31 -0400 +Received: from drake.dyndns.org (26-4-182.dynamic.csail.mit.edu [18.26.4.182]) + (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r83LjRUv026853 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Tue, 3 Sep 2013 17:45:28 -0400 +Received: from amthrax by drake.dyndns.org with local (Exim 4.77) + (envelope-from ) + id 1VGyPe-0004xm-Rn; Tue, 03 Sep 2013 17:45:26 -0400 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH v2 0/9] emacs: Unify common key bindings and lots more +Date: Tue, 3 Sep 2013 17:45:16 -0400 +Message-Id: <1378244725-18846-1-git-send-email-amdragon@mit.edu> +X-Mailer: git-send-email 1.7.10.4 +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFlrDIsWRmVeSWpSXmKPExsUixG6nrlsToRZk0P2cw6JpurPF6rk8Ftdv + zmR2YPbYOesuu8et+6/ZPZ6tusUcwBzFZZOSmpNZllqkb5fAlXFw8wnmgi7xii9TNRsY7wh1 + MXJySAiYSFxtXswIYYtJXLi3nq2LkYtDSGAfo8TG58dYIJwNjBKXlvaxQjiHmSSmHXgJlZnL + KPGw7RoTSD+bgIbEtv3LwWaJCEhL7Lw7mxXEZhbQk9jycDOQzcEhLOAm0bahDCTMIqAq8aJx + Flgrr4CDRPu3fywQZyhKdD+bwDaBkXcBI8MqRtmU3Crd3MTMnOLUZN3i5MS8vNQiXTO93MwS + vdSU0k2M4EBxUd7B+Oeg0iFGAQ5GJR5ehkeqQUKsiWXFlbmHGCU5mJREeY+EqgUJ8SXlp1Rm + JBZnxBeV5qQWH2KU4GBWEuFN8AHK8aYkVlalFuXDpKQ5WJTEeZ89PRsoJJCeWJKanZpakFoE + k5Xh4FCS4C0PB2oULEpNT61Iy8wpQUgzcXCCDOcBGr4GpIa3uCAxtzgzHSJ/ilFRSpw3HSQh + AJLIKM2D64VF8itGcaBXhHl7QKp4gEkArvsV0GAmoMFpn1VBBpckIqSkGhhbBFh96yYavBFe + d+Ua27yWtRK3pabmvVlwSrncw/nOWdmGv+d79xhOkKt853zn1Jr0a7EfDndILGRcX/zzSpj5 + updSDYdfp4a87M7Y8d3Lndf7n+Cre+lPGwP8Lu01zNgwaXe8abKVr4Nm0cveF5b9VzkOCTsK + MS1Ssf3g/2KbXF7dL0mOydFKLMUZiYZazEXFiQAgHo8EvwIAAA== +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: Tue, 03 Sep 2013 21:45:52 -0000 + +This is v2 of id:1377793557-28878-1-git-send-email-amdragon@mit.edu. +This fixes a problem found by Jani where notmuch-hello would reset +point placement when refreshing in Emacs 24. It also inverts the +sense of notmuch-hello-auto-refresh and makes it a defcustom +(originally I'd intended notmuch-hello-inhibit-auto-refresh for +internal use only, but both Mark and Jani expressed interest in +setting it). + +The diff from v1 follows + +diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el +index 1d6c3a2..55c416a 100644 +--- a/emacs/notmuch-hello.el ++++ b/emacs/notmuch-hello.el +@@ -232,6 +232,11 @@ supported for \"Customized queries section\" items." + notmuch-hello-query-section + (function :tag "Custom section")))) + ++(defcustom notmuch-hello-auto-refresh t ++ "Automatically refresh when returning to the notmuch-hello buffer." ++ :group 'notmuch-hello ++ :type 'boolean) ++ + (defvar notmuch-hello-hidden-sections nil + "List of sections titles whose contents are hidden") + +@@ -478,9 +483,6 @@ Such a list can be computed with `notmuch-hello-query-counts'." + ;; Lazy - rebuild everything. + (notmuch-hello no-display)) + +-(defvar notmuch-hello-inhibit-auto-refresh nil +- "Don't refresh notmuch-hello on window configuration changes.") +- + (defun notmuch-hello-window-configuration-change () + "Hook function to update the hello buffer when it is switched to." + (let ((hello-buf (get-buffer "*notmuch-hello*")) +@@ -501,8 +503,11 @@ Such a list can be computed with `notmuch-hello-query-counts'." + ;; is currently visible, was not visible on the last + ;; configuration change, and this is not a new window) + (setq do-refresh t))))) +- (when (and do-refresh (not notmuch-hello-inhibit-auto-refresh)) +- (notmuch-hello t)) ++ (when (and do-refresh notmuch-hello-auto-refresh) ++ ;; Refresh hello as soon as we get back to redisplay. On Emacs ++ ;; 24, we can't do it right here because something in this ++ ;; hook's call stack overrides hello's point placement. ++ (run-at-time nil nil #'notmuch-hello t)) + (when (null hello-buf) + ;; Clean up hook + (remove-hook 'window-configuration-change-hook +@@ -785,14 +790,15 @@ following: + + ;; This may cause a window configuration change, so if the + ;; auto-refresh hook is already installed, avoid recursive refresh. +- (let ((notmuch-hello-inhibit-auto-refresh t)) ++ (let ((notmuch-hello-auto-refresh nil)) + (if no-display + (set-buffer "*notmuch-hello*") + (switch-to-buffer "*notmuch-hello*"))) + + ;; Install auto-refresh hook +- (add-hook 'window-configuration-change-hook +- #'notmuch-hello-window-configuration-change) ++ (when notmuch-hello-auto-refresh ++ (add-hook 'window-configuration-change-hook ++ #'notmuch-hello-window-configuration-change)) + + (let ((target-line (line-number-at-pos)) + (target-column (current-column)) +