branch: externals/objed
commit 35feabbe725d9795a35669260127fca5990dfe2b
Author: Clemens Radermacher <[email protected]>
Commit: Clemens Radermacher <[email protected]>
Add function to get align section bounds
---
objed-objects.el | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/objed-objects.el b/objed-objects.el
index b40316b..683e52c 100644
--- a/objed-objects.el
+++ b/objed-objects.el
@@ -1555,6 +1555,20 @@ comments."
begin)))
+(defun objed--get-align-section ()
+ "Get region bounds of current align section."
+ (require 'align)
+ (let ((olddef (symbol-function 'align-region)))
+ (cl-letf (((symbol-function 'align-region)
+ (lambda (beg end &rest args)
+ (if (and beg end)
+ (throw 'region (cons beg end))
+ (apply olddef beg end
+ args)))))
+ (catch 'region
+ (align nil nil)))))
+
+
;; * Object definitions