summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2007-10-12 21:06:27 +0000
committerMiles Bader <miles@gnu.org>2007-10-12 21:06:27 +0000
commit985773c9038f9847f9e7362f3b5fb0c8acac13a2 (patch)
tree12d10cb76729ccbdc5ace4688d15f83894a70cc9 /src
parent47632e43ca42e26da139289f1e0f4f69e8c140fd (diff)
downloademacs-985773c9038f9847f9e7362f3b5fb0c8acac13a2.tar.gz
Fix up multi-tty merge
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-261 Creator: Stefan Monnier <monnier@iro.umontreal.ca>
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog.105
-rw-r--r--src/ChangeLog.unicode49
-rw-r--r--src/Makefile.in11
-rw-r--r--src/alloc.c50
-rw-r--r--src/chartab.c5
-rw-r--r--src/coding.c22
-rw-r--r--src/coding.h3
-rw-r--r--src/doc.c4
-rw-r--r--src/emacs.c15
-rw-r--r--src/fontset.c2
-rw-r--r--src/lread.c4
-rw-r--r--src/term.c1
-rw-r--r--src/terminal.c4
-rw-r--r--src/xdisp.c144
-rw-r--r--src/xfaces.c4
-rw-r--r--src/xterm.c40
16 files changed, 189 insertions, 174 deletions
diff --git a/src/ChangeLog.10 b/src/ChangeLog.10
index f0e0f191b9a..c5e7bc61e47 100644
--- a/src/ChangeLog.10
+++ b/src/ChangeLog.10
@@ -12403,6 +12403,11 @@
* regex.c (re_error_msgid): Add an entry for REG_ERANGEX.
(regex_compile): Return REG_ERANGEX if appropriate.
+2004-10-22 Kenichi Handa <handa@m17n.org>
+
+ * editfns.c (Ftranslate_region_internal): New function.
+ (syms_of_editfns): Defsubr it.
+
2004-10-22 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
* xfns.c (xic_create_xfontset): Initialize missing_list to NULL.
diff --git a/src/ChangeLog.unicode b/src/ChangeLog.unicode
index b3f20c24a55..345890b36db 100644
--- a/src/ChangeLog.unicode
+++ b/src/ChangeLog.unicode
@@ -1,3 +1,52 @@
+2007-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Fix up multy-tty merge.
+
+ * xterm.c (handle_one_xevent): Remove duplicate code and fix up nesting
+ and indentation.
+
+ * xfaces.c (free_realized_face, clear_face_gcs):
+ Include font_done_for_face in the input_blocked section, just in case.
+
+ * xdisp.c (decode_mode_spec): Use terminal-local coding systems.
+ (get_char_face_and_encoding): Undo last change and remove the *other*
+ duplicate definition (i.e. keep the one that's better scoped and that
+ includes code for the font-backend).
+
+ * terminal.c (create_terminal): Default keyboard_coding to
+ `no-conversion' and terminal_coding to `undecided'.
+
+ * lread.c (read1): Use XSETPVECTYPE to set a pseudovector's tag.
+
+ * fontset.c (free_realized_fontsets): Check that the table entry does
+ contain a fontset before trying to compare it to `base'.
+
+ * emacs.c (main): Move syms_of_data, syms_of_fileio, syms_of_alloc,
+ syms_of_charset, and syms_of_coding earlier because init_window_once
+ now needs Vcoding_system_hash_table to be setup.
+
+ * coding.h (default_buffer_file_coding): Remove.
+
+ * coding.c (default_buffer_file_coding): Remove.
+ (Fterminal_coding_system, Fkeyboard_coding_system): Use ->id rather
+ than ->symbol, and use the terminal-local coding system.
+ (syms_of_coding): Don't setup the coding-systems that are not
+ terminal-local.
+ (Fdefine_coding_system_internal): Use XCAR/XCDR.
+
+ * chartab.c (Fmake_char_table, make_sub_char_table, copy_char_table):
+ Use XSETPVECTYPE now that XSETCHAR_TABLE doesn't set the tag anymore.
+
+ * alloc.c (Fmake_char_table, make_sub_char_table): Remove. They're now
+ in chartab.c and were re-added here by mistake.
+ (Fpurecopy): Use XSETPVECTYPE after copying a COMPILED pseudovector.
+
+ * doc.c (Fsnarf_documentation):
+ * Makefile.in (temacs${EXEEXT}, mostlyclean): Move buildobj.lst from
+ src to etc.
+
+ * ChangeLog.10: Add mistakenly removed entry.
+
2007-10-12 Dan Nicolaescu <dann@ics.uci.edu>
* Makefile.in (fringe.o, minibuf.o): Fix dependencies.
diff --git a/src/Makefile.in b/src/Makefile.in
index c73f402f228..6fce595a9ec 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1007,7 +1007,7 @@ ${lispsource}international/charprop.el: temacs${EXEEXT} ${UNIDATA}
#endif
temacs${EXEEXT}: MAKE_PARALLEL $(LOCALCPP) $(STARTFILES) stamp-oldxmenu ${obj} ${otherobj} OBJECTS_MACHINE prefix-args${EXEEXT}
- echo "${obj} ${otherobj} " OBJECTS_MACHINE > buildobj.lst
+ echo "${obj} ${otherobj} " OBJECTS_MACHINE > ${etc}buildobj.lst
$(LD) YMF_PASS_LDFLAGS (${STARTFLAGS} ${TEMACS_LDFLAGS}) $(LDFLAGS) \
-o temacs ${STARTFILES} ${obj} ${otherobj} \
OBJECTS_MACHINE ${LIBES}
@@ -1133,7 +1133,7 @@ ecrt0.o: ecrt0.c $(config_h)
CRT0_COMPILE ${srcdir}/ecrt0.c
dired.o: dired.c commands.h buffer.h $(config_h) character.h charset.h \
coding.h regex.h systime.h blockinput.h atimer.h
-dispnew.o: dispnew.c systty.h systime.h commands.h process.h frame.h \
+dispnew.o: dispnew.c systime.h commands.h process.h frame.h \
window.h buffer.h dispextern.h termchar.h termopts.h termhooks.h cm.h \
disptab.h indent.h intervals.h \
xterm.h blockinput.h atimer.h character.h msdos.h composite.h keyboard.h \
@@ -1288,11 +1288,10 @@ fns.o: fns.c commands.h $(config_h) frame.h buffer.h character.h keyboard.h \
keymap.h frame.h window.h dispextern.h $(INTERVAL_SRC) coding.h md5.h \
blockinput.h atimer.h systime.h xterm.h termhooks.h
print.o: print.c process.h frame.h window.h buffer.h keyboard.h character.h \
- $(config_h) dispextern.h termchar.h $(INTERVAL_SRC) msdos.h composite.h \
+ $(config_h) dispextern.h termchar.h $(INTERVAL_SRC) msdos.h composite.h \
blockinput.h atimer.h systime.h
lread.o: lread.c commands.h keyboard.h buffer.h epaths.h character.h \
- charset.h $(config_h) $(INTERVAL_SRC) termhooks.h coding.h msdos.h \
- blockinput.h atimer.h systime.h
+ charset.h $(config_h) $(INTERVAL_SRC) termhooks.h coding.h msdos.h
/* Text properties support */
textprop.o: textprop.c buffer.h window.h dispextern.h $(INTERVAL_SRC) \
@@ -1357,7 +1356,7 @@ mostlyclean:
rm -f temacs${EXEEXT} prefix-args${EXEEXT} core *.core \#* *.o libXMenu11.a liblw.a
rm -f ../etc/DOC
rm -f bootstrap-emacs${EXEEXT} emacs-${version}${EXEEXT}
- rm -f buildobj.lst
+ rm -f ${etc}buildobj.lst
clean: mostlyclean
rm -f emacs-*${EXEEXT} emacs${EXEEXT}
/**/# This is used in making a distribution.
diff --git a/src/alloc.c b/src/alloc.c
index fccdf2a88a7..ed003af3ea8 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -3070,51 +3070,6 @@ See also the function `vector'. */)
}
-DEFUN ("make-char-table", Fmake_char_table, Smake_char_table, 1, 2, 0,
- doc: /* Return a newly created char-table, with purpose PURPOSE.
-Each element is initialized to INIT, which defaults to nil.
-PURPOSE should be a symbol which has a `char-table-extra-slots' property.
-The property's value should be an integer between 0 and 10. */)
- (purpose, init)
- register Lisp_Object purpose, init;
-{
- Lisp_Object vector;
- Lisp_Object n;
- CHECK_SYMBOL (purpose);
- n = Fget (purpose, Qchar_table_extra_slots);
- CHECK_NUMBER (n);
- if (XINT (n) < 0 || XINT (n) > 10)
- args_out_of_range (n, Qnil);
- /* Add 2 to the size for the defalt and parent slots. */
- vector = Fmake_vector (make_number (CHAR_TABLE_STANDARD_SLOTS + XINT (n)),
- init);
- XSETPVECTYPE (XVECTOR (vector), PVEC_CHAR_TABLE);
- XCHAR_TABLE (vector)->top = Qt;
- XCHAR_TABLE (vector)->parent = Qnil;
- XCHAR_TABLE (vector)->purpose = purpose;
- XSETCHAR_TABLE (vector, XCHAR_TABLE (vector));
- return vector;
-}
-
-
-/* Return a newly created sub char table with slots initialized by INIT.
- Since a sub char table does not appear as a top level Emacs Lisp
- object, we don't need a Lisp interface to make it. */
-
-Lisp_Object
-make_sub_char_table (init)
- Lisp_Object init;
-{
- Lisp_Object vector
- = Fmake_vector (make_number (SUB_CHAR_TABLE_STANDARD_SLOTS), init);
- XSETPVECTYPE (XVECTOR (vector), PVEC_CHAR_TABLE);
- XCHAR_TABLE (vector)->top = Qnil;
- XCHAR_TABLE (vector)->defalt = Qnil;
- XSETCHAR_TABLE (vector, XCHAR_TABLE (vector));
- return vector;
-}
-
-
DEFUN ("vector", Fvector, Svector, 0, MANY, 0,
doc: /* Return a newly created vector with specified arguments as elements.
Any number of arguments, even zero arguments, are allowed.
@@ -4964,7 +4919,10 @@ Does not copy symbols. Copies strings without text properties. */)
for (i = 0; i < size; i++)
vec->contents[i] = Fpurecopy (XVECTOR (obj)->contents[i]);
if (COMPILEDP (obj))
- XSETCOMPILED (obj, vec);
+ {
+ XSETPVECTYPE (vec, PVEC_COMPILED);
+ XSETCOMPILED (obj, vec);
+ }
else
XSETVECTOR (obj, vec);
return obj;
diff --git a/src/chartab.c b/src/chartab.c
index 021b163618d..5306e22cefc 100644
--- a/src/chartab.c
+++ b/src/chartab.c
@@ -7,7 +7,7 @@ This file is part of GNU Emacs.
GNU Emacs is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Emacs is distributed in the hope that it will be useful,
@@ -85,6 +85,7 @@ the char-table has no extra slot. */)
size = VECSIZE (struct Lisp_Char_Table) - 1 + n_extras;
vector = Fmake_vector (make_number (size), init);
+ XSETPVECTYPE (XVECTOR (vector), PVEC_CHAR_TABLE);
XCHAR_TABLE (vector)->parent = Qnil;
XCHAR_TABLE (vector)->purpose = purpose;
XSETCHAR_TABLE (vector, XCHAR_TABLE (vector));
@@ -100,6 +101,7 @@ make_sub_char_table (depth, min_char, defalt)
int size = VECSIZE (struct Lisp_Sub_Char_Table) - 1 + chartab_size[depth];
table = Fmake_vector (make_number (size), defalt);
+ XSETPVECTYPE (XVECTOR (table), PVEC_SUB_CHAR_TABLE);
XSUB_CHAR_TABLE (table)->depth = make_number (depth);
XSUB_CHAR_TABLE (table)->min_char = make_number (min_char);
XSETSUB_CHAR_TABLE (table, XSUB_CHAR_TABLE (table));
@@ -156,6 +158,7 @@ copy_char_table (table)
int i;
copy = Fmake_vector (make_number (size), Qnil);
+ XSETPVECTYPE (XVECTOR (copy), PVEC_CHAR_TABLE);
XCHAR_TABLE (copy)->defalt = XCHAR_TABLE (table)->defalt;
XCHAR_TABLE (copy)->parent = XCHAR_TABLE (table)->parent;
XCHAR_TABLE (copy)->purpose = XCHAR_TABLE (table)->purpose;
diff --git a/src/coding.c b/src/coding.c
index 8ab5a1107aa..2b518b903a4 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -387,9 +387,6 @@ int inherit_process_coding_system;
terminal coding system is nil. */
struct coding_system safe_terminal_coding;
-/* Default coding system to be used to write a file. */
-struct coding_system default_buffer_file_coding;
-
Lisp_Object Vfile_coding_system_alist;
Lisp_Object Vprocess_coding_system_alist;
Lisp_Object Vnetwork_coding_system_alist;
@@ -8329,9 +8326,10 @@ frame's terminal device. */)
(terminal)
Lisp_Object terminal;
{
- Lisp_Object coding_system;
+ struct coding_system *terminal_coding
+ = TERMINAL_TERMINAL_CODING (get_terminal (terminal, 1));
+ Lisp_Object coding_system = CODING_ID_NAME (terminal_coding->id);
- coding_system = TERMINAL_TERMINAL_CODING (get_terminal (terminal, 1))->symbol;
/* For backward compatibility, return nil if it is `undecided'. */
return (! EQ (coding_system, Qundecided) ? coding_system : Qnil);
}
@@ -8354,11 +8352,13 @@ DEFUN ("set-keyboard-coding-system-internal", Fset_keyboard_coding_system_intern
}
DEFUN ("keyboard-coding-system",
- Fkeyboard_coding_system, Skeyboard_coding_system, 0, 0, 0,
+ Fkeyboard_coding_system, Skeyboard_coding_system, 0, 1, 0,
doc: /* Return coding system specified for decoding keyboard input. */)
- ()
+ (terminal)
+ Lisp_Object terminal;
{
- return CODING_ID_NAME (keyboard_coding.id);
+ return CODING_ID_NAME (TERMINAL_KEYBOARD_CODING
+ (get_terminal (terminal, 1))->id);
}
@@ -8643,11 +8643,11 @@ usage: (define-coding-system-internal ...) */)
else
{
charset_list = Fcopy_sequence (charset_list);
- for (tail = charset_list; !NILP (tail); tail = Fcdr (tail))
+ for (tail = charset_list; CONSP (tail); tail = XCDR (tail))
{
struct charset *charset;
- val = Fcar (tail);
+ val = XCAR (tail);
CHECK_CHARSET_GET_CHARSET (val, charset);
if (EQ (coding_type, Qiso_2022)
? CHARSET_ISO_FINAL (charset) < 0
@@ -9827,8 +9827,6 @@ character.");
Fdefine_coding_system_internal (coding_arg_max, args);
}
- setup_coding_system (Qno_conversion, &keyboard_coding);
- setup_coding_system (Qundecided, &terminal_coding);
setup_coding_system (Qno_conversion, &safe_terminal_coding);
{
diff --git a/src/coding.h b/src/coding.h
index 573632abb9b..ef464caeadc 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -746,9 +746,6 @@ extern int inherit_process_coding_system;
terminal coding system is nil. */
extern struct coding_system safe_terminal_coding;
-/* Default coding system to be used to write a file. */
-extern struct coding_system default_buffer_file_coding;
-
/* Default coding systems used for process I/O. */
extern Lisp_Object Vdefault_process_coding_system;
diff --git a/src/doc.c b/src/doc.c
index 70b78da5966..3b335127a75 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -617,8 +617,10 @@ the same file name is found in the `doc-directory'. */)
int nr_read;
char *cp = NULL;
char *beg, *end;
+ Lisp_Object buildobj = Fexpand_file_name (build_string ("buildobj.lst"),
+ Vdoc_directory);
- fd = emacs_open ("buildobj.lst", O_RDONLY, 0);
+ fd = emacs_open (SDATA (buildobj), O_RDONLY, 0);
if (fd < 0)
report_file_error ("Opening file buildobj.lst", Qnil);
diff --git a/src/emacs.c b/src/emacs.c
index dfe950631b1..94357bb69ce 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1324,7 +1324,6 @@ main (argc, argv
syms_of_macterm ();
syms_of_macmenu ();
syms_of_macselect ();
- syms_of_data ();
syms_of_search ();
syms_of_frame ();
@@ -1332,6 +1331,16 @@ main (argc, argv
mac_term_init (build_string ("Mac"), NULL, NULL);
init_keyboard ();
#endif
+ /* Called before syms_of_fileio, because it sets up Qerror_condition. */
+ syms_of_data ();
+ syms_of_fileio ();
+ /* Before syms_of_coding to initialize Vgc_cons_threshold. */
+ syms_of_alloc ();
+ /* Before syms_of_coding because it initializes Qcharsetp. */
+ syms_of_charset ();
+ /* Before init_window_once, because it sets up the
+ Vcoding_system_hash_table. */
+ syms_of_coding (); /* This should be after syms_of_fileio. */
init_window_once (); /* Init the window system. */
init_fileio_once (); /* Must precede any path manipulation. */
@@ -1553,7 +1562,6 @@ main (argc, argv
/* Called before init_window_once for Mac OS Classic. */
syms_of_data ();
#endif
- syms_of_alloc ();
syms_of_chartab ();
syms_of_lread ();
syms_of_print ();
@@ -1574,7 +1582,6 @@ main (argc, argv
syms_of_ccl ();
#endif
syms_of_character ();
- syms_of_charset ();
syms_of_cmds ();
#ifndef NO_DIR_LIBRARY
syms_of_dired ();
@@ -1583,8 +1590,6 @@ main (argc, argv
syms_of_doc ();
syms_of_editfns ();
syms_of_emacs ();
- syms_of_fileio ();
- syms_of_coding (); /* This should be after syms_of_fileio. */
#ifdef CLASH_DETECTION
syms_of_filelock ();
#endif /* CLASH_DETECTION */
diff --git a/src/fontset.c b/src/fontset.c
index 9b9fc79b918..a9cf53c4913 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -1442,7 +1442,7 @@ free_realized_fontsets (base)
{
Lisp_Object this = AREF (Vfontset_table, id);
- if (EQ (FONTSET_BASE (this), base))
+ if (CHAR_TABLE_P (this) && EQ (FONTSET_BASE (this), base))
{
Fclear_face_cache (Qt);
break;
diff --git a/src/lread.c b/src/lread.c
index bccdf28b059..3975c0bfcd0 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -2324,7 +2324,7 @@ read1 (readcharfun, pch, first_in_list)
tmp = read_vector (readcharfun, 0);
if (XVECTOR (tmp)->size < CHAR_TABLE_STANDARD_SLOTS)
error ("Invalid size char-table");
- XSETCHAR_TABLE (tmp, XCHAR_TABLE (tmp));
+ XSETPVECTYPE (XVECTOR (tmp), PVEC_CHAR_TABLE);
return tmp;
}
else if (c == '^')
@@ -2344,7 +2344,7 @@ read1 (readcharfun, pch, first_in_list)
size = XVECTOR (tmp)->size - 2;
if (chartab_size [depth] != size)
error ("Invalid size char-table");
- XSETSUB_CHAR_TABLE (tmp, XSUB_CHAR_TABLE (tmp));
+ XSETPVECTYPE (XVECTOR (tmp), PVEC_SUB_CHAR_TABLE);
return tmp;
}
invalid_syntax ("#^^", 3);
diff --git a/src/term.c b/src/term.c
index b84cea0ee36..fca99bc6c75 100644
--- a/src/term.c
+++ b/src/term.c
@@ -41,7 +41,6 @@ Boston, MA 02110-1301, USA. */
#include "lisp.h"
#include "termchar.h"
#include "termopts.h"
-#include "lisp.h"
#include "buffer.h"
#include "character.h"
#include "charset.h"
diff --git a/src/terminal.c b/src/terminal.c
index 46ffb3c2dc8..8b1836b3681 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -242,8 +242,8 @@ create_terminal (void)
terminal->terminal_coding =
(struct coding_system *) xmalloc (sizeof (struct coding_system));
- setup_coding_system (Qnil, terminal->keyboard_coding);
- setup_coding_system (Qnil, terminal->terminal_coding);
+ setup_coding_system (Qno_conversion, terminal->keyboard_coding);
+ setup_coding_system (Qundecided, terminal->terminal_coding);
terminal->param_alist = Qnil;
return terminal;
diff --git a/src/xdisp.c b/src/xdisp.c
index 4a093495f37..746fa2540f9 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -18210,9 +18210,11 @@ decode_mode_spec (w, c, field_width, precision, multibyte)
{
/* No need to mention EOL here--the terminal never needs
to do EOL conversion. */
- p = decode_mode_spec_coding (CODING_ID_NAME (keyboard_coding.id),
+ p = decode_mode_spec_coding (CODING_ID_NAME
+ (FRAME_KEYBOARD_CODING (f)->id),
p, 0);
- p = decode_mode_spec_coding (CODING_ID_NAME (terminal_coding.id),
+ p = decode_mode_spec_coding (CODING_ID_NAME
+ (FRAME_TERMINAL_CODING (f)->id),
p, 0);
}
p = decode_mode_spec_coding (b->buffer_file_coding_system,
@@ -19037,6 +19039,80 @@ append_glyph_string (head, tail, s)
}
+/* Get face and two-byte form of character C in face FACE_ID on frame
+ F. The encoding of C is returned in *CHAR2B. MULTIBYTE_P non-zero
+ means we want to display multibyte text. DISPLAY_P non-zero means
+ make sure that X resources for the face returned are allocated.
+ Value is a pointer to a realized face that is ready for display if
+ DISPLAY_P is non-zero. */
+
+static INLINE struct face *
+get_char_face_and_encoding (f, c, face_id, char2b, multibyte_p, display_p)
+ struct frame *f;
+ int c, face_id;
+ XChar2b *char2b;
+ int multibyte_p, display_p;
+{
+ struct face *face = FACE_FROM_ID (f, face_id);
+
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ {
+ struct font *font = (struct font *) face->font_info;
+
+ if (font)
+ {
+ unsigned code = font->driver->encode_char (font, c);
+
+ if (code != FONT_INVALID_CODE)
+ STORE_XCHAR2B (char2b, (code >> 8), (code & 0xFF));
+ else
+ STORE_XCHAR2B (char2b, 0, 0);
+ }
+ }
+ else
+#endif /* USE_FONT_BACKEND */
+ if (!multibyte_p)
+ {
+ /* Unibyte case. We don't have to encode, but we have to make
+ sure to use a face suitable for unibyte. */
+ STORE_XCHAR2B (char2b, 0, c);
+ face_id = FACE_FOR_CHAR (f, face, c, -1, Qnil);
+ face = FACE_FROM_ID (f, face_id);
+ }
+ else if (c < 128)
+ {
+ /* Case of ASCII in a face known to fit ASCII. */
+ STORE_XCHAR2B (char2b, 0, c);
+ }
+ else if (face->font != NULL)
+ {
+ struct font_info *font_info
+ = FONT_INFO_FROM_ID (f, face->font_info_id);
+ struct charset *charset = CHARSET_FROM_ID (font_info->charset);
+ unsigned code = ENCODE_CHAR (charset, c);
+
+ if (CHARSET_DIMENSION (charset) == 1)
+ STORE_XCHAR2B (char2b, 0, code);
+ else
+ STORE_XCHAR2B (char2b, (code >> 8), (code & 0xFF));
+ /* Maybe encode the character in *CHAR2B. */
+ FRAME_RIF (f)->encode_char (c, char2b, font_info, charset, NULL);
+ }
+
+ /* Make sure X resources of the face are allocated. */
+#ifdef HAVE_X_WINDOWS
+ if (display_p)
+#endif
+ {
+ xassert (face != NULL);
+ PREPARE_FACE_FOR_DISPLAY (f, face);
+ }
+
+ return face;
+}
+
+
/* Get face and two-byte form of character glyph GLYPH on frame F.
The encoding of GLYPH->u.ch is returned in *CHAR2B. Value is
a pointer to a realized face that is ready for display. */
@@ -19541,70 +19617,6 @@ right_overwriting (s)
}
-/* Get face and two-byte form of character C in face FACE_ID on frame
- F. The encoding of C is returned in *CHAR2B. MULTIBYTE_P non-zero
- means we want to display multibyte text. DISPLAY_P non-zero means
- make sure that X resources for the face returned are allocated.
- Value is a pointer to a realized face that is ready for display if
- DISPLAY_P is non-zero. */
-
-static INLINE struct face *
-get_char_face_and_encoding (f, c, face_id, char2b, multibyte_p, display_p)
- struct frame *f;
- int c, face_id;
- XChar2b *char2b;
- int multibyte_p, display_p;
-{
- struct face *face = FACE_FROM_ID (f, face_id);
-
- if (!multibyte_p)
- {
- /* Unibyte case. We don't have to encode, but we have to make
- sure to use a face suitable for unibyte. */
- STORE_XCHAR2B (char2b, 0, c);
- face_id = FACE_FOR_CHAR (f, face, c, -1, Qnil);
- face = FACE_FROM_ID (f, face_id);
- }
- else if (c < 128)
- {
- /* Case of ASCII in a face known to fit ASCII. */
- STORE_XCHAR2B (char2b, 0, c);
- }
- else
- {
- int c1, c2, charset;
-
- /* Split characters into bytes. If c2 is -1 afterwards, C is
- really a one-byte character so that byte1 is zero. */
- SPLIT_CHAR (c, charset, c1, c2);
- if (c2 > 0)
- STORE_XCHAR2B (char2b, c1, c2);
- else
- STORE_XCHAR2B (char2b, 0, c1);
-
- /* Maybe encode the character in *CHAR2B. */
- if (face->font != NULL)
- {
- struct font_info *font_info
- = FONT_INFO_FROM_ID (f, face->font_info_id);
- if (font_info)
- FRAME_RIF (f)->encode_char (c, char2b, font_info, 0);
- }
- }
-
- /* Make sure X resources of the face are allocated. */
-#ifdef HAVE_X_WINDOWS
- if (display_p)
-#endif
- {
- xassert (face != NULL);
- PREPARE_FACE_FOR_DISPLAY (f, face);
- }
-
- return face;
-}
-
-
/* Set background width of glyph string S. START is the index of the
first glyph following S. LAST_X is the right-most x-position + 1
in the drawing area. */
diff --git a/src/xfaces.c b/src/xfaces.c
index 298e9e52d55..d3e7a105b60 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -5572,11 +5572,11 @@ free_realized_face (f, face)
free_face_fontset (f, face);
if (face->gc)
{
+ BLOCK_INPUT;
#ifdef USE_FONT_BACKEND
if (enable_font_backend && face->font_info)
font_done_for_face (f, face);
#endif /* USE_FONT_BACKEND */
- BLOCK_INPUT;
x_free_gc (f, face->gc);
face->gc = 0;
UNBLOCK_INPUT;
@@ -5747,11 +5747,11 @@ clear_face_gcs (c)
struct face *face = c->faces_by_id[i];
if (face && face->gc)
{
+ BLOCK_INPUT;
#ifdef USE_FONT_BACKEND
if (enable_font_backend && face->font_info)
font_done_for_face (c->f, face);
#endif /* USE_FONT_BACKEND */
- BLOCK_INPUT;
x_free_gc (c->f, face->gc);
face->gc = 0;
UNBLOCK_INPUT;
diff --git a/src/xterm.c b/src/xterm.c
index 363d2183ee5..a1beab492ee 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -6777,32 +6777,20 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
copy_bufptr = coding.destination;
}
- require = decoding_buffer_size (&coding, nbytes);
- p = (unsigned char *) alloca (require);
- coding.mode |= CODING_MODE_LAST_BLOCK;
- /* We explicitly disable composition handling because
- key data should not contain any composition sequence. */
- coding.composing = COMPOSITION_DISABLED;
- decode_coding (&coding, copy_bufptr, p, nbytes, require);
- nbytes = coding.produced;
- nchars = coding.produced_char;
- copy_bufptr = p;
-
- /* Convert the input data to a sequence of
- character events. */
- for (i = 0; i < nbytes; i += len)
- {
- if (nchars == nbytes)
- c = copy_bufptr[i], len = 1;
- else
- c = STRING_CHAR_AND_LENGTH (copy_bufptr + i,
- nbytes - i, len);
- inev.ie.kind = (SINGLE_BYTE_CHAR_P (c)
- ? ASCII_KEYSTROKE_EVENT
- : MULTIBYTE_CHAR_KEYSTROKE_EVENT);
- inev.ie.code = c;
- kbd_buffer_store_event_hold (&inev.ie, hold_quit);
- }
+ /* Convert the input data to a sequence of
+ character events. */
+ for (i = 0; i < nbytes; i += len)
+ {
+ if (nchars == nbytes)
+ c = copy_bufptr[i], len = 1;
+ else
+ c = STRING_CHAR_AND_LENGTH (copy_bufptr + i,
+ nbytes - i, len);
+ inev.ie.kind = (SINGLE_BYTE_CHAR_P (c)
+ ? ASCII_KEYSTROKE_EVENT
+ : MULTIBYTE_CHAR_KEYSTROKE_EVENT);
+ inev.ie.code = c;
+ kbd_buffer_store_event_hold (&inev.ie, hold_quit);
}
/* Previous code updated count by nchars rather than nbytes,