From mboxrd@z Thu Jan 1 00:00:00 1970 From: Charles Berry Subject: Re: meaningfull names for org-src buffers Date: Thu, 25 Sep 2014 19:55:45 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58177) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXF9C-0004YK-8Z for emacs-orgmode@gnu.org; Thu, 25 Sep 2014 15:56:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XXF97-00071f-D9 for emacs-orgmode@gnu.org; Thu, 25 Sep 2014 15:56:14 -0400 Received: from plane.gmane.org ([80.91.229.3]:55043) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXF97-00070C-6q for emacs-orgmode@gnu.org; Thu, 25 Sep 2014 15:56:09 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XXF8v-00067t-H4 for emacs-orgmode@gnu.org; Thu, 25 Sep 2014 21:55:57 +0200 Received: from 137.110.37.92 ([137.110.37.92]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 25 Sep 2014 21:55:57 +0200 Received: from ccberry by 137.110.37.92 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 25 Sep 2014 21:55:57 +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: emacs-orgmode@gnu.org Andreas Leha med.uni-goettingen.de> writes: > > Hi, > > Grant Rettke wisdomandwonder.com> writes: > > On Thu, Sep 11, 2014 at 5:05 PM, Adriaan Sticker > > gmail.com> wrote: > >> I was wondering if it's somehow possible to give named org src buffer the > >> name they were give in their #+NAME tag? Now there are just called > >> something like: > >> *Org Src test.org[ R ]* > >> > >> But if you have multiple org-src buffers opened at the same time, its > >> hard to find the correct one back. > > > > Excellent idea. I've got so many small source blocks that it is too > > difficult to make sense of > > keeping multiple source block edit buffers open and limit them to one > > at a time eg > > > > ,---- > > | (setq org-src-window-setup 'current-window) > > `---- > > > > How have you come upon your workflow of keeping multiple open and what > > are some of the pros and > > cons that you've found with it? > > I'd be interested in this as well. > > Regards, > Andreas > > Maybe I am answering the wrong question, but org-edit-src-code allows you to specify the buffer name: ,----[ C-h f org-edit-src-code RET ] | org-edit-src-code is an interactive compiled Lisp function in | `org-src.el'. | | (org-edit-src-code &optional CONTEXT CODE EDIT-BUFFER-NAME) | | ... `---- So you can do something like this: #+BEGIN_SRC emacs-lisp (defun org-edit-src-code-plus-name () (interactive) (let* ((eop (org-element-at-point)) (name (or (org-element-property :name (org-element-context eop)) "unnamed")) (lang (org-element-property :language eop)) (buff-name (concat "*Org Src " name "[ " lang " ] *"))) (org-edit-src-code nil nil buff-name))) #+END_SRC which leads to a buffer named like "*Org Src My-block[ R ] *", where 'My-block' is the name of the src block. HTH, Chuck