aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog131
-rw-r--r--src/Makefile.in5
-rw-r--r--src/config.in12
-rw-r--r--src/data.c6
-rw-r--r--src/doc.c16
-rw-r--r--src/editfns.c2
-rw-r--r--src/emacs.c65
-rw-r--r--src/fontset.c18
-rw-r--r--src/gtkutil.c161
-rw-r--r--src/gtkutil.h5
-rw-r--r--src/lastfile.c2
-rw-r--r--src/lisp.h1
-rw-r--r--src/m/ia64.h2
-rw-r--r--src/search.c21
-rw-r--r--src/w32.c26
-rw-r--r--src/w32fns.c10
-rw-r--r--src/w32term.c14
-rw-r--r--src/window.c11
-rw-r--r--src/xdisp.c46
-rw-r--r--src/xfns.c76
-rw-r--r--src/xterm.c36
-rw-r--r--src/xterm.h12
22 files changed, 417 insertions, 261 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 9fedb52f42c..efb792df4d6 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,7 +1,136 @@
12004-10-21 K,Aa(Broly L$,1 q(Brentey <lorentey@elte.hu>
2
3 * xterm.h (x_output): New member `xic_base_fontname'.
4 (FRAME_XIC_BASE_FONTNAME): New macro.
5 (xic_free_xfontset): Declare.
6
7 * xfns.c (xic_create_xfontset): Share fontsets between frames
8 based on base_fontname.
9 (xic_free_xfontset): New function.
10 (free_frame_xic): Use it.
11 (xic_set_xfontset): Ditto.
12
13 * xterm.c (xim_destroy_callback): Ditto.
14
15
162004-10-20 B. Anyos <banyos@freemail.hu> (tiny change)
17
18 * w32term.c (x_draw_glyph_string): Use overline_color for overlines.
19
202004-10-20 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
21
22 * xterm.h (XSync): If USE_GTK, define XSync as process_all and then
23 XSync.
24
25 * emacs.c (my_heap_start, heap_bss_diff, MAX_HEAP_BSS_DIFF):
26 New variables and constant.
27 (main): Calculate heap_bss_diff. If we are dumping and the
28 heap_bss_diff is greater than MAX_HEAP_BSS_DIFF, set PER_LINUX32
29 and exec ourself again.
30 (Fdump_emacs): If heap_bss_diff is greater than MAX_HEAP_BSS_DIFF
31 print a warning.
32
33 * lastfile.c: Make my_endbss and my_endbss_static available on all
34 platforms.
35
36 * Makefile.in (RUN_TEMACS): Remove @SETARCH@.
37 * config.in (HAVE_PERSONALITY_LINUX32): Regenerate.
38
392004-10-19 Luc Teirlinck <teirllm@auburn.edu>
40
41 * data.c (Flocal_variable_if_set_p): Doc fix.
42
432004-10-19 Jason Rumney <jasonr@gnu.org>
44
45 * w32.c (init_environment): Set emacs_dir correctly when running
46 emacs from the build directory.
47
482004-10-19 Richard M. Stallman <rms@gnu.org>
49
50 * editfns.c (Fdelete_and_extract_region):
51 If region is empty, return null string.
52
532004-10-19 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
54
55 * gtkutil.h (xg_update_scrollbar_pos): Remove arguments real_left
56 and canon_width.
57 (xg_frame_cleared): Removed.
58
59 * gtkutil.c (xg_frame_cleared, xg_fixed_handle_expose,
60 xg_find_top_left_in_fixed): Removed.
61 (xg_create_scroll_bar): Put an event box widget between
62 the scroll bar widget and the edit widget.
63 (xg_show_scroll_bar): Show the parent widget (the event box).
64 (xg_remove_scroll_bar): Destroy parent (the event box) also.
65 (xg_update_scrollbar_pos): Remove arguments real_left and canon_width.
66 Move the parent (the event box) widget inside the fixed widget.
67 Move window clear to xterm.c.
68
69 * gtkutil.h (xg_frame_cleared): Removed.
70
71 * xterm.c (x_clear_frame): Remove call to xg_frame_cleared
72 (x_scroll_bar_create, XTset_vertical_scroll_bar): Remove
73 arguments left and width to xg_update_scrollbar_pos.
74 (XTset_vertical_scroll_bar): Do x_clear_area for USE_GTK also.
75
762004-10-19 Kenichi Handa <handa@m17n.org>
77
78 * xdisp.c (display_mode_element): Fix display of wide chars.
79
802004-10-18 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
81
82 * gtkutil.c (xg_update_scrollbar_pos): Change XClearWindow to
83 gdk_window_clear and move gdk_window_process_all_updates after
84 clear so events are sent to the X server in correct order.
85
862004-10-18 Kenichi Handa <handa@m17n.org>
87
88 * fontset.c (fs_load_font): Use fast_string_match_ignore_case for
89 comparing font names.
90 (fs_query_fontset): Use fast_string_match for comparing fontset names.
91 (list_fontsets): Likewise.
92
93 * search.c (fast_string_match_ignore_case): New function.
94
95 * lisp.h (fast_string_match_ignore_case): Extern it.
96
972004-10-17 Kim F. Storm <storm@cua.dk>
98
99 * xdisp.c (overlay_arrow_at_row): Return overlay string rather
100 than bitmap if there is not left fringe.
101 (get_overlay_arrow_glyph_row): Also used on windows system.
102 (display_line): Display overlay string if no left fringe.
103
1042004-10-16 Jason Rumney <jasonr@gnu.org>
105
106 * w32fns.c (w32_font_match): Encode font name being matched.
107
1082004-10-16 Richard M. Stallman <rms@gnu.org>
109
110 * window.c (Fspecial_display_p): Doc fix.
111
1122004-10-15 Stefan <monnier@iro.umontreal.ca>
113
114 * doc.c (Fsubstitute_command_keys): Fix remap-handling.
115 Don't ignore menus, because where-is-internal already does it for us.
116
1172004-10-15 Kim F. Storm <storm@cua.dk>
118
119 * xdisp.c (redisplay_window): Only update fringes and vertical
120 border on window frames.
121
1222004-10-14 Andreas Schwab <schwab@suse.de>
123
124 * m/ia64.h (DATA_SEG_BITS): Don't define.
125
12004-10-14 Kim F. Storm <storm@cua.dk> 1262004-10-14 Kim F. Storm <storm@cua.dk>
2 127
3 * xterm.h: Include Xutil.h after keysym.h to work around bug 128 * xterm.h: Include Xutil.h after keysym.h to work around bug
4 (incorrectly recognising AltGr key) in some X versions. 129 in some X versions.
130
1312004-10-13 Stefan Monnier <monnier@iro.umontreal.ca>
132
133 * fns.c (map_char_table): Add missing gcpros.
5 134
62004-10-13 Stefan Monnier <monnier@iro.umontreal.ca> 1352004-10-13 Stefan Monnier <monnier@iro.umontreal.ca>
7 136
diff --git a/src/Makefile.in b/src/Makefile.in
index 08504dcf725..80789a99e39 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -887,12 +887,7 @@ LIBES = $(LOADLIBES) $(LIBS) $(LIBX) $(LIBSOUND) \
887#define OBJECTS_MACHINE 887#define OBJECTS_MACHINE
888#endif 888#endif
889 889
890#ifdef HAVE_RANDOM_HEAPSTART
891#undef i386
892RUN_TEMACS = @SETARCH@ i386 ./temacs
893#else
894RUN_TEMACS = ./temacs 890RUN_TEMACS = ./temacs
895#endif
896 891
897all: emacs${EXEEXT} OTHER_FILES 892all: emacs${EXEEXT} OTHER_FILES
898 893
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. */
414/* Define to 1 if you have the <nlist.h> header file. */ 414/* Define to 1 if you have the <nlist.h> header file. */
415#undef HAVE_NLIST_H 415#undef HAVE_NLIST_H
416 416
417/* Define to 1 if personality LINUX32 can be set. */
418#undef HAVE_PERSONALITY_LINUX32
419
417/* Define to 1 if you have the png library (-lpng). */ 420/* Define to 1 if you have the png library (-lpng). */
418#undef HAVE_PNG 421#undef HAVE_PNG
419 422
@@ -432,9 +435,6 @@ Boston, MA 02111-1307, USA. */
432/* Define to 1 if you have the `random' function. */ 435/* Define to 1 if you have the `random' function. */
433#undef HAVE_RANDOM 436#undef HAVE_RANDOM
434 437
435/* Define to 1 if this OS randomizes the start address of the heap. */
436#undef HAVE_RANDOM_HEAPSTART
437
438/* Define to 1 if you have the `recvfrom' function. */ 438/* Define to 1 if you have the `recvfrom' function. */
439#undef HAVE_RECVFROM 439#undef HAVE_RECVFROM
440 440
@@ -757,9 +757,9 @@ Boston, MA 02111-1307, USA. */
757/* If using the C implementation of alloca, define if you know the 757/* If using the C implementation of alloca, define if you know the
758 direction of stack growth for your system; otherwise it will be 758 direction of stack growth for your system; otherwise it will be
759 automatically deduced at run-time. 759 automatically deduced at run-time.
760 STACK_DIRECTION > 0 => grows toward higher addresses 760 STACK_DIRECTION > 0 => grows toward higher addresses
761 STACK_DIRECTION < 0 => grows toward lower addresses 761 STACK_DIRECTION < 0 => grows toward lower addresses
762 STACK_DIRECTION = 0 => direction of growth unknown */ 762 STACK_DIRECTION = 0 => direction of growth unknown */
763#undef STACK_DIRECTION 763#undef STACK_DIRECTION
764 764
765/* Define to 1 if you have the ANSI C header files. */ 765/* Define to 1 if you have the ANSI C header files. */
diff --git a/src/data.c b/src/data.c
index 558c7a974af..dd26feee264 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1794,7 +1794,11 @@ BUFFER defaults to the current buffer. */)
1794 1794
1795DEFUN ("local-variable-if-set-p", Flocal_variable_if_set_p, Slocal_variable_if_set_p, 1795DEFUN ("local-variable-if-set-p", Flocal_variable_if_set_p, Slocal_variable_if_set_p,
1796 1, 2, 0, 1796 1, 2, 0,
1797 doc: /* Non-nil if VARIABLE will be local in buffer BUFFER if it is set there. 1797 doc: /* Non-nil if VARIABLE will be local in buffer BUFFER when set there.
1798More precisely, this means that setting the variable \(with `set' or`setq'),
1799while it does not have a `let'-style binding that was made in BUFFER,
1800will produce a buffer local binding. See Info node
1801`(elisp)Creating Buffer-Local'.
1798BUFFER defaults to the current buffer. */) 1802BUFFER defaults to the current buffer. */)
1799 (variable, buffer) 1803 (variable, buffer)
1800 register Lisp_Object variable, buffer; 1804 register Lisp_Object variable, buffer;
diff --git a/src/doc.c b/src/doc.c
index 9a787e002d8..f722dd49b76 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -774,28 +774,18 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int
774 774
775 /* Save STRP in IDX. */ 775 /* Save STRP in IDX. */
776 idx = strp - SDATA (string); 776 idx = strp - SDATA (string);
777 tem = Fintern (make_string (start, length_byte), Qnil); 777 name = Fintern (make_string (start, length_byte), Qnil);
778 778
779 /* Ignore remappings unless there are no ordinary bindings. */ 779 /* Ignore remappings unless there are no ordinary bindings. */
780 tem = Fwhere_is_internal (tem, keymap, Qt, Qnil, Qt); 780 tem = Fwhere_is_internal (name, keymap, Qt, Qnil, Qt);
781 if (NILP (tem)) 781 if (NILP (tem))
782 tem = Fwhere_is_internal (tem, keymap, Qt, Qnil, Qnil); 782 tem = Fwhere_is_internal (name, keymap, Qt, Qnil, Qnil);
783 783
784 /* Note the Fwhere_is_internal can GC, so we have to take 784 /* Note the Fwhere_is_internal can GC, so we have to take
785 relocation of string contents into account. */ 785 relocation of string contents into account. */
786 strp = SDATA (string) + idx; 786 strp = SDATA (string) + idx;
787 start = SDATA (string) + start_idx; 787 start = SDATA (string) + start_idx;
788 788
789 /* Disregard menu bar bindings; it is positively annoying to
790 mention them when there's no menu bar, and it isn't terribly
791 useful even when there is a menu bar. */
792 if (!NILP (tem))
793 {
794 firstkey = Faref (tem, make_number (0));
795 if (EQ (firstkey, Qmenu_bar))
796 tem = Qnil;
797 }
798
799 if (NILP (tem)) /* but not on any keys */ 789 if (NILP (tem)) /* but not on any keys */
800 { 790 {
801 int offset = bufp - buf; 791 int offset = bufp - buf;
diff --git a/src/editfns.c b/src/editfns.c
index 49617f7ebc9..c3a69fc3f0c 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -3000,6 +3000,8 @@ DEFUN ("delete-and-extract-region", Fdelete_and_extract_region,
3000 Lisp_Object start, end; 3000 Lisp_Object start, end;
3001{ 3001{
3002 validate_region (&start, &end); 3002 validate_region (&start, &end);
3003 if (XINT (start) == XINT (end))
3004 return build_string ("");
3003 return del_range_1 (XINT (start), XINT (end), 1, 1); 3005 return del_range_1 (XINT (start), XINT (end), 1, 1);
3004} 3006}
3005 3007
diff --git a/src/emacs.c b/src/emacs.c
index 5b7394627ef..98572d7e6dc 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -67,6 +67,10 @@ Boston, MA 02111-1307, USA. */
67#include <sys/resource.h> 67#include <sys/resource.h>
68#endif 68#endif
69 69
70#ifdef HAVE_PERSONALITY_LINUX32
71#include <sys/personality.h>
72#endif
73
70#ifndef O_RDWR 74#ifndef O_RDWR
71#define O_RDWR 2 75#define O_RDWR 2
72#endif 76#endif
@@ -192,6 +196,17 @@ int display_arg;
192 Tells GC how to save a copy of the stack. */ 196 Tells GC how to save a copy of the stack. */
193char *stack_bottom; 197char *stack_bottom;
194 198
199/* The address where the heap starts (from the first sbrk (0) call). */
200static void *my_heap_start;
201
202/* The gap between BSS end and heap start as far as we can tell. */
203static unsigned long heap_bss_diff;
204
205/* If the gap between BSS end and heap start is larger than this we try to
206 work around it, and if that fails, output a warning in dump-emacs. */
207#define MAX_HEAP_BSS_DIFF (1024*1024)
208
209
195#ifdef HAVE_WINDOW_SYSTEM 210#ifdef HAVE_WINDOW_SYSTEM
196extern Lisp_Object Vwindow_system; 211extern Lisp_Object Vwindow_system;
197#endif /* HAVE_WINDOW_SYSTEM */ 212#endif /* HAVE_WINDOW_SYSTEM */
@@ -733,7 +748,11 @@ malloc_initialize_hook ()
733 free (malloc_state_ptr); 748 free (malloc_state_ptr);
734 } 749 }
735 else 750 else
736 malloc_using_checking = getenv ("MALLOC_CHECK_") != NULL; 751 {
752 if (my_heap_start == 0)
753 my_heap_start = sbrk (0);
754 malloc_using_checking = getenv ("MALLOC_CHECK_") != NULL;
755 }
737} 756}
738 757
739void (*__malloc_initialize_hook) () = malloc_initialize_hook; 758void (*__malloc_initialize_hook) () = malloc_initialize_hook;
@@ -809,6 +828,17 @@ main (argc, argv
809 stack_base = &dummy; 828 stack_base = &dummy;
810#endif 829#endif
811 830
831 if (!initialized)
832 {
833 extern char my_endbss[];
834 extern char *my_endbss_static;
835
836 if (my_heap_start == 0)
837 my_heap_start = sbrk (0);
838
839 heap_bss_diff = (char *)my_heap_start - max (my_endbss, my_endbss_static);
840 }
841
812#ifdef LINUX_SBRK_BUG 842#ifdef LINUX_SBRK_BUG
813 __sbrk (1); 843 __sbrk (1);
814#endif 844#endif
@@ -852,6 +882,28 @@ main (argc, argv
852 } 882 }
853 } 883 }
854 884
885#ifdef HAVE_PERSONALITY_LINUX32
886 /* See if there is a gap between the end of BSS and the heap.
887 In that case, set personality and exec ourself again. */
888 if (!initialized
889 && (strcmp (argv[argc-1], "dump") == 0
890 || strcmp (argv[argc-1], "bootstrap") == 0)
891 && heap_bss_diff > MAX_HEAP_BSS_DIFF)
892 {
893 if (! getenv ("EMACS_HEAP_EXEC"))
894 {
895 /* Set this so we only do this once. */
896 putenv("EMACS_HEAP_EXEC=true");
897 personality (PER_LINUX32);
898 execvp (argv[0], argv);
899
900 /* If the exec fails, try to dump anyway. */
901 perror ("execvp");
902 }
903 }
904#endif /* HAVE_PERSONALITY_LINUX32 */
905
906
855/* Map in shared memory, if we are using that. */ 907/* Map in shared memory, if we are using that. */
856#ifdef HAVE_SHM 908#ifdef HAVE_SHM
857 if (argmatch (argv, argc, "-nl", "--no-shared-memory", 6, NULL, &skip_args)) 909 if (argmatch (argv, argc, "-nl", "--no-shared-memory", 6, NULL, &skip_args))
@@ -2138,6 +2190,17 @@ You must run Emacs in batch mode in order to dump it. */)
2138 if (! noninteractive) 2190 if (! noninteractive)
2139 error ("Dumping Emacs works only in batch mode"); 2191 error ("Dumping Emacs works only in batch mode");
2140 2192
2193 if (heap_bss_diff > MAX_HEAP_BSS_DIFF)
2194 {
2195 fprintf (stderr, "**************************************************\n");
2196 fprintf (stderr, "Warning: Your system has a gap between BSS and the\n");
2197 fprintf (stderr, "heap. This usually means that exec-shield or\n");
2198 fprintf (stderr, "something similar is in effect. The dump may fail\n");
2199 fprintf (stderr, "because of this. See the section about exec-shield\n");
2200 fprintf (stderr, "in etc/PROBLEMS for more information.\n");
2201 fprintf (stderr, "**************************************************\n");
2202 }
2203
2141 /* Bind `command-line-processed' to nil before dumping, 2204 /* Bind `command-line-processed' to nil before dumping,
2142 so that the dumped Emacs will process its command line 2205 so that the dumped Emacs will process its command line
2143 and set up to work with X windows if appropriate. */ 2206 and set up to work with X windows if appropriate. */
diff --git a/src/fontset.c b/src/fontset.c
index 4901fc71419..289f5368a35 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -1126,18 +1126,17 @@ fs_query_fontset (name, regexpp)
1126 1126
1127 for (i = 0; i < ASIZE (Vfontset_table); i++) 1127 for (i = 0; i < ASIZE (Vfontset_table); i++)
1128 { 1128 {
1129 Lisp_Object fontset; 1129 Lisp_Object fontset, this_name;
1130 unsigned char *this_name;
1131 1130
1132 fontset = FONTSET_FROM_ID (i); 1131 fontset = FONTSET_FROM_ID (i);
1133 if (NILP (fontset) 1132 if (NILP (fontset)
1134 || !BASE_FONTSET_P (fontset)) 1133 || !BASE_FONTSET_P (fontset))
1135 continue; 1134 continue;
1136 1135
1137 this_name = SDATA (FONTSET_NAME (fontset)); 1136 this_name = FONTSET_NAME (fontset);
1138 if (regexpp 1137 if (regexpp
1139 ? fast_c_string_match_ignore_case (name, this_name) >= 0 1138 ? fast_string_match (name, this_name) >= 0
1140 : !strcmp (SDATA (name), this_name)) 1139 : !strcmp (SDATA (name), SDATA (this_name)))
1141 return i; 1140 return i;
1142 } 1141 }
1143 return -1; 1142 return -1;
@@ -1189,19 +1188,18 @@ list_fontsets (f, pattern, size)
1189 1188
1190 for (id = 0; id < ASIZE (Vfontset_table); id++) 1189 for (id = 0; id < ASIZE (Vfontset_table); id++)
1191 { 1190 {
1192 Lisp_Object fontset; 1191 Lisp_Object fontset, name;
1193 unsigned char *name;
1194 1192
1195 fontset = FONTSET_FROM_ID (id); 1193 fontset = FONTSET_FROM_ID (id);
1196 if (NILP (fontset) 1194 if (NILP (fontset)
1197 || !BASE_FONTSET_P (fontset) 1195 || !BASE_FONTSET_P (fontset)
1198 || !EQ (frame, FONTSET_FRAME (fontset))) 1196 || !EQ (frame, FONTSET_FRAME (fontset)))
1199 continue; 1197 continue;
1200 name = SDATA (FONTSET_NAME (fontset)); 1198 name = FONTSET_NAME (fontset);
1201 1199
1202 if (STRINGP (regexp) 1200 if (STRINGP (regexp)
1203 ? (fast_c_string_match_ignore_case (regexp, name) < 0) 1201 ? (fast_string_match (regexp, name) < 0)
1204 : strcmp (SDATA (pattern), name)) 1202 : strcmp (SDATA (pattern), SDATA (name)))
1205 continue; 1203 continue;
1206 1204
1207 val = Fcons (Fcopy_sequence (FONTSET_NAME (fontset)), val); 1205 val = Fcons (Fcopy_sequence (FONTSET_NAME (fontset)), val);
diff --git a/src/gtkutil.c b/src/gtkutil.c
index fabdae74dc6..8182ff45766 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -550,24 +550,6 @@ xg_resize_outer_widget (f, columns, rows)
550 gdk_window_process_all_updates (); 550 gdk_window_process_all_updates ();
551} 551}
552 552
553/* This gets called after the frame F has been cleared. Since that is
554 done with X calls, we need to redraw GTK widget (scroll bars). */
555void
556xg_frame_cleared (f)
557 FRAME_PTR f;
558{
559 GtkWidget *w = f->output_data.x->widget;
560
561 if (w)
562 {
563 gtk_container_set_reallocate_redraws (GTK_CONTAINER (w), TRUE);
564 gtk_container_foreach (GTK_CONTAINER (w),
565 (GtkCallback) gtk_widget_queue_draw,
566 0);
567 gdk_window_process_all_updates ();
568 }
569}
570
571/* Function to handle resize of our widgets. Since Emacs has some layouts 553/* Function to handle resize of our widgets. Since Emacs has some layouts
572 that does not fit well with GTK standard containers, we do most layout 554 that does not fit well with GTK standard containers, we do most layout
573 manually. 555 manually.
@@ -585,8 +567,10 @@ xg_resize_widgets (f, pixelwidth, pixelheight)
585 int columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixelwidth); 567 int columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixelwidth);
586 568
587 if (FRAME_GTK_WIDGET (f) 569 if (FRAME_GTK_WIDGET (f)
588 && (columns != FRAME_COLS (f) || rows != FRAME_LINES (f) 570 && (columns != FRAME_COLS (f)
589 || pixelwidth != FRAME_PIXEL_WIDTH (f) || pixelheight != FRAME_PIXEL_HEIGHT (f))) 571 || rows != FRAME_LINES (f)
572 || pixelwidth != FRAME_PIXEL_WIDTH (f)
573 || pixelheight != FRAME_PIXEL_HEIGHT (f)))
590 { 574 {
591 struct x_output *x = f->output_data.x; 575 struct x_output *x = f->output_data.x;
592 GtkAllocation all; 576 GtkAllocation all;
@@ -681,54 +665,6 @@ xg_pix_to_gcolor (w, pixel, c)
681 gdk_colormap_query_color (map, pixel, c); 665 gdk_colormap_query_color (map, pixel, c);
682} 666}
683 667
684/* Turning off double buffering for our GtkFixed widget has the side
685 effect of turning it off also for its children (scroll bars).
686 But we want those to be double buffered to not flicker so handle
687 expose manually here.
688 WIDGET is the GtkFixed widget that gets exposed.
689 EVENT is the expose event.
690 USER_DATA is unused.
691
692 Return TRUE to tell GTK that this expose event has been fully handeled
693 and that GTK shall do nothing more with it. */
694static gboolean
695xg_fixed_handle_expose (GtkWidget *widget,
696 GdkEventExpose *event,
697 gpointer user_data)
698{
699 GList *iter;
700
701 for (iter = GTK_FIXED (widget)->children; iter; iter = g_list_next (iter))
702 {
703 GtkFixedChild *child_data = (GtkFixedChild *) iter->data;
704 GtkWidget *child = child_data->widget;
705 GdkWindow *window = child->window;
706 GdkRegion *region = gtk_widget_region_intersect (child, event->region);
707
708 if (! gdk_region_empty (region))
709 {
710 GdkEvent child_event;
711 child_event.expose = *event;
712 child_event.expose.region = region;
713
714 /* Turn on double buffering, i.e. draw to an off screen area. */
715 gdk_window_begin_paint_region (window, region);
716
717 /* Tell child to redraw itself. */
718 gdk_region_get_clipbox (region, &child_event.expose.area);
719 gtk_widget_send_expose (child, &child_event);
720 gdk_window_process_updates (window, TRUE);
721
722 /* Copy off screen area to the window. */
723 gdk_window_end_paint (window);
724 }
725
726 gdk_region_destroy (region);
727 }
728
729 return TRUE;
730}
731
732/* Create and set up the GTK widgets for frame F. 668/* Create and set up the GTK widgets for frame F.
733 Return 0 if creation failed, non-zero otherwise. */ 669 Return 0 if creation failed, non-zero otherwise. */
734int 670int
@@ -804,12 +740,6 @@ xg_create_frame_widgets (f)
804 a lot, so we turn off double buffering. */ 740 a lot, so we turn off double buffering. */
805 gtk_widget_set_double_buffered (wfixed, FALSE); 741 gtk_widget_set_double_buffered (wfixed, FALSE);
806 742
807 /* Turning off double buffering above has the side effect of turning
808 it off also for its children (scroll bars). But we want those
809 to be double buffered to not flicker so handle expose manually. */
810 g_signal_connect (G_OBJECT (wfixed), "expose-event",
811 G_CALLBACK (xg_fixed_handle_expose), 0);
812
813 /* GTK documents says use gtk_window_set_resizable. But then a user 743 /* GTK documents says use gtk_window_set_resizable. But then a user
814 can't shrink the window from its starting size. */ 744 can't shrink the window from its starting size. */
815 gtk_window_set_policy (GTK_WINDOW (wtop), TRUE, TRUE, TRUE); 745 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)
2770 char *scroll_bar_name; 2700 char *scroll_bar_name;
2771{ 2701{
2772 GtkWidget *wscroll; 2702 GtkWidget *wscroll;
2703 GtkWidget *webox;
2773 GtkObject *vadj; 2704 GtkObject *vadj;
2774 int scroll_id; 2705 int scroll_id;
2775 2706
@@ -2779,6 +2710,7 @@ xg_create_scroll_bar (f, bar, scroll_callback, scroll_bar_name)
2779 0.1, 0.1, 0.1); 2710 0.1, 0.1, 0.1);
2780 2711
2781 wscroll = gtk_vscrollbar_new (GTK_ADJUSTMENT (vadj)); 2712 wscroll = gtk_vscrollbar_new (GTK_ADJUSTMENT (vadj));
2713 webox = gtk_event_box_new ();
2782 gtk_widget_set_name (wscroll, scroll_bar_name); 2714 gtk_widget_set_name (wscroll, scroll_bar_name);
2783 gtk_range_set_update_policy (GTK_RANGE (wscroll), GTK_UPDATE_CONTINUOUS); 2715 gtk_range_set_update_policy (GTK_RANGE (wscroll), GTK_UPDATE_CONTINUOUS);
2784 2716
@@ -2804,11 +2736,18 @@ xg_create_scroll_bar (f, bar, scroll_callback, scroll_bar_name)
2804 G_CALLBACK (scroll_bar_button_cb), 2736 G_CALLBACK (scroll_bar_button_cb),
2805 (gpointer) bar); 2737 (gpointer) bar);
2806 2738
2807 gtk_fixed_put (GTK_FIXED (f->output_data.x->edit_widget), 2739 /* The scroll bar widget does not draw on a window of its own. Instead
2808 wscroll, -1, -1); 2740 it draws on the parent window, in this case the edit widget. So
2741 whenever the edit widget is cleared, the scroll bar needs to redraw
2742 also, which causes flicker. Put an event box between the edit widget
2743 and the scroll bar, so the scroll bar instead draws itself on the
2744 event box window. */
2745 gtk_fixed_put (GTK_FIXED (f->output_data.x->edit_widget), webox, -1, -1);
2746 gtk_container_add (GTK_CONTAINER (webox), wscroll);
2747
2809 2748
2810 /* Set the cursor to an arrow. */ 2749 /* Set the cursor to an arrow. */
2811 xg_set_cursor (wscroll, FRAME_X_DISPLAY_INFO (f)->xg_cursor); 2750 xg_set_cursor (webox, FRAME_X_DISPLAY_INFO (f)->xg_cursor);
2812 2751
2813 SET_SCROLL_BAR_X_WINDOW (bar, scroll_id); 2752 SET_SCROLL_BAR_X_WINDOW (bar, scroll_id);
2814} 2753}
@@ -2820,7 +2759,7 @@ xg_show_scroll_bar (scrollbar_id)
2820{ 2759{
2821 GtkWidget *w = xg_get_widget_from_map (scrollbar_id); 2760 GtkWidget *w = xg_get_widget_from_map (scrollbar_id);
2822 if (w) 2761 if (w)
2823 gtk_widget_show (w); 2762 gtk_widget_show_all (gtk_widget_get_parent (w));
2824} 2763}
2825 2764
2826/* Remove the scroll bar represented by SCROLLBAR_ID from the frame F. */ 2765/* Remove the scroll bar represented by SCROLLBAR_ID from the frame F. */
@@ -2832,42 +2771,19 @@ xg_remove_scroll_bar (f, scrollbar_id)
2832 GtkWidget *w = xg_get_widget_from_map (scrollbar_id); 2771 GtkWidget *w = xg_get_widget_from_map (scrollbar_id);
2833 if (w) 2772 if (w)
2834 { 2773 {
2774 GtkWidget *wparent = gtk_widget_get_parent (w);
2835 gtk_widget_destroy (w); 2775 gtk_widget_destroy (w);
2776 gtk_widget_destroy (wparent);
2836 SET_FRAME_GARBAGED (f); 2777 SET_FRAME_GARBAGED (f);
2837 } 2778 }
2838} 2779}
2839 2780
2840/* Find left/top for widget W in GtkFixed widget WFIXED. */
2841static void
2842xg_find_top_left_in_fixed (w, wfixed, left, top)
2843 GtkWidget *w, *wfixed;
2844 int *left, *top;
2845{
2846 GList *iter;
2847
2848 for (iter = GTK_FIXED (wfixed)->children; iter; iter = g_list_next (iter))
2849 {
2850 GtkFixedChild *child = (GtkFixedChild *) iter->data;
2851
2852 if (child->widget == w)
2853 {
2854 *left = child->x;
2855 *top = child->y;
2856 return;
2857 }
2858 }
2859
2860 /* Shall never end up here. */
2861 abort ();
2862}
2863
2864/* Update the position of the vertical scroll bar represented by SCROLLBAR_ID 2781/* Update the position of the vertical scroll bar represented by SCROLLBAR_ID
2865 in frame F. 2782 in frame F.
2866 TOP/LEFT are the new pixel positions where the bar shall appear. 2783 TOP/LEFT are the new pixel positions where the bar shall appear.
2867 WIDTH, HEIGHT is the size in pixels the bar shall have. */ 2784 WIDTH, HEIGHT is the size in pixels the bar shall have. */
2868void 2785void
2869xg_update_scrollbar_pos (f, scrollbar_id, top, left, width, height, 2786xg_update_scrollbar_pos (f, scrollbar_id, top, left, width, height)
2870 real_left, canon_width)
2871 FRAME_PTR f; 2787 FRAME_PTR f;
2872 int scrollbar_id; 2788 int scrollbar_id;
2873 int top; 2789 int top;
@@ -2881,44 +2797,11 @@ xg_update_scrollbar_pos (f, scrollbar_id, top, left, width, height,
2881 if (wscroll) 2797 if (wscroll)
2882 { 2798 {
2883 GtkWidget *wfixed = f->output_data.x->edit_widget; 2799 GtkWidget *wfixed = f->output_data.x->edit_widget;
2884 2800 GtkWidget *wparent = gtk_widget_get_parent (wscroll);
2885 gtk_container_set_reallocate_redraws (GTK_CONTAINER (wfixed), TRUE);
2886 2801
2887 /* Move and resize to new values. */ 2802 /* Move and resize to new values. */
2888 gtk_fixed_move (GTK_FIXED (wfixed), wscroll, left, top);
2889 gtk_widget_set_size_request (wscroll, width, height); 2803 gtk_widget_set_size_request (wscroll, width, height);
2890 2804 gtk_fixed_move (GTK_FIXED (wfixed), wparent, left, top);
2891 /* Must force out update so changed scroll bars gets redrawn. */
2892 gdk_window_process_all_updates ();
2893
2894 /* Scroll bars in GTK has a fixed width, so if we say width 16, it
2895 will only be its fixed width (14 is default) anyway, the rest is
2896 blank. We are drawing the mode line across scroll bars when
2897 the frame is split:
2898 |bar| |fringe|
2899 ----------------
2900 mode line
2901 ----------------
2902 |bar| |fringe|
2903
2904 When we "unsplit" the frame:
2905
2906 |bar| |fringe|
2907 -| |-| |
2908 m¦ |i| |
2909 -| |-| |
2910 | | | |
2911
2912
2913 the remains of the mode line can be seen in these blank spaces.
2914 So we must clear them explicitly.
2915 GTK scroll bars should do that, but they don't.
2916 Also, the canonical width may be wider than the width for the
2917 scroll bar so that there is some space (typically 1 pixel) between
2918 the scroll bar and the edge of the window and between the scroll
2919 bar and the fringe. */
2920
2921 XClearWindow (FRAME_X_DISPLAY (f), GTK_WIDGET_TO_X_WIN (wscroll));
2922 2805
2923 SET_FRAME_GARBAGED (f); 2806 SET_FRAME_GARBAGED (f);
2924 cancel_mouse_face (f); 2807 cancel_mouse_face (f);
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,
168 int top, 168 int top,
169 int left, 169 int left,
170 int width, 170 int width,
171 int height, 171 int height));
172 int real_left,
173 int canon_width));
174 172
175extern void xg_set_toolkit_scroll_bar_thumb P_ ((struct scroll_bar *bar, 173extern void xg_set_toolkit_scroll_bar_thumb P_ ((struct scroll_bar *bar,
176 int portion, 174 int portion,
@@ -184,7 +182,6 @@ extern void free_frame_tool_bar P_ ((FRAME_PTR f));
184extern void xg_resize_widgets P_ ((FRAME_PTR f, 182extern void xg_resize_widgets P_ ((FRAME_PTR f,
185 int pixelwidth, 183 int pixelwidth,
186 int pixelheight)); 184 int pixelheight));
187extern void xg_frame_cleared P_ ((FRAME_PTR f));
188extern void xg_frame_set_char_size P_ ((FRAME_PTR f, int cols, int rows)); 185extern void xg_frame_set_char_size P_ ((FRAME_PTR f, int cols, int rows));
189extern GtkWidget * xg_win_to_widget P_ ((Display *dpy, Window wdesc)); 186extern GtkWidget * xg_win_to_widget P_ ((Display *dpy, Window wdesc));
190 187
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. */
40 40
41char my_edata[] = "End of Emacs initialized data"; 41char my_edata[] = "End of Emacs initialized data";
42 42
43#if defined(WINDOWSNT) || defined(CYGWIN)
44/* Help unexec locate the end of the .bss area used by Emacs (which 43/* Help unexec locate the end of the .bss area used by Emacs (which
45 isn't always a separate section in NT executables). */ 44 isn't always a separate section in NT executables). */
46char my_endbss[1]; 45char my_endbss[1];
@@ -50,7 +49,6 @@ char my_endbss[1];
50 of the bss area used by Emacs. */ 49 of the bss area used by Emacs. */
51static char _my_endbss[1]; 50static char _my_endbss[1];
52char * my_endbss_static = _my_endbss; 51char * my_endbss_static = _my_endbss;
53#endif
54 52
55/* arch-tag: 67e81ab4-e14f-44b2-8875-c0c12252223e 53/* arch-tag: 67e81ab4-e14f-44b2-8875-c0c12252223e
56 (do not change this comment) */ 54 (do not change this comment) */
diff --git a/src/lisp.h b/src/lisp.h
index 4794f77d5a1..5e4d87595eb 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2833,6 +2833,7 @@ EXFUN (Fmatch_end, 1);
2833EXFUN (Flooking_at, 1); 2833EXFUN (Flooking_at, 1);
2834extern int fast_string_match P_ ((Lisp_Object, Lisp_Object)); 2834extern int fast_string_match P_ ((Lisp_Object, Lisp_Object));
2835extern int fast_c_string_match_ignore_case P_ ((Lisp_Object, const char *)); 2835extern int fast_c_string_match_ignore_case P_ ((Lisp_Object, const char *));
2836extern int fast_string_match_ignore_case P_ ((Lisp_Object, Lisp_Object));
2836extern int scan_buffer P_ ((int, int, int, int, int *, int)); 2837extern int scan_buffer P_ ((int, int, int, int, int *, int));
2837extern int scan_newline P_ ((int, int, int, int, int, int)); 2838extern int scan_newline P_ ((int, int, int, int, int, int));
2838extern int find_next_newline P_ ((int, int)); 2839extern int find_next_newline P_ ((int, int));
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 ();
133 133
134#endif /* not NOT_C_CODE */ 134#endif /* not NOT_C_CODE */
135 135
136#define DATA_SEG_BITS 0x6000000000000000
137
138#define HAVE_TEXT_START 136#define HAVE_TEXT_START
139 137
140/* arch-tag: 9b8e9fb2-2e49-4c22-b68f-11a488e77c66 138/* arch-tag: 9b8e9fb2-2e49-4c22-b68f-11a488e77c66
diff --git a/src/search.c b/src/search.c
index a00490fd4b3..be2ea2bcd89 100644
--- a/src/search.c
+++ b/src/search.c
@@ -460,6 +460,27 @@ fast_c_string_match_ignore_case (regexp, string)
460 immediate_quit = 0; 460 immediate_quit = 0;
461 return val; 461 return val;
462} 462}
463
464/* Like fast_string_match but ignore case. */
465
466int
467fast_string_match_ignore_case (regexp, string)
468 Lisp_Object regexp, string;
469{
470 int val;
471 struct re_pattern_buffer *bufp;
472
473 bufp = compile_pattern (regexp, 0, Vascii_downcase_table,
474 0, STRING_MULTIBYTE (string));
475 immediate_quit = 1;
476 re_match_object = string;
477
478 val = re_search (bufp, (char *) SDATA (string),
479 SBYTES (string), 0,
480 SBYTES (string), 0);
481 immediate_quit = 0;
482 return val;
483}
463 484
464/* The newline cache: remembering which sections of text have no newlines. */ 485/* The newline cache: remembering which sections of text have no newlines. */
465 486
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)
1005 _snprintf (buf, sizeof(buf)-1, "emacs_dir=%s", modname); 1005 _snprintf (buf, sizeof(buf)-1, "emacs_dir=%s", modname);
1006 _putenv (strdup (buf)); 1006 _putenv (strdup (buf));
1007 } 1007 }
1008 /* Handle running emacs from the build directory: src/oo-spd/i386/ */
1009
1010 /* FIXME: should use substring of get_emacs_configuration ().
1011 But I don't think the Windows build supports alpha, mips etc
1012 anymore, so have taken the easy option for now. */
1013 else if (p && stricmp (p, "\\i386") == 0)
1014 {
1015 *p = 0;
1016 p = strrchr (modname, '\\');
1017 if (p != NULL)
1018 {
1019 *p = 0;
1020 p = strrchr (modname, '\\');
1021 if (p && stricmp (p, "\\src") == 0)
1022 {
1023 char buf[SET_ENV_BUF_SIZE];
1024
1025 *p = 0;
1026 for (p = modname; *p; p++)
1027 if (*p == '\\') *p = '/';
1028
1029 _snprintf (buf, sizeof(buf)-1, "emacs_dir=%s", modname);
1030 _putenv (strdup (buf));
1031 }
1032 }
1033 }
1008 } 1034 }
1009 1035
1010 for (i = 0; i < (sizeof (env_vars) / sizeof (env_vars[0])); i++) 1036 for (i = 0; i < (sizeof (env_vars) / sizeof (env_vars[0])); i++)
diff --git a/src/w32fns.c b/src/w32fns.c
index 2b613931a9c..e5a1ca00cc3 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -5667,12 +5667,14 @@ w32_font_match (fontname, pattern)
5667 char * fontname; 5667 char * fontname;
5668 char * pattern; 5668 char * pattern;
5669{ 5669{
5670 char *regex = alloca (strlen (pattern) * 2 + 3); 5670 char *font_name_copy;
5671 char *font_name_copy = alloca (strlen (fontname) + 1);
5672 char *ptr; 5671 char *ptr;
5672 Lisp_Object encoded_font_name;
5673 char *regex = alloca (strlen (pattern) * 2 + 3);
5673 5674
5674 /* Copy fontname so we can modify it during comparison. */ 5675 /* Convert fontname to unibyte for match. */
5675 strcpy (font_name_copy, fontname); 5676 encoded_font_name = string_make_unibyte (build_string (fontname));
5677 font_name_copy = SDATA (encoded_font_name);
5676 5678
5677 ptr = regex; 5679 ptr = regex;
5678 *ptr++ = '^'; 5680 *ptr++ = '^';
diff --git a/src/w32term.c b/src/w32term.c
index 574457f727f..a69552a2812 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -1360,7 +1360,6 @@ w32_text_out (s, x, y,chars,nchars)
1360} 1360}
1361 1361
1362 1362
1363
1364static void x_set_glyph_string_clipping P_ ((struct glyph_string *)); 1363static void x_set_glyph_string_clipping P_ ((struct glyph_string *));
1365static void x_set_glyph_string_gc P_ ((struct glyph_string *)); 1364static void x_set_glyph_string_gc P_ ((struct glyph_string *));
1366static void x_draw_glyph_string_background P_ ((struct glyph_string *, 1365static void x_draw_glyph_string_background P_ ((struct glyph_string *,
@@ -2212,7 +2211,6 @@ x_draw_image_foreground (s)
2212} 2211}
2213 2212
2214 2213
2215
2216/* Draw a relief around the image glyph string S. */ 2214/* Draw a relief around the image glyph string S. */
2217 2215
2218static void 2216static void
@@ -2669,7 +2667,7 @@ x_draw_glyph_string (s)
2669 } 2667 }
2670 else 2668 else
2671 { 2669 {
2672 w32_fill_area (s->f, s->hdc, s->face->underline_color, s->x, 2670 w32_fill_area (s->f, s->hdc, s->face->overline_color, s->x,
2673 s->y + dy, s->width, h); 2671 s->y + dy, s->width, h);
2674 } 2672 }
2675 } 2673 }
@@ -2963,14 +2961,6 @@ x_new_focus_frame (dpyinfo, frame)
2963 if (old_focus && old_focus->auto_lower) 2961 if (old_focus && old_focus->auto_lower)
2964 x_lower_frame (old_focus); 2962 x_lower_frame (old_focus);
2965 2963
2966
2967
2968
2969
2970
2971
2972
2973
2974 if (dpyinfo->w32_focus_frame && dpyinfo->w32_focus_frame->auto_raise) 2964 if (dpyinfo->w32_focus_frame && dpyinfo->w32_focus_frame->auto_raise)
2975 pending_autoraise_frame = dpyinfo->w32_focus_frame; 2965 pending_autoraise_frame = dpyinfo->w32_focus_frame;
2976 else 2966 else
@@ -4839,7 +4829,6 @@ w32_read_socket (sd, expected, hold_quit)
4839 if (f) 4829 if (f)
4840 x_new_focus_frame (dpyinfo, f); 4830 x_new_focus_frame (dpyinfo, f);
4841 4831
4842
4843 dpyinfo->grabbed = 0; 4832 dpyinfo->grabbed = 0;
4844 check_visibility = 1; 4833 check_visibility = 1;
4845 break; 4834 break;
@@ -5057,7 +5046,6 @@ w32_read_socket (sd, expected, hold_quit)
5057} 5046}
5058 5047
5059 5048
5060
5061 5049
5062/*********************************************************************** 5050/***********************************************************************
5063 Text Cursor 5051 Text Cursor
diff --git a/src/window.c b/src/window.c
index 55d7d7d2799..2aa8bed7dbc 100644
--- a/src/window.c
+++ b/src/window.c
@@ -3214,10 +3214,13 @@ display_buffer_1 (window)
3214} 3214}
3215 3215
3216DEFUN ("special-display-p", Fspecial_display_p, Sspecial_display_p, 1, 1, 0, 3216DEFUN ("special-display-p", Fspecial_display_p, Sspecial_display_p, 1, 1, 0,
3217 doc: /* Returns non-nil if a buffer named BUFFER-NAME would be created specially. 3217 doc: /* Returns non-nil if a buffer named BUFFER-NAME gets a special frame.
3218The value is actually t if the frame should be called with default frame 3218If the value is t, a frame would be created for that buffer
3219parameters, and a list of frame parameters if they were specified. 3219using the default frame parameters. If the value is a list,
3220See `special-display-buffer-names', and `special-display-regexps'. */) 3220it is a list of frame parameters that would be used
3221to make a frame for that buffer.
3222The variables `special-display-buffer-names'
3223and `special-display-regexps' control this. */)
3221 (buffer_name) 3224 (buffer_name)
3222 Lisp_Object buffer_name; 3225 Lisp_Object buffer_name;
3223{ 3226{
diff --git a/src/xdisp.c b/src/xdisp.c
index 53c03315853..d817e847aa3 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -8087,7 +8087,7 @@ store_frame_title (str, field_width, precision)
8087 8087
8088 /* Copy at most PRECISION chars from STR. */ 8088 /* Copy at most PRECISION chars from STR. */
8089 nbytes = strlen (str); 8089 nbytes = strlen (str);
8090 n+= c_string_width (str, nbytes, precision, &dummy, &nbytes); 8090 n += c_string_width (str, nbytes, precision, &dummy, &nbytes);
8091 while (nbytes--) 8091 while (nbytes--)
8092 store_frame_title_char (*str++); 8092 store_frame_title_char (*str++);
8093 8093
@@ -9634,11 +9634,13 @@ update_overlay_arrows (up_to_date)
9634} 9634}
9635 9635
9636 9636
9637/* Return overlay arrow string at row, or nil. */ 9637/* Return overlay arrow string to display at row.
9638 Return t if display as bitmap in left fringe.
9639 Return nil if no overlay arrow. */
9638 9640
9639static Lisp_Object 9641static Lisp_Object
9640overlay_arrow_at_row (f, row, pbitmap) 9642overlay_arrow_at_row (it, row, pbitmap)
9641 struct frame *f; 9643 struct it *it;
9642 struct glyph_row *row; 9644 struct glyph_row *row;
9643 int *pbitmap; 9645 int *pbitmap;
9644{ 9646{
@@ -9661,9 +9663,10 @@ overlay_arrow_at_row (f, row, pbitmap)
9661 && (MATRIX_ROW_START_CHARPOS (row) == marker_position (val))) 9663 && (MATRIX_ROW_START_CHARPOS (row) == marker_position (val)))
9662 { 9664 {
9663 val = overlay_arrow_string_or_property (var, pbitmap); 9665 val = overlay_arrow_string_or_property (var, pbitmap);
9664 if (FRAME_WINDOW_P (f)) 9666 if (FRAME_WINDOW_P (it->f)
9667 && WINDOW_LEFT_FRINGE_WIDTH (it->w) > 0)
9665 return Qt; 9668 return Qt;
9666 else if (STRINGP (val)) 9669 if (STRINGP (val))
9667 return val; 9670 return val;
9668 break; 9671 break;
9669 } 9672 }
@@ -12317,7 +12320,8 @@ redisplay_window (window, just_this_one_p)
12317 } 12320 }
12318 12321
12319#ifdef HAVE_WINDOW_SYSTEM 12322#ifdef HAVE_WINDOW_SYSTEM
12320 if (update_window_fringes (w, 0) 12323 if (FRAME_WINDOW_P (f)
12324 && update_window_fringes (w, 0)
12321 && !just_this_one_p 12325 && !just_this_one_p
12322 && (used_current_matrix_p || overlay_arrow_seen) 12326 && (used_current_matrix_p || overlay_arrow_seen)
12323 && !w->pseudo_window_p) 12327 && !w->pseudo_window_p)
@@ -14172,8 +14176,8 @@ usage: (trace-to-stderr STRING &rest OBJECTS) */)
14172 Building Desired Matrix Rows 14176 Building Desired Matrix Rows
14173 ***********************************************************************/ 14177 ***********************************************************************/
14174 14178
14175/* Return a temporary glyph row holding the glyphs of an overlay 14179/* Return a temporary glyph row holding the glyphs of an overlay arrow.
14176 arrow. Only used for non-window-redisplay windows. */ 14180 Used for non-window-redisplay windows, and for windows w/o left fringe. */
14177 14181
14178static struct glyph_row * 14182static struct glyph_row *
14179get_overlay_arrow_glyph_row (w, overlay_arrow_string) 14183get_overlay_arrow_glyph_row (w, overlay_arrow_string)
@@ -15054,11 +15058,11 @@ display_line (it)
15054 better to let it be displayed like cursors under X. */ 15058 better to let it be displayed like cursors under X. */
15055 if (! overlay_arrow_seen 15059 if (! overlay_arrow_seen
15056 && (overlay_arrow_string 15060 && (overlay_arrow_string
15057 = overlay_arrow_at_row (it->f, row, &overlay_arrow_bitmap), 15061 = overlay_arrow_at_row (it, row, &overlay_arrow_bitmap),
15058 !NILP (overlay_arrow_string))) 15062 !NILP (overlay_arrow_string)))
15059 { 15063 {
15060 /* Overlay arrow in window redisplay is a fringe bitmap. */ 15064 /* Overlay arrow in window redisplay is a fringe bitmap. */
15061 if (!FRAME_WINDOW_P (it->f)) 15065 if (STRINGP (overlay_arrow_string))
15062 { 15066 {
15063 struct glyph_row *arrow_row 15067 struct glyph_row *arrow_row
15064 = get_overlay_arrow_glyph_row (it->w, overlay_arrow_string); 15068 = get_overlay_arrow_glyph_row (it->w, overlay_arrow_string);
@@ -15083,10 +15087,12 @@ display_line (it)
15083 row->used[TEXT_AREA] = p2 - row->glyphs[TEXT_AREA]; 15087 row->used[TEXT_AREA] = p2 - row->glyphs[TEXT_AREA];
15084 } 15088 }
15085 } 15089 }
15086 15090 else
15091 {
15092 it->w->overlay_arrow_bitmap = overlay_arrow_bitmap;
15093 row->overlay_arrow_p = 1;
15094 }
15087 overlay_arrow_seen = 1; 15095 overlay_arrow_seen = 1;
15088 it->w->overlay_arrow_bitmap = overlay_arrow_bitmap;
15089 row->overlay_arrow_p = 1;
15090 } 15096 }
15091 15097
15092 /* Compute pixel dimensions of this line. */ 15098 /* Compute pixel dimensions of this line. */
@@ -15551,14 +15557,15 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky)
15551 15557
15552 if (this - 1 != last) 15558 if (this - 1 != last)
15553 { 15559 {
15560 int nchars, nbytes;
15561
15554 /* Output to end of string or up to '%'. Field width 15562 /* Output to end of string or up to '%'. Field width
15555 is length of string. Don't output more than 15563 is length of string. Don't output more than
15556 PRECISION allows us. */ 15564 PRECISION allows us. */
15557 --this; 15565 --this;
15558 15566
15559 prec = chars_in_text (last, this - last); 15567 prec = c_string_width (last, this - last, precision - n,
15560 if (precision > 0 && prec > precision - n) 15568 &nchars, &nbytes);
15561 prec = precision - n;
15562 15569
15563 if (frame_title_ptr) 15570 if (frame_title_ptr)
15564 n += store_frame_title (last, 0, prec); 15571 n += store_frame_title (last, 0, prec);
@@ -15566,9 +15573,12 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky)
15566 { 15573 {
15567 int bytepos = last - lisp_string; 15574 int bytepos = last - lisp_string;
15568 int charpos = string_byte_to_char (elt, bytepos); 15575 int charpos = string_byte_to_char (elt, bytepos);
15576 int endpos = (precision <= 0 ? SCHARS (elt)
15577 : charpos + nchars);
15578
15569 n += store_mode_line_string (NULL, 15579 n += store_mode_line_string (NULL,
15570 Fsubstring (elt, make_number (charpos), 15580 Fsubstring (elt, make_number (charpos),
15571 make_number (charpos + prec)), 15581 make_number (endpos)),
15572 0, 0, 0, Qnil); 15582 0, 0, 0, Qnil);
15573 } 15583 }
15574 else 15584 else
diff --git a/src/xfns.c b/src/xfns.c
index e41540a9942..3c8035c925a 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1921,29 +1921,83 @@ static XIMStyle supported_xim_styles[] =
1921}; 1921};
1922 1922
1923 1923
1924/* Create an X fontset on frame F with base font name 1924/* Create an X fontset on frame F with base font name BASE_FONTNAME. */
1925 BASE_FONTNAME.. */
1926 1925
1927static XFontSet 1926static XFontSet
1928xic_create_xfontset (f, base_fontname) 1927xic_create_xfontset (f, base_fontname)
1929 struct frame *f; 1928 struct frame *f;
1930 char *base_fontname; 1929 char *base_fontname;
1931{ 1930{
1932 XFontSet xfs; 1931 XFontSet xfs = NULL;
1933 char **missing_list; 1932 char **missing_list;
1934 int missing_count; 1933 int missing_count;
1935 char *def_string; 1934 char *def_string;
1935 Lisp_Object rest, frame;
1936
1937 /* See if there is another frame already using same fontset. */
1938 FOR_EACH_FRAME (rest, frame)
1939 {
1940 struct frame *cf = XFRAME (frame);
1941 if (cf != f && FRAME_LIVE_P (f) && FRAME_X_P (cf)
1942 && FRAME_X_DISPLAY_INFO (cf) == FRAME_X_DISPLAY_INFO (f)
1943 && !strcmp (FRAME_XIC_BASE_FONTNAME (cf), base_fontname))
1944 {
1945 xfs = FRAME_XIC_FONTSET (cf);
1946 break;
1947 }
1948 }
1936 1949
1937 xfs = XCreateFontSet (FRAME_X_DISPLAY (f), 1950 if (!xfs)
1938 base_fontname, &missing_list, 1951 /* New fontset. */
1939 &missing_count, &def_string); 1952 xfs = XCreateFontSet (FRAME_X_DISPLAY (f),
1953 base_fontname, &missing_list,
1954 &missing_count, &def_string);
1940 if (missing_list) 1955 if (missing_list)
1941 XFreeStringList (missing_list); 1956 XFreeStringList (missing_list);
1942 1957
1943 /* No need to free def_string. */ 1958 if (FRAME_XIC_BASE_FONTNAME (f))
1959 xfree (FRAME_XIC_BASE_FONTNAME (f));
1960 FRAME_XIC_BASE_FONTNAME (f) = xstrdup (base_fontname);
1961
1962 /* No need to free def_string. */
1944 return xfs; 1963 return xfs;
1945} 1964}
1946 1965
1966/* Free the X fontset of frame F if it is the last frame using it. */
1967
1968void
1969xic_free_xfontset (f)
1970 struct frame *f;
1971{
1972 Lisp_Object rest, frame;
1973 int shared_p = 0;
1974
1975 if (!FRAME_XIC_FONTSET (f))
1976 return;
1977
1978 /* See if there is another frame sharing the same fontset. */
1979 FOR_EACH_FRAME (rest, frame)
1980 {
1981 struct frame *cf = XFRAME (frame);
1982 if (cf != f && FRAME_LIVE_P (f) && FRAME_X_P (cf)
1983 && FRAME_X_DISPLAY_INFO (cf) == FRAME_X_DISPLAY_INFO (f)
1984 && FRAME_XIC_FONTSET (cf) == FRAME_XIC_FONTSET (f))
1985 {
1986 shared_p = 1;
1987 break;
1988 }
1989 }
1990
1991 if (!shared_p)
1992 /* The fontset is not used anymore. It is safe to free it. */
1993 XFreeFontSet (FRAME_X_DISPLAY (f), FRAME_XIC_FONTSET (f));
1994
1995 if (FRAME_XIC_BASE_FONTNAME (f))
1996 xfree (FRAME_XIC_BASE_FONTNAME (f));
1997 FRAME_XIC_BASE_FONTNAME (f) = NULL;
1998 FRAME_XIC_FONTSET (f) = NULL;
1999}
2000
1947 2001
1948/* Value is the best input style, given user preferences USER (already 2002/* Value is the best input style, given user preferences USER (already
1949 checked to be supported by Emacs), and styles supported by the 2003 checked to be supported by Emacs), and styles supported by the
@@ -2094,11 +2148,9 @@ free_frame_xic (f)
2094 return; 2148 return;
2095 2149
2096 XDestroyIC (FRAME_XIC (f)); 2150 XDestroyIC (FRAME_XIC (f));
2097 if (FRAME_XIC_FONTSET (f)) 2151 xic_free_xfontset (f);
2098 XFreeFontSet (FRAME_X_DISPLAY (f), FRAME_XIC_FONTSET (f));
2099 2152
2100 FRAME_XIC (f) = NULL; 2153 FRAME_XIC (f) = NULL;
2101 FRAME_XIC_FONTSET (f) = NULL;
2102} 2154}
2103 2155
2104 2156
@@ -2177,6 +2229,8 @@ xic_set_xfontset (f, base_fontname)
2177 XVaNestedList attr; 2229 XVaNestedList attr;
2178 XFontSet xfs; 2230 XFontSet xfs;
2179 2231
2232 xic_free_xfontset (f);
2233
2180 xfs = xic_create_xfontset (f, base_fontname); 2234 xfs = xic_create_xfontset (f, base_fontname);
2181 2235
2182 attr = XVaCreateNestedList (0, XNFontSet, xfs, NULL); 2236 attr = XVaCreateNestedList (0, XNFontSet, xfs, NULL);
@@ -2186,8 +2240,6 @@ xic_set_xfontset (f, base_fontname)
2186 XSetICValues (FRAME_XIC (f), XNStatusAttributes, attr, NULL); 2240 XSetICValues (FRAME_XIC (f), XNStatusAttributes, attr, NULL);
2187 XFree (attr); 2241 XFree (attr);
2188 2242
2189 if (FRAME_XIC_FONTSET (f))
2190 XFreeFontSet (FRAME_X_DISPLAY (f), FRAME_XIC_FONTSET (f));
2191 FRAME_XIC_FONTSET (f) = xfs; 2243 FRAME_XIC_FONTSET (f) = xfs;
2192} 2244}
2193 2245
diff --git a/src/xterm.c b/src/xterm.c
index ef469a2b82e..603df429dce 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -2829,10 +2829,6 @@ x_clear_frame ()
2829 2829
2830 XFlush (FRAME_X_DISPLAY (f)); 2830 XFlush (FRAME_X_DISPLAY (f));
2831 2831
2832#ifdef USE_GTK
2833 xg_frame_cleared (f);
2834#endif
2835
2836 UNBLOCK_INPUT; 2832 UNBLOCK_INPUT;
2837} 2833}
2838 2834
@@ -4867,9 +4863,7 @@ x_scroll_bar_create (w, top, left, width, height)
4867 top, 4863 top,
4868 left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, 4864 left + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
4869 width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2, 4865 width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
4870 max (height, 1), 4866 max (height, 1));
4871 left,
4872 width);
4873 xg_show_scroll_bar (SCROLL_BAR_X_WINDOW (bar)); 4867 xg_show_scroll_bar (SCROLL_BAR_X_WINDOW (bar));
4874#else /* not USE_GTK */ 4868#else /* not USE_GTK */
4875 Widget scroll_bar = SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar); 4869 Widget scroll_bar = SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar);
@@ -5113,18 +5107,6 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
5113 5107
5114#ifdef USE_TOOLKIT_SCROLL_BARS 5108#ifdef USE_TOOLKIT_SCROLL_BARS
5115 5109
5116#ifdef USE_GTK
5117 if (mask)
5118 xg_update_scrollbar_pos (f,
5119 SCROLL_BAR_X_WINDOW (bar),
5120 top,
5121 sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
5122 sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
5123 max (height, 1),
5124 left,
5125 width);
5126#else /* not USE_GTK */
5127
5128 /* Move/size the scroll bar widget. */ 5110 /* Move/size the scroll bar widget. */
5129 if (mask) 5111 if (mask)
5130 { 5112 {
@@ -5133,13 +5115,21 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
5133 if (width > 0 && height > 0) 5115 if (width > 0 && height > 0)
5134 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 5116 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
5135 left, top, width, height, False); 5117 left, top, width, height, False);
5118#ifdef USE_GTK
5119 xg_update_scrollbar_pos (f,
5120 SCROLL_BAR_X_WINDOW (bar),
5121 top,
5122 sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
5123 sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM *2,
5124 max (height, 1));
5125#else /* not USE_GTK */
5136 XtConfigureWidget (SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar), 5126 XtConfigureWidget (SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar),
5137 sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, 5127 sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
5138 top, 5128 top,
5139 sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2, 5129 sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
5140 max (height, 1), 0); 5130 max (height, 1), 0);
5141 }
5142#endif /* not USE_GTK */ 5131#endif /* not USE_GTK */
5132 }
5143#else /* not USE_TOOLKIT_SCROLL_BARS */ 5133#else /* not USE_TOOLKIT_SCROLL_BARS */
5144 5134
5145 /* Clear areas not covered by the scroll bar because of 5135 /* Clear areas not covered by the scroll bar because of
@@ -8046,11 +8036,7 @@ xim_destroy_callback (xim, client_data, call_data)
8046 if (FRAME_X_DISPLAY_INFO (f) == dpyinfo) 8036 if (FRAME_X_DISPLAY_INFO (f) == dpyinfo)
8047 { 8037 {
8048 FRAME_XIC (f) = NULL; 8038 FRAME_XIC (f) = NULL;
8049 if (FRAME_XIC_FONTSET (f)) 8039 xic_free_xfontset (f);
8050 {
8051 XFreeFontSet (FRAME_X_DISPLAY (f), FRAME_XIC_FONTSET (f));
8052 FRAME_XIC_FONTSET (f) = NULL;
8053 }
8054 } 8040 }
8055 } 8041 }
8056 8042
diff --git a/src/xterm.h b/src/xterm.h
index 76cba8a2517..4e38ac18e3d 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -21,8 +21,13 @@ Boston, MA 02111-1307, USA. */
21 21
22#include <X11/Xlib.h> 22#include <X11/Xlib.h>
23#include <X11/cursorfont.h> 23#include <X11/cursorfont.h>
24
25/* Include Xutil.h after keysym.h to work around a bug that prevents
26 correct recognition of AltGr key in some X versions. */
27
24#include <X11/keysym.h> 28#include <X11/keysym.h>
25#include <X11/Xutil.h> 29#include <X11/Xutil.h>
30
26#include <X11/Xatom.h> 31#include <X11/Xatom.h>
27#include <X11/Xresource.h> 32#include <X11/Xresource.h>
28 33
@@ -45,7 +50,9 @@ typedef Widget xt_or_gtk_widget;
45typedef GtkWidget *xt_or_gtk_widget; 50typedef GtkWidget *xt_or_gtk_widget;
46#define XtParent(x) (gtk_widget_get_parent (x)) 51#define XtParent(x) (gtk_widget_get_parent (x))
47#undef XSync 52#undef XSync
48#define XSync(d, b) gdk_window_process_all_updates () 53#define XSync(d, b) do { gdk_window_process_all_updates (); \
54 XSync (d, b); } while (0)
55
49 56
50#endif /* USE_GTK */ 57#endif /* USE_GTK */
51 58
@@ -596,6 +603,7 @@ struct x_output
596 XIC xic; 603 XIC xic;
597 XIMStyle xic_style; 604 XIMStyle xic_style;
598 XFontSet xic_xfs; 605 XFontSet xic_xfs;
606 char *xic_base_fontname;
599#endif 607#endif
600 608
601 /* Relief GCs, colors etc. */ 609 /* Relief GCs, colors etc. */
@@ -730,6 +738,7 @@ enum
730#define FRAME_X_XIM_STYLES(f) (FRAME_X_DISPLAY_INFO (f)->xim_styles) 738#define FRAME_X_XIM_STYLES(f) (FRAME_X_DISPLAY_INFO (f)->xim_styles)
731#define FRAME_XIC_STYLE(f) ((f)->output_data.x->xic_style) 739#define FRAME_XIC_STYLE(f) ((f)->output_data.x->xic_style)
732#define FRAME_XIC_FONTSET(f) ((f)->output_data.x->xic_xfs) 740#define FRAME_XIC_FONTSET(f) ((f)->output_data.x->xic_xfs)
741#define FRAME_XIC_BASE_FONTNAME(f) ((f)->output_data.x->xic_base_fontname)
733 742
734/* Value is the smallest width of any character in any font on frame F. */ 743/* Value is the smallest width of any character in any font on frame F. */
735 744
@@ -1039,6 +1048,7 @@ extern void x_set_menu_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object))
1039extern unsigned char * x_encode_text P_ ((Lisp_Object, Lisp_Object, int, 1048extern unsigned char * x_encode_text P_ ((Lisp_Object, Lisp_Object, int,
1040 int *, int *)); 1049 int *, int *));
1041extern void x_implicitly_set_name P_ ((struct frame *, Lisp_Object, Lisp_Object)); 1050extern void x_implicitly_set_name P_ ((struct frame *, Lisp_Object, Lisp_Object));
1051extern void xic_free_xfontset P_ ((struct frame *));
1042extern void create_frame_xic P_ ((struct frame *)); 1052extern void create_frame_xic P_ ((struct frame *));
1043extern void destroy_frame_xic P_ ((struct frame *)); 1053extern void destroy_frame_xic P_ ((struct frame *));
1044extern void xic_set_preeditarea P_ ((struct window *, int, int)); 1054extern void xic_set_preeditarea P_ ((struct window *, int, int));