[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode c3793b2 176/385: canonical until macro
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode c3793b2 176/385: canonical until macro |
Date: |
Tue, 5 Oct 2021 23:59:26 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit c3793b2ca131488c7f325af5af90896ec08c292e
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
canonical until macro
---
haskell-tng-smie.el | 10 +++++-----
haskell-tng-util.el | 11 +++++------
2 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/haskell-tng-smie.el b/haskell-tng-smie.el
index a7f396a..fdab67e 100644
--- a/haskell-tng-smie.el
+++ b/haskell-tng-smie.el
@@ -178,8 +178,8 @@ information, to aid in the creation of new rules."
(car (smie-indent-backward-token))))
(psexp (save-excursion
(caddr (haskell-tng:until
- (smie-backward-sexp)
- (bobp)))))
+ (or (smie-backward-sexp)
+ (bobp))))))
(next (save-excursion
(car (smie-indent-forward-token)))))
@@ -409,9 +409,9 @@ extreme parent.
Inspired by `smie-indent--parent', which can only be used in
:before and :after."
(when-let ((res (or (smie-backward-sexp t)
- (haskell-tng:until
- (smie-backward-sexp)
- (bobp))))
+ (haskell-tng:until
+ (or (smie-backward-sexp)
+ (bobp)))))
(tok (if (car res)
;; break through open parens
(car (smie-indent-backward-token))
diff --git a/haskell-tng-util.el b/haskell-tng-util.el
index 2c08e86..15068b7 100644
--- a/haskell-tng-util.el
+++ b/haskell-tng-util.el
@@ -60,14 +60,13 @@ and taking a regexp."
default-directory
(lambda (dir) (directory-files dir nil regexp))))
-(defmacro haskell-tng:until (form &optional guard)
- "Runs `while' on FORM until it is non-nil, returning the value.
-
-A guard is provided which may cause the loop to exit early with nil."
+(defmacro haskell-tng:until (test &rest body)
+ ;; https://lists.gnu.org/r/emacs-devel/2018-10/msg00250.html
+ ;; by Stefan Monnier
+ "Run BODY while TEST is non-nil, returning the final TEST."
(let ((res (gensym "res")))
`(let (,res)
- (while (and (not ,guard)
- (not (setq ,res ,form))))
+ (while (not (setq ,res ,test)) ,@body)
,res)))
(provide 'haskell-tng-util)
- [nongnu] elpa/haskell-tng-mode 8405852 351/385: document bugs and ideas, (continued)
- [nongnu] elpa/haskell-tng-mode 8405852 351/385: document bugs and ideas, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode f429326 327/385: thots, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 8bb3c34 363/385: the in-memory cache doesn't have to cache nil, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode f5977b6 339/385: bugfix for source downloading, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 9359c7b 349/385: cl-loop, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode f5d76fc 348/385: tidy docs, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3b37524 360/385: bugfix for qualified imports when the cache was bad, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode fe2b164 372/385: fix the build, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 63225d5 374/385: use .ghc.path to find hsinspect, build tool agnostic, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3d1122b 116/385: notes on regexps, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode c3793b2 176/385: canonical until macro,
ELPA Syncer <=
- [nongnu] elpa/haskell-tng-mode b7cb5b9 214/385: starting to create imenu, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 5306ae2 217/385: fix type faces with constraints, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 5f81d6b 219/385: bump python version, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 8f4d7fc 225/385: advice around smartparens workaround, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 4cbf702 205/385: move third party deps to -contrib, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3ff278e 227/385: ability to not continue comments, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode dbcef71 235/385: workaround the env file situation, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 5892c04 232/385: small things, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 44dc467 248/385: notes on motivation, contributing and collaboration, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 6f2b5ee 266/385: font lock CPP, ELPA Syncer, 2021/10/06