Overview
Comment: | Add sbbs-goto-end for jumping to the end of a thread |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | master | trunk |
Files: | files | file ages | folders |
SHA3-256: |
99f8459c8be2e69ce144b791156cb43d |
User & Date: | zge on 2021-01-19 15:39:17 |
Other Links: | branch diff | manifest | tags |
Context
2021-01-22
| ||
17:08 | Make sbbs-read-board prompt easier to use check-in: b0f8109722 user: zge tags: master, trunk | |
2021-01-19
| ||
15:39 | Add sbbs-goto-end for jumping to the end of a thread check-in: 99f8459c8b user: zge tags: master, trunk | |
10:39 | Ensure valid board names are entered check-in: aabf564004 user: zge tags: master, trunk | |
Changes
Modified sbbs.el from [d9b39dbe32] to [c6978dc733].
53 53 (defcustom sbbs-jump-to-link t 54 54 "Jump to first link after narrowing posts." 55 55 :type 'boolean) 56 56 57 57 (defcustom sbbs-recenter-to-top t 58 58 "Move point to top of frame when moving through posts." 59 59 :type 'boolean) 60 + 61 +(defcustom sbbs-open-at-last-post t 62 + "Jump to last post in a thread when opening a thread." 63 + :type 'boolean) 60 64 61 65 (defface sbbs--spoiler-face 62 66 '((((background light)) :background "black" :foreground "black") 63 67 (((background dark)) :background "white" :foreground "white")) 64 68 "Face for spoiler text in threads.") 65 69 66 70 (defface sbbs--uncover-spoiler-face ................................................................................ 461 465 (format "Thread %d: %s" id 462 466 (cdr (assq 'headline thread)))) 463 467 (dolist (post (cadr (assq 'posts thread))) 464 468 (sbbs--thread-insert-post post)) 465 469 (delete-blank-lines) 466 470 (when range 467 471 (sbbs--limit-to-range range)) 468 - (goto-char (point-min))))))) 472 + (if sbbs-open-at-last-post 473 + (sbbs-goto-end) 474 + (goto-char (point-min)))))))) 469 475 470 476 ;; INTERACTIVE FUNCTIONS 471 477 472 478 (defun sbbs-show-all () 473 479 "Show all hidden posts." 474 480 (interactive) 475 481 (sbbs-show-pop -1)) ................................................................................ 649 655 (when (and (eq 'sbbs--post-header-face (get-text-property (point) 'face)) 650 656 (not (get-text-property (point) 'invisible))) 651 657 (throw 'found t))))) 652 658 (beginning-of-line) 653 659 (when sbbs-recenter-to-top 654 660 (set-window-start (selected-window) (point)))) 655 661 662 +(defun sbbs-goto-end () 663 + "Jump to last message in the curren thread." 664 + (interactive) 665 + (goto-char (point-max)) 666 + (let ((sbbs-recenter-to-top nil)) 667 + (sbbs-read-previous 1))) 668 + 656 669 ;;;###autoload 657 670 (defun sbbs-browse (board reload) 658 671 "Open thread overview for BOARD." 659 672 (interactive (list (sbbs-read-board) nil)) 660 673 (let* ((name (format "*browsing /%s/*" (sbbs--board-name board))) 661 674 (url (sbbs--board-url "list" t board))) 662 675 (if (and (get-buffer name) (not reload)) ................................................................................ 699 712 (suppress-keymap map) 700 713 (define-key map (kbd "<tab>") #'forward-button) 701 714 (define-key map (kbd "<backtab>") #'backward-button) 702 715 (define-key map (kbd "r") #'sbbs-read-reply) 703 716 (define-key map (kbd "n") #'sbbs-read-next) 704 717 (define-key map (kbd "p") #'sbbs-read-previous) 705 718 (define-key map (kbd "a") #'sbbs-show-pop) 719 + (define-key map (kbd "u") #'sbbs-show-pop) 720 + (define-key map (kbd "l") #'sbbs-show-pop) 706 721 (define-key map (kbd "A") #'sbbs-show-all) 707 722 (define-key map (kbd "f") #'sbbs-show-replies) 723 + (define-key map (kbd "e") #'sbbs-goto-end) 724 + (define-key map (kbd ">") #'sbbs-goto-end) 708 725 map)) 709 726 710 727 (define-derived-mode sbbs-read-mode special-mode "SchemeBBS Read" 711 728 "Major mode for reading a thread." 712 729 (buffer-disable-undo) 713 730 (visual-line-mode t) 714 731 (setq-local revert-buffer-function #'sbbs--reload-thread)