From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: ptrdiff_t misuse [was :Re: (empty)] Date: Tue, 03 Jul 2012 23:25:26 -0700 Organization: UCLA Computer Science Department Message-ID: <4FF3E1D6.1050103@cs.ucla.edu> References: <83lij66yq9.fsf@gnu.org> <4FEDB953.1010800@yandex.ru> <4FEEA720.2040405@cs.ucla.edu> <4FEEFBAB.6000404@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1341383137 302 80.91.229.3 (4 Jul 2012 06:25:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 4 Jul 2012 06:25:37 +0000 (UTC) Cc: Dmitry Antipov , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 04 08:25:35 2012 Return-path: Envelope-to: ged-emacs-devel@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 1SmJ1p-0005MS-1B for ged-emacs-devel@m.gmane.org; Wed, 04 Jul 2012 08:25:33 +0200 Original-Received: from localhost ([::1]:53566 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmJ1n-0003Cp-SI for ged-emacs-devel@m.gmane.org; Wed, 04 Jul 2012 02:25:31 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38740) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmJ1k-0003Ck-S3 for emacs-devel@gnu.org; Wed, 04 Jul 2012 02:25:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SmJ1j-00012P-3W for emacs-devel@gnu.org; Wed, 04 Jul 2012 02:25:28 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:59822) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmJ1i-00012L-Tn for emacs-devel@gnu.org; Wed, 04 Jul 2012 02:25:27 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id BAFADA60012; Tue, 3 Jul 2012 23:25:24 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FPhS1aOjglLy; Tue, 3 Jul 2012 23:25:24 -0700 (PDT) Original-Received: from [192.168.1.4] (pool-108-23-119-2.lsanca.fios.verizon.net [108.23.119.2]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 2FC81A6000A; Tue, 3 Jul 2012 23:25:24 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 131.179.128.62 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:151407 Archived-At: On 06/30/2012 07:23 AM, Stefan Monnier wrote: > No, the problem is long lines. There's also a problem even if lines are short. I ran Emacs without the patch, on files with only short lines, and attempted large horizontal scroll values (say, most-positive-fixnum minus 100). The screen would mess up. Sometimes even after I scrolled back to the left margin, there would be scroll indicators in the left column. Sometimes there would be stray characters on the screen. To work around this I pushed a patch (trunk bzr 108856) that arbitrarily ceilings the hscroll value at 100000. I didn't observe any problems with hscroll values less than that, though I suppose the exact safe region may vary depending on font sizes or whatnot. This patch removes the PTRDIFF_MAX checks that prompted this thread, as they're no longer needed. This patch is independent of whether hscroll values are stored as ptrdiff_t or EMACS_INT or int, so it shouldn't affect Dmitry's work-in-progress that would change the number of bits in an hscroll value.