diff options
author | Miles Bader <miles@gnu.org> | 2007-01-26 06:16:11 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2007-01-26 06:16:11 +0000 |
commit | c0466914ba3ad88c402b0301646b4b5db8aeb913 (patch) | |
tree | 964d8df324ab5f46872dfedc92ccea9fe50a1441 /src/indent.c | |
parent | c97a3f22ed5841f1c8bcdbb80df2bd49635c6a56 (diff) | |
parent | 58f8a3f97bd49484d0eb4f83a70662ded0daf9cc (diff) | |
download | emacs-c0466914ba3ad88c402b0301646b4b5db8aeb913.tar.gz emacs-c0466914ba3ad88c402b0301646b4b5db8aeb913.tar.bz2 emacs-c0466914ba3ad88c402b0301646b4b5db8aeb913.zip |
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 586-614)
- Update from CVS
- Update from erc--emacs--22
- Merge from gnus--rel--5.10
- Merge from erc--main--0
- Make byte compiler correctly write circular constants
* gnus--rel--5.10 (patch 186-196)
- Update from CVS
- Merge from emacs--devo--0
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-162
Diffstat (limited to 'src/indent.c')
-rw-r--r-- | src/indent.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/indent.c b/src/indent.c index 368609bad64..429c2722a1d 100644 --- a/src/indent.c +++ b/src/indent.c @@ -1,6 +1,6 @@ /* Indentation functions. Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1998, 2000, 2001, - 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -2074,7 +2074,7 @@ whether or not it is currently displayed in some window. */) { int it_start; int oselective; - int it_overshoot_expected_p; + int it_overshoot_expected; SET_TEXT_POS (pt, PT, PT_BYTE); start_display (&it, w, pt); @@ -2100,12 +2100,16 @@ whether or not it is currently displayed in some window. */) while (s < e && *s != '\n') ++s; - it_overshoot_expected_p = (s == e); + /* If there is no newline in the string, we need to check + whether there is a newline immediately after the string + in move_it_to below. This may happen if there is an + overlay with an after-string just before the newline. */ + it_overshoot_expected = (s == e) ? -1 : 0; } else - it_overshoot_expected_p = (it.method == GET_FROM_IMAGE - || it.method == GET_FROM_STRETCH - || it.method == GET_FROM_COMPOSITION); + it_overshoot_expected = (it.method == GET_FROM_IMAGE + || it.method == GET_FROM_STRETCH + || it.method == GET_FROM_COMPOSITION); reseat_at_previous_visible_line_start (&it); it.current_x = it.hpos = 0; @@ -2119,7 +2123,10 @@ whether or not it is currently displayed in some window. */) truncate-lines is on and PT is beyond right margin. Don't go back if the overshoot is expected (see above). */ if (IT_CHARPOS (it) > it_start && XINT (lines) > 0 - && !it_overshoot_expected_p) + && (!it_overshoot_expected + || (it_overshoot_expected < 0 + && it.method == GET_FROM_BUFFER + && it.c == '\n'))) move_it_by_lines (&it, -1, 0); it.vpos = 0; |