Use browse-url-button-regexp for rcirc-url-regexp
* rcirc.el (rcirc-url-regexp): Copy improved regexp from browse-url
This commit is contained in:
parent
9ed53b022d
commit
9b1adf8b4f
1 changed files with 3 additions and 18 deletions
|
@ -2827,24 +2827,9 @@ keywords when no KEYWORD is given."
|
||||||
string))
|
string))
|
||||||
|
|
||||||
(defvar rcirc-url-regexp
|
(defvar rcirc-url-regexp
|
||||||
(concat
|
(eval-when-compile
|
||||||
"\\b\\(\\(www\\.\\|\\(s?https?\\|ftp\\|file\\|gopher\\|"
|
(require 'browse-url)
|
||||||
"nntp\\|news\\|telnet\\|wais\\|mailto\\|info\\):\\)"
|
browse-url-button-regexp)
|
||||||
"\\(//[-a-z0-9_.]+:[0-9]*\\)?"
|
|
||||||
(if (string-match "[[:digit:]]" "1") ;; Support POSIX?
|
|
||||||
(let ((chars "-a-z0-9_=#$@~%&*+\\/[:word:]")
|
|
||||||
(punct "!?:;.,"))
|
|
||||||
(concat
|
|
||||||
"\\(?:"
|
|
||||||
;; Match paired parentheses, e.g. in Wikipedia URLs:
|
|
||||||
"[" chars punct "]+" "(" "[" chars punct "]+" ")" "[" chars "]"
|
|
||||||
"\\|"
|
|
||||||
"[" chars punct "]+" "[" chars "]"
|
|
||||||
"\\)"))
|
|
||||||
(concat ;; XEmacs 21.4 doesn't support POSIX.
|
|
||||||
"\\([-a-z0-9_=!?#$@~%&*+\\/:;.,]\\|\\w\\)+"
|
|
||||||
"\\([-a-z0-9_=#$@~%&*+\\/]\\|\\w\\)"))
|
|
||||||
"\\)")
|
|
||||||
"Regexp matching URLs. Set to nil to disable URL features in rcirc.")
|
"Regexp matching URLs. Set to nil to disable URL features in rcirc.")
|
||||||
|
|
||||||
;; cf cl-remove-if-not
|
;; cf cl-remove-if-not
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue