[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#17401: 24.4.50; Narrow to {region,page,defun} in an indirect clone b
From: |
Drew Adams |
Subject: |
bug#17401: 24.4.50; Narrow to {region,page,defun} in an indirect clone buffer in the other window |
Date: |
Fri, 18 Sep 2020 16:02:27 +0000 (UTC) |
> > That post provides a function which creates a indirect clone of
> > the current buffer, and narrows to the marked region in that, so
> > that you have both the original un-narrowed buffer and the narrowed
> > indirect clone available simultaneously.
> >
> > This is incredibly useful, and it seems like an obvious contender
> > for standard functionality in Emacs.
> >
> > I'm attaching a patch which uses that approach to implement the
> > following functions and bindings:
> >
> > C-x 4 n n: narrow-to-region-indirect-other-window
> > C-x 4 n p: narrow-to-page-indirect-other-window
> > C-x 4 n d: narrow-to-defun-indirect-other-window
>
> Sounds like a good idea to me, and seems to be a logical extension.
> Anybody got an opinion?
>
> However:
>
> > It's still essentially Zane's code, so I've confirmed that he's
> > happy for me to send this, and am CCing this to him.
>
> We'd need copyright assignment papers for something like this. Zane,
> would you be willing to assign copyright for this code to the FSF?
FWIW, `narrow-indirect.el' is based on this and extends
it in a few ways. From the Commentary (and the wiki page):
;; Acknowledgments:
;;
;; The idea and original code for a command that combines narrowing
;; with cloning a buffer as an indirect-buffer is due to Zane Ashby:
;; https://demonastery.org/2013/04/emacs-narrow-to-region-indirect/.
;;
;; In Emacs bug thread #17401, Phil Sainty proposed adding three
;; commands to Emacs based on this approach. Lennart Borgman
;; contributed code that uses, in the cloned buffer name, some text
;; based on the narrowed region.
;;
;; The code in `narrow-indirect.el' extends this a bit and provides
;; a couple of user options and some alternative (prefix-argument)
;; behavior. It is doubtful that Emacs Dev will ever adopt features
;; such as those defined here, and if they do then this library can
;; at least help for Emacs versions prior to their addition.
Description here:
https://www.emacswiki.org/emacs/NarrowIndirect
Code:
https://www.emacswiki.org/emacs/download/narrow-indirect.el