[PATCH v2 0/9] emacs: Unify common key bindings and lots more
authorAustin Clements <amdragon@MIT.EDU>
Tue, 3 Sep 2013 21:45:16 +0000 (17:45 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:56:52 +0000 (09:56 -0800)
9a/b947381863bdb8600583d8bc444ba80729898f [new file with mode: 0644]

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