aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLeo Liu2014-05-21 11:49:58 +0800
committerLeo Liu2014-05-21 11:49:58 +0800
commit254b7645f30f67abd00b773f2b0eac63d4c382dd (patch)
tree30b7feb81da5fb54bceb4a06f6f020fd22bb70f1 /src
parente619d93c227597bccc8b3d76ee8518fb20098bb1 (diff)
downloademacs-254b7645f30f67abd00b773f2b0eac63d4c382dd.tar.gz
emacs-254b7645f30f67abd00b773f2b0eac63d4c382dd.zip
* doc/lispref/sequences.texi (Sequence Functions): Update nreverse.
* src/fns.c (Fnreverse): Accept strings for SEQ and update doc-string.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog4
-rw-r--r--src/fns.c11
2 files changed, 9 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 0ca3deaec9c..d6e21a777c2 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
12014-05-21 Leo Liu <sdl.web@gmail.com>
2
3 * fns.c (Fnreverse): Accept strings for SEQ and update doc-string.
4
12014-05-20 Michael Albinus <michael.albinus@gmx.de> 52014-05-20 Michael Albinus <michael.albinus@gmx.de>
2 6
3 * dbusbind.c (xd_signature): Revert last 2 patches. 7 * dbusbind.c (xd_signature): Revert last 2 patches.
diff --git a/src/fns.c b/src/fns.c
index 1694f1c798d..5074ae3b41b 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -1697,16 +1697,15 @@ changing the value of a sequence `foo'. */)
1697} 1697}
1698 1698
1699DEFUN ("nreverse", Fnreverse, Snreverse, 1, 1, 0, 1699DEFUN ("nreverse", Fnreverse, Snreverse, 1, 1, 0,
1700 doc: /* Reverse order of items in a list or vector SEQ. 1700 doc: /* Reverse order of items in a list, vector or string SEQ.
1701If SEQ is a list, it should be nil-terminated, and reversed 1701If SEQ is a list, it should be nil-terminated.
1702by modifying cdr pointers. Return the reversed SEQ. 1702This function may destructively modify SEQ to produce the value. */)
1703
1704Note that unlike `reverse', this function doesn't work with strings.
1705It is strongly encouraged to treat them as immutable. */)
1706 (Lisp_Object seq) 1703 (Lisp_Object seq)
1707{ 1704{
1708 if (NILP (seq)) 1705 if (NILP (seq))
1709 return seq; 1706 return seq;
1707 else if (STRINGP (seq))
1708 return Freverse (seq);
1710 else if (CONSP (seq)) 1709 else if (CONSP (seq))
1711 { 1710 {
1712 Lisp_Object prev, tail, next; 1711 Lisp_Object prev, tail, next;