From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark Lillibridge Newsgroups: gmane.emacs.bugs Subject: bug#5042: 23.1; linum-mode gives incorrect line numbers with narrowed buffers Date: Sat, 9 Jan 2010 17:32:18 -0800 Message-ID: <201001100132.o0A1WIxG005631@mailhub-pa1.hpl.hp.com> References: <200911260039.nAQ0dTD1019384@mailhub-pa1.hpl.hp.com> <200912100534.nBA5YSva008256@mailhub-pa1.hpl.hp.com> <200912210659.nBL6xhDG020940@mailhub-pa1.hpl.hp.com> <201001070538.o075cpux020583@mailhub-pa1.hpl.hp.com> Reply-To: mark.lillibridge@hp.com, 5042@debbugs.gnu.org NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1263088159 26062 80.91.229.12 (10 Jan 2010 01:49:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 Jan 2010 01:49:19 +0000 (UTC) Cc: lekktu@gmail.com, 5042@emacsbugs.donarmstrong.com To: markus.triska@gmx.at Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jan 10 02:49:12 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NTmvX-0006MR-4U for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Jan 2010 02:49:11 +0100 Original-Received: from localhost ([127.0.0.1]:52079 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NTmvX-0007sg-6J for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Jan 2010 20:49:11 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NTmvS-0007rJ-Ea for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2010 20:49:06 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NTmvN-0007oL-HW for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2010 20:49:05 -0500 Original-Received: from [199.232.76.173] (port=47251 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NTmvN-0007oE-8G for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2010 20:49:01 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52582) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NTmvM-00086f-UO for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2010 20:49:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NTmft-0001Ad-JD; Sat, 09 Jan 2010 20:33:01 -0500 X-Loop: bug-gnu-emacs@gnu.org Mail-Followup-To: mark.lillibridge@hp.com, 5042@debbugs.gnu.org Resent-From: Mark Lillibridge Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Jan 2010 01:33:01 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: followup 5042 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 5042-submit@debbugs.gnu.org id=B5042.12630871554491 (code B ref 5042); Sun, 10 Jan 2010 01:33:01 +0000 Original-Received: (at 5042) by debbugs.gnu.org; 10 Jan 2010 01:32:35 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NTmfS-0001AO-V9 for submit@debbugs.gnu.org; Sat, 09 Jan 2010 20:32:35 -0500 Original-Received: from madara.hpl.hp.com ([192.6.19.124]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NTmfQ-0001AI-I7 for 5042@emacsbugs.donarmstrong.com; Sat, 09 Jan 2010 20:32:33 -0500 Original-Received: from mailhub-pa1.hpl.hp.com (mailhub-pa1.hpl.hp.com [15.25.115.25]) by madara.hpl.hp.com (8.14.3/8.14.1/HPL-PA Relay) with ESMTP id o0A1WKTT008517 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 9 Jan 2010 17:32:20 -0800 (PST) Original-Received: from ts-rhel4.hpl.hp.com (ts-rhel4.hpl.hp.com [15.25.118.24]) by mailhub-pa1.hpl.hp.com (8.14.3/8.14.3/HPL-PA Hub) with ESMTP id o0A1WIxG005631; Sat, 9 Jan 2010 17:32:18 -0800 In-reply-to: (message from Markus Triska on Fri, 8 Jan 2010 00:30:28 +0100) X-HPL-MailScanner: Found to be clean X-HPL-MailScanner-From: mark.lillibridge@hp.com X-Spam-Score: -5.1 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list X-Spam-Score: -5.2 (-----) Resent-Date: Sat, 09 Jan 2010 20:33:01 -0500 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:34145 Archived-At: Markus wrote: > In my opinion, a more general solution than only for linum.el would be > best, one that also makes for example line-number-mode show line numbers > that work as expected with M-x goto-line RET also for narrowed buffers. > Ideally, it should work without having to customize each of these > features (and new modes in the future) separately. I think a promising > suggestion (found in this thread) is to generalise narrowing itself, > possibly with a single new customization option instead of many. That's a good idea. We could add a buffer local variable that determines how to number lines when a restriction is in effect. Rmail, Info, and similar modes could set this variable for their buffers to start numbering the visible restriction at 1. Other buffers would depend on the user's global customization setting. goto-line, linum, and related features would consult this variable. I don't know any good arguments for which way to set the global default. What do people think of this plan? The alternative KISS strategy is to just make line numbering always start with one for restrictions; I think this makes everybody happy. The downside is that you can't see the external line numbers of lines while you have restricted the buffer and you can't go to lines by their external line number while you have restricted the buffer. I, at least, don't use narrow (interactively) enough that that these drawbacks would matter. - Mark