From: Kaushal Modi <kaushal.modi@gmail.com>
To: emacs-org list <emacs-orgmode@gnu.org>, Bastien Guerry <bzg@gnu.org>
Subject: Re: Debugging at least 2 regressions in org-mode master breaking ox-hugo
Date: Thu, 27 Feb 2020 09:19:42 -0500 [thread overview]
Message-ID: <CAFyQvY14iek+op12Vm7+jrniGEVU2yha7kuPtNtFQAso6d=PjQ@mail.gmail.com> (raw)
In-Reply-To: <CAFyQvY08atfQcFG973_EhwJfiEzbc_KcyREAdRK11JRYm+VMWw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1414 bytes --]
On Thu, Feb 27, 2020 at 9:13 AM Kaushal Modi <kaushal.modi@gmail.com> wrote:
> The regression is caused by
> https://code.orgmode.org/bzg/org-mode/commit/6b2a7cb20b357e730de151522fe4204c96615f98
> or the later commit that changes `org-babel--string-to-number'.
>
> Using this function redefinition with additional debug messages:
>
> (defun org-babel--string-to-number (string)
> "If STRING represents a number return its value.
> Otherwise return nil."
> (message "DBG: string: %S" string)
> (unless (string-match-p "\\s-" (org-trim string))
> (let ((interned-string (ignore-errors (read string))))
> (when (numberp interned-string)
> (message "DBG: interned string: %S" interned-string)
> interned-string))))
>
> I get:
>
> DBG: string: "1,3-5"
> DBG: interned string: 1
>
> So that ",3-5" piece of information is lost.
>
To be more specific, here is the call order:
org-babel-parse-header-arguments -> org-babel-read ->
org-babel--string-to-number
org-babel-read returns the string as-is if org-babel--string-to-number
returns nil.
*The regression is that earlier (org-babel--string-to-number "1,3-5") used
to return nil, but now it returns 1.*
I think that it should return a number only if 100% of the input string
represents a number. In the case of "1,3-5", it makes sense for it to still
return nil, so that org-babel-read does not throw away the ",3-5" piece of
information.
[-- Attachment #2: Type: text/html, Size: 2240 bytes --]
next prev parent reply other threads:[~2020-02-27 14:20 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-27 14:00 Debugging at least 2 regressions in org-mode master breaking ox-hugo Kaushal Modi
2020-02-27 14:13 ` Kaushal Modi
2020-02-27 14:19 ` Kaushal Modi [this message]
2020-09-06 21:37 ` Bastien
2020-09-07 11:47 ` Kaushal Modi
2020-02-28 0:03 ` Adam Porter
2020-03-05 13:49 ` Kaushal Modi
2020-03-05 14:04 ` Bastien
2020-03-05 14:43 ` Kaushal Modi
2020-04-16 2:41 ` Kyle Meyer
2020-04-24 10:53 ` Daniel Kraus
2020-04-25 1:34 ` Kyle Meyer
2020-04-26 5:31 ` Kyle Meyer
2020-04-28 17:21 ` Bastien
2020-05-21 7:03 ` Bastien
2020-04-24 11:20 ` Carsten Dominik
2020-05-11 14:10 ` Carsten Dominik
2020-05-11 14:27 ` Kyle Meyer
2020-05-11 14:48 ` Carsten Dominik
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='CAFyQvY14iek+op12Vm7+jrniGEVU2yha7kuPtNtFQAso6d=PjQ@mail.gmail.com' \
--to=kaushal.modi@gmail.com \
--cc=bzg@gnu.org \
--cc=emacs-orgmode@gnu.org \
/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).