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

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

[elpa] externals/valign 44c747b 136/198: * valign.el (valign-table): Cle


From: Stefan Monnier
Subject: [elpa] externals/valign 44c747b 136/198: * valign.el (valign-table): Clean up table if error occurs.
Date: Tue, 1 Dec 2020 18:19:34 -0500 (EST)

branch: externals/valign
commit 44c747b0ee75283996379b06bb8b2cbe3aa24f04
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>

    * valign.el (valign-table): Clean up table if error occurs.
---
 valign.el | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/valign.el b/valign.el
index 3ee2bed..534cf14 100644
--- a/valign.el
+++ b/valign.el
@@ -475,7 +475,7 @@ You need to restart valign mode for this setting to take 
effect."
 (defun valign-table ()
   "Visually align the table at point."
   (interactive)
-  (condition-case nil
+  (condition-case err
       (save-excursion
         (if (not window-system)
             (signal 'valign-not-gui nil))
@@ -483,8 +483,12 @@ You need to restart valign mode for this setting to take 
effect."
             (signal 'valign-not-on-table nil))
         (valign-table-1))
     (valign-early-termination nil)
-    ((valign-bad-cell valign-not-gui valign-not-on-table) nil)
-    (search-failed nil)))
+    ((valign-bad-cell search-failed error)
+     (valign--clean-text-property
+      (save-excursion (valign--beginning-of-table) (point))
+      (save-excursion (valign--end-of-table) (point)))
+     (when (eq (car err) 'error)
+       (error (error-message-string err))))))
 
 (defun valign-table-1 ()
   "Visually align the table at point."



reply via email to

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