From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: next-line screws up column at the EOL Date: Thu, 27 Sep 2007 14:25:45 -0400 Message-ID: References: <46F7E6CE.1010907@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1190917593 11353 80.91.229.12 (27 Sep 2007 18:26:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 27 Sep 2007 18:26:33 +0000 (UTC) Cc: Sam Steingold , rms@gnu.org, emacs-devel@gnu.org To: Glenn Morris Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 27 20:26:28 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Iay3s-0001M7-Ao for ged-emacs-devel@m.gmane.org; Thu, 27 Sep 2007 20:26:08 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Iay3o-00063B-SJ for ged-emacs-devel@m.gmane.org; Thu, 27 Sep 2007 14:26:04 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Iay3l-000630-5g for emacs-devel@gnu.org; Thu, 27 Sep 2007 14:26:01 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Iay3g-00062W-Lw for emacs-devel@gnu.org; Thu, 27 Sep 2007 14:26:00 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Iay3g-00062H-GW for emacs-devel@gnu.org; Thu, 27 Sep 2007 14:25:56 -0400 Original-Received: from vpn-132-204-232-106.acd.umontreal.ca ([132.204.232.106] helo=ceviche.home) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Iay3U-0003xa-4Z; Thu, 27 Sep 2007 14:25:44 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 71B0CB4062; Thu, 27 Sep 2007 14:25:45 -0400 (EDT) In-Reply-To: (Glenn Morris's message of "Wed\, 26 Sep 2007 17\:26\:08 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux) X-Detected-Kernel: Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:79960 Archived-At: >> I cannot reproduce your problem. Can you give a recipe starting from >> "emacs -Q"? My guess is that some code somewhere uses "column + 1" >> so the most-positive-fixnum causes a wraparound, but I can't find >> the relevant code. > For me, in a 64-bit Emacs > (move-to-column most-positive-fixnum) Does the patch below fix the problem? Stefan --- indent.c 29 ao=FB 2007 22:33:12 -0400 1.195 +++ indent.c 27 sep 2007 14:22:46 -0400=09 @@ -932,19 +932,19 @@ (column, force) Lisp_Object column, force; { - register int pos; - register int col =3D current_column (); - register int goal; - register int end; + register EMACS_INT pos; + register EMACS_INT col =3D current_column (); + register EMACS_INT goal; + register EMACS_INT end; register int tab_width =3D XINT (current_buffer->tab_width); register int ctl_arrow =3D !NILP (current_buffer->ctl_arrow); register struct Lisp_Char_Table *dp =3D buffer_display_table (); register int multibyte =3D !NILP (current_buffer->enable_multibyte_chara= cters); =20 Lisp_Object val; - int prev_col =3D 0; + EMACS_INT prev_col =3D 0; int c =3D 0; - int next_boundary, pos_byte; + EMACS_INT next_boundary, pos_byte; =20 if (tab_width <=3D 0 || tab_width > 1000) tab_width =3D 8; CHECK_NATNUM (column); @@ -970,7 +970,7 @@ { while (pos =3D=3D next_boundary) { - int prev =3D pos; + EMACS_INT prev =3D pos; pos =3D skip_invisible (pos, &next_boundary, end, Qnil); if (pos !=3D prev) pos_byte =3D CHAR_TO_BYTE (pos); @@ -1090,7 +1090,7 @@ and scan through it again. */ if (!NILP (force) && col > goal && c =3D=3D '\t' && prev_col < goal) { - int goal_pt, goal_pt_byte; + EMACS_INT goal_pt, goal_pt_byte; =20 /* Insert spaces in front of the tab to reach GOAL. Do this first so that a marker at the end of the tab gets