* Bug: ob-shell cannot forward empty blocks to stdin [9.3.1 (release_9.3.1-101-gc9ee3d @ /home/lockywolf/OfficialRepos/org-mode/lisp/)]
@ 2020-02-25 1:28 Vladimir Nikishkin
2020-09-05 13:55 ` Bastien
0 siblings, 1 reply; 3+ messages in thread
From: Vladimir Nikishkin @ 2020-02-25 1:28 UTC (permalink / raw)
To: emacs-orgmode
The MWE would be the following:
#+name: empty
#+begin_quote
#+end_quote
#+begin_src shell :stdin empty
#+end_src
Now if you try to execute the second block, you will get a lisp error.
"Wrong argument integer-or-marker-p"
Remember to cover the basics, that is, what you expected to happen and
what in fact did happen. You don't know how to make a good report? See
https://orgmode.org/manual/Feedback.html#Feedback
Your bug report will be posted to the Org mailing list.
------------------------------------------------------------------------
Emacs : GNU Emacs 26.3 (build 1, x86_64-slackware-linux-gnu, GTK+ Version 3.24.12)
of 2019-11-26
Package: Org mode version 9.3.1 (release_9.3.1-101-gc9ee3d @ /home/lockywolf/OfficialRepos/org-mode/lisp/)
current state:
==============
(setq
org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer)
org-link-shell-confirm-function 'yes-or-no-p
org-babel-after-execute-hook '((lambda nil
(if org-inline-image-overlays
(progn (org-redisplay-inline-images)))
)
)
org-metadown-hook '(org-babel-pop-to-session-maybe)
org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
org-html-format-inlinetask-function 'org-html-format-inlinetask-default-function
org-pretty-entities t
org-odt-format-headline-function 'org-odt-format-headline-default-function
org-agenda-files '("~/DevLinux/chibi-sicp/index.org" "~/Personal_Planner/Planner.org")
org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
org-modules '(org-habits ol-w3m ol-bbdb ol-bibtex ol-docview ol-gnus ol-info ol-irc ol-mhe
ol-rmail ol-eww)
org-plantuml-jar-path "/usr/local/bin/plantuml.jar"
org-mode-hook '(#[0 "\301\211\207" [imenu-create-index-function org-imenu-get-tree] 2]
turn-on-org-cdlatex org-tempo-setup
#[0 "\300\301\302\303\304$\207"
[add-hook change-major-mode-hook org-show-all append local] 5]
#[0 "\300\301\302\303\304$\207"
[add-hook change-major-mode-hook org-babel-show-result-all append local] 5]
org-babel-result-hide-spec org-babel-hide-all-hashes
(lambda nil
(if
(member #1=(quote ("p" . "src plantuml :exports both :file "))
org-structure-template-alist)
org-structure-template-alist
(setq org-structure-template-alist (cons #1# org-structure-template-alist))
)
(if
(member #2=(quote ("SO" . "src scheme :exports both :results output"))
org-structure-template-alist)
org-structure-template-alist
(setq org-structure-template-alist (cons #2# org-structure-template-alist))
)
(if
(member #3=(quote ("SV" . "src scheme :exports both :results value"))
org-structure-template-alist)
org-structure-template-alist
(setq org-structure-template-alist (cons #3# org-structure-template-alist))
)
(if
(member #4=(quote ("SE" . "src scheme :exports code"))
org-structure-template-alist)
org-structure-template-alist
(setq org-structure-template-alist (cons #4# org-structure-template-alist))
)
(if
(member #5=(quote ("EL" . "src elisp :exports both :results output"))
org-structure-template-alist)
org-structure-template-alist
(setq org-structure-template-alist (cons #5# org-structure-template-alist))
)
)
(lambda nil (modify-syntax-entry 60 ".") (modify-syntax-entry 62 "."))
(lambda nil (imenu-add-to-menubar "Imenu")) org-eldoc-load)
org-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
org-archive-hook '(org-attach-archive-delete-maybe)
org-confirm-elisp-link-function 'yes-or-no-p
org-agenda-before-write-hook '(org-agenda-add-entry-text)
org-metaup-hook '(org-babel-load-in-session-maybe)
org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn ENTRY)"]
org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"]
org-babel-pre-tangle-hook '(save-buffer)
org-latex-compiler "lualatex"
org-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand)
org-babel-load-languages '((plantuml . t) (C . t) (scheme . t) (latex . t))
org-log-done 'time
org-startup-align-all-tables t
org-ascii-format-drawer-function #[771 "\207" [] 4 "\n\n(fn NAME CONTENTS WIDTH)"]
org-src-lang-modes '(("arduino" . arduino) ("redis" . redis) ("php" . php) ("C" . c)
("C++" . c++) ("asymptote" . asy) ("bash" . sh) ("beamer" . latex)
("calc" . fundamental) ("cpp" . c++) ("ditaa" . artist)
("dot" . fundamental) ("elisp" . emacs-lisp) ("ocaml" . tuareg)
("screen" . shell-script) ("shell" . sh) ("sqlite" . sql))
org-catch-invisible-edits t
org-occur-hook '(org-first-headline-recenter)
org-edit-src-auto-save-idle-delay 15
org-agenda-include-diary t
org-structure-template-alist '(("EL" . "src elisp :exports both :results output")
("SE" . "src scheme :exports code")
("SV" . "src scheme :exports both :results value")
("SO" . "src scheme :exports both :results output")
("p" . "src plantuml :exports both :file ")
("a" . "export ascii") ("c" . "center") ("C" . "comment")
("e" . "example") ("E" . "export") ("h" . "export html")
("l" . "export latex") ("q" . "quote") ("s" . "src")
("v" . "verse"))
org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-show-empty-lines
org-optimize-window-after-visibility-change)
org-edit-src-turn-on-auto-save t
org-speed-command-hook '(org-speed-command-activate org-babel-speed-command-activate)
org-hierarchical-todo-statistics nil
org-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function
org-babel-tangle-lang-exts '(("latex" . "tex") ("D" . "d") ("C++" . "cpp")
("emacs-lisp" . "el") ("elisp" . "el"))
org-format-latex-options '(:foreground default :background default :scale 2.0
:html-foreground "Black" :html-background "Transparent"
:html-scale 1.0 :matchers ("begin" "$1" "$" "$$" "\\(" "\\["))
org-confirm-shell-link-function 'yes-or-no-p
org-link-parameters '(("attachment" :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" :follow org-docview-open :export org-docview-export :store
org-docview-store-link)
("bibtex" :follow org-bibtex-open :store org-bibtex-store-link)
("bbdb" :follow org-bbdb-open :export org-bbdb-export :complete
org-bbdb-complete-link :store org-bbdb-store-link)
("w3m" :store org-w3m-store-link) ("file+sys") ("file+emacs")
("shell" :follow org-link--open-shell)
(#1="news" :follow
#[257 #2="\301\300\302Q!\207" [#1# browse-url #4=":"] 5 #5=
"\n\n(fn URL)"]
)
(#3="mailto" :follow #[257 #2# [#3# browse-url #4#] 5 #5#])
(#6="https" :follow #[257 #2# [#6# browse-url #4#] 5 #5#])
(#7="http" :follow #[257 #2# [#7# browse-url #4#] 5 #5#])
(#8="ftp" :follow #[257 #2# [#8# browse-url #4#] 5 #5#])
("help" :follow org-link--open-help)
("file" :complete org-link-complete-file)
("elisp" :follow org-link--open-elisp)
("doi" :follow org-link--open-doi))
org-latex-format-headline-function 'org-latex-format-headline-default-function
org-agenda-start-with-follow-mode t
org-link-elisp-confirm-function 'yes-or-no-p
org-org-src-mode-hook '((lambda nil (modify-syntax-entry 60 ".")
(modify-syntax-entry 62 "."))
)
org-latex-format-inlinetask-function 'org-latex-format-inlinetask-default-function
org-tab-before-tab-emulation-hook '(org-tempo-complete-tag)
org-html-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
org-image-actual-width nil
org-html-use-infojs t
org-html-format-headline-function 'org-html-format-headline-default-function
org-confirm-babel-evaluate 'my-org-confirm-babel-evaluate
org-use-speed-commands t
org-latex-bib-compiler "biber"
org-default-notes-file "~/org/notes.org"
)
--
--
Vladimir Nikishkin (MiEr, lockywolf)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Bug: ob-shell cannot forward empty blocks to stdin [9.3.1 (release_9.3.1-101-gc9ee3d @ /home/lockywolf/OfficialRepos/org-mode/lisp/)]
2020-02-25 1:28 Bug: ob-shell cannot forward empty blocks to stdin [9.3.1 (release_9.3.1-101-gc9ee3d @ /home/lockywolf/OfficialRepos/org-mode/lisp/)] Vladimir Nikishkin
@ 2020-09-05 13:55 ` Bastien
2020-09-10 7:10 ` Vladimir Nikishkin
0 siblings, 1 reply; 3+ messages in thread
From: Bastien @ 2020-09-05 13:55 UTC (permalink / raw)
To: Vladimir Nikishkin; +Cc: emacs-orgmode
Hi Vladimir,
Vladimir Nikishkin <lockywolf@gmail.com> writes:
> The MWE would be the following:
>
> #+name: empty
> #+begin_quote
>
> #+end_quote
>
> #+begin_src shell :stdin empty
> #+end_src
>
> Now if you try to execute the second block, you will get a lisp error.
> "Wrong argument integer-or-marker-p"
It probably has been fixed a long time ago because I cannot reproduce
it here. Sorry if I lost part of the discussion about this bug. If
you can confirm the fix, that'd be good.
Thanks,
--
Bastien
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Bug: ob-shell cannot forward empty blocks to stdin [9.3.1 (release_9.3.1-101-gc9ee3d @ /home/lockywolf/OfficialRepos/org-mode/lisp/)]
2020-09-05 13:55 ` Bastien
@ 2020-09-10 7:10 ` Vladimir Nikishkin
0 siblings, 0 replies; 3+ messages in thread
From: Vladimir Nikishkin @ 2020-09-10 7:10 UTC (permalink / raw)
To: Bastien; +Cc: emacs-orgmode
It still behaves as described.
Let me describe it in more detail:
suppose you have the following file
```
# -*- mode:org; -*-
#+name: empty
#+begin_quote
#+end_quote
#+begin_src shell :stdin empty
#+end_src
```
the #+end_src line should be the line number 8 in the file.
Place the point at the very beginning of line 8. This way the point is
_inside_ the code block, even though the block itself has length 0.
Type C-c C-c. Observe an error in the echo area.
The stack trace is the following:
```
Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
buffer-substring-no-properties(nil nil)
(org-remove-indentation (buffer-substring-no-properties
(org-element-property :contents-begin element) (org-element-property
:contents-end element)))
(cond ((eq val 'fixed-width) (let ((v (org-trim
(org-element-property :value element)))) (or
(org-babel--string-to-number v) v))) ((eq val 'table)
(org-babel-read-table)) ((eq val 'plain-list) (org-babel-read-list))
((eq val 'example-block) (let ((v (org-element-property :value
element))) (if (or org-src-preserve-indentation (org-element-property
:preserve-indent element)) v (org-remove-indentation v)))) ((eq val
'export-block) (org-remove-indentation (org-element-property :value
element))) ((eq val 'paragraph) (skip-chars-forward " \11") (if (and
(looking-at org-link-bracket-re) (save-excursion (goto-char (match-end
0)) (skip-chars-forward " \15\11\n") (<= (org-element-property :end
element) (point)))) (org-babel-read-link)
(buffer-substring-no-properties (org-element-property :contents-begin
element) (org-element-property :contents-end element)))) ((pcase--flip
memq '(special-block verse-block quote-block center-block) val)
(org-remove-indentation (buffer-substring-no-properties
(org-element-property :contents-begin element) (org-element-property
:contents-end element)))) (t nil))
(let* ((val (org-element-type element))) (cond ((eq val
'fixed-width) (let ((v (org-trim (org-element-property :value
element)))) (or (org-babel--string-to-number v) v))) ((eq val 'table)
(org-babel-read-table)) ((eq val 'plain-list) (org-babel-read-list))
((eq val 'example-block) (let ((v (org-element-property :value
element))) (if (or org-src-preserve-indentation (org-element-property
:preserve-indent element)) v (org-remove-indentation v)))) ((eq val
'export-block) (org-remove-indentation (org-element-property :value
element))) ((eq val 'paragraph) (skip-chars-forward " \11") (if (and
(looking-at org-link-bracket-re) (save-excursion (goto-char (match-end
0)) (skip-chars-forward " \15\11\n") (<= (org-element-property :end
element) (point)))) (org-babel-read-link)
(buffer-substring-no-properties (org-element-property :contents-begin
element) (org-element-property :contents-end element)))) ((pcase--flip
memq '(special-block verse-block quote-block center-block) val)
(org-remove-indentation (buffer-substring-no-properties
(org-element-property :contents-begin element) (org-element-property
:contents-end element)))) (t nil)))
(pcase (org-element-type element) (`fixed-width (let ((v (org-trim
(org-element-property :value element)))) (or
(org-babel--string-to-number v) v))) (`table (org-babel-read-table))
(`plain-list (org-babel-read-list)) (`example-block (let ((v
(org-element-property :value element))) (if (or
org-src-preserve-indentation (org-element-property :preserve-indent
element)) v (org-remove-indentation v)))) (`export-block
(org-remove-indentation (org-element-property :value element)))
(`paragraph (skip-chars-forward " \11") (if (and (looking-at
org-link-bracket-re) (save-excursion (goto-char (match-end 0))
(skip-chars-forward " \15\11\n") (<= (org-element-property :end
element) (point)))) (org-babel-read-link)
(buffer-substring-no-properties (org-element-property :contents-begin
element) (org-element-property :contents-end element)))) ((or
`center-block `quote-block `verse-block `special-block)
(org-remove-indentation (buffer-substring-no-properties
(org-element-property :contents-begin element) (org-element-property
:contents-end element)))) (_ nil))
(save-restriction (widen) (goto-char (org-element-property
:post-affiliated element)) (pcase (org-element-type element)
(`fixed-width (let ((v (org-trim (org-element-property :value
element)))) (or (org-babel--string-to-number v) v))) (`table
(org-babel-read-table)) (`plain-list (org-babel-read-list))
(`example-block (let ((v (org-element-property :value element))) (if
(or org-src-preserve-indentation (org-element-property
:preserve-indent element)) v (org-remove-indentation v))))
(`export-block (org-remove-indentation (org-element-property :value
element))) (`paragraph (skip-chars-forward " \11") (if (and
(looking-at org-link-bracket-re) (save-excursion (goto-char (match-end
0)) (skip-chars-forward " \15\11\n") (<= (org-element-property :end
element) (point)))) (org-babel-read-link)
(buffer-substring-no-properties (org-element-property :contents-begin
element) (org-element-property :contents-end element)))) ((or
`center-block `quote-block `verse-block `special-block)
(org-remove-indentation (buffer-substring-no-properties
(org-element-property :contents-begin element) (org-element-property
:contents-end element)))) (_ nil)))
(save-excursion (save-restriction (widen) (goto-char
(org-element-property :post-affiliated element)) (pcase
(org-element-type element) (`fixed-width (let ((v (org-trim ...))) (or
(org-babel--string-to-number v) v))) (`table (org-babel-read-table))
(`plain-list (org-babel-read-list)) (`example-block (let ((v
(org-element-property :value element))) (if (or
org-src-preserve-indentation (org-element-property :preserve-indent
element)) v (org-remove-indentation v)))) (`export-block
(org-remove-indentation (org-element-property :value element)))
(`paragraph (skip-chars-forward " \11") (if (and (looking-at
org-link-bracket-re) (save-excursion (goto-char ...)
(skip-chars-forward " \15\11\n") (<= ... ...))) (org-babel-read-link)
(buffer-substring-no-properties (org-element-property :contents-begin
element) (org-element-property :contents-end element)))) ((or
`center-block `quote-block `verse-block `special-block)
(org-remove-indentation (buffer-substring-no-properties
(org-element-property :contents-begin element) (org-element-property
:contents-end element)))) (_ nil))))
(org-with-wide-buffer (goto-char (org-element-property
:post-affiliated element)) (pcase (org-element-type element)
(`fixed-width (let ((v (org-trim (org-element-property :value
element)))) (or (org-babel--string-to-number v) v))) (`table
(org-babel-read-table)) (`plain-list (org-babel-read-list))
(`example-block (let ((v (org-element-property :value element))) (if
(or org-src-preserve-indentation (org-element-property
:preserve-indent element)) v (org-remove-indentation v))))
(`export-block (org-remove-indentation (org-element-property :value
element))) (`paragraph (skip-chars-forward " \11") (if (and
(looking-at org-link-bracket-re) (save-excursion (goto-char (match-end
0)) (skip-chars-forward " \15\11\n") (<= (org-element-property :end
element) (point)))) (org-babel-read-link)
(buffer-substring-no-properties (org-element-property :contents-begin
element) (org-element-property :contents-end element)))) ((or
`center-block `quote-block `verse-block `special-block)
(org-remove-indentation (buffer-substring-no-properties
(org-element-property :contents-begin element) (org-element-property
:contents-end element)))) (_ nil)))
org-babel-read-element((quote-block (:begin 22 :end 63
:contents-begin nil :contents-end nil :post-blank 1 :post-affiliated
36 :name "empty" :parent nil)))
org-babel-ref-resolve("empty")
org-babel-execute:shell("" ((:colname-names) (:rowname-names)
(:result-params "replace") (:result-type . value) (:results .
"replace") (:exports . "code") (:session . "none") (:cache . "no")
(:noweb . "no") (:hlines . "no") (:tangle . "no") (:stdin . "empty")))
org-babel-execute-src-block(nil ("shell" "" ((:colname-names)
(:rowname-names) (:result-params "replace") (:result-type . value)
(:results . "replace") (:exports . "code") (:stdin . "empty") (:tangle
. "no") (:hlines . "no") (:noweb . "no") (:cache . "no") (:session .
"none")) "" nil 63 "(ref:%s)"))
org-ctrl-c-ctrl-c(nil)
funcall-interactively(org-ctrl-c-ctrl-c nil)
#<subr call-interactively>(org-ctrl-c-ctrl-c nil nil)
apply(#<subr call-interactively> org-ctrl-c-ctrl-c (nil nil))
call-interactively@ido-cr+-record-current-command(#<subr
call-interactively> org-ctrl-c-ctrl-c nil nil)
apply(call-interactively@ido-cr+-record-current-command #<subr
call-interactively> (org-ctrl-c-ctrl-c nil nil))
call-interactively(org-ctrl-c-ctrl-c nil nil)
command-execute(org-ctrl-c-ctrl-c)
```
On Sat, 5 Sep 2020 at 21:55, Bastien <bzg@gnu.org> wrote:
>
> Hi Vladimir,
>
> Vladimir Nikishkin <lockywolf@gmail.com> writes:
>
> > The MWE would be the following:
> >
> > #+name: empty
> > #+begin_quote
> >
> > #+end_quote
> >
> > #+begin_src shell :stdin empty
> > #+end_src
> >
> > Now if you try to execute the second block, you will get a lisp error.
> > "Wrong argument integer-or-marker-p"
>
> It probably has been fixed a long time ago because I cannot reproduce
> it here. Sorry if I lost part of the discussion about this bug. If
> you can confirm the fix, that'd be good.
>
> Thanks,
>
> --
> Bastien
--
Yours sincerely, Vladimir Nikishkin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-09-10 7:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-25 1:28 Bug: ob-shell cannot forward empty blocks to stdin [9.3.1 (release_9.3.1-101-gc9ee3d @ /home/lockywolf/OfficialRepos/org-mode/lisp/)] Vladimir Nikishkin
2020-09-05 13:55 ` Bastien
2020-09-10 7:10 ` Vladimir Nikishkin
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).