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 ADbfA+SRLl+ZMgAA0tVLHw (envelope-from ) for ; Sat, 08 Aug 2020 11:52:04 +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 YOMrO+ORLl9rfQAAbx9fmQ (envelope-from ) for ; Sat, 08 Aug 2020 11:52:03 +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 84CE994053B for ; Sat, 8 Aug 2020 11:52:03 +0000 (UTC) Received: from [144.217.243.247] (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 1AB9329ACF; Sat, 8 Aug 2020 07:51:14 -0400 (EDT) Received: from mail.hostpark.net (mail.hostpark.net [212.243.197.30]) by mail.notmuchmail.org (Postfix) with ESMTPS id C5D1A29ABE for ; Sat, 8 Aug 2020 07:50:14 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id EF4CD16A83 for ; Sat, 8 Aug 2020 13:50:10 +0200 (CEST) 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 3n8jnxmXzAEs for ; Sat, 8 Aug 2020 13:50:10 +0200 (CEST) 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 BA62816A8A for ; Sat, 8 Aug 2020 13:50:10 +0200 (CEST) From: Jonas Bernoulli To: notmuch@notmuchmail.org Subject: [PATCH v3 18/34] emacs: Various cosmetic changes Date: Sat, 8 Aug 2020 13:49:53 +0200 Message-Id: <20200808115009.24071-19-jonas@bernoul.li> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200808115009.24071-1-jonas@bernoul.li> References: <20200726165818.400-1-jonas@bernoul.li> <20200808115009.24071-1-jonas@bernoul.li> MIME-Version: 1.0 Message-ID-Hash: JXJQ2SXO6YRH76MG4TPKZJ2M5YN3NRDN X-Message-ID-Hash: JXJQ2SXO6YRH76MG4TPKZJ2M5YN3NRDN 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: scn0 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.03 X-TUID: PaSeHAfsjJer --- emacs/make-deps.el | 3 ++- emacs/notmuch-lib.el | 8 +++----- emacs/notmuch-parser.el | 9 +++------ emacs/notmuch-show.el | 18 +++++++----------- emacs/rstdoc.el | 9 ++++----- test/test-lib.el | 31 +++++++++++++++---------------- 6 files changed, 34 insertions(+), 44 deletions(-) diff --git a/emacs/make-deps.el b/emacs/make-deps.el index dcac319c..91f4ef3d 100644 --- a/emacs/make-deps.el +++ b/emacs/make-deps.el @@ -36,7 +36,8 @@ (defun make-deps (&optional dir) This prints make dependencies to `standard-output' based on the top-level `require' expressions in the current buffer. Paths in rules will be given relative to DIR, or `default-directory'." - (setq dir (or dir default-directory)) + (unless dir + (setq dir default-directory)) (save-excursion (goto-char (point-min)) (condition-case nil diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index b86c44ed..05d86ea1 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -53,9 +53,8 @@ (defgroup notmuch-show nil (defgroup notmuch-send nil "Sending messages from Notmuch." - :group 'notmuch) - -(custom-add-to-group 'notmuch-send 'message 'custom-group) + :group 'notmuch + :group 'message) (defgroup notmuch-tag nil "Tags and tagging in Notmuch." @@ -782,8 +781,7 @@ (defun notmuch-logged-error (msg &optional extra) (insert extra) (unless (bolp) (newline))))) - (error "%s" - (concat msg (and extra " (see *Notmuch errors* for more details)")))) + (error "%s%s" msg (if extra " (see *Notmuch errors* for more details)" ""))) (defun notmuch-check-async-exit-status (proc msg &optional command err) "If PROC exited abnormally, pop up an error buffer and signal an error. diff --git a/emacs/notmuch-parser.el b/emacs/notmuch-parser.el index fbcfc2ef..3aa5bd8f 100644 --- a/emacs/notmuch-parser.el +++ b/emacs/notmuch-parser.el @@ -39,12 +39,9 @@ (defun notmuch-sexp-create-parser () buffer. Hence, the caller is allowed to delete any data before point and may resynchronize after an error by moving point." (vector 'notmuch-sexp-parser - ;; List depth - 0 - ;; Partial parse position marker - nil - ;; Partial parse state - nil)) + 0 ; List depth + nil ; Partial parse position marker + nil)) ; Partial parse state (defmacro notmuch-sexp--depth (sp) `(aref ,sp 1)) (defmacro notmuch-sexp--partial-pos (sp) `(aref ,sp 2)) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 015edb0c..5640346f 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -499,21 +499,17 @@ (define-button-type 'notmuch-show-part-button-type (defun notmuch-show-insert-part-header (nth content-type declared-type &optional name comment) - (let ((button) - (base-label (concat (and name (concat name ": ")) + (let ((base-label (concat (and name (concat name ": ")) declared-type (and (not (string-equal declared-type content-type)) (concat " (as " content-type ")")) comment))) - (setq button - (insert-button - (concat "[ " base-label " ]") - :base-label base-label - :type 'notmuch-show-part-button-type - :notmuch-part-hidden nil)) - (insert "\n") - ;; return button - button)) + (prog1 (insert-button + (concat "[ " base-label " ]") + :base-label base-label + :type 'notmuch-show-part-button-type + :notmuch-part-hidden nil) + (insert "\n")))) (defun notmuch-show-toggle-part-invisibility (&optional button) (interactive) diff --git a/emacs/rstdoc.el b/emacs/rstdoc.el index 92a337c8..41390bbe 100644 --- a/emacs/rstdoc.el +++ b/emacs/rstdoc.el @@ -24,7 +24,6 @@ ;; ;;; Commentary: -;; ;; Rstdoc provides a facility to extract all of the docstrings defined in ;; an elisp source file. Usage: @@ -68,10 +67,10 @@ (defun rstdoc--insert-docstring (symbol docstring) (insert "\n")) (defvar rst--escape-alist - '( ("\\\\='" . "\\\\'") - ("\\([^\\]\\)'" . "\\1`") - ("^[[:space:]\t]*$" . "|br|") - ("^[[:space:]\t]" . "|indent| ")) + '(("\\\\='" . "\\\\'") + ("\\([^\\]\\)'" . "\\1`") + ("^[[:space:]\t]*$" . "|br|") + ("^[[:space:]\t]" . "|indent| ")) "List of (regex . replacement) pairs.") (defun rstdoc--rst-quote-string (str) diff --git a/test/test-lib.el b/test/test-lib.el index 6a39bbe2..e9e7c379 100644 --- a/test/test-lib.el +++ b/test/test-lib.el @@ -154,22 +154,21 @@ (defun notmuch-test-report-unexpected (output expected) (defun notmuch-test-expect-equal (output expected) "Compare OUTPUT with EXPECTED. Report any discrepencies." - (if (equal output expected) - t - (cond - ((and (listp output) - (listp expected)) - ;; Reporting the difference between two lists is done by - ;; reporting differing elements of OUTPUT and EXPECTED - ;; pairwise. This is expected to make analysis of failures - ;; simpler. - (apply #'concat (cl-loop for o in output - for e in expected - if (not (equal o e)) - collect (notmuch-test-report-unexpected o e)))) - - (t - (notmuch-test-report-unexpected output expected))))) + (cond + ((equal output expected) + t) + ((and (listp output) + (listp expected)) + ;; Reporting the difference between two lists is done by + ;; reporting differing elements of OUTPUT and EXPECTED + ;; pairwise. This is expected to make analysis of failures + ;; simpler. + (apply #'concat (cl-loop for o in output + for e in expected + if (not (equal o e)) + collect (notmuch-test-report-unexpected o e)))) + (t + (notmuch-test-report-unexpected output expected)))) (defun notmuch-post-command () (run-hooks 'post-command-hook)) -- 2.28.0