aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2012-08-17 17:07:52 -0700
committerPaul Eggert2012-08-17 17:07:52 -0700
commit3f22b86fc7d9b66ff3e332b9a56350e93ddbd0aa (patch)
treecbdad3a66ebab38dba4f41ec3ad861252618b4fd /src
parent15dbb4d6ba5dea7d3e0f45ab3fd038c2b305a145 (diff)
downloademacs-3f22b86fc7d9b66ff3e332b9a56350e93ddbd0aa.tar.gz
emacs-3f22b86fc7d9b66ff3e332b9a56350e93ddbd0aa.zip
* termhooks.h (TSET): Remove.
Replace all uses with calls to new setter functions. Use INLINE_HEADER_BEGIN, INLINE_HEADER_END. (TERMHOOKS_INLINE): New macro. (tset_charset_list, tset_selection_alist): New setter functions. * terminal.c (TERMHOOKS_INLINE): Define to EXTERN_INLINE, so that the corresponding functions are compiled into code. (tset_param_alist): New setter function. Fixes: debbugs:12215
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog12
-rw-r--r--src/coding.c8
-rw-r--r--src/termhooks.h23
-rw-r--r--src/terminal.c12
-rw-r--r--src/xselect.c9
5 files changed, 51 insertions, 13 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 403f76243a0..2175f48dabf 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,15 @@
12012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2
3 * termhooks.h (TSET): Remove (Bug#12215).
4 Replace all uses with calls to new setter functions.
5 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6 (TERMHOOKS_INLINE): New macro.
7 (tset_charset_list, tset_selection_alist): New setter functions.
8 * terminal.c (TERMHOOKS_INLINE):
9 Define to EXTERN_INLINE, so that the corresponding functions
10 are compiled into code.
11 (tset_param_alist): New setter function.
12
12012-08-17 Paul Eggert <eggert@cs.ucla.edu> 132012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2 14
3 * keyboard.h (KSET): Remove (Bug#12215). 15 * keyboard.h (KSET): Remove (Bug#12215).
diff --git a/src/coding.c b/src/coding.c
index c601a18b26e..290b9a5dbb6 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -9302,10 +9302,10 @@ DEFUN ("set-terminal-coding-system-internal", Fset_terminal_coding_system_intern
9302 terminal_coding->common_flags &= ~CODING_ANNOTATE_COMPOSITION_MASK; 9302 terminal_coding->common_flags &= ~CODING_ANNOTATE_COMPOSITION_MASK;
9303 terminal_coding->src_multibyte = 1; 9303 terminal_coding->src_multibyte = 1;
9304 terminal_coding->dst_multibyte = 0; 9304 terminal_coding->dst_multibyte = 0;
9305 if (terminal_coding->common_flags & CODING_REQUIRE_ENCODING_MASK) 9305 tset_charset_list
9306 TSET (term, charset_list, coding_charset_list (terminal_coding)); 9306 (term, (terminal_coding->common_flags & CODING_REQUIRE_ENCODING_MASK
9307 else 9307 ? coding_charset_list (terminal_coding)
9308 TSET (term, charset_list, Fcons (make_number (charset_ascii), Qnil)); 9308 : Fcons (make_number (charset_ascii), Qnil)));
9309 return Qnil; 9309 return Qnil;
9310} 9310}
9311 9311
diff --git a/src/termhooks.h b/src/termhooks.h
index 78d8532e03f..46962a1217d 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -22,6 +22,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
22 22
23#include "systime.h" /* for Time */ 23#include "systime.h" /* for Time */
24 24
25INLINE_HEADER_BEGIN
26#ifndef TERMHOOKS_INLINE
27# define TERMHOOKS_INLINE INLINE
28#endif
29
25struct glyph; 30struct glyph;
26struct frame; 31struct frame;
27 32
@@ -321,10 +326,6 @@ struct ns_display_info;
321struct x_display_info; 326struct x_display_info;
322struct w32_display_info; 327struct w32_display_info;
323 328
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
328/* Terminal-local parameters. */ 329/* Terminal-local parameters. */
329struct terminal 330struct terminal
330{ 331{
@@ -631,6 +632,18 @@ struct terminal
631 void (*delete_terminal_hook) (struct terminal *); 632 void (*delete_terminal_hook) (struct terminal *);
632}; 633};
633 634
635/* Most code should use these functions to set Lisp fields in struct
636 terminal. */
637TERMHOOKS_INLINE void
638tset_charset_list (struct terminal *t, Lisp_Object val)
639{
640 t->charset_list = val;
641}
642TERMHOOKS_INLINE void
643tset_selection_alist (struct terminal *t, Lisp_Object val)
644{
645 t->Vselection_alist = val;
646}
634 647
635/* Chain of all terminal devices currently in use. */ 648/* Chain of all terminal devices currently in use. */
636extern struct terminal *terminal_list; 649extern struct terminal *terminal_list;
@@ -669,3 +682,5 @@ extern unsigned char *encode_terminal_code (struct glyph *, int,
669#ifdef HAVE_GPM 682#ifdef HAVE_GPM
670extern void close_gpm (int gpm_fd); 683extern void close_gpm (int gpm_fd);
671#endif 684#endif
685
686INLINE_HEADER_END
diff --git a/src/terminal.c b/src/terminal.c
index 53610d9736f..d94164a4e40 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -17,6 +17,9 @@ You should have received a copy of the GNU General Public License
17along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ 17along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
18 18
19#include <config.h> 19#include <config.h>
20
21#define TERMHOOKS_INLINE EXTERN_INLINE
22
20#include <stdio.h> 23#include <stdio.h>
21#include <setjmp.h> 24#include <setjmp.h>
22 25
@@ -39,6 +42,13 @@ struct terminal *initial_terminal;
39 42
40static void delete_initial_terminal (struct terminal *); 43static void delete_initial_terminal (struct terminal *);
41 44
45/* This setter is used only in this file, so it can be private. */
46static inline void
47tset_param_alist (struct terminal *t, Lisp_Object val)
48{
49 t->param_alist = val;
50}
51
42 52
43 53
44void 54void
@@ -446,7 +456,7 @@ store_terminal_param (struct terminal *t, Lisp_Object parameter, Lisp_Object val
446 Lisp_Object old_alist_elt = Fassq (parameter, t->param_alist); 456 Lisp_Object old_alist_elt = Fassq (parameter, t->param_alist);
447 if (EQ (old_alist_elt, Qnil)) 457 if (EQ (old_alist_elt, Qnil))
448 { 458 {
449 TSET (t, param_alist, Fcons (Fcons (parameter, value), t->param_alist)); 459 tset_param_alist (t, Fcons (Fcons (parameter, value), t->param_alist));
450 return Qnil; 460 return Qnil;
451 } 461 }
452 else 462 else
diff --git a/src/xselect.c b/src/xselect.c
index 664b5f92a15..463bd6e37b0 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -353,8 +353,9 @@ 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 TSET (dpyinfo->terminal, Vselection_alist, 356 tset_selection_alist
357 Fcons (selection_data, dpyinfo->terminal->Vselection_alist)); 357 (dpyinfo->terminal,
358 Fcons (selection_data, dpyinfo->terminal->Vselection_alist));
358 359
359 /* If we already owned the selection, remove the old selection 360 /* If we already owned the selection, remove the old selection
360 data. Don't use Fdelq as that may QUIT. */ 361 data. Don't use Fdelq as that may QUIT. */
@@ -989,7 +990,7 @@ x_handle_selection_clear (struct input_event *event)
989 break; 990 break;
990 } 991 }
991 } 992 }
992 TSET (dpyinfo->terminal, Vselection_alist, Vselection_alist); 993 tset_selection_alist (dpyinfo->terminal, Vselection_alist);
993 994
994 /* Run the `x-lost-selection-functions' abnormal hook. */ 995 /* Run the `x-lost-selection-functions' abnormal hook. */
995 { 996 {
@@ -1039,7 +1040,7 @@ x_clear_frame_selections (FRAME_PTR f)
1039 args[1] = Fcar (Fcar (t->Vselection_alist)); 1040 args[1] = Fcar (Fcar (t->Vselection_alist));
1040 Frun_hook_with_args (2, args); 1041 Frun_hook_with_args (2, args);
1041 1042
1042 TSET (t, Vselection_alist, XCDR (t->Vselection_alist)); 1043 tset_selection_alist (t, XCDR (t->Vselection_alist));
1043 } 1044 }
1044 1045
1045 /* Delete elements after the beginning of Vselection_alist. */ 1046 /* Delete elements after the beginning of Vselection_alist. */