summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Kaludercic <philipk@posteo.net>2021-10-13 21:49:28 +0200
committerPhilip Kaludercic <philipk@posteo.net>2021-10-13 21:49:28 +0200
commit9b1adf8b4feaf92f5229839edfe42fe89ceba677 (patch)
treeb1301990b72134522cc4ac59bf756d287d5c99c8
parent9ed53b022db7df2d027a82af6897ea8ac977664b (diff)
downloademacs-9b1adf8b4feaf92f5229839edfe42fe89ceba677.tar.gz
emacs-9b1adf8b4feaf92f5229839edfe42fe89ceba677.tar.bz2
emacs-9b1adf8b4feaf92f5229839edfe42fe89ceba677.zip
Use browse-url-button-regexp for rcirc-url-regexp
* rcirc.el (rcirc-url-regexp): Copy improved regexp from browse-url
-rw-r--r--lisp/net/rcirc.el21
1 files changed, 3 insertions, 18 deletions
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index c18748ae099..52d74a33945 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -2827,24 +2827,9 @@ keywords when no KEYWORD is given."
string))
(defvar rcirc-url-regexp
- (concat
- "\\b\\(\\(www\\.\\|\\(s?https?\\|ftp\\|file\\|gopher\\|"
- "nntp\\|news\\|telnet\\|wais\\|mailto\\|info\\):\\)"
- "\\(//[-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\\)"))
- "\\)")
+ (eval-when-compile
+ (require 'browse-url)
+ browse-url-button-regexp)
"Regexp matching URLs. Set to nil to disable URL features in rcirc.")
;; cf cl-remove-if-not