+2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * coccinelle/list_loop.cocci: Semantic patch to convert from Fcdr
+ to XCDR and consistently use CONSP in the list iteration loops.
+ * coccinelle/vector_contents.cocci: Fix indentation.
+
2012-07-10 Stefan Monnier <monnier@iro.umontreal.ca>
* bzrmerge.el: Use cl-lib.
--- /dev/null
+// Omit redundant type check, consistently use CONSP.
+@@
+identifier A;
+expression X;
+statement S;
+@@
+(
+for (A = X;
+- !NILP (A);
++ CONSP (A);
+- A = Fcdr (A))
++ A = XCDR (A))
+S
+|
+for (A = X; CONSP (A);
+- A = Fcdr (A))
++ A = XCDR (A))
+S
+)
- XVECTOR (I1)->contents[E1] = E2
+ ASET (I1, E1, E2)
|
--XVECTOR (I1)->contents[E1]
-+AREF (I1, E1)
+- XVECTOR (I1)->contents[E1]
++ AREF (I1, E1)
)
+2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Use XCAR and XCDR instead of Fcar and Fcdr where possible.
+ * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
+ * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
+ * w32menu.c, window.c, xmenu.c: Changed to use XCAR and XCDR
+ where argument type is known to be a Lisp_Cons.
+
2012-07-10 Tom Tromey <tromey@redhat.com>
* bytecode.c (BYTE_CODE_THREADED): New macro.
if (CONSP (elt))
{
Lisp_Object presflag, carelt;
- carelt = Fcar (elt);
+ carelt = XCAR (elt);
/* If it is (if X Y), look at Y. */
if (EQ (carelt, Qif)
&& EQ (Fnthcdr (make_number (3), elt), Qnil))
val = args[coding_arg_ccl_valids];
valids = Fmake_string (make_number (256), make_number (0));
- for (tail = val; !NILP (tail); tail = Fcdr (tail))
+ for (tail = val; CONSP (tail); tail = XCDR (tail))
{
int from, to;
CHECK_NUMBER_CDR (reg_usage);
request = Fcopy_sequence (args[coding_arg_iso2022_request]);
- for (tail = request; ! NILP (tail); tail = Fcdr (tail))
+ for (tail = request; CONSP (tail); tail = XCDR (tail))
{
int id;
Lisp_Object tmp1;
}
else if (CONSP (fun))
{
- funcar = Fcar (fun);
+ funcar = XCAR (fun);
if (!SYMBOLP (funcar))
xsignal1 (Qinvalid_function, fun);
else if (EQ (funcar, Qkeymap))
tm.tm_isdst = -1;
if (CONSP (zone))
- zone = Fcar (zone);
+ zone = XCAR (zone);
if (NILP (zone))
{
BLOCK_INPUT;
error ("Lisp nesting exceeds `max-lisp-eval-depth'");
}
- original_fun = Fcar (form);
- original_args = Fcdr (form);
+ original_fun = XCAR (form);
+ original_args = XCDR (form);
backtrace.next = backtrace_list;
backtrace_list = &backtrace;
CHECK_CONS (otf_features);
CHECK_SYMBOL (XCAR (otf_features));
otf_features = XCDR (otf_features);
- for (val = Fcar (otf_features); ! NILP (val); val = Fcdr (val))
+ for (val = Fcar (otf_features); CONSP (val); val = XCDR (val))
{
CHECK_SYMBOL (Fcar (val));
if (SBYTES (SYMBOL_NAME (XCAR (val))) > 4)
SDATA (SYMBOL_NAME (XCAR (val))));
}
otf_features = XCDR (otf_features);
- for (val = Fcar (otf_features); ! NILP (val); val = Fcdr (val))
+ for (val = Fcar (otf_features); CONSP (val); val = XCDR (val))
{
CHECK_SYMBOL (Fcar (val));
if (SBYTES (SYMBOL_NAME (XCAR (val))) > 4)
Fset_char_table_range (fontset, Qt, Qnil);
}
- for (; ! NILP (fontlist); fontlist = Fcdr (fontlist))
+ for (; CONSP (fontlist); fontlist = XCDR (fontlist))
{
Lisp_Object elt, script;
struct gcpro gcpro1, gcpro2;
i = 0;
- for (tail = alist; CONSP (tail); tail = Fcdr (tail))
+ for (tail = alist; CONSP (tail); tail = XCDR (tail))
i++;
parms = alloca (i * sizeof *parms);
int file_format = GNUTLS_X509_FMT_PEM;
Lisp_Object tail;
- for (tail = trustfiles; !NILP (tail); tail = Fcdr (tail))
+ for (tail = trustfiles; CONSP (tail); tail = XCDR (tail))
{
Lisp_Object trustfile = Fcar (tail);
if (STRINGP (trustfile))
}
}
- for (tail = crlfiles; !NILP (tail); tail = Fcdr (tail))
+ for (tail = crlfiles; CONSP (tail); tail = XCDR (tail))
{
Lisp_Object crlfile = Fcar (tail);
if (STRINGP (crlfile))
}
}
- for (tail = keylist; !NILP (tail); tail = Fcdr (tail))
+ for (tail = keylist; CONSP (tail); tail = XCDR (tail))
{
Lisp_Object keyfile = Fcar (Fcar (tail));
Lisp_Object certfile = Fcar (Fcdr (tail));
if (CONSP (initial))
{
Lisp_Object backup_n = Fcdr (initial);
- initial = Fcar (initial);
+ initial = XCAR (initial);
CHECK_STRING (initial);
if (!NILP (backup_n))
{
/* Extract parm names and values into those vectors. */
i = 0;
- for (tail = alist; CONSP (tail); tail = Fcdr (tail))
+ for (tail = alist; CONSP (tail); tail = XCDR (tail))
{
Lisp_Object elt;
/* Go through each element of LIST. */
for (tail1 = list; CONSP (tail1); tail1 = XCDR (tail1))
{
- sym = Fcar (tail1);
+ sym = XCAR (tail1);
/* Go through i's plist, looking for tail1 */
for (tail2 = i->plist; CONSP (tail2); tail2 = XCDR (XCDR (tail2)))
elt = XCAR (tail);
if (!CONSP (elt)) continue;
- tem = Fcar (elt);
+ tem = XCAR (elt);
if (lstrcmpi (SDATA (tem), colorname) == 0)
{
}
else if (CONSP (position))
{
- Lisp_Object tem;
- tem = Fcar (position);
+ Lisp_Object tem = XCAR (position);
if (CONSP (tem))
window = Fcar (Fcdr (position));
else
else
{
if (CONSP (arg))
- arg = Fcar (arg);
+ arg = XCAR (arg);
CHECK_NUMBER (arg);
window_scroll (window, XINT (arg), 0, 1);
}
}
else if (CONSP (position))
{
- Lisp_Object tem;
- tem = Fcar (position);
+ Lisp_Object tem = XCAR (position);
if (CONSP (tem))
window = Fcar (Fcdr (position));
else