]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix a bug in callback functions in align-areas
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 18 Sep 2019 14:01:56 +0000 (16:01 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 19 Sep 2019 12:36:55 +0000 (14:36 +0200)
* lisp/align.el (align-areas): When given a callback function and
JUSTIFY, pick out the correct parameters (bug#30139).  Suggested
by "John Wiegley" <johnw@gnu.org>.

lisp/align.el

index 443237b451bf9c15c8448ff3bd2df74ef56f37a6..cd72d52df47964cfd80895de3b6d7f307ed8ca46 100644 (file)
@@ -1216,9 +1216,12 @@ have been aligned.  No changes will be made to the buffer."
          (when area
            (if func
                (funcall func
-                        (marker-position (car area))
-                        (marker-position (cdr area))
-                        change)
+                         (marker-position (car area))
+                         (marker-position (if (and justify
+                                                   (consp (cdr area)))
+                                              (cadr area)
+                                            (cdr area)))
+                         change)
              (if (not (and justify
                            (consp (cdr area))))
                  (goto-char (cdr area))