diff options
| -rw-r--r-- | lisp/subr.el | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index e2c1baea442..bfdc0ff4a13 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -440,16 +440,16 @@ one is kept." | |||
| 440 | First and last elements are considered consecutive if CIRCULAR is | 440 | First and last elements are considered consecutive if CIRCULAR is |
| 441 | non-nil." | 441 | non-nil." |
| 442 | (let ((tail list) last) | 442 | (let ((tail list) last) |
| 443 | (while (consp tail) | 443 | (while (cdr tail) |
| 444 | (if (equal (car tail) (cadr tail)) | 444 | (if (equal (car tail) (cadr tail)) |
| 445 | (setcdr tail (cddr tail)) | 445 | (setcdr tail (cddr tail)) |
| 446 | (setq last (car tail) | 446 | (setq last tail |
| 447 | tail (cdr tail)))) | 447 | tail (cdr tail)))) |
| 448 | (if (and circular | 448 | (if (and circular |
| 449 | (cdr list) | 449 | last |
| 450 | (equal last (car list))) | 450 | (equal (car tail) (car list))) |
| 451 | (nbutlast list) | 451 | (setcdr last nil))) |
| 452 | list))) | 452 | list) |
| 453 | 453 | ||
| 454 | (defun number-sequence (from &optional to inc) | 454 | (defun number-sequence (from &optional to inc) |
| 455 | "Return a sequence of numbers from FROM to TO (both inclusive) as a list. | 455 | "Return a sequence of numbers from FROM to TO (both inclusive) as a list. |