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 AL3nMmdBqF/uPQAA0tVLHw (envelope-from ) for ; Sun, 08 Nov 2020 19:05:11 +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 +FrYLmdBqF8+WgAAB5/wlQ (envelope-from ) for ; Sun, 08 Nov 2020 19:05:11 +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 41AE59402C8 for ; Sun, 8 Nov 2020 19:05:11 +0000 (UTC) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id A1BE428C76; Sun, 8 Nov 2020 14:04:04 -0500 (EST) Received: from mail.hostpark.net (mail.hostpark.net [212.243.197.30]) by mail.notmuchmail.org (Postfix) with ESMTPS id 9B3D427106 for ; Sun, 8 Nov 2020 14:03:15 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id 616071665F for ; Sun, 8 Nov 2020 20:03:13 +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 msPMM-xvod_A for ; Sun, 8 Nov 2020 20:03:13 +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 C594416668 for ; Sun, 8 Nov 2020 20:03:12 +0100 (CET) From: Jonas Bernoulli To: notmuch@notmuchmail.org Subject: [PATCH 22/27] emacs: use defvar-local Date: Sun, 8 Nov 2020 20:03:06 +0100 Message-Id: <20201108190311.1397-23-jonas@bernoul.li> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201108190311.1397-1-jonas@bernoul.li> References: <20201108190311.1397-1-jonas@bernoul.li> MIME-Version: 1.0 Message-ID-Hash: HDUUJOYZKGMEZORXPOBRRCHGR2VLOOZ5 X-Message-ID-Hash: HDUUJOYZKGMEZORXPOBRRCHGR2VLOOZ5 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 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Spam-Score: -0.01 X-TUID: 57W/rXorFIri It is available since Emacs 24.3 and we require at least Emacs 25. --- emacs/coolj.el | 4 +--- emacs/notmuch-company.el | 4 ++-- emacs/notmuch-draft.el | 3 +-- emacs/notmuch-lib.el | 8 ++------ emacs/notmuch-show.el | 18 ++++++------------ emacs/notmuch-tree.el | 27 +++++++++------------------ 6 files changed, 21 insertions(+), 43 deletions(-) diff --git a/emacs/coolj.el b/emacs/coolj.el index 39a8de2b..0385872f 100644 --- a/emacs/coolj.el +++ b/emacs/coolj.el @@ -50,9 +50,7 @@ (defcustom coolj-line-prefix-regexp "^\\(>+ \\)*" :group 'coolj :type 'regexp) -(defvar coolj-wrap-point nil) - -(make-variable-buffer-local 'coolj-wrap-point) +(defvar-local coolj-wrap-point nil) (defun coolj-determine-prefix () "Determine the prefix for the current line." diff --git a/emacs/notmuch-company.el b/emacs/notmuch-company.el index 9ee8ceca..9e743029 100644 --- a/emacs/notmuch-company.el +++ b/emacs/notmuch-company.el @@ -36,8 +36,8 @@ (eval-when-compile (require 'cl-lib)) (require 'notmuch-lib) -(defvar notmuch-company-last-prefix nil) -(make-variable-buffer-local 'notmuch-company-last-prefix) +(defvar-local notmuch-company-last-prefix nil) + (declare-function company-begin-backend "company") (declare-function company-grab "company") (declare-function company-mode "company") diff --git a/emacs/notmuch-draft.el b/emacs/notmuch-draft.el index b13eb51c..ca720384 100644 --- a/emacs/notmuch-draft.el +++ b/emacs/notmuch-draft.el @@ -89,9 +89,8 @@ (defvar notmuch-draft-encryption-tag-regex "<#\\(part encrypt\\|secure.*mode=.*encrypt>\\)" "Regular expression matching mml tags indicating encryption of part or message.") -(defvar notmuch-draft-id nil +(defvar-local notmuch-draft-id nil "Message-id of the most recent saved draft of this message.") -(make-variable-buffer-local 'notmuch-draft-id) (defun notmuch-draft--mark-deleted () "Tag the last saved draft deleted. diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index 2c8de328..e23999ad 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -435,9 +435,8 @@ (defun notmuch-subkeymap-help () (insert desc))) (pop-to-buffer (help-buffer))))) -(defvar notmuch-buffer-refresh-function nil +(defvar-local notmuch-buffer-refresh-function nil "Function to call to refresh the current buffer.") -(make-variable-buffer-local 'notmuch-buffer-refresh-function) (defun notmuch-refresh-this-buffer () "Refresh the current buffer." @@ -989,10 +988,7 @@ (defun notmuch-start-notmuch-error-sentinel (proc event) (find-file-noselect err-file)))) (when err-buffer (kill-buffer err-buffer)))) -;; This variable is used only buffer local, but it needs to be -;; declared globally first to avoid compiler warnings. -(defvar notmuch-show-process-crypto nil) -(make-variable-buffer-local 'notmuch-show-process-crypto) +(defvar-local notmuch-show-process-crypto nil) (defun notmuch-interactive-region () "Return the bounds of the current interactive region. diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 09cdeaaa..c9b1e966 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -162,23 +162,17 @@ (defcustom notmuch-show-text/html-blocked-images "." :type '(choice (const nil) regexp) :group 'notmuch-show) -(defvar notmuch-show-thread-id nil) -(make-variable-buffer-local 'notmuch-show-thread-id) +(defvar-local notmuch-show-thread-id nil) -(defvar notmuch-show-parent-buffer nil) -(make-variable-buffer-local 'notmuch-show-parent-buffer) +(defvar-local notmuch-show-parent-buffer nil) -(defvar notmuch-show-query-context nil) -(make-variable-buffer-local 'notmuch-show-query-context) +(defvar-local notmuch-show-query-context nil) -(defvar notmuch-show-process-crypto nil) -(make-variable-buffer-local 'notmuch-show-process-crypto) +(defvar-local notmuch-show-process-crypto nil) -(defvar notmuch-show-elide-non-matching-messages nil) -(make-variable-buffer-local 'notmuch-show-elide-non-matching-messages) +(defvar-local notmuch-show-elide-non-matching-messages nil) -(defvar notmuch-show-indent-content t) -(make-variable-buffer-local 'notmuch-show-indent-content) +(defvar-local notmuch-show-indent-content t) (defvar notmuch-show-attachment-debug nil "If t log stdout and stderr from attachment handlers. diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el index 71b6387a..3b5dab3e 100644 --- a/emacs/notmuch-tree.el +++ b/emacs/notmuch-tree.el @@ -51,9 +51,8 @@ (declare-function notmuch-tree-from-search-thread "notmuch" ()) (defvar notmuch-search-query-string) ;; this variable distinguishes the unthreaded display from the normal tree display -(defvar notmuch-tree-unthreaded nil +(defvar-local notmuch-tree-unthreaded nil "A buffer local copy of argument unthreaded to the function notmuch-tree.") -(make-variable-buffer-local 'notmuch-tree-unthreaded) (defgroup notmuch-tree nil "Showing message and thread structure." @@ -207,44 +206,36 @@ (defface notmuch-tree-no-match-tag-face :group 'notmuch-tree :group 'notmuch-faces) -(defvar notmuch-tree-previous-subject +(defvar-local notmuch-tree-previous-subject "The subject of the most recent result shown during the async display.") -(make-variable-buffer-local 'notmuch-tree-previous-subject) -(defvar notmuch-tree-basic-query nil +(defvar-local notmuch-tree-basic-query nil "A buffer local copy of argument query to the function notmuch-tree.") -(make-variable-buffer-local 'notmuch-tree-basic-query) -(defvar notmuch-tree-query-context nil +(defvar-local notmuch-tree-query-context nil "A buffer local copy of argument query-context to the function notmuch-tree.") -(make-variable-buffer-local 'notmuch-tree-query-context) -(defvar notmuch-tree-target-msg nil +(defvar-local notmuch-tree-target-msg nil "A buffer local copy of argument target to the function notmuch-tree.") -(make-variable-buffer-local 'notmuch-tree-target-msg) -(defvar notmuch-tree-open-target nil +(defvar-local notmuch-tree-open-target nil "A buffer local copy of argument open-target to the function notmuch-tree.") -(make-variable-buffer-local 'notmuch-tree-open-target) -(defvar notmuch-tree-parent-buffer nil) -(make-variable-buffer-local 'notmuch-tree-parent-buffer) +(defvar-local notmuch-tree-parent-buffer nil) -(defvar notmuch-tree-message-window nil +(defvar-local notmuch-tree-message-window nil "The window of the message pane. It is set in both the tree buffer and the child show buffer. It is used to try and close the message pane when quitting tree view or the child show buffer.") -(make-variable-buffer-local 'notmuch-tree-message-window) (put 'notmuch-tree-message-window 'permanent-local t) -(defvar notmuch-tree-message-buffer nil +(defvar-local notmuch-tree-message-buffer nil "The buffer name of the show buffer in the message pane. This is used to try and make sure we don't close the message pane if the user has loaded a different buffer in that window.") -(make-variable-buffer-local 'notmuch-tree-message-buffer) (put 'notmuch-tree-message-buffer 'permanent-local t) (defun notmuch-tree-to-message-pane (func) -- 2.29.1