Differences From
Artifact [f9185109d4]:
26 26 (require 'text-property-search)
27 27 (require 'tabulated-list)
28 28 (require 'button)
29 29 (require 'url)
30 30 (require 'hl-line)
31 31 (require 'rx)
32 32
33 - ;; CUSTOMIZABLE DATA
33 +
34 +;;; CUSTOMIZABLE DATA
34 35
35 36 (defgroup sbbs nil
36 37 "SchemeBBS client."
37 38 :group 'applications
38 39 :prefix "sbbs-")
39 40
40 41 (defcustom sbbs-boards
................................................................................
91 92 "Face for code blocks in threads.")
92 93
93 94 (defface sbbs--post-header-face
94 95 '((nil :extend t
95 96 :inherit highlight))
96 97 "Face for post headers in the thread view.")
97 98
98 - ;; VARIABLES
99 +
100 +;;; VARIABLES
99 101
100 102 (defvar-local sbbs--board nil
101 103 "Buffer local reference to current board.
102 104
103 105 See `sbbs-make-board'.")
104 106
105 107 (defvar-local sbbs--thread-id nil
................................................................................
109 111
110 112 (defvar-local sbbs--limit-stack nil
111 113 "Stack of last limit specs.")
112 114
113 115 (defvar-local sbbs--last-spoiler nil
114 116 "Point of last spoiler visited.")
115 117
116 - ;; BOARD OBJECT AND FUNCTIONS
118 +
119 +;;; BOARD OBJECT AND FUNCTIONS
117 120
118 121 (defun sbbs-make-board (domain name &optional tls)
119 122 "Create board object, using DOMAIN, NAME and TLS flag."
120 123 (vector domain name tls))
121 124
122 125 (defsubst sbbs--board-domain (board)
123 126 "Get domain part of a BOARD object."
................................................................................
177 180 (sbbs--board-name def))
178 181 "Board: ")
179 182 boards nil t "/" nil def)))
180 183 (if (stringp choice)
181 184 (cdr (assoc choice boards))
182 185 choice))))
183 186
184 - ;; UTILITY FUNCTIONS
187 +
188 +;;; UTILITY FUNCTIONS
185 189
186 190 (defun sbbs--reload-thread (&optional _ignore-auto _noconfirm)
187 191 "Function to reload an opened thread."
188 192 (when sbbs--thread-id (sbbs-view-open sbbs--thread-id)))
189 193
190 194 (defun sbbs--reload-board ()
191 195 "Function to regenerate thread index.
................................................................................
220 224 ((> nr current) (setq up (point))))))
221 225 (unless (and (eq 'highlight (get-text-property (point) 'face))
222 226 (looking-at-p "\\`#[[:digit:]]+"))
223 227 ;; in case we are on the first character of a post, we shouldn't
224 228 ;; jump back, since that would mean setting to point to NR-1.
225 229 (sbbs-read-previous 1)))
226 230
227 - ;; UI GENERATOR
231 +
232 +;;; UI GENERATOR
228 233
229 234 (defconst sbbs--link-regexp
230 235 (rx-to-string
231 236 `(: bos
232 237 (or (: "/" (group-n 2 (+ alnum))
233 238 "/" (group-n 3 (+ digit))
234 239 "/" (group-n 4 (: (+ digit) (? "-" (+ digit)))
................................................................................
403 408 (setq sbbs--last-spoiler (point)))
404 409 (sbbs--last-spoiler
405 410 (dolist (o (overlays-at sbbs--last-spoiler))
406 411 (when (overlay-get o 'sbbs-uncover-p)
407 412 (delete-overlay o)))
408 413 (setq sbbs--last-spoiler nil))))
409 414
410 - ;; URL.EL CALLBACKS
415 +
416 +;;; URL.EL CALLBACKS
411 417
412 418 (defun sbbs--fix-encoding ()
413 419 "Convert the raw response after point to utf-8."
414 420 (save-excursion
415 421 ;; see http://textboard.org/prog/39/263
416 422 (set-buffer-multibyte nil)
417 423 (while (search-forward-regexp
................................................................................
499 505 (delete-blank-lines)
500 506 (when range
501 507 (sbbs--limit-to-range range))
502 508 (if sbbs-open-at-last-post
503 509 (sbbs-goto-end)
504 510 (goto-char (point-min))))))))
505 511
506 - ;; INTERACTIVE FUNCTIONS
512 +
513 +;;; INTERACTIVE FUNCTIONS
507 514
508 515 (defun sbbs-show-all ()
509 516 "Show all hidden posts."
510 517 (interactive)
511 518 (sbbs-show-pop -1))
512 519
513 520 (defun sbbs-show-pop (&optional n)
................................................................................
715 722 (url-retrieve url #'sbbs--board-loader
716 723 (list (current-buffer)))
717 724 (switch-to-buffer (current-buffer))))))
718 725
719 726 ;;;###autoload
720 727 (defalias 'sbbs #'sbbs-browse)
721 728
722 - ;; MAJOR MODES
729 +
730 +;;; MAJOR MODES
723 731
724 732 (defvar sbbs-view-mode-map
725 733 (let ((map (make-sparse-keymap)))
726 734 (define-key map (kbd "RET") #'sbbs-view-open)
727 735 (define-key map (kbd "c") #'sbbs-view-compose)
728 736 map))
729 737