Alan Schmitt <[email protected]> writes: > On 2015-06-09 10:36, Rainer M Krug <[email protected]> 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
Thanks - works perfectly. I just used
#+begin_src emacs-lisp
(define-key org-mode-map "\C-ci" (lambda ()
(interactive)
(org-tree-to-indirect-buffer '(4))))
#+end_src
as it only makes sense in org files (or can I use it in other files as
well?).
>
>> 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.
Thanks - I will look into this and post a new question.
Thanks a lot,
Rainer
>
> Alan
--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
UCT), Dipl. Phys. (Germany)
Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa
Tel : +33 - (0)9 53 10 27 44
Cell: +33 - (0)6 85 62 59 98
Fax : +33 - (0)9 58 10 27 44
Fax (D): +49 - (0)3 21 21 25 22 44
email: [email protected]
Skype: RMkrug
PGP: 0x0F52F982
signature.asc
Description: PGP signature
