[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode dbb2b7a 350/385: block / return-from inst
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode dbb2b7a 350/385: block / return-from instead of catch / throw |
Date: |
Wed, 6 Oct 2021 00:00:02 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit dbb2b7ab4392cfea58f90c81b54feff57fea921e
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
block / return-from instead of catch / throw
---
haskell-tng-hsinspect.el | 3 +++
haskell-tng-layout.el | 18 +++++++++++-------
haskell-tng-util.el | 7 ++++---
3 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/haskell-tng-hsinspect.el b/haskell-tng-hsinspect.el
index 8227d09..d856644 100644
--- a/haskell-tng-hsinspect.el
+++ b/haskell-tng-hsinspect.el
@@ -14,6 +14,9 @@
;; TODO this file needs tests, if not testing calling hsinspect then at least
;; with pre-canned data.
+(eval-when-compile
+ (require 'cl))
+
(require 'array)
(require 'subr-x)
(require 'tar-mode)
diff --git a/haskell-tng-layout.el b/haskell-tng-layout.el
index 9107d00..fbfaa3e 100644
--- a/haskell-tng-layout.el
+++ b/haskell-tng-layout.el
@@ -27,6 +27,9 @@
;; Galaxy brain caching would use properties and put dirty markers on inserted
;; or deleted regions. Would give fast lookup at point.
+(eval-when-compile
+ (require 'cl))
+
(require 'haskell-tng-util)
;; A alist of lists of (OPEN . (CLOSE . SEPS)) positions, keyed by (START .
END)
@@ -170,7 +173,7 @@ using a cache if available."
value)))))
(defun haskell-tng--layout-next-wldo (limit)
- (catch 'wldo
+ (block wldo
(while (< (point) limit)
(forward-comment limit)
(cond
@@ -181,9 +184,10 @@ using a cache if available."
(goto-char (match-end 0))
(forward-comment limit)
(unless (looking-at "{")
- (throw 'wldo (haskell-tng--layout-wldo
- (min (or (haskell-tng--util-paren-close) (point-max))
- limit)))))
+ (return-from wldo
+ (haskell-tng--layout-wldo
+ (min (or (haskell-tng--util-paren-close) (point-max))
+ limit)))))
(t (skip-syntax-forward "^-"))))))
@@ -197,7 +201,7 @@ WLDO that is using the offside rule."
(let* ((open (point))
seps
(level (current-column))
- (close (catch 'closed
+ (close (block closed
(while (< (point) limit)
(forward-line)
(forward-comment limit)
@@ -207,9 +211,9 @@ WLDO that is using the offside rule."
(rx bol (or "," ")" "]" "}")))))
(push (point) seps))
(when (<= limit (point))
- (throw 'closed limit))
+ (return-from closed limit))
(when (< (current-column) level)
- (throw 'closed (point))))
+ (return-from closed (point))))
limit)))
`(,open . (,close . ,(reverse seps))))))
diff --git a/haskell-tng-util.el b/haskell-tng-util.el
index 02fc271..75f4b01 100644
--- a/haskell-tng-util.el
+++ b/haskell-tng-util.el
@@ -11,6 +11,8 @@
;; TODO move things to single use sites (twas premature abstraction!)
+(eval-when-compile
+ (require 'cl))
(require 'subr-x)
(require 'xdg)
@@ -30,11 +32,10 @@
(save-excursion
(goto-char (or pos (point)))
(let ((level (current-column)))
- (catch 'closed
+ (block closed
(while (and (forward-line) (not (eobp)))
(when (<= (current-indentation) level)
- (throw 'closed (point))))
- nil))))
+ (return-from closed (point))))))))
(defun haskell-tng--util-type-ender (&optional pos)
;; trivial, should just be called as an inline regexp
- [nongnu] elpa/haskell-tng-mode 1b4bf3b 294/385: improve the cabal defaults, (continued)
- [nongnu] elpa/haskell-tng-mode 1b4bf3b 294/385: improve the cabal defaults, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode b2cd1c8 297/385: projectile-tags-command should be buffer local, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 7b45c25 298/385: guard file saving, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode e245a93 296/385: allow opt-out of local history, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 411268e 310/385: improve hsinspect error messages, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 766480d 290/385: fast-tags should be project specific, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode efd8093 299/385: silent formatter errors, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 26c6828 291/385: fqn imports, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 4480bb4 319/385: bump hsinspect/ghcflags versions, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 99287ef 316/385: stack projectile defaults, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode dbb2b7a 350/385: block / return-from instead of catch / throw,
ELPA Syncer <=
- [nongnu] elpa/haskell-tng-mode d611f0b 322/385: thots, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode a717a50 331/385: allow workflow with qualified imports as default, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 70e649b 330/385: import qualified is even smarter, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 5a064fd 328/385: hypen prefix asks to qualify the import, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode c42b5c5 338/385: use url-copy-path instead of shelling out, ELPA Syncer, 2021/10/06
- [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