aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog369
-rw-r--r--src/ChangeLog.15
-rw-r--r--src/ChangeLog.1011
-rw-r--r--src/ChangeLog.1114
-rw-r--r--src/ChangeLog.23
-rw-r--r--src/ChangeLog.314
-rw-r--r--src/ChangeLog.44
-rw-r--r--src/ChangeLog.62
-rw-r--r--src/ChangeLog.712
-rw-r--r--src/ChangeLog.88
-rw-r--r--src/ChangeLog.94
-rw-r--r--src/alloc.c11
-rw-r--r--src/buffer.c2
-rw-r--r--src/bytecode.c2
-rw-r--r--src/callproc.c4
-rw-r--r--src/ccl.c8
-rw-r--r--src/character.c4
-rw-r--r--src/charset.c4
-rw-r--r--src/charset.h6
-rw-r--r--src/chartab.c4
-rw-r--r--src/coding.c2
-rw-r--r--src/coding.h2
-rw-r--r--src/composite.c2
-rw-r--r--src/composite.h2
-rw-r--r--src/data.c2
-rw-r--r--src/dired.c2
-rw-r--r--src/dispextern.h5
-rw-r--r--src/dispnew.c45
-rw-r--r--src/doprnt.c2
-rw-r--r--src/emacs.c2
-rw-r--r--src/font.c8
-rw-r--r--src/font.h2
-rw-r--r--src/fontset.c6
-rw-r--r--src/frame.c13
-rw-r--r--src/frame.h2
-rw-r--r--src/gtkutil.c18
-rw-r--r--src/image.c10
-rw-r--r--src/indent.c2
-rw-r--r--src/insdel.c2
-rw-r--r--src/intervals.c58
-rw-r--r--src/intervals.h68
-rw-r--r--src/keyboard.c18
-rw-r--r--src/keymap.c6
-rw-r--r--src/lisp.h60
-rw-r--r--src/makefile.w32-in13
-rw-r--r--src/nsfns.m210
-rw-r--r--src/nsterm.h2
-rw-r--r--src/nsterm.m25
-rw-r--r--src/process.c7
-rw-r--r--src/ralloc.c16
-rw-r--r--src/regex.c6
-rw-r--r--src/regex.h2
-rw-r--r--src/s/gnu.h2
-rw-r--r--src/s/hpux10-20.h2
-rw-r--r--src/s/ms-w32.h24
-rw-r--r--src/s/msdos.h3
-rw-r--r--src/sound.c2
-rw-r--r--src/syssignal.h2
-rw-r--r--src/unexelf.c2
-rw-r--r--src/w32.c14
-rw-r--r--src/w32fns.c31
-rw-r--r--src/w32font.c41
-rw-r--r--src/w32font.h5
-rw-r--r--src/w32menu.c2
-rw-r--r--src/w32proc.c8
-rw-r--r--src/w32term.c18
-rw-r--r--src/w32term.h2
-rw-r--r--src/w32uniscribe.c3
-rw-r--r--src/window.c471
-rw-r--r--src/window.h11
-rw-r--r--src/xdisp.c105
-rw-r--r--src/xfaces.c6
-rw-r--r--src/xfns.c40
-rw-r--r--src/xfont.c6
-rw-r--r--src/xmenu.c31
-rw-r--r--src/xselect.c2
-rw-r--r--src/xsettings.c2
-rw-r--r--src/xsmfns.c2
-rw-r--r--src/xterm.c2
-rw-r--r--src/xterm.h2
80 files changed, 1243 insertions, 709 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index eb71bfc62ed..4cec277fb36 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,4 +1,4 @@
12011-11-02 Paul Eggert <eggert@cs.ucla.edu> 12011-11-18 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 Fix integer width and related bugs (Bug#9874). 3 Fix integer width and related bugs (Bug#9874).
4 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp): 4 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
@@ -786,6 +786,364 @@
786 rather than rolling our own approximation. 786 rather than rolling our own approximation.
787 (SCROLL_BAR_VEC_SIZE): Remove; not used. 787 (SCROLL_BAR_VEC_SIZE): Remove; not used.
788 788
7892011-11-18 Paul Eggert <eggert@cs.ucla.edu>
790
791 Fix minor problems found by static checking.
792 * dispextern.h, xdisp.c (row_hash): Declare extern only if XASSERTS.
793 * dispnew.c (verify_row_hash): Now static.
794
7952011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
796
797 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
798
7992011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
800
801 * intervals.c: Fix grafting over the whole buffer (bug#10071).
802 (graft_intervals_into_buffer): Simplify.
803
8042011-11-18 Eli Zaretskii <eliz@gnu.org>
805
806 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
807 hash values of the two rows.
808 (copy_row_except_pointers): Preserve the used[] arrays and the
809 hash values of the two rows. (Bug#10035)
810 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
811
812 * xdisp.c (row_hash): New function, body extracted from
813 compute_line_metrics.
814 (compute_line_metrics): Call row_hash, instead of computing the
815 hash code inline.
816
817 * dispnew.c (verify_row_hash): Call row_hash for computing the
818 hash code of a row, instead of duplicating code from xdisp.c.
819
820 * dispextern.h (row_hash): Add prototype.
821
8222011-11-18 Tassilo Horn <tassilo@member.fsf.org>
823
824 * frame.c (delete_frame): Don't delete the terminal when the last
825 X frame is closed if emacs is built with GTK toolkit.
826
8272011-11-17 Juanma Barranquero <lekktu@gmail.com>
828
829 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
830
8312011-11-17 Martin Rudalics <rudalics@gmx.at>
832
833 * window.c (Vwindow_splits): Rename to
834 Vwindow_combination_resize. Suggested by Juri Linkov.
835 (Fsplit_window_internal): Use Vwindow_combination_resize instead
836 of Vwindow_splits.
837
8382011-11-16 Juanma Barranquero <lekktu@gmail.com>
839
840 * nsfns.m (Fns_font_name):
841 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
842
8432011-11-16 Martin Rudalics <rudalics@gmx.at>
844
845 * window.h (window): Rename slot "nest" to "combination_limit".
846 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
847 (Fset_window_nest): Rename to Fset_window_combination_limit.
848 (Vwindow_nest): Rename to Vwindow_combination_limit.
849 (recombine_windows, make_parent_window, make_window)
850 (Fsplit_window_internal, saved_window)
851 (Fset_window_configuration, save_window_save): Rename all
852 occurrences of window_nest to window_combination_limit.
853
8542011-11-15 Juanma Barranquero <lekktu@gmail.com>
855
856 * image.c (imagemagick_load_image): Fix typo.
857
8582011-11-14 Eli Zaretskii <eliz@gnu.org>
859
860 * xdisp.c (display_line): Move the call to
861 highlight_trailing_whitespace before the call to
862 compute_line_metrics, since the latter needs to see the final
863 faces of all the glyphs to compute ROW's hash value. Fixes
864 assertion violations in row_equal_p. (Bug#10035)
865
8662011-11-14 Juanma Barranquero <lekktu@gmail.com>
867
868 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
869 just return (bug#10044).
870
8712011-11-12 Eli Zaretskii <eliz@gnu.org>
872
873 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
874 with user-defined heap size. Bump the default size of the temacs
875 heap to 27MB, to avoid memory warning when running temacs.
876 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
877
878 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
879 current_matrix and desired_matrix. (Bug#9990)
880 (verify_row_hash) [XASSERTS]: New function.
881 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
882 that the hash value of glyph rows is correct.
883
8842011-11-12 Martin Rudalics <rudalics@gmx.at>
885
886 * window.h (window): Remove splits slot.
887 * window.c (Fwindow_splits, Fset_window_splits): Remove.
888 (Fdelete_other_windows_internal, make_parent_window)
889 (make_window, Fsplit_window_internal, Fdelete_window_internal)
890 (Fset_window_configuration, save_window_save): Don't deal with
891 split status of windows.
892 (saved_window): Remove splits slot.
893 (Vwindow_splits): Rewrite doc-string.
894
8952011-11-11 Jan Djärv <jan.h.d@swipnet.se>
896
897 * xfns.c (unwind_create_frame):
898 * nsfns.m (unwind_create_frame):
899 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
900 Vframe_list (Bug#9999).
901
9022011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
903
904 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
905
9062011-11-11 Kenichi Handa <handa@m17n.org>
907
908 * callproc.c (Fcall_process): Set the member dst_multibyte of
909 process_coding.
910
9112011-11-11 Johan Bockgård <bojohan@gnu.org>
912
913 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
914 avoid a crash (bug#9496).
915
9162011-11-09 Chong Yidong <cyd@gnu.org>
917
918 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
919 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
920
9212011-11-08 Paul Eggert <eggert@cs.ucla.edu>
922
923 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
924
9252011-11-08 Paul Eggert <eggert@cs.ucla.edu>
926
927 Avoid some portability problems by eschewing 'extern inline' functions.
928 The trivial performance wins aren't worth the portability hassles; see
929 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
930 et seq.
931 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
932 (window_box_width, window_box_left, window_box_left_offset)
933 (window_box_right, window_box_right_offset): Undo previous change,
934 by removing the "extern"s.
935 * intervals.c (adjust_intervals_for_insertion)
936 (adjust_intervals_for_deletion): Undo previous change,
937 making these static again.
938 (offset_intervals, temp_set_point_both, temp_set_point)
939 (copy_intervals_to_string): No longer inline.
940 * xdisp.c (window_text_bottom_y, window_box_width)
941 (window_box_height, window_box_left_offset)
942 (window_box_right_offset, window_box_left, window_box_right)
943 (window_box): No longer inline.
944
9452011-11-08 Chong Yidong <cyd@gnu.org>
946
947 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
948 (Fwindow_body_height, Fwindow_body_width): Move from Lisp. Signal
949 an error if not a live window.
950 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
951 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
952
9532011-11-07 Juanma Barranquero <lekktu@gmail.com>
954
955 * lisp.h (syms_of_abbrev): Remove declaration.
956 Reported by CHENG Gao <chenggao@royau.me>.
957
9582011-11-07 Eli Zaretskii <eliz@gnu.org>
959
960 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
961 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
962 of temacs in GUI mode.
963
9642011-11-07 Martin Rudalics <rudalics@gmx.at>
965
966 * window.h: Declare delete_all_child_windows instead of
967 delete_all_subwindows.
968 * window.c (Fwindow_nest, Fset_window_nest)
969 (Fset_window_new_total, Fset_window_new_normal)
970 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
971 (delete_all_subwindows): Rename to delete_all_child_windows.
972 (Fdelete_other_windows_internal, Fset_window_configuration):
973 Call delete_all_child_windows instead of delete_all_subwindows.
974 * frame.c (delete_frame): Call delete_all_child_windows instead
975 of delete_all_subwindows.
976
9772011-11-07 Paul Eggert <eggert@cs.ucla.edu>
978
979 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
980 This is also needed for porting to any host where GC_MARK_STACK is
981 not GC_MAKE_GCPROS_NOOPS.
982 (which_symbols): Use it.
983
9842011-11-07 Kenichi Handa <handa@m17n.org>
985
986 * coding.c (coding_set_destination): Check coding->src_pos only
987 when coding->src_object is a buffer (bug#9910).
988
989 * process.c (send_process): Set the member src_multibyte of coding
990 to 0 (bug#9911) when sending a unibyte text.
991
992 * callproc.c (Fcall_process): Set the member src_multibyte of
993 process_coding to 0 (bug#9912).
994
9952011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
996
997 * xmenu.c (cleanup_widget_value_tree): New function.
998 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
999 calling free_menubar_widget_value_tree directly (Bug#9830).
1000
10012011-11-06 Paul Eggert <eggert@cs.ucla.edu>
1002
1003 Fix some portability problems with 'inline'.
1004 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
1005 (window_box_width, window_box_left, window_box_left_offset)
1006 (window_box_right, window_box_right_offset): Declare extern.
1007 Otherwise, these inline functions do not conform to C99 and
1008 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
1009 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
1010 * intervals.c (adjust_intervals_for_insertion)
1011 (adjust_intervals_for_deletion): Now extern, because otherwise the
1012 extern inline functions 'offset_intervals' couldn't refer to it.
1013 (static_offset_intervals): Remove.
1014 (offset_intervals): Rewrite using the old contents of
1015 static_offset_intervals. The old version didn't conform to C99
1016 because an extern inline function contained a reference to an
1017 identifier with static linkage.
1018
10192011-11-06 Andreas Schwab <schwab@linux-m68k.org>
1020
1021 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
1022 GC.
1023
10242011-11-06 Eli Zaretskii <eliz@gnu.org>
1025
1026 * xdisp.c (init_iterator, reseat_to_string): Don't set the
1027 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
1028 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
1029 return Qleft_to_right.
1030
10312011-11-06 Chong Yidong <cyd@gnu.org>
1032
1033 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
1034 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
1035 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
1036 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
1037 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
1038 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
1039 (Fwindow_vscroll): Doc fix.
1040 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
1041 argument, since it makes no sense to pass a live window and for
1042 consistency with window-child.
1043
10442011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
1045
1046 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
1047 support MSVC.
1048
10492011-11-05 Jason Rumney <jasonr@gnu.org>
1050
1051 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
1052 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
1053 fonts (Bug#6029).
1054 (add_font_entity_to_list): Fix logic errors in mixed boolean and
1055 bitwise arithmetic preventing use of unicode-sip and non-truetype
1056 opentype fonts.
1057
10582011-11-05 Eli Zaretskii <eliz@gnu.org>
1059
1060 * s/ms-w32.h (fstat, stat, utime): Move redirections to
1061 "emacs"-only part.
1062
1063 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
1064 initialization code to keep similarity to xfns.c after changes
1065 from 2011-11-05.
1066
10672011-11-05 Jan Djärv <jan.h.d@swipnet.se>
1068
1069 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
1070 (unwind_create_frame): New function (Bug#9943).
1071 (Fx_create_frame): Restructure code to be more similar to the one in
1072 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
1073 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
1074 Move terminal->reference_count++ just before making the frame official
1075 (Bug#9943).
1076
1077 * nsterm.m (x_free_frame_resources): New function.
1078 (x_destroy_window): Move code to x_free_frame_resources.
1079
1080 * xfns.c (unwind_create_frame): Fix comment.
1081 (Fx_create_frame, x_create_tip_frame): Move
1082 terminal->reference_count++ just before making the frame
1083 official. Move initialization of image_cache_refcount and
1084 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
1085
10862011-11-05 Eli Zaretskii <eliz@gnu.org>
1087
1088 Support MSVC build with newer versions of Visual Studio.
1089 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
1090 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
1091 nt/gmake.defs.
1092
1093 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
1094 which are not supported by MSVC.
1095 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
1096 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
1097 bitfields.
1098 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
1099 types in bitfields.
1100 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
1101
1102 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
1103
11042011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
1105
1106 Support MSVC build with newer versions of Visual Studio.
1107 * w32.c: Don't include w32api.h for MSVC.
1108 (init_environment) [_MSC_VER]: Call sys_access, not _access.
1109
1110 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
1111 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
1112 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
1113 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
1114 e_* cousins.
1115 (alloca) [_MSC_VER]: Define to _alloca.
1116
1117 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
1118
1119 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
1120
11212011-11-04 Eli Zaretskii <eliz@gnu.org>
1122
1123 * xdisp.c (note_mouse_highlight): If either of
1124 previous/next-single-property-change returns nil, treat that as
1125 the beginning or the end of the buffer. (Bug#9955)
1126
11272011-11-04 Jan Djärv <jan.h.d@swipnet.se>
1128
1129 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
1130 label is not null (Bug#9951).
1131 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
1132 may be NULL.
1133
11342011-11-04 Eli Zaretskii <eliz@gnu.org>
1135
1136 * window.c (Fwindow_body_size): Mention in the doc string that the
1137 return value is in frame's canonical units. (Bug#9949)
1138
11392011-11-03 Eli Zaretskii <eliz@gnu.org>
1140
1141 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
1142
1143 * w32fns.c (unwind_create_frame): If needed, free the glyph
1144 matrices of the partially constructed frame. (Bug#9943)
1145 * xfns.c (unwind_create_frame): Likewise.
1146
7892011-11-01 Eli Zaretskii <eliz@gnu.org> 11472011-11-01 Eli Zaretskii <eliz@gnu.org>
790 1148
791 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment. 1149 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
@@ -805,7 +1163,7 @@
805 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented 1163 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
806 past the beginning of the current glyph matrix. 1164 past the beginning of the current glyph matrix.
807 1165
8082011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change) 11662011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
809 1167
810 * xterm.c: Include X11/Xproto.h if HAVE_GTK3. 1168 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
811 (x_error_handler): Ignore BadMatch for X_SetInputFocus for 1169 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
@@ -839,7 +1197,7 @@
839 1197
840 Fix the `xbytecode' command. 1198 Fix the `xbytecode' command.
841 * .gdbinit (xprintbytestr): New command. 1199 * .gdbinit (xprintbytestr): New command.
842 (xwhichsymbols): Renamed from `which'; all callers changed. 1200 (xwhichsymbols): Rename from `which'; all callers changed.
843 (xbytecode): Print the byte-code string as well. 1201 (xbytecode): Print the byte-code string as well.
844 1202
8452011-10-29 Kim Storm <storm@cua.dk> 12032011-10-29 Kim Storm <storm@cua.dk>
@@ -3511,6 +3869,9 @@
3511 3869
35122011-07-08 Jason Rumney <jasonr@gnu.org> 38702011-07-08 Jason Rumney <jasonr@gnu.org>
3513 3871
3872 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
3873 SH_SHOW for hidden windows (Bug#5482).
3874
3514 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using 3875 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
3515 frame struct members of non-existent frames (Bug#6284). 3876 frame struct members of non-existent frames (Bug#6284).
3516 3877
@@ -3530,7 +3891,7 @@
3530 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods 3891 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
3531 cString and lossyCString on OSX >= 10.4 3892 cString and lossyCString on OSX >= 10.4
3532 3893
3533 * nsmenu.m (fillWithWidgetValue): Don't use depercated method 3894 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
3534 sizeToFit on OSX >= 10.2. 3895 sizeToFit on OSX >= 10.2.
3535 3896
3536 * nsimage.m (allocInitFromFile): Don't use deprecated method 3897 * nsimage.m (allocInitFromFile): Don't use deprecated method
diff --git a/src/ChangeLog.1 b/src/ChangeLog.1
index e32db190cd0..efe77648458 100644
--- a/src/ChangeLog.1
+++ b/src/ChangeLog.1
@@ -405,7 +405,7 @@
405 Copy their own header field a_scovfrl from ohdr. 405 Copy their own header field a_scovfrl from ohdr.
406 406
407 * unexec.c [COFF]: 407 * unexec.c [COFF]:
408 Round positions of text and and data sections in output file 408 Round positions of text and data sections in output file
409 to page boundaries. 409 to page boundaries.
410 410
411 * crt0.c: Install version for Encore machines. 411 * crt0.c: Install version for Encore machines.
@@ -2375,7 +2375,7 @@
2375 Often, just return what it returned. 2375 Often, just return what it returned.
2376 `error' still never returns to its caller. 2376 `error' still never returns to its caller.
2377 2377
2378 * Signalling Qargs_out_of_range: 2378 * Signaling Qargs_out_of_range:
2379 Use new functions args_out_of_range and args_out_of_range_3 2379 Use new functions args_out_of_range and args_out_of_range_3
2380 (in data.c) to do this. 2380 (in data.c) to do this.
2381 2381
@@ -3537,4 +3537,3 @@
3537 3537
3538 You should have received a copy of the GNU General Public License 3538 You should have received a copy of the GNU General Public License
3539 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. 3539 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
3540
diff --git a/src/ChangeLog.10 b/src/ChangeLog.10
index 6152b4c76af..181b11b5a2b 100644
--- a/src/ChangeLog.10
+++ b/src/ChangeLog.10
@@ -5133,7 +5133,7 @@
5133 it can be called in a signal handler. 5133 it can be called in a signal handler.
5134 (x_catch_errors_unwind): Function deleted. 5134 (x_catch_errors_unwind): Function deleted.
5135 (x_uncatch_errors): Deallocate last x_error_message_stack struct. 5135 (x_uncatch_errors): Deallocate last x_error_message_stack struct.
5136 (x_check_errors): Call x_uncatch_errors before signalling error. 5136 (x_check_errors): Call x_uncatch_errors before signaling error.
5137 5137
5138 (x_load_font, x_term_init, XTmouse_position, handle_one_xevent) 5138 (x_load_font, x_term_init, XTmouse_position, handle_one_xevent)
5139 (x_connection_closed, x_list_fonts): Use new versions of 5139 (x_connection_closed, x_list_fonts): Use new versions of
@@ -19139,7 +19139,7 @@
19139 (font_rescale_ratio): New function. 19139 (font_rescale_ratio): New function.
19140 (split_font_name): If NUMERIC_P is nonzero, set font->rescale_ratio. 19140 (split_font_name): If NUMERIC_P is nonzero, set font->rescale_ratio.
19141 (better_font_p): On comparing point sized, pay attention to 19141 (better_font_p): On comparing point sized, pay attention to
19142 recale_ratio member of fonts. 19142 rescale_ratio member of fonts.
19143 (build_scalable_font_name): Reflect font->rescale_ratio in the 19143 (build_scalable_font_name): Reflect font->rescale_ratio in the
19144 font name. 19144 font name.
19145 (syms_of_xfaces): Declare Vface_font_rescale_alist as a Lisp variable. 19145 (syms_of_xfaces): Declare Vface_font_rescale_alist as a Lisp variable.
@@ -20702,11 +20702,11 @@
20702 (free_frame_menubar): Only compile if not USE_GTK. GTK version 20702 (free_frame_menubar): Only compile if not USE_GTK. GTK version
20703 is in gtkutil.c. 20703 is in gtkutil.c.
20704 (popup_selection_callback): New version for USE_GTK. 20704 (popup_selection_callback): New version for USE_GTK.
20705 (create_and_show_popup_menu): New fuction, one USE_GTK version and 20705 (create_and_show_popup_menu): New function, one USE_GTK version and
20706 one USE_X_TOOLKIT version. 20706 one USE_X_TOOLKIT version.
20707 (xmenu_show): Call create_and_show_popup_menu. 20707 (xmenu_show): Call create_and_show_popup_menu.
20708 (dialog_selection_callback): New version for USE_GTK. 20708 (dialog_selection_callback): New version for USE_GTK.
20709 (create_and_show_dialog): New fuction, one USE_GTK version and 20709 (create_and_show_dialog): New function, one USE_GTK version and
20710 one USE_X_TOOLKIT version. 20710 one USE_X_TOOLKIT version.
20711 (xdialog_show): Call create_and_show_dialog. 20711 (xdialog_show): Call create_and_show_dialog.
20712 20712
@@ -22780,7 +22780,7 @@
227802002-07-23 Kenichi Handa <handa@etl.go.jp> 227802002-07-23 Kenichi Handa <handa@etl.go.jp>
22781 22781
22782 * xdisp.c (face_before_or_after_it_pos): 22782 * xdisp.c (face_before_or_after_it_pos):
22783 Call FETCH_MULTIBYTE_CHAR with byte postion, not char position. 22783 Call FETCH_MULTIBYTE_CHAR with byte position, not char position.
22784 22784
227852002-07-22 Juanma Barranquero <lektu@terra.es> 227852002-07-22 Juanma Barranquero <lektu@terra.es>
22786 22786
@@ -27928,4 +27928,3 @@ See ChangeLog.9 for earlier changes.
27928 27928
27929 You should have received a copy of the GNU General Public License 27929 You should have received a copy of the GNU General Public License
27930 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. 27930 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
27931
diff --git a/src/ChangeLog.11 b/src/ChangeLog.11
index 0a9df7d1aee..73ac5fd4e00 100644
--- a/src/ChangeLog.11
+++ b/src/ChangeLog.11
@@ -7949,7 +7949,7 @@
79492010-05-11 Karel Klíč <kklic@redhat.com> 79492010-05-11 Karel Klíč <kklic@redhat.com>
7950 7950
7951 * ftfont.c: Fix incorrect parentheses of #if condition for 7951 * ftfont.c: Fix incorrect parentheses of #if condition for
7952 definining M17N_FLT_USE_NEW_FEATURE. 7952 defining M17N_FLT_USE_NEW_FEATURE.
7953 7953
79542010-05-11 Glenn Morris <rgm@gnu.org> 79542010-05-11 Glenn Morris <rgm@gnu.org>
7955 7955
@@ -11972,7 +11972,7 @@
11972 11972
11973 * image.c (xbm_read_bitmap_data): New arg inhibit_image_error. 11973 * image.c (xbm_read_bitmap_data): New arg inhibit_image_error.
11974 (xbm_load_image): Caller changed. 11974 (xbm_load_image): Caller changed.
11975 (xbm_file_p): Avoid signalling an image_error (Bug#4107). 11975 (xbm_file_p): Avoid signaling an image_error (Bug#4107).
11976 11976
119772009-08-13 Nick Roberts <nickrob@snap.net.nz> 119772009-08-13 Nick Roberts <nickrob@snap.net.nz>
11978 11978
@@ -16658,7 +16658,7 @@
166582008-08-20 Chong Yidong <cyd@stupidchicken.com> 166582008-08-20 Chong Yidong <cyd@stupidchicken.com>
16659 16659
16660 * xselect.c (x_get_foreign_selection): Return nil if desired 16660 * xselect.c (x_get_foreign_selection): Return nil if desired
16661 selection could not be obtained, instead of signalling an error. 16661 selection could not be obtained, instead of signaling an error.
16662 16662
166632008-08-20 David Reitter <david.reitter@gmail.com> 166632008-08-20 David Reitter <david.reitter@gmail.com>
16664 16664
@@ -23551,7 +23551,7 @@
23551 STORE_XCHARB a valid l-value. 23551 STORE_XCHARB a valid l-value.
23552 23552
23553 * w32term.c (w32_native_per_char_metric): Swap width and rbearing 23553 * w32term.c (w32_native_per_char_metric): Swap width and rbearing
23554 calculations for non-Truetype fonts. 23554 calculations for non-TrueType fonts.
23555 (x_draw_glyph_string): Sync with xterm.c. 23555 (x_draw_glyph_string): Sync with xterm.c.
23556 (x_draw_glyph_string_foreground) [USE_FONT_BACKEND]: 23556 (x_draw_glyph_string_foreground) [USE_FONT_BACKEND]:
23557 Remove redundant code. 23557 Remove redundant code.
@@ -25474,7 +25474,7 @@
25474 25474
25475 * term.c (terminal_encode_buffer): Make externally visible. 25475 * term.c (terminal_encode_buffer): Make externally visible.
25476 25476
25477 * makefile.w32-in: Add character.h dependancies. 25477 * makefile.w32-in: Add character.h dependencies.
25478 (character.o, chartab.o): New targets. 25478 (character.o, chartab.o): New targets.
25479 25479
254802008-02-01 Kenichi Handa <handa@m17n.org> 254802008-02-01 Kenichi Handa <handa@m17n.org>
@@ -26748,7 +26748,7 @@
267482008-02-01 Kenichi Handa <handa@m17n.org> 267482008-02-01 Kenichi Handa <handa@m17n.org>
26749 26749
26750 * xdisp.c (face_before_or_after_it_pos): 26750 * xdisp.c (face_before_or_after_it_pos):
26751 Call FETCH_MULTIBYTE_CHAR with byte postion, not char position. 26751 Call FETCH_MULTIBYTE_CHAR with byte position, not char position.
26752 26752
267532008-02-01 Kenichi Handa <handa@m17n.org> 267532008-02-01 Kenichi Handa <handa@m17n.org>
26754 26754
@@ -29718,7 +29718,7 @@
29718 * keyboard.c (restore_kboard_configuration): Only define when 29718 * keyboard.c (restore_kboard_configuration): Only define when
29719 MULTI_KBOARD defined. 29719 MULTI_KBOARD defined.
29720 29720
29721 * makefile.w32-in: Update dependancies from Makefile.in. 29721 * makefile.w32-in: Update dependencies from Makefile.in.
29722 (OBJ1): Add terminal.$(O) 29722 (OBJ1): Add terminal.$(O)
29723 29723
29724 * term.c (dissociate_if_controlling_tty) [WINDOWSNT]: 29724 * term.c (dissociate_if_controlling_tty) [WINDOWSNT]:
diff --git a/src/ChangeLog.2 b/src/ChangeLog.2
index ca7feaee9f5..05e448c043c 100644
--- a/src/ChangeLog.2
+++ b/src/ChangeLog.2
@@ -1222,7 +1222,7 @@
12221987-07-10 Chris Hanson (cph@prep) 12221987-07-10 Chris Hanson (cph@prep)
1223 1223
1224 * xterm.h: Define macros to abstract control of input signals. 1224 * xterm.h: Define macros to abstract control of input signals.
1225 Alternate set of macros for hp-ux does no signalling. 1225 Alternate set of macros for hp-ux does no signaling.
1226 1226
1227 * xterm.c: 1227 * xterm.c:
1228 * xfns.c: 1228 * xfns.c:
@@ -4787,4 +4787,3 @@ See ChangeLog.1 for earlier changes.
4787 4787
4788 You should have received a copy of the GNU General Public License 4788 You should have received a copy of the GNU General Public License
4789 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. 4789 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
4790
diff --git a/src/ChangeLog.3 b/src/ChangeLog.3
index beb7a0a2ae1..cdfe63fc59c 100644
--- a/src/ChangeLog.3
+++ b/src/ChangeLog.3
@@ -900,9 +900,9 @@
900 invalid overlay. 900 invalid overlay.
901 (syms_of_buffer): defsubr Soverlayp; initialize Qoverlayp. 901 (syms_of_buffer): defsubr Soverlayp; initialize Qoverlayp.
902 (Fdelete_overlay): Set the overlay's markers to point nowhere. 902 (Fdelete_overlay): Set the overlay's markers to point nowhere.
903 Use CHECK_OVERLAY instead of signalling a special error. 903 Use CHECK_OVERLAY instead of signaling a special error.
904 (Fmove_overlay, Foverlay_put): Use CHECK_OVERLAY instead of 904 (Fmove_overlay, Foverlay_put): Use CHECK_OVERLAY instead of
905 signalling a special error. 905 signaling a special error.
906 (Foverlay_get): Use CHECK_OVERLAY. 906 (Foverlay_get): Use CHECK_OVERLAY.
907 * fns.c (internal_equal): Define this for overlays. 907 * fns.c (internal_equal): Define this for overlays.
908 * buffer.h (OVERLAY_VALID): Define in terms of OVERLAYP. 908 * buffer.h (OVERLAY_VALID): Define in terms of OVERLAYP.
@@ -5549,7 +5549,7 @@
5549 h->poll_suppress_count. 5549 h->poll_suppress_count.
5550 5550
5551 * eval.c (Fsignal): It's okay for the debugger to return to the 5551 * eval.c (Fsignal): It's okay for the debugger to return to the
5552 caller if the caller was signalling a quit. 5552 caller if the caller was signaling a quit.
5553 5553
5554 * eval.c (unbind_catch): Restore the polling suppression count 5554 * eval.c (unbind_catch): Restore the polling suppression count
5555 here, instead of in Fsignal and Fthrow. 5555 here, instead of in Fsignal and Fthrow.
@@ -10592,7 +10592,7 @@
10592 (init_x_parm_symbols, x_set_screen_param): Use x_screen_parms 10592 (init_x_parm_symbols, x_set_screen_param): Use x_screen_parms
10593 instead of a large switch statement. 10593 instead of a large switch statement.
10594 (x_figure_window_size): Make the default case of the switch call 10594 (x_figure_window_size): Make the default case of the switch call
10595 abort instead of signalling an error, since window_prompting's 10595 abort instead of signaling an error, since window_prompting's
10596 value is internally generated. 10596 value is internally generated.
10597 10597
105981991-05-01 Jim Blandy (jimb@churchy.gnu.ai.mit.edu) 105981991-05-01 Jim Blandy (jimb@churchy.gnu.ai.mit.edu)
@@ -13393,7 +13393,7 @@
13393 13393
13394 * macros.c (Fstart_kbd_macro): Local cleanup. 13394 * macros.c (Fstart_kbd_macro): Local cleanup.
13395 13395
13396 * minibuf.c (read_minibuf): No more delcaration of 13396 * minibuf.c (read_minibuf): No more declaration of
13397 Frestore_screen_configuration. 13397 Frestore_screen_configuration.
13398 13398
13399 * search.c (Fregexp_quote): Simplified. 13399 * search.c (Fregexp_quote): Simplified.
@@ -14884,7 +14884,7 @@
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
14887 * fileio.c (barf_or_query_if_file_exists): When signalling, 14887 * fileio.c (barf_or_query_if_file_exists): When signaling,
14888 provide the expected args for a file-error. 14888 provide the expected args for a file-error.
14889 14889
148901989-08-06 Richard Stallman (rms@sugar-bombs.ai.mit.edu) 148901989-08-06 Richard Stallman (rms@sugar-bombs.ai.mit.edu)
@@ -15414,7 +15414,7 @@
15414 * xfns.c (Fx_create_screen): If user has specified 15414 * xfns.c (Fx_create_screen): If user has specified
15415 `x-iconic-startup' then start emacs in iconic form. 15415 `x-iconic-startup' then start emacs in iconic form.
15416 Look for icon position in `icon-left' and `icon-top', or use 15416 Look for icon position in `icon-left' and `icon-top', or use
15417 window postion. 15417 window position.
15418 15418
15419 * xterm.c (x_term_init): If server doesn't respond, use fatal 15419 * xterm.c (x_term_init): If server doesn't respond, use fatal
15420 instead of error. Also tell user about -d option. 15420 instead of error. Also tell user about -d option.
diff --git a/src/ChangeLog.4 b/src/ChangeLog.4
index dc8fe23a221..208d9c2cdb0 100644
--- a/src/ChangeLog.4
+++ b/src/ChangeLog.4
@@ -811,7 +811,7 @@
811 811
8121994-04-28 Michael D. Ernst (mernst@monozygote.research.microsoft.com) 8121994-04-28 Michael D. Ernst (mernst@monozygote.research.microsoft.com)
813 813
814 * fileio.c (inhibit-file-name-handers): Correct documentation. 814 * fileio.c (inhibit-file-name-handlers): Correct documentation.
815 815
8161994-04-28 Karl Heuer (kwzh@hal.gnu.ai.mit.edu) 8161994-04-28 Karl Heuer (kwzh@hal.gnu.ai.mit.edu)
817 817
@@ -1885,7 +1885,7 @@
18851994-03-22 Frederic Pierresteguy (fp@mole.gnu.ai.mit.edu) 18851994-03-22 Frederic Pierresteguy (fp@mole.gnu.ai.mit.edu)
1886 1886
1887 * widget.c (set_frame_size): Put #if 0 around a lot of useless code. 1887 * widget.c (set_frame_size): Put #if 0 around a lot of useless code.
1888 Compute explicitely the geometry of the toplevel widget. 1888 Compute explicitly the geometry of the toplevel widget.
1889 Call XtSetValues not XtVaSetValues. 1889 Call XtSetValues not XtVaSetValues.
1890 1890
18911994-03-22 Richard Stallman (rms@mole.gnu.ai.mit.edu) 18911994-03-22 Richard Stallman (rms@mole.gnu.ai.mit.edu)
diff --git a/src/ChangeLog.6 b/src/ChangeLog.6
index f9372aa666a..141a570040c 100644
--- a/src/ChangeLog.6
+++ b/src/ChangeLog.6
@@ -1138,7 +1138,7 @@
1138 ntproc.c and simplified to match other changes (all handles are 1138 ntproc.c and simplified to match other changes (all handles are
1139 already non-inheritable). 1139 already non-inheritable).
1140 1140
1141 (get_emacs_configuration): Detect Windows flavour (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
diff --git a/src/ChangeLog.7 b/src/ChangeLog.7
index d5bebec660f..73d0d45e9c1 100644
--- a/src/ChangeLog.7
+++ b/src/ChangeLog.7
@@ -592,7 +592,7 @@
592 592
593 * coding.h (Qemacs_mule): Extern it. 593 * coding.h (Qemacs_mule): Extern it.
594 594
595 * process.c (init_process): Initilize Vdefault_process_coding_system. 595 * process.c (init_process): Initialize Vdefault_process_coding_system.
596 596
5971998-06-26 Kenichi Handa <handa@etl.go.jp> 5971998-06-26 Kenichi Handa <handa@etl.go.jp>
598 598
@@ -972,7 +972,7 @@
972 972
9731998-06-01 Ken'ichi Handa <handa@melange.gnu.org> 9731998-06-01 Ken'ichi Handa <handa@melange.gnu.org>
974 974
975 * coding.c (detect_coding_mask): Initilize local variable C. 975 * coding.c (detect_coding_mask): Initialize local variable C.
976 976
9771998-06-01 Richard Stallman <rms@gnu.org> 9771998-06-01 Richard Stallman <rms@gnu.org>
978 978
@@ -5943,7 +5943,7 @@
5943 Vauto_file_coding_system. 5943 Vauto_file_coding_system.
5944 (syms_of_fileio): Adjusted for the above change. Doc change. 5944 (syms_of_fileio): Adjusted for the above change. Doc change.
5945 (Finsert_file_contents): The argument for Vset_auto_coding is a 5945 (Finsert_file_contents): The argument for Vset_auto_coding is a
5946 concatination of the heading 1K-byte and the tailing 3K-byte. 5946 concatenation of the heading 1K-byte and the tailing 3K-byte.
5947 5947
5948 * cmds.c (internal_self_insert): Only set TARGET_CLM when C2 is tab. 5948 * cmds.c (internal_self_insert): Only set TARGET_CLM when C2 is tab.
5949 When multibyte characters are disabled, 5949 When multibyte characters are disabled,
@@ -6317,7 +6317,7 @@
6317 (ENCODE_ISO_CHARACTER_DIMENSION2): Likewise. 6317 (ENCODE_ISO_CHARACTER_DIMENSION2): Likewise.
6318 (safe_terminal_coding): New variable. 6318 (safe_terminal_coding): New variable.
6319 (Fset_safe_terminal_coding_system_internal): New function. 6319 (Fset_safe_terminal_coding_system_internal): New function.
6320 (init_coding_once): Initilize safe_terminal_coding. 6320 (init_coding_once): Initialize safe_terminal_coding.
6321 (syms_of_coding): Declare set-safe-terminal-coding-system as a 6321 (syms_of_coding): Declare set-safe-terminal-coding-system as a
6322 Lisp function. 6322 Lisp function.
6323 6323
@@ -7399,7 +7399,7 @@
7399 7399
74001997-06-18 Kenichi Handa <handa@etl.go.jp> 74001997-06-18 Kenichi Handa <handa@etl.go.jp>
7401 7401
7402 * coding.c (detect_coding_iso2022): Initilize mask correctly. 7402 * coding.c (detect_coding_iso2022): Initialize mask correctly.
7403 7403
7404 * fns.c (concat): Pay attention to multibyte characters when 7404 * fns.c (concat): Pay attention to multibyte characters when
7405 TARGET_TYPE is Lisp_String. 7405 TARGET_TYPE is Lisp_String.
@@ -7485,7 +7485,7 @@
7485 7485
74861997-06-09 Kenichi Handa <handa@etl.go.jp> 74861997-06-09 Kenichi Handa <handa@etl.go.jp>
7487 7487
7488 * buffer.c (init_buffer_once): Inititialize the member 7488 * buffer.c (init_buffer_once): Initialize the member
7489 buffer_file_coding_system. 7489 buffer_file_coding_system.
7490 (syms_of_buffer): Declare Lisp variables 7490 (syms_of_buffer): Declare Lisp variables
7491 default-buffer-file-coding-system and buffer-file-coding-system. 7491 default-buffer-file-coding-system and buffer-file-coding-system.
diff --git a/src/ChangeLog.8 b/src/ChangeLog.8
index 833119c9fcf..00e4a1f62c8 100644
--- a/src/ChangeLog.8
+++ b/src/ChangeLog.8
@@ -919,7 +919,7 @@
9191999-11-28 Eli Zaretskii <eliz@is.elta.co.il> 9191999-11-28 Eli Zaretskii <eliz@is.elta.co.il>
920 920
921 * charset.c (Fmake_char_internal): Print the charset ID when 921 * charset.c (Fmake_char_internal): Print the charset ID when
922 signalling an error. 922 signaling an error.
923 923
924 * emacs.c (synchronize_locale): Avoid compiler warnings about 924 * emacs.c (synchronize_locale): Avoid compiler warnings about
925 pointer type mismatch. 925 pointer type mismatch.
@@ -2196,7 +2196,7 @@
2196 2196
21971999-09-14 Gerd Moellmann <gerd@gnu.org> 21971999-09-14 Gerd Moellmann <gerd@gnu.org>
2198 2198
2199 * sound.c (Fplay_sound): Remove usused variables. 2199 * sound.c (Fplay_sound): Remove unused variables.
2200 (be2hs): Put in #if 0 because it's currently not used. 2200 (be2hs): Put in #if 0 because it's currently not used.
2201 2201
22021999-09-14 Ken Raeburn <raeburn@gnu.org> 22021999-09-14 Ken Raeburn <raeburn@gnu.org>
@@ -7367,7 +7367,7 @@
7367 7367
7368 * xfaces.c (free_font): Removed. 7368 * xfaces.c (free_font): Removed.
7369 (load_face_font_or_fontset): Renamed from load_font. 7369 (load_face_font_or_fontset): Renamed from load_font.
7370 (load_face_font_or_fontset): Use message2 instead of signalling. 7370 (load_face_font_or_fontset): Use message2 instead of signaling.
7371 (load_color): Likewise. 7371 (load_color): Likewise.
7372 (load_pixmap): Likewise. 7372 (load_pixmap): Likewise.
7373 7373
@@ -13404,7 +13404,7 @@
13404 13404
134051998-10-20 Jason Rumney <jasonr@altavista.net> 134051998-10-20 Jason Rumney <jasonr@altavista.net>
13406 13406
13407 * makefile.nt (w32fns.c): Add x-list-font.c to dependancies. 13407 * makefile.nt (w32fns.c): Add x-list-font.c to dependencies.
13408 13408
13409 * w32faces.c: Update comments referring to obsolete structs. 13409 * w32faces.c: Update comments referring to obsolete structs.
13410 (allocate_face, copy_face, face_eql, load_font) 13410 (allocate_face, copy_face, face_eql, load_font)
diff --git a/src/ChangeLog.9 b/src/ChangeLog.9
index ceec5da3296..9e7bd24f792 100644
--- a/src/ChangeLog.9
+++ b/src/ChangeLog.9
@@ -4617,7 +4617,7 @@
4617 * lisp.h (detect_coding_system): Prototype adjusted. 4617 * lisp.h (detect_coding_system): Prototype adjusted.
4618 4618
4619 * coding.c (ONE_MORE_BYTE_CHECK_MULTIBYTE): New macro. 4619 * coding.c (ONE_MORE_BYTE_CHECK_MULTIBYTE): New macro.
4620 (detect_coding_emacs_mule, detect_coding_iso2022,) 4620 (detect_coding_emacs_mule, detect_coding_iso2022)
4621 (detect_coding_sjis, detect_coding_big5, detect_coding_utf_8) 4621 (detect_coding_sjis, detect_coding_big5, detect_coding_utf_8)
4622 (detect_coding_utf_16, detect_coding_ccl): Make them static. 4622 (detect_coding_utf_16, detect_coding_ccl): Make them static.
4623 New argument MULTIBYTEP. Callers changed. 4623 New argument MULTIBYTEP. Callers changed.
@@ -8409,7 +8409,7 @@
8409 (encode_coding_iso2022): New local variable safe_chars. Check 8409 (encode_coding_iso2022): New local variable safe_chars. Check
8410 unsafe chars. 8410 unsafe chars.
8411 (setup_coding_system): Delete the code to initialize 8411 (setup_coding_system): Delete the code to initialize
8412 coding->safe_charses. 8412 coding->safe_charsets.
8413 (intersection, find_safe_codings): New functions. 8413 (intersection, find_safe_codings): New functions.
8414 (Ffind_coding_systems_region_internal): New function. 8414 (Ffind_coding_systems_region_internal): New function.
8415 (syms_of_coding): Defsubr it. Initialize Qsafe_chars, 8415 (syms_of_coding): Defsubr it. Initialize Qsafe_chars,
diff --git a/src/alloc.c b/src/alloc.c
index 86127dd5197..f21f0b4fa3a 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -315,6 +315,7 @@ static POINTER_TYPE *lisp_malloc (size_t, enum mem_type);
315 on free lists recognizable in O(1). */ 315 on free lists recognizable in O(1). */
316 316
317static Lisp_Object Vdead; 317static Lisp_Object Vdead;
318#define DEADP(x) EQ (x, Vdead)
318 319
319#ifdef GC_MALLOC_CHECK 320#ifdef GC_MALLOC_CHECK
320 321
@@ -411,6 +412,10 @@ static void check_gcpros (void);
411 412
412#endif /* GC_MARK_STACK || GC_MALLOC_CHECK */ 413#endif /* GC_MARK_STACK || GC_MALLOC_CHECK */
413 414
415#ifndef DEADP
416# define DEADP(x) 0
417#endif
418
414/* Recording what needs to be marked for gc. */ 419/* Recording what needs to be marked for gc. */
415 420
416struct gcpro *gcprolist; 421struct gcpro *gcprolist;
@@ -877,7 +882,7 @@ safe_alloca_unwind (Lisp_Object arg)
877 882
878/* Like malloc but used for allocating Lisp data. NBYTES is the 883/* Like malloc but used for allocating Lisp data. NBYTES is the
879 number of bytes to allocate, TYPE describes the intended use of the 884 number of bytes to allocate, TYPE describes the intended use of the
880 allcated memory block (for strings, for conses, ...). */ 885 allocated memory block (for strings, for conses, ...). */
881 886
882#ifndef USE_LSB_TAG 887#ifndef USE_LSB_TAG
883static void *lisp_malloc_loser; 888static void *lisp_malloc_loser;
@@ -1407,7 +1412,7 @@ uninterrupt_malloc (void)
1407#ifdef DOUG_LEA_MALLOC 1412#ifdef DOUG_LEA_MALLOC
1408 pthread_mutexattr_t attr; 1413 pthread_mutexattr_t attr;
1409 1414
1410 /* GLIBC has a faster way to do this, but lets keep it portable. 1415 /* GLIBC has a faster way to do this, but let's keep it portable.
1411 This is according to the Single UNIX Specification. */ 1416 This is according to the Single UNIX Specification. */
1412 pthread_mutexattr_init (&attr); 1417 pthread_mutexattr_init (&attr);
1413 pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE); 1418 pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE);
@@ -6262,7 +6267,7 @@ which_symbols (Lisp_Object obj, EMACS_INT find_max)
6262 ptrdiff_t gc_count = inhibit_garbage_collection (); 6267 ptrdiff_t gc_count = inhibit_garbage_collection ();
6263 Lisp_Object found = Qnil; 6268 Lisp_Object found = Qnil;
6264 6269
6265 if (!EQ (obj, Vdead)) 6270 if (! DEADP (obj))
6266 { 6271 {
6267 for (sblk = symbol_block; sblk; sblk = sblk->next) 6272 for (sblk = symbol_block; sblk; sblk = sblk->next)
6268 { 6273 {
diff --git a/src/buffer.c b/src/buffer.c
index fec633371fc..f1ce9f4ec47 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -4430,7 +4430,7 @@ static int mmap_initialized_p;
4430 is currently mapped. Used to prevent overwriting an existing 4430 is currently mapped. Used to prevent overwriting an existing
4431 memory mapping. 4431 memory mapping.
4432 4432
4433 Default is to conservativly assume the address range is occupied by 4433 Default is to conservatively assume the address range is occupied by
4434 something else. This can be overridden by system configuration 4434 something else. This can be overridden by system configuration
4435 files if system-specific means to determine this exists. */ 4435 files if system-specific means to determine this exists. */
4436 4436
diff --git a/src/bytecode.c b/src/bytecode.c
index ed85d54d789..fdefe39a69d 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -271,7 +271,7 @@ struct byte_stack
271/* A list of currently active byte-code execution value stacks. 271/* A list of currently active byte-code execution value stacks.
272 Fbyte_code adds an entry to the head of this list before it starts 272 Fbyte_code adds an entry to the head of this list before it starts
273 processing byte-code, and it removed the entry again when it is 273 processing byte-code, and it removed the entry again when it is
274 done. Signalling an error truncates the list analoguous to 274 done. Signaling an error truncates the list analogous to
275 gcprolist. */ 275 gcprolist. */
276 276
277struct byte_stack *byte_stack_list; 277struct byte_stack *byte_stack_list;
diff --git a/src/callproc.c b/src/callproc.c
index ecb03ea9db2..d8f50e21ee5 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -722,6 +722,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
722 /* If BUFFER is nil, we must read process output once and then 722 /* If BUFFER is nil, we must read process output once and then
723 discard it, so setup coding system but with nil. */ 723 discard it, so setup coding system but with nil. */
724 setup_coding_system (Qnil, &process_coding); 724 setup_coding_system (Qnil, &process_coding);
725 process_coding.dst_multibyte = 0;
725 } 726 }
726 else 727 else
727 { 728 {
@@ -757,7 +758,10 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
757 && !NILP (val)) 758 && !NILP (val))
758 val = raw_text_coding_system (val); 759 val = raw_text_coding_system (val);
759 setup_coding_system (val, &process_coding); 760 setup_coding_system (val, &process_coding);
761 process_coding.dst_multibyte
762 = ! NILP (BVAR (current_buffer, enable_multibyte_characters));
760 } 763 }
764 process_coding.src_multibyte = 0;
761 765
762 immediate_quit = 1; 766 immediate_quit = 1;
763 QUIT; 767 QUIT;
diff --git a/src/ccl.c b/src/ccl.c
index 4764fa0f5b5..97fca3bb032 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -429,7 +429,7 @@ static Lisp_Object Vccl_program_table;
429 429
430#define CCL_Extension 0x1F /* Extended CCL code 430#define CCL_Extension 0x1F /* Extended CCL code
431 1:ExtendedCOMMNDRrrRRRrrrXXXXX 431 1:ExtendedCOMMNDRrrRRRrrrXXXXX
432 2:ARGUEMENT 432 2:ARGUMENT
433 3:... 433 3:...
434 ------------------------------ 434 ------------------------------
435 extended_command (rrr,RRR,Rrr,ARGS) 435 extended_command (rrr,RRR,Rrr,ARGS)
@@ -484,7 +484,7 @@ static Lisp_Object Vccl_program_table;
484 If the element is t or lambda, finish without changing reg[rrr]. 484 If the element is t or lambda, finish without changing reg[rrr].
485 If the element is a number, set reg[rrr] to the number and finish. 485 If the element is a number, set reg[rrr] to the number and finish.
486 486
487 Detail of the map structure is descibed in the comment for 487 Detail of the map structure is described in the comment for
488 CCL_MapMultiple below. */ 488 CCL_MapMultiple below. */
489 489
490#define CCL_IterateMultipleMap 0x10 /* Iterate multiple maps 490#define CCL_IterateMultipleMap 0x10 /* Iterate multiple maps
@@ -1762,7 +1762,7 @@ ccl_driver (struct ccl_program *ccl, int *source, int *destination, int src_size
1762 1762
1763 case CCL_STAT_QUIT: 1763 case CCL_STAT_QUIT:
1764 if (! ccl->quit_silently) 1764 if (! ccl->quit_silently)
1765 sprintf (msg, "\nCCL: Quited."); 1765 sprintf (msg, "\nCCL: Quitted.");
1766 break; 1766 break;
1767 1767
1768 default: 1768 default:
@@ -1808,7 +1808,7 @@ ccl_driver (struct ccl_program *ccl, int *source, int *destination, int src_size
1808 1808
1809/* Resolve symbols in the specified CCL code (Lisp vector). This 1809/* Resolve symbols in the specified CCL code (Lisp vector). This
1810 function converts symbols of code conversion maps and character 1810 function converts symbols of code conversion maps and character
1811 translation tables embeded in the CCL code into their ID numbers. 1811 translation tables embedded in the CCL code into their ID numbers.
1812 1812
1813 The return value is a new vector in which all symbols are resolved, 1813 The return value is a new vector in which all symbols are resolved,
1814 Qt if resolving of some symbol failed, 1814 Qt if resolving of some symbol failed,
diff --git a/src/character.c b/src/character.c
index 3517dbba47d..d5d89381aaf 100644
--- a/src/character.c
+++ b/src/character.c
@@ -589,7 +589,7 @@ parse_str_as_multibyte (const unsigned char *str, ptrdiff_t len,
589} 589}
590 590
591/* Arrange unibyte text at STR of NBYTES bytes as a multibyte text. 591/* Arrange unibyte text at STR of NBYTES bytes as a multibyte text.
592 It actually converts only such 8-bit characters that don't contruct 592 It actually converts only such 8-bit characters that don't construct
593 a multibyte sequence to multibyte forms of Latin-1 characters. If 593 a multibyte sequence to multibyte forms of Latin-1 characters. If
594 NCHARS is nonzero, set *NCHARS to the number of characters in the 594 NCHARS is nonzero, set *NCHARS to the number of characters in the
595 text. It is assured that we can use LEN bytes at STR as a work 595 text. It is assured that we can use LEN bytes at STR as a work
@@ -966,7 +966,7 @@ character is a target to get a byte value. In this case, POSITION, if
966non-nil, is an index of a target character in the string. 966non-nil, is an index of a target character in the string.
967 967
968If the current buffer (or STRING) is multibyte, and the target 968If the current buffer (or STRING) is multibyte, and the target
969character is not ASCII nor 8-bit character, an error is signalled. */) 969character is not ASCII nor 8-bit character, an error is signaled. */)
970 (Lisp_Object position, Lisp_Object string) 970 (Lisp_Object position, Lisp_Object string)
971{ 971{
972 int c; 972 int c;
diff --git a/src/charset.c b/src/charset.c
index 6aa6fe46b54..8f16771b855 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -163,8 +163,8 @@ static struct
163 /* 1 iff the following table is used for encoder. */ 163 /* 1 iff the following table is used for encoder. */
164 short for_encoder; 164 short for_encoder;
165 165
166 /* When the following table is used for encoding, mininum and 166 /* When the following table is used for encoding, minimum and
167 maxinum character of the current charset. */ 167 maximum character of the current charset. */
168 int min_char, max_char; 168 int min_char, max_char;
169 169
170 /* A Unicode character correspoinding to the code indice 0 (i.e. the 170 /* A Unicode character correspoinding to the code indice 0 (i.e. the
diff --git a/src/charset.h b/src/charset.h
index 483b7e29f7b..6d9079291c7 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -153,7 +153,7 @@ struct charset
153 /* Dimension of the charset: 1, 2, 3, or 4. */ 153 /* Dimension of the charset: 1, 2, 3, or 4. */
154 int dimension; 154 int dimension;
155 155
156 /* Byte code range of each dimension. <code_space>[4N] is a mininum 156 /* Byte code range of each dimension. <code_space>[4N] is a minimum
157 byte code of the (N+1)th dimension, <code_space>[4N+1] is a 157 byte code of the (N+1)th dimension, <code_space>[4N+1] is a
158 maximum byte code of the (N+1)th dimension, <code_space>[4N+2] is 158 maximum byte code of the (N+1)th dimension, <code_space>[4N+2] is
159 (<code_space>[4N+1] - <code_space>[4N] + 1), <code_space>[4N+3] 159 (<code_space>[4N+1] - <code_space>[4N] + 1), <code_space>[4N+3]
@@ -199,14 +199,14 @@ struct charset
199 /* The method for encoding/decoding characters of the charset. */ 199 /* The method for encoding/decoding characters of the charset. */
200 enum charset_method method; 200 enum charset_method method;
201 201
202 /* Mininum and Maximum code points of the charset. */ 202 /* Minimum and Maximum code points of the charset. */
203 unsigned min_code, max_code; 203 unsigned min_code, max_code;
204 204
205 /* Offset value used by macros CODE_POINT_TO_INDEX and 205 /* Offset value used by macros CODE_POINT_TO_INDEX and
206 INDEX_TO_CODE_POINT. . */ 206 INDEX_TO_CODE_POINT. . */
207 unsigned char_index_offset; 207 unsigned char_index_offset;
208 208
209 /* Mininum and Maximum character codes of the charset. If the 209 /* Minimum and Maximum character codes of the charset. If the
210 charset is compatible with ASCII, min_char is a minimum non-ASCII 210 charset is compatible with ASCII, min_char is a minimum non-ASCII
211 character of the charset. If the method of charset is 211 character of the charset. If the method of charset is
212 CHARSET_METHOD_OFFSET, even if the charset is unified, min_char 212 CHARSET_METHOD_OFFSET, even if the charset is unified, min_char
diff --git a/src/chartab.c b/src/chartab.c
index 06def16e795..c3dd1fe5b15 100644
--- a/src/chartab.c
+++ b/src/chartab.c
@@ -758,7 +758,7 @@ map_sub_char_table (void (*c_function) (Lisp_Object, Lisp_Object, Lisp_Object),
758{ 758{
759 /* Depth of TABLE. */ 759 /* Depth of TABLE. */
760 int depth; 760 int depth;
761 /* Minimum and maxinum characters covered by TABLE. */ 761 /* Minimum and maximum characters covered by TABLE. */
762 int min_char, max_char; 762 int min_char, max_char;
763 /* Number of characters covered by one element of TABLE. */ 763 /* Number of characters covered by one element of TABLE. */
764 int chars_in_block; 764 int chars_in_block;
@@ -1196,7 +1196,7 @@ uniprop_table_uncompress (Lisp_Object table, int idx)
1196} 1196}
1197 1197
1198 1198
1199/* Decode VALUE as an elemnet of char-table TABLE. */ 1199/* Decode VALUE as an element of char-table TABLE. */
1200 1200
1201static Lisp_Object 1201static Lisp_Object
1202uniprop_decode_value_run_length (Lisp_Object table, Lisp_Object value) 1202uniprop_decode_value_run_length (Lisp_Object table, Lisp_Object value)
diff --git a/src/coding.c b/src/coding.c
index e8765aea96d..b0dfc498add 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -1043,7 +1043,7 @@ coding_set_destination (struct coding_system *coding)
1043{ 1043{
1044 if (BUFFERP (coding->dst_object)) 1044 if (BUFFERP (coding->dst_object))
1045 { 1045 {
1046 if (coding->src_pos < 0) 1046 if (BUFFERP (coding->src_object) && coding->src_pos < 0)
1047 { 1047 {
1048 coding->destination = BEG_ADDR + coding->dst_pos_byte - BEG_BYTE; 1048 coding->destination = BEG_ADDR + coding->dst_pos_byte - BEG_BYTE;
1049 coding->dst_bytes = (GAP_END_ADDR 1049 coding->dst_bytes = (GAP_END_ADDR
diff --git a/src/coding.h b/src/coding.h
index 3cf28fb2458..2165fa23712 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -518,7 +518,7 @@ struct coding_system
518#define CODING_REQUIRE_DETECTION_MASK 0x1000 518#define CODING_REQUIRE_DETECTION_MASK 0x1000
519#define CODING_RESET_AT_BOL_MASK 0x2000 519#define CODING_RESET_AT_BOL_MASK 0x2000
520 520
521/* Return 1 if the coding context CODING requires annotaion 521/* Return 1 if the coding context CODING requires annotation
522 handling. */ 522 handling. */
523#define CODING_REQUIRE_ANNOTATION(coding) \ 523#define CODING_REQUIRE_ANNOTATION(coding) \
524 ((coding)->common_flags & CODING_ANNOTATION_MASK) 524 ((coding)->common_flags & CODING_ANNOTATION_MASK)
diff --git a/src/composite.c b/src/composite.c
index 90a239281fe..0a9bdcffc99 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -1308,7 +1308,7 @@ composition_reseat_it (struct composition_it *cmp_it, ptrdiff_t charpos, ptrdiff
1308 if (cmp_it->lookback == 0) 1308 if (cmp_it->lookback == 0)
1309 goto no_composition; 1309 goto no_composition;
1310 lgstring = Qnil; 1310 lgstring = Qnil;
1311 /* Try to find a shorter compostion that starts after CPOS. */ 1311 /* Try to find a shorter composition that starts after CPOS. */
1312 composition_compute_stop_pos (cmp_it, charpos, bytepos, cpos, 1312 composition_compute_stop_pos (cmp_it, charpos, bytepos, cpos,
1313 string); 1313 string);
1314 if (cmp_it->ch == -2 || cmp_it->stop_pos < charpos) 1314 if (cmp_it->ch == -2 || cmp_it->stop_pos < charpos)
diff --git a/src/composite.h b/src/composite.h
index b21994e5e3c..39e82ad74ad 100644
--- a/src/composite.h
+++ b/src/composite.h
@@ -41,7 +41,7 @@ enum composition_method {
41 COMPOSITION_NO 41 COMPOSITION_NO
42}; 42};
43 43
44/* Maximum number of compoments a single composition can have. */ 44/* Maximum number of components a single composition can have. */
45#define MAX_COMPOSITION_COMPONENTS 16 45#define MAX_COMPOSITION_COMPONENTS 16
46 46
47/* These macros access information about a composition that 47/* These macros access information about a composition that
diff --git a/src/data.c b/src/data.c
index d38dc5e0c58..7b30e91b12f 100644
--- a/src/data.c
+++ b/src/data.c
@@ -2028,7 +2028,7 @@ DEFUN ("indirect-function", Findirect_function, Sindirect_function, 1, 2, 0,
2028If OBJECT is not a symbol, just return it. Otherwise, follow all 2028If OBJECT is not a symbol, just return it. Otherwise, follow all
2029function indirections to find the final function binding and return it. 2029function indirections to find the final function binding and return it.
2030If the final symbol in the chain is unbound, signal a void-function error. 2030If the final symbol in the chain is unbound, signal a void-function error.
2031Optional arg NOERROR non-nil means to return nil instead of signalling. 2031Optional arg NOERROR non-nil means to return nil instead of signaling.
2032Signal a cyclic-function-indirection error if there is a loop in the 2032Signal a cyclic-function-indirection error if there is a loop in the
2033function chain of symbols. */) 2033function chain of symbols. */)
2034 (register Lisp_Object object, Lisp_Object noerror) 2034 (register Lisp_Object object, Lisp_Object noerror)
diff --git a/src/dired.c b/src/dired.c
index db07bc61e7d..3a3adfb5082 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -628,7 +628,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v
628 628
629 if (includeall && !canexclude) 629 if (includeall && !canexclude)
630 { /* If we have one non-excludable file, we want to exclude the 630 { /* If we have one non-excludable file, we want to exclude the
631 excudable files. */ 631 excludable files. */
632 includeall = 0; 632 includeall = 0;
633 /* Throw away any previous excludable match found. */ 633 /* Throw away any previous excludable match found. */
634 bestmatch = Qnil; 634 bestmatch = Qnil;
diff --git a/src/dispextern.h b/src/dispextern.h
index b1c3d6237c9..ccb85e7422e 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -3126,6 +3126,11 @@ void compute_fringe_widths (struct frame *, int);
3126void w32_init_fringe (struct redisplay_interface *); 3126void w32_init_fringe (struct redisplay_interface *);
3127void w32_reset_fringes (void); 3127void w32_reset_fringes (void);
3128#endif 3128#endif
3129
3130#if XASSERTS
3131extern unsigned row_hash (struct glyph_row *);
3132#endif
3133
3129/* Defined in image.c */ 3134/* Defined in image.c */
3130 3135
3131#ifdef HAVE_WINDOW_SYSTEM 3136#ifdef HAVE_WINDOW_SYSTEM
diff --git a/src/dispnew.c b/src/dispnew.c
index 93a990cff47..88f75414074 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -429,6 +429,14 @@ margin_glyphs_to_reserve (struct window *w, int total_glyphs, Lisp_Object margin
429 return n; 429 return n;
430} 430}
431 431
432#if XASSERTS
433/* Return non-zero if ROW's hash value is correct, zero if not. */
434static int
435verify_row_hash (struct glyph_row *row)
436{
437 return row->hash == row_hash (row);
438}
439#endif
432 440
433/* Adjust glyph matrix MATRIX on window W or on a frame to changed 441/* Adjust glyph matrix MATRIX on window W or on a frame to changed
434 window sizes. 442 window sizes.
@@ -600,6 +608,7 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y
600 row->glyphs[LAST_AREA] 608 row->glyphs[LAST_AREA]
601 = row->glyphs[LEFT_MARGIN_AREA] + dim.width; 609 = row->glyphs[LEFT_MARGIN_AREA] + dim.width;
602 } 610 }
611 xassert (!row->enabled_p || verify_row_hash (row));
603 ++row; 612 ++row;
604 } 613 }
605 } 614 }
@@ -1063,37 +1072,55 @@ swap_glyphs_in_rows (struct glyph_row *a, struct glyph_row *b)
1063 1072
1064#endif /* 0 */ 1073#endif /* 0 */
1065 1074
1066/* Exchange pointers to glyph memory between glyph rows A and B. */ 1075/* Exchange pointers to glyph memory between glyph rows A and B. Also
1076 exchange the used[] array and the hash values of the rows, because
1077 these should all go together for the row's hash value to be
1078 correct. */
1067 1079
1068static inline void 1080static inline void
1069swap_glyph_pointers (struct glyph_row *a, struct glyph_row *b) 1081swap_glyph_pointers (struct glyph_row *a, struct glyph_row *b)
1070{ 1082{
1071 int i; 1083 int i;
1084 unsigned hash_tem = a->hash;
1085
1072 for (i = 0; i < LAST_AREA + 1; ++i) 1086 for (i = 0; i < LAST_AREA + 1; ++i)
1073 { 1087 {
1074 struct glyph *temp = a->glyphs[i]; 1088 struct glyph *temp = a->glyphs[i];
1089 short used_tem = a->used[i];
1090
1075 a->glyphs[i] = b->glyphs[i]; 1091 a->glyphs[i] = b->glyphs[i];
1076 b->glyphs[i] = temp; 1092 b->glyphs[i] = temp;
1093 a->used[i] = b->used[i];
1094 b->used[i] = used_tem;
1077 } 1095 }
1096 a->hash = b->hash;
1097 b->hash = hash_tem;
1078} 1098}
1079 1099
1080 1100
1081/* Copy glyph row structure FROM to glyph row structure TO, except 1101/* Copy glyph row structure FROM to glyph row structure TO, except
1082 that glyph pointers in the structures are left unchanged. */ 1102 that glyph pointers, the `used' counts, and the hash values in the
1103 structures are left unchanged. */
1083 1104
1084static inline void 1105static inline void
1085copy_row_except_pointers (struct glyph_row *to, struct glyph_row *from) 1106copy_row_except_pointers (struct glyph_row *to, struct glyph_row *from)
1086{ 1107{
1087 struct glyph *pointers[1 + LAST_AREA]; 1108 struct glyph *pointers[1 + LAST_AREA];
1109 short used[1 + LAST_AREA];
1110 unsigned hashval;
1088 1111
1089 /* Save glyph pointers of TO. */ 1112 /* Save glyph pointers of TO. */
1090 memcpy (pointers, to->glyphs, sizeof to->glyphs); 1113 memcpy (pointers, to->glyphs, sizeof to->glyphs);
1114 memcpy (used, to->used, sizeof to->used);
1115 hashval = to->hash;
1091 1116
1092 /* Do a structure assignment. */ 1117 /* Do a structure assignment. */
1093 *to = *from; 1118 *to = *from;
1094 1119
1095 /* Restore original pointers of TO. */ 1120 /* Restore original pointers of TO. */
1096 memcpy (to->glyphs, pointers, sizeof to->glyphs); 1121 memcpy (to->glyphs, pointers, sizeof to->glyphs);
1122 memcpy (to->used, used, sizeof to->used);
1123 to->hash = hashval;
1097} 1124}
1098 1125
1099 1126
@@ -1271,6 +1298,9 @@ line_draw_cost (struct glyph_matrix *matrix, int vpos)
1271static inline int 1298static inline int
1272row_equal_p (struct glyph_row *a, struct glyph_row *b, int mouse_face_p) 1299row_equal_p (struct glyph_row *a, struct glyph_row *b, int mouse_face_p)
1273{ 1300{
1301 xassert (verify_row_hash (a));
1302 xassert (verify_row_hash (b));
1303
1274 if (a == b) 1304 if (a == b)
1275 return 1; 1305 return 1;
1276 else if (a->hash != b->hash) 1306 else if (a->hash != b->hash)
@@ -3467,7 +3497,7 @@ redraw_overlapping_rows (struct window *w, int yb)
3467 if (row->used[RIGHT_MARGIN_AREA]) 3497 if (row->used[RIGHT_MARGIN_AREA])
3468 rif->fix_overlapping_area (w, row, RIGHT_MARGIN_AREA, overlaps); 3498 rif->fix_overlapping_area (w, row, RIGHT_MARGIN_AREA, overlaps);
3469 3499
3470 /* Record in neighbour rows that ROW overwrites part of 3500 /* Record in neighbor rows that ROW overwrites part of
3471 their display. */ 3501 their display. */
3472 if (overlaps & OVERLAPS_PRED) 3502 if (overlaps & OVERLAPS_PRED)
3473 MATRIX_ROW (w->current_matrix, i - 1)->overlapped_p = 1; 3503 MATRIX_ROW (w->current_matrix, i - 1)->overlapped_p = 1;
@@ -4209,6 +4239,7 @@ add_row_entry (struct glyph_row *row)
4209 ptrdiff_t i = row->hash % row_table_size; 4239 ptrdiff_t i = row->hash % row_table_size;
4210 4240
4211 entry = row_table[i]; 4241 entry = row_table[i];
4242 xassert (entry || verify_row_hash (row));
4212 while (entry && !row_equal_p (entry->row, row, 1)) 4243 while (entry && !row_equal_p (entry->row, row, 1))
4213 entry = entry->next; 4244 entry = entry->next;
4214 4245
@@ -4333,10 +4364,10 @@ scrolling_window (struct window *w, int header_line_p)
4333 j = last_old; 4364 j = last_old;
4334 while (i - 1 > first_new 4365 while (i - 1 > first_new
4335 && j - 1 > first_old 4366 && j - 1 > first_old
4336 && MATRIX_ROW (current_matrix, i - 1)->enabled_p 4367 && MATRIX_ROW (current_matrix, j - 1)->enabled_p
4337 && (MATRIX_ROW (current_matrix, i - 1)->y 4368 && (MATRIX_ROW (current_matrix, j - 1)->y
4338 == MATRIX_ROW (desired_matrix, j - 1)->y) 4369 == MATRIX_ROW (desired_matrix, i - 1)->y)
4339 && !MATRIX_ROW (desired_matrix, j - 1)->redraw_fringe_bitmaps_p 4370 && !MATRIX_ROW (desired_matrix, i - 1)->redraw_fringe_bitmaps_p
4340 && row_equal_p (MATRIX_ROW (desired_matrix, i - 1), 4371 && row_equal_p (MATRIX_ROW (desired_matrix, i - 1),
4341 MATRIX_ROW (current_matrix, j - 1), 1)) 4372 MATRIX_ROW (current_matrix, j - 1), 1))
4342 --i, --j; 4373 --i, --j;
diff --git a/src/doprnt.c b/src/doprnt.c
index b7c1e4e68e2..166d396851a 100644
--- a/src/doprnt.c
+++ b/src/doprnt.c
@@ -26,7 +26,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
26 of the (`int') argument, suitable for display in an Emacs buffer. 26 of the (`int') argument, suitable for display in an Emacs buffer.
27 27
28 . For %s and %c, when field width is specified (e.g., %25s), it accounts for 28 . For %s and %c, when field width is specified (e.g., %25s), it accounts for
29 the diplay width of each character, according to char-width-table. That 29 the display width of each character, according to char-width-table. That
30 is, it does not assume that each character takes one column on display. 30 is, it does not assume that each character takes one column on display.
31 31
32 . If the size of the buffer is not enough to produce the formatted string in 32 . If the size of the buffer is not enough to produce the formatted string in
diff --git a/src/emacs.c b/src/emacs.c
index 5f3d126e13e..a5d2f619b8c 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1402,7 +1402,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
1402#endif 1402#endif
1403 1403
1404 /* argmatch must not be used after here, 1404 /* argmatch must not be used after here,
1405 except when bulding temacs 1405 except when building temacs
1406 because the -d argument has not been skipped in skip_args. */ 1406 because the -d argument has not been skipped in skip_args. */
1407 1407
1408#ifdef MSDOS 1408#ifdef MSDOS
diff --git a/src/font.c b/src/font.c
index 30c39771fd6..cb27155f09d 100644
--- a/src/font.c
+++ b/src/font.c
@@ -162,7 +162,7 @@ static struct font_driver_list *font_driver_list;
162 162
163 163
164 164
165/* Creaters of font-related Lisp object. */ 165/* Creators of font-related Lisp object. */
166 166
167static Lisp_Object 167static Lisp_Object
168font_make_spec (void) 168font_make_spec (void)
@@ -802,7 +802,7 @@ font_expand_wildcards (Lisp_Object *field, int n)
802 struct { 802 struct {
803 /* Minimum possible field. */ 803 /* Minimum possible field. */
804 int from; 804 int from;
805 /* Maxinum possible field. */ 805 /* Maximum possible field. */
806 int to; 806 int to;
807 /* Bit mask of possible field. Nth bit corresponds to Nth field. */ 807 /* Bit mask of possible field. Nth bit corresponds to Nth field. */
808 int mask; 808 int mask;
@@ -954,7 +954,7 @@ font_expand_wildcards (Lisp_Object *field, int n)
954 } 954 }
955 } 955 }
956 956
957 /* Decide all fileds from restrictions in RANGE. */ 957 /* Decide all fields from restrictions in RANGE. */
958 for (i = j = 0; i < n ; i++) 958 for (i = j = 0; i < n ; i++)
959 { 959 {
960 if (j < range[i].from) 960 if (j < range[i].from)
@@ -5147,7 +5147,7 @@ the corresponding glyph code. If ENCODING is a char-table, looking up
5147the table by a character gives the corresponding glyph code. 5147the table by a character gives the corresponding glyph code.
5148 5148
5149REPERTORY specifies a repertory of characters supported by the font. 5149REPERTORY specifies a repertory of characters supported by the font.
5150If REPERTORY is a charset, all characters beloging to the charset are 5150If REPERTORY is a charset, all characters belonging to the charset are
5151supported. If REPERTORY is a char-table, all characters who have a 5151supported. If REPERTORY is a char-table, all characters who have a
5152non-nil value in the table are supported. If REPERTORY is nil, Emacs 5152non-nil value in the table are supported. If REPERTORY is nil, Emacs
5153gets the repertory information by an opened font and ENCODING. */); 5153gets the repertory information by an opened font and ENCODING. */);
diff --git a/src/font.h b/src/font.h
index 775c02b000f..f49f06a1fbc 100644
--- a/src/font.h
+++ b/src/font.h
@@ -599,7 +599,7 @@ struct font_driver
599 599
600 /* Optional. 600 /* Optional.
601 Store bitmap data for glyph-code CODE of FONT in BITMAP. It is 601 Store bitmap data for glyph-code CODE of FONT in BITMAP. It is
602 intended that this method is callled from the other font-driver 602 intended that this method is called from the other font-driver
603 for actual drawing. */ 603 for actual drawing. */
604 int (*get_bitmap) (struct font *font, unsigned code, 604 int (*get_bitmap) (struct font *font, unsigned code,
605 struct font_bitmap *bitmap, 605 struct font_bitmap *bitmap,
diff --git a/src/fontset.c b/src/fontset.c
index 891a89f8cd0..ae919468695 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -1090,7 +1090,7 @@ fontset_pattern_regexp (Lisp_Object pattern)
1090 nescs++; 1090 nescs++;
1091 } 1091 }
1092 1092
1093 /* If PATTERN is not full XLFD we conert "*" to ".*". Otherwise 1093 /* If PATTERN is not full XLFD we convert "*" to ".*". Otherwise
1094 we convert "*" to "[^-]*" which is much faster in regular 1094 we convert "*" to "[^-]*" which is much faster in regular
1095 expression matching. */ 1095 expression matching. */
1096 if (ndashes < 14) 1096 if (ndashes < 14)
@@ -1704,7 +1704,7 @@ static Lisp_Object auto_fontset_alist;
1704/* Number of automatically created fontsets. */ 1704/* Number of automatically created fontsets. */
1705static ptrdiff_t num_auto_fontsets; 1705static ptrdiff_t num_auto_fontsets;
1706 1706
1707/* Retun a fontset synthesized from FONT-OBJECT. This is called from 1707/* Return a fontset synthesized from FONT-OBJECT. This is called from
1708 x_new_font when FONT-OBJECT is used for the default ASCII font of a 1708 x_new_font when FONT-OBJECT is used for the default ASCII font of a
1709 frame, and the returned fontset is used for the default fontset of 1709 frame, and the returned fontset is used for the default fontset of
1710 that frame. The fontset specifies a font of the same registry as 1710 that frame. The fontset specifies a font of the same registry as
@@ -1790,7 +1790,7 @@ update_auto_fontset_alist (Lisp_Object font_object, Lisp_Object fontset)
1790/* Return a cons (FONT-OBJECT . GLYPH-CODE). 1790/* Return a cons (FONT-OBJECT . GLYPH-CODE).
1791 FONT-OBJECT is the font for the character at POSITION in the current 1791 FONT-OBJECT is the font for the character at POSITION in the current
1792 buffer. This is computed from all the text properties and overlays 1792 buffer. This is computed from all the text properties and overlays
1793 that apply to POSITION. POSTION may be nil, in which case, 1793 that apply to POSITION. POSITION may be nil, in which case,
1794 FONT-SPEC is the font for displaying the character CH with the 1794 FONT-SPEC is the font for displaying the character CH with the
1795 default face. 1795 default face.
1796 1796
diff --git a/src/frame.c b/src/frame.c
index 1b29bd8f085..dbee6a8092b 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1237,7 +1237,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
1237 else 1237 else
1238 { 1238 {
1239#ifdef HAVE_X_WINDOWS 1239#ifdef HAVE_X_WINDOWS
1240 /* Also, save clipboard to the the clipboard manager. */ 1240 /* Also, save clipboard to the clipboard manager. */
1241 x_clipboard_manager_save_frame (frame); 1241 x_clipboard_manager_save_frame (frame);
1242#endif 1242#endif
1243 1243
@@ -1320,7 +1320,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
1320 1320
1321 /* Mark all the windows that used to be on FRAME as deleted, and then 1321 /* Mark all the windows that used to be on FRAME as deleted, and then
1322 remove the reference to them. */ 1322 remove the reference to them. */
1323 delete_all_subwindows (f->root_window); 1323 delete_all_child_windows (f->root_window);
1324 f->root_window = Qnil; 1324 f->root_window = Qnil;
1325 1325
1326 Vframe_list = Fdelq (frame, Vframe_list); 1326 Vframe_list = Fdelq (frame, Vframe_list);
@@ -1359,6 +1359,13 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
1359 /* If needed, delete the terminal that this frame was on. 1359 /* If needed, delete the terminal that this frame was on.
1360 (This must be done after the frame is killed.) */ 1360 (This must be done after the frame is killed.) */
1361 terminal->reference_count--; 1361 terminal->reference_count--;
1362#ifdef USE_GTK
1363 /* FIXME: Deleting the terminal crashes emacs because of a GTK
1364 bug.
1365 http://lists.gnu.org/archive/html/emacs-devel/2011-10/msg00363.html */
1366 if (terminal->reference_count == 0 && terminal->type == output_x_window)
1367 terminal->reference_count = 1;
1368#endif /* USE_GTK */
1362 if (terminal->reference_count == 0) 1369 if (terminal->reference_count == 0)
1363 { 1370 {
1364 Lisp_Object tmp; 1371 Lisp_Object tmp;
@@ -2490,7 +2497,7 @@ If FRAME is omitted, the selected frame is used. The exact value
2490of the result depends on the window-system and toolkit in use: 2497of the result depends on the window-system and toolkit in use:
2491 2498
2492In the Gtk+ version of Emacs, it includes only any window (including 2499In the Gtk+ version of Emacs, it includes only any window (including
2493the minibuffer or eacho area), mode line, and header line. It does not 2500the minibuffer or echo area), mode line, and header line. It does not
2494include the tool bar or menu bar. 2501include the tool bar or menu bar.
2495 2502
2496With the Motif or Lucid toolkits, it also includes the tool bar (but 2503With the Motif or Lucid toolkits, it also includes the tool bar (but
diff --git a/src/frame.h b/src/frame.h
index 574da5c3b52..598d9adc491 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -371,7 +371,7 @@ struct frame
371 if greater than 1, then the frame is obscured - we still consider 371 if greater than 1, then the frame is obscured - we still consider
372 it to be "visible" as seen from lisp, but we don't bother 372 it to be "visible" as seen from lisp, but we don't bother
373 updating it. We must take care to garbage the frame when it 373 updating it. We must take care to garbage the frame when it
374 ceaces to be obscured though. 374 ceases to be obscured though.
375 375
376 iconified is nonzero if the frame is currently iconified. 376 iconified is nonzero if the frame is currently iconified.
377 377
diff --git a/src/gtkutil.c b/src/gtkutil.c
index e13a7540715..31cbd32f441 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -348,7 +348,7 @@ file_for_image (Lisp_Object image)
348 348
349/* For the image defined in IMG, make and return a GtkImage. For displays with 349/* For the image defined in IMG, make and return a GtkImage. For displays with
350 8 planes or less we must make a GdkPixbuf and apply the mask manually. 350 8 planes or less we must make a GdkPixbuf and apply the mask manually.
351 Otherwise the highlightning and dimming the tool bar code in GTK does 351 Otherwise the highlighting and dimming the tool bar code in GTK does
352 will look bad. For display with more than 8 planes we just use the 352 will look bad. For display with more than 8 planes we just use the
353 pixmap and mask directly. For monochrome displays, GTK doesn't seem 353 pixmap and mask directly. For monochrome displays, GTK doesn't seem
354 able to use external pixmaps, it looks bad whatever we do. 354 able to use external pixmaps, it looks bad whatever we do.
@@ -891,7 +891,7 @@ xg_frame_resized (FRAME_PTR f, int pixelwidth, int pixelheight)
891 } 891 }
892} 892}
893 893
894/* Resize the outer window of frame F after chainging the height. 894/* Resize the outer window of frame F after changing the height.
895 COLUMNS/ROWS is the size the edit area shall have after the resize. */ 895 COLUMNS/ROWS is the size the edit area shall have after the resize. */
896 896
897void 897void
@@ -1423,7 +1423,7 @@ get_dialog_title (char key)
1423/* Callback for dialogs that get WM_DELETE_WINDOW. We pop down 1423/* Callback for dialogs that get WM_DELETE_WINDOW. We pop down
1424 the dialog, but return TRUE so the event does not propagate further 1424 the dialog, but return TRUE so the event does not propagate further
1425 in GTK. This prevents GTK from destroying the dialog widget automatically 1425 in GTK. This prevents GTK from destroying the dialog widget automatically
1426 and we can always destrou the widget manually, regardles of how 1426 and we can always destroy the widget manually, regardless of how
1427 it was popped down (button press or WM_DELETE_WINDOW). 1427 it was popped down (button press or WM_DELETE_WINDOW).
1428 W is the dialog widget. 1428 W is the dialog widget.
1429 EVENT is the GdkEvent that represents WM_DELETE_WINDOW (not used). 1429 EVENT is the GdkEvent that represents WM_DELETE_WINDOW (not used).
@@ -2294,7 +2294,7 @@ tearoff_activate (GtkWidget *widget, gpointer client_data)
2294 2294
2295 2295
2296/* Create a menu item widget, and connect the callbacks. 2296/* Create a menu item widget, and connect the callbacks.
2297 ITEM decribes the menu item. 2297 ITEM describes the menu item.
2298 F is the frame the created menu belongs to. 2298 F is the frame the created menu belongs to.
2299 SELECT_CB is the callback to use when a menu item is selected. 2299 SELECT_CB is the callback to use when a menu item is selected.
2300 HIGHLIGHT_CB is the callback to call when entering/leaving menu items. 2300 HIGHLIGHT_CB is the callback to call when entering/leaving menu items.
@@ -4237,7 +4237,7 @@ xg_make_tool_item (FRAME_PTR f,
4237 gtk_container_add (GTK_CONTAINER (weventbox), wb); 4237 gtk_container_add (GTK_CONTAINER (weventbox), wb);
4238 gtk_container_add (GTK_CONTAINER (ti), weventbox); 4238 gtk_container_add (GTK_CONTAINER (ti), weventbox);
4239 4239
4240 if (wimage) 4240 if (wimage || label)
4241 { 4241 {
4242 intptr_t ii = i; 4242 intptr_t ii = i;
4243 gpointer gi = (gpointer) ii; 4243 gpointer gi = (gpointer) ii;
@@ -4301,21 +4301,21 @@ xg_tool_item_stale_p (GtkWidget *wbutton, const char *stock_name,
4301 GtkWidget *wlbl = xg_get_tool_bar_widgets (vb, &wimage); 4301 GtkWidget *wlbl = xg_get_tool_bar_widgets (vb, &wimage);
4302 4302
4303 /* Check if the tool icon matches. */ 4303 /* Check if the tool icon matches. */
4304 if (stock_name) 4304 if (stock_name && wimage)
4305 { 4305 {
4306 old = g_object_get_data (G_OBJECT (wimage), 4306 old = g_object_get_data (G_OBJECT (wimage),
4307 XG_TOOL_BAR_STOCK_NAME); 4307 XG_TOOL_BAR_STOCK_NAME);
4308 if (!old || strcmp (old, stock_name)) 4308 if (!old || strcmp (old, stock_name))
4309 return 1; 4309 return 1;
4310 } 4310 }
4311 else if (icon_name) 4311 else if (icon_name && wimage)
4312 { 4312 {
4313 old = g_object_get_data (G_OBJECT (wimage), 4313 old = g_object_get_data (G_OBJECT (wimage),
4314 XG_TOOL_BAR_ICON_NAME); 4314 XG_TOOL_BAR_ICON_NAME);
4315 if (!old || strcmp (old, icon_name)) 4315 if (!old || strcmp (old, icon_name))
4316 return 1; 4316 return 1;
4317 } 4317 }
4318 else 4318 else if (wimage)
4319 { 4319 {
4320 gpointer gold_img = g_object_get_data (G_OBJECT (wimage), 4320 gpointer gold_img = g_object_get_data (G_OBJECT (wimage),
4321 XG_TOOL_BAR_IMAGE_DATA); 4321 XG_TOOL_BAR_IMAGE_DATA);
@@ -4330,7 +4330,7 @@ xg_tool_item_stale_p (GtkWidget *wbutton, const char *stock_name,
4330 return 1; 4330 return 1;
4331 4331
4332 /* Ensure label is correct. */ 4332 /* Ensure label is correct. */
4333 if (label) 4333 if (label && wlbl)
4334 gtk_label_set_text (GTK_LABEL (wlbl), label); 4334 gtk_label_set_text (GTK_LABEL (wlbl), label);
4335 return 0; 4335 return 0;
4336} 4336}
diff --git a/src/image.c b/src/image.c
index 4453d2aa8d8..fd842f3e347 100644
--- a/src/image.c
+++ b/src/image.c
@@ -7553,7 +7553,7 @@ imagemagick_image_p (Lisp_Object object)
7553} 7553}
7554 7554
7555/* The GIF library also defines DrawRectangle, but its never used in Emacs. 7555/* The GIF library also defines DrawRectangle, but its never used in Emacs.
7556 Therefore rename the function so it doesnt collide with ImageMagick. */ 7556 Therefore rename the function so it doesn't collide with ImageMagick. */
7557#define DrawRectangle DrawRectangleGif 7557#define DrawRectangle DrawRectangleGif
7558#include <wand/MagickWand.h> 7558#include <wand/MagickWand.h>
7559 7559
@@ -7825,7 +7825,7 @@ imagemagick_load_image (struct frame *f, struct image *img,
7825 7825
7826 if (imagemagick_rendermethod == 1) 7826 if (imagemagick_rendermethod == 1)
7827 { 7827 {
7828 /* Magicexportimage is normaly faster than pixelpushing. This 7828 /* Magicexportimage is normally faster than pixelpushing. This
7829 method is also well tested. Some aspects of this method are 7829 method is also well tested. Some aspects of this method are
7830 ad-hoc and needs to be more researched. */ 7830 ad-hoc and needs to be more researched. */
7831 int imagedepth = 24;/*MagickGetImageDepth(image_wand);*/ 7831 int imagedepth = 24;/*MagickGetImageDepth(image_wand);*/
@@ -7842,7 +7842,7 @@ imagemagick_load_image (struct frame *f, struct image *img,
7842 } 7842 }
7843 7843
7844 7844
7845 /* Oddly, the below code doesnt seem to work:*/ 7845 /* Oddly, the below code doesn't seem to work:*/
7846 /* switch(ximg->bitmap_unit){ */ 7846 /* switch(ximg->bitmap_unit){ */
7847 /* case 8: */ 7847 /* case 8: */
7848 /* pixelwidth=CharPixel; */ 7848 /* pixelwidth=CharPixel; */
@@ -7871,7 +7871,7 @@ imagemagick_load_image (struct frame *f, struct image *img,
7871 /*&(img->pixmap));*/ 7871 /*&(img->pixmap));*/
7872 ximg->data); 7872 ximg->data);
7873#else 7873#else
7874 image_error ("You dont have MagickExportImagePixels, upgrade ImageMagick!", 7874 image_error ("You don't have MagickExportImagePixels, upgrade ImageMagick!",
7875 Qnil, Qnil); 7875 Qnil, Qnil);
7876#endif 7876#endif
7877 } 7877 }
@@ -8782,7 +8782,7 @@ syms_of_image (void)
8782 operation on GNU/Linux of calling dump-emacs after loading some images. */ 8782 operation on GNU/Linux of calling dump-emacs after loading some images. */
8783 image_types = NULL; 8783 image_types = NULL;
8784 8784
8785 /* Must be defined now becase we're going to update it below, while 8785 /* Must be defined now because we're going to update it below, while
8786 defining the supported image types. */ 8786 defining the supported image types. */
8787 DEFVAR_LISP ("image-types", Vimage_types, 8787 DEFVAR_LISP ("image-types", Vimage_types,
8788 doc: /* List of potentially supported image types. 8788 doc: /* List of potentially supported image types.
diff --git a/src/indent.c b/src/indent.c
index 7e2edc8713b..033d258c67e 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -1680,6 +1680,8 @@ compute_motion (ptrdiff_t from, EMACS_INT fromvpos, EMACS_INT fromhpos, int did_
1680 val_compute_motion.prevhpos = contin_hpos; 1680 val_compute_motion.prevhpos = contin_hpos;
1681 else 1681 else
1682 val_compute_motion.prevhpos = prev_hpos; 1682 val_compute_motion.prevhpos = prev_hpos;
1683 /* We always handle all of them here; none of them remain to do. */
1684 val_compute_motion.ovstring_chars_done = 0;
1683 1685
1684 /* Nonzero if have just continued a line */ 1686 /* Nonzero if have just continued a line */
1685 val_compute_motion.contin = (contin_hpos && prev_hpos == 0); 1687 val_compute_motion.contin = (contin_hpos && prev_hpos == 0);
diff --git a/src/insdel.c b/src/insdel.c
index 0a9777ad95e..10d37c42592 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -1316,7 +1316,7 @@ replace_range (ptrdiff_t from, ptrdiff_t to, Lisp_Object new,
1316 1316
1317 UNGCPRO; 1317 UNGCPRO;
1318 1318
1319 /* Make args be valid */ 1319 /* Make args be valid. */
1320 if (from < BEGV) 1320 if (from < BEGV)
1321 from = BEGV; 1321 from = BEGV;
1322 if (to > ZV) 1322 if (to > ZV)
diff --git a/src/intervals.c b/src/intervals.c
index e8ff5bce5b6..6f8dda4294e 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -1317,7 +1317,7 @@ interval_deletion_adjustment (register INTERVAL tree, register ptrdiff_t from,
1317 if (NULL_INTERVAL_P (tree)) 1317 if (NULL_INTERVAL_P (tree))
1318 return 0; 1318 return 0;
1319 1319
1320 /* Left branch */ 1320 /* Left branch. */
1321 if (relative_position < LEFT_TOTAL_LENGTH (tree)) 1321 if (relative_position < LEFT_TOTAL_LENGTH (tree))
1322 { 1322 {
1323 ptrdiff_t subtract = interval_deletion_adjustment (tree->left, 1323 ptrdiff_t subtract = interval_deletion_adjustment (tree->left,
@@ -1327,7 +1327,7 @@ interval_deletion_adjustment (register INTERVAL tree, register ptrdiff_t from,
1327 CHECK_TOTAL_LENGTH (tree); 1327 CHECK_TOTAL_LENGTH (tree);
1328 return subtract; 1328 return subtract;
1329 } 1329 }
1330 /* Right branch */ 1330 /* Right branch. */
1331 else if (relative_position >= (TOTAL_LENGTH (tree) 1331 else if (relative_position >= (TOTAL_LENGTH (tree)
1332 - RIGHT_TOTAL_LENGTH (tree))) 1332 - RIGHT_TOTAL_LENGTH (tree)))
1333 { 1333 {
@@ -1425,9 +1425,8 @@ adjust_intervals_for_deletion (struct buffer *buffer,
1425 compiler that does not allow calling a static function (here, 1425 compiler that does not allow calling a static function (here,
1426 adjust_intervals_for_deletion) from a non-static inline function. */ 1426 adjust_intervals_for_deletion) from a non-static inline function. */
1427 1427
1428static inline void 1428void
1429static_offset_intervals (struct buffer *buffer, ptrdiff_t start, 1429offset_intervals (struct buffer *buffer, ptrdiff_t start, ptrdiff_t length)
1430 ptrdiff_t length)
1431{ 1430{
1432 if (NULL_INTERVAL_P (BUF_INTERVALS (buffer)) || length == 0) 1431 if (NULL_INTERVAL_P (BUF_INTERVALS (buffer)) || length == 0)
1433 return; 1432 return;
@@ -1440,12 +1439,6 @@ static_offset_intervals (struct buffer *buffer, ptrdiff_t start,
1440 adjust_intervals_for_deletion (buffer, start, -length); 1439 adjust_intervals_for_deletion (buffer, start, -length);
1441 } 1440 }
1442} 1441}
1443
1444inline void
1445offset_intervals (struct buffer *buffer, ptrdiff_t start, ptrdiff_t length)
1446{
1447 static_offset_intervals (buffer, start, length);
1448}
1449 1442
1450/* Merge interval I with its lexicographic successor. The resulting 1443/* Merge interval I with its lexicographic successor. The resulting
1451 interval is returned, and has the properties of the original 1444 interval is returned, and has the properties of the original
@@ -1706,54 +1699,37 @@ graft_intervals_into_buffer (INTERVAL source, ptrdiff_t position,
1706 Qnil, buf, 0); 1699 Qnil, buf, 0);
1707 } 1700 }
1708 if (! NULL_INTERVAL_P (BUF_INTERVALS (buffer))) 1701 if (! NULL_INTERVAL_P (BUF_INTERVALS (buffer)))
1709 /* Shouldn't be necessary. -stef */ 1702 /* Shouldn't be necessary. --Stef */
1710 BUF_INTERVALS (buffer) = balance_an_interval (BUF_INTERVALS (buffer)); 1703 BUF_INTERVALS (buffer) = balance_an_interval (BUF_INTERVALS (buffer));
1711 return; 1704 return;
1712 } 1705 }
1713 1706
1714 if (NULL_INTERVAL_P (tree)) 1707 eassert (length == TOTAL_LENGTH (source));
1715 { 1708
1716 /* The inserted text constitutes the whole buffer, so 1709 if ((BUF_Z (buffer) - BUF_BEG (buffer)) == length)
1710 { /* The inserted text constitutes the whole buffer, so
1717 simply copy over the interval structure. */ 1711 simply copy over the interval structure. */
1718 if ((BUF_Z (buffer) - BUF_BEG (buffer)) == TOTAL_LENGTH (source))
1719 {
1720 Lisp_Object buf; 1712 Lisp_Object buf;
1721 XSETBUFFER (buf, buffer); 1713 XSETBUFFER (buf, buffer);
1722 BUF_INTERVALS (buffer) = reproduce_tree_obj (source, buf); 1714 BUF_INTERVALS (buffer) = reproduce_tree_obj (source, buf);
1723 BUF_INTERVALS (buffer)->position = BEG; 1715 BUF_INTERVALS (buffer)->position = BUF_BEG (buffer);
1724 BUF_INTERVALS (buffer)->up_obj = 1; 1716 eassert (BUF_INTERVALS (buffer)->up_obj == 1);
1725
1726 return; 1717 return;
1727 } 1718 }
1728 1719 else if (NULL_INTERVAL_P (tree))
1729 /* Create an interval tree in which to place a copy 1720 { /* Create an interval tree in which to place a copy
1730 of the intervals of the inserted string. */ 1721 of the intervals of the inserted string. */
1731 {
1732 Lisp_Object buf; 1722 Lisp_Object buf;
1733 XSETBUFFER (buf, buffer); 1723 XSETBUFFER (buf, buffer);
1734 tree = create_root_interval (buf); 1724 tree = create_root_interval (buf);
1735 } 1725 }
1736 }
1737 else if (TOTAL_LENGTH (tree) == TOTAL_LENGTH (source))
1738 /* If the buffer contains only the new string, but
1739 there was already some interval tree there, then it may be
1740 some zero length intervals. Eventually, do something clever
1741 about inserting properly. For now, just waste the old intervals. */
1742 {
1743 BUF_INTERVALS (buffer) = reproduce_tree (source, INTERVAL_PARENT (tree));
1744 BUF_INTERVALS (buffer)->position = BEG;
1745 BUF_INTERVALS (buffer)->up_obj = 1;
1746 /* Explicitly free the old tree here. */
1747
1748 return;
1749 }
1750 /* Paranoia -- the text has already been added, so this buffer 1726 /* Paranoia -- the text has already been added, so this buffer
1751 should be of non-zero length. */ 1727 should be of non-zero length. */
1752 else if (TOTAL_LENGTH (tree) == 0) 1728 else if (TOTAL_LENGTH (tree) == 0)
1753 abort (); 1729 abort ();
1754 1730
1755 this = under = find_interval (tree, position); 1731 this = under = find_interval (tree, position);
1756 if (NULL_INTERVAL_P (under)) /* Paranoia */ 1732 if (NULL_INTERVAL_P (under)) /* Paranoia. */
1757 abort (); 1733 abort ();
1758 over = find_interval (source, interval_start_pos (source)); 1734 over = find_interval (source, interval_start_pos (source));
1759 1735
@@ -1884,7 +1860,7 @@ lookup_char_property (Lisp_Object plist, register Lisp_Object prop, int textprop
1884/* Set point in BUFFER "temporarily" to CHARPOS, which corresponds to 1860/* Set point in BUFFER "temporarily" to CHARPOS, which corresponds to
1885 byte position BYTEPOS. */ 1861 byte position BYTEPOS. */
1886 1862
1887inline void 1863void
1888temp_set_point_both (struct buffer *buffer, 1864temp_set_point_both (struct buffer *buffer,
1889 ptrdiff_t charpos, ptrdiff_t bytepos) 1865 ptrdiff_t charpos, ptrdiff_t bytepos)
1890{ 1866{
@@ -1904,7 +1880,7 @@ temp_set_point_both (struct buffer *buffer,
1904 1880
1905/* Set point "temporarily", without checking any text properties. */ 1881/* Set point "temporarily", without checking any text properties. */
1906 1882
1907inline void 1883void
1908temp_set_point (struct buffer *buffer, ptrdiff_t charpos) 1884temp_set_point (struct buffer *buffer, ptrdiff_t charpos)
1909{ 1885{
1910 temp_set_point_both (buffer, charpos, 1886 temp_set_point_both (buffer, charpos,
@@ -2393,7 +2369,7 @@ copy_intervals (INTERVAL tree, ptrdiff_t start, ptrdiff_t length)
2393 2369
2394/* Give STRING the properties of BUFFER from POSITION to LENGTH. */ 2370/* Give STRING the properties of BUFFER from POSITION to LENGTH. */
2395 2371
2396inline void 2372void
2397copy_intervals_to_string (Lisp_Object string, struct buffer *buffer, 2373copy_intervals_to_string (Lisp_Object string, struct buffer *buffer,
2398 ptrdiff_t position, ptrdiff_t length) 2374 ptrdiff_t position, ptrdiff_t length)
2399{ 2375{
diff --git a/src/intervals.h b/src/intervals.h
index d7d156b42db..be0cc43d032 100644
--- a/src/intervals.h
+++ b/src/intervals.h
@@ -64,71 +64,71 @@ struct interval
64 Lisp_Object plist; 64 Lisp_Object plist;
65}; 65};
66 66
67/* These are macros for dealing with the interval tree. */ 67/* These are macros for dealing with the interval tree. */
68 68
69/* Size of the structure used to represent an interval */ 69/* Size of the structure used to represent an interval. */
70#define INTERVAL_SIZE (sizeof (struct interval)) 70#define INTERVAL_SIZE (sizeof (struct interval))
71 71
72/* Size of a pointer to an interval structure */ 72/* Size of a pointer to an interval structure. */
73#define INTERVAL_PTR_SIZE (sizeof (struct interval *)) 73#define INTERVAL_PTR_SIZE (sizeof (struct interval *))
74 74
75#define NULL_INTERVAL_P(i) ((i) == NULL_INTERVAL) 75#define NULL_INTERVAL_P(i) ((i) == NULL_INTERVAL)
76 76
77/* True if this interval has no right child. */ 77/* True if this interval has no right child. */
78#define NULL_RIGHT_CHILD(i) ((i)->right == NULL_INTERVAL) 78#define NULL_RIGHT_CHILD(i) ((i)->right == NULL_INTERVAL)
79 79
80/* True if this interval has no left child. */ 80/* True if this interval has no left child. */
81#define NULL_LEFT_CHILD(i) ((i)->left == NULL_INTERVAL) 81#define NULL_LEFT_CHILD(i) ((i)->left == NULL_INTERVAL)
82 82
83/* True if this interval has no parent. */ 83/* True if this interval has no parent. */
84#define NULL_PARENT(i) ((i)->up_obj || (i)->up.interval == 0) 84#define NULL_PARENT(i) ((i)->up_obj || (i)->up.interval == 0)
85 85
86/* True if this interval is the left child of some other interval. */ 86/* True if this interval is the left child of some other interval. */
87#define AM_LEFT_CHILD(i) (! NULL_PARENT (i) \ 87#define AM_LEFT_CHILD(i) (! NULL_PARENT (i) \
88 && INTERVAL_PARENT (i)->left == (i)) 88 && INTERVAL_PARENT (i)->left == (i))
89 89
90/* True if this interval is the right child of some other interval. */ 90/* True if this interval is the right child of some other interval. */
91#define AM_RIGHT_CHILD(i) (! NULL_PARENT (i) \ 91#define AM_RIGHT_CHILD(i) (! NULL_PARENT (i) \
92 && INTERVAL_PARENT (i)->right == (i)) 92 && INTERVAL_PARENT (i)->right == (i))
93 93
94/* True if this interval has no children. */ 94/* True if this interval has no children. */
95#define LEAF_INTERVAL_P(i) ((i)->left == NULL_INTERVAL \ 95#define LEAF_INTERVAL_P(i) ((i)->left == NULL_INTERVAL \
96 && (i)->right == NULL_INTERVAL) 96 && (i)->right == NULL_INTERVAL)
97 97
98/* True if this interval has no parent and is therefore the root. */ 98/* True if this interval has no parent and is therefore the root. */
99#define ROOT_INTERVAL_P(i) (NULL_PARENT (i)) 99#define ROOT_INTERVAL_P(i) (NULL_PARENT (i))
100 100
101/* True if this interval is the only interval in the interval tree. */ 101/* True if this interval is the only interval in the interval tree. */
102#define ONLY_INTERVAL_P(i) (ROOT_INTERVAL_P ((i)) && LEAF_INTERVAL_P ((i))) 102#define ONLY_INTERVAL_P(i) (ROOT_INTERVAL_P ((i)) && LEAF_INTERVAL_P ((i)))
103 103
104/* True if this interval has both left and right children. */ 104/* True if this interval has both left and right children. */
105#define BOTH_KIDS_P(i) ((i)->left != NULL_INTERVAL \ 105#define BOTH_KIDS_P(i) ((i)->left != NULL_INTERVAL \
106 && (i)->right != NULL_INTERVAL) 106 && (i)->right != NULL_INTERVAL)
107 107
108/* The total size of all text represented by this interval and all its 108/* The total size of all text represented by this interval and all its
109 children in the tree. This is zero if the interval is null. */ 109 children in the tree. This is zero if the interval is null. */
110#define TOTAL_LENGTH(i) ((i) == NULL_INTERVAL ? 0 : (i)->total_length) 110#define TOTAL_LENGTH(i) ((i) == NULL_INTERVAL ? 0 : (i)->total_length)
111 111
112/* The size of text represented by this interval alone. */ 112/* The size of text represented by this interval alone. */
113#define LENGTH(i) ((i) == NULL_INTERVAL ? 0 : (TOTAL_LENGTH ((i)) \ 113#define LENGTH(i) ((i) == NULL_INTERVAL ? 0 : (TOTAL_LENGTH ((i)) \
114 - TOTAL_LENGTH ((i)->right) \ 114 - TOTAL_LENGTH ((i)->right) \
115 - TOTAL_LENGTH ((i)->left))) 115 - TOTAL_LENGTH ((i)->left)))
116 116
117/* The position of the character just past the end of I. Note that 117/* The position of the character just past the end of I. Note that
118 the position cache i->position must be valid for this to work. */ 118 the position cache i->position must be valid for this to work. */
119#define INTERVAL_LAST_POS(i) ((i)->position + LENGTH ((i))) 119#define INTERVAL_LAST_POS(i) ((i)->position + LENGTH ((i)))
120 120
121/* The total size of the left subtree of this interval. */ 121/* The total size of the left subtree of this interval. */
122#define LEFT_TOTAL_LENGTH(i) ((i)->left ? (i)->left->total_length : 0) 122#define LEFT_TOTAL_LENGTH(i) ((i)->left ? (i)->left->total_length : 0)
123 123
124/* The total size of the right subtree of this interval. */ 124/* The total size of the right subtree of this interval. */
125#define RIGHT_TOTAL_LENGTH(i) ((i)->right ? (i)->right->total_length : 0) 125#define RIGHT_TOTAL_LENGTH(i) ((i)->right ? (i)->right->total_length : 0)
126 126
127 127
128/* These macros are for dealing with the interval properties. */ 128/* These macros are for dealing with the interval properties. */
129 129
130/* True if this is a default interval, which is the same as being null 130/* True if this is a default interval, which is the same as being null
131 or having no properties. */ 131 or having no properties. */
132#define DEFAULT_INTERVAL_P(i) (NULL_INTERVAL_P (i) || EQ ((i)->plist, Qnil)) 132#define DEFAULT_INTERVAL_P(i) (NULL_INTERVAL_P (i) || EQ ((i)->plist, Qnil))
133 133
134/* Test what type of parent we have. Three possibilities: another 134/* Test what type of parent we have. Three possibilities: another
@@ -169,7 +169,7 @@ struct interval
169 } \ 169 } \
170 while (0) 170 while (0)
171 171
172/* Reset this interval to its vanilla, or no-property state. */ 172/* Reset this interval to its vanilla, or no-property state. */
173#define RESET_INTERVAL(i) \ 173#define RESET_INTERVAL(i) \
174{ \ 174{ \
175 (i)->total_length = (i)->position = 0; \ 175 (i)->total_length = (i)->position = 0; \
@@ -181,7 +181,7 @@ struct interval
181 (i)->plist = Qnil; \ 181 (i)->plist = Qnil; \
182} 182}
183 183
184/* Copy the cached property values of interval FROM to interval TO. */ 184/* Copy the cached property values of interval FROM to interval TO. */
185#define COPY_INTERVAL_CACHE(from,to) \ 185#define COPY_INTERVAL_CACHE(from,to) \
186{ \ 186{ \
187 (to)->write_protect = (from)->write_protect; \ 187 (to)->write_protect = (from)->write_protect; \
@@ -190,7 +190,7 @@ struct interval
190 (to)->rear_sticky = (from)->rear_sticky; \ 190 (to)->rear_sticky = (from)->rear_sticky; \
191} 191}
192 192
193/* Copy only the set bits of FROM's cache. */ 193/* Copy only the set bits of FROM's cache. */
194#define MERGE_INTERVAL_CACHE(from,to) \ 194#define MERGE_INTERVAL_CACHE(from,to) \
195{ \ 195{ \
196 if ((from)->write_protect) (to)->write_protect = 1; \ 196 if ((from)->write_protect) (to)->write_protect = 1; \
@@ -201,18 +201,18 @@ struct interval
201 201
202/* Macro determining whether the properties of an interval being 202/* Macro determining whether the properties of an interval being
203 inserted should be merged with the properties of the text where 203 inserted should be merged with the properties of the text where
204 they are being inserted. */ 204 they are being inserted. */
205#define MERGE_INSERTIONS(i) 1 205#define MERGE_INSERTIONS(i) 1
206 206
207/* Macro determining if an invisible interval should be displayed 207/* Macro determining if an invisible interval should be displayed
208 as a special glyph, or not at all. */ 208 as a special glyph, or not at all. */
209#define DISPLAY_INVISIBLE_GLYPH(i) 0 209#define DISPLAY_INVISIBLE_GLYPH(i) 0
210 210
211/* Is this interval visible? Replace later with cache access */ 211/* Is this interval visible? Replace later with cache access. */
212#define INTERVAL_VISIBLE_P(i) \ 212#define INTERVAL_VISIBLE_P(i) \
213 (! NULL_INTERVAL_P (i) && NILP (textget ((i)->plist, Qinvisible))) 213 (! NULL_INTERVAL_P (i) && NILP (textget ((i)->plist, Qinvisible)))
214 214
215/* Is this interval writable? Replace later with cache access */ 215/* Is this interval writable? Replace later with cache access. */
216#define INTERVAL_WRITABLE_P(i) \ 216#define INTERVAL_WRITABLE_P(i) \
217 (! NULL_INTERVAL_P (i) \ 217 (! NULL_INTERVAL_P (i) \
218 && (NILP (textget ((i)->plist, Qread_only)) \ 218 && (NILP (textget ((i)->plist, Qread_only)) \
@@ -222,7 +222,7 @@ struct interval
222 : !NILP (Vinhibit_read_only))))) \ 222 : !NILP (Vinhibit_read_only))))) \
223 223
224/* Macros to tell whether insertions before or after this interval 224/* Macros to tell whether insertions before or after this interval
225 should stick to it. */ 225 should stick to it. */
226/* Replace later with cache access */ 226/* Replace later with cache access */
227/*#define FRONT_STICKY_P(i) ((i)->front_sticky != 0) 227/*#define FRONT_STICKY_P(i) ((i)->front_sticky != 0)
228 #define END_STICKY_P(i) ((i)->rear_sticky != 0)*/ 228 #define END_STICKY_P(i) ((i)->rear_sticky != 0)*/
@@ -245,11 +245,11 @@ struct interval
245 ? !NILP (prop) \ 245 ? !NILP (prop) \
246 : invisible_p (prop, BVAR (current_buffer, invisibility_spec))) 246 : invisible_p (prop, BVAR (current_buffer, invisibility_spec)))
247 247
248/* Declared in alloc.c */ 248/* Declared in alloc.c. */
249 249
250extern INTERVAL make_interval (void); 250extern INTERVAL make_interval (void);
251 251
252/* Declared in intervals.c */ 252/* Declared in intervals.c. */
253 253
254extern INTERVAL create_root_interval (Lisp_Object); 254extern INTERVAL create_root_interval (Lisp_Object);
255extern void copy_properties (INTERVAL, INTERVAL); 255extern void copy_properties (INTERVAL, INTERVAL);
@@ -288,12 +288,12 @@ extern INTERVAL validate_interval_range (Lisp_Object, Lisp_Object *,
288 Lisp_Object *, int); 288 Lisp_Object *, int);
289extern INTERVAL interval_of (ptrdiff_t, Lisp_Object); 289extern INTERVAL interval_of (ptrdiff_t, Lisp_Object);
290 290
291/* Defined in xdisp.c */ 291/* Defined in xdisp.c. */
292extern int invisible_p (Lisp_Object, Lisp_Object); 292extern int invisible_p (Lisp_Object, Lisp_Object);
293 293
294/* Declared in textprop.c */ 294/* Declared in textprop.c. */
295 295
296/* Types of hooks. */ 296/* Types of hooks. */
297extern Lisp_Object Qpoint_left; 297extern Lisp_Object Qpoint_left;
298extern Lisp_Object Qpoint_entered; 298extern Lisp_Object Qpoint_entered;
299extern Lisp_Object Qmodification_hooks; 299extern Lisp_Object Qmodification_hooks;
@@ -301,11 +301,11 @@ extern Lisp_Object Qcategory;
301extern Lisp_Object Qlocal_map; 301extern Lisp_Object Qlocal_map;
302extern Lisp_Object Qkeymap; 302extern Lisp_Object Qkeymap;
303 303
304/* Visual properties text (including strings) may have. */ 304/* Visual properties text (including strings) may have. */
305extern Lisp_Object Qfont; 305extern Lisp_Object Qfont;
306extern Lisp_Object Qinvisible, Qintangible; 306extern Lisp_Object Qinvisible, Qintangible;
307 307
308/* Sticky properties */ 308/* Sticky properties. */
309extern Lisp_Object Qfront_sticky, Qrear_nonsticky; 309extern Lisp_Object Qfront_sticky, Qrear_nonsticky;
310 310
311EXFUN (Fget_char_property, 3); 311EXFUN (Fget_char_property, 3);
diff --git a/src/keyboard.c b/src/keyboard.c
index 239028c8bad..3b82c497650 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -930,7 +930,7 @@ pop_kboard (void)
930 state later. 930 state later.
931 931
932 If Emacs is already in single_kboard mode, and F's keyboard is 932 If Emacs is already in single_kboard mode, and F's keyboard is
933 locked, then this function will throw an errow. */ 933 locked, then this function will throw an error. */
934 934
935void 935void
936temporarily_switch_to_single_kboard (struct frame *f) 936temporarily_switch_to_single_kboard (struct frame *f)
@@ -1058,7 +1058,7 @@ cmd_error_internal (Lisp_Object data, const char *context)
1058 struct frame *sf = SELECTED_FRAME (); 1058 struct frame *sf = SELECTED_FRAME ();
1059 1059
1060 /* The immediate context is not interesting for Quits, 1060 /* The immediate context is not interesting for Quits,
1061 since they are asyncronous. */ 1061 since they are asynchronous. */
1062 if (EQ (XCAR (data), Qquit)) 1062 if (EQ (XCAR (data), Qquit))
1063 Vsignaling_function = Qnil; 1063 Vsignaling_function = Qnil;
1064 1064
@@ -5393,7 +5393,7 @@ make_lispy_event (struct input_event *event)
5393 || !lispy_function_keys[event->code - FUNCTION_KEY_OFFSET]) 5393 || !lispy_function_keys[event->code - FUNCTION_KEY_OFFSET])
5394 { 5394 {
5395 /* We need to use an alist rather than a vector as the cache 5395 /* We need to use an alist rather than a vector as the cache
5396 since we can't make a vector long enuf. */ 5396 since we can't make a vector long enough. */
5397 if (NILP (KVAR (current_kboard, system_key_syms))) 5397 if (NILP (KVAR (current_kboard, system_key_syms)))
5398 KVAR (current_kboard, system_key_syms) = Fcons (Qnil, Qnil); 5398 KVAR (current_kboard, system_key_syms) = Fcons (Qnil, Qnil);
5399 return modify_event_symbol (event->code, 5399 return modify_event_symbol (event->code,
@@ -8137,7 +8137,7 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
8137 Lisp_Object caption; 8137 Lisp_Object caption;
8138 int i, have_label = 0; 8138 int i, have_label = 0;
8139 8139
8140 /* Defininition looks like `(menu-item CAPTION BINDING PROPS...)'. 8140 /* Definition looks like `(menu-item CAPTION BINDING PROPS...)'.
8141 Rule out items that aren't lists, don't start with 8141 Rule out items that aren't lists, don't start with
8142 `menu-item' or whose rest following `tool-bar-item' is not a 8142 `menu-item' or whose rest following `tool-bar-item' is not a
8143 list. */ 8143 list. */
@@ -8787,7 +8787,7 @@ typedef struct keyremap
8787 /* Positions [START, END) in the key sequence buffer 8787 /* Positions [START, END) in the key sequence buffer
8788 are the key that we have scanned so far. 8788 are the key that we have scanned so far.
8789 Those events are the ones that we will replace 8789 Those events are the ones that we will replace
8790 if PAREHT maps them into a key sequence. */ 8790 if PARENT maps them into a key sequence. */
8791 int start, end; 8791 int start, end;
8792} keyremap; 8792} keyremap;
8793 8793
@@ -10861,8 +10861,12 @@ interrupt_signal (int signalnum) /* If we don't have an argument, some */
10861 if (!terminal) 10861 if (!terminal)
10862 { 10862 {
10863 /* If there are no frames there, let's pretend that we are a 10863 /* If there are no frames there, let's pretend that we are a
10864 well-behaving UN*X program and quit. */ 10864 well-behaving UN*X program and quit. We cannot do that while
10865 Fkill_emacs (Qnil); 10865 GC is in progress, though. */
10866 if (!gc_in_progress)
10867 Fkill_emacs (Qnil);
10868 else
10869 Vquit_flag = Qt;
10866 } 10870 }
10867 else 10871 else
10868 { 10872 {
diff --git a/src/keymap.c b/src/keymap.c
index 54134c67043..2a0f162a0e0 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -998,7 +998,7 @@ copy_keymap_item (Lisp_Object elt)
998 } 998 }
999 else 999 else
1000 { 1000 {
1001 /* It may be an old fomat menu item. 1001 /* It may be an old format menu item.
1002 Skip the optional menu string. */ 1002 Skip the optional menu string. */
1003 if (STRINGP (XCAR (tem))) 1003 if (STRINGP (XCAR (tem)))
1004 { 1004 {
@@ -2642,11 +2642,11 @@ remapped command in the returned list. */)
2642 /* We have a list of advertised bindings. */ 2642 /* We have a list of advertised bindings. */
2643 while (CONSP (tem)) 2643 while (CONSP (tem))
2644 if (EQ (shadow_lookup (keymaps, XCAR (tem), Qnil, 0), definition)) 2644 if (EQ (shadow_lookup (keymaps, XCAR (tem), Qnil, 0), definition))
2645 return XCAR (tem); 2645 RETURN_UNGCPRO (XCAR (tem));
2646 else 2646 else
2647 tem = XCDR (tem); 2647 tem = XCDR (tem);
2648 if (EQ (shadow_lookup (keymaps, tem, Qnil, 0), definition)) 2648 if (EQ (shadow_lookup (keymaps, tem, Qnil, 0), definition))
2649 return tem; 2649 RETURN_UNGCPRO (tem);
2650 } 2650 }
2651 2651
2652 sequences = Freverse (where_is_internal (definition, keymaps, 2652 sequences = Freverse (where_is_internal (definition, keymaps,
diff --git a/src/lisp.h b/src/lisp.h
index 7b1be98bd22..648eb6430bd 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -168,6 +168,9 @@ extern int suppress_checking EXTERNALLY_VISIBLE;
168# if HAVE_ATTRIBUTE_ALIGNED 168# if HAVE_ATTRIBUTE_ALIGNED
169# define DECL_ALIGN(type, var) \ 169# define DECL_ALIGN(type, var) \
170 type __attribute__ ((__aligned__ (1 << GCTYPEBITS))) var 170 type __attribute__ ((__aligned__ (1 << GCTYPEBITS))) var
171# elif defined(_MSC_VER)
172# define DECL_ALIGN(type, var) \
173 type __declspec(align(1 << GCTYPEBITS)) var
171# else 174# else
172 /* What directives do other compilers use? */ 175 /* What directives do other compilers use? */
173# endif 176# endif
@@ -225,6 +228,15 @@ extern int suppress_checking EXTERNALLY_VISIBLE;
225# endif 228# endif
226#endif 229#endif
227 230
231/* Stolen from GDB. The only known compiler that doesn't support
232 enums in bitfields is MSVC. */
233#ifdef _MSC_VER
234#define ENUM_BF(TYPE) unsigned int
235#else
236#define ENUM_BF(TYPE) enum TYPE
237#endif
238
239
228enum Lisp_Type 240enum Lisp_Type
229 { 241 {
230 /* Integer. XINT (obj) is the integer value. */ 242 /* Integer. XINT (obj) is the integer value. */
@@ -315,12 +327,12 @@ union Lisp_Object
315 /* Use explict signed, the signedness of a bit-field of type 327 /* Use explict signed, the signedness of a bit-field of type
316 int is implementation defined. */ 328 int is implementation defined. */
317 signed EMACS_INT val : VALBITS; 329 signed EMACS_INT val : VALBITS;
318 enum Lisp_Type type : GCTYPEBITS; 330 ENUM_BF (Lisp_Type) type : GCTYPEBITS;
319 } s; 331 } s;
320 struct 332 struct
321 { 333 {
322 EMACS_UINT val : VALBITS; 334 EMACS_UINT val : VALBITS;
323 enum Lisp_Type type : GCTYPEBITS; 335 ENUM_BF (Lisp_Type) type : GCTYPEBITS;
324 } u; 336 } u;
325 } 337 }
326Lisp_Object; 338Lisp_Object;
@@ -336,14 +348,14 @@ union Lisp_Object
336 348
337 struct 349 struct
338 { 350 {
339 enum Lisp_Type type : GCTYPEBITS; 351 ENUM_BF (Lisp_Type) type : GCTYPEBITS;
340 /* Use explict signed, the signedness of a bit-field of type 352 /* Use explict signed, the signedness of a bit-field of type
341 int is implementation defined. */ 353 int is implementation defined. */
342 signed EMACS_INT val : VALBITS; 354 signed EMACS_INT val : VALBITS;
343 } s; 355 } s;
344 struct 356 struct
345 { 357 {
346 enum Lisp_Type type : GCTYPEBITS; 358 ENUM_BF (Lisp_Type) type : GCTYPEBITS;
347 EMACS_UINT val : VALBITS; 359 EMACS_UINT val : VALBITS;
348 } u; 360 } u;
349 } 361 }
@@ -1101,7 +1113,7 @@ struct Lisp_Symbol
1101 1 : it's a varalias, the value is really in the `alias' symbol. 1113 1 : it's a varalias, the value is really in the `alias' symbol.
1102 2 : it's a localized var, the value is in the `blv' object. 1114 2 : it's a localized var, the value is in the `blv' object.
1103 3 : it's a forwarding variable, the value is in `forward'. */ 1115 3 : it's a forwarding variable, the value is in `forward'. */
1104 enum symbol_redirect redirect : 3; 1116 ENUM_BF (symbol_redirect) redirect : 3;
1105 1117
1106 /* Non-zero means symbol is constant, i.e. changing its value 1118 /* Non-zero means symbol is constant, i.e. changing its value
1107 should signal an error. If the value is 3, then the var 1119 should signal an error. If the value is 3, then the var
@@ -1314,7 +1326,7 @@ struct Lisp_Hash_Table
1314 1326
1315struct Lisp_Misc_Any /* Supertype of all Misc types. */ 1327struct Lisp_Misc_Any /* Supertype of all Misc types. */
1316{ 1328{
1317 enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_??? */ 1329 ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_??? */
1318 unsigned gcmarkbit : 1; 1330 unsigned gcmarkbit : 1;
1319 int spacer : 15; 1331 int spacer : 15;
1320 /* Make it as long as "Lisp_Free without padding". */ 1332 /* Make it as long as "Lisp_Free without padding". */
@@ -1323,7 +1335,7 @@ struct Lisp_Misc_Any /* Supertype of all Misc types. */
1323 1335
1324struct Lisp_Marker 1336struct Lisp_Marker
1325{ 1337{
1326 enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_Marker */ 1338 ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Marker */
1327 unsigned gcmarkbit : 1; 1339 unsigned gcmarkbit : 1;
1328 int spacer : 13; 1340 int spacer : 13;
1329 /* This flag is temporarily used in the functions 1341 /* This flag is temporarily used in the functions
@@ -1473,7 +1485,7 @@ struct Lisp_Overlay
1473 I.e. 9words plus 2 bits, 3words of which are for external linked lists. 1485 I.e. 9words plus 2 bits, 3words of which are for external linked lists.
1474*/ 1486*/
1475 { 1487 {
1476 enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_Overlay */ 1488 ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Overlay */
1477 unsigned gcmarkbit : 1; 1489 unsigned gcmarkbit : 1;
1478 int spacer : 15; 1490 int spacer : 15;
1479 struct Lisp_Overlay *next; 1491 struct Lisp_Overlay *next;
@@ -1492,7 +1504,7 @@ struct Lisp_Kboard_Objfwd
1492 This type of object is used in the arg to record_unwind_protect. */ 1504 This type of object is used in the arg to record_unwind_protect. */
1493struct Lisp_Save_Value 1505struct Lisp_Save_Value
1494 { 1506 {
1495 enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_Save_Value */ 1507 ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Save_Value */
1496 unsigned gcmarkbit : 1; 1508 unsigned gcmarkbit : 1;
1497 int spacer : 14; 1509 int spacer : 14;
1498 /* If DOGC is set, POINTER is the address of a memory 1510 /* If DOGC is set, POINTER is the address of a memory
@@ -1506,7 +1518,7 @@ struct Lisp_Save_Value
1506/* A miscellaneous object, when it's on the free list. */ 1518/* A miscellaneous object, when it's on the free list. */
1507struct Lisp_Free 1519struct Lisp_Free
1508 { 1520 {
1509 enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_Free */ 1521 ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Free */
1510 unsigned gcmarkbit : 1; 1522 unsigned gcmarkbit : 1;
1511 int spacer : 15; 1523 int spacer : 15;
1512 union Lisp_Misc *chain; 1524 union Lisp_Misc *chain;
@@ -1928,13 +1940,23 @@ typedef struct {
1928 1940
1929/* This version of DEFUN declares a function prototype with the right 1941/* This version of DEFUN declares a function prototype with the right
1930 arguments, so we can catch errors with maxargs at compile-time. */ 1942 arguments, so we can catch errors with maxargs at compile-time. */
1931#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ 1943#ifdef _MSC_VER
1932 Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \ 1944#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \
1933 static DECL_ALIGN (struct Lisp_Subr, sname) = \ 1945 Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \
1934 { PVEC_SUBR, \ 1946 static DECL_ALIGN (struct Lisp_Subr, sname) = \
1935 { .a ## maxargs = fnname }, \ 1947 { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)), \
1936 minargs, maxargs, lname, intspec, 0}; \ 1948 { (Lisp_Object (__cdecl *)(void))fnname }, \
1937 Lisp_Object fnname 1949 minargs, maxargs, lname, intspec, 0}; \
1950 Lisp_Object fnname
1951#else /* not _MSC_VER */
1952#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \
1953 Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \
1954 static DECL_ALIGN (struct Lisp_Subr, sname) = \
1955 { PVEC_SUBR, \
1956 { .a ## maxargs = fnname }, \
1957 minargs, maxargs, lname, intspec, 0}; \
1958 Lisp_Object fnname
1959#endif
1938 1960
1939/* Note that the weird token-substitution semantics of ANSI C makes 1961/* Note that the weird token-substitution semantics of ANSI C makes
1940 this work for MANY and UNEVALLED. */ 1962 this work for MANY and UNEVALLED. */
@@ -3165,10 +3187,6 @@ extern void syms_of_fileio (void);
3165extern Lisp_Object make_temp_name (Lisp_Object, int); 3187extern Lisp_Object make_temp_name (Lisp_Object, int);
3166extern Lisp_Object Qdelete_file; 3188extern Lisp_Object Qdelete_file;
3167 3189
3168/* Defined in abbrev.c */
3169
3170extern void syms_of_abbrev (void);
3171
3172/* Defined in search.c */ 3190/* Defined in search.c */
3173extern void shrink_regexp_cache (void); 3191extern void shrink_regexp_cache (void);
3174EXFUN (Fstring_match, 3); 3192EXFUN (Fstring_match, 3);
diff --git a/src/makefile.w32-in b/src/makefile.w32-in
index 53cb5f857ab..36e4511d845 100644
--- a/src/makefile.w32-in
+++ b/src/makefile.w32-in
@@ -24,6 +24,9 @@ ALL = emacs
24# Set EMACSLOADPATH correctly (in case already defined in environment). 24# Set EMACSLOADPATH correctly (in case already defined in environment).
25EMACSLOADPATH=$(CURDIR)/../lisp 25EMACSLOADPATH=$(CURDIR)/../lisp
26 26
27# Size in MBs of the static heap in temacs.exe.
28HEAPSIZE = 27
29
27# 30#
28# HAVE_CONFIG_H is required by some generic gnu sources stuck into 31# HAVE_CONFIG_H is required by some generic gnu sources stuck into
29# the emacs source tree. 32# the emacs source tree.
@@ -177,7 +180,7 @@ temacs: stamp_BLD $(TEMACS)
177$(TEMACS): $(TLIB0) $(TLIB1) $(TLIB2) $(TLASTLIB) $(TOBJ) $(TRES) \ 180$(TEMACS): $(TLIB0) $(TLIB1) $(TLIB2) $(TLASTLIB) $(TOBJ) $(TRES) \
178 ../nt/$(BLD)/addsection.exe $(GNULIB) 181 ../nt/$(BLD)/addsection.exe $(GNULIB)
179 $(LINK) $(LINK_OUT)$(TEMACS_TMP) $(FULL_LINK_FLAGS) $(TOBJ) $(TRES) $(LIBS) 182 $(LINK) $(LINK_OUT)$(TEMACS_TMP) $(FULL_LINK_FLAGS) $(TOBJ) $(TRES) $(LIBS)
180 "../nt/$(BLD)/addsection" "$(TEMACS_TMP)" "$(TEMACS)" EMHEAP 21 183 "$(THISDIR)/../nt/$(BLD)/addsection" "$(TEMACS_TMP)" "$(TEMACS)" EMHEAP $(HEAPSIZE)
181 184
182# These omit firstfile.${O}, but there's no documentation in there 185# These omit firstfile.${O}, but there's no documentation in there
183# anyways. 186# anyways.
@@ -232,7 +235,7 @@ globals.h: gl-stamp
232 235
233gl-stamp: ../lib-src/$(BLD)/make-docfile.exe $(GLOBAL_SOURCES) 236gl-stamp: ../lib-src/$(BLD)/make-docfile.exe $(GLOBAL_SOURCES)
234 - $(DEL) gl-tmp 237 - $(DEL) gl-tmp
235 "../lib-src/$(BLD)/make-docfile" -d . -g $(SOME_MACHINE_OBJECTS) $(obj) > gl-tmp 238 "$(THISDIR)/../lib-src/$(BLD)/make-docfile" -d . -g $(SOME_MACHINE_OBJECTS) $(obj) > gl-tmp
236 cmd /c "fc /b gl-tmp globals.h >nul 2>&1 || $(CP) gl-tmp globals.h" 239 cmd /c "fc /b gl-tmp globals.h >nul 2>&1 || $(CP) gl-tmp globals.h"
237 - $(DEL) gl-tmp 240 - $(DEL) gl-tmp
238 echo timestamp > $@ 241 echo timestamp > $@
@@ -348,11 +351,11 @@ TAGS-LISP: $(OBJ0) $(OBJ1) $(OBJ2)
348TAGS-gmake: 351TAGS-gmake:
349 ../lib-src/$(BLD)/etags.exe --include=TAGS-LISP --include=../nt/TAGS \ 352 ../lib-src/$(BLD)/etags.exe --include=TAGS-LISP --include=../nt/TAGS \
350 --regex=@../nt/emacs-src.tags \ 353 --regex=@../nt/emacs-src.tags \
351 $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ0)) 354 $(OBJ0_c)
352 ../lib-src/$(BLD)/etags.exe -a --regex=@../nt/emacs-src.tags \ 355 ../lib-src/$(BLD)/etags.exe -a --regex=@../nt/emacs-src.tags \
353 $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ1)) 356 $(OBJ1_c)
354 ../lib-src/$(BLD)/etags.exe -a --regex=@../nt/emacs-src.tags \ 357 ../lib-src/$(BLD)/etags.exe -a --regex=@../nt/emacs-src.tags \
355 $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ2)) \ 358 $(OBJ2_c) \
356 $(CURDIR)/*.h $(CURDIR)/m/intel386.h $(CURDIR)/s/ms-w32.h 359 $(CURDIR)/*.h $(CURDIR)/m/intel386.h $(CURDIR)/s/ms-w32.h
357 360
358TAGS-nmake: 361TAGS-nmake:
diff --git a/src/nsfns.m b/src/nsfns.m
index 80da9d7a9ac..f320a909497 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -101,6 +101,10 @@ extern BOOL ns_in_resize;
101static Lisp_Object as_script, *as_result; 101static Lisp_Object as_script, *as_result;
102static int as_status; 102static int as_status;
103 103
104#if GLYPH_DEBUG
105static ptrdiff_t image_cache_refcount;
106#endif
107
104/* ========================================================================== 108/* ==========================================================================
105 109
106 Internal utility functions 110 Internal utility functions
@@ -1038,6 +1042,41 @@ frame_parm_handler ns_frame_parm_handlers[] =
1038}; 1042};
1039 1043
1040 1044
1045/* Handler for signals raised during x_create_frame.
1046 FRAME is the frame which is partially constructed. */
1047
1048static Lisp_Object
1049unwind_create_frame (Lisp_Object frame)
1050{
1051 struct frame *f = XFRAME (frame);
1052
1053 /* If frame is already dead, nothing to do. This can happen if the
1054 display is disconnected after the frame has become official, but
1055 before x_create_frame removes the unwind protect. */
1056 if (!FRAME_LIVE_P (f))
1057 return Qnil;
1058
1059 /* If frame is ``official'', nothing to do. */
1060 if (NILP (Fmemq (frame, Vframe_list)))
1061 {
1062#if GLYPH_DEBUG && XASSERTS
1063 struct ns_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
1064#endif
1065
1066 x_free_frame_resources (f);
1067 free_glyphs (f);
1068
1069#if GLYPH_DEBUG
1070 /* Check that reference counts are indeed correct. */
1071 xassert (dpyinfo->terminal->image_cache->refcount == image_cache_refcount);
1072#endif
1073 return Qt;
1074 }
1075
1076 return Qnil;
1077}
1078
1079
1041 1080
1042/* ========================================================================== 1081/* ==========================================================================
1043 1082
@@ -1047,46 +1086,50 @@ frame_parm_handler ns_frame_parm_handlers[] =
1047 1086
1048DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame, 1087DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
1049 1, 1, 0, 1088 1, 1, 0,
1050 doc: /* Make a new Nextstep window, called a \"frame\" in Emacs terms. 1089 doc: /* Make a new Nextstep window, called a "frame" in Emacs terms.
1051Return an Emacs frame object. 1090Return an Emacs frame object.
1052PARMS is an alist of frame parameters. 1091PARMS is an alist of frame parameters.
1053If the parameters specify that the frame should not have a minibuffer, 1092If the parameters specify that the frame should not have a minibuffer,
1054and do not specify a specific minibuffer window to use, 1093and do not specify a specific minibuffer window to use,
1055then `default-minibuffer-frame' must be a frame whose minibuffer can 1094then `default-minibuffer-frame' must be a frame whose minibuffer can
1056be shared by the new frame. */) 1095be shared by the new frame.
1096
1097This function is an internal primitive--use `make-frame' instead. */)
1057 (Lisp_Object parms) 1098 (Lisp_Object parms)
1058{ 1099{
1059 static int desc_ctr = 1;
1060 struct frame *f; 1100 struct frame *f;
1061 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
1062 Lisp_Object frame, tem; 1101 Lisp_Object frame, tem;
1063 Lisp_Object name; 1102 Lisp_Object name;
1064 int minibuffer_only = 0; 1103 int minibuffer_only = 0;
1104 int window_prompting = 0;
1105 int width, height;
1065 ptrdiff_t count = specpdl_ptr - specpdl; 1106 ptrdiff_t count = specpdl_ptr - specpdl;
1107 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
1066 Lisp_Object display; 1108 Lisp_Object display;
1067 struct ns_display_info *dpyinfo = NULL; 1109 struct ns_display_info *dpyinfo = NULL;
1068 Lisp_Object parent; 1110 Lisp_Object parent;
1069 struct kboard *kb; 1111 struct kboard *kb;
1070 Lisp_Object tfont, tfontsize; 1112 Lisp_Object tfont, tfontsize;
1071 int window_prompting = 0; 1113 static int desc_ctr = 1;
1072 int width, height;
1073 1114
1074 check_ns (); 1115 check_ns ();
1075 1116
1076 /* Seems a little strange, but other terms do it. Perhaps the code below 1117 /* x_get_arg modifies parms. */
1077 is modifying something? */
1078 parms = Fcopy_alist (parms); 1118 parms = Fcopy_alist (parms);
1079 1119
1120 /* Use this general default value to start with
1121 until we know if this frame has a specified name. */
1122 Vx_resource_name = Vinvocation_name;
1123
1080 display = x_get_arg (dpyinfo, parms, Qterminal, 0, 0, RES_TYPE_STRING); 1124 display = x_get_arg (dpyinfo, parms, Qterminal, 0, 0, RES_TYPE_STRING);
1081 if (EQ (display, Qunbound)) 1125 if (EQ (display, Qunbound))
1082 display = Qnil; 1126 display = Qnil;
1083 dpyinfo = check_ns_display_info (display); 1127 dpyinfo = check_ns_display_info (display);
1128 kb = dpyinfo->terminal->kboard;
1084 1129
1085 if (!dpyinfo->terminal->name) 1130 if (!dpyinfo->terminal->name)
1086 error ("Terminal is not live, can't create new frames on it"); 1131 error ("Terminal is not live, can't create new frames on it");
1087 1132
1088 kb = dpyinfo->terminal->kboard;
1089
1090 name = x_get_arg (dpyinfo, parms, Qname, 0, 0, RES_TYPE_STRING); 1133 name = x_get_arg (dpyinfo, parms, Qname, 0, 0, RES_TYPE_STRING);
1091 if (!STRINGP (name) 1134 if (!STRINGP (name)
1092 && ! EQ (name, Qunbound) 1135 && ! EQ (name, Qunbound)
@@ -1095,8 +1138,6 @@ be shared by the new frame. */)
1095 1138
1096 if (STRINGP (name)) 1139 if (STRINGP (name))
1097 Vx_resource_name = name; 1140 Vx_resource_name = name;
1098 else
1099 Vx_resource_name = Vinvocation_name;
1100 1141
1101 parent = x_get_arg (dpyinfo, parms, Qparent_id, 0, 0, RES_TYPE_NUMBER); 1142 parent = x_get_arg (dpyinfo, parms, Qparent_id, 0, 0, RES_TYPE_NUMBER);
1102 if (EQ (parent, Qunbound)) 1143 if (EQ (parent, Qunbound))
@@ -1104,57 +1145,36 @@ be shared by the new frame. */)
1104 if (! NILP (parent)) 1145 if (! NILP (parent))
1105 CHECK_NUMBER (parent); 1146 CHECK_NUMBER (parent);
1106 1147
1148 /* make_frame_without_minibuffer can run Lisp code and garbage collect. */
1149 /* No need to protect DISPLAY because that's not used after passing
1150 it to make_frame_without_minibuffer. */
1107 frame = Qnil; 1151 frame = Qnil;
1108 GCPRO4 (parms, parent, name, frame); 1152 GCPRO4 (parms, parent, name, frame);
1109
1110 tem = x_get_arg (dpyinfo, parms, Qminibuffer, "minibuffer", "Minibuffer", 1153 tem = x_get_arg (dpyinfo, parms, Qminibuffer, "minibuffer", "Minibuffer",
1111 RES_TYPE_SYMBOL); 1154 RES_TYPE_SYMBOL);
1112 if (EQ (tem, Qnone) || NILP (tem)) 1155 if (EQ (tem, Qnone) || NILP (tem))
1113 {
1114 f = make_frame_without_minibuffer (Qnil, kb, display); 1156 f = make_frame_without_minibuffer (Qnil, kb, display);
1115 }
1116 else if (EQ (tem, Qonly)) 1157 else if (EQ (tem, Qonly))
1117 { 1158 {
1118 f = make_minibuffer_frame (); 1159 f = make_minibuffer_frame ();
1119 minibuffer_only = 1; 1160 minibuffer_only = 1;
1120 } 1161 }
1121 else if (WINDOWP (tem)) 1162 else if (WINDOWP (tem))
1122 {
1123 f = make_frame_without_minibuffer (tem, kb, display); 1163 f = make_frame_without_minibuffer (tem, kb, display);
1124 }
1125 else 1164 else
1126 {
1127 f = make_frame (1); 1165 f = make_frame (1);
1128 }
1129
1130 /* Set the name; the functions to which we pass f expect the name to
1131 be set. */
1132 if (EQ (name, Qunbound) || NILP (name) || (XTYPE (name) != Lisp_String))
1133 {
1134 f->name = build_string ([ns_app_name UTF8String]);
1135 f->explicit_name =0;
1136 }
1137 else
1138 {
1139 f->name = name;
1140 f->explicit_name = 1;
1141 specbind (Qx_resource_name, name);
1142 }
1143 1166
1144 XSETFRAME (frame, f); 1167 XSETFRAME (frame, f);
1145 FRAME_CAN_HAVE_SCROLL_BARS (f) = 1; 1168 FRAME_CAN_HAVE_SCROLL_BARS (f) = 1;
1146 1169
1147 f->terminal = dpyinfo->terminal; 1170 f->terminal = dpyinfo->terminal;
1148 f->terminal->reference_count++;
1149 1171
1150 f->output_method = output_ns; 1172 f->output_method = output_ns;
1151 f->output_data.ns = (struct ns_output *)xmalloc (sizeof *(f->output_data.ns)); 1173 f->output_data.ns = (struct ns_output *)xmalloc (sizeof *(f->output_data.ns));
1152 memset (f->output_data.ns, 0, sizeof (*(f->output_data.ns))); 1174 memset (f->output_data.ns, 0, sizeof *(f->output_data.ns));
1153 1175
1154 FRAME_FONTSET (f) = -1; 1176 FRAME_FONTSET (f) = -1;
1155 1177
1156 /* record_unwind_protect (unwind_create_frame, frame); safety; maybe later? */
1157
1158 f->icon_name = x_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title", 1178 f->icon_name = x_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title",
1159 RES_TYPE_STRING); 1179 RES_TYPE_STRING);
1160 if (! STRINGP (f->icon_name)) 1180 if (! STRINGP (f->icon_name))
@@ -1162,6 +1182,9 @@ be shared by the new frame. */)
1162 1182
1163 FRAME_NS_DISPLAY_INFO (f) = dpyinfo; 1183 FRAME_NS_DISPLAY_INFO (f) = dpyinfo;
1164 1184
1185 /* With FRAME_NS_DISPLAY_INFO set up, this unwind-protect is safe. */
1186 record_unwind_protect (unwind_create_frame, frame);
1187
1165 f->output_data.ns->window_desc = desc_ctr++; 1188 f->output_data.ns->window_desc = desc_ctr++;
1166 if (TYPE_RANGED_INTEGERP (Window, parent)) 1189 if (TYPE_RANGED_INTEGERP (Window, parent))
1167 { 1190 {
@@ -1174,6 +1197,20 @@ be shared by the new frame. */)
1174 f->output_data.ns->explicit_parent = 0; 1197 f->output_data.ns->explicit_parent = 0;
1175 } 1198 }
1176 1199
1200 /* Set the name; the functions to which we pass f expect the name to
1201 be set. */
1202 if (EQ (name, Qunbound) || NILP (name) || ! STRINGP (name))
1203 {
1204 f->name = build_string ([ns_app_name UTF8String]);
1205 f->explicit_name = 0;
1206 }
1207 else
1208 {
1209 f->name = name;
1210 f->explicit_name = 1;
1211 specbind (Qx_resource_name, name);
1212 }
1213
1177 f->resx = dpyinfo->resx; 1214 f->resx = dpyinfo->resx;
1178 f->resy = dpyinfo->resy; 1215 f->resy = dpyinfo->resy;
1179 1216
@@ -1223,11 +1260,15 @@ be shared by the new frame. */)
1223 "leftFringe", "LeftFringe", RES_TYPE_NUMBER); 1260 "leftFringe", "LeftFringe", RES_TYPE_NUMBER);
1224 x_default_parameter (f, parms, Qright_fringe, Qnil, 1261 x_default_parameter (f, parms, Qright_fringe, Qnil,
1225 "rightFringe", "RightFringe", RES_TYPE_NUMBER); 1262 "rightFringe", "RightFringe", RES_TYPE_NUMBER);
1226 /* end PENDING */ 1263
1264#if GLYPH_DEBUG
1265 image_cache_refcount =
1266 FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0;
1267#endif
1227 1268
1228 init_frame_faces (f); 1269 init_frame_faces (f);
1229 1270
1230 /* The X resources controlling the menu-bar and tool-bar are 1271 /* The resources controlling the menu-bar and tool-bar are
1231 processed specially at startup, and reflected in the mode 1272 processed specially at startup, and reflected in the mode
1232 variables; ignore them here. */ 1273 variables; ignore them here. */
1233 x_default_parameter (f, parms, Qmenu_bar_lines, 1274 x_default_parameter (f, parms, Qmenu_bar_lines,
@@ -1244,38 +1285,6 @@ be shared by the new frame. */)
1244 x_default_parameter (f, parms, Qtitle, Qnil, "title", "Title", 1285 x_default_parameter (f, parms, Qtitle, Qnil, "title", "Title",
1245 RES_TYPE_STRING); 1286 RES_TYPE_STRING);
1246 1287
1247/* TODO: other terms seem to get away w/o this complexity.. */
1248 if (NILP (Fassq (Qwidth, parms)))
1249 {
1250 Lisp_Object value
1251 = x_get_arg (dpyinfo, parms, Qwidth, "width", "Width",
1252 RES_TYPE_NUMBER);
1253 if (! EQ (value, Qunbound))
1254 parms = Fcons (Fcons (Qwidth, value), parms);
1255 }
1256 if (NILP (Fassq (Qheight, parms)))
1257 {
1258 Lisp_Object value
1259 = x_get_arg (dpyinfo, parms, Qheight, "height", "Height",
1260 RES_TYPE_NUMBER);
1261 if (! EQ (value, Qunbound))
1262 parms = Fcons (Fcons (Qheight, value), parms);
1263 }
1264 if (NILP (Fassq (Qleft, parms)))
1265 {
1266 Lisp_Object value
1267 = x_get_arg (dpyinfo, parms, Qleft, "left", "Left", RES_TYPE_NUMBER);
1268 if (! EQ (value, Qunbound))
1269 parms = Fcons (Fcons (Qleft, value), parms);
1270 }
1271 if (NILP (Fassq (Qtop, parms)))
1272 {
1273 Lisp_Object value
1274 = x_get_arg (dpyinfo, parms, Qtop, "top", "Top", RES_TYPE_NUMBER);
1275 if (! EQ (value, Qunbound))
1276 parms = Fcons (Fcons (Qtop, value), parms);
1277 }
1278
1279 window_prompting = x_figure_window_size (f, parms, 1); 1288 window_prompting = x_figure_window_size (f, parms, 1);
1280 1289
1281 tem = x_get_arg (dpyinfo, parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN); 1290 tem = x_get_arg (dpyinfo, parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN);
@@ -1297,23 +1306,27 @@ be shared by the new frame. */)
1297 1306
1298 x_icon (f, parms); 1307 x_icon (f, parms);
1299 1308
1309 /* ns_display_info does not have a reference_count. */
1310 f->terminal->reference_count++;
1311
1300 /* It is now ok to make the frame official even if we get an error below. 1312 /* It is now ok to make the frame official even if we get an error below.
1301 The frame needs to be on Vframe_list or making it visible won't work. */ 1313 The frame needs to be on Vframe_list or making it visible won't work. */
1302 Vframe_list = Fcons (frame, Vframe_list); 1314 Vframe_list = Fcons (frame, Vframe_list);
1303 /*FRAME_NS_DISPLAY_INFO (f)->reference_count++; */ 1315
1304 1316 x_default_parameter (f, parms, Qicon_type, Qnil,
1305 x_default_parameter (f, parms, Qicon_type, Qnil, "bitmapIcon", "BitmapIcon", 1317 "bitmapIcon", "BitmapIcon", RES_TYPE_SYMBOL);
1306 RES_TYPE_SYMBOL); 1318
1307 x_default_parameter (f, parms, Qauto_raise, Qnil, "autoRaise", "AutoRaiseLower", 1319 x_default_parameter (f, parms, Qauto_raise, Qnil,
1308 RES_TYPE_BOOLEAN); 1320 "autoRaise", "AutoRaiseLower", RES_TYPE_BOOLEAN);
1309 x_default_parameter (f, parms, Qauto_lower, Qnil, "autoLower", "AutoLower", 1321 x_default_parameter (f, parms, Qauto_lower, Qnil,
1310 RES_TYPE_BOOLEAN); 1322 "autoLower", "AutoLower", RES_TYPE_BOOLEAN);
1311 x_default_parameter (f, parms, Qcursor_type, Qbox, "cursorType", "CursorType", 1323 x_default_parameter (f, parms, Qcursor_type, Qbox,
1312 RES_TYPE_SYMBOL); 1324 "cursorType", "CursorType", RES_TYPE_SYMBOL);
1313 x_default_parameter (f, parms, Qscroll_bar_width, Qnil, "scrollBarWidth", 1325 x_default_parameter (f, parms, Qscroll_bar_width, Qnil,
1314 "ScrollBarWidth", RES_TYPE_NUMBER); 1326 "scrollBarWidth", "ScrollBarWidth",
1315 x_default_parameter (f, parms, Qalpha, Qnil, "alpha", "Alpha", 1327 RES_TYPE_NUMBER);
1316 RES_TYPE_NUMBER); 1328 x_default_parameter (f, parms, Qalpha, Qnil,
1329 "alpha", "Alpha", RES_TYPE_NUMBER);
1317 1330
1318 width = FRAME_COLS (f); 1331 width = FRAME_COLS (f);
1319 height = FRAME_LINES (f); 1332 height = FRAME_LINES (f);
@@ -1324,20 +1337,24 @@ be shared by the new frame. */)
1324 1337
1325 if (! f->output_data.ns->explicit_parent) 1338 if (! f->output_data.ns->explicit_parent)
1326 { 1339 {
1327 tem = x_get_arg (dpyinfo, parms, Qvisibility, 0, 0, RES_TYPE_SYMBOL); 1340 Lisp_Object visibility;
1328 if (EQ (tem, Qunbound)) 1341
1329 tem = Qt; 1342 visibility = x_get_arg (dpyinfo, parms, Qvisibility, 0, 0,
1330 x_set_visibility (f, tem, Qnil); 1343 RES_TYPE_SYMBOL);
1331 if (EQ (tem, Qicon)) 1344 if (EQ (visibility, Qunbound))
1345 visibility = Qt;
1346
1347 if (EQ (visibility, Qicon))
1332 x_iconify_frame (f); 1348 x_iconify_frame (f);
1333 else if (! NILP (tem)) 1349 else if (! NILP (visibility))
1334 { 1350 {
1335 x_make_frame_visible (f); 1351 x_make_frame_visible (f);
1336 f->async_visible = 1;
1337 [[FRAME_NS_VIEW (f) window] makeKeyWindow]; 1352 [[FRAME_NS_VIEW (f) window] makeKeyWindow];
1338 } 1353 }
1339 else 1354 else
1340 f->async_visible = 0; 1355 {
1356 /* Must have been Qnil. */
1357 }
1341 } 1358 }
1342 1359
1343 if (FRAME_HAS_MINIBUF_P (f) 1360 if (FRAME_HAS_MINIBUF_P (f)
@@ -1352,6 +1369,9 @@ be shared by the new frame. */)
1352 f->param_alist = Fcons (XCAR (tem), f->param_alist); 1369 f->param_alist = Fcons (XCAR (tem), f->param_alist);
1353 1370
1354 UNGCPRO; 1371 UNGCPRO;
1372
1373 /* Make sure windows on this frame appear in calls to next-window
1374 and similar functions. */
1355 Vwindow_list = Qnil; 1375 Vwindow_list = Qnil;
1356 1376
1357 return unbind_to (count, frame); 1377 return unbind_to (count, frame);
@@ -1636,7 +1656,7 @@ If omitted or nil, the selected frame's display is used. */)
1636 1656
1637DEFUN ("x-display-backing-store", Fx_display_backing_store, 1657DEFUN ("x-display-backing-store", Fx_display_backing_store,
1638 Sx_display_backing_store, 0, 1, 0, 1658 Sx_display_backing_store, 0, 1, 0,
1639 doc: /* Return whether the Nexstep display DISPLAY supports backing store. 1659 doc: /* Return whether the Nextstep display DISPLAY supports backing store.
1640The value may be `buffered', `retained', or `non-retained'. 1660The value may be `buffered', `retained', or `non-retained'.
1641DISPLAY should be a frame, the display name as a string, or a terminal ID. 1661DISPLAY should be a frame, the display name as a string, or a terminal ID.
1642If omitted or nil, the selected frame's display is used. */) 1662If omitted or nil, the selected frame's display is used. */)
@@ -1826,7 +1846,7 @@ DEFUN ("ns-emacs-info-panel", Fns_emacs_info_panel, Sns_emacs_info_panel,
1826 1846
1827 1847
1828DEFUN ("ns-font-name", Fns_font_name, Sns_font_name, 1, 1, 0, 1848DEFUN ("ns-font-name", Fns_font_name, Sns_font_name, 1, 1, 0,
1829 doc: /* Determine font postscript or family name for font NAME. 1849 doc: /* Determine font PostScript or family name for font NAME.
1830NAME should be a string containing either the font name or an XLFD 1850NAME should be a string containing either the font name or an XLFD
1831font descriptor. If string contains `fontset' and not 1851font descriptor. If string contains `fontset' and not
1832`fontset-startup', it is left alone. */) 1852`fontset-startup', it is left alone. */)
diff --git a/src/nsterm.h b/src/nsterm.h
index b54e182780a..574d31c962a 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -447,7 +447,7 @@ struct nsfont_info
447{ 447{
448 struct font font; 448 struct font font;
449 449
450 char *name; /* postscript name, uniquely identifies on NS systems */ 450 char *name; /* PostScript name, uniquely identifies on NS systems */
451 float width; /* this and following metrics stored as float rather than int */ 451 float width; /* this and following metrics stored as float rather than int */
452 float height; 452 float height;
453 float underpos; 453 float underpos;
diff --git a/src/nsterm.m b/src/nsterm.m
index a2ae5e69512..c5b28d57ac5 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -164,7 +164,7 @@ static Lisp_Object last_mouse_motion_frame;
164static EmacsScroller *last_mouse_scroll_bar = nil; 164static EmacsScroller *last_mouse_scroll_bar = nil;
165static struct frame *ns_updating_frame; 165static struct frame *ns_updating_frame;
166static NSView *focus_view = NULL; 166static NSView *focus_view = NULL;
167static int ns_window_num =0; 167static int ns_window_num = 0;
168static NSRect uRect; 168static NSRect uRect;
169static BOOL gsaved = NO; 169static BOOL gsaved = NO;
170BOOL ns_in_resize = NO; 170BOOL ns_in_resize = NO;
@@ -1123,12 +1123,10 @@ x_iconify_frame (struct frame *f)
1123 [[view window] miniaturize: NSApp]; 1123 [[view window] miniaturize: NSApp];
1124} 1124}
1125 1125
1126/* Free X resources of frame F. */
1126 1127
1127void 1128void
1128x_destroy_window (struct frame *f) 1129x_free_frame_resources (struct frame *f)
1129/* --------------------------------------------------------------------------
1130 External: Delete the window
1131 -------------------------------------------------------------------------- */
1132{ 1130{
1133 NSView *view = FRAME_NS_VIEW (f); 1131 NSView *view = FRAME_NS_VIEW (f);
1134 struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f); 1132 struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f);
@@ -1163,10 +1161,21 @@ x_destroy_window (struct frame *f)
1163 [[view window] close]; 1161 [[view window] close];
1164 [view release]; 1162 [view release];
1165 1163
1166 ns_window_num--;
1167 UNBLOCK_INPUT; 1164 UNBLOCK_INPUT;
1168} 1165}
1169 1166
1167void
1168x_destroy_window (struct frame *f)
1169/* --------------------------------------------------------------------------
1170 External: Delete the window
1171 -------------------------------------------------------------------------- */
1172{
1173 NSTRACE (x_destroy_window);
1174 check_ns ();
1175 x_free_frame_resources (f);
1176 ns_window_num--;
1177}
1178
1170 1179
1171void 1180void
1172x_set_offset (struct frame *f, int xoff, int yoff, int change_grav) 1181x_set_offset (struct frame *f, int xoff, int yoff, int change_grav)
@@ -3026,7 +3035,7 @@ ns_dumpglyphs_image (struct glyph_string *s, NSRect r)
3026 /* Currently on NS img->mask is always 0. Since 3035 /* Currently on NS img->mask is always 0. Since
3027 get_window_cursor_type specifies a hollow box cursor when on 3036 get_window_cursor_type specifies a hollow box cursor when on
3028 a non-masked image we never reach this clause. But we put it 3037 a non-masked image we never reach this clause. But we put it
3029 in in antipication of better support for image masks on 3038 in in anticipation of better support for image masks on
3030 NS. */ 3039 NS. */
3031 tdCol = ns_lookup_indexed_color (NS_FACE_FOREGROUND (face), s->f); 3040 tdCol = ns_lookup_indexed_color (NS_FACE_FOREGROUND (face), s->f);
3032 } 3041 }
@@ -4494,7 +4503,7 @@ ns_term_shutdown (int sig)
4494 //ns_app_active=YES; 4503 //ns_app_active=YES;
4495 4504
4496 ns_update_auto_hide_menu_bar (); 4505 ns_update_auto_hide_menu_bar ();
4497 // No constrining takes place when the application is not active. 4506 // No constraining takes place when the application is not active.
4498 ns_constrain_all_frames (); 4507 ns_constrain_all_frames ();
4499} 4508}
4500- (void)applicationDidResignActive: (NSNotification *)notification 4509- (void)applicationDidResignActive: (NSNotification *)notification
diff --git a/src/process.c b/src/process.c
index de2edad07bd..71da2e17670 100644
--- a/src/process.c
+++ b/src/process.c
@@ -3116,7 +3116,7 @@ usage: (make-network-process &rest ARGS) */)
3116 { 3116 {
3117 struct hostent *host_info_ptr; 3117 struct hostent *host_info_ptr;
3118 3118
3119 /* gethostbyname may fail with TRY_AGAIN, but we don't honour that, 3119 /* gethostbyname may fail with TRY_AGAIN, but we don't honor that,
3120 as it may `hang' Emacs for a very long time. */ 3120 as it may `hang' Emacs for a very long time. */
3121 immediate_quit = 1; 3121 immediate_quit = 1;
3122 QUIT; 3122 QUIT;
@@ -5363,8 +5363,8 @@ send_process (volatile Lisp_Object proc, const char *volatile buf,
5363 sending a multibyte text, thus we must encode it by the 5363 sending a multibyte text, thus we must encode it by the
5364 original coding system specified for the current process. 5364 original coding system specified for the current process.
5365 5365
5366 Another reason we comming here is that the coding system 5366 Another reason we come here is that the coding system
5367 was just complemented and new one was returned by 5367 was just complemented and a new one was returned by
5368 complement_process_encoding_system. */ 5368 complement_process_encoding_system. */
5369 setup_coding_system (p->encode_coding_system, coding); 5369 setup_coding_system (p->encode_coding_system, coding);
5370 Vlast_coding_system_used = p->encode_coding_system; 5370 Vlast_coding_system_used = p->encode_coding_system;
@@ -5373,6 +5373,7 @@ send_process (volatile Lisp_Object proc, const char *volatile buf,
5373 } 5373 }
5374 else 5374 else
5375 { 5375 {
5376 coding->src_multibyte = 0;
5376 /* For sending a unibyte text, character code conversion should 5377 /* For sending a unibyte text, character code conversion should
5377 not take place but EOL conversion should. So, setup raw-text 5378 not take place but EOL conversion should. So, setup raw-text
5378 or one of the subsidiary if we have not yet done it. */ 5379 or one of the subsidiary if we have not yet done it. */
diff --git a/src/ralloc.c b/src/ralloc.c
index 50d322523c1..62189ad8fc7 100644
--- a/src/ralloc.c
+++ b/src/ralloc.c
@@ -219,13 +219,13 @@ find_heap (POINTER address)
219 If enough space is not presently available in our reserve, this means 219 If enough space is not presently available in our reserve, this means
220 getting more page-aligned space from the system. If the returned space 220 getting more page-aligned space from the system. If the returned space
221 is not contiguous to the last heap, allocate a new heap, and append it 221 is not contiguous to the last heap, allocate a new heap, and append it
222 to the heap list.
222 223
223 obtain does not try to keep track of whether space is in use 224 obtain does not try to keep track of whether space is in use or not
224 or not in use. It just returns the address of SIZE bytes that 225 in use. It just returns the address of SIZE bytes that fall within a
225 fall within a single heap. If you call obtain twice in a row 226 single heap. If you call obtain twice in a row with the same arguments,
226 with the same arguments, you typically get the same value. 227 you typically get the same value. It's the caller's responsibility to
227 to the heap list. It's the caller's responsibility to keep 228 keep track of what space is in use.
228 track of what space is in use.
229 229
230 Return the address of the space if all went well, or zero if we couldn't 230 Return the address of the space if all went well, or zero if we couldn't
231 allocate the memory. */ 231 allocate the memory. */
@@ -389,7 +389,7 @@ find_bloc (POINTER *ptr)
389 while (p != NIL_BLOC) 389 while (p != NIL_BLOC)
390 { 390 {
391 /* Consistency check. Don't return inconsistent blocs. 391 /* Consistency check. Don't return inconsistent blocs.
392 Don't abort here, as callers might be expecting this, but 392 Don't abort here, as callers might be expecting this, but
393 callers that always expect a bloc to be returned should abort 393 callers that always expect a bloc to be returned should abort
394 if one isn't to avoid a memory corruption bug that is 394 if one isn't to avoid a memory corruption bug that is
395 difficult to track down. */ 395 difficult to track down. */
@@ -1180,7 +1180,7 @@ r_alloc_reset_variable (POINTER *old, POINTER *new)
1180 1180
1181 /* Find the bloc that corresponds to the data pointed to by pointer. 1181 /* Find the bloc that corresponds to the data pointed to by pointer.
1182 find_bloc cannot be used, as it has internal consistency checks 1182 find_bloc cannot be used, as it has internal consistency checks
1183 which fail when the variable needs reseting. */ 1183 which fail when the variable needs resetting. */
1184 while (bloc != NIL_BLOC) 1184 while (bloc != NIL_BLOC)
1185 { 1185 {
1186 if (bloc->data == *new) 1186 if (bloc->data == *new)
diff --git a/src/regex.c b/src/regex.c
index 8033ab9edaa..b7699378f5a 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -530,7 +530,11 @@ init_syntax_once (void)
530#define MIN(a, b) ((a) < (b) ? (a) : (b)) 530#define MIN(a, b) ((a) < (b) ? (a) : (b))
531 531
532/* Type of source-pattern and string chars. */ 532/* Type of source-pattern and string chars. */
533#ifdef _MSC_VER
534typedef unsigned char re_char;
535#else
533typedef const unsigned char re_char; 536typedef const unsigned char re_char;
537#endif
534 538
535typedef char boolean; 539typedef char boolean;
536#define false 0 540#define false 0
@@ -633,7 +637,7 @@ typedef enum
633 on_failure_jump_nastyloop, 637 on_failure_jump_nastyloop,
634 638
635 /* A smart `on_failure_jump' used for greedy * and + operators. 639 /* A smart `on_failure_jump' used for greedy * and + operators.
636 It analyses the loop before which it is put and if the 640 It analyzes the loop before which it is put and if the
637 loop does not require backtracking, it changes itself to 641 loop does not require backtracking, it changes itself to
638 `on_failure_keep_string_jump' and short-circuits the loop, 642 `on_failure_keep_string_jump' and short-circuits the loop,
639 else it just defaults to changing itself into `on_failure_jump'. 643 else it just defaults to changing itself into `on_failure_jump'.
diff --git a/src/regex.h b/src/regex.h
index 7747ec57629..eba62f2e769 100644
--- a/src/regex.h
+++ b/src/regex.h
@@ -415,7 +415,7 @@ struct re_pattern_buffer
415typedef struct re_pattern_buffer regex_t; 415typedef struct re_pattern_buffer regex_t;
416 416
417/* Type for byte offsets within the string. POSIX mandates this to be an int, 417/* Type for byte offsets within the string. POSIX mandates this to be an int,
418 but the Open Group has signalled its intention to change the requirement to 418 but the Open Group has signaled its intention to change the requirement to
419 be that regoff_t be at least as wide as ptrdiff_t and ssize_t. Current 419 be that regoff_t be at least as wide as ptrdiff_t and ssize_t. Current
420 gnulib sources also use ssize_t, and we need this for supporting buffers and 420 gnulib sources also use ssize_t, and we need this for supporting buffers and
421 strings > 2GB on 64-bit hosts. */ 421 strings > 2GB on 64-bit hosts. */
diff --git a/src/s/gnu.h b/src/s/gnu.h
index c40f764f8bf..b40f7b0a95b 100644
--- a/src/s/gnu.h
+++ b/src/s/gnu.h
@@ -44,3 +44,5 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
44#endif /* !_IO_STDIO_H */ 44#endif /* !_IO_STDIO_H */
45#endif /* emacs */ 45#endif /* emacs */
46 46
47/* Use the GC_MAKE_GCPROS_NOOPS (see lisp.h) method for marking the stack. */
48#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
diff --git a/src/s/hpux10-20.h b/src/s/hpux10-20.h
index 1cd91a41b55..37199bcc29b 100644
--- a/src/s/hpux10-20.h
+++ b/src/s/hpux10-20.h
@@ -89,7 +89,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
89#undef HAVE_RANDOM 89#undef HAVE_RANDOM
90 90
91 91
92/* Rainer Malzbender <rainer@displaytech.com> says definining 92/* Rainer Malzbender <rainer@displaytech.com> says defining
93 HAVE_XRMSETDATABASE allows Emacs to compile on HP-UX 10.20 using GCC. */ 93 HAVE_XRMSETDATABASE allows Emacs to compile on HP-UX 10.20 using GCC. */
94#ifndef HAVE_XRMSETDATABASE 94#ifndef HAVE_XRMSETDATABASE
95#define HAVE_XRMSETDATABASE 95#define HAVE_XRMSETDATABASE
diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h
index 813c3cef115..fb0882860d1 100644
--- a/src/s/ms-w32.h
+++ b/src/s/ms-w32.h
@@ -86,6 +86,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
86#define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_)) 86#define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))
87 87
88#include <sys/types.h> 88#include <sys/types.h>
89
90#ifdef _MSC_VER
91typedef unsigned long sigset_t;
92typedef int ssize_t;
93#endif
94
89struct sigaction { 95struct sigaction {
90 int sa_flags; 96 int sa_flags;
91 void (*sa_handler)(int); 97 void (*sa_handler)(int);
@@ -181,6 +187,17 @@ struct sigaction {
181 187
182#ifdef emacs 188#ifdef emacs
183 189
190#ifdef _MSC_VER
191#include <sys/timeb.h>
192#include <sys/stat.h>
193#include <signal.h>
194
195/* MSVC gets link-time errors without these redirections. */
196#define fstat(a, b) sys_fstat(a, b)
197#define stat(a, b) sys_stat(a, b)
198#define utime sys_utime
199#endif
200
184/* Calls that are emulated or shadowed. */ 201/* Calls that are emulated or shadowed. */
185#undef access 202#undef access
186#define access sys_access 203#define access sys_access
@@ -267,6 +284,7 @@ typedef int pid_t;
267 284
268#if !defined (_MSC_VER) || (_MSC_VER < 1400) 285#if !defined (_MSC_VER) || (_MSC_VER < 1400)
269#define tzname _tzname 286#define tzname _tzname
287#undef utime
270#define utime _utime 288#define utime _utime
271#endif 289#endif
272 290
@@ -317,13 +335,17 @@ extern char *get_emacs_configuration_options (void);
317#define _WINSOCK_H 335#define _WINSOCK_H
318 336
319/* Defines size_t and alloca (). */ 337/* Defines size_t and alloca (). */
320#ifdef USE_CRT_DLL 338#if (defined(_MSC_VER) && defined(emacs)) || defined(USE_CRT_DLL)
321#define malloc e_malloc 339#define malloc e_malloc
322#define free e_free 340#define free e_free
323#define realloc e_realloc 341#define realloc e_realloc
324#define calloc e_calloc 342#define calloc e_calloc
325#endif 343#endif
344#ifdef _MSC_VER
345#define alloca _alloca
346#else
326#include <malloc.h> 347#include <malloc.h>
348#endif
327 349
328#include <sys/stat.h> 350#include <sys/stat.h>
329 351
diff --git a/src/s/msdos.h b/src/s/msdos.h
index 29ca0629899..9ee13d12867 100644
--- a/src/s/msdos.h
+++ b/src/s/msdos.h
@@ -119,7 +119,7 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */
119#ifdef HAVE_X_WINDOWS 119#ifdef HAVE_X_WINDOWS
120/* We need a little extra space, see ../../lisp/loadup.el and the 120/* We need a little extra space, see ../../lisp/loadup.el and the
121 commentary below, in the non-X branch. The 140KB number was 121 commentary below, in the non-X branch. The 140KB number was
122 measured on GNU/Linux and on MS-WIndows. */ 122 measured on GNU/Linux and on MS-Windows. */
123#define SYSTEM_PURESIZE_EXTRA (-170000+140000) 123#define SYSTEM_PURESIZE_EXTRA (-170000+140000)
124#else 124#else
125/* We need a little extra space, see ../../lisp/loadup.el. 125/* We need a little extra space, see ../../lisp/loadup.el.
@@ -138,4 +138,3 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */
138 registers relevant for conservative garbage collection in the jmp_buf. */ 138 registers relevant for conservative garbage collection in the jmp_buf. */
139#define GC_SETJMP_WORKS 1 139#define GC_SETJMP_WORKS 1
140#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS 140#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
141
diff --git a/src/sound.c b/src/sound.c
index b95fa82202f..9e15caae3ea 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -226,7 +226,7 @@ struct sound_device
226 /* Close device SD. */ 226 /* Close device SD. */
227 void (* close) (struct sound_device *sd); 227 void (* close) (struct sound_device *sd);
228 228
229 /* Configure SD accoring to device-dependent parameters. */ 229 /* Configure SD according to device-dependent parameters. */
230 void (* configure) (struct sound_device *device); 230 void (* configure) (struct sound_device *device);
231 231
232 /* Choose a device-dependent format for outputting sound S. */ 232 /* Choose a device-dependent format for outputting sound S. */
diff --git a/src/syssignal.h b/src/syssignal.h
index 7533a5a64fd..315400d8498 100644
--- a/src/syssignal.h
+++ b/src/syssignal.h
@@ -39,7 +39,7 @@ extern sigset_t empty_mask;
39 39
40/* POSIX pretty much destroys any possibility of writing sigmask as a 40/* POSIX pretty much destroys any possibility of writing sigmask as a
41 macro in standard C. We always define our own version because the 41 macro in standard C. We always define our own version because the
42 predefined macro in Glibc 2.1 is only provided for compatility for old 42 predefined macro in Glibc 2.1 is only provided for compatibility for old
43 programs that use int as signal mask type. */ 43 programs that use int as signal mask type. */
44#undef sigmask 44#undef sigmask
45#ifdef __GNUC__ 45#ifdef __GNUC__
diff --git a/src/unexelf.c b/src/unexelf.c
index 979d6dce629..04c029f7e80 100644
--- a/src/unexelf.c
+++ b/src/unexelf.c
@@ -1019,7 +1019,7 @@ temacs:
1019 /* The conditional bit below was in Oliva's original code 1019 /* The conditional bit below was in Oliva's original code
1020 (1999-08-25) and seems to have been dropped by mistake 1020 (1999-08-25) and seems to have been dropped by mistake
1021 subsequently. It prevents a crash at startup under X in 1021 subsequently. It prevents a crash at startup under X in
1022 `IRIX64 6.5 6.5.17m', whether compiled on that relase or 1022 `IRIX64 6.5 6.5.17m', whether compiled on that release or
1023 an earlier one. It causes no trouble on the other ELF 1023 an earlier one. It causes no trouble on the other ELF
1024 platforms I could test (Irix 6.5.15m, Solaris 8, Debian 1024 platforms I could test (Irix 6.5.15m, Solaris 8, Debian
1025 Potato x86, Debian Woody SPARC); however, it's reported 1025 Potato x86, Debian Woody SPARC); however, it's reported
diff --git a/src/w32.c b/src/w32.c
index 42546fc8d49..b2b47dbd179 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -94,7 +94,9 @@ typedef struct _MEMORY_STATUS_EX {
94 94
95#include <tlhelp32.h> 95#include <tlhelp32.h>
96#include <psapi.h> 96#include <psapi.h>
97#ifndef _MSC_VER
97#include <w32api.h> 98#include <w32api.h>
99#endif
98#if !defined (__MINGW32__) || __W32API_MAJOR_VERSION < 3 || (__W32API_MAJOR_VERSION == 3 && __W32API_MINOR_VERSION < 15) 100#if !defined (__MINGW32__) || __W32API_MAJOR_VERSION < 3 || (__W32API_MAJOR_VERSION == 3 && __W32API_MINOR_VERSION < 15)
99/* This either is not in psapi.h or guarded by higher value of 101/* This either is not in psapi.h or guarded by higher value of
100 _WIN32_WINNT than what we use. w32api supplied with MinGW 3.15 102 _WIN32_WINNT than what we use. w32api supplied with MinGW 3.15
@@ -1547,7 +1549,12 @@ init_environment (char ** argv)
1547 read-only filesystem, like CD-ROM or a write-protected floppy. 1549 read-only filesystem, like CD-ROM or a write-protected floppy.
1548 The only way to be really sure is to actually create a file and 1550 The only way to be really sure is to actually create a file and
1549 see if it succeeds. But I think that's too much to ask. */ 1551 see if it succeeds. But I think that's too much to ask. */
1552#ifdef _MSC_VER
1553 /* MSVC's _access crashes with D_OK. */
1554 if (tmp && sys_access (tmp, D_OK) == 0)
1555#else
1550 if (tmp && _access (tmp, D_OK) == 0) 1556 if (tmp && _access (tmp, D_OK) == 0)
1557#endif
1551 { 1558 {
1552 char * var = alloca (strlen (tmp) + 8); 1559 char * var = alloca (strlen (tmp) + 8);
1553 sprintf (var, "TMPDIR=%s", tmp); 1560 sprintf (var, "TMPDIR=%s", tmp);
@@ -3396,7 +3403,7 @@ stat (const char * path, struct stat * buf)
3396 FILE_FLAG_BACKUP_SEMANTICS, NULL)) 3403 FILE_FLAG_BACKUP_SEMANTICS, NULL))
3397 != INVALID_HANDLE_VALUE) 3404 != INVALID_HANDLE_VALUE)
3398 { 3405 {
3399 /* This is more accurate in terms of gettting the correct number 3406 /* This is more accurate in terms of getting the correct number
3400 of links, but is quite slow (it is noticeable when Emacs is 3407 of links, but is quite slow (it is noticeable when Emacs is
3401 making a list of file name completions). */ 3408 making a list of file name completions). */
3402 BY_HANDLE_FILE_INFORMATION info; 3409 BY_HANDLE_FILE_INFORMATION info;
@@ -5777,7 +5784,10 @@ check_windows_init_file (void)
5777 it cannot find the Windows installation file. If this file does 5784 it cannot find the Windows installation file. If this file does
5778 not exist in the expected place, tell the user. */ 5785 not exist in the expected place, tell the user. */
5779 5786
5780 if (!noninteractive && !inhibit_window_system) 5787 if (!noninteractive && !inhibit_window_system
5788 /* Vload_path is not yet initialized when we are loading
5789 loadup.el. */
5790 && NILP (Vpurify_flag))
5781 { 5791 {
5782 Lisp_Object objs[2]; 5792 Lisp_Object objs[2];
5783 Lisp_Object full_load_path; 5793 Lisp_Object full_load_path;
diff --git a/src/w32fns.c b/src/w32fns.c
index 92fcac92c4e..aa4650dd7b2 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -140,8 +140,8 @@ struct MONITOR_INFO
140 DWORD dwFlags; 140 DWORD dwFlags;
141}; 141};
142 142
143/* Reportedly, VS 6 does not have this in its headers. */ 143/* Reportedly, MSVC does not have this in its headers. */
144#if defined (_MSC_VER) && _MSC_VER < 1300 144#ifdef _MSC_VER
145DECLARE_HANDLE(HMONITOR); 145DECLARE_HANDLE(HMONITOR);
146#endif 146#endif
147 147
@@ -2088,7 +2088,7 @@ w32_key_to_modifier (int key)
2088 key_mapping = Qnil; 2088 key_mapping = Qnil;
2089 } 2089 }
2090 2090
2091 /* NB. This code runs in the input thread, asychronously to the lisp 2091 /* NB. This code runs in the input thread, asynchronously to the lisp
2092 thread, so we must be careful to ensure access to lisp data is 2092 thread, so we must be careful to ensure access to lisp data is
2093 thread-safe. The following code is safe because the modifier 2093 thread-safe. The following code is safe because the modifier
2094 variable values are updated atomically from lisp and symbols are 2094 variable values are updated atomically from lisp and symbols are
@@ -3977,7 +3977,7 @@ x_make_gc (struct frame *f)
3977 3977
3978 3978
3979/* Handler for signals raised during x_create_frame and 3979/* Handler for signals raised during x_create_frame and
3980 x_create_top_frame. FRAME is the frame which is partially 3980 x_create_tip_frame. FRAME is the frame which is partially
3981 constructed. */ 3981 constructed. */
3982 3982
3983static Lisp_Object 3983static Lisp_Object
@@ -3986,13 +3986,14 @@ unwind_create_frame (Lisp_Object frame)
3986 struct frame *f = XFRAME (frame); 3986 struct frame *f = XFRAME (frame);
3987 3987
3988 /* If frame is ``official'', nothing to do. */ 3988 /* If frame is ``official'', nothing to do. */
3989 if (!CONSP (Vframe_list) || !EQ (XCAR (Vframe_list), frame)) 3989 if (NILP (Fmemq (frame, Vframe_list)))
3990 { 3990 {
3991#if GLYPH_DEBUG 3991#if GLYPH_DEBUG
3992 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); 3992 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f);
3993#endif 3993#endif
3994 3994
3995 x_free_frame_resources (f); 3995 x_free_frame_resources (f);
3996 free_glyphs (f);
3996 3997
3997#if GLYPH_DEBUG 3998#if GLYPH_DEBUG
3998 /* Check that reference counts are indeed correct. */ 3999 /* Check that reference counts are indeed correct. */
@@ -4134,7 +4135,6 @@ This function is an internal primitive--use `make-frame' instead. */)
4134 FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = GetSystemMetrics (SM_CXVSCROLL); 4135 FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = GetSystemMetrics (SM_CXVSCROLL);
4135 4136
4136 f->terminal = dpyinfo->terminal; 4137 f->terminal = dpyinfo->terminal;
4137 f->terminal->reference_count++;
4138 4138
4139 f->output_method = output_w32; 4139 f->output_method = output_w32;
4140 f->output_data.w32 = 4140 f->output_data.w32 =
@@ -4153,7 +4153,8 @@ This function is an internal primitive--use `make-frame' instead. */)
4153 /* With FRAME_X_DISPLAY_INFO set up, this unwind-protect is safe. */ 4153 /* With FRAME_X_DISPLAY_INFO set up, this unwind-protect is safe. */
4154 record_unwind_protect (unwind_create_frame, frame); 4154 record_unwind_protect (unwind_create_frame, frame);
4155#if GLYPH_DEBUG 4155#if GLYPH_DEBUG
4156 image_cache_refcount = FRAME_IMAGE_CACHE (f)->refcount; 4156 image_cache_refcount =
4157 FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0;
4157 dpyinfo_refcount = dpyinfo->reference_count; 4158 dpyinfo_refcount = dpyinfo->reference_count;
4158#endif /* GLYPH_DEBUG */ 4159#endif /* GLYPH_DEBUG */
4159 4160
@@ -4286,6 +4287,7 @@ This function is an internal primitive--use `make-frame' instead. */)
4286 x_make_gc (f); 4287 x_make_gc (f);
4287 4288
4288 /* Now consider the frame official. */ 4289 /* Now consider the frame official. */
4290 f->terminal->reference_count++;
4289 FRAME_W32_DISPLAY_INFO (f)->reference_count++; 4291 FRAME_W32_DISPLAY_INFO (f)->reference_count++;
4290 Vframe_list = Fcons (frame, Vframe_list); 4292 Vframe_list = Fcons (frame, Vframe_list);
4291 4293
@@ -5228,7 +5230,6 @@ x_create_tip_frame (struct w32_display_info *dpyinfo,
5228 from this point on, x_destroy_window might screw up reference 5230 from this point on, x_destroy_window might screw up reference
5229 counts etc. */ 5231 counts etc. */
5230 f->terminal = dpyinfo->terminal; 5232 f->terminal = dpyinfo->terminal;
5231 f->terminal->reference_count++;
5232 f->output_method = output_w32; 5233 f->output_method = output_w32;
5233 f->output_data.w32 = 5234 f->output_data.w32 =
5234 (struct w32_output *) xmalloc (sizeof (struct w32_output)); 5235 (struct w32_output *) xmalloc (sizeof (struct w32_output));
@@ -5238,7 +5239,8 @@ x_create_tip_frame (struct w32_display_info *dpyinfo,
5238 f->icon_name = Qnil; 5239 f->icon_name = Qnil;
5239 5240
5240#if GLYPH_DEBUG 5241#if GLYPH_DEBUG
5241 image_cache_refcount = FRAME_IMAGE_CACHE (f)->refcount; 5242 image_cache_refcount =
5243 FRAME_IMAGE_CACHE ? FRAME_IMAGE_CACHE (f)->refcount : 0;
5242 dpyinfo_refcount = dpyinfo->reference_count; 5244 dpyinfo_refcount = dpyinfo->reference_count;
5243#endif /* GLYPH_DEBUG */ 5245#endif /* GLYPH_DEBUG */
5244 FRAME_KBOARD (f) = kb; 5246 FRAME_KBOARD (f) = kb;
@@ -5379,15 +5381,16 @@ x_create_tip_frame (struct w32_display_info *dpyinfo,
5379 5381
5380 UNGCPRO; 5382 UNGCPRO;
5381 5383
5384 /* Now that the frame is official, it counts as a reference to
5385 its display. */
5386 FRAME_W32_DISPLAY_INFO (f)->reference_count++;
5387 f->terminal->reference_count++;
5388
5382 /* It is now ok to make the frame official even if we get an error 5389 /* It is now ok to make the frame official even if we get an error
5383 below. And the frame needs to be on Vframe_list or making it 5390 below. And the frame needs to be on Vframe_list or making it
5384 visible won't work. */ 5391 visible won't work. */
5385 Vframe_list = Fcons (frame, Vframe_list); 5392 Vframe_list = Fcons (frame, Vframe_list);
5386 5393
5387 /* Now that the frame is official, it counts as a reference to
5388 its display. */
5389 FRAME_W32_DISPLAY_INFO (f)->reference_count++;
5390
5391 /* Setting attributes of faces of the tooltip frame from resources 5394 /* Setting attributes of faces of the tooltip frame from resources
5392 and similar will increment face_change_count, which leads to the 5395 and similar will increment face_change_count, which leads to the
5393 clearing of all current matrices. Since this isn't necessary 5396 clearing of all current matrices. Since this isn't necessary
@@ -6706,7 +6709,7 @@ DEFUN ("default-printer-name", Fdefault_printer_name, Sdefault_printer_name,
6706 ClosePrinter (hPrn); 6709 ClosePrinter (hPrn);
6707 return Qnil; 6710 return Qnil;
6708 } 6711 }
6709 /* Call GetPrinter again with big enouth memory block */ 6712 /* Call GetPrinter again with big enough memory block. */
6710 err = GetPrinter (hPrn, 2, (LPBYTE)ppi2, dwNeeded, &dwReturned); 6713 err = GetPrinter (hPrn, 2, (LPBYTE)ppi2, dwNeeded, &dwReturned);
6711 ClosePrinter (hPrn); 6714 ClosePrinter (hPrn);
6712 if (!err) 6715 if (!err)
diff --git a/src/w32font.c b/src/w32font.c
index 6c1b4d0bc20..bd58e7e757b 100644
--- a/src/w32font.c
+++ b/src/w32font.c
@@ -330,7 +330,7 @@ w32font_list (Lisp_Object frame, Lisp_Object font_spec)
330 330
331/* w32 implementation of match for font backend. 331/* w32 implementation of match for font backend.
332 Return a font entity most closely matching with FONT_SPEC on 332 Return a font entity most closely matching with FONT_SPEC on
333 FRAME. The closeness is detemined by the font backend, thus 333 FRAME. The closeness is determined by the font backend, thus
334 `face-font-selection-order' is ignored here. */ 334 `face-font-selection-order' is ignored here. */
335static Lisp_Object 335static Lisp_Object
336w32font_match (Lisp_Object frame, Lisp_Object font_spec) 336w32font_match (Lisp_Object frame, Lisp_Object font_spec)
@@ -1284,14 +1284,23 @@ font_matches_spec (DWORD type, NEWTEXTMETRICEX *font,
1284 { 1284 {
1285 /* Only truetype fonts will have information about what 1285 /* Only truetype fonts will have information about what
1286 scripts they support. This probably means the user 1286 scripts they support. This probably means the user
1287 will have to force Emacs to use raster, postscript 1287 will have to force Emacs to use raster, PostScript
1288 or atm fonts for non-ASCII text. */ 1288 or ATM fonts for non-ASCII text. */
1289 if (type & TRUETYPE_FONTTYPE) 1289 if (type & TRUETYPE_FONTTYPE)
1290 { 1290 {
1291 Lisp_Object support 1291 Lisp_Object support
1292 = font_supported_scripts (&font->ntmFontSig); 1292 = font_supported_scripts (&font->ntmFontSig);
1293 if (! memq_no_quit (val, support)) 1293 if (! memq_no_quit (val, support))
1294 return 0; 1294 return 0;
1295
1296 /* Avoid using non-Japanese fonts for Japanese, even
1297 if they claim they are capable, due to known
1298 breakage in Vista and Windows 7 fonts
1299 (bug#6029). */
1300 if (EQ (val, Qkana)
1301 && (font->ntmTm.tmCharSet != SHIFTJIS_CHARSET
1302 || !(font->ntmFontSig.fsCsb[0] & CSB_JAPANESE)))
1303 return 0;
1295 } 1304 }
1296 else 1305 else
1297 { 1306 {
@@ -1455,7 +1464,7 @@ check_face_name (LOGFONT *font, char *full_name)
1455 /* Helvetica is mapped to Arial in Windows, but if a Type-1 Helvetica is 1464 /* Helvetica is mapped to Arial in Windows, but if a Type-1 Helvetica is
1456 installed, we run into problems with the Uniscribe backend which tries 1465 installed, we run into problems with the Uniscribe backend which tries
1457 to avoid non-truetype fonts, and ends up mixing the Type-1 Helvetica 1466 to avoid non-truetype fonts, and ends up mixing the Type-1 Helvetica
1458 with Arial's characteristics, since that attempt to use Truetype works 1467 with Arial's characteristics, since that attempt to use TrueType works
1459 some places, but not others. */ 1468 some places, but not others. */
1460 if (!xstrcasecmp (font->lfFaceName, "helvetica")) 1469 if (!xstrcasecmp (font->lfFaceName, "helvetica"))
1461 { 1470 {
@@ -1483,7 +1492,7 @@ check_face_name (LOGFONT *font, char *full_name)
1483 1492
1484 1493
1485/* Callback function for EnumFontFamiliesEx. 1494/* Callback function for EnumFontFamiliesEx.
1486 * Checks if a font matches everything we are trying to check agaist, 1495 * Checks if a font matches everything we are trying to check against,
1487 * and if so, adds it to a list. Both the data we are checking against 1496 * and if so, adds it to a list. Both the data we are checking against
1488 * and the list to which the fonts are added are passed in via the 1497 * and the list to which the fonts are added are passed in via the
1489 * lparam argument, in the form of a font_callback_data struct. */ 1498 * lparam argument, in the form of a font_callback_data struct. */
@@ -1507,7 +1516,7 @@ add_font_entity_to_list (ENUMLOGFONTEX *logical_font,
1507 /* For uniscribe backend, consider only truetype or opentype fonts 1516 /* For uniscribe backend, consider only truetype or opentype fonts
1508 that have some unicode coverage. */ 1517 that have some unicode coverage. */
1509 if (match_data->opentype_only 1518 if (match_data->opentype_only
1510 && ((!physical_font->ntmTm.ntmFlags & NTMFLAGS_OPENTYPE 1519 && ((!(physical_font->ntmTm.ntmFlags & NTMFLAGS_OPENTYPE)
1511 && !(font_type & TRUETYPE_FONTTYPE)) 1520 && !(font_type & TRUETYPE_FONTTYPE))
1512 || !is_unicode)) 1521 || !is_unicode))
1513 return 1; 1522 return 1;
@@ -1568,8 +1577,8 @@ add_font_entity_to_list (ENUMLOGFONTEX *logical_font,
1568 the bits for CJK ranges that include those characters. */ 1577 the bits for CJK ranges that include those characters. */
1569 else if (EQ (spec_charset, Qunicode_sip)) 1578 else if (EQ (spec_charset, Qunicode_sip))
1570 { 1579 {
1571 if (!physical_font->ntmFontSig.fsUsb[1] & 0x02000000 1580 if (!(physical_font->ntmFontSig.fsUsb[1] & 0x02000000)
1572 || !physical_font->ntmFontSig.fsUsb[1] & 0x28000000) 1581 || !(physical_font->ntmFontSig.fsUsb[1] & 0x28000000))
1573 return 1; 1582 return 1;
1574 } 1583 }
1575 1584
@@ -1577,8 +1586,16 @@ add_font_entity_to_list (ENUMLOGFONTEX *logical_font,
1577 1586
1578 /* If registry was specified, ensure it is reported as the same. */ 1587 /* If registry was specified, ensure it is reported as the same. */
1579 if (!NILP (spec_charset)) 1588 if (!NILP (spec_charset))
1580 ASET (entity, FONT_REGISTRY_INDEX, spec_charset); 1589 {
1581 1590 /* Avoid using non-Japanese fonts for Japanese, even if they
1591 claim they are capable, due to known breakage in Vista
1592 and Windows 7 fonts (bug#6029). */
1593 if (logical_font->elfLogFont.lfCharSet == SHIFTJIS_CHARSET
1594 && !(physical_font->ntmFontSig.fsCsb[0] & CSB_JAPANESE))
1595 return 1;
1596 else
1597 ASET (entity, FONT_REGISTRY_INDEX, spec_charset);
1598 }
1582 /* Otherwise if using the uniscribe backend, report ANSI and DEFAULT 1599 /* Otherwise if using the uniscribe backend, report ANSI and DEFAULT
1583 fonts as unicode and skip other charsets. */ 1600 fonts as unicode and skip other charsets. */
1584 else if (match_data->opentype_only) 1601 else if (match_data->opentype_only)
@@ -2204,7 +2221,7 @@ font_supported_scripts (FONTSIGNATURE * sig)
2204 so don't need to mark them separately. */ 2221 so don't need to mark them separately. */
2205 /* 1: Latin-1 supplement, 2: Latin Extended A, 3: Latin Extended B. */ 2222 /* 1: Latin-1 supplement, 2: Latin Extended A, 3: Latin Extended B. */
2206 SUBRANGE (4, Qphonetic); 2223 SUBRANGE (4, Qphonetic);
2207 /* 5: Spacing and tone modifiers, 6: Combining Diacriticals. */ 2224 /* 5: Spacing and tone modifiers, 6: Combining Diacritical Marks. */
2208 SUBRANGE (7, Qgreek); 2225 SUBRANGE (7, Qgreek);
2209 SUBRANGE (8, Qcoptic); 2226 SUBRANGE (8, Qcoptic);
2210 SUBRANGE (9, Qcyrillic); 2227 SUBRANGE (9, Qcyrillic);
@@ -2294,7 +2311,7 @@ font_supported_scripts (FONTSIGNATURE * sig)
2294 /* 115: Saurashtra, 116: Kayah Li, 117: Rejang. */ 2311 /* 115: Saurashtra, 116: Kayah Li, 117: Rejang. */
2295 SUBRANGE (118, Qcham); 2312 SUBRANGE (118, Qcham);
2296 /* 119: Ancient symbols, 120: Phaistos Disc. */ 2313 /* 119: Ancient symbols, 120: Phaistos Disc. */
2297 /* 121: Carian, Lycian, Lydian, 122: Dominos, Mah Jong tiles. */ 2314 /* 121: Carian, Lycian, Lydian, 122: Dominoes, Mahjong tiles. */
2298 /* 123-127: Reserved. */ 2315 /* 123-127: Reserved. */
2299 2316
2300 /* There isn't really a main symbol range, so include symbol if any 2317 /* There isn't really a main symbol range, so include symbol if any
diff --git a/src/w32font.h b/src/w32font.h
index 45c06897195..f77866b869f 100644
--- a/src/w32font.h
+++ b/src/w32font.h
@@ -20,8 +20,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20#define EMACS_W32FONT_H 20#define EMACS_W32FONT_H
21 21
22 22
23/* Bit 17 of ntmFlags in NEWTEXTMETRIC is set for Postscript OpenType fonts, 23/* Bit 17 of ntmFlags in NEWTEXTMETRIC is set for PostScript OpenType fonts,
24 bit 18 for Truetype OpenType fonts, bit 20 for Type1 fonts. */ 24 bit 18 for TrueType OpenType fonts, bit 20 for Type1 fonts. */
25#ifndef NTM_PS_OPENTYPE 25#ifndef NTM_PS_OPENTYPE
26#define NTM_PS_OPENTYPE 0x00020000 26#define NTM_PS_OPENTYPE 0x00020000
27#endif 27#endif
@@ -84,4 +84,3 @@ int uniscribe_check_otf (LOGFONT *font, Lisp_Object otf_spec);
84Lisp_Object intern_font_name (char *); 84Lisp_Object intern_font_name (char *);
85 85
86#endif 86#endif
87
diff --git a/src/w32menu.c b/src/w32menu.c
index 98b053a9e23..93194b68018 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -1443,7 +1443,7 @@ add_menu_item (HMENU menu, widget_value *wv, HMENU item)
1443 out_string = (char *) local_alloc (strlen (wv->name) + 1); 1443 out_string = (char *) local_alloc (strlen (wv->name) + 1);
1444 strcpy (out_string, wv->name); 1444 strcpy (out_string, wv->name);
1445#ifdef MENU_DEBUG 1445#ifdef MENU_DEBUG
1446 DebPrint ("Menu: allocing %ld for owner-draw", out_string); 1446 DebPrint ("Menu: allocating %ld for owner-draw", out_string);
1447#endif 1447#endif
1448 fuFlags = MF_OWNERDRAW | MF_DISABLED; 1448 fuFlags = MF_OWNERDRAW | MF_DISABLED;
1449 } 1449 }
diff --git a/src/w32proc.c b/src/w32proc.c
index 47cbf57d9ea..279816bcc3e 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -174,7 +174,7 @@ delete_child (child_process *cp)
174 cp->status = STATUS_READ_ERROR; 174 cp->status = STATUS_READ_ERROR;
175 SetEvent (cp->char_consumed); 175 SetEvent (cp->char_consumed);
176#if 0 176#if 0
177 /* We used to forceably terminate the thread here, but it 177 /* We used to forcibly terminate the thread here, but it
178 is normally unnecessary, and in abnormal cases, the worst that 178 is normally unnecessary, and in abnormal cases, the worst that
179 will happen is we have an extra idle thread hanging around 179 will happen is we have an extra idle thread hanging around
180 waiting for the zombie process. */ 180 waiting for the zombie process. */
@@ -241,7 +241,8 @@ reader_thread (void *arg)
241 241
242 /* We have to wait for the go-ahead before we can start */ 242 /* We have to wait for the go-ahead before we can start */
243 if (cp == NULL 243 if (cp == NULL
244 || WaitForSingleObject (cp->char_consumed, INFINITE) != WAIT_OBJECT_0) 244 || WaitForSingleObject (cp->char_consumed, INFINITE) != WAIT_OBJECT_0
245 || cp->fd < 0)
245 return 1; 246 return 1;
246 247
247 for (;;) 248 for (;;)
@@ -2295,7 +2296,7 @@ filesystems via ange-ftp. */);
2295 doc: /* Non-nil means attempt to fake realistic inode values. 2296 doc: /* Non-nil means attempt to fake realistic inode values.
2296This works by hashing the truename of files, and should detect 2297This works by hashing the truename of files, and should detect
2297aliasing between long and short (8.3 DOS) names, but can have 2298aliasing between long and short (8.3 DOS) names, but can have
2298false positives because of hash collisions. Note that determing 2299false positives because of hash collisions. Note that determining
2299the truename of a file can be slow. */); 2300the truename of a file can be slow. */);
2300 Vw32_generate_fake_inodes = Qnil; 2301 Vw32_generate_fake_inodes = Qnil;
2301#endif 2302#endif
@@ -2319,4 +2320,3 @@ where the performance impact may be noticeable even on modern hardware. */);
2319 staticpro (&Vw32_valid_codepages); 2320 staticpro (&Vw32_valid_codepages);
2320} 2321}
2321/* end of w32proc.c */ 2322/* end of w32proc.c */
2322
diff --git a/src/w32term.c b/src/w32term.c
index 39f1e245e18..e9fa16ba325 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -3287,7 +3287,7 @@ w32_mouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window,
3287 3287
3288/* Handle mouse button event on the tool-bar of frame F, at 3288/* Handle mouse button event on the tool-bar of frame F, at
3289 frame-relative coordinates X/Y. EVENT_TYPE is either ButtionPress 3289 frame-relative coordinates X/Y. EVENT_TYPE is either ButtionPress
3290 or ButtonRelase. */ 3290 or ButtonRelease. */
3291 3291
3292static void 3292static void
3293w32_handle_tool_bar_click (struct frame *f, struct input_event *button_event) 3293w32_handle_tool_bar_click (struct frame *f, struct input_event *button_event)
@@ -5690,15 +5690,15 @@ x_make_frame_visible (struct frame *f)
5690 5690
5691 f->output_data.w32->asked_for_visible = 1; 5691 f->output_data.w32->asked_for_visible = 1;
5692 5692
5693 /* The first of these seems to give more expected behavior, but 5693 /* According to a report in emacs-devel 2008-06-03, SW_SHOWNORMAL
5694 was added as a commented out line in Sept 1997, with the 5694 causes unexpected behavior when unminimizing frames that were
5695 second version remaining uncommented. There may have been 5695 previously maximised. But only SW_SHOWNORMAL works properly for
5696 some problem with it that led to it not being enabled, 5696 frames that were truely hidden (using make-frame-invisible), so
5697 so the old version remains commented out below in case we 5697 we need it to avoid Bug#5482. It seems that async_iconified
5698 decide we need to go back to it [23.0.60 2008-06-09]. */ 5698 is only set for minimised windows that are still visible, so
5699 use that to determine the appropriate flag to pass ShowWindow. */
5699 my_show_window (f, FRAME_W32_WINDOW (f), 5700 my_show_window (f, FRAME_W32_WINDOW (f),
5700 f->async_iconified ? SW_RESTORE : SW_SHOW); 5701 f->async_iconified ? SW_RESTORE : SW_SHOWNORMAL);
5701 /* my_show_window (f, FRAME_W32_WINDOW (f), SW_SHOWNORMAL); */
5702 } 5702 }
5703 5703
5704 /* Synchronize to ensure Emacs knows the frame is visible 5704 /* Synchronize to ensure Emacs knows the frame is visible
diff --git a/src/w32term.h b/src/w32term.h
index 710394583e4..02392133837 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -637,7 +637,7 @@ extern void x_delete_display (struct w32_display_info *dpyinfo);
637 637
638/* Keypad command key support. W32 doesn't have virtual keys defined 638/* Keypad command key support. W32 doesn't have virtual keys defined
639 for the function keys on the keypad (they are mapped to the standard 639 for the function keys on the keypad (they are mapped to the standard
640 fuction keys), so we define our own. */ 640 function keys), so we define our own. */
641#define VK_NUMPAD_BEGIN 0x92 641#define VK_NUMPAD_BEGIN 0x92
642#define VK_NUMPAD_CLEAR (VK_NUMPAD_BEGIN + 0) 642#define VK_NUMPAD_CLEAR (VK_NUMPAD_BEGIN + 0)
643#define VK_NUMPAD_ENTER (VK_NUMPAD_BEGIN + 1) 643#define VK_NUMPAD_ENTER (VK_NUMPAD_BEGIN + 1)
diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c
index f6347bb88f7..36197b3b28a 100644
--- a/src/w32uniscribe.c
+++ b/src/w32uniscribe.c
@@ -507,7 +507,7 @@ uniscribe_encode_char (struct font *font, int c)
507 if (SUCCEEDED (result) && nglyphs == 1) 507 if (SUCCEEDED (result) && nglyphs == 1)
508 { 508 {
509 /* Some fonts return .notdef glyphs instead of failing. 509 /* Some fonts return .notdef glyphs instead of failing.
510 (Truetype spec reserves glyph code 0 for .notdef) */ 510 (TrueType spec reserves glyph code 0 for .notdef) */
511 if (glyphs[0]) 511 if (glyphs[0])
512 code = glyphs[0]; 512 code = glyphs[0];
513 } 513 }
@@ -961,4 +961,3 @@ syms_of_w32uniscribe (void)
961 961
962 register_font_driver (&uniscribe_font_driver, NULL); 962 register_font_driver (&uniscribe_font_driver, NULL);
963} 963}
964
diff --git a/src/window.c b/src/window.c
index 5ed7db2c916..60d17c74de3 100644
--- a/src/window.c
+++ b/src/window.c
@@ -159,7 +159,8 @@ DEFUN ("windowp", Fwindowp, Swindowp, 1, 1, 0,
159 159
160DEFUN ("window-live-p", Fwindow_live_p, Swindow_live_p, 1, 1, 0, 160DEFUN ("window-live-p", Fwindow_live_p, Swindow_live_p, 1, 1, 0,
161 doc: /* Return t if OBJECT is a live window and nil otherwise. 161 doc: /* Return t if OBJECT is a live window and nil otherwise.
162A live window is a window that displays a buffer. */) 162A live window is a window that displays a buffer.
163Internal windows and deleted windows are not live. */)
163 (Lisp_Object object) 164 (Lisp_Object object)
164{ 165{
165 return WINDOW_LIVE_P (object) ? Qt : Qnil; 166 return WINDOW_LIVE_P (object) ? Qt : Qnil;
@@ -168,7 +169,7 @@ A live window is a window that displays a buffer. */)
168/* Frames and windows. */ 169/* Frames and windows. */
169DEFUN ("window-frame", Fwindow_frame, Swindow_frame, 1, 1, 0, 170DEFUN ("window-frame", Fwindow_frame, Swindow_frame, 1, 1, 0,
170 doc: /* Return the frame that window WINDOW is on. 171 doc: /* Return the frame that window WINDOW is on.
171WINDOW can be any window and defaults to the selected one. */) 172If WINDOW is omitted or nil, it defaults to the selected window. */)
172 (Lisp_Object window) 173 (Lisp_Object window)
173{ 174{
174 return decode_any_window (window)->frame; 175 return decode_any_window (window)->frame;
@@ -177,9 +178,8 @@ WINDOW can be any window and defaults to the selected one. */)
177DEFUN ("frame-root-window", Fframe_root_window, Sframe_root_window, 0, 1, 0, 178DEFUN ("frame-root-window", Fframe_root_window, Sframe_root_window, 0, 1, 0,
178 doc: /* Return the root window of FRAME-OR-WINDOW. 179 doc: /* Return the root window of FRAME-OR-WINDOW.
179If omitted, FRAME-OR-WINDOW defaults to the currently selected frame. 180If omitted, FRAME-OR-WINDOW defaults to the currently selected frame.
180Else if FRAME-OR-WINDOW denotes any window, return the root window of 181With a frame argument, return that frame's root window.
181that window's frame. If FRAME-OR-WINDOW denotes a live frame, return 182With a window argument, return the root window of that window's frame. */)
182the root window of that frame. */)
183 (Lisp_Object frame_or_window) 183 (Lisp_Object frame_or_window)
184{ 184{
185 Lisp_Object window; 185 Lisp_Object window;
@@ -198,9 +198,8 @@ the root window of that frame. */)
198} 198}
199 199
200DEFUN ("minibuffer-window", Fminibuffer_window, Sminibuffer_window, 0, 1, 0, 200DEFUN ("minibuffer-window", Fminibuffer_window, Sminibuffer_window, 0, 1, 0,
201 doc: /* Return the window used now for minibuffers. 201 doc: /* Return the minibuffer window for frame FRAME.
202If the optional argument FRAME is specified, return the minibuffer window 202If FRAME is omitted or nil, it defaults to the selected frame. */)
203used by that frame. */)
204 (Lisp_Object frame) 203 (Lisp_Object frame)
205{ 204{
206 if (NILP (frame)) 205 if (NILP (frame))
@@ -212,7 +211,7 @@ used by that frame. */)
212DEFUN ("window-minibuffer-p", Fwindow_minibuffer_p, 211DEFUN ("window-minibuffer-p", Fwindow_minibuffer_p,
213 Swindow_minibuffer_p, 0, 1, 0, 212 Swindow_minibuffer_p, 0, 1, 0,
214 doc: /* Return non-nil if WINDOW is a minibuffer window. 213 doc: /* Return non-nil if WINDOW is a minibuffer window.
215WINDOW can be any window and defaults to the selected one. */) 214If WINDOW is omitted or nil, it defaults to the selected window. */)
216 (Lisp_Object window) 215 (Lisp_Object window)
217{ 216{
218 return MINI_WINDOW_P (decode_any_window (window)) ? Qt : Qnil; 217 return MINI_WINDOW_P (decode_any_window (window)) ? Qt : Qnil;
@@ -409,44 +408,48 @@ buffer of the selected window before each command. */)
409} 408}
410 409
411DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0, 410DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0,
412 doc: /* Return the buffer that WINDOW is displaying. 411 doc: /* Return the buffer displayed in window WINDOW.
413WINDOW can be any window and defaults to the selected one. 412If WINDOW is omitted or nil, it defaults to the selected window.
414If WINDOW is an internal window return nil. */) 413Return nil for an internal window or a deleted window. */)
415 (Lisp_Object window) 414 (Lisp_Object window)
416{ 415{
417 return decode_any_window (window)->buffer; 416 return decode_any_window (window)->buffer;
418} 417}
419 418
420DEFUN ("window-parent", Fwindow_parent, Swindow_parent, 0, 1, 0, 419DEFUN ("window-parent", Fwindow_parent, Swindow_parent, 0, 1, 0,
421 doc: /* Return WINDOW's parent window. 420 doc: /* Return the parent window of window WINDOW.
422WINDOW can be any window and defaults to the selected one. 421If WINDOW is omitted or nil, it defaults to the selected window.
423Return nil if WINDOW has no parent. */) 422Return nil for a window with no parent (e.g. a root window). */)
424 (Lisp_Object window) 423 (Lisp_Object window)
425{ 424{
426 return decode_any_window (window)->parent; 425 return decode_any_window (window)->parent;
427} 426}
428 427
429DEFUN ("window-top-child", Fwindow_top_child, Swindow_top_child, 0, 1, 0, 428DEFUN ("window-top-child", Fwindow_top_child, Swindow_top_child, 1, 1, 0,
430 doc: /* Return WINDOW's topmost child window. 429 doc: /* Return the topmost child window of window WINDOW.
431WINDOW can be any window and defaults to the selected one. 430Return nil if WINDOW is a live window (live windows have no children).
432Return nil if WINDOW is not a vertical combination. */) 431Return nil if WINDOW is an internal window whose children form a
432horizontal combination. */)
433 (Lisp_Object window) 433 (Lisp_Object window)
434{ 434{
435 CHECK_WINDOW (window);
435 return decode_any_window (window)->vchild; 436 return decode_any_window (window)->vchild;
436} 437}
437 438
438DEFUN ("window-left-child", Fwindow_left_child, Swindow_left_child, 0, 1, 0, 439DEFUN ("window-left-child", Fwindow_left_child, Swindow_left_child, 1, 1, 0,
439 doc: /* Return WINDOW's leftmost child window. 440 doc: /* Return the leftmost child window of window WINDOW.
440WINDOW can be any window and defaults to the selected one. 441Return nil if WINDOW is a live window (live windows have no children).
441Return nil if WINDOW is not a horizontal combination. */) 442Return nil if WINDOW is an internal window whose children form a
443vertical combination. */)
442 (Lisp_Object window) 444 (Lisp_Object window)
443{ 445{
446 CHECK_WINDOW (window);
444 return decode_any_window (window)->hchild; 447 return decode_any_window (window)->hchild;
445} 448}
446 449
447DEFUN ("window-next-sibling", Fwindow_next_sibling, Swindow_next_sibling, 0, 1, 0, 450DEFUN ("window-next-sibling", Fwindow_next_sibling, Swindow_next_sibling, 0, 1, 0,
448 doc: /* Return WINDOW's next sibling window. 451 doc: /* Return the next sibling window of window WINDOW.
449WINDOW can be any window and defaults to the selected one. 452If WINDOW is omitted or nil, it defaults to the selected window.
450Return nil if WINDOW has no next sibling. */) 453Return nil if WINDOW has no next sibling. */)
451 (Lisp_Object window) 454 (Lisp_Object window)
452{ 455{
@@ -454,123 +457,96 @@ Return nil if WINDOW has no next sibling. */)
454} 457}
455 458
456DEFUN ("window-prev-sibling", Fwindow_prev_sibling, Swindow_prev_sibling, 0, 1, 0, 459DEFUN ("window-prev-sibling", Fwindow_prev_sibling, Swindow_prev_sibling, 0, 1, 0,
457 doc: /* Return WINDOW's previous sibling window. 460 doc: /* Return the previous sibling window of window WINDOW.
458WINDOW can be any window and defaults to the selected one. 461If WINDOW is omitted or nil, it defaults to the selected window.
459Return nil if WINDOW has no previous sibling. */) 462Return nil if WINDOW has no previous sibling. */)
460 (Lisp_Object window) 463 (Lisp_Object window)
461{ 464{
462 return decode_any_window (window)->prev; 465 return decode_any_window (window)->prev;
463} 466}
464 467
465DEFUN ("window-splits", Fwindow_splits, Swindow_splits, 0, 1, 0, 468DEFUN ("window-combination-limit", Fwindow_combination_limit, Swindow_combination_limit, 0, 1, 0,
466 doc: /* Return splits status for WINDOW. 469 doc: /* Return combination limit of window WINDOW.
467WINDOW can be any window and defaults to the selected one. 470If WINDOW is omitted or nil, it defaults to the selected window.
468
469If the value returned by this function is nil and WINDOW is resized, the
470corresponding space is preferably taken from (or given to) WINDOW's
471right sibling. When WINDOW is deleted, its space is given to its left
472sibling.
473 471
474If the value returned by this function is non-nil, resizing and deleting 472If the return value is nil, child windows of WINDOW can be recombined with
475WINDOW may resize all windows in the same combination. */) 473WINDOW's siblings. A return value of t means that child windows of
474WINDOW are never \(re-)combined with WINDOW's siblings. */)
476 (Lisp_Object window) 475 (Lisp_Object window)
477{ 476{
478 return decode_any_window (window)->splits; 477 return decode_any_window (window)->combination_limit;
479} 478}
480 479
481DEFUN ("set-window-splits", Fset_window_splits, Sset_window_splits, 2, 2, 0, 480DEFUN ("set-window-combination-limit", Fset_window_combination_limit, Sset_window_combination_limit, 2, 2, 0,
482 doc: /* Set splits status of WINDOW to STATUS. 481 doc: /* Set combination limit of window WINDOW to STATUS; return STATUS.
483WINDOW can be any window and defaults to the selected one. Return 482If WINDOW is omitted or nil, it defaults to the selected window.
484STATUS.
485 483
486If STATUS is nil and WINDOW is later resized, the corresponding space is 484If STATUS is nil, child windows of WINDOW can be recombined with
487preferably taken from (or given to) WINDOW's right sibling. When WINDOW 485WINDOW's siblings. STATUS t means that child windows of WINDOW are
488is deleted, its space is given to its left sibling. 486never \(re-)combined with WINDOW's siblings. Other values are reserved
489 487for future use. */)
490If STATUS is non-nil, resizing and deleting WINDOW may resize all
491windows in the same combination. */)
492 (Lisp_Object window, Lisp_Object status) 488 (Lisp_Object window, Lisp_Object status)
493{ 489{
494 register struct window *w = decode_any_window (window); 490 register struct window *w = decode_any_window (window);
495 491
496 w->splits = status; 492 w->combination_limit = status;
497 493
498 return w->splits; 494 return w->combination_limit;
499} 495}
500 496
501DEFUN ("window-nest", Fwindow_nest, Swindow_nest, 0, 1, 0, 497DEFUN ("window-use-time", Fwindow_use_time, Swindow_use_time, 0, 1, 0,
502 doc: /* Return nest status of WINDOW. 498 doc: /* Return the use time of window WINDOW.
503WINDOW can be any window and defaults to the selected one. 499If WINDOW is omitted or nil, it defaults to the selected window.
504 500The window with the highest use time is the most recently selected
505If the return value is nil, subwindows of WINDOW can be recombined with 501one. The window with the lowest use time is the least recently
506WINDOW's siblings. A return value of non-nil means that subwindows of 502selected one. */)
507WINDOW are never \(re-)combined with WINDOW's siblings. */)
508 (Lisp_Object window) 503 (Lisp_Object window)
509{ 504{
510 return decode_any_window (window)->nest; 505 return decode_window (window)->use_time;
511} 506}
507
508DEFUN ("window-total-height", Fwindow_total_height, Swindow_total_height, 0, 1, 0,
509 doc: /* Return the total height, in lines, of window WINDOW.
510If WINDOW is omitted or nil, it defaults to the selected window.
512 511
513DEFUN ("set-window-nest", Fset_window_nest, Sset_window_nest, 2, 2, 0, 512The return value includes the mode line and header line, if any.
514 doc: /* Set nest status of WINDOW to STATUS. 513If WINDOW is an internal window, the total height is the height
515WINDOW can be any window and defaults to the selected one. Return 514of the screen areas spanned by its children.
516STATUS.
517 515
518If STATUS is nil, subwindows of WINDOW can be recombined with WINDOW's 516On a graphical display, this total height is reported as an
519siblings. STATUS non-nil means that subwindows of WINDOW are never 517integer multiple of the default character height. */)
520\(re-)combined with WINDOW's siblings. */) 518 (Lisp_Object window)
521 (Lisp_Object window, Lisp_Object status)
522{ 519{
523 register struct window *w = decode_any_window (window); 520 return decode_any_window (window)->total_lines;
521}
524 522
525 w->nest = status; 523DEFUN ("window-total-width", Fwindow_total_width, Swindow_total_width, 0, 1, 0,
524 doc: /* Return the total width, in columns, of window WINDOW.
525If WINDOW is omitted or nil, it defaults to the selected window.
526 526
527 return w->nest; 527The return value includes any vertical dividers or scroll bars
528} 528belonging to WINDOW. If WINDOW is an internal window, the total width
529is the width of the screen areas spanned by its children.
529 530
530DEFUN ("window-use-time", Fwindow_use_time, Swindow_use_time, 0, 1, 0, 531On a graphical display, this total width is reported as an
531 doc: /* Return WINDOW's use time. 532integer multiple of the default character width. */)
532WINDOW defaults to the selected window. The window with the highest use
533time is the most recently selected one. The window with the lowest use
534time is the least recently selected one. */)
535 (Lisp_Object window) 533 (Lisp_Object window)
536{ 534{
537 return decode_window (window)->use_time; 535 return decode_any_window (window)->total_cols;
538}
539
540DEFUN ("window-total-size", Fwindow_total_size, Swindow_total_size, 0, 2, 0,
541 doc: /* Return the total number of lines of WINDOW.
542WINDOW can be any window and defaults to the selected one. The return
543value includes WINDOW's mode line and header line, if any. If WINDOW
544is internal, the return value is the sum of the total number of lines
545of WINDOW's child windows if these are vertically combined and the
546height of WINDOW's first child otherwise.
547
548Optional argument HORIZONTAL non-nil means return the total number of
549columns of WINDOW. In this case the return value includes any vertical
550dividers or scrollbars of WINDOW. If WINDOW is internal, the return
551value is the sum of the total number of columns of WINDOW's child
552windows if they are horizontally combined and the width of WINDOW's
553first child otherwise. */)
554 (Lisp_Object window, Lisp_Object horizontal)
555{
556 if (NILP (horizontal))
557 return decode_any_window (window)->total_lines;
558 else
559 return decode_any_window (window)->total_cols;
560} 536}
561 537
562DEFUN ("window-new-total", Fwindow_new_total, Swindow_new_total, 0, 1, 0, 538DEFUN ("window-new-total", Fwindow_new_total, Swindow_new_total, 0, 1, 0,
563 doc: /* Return new total size of WINDOW. 539 doc: /* Return the new total size of window WINDOW.
564WINDOW defaults to the selected window. */) 540If WINDOW is omitted or nil, it defaults to the selected window. */)
565 (Lisp_Object window) 541 (Lisp_Object window)
566{ 542{
567 return decode_any_window (window)->new_total; 543 return decode_any_window (window)->new_total;
568} 544}
569 545
570DEFUN ("window-normal-size", Fwindow_normal_size, Swindow_normal_size, 0, 2, 0, 546DEFUN ("window-normal-size", Fwindow_normal_size, Swindow_normal_size, 0, 2, 0,
571 doc: /* Return normal height of WINDOW. 547 doc: /* Return the normal height of window WINDOW.
572WINDOW can be any window and defaults to the selected one. Optional 548If WINDOW is omitted or nil, it defaults to the selected window.
573argument HORIZONTAL non-nil means return normal width of WINDOW. */) 549If HORIZONTAL is non-nil, return the normal width of WINDOW. */)
574 (Lisp_Object window, Lisp_Object horizontal) 550 (Lisp_Object window, Lisp_Object horizontal)
575{ 551{
576 if (NILP (horizontal)) 552 if (NILP (horizontal))
@@ -580,24 +556,32 @@ argument HORIZONTAL non-nil means return normal width of WINDOW. */)
580} 556}
581 557
582DEFUN ("window-new-normal", Fwindow_new_normal, Swindow_new_normal, 0, 1, 0, 558DEFUN ("window-new-normal", Fwindow_new_normal, Swindow_new_normal, 0, 1, 0,
583 doc: /* Return new normal size of WINDOW. 559 doc: /* Return new normal size of window WINDOW.
584WINDOW can be any window and defaults to the selected one. */) 560If WINDOW is omitted or nil, it defaults to the selected window. */)
585 (Lisp_Object window) 561 (Lisp_Object window)
586{ 562{
587 return decode_any_window (window)->new_normal; 563 return decode_any_window (window)->new_normal;
588} 564}
589 565
590DEFUN ("window-left-column", Fwindow_left_column, Swindow_left_column, 0, 1, 0, 566DEFUN ("window-left-column", Fwindow_left_column, Swindow_left_column, 0, 1, 0,
591 doc: /* Return left column of WINDOW. 567 doc: /* Return left column of window WINDOW.
592WINDOW can be any window and defaults to the selected one. */) 568This is the distance, in columns, between the left edge of WINDOW and
569the left edge of the frame's window area. For instance, the return
570value is 0 if there is no window to the left of WINDOW.
571
572If WINDOW is omitted or nil, it defaults to the selected window. */)
593 (Lisp_Object window) 573 (Lisp_Object window)
594{ 574{
595 return decode_any_window (window)->left_col; 575 return decode_any_window (window)->left_col;
596} 576}
597 577
598DEFUN ("window-top-line", Fwindow_top_line, Swindow_top_line, 0, 1, 0, 578DEFUN ("window-top-line", Fwindow_top_line, Swindow_top_line, 0, 1, 0,
599 doc: /* Return top line of WINDOW. 579 doc: /* Return top line of window WINDOW.
600WINDOW can be any window and defaults to the selected one. */) 580This is the distance, in lines, between the top of WINDOW and the top
581of the frame's window area. For instance, the return value is 0 if
582there is no window above WINDOW.
583
584If WINDOW is omitted or nil, it defaults to the selected window. */)
601 (Lisp_Object window) 585 (Lisp_Object window)
602{ 586{
603 return decode_any_window (window)->top_line; 587 return decode_any_window (window)->top_line;
@@ -652,25 +636,34 @@ window_body_cols (struct window *w)
652 return width; 636 return width;
653} 637}
654 638
655DEFUN ("window-body-size", Fwindow_body_size, Swindow_body_size, 0, 2, 0, 639DEFUN ("window-body-height", Fwindow_body_height, Swindow_body_height, 0, 1, 0,
656 doc: /* Return the number of lines of WINDOW's body. 640 doc: /* Return the height, in lines, of WINDOW's text area.
657WINDOW must be a live window and defaults to the selected one. The 641If WINDOW is omitted or nil, it defaults to the selected window.
658return value does not include WINDOW's mode line and header line, if 642Signal an error if the window is not live.
659any. 643
660 644The returned height does not include the mode line or header line.
661Optional argument HORIZONTAL non-nil means return the number of columns 645On a graphical display, the height is expressed as an integer multiple
662of WINDOW's body. In this case, the return value does not include any 646of the default character height. If a line at the bottom of the text
663vertical dividers or scroll bars owned by WINDOW. On a window-system 647area is only partially visible, that counts as a whole line; to
664the return value does not include the number of columns used for 648exclude partially-visible lines, use `window-text-height'. */)
665WINDOW's fringes or display margins either. */) 649 (Lisp_Object window)
666 (Lisp_Object window, Lisp_Object horizontal)
667{ 650{
668 struct window *w = decode_any_window (window); 651 struct window *w = decode_window (window);
652 return make_number (window_body_lines (w));
653}
669 654
670 if (NILP (horizontal)) 655DEFUN ("window-body-width", Fwindow_body_width, Swindow_body_width, 0, 1, 0,
671 return make_number (window_body_lines (w)); 656 doc: /* Return the width, in columns, of WINDOW's text area.
672 else 657If WINDOW is omitted or nil, it defaults to the selected window.
673 return make_number (window_body_cols (w)); 658Signal an error if the window is not live.
659
660The return value does not include any vertical dividers, fringe or
661marginal areas, or scroll bars. On a graphical display, the width is
662expressed as an integer multiple of the default character width. */)
663 (Lisp_Object window)
664{
665 struct window *w = decode_window (window);
666 return make_number (window_body_cols (w));
674} 667}
675 668
676DEFUN ("window-hscroll", Fwindow_hscroll, Swindow_hscroll, 0, 1, 0, 669DEFUN ("window-hscroll", Fwindow_hscroll, Swindow_hscroll, 0, 1, 0,
@@ -832,7 +825,7 @@ The inside edges do not include the space used by the WINDOW's scroll
832bar, display margins, fringes, header line, and/or mode line. */) 825bar, display margins, fringes, header line, and/or mode line. */)
833 (Lisp_Object window) 826 (Lisp_Object window)
834{ 827{
835 register struct window *w = decode_any_window (window); 828 register struct window *w = decode_window (window);
836 829
837 return list4 (make_number (WINDOW_BOX_LEFT_EDGE_COL (w) 830 return list4 (make_number (WINDOW_BOX_LEFT_EDGE_COL (w)
838 + WINDOW_LEFT_MARGIN_COLS (w) 831 + WINDOW_LEFT_MARGIN_COLS (w)
@@ -847,9 +840,9 @@ bar, display margins, fringes, header line, and/or mode line. */)
847} 840}
848 841
849DEFUN ("window-inside-pixel-edges", Fwindow_inside_pixel_edges, Swindow_inside_pixel_edges, 0, 1, 0, 842DEFUN ("window-inside-pixel-edges", Fwindow_inside_pixel_edges, Swindow_inside_pixel_edges, 0, 1, 0,
850 doc: /* Return a list of the edge pixel coordinates of WINDOW. 843 doc: /* Return a list of the edge pixel coordinates of WINDOW's text area.
851The list has the form (LEFT TOP RIGHT BOTTOM), all relative to 0, 0 at 844The list has the form (LEFT TOP RIGHT BOTTOM), all relative to (0,0)
852the top left corner of the frame. 845at the top left corner of the frame's window area.
853 846
854RIGHT is one more than the rightmost x position of WINDOW's text area. 847RIGHT is one more than the rightmost x position of WINDOW's text area.
855BOTTOM is one more than the bottommost y position of WINDOW's text area. 848BOTTOM is one more than the bottommost y position of WINDOW's text area.
@@ -857,7 +850,7 @@ The inside edges do not include the space used by WINDOW's scroll bar,
857display margins, fringes, header line, and/or mode line. */) 850display margins, fringes, header line, and/or mode line. */)
858 (Lisp_Object window) 851 (Lisp_Object window)
859{ 852{
860 register struct window *w = decode_any_window (window); 853 register struct window *w = decode_window (window);
861 854
862 return list4 (make_number (WINDOW_BOX_LEFT_EDGE_X (w) 855 return list4 (make_number (WINDOW_BOX_LEFT_EDGE_X (w)
863 + WINDOW_LEFT_MARGIN_WIDTH (w) 856 + WINDOW_LEFT_MARGIN_WIDTH (w)
@@ -874,9 +867,9 @@ display margins, fringes, header line, and/or mode line. */)
874DEFUN ("window-inside-absolute-pixel-edges", 867DEFUN ("window-inside-absolute-pixel-edges",
875 Fwindow_inside_absolute_pixel_edges, 868 Fwindow_inside_absolute_pixel_edges,
876 Swindow_inside_absolute_pixel_edges, 0, 1, 0, 869 Swindow_inside_absolute_pixel_edges, 0, 1, 0,
877 doc: /* Return a list of the edge pixel coordinates of WINDOW. 870 doc: /* Return a list of the edge pixel coordinates of WINDOW's text area.
878The list has the form (LEFT TOP RIGHT BOTTOM), all relative to 0, 0 at 871The list has the form (LEFT TOP RIGHT BOTTOM), all relative to (0,0)
879the top left corner of the display. 872at the top left corner of the frame's window area.
880 873
881RIGHT is one more than the rightmost x position of WINDOW's text area. 874RIGHT is one more than the rightmost x position of WINDOW's text area.
882BOTTOM is one more than the bottommost y position of WINDOW's text area. 875BOTTOM is one more than the bottommost y position of WINDOW's text area.
@@ -884,7 +877,7 @@ The inside edges do not include the space used by WINDOW's scroll bar,
884display margins, fringes, header line, and/or mode line. */) 877display margins, fringes, header line, and/or mode line. */)
885 (Lisp_Object window) 878 (Lisp_Object window)
886{ 879{
887 register struct window *w = decode_any_window (window); 880 register struct window *w = decode_window (window);
888 int add_x, add_y; 881 int add_x, add_y;
889 calc_absolute_offset (w, &add_x, &add_y); 882 calc_absolute_offset (w, &add_x, &add_y);
890 883
@@ -1888,7 +1881,7 @@ recombine_windows (Lisp_Object window)
1888 1881
1889 w = XWINDOW (window); 1882 w = XWINDOW (window);
1890 parent = w->parent; 1883 parent = w->parent;
1891 if (!NILP (parent) && NILP (w->nest)) 1884 if (!NILP (parent) && NILP (w->combination_limit))
1892 { 1885 {
1893 p = XWINDOW (parent); 1886 p = XWINDOW (parent);
1894 if (((!NILP (p->vchild) && !NILP (w->vchild)) 1887 if (((!NILP (p->vchild) && !NILP (w->vchild))
@@ -2303,7 +2296,7 @@ window_list_1 (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames)
2303DEFUN ("window-list", Fwindow_list, Swindow_list, 0, 3, 0, 2296DEFUN ("window-list", Fwindow_list, Swindow_list, 0, 3, 0,
2304 doc: /* Return a list of windows on FRAME, starting with WINDOW. 2297 doc: /* Return a list of windows on FRAME, starting with WINDOW.
2305FRAME nil or omitted means use the selected frame. 2298FRAME nil or omitted means use the selected frame.
2306WINDOW nil or omitted means use the selected window. 2299WINDOW nil or omitted means use the window selected within FRAME.
2307MINIBUF t means include the minibuffer window, even if it isn't active. 2300MINIBUF t means include the minibuffer window, even if it isn't active.
2308MINIBUF nil or omitted means include the minibuffer window only 2301MINIBUF nil or omitted means include the minibuffer window only
2309if it's active. 2302if it's active.
@@ -2353,7 +2346,7 @@ Anything else means consider all windows on WINDOW's frame and no
2353others. 2346others.
2354 2347
2355If WINDOW is not on the list of windows returned, some other window will 2348If WINDOW is not on the list of windows returned, some other window will
2356be listed first but no error is signalled. */) 2349be listed first but no error is signaled. */)
2357 (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames) 2350 (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames)
2358{ 2351{
2359 return window_list_1 (window, minibuf, all_frames); 2352 return window_list_1 (window, minibuf, all_frames);
@@ -2560,9 +2553,9 @@ DEFUN ("delete-other-windows-internal", Fdelete_other_windows_internal,
2560Only the frame WINDOW is on is affected. WINDOW may be any window and 2553Only the frame WINDOW is on is affected. WINDOW may be any window and
2561defaults to the selected one. 2554defaults to the selected one.
2562 2555
2563Optional argument ROOT, if non-nil, must specify an internal window 2556Optional argument ROOT, if non-nil, must specify an internal window such
2564containing WINDOW as a subwindow. If this is the case, replace ROOT by 2557that WINDOW is in its window subtree. If this is the case, replace ROOT
2565WINDOW and leave alone any windows not contained in ROOT. 2558by WINDOW and leave alone any windows not part of ROOT's subtree.
2566 2559
2567When WINDOW is live try to reduce display jumps by keeping the text 2560When WINDOW is live try to reduce display jumps by keeping the text
2568previously visible in WINDOW in the same place on the frame. Doing this 2561previously visible in WINDOW in the same place on the frame. Doing this
@@ -2626,10 +2619,10 @@ window-start value is reasonable when this function is called. */)
2626 } 2619 }
2627 else 2620 else
2628 { 2621 {
2629 /* See if the frame's selected window is a subwindow of WINDOW, by 2622 /* See if the frame's selected window is a part of the window
2630 finding all the selected window's parents and comparing each 2623 subtree rooted at WINDOW, by finding all the selected window's
2631 one with WINDOW. If it isn't we need a new selected window for 2624 parents and comparing each one with WINDOW. If it isn't we
2632 this frame. */ 2625 need a new selected window for this frame. */
2633 swindow = FRAME_SELECTED_WINDOW (f); 2626 swindow = FRAME_SELECTED_WINDOW (f);
2634 while (1) 2627 while (1)
2635 { 2628 {
@@ -2665,7 +2658,7 @@ window-start value is reasonable when this function is called. */)
2665 2658
2666 if (NILP (w->buffer)) 2659 if (NILP (w->buffer))
2667 { 2660 {
2668 /* Resize subwindows vertically. */ 2661 /* Resize child windows vertically. */
2669 XSETINT (delta, XINT (r->total_lines) - XINT (w->total_lines)); 2662 XSETINT (delta, XINT (r->total_lines) - XINT (w->total_lines));
2670 w->top_line = r->top_line; 2663 w->top_line = r->top_line;
2671 resize_root_window (window, delta, Qnil, Qnil); 2664 resize_root_window (window, delta, Qnil, Qnil);
@@ -2680,7 +2673,7 @@ window-start value is reasonable when this function is called. */)
2680 resize_failed = 1; 2673 resize_failed = 1;
2681 } 2674 }
2682 2675
2683 /* Resize subwindows horizontally. */ 2676 /* Resize child windows horizontally. */
2684 if (!resize_failed) 2677 if (!resize_failed)
2685 { 2678 {
2686 w->left_col = r->left_col; 2679 w->left_col = r->left_col;
@@ -2729,23 +2722,20 @@ window-start value is reasonable when this function is called. */)
2729 XWINDOW (w->parent)->hchild = sibling; 2722 XWINDOW (w->parent)->hchild = sibling;
2730 } 2723 }
2731 2724
2732 /* Delete ROOT and all subwindows of ROOT. */ 2725 /* Delete ROOT and all child windows of ROOT. */
2733 if (!NILP (r->vchild)) 2726 if (!NILP (r->vchild))
2734 { 2727 {
2735 delete_all_subwindows (r->vchild); 2728 delete_all_child_windows (r->vchild);
2736 r->vchild = Qnil; 2729 r->vchild = Qnil;
2737 } 2730 }
2738 else if (!NILP (r->hchild)) 2731 else if (!NILP (r->hchild))
2739 { 2732 {
2740 delete_all_subwindows (r->hchild); 2733 delete_all_child_windows (r->hchild);
2741 r->hchild = Qnil; 2734 r->hchild = Qnil;
2742 } 2735 }
2743 2736
2744 replace_window (root, window, 1); 2737 replace_window (root, window, 1);
2745 2738
2746 /* Reset WINDOW's splits status. */
2747 w->splits = Qnil;
2748
2749 /* This must become SWINDOW anyway ....... */ 2739 /* This must become SWINDOW anyway ....... */
2750 if (!NILP (w->buffer) && !resize_failed) 2740 if (!NILP (w->buffer) && !resize_failed)
2751 { 2741 {
@@ -3260,8 +3250,7 @@ make_parent_window (Lisp_Object window, int horflag)
3260 p->start = Qnil; 3250 p->start = Qnil;
3261 p->pointm = Qnil; 3251 p->pointm = Qnil;
3262 p->buffer = Qnil; 3252 p->buffer = Qnil;
3263 p->splits = Qnil; 3253 p->combination_limit = Qnil;
3264 p->nest = Qnil;
3265 p->window_parameters = Qnil; 3254 p->window_parameters = Qnil;
3266} 3255}
3267 3256
@@ -3308,7 +3297,7 @@ make_window (void)
3308 w->start_at_line_beg = w->display_table = w->dedicated = Qnil; 3297 w->start_at_line_beg = w->display_table = w->dedicated = Qnil;
3309 w->base_line_number = w->base_line_pos = w->region_showing = Qnil; 3298 w->base_line_number = w->base_line_pos = w->region_showing = Qnil;
3310 w->column_number_displayed = w->redisplay_end_trigger = Qnil; 3299 w->column_number_displayed = w->redisplay_end_trigger = Qnil;
3311 w->splits = w->nest = w->window_parameters = Qnil; 3300 w->combination_limit = w->window_parameters = Qnil;
3312 w->prev_buffers = w->next_buffers = Qnil; 3301 w->prev_buffers = w->next_buffers = Qnil;
3313 /* Initialize non-Lisp data. */ 3302 /* Initialize non-Lisp data. */
3314 w->desired_matrix = w->current_matrix = 0; 3303 w->desired_matrix = w->current_matrix = 0;
@@ -3338,7 +3327,7 @@ Return SIZE.
3338Optional argument ADD non-nil means add SIZE to the new total size of 3327Optional argument ADD non-nil means add SIZE to the new total size of
3339WINDOW and return the sum. 3328WINDOW and return the sum.
3340 3329
3341Note: This function does not operate on any subwindows of WINDOW. */) 3330Note: This function does not operate on any child windows of WINDOW. */)
3342 (Lisp_Object window, Lisp_Object size, Lisp_Object add) 3331 (Lisp_Object window, Lisp_Object size, Lisp_Object add)
3343{ 3332{
3344 struct window *w = decode_any_window (window); 3333 struct window *w = decode_any_window (window);
@@ -3356,7 +3345,7 @@ DEFUN ("set-window-new-normal", Fset_window_new_normal, Sset_window_new_normal,
3356 doc: /* Set new normal size of WINDOW to SIZE. 3345 doc: /* Set new normal size of WINDOW to SIZE.
3357Return SIZE. 3346Return SIZE.
3358 3347
3359Note: This function does not operate on any subwindows of WINDOW. */) 3348Note: This function does not operate on any child windows of WINDOW. */)
3360 (Lisp_Object window, Lisp_Object size) 3349 (Lisp_Object window, Lisp_Object size)
3361{ 3350{
3362 struct window *w = decode_any_window (window); 3351 struct window *w = decode_any_window (window);
@@ -3367,7 +3356,7 @@ Note: This function does not operate on any subwindows of WINDOW. */)
3367 3356
3368/* Return 1 if setting w->total_lines (w->total_cols if HORFLAG is 3357/* Return 1 if setting w->total_lines (w->total_cols if HORFLAG is
3369 non-zero) to w->new_total would result in correct heights (widths) 3358 non-zero) to w->new_total would result in correct heights (widths)
3370 for window W and recursively all subwindows of W. 3359 for window W and recursively all child windows of W.
3371 3360
3372 Note: This function does not check any of `window-fixed-size-p', 3361 Note: This function does not check any of `window-fixed-size-p',
3373 `window-min-height' or `window-min-width'. It does check that window 3362 `window-min-height' or `window-min-width'. It does check that window
@@ -3382,7 +3371,7 @@ window_resize_check (struct window *w, int horflag)
3382 { 3371 {
3383 c = XWINDOW (w->vchild); 3372 c = XWINDOW (w->vchild);
3384 if (horflag) 3373 if (horflag)
3385 /* All subwindows of W must have the same width as W. */ 3374 /* All child windows of W must have the same width as W. */
3386 { 3375 {
3387 while (c) 3376 while (c)
3388 { 3377 {
@@ -3394,8 +3383,8 @@ window_resize_check (struct window *w, int horflag)
3394 return 1; 3383 return 1;
3395 } 3384 }
3396 else 3385 else
3397 /* The sum of the heights of the subwindows of W must equal W's 3386 /* The sum of the heights of the child windows of W must equal
3398 height. */ 3387 W's height. */
3399 { 3388 {
3400 int sum_of_sizes = 0; 3389 int sum_of_sizes = 0;
3401 while (c) 3390 while (c)
@@ -3413,7 +3402,7 @@ window_resize_check (struct window *w, int horflag)
3413 { 3402 {
3414 c = XWINDOW (w->hchild); 3403 c = XWINDOW (w->hchild);
3415 if (horflag) 3404 if (horflag)
3416 /* The sum of the widths of the subwindows of W must equal W's 3405 /* The sum of the widths of the child windows of W must equal W's
3417 width. */ 3406 width. */
3418 { 3407 {
3419 int sum_of_sizes = 0; 3408 int sum_of_sizes = 0;
@@ -3427,7 +3416,7 @@ window_resize_check (struct window *w, int horflag)
3427 return (sum_of_sizes == XINT (w->new_total)); 3416 return (sum_of_sizes == XINT (w->new_total));
3428 } 3417 }
3429 else 3418 else
3430 /* All subwindows of W must have the same height as W. */ 3419 /* All child windows of W must have the same height as W. */
3431 { 3420 {
3432 while (c) 3421 while (c)
3433 { 3422 {
@@ -3447,9 +3436,9 @@ window_resize_check (struct window *w, int horflag)
3447} 3436}
3448 3437
3449/* Set w->total_lines (w->total_cols if HORIZONTAL is non-zero) to 3438/* Set w->total_lines (w->total_cols if HORIZONTAL is non-zero) to
3450 w->new_total for window W and recursively all subwindows of W. Also 3439 w->new_total for window W and recursively all child windows of W.
3451 calculate and assign the new vertical (horizontal) start positions of 3440 Also calculate and assign the new vertical (horizontal) start
3452 each of these windows. 3441 positions of each of these windows.
3453 3442
3454 This function does not perform any error checks. Make sure you have 3443 This function does not perform any error checks. Make sure you have
3455 run window_resize_check on W before applying this function. */ 3444 run window_resize_check on W before applying this function. */
@@ -3523,8 +3512,8 @@ Optional argument HORIZONTAL omitted or nil means apply requested height
3523values. HORIZONTAL non-nil means apply requested width values. 3512values. HORIZONTAL non-nil means apply requested width values.
3524 3513
3525This function checks whether the requested values sum up to a valid 3514This function checks whether the requested values sum up to a valid
3526window layout, recursively assigns the new sizes of all subwindows and 3515window layout, recursively assigns the new sizes of all child windows
3527calculates and assigns the new start positions of these windows. 3516and calculates and assigns the new start positions of these windows.
3528 3517
3529Note: This function does not check any of `window-fixed-size-p', 3518Note: This function does not check any of `window-fixed-size-p',
3530`window-min-height' or `window-min-width'. All these checks have to 3519`window-min-height' or `window-min-width'. All these checks have to
@@ -3681,7 +3670,7 @@ set correctly. See the code of `split-window' for how this is done. */)
3681 int horflag 3670 int horflag
3682 /* HORFLAG is 1 when we split side-by-side, 0 otherwise. */ 3671 /* HORFLAG is 1 when we split side-by-side, 0 otherwise. */
3683 = EQ (side, Qt) || EQ (side, Qleft) || EQ (side, Qright); 3672 = EQ (side, Qt) || EQ (side, Qleft) || EQ (side, Qright);
3684 int do_nest = 0; 3673 int combination_limit = 0;
3685 3674
3686 CHECK_WINDOW (old); 3675 CHECK_WINDOW (old);
3687 o = XWINDOW (old); 3676 o = XWINDOW (old);
@@ -3690,11 +3679,11 @@ set correctly. See the code of `split-window' for how this is done. */)
3690 3679
3691 CHECK_NUMBER (total_size); 3680 CHECK_NUMBER (total_size);
3692 3681
3693 /* Set do_nest to 1 if we have to make a new parent window. We do 3682 /* Set combination_limit to 1 if we have to make a new parent window.
3694 that if either `window-nest' is non-nil, or OLD has no parent, or 3683 We do that if either `window-combination-limit' is t, or OLD has no
3695 OLD is ortho-combined. */ 3684 parent, or OLD is ortho-combined. */
3696 do_nest = 3685 combination_limit =
3697 !NILP (Vwindow_nest) 3686 !NILP (Vwindow_combination_limit)
3698 || NILP (o->parent) 3687 || NILP (o->parent)
3699 || NILP (horflag 3688 || NILP (horflag
3700 ? (XWINDOW (o->parent)->hchild) 3689 ? (XWINDOW (o->parent)->hchild)
@@ -3714,8 +3703,8 @@ set correctly. See the code of `split-window' for how this is done. */)
3714 error ("Attempt to split minibuffer window"); 3703 error ("Attempt to split minibuffer window");
3715 else if (XINT (total_size) < (horflag ? 2 : 1)) 3704 else if (XINT (total_size) < (horflag ? 2 : 1))
3716 error ("Size of new window too small (after split)"); 3705 error ("Size of new window too small (after split)");
3717 else if (!do_nest && !NILP (Vwindow_splits)) 3706 else if (!combination_limit && !NILP (Vwindow_combination_resize))
3718 /* `window-splits' non-nil means try to resize OLD's siblings 3707 /* `window-combination-resize' non-nil means try to resize OLD's siblings
3719 proportionally. */ 3708 proportionally. */
3720 { 3709 {
3721 p = XWINDOW (o->parent); 3710 p = XWINDOW (o->parent);
@@ -3739,7 +3728,7 @@ set correctly. See the code of `split-window' for how this is done. */)
3739 } 3728 }
3740 3729
3741 /* This is our point of no return. */ 3730 /* This is our point of no return. */
3742 if (do_nest) 3731 if (combination_limit)
3743 { 3732 {
3744 /* Save the old value of o->normal_cols/lines. It gets corrupted 3733 /* Save the old value of o->normal_cols/lines. It gets corrupted
3745 by make_parent_window and we need it below for assigning it to 3734 by make_parent_window and we need it below for assigning it to
@@ -3748,12 +3737,9 @@ set correctly. See the code of `split-window' for how this is done. */)
3748 3737
3749 make_parent_window (old, horflag); 3738 make_parent_window (old, horflag);
3750 p = XWINDOW (o->parent); 3739 p = XWINDOW (o->parent);
3751 /* Store value of `window-nest' in new parent's nest slot. */ 3740 /* Store value of `window-combination-limit' in new parent's
3752 p->nest = Vwindow_nest; 3741 combination_limit slot. */
3753 /* Have PARENT inherit splits slot value from OLD. */ 3742 p->combination_limit = Vwindow_combination_limit;
3754 p->splits = o->splits;
3755 /* Store value of `window-splits' in OLD's splits slot. */
3756 o->splits = Vwindow_splits;
3757 /* These get applied below. */ 3743 /* These get applied below. */
3758 p->new_total = horflag ? o->total_cols : o->total_lines; 3744 p->new_total = horflag ? o->total_cols : o->total_lines;
3759 p->new_normal = new_normal; 3745 p->new_normal = new_normal;
@@ -3804,9 +3790,6 @@ set correctly. See the code of `split-window' for how this is done. */)
3804 n->scroll_bar_width = r->scroll_bar_width; 3790 n->scroll_bar_width = r->scroll_bar_width;
3805 n->vertical_scroll_bar_type = r->vertical_scroll_bar_type; 3791 n->vertical_scroll_bar_type = r->vertical_scroll_bar_type;
3806 3792
3807 /* Store `window-splits' in NEW's splits slot. */
3808 n->splits = Vwindow_splits;
3809
3810 /* Directly assign orthogonal coordinates and sizes. */ 3793 /* Directly assign orthogonal coordinates and sizes. */
3811 if (horflag) 3794 if (horflag)
3812 { 3795 {
@@ -3920,12 +3903,12 @@ Signal an error when WINDOW is the only window on its frame. */)
3920 3903
3921 if (!NILP (w->vchild)) 3904 if (!NILP (w->vchild))
3922 { 3905 {
3923 delete_all_subwindows (w->vchild); 3906 delete_all_child_windows (w->vchild);
3924 w->vchild = Qnil; 3907 w->vchild = Qnil;
3925 } 3908 }
3926 else if (!NILP (w->hchild)) 3909 else if (!NILP (w->hchild))
3927 { 3910 {
3928 delete_all_subwindows (w->hchild); 3911 delete_all_child_windows (w->hchild);
3929 w->hchild = Qnil; 3912 w->hchild = Qnil;
3930 } 3913 }
3931 else if (!NILP (w->buffer)) 3914 else if (!NILP (w->buffer))
@@ -3943,10 +3926,9 @@ Signal an error when WINDOW is the only window on its frame. */)
3943 /* Put SIBLING into PARENT's place. */ 3926 /* Put SIBLING into PARENT's place. */
3944 replace_window (parent, sibling, 0); 3927 replace_window (parent, sibling, 0);
3945 /* Have SIBLING inherit the following three slot values from 3928 /* Have SIBLING inherit the following three slot values from
3946 PARENT (the nest slot is not inherited). */ 3929 PARENT (the combination_limit slot is not inherited). */
3947 s->normal_cols = p->normal_cols; 3930 s->normal_cols = p->normal_cols;
3948 s->normal_lines = p->normal_lines; 3931 s->normal_lines = p->normal_lines;
3949 s->splits = p->splits;
3950 /* Mark PARENT as deleted. */ 3932 /* Mark PARENT as deleted. */
3951 p->vchild = p->hchild = Qnil; 3933 p->vchild = p->hchild = Qnil;
3952 /* Try to merge SIBLING into its new parent. */ 3934 /* Try to merge SIBLING into its new parent. */
@@ -5208,10 +5190,10 @@ and redisplay normally--don't erase and redraw the frame. */)
5208DEFUN ("window-text-height", Fwindow_text_height, Swindow_text_height, 5190DEFUN ("window-text-height", Fwindow_text_height, Swindow_text_height,
5209 0, 1, 0, 5191 0, 1, 0,
5210 doc: /* Return the height in lines of the text display area of WINDOW. 5192 doc: /* Return the height in lines of the text display area of WINDOW.
5211WINDOW defaults to the selected window. 5193If WINDOW is omitted or nil, it defaults to the selected window.
5212 5194
5213The return value does not include the mode line, any header line, nor 5195The returned height does not include the mode line, any header line,
5214any partial-height lines in the text display area. */) 5196nor any partial-height lines at the bottom of the text area. */)
5215 (Lisp_Object window) 5197 (Lisp_Object window)
5216{ 5198{
5217 struct window *w = decode_window (window); 5199 struct window *w = decode_window (window);
@@ -5334,7 +5316,7 @@ struct saved_window
5334 Lisp_Object left_margin_cols, right_margin_cols; 5316 Lisp_Object left_margin_cols, right_margin_cols;
5335 Lisp_Object left_fringe_width, right_fringe_width, fringes_outside_margins; 5317 Lisp_Object left_fringe_width, right_fringe_width, fringes_outside_margins;
5336 Lisp_Object scroll_bar_width, vertical_scroll_bar_type, dedicated; 5318 Lisp_Object scroll_bar_width, vertical_scroll_bar_type, dedicated;
5337 Lisp_Object splits, nest, window_parameters; 5319 Lisp_Object combination_limit, window_parameters;
5338}; 5320};
5339 5321
5340#define SAVED_WINDOW_N(swv,n) \ 5322#define SAVED_WINDOW_N(swv,n) \
@@ -5505,7 +5487,7 @@ the return value is nil. Otherwise the value is t. */)
5505 Save their current buffers in their height fields, since we may 5487 Save their current buffers in their height fields, since we may
5506 need it later, if a buffer saved in the configuration is now 5488 need it later, if a buffer saved in the configuration is now
5507 dead. */ 5489 dead. */
5508 delete_all_subwindows (FRAME_ROOT_WINDOW (f)); 5490 delete_all_child_windows (FRAME_ROOT_WINDOW (f));
5509 5491
5510 for (k = 0; k < saved_windows->header.size; k++) 5492 for (k = 0; k < saved_windows->header.size; k++)
5511 { 5493 {
@@ -5565,8 +5547,7 @@ the return value is nil. Otherwise the value is t. */)
5565 w->scroll_bar_width = p->scroll_bar_width; 5547 w->scroll_bar_width = p->scroll_bar_width;
5566 w->vertical_scroll_bar_type = p->vertical_scroll_bar_type; 5548 w->vertical_scroll_bar_type = p->vertical_scroll_bar_type;
5567 w->dedicated = p->dedicated; 5549 w->dedicated = p->dedicated;
5568 w->splits = p->splits; 5550 w->combination_limit = p->combination_limit;
5569 w->nest = p->nest;
5570 w->window_parameters = p->window_parameters; 5551 w->window_parameters = p->window_parameters;
5571 XSETFASTINT (w->last_modified, 0); 5552 XSETFASTINT (w->last_modified, 0);
5572 XSETFASTINT (w->last_overlay_modified, 0); 5553 XSETFASTINT (w->last_overlay_modified, 0);
@@ -5719,10 +5700,10 @@ the return value is nil. Otherwise the value is t. */)
5719} 5700}
5720 5701
5721 5702
5722/* Delete all subwindows reachable via the next, vchild, and hchild 5703/* Recursively delete all child windows reachable via the next, vchild,
5723 slots of WINDOW. */ 5704 and hchild slots of WINDOW. */
5724void 5705void
5725delete_all_subwindows (Lisp_Object window) 5706delete_all_child_windows (Lisp_Object window)
5726{ 5707{
5727 register struct window *w; 5708 register struct window *w;
5728 5709
@@ -5730,18 +5711,18 @@ delete_all_subwindows (Lisp_Object window)
5730 5711
5731 if (!NILP (w->next)) 5712 if (!NILP (w->next))
5732 /* Delete WINDOW's siblings (we traverse postorderly). */ 5713 /* Delete WINDOW's siblings (we traverse postorderly). */
5733 delete_all_subwindows (w->next); 5714 delete_all_child_windows (w->next);
5734 5715
5735 w->total_lines = w->buffer; /* See Fset_window_configuration for excuse. */ 5716 w->total_lines = w->buffer; /* See Fset_window_configuration for excuse. */
5736 5717
5737 if (!NILP (w->vchild)) 5718 if (!NILP (w->vchild))
5738 { 5719 {
5739 delete_all_subwindows (w->vchild); 5720 delete_all_child_windows (w->vchild);
5740 w->vchild = Qnil; 5721 w->vchild = Qnil;
5741 } 5722 }
5742 else if (!NILP (w->hchild)) 5723 else if (!NILP (w->hchild))
5743 { 5724 {
5744 delete_all_subwindows (w->hchild); 5725 delete_all_child_windows (w->hchild);
5745 w->hchild = Qnil; 5726 w->hchild = Qnil;
5746 } 5727 }
5747 else if (!NILP (w->buffer)) 5728 else if (!NILP (w->buffer))
@@ -5844,8 +5825,7 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
5844 p->scroll_bar_width = w->scroll_bar_width; 5825 p->scroll_bar_width = w->scroll_bar_width;
5845 p->vertical_scroll_bar_type = w->vertical_scroll_bar_type; 5826 p->vertical_scroll_bar_type = w->vertical_scroll_bar_type;
5846 p->dedicated = w->dedicated; 5827 p->dedicated = w->dedicated;
5847 p->splits = w->splits; 5828 p->combination_limit = w->combination_limit;
5848 p->nest = w->nest;
5849 p->window_parameters = w->window_parameters; 5829 p->window_parameters = w->window_parameters;
5850 if (!NILP (w->buffer)) 5830 if (!NILP (w->buffer))
5851 { 5831 {
@@ -5995,7 +5975,7 @@ means no margin. */)
5995DEFUN ("window-margins", Fwindow_margins, Swindow_margins, 5975DEFUN ("window-margins", Fwindow_margins, Swindow_margins,
5996 0, 1, 0, 5976 0, 1, 0,
5997 doc: /* Get width of marginal areas of window WINDOW. 5977 doc: /* Get width of marginal areas of window WINDOW.
5998If WINDOW is omitted or nil, use the currently selected window. 5978If WINDOW is omitted or nil, it defaults to the selected window.
5999Value is a cons of the form (LEFT-WIDTH . RIGHT-WIDTH). 5979Value is a cons of the form (LEFT-WIDTH . RIGHT-WIDTH).
6000If a marginal area does not exist, its width will be returned 5980If a marginal area does not exist, its width will be returned
6001as nil. */) 5981as nil. */)
@@ -6059,7 +6039,7 @@ display marginal areas and the text area. */)
6059DEFUN ("window-fringes", Fwindow_fringes, Swindow_fringes, 6039DEFUN ("window-fringes", Fwindow_fringes, Swindow_fringes,
6060 0, 1, 0, 6040 0, 1, 0,
6061 doc: /* Get width of fringes of window WINDOW. 6041 doc: /* Get width of fringes of window WINDOW.
6062If WINDOW is omitted or nil, use the currently selected window. 6042If WINDOW is omitted or nil, it defaults to the selected window.
6063Value is a list of the form (LEFT-WIDTH RIGHT-WIDTH OUTSIDE-MARGINS). */) 6043Value is a list of the form (LEFT-WIDTH RIGHT-WIDTH OUTSIDE-MARGINS). */)
6064 (Lisp_Object window) 6044 (Lisp_Object window)
6065{ 6045{
@@ -6128,7 +6108,7 @@ Fourth parameter HORIZONTAL-TYPE is currently unused. */)
6128DEFUN ("window-scroll-bars", Fwindow_scroll_bars, Swindow_scroll_bars, 6108DEFUN ("window-scroll-bars", Fwindow_scroll_bars, Swindow_scroll_bars,
6129 0, 1, 0, 6109 0, 1, 0,
6130 doc: /* Get width and type of scroll bars of window WINDOW. 6110 doc: /* Get width and type of scroll bars of window WINDOW.
6131If WINDOW is omitted or nil, use the currently selected window. 6111If WINDOW is omitted or nil, it defaults to the selected window.
6132Value is a list of the form (WIDTH COLS VERTICAL-TYPE HORIZONTAL-TYPE). 6112Value is a list of the form (WIDTH COLS VERTICAL-TYPE HORIZONTAL-TYPE).
6133If WIDTH is nil or TYPE is t, the window is using the frame's corresponding 6113If WIDTH is nil or TYPE is t, the window is using the frame's corresponding
6134value. */) 6114value. */)
@@ -6151,7 +6131,7 @@ value. */)
6151 6131
6152DEFUN ("window-vscroll", Fwindow_vscroll, Swindow_vscroll, 0, 2, 0, 6132DEFUN ("window-vscroll", Fwindow_vscroll, Swindow_vscroll, 0, 2, 0,
6153 doc: /* Return the amount by which WINDOW is scrolled vertically. 6133 doc: /* Return the amount by which WINDOW is scrolled vertically.
6154Use the selected window if WINDOW is nil or omitted. 6134If WINDOW is omitted or nil, it defaults to the selected window.
6155Normally, value is a multiple of the canonical character height of WINDOW; 6135Normally, value is a multiple of the canonical character height of WINDOW;
6156optional second arg PIXELS-P means value is measured in pixels. */) 6136optional second arg PIXELS-P means value is measured in pixels. */)
6157 (Lisp_Object window, Lisp_Object pixels_p) 6137 (Lisp_Object window, Lisp_Object pixels_p)
@@ -6308,7 +6288,8 @@ freeze_window_starts (struct frame *f, int freeze_p)
6308 and the like. 6288 and the like.
6309 6289
6310 This ignores a couple of things like the dedicatedness status of 6290 This ignores a couple of things like the dedicatedness status of
6311 window, splits, nest and the like. This might have to be fixed. */ 6291 window, combination_limit and the like. This might have to be
6292 fixed. */
6312 6293
6313int 6294int
6314compare_window_configurations (Lisp_Object configuration1, Lisp_Object configuration2, int ignore_positions) 6295compare_window_configurations (Lisp_Object configuration1, Lisp_Object configuration2, int ignore_positions)
@@ -6512,41 +6493,39 @@ will redraw the entire frame; the special value `tty' causes the
6512frame to be redrawn only if it is a tty frame. */); 6493frame to be redrawn only if it is a tty frame. */);
6513 Vrecenter_redisplay = Qtty; 6494 Vrecenter_redisplay = Qtty;
6514 6495
6515 DEFVAR_LISP ("window-splits", Vwindow_splits, 6496 DEFVAR_LISP ("window-combination-resize", Vwindow_combination_resize,
6516 doc: /* Non-nil means splitting windows is handled specially. 6497 doc: /* Non-nil means resize window combinations proportionally.
6517If this variable is nil, splitting a window gets the entire screen space 6498If this variable is nil, splitting a window gets the entire screen space
6518for displaying the new window from the window to split. If this 6499for displaying the new window from the window to split. Deleting and
6519variable is non-nil, splitting a window may resize all windows in the 6500resizing a window preferably resizes one adjacent window only.
6520same combination. This also allows to split a window that is otherwise 6501
6521too small or of fixed size. 6502If this variable is non-nil, splitting a window tries to get the space
6522 6503proportionally from all windows in the same combination. This also
6523The value of this variable is also assigned to the split status of the 6504allows to split a window that is otherwise too small or of fixed size.
6524new window and, provided the old and new window form a new combination, 6505Resizing and deleting a window proportionally resize all windows in the
6525to the window that was split as well. The split status of a window can 6506same combination.
6526be retrieved with the function `window-splits' and altered by the 6507
6527function `set-window-splits'. 6508This variable takes no effect if `window-combination-limit' is non-nil. */);
6528 6509 Vwindow_combination_resize = Qnil;
6529If the value of the variable `window-nest' is non-nil, the space for the 6510
6530new window is exclusively taken from the window that shall be split, but 6511 DEFVAR_LISP ("window-combination-limit", Vwindow_combination_limit,
6531the split status of the window that is split as well as that of the new
6532window are still set to the value of this variable. */);
6533 Vwindow_splits = Qnil;
6534
6535 DEFVAR_LISP ("window-nest", Vwindow_nest,
6536 doc: /* Non-nil means splitting a window makes a new parent window. 6512 doc: /* Non-nil means splitting a window makes a new parent window.
6537If this variable is nil, splitting a window will create a new parent 6513If this variable is nil, splitting a window will create a new parent
6538window only if the window has no parent window or the window shall 6514window only if the window has no parent window or the window shall
6539become a combination orthogonal to the one it it is part of. 6515become a combination orthogonal to the one it is part of.
6516
6517If this variable is t, splitting a window always creates a new parent
6518window. If all splits behave this way, each frame's window tree is a
6519binary tree and every window but the frame's root window has exactly one
6520sibling.
6540 6521
6541If this variable is non-nil, splitting a window always creates a new 6522Other values are reserved for future use.
6542parent window. If all splits behave this way, each frame's window tree
6543is a binary tree and every window but the frame's root window has
6544exactly one sibling.
6545 6523
6546The value of this variable is also assigned to the nest status of the 6524The value of this variable is also assigned to the combination-limit
6547new parent window. The nest status of a window can be retrieved via the 6525status of the new parent window. The combination-limit status of a
6548function `window-nest' and altered by the function `set-window-nest'. */); 6526window can be retrieved via the function `window-combination-limit' and
6549 Vwindow_nest = Qnil; 6527altered by the function `set-window-combination-limit'. */);
6528 Vwindow_combination_limit = Qnil;
6550 6529
6551 defsubr (&Sselected_window); 6530 defsubr (&Sselected_window);
6552 defsubr (&Sminibuffer_window); 6531 defsubr (&Sminibuffer_window);
@@ -6566,21 +6545,21 @@ function `window-nest' and altered by the function `set-window-nest'. */);
6566 defsubr (&Swindow_left_child); 6545 defsubr (&Swindow_left_child);
6567 defsubr (&Swindow_next_sibling); 6546 defsubr (&Swindow_next_sibling);
6568 defsubr (&Swindow_prev_sibling); 6547 defsubr (&Swindow_prev_sibling);
6569 defsubr (&Swindow_splits); 6548 defsubr (&Swindow_combination_limit);
6570 defsubr (&Sset_window_splits); 6549 defsubr (&Sset_window_combination_limit);
6571 defsubr (&Swindow_nest);
6572 defsubr (&Sset_window_nest);
6573 defsubr (&Swindow_use_time); 6550 defsubr (&Swindow_use_time);
6574 defsubr (&Swindow_top_line); 6551 defsubr (&Swindow_top_line);
6575 defsubr (&Swindow_left_column); 6552 defsubr (&Swindow_left_column);
6576 defsubr (&Swindow_total_size); 6553 defsubr (&Swindow_total_height);
6554 defsubr (&Swindow_total_width);
6577 defsubr (&Swindow_normal_size); 6555 defsubr (&Swindow_normal_size);
6578 defsubr (&Swindow_new_total); 6556 defsubr (&Swindow_new_total);
6579 defsubr (&Swindow_new_normal); 6557 defsubr (&Swindow_new_normal);
6580 defsubr (&Sset_window_new_total); 6558 defsubr (&Sset_window_new_total);
6581 defsubr (&Sset_window_new_normal); 6559 defsubr (&Sset_window_new_normal);
6582 defsubr (&Swindow_resize_apply); 6560 defsubr (&Swindow_resize_apply);
6583 defsubr (&Swindow_body_size); 6561 defsubr (&Swindow_body_height);
6562 defsubr (&Swindow_body_width);
6584 defsubr (&Swindow_hscroll); 6563 defsubr (&Swindow_hscroll);
6585 defsubr (&Sset_window_hscroll); 6564 defsubr (&Sset_window_hscroll);
6586 defsubr (&Swindow_redisplay_end_trigger); 6565 defsubr (&Swindow_redisplay_end_trigger);
diff --git a/src/window.h b/src/window.h
index c6fa5e7a338..de0f7307a51 100644
--- a/src/window.h
+++ b/src/window.h
@@ -258,13 +258,8 @@ struct window
258 must run the redisplay-end-trigger-hook. */ 258 must run the redisplay-end-trigger-hook. */
259 Lisp_Object redisplay_end_trigger; 259 Lisp_Object redisplay_end_trigger;
260 260
261 /* Non-nil means deleting or resizing this window distributes 261 /* t means this window's child windows are not (re-)combined. */
262 space among all windows in the same combination. */ 262 Lisp_Object combination_limit;
263 Lisp_Object splits;
264
265 /* Non-nil means this window's child windows are never
266 (re-)combined. */
267 Lisp_Object nest;
268 263
269 /* Alist of <buffer, window-start, window-point> triples listing 264 /* Alist of <buffer, window-start, window-point> triples listing
270 buffers previously shown in this window. */ 265 buffers previously shown in this window. */
@@ -824,7 +819,7 @@ extern Lisp_Object window_from_coordinates (struct frame *, int, int,
824 enum window_part *, int); 819 enum window_part *, int);
825EXFUN (Fwindow_dedicated_p, 1); 820EXFUN (Fwindow_dedicated_p, 1);
826extern void resize_frame_windows (struct frame *, int, int); 821extern void resize_frame_windows (struct frame *, int, int);
827extern void delete_all_subwindows (Lisp_Object); 822extern void delete_all_child_windows (Lisp_Object);
828extern void freeze_window_starts (struct frame *, int); 823extern void freeze_window_starts (struct frame *, int);
829extern void grow_mini_window (struct window *, int); 824extern void grow_mini_window (struct window *, int);
830extern void shrink_mini_window (struct window *); 825extern void shrink_mini_window (struct window *);
diff --git a/src/xdisp.c b/src/xdisp.c
index 698f217f240..3883a753940 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -954,7 +954,7 @@ static int coords_in_mouse_face_p (struct window *, int, int);
954 954
955 This is the height of W minus the height of a mode line, if any. */ 955 This is the height of W minus the height of a mode line, if any. */
956 956
957inline int 957int
958window_text_bottom_y (struct window *w) 958window_text_bottom_y (struct window *w)
959{ 959{
960 int height = WINDOW_TOTAL_HEIGHT (w); 960 int height = WINDOW_TOTAL_HEIGHT (w);
@@ -968,7 +968,7 @@ window_text_bottom_y (struct window *w)
968 means return the total width of W, not including fringes to 968 means return the total width of W, not including fringes to
969 the left and right of the window. */ 969 the left and right of the window. */
970 970
971inline int 971int
972window_box_width (struct window *w, int area) 972window_box_width (struct window *w, int area)
973{ 973{
974 int cols = XFASTINT (w->total_cols); 974 int cols = XFASTINT (w->total_cols);
@@ -1007,7 +1007,7 @@ window_box_width (struct window *w, int area)
1007/* Return the pixel height of the display area of window W, not 1007/* Return the pixel height of the display area of window W, not
1008 including mode lines of W, if any. */ 1008 including mode lines of W, if any. */
1009 1009
1010inline int 1010int
1011window_box_height (struct window *w) 1011window_box_height (struct window *w)
1012{ 1012{
1013 struct frame *f = XFRAME (w->frame); 1013 struct frame *f = XFRAME (w->frame);
@@ -1054,7 +1054,7 @@ window_box_height (struct window *w)
1054 area AREA of window W. AREA < 0 means return the left edge of the 1054 area AREA of window W. AREA < 0 means return the left edge of the
1055 whole window, to the right of the left fringe of W. */ 1055 whole window, to the right of the left fringe of W. */
1056 1056
1057inline int 1057int
1058window_box_left_offset (struct window *w, int area) 1058window_box_left_offset (struct window *w, int area)
1059{ 1059{
1060 int x; 1060 int x;
@@ -1086,7 +1086,7 @@ window_box_left_offset (struct window *w, int area)
1086 area AREA of window W. AREA < 0 means return the right edge of the 1086 area AREA of window W. AREA < 0 means return the right edge of the
1087 whole window, to the left of the right fringe of W. */ 1087 whole window, to the left of the right fringe of W. */
1088 1088
1089inline int 1089int
1090window_box_right_offset (struct window *w, int area) 1090window_box_right_offset (struct window *w, int area)
1091{ 1091{
1092 return window_box_left_offset (w, area) + window_box_width (w, area); 1092 return window_box_left_offset (w, area) + window_box_width (w, area);
@@ -1096,7 +1096,7 @@ window_box_right_offset (struct window *w, int area)
1096 area AREA of window W. AREA < 0 means return the left edge of the 1096 area AREA of window W. AREA < 0 means return the left edge of the
1097 whole window, to the right of the left fringe of W. */ 1097 whole window, to the right of the left fringe of W. */
1098 1098
1099inline int 1099int
1100window_box_left (struct window *w, int area) 1100window_box_left (struct window *w, int area)
1101{ 1101{
1102 struct frame *f = XFRAME (w->frame); 1102 struct frame *f = XFRAME (w->frame);
@@ -1116,7 +1116,7 @@ window_box_left (struct window *w, int area)
1116 area AREA of window W. AREA < 0 means return the right edge of the 1116 area AREA of window W. AREA < 0 means return the right edge of the
1117 whole window, to the left of the right fringe of W. */ 1117 whole window, to the left of the right fringe of W. */
1118 1118
1119inline int 1119int
1120window_box_right (struct window *w, int area) 1120window_box_right (struct window *w, int area)
1121{ 1121{
1122 return window_box_left (w, area) + window_box_width (w, area); 1122 return window_box_left (w, area) + window_box_width (w, area);
@@ -1129,7 +1129,7 @@ window_box_right (struct window *w, int area)
1129 coordinates of the upper-left corner of the box. Return in 1129 coordinates of the upper-left corner of the box. Return in
1130 *BOX_WIDTH, and *BOX_HEIGHT the pixel width and height of the box. */ 1130 *BOX_WIDTH, and *BOX_HEIGHT the pixel width and height of the box. */
1131 1131
1132inline void 1132void
1133window_box (struct window *w, int area, int *box_x, int *box_y, 1133window_box (struct window *w, int area, int *box_x, int *box_y,
1134 int *box_width, int *box_height) 1134 int *box_width, int *box_height)
1135{ 1135{
@@ -2766,9 +2766,13 @@ init_iterator (struct it *it, struct window *w,
2766 /* Do we need to reorder bidirectional text? Not if this is a 2766 /* Do we need to reorder bidirectional text? Not if this is a
2767 unibyte buffer: by definition, none of the single-byte 2767 unibyte buffer: by definition, none of the single-byte
2768 characters are strong R2L, so no reordering is needed. And 2768 characters are strong R2L, so no reordering is needed. And
2769 bidi.c doesn't support unibyte buffers anyway. */ 2769 bidi.c doesn't support unibyte buffers anyway. Also, don't
2770 reorder while we are loading loadup.el, since the tables of
2771 character properties needed for reordering are not yet
2772 available. */
2770 it->bidi_p = 2773 it->bidi_p =
2771 !NILP (BVAR (current_buffer, bidi_display_reordering)) 2774 NILP (Vpurify_flag)
2775 && !NILP (BVAR (current_buffer, bidi_display_reordering))
2772 && it->multibyte_p; 2776 && it->multibyte_p;
2773 2777
2774 /* If we are to reorder bidirectional text, init the bidi 2778 /* If we are to reorder bidirectional text, init the bidi
@@ -6144,8 +6148,12 @@ reseat_to_string (struct it *it, const char *s, Lisp_Object string,
6144 it->multibyte_p = multibyte > 0; 6148 it->multibyte_p = multibyte > 0;
6145 6149
6146 /* Bidirectional reordering of strings is controlled by the default 6150 /* Bidirectional reordering of strings is controlled by the default
6147 value of bidi-display-reordering. */ 6151 value of bidi-display-reordering. Don't try to reorder while
6148 it->bidi_p = !NILP (BVAR (&buffer_defaults, bidi_display_reordering)); 6152 loading loadup.el, as the necessary character property tables are
6153 not yet available. */
6154 it->bidi_p =
6155 NILP (Vpurify_flag)
6156 && !NILP (BVAR (&buffer_defaults, bidi_display_reordering));
6149 6157
6150 if (s == NULL) 6158 if (s == NULL)
6151 { 6159 {
@@ -17948,6 +17956,26 @@ insert_left_trunc_glyphs (struct it *it)
17948 } 17956 }
17949} 17957}
17950 17958
17959/* Compute the hash code for ROW. */
17960#if !XASSERTS
17961static
17962#endif
17963unsigned
17964row_hash (struct glyph_row *row)
17965{
17966 int area, k;
17967 unsigned hashval = 0;
17968
17969 for (area = LEFT_MARGIN_AREA; area < LAST_AREA; ++area)
17970 for (k = 0; k < row->used[area]; ++k)
17971 hashval = ((((hashval << 4) + (hashval >> 24)) & 0x0fffffff)
17972 + row->glyphs[area][k].u.val
17973 + row->glyphs[area][k].face_id
17974 + row->glyphs[area][k].padding_p
17975 + (row->glyphs[area][k].type << 2));
17976
17977 return hashval;
17978}
17951 17979
17952/* Compute the pixel height and width of IT->glyph_row. 17980/* Compute the pixel height and width of IT->glyph_row.
17953 17981
@@ -18034,17 +18062,7 @@ compute_line_metrics (struct it *it)
18034 } 18062 }
18035 18063
18036 /* Compute a hash code for this row. */ 18064 /* Compute a hash code for this row. */
18037 { 18065 row->hash = row_hash (row);
18038 int area, i;
18039 row->hash = 0;
18040 for (area = LEFT_MARGIN_AREA; area < LAST_AREA; ++area)
18041 for (i = 0; i < row->used[area]; ++i)
18042 row->hash = ((((row->hash << 4) + (row->hash >> 24)) & 0x0fffffff)
18043 + row->glyphs[area][i].u.val
18044 + row->glyphs[area][i].face_id
18045 + row->glyphs[area][i].padding_p
18046 + (row->glyphs[area][i].type << 2));
18047 }
18048 18066
18049 it->max_ascent = it->max_descent = 0; 18067 it->max_ascent = it->max_descent = 0;
18050 it->max_phys_ascent = it->max_phys_descent = 0; 18068 it->max_phys_ascent = it->max_phys_descent = 0;
@@ -19381,9 +19399,18 @@ display_line (struct it *it)
19381 overlay_arrow_seen = 1; 19399 overlay_arrow_seen = 1;
19382 } 19400 }
19383 19401
19402 /* Highlight trailing whitespace. */
19403 if (!NILP (Vshow_trailing_whitespace))
19404 highlight_trailing_whitespace (it->f, it->glyph_row);
19405
19384 /* Compute pixel dimensions of this line. */ 19406 /* Compute pixel dimensions of this line. */
19385 compute_line_metrics (it); 19407 compute_line_metrics (it);
19386 19408
19409 /* Implementation note: No changes in the glyphs of ROW or in their
19410 faces can be done past this point, because compute_line_metrics
19411 computes ROW's hash value and stores it within the glyph_row
19412 structure. */
19413
19387 /* Record whether this row ends inside an ellipsis. */ 19414 /* Record whether this row ends inside an ellipsis. */
19388 row->ends_in_ellipsis_p 19415 row->ends_in_ellipsis_p
19389 = (it->method == GET_FROM_DISPLAY_VECTOR 19416 = (it->method == GET_FROM_DISPLAY_VECTOR
@@ -19418,10 +19445,6 @@ display_line (struct it *it)
19418 && cursor_row_p (row)) 19445 && cursor_row_p (row))
19419 set_cursor_from_row (it->w, row, it->w->desired_matrix, 0, 0, 0, 0); 19446 set_cursor_from_row (it->w, row, it->w->desired_matrix, 0, 0, 0, 0);
19420 19447
19421 /* Highlight trailing whitespace. */
19422 if (!NILP (Vshow_trailing_whitespace))
19423 highlight_trailing_whitespace (it->f, it->glyph_row);
19424
19425 /* Prepare for the next line. This line starts horizontally at (X 19448 /* Prepare for the next line. This line starts horizontally at (X
19426 HPOS) = (0 0). Vertical positions are incremented. As a 19449 HPOS) = (0 0). Vertical positions are incremented. As a
19427 convenience for the caller, IT->glyph_row is set to the next 19450 convenience for the caller, IT->glyph_row is set to the next
@@ -19467,7 +19490,10 @@ See also `bidi-paragraph-direction'. */)
19467 } 19490 }
19468 19491
19469 if (NILP (BVAR (buf, bidi_display_reordering)) 19492 if (NILP (BVAR (buf, bidi_display_reordering))
19470 || NILP (BVAR (buf, enable_multibyte_characters))) 19493 || NILP (BVAR (buf, enable_multibyte_characters))
19494 /* When we are loading loadup.el, the character property tables
19495 needed for bidi iteration are not yet available. */
19496 || !NILP (Vpurify_flag))
19471 return Qleft_to_right; 19497 return Qleft_to_right;
19472 else if (!NILP (BVAR (buf, bidi_paragraph_direction))) 19498 else if (!NILP (BVAR (buf, bidi_paragraph_direction)))
19473 return BVAR (buf, bidi_paragraph_direction); 19499 return BVAR (buf, bidi_paragraph_direction);
@@ -22045,7 +22071,7 @@ get_glyph_face_and_encoding (struct frame *f, struct glyph *glyph,
22045 22071
22046 22072
22047/* Get glyph code of character C in FONT in the two-byte form CHAR2B. 22073/* Get glyph code of character C in FONT in the two-byte form CHAR2B.
22048 Retunr 1 if FONT has a glyph for C, otherwise return 0. */ 22074 Return 1 if FONT has a glyph for C, otherwise return 0. */
22049 22075
22050static inline int 22076static inline int
22051get_char_glyph_code (int c, struct font *font, XChar2b *char2b) 22077get_char_glyph_code (int c, struct font *font, XChar2b *char2b)
@@ -22117,6 +22143,12 @@ fill_composite_glyph_string (struct glyph_string *s, struct face *base_face,
22117 } 22143 }
22118 s->cmp_to = i; 22144 s->cmp_to = i;
22119 22145
22146 if (s->face == NULL)
22147 {
22148 s->face = base_face->ascii_face;
22149 s->font = s->face->font;
22150 }
22151
22120 /* All glyph strings for the same composition has the same width, 22152 /* All glyph strings for the same composition has the same width,
22121 i.e. the width set for the first component of the composition. */ 22153 i.e. the width set for the first component of the composition. */
22122 s->width = s->first_glyph->pixel_width; 22154 s->width = s->first_glyph->pixel_width;
@@ -23612,7 +23644,7 @@ produce_stretch_glyph (struct it *it)
23612 { 23644 {
23613 width = it->last_visible_x - it->current_x; 23645 width = it->last_visible_x - it->current_x;
23614#ifdef HAVE_WINDOW_SYSTEM 23646#ifdef HAVE_WINDOW_SYSTEM
23615 /* Subtact one more pixel from the stretch width, but only on 23647 /* Subtract one more pixel from the stretch width, but only on
23616 GUI frames, since on a TTY each glyph is one "pixel" wide. */ 23648 GUI frames, since on a TTY each glyph is one "pixel" wide. */
23617 width -= FRAME_WINDOW_P (it->f); 23649 width -= FRAME_WINDOW_P (it->f);
23618#endif 23650#endif
@@ -26899,7 +26931,7 @@ note_mouse_highlight (struct frame *f, int x, int y)
26899 && XFASTINT (w->last_modified) == BUF_MODIFF (b) 26931 && XFASTINT (w->last_modified) == BUF_MODIFF (b)
26900 && XFASTINT (w->last_overlay_modified) == BUF_OVERLAY_MODIFF (b)) 26932 && XFASTINT (w->last_overlay_modified) == BUF_OVERLAY_MODIFF (b))
26901 { 26933 {
26902 int hpos, vpos, dx, dy, area; 26934 int hpos, vpos, dx, dy, area = LAST_AREA;
26903 ptrdiff_t pos; 26935 ptrdiff_t pos;
26904 struct glyph *glyph; 26936 struct glyph *glyph;
26905 Lisp_Object object; 26937 Lisp_Object object;
@@ -27159,8 +27191,12 @@ note_mouse_highlight (struct frame *f, int x, int y)
27159 } 27191 }
27160 27192
27161 mouse_face_from_buffer_pos (window, hlinfo, pos, 27193 mouse_face_from_buffer_pos (window, hlinfo, pos,
27162 XFASTINT (before), 27194 NILP (before)
27163 XFASTINT (after), 27195 ? 1
27196 : XFASTINT (before),
27197 NILP (after)
27198 ? BUF_Z (XBUFFER (buffer))
27199 : XFASTINT (after),
27164 before_string, after_string, 27200 before_string, after_string,
27165 disp_string); 27201 disp_string);
27166 cursor = No_Cursor; 27202 cursor = No_Cursor;
@@ -27960,7 +27996,6 @@ syms_of_xdisp (void)
27960 DEFSYM (Qhollow, "hollow"); 27996 DEFSYM (Qhollow, "hollow");
27961 DEFSYM (Qhand, "hand"); 27997 DEFSYM (Qhand, "hand");
27962 DEFSYM (Qarrow, "arrow"); 27998 DEFSYM (Qarrow, "arrow");
27963 DEFSYM (Qtext, "text");
27964 DEFSYM (Qinhibit_free_realized_faces, "inhibit-free-realized-faces"); 27999 DEFSYM (Qinhibit_free_realized_faces, "inhibit-free-realized-faces");
27965 28000
27966 list_of_error = Fcons (Fcons (intern_c_string ("error"), 28001 list_of_error = Fcons (Fcons (intern_c_string ("error"),
@@ -28429,7 +28464,7 @@ To add a prefix to continuation lines, use `wrap-prefix'. */);
28429 DEFVAR_INT ("overline-margin", overline_margin, 28464 DEFVAR_INT ("overline-margin", overline_margin,
28430 doc: /* *Space between overline and text, in pixels. 28465 doc: /* *Space between overline and text, in pixels.
28431The default value is 2: the height of the overline (1 pixel) plus 1 pixel 28466The default value is 2: the height of the overline (1 pixel) plus 1 pixel
28432margin to the caracter height. */); 28467margin to the character height. */);
28433 overline_margin = 2; 28468 overline_margin = 2;
28434 28469
28435 DEFVAR_INT ("underline-minimum-offset", 28470 DEFVAR_INT ("underline-minimum-offset",
diff --git a/src/xfaces.c b/src/xfaces.c
index ee41ab69b0b..2dc46b2fa02 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -27,7 +27,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
27 27
28 1. Font family name. 28 1. Font family name.
29 29
30 2. Font foundary name. 30 2. Font foundry name.
31 31
32 3. Relative proportionate width, aka character set width or set 32 3. Relative proportionate width, aka character set width or set
33 width (swidth), e.g. `semi-compressed'. 33 width (swidth), e.g. `semi-compressed'.
@@ -4193,12 +4193,12 @@ prepare_face_for_display (struct frame *f, struct face *face)
4193static int 4193static int
4194color_distance (XColor *x, XColor *y) 4194color_distance (XColor *x, XColor *y)
4195{ 4195{
4196 /* This formula is from a paper title `Colour metric' by Thiadmer Riemersma. 4196 /* This formula is from a paper titled `Colour metric' by Thiadmer Riemersma.
4197 Quoting from that paper: 4197 Quoting from that paper:
4198 4198
4199 This formula has results that are very close to L*u*v* (with the 4199 This formula has results that are very close to L*u*v* (with the
4200 modified lightness curve) and, more importantly, it is a more even 4200 modified lightness curve) and, more importantly, it is a more even
4201 algorithm: it does not have a range of colours where it suddenly 4201 algorithm: it does not have a range of colors where it suddenly
4202 gives far from optimal results. 4202 gives far from optimal results.
4203 4203
4204 See <http://www.compuphase.com/cmetric.htm> for more info. */ 4204 See <http://www.compuphase.com/cmetric.htm> for more info. */
diff --git a/src/xfns.c b/src/xfns.c
index ba73bdba70b..88c70a9b410 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -2914,7 +2914,7 @@ x_free_gcs (struct frame *f)
2914 2914
2915 2915
2916/* Handler for signals raised during x_create_frame and 2916/* Handler for signals raised during x_create_frame and
2917 x_create_top_frame. FRAME is the frame which is partially 2917 x_create_tip_frame. FRAME is the frame which is partially
2918 constructed. */ 2918 constructed. */
2919 2919
2920static Lisp_Object 2920static Lisp_Object
@@ -2929,13 +2929,14 @@ unwind_create_frame (Lisp_Object frame)
2929 return Qnil; 2929 return Qnil;
2930 2930
2931 /* If frame is ``official'', nothing to do. */ 2931 /* If frame is ``official'', nothing to do. */
2932 if (!CONSP (Vframe_list) || !EQ (XCAR (Vframe_list), frame)) 2932 if (NILP (Fmemq (frame, Vframe_list)))
2933 { 2933 {
2934#if GLYPH_DEBUG && XASSERTS 2934#if GLYPH_DEBUG && XASSERTS
2935 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 2935 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
2936#endif 2936#endif
2937 2937
2938 x_free_frame_resources (f); 2938 x_free_frame_resources (f);
2939 free_glyphs (f);
2939 2940
2940#if GLYPH_DEBUG 2941#if GLYPH_DEBUG
2941 /* Check that reference counts are indeed correct. */ 2942 /* Check that reference counts are indeed correct. */
@@ -3137,7 +3138,6 @@ This function is an internal primitive--use `make-frame' instead. */)
3137 FRAME_CAN_HAVE_SCROLL_BARS (f) = 1; 3138 FRAME_CAN_HAVE_SCROLL_BARS (f) = 1;
3138 3139
3139 f->terminal = dpyinfo->terminal; 3140 f->terminal = dpyinfo->terminal;
3140 f->terminal->reference_count++;
3141 3141
3142 f->output_method = output_x_window; 3142 f->output_method = output_x_window;
3143 f->output_data.x = (struct x_output *) xmalloc (sizeof (struct x_output)); 3143 f->output_data.x = (struct x_output *) xmalloc (sizeof (struct x_output));
@@ -3307,6 +3307,12 @@ This function is an internal primitive--use `make-frame' instead. */)
3307 "scrollBarBackground", 3307 "scrollBarBackground",
3308 "ScrollBarBackground", 0); 3308 "ScrollBarBackground", 0);
3309 3309
3310#if GLYPH_DEBUG
3311 image_cache_refcount =
3312 FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0;
3313 dpyinfo_refcount = dpyinfo->reference_count;
3314#endif /* GLYPH_DEBUG */
3315
3310 /* Init faces before x_default_parameter is called for scroll-bar 3316 /* Init faces before x_default_parameter is called for scroll-bar
3311 parameters because that function calls x_set_scroll_bar_width, 3317 parameters because that function calls x_set_scroll_bar_width,
3312 which calls change_frame_size, which calls Fset_window_buffer, 3318 which calls change_frame_size, which calls Fset_window_buffer,
@@ -3315,11 +3321,6 @@ This function is an internal primitive--use `make-frame' instead. */)
3315 happen. */ 3321 happen. */
3316 init_frame_faces (f); 3322 init_frame_faces (f);
3317 3323
3318#if GLYPH_DEBUG
3319 image_cache_refcount = FRAME_IMAGE_CACHE (f)->refcount;
3320 dpyinfo_refcount = dpyinfo->reference_count;
3321#endif /* GLYPH_DEBUG */
3322
3323 /* The X resources controlling the menu-bar and tool-bar are 3324 /* The X resources controlling the menu-bar and tool-bar are
3324 processed specially at startup, and reflected in the mode 3325 processed specially at startup, and reflected in the mode
3325 variables; ignore them here. */ 3326 variables; ignore them here. */
@@ -3363,6 +3364,7 @@ This function is an internal primitive--use `make-frame' instead. */)
3363 x_make_gc (f); 3364 x_make_gc (f);
3364 3365
3365 /* Now consider the frame official. */ 3366 /* Now consider the frame official. */
3367 f->terminal->reference_count++;
3366 FRAME_X_DISPLAY_INFO (f)->reference_count++; 3368 FRAME_X_DISPLAY_INFO (f)->reference_count++;
3367 Vframe_list = Fcons (frame, Vframe_list); 3369 Vframe_list = Fcons (frame, Vframe_list);
3368 3370
@@ -3689,7 +3691,7 @@ If omitted or nil, that stands for the selected frame's display. */)
3689 3691
3690DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0, 3692DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0,
3691 doc: /* Return the "vendor ID" string of the X server of display TERMINAL. 3693 doc: /* Return the "vendor ID" string of the X server of display TERMINAL.
3692\(Labelling every distributor as a "vendor" embodies the false assumption 3694\(Labeling every distributor as a "vendor" embodies the false assumption
3693that operating systems cannot be developed and distributed noncommercially.) 3695that operating systems cannot be developed and distributed noncommercially.)
3694The optional argument TERMINAL specifies which display to ask about. 3696The optional argument TERMINAL specifies which display to ask about.
3695TERMINAL should be a terminal object, a frame or a display name (a string). 3697TERMINAL should be a terminal object, a frame or a display name (a string).
@@ -4593,7 +4595,6 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
4593 record_unwind_protect (unwind_create_tip_frame, frame); 4595 record_unwind_protect (unwind_create_tip_frame, frame);
4594 4596
4595 f->terminal = dpyinfo->terminal; 4597 f->terminal = dpyinfo->terminal;
4596 f->terminal->reference_count++;
4597 4598
4598 /* By setting the output method, we're essentially saying that 4599 /* By setting the output method, we're essentially saying that
4599 the frame is live, as per FRAME_LIVE_P. If we get a signal 4600 the frame is live, as per FRAME_LIVE_P. If we get a signal
@@ -4715,6 +4716,12 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
4715 x_default_parameter (f, parms, Qborder_color, build_string ("black"), 4716 x_default_parameter (f, parms, Qborder_color, build_string ("black"),
4716 "borderColor", "BorderColor", RES_TYPE_STRING); 4717 "borderColor", "BorderColor", RES_TYPE_STRING);
4717 4718
4719#if GLYPH_DEBUG
4720 image_cache_refcount =
4721 FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0;
4722 dpyinfo_refcount = dpyinfo->reference_count;
4723#endif /* GLYPH_DEBUG */
4724
4718 /* Init faces before x_default_parameter is called for scroll-bar 4725 /* Init faces before x_default_parameter is called for scroll-bar
4719 parameters because that function calls x_set_scroll_bar_width, 4726 parameters because that function calls x_set_scroll_bar_width,
4720 which calls change_frame_size, which calls Fset_window_buffer, 4727 which calls change_frame_size, which calls Fset_window_buffer,
@@ -4723,11 +4730,6 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
4723 happen. */ 4730 happen. */
4724 init_frame_faces (f); 4731 init_frame_faces (f);
4725 4732
4726#if GLYPH_DEBUG
4727 image_cache_refcount = FRAME_IMAGE_CACHE (f)->refcount;
4728 dpyinfo_refcount = dpyinfo->reference_count;
4729#endif /* GLYPH_DEBUG */
4730
4731 f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window; 4733 f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window;
4732 4734
4733 x_figure_window_size (f, parms, 0); 4735 x_figure_window_size (f, parms, 0);
@@ -4833,14 +4835,16 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
4833 4835
4834 UNGCPRO; 4836 UNGCPRO;
4835 4837
4838 /* Now that the frame will be official, it counts as a reference to
4839 its display and terminal. */
4840 FRAME_X_DISPLAY_INFO (f)->reference_count++;
4841 f->terminal->reference_count++;
4842
4836 /* It is now ok to make the frame official even if we get an error 4843 /* It is now ok to make the frame official even if we get an error
4837 below. And the frame needs to be on Vframe_list or making it 4844 below. And the frame needs to be on Vframe_list or making it
4838 visible won't work. */ 4845 visible won't work. */
4839 Vframe_list = Fcons (frame, Vframe_list); 4846 Vframe_list = Fcons (frame, Vframe_list);
4840 4847
4841 /* Now that the frame is official, it counts as a reference to
4842 its display. */
4843 FRAME_X_DISPLAY_INFO (f)->reference_count++;
4844 4848
4845 /* Setting attributes of faces of the tooltip frame from resources 4849 /* Setting attributes of faces of the tooltip frame from resources
4846 and similar will increment face_change_count, which leads to the 4850 and similar will increment face_change_count, which leads to the
diff --git a/src/xfont.c b/src/xfont.c
index 8b1e37aa146..73f1e130be0 100644
--- a/src/xfont.c
+++ b/src/xfont.c
@@ -272,8 +272,8 @@ xfont_chars_supported (Lisp_Object chars, XFontStruct *xfont,
272 return 0; 272 return 0;
273} 273}
274 274
275/* A hash table recoding which font supports which scritps. Each key 275/* A hash table recoding which font supports which scripts. Each key
276 is a vector of characteristic font propertis FOUNDRY to WIDTH and 276 is a vector of characteristic font properties FOUNDRY to WIDTH and
277 ADDSTYLE, and each value is a list of script symbols. 277 ADDSTYLE, and each value is a list of script symbols.
278 278
279 We assume that fonts that have the same value in the above 279 We assume that fonts that have the same value in the above
@@ -281,7 +281,7 @@ xfont_chars_supported (Lisp_Object chars, XFontStruct *xfont,
281 281
282static Lisp_Object xfont_scripts_cache; 282static Lisp_Object xfont_scripts_cache;
283 283
284/* Re-usable vector to store characteristic font properites. */ 284/* Re-usable vector to store characteristic font properties. */
285static Lisp_Object xfont_scratch_props; 285static Lisp_Object xfont_scratch_props;
286 286
287/* Return a list of scripts supported by the font of FONTNAME whose 287/* Return a list of scripts supported by the font of FONTNAME whose
diff --git a/src/xmenu.c b/src/xmenu.c
index eab25d709f6..d73051be6de 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -1604,6 +1604,17 @@ create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv,
1604 1604
1605#endif /* not USE_GTK */ 1605#endif /* not USE_GTK */
1606 1606
1607static Lisp_Object
1608cleanup_widget_value_tree (Lisp_Object arg)
1609{
1610 struct Lisp_Save_Value *p = XSAVE_VALUE (arg);
1611 widget_value *wv = p->pointer;
1612
1613 free_menubar_widget_value_tree (wv);
1614
1615 return Qnil;
1616}
1617
1607Lisp_Object 1618Lisp_Object
1608xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps, 1619xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
1609 Lisp_Object title, const char **error_name, Time timestamp) 1620 Lisp_Object title, const char **error_name, Time timestamp)
@@ -1618,6 +1629,8 @@ xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
1618 1629
1619 int first_pane; 1630 int first_pane;
1620 1631
1632 ptrdiff_t specpdl_count = SPECPDL_INDEX ();
1633
1621 if (! FRAME_X_P (f)) 1634 if (! FRAME_X_P (f))
1622 abort (); 1635 abort ();
1623 1636
@@ -1812,11 +1825,15 @@ xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
1812 /* No selection has been chosen yet. */ 1825 /* No selection has been chosen yet. */
1813 menu_item_selection = 0; 1826 menu_item_selection = 0;
1814 1827
1828 /* Make sure to free the widget_value objects we used to specify the
1829 contents even with longjmp. */
1830 record_unwind_protect (cleanup_widget_value_tree,
1831 make_save_value (first_wv, 0));
1832
1815 /* Actually create and show the menu until popped down. */ 1833 /* Actually create and show the menu until popped down. */
1816 create_and_show_popup_menu (f, first_wv, x, y, for_click, timestamp); 1834 create_and_show_popup_menu (f, first_wv, x, y, for_click, timestamp);
1817 1835
1818 /* Free the widget_value objects we used to specify the contents. */ 1836 unbind_to (specpdl_count, Qnil);
1819 free_menubar_widget_value_tree (first_wv);
1820 1837
1821 /* Find the selected item, and its pane, to return 1838 /* Find the selected item, and its pane, to return
1822 the proper value. */ 1839 the proper value. */
@@ -2003,6 +2020,8 @@ xdialog_show (FRAME_PTR f,
2003 /* 1 means we've seen the boundary between left-hand elts and right-hand. */ 2020 /* 1 means we've seen the boundary between left-hand elts and right-hand. */
2004 int boundary_seen = 0; 2021 int boundary_seen = 0;
2005 2022
2023 ptrdiff_t specpdl_count = SPECPDL_INDEX ();
2024
2006 if (! FRAME_X_P (f)) 2025 if (! FRAME_X_P (f))
2007 abort (); 2026 abort ();
2008 2027
@@ -2116,11 +2135,15 @@ xdialog_show (FRAME_PTR f,
2116 /* No selection has been chosen yet. */ 2135 /* No selection has been chosen yet. */
2117 menu_item_selection = 0; 2136 menu_item_selection = 0;
2118 2137
2138 /* Make sure to free the widget_value objects we used to specify the
2139 contents even with longjmp. */
2140 record_unwind_protect (cleanup_widget_value_tree,
2141 make_save_value (first_wv, 0));
2142
2119 /* Actually create and show the dialog. */ 2143 /* Actually create and show the dialog. */
2120 create_and_show_dialog (f, first_wv); 2144 create_and_show_dialog (f, first_wv);
2121 2145
2122 /* Free the widget_value objects we used to specify the contents. */ 2146 unbind_to (specpdl_count, Qnil);
2123 free_menubar_widget_value_tree (first_wv);
2124 2147
2125 /* Find the selected item, and its pane, to return 2148 /* Find the selected item, and its pane, to return
2126 the proper value. */ 2149 the proper value. */
diff --git a/src/xselect.c b/src/xselect.c
index 9eee4ee9593..d2ab416176c 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -2354,7 +2354,7 @@ x_fill_property_data (Display *dpy, Lisp_Object data, void *ret, int format)
2354 F is the frame to be used to look up X atoms if the TYPE is XA_ATOM. 2354 F is the frame to be used to look up X atoms if the TYPE is XA_ATOM.
2355 DATA is a C array of values to be converted. 2355 DATA is a C array of values to be converted.
2356 TYPE is the type of the data. Only XA_ATOM is special, it converts 2356 TYPE is the type of the data. Only XA_ATOM is special, it converts
2357 each number in DATA to its corresponfing X atom as a symbol. 2357 each number in DATA to its corresponding X atom as a symbol.
2358 FORMAT is 8, 16 or 32 and gives the size in bits for each C value to 2358 FORMAT is 8, 16 or 32 and gives the size in bits for each C value to
2359 be stored in RET. 2359 be stored in RET.
2360 SIZE is the number of elements in DATA. 2360 SIZE is the number of elements in DATA.
diff --git a/src/xsettings.c b/src/xsettings.c
index d57f3b5be81..a8604ac5897 100644
--- a/src/xsettings.c
+++ b/src/xsettings.c
@@ -121,7 +121,7 @@ store_font_name_changed (const char *newfont)
121} 121}
122#endif /* HAVE_XFT */ 122#endif /* HAVE_XFT */
123 123
124/* Map TOOL_BAR_STYLE from a string to its correspinding Lisp value. 124/* Map TOOL_BAR_STYLE from a string to its corresponding Lisp value.
125 Return Qnil if TOOL_BAR_STYLE is not known. */ 125 Return Qnil if TOOL_BAR_STYLE is not known. */
126 126
127static Lisp_Object 127static Lisp_Object
diff --git a/src/xsmfns.c b/src/xsmfns.c
index 55daec73307..7deac7b14e4 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -462,7 +462,7 @@ x_session_initialize (struct x_display_info *dpyinfo)
462 Vx_session_id = build_string (client_id); 462 Vx_session_id = build_string (client_id);
463 463
464#ifdef USE_GTK 464#ifdef USE_GTK
465 /* GTK creats a leader window by itself, but we need to tell 465 /* GTK creates a leader window by itself, but we need to tell
466 it about our client_id. */ 466 it about our client_id. */
467 gdk_x11_set_sm_client_id (client_id); 467 gdk_x11_set_sm_client_id (client_id);
468#else 468#else
diff --git a/src/xterm.c b/src/xterm.c
index 9603c41fce2..d5131c9a60c 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -6119,7 +6119,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6119 { 6119 {
6120 /* Gnome shell does not iconify us when C-z is pressed. It hides 6120 /* Gnome shell does not iconify us when C-z is pressed. It hides
6121 the frame. So if our state says we aren't hidden anymore, 6121 the frame. So if our state says we aren't hidden anymore,
6122 treat is as deiconfied. */ 6122 treat it as deiconified. */
6123 if (! f->async_iconified) 6123 if (! f->async_iconified)
6124 SET_FRAME_GARBAGED (f); 6124 SET_FRAME_GARBAGED (f);
6125 f->async_visible = 1; 6125 f->async_visible = 1;
diff --git a/src/xterm.h b/src/xterm.h
index af2e94ed112..92761ccee87 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -330,7 +330,7 @@ struct x_display_info
330 ptrdiff_t x_dnd_atoms_length; 330 ptrdiff_t x_dnd_atoms_length;
331 331
332 /* Extended window manager hints, Atoms supported by the window manager and 332 /* Extended window manager hints, Atoms supported by the window manager and
333 atoms for settig the window type. */ 333 atoms for setting the window type. */
334 Atom Xatom_net_supported, Xatom_net_supporting_wm_check; 334 Atom Xatom_net_supported, Xatom_net_supporting_wm_check;
335 Atom *net_supported_atoms; 335 Atom *net_supported_atoms;
336 int nr_net_supported_atoms; 336 int nr_net_supported_atoms;