From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: widen-one-level [was: Emacs's handling of line numbers] Date: Sun, 18 Apr 2010 17:25:50 -0700 Message-ID: <4932214A02774198997B6B01B77292CD@us.oracle.com> References: <837ho6czb6.fsf@gnu.org> <8339yucbsg.fsf@gnu.org> <83wrw5bxkc.fsf@gnu.org><90D3EB66AA37491881EB2B26100925C2@us.oracle.com><7DAA22BBC7FD45D9996D3EE994E01C16@us.oracle.com> <8739ysmoqf.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1271636783 5759 80.91.229.12 (19 Apr 2010 00:26:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 19 Apr 2010 00:26:23 +0000 (UTC) Cc: 'Juanma Barranquero' , 'Eli Zaretskii' , monnier@iro.umontreal.ca, mark.lillibridge@hp.com, emacs-devel@gnu.org To: "'Juri Linkov'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 19 02:26:19 2010 connect(): No such file or directory 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.69) (envelope-from ) id 1O3eoc-0003uY-H9 for ged-emacs-devel@m.gmane.org; Mon, 19 Apr 2010 02:26:18 +0200 Original-Received: from localhost ([127.0.0.1]:38419 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O3eob-0006Jk-RH for ged-emacs-devel@m.gmane.org; Sun, 18 Apr 2010 20:26:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O3eo5-0005up-2B for emacs-devel@gnu.org; Sun, 18 Apr 2010 20:25:45 -0400 Original-Received: from [140.186.70.92] (port=33687 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O3eo2-0005sm-VX for emacs-devel@gnu.org; Sun, 18 Apr 2010 20:25:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O3eo1-0000i1-2d for emacs-devel@gnu.org; Sun, 18 Apr 2010 20:25:42 -0400 Original-Received: from rcsinet10.oracle.com ([148.87.113.121]:50238) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O3eo0-0000hf-U6; Sun, 18 Apr 2010 20:25:41 -0400 Original-Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o3J0PYJ6032200 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 19 Apr 2010 00:25:36 GMT Original-Received: from acsmt355.oracle.com (acsmt355.oracle.com [141.146.40.155]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o3IAYClh024868; Mon, 19 Apr 2010 00:25:34 GMT Original-Received: from abhmt002.oracle.com by acsmt354.oracle.com with ESMTP id 185818721271636733; Sun, 18 Apr 2010 17:25:33 -0700 Original-Received: from dradamslap1 (/10.175.221.180) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 18 Apr 2010 17:25:33 -0700 X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Thread-Index: AcrfP0eP+qx8PGTnTnmUxyt/8f7HgQAEYdLQ In-Reply-To: <8739ysmoqf.fsf@mail.jurta.org> X-Auth-Type: Internal IP X-Source-IP: acsinet15.oracle.com [141.146.126.227] X-CT-RefId: str=0001.0A090204.4BCBA301.000A:SCFMA922111,ss=1,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/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:123860 Archived-At: > > If you want to get a quick idea what this would be like, eval this > > code and bind `widen-one-level' (e.g. to `C-x n w' ;-)). > > I propose a better UI compatible with current commands: > bind `C-x n w' to a new user command `widen-command' that > by default works exactly like `widen' currently works, > i.e. without a prefix argument, widen completely. > > But with a numeric prefix it will widen that many levels, > e.g. `C-u 1 C-x n w' for one level. I prefer something like this: http://www.emacswiki.org/emacs/wide-n.el It follows this suggestion I made: >> Another possibility would be to make a restriction ring, >> instead of a stack, and let you browse among the restrictions... * The binding is `C-x n x', not `C-x n w'. You can still use `C-x n w' normally. * You can repeat the `x' to cycle: `C-x n x x x'... * Use a plain prefix arg (`C-u') to widen completely. * Use a prefix arg N < 0 to widen completely and empty the ring. * Use a prefix arg N >= 0 to go to the Nth previous restriction. You can have any number of regions that you can return to as restrictions. They can be, but need not be, nested. --- One question I have, at least for this library if something like this is not added to Emacs: In which of the two categories of primitive functions is `narrow-to-region' (quoting from Stefan's mail to bug #5863 thread): > there are several categories of functions: > - functions that have their own byte-code (things like widen, > car, cdr, ...). > - functions that are implemented in C but don't have their own > byte-code. > - other functions. > > Pieces of advice on the first kind of functions only work for > calls from interpreted Lisp code. Pieces of advice on the > second kind of functions only work for calls from Lisp code > (both interpreted and byte-compiled). If `narrow-to-region' has its own byte-code, then I'll add a note to the library telling users not to byte-compile it. And for future reference, how to tell whether a primitive has its own byte-code? And shouldn't this info about advising primitives be documented? (see bug #5863)