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: Drew Adams
Subject: RE: widen-one-level [was: Emacs's handling of line numbers]
Date: Sun, 18 Apr 2010 19:04:28 -0700

 

> > (defadvice narrow-to-region (before push-restriction-stack activate)
> >   (setq restriction-stack  (cons (cons start end) 
> >                                  restriction-stack))
> >   (when (and (= start 1) (= end (1+ (buffer-size))))
> >     (setq restriction-stack  ())))
> 
> I also have something similar in my .emacs. I wonder if you 
> noticed this
> problem. After advising narrow-to-region, preloaded functions such as
> narrow-to-page narrow-to-defun still use the original narrow-to-region
> ignoring the advice.

Yes, I noticed that too. Presumably it's because `narrow-to-region' has its own
byte code. At least that's my guess. `narrow-to-defun' is a lisp function, and
it is byte-compiled, which presumably means the byte-code for `narrow-to-region'
is inlined.

Or something like that. Someone more knowledgable will no doubt enlighten us.







reply via email to

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