diff options
author | Joakim Verona <joakim@verona.se> | 2011-12-28 04:12:56 +0100 |
---|---|---|
committer | Joakim Verona <joakim@verona.se> | 2011-12-28 04:12:56 +0100 |
commit | bb29f044aa967831cd664c54eba0de0c701436ce (patch) | |
tree | 1398cc9780bbae0fdad071a3a3765a571c3f6d7b /src | |
parent | 3c935a7e996701244d166f684119f0ff97e25496 (diff) | |
parent | 5e605a2e528955721fc6f2bd7b9f174c15075fb1 (diff) | |
download | emacs-bb29f044aa967831cd664c54eba0de0c701436ce.tar.gz emacs-bb29f044aa967831cd664c54eba0de0c701436ce.tar.bz2 emacs-bb29f044aa967831cd664c54eba0de0c701436ce.zip |
upstream i think
Diffstat (limited to 'src')
-rw-r--r-- | src/.gdbinit | 5 | ||||
-rw-r--r-- | src/ChangeLog | 163 | ||||
-rw-r--r-- | src/ChangeLog.10 | 10 | ||||
-rw-r--r-- | src/ChangeLog.11 | 18 | ||||
-rw-r--r-- | src/ChangeLog.3 | 4 | ||||
-rw-r--r-- | src/ChangeLog.6 | 18 | ||||
-rw-r--r-- | src/ChangeLog.8 | 6 | ||||
-rw-r--r-- | src/ChangeLog.9 | 2 | ||||
-rw-r--r-- | src/buffer.c | 13 | ||||
-rw-r--r-- | src/callint.c | 2 | ||||
-rw-r--r-- | src/ccl.c | 2 | ||||
-rw-r--r-- | src/charset.c | 4 | ||||
-rw-r--r-- | src/cm.h | 2 | ||||
-rw-r--r-- | src/dired.c | 18 | ||||
-rw-r--r-- | src/dispextern.h | 2 | ||||
-rw-r--r-- | src/dispnew.c | 82 | ||||
-rw-r--r-- | src/fileio.c | 22 | ||||
-rw-r--r-- | src/font.c | 9 | ||||
-rw-r--r-- | src/fontset.c | 2 | ||||
-rw-r--r-- | src/fringe.c | 4 | ||||
-rw-r--r-- | src/ftfont.c | 2 | ||||
-rw-r--r-- | src/gtkutil.c | 8 | ||||
-rw-r--r-- | src/gtkutil.h | 4 | ||||
-rw-r--r-- | src/image.c | 4 | ||||
-rw-r--r-- | src/keyboard.c | 16 | ||||
-rw-r--r-- | src/lisp.h | 247 | ||||
-rw-r--r-- | src/lread.c | 2 | ||||
-rw-r--r-- | src/msdos.c | 2 | ||||
-rw-r--r-- | src/nsgui.h | 3 | ||||
-rw-r--r-- | src/nsterm.m | 4 | ||||
-rw-r--r-- | src/process.c | 43 | ||||
-rw-r--r-- | src/s/ms-w32.h | 8 | ||||
-rw-r--r-- | src/search.c | 61 | ||||
-rw-r--r-- | src/term.c | 2 | ||||
-rw-r--r-- | src/w32fns.c | 5 | ||||
-rw-r--r-- | src/w32term.h | 2 | ||||
-rw-r--r-- | src/widget.c | 13 | ||||
-rw-r--r-- | src/widget.h | 4 | ||||
-rw-r--r-- | src/window.c | 7 | ||||
-rw-r--r-- | src/xdisp.c | 97 | ||||
-rw-r--r-- | src/xfaces.c | 4 | ||||
-rw-r--r-- | src/xfns.c | 12 | ||||
-rw-r--r-- | src/xterm.c | 17 | ||||
-rw-r--r-- | src/xterm.h | 3 |
44 files changed, 632 insertions, 326 deletions
diff --git a/src/.gdbinit b/src/.gdbinit index 80415abe40d..2051475bea0 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -311,9 +311,8 @@ define prowx 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 a0f83560603..6a13bd87264 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,160 @@ +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 @@ -7075,7 +7232,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> @@ -7691,7 +7848,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> @@ -8575,7 +8732,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.10 b/src/ChangeLog.10 index 99ab02577d5..7d2f48a03ea 100644 --- a/src/ChangeLog.10 +++ b/src/ChangeLog.10 @@ -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): @@ -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> @@ -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 07d4f4ec116..7c46dea675c 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> @@ -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> @@ -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> @@ -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 @@ -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.3 b/src/ChangeLog.3 index cbf867829c7..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 @@ -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.6 b/src/ChangeLog.6 index af97d0de7b4..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 @@ -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. @@ -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.8 b/src/ChangeLog.8 index e21af17657f..2f3ee45a1ac 100644 --- a/src/ChangeLog.8 +++ b/src/ChangeLog.8 @@ -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 @@ -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> diff --git a/src/ChangeLog.9 b/src/ChangeLog.9 index 6f007992bef..6e3a8d8ab3b 100644 --- a/src/ChangeLog.9 +++ b/src/ChangeLog.9 @@ -3479,7 +3479,7 @@ 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> diff --git a/src/buffer.c b/src/buffer.c index a327a1650f1..a482493fac7 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1526,7 +1526,13 @@ with SIGHUP. */) 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); @@ -2481,7 +2486,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: diff --git a/src/callint.c b/src/callint.c index 61ab4a3963e..80e24f6c8ee 100644 --- a/src/callint.c +++ b/src/callint.c @@ -78,7 +78,7 @@ c -- Character (no input method is used). 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/ccl.c b/src/ccl.c index 84d7a6a25ff..b7228a4d1cd 100644 --- a/src/ccl.c +++ b/src/ccl.c @@ -561,7 +561,7 @@ static Lisp_Object Vccl_program_table; 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. diff --git a/src/charset.c b/src/charset.c index b6921a762b6..3c15f1bee54 100644 --- a/src/charset.c +++ b/src/charset.c @@ -166,9 +166,9 @@ static struct 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; @@ -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 diff --git a/src/dired.c b/src/dired.c index acc81a6ed9d..2b5f3b40641 100644 --- a/src/dired.c +++ b/src/dired.c @@ -229,11 +229,11 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, Lisp_Object m int 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 a45c5cc138f..ec66dcb4220 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -409,7 +409,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. */ diff --git a/src/dispnew.c b/src/dispnew.c index b920693688c..e21f565fb3a 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -612,7 +612,6 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y row->glyphs[LAST_AREA] = row->glyphs[LEFT_MARGIN_AREA] + dim.width; } - xassert (!row->enabled_p || verify_row_hash (row)); ++row; } } @@ -3580,12 +3579,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; @@ -3630,6 +3628,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); @@ -4564,18 +4564,69 @@ scrolling_window (struct window *w, int header_line_p) { rif->clear_window_mouse_face (w); rif->scroll_run_hook (w, r); + } + + /* 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; - /* Invalidate runs that copy from where we copied to. */ - for (j = i + 1; j < nruns; ++j) + 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; } } @@ -4590,7 +4641,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/fileio.c b/src/fileio.c index 7e75e6285f0..c0f6c1d2e8e 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -1553,7 +1553,7 @@ those `/' is discarded. */) 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)); @@ -4100,6 +4100,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: @@ -4270,16 +4280,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/font.c b/src/font.c index 9559c65e7ed..35f5703e32e 100644 --- a/src/font.c +++ b/src/font.c @@ -3160,14 +3160,7 @@ font_find_for_lface (FRAME_PTR f, Lisp_Object *attrs, Lisp_Object spec, int c) 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/fontset.c b/src/fontset.c index 9697f62ea72..7592521cc7d 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -631,7 +631,7 @@ fontset_find_font (Lisp_Object fontset, int c, struct face *face, int id, int fa { /* 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); diff --git a/src/fringe.c b/src/fringe.c index 25fecca2334..da896e07b76 100644 --- a/src/fringe.c +++ b/src/fringe.c @@ -35,7 +35,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ 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 5c540f9bf82..c48346b0147 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -1462,7 +1462,7 @@ ftfont_get_bitmap (struct font *font, unsigned int code, struct font_bitmap *bit : 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/gtkutil.c b/src/gtkutil.c index 7e6f5c3164d..bc71685819e 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -1100,6 +1100,14 @@ xg_create_frame_widgets (FRAME_PTR f) 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); 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 8b61c7eefbc..81907d8e580 100644 --- a/src/image.c +++ b/src/image.c @@ -7618,7 +7618,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); @@ -7628,6 +7628,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'", diff --git a/src/keyboard.c b/src/keyboard.c index bee91c6b5cf..656634b8d31 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -3001,7 +3001,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, { Lisp_Object keys; int key_count, key_count_reset; - struct gcpro inner_gcpro1; + struct gcpro gcpro1; int count = SPECPDL_INDEX (); /* Save the echo status. */ @@ -3029,7 +3029,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; @@ -3067,7 +3067,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)) @@ -9069,9 +9069,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; @@ -9367,7 +9367,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; } @@ -10065,7 +10065,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, add_command_key (keybuf[t]); } - UNGCPRO_VAR (outer_gcpro); + UNGCPRO; return t; } @@ -10874,7 +10874,7 @@ interrupt_signal (int signalnum) /* If we don't have an argument, some */ /* 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) + if (!gc_in_progress && !waiting_for_input) Fkill_emacs (Qnil); else Vquit_flag = Qt; diff --git a/src/lisp.h b/src/lisp.h index 2056b7caff8..6b19396111c 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -163,14 +163,23 @@ extern int suppress_checking EXTERNALLY_VISIBLE; /* 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; @@ -2222,143 +2227,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 */ diff --git a/src/lread.c b/src/lread.c index f1f6f0cbd78..cdbd09d2f89 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1917,7 +1917,7 @@ which is the input stream for reading characters. 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! */ int count = SPECPDL_INDEX (); Lisp_Object tem, cbuf; diff --git a/src/msdos.c b/src/msdos.c index 4c08c5b29e0..64e9d72c784 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -1558,7 +1558,7 @@ IT_set_terminal_window (struct frame *f, int foo) { } -/* 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/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.m b/src/nsterm.m index c5b28d57ac5..5e19a397c34 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -559,7 +559,7 @@ ns_constrain_all_frames (void) { 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]; } @@ -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); diff --git a/src/process.c b/src/process.c index a02ba44ae71..05c4be27550 100644 --- a/src/process.c +++ b/src/process.c @@ -3474,7 +3474,7 @@ usage: (make-network-process &rest ARGS) */) { /* 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; @@ -3502,9 +3502,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); @@ -3535,9 +3535,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)) @@ -3717,7 +3717,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) { @@ -4630,26 +4630,29 @@ wait_reading_process_output (int time_limit, int microsecs, int read_kbd, the gnutls library -- 2.12.14 has been confirmed to need it. See http://comments.gmane.org/gmane.emacs.devel/145074 */ - struct Lisp_Process *proc; for (channel = 0; channel < MAXDESC; ++channel) - { - if (! NILP (chan_process[channel]) && - (proc = XPROCESS (chan_process[channel])) != NULL && - proc->gnutls_p && - proc->infd && - emacs_gnutls_record_check_pending (proc->gnutls_state) > 0) - { - nfds++; - FD_SET (proc->infd, &Available); - } - } + 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. */ + if (wait_proc->gnutls_p /* Check for valid process. */ /* Do we have pending data? */ - emacs_gnutls_record_check_pending (wait_proc->gnutls_state) > 0) + && ((emacs_gnutls_record_check_pending + (wait_proc->gnutls_state)) + > 0)) { nfds = 1; /* Set to Available. */ diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h index fb0882860d1..cc19765aba6 100644 --- a/src/s/ms-w32.h +++ b/src/s/ms-w32.h @@ -267,6 +267,8 @@ struct sigaction { #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 a6a0fddb137..811ac74e194 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 (EMACS_INT, EMACS_INT); @@ -2078,13 +2077,16 @@ set_search_regs (EMACS_INT beg_byte, EMACS_INT 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 EMACS_INT i, i_byte, len, punct_count = 0, word_count = 0; @@ -2125,7 +2127,7 @@ wordify (Lisp_Object string, int lax) } adjust = - punct_count + 5 * (word_count - 1) - + ((lax && !whitespace_at_end) ? 2 : 4); + + ((!NILP (lax) && !whitespace_at_end) ? 2 : 4); if (STRING_MULTIBYTE (string)) val = make_uninit_multibyte_string (len + adjust, SBYTES (string) @@ -2162,7 +2164,7 @@ wordify (Lisp_Object string, int lax) prev_c = c; } - if (!lax || whitespace_at_end) + if (NILP (lax) || whitespace_at_end) { *o++ = '\\'; *o++ = 'b'; @@ -2217,10 +2219,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, @@ -2231,10 +2237,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, @@ -2249,10 +2259,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, @@ -2267,10 +2281,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, @@ -3132,7 +3150,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. */) @@ -3229,6 +3247,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/term.c b/src/term.c index 4a671d048c4..ae505f020f2 100644 --- a/src/term.c +++ b/src/term.c @@ -3236,7 +3236,7 @@ use the Bourne shell command `TERM=... export TERM' (C-shell:\n\ 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/w32fns.c b/src/w32fns.c index 434861320a5..7a17c108d4d 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -3711,7 +3711,7 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) 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); @@ -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. */ diff --git a/src/w32term.h b/src/w32term.h index 02392133837..6c73daba601 100644 --- a/src/w32term.h +++ b/src/w32term.h @@ -209,7 +209,7 @@ extern int x_display_pixel_width (struct w32_display_info *); 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 { 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 728e811f304..86fcca25f2e 100644 --- a/src/window.c +++ b/src/window.c @@ -1054,6 +1054,7 @@ window_relative_x_coord (struct window *w, enum window_part part, int x) 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 @@ -1075,7 +1076,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); @@ -3089,7 +3090,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); @@ -6303,7 +6304,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. */ diff --git a/src/xdisp.c b/src/xdisp.c index 7c415e485b5..530373a4436 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -2851,8 +2851,14 @@ start_display (struct it *it, struct window *w, struct text_pos pos) || (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); @@ -3171,13 +3177,11 @@ compute_stop_pos (struct it *it) Lisp_Object object, limit, position; EMACS_INT 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); @@ -3187,6 +3191,12 @@ compute_stop_pos (struct it *it) { EMACS_INT 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 @@ -4088,26 +4098,37 @@ handle_invisible_prop (struct it *it) if (it->bidi_p && newpos < ZV) { EMACS_INT 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. */ { @@ -4116,11 +4137,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, @@ -15614,8 +15635,8 @@ redisplay_window (Lisp_Object window, int just_this_one_p) ? min (scroll_margin, WINDOW_TOTAL_LINES (w) / 4) : 0; EMACS_INT 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. */ @@ -15657,7 +15678,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 @@ -15777,6 +15798,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. */ @@ -28871,7 +28911,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 849ad6bbdf4..7e3ce4103d9 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -66,7 +66,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ 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 c68149cce11..323b272e9f0 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -3166,7 +3166,7 @@ This function is an internal primitive--use `make-frame' instead. */) 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. */ @@ -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 diff --git a/src/xterm.c b/src/xterm.c index f750c00cea0..8171fe7738e 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -6123,7 +6123,8 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr, 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, @@ -6133,6 +6134,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); } @@ -8494,7 +8496,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) @@ -9570,6 +9575,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 */; diff --git a/src/xterm.h b/src/xterm.h index 1d2ce9a2d3c..4385b1a467d 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -632,6 +632,9 @@ struct x_output 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) |