emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: widen-one-level [was: Emacs's handling of line numbers]


From: Leo
Subject: Re: widen-one-level [was: Emacs's handling of line numbers]
Date: Mon, 19 Apr 2010 18:57:18 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

On 2010-04-19 17:31 +0100, Drew Adams wrote:
>> Or something like that. Someone more knowledgable will no 
>> doubt enlighten us.
>
> One (ugly) solution is to copy the Lisp source code for `narrow-to-defun' and
> `narrow-to-page' to the same library that advises `narrow-to-region'. That 
> way,
> the advised definition is used also for the other two.

Yes. I suspect defadvice will do too.

My original idea was to implement some sort of undo for narrowing using
a ring structure and have narrow-to-region record that info for me.
Because of this (which I think is ugly) I abandoned the plan.

In the end I implemented something that needs a user to explicitly
record the state (bound to C-x n r).

The use case for me is this: suppose I am writing an around 50 page
article in LaTeX and I don't feel like splitting it into multiple files.
But during writing I only want to focus on a portion of the article (a
section for example), I can narrow to that section and record that
state so that C-x n w will not expose me to the entire file.

I posted my code here http://paste.lisp.org/display/97993.

Leo





reply via email to

[Prev in Thread] Current Thread [Next in Thread]