Skip to content

Commit

Permalink
fix: Use = and length separately instead of length=
Browse files Browse the repository at this point in the history
length= does not exist on 27.2 and older Emacs versions.

It was added in Emacs 28.1 in
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=9809f7ed2c639bd51abd4a28bd5d1a37f0d46a3d.
  • Loading branch information
kaushalmodi committed Apr 29, 2022
1 parent f37841c commit 98c9b8c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tomelr.el
Original file line number Diff line number Diff line change
Expand Up @@ -277,16 +277,17 @@ non-nil. Sorting can optionally be DESTRUCTIVE for speed."
(defun tomelr--print-array (array)
"Like `tomelr-encode-array', but insert the TOML at point."
(insert "[ ")
(unless (length= array 0)
(unless (= 0 (length array))
(tomelr--with-indentation
(let ((first t))
(mapc (lambda (elt)
(if first
(setq first nil)
(insert ", "))
(tomelr--print elt))
array))))
(insert " ]"))
array)))
(insert " "))
(insert "]"))

(defun tomelr-encode-array (array)
"Return a TOML representation of ARRAY.
Expand Down

0 comments on commit 98c9b8c

Please sign in to comment.