emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Alan Schmitt <alan.schmitt@polytechnique.org>
To: Rainer M Krug <Rainer@krugs.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: org-tree-to-indirect-buffer - naming and prefix in define keyboard key
Date: Tue, 09 Jun 2015 14:38:26 +0200	[thread overview]
Message-ID: <m23821vyyl.fsf@charm-ecran.irisa.fr> (raw)
In-Reply-To: <m2vbex46sr.fsf@krugs.de> (Rainer M. Krug's message of "Tue, 09 Jun 2015 10:36:36 +0200")

[-- Attachment #1: Type: text/plain, Size: 1315 bytes --]

On 2015-06-09 10:36, Rainer M Krug <Rainer@krugs.de> writes:

> While writing this, I discovered the C-u prefix to keep the last opened
> indirect buffer open.
>
> But I still have two question:
>
> 1) How can I map the command C-u M-x ~org-tree-to-indirect-buffer~ to a
> keyboard shortcut?

According to http://ergoemacs.org/emacs/elisp_universal_argument.html
the universal argument corresponds to an argument '(4). So you could
try:

#+begin_src emacs-lisp
(global-set-key
 (kbd "<f8>")
 (lambda ()
   (interactive)
   (org-tree-to-indirect-buffer '(4))))
#+end_src

> 2) Can I change the naming of the indirect buffer? To prefix the .org
> buffer name makes sense, but is cluttering my tabbar (yes - I still use
> it) - so I would prefer to simply use the name of the subtree.

The buffer name is set by the function `org-get-indirect-buffer'.
You could try to change the name after calling the function … for
instance by doing
#+begin_src emacs-lisp
(rename-buffer (org-get-heading) t)
#+end_src
(the t at the end makes sure the name is unique), but for this to work
you need to go to the buffer that was just created, and I don't know how
to do that.

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Weekly CO₂ average (2015-05-30, Mauna Loa Observatory): 403.41 ppm

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

  reply	other threads:[~2015-06-09 12:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-09  8:36 org-tree-to-indirect-buffer - naming and prefix in define keyboard key Rainer M Krug
2015-06-09 12:38 ` Alan Schmitt [this message]
2015-06-10 12:59   ` Rainer M Krug

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=m23821vyyl.fsf@charm-ecran.irisa.fr \
    --to=alan.schmitt@polytechnique.org \
    --cc=Rainer@krugs.de \
    --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).