From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: Naming of (indirect?) buffers opened by C-' Date: Fri, 19 Dec 2014 10:53:19 +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]:44671) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1uFZ-0000jX-0c for emacs-orgmode@gnu.org; Fri, 19 Dec 2014 04:53:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y1uFU-0004mY-2M for emacs-orgmode@gnu.org; Fri, 19 Dec 2014 04:53:32 -0500 Received: from mail-wi0-f176.google.com ([209.85.212.176]:48056) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1uFT-0004mT-S8 for emacs-orgmode@gnu.org; Fri, 19 Dec 2014 04:53:27 -0500 Received: by mail-wi0-f176.google.com with SMTP id ex7so1326369wid.3 for ; Fri, 19 Dec 2014 01:53:26 -0800 (PST) In-Reply-To: (Grant Rettke's message of "Thu, 18 Dec 2014 20:30:00 -0600") 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 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/rainerkrug= /.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/WTAAoJENvXNx4PUvmCJzUH/2eoMxL0n7Bwu0kn8aYOGlA8 iQkFCR6OeTV0gkNIn41xOW/ILkRIELnWvd3SuO9DdemN+vk31IB6JgNDIiyNhmSR N+yISpr+uuwQNiJfMbJxPg+gu6ydkdAiv0uUUpFRZQqJgYl0BssfoZVBqDc4vyg9 rnSmX3YR6E0SHds0/TM452YqHcGuDJs/VQ3KF3cpvLGEKcJUUdmZ5sRv7soHN0Ds 7byR1nl/R87BEuIpPbRtchckPckRhCvfU/DV2W+TLNlxOD5kbNU551kKLEwrrYlM TYmh8lnwFyGWLpmGhEHjibi7qW4g6zKjP5TQPfBlLoKOD6WvMbjXNJF/CQP1PU8= =g94z -----END PGP SIGNATURE----- --=-=-=--