From b82f34f996c25deda1b89fc7006833335bb1a6fa Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 18 Sep 2019 16:01:56 +0200 Subject: [PATCH] Fix a bug in callback functions in align-areas * lisp/align.el (align-areas): When given a callback function and JUSTIFY, pick out the correct parameters (bug#30139). Suggested by "John Wiegley" . --- lisp/align.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lisp/align.el b/lisp/align.el index 443237b451b..cd72d52df47 100644 --- a/lisp/align.el +++ b/lisp/align.el @@ -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)) -- 2.39.5