diff options
| author | Dmitry Antipov | 2012-08-09 09:14:23 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2012-08-09 09:14:23 +0400 |
| commit | a2752828083a77421efdcd59938eeb21657c39a3 (patch) | |
| tree | 13a3ddaf12f8794882d552d0f15aa3011a96ef58 /src | |
| parent | e0cc4efac7f170e81c9b95f1a616c1595442936e (diff) | |
| download | emacs-a2752828083a77421efdcd59938eeb21657c39a3.tar.gz emacs-a2752828083a77421efdcd59938eeb21657c39a3.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/coding.c | 4 | ||||
| -rw-r--r-- | src/termhooks.h | 4 | ||||
| -rw-r--r-- | src/terminal.c | 2 | ||||
| -rw-r--r-- | src/xselect.c | 8 |
5 files changed, 17 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 4a570a51df4..2d65dcb0860 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | Use TSET for write access to Lisp_Object slots of struct terminal. | ||
| 4 | * termhooks.h (TSET): New macro. | ||
| 5 | * coding.c, terminal.c, xselect.c: Adjust users. | ||
| 6 | |||
| 1 | 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca> | 7 | 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 8 | ||
| 3 | * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing | 9 | * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing |
diff --git a/src/coding.c b/src/coding.c index 12a7cf93c46..5bed11b8241 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -9294,9 +9294,9 @@ DEFUN ("set-terminal-coding-system-internal", Fset_terminal_coding_system_intern | |||
| 9294 | terminal_coding->src_multibyte = 1; | 9294 | terminal_coding->src_multibyte = 1; |
| 9295 | terminal_coding->dst_multibyte = 0; | 9295 | terminal_coding->dst_multibyte = 0; |
| 9296 | if (terminal_coding->common_flags & CODING_REQUIRE_ENCODING_MASK) | 9296 | if (terminal_coding->common_flags & CODING_REQUIRE_ENCODING_MASK) |
| 9297 | term->charset_list = coding_charset_list (terminal_coding); | 9297 | TSET (term, charset_list, coding_charset_list (terminal_coding)); |
| 9298 | else | 9298 | else |
| 9299 | term->charset_list = Fcons (make_number (charset_ascii), Qnil); | 9299 | TSET (term, charset_list, Fcons (make_number (charset_ascii), Qnil)); |
| 9300 | return Qnil; | 9300 | return Qnil; |
| 9301 | } | 9301 | } |
| 9302 | 9302 | ||
diff --git a/src/termhooks.h b/src/termhooks.h index 4cad4825cdd..78d8532e03f 100644 --- a/src/termhooks.h +++ b/src/termhooks.h | |||
| @@ -321,6 +321,10 @@ struct ns_display_info; | |||
| 321 | struct x_display_info; | 321 | struct x_display_info; |
| 322 | struct w32_display_info; | 322 | struct w32_display_info; |
| 323 | 323 | ||
| 324 | /* Most code should use this macro to set Lisp field in struct terminal. */ | ||
| 325 | |||
| 326 | #define TSET(f, field, value) ((f)->field = (value)) | ||
| 327 | |||
| 324 | /* Terminal-local parameters. */ | 328 | /* Terminal-local parameters. */ |
| 325 | struct terminal | 329 | struct terminal |
| 326 | { | 330 | { |
diff --git a/src/terminal.c b/src/terminal.c index 4e03c162213..53610d9736f 100644 --- a/src/terminal.c +++ b/src/terminal.c | |||
| @@ -446,7 +446,7 @@ store_terminal_param (struct terminal *t, Lisp_Object parameter, Lisp_Object val | |||
| 446 | Lisp_Object old_alist_elt = Fassq (parameter, t->param_alist); | 446 | Lisp_Object old_alist_elt = Fassq (parameter, t->param_alist); |
| 447 | if (EQ (old_alist_elt, Qnil)) | 447 | if (EQ (old_alist_elt, Qnil)) |
| 448 | { | 448 | { |
| 449 | t->param_alist = Fcons (Fcons (parameter, value), t->param_alist); | 449 | TSET (t, param_alist, Fcons (Fcons (parameter, value), t->param_alist)); |
| 450 | return Qnil; | 450 | return Qnil; |
| 451 | } | 451 | } |
| 452 | else | 452 | else |
diff --git a/src/xselect.c b/src/xselect.c index ff779b91944..664b5f92a15 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -353,8 +353,8 @@ x_own_selection (Lisp_Object selection_name, Lisp_Object selection_value, | |||
| 353 | INTEGER_TO_CONS (timestamp), frame); | 353 | INTEGER_TO_CONS (timestamp), frame); |
| 354 | prev_value = LOCAL_SELECTION (selection_name, dpyinfo); | 354 | prev_value = LOCAL_SELECTION (selection_name, dpyinfo); |
| 355 | 355 | ||
| 356 | dpyinfo->terminal->Vselection_alist | 356 | TSET (dpyinfo->terminal, Vselection_alist, |
| 357 | = Fcons (selection_data, dpyinfo->terminal->Vselection_alist); | 357 | Fcons (selection_data, dpyinfo->terminal->Vselection_alist)); |
| 358 | 358 | ||
| 359 | /* If we already owned the selection, remove the old selection | 359 | /* If we already owned the selection, remove the old selection |
| 360 | data. Don't use Fdelq as that may QUIT. */ | 360 | data. Don't use Fdelq as that may QUIT. */ |
| @@ -989,7 +989,7 @@ x_handle_selection_clear (struct input_event *event) | |||
| 989 | break; | 989 | break; |
| 990 | } | 990 | } |
| 991 | } | 991 | } |
| 992 | dpyinfo->terminal->Vselection_alist = Vselection_alist; | 992 | TSET (dpyinfo->terminal, Vselection_alist, Vselection_alist); |
| 993 | 993 | ||
| 994 | /* Run the `x-lost-selection-functions' abnormal hook. */ | 994 | /* Run the `x-lost-selection-functions' abnormal hook. */ |
| 995 | { | 995 | { |
| @@ -1039,7 +1039,7 @@ x_clear_frame_selections (FRAME_PTR f) | |||
| 1039 | args[1] = Fcar (Fcar (t->Vselection_alist)); | 1039 | args[1] = Fcar (Fcar (t->Vselection_alist)); |
| 1040 | Frun_hook_with_args (2, args); | 1040 | Frun_hook_with_args (2, args); |
| 1041 | 1041 | ||
| 1042 | t->Vselection_alist = XCDR (t->Vselection_alist); | 1042 | TSET (t, Vselection_alist, XCDR (t->Vselection_alist)); |
| 1043 | } | 1043 | } |
| 1044 | 1044 | ||
| 1045 | /* Delete elements after the beginning of Vselection_alist. */ | 1045 | /* Delete elements after the beginning of Vselection_alist. */ |