Explorar o código

cleaned version of body is now added to kill ring

Eric Schulte %!s(int64=16) %!d(string=hai) anos
pai
achega
d1bcb5e425
Modificáronse 2 ficheiros con 8 adicións e 2 borrados
  1. 1 1
      lisp/org-babel.el
  2. 7 1
      org-babel.org

+ 1 - 1
lisp/org-babel.el

@@ -125,7 +125,7 @@ of the source block to the kill ring."
     (unless (member lang org-babel-interpreters)
       (error "Language is not in `org-babel-interpreters': %s" lang))
     ;; copy body to the kill ring
-    (with-temp-buffer (insert body) (copy-region-as-kill (point-min) (point-max)))
+    (with-temp-buffer (insert (org-babel-trim body)) (copy-region-as-kill (point-min) (point-max)))
     ;; if called with a prefix argument, then process header arguments
     (if arg (funcall (intern (concat "org-babel-prep-session:" lang)) session params))
     ;; just to the session using pop-to-buffer

+ 7 - 1
org-babel.org

@@ -677,11 +677,17 @@ For lack of a better place, lets add this to the
 
 #+srcname: task-ruby-pop-to-session
 #+begin_src ruby :var num=9 :var another="something else"
+num.times{|n| puts another}
+#+end_src
+
+**** TODO python
+
+#+srcname: task-python-pop-to-session
+#+begin_src python :var num=9 :var another="something else"
 num.times{|n| puts n}
 #+end_src
 
 **** TODO R
-**** TODO python
 **** TODO shell
 *** TODO function to dump last N lines from inf-proc buffer into the current source block