unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Help making a map-do/seq-do based code work on emacs 26.3
@ 2022-05-04 18:50 Kaushal Modi
  2022-05-04 19:20 ` Emanuel Berg
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Kaushal Modi @ 2022-05-04 18:50 UTC (permalink / raw)
  To: Help Gnu Emacs mailing list, Nicolas Petton

Hello,

I recently published the tomelr package on GNU ELPA that can take in a
plist or alist and return a TOML string.

Now I need to tackle a small problem that makes the package fail at
run-time only on emacs 26.3 (not on emacs 27+) when a plist is passed
to its tomelr-encode function.

Recipe to reproduce failure:

1. Load emacs 26.3
2. Install tomelr from GNU ELPA
3. (require 'tomelr)
4. M-: (tomelr-encode '(:int 123))

Error backtrace

Test test-plist backtrace:
  #f(compiled-function (pair) #<bytecode 0x313eed>)(:int)
  mapc(#f(compiled-function (pair) #<bytecode 0x313eed>) (:int 123))
  seq-do(#f(compiled-function (pair) #<bytecode 0x313eed>) (:int 123))
  map--do-alist(tomelr--print-pair (:int 123))
  map-do(tomelr--print-pair (:int 123))
  (let ((tomelr--print-indentation-depth (1+ tomelr--print-indentation
  (if (map-empty-p map) nil (let ((tomelr--print-indentation-depth (1+
  tomelr--print-map((:int 123))
  (cond ((tomelr-toml-table-p list) (tomelr--print-map list)) ((listp
  tomelr--print-list((:int 123))
  (cond ((tomelr--print-boolean object)) ((listp object) (tomelr--prin
  tomelr--print((:int 123))
  (save-current-buffer (set-buffer standard-output) (set (make-local-v
  (let ((standard-output standard-output)) (save-current-buffer (set-b
  (progn (let ((standard-output standard-output)) (save-current-buffer
  (unwind-protect (progn (let ((standard-output standard-output)) (sav
  (let ((standard-output (get-buffer-create (generate-new-buffer-name
  (string-trim (let ((standard-output (get-buffer-create (generate-new
  tomelr-encode((:int 123))

Expected output:

"int = 123"


Same error on the package's CI for reference:
https://github.com/kaushalmodi/tomelr/runs/6295315125?check_suite_focus=true

===

- Is there a function or few of them that I can override so that
(tomelr-encode '(:int 123)) works on emacs 26.3 as well?
- Can I force install map and seq from GNU ELPA on emacs 26.3? But how
can I do that if a user's package.el is installing tomelr.el from GNU
ELPA as a dependency? Also package.el will refuse to install map and
seq because they are already present in Emacs 26.3 core.

--
Kaushal Modi



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-05-05 21:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-04 18:50 Help making a map-do/seq-do based code work on emacs 26.3 Kaushal Modi
2022-05-04 19:20 ` Emanuel Berg
2022-05-05  2:20 ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-05-05 16:24 ` Kaushal Modi
2022-05-05 18:32   ` Stefan Monnier
2022-05-05 21:23     ` Kaushal Modi
2022-05-05 21:33       ` Stefan Monnier

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).