From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id aOsQCo7RWV/sLAAA0tVLHw (envelope-from ) for ; Thu, 10 Sep 2020 07:11:10 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id UMjwBY7RWV9rZgAA1q6Kng (envelope-from ) for ; Thu, 10 Sep 2020 07:11:10 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 25D5294036A for ; Thu, 10 Sep 2020 07:11:09 +0000 (UTC) Received: from localhost ([::1]:45546 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGGja-00086p-Sk for larch@yhetil.org; Thu, 10 Sep 2020 03:11:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33356) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGGix-00084Z-MO for emacs-orgmode@gnu.org; Thu, 10 Sep 2020 03:10:27 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]:46240) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kGGit-0002iv-29; Thu, 10 Sep 2020 03:10:27 -0400 Received: by mail-ej1-x630.google.com with SMTP id z23so7106283ejr.13; Thu, 10 Sep 2020 00:10:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SZ+UoA3NeuToq6DXcgiN+GqvUeOCm4WkyTVjr7tAnGE=; b=PZXYFCodbapQqhXeIz6qSZUc0ON1G2UCfqyAO5JUgiFN/H1sYX4fhxh1ZNkgSt3ujq Shi/lUT49bVyHecOM2cD5ob5u9jZnln5UNjlBbH0Bw0fugD0a5bz17RYzOncxsYKBzh6 rXkfe3aGXNZqe+reT3bw9yI4C9WUD2Yr1joD6O82nR1BYaQRIUsKEzD5+er0Ye8tQ4Rf vmXIeQsxKl1sFNh2WLH3iumulEcEbz/bn1ZwiQxULkK8STmmzucU9c/MpstMo3cYIqOK v3EJK//ITnxpzbnmEZSxy/tFuXq9lzY4KqGF3cEnovlx5EDQguKxUNQ9tKaKp2QBKWL9 OwNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SZ+UoA3NeuToq6DXcgiN+GqvUeOCm4WkyTVjr7tAnGE=; b=CPAaAQeLyMP6ENj2nyzFaqXXK8ZNYYXCbw0KubPK83xcIKmbG9Bp+5XP1+EJJuRQcS ZQv1eLTmnAaovYLtK0nCKO+zyzipHz9l8Rynp93XQSRE5DiJ7RWOkDYI9PjDuTR2FYpF aWnrB3AU3IcPkLQS6T7QDSTL9Ug8c+GjoFBfRuO4RnBHnHaWh3PW/vV0eGwP9xJyUI4C 0uPP+ctegle4BTjRtevjrkNo1VgB4Fz26YFeVBawrTkba4htJdYPWiMcWCU8IYGKvijb QMSQFFsJVurVKmXBzlXjri+CxWu/JFSF4D2ssQ6dvHjZrPIvzCIkjPDNRDG670BX4UAm 5Jzg== X-Gm-Message-State: AOAM530PplBxnL5E7eNTNCAfhpJNwt14gftOh4b8SuucIAJKaV7JowyE BcKyUzMxuPCklf4DoGfNyYZMGPxWT61ITG91isGQ1QNwvQkkeA== X-Google-Smtp-Source: ABdhPJwjNae0WRlxxAOo0AseSUZRog9GxCDTzU+xlKkibq5lS2B68RyXjm+3Lne8unvL35Jw7XXd7FawQLsSvotZhuk= X-Received: by 2002:a17:906:c18e:: with SMTP id g14mr7607002ejz.416.1599721820682; Thu, 10 Sep 2020 00:10:20 -0700 (PDT) MIME-Version: 1.0 References: <87o8tn316u.fsf@delllaptop.lockywolf.net> <87blikib0j.fsf@bzg.fr> In-Reply-To: <87blikib0j.fsf@bzg.fr> From: Vladimir Nikishkin Date: Thu, 10 Sep 2020 15:10:08 +0800 Message-ID: Subject: 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/)] To: Bastien Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=lockywolf@gmail.com; helo=mail-ej1-x630.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=PZXYFCod; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -1.71 X-TUID: uuy9LpwEikKt 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) #(org-ctrl-c-ctrl-c nil nil) apply(# org-ctrl-c-ctrl-c (nil nil)) call-interactively@ido-cr+-record-current-command(# org-ctrl-c-ctrl-c nil nil) apply(call-interactively@ido-cr+-record-current-command # (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 wrote: > > Hi Vladimir, > > Vladimir Nikishkin 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