■掲示板に戻る■ 全部 1- 101- 201- 最新50ナビ兄ちゃん
- 39 :名無λ式 :2001/08/11(土) 04:50
- 泥沼なコードだが、
(setq navi2ch-article-url-regexp
"h?ttps?://\\([-a-zA-Z0-9_=?#$@~`%&*+|\\/.,:]+\\)\\|\\(www\\.[-a-zA-Z0-9_=?#$@~`%&*+|\\/.,:]+\\)")
navi2ch-article.elのnavi2ch-article-set-link-propertyを
(defun navi2ch-article-set-link-property ()
">>1 とか http:// に property を付ける"
(goto-char (point-min))
(while (re-search-forward
navi2ch-article-number-regexp nil t)
(add-text-properties
(match-beginning 0)
(match-end 0)
(list 'face 'navi2ch-article-link-face
'link t
'mouse-face 'highlight
'number (match-string 1))))
(goto-char (point-min))
(goto-char (point-min))
(while (re-search-forward
navi2ch-article-url-regexp nil t)
(add-text-properties
(match-beginning 0)
(match-end 0)
(list 'face 'navi2ch-article-link-face
'link t
'mouse-face 'highlight
'url (concat "http://" (cond ((match-string 1))
(t (match-string 2))))))))
とすればOK。最後のcondの辺りが苦しい。
ついでにhttps:も入れといた。
- 40 :名無λ式 :2001/08/11(土) 04:53
- >>39
コメントつけとくか。
> 'url (concat "http://" (cond ((match-string 1)) ; for h?ttps?:
> (t (match-string 2)))))))) ; for www.
掲示板に戻る 全部 前100 次100 最新50read.cgi ver5.26+ (01/10/21-)