aboutsummaryrefslogtreecommitdiffhomepage
path: root/generic
diff options
context:
space:
mode:
authorGravatar Erik Martin-Dorel <erik.martin-dorel@ens-lyon.org>2016-07-04 16:40:57 +0200
committerGravatar Erik Martin-Dorel <erik.martin-dorel@ens-lyon.org>2016-07-04 16:47:20 +0200
commita8b55a360609413f9372cb48735d1537d865cb7f (patch)
treefe62b997989effe0c5bbd73d4f37905bae4ed692 /generic
parentc022079c7ec0559852de9877b98ffda4b70bd8b2 (diff)
Fix (next-undo-elt) to return a relevant undo element w.r.t (undo-delta).
Diffstat (limited to 'generic')
-rw-r--r--generic/pg-user.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/generic/pg-user.el b/generic/pg-user.el
index f0358239..513b477b 100644
--- a/generic/pg-user.el
+++ b/generic/pg-user.el
@@ -1273,7 +1273,11 @@ assuming the undo-in-region behavior will apply if ARG is non-nil."
buffer-undo-list))) ; can be nil
(if (or (null undo-list) (equal undo-list (list nil)))
nil ; there is clearly no undo elt
- (while (eq (car undo-list) nil)
+ (while (and undo-list ; to ensure it will terminate
+ (let ((elt (car undo-list)))
+ (not (and (consp elt)
+ (or (stringp (car elt))
+ (integerp (car elt)))))))
(setq undo-list (cdr undo-list))) ; get the last undo record
(if (and (eq last-command 'undo)
(or (eq pending-undo-list t)