aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMiles Bader2006-07-06 08:59:39 +0000
committerMiles Bader2006-07-06 08:59:39 +0000
commit6a46b0188332c8007c23014bd0ba97441be6abe8 (patch)
treee6bad7efe8102d87934fbae8f1b34341cd4e4957 /src
parent5ed089581a49f8f0eba2d911203ff5db57eac322 (diff)
parent978db1472a9d4bbaafbc93b9176f7c409ac209bd (diff)
downloademacs-6a46b0188332c8007c23014bd0ba97441be6abe8.tar.gz
emacs-6a46b0188332c8007c23014bd0ba97441be6abe8.zip
Merge from emacs--devo--0
Patches applied: * emacs--devo--0 (patch 320-342) - Update from CVS - Merge from gnus--rel--5.10 - lisp/play/cookie1.el (cookie): Work properly when there's only one entry - Add note about "link" button-class to etc/TODO * gnus--rel--5.10 (patch 108-112) - Merge from emacs--devo--0 - Clean up merge mistakes - Update from CVS - Update from CVS: texi/gnus.texi (Summary Buffer Lines): Fix typo. Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-86
Diffstat (limited to 'src')
-rw-r--r--src/.gdbinit9
-rw-r--r--src/ChangeLog143
-rw-r--r--src/dired.c10
-rw-r--r--src/dispextern.h20
-rw-r--r--src/dispnew.c2
-rw-r--r--src/editfns.c25
-rw-r--r--src/eval.c3
-rw-r--r--src/fileio.c8
-rw-r--r--src/insdel.c20
-rw-r--r--src/lread.c4
-rw-r--r--src/mac.c2
-rw-r--r--src/macfns.c3
-rw-r--r--src/macgui.h2
-rw-r--r--src/macterm.c93
-rw-r--r--src/puresize.h2
-rw-r--r--src/s/gnu-linux.h10
-rw-r--r--src/textprop.c11
-rw-r--r--src/w32console.c2
-rw-r--r--src/w32fns.c9
-rw-r--r--src/w32term.c17
-rw-r--r--src/xdisp.c78
-rw-r--r--src/xfaces.c9
-rw-r--r--src/xfns.c7
-rw-r--r--src/xterm.c16
24 files changed, 414 insertions, 91 deletions
diff --git a/src/.gdbinit b/src/.gdbinit
index dd848fed3d5..60730536ae9 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -217,6 +217,15 @@ define pitx
217 printf " a+d=%d+%d=%d", $it->ascent, $it->descent, $it->ascent+$it->descent 217 printf " a+d=%d+%d=%d", $it->ascent, $it->descent, $it->ascent+$it->descent
218 printf " max=%d+%d=%d", $it->max_ascent, $it->max_descent, $it->max_ascent+$it->max_descent 218 printf " max=%d+%d=%d", $it->max_ascent, $it->max_descent, $it->max_ascent+$it->max_descent
219 printf "\n" 219 printf "\n"
220 set $i = 0
221 while ($i < $it->sp)
222 set $e = $it->stack[$i]
223 printf "stack[%d]: ", $i
224 output $e->method
225 printf "[%d]", $e->position.charpos
226 printf "\n"
227 set $i = $i + 1
228 end
220end 229end
221document pitx 230document pitx
222Pretty print a display iterator. 231Pretty print a display iterator.
diff --git a/src/ChangeLog b/src/ChangeLog
index 3e523d28f8d..4b817c11eae 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,144 @@
12006-07-05 Chong Yidong <cyd@stupidchicken.com>
2
3 * insdel.c (prepare_to_modify_buffer): For an indirect buffer, do
4 clash detection using the base buffer.
5
6 * puresize.h (BASE_PURESIZE): Increment to 1210500.
7
82006-07-04 Kim F. Storm <storm@cua.dk>
9
10 * xterm.c (x_delete_display): Don't free or derefence NULL pointers.
11
122006-07-04 Kenichi Handa <handa@m17n.org>
13
14 * fontset.c (Fset_overriding_fontspec_internal): Check if we need
15 to update Voverriding_fontspec_alist.
16
172006-07-03 Richard Stallman <rms@gnu.org>
18
19 * xfns.c (Fx_create_frame): Move unwind_create_frame setup down.
20
21 * xfaces.c (Fface_attribute_relative_p): Doc fix.
22
23 * textprop.c (Fget_char_property_and_overlay): Doc fix.
24
25 * eval.c (Fdefvaralias): Doc fix.
26
272006-07-03 Kim F. Storm <storm@cua.dk>
28
29 * dispnew.c (sit_for): Fix preempt condition.
30
312006-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
32
33 * lread.c (read_filtered_event): Treat select-window just like
34 switch-frame.
35
362006-07-02 Kim F. Storm <storm@cua.dk>
37
38 * xdisp.c (display_tool_bar_line): Skip glyphs which are too big
39 to ever fit the tool-bar,
40 (MAX_FRAME_TOOL_BAR_HEIGHT): New macro.
41 (tool_bar_lines_needed): Use unused mode-line row as temp_row.
42 (redisplay_tool_bar): Only clear desired matrix if we actually
43 change the tool-bar window height. Only try to make the tool-bar
44 window bigger if there is actually room for it.
45
462006-06-30 Ralf Angeli <angeli@caeruleus.net>
47
48 * w32term.c (x_make_frame_visible): Use SystemParametersInfo with
49 SPI_GETWORKAREA to find the dimensions of the screen work area,
50 and adjust vertical position of the frame in order to avoid being
51 covered by the task bar.
52
53 * w32fns.c (w32_createwindow): Use CW_USEDEFAULT instead of
54 f->left_pos and SH_SHOW instead of f->top_pos in the call to
55 CreateWindow. Record the actual position in f->left_pos and
56 f->top_pos.
57
582006-06-30 John Paul Wallington <jpw@pobox.com>
59
60 * w32console.c (syms_of_ntterm) <w32-use-full-screen-buffer>:
61 Doc fix - default value has changed.
62
632006-06-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
64
65 * mac.c [!TARGET_API_MAC_CARBON]: Don't include FixMath.h or Scrap.h.
66
67 * macfns.c (Fx_create_frame): Apply 2006-06-24 change for xfns.c.
68
69 * macgui.h (USE_MAC_TSM) [TARGET_API_MAC_CARBON]: Set default to 1.
70
71 * macterm.c (Qeql): Add extern.
72 (x_set_mouse_pixel_position) [MAC_OSX]: Use CGWarpMouseCursorPosition.
73 (fm_style_face_attributes_alist) [USE_ATSUI]: New variable.
74 (syms_of_macterm) [USE_ATSUI]: Initialize and staticpro it.
75 Change keys of Vmac_atsu_font_table from strings to numbers.
76 (fm_style_to_face_attributes) [USE_ATSUI]: New function.
77 (init_font_name_table) [USE_ATSUI]: Use it.
78 (saved_ts_script_language_on_focus) [USE_MAC_TSM]: New variable.
79 (syms_of_macterm) [USE_MAC_TSM]: Initialize and staticpro it.
80 [USE_MAC_TSM] (mac_tsm_resume): Restore script and language codes
81 only when saved_ts_script_language_on_focus coincides with
82 Vmac_ts_script_language_on_focus.
83 [USE_MAC_TSM] (mac_tsm_suspend): Save value of
84 Vmac_ts_script_language_on_focus to saved_ts_script_language_on_focus.
85 (XTread_socket) [USE_MAC_TSM]: Add Mac OS Classic support.
86 [USE_MAC_TSM] (mac_handle_text_input_event, init_tsm): Likewise.
87
882006-06-27 Chong Yidong <cyd@stupidchicken.com>
89
90 * editfns.c (Fdelete_field, Ffield_string, Ffield_beginning)
91 (Ffield_string_no_properties, Ffield_end): Mention
92 args-out-of-range error condition in docstring.
93
942006-06-27 Kim F. Storm <storm@cua.dk>
95
96 * xdisp.c (handle_composition_prop): Set stop_charpos before push_it.
97
982006-06-25 Kim F. Storm <storm@cua.dk>
99
100 * s/gnu-linux.h (SIGNALS_VIA_CHARACTERS): Define for Linux kernel
101 version 2.4 and later.
102
1032006-06-24 Chong Yidong <cyd@stupidchicken.com>
104
105 * xfns.c (Fx_create_frame): Set font parameter directly instead of
106 using x_default_parameter, since x_get_args clears the parm alist.
107
1082006-06-24 Eli Zaretskii <eliz@gnu.org>
109
110 * dired.c (directory_files_internal) [WINDOWSNT]: Find files
111 case-insensitively.
112
1132006-06-24 Aidan Kehoe <kehoea@parhasard.net>
114
115 * lread.c (read_escape): When an unknown Unicode code point is
116 encountered as a string or character escape, signal an error.
117
1182006-06-23 Kim F. Storm <storm@cua.dk>
119
120 * .gdbinit (pitx): Dump iterator stack.
121
122 * xdisp.c (handle_composition_prop): Push iterator on stack.
123 (set_iterator_to_next): Pop iterator at end of composition.
124
1252006-06-23 Martin Rudalics <rudalics@gmx.at>
126
127 * fileio.c (Frename_file) [DOS_NT]: Don't try to move directory to
128 itself on DOS_NT platforms, if the old and new names are identical
129 but for the letter-case.
130
1312006-06-21 Kim F. Storm <storm@cua.dk>
132
133 * dispextern.h (struct it): Add `position' member to iterator stack.
134 Rename `pos' member to `current'. Rearrange and add comments.
135
136 * xdisp.c (handle_stop): Set it->ignore_overlay_strings_at_pos_p
137 if we get any overlays.
138 (set_cursor_from_row): Don't clobber `end' if we rescan from
139 start_string.
140 (push_it, pop_it): Save it->position.
141
12006-06-19 Richard Stallman <rms@gnu.org> 1422006-06-19 Richard Stallman <rms@gnu.org>
2 143
3 * window.c (size_window): New arg FIRST_ONLY. All callers changed. 144 * window.c (size_window): New arg FIRST_ONLY. All callers changed.
@@ -5,7 +146,7 @@
5 for the case of a top-level window and the following minibuffer. 146 for the case of a top-level window and the following minibuffer.
6 Don't exit because of no `next' when there is a parent. 147 Don't exit because of no `next' when there is a parent.
7 Use the FIRST_ONLY feature when resizing following windows. 148 Use the FIRST_ONLY feature when resizing following windows.
8 149
9 * syntax.c (init_syntax_once): Give most control chars' syntax Spunct. 150 * syntax.c (init_syntax_once): Give most control chars' syntax Spunct.
10 151
112006-06-17 Kim F. Storm <storm@cua.dk> 1522006-06-17 Kim F. Storm <storm@cua.dk>
diff --git a/src/dired.c b/src/dired.c
index 4075f9b7b79..fe3382fd7a7 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -176,9 +176,15 @@ directory_files_internal (directory, full, match, nosort, attrs, id_format)
176#ifdef VMS 176#ifdef VMS
177 bufp = compile_pattern (match, 0, 177 bufp = compile_pattern (match, 0,
178 buffer_defaults.downcase_table, 0, 1); 178 buffer_defaults.downcase_table, 0, 1);
179#else 179#else /* !VMS */
180# ifdef WINDOWSNT
181 /* Windows users want case-insensitive wildcards. */
182 bufp = compile_pattern (match, 0,
183 buffer_defaults.case_canon_table, 0, 1);
184# else /* !WINDOWSNT */
180 bufp = compile_pattern (match, 0, Qnil, 0, 1); 185 bufp = compile_pattern (match, 0, Qnil, 0, 1);
181#endif 186# endif /* !WINDOWSNT */
187#endif /* !VMS */
182 } 188 }
183 189
184 /* Note: ENCODE_FILE and DECODE_FILE can GC because they can run 190 /* Note: ENCODE_FILE and DECODE_FILE can GC because they can run
diff --git a/src/dispextern.h b/src/dispextern.h
index 8c9c427f68d..0acaf6b38ec 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1937,35 +1937,45 @@ struct it
1937 from what we previously had. */ 1937 from what we previously had. */
1938 struct iterator_stack_entry 1938 struct iterator_stack_entry
1939 { 1939 {
1940 Lisp_Object string;
1941 int string_nchars;
1942 int end_charpos;
1940 int stop_charpos; 1943 int stop_charpos;
1941 int face_id; 1944 int face_id;
1942 Lisp_Object string; 1945
1946 /* Save values specific to a given method. */
1943 union { 1947 union {
1948 /* method == GET_FROM_IMAGE */
1944 struct { 1949 struct {
1945 Lisp_Object object; 1950 Lisp_Object object;
1946 struct it_slice slice; 1951 struct it_slice slice;
1947 int image_id; 1952 int image_id;
1948 } image; 1953 } image;
1954 /* method == GET_FROM_COMPOSITION */
1949 struct { 1955 struct {
1950 Lisp_Object object; 1956 Lisp_Object object;
1951 int c, len; 1957 int c, len;
1952 int cmp_id, cmp_len; 1958 int cmp_id, cmp_len;
1953 } comp; 1959 } comp;
1960 /* method == GET_FROM_STRETCH */
1954 struct { 1961 struct {
1955 Lisp_Object object; 1962 Lisp_Object object;
1956 } stretch; 1963 } stretch;
1957 } u; 1964 } u;
1958 struct display_pos pos; 1965
1959 int end_charpos; 1966 /* current text and display positions. */
1960 int string_nchars; 1967 struct text_pos position;
1968 struct display_pos current;
1961 enum glyph_row_area area; 1969 enum glyph_row_area area;
1962 enum it_method method; 1970 enum it_method method;
1963 unsigned multibyte_p : 1; 1971 unsigned multibyte_p : 1;
1964 unsigned string_from_display_prop_p : 1; 1972 unsigned string_from_display_prop_p : 1;
1965 unsigned display_ellipsis_p : 1; 1973 unsigned display_ellipsis_p : 1;
1974
1975 /* properties from display property that are reset by another display property. */
1966 Lisp_Object space_width; 1976 Lisp_Object space_width;
1967 short voffset;
1968 Lisp_Object font_height; 1977 Lisp_Object font_height;
1978 short voffset;
1969 } 1979 }
1970 stack[IT_STACK_SIZE]; 1980 stack[IT_STACK_SIZE];
1971 1981
diff --git a/src/dispnew.c b/src/dispnew.c
index b899cd2bd93..bf0d0044491 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -6490,7 +6490,7 @@ Lisp_Object
6490sit_for (sec, usec, reading, display, initial_display) 6490sit_for (sec, usec, reading, display, initial_display)
6491 int sec, usec, reading, display, initial_display; 6491 int sec, usec, reading, display, initial_display;
6492{ 6492{
6493 int preempt = (sec >= 0) || (sec == 0 && usec >= 0); 6493 int preempt = (sec > 0) || (sec == 0 && usec >= 0);
6494 6494
6495 swallow_events (display); 6495 swallow_events (display);
6496 6496
diff --git a/src/editfns.c b/src/editfns.c
index 4578af6973c..d758e82bbb0 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -626,7 +626,10 @@ find_field (pos, merge_at_boundary, beg_limit, beg, end_limit, end)
626DEFUN ("delete-field", Fdelete_field, Sdelete_field, 0, 1, 0, 626DEFUN ("delete-field", Fdelete_field, Sdelete_field, 0, 1, 0,
627 doc: /* Delete the field surrounding POS. 627 doc: /* Delete the field surrounding POS.
628A field is a region of text with the same `field' property. 628A field is a region of text with the same `field' property.
629If POS is nil, the value of point is used for POS. */) 629If POS is nil, the value of point is used for POS.
630
631An `args-out-of-range' error is signaled if POS is outside the
632buffer's accessible portion. */)
630 (pos) 633 (pos)
631 Lisp_Object pos; 634 Lisp_Object pos;
632{ 635{
@@ -640,7 +643,10 @@ If POS is nil, the value of point is used for POS. */)
640DEFUN ("field-string", Ffield_string, Sfield_string, 0, 1, 0, 643DEFUN ("field-string", Ffield_string, Sfield_string, 0, 1, 0,
641 doc: /* Return the contents of the field surrounding POS as a string. 644 doc: /* Return the contents of the field surrounding POS as a string.
642A field is a region of text with the same `field' property. 645A field is a region of text with the same `field' property.
643If POS is nil, the value of point is used for POS. */) 646If POS is nil, the value of point is used for POS.
647
648An `args-out-of-range' error is signaled if POS is outside the
649buffer's accessible portion. */)
644 (pos) 650 (pos)
645 Lisp_Object pos; 651 Lisp_Object pos;
646{ 652{
@@ -652,7 +658,10 @@ If POS is nil, the value of point is used for POS. */)
652DEFUN ("field-string-no-properties", Ffield_string_no_properties, Sfield_string_no_properties, 0, 1, 0, 658DEFUN ("field-string-no-properties", Ffield_string_no_properties, Sfield_string_no_properties, 0, 1, 0,
653 doc: /* Return the contents of the field around POS, without text-properties. 659 doc: /* Return the contents of the field around POS, without text-properties.
654A field is a region of text with the same `field' property. 660A field is a region of text with the same `field' property.
655If POS is nil, the value of point is used for POS. */) 661If POS is nil, the value of point is used for POS.
662
663An `args-out-of-range' error is signaled if POS is outside the
664buffer's accessible portion. */)
656 (pos) 665 (pos)
657 Lisp_Object pos; 666 Lisp_Object pos;
658{ 667{
@@ -668,7 +677,10 @@ If POS is nil, the value of point is used for POS.
668If ESCAPE-FROM-EDGE is non-nil and POS is at the beginning of its 677If ESCAPE-FROM-EDGE is non-nil and POS is at the beginning of its
669field, then the beginning of the *previous* field is returned. 678field, then the beginning of the *previous* field is returned.
670If LIMIT is non-nil, it is a buffer position; if the beginning of the field 679If LIMIT is non-nil, it is a buffer position; if the beginning of the field
671is before LIMIT, then LIMIT will be returned instead. */) 680is before LIMIT, then LIMIT will be returned instead.
681
682An `args-out-of-range' error is signaled if POS is outside the
683buffer's accessible portion. */)
672 (pos, escape_from_edge, limit) 684 (pos, escape_from_edge, limit)
673 Lisp_Object pos, escape_from_edge, limit; 685 Lisp_Object pos, escape_from_edge, limit;
674{ 686{
@@ -684,7 +696,10 @@ If POS is nil, the value of point is used for POS.
684If ESCAPE-FROM-EDGE is non-nil and POS is at the end of its field, 696If ESCAPE-FROM-EDGE is non-nil and POS is at the end of its field,
685then the end of the *following* field is returned. 697then the end of the *following* field is returned.
686If LIMIT is non-nil, it is a buffer position; if the end of the field 698If LIMIT is non-nil, it is a buffer position; if the end of the field
687is after LIMIT, then LIMIT will be returned instead. */) 699is after LIMIT, then LIMIT will be returned instead.
700
701An `args-out-of-range' error is signaled if POS is outside the
702buffer's accessible portion. */)
688 (pos, escape_from_edge, limit) 703 (pos, escape_from_edge, limit)
689 Lisp_Object pos, escape_from_edge, limit; 704 Lisp_Object pos, escape_from_edge, limit;
690{ 705{
diff --git a/src/eval.c b/src/eval.c
index 5f8d266ec7b..30df5f8ea36 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -749,8 +749,7 @@ usage: (defmacro NAME ARGLIST [DOCSTRING] [DECL] BODY...) */)
749 749
750DEFUN ("defvaralias", Fdefvaralias, Sdefvaralias, 2, 3, 0, 750DEFUN ("defvaralias", Fdefvaralias, Sdefvaralias, 2, 3, 0,
751 doc: /* Make NEW-ALIAS a variable alias for symbol BASE-VARIABLE. 751 doc: /* Make NEW-ALIAS a variable alias for symbol BASE-VARIABLE.
752Setting the value of NEW-ALIAS will subsequently set the value of BASE-VARIABLE, 752Aliased variables always have the same value; setting one sets the other.
753 and getting the value of NEW-ALIAS will return the value BASE-VARIABLE has.
754Third arg DOCSTRING, if non-nil, is documentation for NEW-ALIAS. If it is 753Third arg DOCSTRING, if non-nil, is documentation for NEW-ALIAS. If it is
755 omitted or nil, NEW-ALIAS gets the documentation string of BASE-VARIABLE, 754 omitted or nil, NEW-ALIAS gets the documentation string of BASE-VARIABLE,
756 or of the variable at the end of the chain of aliases, if BASE-VARIABLE is 755 or of the variable at the end of the chain of aliases, if BASE-VARIABLE is
diff --git a/src/fileio.c b/src/fileio.c
index 8ce89ba23f3..82af5cf6cf9 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2755,7 +2755,13 @@ This is what happens in interactive use with M-x. */)
2755 CHECK_STRING (newname); 2755 CHECK_STRING (newname);
2756 file = Fexpand_file_name (file, Qnil); 2756 file = Fexpand_file_name (file, Qnil);
2757 2757
2758 if (!NILP (Ffile_directory_p (newname))) 2758 if ((!NILP (Ffile_directory_p (newname)))
2759#ifdef DOS_NT
2760 /* If the file names are identical but for the case,
2761 don't attempt to move directory to itself. */
2762 && (NILP (Fstring_equal (Fdowncase (file), Fdowncase (newname))))
2763#endif
2764 )
2759 newname = Fexpand_file_name (Ffile_name_nondirectory (file), newname); 2765 newname = Fexpand_file_name (Ffile_name_nondirectory (file), newname);
2760 else 2766 else
2761 newname = Fexpand_file_name (newname, Qnil); 2767 newname = Fexpand_file_name (newname, Qnil);
diff --git a/src/insdel.c b/src/insdel.c
index 6decf7b3f27..df0831c9652 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -2064,6 +2064,8 @@ prepare_to_modify_buffer (start, end, preserve_ptr)
2064 int start, end; 2064 int start, end;
2065 int *preserve_ptr; 2065 int *preserve_ptr;
2066{ 2066{
2067 struct buffer *base_buffer;
2068
2067 if (!NILP (current_buffer->read_only)) 2069 if (!NILP (current_buffer->read_only))
2068 Fbarf_if_buffer_read_only (); 2070 Fbarf_if_buffer_read_only ();
2069 2071
@@ -2089,20 +2091,26 @@ prepare_to_modify_buffer (start, end, preserve_ptr)
2089 verify_interval_modification (current_buffer, start, end); 2091 verify_interval_modification (current_buffer, start, end);
2090 } 2092 }
2091 2093
2094 /* For indirect buffers, use the base buffer to check clashes. */
2095 if (current_buffer->base_buffer != 0)
2096 base_buffer = current_buffer->base_buffer;
2097 else
2098 base_buffer = current_buffer;
2099
2092#ifdef CLASH_DETECTION 2100#ifdef CLASH_DETECTION
2093 if (!NILP (current_buffer->file_truename) 2101 if (!NILP (base_buffer->file_truename)
2094 /* Make binding buffer-file-name to nil effective. */ 2102 /* Make binding buffer-file-name to nil effective. */
2095 && !NILP (current_buffer->filename) 2103 && !NILP (base_buffer->filename)
2096 && SAVE_MODIFF >= MODIFF) 2104 && SAVE_MODIFF >= MODIFF)
2097 lock_file (current_buffer->file_truename); 2105 lock_file (base_buffer->file_truename);
2098#else 2106#else
2099 /* At least warn if this file has changed on disk since it was visited. */ 2107 /* At least warn if this file has changed on disk since it was visited. */
2100 if (!NILP (current_buffer->filename) 2108 if (!NILP (base_buffer->filename)
2101 && SAVE_MODIFF >= MODIFF 2109 && SAVE_MODIFF >= MODIFF
2102 && NILP (Fverify_visited_file_modtime (Fcurrent_buffer ())) 2110 && NILP (Fverify_visited_file_modtime (Fcurrent_buffer ()))
2103 && !NILP (Ffile_exists_p (current_buffer->filename))) 2111 && !NILP (Ffile_exists_p (base_buffer->filename)))
2104 call1 (intern ("ask-user-about-supersession-threat"), 2112 call1 (intern ("ask-user-about-supersession-threat"),
2105 current_buffer->filename); 2113 base_buffer->filename);
2106#endif /* not CLASH_DETECTION */ 2114#endif /* not CLASH_DETECTION */
2107 2115
2108 signal_before_change (start, end, preserve_ptr); 2116 signal_before_change (start, end, preserve_ptr);
diff --git a/src/lread.c b/src/lread.c
index 824bc5f7502..5d8e39d7fb1 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -659,7 +659,7 @@ read_filtered_event (no_switch_frame, ascii_required, error_nonascii,
659 switch-frame events will read it and process it. */ 659 switch-frame events will read it and process it. */
660 if (no_switch_frame 660 if (no_switch_frame
661 && EVENT_HAS_PARAMETERS (val) 661 && EVENT_HAS_PARAMETERS (val)
662 && EQ (EVENT_HEAD (val), Qswitch_frame)) 662 && EQ (EVENT_HEAD_KIND (EVENT_HEAD (val)), Qswitch_frame))
663 { 663 {
664 delayed_switch_frame = val; 664 delayed_switch_frame = val;
665 goto retry; 665 goto retry;
@@ -2107,7 +2107,7 @@ read_escape (readcharfun, stringp)
2107 while (++count <= unicode_hex_count) 2107 while (++count <= unicode_hex_count)
2108 { 2108 {
2109 c = READCHAR; 2109 c = READCHAR;
2110 /* isdigit(), isalpha() may be locale-specific, which we don't 2110 /* isdigit and isalpha may be locale-specific, which we don't
2111 want. */ 2111 want. */
2112 if (c >= '0' && c <= '9') i = (i << 4) + (c - '0'); 2112 if (c >= '0' && c <= '9') i = (i << 4) + (c - '0');
2113 else if (c >= 'a' && c <= 'f') i = (i << 4) + (c - 'a') + 10; 2113 else if (c >= 'a' && c <= 'f') i = (i << 4) + (c - 'a') + 10;
diff --git a/src/mac.c b/src/mac.c
index 5fc9ea4ee28..e25ed435342 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -46,11 +46,9 @@ Boston, MA 02110-1301, USA. */
46#include <Folders.h> 46#include <Folders.h>
47#include <Resources.h> 47#include <Resources.h>
48#include <Aliases.h> 48#include <Aliases.h>
49#include <FixMath.h>
50#include <Timer.h> 49#include <Timer.h>
51#include <OSA.h> 50#include <OSA.h>
52#include <AppleScript.h> 51#include <AppleScript.h>
53#include <Scrap.h>
54#include <Events.h> 52#include <Events.h>
55#include <Processes.h> 53#include <Processes.h>
56#include <EPPC.h> 54#include <EPPC.h>
diff --git a/src/macfns.c b/src/macfns.c
index 6d77aea0409..10e7dd97fa1 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -2646,8 +2646,7 @@ This function is an internal primitive--use `make-frame' instead. */)
2646 error ("Cannot find any usable font"); 2646 error ("Cannot find any usable font");
2647 UNBLOCK_INPUT; 2647 UNBLOCK_INPUT;
2648 2648
2649 x_default_parameter (f, parms, Qfont, font, 2649 x_set_frame_parameters (f, Fcons (Fcons (Qfont, font), Qnil));
2650 "font", "Font", RES_TYPE_STRING);
2651 } 2650 }
2652 2651
2653 x_default_parameter (f, parms, Qborder_width, make_number (0), 2652 x_default_parameter (f, parms, Qborder_width, make_number (0),
diff --git a/src/macgui.h b/src/macgui.h
index 90688e5703e..01f5317aad6 100644
--- a/src/macgui.h
+++ b/src/macgui.h
@@ -114,7 +114,7 @@ typedef unsigned long Time;
114 114
115/* Whether to use Text Services Manager. */ 115/* Whether to use Text Services Manager. */
116#ifndef USE_MAC_TSM 116#ifndef USE_MAC_TSM
117#ifdef MAC_OSX 117#if TARGET_API_MAC_CARBON
118#define USE_MAC_TSM 1 118#define USE_MAC_TSM 1
119#endif 119#endif
120#endif 120#endif
diff --git a/src/macterm.c b/src/macterm.c
index 7e354642759..a6fc6b1a497 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -198,6 +198,8 @@ static int input_signal_count;
198 198
199extern Lisp_Object Vsystem_name; 199extern Lisp_Object Vsystem_name;
200 200
201extern Lisp_Object Qeql;
202
201/* A mask of extra modifier bits to put into every keyboard char. */ 203/* A mask of extra modifier bits to put into every keyboard char. */
202 204
203extern EMACS_INT extra_keyboard_modifiers; 205extern EMACS_INT extra_keyboard_modifiers;
@@ -6050,13 +6052,28 @@ x_set_mouse_pixel_position (f, pix_x, pix_y)
6050 struct frame *f; 6052 struct frame *f;
6051 int pix_x, pix_y; 6053 int pix_x, pix_y;
6052{ 6054{
6053#if 0 /* MAC_TODO: CursorDeviceMoveTo is non-Carbon */ 6055#ifdef MAC_OSX
6056 Point p;
6057 CGPoint point;
6058
6059 BLOCK_INPUT;
6060 SetPortWindowPort (FRAME_MAC_WINDOW (f));
6061 p.h = pix_x;
6062 p.v = pix_y;
6063 LocalToGlobal (&p);
6064 point.x = p.h;
6065 point.y = p.v;
6066 CGWarpMouseCursorPosition (point);
6067 UNBLOCK_INPUT;
6068#else
6069#if 0 /* MAC_TODO: LMSetMouseLocation and CursorDeviceMoveTo are non-Carbon */
6054 BLOCK_INPUT; 6070 BLOCK_INPUT;
6055 6071
6056 XWarpPointer (FRAME_X_DISPLAY (f), None, FRAME_X_WINDOW (f), 6072 XWarpPointer (FRAME_X_DISPLAY (f), None, FRAME_X_WINDOW (f),
6057 0, 0, 0, 0, pix_x, pix_y); 6073 0, 0, 0, 0, pix_x, pix_y);
6058 UNBLOCK_INPUT; 6074 UNBLOCK_INPUT;
6059#endif 6075#endif
6076#endif
6060} 6077}
6061 6078
6062/* focus shifting, raising and lowering. */ 6079/* focus shifting, raising and lowering. */
@@ -6916,6 +6933,8 @@ static Lisp_Object fm_font_family_alist;
6916#if USE_ATSUI 6933#if USE_ATSUI
6917/* Hash table linking font family names to ATSU font IDs. */ 6934/* Hash table linking font family names to ATSU font IDs. */
6918static Lisp_Object atsu_font_id_hash; 6935static Lisp_Object atsu_font_id_hash;
6936/* Alist linking Font Manager style to face attributes. */
6937static Lisp_Object fm_style_face_attributes_alist;
6919static Lisp_Object Vmac_atsu_font_table; 6938static Lisp_Object Vmac_atsu_font_table;
6920extern Lisp_Object QCfamily, QCweight, QCslant, Qnormal, Qbold, Qitalic; 6939extern Lisp_Object QCfamily, QCweight, QCslant, Qnormal, Qbold, Qitalic;
6921#endif 6940#endif
@@ -7151,6 +7170,29 @@ add_mac_font_name (name, size, style, charset)
7151 } 7170 }
7152} 7171}
7153 7172
7173#if USE_ATSUI
7174static Lisp_Object
7175fm_style_to_face_attributes (fm_style)
7176 FMFontStyle fm_style;
7177{
7178 Lisp_Object tem;
7179
7180 fm_style &= (bold | italic);
7181 tem = assq_no_quit (make_number (fm_style),
7182 fm_style_face_attributes_alist);
7183 if (!NILP (tem))
7184 return XCDR (tem);
7185
7186 tem = list4 (QCweight, fm_style & bold ? Qbold : Qnormal,
7187 QCslant, fm_style & italic ? Qitalic : Qnormal);
7188 fm_style_face_attributes_alist =
7189 Fcons (Fcons (make_number (fm_style), tem),
7190 fm_style_face_attributes_alist);
7191
7192 return tem;
7193}
7194#endif
7195
7154/* Sets up the table font_name_table to contain the list of all fonts 7196/* Sets up the table font_name_table to contain the list of all fonts
7155 in the system the first time the table is used so that the Resource 7197 in the system the first time the table is used so that the Resource
7156 Manager need not be accessed every time this information is 7198 Manager need not be accessed every time this information is
@@ -7219,14 +7261,12 @@ init_font_name_table ()
7219 decode_mac_font_name (name, name_len + 1, Qnil); 7261 decode_mac_font_name (name, name_len + 1, Qnil);
7220 family = make_unibyte_string (name, name_len); 7262 family = make_unibyte_string (name, name_len);
7221 FMGetFontFamilyInstanceFromFont (font_ids[i], &ff, &style); 7263 FMGetFontFamilyInstanceFromFont (font_ids[i], &ff, &style);
7222 Fputhash (make_unibyte_string ((char *)(font_ids + i), 7264 Fputhash ((font_ids[i] > MOST_POSITIVE_FIXNUM
7223 sizeof (ATSUFontID)), 7265 ? make_float (font_ids[i])
7266 : make_number (font_ids[i])),
7224 Fcons (QCfamily, 7267 Fcons (QCfamily,
7225 list5 (family, 7268 Fcons (family,
7226 QCweight, 7269 fm_style_to_face_attributes (style))),
7227 style & bold ? Qbold : Qnormal,
7228 QCslant,
7229 style & italic ? Qitalic : Qnormal)),
7230 Vmac_atsu_font_table); 7270 Vmac_atsu_font_table);
7231 if (*name != '.' 7271 if (*name != '.'
7232 && hash_lookup (h, family, &hash_code) < 0) 7272 && hash_lookup (h, family, &hash_code) < 0)
@@ -8534,6 +8574,7 @@ static Lisp_Object Qupdate_active_input_area, Qunicode_for_key_event;
8534static Lisp_Object Vmac_ts_active_input_overlay; 8574static Lisp_Object Vmac_ts_active_input_overlay;
8535extern Lisp_Object Qbefore_string; 8575extern Lisp_Object Qbefore_string;
8536static Lisp_Object Vmac_ts_script_language_on_focus; 8576static Lisp_Object Vmac_ts_script_language_on_focus;
8577static Lisp_Object saved_ts_script_language_on_focus;
8537static ScriptLanguageRecord saved_ts_language; 8578static ScriptLanguageRecord saved_ts_language;
8538static Component saved_ts_component; 8579static Component saved_ts_component;
8539#endif 8580#endif
@@ -8896,11 +8937,17 @@ mac_tsm_resume ()
8896 8937
8897 if (err == noErr) 8938 if (err == noErr)
8898 { 8939 {
8899 if (EQ (Vmac_ts_script_language_on_focus, Qt)) 8940 if (EQ (Vmac_ts_script_language_on_focus, Qt)
8941 && EQ (saved_ts_script_language_on_focus, Qt))
8900 slptr = &saved_ts_language; 8942 slptr = &saved_ts_language;
8901 else if (CONSP (Vmac_ts_script_language_on_focus) 8943 else if (CONSP (Vmac_ts_script_language_on_focus)
8902 && INTEGERP (XCAR (Vmac_ts_script_language_on_focus)) 8944 && INTEGERP (XCAR (Vmac_ts_script_language_on_focus))
8903 && INTEGERP (XCDR (Vmac_ts_script_language_on_focus))) 8945 && INTEGERP (XCDR (Vmac_ts_script_language_on_focus))
8946 && CONSP (saved_ts_script_language_on_focus)
8947 && EQ (XCAR (saved_ts_script_language_on_focus),
8948 XCAR (Vmac_ts_script_language_on_focus))
8949 && EQ (XCDR (saved_ts_script_language_on_focus),
8950 XCDR (Vmac_ts_script_language_on_focus)))
8904 { 8951 {
8905 slrec.fScript = XINT (XCAR (Vmac_ts_script_language_on_focus)); 8952 slrec.fScript = XINT (XCAR (Vmac_ts_script_language_on_focus));
8906 slrec.fLanguage = XINT (XCDR (Vmac_ts_script_language_on_focus)); 8953 slrec.fLanguage = XINT (XCDR (Vmac_ts_script_language_on_focus));
@@ -8933,6 +8980,8 @@ mac_tsm_suspend ()
8933 OSStatus err; 8980 OSStatus err;
8934 ScriptLanguageRecord slrec, *slptr = NULL; 8981 ScriptLanguageRecord slrec, *slptr = NULL;
8935 8982
8983 saved_ts_script_language_on_focus = Vmac_ts_script_language_on_focus;
8984
8936 if (EQ (Vmac_ts_script_language_on_focus, Qt)) 8985 if (EQ (Vmac_ts_script_language_on_focus, Qt))
8937 { 8986 {
8938 err = GetTextServiceLanguage (&saved_ts_language); 8987 err = GetTextServiceLanguage (&saved_ts_language);
@@ -9581,7 +9630,11 @@ mac_handle_text_input_event (next_handler, event, data)
9581 typeLongInteger, 9630 typeLongInteger,
9582 typeIntlWritingCode, 9631 typeIntlWritingCode,
9583 typeLongInteger, 9632 typeLongInteger,
9633#ifdef MAC_OSX
9584 typeUnicodeText, 9634 typeUnicodeText,
9635#else
9636 typeChar,
9637#endif
9585 typeTextRangeArray, 9638 typeTextRangeArray,
9586 typeTextRangeArray, 9639 typeTextRangeArray,
9587 typeOffsetArray, 9640 typeOffsetArray,
@@ -10643,7 +10696,7 @@ XTread_socket (sd, expected, hold_quit)
10643#endif 10696#endif
10644 mapped_modifiers &= modifiers; 10697 mapped_modifiers &= modifiers;
10645 10698
10646#if USE_CARBON_EVENTS && defined (MAC_OSX) 10699#if USE_CARBON_EVENTS && (defined (MAC_OSX) || USE_MAC_TSM)
10647 /* When using Carbon Events, we need to pass raw keyboard 10700 /* When using Carbon Events, we need to pass raw keyboard
10648 events to the TSM ourselves. If TSM handles it, it 10701 events to the TSM ourselves. If TSM handles it, it
10649 will pass back noErr, otherwise it will pass back 10702 will pass back noErr, otherwise it will pass back
@@ -11299,7 +11352,11 @@ init_menu_bar ()
11299static void 11352static void
11300init_tsm () 11353init_tsm ()
11301{ 11354{
11355#ifdef MAC_OSX
11302 static InterfaceTypeList types = {kUnicodeDocument}; 11356 static InterfaceTypeList types = {kUnicodeDocument};
11357#else
11358 static InterfaceTypeList types = {kTextService};
11359#endif
11303 11360
11304 NewTSMDocument (sizeof (types) / sizeof (types[0]), types, 11361 NewTSMDocument (sizeof (types) / sizeof (types[0]), types,
11305 &tsm_document_id, 0); 11362 &tsm_document_id, 0);
@@ -11487,6 +11544,14 @@ syms_of_macterm ()
11487#if USE_ATSUI 11544#if USE_ATSUI
11488 staticpro (&atsu_font_id_hash); 11545 staticpro (&atsu_font_id_hash);
11489 atsu_font_id_hash = Qnil; 11546 atsu_font_id_hash = Qnil;
11547
11548 staticpro (&fm_style_face_attributes_alist);
11549 fm_style_face_attributes_alist = Qnil;
11550#endif
11551
11552#if USE_MAC_TSM
11553 staticpro (&saved_ts_script_language_on_focus);
11554 saved_ts_script_language_on_focus = Qnil;
11490#endif 11555#endif
11491 11556
11492 /* We don't yet support this, but defining this here avoids whining 11557 /* We don't yet support this, but defining this here avoids whining
@@ -11599,11 +11664,9 @@ CODING_SYSTEM is a coding system corresponding to TEXT-ENCODING. */);
11599 11664
11600#if USE_ATSUI 11665#if USE_ATSUI
11601 DEFVAR_LISP ("mac-atsu-font-table", &Vmac_atsu_font_table, 11666 DEFVAR_LISP ("mac-atsu-font-table", &Vmac_atsu_font_table,
11602 doc: /* Hash table of ATSU font IDs vs plist of attributes and values. 11667 doc: /* Hash table of ATSU font IDs vs plist of attributes and values. */);
11603Each font ID is represented as a four-byte string in native byte
11604order. */);
11605 Vmac_atsu_font_table = 11668 Vmac_atsu_font_table =
11606 make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE), 11669 make_hash_table (Qeql, make_number (DEFAULT_HASH_SIZE),
11607 make_float (DEFAULT_REHASH_SIZE), 11670 make_float (DEFAULT_REHASH_SIZE),
11608 make_float (DEFAULT_REHASH_THRESHOLD), 11671 make_float (DEFAULT_REHASH_THRESHOLD),
11609 Qnil, Qnil, Qnil); 11672 Qnil, Qnil, Qnil);
diff --git a/src/puresize.h b/src/puresize.h
index 67e758ae799..fa01ad610a1 100644
--- a/src/puresize.h
+++ b/src/puresize.h
@@ -43,7 +43,7 @@ Boston, MA 02110-1301, USA. */
43#endif 43#endif
44 44
45#ifndef BASE_PURESIZE 45#ifndef BASE_PURESIZE
46#define BASE_PURESIZE (1210000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA) 46#define BASE_PURESIZE (1210500 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA)
47#endif 47#endif
48 48
49/* Increase BASE_PURESIZE by a ratio depending on the machine's word size. */ 49/* Increase BASE_PURESIZE by a ratio depending on the machine's word size. */
diff --git a/src/s/gnu-linux.h b/src/s/gnu-linux.h
index 4ef3db9f2ea..817f1facdee 100644
--- a/src/s/gnu-linux.h
+++ b/src/s/gnu-linux.h
@@ -52,6 +52,9 @@ Boston, MA 02110-1301, USA. */
52#if LINUX_VERSION_CODE >= 0x20000 52#if LINUX_VERSION_CODE >= 0x20000
53#define LINUX_MAP_SHARED_DOES_WORK 53#define LINUX_MAP_SHARED_DOES_WORK
54#endif /* LINUX_VERSION_CODE >= 0x20000 */ 54#endif /* LINUX_VERSION_CODE >= 0x20000 */
55#if LINUX_VERSION_CODE >= 0x20400
56#define LINUX_SIGNALS_VIA_CHARACTERS_DOES_WORK
57#endif /* LINUX_VERSION_CODE >= 0x20400 */
55#endif /* HAVE_LINUX_VERSION_H */ 58#endif /* HAVE_LINUX_VERSION_H */
56#endif /* emacs */ 59#endif /* emacs */
57#endif /* NOT_C_CODE */ 60#endif /* NOT_C_CODE */
@@ -247,9 +250,10 @@ Boston, MA 02110-1301, USA. */
247#define C_DEBUG_SWITCH 250#define C_DEBUG_SWITCH
248#endif 251#endif
249 252
250/* Let's try this out, just in case. 253/* 21 Jun 06: Eric Hanchrow <offby1@blarg.net> says this works. */
251 Nah. Rik Faith <faith@cs.unc.edu> says it doesn't work well. */ 254#ifdef LINUX_SIGNALS_VIA_CHARACTERS_DOES_WORK
252/* #define SIGNALS_VIA_CHARACTERS */ 255#define SIGNALS_VIA_CHARACTERS
256#endif
253 257
254/* Rob Malouf <malouf@csli.stanford.edu> says: 258/* Rob Malouf <malouf@csli.stanford.edu> says:
255 SYSV IPC is standard a standard part of Linux since version 0.99pl10, 259 SYSV IPC is standard a standard part of Linux since version 0.99pl10,
diff --git a/src/textprop.c b/src/textprop.c
index 87fa6742919..0318d12913f 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -690,10 +690,11 @@ overlays are considered only if they are associated with OBJECT. */)
690DEFUN ("get-char-property-and-overlay", Fget_char_property_and_overlay, 690DEFUN ("get-char-property-and-overlay", Fget_char_property_and_overlay,
691 Sget_char_property_and_overlay, 2, 3, 0, 691 Sget_char_property_and_overlay, 2, 3, 0,
692 doc: /* Like `get-char-property', but with extra overlay information. 692 doc: /* Like `get-char-property', but with extra overlay information.
693Return a cons whose car is the return value of `get-char-property' 693The value is a cons cell. Its car is the return value of `get-char-property'
694with the same arguments, that is, the value of POSITION's property 694with the same arguments--that is, the value of POSITION's property
695PROP in OBJECT, and whose cdr is the overlay in which the property was 695PROP in OBJECT. Its cdr is the overlay in which the property was
696found, or nil, if it was found as a text property or not found at all. 696found, or nil, if it was found as a text property or not found at all.
697
697OBJECT is optional and defaults to the current buffer. OBJECT may be 698OBJECT is optional and defaults to the current buffer. OBJECT may be
698a string, a buffer or a window. For strings, the cdr of the return 699a string, a buffer or a window. For strings, the cdr of the return
699value is always nil, since strings do not have overlays. If OBJECT is 700value is always nil, since strings do not have overlays. If OBJECT is
@@ -1787,8 +1788,12 @@ text_property_stickiness (prop, pos, buffer)
1787 /* PROP is rear-non-sticky. */ 1788 /* PROP is rear-non-sticky. */
1788 is_rear_sticky = 0; 1789 is_rear_sticky = 0;
1789 } 1790 }
1791 else
1792 return 0;
1790 1793
1791 /* Consider following character. */ 1794 /* Consider following character. */
1795 /* This signals an arg-out-of-range error if pos is outside the
1796 buffer's accessible range. */
1792 front_sticky = Fget_text_property (pos, Qfront_sticky, buffer); 1797 front_sticky = Fget_text_property (pos, Qfront_sticky, buffer);
1793 1798
1794 if (EQ (front_sticky, Qt) 1799 if (EQ (front_sticky, Qt)
diff --git a/src/w32console.c b/src/w32console.c
index a696534a4b6..b660d74f852 100644
--- a/src/w32console.c
+++ b/src/w32console.c
@@ -705,7 +705,7 @@ syms_of_ntterm ()
705 DEFVAR_BOOL ("w32-use-full-screen-buffer", 705 DEFVAR_BOOL ("w32-use-full-screen-buffer",
706 &w32_use_full_screen_buffer, 706 &w32_use_full_screen_buffer,
707 doc: /* Non-nil means make terminal frames use the full screen buffer dimensions. 707 doc: /* Non-nil means make terminal frames use the full screen buffer dimensions.
708This is desirable when running Emacs over telnet, and is the default. 708This is desirable when running Emacs over telnet.
709A value of nil means use the current console window dimensions; this 709A value of nil means use the current console window dimensions; this
710may be preferrable when working directly at the console with a large 710may be preferrable when working directly at the console with a large
711scroll-back buffer. */); 711scroll-back buffer. */);
diff --git a/src/w32fns.c b/src/w32fns.c
index aa83e006194..b548c2c1efe 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -2086,8 +2086,8 @@ w32_createwindow (f)
2086 = CreateWindow (EMACS_CLASS, 2086 = CreateWindow (EMACS_CLASS,
2087 f->namebuf, 2087 f->namebuf,
2088 f->output_data.w32->dwStyle | WS_CLIPCHILDREN, 2088 f->output_data.w32->dwStyle | WS_CLIPCHILDREN,
2089 f->left_pos, 2089 CW_USEDEFAULT,
2090 f->top_pos, 2090 SW_SHOW,
2091 rect.right - rect.left, 2091 rect.right - rect.left,
2092 rect.bottom - rect.top, 2092 rect.bottom - rect.top,
2093 NULL, 2093 NULL,
@@ -2108,6 +2108,11 @@ w32_createwindow (f)
2108 2108
2109 /* Do this to discard the default setting specified by our parent. */ 2109 /* Do this to discard the default setting specified by our parent. */
2110 ShowWindow (hwnd, SW_HIDE); 2110 ShowWindow (hwnd, SW_HIDE);
2111
2112 /* Update frame positions. */
2113 GetWindowRect (hwnd, &rect);
2114 f->left_pos = rect.left;
2115 f->top_pos = rect.top;
2111 } 2116 }
2112} 2117}
2113 2118
diff --git a/src/w32term.c b/src/w32term.c
index 8e3d14b600c..3683089cb3e 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -5833,7 +5833,22 @@ x_make_frame_visible (f)
5833 before the window gets really visible. */ 5833 before the window gets really visible. */
5834 if (! FRAME_ICONIFIED_P (f) 5834 if (! FRAME_ICONIFIED_P (f)
5835 && ! f->output_data.w32->asked_for_visible) 5835 && ! f->output_data.w32->asked_for_visible)
5836 x_set_offset (f, f->left_pos, f->top_pos, 0); 5836 {
5837 RECT workarea_rect;
5838 RECT window_rect;
5839
5840 /* Adjust vertical window position in order to avoid being
5841 covered by a task bar placed at the bottom of the desktop. */
5842 SystemParametersInfo(SPI_GETWORKAREA, 0, &workarea_rect, 0);
5843 GetWindowRect(FRAME_W32_WINDOW(f), &window_rect);
5844 if (window_rect.bottom > workarea_rect.bottom
5845 && window_rect.top > workarea_rect.top)
5846 f->top_pos = max (window_rect.top
5847 - window_rect.bottom + workarea_rect.bottom,
5848 workarea_rect.top);
5849
5850 x_set_offset (f, f->left_pos, f->top_pos, 0);
5851 }
5837 5852
5838 f->output_data.w32->asked_for_visible = 1; 5853 f->output_data.w32->asked_for_visible = 1;
5839 5854
diff --git a/src/xdisp.c b/src/xdisp.c
index bf51137c716..8a745ac778e 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -3038,6 +3038,7 @@ handle_stop (it)
3038 return; 3038 return;
3039 if (!get_overlay_strings_1 (it, 0, 0)) 3039 if (!get_overlay_strings_1 (it, 0, 0))
3040 return; 3040 return;
3041 it->ignore_overlay_strings_at_pos_p = 1;
3041 it->string_from_display_prop_p = 0; 3042 it->string_from_display_prop_p = 0;
3042 handle_overlay_change_p = 0; 3043 handle_overlay_change_p = 0;
3043 handled = HANDLED_RECOMPUTE_PROPS; 3044 handled = HANDLED_RECOMPUTE_PROPS;
@@ -4588,6 +4589,10 @@ handle_composition_prop (it)
4588 } 4589 }
4589 return HANDLED_RECOMPUTE_PROPS; 4590 return HANDLED_RECOMPUTE_PROPS;
4590 } 4591 }
4592
4593 it->stop_charpos = end;
4594 push_it (it);
4595
4591 it->method = GET_FROM_COMPOSITION; 4596 it->method = GET_FROM_COMPOSITION;
4592 it->cmp_id = id; 4597 it->cmp_id = id;
4593 it->cmp_len = COMPOSITION_LENGTH (prop); 4598 it->cmp_len = COMPOSITION_LENGTH (prop);
@@ -4602,7 +4607,6 @@ handle_composition_prop (it)
4602 it->len = (STRINGP (it->string) 4607 it->len = (STRINGP (it->string)
4603 ? string_char_to_byte (it->string, end) 4608 ? string_char_to_byte (it->string, end)
4604 : CHAR_TO_BYTE (end)) - pos_byte; 4609 : CHAR_TO_BYTE (end)) - pos_byte;
4605 it->stop_charpos = end;
4606 handled = HANDLED_RETURN; 4610 handled = HANDLED_RETURN;
4607 } 4611 }
4608 } 4612 }
@@ -5031,7 +5035,8 @@ push_it (it)
5031 p->u.stretch.object = it->object; 5035 p->u.stretch.object = it->object;
5032 break; 5036 break;
5033 } 5037 }
5034 p->pos = it->current; 5038 p->position = it->position;
5039 p->current = it->current;
5035 p->end_charpos = it->end_charpos; 5040 p->end_charpos = it->end_charpos;
5036 p->string_nchars = it->string_nchars; 5041 p->string_nchars = it->string_nchars;
5037 p->area = it->area; 5042 p->area = it->area;
@@ -5062,7 +5067,8 @@ pop_it (it)
5062 p = it->stack + it->sp; 5067 p = it->stack + it->sp;
5063 it->stop_charpos = p->stop_charpos; 5068 it->stop_charpos = p->stop_charpos;
5064 it->face_id = p->face_id; 5069 it->face_id = p->face_id;
5065 it->current = p->pos; 5070 it->current = p->current;
5071 it->position = p->position;
5066 it->string = p->string; 5072 it->string = p->string;
5067 if (NILP (it->string)) 5073 if (NILP (it->string))
5068 SET_TEXT_POS (it->current.string_pos, -1, -1); 5074 SET_TEXT_POS (it->current.string_pos, -1, -1);
@@ -5220,6 +5226,7 @@ back_to_previous_visible_line_start (it)
5220 while (IT_CHARPOS (*it) > BEGV) 5226 while (IT_CHARPOS (*it) > BEGV)
5221 { 5227 {
5222 back_to_previous_line_start (it); 5228 back_to_previous_line_start (it);
5229
5223 if (IT_CHARPOS (*it) <= BEGV) 5230 if (IT_CHARPOS (*it) <= BEGV)
5224 break; 5231 break;
5225 5232
@@ -5892,19 +5899,19 @@ set_iterator_to_next (it, reseat_p)
5892 5899
5893 case GET_FROM_COMPOSITION: 5900 case GET_FROM_COMPOSITION:
5894 xassert (it->cmp_id >= 0 && it->cmp_id < n_compositions); 5901 xassert (it->cmp_id >= 0 && it->cmp_id < n_compositions);
5895 if (STRINGP (it->string)) 5902 xassert (it->sp > 0);
5903 pop_it (it);
5904 if (it->method == GET_FROM_STRING)
5896 { 5905 {
5897 IT_STRING_BYTEPOS (*it) += it->len; 5906 IT_STRING_BYTEPOS (*it) += it->len;
5898 IT_STRING_CHARPOS (*it) += it->cmp_len; 5907 IT_STRING_CHARPOS (*it) += it->cmp_len;
5899 it->method = GET_FROM_STRING;
5900 it->object = it->string; 5908 it->object = it->string;
5901 goto consider_string_end; 5909 goto consider_string_end;
5902 } 5910 }
5903 else 5911 else if (it->method == GET_FROM_BUFFER)
5904 { 5912 {
5905 IT_BYTEPOS (*it) += it->len; 5913 IT_BYTEPOS (*it) += it->len;
5906 IT_CHARPOS (*it) += it->cmp_len; 5914 IT_CHARPOS (*it) += it->cmp_len;
5907 it->method = GET_FROM_BUFFER;
5908 it->object = it->w->buffer; 5915 it->object = it->w->buffer;
5909 } 5916 }
5910 break; 5917 break;
@@ -9718,6 +9725,12 @@ display_tool_bar_line (it, height)
9718 /* Glyph doesn't fit on line. Backtrack. */ 9725 /* Glyph doesn't fit on line. Backtrack. */
9719 row->used[TEXT_AREA] = n_glyphs_before; 9726 row->used[TEXT_AREA] = n_glyphs_before;
9720 *it = it_before; 9727 *it = it_before;
9728 /* If this is the only glyph on this line, it will never fit on the
9729 toolbar, so skip it. But ensure there is at least one glyph,
9730 so we don't accidentally disable the tool-bar. */
9731 if (n_glyphs_before == 0
9732 && (it->vpos > 0 || IT_STRING_CHARPOS (*it) < it->end_charpos-1))
9733 break;
9721 goto out; 9734 goto out;
9722 } 9735 }
9723 9736
@@ -9776,6 +9789,11 @@ display_tool_bar_line (it, height)
9776} 9789}
9777 9790
9778 9791
9792/* Max tool-bar height. */
9793
9794#define MAX_FRAME_TOOL_BAR_HEIGHT(f) \
9795 ((FRAME_LINE_HEIGHT (f) * FRAME_LINES (f)))
9796
9779/* Value is the number of screen lines needed to make all tool-bar 9797/* Value is the number of screen lines needed to make all tool-bar
9780 items of frame F visible. The number of actual rows needed is 9798 items of frame F visible. The number of actual rows needed is
9781 returned in *N_ROWS if non-NULL. */ 9799 returned in *N_ROWS if non-NULL. */
@@ -9787,7 +9805,10 @@ tool_bar_lines_needed (f, n_rows)
9787{ 9805{
9788 struct window *w = XWINDOW (f->tool_bar_window); 9806 struct window *w = XWINDOW (f->tool_bar_window);
9789 struct it it; 9807 struct it it;
9790 struct glyph_row *temp_row = w->desired_matrix->rows; 9808 /* tool_bar_lines_needed is called from redisplay_tool_bar after building
9809 the desired matrix, so use (unused) mode-line row as temporary row to
9810 avoid destroying the first tool-bar row. */
9811 struct glyph_row *temp_row = MATRIX_MODE_LINE_ROW (w->desired_matrix);
9791 9812
9792 /* Initialize an iterator for iteration over 9813 /* Initialize an iterator for iteration over
9793 F->desired_tool_bar_string in the tool-bar window of frame F. */ 9814 F->desired_tool_bar_string in the tool-bar window of frame F. */
@@ -9893,13 +9914,13 @@ redisplay_tool_bar (f)
9893 int old_height = WINDOW_TOTAL_LINES (w); 9914 int old_height = WINDOW_TOTAL_LINES (w);
9894 9915
9895 XSETFRAME (frame, f); 9916 XSETFRAME (frame, f);
9896 clear_glyph_matrix (w->desired_matrix);
9897 Fmodify_frame_parameters (frame, 9917 Fmodify_frame_parameters (frame,
9898 Fcons (Fcons (Qtool_bar_lines, 9918 Fcons (Fcons (Qtool_bar_lines,
9899 make_number (nlines)), 9919 make_number (nlines)),
9900 Qnil)); 9920 Qnil));
9901 if (WINDOW_TOTAL_LINES (w) != old_height) 9921 if (WINDOW_TOTAL_LINES (w) != old_height)
9902 { 9922 {
9923 clear_glyph_matrix (w->desired_matrix);
9903 fonts_changed_p = 1; 9924 fonts_changed_p = 1;
9904 return 1; 9925 return 1;
9905 } 9926 }
@@ -9951,17 +9972,20 @@ redisplay_tool_bar (f)
9951 9972
9952 if (auto_resize_tool_bars_p) 9973 if (auto_resize_tool_bars_p)
9953 { 9974 {
9954 int nlines; 9975 int nlines, nrows;
9976 int max_tool_bar_height = MAX_FRAME_TOOL_BAR_HEIGHT (f);
9955 9977
9956 /* If we couldn't display everything, change the tool-bar's 9978 /* If we couldn't display everything, change the tool-bar's
9957 height. */ 9979 height if there is room for more. */
9958 if (IT_STRING_CHARPOS (it) < it.end_charpos) 9980 if (IT_STRING_CHARPOS (it) < it.end_charpos
9981 && it.current_y < max_tool_bar_height)
9959 change_height_p = 1; 9982 change_height_p = 1;
9960 9983
9984 row = it.glyph_row - 1;
9985
9961 /* If there are blank lines at the end, except for a partially 9986 /* If there are blank lines at the end, except for a partially
9962 visible blank line at the end that is smaller than 9987 visible blank line at the end that is smaller than
9963 FRAME_LINE_HEIGHT, change the tool-bar's height. */ 9988 FRAME_LINE_HEIGHT, change the tool-bar's height. */
9964 row = it.glyph_row - 1;
9965 if (!row->displays_text_p 9989 if (!row->displays_text_p
9966 && row->height >= FRAME_LINE_HEIGHT (f)) 9990 && row->height >= FRAME_LINE_HEIGHT (f))
9967 change_height_p = 1; 9991 change_height_p = 1;
@@ -9969,13 +9993,14 @@ redisplay_tool_bar (f)
9969 /* If row displays tool-bar items, but is partially visible, 9993 /* If row displays tool-bar items, but is partially visible,
9970 change the tool-bar's height. */ 9994 change the tool-bar's height. */
9971 if (row->displays_text_p 9995 if (row->displays_text_p
9972 && MATRIX_ROW_BOTTOM_Y (row) > it.last_visible_y) 9996 && MATRIX_ROW_BOTTOM_Y (row) > it.last_visible_y
9997 && MATRIX_ROW_BOTTOM_Y (row) < max_tool_bar_height)
9973 change_height_p = 1; 9998 change_height_p = 1;
9974 9999
9975 /* Resize windows as needed by changing the `tool-bar-lines' 10000 /* Resize windows as needed by changing the `tool-bar-lines'
9976 frame parameter. */ 10001 frame parameter. */
9977 if (change_height_p 10002 if (change_height_p
9978 && (nlines = tool_bar_lines_needed (f, &f->n_tool_bar_rows), 10003 && (nlines = tool_bar_lines_needed (f, &nrows),
9979 nlines != WINDOW_TOTAL_LINES (w))) 10004 nlines != WINDOW_TOTAL_LINES (w)))
9980 { 10005 {
9981 extern Lisp_Object Qtool_bar_lines; 10006 extern Lisp_Object Qtool_bar_lines;
@@ -9983,13 +10008,16 @@ redisplay_tool_bar (f)
9983 int old_height = WINDOW_TOTAL_LINES (w); 10008 int old_height = WINDOW_TOTAL_LINES (w);
9984 10009
9985 XSETFRAME (frame, f); 10010 XSETFRAME (frame, f);
9986 clear_glyph_matrix (w->desired_matrix);
9987 Fmodify_frame_parameters (frame, 10011 Fmodify_frame_parameters (frame,
9988 Fcons (Fcons (Qtool_bar_lines, 10012 Fcons (Fcons (Qtool_bar_lines,
9989 make_number (nlines)), 10013 make_number (nlines)),
9990 Qnil)); 10014 Qnil));
9991 if (WINDOW_TOTAL_LINES (w) != old_height) 10015 if (WINDOW_TOTAL_LINES (w) != old_height)
9992 fonts_changed_p = 1; 10016 {
10017 clear_glyph_matrix (w->desired_matrix);
10018 f->n_tool_bar_rows = nrows;
10019 fonts_changed_p = 1;
10020 }
9993 } 10021 }
9994 } 10022 }
9995 10023
@@ -11919,25 +11947,25 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos)
11919 glyph on point by scanning from string_start again. */ 11947 glyph on point by scanning from string_start again. */
11920 Lisp_Object limit; 11948 Lisp_Object limit;
11921 Lisp_Object string; 11949 Lisp_Object string;
11950 struct glyph *stop = glyph;
11922 int pos; 11951 int pos;
11923 11952
11924 limit = make_number (pt_old + 1); 11953 limit = make_number (pt_old + 1);
11925 end = glyph;
11926 glyph = string_start; 11954 glyph = string_start;
11927 x = string_start_x; 11955 x = string_start_x;
11928 string = glyph->object; 11956 string = glyph->object;
11929 pos = string_buffer_position (w, string, string_before_pos); 11957 pos = string_buffer_position (w, string, string_before_pos);
11930 /* If STRING is from overlay, LAST_POS == 0. We skip such glyphs 11958 /* If STRING is from overlay, LAST_POS == 0. We skip such glyphs
11931 because we always put cursor after overlay strings. */ 11959 because we always put cursor after overlay strings. */
11932 while (pos == 0 && glyph < end) 11960 while (pos == 0 && glyph < stop)
11933 { 11961 {
11934 string = glyph->object; 11962 string = glyph->object;
11935 SKIP_GLYPHS (glyph, end, x, EQ (glyph->object, string)); 11963 SKIP_GLYPHS (glyph, stop, x, EQ (glyph->object, string));
11936 if (glyph < end) 11964 if (glyph < stop)
11937 pos = string_buffer_position (w, glyph->object, string_before_pos); 11965 pos = string_buffer_position (w, glyph->object, string_before_pos);
11938 } 11966 }
11939 11967
11940 while (glyph < end) 11968 while (glyph < stop)
11941 { 11969 {
11942 pos = XINT (Fnext_single_char_property_change 11970 pos = XINT (Fnext_single_char_property_change
11943 (make_number (pos), Qdisplay, Qnil, limit)); 11971 (make_number (pos), Qdisplay, Qnil, limit));
@@ -11945,13 +11973,13 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos)
11945 break; 11973 break;
11946 /* Skip glyphs from the same string. */ 11974 /* Skip glyphs from the same string. */
11947 string = glyph->object; 11975 string = glyph->object;
11948 SKIP_GLYPHS (glyph, end, x, EQ (glyph->object, string)); 11976 SKIP_GLYPHS (glyph, stop, x, EQ (glyph->object, string));
11949 /* Skip glyphs from an overlay. */ 11977 /* Skip glyphs from an overlay. */
11950 while (glyph < end 11978 while (glyph < stop
11951 && ! string_buffer_position (w, glyph->object, pos)) 11979 && ! string_buffer_position (w, glyph->object, pos))
11952 { 11980 {
11953 string = glyph->object; 11981 string = glyph->object;
11954 SKIP_GLYPHS (glyph, end, x, EQ (glyph->object, string)); 11982 SKIP_GLYPHS (glyph, stop, x, EQ (glyph->object, string));
11955 } 11983 }
11956 } 11984 }
11957 11985
diff --git a/src/xfaces.c b/src/xfaces.c
index efdb7b0a660..7a5f6edfc32 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -5098,7 +5098,14 @@ x_update_menu_appearance (f)
5098DEFUN ("face-attribute-relative-p", Fface_attribute_relative_p, 5098DEFUN ("face-attribute-relative-p", Fface_attribute_relative_p,
5099 Sface_attribute_relative_p, 5099 Sface_attribute_relative_p,
5100 2, 2, 0, 5100 2, 2, 0,
5101 doc: /* Return non-nil if face ATTRIBUTE VALUE is relative. */) 5101 doc: /* Check whether a face attribute value is relative.
5102Specifically, this function returns t if the attribute ATTRIBUTE
5103with the value VALUE is relative.
5104
5105A relative value is one that doesn't entirely override whatever is
5106inherited from another face. For most possible attributes,
5107the only relative value that users see is `unspecified'.
5108However, for :height, floating point values are also relative. */)
5102 (attribute, value) 5109 (attribute, value)
5103 Lisp_Object attribute, value; 5110 Lisp_Object attribute, value;
5104{ 5111{
diff --git a/src/xfns.c b/src/xfns.c
index 5924ba21f88..253f2829f85 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -3099,7 +3099,6 @@ This function is an internal primitive--use `make-frame' instead. */)
3099 f->output_data.x->scroll_bar_top_shadow_pixel = -1; 3099 f->output_data.x->scroll_bar_top_shadow_pixel = -1;
3100 f->output_data.x->scroll_bar_bottom_shadow_pixel = -1; 3100 f->output_data.x->scroll_bar_bottom_shadow_pixel = -1;
3101#endif /* USE_TOOLKIT_SCROLL_BARS */ 3101#endif /* USE_TOOLKIT_SCROLL_BARS */
3102 record_unwind_protect (unwind_create_frame, frame);
3103 3102
3104 f->icon_name 3103 f->icon_name
3105 = x_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title", 3104 = x_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title",
@@ -3108,6 +3107,9 @@ This function is an internal primitive--use `make-frame' instead. */)
3108 f->icon_name = Qnil; 3107 f->icon_name = Qnil;
3109 3108
3110 FRAME_X_DISPLAY_INFO (f) = dpyinfo; 3109 FRAME_X_DISPLAY_INFO (f) = dpyinfo;
3110
3111 /* With FRAME_X_DISPLAY_INFO set up, this unwind-protect is safe. */
3112 record_unwind_protect (unwind_create_frame, frame);
3111#if GLYPH_DEBUG 3113#if GLYPH_DEBUG
3112 image_cache_refcount = FRAME_X_IMAGE_CACHE (f)->refcount; 3114 image_cache_refcount = FRAME_X_IMAGE_CACHE (f)->refcount;
3113 dpyinfo_refcount = dpyinfo->reference_count; 3115 dpyinfo_refcount = dpyinfo->reference_count;
@@ -4847,8 +4849,7 @@ else
4847 if (! STRINGP (font)) 4849 if (! STRINGP (font))
4848 font = build_string ("fixed"); 4850 font = build_string ("fixed");
4849 4851
4850 x_default_parameter (f, parms, Qfont, font, 4852 x_set_frame_parameters (f, Fcons (Fcons (Qfont, font), Qnil));
4851 "font", "Font", RES_TYPE_STRING);
4852 } 4853 }
4853 4854
4854 x_default_parameter (f, parms, Qborder_width, make_number (2), 4855 x_default_parameter (f, parms, Qborder_width, make_number (2),
diff --git a/src/xterm.c b/src/xterm.c
index 0c2014b184f..19dc35ff85d 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -11230,12 +11230,16 @@ x_delete_display (dpyinfo)
11230 xfree (dpyinfo->font_table[i].name); 11230 xfree (dpyinfo->font_table[i].name);
11231 } 11231 }
11232 11232
11233 if (dpyinfo->font_table->font_encoder) 11233 if (dpyinfo->font_table)
11234 xfree (dpyinfo->font_table->font_encoder); 11234 {
11235 11235 if (dpyinfo->font_table->font_encoder)
11236 xfree (dpyinfo->font_table); 11236 xfree (dpyinfo->font_table->font_encoder);
11237 xfree (dpyinfo->x_id_name); 11237 xfree (dpyinfo->font_table);
11238 xfree (dpyinfo->color_cells); 11238 }
11239 if (dpyinfo->x_id_name)
11240 xfree (dpyinfo->x_id_name);
11241 if (dpyinfo->color_cells)
11242 xfree (dpyinfo->color_cells);
11239 xfree (dpyinfo); 11243 xfree (dpyinfo);
11240} 11244}
11241 11245