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 MHbNBPUI+1+2bAAA0tVLHw (envelope-from ) for ; Sun, 10 Jan 2021 14:02:29 +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 gGChAPUI+18zcwAAB5/wlQ (envelope-from ) for ; Sun, 10 Jan 2021 14:02:29 +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 C1D12940276 for ; Sun, 10 Jan 2021 14:02:28 +0000 (UTC) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 0926529EC1; Sun, 10 Jan 2021 09:01:36 -0500 (EST) Received: from mail.hostpark.net (mail.hostpark.net [212.243.197.30]) by mail.notmuchmail.org (Postfix) with ESMTPS id 52BA529D85 for ; Sun, 10 Jan 2021 09:01:17 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id D9C3A1661F for ; Sun, 10 Jan 2021 15:01:13 +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=1610287273; bh=SoHFcPgdzxrxDUn ogjwZJLK2g+iT3oDAFC2f3Nj3nUk=; b=IEofeJcK4FjWx9LrGGB0uNdKFPX3uca n4/2ytQ85XDp3JIFfrTc87+7rrOR9hF7X5fYG4vyWoL7Eevo3xuUcyjLridicKlt L1HKsbLjvFmyqQ1FFiMhaNDmbYxTWh3vVERxEy8RieSXx47FnnzFlKrGgkL+rdwn m94fhzAn3qyc= 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 zVkSHybKGb-K for ; Sun, 10 Jan 2021 15:01: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 A21111666F for ; Sun, 10 Jan 2021 15:01:13 +0100 (CET) From: Jonas Bernoulli To: notmuch@notmuchmail.org Subject: [PATCH v2 14/36] emacs: inline notmuch-sexp-eof into only caller Date: Sun, 10 Jan 2021 15:00:50 +0100 Message-Id: <20210110140112.25930-15-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: 3OOF55YYWUFQRNGCGND2J4L3O4EPPJP6 X-Message-ID-Hash: 3OOF55YYWUFQRNGCGND2J4L3O4EPPJP6 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.09 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=bernoul.li header.s=sel2011a header.b=IEofeJcK; 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-Migadu-Queue-Id: C1D12940276 X-Spam-Score: -0.09 X-Migadu-Scanner: scn0.migadu.com X-TUID: ihco7Iu6PD00 This function had a few issues. - Neither its name nor the old comment before it is called made it clear what it does. - It took one argument but didn't do anything with it. - It's doc-string made a few claims, which are untrue and generally focused on details instead of that its purpose is. --- emacs/notmuch-parser.el | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/emacs/notmuch-parser.el b/emacs/notmuch-parser.el index b8c3fd2c..294e0544 100644 --- a/emacs/notmuch-parser.el +++ b/emacs/notmuch-parser.el @@ -140,15 +140,6 @@ (defun notmuch-sexp-begin-list (sp) (forward-char) (signal 'invalid-read-syntax (list (string (char-before))))))) -(defun notmuch-sexp-eof (sp) - "Signal an error if there is more data in SP's buffer. - -Moves point to the beginning of any trailing data or to the end -of the buffer if there is only trailing whitespace." - (skip-chars-forward " \n\r\t") - (unless (eobp) - (error "Trailing garbage following expression"))) - (defvar notmuch-sexp--parser nil "The buffer-local notmuch-sexp-parser instance. @@ -187,8 +178,11 @@ (defun notmuch-sexp-parse-partial-list (result-function result-buffer) (t (with-current-buffer result-buffer (funcall result-function result)))))) (end - ;; Any trailing data is unexpected - (notmuch-sexp-eof notmuch-sexp--parser) + ;; Skip over trailing whitespace. + (skip-chars-forward " \n\r\t") + ;; Any trailing data is unexpected. + (unless (eobp) + (error "Trailing garbage following expression")) (setq done t))))) ;; Clear out what we've parsed (delete-region (point-min) (point))) -- 2.29.1