aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 403f76243a..2175f48dab 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,15 @@
+2012-08-18 Paul Eggert <[email protected]>
+
+ * 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 <[email protected]>
* keyboard.h (KSET): Remove (Bug#12215).
diff --git a/src/coding.c b/src/coding.c
index c601a18b26..290b9a5dbb 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -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;
}
diff --git a/src/termhooks.h b/src/termhooks.h
index 78d8532e03..46962a1217 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/>. */
#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
diff --git a/src/terminal.c b/src/terminal.c
index 53610d9736..d94164a4e4 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
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
diff --git a/src/xselect.c b/src/xselect.c
index 664b5f92a1..463bd6e37b 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -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. */