emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: Cody Goodman <codygman.consulting@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: Any easy way to use multiple indirect buffers based on subtrees?
Date: Tue, 04 Sep 2018 20:11:38 -0400	[thread overview]
Message-ID: <87o9dcx0p1.fsf@kyleam.com> (raw)
In-Reply-To: <CADq_+R1J3DygFTpOVrp5dfZLdo_pnh9YTyNikyjO50fCUS2iSg@mail.gmail.com>

Cody Goodman <codygman.consulting@gmail.com> writes:

> I would like to be able to create N indirect buffers per subtree because I
> like working on each subtree in it's own eyebrowse workspace. Does anyone
> already do this? I didn't see config options to achieve what I wanted, so
> wanted to ask here before I look at the indirect buffer implementation to
> figure out how to do this.

I'm not sure I'm reading your question correctly, but does a C-u before
org-tree-to-indirect-buffer do what you want?  From
org-tree-to-indirect-buffer's docstring:

    However, when you call the command with a ‘C-u’ prefix, or when
    ‘org-indirect-buffer-display’ is ‘new-frame’, the last buffer is
    kept so that you can work with several indirect buffers at the same
    time.

I prefer to reverse the meaning of the prefix argument, so I define the
following wrapper in my config:

--8<---------------cut here---------------start------------->8---
(defun km/org-tree-to-indirect-buffer (&optional arg)
  "Run `org-tree-to-indirect-buffer', keeping previous buffer.
By default, `org-tree-to-indirect-buffer' deletes the previous
indirect buffer when making a new one to avoid accumulating
buffers, which can be overriden by a C-u prefix. Reverse this
behavior so that the prefix must be given in order to delete the
previous indirect buffer. If the argument is a number, which has
a different meaning, it is left untouched."
  (interactive "P")
  (unless (numberp arg)
    (setq arg (not arg)))
  (org-tree-to-indirect-buffer arg))
--8<---------------cut here---------------end--------------->8---

-- 
Kyle

  reply	other threads:[~2018-09-05  0:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-04 17:26 Any easy way to use multiple indirect buffers based on subtrees? Cody Goodman
2018-09-05  0:11 ` Kyle Meyer [this message]
2018-09-13 10:02 ` Adam Porter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o9dcx0p1.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=codygman.consulting@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).