Re: [O] paste from clip to code block

2015-09-07 Thread John Kitchin
For example with the cursor on a src-block press C-c l to store a link to that name, and later type C-c C-l to insert a link to that src-block. It would look a little like this: #+BEGIN_SRC emacs-lisp (defun org-src-block-store-link () (let* ((object (org-element-context))) (when (equal (org

Re: [O] paste from clip to code block

2015-09-07 Thread Grant Rettke
On Mon, Sep 7, 2015 at 9:09 AM, John Kitchin wrote: > Neat. Do you have some handy way to store a link to the source block, or > jump to them? I don't, but please tell us more about what you mean.

Re: [O] paste from clip to code block

2015-09-07 Thread John Kitchin
Neat. Do you have some handy way to store a link to the source block, or jump to them? Grant Rettke writes: > On Thu, May 7, 2015 at 2:59 AM, Sebastien Vauban > wrote: >> John Kitchin wrote: >>> I have these templates defined in my setup: > > I used my duplicated Org macros as an excuse to learn

Re: [O] paste from clip to code block

2015-09-05 Thread Grant Rettke
On Thu, May 7, 2015 at 2:59 AM, Sebastien Vauban wrote: > John Kitchin wrote: >> I have these templates defined in my setup: I used my duplicated Org macros as an excuse to learn YASnippet and came up with this. It is work in progress, but it works. I got tired of entering a name so many times al

Re: [O] paste from clip to code block

2015-05-07 Thread Sebastien Vauban
John Kitchin wrote: > I have these templates defined in my setup: > > ;; * Expansions for blocks [...] > > ;; add (add-to-list 'org-structure-template-alist > '("sh" "#+BEGIN_SRC sh\n?\n#+END_SRC" " lang=\"shell\">\n?\n")) Note that the language should be `shell' in Org from Git (not

Re: [O] paste from clip to code block

2015-04-17 Thread John Kitchin
you are right, I meant C-y ;) I have these templates defined in my setup: ;; * Expansions for blocks ;; add \n?\n")) ;; add \n?\n")) ;; add \n?\n")) ;; add \n?\n")) ;; add \n?\n")) John --- Professor John Kitchin Doherty Hall A207F Department of Chemical Engi

Re: [O] paste from clip to code block

2015-04-17 Thread Jorge A. Alfaro-Murillo
John Kitchin writes: I like this kind of keyboard shortcut: For python: For emacs-lisp I agree, this is the best method. Although probably you mean C-y instead of C-w. For the record, this requires you to set up `org-structure-template-alist' to include python and emacs-lisp. For exa

Re: [O] paste from clip to code block

2015-04-17 Thread Xebar Saram
thx john that are very helpful tips! Z On Fri, Apr 17, 2015 at 4:56 PM, John Kitchin wrote: > I like this kind of keyboard shortcut: > > For python: > > For emacs-lisp > > > What else would you want? > > If you like yasnippets, you could do this: > > # -*- mode: snippet; require-final-newlin

Re: [O] paste from clip to code block

2015-04-17 Thread John Kitchin
I like this kind of keyboard shortcut: For python: Hi all > > i was wondering if anyone has every created a function to auto paste what > in the sysclip/emas clip into org but as a formatted code block? > any clue anyone? > > best > > Z -- Professor John Kitchin Doherty Hall A207F Department of

[O] paste from clip to code block

2015-04-17 Thread Xebar Saram
Hi all i was wondering if anyone has every created a function to auto paste what in the sysclip/emas clip into org but as a formatted code block? any clue anyone? best Z