From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: org-tree-to-indirect-buffer - naming and prefix in define keyboard key Date: Wed, 10 Jun 2015 14:59:57 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57545) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2fcJ-0001b1-RD for emacs-orgmode@gnu.org; Wed, 10 Jun 2015 09:00:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2fc4-0002U9-Kc for emacs-orgmode@gnu.org; Wed, 10 Jun 2015 09:00:27 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:34523) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2fc4-0002Tj-7u for emacs-orgmode@gnu.org; Wed, 10 Jun 2015 09:00:12 -0400 Received: by wibut5 with SMTP id ut5so47626269wib.1 for ; Wed, 10 Jun 2015 06:00:11 -0700 (PDT) In-Reply-To: (Alan Schmitt's message of "Tue, 09 Jun 2015 14:38:26 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Alan Schmitt Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Alan Schmitt writes: > On 2015-06-09 10:36, Rainer M Krug 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 "") > (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 =E2=80=A6 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 =2D-=20 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: Rainer@krugs.de Skype: RMkrug PGP: 0x0F52F982 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iQEcBAEBAgAGBQJVeDTNAAoJENvXNx4PUvmCIZAIALrTZMLmcoovDT1GHeDBtbpx ITT2po/xAlXdQ+fegXhhQ7DhJcWtKL0LSBDh8gMtQBY0kmZKPNZdf0/Z5dxV+YiG clvvvapZDU/QuDG9YwpAxYIF3ud8hPrQ9I07XlZoIYGZJC5mQ/yZy6HM3zzq9lYo NJWtw2lfVmBar4pLJMvZZLuj56F+m3ekHV2pgBpKtbNfj57KdL1ibV1GJE8IV2wI a5kbjFVv7HyZQoNwS4gn2KsKp9JodVehcMu+8S8Qwpx7EyUQ6+VGGtED7xZl/J12 InaKgvb1VElrSXHjTpIEu9xSVPxVrJoaaCSHx8wEIBTy+cQ1OVNxlXoZxUhEKO8= =yOYj -----END PGP SIGNATURE----- --=-=-=--