From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 4AXgAivT72IX7AAAbAwnHQ (envelope-from ) for ; Sun, 07 Aug 2022 16:58:51 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id +MvoAivT72Ke5wAAauVa8A (envelope-from ) for ; Sun, 07 Aug 2022 16:58:51 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::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 aspmx1.migadu.com (Postfix) with ESMTPS id B3E439341 for ; Sun, 7 Aug 2022 16:58:50 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 8A88B5F41E; Sun, 7 Aug 2022 14:58:20 +0000 (UTC) Received: from mail.kisara.moe (119.ip-51-38-65.eu [51.38.65.119]) by mail.notmuchmail.org (Postfix) with ESMTPS id 907875E01E for ; Sun, 7 Aug 2022 14:58:11 +0000 (UTC) Received: from localhost.localdomain (unknown [141.98.252.161]) (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.kisara.moe (Postfix) with ESMTPSA id D53EDA0B58; Sun, 7 Aug 2022 16:58:10 +0200 (CEST) From: Mohsin Kaleem To: David Bremner , notmuch@notmuchmail.org Subject: [PATCH 8/9] review: Rename variables to better express intention Date: Sun, 7 Aug 2022 15:57:32 +0100 Message-Id: <20220807145733.129867-8-mohkale@kisara.moe> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220807145733.129867-1-mohkale@kisara.moe> References: <87v8re66mg.fsf@tethera.net> <20220807145733.129867-1-mohkale@kisara.moe> MIME-Version: 1.0 Message-ID-Hash: ACLCL6TPLTMIWLYVHQ2TQVMWUFY2EFET X-Message-ID-Hash: ACLCL6TPLTMIWLYVHQ2TQVMWUFY2EFET X-MailFrom: mohkale@kisara.moe X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0 CC: Mohsin Kaleem X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1659884330; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=8VZnAYMdzK0QQp8Jb/H1VtOG/iCSewFUkk9LHfdcEEs=; b=pzsiJF8iUpW2zc3fbNPNcbpuv3cpapvIU/X6Y+X4eiat5OO3ikHcEwM6+L/wSAkwu8NLkY F5Oee/SSC3sS4m7trhL4qhxU2soaKM2za1BnY/1eLUriG4/YUYpp6r5Lqe30nUJjFxxh8H l00SoMAgL1GWhaTP+R4d8CoUoa0GGkW3bh+kS+K9WWQ7o26NFn9nyII9JOcuESVdEm/gII 3NMXNHSTB4BBaMT9E0HpsaGTIMrjvPc4DhXbHB6uTHa7iMLu/kgPXb7eHNF39YiWUyJ/ls gEPhbHqmjiYuGBKO91h+A1rY210nXs6tUfFzn06ouJnjr6NlXQCPbBgOXJBeIw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1659884330; a=rsa-sha256; cv=none; b=lgnLvCZO/uKwWKbiu+GdbCiUnfQsAZbTIzuiFrE4kUPFdYQJFKY2tLZ8TPp/e/PGLuzrXN cG7Gu9zQH75+teKUMbsFL+7qHOIGEBKiAT/JJT9/yDwcaQw4S11Tr1f6nGOmiDxBstE2Hm 4HmlL09AgkIItWK7R/r5NKbhgQxe3sE//up+SiYDVsF7vLZvJEqn2pJYBfjQvCx35M9M4a WB0PSI3f+IgO98jk9f1Pa0zVdoA9kJHPJJ7Cq++0wGE+dXQR7UN0Wgkycj61y6curPbLTZ r+dJbN6l4vr9uK52ukhec0RO9MPR6SkgUo+Ehyi+wJH+Asf6gZPpS2CZ9WspOQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kisara.moe (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: 3.84 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kisara.moe (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: B3E439341 X-Spam-Score: 3.84 X-Migadu-Scanner: scn1.migadu.com X-TUID: hU4erdliyVQu --- emacs/notmuch-hello.el | 18 +++++++++--------- emacs/notmuch-jump.el | 2 +- emacs/notmuch-lib.el | 4 ++-- emacs/notmuch-tree.el | 24 ++++++++++++------------ emacs/notmuch.el | 29 +++++++++++++++-------------- 5 files changed, 39 insertions(+), 38 deletions(-) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index 810f094e..39ba2537 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -143,10 +143,10 @@ a plist. Supported properties are :sort-order Specify the sort order to be used for the search. Possible values are `oldest-first', `newest-first' or nil. Nil means use the default sort order. - :excluded Whether to include mail with excluded tags in the - search. Possible values are `include', `exclude', + :excluded Whether to show mail with excluded tags in the + search. Possible values are `hide', `show', or nil. Nil means use the default value of - `notmuch-search-exclude'. + `notmuch-search-hide-excluded'. :search-type Specify whether to run the search in search-mode, tree mode or unthreaded mode. Set to `tree' to specify tree mode, 'unthreaded to specify @@ -490,7 +490,7 @@ diagonal." (defun notmuch-hello-widget-search (widget &rest _ignore) (let ((search-terms (widget-get widget :notmuch-search-terms)) (oldest-first (widget-get widget :notmuch-search-oldest-first)) - (exclude (widget-get widget :notmuch-search-exclude))) + (exclude (widget-get widget :notmuch-search-hide-excluded))) (cl-case (widget-get widget :notmuch-search-type) (tree (let ((n (notmuch-search-format-buffer-name (widget-value widget) "tree" t))) @@ -498,7 +498,7 @@ diagonal." (unthreaded (let ((n (notmuch-search-format-buffer-name (widget-value widget) "unthreaded" t))) - (notmuch-unthreaded search-terms nil nil n nil oldest-first search-exclude))) + (notmuch-unthreaded search-terms nil nil n nil oldest-first exclude))) (t (notmuch-search search-terms oldest-first exclude))))) @@ -648,9 +648,9 @@ with `notmuch-hello-query-counts'." (oldest-first t) (otherwise notmuch-search-oldest-first))) (exclude (cl-case (plist-get elem :excluded) - (exclude t) - (include nil) - (otherwise notmuch-search-exclude))) + (hide t) + (show nil) + (otherwise notmuch-search-hide-excluded))) (search-type (plist-get elem :search-type)) (msg-count (plist-get elem :count))) (widget-insert (format "%8s " @@ -660,7 +660,7 @@ with `notmuch-hello-query-counts'." :notmuch-search-terms query :notmuch-search-oldest-first oldest-first :notmuch-search-type search-type - :notmuch-search-exclude exclude + :notmuch-search-hide-excluded exclude name) (setq column-indent (1+ (max 0 (- column-width (length name))))))) diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el index e98c9c1d..53496e5c 100644 --- a/emacs/notmuch-jump.el +++ b/emacs/notmuch-jump.el @@ -51,7 +51,7 @@ fast way to jump to a saved search from anywhere in Notmuch." (newest-first nil) (oldest-first t) (otherwise (default-value 'notmuch-search-oldest-first)))) - (exclude (default-value 'notmuch-search-exclude))) + (exclude (default-value 'notmuch-search-hide-excluded))) (push (list key name (cond ((eq (plist-get saved-search :search-type) 'tree) diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index 96795054..d0205d0e 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -105,7 +105,7 @@ search." :group 'notmuch-search) (make-variable-buffer-local 'notmuch-search-oldest-first) -(defcustom notmuch-search-exclude t +(defcustom notmuch-search-hide-excluded t "Hide mail tagged with a excluded tag. Excluded tags are defined in the users configuration file under @@ -113,7 +113,7 @@ the search section. When this variable is true, any mail with such a tag will not be shown in the search output." :type 'boolean :group 'notmuch-search) -(make-variable-buffer-local 'notmuch-search-exclude) +(make-variable-buffer-local 'notmuch-search-hide-excluded) (defcustom notmuch-poll-script nil "[Deprecated] Command to run to incorporate new mail into the notmuch database. diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el index 5f999424..6d19b9ed 100644 --- a/emacs/notmuch-tree.el +++ b/emacs/notmuch-tree.el @@ -593,7 +593,7 @@ NOT change the database." (notmuch-tree-close-message-window) (notmuch-search (notmuch-tree-get-query) notmuch-search-oldest-first - notmuch-search-exclude)) + notmuch-search-hide-excluded)) (defun notmuch-tree-message-window-kill-hook () "Close the message pane when exiting the show buffer." @@ -807,7 +807,7 @@ nil otherwise." nil unthreaded notmuch-search-oldest-first - notmuch-search-exclude))) + notmuch-search-hide-excluded))) (defun notmuch-tree-thread-top () (when (notmuch-tree-get-message-properties) @@ -1134,7 +1134,7 @@ the same as for the function notmuch-tree." (notmuch-tree-mode) (add-hook 'post-command-hook #'notmuch-tree-command-hook t t) (setq notmuch-search-oldest-first oldest-first) - (setq notmuch-search-exclude exclude) + (setq notmuch-search-hide-excluded exclude) (setq notmuch-tree-unthreaded unthreaded) (setq notmuch-tree-basic-query basic-query) (setq notmuch-tree-query-context (if (or (string= query-context "") @@ -1193,14 +1193,14 @@ default sort order is defined by `notmuch-search-oldest-first'." "Toggle whether to hide excluded messages. This command toggles whether to hide excluded messages for the current -search. The default value for this is defined by `notmuch-search-exclude'." +search. The default value for this is defined by `notmuch-search-hide-excluded'." (interactive) - (setq notmuch-search-exclude (not notmuch-search-exclude)) + (setq notmuch-search-hide-excluded (not notmuch-search-hide-excluded)) (notmuch-tree-refresh-view)) (defun notmuch-tree (&optional query query-context target buffer-name open-target unthreaded parent-buffer - oldest-first exclude) + oldest-first hide-excluded) "Display threads matching QUERY in tree view. The arguments are: @@ -1223,7 +1223,7 @@ The arguments are: nil nil nil nil nil nil ;; Populate these from the default value of these options. (default-value 'notmuch-search-oldest-first) - (default-value 'notmuch-search-exclude))) + (default-value 'notmuch-search-hide-excluded))) (unless query (setq query (notmuch-read-query (concat "Notmuch " (if unthreaded "unthreaded " "tree ") @@ -1238,12 +1238,12 @@ The arguments are: ;; Don't track undo information for this buffer (setq buffer-undo-list t) (notmuch-tree-worker query query-context target open-target - unthreaded oldest-first exclude) + unthreaded oldest-first hide-excluded) (setq notmuch-tree-parent-buffer parent-buffer) (setq truncate-lines t)) (defun notmuch-unthreaded (&optional query query-context target buffer-name - open-target oldest-first exclude) + open-target oldest-first hide-excluded) "Display threads matching QUERY in unthreaded view. See function NOTMUCH-TREE for documentation of the arguments" @@ -1255,9 +1255,9 @@ See function NOTMUCH-TREE for documentation of the arguments" nil nil nil nil ;; Populate these from the default value of these options. (default-value 'notmuch-search-oldest-first) - (default-value 'notmuch-search-exclude))) + (default-value 'notmuch-search-hide-excluded))) (notmuch-tree query query-context target buffer-name open-target - t nil oldest-first exclude)) + t nil oldest-first hide-excluded)) (defun notmuch-tree-filter (query) "Filter or LIMIT the current search results based on an additional query string. @@ -1292,7 +1292,7 @@ search results and that are also tagged with the given TAG." notmuch-tree-unthreaded nil notmuch-search-oldest-first - notmuch-search-exclude))) + notmuch-search-hide-excluded))) ;;; _ diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 0158e20a..8dee623b 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -553,7 +553,7 @@ Return non-nil on success." (notmuch-tree notmuch-search-query-string nil nil nil nil nil nil notmuch-search-oldest-first - notmuch-search-exclude)) + notmuch-search-hide-excluded)) (defun notmuch-unthreaded-from-search-current-query () "Unthreaded view of current query." @@ -561,7 +561,7 @@ Return non-nil on success." (notmuch-unthreaded notmuch-search-query-string nil nil nil nil notmuch-search-oldest-first - notmuch-search-exclude)) + notmuch-search-hide-excluded)) (defun notmuch-tree-from-search-thread () "Show the selected thread with notmuch-tree." @@ -572,7 +572,7 @@ Return non-nil on success." (notmuch-prettify-subject (notmuch-search-find-subject)) t nil (current-buffer) notmuch-search-oldest-first - notmuch-search-exclude)) + notmuch-search-hide-excluded)) (defun notmuch-search-reply-to-thread (&optional prompt-for-sender) "Begin composing a reply-all to the entire current thread in a new buffer." @@ -1042,7 +1042,7 @@ PROMPT is the string to prompt with." (put 'notmuch-search 'notmuch-doc "Search for messages.") ;;;###autoload -(defun notmuch-search (&optional query oldest-first exclude target-thread +(defun notmuch-search (&optional query oldest-first hide-excluded target-thread target-line no-display) "Display threads matching QUERY in a notmuch-search buffer. @@ -1050,7 +1050,8 @@ If QUERY is nil, it is read interactively from the minibuffer. Other optional parameters are used as follows: OLDEST-FIRST: A Boolean controlling the sort order of returned threads - EXCLUDE: A boolean controlling whether to omit threads with excluded tags. + HIDE-EXCLUDED: A boolean controlling whether to omit threads with excluded + tags. TARGET-THREAD: A thread ID (without the thread: prefix) that will be made current if it appears in the search results. TARGET-LINE: The line number to move to if the target thread does not @@ -1068,7 +1069,7 @@ the configured default sort order." ;; Use the default search order and exclude value (if we're doing a ;; search from a search buffer, ignore any buffer-local overrides) (default-value 'notmuch-search-oldest-first) - (default-value 'notmuch-search-exclude))) + (default-value 'notmuch-search-hide-excluded))) (let* ((query (or query (notmuch-read-query "Notmuch search: "))) (buffer (get-buffer-create (notmuch-search-buffer-title query)))) @@ -1082,7 +1083,7 @@ the configured default sort order." (setq notmuch-search-oldest-first oldest-first) (setq notmuch-search-target-thread target-thread) (setq notmuch-search-target-line target-line) - (setq notmuch-search-exclude exclude) + (setq notmuch-search-hide-excluded hide-excluded) (notmuch-tag-clear-cache) (when (get-buffer-process buffer) (error "notmuch search process already running for query `%s'" query)) @@ -1096,7 +1097,7 @@ the configured default sort order." (if oldest-first "--sort=oldest-first" "--sort=newest-first") - (if exclude + (if hide-excluded "--exclude=true" "--exclude=false") query))) @@ -1119,7 +1120,7 @@ same relative position within the new buffer." (interactive) (notmuch-search notmuch-search-query-string notmuch-search-oldest-first - notmuch-search-exclude + notmuch-search-hide-excluded (notmuch-search-find-thread-id 'bare) (line-number-at-pos) t) @@ -1129,9 +1130,9 @@ same relative position within the new buffer." "Toggle whether to hide excluded messages. This command toggles whether to hide excluded messages for the current -search. The default value for this is defined by `notmuch-search-exclude'." +search. The default value for this is defined by `notmuch-search-hide-excluded'." (interactive) - (setq notmuch-search-exclude (not notmuch-search-exclude)) + (setq notmuch-search-hide-excluded (not notmuch-search-hide-excluded)) (notmuch-search-refresh-view)) (defun notmuch-search-toggle-order () @@ -1163,7 +1164,7 @@ current search results AND the additional query string provided." grouped-query (concat grouped-original-query " and " grouped-query)) notmuch-search-oldest-first - notmuch-search-exclude))) + notmuch-search-hide-excluded))) (defun notmuch-search-filter-by-tag (tag) "Filter the current search results based on a single TAG. @@ -1175,7 +1176,7 @@ search results and that are also tagged with the given TAG." notmuch-search-query-string))) (notmuch-search (concat notmuch-search-query-string " and tag:" tag) notmuch-search-oldest-first - notmuch-search-exclude)) + notmuch-search-hide-excluded)) (defun notmuch-search-by-tag (tag) "Display threads matching TAG in a notmuch-search buffer." @@ -1183,7 +1184,7 @@ search results and that are also tagged with the given TAG." (list (notmuch-select-tag-with-completion "Notmuch search tag: "))) (notmuch-search (concat "tag:" tag) (default-value 'notmuch-search-oldest-first) - (default-value 'notmuch-search-exclude))) + (default-value 'notmuch-search-hide-excluded))) ;;;###autoload (defun notmuch () -- 2.37.1