emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/tuareg 3367a31e75 1/2: Avoid unused return value warning


From: ELPA Syncer
Subject: [nongnu] elpa/tuareg 3367a31e75 1/2: Avoid unused return value warning
Date: Sat, 13 May 2023 12:02:38 -0400 (EDT)

branch: elpa/tuareg
commit 3367a31e757d2b0de215ec3e6666b2b3c0792bf0
Author: Mattias EngdegÄrd <mattiase@acm.org>
Commit: Mattias EngdegÄrd <mattiase@acm.org>

    Avoid unused return value warning
    
    tuareg--syntax-rules: Omit clauses with empty bodies to avoid an Emacs
    30 warning about the value from `match-beginning` being unused.
---
 tuareg.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tuareg.el b/tuareg.el
index 0c5a2e30dd..cc61f81354 100644
--- a/tuareg.el
+++ b/tuareg.el
@@ -722,8 +722,12 @@ delimiting the region of interest. "
                       ,@body))
                 body)))
         (push re regexps)
-        (push `((match-beginning ,group-number) . ,clause-body)
-              clauses)
+        ;; We can just omit empty clauses since the conditions are
+        ;; mutually exclusive by construction (and the value of the
+        ;; clause bodies are ignored).
+        (when body
+          (push `((match-beginning ,group-number) . ,clause-body)
+                clauses))
         (setq group-number (+ group-number 1 re-ngroups))))
     (let ((combined-re (mapconcat (lambda (re) (concat "\\(" re "\\)"))
                                   (nreverse regexps) "\\|"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]