summaryrefslogtreecommitdiff
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 @@
-2011-11-02 Paul Eggert <eggert@cs.ucla.edu>
+2011-11-18 Paul Eggert <eggert@cs.ucla.edu>
Fix integer width and related bugs (Bug#9874).
* alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
@@ -786,6 +786,364 @@
rather than rolling our own approximation.
(SCROLL_BAR_VEC_SIZE): Remove; not used.
+2011-11-18 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix minor problems found by static checking.
+ * dispextern.h, xdisp.c (row_hash): Declare extern only if XASSERTS.
+ * dispnew.c (verify_row_hash): Now static.
+
+2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
+
+2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * intervals.c: Fix grafting over the whole buffer (bug#10071).
+ (graft_intervals_into_buffer): Simplify.
+
+2011-11-18 Eli Zaretskii <eliz@gnu.org>
+
+ * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
+ hash values of the two rows.
+ (copy_row_except_pointers): Preserve the used[] arrays and the
+ hash values of the two rows. (Bug#10035)
+ (add_row_entry): Add xassert to verify that ROW's hash code is valid.
+
+ * xdisp.c (row_hash): New function, body extracted from
+ compute_line_metrics.
+ (compute_line_metrics): Call row_hash, instead of computing the
+ hash code inline.
+
+ * dispnew.c (verify_row_hash): Call row_hash for computing the
+ hash code of a row, instead of duplicating code from xdisp.c.
+
+ * dispextern.h (row_hash): Add prototype.
+
+2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
+
+ * frame.c (delete_frame): Don't delete the terminal when the last
+ X frame is closed if emacs is built with GTK toolkit.
+
+2011-11-17 Juanma Barranquero <lekktu@gmail.com>
+
+ * window.c (syms_of_window) <window-combination-resize>: Fix typo.
+
+2011-11-17 Martin Rudalics <rudalics@gmx.at>
+
+ * window.c (Vwindow_splits): Rename to
+ Vwindow_combination_resize. Suggested by Juri Linkov.
+ (Fsplit_window_internal): Use Vwindow_combination_resize instead
+ of Vwindow_splits.
+
+2011-11-16 Juanma Barranquero <lekktu@gmail.com>
+
+ * nsfns.m (Fns_font_name):
+ * window.c (syms_of_window) <window-combination-limit>: Fix typos.
+
+2011-11-16 Martin Rudalics <rudalics@gmx.at>
+
+ * window.h (window): Rename slot "nest" to "combination_limit".
+ * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
+ (Fset_window_nest): Rename to Fset_window_combination_limit.
+ (Vwindow_nest): Rename to Vwindow_combination_limit.
+ (recombine_windows, make_parent_window, make_window)
+ (Fsplit_window_internal, saved_window)
+ (Fset_window_configuration, save_window_save): Rename all
+ occurrences of window_nest to window_combination_limit.
+
+2011-11-15 Juanma Barranquero <lekktu@gmail.com>
+
+ * image.c (imagemagick_load_image): Fix typo.
+
+2011-11-14 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (display_line): Move the call to
+ highlight_trailing_whitespace before the call to
+ compute_line_metrics, since the latter needs to see the final
+ faces of all the glyphs to compute ROW's hash value. Fixes
+ assertion violations in row_equal_p. (Bug#10035)
+
+2011-11-14 Juanma Barranquero <lekktu@gmail.com>
+
+ * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
+ just return (bug#10044).
+
+2011-11-12 Eli Zaretskii <eliz@gnu.org>
+
+ * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
+ with user-defined heap size. Bump the default size of the temacs
+ heap to 27MB, to avoid memory warning when running temacs.
+ ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
+
+ * dispnew.c (scrolling_window): Fix incorrect indices in accessing
+ current_matrix and desired_matrix. (Bug#9990)
+ (verify_row_hash) [XASSERTS]: New function.
+ (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
+ that the hash value of glyph rows is correct.
+
+2011-11-12 Martin Rudalics <rudalics@gmx.at>
+
+ * window.h (window): Remove splits slot.
+ * window.c (Fwindow_splits, Fset_window_splits): Remove.
+ (Fdelete_other_windows_internal, make_parent_window)
+ (make_window, Fsplit_window_internal, Fdelete_window_internal)
+ (Fset_window_configuration, save_window_save): Don't deal with
+ split status of windows.
+ (saved_window): Remove splits slot.
+ (Vwindow_splits): Rewrite doc-string.
+
+2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xfns.c (unwind_create_frame):
+ * nsfns.m (unwind_create_frame):
+ * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
+ Vframe_list (Bug#9999).
+
+2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
+
+2011-11-11 Kenichi Handa <handa@m17n.org>
+
+ * callproc.c (Fcall_process): Set the member dst_multibyte of
+ process_coding.
+
+2011-11-11 Johan Bockgård <bojohan@gnu.org>
+
+ * xdisp.c (fill_composite_glyph_string): Always set s->face, to
+ avoid a crash (bug#9496).
+
+2011-11-09 Chong Yidong <cyd@gnu.org>
+
+ * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
+ (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
+
+2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
+
+ * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
+
+2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
+
+ Avoid some portability problems by eschewing 'extern inline' functions.
+ The trivial performance wins aren't worth the portability hassles; see
+ <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
+ et seq.
+ * dispextern.h (window_box, window_box_height, window_text_bottom_y)
+ (window_box_width, window_box_left, window_box_left_offset)
+ (window_box_right, window_box_right_offset): Undo previous change,
+ by removing the "extern"s.
+ * intervals.c (adjust_intervals_for_insertion)
+ (adjust_intervals_for_deletion): Undo previous change,
+ making these static again.
+ (offset_intervals, temp_set_point_both, temp_set_point)
+ (copy_intervals_to_string): No longer inline.
+ * xdisp.c (window_text_bottom_y, window_box_width)
+ (window_box_height, window_box_left_offset)
+ (window_box_right_offset, window_box_left, window_box_right)
+ (window_box): No longer inline.
+
+2011-11-08 Chong Yidong <cyd@gnu.org>
+
+ * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
+ (Fwindow_body_height, Fwindow_body_width): Move from Lisp. Signal
+ an error if not a live window.
+ (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
+ (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
+
+2011-11-07 Juanma Barranquero <lekktu@gmail.com>
+
+ * lisp.h (syms_of_abbrev): Remove declaration.
+ Reported by CHENG Gao <chenggao@royau.me>.
+
+2011-11-07 Eli Zaretskii <eliz@gnu.org>
+
+ * w32.c (check_windows_init_file): Don't look for term/w32-win.el
+ if Vpurify_flag is non-nil. Fixes a crash when running w32 build
+ of temacs in GUI mode.
+
+2011-11-07 Martin Rudalics <rudalics@gmx.at>
+
+ * window.h: Declare delete_all_child_windows instead of
+ delete_all_subwindows.
+ * window.c (Fwindow_nest, Fset_window_nest)
+ (Fset_window_new_total, Fset_window_new_normal)
+ (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
+ (delete_all_subwindows): Rename to delete_all_child_windows.
+ (Fdelete_other_windows_internal, Fset_window_configuration):
+ Call delete_all_child_windows instead of delete_all_subwindows.
+ * frame.c (delete_frame): Call delete_all_child_windows instead
+ of delete_all_subwindows.
+
+2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
+
+ * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
+ This is also needed for porting to any host where GC_MARK_STACK is
+ not GC_MAKE_GCPROS_NOOPS.
+ (which_symbols): Use it.
+
+2011-11-07 Kenichi Handa <handa@m17n.org>
+
+ * coding.c (coding_set_destination): Check coding->src_pos only
+ when coding->src_object is a buffer (bug#9910).
+
+ * process.c (send_process): Set the member src_multibyte of coding
+ to 0 (bug#9911) when sending a unibyte text.
+
+ * callproc.c (Fcall_process): Set the member src_multibyte of
+ process_coding to 0 (bug#9912).
+
+2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * xmenu.c (cleanup_widget_value_tree): New function.
+ (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
+ calling free_menubar_widget_value_tree directly (Bug#9830).
+
+2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix some portability problems with 'inline'.
+ * dispextern.h (window_box, window_box_height, window_text_bottom_y)
+ (window_box_width, window_box_left, window_box_left_offset)
+ (window_box_right, window_box_right_offset): Declare extern.
+ Otherwise, these inline functions do not conform to C99 and
+ are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
+ <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
+ * intervals.c (adjust_intervals_for_insertion)
+ (adjust_intervals_for_deletion): Now extern, because otherwise the
+ extern inline functions 'offset_intervals' couldn't refer to it.
+ (static_offset_intervals): Remove.
+ (offset_intervals): Rewrite using the old contents of
+ static_offset_intervals. The old version didn't conform to C99
+ because an extern inline function contained a reference to an
+ identifier with static linkage.
+
+2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
+
+ * keyboard.c (interrupt_signal): Don't call kill-emacs while in
+ GC.
+
+2011-11-06 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (init_iterator, reseat_to_string): Don't set the
+ iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
+ (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
+ return Qleft_to_right.
+
+2011-11-06 Chong Yidong <cyd@gnu.org>
+
+ * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
+ (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
+ (Fset_window_splits, Fwindow_nest, Fset_window_nest)
+ (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
+ (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
+ (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
+ (Fwindow_vscroll): Doc fix.
+ (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
+ argument, since it makes no sense to pass a live window and for
+ consistency with window-child.
+
+2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
+
+ * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
+ support MSVC.
+
+2011-11-05 Jason Rumney <jasonr@gnu.org>
+
+ * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
+ (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
+ fonts (Bug#6029).
+ (add_font_entity_to_list): Fix logic errors in mixed boolean and
+ bitwise arithmetic preventing use of unicode-sip and non-truetype
+ opentype fonts.
+
+2011-11-05 Eli Zaretskii <eliz@gnu.org>
+
+ * s/ms-w32.h (fstat, stat, utime): Move redirections to
+ "emacs"-only part.
+
+ * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
+ initialization code to keep similarity to xfns.c after changes
+ from 2011-11-05.
+
+2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
+
+ * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
+ (unwind_create_frame): New function (Bug#9943).
+ (Fx_create_frame): Restructure code to be more similar to the one in
+ xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
+ Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
+ Move terminal->reference_count++ just before making the frame official
+ (Bug#9943).
+
+ * nsterm.m (x_free_frame_resources): New function.
+ (x_destroy_window): Move code to x_free_frame_resources.
+
+ * xfns.c (unwind_create_frame): Fix comment.
+ (Fx_create_frame, x_create_tip_frame): Move
+ terminal->reference_count++ just before making the frame
+ official. Move initialization of image_cache_refcount and
+ dpyinfo_refcount before calling init_frame_faces (Bug#9943).
+
+2011-11-05 Eli Zaretskii <eliz@gnu.org>
+
+ Support MSVC build with newer versions of Visual Studio.
+ * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
+ Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
+ nt/gmake.defs.
+
+ * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
+ which are not supported by MSVC.
+ (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
+ (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
+ bitfields.
+ (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
+ types in bitfields.
+ (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
+
+ * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
+
+2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
+
+ Support MSVC build with newer versions of Visual Studio.
+ * w32.c: Don't include w32api.h for MSVC.
+ (init_environment) [_MSC_VER]: Call sys_access, not _access.
+
+ * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
+ [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
+ (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
+ (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
+ e_* cousins.
+ (alloca) [_MSC_VER]: Define to _alloca.
+
+ * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
+
+ * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
+
+2011-11-04 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (note_mouse_highlight): If either of
+ previous/next-single-property-change returns nil, treat that as
+ the beginning or the end of the buffer. (Bug#9955)
+
+2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
+
+ * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
+ label is not null (Bug#9951).
+ (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
+ may be NULL.
+
+2011-11-04 Eli Zaretskii <eliz@gnu.org>
+
+ * window.c (Fwindow_body_size): Mention in the doc string that the
+ return value is in frame's canonical units. (Bug#9949)
+
+2011-11-03 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
+
+ * w32fns.c (unwind_create_frame): If needed, free the glyph
+ matrices of the partially constructed frame. (Bug#9943)
+ * xfns.c (unwind_create_frame): Likewise.
+
2011-11-01 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
@@ -805,7 +1163,7 @@
* xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
past the beginning of the current glyph matrix.
-2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
+2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
* xterm.c: Include X11/Xproto.h if HAVE_GTK3.
(x_error_handler): Ignore BadMatch for X_SetInputFocus for
@@ -839,7 +1197,7 @@
Fix the `xbytecode' command.
* .gdbinit (xprintbytestr): New command.
- (xwhichsymbols): Renamed from `which'; all callers changed.
+ (xwhichsymbols): Rename from `which'; all callers changed.
(xbytecode): Print the byte-code string as well.
2011-10-29 Kim Storm <storm@cua.dk>
@@ -3511,6 +3869,9 @@
2011-07-08 Jason Rumney <jasonr@gnu.org>
+ * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
+ SH_SHOW for hidden windows (Bug#5482).
+
* w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
frame struct members of non-existent frames (Bug#6284).
@@ -3530,7 +3891,7 @@
* nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
cString and lossyCString on OSX >= 10.4
- * nsmenu.m (fillWithWidgetValue): Don't use depercated method
+ * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
sizeToFit on OSX >= 10.2.
* 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 @@
Copy their own header field a_scovfrl from ohdr.
* unexec.c [COFF]:
- Round positions of text and and data sections in output file
+ Round positions of text and data sections in output file
to page boundaries.
* crt0.c: Install version for Encore machines.
@@ -2375,7 +2375,7 @@
Often, just return what it returned.
`error' still never returns to its caller.
- * Signalling Qargs_out_of_range:
+ * Signaling Qargs_out_of_range:
Use new functions args_out_of_range and args_out_of_range_3
(in data.c) to do this.
@@ -3537,4 +3537,3 @@
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
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 @@
it can be called in a signal handler.
(x_catch_errors_unwind): Function deleted.
(x_uncatch_errors): Deallocate last x_error_message_stack struct.
- (x_check_errors): Call x_uncatch_errors before signalling error.
+ (x_check_errors): Call x_uncatch_errors before signaling error.
(x_load_font, x_term_init, XTmouse_position, handle_one_xevent)
(x_connection_closed, x_list_fonts): Use new versions of
@@ -19139,7 +19139,7 @@
(font_rescale_ratio): New function.
(split_font_name): If NUMERIC_P is nonzero, set font->rescale_ratio.
(better_font_p): On comparing point sized, pay attention to
- recale_ratio member of fonts.
+ rescale_ratio member of fonts.
(build_scalable_font_name): Reflect font->rescale_ratio in the
font name.
(syms_of_xfaces): Declare Vface_font_rescale_alist as a Lisp variable.
@@ -20702,11 +20702,11 @@
(free_frame_menubar): Only compile if not USE_GTK. GTK version
is in gtkutil.c.
(popup_selection_callback): New version for USE_GTK.
- (create_and_show_popup_menu): New fuction, one USE_GTK version and
+ (create_and_show_popup_menu): New function, one USE_GTK version and
one USE_X_TOOLKIT version.
(xmenu_show): Call create_and_show_popup_menu.
(dialog_selection_callback): New version for USE_GTK.
- (create_and_show_dialog): New fuction, one USE_GTK version and
+ (create_and_show_dialog): New function, one USE_GTK version and
one USE_X_TOOLKIT version.
(xdialog_show): Call create_and_show_dialog.
@@ -22780,7 +22780,7 @@
2002-07-23 Kenichi Handa <handa@etl.go.jp>
* xdisp.c (face_before_or_after_it_pos):
- Call FETCH_MULTIBYTE_CHAR with byte postion, not char position.
+ Call FETCH_MULTIBYTE_CHAR with byte position, not char position.
2002-07-22 Juanma Barranquero <lektu@terra.es>
@@ -27928,4 +27928,3 @@ See ChangeLog.9 for earlier changes.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
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 @@
2010-05-11 Karel Klíč <kklic@redhat.com>
* ftfont.c: Fix incorrect parentheses of #if condition for
- definining M17N_FLT_USE_NEW_FEATURE.
+ defining M17N_FLT_USE_NEW_FEATURE.
2010-05-11 Glenn Morris <rgm@gnu.org>
@@ -11972,7 +11972,7 @@
* image.c (xbm_read_bitmap_data): New arg inhibit_image_error.
(xbm_load_image): Caller changed.
- (xbm_file_p): Avoid signalling an image_error (Bug#4107).
+ (xbm_file_p): Avoid signaling an image_error (Bug#4107).
2009-08-13 Nick Roberts <nickrob@snap.net.nz>
@@ -16658,7 +16658,7 @@
2008-08-20 Chong Yidong <cyd@stupidchicken.com>
* xselect.c (x_get_foreign_selection): Return nil if desired
- selection could not be obtained, instead of signalling an error.
+ selection could not be obtained, instead of signaling an error.
2008-08-20 David Reitter <david.reitter@gmail.com>
@@ -23551,7 +23551,7 @@
STORE_XCHARB a valid l-value.
* w32term.c (w32_native_per_char_metric): Swap width and rbearing
- calculations for non-Truetype fonts.
+ calculations for non-TrueType fonts.
(x_draw_glyph_string): Sync with xterm.c.
(x_draw_glyph_string_foreground) [USE_FONT_BACKEND]:
Remove redundant code.
@@ -25474,7 +25474,7 @@
* term.c (terminal_encode_buffer): Make externally visible.
- * makefile.w32-in: Add character.h dependancies.
+ * makefile.w32-in: Add character.h dependencies.
(character.o, chartab.o): New targets.
2008-02-01 Kenichi Handa <handa@m17n.org>
@@ -26748,7 +26748,7 @@
2008-02-01 Kenichi Handa <handa@m17n.org>
* xdisp.c (face_before_or_after_it_pos):
- Call FETCH_MULTIBYTE_CHAR with byte postion, not char position.
+ Call FETCH_MULTIBYTE_CHAR with byte position, not char position.
2008-02-01 Kenichi Handa <handa@m17n.org>
@@ -29718,7 +29718,7 @@
* keyboard.c (restore_kboard_configuration): Only define when
MULTI_KBOARD defined.
- * makefile.w32-in: Update dependancies from Makefile.in.
+ * makefile.w32-in: Update dependencies from Makefile.in.
(OBJ1): Add terminal.$(O)
* 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 @@
1987-07-10 Chris Hanson (cph@prep)
* xterm.h: Define macros to abstract control of input signals.
- Alternate set of macros for hp-ux does no signalling.
+ Alternate set of macros for hp-ux does no signaling.
* xterm.c:
* xfns.c:
@@ -4787,4 +4787,3 @@ See ChangeLog.1 for earlier changes.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
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 @@
invalid overlay.
(syms_of_buffer): defsubr Soverlayp; initialize Qoverlayp.
(Fdelete_overlay): Set the overlay's markers to point nowhere.
- Use CHECK_OVERLAY instead of signalling a special error.
+ Use CHECK_OVERLAY instead of signaling a special error.
(Fmove_overlay, Foverlay_put): Use CHECK_OVERLAY instead of
- signalling a special error.
+ signaling a special error.
(Foverlay_get): Use CHECK_OVERLAY.
* fns.c (internal_equal): Define this for overlays.
* buffer.h (OVERLAY_VALID): Define in terms of OVERLAYP.
@@ -5549,7 +5549,7 @@
h->poll_suppress_count.
* eval.c (Fsignal): It's okay for the debugger to return to the
- caller if the caller was signalling a quit.
+ caller if the caller was signaling a quit.
* eval.c (unbind_catch): Restore the polling suppression count
here, instead of in Fsignal and Fthrow.
@@ -10592,7 +10592,7 @@
(init_x_parm_symbols, x_set_screen_param): Use x_screen_parms
instead of a large switch statement.
(x_figure_window_size): Make the default case of the switch call
- abort instead of signalling an error, since window_prompting's
+ abort instead of signaling an error, since window_prompting's
value is internally generated.
1991-05-01 Jim Blandy (jimb@churchy.gnu.ai.mit.edu)
@@ -13393,7 +13393,7 @@
* macros.c (Fstart_kbd_macro): Local cleanup.
- * minibuf.c (read_minibuf): No more delcaration of
+ * minibuf.c (read_minibuf): No more declaration of
Frestore_screen_configuration.
* search.c (Fregexp_quote): Simplified.
@@ -14884,7 +14884,7 @@
1989-08-07 Richard Stallman (rms@sugar-bombs.ai.mit.edu)
- * fileio.c (barf_or_query_if_file_exists): When signalling,
+ * fileio.c (barf_or_query_if_file_exists): When signaling,
provide the expected args for a file-error.
1989-08-06 Richard Stallman (rms@sugar-bombs.ai.mit.edu)
@@ -15414,7 +15414,7 @@
* xfns.c (Fx_create_screen): If user has specified
`x-iconic-startup' then start emacs in iconic form.
Look for icon position in `icon-left' and `icon-top', or use
- window postion.
+ window position.
* xterm.c (x_term_init): If server doesn't respond, use fatal
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 @@
1994-04-28 Michael D. Ernst (mernst@monozygote.research.microsoft.com)
- * fileio.c (inhibit-file-name-handers): Correct documentation.
+ * fileio.c (inhibit-file-name-handlers): Correct documentation.
1994-04-28 Karl Heuer (kwzh@hal.gnu.ai.mit.edu)
@@ -1885,7 +1885,7 @@
1994-03-22 Frederic Pierresteguy (fp@mole.gnu.ai.mit.edu)
* widget.c (set_frame_size): Put #if 0 around a lot of useless code.
- Compute explicitely the geometry of the toplevel widget.
+ Compute explicitly the geometry of the toplevel widget.
Call XtSetValues not XtVaSetValues.
1994-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 @@
ntproc.c and simplified to match other changes (all handles are
already non-inheritable).
- (get_emacs_configuration): Detect Windows flavour (Windows 95 or
+ (get_emacs_configuration): Detect Windows flavor (Windows 95 or
NT) at run-time. Change OS name for Windows 95 to be "win95".
(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 @@
* coding.h (Qemacs_mule): Extern it.
- * process.c (init_process): Initilize Vdefault_process_coding_system.
+ * process.c (init_process): Initialize Vdefault_process_coding_system.
1998-06-26 Kenichi Handa <handa@etl.go.jp>
@@ -972,7 +972,7 @@
1998-06-01 Ken'ichi Handa <handa@melange.gnu.org>
- * coding.c (detect_coding_mask): Initilize local variable C.
+ * coding.c (detect_coding_mask): Initialize local variable C.
1998-06-01 Richard Stallman <rms@gnu.org>
@@ -5943,7 +5943,7 @@
Vauto_file_coding_system.
(syms_of_fileio): Adjusted for the above change. Doc change.
(Finsert_file_contents): The argument for Vset_auto_coding is a
- concatination of the heading 1K-byte and the tailing 3K-byte.
+ concatenation of the heading 1K-byte and the tailing 3K-byte.
* cmds.c (internal_self_insert): Only set TARGET_CLM when C2 is tab.
When multibyte characters are disabled,
@@ -6317,7 +6317,7 @@
(ENCODE_ISO_CHARACTER_DIMENSION2): Likewise.
(safe_terminal_coding): New variable.
(Fset_safe_terminal_coding_system_internal): New function.
- (init_coding_once): Initilize safe_terminal_coding.
+ (init_coding_once): Initialize safe_terminal_coding.
(syms_of_coding): Declare set-safe-terminal-coding-system as a
Lisp function.
@@ -7399,7 +7399,7 @@
1997-06-18 Kenichi Handa <handa@etl.go.jp>
- * coding.c (detect_coding_iso2022): Initilize mask correctly.
+ * coding.c (detect_coding_iso2022): Initialize mask correctly.
* fns.c (concat): Pay attention to multibyte characters when
TARGET_TYPE is Lisp_String.
@@ -7485,7 +7485,7 @@
1997-06-09 Kenichi Handa <handa@etl.go.jp>
- * buffer.c (init_buffer_once): Inititialize the member
+ * buffer.c (init_buffer_once): Initialize the member
buffer_file_coding_system.
(syms_of_buffer): Declare Lisp variables
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 @@
1999-11-28 Eli Zaretskii <eliz@is.elta.co.il>
* charset.c (Fmake_char_internal): Print the charset ID when
- signalling an error.
+ signaling an error.
* emacs.c (synchronize_locale): Avoid compiler warnings about
pointer type mismatch.
@@ -2196,7 +2196,7 @@
1999-09-14 Gerd Moellmann <gerd@gnu.org>
- * sound.c (Fplay_sound): Remove usused variables.
+ * sound.c (Fplay_sound): Remove unused variables.
(be2hs): Put in #if 0 because it's currently not used.
1999-09-14 Ken Raeburn <raeburn@gnu.org>
@@ -7367,7 +7367,7 @@
* xfaces.c (free_font): Removed.
(load_face_font_or_fontset): Renamed from load_font.
- (load_face_font_or_fontset): Use message2 instead of signalling.
+ (load_face_font_or_fontset): Use message2 instead of signaling.
(load_color): Likewise.
(load_pixmap): Likewise.
@@ -13404,7 +13404,7 @@
1998-10-20 Jason Rumney <jasonr@altavista.net>
- * makefile.nt (w32fns.c): Add x-list-font.c to dependancies.
+ * makefile.nt (w32fns.c): Add x-list-font.c to dependencies.
* w32faces.c: Update comments referring to obsolete structs.
(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 @@
* lisp.h (detect_coding_system): Prototype adjusted.
* coding.c (ONE_MORE_BYTE_CHECK_MULTIBYTE): New macro.
- (detect_coding_emacs_mule, detect_coding_iso2022,)
+ (detect_coding_emacs_mule, detect_coding_iso2022)
(detect_coding_sjis, detect_coding_big5, detect_coding_utf_8)
(detect_coding_utf_16, detect_coding_ccl): Make them static.
New argument MULTIBYTEP. Callers changed.
@@ -8409,7 +8409,7 @@
(encode_coding_iso2022): New local variable safe_chars. Check
unsafe chars.
(setup_coding_system): Delete the code to initialize
- coding->safe_charses.
+ coding->safe_charsets.
(intersection, find_safe_codings): New functions.
(Ffind_coding_systems_region_internal): New function.
(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);
on free lists recognizable in O(1). */
static Lisp_Object Vdead;
+#define DEADP(x) EQ (x, Vdead)
#ifdef GC_MALLOC_CHECK
@@ -411,6 +412,10 @@ static void check_gcpros (void);
#endif /* GC_MARK_STACK || GC_MALLOC_CHECK */
+#ifndef DEADP
+# define DEADP(x) 0
+#endif
+
/* Recording what needs to be marked for gc. */
struct gcpro *gcprolist;
@@ -877,7 +882,7 @@ safe_alloca_unwind (Lisp_Object arg)
/* Like malloc but used for allocating Lisp data. NBYTES is the
number of bytes to allocate, TYPE describes the intended use of the
- allcated memory block (for strings, for conses, ...). */
+ allocated memory block (for strings, for conses, ...). */
#ifndef USE_LSB_TAG
static void *lisp_malloc_loser;
@@ -1407,7 +1412,7 @@ uninterrupt_malloc (void)
#ifdef DOUG_LEA_MALLOC
pthread_mutexattr_t attr;
- /* GLIBC has a faster way to do this, but lets keep it portable.
+ /* GLIBC has a faster way to do this, but let's keep it portable.
This is according to the Single UNIX Specification. */
pthread_mutexattr_init (&attr);
pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE);
@@ -6262,7 +6267,7 @@ which_symbols (Lisp_Object obj, EMACS_INT find_max)
ptrdiff_t gc_count = inhibit_garbage_collection ();
Lisp_Object found = Qnil;
- if (!EQ (obj, Vdead))
+ if (! DEADP (obj))
{
for (sblk = symbol_block; sblk; sblk = sblk->next)
{
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;
is currently mapped. Used to prevent overwriting an existing
memory mapping.
- Default is to conservativly assume the address range is occupied by
+ Default is to conservatively assume the address range is occupied by
something else. This can be overridden by system configuration
files if system-specific means to determine this exists. */
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
/* A list of currently active byte-code execution value stacks.
Fbyte_code adds an entry to the head of this list before it starts
processing byte-code, and it removed the entry again when it is
- done. Signalling an error truncates the list analoguous to
+ done. Signaling an error truncates the list analogous to
gcprolist. */
struct 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) */)
/* If BUFFER is nil, we must read process output once and then
discard it, so setup coding system but with nil. */
setup_coding_system (Qnil, &process_coding);
+ process_coding.dst_multibyte = 0;
}
else
{
@@ -757,7 +758,10 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
&& !NILP (val))
val = raw_text_coding_system (val);
setup_coding_system (val, &process_coding);
+ process_coding.dst_multibyte
+ = ! NILP (BVAR (current_buffer, enable_multibyte_characters));
}
+ process_coding.src_multibyte = 0;
immediate_quit = 1;
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;
#define CCL_Extension 0x1F /* Extended CCL code
1:ExtendedCOMMNDRrrRRRrrrXXXXX
- 2:ARGUEMENT
+ 2:ARGUMENT
3:...
------------------------------
extended_command (rrr,RRR,Rrr,ARGS)
@@ -484,7 +484,7 @@ static Lisp_Object Vccl_program_table;
If the element is t or lambda, finish without changing reg[rrr].
If the element is a number, set reg[rrr] to the number and finish.
- Detail of the map structure is descibed in the comment for
+ Detail of the map structure is described in the comment for
CCL_MapMultiple below. */
#define CCL_IterateMultipleMap 0x10 /* Iterate multiple maps
@@ -1762,7 +1762,7 @@ ccl_driver (struct ccl_program *ccl, int *source, int *destination, int src_size
case CCL_STAT_QUIT:
if (! ccl->quit_silently)
- sprintf (msg, "\nCCL: Quited.");
+ sprintf (msg, "\nCCL: Quitted.");
break;
default:
@@ -1808,7 +1808,7 @@ ccl_driver (struct ccl_program *ccl, int *source, int *destination, int src_size
/* Resolve symbols in the specified CCL code (Lisp vector). This
function converts symbols of code conversion maps and character
- translation tables embeded in the CCL code into their ID numbers.
+ translation tables embedded in the CCL code into their ID numbers.
The return value is a new vector in which all symbols are resolved,
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,
}
/* Arrange unibyte text at STR of NBYTES bytes as a multibyte text.
- It actually converts only such 8-bit characters that don't contruct
+ It actually converts only such 8-bit characters that don't construct
a multibyte sequence to multibyte forms of Latin-1 characters. If
NCHARS is nonzero, set *NCHARS to the number of characters in the
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
non-nil, is an index of a target character in the string.
If the current buffer (or STRING) is multibyte, and the target
-character is not ASCII nor 8-bit character, an error is signalled. */)
+character is not ASCII nor 8-bit character, an error is signaled. */)
(Lisp_Object position, Lisp_Object string)
{
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
/* 1 iff the following table is used for encoder. */
short for_encoder;
- /* When the following table is used for encoding, mininum and
- maxinum character of the current charset. */
+ /* When the following table is used for encoding, minimum and
+ maximum character of the current charset. */
int min_char, max_char;
/* 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
/* Dimension of the charset: 1, 2, 3, or 4. */
int dimension;
- /* Byte code range of each dimension. <code_space>[4N] is a mininum
+ /* Byte code range of each dimension. <code_space>[4N] is a minimum
byte code of the (N+1)th dimension, <code_space>[4N+1] is a
maximum byte code of the (N+1)th dimension, <code_space>[4N+2] is
(<code_space>[4N+1] - <code_space>[4N] + 1), <code_space>[4N+3]
@@ -199,14 +199,14 @@ struct charset
/* The method for encoding/decoding characters of the charset. */
enum charset_method method;
- /* Mininum and Maximum code points of the charset. */
+ /* Minimum and Maximum code points of the charset. */
unsigned min_code, max_code;
/* Offset value used by macros CODE_POINT_TO_INDEX and
INDEX_TO_CODE_POINT. . */
unsigned char_index_offset;
- /* Mininum and Maximum character codes of the charset. If the
+ /* Minimum and Maximum character codes of the charset. If the
charset is compatible with ASCII, min_char is a minimum non-ASCII
character of the charset. If the method of charset is
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),
{
/* Depth of TABLE. */
int depth;
- /* Minimum and maxinum characters covered by TABLE. */
+ /* Minimum and maximum characters covered by TABLE. */
int min_char, max_char;
/* Number of characters covered by one element of TABLE. */
int chars_in_block;
@@ -1196,7 +1196,7 @@ uniprop_table_uncompress (Lisp_Object table, int idx)
}
-/* Decode VALUE as an elemnet of char-table TABLE. */
+/* Decode VALUE as an element of char-table TABLE. */
static Lisp_Object
uniprop_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)
{
if (BUFFERP (coding->dst_object))
{
- if (coding->src_pos < 0)
+ if (BUFFERP (coding->src_object) && coding->src_pos < 0)
{
coding->destination = BEG_ADDR + coding->dst_pos_byte - BEG_BYTE;
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
#define CODING_REQUIRE_DETECTION_MASK 0x1000
#define CODING_RESET_AT_BOL_MASK 0x2000
-/* Return 1 if the coding context CODING requires annotaion
+/* Return 1 if the coding context CODING requires annotation
handling. */
#define CODING_REQUIRE_ANNOTATION(coding) \
((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
if (cmp_it->lookback == 0)
goto no_composition;
lgstring = Qnil;
- /* Try to find a shorter compostion that starts after CPOS. */
+ /* Try to find a shorter composition that starts after CPOS. */
composition_compute_stop_pos (cmp_it, charpos, bytepos, cpos,
string);
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 {
COMPOSITION_NO
};
-/* Maximum number of compoments a single composition can have. */
+/* Maximum number of components a single composition can have. */
#define MAX_COMPOSITION_COMPONENTS 16
/* 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,
If OBJECT is not a symbol, just return it. Otherwise, follow all
function indirections to find the final function binding and return it.
If the final symbol in the chain is unbound, signal a void-function error.
-Optional arg NOERROR non-nil means to return nil instead of signalling.
+Optional arg NOERROR non-nil means to return nil instead of signaling.
Signal a cyclic-function-indirection error if there is a loop in the
function chain of symbols. */)
(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
if (includeall && !canexclude)
{ /* If we have one non-excludable file, we want to exclude the
- excudable files. */
+ excludable files. */
includeall = 0;
/* Throw away any previous excludable match found. */
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);
void w32_init_fringe (struct redisplay_interface *);
void w32_reset_fringes (void);
#endif
+
+#if XASSERTS
+extern unsigned row_hash (struct glyph_row *);
+#endif
+
/* Defined in image.c */
#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
return n;
}
+#if XASSERTS
+/* Return non-zero if ROW's hash value is correct, zero if not. */
+static int
+verify_row_hash (struct glyph_row *row)
+{
+ return row->hash == row_hash (row);
+}
+#endif
/* Adjust glyph matrix MATRIX on window W or on a frame to changed
window sizes.
@@ -600,6 +608,7 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y
row->glyphs[LAST_AREA]
= row->glyphs[LEFT_MARGIN_AREA] + dim.width;
}
+ xassert (!row->enabled_p || verify_row_hash (row));
++row;
}
}
@@ -1063,37 +1072,55 @@ swap_glyphs_in_rows (struct glyph_row *a, struct glyph_row *b)
#endif /* 0 */
-/* Exchange pointers to glyph memory between glyph rows A and B. */
+/* Exchange pointers to glyph memory between glyph rows A and B. Also
+ exchange the used[] array and the hash values of the rows, because
+ these should all go together for the row's hash value to be
+ correct. */
static inline void
swap_glyph_pointers (struct glyph_row *a, struct glyph_row *b)
{
int i;
+ unsigned hash_tem = a->hash;
+
for (i = 0; i < LAST_AREA + 1; ++i)
{
struct glyph *temp = a->glyphs[i];
+ short used_tem = a->used[i];
+
a->glyphs[i] = b->glyphs[i];
b->glyphs[i] = temp;
+ a->used[i] = b->used[i];
+ b->used[i] = used_tem;
}
+ a->hash = b->hash;
+ b->hash = hash_tem;
}
/* Copy glyph row structure FROM to glyph row structure TO, except
- that glyph pointers in the structures are left unchanged. */
+ that glyph pointers, the `used' counts, and the hash values in the
+ structures are left unchanged. */
static inline void
copy_row_except_pointers (struct glyph_row *to, struct glyph_row *from)
{
struct glyph *pointers[1 + LAST_AREA];
+ short used[1 + LAST_AREA];
+ unsigned hashval;
/* Save glyph pointers of TO. */
memcpy (pointers, to->glyphs, sizeof to->glyphs);
+ memcpy (used, to->used, sizeof to->used);
+ hashval = to->hash;
/* Do a structure assignment. */
*to = *from;
/* Restore original pointers of TO. */
memcpy (to->glyphs, pointers, sizeof to->glyphs);
+ memcpy (to->used, used, sizeof to->used);
+ to->hash = hashval;
}
@@ -1271,6 +1298,9 @@ line_draw_cost (struct glyph_matrix *matrix, int vpos)
static inline int
row_equal_p (struct glyph_row *a, struct glyph_row *b, int mouse_face_p)
{
+ xassert (verify_row_hash (a));
+ xassert (verify_row_hash (b));
+
if (a == b)
return 1;
else if (a->hash != b->hash)
@@ -3467,7 +3497,7 @@ redraw_overlapping_rows (struct window *w, int yb)
if (row->used[RIGHT_MARGIN_AREA])
rif->fix_overlapping_area (w, row, RIGHT_MARGIN_AREA, overlaps);
- /* Record in neighbour rows that ROW overwrites part of
+ /* Record in neighbor rows that ROW overwrites part of
their display. */
if (overlaps & OVERLAPS_PRED)
MATRIX_ROW (w->current_matrix, i - 1)->overlapped_p = 1;
@@ -4209,6 +4239,7 @@ add_row_entry (struct glyph_row *row)
ptrdiff_t i = row->hash % row_table_size;
entry = row_table[i];
+ xassert (entry || verify_row_hash (row));
while (entry && !row_equal_p (entry->row, row, 1))
entry = entry->next;
@@ -4333,10 +4364,10 @@ scrolling_window (struct window *w, int header_line_p)
j = last_old;
while (i - 1 > first_new
&& j - 1 > first_old
- && MATRIX_ROW (current_matrix, i - 1)->enabled_p
- && (MATRIX_ROW (current_matrix, i - 1)->y
- == MATRIX_ROW (desired_matrix, j - 1)->y)
- && !MATRIX_ROW (desired_matrix, j - 1)->redraw_fringe_bitmaps_p
+ && MATRIX_ROW (current_matrix, j - 1)->enabled_p
+ && (MATRIX_ROW (current_matrix, j - 1)->y
+ == MATRIX_ROW (desired_matrix, i - 1)->y)
+ && !MATRIX_ROW (desired_matrix, i - 1)->redraw_fringe_bitmaps_p
&& row_equal_p (MATRIX_ROW (desired_matrix, i - 1),
MATRIX_ROW (current_matrix, j - 1), 1))
--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/>. */
of the (`int') argument, suitable for display in an Emacs buffer.
. For %s and %c, when field width is specified (e.g., %25s), it accounts for
- the diplay width of each character, according to char-width-table. That
+ the display width of each character, according to char-width-table. That
is, it does not assume that each character takes one column on display.
. 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
#endif
/* argmatch must not be used after here,
- except when bulding temacs
+ except when building temacs
because the -d argument has not been skipped in skip_args. */
#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;
-/* Creaters of font-related Lisp object. */
+/* Creators of font-related Lisp object. */
static Lisp_Object
font_make_spec (void)
@@ -802,7 +802,7 @@ font_expand_wildcards (Lisp_Object *field, int n)
struct {
/* Minimum possible field. */
int from;
- /* Maxinum possible field. */
+ /* Maximum possible field. */
int to;
/* Bit mask of possible field. Nth bit corresponds to Nth field. */
int mask;
@@ -954,7 +954,7 @@ font_expand_wildcards (Lisp_Object *field, int n)
}
}
- /* Decide all fileds from restrictions in RANGE. */
+ /* Decide all fields from restrictions in RANGE. */
for (i = j = 0; i < n ; i++)
{
if (j < range[i].from)
@@ -5147,7 +5147,7 @@ the corresponding glyph code. If ENCODING is a char-table, looking up
the table by a character gives the corresponding glyph code.
REPERTORY specifies a repertory of characters supported by the font.
-If REPERTORY is a charset, all characters beloging to the charset are
+If REPERTORY is a charset, all characters belonging to the charset are
supported. If REPERTORY is a char-table, all characters who have a
non-nil value in the table are supported. If REPERTORY is nil, Emacs
gets 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
/* Optional.
Store bitmap data for glyph-code CODE of FONT in BITMAP. It is
- intended that this method is callled from the other font-driver
+ intended that this method is called from the other font-driver
for actual drawing. */
int (*get_bitmap) (struct font *font, unsigned code,
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)
nescs++;
}
- /* If PATTERN is not full XLFD we conert "*" to ".*". Otherwise
+ /* If PATTERN is not full XLFD we convert "*" to ".*". Otherwise
we convert "*" to "[^-]*" which is much faster in regular
expression matching. */
if (ndashes < 14)
@@ -1704,7 +1704,7 @@ static Lisp_Object auto_fontset_alist;
/* Number of automatically created fontsets. */
static ptrdiff_t num_auto_fontsets;
-/* Retun a fontset synthesized from FONT-OBJECT. This is called from
+/* Return a fontset synthesized from FONT-OBJECT. This is called from
x_new_font when FONT-OBJECT is used for the default ASCII font of a
frame, and the returned fontset is used for the default fontset of
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)
/* Return a cons (FONT-OBJECT . GLYPH-CODE).
FONT-OBJECT is the font for the character at POSITION in the current
buffer. This is computed from all the text properties and overlays
- that apply to POSITION. POSTION may be nil, in which case,
+ that apply to POSITION. POSITION may be nil, in which case,
FONT-SPEC is the font for displaying the character CH with the
default face.
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)
else
{
#ifdef HAVE_X_WINDOWS
- /* Also, save clipboard to the the clipboard manager. */
+ /* Also, save clipboard to the clipboard manager. */
x_clipboard_manager_save_frame (frame);
#endif
@@ -1320,7 +1320,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
/* Mark all the windows that used to be on FRAME as deleted, and then
remove the reference to them. */
- delete_all_subwindows (f->root_window);
+ delete_all_child_windows (f->root_window);
f->root_window = Qnil;
Vframe_list = Fdelq (frame, Vframe_list);
@@ -1359,6 +1359,13 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
/* If needed, delete the terminal that this frame was on.
(This must be done after the frame is killed.) */
terminal->reference_count--;
+#ifdef USE_GTK
+ /* FIXME: Deleting the terminal crashes emacs because of a GTK
+ bug.
+ http://lists.gnu.org/archive/html/emacs-devel/2011-10/msg00363.html */
+ if (terminal->reference_count == 0 && terminal->type == output_x_window)
+ terminal->reference_count = 1;
+#endif /* USE_GTK */
if (terminal->reference_count == 0)
{
Lisp_Object tmp;
@@ -2490,7 +2497,7 @@ If FRAME is omitted, the selected frame is used. The exact value
of the result depends on the window-system and toolkit in use:
In the Gtk+ version of Emacs, it includes only any window (including
-the minibuffer or eacho area), mode line, and header line. It does not
+the minibuffer or echo area), mode line, and header line. It does not
include the tool bar or menu bar.
With 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
if greater than 1, then the frame is obscured - we still consider
it to be "visible" as seen from lisp, but we don't bother
updating it. We must take care to garbage the frame when it
- ceaces to be obscured though.
+ ceases to be obscured though.
iconified is nonzero if the frame is currently iconified.
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)
/* For the image defined in IMG, make and return a GtkImage. For displays with
8 planes or less we must make a GdkPixbuf and apply the mask manually.
- Otherwise the highlightning and dimming the tool bar code in GTK does
+ Otherwise the highlighting and dimming the tool bar code in GTK does
will look bad. For display with more than 8 planes we just use the
pixmap and mask directly. For monochrome displays, GTK doesn't seem
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)
}
}
-/* Resize the outer window of frame F after chainging the height.
+/* Resize the outer window of frame F after changing the height.
COLUMNS/ROWS is the size the edit area shall have after the resize. */
void
@@ -1423,7 +1423,7 @@ get_dialog_title (char key)
/* Callback for dialogs that get WM_DELETE_WINDOW. We pop down
the dialog, but return TRUE so the event does not propagate further
in GTK. This prevents GTK from destroying the dialog widget automatically
- and we can always destrou the widget manually, regardles of how
+ and we can always destroy the widget manually, regardless of how
it was popped down (button press or WM_DELETE_WINDOW).
W is the dialog widget.
EVENT is the GdkEvent that represents WM_DELETE_WINDOW (not used).
@@ -2294,7 +2294,7 @@ tearoff_activate (GtkWidget *widget, gpointer client_data)
/* Create a menu item widget, and connect the callbacks.
- ITEM decribes the menu item.
+ ITEM describes the menu item.
F is the frame the created menu belongs to.
SELECT_CB is the callback to use when a menu item is selected.
HIGHLIGHT_CB is the callback to call when entering/leaving menu items.
@@ -4237,7 +4237,7 @@ xg_make_tool_item (FRAME_PTR f,
gtk_container_add (GTK_CONTAINER (weventbox), wb);
gtk_container_add (GTK_CONTAINER (ti), weventbox);
- if (wimage)
+ if (wimage || label)
{
intptr_t ii = i;
gpointer gi = (gpointer) ii;
@@ -4301,21 +4301,21 @@ xg_tool_item_stale_p (GtkWidget *wbutton, const char *stock_name,
GtkWidget *wlbl = xg_get_tool_bar_widgets (vb, &wimage);
/* Check if the tool icon matches. */
- if (stock_name)
+ if (stock_name && wimage)
{
old = g_object_get_data (G_OBJECT (wimage),
XG_TOOL_BAR_STOCK_NAME);
if (!old || strcmp (old, stock_name))
return 1;
}
- else if (icon_name)
+ else if (icon_name && wimage)
{
old = g_object_get_data (G_OBJECT (wimage),
XG_TOOL_BAR_ICON_NAME);
if (!old || strcmp (old, icon_name))
return 1;
}
- else
+ else if (wimage)
{
gpointer gold_img = g_object_get_data (G_OBJECT (wimage),
XG_TOOL_BAR_IMAGE_DATA);
@@ -4330,7 +4330,7 @@ xg_tool_item_stale_p (GtkWidget *wbutton, const char *stock_name,
return 1;
/* Ensure label is correct. */
- if (label)
+ if (label && wlbl)
gtk_label_set_text (GTK_LABEL (wlbl), label);
return 0;
}
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)
}
/* The GIF library also defines DrawRectangle, but its never used in Emacs.
- Therefore rename the function so it doesnt collide with ImageMagick. */
+ Therefore rename the function so it doesn't collide with ImageMagick. */
#define DrawRectangle DrawRectangleGif
#include <wand/MagickWand.h>
@@ -7825,7 +7825,7 @@ imagemagick_load_image (struct frame *f, struct image *img,
if (imagemagick_rendermethod == 1)
{
- /* Magicexportimage is normaly faster than pixelpushing. This
+ /* Magicexportimage is normally faster than pixelpushing. This
method is also well tested. Some aspects of this method are
ad-hoc and needs to be more researched. */
int imagedepth = 24;/*MagickGetImageDepth(image_wand);*/
@@ -7842,7 +7842,7 @@ imagemagick_load_image (struct frame *f, struct image *img,
}
- /* Oddly, the below code doesnt seem to work:*/
+ /* Oddly, the below code doesn't seem to work:*/
/* switch(ximg->bitmap_unit){ */
/* case 8: */
/* pixelwidth=CharPixel; */
@@ -7871,7 +7871,7 @@ imagemagick_load_image (struct frame *f, struct image *img,
/*&(img->pixmap));*/
ximg->data);
#else
- image_error ("You dont have MagickExportImagePixels, upgrade ImageMagick!",
+ image_error ("You don't have MagickExportImagePixels, upgrade ImageMagick!",
Qnil, Qnil);
#endif
}
@@ -8782,7 +8782,7 @@ syms_of_image (void)
operation on GNU/Linux of calling dump-emacs after loading some images. */
image_types = NULL;
- /* Must be defined now becase we're going to update it below, while
+ /* Must be defined now because we're going to update it below, while
defining the supported image types. */
DEFVAR_LISP ("image-types", Vimage_types,
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_
val_compute_motion.prevhpos = contin_hpos;
else
val_compute_motion.prevhpos = prev_hpos;
+ /* We always handle all of them here; none of them remain to do. */
+ val_compute_motion.ovstring_chars_done = 0;
/* Nonzero if have just continued a line */
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,
UNGCPRO;
- /* Make args be valid */
+ /* Make args be valid. */
if (from < BEGV)
from = BEGV;
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,
if (NULL_INTERVAL_P (tree))
return 0;
- /* Left branch */
+ /* Left branch. */
if (relative_position < LEFT_TOTAL_LENGTH (tree))
{
ptrdiff_t subtract = interval_deletion_adjustment (tree->left,
@@ -1327,7 +1327,7 @@ interval_deletion_adjustment (register INTERVAL tree, register ptrdiff_t from,
CHECK_TOTAL_LENGTH (tree);
return subtract;
}
- /* Right branch */
+ /* Right branch. */
else if (relative_position >= (TOTAL_LENGTH (tree)
- RIGHT_TOTAL_LENGTH (tree)))
{
@@ -1425,9 +1425,8 @@ adjust_intervals_for_deletion (struct buffer *buffer,
compiler that does not allow calling a static function (here,
adjust_intervals_for_deletion) from a non-static inline function. */
-static inline void
-static_offset_intervals (struct buffer *buffer, ptrdiff_t start,
- ptrdiff_t length)
+void
+offset_intervals (struct buffer *buffer, ptrdiff_t start, ptrdiff_t length)
{
if (NULL_INTERVAL_P (BUF_INTERVALS (buffer)) || length == 0)
return;
@@ -1440,12 +1439,6 @@ static_offset_intervals (struct buffer *buffer, ptrdiff_t start,
adjust_intervals_for_deletion (buffer, start, -length);
}
}
-
-inline void
-offset_intervals (struct buffer *buffer, ptrdiff_t start, ptrdiff_t length)
-{
- static_offset_intervals (buffer, start, length);
-}
/* Merge interval I with its lexicographic successor. The resulting
interval is returned, and has the properties of the original
@@ -1706,54 +1699,37 @@ graft_intervals_into_buffer (INTERVAL source, ptrdiff_t position,
Qnil, buf, 0);
}
if (! NULL_INTERVAL_P (BUF_INTERVALS (buffer)))
- /* Shouldn't be necessary. -stef */
+ /* Shouldn't be necessary. --Stef */
BUF_INTERVALS (buffer) = balance_an_interval (BUF_INTERVALS (buffer));
return;
}
- if (NULL_INTERVAL_P (tree))
- {
- /* The inserted text constitutes the whole buffer, so
+ eassert (length == TOTAL_LENGTH (source));
+
+ if ((BUF_Z (buffer) - BUF_BEG (buffer)) == length)
+ { /* The inserted text constitutes the whole buffer, so
simply copy over the interval structure. */
- if ((BUF_Z (buffer) - BUF_BEG (buffer)) == TOTAL_LENGTH (source))
- {
Lisp_Object buf;
XSETBUFFER (buf, buffer);
BUF_INTERVALS (buffer) = reproduce_tree_obj (source, buf);
- BUF_INTERVALS (buffer)->position = BEG;
- BUF_INTERVALS (buffer)->up_obj = 1;
-
+ BUF_INTERVALS (buffer)->position = BUF_BEG (buffer);
+ eassert (BUF_INTERVALS (buffer)->up_obj == 1);
return;
}
-
- /* Create an interval tree in which to place a copy
+ else if (NULL_INTERVAL_P (tree))
+ { /* Create an interval tree in which to place a copy
of the intervals of the inserted string. */
- {
Lisp_Object buf;
XSETBUFFER (buf, buffer);
tree = create_root_interval (buf);
}
- }
- else if (TOTAL_LENGTH (tree) == TOTAL_LENGTH (source))
- /* If the buffer contains only the new string, but
- there was already some interval tree there, then it may be
- some zero length intervals. Eventually, do something clever
- about inserting properly. For now, just waste the old intervals. */
- {
- BUF_INTERVALS (buffer) = reproduce_tree (source, INTERVAL_PARENT (tree));
- BUF_INTERVALS (buffer)->position = BEG;
- BUF_INTERVALS (buffer)->up_obj = 1;
- /* Explicitly free the old tree here. */
-
- return;
- }
/* Paranoia -- the text has already been added, so this buffer
should be of non-zero length. */
else if (TOTAL_LENGTH (tree) == 0)
abort ();
this = under = find_interval (tree, position);
- if (NULL_INTERVAL_P (under)) /* Paranoia */
+ if (NULL_INTERVAL_P (under)) /* Paranoia. */
abort ();
over = find_interval (source, interval_start_pos (source));
@@ -1884,7 +1860,7 @@ lookup_char_property (Lisp_Object plist, register Lisp_Object prop, int textprop
/* Set point in BUFFER "temporarily" to CHARPOS, which corresponds to
byte position BYTEPOS. */
-inline void
+void
temp_set_point_both (struct buffer *buffer,
ptrdiff_t charpos, ptrdiff_t bytepos)
{
@@ -1904,7 +1880,7 @@ temp_set_point_both (struct buffer *buffer,
/* Set point "temporarily", without checking any text properties. */
-inline void
+void
temp_set_point (struct buffer *buffer, ptrdiff_t charpos)
{
temp_set_point_both (buffer, charpos,
@@ -2393,7 +2369,7 @@ copy_intervals (INTERVAL tree, ptrdiff_t start, ptrdiff_t length)
/* Give STRING the properties of BUFFER from POSITION to LENGTH. */
-inline void
+void
copy_intervals_to_string (Lisp_Object string, struct buffer *buffer,
ptrdiff_t position, ptrdiff_t length)
{
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
Lisp_Object plist;
};
-/* These are macros for dealing with the interval tree. */
+/* These are macros for dealing with the interval tree. */
-/* Size of the structure used to represent an interval */
+/* Size of the structure used to represent an interval. */
#define INTERVAL_SIZE (sizeof (struct interval))
-/* Size of a pointer to an interval structure */
+/* Size of a pointer to an interval structure. */
#define INTERVAL_PTR_SIZE (sizeof (struct interval *))
#define NULL_INTERVAL_P(i) ((i) == NULL_INTERVAL)
-/* True if this interval has no right child. */
+/* True if this interval has no right child. */
#define NULL_RIGHT_CHILD(i) ((i)->right == NULL_INTERVAL)
-/* True if this interval has no left child. */
+/* True if this interval has no left child. */
#define NULL_LEFT_CHILD(i) ((i)->left == NULL_INTERVAL)
-/* True if this interval has no parent. */
+/* True if this interval has no parent. */
#define NULL_PARENT(i) ((i)->up_obj || (i)->up.interval == 0)
-/* True if this interval is the left child of some other interval. */
+/* True if this interval is the left child of some other interval. */
#define AM_LEFT_CHILD(i) (! NULL_PARENT (i) \
&& INTERVAL_PARENT (i)->left == (i))
-/* True if this interval is the right child of some other interval. */
+/* True if this interval is the right child of some other interval. */
#define AM_RIGHT_CHILD(i) (! NULL_PARENT (i) \
&& INTERVAL_PARENT (i)->right == (i))
-/* True if this interval has no children. */
+/* True if this interval has no children. */
#define LEAF_INTERVAL_P(i) ((i)->left == NULL_INTERVAL \
&& (i)->right == NULL_INTERVAL)
-/* True if this interval has no parent and is therefore the root. */
+/* True if this interval has no parent and is therefore the root. */
#define ROOT_INTERVAL_P(i) (NULL_PARENT (i))
-/* True if this interval is the only interval in the interval tree. */
+/* True if this interval is the only interval in the interval tree. */
#define ONLY_INTERVAL_P(i) (ROOT_INTERVAL_P ((i)) && LEAF_INTERVAL_P ((i)))
-/* True if this interval has both left and right children. */
+/* True if this interval has both left and right children. */
#define BOTH_KIDS_P(i) ((i)->left != NULL_INTERVAL \
&& (i)->right != NULL_INTERVAL)
/* The total size of all text represented by this interval and all its
- children in the tree. This is zero if the interval is null. */
+ children in the tree. This is zero if the interval is null. */
#define TOTAL_LENGTH(i) ((i) == NULL_INTERVAL ? 0 : (i)->total_length)
-/* The size of text represented by this interval alone. */
+/* The size of text represented by this interval alone. */
#define LENGTH(i) ((i) == NULL_INTERVAL ? 0 : (TOTAL_LENGTH ((i)) \
- TOTAL_LENGTH ((i)->right) \
- TOTAL_LENGTH ((i)->left)))
/* The position of the character just past the end of I. Note that
- the position cache i->position must be valid for this to work. */
+ the position cache i->position must be valid for this to work. */
#define INTERVAL_LAST_POS(i) ((i)->position + LENGTH ((i)))
-/* The total size of the left subtree of this interval. */
+/* The total size of the left subtree of this interval. */
#define LEFT_TOTAL_LENGTH(i) ((i)->left ? (i)->left->total_length : 0)
-/* The total size of the right subtree of this interval. */
+/* The total size of the right subtree of this interval. */
#define RIGHT_TOTAL_LENGTH(i) ((i)->right ? (i)->right->total_length : 0)
-/* These macros are for dealing with the interval properties. */
+/* These macros are for dealing with the interval properties. */
/* True if this is a default interval, which is the same as being null
- or having no properties. */
+ or having no properties. */
#define DEFAULT_INTERVAL_P(i) (NULL_INTERVAL_P (i) || EQ ((i)->plist, Qnil))
/* Test what type of parent we have. Three possibilities: another
@@ -169,7 +169,7 @@ struct interval
} \
while (0)
-/* Reset this interval to its vanilla, or no-property state. */
+/* Reset this interval to its vanilla, or no-property state. */
#define RESET_INTERVAL(i) \
{ \
(i)->total_length = (i)->position = 0; \
@@ -181,7 +181,7 @@ struct interval
(i)->plist = Qnil; \
}
-/* Copy the cached property values of interval FROM to interval TO. */
+/* Copy the cached property values of interval FROM to interval TO. */
#define COPY_INTERVAL_CACHE(from,to) \
{ \
(to)->write_protect = (from)->write_protect; \
@@ -190,7 +190,7 @@ struct interval
(to)->rear_sticky = (from)->rear_sticky; \
}
-/* Copy only the set bits of FROM's cache. */
+/* Copy only the set bits of FROM's cache. */
#define MERGE_INTERVAL_CACHE(from,to) \
{ \
if ((from)->write_protect) (to)->write_protect = 1; \
@@ -201,18 +201,18 @@ struct interval
/* Macro determining whether the properties of an interval being
inserted should be merged with the properties of the text where
- they are being inserted. */
+ they are being inserted. */
#define MERGE_INSERTIONS(i) 1
/* Macro determining if an invisible interval should be displayed
- as a special glyph, or not at all. */
+ as a special glyph, or not at all. */
#define DISPLAY_INVISIBLE_GLYPH(i) 0
-/* Is this interval visible? Replace later with cache access */
+/* Is this interval visible? Replace later with cache access. */
#define INTERVAL_VISIBLE_P(i) \
(! NULL_INTERVAL_P (i) && NILP (textget ((i)->plist, Qinvisible)))
-/* Is this interval writable? Replace later with cache access */
+/* Is this interval writable? Replace later with cache access. */
#define INTERVAL_WRITABLE_P(i) \
(! NULL_INTERVAL_P (i) \
&& (NILP (textget ((i)->plist, Qread_only)) \
@@ -222,7 +222,7 @@ struct interval
: !NILP (Vinhibit_read_only))))) \
/* Macros to tell whether insertions before or after this interval
- should stick to it. */
+ should stick to it. */
/* Replace later with cache access */
/*#define FRONT_STICKY_P(i) ((i)->front_sticky != 0)
#define END_STICKY_P(i) ((i)->rear_sticky != 0)*/
@@ -245,11 +245,11 @@ struct interval
? !NILP (prop) \
: invisible_p (prop, BVAR (current_buffer, invisibility_spec)))
-/* Declared in alloc.c */
+/* Declared in alloc.c. */
extern INTERVAL make_interval (void);
-/* Declared in intervals.c */
+/* Declared in intervals.c. */
extern INTERVAL create_root_interval (Lisp_Object);
extern void copy_properties (INTERVAL, INTERVAL);
@@ -288,12 +288,12 @@ extern INTERVAL validate_interval_range (Lisp_Object, Lisp_Object *,
Lisp_Object *, int);
extern INTERVAL interval_of (ptrdiff_t, Lisp_Object);
-/* Defined in xdisp.c */
+/* Defined in xdisp.c. */
extern int invisible_p (Lisp_Object, Lisp_Object);
-/* Declared in textprop.c */
+/* Declared in textprop.c. */
-/* Types of hooks. */
+/* Types of hooks. */
extern Lisp_Object Qpoint_left;
extern Lisp_Object Qpoint_entered;
extern Lisp_Object Qmodification_hooks;
@@ -301,11 +301,11 @@ extern Lisp_Object Qcategory;
extern Lisp_Object Qlocal_map;
extern Lisp_Object Qkeymap;
-/* Visual properties text (including strings) may have. */
+/* Visual properties text (including strings) may have. */
extern Lisp_Object Qfont;
extern Lisp_Object Qinvisible, Qintangible;
-/* Sticky properties */
+/* Sticky properties. */
extern Lisp_Object Qfront_sticky, Qrear_nonsticky;
EXFUN (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)
state later.
If Emacs is already in single_kboard mode, and F's keyboard is
- locked, then this function will throw an errow. */
+ locked, then this function will throw an error. */
void
temporarily_switch_to_single_kboard (struct frame *f)
@@ -1058,7 +1058,7 @@ cmd_error_internal (Lisp_Object data, const char *context)
struct frame *sf = SELECTED_FRAME ();
/* The immediate context is not interesting for Quits,
- since they are asyncronous. */
+ since they are asynchronous. */
if (EQ (XCAR (data), Qquit))
Vsignaling_function = Qnil;
@@ -5393,7 +5393,7 @@ make_lispy_event (struct input_event *event)
|| !lispy_function_keys[event->code - FUNCTION_KEY_OFFSET])
{
/* We need to use an alist rather than a vector as the cache
- since we can't make a vector long enuf. */
+ since we can't make a vector long enough. */
if (NILP (KVAR (current_kboard, system_key_syms)))
KVAR (current_kboard, system_key_syms) = Fcons (Qnil, Qnil);
return modify_event_symbol (event->code,
@@ -8137,7 +8137,7 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
Lisp_Object caption;
int i, have_label = 0;
- /* Defininition looks like `(menu-item CAPTION BINDING PROPS...)'.
+ /* Definition looks like `(menu-item CAPTION BINDING PROPS...)'.
Rule out items that aren't lists, don't start with
`menu-item' or whose rest following `tool-bar-item' is not a
list. */
@@ -8787,7 +8787,7 @@ typedef struct keyremap
/* Positions [START, END) in the key sequence buffer
are the key that we have scanned so far.
Those events are the ones that we will replace
- if PAREHT maps them into a key sequence. */
+ if PARENT maps them into a key sequence. */
int start, end;
} keyremap;
@@ -10861,8 +10861,12 @@ interrupt_signal (int signalnum) /* If we don't have an argument, some */
if (!terminal)
{
/* If there are no frames there, let's pretend that we are a
- well-behaving UN*X program and quit. */
- Fkill_emacs (Qnil);
+ well-behaving UN*X program and quit. We cannot do that while
+ GC is in progress, though. */
+ if (!gc_in_progress)
+ Fkill_emacs (Qnil);
+ else
+ Vquit_flag = Qt;
}
else
{
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)
}
else
{
- /* It may be an old fomat menu item.
+ /* It may be an old format menu item.
Skip the optional menu string. */
if (STRINGP (XCAR (tem)))
{
@@ -2642,11 +2642,11 @@ remapped command in the returned list. */)
/* We have a list of advertised bindings. */
while (CONSP (tem))
if (EQ (shadow_lookup (keymaps, XCAR (tem), Qnil, 0), definition))
- return XCAR (tem);
+ RETURN_UNGCPRO (XCAR (tem));
else
tem = XCDR (tem);
if (EQ (shadow_lookup (keymaps, tem, Qnil, 0), definition))
- return tem;
+ RETURN_UNGCPRO (tem);
}
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;
# if HAVE_ATTRIBUTE_ALIGNED
# define DECL_ALIGN(type, var) \
type __attribute__ ((__aligned__ (1 << GCTYPEBITS))) var
+# elif defined(_MSC_VER)
+# define DECL_ALIGN(type, var) \
+ type __declspec(align(1 << GCTYPEBITS)) var
# else
/* What directives do other compilers use? */
# endif
@@ -225,6 +228,15 @@ extern int suppress_checking EXTERNALLY_VISIBLE;
# endif
#endif
+/* Stolen from GDB. The only known compiler that doesn't support
+ enums in bitfields is MSVC. */
+#ifdef _MSC_VER
+#define ENUM_BF(TYPE) unsigned int
+#else
+#define ENUM_BF(TYPE) enum TYPE
+#endif
+
+
enum Lisp_Type
{
/* Integer. XINT (obj) is the integer value. */
@@ -315,12 +327,12 @@ union Lisp_Object
/* Use explict signed, the signedness of a bit-field of type
int is implementation defined. */
signed EMACS_INT val : VALBITS;
- enum Lisp_Type type : GCTYPEBITS;
+ ENUM_BF (Lisp_Type) type : GCTYPEBITS;
} s;
struct
{
EMACS_UINT val : VALBITS;
- enum Lisp_Type type : GCTYPEBITS;
+ ENUM_BF (Lisp_Type) type : GCTYPEBITS;
} u;
}
Lisp_Object;
@@ -336,14 +348,14 @@ union Lisp_Object
struct
{
- enum Lisp_Type type : GCTYPEBITS;
+ ENUM_BF (Lisp_Type) type : GCTYPEBITS;
/* Use explict signed, the signedness of a bit-field of type
int is implementation defined. */
signed EMACS_INT val : VALBITS;
} s;
struct
{
- enum Lisp_Type type : GCTYPEBITS;
+ ENUM_BF (Lisp_Type) type : GCTYPEBITS;
EMACS_UINT val : VALBITS;
} u;
}
@@ -1101,7 +1113,7 @@ struct Lisp_Symbol
1 : it's a varalias, the value is really in the `alias' symbol.
2 : it's a localized var, the value is in the `blv' object.
3 : it's a forwarding variable, the value is in `forward'. */
- enum symbol_redirect redirect : 3;
+ ENUM_BF (symbol_redirect) redirect : 3;
/* Non-zero means symbol is constant, i.e. changing its value
should signal an error. If the value is 3, then the var
@@ -1314,7 +1326,7 @@ struct Lisp_Hash_Table
struct Lisp_Misc_Any /* Supertype of all Misc types. */
{
- enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_??? */
+ ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_??? */
unsigned gcmarkbit : 1;
int spacer : 15;
/* Make it as long as "Lisp_Free without padding". */
@@ -1323,7 +1335,7 @@ struct Lisp_Misc_Any /* Supertype of all Misc types. */
struct Lisp_Marker
{
- enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_Marker */
+ ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Marker */
unsigned gcmarkbit : 1;
int spacer : 13;
/* This flag is temporarily used in the functions
@@ -1473,7 +1485,7 @@ struct Lisp_Overlay
I.e. 9words plus 2 bits, 3words of which are for external linked lists.
*/
{
- enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_Overlay */
+ ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Overlay */
unsigned gcmarkbit : 1;
int spacer : 15;
struct Lisp_Overlay *next;
@@ -1492,7 +1504,7 @@ struct Lisp_Kboard_Objfwd
This type of object is used in the arg to record_unwind_protect. */
struct Lisp_Save_Value
{
- enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_Save_Value */
+ ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Save_Value */
unsigned gcmarkbit : 1;
int spacer : 14;
/* If DOGC is set, POINTER is the address of a memory
@@ -1506,7 +1518,7 @@ struct Lisp_Save_Value
/* A miscellaneous object, when it's on the free list. */
struct Lisp_Free
{
- enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_Free */
+ ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Free */
unsigned gcmarkbit : 1;
int spacer : 15;
union Lisp_Misc *chain;
@@ -1928,13 +1940,23 @@ typedef struct {
/* This version of DEFUN declares a function prototype with the right
arguments, so we can catch errors with maxargs at compile-time. */
-#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \
- Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \
- static DECL_ALIGN (struct Lisp_Subr, sname) = \
- { PVEC_SUBR, \
- { .a ## maxargs = fnname }, \
- minargs, maxargs, lname, intspec, 0}; \
- Lisp_Object fnname
+#ifdef _MSC_VER
+#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \
+ Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \
+ static DECL_ALIGN (struct Lisp_Subr, sname) = \
+ { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)), \
+ { (Lisp_Object (__cdecl *)(void))fnname }, \
+ minargs, maxargs, lname, intspec, 0}; \
+ Lisp_Object fnname
+#else /* not _MSC_VER */
+#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \
+ Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \
+ static DECL_ALIGN (struct Lisp_Subr, sname) = \
+ { PVEC_SUBR, \
+ { .a ## maxargs = fnname }, \
+ minargs, maxargs, lname, intspec, 0}; \
+ Lisp_Object fnname
+#endif
/* Note that the weird token-substitution semantics of ANSI C makes
this work for MANY and UNEVALLED. */
@@ -3165,10 +3187,6 @@ extern void syms_of_fileio (void);
extern Lisp_Object make_temp_name (Lisp_Object, int);
extern Lisp_Object Qdelete_file;
-/* Defined in abbrev.c */
-
-extern void syms_of_abbrev (void);
-
/* Defined in search.c */
extern void shrink_regexp_cache (void);
EXFUN (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
# Set EMACSLOADPATH correctly (in case already defined in environment).
EMACSLOADPATH=$(CURDIR)/../lisp
+# Size in MBs of the static heap in temacs.exe.
+HEAPSIZE = 27
+
#
# HAVE_CONFIG_H is required by some generic gnu sources stuck into
# the emacs source tree.
@@ -177,7 +180,7 @@ temacs: stamp_BLD $(TEMACS)
$(TEMACS): $(TLIB0) $(TLIB1) $(TLIB2) $(TLASTLIB) $(TOBJ) $(TRES) \
../nt/$(BLD)/addsection.exe $(GNULIB)
$(LINK) $(LINK_OUT)$(TEMACS_TMP) $(FULL_LINK_FLAGS) $(TOBJ) $(TRES) $(LIBS)
- "../nt/$(BLD)/addsection" "$(TEMACS_TMP)" "$(TEMACS)" EMHEAP 21
+ "$(THISDIR)/../nt/$(BLD)/addsection" "$(TEMACS_TMP)" "$(TEMACS)" EMHEAP $(HEAPSIZE)
# These omit firstfile.${O}, but there's no documentation in there
# anyways.
@@ -232,7 +235,7 @@ globals.h: gl-stamp
gl-stamp: ../lib-src/$(BLD)/make-docfile.exe $(GLOBAL_SOURCES)
- $(DEL) gl-tmp
- "../lib-src/$(BLD)/make-docfile" -d . -g $(SOME_MACHINE_OBJECTS) $(obj) > gl-tmp
+ "$(THISDIR)/../lib-src/$(BLD)/make-docfile" -d . -g $(SOME_MACHINE_OBJECTS) $(obj) > gl-tmp
cmd /c "fc /b gl-tmp globals.h >nul 2>&1 || $(CP) gl-tmp globals.h"
- $(DEL) gl-tmp
echo timestamp > $@
@@ -348,11 +351,11 @@ TAGS-LISP: $(OBJ0) $(OBJ1) $(OBJ2)
TAGS-gmake:
../lib-src/$(BLD)/etags.exe --include=TAGS-LISP --include=../nt/TAGS \
--regex=@../nt/emacs-src.tags \
- $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ0))
+ $(OBJ0_c)
../lib-src/$(BLD)/etags.exe -a --regex=@../nt/emacs-src.tags \
- $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ1))
+ $(OBJ1_c)
../lib-src/$(BLD)/etags.exe -a --regex=@../nt/emacs-src.tags \
- $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ2)) \
+ $(OBJ2_c) \
$(CURDIR)/*.h $(CURDIR)/m/intel386.h $(CURDIR)/s/ms-w32.h
TAGS-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;
static Lisp_Object as_script, *as_result;
static int as_status;
+#if GLYPH_DEBUG
+static ptrdiff_t image_cache_refcount;
+#endif
+
/* ==========================================================================
Internal utility functions
@@ -1038,6 +1042,41 @@ frame_parm_handler ns_frame_parm_handlers[] =
};
+/* Handler for signals raised during x_create_frame.
+ FRAME is the frame which is partially constructed. */
+
+static Lisp_Object
+unwind_create_frame (Lisp_Object frame)
+{
+ struct frame *f = XFRAME (frame);
+
+ /* If frame is already dead, nothing to do. This can happen if the
+ display is disconnected after the frame has become official, but
+ before x_create_frame removes the unwind protect. */
+ if (!FRAME_LIVE_P (f))
+ return Qnil;
+
+ /* If frame is ``official'', nothing to do. */
+ if (NILP (Fmemq (frame, Vframe_list)))
+ {
+#if GLYPH_DEBUG && XASSERTS
+ struct ns_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
+#endif
+
+ x_free_frame_resources (f);
+ free_glyphs (f);
+
+#if GLYPH_DEBUG
+ /* Check that reference counts are indeed correct. */
+ xassert (dpyinfo->terminal->image_cache->refcount == image_cache_refcount);
+#endif
+ return Qt;
+ }
+
+ return Qnil;
+}
+
+
/* ==========================================================================
@@ -1047,46 +1086,50 @@ frame_parm_handler ns_frame_parm_handlers[] =
DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
1, 1, 0,
- doc: /* Make a new Nextstep window, called a \"frame\" in Emacs terms.
+ doc: /* Make a new Nextstep window, called a "frame" in Emacs terms.
Return an Emacs frame object.
PARMS is an alist of frame parameters.
If the parameters specify that the frame should not have a minibuffer,
and do not specify a specific minibuffer window to use,
then `default-minibuffer-frame' must be a frame whose minibuffer can
-be shared by the new frame. */)
+be shared by the new frame.
+
+This function is an internal primitive--use `make-frame' instead. */)
(Lisp_Object parms)
{
- static int desc_ctr = 1;
struct frame *f;
- struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
Lisp_Object frame, tem;
Lisp_Object name;
int minibuffer_only = 0;
+ int window_prompting = 0;
+ int width, height;
ptrdiff_t count = specpdl_ptr - specpdl;
+ struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
Lisp_Object display;
struct ns_display_info *dpyinfo = NULL;
Lisp_Object parent;
struct kboard *kb;
Lisp_Object tfont, tfontsize;
- int window_prompting = 0;
- int width, height;
+ static int desc_ctr = 1;
check_ns ();
- /* Seems a little strange, but other terms do it. Perhaps the code below
- is modifying something? */
+ /* x_get_arg modifies parms. */
parms = Fcopy_alist (parms);
+ /* Use this general default value to start with
+ until we know if this frame has a specified name. */
+ Vx_resource_name = Vinvocation_name;
+
display = x_get_arg (dpyinfo, parms, Qterminal, 0, 0, RES_TYPE_STRING);
if (EQ (display, Qunbound))
display = Qnil;
dpyinfo = check_ns_display_info (display);
+ kb = dpyinfo->terminal->kboard;
if (!dpyinfo->terminal->name)
error ("Terminal is not live, can't create new frames on it");
- kb = dpyinfo->terminal->kboard;
-
name = x_get_arg (dpyinfo, parms, Qname, 0, 0, RES_TYPE_STRING);
if (!STRINGP (name)
&& ! EQ (name, Qunbound)
@@ -1095,8 +1138,6 @@ be shared by the new frame. */)
if (STRINGP (name))
Vx_resource_name = name;
- else
- Vx_resource_name = Vinvocation_name;
parent = x_get_arg (dpyinfo, parms, Qparent_id, 0, 0, RES_TYPE_NUMBER);
if (EQ (parent, Qunbound))
@@ -1104,57 +1145,36 @@ be shared by the new frame. */)
if (! NILP (parent))
CHECK_NUMBER (parent);
+ /* make_frame_without_minibuffer can run Lisp code and garbage collect. */
+ /* No need to protect DISPLAY because that's not used after passing
+ it to make_frame_without_minibuffer. */
frame = Qnil;
GCPRO4 (parms, parent, name, frame);
-
tem = x_get_arg (dpyinfo, parms, Qminibuffer, "minibuffer", "Minibuffer",
RES_TYPE_SYMBOL);
if (EQ (tem, Qnone) || NILP (tem))
- {
f = make_frame_without_minibuffer (Qnil, kb, display);
- }
else if (EQ (tem, Qonly))
{
f = make_minibuffer_frame ();
minibuffer_only = 1;
}
else if (WINDOWP (tem))
- {
f = make_frame_without_minibuffer (tem, kb, display);
- }
else
- {
f = make_frame (1);
- }
-
- /* Set the name; the functions to which we pass f expect the name to
- be set. */
- if (EQ (name, Qunbound) || NILP (name) || (XTYPE (name) != Lisp_String))
- {
- f->name = build_string ([ns_app_name UTF8String]);
- f->explicit_name =0;
- }
- else
- {
- f->name = name;
- f->explicit_name = 1;
- specbind (Qx_resource_name, name);
- }
XSETFRAME (frame, f);
FRAME_CAN_HAVE_SCROLL_BARS (f) = 1;
f->terminal = dpyinfo->terminal;
- f->terminal->reference_count++;
f->output_method = output_ns;
f->output_data.ns = (struct ns_output *)xmalloc (sizeof *(f->output_data.ns));
- memset (f->output_data.ns, 0, sizeof (*(f->output_data.ns)));
+ memset (f->output_data.ns, 0, sizeof *(f->output_data.ns));
FRAME_FONTSET (f) = -1;
- /* record_unwind_protect (unwind_create_frame, frame); safety; maybe later? */
-
f->icon_name = x_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title",
RES_TYPE_STRING);
if (! STRINGP (f->icon_name))
@@ -1162,6 +1182,9 @@ be shared by the new frame. */)
FRAME_NS_DISPLAY_INFO (f) = dpyinfo;
+ /* With FRAME_NS_DISPLAY_INFO set up, this unwind-protect is safe. */
+ record_unwind_protect (unwind_create_frame, frame);
+
f->output_data.ns->window_desc = desc_ctr++;
if (TYPE_RANGED_INTEGERP (Window, parent))
{
@@ -1174,6 +1197,20 @@ be shared by the new frame. */)
f->output_data.ns->explicit_parent = 0;
}
+ /* Set the name; the functions to which we pass f expect the name to
+ be set. */
+ if (EQ (name, Qunbound) || NILP (name) || ! STRINGP (name))
+ {
+ f->name = build_string ([ns_app_name UTF8String]);
+ f->explicit_name = 0;
+ }
+ else
+ {
+ f->name = name;
+ f->explicit_name = 1;
+ specbind (Qx_resource_name, name);
+ }
+
f->resx = dpyinfo->resx;
f->resy = dpyinfo->resy;
@@ -1223,11 +1260,15 @@ be shared by the new frame. */)
"leftFringe", "LeftFringe", RES_TYPE_NUMBER);
x_default_parameter (f, parms, Qright_fringe, Qnil,
"rightFringe", "RightFringe", RES_TYPE_NUMBER);
- /* end PENDING */
+
+#if GLYPH_DEBUG
+ image_cache_refcount =
+ FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0;
+#endif
init_frame_faces (f);
- /* The X resources controlling the menu-bar and tool-bar are
+ /* The resources controlling the menu-bar and tool-bar are
processed specially at startup, and reflected in the mode
variables; ignore them here. */
x_default_parameter (f, parms, Qmenu_bar_lines,
@@ -1244,38 +1285,6 @@ be shared by the new frame. */)
x_default_parameter (f, parms, Qtitle, Qnil, "title", "Title",
RES_TYPE_STRING);
-/* TODO: other terms seem to get away w/o this complexity.. */
- if (NILP (Fassq (Qwidth, parms)))
- {
- Lisp_Object value
- = x_get_arg (dpyinfo, parms, Qwidth, "width", "Width",
- RES_TYPE_NUMBER);
- if (! EQ (value, Qunbound))
- parms = Fcons (Fcons (Qwidth, value), parms);
- }
- if (NILP (Fassq (Qheight, parms)))
- {
- Lisp_Object value
- = x_get_arg (dpyinfo, parms, Qheight, "height", "Height",
- RES_TYPE_NUMBER);
- if (! EQ (value, Qunbound))
- parms = Fcons (Fcons (Qheight, value), parms);
- }
- if (NILP (Fassq (Qleft, parms)))
- {
- Lisp_Object value
- = x_get_arg (dpyinfo, parms, Qleft, "left", "Left", RES_TYPE_NUMBER);
- if (! EQ (value, Qunbound))
- parms = Fcons (Fcons (Qleft, value), parms);
- }
- if (NILP (Fassq (Qtop, parms)))
- {
- Lisp_Object value
- = x_get_arg (dpyinfo, parms, Qtop, "top", "Top", RES_TYPE_NUMBER);
- if (! EQ (value, Qunbound))
- parms = Fcons (Fcons (Qtop, value), parms);
- }
-
window_prompting = x_figure_window_size (f, parms, 1);
tem = x_get_arg (dpyinfo, parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN);
@@ -1297,23 +1306,27 @@ be shared by the new frame. */)
x_icon (f, parms);
+ /* ns_display_info does not have a reference_count. */
+ f->terminal->reference_count++;
+
/* It is now ok to make the frame official even if we get an error below.
The frame needs to be on Vframe_list or making it visible won't work. */
Vframe_list = Fcons (frame, Vframe_list);
- /*FRAME_NS_DISPLAY_INFO (f)->reference_count++; */
-
- x_default_parameter (f, parms, Qicon_type, Qnil, "bitmapIcon", "BitmapIcon",
- RES_TYPE_SYMBOL);
- x_default_parameter (f, parms, Qauto_raise, Qnil, "autoRaise", "AutoRaiseLower",
- RES_TYPE_BOOLEAN);
- x_default_parameter (f, parms, Qauto_lower, Qnil, "autoLower", "AutoLower",
- RES_TYPE_BOOLEAN);
- x_default_parameter (f, parms, Qcursor_type, Qbox, "cursorType", "CursorType",
- RES_TYPE_SYMBOL);
- x_default_parameter (f, parms, Qscroll_bar_width, Qnil, "scrollBarWidth",
- "ScrollBarWidth", RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qalpha, Qnil, "alpha", "Alpha",
- RES_TYPE_NUMBER);
+
+ x_default_parameter (f, parms, Qicon_type, Qnil,
+ "bitmapIcon", "BitmapIcon", RES_TYPE_SYMBOL);
+
+ x_default_parameter (f, parms, Qauto_raise, Qnil,
+ "autoRaise", "AutoRaiseLower", RES_TYPE_BOOLEAN);
+ x_default_parameter (f, parms, Qauto_lower, Qnil,
+ "autoLower", "AutoLower", RES_TYPE_BOOLEAN);
+ x_default_parameter (f, parms, Qcursor_type, Qbox,
+ "cursorType", "CursorType", RES_TYPE_SYMBOL);
+ x_default_parameter (f, parms, Qscroll_bar_width, Qnil,
+ "scrollBarWidth", "ScrollBarWidth",
+ RES_TYPE_NUMBER);
+ x_default_parameter (f, parms, Qalpha, Qnil,
+ "alpha", "Alpha", RES_TYPE_NUMBER);
width = FRAME_COLS (f);
height = FRAME_LINES (f);
@@ -1324,20 +1337,24 @@ be shared by the new frame. */)
if (! f->output_data.ns->explicit_parent)
{
- tem = x_get_arg (dpyinfo, parms, Qvisibility, 0, 0, RES_TYPE_SYMBOL);
- if (EQ (tem, Qunbound))
- tem = Qt;
- x_set_visibility (f, tem, Qnil);
- if (EQ (tem, Qicon))
+ Lisp_Object visibility;
+
+ visibility = x_get_arg (dpyinfo, parms, Qvisibility, 0, 0,
+ RES_TYPE_SYMBOL);
+ if (EQ (visibility, Qunbound))
+ visibility = Qt;
+
+ if (EQ (visibility, Qicon))
x_iconify_frame (f);
- else if (! NILP (tem))
+ else if (! NILP (visibility))
{
x_make_frame_visible (f);
- f->async_visible = 1;
[[FRAME_NS_VIEW (f) window] makeKeyWindow];
}
else
- f->async_visible = 0;
+ {
+ /* Must have been Qnil. */
+ }
}
if (FRAME_HAS_MINIBUF_P (f)
@@ -1352,6 +1369,9 @@ be shared by the new frame. */)
f->param_alist = Fcons (XCAR (tem), f->param_alist);
UNGCPRO;
+
+ /* Make sure windows on this frame appear in calls to next-window
+ and similar functions. */
Vwindow_list = Qnil;
return unbind_to (count, frame);
@@ -1636,7 +1656,7 @@ If omitted or nil, the selected frame's display is used. */)
DEFUN ("x-display-backing-store", Fx_display_backing_store,
Sx_display_backing_store, 0, 1, 0,
- doc: /* Return whether the Nexstep display DISPLAY supports backing store.
+ doc: /* Return whether the Nextstep display DISPLAY supports backing store.
The value may be `buffered', `retained', or `non-retained'.
DISPLAY should be a frame, the display name as a string, or a terminal ID.
If 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,
DEFUN ("ns-font-name", Fns_font_name, Sns_font_name, 1, 1, 0,
- doc: /* Determine font postscript or family name for font NAME.
+ doc: /* Determine font PostScript or family name for font NAME.
NAME should be a string containing either the font name or an XLFD
font descriptor. If string contains `fontset' and not
`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
{
struct font font;
- char *name; /* postscript name, uniquely identifies on NS systems */
+ char *name; /* PostScript name, uniquely identifies on NS systems */
float width; /* this and following metrics stored as float rather than int */
float height;
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;
static EmacsScroller *last_mouse_scroll_bar = nil;
static struct frame *ns_updating_frame;
static NSView *focus_view = NULL;
-static int ns_window_num =0;
+static int ns_window_num = 0;
static NSRect uRect;
static BOOL gsaved = NO;
BOOL ns_in_resize = NO;
@@ -1123,12 +1123,10 @@ x_iconify_frame (struct frame *f)
[[view window] miniaturize: NSApp];
}
+/* Free X resources of frame F. */
void
-x_destroy_window (struct frame *f)
-/* --------------------------------------------------------------------------
- External: Delete the window
- -------------------------------------------------------------------------- */
+x_free_frame_resources (struct frame *f)
{
NSView *view = FRAME_NS_VIEW (f);
struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f);
@@ -1163,10 +1161,21 @@ x_destroy_window (struct frame *f)
[[view window] close];
[view release];
- ns_window_num--;
UNBLOCK_INPUT;
}
+void
+x_destroy_window (struct frame *f)
+/* --------------------------------------------------------------------------
+ External: Delete the window
+ -------------------------------------------------------------------------- */
+{
+ NSTRACE (x_destroy_window);
+ check_ns ();
+ x_free_frame_resources (f);
+ ns_window_num--;
+}
+
void
x_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)
/* Currently on NS img->mask is always 0. Since
get_window_cursor_type specifies a hollow box cursor when on
a non-masked image we never reach this clause. But we put it
- in in antipication of better support for image masks on
+ in in anticipation of better support for image masks on
NS. */
tdCol = ns_lookup_indexed_color (NS_FACE_FOREGROUND (face), s->f);
}
@@ -4494,7 +4503,7 @@ ns_term_shutdown (int sig)
//ns_app_active=YES;
ns_update_auto_hide_menu_bar ();
- // No constrining takes place when the application is not active.
+ // No constraining takes place when the application is not active.
ns_constrain_all_frames ();
}
- (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) */)
{
struct hostent *host_info_ptr;
- /* gethostbyname may fail with TRY_AGAIN, but we don't honour that,
+ /* gethostbyname may fail with TRY_AGAIN, but we don't honor that,
as it may `hang' Emacs for a very long time. */
immediate_quit = 1;
QUIT;
@@ -5363,8 +5363,8 @@ send_process (volatile Lisp_Object proc, const char *volatile buf,
sending a multibyte text, thus we must encode it by the
original coding system specified for the current process.
- Another reason we comming here is that the coding system
- was just complemented and new one was returned by
+ Another reason we come here is that the coding system
+ was just complemented and a new one was returned by
complement_process_encoding_system. */
setup_coding_system (p->encode_coding_system, coding);
Vlast_coding_system_used = p->encode_coding_system;
@@ -5373,6 +5373,7 @@ send_process (volatile Lisp_Object proc, const char *volatile buf,
}
else
{
+ coding->src_multibyte = 0;
/* For sending a unibyte text, character code conversion should
not take place but EOL conversion should. So, setup raw-text
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)
If enough space is not presently available in our reserve, this means
getting more page-aligned space from the system. If the returned space
is not contiguous to the last heap, allocate a new heap, and append it
+ to the heap list.
- obtain does not try to keep track of whether space is in use
- or not in use. It just returns the address of SIZE bytes that
- fall within a single heap. If you call obtain twice in a row
- with the same arguments, you typically get the same value.
- to the heap list. It's the caller's responsibility to keep
- track of what space is in use.
+ obtain does not try to keep track of whether space is in use or not
+ in use. It just returns the address of SIZE bytes that fall within a
+ single heap. If you call obtain twice in a row with the same arguments,
+ you typically get the same value. It's the caller's responsibility to
+ keep track of what space is in use.
Return the address of the space if all went well, or zero if we couldn't
allocate the memory. */
@@ -389,7 +389,7 @@ find_bloc (POINTER *ptr)
while (p != NIL_BLOC)
{
/* Consistency check. Don't return inconsistent blocs.
- Don't abort here, as callers might be expecting this, but
+ Don't abort here, as callers might be expecting this, but
callers that always expect a bloc to be returned should abort
if one isn't to avoid a memory corruption bug that is
difficult to track down. */
@@ -1180,7 +1180,7 @@ r_alloc_reset_variable (POINTER *old, POINTER *new)
/* Find the bloc that corresponds to the data pointed to by pointer.
find_bloc cannot be used, as it has internal consistency checks
- which fail when the variable needs reseting. */
+ which fail when the variable needs resetting. */
while (bloc != NIL_BLOC)
{
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)
#define MIN(a, b) ((a) < (b) ? (a) : (b))
/* Type of source-pattern and string chars. */
+#ifdef _MSC_VER
+typedef unsigned char re_char;
+#else
typedef const unsigned char re_char;
+#endif
typedef char boolean;
#define false 0
@@ -633,7 +637,7 @@ typedef enum
on_failure_jump_nastyloop,
/* A smart `on_failure_jump' used for greedy * and + operators.
- It analyses the loop before which it is put and if the
+ It analyzes the loop before which it is put and if the
loop does not require backtracking, it changes itself to
`on_failure_keep_string_jump' and short-circuits the loop,
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
typedef struct re_pattern_buffer regex_t;
/* Type for byte offsets within the string. POSIX mandates this to be an int,
- but the Open Group has signalled its intention to change the requirement to
+ but the Open Group has signaled its intention to change the requirement to
be that regoff_t be at least as wide as ptrdiff_t and ssize_t. Current
gnulib sources also use ssize_t, and we need this for supporting buffers and
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/>. */
#endif /* !_IO_STDIO_H */
#endif /* emacs */
+/* Use the GC_MAKE_GCPROS_NOOPS (see lisp.h) method for marking the stack. */
+#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/>. */
#undef HAVE_RANDOM
-/* Rainer Malzbender <rainer@displaytech.com> says definining
+/* Rainer Malzbender <rainer@displaytech.com> says defining
HAVE_XRMSETDATABASE allows Emacs to compile on HP-UX 10.20 using GCC. */
#ifndef HAVE_XRMSETDATABASE
#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/>. */
#define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))
#include <sys/types.h>
+
+#ifdef _MSC_VER
+typedef unsigned long sigset_t;
+typedef int ssize_t;
+#endif
+
struct sigaction {
int sa_flags;
void (*sa_handler)(int);
@@ -181,6 +187,17 @@ struct sigaction {
#ifdef emacs
+#ifdef _MSC_VER
+#include <sys/timeb.h>
+#include <sys/stat.h>
+#include <signal.h>
+
+/* MSVC gets link-time errors without these redirections. */
+#define fstat(a, b) sys_fstat(a, b)
+#define stat(a, b) sys_stat(a, b)
+#define utime sys_utime
+#endif
+
/* Calls that are emulated or shadowed. */
#undef access
#define access sys_access
@@ -267,6 +284,7 @@ typedef int pid_t;
#if !defined (_MSC_VER) || (_MSC_VER < 1400)
#define tzname _tzname
+#undef utime
#define utime _utime
#endif
@@ -317,13 +335,17 @@ extern char *get_emacs_configuration_options (void);
#define _WINSOCK_H
/* Defines size_t and alloca (). */
-#ifdef USE_CRT_DLL
+#if (defined(_MSC_VER) && defined(emacs)) || defined(USE_CRT_DLL)
#define malloc e_malloc
#define free e_free
#define realloc e_realloc
#define calloc e_calloc
#endif
+#ifdef _MSC_VER
+#define alloca _alloca
+#else
#include <malloc.h>
+#endif
#include <sys/stat.h>
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 */
#ifdef HAVE_X_WINDOWS
/* We need a little extra space, see ../../lisp/loadup.el and the
commentary below, in the non-X branch. The 140KB number was
- measured on GNU/Linux and on MS-WIndows. */
+ measured on GNU/Linux and on MS-Windows. */
#define SYSTEM_PURESIZE_EXTRA (-170000+140000)
#else
/* We need a little extra space, see ../../lisp/loadup.el.
@@ -138,4 +138,3 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */
registers relevant for conservative garbage collection in the jmp_buf. */
#define GC_SETJMP_WORKS 1
#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
-
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
/* Close device SD. */
void (* close) (struct sound_device *sd);
- /* Configure SD accoring to device-dependent parameters. */
+ /* Configure SD according to device-dependent parameters. */
void (* configure) (struct sound_device *device);
/* 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;
/* POSIX pretty much destroys any possibility of writing sigmask as a
macro in standard C. We always define our own version because the
- predefined macro in Glibc 2.1 is only provided for compatility for old
+ predefined macro in Glibc 2.1 is only provided for compatibility for old
programs that use int as signal mask type. */
#undef sigmask
#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:
/* The conditional bit below was in Oliva's original code
(1999-08-25) and seems to have been dropped by mistake
subsequently. It prevents a crash at startup under X in
- `IRIX64 6.5 6.5.17m', whether compiled on that relase or
+ `IRIX64 6.5 6.5.17m', whether compiled on that release or
an earlier one. It causes no trouble on the other ELF
platforms I could test (Irix 6.5.15m, Solaris 8, Debian
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 {
#include <tlhelp32.h>
#include <psapi.h>
+#ifndef _MSC_VER
#include <w32api.h>
+#endif
#if !defined (__MINGW32__) || __W32API_MAJOR_VERSION < 3 || (__W32API_MAJOR_VERSION == 3 && __W32API_MINOR_VERSION < 15)
/* This either is not in psapi.h or guarded by higher value of
_WIN32_WINNT than what we use. w32api supplied with MinGW 3.15
@@ -1547,7 +1549,12 @@ init_environment (char ** argv)
read-only filesystem, like CD-ROM or a write-protected floppy.
The only way to be really sure is to actually create a file and
see if it succeeds. But I think that's too much to ask. */
+#ifdef _MSC_VER
+ /* MSVC's _access crashes with D_OK. */
+ if (tmp && sys_access (tmp, D_OK) == 0)
+#else
if (tmp && _access (tmp, D_OK) == 0)
+#endif
{
char * var = alloca (strlen (tmp) + 8);
sprintf (var, "TMPDIR=%s", tmp);
@@ -3396,7 +3403,7 @@ stat (const char * path, struct stat * buf)
FILE_FLAG_BACKUP_SEMANTICS, NULL))
!= INVALID_HANDLE_VALUE)
{
- /* This is more accurate in terms of gettting the correct number
+ /* This is more accurate in terms of getting the correct number
of links, but is quite slow (it is noticeable when Emacs is
making a list of file name completions). */
BY_HANDLE_FILE_INFORMATION info;
@@ -5777,7 +5784,10 @@ check_windows_init_file (void)
it cannot find the Windows installation file. If this file does
not exist in the expected place, tell the user. */
- if (!noninteractive && !inhibit_window_system)
+ if (!noninteractive && !inhibit_window_system
+ /* Vload_path is not yet initialized when we are loading
+ loadup.el. */
+ && NILP (Vpurify_flag))
{
Lisp_Object objs[2];
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
DWORD dwFlags;
};
-/* Reportedly, VS 6 does not have this in its headers. */
-#if defined (_MSC_VER) && _MSC_VER < 1300
+/* Reportedly, MSVC does not have this in its headers. */
+#ifdef _MSC_VER
DECLARE_HANDLE(HMONITOR);
#endif
@@ -2088,7 +2088,7 @@ w32_key_to_modifier (int key)
key_mapping = Qnil;
}
- /* NB. This code runs in the input thread, asychronously to the lisp
+ /* NB. This code runs in the input thread, asynchronously to the lisp
thread, so we must be careful to ensure access to lisp data is
thread-safe. The following code is safe because the modifier
variable values are updated atomically from lisp and symbols are
@@ -3977,7 +3977,7 @@ x_make_gc (struct frame *f)
/* Handler for signals raised during x_create_frame and
- x_create_top_frame. FRAME is the frame which is partially
+ x_create_tip_frame. FRAME is the frame which is partially
constructed. */
static Lisp_Object
@@ -3986,13 +3986,14 @@ unwind_create_frame (Lisp_Object frame)
struct frame *f = XFRAME (frame);
/* If frame is ``official'', nothing to do. */
- if (!CONSP (Vframe_list) || !EQ (XCAR (Vframe_list), frame))
+ if (NILP (Fmemq (frame, Vframe_list)))
{
#if GLYPH_DEBUG
struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f);
#endif
x_free_frame_resources (f);
+ free_glyphs (f);
#if GLYPH_DEBUG
/* Check that reference counts are indeed correct. */
@@ -4134,7 +4135,6 @@ This function is an internal primitive--use `make-frame' instead. */)
FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = GetSystemMetrics (SM_CXVSCROLL);
f->terminal = dpyinfo->terminal;
- f->terminal->reference_count++;
f->output_method = output_w32;
f->output_data.w32 =
@@ -4153,7 +4153,8 @@ This function is an internal primitive--use `make-frame' instead. */)
/* With FRAME_X_DISPLAY_INFO set up, this unwind-protect is safe. */
record_unwind_protect (unwind_create_frame, frame);
#if GLYPH_DEBUG
- image_cache_refcount = FRAME_IMAGE_CACHE (f)->refcount;
+ image_cache_refcount =
+ FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0;
dpyinfo_refcount = dpyinfo->reference_count;
#endif /* GLYPH_DEBUG */
@@ -4286,6 +4287,7 @@ This function is an internal primitive--use `make-frame' instead. */)
x_make_gc (f);
/* Now consider the frame official. */
+ f->terminal->reference_count++;
FRAME_W32_DISPLAY_INFO (f)->reference_count++;
Vframe_list = Fcons (frame, Vframe_list);
@@ -5228,7 +5230,6 @@ x_create_tip_frame (struct w32_display_info *dpyinfo,
from this point on, x_destroy_window might screw up reference
counts etc. */
f->terminal = dpyinfo->terminal;
- f->terminal->reference_count++;
f->output_method = output_w32;
f->output_data.w32 =
(struct w32_output *) xmalloc (sizeof (struct w32_output));
@@ -5238,7 +5239,8 @@ x_create_tip_frame (struct w32_display_info *dpyinfo,
f->icon_name = Qnil;
#if GLYPH_DEBUG
- image_cache_refcount = FRAME_IMAGE_CACHE (f)->refcount;
+ image_cache_refcount =
+ FRAME_IMAGE_CACHE ? FRAME_IMAGE_CACHE (f)->refcount : 0;
dpyinfo_refcount = dpyinfo->reference_count;
#endif /* GLYPH_DEBUG */
FRAME_KBOARD (f) = kb;
@@ -5379,15 +5381,16 @@ x_create_tip_frame (struct w32_display_info *dpyinfo,
UNGCPRO;
+ /* Now that the frame is official, it counts as a reference to
+ its display. */
+ FRAME_W32_DISPLAY_INFO (f)->reference_count++;
+ f->terminal->reference_count++;
+
/* It is now ok to make the frame official even if we get an error
below. And the frame needs to be on Vframe_list or making it
visible won't work. */
Vframe_list = Fcons (frame, Vframe_list);
- /* Now that the frame is official, it counts as a reference to
- its display. */
- FRAME_W32_DISPLAY_INFO (f)->reference_count++;
-
/* Setting attributes of faces of the tooltip frame from resources
and similar will increment face_change_count, which leads to the
clearing of all current matrices. Since this isn't necessary
@@ -6706,7 +6709,7 @@ DEFUN ("default-printer-name", Fdefault_printer_name, Sdefault_printer_name,
ClosePrinter (hPrn);
return Qnil;
}
- /* Call GetPrinter again with big enouth memory block */
+ /* Call GetPrinter again with big enough memory block. */
err = GetPrinter (hPrn, 2, (LPBYTE)ppi2, dwNeeded, &dwReturned);
ClosePrinter (hPrn);
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)
/* w32 implementation of match for font backend.
Return a font entity most closely matching with FONT_SPEC on
- FRAME. The closeness is detemined by the font backend, thus
+ FRAME. The closeness is determined by the font backend, thus
`face-font-selection-order' is ignored here. */
static Lisp_Object
w32font_match (Lisp_Object frame, Lisp_Object font_spec)
@@ -1284,14 +1284,23 @@ font_matches_spec (DWORD type, NEWTEXTMETRICEX *font,
{
/* Only truetype fonts will have information about what
scripts they support. This probably means the user
- will have to force Emacs to use raster, postscript
- or atm fonts for non-ASCII text. */
+ will have to force Emacs to use raster, PostScript
+ or ATM fonts for non-ASCII text. */
if (type & TRUETYPE_FONTTYPE)
{
Lisp_Object support
= font_supported_scripts (&font->ntmFontSig);
if (! memq_no_quit (val, support))
return 0;
+
+ /* Avoid using non-Japanese fonts for Japanese, even
+ if they claim they are capable, due to known
+ breakage in Vista and Windows 7 fonts
+ (bug#6029). */
+ if (EQ (val, Qkana)
+ && (font->ntmTm.tmCharSet != SHIFTJIS_CHARSET
+ || !(font->ntmFontSig.fsCsb[0] & CSB_JAPANESE)))
+ return 0;
}
else
{
@@ -1455,7 +1464,7 @@ check_face_name (LOGFONT *font, char *full_name)
/* Helvetica is mapped to Arial in Windows, but if a Type-1 Helvetica is
installed, we run into problems with the Uniscribe backend which tries
to avoid non-truetype fonts, and ends up mixing the Type-1 Helvetica
- with Arial's characteristics, since that attempt to use Truetype works
+ with Arial's characteristics, since that attempt to use TrueType works
some places, but not others. */
if (!xstrcasecmp (font->lfFaceName, "helvetica"))
{
@@ -1483,7 +1492,7 @@ check_face_name (LOGFONT *font, char *full_name)
/* Callback function for EnumFontFamiliesEx.
- * Checks if a font matches everything we are trying to check agaist,
+ * Checks if a font matches everything we are trying to check against,
* and if so, adds it to a list. Both the data we are checking against
* and the list to which the fonts are added are passed in via the
* lparam argument, in the form of a font_callback_data struct. */
@@ -1507,7 +1516,7 @@ add_font_entity_to_list (ENUMLOGFONTEX *logical_font,
/* For uniscribe backend, consider only truetype or opentype fonts
that have some unicode coverage. */
if (match_data->opentype_only
- && ((!physical_font->ntmTm.ntmFlags & NTMFLAGS_OPENTYPE
+ && ((!(physical_font->ntmTm.ntmFlags & NTMFLAGS_OPENTYPE)
&& !(font_type & TRUETYPE_FONTTYPE))
|| !is_unicode))
return 1;
@@ -1568,8 +1577,8 @@ add_font_entity_to_list (ENUMLOGFONTEX *logical_font,
the bits for CJK ranges that include those characters. */
else if (EQ (spec_charset, Qunicode_sip))
{
- if (!physical_font->ntmFontSig.fsUsb[1] & 0x02000000
- || !physical_font->ntmFontSig.fsUsb[1] & 0x28000000)
+ if (!(physical_font->ntmFontSig.fsUsb[1] & 0x02000000)
+ || !(physical_font->ntmFontSig.fsUsb[1] & 0x28000000))
return 1;
}
@@ -1577,8 +1586,16 @@ add_font_entity_to_list (ENUMLOGFONTEX *logical_font,
/* If registry was specified, ensure it is reported as the same. */
if (!NILP (spec_charset))
- ASET (entity, FONT_REGISTRY_INDEX, spec_charset);
-
+ {
+ /* Avoid using non-Japanese fonts for Japanese, even if they
+ claim they are capable, due to known breakage in Vista
+ and Windows 7 fonts (bug#6029). */
+ if (logical_font->elfLogFont.lfCharSet == SHIFTJIS_CHARSET
+ && !(physical_font->ntmFontSig.fsCsb[0] & CSB_JAPANESE))
+ return 1;
+ else
+ ASET (entity, FONT_REGISTRY_INDEX, spec_charset);
+ }
/* Otherwise if using the uniscribe backend, report ANSI and DEFAULT
fonts as unicode and skip other charsets. */
else if (match_data->opentype_only)
@@ -2204,7 +2221,7 @@ font_supported_scripts (FONTSIGNATURE * sig)
so don't need to mark them separately. */
/* 1: Latin-1 supplement, 2: Latin Extended A, 3: Latin Extended B. */
SUBRANGE (4, Qphonetic);
- /* 5: Spacing and tone modifiers, 6: Combining Diacriticals. */
+ /* 5: Spacing and tone modifiers, 6: Combining Diacritical Marks. */
SUBRANGE (7, Qgreek);
SUBRANGE (8, Qcoptic);
SUBRANGE (9, Qcyrillic);
@@ -2294,7 +2311,7 @@ font_supported_scripts (FONTSIGNATURE * sig)
/* 115: Saurashtra, 116: Kayah Li, 117: Rejang. */
SUBRANGE (118, Qcham);
/* 119: Ancient symbols, 120: Phaistos Disc. */
- /* 121: Carian, Lycian, Lydian, 122: Dominos, Mah Jong tiles. */
+ /* 121: Carian, Lycian, Lydian, 122: Dominoes, Mahjong tiles. */
/* 123-127: Reserved. */
/* 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/>. */
#define EMACS_W32FONT_H
-/* Bit 17 of ntmFlags in NEWTEXTMETRIC is set for Postscript OpenType fonts,
- bit 18 for Truetype OpenType fonts, bit 20 for Type1 fonts. */
+/* Bit 17 of ntmFlags in NEWTEXTMETRIC is set for PostScript OpenType fonts,
+ bit 18 for TrueType OpenType fonts, bit 20 for Type1 fonts. */
#ifndef NTM_PS_OPENTYPE
#define NTM_PS_OPENTYPE 0x00020000
#endif
@@ -84,4 +84,3 @@ int uniscribe_check_otf (LOGFONT *font, Lisp_Object otf_spec);
Lisp_Object intern_font_name (char *);
#endif
-
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)
out_string = (char *) local_alloc (strlen (wv->name) + 1);
strcpy (out_string, wv->name);
#ifdef MENU_DEBUG
- DebPrint ("Menu: allocing %ld for owner-draw", out_string);
+ DebPrint ("Menu: allocating %ld for owner-draw", out_string);
#endif
fuFlags = MF_OWNERDRAW | MF_DISABLED;
}
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)
cp->status = STATUS_READ_ERROR;
SetEvent (cp->char_consumed);
#if 0
- /* We used to forceably terminate the thread here, but it
+ /* We used to forcibly terminate the thread here, but it
is normally unnecessary, and in abnormal cases, the worst that
will happen is we have an extra idle thread hanging around
waiting for the zombie process. */
@@ -241,7 +241,8 @@ reader_thread (void *arg)
/* We have to wait for the go-ahead before we can start */
if (cp == NULL
- || WaitForSingleObject (cp->char_consumed, INFINITE) != WAIT_OBJECT_0)
+ || WaitForSingleObject (cp->char_consumed, INFINITE) != WAIT_OBJECT_0
+ || cp->fd < 0)
return 1;
for (;;)
@@ -2295,7 +2296,7 @@ filesystems via ange-ftp. */);
doc: /* Non-nil means attempt to fake realistic inode values.
This works by hashing the truename of files, and should detect
aliasing between long and short (8.3 DOS) names, but can have
-false positives because of hash collisions. Note that determing
+false positives because of hash collisions. Note that determining
the truename of a file can be slow. */);
Vw32_generate_fake_inodes = Qnil;
#endif
@@ -2319,4 +2320,3 @@ where the performance impact may be noticeable even on modern hardware. */);
staticpro (&Vw32_valid_codepages);
}
/* end of w32proc.c */
-
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,
/* Handle mouse button event on the tool-bar of frame F, at
frame-relative coordinates X/Y. EVENT_TYPE is either ButtionPress
- or ButtonRelase. */
+ or ButtonRelease. */
static void
w32_handle_tool_bar_click (struct frame *f, struct input_event *button_event)
@@ -5690,15 +5690,15 @@ x_make_frame_visible (struct frame *f)
f->output_data.w32->asked_for_visible = 1;
- /* The first of these seems to give more expected behavior, but
- was added as a commented out line in Sept 1997, with the
- second version remaining uncommented. There may have been
- some problem with it that led to it not being enabled,
- so the old version remains commented out below in case we
- decide we need to go back to it [23.0.60 2008-06-09]. */
+ /* According to a report in emacs-devel 2008-06-03, SW_SHOWNORMAL
+ causes unexpected behavior when unminimizing frames that were
+ previously maximised. But only SW_SHOWNORMAL works properly for
+ frames that were truely hidden (using make-frame-invisible), so
+ we need it to avoid Bug#5482. It seems that async_iconified
+ is only set for minimised windows that are still visible, so
+ use that to determine the appropriate flag to pass ShowWindow. */
my_show_window (f, FRAME_W32_WINDOW (f),
- f->async_iconified ? SW_RESTORE : SW_SHOW);
- /* my_show_window (f, FRAME_W32_WINDOW (f), SW_SHOWNORMAL); */
+ f->async_iconified ? SW_RESTORE : SW_SHOWNORMAL);
}
/* 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);
/* Keypad command key support. W32 doesn't have virtual keys defined
for the function keys on the keypad (they are mapped to the standard
- fuction keys), so we define our own. */
+ function keys), so we define our own. */
#define VK_NUMPAD_BEGIN 0x92
#define VK_NUMPAD_CLEAR (VK_NUMPAD_BEGIN + 0)
#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)
if (SUCCEEDED (result) && nglyphs == 1)
{
/* Some fonts return .notdef glyphs instead of failing.
- (Truetype spec reserves glyph code 0 for .notdef) */
+ (TrueType spec reserves glyph code 0 for .notdef) */
if (glyphs[0])
code = glyphs[0];
}
@@ -961,4 +961,3 @@ syms_of_w32uniscribe (void)
register_font_driver (&uniscribe_font_driver, NULL);
}
-
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,
DEFUN ("window-live-p", Fwindow_live_p, Swindow_live_p, 1, 1, 0,
doc: /* Return t if OBJECT is a live window and nil otherwise.
-A live window is a window that displays a buffer. */)
+A live window is a window that displays a buffer.
+Internal windows and deleted windows are not live. */)
(Lisp_Object object)
{
return WINDOW_LIVE_P (object) ? Qt : Qnil;
@@ -168,7 +169,7 @@ A live window is a window that displays a buffer. */)
/* Frames and windows. */
DEFUN ("window-frame", Fwindow_frame, Swindow_frame, 1, 1, 0,
doc: /* Return the frame that window WINDOW is on.
-WINDOW can be any window and defaults to the selected one. */)
+If WINDOW is omitted or nil, it defaults to the selected window. */)
(Lisp_Object window)
{
return decode_any_window (window)->frame;
@@ -177,9 +178,8 @@ WINDOW can be any window and defaults to the selected one. */)
DEFUN ("frame-root-window", Fframe_root_window, Sframe_root_window, 0, 1, 0,
doc: /* Return the root window of FRAME-OR-WINDOW.
If omitted, FRAME-OR-WINDOW defaults to the currently selected frame.
-Else if FRAME-OR-WINDOW denotes any window, return the root window of
-that window's frame. If FRAME-OR-WINDOW denotes a live frame, return
-the root window of that frame. */)
+With a frame argument, return that frame's root window.
+With a window argument, return the root window of that window's frame. */)
(Lisp_Object frame_or_window)
{
Lisp_Object window;
@@ -198,9 +198,8 @@ the root window of that frame. */)
}
DEFUN ("minibuffer-window", Fminibuffer_window, Sminibuffer_window, 0, 1, 0,
- doc: /* Return the window used now for minibuffers.
-If the optional argument FRAME is specified, return the minibuffer window
-used by that frame. */)
+ doc: /* Return the minibuffer window for frame FRAME.
+If FRAME is omitted or nil, it defaults to the selected frame. */)
(Lisp_Object frame)
{
if (NILP (frame))
@@ -212,7 +211,7 @@ used by that frame. */)
DEFUN ("window-minibuffer-p", Fwindow_minibuffer_p,
Swindow_minibuffer_p, 0, 1, 0,
doc: /* Return non-nil if WINDOW is a minibuffer window.
-WINDOW can be any window and defaults to the selected one. */)
+If WINDOW is omitted or nil, it defaults to the selected window. */)
(Lisp_Object window)
{
return MINI_WINDOW_P (decode_any_window (window)) ? Qt : Qnil;
@@ -409,44 +408,48 @@ buffer of the selected window before each command. */)
}
DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0,
- doc: /* Return the buffer that WINDOW is displaying.
-WINDOW can be any window and defaults to the selected one.
-If WINDOW is an internal window return nil. */)
+ doc: /* Return the buffer displayed in window WINDOW.
+If WINDOW is omitted or nil, it defaults to the selected window.
+Return nil for an internal window or a deleted window. */)
(Lisp_Object window)
{
return decode_any_window (window)->buffer;
}
DEFUN ("window-parent", Fwindow_parent, Swindow_parent, 0, 1, 0,
- doc: /* Return WINDOW's parent window.
-WINDOW can be any window and defaults to the selected one.
-Return nil if WINDOW has no parent. */)
+ doc: /* Return the parent window of window WINDOW.
+If WINDOW is omitted or nil, it defaults to the selected window.
+Return nil for a window with no parent (e.g. a root window). */)
(Lisp_Object window)
{
return decode_any_window (window)->parent;
}
-DEFUN ("window-top-child", Fwindow_top_child, Swindow_top_child, 0, 1, 0,
- doc: /* Return WINDOW's topmost child window.
-WINDOW can be any window and defaults to the selected one.
-Return nil if WINDOW is not a vertical combination. */)
+DEFUN ("window-top-child", Fwindow_top_child, Swindow_top_child, 1, 1, 0,
+ doc: /* Return the topmost child window of window WINDOW.
+Return nil if WINDOW is a live window (live windows have no children).
+Return nil if WINDOW is an internal window whose children form a
+horizontal combination. */)
(Lisp_Object window)
{
+ CHECK_WINDOW (window);
return decode_any_window (window)->vchild;
}
-DEFUN ("window-left-child", Fwindow_left_child, Swindow_left_child, 0, 1, 0,
- doc: /* Return WINDOW's leftmost child window.
-WINDOW can be any window and defaults to the selected one.
-Return nil if WINDOW is not a horizontal combination. */)
+DEFUN ("window-left-child", Fwindow_left_child, Swindow_left_child, 1, 1, 0,
+ doc: /* Return the leftmost child window of window WINDOW.
+Return nil if WINDOW is a live window (live windows have no children).
+Return nil if WINDOW is an internal window whose children form a
+vertical combination. */)
(Lisp_Object window)
{
+ CHECK_WINDOW (window);
return decode_any_window (window)->hchild;
}
DEFUN ("window-next-sibling", Fwindow_next_sibling, Swindow_next_sibling, 0, 1, 0,
- doc: /* Return WINDOW's next sibling window.
-WINDOW can be any window and defaults to the selected one.
+ doc: /* Return the next sibling window of window WINDOW.
+If WINDOW is omitted or nil, it defaults to the selected window.
Return nil if WINDOW has no next sibling. */)
(Lisp_Object window)
{
@@ -454,123 +457,96 @@ Return nil if WINDOW has no next sibling. */)
}
DEFUN ("window-prev-sibling", Fwindow_prev_sibling, Swindow_prev_sibling, 0, 1, 0,
- doc: /* Return WINDOW's previous sibling window.
-WINDOW can be any window and defaults to the selected one.
+ doc: /* Return the previous sibling window of window WINDOW.
+If WINDOW is omitted or nil, it defaults to the selected window.
Return nil if WINDOW has no previous sibling. */)
(Lisp_Object window)
{
return decode_any_window (window)->prev;
}
-DEFUN ("window-splits", Fwindow_splits, Swindow_splits, 0, 1, 0,
- doc: /* Return splits status for WINDOW.
-WINDOW can be any window and defaults to the selected one.
-
-If the value returned by this function is nil and WINDOW is resized, the
-corresponding space is preferably taken from (or given to) WINDOW's
-right sibling. When WINDOW is deleted, its space is given to its left
-sibling.
+DEFUN ("window-combination-limit", Fwindow_combination_limit, Swindow_combination_limit, 0, 1, 0,
+ doc: /* Return combination limit of window WINDOW.
+If WINDOW is omitted or nil, it defaults to the selected window.
-If the value returned by this function is non-nil, resizing and deleting
-WINDOW may resize all windows in the same combination. */)
+If the return value is nil, child windows of WINDOW can be recombined with
+WINDOW's siblings. A return value of t means that child windows of
+WINDOW are never \(re-)combined with WINDOW's siblings. */)
(Lisp_Object window)
{
- return decode_any_window (window)->splits;
+ return decode_any_window (window)->combination_limit;
}
-DEFUN ("set-window-splits", Fset_window_splits, Sset_window_splits, 2, 2, 0,
- doc: /* Set splits status of WINDOW to STATUS.
-WINDOW can be any window and defaults to the selected one. Return
-STATUS.
+DEFUN ("set-window-combination-limit", Fset_window_combination_limit, Sset_window_combination_limit, 2, 2, 0,
+ doc: /* Set combination limit of window WINDOW to STATUS; return STATUS.
+If WINDOW is omitted or nil, it defaults to the selected window.
-If STATUS is nil and WINDOW is later resized, the corresponding space is
-preferably taken from (or given to) WINDOW's right sibling. When WINDOW
-is deleted, its space is given to its left sibling.
-
-If STATUS is non-nil, resizing and deleting WINDOW may resize all
-windows in the same combination. */)
+If STATUS is nil, child windows of WINDOW can be recombined with
+WINDOW's siblings. STATUS t means that child windows of WINDOW are
+never \(re-)combined with WINDOW's siblings. Other values are reserved
+for future use. */)
(Lisp_Object window, Lisp_Object status)
{
register struct window *w = decode_any_window (window);
- w->splits = status;
+ w->combination_limit = status;
- return w->splits;
+ return w->combination_limit;
}
-DEFUN ("window-nest", Fwindow_nest, Swindow_nest, 0, 1, 0,
- doc: /* Return nest status of WINDOW.
-WINDOW can be any window and defaults to the selected one.
-
-If the return value is nil, subwindows of WINDOW can be recombined with
-WINDOW's siblings. A return value of non-nil means that subwindows of
-WINDOW are never \(re-)combined with WINDOW's siblings. */)
+DEFUN ("window-use-time", Fwindow_use_time, Swindow_use_time, 0, 1, 0,
+ doc: /* Return the use time of window WINDOW.
+If WINDOW is omitted or nil, it defaults to the selected window.
+The window with the highest use time is the most recently selected
+one. The window with the lowest use time is the least recently
+selected one. */)
(Lisp_Object window)
{
- return decode_any_window (window)->nest;
+ return decode_window (window)->use_time;
}
+
+DEFUN ("window-total-height", Fwindow_total_height, Swindow_total_height, 0, 1, 0,
+ doc: /* Return the total height, in lines, of window WINDOW.
+If WINDOW is omitted or nil, it defaults to the selected window.
-DEFUN ("set-window-nest", Fset_window_nest, Sset_window_nest, 2, 2, 0,
- doc: /* Set nest status of WINDOW to STATUS.
-WINDOW can be any window and defaults to the selected one. Return
-STATUS.
+The return value includes the mode line and header line, if any.
+If WINDOW is an internal window, the total height is the height
+of the screen areas spanned by its children.
-If STATUS is nil, subwindows of WINDOW can be recombined with WINDOW's
-siblings. STATUS non-nil means that subwindows of WINDOW are never
-\(re-)combined with WINDOW's siblings. */)
- (Lisp_Object window, Lisp_Object status)
+On a graphical display, this total height is reported as an
+integer multiple of the default character height. */)
+ (Lisp_Object window)
{
- register struct window *w = decode_any_window (window);
+ return decode_any_window (window)->total_lines;
+}
- w->nest = status;
+DEFUN ("window-total-width", Fwindow_total_width, Swindow_total_width, 0, 1, 0,
+ doc: /* Return the total width, in columns, of window WINDOW.
+If WINDOW is omitted or nil, it defaults to the selected window.
- return w->nest;
-}
+The return value includes any vertical dividers or scroll bars
+belonging to WINDOW. If WINDOW is an internal window, the total width
+is the width of the screen areas spanned by its children.
-DEFUN ("window-use-time", Fwindow_use_time, Swindow_use_time, 0, 1, 0,
- doc: /* Return WINDOW's use time.
-WINDOW defaults to the selected window. The window with the highest use
-time is the most recently selected one. The window with the lowest use
-time is the least recently selected one. */)
+On a graphical display, this total width is reported as an
+integer multiple of the default character width. */)
(Lisp_Object window)
{
- return decode_window (window)->use_time;
-}
-
-DEFUN ("window-total-size", Fwindow_total_size, Swindow_total_size, 0, 2, 0,
- doc: /* Return the total number of lines of WINDOW.
-WINDOW can be any window and defaults to the selected one. The return
-value includes WINDOW's mode line and header line, if any. If WINDOW
-is internal, the return value is the sum of the total number of lines
-of WINDOW's child windows if these are vertically combined and the
-height of WINDOW's first child otherwise.
-
-Optional argument HORIZONTAL non-nil means return the total number of
-columns of WINDOW. In this case the return value includes any vertical
-dividers or scrollbars of WINDOW. If WINDOW is internal, the return
-value is the sum of the total number of columns of WINDOW's child
-windows if they are horizontally combined and the width of WINDOW's
-first child otherwise. */)
- (Lisp_Object window, Lisp_Object horizontal)
-{
- if (NILP (horizontal))
- return decode_any_window (window)->total_lines;
- else
- return decode_any_window (window)->total_cols;
+ return decode_any_window (window)->total_cols;
}
DEFUN ("window-new-total", Fwindow_new_total, Swindow_new_total, 0, 1, 0,
- doc: /* Return new total size of WINDOW.
-WINDOW defaults to the selected window. */)
+ doc: /* Return the new total size of window WINDOW.
+If WINDOW is omitted or nil, it defaults to the selected window. */)
(Lisp_Object window)
{
return decode_any_window (window)->new_total;
}
DEFUN ("window-normal-size", Fwindow_normal_size, Swindow_normal_size, 0, 2, 0,
- doc: /* Return normal height of WINDOW.
-WINDOW can be any window and defaults to the selected one. Optional
-argument HORIZONTAL non-nil means return normal width of WINDOW. */)
+ doc: /* Return the normal height of window WINDOW.
+If WINDOW is omitted or nil, it defaults to the selected window.
+If HORIZONTAL is non-nil, return the normal width of WINDOW. */)
(Lisp_Object window, Lisp_Object horizontal)
{
if (NILP (horizontal))
@@ -580,24 +556,32 @@ argument HORIZONTAL non-nil means return normal width of WINDOW. */)
}
DEFUN ("window-new-normal", Fwindow_new_normal, Swindow_new_normal, 0, 1, 0,
- doc: /* Return new normal size of WINDOW.
-WINDOW can be any window and defaults to the selected one. */)
+ doc: /* Return new normal size of window WINDOW.
+If WINDOW is omitted or nil, it defaults to the selected window. */)
(Lisp_Object window)
{
return decode_any_window (window)->new_normal;
}
DEFUN ("window-left-column", Fwindow_left_column, Swindow_left_column, 0, 1, 0,
- doc: /* Return left column of WINDOW.
-WINDOW can be any window and defaults to the selected one. */)
+ doc: /* Return left column of window WINDOW.
+This is the distance, in columns, between the left edge of WINDOW and
+the left edge of the frame's window area. For instance, the return
+value is 0 if there is no window to the left of WINDOW.
+
+If WINDOW is omitted or nil, it defaults to the selected window. */)
(Lisp_Object window)
{
return decode_any_window (window)->left_col;
}
DEFUN ("window-top-line", Fwindow_top_line, Swindow_top_line, 0, 1, 0,
- doc: /* Return top line of WINDOW.
-WINDOW can be any window and defaults to the selected one. */)
+ doc: /* Return top line of window WINDOW.
+This is the distance, in lines, between the top of WINDOW and the top
+of the frame's window area. For instance, the return value is 0 if
+there is no window above WINDOW.
+
+If WINDOW is omitted or nil, it defaults to the selected window. */)
(Lisp_Object window)
{
return decode_any_window (window)->top_line;
@@ -652,25 +636,34 @@ window_body_cols (struct window *w)
return width;
}
-DEFUN ("window-body-size", Fwindow_body_size, Swindow_body_size, 0, 2, 0,
- doc: /* Return the number of lines of WINDOW's body.
-WINDOW must be a live window and defaults to the selected one. The
-return value does not include WINDOW's mode line and header line, if
-any.
-
-Optional argument HORIZONTAL non-nil means return the number of columns
-of WINDOW's body. In this case, the return value does not include any
-vertical dividers or scroll bars owned by WINDOW. On a window-system
-the return value does not include the number of columns used for
-WINDOW's fringes or display margins either. */)
- (Lisp_Object window, Lisp_Object horizontal)
+DEFUN ("window-body-height", Fwindow_body_height, Swindow_body_height, 0, 1, 0,
+ doc: /* Return the height, in lines, of WINDOW's text area.
+If WINDOW is omitted or nil, it defaults to the selected window.
+Signal an error if the window is not live.
+
+The returned height does not include the mode line or header line.
+On a graphical display, the height is expressed as an integer multiple
+of the default character height. If a line at the bottom of the text
+area is only partially visible, that counts as a whole line; to
+exclude partially-visible lines, use `window-text-height'. */)
+ (Lisp_Object window)
{
- struct window *w = decode_any_window (window);
+ struct window *w = decode_window (window);
+ return make_number (window_body_lines (w));
+}
- if (NILP (horizontal))
- return make_number (window_body_lines (w));
- else
- return make_number (window_body_cols (w));
+DEFUN ("window-body-width", Fwindow_body_width, Swindow_body_width, 0, 1, 0,
+ doc: /* Return the width, in columns, of WINDOW's text area.
+If WINDOW is omitted or nil, it defaults to the selected window.
+Signal an error if the window is not live.
+
+The return value does not include any vertical dividers, fringe or
+marginal areas, or scroll bars. On a graphical display, the width is
+expressed as an integer multiple of the default character width. */)
+ (Lisp_Object window)
+{
+ struct window *w = decode_window (window);
+ return make_number (window_body_cols (w));
}
DEFUN ("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
bar, display margins, fringes, header line, and/or mode line. */)
(Lisp_Object window)
{
- register struct window *w = decode_any_window (window);
+ register struct window *w = decode_window (window);
return list4 (make_number (WINDOW_BOX_LEFT_EDGE_COL (w)
+ WINDOW_LEFT_MARGIN_COLS (w)
@@ -847,9 +840,9 @@ bar, display margins, fringes, header line, and/or mode line. */)
}
DEFUN ("window-inside-pixel-edges", Fwindow_inside_pixel_edges, Swindow_inside_pixel_edges, 0, 1, 0,
- doc: /* Return a list of the edge pixel coordinates of WINDOW.
-The list has the form (LEFT TOP RIGHT BOTTOM), all relative to 0, 0 at
-the top left corner of the frame.
+ doc: /* Return a list of the edge pixel coordinates of WINDOW's text area.
+The list has the form (LEFT TOP RIGHT BOTTOM), all relative to (0,0)
+at the top left corner of the frame's window area.
RIGHT is one more than the rightmost x position of WINDOW's text area.
BOTTOM 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,
display margins, fringes, header line, and/or mode line. */)
(Lisp_Object window)
{
- register struct window *w = decode_any_window (window);
+ register struct window *w = decode_window (window);
return list4 (make_number (WINDOW_BOX_LEFT_EDGE_X (w)
+ WINDOW_LEFT_MARGIN_WIDTH (w)
@@ -874,9 +867,9 @@ display margins, fringes, header line, and/or mode line. */)
DEFUN ("window-inside-absolute-pixel-edges",
Fwindow_inside_absolute_pixel_edges,
Swindow_inside_absolute_pixel_edges, 0, 1, 0,
- doc: /* Return a list of the edge pixel coordinates of WINDOW.
-The list has the form (LEFT TOP RIGHT BOTTOM), all relative to 0, 0 at
-the top left corner of the display.
+ doc: /* Return a list of the edge pixel coordinates of WINDOW's text area.
+The list has the form (LEFT TOP RIGHT BOTTOM), all relative to (0,0)
+at the top left corner of the frame's window area.
RIGHT is one more than the rightmost x position of WINDOW's text area.
BOTTOM 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,
display margins, fringes, header line, and/or mode line. */)
(Lisp_Object window)
{
- register struct window *w = decode_any_window (window);
+ register struct window *w = decode_window (window);
int add_x, add_y;
calc_absolute_offset (w, &add_x, &add_y);
@@ -1888,7 +1881,7 @@ recombine_windows (Lisp_Object window)
w = XWINDOW (window);
parent = w->parent;
- if (!NILP (parent) && NILP (w->nest))
+ if (!NILP (parent) && NILP (w->combination_limit))
{
p = XWINDOW (parent);
if (((!NILP (p->vchild) && !NILP (w->vchild))
@@ -2303,7 +2296,7 @@ window_list_1 (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames)
DEFUN ("window-list", Fwindow_list, Swindow_list, 0, 3, 0,
doc: /* Return a list of windows on FRAME, starting with WINDOW.
FRAME nil or omitted means use the selected frame.
-WINDOW nil or omitted means use the selected window.
+WINDOW nil or omitted means use the window selected within FRAME.
MINIBUF t means include the minibuffer window, even if it isn't active.
MINIBUF nil or omitted means include the minibuffer window only
if it's active.
@@ -2353,7 +2346,7 @@ Anything else means consider all windows on WINDOW's frame and no
others.
If WINDOW is not on the list of windows returned, some other window will
-be listed first but no error is signalled. */)
+be listed first but no error is signaled. */)
(Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames)
{
return window_list_1 (window, minibuf, all_frames);
@@ -2560,9 +2553,9 @@ DEFUN ("delete-other-windows-internal", Fdelete_other_windows_internal,
Only the frame WINDOW is on is affected. WINDOW may be any window and
defaults to the selected one.
-Optional argument ROOT, if non-nil, must specify an internal window
-containing WINDOW as a subwindow. If this is the case, replace ROOT by
-WINDOW and leave alone any windows not contained in ROOT.
+Optional argument ROOT, if non-nil, must specify an internal window such
+that WINDOW is in its window subtree. If this is the case, replace ROOT
+by WINDOW and leave alone any windows not part of ROOT's subtree.
When WINDOW is live try to reduce display jumps by keeping the text
previously 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. */)
}
else
{
- /* See if the frame's selected window is a subwindow of WINDOW, by
- finding all the selected window's parents and comparing each
- one with WINDOW. If it isn't we need a new selected window for
- this frame. */
+ /* See if the frame's selected window is a part of the window
+ subtree rooted at WINDOW, by finding all the selected window's
+ parents and comparing each one with WINDOW. If it isn't we
+ need a new selected window for this frame. */
swindow = FRAME_SELECTED_WINDOW (f);
while (1)
{
@@ -2665,7 +2658,7 @@ window-start value is reasonable when this function is called. */)
if (NILP (w->buffer))
{
- /* Resize subwindows vertically. */
+ /* Resize child windows vertically. */
XSETINT (delta, XINT (r->total_lines) - XINT (w->total_lines));
w->top_line = r->top_line;
resize_root_window (window, delta, Qnil, Qnil);
@@ -2680,7 +2673,7 @@ window-start value is reasonable when this function is called. */)
resize_failed = 1;
}
- /* Resize subwindows horizontally. */
+ /* Resize child windows horizontally. */
if (!resize_failed)
{
w->left_col = r->left_col;
@@ -2729,23 +2722,20 @@ window-start value is reasonable when this function is called. */)
XWINDOW (w->parent)->hchild = sibling;
}
- /* Delete ROOT and all subwindows of ROOT. */
+ /* Delete ROOT and all child windows of ROOT. */
if (!NILP (r->vchild))
{
- delete_all_subwindows (r->vchild);
+ delete_all_child_windows (r->vchild);
r->vchild = Qnil;
}
else if (!NILP (r->hchild))
{
- delete_all_subwindows (r->hchild);
+ delete_all_child_windows (r->hchild);
r->hchild = Qnil;
}
replace_window (root, window, 1);
- /* Reset WINDOW's splits status. */
- w->splits = Qnil;
-
/* This must become SWINDOW anyway ....... */
if (!NILP (w->buffer) && !resize_failed)
{
@@ -3260,8 +3250,7 @@ make_parent_window (Lisp_Object window, int horflag)
p->start = Qnil;
p->pointm = Qnil;
p->buffer = Qnil;
- p->splits = Qnil;
- p->nest = Qnil;
+ p->combination_limit = Qnil;
p->window_parameters = Qnil;
}
@@ -3308,7 +3297,7 @@ make_window (void)
w->start_at_line_beg = w->display_table = w->dedicated = Qnil;
w->base_line_number = w->base_line_pos = w->region_showing = Qnil;
w->column_number_displayed = w->redisplay_end_trigger = Qnil;
- w->splits = w->nest = w->window_parameters = Qnil;
+ w->combination_limit = w->window_parameters = Qnil;
w->prev_buffers = w->next_buffers = Qnil;
/* Initialize non-Lisp data. */
w->desired_matrix = w->current_matrix = 0;
@@ -3338,7 +3327,7 @@ Return SIZE.
Optional argument ADD non-nil means add SIZE to the new total size of
WINDOW and return the sum.
-Note: This function does not operate on any subwindows of WINDOW. */)
+Note: This function does not operate on any child windows of WINDOW. */)
(Lisp_Object window, Lisp_Object size, Lisp_Object add)
{
struct window *w = decode_any_window (window);
@@ -3356,7 +3345,7 @@ DEFUN ("set-window-new-normal", Fset_window_new_normal, Sset_window_new_normal,
doc: /* Set new normal size of WINDOW to SIZE.
Return SIZE.
-Note: This function does not operate on any subwindows of WINDOW. */)
+Note: This function does not operate on any child windows of WINDOW. */)
(Lisp_Object window, Lisp_Object size)
{
struct window *w = decode_any_window (window);
@@ -3367,7 +3356,7 @@ Note: This function does not operate on any subwindows of WINDOW. */)
/* Return 1 if setting w->total_lines (w->total_cols if HORFLAG is
non-zero) to w->new_total would result in correct heights (widths)
- for window W and recursively all subwindows of W.
+ for window W and recursively all child windows of W.
Note: This function does not check any of `window-fixed-size-p',
`window-min-height' or `window-min-width'. It does check that window
@@ -3382,7 +3371,7 @@ window_resize_check (struct window *w, int horflag)
{
c = XWINDOW (w->vchild);
if (horflag)
- /* All subwindows of W must have the same width as W. */
+ /* All child windows of W must have the same width as W. */
{
while (c)
{
@@ -3394,8 +3383,8 @@ window_resize_check (struct window *w, int horflag)
return 1;
}
else
- /* The sum of the heights of the subwindows of W must equal W's
- height. */
+ /* The sum of the heights of the child windows of W must equal
+ W's height. */
{
int sum_of_sizes = 0;
while (c)
@@ -3413,7 +3402,7 @@ window_resize_check (struct window *w, int horflag)
{
c = XWINDOW (w->hchild);
if (horflag)
- /* The sum of the widths of the subwindows of W must equal W's
+ /* The sum of the widths of the child windows of W must equal W's
width. */
{
int sum_of_sizes = 0;
@@ -3427,7 +3416,7 @@ window_resize_check (struct window *w, int horflag)
return (sum_of_sizes == XINT (w->new_total));
}
else
- /* All subwindows of W must have the same height as W. */
+ /* All child windows of W must have the same height as W. */
{
while (c)
{
@@ -3447,9 +3436,9 @@ window_resize_check (struct window *w, int horflag)
}
/* Set w->total_lines (w->total_cols if HORIZONTAL is non-zero) to
- w->new_total for window W and recursively all subwindows of W. Also
- calculate and assign the new vertical (horizontal) start positions of
- each of these windows.
+ w->new_total for window W and recursively all child windows of W.
+ Also calculate and assign the new vertical (horizontal) start
+ positions of each of these windows.
This function does not perform any error checks. Make sure you have
run window_resize_check on W before applying this function. */
@@ -3523,8 +3512,8 @@ Optional argument HORIZONTAL omitted or nil means apply requested height
values. HORIZONTAL non-nil means apply requested width values.
This function checks whether the requested values sum up to a valid
-window layout, recursively assigns the new sizes of all subwindows and
-calculates and assigns the new start positions of these windows.
+window layout, recursively assigns the new sizes of all child windows
+and calculates and assigns the new start positions of these windows.
Note: This function does not check any of `window-fixed-size-p',
`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. */)
int horflag
/* HORFLAG is 1 when we split side-by-side, 0 otherwise. */
= EQ (side, Qt) || EQ (side, Qleft) || EQ (side, Qright);
- int do_nest = 0;
+ int combination_limit = 0;
CHECK_WINDOW (old);
o = XWINDOW (old);
@@ -3690,11 +3679,11 @@ set correctly. See the code of `split-window' for how this is done. */)
CHECK_NUMBER (total_size);
- /* Set do_nest to 1 if we have to make a new parent window. We do
- that if either `window-nest' is non-nil, or OLD has no parent, or
- OLD is ortho-combined. */
- do_nest =
- !NILP (Vwindow_nest)
+ /* Set combination_limit to 1 if we have to make a new parent window.
+ We do that if either `window-combination-limit' is t, or OLD has no
+ parent, or OLD is ortho-combined. */
+ combination_limit =
+ !NILP (Vwindow_combination_limit)
|| NILP (o->parent)
|| NILP (horflag
? (XWINDOW (o->parent)->hchild)
@@ -3714,8 +3703,8 @@ set correctly. See the code of `split-window' for how this is done. */)
error ("Attempt to split minibuffer window");
else if (XINT (total_size) < (horflag ? 2 : 1))
error ("Size of new window too small (after split)");
- else if (!do_nest && !NILP (Vwindow_splits))
- /* `window-splits' non-nil means try to resize OLD's siblings
+ else if (!combination_limit && !NILP (Vwindow_combination_resize))
+ /* `window-combination-resize' non-nil means try to resize OLD's siblings
proportionally. */
{
p = XWINDOW (o->parent);
@@ -3739,7 +3728,7 @@ set correctly. See the code of `split-window' for how this is done. */)
}
/* This is our point of no return. */
- if (do_nest)
+ if (combination_limit)
{
/* Save the old value of o->normal_cols/lines. It gets corrupted
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. */)
make_parent_window (old, horflag);
p = XWINDOW (o->parent);
- /* Store value of `window-nest' in new parent's nest slot. */
- p->nest = Vwindow_nest;
- /* Have PARENT inherit splits slot value from OLD. */
- p->splits = o->splits;
- /* Store value of `window-splits' in OLD's splits slot. */
- o->splits = Vwindow_splits;
+ /* Store value of `window-combination-limit' in new parent's
+ combination_limit slot. */
+ p->combination_limit = Vwindow_combination_limit;
/* These get applied below. */
p->new_total = horflag ? o->total_cols : o->total_lines;
p->new_normal = new_normal;
@@ -3804,9 +3790,6 @@ set correctly. See the code of `split-window' for how this is done. */)
n->scroll_bar_width = r->scroll_bar_width;
n->vertical_scroll_bar_type = r->vertical_scroll_bar_type;
- /* Store `window-splits' in NEW's splits slot. */
- n->splits = Vwindow_splits;
-
/* Directly assign orthogonal coordinates and sizes. */
if (horflag)
{
@@ -3920,12 +3903,12 @@ Signal an error when WINDOW is the only window on its frame. */)
if (!NILP (w->vchild))
{
- delete_all_subwindows (w->vchild);
+ delete_all_child_windows (w->vchild);
w->vchild = Qnil;
}
else if (!NILP (w->hchild))
{
- delete_all_subwindows (w->hchild);
+ delete_all_child_windows (w->hchild);
w->hchild = Qnil;
}
else if (!NILP (w->buffer))
@@ -3943,10 +3926,9 @@ Signal an error when WINDOW is the only window on its frame. */)
/* Put SIBLING into PARENT's place. */
replace_window (parent, sibling, 0);
/* Have SIBLING inherit the following three slot values from
- PARENT (the nest slot is not inherited). */
+ PARENT (the combination_limit slot is not inherited). */
s->normal_cols = p->normal_cols;
s->normal_lines = p->normal_lines;
- s->splits = p->splits;
/* Mark PARENT as deleted. */
p->vchild = p->hchild = Qnil;
/* Try to merge SIBLING into its new parent. */
@@ -5208,10 +5190,10 @@ and redisplay normally--don't erase and redraw the frame. */)
DEFUN ("window-text-height", Fwindow_text_height, Swindow_text_height,
0, 1, 0,
doc: /* Return the height in lines of the text display area of WINDOW.
-WINDOW defaults to the selected window.
+If WINDOW is omitted or nil, it defaults to the selected window.
-The return value does not include the mode line, any header line, nor
-any partial-height lines in the text display area. */)
+The returned height does not include the mode line, any header line,
+nor any partial-height lines at the bottom of the text area. */)
(Lisp_Object window)
{
struct window *w = decode_window (window);
@@ -5334,7 +5316,7 @@ struct saved_window
Lisp_Object left_margin_cols, right_margin_cols;
Lisp_Object left_fringe_width, right_fringe_width, fringes_outside_margins;
Lisp_Object scroll_bar_width, vertical_scroll_bar_type, dedicated;
- Lisp_Object splits, nest, window_parameters;
+ Lisp_Object combination_limit, window_parameters;
};
#define SAVED_WINDOW_N(swv,n) \
@@ -5505,7 +5487,7 @@ the return value is nil. Otherwise the value is t. */)
Save their current buffers in their height fields, since we may
need it later, if a buffer saved in the configuration is now
dead. */
- delete_all_subwindows (FRAME_ROOT_WINDOW (f));
+ delete_all_child_windows (FRAME_ROOT_WINDOW (f));
for (k = 0; k < saved_windows->header.size; k++)
{
@@ -5565,8 +5547,7 @@ the return value is nil. Otherwise the value is t. */)
w->scroll_bar_width = p->scroll_bar_width;
w->vertical_scroll_bar_type = p->vertical_scroll_bar_type;
w->dedicated = p->dedicated;
- w->splits = p->splits;
- w->nest = p->nest;
+ w->combination_limit = p->combination_limit;
w->window_parameters = p->window_parameters;
XSETFASTINT (w->last_modified, 0);
XSETFASTINT (w->last_overlay_modified, 0);
@@ -5719,10 +5700,10 @@ the return value is nil. Otherwise the value is t. */)
}
-/* Delete all subwindows reachable via the next, vchild, and hchild
- slots of WINDOW. */
+/* Recursively delete all child windows reachable via the next, vchild,
+ and hchild slots of WINDOW. */
void
-delete_all_subwindows (Lisp_Object window)
+delete_all_child_windows (Lisp_Object window)
{
register struct window *w;
@@ -5730,18 +5711,18 @@ delete_all_subwindows (Lisp_Object window)
if (!NILP (w->next))
/* Delete WINDOW's siblings (we traverse postorderly). */
- delete_all_subwindows (w->next);
+ delete_all_child_windows (w->next);
w->total_lines = w->buffer; /* See Fset_window_configuration for excuse. */
if (!NILP (w->vchild))
{
- delete_all_subwindows (w->vchild);
+ delete_all_child_windows (w->vchild);
w->vchild = Qnil;
}
else if (!NILP (w->hchild))
{
- delete_all_subwindows (w->hchild);
+ delete_all_child_windows (w->hchild);
w->hchild = Qnil;
}
else if (!NILP (w->buffer))
@@ -5844,8 +5825,7 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
p->scroll_bar_width = w->scroll_bar_width;
p->vertical_scroll_bar_type = w->vertical_scroll_bar_type;
p->dedicated = w->dedicated;
- p->splits = w->splits;
- p->nest = w->nest;
+ p->combination_limit = w->combination_limit;
p->window_parameters = w->window_parameters;
if (!NILP (w->buffer))
{
@@ -5995,7 +5975,7 @@ means no margin. */)
DEFUN ("window-margins", Fwindow_margins, Swindow_margins,
0, 1, 0,
doc: /* Get width of marginal areas of window WINDOW.
-If WINDOW is omitted or nil, use the currently selected window.
+If WINDOW is omitted or nil, it defaults to the selected window.
Value is a cons of the form (LEFT-WIDTH . RIGHT-WIDTH).
If a marginal area does not exist, its width will be returned
as nil. */)
@@ -6059,7 +6039,7 @@ display marginal areas and the text area. */)
DEFUN ("window-fringes", Fwindow_fringes, Swindow_fringes,
0, 1, 0,
doc: /* Get width of fringes of window WINDOW.
-If WINDOW is omitted or nil, use the currently selected window.
+If WINDOW is omitted or nil, it defaults to the selected window.
Value is a list of the form (LEFT-WIDTH RIGHT-WIDTH OUTSIDE-MARGINS). */)
(Lisp_Object window)
{
@@ -6128,7 +6108,7 @@ Fourth parameter HORIZONTAL-TYPE is currently unused. */)
DEFUN ("window-scroll-bars", Fwindow_scroll_bars, Swindow_scroll_bars,
0, 1, 0,
doc: /* Get width and type of scroll bars of window WINDOW.
-If WINDOW is omitted or nil, use the currently selected window.
+If WINDOW is omitted or nil, it defaults to the selected window.
Value is a list of the form (WIDTH COLS VERTICAL-TYPE HORIZONTAL-TYPE).
If WIDTH is nil or TYPE is t, the window is using the frame's corresponding
value. */)
@@ -6151,7 +6131,7 @@ value. */)
DEFUN ("window-vscroll", Fwindow_vscroll, Swindow_vscroll, 0, 2, 0,
doc: /* Return the amount by which WINDOW is scrolled vertically.
-Use the selected window if WINDOW is nil or omitted.
+If WINDOW is omitted or nil, it defaults to the selected window.
Normally, value is a multiple of the canonical character height of WINDOW;
optional second arg PIXELS-P means value is measured in pixels. */)
(Lisp_Object window, Lisp_Object pixels_p)
@@ -6308,7 +6288,8 @@ freeze_window_starts (struct frame *f, int freeze_p)
and the like.
This ignores a couple of things like the dedicatedness status of
- window, splits, nest and the like. This might have to be fixed. */
+ window, combination_limit and the like. This might have to be
+ fixed. */
int
compare_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
frame to be redrawn only if it is a tty frame. */);
Vrecenter_redisplay = Qtty;
- DEFVAR_LISP ("window-splits", Vwindow_splits,
- doc: /* Non-nil means splitting windows is handled specially.
+ DEFVAR_LISP ("window-combination-resize", Vwindow_combination_resize,
+ doc: /* Non-nil means resize window combinations proportionally.
If this variable is nil, splitting a window gets the entire screen space
-for displaying the new window from the window to split. If this
-variable is non-nil, splitting a window may resize all windows in the
-same combination. This also allows to split a window that is otherwise
-too small or of fixed size.
-
-The value of this variable is also assigned to the split status of the
-new window and, provided the old and new window form a new combination,
-to the window that was split as well. The split status of a window can
-be retrieved with the function `window-splits' and altered by the
-function `set-window-splits'.
-
-If the value of the variable `window-nest' is non-nil, the space for the
-new window is exclusively taken from the window that shall be split, but
-the split status of the window that is split as well as that of the new
-window are still set to the value of this variable. */);
- Vwindow_splits = Qnil;
-
- DEFVAR_LISP ("window-nest", Vwindow_nest,
+for displaying the new window from the window to split. Deleting and
+resizing a window preferably resizes one adjacent window only.
+
+If this variable is non-nil, splitting a window tries to get the space
+proportionally from all windows in the same combination. This also
+allows to split a window that is otherwise too small or of fixed size.
+Resizing and deleting a window proportionally resize all windows in the
+same combination.
+
+This variable takes no effect if `window-combination-limit' is non-nil. */);
+ Vwindow_combination_resize = Qnil;
+
+ DEFVAR_LISP ("window-combination-limit", Vwindow_combination_limit,
doc: /* Non-nil means splitting a window makes a new parent window.
If this variable is nil, splitting a window will create a new parent
window only if the window has no parent window or the window shall
-become a combination orthogonal to the one it it is part of.
+become a combination orthogonal to the one it is part of.
+
+If this variable is t, splitting a window always creates a new parent
+window. If all splits behave this way, each frame's window tree is a
+binary tree and every window but the frame's root window has exactly one
+sibling.
-If this variable is non-nil, splitting a window always creates a new
-parent window. If all splits behave this way, each frame's window tree
-is a binary tree and every window but the frame's root window has
-exactly one sibling.
+Other values are reserved for future use.
-The value of this variable is also assigned to the nest status of the
-new parent window. The nest status of a window can be retrieved via the
-function `window-nest' and altered by the function `set-window-nest'. */);
- Vwindow_nest = Qnil;
+The value of this variable is also assigned to the combination-limit
+status of the new parent window. The combination-limit status of a
+window can be retrieved via the function `window-combination-limit' and
+altered by the function `set-window-combination-limit'. */);
+ Vwindow_combination_limit = Qnil;
defsubr (&Sselected_window);
defsubr (&Sminibuffer_window);
@@ -6566,21 +6545,21 @@ function `window-nest' and altered by the function `set-window-nest'. */);
defsubr (&Swindow_left_child);
defsubr (&Swindow_next_sibling);
defsubr (&Swindow_prev_sibling);
- defsubr (&Swindow_splits);
- defsubr (&Sset_window_splits);
- defsubr (&Swindow_nest);
- defsubr (&Sset_window_nest);
+ defsubr (&Swindow_combination_limit);
+ defsubr (&Sset_window_combination_limit);
defsubr (&Swindow_use_time);
defsubr (&Swindow_top_line);
defsubr (&Swindow_left_column);
- defsubr (&Swindow_total_size);
+ defsubr (&Swindow_total_height);
+ defsubr (&Swindow_total_width);
defsubr (&Swindow_normal_size);
defsubr (&Swindow_new_total);
defsubr (&Swindow_new_normal);
defsubr (&Sset_window_new_total);
defsubr (&Sset_window_new_normal);
defsubr (&Swindow_resize_apply);
- defsubr (&Swindow_body_size);
+ defsubr (&Swindow_body_height);
+ defsubr (&Swindow_body_width);
defsubr (&Swindow_hscroll);
defsubr (&Sset_window_hscroll);
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
must run the redisplay-end-trigger-hook. */
Lisp_Object redisplay_end_trigger;
- /* Non-nil means deleting or resizing this window distributes
- space among all windows in the same combination. */
- Lisp_Object splits;
-
- /* Non-nil means this window's child windows are never
- (re-)combined. */
- Lisp_Object nest;
+ /* t means this window's child windows are not (re-)combined. */
+ Lisp_Object combination_limit;
/* Alist of <buffer, window-start, window-point> triples listing
buffers previously shown in this window. */
@@ -824,7 +819,7 @@ extern Lisp_Object window_from_coordinates (struct frame *, int, int,
enum window_part *, int);
EXFUN (Fwindow_dedicated_p, 1);
extern void resize_frame_windows (struct frame *, int, int);
-extern void delete_all_subwindows (Lisp_Object);
+extern void delete_all_child_windows (Lisp_Object);
extern void freeze_window_starts (struct frame *, int);
extern void grow_mini_window (struct window *, int);
extern 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);
This is the height of W minus the height of a mode line, if any. */
-inline int
+int
window_text_bottom_y (struct window *w)
{
int height = WINDOW_TOTAL_HEIGHT (w);
@@ -968,7 +968,7 @@ window_text_bottom_y (struct window *w)
means return the total width of W, not including fringes to
the left and right of the window. */
-inline int
+int
window_box_width (struct window *w, int area)
{
int cols = XFASTINT (w->total_cols);
@@ -1007,7 +1007,7 @@ window_box_width (struct window *w, int area)
/* Return the pixel height of the display area of window W, not
including mode lines of W, if any. */
-inline int
+int
window_box_height (struct window *w)
{
struct frame *f = XFRAME (w->frame);
@@ -1054,7 +1054,7 @@ window_box_height (struct window *w)
area AREA of window W. AREA < 0 means return the left edge of the
whole window, to the right of the left fringe of W. */
-inline int
+int
window_box_left_offset (struct window *w, int area)
{
int x;
@@ -1086,7 +1086,7 @@ window_box_left_offset (struct window *w, int area)
area AREA of window W. AREA < 0 means return the right edge of the
whole window, to the left of the right fringe of W. */
-inline int
+int
window_box_right_offset (struct window *w, int area)
{
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)
area AREA of window W. AREA < 0 means return the left edge of the
whole window, to the right of the left fringe of W. */
-inline int
+int
window_box_left (struct window *w, int area)
{
struct frame *f = XFRAME (w->frame);
@@ -1116,7 +1116,7 @@ window_box_left (struct window *w, int area)
area AREA of window W. AREA < 0 means return the right edge of the
whole window, to the left of the right fringe of W. */
-inline int
+int
window_box_right (struct window *w, int area)
{
return window_box_left (w, area) + window_box_width (w, area);
@@ -1129,7 +1129,7 @@ window_box_right (struct window *w, int area)
coordinates of the upper-left corner of the box. Return in
*BOX_WIDTH, and *BOX_HEIGHT the pixel width and height of the box. */
-inline void
+void
window_box (struct window *w, int area, int *box_x, int *box_y,
int *box_width, int *box_height)
{
@@ -2766,9 +2766,13 @@ init_iterator (struct it *it, struct window *w,
/* Do we need to reorder bidirectional text? Not if this is a
unibyte buffer: by definition, none of the single-byte
characters are strong R2L, so no reordering is needed. And
- bidi.c doesn't support unibyte buffers anyway. */
+ bidi.c doesn't support unibyte buffers anyway. Also, don't
+ reorder while we are loading loadup.el, since the tables of
+ character properties needed for reordering are not yet
+ available. */
it->bidi_p =
- !NILP (BVAR (current_buffer, bidi_display_reordering))
+ NILP (Vpurify_flag)
+ && !NILP (BVAR (current_buffer, bidi_display_reordering))
&& it->multibyte_p;
/* 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,
it->multibyte_p = multibyte > 0;
/* Bidirectional reordering of strings is controlled by the default
- value of bidi-display-reordering. */
- it->bidi_p = !NILP (BVAR (&buffer_defaults, bidi_display_reordering));
+ value of bidi-display-reordering. Don't try to reorder while
+ loading loadup.el, as the necessary character property tables are
+ not yet available. */
+ it->bidi_p =
+ NILP (Vpurify_flag)
+ && !NILP (BVAR (&buffer_defaults, bidi_display_reordering));
if (s == NULL)
{
@@ -17948,6 +17956,26 @@ insert_left_trunc_glyphs (struct it *it)
}
}
+/* Compute the hash code for ROW. */
+#if !XASSERTS
+static
+#endif
+unsigned
+row_hash (struct glyph_row *row)
+{
+ int area, k;
+ unsigned hashval = 0;
+
+ for (area = LEFT_MARGIN_AREA; area < LAST_AREA; ++area)
+ for (k = 0; k < row->used[area]; ++k)
+ hashval = ((((hashval << 4) + (hashval >> 24)) & 0x0fffffff)
+ + row->glyphs[area][k].u.val
+ + row->glyphs[area][k].face_id
+ + row->glyphs[area][k].padding_p
+ + (row->glyphs[area][k].type << 2));
+
+ return hashval;
+}
/* Compute the pixel height and width of IT->glyph_row.
@@ -18034,17 +18062,7 @@ compute_line_metrics (struct it *it)
}
/* Compute a hash code for this row. */
- {
- int area, i;
- row->hash = 0;
- for (area = LEFT_MARGIN_AREA; area < LAST_AREA; ++area)
- for (i = 0; i < row->used[area]; ++i)
- row->hash = ((((row->hash << 4) + (row->hash >> 24)) & 0x0fffffff)
- + row->glyphs[area][i].u.val
- + row->glyphs[area][i].face_id
- + row->glyphs[area][i].padding_p
- + (row->glyphs[area][i].type << 2));
- }
+ row->hash = row_hash (row);
it->max_ascent = it->max_descent = 0;
it->max_phys_ascent = it->max_phys_descent = 0;
@@ -19381,9 +19399,18 @@ display_line (struct it *it)
overlay_arrow_seen = 1;
}
+ /* Highlight trailing whitespace. */
+ if (!NILP (Vshow_trailing_whitespace))
+ highlight_trailing_whitespace (it->f, it->glyph_row);
+
/* Compute pixel dimensions of this line. */
compute_line_metrics (it);
+ /* Implementation note: No changes in the glyphs of ROW or in their
+ faces can be done past this point, because compute_line_metrics
+ computes ROW's hash value and stores it within the glyph_row
+ structure. */
+
/* Record whether this row ends inside an ellipsis. */
row->ends_in_ellipsis_p
= (it->method == GET_FROM_DISPLAY_VECTOR
@@ -19418,10 +19445,6 @@ display_line (struct it *it)
&& cursor_row_p (row))
set_cursor_from_row (it->w, row, it->w->desired_matrix, 0, 0, 0, 0);
- /* Highlight trailing whitespace. */
- if (!NILP (Vshow_trailing_whitespace))
- highlight_trailing_whitespace (it->f, it->glyph_row);
-
/* Prepare for the next line. This line starts horizontally at (X
HPOS) = (0 0). Vertical positions are incremented. As a
convenience for the caller, IT->glyph_row is set to the next
@@ -19467,7 +19490,10 @@ See also `bidi-paragraph-direction'. */)
}
if (NILP (BVAR (buf, bidi_display_reordering))
- || NILP (BVAR (buf, enable_multibyte_characters)))
+ || NILP (BVAR (buf, enable_multibyte_characters))
+ /* When we are loading loadup.el, the character property tables
+ needed for bidi iteration are not yet available. */
+ || !NILP (Vpurify_flag))
return Qleft_to_right;
else if (!NILP (BVAR (buf, bidi_paragraph_direction)))
return BVAR (buf, bidi_paragraph_direction);
@@ -22045,7 +22071,7 @@ get_glyph_face_and_encoding (struct frame *f, struct glyph *glyph,
/* Get glyph code of character C in FONT in the two-byte form CHAR2B.
- Retunr 1 if FONT has a glyph for C, otherwise return 0. */
+ Return 1 if FONT has a glyph for C, otherwise return 0. */
static inline int
get_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,
}
s->cmp_to = i;
+ if (s->face == NULL)
+ {
+ s->face = base_face->ascii_face;
+ s->font = s->face->font;
+ }
+
/* All glyph strings for the same composition has the same width,
i.e. the width set for the first component of the composition. */
s->width = s->first_glyph->pixel_width;
@@ -23612,7 +23644,7 @@ produce_stretch_glyph (struct it *it)
{
width = it->last_visible_x - it->current_x;
#ifdef HAVE_WINDOW_SYSTEM
- /* Subtact one more pixel from the stretch width, but only on
+ /* Subtract one more pixel from the stretch width, but only on
GUI frames, since on a TTY each glyph is one "pixel" wide. */
width -= FRAME_WINDOW_P (it->f);
#endif
@@ -26899,7 +26931,7 @@ note_mouse_highlight (struct frame *f, int x, int y)
&& XFASTINT (w->last_modified) == BUF_MODIFF (b)
&& XFASTINT (w->last_overlay_modified) == BUF_OVERLAY_MODIFF (b))
{
- int hpos, vpos, dx, dy, area;
+ int hpos, vpos, dx, dy, area = LAST_AREA;
ptrdiff_t pos;
struct glyph *glyph;
Lisp_Object object;
@@ -27159,8 +27191,12 @@ note_mouse_highlight (struct frame *f, int x, int y)
}
mouse_face_from_buffer_pos (window, hlinfo, pos,
- XFASTINT (before),
- XFASTINT (after),
+ NILP (before)
+ ? 1
+ : XFASTINT (before),
+ NILP (after)
+ ? BUF_Z (XBUFFER (buffer))
+ : XFASTINT (after),
before_string, after_string,
disp_string);
cursor = No_Cursor;
@@ -27960,7 +27996,6 @@ syms_of_xdisp (void)
DEFSYM (Qhollow, "hollow");
DEFSYM (Qhand, "hand");
DEFSYM (Qarrow, "arrow");
- DEFSYM (Qtext, "text");
DEFSYM (Qinhibit_free_realized_faces, "inhibit-free-realized-faces");
list_of_error = Fcons (Fcons (intern_c_string ("error"),
@@ -28429,7 +28464,7 @@ To add a prefix to continuation lines, use `wrap-prefix'. */);
DEFVAR_INT ("overline-margin", overline_margin,
doc: /* *Space between overline and text, in pixels.
The default value is 2: the height of the overline (1 pixel) plus 1 pixel
-margin to the caracter height. */);
+margin to the character height. */);
overline_margin = 2;
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/>. */
1. Font family name.
- 2. Font foundary name.
+ 2. Font foundry name.
3. Relative proportionate width, aka character set width or set
width (swidth), e.g. `semi-compressed'.
@@ -4193,12 +4193,12 @@ prepare_face_for_display (struct frame *f, struct face *face)
static int
color_distance (XColor *x, XColor *y)
{
- /* This formula is from a paper title `Colour metric' by Thiadmer Riemersma.
+ /* This formula is from a paper titled `Colour metric' by Thiadmer Riemersma.
Quoting from that paper:
This formula has results that are very close to L*u*v* (with the
modified lightness curve) and, more importantly, it is a more even
- algorithm: it does not have a range of colours where it suddenly
+ algorithm: it does not have a range of colors where it suddenly
gives far from optimal results.
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)
/* Handler for signals raised during x_create_frame and
- x_create_top_frame. FRAME is the frame which is partially
+ x_create_tip_frame. FRAME is the frame which is partially
constructed. */
static Lisp_Object
@@ -2929,13 +2929,14 @@ unwind_create_frame (Lisp_Object frame)
return Qnil;
/* If frame is ``official'', nothing to do. */
- if (!CONSP (Vframe_list) || !EQ (XCAR (Vframe_list), frame))
+ if (NILP (Fmemq (frame, Vframe_list)))
{
#if GLYPH_DEBUG && XASSERTS
struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
#endif
x_free_frame_resources (f);
+ free_glyphs (f);
#if GLYPH_DEBUG
/* Check that reference counts are indeed correct. */
@@ -3137,7 +3138,6 @@ This function is an internal primitive--use `make-frame' instead. */)
FRAME_CAN_HAVE_SCROLL_BARS (f) = 1;
f->terminal = dpyinfo->terminal;
- f->terminal->reference_count++;
f->output_method = output_x_window;
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. */)
"scrollBarBackground",
"ScrollBarBackground", 0);
+#if GLYPH_DEBUG
+ image_cache_refcount =
+ FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0;
+ dpyinfo_refcount = dpyinfo->reference_count;
+#endif /* GLYPH_DEBUG */
+
/* Init faces before x_default_parameter is called for scroll-bar
parameters because that function calls x_set_scroll_bar_width,
which calls change_frame_size, which calls Fset_window_buffer,
@@ -3315,11 +3321,6 @@ This function is an internal primitive--use `make-frame' instead. */)
happen. */
init_frame_faces (f);
-#if GLYPH_DEBUG
- image_cache_refcount = FRAME_IMAGE_CACHE (f)->refcount;
- dpyinfo_refcount = dpyinfo->reference_count;
-#endif /* GLYPH_DEBUG */
-
/* The X resources controlling the menu-bar and tool-bar are
processed specially at startup, and reflected in the mode
variables; ignore them here. */
@@ -3363,6 +3364,7 @@ This function is an internal primitive--use `make-frame' instead. */)
x_make_gc (f);
/* Now consider the frame official. */
+ f->terminal->reference_count++;
FRAME_X_DISPLAY_INFO (f)->reference_count++;
Vframe_list = Fcons (frame, Vframe_list);
@@ -3689,7 +3691,7 @@ If omitted or nil, that stands for the selected frame's display. */)
DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0,
doc: /* Return the "vendor ID" string of the X server of display TERMINAL.
-\(Labelling every distributor as a "vendor" embodies the false assumption
+\(Labeling every distributor as a "vendor" embodies the false assumption
that operating systems cannot be developed and distributed noncommercially.)
The optional argument TERMINAL specifies which display to ask about.
TERMINAL 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,
record_unwind_protect (unwind_create_tip_frame, frame);
f->terminal = dpyinfo->terminal;
- f->terminal->reference_count++;
/* By setting the output method, we're essentially saying that
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,
x_default_parameter (f, parms, Qborder_color, build_string ("black"),
"borderColor", "BorderColor", RES_TYPE_STRING);
+#if GLYPH_DEBUG
+ image_cache_refcount =
+ FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0;
+ dpyinfo_refcount = dpyinfo->reference_count;
+#endif /* GLYPH_DEBUG */
+
/* Init faces before x_default_parameter is called for scroll-bar
parameters because that function calls x_set_scroll_bar_width,
which calls change_frame_size, which calls Fset_window_buffer,
@@ -4723,11 +4730,6 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
happen. */
init_frame_faces (f);
-#if GLYPH_DEBUG
- image_cache_refcount = FRAME_IMAGE_CACHE (f)->refcount;
- dpyinfo_refcount = dpyinfo->reference_count;
-#endif /* GLYPH_DEBUG */
-
f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window;
x_figure_window_size (f, parms, 0);
@@ -4833,14 +4835,16 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
UNGCPRO;
+ /* Now that the frame will be official, it counts as a reference to
+ its display and terminal. */
+ FRAME_X_DISPLAY_INFO (f)->reference_count++;
+ f->terminal->reference_count++;
+
/* It is now ok to make the frame official even if we get an error
below. And the frame needs to be on Vframe_list or making it
visible won't work. */
Vframe_list = Fcons (frame, Vframe_list);
- /* Now that the frame is official, it counts as a reference to
- its display. */
- FRAME_X_DISPLAY_INFO (f)->reference_count++;
/* Setting attributes of faces of the tooltip frame from resources
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,
return 0;
}
-/* A hash table recoding which font supports which scritps. Each key
- is a vector of characteristic font propertis FOUNDRY to WIDTH and
+/* A hash table recoding which font supports which scripts. Each key
+ is a vector of characteristic font properties FOUNDRY to WIDTH and
ADDSTYLE, and each value is a list of script symbols.
We assume that fonts that have the same value in the above
@@ -281,7 +281,7 @@ xfont_chars_supported (Lisp_Object chars, XFontStruct *xfont,
static Lisp_Object xfont_scripts_cache;
-/* Re-usable vector to store characteristic font properites. */
+/* Re-usable vector to store characteristic font properties. */
static Lisp_Object xfont_scratch_props;
/* 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,
#endif /* not USE_GTK */
+static Lisp_Object
+cleanup_widget_value_tree (Lisp_Object arg)
+{
+ struct Lisp_Save_Value *p = XSAVE_VALUE (arg);
+ widget_value *wv = p->pointer;
+
+ free_menubar_widget_value_tree (wv);
+
+ return Qnil;
+}
+
Lisp_Object
xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
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,
int first_pane;
+ ptrdiff_t specpdl_count = SPECPDL_INDEX ();
+
if (! FRAME_X_P (f))
abort ();
@@ -1812,11 +1825,15 @@ xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
/* No selection has been chosen yet. */
menu_item_selection = 0;
+ /* Make sure to free the widget_value objects we used to specify the
+ contents even with longjmp. */
+ record_unwind_protect (cleanup_widget_value_tree,
+ make_save_value (first_wv, 0));
+
/* Actually create and show the menu until popped down. */
create_and_show_popup_menu (f, first_wv, x, y, for_click, timestamp);
- /* Free the widget_value objects we used to specify the contents. */
- free_menubar_widget_value_tree (first_wv);
+ unbind_to (specpdl_count, Qnil);
/* Find the selected item, and its pane, to return
the proper value. */
@@ -2003,6 +2020,8 @@ xdialog_show (FRAME_PTR f,
/* 1 means we've seen the boundary between left-hand elts and right-hand. */
int boundary_seen = 0;
+ ptrdiff_t specpdl_count = SPECPDL_INDEX ();
+
if (! FRAME_X_P (f))
abort ();
@@ -2116,11 +2135,15 @@ xdialog_show (FRAME_PTR f,
/* No selection has been chosen yet. */
menu_item_selection = 0;
+ /* Make sure to free the widget_value objects we used to specify the
+ contents even with longjmp. */
+ record_unwind_protect (cleanup_widget_value_tree,
+ make_save_value (first_wv, 0));
+
/* Actually create and show the dialog. */
create_and_show_dialog (f, first_wv);
- /* Free the widget_value objects we used to specify the contents. */
- free_menubar_widget_value_tree (first_wv);
+ unbind_to (specpdl_count, Qnil);
/* Find the selected item, and its pane, to return
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)
F is the frame to be used to look up X atoms if the TYPE is XA_ATOM.
DATA is a C array of values to be converted.
TYPE is the type of the data. Only XA_ATOM is special, it converts
- each number in DATA to its corresponfing X atom as a symbol.
+ each number in DATA to its corresponding X atom as a symbol.
FORMAT is 8, 16 or 32 and gives the size in bits for each C value to
be stored in RET.
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)
}
#endif /* HAVE_XFT */
-/* Map TOOL_BAR_STYLE from a string to its correspinding Lisp value.
+/* Map TOOL_BAR_STYLE from a string to its corresponding Lisp value.
Return Qnil if TOOL_BAR_STYLE is not known. */
static 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)
Vx_session_id = build_string (client_id);
#ifdef USE_GTK
- /* GTK creats a leader window by itself, but we need to tell
+ /* GTK creates a leader window by itself, but we need to tell
it about our client_id. */
gdk_x11_set_sm_client_id (client_id);
#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,
{
/* Gnome shell does not iconify us when C-z is pressed. It hides
the frame. So if our state says we aren't hidden anymore,
- treat is as deiconfied. */
+ treat it as deiconified. */
if (! f->async_iconified)
SET_FRAME_GARBAGED (f);
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
ptrdiff_t x_dnd_atoms_length;
/* Extended window manager hints, Atoms supported by the window manager and
- atoms for settig the window type. */
+ atoms for setting the window type. */
Atom Xatom_net_supported, Xatom_net_supporting_wm_check;
Atom *net_supported_atoms;
int nr_net_supported_atoms;