[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/extmap 07223c2cd9 19/39: Add a workaround for value compre
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/extmap 07223c2cd9 19/39: Add a workaround for value compression not working in some cases on Emacs 27. |
Date: |
Fri, 31 Jan 2025 07:00:43 -0500 (EST) |
branch: elpa/extmap
commit 07223c2cd9885a2b8bf1b3c997792c773b91bd2f
Author: Paul Pogonyshev <pogonyshev@gmail.com>
Commit: Paul Pogonyshev <pogonyshev@gmail.com>
Add a workaround for value compression not working in some cases on Emacs
27.
---
extmap.el | 8 +++++++-
test/extmap-test.el | 7 +++++++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/extmap.el b/extmap.el
index 07bc93b701..a574b885d9 100644
--- a/extmap.el
+++ b/extmap.el
@@ -405,7 +405,13 @@ Only available on Emacs 25, as this requires `generator'
package."
(when canonical-subvalues
(clrhash canonical-subvalues)
(setq value (extmap--compress-value value
canonical-subvalues)))
- (prin1-to-string value)))))
+ ;; Workaround for Emacs (27?) not using the
print circle for
+ ;; strings on the first level. At this
point I no longer care to
+ ;; report bugs in Emacs. Fuck it, it's
faster and easier to just
+ ;; add workarounds
+ (if (stringp value)
+ (prin1-to-string value)
+ (substring (prin1-to-string (list value))
1 -1))))))
(unless (or (extmap--plain-string-p value) (condition-case _
(equal (read serialized) value) (error nil)))
(error "Value for key `%s' cannot be saved in database: it
cannot be read back or is different after reading" key))
;; The whole point of this buffer is to be used for
diff --git a/test/extmap-test.el b/test/extmap-test.el
index b1d570609b..545cd56fa7 100644
--- a/test/extmap-test.el
+++ b/test/extmap-test.el
@@ -90,6 +90,13 @@
(should (eq (nth 2 bar) (cdr (nth 3 bar))))
(should-not (eq foo bar))))
+(ert-deftest extmap-compressed-values-2 ()
+ ;; Targeted at a specific bug in Emacs. Extmap adds a workaround for it.
+ (let* ((extmap (extmap--test-alist `((foo . ("some long string" "some long
string")))
+ :compress-values t :max-inline-bytes 0))
+ (foo (extmap-get extmap 'foo)))
+ (should (eq (nth 0 foo) (nth 1 foo)))))
+
(ert-deftest extmap-plain-string-p ()
(should (extmap--plain-string-p "foo"))
- [nongnu] branch elpa/extmap created (now 3b0f898057), ELPA Syncer, 2025/01/31
- [nongnu] elpa/extmap 669aa3484a 05/39: Fix for commit eabe5f6: function `file-attribute-modification-time' doesn't exist in Emacs 25., ELPA Syncer, 2025/01/31
- [nongnu] elpa/extmap 75d23267df 06/39: Make the package work on Emacs 24., ELPA Syncer, 2025/01/31
- [nongnu] elpa/extmap 28e1dfd6bd 09/39: Expand `README.md' a bit., ELPA Syncer, 2025/01/31
- [nongnu] elpa/extmap 3860b69fb1 10/39: Release version 1.0., ELPA Syncer, 2025/01/31
- [nongnu] elpa/extmap 070cc972a9 12/39: Implement `:share-values' flag; bump generated file version accordingly., ELPA Syncer, 2025/01/31
- [nongnu] elpa/extmap 07223c2cd9 19/39: Add a workaround for value compression not working in some cases on Emacs 27.,
ELPA Syncer <=
- [nongnu] elpa/extmap 2a6373d4fa 21/39: Experimentally also test on Emacs snapshot., ELPA Syncer, 2025/01/31
- [nongnu] elpa/extmap 1139b57d8f 14/39: Release version 1.1., ELPA Syncer, 2025/01/31
- [nongnu] elpa/extmap 434571a027 35/39: Require Emacs 24.4., ELPA Syncer, 2025/01/31
- [nongnu] elpa/extmap a9ecc94344 27/39: Add a simplistic but useful Git hook., ELPA Syncer, 2025/01/31
- [nongnu] elpa/extmap fb6630228d 24/39: Speed-optimize `extmap--equal-including-properties'; while not terribly important, 3 s vs. 29 in a real-world usecase is a good improvement., ELPA Syncer, 2025/01/31
- [nongnu] elpa/extmap 461e559464 31/39: Bump actions/checkout from 3 to 4, ELPA Syncer, 2025/01/31
- [nongnu] elpa/extmap 8b66ccd3b8 28/39: Include a file with settings for ripgrep., ELPA Syncer, 2025/01/31
- [nongnu] elpa/extmap c0dd886e0b 22/39: Add function `extmap-equal-p`., ELPA Syncer, 2025/01/31
- [nongnu] elpa/extmap c7af95865e 38/39: Release extmap 1.3, ELPA Syncer, 2025/01/31
- [nongnu] elpa/extmap 7b82106cdc 30/39: Use a GitHub action to install Eldev instead of shell command; also test on Emacs 28, 29, macOS and Windows., ELPA Syncer, 2025/01/31