emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] org-tree-to-indirect-buffer - naming and prefix in define keyboa


From: Alan Schmitt
Subject: Re: [O] org-tree-to-indirect-buffer - naming and prefix in define keyboard key
Date: Tue, 09 Jun 2015 14:38:26 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin)

On 2015-06-09 10:36, Rainer M Krug <address@hidden> 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: signature.asc
Description: PGP signature


reply via email to

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