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

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

[elpa] externals/objed 35feabb 085/166: Add function to get align sectio


From: Clemens Radermacher
Subject: [elpa] externals/objed 35feabb 085/166: Add function to get align section bounds
Date: Sun, 29 Dec 2019 08:21:05 -0500 (EST)

branch: externals/objed
commit 35feabbe725d9795a35669260127fca5990dfe2b
Author: Clemens Radermacher <address@hidden>
Commit: Clemens Radermacher <address@hidden>

    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
 
 



reply via email to

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