sbbs.el

Check-in [ae851a4d20]
Login
Overview
Comment:Only generate "other" board when link matches regexp Fixes [ed8a04be6b]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256: ae851a4d20809d858475e5893563a3e8326f0b5a3a71ab408b90eba08006d18f
User & Date: zge on 2020-06-06 16:06:18
Other Links: branch diff | manifest | tags
References
2020-06-06
16:09 Fixed ticket [ed8a04be6b]: Error is thrown when rendering some links plus 5 other changes artifact: e8742dc99f user: zge
Context
2020-06-06
16:28
Fix sbbs-compose-format on when region is active See http://textboard.org/prog/81/49 check-in: d5347562aa user: zge tags: master, trunk
16:06
Only generate "other" board when link matches regexp Fixes [ed8a04be6b] check-in: ae851a4d20 user: zge tags: master, trunk
2020-06-05
21:38
Use Shift-JIS font for text if installed check-in: 5ffdf5dd20 user: zge tags: master, trunk
Changes

Modified sbbs.el from [47b32ff1b0] to [676c904eb1].

240
241
242
243
244
245
246
247
248
249
250
251




252
253
254
255
256
257
258
259
260
261
262
263
264
(defun sbbs--insert-link (text link)
  "Insert link to LINK as TEXT into buffer.

If LINK is a (board, thread or site) local link, modify opening
behaviour accordingly."
  (save-match-data
    (let ((match (string-match sbbs--link-regexp link))
          range id)
      (when match
        (when (match-string 4 link)
          (setq range (sbbs--parse-number-range (match-string 4 link) 300)))
        (setq id (string-to-number (match-string 3 link))))




      (let* ((board sbbs--board)
             (domain (sbbs--board-domain board))
             (name (sbbs--board-name board))
             (other (sbbs-make-board (match-string 1 link)
                                     (match-string 2 link)
                                     (string-match-p "\\`https://" link)))
             (func (lambda (&optional _)
                     (cond ((not match) (browse-url link))
                           ;; other supported board
                           ((or (and (sbbs--board-domain other)
                                     (not (string= (sbbs--board-domain other)
                                                   domain)))
                                (not (string= name (sbbs--board-name other))))







|



|
>
>
>
>



<
<
<







240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258



259
260
261
262
263
264
265
(defun sbbs--insert-link (text link)
  "Insert link to LINK as TEXT into buffer.

If LINK is a (board, thread or site) local link, modify opening
behaviour accordingly."
  (save-match-data
    (let ((match (string-match sbbs--link-regexp link))
          range id other)
      (when match
        (when (match-string 4 link)
          (setq range (sbbs--parse-number-range (match-string 4 link) 300)))
        (setq id (string-to-number (match-string 3 link)))
        (setq other (sbbs-make-board
                     (match-string 1 link)
                     (match-string 2 link)
                     (string-match-p "\\`https://" link))))
      (let* ((board sbbs--board)
             (domain (sbbs--board-domain board))
             (name (sbbs--board-name board))



             (func (lambda (&optional _)
                     (cond ((not match) (browse-url link))
                           ;; other supported board
                           ((or (and (sbbs--board-domain other)
                                     (not (string= (sbbs--board-domain other)
                                                   domain)))
                                (not (string= name (sbbs--board-name other))))