Re: Bug: error in org-table-justify-field-maybe - in conjunction with org-sbe [9.3.6 (9.3.6-elpa @ ~/.emacs.d/elpa/org-9.3.6/)]

2020-09-05 Thread Bastien
Hi Lester,

Lester Longley  writes:

> I am encountering an error when using this .org code:

Thanks a lot for the detailed report.

I prevented the error from occurring in maint (114d50982).

Best,

-- 
 Bastien



Bug: error in org-table-justify-field-maybe - in conjunction with org-sbe [9.3.6 (9.3.6-elpa @ ~/.emacs.d/elpa/org-9.3.6/)]

2020-02-29 Thread Lester Longley
Hello,

I am encountering an error when using this .org code:

--
| abc | hello |
#+TBLFM: :: $2 = '(org-sbe hello_world)

#+NAME: hello_world
#+BEGIN_SRC shell -n
  echo "hello"
#+END_SRC
--

The error can be reproduced as follows:

(1) setup: (org-babel-do-load-languages 'org-babel-load-languages
'((emacs-lisp . t) (shell . t)))
(2) with position at beg of table - C-c C-c - succeeds
(3) with position (still) at beg of table - C-c C-c (again) - fails, with
Backtrace as attached.

The error is from this line in function "org-table-justify-field-maybe()"
of "org-table.el":

 ((<= (org-string-width new) width)

... where "width" is nil.

It seems to be caused by a wrong state of variable
"org-table-last-column-widths".

After the 1st C-c C-c, org-table-last-column-widths contains: "(3 5)" -
correct
After the 2nd C-c C-c, org-table-last-column-widths contains: "(5)" - wrong

The latter value results, I think, from a prior invocation of
"org-table-import" overwriting "org-table-last-column-widths".

(There are other ways to trigger the error; this is the simplest recipe I
have found.)

Thanks for your help.

Regards,
Lester

Emacs  : GNU Emacs 25.1.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
 of 2017-09-15, modified by Debian
Package: Org mode version 9.3.6 (9.3.6-elpa @ ~/.emacs.d/elpa/org-9.3.6/)

current state:
==
(setq
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand)
 org-speed-command-hook '(org-speed-command-activate
org-babel-speed-command-activate)
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-confirm-shell-link-function 'yes-or-no-p
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-mode-hook '((closure
 (org--rds reftex-docstruct-symbol org-element-greater-elements
  org-clock-history org-agenda-current-date org-with-time
  org-defdecode org-def org-read-date-inactive org-ans2 org-ans1
  org-columns-current-fmt-compiled org-clock-current-task
  org-clock-effort org-agenda-skip-function
  org-agenda-skip-comment-trees org-agenda-archives-mode
  org-end-time-was-given org-time-was-given org-log-note-extra
  org-log-note-purpose org-log-post-message
  org-last-inserted-timestamp org-last-changed-timestamp
  org-entry-property-inherited-from org-blocked-by-checkboxes
  org-state org-agenda-headline-snapshot-before-repeat
  org-capture-last-stored-marker org-agenda-start-on-weekday
  org-agenda-buffer-tmp-name org-priority-regexp buffer-face-mode-face
  org-tbl-menu org-org-menu org-struct-menu org-entities
  org-last-state org-id-track-globally org-clock-start-time
  texmathp-why remember-data-file
  org-agenda-tags-todo-honor-ignore-options iswitchb-temp-buflist
  calc-embedded-open-mode calc-embedded-open-formula
  calc-embedded-close-formula align-mode-rules-list org-emphasis-alist
  org-emphasis-regexp-components org-export-registered-backends
  org-modules org-babel-load-languages
  org-indent-indentation-per-level org-element-paragraph-separate
  ffap-url-regexp org-inlinetask-min-level t)
 nil
 (add-hook (quote change-major-mode-hook) (quote org-show-all)
  (quote append) (quote local))
 )
(closure
 (org-src-window-setup *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)
 nil
 (add-hook (quote change-major-mode-hook)
  (quote org-babel-show-result-all) (quote append) (quote local))
 )
org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-bibtex-headline-format-function '(closure
  (org-id-locations
org-agenda-search-view-always-boolean
org-agenda-overriding-header t)
  (entry) (cdr (assq :title entry)))
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees
org-cycle-show-empty-lines
 org-optimize-window-after-visibility-change)
 org-link-shell-confirm-function 'yes-or-no-p
 org-link-elisp-confirm-function 'yes-or-no-p
 org-table-automatic-realign nil
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-link-parameters '(("attachment" :follow org-attach-open-link :export
org-attach-export-link :complete org-attach-complete-link)
  ("id" :follow org-id-open)
  ("eww" :follow eww :store org-eww-store-link)
  ("rmail" :follow org-rmail-open :store org-rmail-store-link)
  ("mhe" :follow org-mhe-open :store org-mhe-store-link)
  ("irc" :follow org-irc-visit :store org-irc-store-link :export
org-irc-export)
  ("info" :follow org-info-open :export org-info-export :store
org-info-store-link)
  ("gnus" :follow org-gnus-open :store org-gnus-store-link)
  ("docview"