diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2017-01-22 00:18:40 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2017-01-22 00:25:35 -0800 |
commit | 0a49f158f1598fb92989f3cbdc238a7e5f1bd8a3 (patch) | |
tree | 34ff3896930886b9a072423fdb310d482bec283a /src/fontset.c | |
parent | ade0652cc2a7103cd910accda8165ff8ee7c719f (diff) | |
download | emacs-0a49f158f1598fb92989f3cbdc238a7e5f1bd8a3.tar.gz |
Improve uses of CHECK_LIST etc.
* src/eval.c (FletX): Report an error for invalid constructs like
‘(let* (a . 0))’, so that ‘let*’ is more consistent with ‘let’.
(lambda_arity): Use plain CHECK_CONS.
* src/fns.c (CHECK_LIST_END): Move from here to lisp.h.
(Fcopy_alist): Remove unnecessary CHECK_LIST call, since
concat does that for us.
(Fnthcdr, Fmember, Fmemql, Fdelete, Fnreverse):
Use CHECK_LIST_END, not CHECK_LIST_CONS. This hoists a
runtime check out of the loop.
(Fmemq): Simplify and use CHECK_LIST_END instead of CHECK_LIST.
(Fassq, Fassoc, Frassq, Frassoc):
Simplify and use CHECK_LIST_END instead of CAR.
(assq_no_quit, assoc_no_quit): Simplify and assume proper list.
(Fnconc): Use plain CHECK_CONS, and do-while instead of while loop.
* src/fontset.c (Fnew_fontset):
* src/frame.c (Fmodify_frame_parameters):
Use CHECK_LIST_END at end, rather than CHECK_LIST at start, for a
more-complete check.
* src/gfilenotify.c (Fgfile_add_watch):
Omit unnecessary CHECK_LIST, since Fmember does that for us.
* src/lisp.h (lisp_h_CHECK_LIST_CONS, CHECK_LIST_CONS):
Remove; no longer used.
(CHECK_LIST_END): New inline function.
Diffstat (limited to 'src/fontset.c')
-rw-r--r-- | src/fontset.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/fontset.c b/src/fontset.c index 33d1d24e5b3..850558b08a0 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -1677,11 +1677,10 @@ FONT-SPEC is a vector, a cons, or a string. See the documentation of `set-fontset-font' for the meaning. */) (Lisp_Object name, Lisp_Object fontlist) { - Lisp_Object fontset; + Lisp_Object fontset, tail; int id; CHECK_STRING (name); - CHECK_LIST (fontlist); name = Fdowncase (name); id = fs_query_fontset (name, 0); @@ -1714,11 +1713,11 @@ FONT-SPEC is a vector, a cons, or a string. See the documentation of Fset_char_table_range (fontset, Qt, Qnil); } - for (; CONSP (fontlist); fontlist = XCDR (fontlist)) + for (tail = fontlist; CONSP (tail); tail = XCDR (tail)) { Lisp_Object elt, script; - elt = XCAR (fontlist); + elt = XCAR (tail); script = Fcar (elt); elt = Fcdr (elt); if (CONSP (elt) && (NILP (XCDR (elt)) || CONSP (XCDR (elt)))) @@ -1727,6 +1726,7 @@ FONT-SPEC is a vector, a cons, or a string. See the documentation of else Fset_fontset_font (name, script, elt, Qnil, Qappend); } + CHECK_LIST_END (tail, fontlist); return name; } |