emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Richard H. Stanton" <rhstanton@berkeley.edu>
To: Ihor Radchenko <yantar92@gmail.com>
Cc: John Kitchin <jkitchin@andrew.cmu.edu>, orgmode <emacs-orgmode@gnu.org>
Subject: Re: Trouble producing nicely aligned org tables from emacs-jupyter code blocks using latest org version
Date: Thu, 19 May 2022 12:22:20 -0700	[thread overview]
Message-ID: <C5866F9E-D9CF-4126-86AE-46C4565895DD@berkeley.edu> (raw)
In-Reply-To: <B5BC691B-BD74-4211-929D-1ED9EB3CC179@berkeley.edu>

Here’s a simple init.el that shows the problem (most of it is just boilerplate code to use straight.el to manage packages, and you may need to edit the python executable path).

-------------------

;;; straight
(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 5))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

;;  Replace use-package with straight-use-package
(straight-use-package 'use-package)
(setq straight-use-package-by-default t)
(setq use-package-verbose t)
(straight-use-package 'use-package-ensure-system-package)


;;; Which org-mode to use?

; (straight-use-package '(org :type git :repo "https://code.orgmode.org/bzg/org-mode.git"))
(straight-use-package '(org :type built-in))

;;; Find python executable
(setq exec-path (append '("/Users/stanton/anaconda3/bin") exec-path))

(use-package org
  :after (jupyter)
  :straight t
  :config
  (org-babel-do-load-languages
   'org-babel-load-languages
   '((python . t)
     (jupyter . t))))

(use-package jupyter)

;; Make cursor more visible when you move a long distance
(use-package beacon :config (beacon-mode 1))

——————————

Now execute the following source block and you’ll see the misaligned table.

#+begin_src jupyter-python :async yes :session py
[['aaaaaaa', 'a'], None, ['b', 'b']]
#+end_src

Commenting out the last line of init.el, thus not loading the beacon package, gets things to work OK. But so does changing which version of org mode is loaded by commenting out one of the lines and uncommenting the other, so this is not only about the beacon package.

Best,

Richard





> On May 19, 2022, at 11:16 AM, Richard H. Stanton <rhstanton@berkeley.edu> wrote:
> 
> After a lot of bisecting my init.el to create the simplest possible example that shows the problem, I found that removing the package beacon makes everything work OK, both in sync and async mode.
> 
> 
> 
>> On May 19, 2022, at 6:37 AM, Ihor Radchenko <yantar92@gmail.com> wrote:
>> 
>> Richard Stanton <rhstanton@berkeley.edu> writes:
>> 
>>> A bit more experimenting shows that asynchronous execution is actually a part of my original problem. By default, I have jupyter-python blocks running asynchronously. In that case, the tables don’t format quite right, as I noted. But if I add the header ":async nil", the table comes out fine. Table formatting is OK in python blocks with or without asynchronous execution. 
>> 
>> Can you also see the problem without using jupyter-python?
>> A detailed recipe starting from emacs -Q would help (see
>> https://orgmode.org/manual/Feedback.html)
>> 
>> Best,
>> Ihor
> 



  reply	other threads:[~2022-05-19 19:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-18 20:05 Trouble producing nicely aligned org tables from emacs-jupyter code blocks using latest org version Richard Stanton
2022-05-18 20:16 ` John Kitchin
2022-05-18 20:56   ` Richard Stanton
2022-05-18 21:00     ` John Kitchin
2022-05-18 21:12       ` Richard Stanton
2022-05-19 13:37         ` Ihor Radchenko
2022-05-19 18:16           ` Richard H. Stanton
2022-05-19 19:22             ` Richard H. Stanton [this message]
2022-05-20  8:57               ` Ihor Radchenko
2022-05-22 13:05                 ` Richard Stanton
2022-05-26  4:27                   ` Ihor Radchenko
2022-05-26  8:42                     ` Richard Stanton
2022-05-19 23:22             ` Mark Barton

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.orgmode.org/

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

  git send-email \
    --in-reply-to=C5866F9E-D9CF-4126-86AE-46C4565895DD@berkeley.edu \
    --to=rhstanton@berkeley.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=jkitchin@andrew.cmu.edu \
    --cc=yantar92@gmail.com \
    /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/org-mode.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).