From b12cd789373d12a8d1b898efa023e7e1b83d0405 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 22 Nov 2011 20:00:38 +0200 Subject: Fix bug #10098 with assertion violation during frame resize. src/dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode- and header-lines, as they don't have one computed for them. src/.gdbinit (prow): Make displayed values more self-explaining. Add row's hash code. --- src/.gdbinit | 5 ++--- src/ChangeLog | 9 +++++++++ src/dispnew.c | 4 +++- 3 files changed, 14 insertions(+), 4 deletions(-) (limited to 'src') 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..51fa3b65be1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2011-11-22 Eli Zaretskii + + * 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 * process.c (wait_reading_process_output): Fix asynchrounous diff --git a/src/dispnew.c b/src/dispnew.c index d6bf6666ee2..8abf5782a88 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -608,7 +608,9 @@ 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)); + xassert (!row->enabled_p + || row->mode_line_p + || verify_row_hash (row)); ++row; } } -- cgit v1.2.1 From 6b21de180fba10432988d94d2b8f3e2521be5b17 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 23 Nov 2011 14:47:09 +0800 Subject: * xdisp.c (compute_stop_pos): Check validity of end_charpos before using it. Fixes: debbugs:5984 --- src/ChangeLog | 5 +++++ src/xdisp.c | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 51fa3b65be1..d26b893ced1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-11-23 Chong Yidong + + * xdisp.c (compute_stop_pos): Check validity of end_charpos before + using it (Bug#5984). + 2011-11-22 Eli Zaretskii * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode- diff --git a/src/xdisp.c b/src/xdisp.c index 8a8c1d08994..403272e7d0c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -3166,13 +3166,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); @@ -3182,6 +3180,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 -- cgit v1.2.1 From ee7683ebb70c308e596103e379ef6b91d001eebc Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 22 Nov 2011 23:03:56 -0800 Subject: Spelling fixes. --- src/ChangeLog | 2 +- src/ChangeLog.10 | 2 +- src/ChangeLog.11 | 2 +- src/ChangeLog.3 | 2 +- src/ChangeLog.9 | 2 +- src/fileio.c | 2 +- src/fontset.c | 2 +- src/fringe.c | 2 +- src/nsgui.h | 3 +-- src/nsterm.m | 2 +- src/w32fns.c | 2 +- src/w32term.h | 2 +- 12 files changed, 12 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index d26b893ced1..1dca6864986 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -7089,7 +7089,7 @@ 2011-04-08 T.V. Raman (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 diff --git a/src/ChangeLog.10 b/src/ChangeLog.10 index 99ab02577d5..ada5e0f78ef 100644 --- a/src/ChangeLog.10 +++ b/src/ChangeLog.10 @@ -5084,7 +5084,7 @@ 2006-02-26 Chong Yidong - * 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): diff --git a/src/ChangeLog.11 b/src/ChangeLog.11 index 07d4f4ec116..72871475b69 100644 --- a/src/ChangeLog.11 +++ b/src/ChangeLog.11 @@ -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 diff --git a/src/ChangeLog.3 b/src/ChangeLog.3 index cbf867829c7..493e8e1ab04 100644 --- a/src/ChangeLog.3 +++ b/src/ChangeLog.3 @@ -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.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) : Remove unnecessay "do" + (ccl_driver) : Remove unnecessary "do" statement. 2001-01-23 Gerd Moellmann diff --git a/src/fileio.c b/src/fileio.c index 7e75e6285f0..5f7a8ad3972 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)); 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..61fd2f2b998 100644 --- a/src/fringe.c +++ b/src/fringe.c @@ -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/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..b02561442e5 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -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/w32fns.c b/src/w32fns.c index 434861320a5..96b3f69b728 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); 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 { -- cgit v1.2.1 From b6e64c4136905ab4f00194c360bd6cd3cd767b9c Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 22 Nov 2011 23:09:27 -0800 Subject: * src/font.c (font_find_for_lface) [HAVE_NS]: Ignore case. Fixes: debbugs:2526 --- src/ChangeLog | 4 ++++ src/font.c | 9 +-------- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 1dca6864986..ade7eaec1e0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2011-11-23 Glenn Morris + + * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526) + 2011-11-23 Chong Yidong * xdisp.c (compute_stop_pos): Check validity of end_charpos before 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)) { -- cgit v1.2.1 From 56e2e794b0b830b2ccb8d43f5651d13f8be176a5 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Wed, 23 Nov 2011 10:57:27 +0100 Subject: In Fkill_buffer do replace_buffer_in_windows before Fset_buffer. (Bug#10114) * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before making another buffer current. (Bug#10114) --- src/ChangeLog | 5 +++++ src/buffer.c | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index ade7eaec1e0..694478e2d39 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-11-23 Martin Rudalics + + * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before + making another buffer current. (Bug#10114) + 2011-11-23 Glenn Morris * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526) diff --git a/src/buffer.c b/src/buffer.c index a327a1650f1..f8482c351c5 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); -- cgit v1.2.1 From 90ec88df9f36d19547d287526f71cc27d76ccabb Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Thu, 24 Nov 2011 00:09:08 +0800 Subject: * src/window.c (Fcoordinates_in_window_p): Accept only live windows. --- src/ChangeLog | 4 ++++ src/window.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 694478e2d39..42e54c41dff 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2011-11-23 Chong Yidong + + * window.c (Fcoordinates_in_window_p): Accept only live windows. + 2011-11-23 Martin Rudalics * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before diff --git a/src/window.c b/src/window.c index dd354b0ceea..bb2478d78fd 100644 --- a/src/window.c +++ b/src/window.c @@ -1052,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 @@ -1073,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); -- cgit v1.2.1 From 20db1522fe719b5de3f7cf9b373183d4b3437e94 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Thu, 24 Nov 2011 02:58:14 +0100 Subject: Fix typos. --- src/ChangeLog.11 | 2 +- src/msdos.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ChangeLog.11 b/src/ChangeLog.11 index 72871475b69..cb8b413a514 100644 --- a/src/ChangeLog.11 +++ b/src/ChangeLog.11 @@ -2191,7 +2191,7 @@ 2010-12-16 Jan Djärv * 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 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, -- cgit v1.2.1 From fa4fdb5ca559f8aae4137f8d3b974c14c760360d Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 24 Nov 2011 21:02:39 +0200 Subject: * src/image.c (imagemagick_load_image): Move `MagickSetResolution' down after the `MagickPingImage' call. Fixes: debbugs:10112 --- src/ChangeLog | 5 +++++ src/image.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 42e54c41dff..59115a910e3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-11-24 Juri Linkov + + * image.c (imagemagick_load_image): Move `MagickSetResolution' down + after the `MagickPingImage' call. (Bug#10112) + 2011-11-23 Chong Yidong * window.c (Fcoordinates_in_window_p): Accept only live windows. 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'", -- cgit v1.2.1 From e4920bc99dfcee02c3bb83b46a761b0893f76626 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 24 Nov 2011 23:14:48 -0800 Subject: Spelling fixes. --- src/ChangeLog.10 | 2 +- src/ChangeLog.8 | 2 +- src/callint.c | 2 +- src/ccl.c | 2 +- src/cm.h | 2 +- src/fringe.c | 2 +- src/process.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/ChangeLog.10 b/src/ChangeLog.10 index ada5e0f78ef..6acc09c2164 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. diff --git a/src/ChangeLog.8 b/src/ChangeLog.8 index e21af17657f..6bc83055c7b 100644 --- a/src/ChangeLog.8 +++ b/src/ChangeLog.8 @@ -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 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/cm.h b/src/cm.h index 8f23990ce55..dbf0820b94c 100644 --- a/src/cm.h +++ b/src/cm.h @@ -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/fringe.c b/src/fringe.c index 61fd2f2b998..da896e07b76 100644 --- a/src/fringe.c +++ b/src/fringe.c @@ -35,7 +35,7 @@ along with GNU Emacs. If not, see . */ 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. diff --git a/src/process.c b/src/process.c index a02ba44ae71..892bd9820bf 100644 --- a/src/process.c +++ b/src/process.c @@ -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) { -- cgit v1.2.1 From 8c535114e2eceabcf14127715dccf7842f5b55a8 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 25 Nov 2011 13:32:14 +0200 Subject: Fix bug #10105 with Isearch triggered scrolling under scroll-conservatively. src/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. --- src/ChangeLog | 7 +++++++ src/xdisp.c | 20 +++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 59115a910e3..1614b02786b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2011-11-25 Eli Zaretskii + + * 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) + 2011-11-24 Juri Linkov * image.c (imagemagick_load_image): Move `MagickSetResolution' down diff --git a/src/xdisp.c b/src/xdisp.c index 403272e7d0c..953a102b095 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -15043,6 +15043,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p) int centering_position = -1; int last_line_misfit = 0; EMACS_INT beg_unchanged, end_unchanged; + int scrolling_up; SET_TEXT_POS (lpoint, PT, PT_BYTE); opoint = lpoint; @@ -15557,7 +15558,6 @@ 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; /* If there is a scroll margin at the top of the window, find @@ -15720,6 +15720,24 @@ 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; + + move_it_by_lines (&it, scrolling_up ? 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. */ -- cgit v1.2.1 From e9fce1acd8e0702c35b2c28d3b4893a913e5c67b Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Fri, 25 Nov 2011 14:26:30 +0100 Subject: Fix typos. --- src/ChangeLog | 2 +- src/ChangeLog.10 | 2 +- src/ChangeLog.11 | 10 +++++----- src/ChangeLog.6 | 18 +++++++++--------- 4 files changed, 16 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 1614b02786b..fe7080f9c02 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -7730,7 +7730,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 diff --git a/src/ChangeLog.10 b/src/ChangeLog.10 index 6acc09c2164..4c0590aa94b 100644 --- a/src/ChangeLog.10 +++ b/src/ChangeLog.10 @@ -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. diff --git a/src/ChangeLog.11 b/src/ChangeLog.11 index cb8b413a514..7c027f1caec 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 @@ -3268,7 +3268,7 @@ 2010-10-10 Lars Magne Ingebrigtsen * 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 @@ -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 @@ -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 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. -- cgit v1.2.1 From 5c730f48c59db8a891cbe46014645f01b4c201e6 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 25 Nov 2011 17:22:30 +0200 Subject: Fix a thinko in 2011-11-25T11:32:14Z!eliz@gnu.org. --- src/xdisp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/xdisp.c b/src/xdisp.c index 953a102b095..9397d15acb7 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -15043,7 +15043,6 @@ redisplay_window (Lisp_Object window, int just_this_one_p) int centering_position = -1; int last_line_misfit = 0; EMACS_INT beg_unchanged, end_unchanged; - int scrolling_up; SET_TEXT_POS (lpoint, PT, PT_BYTE); opoint = lpoint; @@ -15559,6 +15558,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p) : 0; EMACS_INT margin_pos = CHARPOS (startp); Lisp_Object aggressive; + int scrolling_up; /* If there is a scroll margin at the top of the window, find its character position. */ @@ -15730,8 +15730,9 @@ redisplay_window (Lisp_Object window, int just_this_one_p) 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, scrolling_up ? margin + 1 : margin -1); + 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)) -- cgit v1.2.1 From 91b4a718988e9d56c2e135d3d41ae3578cbacffd Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 25 Nov 2011 21:52:46 +0200 Subject: Fix bug #10119 with C-e and whitespace-mode. src/xdisp.c (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. --- src/ChangeLog | 3 +++ src/xdisp.c | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index fe7080f9c02..6d1a645c3ee 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -4,6 +4,9 @@ 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 diff --git a/src/xdisp.c b/src/xdisp.c index 9397d15acb7..921155940b5 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -2846,8 +2846,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); -- cgit v1.2.1 From 5b76caa476d552e204adc3c1bf4af8e401ec5d42 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 25 Nov 2011 23:42:44 -0800 Subject: 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. --- src/ChangeLog | 9 +++++++++ src/fileio.c | 4 ++-- src/process.c | 31 +++++++++++++++++-------------- 3 files changed, 28 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 6d1a645c3ee..9097eab47a2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2011-11-26 Paul Eggert + + 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 * xdisp.c (redisplay_window): If cursor row is not fully visible diff --git a/src/fileio.c b/src/fileio.c index 5f7a8ad3972..009f35d2a7f 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -3686,7 +3686,7 @@ variable `last-coding-system-used' to the coding system actually used. */) int this_count = SPECPDL_INDEX (); int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); Lisp_Object conversion_buffer; - struct gcpro gcpro1; + struct gcpro inner_gcpro1; conversion_buffer = code_conversion_save (1, multibyte); @@ -3702,7 +3702,7 @@ variable `last-coding-system-used' to the coding system actually used. */) inserted = 0; /* Bytes put into CONVERSION_BUFFER so far. */ unprocessed = 0; /* Bytes not processed in previous loop. */ - GCPRO1 (conversion_buffer); + GCPRO1_VAR (conversion_buffer, inner_gcpro); while (how_much < total) { /* We read one bunch by one (READ_BUF_SIZE bytes) to allow diff --git a/src/process.c b/src/process.c index 892bd9820bf..ba3eeb81614 100644 --- a/src/process.c +++ b/src/process.c @@ -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. */ -- cgit v1.2.1 From b0b199744d35273a496b8e9189a28a83c70191da Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 26 Nov 2011 00:26:37 -0800 Subject: Spelling fixes. --- src/ChangeLog.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog.8 b/src/ChangeLog.8 index 6bc83055c7b..4c9ecfb4d4d 100644 --- a/src/ChangeLog.8 +++ b/src/ChangeLog.8 @@ -12766,7 +12766,7 @@ 1998-12-08 Geoff Voelker - * makefile.nt: Do string comparision of _NMAKE_VER. + * makefile.nt: Do string comparison of _NMAKE_VER. 1998-12-06 Eli Zaretskii -- cgit v1.2.1 From 394305db3457d6799f87cc058ac58ff577991b4e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 26 Nov 2011 15:11:03 +0200 Subject: src/dispnew.c (update_window): Fix outdated commentary. --- src/dispnew.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/dispnew.c b/src/dispnew.c index 8abf5782a88..385ad98e21f 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -3578,12 +3578,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; @@ -3628,6 +3627,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); -- cgit v1.2.1 From 83aca1cb6970314dcc6c35c1432ebcac42811926 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 26 Nov 2011 13:40:41 -0800 Subject: * fileio.c (Finsert_file_contents): Undo previous change. See . --- src/ChangeLog | 5 +++++ src/fileio.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 9097eab47a2..dd7b715e443 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-11-26 Paul Eggert + + * fileio.c (Finsert_file_contents): Undo previous change; see + . + 2011-11-26 Paul Eggert Rename locals to avoid shadowing. diff --git a/src/fileio.c b/src/fileio.c index 009f35d2a7f..5f7a8ad3972 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -3686,7 +3686,7 @@ variable `last-coding-system-used' to the coding system actually used. */) int this_count = SPECPDL_INDEX (); int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); Lisp_Object conversion_buffer; - struct gcpro inner_gcpro1; + struct gcpro gcpro1; conversion_buffer = code_conversion_save (1, multibyte); @@ -3702,7 +3702,7 @@ variable `last-coding-system-used' to the coding system actually used. */) inserted = 0; /* Bytes put into CONVERSION_BUFFER so far. */ unprocessed = 0; /* Bytes not processed in previous loop. */ - GCPRO1_VAR (conversion_buffer, inner_gcpro); + GCPRO1 (conversion_buffer); while (how_much < total) { /* We read one bunch by one (READ_BUF_SIZE bytes) to allow -- cgit v1.2.1 From e47695319fc758da7ff07d7084386258b6c8b677 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 26 Nov 2011 20:43:11 -0800 Subject: Spelling fixes. --- src/ChangeLog.10 | 2 +- src/ChangeLog.11 | 4 ++-- src/ChangeLog.3 | 2 +- src/ChangeLog.8 | 2 +- src/buffer.c | 4 ++-- src/charset.c | 4 ++-- src/dispextern.h | 2 +- src/gtkutil.h | 4 ++-- src/lisp.h | 4 ++-- src/lread.c | 2 +- src/nsterm.m | 2 +- src/w32fns.c | 3 ++- src/widget.c | 2 +- src/widget.h | 3 +-- src/window.c | 4 ++-- src/xdisp.c | 3 ++- src/xfaces.c | 4 ++-- 17 files changed, 26 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/ChangeLog.10 b/src/ChangeLog.10 index 4c0590aa94b..42af99ccc58 100644 --- a/src/ChangeLog.10 +++ b/src/ChangeLog.10 @@ -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 7c027f1caec..7c46dea675c 100644 --- a/src/ChangeLog.11 +++ b/src/ChangeLog.11 @@ -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 @@ -31330,7 +31330,7 @@ 2007-05-12 Chong Yidong - * 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 493e8e1ab04..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 diff --git a/src/ChangeLog.8 b/src/ChangeLog.8 index 4c9ecfb4d4d..2f3ee45a1ac 100644 --- a/src/ChangeLog.8 +++ b/src/ChangeLog.8 @@ -5409,7 +5409,7 @@ 1998-11-10 Gerd Moellmann - * 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 diff --git a/src/buffer.c b/src/buffer.c index f8482c351c5..a482493fac7 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1631,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); @@ -2486,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/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; diff --git a/src/dispextern.h b/src/dispextern.h index 3225c1eb46e..5228a71ba3f 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. */ 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/lisp.h b/src/lisp.h index dcd1167e0a2..fa41239a1c8 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -324,7 +324,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 +349,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; 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/nsterm.m b/src/nsterm.m index b02561442e5..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]; } diff --git a/src/w32fns.c b/src/w32fns.c index 96b3f69b728..7a17c108d4d 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -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/widget.c b/src/widget.c index 0582718948d..181811b8369 100644 --- a/src/widget.c +++ b/src/widget.c @@ -808,7 +808,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..b5b4147b167 100644 --- a/src/widget.h +++ b/src/widget.h @@ -92,9 +92,8 @@ 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); #endif /* _EmacsFrame_h */ - diff --git a/src/window.c b/src/window.c index bb2478d78fd..af4fad054a2 100644 --- a/src/window.c +++ b/src/window.c @@ -3088,7 +3088,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); @@ -6299,7 +6299,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 921155940b5..c9b9b5c5e88 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -28662,7 +28662,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 . */ 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) -- cgit v1.2.1 From e9a452d9cd08b5e09fa7ee51d1f57bbc4a9509c0 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 27 Nov 2011 10:17:40 -0800 Subject: Spelling fixes (mostly "inactive" vs "deactivate"). --- src/ChangeLog.10 | 2 +- src/search.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ChangeLog.10 b/src/ChangeLog.10 index 42af99ccc58..7d2f48a03ea 100644 --- a/src/ChangeLog.10 +++ b/src/ChangeLog.10 @@ -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 diff --git a/src/search.c b/src/search.c index a6a0fddb137..fe4ce534b0b 100644 --- a/src/search.c +++ b/src/search.c @@ -3132,7 +3132,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. */) -- cgit v1.2.1 From 54e9e3bf847d39b8c0daa46a999efeb6f84c9d76 Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Sun, 27 Nov 2011 19:33:17 +0100 Subject: Work around an Ubuntu 11.10 bug where Emacs loops forever when started. * configure.in: Check for gtk_window_set_has_resize_grip. * src/gtkutil.c (xg_create_frame_widgets): Call gtk_window_set_has_resize_grip (FALSE) if that function is present with Gtk+ 2.0. --- src/ChangeLog | 6 ++++++ src/gtkutil.c | 8 ++++++++ 2 files changed, 14 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index dd7b715e443..5b1d5aa2f24 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2011-11-27 Jan Djärv + + * 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 * fileio.c (Finsert_file_contents): Undo previous change; see 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); -- cgit v1.2.1 From 8c9afb46949ddd9853f38eb8c1a865cb13522d92 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 27 Nov 2011 20:52:53 +0200 Subject: Fix MS-Windows build with MSVC compiler. Parts of the changes by Fabrice Popineau . lib-src/makefile.w32-in (LOCAL_FLAGS): Add $(EMACS_EXTRA_C_FLAGS). lib-src/emacsclient.c (main) : Remove declaration, already pulled in by unistd.h on Posix hosts and stdlib.h on MS-Windows. nt/inc/stdint.h (uint32_t, uint64_t) [_WIN64]: New typedefs. (UINT64_MAX) [_WIN64]: Fix definition. (uintmax_t, intmax_t): Fix definitions. nt/inc/inttypes.h (strtoumax, strtoimax) [!__MINGW32__]: Provide correct definitions. nt/config.nt (HAVE_DECL_STRTOLL): Define. (va_copy) [_WIN64]: Provide a better definition. src/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. src/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. (tzname): Redirect to _tzname for all values of _MSC_VER. Fixes: debbugs:9960 --- src/ChangeLog | 16 ++++++++++++++++ src/lisp.h | 15 ++++++++++----- src/s/ms-w32.h | 8 ++++++-- 3 files changed, 32 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 5b1d5aa2f24..a2d84d901b5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,19 @@ +2011-11-27 Eli Zaretskii + + * 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 * gtkutil.c (xg_create_frame_widgets): Call diff --git a/src/lisp.h b/src/lisp.h index fa41239a1c8..5735c207241 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) 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 -- cgit v1.2.1 From 1305621bc212d922c5ef8ee89d73ce7aae496b71 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Mon, 28 Nov 2011 10:07:01 +0900 Subject: Truncate scroll runs that copy to where we copied to. * 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. --- src/ChangeLog | 6 +++++ src/dispnew.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 72 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index a2d84d901b5..83b625d279e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2011-11-28 YAMAMOTO Mitsuharu + + * 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 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define. diff --git a/src/dispnew.c b/src/dispnew.c index 385ad98e21f..c9e4ec5c20e 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -4554,18 +4554,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; } } @@ -4580,7 +4631,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; } } -- cgit v1.2.1 From dbf312256d8a8c731dadaf27c1260832a3796350 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 28 Nov 2011 00:20:58 -0800 Subject: 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 . All uses changed to use GCPRO1 etc. (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO): Revert to old implementation (i.e., before 2011-03-11). --- src/ChangeLog | 10 +++ src/dired.c | 18 ++--- src/keyboard.c | 14 ++-- src/lisp.h | 228 +++++++++++++++++++++++++++------------------------------ src/process.c | 10 +-- src/xfns.c | 12 +-- 6 files changed, 143 insertions(+), 149 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 83b625d279e..915e0659a0e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2011-11-28 Paul Eggert + + 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 + . + 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 * dispnew.c (scrolling_window): Truncate overlaps in copy destination 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/keyboard.c b/src/keyboard.c index 9b4ba427c24..e74c7ca1c68 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2998,7 +2998,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. */ @@ -3026,7 +3026,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 +3064,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)) @@ -9053,9 +9053,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; @@ -9351,7 +9351,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; } @@ -10049,7 +10049,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, add_command_key (keybuf[t]); } - UNGCPRO_VAR (outer_gcpro); + UNGCPRO; return t; } diff --git a/src/lisp.h b/src/lisp.h index 5735c207241..e645fbd65a5 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2223,143 +2223,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/process.c b/src/process.c index ba3eeb81614..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)) 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 -- cgit v1.2.1 From 2b56b87e029eaa04f243718c1690eca5545c5102 Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Tue, 29 Nov 2011 19:08:53 +0100 Subject: * xterm.c (handle_one_xevent): Only set async_visible and friends if net_wm_state_hidden_seen is non-zero (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if _NET_WM_STATE_HIDDEN is in NET_WM_STATE. * xterm.h (struct x_output): net_wm_state_hidden_seen is new. Fixes: debbugs:10002 --- src/ChangeLog | 9 +++++++++ src/xterm.c | 9 +++++++-- src/xterm.h | 3 +++ 3 files changed, 19 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 915e0659a0e..3b1fd5e6a51 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2011-11-29 Jan Djärv + + * 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 Remove GCPRO-related macros that exist only to avoid shadowing locals. diff --git a/src/xterm.c b/src/xterm.c index 063794bae65..e41af2b2870 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -6114,7 +6114,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, @@ -6124,6 +6125,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); } @@ -8480,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) 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) -- cgit v1.2.1 From 801a431304543436accd7088de953dbb5fc15838 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 30 Nov 2011 07:25:09 -0500 Subject: Fix bug #10164 with assertion violations in linum-mode. src/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. --- src/ChangeLog | 6 ++++++ src/dispnew.c | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 3b1fd5e6a51..086d795341c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2011-11-30 Eli Zaretskii + + * 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 * xterm.h (struct x_output): net_wm_state_hidden_seen is new. diff --git a/src/dispnew.c b/src/dispnew.c index c9e4ec5c20e..7e591aa8e8f 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -608,9 +608,10 @@ 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 - || row->mode_line_p - || verify_row_hash (row)); +#if XASSERTS + if (row->enabled_p && !row->mode_line_p) + verify_row_hash (row)); +#endif ++row; } } -- cgit v1.2.1 From febe6beadce3699409fc4034a9afaca68438c4e6 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Wed, 30 Nov 2011 13:58:42 +0100 Subject: src/dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check. --- src/ChangeLog | 4 ++++ src/dispnew.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 086d795341c..8becf2b580e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2011-11-30 Juanma Barranquero + + * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check. + 2011-11-30 Eli Zaretskii * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's diff --git a/src/dispnew.c b/src/dispnew.c index 7e591aa8e8f..d2f33f0b5e4 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -610,7 +610,7 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y } #if XASSERTS if (row->enabled_p && !row->mode_line_p) - verify_row_hash (row)); + xassert (verify_row_hash (row)); #endif ++row; } -- cgit v1.2.1 From 5c32d3f2f93edced9c004698eaa2234d809fee02 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Wed, 30 Nov 2011 17:33:05 +0100 Subject: Fix typos. --- src/ChangeLog | 2 +- src/ftfont.c | 2 +- src/term.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 8becf2b580e..4121da08617 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -8688,7 +8688,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/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/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); -- cgit v1.2.1 From 73d6c093dc3b6363835f53edac65799c6422493b Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 30 Nov 2011 18:50:38 +0200 Subject: REALLY fix bug #10164 with crashes when linum-mode is turned on. src/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. --- src/ChangeLog | 6 ++++++ src/dispnew.c | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 4121da08617..cd3d5b0ac3c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2011-11-30 Eli Zaretskii + + * 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 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check. diff --git a/src/dispnew.c b/src/dispnew.c index d2f33f0b5e4..2c0e74d0dde 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -608,10 +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; } -#if XASSERTS - if (row->enabled_p && !row->mode_line_p) - xassert (verify_row_hash (row)); -#endif ++row; } } -- cgit v1.2.1 From 3360a3fcb0c01428a42f1fb8a0b7459e0e6cac72 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Thu, 1 Dec 2011 19:27:52 +0100 Subject: Fixes: debbugs:10169 * src/keyboard.c (interrupt_signal): Don't call kill-emacs when waiting for input. --- src/ChangeLog | 5 +++++ src/keyboard.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index cd3d5b0ac3c..f230cdba26f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-12-01 Andreas Schwab + + * keyboard.c (interrupt_signal): Don't call kill-emacs when + waiting for input. (Bug#10169) + 2011-11-30 Eli Zaretskii * dispnew.c (adjust_glyph_matrix): Remove the assertion that diff --git a/src/keyboard.c b/src/keyboard.c index e74c7ca1c68..8f316c5e446 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -10858,7 +10858,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; -- cgit v1.2.1 From 0068070eb050be4d7f46313e67e5902a931ce051 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 1 Dec 2011 15:19:38 -0500 Subject: * src/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. Fixes: debbugs:10117 --- src/ChangeLog | 7 +++++++ src/fileio.c | 20 ++++++++++---------- 2 files changed, 17 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index f230cdba26f..75f62ad6fbd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2011-12-01 Stefan Monnier + + * 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 * keyboard.c (interrupt_signal): Don't call kill-emacs when diff --git a/src/fileio.c b/src/fileio.c index 5f7a8ad3972..c0f6c1d2e8e 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -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) { -- cgit v1.2.1 From 02b16839f5242e93a234e7ebb0578d5aebb529ca Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Fri, 2 Dec 2011 12:19:49 +0200 Subject: Change `wordify' to `word-search-regexp'. * lisp/isearch.el (isearch-occur): Use `word-search-regexp' for `isearch-word'. (isearch-search-and-update): Add condition for `isearch-word' and call `word-search-regexp'. * src/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'. Fixes: debbugs:10145 --- src/ChangeLog | 9 +++++++++ src/search.c | 59 +++++++++++++++++++++++++++++++++++++++-------------------- 2 files changed, 48 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 75f62ad6fbd..ed47da2caa1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2011-12-02 Juri Linkov + + * 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 * fileio.c (Finsert_file_contents): Move after-change-function call diff --git a/src/search.c b/src/search.c index fe4ce534b0b..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, @@ -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); -- cgit v1.2.1 From 9e49252b2d8fe1a3f078ec0342df0008cea5059e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 3 Dec 2011 09:59:23 +0200 Subject: Fix parts 1 & 2 of bug #10183 with RTL headings in Org mode. src/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. --- src/ChangeLog | 6 ++++++ src/xdisp.c | 51 +++++++++++++++++++++++++++++++-------------------- 2 files changed, 37 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index ed47da2caa1..efba68d99d6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2011-12-03 Eli Zaretskii + + * 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) + 2011-12-02 Juri Linkov * search.c (Fword_search_regexp): New Lisp function created from diff --git a/src/xdisp.c b/src/xdisp.c index c9b9b5c5e88..b9741d97d30 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -4093,26 +4093,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. */ { @@ -4121,11 +4132,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, -- cgit v1.2.1 From e9a494263ca8d8e39373597ebf432ee001d62e21 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 3 Dec 2011 11:55:27 +0200 Subject: Fix bug #10192 with assertion violation when scrolling. src/xdisp.c (redisplay_window): Don't let `margin' become negative. This could happen when scroll-margin is zero and scroll-*-aggressively is a small float number. --- src/ChangeLog | 1 + src/xdisp.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index efba68d99d6..61b44593062 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -3,6 +3,7 @@ * 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 diff --git a/src/xdisp.c b/src/xdisp.c index b9741d97d30..7708b9c40fa 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -15617,7 +15617,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 -- cgit v1.2.1 From c052ead41f5a53da9cc32e7697005fac3506a858 Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Sat, 3 Dec 2011 20:15:20 +0100 Subject: * 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. Fixes: debbugs:10104 --- src/ChangeLog | 10 ++++++++++ src/widget.c | 11 +++++++++++ src/widget.h | 1 + src/xterm.c | 8 ++++++++ 4 files changed, 30 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 61b44593062..6a13bd87264 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2011-12-03 Jan Djärv + + * 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 * xdisp.c (handle_invisible_prop): If the invisible text ends just diff --git a/src/widget.c b/src/widget.c index 181811b8369..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 diff --git a/src/widget.h b/src/widget.h index b5b4147b167..11041d54ad0 100644 --- a/src/widget.h +++ b/src/widget.h @@ -95,5 +95,6 @@ extern struct _DisplayContext* display_context; /* 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/xterm.c b/src/xterm.c index e41af2b2870..290acdd9ca4 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -9561,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 */; -- cgit v1.2.1