diff options
| author | Pierre Courtieu | 2016-07-20 11:18:47 +0200 |
|---|---|---|
| committer | GitHub | 2016-07-20 11:18:47 +0200 |
| commit | c302c243bbb31c22c239ebc6574db61b5b16145a (patch) | |
| tree | c2f19c77b1c7dbcffdf258de463fcbe538418e19 | |
| parent | 1881be14416e3eb719cce90c6ac5d1f17ff53cd8 (diff) | |
| parent | a8b55a360609413f9372cb48735d1537d865cb7f (diff) | |
Merge pull request #87 from erikmd/patch-1
Fix (next-undo-elt) to return a relevant undo element w.r.t (undo-delta)
| -rw-r--r-- | generic/pg-user.el | 6 |
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) |
