From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xebar Saram Subject: Re: paste from clip to code block Date: Fri, 17 Apr 2015 17:36:06 +0300 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b675b5825e5ba0513ec80b8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj7NM-0004GI-MW for emacs-orgmode@gnu.org; Fri, 17 Apr 2015 10:36:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yj7NI-0008Se-6m for emacs-orgmode@gnu.org; Fri, 17 Apr 2015 10:36:12 -0400 Received: from mail-pa0-x236.google.com ([2607:f8b0:400e:c03::236]:35756) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj7NH-0008SN-VG for emacs-orgmode@gnu.org; Fri, 17 Apr 2015 10:36:08 -0400 Received: by pabtp1 with SMTP id tp1so127202249pab.2 for ; Fri, 17 Apr 2015 07:36:06 -0700 (PDT) In-Reply-To: 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: John Kitchin Cc: org mode --047d7b675b5825e5ba0513ec80b8 Content-Type: text/plain; charset=UTF-8 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-newline: nil -*- > # -- > > #+begin_src python > `(yank)` > #+end_src > > $0 > > Or some kind of lisp function like: > #+BEGIN_SRC emacs-lisp > (defun paste-python-code () > (interactive) > (insert "#+BEGIN_SRC python\n") > (yank) > (insert "\n#+END_SRC")) > #+END_SRC > > I guess you need one of these for every language type. > Xebar Saram writes: > > > 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 Chemical Engineering > Carnegie Mellon University > Pittsburgh, PA 15213 > 412-268-7803 > @johnkitchin > http://kitchingroup.cheme.cmu.edu > --047d7b675b5825e5ba0513ec80b8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

thx john

that are very helpful tips!

Z

On Fri, Apr 17, 2015 at 4:56 PM, John Kitchin <j= kitchin@andrew.cmu.edu> wrote:
I like this kind of keyboard shortcut:

For python:
<p TAB C-w

For emacs-lisp

<el TAB C-w

What else would you want?

If you like yasnippets, you could do this:

# -*- mode: snippet; require-final-newline: nil -*-
# --

#+begin_src python
`(yank)`
#+end_src

$0

Or some kind of lisp function like:
#+BEGIN_SRC emacs-lisp
(defun paste-python-code ()
=C2=A0 (interactive)
=C2=A0 (insert "#+BEGIN_SRC python\n")
=C2=A0 (yank)
=C2=A0 (insert "\n#+END_SRC"))
#+END_SRC

I guess you need one of these for every language type.
Xebar Saram writes:

> Hi all
>
> i was wondering if anyone has every created a function to auto paste w= hat
> 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 Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitc= hingroup.cheme.cmu.edu

--047d7b675b5825e5ba0513ec80b8--