From 866f85184a7d583883f1d1dd4ce2d1d8dbf77884 Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Thu, 19 Oct 2006 07:17:42 +0000 Subject: * xselect.c (x_handle_selection_request): If the converted_selection is NIL or XCDR (converted_selection) is NIL, decline the request. --- src/ChangeLog | 5 +++++ src/xselect.c | 8 ++++++++ 2 files changed, 13 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index ce3c7d1435b..9b33d6c2d70 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-10-19 Jan Dj,Ad(Brv + + * 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 * gtkutil.c (get_utf8_string): Remove warnings with casts. diff --git a/src/xselect.c b/src/xselect.c index 013a52dbdb1..022226946a9 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -956,6 +956,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); @@ -971,6 +977,8 @@ x_handle_selection_request (event) if (!nofree) xfree (data); } + + DONE2: unbind_to (count, Qnil); DONE: -- cgit v1.2.1 From 9346531434a0091a5655d83f9436fa011431bcfd Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Thu, 19 Oct 2006 08:01:25 +0000 Subject: (Vmac_carbon_version_string) [TARGET_API_MAC_CARBON]: New variable. (syms_of_macfns) [TARGET_API_MAC_CARBON]: Defvar it. --- src/macfns.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src') diff --git a/src/macfns.c b/src/macfns.c index 49c72e1bf4f..1b3a7223b63 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); -- cgit v1.2.1 From 045b190821781a78d6618b296d97369612ad4bd2 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Thu, 19 Oct 2006 08:02:23 +0000 Subject: *** empty log message *** --- src/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 9b33d6c2d70..0e91753e9ac 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2006-10-19 YAMAMOTO Mitsuharu + + * 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 * xselect.c (x_handle_selection_request): If the converted_selection -- cgit v1.2.1 From cc7aa8dc09aaebd07db4684d619fe682f7e8451c Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Thu, 19 Oct 2006 09:48:55 +0000 Subject: *** empty log message *** --- src/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 0e91753e9ac..4747661b0ee 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2006-10-19 YAMAMOTO Mitsuharu + + * xdisp.c (display_mode_line): Clear enabled_p flag on mode-line row. + 2006-10-19 YAMAMOTO Mitsuharu * macfns.c (Vmac_carbon_version_string) [TARGET_API_MAC_CARBON]: -- cgit v1.2.1 From a4d2787c2db621248f1e8b1fb33a63c836fcae4d Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Thu, 19 Oct 2006 09:49:23 +0000 Subject: 2006-10-19 YAMAMOTO Mitsuharu (display_mode_line): Clear enabled_p flag on mode-line row. --- src/xdisp.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/xdisp.c b/src/xdisp.c index 5c017ad70c2..875d12a4816 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -16591,6 +16591,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; -- cgit v1.2.1 From 55b41ef52ebbb03d66ad4b5400500857053a5d7e Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Thu, 19 Oct 2006 14:13:52 +0000 Subject: * 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. --- src/ChangeLog | 8 ++++++ src/callint.c | 87 ++++++++++++++++++++++------------------------------------- 2 files changed, 40 insertions(+), 55 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 4747661b0ee..0f098a07c8a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2006-10-19 Chong Yidong + + * 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 * xdisp.c (display_mode_line): Clear enabled_p flag on mode-line row. diff --git a/src/callint.c b/src/callint.c index 392b6f00eec..b65ef144d5d 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; @@ -915,6 +893,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"), @@ -954,10 +935,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, -- cgit v1.2.1 From cd987aaa0a8254a701886b3c32c269b09025c7a1 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Sat, 21 Oct 2006 01:57:34 +0000 Subject: (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. --- src/ChangeLog | 7 +++++++ src/xfns.c | 50 +++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 50 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 0f098a07c8a..930c2a44d4d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2006-10-21 Kenichi Handa + + * 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 * callint.c (callint_message): Convert to a Lisp string. diff --git a/src/xfns.c b/src/xfns.c index 3afaf0ea20a..9f656d4cd7b 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -2020,13 +2020,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++) { @@ -2037,8 +2038,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); @@ -2046,7 +2066,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); @@ -2113,13 +2134,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); } -- cgit v1.2.1 From 627fb581aed103ff9ed9268d8bff8aea44845415 Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Sat, 21 Oct 2006 17:40:03 +0000 Subject: (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. --- src/ChangeLog | 8 ++++++++ src/minibuf.c | 18 ++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 930c2a44d4d..2a10a65c71b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2006-10-21 Richard Stallman + + * 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 * xfns.c (xic_create_fontsetname): If ADSTYLE field is not a wild diff --git a/src/minibuf.c b/src/minibuf.c index bb9c80b4e7d..46c54d8724f 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -132,7 +132,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; @@ -142,6 +143,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; @@ -1040,7 +1045,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. */ @@ -2808,6 +2815,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; @@ -2933,6 +2943,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); -- cgit v1.2.1 From 96f4f7ecf189de0869289480e5915a6124b61b03 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Sun, 22 Oct 2006 22:25:03 +0000 Subject: (read_char): Make an element (t . EVENT) in unread-command-events add EVENT to the current command's key sequence. (syms_of_keyboard) : Update doc. --- src/keyboard.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/keyboard.c b/src/keyboard.c index eb46f99d668..364fa893539 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2537,6 +2537,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) @@ -2550,7 +2562,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; } @@ -11226,7 +11237,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, -- cgit v1.2.1 From cbfe778a8534e0f862d14391a8136d5211067913 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Sun, 22 Oct 2006 22:32:43 +0000 Subject: *** empty log message *** --- src/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 2a10a65c71b..48fa6846b2f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2006-10-23 Kim F. Storm + + * 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) : Update doc. + 2006-10-21 Richard Stallman * minibuf.c (Vread_expression_map): Define here. -- cgit v1.2.1 From a4614668b42cdf5b707df387f7b6011a5554273e Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Mon, 23 Oct 2006 09:51:56 +0000 Subject: *** empty log message *** --- src/ChangeLog | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 48fa6846b2f..d4f67a927de 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2006-10-23 Kim F. Storm + * 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) : Update doc. -- cgit v1.2.1 From 4fa93fa8596baeb9d9f42942417bc99fd602b88b Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Mon, 23 Oct 2006 09:58:49 +0000 Subject: (remember_mouse_glyph): Don't crash if glyphs are not initialized. --- src/xdisp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/xdisp.c b/src/xdisp.c index 875d12a4816..cf508288616 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -2081,7 +2081,7 @@ remember_mouse_glyph (f, gx, gy, rect) int gx, gy; NativeRectangle *rect; { - Lisp_Object window; + Lisp_Object window = Qnil; struct window *w; struct glyph_row *r, *gr, *end_row; enum window_part part; @@ -2091,7 +2091,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 (f->glyphs_initialized_p) + window = window_from_coordinates (f, gx, gy, &part, &x, &y, 0); + if (NILP (window)) { width = FRAME_SMALLEST_CHAR_WIDTH (f); -- cgit v1.2.1 From 88efeba65ea05ecf778a56758138484ccdfd5103 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Mon, 23 Oct 2006 11:49:48 +0000 Subject: (remember_mouse_glyph): Simplify last change. --- src/xdisp.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/xdisp.c b/src/xdisp.c index cf508288616..b85fdb4d71e 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -2081,7 +2081,7 @@ remember_mouse_glyph (f, gx, gy, rect) int gx, gy; NativeRectangle *rect; { - Lisp_Object window = Qnil; + Lisp_Object window; struct window *w; struct glyph_row *r, *gr, *end_row; enum window_part part; @@ -2091,10 +2091,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. */ - if (f->glyphs_initialized_p) - 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); -- cgit v1.2.1 From 234b59d7bb1bd34f7c0e533be3ab3d47c1f7095a Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Fri, 27 Oct 2006 22:34:22 +0000 Subject: (best_matching_font): Fix logic to decide whether to use overstriking to simulate bold-face (it was reversed). --- src/xfaces.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/xfaces.c b/src/xfaces.c index 3dc5ddc3401..c408a7d3685 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -6688,10 +6688,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; } -- cgit v1.2.1 From 4975e69596a64247e8995d1ff9084b98a9a5ed0d Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Fri, 27 Oct 2006 22:37:48 +0000 Subject: (x_draw_glyph_string_foreground): Set background mode to TRANSPARENT before using overstrike to simulate bold faces. --- src/ChangeLog | 17 +++++++++++++---- src/w32term.c | 3 +++ 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index d4f67a927de..4118fc6f2d8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,6 +1,15 @@ +2006-10-27 Ben North (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 - * xdisp.c (remember_mouse_glyph): Do nothing if glyphs are not initialized. + * 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. @@ -113,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 @@ -157,7 +166,7 @@ 2006-09-30 Eli Zaretskii - * config.in Regenerated. + * config.in: Regenerated. 2006-09-29 Juri Linkov diff --git a/src/w32term.c b/src/w32term.c index c00fdb8923c..e22a9dbe1ab 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) -- cgit v1.2.1