summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog61
-rw-r--r--src/callint.c87
-rw-r--r--src/keyboard.c18
-rw-r--r--src/macfns.c24
-rw-r--r--src/minibuf.c18
-rw-r--r--src/w32term.c3
-rw-r--r--src/xdisp.c8
-rw-r--r--src/xfaces.c4
-rw-r--r--src/xfns.c50
-rw-r--r--src/xselect.c8
10 files changed, 208 insertions, 73 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index ce3c7d1435b..4118fc6f2d8 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,58 @@
+2006-10-27 Ben North <ben@redfrontdoor.org> (tiny change)
+
+ * w32term.c (x_draw_glyph_string_foreground): Set background mode
+ to TRANSPARENT before using overstrike to simulate bold faces.
+
+ * xfaces.c (best_matching_font): Fix logic to decide whether to
+ use overstriking to simulate bold-face (it was reversed).
+
+2006-10-23 Kim F. Storm <storm@cua.dk>
+
+ * xdisp.c (remember_mouse_glyph): Do nothing if glyphs are not
+ initialized.
+
+ * keyboard.c (read_char): Make an element (t . EVENT) in
+ unread-command-events add EVENT to the current command's key sequence.
+ (syms_of_keyboard) <unread-command-events>: Update doc.
+
+2006-10-21 Richard Stallman <rms@gnu.org>
+
+ * minibuf.c (Vread_expression_map): Define here.
+ (Qread_expression_history): New variable.
+ (syms_of_minibuf): Initialize them.
+ (Feval_minibuffer): Use Vread_expression_map and
+ Qread_expression_history.
+
+2006-10-21 Kenichi Handa <handa@m17n.org>
+
+ * xfns.c (xic_create_fontsetname): If ADSTYLE field is not a wild
+ card, change it to "*".
+ (xic_create_xfontset): Call XCreateFontSet for each single
+ fontname in fontsetname.
+
+2006-10-19 Chong Yidong <cyd@stupidchicken.com>
+
+ * callint.c (callint_message): Convert to a Lisp string.
+ (syms_of_callint): Initialize it.
+ (callint_message_size): Var deleted.
+ (Fcall_interactively): Use Fformat instead of doprnt to construct
+ prompt string.
+
+2006-10-19 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * xdisp.c (display_mode_line): Clear enabled_p flag on mode-line row.
+
+2006-10-19 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * macfns.c (Vmac_carbon_version_string) [TARGET_API_MAC_CARBON]:
+ New variable.
+ (syms_of_macfns) [TARGET_API_MAC_CARBON]: Defvar it.
+
+2006-10-19 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
+
+ * xselect.c (x_handle_selection_request): If the converted_selection
+ is NIL or XCDR (converted_selection) is NIL, decline the request.
+
2006-10-16 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
* gtkutil.c (get_utf8_string): Remove warnings with casts.
@@ -67,8 +122,8 @@
(x_draw_glyph_string_foreground): Use overstrike when needed.
(x_draw_composite_glyph_string_foreground): Likewise.
Use mac_draw_image_string_16 instead of mac_draw_string_16.
- (mac_load_query_font): Rename from XLoadQueryFont. Take argument F
- instead of DPY. All uses changed. Don't save/restore font.
+ (mac_load_query_font): Rename from XLoadQueryFont. Take argument
+ F instead of DPY. All uses changed. Don't save/restore font.
2006-10-07 Ralf Angeli <angeli@caeruleus.net>
@@ -111,7 +166,7 @@
2006-09-30 Eli Zaretskii <eliz@gnu.org>
- * config.in Regenerated.
+ * config.in: Regenerated.
2006-09-29 Juri Linkov <juri@jurta.org>
diff --git a/src/callint.c b/src/callint.c
index 5c54cdcaf48..0bd2ed66383 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -58,11 +58,8 @@ static Lisp_Object preserved_fns;
/* Marker used within call-interactively to refer to point. */
static Lisp_Object point_marker;
-/* Buffer for the prompt text used in Fcall_interactively. */
-static char *callint_message;
-
-/* Allocated length of that buffer. */
-static int callint_message_size;
+/* String for the prompt text used in Fcall_interactively. */
+static Lisp_Object callint_message;
/* ARGSUSED */
DEFUN ("interactive", Finteractive, Sinteractive, 0, UNEVALLED, 0,
@@ -266,7 +263,6 @@ invoke it. If KEYS is omitted or nil, the return value of
Lisp_Object function, record_flag, keys;
{
Lisp_Object *args, *visargs;
- unsigned char **argstrings;
Lisp_Object fun;
Lisp_Object specs;
Lisp_Object filter_specs;
@@ -492,7 +488,6 @@ invoke it. If KEYS is omitted or nil, the return value of
args = (Lisp_Object *) alloca ((count + 1) * sizeof (Lisp_Object));
visargs = (Lisp_Object *) alloca ((count + 1) * sizeof (Lisp_Object));
- argstrings = (unsigned char **) alloca ((count + 1) * sizeof (char *));
varies = (int *) alloca ((count + 1) * sizeof (int));
for (i = 0; i < (count + 1); i++)
@@ -516,34 +511,17 @@ invoke it. If KEYS is omitted or nil, the return value of
prompt1[sizeof prompt1 - 1] = 0;
tem1 = (char *) index (prompt1, '\n');
if (tem1) *tem1 = 0;
- /* Fill argstrings with a vector of C strings
- corresponding to the Lisp strings in visargs. */
- for (j = 1; j < i; j++)
- argstrings[j]
- = (EQ (visargs[j], Qnil)
- ? (unsigned char *) ""
- : SDATA (visargs[j]));
-
- /* Process the format-string in prompt1, putting the output
- into callint_message. Make callint_message bigger if necessary.
- We don't use a buffer on the stack, because the contents
- need to stay stable for a while. */
- while (1)
- {
- int nchars = doprnt (callint_message, callint_message_size,
- prompt1, (char *)0,
- j - 1, (char **) argstrings + 1);
- if (nchars < callint_message_size - 1)
- break;
- callint_message_size *= 2;
- callint_message
- = (char *) xrealloc (callint_message, callint_message_size);
- }
+
+ visargs[0] = build_string (prompt1);
+ if (index (prompt1, '%'))
+ callint_message = Fformat (i, visargs);
+ else
+ callint_message = visargs[0];
switch (*tem)
{
case 'a': /* Symbol defined as a function */
- visargs[i] = Fcompleting_read (build_string (callint_message),
+ visargs[i] = Fcompleting_read (callint_message,
Vobarray, Qfboundp, Qt,
Qnil, Qnil, Qnil, Qnil);
/* Passing args[i] directly stimulates compiler bug */
@@ -555,17 +533,17 @@ invoke it. If KEYS is omitted or nil, the return value of
args[i] = Fcurrent_buffer ();
if (EQ (selected_window, minibuf_window))
args[i] = Fother_buffer (args[i], Qnil, Qnil);
- args[i] = Fread_buffer (build_string (callint_message), args[i], Qt);
+ args[i] = Fread_buffer (callint_message, args[i], Qt);
break;
case 'B': /* Name of buffer, possibly nonexistent */
- args[i] = Fread_buffer (build_string (callint_message),
+ args[i] = Fread_buffer (callint_message,
Fother_buffer (Fcurrent_buffer (), Qnil, Qnil),
Qnil);
break;
case 'c': /* Character */
- args[i] = Fread_char (build_string (callint_message), Qnil, Qnil);
+ args[i] = Fread_char (callint_message, Qnil, Qnil);
message1_nolog ((char *) 0);
/* Passing args[i] directly stimulates compiler bug */
teml = args[i];
@@ -573,7 +551,7 @@ invoke it. If KEYS is omitted or nil, the return value of
break;
case 'C': /* Command: symbol with interactive function */
- visargs[i] = Fcompleting_read (build_string (callint_message),
+ visargs[i] = Fcompleting_read (callint_message,
Vobarray, Qcommandp,
Qt, Qnil, Qnil, Qnil, Qnil);
/* Passing args[i] directly stimulates compiler bug */
@@ -589,24 +567,24 @@ invoke it. If KEYS is omitted or nil, the return value of
break;
case 'D': /* Directory name. */
- args[i] = Fread_file_name (build_string (callint_message), Qnil,
+ args[i] = Fread_file_name (callint_message, Qnil,
current_buffer->directory, Qlambda, Qnil,
Qfile_directory_p);
break;
case 'f': /* Existing file name. */
- args[i] = Fread_file_name (build_string (callint_message),
+ args[i] = Fread_file_name (callint_message,
Qnil, Qnil, Qlambda, Qnil, Qnil);
break;
case 'F': /* Possibly nonexistent file name. */
- args[i] = Fread_file_name (build_string (callint_message),
+ args[i] = Fread_file_name (callint_message,
Qnil, Qnil, Qnil, Qnil, Qnil);
break;
case 'G': /* Possibly nonexistent file name,
default to directory alone. */
- args[i] = Fread_file_name (build_string (callint_message),
+ args[i] = Fread_file_name (callint_message,
Qnil, Qnil, Qnil, build_string (""), Qnil);
break;
@@ -618,7 +596,7 @@ invoke it. If KEYS is omitted or nil, the return value of
{
int speccount1 = SPECPDL_INDEX ();
specbind (Qcursor_in_echo_area, Qt);
- args[i] = Fread_key_sequence (build_string (callint_message),
+ args[i] = Fread_key_sequence (callint_message,
Qnil, Qnil, Qnil, Qnil);
unbind_to (speccount1, Qnil);
teml = args[i];
@@ -646,7 +624,7 @@ invoke it. If KEYS is omitted or nil, the return value of
{
int speccount1 = SPECPDL_INDEX ();
specbind (Qcursor_in_echo_area, Qt);
- args[i] = Fread_key_sequence (build_string (callint_message),
+ args[i] = Fread_key_sequence (callint_message,
Qnil, Qt, Qnil, Qnil);
teml = args[i];
visargs[i] = Fkey_description (teml, Qnil);
@@ -706,7 +684,7 @@ invoke it. If KEYS is omitted or nil, the return value of
case 'M': /* String read via minibuffer with
inheriting the current input method. */
- args[i] = Fread_string (build_string (callint_message),
+ args[i] = Fread_string (callint_message,
Qnil, Qnil, Qnil, Qt);
break;
@@ -726,7 +704,7 @@ invoke it. If KEYS is omitted or nil, the return value of
}
first = 0;
- tem = Fread_from_minibuffer (build_string (callint_message),
+ tem = Fread_from_minibuffer (callint_message,
Qnil, Qnil, Qnil, Qnil, Qnil,
Qnil);
if (! STRINGP (tem) || SCHARS (tem) == 0)
@@ -736,7 +714,7 @@ invoke it. If KEYS is omitted or nil, the return value of
}
while (! NUMBERP (args[i]));
}
- visargs[i] = last_minibuf_string;
+ visargs[i] = args[i];
break;
case 'P': /* Prefix arg in raw form. Does no I/O. */
@@ -766,12 +744,12 @@ invoke it. If KEYS is omitted or nil, the return value of
case 's': /* String read via minibuffer without
inheriting the current input method. */
- args[i] = Fread_string (build_string (callint_message),
+ args[i] = Fread_string (callint_message,
Qnil, Qnil, Qnil, Qnil);
break;
case 'S': /* Any symbol. */
- visargs[i] = Fread_string (build_string (callint_message),
+ visargs[i] = Fread_string (callint_message,
Qnil, Qnil, Qnil, Qnil);
/* Passing args[i] directly stimulates compiler bug */
teml = visargs[i];
@@ -780,17 +758,17 @@ invoke it. If KEYS is omitted or nil, the return value of
case 'v': /* Variable name: symbol that is
user-variable-p. */
- args[i] = Fread_variable (build_string (callint_message), Qnil);
+ args[i] = Fread_variable (callint_message, Qnil);
visargs[i] = last_minibuf_string;
break;
case 'x': /* Lisp expression read but not evaluated */
- args[i] = Fread_minibuffer (build_string (callint_message), Qnil);
+ args[i] = Fread_minibuffer (callint_message, Qnil);
visargs[i] = last_minibuf_string;
break;
case 'X': /* Lisp expression read and evaluated */
- args[i] = Feval_minibuffer (build_string (callint_message), Qnil);
+ args[i] = Feval_minibuffer (callint_message, Qnil);
visargs[i] = last_minibuf_string;
break;
@@ -804,13 +782,13 @@ invoke it. If KEYS is omitted or nil, the return value of
else
{
args[i]
- = Fread_non_nil_coding_system (build_string (callint_message));
+ = Fread_non_nil_coding_system (callint_message);
visargs[i] = last_minibuf_string;
}
break;
case 'z': /* Coding-system symbol or nil */
- args[i] = Fread_coding_system (build_string (callint_message), Qnil);
+ args[i] = Fread_coding_system (callint_message, Qnil);
visargs[i] = last_minibuf_string;
break;
@@ -914,6 +892,9 @@ syms_of_callint ()
point_marker = Fmake_marker ();
staticpro (&point_marker);
+ callint_message = Qnil;
+ staticpro (&callint_message);
+
preserved_fns = Fcons (intern ("region-beginning"),
Fcons (intern ("region-end"),
Fcons (intern ("point"),
@@ -953,10 +934,6 @@ syms_of_callint ()
Qmouse_leave_buffer_hook = intern ("mouse-leave-buffer-hook");
staticpro (&Qmouse_leave_buffer_hook);
- callint_message_size = 100;
- callint_message = (char *) xmalloc (callint_message_size);
-
-
DEFVAR_KBOARD ("prefix-arg", Vprefix_arg,
doc: /* The value of the prefix argument for the next editing command.
It may be a number, or the symbol `-' for just a minus sign as arg,
diff --git a/src/keyboard.c b/src/keyboard.c
index 5d0e05f887d..97554717e9a 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -2620,6 +2620,18 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
c = XCAR (Vunread_command_events);
Vunread_command_events = XCDR (Vunread_command_events);
+ reread = 1;
+
+ /* Undo what sit-for did when it unread additional keys
+ inside universal-argument. */
+
+ if (CONSP (c)
+ && EQ (XCAR (c), Qt))
+ {
+ reread = 0;
+ c = XCDR (c);
+ }
+
/* Undo what read_char_x_menu_prompt did when it unread
additional keys returned by Fx_popup_menu. */
if (CONSP (c)
@@ -2633,7 +2645,6 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
&& (EQ (c, Qtool_bar) || EQ (c, Qmenu_bar)))
*used_mouse_menu = 1;
- reread = 1;
goto reread_for_input_method;
}
@@ -11626,7 +11637,10 @@ so that you can determine whether the command was run by mouse or not. */);
DEFVAR_LISP ("unread-command-events", &Vunread_command_events,
doc: /* List of events to be read as the command input.
-These events are processed first, before actual keyboard input. */);
+These events are processed first, before actual keyboard input.
+Events read from this list are not normally added to `this-command-keys',
+as they will already have been added once as they were read for the first time.
+An element of the form (t . EVENT) forces EVENT to be added to that list. */);
Vunread_command_events = Qnil;
DEFVAR_INT ("unread-command-char", &unread_command_char,
diff --git a/src/macfns.c b/src/macfns.c
index e18d6089df7..e0e58ff5c6f 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -51,6 +51,14 @@ Boston, MA 02110-1301, USA. */
extern void free_frame_menubar ();
+#if TARGET_API_MAC_CARBON
+
+/* Carbon version info */
+
+static Lisp_Object Vmac_carbon_version_string;
+
+#endif /* TARGET_API_MAC_CARBON */
+
/* Non-zero means we're allowed to display an hourglass cursor. */
int display_hourglass_p;
@@ -4718,6 +4726,22 @@ such a font. This is especially effective for such large fonts as
Chinese, Japanese, and Korean. */);
Vx_pixel_size_width_font_regexp = Qnil;
+#if TARGET_API_MAC_CARBON
+ DEFVAR_LISP ("mac-carbon-version-string", &Vmac_carbon_version_string,
+ doc: /* Version info for Carbon API. */);
+ {
+ OSErr err;
+ UInt32 response;
+ char carbon_version[16] = "Unknown";
+
+ err = Gestalt (gestaltCarbonVersion, &response);
+ if (err == noErr)
+ sprintf (carbon_version, "%u.%u.%u",
+ (response >> 8) & 0xf, (response >> 4) & 0xf, response & 0xf);
+ Vmac_carbon_version_string = build_string (carbon_version);
+ }
+#endif /* TARGET_API_MAC_CARBON */
+
/* X window properties. */
defsubr (&Sx_change_window_property);
defsubr (&Sx_delete_window_property);
diff --git a/src/minibuf.c b/src/minibuf.c
index 8924668db52..f54feffbb21 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -133,7 +133,8 @@ int minibuffer_auto_raise;
static Lisp_Object last_exact_completion;
-extern Lisp_Object Voverriding_local_map;
+/* Keymap for reading expressions. */
+Lisp_Object Vread_expression_map;
Lisp_Object Quser_variable_p;
@@ -143,6 +144,10 @@ Lisp_Object Qcurrent_input_method, Qactivate_input_method;
Lisp_Object Qcase_fold_search;
+Lisp_Object Qread_expression_history;
+
+extern Lisp_Object Voverriding_local_map;
+
extern Lisp_Object Qmouse_face;
extern Lisp_Object Qfield;
@@ -1046,7 +1051,9 @@ arguments are used as in `read-from-minibuffer'.) */)
(prompt, initial_contents)
Lisp_Object prompt, initial_contents;
{
- return Feval (Fread_minibuffer (prompt, initial_contents));
+ return Feval (read_minibuf (Vread_expression_map, initial_contents,
+ prompt, Qnil, 1, Qread_expression_history,
+ make_number (0), Qnil, 0, 0));
}
/* Functions that use the minibuffer to read various things. */
@@ -2814,6 +2821,9 @@ syms_of_minibuf ()
Qcase_fold_search = intern ("case-fold-search");
staticpro (&Qcase_fold_search);
+ Qread_expression_history = intern ("read-expression-history");
+ staticpro (&Qread_expression_history);
+
DEFVAR_LISP ("read-buffer-function", &Vread_buffer_function,
doc: /* If this is non-nil, `read-buffer' does its work by calling this function. */);
Vread_buffer_function = Qnil;
@@ -2939,6 +2949,10 @@ properties. */);
Vminibuffer_prompt_properties
= Fcons (intern ("read-only"), Fcons (Qt, Qnil));
+ DEFVAR_LISP ("read-expression-map", &Vread_expression_map,
+ doc: /* Minibuffer keymap used for reading Lisp expressions. */);
+ Vread_expression_map = Qnil;
+
defsubr (&Sset_minibuffer_window);
defsubr (&Sread_from_minibuffer);
defsubr (&Seval_minibuffer);
diff --git a/src/w32term.c b/src/w32term.c
index 9a6142925fd..948a5553e5d 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -1591,7 +1591,10 @@ x_draw_glyph_string_foreground (s)
{
/* For overstriking (to simulate bold-face), draw the
characters again shifted to the right by one pixel. */
+ int old_BkMode = SetBkMode (s->hdc, TRANSPARENT);
w32_text_out (s, x + 1, s->ybase - boff, s->char2b, s->nchars);
+ if (old_BkMode && old_BkMode != TRANSPARENT)
+ SetBkMode (s->hdc, old_BkMode);
}
}
if (s->font && s->font->hfont)
diff --git a/src/xdisp.c b/src/xdisp.c
index fe22c55dc35..d99f7a9ad1d 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -2078,8 +2078,9 @@ remember_mouse_glyph (f, gx, gy, rect)
/* Try to determine frame pixel position and size of the glyph under
frame pixel coordinates X/Y on frame F. */
- window = window_from_coordinates (f, gx, gy, &part, &x, &y, 0);
- if (NILP (window))
+ if (!f->glyphs_initialized_p
+ || (window = window_from_coordinates (f, gx, gy, &part, &x, &y, 0),
+ NILP (window)))
{
width = FRAME_SMALLEST_CHAR_WIDTH (f);
height = FRAME_SMALLEST_FONT_HEIGHT (f);
@@ -16603,6 +16604,9 @@ display_mode_line (w, face_id, format)
int count = SPECPDL_INDEX ();
init_iterator (&it, w, -1, -1, NULL, face_id);
+ /* Don't extend on a previously drawn mode-line.
+ This may happen if called from pos_visible_p. */
+ it.glyph_row->enabled_p = 0;
prepare_desired_row (it.glyph_row);
it.glyph_row->mode_line_p = 1;
diff --git a/src/xfaces.c b/src/xfaces.c
index 6373100484a..b55118acdf0 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -6705,10 +6705,10 @@ best_matching_font (f, attrs, fonts, nfonts, width_ratio, needs_overstrike)
{
/* We want a bold font, but didn't get one; try to use
overstriking instead to simulate bold-face. However,
- don't overstrike an already-bold fontn unless the
+ don't overstrike an already-bold font unless the
desired weight grossly exceeds the available weight. */
if (got_weight > XLFD_WEIGHT_MEDIUM)
- *needs_overstrike = (got_weight - want_weight) > 2;
+ *needs_overstrike = (want_weight - got_weight) > 2;
else
*needs_overstrike = 1;
}
diff --git a/src/xfns.c b/src/xfns.c
index 066996628e2..1cd8265d20f 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -2029,13 +2029,14 @@ xic_create_fontsetname (base_fontname, motif)
else
{
int len;
- char *p1 = NULL, *p2 = NULL;
+ char *p1 = NULL, *p2 = NULL, *p3 = NULL;
char *font_allcs = NULL;
char *font_allfamilies = NULL;
char *font_all = NULL;
char *allcs = "*-*-*-*-*-*-*";
char *allfamilies = "-*-*-";
char *all = "*-*-*-*-";
+ char *base;
for (i = 0, p = base_fontname; i < 8; p++)
{
@@ -2046,8 +2047,27 @@ xic_create_fontsetname (base_fontname, motif)
p1 = p + 1;
else if (i == 7)
p2 = p + 1;
+ else if (i == 6)
+ p3 = p + 1;
}
}
+ /* If base_fontname specifies ADSTYLE, make it a
+ wildcard. */
+ if (*p3 != '*')
+ {
+ int diff = (p2 - p3) - 2;
+
+ base = alloca (strlen (base_fontname) + 1);
+ bcopy (base_fontname, base, p3 - base_fontname);
+ base[p3 - base_fontname] = '*';
+ base[(p3 - base_fontname) + 1] = '-';
+ strcpy (base + (p3 - base_fontname) + 2, p2);
+ p = base + (p - base_fontname) - diff;
+ p1 = base + (p1 - base_fontname);
+ p2 = base + (p2 - base_fontname) - diff;
+ base_fontname = base;
+ }
+
/* Build the font spec that matches all charsets. */
len = p - base_fontname + strlen (allcs) + 1;
font_allcs = (char *) alloca (len);
@@ -2055,7 +2075,8 @@ xic_create_fontsetname (base_fontname, motif)
bcopy (base_fontname, font_allcs, p - base_fontname);
strcat (font_allcs, allcs);
- /* Build the font spec that matches all families. */
+ /* Build the font spec that matches all families and
+ add-styles. */
len = p - p1 + strlen (allcs) + strlen (allfamilies) + 1;
font_allfamilies = (char *) alloca (len);
bzero (font_allfamilies, len);
@@ -2122,13 +2143,28 @@ xic_create_xfontset (f, base_fontname)
if (!xfs)
{
char *fontsetname = xic_create_fontsetname (base_fontname, False);
+ char *p0 = fontsetname, *p1;
/* New fontset. */
- xfs = XCreateFontSet (FRAME_X_DISPLAY (f),
- fontsetname, &missing_list,
- &missing_count, &def_string);
- if (missing_list)
- XFreeStringList (missing_list);
+ /* FONTSETNAME contains a list of font names (specific fonts
+ first, general fonts last), but giving that to XCreateFontSet
+ at once occasionally fails (bug of X?). So, we try to call
+ XCreateFontSet for each fontname. */
+
+ while (p0)
+ {
+ p1 = strchr (p0, ',');
+ if (p1)
+ *p1 = '\0';
+ xfs = XCreateFontSet (FRAME_X_DISPLAY (f),
+ p0, &missing_list,
+ &missing_count, &def_string);
+ if (missing_list)
+ XFreeStringList (missing_list);
+ if (xfs)
+ break;
+ p0 = p1 ? p1 + 1 : NULL;
+ }
xfree (fontsetname);
}
diff --git a/src/xselect.c b/src/xselect.c
index cd49e05171b..e6103043dce 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -964,6 +964,12 @@ x_handle_selection_request (event)
Atom type;
int nofree;
+ if (CONSP (converted_selection) && NILP (XCDR (converted_selection)))
+ {
+ x_decline_selection_request (event);
+ goto DONE2;
+ }
+
lisp_data_to_selection_data (SELECTION_EVENT_DISPLAY (event),
converted_selection,
&data, &type, &size, &format, &nofree);
@@ -979,6 +985,8 @@ x_handle_selection_request (event)
if (!nofree)
xfree (data);
}
+
+ DONE2:
unbind_to (count, Qnil);
DONE: