help-gnu-emacs
[Top][All Lists]
Advanced

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

Help making a map-do/seq-do based code work on emacs 26.3


From: Kaushal Modi
Subject: Help making a map-do/seq-do based code work on emacs 26.3
Date: Wed, 4 May 2022 14:50:37 -0400

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



reply via email to

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