sbbs.el

Check-in [d0b75dd168]
Login
Overview
Comment:Fix /mona/
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256: d0b75dd1686363ec1b86f1419218a08b295d37e328df9575abc6c5ad10dce616
User & Date: zge on 2022-01-24 09:11:58
Other Links: branch diff | manifest | tags
References
2022-01-24
09:16
Fix type update from [d0b75dd168] check-in: c6c6a90cab user: zge tags: master, trunk
Context
2022-01-24
09:12
Fix typo in sbbs--thread-loader's Scheme->Elisp translation check-in: c0938f9005 user: zge tags: master, trunk
09:11
Fix /mona/ check-in: d0b75dd168 user: zge tags: master, trunk
2022-01-22
18:57
Kill thread buffers when quitting board buffer check-in: a3e4eb41e0 user: zge tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Modified sbbs.el from [a7ead60032] to [490ff2e445].

36
37
38
39
40
41
42
43
44
45

46

47
48
49
50
51
52
53
...
128
129
130
131
132
133
134
135






136
137
138
139
140
141
142
...
143
144
145
146
147
148
149


150
151
152
153
154
155
156
157
(defgroup sbbs nil
  "SchemeBBS client."
  :group 'applications
  :prefix "sbbs-")

(defcustom sbbs-boards
  '(("textboard.org" ("sol" "prog") t)
    ("bbs.jp.net" ("mona") t))
  "List of SchemeBBS sites and boards."
  :type '(repeat (list (string :tag "Board Domain")

                       (repeat (string :tag "Board Name"))

                       (boolean :tag "Use TLS?"))))

(defcustom sbbs-default-board nil
  "Jump to first link after narrowing posts."
  :type '(choice (const :tag "None" nil)
                 (cons (string :tag "Board Domain")
                       (string :tag "Board Name"))))
................................................................................

(defsubst sbbs--board-domain (board)
  "Get domain part of a BOARD object."
  (aref board 0))

(defsubst sbbs--board-name (board)
  "Get board name part of a BOARD object."
  (aref board 1))







(defsubst sbbs--board-protocol (board)
  "Determine protocol to be used for BOARD object."
  (if (aref board 2) "https" "http"))

(defun sbbs--board-url (&optional path api-p board)
  "Generate URL for BOARD to access PATH.
................................................................................

If API-P is non-nil, prefix path with \"sexp\"."
  (let ((board (or board sbbs--board)))
    (format "%s://%s/%s%s/%s"
            (sbbs--board-protocol board)
            (sbbs--board-domain board)
            (if api-p "sexp/" "")


            (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))







|


>
|
>







 







|
>
>
>
>
>
>







 







>
>
|







36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
...
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
...
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
(defgroup sbbs nil
  "SchemeBBS client."
  :group 'applications
  :prefix "sbbs-")

(defcustom sbbs-boards
  '(("textboard.org" ("sol" "prog") t)
    ("bbs.jp.net" (("mona" . "")) t))
  "List of SchemeBBS sites and boards."
  :type '(repeat (list (string :tag "Board Domain")
                       (repeat (or (string :tag "Board Name")
                                   (cons (string :tag "Board Name")
                                         (string :tag "API Path"))))
                       (boolean :tag "Use TLS?"))))

(defcustom sbbs-default-board nil
  "Jump to first link after narrowing posts."
  :type '(choice (const :tag "None" nil)
                 (cons (string :tag "Board Domain")
                       (string :tag "Board Name"))))
................................................................................

(defsubst sbbs--board-domain (board)
  "Get domain part of a BOARD object."
  (aref board 0))

(defsubst sbbs--board-name (board)
  "Get board name part of a BOARD object."
  (let ((name (aref board 1)))
    (if (consp name) (car name) name)))

(defsubst sbbs--board-api (board)
  "Get board name part of a BOARD object."
  (let ((name (aref board 1)))
    (if (consp name) (cdr name) name)))

(defsubst sbbs--board-protocol (board)
  "Determine protocol to be used for BOARD object."
  (if (aref board 2) "https" "http"))

(defun sbbs--board-url (&optional path api-p board)
  "Generate URL for BOARD to access PATH.
................................................................................

If API-P is non-nil, prefix path with \"sexp\"."
  (let ((board (or board sbbs--board)))
    (format "%s://%s/%s%s/%s"
            (sbbs--board-protocol board)
            (sbbs--board-domain board)
            (if api-p "sexp/" "")
            (if api-p
                (sbbs--board-api board)
              (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))