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

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

[nongnu] elpa/git-commit 6b4f7f5811 05/11: Remove magit-section-when, ob


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit 6b4f7f5811 05/11: Remove magit-section-when, obsolete since v2.90.0
Date: Mon, 13 Mar 2023 14:00:24 -0400 (EDT)

branch: elpa/git-commit
commit 6b4f7f5811272417560e952aed390098c6cf100e
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    Remove magit-section-when, obsolete since v2.90.0
---
 lisp/magit-section.el | 24 ------------------------
 1 file changed, 24 deletions(-)

diff --git a/lisp/magit-section.el b/lisp/magit-section.el
index 3844e13780..10c119a779 100644
--- a/lisp/magit-section.el
+++ b/lisp/magit-section.el
@@ -1213,30 +1213,6 @@ See `magit-section-match' for the forms CONDITION can 
take."
     (and (magit-section-match condition section)
          (oref section value))))
 
-(defmacro magit-section-when (condition &rest body)
-  "If the section at point matches CONDITION, evaluate BODY.
-
-If the section matches, then evaluate BODY forms sequentially
-with `it' bound to the section and return the value of the last
-form.  If there are no BODY forms, then return the value of the
-section.  If the section does not match or if there is no section
-at point, then return nil.
-
-See `magit-section-match' for the forms CONDITION can take."
-  (declare (obsolete
-            "instead use `magit-section-match' or `magit-section-value-if'."
-            "Magit 2.90.0")
-           (indent 1)
-           (debug (sexp body)))
-  `(--when-let (magit-current-section)
-     ;; Quoting CONDITION here often leads to double-quotes, which
-     ;; isn't an issue because `magit-section-match-1' implicitly
-     ;; deals with that.  We shouldn't force users of this function
-     ;; to not quote CONDITION because that would needlessly break
-     ;; backward compatibility.
-     (when (magit-section-match ',condition it)
-       ,@(or body '((oref it value))))))
-
 (defmacro magit-section-case (&rest clauses)
   "Choose among clauses on the type of the section at point.
 



reply via email to

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