sbbs.el

Diff
Login

Differences From Artifact [47b32ff1b0]:

To Artifact [676c904eb1]:


   240    240   (defun sbbs--insert-link (text link)
   241    241     "Insert link to LINK as TEXT into buffer.
   242    242   
   243    243   If LINK is a (board, thread or site) local link, modify opening
   244    244   behaviour accordingly."
   245    245     (save-match-data
   246    246       (let ((match (string-match sbbs--link-regexp link))
   247         -          range id)
          247  +          range id other)
   248    248         (when match
   249    249           (when (match-string 4 link)
   250    250             (setq range (sbbs--parse-number-range (match-string 4 link) 300)))
   251         -        (setq id (string-to-number (match-string 3 link))))
          251  +        (setq id (string-to-number (match-string 3 link)))
          252  +        (setq other (sbbs-make-board
          253  +                     (match-string 1 link)
          254  +                     (match-string 2 link)
          255  +                     (string-match-p "\\`https://" link))))
   252    256         (let* ((board sbbs--board)
   253    257                (domain (sbbs--board-domain board))
   254    258                (name (sbbs--board-name board))
   255         -             (other (sbbs-make-board (match-string 1 link)
   256         -                                     (match-string 2 link)
   257         -                                     (string-match-p "\\`https://" link)))
   258    259                (func (lambda (&optional _)
   259    260                        (cond ((not match) (browse-url link))
   260    261                              ;; other supported board
   261    262                              ((or (and (sbbs--board-domain other)
   262    263                                        (not (string= (sbbs--board-domain other)
   263    264                                                      domain)))
   264    265                                   (not (string= name (sbbs--board-name other))))