[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/async 26c0a44 1/2: Handle unreadable chars #145
From: |
ELPA Syncer |
Subject: |
[elpa] externals/async 26c0a44 1/2: Handle unreadable chars #145 |
Date: |
Sat, 21 Aug 2021 01:57:13 -0400 (EDT) |
branch: externals/async
commit 26c0a445e26e26a68fad1de7c0fa24a4ef39e0da
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>
Handle unreadable chars #145
---
async.el | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/async.el b/async.el
index 2537681..03c5fbd 100644
--- a/async.el
+++ b/async.el
@@ -164,6 +164,19 @@ It is intended to be used as follows:
(kill-buffer (current-buffer))))
(set (make-local-variable 'async-callback-value) proc)
(set (make-local-variable 'async-callback-value-set) t))
+ ;; Maybe strip out unreadable "#"; They are replaced by
+ ;; empty string unless they are prefixing a special
+ ;; object like a marker. See issue #145.
+ (goto-char (point-min))
+ (save-excursion
+ ;; Transform markers in list like
+ ;; (marker (moves after insertion) at 2338 in
+ ;; test\.org) so that remap text properties function
+ ;; can parse it to restitute marker.
+ (while (re-search-forward "#<\\([^>]*\\)>" nil t)
+ (replace-match (concat "(" (match-string 1) ")") t t)))
+ (while (re-search-forward "#" nil t)
+ (replace-match "" t t))
(goto-char (point-max))
(backward-sexp)
(async-handle-result async-callback (read (current-buffer))