Differences From
Artifact [a7ead60032]:
36 36 (defgroup sbbs nil
37 37 "SchemeBBS client."
38 38 :group 'applications
39 39 :prefix "sbbs-")
40 40
41 41 (defcustom sbbs-boards
42 42 '(("textboard.org" ("sol" "prog") t)
43 - ("bbs.jp.net" ("mona") t))
43 + ("bbs.jp.net" (("mona" . "")) t))
44 44 "List of SchemeBBS sites and boards."
45 45 :type '(repeat (list (string :tag "Board Domain")
46 - (repeat (string :tag "Board Name"))
46 + (repeat (or (string :tag "Board Name")
47 + (cons (string :tag "Board Name")
48 + (string :tag "API Path"))))
47 49 (boolean :tag "Use TLS?"))))
48 50
49 51 (defcustom sbbs-default-board nil
50 52 "Jump to first link after narrowing posts."
51 53 :type '(choice (const :tag "None" nil)
52 54 (cons (string :tag "Board Domain")
53 55 (string :tag "Board Name"))))
................................................................................
128 130
129 131 (defsubst sbbs--board-domain (board)
130 132 "Get domain part of a BOARD object."
131 133 (aref board 0))
132 134
133 135 (defsubst sbbs--board-name (board)
134 136 "Get board name part of a BOARD object."
135 - (aref board 1))
137 + (let ((name (aref board 1)))
138 + (if (consp name) (car name) name)))
139 +
140 +(defsubst sbbs--board-api (board)
141 + "Get board name part of a BOARD object."
142 + (let ((name (aref board 1)))
143 + (if (consp name) (cdr name) name)))
136 144
137 145 (defsubst sbbs--board-protocol (board)
138 146 "Determine protocol to be used for BOARD object."
139 147 (if (aref board 2) "https" "http"))
140 148
141 149 (defun sbbs--board-url (&optional path api-p board)
142 150 "Generate URL for BOARD to access PATH.
................................................................................
143 151
144 152 If API-P is non-nil, prefix path with \"sexp\"."
145 153 (let ((board (or board sbbs--board)))
146 154 (format "%s://%s/%s%s/%s"
147 155 (sbbs--board-protocol board)
148 156 (sbbs--board-domain board)
149 157 (if api-p "sexp/" "")
150 - (sbbs--board-name board)
158 + (if api-p
159 + (sbbs--board-api board)
160 + (sbbs--board-name board))
151 161 (or path ""))))
152 162
153 163 (defun sbbs--list-boards ()
154 164 "Return a list of known board objects."
155 165 (let (boards)
156 166 (dolist (ent sbbs-boards)
157 167 (dolist (board (cadr ent))