Fix elfeed-update-async niceness

This commit is contained in:
Case Duckworth 2022-02-28 09:40:24 -06:00
parent b0346f6283
commit f65f4387b8
1 changed files with 8 additions and 1 deletions

View File

@ -40,6 +40,10 @@
(defvar +elfeed--update-running nil "Whether an update is currently running.")
(defvar +elfeed--update-count 0 "How many times `+elfeed-update-command' has run.")
(defcustom +elfeed-update-niceness 15
"How \"nice\" `+elfeed-update-command' should be."
:type 'integer
:group 'elfeed)
(defun +elfeed-update-command ()
(interactive)
@ -104,7 +108,10 @@
(message update-message-format "start")
(set-process-sentinel (start-process-shell-command
"Elfeed" "*+elfeed-update-background*"
(format "nice -%d %s %s" 15 "emacs -Q --script" script))
(format "nice -n %d %s %s"
+elfeed-update-niceness
"emacs -Q --script"
script))
(lambda (proc stat)
(advice-remove 'elfeed #'+elfeed--update-message)
(setq +elfeed--update-running nil)