diff options
| author | Karoly Lorentey <lorentey@elte.hu> | 2005-02-20 18:47:54 +0000 |
|---|---|---|
| committer | Karoly Lorentey <lorentey@elte.hu> | 2005-02-20 18:47:54 +0000 |
| commit | b5d78df397f8cdcd20f3bcfbed2eb71d522abddd (patch) | |
| tree | cedfc1db69595526c12da068ea7ff5bdf3b806f2 /src | |
| parent | 60c73d2ed638e5d51643c65a0fc6dea618fc72c8 (diff) | |
| parent | eedeacb3074baad8ce752a506f9f435c98e42ff4 (diff) | |
Merged from miles@gnu.org--gnu-2005 (patch 17-26, 107-116)
Patches applied:
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-107
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-108
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-109
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-110
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-111
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-112
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-113
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-114
<no summary provided>
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-115
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-116
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-17
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-18
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-19
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-20
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-21
More work on moving images to etc/images
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-22
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-23
Fix errors with image-file installation
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-24
etc/Makefile.in (install): Put gnus-tut.txt in the right place.
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-25
etc/Makefile.in (install, uninstall): Fix installed image dirs.
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-26
etc/Makefile.in (install): Create $(etcdir)/images/gnus dir.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-296
Diffstat (limited to 'src')
| -rw-r--r-- | src/.gdbinit | 187 | ||||
| -rw-r--r-- | src/ChangeLog | 37 | ||||
| -rw-r--r-- | src/ChangeLog.5 | 10 | ||||
| -rw-r--r-- | src/alloc.c | 11 | ||||
| -rw-r--r-- | src/xdisp.c | 101 | ||||
| -rw-r--r-- | src/xfaces.c | 2 |
6 files changed, 294 insertions, 54 deletions
diff --git a/src/.gdbinit b/src/.gdbinit index 358774f5bec..09c70c9ead8 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -101,6 +101,193 @@ document ppt Print point, beg, end, narrow, and gap for current buffer. end +# Print out iterator given as first arg +define pitx + set $it = $arg0 + printf "cur=%d", $it->current.pos.charpos + if ($it->current.pos.charpos != $it->current.pos.bytepos) + printf "[%d]", $it->current.pos.bytepos + end + printf " start=%d", $it->start.pos.charpos + if ($it->start.pos.charpos != $it->start.pos.bytepos) + printf "[%d]", $it->start.pos.bytepos + end + printf " stop=%d ", $it->stop_charpos + output $it->what + if ($it->what == IT_CHARACTER) + if ($it->len == 1 && $it->c >= ' ' && it->c < 255) + printf "['%c']", $it->c + else + printf "[%d,%d]", $it->c, $it->len + end + end + printf " next=" + output $it->method + printf "\n" + printf "vpos=%d hpos=%d", $it->vpos, $it->hpos, + printf " y=%d lvy=%d", $it->current_y, $it->last_visible_y + printf " x=%d lvx=%d", $it->current_x, $it->last_visible_x + printf " a+d=%d+%d=%d", $it->ascent, $it->descent, $it->ascent+$it->descent + printf " max=%d+%d=%d", $it->max_ascent, $it->max_descent, $it->max_ascent+$it->max_descent + printf "\n" +end +document pitx +Pretty print a display iterator. +Take one arg, an iterator object or pointer. +end + +define pit + pitx it +end +document pit +Pretty print the display iterator it. +end + +define prowx + set $row = $arg0 + 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 "start=%d end=%d", $row->start.pos.charpos, $row->end.pos.charpos + if ($row->enabled_p) + printf " ENA" + end + if ($row->displays_text_p) + printf " DISP" + end + if ($row->mode_line_p) + printf " MODEL" + end + if ($row->continued_p) + printf " CONT" + end + if ($row-> truncated_on_left_p) + printf " TRUNC:L" + end + if ($row-> truncated_on_right_p) + printf " TRUNC:R" + end + if ($row->starts_in_middle_of_char_p) + printf " STARTMID" + end + if ($row->ends_in_middle_of_char_p) + printf " ENDMID" + end + if ($row->ends_in_newline_from_string_p) + printf " ENDNLFS" + end + if ($row->ends_at_zv_p) + printf " ENDZV" + end + if ($row->overlapped_p) + printf " OLAPD" + end + if ($row->overlapping_p) + printf " OLAPNG" + end + printf "\n" +end +document prowx +Pretty print information about glyph_row. +Takes one argument, a row object or pointer. +end + +define prow + prowx row +end +document prow +Pretty print information about glyph_row in row. +end + + +define pcursorx + set $cp = $arg0 + printf "y=%d x=%d vpos=%d hpos=%d", $cp->y, $cp->x, $cp->vpos, $cp->hpos +end +document pcursorx +Pretty print a window cursor +end + +define pcursor + printf "output: " + pcursorx output_cursor + printf "\n" +end +document pcursor +Pretty print the output_cursor +end + +define pwinx + set $w = $arg0 + xgetint $w->sequence_number + if ($w->mini_p != Qnil) + printf "Mini " + end + printf "Window %d ", $int + xgetptr $w->buffer + set $tem = (struct buffer *) $ptr + xgetptr $tem->name + printf "%s", ((struct Lisp_String *) $ptr)->data + printf "\n" + xgetptr $w->start + set $tem = (struct Lisp_Marker *) $ptr + printf "start=%d end:", $tem->charpos + if ($w->window_end_valid != Qnil) + xgetint $w->window_end_pos + printf "pos=%d", $int + xgetint $w->window_end_vpos + printf " vpos=%d", $int + else + printf "invalid" + end + printf " vscroll=%d", $w->vscroll + if ($w->force_start != Qnil) + printf " FORCE_START" + end + if ($w->must_be_updated_p) + printf " MUST_UPD" + end + printf "\n" + printf "cursor: " + pcursorx $w->cursor + printf " phys: " + pcursorx $w->phys_cursor + if ($w->phys_cursor_on_p) + printf " ON" + else + printf " OFF" + end + printf " blk=" + if ($w->last_cursor_off_p != $w->cursor_off_p) + if ($w->last_cursor_off_p) + printf "ON->" + else + printf "OFF->" + end + end + if ($w->cursor_off_p) + printf "ON" + else + printf "OFF" + end + printf "\n" +end +document pwinx +Pretty print a window structure. +Takes one argument, a pointer to a window structure +end + +define pwin + pwinx w +end +document pwin +Pretty print window structure w. +end + + define xtype xgettype $ output $type diff --git a/src/ChangeLog b/src/ChangeLog index 400946fb4d0..7c926e9b919 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,40 @@ +2005-02-20 Kim F. Storm <storm@cua.dk> + + * xdisp.c (pos_visible_p): Be sure to move to the specified + position. Always get the full ascent / descent of the + corresponding row, to return reliable rtop and rbot values. + (back_to_previous_visible_line_start): Fix 2005-01-18 change. + Must look one character back, as back_to_previous_line_start + returns position after the newline. + (move_it_vertically_backward): Fix heuristic for when to move further + back in case line_height * 2/3 is larger than window height. + (cursor_row_fully_visible_p): Rename make_cursor_line_fully_visible_p + as it does not do anything anymore. Add arg current_matrix_p to + use current matrix rather than desired matrix when set. + (try_cursor_movement): Don't scroll to make cursor row fully + visible if cursor didn't move. This avoids unexpected recentering + in case of blinking cursor or accepting process output. + Use current matrix to check cursor row visibility. + (redisplay_window): Fix whether to recenter or move to top in case + cursor line is taller than window height. + (find_first_unchanged_at_end_row): Stop search if we reach a row + which not enabled (instead of abort). + +2005-02-18 Kim F. Storm <storm@cua.dk> + + * xfaces.c (Finternal_set_lisp_face_attribute): Allow :color property + to be nil in a :box attribute value list; customize prints that + as lisp value when no box color is specified. + + * .gdbinit (pitx, pit): Pretty print display iterator. + (prowx, prow): Pretty print glyph row. + (pcursorx, pcursor): Pretty print a window cursor. + (pwinx, pwin): Pretty print struct window. + +2005-02-18 Stefan Monnier <monnier@iro.umontreal.ca> + + * alloc.c (BLOCK_BYTES): Harmless typo. + 2005-02-17 Andreas Schwab <schwab@suse.de> * xfns.c (hack_wm_protocols): Use correct type for last parameter diff --git a/src/ChangeLog.5 b/src/ChangeLog.5 index 20fc4887084..5e50066bc78 100644 --- a/src/ChangeLog.5 +++ b/src/ChangeLog.5 @@ -3405,7 +3405,7 @@ (UNISTD_H_INCLUDED): Don't define or test this. * m/ibm370aix.h (NEED_UNISTD_H): Defined. * s/aix3-1.h (NEED_UNISTD_H): Defined. - * s/irix4-0.h (NEED_UNISTD_H): Defined. + * s/irix4-0.h (NEED_UNISTD_H): Define. * fileio.c (internal_delete_file, internal_delete_file_1): New functions. @@ -3419,7 +3419,7 @@ 1994-11-24 Francesco Potorti` <pot@cnuce.cnr.it> * m/delta.h (C_SWITCH_MACHINE): -inline-functions removed, - because the compiler shipped with R3V7 is not stable. + because the compiler shipped with R3V7 is not stable. 1994-11-24 Richard Stallman <rms@mole.gnu.ai.mit.edu> @@ -3443,7 +3443,7 @@ (complete_and_exit_1, complete_and_exit_2): New subroutines. * s/aix4.h: New file. - * s/aix3-1.h (AIXHFT): Defined. + * s/aix3-1.h (AIXHFT): Define. * m/ibmrs6000.h (OBJECTS_MACHINE): Define only if AIXHFT. * sysdep.c (init_sys_modes): Tes AIXHFT, not AIX. @@ -6451,7 +6451,7 @@ Add an unwind protect to restore original buffer and kill the temp. * sysdep.c (init_system_name): Retry gethostbyname after TRY_AGAIN - failure. + failure. * process.c (Fopen_network_stream): Retry gethostbyname after TRY_AGAIN failure. @@ -6477,7 +6477,7 @@ * s/linux.h [emacs]: Include stdio.h. - * commands.h (unread_command_char): Declared. + * commands.h (unread_command_char): Declare. * dispnew.c (sit_for): Return immediately if unread events exist. 1994-07-17 Richard Stallman (rms@mole.gnu.ai.mit.edu) diff --git a/src/alloc.c b/src/alloc.c index 49fc69e7058..093919fee3d 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -1,6 +1,6 @@ /* Storage allocation and gc for GNU Emacs Lisp interpreter. Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -891,12 +891,13 @@ lisp_free (block) On glibc-2.3.2, malloc never tries to align, so a padding of 0 is best. posix_memalign on the other hand would ideally prefer a value of 4 because otherwise, there's 1020 bytes wasted between each ablocks. - But testing shows that those 1020 will most of the time be efficiently - used by malloc to place other objects, so a value of 0 is still preferable - unless you have a lot of cons&floats and virtually nothing else. */ + In Emacs, testing shows that those 1020 can most of the time be + efficiently used by malloc to place other objects, so a value of 0 can + still preferable unless you have a lot of aligned blocks and virtually + nothing else. */ #define BLOCK_PADDING 0 #define BLOCK_BYTES \ - (BLOCK_ALIGN - sizeof (struct aligned_block *) - BLOCK_PADDING) + (BLOCK_ALIGN - sizeof (struct ablock *) - BLOCK_PADDING) /* Internal data structures and constants. */ diff --git a/src/xdisp.c b/src/xdisp.c index 142b1fb1398..f8f97b44b3b 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -859,7 +859,7 @@ static struct glyph_row *get_overlay_arrow_glyph_row P_ ((struct window *, Lisp_Object)); static void extend_face_to_end_of_line P_ ((struct it *)); static int append_space_for_newline P_ ((struct it *, int)); -static int make_cursor_line_fully_visible P_ ((struct window *, int)); +static int cursor_row_fully_visible_p P_ ((struct window *, int, int)); static int try_scrolling P_ ((Lisp_Object, int, EMACS_INT, EMACS_INT, int, int)); static int try_cursor_movement P_ ((Lisp_Object, struct text_pos, int *)); static int trailing_whitespace_p P_ ((int)); @@ -1281,8 +1281,8 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, exact_mode_line_heights_p) } start_display (&it, w, top); - move_it_to (&it, charpos, 0, it.last_visible_y, -1, - MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y); + move_it_to (&it, charpos, -1, it.last_visible_y, -1, + MOVE_TO_POS | MOVE_TO_Y); /* Note that we may overshoot because of invisible text. */ if (IT_CHARPOS (it) >= charpos) @@ -1306,12 +1306,13 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, exact_mode_line_heights_p) } } } - else if (it.current_y + it.max_ascent + it.max_descent > it.last_visible_y) + else { struct it it2; it2 = it; - move_it_by_lines (&it, 1, 0); + if (IT_CHARPOS (it) < ZV && FETCH_BYTE (IT_BYTEPOS (it)) != '\n') + move_it_by_lines (&it, 1, 0); if (charpos < IT_CHARPOS (it)) { visible_p = 1; @@ -1322,8 +1323,9 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, exact_mode_line_heights_p) *y = it2.current_y + it2.max_ascent - it2.ascent; if (rtop) { - *rtop = 0; - *rbot = max (0, (it2.current_y + it2.max_ascent + it2.max_descent) - it.last_visible_y); + *rtop = max (0, -it2.current_y); + *rbot = max (0, ((it2.current_y + it2.max_ascent + it2.max_descent) + - it.last_visible_y)); } } } @@ -4693,27 +4695,31 @@ back_to_previous_visible_line_start (it) /* If newline has a display property that replaces the newline with something else (image or text), find start of overlay or interval and continue search from that point. */ - { - struct it it2 = *it; - int pos = IT_CHARPOS (*it); - int beg, end; - Lisp_Object val, overlay; + if (IT_CHARPOS (*it) > BEGV) + { + struct it it2 = *it; + int pos; + int beg, end; + Lisp_Object val, overlay; + + pos = --IT_CHARPOS (it2); + --IT_BYTEPOS (it2); + it2.sp = 0; + if (handle_display_prop (&it2) == HANDLED_RETURN + && !NILP (val = get_char_property_and_overlay + (make_number (pos), Qdisplay, Qnil, &overlay)) + && (OVERLAYP (overlay) + ? (beg = OVERLAY_POSITION (OVERLAY_START (overlay))) + : get_property_and_range (pos, Qdisplay, &val, &beg, &end, Qnil))) + { + if (beg < BEGV) + beg = BEGV; + IT_CHARPOS (*it) = beg; + IT_BYTEPOS (*it) = buf_charpos_to_bytepos (current_buffer, beg); + continue; + } + } - it2.sp = 0; - if (handle_display_prop (&it2) == HANDLED_RETURN - && !NILP (val = get_char_property_and_overlay - (make_number (pos), Qdisplay, Qnil, &overlay)) - && (OVERLAYP (overlay) - ? (beg = OVERLAY_POSITION (OVERLAY_START (overlay))) - : get_property_and_range (pos, Qdisplay, &val, &beg, &end, Qnil))) - { - if (beg < BEGV) - beg = BEGV; - IT_CHARPOS (*it) = beg; - IT_BYTEPOS (*it) = buf_charpos_to_bytepos (current_buffer, beg); - continue; - } - } break; } @@ -6326,7 +6332,8 @@ move_it_vertically_backward (it, dy) a line height of 13 pixels each, recentering with point on the bottom line will try to move -39/2 = 19 pixels backward. Try to avoid moving into the first line. */ - && it->current_y - target_y > line_height * 2 / 3 + && (it->current_y - target_y + > min (window_box_height (it->w), line_height * 2 / 3)) && IT_CHARPOS (*it) > BEGV) { TRACE_MOVE ((stderr, " not far enough -> move_vert %d\n", @@ -11084,7 +11091,7 @@ run_window_scroll_functions (window, startp) as if point had gone off the screen. */ static int -make_cursor_line_fully_visible (w, force_p) +cursor_row_fully_visible_p (w, force_p, current_matrix_p) struct window *w; int force_p; { @@ -11100,7 +11107,7 @@ make_cursor_line_fully_visible (w, force_p) if (w->cursor.vpos < 0) return 1; - matrix = w->desired_matrix; + matrix = current_matrix_p ? w->current_matrix : w->desired_matrix; row = MATRIX_ROW (matrix, w->cursor.vpos); /* If the cursor row is not partially visible, there's nothing to do. */ @@ -11405,7 +11412,7 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, /* If cursor ends up on a partially visible line, treat that as being off the bottom of the screen. */ - if (! make_cursor_line_fully_visible (w, extra_scroll_margin_lines <= 1)) + if (! cursor_row_fully_visible_p (w, extra_scroll_margin_lines <= 1, 0)) { clear_glyph_matrix (w->desired_matrix); ++extra_scroll_margin_lines; @@ -11675,6 +11682,12 @@ try_cursor_movement (window, startp, scroll_step) && CHARPOS (startp) != BEGV) scroll_p = 1; } + else + { + /* Cursor did not move. So don't scroll even if cursor line + is partially visible, as it was so before. */ + rc = CURSOR_MOVEMENT_SUCCESS; + } if (PT < MATRIX_ROW_START_CHARPOS (row) || PT > MATRIX_ROW_END_CHARPOS (row)) @@ -11682,7 +11695,8 @@ try_cursor_movement (window, startp, scroll_step) /* if PT is not in the glyph row, give up. */ rc = CURSOR_MOVEMENT_MUST_SCROLL; } - else if (MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row) + else if (rc != CURSOR_MOVEMENT_SUCCESS + && MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row) && make_cursor_line_fully_visible_p) { if (PT == MATRIX_ROW_END_CHARPOS (row) @@ -11701,7 +11715,7 @@ try_cursor_movement (window, startp, scroll_step) else { set_cursor_from_row (w, row, w->current_matrix, 0, 0, 0, 0); - if (!make_cursor_line_fully_visible (w, 0)) + if (!cursor_row_fully_visible_p (w, 0, 1)) rc = CURSOR_MOVEMENT_MUST_SCROLL; else rc = CURSOR_MOVEMENT_SUCCESS; @@ -11788,7 +11802,7 @@ redisplay_window (window, just_this_one_p) int temp_scroll_step = 0; int count = SPECPDL_INDEX (); int rc; - int centering_position; + int centering_position = -1; int last_line_misfit = 0; SET_TEXT_POS (lpoint, PT, PT_BYTE); @@ -12034,7 +12048,7 @@ redisplay_window (window, just_this_one_p) new_vpos = window_box_height (w) / 2; } - if (!make_cursor_line_fully_visible (w, 0)) + if (!cursor_row_fully_visible_p (w, 0, 0)) { /* Point does appear, but on a line partly visible at end of window. Move it back to a fully-visible line. */ @@ -12171,7 +12185,7 @@ redisplay_window (window, just_this_one_p) /* Forget any recorded base line for line number display. */ w->base_line_number = Qnil; - if (!make_cursor_line_fully_visible (w, 1)) + if (!cursor_row_fully_visible_p (w, 1, 0)) { clear_glyph_matrix (w->desired_matrix); last_line_misfit = 1; @@ -12231,10 +12245,8 @@ redisplay_window (window, just_this_one_p) /* Finally, just choose place to start which centers point */ recenter: - centering_position = window_box_height (w) / 2; - - point_at_top: - /* Jump here with centering_position already set to 0. */ + if (centering_position < 0) + centering_position = window_box_height (w) / 2; #if GLYPH_DEBUG debug_method_add (w, "recenter"); @@ -12331,7 +12343,7 @@ redisplay_window (window, just_this_one_p) set_cursor_from_row (w, row, w->current_matrix, 0, 0, 0, 0); } - if (!make_cursor_line_fully_visible (w, centering_position > 0)) + if (!cursor_row_fully_visible_p (w, 0, 0)) { /* If vscroll is enabled, disable it and try again. */ if (w->vscroll) @@ -12346,9 +12358,10 @@ redisplay_window (window, just_this_one_p) visible, if it can be done. */ if (centering_position == 0) goto done; + clear_glyph_matrix (w->desired_matrix); centering_position = 0; - goto point_at_top; + goto recenter; } done: @@ -13136,8 +13149,10 @@ find_first_unchanged_at_end_row (w, delta, delta_bytes) starts at a minimum position >= last_unchanged_pos_old. */ for (; row > first_text_row; --row) { + /* This used to abort, but it can happen. + It is ok to just stop the search instead here. KFS. */ if (!row->enabled_p || !MATRIX_ROW_DISPLAYS_TEXT_P (row)) - abort (); + break; if (MATRIX_ROW_START_CHARPOS (row) >= last_unchanged_pos_old) row_found = row; diff --git a/src/xfaces.c b/src/xfaces.c index 9b2d5731508..025139377aa 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -4151,7 +4151,7 @@ FRAME 0 means change the face on all frames, and change the default } else if (EQ (k, QCcolor)) { - if (!STRINGP (v) || SCHARS (v) == 0) + if (!NILP (v) && (!STRINGP (v) || SCHARS (v) == 0)) break; } else if (EQ (k, QCstyle)) |
