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

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

[nongnu] elpa/racket-mode 5a8fbb6eab 2/2: Signal scan-error for forward-


From: ELPA Syncer
Subject: [nongnu] elpa/racket-mode 5a8fbb6eab 2/2: Signal scan-error for forward-sexp-function failures; fixed #726
Date: Tue, 12 Nov 2024 16:01:03 -0500 (EST)

branch: elpa/racket-mode
commit 5a8fbb6eab46cc8b371fc2d589fb3503f820795d
Author: Greg Hendershott <git@greghendershott.com>
Commit: Greg Hendershott <git@greghendershott.com>

    Signal scan-error for forward-sexp-function failures; fixed #726
---
 racket-hash-lang.el | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/racket-hash-lang.el b/racket-hash-lang.el
index 1efcc18fe5..8758a538a5 100644
--- a/racket-hash-lang.el
+++ b/racket-hash-lang.el
@@ -630,7 +630,7 @@ We never use `racket-indent-line' from traditional
 
 ;; Motion
 
-(defun racket-hash-lang-move (direction &optional count)
+(defun racket-hash-lang-move (direction count &optional scan-error-p)
   (let ((count (or count 1)))
     (pcase (racket--cmd/await       ; await = :(
             nil
@@ -643,9 +643,16 @@ We never use `racket-indent-line' from traditional
                         ,count))
       ((and (pred numberp) pos)
        (goto-char pos))
-      (_ (user-error "Cannot move %s%s" direction (if (memq count '(-1 0 1))
-                                                      ""
-                                                    (format " %s times" 
count)))))))
+      (_
+       (if scan-error-p
+           (signal 'scan-error
+                   (list (format "Cannot move %s" direction)
+                         (point) (point)))
+         (user-error "Cannot move %s%s"
+                     direction
+                     (if (memq count '(-1 0 1))
+                         ""
+                       (format " %s times" count))))))))
 
 (defun racket-hash-lang-backward (&optional count)
   "Like `backward-sexp' but uses #lang supplied navigation."
@@ -679,7 +686,7 @@ However other users don't need that, so we supply this
   (let* ((arg (or arg 1))
          (dir (if (< arg 0) 'backward 'forward))
          (cnt (abs arg)))
-    (racket-hash-lang-move dir cnt)))
+    (racket-hash-lang-move dir cnt t)))
 
 ;;; Pairs
 



reply via email to

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