From mboxrd@z Thu Jan 1 00:00:00 1970 From: stardiviner Subject: ob-python specify session error Date: Wed, 19 Jun 2019 14:04:43 +0800 Message-ID: <875zp2w1ok.fsf@gmail.com> Reply-To: numbchild@gmail.com Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:45915) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdTpt-000133-6e for emacs-orgmode@gnu.org; Wed, 19 Jun 2019 02:12:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdTpo-0004CV-KW for emacs-orgmode@gnu.org; Wed, 19 Jun 2019 02:12:45 -0400 Received: from [122.236.11.153] (port=39808 helo=dark.localdomain) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hdTpn-0004BP-Gu for emacs-orgmode@gnu.org; Wed, 19 Jun 2019 02:12:40 -0400 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" To: Org Mode #+begin_src python :session wxpy from wxpy import * #+end_src When I =3D[C-c C-c]=3D eval source block, I got following error: #+begin_example Debugger entered--Lisp error: (wrong-number-of-arguments (0 . 0) 1) py-toggle-shells("python") (cond ((and (eq 'python org-babel-python-mode) (fboundp 'run-python)) (if= (not (version< "24.1" emacs-version)) (run-python cmd) (if python-buffer n= il (setq python-buffer (org-babel-python-with-earmuffs session))) (let ((py= thon-shell-buffer-name (org-babel-python-without-earmuffs python-buffer))) = (run-python cmd)))) ((and (eq 'python-mode org-babel-python-mode) (fboundp = 'py-shell)) (py-toggle-shells py-default-interpreter) (let* ((bufname (if (= and python-buffer (buffer-live-p python-buffer)) (replace-regexp-in-string = "^\\*\\([^*]+\\)\\*$" "\\1" python-buffer) (concat "Python-" (symbol-name s= ession)))) (py-which-bufname bufname)) (py-shell) (setq python-buffer (org-= babel-python-with-earmuffs bufname)))) (t (error "No function available for= running an inferior Pyth..."))) (let* ((session (if session (intern session) :default)) (python-buffer (o= rg-babel-python-session-buffer session)) (cmd (if (member system-type '(cyg= win windows-nt ms-dos)) (concat org-babel-python-command " -i") org-babel-p= ython-command))) (cond ((and (eq 'python org-babel-python-mode) (fboundp 'r= un-python)) (if (not (version< "24.1" emacs-version)) (run-python cmd) (if = python-buffer nil (setq python-buffer (org-babel-python-with-earmuffs sessi= on))) (let ((python-shell-buffer-name (org-babel-python-without-earmuffs py= thon-buffer))) (run-python cmd)))) ((and (eq 'python-mode org-babel-python-= mode) (fboundp 'py-shell)) (py-toggle-shells py-default-interpreter) (let* = ((bufname (if (and python-buffer ...) (replace-regexp-in-string "^\\*\\([^*= ]+\\)\\*$" "\\1" python-buffer) (concat "Python-" ...))) (py-which-bufname = bufname)) (py-shell) (setq python-buffer (org-babel-python-with-earmuffs bu= fname)))) (t (error "No function available for running an inferior Pyth..."= ))) (setq org-babel-python-buffers (cons (cons session python-buffer) (assq= -delete-all session org-babel-python-buffers))) session) (progn (let* ((session (if session (intern session) :default)) (python-bu= ffer (org-babel-python-session-buffer session)) (cmd (if (member system-typ= e '(cygwin windows-nt ms-dos)) (concat org-babel-python-command " -i") org-= babel-python-command))) (cond ((and (eq 'python org-babel-python-mode) (fbo= undp 'run-python)) (if (not (version< "24.1" emacs-version)) (run-python cm= d) (if python-buffer nil (setq python-buffer (org-babel-python-with-earmuff= s session))) (let ((python-shell-buffer-name ...)) (run-python cmd)))) ((an= d (eq 'python-mode org-babel-python-mode) (fboundp 'py-shell)) (py-toggle-s= hells py-default-interpreter) (let* ((bufname (if ... ... ...)) (py-which-b= ufname bufname)) (py-shell) (setq python-buffer (org-babel-python-with-earm= uffs bufname)))) (t (error "No function available for running an inferior P= yth..."))) (setq org-babel-python-buffers (cons (cons session python-buffer= ) (assq-delete-all session org-babel-python-buffers))) session)) (unwind-protect (progn (let* ((session (if session (intern session) :defa= ult)) (python-buffer (org-babel-python-session-buffer session)) (cmd (if (m= ember system-type '...) (concat org-babel-python-command " -i") org-babel-p= ython-command))) (cond ((and (eq 'python org-babel-python-mode) (fboundp 'r= un-python)) (if (not (version< "24.1" emacs-version)) (run-python cmd) (if = python-buffer nil (setq python-buffer ...)) (let (...) (run-python cmd)))) = ((and (eq 'python-mode org-babel-python-mode) (fboundp 'py-shell)) (py-togg= le-shells py-default-interpreter) (let* ((bufname ...) (py-which-bufname bu= fname)) (py-shell) (setq python-buffer (org-babel-python-with-earmuffs bufn= ame)))) (t (error "No function available for running an inferior Pyth..."))= ) (setq org-babel-python-buffers (cons (cons session python-buffer) (assq-d= elete-all session org-babel-python-buffers))) session)) (set-window-configu= ration wconfig)) (let ((wconfig (current-window-configuration))) (unwind-protect (progn (l= et* ((session (if session (intern session) :default)) (python-buffer (org-b= abel-python-session-buffer session)) (cmd (if (member system-type ...) (con= cat org-babel-python-command " -i") org-babel-python-command))) (cond ((and= (eq ... org-babel-python-mode) (fboundp ...)) (if (not ...) (run-python cm= d) (if python-buffer nil ...) (let ... ...))) ((and (eq ... org-babel-pytho= n-mode) (fboundp ...)) (py-toggle-shells py-default-interpreter) (let* (...= ...) (py-shell) (setq python-buffer ...))) (t (error "No function availabl= e for running an inferior Pyth..."))) (setq org-babel-python-buffers (cons = (cons session python-buffer) (assq-delete-all session org-babel-python-buff= ers))) session)) (set-window-configuration wconfig))) org-babel-python-initiate-session-by-key("yes") (org-babel-python-session-buffer (org-babel-python-initiate-session-by-ke= y session)) (if (string=3D session "none") nil (org-babel-python-session-buffer (org-= babel-python-initiate-session-by-key session))) org-babel-python-initiate-session("yes") (let* ((org-babel-python-command (or (cdr (assq :python params)) org-babe= l-python-command)) (session (org-babel-python-initiate-session (cdr (assq := session params)))) (result-params (cdr (assq :result-params params))) (resu= lt-type (cdr (assq :result-type params))) (return-val (if (and (eq result-t= ype 'value) (not session)) (progn (cdr (assq :return params))))) (preamble = (cdr (assq :preamble params))) (full-body (org-babel-expand-body:generic (c= oncat body (if return-val (format "\nreturn %s" return-val) "")) params (or= g-babel-variable-assignments:python params))) (result (org-babel-python-eva= luate session full-body result-type result-params preamble))) (org-babel-re= assemble-table result (org-babel-pick-name (cdr (assq :colname-names params= )) (cdr (assq :colnames params))) (org-babel-pick-name (cdr (assq :rowname-= names params)) (cdr (assq :rownames params))))) org-babel-execute:python("from wxpy import *" ((:colname-names) (:rowname= -names) (:result-params "replace" "output") (:result-type . output) (:resul= ts . "replace output") (:exports . "") (:hlines . "no") (:tangle . "no") (:= cache . "yes") (:mkdirp . "yes") (:noweb . "yes") (:eval . "yes") (:session= . "yes"))) funcall(org-babel-execute:python "from wxpy import *" ((:colname-names) (= :rowname-names) (:result-params "replace" "output") (:result-type . output)= (:results . "replace output") (:exports . "") (:hlines . "no") (:tangle . = "no") (:cache . "yes") (:mkdirp . "yes") (:noweb . "yes") (:eval . "yes") (= :session . "yes"))) (let ((r (funcall cmd body params))) (if (and (eq (cdr (assq :result-type= params)) 'value) (or (member "vector" result-params) (member "table" resul= t-params)) (not (listp r))) (list (list r)) r)) (setq result (let ((r (funcall cmd body params))) (if (and (eq (cdr (assq= :result-type params)) 'value) (or (member "vector" result-params) (member = "table" result-params)) (not (listp r))) (list (list r)) r))) (if (member "none" result-params) (progn (funcall cmd body params) (messa= ge "result silenced")) (setq result (let ((r (funcall cmd body params))) (i= f (and (eq (cdr (assq :result-type params)) 'value) (or (member "vector" re= sult-params) (member "table" result-params)) (not (listp r))) (list (list r= )) r))) (let ((file (and (member "file" result-params) (cdr (assq :file par= ams))))) (if file (progn (if (and result (not (or ... ...))) (progn (let (.= .. ...) (unwind-protect ... ...)))) (setq result file))) (let ((post (cdr (= assq :post params)))) (if post (progn (let ((*this* ...)) (setq result (org= -babel-ref-resolve post)) (if file (progn ...)))))) (org-babel-insert-resul= t result result-params info new-hash lang))) (let* ((lang (nth 0 info)) (result-params (cdr (assq :result-params param= s))) (body (let ((coderef (nth 6 info)) (expand (if (org-babel-noweb-p para= ms :eval) (org-babel-expand-noweb-references info) (nth 1 info)))) (if (not= coderef) expand (replace-regexp-in-string (org-src-coderef-regexp coderef)= "" expand nil nil 1)))) (dir (cdr (assq :dir params))) (mkdirp (cdr (assq = :mkdirp params))) (default-directory (cond ((not dir) default-directory) ((= member mkdirp '("no" "nil" nil)) (file-name-as-directory (expand-file-name = dir))) (t (let ((d ...)) (make-directory d 'parents) d)))) (cmd (intern (co= ncat "org-babel-execute:" lang))) result) (if (fboundp cmd) nil (error "No = org-babel-execute function for %s!" lang)) (message "executing %s code bloc= k%s..." (capitalize lang) (let ((name (nth 4 info))) (if name (format " (%s= )" name) ""))) (if (member "none" result-params) (progn (funcall cmd body p= arams) (message "result silenced")) (setq result (let ((r (funcall cmd body= params))) (if (and (eq (cdr ...) 'value) (or (member "vector" result-param= s) (member "table" result-params)) (not (listp r))) (list (list r)) r))) (l= et ((file (and (member "file" result-params) (cdr (assq :file params))))) (= if file (progn (if (and result (not ...)) (progn (let ... ...))) (setq resu= lt file))) (let ((post (cdr (assq :post params)))) (if post (progn (let (..= .) (setq result ...) (if file ...))))) (org-babel-insert-result result resu= lt-params info new-hash lang))) (run-hooks 'org-babel-after-execute-hook) r= esult) (cond (current-cache (save-excursion (goto-char (org-babel-where-is-src-b= lock-result nil info)) (forward-line) (skip-chars-forward " \11") (let ((re= sult (org-babel-read-result))) (message (replace-regexp-in-string "%" "%%" = (format "%S" result))) result))) ((org-babel-confirm-evaluate info) (let* (= (lang (nth 0 info)) (result-params (cdr (assq :result-params params))) (bod= y (let ((coderef ...) (expand ...)) (if (not coderef) expand (replace-regex= p-in-string ... "" expand nil nil 1)))) (dir (cdr (assq :dir params))) (mkd= irp (cdr (assq :mkdirp params))) (default-directory (cond ((not dir) defaul= t-directory) ((member mkdirp ...) (file-name-as-directory ...)) (t (let ...= ... d)))) (cmd (intern (concat "org-babel-execute:" lang))) result) (if (f= boundp cmd) nil (error "No org-babel-execute function for %s!" lang)) (mess= age "executing %s code block%s..." (capitalize lang) (let ((name (nth 4 inf= o))) (if name (format " (%s)" name) ""))) (if (member "none" result-params)= (progn (funcall cmd body params) (message "result silenced")) (setq result= (let ((r ...)) (if (and ... ... ...) (list ...) r))) (let ((file (and ... = ...))) (if file (progn (if ... ...) (setq result file))) (let ((post ...)) = (if post (progn ...))) (org-babel-insert-result result result-params info n= ew-hash lang))) (run-hooks 'org-babel-after-execute-hook) result))) (let* ((params (nth 2 info)) (cache (let ((c (cdr (assq :cache params))))= (and (not arg) c (string=3D "yes" c)))) (new-hash (and cache (org-babel-sh= a1-hash info :eval))) (old-hash (and cache (org-babel-current-result-hash))= ) (current-cache (and new-hash (equal new-hash old-hash)))) (cond (current-= cache (save-excursion (goto-char (org-babel-where-is-src-block-result nil i= nfo)) (forward-line) (skip-chars-forward " \11") (let ((result (org-babel-r= ead-result))) (message (replace-regexp-in-string "%" "%%" (format "%S" resu= lt))) result))) ((org-babel-confirm-evaluate info) (let* ((lang (nth 0 info= )) (result-params (cdr (assq :result-params params))) (body (let (... ...) = (if ... expand ...))) (dir (cdr (assq :dir params))) (mkdirp (cdr (assq :mk= dirp params))) (default-directory (cond (... default-directory) (... ...) (= t ...))) (cmd (intern (concat "org-babel-execute:" lang))) result) (if (fbo= undp cmd) nil (error "No org-babel-execute function for %s!" lang)) (messag= e "executing %s code block%s..." (capitalize lang) (let ((name ...)) (if na= me (format " (%s)" name) ""))) (if (member "none" result-params) (progn (fu= ncall cmd body params) (message "result silenced")) (setq result (let (...)= (if ... ... r))) (let ((file ...)) (if file (progn ... ...)) (let (...) (i= f post ...)) (org-babel-insert-result result result-params info new-hash la= ng))) (run-hooks 'org-babel-after-execute-hook) result)))) (progn (let* ((c (nthcdr 2 info))) (setcar c (org-babel-process-params (c= ar c)))) (let* ((params (nth 2 info)) (cache (let ((c (cdr ...))) (and (not= arg) c (string=3D "yes" c)))) (new-hash (and cache (org-babel-sha1-hash in= fo :eval))) (old-hash (and cache (org-babel-current-result-hash))) (current= -cache (and new-hash (equal new-hash old-hash)))) (cond (current-cache (sav= e-excursion (goto-char (org-babel-where-is-src-block-result nil info)) (for= ward-line) (skip-chars-forward " \11") (let ((result ...)) (message (replac= e-regexp-in-string "%" "%%" ...)) result))) ((org-babel-confirm-evaluate in= fo) (let* ((lang (nth 0 info)) (result-params (cdr ...)) (body (let ... ...= )) (dir (cdr ...)) (mkdirp (cdr ...)) (default-directory (cond ... ... ...)= ) (cmd (intern ...)) result) (if (fboundp cmd) nil (error "No org-babel-exe= cute function for %s!" lang)) (message "executing %s code block%s..." (capi= talize lang) (let (...) (if name ... ""))) (if (member "none" result-params= ) (progn (funcall cmd body params) (message "result silenced")) (setq resul= t (let ... ...)) (let (...) (if file ...) (let ... ...) (org-babel-insert-r= esult result result-params info new-hash lang))) (run-hooks 'org-babel-afte= r-execute-hook) result))))) (if (org-babel-check-evaluate info) (progn (let* ((c (nthcdr 2 info))) (s= etcar c (org-babel-process-params (car c)))) (let* ((params (nth 2 info)) (= cache (let ((c ...)) (and (not arg) c (string=3D "yes" c)))) (new-hash (and= cache (org-babel-sha1-hash info :eval))) (old-hash (and cache (org-babel-c= urrent-result-hash))) (current-cache (and new-hash (equal new-hash old-hash= )))) (cond (current-cache (save-excursion (goto-char (org-babel-where-is-sr= c-block-result nil info)) (forward-line) (skip-chars-forward " \11") (let (= ...) (message ...) result))) ((org-babel-confirm-evaluate info) (let* ((lan= g ...) (result-params ...) (body ...) (dir ...) (mkdirp ...) (default-direc= tory ...) (cmd ...) result) (if (fboundp cmd) nil (error "No org-babel-exec= ute function for %s!" lang)) (message "executing %s code block%s..." (capit= alize lang) (let ... ...)) (if (member "none" result-params) (progn ... ...= ) (setq result ...) (let ... ... ... ...)) (run-hooks 'org-babel-after-exec= ute-hook) result)))))) (let* ((org-babel-current-src-block-location (or org-babel-current-src-bl= ock-location (nth 5 info) (org-babel-where-is-src-block-head))) (info (if i= nfo (copy-tree info) (org-babel-get-src-block-info)))) (let* ((c (nthcdr 2 = info))) (setcar c (org-babel-merge-params (car c) params))) (if (org-babel-= check-evaluate info) (progn (let* ((c (nthcdr 2 info))) (setcar c (org-babe= l-process-params (car c)))) (let* ((params (nth 2 info)) (cache (let (...) = (and ... c ...))) (new-hash (and cache (org-babel-sha1-hash info :eval))) (= old-hash (and cache (org-babel-current-result-hash))) (current-cache (and n= ew-hash (equal new-hash old-hash)))) (cond (current-cache (save-excursion (= goto-char ...) (forward-line) (skip-chars-forward " \11") (let ... ... resu= lt))) ((org-babel-confirm-evaluate info) (let* (... ... ... ... ... ... ...= result) (if ... nil ...) (message "executing %s code block%s..." ... ...) = (if ... ... ... ...) (run-hooks ...) result))))))) (closure (*this* org-babel-confirm-evaluate-answer-no org-src-preserve-in= dentation org-src-lang-modes org-edit-src-content-indentation org-babel-lib= rary-of-babel t) (&optional arg info params) "Execute the current source co= de block.\nInsert the ..." (interactive) (let* ((org-babel-current-src-bloc= k-location (or org-babel-current-src-block-location (nth 5 info) (org-babel= -where-is-src-block-head))) (info (if info (copy-tree info) (org-babel-get-= src-block-info)))) (let* ((c (nthcdr 2 info))) (setcar c (org-babel-merge-p= arams (car c) params))) (if (org-babel-check-evaluate info) (progn (let* ((= c ...)) (setcar c (org-babel-process-params ...))) (let* ((params ...) (cac= he ...) (new-hash ...) (old-hash ...) (current-cache ...)) (cond (current-c= ache ...) (... ...)))))))(nil ("python" "from wxpy import *" ((:colname-nam= es) (:rowname-names) (:result-params "output" "replace") (:result-type . ou= tput) (:results . "output replace") (:exports . "") (:session . "yes") (:ev= al . "yes") (:noweb . "yes") (:mkdirp . "yes") (:cache . "yes") (:tangle . = "no") (:hlines . "no")) "" nil 2729 "# (ref:%s)") nil) apply((closure (*this* org-babel-confirm-evaluate-answer-no org-src-prese= rve-indentation org-src-lang-modes org-edit-src-content-indentation org-bab= el-library-of-babel t) (&optional arg info params) "Execute the current sou= rce code block.\nInsert the ..." (interactive) (let* ((org-babel-current-sr= c-block-location (or org-babel-current-src-block-location (nth 5 info) (org= -babel-where-is-src-block-head))) (info (if info (copy-tree info) (org-babe= l-get-src-block-info)))) (let* ((c (nthcdr 2 info))) (setcar c (org-babel-m= erge-params (car c) params))) (if (org-babel-check-evaluate info) (progn (l= et* ((c ...)) (setcar c (org-babel-process-params ...))) (let* ((params ...= ) (cache ...) (new-hash ...) (old-hash ...) (current-cache ...)) (cond (cur= rent-cache ...) (... ...))))))) (nil ("python" "from wxpy import *" ((:coln= ame-names) (:rowname-names) (:result-params "output" "replace") (:result-ty= pe . output) (:results . "output replace") (:exports . "") (:session . "yes= ") (:eval . "yes") (:noweb . "yes") (:mkdirp . "yes") (:cache . "yes") (:ta= ngle . "no") (:hlines . "no")) "" nil 2729 "# (ref:%s)") nil)) #f(advice-wrapper :after (closure (*this* org-babel-confirm-evaluate-answ= er-no org-src-preserve-indentation org-src-lang-modes org-edit-src-content-= indentation org-babel-library-of-babel t) (&optional arg info params) "Exec= ute the current source code block.\nInsert the results of execution into th= e buffer. Source code\nexecution and the collection and formatting of resu= lts can be\ncontrolled through a variety of header arguments.\n\nWith prefi= x argument ARG, force re-execution even if an existing\nresult cached in th= e buffer would otherwise have been returned.\n\nOptionally supply a value f= or INFO in the form returned by\n`org-babel-get-src-block-info'.\n\nOptiona= lly supply a value for PARAMS which will be merged with\nthe header argumen= ts specified at the front of the source code\nblock." (interactive) (let* (= (org-babel-current-src-block-location (or org-babel-current-src-block-locat= ion (nth 5 info) (org-babel-where-is-src-block-head))) (info (if info (copy= -tree info) (org-babel-get-src-block-info)))) (let* ((c (nthcdr 2 info))) (= setcar c (org-babel-merge-params (car c) params))) (if (org-babel-check-eva= luate info) (progn (let* ((c (nthcdr 2 info))) (setcar c (org-babel-process= -params (car c)))) (let* ((params (nth 2 info)) (cache (let ((c (cdr (assq = :cache params)))) (and (not arg) c (string=3D "yes" c)))) (new-hash (and ca= che (org-babel-sha1-hash info :eval))) (old-hash (and cache (org-babel-curr= ent-result-hash))) (current-cache (and new-hash (equal new-hash old-hash)))= ) (cond (current-cache (save-excursion (goto-char (org-babel-where-is-src-b= lock-result nil info)) (forward-line) (skip-chars-forward " \11") (let ((re= sult (org-babel-read-result))) (message (replace-regexp-in-string "%" "%%" = (format "%S" result))) result))) ((org-babel-confirm-evaluate info) (let* (= (lang (nth 0 info)) (result-params (cdr (assq :result-params params))) (bod= y (let ((coderef (nth 6 info)) (expand (if (org-babel-noweb-p params :eval)= (org-babel-expand-noweb-references info) (nth 1 info)))) (if (not coderef)= expand (replace-regexp-in-string (org-src-coderef-regexp coderef) "" expan= d nil nil 1)))) (dir (cdr (assq :dir params))) (mkdirp (cdr (assq :mkdirp p= arams))) (default-directory (cond ((not dir) default-directory) ((member mk= dirp '("no" "nil" nil)) (file-name-as-directory (expand-file-name dir))) (t= (let ((d (file-name-as-directory (expand-file-name dir)))) (make-directory= d 'parents) d)))) (cmd (intern (concat "org-babel-execute:" lang))) result= ) (if (fboundp cmd) nil (error "No org-babel-execute function for %s!" lang= )) (message "executing %s code block%s..." (capitalize lang) (let ((name (n= th 4 info))) (if name (format " (%s)" name) ""))) (if (member "none" result= -params) (progn (funcall cmd body params) (message "result silenced")) (set= q result (let ((r (funcall cmd body params))) (if (and (eq (cdr (assq :resu= lt-type params)) 'value) (or (member "vector" result-params) (member "table= " result-params)) (not (listp r))) (list (list r)) r))) (let ((file (and (m= ember "file" result-params) (cdr (assq :file params))))) (if file (progn (i= f (and result (not (or (member "link" result-params) (member "graphics" res= ult-params)))) (progn (let ((temp-file file) (temp-buffer (get-buffer-creat= e (generate-new-buffer-name " *temp file*")))) (unwind-protect (prog1 (save= -current-buffer (set-buffer temp-buffer) (insert (org-babel-format-result r= esult (cdr (assq :sep params))))) (save-current-buffer (set-buffer temp-buf= fer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer= ) (kill-buffer temp-buffer)))))) (setq result file))) (let ((post (cdr (ass= q :post params)))) (if post (progn (let ((*this* (if (not file) result (org= -babel-result-to-file file (let ((desc (assq :file-desc params))) (and desc= (or (cdr desc) result))))))) (setq result (org-babel-ref-resolve post)) (i= f file (progn (setq result-params (remove "file" result-params)))))))) (org= -babel-insert-result result result-params info new-hash lang))) (run-hooks = 'org-babel-after-execute-hook) result)))))))) my/org-redisplay-inline-image= s)(nil ("python" "from wxpy import *" ((:colname-names) (:rowname-names) (:= result-params "output" "replace") (:result-type . output) (:results . "outp= ut replace") (:exports . "") (:session . "yes") (:eval . "yes") (:noweb . "= yes") (:mkdirp . "yes") (:cache . "yes") (:tangle . "no") (:hlines . "no"))= "" nil 2729 "# (ref:%s)") nil) ob-async-org-babel-execute-src-block(#f(advice-wrapper :after (closure (*= this* org-babel-confirm-evaluate-answer-no org-src-preserve-indentation org= -src-lang-modes org-edit-src-content-indentation org-babel-library-of-babel= t) (&optional arg info params) "Execute the current source code block.\nIn= sert the ..." (interactive) (let* ((org-babel-current-src-block-location (o= r org-babel-current-src-block-location (nth 5 info) (org-babel-where-is-src= -block-head))) (info (if info (copy-tree info) (org-babel-get-src-block-inf= o)))) (let* ((c (nthcdr 2 info))) (setcar c (org-babel-merge-params (car c)= params))) (if (org-babel-check-evaluate info) (progn (let* (...) (setcar c= ...)) (let* (... ... ... ... ...) (cond ... ...)))))) my/org-redisplay-inl= ine-images) nil ("python" "from wxpy import *" ((:colname-names) (:rowname-= names) (:result-params "output" "replace") (:result-type . output) (:result= s . "output replace") (:exports . "") (:session . "yes") (:eval . "yes") (:= noweb . "yes") (:mkdirp . "yes") (:cache . "yes") (:tangle . "no") (:hlines= . "no")) "" nil 2729 "# (ref:%s)")) apply(ob-async-org-babel-execute-src-block #f(advice-wrapper :after (clos= ure (*this* org-babel-confirm-evaluate-answer-no org-src-preserve-indentati= on org-src-lang-modes org-edit-src-content-indentation org-babel-library-of= -babel t) (&optional arg info params) "Execute the current source code bloc= k.\nInsert the ..." (interactive) (let* ((org-babel-current-src-block-locat= ion (or org-babel-current-src-block-location (nth 5 info) (org-babel-where-= is-src-block-head))) (info (if info (copy-tree info) (org-babel-get-src-blo= ck-info)))) (let* ((c (nthcdr 2 info))) (setcar c (org-babel-merge-params (= car c) params))) (if (org-babel-check-evaluate info) (progn (let* (...) (se= tcar c ...)) (let* (... ... ... ... ...) (cond ... ...)))))) my/org-redispl= ay-inline-images) (nil ("python" "from wxpy import *" ((:colname-names) (:r= owname-names) (:result-params "output" "replace") (:result-type . output) (= :results . "output replace") (:exports . "") (:session . "yes") (:eval . "y= es") (:noweb . "yes") (:mkdirp . "yes") (:cache . "yes") (:tangle . "no") (= :hlines . "no")) "" nil 2729 "# (ref:%s)"))) org-babel-execute-src-block(nil ("python" "from wxpy import *" ((:colname= -names) (:rowname-names) (:result-params "output" "replace") (:result-type = . output) (:results . "output replace") (:exports . "") (:session . "yes") = (:eval . "yes") (:noweb . "yes") (:mkdirp . "yes") (:cache . "yes") (:tangl= e . "no") (:hlines . "no")) "" nil 2729 "# (ref:%s)")) (if org-babel-no-eval-on-ctrl-c-ctrl-c nil (org-babel-eval-wipe-error-buf= fer) (org-babel-execute-src-block current-prefix-arg (org-babel-get-src-blo= ck-info nil context))) (cond ((memq type '(src-block inline-src-block)) (if org-babel-no-eval-on= -ctrl-c-ctrl-c nil (org-babel-eval-wipe-error-buffer) (org-babel-execute-sr= c-block current-prefix-arg (org-babel-get-src-block-info nil context)))) ((= org-match-line "[ \11]*$") (or (run-hook-with-args-until-success 'org-ctrl-= c-ctrl-c-final-hook) (user-error (substitute-command-keys "`\\[org-ctrl-c-c= trl-c]' can do nothing useful...")))) ((memq type '(inline-babel-call babel= -call)) (let ((info (org-babel-lob-get-info context))) (if info (progn (org= -babel-execute-src-block nil info))))) ((eq type 'clock) (org-clock-update-= time-maybe)) ((eq type 'dynamic-block) (save-excursion (goto-char (org-elem= ent-property :post-affiliated context)) (org-update-dblock))) ((eq type 'fo= otnote-definition) (goto-char (org-element-property :post-affiliated contex= t)) (call-interactively 'org-footnote-action)) ((eq type 'footnote-referenc= e) (call-interactively #'org-footnote-action)) ((memq type '(inlinetask hea= dline)) (save-excursion (goto-char (org-element-property :begin context)) (= call-interactively #'org-set-tags-command))) ((eq type 'item) (let* ((box (= org-element-property :checkbox context)) (struct (org-element-property :str= ucture context)) (old-struct (copy-tree struct)) (parents (org-list-parents= -alist struct)) (prevs (org-list-prevs-alist struct)) (orderedp (org-not-ni= l (org-entry-get nil "ORDERED")))) (org-list-set-checkbox (org-element-prop= erty :begin context) struct (cond ((equal arg ...) "[-]") ((and ... ...) "[= ]") ((or ... ...) nil) ((eq box ...) "[ ]") (t "[X]"))) (org-list-struct-f= ix-ind struct parents 2) (org-list-struct-fix-item-end struct) (org-list-st= ruct-fix-bul struct prevs) (org-list-struct-fix-ind struct parents) (let ((= block-item (org-list-struct-fix-box struct parents prevs orderedp))) (if (a= nd box (equal struct old-struct)) (if (equal arg ...) (message "Checkboxes = already reset") (user-error "Cannot toggle this checkbox: %s" ...)) (org-li= st-struct-apply-struct struct old-struct) (org-update-checkbox-count-maybe)= ) (if block-item (progn (message "Checkboxes were removed due to empty box = at ..." ...)))))) ((eq type 'keyword) (let ((org-inhibit-startup-visibility= -stuff t) (org-startup-align-all-tables nil)) (if (boundp 'org-table-coordi= nate-overlays) (progn (mapc #'delete-overlay org-table-coordinate-overlays)= (setq org-table-coordinate-overlays nil))) (let* ((--invisible-types '...)= (--markers\? 'use-markers) (--data (mapcar ... ...))) (unwind-protect (pro= gn (org-mode-restart)) (save-excursion (save-restriction ... ... ...))))) (= message "Local setup has been refreshed")) ((eq type 'plain-list) (let* ((b= egin (org-element-property :contents-begin context)) (struct (org-element-p= roperty :structure context)) (old-struct (copy-tree struct)) (first-box (sa= ve-excursion (goto-char begin) (looking-at org-list-full-item-re) (match-st= ring-no-properties 3))) (new-box (cond (... "[-]") (... ...) (... "[ ]") (t= "[X]")))) (cond (arg (let (...) (while --dolist-tail-- ...))) ((and first-= box (eq ... begin)) (org-list-set-checkbox begin struct new-box))) (if (equ= al (org-list-write-struct struct (org-list-parents-alist struct) old-struct= ) old-struct) (progn (message "Cannot update this checkbox"))) (org-update-= checkbox-count-maybe))) ((memq type '(node-property property-drawer)) (call= -interactively #'org-property-action)) ((eq type 'radio-target) (call-inter= actively #'org-update-radio-target-regexp)) ((eq type 'statistics-cookie) (= call-interactively #'org-update-statistics-cookies)) ((memq type '(table-ro= w table-cell table)) (if (eq (org-element-property :type context) 'table\.e= l) (message "%s" (substitute-command-keys "\\Use `\\[org-edit= -special]' to ...")) (if (or (eq type 'table) (and (eq type ...) (=3D ... .= ..))) (save-excursion (if (org-at-TBLFM-p) (progn ... ...) (goto-char ...) = (org-call-with-arg ... ...) (orgtbl-send-table ...))) (org-table-maybe-eval= -formula) (cond (arg (call-interactively ...)) ((org-table-maybe-recalculat= e-line)) (t (org-table-align)))))) ((eq type 'timestamp) (funcall pcase-0))= ((eq type 'planning) (cond ((org-at-timestamp-p 'lax) (funcall pcase-0)) (= (run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-final-hook) nil) (t (u= ser-error (substitute-command-keys "`\\[org-ctrl-c-ctrl-c]' can do nothing = useful..."))))) ((null type) (cond ((org-at-heading-p) (call-interactively = #'org-set-tags-command)) ((run-hook-with-args-until-success 'org-ctrl-c-ctr= l-c-final-hook) (funcall pcase-1)) (t (funcall pcase-2)))) ((run-hook-with-= args-until-success 'org-ctrl-c-ctrl-c-final-hook) (funcall pcase-1)) (t (fu= ncall pcase-2))) (let* ((pcase-2 #'(lambda nil (user-error (substitute-command-keys "`\\[o= rg-ctrl-c-ctrl-c]' can do nothing useful here")))) (pcase-1 #'(lambda nil))= (pcase-0 #'(lambda nil (org-timestamp-change 0 'day)))) (cond ((memq type = '(src-block inline-src-block)) (if org-babel-no-eval-on-ctrl-c-ctrl-c nil (= org-babel-eval-wipe-error-buffer) (org-babel-execute-src-block current-pref= ix-arg (org-babel-get-src-block-info nil context)))) ((org-match-line "[ \1= 1]*$") (or (run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-final-hook)= (user-error (substitute-command-keys "`\\[org-ctrl-c-ctrl-c]' can do nothi= ng useful here")))) ((memq type '(inline-babel-call babel-call)) (let ((inf= o (org-babel-lob-get-info context))) (if info (progn (org-babel-execute-src= -block nil info))))) ((eq type 'clock) (org-clock-update-time-maybe)) ((eq = type 'dynamic-block) (save-excursion (goto-char (org-element-property :post= -affiliated context)) (org-update-dblock))) ((eq type 'footnote-definition)= (goto-char (org-element-property :post-affiliated context)) (call-interact= ively 'org-footnote-action)) ((eq type 'footnote-reference) (call-interacti= vely #'org-footnote-action)) ((memq type '(inlinetask headline)) (save-excu= rsion (goto-char (org-element-property :begin context)) (call-interactively= #'org-set-tags-command))) ((eq type 'item) (let* ((box (org-element-proper= ty :checkbox context)) (struct (org-element-property :structure context)) (= old-struct (copy-tree struct)) (parents (org-list-parents-alist struct)) (p= revs (org-list-prevs-alist struct)) (orderedp (org-not-nil (org-entry-get n= il "ORDERED")))) (org-list-set-checkbox (org-element-property :begin contex= t) struct (cond ((equal arg ...) "[-]") ((and ... ...) "[ ]") ((or ... ...)= nil) ((eq box ...) "[ ]") (t "[X]"))) (org-list-struct-fix-ind struct pare= nts 2) (org-list-struct-fix-item-end struct) (org-list-struct-fix-bul struc= t prevs) (org-list-struct-fix-ind struct parents) (let ((block-item (org-li= st-struct-fix-box struct parents prevs orderedp))) (if (and box (equal stru= ct old-struct)) (if (equal arg ...) (message "Checkboxes already reset") (u= ser-error "Cannot toggle this checkbox: %s" ...)) (org-list-struct-apply-st= ruct struct old-struct) (org-update-checkbox-count-maybe)) (if block-item (= progn (message "Checkboxes were removed due to empty box at line %..." ...)= ))))) ((eq type 'keyword) (let ((org-inhibit-startup-visibility-stuff t) (o= rg-startup-align-all-tables nil)) (if (boundp 'org-table-coordinate-overlay= s) (progn (mapc #'delete-overlay org-table-coordinate-overlays) (setq org-t= able-coordinate-overlays nil))) (let* ((--invisible-types '...) (--markers\= ? 'use-markers) (--data (mapcar ... ...))) (unwind-protect (progn (org-mode= -restart)) (save-excursion (save-restriction ... ... ...))))) (message "Loc= al setup has been refreshed")) ((eq type 'plain-list) (let* ((begin (org-el= ement-property :contents-begin context)) (struct (org-element-property :str= ucture context)) (old-struct (copy-tree struct)) (first-box (save-excursion= (goto-char begin) (looking-at org-list-full-item-re) (match-string-no-prop= erties 3))) (new-box (cond (... "[-]") (... ...) (... "[ ]") (t "[X]")))) (= cond (arg (let (...) (while --dolist-tail-- ...))) ((and first-box (eq ... = begin)) (org-list-set-checkbox begin struct new-box))) (if (equal (org-list= -write-struct struct (org-list-parents-alist struct) old-struct) old-struct= ) (progn (message "Cannot update this checkbox"))) (org-update-checkbox-cou= nt-maybe))) ((memq type '(node-property property-drawer)) (call-interactive= ly #'org-property-action)) ((eq type 'radio-target) (call-interactively #'o= rg-update-radio-target-regexp)) ((eq type 'statistics-cookie) (call-interac= tively #'org-update-statistics-cookies)) ((memq type '(table-row table-cell= table)) (if (eq (org-element-property :type context) 'table\.el) (message = "%s" (substitute-command-keys "\\Use `\\[org-edit-special]' t= o edit t...")) (if (or (eq type 'table) (and (eq type ...) (=3D ... ...))) = (save-excursion (if (org-at-TBLFM-p) (progn ... ...) (goto-char ...) (org-c= all-with-arg ... ...) (orgtbl-send-table ...))) (org-table-maybe-eval-formu= la) (cond (arg (call-interactively ...)) ((org-table-maybe-recalculate-line= )) (t (org-table-align)))))) ((eq type 'timestamp) (funcall pcase-0)) ((eq = type 'planning) (cond ((org-at-timestamp-p 'lax) (funcall pcase-0)) ((run-h= ook-with-args-until-success 'org-ctrl-c-ctrl-c-final-hook) nil) (t (user-er= ror (substitute-command-keys "`\\[org-ctrl-c-ctrl-c]' can do nothing useful= here"))))) ((null type) (cond ((org-at-heading-p) (call-interactively #'or= g-set-tags-command)) ((run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-= final-hook) (funcall pcase-1)) (t (funcall pcase-2)))) ((run-hook-with-args= -until-success 'org-ctrl-c-ctrl-c-final-hook) (funcall pcase-1)) (t (funcal= l pcase-2)))) (let* ((context (org-element-lineage (org-element-context) '(babel-call c= lock dynamic-block footnote-definition footnote-reference inline-babel-call= inline-src-block inlinetask item keyword node-property paragraph plain-lis= t planning property-drawer radio-target src-block statistics-cookie table t= able-cell table-row timestamp) t)) (type (org-element-type context))) (if (= eq type 'paragraph) (progn (let ((parent (org-element-property :parent cont= ext))) (if (and (eq (org-element-type parent) 'item) (=3D (line-beginning-p= osition) (org-element-property :begin parent))) (progn (setq context parent= ) (setq type 'item)))))) (let* ((pcase-2 #'(lambda nil (user-error (substit= ute-command-keys "`\\[org-ctrl-c-ctrl-c]' can do nothing useful here")))) (= pcase-1 #'(lambda nil)) (pcase-0 #'(lambda nil (org-timestamp-change 0 'day= )))) (cond ((memq type '(src-block inline-src-block)) (if org-babel-no-eval= -on-ctrl-c-ctrl-c nil (org-babel-eval-wipe-error-buffer) (org-babel-execute= -src-block current-prefix-arg (org-babel-get-src-block-info nil context))))= ((org-match-line "[ \11]*$") (or (run-hook-with-args-until-success 'org-ct= rl-c-ctrl-c-final-hook) (user-error (substitute-command-keys "`\\[org-ctrl-= c-ctrl-c]' can do nothing useful here")))) ((memq type '(inline-babel-call = babel-call)) (let ((info (org-babel-lob-get-info context))) (if info (progn= (org-babel-execute-src-block nil info))))) ((eq type 'clock) (org-clock-up= date-time-maybe)) ((eq type 'dynamic-block) (save-excursion (goto-char (org= -element-property :post-affiliated context)) (org-update-dblock))) ((eq typ= e 'footnote-definition) (goto-char (org-element-property :post-affiliated c= ontext)) (call-interactively 'org-footnote-action)) ((eq type 'footnote-ref= erence) (call-interactively #'org-footnote-action)) ((memq type '(inlinetas= k headline)) (save-excursion (goto-char (org-element-property :begin contex= t)) (call-interactively #'org-set-tags-command))) ((eq type 'item) (let* ((= box (org-element-property :checkbox context)) (struct (org-element-property= :structure context)) (old-struct (copy-tree struct)) (parents (org-list-pa= rents-alist struct)) (prevs (org-list-prevs-alist struct)) (orderedp (org-n= ot-nil ...))) (org-list-set-checkbox (org-element-property :begin context) = struct (cond (... "[-]") (... "[ ]") (... nil) (... "[ ]") (t "[X]"))) (org= -list-struct-fix-ind struct parents 2) (org-list-struct-fix-item-end struct= ) (org-list-struct-fix-bul struct prevs) (org-list-struct-fix-ind struct pa= rents) (let ((block-item ...)) (if (and box ...) (if ... ... ...) (org-list= -struct-apply-struct struct old-struct) (org-update-checkbox-count-maybe)) = (if block-item (progn ...))))) ((eq type 'keyword) (let ((org-inhibit-start= up-visibility-stuff t) (org-startup-align-all-tables nil)) (if (boundp 'org= -table-coordinate-overlays) (progn (mapc ... org-table-coordinate-overlays)= (setq org-table-coordinate-overlays nil))) (let* ((--invisible-types ...) = (--markers\? ...) (--data ...)) (unwind-protect (progn ...) (save-excursion= ...)))) (message "Local setup has been refreshed")) ((eq type 'plain-list)= (let* ((begin (org-element-property :contents-begin context)) (struct (org= -element-property :structure context)) (old-struct (copy-tree struct)) (fir= st-box (save-excursion ... ... ...)) (new-box (cond ... ... ... ...))) (con= d (arg (let ... ...)) ((and first-box ...) (org-list-set-checkbox begin str= uct new-box))) (if (equal (org-list-write-struct struct ... old-struct) old= -struct) (progn (message "Cannot update this checkbox"))) (org-update-check= box-count-maybe))) ((memq type '(node-property property-drawer)) (call-inte= ractively #'org-property-action)) ((eq type 'radio-target) (call-interactiv= ely #'org-update-radio-target-regexp)) ((eq type 'statistics-cookie) (call-= interactively #'org-update-statistics-cookies)) ((memq type '(table-row tab= le-cell table)) (if (eq (org-element-property :type context) 'table\.el) (m= essage "%s" (substitute-command-keys "\\Use `\\[org-edit-spec= ial]' to edit t...")) (if (or (eq type ...) (and ... ...)) (save-excursion = (if ... ... ... ... ...)) (org-table-maybe-eval-formula) (cond (arg ...) (.= ..) (t ...))))) ((eq type 'timestamp) (funcall pcase-0)) ((eq type 'plannin= g) (cond ((org-at-timestamp-p 'lax) (funcall pcase-0)) ((run-hook-with-args= -until-success 'org-ctrl-c-ctrl-c-final-hook) nil) (t (user-error (substitu= te-command-keys "`\\[org-ctrl-c-ctrl-c]' can do nothing useful here"))))) (= (null type) (cond ((org-at-heading-p) (call-interactively #'org-set-tags-co= mmand)) ((run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-final-hook) (= funcall pcase-1)) (t (funcall pcase-2)))) ((run-hook-with-args-until-succes= s 'org-ctrl-c-ctrl-c-final-hook) (funcall pcase-1)) (t (funcall pcase-2))))) (cond ((or (and (boundp 'org-clock-overlays) org-clock-overlays) org-occu= r-highlights) (if (boundp 'org-clock-overlays) (progn (org-clock-remove-ove= rlays))) (org-remove-occur-highlights) (message "Temporary highlights/overl= ays removed from current...")) ((and (local-variable-p 'org-finish-function= ) (fboundp org-finish-function)) (funcall org-finish-function)) ((org-babel= -hash-at-point)) ((run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-hook= )) (t (let* ((context (org-element-lineage (org-element-context) '(babel-ca= ll clock dynamic-block footnote-definition footnote-reference inline-babel-= call inline-src-block inlinetask item keyword node-property paragraph plain= -list planning property-drawer radio-target src-block statistics-cookie tab= le table-cell table-row timestamp) t)) (type (org-element-type context))) (= if (eq type 'paragraph) (progn (let ((parent ...)) (if (and ... ...) (progn= ... ...))))) (let* ((pcase-2 #'(lambda nil ...)) (pcase-1 #'(lambda nil)) = (pcase-0 #'(lambda nil ...))) (cond ((memq type '...) (if org-babel-no-eval= -on-ctrl-c-ctrl-c nil (org-babel-eval-wipe-error-buffer) (org-babel-execute= -src-block current-prefix-arg ...))) ((org-match-line "[ \11]*$") (or (run-= hook-with-args-until-success ...) (user-error ...))) ((memq type '...) (let= (...) (if info ...))) ((eq type 'clock) (org-clock-update-time-maybe)) ((e= q type 'dynamic-block) (save-excursion (goto-char ...) (org-update-dblock))= ) ((eq type 'footnote-definition) (goto-char (org-element-property :post-af= filiated context)) (call-interactively 'org-footnote-action)) ((eq type 'fo= otnote-reference) (call-interactively #'org-footnote-action)) ((memq type '= ...) (save-excursion (goto-char ...) (call-interactively ...))) ((eq type '= item) (let* (... ... ... ... ... ...) (org-list-set-checkbox ... struct ...= ) (org-list-struct-fix-ind struct parents 2) (org-list-struct-fix-item-end = struct) (org-list-struct-fix-bul struct prevs) (org-list-struct-fix-ind str= uct parents) (let ... ... ...))) ((eq type 'keyword) (let (... ...) (if ...= ...) (let* ... ...)) (message "Local setup has been refreshed")) ((eq type= 'plain-list) (let* (... ... ... ... ...) (cond ... ...) (if ... ...) (org-= update-checkbox-count-maybe))) ((memq type '...) (call-interactively #'org-= property-action)) ((eq type 'radio-target) (call-interactively #'org-update= -radio-target-regexp)) ((eq type 'statistics-cookie) (call-interactively #'= org-update-statistics-cookies)) ((memq type '...) (if (eq ... ...) (message= "%s" ...) (if ... ... ... ...))) ((eq type 'timestamp) (funcall pcase-0)) = ((eq type 'planning) (cond (... ...) (... nil) (t ...))) ((null type) (cond= (... ...) (... ...) (t ...))) ((run-hook-with-args-until-success 'org-ctrl= -c-ctrl-c-final-hook) (funcall pcase-1)) (t (funcall pcase-2))))))) org-ctrl-c-ctrl-c(nil) funcall-interactively(org-ctrl-c-ctrl-c nil) call-interactively(org-ctrl-c-ctrl-c nil nil) command-execute(org-ctrl-c-ctrl-c) #+end_example --=20 [ stardiviner ] I try to make every word tell the meaning what I want to express. Blog: https://stardiviner.github.io/ IRC(freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 =20=20=20=20=20=20