Re: [O] meaningfull names for org-src buffers

2014-09-26 Thread Rainer M Krug
Andreas Leha andreas.l...@med.uni-goettingen.de writes:

 Hi Charles,

 Charles Berry ccbe...@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: Raineratkrugsdotde
PGP: 0x0F52F982


pgpxPBgKlq0Wd.pgp
Description: PGP signature


Re: [O] meaningfull names for org-src buffers

2014-09-25 Thread Andreas Leha
Hi,

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




Re: [O] meaningfull names for org-src buffers

2014-09-25 Thread Andreas Leha
Hi Adriaan,

Adriaan Sticker adriaan.stic...@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




Re: [O] meaningfull names for org-src buffers

2014-09-25 Thread Charles Berry
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




Re: [O] meaningfull names for org-src buffers

2014-09-25 Thread Andreas Leha
Hi Charles,

Charles Berry ccbe...@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




Re: [O] meaningfull names for org-src buffers

2014-09-21 Thread Adriaan Sticker
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 g...@wisdomandwonder.com:

 On Thu, Sep 11, 2014 at 5:05 PM, Adriaan Sticker
 adriaan.stic...@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
 g...@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



Re: [O] meaningfull names for org-src buffers

2014-09-21 Thread Grant Rettke
On Sun, Sep 21, 2014 at 10:07 AM, Adriaan Sticker
adriaan.stic...@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.



[O] meaningfull names for org-src buffers

2014-09-11 Thread Adriaan Sticker
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