branch: externals/valign
commit 5e70d9be8f5fd42609899dbadad45d6752eca489
Author: Yuan Fu <[email protected]>
Commit: Yuan Fu <[email protected]>
Fix beginning- and end-of-table functions
* valign.el (valign--beginning-of-table, valign--end-of-table): Don't
move point if not at a table.
---
valign.el | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/valign.el b/valign.el
index ffbe887..1d9f9bc 100644
--- a/valign.el
+++ b/valign.el
@@ -501,7 +501,8 @@ Assumes point is on a table."
;; This implementation allows non-table lines before a table, e.g.,
;; #+latex: xxx
;; |------+----|
- (beginning-of-line)
+ (when (valign--at-table-p)
+ (beginning-of-line))
(while (and (< (point-min) (point))
(valign--at-table-p))
(forward-line -1))
@@ -512,7 +513,8 @@ Assumes point is on a table."
"Go forward to the end of the table at point.
Assumes point is on a table."
(let ((start (point)))
- (beginning-of-line)
+ (when (valign--at-table-p)
+ (beginning-of-line))
(while (and (< (point) (point-max))
(valign--at-table-p))
(forward-line 1))