[PATCH 2/3] Moved global defvar of notmuch-hello-target to function local
authorTomi Ollila <tomi.ollila@iki.fi>
Tue, 24 Apr 2012 21:11:09 +0000 (00:11 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:46:42 +0000 (09:46 -0800)
1a/9325c05e2e3cb828e762f63c28a679109215d0 [new file with mode: 0644]

diff --git a/1a/9325c05e2e3cb828e762f63c28a679109215d0 b/1a/9325c05e2e3cb828e762f63c28a679109215d0
new file mode 100644 (file)
index 0000000..5e8493f
--- /dev/null
@@ -0,0 +1,87 @@
+Return-Path: <too@guru.guru-group.fi>\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 7D7E0431FAE\r
+       for <notmuch@notmuchmail.org>; Tue, 24 Apr 2012 14:11:18 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       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 rm-Tpmth2mG1 for <notmuch@notmuchmail.org>;\r
+       Tue, 24 Apr 2012 14:11:17 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru-group.fi [87.108.86.66])\r
+       by olra.theworths.org (Postfix) with ESMTP id 9F466431FB6\r
+       for <notmuch@notmuchmail.org>; Tue, 24 Apr 2012 14:11:17 -0700 (PDT)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+       id A16B368056; Wed, 25 Apr 2012 00:11:12 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 2/3] Moved global defvar of notmuch-hello-target to function\r
+       local\r
+Date: Wed, 25 Apr 2012 00:11:09 +0300\r
+Message-Id: <1335301870-11572-2-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 1.7.6.1\r
+In-Reply-To: <1335301870-11572-1-git-send-email-tomi.ollila@iki.fi>\r
+References: <1335301870-11572-1-git-send-email-tomi.ollila@iki.fi>\r
+Cc: Tomi Ollila <too@iki.fi>\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, 24 Apr 2012 21:11:18 -0000\r
+\r
+From: Tomi Ollila <too@iki.fi>\r
+\r
+The global defvar notmuch-hello-target was used to silence compiler\r
+'free variable' warning. Actually the variable (when used) was always\r
+defined in (let...), shadowing the global in when dynamically scoped.\r
+"Moving" the defvar in function (possibly functions in future) where it\r
+is referenced is somewhat cleaner solution.\r
+\r
+---\r
+ emacs/notmuch-hello.el |    9 +--------\r
+ 1 files changed, 1 insertions(+), 8 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
+index 8ae0aca..c2cda19 100644\r
+--- a/emacs/notmuch-hello.el\r
++++ b/emacs/notmuch-hello.el\r
+@@ -235,14 +235,6 @@ supported for \"Customized queries section\" items."\r
+           notmuch-hello-query-section\r
+           (function :tag "Custom section"))))\r
+ \r
+-(defvar notmuch-hello-target nil\r
+-  "Button text at position of point before rebuilding the notmuch-buffer.\r
+-\r
+-This variable contains the text of the button, if any, the\r
+-point was positioned at before the notmuch-hello buffer was\r
+-rebuilt. This should never actually be global and is defined as a\r
+-defvar only for documentation purposes and to avoid a compiler\r
+-warning about it occurring as a free variable.")\r
+ \r
+ (defvar notmuch-hello-hidden-sections nil\r
+   "List of sections titles whose contents are hidden")\r
+@@ -421,6 +413,7 @@ SEARCHES must be a list containing lists of the form (NAME QUERY COUNT), where\r
+ QUERY is the query to start when the button for the corresponding entry is\r
+ activated. COUNT should be the number of messages matching the query.\r
+ Such a list can be computed with `notmuch-hello-query-counts'."\r
++  (defvar notmuch-hello-target) ;; dynamically bound in call path (or nil)\r
+   (let* ((widest (notmuch-hello-longest-label searches))\r
+        (tags-and-width (notmuch-hello-tags-per-line widest))\r
+        (tags-per-line (car tags-and-width))\r
+-- \r
+1.7.7.6\r
+\r