Overview
Comment: | Kill thread buffers when quitting board buffer |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | master | trunk |
Files: | files | file ages | folders |
SHA3-256: |
a3e4eb41e0b87f34b669e70f041719f7 |
User & Date: | zge on 2022-01-22 18:57:01 |
Other Links: | branch diff | manifest | tags |
Context
2022-01-24
| ||
09:11 | Fix /mona/ check-in: d0b75dd168 user: zge tags: master, trunk | |
2022-01-22
| ||
18:57 | Kill thread buffers when quitting board buffer check-in: a3e4eb41e0 user: zge tags: master, trunk | |
18:49 | Always kill HTTP response buffer after processing it check-in: 67d30a2317 user: zge tags: master, trunk | |
Changes
Modified sbbs.el from [1c7c7f43da] to [a7ead60032].
59 59 (defcustom sbbs-recenter-to-top nil 60 60 "Move point to top of frame when moving through posts." 61 61 :type 'boolean) 62 62 63 63 (defcustom sbbs-open-at-last-post nil 64 64 "Jump to last post in a thread when opening a thread." 65 65 :type 'boolean) 66 + 67 +(defcustom sbbs-kill-threads-on-quit t 68 + "Kill all thread buffers when quitting a board buffer." 69 + :type 'boolean) 66 70 67 71 (defface sbbs--semi-spoiler-face 68 72 '((((background light)) :background "gray80" :foreground "black") 69 73 (((background dark)) :background "gray20" :foreground "white")) 70 74 "Face for spoiler text in threads.") 71 75 72 76 (defface sbbs--spoiler-face ................................................................................ 223 227 (cond ((< nr current) (setq down (point))) 224 228 ((> nr current) (setq up (point)))))) 225 229 (unless (and (eq 'highlight (get-text-property (point) 'face)) 226 230 (looking-at-p "\\`#[[:digit:]]+")) 227 231 ;; in case we are on the first character of a post, we shouldn't 228 232 ;; jump back, since that would mean setting to point to NR-1. 229 233 (sbbs-read-previous 1))) 234 + 235 +(defun sbbs--cleanup-board () 236 + "Close all thread buffers for the current board." 237 + (when sbbs-kill-threads-on-quit 238 + (dolist (buf (buffer-list)) 239 + (when (and (eq (buffer-local-value 'sbbs--board buf) sbbs--board) 240 + (buffer-local-value 'sbbs--thread-id buf)) 241 + (kill-buffer buf))))) 230 242 231 243 232 244 ;;; UI GENERATOR 233 245 234 246 (defconst sbbs--link-regexp 235 247 (rx-to-string 236 248 `(: bos ................................................................................ 753 765 "Major mode for browsing a SchemeBBS board." 754 766 (buffer-disable-undo) 755 767 756 768 (setq tabulated-list-format [("Date" 16 t) 757 769 ("#" 3 t :right-align t) 758 770 ("Headline" 0 nil)] 759 771 tabulated-list-sort-key '("Date" . t)) 772 + (add-hook 'quit-window-hook 773 + 'sbbs--cleanup-board 774 + nil t) 760 775 (add-hook 'tabulated-list-revert-hook 761 776 #'sbbs--reload-board nil t) 762 777 (tabulated-list-init-header) 763 778 764 779 (hl-line-mode t)) 765 780 766 781 (defvar sbbs-read-mode-map