unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Barton, Mark" <Mark.Barton@disney.com>
To: Augusto Stoffel <arstoffel@gmail.com>
Cc: "50514@debbugs.gnu.org" <50514@debbugs.gnu.org>,
	Lars Ingebrigtsen <larsi@gnus.org>
Subject: bug#50514: 28.0.50; org inline call to python src block req C-g to break
Date: Sun, 12 Sep 2021 20:04:51 +0000	[thread overview]
Message-ID: <73383502-159B-4BD9-8836-6C8A534A7063@disney.com> (raw)
In-Reply-To: <21C76818-63E5-4DC9-A60D-2BEF33813A18@disney.com>

[-- Attachment #1: Type: text/plain, Size: 4516 bytes --]

If I create the comint buffer myself and then make that inline python function call in the org document, then it works. Below is the lisp I evaluated to make the comint buffer myself based on what I saw in the Backtraces.
(python-shell-make-comint "python" "python-chain" nil)

Here is the Backtrace where I tried to compare what happens when I need to press C-g.
#+begin_example C-c C-c needs to make comint shell
Debugger entered--returning value: 0
  alist-get(yas--post-command-handler ((python-shell-font-lock-post-command-hook . 0) (yas--post-command-handler . 0) (company-post-command . 0) (company-post-command . 0) (yas--post-command-handler . 0) (vertico--exhibit . -90) (consult--preview-post-command . 0) (vertico--exhibit . -90) (eldoc-schedule-timer . 0) (eldoc-schedule-timer . 0) (eldoc-schedule-timer . 0) (eldoc-schedule-timer . 0) (eldoc-schedule-timer . 0) (python-shell-font-lock-post-command-hook . 0) (jit-lock--antiblink-post-command . 0) (company-post-command . 0) (company-post-command . 0) (yas--post-command-handler . 0) (yas--post-command-handler . 0) (company-post-command . 0) (yas--post-command-handler . 0) (vertico--exhibit . -90) (vertico--exhibit . -90) (consult--preview-post-command . 0) (vertico--exhibit . -90) (vertico--exhibit . -90) (consult--preview-post-command . 0) (vertico--exhibit . -90) (vertico--exhibit . -90) (company-post-command . 0) (yas--post-command-handler . 0) (hl-line-highlight . 0) (magit-section-update-highlight . 90) (vertico--exhibit . -90) (vertico--exhibit . -90) (company-post-command . 0) (yas--post-command-handler . 0) (magit-section-update-highlight . 90) (consult--preview-post-command . 0) (vertico--exhibit . -90) (company-post-command . 0) (yas--post-command-handler . 0) (magit-section-update-highlight . 90) (company-post-command . 0) (yas--post-command-handler . 0) (magit-section-update-highlight . 90) (vertico--exhibit . -90) (consult--preview-post-command . 0) (vertico--exhibit . -90) (eldoc-schedule-timer . 0) ...) 0 nil eq)
,* #f(compiled-function (f1 f2) #<bytecode -0x6149ed0fee718f2>)(yas--post-command-handler python-shell-font-lock-post-command-hook)
,* add-hook(post-command-hook python-shell-font-lock-post-command-hook nil local)
  python-shell-font-lock-turn-on()
  inferior-python-mode()
  python-shell-make-comint("python" "python-chain" nil)
  run-python("python")
  org-babel-python-initiate-session-by-key("python-chain")
  org-babel-python-initiate-session("python-chain")
  org-babel-execute:python("print(\"testing12\", end=\"\")" ((:colname-names) (:rowname-names) (:result-params "replace" "output") (:result-type . output) (:results . "replace output") (:exports . "results") (:tangle . "no") (:hlines . "no") (:noweb . "no") (:cache . "no") (:session . "python-chain")))
  org-babel-execute-src-block(nil ("python" "print(\"testing12\", end=\"\")" ((:results . "output replace") (:exports . "results") (:session . "python-chain") (:cache . "no") (:noweb . "no") (:hlines . "no") (:tangle . "no")) nil nil 360 "(ref:%s)"))
  org-ctrl-c-ctrl-c(nil)
  funcall-interactively(org-ctrl-c-ctrl-c nil)
  command-execute(org-ctrl-c-ctrl-c)

#+end_example

#+begin_example comint shell already exists
Debugger entered--entering a function:
,* comint-snapshot-last-prompt()
,* comint-send-string(#<process python-chain> "__PYTHON_EL_eval(\"try:\\n    with open('/var/folder...")
  python-shell-send-string("try:\n    with open('/var/folders/kf/zdpzgs9d30b3jj...")
  org-babel-python--send-string("*python-chain*" "with open('/var/folders/kf/zdpzgs9d30b3jj4bdkdjf1v...")
  org-babel-python-evaluate-session("*python-chain*" "print(\"testing12\", end=\"\")" output ("replace" "output"))
  org-babel-python-evaluate("*python-chain*" "print(\"testing12\", end=\"\")" output ("replace" "output") nil)
  org-babel-execute:python("print(\"testing12\", end=\"\")" ((:colname-names) (:rowname-names) (:result-params "replace" "output") (:result-type . output) (:results . "replace output") (:exports . "results") (:tangle . "no") (:hlines . "no") (:noweb . "no") (:cache . "no") (:session . "python-chain")))
  org-babel-execute-src-block(nil ("python" "print(\"testing12\", end=\"\")" ((:results . "output replace") (:exports . "results") (:session . "python-chain") (:cache . "no") (:noweb . "no") (:hlines . "no") (:tangle . "no")) nil nil 360 "(ref:%s)"))
  org-ctrl-c-ctrl-c(nil)
  funcall-interactively(org-ctrl-c-ctrl-c nil)
  command-execute(org-ctrl-c-ctrl-c)

#+end_example



[-- Attachment #2: Type: text/html, Size: 6681 bytes --]

  reply	other threads:[~2021-09-12 20:04 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-10 23:06 bug#50514: 28.0.50; org inline call to python src block req C-g to break Barton, Mark
2021-09-11 13:04 ` Lars Ingebrigtsen
2021-09-11 13:26 ` Augusto Stoffel
2021-09-12  6:22   ` Barton, Mark
2021-09-12  6:51     ` Augusto Stoffel
2021-09-12  8:27       ` Barton, Mark
2021-09-12  9:15         ` Augusto Stoffel
2021-09-12 17:00           ` Barton, Mark
2021-09-12 20:04             ` Barton, Mark [this message]
2021-09-14  6:42               ` Augusto Stoffel
2021-09-14 17:54                 ` Barton, Mark
2021-09-14 18:29                   ` Augusto Stoffel
2021-09-14 19:25                     ` Barton, Mark
2021-09-14 19:31                       ` Augusto Stoffel
2021-09-14 22:20                         ` Barton, Mark
2021-09-15  6:28                           ` Augusto Stoffel
2021-09-14 19:36                       ` Augusto Stoffel
2021-09-15  8:02                         ` Lars Ingebrigtsen
2022-08-25 15:12                           ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=73383502-159B-4BD9-8836-6C8A534A7063@disney.com \
    --to=mark.barton@disney.com \
    --cc=50514@debbugs.gnu.org \
    --cc=arstoffel@gmail.com \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).