From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id KE3yFTwxqF8kOQAA0tVLHw (envelope-from ) for ; Sun, 08 Nov 2020 17:56:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id mK+/ETwxqF8gMAAAB5/wlQ (envelope-from ) for ; Sun, 08 Nov 2020 17:56:12 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BFEBB94042C for ; Sun, 8 Nov 2020 17:56:11 +0000 (UTC) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 5C6FA270DC; Sun, 8 Nov 2020 12:56:06 -0500 (EST) X-Greylist: delayed 390 seconds by postgrey-1.36 at nmbug; Sun, 08 Nov 2020 12:56:03 EST Received: from mail.hostpark.net (mail.hostpark.net [212.243.197.30]) by mail.notmuchmail.org (Postfix) with ESMTPS id 624472000C for ; Sun, 8 Nov 2020 12:56:03 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id 424E4165BD for ; Sun, 8 Nov 2020 18:49:30 +0100 (CET) X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net Received: from mail.hostpark.net ([127.0.0.1]) by localhost (mail0.hostpark.net [127.0.0.1]) (amavisd-new, port 10124) with ESMTP id q_YSuxJ74TaQ for ; Sun, 8 Nov 2020 18:49:30 +0100 (CET) Received: from customer (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.hostpark.net (Postfix) with ESMTPSA id 115F716104 for ; Sun, 8 Nov 2020 18:49:30 +0100 (CET) From: Jonas Bernoulli To: notmuch@notmuchmail.org Subject: [PATCH] Revert "emacs: notmuch-search: avoid wiping out buffer-local variables" Date: Sun, 8 Nov 2020 18:49:29 +0100 Message-Id: <20201108174929.1227-1-jonas@bernoul.li> X-Mailer: git-send-email 2.29.1 MIME-Version: 1.0 Message-ID-Hash: IT4LXNAJ7ROKVCFEHPYXMBZLDM67GQNS X-Message-ID-Hash: IT4LXNAJ7ROKVCFEHPYXMBZLDM67GQNS X-MailFrom: jonas@bernoul.li X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Spam-Score: -0.01 X-TUID: gAtlj3AeIibf This reverts commit f9fbd1ee3bfd679175d88af403752d87a730349f. Emacs provides a mechanism for avoiding wiping out buffer-local variables: marking them as "permanent local", which essentially means "don't wip out the local value when enabling major-mode". (put 'the-variable 'permanent-local t) See (info "(elisp)Creating Buffer-Local"). Whether refreshing the buffer contents should involve re-enable the mode is a different question, which should not be decided based on the fact that we want keep the value of some random variable, not least because some other (e.g. cache) variables are likely expected to be wiped. --- emacs/notmuch.el | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 83bcee57..c4078bd3 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -995,11 +995,7 @@ (defun notmuch-search (&optional query oldest-first target-thread target-line no (if no-display (set-buffer buffer) (pop-to-buffer-same-window buffer)) - ;; avoid wiping out third party buffer-local variables in the case - ;; where we're just refreshing or changing the sort order of an - ;; existing search results buffer - (unless (eq major-mode 'notmuch-search-mode) - (notmuch-search-mode)) + (notmuch-search-mode) ;; Don't track undo information for this buffer (set 'buffer-undo-list t) (set 'notmuch-search-query-string query) -- 2.29.1