aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/.gdbinit5
-rw-r--r--src/ChangeLog163
-rw-r--r--src/ChangeLog.1010
-rw-r--r--src/ChangeLog.1118
-rw-r--r--src/ChangeLog.34
-rw-r--r--src/ChangeLog.618
-rw-r--r--src/ChangeLog.86
-rw-r--r--src/ChangeLog.92
-rw-r--r--src/buffer.c13
-rw-r--r--src/callint.c2
-rw-r--r--src/ccl.c2
-rw-r--r--src/charset.c4
-rw-r--r--src/cm.h2
-rw-r--r--src/dired.c18
-rw-r--r--src/dispextern.h2
-rw-r--r--src/dispnew.c82
-rw-r--r--src/fileio.c22
-rw-r--r--src/font.c9
-rw-r--r--src/fontset.c2
-rw-r--r--src/fringe.c4
-rw-r--r--src/ftfont.c2
-rw-r--r--src/gtkutil.c8
-rw-r--r--src/gtkutil.h4
-rw-r--r--src/image.c4
-rw-r--r--src/keyboard.c16
-rw-r--r--src/lisp.h247
-rw-r--r--src/lread.c2
-rw-r--r--src/msdos.c2
-rw-r--r--src/nsgui.h3
-rw-r--r--src/nsterm.m4
-rw-r--r--src/process.c43
-rw-r--r--src/s/ms-w32.h8
-rw-r--r--src/search.c61
-rw-r--r--src/term.c2
-rw-r--r--src/w32fns.c5
-rw-r--r--src/w32term.h2
-rw-r--r--src/widget.c13
-rw-r--r--src/widget.h4
-rw-r--r--src/window.c7
-rw-r--r--src/xdisp.c97
-rw-r--r--src/xfaces.c4
-rw-r--r--src/xfns.c12
-rw-r--r--src/xterm.c17
-rw-r--r--src/xterm.h3
44 files changed, 632 insertions, 326 deletions
diff --git a/src/.gdbinit b/src/.gdbinit
index 80415abe40d..2051475bea0 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -311,9 +311,8 @@ define prowx
311 printf "y=%d x=%d pwid=%d", $row->y, $row->x, $row->pixel_width 311 printf "y=%d x=%d pwid=%d", $row->y, $row->x, $row->pixel_width
312 printf " a+d=%d+%d=%d", $row->ascent, $row->height-$row->ascent, $row->height 312 printf " a+d=%d+%d=%d", $row->ascent, $row->height-$row->ascent, $row->height
313 printf " phys=%d+%d=%d", $row->phys_ascent, $row->phys_height-$row->phys_ascent, $row->phys_height 313 printf " phys=%d+%d=%d", $row->phys_ascent, $row->phys_height-$row->phys_ascent, $row->phys_height
314 printf " vis=%d", $row->visible_height 314 printf " vis=%d\n", $row->visible_height
315 printf " L=%d T=%d R=%d", $row->used[0], $row->used[1], $row->used[2] 315 printf "used=(LMargin=%d,Text=%d,RMargin=%d) Hash=%d\n", $row->used[0], $row->used[1], $row->used[2], $row->hash
316 printf "\n"
317 printf "start=%d end=%d", $row->start.pos.charpos, $row->end.pos.charpos 316 printf "start=%d end=%d", $row->start.pos.charpos, $row->end.pos.charpos
318 if ($row->enabled_p) 317 if ($row->enabled_p)
319 printf " ENA" 318 printf " ENA"
diff --git a/src/ChangeLog b/src/ChangeLog
index a0f83560603..6a13bd87264 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,160 @@
12011-12-03 Jan Djärv <jan.h.d@swipnet.se>
2
3 * widget.c (update_wm_hints): Return if wmshell is null.
4 (widget_update_wm_size_hints): New function.
5
6 * widget.h (widget_update_wm_size_hints): Declare.
7
8 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9 widget_update_wm_size_hints (Bug#10104).
10
112011-12-03 Eli Zaretskii <eliz@gnu.org>
12
13 * xdisp.c (handle_invisible_prop): If the invisible text ends just
14 before a newline, prepare the bidi iterator for consuming the
15 newline, and keep the current paragraph direction. (Bug#10183)
16 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
17
182011-12-02 Juri Linkov <juri@jurta.org>
19
20 * search.c (Fword_search_regexp): New Lisp function created from
21 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
22 (Fword_search_backward, Fword_search_forward)
23 (Fword_search_backward_lax, Fword_search_forward_lax):
24 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
25 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
26
272011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
28
29 * fileio.c (Finsert_file_contents): Move after-change-function call
30 to before the "handled:" label, since all "goto handled" appear in
31 cases where the *-change-functions have already been properly called
32 (bug#10117).
33
342011-12-01 Andreas Schwab <schwab@linux-m68k.org>
35
36 * keyboard.c (interrupt_signal): Don't call kill-emacs when
37 waiting for input. (Bug#10169)
38
392011-11-30 Eli Zaretskii <eliz@gnu.org>
40
41 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
42 verifies glyph row's hash code--we have just reallocated the
43 glyphs, so their contents can be complete garbage. (Bug#10164)
44
452011-11-30 Juanma Barranquero <lekktu@gmail.com>
46
47 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
48
492011-11-30 Eli Zaretskii <eliz@gnu.org>
50
51 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
52 attributes are tested _before_ calling verify_row_hash, to protect
53 against GCC re-ordering of the tests. (Bug#10164)
54
552011-11-29 Jan Djärv <jan.h.d@swipnet.se>
56
57 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
58
59 * xterm.c (handle_one_xevent): Only set async_visible and friends
60 if net_wm_state_hidden_seen is non-zero (Bug#10002)
61 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
62 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
63
642011-11-28 Paul Eggert <eggert@cs.ucla.edu>
65
66 Remove GCPRO-related macros that exist only to avoid shadowing locals.
67 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
68 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
69 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
70 All uses changed to use GCPRO1 etc.
71 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
72 Revert to old implementation (i.e., before 2011-03-11).
73
742011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
75
76 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
77 of scroll runs so as to avoid assigning disabled bogus rows and
78 unnecessary graphics copy operations.
79
802011-11-27 Eli Zaretskii <eliz@gnu.org>
81
82 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
83 (snprintf) [_MSC_VER]: Redirect to _snprintf.
84 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
85 (malloc, free, realloc, calloc): Redirect to e_* only when
86 compiling Emacs.
87
88 * lisp.h (GCTYPEBITS): Move before first use.
89 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
90 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
91 this macro definition.
92
93 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
94 _MSC_VER.
95
962011-11-27 Jan Djärv <jan.h.d@swipnet.se>
97
98 * gtkutil.c (xg_create_frame_widgets): Call
99 gtk_window_set_has_resize_grip (FALSE) if that function is
100 present with Gtk+ 2.0.
101
1022011-11-26 Paul Eggert <eggert@cs.ucla.edu>
103
104 * fileio.c (Finsert_file_contents): Undo previous change; see
105 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
106
1072011-11-26 Paul Eggert <eggert@cs.ucla.edu>
108
109 Rename locals to avoid shadowing.
110 * fileio.c (Finsert_file_contents):
111 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
112 * process.c (wait_reading_process_output):
113 Rename inner 'proc' to 'p' to avoid shadowing.
114 Indent for consistency with usual Emacs style.
115
1162011-11-25 Eli Zaretskii <eliz@gnu.org>
117
118 * xdisp.c (redisplay_window): If cursor row is not fully visible
119 after recentering, and scroll-conservatively is set to a large
120 number, scroll window by a few more lines to make the cursor fully
121 visible and out of scroll-margin. (Bug#10105)
122 (start_display): Don't move to the next line if the display should
123 start at a newline that is part of a display vector or an overlay
124 string. (Bug#10119)
125
1262011-11-24 Juri Linkov <juri@jurta.org>
127
128 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
129 after the `MagickPingImage' call. (Bug#10112)
130
1312011-11-23 Chong Yidong <cyd@gnu.org>
132
133 * window.c (Fcoordinates_in_window_p): Accept only live windows.
134
1352011-11-23 Martin Rudalics <rudalics@gmx.at>
136
137 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
138 making another buffer current. (Bug#10114)
139
1402011-11-23 Glenn Morris <rgm@gnu.org>
141
142 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
143
1442011-11-23 Chong Yidong <cyd@gnu.org>
145
146 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
147 using it (Bug#5984).
148
1492011-11-22 Eli Zaretskii <eliz@gnu.org>
150
151 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
152 and header-lines, as they don't have one computed for them.
153 (Bug#10098)
154
155 * .gdbinit (prow): Make displayed values more self-explaining.
156 Add row's hash code.
157
12011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org> 1582011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 159
3 * process.c (wait_reading_process_output): Fix asynchrounous 160 * process.c (wait_reading_process_output): Fix asynchrounous
@@ -7075,7 +7232,7 @@
7075 7232
70762011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change) 72332011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
7077 7234
7078 * xml.c (parse_region): Avoid creating spurious whiespace nodes. 7235 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
7079 7236
70802011-04-08 Chong Yidong <cyd@stupidchicken.com> 72372011-04-08 Chong Yidong <cyd@stupidchicken.com>
7081 7238
@@ -7691,7 +7848,7 @@
7691 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1): 7848 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
7692 Use Frun_hooks. 7849 Use Frun_hooks.
7693 (command_loop_1): Use Frun_hooks. Call safe_run_hooks 7850 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
7694 unconditionnaly since it does the check itself. 7851 unconditionally since it does the check itself.
7695 7852
76962011-03-23 Paul Eggert <eggert@cs.ucla.edu> 78532011-03-23 Paul Eggert <eggert@cs.ucla.edu>
7697 7854
@@ -8575,7 +8732,7 @@
8575 (xg_set_widget_bg): New function. 8732 (xg_set_widget_bg): New function.
8576 (delete_cb): New function. 8733 (delete_cb): New function.
8577 (xg_create_frame_widgets): Connect delete-event to delete_cb. 8734 (xg_create_frame_widgets): Connect delete-event to delete_cb.
8578 Call xg_set_widget_bg. Only set backgrund pixmap for ! HAVE_GTK3 8735 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
8579 (xg_set_background_color): Call xg_set_widget_bg. 8736 (xg_set_background_color): Call xg_set_widget_bg.
8580 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask. 8737 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
8581 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3. 8738 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
diff --git a/src/ChangeLog.10 b/src/ChangeLog.10
index 99ab02577d5..7d2f48a03ea 100644
--- a/src/ChangeLog.10
+++ b/src/ChangeLog.10
@@ -1003,7 +1003,7 @@
1003 (syms_of_xdisp): DEFVAR_LISP and initialize it. Update doc string 1003 (syms_of_xdisp): DEFVAR_LISP and initialize it. Update doc string
1004 to describe new value `grow-only', and use of C-l. 1004 to describe new value `grow-only', and use of C-l.
1005 (display_tool_bar_line): Only use default face for border below 1005 (display_tool_bar_line): Only use default face for border below
1006 toolbar if not grow-only (to get acceptable visual appearence). 1006 toolbar if not grow-only (to get acceptable visual appearance).
1007 Explicitly set visible_height for empty toolbar lines. 1007 Explicitly set visible_height for empty toolbar lines.
1008 (redisplay_tool_bar): Handle `grow-only' setting. Check and clear 1008 (redisplay_tool_bar): Handle `grow-only' setting. Check and clear
1009 minimize_tool_bar_window_p flag. 1009 minimize_tool_bar_window_p flag.
@@ -4346,7 +4346,7 @@
4346 4346
4347 * textprop.c (Fremove_list_of_text_properties): 4347 * textprop.c (Fremove_list_of_text_properties):
4348 Ensure modify_region is called only when buffer is modified and that 4348 Ensure modify_region is called only when buffer is modified and that
4349 signal_after_change is allways called in that case. 4349 signal_after_change is always called in that case.
4350 4350
4351 * print.c (PRINTFINISH): Call signal_after_change. 4351 * print.c (PRINTFINISH): Call signal_after_change.
4352 4352
@@ -5084,7 +5084,7 @@
5084 5084
50852006-02-26 Chong Yidong <cyd@stupidchicken.com> 50852006-02-26 Chong Yidong <cyd@stupidchicken.com>
5086 5086
5087 * xterm.h, xterm.c (x_uncatch_errors): Delete unneccessary argument. 5087 * xterm.h, xterm.c (x_uncatch_errors): Delete unnecessary argument.
5088 5088
5089 * xterm.c (x_load_font, x_term_init, XTmouse_position) 5089 * xterm.c (x_load_font, x_term_init, XTmouse_position)
5090 (handle_one_xevent, x_connection_closed, x_list_fonts): 5090 (handle_one_xevent, x_connection_closed, x_list_fonts):
@@ -12087,7 +12087,7 @@
12087 (merge_face_heights): Eliminate GCPRO arg. All callers changed. 12087 (merge_face_heights): Eliminate GCPRO arg. All callers changed.
12088 12088
12089 * keyboard.c (command_loop_1): Change Vtransient_mark_mode 12089 * keyboard.c (command_loop_1): Change Vtransient_mark_mode
12090 before deciding whether to inactivate mark. 12090 before deciding whether to deactivate mark.
12091 12091
120922004-11-06 Lars Brinkhoff <lars@nocrew.org> 120922004-11-06 Lars Brinkhoff <lars@nocrew.org>
12093 12093
@@ -23013,7 +23013,7 @@
23013 (try_window_id): Likewise. 23013 (try_window_id): Likewise.
23014 (redisplay_window): New local var buffer_unchanged_p. 23014 (redisplay_window): New local var buffer_unchanged_p.
23015 23015
23016 * keyboard.c (cmd_error) [HAVE_X_WINDOWS]: Maybe call cancel_houglass. 23016 * keyboard.c (cmd_error) [HAVE_X_WINDOWS]: Maybe call cancel_hourglass.
23017 23017
23018 * process.c (create_process): Test USG_SUBTTY_WORKS. 23018 * process.c (create_process): Test USG_SUBTTY_WORKS.
23019 (process_send_signal): Clean up handling of GID. 23019 (process_send_signal): Clean up handling of GID.
diff --git a/src/ChangeLog.11 b/src/ChangeLog.11
index 07d4f4ec116..7c46dea675c 100644
--- a/src/ChangeLog.11
+++ b/src/ChangeLog.11
@@ -966,7 +966,7 @@
966 ($(BLD)/editfns.$(O)): Depend on ../lib/strftime.h. 966 ($(BLD)/editfns.$(O)): Depend on ../lib/strftime.h.
967 ($(BLD)/print.$(O)): Depend on ../lib/ftoastr.h and ../lib/intprops.h. 967 ($(BLD)/print.$(O)): Depend on ../lib/ftoastr.h and ../lib/intprops.h.
968 968
969 * deps.mk: Update for recent changes: gnutls support, gnulib 969 * deps.mk: Update for recent changes: GnuTLS support, gnulib
970 imports, addition of globals.h. 970 imports, addition of globals.h.
971 971
972 * makefile.w32-in ($(BLD)/sysdep.$(O)): Depend on 972 * makefile.w32-in ($(BLD)/sysdep.$(O)): Depend on
@@ -2191,7 +2191,7 @@
21912010-12-16 Jan Djärv <jan.h.d@swipnet.se> 21912010-12-16 Jan Djärv <jan.h.d@swipnet.se>
2192 2192
2193 * nsterm.m (ns_draw_window_cursor): If the cursor color is the 2193 * nsterm.m (ns_draw_window_cursor): If the cursor color is the
2194 same as the background, use the face forground as cursor. 2194 same as the background, use the face foreground as cursor.
2195 2195
21962010-12-13 Eli Zaretskii <eliz@gnu.org> 21962010-12-13 Eli Zaretskii <eliz@gnu.org>
2197 2197
@@ -3268,7 +3268,7 @@
32682010-10-10 Lars Magne Ingebrigtsen <larsi@gnus.org> 32682010-10-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
3269 3269
3270 * gnutls.c (emacs_gnutls_write): If we're trying to write before 3270 * gnutls.c (emacs_gnutls_write): If we're trying to write before
3271 gnutls is ready, return EAGAIN as the errno. 3271 GnuTLS is ready, return EAGAIN as the errno.
3272 3272
32732010-10-10 Dan Nicolaescu <dann@ics.uci.edu> 32732010-10-10 Dan Nicolaescu <dann@ics.uci.edu>
3274 3274
@@ -3585,12 +3585,12 @@
3585 * process.c (make_process): Set the gnutls_p field to zero by 3585 * process.c (make_process): Set the gnutls_p field to zero by
3586 default. 3586 default.
3587 (read_process_output): Always call the gnutls_read function if the 3587 (read_process_output): Always call the gnutls_read function if the
3588 stream is a gnutls stream. 3588 stream is a GnuTLS stream.
3589 (send_process): Ditto for writes. 3589 (send_process): Ditto for writes.
3590 3590
3591 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read): Refuse to read 3591 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read): Refuse to read
3592 or write anything until the state is GNUTLS_STAGE_READY. 3592 or write anything until the state is GNUTLS_STAGE_READY.
3593 (Fgnutls_boot): Mark the stream as being a gnutls stream. 3593 (Fgnutls_boot): Mark the stream as being a GnuTLS stream.
3594 3594
35952010-09-29 Eli Zaretskii <eliz@gnu.org> 35952010-09-29 Eli Zaretskii <eliz@gnu.org>
3596 3596
@@ -11805,7 +11805,7 @@
11805 * coding.c (encode_coding_utf_16): Fix checking of a Unicode 11805 * coding.c (encode_coding_utf_16): Fix checking of a Unicode
11806 character. 11806 character.
11807 11807
11808 * cmds.c (Fself_insert_command): Avoid unnecessay 11808 * cmds.c (Fself_insert_command): Avoid unnecessary
11809 unibyte->multibyte conversion. (Bug#4240) (Bug#4037) 11809 unibyte->multibyte conversion. (Bug#4240) (Bug#4037)
11810 11810
118112009-08-26 Dan Nicolaescu <dann@ics.uci.edu> 118112009-08-26 Dan Nicolaescu <dann@ics.uci.edu>
@@ -22234,7 +22234,7 @@
22234 * lisp.h (Fdelete_terminal): Declare. 22234 * lisp.h (Fdelete_terminal): Declare.
22235 22235
22236 * charset.h (CHECK_CHARSET, CHECK_CHARSET_GET_ID) 22236 * charset.h (CHECK_CHARSET, CHECK_CHARSET_GET_ID)
22237 (CHECK_CHARSET_GET_ATTR): Don't use the inexistent return value of 22237 (CHECK_CHARSET_GET_ATTR): Don't use the nonexistent return value of
22238 wrong_type_argument. 22238 wrong_type_argument.
22239 22239
222402008-02-22 Kenichi Handa <handa@ni.aist.go.jp> 222402008-02-22 Kenichi Handa <handa@ni.aist.go.jp>
@@ -27366,7 +27366,7 @@
27366 27366
27367 * ccl.c: Include "character.h". 27367 * ccl.c: Include "character.h".
27368 (Qccl, Qcclp): New variables. 27368 (Qccl, Qcclp): New variables.
27369 (CCL_WRITE_CHAR): Alway treat the arg CH as a character even if 27369 (CCL_WRITE_CHAR): Always treat the arg CH as a character even if
27370 it's less than 256. 27370 it's less than 256.
27371 (CCL_WRITE_MULTIBYTE_CHAR): Delete. 27371 (CCL_WRITE_MULTIBYTE_CHAR): Delete.
27372 (CCL_WRITE_STRING, CCL_READ_CHAR): Adjust for the change of SRC 27372 (CCL_WRITE_STRING, CCL_READ_CHAR): Adjust for the change of SRC
@@ -31330,7 +31330,7 @@
31330 31330
313312007-05-12 Chong Yidong <cyd@stupidchicken.com> 313312007-05-12 Chong Yidong <cyd@stupidchicken.com>
31332 31332
31333 * image.c (pbm_load): Correctly check image size for greyscale pbm. 31333 * image.c (pbm_load): Correctly check image size for grayscale pbm.
31334 31334
31335 * xterm.c (XTread_socket): Yet Another Uncaught X Error Crash (YAUXEC). 31335 * xterm.c (XTread_socket): Yet Another Uncaught X Error Crash (YAUXEC).
31336 31336
diff --git a/src/ChangeLog.3 b/src/ChangeLog.3
index cbf867829c7..34906e505da 100644
--- a/src/ChangeLog.3
+++ b/src/ChangeLog.3
@@ -3271,7 +3271,7 @@
3271 [not HAVE_X11] (x_set_border_pixel): Use gray_width and 3271 [not HAVE_X11] (x_set_border_pixel): Use gray_width and
3272 gray_height, instead of assuming that the bitmap is 16x16. 3272 gray_height, instead of assuming that the bitmap is 16x16.
3273 (x_make_gc): Instead of creating a pixmap and then calling 3273 (x_make_gc): Instead of creating a pixmap and then calling
3274 XPutImage to make it into a grey stipple, just call 3274 XPutImage to make it into a gray stipple, just call
3275 XCreatePixmapFromBitmapData to do it all at once. 3275 XCreatePixmapFromBitmapData to do it all at once.
3276 3276
3277 * xterm.c (x_text_icon): Move the request for font information 3277 * xterm.c (x_text_icon): Move the request for font information
@@ -14880,7 +14880,7 @@
14880 14880
148811989-08-09 Joseph Arceneaux (jla@spiff) 148811989-08-09 Joseph Arceneaux (jla@spiff)
14882 14882
14883 * ../oldXMenu/Makefile: Removed all the unneccessary X stuff. 14883 * ../oldXMenu/Makefile: Removed all the unnecessary X stuff.
14884 14884
148851989-08-07 Richard Stallman (rms@sugar-bombs.ai.mit.edu) 148851989-08-07 Richard Stallman (rms@sugar-bombs.ai.mit.edu)
14886 14886
diff --git a/src/ChangeLog.6 b/src/ChangeLog.6
index af97d0de7b4..74141f6813a 100644
--- a/src/ChangeLog.6
+++ b/src/ChangeLog.6
@@ -718,7 +718,7 @@
718 (init_ntproc) [HAVE_SOCKETS]: Only load winsock library on startup 718 (init_ntproc) [HAVE_SOCKETS]: Only load winsock library on startup
719 if PRELOAD_WINSOCK is set in environment (or registry). 719 if PRELOAD_WINSOCK is set in environment (or registry).
720 720
721 * ntproc.c (Fwin32_has_winsock, Fwin32_unload_winsock) 721 * ntproc.c (Fwin32_has_winsock, Fwin32_unload_winsock)
722 [HAVE_SOCKETS]: New functions. 722 [HAVE_SOCKETS]: New functions.
723 (syms_of_ntproc) [HAVE_SOCKETS]: defsubr them. 723 (syms_of_ntproc) [HAVE_SOCKETS]: defsubr them.
724 724
@@ -845,7 +845,7 @@
845 (timer_id): Renamed to mouse_button_timer. 845 (timer_id): Renamed to mouse_button_timer.
846 (saved_mouse_move_msg, mouse_move_timer): New variables. 846 (saved_mouse_move_msg, mouse_move_timer): New variables.
847 (win_msg_worker): Delete WM_TIMER code. 847 (win_msg_worker): Delete WM_TIMER code.
848 (win32_wnd_proc): Handle WM_TIMER events here. Use separate timers 848 (win32_wnd_proc): Handle WM_TIMER events here. Use separate timers
849 for mouse down and mouse move (including scroll bar drag) events. 849 for mouse down and mouse move (including scroll bar drag) events.
850 Add new handling code for WM_VSCROLL and WM_MOUSEMOVE events. 850 Add new handling code for WM_VSCROLL and WM_MOUSEMOVE events.
851 Only filter WM_MOUSEMOVE events when a button is held down. 851 Only filter WM_MOUSEMOVE events when a button is held down.
@@ -1100,17 +1100,17 @@
1100 1100
1101 (nt_sleep): Renamed to sys_sleep. 1101 (nt_sleep): Renamed to sys_sleep.
1102 1102
1103 (rename): Renamed to sys_rename. Always rename to a temporary name 1103 (rename): Renamed to sys_rename. Always rename to a temporary name
1104 first on Windows 95. Unlink new name first if necessary. 1104 first on Windows 95. Unlink new name first if necessary.
1105 1105
1106 (dir_finding): Variable deleted. 1106 (dir_finding): Variable deleted.
1107 (dir_is_fat, dir_pathname): New variables. 1107 (dir_is_fat, dir_pathname): New variables.
1108 1108
1109 (openddir): Fail if dir_find_handle is in use. Save directory name 1109 (openddir): Fail if dir_find_handle is in use. Save directory name
1110 in dir_pathname, and set dir_is_fat appropriately. 1110 in dir_pathname, and set dir_is_fat appropriately.
1111 (closedir, readdir): Use dir_find_handle in place of dir_finding. 1111 (closedir, readdir): Use dir_find_handle in place of dir_finding.
1112 (readdir): Copy directory name from dir_pathname on first 1112 (readdir): Copy directory name from dir_pathname on first
1113 call. Use IS_DIRECTORY_SEP instead of IS_ANY_SEP. Force filename 1113 call. Use IS_DIRECTORY_SEP instead of IS_ANY_SEP. Force filename
1114 to be lower case on FAT volumes. 1114 to be lower case on FAT volumes.
1115 1115
1116 (getpwuid): Move struct passwd initialization to init_user_info, 1116 (getpwuid): Move struct passwd initialization to init_user_info,
@@ -1141,7 +1141,7 @@
1141 (get_emacs_configuration): Detect Windows flavor (Windows 95 or 1141 (get_emacs_configuration): Detect Windows flavor (Windows 95 or
1142 NT) at run-time. Change OS name for Windows 95 to be "win95". 1142 NT) at run-time. Change OS name for Windows 95 to be "win95".
1143 1143
1144 (fd_info): New variable. Array of extra info for file descriptors 1144 (fd_info): New variable. Array of extra info for file descriptors
1145 needed for pipe/socket support. 1145 needed for pipe/socket support.
1146 1146
1147 (utc_base_ft, utc_base, init): New internal variables used for 1147 (utc_base_ft, utc_base, init): New internal variables used for
@@ -1206,7 +1206,7 @@
1206 * ntinevt.c (win32_kdb_patch_key): Initialize isdead. 1206 * ntinevt.c (win32_kdb_patch_key): Initialize isdead.
1207 (key_event) [HAVE_NTGUI]: Use Windows key code. 1207 (key_event) [HAVE_NTGUI]: Use Windows key code.
1208 1208
1209 * ntproc.c: Include config.h after CRT headers. Include fcntl.h. 1209 * ntproc.c: Include config.h after CRT headers. Include fcntl.h.
1210 (child_process, MAX_CHILDREN, CHILD_ACTIVE): Moved to nt.h. 1210 (child_process, MAX_CHILDREN, CHILD_ACTIVE): Moved to nt.h.
1211 (DebugPrint): New macro. 1211 (DebugPrint): New macro.
1212 (new_child): Create input event structures for child processes. 1212 (new_child): Create input event structures for child processes.
@@ -2580,7 +2580,7 @@
2580 (win32_fill_rect, dumpglyphs, do_line_dance, x_draw_box): 2580 (win32_fill_rect, dumpglyphs, do_line_dance, x_draw_box):
2581 Use Get/ReleaseFrameDC. 2581 Use Get/ReleaseFrameDC.
2582 (win32_update_begin): Regenerate palette if required. 2582 (win32_update_begin): Regenerate palette if required.
2583 (w32_read_socket): Use FALSE. Handle WM_PALETTECHANGED. 2583 (w32_read_socket): Use FALSE. Handle WM_PALETTECHANGED.
2584 (win32_term_init): Use GetDC directly. 2584 (win32_term_init): Use GetDC directly.
2585 Enable palette in display structure. 2585 Enable palette in display structure.
2586 Predefine white and black. 2586 Predefine white and black.
@@ -4501,7 +4501,7 @@
4501 * msdos.c (putchar): Call internal_flush instead of _flsbuf. 4501 * msdos.c (putchar): Call internal_flush instead of _flsbuf.
4502 (DO_TERMSCRIPT): New macro to support open-termscript. 4502 (DO_TERMSCRIPT): New macro to support open-termscript.
4503 (internal_flush): Corrected handling of flush in middle of 4503 (internal_flush): Corrected handling of flush in middle of
4504 escape sequences. Handle screen width > 127. 4504 escape sequences. Handle screen width > 127.
4505 (flush_escape): New function for use by internal_flush. 4505 (flush_escape): New function for use by internal_flush.
4506 (sys_select): New MS-DOS specific version with us timing. 4506 (sys_select): New MS-DOS specific version with us timing.
4507 (EMACSCOLORS): New environment variable. 4507 (EMACSCOLORS): New environment variable.
diff --git a/src/ChangeLog.8 b/src/ChangeLog.8
index e21af17657f..2f3ee45a1ac 100644
--- a/src/ChangeLog.8
+++ b/src/ChangeLog.8
@@ -5409,7 +5409,7 @@
5409 5409
54101998-11-10 Gerd Moellmann <gerd@gnu.org> 54101998-11-10 Gerd Moellmann <gerd@gnu.org>
5411 5411
5412 * xrdb.c (x_load_resources): Add grey background colors as 5412 * xrdb.c (x_load_resources): Add gray background colors as
5413 defaults for menus, scroll bars, and dialogs. 5413 defaults for menus, scroll bars, and dialogs.
5414 5414
5415 * insdel.c (prepare_to_modify_buffer): Move setting 5415 * insdel.c (prepare_to_modify_buffer): Move setting
@@ -8018,7 +8018,7 @@
8018 8018
8019 * xterm.c (x_scroll_run): Renamed from do_line_dance. 8019 * xterm.c (x_scroll_run): Renamed from do_line_dance.
8020 8020
8021 * xdisp.c (redisplay_window): For window-based redisplay, alway 8021 * xdisp.c (redisplay_window): For window-based redisplay, always
8022 try try_window_id. 8022 try try_window_id.
8023 8023
8024 * xterm.c (struct glyph_string): New member two_byte_p that is 8024 * xterm.c (struct glyph_string): New member two_byte_p that is
@@ -12766,7 +12766,7 @@
12766 12766
127671998-12-08 Geoff Voelker <voelker@cs.washington.edu> 127671998-12-08 Geoff Voelker <voelker@cs.washington.edu>
12768 12768
12769 * makefile.nt: Do string comparision of _NMAKE_VER. 12769 * makefile.nt: Do string comparison of _NMAKE_VER.
12770 12770
127711998-12-06 Eli Zaretskii <eliz@mescaline.gnu.org> 127711998-12-06 Eli Zaretskii <eliz@mescaline.gnu.org>
12772 12772
diff --git a/src/ChangeLog.9 b/src/ChangeLog.9
index 6f007992bef..6e3a8d8ab3b 100644
--- a/src/ChangeLog.9
+++ b/src/ChangeLog.9
@@ -3479,7 +3479,7 @@
3479 a workaround for SunOS 4's cc. 3479 a workaround for SunOS 4's cc.
3480 (CCL_CALL_FOR_MAP_INSTRUCTION): Use "if (1)..." not "do {...". 3480 (CCL_CALL_FOR_MAP_INSTRUCTION): Use "if (1)..." not "do {...".
3481 (CCL_SUCCESS, CCL_SUSPEND, CCL_INVALID_CMD): Likewise. 3481 (CCL_SUCCESS, CCL_SUSPEND, CCL_INVALID_CMD): Likewise.
3482 (ccl_driver) <CCL_ReadMultibyteChar2>: Remove unnecessay "do" 3482 (ccl_driver) <CCL_ReadMultibyteChar2>: Remove unnecessary "do"
3483 statement. 3483 statement.
3484 3484
34852001-01-23 Gerd Moellmann <gerd@gnu.org> 34852001-01-23 Gerd Moellmann <gerd@gnu.org>
diff --git a/src/buffer.c b/src/buffer.c
index a327a1650f1..a482493fac7 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1526,7 +1526,13 @@ with SIGHUP. */)
1526 UNGCPRO; 1526 UNGCPRO;
1527 } 1527 }
1528 1528
1529 /* Make this buffer not be current. 1529 /* Run replace_buffer_in_windows before making another buffer current
1530 since set-window-buffer-start-and-point will refuse to make another
1531 buffer current if the selected window does not show the current
1532 buffer. (Bug#10114) */
1533 replace_buffer_in_windows (buffer);
1534
1535 /* Make this buffer not be current.
1530 In the process, notice if this is the sole visible buffer 1536 In the process, notice if this is the sole visible buffer
1531 and give up if so. */ 1537 and give up if so. */
1532 if (b == current_buffer) 1538 if (b == current_buffer)
@@ -1566,7 +1572,6 @@ with SIGHUP. */)
1566 1572
1567 /* These may run Lisp code and into infinite loops (if someone 1573 /* These may run Lisp code and into infinite loops (if someone
1568 insisted on circular lists) so allow quitting here. */ 1574 insisted on circular lists) so allow quitting here. */
1569 replace_buffer_in_windows (buffer);
1570 frames_discard_buffer (buffer); 1575 frames_discard_buffer (buffer);
1571 1576
1572 clear_charpos_cache (b); 1577 clear_charpos_cache (b);
@@ -1626,7 +1631,7 @@ with SIGHUP. */)
1626 1631
1627 /* Reset the local variables, so that this buffer's local values 1632 /* Reset the local variables, so that this buffer's local values
1628 won't be protected from GC. They would be protected 1633 won't be protected from GC. They would be protected
1629 if they happened to remain encached in their symbols. 1634 if they happened to remain cached in their symbols.
1630 This gets rid of them for certain. */ 1635 This gets rid of them for certain. */
1631 swap_out_buffer_local_variables (b); 1636 swap_out_buffer_local_variables (b);
1632 reset_buffer_local_variables (b, 1); 1637 reset_buffer_local_variables (b, 1);
@@ -2481,7 +2486,7 @@ swap_out_buffer_local_variables (struct buffer *b)
2481 Lisp_Object sym = XCAR (XCAR (alist)); 2486 Lisp_Object sym = XCAR (XCAR (alist));
2482 eassert (XSYMBOL (sym)->redirect == SYMBOL_LOCALIZED); 2487 eassert (XSYMBOL (sym)->redirect == SYMBOL_LOCALIZED);
2483 /* Need not do anything if some other buffer's binding is 2488 /* Need not do anything if some other buffer's binding is
2484 now encached. */ 2489 now cached. */
2485 if (EQ (SYMBOL_BLV (XSYMBOL (sym))->where, buffer)) 2490 if (EQ (SYMBOL_BLV (XSYMBOL (sym))->where, buffer))
2486 { 2491 {
2487 /* Symbol is set up for this buffer's old local value: 2492 /* Symbol is set up for this buffer's old local value:
diff --git a/src/callint.c b/src/callint.c
index 61ab4a3963e..80e24f6c8ee 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -78,7 +78,7 @@ c -- Character (no input method is used).
78C -- Command name: symbol with interactive function definition. 78C -- Command name: symbol with interactive function definition.
79d -- Value of point as number. Does not do I/O. 79d -- Value of point as number. Does not do I/O.
80D -- Directory name. 80D -- Directory name.
81e -- Parametrized event (i.e., one that's a list) that invoked this command. 81e -- Parameterized event (i.e., one that's a list) that invoked this command.
82 If used more than once, the Nth `e' returns the Nth parameterized event. 82 If used more than once, the Nth `e' returns the Nth parameterized event.
83 This skips events that are integers or symbols. 83 This skips events that are integers or symbols.
84f -- Existing file name. 84f -- Existing file name.
diff --git a/src/ccl.c b/src/ccl.c
index 84d7a6a25ff..b7228a4d1cd 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -561,7 +561,7 @@ static Lisp_Object Vccl_program_table;
561 If VALn is lambda, move to the next map set like reaching to the 561 If VALn is lambda, move to the next map set like reaching to the
562 end of the current map set. 562 end of the current map set.
563 563
564 If VALn is a symbol, call the CCL program refered by it. 564 If VALn is a symbol, call the CCL program referred by it.
565 Then, use reg[rrr] as a mapped value except for -1, -2 and -3. 565 Then, use reg[rrr] as a mapped value except for -1, -2 and -3.
566 Such special values are regarded as nil, t, and lambda respectively. 566 Such special values are regarded as nil, t, and lambda respectively.
567 567
diff --git a/src/charset.c b/src/charset.c
index b6921a762b6..3c15f1bee54 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -166,9 +166,9 @@ static struct
166 maximum character of the current charset. */ 166 maximum character of the current charset. */
167 int min_char, max_char; 167 int min_char, max_char;
168 168
169 /* A Unicode character correspoinding to the code indice 0 (i.e. the 169 /* A Unicode character corresponding to the code index 0 (i.e. the
170 minimum code-point) of the current charset, or -1 if the code 170 minimum code-point) of the current charset, or -1 if the code
171 indice 0 is not a Unicode character. This is checked when 171 index 0 is not a Unicode character. This is checked when
172 table.encoder[CHAR] is zero. */ 172 table.encoder[CHAR] is zero. */
173 int zero_index_char; 173 int zero_index_char;
174 174
diff --git a/src/cm.h b/src/cm.h
index 8f23990ce55..dbf0820b94c 100644
--- a/src/cm.h
+++ b/src/cm.h
@@ -66,7 +66,7 @@ struct cm
66 location */ 66 location */
67 unsigned int cm_autolf:1; /* \r performs a \r\n (rn) */ 67 unsigned int cm_autolf:1; /* \r performs a \r\n (rn) */
68 68
69 /* Parametrized capabilities. This needs to be a struct since 69 /* Parameterized capabilities. This needs to be a struct since
70 the costs are accessed through pointers. */ 70 the costs are accessed through pointers. */
71 71
72#if 0 72#if 0
diff --git a/src/dired.c b/src/dired.c
index acc81a6ed9d..2b5f3b40641 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -229,11 +229,11 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, Lisp_Object m
229 int len; 229 int len;
230 int wanted = 0; 230 int wanted = 0;
231 Lisp_Object name, finalname; 231 Lisp_Object name, finalname;
232 struct gcpro inner_gcpro1, inner_gcpro2; 232 struct gcpro gcpro1, gcpro2;
233 233
234 len = NAMLEN (dp); 234 len = NAMLEN (dp);
235 name = finalname = make_unibyte_string (dp->d_name, len); 235 name = finalname = make_unibyte_string (dp->d_name, len);
236 GCPRO2_VAR (finalname, name, inner_gcpro); 236 GCPRO2 (finalname, name);
237 237
238 /* Note: DECODE_FILE can GC; it should protect its argument, 238 /* Note: DECODE_FILE can GC; it should protect its argument,
239 though. */ 239 though. */
@@ -289,23 +289,23 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, Lisp_Object m
289 /* Construct an expanded filename for the directory entry. 289 /* Construct an expanded filename for the directory entry.
290 Use the decoded names for input to Ffile_attributes. */ 290 Use the decoded names for input to Ffile_attributes. */
291 Lisp_Object decoded_fullname, fileattrs; 291 Lisp_Object decoded_fullname, fileattrs;
292 struct gcpro innermost_gcpro1, innermost_gcpro2; 292 struct gcpro gcpro1, gcpro2;
293 293
294 decoded_fullname = fileattrs = Qnil; 294 decoded_fullname = fileattrs = Qnil;
295 GCPRO2_VAR (decoded_fullname, fileattrs, innermost_gcpro); 295 GCPRO2 (decoded_fullname, fileattrs);
296 296
297 /* Both Fexpand_file_name and Ffile_attributes can GC. */ 297 /* Both Fexpand_file_name and Ffile_attributes can GC. */
298 decoded_fullname = Fexpand_file_name (name, directory); 298 decoded_fullname = Fexpand_file_name (name, directory);
299 fileattrs = Ffile_attributes (decoded_fullname, id_format); 299 fileattrs = Ffile_attributes (decoded_fullname, id_format);
300 300
301 list = Fcons (Fcons (finalname, fileattrs), list); 301 list = Fcons (Fcons (finalname, fileattrs), list);
302 UNGCPRO_VAR (innermost_gcpro); 302 UNGCPRO;
303 } 303 }
304 else 304 else
305 list = Fcons (finalname, list); 305 list = Fcons (finalname, list);
306 } 306 }
307 307
308 UNGCPRO_VAR (inner_gcpro); 308 UNGCPRO;
309 } 309 }
310 } 310 }
311 311
@@ -673,11 +673,11 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v
673 if (!NILP (predicate)) 673 if (!NILP (predicate))
674 { 674 {
675 Lisp_Object val; 675 Lisp_Object val;
676 struct gcpro inner_gcpro1; 676 struct gcpro gcpro1;
677 677
678 GCPRO1_VAR (name, inner_gcpro); 678 GCPRO1 (name);
679 val = call1 (predicate, name); 679 val = call1 (predicate, name);
680 UNGCPRO_VAR (inner_gcpro); 680 UNGCPRO;
681 681
682 if (NILP (val)) 682 if (NILP (val))
683 continue; 683 continue;
diff --git a/src/dispextern.h b/src/dispextern.h
index a45c5cc138f..ec66dcb4220 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -409,7 +409,7 @@ struct glyph
409 { 409 {
410 /* Metrics of a partial glyph of an image (type == IMAGE_GLYPH). */ 410 /* Metrics of a partial glyph of an image (type == IMAGE_GLYPH). */
411 struct glyph_slice img; 411 struct glyph_slice img;
412 /* Start and end indices of glyphs of a graphme cluster of a 412 /* Start and end indices of glyphs of a grapheme cluster of a
413 composition (type == COMPOSITE_GLYPH). */ 413 composition (type == COMPOSITE_GLYPH). */
414 struct { int from, to; } cmp; 414 struct { int from, to; } cmp;
415 /* Pixel offsets for upper and lower part of the acronym. */ 415 /* Pixel offsets for upper and lower part of the acronym. */
diff --git a/src/dispnew.c b/src/dispnew.c
index b920693688c..e21f565fb3a 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -612,7 +612,6 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y
612 row->glyphs[LAST_AREA] 612 row->glyphs[LAST_AREA]
613 = row->glyphs[LEFT_MARGIN_AREA] + dim.width; 613 = row->glyphs[LEFT_MARGIN_AREA] + dim.width;
614 } 614 }
615 xassert (!row->enabled_p || verify_row_hash (row));
616 ++row; 615 ++row;
617 } 616 }
618 } 617 }
@@ -3580,12 +3579,11 @@ update_window (struct window *w, int force_p)
3580 3579
3581 rif->update_window_begin_hook (w); 3580 rif->update_window_begin_hook (w);
3582 yb = window_text_bottom_y (w); 3581 yb = window_text_bottom_y (w);
3583
3584 /* If window has a header line, update it before everything else.
3585 Adjust y-positions of other rows by the header line height. */
3586 row = desired_matrix->rows; 3582 row = desired_matrix->rows;
3587 end = row + desired_matrix->nrows - 1; 3583 end = row + desired_matrix->nrows - 1;
3588 3584
3585 /* Take note of the header line, if there is one. We will
3586 update it below, after updating all of the window's lines. */
3589 if (row->mode_line_p) 3587 if (row->mode_line_p)
3590 { 3588 {
3591 header_line_row = row; 3589 header_line_row = row;
@@ -3630,6 +3628,8 @@ update_window (struct window *w, int force_p)
3630 3628
3631 /* Update the rest of the lines. */ 3629 /* Update the rest of the lines. */
3632 for (; row < end && (force_p || !input_pending); ++row) 3630 for (; row < end && (force_p || !input_pending); ++row)
3631 /* scrolling_window resets the enabled_p flag of the rows it
3632 reuses from current_matrix. */
3633 if (row->enabled_p) 3633 if (row->enabled_p)
3634 { 3634 {
3635 int vpos = MATRIX_ROW_VPOS (row, desired_matrix); 3635 int vpos = MATRIX_ROW_VPOS (row, desired_matrix);
@@ -4564,18 +4564,69 @@ scrolling_window (struct window *w, int header_line_p)
4564 { 4564 {
4565 rif->clear_window_mouse_face (w); 4565 rif->clear_window_mouse_face (w);
4566 rif->scroll_run_hook (w, r); 4566 rif->scroll_run_hook (w, r);
4567 }
4568
4569 /* Truncate runs that copy to where we copied to, and
4570 invalidate runs that copy from where we copied to. */
4571 for (j = nruns - 1; j > i; --j)
4572 {
4573 struct run *p = runs[j];
4574 int truncated_p = 0;
4567 4575
4568 /* Invalidate runs that copy from where we copied to. */ 4576 if (p->nrows > 0
4569 for (j = i + 1; j < nruns; ++j) 4577 && p->desired_y < r->desired_y + r->height
4578 && p->desired_y + p->height > r->desired_y)
4570 { 4579 {
4571 struct run *p = runs[j]; 4580 if (p->desired_y < r->desired_y)
4581 {
4582 p->nrows = r->desired_vpos - p->desired_vpos;
4583 p->height = r->desired_y - p->desired_y;
4584 truncated_p = 1;
4585 }
4586 else
4587 {
4588 int nrows_copied = (r->desired_vpos + r->nrows
4589 - p->desired_vpos);
4590
4591 if (p->nrows <= nrows_copied)
4592 p->nrows = 0;
4593 else
4594 {
4595 int height_copied = (r->desired_y + r->height
4596 - p->desired_y);
4597
4598 p->current_vpos += nrows_copied;
4599 p->desired_vpos += nrows_copied;
4600 p->nrows -= nrows_copied;
4601 p->current_y += height_copied;
4602 p->desired_y += height_copied;
4603 p->height -= height_copied;
4604 truncated_p = 1;
4605 }
4606 }
4607 }
4572 4608
4573 if ((p->current_y >= r->desired_y 4609 if (r->current_y != r->desired_y
4610 /* The condition below is equivalent to
4611 ((p->current_y >= r->desired_y
4574 && p->current_y < r->desired_y + r->height) 4612 && p->current_y < r->desired_y + r->height)
4575 || (p->current_y + p->height >= r->desired_y 4613 || (p->current_y + p->height > r->desired_y
4576 && (p->current_y + p->height 4614 && (p->current_y + p->height
4577 < r->desired_y + r->height))) 4615 <= r->desired_y + r->height)))
4578 p->nrows = 0; 4616 because we have 0 < p->height <= r->height. */
4617 && p->current_y < r->desired_y + r->height
4618 && p->current_y + p->height > r->desired_y)
4619 p->nrows = 0;
4620
4621 /* Reorder runs by copied pixel lines if truncated. */
4622 if (truncated_p && p->nrows > 0)
4623 {
4624 int k = nruns - 1;
4625
4626 while (runs[k]->nrows == 0 || runs[k]->height < p->height)
4627 k--;
4628 memmove (runs + j, runs + j + 1, (k - j) * sizeof (*runs));
4629 runs[k] = p;
4579 } 4630 }
4580 } 4631 }
4581 4632
@@ -4590,7 +4641,14 @@ scrolling_window (struct window *w, int header_line_p)
4590 to_overlapped_p = to->overlapped_p; 4641 to_overlapped_p = to->overlapped_p;
4591 from->redraw_fringe_bitmaps_p = from->fringe_bitmap_periodic_p; 4642 from->redraw_fringe_bitmaps_p = from->fringe_bitmap_periodic_p;
4592 assign_row (to, from); 4643 assign_row (to, from);
4593 to->enabled_p = 1, from->enabled_p = 0; 4644 /* The above `assign_row' actually does swap, so if we had
4645 an overlap in the copy destination of two runs, then
4646 the second run would assign a previously disabled bogus
4647 row. But thanks to the truncation code in the
4648 preceding for-loop, we no longer have such an overlap,
4649 and thus the assigned row should always be enabled. */
4650 xassert (to->enabled_p);
4651 from->enabled_p = 0;
4594 to->overlapped_p = to_overlapped_p; 4652 to->overlapped_p = to_overlapped_p;
4595 } 4653 }
4596 } 4654 }
diff --git a/src/fileio.c b/src/fileio.c
index 7e75e6285f0..c0f6c1d2e8e 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -1553,7 +1553,7 @@ those `/' is discarded. */)
1553 if (p) 1553 if (p)
1554 /* Start over with the new string, so we check the file-name-handler 1554 /* Start over with the new string, so we check the file-name-handler
1555 again. Important with filenames like "/home/foo//:/hello///there" 1555 again. Important with filenames like "/home/foo//:/hello///there"
1556 which whould substitute to "/:/hello///there" rather than "/there". */ 1556 which would substitute to "/:/hello///there" rather than "/there". */
1557 return Fsubstitute_in_file_name 1557 return Fsubstitute_in_file_name
1558 (make_specified_string (p, -1, endp - p, multibyte)); 1558 (make_specified_string (p, -1, endp - p, multibyte));
1559 1559
@@ -4100,6 +4100,16 @@ variable `last-coding-system-used' to the coding system actually used. */)
4100 adjust_after_insert (PT, PT_BYTE, PT + inserted, PT_BYTE + inserted, 4100 adjust_after_insert (PT, PT_BYTE, PT + inserted, PT_BYTE + inserted,
4101 inserted); 4101 inserted);
4102 4102
4103 /* Call after-change hooks for the inserted text, aside from the case
4104 of normal visiting (not with REPLACE), which is done in a new buffer
4105 "before" the buffer is changed. */
4106 if (inserted > 0 && total > 0
4107 && (NILP (visit) || !NILP (replace)))
4108 {
4109 signal_after_change (PT, 0, inserted);
4110 update_compositions (PT, PT, CHECK_BORDER);
4111 }
4112
4103 /* Now INSERTED is measured in characters. */ 4113 /* Now INSERTED is measured in characters. */
4104 4114
4105 handled: 4115 handled:
@@ -4270,16 +4280,6 @@ variable `last-coding-system-used' to the coding system actually used. */)
4270 unbind_to (count1, Qnil); 4280 unbind_to (count1, Qnil);
4271 } 4281 }
4272 4282
4273 /* Call after-change hooks for the inserted text, aside from the case
4274 of normal visiting (not with REPLACE), which is done in a new buffer
4275 "before" the buffer is changed. */
4276 if (inserted > 0 && total > 0
4277 && (NILP (visit) || !NILP (replace)))
4278 {
4279 signal_after_change (PT, 0, inserted);
4280 update_compositions (PT, PT, CHECK_BORDER);
4281 }
4282
4283 if (!NILP (visit) 4283 if (!NILP (visit)
4284 && current_buffer->modtime == -1) 4284 && current_buffer->modtime == -1)
4285 { 4285 {
diff --git a/src/font.c b/src/font.c
index 9559c65e7ed..35f5703e32e 100644
--- a/src/font.c
+++ b/src/font.c
@@ -3160,14 +3160,7 @@ font_find_for_lface (FRAME_PTR f, Lisp_Object *attrs, Lisp_Object spec, int c)
3160 else 3160 else
3161 { 3161 {
3162 Lisp_Object alters 3162 Lisp_Object alters
3163 = Fassoc_string (val, Vface_alternative_font_family_alist, 3163 = Fassoc_string (val, Vface_alternative_font_family_alist, Qt);
3164 /* Font family names are case-sensitive under NS. */
3165#ifndef HAVE_NS
3166 Qt
3167#else
3168 Qnil
3169#endif
3170 );
3171 3164
3172 if (! NILP (alters)) 3165 if (! NILP (alters))
3173 { 3166 {
diff --git a/src/fontset.c b/src/fontset.c
index 9697f62ea72..7592521cc7d 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -631,7 +631,7 @@ fontset_find_font (Lisp_Object fontset, int c, struct face *face, int id, int fa
631 { 631 {
632 /* Something strange happened, perhaps because of a 632 /* Something strange happened, perhaps because of a
633 Font-backend problem. Too avoid crashing, record 633 Font-backend problem. Too avoid crashing, record
634 that this spec is unsable. It may be better to find 634 that this spec is unusable. It may be better to find
635 another font of the same spec, but currently we don't 635 another font of the same spec, but currently we don't
636 have such an API. */ 636 have such an API. */
637 RFONT_DEF_SET_FACE (rfont_def, -1); 637 RFONT_DEF_SET_FACE (rfont_def, -1);
diff --git a/src/fringe.c b/src/fringe.c
index 25fecca2334..da896e07b76 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -35,7 +35,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
35 Logical bitmaps are used internally to denote things like 35 Logical bitmaps are used internally to denote things like
36 'end-of-buffer', 'left-truncation', 'overlay-arrow', etc. 36 'end-of-buffer', 'left-truncation', 'overlay-arrow', etc.
37 37
38 Physical bitmaps specify the visual appearence of the bitmap, 38 Physical bitmaps specify the visual appearance of the bitmap,
39 e.g. 'bottom-left-angle', 'left-arrow', 'left-triangle', etc. 39 e.g. 'bottom-left-angle', 'left-arrow', 'left-triangle', etc.
40 User defined bitmaps are physical bitmaps. 40 User defined bitmaps are physical bitmaps.
41 41
@@ -928,7 +928,7 @@ update_window_fringes (struct window *w, int keep_current_p)
928 int top_ind_rn, bot_ind_rn; 928 int top_ind_rn, bot_ind_rn;
929 int top_ind_min_y, bot_ind_max_y; 929 int top_ind_min_y, bot_ind_max_y;
930 930
931 /* top_ind_rn is set to a nonnegative value whenver 931 /* top_ind_rn is set to a nonnegative value whenever
932 row->indicate_bob_p is set, so it's OK that top_row_ends_at_zv_p 932 row->indicate_bob_p is set, so it's OK that top_row_ends_at_zv_p
933 is not initialized here. Similarly for bot_ind_rn, 933 is not initialized here. Similarly for bot_ind_rn,
934 row->indicate_eob_p and bot_row_ends_at_zv_p. */ 934 row->indicate_eob_p and bot_row_ends_at_zv_p. */
diff --git a/src/ftfont.c b/src/ftfont.c
index 5c540f9bf82..c48346b0147 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -1462,7 +1462,7 @@ ftfont_get_bitmap (struct font *font, unsigned int code, struct font_bitmap *bit
1462 : ft_face->glyph->bitmap.pixel_mode == FT_PIXEL_MODE_LCD_V ? 8 1462 : ft_face->glyph->bitmap.pixel_mode == FT_PIXEL_MODE_LCD_V ? 8
1463 : -1); 1463 : -1);
1464 if (bitmap->bits_per_pixel < 0) 1464 if (bitmap->bits_per_pixel < 0)
1465 /* We don't suport that kind of pixel mode. */ 1465 /* We don't support that kind of pixel mode. */
1466 return -1; 1466 return -1;
1467 bitmap->rows = ft_face->glyph->bitmap.rows; 1467 bitmap->rows = ft_face->glyph->bitmap.rows;
1468 bitmap->width = ft_face->glyph->bitmap.width; 1468 bitmap->width = ft_face->glyph->bitmap.width;
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 7e6f5c3164d..bc71685819e 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -1100,6 +1100,14 @@ xg_create_frame_widgets (FRAME_PTR f)
1100 else 1100 else
1101 wtop = gtk_window_new (GTK_WINDOW_TOPLEVEL); 1101 wtop = gtk_window_new (GTK_WINDOW_TOPLEVEL);
1102 1102
1103 /* gtk_window_set_has_resize_grip is a Gtk+ 3.0 function but Ubuntu
1104 has backported it to Gtk+ 2.0 and they add the resize grip for
1105 Gtk+ 2.0 applications also. But it has a bug that makes Emacs loop
1106 forever, so disable the grip. */
1107#if GTK_MAJOR_VERSION < 3 && defined (HAVE_GTK_WINDOW_SET_HAS_RESIZE_GRIP)
1108 gtk_window_set_has_resize_grip (GTK_WINDOW (wtop), FALSE);
1109#endif
1110
1103 xg_set_screen (wtop, f); 1111 xg_set_screen (wtop, f);
1104 1112
1105 wvbox = gtk_vbox_new (FALSE, 0); 1113 wvbox = gtk_vbox_new (FALSE, 0);
diff --git a/src/gtkutil.h b/src/gtkutil.h
index 2dfb3a5ed6c..7cc2d21f9c4 100644
--- a/src/gtkutil.h
+++ b/src/gtkutil.h
@@ -98,7 +98,7 @@ extern GtkWidget *xg_create_widget (const char *type,
98 struct _widget_value *val, 98 struct _widget_value *val,
99 GCallback select_cb, 99 GCallback select_cb,
100 GCallback deactivate_cb, 100 GCallback deactivate_cb,
101 GCallback hightlight_cb); 101 GCallback highlight_cb);
102 102
103extern void xg_modify_menubar_widgets (GtkWidget *menubar, 103extern void xg_modify_menubar_widgets (GtkWidget *menubar,
104 FRAME_PTR f, 104 FRAME_PTR f,
@@ -106,7 +106,7 @@ extern void xg_modify_menubar_widgets (GtkWidget *menubar,
106 int deep_p, 106 int deep_p,
107 GCallback select_cb, 107 GCallback select_cb,
108 GCallback deactivate_cb, 108 GCallback deactivate_cb,
109 GCallback hightlight_cb); 109 GCallback highlight_cb);
110 110
111extern int xg_update_frame_menubar (FRAME_PTR f); 111extern int xg_update_frame_menubar (FRAME_PTR f);
112 112
diff --git a/src/image.c b/src/image.c
index 8b61c7eefbc..81907d8e580 100644
--- a/src/image.c
+++ b/src/image.c
@@ -7618,7 +7618,7 @@ imagemagick_load_image (struct frame *f, struct image *img,
7618 image = image_spec_value (img->spec, QCindex, NULL); 7618 image = image_spec_value (img->spec, QCindex, NULL);
7619 ino = INTEGERP (image) ? XFASTINT (image) : 0; 7619 ino = INTEGERP (image) ? XFASTINT (image) : 0;
7620 ping_wand = NewMagickWand (); 7620 ping_wand = NewMagickWand ();
7621 MagickSetResolution (ping_wand, 2, 2); 7621
7622 if (filename != NULL) 7622 if (filename != NULL)
7623 { 7623 {
7624 status = MagickPingImage (ping_wand, filename); 7624 status = MagickPingImage (ping_wand, filename);
@@ -7628,6 +7628,8 @@ imagemagick_load_image (struct frame *f, struct image *img,
7628 status = MagickPingImageBlob (ping_wand, contents, size); 7628 status = MagickPingImageBlob (ping_wand, contents, size);
7629 } 7629 }
7630 7630
7631 MagickSetResolution (ping_wand, 2, 2);
7632
7631 if (! (0 <= ino && ino < MagickGetNumberImages (ping_wand))) 7633 if (! (0 <= ino && ino < MagickGetNumberImages (ping_wand)))
7632 { 7634 {
7633 image_error ("Invalid image number `%s' in image `%s'", 7635 image_error ("Invalid image number `%s' in image `%s'",
diff --git a/src/keyboard.c b/src/keyboard.c
index bee91c6b5cf..656634b8d31 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -3001,7 +3001,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
3001 { 3001 {
3002 Lisp_Object keys; 3002 Lisp_Object keys;
3003 int key_count, key_count_reset; 3003 int key_count, key_count_reset;
3004 struct gcpro inner_gcpro1; 3004 struct gcpro gcpro1;
3005 int count = SPECPDL_INDEX (); 3005 int count = SPECPDL_INDEX ();
3006 3006
3007 /* Save the echo status. */ 3007 /* Save the echo status. */
@@ -3029,7 +3029,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
3029 keys = Fcopy_sequence (this_command_keys); 3029 keys = Fcopy_sequence (this_command_keys);
3030 else 3030 else
3031 keys = Qnil; 3031 keys = Qnil;
3032 GCPRO1_VAR (keys, inner_gcpro); 3032 GCPRO1 (keys);
3033 3033
3034 /* Clear out this_command_keys. */ 3034 /* Clear out this_command_keys. */
3035 this_command_key_count = 0; 3035 this_command_key_count = 0;
@@ -3067,7 +3067,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
3067 if (saved_immediate_echo) 3067 if (saved_immediate_echo)
3068 echo_now (); 3068 echo_now ();
3069 3069
3070 UNGCPRO_VAR (inner_gcpro); 3070 UNGCPRO;
3071 3071
3072 /* The input method can return no events. */ 3072 /* The input method can return no events. */
3073 if (! CONSP (tem)) 3073 if (! CONSP (tem))
@@ -9069,9 +9069,9 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9069 int junk; 9069 int junk;
9070#endif 9070#endif
9071 9071
9072 struct gcpro outer_gcpro1; 9072 struct gcpro gcpro1;
9073 9073
9074 GCPRO1_VAR (fake_prefixed_keys, outer_gcpro); 9074 GCPRO1 (fake_prefixed_keys);
9075 raw_keybuf_count = 0; 9075 raw_keybuf_count = 0;
9076 9076
9077 last_nonmenu_event = Qnil; 9077 last_nonmenu_event = Qnil;
@@ -9367,7 +9367,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9367 if (EQ (key, Qt)) 9367 if (EQ (key, Qt))
9368 { 9368 {
9369 unbind_to (count, Qnil); 9369 unbind_to (count, Qnil);
9370 UNGCPRO_VAR (outer_gcpro); 9370 UNGCPRO;
9371 return -1; 9371 return -1;
9372 } 9372 }
9373 9373
@@ -10065,7 +10065,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
10065 add_command_key (keybuf[t]); 10065 add_command_key (keybuf[t]);
10066 } 10066 }
10067 10067
10068 UNGCPRO_VAR (outer_gcpro); 10068 UNGCPRO;
10069 return t; 10069 return t;
10070} 10070}
10071 10071
@@ -10874,7 +10874,7 @@ interrupt_signal (int signalnum) /* If we don't have an argument, some */
10874 /* If there are no frames there, let's pretend that we are a 10874 /* If there are no frames there, let's pretend that we are a
10875 well-behaving UN*X program and quit. We cannot do that while 10875 well-behaving UN*X program and quit. We cannot do that while
10876 GC is in progress, though. */ 10876 GC is in progress, though. */
10877 if (!gc_in_progress) 10877 if (!gc_in_progress && !waiting_for_input)
10878 Fkill_emacs (Qnil); 10878 Fkill_emacs (Qnil);
10879 else 10879 else
10880 Vquit_flag = Qt; 10880 Vquit_flag = Qt;
diff --git a/src/lisp.h b/src/lisp.h
index 2056b7caff8..6b19396111c 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -163,14 +163,23 @@ extern int suppress_checking EXTERNALLY_VISIBLE;
163/* First, try and define DECL_ALIGN(type,var) which declares a static 163/* First, try and define DECL_ALIGN(type,var) which declares a static
164 variable VAR of type TYPE with the added requirement that it be 164 variable VAR of type TYPE with the added requirement that it be
165 TYPEBITS-aligned. */ 165 TYPEBITS-aligned. */
166
167#ifndef GCTYPEBITS
168#define GCTYPEBITS 3
169#endif
170
166#ifndef NO_DECL_ALIGN 171#ifndef NO_DECL_ALIGN
167# ifndef DECL_ALIGN 172# ifndef DECL_ALIGN
168# if HAVE_ATTRIBUTE_ALIGNED 173# if HAVE_ATTRIBUTE_ALIGNED
169# define DECL_ALIGN(type, var) \ 174# define DECL_ALIGN(type, var) \
170 type __attribute__ ((__aligned__ (1 << GCTYPEBITS))) var 175 type __attribute__ ((__aligned__ (1 << GCTYPEBITS))) var
171# elif defined(_MSC_VER) 176# elif defined(_MSC_VER)
177# define ALIGN_GCTYPEBITS 8
178# if (1 << GCTYPEBITS) != ALIGN_GCTYPEBITS
179# error ALIGN_GCTYPEBITS is wrong!
180# endif
172# define DECL_ALIGN(type, var) \ 181# define DECL_ALIGN(type, var) \
173 type __declspec(align(1 << GCTYPEBITS)) var 182 type __declspec(align(ALIGN_GCTYPEBITS)) var
174# else 183# else
175 /* What directives do other compilers use? */ 184 /* What directives do other compilers use? */
176# endif 185# endif
@@ -300,10 +309,6 @@ enum Lisp_Fwd_Type
300 Lisp_Fwd_Kboard_Obj, /* Fwd to a Lisp_Object field of kboards. */ 309 Lisp_Fwd_Kboard_Obj, /* Fwd to a Lisp_Object field of kboards. */
301 }; 310 };
302 311
303#ifndef GCTYPEBITS
304#define GCTYPEBITS 3
305#endif
306
307/* These values are overridden by the m- file on some machines. */ 312/* These values are overridden by the m- file on some machines. */
308#ifndef VALBITS 313#ifndef VALBITS
309#define VALBITS (BITS_PER_EMACS_INT - GCTYPEBITS) 314#define VALBITS (BITS_PER_EMACS_INT - GCTYPEBITS)
@@ -324,7 +329,7 @@ union Lisp_Object
324 329
325 struct 330 struct
326 { 331 {
327 /* Use explict signed, the signedness of a bit-field of type 332 /* Use explicit signed, the signedness of a bit-field of type
328 int is implementation defined. */ 333 int is implementation defined. */
329 signed EMACS_INT val : VALBITS; 334 signed EMACS_INT val : VALBITS;
330 ENUM_BF (Lisp_Type) type : GCTYPEBITS; 335 ENUM_BF (Lisp_Type) type : GCTYPEBITS;
@@ -349,7 +354,7 @@ union Lisp_Object
349 struct 354 struct
350 { 355 {
351 ENUM_BF (Lisp_Type) type : GCTYPEBITS; 356 ENUM_BF (Lisp_Type) type : GCTYPEBITS;
352 /* Use explict signed, the signedness of a bit-field of type 357 /* Use explicit signed, the signedness of a bit-field of type
353 int is implementation defined. */ 358 int is implementation defined. */
354 signed EMACS_INT val : VALBITS; 359 signed EMACS_INT val : VALBITS;
355 } s; 360 } s;
@@ -2222,143 +2227,127 @@ struct gcpro
2222 || GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS) 2227 || GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS)
2223 2228
2224 2229
2225#define GCPRO1(var) \
2226 GCPRO1_VAR (var, gcpro)
2227#define GCPRO2(var1, var2) \
2228 GCPRO2_VAR (var1, var2, gcpro)
2229#define GCPRO3(var1, var2, var3) \
2230 GCPRO3_VAR (var1, var2, var3, gcpro)
2231#define GCPRO4(var1, var2, var3, var4) \
2232 GCPRO4_VAR (var1, var2, var3, var4, gcpro)
2233#define GCPRO5(var1, var2, var3, var4, var5) \
2234 GCPRO5_VAR (var1, var2, var3, var4, var5, gcpro)
2235#define GCPRO6(var1, var2, var3, var4, var5, var6) \
2236 GCPRO6_VAR (var1, var2, var3, var4, var5, var6, gcpro)
2237#define UNGCPRO UNGCPRO_VAR (gcpro)
2238
2239#if GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS 2230#if GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS
2240 2231
2241/* Do something silly with gcproN vars just so gcc shuts up. */ 2232/* Do something silly with gcproN vars just so gcc shuts up. */
2242/* You get warnings from MIPSPro... */ 2233/* You get warnings from MIPSPro... */
2243 2234
2244#define GCPRO1_VAR(var, gcpro) ((void) gcpro##1) 2235#define GCPRO1(varname) ((void) gcpro1)
2245#define GCPRO2_VAR(var1, var2, gcpro) \ 2236#define GCPRO2(varname1, varname2) ((void) gcpro2, (void) gcpro1)
2246 ((void) gcpro##2, (void) gcpro##1) 2237#define GCPRO3(varname1, varname2, varname3) \
2247#define GCPRO3_VAR(var1, var2, var3, gcpro) \ 2238 ((void) gcpro3, (void) gcpro2, (void) gcpro1)
2248 ((void) gcpro##3, (void) gcpro##2, (void) gcpro##1) 2239#define GCPRO4(varname1, varname2, varname3, varname4) \
2249#define GCPRO4_VAR(var1, var2, var3, var4, gcpro) \ 2240 ((void) gcpro4, (void) gcpro3, (void) gcpro2, (void) gcpro1)
2250 ((void) gcpro##4, (void) gcpro##3, (void) gcpro##2, (void) gcpro##1) 2241#define GCPRO5(varname1, varname2, varname3, varname4, varname5) \
2251#define GCPRO5_VAR(var1, var2, var3, var4, var5, gcpro) \ 2242 ((void) gcpro5, (void) gcpro4, (void) gcpro3, (void) gcpro2, (void) gcpro1)
2252 ((void) gcpro##5, (void) gcpro##4, (void) gcpro##3, (void) gcpro##2, \ 2243#define GCPRO6(varname1, varname2, varname3, varname4, varname5, varname6) \
2253 (void) gcpro##1) 2244 ((void) gcpro6, (void) gcpro5, (void) gcpro4, (void) gcpro3, (void) gcpro2, \
2254#define GCPRO6_VAR(var1, var2, var3, var4, var5, var6, gcpro) \ 2245 (void) gcpro1)
2255 ((void) gcpro##6, (void) gcpro##5, (void) gcpro##4, (void) gcpro##3, \ 2246#define UNGCPRO ((void) 0)
2256 (void) gcpro##2, (void) gcpro##1)
2257#define UNGCPRO_VAR(gcpro) ((void) 0)
2258 2247
2259#else /* GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS */ 2248#else /* GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS */
2260 2249
2261#ifndef DEBUG_GCPRO 2250#ifndef DEBUG_GCPRO
2262 2251
2263#define GCPRO1_VAR(var1, gcpro) \ 2252#define GCPRO1(varname) \
2264 {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ 2253 {gcpro1.next = gcprolist; gcpro1.var = &varname; gcpro1.nvars = 1; \
2265 gcprolist = &gcpro##1; } 2254 gcprolist = &gcpro1; }
2266 2255
2267#define GCPRO2_VAR(var1, var2, gcpro) \ 2256#define GCPRO2(varname1, varname2) \
2268 {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ 2257 {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \
2269 gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ 2258 gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \
2270 gcprolist = &gcpro##2; } 2259 gcprolist = &gcpro2; }
2271 2260
2272#define GCPRO3_VAR(var1, var2, var3, gcpro) \ 2261#define GCPRO3(varname1, varname2, varname3) \
2273 {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ 2262 {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \
2274 gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ 2263 gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \
2275 gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ 2264 gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \
2276 gcprolist = &gcpro##3; } 2265 gcprolist = &gcpro3; }
2277 2266
2278#define GCPRO4_VAR(var1, var2, var3, var4, gcpro) \ 2267#define GCPRO4(varname1, varname2, varname3, varname4) \
2279 {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ 2268 {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \
2280 gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ 2269 gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \
2281 gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ 2270 gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \
2282 gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ 2271 gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \
2283 gcprolist = &gcpro##4; } 2272 gcprolist = &gcpro4; }
2284 2273
2285#define GCPRO5_VAR(var1, var2, var3, var4, var5, gcpro) \ 2274#define GCPRO5(varname1, varname2, varname3, varname4, varname5) \
2286 {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ 2275 {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \
2287 gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ 2276 gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \
2288 gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ 2277 gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \
2289 gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ 2278 gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \
2290 gcpro##5 .next = &gcpro##4; gcpro##5 .var = &var5; gcpro##5 .nvars = 1; \ 2279 gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \
2291 gcprolist = &gcpro##5; } 2280 gcprolist = &gcpro5; }
2292 2281
2293#define GCPRO6_VAR(var1, var2, var3, var4, var5, var6, gcpro) \ 2282#define GCPRO6(varname1, varname2, varname3, varname4, varname5, varname6) \
2294 {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ 2283 {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \
2295 gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ 2284 gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \
2296 gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ 2285 gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \
2297 gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ 2286 gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \
2298 gcpro##5 .next = &gcpro##4; gcpro##5 .var = &var5; gcpro##5 .nvars = 1; \ 2287 gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \
2299 gcpro##6 .next = &gcpro##5; gcpro##6 .var = &var6; gcpro##6 .nvars = 1; \ 2288 gcpro6.next = &gcpro5; gcpro6.var = &varname6; gcpro6.nvars = 1; \
2300 gcprolist = &gcpro##6; } 2289 gcprolist = &gcpro6; }
2301 2290
2302#define UNGCPRO_VAR(gcpro) (gcprolist = gcpro##1 .next) 2291#define UNGCPRO (gcprolist = gcpro1.next)
2303 2292
2304#else 2293#else
2305 2294
2306extern int gcpro_level; 2295extern int gcpro_level;
2307 2296
2308#define GCPRO1_VAR(var1, gcpro) \ 2297#define GCPRO1(varname) \
2309 {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ 2298 {gcpro1.next = gcprolist; gcpro1.var = &varname; gcpro1.nvars = 1; \
2310 gcpro##1 .level = gcpro_level++; \ 2299 gcpro1.level = gcpro_level++; \
2311 gcprolist = &gcpro##1; } 2300 gcprolist = &gcpro1; }
2312 2301
2313#define GCPRO2_VAR(var1, var2, gcpro) \ 2302#define GCPRO2(varname1, varname2) \
2314 {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ 2303 {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \
2315 gcpro##1 .level = gcpro_level; \ 2304 gcpro1.level = gcpro_level; \
2316 gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ 2305 gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \
2317 gcpro##2 .level = gcpro_level++; \ 2306 gcpro2.level = gcpro_level++; \
2318 gcprolist = &gcpro##2; } 2307 gcprolist = &gcpro2; }
2319 2308
2320#define GCPRO3_VAR(var1, var2, var3, gcpro) \ 2309#define GCPRO3(varname1, varname2, varname3) \
2321 {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ 2310 {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \
2322 gcpro##1 .level = gcpro_level; \ 2311 gcpro1.level = gcpro_level; \
2323 gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ 2312 gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \
2324 gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ 2313 gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \
2325 gcpro##3 .level = gcpro_level++; \ 2314 gcpro3.level = gcpro_level++; \
2326 gcprolist = &gcpro##3; } 2315 gcprolist = &gcpro3; }
2327 2316
2328#define GCPRO4_VAR(var1, var2, var3, var4, gcpro) \ 2317#define GCPRO4(varname1, varname2, varname3, varname4) \
2329 {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ 2318 {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \
2330 gcpro##1 .level = gcpro_level; \ 2319 gcpro1.level = gcpro_level; \
2331 gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ 2320 gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \
2332 gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ 2321 gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \
2333 gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ 2322 gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \
2334 gcpro##4 .level = gcpro_level++; \ 2323 gcpro4.level = gcpro_level++; \
2335 gcprolist = &gcpro##4; } 2324 gcprolist = &gcpro4; }
2336 2325
2337#define GCPRO5_VAR(var1, var2, var3, var4, var5, gcpro) \ 2326#define GCPRO5(varname1, varname2, varname3, varname4, varname5) \
2338 {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ 2327 {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \
2339 gcpro##1 .level = gcpro_level; \ 2328 gcpro1.level = gcpro_level; \
2340 gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ 2329 gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \
2341 gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ 2330 gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \
2342 gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ 2331 gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \
2343 gcpro##5 .next = &gcpro##4; gcpro##5 .var = &var5; gcpro##5 .nvars = 1; \ 2332 gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \
2344 gcpro##5 .level = gcpro_level++; \ 2333 gcpro5.level = gcpro_level++; \
2345 gcprolist = &gcpro##5; } 2334 gcprolist = &gcpro5; }
2346 2335
2347#define GCPRO6_VAR(var1, var2, var3, var4, var5, var6, gcpro) \ 2336#define GCPRO6(varname1, varname2, varname3, varname4, varname5, varname6) \
2348 {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ 2337 {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \
2349 gcpro##1 .level = gcpro_level; \ 2338 gcpro1.level = gcpro_level; \
2350 gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ 2339 gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \
2351 gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ 2340 gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \
2352 gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ 2341 gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \
2353 gcpro##5 .next = &gcpro##4; gcpro##5 .var = &var5; gcpro##5 .nvars = 1; \ 2342 gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \
2354 gcpro##6 .next = &gcpro##5; gcpro##6 .var = &var6; gcpro##6 .nvars = 1; \ 2343 gcpro6.next = &gcpro5; gcpro6.var = &varname6; gcpro6.nvars = 1; \
2355 gcpro##6 .level = gcpro_level++; \ 2344 gcpro6.level = gcpro_level++; \
2356 gcprolist = &gcpro##6; } 2345 gcprolist = &gcpro6; }
2357 2346
2358#define UNGCPRO_VAR(gcpro) \ 2347#define UNGCPRO \
2359 ((--gcpro_level != gcpro##1 .level) \ 2348 ((--gcpro_level != gcpro1.level) \
2360 ? (abort (), 0) \ 2349 ? (abort (), 0) \
2361 : ((gcprolist = gcpro##1 .next), 0)) 2350 : ((gcprolist = gcpro1.next), 0))
2362 2351
2363#endif /* DEBUG_GCPRO */ 2352#endif /* DEBUG_GCPRO */
2364#endif /* GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS */ 2353#endif /* GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS */
diff --git a/src/lread.c b/src/lread.c
index f1f6f0cbd78..cdbd09d2f89 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1917,7 +1917,7 @@ which is the input stream for reading characters.
1917This function does not move point. */) 1917This function does not move point. */)
1918 (Lisp_Object start, Lisp_Object end, Lisp_Object printflag, Lisp_Object read_function) 1918 (Lisp_Object start, Lisp_Object end, Lisp_Object printflag, Lisp_Object read_function)
1919{ 1919{
1920 /* FIXME: Do the eval-sexp-add-defvars danse! */ 1920 /* FIXME: Do the eval-sexp-add-defvars dance! */
1921 int count = SPECPDL_INDEX (); 1921 int count = SPECPDL_INDEX ();
1922 Lisp_Object tem, cbuf; 1922 Lisp_Object tem, cbuf;
1923 1923
diff --git a/src/msdos.c b/src/msdos.c
index 4c08c5b29e0..64e9d72c784 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -1558,7 +1558,7 @@ IT_set_terminal_window (struct frame *f, int foo)
1558{ 1558{
1559} 1559}
1560 1560
1561/* Remember the screen colors of the curent frame, to serve as the 1561/* Remember the screen colors of the current frame, to serve as the
1562 default colors for newly-created frames. */ 1562 default colors for newly-created frames. */
1563DEFUN ("msdos-remember-default-colors", Fmsdos_remember_default_colors, 1563DEFUN ("msdos-remember-default-colors", Fmsdos_remember_default_colors,
1564 Smsdos_remember_default_colors, 1, 1, 0, 1564 Smsdos_remember_default_colors, 1, 1, 0,
diff --git a/src/nsgui.h b/src/nsgui.h
index 5cc2eee3230..99c64cd4cde 100644
--- a/src/nsgui.h
+++ b/src/nsgui.h
@@ -65,7 +65,7 @@ typedef struct _XCharStruct
65 int descent; 65 int descent;
66} XCharStruct; 66} XCharStruct;
67 67
68/* Fake tructure from Xlib.h to represent two-byte characters. */ 68/* Fake structure from Xlib.h to represent two-byte characters. */
69#ifndef __OBJC__ 69#ifndef __OBJC__
70typedef unsigned short unichar; 70typedef unsigned short unichar;
71#endif 71#endif
@@ -202,4 +202,3 @@ typedef struct _NSRect { NSPoint origin; NSSize size; } NSRect;
202#define PWinGravity (1L << 9) /* program specified window gravity */ 202#define PWinGravity (1L << 9) /* program specified window gravity */
203 203
204#endif /* __NSGUI_H__ */ 204#endif /* __NSGUI_H__ */
205
diff --git a/src/nsterm.m b/src/nsterm.m
index c5b28d57ac5..5e19a397c34 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -559,7 +559,7 @@ ns_constrain_all_frames (void)
559 { 559 {
560 NSView *view = FRAME_NS_VIEW (f); 560 NSView *view = FRAME_NS_VIEW (f);
561 /* This no-op will trigger the default window placing 561 /* This no-op will trigger the default window placing
562 * constriant system. */ 562 * constraint system. */
563 f->output_data.ns->dont_constrain = 0; 563 f->output_data.ns->dont_constrain = 0;
564 [[view window] setFrameOrigin:[[view window] frame].origin]; 564 [[view window] setFrameOrigin:[[view window] frame].origin];
565 } 565 }
@@ -3075,7 +3075,7 @@ ns_dumpglyphs_image (struct glyph_string *s, NSRect r)
3075 3075
3076 /* If there is no mask, the background won't be seen, 3076 /* If there is no mask, the background won't be seen,
3077 so draw a rectangle on the image for the cursor. 3077 so draw a rectangle on the image for the cursor.
3078 Do this for all images, getting trancparency right is not reliable. */ 3078 Do this for all images, getting transparency right is not reliable. */
3079 if (s->hl == DRAW_CURSOR) 3079 if (s->hl == DRAW_CURSOR)
3080 { 3080 {
3081 int thickness = abs (s->img->relief); 3081 int thickness = abs (s->img->relief);
diff --git a/src/process.c b/src/process.c
index a02ba44ae71..05c4be27550 100644
--- a/src/process.c
+++ b/src/process.c
@@ -3474,7 +3474,7 @@ usage: (make-network-process &rest ARGS) */)
3474 3474
3475 { 3475 {
3476 /* Setup coding systems for communicating with the network stream. */ 3476 /* Setup coding systems for communicating with the network stream. */
3477 struct gcpro inner_gcpro1; 3477 struct gcpro gcpro1;
3478 /* Qt denotes we have not yet called Ffind_operation_coding_system. */ 3478 /* Qt denotes we have not yet called Ffind_operation_coding_system. */
3479 Lisp_Object coding_systems = Qt; 3479 Lisp_Object coding_systems = Qt;
3480 Lisp_Object fargs[5], val; 3480 Lisp_Object fargs[5], val;
@@ -3502,9 +3502,9 @@ usage: (make-network-process &rest ARGS) */)
3502 { 3502 {
3503 fargs[0] = Qopen_network_stream, fargs[1] = name, 3503 fargs[0] = Qopen_network_stream, fargs[1] = name,
3504 fargs[2] = buffer, fargs[3] = host, fargs[4] = service; 3504 fargs[2] = buffer, fargs[3] = host, fargs[4] = service;
3505 GCPRO1_VAR (proc, inner_gcpro); 3505 GCPRO1 (proc);
3506 coding_systems = Ffind_operation_coding_system (5, fargs); 3506 coding_systems = Ffind_operation_coding_system (5, fargs);
3507 UNGCPRO_VAR (inner_gcpro); 3507 UNGCPRO;
3508 } 3508 }
3509 if (CONSP (coding_systems)) 3509 if (CONSP (coding_systems))
3510 val = XCAR (coding_systems); 3510 val = XCAR (coding_systems);
@@ -3535,9 +3535,9 @@ usage: (make-network-process &rest ARGS) */)
3535 { 3535 {
3536 fargs[0] = Qopen_network_stream, fargs[1] = name, 3536 fargs[0] = Qopen_network_stream, fargs[1] = name,
3537 fargs[2] = buffer, fargs[3] = host, fargs[4] = service; 3537 fargs[2] = buffer, fargs[3] = host, fargs[4] = service;
3538 GCPRO1_VAR (proc, inner_gcpro); 3538 GCPRO1 (proc);
3539 coding_systems = Ffind_operation_coding_system (5, fargs); 3539 coding_systems = Ffind_operation_coding_system (5, fargs);
3540 UNGCPRO_VAR (inner_gcpro); 3540 UNGCPRO;
3541 } 3541 }
3542 } 3542 }
3543 if (CONSP (coding_systems)) 3543 if (CONSP (coding_systems))
@@ -3717,7 +3717,7 @@ DEFUN ("network-interface-info", Fnetwork_interface_info, Snetwork_interface_inf
3717 doc: /* Return information about network interface named IFNAME. 3717 doc: /* Return information about network interface named IFNAME.
3718The return value is a list (ADDR BCAST NETMASK HWADDR FLAGS), 3718The return value is a list (ADDR BCAST NETMASK HWADDR FLAGS),
3719where ADDR is the layer 3 address, BCAST is the layer 3 broadcast address, 3719where ADDR is the layer 3 address, BCAST is the layer 3 broadcast address,
3720NETMASK is the layer 3 network mask, HWADDR is the layer 2 addres, and 3720NETMASK is the layer 3 network mask, HWADDR is the layer 2 address, and
3721FLAGS is the current flags of the interface. */) 3721FLAGS is the current flags of the interface. */)
3722 (Lisp_Object ifname) 3722 (Lisp_Object ifname)
3723{ 3723{
@@ -4630,26 +4630,29 @@ wait_reading_process_output (int time_limit, int microsecs, int read_kbd,
4630 the gnutls library -- 2.12.14 has been confirmed 4630 the gnutls library -- 2.12.14 has been confirmed
4631 to need it. See 4631 to need it. See
4632 http://comments.gmane.org/gmane.emacs.devel/145074 */ 4632 http://comments.gmane.org/gmane.emacs.devel/145074 */
4633 struct Lisp_Process *proc;
4634 for (channel = 0; channel < MAXDESC; ++channel) 4633 for (channel = 0; channel < MAXDESC; ++channel)
4635 { 4634 if (! NILP (chan_process[channel]))
4636 if (! NILP (chan_process[channel]) && 4635 {
4637 (proc = XPROCESS (chan_process[channel])) != NULL && 4636 struct Lisp_Process *p =
4638 proc->gnutls_p && 4637 XPROCESS (chan_process[channel]);
4639 proc->infd && 4638 if (p && p->gnutls_p && p->infd
4640 emacs_gnutls_record_check_pending (proc->gnutls_state) > 0) 4639 && ((emacs_gnutls_record_check_pending
4641 { 4640 (p->gnutls_state))
4642 nfds++; 4641 > 0))
4643 FD_SET (proc->infd, &Available); 4642 {
4644 } 4643 nfds++;
4645 } 4644 FD_SET (p->infd, &Available);
4645 }
4646 }
4646 } 4647 }
4647 else 4648 else
4648 { 4649 {
4649 /* Check this specific channel. */ 4650 /* Check this specific channel. */
4650 if (wait_proc->gnutls_p && /* Check for valid process. */ 4651 if (wait_proc->gnutls_p /* Check for valid process. */
4651 /* Do we have pending data? */ 4652 /* Do we have pending data? */
4652 emacs_gnutls_record_check_pending (wait_proc->gnutls_state) > 0) 4653 && ((emacs_gnutls_record_check_pending
4654 (wait_proc->gnutls_state))
4655 > 0))
4653 { 4656 {
4654 nfds = 1; 4657 nfds = 1;
4655 /* Set to Available. */ 4658 /* Set to Available. */
diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h
index fb0882860d1..cc19765aba6 100644
--- a/src/s/ms-w32.h
+++ b/src/s/ms-w32.h
@@ -267,6 +267,8 @@ struct sigaction {
267#define getpid _getpid 267#define getpid _getpid
268#ifdef _MSC_VER 268#ifdef _MSC_VER
269typedef int pid_t; 269typedef int pid_t;
270#define snprintf _snprintf
271#define strtoll _strtoi64
270#endif 272#endif
271#define isatty _isatty 273#define isatty _isatty
272#define logb _logb 274#define logb _logb
@@ -275,15 +277,17 @@ typedef int pid_t;
275#define popen _popen 277#define popen _popen
276#define pclose _pclose 278#define pclose _pclose
277#define umask _umask 279#define umask _umask
280#ifndef _MSC_VER
278#define utimbuf _utimbuf 281#define utimbuf _utimbuf
282#endif
279#define strdup _strdup 283#define strdup _strdup
280#define strupr _strupr 284#define strupr _strupr
281#define strnicmp _strnicmp 285#define strnicmp _strnicmp
282#define stricmp _stricmp 286#define stricmp _stricmp
283#define tzset _tzset 287#define tzset _tzset
284 288
285#if !defined (_MSC_VER) || (_MSC_VER < 1400)
286#define tzname _tzname 289#define tzname _tzname
290#if !defined (_MSC_VER) || (_MSC_VER < 1400)
287#undef utime 291#undef utime
288#define utime _utime 292#define utime _utime
289#endif 293#endif
@@ -335,7 +339,7 @@ extern char *get_emacs_configuration_options (void);
335#define _WINSOCK_H 339#define _WINSOCK_H
336 340
337/* Defines size_t and alloca (). */ 341/* Defines size_t and alloca (). */
338#if (defined(_MSC_VER) && defined(emacs)) || defined(USE_CRT_DLL) 342#ifdef emacs
339#define malloc e_malloc 343#define malloc e_malloc
340#define free e_free 344#define free e_free
341#define realloc e_realloc 345#define realloc e_realloc
diff --git a/src/search.c b/src/search.c
index a6a0fddb137..811ac74e194 100644
--- a/src/search.c
+++ b/src/search.c
@@ -83,11 +83,10 @@ static struct re_registers search_regs;
83 Qnil if no searching has been done yet. */ 83 Qnil if no searching has been done yet. */
84static Lisp_Object last_thing_searched; 84static Lisp_Object last_thing_searched;
85 85
86/* error condition signaled when regexp compile_pattern fails */ 86/* Error condition signaled when regexp compile_pattern fails. */
87
88static Lisp_Object Qinvalid_regexp; 87static Lisp_Object Qinvalid_regexp;
89 88
90/* Error condition used for failing searches */ 89/* Error condition used for failing searches. */
91static Lisp_Object Qsearch_failed; 90static Lisp_Object Qsearch_failed;
92 91
93static void set_search_regs (EMACS_INT, EMACS_INT); 92static void set_search_regs (EMACS_INT, EMACS_INT);
@@ -2078,13 +2077,16 @@ set_search_regs (EMACS_INT beg_byte, EMACS_INT nbytes)
2078 XSETBUFFER (last_thing_searched, current_buffer); 2077 XSETBUFFER (last_thing_searched, current_buffer);
2079} 2078}
2080 2079
2081/* Given STRING, a string of words separated by word delimiters, 2080DEFUN ("word-search-regexp", Fword_search_regexp, Sword_search_regexp, 1, 2, 0,
2082 compute a regexp that matches those exact words separated by 2081 doc: /* Return a regexp which matches words, ignoring punctuation.
2083 arbitrary punctuation. If LAX is nonzero, the end of the string 2082Given STRING, a string of words separated by word delimiters,
2084 need not match a word boundary unless it ends in whitespace. */ 2083compute a regexp that matches those exact words separated by
2085 2084arbitrary punctuation. If LAX is non-nil, the end of the string
2086static Lisp_Object 2085need not match a word boundary unless it ends in whitespace.
2087wordify (Lisp_Object string, int lax) 2086
2087Used in `word-search-forward', `word-search-backward',
2088`word-search-forward-lax', `word-search-backward-lax'. */)
2089 (Lisp_Object string, Lisp_Object lax)
2088{ 2090{
2089 register unsigned char *o; 2091 register unsigned char *o;
2090 register EMACS_INT i, i_byte, len, punct_count = 0, word_count = 0; 2092 register EMACS_INT i, i_byte, len, punct_count = 0, word_count = 0;
@@ -2125,7 +2127,7 @@ wordify (Lisp_Object string, int lax)
2125 } 2127 }
2126 2128
2127 adjust = - punct_count + 5 * (word_count - 1) 2129 adjust = - punct_count + 5 * (word_count - 1)
2128 + ((lax && !whitespace_at_end) ? 2 : 4); 2130 + ((!NILP (lax) && !whitespace_at_end) ? 2 : 4);
2129 if (STRING_MULTIBYTE (string)) 2131 if (STRING_MULTIBYTE (string))
2130 val = make_uninit_multibyte_string (len + adjust, 2132 val = make_uninit_multibyte_string (len + adjust,
2131 SBYTES (string) 2133 SBYTES (string)
@@ -2162,7 +2164,7 @@ wordify (Lisp_Object string, int lax)
2162 prev_c = c; 2164 prev_c = c;
2163 } 2165 }
2164 2166
2165 if (!lax || whitespace_at_end) 2167 if (NILP (lax) || whitespace_at_end)
2166 { 2168 {
2167 *o++ = '\\'; 2169 *o++ = '\\';
2168 *o++ = 'b'; 2170 *o++ = 'b';
@@ -2217,10 +2219,14 @@ An optional second argument bounds the search; it is a buffer position.
2217The match found must not extend before that position. 2219The match found must not extend before that position.
2218Optional third argument, if t, means if fail just return nil (no error). 2220Optional third argument, if t, means if fail just return nil (no error).
2219 If not nil and not t, move to limit of search and return nil. 2221 If not nil and not t, move to limit of search and return nil.
2220Optional fourth argument is repeat count--search for successive occurrences. */) 2222Optional fourth argument is repeat count--search for successive occurrences.
2223
2224Relies on the function `word-search-regexp' to convert a sequence
2225of words in STRING to a regexp used to search words without regard
2226to punctuation. */)
2221 (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count) 2227 (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count)
2222{ 2228{
2223 return search_command (wordify (string, 0), bound, noerror, count, -1, 1, 0); 2229 return search_command (Fword_search_regexp (string, Qnil), bound, noerror, count, -1, 1, 0);
2224} 2230}
2225 2231
2226DEFUN ("word-search-forward", Fword_search_forward, Sword_search_forward, 1, 4, 2232DEFUN ("word-search-forward", Fword_search_forward, Sword_search_forward, 1, 4,
@@ -2231,10 +2237,14 @@ An optional second argument bounds the search; it is a buffer position.
2231The match found must not extend after that position. 2237The match found must not extend after that position.
2232Optional third argument, if t, means if fail just return nil (no error). 2238Optional third argument, if t, means if fail just return nil (no error).
2233 If not nil and not t, move to limit of search and return nil. 2239 If not nil and not t, move to limit of search and return nil.
2234Optional fourth argument is repeat count--search for successive occurrences. */) 2240Optional fourth argument is repeat count--search for successive occurrences.
2241
2242Relies on the function `word-search-regexp' to convert a sequence
2243of words in STRING to a regexp used to search words without regard
2244to punctuation. */)
2235 (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count) 2245 (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count)
2236{ 2246{
2237 return search_command (wordify (string, 0), bound, noerror, count, 1, 1, 0); 2247 return search_command (Fword_search_regexp (string, Qnil), bound, noerror, count, 1, 1, 0);
2238} 2248}
2239 2249
2240DEFUN ("word-search-backward-lax", Fword_search_backward_lax, Sword_search_backward_lax, 1, 4, 2250DEFUN ("word-search-backward-lax", Fword_search_backward_lax, Sword_search_backward_lax, 1, 4,
@@ -2249,10 +2259,14 @@ An optional second argument bounds the search; it is a buffer position.
2249The match found must not extend before that position. 2259The match found must not extend before that position.
2250Optional third argument, if t, means if fail just return nil (no error). 2260Optional third argument, if t, means if fail just return nil (no error).
2251 If not nil and not t, move to limit of search and return nil. 2261 If not nil and not t, move to limit of search and return nil.
2252Optional fourth argument is repeat count--search for successive occurrences. */) 2262Optional fourth argument is repeat count--search for successive occurrences.
2263
2264Relies on the function `word-search-regexp' to convert a sequence
2265of words in STRING to a regexp used to search words without regard
2266to punctuation. */)
2253 (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count) 2267 (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count)
2254{ 2268{
2255 return search_command (wordify (string, 1), bound, noerror, count, -1, 1, 0); 2269 return search_command (Fword_search_regexp (string, Qt), bound, noerror, count, -1, 1, 0);
2256} 2270}
2257 2271
2258DEFUN ("word-search-forward-lax", Fword_search_forward_lax, Sword_search_forward_lax, 1, 4, 2272DEFUN ("word-search-forward-lax", Fword_search_forward_lax, Sword_search_forward_lax, 1, 4,
@@ -2267,10 +2281,14 @@ An optional second argument bounds the search; it is a buffer position.
2267The match found must not extend after that position. 2281The match found must not extend after that position.
2268Optional third argument, if t, means if fail just return nil (no error). 2282Optional third argument, if t, means if fail just return nil (no error).
2269 If not nil and not t, move to limit of search and return nil. 2283 If not nil and not t, move to limit of search and return nil.
2270Optional fourth argument is repeat count--search for successive occurrences. */) 2284Optional fourth argument is repeat count--search for successive occurrences.
2285
2286Relies on the function `word-search-regexp' to convert a sequence
2287of words in STRING to a regexp used to search words without regard
2288to punctuation. */)
2271 (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count) 2289 (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count)
2272{ 2290{
2273 return search_command (wordify (string, 1), bound, noerror, count, 1, 1, 0); 2291 return search_command (Fword_search_regexp (string, Qt), bound, noerror, count, 1, 1, 0);
2274} 2292}
2275 2293
2276DEFUN ("re-search-backward", Fre_search_backward, Sre_search_backward, 1, 4, 2294DEFUN ("re-search-backward", Fre_search_backward, Sre_search_backward, 1, 4,
@@ -3132,7 +3150,7 @@ record_unwind_save_match_data (void)
3132 Fmatch_data (Qnil, Qnil, Qnil)); 3150 Fmatch_data (Qnil, Qnil, Qnil));
3133} 3151}
3134 3152
3135/* Quote a string to inactivate reg-expr chars */ 3153/* Quote a string to deactivate reg-expr chars */
3136 3154
3137DEFUN ("regexp-quote", Fregexp_quote, Sregexp_quote, 1, 1, 0, 3155DEFUN ("regexp-quote", Fregexp_quote, Sregexp_quote, 1, 1, 0,
3138 doc: /* Return a regexp string which matches exactly STRING and nothing else. */) 3156 doc: /* Return a regexp string which matches exactly STRING and nothing else. */)
@@ -3229,6 +3247,7 @@ is to bind it with `let' around a small expression. */);
3229 defsubr (&Sposix_string_match); 3247 defsubr (&Sposix_string_match);
3230 defsubr (&Ssearch_forward); 3248 defsubr (&Ssearch_forward);
3231 defsubr (&Ssearch_backward); 3249 defsubr (&Ssearch_backward);
3250 defsubr (&Sword_search_regexp);
3232 defsubr (&Sword_search_forward); 3251 defsubr (&Sword_search_forward);
3233 defsubr (&Sword_search_backward); 3252 defsubr (&Sword_search_backward);
3234 defsubr (&Sword_search_forward_lax); 3253 defsubr (&Sword_search_forward_lax);
diff --git a/src/term.c b/src/term.c
index 4a671d048c4..ae505f020f2 100644
--- a/src/term.c
+++ b/src/term.c
@@ -3236,7 +3236,7 @@ use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
3236 MultiLeft (tty) = tgetstr ("LE", address); 3236 MultiLeft (tty) = tgetstr ("LE", address);
3237 MultiRight (tty) = tgetstr ("RI", address); 3237 MultiRight (tty) = tgetstr ("RI", address);
3238 3238
3239 /* SVr4/ANSI color suppert. If "op" isn't available, don't support 3239 /* SVr4/ANSI color support. If "op" isn't available, don't support
3240 color because we can't switch back to the default foreground and 3240 color because we can't switch back to the default foreground and
3241 background. */ 3241 background. */
3242 tty->TS_orig_pair = tgetstr ("op", address); 3242 tty->TS_orig_pair = tgetstr ("op", address);
diff --git a/src/w32fns.c b/src/w32fns.c
index 434861320a5..7a17c108d4d 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -3711,7 +3711,7 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
3711 if (w32_system_caret_hwnd == NULL) 3711 if (w32_system_caret_hwnd == NULL)
3712 { 3712 {
3713 /* Use the default caret width, and avoid changing it 3713 /* Use the default caret width, and avoid changing it
3714 unneccesarily, as it confuses screen reader software. */ 3714 unnecessarily, as it confuses screen reader software. */
3715 w32_system_caret_hwnd = hwnd; 3715 w32_system_caret_hwnd = hwnd;
3716 CreateCaret (hwnd, NULL, 0, 3716 CreateCaret (hwnd, NULL, 0,
3717 w32_system_caret_height); 3717 w32_system_caret_height);
@@ -5011,7 +5011,8 @@ no value of TYPE (always string in the MS Windows case). */)
5011 cursor. Duplicated from xdisp.c, but cannot use the version there 5011 cursor. Duplicated from xdisp.c, but cannot use the version there
5012 due to lack of atimers on w32. */ 5012 due to lack of atimers on w32. */
5013#define DEFAULT_HOURGLASS_DELAY 1 5013#define DEFAULT_HOURGLASS_DELAY 1
5014/* Return non-zero if houglass timer has been started or hourglass is shown. */ 5014/* Return non-zero if hourglass timer has been started or hourglass is
5015 shown. */
5015/* PENDING: if W32 can use atimers (atimer.[hc]) then the common impl in 5016/* PENDING: if W32 can use atimers (atimer.[hc]) then the common impl in
5016 xdisp.c could be used. */ 5017 xdisp.c could be used. */
5017 5018
diff --git a/src/w32term.h b/src/w32term.h
index 02392133837..6c73daba601 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -209,7 +209,7 @@ extern int x_display_pixel_width (struct w32_display_info *);
209 the information that is specific to W32 windows. */ 209 the information that is specific to W32 windows. */
210 210
211/* Put some things in x_output for compatibility. 211/* Put some things in x_output for compatibility.
212 NTEMACS_TODO: Move all common things here to eliminate unneccesary 212 NTEMACS_TODO: Move all common things here to eliminate unnecessary
213 diffs between X and w32 code. */ 213 diffs between X and w32 code. */
214struct x_output 214struct x_output
215{ 215{
diff --git a/src/widget.c b/src/widget.c
index 0582718948d..96bfd4787e9 100644
--- a/src/widget.c
+++ b/src/widget.c
@@ -476,6 +476,9 @@ update_wm_hints (EmacsFrame ew)
476 int base_height; 476 int base_height;
477 int min_rows = 0, min_cols = 0; 477 int min_rows = 0, min_cols = 0;
478 478
479 /* This happens when the frame is just created. */
480 if (! wmshell) return;
481
479#if 0 482#if 0
480 check_frame_size (ew->emacs_frame.frame, &min_rows, &min_cols); 483 check_frame_size (ew->emacs_frame.frame, &min_rows, &min_cols);
481#endif 484#endif
@@ -506,6 +509,14 @@ update_wm_hints (EmacsFrame ew)
506 NULL); 509 NULL);
507} 510}
508 511
512void
513widget_update_wm_size_hints (Widget widget)
514{
515 EmacsFrame ew = (EmacsFrame)widget;
516 update_wm_hints (ew);
517}
518
519
509#if 0 520#if 0
510 521
511static void 522static void
@@ -808,7 +819,7 @@ EmacsFrameQueryGeometry (Widget widget, XtWidgetGeometry *request, XtWidgetGeome
808 return result->request_mode ? XtGeometryAlmost : XtGeometryYes; 819 return result->request_mode ? XtGeometryAlmost : XtGeometryYes;
809} 820}
810 821
811/* Special entrypoints */ 822/* Special entry points */
812void 823void
813EmacsFrameSetCharSize (Widget widget, int columns, int rows) 824EmacsFrameSetCharSize (Widget widget, int columns, int rows)
814{ 825{
diff --git a/src/widget.h b/src/widget.h
index f64f188e158..11041d54ad0 100644
--- a/src/widget.h
+++ b/src/widget.h
@@ -92,9 +92,9 @@ extern WidgetClass emacsFrameClass;
92 92
93extern struct _DisplayContext* display_context; 93extern struct _DisplayContext* display_context;
94 94
95/* Special entrypoints */ 95/* Special entry points */
96void EmacsFrameSetCharSize (Widget, int, int); 96void EmacsFrameSetCharSize (Widget, int, int);
97void widget_store_internal_border (Widget widget); 97void widget_store_internal_border (Widget widget);
98void widget_update_wm_size_hints (Widget widget);
98 99
99#endif /* _EmacsFrame_h */ 100#endif /* _EmacsFrame_h */
100
diff --git a/src/window.c b/src/window.c
index 728e811f304..86fcca25f2e 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1054,6 +1054,7 @@ window_relative_x_coord (struct window *w, enum window_part part, int x)
1054DEFUN ("coordinates-in-window-p", Fcoordinates_in_window_p, 1054DEFUN ("coordinates-in-window-p", Fcoordinates_in_window_p,
1055 Scoordinates_in_window_p, 2, 2, 0, 1055 Scoordinates_in_window_p, 2, 2, 0,
1056 doc: /* Return non-nil if COORDINATES are in WINDOW. 1056 doc: /* Return non-nil if COORDINATES are in WINDOW.
1057WINDOW must be a live window.
1057COORDINATES is a cons of the form (X . Y), X and Y being distances 1058COORDINATES is a cons of the form (X . Y), X and Y being distances
1058measured in characters from the upper-left corner of the frame. 1059measured in characters from the upper-left corner of the frame.
1059\(0 . 0) denotes the character in the upper left corner of the 1060\(0 . 0) denotes the character in the upper left corner of the
@@ -1075,7 +1076,7 @@ If they are in the windows's left or right marginal areas, `left-margin'\n\
1075 int x, y; 1076 int x, y;
1076 Lisp_Object lx, ly; 1077 Lisp_Object lx, ly;
1077 1078
1078 CHECK_WINDOW (window); 1079 CHECK_LIVE_WINDOW (window);
1079 w = XWINDOW (window); 1080 w = XWINDOW (window);
1080 f = XFRAME (w->frame); 1081 f = XFRAME (w->frame);
1081 CHECK_CONS (coordinates); 1082 CHECK_CONS (coordinates);
@@ -3089,7 +3090,7 @@ This function runs `window-scroll-functions' before running
3089 error ("Window is dedicated to `%s'", SDATA (BVAR (XBUFFER (tem), name))); 3090 error ("Window is dedicated to `%s'", SDATA (BVAR (XBUFFER (tem), name)));
3090 else 3091 else
3091 /* WINDOW is weakly dedicated to its buffer, reset 3092 /* WINDOW is weakly dedicated to its buffer, reset
3092 dedicatedness. */ 3093 dedication. */
3093 w->dedicated = Qnil; 3094 w->dedicated = Qnil;
3094 3095
3095 call1 (Qrecord_window_buffer, window); 3096 call1 (Qrecord_window_buffer, window);
@@ -6303,7 +6304,7 @@ freeze_window_starts (struct frame *f, int freeze_p)
6303 ignore_positions non-zero means ignore non-matching scroll positions 6304 ignore_positions non-zero means ignore non-matching scroll positions
6304 and the like. 6305 and the like.
6305 6306
6306 This ignores a couple of things like the dedicatedness status of 6307 This ignores a couple of things like the dedication status of
6307 window, combination_limit and the like. This might have to be 6308 window, combination_limit and the like. This might have to be
6308 fixed. */ 6309 fixed. */
6309 6310
diff --git a/src/xdisp.c b/src/xdisp.c
index 7c415e485b5..530373a4436 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -2851,8 +2851,14 @@ start_display (struct it *it, struct window *w, struct text_pos pos)
2851 || (new_x == it->last_visible_x 2851 || (new_x == it->last_visible_x
2852 && FRAME_WINDOW_P (it->f)))) 2852 && FRAME_WINDOW_P (it->f))))
2853 { 2853 {
2854 if (it->current.dpvec_index >= 0 2854 if ((it->current.dpvec_index >= 0
2855 || it->current.overlay_string_index >= 0) 2855 || it->current.overlay_string_index >= 0)
2856 /* If we are on a newline from a display vector or
2857 overlay string, then we are already at the end of
2858 a screen line; no need to go to the next line in
2859 that case, as this line is not really continued.
2860 (If we do go to the next line, C-e will not DTRT.) */
2861 && it->c != '\n')
2856 { 2862 {
2857 set_iterator_to_next (it, 1); 2863 set_iterator_to_next (it, 1);
2858 move_it_in_display_line_to (it, -1, -1, 0); 2864 move_it_in_display_line_to (it, -1, -1, 0);
@@ -3171,13 +3177,11 @@ compute_stop_pos (struct it *it)
3171 Lisp_Object object, limit, position; 3177 Lisp_Object object, limit, position;
3172 EMACS_INT charpos, bytepos; 3178 EMACS_INT charpos, bytepos;
3173 3179
3174 /* If nowhere else, stop at the end. */
3175 it->stop_charpos = it->end_charpos;
3176
3177 if (STRINGP (it->string)) 3180 if (STRINGP (it->string))
3178 { 3181 {
3179 /* Strings are usually short, so don't limit the search for 3182 /* Strings are usually short, so don't limit the search for
3180 properties. */ 3183 properties. */
3184 it->stop_charpos = it->end_charpos;
3181 object = it->string; 3185 object = it->string;
3182 limit = Qnil; 3186 limit = Qnil;
3183 charpos = IT_STRING_CHARPOS (*it); 3187 charpos = IT_STRING_CHARPOS (*it);
@@ -3187,6 +3191,12 @@ compute_stop_pos (struct it *it)
3187 { 3191 {
3188 EMACS_INT pos; 3192 EMACS_INT pos;
3189 3193
3194 /* If end_charpos is out of range for some reason, such as a
3195 misbehaving display function, rationalize it (Bug#5984). */
3196 if (it->end_charpos > ZV)
3197 it->end_charpos = ZV;
3198 it->stop_charpos = it->end_charpos;
3199
3190 /* If next overlay change is in front of the current stop pos 3200 /* If next overlay change is in front of the current stop pos
3191 (which is IT->end_charpos), stop there. Note: value of 3201 (which is IT->end_charpos), stop there. Note: value of
3192 next_overlay_change is point-max if no overlay change 3202 next_overlay_change is point-max if no overlay change
@@ -4088,26 +4098,37 @@ handle_invisible_prop (struct it *it)
4088 if (it->bidi_p && newpos < ZV) 4098 if (it->bidi_p && newpos < ZV)
4089 { 4099 {
4090 EMACS_INT bpos = CHAR_TO_BYTE (newpos); 4100 EMACS_INT bpos = CHAR_TO_BYTE (newpos);
4091 4101 int on_newline = FETCH_BYTE (bpos) == '\n';
4092 if (FETCH_BYTE (bpos) == '\n' 4102 int after_newline =
4093 || (newpos > BEGV && FETCH_BYTE (bpos - 1) == '\n')) 4103 newpos <= BEGV || FETCH_BYTE (bpos - 1) == '\n';
4104
4105 /* If the invisible text ends on a newline or on a
4106 character after a newline, we can avoid the costly,
4107 character by character, bidi iteration to NEWPOS, and
4108 instead simply reseat the iterator there. That's
4109 because all bidi reordering information is tossed at
4110 the newline. This is a big win for modes that hide
4111 complete lines, like Outline, Org, etc. */
4112 if (on_newline || after_newline)
4094 { 4113 {
4095 /* If the invisible text ends on a newline or the
4096 character after a newline, we can avoid the
4097 costly, character by character, bidi iteration to
4098 newpos, and instead simply reseat the iterator
4099 there. That's because all bidi reordering
4100 information is tossed at the newline. This is a
4101 big win for modes that hide complete lines, like
4102 Outline, Org, etc. (Implementation note: the
4103 call to reseat_1 is necessary, because it signals
4104 to the bidi iterator that it needs to reinit its
4105 internal information when the next element for
4106 display is requested. */
4107 struct text_pos tpos; 4114 struct text_pos tpos;
4115 bidi_dir_t pdir = it->bidi_it.paragraph_dir;
4108 4116
4109 SET_TEXT_POS (tpos, newpos, bpos); 4117 SET_TEXT_POS (tpos, newpos, bpos);
4110 reseat_1 (it, tpos, 0); 4118 reseat_1 (it, tpos, 0);
4119 /* If we reseat on a newline, we need to prep the
4120 bidi iterator for advancing to the next character
4121 after the newline, keeping the current paragraph
4122 direction (so that PRODUCE_GLYPHS does TRT wrt
4123 prepending/appending glyphs to a glyph row). */
4124 if (on_newline)
4125 {
4126 it->bidi_it.first_elt = 0;
4127 it->bidi_it.paragraph_dir = pdir;
4128 it->bidi_it.ch = '\n';
4129 it->bidi_it.nchars = 1;
4130 it->bidi_it.ch_len = 1;
4131 }
4111 } 4132 }
4112 else /* Must use the slow method. */ 4133 else /* Must use the slow method. */
4113 { 4134 {
@@ -4116,11 +4137,11 @@ handle_invisible_prop (struct it *it)
4116 non-base embedding level. Therefore, we need to 4137 non-base embedding level. Therefore, we need to
4117 skip invisible text using the bidi iterator, 4138 skip invisible text using the bidi iterator,
4118 starting at IT's current position, until we find 4139 starting at IT's current position, until we find
4119 ourselves outside the invisible text. Skipping 4140 ourselves outside of the invisible text.
4120 invisible text _after_ bidi iteration avoids 4141 Skipping invisible text _after_ bidi iteration
4121 affecting the visual order of the displayed text 4142 avoids affecting the visual order of the
4122 when invisible properties are added or 4143 displayed text when invisible properties are
4123 removed. */ 4144 added or removed. */
4124 if (it->bidi_it.first_elt && it->bidi_it.charpos < ZV) 4145 if (it->bidi_it.first_elt && it->bidi_it.charpos < ZV)
4125 { 4146 {
4126 /* If we were `reseat'ed to a new paragraph, 4147 /* If we were `reseat'ed to a new paragraph,
@@ -15614,8 +15635,8 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15614 ? min (scroll_margin, WINDOW_TOTAL_LINES (w) / 4) 15635 ? min (scroll_margin, WINDOW_TOTAL_LINES (w) / 4)
15615 : 0; 15636 : 0;
15616 EMACS_INT margin_pos = CHARPOS (startp); 15637 EMACS_INT margin_pos = CHARPOS (startp);
15617 int scrolling_up;
15618 Lisp_Object aggressive; 15638 Lisp_Object aggressive;
15639 int scrolling_up;
15619 15640
15620 /* If there is a scroll margin at the top of the window, find 15641 /* If there is a scroll margin at the top of the window, find
15621 its character position. */ 15642 its character position. */
@@ -15657,7 +15678,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15657 pt_offset = float_amount * WINDOW_BOX_TEXT_HEIGHT (w); 15678 pt_offset = float_amount * WINDOW_BOX_TEXT_HEIGHT (w);
15658 if (pt_offset == 0 && float_amount > 0) 15679 if (pt_offset == 0 && float_amount > 0)
15659 pt_offset = 1; 15680 pt_offset = 1;
15660 if (pt_offset) 15681 if (pt_offset && margin > 0)
15661 margin -= 1; 15682 margin -= 1;
15662 } 15683 }
15663 /* Compute how much to move the window start backward from 15684 /* Compute how much to move the window start backward from
@@ -15777,6 +15798,25 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15777 goto recenter; 15798 goto recenter;
15778 } 15799 }
15779 15800
15801 /* Users who set scroll-conservatively to a large number want
15802 point just above/below the scroll margin. If we ended up
15803 with point's row partially visible, move the window start to
15804 make that row fully visible and out of the margin. */
15805 if (scroll_conservatively > SCROLL_LIMIT)
15806 {
15807 int margin =
15808 scroll_margin > 0
15809 ? min (scroll_margin, WINDOW_TOTAL_LINES (w) / 4)
15810 : 0;
15811 int move_down = w->cursor.vpos >= WINDOW_TOTAL_LINES (w) / 2;
15812
15813 move_it_by_lines (&it, move_down ? margin + 1 : -(margin + 1));
15814 clear_glyph_matrix (w->desired_matrix);
15815 if (1 == try_window (window, it.current.pos,
15816 TRY_WINDOW_CHECK_MARGINS))
15817 goto done;
15818 }
15819
15780 /* If centering point failed to make the whole line visible, 15820 /* If centering point failed to make the whole line visible,
15781 put point at the top instead. That has to make the whole line 15821 put point at the top instead. That has to make the whole line
15782 visible, if it can be done. */ 15822 visible, if it can be done. */
@@ -28871,7 +28911,8 @@ init_xdisp (void)
28871 28911
28872/* Platform-independent portion of hourglass implementation. */ 28912/* Platform-independent portion of hourglass implementation. */
28873 28913
28874/* Return non-zero if houglass timer has been started or hourglass is shown. */ 28914/* Return non-zero if hourglass timer has been started or hourglass is
28915 shown. */
28875int 28916int
28876hourglass_started (void) 28917hourglass_started (void)
28877{ 28918{
diff --git a/src/xfaces.c b/src/xfaces.c
index 849ad6bbdf4..7e3ce4103d9 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -66,7 +66,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
66 attributes (1st thru 5th) are updated from the spec. 66 attributes (1st thru 5th) are updated from the spec.
67 67
68 On the other hand, if one of the other font-related attributes are 68 On the other hand, if one of the other font-related attributes are
69 specified, the correspoinding specs in this attribute is set to nil. 69 specified, the corresponding specs in this attribute is set to nil.
70 70
71 15. A face name or list of face names from which to inherit attributes. 71 15. A face name or list of face names from which to inherit attributes.
72 72
@@ -1223,7 +1223,7 @@ face_color_gray_p (struct frame *f, const char *color_name)
1223 int gray_p; 1223 int gray_p;
1224 1224
1225 if (defined_color (f, color_name, &color, 0)) 1225 if (defined_color (f, color_name, &color, 0))
1226 gray_p = (/* Any color sufficiently close to black counts as grey. */ 1226 gray_p = (/* Any color sufficiently close to black counts as gray. */
1227 (color.red < 5000 && color.green < 5000 && color.blue < 5000) 1227 (color.red < 5000 && color.green < 5000 && color.blue < 5000)
1228 || 1228 ||
1229 ((eabs (color.red - color.green) 1229 ((eabs (color.red - color.green)
diff --git a/src/xfns.c b/src/xfns.c
index c68149cce11..323b272e9f0 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -3166,7 +3166,7 @@ This function is an internal primitive--use `make-frame' instead. */)
3166 to get the color reference counts right, so initialize them! */ 3166 to get the color reference counts right, so initialize them! */
3167 { 3167 {
3168 Lisp_Object black; 3168 Lisp_Object black;
3169 struct gcpro inner_gcpro1; 3169 struct gcpro gcpro1;
3170 3170
3171 /* Function x_decode_color can signal an error. Make 3171 /* Function x_decode_color can signal an error. Make
3172 sure to initialize color slots so that we won't try 3172 sure to initialize color slots so that we won't try
@@ -3179,7 +3179,7 @@ This function is an internal primitive--use `make-frame' instead. */)
3179 f->output_data.x->mouse_pixel = -1; 3179 f->output_data.x->mouse_pixel = -1;
3180 3180
3181 black = build_string ("black"); 3181 black = build_string ("black");
3182 GCPRO1_VAR (black, inner_gcpro); 3182 GCPRO1 (black);
3183 FRAME_FOREGROUND_PIXEL (f) 3183 FRAME_FOREGROUND_PIXEL (f)
3184 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); 3184 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
3185 FRAME_BACKGROUND_PIXEL (f) 3185 FRAME_BACKGROUND_PIXEL (f)
@@ -3192,7 +3192,7 @@ This function is an internal primitive--use `make-frame' instead. */)
3192 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); 3192 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
3193 f->output_data.x->mouse_pixel 3193 f->output_data.x->mouse_pixel
3194 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); 3194 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
3195 UNGCPRO_VAR (inner_gcpro); 3195 UNGCPRO;
3196 } 3196 }
3197 3197
3198 /* Specify the parent under which to make this X window. */ 3198 /* Specify the parent under which to make this X window. */
@@ -4620,7 +4620,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
4620 to get the color reference counts right, so initialize them! */ 4620 to get the color reference counts right, so initialize them! */
4621 { 4621 {
4622 Lisp_Object black; 4622 Lisp_Object black;
4623 struct gcpro inner_gcpro1; 4623 struct gcpro gcpro1;
4624 4624
4625 /* Function x_decode_color can signal an error. Make 4625 /* Function x_decode_color can signal an error. Make
4626 sure to initialize color slots so that we won't try 4626 sure to initialize color slots so that we won't try
@@ -4633,7 +4633,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
4633 f->output_data.x->mouse_pixel = -1; 4633 f->output_data.x->mouse_pixel = -1;
4634 4634
4635 black = build_string ("black"); 4635 black = build_string ("black");
4636 GCPRO1_VAR (black, inner_gcpro); 4636 GCPRO1 (black);
4637 FRAME_FOREGROUND_PIXEL (f) 4637 FRAME_FOREGROUND_PIXEL (f)
4638 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); 4638 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
4639 FRAME_BACKGROUND_PIXEL (f) 4639 FRAME_BACKGROUND_PIXEL (f)
@@ -4646,7 +4646,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
4646 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); 4646 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
4647 f->output_data.x->mouse_pixel 4647 f->output_data.x->mouse_pixel
4648 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); 4648 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
4649 UNGCPRO_VAR (inner_gcpro); 4649 UNGCPRO;
4650 } 4650 }
4651 4651
4652 /* Set the name; the functions to which we pass f expect the name to 4652 /* Set the name; the functions to which we pass f expect the name to
diff --git a/src/xterm.c b/src/xterm.c
index f750c00cea0..8171fe7738e 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -6123,7 +6123,8 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6123 last_user_time = event.xproperty.time; 6123 last_user_time = event.xproperty.time;
6124 f = x_top_window_to_frame (dpyinfo, event.xproperty.window); 6124 f = x_top_window_to_frame (dpyinfo, event.xproperty.window);
6125 if (f && event.xproperty.atom == dpyinfo->Xatom_net_wm_state) 6125 if (f && event.xproperty.atom == dpyinfo->Xatom_net_wm_state)
6126 if (x_handle_net_wm_state (f, &event.xproperty) && f->iconified) 6126 if (x_handle_net_wm_state (f, &event.xproperty) && f->iconified
6127 && f->output_data.x->net_wm_state_hidden_seen)
6127 { 6128 {
6128 /* Gnome shell does not iconify us when C-z is pressed. It hides 6129 /* Gnome shell does not iconify us when C-z is pressed. It hides
6129 the frame. So if our state says we aren't hidden anymore, 6130 the frame. So if our state says we aren't hidden anymore,
@@ -6133,6 +6134,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6133 f->async_visible = 1; 6134 f->async_visible = 1;
6134 f->async_iconified = 0; 6135 f->async_iconified = 0;
6135 f->output_data.x->has_been_visible = 1; 6136 f->output_data.x->has_been_visible = 1;
6137 f->output_data.x->net_wm_state_hidden_seen = 0;
6136 inev.ie.kind = DEICONIFY_EVENT; 6138 inev.ie.kind = DEICONIFY_EVENT;
6137 XSETFRAME (inev.ie.frame_or_window, f); 6139 XSETFRAME (inev.ie.frame_or_window, f);
6138 } 6140 }
@@ -8494,7 +8496,10 @@ get_current_wm_state (struct frame *f,
8494 { 8496 {
8495 Atom a = ((Atom*)tmp_data)[i]; 8497 Atom a = ((Atom*)tmp_data)[i];
8496 if (a == dpyinfo->Xatom_net_wm_state_hidden) 8498 if (a == dpyinfo->Xatom_net_wm_state_hidden)
8497 is_hidden = 1; 8499 {
8500 is_hidden = 1;
8501 f->output_data.x->net_wm_state_hidden_seen = 1;
8502 }
8498 else if (a == dpyinfo->Xatom_net_wm_state_maximized_horz) 8503 else if (a == dpyinfo->Xatom_net_wm_state_maximized_horz)
8499 { 8504 {
8500 if (*size_state == FULLSCREEN_HEIGHT) 8505 if (*size_state == FULLSCREEN_HEIGHT)
@@ -9570,6 +9575,14 @@ x_wm_set_size_hint (struct frame *f, long flags, int user_position)
9570 XSizeHints size_hints; 9575 XSizeHints size_hints;
9571 Window window = FRAME_OUTER_WINDOW (f); 9576 Window window = FRAME_OUTER_WINDOW (f);
9572 9577
9578#ifdef USE_X_TOOLKIT
9579 if (f->output_data.x->widget)
9580 {
9581 widget_update_wm_size_hints (f->output_data.x->widget);
9582 return;
9583 }
9584#endif
9585
9573 /* Setting PMaxSize caused various problems. */ 9586 /* Setting PMaxSize caused various problems. */
9574 size_hints.flags = PResizeInc | PMinSize /* | PMaxSize */; 9587 size_hints.flags = PResizeInc | PMinSize /* | PMaxSize */;
9575 9588
diff --git a/src/xterm.h b/src/xterm.h
index 1d2ce9a2d3c..4385b1a467d 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -632,6 +632,9 @@ struct x_output
632 x_check_expected_move. */ 632 x_check_expected_move. */
633 int left_before_move; 633 int left_before_move;
634 int top_before_move; 634 int top_before_move;
635
636 /* Non-zero if _NET_WM_STATE_HIDDEN is set for this frame. */
637 int net_wm_state_hidden_seen;
635}; 638};
636 639
637#define No_Cursor (None) 640#define No_Cursor (None)