Skip to content

Commit

Permalink
Update bigint check for Emacs 27+
Browse files Browse the repository at this point in the history
On Emacs 27+, intergerp is sort of `(or bigintp fixnump)`. So use
fixnump in newer Emacsen.
  • Loading branch information
kaushalmodi committed Aug 16, 2018
1 parent af4c706 commit efbb6ce
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ox-hugo.el
Original file line number Diff line number Diff line change
Expand Up @@ -2520,11 +2520,14 @@ Optional argument FORMAT can be \"toml\" or \"yaml\"."
;; "10040216507682529280" that needs more than 64 bits to
;; be stored as a signed integer, it will be automatically
;; stored as a float. So (integerp (string-to-number
;; val)) will return nil.
;; val)) will return nil [or `fixnump' instead of
;; `integerp' in Emacs 27 or newer]
;; https://github.com/toml-lang/toml#integer Integer
;; examples: 7, +7, -7, 7_000
(and (string-match-p "\\`[+-]?[[:digit:]_]+\\'" val)
(integerp (string-to-number val)))
(if (functionp #'fixnump) ;`fixnump' and `bignump' get introduced in Emacs 27.x
(fixnump (string-to-number val))
(integerp (string-to-number val)))) ;On older Emacsen, `integerp' behaved the same as the new `fixnump'
(string= "true" val)
(string= "false" val)
;; or if it is a date (date, publishDate, expiryDate, lastmod)
Expand Down

0 comments on commit efbb6ce

Please sign in to comment.