help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: yanking in outline mode without expanding?


From: Kevin Rodgers
Subject: Re: yanking in outline mode without expanding?
Date: Mon, 22 Dec 2003 12:47:12 -0700
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2

Peter Seibel wrote:

When I have my outline collapsed and kill a section and then yank it
back, it always insterts the text fully expanded. Is there some simple
way to change this behavior--I'd like it to stay collapsed just the
way it was when I killed it.

I don't know -- does this work?

(defadvice yank (after hide-region-body activate)
  "If the buffer is in Outline mode, hide the body lines in the yanked text."
  (if (eq major-mode 'outline-mode)     ; (or ... outline-minor-mode)
      (hide-region-body (region-beginning) (region-end))))

--
Kevin Rodgers



reply via email to

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