@@ -137,8 +137,9 @@ (sbbs--board-name board) (or path "")))) (defun sbbs--list-boards () + "Return a list of known board objects." (let (boards) (dolist (ent sbbs-boards) (dolist (board (cadr ent)) (push (sbbs-make-board (car ent) board (caddr ent)) @@ -198,9 +199,9 @@ (number-sequence (string-to-number (match-string 1 range)) (min limit (string-to-number (match-string 2 range))))) ((string-match "\\`\\([[:digit:]]+\\)\\'" range) (list (string-to-number (match-string 1 range)))) - (t (error "invalid range")))) + (t (error "Invalid range")))) (split-string desc ","))))) (defun sbbs--read-jump-to (nr) "Set point to first character of post with number NR." @@ -362,9 +363,9 @@ (sbbs--insert-sxml (cdr (assq 'content (cdr post)))) (add-text-properties start (point) (list 'sbbs-thread-nr (car post))))) (defun sbbs--uncover-spoiler () - "" + "Uncover or cover a spoiler, depending on the point." (cond ((eq (get-text-property (point) 'face) 'sbbs--spoiler-face) (let* ((start (previous-property-change (1+ (point)))) (end (next-property-change (point))) (o (make-overlay start end (current-buffer) t t))) @@ -387,9 +388,9 @@ (while (search-forward-regexp ;; rx generates a multibyte string, that confuses ;; search-forward-regexp, therefore the regexp literal ;; here - "[\x80-\xff]\\(\\(?:\\\\[0-7]\\{3\\}\\)+\\)" + "[\x80-\xff]\\(\\(?:\\\\[0-7]\\{3\\}\\)+\\)" nil t) (let (new) (goto-char (match-beginning 1)) (while (< (point) (match-end 1)) @@ -407,9 +408,9 @@ (defun sbbs--board-loader (status buf) "Callback function for `url-retrieve' when loading board. -Load results into buffer BUF. STATUS is used to check for +Load results into buffer BUF. STATUS is used to check for errors." (when (buffer-live-p buf) (when (plist-get status :error) (error "Error while loading: %s" @@ -437,9 +438,9 @@ (defun sbbs--thread-loader (status id buf range) "Callback function for `url-retrieve' when loading thread. The attribute ID determines what thread from board BOARD to -load. STATUS is used to check for errors." +load. STATUS is used to check for errors." (when (buffer-live-p buf) (when (plist-get status :error) (error "Error while loading: %s" (cdr (plist-get status :error)))) @@ -482,9 +483,9 @@ (defun sbbs-show-pop (&optional n) "Show all hidden posts. -A prefix argument N, repeats this N times. If negative or zero, +A prefix argument N, repeats this N times. If negative or zero, pop all the way up." (interactive "P") (let ((n (or n 1))) (unless sbbs--limit-stack @@ -509,9 +510,11 @@ (sbbs--limit-to-range range) (message "No posts referencing %d" nr)))) (defun sbbs-view-open (id &optional range) - "Open thread ID in new buffer." + "Open thread ID in new buffer. +If RANGE is nil, display all posts. If range is a list, display +only those posts designated by RANGE." (interactive (list (tabulated-list-get-id))) (let ((url (sbbs--board-url (format "/%d" id) t)) (headline (or (and (not (tabulated-list-get-entry)) header-line-format) @@ -598,8 +601,9 @@ (interactive) (sbbs-compose-format "~~")) (defun sbbs-compose-unformat () + "Remove formatting from point." (interactive) (when (search-backward-regexp "\\(\\*\\*\\|==\\|__\\|~~\\)" nil t) (looking-at (concat "\\(" (regexp-quote (match-string 1)) "\\).*?" "\\(" (regexp-quote (match-string 1)) "\\)")) @@ -667,10 +671,11 @@ (sbbs-read-previous 1))) ;;;###autoload (defun sbbs-browse (board reload) - "Open thread overview for BOARD." - (interactive (list (sbbs-read-board) nil)) + "Open thread overview for BOARD. +If RELOAD is non-nil, force-reloading the board." + (interactive (list (sbbs-read-board) current-prefix-arg)) (let* ((name (format "*browsing /%s/*" (sbbs--board-name board))) (url (sbbs--board-url "list" t board))) (if (and (get-buffer name) (not reload)) (progn (switch-to-buffer name) @@ -760,9 +765,9 @@ (">>\\([[:digit:]]+\\(?:-[[:digit:]]+\\)?\\(?:,[[:digit:]]+\\(?:-[[:digit:]]+\\)?\\)*\\)" . 'link) ;; quotes ("^>.*" . font-lock-comment-face)) - "Highlighting for SchemeBBS posts") + "Highlighting for SchemeBBS posts.") (define-derived-mode sbbs-compose-mode text-mode "SchemeBBS Compose" "Major mode for composing replies and starting new threads." (setq-local comment-start ">")