diff options
Diffstat (limited to 'src')
99 files changed, 1529 insertions, 778 deletions
diff --git a/src/.gdbinit b/src/.gdbinit index 80415abe40d..2051475bea0 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -311,9 +311,8 @@ define prowx printf "y=%d x=%d pwid=%d", $row->y, $row->x, $row->pixel_width printf " a+d=%d+%d=%d", $row->ascent, $row->height-$row->ascent, $row->height printf " phys=%d+%d=%d", $row->phys_ascent, $row->phys_height-$row->phys_ascent, $row->phys_height - printf " vis=%d", $row->visible_height - printf " L=%d T=%d R=%d", $row->used[0], $row->used[1], $row->used[2] - printf "\n" + printf " vis=%d\n", $row->visible_height + printf "used=(LMargin=%d,Text=%d,RMargin=%d) Hash=%d\n", $row->used[0], $row->used[1], $row->used[2], $row->hash printf "start=%d end=%d", $row->start.pos.charpos, $row->end.pos.charpos if ($row->enabled_p) printf " ENA" diff --git a/src/ChangeLog b/src/ChangeLog index 4cec277fb36..f525535e4d8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,4 +1,4 @@ -2011-11-18 Paul Eggert <eggert@cs.ucla.edu> +2011-12-11 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): @@ -150,6 +150,7 @@ Fix a FIXME, by checking for integer overflow when calculating target_clm and actual_clm. * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR) + (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P) (ASSURE_DESTINATION, coding_alloc_by_realloc) (coding_alloc_by_making_gap, alloc_destination) (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16) @@ -169,7 +170,8 @@ (decode_coding_object, encode_coding_object, detect_coding_system) (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region) (code_convert_region, code_convert_string) - (Fdefine_coding_system_internal): + (Fdefine_coding_system_internal) + (coding_set_source, coding_set_destination): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough. (setup_iso_safe_charsets, consume_chars, Funencodable_char_position) (Fdefine_coding_system_internal): @@ -786,11 +788,369 @@ rather than rolling our own approximation. (SCROLL_BAR_VEC_SIZE): Remove; not used. -2011-11-18 Paul Eggert <eggert@cs.ucla.edu> +2011-12-10 Jan Djärv <jan.h.d@swipnet.se> - 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. + * xterm.c (x_term_init): Move call to gdk_window_add_filter before + gtk_init (Bug#10100). + +2011-12-10 Eli Zaretskii <eliz@gnu.org> + + * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if + IT->string is nil. (Bug#10263) + +2011-12-10 Jan Djärv <jan.h.d@swipnet.se> + + * nsterm.h (x_free_frame_resources): Declare. + + * nsfns.m (ns_get_defaults_value): New function (Bug#10103). + (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value. + + * nsterm.h (ns_get_defaults_value): Declare. + + * nsterm.m (ns_default): Call ns_get_defaults_value. + +2011-12-09 Eli Zaretskii <eliz@gnu.org> + + * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero. + (Bug#10170) + +2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case + that where the value of an _OBJC_* symbol points to is in the .bss + section (Bug#10240). + +2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change) + + * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end) + after the loop to call ccl_driver at least once (Bug#8619). + +2011-12-08 Kenichi Handa <handa@m17n.org> + + * ftfont.c (get_adstyle_property): Fix previous change + (Bug#10233). + +2011-12-07 Juanma Barranquero <lekktu@gmail.com> + + * w32.c (init_environment): If no_site_lisp, remove site-lisp + dirs from the default value of EMACSLOADPATH (bug#10208). + +2011-12-07 Glenn Morris <rgm@gnu.org> + + * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in + installation and source directories as well. (Bug#10208) + +2011-12-06 Chong Yidong <cyd@gnu.org> + + * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228). + +2011-12-06 Glenn Morris <rgm@gnu.org> + + * process.c (start_process_unwind): Treat any pid <= 0, except -2, + as an error, not just -1. (Bug#10217) + +2011-12-05 Chong Yidong <cyd@gnu.org> + + * keyboard.c (process_special_events): New function. + (swallow_events, Finput_pending_p): Use it (Bug#10195). + +2011-12-05 Paul Eggert <eggert@cs.ucla.edu> + + * coding.c (encode_designation_at_bol): Don't use uninitialized + local variable (Bug#9318). + +2011-12-05 Kenichi Handa <handa@m17n.org> + + * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF, + return Qnil (Bug#8046, Bug#10193). + +2011-12-05 Kenichi Handa <handa@m17n.org> + + * coding.c (encode_designation_at_bol): New args charbuf_end and + dst. Return the number of produced bytes. Callers changed. + (coding_set_source): Return how many bytes coding->source was + relocated. + (coding_set_destination): Return how many bytes + coding->destination was relocated. + (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET) + (CODING_CHAR_CHARSET_P): Adjusted for the avove changes. + +2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change) + + * coding.c (CODING_CHAR_CHARSET_P): New macro. + (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above + macro (Bug#9318). + +2011-12-05 Andreas Schwab <schwab@linux-m68k.org> + + The following changes are to fix Bug#9318. + + * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros. + (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER) + (encode_coding_iso_2022, encode_coding_sjis) + (encode_coding_big5, encode_coding_charset): Use the above macros. + +2011-12-05 Juanma Barranquero <lekktu@gmail.com> + + * lisp.h (process_quit_flag): Fix external declaration. + +2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca> + + Don't macro-inline non-performance-critical code. + * eval.c (process_quit_flag): New function. + * lisp.h (QUIT): Use it. + +2011-12-04 Jan Djärv <jan.h.d@swipnet.se> + + * nsfns.m (get_geometry_from_preferences): New function. + (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103). + +2011-12-04 Andreas Schwab <schwab@linux-m68k.org> + + * emacs.c (Qkill_emacs): Define. + (syms_of_emacs): Initialize it. + * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set + Qquit_flag to `kill-emacs' instead. + (quit_throw_to_read_char): Add parameter `from_signal'. + All callers changed. Call Fkill_emacs if requested and safe. + * lisp.h (QUIT): Call Fkill_emacs if requested. + +2011-12-03 Jan Djärv <jan.h.d@swipnet.se> + + * widget.c (update_wm_hints): Return if wmshell is null. + (widget_update_wm_size_hints): New function. + + * widget.h (widget_update_wm_size_hints): Declare. + + * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call + widget_update_wm_size_hints (Bug#10104). + +2011-12-03 Eli Zaretskii <eliz@gnu.org> + + * xdisp.c (handle_invisible_prop): If the invisible text ends just + before a newline, prepare the bidi iterator for consuming the + newline, and keep the current paragraph direction. (Bug#10183) + (redisplay_window): Don't let `margin' become negative. (Bug#10192) + +2011-12-02 Juri Linkov <juri@jurta.org> + + * search.c (Fword_search_regexp): New Lisp function created from + `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'. + (Fword_search_backward, Fword_search_forward) + (Fword_search_backward_lax, Fword_search_forward_lax): + Use `Fword_search_regexp' instead of `wordify'. Doc fix. + (syms_of_search): Define `Sword_search_regexp'. (Bug#10145) + +2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca> + + * fileio.c (Finsert_file_contents): Move after-change-function call + to before the "handled:" label, since all "goto handled" appear in + cases where the *-change-functions have already been properly called + (bug#10117). + +2011-12-01 Andreas Schwab <schwab@linux-m68k.org> + + * keyboard.c (interrupt_signal): Don't call kill-emacs when + waiting for input. (Bug#10169) + +2011-11-30 Eli Zaretskii <eliz@gnu.org> + + * dispnew.c (adjust_glyph_matrix): Remove the assertion that + verifies glyph row's hash code--we have just reallocated the + glyphs, so their contents can be complete garbage. (Bug#10164) + +2011-11-30 Juanma Barranquero <lekktu@gmail.com> + + * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check. + +2011-11-30 Eli Zaretskii <eliz@gnu.org> + + * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's + attributes are tested _before_ calling verify_row_hash, to protect + against GCC re-ordering of the tests. (Bug#10164) + +2011-11-29 Jan Djärv <jan.h.d@swipnet.se> + + * xterm.h (struct x_output): net_wm_state_hidden_seen is new. + + * xterm.c (handle_one_xevent): Only set async_visible and friends + if net_wm_state_hidden_seen is non-zero (Bug#10002) + (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if + _NET_WM_STATE_HIDDEN is in NET_WM_STATE. + +2011-11-28 Paul Eggert <eggert@cs.ucla.edu> + + Remove GCPRO-related macros that exist only to avoid shadowing locals. + * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR) + (GCPRO6_VAR, UNGCPRO_VAR): Remove. See + <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>. + All uses changed to use GCPRO1 etc. + (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO): + Revert to old implementation (i.e., before 2011-03-11). + +2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * dispnew.c (scrolling_window): Truncate overlaps in copy destination + of scroll runs so as to avoid assigning disabled bogus rows and + unnecessary graphics copy operations. + +2011-11-27 Eli Zaretskii <eliz@gnu.org> + + * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define. + (snprintf) [_MSC_VER]: Redirect to _snprintf. + (strtoll) [_MSC_VER]: Redirect to _strtoi64. + (malloc, free, realloc, calloc): Redirect to e_* only when + compiling Emacs. + + * lisp.h (GCTYPEBITS): Move before first use. + (ALIGN_GCTYPEBITS) [_MSC_VER]: Define. + (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in + this macro definition. + + * s/ms-w32.h (tzname): Redirect to _tzname for all values of + _MSC_VER. + +2011-11-27 Jan Djärv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_create_frame_widgets): + Call gtk_window_set_has_resize_grip (FALSE) if that function is + present with Gtk+ 2.0. + +2011-11-26 Paul Eggert <eggert@cs.ucla.edu> + + * fileio.c (Finsert_file_contents): Undo previous change; see + <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>. + +2011-11-26 Paul Eggert <eggert@cs.ucla.edu> + + Rename locals to avoid shadowing. + * fileio.c (Finsert_file_contents): + Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing. + * process.c (wait_reading_process_output): + Rename inner 'proc' to 'p' to avoid shadowing. + Indent for consistency with usual Emacs style. + +2011-11-25 Eli Zaretskii <eliz@gnu.org> + + * xdisp.c (redisplay_window): If cursor row is not fully visible + after recentering, and scroll-conservatively is set to a large + number, scroll window by a few more lines to make the cursor fully + visible and out of scroll-margin. (Bug#10105) + (start_display): Don't move to the next line if the display should + start at a newline that is part of a display vector or an overlay + string. (Bug#10119) + +2011-11-24 Juri Linkov <juri@jurta.org> + + * image.c (imagemagick_load_image): Move `MagickSetResolution' down + after the `MagickPingImage' call. (Bug#10112) + +2011-11-23 Chong Yidong <cyd@gnu.org> + + * window.c (Fcoordinates_in_window_p): Accept only live windows. + +2011-11-23 Martin Rudalics <rudalics@gmx.at> + + * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before + making another buffer current. (Bug#10114) + +2011-11-23 Glenn Morris <rgm@gnu.org> + + * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526) + +2011-11-23 Chong Yidong <cyd@gnu.org> + + * xdisp.c (compute_stop_pos): Check validity of end_charpos before + using it (Bug#5984). + +2011-11-22 Eli Zaretskii <eliz@gnu.org> + + * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode- + and header-lines, as they don't have one computed for them. + (Bug#10098) + + * .gdbinit (prow): Make displayed values more self-explaining. + Add row's hash code. + +2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org> + + * process.c (wait_reading_process_output): Fix asynchrounous + GnuTLS socket handling on some versions of the GnuTLS library. + (wait_reading_process_output): Add comment and URL. + +2011-11-21 Jan Djärv <jan.h.d@swipnet.se> + + * xterm.c (x_clear_frame): Reinstate the XClearWindow call. + +2011-11-21 Chong Yidong <cyd@gnu.org> + + * window.c (Fnext_window, Fprevious_window): Doc fix. + +2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca> + + * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup. + +2011-11-20 Juanma Barranquero <lekktu@gmail.com> + + * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo. + +2011-11-20 Martin Rudalics <rudalics@gmx.at> + + * window.c (Fset_window_combination_limit): Rename argument + STATUS to LIMIT. + (Vwindow_combination_limit): Remove "status" from doc-string. + +2011-11-20 Andreas Schwab <schwab@linux-m68k.org> + + * m/ibms390.h: Remove. + * m/ibms390x.h: Don't include "ibms390.h". + +2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca> + + * fileio.c (Finsert_file_contents): Add missing gcpro1 variable. + Suggested by Dmitry Antipov <dmantipov@yandex.ru>. + +2011-11-20 Juanma Barranquero <lekktu@gmail.com> + + * casetab.c (Fset_case_table): + * charset.c (Fcharset_after): Fix typos. + +2011-11-20 Paul Eggert <eggert@cs.ucla.edu> + + Standardize on VIRT_ADDR_VARIES behavior (Bug#10042). + Otherwise, valgrind does not work on some platforms. + Problem reported by Andreas Schwab in + <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>. + * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES + is set, removing the need for VIRT_ADDRESS_VARIES. + (PURE_P): Use a more-efficient implementation that needs just one + comparison, not two: on x86-64 with GCC 4.6.2, this cut down the + number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge) + to 4 (xorl, subq, cmpq, setbe). + * alloc.c (pure): Always extern now, since that's the + VIRT_ADDR_VARIES behavior. + (PURE_POINTER_P): Use a single comparison, not two, for + consistency with the new puresize.h. + * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed. + * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h: + Remove VIRT_ADDR_VARIES no longer needed. + +2011-11-19 Eli Zaretskii <eliz@gnu.org> + + * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph) + (erase_phys_cursor, update_window_cursor, show_mouse_face) + (cursor_in_mouse_face_p): If the cursor position is out of bounds, + behave as if the cursor position were at the window margin. + + * window.c (get_phys_cursor_glyph): If the window is hscrolled, + and the cursor position is out of bounds, behave as if the cursor + position were at the window margin. (Bug#10075) + +2011-11-18 Chong Yidong <cyd@gnu.org> + + * window.c (Fwindow_combination_limit): Make first argument + non-optional, since it is meaningless for live windows like the + selected window. 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru> @@ -860,8 +1220,8 @@ * 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) + 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> @@ -945,8 +1305,8 @@ 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_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. @@ -1078,8 +1438,8 @@ (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 + (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). @@ -1149,8 +1509,8 @@ * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment. Don't stop backward scan on the continuation glyph, even though its CHARPOS is positive. - (mouse_face_from_buffer_pos, note_mouse_highlight): Rename - cover_string to disp_string. + (mouse_face_from_buffer_pos, note_mouse_highlight): + Rename cover_string to disp_string. 2011-11-01 Martin Rudalics <rudalics@gmx.at> @@ -7789,7 +8149,7 @@ 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change) - * xml.c (parse_region): Avoid creating spurious whiespace nodes. + * xml.c (parse_region): Avoid creating spurious whitespace nodes. 2011-04-08 Chong Yidong <cyd@stupidchicken.com> @@ -8405,7 +8765,7 @@ * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1): Use Frun_hooks. (command_loop_1): Use Frun_hooks. Call safe_run_hooks - unconditionnaly since it does the check itself. + unconditionally since it does the check itself. 2011-03-23 Paul Eggert <eggert@cs.ucla.edu> @@ -9289,7 +9649,7 @@ (xg_set_widget_bg): New function. (delete_cb): New function. (xg_create_frame_widgets): Connect delete-event to delete_cb. - Call xg_set_widget_bg. Only set backgrund pixmap for ! HAVE_GTK3 + Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3 (xg_set_background_color): Call xg_set_widget_bg. (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask. (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3. diff --git a/src/ChangeLog.1 b/src/ChangeLog.1 index efe77648458..7fef45f36da 100644 --- a/src/ChangeLog.1 +++ b/src/ChangeLog.1 @@ -2237,7 +2237,7 @@ * data.c (Fset): If Vautoload_queue non-nil, record function and old definition - by consing onto Vautoload_qeueue. + by consing onto Vautoload_queue. * fns.c (Fprovide): If Vautoload_queue is non-nil, record old value of Vfeatures. diff --git a/src/ChangeLog.10 b/src/ChangeLog.10 index 181b11b5a2b..e759183724e 100644 --- a/src/ChangeLog.10 +++ b/src/ChangeLog.10 @@ -516,7 +516,7 @@ * w32fns.c (current_popup_menu): Use from w32menu.c. (w32_wnd_proc) <WM_EXITMENULOOP, WM_TIMER>: Use menubar_active and current_popup_menu to determine whether a menubar menu has - been cancelled. + been canceled. * w32term.h (w32_output): Remove menu_command_in_progress. @@ -1003,7 +1003,7 @@ (syms_of_xdisp): DEFVAR_LISP and initialize it. Update doc string to describe new value `grow-only', and use of C-l. (display_tool_bar_line): Only use default face for border below - toolbar if not grow-only (to get acceptable visual appearence). + toolbar if not grow-only (to get acceptable visual appearance). Explicitly set visible_height for empty toolbar lines. (redisplay_tool_bar): Handle `grow-only' setting. Check and clear minimize_tool_bar_window_p flag. @@ -4346,7 +4346,7 @@ * textprop.c (Fremove_list_of_text_properties): Ensure modify_region is called only when buffer is modified and that - signal_after_change is allways called in that case. + signal_after_change is always called in that case. * print.c (PRINTFINISH): Call signal_after_change. @@ -5084,7 +5084,7 @@ 2006-02-26 Chong Yidong <cyd@stupidchicken.com> - * xterm.h, xterm.c (x_uncatch_errors): Delete unneccessary argument. + * xterm.h, xterm.c (x_uncatch_errors): Delete unnecessary argument. * xterm.c (x_load_font, x_term_init, XTmouse_position) (handle_one_xevent, x_connection_closed, x_list_fonts): @@ -6387,7 +6387,7 @@ 2005-11-20 Nick Roberts <nickrob@snap.net.nz> * lisp.h: Use typedef when Lisp_Object is EMACS_INT so that - this type is recognised when debugging. + this type is recognized when debugging. 2005-11-19 Andreas Schwab <schwab@suse.de> @@ -12087,7 +12087,7 @@ (merge_face_heights): Eliminate GCPRO arg. All callers changed. * keyboard.c (command_loop_1): Change Vtransient_mark_mode - before deciding whether to inactivate mark. + before deciding whether to deactivate mark. 2004-11-06 Lars Brinkhoff <lars@nocrew.org> @@ -13398,7 +13398,7 @@ 2004-07-04 John Paul Wallington <jpw@gnu.org> * fileio.c (read_file_name_completion_ignore_case): New variable. - (syms_of_fileio): Declare and initialise it. + (syms_of_fileio): Declare and initialize it. (Fread_file_name): Bind `completion-ignore-case' to respect it. 2004-07-03 Eli Zaretskii <eliz@gnu.org> @@ -18755,7 +18755,7 @@ 2003-05-21 Dave Love <fx@gnu.org> - [Merged from unicode branch.] + [Merged from Unicode branch.] * xfns.c (x_window, x_window): Use use_xim. @@ -23013,7 +23013,7 @@ (try_window_id): Likewise. (redisplay_window): New local var buffer_unchanged_p. - * keyboard.c (cmd_error) [HAVE_X_WINDOWS]: Maybe call cancel_houglass. + * keyboard.c (cmd_error) [HAVE_X_WINDOWS]: Maybe call cancel_hourglass. * process.c (create_process): Test USG_SUBTTY_WORKS. (process_send_signal): Clean up handling of GID. diff --git a/src/ChangeLog.11 b/src/ChangeLog.11 index 73ac5fd4e00..f9fd442da3f 100644 --- a/src/ChangeLog.11 +++ b/src/ChangeLog.11 @@ -966,7 +966,7 @@ ($(BLD)/editfns.$(O)): Depend on ../lib/strftime.h. ($(BLD)/print.$(O)): Depend on ../lib/ftoastr.h and ../lib/intprops.h. - * deps.mk: Update for recent changes: gnutls support, gnulib + * deps.mk: Update for recent changes: GnuTLS support, gnulib imports, addition of globals.h. * makefile.w32-in ($(BLD)/sysdep.$(O)): Depend on @@ -2191,7 +2191,7 @@ 2010-12-16 Jan Djärv <jan.h.d@swipnet.se> * nsterm.m (ns_draw_window_cursor): If the cursor color is the - same as the background, use the face forground as cursor. + same as the background, use the face foreground as cursor. 2010-12-13 Eli Zaretskii <eliz@gnu.org> @@ -3268,7 +3268,7 @@ 2010-10-10 Lars Magne Ingebrigtsen <larsi@gnus.org> * gnutls.c (emacs_gnutls_write): If we're trying to write before - gnutls is ready, return EAGAIN as the errno. + GnuTLS is ready, return EAGAIN as the errno. 2010-10-10 Dan Nicolaescu <dann@ics.uci.edu> @@ -3585,12 +3585,12 @@ * process.c (make_process): Set the gnutls_p field to zero by default. (read_process_output): Always call the gnutls_read function if the - stream is a gnutls stream. + stream is a GnuTLS stream. (send_process): Ditto for writes. * gnutls.c (emacs_gnutls_write, emacs_gnutls_read): Refuse to read or write anything until the state is GNUTLS_STAGE_READY. - (Fgnutls_boot): Mark the stream as being a gnutls stream. + (Fgnutls_boot): Mark the stream as being a GnuTLS stream. 2010-09-29 Eli Zaretskii <eliz@gnu.org> @@ -4839,7 +4839,7 @@ 2010-08-13 Jason Rumney <jasonr@gnu.org> - * w32menu.c (simple_dialog_show): Use unicode message box if available. + * w32menu.c (simple_dialog_show): Use Unicode message box if available. (MessageBoxW_Proc): New function typedef. (unicode-message-box): New function pointer. (globals_of_w32menu): Import it from user32.dll. (Bug#5629) @@ -5896,7 +5896,7 @@ * eval.c (Feval, Ffuncall): Use the new names. * lisp.h (struct Lisp_Subr): Rename `am' to aMANY and add aUNEVALLED. - (DEFUN): Add braces around the union initialisation and use ## to + (DEFUN): Add braces around the union initialization and use ## to specify the right union alternative and avoid a cast. 2010-07-18 Juanma Barranquero <lekktu@gmail.com> @@ -6604,9 +6604,9 @@ * keyboard.c (input_available_signal): Declare. (kbd_buffer_nr_stored): New function. (kbd_buffer_store_event_hold): If kbd_buffer_nr_stored returns - more than KBD_BUFFER_SIZE/2, stop reding input (Bug#6571). + more than KBD_BUFFER_SIZE/2, stop reading input (Bug#6571). (kbd_buffer_get_event): If input is suspended and kbd_buffer_nr_stored - returns less than KBD_BUFFER_SIZE/4, resume reding input (Bug#6571). + returns less than KBD_BUFFER_SIZE/4, resume reading input (Bug#6571). (tty_read_avail_input): If input is on hold, return. Don't read more that free slots in kbd_buffer (Bug#6571). @@ -7199,7 +7199,7 @@ 2010-06-27 Chong Yidong <cyd@stupidchicken.com> - * xfns.c (Fx_create_frame): Don't consult X resouces when setting + * xfns.c (Fx_create_frame): Don't consult X resources when setting menu-bar-lines and tool-bar-lines. Use menu-bar-mode and tool-bar-mode, which are now set using these X resources at startup, to determine the defaults (Bug#2249). @@ -7683,7 +7683,7 @@ 2010-05-20 Juri Linkov <juri@jurta.org> - * fileio.c (Fdelete_file): Change interative spec to use + * fileio.c (Fdelete_file): Change interactive spec to use `read-file-name' like in `find-file-read-args' where the default value is `default-directory' instead of `buffer-file-name'. http://lists.gnu.org/archive/html/emacs-devel/2010-05/msg00533.html @@ -8991,8 +8991,8 @@ 2010-04-13 Jan Djärv <jan.h.d@swipnet.se> * gtkutil.c (xg_set_geometry): Set geometry for PPosition also. - (x_wm_set_size_hint): Dont set position flags, gtk_window_parse_geometry - does that. + (x_wm_set_size_hint): Don't set position flags, + gtk_window_parse_geometry does that. * xfns.c (Fx_create_frame, x_create_tip_frame): Set default border width to zero. @@ -9266,7 +9266,7 @@ Get rid of the direct_output optimizations. * keyboard.c (nonundocount): Remove extern declaration. - (command_loop_1): Remove brittle optimisation for cheap and + (command_loop_1): Remove brittle optimization for cheap and common operations. * xdisp.c (redisplay_internal): Don't bother checking redisplay_performed_directly_p any more. @@ -9864,8 +9864,8 @@ 2010-01-27 Jason Rumney <jasonr@gnu.org> - * w32inevt.c (w32_kbd_patch_key): Save the unicode character. - (key_event): Use unicode for characters 128 and higher (Bug#4567). + * w32inevt.c (w32_kbd_patch_key): Save the Unicode character. + (key_event): Use Unicode for characters 128 and higher (Bug#4567). 2010-01-27 Kenichi Handa <handa@m17n.org> @@ -11541,7 +11541,7 @@ (syms_of_nsfont): Declare it. (ns_registry_to_script): New function. (ns_get_req_script): Call it. - (ns_findfonts): Don't give up on non-unicode registry. + (ns_findfonts): Don't give up on non-Unicode registry. * font.c (DEFAULT_ENCODING) [HAVE_NS]: Remove special case. @@ -11805,7 +11805,7 @@ * coding.c (encode_coding_utf_16): Fix checking of a Unicode character. - * cmds.c (Fself_insert_command): Avoid unnecessay + * cmds.c (Fself_insert_command): Avoid unnecessary unibyte->multibyte conversion. (Bug#4240) (Bug#4037) 2009-08-26 Dan Nicolaescu <dann@ics.uci.edu> @@ -11923,7 +11923,7 @@ * process.c (status_notify): Don't perform redisplay. (Fdelete_process, list_processes_1, process_send_signal): - Expliticly perform redisplay. + Explicitly perform redisplay. (wait_reading_process_output): Always check process status, but don't perform redisplay unless DO_DISPLAY is non-zero (Bug#2930). @@ -12481,7 +12481,7 @@ * dbusbind.c (XD_SYMBOL_TO_DBUS_TYPE): Convert macro into function xd_symbol_to_dbus_type. With Solaris 2.11, it was said to compile - for hours, when optimzation is enabled. + for hours, when optimization is enabled. (xd_signature, xd_append_arg, xd_retrieve_arg, xd_initialize) (xd_read_message): Make them static. @@ -13149,7 +13149,7 @@ (ftfont_has_char): Special handling of `ja' and `ko' adstyle. * font.c (font_sort_entites): Change the meaning of the arg - BEST-ONLY. Don't optimize for VEC of lenght 1. + BEST-ONLY. Don't optimize for VEC of length 1. (font_select_entity): Just return the value of font_sort_entites. * xfaces.c (merge_face_vectors): Reflect font properties in @@ -16072,7 +16072,7 @@ 2008-09-07 Andreas Schwab <schwab@suse.de> * callproc.c (Fcall_process): Don't hold references to string data - across garbage collection. Move initialisation of new_argv down + across garbage collection. Move initialization of new_argv down to avoid compiler bug. 2008-09-07 Roland Winkler <Roland.Winkler@physik.uni-erlangen.de> @@ -17147,10 +17147,10 @@ 2008-07-30 Jason Rumney <jasonr@gnu.org> - * w32font.h (struct w32font_info): Use unicode version of textmetrics. + * w32font.h (struct w32font_info): Use Unicode version of textmetrics. - * w32font.c (w32font_encode_char): Leave as unicode if in range. - (w32font_open_internal): Get unicode version of textmetrics. + * w32font.c (w32font_encode_char): Leave as Unicode if in range. + (w32font_open_internal): Get Unicode version of textmetrics. Don't enable or disable glyph indices here. (w32font_open): Disable use of glyph indices. @@ -19178,7 +19178,7 @@ 2008-06-10 Jason Rumney <jasonr@gnu.org> * w32uniscribe.c (add_opentype_font_name_to_list): - Skip non unicode fonts. + Skip non Unicode fonts. 2008-06-10 Chong Yidong <cyd@stupidchicken.com> @@ -19248,7 +19248,7 @@ * w32menu.c (Fx_popup_menu): Unwind protect while building menu. (parse_single_submenu): Remove. (digest_single_submenu): Remove. - (syms_of_w32menu): Don't initialise variables that have moved + (syms_of_w32menu): Don't initialize variables that have moved to menu.c. (set_frame_menubar): Sync with version in xmenu.c. (w32_menu_show): Sync with xmenu_show in xmenu.c. @@ -19647,7 +19647,7 @@ `raster' specified. (add_font_entity_to_list): Allow non-opentype truetype fonts back in the uniscribe backend, but disallow any font that has no - unicode subrange support. + Unicode subrange support. 2008-05-29 Juanma Barranquero <lekktu@gmail.com> @@ -21290,7 +21290,7 @@ (CACHE_BLOCKSIZE): New constants. * w32font.c (Qja, Qko, Qzh): New symbols. - (syms_of_w32font): Initialise them. + (syms_of_w32font): Initialize them. (font_matches_spec): Use them to filter by language. (recompute_cached_metrics): Remove function. (compute_metrics, clear_cached_metrics): New functions. @@ -21813,8 +21813,8 @@ 2008-03-06 Jason Rumney <jasonr@gnu.org> * w32font.c (w32_registry): Take font_type argument. Use ANSI - when charset not specified. Only translate ANSI to unicode when - font_type is truetype. + when charset not specified. Only translate ANSI to Unicode when + font_type is TrueType. (w32font_coverage_ok): New function. (add_font_entity_to_list): Use it to filter unsuitable fonts. @@ -22234,7 +22234,7 @@ * lisp.h (Fdelete_terminal): Declare. * charset.h (CHECK_CHARSET, CHECK_CHARSET_GET_ID) - (CHECK_CHARSET_GET_ATTR): Don't use the inexistent return value of + (CHECK_CHARSET_GET_ATTR): Don't use the nonexistent return value of wrong_type_argument. 2008-02-22 Kenichi Handa <handa@ni.aist.go.jp> @@ -23182,7 +23182,7 @@ * font.c (font_prop_validate_symbol, font_prop_validate_style) (font_prop_validate_non_neg, font_prop_validate_spacing): Delete argument prop_index. - (font_property_table): Change arguments to validater. Change Callers. + (font_property_table): Change arguments to validator. Change Callers. (font_lispy_object): Delete. (font_at): Use font_find_object instead fo font_lispy_object. @@ -23463,10 +23463,10 @@ (w32font_list, w32font_match): Use it. (w32font_open): Don't populate subranges. (w32font_has_char): Use script Lisp symbols, not subrange bitmask. - (w32font_encode_char): Always return unicode code-point as-is. + (w32font_encode_char): Always return Unicode code-point as-is. (w32font_text_extents): Supply a transformation matrix to GetGlyphOutline. Never look up by glyph index. Avoid looping - twice. Use unicode version of GetTexExtentPoint32 instead of + twice. Use Unicode version of GetTexExtentPoint32 instead of glyph index version. (set_fonts_frame): Remove. (w32_enumfont_pattern_entity): Add frame parameter, use it to @@ -25081,7 +25081,7 @@ * keymap.c (describe_vector): Handle default value of a char table. * fontset.c (fontset_face): Handle fallback fonts correctly. - (Ffontset_info): Return infomation about fallback fonts. + (Ffontset_info): Return information about fallback fonts. 2008-02-01 Kenichi Handa <handa@m17n.org> @@ -25425,16 +25425,16 @@ (pfnGetFontUnicodeRanges): New dynamically loaded function. (w32_initialize): Try to load it. (x_get_font_repertory): Use it if available. - (w32_encode_char): Add shortcut for unicode output. + (w32_encode_char): Add shortcut for Unicode output. * w32fns.c (w32_load_system_font): Default charset to -1. - (x_to_w32_charset): Match all fonts for unicode. + (x_to_w32_charset): Match all fonts for Unicode. (w32_to_x_charset): New parameter matching. Don't return partial or wildcard charsets. (w32_to_all_x_charsets): Don't return partial or wildcard charsets. - (w32_codepage_for_font): Return CP_UNICODE for unicode. + (w32_codepage_for_font): Return CP_UNICODE for Unicode. (w32_to_x_font): Match charset to real charset. - (enum_font_cb2): Always list unicode versions. + (enum_font_cb2): Always list Unicode versions. * makefile.w32-in (temacs): Increase EMHEAP. @@ -25458,7 +25458,7 @@ * w32fns.c (Fx_create_frame, x_create_tip_frame): Use new version of x_new_fontset. - (w32_load_system_font): Initialize charset as unicode. + (w32_load_system_font): Initialize charset as Unicode. font_info.encoding becomes encoding_type. (w32_to_x_font): Use decode_coding_c_string in place of decode_coding. (x_to_w32_font): Use encode_coding_object in place of encode_coding. @@ -27366,7 +27366,7 @@ * ccl.c: Include "character.h". (Qccl, Qcclp): New variables. - (CCL_WRITE_CHAR): Alway treat the arg CH as a character even if + (CCL_WRITE_CHAR): Always treat the arg CH as a character even if it's less than 256. (CCL_WRITE_MULTIBYTE_CHAR): Delete. (CCL_WRITE_STRING, CCL_READ_CHAR): Adjust for the change of SRC @@ -27685,7 +27685,7 @@ * xterm.c (handle_one_xevent): Revert to counting chars not bytes. * w32term.c (w32_read_socket) <WM_CHAR>: Decode characters outside - the unicode range available in MULE by locale-coding-system. + the Unicode range available in MULE by locale-coding-system. Improve dbcs lead byte detection. Set event timestamp and modifiers earlier. @@ -29136,7 +29136,7 @@ * lisp.h (defvar_per_buffer, DEFVAR_PER_BUFFER): * lread.c (defvar_per_buffer): - * abbrev.c (syms_of_abbrev) <local-abbrev-tabl>: Move to buffer.c. + * abbrev.c (syms_of_abbrev) <local-abbrev-table>: Move to buffer.c. * window.c (candidate_window_p): Only consider as visible frames that are on the same terminal. @@ -29651,7 +29651,7 @@ * callproc.c (child_setup, getenv_internal): Use the display-environment-variable and term-environment-variable frame params. - (set_initial_environment): Initialise Vprocess_environment. + (set_initial_environment): Initialize Vprocess_environment. * config.in: Disable multi-keyboard support on a mac. @@ -30873,7 +30873,7 @@ 2007-06-17 Jason Rumney <jasonr@gnu.org> * w32menu.c (add_menu_item): Don't use multibyte string functions on - unicode strings. + Unicode strings. 2007-06-16 Juanma Barranquero <lekktu@gmail.com> @@ -30892,7 +30892,7 @@ 2007-06-14 Jason Rumney <jasonr@gnu.org> * w32.c (get_process_times_fn): New function pointer. - (globals_of_w32): Intialize it if present in kernel32.dll. + (globals_of_w32): Initialize it if present in kernel32.dll. (w32_get_internal_run_time): New function. * editfns.c (Fget_internal_run_time) [WINDOWSNT]: Use it. @@ -31298,7 +31298,7 @@ (term_mouse_highlight, term_mouse_movement, term_mouse_position) (term_mouse_click, handle_one_term_event, Fterm_open_connection) (Fterm_close_connection): New functions. - (term_init): Initialise mouse_face_window. + (term_init): Initialize mouse_face_window. 2007-05-19 Chong Yidong <cyd@stupidchicken.com> @@ -31330,7 +31330,7 @@ 2007-05-12 Chong Yidong <cyd@stupidchicken.com> - * image.c (pbm_load): Correctly check image size for greyscale pbm. + * image.c (pbm_load): Correctly check image size for grayscale pbm. * xterm.c (XTread_socket): Yet Another Uncaught X Error Crash (YAUXEC). diff --git a/src/ChangeLog.2 b/src/ChangeLog.2 index 05e448c043c..ba61c337efc 100644 --- a/src/ChangeLog.2 +++ b/src/ChangeLog.2 @@ -1152,7 +1152,7 @@ 1987-07-29 Richard Mlynarik (mly@prep) - * lread.c (init_read): Initialise load_in_progress. + * lread.c (init_read): Initialize load_in_progress. 1987-07-28 Richard M. Stallman (rms@prep) @@ -1811,7 +1811,7 @@ 1987-03-13 Richard M. Stallman (rms@prep) * sysdep.c: Don't redefine TCSETAW if already defined. - (Cancelled by change on March 17). + (Canceled by change on March 17). * sunfns.c: New file containing interface to Sun windows. This is enabled by the switch HAVE_SUN_WINDOWS. @@ -2251,7 +2251,7 @@ 1987-01-16 Richard Mlynarik (mly@prep) * xfns.c (Fx_set_{background,cursor,mouse}_color): - Initialise save_color. + Initialize save_color. * fileio.c, search.c, sysdep.c, filelock.c, editfns.c, process.c: Delete/replace unused/conditionalised variables @@ -3002,7 +3002,7 @@ 1986-11-18 Richard Mlynarik (mly@prep) * emacs.c (main): - Giving `inhibit_x_windows' an initialisation loses; + Giving `inhibit_x_windows' an initialization loses; do it explicitly. * xfns.c (Fx_rubber_band): @@ -3291,7 +3291,7 @@ 1986-11-03 Richard Mlynarik (mly@prep) * xterm.c (stufflines): - Initialise signal mask. + Initialize signal mask. * xterm.h: Add definition of sigmask @@ -3346,7 +3346,7 @@ New function. * window.c (Fset_window_hscroll): - Don't inhibit redisplay optimisations if hscroll is same. + Don't inhibit redisplay optimizations if hscroll is same. * ymakefile: rm ../etc/DOC to avoid make-docfile overwriting any files which @@ -3358,7 +3358,7 @@ VMS changes from Sasaki * termcap.c (tgetent): - Make sure `indirect' initialised. + Make sure `indirect' initialized. * xfns.c (grey_p and callers): New function to compensate for ugly chauvinistic American @@ -3496,7 +3496,7 @@ core-dump) Dike out global-minor-modes. This wasn't actually being used by - anything (due to a bug) and wasn't even being initialised! + anything (due to a bug) and wasn't even being initialized! minor-mode-alist does what this thought it was doing. 1986-10-11 Richard Mlynarik (mly@prep) diff --git a/src/ChangeLog.3 b/src/ChangeLog.3 index cdfe63fc59c..34906e505da 100644 --- a/src/ChangeLog.3 +++ b/src/ChangeLog.3 @@ -3271,7 +3271,7 @@ [not HAVE_X11] (x_set_border_pixel): Use gray_width and gray_height, instead of assuming that the bitmap is 16x16. (x_make_gc): Instead of creating a pixmap and then calling - XPutImage to make it into a grey stipple, just call + XPutImage to make it into a gray stipple, just call XCreatePixmapFromBitmapData to do it all at once. * xterm.c (x_text_icon): Move the request for font information @@ -6089,7 +6089,7 @@ shrink below the minimum, this code would only try to delete it if it had a parent. Well, even if the window doesn't have a parent, you want Fdelete_window to signal an error, since you're trying to - resize one of the undeleteable windows into nothingness. So call + resize one of the undeletable windows into nothingness. So call Fdelete_window even if the window doesn't have a parent. * window.c (MINSIZE): Add kludge so that the minibuffer is always @@ -9010,7 +9010,7 @@ * keyboard.c (cmd_error): If an error occurs before somebody has provided a screen to print it on, print it to stderr and exit Emacs. Handle batch-mode errors with the same code. - * lisp.h (Qexternal_debugging_ouput): New extern declaration, for + * lisp.h (Qexternal_debugging_output): New extern declaration, for use in cmd_error. * screen.c (Fscreen_pixel_size, Fset_screen_position): Doc fix. @@ -13137,7 +13137,7 @@ * print.c: Include dispextern.h. (printchar, strout): Use message_buf. - * sysdep.c (get_screen_size): Don't use MscreenWidth, MscreenLenght. + * sysdep.c (get_screen_size): Don't use MscreenWidth, MscreenLength. * term.c: Likewise. * scroll.c (CalcIDCosts, CalcIDCosts1, CalcLID): These now take a @@ -13147,7 +13147,7 @@ (do_scrolling): Use alloca for queue. * dispnew.c (remake_screen_structures): Allocate message_buf. - Don't use MscreenWidth, MscreenLenght. + Don't use MscreenWidth, MscreenLength. * xdisp.c: bf_cur replaced with current_buffer. Calls to SetBfx deleted. @@ -14880,7 +14880,7 @@ 1989-08-09 Joseph Arceneaux (jla@spiff) - * ../oldXMenu/Makefile: Removed all the unneccessary X stuff. + * ../oldXMenu/Makefile: Removed all the unnecessary X stuff. 1989-08-07 Richard Stallman (rms@sugar-bombs.ai.mit.edu) diff --git a/src/ChangeLog.4 b/src/ChangeLog.4 index 208d9c2cdb0..88c9e3dbf71 100644 --- a/src/ChangeLog.4 +++ b/src/ChangeLog.4 @@ -3656,7 +3656,7 @@ * m/delta.h (BROKEN_CLOSEDIR): Added because closedir is interruptible. (HAVE_UNISTD_H): Deleted because configure takes care of it. - (C_SWITCH_MACHINE): Added optimisation options for gnu cc. + (C_SWITCH_MACHINE): Added optimization options for gnu cc. 1993-12-17 Mike Long (mike.long@analog.com) @@ -5007,7 +5007,7 @@ Change display code to handle the `invisible' text property. * dispnew.c (direct_output_for_insert): Fail if character just inserted has text properties. - (direct_ouput_forward_char): Fail if moving near invisible chars. + (direct_output_forward_char): Fail if moving near invisible chars. * indent.c (compute_motion): Compute correctly for invisible text. (vmotion): Take care of invisible newlines. * intervals.c (set_point): Ignore `invisible' property diff --git a/src/ChangeLog.5 b/src/ChangeLog.5 index 1f21e9fb99c..ee79917a34d 100644 --- a/src/ChangeLog.5 +++ b/src/ChangeLog.5 @@ -3463,7 +3463,7 @@ * lisp.h (running_asynch_code): New global flag. * emacs.c (running_asynch_code): New global flag. - (main): Initialise it. + (main): Initialize it. * process.c (read_process_output, exec_sentinel): Set and reset the running_asynch_code global flag and restore match data. diff --git a/src/ChangeLog.6 b/src/ChangeLog.6 index 141a570040c..74141f6813a 100644 --- a/src/ChangeLog.6 +++ b/src/ChangeLog.6 @@ -718,7 +718,7 @@ (init_ntproc) [HAVE_SOCKETS]: Only load winsock library on startup if PRELOAD_WINSOCK is set in environment (or registry). - * ntproc.c (Fwin32_has_winsock, Fwin32_unload_winsock) + * ntproc.c (Fwin32_has_winsock, Fwin32_unload_winsock) [HAVE_SOCKETS]: New functions. (syms_of_ntproc) [HAVE_SOCKETS]: defsubr them. @@ -845,7 +845,7 @@ (timer_id): Renamed to mouse_button_timer. (saved_mouse_move_msg, mouse_move_timer): New variables. (win_msg_worker): Delete WM_TIMER code. - (win32_wnd_proc): Handle WM_TIMER events here. Use separate timers + (win32_wnd_proc): Handle WM_TIMER events here. Use separate timers for mouse down and mouse move (including scroll bar drag) events. Add new handling code for WM_VSCROLL and WM_MOUSEMOVE events. Only filter WM_MOUSEMOVE events when a button is held down. @@ -1100,17 +1100,17 @@ (nt_sleep): Renamed to sys_sleep. - (rename): Renamed to sys_rename. Always rename to a temporary name + (rename): Renamed to sys_rename. Always rename to a temporary name first on Windows 95. Unlink new name first if necessary. (dir_finding): Variable deleted. (dir_is_fat, dir_pathname): New variables. - (openddir): Fail if dir_find_handle is in use. Save directory name + (openddir): Fail if dir_find_handle is in use. Save directory name in dir_pathname, and set dir_is_fat appropriately. (closedir, readdir): Use dir_find_handle in place of dir_finding. (readdir): Copy directory name from dir_pathname on first - call. Use IS_DIRECTORY_SEP instead of IS_ANY_SEP. Force filename + call. Use IS_DIRECTORY_SEP instead of IS_ANY_SEP. Force filename to be lower case on FAT volumes. (getpwuid): Move struct passwd initialization to init_user_info, @@ -1141,7 +1141,7 @@ (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 + (fd_info): New variable. Array of extra info for file descriptors needed for pipe/socket support. (utc_base_ft, utc_base, init): New internal variables used for @@ -1182,7 +1182,7 @@ support in sys_select. (term_ntproc): New function. - (init_ntproc): New function to initialise socket support and make + (init_ntproc): New function to initialize socket support and make initial std handles non-inheritable. Also ensure stdin, stdout and stderr have valid handles so that pipes and sockets can't inadvertently use fd 0, 1, or 2. @@ -1206,7 +1206,7 @@ * ntinevt.c (win32_kdb_patch_key): Initialize isdead. (key_event) [HAVE_NTGUI]: Use Windows key code. - * ntproc.c: Include config.h after CRT headers. Include fcntl.h. + * ntproc.c: Include config.h after CRT headers. Include fcntl.h. (child_process, MAX_CHILDREN, CHILD_ACTIVE): Moved to nt.h. (DebugPrint): New macro. (new_child): Create input event structures for child processes. @@ -1440,7 +1440,7 @@ Correctly detect when default_directory is absolute. Be strict when looking for MSDOS drive specifier; defer calling getdefdir. Ignore drive specifier if name now has UNC prefix. - Correctly recognise if name is not absolute when trying simple + Correctly recognize if name is not absolute when trying simple method to expand; return original string if possible. Skip dir sep after ~ or ~user. Use getpwnam instead of HOME for ~user on NT. @@ -2580,7 +2580,7 @@ (win32_fill_rect, dumpglyphs, do_line_dance, x_draw_box): Use Get/ReleaseFrameDC. (win32_update_begin): Regenerate palette if required. - (w32_read_socket): Use FALSE. Handle WM_PALETTECHANGED. + (w32_read_socket): Use FALSE. Handle WM_PALETTECHANGED. (win32_term_init): Use GetDC directly. Enable palette in display structure. Predefine white and black. @@ -4501,7 +4501,7 @@ * msdos.c (putchar): Call internal_flush instead of _flsbuf. (DO_TERMSCRIPT): New macro to support open-termscript. (internal_flush): Corrected handling of flush in middle of - escape sequences. Handle screen width > 127. + escape sequences. Handle screen width > 127. (flush_escape): New function for use by internal_flush. (sys_select): New MS-DOS specific version with us timing. (EMACSCOLORS): New environment variable. diff --git a/src/ChangeLog.7 b/src/ChangeLog.7 index 73d0d45e9c1..fc97acdeb1e 100644 --- a/src/ChangeLog.7 +++ b/src/ChangeLog.7 @@ -5774,7 +5774,7 @@ (w32_initialize): Set input mode. Use w32_msg_worker instead of windows_msg_worker. Dynamically link proportional scroll bar - functions and intialize proportional scroll bar variables. + functions and initialize proportional scroll bar variables. (syms_of_w32term): DEFVAR new variables. * w32term.h (w32_output): New fields menubar_widget, menubar_active, @@ -10963,7 +10963,7 @@ 1996-08-28 Morten Welinder <terra@diku.dk> * minibuf.c (Vhistory_length, Qhistory_length): New variables. - (syms_of_minibuf): Register and initialise these. + (syms_of_minibuf): Register and initialize these. (read_minibuf): Truncate history list if needed. 1996-08-28 Richard Stallman <rms@psilocin.gnu.ai.mit.edu> diff --git a/src/ChangeLog.8 b/src/ChangeLog.8 index 00e4a1f62c8..6a48b09e64b 100644 --- a/src/ChangeLog.8 +++ b/src/ChangeLog.8 @@ -2723,7 +2723,7 @@ (CURSOR_FACE_ID, MOUSE_FACE_ID): New. * xfaces.c (Qscroll_bar, Qcursor, Qborder, Qmouse): New. - (syms_of_xfaces): Intialize new symbols. + (syms_of_xfaces): Initialize new symbols. * fns.c (Fmakehash): Take one argument, test, make all the rest keyword arguments. @@ -5409,7 +5409,7 @@ 1998-11-10 Gerd Moellmann <gerd@gnu.org> - * xrdb.c (x_load_resources): Add grey background colors as + * xrdb.c (x_load_resources): Add gray background colors as defaults for menus, scroll bars, and dialogs. * insdel.c (prepare_to_modify_buffer): Move setting @@ -8018,7 +8018,7 @@ * xterm.c (x_scroll_run): Renamed from do_line_dance. - * xdisp.c (redisplay_window): For window-based redisplay, alway + * xdisp.c (redisplay_window): For window-based redisplay, always try try_window_id. * xterm.c (struct glyph_string): New member two_byte_p that is @@ -9227,7 +9227,7 @@ * xdisp.c (store_frame_title_char): New function to store a single character for the frame title with re-allocation of frame_title_buf. - (init_xdisp): Intialize frame_title_.* variables to null. + (init_xdisp): Initialize frame_title_.* variables to null. * dispnew.c (quit_error_check): Removed. @@ -12321,7 +12321,7 @@ (enumfont_t): Remove unused head pointer. (enum_font_cb2): Dereference elfLogFont. (w32_list_bdf_fonts): New function. - (w32_list_fonts): Use one_w32_dispay_info instead of insisting on + (w32_list_fonts): Use one_w32_display_info instead of insisting on valid frame. Remove MessageBox. Support BDF fonts. (Fw32_find_bdf_fonts): New function. (syms_of_w32fns): Add Vw32_bdf_filename_alist and @@ -12583,7 +12583,7 @@ quit_char is typed, in order to break out of potential deadlocks. (cancel_all_deferred_msgs): New function. (complete_deferred_msg): Don't abort if msg not found; may have - been cancelled. + been canceled. (Fw32_reconstruct_hot_key): Use pre-interned symbols. (Fw32_send_sys_command): Wait for system command to complete before returning. @@ -12766,7 +12766,7 @@ 1998-12-08 Geoff Voelker <voelker@cs.washington.edu> - * makefile.nt: Do string comparision of _NMAKE_VER. + * makefile.nt: Do string comparison of _NMAKE_VER. 1998-12-06 Eli Zaretskii <eliz@mescaline.gnu.org> @@ -13266,7 +13266,7 @@ * charset.c (Fchar_bytes): Doc fix. (char_bytes): Fix returned value to match returned type. - (syms_of_charset): Fix type clash in initialisation of + (syms_of_charset): Fix type clash in initialization of Vauto_fill_chars. 1998-10-29 Geoff Voelker <voelker@cs.washington.edu> @@ -13429,7 +13429,7 @@ `x-list-fonts.c'. (w32_get_font_info, w32_query_font, w32_find_ccl_program): New functions for fontset support - adapted from x_ equivalents. - (syms_of_w32fns): New lisp variables initialised. Function + (syms_of_w32fns): New lisp variables initialized. Function pointers for fontset.c set up. * w32term.c: Include fontset.h. Define codepage macros. @@ -13701,7 +13701,7 @@ * ccl.c (CCL_WRITE_CHAR): Don't use bcopy. (ccl_driver): If BUFFER-MAGNIFICATION of the CCL program is 0, cause error if the program is going to output some bytes. When - outputing a string to notify an error, check the case that + outputting a string to notify an error, check the case that DST_BYTES is zero. * coding.h (CODING_FINISH_INTERRUPT): New macro. diff --git a/src/ChangeLog.9 b/src/ChangeLog.9 index 9e7bd24f792..6e3a8d8ab3b 100644 --- a/src/ChangeLog.9 +++ b/src/ChangeLog.9 @@ -3479,7 +3479,7 @@ a workaround for SunOS 4's cc. (CCL_CALL_FOR_MAP_INSTRUCTION): Use "if (1)..." not "do {...". (CCL_SUCCESS, CCL_SUSPEND, CCL_INVALID_CMD): Likewise. - (ccl_driver) <CCL_ReadMultibyteChar2>: Remove unnecessay "do" + (ccl_driver) <CCL_ReadMultibyteChar2>: Remove unnecessary "do" statement. 2001-01-23 Gerd Moellmann <gerd@gnu.org> @@ -5150,7 +5150,7 @@ 2000-11-27 Jason Rumney <jasonr@gnu.org> * w32fns.c (w32_load_system_font): Always mark font as double byte - if codepage is unicode. + if codepage is Unicode. 2000-11-27 Gerd Moellmann <gerd@gnu.org> diff --git a/src/alloc.c b/src/alloc.c index f21f0b4fa3a..84a84df3597 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -203,9 +203,6 @@ static int malloc_hysteresis; remapping on more recent systems because this is less important nowadays than in the days of small memories and timesharing. */ -#ifndef VIRT_ADDR_VARIES -static -#endif EMACS_INT pure[(PURESIZE + sizeof (EMACS_INT) - 1) / sizeof (EMACS_INT)] = {1,}; #define PUREBEG (char *) pure @@ -222,10 +219,7 @@ static ptrdiff_t pure_bytes_used_before_overflow; /* Value is non-zero if P points into pure space. */ #define PURE_POINTER_P(P) \ - (((PNTR_COMPARISON_TYPE) (P) \ - < (PNTR_COMPARISON_TYPE) ((char *) purebeg + pure_size)) \ - && ((PNTR_COMPARISON_TYPE) (P) \ - >= (PNTR_COMPARISON_TYPE) purebeg)) + ((uintptr_t) (P) - (uintptr_t) purebeg <= pure_size) /* Index in pure at which next pure Lisp object will be allocated.. */ diff --git a/src/bidi.c b/src/bidi.c index e8f2df89a9e..bd78a5eff29 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -51,7 +51,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ A note about references to UAX#9 rules: if the reference says something like "X9/Retaining", it means that you need to refer to - rule X9 and to its modifications decribed in the "Implementation + rule X9 and to its modifications described in the "Implementation Notes" section of UAX#9, under "Retaining Format Codes". */ #include <config.h> diff --git a/src/buffer.c b/src/buffer.c index f1ce9f4ec47..afa7e915429 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1526,7 +1526,13 @@ with SIGHUP. */) UNGCPRO; } - /* Make this buffer not be current. + /* Run replace_buffer_in_windows before making another buffer current + since set-window-buffer-start-and-point will refuse to make another + buffer current if the selected window does not show the current + buffer. (Bug#10114) */ + replace_buffer_in_windows (buffer); + + /* Make this buffer not be current. In the process, notice if this is the sole visible buffer and give up if so. */ if (b == current_buffer) @@ -1566,7 +1572,6 @@ with SIGHUP. */) /* These may run Lisp code and into infinite loops (if someone insisted on circular lists) so allow quitting here. */ - replace_buffer_in_windows (buffer); frames_discard_buffer (buffer); clear_charpos_cache (b); @@ -1626,7 +1631,7 @@ with SIGHUP. */) /* Reset the local variables, so that this buffer's local values won't be protected from GC. They would be protected - if they happened to remain encached in their symbols. + if they happened to remain cached in their symbols. This gets rid of them for certain. */ swap_out_buffer_local_variables (b); reset_buffer_local_variables (b, 1); @@ -2480,7 +2485,7 @@ swap_out_buffer_local_variables (struct buffer *b) Lisp_Object sym = XCAR (XCAR (alist)); eassert (XSYMBOL (sym)->redirect == SYMBOL_LOCALIZED); /* Need not do anything if some other buffer's binding is - now encached. */ + now cached. */ if (EQ (SYMBOL_BLV (XSYMBOL (sym))->where, buffer)) { /* Symbol is set up for this buffer's old local value: @@ -4399,7 +4404,7 @@ static int mmap_fd_1; static int mmap_page_size; -/* 1 means mmap has been intialized. */ +/* 1 means mmap has been initialized. */ static int mmap_initialized_p; @@ -4438,7 +4443,7 @@ static int mmap_initialized_p; #define MMAP_ALLOCATED_P(start, end) 1 #endif -/* Perform necessary intializations for the use of mmap. */ +/* Perform necessary initializations for the use of mmap. */ static void mmap_init (void) diff --git a/src/buffer.h b/src/buffer.h index 323c85a0c77..e2d4b555e11 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -978,7 +978,7 @@ extern int last_per_buffer_idx; variable has an index > 0 associated with it, except when it always has buffer-local values, in which case the index is -1. If this is 0, this is a bug and means that the slot of VAR in - buffer_local_flags wasn't intiialized. */ + buffer_local_flags wasn't initialized. */ #define PER_BUFFER_VAR_IDX(VAR) \ PER_BUFFER_IDX (PER_BUFFER_VAR_OFFSET (VAR)) diff --git a/src/callint.c b/src/callint.c index 5eb824b8c74..444892ef9cb 100644 --- a/src/callint.c +++ b/src/callint.c @@ -78,7 +78,7 @@ c -- Character (no input method is used). C -- Command name: symbol with interactive function definition. d -- Value of point as number. Does not do I/O. D -- Directory name. -e -- Parametrized event (i.e., one that's a list) that invoked this command. +e -- Parameterized event (i.e., one that's a list) that invoked this command. If used more than once, the Nth `e' returns the Nth parameterized event. This skips events that are integers or symbols. f -- Existing file name. diff --git a/src/casetab.c b/src/casetab.c index 64e47859d9b..8778048072c 100644 --- a/src/casetab.c +++ b/src/casetab.c @@ -95,7 +95,7 @@ CANONICALIZE maps each character to a canonical equivalent; any two characters that are related by case-conversion have the same canonical equivalent character; it may be nil, in which case it is deduced from DOWNCASE and UPCASE. -EQUIVALENCES is a map that cyclicly permutes each equivalence class +EQUIVALENCES is a map that cyclically permutes each equivalence class (of characters with the same canonical equivalent); it may be nil, in which case it is deduced from CANONICALIZE. */) (Lisp_Object table) diff --git a/src/ccl.c b/src/ccl.c index 97fca3bb032..1c6f444920c 100644 --- a/src/ccl.c +++ b/src/ccl.c @@ -47,7 +47,7 @@ static Lisp_Object Qcode_conversion_map; static Lisp_Object Qcode_conversion_map_id; /* Symbols of ccl program have this property, a value of the property - is an index for Vccl_protram_table. */ + is an index for Vccl_program_table. */ static Lisp_Object Qccl_program_idx; /* Table of registered CCL programs. Each element is a vector of @@ -552,7 +552,7 @@ static Lisp_Object Vccl_program_table; But, when VALm is mapped to VALn and VALn is not a number, the mapping proceed as below: - If VALn is nil, the lastest map is ignored and the mapping of VALm + If VALn is nil, the last map is ignored and the mapping of VALm proceed to the next map. In VALn is t, VALm is reverted to reg[rrr] and the mapping of VALm @@ -561,7 +561,7 @@ static Lisp_Object Vccl_program_table; If VALn is lambda, move to the next map set like reaching to the end of the current map set. - If VALn is a symbol, call the CCL program refered by it. + If VALn is a symbol, call the CCL program referred by it. Then, use reg[rrr] as a mapped value except for -1, -2 and -3. Such special values are regarded as nil, t, and lambda respectively. @@ -823,7 +823,7 @@ while (0) : (charset = CHARSET_FROM_ID ((id)), DECODE_CHAR (charset, (code)))) /* Encode character C by some of charsets in CHARSET_LIST. Set ID to - the id of the used charset, ENCODED to the resulf of encoding. + the id of the used charset, ENCODED to the result of encoding. Assume that we can use the variable `charset'. */ #define CCL_ENCODE_CHAR(c, charset_list, id, encoded) \ diff --git a/src/character.c b/src/character.c index d5d89381aaf..5e2a7b9461c 100644 --- a/src/character.c +++ b/src/character.c @@ -670,7 +670,7 @@ str_as_multibyte (unsigned char *str, ptrdiff_t len, ptrdiff_t nbytes, } /* Parse unibyte string at STR of LEN bytes, and return the number of - bytes it may ocupy when converted to multibyte string by + bytes it may occupy when converted to multibyte string by `str_to_multibyte'. */ ptrdiff_t diff --git a/src/character.h b/src/character.h index 2e1372eaf94..cc76ab213fc 100644 --- a/src/character.h +++ b/src/character.h @@ -596,7 +596,7 @@ sanitize_char_width (EMACS_INT width) ? ASCII_CHAR_WIDTH (c) \ : sanitize_char_width (XINT (CHAR_TABLE_REF (Vchar_width_table, c)))) -/* If C is a variation selector, return the index numnber of the +/* If C is a variation selector, return the index of the variation selector (1..256). Otherwise, return 0. */ #define CHAR_VARIATION_SELECTOR_P(c) \ diff --git a/src/charset.c b/src/charset.c index 8f16771b855..ec90a64341e 100644 --- a/src/charset.c +++ b/src/charset.c @@ -167,9 +167,9 @@ static struct maximum character of the current charset. */ int min_char, max_char; - /* A Unicode character correspoinding to the code indice 0 (i.e. the + /* A Unicode character corresponding to the code index 0 (i.e. the minimum code-point) of the current charset, or -1 if the code - indice 0 is not a Unicode character. This is checked when + index 0 is not a Unicode character. This is checked when table.encoder[CHAR] is zero. */ int zero_index_char; @@ -2074,7 +2074,7 @@ that case, find the charset from what supported by that coding system. */) DEFUN ("charset-after", Fcharset_after, Scharset_after, 0, 1, 0, doc: /* Return charset of a character in the current buffer at position POS. -If POS is nil, it defauls to the current point. +If POS is nil, it defaults to the current point. If POS is out of range, the value is nil. */) (Lisp_Object pos) { diff --git a/src/chartab.c b/src/chartab.c index c3dd1fe5b15..e1252962612 100644 --- a/src/chartab.c +++ b/src/chartab.c @@ -747,7 +747,7 @@ equivalent and can be merged. It defaults to `equal'. */) ARG is passed to C_FUNCTION when that is called. It returns the value of last character covered by TABLE (not the - value inheritted from the parent), and by side-effect, the car part + value inherited from the parent), and by side-effect, the car part of RANGE is updated to the minimum character C where C and all the following characters in TABLE have the same value. */ @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ -/* Holds the minimum and maximum costs for the parametrized capabilities. */ +/* Holds the minimum and maximum costs for the parameterized capabilities. */ struct parmcap { int mincost, maxcost; @@ -66,7 +66,7 @@ struct cm location */ unsigned int cm_autolf:1; /* \r performs a \r\n (rn) */ - /* Parametrized capabilities. This needs to be a struct since + /* Parameterized capabilities. This needs to be a struct since the costs are accessed through pointers. */ #if 0 @@ -79,7 +79,7 @@ struct cm struct parmcap cc_multiright; /* multiple right (RI) */ #endif - /* Costs for the non-parametrized capabilities */ + /* Costs for the non-parameterized capabilities */ int cc_up; /* cost for up */ int cc_down; /* etc. */ int cc_left; diff --git a/src/coding.c b/src/coding.c index b0dfc498add..74cf232cfb2 100644 --- a/src/coding.c +++ b/src/coding.c @@ -847,16 +847,16 @@ static int encode_coding_ccl (struct coding_system *); static void decode_coding_raw_text (struct coding_system *); static int encode_coding_raw_text (struct coding_system *); -static void coding_set_source (struct coding_system *); -static void coding_set_destination (struct coding_system *); +static ptrdiff_t coding_set_source (struct coding_system *); +static ptrdiff_t coding_set_destination (struct coding_system *); static void coding_alloc_by_realloc (struct coding_system *, ptrdiff_t); static void coding_alloc_by_making_gap (struct coding_system *, ptrdiff_t, ptrdiff_t); static unsigned char *alloc_destination (struct coding_system *, ptrdiff_t, unsigned char *); static void setup_iso_safe_charsets (Lisp_Object); -static unsigned char *encode_designation_at_bol (struct coding_system *, - int *, unsigned char *); +static int encode_designation_at_bol (struct coding_system *, + int *, int *, unsigned char *); static int detect_eol (const unsigned char *, ptrdiff_t, enum coding_category); static Lisp_Object adjust_coding_eol_type (struct coding_system *, int); @@ -915,27 +915,68 @@ record_conversion_result (struct coding_system *coding, } } -/* This wrapper macro is used to preserve validity of pointers into - buffer text across calls to decode_char, which could cause - relocation of buffers if it loads a charset map, because loading a - charset map allocates large structures. */ +/* These wrapper macros are used to preserve validity of pointers into + buffer text across calls to decode_char, encode_char, etc, which + could cause relocation of buffers if it loads a charset map, + because loading a charset map allocates large structures. */ + #define CODING_DECODE_CHAR(coding, src, src_base, src_end, charset, code, c) \ do { \ + ptrdiff_t offset; \ + \ charset_map_loaded = 0; \ c = DECODE_CHAR (charset, code); \ - if (charset_map_loaded) \ + if (charset_map_loaded \ + && (offset = coding_set_source (coding))) \ { \ - const unsigned char *orig = coding->source; \ - ptrdiff_t offset; \ - \ - coding_set_source (coding); \ - offset = coding->source - orig; \ src += offset; \ src_base += offset; \ src_end += offset; \ } \ } while (0) +#define CODING_ENCODE_CHAR(coding, dst, dst_end, charset, c, code) \ + do { \ + ptrdiff_t offset; \ + \ + charset_map_loaded = 0; \ + code = ENCODE_CHAR (charset, c); \ + if (charset_map_loaded \ + && (offset = coding_set_destination (coding))) \ + { \ + dst += offset; \ + dst_end += offset; \ + } \ + } while (0) + +#define CODING_CHAR_CHARSET(coding, dst, dst_end, c, charset_list, code_return, charset) \ + do { \ + ptrdiff_t offset; \ + \ + charset_map_loaded = 0; \ + charset = char_charset (c, charset_list, code_return); \ + if (charset_map_loaded \ + && (offset = coding_set_destination (coding))) \ + { \ + dst += offset; \ + dst_end += offset; \ + } \ + } while (0) + +#define CODING_CHAR_CHARSET_P(coding, dst, dst_end, c, charset, result) \ + do { \ + ptrdiff_t offset; \ + \ + charset_map_loaded = 0; \ + result = CHAR_CHARSET_P (c, charset); \ + if (charset_map_loaded \ + && (offset = coding_set_destination (coding))) \ + { \ + dst += offset; \ + dst_end += offset; \ + } \ + } while (0) + /* If there are at least BYTES length of room at dst, allocate memory for coding->destination and update dst and dst_end. We don't have @@ -1015,9 +1056,14 @@ record_conversion_result (struct coding_system *coding, | ((p)[-1] & 0x3F)))) -static void +/* Update coding->source from coding->src_object, and return how many + bytes coding->source was changed. */ + +static ptrdiff_t coding_set_source (struct coding_system *coding) { + const unsigned char *orig = coding->source; + if (BUFFERP (coding->src_object)) { struct buffer *buf = XBUFFER (coding->src_object); @@ -1036,11 +1082,18 @@ coding_set_source (struct coding_system *coding) /* Otherwise, the source is C string and is never relocated automatically. Thus we don't have to update anything. */ } + return coding->source - orig; } -static void + +/* Update coding->destination from coding->dst_object, and return how + many bytes coding->destination was changed. */ + +static ptrdiff_t coding_set_destination (struct coding_system *coding) { + const unsigned char *orig = coding->destination; + if (BUFFERP (coding->dst_object)) { if (BUFFERP (coding->src_object) && coding->src_pos < 0) @@ -1065,6 +1118,7 @@ coding_set_destination (struct coding_system *coding) /* Otherwise, the destination is C string and is never relocated automatically. Thus we don't have to update anything. */ } + return coding->destination - orig; } @@ -2650,14 +2704,19 @@ encode_coding_emacs_mule (struct coding_system *coding) if (preferred_charset_id >= 0) { + int result; + charset = CHARSET_FROM_ID (preferred_charset_id); - if (CHAR_CHARSET_P (c, charset)) + CODING_CHAR_CHARSET_P (coding, dst, dst_end, c, charset, result); + if (result) code = ENCODE_CHAR (charset, c); else - charset = char_charset (c, charset_list, &code); + CODING_CHAR_CHARSET (coding, dst, dst_end, c, charset_list, + &code, charset); } else - charset = char_charset (c, charset_list, &code); + CODING_CHAR_CHARSET (coding, dst, dst_end, c, charset_list, + &code, charset); if (! charset) { c = coding->default_char; @@ -2666,7 +2725,8 @@ encode_coding_emacs_mule (struct coding_system *coding) EMIT_ONE_ASCII_BYTE (c); continue; } - charset = char_charset (c, charset_list, &code); + CODING_CHAR_CHARSET (coding, dst, dst_end, c, charset_list, + &code, charset); } dimension = CHARSET_DIMENSION (charset); emacs_mule_id = CHARSET_EMACS_MULE_ID (charset); @@ -4185,7 +4245,8 @@ decode_coding_iso_2022 (struct coding_system *coding) #define ENCODE_ISO_CHARACTER(charset, c) \ do { \ - unsigned code = ENCODE_CHAR ((charset), (c)); \ + unsigned code; \ + CODING_ENCODE_CHAR (coding, dst, dst_end, (charset), (c), code); \ \ if (CHARSET_DIMENSION (charset) == 1) \ ENCODE_ISO_CHARACTER_DIMENSION1 ((charset), code); \ @@ -4283,15 +4344,19 @@ encode_invocation_designation (struct charset *charset, /* Produce designation sequences of charsets in the line started from - SRC to a place pointed by DST, and return updated DST. + CHARBUF to a place pointed by DST, and return the number of + produced bytes. DST should not directly point a buffer text area + which may be relocated by char_charset call. If the current block ends before any end-of-line, we may fail to find all the necessary designations. */ -static unsigned char * -encode_designation_at_bol (struct coding_system *coding, int *charbuf, +static int +encode_designation_at_bol (struct coding_system *coding, + int *charbuf, int *charbuf_end, unsigned char *dst) { + unsigned char *orig = dst; struct charset *charset; /* Table of charsets to be designated to each graphic register. */ int r[4]; @@ -4309,7 +4374,7 @@ encode_designation_at_bol (struct coding_system *coding, int *charbuf, for (reg = 0; reg < 4; reg++) r[reg] = -1; - while (found < 4) + while (charbuf < charbuf_end && found < 4) { int id; @@ -4334,7 +4399,7 @@ encode_designation_at_bol (struct coding_system *coding, int *charbuf, ENCODE_DESIGNATION (CHARSET_FROM_ID (r[reg]), reg, coding); } - return dst; + return dst - orig; } /* See the above "GENERAL NOTES on `encode_coding_XXX ()' functions". */ @@ -4378,13 +4443,26 @@ encode_coding_iso_2022 (struct coding_system *coding) if (bol_designation) { - unsigned char *dst_prev = dst; - /* We have to produce designation sequences if any now. */ - dst = encode_designation_at_bol (coding, charbuf, dst); - bol_designation = 0; + unsigned char desig_buf[16]; + int nbytes; + ptrdiff_t offset; + + charset_map_loaded = 0; + nbytes = encode_designation_at_bol (coding, charbuf, charbuf_end, + desig_buf); + if (charset_map_loaded + && (offset = coding_set_destination (coding))) + { + dst += offset; + dst_end += offset; + } + memcpy (dst, desig_buf, nbytes); + dst += nbytes; /* We are sure that designation sequences are all ASCII bytes. */ - produced_chars += dst - dst_prev; + produced_chars += nbytes; + bol_designation = 0; + ASSURE_DESTINATION (safe_room); } c = *charbuf++; @@ -4455,12 +4533,17 @@ encode_coding_iso_2022 (struct coding_system *coding) if (preferred_charset_id >= 0) { + int result; + charset = CHARSET_FROM_ID (preferred_charset_id); - if (! CHAR_CHARSET_P (c, charset)) - charset = char_charset (c, charset_list, NULL); + CODING_CHAR_CHARSET_P (coding, dst, dst_end, c, charset, result); + if (! result) + CODING_CHAR_CHARSET (coding, dst, dst_end, c, charset_list, + NULL, charset); } else - charset = char_charset (c, charset_list, NULL); + CODING_CHAR_CHARSET (coding, dst, dst_end, c, charset_list, + NULL, charset); if (!charset) { if (coding->mode & CODING_MODE_SAFE_ENCODING) @@ -4471,7 +4554,8 @@ encode_coding_iso_2022 (struct coding_system *coding) else { c = coding->default_char; - charset = char_charset (c, charset_list, NULL); + CODING_CHAR_CHARSET (coding, dst, dst_end, c, + charset_list, NULL, charset); } } ENCODE_ISO_CHARACTER (charset, c); @@ -4897,7 +4981,9 @@ encode_coding_sjis (struct coding_system *coding) else { unsigned code; - struct charset *charset = char_charset (c, charset_list, &code); + struct charset *charset; + CODING_CHAR_CHARSET (coding, dst, dst_end, c, charset_list, + &code, charset); if (!charset) { @@ -4909,7 +4995,8 @@ encode_coding_sjis (struct coding_system *coding) else { c = coding->default_char; - charset = char_charset (c, charset_list, &code); + CODING_CHAR_CHARSET (coding, dst, dst_end, c, + charset_list, &code, charset); } } if (code == CHARSET_INVALID_CODE (charset)) @@ -4984,7 +5071,9 @@ encode_coding_big5 (struct coding_system *coding) else { unsigned code; - struct charset *charset = char_charset (c, charset_list, &code); + struct charset *charset; + CODING_CHAR_CHARSET (coding, dst, dst_end, c, charset_list, + &code, charset); if (! charset) { @@ -4996,7 +5085,8 @@ encode_coding_big5 (struct coding_system *coding) else { c = coding->default_char; - charset = char_charset (c, charset_list, &code); + CODING_CHAR_CHARSET (coding, dst, dst_end, c, + charset_list, &code, charset); } } if (code == CHARSET_INVALID_CODE (charset)) @@ -5154,7 +5244,7 @@ encode_coding_ccl (struct coding_system *coding) && coding->mode & CODING_MODE_LAST_BLOCK) ccl->last_block = 1; - while (charbuf < charbuf_end) + do { ccl_driver (ccl, charbuf, destination_charbuf, charbuf_end - charbuf, 1024, charset_list); @@ -5176,6 +5266,7 @@ encode_coding_ccl (struct coding_system *coding) || ccl->status == CCL_STAT_INVALID_CMD) break; } + while (charbuf < charbuf_end); switch (ccl->status) { @@ -5572,7 +5663,9 @@ encode_coding_charset (struct coding_system *coding) } else { - charset = char_charset (c, charset_list, &code); + CODING_CHAR_CHARSET (coding, dst, dst_end, c, charset_list, + &code, charset); + if (charset) { if (CHARSET_DIMENSION (charset) == 1) @@ -9207,7 +9300,7 @@ frame's terminal device. */) = TERMINAL_TERMINAL_CODING (get_terminal (terminal, 1)); Lisp_Object coding_system = CODING_ID_NAME (terminal_coding->id); - /* For backward compatibility, return nil if it is `undecided'. */ + /* For backward compatibility, return nil if it is `undecided'. */ return (! EQ (coding_system, Qundecided) ? coding_system : Qnil); } diff --git a/src/coding.h b/src/coding.h index 2165fa23712..711e41ed5b8 100644 --- a/src/coding.h +++ b/src/coding.h @@ -457,7 +457,7 @@ struct coding_system /* Number of error source data found in a decoding routine. */ int errors; - /* Store the positions of error source data. */ + /* Store the positions of error source data. */ ptrdiff_t *error_positions; /* Finish status of code conversion. */ diff --git a/src/data.c b/src/data.c index 7b30e91b12f..2337b0a4952 100644 --- a/src/data.c +++ b/src/data.c @@ -839,7 +839,7 @@ do_symval_forwarding (register union Lisp_Fwd *valcontents) case Lisp_Fwd_Kboard_Obj: /* We used to simply use current_kboard here, but from Lisp - code, it's value is often unexpected. It seems nicer to + code, its value is often unexpected. It seems nicer to allow constructions like this to work as intuitively expected: (with-selected-frame frame diff --git a/src/dbusbind.c b/src/dbusbind.c index 352f2fc1ff8..7801ec259bb 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -184,7 +184,7 @@ static int xd_in_read_queued_messages = 0; #endif /* This was a macro. On Solaris 2.11 it was said to compile for - hours, when optimzation is enabled. So we have transferred it into + hours, when optimization is enabled. So we have transferred it into a function. */ /* Determine the DBusType of a given Lisp symbol. OBJECT must be one of the predefined D-Bus type symbols. */ diff --git a/src/dired.c b/src/dired.c index 3a3adfb5082..1d112db8a93 100644 --- a/src/dired.c +++ b/src/dired.c @@ -229,11 +229,11 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, Lisp_Object m ptrdiff_t len; int wanted = 0; Lisp_Object name, finalname; - struct gcpro inner_gcpro1, inner_gcpro2; + struct gcpro gcpro1, gcpro2; len = NAMLEN (dp); name = finalname = make_unibyte_string (dp->d_name, len); - GCPRO2_VAR (finalname, name, inner_gcpro); + GCPRO2 (finalname, name); /* Note: DECODE_FILE can GC; it should protect its argument, though. */ @@ -289,23 +289,23 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, Lisp_Object m /* Construct an expanded filename for the directory entry. Use the decoded names for input to Ffile_attributes. */ Lisp_Object decoded_fullname, fileattrs; - struct gcpro innermost_gcpro1, innermost_gcpro2; + struct gcpro gcpro1, gcpro2; decoded_fullname = fileattrs = Qnil; - GCPRO2_VAR (decoded_fullname, fileattrs, innermost_gcpro); + GCPRO2 (decoded_fullname, fileattrs); /* Both Fexpand_file_name and Ffile_attributes can GC. */ decoded_fullname = Fexpand_file_name (name, directory); fileattrs = Ffile_attributes (decoded_fullname, id_format); list = Fcons (Fcons (finalname, fileattrs), list); - UNGCPRO_VAR (innermost_gcpro); + UNGCPRO; } else list = Fcons (finalname, list); } - UNGCPRO_VAR (inner_gcpro); + UNGCPRO; } } @@ -673,11 +673,11 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v if (!NILP (predicate)) { Lisp_Object val; - struct gcpro inner_gcpro1; + struct gcpro gcpro1; - GCPRO1_VAR (name, inner_gcpro); + GCPRO1 (name); val = call1 (predicate, name); - UNGCPRO_VAR (inner_gcpro); + UNGCPRO; if (NILP (val)) continue; diff --git a/src/dispextern.h b/src/dispextern.h index ccb85e7422e..9d5feea6024 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -405,7 +405,7 @@ struct glyph { /* Metrics of a partial glyph of an image (type == IMAGE_GLYPH). */ struct glyph_slice img; - /* Start and end indices of glyphs of a graphme cluster of a + /* Start and end indices of glyphs of a grapheme cluster of a composition (type == COMPOSITE_GLYPH). */ struct { int from, to; } cmp; /* Pixel offsets for upper and lower part of the acronym. */ @@ -2649,11 +2649,11 @@ struct redisplay_interface void (*flush_display) (struct frame *f); /* Flush the display of frame F if non-NULL. This is called - during redisplay, and should be NULL on systems which flushes + during redisplay, and should be NULL on systems which flush automatically before reading input. */ void (*flush_display_optional) (struct frame *f); - /* Clear the mouse hightlight in window W, if there is any. */ + /* Clear the mouse highlight in window W, if there is any. */ void (*clear_window_mouse_face) (struct window *w); /* Set *LEFT and *RIGHT to the left and right overhang of GLYPH on @@ -3127,9 +3127,7 @@ 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 */ diff --git a/src/dispnew.c b/src/dispnew.c index 88f75414074..e53e3fdf80d 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -431,7 +431,7 @@ margin_glyphs_to_reserve (struct window *w, int total_glyphs, Lisp_Object margin #if XASSERTS /* Return non-zero if ROW's hash value is correct, zero if not. */ -static int +int verify_row_hash (struct glyph_row *row) { return row->hash == row_hash (row); @@ -608,7 +608,6 @@ 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; } } @@ -3575,12 +3574,11 @@ update_window (struct window *w, int force_p) rif->update_window_begin_hook (w); yb = window_text_bottom_y (w); - - /* If window has a header line, update it before everything else. - Adjust y-positions of other rows by the header line height. */ row = desired_matrix->rows; end = row + desired_matrix->nrows - 1; + /* Take note of the header line, if there is one. We will + update it below, after updating all of the window's lines. */ if (row->mode_line_p) { header_line_row = row; @@ -3625,6 +3623,8 @@ update_window (struct window *w, int force_p) /* Update the rest of the lines. */ for (; row < end && (force_p || !input_pending); ++row) + /* scrolling_window resets the enabled_p flag of the rows it + reuses from current_matrix. */ if (row->enabled_p) { int vpos = MATRIX_ROW_VPOS (row, desired_matrix); @@ -4550,18 +4550,69 @@ scrolling_window (struct window *w, int header_line_p) { rif->clear_window_mouse_face (w); rif->scroll_run_hook (w, r); + } - /* Invalidate runs that copy from where we copied to. */ - for (j = i + 1; j < nruns; ++j) + /* Truncate runs that copy to where we copied to, and + invalidate runs that copy from where we copied to. */ + for (j = nruns - 1; j > i; --j) + { + struct run *p = runs[j]; + int truncated_p = 0; + + if (p->nrows > 0 + && p->desired_y < r->desired_y + r->height + && p->desired_y + p->height > r->desired_y) { - struct run *p = runs[j]; + if (p->desired_y < r->desired_y) + { + p->nrows = r->desired_vpos - p->desired_vpos; + p->height = r->desired_y - p->desired_y; + truncated_p = 1; + } + else + { + int nrows_copied = (r->desired_vpos + r->nrows + - p->desired_vpos); + + if (p->nrows <= nrows_copied) + p->nrows = 0; + else + { + int height_copied = (r->desired_y + r->height + - p->desired_y); + + p->current_vpos += nrows_copied; + p->desired_vpos += nrows_copied; + p->nrows -= nrows_copied; + p->current_y += height_copied; + p->desired_y += height_copied; + p->height -= height_copied; + truncated_p = 1; + } + } + } - if ((p->current_y >= r->desired_y + if (r->current_y != r->desired_y + /* The condition below is equivalent to + ((p->current_y >= r->desired_y && p->current_y < r->desired_y + r->height) - || (p->current_y + p->height >= r->desired_y + || (p->current_y + p->height > r->desired_y && (p->current_y + p->height - < r->desired_y + r->height))) - p->nrows = 0; + <= r->desired_y + r->height))) + because we have 0 < p->height <= r->height. */ + && p->current_y < r->desired_y + r->height + && p->current_y + p->height > r->desired_y) + p->nrows = 0; + + /* Reorder runs by copied pixel lines if truncated. */ + if (truncated_p && p->nrows > 0) + { + int k = nruns - 1; + + while (runs[k]->nrows == 0 || runs[k]->height < p->height) + k--; + memmove (runs + j, runs + j + 1, (k - j) * sizeof (*runs)); + runs[k] = p; } } @@ -4576,7 +4627,14 @@ scrolling_window (struct window *w, int header_line_p) to_overlapped_p = to->overlapped_p; from->redraw_fringe_bitmaps_p = from->fringe_bitmap_periodic_p; assign_row (to, from); - to->enabled_p = 1, from->enabled_p = 0; + /* The above `assign_row' actually does swap, so if we had + an overlap in the copy destination of two runs, then + the second run would assign a previously disabled bogus + row. But thanks to the truncation code in the + preceding for-loop, we no longer have such an overlap, + and thus the assigned row should always be enabled. */ + xassert (to->enabled_p); + from->enabled_p = 0; to->overlapped_p = to_overlapped_p; } } diff --git a/src/emacs.c b/src/emacs.c index a5d2f619b8c..4c8d3298495 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -154,6 +154,8 @@ Lisp_Object Qfile_name_handler_alist; Lisp_Object Qrisky_local_variable; +Lisp_Object Qkill_emacs; + /* If non-zero, Emacs should not attempt to use a window-specific code, but instead should use the virtual terminal under which it was started. */ int inhibit_window_system; @@ -2399,6 +2401,7 @@ syms_of_emacs (void) { DEFSYM (Qfile_name_handler_alist, "file-name-handler-alist"); DEFSYM (Qrisky_local_variable, "risky-local-variable"); + DEFSYM (Qkill_emacs, "kill-emacs"); #ifndef CANNOT_DUMP defsubr (&Sdump_emacs); diff --git a/src/emacsgtkfixed.c b/src/emacsgtkfixed.c index aef1ffdf783..d9084bf9a98 100644 --- a/src/emacsgtkfixed.c +++ b/src/emacsgtkfixed.c @@ -1,4 +1,4 @@ -/* A Gtk Widget that inherits GtkFixed, but can be shrinked. +/* A Gtk Widget that inherits GtkFixed, but can be shrunk. This file is only use when compiling with Gtk+ 3. Copyright (C) 2011 Free Software Foundation, Inc. diff --git a/src/emacsgtkfixed.h b/src/emacsgtkfixed.h index dbac136bd7f..c70e9a3efe3 100644 --- a/src/emacsgtkfixed.h +++ b/src/emacsgtkfixed.h @@ -1,4 +1,4 @@ -/* A Gtk Widget that inherits GtkFixed, but can be shrinked. +/* A Gtk Widget that inherits GtkFixed, but can be shrunk. This file is only use when compiling with Gtk+ 3. Copyright (C) 2011 Free Software Foundation, Inc. diff --git a/src/eval.c b/src/eval.c index c6bf2ccef1d..b604df8f35b 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1601,6 +1601,18 @@ static Lisp_Object find_handler_clause (Lisp_Object, Lisp_Object); static int maybe_call_debugger (Lisp_Object conditions, Lisp_Object sig, Lisp_Object data); +void +process_quit_flag (void) +{ + Lisp_Object flag = Vquit_flag; + Vquit_flag = Qnil; + if (EQ (flag, Qkill_emacs)) + Fkill_emacs (Qnil); + if (EQ (Vthrow_on_input, flag)) + Fthrow (Vthrow_on_input, Qt); + Fsignal (Qquit, Qnil); +} + DEFUN ("signal", Fsignal, Ssignal, 2, 2, 0, doc: /* Signal an error. Args are ERROR-SYMBOL and associated DATA. This function does not return. @@ -3701,7 +3713,7 @@ When lexical binding is not being used, this variable is nil. A value of `(t)' indicates an empty environment, otherwise it is an alist of active lexical bindings. */); Vinternal_interpreter_environment = Qnil; - /* Don't export this variable to Elisp, so noone can mess with it + /* Don't export this variable to Elisp, so no one can mess with it (Just imagine if someone makes it buffer-local). */ Funintern (Qinternal_interpreter_environment, Qnil); diff --git a/src/fileio.c b/src/fileio.c index 110977b3a60..3139e634c80 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -62,7 +62,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #ifdef DOS_NT /* On Windows, drive letters must be alphabetic - on DOS, the Netware - redirector allows the six letters between 'Z' and 'a' as well. */ + redirector allows the six letters between 'Z' and 'a' as well. */ #ifdef MSDOS #define IS_DRIVE(x) ((x) >= 'A' && (x) <= 'z') #endif @@ -70,7 +70,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #define IS_DRIVE(x) isalpha ((unsigned char) (x)) #endif /* Need to lower-case the drive letter, or else expanded - filenames will sometimes compare inequal, because + filenames will sometimes compare unequal, because `expand-file-name' doesn't always down-case the drive letter. */ #define DRIVE_LETTER(x) (tolower ((unsigned char) (x))) #endif @@ -338,7 +338,7 @@ Given a Unix syntax file name, returns a string ending in slash. */) while (p != beg && !IS_DIRECTORY_SEP (p[-1]) #ifdef DOS_NT - /* only recognise drive specifier at the beginning */ + /* only recognize drive specifier at the beginning */ && !(p[-1] == ':' /* handle the "/:d:foo" and "/:foo" cases correctly */ && ((p == beg + 2 && !IS_DIRECTORY_SEP (*beg)) @@ -401,7 +401,7 @@ or the entire name if it contains no slash. */) while (p != beg && !IS_DIRECTORY_SEP (p[-1]) #ifdef DOS_NT - /* only recognise drive specifier at beginning */ + /* only recognize drive specifier at beginning */ && !(p[-1] == ':' /* handle the "/:d:foo" case correctly */ && (p == beg + 2 || (p == beg + 4 && IS_DIRECTORY_SEP (*beg)))) @@ -1553,7 +1553,7 @@ those `/' is discarded. */) if (p) /* Start over with the new string, so we check the file-name-handler again. Important with filenames like "/home/foo//:/hello///there" - which whould substitute to "/:/hello///there" rather than "/there". */ + which would substitute to "/:/hello///there" rather than "/there". */ return Fsubstitute_in_file_name (make_specified_string (p, -1, endp - p, multibyte)); @@ -3689,6 +3689,7 @@ variable `last-coding-system-used' to the coding system actually used. */) ptrdiff_t this_count = SPECPDL_INDEX (); int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); Lisp_Object conversion_buffer; + struct gcpro gcpro1; conversion_buffer = code_conversion_save (1, multibyte); @@ -3709,7 +3710,7 @@ variable `last-coding-system-used' to the coding system actually used. */) { /* We read one bunch by one (READ_BUF_SIZE bytes) to allow quitting while reading a huge while. */ - /* try is reserved in some compilers (Microsoft C) */ + /* `try'' is reserved in some compilers (Microsoft C). */ int trytry = min (total - how_much, READ_BUF_SIZE - unprocessed); /* Allow quitting out of the actual I/O. */ @@ -4101,6 +4102,16 @@ variable `last-coding-system-used' to the coding system actually used. */) adjust_after_insert (PT, PT_BYTE, PT + inserted, PT_BYTE + inserted, inserted); + /* Call after-change hooks for the inserted text, aside from the case + of normal visiting (not with REPLACE), which is done in a new buffer + "before" the buffer is changed. */ + if (inserted > 0 && total > 0 + && (NILP (visit) || !NILP (replace))) + { + signal_after_change (PT, 0, inserted); + update_compositions (PT, PT, CHECK_BORDER); + } + /* Now INSERTED is measured in characters. */ handled: @@ -4179,7 +4190,7 @@ variable `last-coding-system-used' to the coding system actually used. */) /* If REPLACE is non-nil and we succeeded in not replacing the beginning or end of the buffer text with the file's contents, call format-decode with `point' positioned at the beginning - of the buffer and `inserted' equalling the number of + of the buffer and `inserted' equaling the number of characters in the buffer. Otherwise, format-decode might fail to correctly analyze the beginning or end of the buffer. Hence we temporarily save `point' and `inserted' here and @@ -4276,16 +4287,6 @@ variable `last-coding-system-used' to the coding system actually used. */) unbind_to (count1, Qnil); } - /* Call after-change hooks for the inserted text, aside from the case - of normal visiting (not with REPLACE), which is done in a new buffer - "before" the buffer is changed. */ - if (inserted > 0 && total > 0 - && (NILP (visit) || !NILP (replace))) - { - signal_after_change (PT, 0, inserted); - update_compositions (PT, PT, CHECK_BORDER); - } - if (!NILP (visit) && current_buffer->modtime == -1) { diff --git a/src/fns.c b/src/fns.c index 2c9559f742b..121143439e0 100644 --- a/src/fns.c +++ b/src/fns.c @@ -3245,7 +3245,7 @@ DEFUN ("base64-decode-string", Fbase64_decode_string, Sbase64_decode_string, return decoded_string; } -/* Base64-decode the data at FROM of LENGHT bytes into TO. If +/* Base64-decode the data at FROM of LENGTH bytes into TO. If MULTIBYTE is nonzero, the decoded result should be in multibyte form. If NCHARS_RETRUN is not NULL, store the number of produced characters in *NCHARS_RETURN. */ diff --git a/src/font.c b/src/font.c index cb27155f09d..64ac36d364c 100644 --- a/src/font.c +++ b/src/font.c @@ -614,7 +614,7 @@ static const struct /* Function to validate PROP's value VAL, or NULL if any value is ok. The value is VAL or its regularized value if VAL is valid, and Qerror if not. */ - Lisp_Object (*validater) (Lisp_Object prop, Lisp_Object val); + Lisp_Object (*validator) (Lisp_Object prop, Lisp_Object val); } font_property_table[] = { { &QCtype, font_prop_validate_symbol }, { &QCfoundry, font_prop_validate_symbol }, @@ -672,7 +672,7 @@ font_prop_validate (int idx, Lisp_Object prop, Lisp_Object val) if (idx < 0) return val; } - validated = (font_property_table[idx].validater) (prop, val); + validated = (font_property_table[idx].validator) (prop, val); if (EQ (validated, Qerror)) signal_error ("invalid font property", Fcons (prop, val)); return validated; @@ -825,7 +825,7 @@ font_expand_wildcards (Lisp_Object *field, int n) range_mask = (range_mask << 1) | 1; /* The triplet RANGE_FROM, RANGE_TO, and RANGE_MASK is a - position-based retriction for FIELD[I]. */ + position-based restriction for FIELD[I]. */ for (i = 0, range_from = 0, range_to = 14 - n; i < n; i++, range_from++, range_to++, range_mask <<= 1) { @@ -842,7 +842,7 @@ font_expand_wildcards (Lisp_Object *field, int n) else { /* The triplet FROM, TO, and MASK is a value-based - retriction for FIELD[I]. */ + restriction for FIELD[I]. */ int from, to; unsigned mask; @@ -3162,14 +3162,7 @@ font_find_for_lface (FRAME_PTR f, Lisp_Object *attrs, Lisp_Object spec, int c) else { Lisp_Object alters - = Fassoc_string (val, Vface_alternative_font_family_alist, - /* Font family names are case-sensitive under NS. */ -#ifndef HAVE_NS - Qt -#else - Qnil -#endif - ); + = Fassoc_string (val, Vface_alternative_font_family_alist, Qt); if (! NILP (alters)) { diff --git a/src/font.h b/src/font.h index f49f06a1fbc..72ee15c5e00 100644 --- a/src/font.h +++ b/src/font.h @@ -705,7 +705,7 @@ struct font_driver /* Chain of font drivers. There's one global font driver list - (font_driver_list in font.c). In addition, each frame has it's own + (font_driver_list in font.c). In addition, each frame has its own font driver list at FRAME_PTR->font_driver_list. */ struct font_driver_list @@ -721,7 +721,7 @@ struct font_driver_list /* Chain of arbitrary data specific to each font driver. Each frame - has it's own font data list at FRAME_PTR->font_data_list. */ + has its own font data list at FRAME_PTR->font_data_list. */ struct font_data_list { diff --git a/src/fontset.c b/src/fontset.c index ae919468695..b5b36822a2d 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -166,7 +166,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ These structures are hidden from the other codes than this file. The other codes handle fontsets only by their ID numbers. They usually use the variable name `fontset' for IDs. But, in this - file, we always use varialbe name `id' for IDs, and name `fontset' + file, we always use variable name `id' for IDs, and name `fontset' for an actual fontset object, i.e., char-table. */ @@ -633,7 +633,7 @@ fontset_find_font (Lisp_Object fontset, int c, struct face *face, int id, int fa { /* Something strange happened, perhaps because of a Font-backend problem. Too avoid crashing, record - that this spec is unsable. It may be better to find + that this spec is unusable. It may be better to find another font of the same spec, but currently we don't have such an API. */ RFONT_DEF_SET_FACE (rfont_def, -1); @@ -907,7 +907,7 @@ face_suitable_for_char_p (struct face *face, int c) /* Return ID of face suitable for displaying character C on frame F. - FACE must be reazlied for ASCII characters in advance. Called from + FACE must be realized for ASCII characters in advance. Called from the macro FACE_FOR_CHAR. */ int @@ -1348,7 +1348,7 @@ accumulate_script_ranges (Lisp_Object arg, Lisp_Object range, Lisp_Object val) In FONTSET, set FONT_DEF in a fashion specified by ADD for characters in RANGE and ranges in SCRIPT_RANGE_LIST before RANGE. - The consumed ranges are poped up from SCRIPT_RANGE_LIST, and the + The consumed ranges are popped up from SCRIPT_RANGE_LIST, and the new SCRIPT_RANGE_LIST is stored in ARG. If ASCII is nil, don't set FONT_DEF for ASCII characters. It is diff --git a/src/frame.c b/src/frame.c index dbee6a8092b..00653af74d6 100644 --- a/src/frame.c +++ b/src/frame.c @@ -374,7 +374,7 @@ make_frame (int mini_p) /* Use set_window_buffer, not Fset_window_buffer, and don't let hooks be run by it. The reason is that the whole frame/window - arrangement is not yet fully intialized at this point. Windows + arrangement is not yet fully initialized at this point. Windows don't have the right size, glyph matrices aren't initialized etc. Running Lisp functions at this point surely ends in a SEGV. */ @@ -1712,7 +1712,7 @@ If omitted, FRAME defaults to the currently selected frame. */) } /* Update the display_time slot of the buffers shown in WINDOW - and all its descendents. */ + and all its descendants. */ static void make_frame_visible_1 (Lisp_Object window) @@ -1929,7 +1929,7 @@ request a switch to FOCUS-FRAME, and `last-event-frame' will be FOCUS-FRAME after reading an event typed at FRAME. If FOCUS-FRAME is omitted or nil, any existing redirection is -cancelled, and the frame again receives its own keystrokes. +canceled, and the frame again receives its own keystrokes. Focus redirection is useful for temporarily redirecting keystrokes to a surrogate minibuffer frame when a frame doesn't have its own diff --git a/src/fringe.c b/src/fringe.c index 727547b1ab7..edc254fa3f2 100644 --- a/src/fringe.c +++ b/src/fringe.c @@ -35,7 +35,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ Logical bitmaps are used internally to denote things like 'end-of-buffer', 'left-truncation', 'overlay-arrow', etc. - Physical bitmaps specify the visual appearence of the bitmap, + Physical bitmaps specify the visual appearance of the bitmap, e.g. 'bottom-left-angle', 'left-arrow', 'left-triangle', etc. User defined bitmaps are physical bitmaps. @@ -928,7 +928,7 @@ update_window_fringes (struct window *w, int keep_current_p) int top_ind_rn, bot_ind_rn; int top_ind_min_y, bot_ind_max_y; - /* top_ind_rn is set to a nonnegative value whenver + /* top_ind_rn is set to a nonnegative value whenever row->indicate_bob_p is set, so it's OK that top_row_ends_at_zv_p is not initialized here. Similarly for bot_ind_rn, row->indicate_eob_p and bot_row_ends_at_zv_p. */ diff --git a/src/ftfont.c b/src/ftfont.c index 9da4a98d692..2f0643a31e0 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -164,6 +164,13 @@ get_adstyle_property (FcPattern *p) char *str, *end; Lisp_Object adstyle; +#ifdef FC_FONTFORMAT + if ((FcPatternGetString (p, FC_FONTFORMAT, 0, &fcstr) == FcResultMatch) + && xstrcasecmp ((char *) fcstr, "bdf") != 0 + && xstrcasecmp ((char *) fcstr, "pcf") != 0) + /* Not a BDF nor PCF font. */ + return Qnil; +#endif if (FcPatternGetString (p, FC_STYLE, 0, &fcstr) != FcResultMatch) return Qnil; str = (char *) fcstr; @@ -272,7 +279,7 @@ ftfont_pattern_entity (FcPattern *p, Lisp_Object extra) } else { - /* As this font is not scalable, parhaps this is a BDF or PCF + /* As this font is not scalable, perhaps this is a BDF or PCF font. */ FT_Face ft_face; @@ -730,7 +737,7 @@ ftfont_spec_pattern (Lisp_Object spec, char *otlayout, struct OpenTypeSpec **ots if ((n = FONT_SLANT_NUMERIC (spec)) >= 0 && n < 100) - /* Fontconfig doesn't support reverse-italic/obligue. */ + /* Fontconfig doesn't support reverse-italic/oblique. */ return NULL; if (INTEGERP (AREF (spec, FONT_DPI_INDEX))) @@ -1462,7 +1469,7 @@ ftfont_get_bitmap (struct font *font, unsigned int code, struct font_bitmap *bit : ft_face->glyph->bitmap.pixel_mode == FT_PIXEL_MODE_LCD_V ? 8 : -1); if (bitmap->bits_per_pixel < 0) - /* We don't suport that kind of pixel mode. */ + /* We don't support that kind of pixel mode. */ return -1; bitmap->rows = ft_face->glyph->bitmap.rows; bitmap->width = ft_face->glyph->bitmap.width; diff --git a/src/ftxfont.c b/src/ftxfont.c index bbba3ca8163..e04e802a3db 100644 --- a/src/ftxfont.c +++ b/src/ftxfont.c @@ -48,14 +48,14 @@ static GC *ftxfont_get_gcs (FRAME_PTR, unsigned long, unsigned long); static int ftxfont_draw_bitmap (FRAME_PTR, GC, GC *, struct font *, unsigned, int, int, XPoint *, int, int *, int); -static void ftxfont_draw_backgrond (FRAME_PTR, struct font *, GC, - int, int, int); +static void ftxfont_draw_background (FRAME_PTR, struct font *, GC, + int, int, int); struct ftxfont_frame_data { /* Background and foreground colors. */ XColor colors[2]; - /* GCs interporationg the above colors. gcs[0] is for a color + /* GCs interpolating the above colors. gcs[0] is for a color closest to BACKGROUND, and gcs[5] is for a color closest to FOREGROUND. */ GC gcs[6]; @@ -219,7 +219,8 @@ ftxfont_draw_bitmap (FRAME_PTR f, GC gc_fore, GC *gcs, struct font *font, unsign } static void -ftxfont_draw_backgrond (FRAME_PTR f, struct font *font, GC gc, int x, int y, int width) +ftxfont_draw_background (FRAME_PTR f, struct font *font, GC gc, int x, int y, + int width) { XGCValues xgcv; @@ -296,7 +297,7 @@ ftxfont_draw (struct glyph_string *s, int from, int to, int x, int y, int with_b BLOCK_INPUT; if (with_background) - ftxfont_draw_backgrond (f, font, s->gc, x, y, s->width); + ftxfont_draw_background (f, font, s->gc, x, y, s->width); code = alloca (sizeof (unsigned) * len); for (i = 0; i < len; i++) code[i] = ((XCHAR2B_BYTE1 (s->char2b + from + i) << 8) diff --git a/src/gtkutil.c b/src/gtkutil.c index 31cbd32f441..43cdb38c640 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -127,7 +127,7 @@ xg_set_screen (GtkWidget *w, FRAME_PTR f) Returns non-zero if display could be opened, zero if display could not be opened, and less than zero if the GTK version doesn't support - multipe displays. */ + multiple displays. */ void xg_display_open (char *display_name, Display **dpy) @@ -1100,6 +1100,14 @@ xg_create_frame_widgets (FRAME_PTR f) else wtop = gtk_window_new (GTK_WINDOW_TOPLEVEL); + /* gtk_window_set_has_resize_grip is a Gtk+ 3.0 function but Ubuntu + has backported it to Gtk+ 2.0 and they add the resize grip for + Gtk+ 2.0 applications also. But it has a bug that makes Emacs loop + forever, so disable the grip. */ +#if GTK_MAJOR_VERSION < 3 && defined (HAVE_GTK_WINDOW_SET_HAS_RESIZE_GRIP) + gtk_window_set_has_resize_grip (GTK_WINDOW (wtop), FALSE); +#endif + xg_set_screen (wtop, f); wvbox = gtk_vbox_new (FALSE, 0); @@ -2363,7 +2371,7 @@ xg_create_one_menuitem (widget_value *item, HIGHLIGHT_CB is the callback to call when entering/leaving menu items. POP_UP_P is non-zero if we shall create a popup menu. MENU_BAR_P is non-zero if we shall create a menu bar. - ADD_TEAROFF_P is non-zero if we shall add a teroff menu item. Ignored + ADD_TEAROFF_P is non-zero if we shall add a tearoff menu item. Ignored if MENU_BAR_P is non-zero. TOPMENU is the topmost GtkWidget that others shall be placed under. It may be NULL, in that case we create the appropriate widget @@ -4262,7 +4270,7 @@ xg_make_tool_item (FRAME_PTR f, #endif gtk_tool_item_set_homogeneous (ti, FALSE); - /* Callback to save modifyer mask (Shift/Control, etc). GTK makes + /* Callback to save modifier mask (Shift/Control, etc). GTK makes no distinction based on modifiers in the activate callback, so we have to do it ourselves. */ g_signal_connect (wb, "button-release-event", diff --git a/src/gtkutil.h b/src/gtkutil.h index 2dfb3a5ed6c..7cc2d21f9c4 100644 --- a/src/gtkutil.h +++ b/src/gtkutil.h @@ -98,7 +98,7 @@ extern GtkWidget *xg_create_widget (const char *type, struct _widget_value *val, GCallback select_cb, GCallback deactivate_cb, - GCallback hightlight_cb); + GCallback highlight_cb); extern void xg_modify_menubar_widgets (GtkWidget *menubar, FRAME_PTR f, @@ -106,7 +106,7 @@ extern void xg_modify_menubar_widgets (GtkWidget *menubar, int deep_p, GCallback select_cb, GCallback deactivate_cb, - GCallback hightlight_cb); + GCallback highlight_cb); extern int xg_update_frame_menubar (FRAME_PTR f); diff --git a/src/image.c b/src/image.c index fd842f3e347..736c1b3472f 100644 --- a/src/image.c +++ b/src/image.c @@ -7619,7 +7619,7 @@ imagemagick_load_image (struct frame *f, struct image *img, image = image_spec_value (img->spec, QCindex, NULL); ino = INTEGERP (image) ? XFASTINT (image) : 0; ping_wand = NewMagickWand (); - MagickSetResolution (ping_wand, 2, 2); + if (filename != NULL) { status = MagickPingImage (ping_wand, filename); @@ -7629,6 +7629,8 @@ imagemagick_load_image (struct frame *f, struct image *img, status = MagickPingImageBlob (ping_wand, contents, size); } + MagickSetResolution (ping_wand, 2, 2); + if (! (0 <= ino && ino < MagickGetNumberImages (ping_wand))) { image_error ("Invalid image number `%s' in image `%s'", @@ -7755,7 +7757,7 @@ imagemagick_load_image (struct frame *f, struct image *img, } /* Finally we are done manipulating the image. Figure out the - resulting width/height and transfer ownerwship to Emacs. */ + resulting width/height and transfer ownership to Emacs. */ height = MagickGetImageHeight (image_wand); width = MagickGetImageWidth (image_wand); @@ -7787,7 +7789,7 @@ imagemagick_load_image (struct frame *f, struct image *img, goto imagemagick_error; } - /* Copy imagegmagick image to x with primitive yet robust pixel + /* Copy imagemagick image to x with primitive yet robust pixel pusher loop. This has been tested a lot with many different images. */ diff --git a/src/intervals.c b/src/intervals.c index 6f8dda4294e..ecb37495a04 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -1900,7 +1900,7 @@ set_point (ptrdiff_t charpos) current buffer, and the invisible property has a `stickiness' such that inserting a character at position POS would inherit the property it, return POS + ADJ, otherwise return POS. If TEST_INTANG is non-zero, - then intangibility is required as well as invisibleness. + then intangibility is required as well as invisibility. TEST_OFFS should be either 0 or -1, and ADJ should be either 1 or -1. diff --git a/src/keyboard.c b/src/keyboard.c index 3b82c497650..aa8a9908f3b 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -464,7 +464,8 @@ static void input_available_signal (int signo); static Lisp_Object (Fcommand_execute) (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); static void handle_interrupt (void); -static void quit_throw_to_read_char (void) NO_RETURN; +static void quit_throw_to_read_char (int) NO_RETURN; +static void process_special_events (void); static void timer_start_idle (void); static void timer_stop_idle (void); static void timer_resume_idle (void); @@ -653,7 +654,7 @@ echo_now (void) echo_kboard = current_kboard; if (waiting_for_input && !NILP (Vquit_flag)) - quit_throw_to_read_char (); + quit_throw_to_read_char (0); } /* Turn off echoing, for the start of a new command. */ @@ -2998,7 +2999,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, Lisp_Object keys; ptrdiff_t key_count; int key_count_reset; - struct gcpro inner_gcpro1; + struct gcpro gcpro1; ptrdiff_t count = SPECPDL_INDEX (); /* Save the echo status. */ @@ -3026,7 +3027,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, keys = Fcopy_sequence (this_command_keys); else keys = Qnil; - GCPRO1_VAR (keys, inner_gcpro); + GCPRO1 (keys); /* Clear out this_command_keys. */ this_command_key_count = 0; @@ -3064,7 +3065,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, if (saved_immediate_echo) echo_now (); - UNGCPRO_VAR (inner_gcpro); + UNGCPRO; /* The input method can return no events. */ if (! CONSP (tem)) @@ -3817,7 +3818,7 @@ kbd_buffer_get_event (KBOARD **kbp, /* If the quit flag is set, then read_char will return quit_char, so that counts as "available input." */ if (!NILP (Vquit_flag)) - quit_throw_to_read_char (); + quit_throw_to_read_char (0); /* One way or another, wait until input is available; then, if interrupt handlers have not read it, read it now. */ @@ -4145,14 +4146,12 @@ kbd_buffer_get_event (KBOARD **kbp, return (obj); } -/* Process any events that are not user-visible, - then return, without reading any user-visible events. */ +/* Process any non-user-visible events (currently X selection events), + without reading any user-visible events. */ -void -swallow_events (int do_display) +static void +process_special_events (void) { - int old_timers_run; - while (kbd_fetch_ptr != kbd_store_ptr) { struct input_event *event; @@ -4187,6 +4186,17 @@ swallow_events (int do_display) else break; } +} + +/* Process any events that are not user-visible, run timer events that + are ripe, and return, without reading any user-visible events. */ + +void +swallow_events (int do_display) +{ + int old_timers_run; + + process_special_events (); old_timers_run = timers_run; get_input_pending (&input_pending, READABLE_EVENTS_DO_TIMERS_NOW); @@ -4813,7 +4823,7 @@ const char *const lispy_function_keys[] = "ico-00", /* VK_ICO_00 0xE4 */ 0, /* VK_PROCESSKEY 0xE5 - used by IME */ "ico-clear", /* VK_ICO_CLEAR 0xE6 */ - 0, /* VK_PACKET 0xE7 - used to pass unicode chars */ + 0, /* VK_PACKET 0xE7 - used to pass Unicode chars */ 0, /* 0xE8 */ "reset", /* VK_OEM_RESET 0xE9 */ "jump", /* VK_OEM_JUMP 0xEA */ @@ -9058,9 +9068,9 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, int junk; #endif - struct gcpro outer_gcpro1; + struct gcpro gcpro1; - GCPRO1_VAR (fake_prefixed_keys, outer_gcpro); + GCPRO1 (fake_prefixed_keys); raw_keybuf_count = 0; last_nonmenu_event = Qnil; @@ -9356,7 +9366,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, if (EQ (key, Qt)) { unbind_to (count, Qnil); - UNGCPRO_VAR (outer_gcpro); + UNGCPRO; return -1; } @@ -10054,7 +10064,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, add_command_key (keybuf[t]); } - UNGCPRO_VAR (outer_gcpro); + UNGCPRO; return t; } @@ -10142,7 +10152,7 @@ will read just one key sequence. */) ! NILP (can_return_switch_frame), 0); #if 0 /* The following is fine for code reading a key sequence and - then proceeding with a lenghty computation, but it's not good + then proceeding with a lengthy computation, but it's not good for code reading keys in a loop, like an input method. */ #ifdef HAVE_WINDOW_SYSTEM if (display_hourglass_p) @@ -10527,6 +10537,9 @@ if there is a doubt, the value is t. */) || !NILP (Vunread_input_method_events)) return (Qt); + /* Process non-user-visible events (Bug#10195). */ + process_special_events (); + get_input_pending (&input_pending, READABLE_EVENTS_DO_TIMERS_NOW | READABLE_EVENTS_FILTER_EVENTS); @@ -10829,7 +10842,7 @@ set_waiting_for_input (struct timeval *time_to_clear) /* If handle_interrupt was called before and buffered a C-g, make it run again now, to avoid timing error. */ if (!NILP (Vquit_flag)) - quit_throw_to_read_char (); + quit_throw_to_read_char (0); } void @@ -10844,7 +10857,7 @@ clear_waiting_for_input (void) If we have a frame on the controlling tty, we assume that the SIGINT was generated by C-g, so we call handle_interrupt. - Otherwise, the handler kills Emacs. */ + Otherwise, tell QUIT to kill Emacs. */ static void interrupt_signal (int signalnum) /* If we don't have an argument, some */ @@ -10861,12 +10874,10 @@ 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. We cannot do that while - GC is in progress, though. */ - if (!gc_in_progress) - Fkill_emacs (Qnil); - else - Vquit_flag = Qt; + well-behaving UN*X program and quit. We must not call Lisp + in a signal handler, so tell QUIT to exit when it is + safe. */ + Vquit_flag = Qkill_emacs; } else { @@ -11015,15 +11026,20 @@ handle_interrupt (void) separate event loop thread like W32. */ #ifndef HAVE_NS if (waiting_for_input && !echoing) - quit_throw_to_read_char (); + quit_throw_to_read_char (1); #endif } /* Handle a C-g by making read_char return C-g. */ static void -quit_throw_to_read_char (void) +quit_throw_to_read_char (int from_signal) { + /* When not called from a signal handler it is safe to call + Lisp. */ + if (!from_signal && EQ (Vquit_flag, Qkill_emacs)) + Fkill_emacs (Qnil); + sigfree (); /* Prevent another signal from doing this before we finish. */ clear_waiting_for_input (); @@ -12105,7 +12121,7 @@ This variable is keyboard-local. */); Function key definitions that apply to all terminal devices should go here. If a mapping is defined in both the current `local-function-key-map' binding and this variable, then the local -definition will take precendence. */); +definition will take precedence. */); Vfunction_key_map = Fmake_sparse_keymap (Qnil); DEFVAR_LISP ("key-translation-map", Vkey_translation_map, @@ -12250,7 +12266,7 @@ text in the region before modifying the buffer. The next DEFVAR_LISP ("debug-on-event", Vdebug_on_event, doc: /* Enter debugger on this event. When Emacs -receives the special event specifed by this variable, it will try to +receives the special event specified by this variable, it will try to break into the debugger as soon as possible instead of processing the event normally through `special-event-map'. diff --git a/src/lisp.h b/src/lisp.h index 648eb6430bd..ecc2fd16267 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -163,14 +163,23 @@ extern int suppress_checking EXTERNALLY_VISIBLE; /* First, try and define DECL_ALIGN(type,var) which declares a static variable VAR of type TYPE with the added requirement that it be TYPEBITS-aligned. */ + +#ifndef GCTYPEBITS +#define GCTYPEBITS 3 +#endif + #ifndef NO_DECL_ALIGN # ifndef DECL_ALIGN # if HAVE_ATTRIBUTE_ALIGNED # define DECL_ALIGN(type, var) \ type __attribute__ ((__aligned__ (1 << GCTYPEBITS))) var # elif defined(_MSC_VER) +# define ALIGN_GCTYPEBITS 8 +# if (1 << GCTYPEBITS) != ALIGN_GCTYPEBITS +# error ALIGN_GCTYPEBITS is wrong! +# endif # define DECL_ALIGN(type, var) \ - type __declspec(align(1 << GCTYPEBITS)) var + type __declspec(align(ALIGN_GCTYPEBITS)) var # else /* What directives do other compilers use? */ # endif @@ -300,10 +309,6 @@ enum Lisp_Fwd_Type Lisp_Fwd_Kboard_Obj, /* Fwd to a Lisp_Object field of kboards. */ }; -#ifndef GCTYPEBITS -#define GCTYPEBITS 3 -#endif - /* These values are overridden by the m- file on some machines. */ #ifndef VALBITS #define VALBITS (BITS_PER_EMACS_INT - GCTYPEBITS) @@ -324,7 +329,7 @@ union Lisp_Object struct { - /* Use explict signed, the signedness of a bit-field of type + /* Use explicit signed, the signedness of a bit-field of type int is implementation defined. */ signed EMACS_INT val : VALBITS; ENUM_BF (Lisp_Type) type : GCTYPEBITS; @@ -349,7 +354,7 @@ union Lisp_Object struct { ENUM_BF (Lisp_Type) type : GCTYPEBITS; - /* Use explict signed, the signedness of a bit-field of type + /* Use explicit signed, the signedness of a bit-field of type int is implementation defined. */ signed EMACS_INT val : VALBITS; } s; @@ -948,7 +953,7 @@ struct Lisp_Vector /* Compute A OP B, using the unsigned comparison operator OP. A and B should be integer expressions. This is not the same as - mathemeatical comparison; for example, UNSIGNED_CMP (0, <, -1) + mathematical comparison; for example, UNSIGNED_CMP (0, <, -1) returns 1. For efficiency, prefer plain unsigned comparison if A and B's sizes both fit (after integer promotion). */ #define UNSIGNED_CMP(a, op, b) \ @@ -1909,9 +1914,6 @@ typedef struct { CHECK_NATNUM (tmp); \ XSETCDR ((x), tmp); \ } while (0) - -/* Cast pointers to this type to compare them. */ -#define PNTR_COMPARISON_TYPE uintptr_t /* Define a built-in function for calling from Lisp. `lname' should be the name to give the function in Lisp, @@ -2158,7 +2160,10 @@ extern char *stack_bottom; Exception: if you set immediate_quit to nonzero, then the handler that responds to the C-g does the quit itself. This is a good thing to do around a loop that has no side effects - and (in particular) cannot call arbitrary Lisp code. */ + and (in particular) cannot call arbitrary Lisp code. + + If quit-flag is set to `kill-emacs' the SIGINT handler has received + a request to exit Emacs when it is safe to do. */ #ifdef SYNC_INPUT extern void process_pending_signals (void); @@ -2170,16 +2175,11 @@ extern int pending_signals; #define ELSE_PENDING_SIGNALS #endif /* not SYNC_INPUT */ +extern void process_quit_flag (void); #define QUIT \ do { \ if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) \ - { \ - Lisp_Object flag = Vquit_flag; \ - Vquit_flag = Qnil; \ - if (EQ (Vthrow_on_input, flag)) \ - Fthrow (Vthrow_on_input, Qt); \ - Fsignal (Qquit, Qnil); \ - } \ + process_quit_flag (); \ ELSE_PENDING_SIGNALS \ } while (0) @@ -2253,143 +2253,127 @@ struct gcpro || GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS) -#define GCPRO1(var) \ - GCPRO1_VAR (var, gcpro) -#define GCPRO2(var1, var2) \ - GCPRO2_VAR (var1, var2, gcpro) -#define GCPRO3(var1, var2, var3) \ - GCPRO3_VAR (var1, var2, var3, gcpro) -#define GCPRO4(var1, var2, var3, var4) \ - GCPRO4_VAR (var1, var2, var3, var4, gcpro) -#define GCPRO5(var1, var2, var3, var4, var5) \ - GCPRO5_VAR (var1, var2, var3, var4, var5, gcpro) -#define GCPRO6(var1, var2, var3, var4, var5, var6) \ - GCPRO6_VAR (var1, var2, var3, var4, var5, var6, gcpro) -#define UNGCPRO UNGCPRO_VAR (gcpro) - #if GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS /* Do something silly with gcproN vars just so gcc shuts up. */ /* You get warnings from MIPSPro... */ -#define GCPRO1_VAR(var, gcpro) ((void) gcpro##1) -#define GCPRO2_VAR(var1, var2, gcpro) \ - ((void) gcpro##2, (void) gcpro##1) -#define GCPRO3_VAR(var1, var2, var3, gcpro) \ - ((void) gcpro##3, (void) gcpro##2, (void) gcpro##1) -#define GCPRO4_VAR(var1, var2, var3, var4, gcpro) \ - ((void) gcpro##4, (void) gcpro##3, (void) gcpro##2, (void) gcpro##1) -#define GCPRO5_VAR(var1, var2, var3, var4, var5, gcpro) \ - ((void) gcpro##5, (void) gcpro##4, (void) gcpro##3, (void) gcpro##2, \ - (void) gcpro##1) -#define GCPRO6_VAR(var1, var2, var3, var4, var5, var6, gcpro) \ - ((void) gcpro##6, (void) gcpro##5, (void) gcpro##4, (void) gcpro##3, \ - (void) gcpro##2, (void) gcpro##1) -#define UNGCPRO_VAR(gcpro) ((void) 0) +#define GCPRO1(varname) ((void) gcpro1) +#define GCPRO2(varname1, varname2) ((void) gcpro2, (void) gcpro1) +#define GCPRO3(varname1, varname2, varname3) \ + ((void) gcpro3, (void) gcpro2, (void) gcpro1) +#define GCPRO4(varname1, varname2, varname3, varname4) \ + ((void) gcpro4, (void) gcpro3, (void) gcpro2, (void) gcpro1) +#define GCPRO5(varname1, varname2, varname3, varname4, varname5) \ + ((void) gcpro5, (void) gcpro4, (void) gcpro3, (void) gcpro2, (void) gcpro1) +#define GCPRO6(varname1, varname2, varname3, varname4, varname5, varname6) \ + ((void) gcpro6, (void) gcpro5, (void) gcpro4, (void) gcpro3, (void) gcpro2, \ + (void) gcpro1) +#define UNGCPRO ((void) 0) #else /* GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS */ #ifndef DEBUG_GCPRO -#define GCPRO1_VAR(var1, gcpro) \ - {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ - gcprolist = &gcpro##1; } - -#define GCPRO2_VAR(var1, var2, gcpro) \ - {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ - gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ - gcprolist = &gcpro##2; } - -#define GCPRO3_VAR(var1, var2, var3, gcpro) \ - {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ - gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ - gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ - gcprolist = &gcpro##3; } - -#define GCPRO4_VAR(var1, var2, var3, var4, gcpro) \ - {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ - gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ - gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ - gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ - gcprolist = &gcpro##4; } - -#define GCPRO5_VAR(var1, var2, var3, var4, var5, gcpro) \ - {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ - gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ - gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ - gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ - gcpro##5 .next = &gcpro##4; gcpro##5 .var = &var5; gcpro##5 .nvars = 1; \ - gcprolist = &gcpro##5; } - -#define GCPRO6_VAR(var1, var2, var3, var4, var5, var6, gcpro) \ - {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ - gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ - gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ - gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ - gcpro##5 .next = &gcpro##4; gcpro##5 .var = &var5; gcpro##5 .nvars = 1; \ - gcpro##6 .next = &gcpro##5; gcpro##6 .var = &var6; gcpro##6 .nvars = 1; \ - gcprolist = &gcpro##6; } - -#define UNGCPRO_VAR(gcpro) (gcprolist = gcpro##1 .next) +#define GCPRO1(varname) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname; gcpro1.nvars = 1; \ + gcprolist = &gcpro1; } + +#define GCPRO2(varname1, varname2) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcprolist = &gcpro2; } + +#define GCPRO3(varname1, varname2, varname3) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ + gcprolist = &gcpro3; } + +#define GCPRO4(varname1, varname2, varname3, varname4) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ + gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ + gcprolist = &gcpro4; } + +#define GCPRO5(varname1, varname2, varname3, varname4, varname5) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ + gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ + gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \ + gcprolist = &gcpro5; } + +#define GCPRO6(varname1, varname2, varname3, varname4, varname5, varname6) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ + gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ + gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \ + gcpro6.next = &gcpro5; gcpro6.var = &varname6; gcpro6.nvars = 1; \ + gcprolist = &gcpro6; } + +#define UNGCPRO (gcprolist = gcpro1.next) #else extern int gcpro_level; -#define GCPRO1_VAR(var1, gcpro) \ - {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ - gcpro##1 .level = gcpro_level++; \ - gcprolist = &gcpro##1; } - -#define GCPRO2_VAR(var1, var2, gcpro) \ - {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ - gcpro##1 .level = gcpro_level; \ - gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ - gcpro##2 .level = gcpro_level++; \ - gcprolist = &gcpro##2; } - -#define GCPRO3_VAR(var1, var2, var3, gcpro) \ - {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ - gcpro##1 .level = gcpro_level; \ - gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ - gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ - gcpro##3 .level = gcpro_level++; \ - gcprolist = &gcpro##3; } - -#define GCPRO4_VAR(var1, var2, var3, var4, gcpro) \ - {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ - gcpro##1 .level = gcpro_level; \ - gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ - gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ - gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ - gcpro##4 .level = gcpro_level++; \ - gcprolist = &gcpro##4; } - -#define GCPRO5_VAR(var1, var2, var3, var4, var5, gcpro) \ - {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ - gcpro##1 .level = gcpro_level; \ - gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ - gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ - gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ - gcpro##5 .next = &gcpro##4; gcpro##5 .var = &var5; gcpro##5 .nvars = 1; \ - gcpro##5 .level = gcpro_level++; \ - gcprolist = &gcpro##5; } - -#define GCPRO6_VAR(var1, var2, var3, var4, var5, var6, gcpro) \ - {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ - gcpro##1 .level = gcpro_level; \ - gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ - gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ - gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ - gcpro##5 .next = &gcpro##4; gcpro##5 .var = &var5; gcpro##5 .nvars = 1; \ - gcpro##6 .next = &gcpro##5; gcpro##6 .var = &var6; gcpro##6 .nvars = 1; \ - gcpro##6 .level = gcpro_level++; \ - gcprolist = &gcpro##6; } - -#define UNGCPRO_VAR(gcpro) \ - ((--gcpro_level != gcpro##1 .level) \ - ? (abort (), 0) \ - : ((gcprolist = gcpro##1 .next), 0)) +#define GCPRO1(varname) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname; gcpro1.nvars = 1; \ + gcpro1.level = gcpro_level++; \ + gcprolist = &gcpro1; } + +#define GCPRO2(varname1, varname2) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro1.level = gcpro_level; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro2.level = gcpro_level++; \ + gcprolist = &gcpro2; } + +#define GCPRO3(varname1, varname2, varname3) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro1.level = gcpro_level; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ + gcpro3.level = gcpro_level++; \ + gcprolist = &gcpro3; } + +#define GCPRO4(varname1, varname2, varname3, varname4) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro1.level = gcpro_level; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ + gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ + gcpro4.level = gcpro_level++; \ + gcprolist = &gcpro4; } + +#define GCPRO5(varname1, varname2, varname3, varname4, varname5) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro1.level = gcpro_level; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ + gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ + gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \ + gcpro5.level = gcpro_level++; \ + gcprolist = &gcpro5; } + +#define GCPRO6(varname1, varname2, varname3, varname4, varname5, varname6) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro1.level = gcpro_level; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ + gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ + gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \ + gcpro6.next = &gcpro5; gcpro6.var = &varname6; gcpro6.nvars = 1; \ + gcpro6.level = gcpro_level++; \ + gcprolist = &gcpro6; } + +#define UNGCPRO \ + ((--gcpro_level != gcpro1.level) \ + ? (abort (), 0) \ + : ((gcprolist = gcpro1.next), 0)) #endif /* DEBUG_GCPRO */ #endif /* GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS */ @@ -3337,6 +3321,7 @@ extern Lisp_Object Qfile_name_handler_alist; #ifdef FLOAT_CATCH_SIGILL extern void fatal_error_signal (int); #endif +extern Lisp_Object Qkill_emacs; EXFUN (Fkill_emacs, 1) NO_RETURN; #if HAVE_SETLOCALE void fixup_locale (void); diff --git a/src/lread.c b/src/lread.c index d7c5db3a02c..90bc8c11b96 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1922,7 +1922,7 @@ which is the input stream for reading characters. This function does not move point. */) (Lisp_Object start, Lisp_Object end, Lisp_Object printflag, Lisp_Object read_function) { - /* FIXME: Do the eval-sexp-add-defvars danse! */ + /* FIXME: Do the eval-sexp-add-defvars dance! */ ptrdiff_t count = SPECPDL_INDEX (); Lisp_Object tem, cbuf; @@ -3990,7 +3990,7 @@ init_obarray (void) Qnil = intern_c_string ("nil"); /* Fmake_symbol inits fields of new symbols with Qunbound and Qnil, - so those two need to be fixed manally. */ + so those two need to be fixed manually. */ SET_SYMBOL_VAL (XSYMBOL (Qunbound), Qunbound); XSYMBOL (Qunbound)->function = Qunbound; XSYMBOL (Qunbound)->plist = Qnil; @@ -4186,13 +4186,16 @@ init_lread (void) } /* Add site-lisp under the installation dir, if it exists. */ - tem = Fexpand_file_name (build_string ("site-lisp"), - Vinstallation_directory); - tem1 = Ffile_exists_p (tem); - if (!NILP (tem1)) + if (!no_site_lisp) { - if (NILP (Fmember (tem, Vload_path))) - Vload_path = Fcons (tem, Vload_path); + tem = Fexpand_file_name (build_string ("site-lisp"), + Vinstallation_directory); + tem1 = Ffile_exists_p (tem); + if (!NILP (tem1)) + { + if (NILP (Fmember (tem, Vload_path))) + Vload_path = Fcons (tem, Vload_path); + } } /* If Emacs was not built in the source directory, @@ -4228,11 +4231,14 @@ init_lread (void) if (NILP (Fmember (tem, Vload_path))) Vload_path = Fcons (tem, Vload_path); - tem = Fexpand_file_name (build_string ("site-lisp"), - Vsource_directory); + if (!no_site_lisp) + { + tem = Fexpand_file_name (build_string ("site-lisp"), + Vsource_directory); - if (NILP (Fmember (tem, Vload_path))) - Vload_path = Fcons (tem, Vload_path); + if (NILP (Fmember (tem, Vload_path))) + Vload_path = Fcons (tem, Vload_path); + } } } if (!NILP (sitelisp) && !no_site_lisp) diff --git a/src/m/ibms390.h b/src/m/ibms390.h deleted file mode 100644 index c309035dc5c..00000000000 --- a/src/m/ibms390.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Machine description file for IBM S390 in 32-bit mode - -Copyright (C) 1985-1986, 2001-2011 Free Software Foundation, Inc. - -This file is part of GNU Emacs. - -GNU Emacs is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -GNU Emacs is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ - - -/* Define VIRT_ADDR_VARIES if the virtual addresses of - pure and impure space as loaded can vary, and even their - relative order cannot be relied on. - - Otherwise Emacs assumes that text space precedes data space, - numerically. */ -#define VIRT_ADDR_VARIES diff --git a/src/m/ibms390x.h b/src/m/ibms390x.h index 04092d6e1ac..5ea7974b052 100644 --- a/src/m/ibms390x.h +++ b/src/m/ibms390x.h @@ -17,8 +17,6 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ -#include "ibms390.h" - #define BITS_PER_LONG 64 #define BITS_PER_EMACS_INT 64 diff --git a/src/m/intel386.h b/src/m/intel386.h index 16f0645715c..114b7fef963 100644 --- a/src/m/intel386.h +++ b/src/m/intel386.h @@ -19,7 +19,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #ifdef WINDOWSNT -#define VIRT_ADDR_VARIES #define DATA_START get_data_start () #endif @@ -28,4 +27,3 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ /* we cannot get the maximum address for brk */ #define ULIMIT_BREAK_VALUE (32*1024*1024) #endif - diff --git a/src/m/template.h b/src/m/template.h index 54fb0da9521..38649e8ac6d 100644 --- a/src/m/template.h +++ b/src/m/template.h @@ -21,14 +21,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ does not define it automatically. Ones defined so far include m68k and many others */ -/* Define VIRT_ADDR_VARIES if the virtual addresses of - pure and impure space as loaded can vary, and even their - relative order cannot be relied on. - - Otherwise Emacs assumes that text space precedes data space, - numerically. */ -#define VIRT_ADDR_VARIES - /* After adding support for a new machine, modify the large case statement in configure.in to recognize reasonable configuration names, and add a description of the system to diff --git a/src/minibuf.c b/src/minibuf.c index 7dd189c325b..9a4df333788 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -905,26 +905,36 @@ DEFUN ("read-from-minibuffer", Fread_from_minibuffer, The optional second arg INITIAL-CONTENTS is an obsolete alternative to DEFAULT-VALUE. It normally should be nil in new code, except when HIST is a cons. It is discussed in more detail below. + Third arg KEYMAP is a keymap to use whilst reading; if omitted or nil, the default is `minibuffer-local-map'. -If fourth arg READ is non-nil, then interpret the result as a Lisp object + +If fourth arg READ is non-nil, interpret the result as a Lisp object and return that object: in other words, do `(car (read-from-string INPUT-STRING))' + Fifth arg HIST, if non-nil, specifies a history list and optionally the initial position in the list. It can be a symbol, which is the - history list variable to use, or it can be a cons cell - (HISTVAR . HISTPOS). In that case, HISTVAR is the history list variable - to use, and HISTPOS is the initial position for use by the minibuffer - history commands. For consistency, you should also specify that - element of the history as the value of INITIAL-CONTENTS. Positions - are counted starting from 1 at the beginning of the list. -Sixth arg DEFAULT-VALUE is a default value or list of default values. - If non-nil, it is available via history commands. If READ is - non-nil, it is also the default to `read' if the user enters empty - input. If READ is non-nil, `read-from-minibuffer' does NOT return - DEFAULT-VALUE for empty input! It returns the empty string. + history list variable to use, or a cons cell (HISTVAR . HISTPOS). + In that case, HISTVAR is the history list variable to use, and + HISTPOS is the initial position for use by the minibuffer history + commands. For consistency, you should also specify that element of + the history as the value of INITIAL-CONTENTS. Positions are counted + starting from 1 at the beginning of the list. + +Sixth arg DEFAULT-VALUE, if non-nil, should be a string, which is used + as the default to `read' if READ is non-nil and the user enters + empty input. But if READ is nil, this function does _not_ return + DEFAULT-VALUE for empty input! Instead, it returns the empty string. + + Whatever the value of READ, DEFAULT-VALUE is made available via the + minibuffer history commands. DEFAULT-VALUE can also be a list of + strings, in which case all the strings are available in the history, + and the first string is the default to `read' if READ is non-nil. + Seventh arg INHERIT-INPUT-METHOD, if non-nil, means the minibuffer inherits the current input method and the setting of `enable-multibyte-characters'. + If the variable `minibuffer-allow-text-properties' is non-nil, then the string which is returned includes whatever text properties were present in the minibuffer. Otherwise the value has no text properties. diff --git a/src/msdos.c b/src/msdos.c index 6b6e365a165..64e9d72c784 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -1342,7 +1342,7 @@ static void IT_copy_glyphs (int xfrom, int xto, size_t len, int ypos) { /* The offsets of source and destination relative to the - conventional memorty selector. */ + conventional memory selector. */ int from = 2 * (xfrom + screen_size_X * ypos) + ScreenPrimary; int to = 2 * (xto + screen_size_X * ypos) + ScreenPrimary; @@ -1558,7 +1558,7 @@ IT_set_terminal_window (struct frame *f, int foo) { } -/* Remember the screen colors of the curent frame, to serve as the +/* Remember the screen colors of the current frame, to serve as the default colors for newly-created frames. */ DEFUN ("msdos-remember-default-colors", Fmsdos_remember_default_colors, Smsdos_remember_default_colors, 1, 1, 0, diff --git a/src/nsfns.m b/src/nsfns.m index f320a909497..ccefec1e34f 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -1076,7 +1076,41 @@ unwind_create_frame (Lisp_Object frame) return Qnil; } +/* + * Read geometry related parameters from preferences if not in PARMS. + * Returns the union of parms and any preferences read. + */ + +static Lisp_Object +get_geometry_from_preferences (struct ns_display_info *dpyinfo, + Lisp_Object parms) +{ + struct { + const char *val; + const char *cls; + Lisp_Object tem; + } r[] = { + { "width", "Width", Qwidth }, + { "height", "Height", Qheight }, + { "left", "Left", Qleft }, + { "top", "Top", Qtop }, + }; + + int i; + for (i = 0; i < sizeof (r)/sizeof (r[0]); ++i) + { + if (NILP (Fassq (r[i].tem, parms))) + { + Lisp_Object value + = x_get_arg (dpyinfo, parms, r[i].tem, r[i].val, r[i].cls, + RES_TYPE_NUMBER); + if (! EQ (value, Qunbound)) + parms = Fcons (Fcons (r[i].tem, value), parms); + } + } + return parms; +} /* ========================================================================== @@ -1285,6 +1319,7 @@ This function is an internal primitive--use `make-frame' instead. */) x_default_parameter (f, parms, Qtitle, Qnil, "title", "Title", RES_TYPE_STRING); + parms = get_geometry_from_preferences (dpyinfo, parms); window_prompting = x_figure_window_size (f, parms, 1); tem = x_get_arg (dpyinfo, parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN); @@ -1511,6 +1546,17 @@ Optional arg INIT, if non-nil, provides a default file name to use. */) return ret ? fname : Qnil; } +const char * +ns_get_defaults_value (const char *key) +{ + NSObject *obj = [[NSUserDefaults standardUserDefaults] + objectForKey: [NSString stringWithUTF8String: key]]; + + if (!obj) return NULL; + + return [[NSString stringWithFormat: @"%@", obj] UTF8String]; +} + DEFUN ("ns-get-resource", Fns_get_resource, Sns_get_resource, 2, 2, 0, doc: /* Return the value of the property NAME of OWNER from the defaults database. @@ -1525,9 +1571,7 @@ If OWNER is nil, Emacs is assumed. */) CHECK_STRING (name); /*fprintf (stderr, "ns-get-resource checking resource '%s'\n", SDATA (name)); */ - value =[[[NSUserDefaults standardUserDefaults] - objectForKey: [NSString stringWithUTF8String: SDATA (name)]] - UTF8String]; + value = ns_get_defaults_value (SDATA (name)); if (value) return build_string (value); @@ -2182,8 +2226,7 @@ x_get_string_resource (XrmDatabase rdb, char *name, char *class) /* --quick was passed, so this is a no-op. */ return NULL; - res = [[[NSUserDefaults standardUserDefaults] objectForKey: - [NSString stringWithUTF8String: toCheck]] UTF8String]; + res = ns_get_defaults_value (toCheck); return !res ? NULL : (!strncasecmp (res, "YES", 3) ? "true" : (!strncasecmp (res, "NO", 2) ? "false" : res)); diff --git a/src/nsfont.m b/src/nsfont.m index ca94b07a6bd..7dfb995dd27 100644 --- a/src/nsfont.m +++ b/src/nsfont.m @@ -256,7 +256,7 @@ ns_char_width (NSFont *sfont, int c) /* Return whether set1 covers set2 to a reasonable extent given by pct. - We check, out of each 16 unicode char range containing chars in set2, + We check, out of each 16 Unicode char range containing chars in set2, whether at least one character is present in set1. This must be true for pct of the pairs to consider it covering. */ static BOOL @@ -297,7 +297,7 @@ static NSString /* Convert OTF 4-letter script code to emacs script name. (Why can't - everyone just use some standard unicode names for these?) */ + everyone just use some standard Unicode names for these?) */ static NSString *ns_otf_to_script (Lisp_Object otf) { @@ -329,7 +329,7 @@ static NSString /* Searches the :script, :lang, and :otf extra-bundle properties of the spec, plus registry regular property, for something that can be mapped to a - unicode script. Empty string returned if no script spec found. */ + Unicode script. Empty string returned if no script spec found. */ static NSString *ns_get_req_script (Lisp_Object font_spec) { @@ -385,7 +385,7 @@ accumulate_script_ranges (Lisp_Object arg, Lisp_Object range, Lisp_Object val) } -/* Use the unicode range information in Vchar_script_table to convert a script +/* Use the Unicode range information in Vchar_script_table to convert a script name into an NSCharacterSet. */ static NSCharacterSet *ns_script_to_charset (NSString *scriptName) @@ -426,7 +426,7 @@ static NSCharacterSet If none are found, we reduce the percentage and try again, until 5%. This provides a font with at least some characters if such can be found. We don't use isSupersetOfSet: because (a) it doesn't work on Tiger, and - (b) need approximate match as fonts covering full unicode ranges are rare. */ + (b) need approximate match as fonts covering full Unicode ranges are rare. */ static NSSet *ns_get_covering_families (NSString *script, float pct) { @@ -1292,7 +1292,7 @@ ns_uni_to_glyphs (struct nsfont_info *font_info, unsigned char block) if (!unichars || !(font_info->glyphs[block])) abort (); - /* create a string containing all unicode characters in this block */ + /* create a string containing all Unicode characters in this block */ for (idx = block<<8, i =0; i<0x100; idx++, i++) if (idx < 0xD800 || idx > 0xDFFF) unichars[i] = idx; @@ -1487,5 +1487,5 @@ syms_of_nsfont (void) DEFSYM (Qroman, "roman"); DEFSYM (Qmedium, "medium"); DEFVAR_LISP ("ns-reg-to-script", Vns_reg_to_script, - doc: /* Internal use: maps font registry to unicode script. */); + doc: /* Internal use: maps font registry to Unicode script. */); } diff --git a/src/nsgui.h b/src/nsgui.h index 5cc2eee3230..99c64cd4cde 100644 --- a/src/nsgui.h +++ b/src/nsgui.h @@ -65,7 +65,7 @@ typedef struct _XCharStruct int descent; } XCharStruct; -/* Fake tructure from Xlib.h to represent two-byte characters. */ +/* Fake structure from Xlib.h to represent two-byte characters. */ #ifndef __OBJC__ typedef unsigned short unichar; #endif @@ -202,4 +202,3 @@ typedef struct _NSRect { NSPoint origin; NSSize size; } NSRect; #define PWinGravity (1L << 9) /* program specified window gravity */ #endif /* __NSGUI_H__ */ - diff --git a/src/nsterm.h b/src/nsterm.h index 574d31c962a..14918cca90d 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -470,7 +470,7 @@ struct nsfont_info XCharStruct max_bounds; /* we compute glyph codes and metrics on-demand in blocks of 256 indexed by hibyte, lobyte */ - unsigned short **glyphs; /* map unicode index to glyph */ + unsigned short **glyphs; /* map Unicode index to glyph */ struct font_metrics **metrics; }; @@ -760,6 +760,7 @@ extern void ns_release_object (void *obj); extern void ns_retain_object (void *obj); extern void *ns_alloc_autorelease_pool (); extern void ns_release_autorelease_pool (); +extern const char *ns_get_defaults_value (); /* in nsmenu */ extern void update_frame_tool_bar (FRAME_PTR f); @@ -794,6 +795,7 @@ extern void x_set_tool_bar_lines (struct frame *f, Lisp_Object oldval); extern void x_activate_menubar (struct frame *); extern void free_frame_menubar (struct frame *); +extern void x_free_frame_resources (struct frame *); #define NSAPP_DATA2_RUNASSCRIPT 10 extern void ns_run_ascript (void); diff --git a/src/nsterm.m b/src/nsterm.m index c5b28d57ac5..1d645943065 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -559,7 +559,7 @@ ns_constrain_all_frames (void) { NSView *view = FRAME_NS_VIEW (f); /* This no-op will trigger the default window placing - * constriant system. */ + * constraint system. */ f->output_data.ns->dont_constrain = 0; [[view window] setFrameOrigin:[[view window] frame].origin]; } @@ -2108,7 +2108,7 @@ ns_scroll_run (struct window *w, struct run *run) } else { - /* Scolling down. Make sure we don't copy over the mode line. + /* Scrolling down. Make sure we don't copy over the mode line. at the bottom. */ if (to_y + run->height > bottom_y) height = bottom_y - to_y; @@ -3075,7 +3075,7 @@ ns_dumpglyphs_image (struct glyph_string *s, NSRect r) /* If there is no mask, the background won't be seen, so draw a rectangle on the image for the cursor. - Do this for all images, getting trancparency right is not reliable. */ + Do this for all images, getting transparency right is not reliable. */ if (s->hl == DRAW_CURSOR) { int thickness = abs (s->img->relief); @@ -3824,11 +3824,9 @@ ns_default (const char *parameter, Lisp_Object *result, Check a parameter value in user's preferences -------------------------------------------------------------------------- */ { - const char *value; + const char *value = ns_get_defaults_value (parameter); - if ( (value =[[[NSUserDefaults standardUserDefaults] - stringForKey: [NSString stringWithUTF8String: parameter]] - UTF8String]) ) + if (value) { double f; char *pos; diff --git a/src/print.c b/src/print.c index f3302daaea3..b8b7ab371f6 100644 --- a/src/print.c +++ b/src/print.c @@ -1627,7 +1627,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag /* Detect circular list. */ if (NILP (Vprint_circle)) { - /* Simple but imcomplete way. */ + /* Simple but incomplete way. */ if (i != 0 && EQ (obj, halftail)) { sprintf (buf, " . #%"pMd, i / 2); diff --git a/src/process.c b/src/process.c index 71da2e17670..206af7059fb 100644 --- a/src/process.c +++ b/src/process.c @@ -1408,7 +1408,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */) val = XCDR (Vdefault_process_coding_system); } XPROCESS (proc)->encode_coding_system = val; - /* Note: At this momemnt, the above coding system may leave + /* Note: At this moment, the above coding system may leave text-conversion or eol-conversion unspecified. They will be decided after we read output from the process and decode it by some coding system, or just before we actually send a text to @@ -1515,8 +1515,9 @@ start_process_unwind (Lisp_Object proc) if (!PROCESSP (proc)) abort (); - /* Was PROC started successfully? */ - if (XPROCESS (proc)->pid == -1) + /* Was PROC started successfully? + -2 is used for a pty with no process, eg for gdb. */ + if (XPROCESS (proc)->pid <= 0 && XPROCESS (proc)->pid != -2) remove_process (proc); return Qnil; @@ -3470,7 +3471,7 @@ usage: (make-network-process &rest ARGS) */) { /* Setup coding systems for communicating with the network stream. */ - struct gcpro inner_gcpro1; + struct gcpro gcpro1; /* Qt denotes we have not yet called Ffind_operation_coding_system. */ Lisp_Object coding_systems = Qt; Lisp_Object fargs[5], val; @@ -3498,9 +3499,9 @@ usage: (make-network-process &rest ARGS) */) { fargs[0] = Qopen_network_stream, fargs[1] = name, fargs[2] = buffer, fargs[3] = host, fargs[4] = service; - GCPRO1_VAR (proc, inner_gcpro); + GCPRO1 (proc); coding_systems = Ffind_operation_coding_system (5, fargs); - UNGCPRO_VAR (inner_gcpro); + UNGCPRO; } if (CONSP (coding_systems)) val = XCAR (coding_systems); @@ -3531,9 +3532,9 @@ usage: (make-network-process &rest ARGS) */) { fargs[0] = Qopen_network_stream, fargs[1] = name, fargs[2] = buffer, fargs[3] = host, fargs[4] = service; - GCPRO1_VAR (proc, inner_gcpro); + GCPRO1 (proc); coding_systems = Ffind_operation_coding_system (5, fargs); - UNGCPRO_VAR (inner_gcpro); + UNGCPRO; } } if (CONSP (coding_systems)) @@ -3713,7 +3714,7 @@ DEFUN ("network-interface-info", Fnetwork_interface_info, Snetwork_interface_inf doc: /* Return information about network interface named IFNAME. The return value is a list (ADDR BCAST NETMASK HWADDR FLAGS), where ADDR is the layer 3 address, BCAST is the layer 3 broadcast address, -NETMASK is the layer 3 network mask, HWADDR is the layer 2 addres, and +NETMASK is the layer 3 network mask, HWADDR is the layer 2 address, and FLAGS is the current flags of the interface. */) (Lisp_Object ifname) { @@ -4606,15 +4607,46 @@ wait_reading_process_output (int time_limit, int microsecs, int read_kbd, some data in the TCP buffers so that select works, but with custom pull/push functions we need to check if some data is available in the buffers manually. */ - if (nfds == 0 && - wait_proc && wait_proc->gnutls_p /* Check for valid process. */ - /* Do we have pending data? */ - && emacs_gnutls_record_check_pending (wait_proc->gnutls_state) > 0) - { - nfds = 1; - /* Set to Available. */ - FD_SET (wait_proc->infd, &Available); - } + if (nfds == 0) + { + if (! wait_proc) + { + /* We're not waiting on a specific process, so loop + through all the channels and check for data. + This is a workaround needed for some versions of + the gnutls library -- 2.12.14 has been confirmed + to need it. See + http://comments.gmane.org/gmane.emacs.devel/145074 */ + for (channel = 0; channel < MAXDESC; ++channel) + if (! NILP (chan_process[channel])) + { + struct Lisp_Process *p = + XPROCESS (chan_process[channel]); + if (p && p->gnutls_p && p->infd + && ((emacs_gnutls_record_check_pending + (p->gnutls_state)) + > 0)) + { + nfds++; + FD_SET (p->infd, &Available); + } + } + } + else + { + /* Check this specific channel. */ + if (wait_proc->gnutls_p /* Check for valid process. */ + /* Do we have pending data? */ + && ((emacs_gnutls_record_check_pending + (wait_proc->gnutls_state)) + > 0)) + { + nfds = 1; + /* Set to Available. */ + FD_SET (wait_proc->infd, &Available); + } + } + } #endif } diff --git a/src/puresize.h b/src/puresize.h index a1b7007805b..889d836af78 100644 --- a/src/puresize.h +++ b/src/puresize.h @@ -79,21 +79,7 @@ extern void pure_write_error (void) NO_RETURN; /* Define PURE_P. */ -#ifdef VIRT_ADDR_VARIES -/* For machines where text and data can go anywhere - in virtual memory. */ - extern EMACS_INT pure[]; #define PURE_P(obj) \ - ((PNTR_COMPARISON_TYPE) XPNTR (obj) < (PNTR_COMPARISON_TYPE) ((char *) pure + PURESIZE) \ - && (PNTR_COMPARISON_TYPE) XPNTR (obj) >= (PNTR_COMPARISON_TYPE) pure) - -#else /* not VIRT_ADDR_VARIES */ - -extern char my_edata[]; - -#define PURE_P(obj) \ - ((PNTR_COMPARISON_TYPE) XPNTR (obj) < (PNTR_COMPARISON_TYPE) my_edata) - -#endif /* VIRT_ADDRESS_VARIES */ + ((uintptr_t) XPNTR (obj) - (uintptr_t) pure <= PURESIZE) diff --git a/src/regex.c b/src/regex.c index b7699378f5a..0ba05a95fdb 100644 --- a/src/regex.c +++ b/src/regex.c @@ -53,7 +53,7 @@ (HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_BTOWC && !emacs) #endif -/* For platform which support the ISO C amendement 1 functionality we +/* For platform which support the ISO C amendment 1 functionality we support user defined character classes. */ #if WIDE_CHAR_SUPPORT /* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */ diff --git a/src/regex.h b/src/regex.h index eba62f2e769..32ccfb7ddef 100644 --- a/src/regex.h +++ b/src/regex.h @@ -582,7 +582,7 @@ extern void regfree _RE_ARGS ((regex_t *__preg)); } #endif /* C++ */ -/* For platform which support the ISO C amendement 1 functionality we +/* For platform which support the ISO C amendment 1 functionality we support user defined character classes. */ #if WIDE_CHAR_SUPPORT /* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */ @@ -592,7 +592,7 @@ extern void regfree _RE_ARGS ((regex_t *__preg)); #if WIDE_CHAR_SUPPORT /* The GNU C library provides support for user-defined character classes - and the functions from ISO C amendement 1. */ + and the functions from ISO C amendment 1. */ # ifdef CHARCLASS_NAME_MAX # define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX # else diff --git a/src/s/cygwin.h b/src/s/cygwin.h index af5308ff7bb..8f5a0ab1fc7 100644 --- a/src/s/cygwin.h +++ b/src/s/cygwin.h @@ -91,9 +91,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ why it needed to be changed. */ #define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS -/* Virtual addresses of pure and impure space can vary, as on Windows. */ -#define VIRT_ADDR_VARIES - /* Emacs supplies its own malloc, but glib (part of Gtk+) calls memalign and on Cygwin, that becomes the Cygwin-supplied memalign. As malloc is not the Cygwin malloc, the Cygwin memalign always diff --git a/src/s/hpux10-20.h b/src/s/hpux10-20.h index 37199bcc29b..be457498add 100644 --- a/src/s/hpux10-20.h +++ b/src/s/hpux10-20.h @@ -100,14 +100,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ header sections which lose when `static' is defined away, as it is on HP-UX. (You get duplicate symbol errors on linking). */ #undef _FILE_OFFSET_BITS - -/* Define VIRT_ADDR_VARIES if the virtual addresses of - pure and impure space as loaded can vary, and even their - relative order cannot be relied on. - - Otherwise Emacs assumes that text space precedes data space, - numerically. */ -#define VIRT_ADDR_VARIES /* The data segment on this machine always starts at address 0x40000000. */ #define DATA_SEG_BITS 0x40000000 diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h index fb0882860d1..cc19765aba6 100644 --- a/src/s/ms-w32.h +++ b/src/s/ms-w32.h @@ -267,6 +267,8 @@ struct sigaction { #define getpid _getpid #ifdef _MSC_VER typedef int pid_t; +#define snprintf _snprintf +#define strtoll _strtoi64 #endif #define isatty _isatty #define logb _logb @@ -275,15 +277,17 @@ typedef int pid_t; #define popen _popen #define pclose _pclose #define umask _umask +#ifndef _MSC_VER #define utimbuf _utimbuf +#endif #define strdup _strdup #define strupr _strupr #define strnicmp _strnicmp #define stricmp _stricmp #define tzset _tzset -#if !defined (_MSC_VER) || (_MSC_VER < 1400) #define tzname _tzname +#if !defined (_MSC_VER) || (_MSC_VER < 1400) #undef utime #define utime _utime #endif @@ -335,7 +339,7 @@ extern char *get_emacs_configuration_options (void); #define _WINSOCK_H /* Defines size_t and alloca (). */ -#if (defined(_MSC_VER) && defined(emacs)) || defined(USE_CRT_DLL) +#ifdef emacs #define malloc e_malloc #define free e_free #define realloc e_realloc diff --git a/src/search.c b/src/search.c index df53dbf8d89..160d08e3c8c 100644 --- a/src/search.c +++ b/src/search.c @@ -83,11 +83,10 @@ static struct re_registers search_regs; Qnil if no searching has been done yet. */ static Lisp_Object last_thing_searched; -/* error condition signaled when regexp compile_pattern fails */ - +/* Error condition signaled when regexp compile_pattern fails. */ static Lisp_Object Qinvalid_regexp; -/* Error condition used for failing searches */ +/* Error condition used for failing searches. */ static Lisp_Object Qsearch_failed; static void set_search_regs (ptrdiff_t, ptrdiff_t); @@ -1893,7 +1892,7 @@ boyer_moore (EMACS_INT n, unsigned char *base_pat, || CHAR_HEAD_P (cursor[1])) && (CHAR_HEAD_P (cursor[0]) /* Check if this is the last byte of - a translable character. */ + a translatable character. */ || (translate_prev_byte1 == cursor[-1] && (CHAR_HEAD_P (translate_prev_byte1) || (translate_prev_byte2 == cursor[-2] @@ -1992,7 +1991,7 @@ boyer_moore (EMACS_INT n, unsigned char *base_pat, || CHAR_HEAD_P (ptr[1])) && (CHAR_HEAD_P (ptr[0]) /* Check if this is the last byte of a - translable character. */ + translatable character. */ || (translate_prev_byte1 == ptr[-1] && (CHAR_HEAD_P (translate_prev_byte1) || (translate_prev_byte2 == ptr[-2] @@ -2079,13 +2078,16 @@ set_search_regs (ptrdiff_t beg_byte, ptrdiff_t nbytes) XSETBUFFER (last_thing_searched, current_buffer); } -/* Given STRING, a string of words separated by word delimiters, - compute a regexp that matches those exact words separated by - arbitrary punctuation. If LAX is nonzero, the end of the string - need not match a word boundary unless it ends in whitespace. */ - -static Lisp_Object -wordify (Lisp_Object string, int lax) +DEFUN ("word-search-regexp", Fword_search_regexp, Sword_search_regexp, 1, 2, 0, + doc: /* Return a regexp which matches words, ignoring punctuation. +Given STRING, a string of words separated by word delimiters, +compute a regexp that matches those exact words separated by +arbitrary punctuation. If LAX is non-nil, the end of the string +need not match a word boundary unless it ends in whitespace. + +Used in `word-search-forward', `word-search-backward', +`word-search-forward-lax', `word-search-backward-lax'. */) + (Lisp_Object string, Lisp_Object lax) { register unsigned char *o; register ptrdiff_t i, i_byte, len, punct_count = 0, word_count = 0; @@ -2129,7 +2131,7 @@ wordify (Lisp_Object string, int lax) if (TYPE_MAXIMUM (EMACS_INT) / 5 < adjust) memory_full (SIZE_MAX); adjust = - punct_count + 5 * adjust - + ((lax && !whitespace_at_end) ? 2 : 4); + + ((!NILP (lax) && !whitespace_at_end) ? 2 : 4); if (STRING_MULTIBYTE (string)) { if (INT_ADD_OVERFLOW (SBYTES (string), adjust)) @@ -2173,7 +2175,7 @@ wordify (Lisp_Object string, int lax) prev_c = c; } - if (!lax || whitespace_at_end) + if (NILP (lax) || whitespace_at_end) { *o++ = '\\'; *o++ = 'b'; @@ -2228,10 +2230,14 @@ An optional second argument bounds the search; it is a buffer position. The match found must not extend before that position. Optional third argument, if t, means if fail just return nil (no error). If not nil and not t, move to limit of search and return nil. -Optional fourth argument is repeat count--search for successive occurrences. */) +Optional fourth argument is repeat count--search for successive occurrences. + +Relies on the function `word-search-regexp' to convert a sequence +of words in STRING to a regexp used to search words without regard +to punctuation. */) (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count) { - return search_command (wordify (string, 0), bound, noerror, count, -1, 1, 0); + return search_command (Fword_search_regexp (string, Qnil), bound, noerror, count, -1, 1, 0); } DEFUN ("word-search-forward", Fword_search_forward, Sword_search_forward, 1, 4, @@ -2242,10 +2248,14 @@ An optional second argument bounds the search; it is a buffer position. The match found must not extend after that position. Optional third argument, if t, means if fail just return nil (no error). If not nil and not t, move to limit of search and return nil. -Optional fourth argument is repeat count--search for successive occurrences. */) +Optional fourth argument is repeat count--search for successive occurrences. + +Relies on the function `word-search-regexp' to convert a sequence +of words in STRING to a regexp used to search words without regard +to punctuation. */) (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count) { - return search_command (wordify (string, 0), bound, noerror, count, 1, 1, 0); + return search_command (Fword_search_regexp (string, Qnil), bound, noerror, count, 1, 1, 0); } DEFUN ("word-search-backward-lax", Fword_search_backward_lax, Sword_search_backward_lax, 1, 4, @@ -2260,10 +2270,14 @@ An optional second argument bounds the search; it is a buffer position. The match found must not extend before that position. Optional third argument, if t, means if fail just return nil (no error). If not nil and not t, move to limit of search and return nil. -Optional fourth argument is repeat count--search for successive occurrences. */) +Optional fourth argument is repeat count--search for successive occurrences. + +Relies on the function `word-search-regexp' to convert a sequence +of words in STRING to a regexp used to search words without regard +to punctuation. */) (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count) { - return search_command (wordify (string, 1), bound, noerror, count, -1, 1, 0); + return search_command (Fword_search_regexp (string, Qt), bound, noerror, count, -1, 1, 0); } DEFUN ("word-search-forward-lax", Fword_search_forward_lax, Sword_search_forward_lax, 1, 4, @@ -2278,10 +2292,14 @@ An optional second argument bounds the search; it is a buffer position. The match found must not extend after that position. Optional third argument, if t, means if fail just return nil (no error). If not nil and not t, move to limit of search and return nil. -Optional fourth argument is repeat count--search for successive occurrences. */) +Optional fourth argument is repeat count--search for successive occurrences. + +Relies on the function `word-search-regexp' to convert a sequence +of words in STRING to a regexp used to search words without regard +to punctuation. */) (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count) { - return search_command (wordify (string, 1), bound, noerror, count, 1, 1, 0); + return search_command (Fword_search_regexp (string, Qt), bound, noerror, count, 1, 1, 0); } DEFUN ("re-search-backward", Fre_search_backward, Sre_search_backward, 1, 4, @@ -3157,7 +3175,7 @@ record_unwind_save_match_data (void) Fmatch_data (Qnil, Qnil, Qnil)); } -/* Quote a string to inactivate reg-expr chars */ +/* Quote a string to deactivate reg-expr chars */ DEFUN ("regexp-quote", Fregexp_quote, Sregexp_quote, 1, 1, 0, doc: /* Return a regexp string which matches exactly STRING and nothing else. */) @@ -3254,6 +3272,7 @@ is to bind it with `let' around a small expression. */); defsubr (&Sposix_string_match); defsubr (&Ssearch_forward); defsubr (&Ssearch_backward); + defsubr (&Sword_search_regexp); defsubr (&Sword_search_forward); defsubr (&Sword_search_backward); defsubr (&Sword_search_forward_lax); diff --git a/src/sound.c b/src/sound.c index 9e15caae3ea..af9dc98c3d3 100644 --- a/src/sound.c +++ b/src/sound.c @@ -267,7 +267,7 @@ struct sound read from the start of a sound file. */ char *header; - /* Number of bytes raed from sound file. This is always <= + /* Number of bytes read from sound file. This is always <= MAX_SOUND_HEADER_BYTES. */ int header_size; diff --git a/src/sysdep.c b/src/sysdep.c index 9b4bd088046..bd8a1020441 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -433,7 +433,7 @@ child_setup_tty (int out) #endif /* AIX */ /* We originally enabled ICANON (and set VEOF to 04), and then had - proces.c send additional EOF chars to flush the output when faced + process.c send additional EOF chars to flush the output when faced with long lines, but this leads to weird effects when the subprocess has disabled ICANON and ends up seeing those spurious extra EOFs. So we don't send EOFs any more in @@ -1663,7 +1663,7 @@ init_signals (void) sys_siglist[SIGQUIT] = "Quit"; # endif # ifdef SIGRETRACT - sys_siglist[SIGRETRACT] = "Need to relinguish monitor mode"; + sys_siglist[SIGRETRACT] = "Need to relinquish monitor mode"; # endif # ifdef SIGSAK sys_siglist[SIGSAK] = "Secure attention"; diff --git a/src/term.c b/src/term.c index fb3166a6e50..036f5797e48 100644 --- a/src/term.c +++ b/src/term.c @@ -3234,7 +3234,7 @@ use the Bourne shell command `TERM=... export TERM' (C-shell:\n\ MultiLeft (tty) = tgetstr ("LE", address); MultiRight (tty) = tgetstr ("RI", address); - /* SVr4/ANSI color suppert. If "op" isn't available, don't support + /* SVr4/ANSI color support. If "op" isn't available, don't support color because we can't switch back to the default foreground and background. */ tty->TS_orig_pair = tgetstr ("op", address); diff --git a/src/textprop.c b/src/textprop.c index a877e2a67ae..1a635444b00 100644 --- a/src/textprop.c +++ b/src/textprop.c @@ -1625,7 +1625,7 @@ Return t if any property was actually removed, nil otherwise. */) DEFUN ("text-property-any", Ftext_property_any, Stext_property_any, 4, 5, 0, - doc: /* Check text from START to END for property PROPERTY equalling VALUE. + doc: /* Check text from START to END for property PROPERTY equaling VALUE. If so, return the position of the first character whose property PROPERTY is `eq' to VALUE. Otherwise return nil. If the optional fifth argument OBJECT is a buffer (or nil, which means @@ -1661,7 +1661,7 @@ markers). If OBJECT is a string, START and END are 0-based indices into it. */ DEFUN ("text-property-not-all", Ftext_property_not_all, Stext_property_not_all, 4, 5, 0, - doc: /* Check text from START to END for property PROPERTY not equalling VALUE. + doc: /* Check text from START to END for property PROPERTY not equaling VALUE. If so, return the position of the first character whose property PROPERTY is not `eq' to VALUE. Otherwise, return nil. If the optional fifth argument OBJECT is a buffer (or nil, which means diff --git a/src/unexelf.c b/src/unexelf.c index 04c029f7e80..1715c3670ca 100644 --- a/src/unexelf.c +++ b/src/unexelf.c @@ -1219,9 +1219,15 @@ temacs: nn = symp->st_shndx; if (nn > old_bss_index) nn--; - old = ((symp->st_value - NEW_SECTION_H (symp->st_shndx).sh_addr) - + OLD_SECTION_H (nn).sh_offset + old_base); - memcpy (new, old, symp->st_size); + if (nn == old_bss_index) + memset (new, 0, symp->st_size); + else + { + old = ((symp->st_value + - NEW_SECTION_H (symp->st_shndx).sh_addr) + + OLD_SECTION_H (nn).sh_offset + old_base); + memcpy (new, old, symp->st_size); + } } #endif } diff --git a/src/w32.c b/src/w32.c index b2b47dbd179..b26327462d8 100644 --- a/src/w32.c +++ b/src/w32.c @@ -1654,6 +1654,24 @@ init_environment (char ** argv) } } + /* When Emacs is invoked with --no-site-lisp, we must remove the + site-lisp directories from the default value of EMACSLOADPATH. + This assumes that the site-lisp entries are at the front, and + that additional entries do exist. */ + if (no_site_lisp) + { + for (i = 0; i < N_ENV_VARS; i++) + { + if (strcmp (env_vars[i].name, "EMACSLOADPATH") == 0) + { + char *site; + while ((site = strstr (env_vars[i].def_value, "site-lisp"))) + env_vars[i].def_value = strchr (site, ';') + 1; + break; + } + } + } + #define SET_ENV_BUF_SIZE (4 * MAX_PATH) /* to cover EMACSLOADPATH */ /* Treat emacs_dir specially: set it unconditionally based on our @@ -3057,7 +3075,7 @@ generate_inode_val (const char * name) unsigned hash; /* Get the truly canonical filename, if it exists. (Note: this - doesn't resolve aliasing due to subst commands, or recognise hard + doesn't resolve aliasing due to subst commands, or recognize hard links. */ if (!w32_get_long_filename ((char *)name, fullname, MAX_PATH)) abort (); @@ -5845,7 +5863,7 @@ term_ntproc (void) void init_ntproc (void) { - /* Initialise the socket interface now if available and requested by + /* Initialize the socket interface now if available and requested by the user by defining PRELOAD_WINSOCK; otherwise loading will be delayed until open-network-stream is called (w32-has-winsock can also be used to dynamically load or reload winsock). diff --git a/src/w32console.c b/src/w32console.c index 49bf56ddee9..30c71f1c276 100644 --- a/src/w32console.c +++ b/src/w32console.c @@ -748,7 +748,7 @@ syms_of_ntterm (void) doc: /* Non-nil means make terminal frames use the full screen buffer dimensions. This is desirable when running Emacs over telnet. A value of nil means use the current console window dimensions; this -may be preferrable when working directly at the console with a large +may be preferable when working directly at the console with a large scroll-back buffer. */); w32_use_full_screen_buffer = 0; @@ -757,4 +757,3 @@ scroll-back buffer. */); defsubr (&Sset_cursor_size); defsubr (&Sset_message_beep); } - diff --git a/src/w32fns.c b/src/w32fns.c index aa4650dd7b2..20284108185 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -2262,7 +2262,7 @@ w32_msg_pump (deferred_msg * msg_buf) some third party shell extensions can cause it to be used in system dialogs, which causes a crash if it is not initialized. This is a known bug in Windows, which was fixed long ago, but - the patch for XP is not publically available until XP SP3, + the patch for XP is not publicly available until XP SP3, and older versions will never be patched. */ CoInitialize (NULL); w32_createwindow ((struct frame *) msg.wParam); @@ -2417,7 +2417,7 @@ complete_deferred_msg (HWND hwnd, UINT msg, LRESULT result) deferred_msg * msg_buf = find_deferred_msg (hwnd, msg); if (msg_buf == NULL) - /* Message may have been cancelled, so don't abort. */ + /* Message may have been canceled, so don't abort. */ return; msg_buf->result = result; @@ -2538,7 +2538,7 @@ post_character_message (HWND hwnd, UINT msg, the lisp thread to respond. Note that we don't want to block the input thread waiting for - a reponse from the lisp thread (although that would at least + a response from the lisp thread (although that would at least solve the deadlock problem above), because we want to be able to receive C-g to interrupt the lisp thread. */ cancel_all_deferred_msgs (); @@ -2880,7 +2880,7 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) key.dwControlKeyState = modifiers; add = w32_kbd_patch_key (&key); - /* 0 means an unrecognised keycode, negative means + /* 0 means an unrecognized keycode, negative means dead key. Ignore both. */ while (--add >= 0) { @@ -2943,7 +2943,7 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) break; case WM_IME_CHAR: - /* If we can't get the IME result as unicode, use default processing, + /* If we can't get the IME result as Unicode, use default processing, which will at least allow characters decodable in the system locale get through. */ if (!get_composition_string_fn) @@ -3711,7 +3711,7 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) if (w32_system_caret_hwnd == NULL) { /* Use the default caret width, and avoid changing it - unneccesarily, as it confuses screen reader software. */ + unnecessarily, as it confuses screen reader software. */ w32_system_caret_hwnd = hwnd; CreateCaret (hwnd, NULL, 0, w32_system_caret_height); @@ -3749,7 +3749,7 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) flags |= TPM_RIGHTBUTTON; /* Remember we did a SetCapture on the initial mouse down event, - so for safety, we make sure the capture is cancelled now. */ + so for safety, we make sure the capture is canceled now. */ ReleaseCapture (); button_state = 0; @@ -4951,7 +4951,7 @@ If TYPE is nil or omitted, get the property as a string. Otherwise TYPE is the name of the atom that denotes the type expected. If SOURCE is non-nil, get the property on that window instead of from FRAME. The number 0 denotes the root window. -If DELETE_P is non-nil, delete the property after retreiving it. +If DELETE_P is non-nil, delete the property after retrieving it. If VECTOR_RET_P is non-nil, don't return a string but a vector of values. Value is nil if FRAME hasn't a property with name PROP or if PROP has @@ -5011,7 +5011,8 @@ no value of TYPE (always string in the MS Windows case). */) cursor. Duplicated from xdisp.c, but cannot use the version there due to lack of atimers on w32. */ #define DEFAULT_HOURGLASS_DELAY 1 -/* Return non-zero if houglass timer has been started or hourglass is shown. */ +/* Return non-zero if hourglass timer has been started or hourglass is + shown. */ /* PENDING: if W32 can use atimers (atimer.[hc]) then the common impl in xdisp.c could be used. */ @@ -6031,7 +6032,7 @@ Otherwise, if ONLY-DIR-P is non-nil, the user can only select directories. */) file = DECODE_FILE (build_string (filename)); } - /* User cancelled the dialog without making a selection. */ + /* User canceled the dialog without making a selection. */ else if (!CommDlgExtendedError ()) file = Qnil; /* An error occurred, fallback on reading from the mini-buffer. */ diff --git a/src/w32font.c b/src/w32font.c index bd58e7e757b..5cc37c0e74f 100644 --- a/src/w32font.c +++ b/src/w32font.c @@ -462,7 +462,7 @@ w32font_has_char (Lisp_Object entity, int c) Return a glyph code of FONT for character C (Unicode code point). If FONT doesn't have such a glyph, return FONT_INVALID_CODE. - For speed, the gdi backend uses unicode (Emacs calls encode_char + For speed, the gdi backend uses Unicode (Emacs calls encode_char far too often for it to be efficient). But we still need to detect which characters are not supported by the font. */ @@ -620,7 +620,7 @@ w32font_text_extents (struct font *font, unsigned *code, total_width = size.cx; } - /* On 95/98/ME, only some unicode functions are available, so fallback + /* On 95/98/ME, only some Unicode functions are available, so fallback on doing a dummy draw to find the total width. */ if (!total_width) { @@ -1153,7 +1153,7 @@ w32_enumfont_pattern_entity (Lisp_Object frame, else ASET (entity, FONT_SIZE_INDEX, make_number (0)); - /* Cache unicode codepoints covered by this font, as there is no other way + /* Cache Unicode codepoints covered by this font, as there is no other way of getting this information easily. */ if (font_type & TRUETYPE_FONTTYPE) { @@ -1514,7 +1514,7 @@ add_font_entity_to_list (ENUMLOGFONTEX *logical_font, /* Skip non matching fonts. */ /* For uniscribe backend, consider only truetype or opentype fonts - that have some unicode coverage. */ + that have some Unicode coverage. */ if (match_data->opentype_only && ((!(physical_font->ntmTm.ntmFlags & NTMFLAGS_OPENTYPE) && !(font_type & TRUETYPE_FONTTYPE)) @@ -1557,7 +1557,7 @@ add_font_entity_to_list (ENUMLOGFONTEX *logical_font, Lisp_Object spec_charset = AREF (match_data->orig_font_spec, FONT_REGISTRY_INDEX); - /* iso10646-1 fonts must contain unicode mapping tables. */ + /* iso10646-1 fonts must contain Unicode mapping tables. */ if (EQ (spec_charset, Qiso10646_1)) { if (!is_unicode) @@ -1572,7 +1572,7 @@ add_font_entity_to_list (ENUMLOGFONTEX *logical_font, && !(physical_font->ntmFontSig.fsUsb[0] & 0x007F001F)) return 1; } - /* unicode-sip fonts must contain characters in unicode plane 2. + /* unicode-sip fonts must contain characters in Unicode plane 2. so look for bit 57 (surrogates) in the Unicode subranges, plus the bits for CJK ranges that include those characters. */ else if (EQ (spec_charset, Qunicode_sip)) @@ -1597,7 +1597,7 @@ add_font_entity_to_list (ENUMLOGFONTEX *logical_font, ASET (entity, FONT_REGISTRY_INDEX, spec_charset); } /* Otherwise if using the uniscribe backend, report ANSI and DEFAULT - fonts as unicode and skip other charsets. */ + fonts as Unicode and skip other charsets. */ else if (match_data->opentype_only) { if (logical_font->elfLogFont.lfCharSet == ANSI_CHARSET @@ -1640,7 +1640,7 @@ x_to_w32_charset (char * lpcs) if (strncmp (lpcs, "*-#", 3) == 0) return atoi (lpcs + 3); - /* All Windows fonts qualify as unicode. */ + /* All Windows fonts qualify as Unicode. */ if (!strncmp (lpcs, "iso10646", 8)) return DEFAULT_CHARSET; @@ -1925,7 +1925,7 @@ w32_registry (LONG w32_charset, DWORD font_type) { char *charset; - /* If charset is defaulted, charset is unicode or unknown, depending on + /* If charset is defaulted, charset is Unicode or unknown, depending on font type. */ if (w32_charset == DEFAULT_CHARSET) return font_type == TRUETYPE_FONTTYPE ? Qiso10646_1 : Qunknown; @@ -2080,7 +2080,7 @@ fill_in_logfont (FRAME_PTR f, LOGFONT *logfont, Lisp_Object font_spec) { Lisp_Object key, val; key = XCAR (tmp), val = XCDR (tmp); - /* Only use QCscript if charset is not provided, or is unicode + /* Only use QCscript if charset is not provided, or is Unicode and a single script is specified. This is rather crude, and is only used to narrow down the fonts returned where there is a definite match. Some scripts, such as latin, han, diff --git a/src/w32menu.c b/src/w32menu.c index 93194b68018..369b75877e8 100644 --- a/src/w32menu.c +++ b/src/w32menu.c @@ -1219,7 +1219,7 @@ simple_dialog_show (FRAME_PTR f, Lisp_Object contents, Lisp_Object header) is_simple_dialog, we don't need to worry about checking contents to see what type of dialog to use. */ - /* Use unicode if possible, so any language can be displayed. */ + /* Use Unicode if possible, so any language can be displayed. */ if (unicode_message_box) { WCHAR *text, *title; @@ -1476,7 +1476,7 @@ add_menu_item (HMENU menu, widget_value *wv, HMENU item) utf16_string); if (!return_value) { - /* On W9x/ME, unicode menus are not supported, though AppendMenuW + /* On W9x/ME, Unicode menus are not supported, though AppendMenuW apparently does exist at least in some cases and appears to be stubbed out to do nothing. out_string is UTF-8, but since our standard menus are in English and this is only going to @@ -1486,7 +1486,7 @@ add_menu_item (HMENU menu, widget_value *wv, HMENU item) AppendMenu (menu, fuFlags, item != NULL ? (UINT) item: (UINT) wv->call_data, out_string); - /* Don't use unicode menus in future. */ + /* Don't use Unicode menus in future. */ unicode_append_menu = NULL; } diff --git a/src/w32proc.c b/src/w32proc.c index 279816bcc3e..254a32503c4 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -122,12 +122,12 @@ new_child (void) for (cp = child_procs + (child_proc_count-1); cp >= child_procs; cp--) if (!CHILD_ACTIVE (cp)) - goto Initialise; + goto Initialize; if (child_proc_count == MAX_CHILDREN) return NULL; cp = &child_procs[child_proc_count++]; - Initialise: + Initialize: memset (cp, 0, sizeof (*cp)); cp->fd = -1; cp->pid = -1; @@ -821,7 +821,7 @@ sys_spawnve (int mode, char *cmdname, char **argv, char **envp) The w32 GNU-based library from Cygnus doubles quotes to escape them, while MSVC uses backslash for escaping. (Actually the MSVC - startup code does attempt to recognise doubled quotes and accept + startup code does attempt to recognize doubled quotes and accept them, but gets it wrong and ends up requiring three quotes to get a single embedded quote!) So by default we decide whether to use quote or backslash as the escape character based on whether the diff --git a/src/w32select.c b/src/w32select.c index e3225c3f996..392cb07a96d 100644 --- a/src/w32select.c +++ b/src/w32select.c @@ -39,7 +39,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ * * When copying or cutting (sending data to the OS), the data is * announced and stored internally, but only actually rendered on - * request. The requester determines the format provided. The + * request. The requestor determines the format provided. The * {next-}selection-coding-system is only used, when its corresponding * clipboard type matches the type requested. * @@ -335,7 +335,7 @@ render_all (Lisp_Object ignore) OpenClipboard (NULL); - /* There is no usefull means to report errors here, there are none + /* There is no useful means to report errors here, there are none expected anyway, and even if there were errors, they wouldn't do any harm. So we just go ahead and do what has to be done without bothering with error handling. */ @@ -750,7 +750,7 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data, else { /* Advertise all supported formats so that whatever the - requester chooses, only one encoding step needs to be + requestor chooses, only one encoding step needs to be made. This is intentionally different from what we do in the handler for WM_RENDERALLFORMATS. */ SetClipboardData (CF_UNICODETEXT, NULL); @@ -1138,4 +1138,3 @@ globals_of_w32select (void) clipboard_owner = create_owner (); } - diff --git a/src/w32term.c b/src/w32term.c index e9fa16ba325..6df218326d1 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -2665,7 +2665,7 @@ x_scroll_run (struct window *w, struct run *run) } else { - /* Scolling down. Make sure we don't copy over the mode line. + /* Scrolling down. Make sure we don't copy over the mode line. at the bottom. */ if (to_y + run->height > bottom_y) height = bottom_y - to_y; @@ -4506,7 +4506,7 @@ w32_read_socket (struct terminal *terminal, int expected, } /* If window has been obscured or exposed by another window - being maximised or minimised/restored, then recheck + being maximized or minimized/restored, then recheck visibility of all frames. Direct changes to our own windows get handled by WM_SIZE. */ #if 0 @@ -5576,7 +5576,7 @@ x_raise_frame (struct frame *f) input focus anyway (so the window with focus will never be completely obscured) - if not, then just moving the mouse over it is sufficient to give it focus. On Windows, the user must actually - click on the frame (preferrably the title bar so as not to move + click on the frame (preferably the title bar so as not to move point), which is more awkward. Also, no other Windows program raises a window to the top but leaves another window (possibly now completely obscured) with input focus. @@ -5692,10 +5692,10 @@ x_make_frame_visible (struct frame *f) /* 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 + previously maximized. 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 + is only set for minimized 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_SHOWNORMAL); @@ -6164,7 +6164,7 @@ w32_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) dpyinfo->has_palette = GetDeviceCaps (hdc, RASTERCAPS) & RC_PALETTE; ReleaseDC (NULL, hdc); - /* initialise palette with white and black */ + /* initialize palette with white and black */ { XColor color; w32_defined_color (0, "white", &color, 1); diff --git a/src/w32term.h b/src/w32term.h index 02392133837..f587ee11af9 100644 --- a/src/w32term.h +++ b/src/w32term.h @@ -209,7 +209,7 @@ extern int x_display_pixel_width (struct w32_display_info *); the information that is specific to W32 windows. */ /* Put some things in x_output for compatibility. - NTEMACS_TODO: Move all common things here to eliminate unneccesary + NTEMACS_TODO: Move all common things here to eliminate unnecessary diffs between X and w32 code. */ struct x_output { @@ -229,7 +229,7 @@ enum { /* Values for focus_state, used as bit mask. EXPLICIT means we received a FocusIn for the frame and know it has - the focus. IMPLICIT means we recevied an EnterNotify and the frame + the focus. IMPLICIT means we received an EnterNotify and the frame may have the focus if no window manager is running. FocusOut and LeaveNotify clears EXPLICIT/IMPLICIT. */ FOCUS_NONE = 0, diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c index 36197b3b28a..63da3b9e962 100644 --- a/src/w32uniscribe.c +++ b/src/w32uniscribe.c @@ -469,7 +469,7 @@ uniscribe_encode_char (struct font *font, int c) /* Non BMP characters must be handled by the uniscribe shaping engine as GDI functions (except blindly displaying lines of - unicode text) and the promising looking ScriptGetCMap do not + Unicode text) and the promising looking ScriptGetCMap do not convert surrogate pairs to glyph indexes correctly. */ { items = (SCRIPT_ITEM *) alloca (sizeof (SCRIPT_ITEM) * 2 + 1); @@ -581,7 +581,7 @@ add_opentype_font_name_to_list (ENUMLOGFONTEX *logical_font, && font_type != TRUETYPE_FONTTYPE) return 1; - /* Skip fonts that have no unicode coverage. */ + /* Skip fonts that have no Unicode coverage. */ if (!physical_font->ntmFontSig.fsUsb[3] && !physical_font->ntmFontSig.fsUsb[2] && !physical_font->ntmFontSig.fsUsb[1] diff --git a/src/w32xfns.c b/src/w32xfns.c index fbbf11bd65c..fc2d5904d67 100644 --- a/src/w32xfns.c +++ b/src/w32xfns.c @@ -188,7 +188,7 @@ get_next_msg (W32Msg * lpmsg, BOOL bWait) } nQueue--; - /* Consolidate WM_PAINT messages to optimise redrawing. */ + /* Consolidate WM_PAINT messages to optimize redrawing. */ if (lpmsg->msg.message == WM_PAINT && nQueue) { int_msg * lpCur = lpHead; @@ -441,4 +441,3 @@ void x_sync (void *f) { } - diff --git a/src/widget.c b/src/widget.c index 0582718948d..96bfd4787e9 100644 --- a/src/widget.c +++ b/src/widget.c @@ -476,6 +476,9 @@ update_wm_hints (EmacsFrame ew) int base_height; int min_rows = 0, min_cols = 0; + /* This happens when the frame is just created. */ + if (! wmshell) return; + #if 0 check_frame_size (ew->emacs_frame.frame, &min_rows, &min_cols); #endif @@ -506,6 +509,14 @@ update_wm_hints (EmacsFrame ew) NULL); } +void +widget_update_wm_size_hints (Widget widget) +{ + EmacsFrame ew = (EmacsFrame)widget; + update_wm_hints (ew); +} + + #if 0 static void @@ -808,7 +819,7 @@ EmacsFrameQueryGeometry (Widget widget, XtWidgetGeometry *request, XtWidgetGeome return result->request_mode ? XtGeometryAlmost : XtGeometryYes; } -/* Special entrypoints */ +/* Special entry points */ void EmacsFrameSetCharSize (Widget widget, int columns, int rows) { diff --git a/src/widget.h b/src/widget.h index f64f188e158..11041d54ad0 100644 --- a/src/widget.h +++ b/src/widget.h @@ -92,9 +92,9 @@ extern WidgetClass emacsFrameClass; extern struct _DisplayContext* display_context; -/* Special entrypoints */ +/* Special entry points */ void EmacsFrameSetCharSize (Widget, int, int); void widget_store_internal_border (Widget widget); +void widget_update_wm_size_hints (Widget widget); #endif /* _EmacsFrame_h */ - diff --git a/src/window.c b/src/window.c index 60d17c74de3..3b9705444f9 100644 --- a/src/window.c +++ b/src/window.c @@ -465,10 +465,8 @@ Return nil if WINDOW has no previous sibling. */) return decode_any_window (window)->prev; } -DEFUN ("window-combination-limit", Fwindow_combination_limit, Swindow_combination_limit, 0, 1, 0, +DEFUN ("window-combination-limit", Fwindow_combination_limit, Swindow_combination_limit, 1, 1, 0, doc: /* Return combination limit of window WINDOW. -If WINDOW is omitted or nil, it defaults to the selected window. - 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. */) @@ -478,18 +476,16 @@ WINDOW are never \(re-)combined with WINDOW's siblings. */) } 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, child windows of WINDOW can be recombined with -WINDOW's siblings. STATUS t means that child windows of WINDOW are + doc: /* Set combination limit of window WINDOW to LIMIT; return LIMIT. +If LIMIT is nil, child windows of WINDOW can be recombined with +WINDOW's siblings. LIMIT 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) + (Lisp_Object window, Lisp_Object limit) { register struct window *w = decode_any_window (window); - w->combination_limit = status; + w->combination_limit = limit; return w->combination_limit; } @@ -1056,6 +1052,7 @@ window_relative_x_coord (struct window *w, enum window_part part, int x) DEFUN ("coordinates-in-window-p", Fcoordinates_in_window_p, Scoordinates_in_window_p, 2, 2, 0, doc: /* Return non-nil if COORDINATES are in WINDOW. +WINDOW must be a live window. COORDINATES is a cons of the form (X . Y), X and Y being distances measured in characters from the upper-left corner of the frame. \(0 . 0) denotes the character in the upper left corner of the @@ -1077,7 +1074,7 @@ If they are in the windows's left or right marginal areas, `left-margin'\n\ int x, y; Lisp_Object lx, ly; - CHECK_WINDOW (window); + CHECK_LIVE_WINDOW (window); w = XWINDOW (window); f = XFRAME (w->frame); CHECK_CONS (coordinates); @@ -2186,7 +2183,7 @@ next_window (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames, in DEFUN ("next-window", Fnext_window, Snext_window, 0, 3, 0, - doc: /* Return window following WINDOW in cyclic ordering of windows. + doc: /* Return live window after WINDOW in the cyclic ordering of windows. WINDOW must be a live window and defaults to the selected one. The optional arguments MINIBUF and ALL-FRAMES specify the set of windows to consider. @@ -2225,7 +2222,7 @@ windows, eventually ending up back at the window you started with. DEFUN ("previous-window", Fprevious_window, Sprevious_window, 0, 3, 0, - doc: /* Return window preceding WINDOW in cyclic ordering of windows. + doc: /* Return live window before WINDOW in the cyclic ordering of windows. WINDOW must be a live window and defaults to the selected one. The optional arguments MINIBUF and ALL-FRAMES specify the set of windows to consider. @@ -3092,7 +3089,7 @@ This function runs `window-scroll-functions' before running error ("Window is dedicated to `%s'", SDATA (BVAR (XBUFFER (tem), name))); else /* WINDOW is weakly dedicated to its buffer, reset - dedicatedness. */ + dedication. */ w->dedicated = Qnil; call1 (Qrecord_window_buffer, window); @@ -5772,20 +5769,37 @@ get_leaf_windows (struct window *w, struct window **flat, int i) /* Return a pointer to the glyph W's physical cursor is on. Value is - null if W's current matrix is invalid, so that no meaningfull glyph + null if W's current matrix is invalid, so that no meaningful glyph can be returned. */ struct glyph * get_phys_cursor_glyph (struct window *w) { struct glyph_row *row; struct glyph *glyph; + int hpos = w->phys_cursor.hpos; + + if (!(w->phys_cursor.vpos >= 0 + && w->phys_cursor.vpos < w->current_matrix->nrows)) + return NULL; + + row = MATRIX_ROW (w->current_matrix, w->phys_cursor.vpos); + if (!row->enabled_p) + return NULL; + + if (XINT (w->hscroll)) + { + /* When the window is hscrolled, cursor hpos can legitimately be + out of bounds, but we draw the cursor at the corresponding + window margin in that case. */ + if (!row->reversed_p && hpos < 0) + hpos = 0; + if (row->reversed_p && hpos >= row->used[TEXT_AREA]) + hpos = row->used[TEXT_AREA] - 1; + } - if (w->phys_cursor.vpos >= 0 - && w->phys_cursor.vpos < w->current_matrix->nrows - && (row = MATRIX_ROW (w->current_matrix, w->phys_cursor.vpos), - row->enabled_p) - && row->used[TEXT_AREA] > w->phys_cursor.hpos) - glyph = row->glyphs[TEXT_AREA] + w->phys_cursor.hpos; + if (row->used[TEXT_AREA] > hpos + && 0 <= hpos) + glyph = row->glyphs[TEXT_AREA] + hpos; else glyph = NULL; @@ -6287,7 +6301,7 @@ freeze_window_starts (struct frame *f, int freeze_p) ignore_positions non-zero means ignore non-matching scroll positions and the like. - This ignores a couple of things like the dedicatedness status of + This ignores a couple of things like the dedication status of window, combination_limit and the like. This might have to be fixed. */ @@ -6521,10 +6535,10 @@ sibling. Other values are reserved for future use. -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'. */); +The value of this variable is also assigned to the combination limit of +the new parent window. The combination limit 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); diff --git a/src/window.h b/src/window.h index de0f7307a51..b4e268b1a34 100644 --- a/src/window.h +++ b/src/window.h @@ -268,7 +268,7 @@ struct window /* List of buffers re-shown in this window. */ Lisp_Object next_buffers; - /* An alist with parameteres. */ + /* An alist with parameters. */ Lisp_Object window_parameters; /* No Lisp data may follow below this point without changing @@ -877,7 +877,7 @@ extern int buffer_shared; extern void check_frame_size (struct frame *frame, int *rows, int *cols); /* Return a pointer to the glyph W's physical cursor is on. Value is - null if W's current matrix is invalid, so that no meaningfull glyph + null if W's current matrix is invalid, so that no meaningful glyph can be returned. */ struct glyph *get_phys_cursor_glyph (struct window *w); diff --git a/src/xdisp.c b/src/xdisp.c index 3883a753940..4eef9e05231 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -1445,7 +1445,7 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y, position is CHARPOS. For the contingency that we didn't, and stopped at the first newline from the display string, move back over the glyphs - prfoduced from the string, until we find the + produced from the string, until we find the rightmost glyph not from the string. */ if (IT_CHARPOS (it3) != charpos && EQ (it3.object, string)) { @@ -1915,7 +1915,7 @@ get_glyph_string_clip_rects (struct glyph_string *s, NativeRectangle *rects, int environments with anti-aliased text: if the same text is drawn onto the same place multiple times, it gets thicker. If the overlap we are processing is for the erased cursor, we - take the intersection with the rectagle of the cursor. */ + take the intersection with the rectangle of the cursor. */ if (s->for_overlaps & OVERLAPS_ERASED_CURSOR) { XRectangle rc, r_save = r; @@ -2849,8 +2849,14 @@ start_display (struct it *it, struct window *w, struct text_pos pos) || (new_x == it->last_visible_x && FRAME_WINDOW_P (it->f)))) { - if (it->current.dpvec_index >= 0 - || it->current.overlay_string_index >= 0) + if ((it->current.dpvec_index >= 0 + || it->current.overlay_string_index >= 0) + /* If we are on a newline from a display vector or + overlay string, then we are already at the end of + a screen line; no need to go to the next line in + that case, as this line is not really continued. + (If we do go to the next line, C-e will not DTRT.) */ + && it->c != '\n') { set_iterator_to_next (it, 1); move_it_in_display_line_to (it, -1, -1, 0); @@ -3169,13 +3175,11 @@ compute_stop_pos (struct it *it) Lisp_Object object, limit, position; ptrdiff_t charpos, bytepos; - /* If nowhere else, stop at the end. */ - it->stop_charpos = it->end_charpos; - if (STRINGP (it->string)) { /* Strings are usually short, so don't limit the search for properties. */ + it->stop_charpos = it->end_charpos; object = it->string; limit = Qnil; charpos = IT_STRING_CHARPOS (*it); @@ -3185,6 +3189,12 @@ compute_stop_pos (struct it *it) { ptrdiff_t pos; + /* If end_charpos is out of range for some reason, such as a + misbehaving display function, rationalize it (Bug#5984). */ + if (it->end_charpos > ZV) + it->end_charpos = ZV; + it->stop_charpos = it->end_charpos; + /* If next overlay change is in front of the current stop pos (which is IT->end_charpos), stop there. Note: value of next_overlay_change is point-max if no overlay change @@ -4086,26 +4096,37 @@ handle_invisible_prop (struct it *it) if (it->bidi_p && newpos < ZV) { ptrdiff_t bpos = CHAR_TO_BYTE (newpos); - - if (FETCH_BYTE (bpos) == '\n' - || (newpos > BEGV && FETCH_BYTE (bpos - 1) == '\n')) + int on_newline = FETCH_BYTE (bpos) == '\n'; + int after_newline = + newpos <= BEGV || FETCH_BYTE (bpos - 1) == '\n'; + + /* If the invisible text ends on a newline or on a + character after a newline, we can avoid the costly, + character by character, bidi iteration to NEWPOS, and + instead simply reseat the iterator there. That's + because all bidi reordering information is tossed at + the newline. This is a big win for modes that hide + complete lines, like Outline, Org, etc. */ + if (on_newline || after_newline) { - /* If the invisible text ends on a newline or the - character after a newline, we can avoid the - costly, character by character, bidi iteration to - newpos, and instead simply reseat the iterator - there. That's because all bidi reordering - information is tossed at the newline. This is a - big win for modes that hide complete lines, like - Outline, Org, etc. (Implementation note: the - call to reseat_1 is necessary, because it signals - to the bidi iterator that it needs to reinit its - internal information when the next element for - display is requested. */ struct text_pos tpos; + bidi_dir_t pdir = it->bidi_it.paragraph_dir; SET_TEXT_POS (tpos, newpos, bpos); reseat_1 (it, tpos, 0); + /* If we reseat on a newline, we need to prep the + bidi iterator for advancing to the next character + after the newline, keeping the current paragraph + direction (so that PRODUCE_GLYPHS does TRT wrt + prepending/appending glyphs to a glyph row). */ + if (on_newline) + { + it->bidi_it.first_elt = 0; + it->bidi_it.paragraph_dir = pdir; + it->bidi_it.ch = '\n'; + it->bidi_it.nchars = 1; + it->bidi_it.ch_len = 1; + } } else /* Must use the slow method. */ { @@ -4114,11 +4135,11 @@ handle_invisible_prop (struct it *it) non-base embedding level. Therefore, we need to skip invisible text using the bidi iterator, starting at IT's current position, until we find - ourselves outside the invisible text. Skipping - invisible text _after_ bidi iteration avoids - affecting the visual order of the displayed text - when invisible properties are added or - removed. */ + ourselves outside of the invisible text. + Skipping invisible text _after_ bidi iteration + avoids affecting the visual order of the + displayed text when invisible properties are + added or removed. */ if (it->bidi_it.first_elt && it->bidi_it.charpos < ZV) { /* If we were `reseat'ed to a new paragraph, @@ -10220,7 +10241,7 @@ current_message_1 (ptrdiff_t a1, Lisp_Object a2, ptrdiff_t a3, ptrdiff_t a4) } -/* Push the current message on Vmessage_stack for later restauration +/* Push the current message on Vmessage_stack for later restoration by restore_message. Value is non-zero if the current message isn't empty. This is a relatively infrequent operation, so it's not worth optimizing. */ @@ -14116,7 +14137,7 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, || (STRINGP (g1->object) && (!NILP (Fget_char_property (make_number (g1->charpos), Qcursor, g1->object)) - /* pevious candidate is from the same display + /* previous candidate is from the same display string as this one, and the display string came from a text property */ || (EQ (g1->object, glyph->object) @@ -14346,7 +14367,7 @@ try_scrolling (Lisp_Object window, int just_this_one_p, { int scroll_margin_y; - /* Compute the pixel ypos of the scroll margin, then move it to + /* Compute the pixel ypos of the scroll margin, then move IT to either that ypos or PT, whichever comes first. */ start_display (&it, w, startp); scroll_margin_y = it.last_visible_y - this_scroll_margin @@ -14376,7 +14397,8 @@ try_scrolling (Lisp_Object window, int just_this_one_p, if (dy > scroll_max) return SCROLLING_FAILED; - scroll_down_p = 1; + if (dy > 0) + scroll_down_p = 1; } } @@ -15038,7 +15060,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p) int current_matrix_up_to_date_p = 0; int used_current_matrix_p = 0; /* This is less strict than current_matrix_up_to_date_p. - It indictes that the buffer contents and narrowing are unchanged. */ + It indicates that the buffer contents and narrowing are unchanged. */ int buffer_unchanged_p = 0; int temp_scroll_step = 0; ptrdiff_t count = SPECPDL_INDEX (); @@ -15560,8 +15582,8 @@ redisplay_window (Lisp_Object window, int just_this_one_p) ? min (scroll_margin, WINDOW_TOTAL_LINES (w) / 4) : 0; ptrdiff_t margin_pos = CHARPOS (startp); - int scrolling_up; Lisp_Object aggressive; + int scrolling_up; /* If there is a scroll margin at the top of the window, find its character position. */ @@ -15603,7 +15625,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p) pt_offset = float_amount * WINDOW_BOX_TEXT_HEIGHT (w); if (pt_offset == 0 && float_amount > 0) pt_offset = 1; - if (pt_offset) + if (pt_offset && margin > 0) margin -= 1; } /* Compute how much to move the window start backward from @@ -15723,6 +15745,25 @@ redisplay_window (Lisp_Object window, int just_this_one_p) goto recenter; } + /* Users who set scroll-conservatively to a large number want + point just above/below the scroll margin. If we ended up + with point's row partially visible, move the window start to + make that row fully visible and out of the margin. */ + if (scroll_conservatively > SCROLL_LIMIT) + { + int margin = + scroll_margin > 0 + ? min (scroll_margin, WINDOW_TOTAL_LINES (w) / 4) + : 0; + int move_down = w->cursor.vpos >= WINDOW_TOTAL_LINES (w) / 2; + + move_it_by_lines (&it, move_down ? margin + 1 : -(margin + 1)); + clear_glyph_matrix (w->desired_matrix); + if (1 == try_window (window, it.current.pos, + TRY_WINDOW_CHECK_MARGINS)) + goto done; + } + /* If centering point failed to make the whole line visible, put point at the top instead. That has to make the whole line visible, if it can be done. */ @@ -17027,7 +17068,7 @@ try_window_id (struct window *w) last_unchanged_at_beg_row = find_last_unchanged_at_beg_row (w); if (last_unchanged_at_beg_row) { - /* Avoid starting to display in the moddle of a character, a TAB + /* Avoid starting to display in the middle of a character, a TAB for instance. This is easier than to set up the iterator exactly, and it's not a frequent case, so the additional effort wouldn't really pay off. */ @@ -17957,9 +17998,6 @@ insert_left_trunc_glyphs (struct it *it) } /* Compute the hash code for ROW. */ -#if !XASSERTS -static -#endif unsigned row_hash (struct glyph_row *row) { @@ -18856,7 +18894,8 @@ display_line (struct it *it) #define RECORD_MAX_MIN_POS(IT) \ do \ { \ - int composition_p = (IT)->what == IT_COMPOSITION; \ + int composition_p = !STRINGP ((IT)->string) \ + && ((IT)->what == IT_COMPOSITION); \ ptrdiff_t current_pos = \ composition_p ? (IT)->cmp_it.charpos \ : IT_CHARPOS (*(IT)); \ @@ -24681,9 +24720,17 @@ x_produce_glyphs (struct it *it) void x_write_glyphs (struct glyph *start, int len) { - int x, hpos; + int x, hpos, chpos = updated_window->phys_cursor.hpos; xassert (updated_window && updated_row); + /* When the window is hscrolled, cursor hpos can legitimately be out + of bounds, but we draw the cursor at the corresponding window + margin in that case. */ + if (!updated_row->reversed_p && chpos < 0) + chpos = 0; + if (updated_row->reversed_p && chpos >= updated_row->used[TEXT_AREA]) + chpos = updated_row->used[TEXT_AREA] - 1; + BLOCK_INPUT; /* Write glyphs. */ @@ -24698,8 +24745,8 @@ x_write_glyphs (struct glyph *start, int len) if (updated_area == TEXT_AREA && updated_window->phys_cursor_on_p && updated_window->phys_cursor.vpos == output_cursor.vpos - && updated_window->phys_cursor.hpos >= hpos - && updated_window->phys_cursor.hpos < hpos + len) + && chpos >= hpos + && chpos < hpos + len) updated_window->phys_cursor_on_p = 0; UNBLOCK_INPUT; @@ -25207,8 +25254,17 @@ draw_phys_cursor_glyph (struct window *w, struct glyph_row *row, { int on_p = w->phys_cursor_on_p; int x1; - x1 = draw_glyphs (w, w->phys_cursor.x, row, TEXT_AREA, - w->phys_cursor.hpos, w->phys_cursor.hpos + 1, + int hpos = w->phys_cursor.hpos; + + /* When the window is hscrolled, cursor hpos can legitimately be + out of bounds, but we draw the cursor at the corresponding + window margin in that case. */ + if (!row->reversed_p && hpos < 0) + hpos = 0; + if (row->reversed_p && hpos >= row->used[TEXT_AREA]) + hpos = row->used[TEXT_AREA] - 1; + + x1 = draw_glyphs (w, w->phys_cursor.x, row, TEXT_AREA, hpos, hpos + 1, hl, 0); w->phys_cursor_on_p = on_p; @@ -25296,6 +25352,14 @@ erase_phys_cursor (struct window *w) : (w->phys_cursor.hpos >= cursor_row->used[TEXT_AREA]))) goto mark_cursor_off; + /* When the window is hscrolled, cursor hpos can legitimately be out + of bounds, but we draw the cursor at the corresponding window + margin in that case. */ + if (!cursor_row->reversed_p && hpos < 0) + hpos = 0; + if (cursor_row->reversed_p && hpos >= cursor_row->used[TEXT_AREA]) + hpos = cursor_row->used[TEXT_AREA] - 1; + /* If the cursor is in the mouse face area, redisplay that when we clear the cursor. */ if (! NILP (hlinfo->mouse_face_window) @@ -25439,8 +25503,26 @@ update_window_cursor (struct window *w, int on) of being deleted. */ if (w->current_matrix) { + int hpos = w->phys_cursor.hpos; + int vpos = w->phys_cursor.vpos; + struct glyph_row *row; + + if (vpos >= w->current_matrix->nrows + || hpos >= w->current_matrix->matrix_w) + return; + + row = MATRIX_ROW (w->current_matrix, vpos); + + /* When the window is hscrolled, cursor hpos can legitimately be + out of bounds, but we draw the cursor at the corresponding + window margin in that case. */ + if (!row->reversed_p && hpos < 0) + hpos = 0; + if (row->reversed_p && hpos >= row->used[TEXT_AREA]) + hpos = row->used[TEXT_AREA] - 1; + BLOCK_INPUT; - display_and_set_cursor (w, on, w->phys_cursor.hpos, w->phys_cursor.vpos, + display_and_set_cursor (w, on, hpos, vpos, w->phys_cursor.x, w->phys_cursor.y); UNBLOCK_INPUT; } @@ -25610,9 +25692,18 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw) if (FRAME_WINDOW_P (f) && phys_cursor_on_p && !w->phys_cursor_on_p) { + int hpos = w->phys_cursor.hpos; + + /* When the window is hscrolled, cursor hpos can legitimately be + out of bounds, but we draw the cursor at the corresponding + window margin in that case. */ + if (!row->reversed_p && hpos < 0) + hpos = 0; + if (row->reversed_p && hpos >= row->used[TEXT_AREA]) + hpos = row->used[TEXT_AREA] - 1; + BLOCK_INPUT; - display_and_set_cursor (w, 1, - w->phys_cursor.hpos, w->phys_cursor.vpos, + display_and_set_cursor (w, 1, hpos, w->phys_cursor.vpos, w->phys_cursor.x, w->phys_cursor.y); UNBLOCK_INPUT; } @@ -25711,7 +25802,19 @@ coords_in_mouse_face_p (struct window *w, int hpos, int vpos) int cursor_in_mouse_face_p (struct window *w) { - return coords_in_mouse_face_p (w, w->phys_cursor.hpos, w->phys_cursor.vpos); + int hpos = w->phys_cursor.hpos; + int vpos = w->phys_cursor.vpos; + struct glyph_row *row = MATRIX_ROW (w->current_matrix, vpos); + + /* When the window is hscrolled, cursor hpos can legitimately be out + of bounds, but we draw the cursor at the corresponding window + margin in that case. */ + if (!row->reversed_p && hpos < 0) + hpos = 0; + if (row->reversed_p && hpos >= row->used[TEXT_AREA]) + hpos = row->used[TEXT_AREA] - 1; + + return coords_in_mouse_face_p (w, hpos, vpos); } @@ -28579,7 +28682,8 @@ init_xdisp (void) /* Platform-independent portion of hourglass implementation. */ -/* Return non-zero if houglass timer has been started or hourglass is shown. */ +/* Return non-zero if hourglass timer has been started or hourglass is + shown. */ int hourglass_started (void) { diff --git a/src/xfaces.c b/src/xfaces.c index 2dc46b2fa02..5a7b39fcca5 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -66,7 +66,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ attributes (1st thru 5th) are updated from the spec. On the other hand, if one of the other font-related attributes are - specified, the correspoinding specs in this attribute is set to nil. + specified, the corresponding specs in this attribute is set to nil. 15. A face name or list of face names from which to inherit attributes. @@ -1223,7 +1223,7 @@ face_color_gray_p (struct frame *f, const char *color_name) int gray_p; if (defined_color (f, color_name, &color, 0)) - gray_p = (/* Any color sufficiently close to black counts as grey. */ + gray_p = (/* Any color sufficiently close to black counts as gray. */ (color.red < 5000 && color.green < 5000 && color.blue < 5000) || ((eabs (color.red - color.green) diff --git a/src/xfns.c b/src/xfns.c index 88c70a9b410..9bbaea37583 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -2962,7 +2962,7 @@ x_default_font_parameter (struct frame *f, Lisp_Object parms) if (NILP (font_param)) { - /* System font should take precedendce over X resources. We suggest this + /* System font should take precedence over X resources. We suggest this regardless of font-use-system-font because .emacs may not have been read yet. */ const char *system_font = xsettings_get_system_font (); @@ -3166,7 +3166,7 @@ This function is an internal primitive--use `make-frame' instead. */) to get the color reference counts right, so initialize them! */ { Lisp_Object black; - struct gcpro inner_gcpro1; + struct gcpro gcpro1; /* Function x_decode_color can signal an error. Make sure to initialize color slots so that we won't try @@ -3179,7 +3179,7 @@ This function is an internal primitive--use `make-frame' instead. */) f->output_data.x->mouse_pixel = -1; black = build_string ("black"); - GCPRO1_VAR (black, inner_gcpro); + GCPRO1 (black); FRAME_FOREGROUND_PIXEL (f) = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); FRAME_BACKGROUND_PIXEL (f) @@ -3192,7 +3192,7 @@ This function is an internal primitive--use `make-frame' instead. */) = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); f->output_data.x->mouse_pixel = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); - UNGCPRO_VAR (inner_gcpro); + UNGCPRO; } /* Specify the parent under which to make this X window. */ @@ -4286,7 +4286,7 @@ If TYPE is nil or omitted, get the property as a string. Otherwise TYPE is the name of the atom that denotes the type expected. If SOURCE is non-nil, get the property on that window instead of from FRAME. The number 0 denotes the root window. -If DELETE_P is non-nil, delete the property after retreiving it. +If DELETE_P is non-nil, delete the property after retrieving it. If VECTOR_RET_P is non-nil, don't return a string but a vector of values. Value is nil if FRAME hasn't a property with name PROP or if PROP has @@ -4620,7 +4620,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo, to get the color reference counts right, so initialize them! */ { Lisp_Object black; - struct gcpro inner_gcpro1; + struct gcpro gcpro1; /* Function x_decode_color can signal an error. Make sure to initialize color slots so that we won't try @@ -4633,7 +4633,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo, f->output_data.x->mouse_pixel = -1; black = build_string ("black"); - GCPRO1_VAR (black, inner_gcpro); + GCPRO1 (black); FRAME_FOREGROUND_PIXEL (f) = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); FRAME_BACKGROUND_PIXEL (f) @@ -4646,7 +4646,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo, = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); f->output_data.x->mouse_pixel = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); - UNGCPRO_VAR (inner_gcpro); + UNGCPRO; } /* Set the name; the functions to which we pass f expect the name to @@ -5912,7 +5912,7 @@ the tool bar buttons. */); x_gtk_whole_detached_tool_bar = 0; DEFVAR_BOOL ("x-gtk-use-system-tooltips", x_gtk_use_system_tooltips, - doc: /* *If non-nil with a Gtk+ built Emacs, the Gtk+ toolip is used. + doc: /* *If non-nil with a Gtk+ built Emacs, the Gtk+ tooltip is used. Otherwise use Emacs own tooltip implementation. When using Gtk+ tooltips, the tooltip face is not used. */); x_gtk_use_system_tooltips = 1; diff --git a/src/xmenu.c b/src/xmenu.c index d73051be6de..b766f142e2d 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -1304,7 +1304,7 @@ free_frame_menubar (FRAME_PTR f) #ifdef USE_MOTIF /* Removing the menu bar magically changes the shell widget's x and y position of (0, 0) which, when the menu bar is turned - on again, leads to pull-down menuss appearing in strange + on again, leads to pull-down menus appearing in strange positions near the upper-left corner of the display. This happens only with some window managers like twm and ctwm, but not with other like Motif's mwm or kwm, because the diff --git a/src/xselect.c b/src/xselect.c index d2ab416176c..099b1670e4d 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -515,7 +515,7 @@ static struct selection_data *converted_selections; static Atom conversion_fail_tag; /* Used as an unwind-protect clause so that, if a selection-converter signals - an error, we tell the requester that we were unable to do what they wanted + an error, we tell the requestor that we were unable to do what they wanted before we throw to top-level or go into the debugger or whatever. */ static Lisp_Object @@ -692,7 +692,7 @@ x_reply_selection_request (struct input_event *event, bytes_remaining = cs->size; bytes_remaining *= format_bytes; - /* Wait for the requester to ack by deleting the property. + /* Wait for the requestor to ack by deleting the property. This can run Lisp code (process handlers) or signal. */ if (! had_errors) { @@ -731,7 +731,7 @@ x_reply_selection_request (struct input_event *event, if (had_errors) break; - /* Wait for the requester to ack this chunk by deleting + /* Wait for the requestor to ack this chunk by deleting the property. This can run Lisp code or signal. */ TRACE1 ("Waiting for increment ACK (deletion of %s)", XGetAtomName (display, cs->property)); @@ -739,7 +739,7 @@ x_reply_selection_request (struct input_event *event, } /* Now write a zero-length chunk to the property to tell the - requester that we're done. */ + requestor that we're done. */ BLOCK_INPUT; if (! waiting_for_other_props_on_window (display, window)) XSelectInput (display, window, 0L); diff --git a/src/xterm.c b/src/xterm.c index d5131c9a60c..4bc12c06b34 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -2963,9 +2963,7 @@ x_clear_frame (struct frame *f) follow an explicit cursor_to. */ BLOCK_INPUT; - /* The following call is commented out because it does not seem to accomplish - anything, apart from causing flickering during window resize. */ - /* XClearWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); */ + XClearWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); /* We have to clear the scroll bars. If we have changed colors or something like that, then they should be notified. */ @@ -3319,7 +3317,7 @@ x_scroll_run (struct window *w, struct run *run) } else { - /* Scolling down. Make sure we don't copy over the mode line. + /* Scrolling down. Make sure we don't copy over the mode line. at the bottom. */ if (to_y + run->height > bottom_y) height = bottom_y - to_y; @@ -4183,7 +4181,7 @@ static Boolean xaw3d_arrow_scroll; /* Whether the drag scrolling maintains the mouse at the top of the thumb. If not, resizing the thumb needs to be done more carefully - to avoid jerkyness. */ + to avoid jerkiness. */ static Boolean xaw3d_pick_top; @@ -6115,7 +6113,8 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr, last_user_time = event.xproperty.time; f = x_top_window_to_frame (dpyinfo, event.xproperty.window); if (f && event.xproperty.atom == dpyinfo->Xatom_net_wm_state) - if (x_handle_net_wm_state (f, &event.xproperty) && f->iconified) + if (x_handle_net_wm_state (f, &event.xproperty) && f->iconified + && f->output_data.x->net_wm_state_hidden_seen) { /* 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, @@ -6125,6 +6124,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr, f->async_visible = 1; f->async_iconified = 0; f->output_data.x->has_been_visible = 1; + f->output_data.x->net_wm_state_hidden_seen = 0; inev.ie.kind = DEICONIFY_EVENT; XSETFRAME (inev.ie.frame_or_window, f); } @@ -8482,7 +8482,10 @@ get_current_wm_state (struct frame *f, { Atom a = ((Atom*)tmp_data)[i]; if (a == dpyinfo->Xatom_net_wm_state_hidden) - is_hidden = 1; + { + is_hidden = 1; + f->output_data.x->net_wm_state_hidden_seen = 1; + } else if (a == dpyinfo->Xatom_net_wm_state_maximized_horz) { if (*size_state == FULLSCREEN_HEIGHT) @@ -8765,7 +8768,7 @@ x_wait_for_event (struct frame *f, int eventtype) pending_event_wait.f = f; pending_event_wait.eventtype = eventtype; - /* Set timeout to 0.1 second. Hopefully not noticable. + /* Set timeout to 0.1 second. Hopefully not noticeable. Maybe it should be configurable. */ EMACS_SET_SECS_USECS (tmo, 0, 100000); EMACS_GET_TIME (tmo_at); @@ -9558,6 +9561,14 @@ x_wm_set_size_hint (struct frame *f, long flags, int user_position) XSizeHints size_hints; Window window = FRAME_OUTER_WINDOW (f); +#ifdef USE_X_TOOLKIT + if (f->output_data.x->widget) + { + widget_update_wm_size_hints (f->output_data.x->widget); + return; + } +#endif + /* Setting PMaxSize caused various problems. */ size_hints.flags = PResizeInc | PMinSize /* | PMaxSize */; @@ -9950,6 +9961,11 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) https://bugzilla.gnome.org/show_bug.cgi?id=563627. */ id = g_log_set_handler ("GLib", G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION, my_log_handler, NULL); + + /* NULL window -> events for all windows go to our function. + Call before gtk_init so Gtk+ event filters comes after our. */ + gdk_window_add_filter (NULL, event_handler_gdk, NULL); + gtk_init (&argc, &argv2); g_log_remove_handler ("GLib", id); @@ -9959,9 +9975,6 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) dpy = DEFAULT_GDK_DISPLAY (); - /* NULL window -> events for all windows go to our function */ - gdk_window_add_filter (NULL, event_handler_gdk, NULL); - #if GTK_MAJOR_VERSION <= 2 && GTK_MINOR_VERSION <= 90 /* Load our own gtkrc if it exists. */ { diff --git a/src/xterm.h b/src/xterm.h index 92761ccee87..1242bf64d77 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -632,6 +632,9 @@ struct x_output x_check_expected_move. */ int left_before_move; int top_before_move; + + /* Non-zero if _NET_WM_STATE_HIDDEN is set for this frame. */ + int net_wm_state_hidden_seen; }; #define No_Cursor (None) @@ -640,7 +643,7 @@ enum { /* Values for focus_state, used as bit mask. EXPLICIT means we received a FocusIn for the frame and know it has - the focus. IMPLICIT means we recevied an EnterNotify and the frame + the focus. IMPLICIT means we received an EnterNotify and the frame may have the focus if no window manager is running. FocusOut and LeaveNotify clears EXPLICIT/IMPLICIT. */ FOCUS_NONE = 0, |