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

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

[nongnu] elpa/scroll-on-jump 9c333320ea 05/31: Don't catch and re-raise


From: ELPA Syncer
Subject: [nongnu] elpa/scroll-on-jump 9c333320ea 05/31: Don't catch and re-raise errors
Date: Thu, 7 Jul 2022 12:03:12 -0400 (EDT)

branch: elpa/scroll-on-jump
commit 9c333320eaa72689f7c79986a19e989a8015c4eb
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>

    Don't catch and re-raise errors
    
    this makes debugging errors difficult.
---
 scroll-on-jump.el | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/scroll-on-jump.el b/scroll-on-jump.el
index 7be5edf77e..dc8472ed0c 100644
--- a/scroll-on-jump.el
+++ b/scroll-on-jump.el
@@ -401,12 +401,17 @@ Argument ALSO-MOVE-POINT When non-nil, move the POINT as 
well."
 
     (prog1
       (save-excursion
-        (condition-case err
+        ;; Note, we could catch and re-raise errors,
+        ;; this has the advantage that we could get the resulting cursor 
location
+        ;; even in the case of an error.
+        ;; However - this makes troubleshooting problems considerably more 
difficult.
+        ;; As it wont show the full back-trace, only the error message.
+        ;; So don't prioritize correct jumping in the case of errors and 
assume errors
+        ;; are not something that happen after cursor motion.
+        (prog1
           (progn
             ,@body)
-          ;; Re-raise below, after handing cursor motion.
-          (error (setq err-value err)))
-        (setq point-next (point)))
+          (setq point-next (point))))
 
       (when (and (eq buf (current-buffer)) (eq window (selected-window)))
         (setq has-context-changed nil))



reply via email to

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