emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Debugging at least 2 regressions in org-mode master breaking ox-hugo


From: Kaushal Modi
Subject: Re: Debugging at least 2 regressions in org-mode master breaking ox-hugo
Date: Thu, 27 Feb 2020 09:19:42 -0500

On Thu, Feb 27, 2020 at 9:13 AM Kaushal Modi <address@hidden> 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]