emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: zhaoyiyu <zhyznd@163.com>
To: Ihor Radchenko <yantar92@posteo.net>,
	Michael Dauer <mick.dauer@gmail.com>
Cc: Timothy <orgmode@tec.tecosaur.net>, emacs-orgmode@gnu.org
Subject: Re: BUG: org-sbe not working anymore: Format specifier doesn’t match argument type
Date: Wed, 22 Feb 2023 11:49:59 +0800	[thread overview]
Message-ID: <21a4d6be-e7ce-740a-f04a-2ebd54db2253@163.com> (raw)
In-Reply-To: <87iljvgp2z.fsf@localhost>

Maybe change the org-sbe macro? Below is a workaround.

(defmacro org-sbe (source-block &rest variables)

   (declare (debug (form form)))
   (let* ((header-args (if (stringp (car variables)) (car variables) ""))
      (variables (if (stringp (car variables)) (cdr variables) variables)))
     (let* (quote
        (variables
         (mapcar
          (lambda (var)
            ;; ensure that all cells prefixed with $'s are strings
            (cons (car var)
              (delq nil (mapcar
                 (lambda (el)
                   (if (eq '$ el)
                       (prog1 nil (setq quote t))
                     (prog1
                     (cond
                                          ;; FIXME: replace "\"%s\"" for 
quotation marks inside value
-->                     (quote (format "%S" el))
                      ((stringp el) (org-no-properties el))
                      (t el))
                       (setq quote nil))))
                 (cdr var)))))
          variables)))
       (unless (stringp source-block)
     (setq source-block (symbol-name source-block)))
       (let ((result
              (if (and source-block (> (length source-block) 0))
                  (let ((params
                         ;; FIXME: Why `eval'?!?!?
                         (eval `(org-babel-parse-header-arguments
                                 (concat
                                  ":var results="
                                  ,source-block
                                  "[" ,header-args "]"
                                  "("
                                  (mapconcat
                                   (lambda (var-spec)
                                     (if (> (length (cdr var-spec)) 1)
                                         (format "%S='%S"
                                                 (car var-spec)
                                                 (mapcar #'read (cdr 
var-spec)))
                                       (format "%S=%s"
                                               (car var-spec) (cadr 
var-spec))))
                                   ',variables ", ")
                                  ")")))))
                    (org-babel-execute-src-block
                     ;; FIXME: manual add names in list
-->                    nil (list "emacs-lisp" "results" params "" "results")
                     '((:results . "silent"))))
                "")))
         (org-trim (if (stringp result) result (format "%S" result)))))))

On 2022/11/4 15:23, Ihor Radchenko wrote:
> Michael Dauer <mick.dauer@gmail.com> writes:
>
>> It's this fixed? How can I track myself?
> I think it is, as a side effect of
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=9987451252fa64af65d0a0a014f41812f4402c02
>
> I was mainly waiting for Timothy to chime in, but there was a second bug report...
>



  reply	other threads:[~2023-02-22 13:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-17 10:40 BUG: org-sbe not working anymore: Format specifier doesn’t match argument type Michael Dauer
2022-10-17 13:11 ` Ihor Radchenko
2022-11-04  7:07   ` BUG: org-sbe not working anymore: Format " Michael Dauer
2022-11-04  7:23     ` Ihor Radchenko
2023-02-22  3:49       ` zhaoyiyu [this message]
2023-02-22 11:18         ` Ihor Radchenko
2023-02-22 13:47           ` 赵一宇
2023-02-22 13:57             ` Ihor Radchenko
2023-02-22 14:05               ` 赵一宇
2023-02-23  9:33                 ` Ihor Radchenko

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=21a4d6be-e7ce-740a-f04a-2ebd54db2253@163.com \
    --to=zhyznd@163.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mick.dauer@gmail.com \
    --cc=orgmode@tec.tecosaur.net \
    --cc=yantar92@posteo.net \
    /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).