Index: sbbs.el ================================================================== --- sbbs.el +++ sbbs.el @@ -55,10 +55,14 @@ :type 'boolean) (defcustom sbbs-recenter-to-top t "Move point to top of frame when moving through posts." :type 'boolean) + +(defcustom sbbs-open-at-last-post t + "Jump to last post in a thread when opening a thread." + :type 'boolean) (defface sbbs--spoiler-face '((((background light)) :background "black" :foreground "black") (((background dark)) :background "white" :foreground "white")) "Face for spoiler text in threads.") @@ -463,11 +467,13 @@ (dolist (post (cadr (assq 'posts thread))) (sbbs--thread-insert-post post)) (delete-blank-lines) (when range (sbbs--limit-to-range range)) - (goto-char (point-min))))))) + (if sbbs-open-at-last-post + (sbbs-goto-end) + (goto-char (point-min)))))))) ;; INTERACTIVE FUNCTIONS (defun sbbs-show-all () "Show all hidden posts." @@ -651,10 +657,17 @@ (throw 'found t))))) (beginning-of-line) (when sbbs-recenter-to-top (set-window-start (selected-window) (point)))) +(defun sbbs-goto-end () + "Jump to last message in the curren thread." + (interactive) + (goto-char (point-max)) + (let ((sbbs-recenter-to-top nil)) + (sbbs-read-previous 1))) + ;;;###autoload (defun sbbs-browse (board reload) "Open thread overview for BOARD." (interactive (list (sbbs-read-board) nil)) (let* ((name (format "*browsing /%s/*" (sbbs--board-name board))) @@ -701,12 +714,16 @@ (define-key map (kbd "") #'backward-button) (define-key map (kbd "r") #'sbbs-read-reply) (define-key map (kbd "n") #'sbbs-read-next) (define-key map (kbd "p") #'sbbs-read-previous) (define-key map (kbd "a") #'sbbs-show-pop) + (define-key map (kbd "u") #'sbbs-show-pop) + (define-key map (kbd "l") #'sbbs-show-pop) (define-key map (kbd "A") #'sbbs-show-all) (define-key map (kbd "f") #'sbbs-show-replies) + (define-key map (kbd "e") #'sbbs-goto-end) + (define-key map (kbd ">") #'sbbs-goto-end) map)) (define-derived-mode sbbs-read-mode special-mode "SchemeBBS Read" "Major mode for reading a thread." (buffer-disable-undo)