diff options
author | Case Duckworth | 2022-05-10 08:33:24 -0500 |
---|---|---|
committer | Case Duckworth | 2022-05-10 08:33:24 -0500 |
commit | a0b156b7e157265b4dcd2a60be2129681e40f2a6 (patch) | |
tree | d6f1cf67ba17092907322a91ff543802e93a8273 /lisp | |
parent | meh (diff) | |
parent | Merged (diff) | |
download | emacs-a0b156b7e157265b4dcd2a60be2129681e40f2a6.tar.gz emacs-a0b156b7e157265b4dcd2a60be2129681e40f2a6.zip |
Merge branch 'main' of tildegit.org:acdw/emacs
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/+elfeed.el | 12 | ||||
-rw-r--r-- | lisp/+scratch.el | 25 |
2 files changed, 32 insertions, 5 deletions
diff --git a/lisp/+elfeed.el b/lisp/+elfeed.el index c0b74f0..9257c8d 100644 --- a/lisp/+elfeed.el +++ b/lisp/+elfeed.el | |||
@@ -105,10 +105,14 @@ If multiple items are selected, don't advance." | |||
105 | (elfeed-db-load) | 105 | (elfeed-db-load) |
106 | (elfeed-update) | 106 | (elfeed-update) |
107 | ;; Wait for `elfeed-update' to finish | 107 | ;; Wait for `elfeed-update' to finish |
108 | (while (> (elfeed-queue-count-total) 0) | 108 | (let ((q<5-count 0)) |
109 | (sleep-for 5) | 109 | (while (and (> (elfeed-queue-count-total) 0) |
110 | (message "%s" (elfeed-queue-count-total)) | 110 | (< q<5-count 5)) |
111 | (accept-process-output)) | 111 | (sleep-for 5) |
112 | (message "Elfeed queue count total: %s" (elfeed-queue-count-total)) | ||
113 | (when (< (elfeed-queue-count-total) 5) | ||
114 | (cl-incf q<5-count)) | ||
115 | (accept-process-output))) | ||
112 | ;; Garbage collect and save the database | 116 | ;; Garbage collect and save the database |
113 | (elfeed-db-gc) | 117 | (elfeed-db-gc) |
114 | (elfeed-db-save) | 118 | (elfeed-db-save) |
diff --git a/lisp/+scratch.el b/lisp/+scratch.el index bd16ec2..e9b825a 100644 --- a/lisp/+scratch.el +++ b/lisp/+scratch.el | |||
@@ -7,7 +7,8 @@ | |||
7 | (defun +scratch-immortal () | 7 | (defun +scratch-immortal () |
8 | "Bury, don't kill \"*scratch*\" buffer. | 8 | "Bury, don't kill \"*scratch*\" buffer. |
9 | For `kill-buffer-query-functions'." | 9 | For `kill-buffer-query-functions'." |
10 | (if (eq (current-buffer) (get-buffer "*scratch*")) | 10 | (if (or (eq (current-buffer) (get-buffer "*scratch*")) |
11 | (eq (current-buffer) (get-buffer "*text*"))) | ||
11 | (progn (bury-buffer) | 12 | (progn (bury-buffer) |
12 | nil) | 13 | nil) |
13 | t)) | 14 | t)) |
@@ -35,5 +36,27 @@ For `kill-buffer-query-functions'." | |||
35 | (concat (replace-regexp-in-string "^" ";; " s) | 36 | (concat (replace-regexp-in-string "^" ";; " s) |
36 | "\n\n"))) | 37 | "\n\n"))) |
37 | 38 | ||
39 | ;; [[https://old.reddit.com/r/emacs/comments/ui1q41/weekly_tips_tricks_c_thread/i7ef4xg/][u/bhrgunatha]] | ||
40 | (defun +scratch-text-scratch () | ||
41 | "Create a \"*text*\" scratch buffer in Text mode." | ||
42 | (with-current-buffer (get-buffer-create "*text*") | ||
43 | (text-mode))) | ||
44 | |||
45 | (defun +scratch-toggle (buffer) | ||
46 | "Switch to BUFFER, or to the previous buffer." | ||
47 | (switch-to-buffer (unless (eq (current-buffer) | ||
48 | (get-buffer buffer)) | ||
49 | buffer))) | ||
50 | |||
51 | (defun +scratch-switch-to-scratch () | ||
52 | "Switch to scratch buffer." | ||
53 | (interactive) | ||
54 | (+scratch-toggle "*scratch*")) | ||
55 | |||
56 | (defun +scratch-switch-to-text () | ||
57 | "Switch to text buffer." | ||
58 | (interactive) | ||
59 | (+scratch-toggle "*text*")) | ||
60 | |||
38 | (provide '+scratch) | 61 | (provide '+scratch) |
39 | ;;; +scratch.el ends here | 62 | ;;; +scratch.el ends here |