From 982241b17ceabd0909d52644f485e1b0b1a95e4b Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 14 Oct 2004 13:24:25 +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 9fedb52f42c..b79898881da 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -3,6 +3,10 @@ * xterm.h: Include Xutil.h after keysym.h to work around bug (incorrectly recognising AltGr key) in some X versions. +2004-10-13 Stefan Monnier + + * fns.c (map_char_table): Add missing gcpros. + 2004-10-13 Stefan Monnier * keymap.c (get_keymap): An autoload form is not a keymap. -- cgit v1.3 From 4e382b0f753edf197a35f2c77ec4236a87d80d37 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Thu, 14 Oct 2004 13:58:25 +0000 Subject: (DATA_SEG_BITS): Don't define. --- src/ChangeLog | 4 ++++ src/m/ia64.h | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index b79898881da..f3f5f7defff 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2004-10-14 Andreas Schwab + + * m/ia64.h (DATA_SEG_BITS): Don't define. + 2004-10-14 Kim F. Storm * xterm.h: Include Xutil.h after keysym.h to work around bug diff --git a/src/m/ia64.h b/src/m/ia64.h index 7114382d513..947bb9d4562 100644 --- a/src/m/ia64.h +++ b/src/m/ia64.h @@ -133,8 +133,6 @@ extern void r_alloc_free (); #endif /* not NOT_C_CODE */ -#define DATA_SEG_BITS 0x6000000000000000 - #define HAVE_TEXT_START /* arch-tag: 9b8e9fb2-2e49-4c22-b68f-11a488e77c66 -- cgit v1.3 From 699a039256a3a5c868d31ce8652eec76a4b23902 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Fri, 15 Oct 2004 11:56:26 +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 f3f5f7defff..1b110130bdf 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2004-10-15 Kim F. Storm + + * xdisp.c (x_draw_vertical_border): Do nothing if non-window system. + 2004-10-14 Andreas Schwab * m/ia64.h (DATA_SEG_BITS): Don't define. -- cgit v1.3 From 87345db95cb26df77916e77ab0966607eb3606b8 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Fri, 15 Oct 2004 11:56:41 +0000 Subject: (x_draw_vertical_border): Do nothing if non-window system. --- src/xdisp.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/xdisp.c b/src/xdisp.c index cea16dcbcb5..1ddfc007f7f 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -21634,6 +21634,9 @@ x_draw_vertical_border (w) windows (on either side) have... But we don't :-( However, I think this works ok. ++KFS 2003-04-25 */ + if (!FRAME_WINDOW_P (XFRAME (w->frame))) + return; + /* Redraw borders between horizontally adjacent windows. Don't do it for frames with vertical scroll bars because either the right scroll bar of a window, or the left scroll bar of its -- cgit v1.3 From b3c7a89bafb58bf101ed38af657ef36a7e4eeb94 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Fri, 15 Oct 2004 12:01:52 +0000 Subject: *** empty log message *** --- src/ChangeLog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 1b110130bdf..5f65b02a908 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,6 +1,7 @@ 2004-10-15 Kim F. Storm - * xdisp.c (x_draw_vertical_border): Do nothing if non-window system. + * xdisp.c (redisplay_window): Only update fringes and vertical + border on window frames. 2004-10-14 Andreas Schwab -- cgit v1.3 From f459b8c059c53a618ba24fe7e0f90024b78f22ab Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Fri, 15 Oct 2004 12:02:27 +0000 Subject: (x_draw_vertical_border): Undo last change. (redisplay_window): Only update fringes and vertical border on window frames. --- src/xdisp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/xdisp.c b/src/xdisp.c index 1ddfc007f7f..2f68207a1d1 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -12217,7 +12217,8 @@ redisplay_window (window, just_this_one_p) } #ifdef HAVE_WINDOW_SYSTEM - if (update_window_fringes (w, 0) + if (FRAME_WINDOW_P (f) + && update_window_fringes (w, 0) && !just_this_one_p && (used_current_matrix_p || overlay_arrow_seen) && !w->pseudo_window_p) @@ -21634,9 +21635,6 @@ x_draw_vertical_border (w) windows (on either side) have... But we don't :-( However, I think this works ok. ++KFS 2003-04-25 */ - if (!FRAME_WINDOW_P (XFRAME (w->frame))) - return; - /* Redraw borders between horizontally adjacent windows. Don't do it for frames with vertical scroll bars because either the right scroll bar of a window, or the left scroll bar of its -- cgit v1.3 From 3584d95d9dbc791526e4cd84187176861fe5963d Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 15 Oct 2004 14:49:30 +0000 Subject: (Fsubstitute_command_keys): Fix remap-handling. Don't ignore menus, because where-is-internal already does it for us. --- src/ChangeLog | 5 +++++ src/doc.c | 16 +++------------- 2 files changed, 8 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 5f65b02a908..e92e6b96eec 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-10-15 Stefan + + * doc.c (Fsubstitute_command_keys): Fix remap-handling. + Don't ignore menus, because where-is-internal already does it for us. + 2004-10-15 Kim F. Storm * xdisp.c (redisplay_window): Only update fringes and vertical diff --git a/src/doc.c b/src/doc.c index e6914d24038..82df9134f61 100644 --- a/src/doc.c +++ b/src/doc.c @@ -774,28 +774,18 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int /* Save STRP in IDX. */ idx = strp - SDATA (string); - tem = Fintern (make_string (start, length_byte), Qnil); + name = Fintern (make_string (start, length_byte), Qnil); /* Ignore remappings unless there are no ordinary bindings. */ - tem = Fwhere_is_internal (tem, keymap, Qt, Qnil, Qt); + tem = Fwhere_is_internal (name, keymap, Qt, Qnil, Qt); if (NILP (tem)) - tem = Fwhere_is_internal (tem, keymap, Qt, Qnil, Qnil); + tem = Fwhere_is_internal (name, keymap, Qt, Qnil, Qnil); /* Note the Fwhere_is_internal can GC, so we have to take relocation of string contents into account. */ strp = SDATA (string) + idx; start = SDATA (string) + start_idx; - /* Disregard menu bar bindings; it is positively annoying to - mention them when there's no menu bar, and it isn't terribly - useful even when there is a menu bar. */ - if (!NILP (tem)) - { - firstkey = Faref (tem, make_number (0)); - if (EQ (firstkey, Qmenu_bar)) - tem = Qnil; - } - if (NILP (tem)) /* but not on any keys */ { int offset = bufp - buf; -- cgit v1.3 From dbb37962f96acdd8af6abf530b178f3a7a51b401 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Fri, 15 Oct 2004 15:09:58 +0000 Subject: Add comment. --- src/ChangeLog | 2 +- src/xterm.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index e92e6b96eec..509add7e1d5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -15,7 +15,7 @@ 2004-10-14 Kim F. Storm * xterm.h: Include Xutil.h after keysym.h to work around bug - (incorrectly recognising AltGr key) in some X versions. + in some X versions. 2004-10-13 Stefan Monnier diff --git a/src/xterm.h b/src/xterm.h index ad5374ace6f..d3f5cee1277 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -21,8 +21,13 @@ Boston, MA 02111-1307, USA. */ #include #include + +/* Include Xutil.h after keysym.h to work around a bug that prevents + correct recognition of AltGr key in some X versions. */ + #include #include + #include #include -- cgit v1.3 From d99b4859a0b850c423fe535c50e3267769566293 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 16 Oct 2004 14:51:39 +0000 Subject: (Fspecial_display_p): Doc fix. --- src/window.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/window.c b/src/window.c index 11dabdaf964..5a1f1bab7ca 100644 --- a/src/window.c +++ b/src/window.c @@ -3214,10 +3214,13 @@ display_buffer_1 (window) } DEFUN ("special-display-p", Fspecial_display_p, Sspecial_display_p, 1, 1, 0, - doc: /* Returns non-nil if a buffer named BUFFER-NAME would be created specially. -The value is actually t if the frame should be called with default frame -parameters, and a list of frame parameters if they were specified. -See `special-display-buffer-names', and `special-display-regexps'. */) + doc: /* Returns non-nil if a buffer named BUFFER-NAME gets a special frame. +If the value is t, a frame would be created for that buffer +using the default frame parameters. If the value is a list, +it is a list of frame parameters that would be used +to make a frame for that buffer. +The variables `special-display-buffer-names' +and `special-display-regexps' control this. */) (buffer_name) Lisp_Object buffer_name; { -- cgit v1.3 From c2e2ede7e88395e3f85871bd58dc9dab1d83d242 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 16 Oct 2004 15:35:53 +0000 Subject: *** empty log message *** --- lisp/ChangeLog | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ lisp/url/ChangeLog | 22 +++++++++++++++++++++ src/ChangeLog | 4 ++++ 3 files changed, 83 insertions(+) (limited to 'src') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f46bc155970..c0c5518f765 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,51 @@ +2004-10-16 Richard M. Stallman + + * pcvs-util.el (cvs-bury-buffer): + Don't call get-buffer-window for effect. + + * outline.el (hide-other): Call outline-up-heading with INVISIBLE-OK=t. + + * newcomment.el (comment-auto-fill-only-comments): Add autoload. + + * msb.el (msb-unload-hook): Set the variable. + + * mouse.el (mouse-yank-at-click, mouse-yank-secondary): + Use * to err if buffer is readonly. + + * subr.el (looking-back): Return only t or nil. + + * whitespace.el (whitespace-unload-hook): Set the variable. + + * view.el (view-mode-enable): Set view-page-size and + view-half-page-size to nil. + (view-set-half-page-size-default): view-half-page-size = nil + means the default. + (View-scroll-page-forward): Use view-page-size-default. + (View-scroll-page-backward): Likewise. + (view-page-size, view-half-page-size): Doc fixes. + + * emacs-lisp/elp.el (elp-unload-hook): Set the variable. + + * emacs-lisp/cl.el (cl-unload-hook): Don't defvar it, just set it. + + * emacs-lisp/bytecomp.el (byte-compile-eval): Don't process + "cl" like other files. Instead, call byte-compile-find-cl-functions. + (byte-compile-log-1): Bind inhibit-read-only. + (byte-compile-warning-prefix, byte-compile-log-file): Likewise. + (byte-compile-log-warning): Likewise. + (byte-compile-file-form-require): Detect "cl" from the arg value. + + * progmodes/compile.el (compilation-start): Assume compilation-mode + will make the buffer read-only. + (compilation-mode): Take arg name-of-mode. + (compilation-setup): Make buffer read-only. + (compilation-handle-exit): Bind inhibit-read-only. + + * textmodes/ispell.el (ispell-command-loop): Use with-no-warnings. + (ispell-message): Likewise. + (ispell-show-choices): Don't call get-buffer-window uselessly. + (ispell-init-process): Use set-process-query-on-exit-flag. + 2004-10-16 Kim F. Storm * fringe.el (fringe-bitmaps): Only initialize when defined. @@ -38,6 +86,15 @@ (event-modifiers): Use push. (mouse-movement-p, with-temp-buffer): Simplify. +2004-10-12 Richard M. Stallman + + * info-look.el (info-lookup-file): Add info-file property. + (info-lookup-symbol): Likewise. + + * info.el (info-xref): Add underlining. + (info): Add info-file property. + (Info-find-emacs-command-nodes): Specify case-sensitive search. + 2004-10-12 Michael Albinus Sync with Tramp 2.0.45. diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index 91a6c869a21..87f818cd70d 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog @@ -1,3 +1,25 @@ +2004-10-16 Richard M. Stallman + + * url.el (url-do-setup): Don't set url-passwd-entry-func. + + * url-vars.el (url-passwd-entry-func): Var deleted. + (mm-mime-mule-charset-alist): Remove compatibility code for old Gnus. + (url-weekday-alist): Renamed from weekday-alist. + (url-monthabbrev-alist): Renamed from monthabbrev-alist. + (url-vars-unload-hook): Initialize hook var to hold the function. + + * url-util.el (url-get-normalized-date): Use + url-weekday-alist and url-monthabbrev-alist. + + * url-misc.el: Load cl at compile time. + + * url-mailto.el: Don't load cl. + (url-mailto): Fix call to `push'. + + * url-gw.el (url-open-telnet): Use read-passwd. + + * url-auth.el (url-basic-auth, url-digest-auth): Use read-passwd. + 2004-10-12 Simon Josefsson * url-vars.el (url-gateway-method): Add new method `tls'. diff --git a/src/ChangeLog b/src/ChangeLog index 509add7e1d5..46649e5006f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2004-10-16 Richard M. Stallman + + * window.c (Fspecial_display_p): Doc fix. + 2004-10-15 Stefan * doc.c (Fsubstitute_command_keys): Fix remap-handling. -- cgit v1.3 From be13cbb78b1986aa44989cf715f05dc07d359348 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Sat, 16 Oct 2004 23:01:19 +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 46649e5006f..b2fc3ce81a6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2004-10-16 Jason Rumney + + * w32fns.c (w32_font_match): Encode font name being matched. + 2004-10-16 Richard M. Stallman * window.c (Fspecial_display_p): Doc fix. -- cgit v1.3 From 0424a1b04306efa6096a59c38a337a40c7dfd856 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Sat, 16 Oct 2004 23:02:25 +0000 Subject: (w32_font_match): Encode font name being matched. --- src/w32fns.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/w32fns.c b/src/w32fns.c index 5cfc4adb0af..1e52155ab3b 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -5370,7 +5370,7 @@ x_to_w32_font (lpxstr, lplogfont) setup_coding_system (Fcheck_coding_system (Vlocale_coding_system), &coding); coding.src_multibyte = 1; - coding.dst_multibyte = 1; + coding.dst_multibyte = 0; /* Need to set COMPOSITION_DISABLED, otherwise Emacs crashes in encode_coding_iso2022 trying to dereference a null pointer. */ coding.composing = COMPOSITION_DISABLED; @@ -5607,12 +5607,14 @@ w32_font_match (fontname, pattern) char * fontname; char * pattern; { - char *regex = alloca (strlen (pattern) * 2 + 3); - char *font_name_copy = alloca (strlen (fontname) + 1); + char *font_name_copy; char *ptr; + Lisp_Object encoded_font_name; + char *regex = alloca (strlen (pattern) * 2 + 3); - /* Copy fontname so we can modify it during comparison. */ - strcpy (font_name_copy, fontname); + /* Convert fontname to unibyte for match. */ + encoded_font_name = string_make_unibyte (build_string (fontname)); + font_name_copy = SDATA (encoded_font_name); ptr = regex; *ptr++ = '^'; -- cgit v1.3 From 345e75a892a1fa6f0abf0ca4a7ce38ae6bfdde6c Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Sun, 17 Oct 2004 13:16:31 +0000 Subject: *** empty log message *** --- src/ChangeLog | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index b2fc3ce81a6..270c2ce69e5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2004-10-17 Kim F. Storm + + * xdisp.c (overlay_arrow_at_row): Return overlay string rather + than bitmap if there is not left fringe. + (get_overlay_arrow_glyph_row): Also used on windows system. + (display_line): Display overlay string if no left fringe. + 2004-10-16 Jason Rumney * w32fns.c (w32_font_match): Encode font name being matched. -- cgit v1.3 From c514efbbf12b7468322df6badaf88b365a4f52ff Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Sun, 17 Oct 2004 13:17:00 +0000 Subject: (overlay_arrow_at_row): Return overlay string rather than bitmap if there is not left fringe. (get_overlay_arrow_glyph_row): Also used on windows system. (display_line): Display overlay string if no left fringe. --- src/xdisp.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/xdisp.c b/src/xdisp.c index 2f68207a1d1..dbce1c56368 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -9523,11 +9523,13 @@ update_overlay_arrows (up_to_date) } -/* Return overlay arrow string at row, or nil. */ +/* Return overlay arrow string to display at row. + Return t if display as bitmap in left fringe. + Return nil if no overlay arrow. */ static Lisp_Object -overlay_arrow_at_row (f, row, pbitmap) - struct frame *f; +overlay_arrow_at_row (it, row, pbitmap) + struct it *it; struct glyph_row *row; int *pbitmap; { @@ -9550,9 +9552,10 @@ overlay_arrow_at_row (f, row, pbitmap) && (MATRIX_ROW_START_CHARPOS (row) == marker_position (val))) { val = overlay_arrow_string_or_property (var, pbitmap); - if (FRAME_WINDOW_P (f)) + if (FRAME_WINDOW_P (it->f) + && WINDOW_LEFT_FRINGE_WIDTH (it->w) > 0) return Qt; - else if (STRINGP (val)) + if (STRINGP (val)) return val; break; } @@ -14073,8 +14076,8 @@ usage: (trace-to-stderr STRING &rest OBJECTS) */) Building Desired Matrix Rows ***********************************************************************/ -/* Return a temporary glyph row holding the glyphs of an overlay - arrow. Only used for non-window-redisplay windows. */ +/* Return a temporary glyph row holding the glyphs of an overlay arrow. + Used for non-window-redisplay windows, and for windows w/o left fringe. */ static struct glyph_row * get_overlay_arrow_glyph_row (w, overlay_arrow_string) @@ -14955,11 +14958,11 @@ display_line (it) better to let it be displayed like cursors under X. */ if (! overlay_arrow_seen && (overlay_arrow_string - = overlay_arrow_at_row (it->f, row, &overlay_arrow_bitmap), + = overlay_arrow_at_row (it, row, &overlay_arrow_bitmap), !NILP (overlay_arrow_string))) { /* Overlay arrow in window redisplay is a fringe bitmap. */ - if (!FRAME_WINDOW_P (it->f)) + if (STRINGP (overlay_arrow_string)) { struct glyph_row *arrow_row = get_overlay_arrow_glyph_row (it->w, overlay_arrow_string); @@ -14984,10 +14987,12 @@ display_line (it) row->used[TEXT_AREA] = p2 - row->glyphs[TEXT_AREA]; } } - + else + { + it->w->overlay_arrow_bitmap = overlay_arrow_bitmap; + row->overlay_arrow_p = 1; + } overlay_arrow_seen = 1; - it->w->overlay_arrow_bitmap = overlay_arrow_bitmap; - row->overlay_arrow_p = 1; } /* Compute pixel dimensions of this line. */ -- cgit v1.3 From 90665a8192762fe5a380a77f7bcb3eb6c5fdc593 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Sun, 17 Oct 2004 14:07:31 +0000 Subject: Remove excessive vertical whitespace. --- src/w32term.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'src') diff --git a/src/w32term.c b/src/w32term.c index 3956fd4b261..0aa782da20d 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -1209,7 +1209,6 @@ w32_text_out (s, x, y,chars,nchars) } - static void x_set_glyph_string_clipping P_ ((struct glyph_string *)); static void x_set_glyph_string_gc P_ ((struct glyph_string *)); static void x_draw_glyph_string_background P_ ((struct glyph_string *, @@ -2061,7 +2060,6 @@ x_draw_image_foreground (s) } - /* Draw a relief around the image glyph string S. */ static void @@ -2812,14 +2810,6 @@ x_new_focus_frame (dpyinfo, frame) if (old_focus && old_focus->auto_lower) x_lower_frame (old_focus); - - - - - - - - if (dpyinfo->w32_focus_frame && dpyinfo->w32_focus_frame->auto_raise) pending_autoraise_frame = dpyinfo->w32_focus_frame; else @@ -4688,7 +4678,6 @@ w32_read_socket (sd, expected, hold_quit) if (f) x_new_focus_frame (dpyinfo, f); - dpyinfo->grabbed = 0; check_visibility = 1; break; @@ -4906,7 +4895,6 @@ w32_read_socket (sd, expected, hold_quit) } - /*********************************************************************** Text Cursor -- cgit v1.3 From a0aa1111d931e801f245d5ebce6c91cccdbcba65 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Mon, 18 Oct 2004 12:26:02 +0000 Subject: (fast_string_match_ignore_case): Extern it. --- src/lisp.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/lisp.h b/src/lisp.h index 7e1e122fbc2..9e39a0d3a8c 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2792,6 +2792,7 @@ EXFUN (Fmatch_end, 1); EXFUN (Flooking_at, 1); extern int fast_string_match P_ ((Lisp_Object, Lisp_Object)); extern int fast_c_string_match_ignore_case P_ ((Lisp_Object, const char *)); +extern int fast_string_match_ignore_case P_ ((Lisp_Object, Lisp_Object)); extern int scan_buffer P_ ((int, int, int, int, int *, int)); extern int scan_newline P_ ((int, int, int, int, int, int)); extern int find_next_newline P_ ((int, int)); -- cgit v1.3 From be5f4dfb0144b5aa94c51a82acf6dd073efc3527 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Mon, 18 Oct 2004 12:26:36 +0000 Subject: (fast_string_match_ignore_case): New function. --- src/search.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src') diff --git a/src/search.c b/src/search.c index 0375f353dd2..f7bee1b8683 100644 --- a/src/search.c +++ b/src/search.c @@ -493,6 +493,27 @@ fast_c_string_match_ignore_case (regexp, string) immediate_quit = 0; return val; } + +/* Like fast_string_match but ignore case. */ + +int +fast_string_match_ignore_case (regexp, string) + Lisp_Object regexp, string; +{ + int val; + struct re_pattern_buffer *bufp; + + bufp = compile_pattern (regexp, 0, Vascii_downcase_table, + 0, STRING_MULTIBYTE (string)); + immediate_quit = 1; + re_match_object = string; + + val = re_search (bufp, (char *) SDATA (string), + SBYTES (string), 0, + SBYTES (string), 0); + immediate_quit = 0; + return val; +} /* The newline cache: remembering which sections of text have no newlines. */ -- cgit v1.3 From 6e1b0d8c4f8db76307825736094ec8f57dcd2e6e Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Mon, 18 Oct 2004 12:28:18 +0000 Subject: (fs_load_font): Use fast_string_match_ignore_case for comparing font names. (fs_query_fontset): Use fast_string_match for comparing fontset names. (list_fontsets): Likewise. --- src/ChangeLog | 12 ++++++++++++ src/fontset.c | 29 +++++++++++++---------------- 2 files changed, 25 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 270c2ce69e5..ab4c4cd67f1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,15 @@ +2004-10-18 Kenichi Handa + + * fontset.c (fs_load_font): Use fast_string_match_ignore_case for + comparing font names. + (fs_query_fontset): Use fast_string_match for comparing fontset + names. + (list_fontsets): Likewise. + + * search.c (fast_string_match_ignore_case): New function. + + * lisp.h (fast_string_match_ignore_case): Extern it. + 2004-10-17 Kim F. Storm * xdisp.c (overlay_arrow_at_row): Return overlay string rather diff --git a/src/fontset.c b/src/fontset.c index 1e64c753330..960b6fcb34b 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -654,7 +654,7 @@ fs_load_font (f, c, fontname, id, face) struct face *face; { Lisp_Object fontset; - Lisp_Object list, elt; + Lisp_Object list, elt, fullname; int size = 0; struct font_info *fontp; int charset = CHAR_CHARSET (c); @@ -700,10 +700,11 @@ fs_load_font (f, c, fontname, id, face) font_info structure that are not set by (*load_font_func). */ fontp->charset = charset; + fullname = build_string (fontp->full_name); fontp->vertical_centering = (STRINGP (Vvertical_centering_font_regexp) - && (fast_c_string_match_ignore_case - (Vvertical_centering_font_regexp, fontp->full_name) >= 0)); + && (fast_string_match_ignore_case + (Vvertical_centering_font_regexp, fullname) >= 0)); if (fontp->encoding[1] != FONT_ENCODING_NOT_DECIDED) { @@ -720,7 +721,6 @@ fs_load_font (f, c, fontname, id, face) /* The font itself doesn't have information about encoding. */ int i; - fontname = fontp->full_name; /* By default, encoding of ASCII chars is 0 (i.e. 0x00..0x7F), others is 1 (i.e. 0x80..0xFF). */ fontp->encoding[0] = 0; @@ -732,8 +732,7 @@ fs_load_font (f, c, fontname, id, face) elt = XCAR (list); if (CONSP (elt) && STRINGP (XCAR (elt)) && CONSP (XCDR (elt)) - && (fast_c_string_match_ignore_case (XCAR (elt), fontname) - >= 0)) + && (fast_string_match_ignore_case (XCAR (elt), fullname) >= 0)) { Lisp_Object tmp; @@ -847,18 +846,17 @@ fs_query_fontset (name, regexpp) for (i = 0; i < ASIZE (Vfontset_table); i++) { - Lisp_Object fontset; - const unsigned char *this_name; + Lisp_Object fontset, this_name; fontset = FONTSET_FROM_ID (i); if (NILP (fontset) || !BASE_FONTSET_P (fontset)) continue; - this_name = SDATA (FONTSET_NAME (fontset)); + this_name = FONTSET_NAME (fontset); if (regexpp - ? fast_c_string_match_ignore_case (name, this_name) >= 0 - : !strcmp (SDATA (name), this_name)) + ? fast_string_match (name, this_name) >= 0 + : !strcmp (SDATA (name), SDATA (this_name))) return i; } return -1; @@ -912,19 +910,18 @@ list_fontsets (f, pattern, size) for (id = 0; id < ASIZE (Vfontset_table); id++) { - Lisp_Object fontset; - const unsigned char *name; + Lisp_Object fontset, name; fontset = FONTSET_FROM_ID (id); if (NILP (fontset) || !BASE_FONTSET_P (fontset) || !EQ (frame, FONTSET_FRAME (fontset))) continue; - name = SDATA (FONTSET_NAME (fontset)); + name = FONTSET_NAME (fontset); if (!NILP (regexp) - ? (fast_c_string_match_ignore_case (regexp, name) < 0) - : strcmp (SDATA (pattern), name)) + ? (fast_string_match (regexp, name) < 0) + : strcmp (SDATA (pattern), SDATA (name))) continue; if (size) -- cgit v1.3 From 8433889043de2a6b8c2812d3a656991c2dd4e50a Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Mon, 18 Oct 2004 16:17:15 +0000 Subject: * gtkutil.c (xg_update_scrollbar_pos): Change XClearWindow to gdk_window_clear and move gdk_window_process_all_updates after clear so events are sent to the X server in correct order. --- src/ChangeLog | 6 ++++++ src/gtkutil.c | 9 ++++----- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index ab4c4cd67f1..7b22f043009 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2004-10-18 Jan Dj,Ad(Brv + + * gtkutil.c (xg_update_scrollbar_pos): Change XClearWindow to + gdk_window_clear and move gdk_window_process_all_updates after + clear so events are sent to the X server in correct order. + 2004-10-18 Kenichi Handa * fontset.c (fs_load_font): Use fast_string_match_ignore_case for diff --git a/src/gtkutil.c b/src/gtkutil.c index fabdae74dc6..4d166a4d01e 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -2888,9 +2888,6 @@ xg_update_scrollbar_pos (f, scrollbar_id, top, left, width, height, gtk_fixed_move (GTK_FIXED (wfixed), wscroll, left, top); gtk_widget_set_size_request (wscroll, width, height); - /* Must force out update so changed scroll bars gets redrawn. */ - gdk_window_process_all_updates (); - /* Scroll bars in GTK has a fixed width, so if we say width 16, it will only be its fixed width (14 is default) anyway, the rest is blank. We are drawing the mode line across scroll bars when @@ -2917,9 +2914,11 @@ xg_update_scrollbar_pos (f, scrollbar_id, top, left, width, height, scroll bar so that there is some space (typically 1 pixel) between the scroll bar and the edge of the window and between the scroll bar and the fringe. */ + gdk_window_clear (wscroll->window); - XClearWindow (FRAME_X_DISPLAY (f), GTK_WIDGET_TO_X_WIN (wscroll)); - + /* Must force out update so changed scroll bars gets redrawn. */ + gdk_window_process_all_updates (); + SET_FRAME_GARBAGED (f); cancel_mouse_face (f); } -- cgit v1.3 From e3e55463715754c2d3cdc64dddc9d08ab15e6455 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 18 Oct 2004 22:52:44 +0000 Subject: *** empty log message *** --- src/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 7b22f043009..d833be8e48c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-10-19 Kim F. Storm + + * xdisp.c (display_mode_element): Fix display of wide chars. + From Kenichi Handa . + 2004-10-18 Jan Dj,Ad(Brv * gtkutil.c (xg_update_scrollbar_pos): Change XClearWindow to -- cgit v1.3 From 7a6b6cce54820af5ab876fdbb253f8eecee37060 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 18 Oct 2004 22:53:13 +0000 Subject: (display_mode_element): Fix display of wide chars. From Kenichi Handa . --- src/xdisp.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/xdisp.c b/src/xdisp.c index dbce1c56368..306e26702f5 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -7976,7 +7976,7 @@ store_frame_title (str, field_width, precision) /* Copy at most PRECISION chars from STR. */ nbytes = strlen (str); - n+= c_string_width (str, nbytes, precision, &dummy, &nbytes); + n += c_string_width (str, nbytes, precision, &dummy, &nbytes); while (nbytes--) store_frame_title_char (*str++); @@ -15457,14 +15457,15 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) if (this - 1 != last) { + int nchars, nbytes; + /* Output to end of string or up to '%'. Field width is length of string. Don't output more than PRECISION allows us. */ --this; - prec = chars_in_text (last, this - last); - if (precision > 0 && prec > precision - n) - prec = precision - n; + prec = c_string_width (last, this - last, precision - n, + &nchars, &nbytes); if (frame_title_ptr) n += store_frame_title (last, 0, prec); @@ -15472,9 +15473,12 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) { int bytepos = last - lisp_string; int charpos = string_byte_to_char (elt, bytepos); + int endpos = (precision <= 0 ? SCHARS (elt) + : charpos + nchars); + n += store_mode_line_string (NULL, Fsubstring (elt, make_number (charpos), - make_number (charpos + prec)), + make_number (endpos)), 0, 0, 0, Qnil); } else -- cgit v1.3 From 1ca69aa4d3c3e4afcb0057ad496d55dd5fe7fcfe Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Tue, 19 Oct 2004 16:39:24 +0000 Subject: * gtkutil.h (xg_frame_cleared): Removed. --- src/gtkutil.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src') diff --git a/src/gtkutil.h b/src/gtkutil.h index b35ab94b2cb..c0055f361cc 100644 --- a/src/gtkutil.h +++ b/src/gtkutil.h @@ -168,9 +168,7 @@ extern void xg_update_scrollbar_pos P_ ((FRAME_PTR f, int top, int left, int width, - int height, - int real_left, - int canon_width)); + int height)); extern void xg_set_toolkit_scroll_bar_thumb P_ ((struct scroll_bar *bar, int portion, @@ -184,7 +182,6 @@ extern void free_frame_tool_bar P_ ((FRAME_PTR f)); extern void xg_resize_widgets P_ ((FRAME_PTR f, int pixelwidth, int pixelheight)); -extern void xg_frame_cleared P_ ((FRAME_PTR f)); extern void xg_frame_set_char_size P_ ((FRAME_PTR f, int cols, int rows)); extern GtkWidget * xg_win_to_widget P_ ((Display *dpy, Window wdesc)); -- cgit v1.3 From 1755a397946dfd7a01f3417501cfa3227769eb53 Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Tue, 19 Oct 2004 16:40:03 +0000 Subject: * gtkutil.c (xg_frame_cleared, xg_fixed_handle_expose, xg_find_top_left_in_fixed): Removed. (xg_create_scroll_bar): Put an event box widget between the scroll bar widget and the edit widget. (xg_show_scroll_bar): Show the parent widget (the event box). (xg_remove_scroll_bar): Destroy parent (the event box) also. (xg_update_scrollbar_pos): Remove arguments real_left and canon_width. Move the parent (the event box) widget inside the fixed widget. Move window clear to xterm.c. --- src/gtkutil.c | 160 ++++++++-------------------------------------------------- 1 file changed, 22 insertions(+), 138 deletions(-) (limited to 'src') diff --git a/src/gtkutil.c b/src/gtkutil.c index 4d166a4d01e..8182ff45766 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -550,24 +550,6 @@ xg_resize_outer_widget (f, columns, rows) gdk_window_process_all_updates (); } -/* This gets called after the frame F has been cleared. Since that is - done with X calls, we need to redraw GTK widget (scroll bars). */ -void -xg_frame_cleared (f) - FRAME_PTR f; -{ - GtkWidget *w = f->output_data.x->widget; - - if (w) - { - gtk_container_set_reallocate_redraws (GTK_CONTAINER (w), TRUE); - gtk_container_foreach (GTK_CONTAINER (w), - (GtkCallback) gtk_widget_queue_draw, - 0); - gdk_window_process_all_updates (); - } -} - /* Function to handle resize of our widgets. Since Emacs has some layouts that does not fit well with GTK standard containers, we do most layout manually. @@ -585,8 +567,10 @@ xg_resize_widgets (f, pixelwidth, pixelheight) int columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixelwidth); if (FRAME_GTK_WIDGET (f) - && (columns != FRAME_COLS (f) || rows != FRAME_LINES (f) - || pixelwidth != FRAME_PIXEL_WIDTH (f) || pixelheight != FRAME_PIXEL_HEIGHT (f))) + && (columns != FRAME_COLS (f) + || rows != FRAME_LINES (f) + || pixelwidth != FRAME_PIXEL_WIDTH (f) + || pixelheight != FRAME_PIXEL_HEIGHT (f))) { struct x_output *x = f->output_data.x; GtkAllocation all; @@ -681,54 +665,6 @@ xg_pix_to_gcolor (w, pixel, c) gdk_colormap_query_color (map, pixel, c); } -/* Turning off double buffering for our GtkFixed widget has the side - effect of turning it off also for its children (scroll bars). - But we want those to be double buffered to not flicker so handle - expose manually here. - WIDGET is the GtkFixed widget that gets exposed. - EVENT is the expose event. - USER_DATA is unused. - - Return TRUE to tell GTK that this expose event has been fully handeled - and that GTK shall do nothing more with it. */ -static gboolean -xg_fixed_handle_expose (GtkWidget *widget, - GdkEventExpose *event, - gpointer user_data) -{ - GList *iter; - - for (iter = GTK_FIXED (widget)->children; iter; iter = g_list_next (iter)) - { - GtkFixedChild *child_data = (GtkFixedChild *) iter->data; - GtkWidget *child = child_data->widget; - GdkWindow *window = child->window; - GdkRegion *region = gtk_widget_region_intersect (child, event->region); - - if (! gdk_region_empty (region)) - { - GdkEvent child_event; - child_event.expose = *event; - child_event.expose.region = region; - - /* Turn on double buffering, i.e. draw to an off screen area. */ - gdk_window_begin_paint_region (window, region); - - /* Tell child to redraw itself. */ - gdk_region_get_clipbox (region, &child_event.expose.area); - gtk_widget_send_expose (child, &child_event); - gdk_window_process_updates (window, TRUE); - - /* Copy off screen area to the window. */ - gdk_window_end_paint (window); - } - - gdk_region_destroy (region); - } - - return TRUE; -} - /* Create and set up the GTK widgets for frame F. Return 0 if creation failed, non-zero otherwise. */ int @@ -804,12 +740,6 @@ xg_create_frame_widgets (f) a lot, so we turn off double buffering. */ gtk_widget_set_double_buffered (wfixed, FALSE); - /* Turning off double buffering above has the side effect of turning - it off also for its children (scroll bars). But we want those - to be double buffered to not flicker so handle expose manually. */ - g_signal_connect (G_OBJECT (wfixed), "expose-event", - G_CALLBACK (xg_fixed_handle_expose), 0); - /* GTK documents says use gtk_window_set_resizable. But then a user can't shrink the window from its starting size. */ gtk_window_set_policy (GTK_WINDOW (wtop), TRUE, TRUE, TRUE); @@ -2770,6 +2700,7 @@ xg_create_scroll_bar (f, bar, scroll_callback, scroll_bar_name) char *scroll_bar_name; { GtkWidget *wscroll; + GtkWidget *webox; GtkObject *vadj; int scroll_id; @@ -2779,6 +2710,7 @@ xg_create_scroll_bar (f, bar, scroll_callback, scroll_bar_name) 0.1, 0.1, 0.1); wscroll = gtk_vscrollbar_new (GTK_ADJUSTMENT (vadj)); + webox = gtk_event_box_new (); gtk_widget_set_name (wscroll, scroll_bar_name); gtk_range_set_update_policy (GTK_RANGE (wscroll), GTK_UPDATE_CONTINUOUS); @@ -2804,11 +2736,18 @@ xg_create_scroll_bar (f, bar, scroll_callback, scroll_bar_name) G_CALLBACK (scroll_bar_button_cb), (gpointer) bar); - gtk_fixed_put (GTK_FIXED (f->output_data.x->edit_widget), - wscroll, -1, -1); + /* The scroll bar widget does not draw on a window of its own. Instead + it draws on the parent window, in this case the edit widget. So + whenever the edit widget is cleared, the scroll bar needs to redraw + also, which causes flicker. Put an event box between the edit widget + and the scroll bar, so the scroll bar instead draws itself on the + event box window. */ + gtk_fixed_put (GTK_FIXED (f->output_data.x->edit_widget), webox, -1, -1); + gtk_container_add (GTK_CONTAINER (webox), wscroll); + /* Set the cursor to an arrow. */ - xg_set_cursor (wscroll, FRAME_X_DISPLAY_INFO (f)->xg_cursor); + xg_set_cursor (webox, FRAME_X_DISPLAY_INFO (f)->xg_cursor); SET_SCROLL_BAR_X_WINDOW (bar, scroll_id); } @@ -2820,7 +2759,7 @@ xg_show_scroll_bar (scrollbar_id) { GtkWidget *w = xg_get_widget_from_map (scrollbar_id); if (w) - gtk_widget_show (w); + gtk_widget_show_all (gtk_widget_get_parent (w)); } /* Remove the scroll bar represented by SCROLLBAR_ID from the frame F. */ @@ -2832,42 +2771,19 @@ xg_remove_scroll_bar (f, scrollbar_id) GtkWidget *w = xg_get_widget_from_map (scrollbar_id); if (w) { + GtkWidget *wparent = gtk_widget_get_parent (w); gtk_widget_destroy (w); + gtk_widget_destroy (wparent); SET_FRAME_GARBAGED (f); } } -/* Find left/top for widget W in GtkFixed widget WFIXED. */ -static void -xg_find_top_left_in_fixed (w, wfixed, left, top) - GtkWidget *w, *wfixed; - int *left, *top; -{ - GList *iter; - - for (iter = GTK_FIXED (wfixed)->children; iter; iter = g_list_next (iter)) - { - GtkFixedChild *child = (GtkFixedChild *) iter->data; - - if (child->widget == w) - { - *left = child->x; - *top = child->y; - return; - } - } - - /* Shall never end up here. */ - abort (); -} - /* Update the position of the vertical scroll bar represented by SCROLLBAR_ID in frame F. TOP/LEFT are the new pixel positions where the bar shall appear. WIDTH, HEIGHT is the size in pixels the bar shall have. */ void -xg_update_scrollbar_pos (f, scrollbar_id, top, left, width, height, - real_left, canon_width) +xg_update_scrollbar_pos (f, scrollbar_id, top, left, width, height) FRAME_PTR f; int scrollbar_id; int top; @@ -2881,44 +2797,12 @@ xg_update_scrollbar_pos (f, scrollbar_id, top, left, width, height, if (wscroll) { GtkWidget *wfixed = f->output_data.x->edit_widget; - - gtk_container_set_reallocate_redraws (GTK_CONTAINER (wfixed), TRUE); + GtkWidget *wparent = gtk_widget_get_parent (wscroll); /* Move and resize to new values. */ - gtk_fixed_move (GTK_FIXED (wfixed), wscroll, left, top); gtk_widget_set_size_request (wscroll, width, height); + gtk_fixed_move (GTK_FIXED (wfixed), wparent, left, top); - /* Scroll bars in GTK has a fixed width, so if we say width 16, it - will only be its fixed width (14 is default) anyway, the rest is - blank. We are drawing the mode line across scroll bars when - the frame is split: - |bar| |fringe| - ---------------- - mode line - ---------------- - |bar| |fringe| - - When we "unsplit" the frame: - - |bar| |fringe| - -| |-| | - m¦ |i| | - -| |-| | - | | | | - - - the remains of the mode line can be seen in these blank spaces. - So we must clear them explicitly. - GTK scroll bars should do that, but they don't. - Also, the canonical width may be wider than the width for the - scroll bar so that there is some space (typically 1 pixel) between - the scroll bar and the edge of the window and between the scroll - bar and the fringe. */ - gdk_window_clear (wscroll->window); - - /* Must force out update so changed scroll bars gets redrawn. */ - gdk_window_process_all_updates (); - SET_FRAME_GARBAGED (f); cancel_mouse_face (f); } -- cgit v1.3 From 6bd8015d00acd19c07570d01c15d8864bd6cf6c1 Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Tue, 19 Oct 2004 16:40:34 +0000 Subject: * xterm.c (x_clear_frame): Remove call to xg_frame_cleared (x_scroll_bar_create, XTset_vertical_scroll_bar): Remove arguments left and width to xg_update_scrollbar_pos. (XTset_vertical_scroll_bar): Do x_clear_area for USE_GTK also. --- src/xterm.c | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/xterm.c b/src/xterm.c index 8aa52b658c8..41b7c18e820 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -2823,10 +2823,6 @@ x_clear_frame () XFlush (FRAME_X_DISPLAY (f)); -#ifdef USE_GTK - xg_frame_cleared (f); -#endif - UNBLOCK_INPUT; } @@ -4861,9 +4857,7 @@ x_scroll_bar_create (w, top, left, width, height) top, left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2, - max (height, 1), - left, - width); + max (height, 1)); xg_show_scroll_bar (SCROLL_BAR_X_WINDOW (bar)); #else /* not USE_GTK */ Widget scroll_bar = SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar); @@ -5107,18 +5101,6 @@ XTset_vertical_scroll_bar (w, portion, whole, position) #ifdef USE_TOOLKIT_SCROLL_BARS -#ifdef USE_GTK - if (mask) - xg_update_scrollbar_pos (f, - SCROLL_BAR_X_WINDOW (bar), - top, - sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, - sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2, - max (height, 1), - left, - width); -#else /* not USE_GTK */ - /* Move/size the scroll bar widget. */ if (mask) { @@ -5127,13 +5109,21 @@ XTset_vertical_scroll_bar (w, portion, whole, position) if (width > 0 && height > 0) x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), left, top, width, height, False); +#ifdef USE_GTK + xg_update_scrollbar_pos (f, + SCROLL_BAR_X_WINDOW (bar), + top, + sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, + sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM *2, + max (height, 1)); +#else /* not USE_GTK */ XtConfigureWidget (SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar), sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, top, sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2, max (height, 1), 0); - } #endif /* not USE_GTK */ + } #else /* not USE_TOOLKIT_SCROLL_BARS */ /* Clear areas not covered by the scroll bar because of -- cgit v1.3 From 08dedea656abbecfc80e8de68645da32edca0533 Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Tue, 19 Oct 2004 16:41:04 +0000 Subject: * gtkutil.h (xg_update_scrollbar_pos): Remove arguments real_left and canon_width. (xg_frame_cleared): Removed. * gtkutil.c (xg_frame_cleared, xg_fixed_handle_expose, xg_find_top_left_in_fixed): Removed. (xg_create_scroll_bar): Put an event box widget between the scroll bar widget and the edit widget. (xg_show_scroll_bar): Show the parent widget (the event box). (xg_remove_scroll_bar): Destroy parent (the event box) also. (xg_update_scrollbar_pos): Remove arguments real_left and canon_width. Move the parent (the event box) widget inside the fixed widget. Move window clear to xterm.c. * gtkutil.h (xg_frame_cleared): Removed. * xterm.c (x_clear_frame): Remove call to xg_frame_cleared (x_scroll_bar_create, XTset_vertical_scroll_bar): Remove arguments left and width to xg_update_scrollbar_pos. (XTset_vertical_scroll_bar): Do x_clear_area for USE_GTK also. --- src/ChangeLog | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index d833be8e48c..a5d67cfbf95 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,26 @@ +2004-10-19 Jan Dj,Ad(Brv + + * gtkutil.h (xg_update_scrollbar_pos): Remove arguments real_left + and canon_width. + (xg_frame_cleared): Removed. + + * gtkutil.c (xg_frame_cleared, xg_fixed_handle_expose, + xg_find_top_left_in_fixed): Removed. + (xg_create_scroll_bar): Put an event box widget between + the scroll bar widget and the edit widget. + (xg_show_scroll_bar): Show the parent widget (the event box). + (xg_remove_scroll_bar): Destroy parent (the event box) also. + (xg_update_scrollbar_pos): Remove arguments real_left and canon_width. + Move the parent (the event box) widget inside the fixed widget. + Move window clear to xterm.c. + + * gtkutil.h (xg_frame_cleared): Removed. + + * xterm.c (x_clear_frame): Remove call to xg_frame_cleared + (x_scroll_bar_create, XTset_vertical_scroll_bar): Remove + arguments left and width to xg_update_scrollbar_pos. + (XTset_vertical_scroll_bar): Do x_clear_area for USE_GTK also. + 2004-10-19 Kim F. Storm * xdisp.c (display_mode_element): Fix display of wide chars. -- cgit v1.3 From 8550b998e80fbd6adf76671deed2e176d826ccf9 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 19 Oct 2004 16:58:30 +0000 Subject: (Fdelete_and_extract_region): If region is empty, return null string. --- lisp/ChangeLog | 14 ++++++++++++++ src/ChangeLog | 11 +++++++---- src/editfns.c | 2 ++ 3 files changed, 23 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 070bcaab658..902a5e2ac2a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,17 @@ +2004-10-19 Richard M. Stallman + + * textmodes/flyspell.el (flyspell-mode): Doc fix. + + * eshell/em-unix.el (eshell-grep): + Don't bind compilation-process-setup-function. + + * comint.el (comint-insert-input): Use @ in `interactive'. + (comint-input-filter-functions): Doc fix. + (comint-kill-whole-line, comint-get-source): Doc fix. + + * progmodes/compile.el (compilation-setup): + Don't set buffer-read-only if MINOR is non-nil. + 2004-10-19 Ulf Jasper * calendar/icalendar.el: Set coding to utf-8. diff --git a/src/ChangeLog b/src/ChangeLog index a5d67cfbf95..5b22d072cf7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-10-19 Richard M. Stallman + + * editfns.c (Fdelete_and_extract_region): + If region is empty, return null string. + 2004-10-19 Jan Dj,Ad(Brv * gtkutil.h (xg_update_scrollbar_pos): Remove arguments real_left @@ -21,10 +26,9 @@ arguments left and width to xg_update_scrollbar_pos. (XTset_vertical_scroll_bar): Do x_clear_area for USE_GTK also. -2004-10-19 Kim F. Storm +2004-10-19 Kenichi Handa * xdisp.c (display_mode_element): Fix display of wide chars. - From Kenichi Handa . 2004-10-18 Jan Dj,Ad(Brv @@ -36,8 +40,7 @@ * fontset.c (fs_load_font): Use fast_string_match_ignore_case for comparing font names. - (fs_query_fontset): Use fast_string_match for comparing fontset - names. + (fs_query_fontset): Use fast_string_match for comparing fontset names. (list_fontsets): Likewise. * search.c (fast_string_match_ignore_case): New function. diff --git a/src/editfns.c b/src/editfns.c index 51f8a71d531..2870c59884a 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -2844,6 +2844,8 @@ DEFUN ("delete-and-extract-region", Fdelete_and_extract_region, Lisp_Object start, end; { validate_region (&start, &end); + if (XINT (start) == XINT (end)) + return build_string (""); return del_range_1 (XINT (start), XINT (end), 1, 1); } -- cgit v1.3 From 950090be0679d07beafa4eeb5d65b8e92be08a36 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Tue, 19 Oct 2004 19:09:37 +0000 Subject: (init_environment): Set emacs_dir correctly when running emacs from the build directory. --- src/ChangeLog | 5 +++++ src/w32.c | 26 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 5b22d072cf7..750e3d52df3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-10-19 Jason Rumney + + * w32.c (init_environment): Set emacs_dir correctly when running + emacs from the build directory. + 2004-10-19 Richard M. Stallman * editfns.c (Fdelete_and_extract_region): diff --git a/src/w32.c b/src/w32.c index 12d1f21b091..7b54924d736 100644 --- a/src/w32.c +++ b/src/w32.c @@ -1005,6 +1005,32 @@ init_environment (char ** argv) _snprintf (buf, sizeof(buf)-1, "emacs_dir=%s", modname); _putenv (strdup (buf)); } + /* Handle running emacs from the build directory: src/oo-spd/i386/ */ + + /* FIXME: should use substring of get_emacs_configuration (). + But I don't think the Windows build supports alpha, mips etc + anymore, so have taken the easy option for now. */ + else if (p && stricmp (p, "\\i386") == 0) + { + *p = 0; + p = strrchr (modname, '\\'); + if (p != NULL) + { + *p = 0; + p = strrchr (modname, '\\'); + if (p && stricmp (p, "\\src") == 0) + { + char buf[SET_ENV_BUF_SIZE]; + + *p = 0; + for (p = modname; *p; p++) + if (*p == '\\') *p = '/'; + + _snprintf (buf, sizeof(buf)-1, "emacs_dir=%s", modname); + _putenv (strdup (buf)); + } + } + } } for (i = 0; i < (sizeof (env_vars) / sizeof (env_vars[0])); i++) -- cgit v1.3 From 1dc5ba01509cfec9d1fbf0c161a5c88aa275aa77 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Wed, 20 Oct 2004 02:20:44 +0000 Subject: (Flocal_variable_if_set_p): Doc fix. --- src/ChangeLog | 8 ++++++-- src/data.c | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 750e3d52df3..5260196d5cd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2004-10-19 Luc Teirlinck + + * data.c (Flocal_variable_if_set_p): Doc fix. + 2004-10-19 Jason Rumney * w32.c (init_environment): Set emacs_dir correctly when running @@ -10,7 +14,7 @@ 2004-10-19 Jan Dj,Ad(Brv - * gtkutil.h (xg_update_scrollbar_pos): Remove arguments real_left + * gtkutil.h (xg_update_scrollbar_pos): Remove arguments real_left and canon_width. (xg_frame_cleared): Removed. @@ -25,7 +29,7 @@ Move window clear to xterm.c. * gtkutil.h (xg_frame_cleared): Removed. - + * xterm.c (x_clear_frame): Remove call to xg_frame_cleared (x_scroll_bar_create, XTset_vertical_scroll_bar): Remove arguments left and width to xg_update_scrollbar_pos. diff --git a/src/data.c b/src/data.c index 616e91c2d62..33b37376a49 100644 --- a/src/data.c +++ b/src/data.c @@ -1794,7 +1794,11 @@ BUFFER defaults to the current buffer. */) DEFUN ("local-variable-if-set-p", Flocal_variable_if_set_p, Slocal_variable_if_set_p, 1, 2, 0, - doc: /* Non-nil if VARIABLE will be local in buffer BUFFER if it is set there. + doc: /* Non-nil if VARIABLE will be local in buffer BUFFER when set there. +More precisely, this means that setting the variable \(with `set' or`setq'), +while it does not have a `let'-style binding that was made in BUFFER, +will produce a buffer local binding. See Info node +`(elisp)Creating Buffer-Local'. BUFFER defaults to the current buffer. */) (variable, buffer) register Lisp_Object variable, buffer; -- cgit v1.3 From dede27921696e4e940c93fa7335066864c93ccfd Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Wed, 20 Oct 2004 16:23:30 +0000 Subject: * emacs.c (my_heap_start, heap_bss_diff, MAX_HEAP_BSS_DIFF): New variables and constant. (main): Calculate heap_bss_diff. If we are dumping and the heap_bss_diff is greater than MAX_HEAP_BSS_DIFF, set PER_LINUX32 and exec ourself again. (Fdump_emacs): If heap_bss_diff is greater than MAX_HEAP_BSS_DIFF print a warning. * lastfile.c: Make my_endbss and my_endbss_static available on all platforms. * Makefile.in (RUN_TEMACS): Remove @SETARCH@. * config.in (HAVE_PERSONALITY_LINUX32): Regenerate. --- src/ChangeLog | 16 ++++++++++++++ src/Makefile.in | 5 ----- src/config.in | 12 +++++------ src/emacs.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- src/lastfile.c | 2 -- 5 files changed, 86 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 5260196d5cd..f1cdd38152d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,19 @@ +2004-10-20 Jan Dj,Ad(Brv + + * emacs.c (my_heap_start, heap_bss_diff, MAX_HEAP_BSS_DIFF): + New variables and constant. + (main): Calculate heap_bss_diff. If we are dumping and the + heap_bss_diff is greater than MAX_HEAP_BSS_DIFF, set PER_LINUX32 + and exec ourself again. + (Fdump_emacs): If heap_bss_diff is greater than MAX_HEAP_BSS_DIFF + print a warning. + + * lastfile.c: Make my_endbss and my_endbss_static available on all + platforms. + + * Makefile.in (RUN_TEMACS): Remove @SETARCH@. + * config.in (HAVE_PERSONALITY_LINUX32): Regenerate. + 2004-10-19 Luc Teirlinck * data.c (Flocal_variable_if_set_p): Doc fix. diff --git a/src/Makefile.in b/src/Makefile.in index f25e0f9d842..deb33730644 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -905,12 +905,7 @@ LIBES = $(LOADLIBES) $(LIBS) $(LIBX) $(LIBSOUND) \ #define OBJECTS_MACHINE #endif -#ifdef HAVE_RANDOM_HEAPSTART -#undef i386 -RUN_TEMACS = @SETARCH@ i386 ./temacs -#else RUN_TEMACS = ./temacs -#endif all: emacs${EXEEXT} OTHER_FILES diff --git a/src/config.in b/src/config.in index 49095ca4e5a..136f4ecd55d 100644 --- a/src/config.in +++ b/src/config.in @@ -414,6 +414,9 @@ Boston, MA 02111-1307, USA. */ /* Define to 1 if you have the header file. */ #undef HAVE_NLIST_H +/* Define to 1 if personality LINUX32 can be set. */ +#undef HAVE_PERSONALITY_LINUX32 + /* Define to 1 if you have the png library (-lpng). */ #undef HAVE_PNG @@ -432,9 +435,6 @@ Boston, MA 02111-1307, USA. */ /* Define to 1 if you have the `random' function. */ #undef HAVE_RANDOM -/* Define to 1 if this OS randomizes the start address of the heap. */ -#undef HAVE_RANDOM_HEAPSTART - /* Define to 1 if you have the `recvfrom' function. */ #undef HAVE_RECVFROM @@ -757,9 +757,9 @@ Boston, MA 02111-1307, USA. */ /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown */ + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if you have the ANSI C header files. */ diff --git a/src/emacs.c b/src/emacs.c index 6ecfdbd4231..bb601ea8643 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -67,6 +67,10 @@ Boston, MA 02111-1307, USA. */ #include #endif +#ifdef HAVE_PERSONALITY_LINUX32 +#include +#endif + #ifndef O_RDWR #define O_RDWR 2 #endif @@ -192,6 +196,17 @@ int display_arg; Tells GC how to save a copy of the stack. */ char *stack_bottom; +/* The address where the heap starts (from the first sbrk (0) call). */ +static void *my_heap_start; + +/* The gap between BSS end and heap start as far as we can tell. */ +static unsigned long heap_bss_diff; + +/* If the gap between BSS end and heap start is larger than this we try to + work around it, and if that fails, output a warning in dump-emacs. */ +#define MAX_HEAP_BSS_DIFF (1024*1024) + + #ifdef HAVE_WINDOW_SYSTEM extern Lisp_Object Vwindow_system; #endif /* HAVE_WINDOW_SYSTEM */ @@ -733,7 +748,11 @@ malloc_initialize_hook () free (malloc_state_ptr); } else - malloc_using_checking = getenv ("MALLOC_CHECK_") != NULL; + { + if (my_heap_start == 0) + my_heap_start = sbrk (0); + malloc_using_checking = getenv ("MALLOC_CHECK_") != NULL; + } } void (*__malloc_initialize_hook) () = malloc_initialize_hook; @@ -809,6 +828,17 @@ main (argc, argv stack_base = &dummy; #endif + if (!initialized) + { + extern char my_endbss[]; + extern char *my_endbss_static; + + if (my_heap_start == 0) + my_heap_start = sbrk (0); + + heap_bss_diff = (char *)my_heap_start - max (my_endbss, my_endbss_static); + } + #ifdef LINUX_SBRK_BUG __sbrk (1); #endif @@ -852,6 +882,28 @@ main (argc, argv } } +#ifdef HAVE_PERSONALITY_LINUX32 + /* See if there is a gap between the end of BSS and the heap. + In that case, set personality and exec ourself again. */ + if (!initialized + && (strcmp (argv[argc-1], "dump") == 0 + || strcmp (argv[argc-1], "bootstrap") == 0) + && heap_bss_diff > MAX_HEAP_BSS_DIFF) + { + if (! getenv ("EMACS_HEAP_EXEC")) + { + /* Set this so we only do this once. */ + putenv("EMACS_HEAP_EXEC=true"); + personality (PER_LINUX32); + execvp (argv[0], argv); + + /* If the exec fails, try to dump anyway. */ + perror ("execvp"); + } + } +#endif /* HAVE_PERSONALITY_LINUX32 */ + + /* Map in shared memory, if we are using that. */ #ifdef HAVE_SHM if (argmatch (argv, argc, "-nl", "--no-shared-memory", 6, NULL, &skip_args)) @@ -2130,6 +2182,17 @@ You must run Emacs in batch mode in order to dump it. */) if (! noninteractive) error ("Dumping Emacs works only in batch mode"); + if (heap_bss_diff > MAX_HEAP_BSS_DIFF) + { + fprintf (stderr, "**************************************************\n"); + fprintf (stderr, "Warning: Your system has a gap between BSS and the\n"); + fprintf (stderr, "heap. This usually means that exec-shield or\n"); + fprintf (stderr, "something similar is in effect. The dump may fail\n"); + fprintf (stderr, "because of this. See the section about exec-shield\n"); + fprintf (stderr, "in etc/PROBLEMS for more information.\n"); + fprintf (stderr, "**************************************************\n"); + } + /* Bind `command-line-processed' to nil before dumping, so that the dumped Emacs will process its command line and set up to work with X windows if appropriate. */ diff --git a/src/lastfile.c b/src/lastfile.c index df678b42876..d6292e30040 100644 --- a/src/lastfile.c +++ b/src/lastfile.c @@ -40,7 +40,6 @@ Boston, MA 02111-1307, USA. */ char my_edata[] = "End of Emacs initialized data"; -#if defined(WINDOWSNT) || defined(CYGWIN) /* Help unexec locate the end of the .bss area used by Emacs (which isn't always a separate section in NT executables). */ char my_endbss[1]; @@ -50,7 +49,6 @@ char my_endbss[1]; of the bss area used by Emacs. */ static char _my_endbss[1]; char * my_endbss_static = _my_endbss; -#endif /* arch-tag: 67e81ab4-e14f-44b2-8875-c0c12252223e (do not change this comment) */ -- cgit v1.3 From 3aca2078081c657fc7937c0ae78ccd6a6449c2c6 Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Wed, 20 Oct 2004 16:53:27 +0000 Subject: * xterm.h (XSync): If USE_GTK, define XSync as process_all and then XSync. --- src/ChangeLog | 3 +++ src/xterm.h | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index f1cdd38152d..1083c4b488b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2004-10-20 Jan Dj,Ad(Brv + * xterm.h (XSync): If USE_GTK, define XSync as process_all and then + XSync. + * emacs.c (my_heap_start, heap_bss_diff, MAX_HEAP_BSS_DIFF): New variables and constant. (main): Calculate heap_bss_diff. If we are dumping and the diff --git a/src/xterm.h b/src/xterm.h index d3f5cee1277..f0e2f3521bb 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -50,7 +50,9 @@ typedef Widget xt_or_gtk_widget; typedef GtkWidget *xt_or_gtk_widget; #define XtParent(x) (gtk_widget_get_parent (x)) #undef XSync -#define XSync(d, b) gdk_window_process_all_updates () +#define XSync(d, b) do { gdk_window_process_all_updates (); \ + XSync (d, b); } while (0) + #endif /* USE_GTK */ -- cgit v1.3 From 5950869993180c993b4c011edd77f919f6b4e8a9 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Wed, 20 Oct 2004 20:09:10 +0000 Subject: (x_draw_glyph_string): Use overline_color for overlines. --- src/ChangeLog | 4 ++++ src/w32term.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 1083c4b488b..c5e12b4edb0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2004-10-20 B. Anyos (tiny change) + + * w32term.c (x_draw_glyph_string): Use overline_color for overlines. + 2004-10-20 Jan Dj,Ad(Brv * xterm.h (XSync): If USE_GTK, define XSync as process_all and then diff --git a/src/w32term.c b/src/w32term.c index 0aa782da20d..3e2e566adc5 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -2516,7 +2516,7 @@ x_draw_glyph_string (s) } else { - w32_fill_area (s->f, s->hdc, s->face->underline_color, s->x, + w32_fill_area (s->f, s->hdc, s->face->overline_color, s->x, s->y + dy, s->width, h); } } -- cgit v1.3 From c27ed90af576892cae147bfe6be1a8b43126102a Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Thu, 21 Oct 2004 18:38:58 +0000 Subject: * xterm.h (x_output): New member `xic_base_fontname'. (FRAME_XIC_BASE_FONTNAME): New macro. (xic_free_xfontset): Declare. * xfns.c (xic_create_xfontset): Share fontsets between frames based on base_fontname. (xic_free_xfontset): New function. (free_frame_xic): Use it. (xic_set_xfontset): Ditto. * xterm.c (xim_destroy_callback): Ditto. --- src/ChangeLog | 15 ++++++++++++ src/xfns.c | 76 +++++++++++++++++++++++++++++++++++++++++++++++++---------- src/xterm.c | 6 +---- src/xterm.h | 3 +++ 4 files changed, 83 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index c5e12b4edb0..efb792df4d6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,18 @@ +2004-10-21 K,Aa(Broly L$,1 q(Brentey + + * xterm.h (x_output): New member `xic_base_fontname'. + (FRAME_XIC_BASE_FONTNAME): New macro. + (xic_free_xfontset): Declare. + + * xfns.c (xic_create_xfontset): Share fontsets between frames + based on base_fontname. + (xic_free_xfontset): New function. + (free_frame_xic): Use it. + (xic_set_xfontset): Ditto. + + * xterm.c (xim_destroy_callback): Ditto. + + 2004-10-20 B. Anyos (tiny change) * w32term.c (x_draw_glyph_string): Use overline_color for overlines. diff --git a/src/xfns.c b/src/xfns.c index de95a59112a..8d539472d11 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -1941,29 +1941,83 @@ static XIMStyle supported_xim_styles[] = }; -/* Create an X fontset on frame F with base font name - BASE_FONTNAME.. */ +/* Create an X fontset on frame F with base font name BASE_FONTNAME. */ static XFontSet xic_create_xfontset (f, base_fontname) struct frame *f; char *base_fontname; { - XFontSet xfs; + XFontSet xfs = NULL; char **missing_list; int missing_count; char *def_string; + Lisp_Object rest, frame; + + /* See if there is another frame already using same fontset. */ + FOR_EACH_FRAME (rest, frame) + { + struct frame *cf = XFRAME (frame); + if (cf != f && FRAME_LIVE_P (f) && FRAME_X_P (cf) + && FRAME_X_DISPLAY_INFO (cf) == FRAME_X_DISPLAY_INFO (f) + && !strcmp (FRAME_XIC_BASE_FONTNAME (cf), base_fontname)) + { + xfs = FRAME_XIC_FONTSET (cf); + break; + } + } - xfs = XCreateFontSet (FRAME_X_DISPLAY (f), - base_fontname, &missing_list, - &missing_count, &def_string); + if (!xfs) + /* New fontset. */ + xfs = XCreateFontSet (FRAME_X_DISPLAY (f), + base_fontname, &missing_list, + &missing_count, &def_string); if (missing_list) XFreeStringList (missing_list); - /* No need to free def_string. */ + if (FRAME_XIC_BASE_FONTNAME (f)) + xfree (FRAME_XIC_BASE_FONTNAME (f)); + FRAME_XIC_BASE_FONTNAME (f) = xstrdup (base_fontname); + + /* No need to free def_string. */ return xfs; } +/* Free the X fontset of frame F if it is the last frame using it. */ + +void +xic_free_xfontset (f) + struct frame *f; +{ + Lisp_Object rest, frame; + int shared_p = 0; + + if (!FRAME_XIC_FONTSET (f)) + return; + + /* See if there is another frame sharing the same fontset. */ + FOR_EACH_FRAME (rest, frame) + { + struct frame *cf = XFRAME (frame); + if (cf != f && FRAME_LIVE_P (f) && FRAME_X_P (cf) + && FRAME_X_DISPLAY_INFO (cf) == FRAME_X_DISPLAY_INFO (f) + && FRAME_XIC_FONTSET (cf) == FRAME_XIC_FONTSET (f)) + { + shared_p = 1; + break; + } + } + + if (!shared_p) + /* The fontset is not used anymore. It is safe to free it. */ + XFreeFontSet (FRAME_X_DISPLAY (f), FRAME_XIC_FONTSET (f)); + + if (FRAME_XIC_BASE_FONTNAME (f)) + xfree (FRAME_XIC_BASE_FONTNAME (f)); + FRAME_XIC_BASE_FONTNAME (f) = NULL; + FRAME_XIC_FONTSET (f) = NULL; +} + /* Value is the best input style, given user preferences USER (already checked to be supported by Emacs), and styles supported by the @@ -2114,11 +2168,9 @@ free_frame_xic (f) return; XDestroyIC (FRAME_XIC (f)); - if (FRAME_XIC_FONTSET (f)) - XFreeFontSet (FRAME_X_DISPLAY (f), FRAME_XIC_FONTSET (f)); + xic_free_xfontset (f); FRAME_XIC (f) = NULL; - FRAME_XIC_FONTSET (f) = NULL; } @@ -2197,6 +2249,8 @@ xic_set_xfontset (f, base_fontname) XVaNestedList attr; XFontSet xfs; + xic_free_xfontset (f); + xfs = xic_create_xfontset (f, base_fontname); attr = XVaCreateNestedList (0, XNFontSet, xfs, NULL); @@ -2206,8 +2260,6 @@ xic_set_xfontset (f, base_fontname) XSetICValues (FRAME_XIC (f), XNStatusAttributes, attr, NULL); XFree (attr); - if (FRAME_XIC_FONTSET (f)) - XFreeFontSet (FRAME_X_DISPLAY (f), FRAME_XIC_FONTSET (f)); FRAME_XIC_FONTSET (f) = xfs; } diff --git a/src/xterm.c b/src/xterm.c index 41b7c18e820..54ee4014e8c 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -8012,11 +8012,7 @@ xim_destroy_callback (xim, client_data, call_data) if (FRAME_X_DISPLAY_INFO (f) == dpyinfo) { FRAME_XIC (f) = NULL; - if (FRAME_XIC_FONTSET (f)) - { - XFreeFontSet (FRAME_X_DISPLAY (f), FRAME_XIC_FONTSET (f)); - FRAME_XIC_FONTSET (f) = NULL; - } + xic_free_xfontset (f); } } diff --git a/src/xterm.h b/src/xterm.h index f0e2f3521bb..7ec690d2e24 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -600,6 +600,7 @@ struct x_output XIC xic; XIMStyle xic_style; XFontSet xic_xfs; + char *xic_base_fontname; #endif /* Relief GCs, colors etc. */ @@ -734,6 +735,7 @@ enum #define FRAME_X_XIM_STYLES(f) (FRAME_X_DISPLAY_INFO (f)->xim_styles) #define FRAME_XIC_STYLE(f) ((f)->output_data.x->xic_style) #define FRAME_XIC_FONTSET(f) ((f)->output_data.x->xic_xfs) +#define FRAME_XIC_BASE_FONTNAME(f) ((f)->output_data.x->xic_base_fontname) /* Value is the smallest width of any character in any font on frame F. */ @@ -1043,6 +1045,7 @@ extern void x_set_menu_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object)) extern unsigned char * x_encode_text P_ ((Lisp_Object, Lisp_Object, int, int *, int *)); extern void x_implicitly_set_name P_ ((struct frame *, Lisp_Object, Lisp_Object)); +extern void xic_free_xfontset P_ ((struct frame *)); extern void create_frame_xic P_ ((struct frame *)); extern void destroy_frame_xic P_ ((struct frame *)); extern void xic_set_preeditarea P_ ((struct window *, int, int)); -- cgit v1.3