[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/helm 2534c228ef 3/3: Finally use a synchronous process for
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/helm 2534c228ef 3/3: Finally use a synchronous process for library desc |
Date: |
Wed, 8 Nov 2023 13:00:35 -0500 (EST) |
branch: elpa/helm
commit 2534c228ef6699cb2588349c44627835fc444278
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>
Finally use a synchronous process for library desc
---
helm-elisp.el | 6 ------
helm-lib.el | 21 ++++-----------------
2 files changed, 4 insertions(+), 23 deletions(-)
diff --git a/helm-elisp.el b/helm-elisp.el
index b9c518487d..f3fbab9965 100644
--- a/helm-elisp.el
+++ b/helm-elisp.el
@@ -893,12 +893,6 @@ a string, i.e. the `symbol-name' of any existing symbol."
;;; Locate elisp library
;;
;;
-;; FIXME: Maybe I make an error of implementation here, building the caches in
-;; the transformer force the usage of an asynchronous function to build the doc
-;; of each library, maybe it would be simpler to make the caches in :init and
use
-;; a simple transformer using gethash to fetch doc and path of each candidate.
And
-;; `helm-locate-lib-get-summary' could use a synchronous process.
-
(defvar helm--locate-library-cache nil)
(defvar helm--locate-library-doc-cache (make-hash-table :test 'equal))
(defun helm-locate-library-scan-list ()
diff --git a/helm-lib.el b/helm-lib.el
index e5c6ccfd5a..f2161d416f 100644
--- a/helm-lib.el
+++ b/helm-lib.el
@@ -1756,28 +1756,15 @@ Directories expansion is not supported."
(cmd "%s %s | head -n1 | awk 'match($0,\"%s\",a) {print a[2]}'\
| awk -F ' -*-' '{print $1}'")
(regexp "^;;;(.*) ---? (.*)$")
- (proc (start-process-shell-command
- "helm-locate-lib-get-summary" "*helm locate lib*"
+ (desc (shell-command-to-string
(format cmd
(if (string-match-p "\\.gz\\'" file)
"gzip -c -q -d" "cat")
(shell-quote-argument file)
- regexp)))
- output)
- (set-process-sentinel
- proc (lambda (process event)
- (when (and (string= event "finished\n")
- (process-buffer process))
- (with-current-buffer (process-buffer process)
- (setq output
- (replace-regexp-in-string
- "\n" ""
- (buffer-string)))
- (erase-buffer)))))
- (while (accept-process-output proc))
- (if (string= output "")
+ regexp))))
+ (if (string= desc "")
"Not documented"
- output)))
+ (replace-regexp-in-string "\n" "" desc))))
;;; helm internals
;;