Commit 3f22b86f authored by Paul Eggert's avatar Paul Eggert

* 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
parent 15dbb4d6
2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
* termhooks.h (TSET): Remove (Bug#12215).
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.
2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
* keyboard.h (KSET): Remove (Bug#12215).
......
......@@ -9302,10 +9302,10 @@ DEFUN ("set-terminal-coding-system-internal", Fset_terminal_coding_system_intern
terminal_coding->common_flags &= ~CODING_ANNOTATE_COMPOSITION_MASK;
terminal_coding->src_multibyte = 1;
terminal_coding->dst_multibyte = 0;
if (terminal_coding->common_flags & CODING_REQUIRE_ENCODING_MASK)
TSET (term, charset_list, coding_charset_list (terminal_coding));
else
TSET (term, charset_list, Fcons (make_number (charset_ascii), Qnil));
tset_charset_list
(term, (terminal_coding->common_flags & CODING_REQUIRE_ENCODING_MASK
? coding_charset_list (terminal_coding)
: Fcons (make_number (charset_ascii), Qnil)));
return Qnil;
}
......
......@@ -22,6 +22,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "systime.h" /* for Time */
INLINE_HEADER_BEGIN
#ifndef TERMHOOKS_INLINE
# define TERMHOOKS_INLINE INLINE
#endif
struct glyph;
struct frame;
......@@ -321,10 +326,6 @@ struct ns_display_info;
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
{
......@@ -631,6 +632,18 @@ struct terminal
void (*delete_terminal_hook) (struct terminal *);
};
/* Most code should use these functions to set Lisp fields in struct
terminal. */
TERMHOOKS_INLINE void
tset_charset_list (struct terminal *t, Lisp_Object val)
{
t->charset_list = val;
}
TERMHOOKS_INLINE void
tset_selection_alist (struct terminal *t, Lisp_Object val)
{
t->Vselection_alist = val;
}
/* Chain of all terminal devices currently in use. */
extern struct terminal *terminal_list;
......@@ -669,3 +682,5 @@ extern unsigned char *encode_terminal_code (struct glyph *, int,
#ifdef HAVE_GPM
extern void close_gpm (int gpm_fd);
#endif
INLINE_HEADER_END
......@@ -17,6 +17,9 @@ You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#define TERMHOOKS_INLINE EXTERN_INLINE
#include <stdio.h>
#include <setjmp.h>
......@@ -39,6 +42,13 @@ struct terminal *initial_terminal;
static void delete_initial_terminal (struct terminal *);
/* This setter is used only in this file, so it can be private. */
static inline void
tset_param_alist (struct terminal *t, Lisp_Object val)
{
t->param_alist = val;
}
void
......@@ -446,7 +456,7 @@ store_terminal_param (struct terminal *t, Lisp_Object parameter, Lisp_Object val
Lisp_Object old_alist_elt = Fassq (parameter, t->param_alist);
if (EQ (old_alist_elt, Qnil))
{
TSET (t, param_alist, Fcons (Fcons (parameter, value), t->param_alist));
tset_param_alist (t, Fcons (Fcons (parameter, value), t->param_alist));
return Qnil;
}
else
......
......@@ -353,8 +353,9 @@ x_own_selection (Lisp_Object selection_name, Lisp_Object selection_value,
INTEGER_TO_CONS (timestamp), frame);
prev_value = LOCAL_SELECTION (selection_name, dpyinfo);
TSET (dpyinfo->terminal, Vselection_alist,
Fcons (selection_data, dpyinfo->terminal->Vselection_alist));
tset_selection_alist
(dpyinfo->terminal,
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. */
......@@ -989,7 +990,7 @@ x_handle_selection_clear (struct input_event *event)
break;
}
}
TSET (dpyinfo->terminal, Vselection_alist, Vselection_alist);
tset_selection_alist (dpyinfo->terminal, Vselection_alist);
/* Run the `x-lost-selection-functions' abnormal hook. */
{
......@@ -1039,7 +1040,7 @@ x_clear_frame_selections (FRAME_PTR f)
args[1] = Fcar (Fcar (t->Vselection_alist));
Frun_hook_with_args (2, args);
TSET (t, Vselection_alist, XCDR (t->Vselection_alist));
tset_selection_alist (t, XCDR (t->Vselection_alist));
}
/* Delete elements after the beginning of Vselection_alist. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment