emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* meaningfull names for org-src buffers
@ 2014-09-11 22:05 Adriaan Sticker
  2014-09-21 13:49 ` Grant Rettke
  0 siblings, 1 reply; 9+ messages in thread
From: Adriaan Sticker @ 2014-09-11 22:05 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 303 bytes --]

Hi all

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.

Greets

[-- Attachment #2: Type: text/html, Size: 421 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: meaningfull names for org-src buffers
  2014-09-11 22:05 meaningfull names for org-src buffers Adriaan Sticker
@ 2014-09-21 13:49 ` Grant Rettke
  2014-09-21 15:07   ` Adriaan Sticker
  2014-09-25 10:55   ` Andreas Leha
  0 siblings, 2 replies; 9+ messages in thread
From: Grant Rettke @ 2014-09-21 13:49 UTC (permalink / raw)
  To: Adriaan Sticker; +Cc: emacs-orgmode@gnu.org

On Thu, Sep 11, 2014 at 5:05 PM, Adriaan Sticker
<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?

-- 
Grant Rettke
gcr@wisdomandwonder.com | http://www.wisdomandwonder.com/
“Wisdom begins in wonder.” --Socrates
((λ (x) (x x)) (λ (x) (x x)))
“Life has become immeasurably better since I have been forced to stop
taking it seriously.” --Thompson

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: meaningfull names for org-src buffers
  2014-09-21 13:49 ` Grant Rettke
@ 2014-09-21 15:07   ` Adriaan Sticker
  2014-09-21 15:51     ` Grant Rettke
  2014-09-25 10:54     ` Andreas Leha
  2014-09-25 10:55   ` Andreas Leha
  1 sibling, 2 replies; 9+ messages in thread
From: Adriaan Sticker @ 2014-09-21 15:07 UTC (permalink / raw)
  To: Grant Rettke; +Cc: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1566 bytes --]

Well, I ussually just try to live with this limitation. :)
I try to C-c ' in and out src block whenever possible so my my list with
buffer names doesnt get to cluttered.

Im also thinking about investigating the usefullness of polymode (
https://github.com/vitoshka/polymode)
So I dont have to go to a different buffer all the time. Do you have any
experience with this?

Greetings

2014-09-21 15:49 GMT+02:00 Grant Rettke <gcr@wisdomandwonder.com>:

> On Thu, Sep 11, 2014 at 5:05 PM, Adriaan Sticker
> <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?
>
> --
> Grant Rettke
> gcr@wisdomandwonder.com | http://www.wisdomandwonder.com/
> “Wisdom begins in wonder.” --Socrates
> ((λ (x) (x x)) (λ (x) (x x)))
> “Life has become immeasurably better since I have been forced to stop
> taking it seriously.” --Thompson
>

[-- Attachment #2: Type: text/html, Size: 2375 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: meaningfull names for org-src buffers
  2014-09-21 15:07   ` Adriaan Sticker
@ 2014-09-21 15:51     ` Grant Rettke
  2014-09-25 10:54     ` Andreas Leha
  1 sibling, 0 replies; 9+ messages in thread
From: Grant Rettke @ 2014-09-21 15:51 UTC (permalink / raw)
  To: Adriaan Sticker; +Cc: emacs-orgmode@gnu.org

On Sun, Sep 21, 2014 at 10:07 AM, Adriaan Sticker
<adriaan.sticker@gmail.com> wrote:
> Im also thinking about investigating the usefullness of polymode
> (https://github.com/vitoshka/polymode)
> So I dont have to go to a different buffer all the time. Do you have any
> experience with this?

No and it is on my TODO list because you may use it for .Rmd files so
it is a must-learn.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: meaningfull names for org-src buffers
  2014-09-21 15:07   ` Adriaan Sticker
  2014-09-21 15:51     ` Grant Rettke
@ 2014-09-25 10:54     ` Andreas Leha
  1 sibling, 0 replies; 9+ messages in thread
From: Andreas Leha @ 2014-09-25 10:54 UTC (permalink / raw)
  To: emacs-orgmode

Hi Adriaan,

Adriaan Sticker <adriaan.sticker@gmail.com> writes:
> Well, I ussually just try to live with this limitation. :)
> I try to C-c ' in and out src block whenever possible so my my list
> with buffer names doesnt get to cluttered. 
>
> Im also thinking about investigating the usefullness of polymode
> (https://github.com/vitoshka/polymode)
> So I dont have to go to a different buffer all the time. Do you have
> any experience with this?

I have finally looked into this some weeks back.  And got emacs lock up.

To quote from the author [fn:1]:

,----
| The work on polymode got stuck a bit as Emacs folks strongly discourage
| inderect buffer usage. So I will have to remove indirect buffers from
| the picture. This will solve all the font-locking problems as the one
| you have described.
`----

I am looking forward to testing any next version, though.

Regards,
Andreas


Footnotes:

[fn:1] http://article.gmane.org/gmane.emacs.ess.general/8342/match=polymode

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: meaningfull names for org-src buffers
  2014-09-21 13:49 ` Grant Rettke
  2014-09-21 15:07   ` Adriaan Sticker
@ 2014-09-25 10:55   ` Andreas Leha
  2014-09-25 19:55     ` Charles Berry
  1 sibling, 1 reply; 9+ messages in thread
From: Andreas Leha @ 2014-09-25 10:55 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

Grant Rettke <gcr@wisdomandwonder.com> writes:
> On Thu, Sep 11, 2014 at 5:05 PM, Adriaan Sticker
> <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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: meaningfull names for org-src buffers
  2014-09-25 10:55   ` Andreas Leha
@ 2014-09-25 19:55     ` Charles Berry
  2014-09-25 20:22       ` Andreas Leha
  0 siblings, 1 reply; 9+ messages in thread
From: Charles Berry @ 2014-09-25 19:55 UTC (permalink / raw)
  To: emacs-orgmode

Andreas Leha <andreas.leha <at> med.uni-goettingen.de> writes:

> 
> Hi,
> 
> Grant Rettke <gcr <at> wisdomandwonder.com> writes:
> > On Thu, Sep 11, 2014 at 5:05 PM, Adriaan Sticker
> > <adriaan.sticker <at> 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: meaningfull names for org-src buffers
  2014-09-25 19:55     ` Charles Berry
@ 2014-09-25 20:22       ` Andreas Leha
  2014-09-26  6:33         ` Rainer M Krug
  0 siblings, 1 reply; 9+ messages in thread
From: Andreas Leha @ 2014-09-25 20:22 UTC (permalink / raw)
  To: emacs-orgmode

Hi Charles,

Charles Berry <ccberry@ucsd.edu> writes:
> Andreas Leha <andreas.leha <at> med.uni-goettingen.de> writes:
>
>> 
>> Hi,
>> 
>> Grant Rettke <gcr <at> wisdomandwonder.com> writes:
>> > On Thu, Sep 11, 2014 at 5:05 PM, Adriaan Sticker
>> > <adriaan.sticker <at> 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:
>

You are answering my exact question.

>
> ,----[ 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.
>

Thanks!  On my first quick tests that works great!  It is in my
initialization and I'll use that regularly.

Is there any drawback to this?  Otherwise I'd advocate for
org-edit-src-code doing that by default.

> HTH,

It sure does.

Thanks,
Andreas

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: meaningfull names for org-src buffers
  2014-09-25 20:22       ` Andreas Leha
@ 2014-09-26  6:33         ` Rainer M Krug
  0 siblings, 0 replies; 9+ messages in thread
From: Rainer M Krug @ 2014-09-26  6:33 UTC (permalink / raw)
  To: Andreas Leha; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2719 bytes --]

Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:

> Hi Charles,
>
> Charles Berry <ccberry@ucsd.edu> writes:
>> Andreas Leha <andreas.leha <at> med.uni-goettingen.de> writes:
>>
>>> 
>>> Hi,
>>> 
>>> Grant Rettke <gcr <at> wisdomandwonder.com> writes:
>>> > On Thu, Sep 11, 2014 at 5:05 PM, Adriaan Sticker
>>> > <adriaan.sticker <at> 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:
>>
>
> You are answering my exact question.
>
>>
>> ,----[ 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.
>>
>
> Thanks!  On my first quick tests that works great!  It is in my
> initialization and I'll use that regularly.
>
> Is there any drawback to this?  Otherwise I'd advocate for
> org-edit-src-code doing that by default.

Haven't tried it out yet, but I second that statement.

Rainer

>
>> HTH,
>
> It sure does.
>
> Thanks,
> Andreas
>
>
>

-- 
Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982

[-- Attachment #2: Type: application/pgp-signature, Size: 494 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-09-26  6:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-11 22:05 meaningfull names for org-src buffers Adriaan Sticker
2014-09-21 13:49 ` Grant Rettke
2014-09-21 15:07   ` Adriaan Sticker
2014-09-21 15:51     ` Grant Rettke
2014-09-25 10:54     ` Andreas Leha
2014-09-25 10:55   ` Andreas Leha
2014-09-25 19:55     ` Charles Berry
2014-09-25 20:22       ` Andreas Leha
2014-09-26  6:33         ` Rainer M Krug

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).