From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: KEybinding for Re: Naming of (indirect?) buffers opened by C-' Date: Fri, 19 Dec 2014 11:00:33 +0100 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]:45967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1uMU-00057e-Sk for emacs-orgmode@gnu.org; Fri, 19 Dec 2014 05:00:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y1uMP-0007ji-Nq for emacs-orgmode@gnu.org; Fri, 19 Dec 2014 05:00:42 -0500 Received: from mail-wg0-f51.google.com ([74.125.82.51]:57954) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1uMP-0007jZ-Bg for emacs-orgmode@gnu.org; Fri, 19 Dec 2014 05:00:37 -0500 Received: by mail-wg0-f51.google.com with SMTP id x12so857272wgg.10 for ; Fri, 19 Dec 2014 02:00:36 -0800 (PST) In-Reply-To: (Rainer M. Krug's message of "Fri, 19 Dec 2014 10:53:19 +0100") 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: Grant Rettke Cc: "emacs-orgmode@gnu.org" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Rainer M Krug writes: Followup: I would now bing=3Dt =3Dthis function to C-c ' - how can I do this without interfering with the general operation of C-c ' which calls org-edit-special? Rainer > Grant Rettke writes: > >> (defun gcr/org-edit-src-code-plus-name () >> "Edit the well-described source code block. >> >> Attribution: URL >> `https://lists.gnu.org/archive/html/emacs-orgmode/2014-09/msg00778.html'" >> (interactive) >> (let* ((eop (org-element-at-point)) >> (name (or (org-element-property :name (org-element-context eop)) >> "=E0=A5=90")) >> (lang (org-element-property :language eop)) >> (buff-name (concat "*Org Src " name "[" lang "]*"))) >> (org-edit-src-code nil nil buff-name))) >> > > Thanks - that is exactly what I was looking for. But I had to change the > last line to > > ,---- > | (org-edit-src-code nil buff-name))) > `---- > > as it seems that in my version of org > > ,---- > | Org-mode version 8.3beta (release_8.3beta-660-g389274 @ /Users/rainerkr= ug/.emacs.d/org-mode/lisp/) > `---- > > the function org-edit-src-code only takes two arguments: > > ,---- > | org-edit-src-code is an interactive compiled Lisp function in > | `org-src.el'. > |=20 > | (org-edit-src-code &optional CODE EDIT-BUFFER-NAME) > |=20 > | Edit the source or example block at point. > |=20 > | The code is copied to a separate buffer and the appropriate mode > | is turned on. When done, exit with M-x org-edit-src-exit. This > | will remove the original code in the Org buffer, and replace it > | with the edited version. See `org-src-window-setup' to configure > | the display of windows containing the Org buffer and the code > | buffer. > |=20 > | When optional argument CODE is a string, edit it in a dedicated > | buffer instead. > |=20 > | When optional argument EDIT-BUFFER-NAME is non-nil, use it as the > | name of the sub-editing buffer. > `---- > > Thanks a lot, > > Rainer > > >> On Thu, Dec 18, 2014 at 5:00 AM, Rainer M Krug wrote: >>> Hi >>> >>> I remember there was a discussion recently about the naming of the >>> indirect buffers of source code block opened with C-' but I can't find >>> it at the moment. Was there a solution on giving these buffers a >>> useful name, i.e. the name of the code block? >>> >>> If this is included in org, it does not seem to be working for me? >>> >>> Thanks, >>> >>> Rainer >>> >>> -- >>> Rainer M. Krug >>> email: Rainerkrugsde >>> PGP: 0x0F52F982 =2D-=20 Rainer M. Krug email: Rainerkrugsde PGP: 0x0F52F982 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iQEcBAEBAgAGBQJUk/dCAAoJENvXNx4PUvmCcOwH/1I5PaB0quvevZBvqi5Ao7qM tSPj8RiY0LiuB1cuhogues8aKHbnzZlkJIyWuOSOPDHtH0cFgV7TEPLtJxIVAvxl PD5FJk9RjQKO47n/aBrRPS7dN7KQwfwXSPQAP/5+0dB1sPyI/QUr5t+f8SQkCApJ qtr90FOZkNuQRBsKheVYzvY9zq3urfeJHUrs36IMiyHjFBmZBkHrhMlSHNfdDuO8 WnnizdODAkhOizTIKELmC8jUIpJ9T3GdESUdkP3Rjo7J2SgDPks5dK8gfebWSZ5v JpRjheeJUAULZktFcCUw3DciNeDIj3rE89raxJr6Laf410Vw6i7z5iqbAwSispo= =6z3J -----END PGP SIGNATURE----- --=-=-=--