APPROVE COMMIT
NOTE: This patch has been committed
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1530725731 -3600
# Wed Jul 04 18:35:31 2018 +0100
# Node ID 518dac37640275f3d01a24e41d1ac1880e47be9c
# Parent 73b61c5225a6c7026ea8a8a40372a97160f53202
No need to have #'nth, #'identity in C either, move them to subr.el
src/ChangeLog addition:
2018-07-04 Aidan Kehoe <kehoea(a)parhasard.net>
* eval.c (Fdefmacro):
Fnth() no longer available, use its implementation.
* fns.c (Fnth, Fidentity): Move to subr.el.
* fns.c (syms_of_fns): Remove their DEFSUBR()s from here.
* lisp.h: Remove Fnth()'s declaration from here.
* select.c (get_selection_raw_time):
Fnth not available, use its implementation.
lisp/ChangeLog addition:
2018-07-04 Aidan Kehoe <kehoea(a)parhasard.net>
* loadup.el (source-lisp):
* make-docfile.el (source-lisp):
* update-elc.el (source-lisp):
#'nth no longer available on a bare-metal XEmacs, use its
implementation.
* subr.el:
* subr.el (identity): New.
* subr.el (nth): New.
Move these functions here from fns.c.
diff -r 73b61c5225a6 -r 518dac376402 lisp/ChangeLog
--- a/lisp/ChangeLog Wed Jul 04 18:29:08 2018 +0100
+++ b/lisp/ChangeLog Wed Jul 04 18:35:31 2018 +0100
@@ -1,3 +1,15 @@
+2018-07-04 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * loadup.el (source-lisp):
+ * make-docfile.el (source-lisp):
+ * update-elc.el (source-lisp):
+ #'nth no longer available on a bare-metal XEmacs, use its
+ implementation.
+ * subr.el:
+ * subr.el (identity): New.
+ * subr.el (nth): New.
+ Move these functions here from fns.c.
+
2018-07-01 Aidan Kehoe <kehoea(a)parhasard.net>
* bytecomp.el (byte-compile-normal-call):
diff -r 73b61c5225a6 -r 518dac376402 lisp/loadup.el
--- a/lisp/loadup.el Wed Jul 04 18:29:08 2018 +0100
+++ b/lisp/loadup.el Wed Jul 04 18:35:31 2018 +0100
@@ -62,7 +62,7 @@
;; Can't make this constant for now because it causes an error in
;; update-elc.el.
-(defvar source-lisp (file-name-directory (expand-file-name (nth 2 command-line-args)))
"\
+(defvar source-lisp (file-name-directory (expand-file-name (car (nthcdr 2
command-line-args)))) "\
Root of tree containing the Lisp source code for the current build.
Differs from `lisp-directory' if this XEmacs has been installed. ")
diff -r 73b61c5225a6 -r 518dac376402 lisp/make-docfile.el
--- a/lisp/make-docfile.el Wed Jul 04 18:29:08 2018 +0100
+++ b/lisp/make-docfile.el Wed Jul 04 18:35:31 2018 +0100
@@ -46,7 +46,7 @@
(defvar build-directory (expand-file-name ".." invocation-directory))
(defvar build-lib-src (expand-file-name "lib-src" build-directory))
(defvar source-lisp (file-name-directory (expand-file-name
- (nth 2 command-line-args))))
+ (car (nthcdr 2 command-line-args)))))
(defvar source-src (expand-file-name "../src" source-lisp))
(defun message (fmt &rest args)
diff -r 73b61c5225a6 -r 518dac376402 lisp/subr.el
--- a/lisp/subr.el Wed Jul 04 18:29:08 2018 +0100
+++ b/lisp/subr.el Wed Jul 04 18:35:31 2018 +0100
@@ -371,6 +371,16 @@
(setq hare (cdr hare)
length (1+ length)))
length))
+
+;; Some more, this time from fns.c
+(defun identity (arg)
+ "Return the argument unchanged."
+ arg)
+
+(defun nth (n list)
+ "Return the Nth element of LIST.
+N counts from zero. If LIST is not that long, nil is returned."
+ (car (nthcdr n list)))
;;;; Keymap support.
;; XEmacs: removed to keymap.el
diff -r 73b61c5225a6 -r 518dac376402 lisp/update-elc.el
--- a/lisp/update-elc.el Wed Jul 04 18:29:08 2018 +0100
+++ b/lisp/update-elc.el Wed Jul 04 18:35:31 2018 +0100
@@ -80,7 +80,7 @@
(defvar build-directory (expand-file-name ".." invocation-directory))
(defvar source-lisp (file-name-directory (expand-file-name
- (nth 2 command-line-args))))
+ (car (nthcdr 2 command-line-args)))))
(defvar source-lisp-mule (expand-file-name "mule" source-lisp))
(defvar source-directory (expand-file-name ".." source-lisp))
diff -r 73b61c5225a6 -r 518dac376402 src/ChangeLog
--- a/src/ChangeLog Wed Jul 04 18:29:08 2018 +0100
+++ b/src/ChangeLog Wed Jul 04 18:35:31 2018 +0100
@@ -1,3 +1,13 @@
+2018-07-04 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * eval.c (Fdefmacro):
+ Fnth() no longer available, use its implementation.
+ * fns.c (Fnth, Fidentity): Move to subr.el.
+ * fns.c (syms_of_fns): Remove their DEFSUBR()s from here.
+ * lisp.h: Remove Fnth()'s declaration from here.
+ * select.c (get_selection_raw_time):
+ Fnth not available, use its implementation.
+
2018-07-04 Aidan Kehoe <kehoea(a)parhasard.net>
* symbols.c (Fspecial_operator_p):
diff -r 73b61c5225a6 -r 518dac376402 src/eval.c
--- a/src/eval.c Wed Jul 04 18:29:08 2018 +0100
+++ b/src/eval.c Wed Jul 04 18:35:31 2018 +0100
@@ -1424,7 +1424,7 @@
/* This function can GC */
if (!NILP (Vmacro_declaration_function))
{
- Lisp_Object declare = Fnth (make_fixnum (2), args);
+ Lisp_Object declare = Fcar (Fnthcdr (make_fixnum (2), args));
/* Sigh. This GNU interface is incompatible with the CL declare macro,
and the latter is much older.
@@ -1440,7 +1440,7 @@
if (STRINGP (declare))
{
- declare = Fnth (make_fixnum (3), args);
+ declare = Fcar (Fnthcdr (make_fixnum (3), args));
}
if (CONSP (declare) && EQ (Qdeclare, XCAR (declare)))
diff -r 73b61c5225a6 -r 518dac376402 src/fns.c
--- a/src/fns.c Wed Jul 04 18:29:08 2018 +0100
+++ b/src/fns.c Wed Jul 04 18:35:31 2018 +0100
@@ -60,14 +60,6 @@
Lisp_Object Vpath_separator;
-DEFUN ("identity", Fidentity, 1, 1, 0, /*
-Return the argument unchanged.
-*/
- (arg))
-{
- return arg;
-}
-
DEFUN ("random", Frandom, 0, 1, 0, /*
Return a pseudo-random number.
All fixnums are equally likely. On most systems, this is 31 bits' worth.
@@ -629,16 +621,6 @@
return tail;
}
-DEFUN ("nth", Fnth, 2, 2, 0, /*
-Return the Nth element of LIST.
-N counts from zero. If LIST is not that long, nil is returned.
-*/
- (n, list))
-{
- /* This function can GC */
- return Fcar (Fnthcdr (n, list));
-}
-
DEFUN ("last", Flast, 1, 2, 0, /*
Return the tail of list LIST, of length N (default 1).
LIST may be a dotted list, but not a circular list.
@@ -2971,7 +2953,6 @@
DEFERROR_STANDARD (Qbase64_conversion_error, Qconversion_error);
- DEFSUBR (Fidentity);
DEFSUBR (Frandom);
DEFSUBR (Flist_length);
DEFSUBR (Fstring_equal);
@@ -2981,7 +2962,6 @@
DEFSUBR (Fcopy_sequence);
DEFSUBR (Fcopy_alist);
DEFSUBR (Fnthcdr);
- DEFSUBR (Fnth);
DEFSUBR (Flast);
DEFSUBR (Fbutlast);
DEFSUBR (Fnbutlast);
diff -r 73b61c5225a6 -r 518dac376402 src/lisp.h
--- a/src/lisp.h Wed Jul 04 18:29:08 2018 +0100
+++ b/src/lisp.h Wed Jul 04 18:35:31 2018 +0100
@@ -5455,7 +5455,6 @@
EXFUN (Fnconc, MANY);
MODULE_API EXFUN (Fnreverse, 1);
EXFUN (Fnthcdr, 2);
-EXFUN (Fnth, 2);
EXFUN (Fold_assq, 2);
EXFUN (Fold_equal, 2);
EXFUN (Fold_member, 2);
diff -r 73b61c5225a6 -r 518dac376402 src/select.c
--- a/src/select.c Wed Jul 04 18:29:08 2018 +0100
+++ b/src/select.c Wed Jul 04 18:35:31 2018 +0100
@@ -463,7 +463,7 @@
{
Lisp_Object local_value = assq_no_quit (selection, Vselection_alist);
- return Fnth (make_fixnum (2), local_value);
+ return Fcar (Fnthcdr (make_fixnum (2), local_value));
}
/* Get the timestamp of the given selection */
--
‘As I sat looking up at the Guinness ad, I could never figure out /
How your man stayed up on the surfboard after forty pints of stout’
(C. Moore)