branch: externals/el-job
commit 8dcd2db2a2275ca94513c792a2a0e0cdf4402499
Author: Martin Edström <[email protected]>
Commit: Martin Edström <[email protected]>
Comments
---
README.org | 6 +-----
el-job.el | 4 +++-
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/README.org b/README.org
index 40857d2013..19dc4d2e9e 100644
--- a/README.org
+++ b/README.org
@@ -2,11 +2,7 @@
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.
-#+BEGIN_HTML
-<a href="https://repology.org/project/emacs%3Ael-job/versions">
- <img src="https://repology.org/badge/vertical-allrepos/emacs%3Ael-job.svg"
alt="Packaging status">
-</a>
-#+END_HTML
+#+HTML: <a href="https://repology.org/project/emacs%3Ael-job/versions"><img
src="https://repology.org/badge/vertical-allrepos/emacs%3Ael-job.svg"
alt="Packaging status"></a>
* el-job
Imagine you have a function you'd like to run on a long list of inputs. You
could run =(mapcar #'FN INPUTS)=, but that hangs Emacs until done.
diff --git a/el-job.el b/el-job.el
index 6fd875bb41..2b42f7c20e 100644
--- a/el-job.el
+++ b/el-job.el
@@ -267,7 +267,8 @@ being saddled with a huge item in addition to the average
workload."
(setq this-sublist nil)
(push item items)))))))
(if (length= sublists 0)
- (progn ;; Degrade gracefully
+ (progn
+ ;; Degrade gracefully (but I think we never arrive here)
(fset 'el-job--split-optimally #'el-job--split-evenly)
(cl-assert (not (length= sublists 0))))
;; Spread leftovers equally
@@ -628,6 +629,7 @@ after a short delay. N is the count of checks done so far."
(el-job--disable job)
(el-job--dbg 2 "Reaped idle processes for %s" (el-job-id job)))))
+;; TODO: Consider using `with-local-quit', because this fires on a timer
(defun el-job--handle-output ()
"Handle output in current buffer.