From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#14780: Regression: C-n doesn't go to next line under simple circumstances Date: Sat, 20 Jul 2013 11:33:07 +0300 Message-ID: <834nbpzl4s.fsf@gnu.org> References: <83fvvaz7jf.fsf@gnu.org> <83ehauz40q.fsf@gnu.org> <83a9lhzq9w.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1374309249 4854 80.91.229.3 (20 Jul 2013 08:34:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 20 Jul 2013 08:34:09 +0000 (UTC) Cc: 14780@debbugs.gnu.org To: gundaetiapo@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 20 10:34:09 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1V0ScC-0004vG-IH for geb-bug-gnu-emacs@m.gmane.org; Sat, 20 Jul 2013 10:34:08 +0200 Original-Received: from localhost ([::1]:34005 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0ScC-0005La-6C for geb-bug-gnu-emacs@m.gmane.org; Sat, 20 Jul 2013 04:34:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0Sc7-0005LN-Vg for bug-gnu-emacs@gnu.org; Sat, 20 Jul 2013 04:34:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V0Sc7-0007sz-0H for bug-gnu-emacs@gnu.org; Sat, 20 Jul 2013 04:34:03 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44689) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0Sc6-0007sv-TS for bug-gnu-emacs@gnu.org; Sat, 20 Jul 2013 04:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1V0Sc6-00053w-Ed for bug-gnu-emacs@gnu.org; Sat, 20 Jul 2013 04:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Jul 2013 08:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14780 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14780-submit@debbugs.gnu.org id=B14780.137430918419311 (code B ref 14780); Sat, 20 Jul 2013 08:34:02 +0000 Original-Received: (at 14780) by debbugs.gnu.org; 20 Jul 2013 08:33:04 +0000 Original-Received: from localhost ([127.0.0.1]:39005 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V0Sb9-00051P-SL for submit@debbugs.gnu.org; Sat, 20 Jul 2013 04:33:04 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:64430) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V0Sb7-00050X-8l for 14780@debbugs.gnu.org; Sat, 20 Jul 2013 04:33:02 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MQ8003007MC7000@a-mtaout21.012.net.il> for 14780@debbugs.gnu.org; Sat, 20 Jul 2013 11:32:54 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MQ8003857QT3A30@a-mtaout21.012.net.il>; Sat, 20 Jul 2013 11:32:54 +0300 (IDT) In-reply-to: <83a9lhzq9w.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:76519 Archived-At: Does the following fix the problem for you? === modified file 'src/xdisp.c' --- src/xdisp.c 2013-07-16 21:35:45 +0000 +++ src/xdisp.c 2013-07-20 08:21:36 +0000 @@ -15592,7 +15592,8 @@ redisplay_window (Lisp_Object window, in Move it back to a fully-visible line. */ new_vpos = window_box_height (w); } - else if (w->cursor.vpos >=0) + else if (w->cursor.vpos >=0 + && PT >= BEGV && PT < ZV) { /* Some people insist on not letting point enter the scroll margin, even though this part handles windows that didn't @@ -15619,7 +15620,16 @@ redisplay_window (Lisp_Object window, in if (header_line) window_height += CURRENT_HEADER_LINE_HEIGHT (w); if (w->cursor.y >= window_height - pixel_margin) - new_vpos = window_height - pixel_margin; + { + struct text_pos pos; + + SET_TEXT_POS (pos, PT, PT_BYTE); + start_display (&it, w, pos); + it.current_y = it.vpos = 0; + move_it_to (&it, ZV, -1, -1, -1, MOVE_TO_POS); + if (it.vpos > margin) + new_vpos = window_height - pixel_margin; + } } }