From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id wNo7C0gJ+1+VdQAA0tVLHw (envelope-from ) for ; Sun, 10 Jan 2021 14:03:52 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id EMflBkgJ+18FQwAAbx9fmQ (envelope-from ) for ; Sun, 10 Jan 2021 14:03:52 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (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 A2D96940463 for ; Sun, 10 Jan 2021 14:03:51 +0000 (UTC) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id B62D72BF54; Sun, 10 Jan 2021 09:02:03 -0500 (EST) Received: from mail.hostpark.net (mail.hostpark.net [212.243.197.30]) by mail.notmuchmail.org (Postfix) with ESMTPS id 9499729DEA for ; Sun, 10 Jan 2021 09:01:18 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id 7F599165C3 for ; Sun, 10 Jan 2021 15:01:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bernoul.li; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=sel2011a; t=1610287274; bh=MmJrSMx469wXk2U Hiabkgdo+wl63sSiPmb/73LK2/RI=; b=yaIP7XwomoBxdrVoGxlSeF6QDrqNVMp GKG65XW6l6Q2XPJIwP+RiBrM5JAaJzpISXG2TkdPDyoh/Iyo5Z70xmqD3O5n1dXv kCZmSv407/JEtWsPbEOy9kJs/ZvXQqRLBWggSm+PqbKYXu9h5lmyqGtGFaT8JwZq Mqj10Gs/GnYA= 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 10224) with ESMTP id 1ZPy-uk1hY2I for ; Sun, 10 Jan 2021 15:01:14 +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 4582E166B5 for ; Sun, 10 Jan 2021 15:01:14 +0100 (CET) From: Jonas Bernoulli To: notmuch@notmuchmail.org Subject: [PATCH v2 27/36] emacs: define a few variables as automatically buffer-local Date: Sun, 10 Jan 2021 15:01:03 +0100 Message-Id: <20210110140112.25930-28-jonas@bernoul.li> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20210110140112.25930-1-jonas@bernoul.li> References: <20201214162401.19569-1-jonas@bernoul.li> <20210110140112.25930-1-jonas@bernoul.li> MIME-Version: 1.0 Message-ID-Hash: QRIQDYCACLODRCFWZRI75CPOS6EUI7B7 X-Message-ID-Hash: QRIQDYCACLODRCFWZRI75CPOS6EUI7B7 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-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: 0.06 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=bernoul.li header.s=sel2011a header.b=yaIP7Xwo; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: A2D96940463 X-Spam-Score: 0.06 X-Migadu-Scanner: scn0.migadu.com X-TUID: wbUUH6Hzigiq Define these variables as automatically buffer-local, meaning that they always become buffer-local when set unless explicitly told otherwise using `setq-default' or when using the Custom interface. Previously they were declared, which keeps the byte-compiler quiet but is not actually the same as being defined. `notmuch-search-mode' then made them buffer-local in the current buffer and then set the local values. This works but is not kosher. The definitions of the three non-option variables have to be moved up a bit to enable the change in the next commit, which see. --- emacs/notmuch-lib.el | 1 + emacs/notmuch.el | 16 ++++++---------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index 72549a98..2fd9a27d 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -101,6 +101,7 @@ (defcustom notmuch-search-oldest-first t search." :type 'boolean :group 'notmuch-search) +(make-variable-buffer-local 'notmuch-search-oldest-first) (defcustom notmuch-poll-script nil "[Deprecated] Command to run to incorporate new mail into the notmuch database. diff --git a/emacs/notmuch.el b/emacs/notmuch.el index ccece811..027c5cfa 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -205,6 +205,12 @@ (defvar notmuch-search-mode-map map) "Keymap for \"notmuch search\" buffers.") +;;; Internal Variables + +(defvar-local notmuch-search-query-string nil) +(defvar-local notmuch-search-target-thread nil) +(defvar-local notmuch-search-target-line nil) + ;;; Stashing (defvar notmuch-search-stash-map @@ -226,12 +232,6 @@ (defun notmuch-stash-query () (interactive) (notmuch-common-do-stash (notmuch-search-get-query))) -;;; Variables - -(defvar notmuch-search-query-string) -(defvar notmuch-search-target-thread) -(defvar notmuch-search-target-line) - ;;; Movement (defun notmuch-search-scroll-up () @@ -404,10 +404,6 @@ (define-derived-mode notmuch-search-mode fundamental-mode "notmuch-search" Complete list of currently available key bindings: \\{notmuch-search-mode-map}" - (make-local-variable 'notmuch-search-query-string) - (make-local-variable 'notmuch-search-oldest-first) - (make-local-variable 'notmuch-search-target-thread) - (make-local-variable 'notmuch-search-target-line) (setq notmuch-buffer-refresh-function #'notmuch-search-refresh-view) (setq-local scroll-preserve-screen-position t) (add-to-invisibility-spec (cons 'ellipsis t)) -- 2.29.1