4

I have a buffer with some data. I want to select part of buffer and open the selection in different buffer (and window) to make it easier to read for me. Is there some function that does it?

I am looking for something like clone-indirect-buffer-other-window, but for selection, not a whole buffer.

  • narrow-to-region ... and if you like using org-mode, there are some narrow-to-subtree... functions. The code behind the scenes use that all the time to limit the scope of the buffer that is being operated on. And, when you are done, you can widen and/or exit the indirect buffer. – lawlist Aug 21 '17 at 0:42
  • @lawlist Why did you write that in comment question? It looks like a valid answer. – MatthewRock Aug 21 '17 at 0:56
  • I generally write comments instead of answers because it's quick (and I'm usually just in between projects, such as compiling something with a minute or two of down-time to see the latest activity on the net) ... it looks like Drew has it covered. :) – lawlist Aug 21 '17 at 1:03
  • @lawlist But I want to upvote you, since it helps me and I don't have to download anything else! – MatthewRock Aug 21 '17 at 1:09
  • Could you please try jac.el available at github? After installing jac.el you just need the command jac to clone the current buffer. The advantage of jac is that it only synchronizes text but no text properties. font-lock should work in both buffers independently. – Tobias Jan 16 at 11:50
3

See library Narrow Indirect (code: narrow-indirect.el).

It lets you create an indirect buffer that is a clone of the current buffer and that is narrowed to a particular portion of it.

Such an indirect buffer gives you a different view of a portion of the buffer, or even of the whole buffer (use C-x h C-x 4 n n). It always has the same text and text properties, but otherwise it is pretty independent.

0

There is also edit-indirect.

It lets you create an completely independent buffer which might use a different major-mode, too. You can edit this buffer and commit you changes back to the original buffer when done.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.