* termhooks.h (TSET): New macro.
* coding.c, terminal.c, xselect.c: Adjust users.
+2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Use TSET for write access to Lisp_Object slots of struct terminal.
+ * termhooks.h (TSET): New macro.
+ * coding.c, terminal.c, xselect.c: Adjust users.
+
2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
* xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
terminal_coding->src_multibyte = 1;
terminal_coding->dst_multibyte = 0;
if (terminal_coding->common_flags & CODING_REQUIRE_ENCODING_MASK)
- term->charset_list = coding_charset_list (terminal_coding);
+ TSET (term, charset_list, coding_charset_list (terminal_coding));
else
- term->charset_list = Fcons (make_number (charset_ascii), Qnil);
+ TSET (term, charset_list, Fcons (make_number (charset_ascii), Qnil));
return Qnil;
}
struct x_display_info;
struct w32_display_info;
+/* Most code should use this macro to set Lisp field in struct terminal. */
+
+#define TSET(f, field, value) ((f)->field = (value))
+
/* Terminal-local parameters. */
struct terminal
{
Lisp_Object old_alist_elt = Fassq (parameter, t->param_alist);
if (EQ (old_alist_elt, Qnil))
{
- t->param_alist = Fcons (Fcons (parameter, value), t->param_alist);
+ TSET (t, param_alist, Fcons (Fcons (parameter, value), t->param_alist));
return Qnil;
}
else
INTEGER_TO_CONS (timestamp), frame);
prev_value = LOCAL_SELECTION (selection_name, dpyinfo);
- dpyinfo->terminal->Vselection_alist
- = Fcons (selection_data, dpyinfo->terminal->Vselection_alist);
+ TSET (dpyinfo->terminal, Vselection_alist,
+ Fcons (selection_data, dpyinfo->terminal->Vselection_alist));
/* If we already owned the selection, remove the old selection
data. Don't use Fdelq as that may QUIT. */
break;
}
}
- dpyinfo->terminal->Vselection_alist = Vselection_alist;
+ TSET (dpyinfo->terminal, Vselection_alist, Vselection_alist);
/* Run the `x-lost-selection-functions' abnormal hook. */
{
args[1] = Fcar (Fcar (t->Vselection_alist));
Frun_hook_with_args (2, args);
- t->Vselection_alist = XCDR (t->Vselection_alist);
+ TSET (t, Vselection_alist, XCDR (t->Vselection_alist));
}
/* Delete elements after the beginning of Vselection_alist. */