From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#5042: 23.1; linum-mode gives incorrect line numbers with narrowed buffers Date: Wed, 23 Dec 2009 13:01:10 -0800 Message-ID: <36E5CB5C587B4E33B6A9F0A213862385@us.oracle.com> References: <200911260039.nAQ0dTD1019384@mailhub-pa1.hpl.hp.com> <200912100534.nBA5YSva008256@mailhub-pa1.hpl.hp.com> <200912210659.nBL6xhDG020940@mailhub-pa1.hpl.hp.com> <200912232049.nBNKnLKS025189@mailhub-pa1.hpl.hp.com> Reply-To: Drew Adams , 5042@debbugs.gnu.org NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1261602452 14440 80.91.229.12 (23 Dec 2009 21:07:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Dec 2009 21:07:32 +0000 (UTC) Cc: 5042@emacsbugs.donarmstrong.com, 5042@debbugs.gnu.org, markus.triska@gmx.at, lekktu@gmail.com To: Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 23 22:07:24 2009 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 1NNYQV-0007r3-7s for geb-bug-gnu-emacs@m.gmane.org; Wed, 23 Dec 2009 22:07:23 +0100 Original-Received: from localhost ([127.0.0.1]:43845 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNYQV-0004GH-AR for geb-bug-gnu-emacs@m.gmane.org; Wed, 23 Dec 2009 16:07:23 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NNYQP-0004Fd-A1 for bug-gnu-emacs@gnu.org; Wed, 23 Dec 2009 16:07:17 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NNYQJ-0004EZ-IC for bug-gnu-emacs@gnu.org; Wed, 23 Dec 2009 16:07:15 -0500 Original-Received: from [199.232.76.173] (port=54061 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNYQJ-0004EW-G7 for bug-gnu-emacs@gnu.org; Wed, 23 Dec 2009 16:07:11 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54758) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NNYQJ-0005i1-M7 for bug-gnu-emacs@gnu.org; Wed, 23 Dec 2009 16:07:11 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NNYLJ-0002CM-Tx; Wed, 23 Dec 2009 16:02:01 -0500 X-Loop: bug-gnu-emacs@gnu.org Mail-Followup-To: "Drew Adams" , 5042@debbugs.gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 Dec 2009 21:02: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.12616020868434 (code B ref 5042); Wed, 23 Dec 2009 21:02:01 +0000 Original-Received: (at 5042) by debbugs.gnu.org; 23 Dec 2009 21:01:26 +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 1NNYKk-0002By-4a for submit@debbugs.gnu.org; Wed, 23 Dec 2009 16:01:26 -0500 Original-Received: from rcsinet12.oracle.com ([148.87.113.124]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NNYKg-0002Bo-KB; Wed, 23 Dec 2009 16:01:24 -0500 Original-Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rcsinet12.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id nBNL1DFx028619 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 23 Dec 2009 21:01:15 GMT Original-Received: from acsmt355.oracle.com (acsmt355.oracle.com [141.146.40.155]) by rcsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id nBNKx8nH014540; Wed, 23 Dec 2009 21:01:12 GMT Original-Received: from abhmt013.oracle.com by acsmt353.oracle.com with ESMTP id 1209838221261602071; Wed, 23 Dec 2009 13:01:11 -0800 Original-Received: from dradamslap1 (/141.144.169.90) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 23 Dec 2009 13:01:11 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <200912232049.nBNKnLKS025189@mailhub-pa1.hpl.hp.com> Thread-Index: AcqEEXjUAdW1k//RSRCmKMGRVNTUuwAAMqKw X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Source-IP: acsmt355.oracle.com [141.146.40.155] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090201.4B328519.0153:SCFMA4539814,ss=1,fgs=0 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list X-Spam-Score: -4.0 (----) Resent-Date: Wed, 23 Dec 2009 16:02: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:33729 Archived-At: > Drew wrote: > > > > there should be an explicit option to switch between the modes. > > > > Yes, an option makes sense. > > > > And it can happen that the same person wants both behaviors at > > different times. For that, why not let `C-u linum-mode' use, in > > effect, the opposite of the option value? > > That might be a good idea. Would an absolute override be better > than a toggle? E.g., a positive prefix uses absolute and a negative > prefix uses relative to start of restriction. I don't think so. Given the option's value, there already is a default behavior, which makes one of your cases unnecessary. IOW, there is no override for one of the two possibilities - the default behavior already corresponds to the requested one. If a given user prefers, in general, to use absolute numbering or relative numbering, then s?he would set the option to reflect that. Then s?he need only use `C-u' for the minority of times when s?he wants the alternative behavior. FWIW, I do this kind of thing in some of my own code. Given the ability to customize the default behavior, I see no reason for also being able to specify the _default_ behavior explicitly via a particular prefix arg. If, on the other hand, you were anticipating non-interactive use, then I'd say that in that case all that's needed is to let-bind the variable (option) to give it the value you want currently.