@@ -56,8 +56,12 @@ (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")) @@ -464,9 +468,11 @@ (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 () @@ -652,8 +658,15 @@ (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)) @@ -702,10 +715,14 @@ (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."