From 58a70b943c3efcc25e1396c8e67bc440c43a3f0a Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 4 Dec 2011 18:47:53 -0800 Subject: [PATCH] align.el marker fix. * lisp/align.el (align--set-marker): Add doc-string. Don't try to move something that is not a marker. Eg the first call from align-region passes eol == 0. Fixes: debbugs:10216 --- lisp/ChangeLog | 5 +++++ lisp/align.el | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e1fa6c6ec31..413a2947a58 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-12-05 Glenn Morris + + * align.el (align--set-marker): Add doc-string. + Don't try to move something that is not a marker. (Bug#10216) + 2011-12-04 Glenn Morris * calendar/appt.el (appt-add): Rewrite the interactive-spec to avoid diff --git a/lisp/align.el b/lisp/align.el index 0d9f351b9da..a386b7a82ba 100644 --- a/lisp/align.el +++ b/lisp/align.el @@ -1247,7 +1247,9 @@ have been aligned. No changes will be made to the buffer." (setq areas (cdr areas)))))) (defmacro align--set-marker (marker-var pos &optional type) - `(if ,marker-var + "If MARKER-VAR is a marker, move it to position POS. +Otherwise, create a new marker at position POS, with type TYPE." + `(if (markerp ,marker-var) (move-marker ,marker-var ,pos) (setq ,marker-var (copy-marker ,pos ,type)))) -- 2.39.2