diff options
author | Richard M. Stallman <rms@gnu.org> | 2008-02-10 14:04:01 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 2008-02-10 14:04:01 +0000 |
commit | 73dd622fb4648ce267acbaa15e1b57d64ddedb9f (patch) | |
tree | 6ddb99febf5f3a9d5728a990fb8c63b67fc82fb9 | |
parent | 4ff718fbc02c7efc835603fd08e59187afa11d98 (diff) | |
download | emacs-73dd622fb4648ce267acbaa15e1b57d64ddedb9f.tar.gz |
(rcirc-url-regexp): Replace definition by copying from gnus-button-url-regexp.
-rw-r--r-- | lisp/ChangeLog | 5 | ||||
-rw-r--r-- | lisp/net/rcirc.el | 35 |
2 files changed, 23 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c1cd83312bc..9bc3a32df6f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2008-02-10 ,AF(Bvar Arnfj,Av(Br,Ap(B Bjarmason <avar@cpan.org> (tiny change) + + * net/rcirc.el (rcirc-url-regexp): Replace definition by copying + from gnus-button-url-regexp. + 2008-02-09 Eli Zaretskii <eliz@gnu.org> * progmodes/compile.el (compilation-next-error): Doc fix. diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 5bc775b8957..d885b059240 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -1887,23 +1887,24 @@ keywords when no KEYWORD is given." string)) (defvar rcirc-url-regexp - (rx-to-string - `(and word-boundary - (or (and - (or (and (or "http" "https" "ftp" "file" "gopher" "news" - "telnet" "wais" "mailto") - "://") - "www.") - (1+ (char "-a-zA-Z0-9_.")) - (1+ (char "-a-zA-Z0-9_")) - (optional ":" (1+ (char "0-9")))) - (and (1+ (char "-a-zA-Z0-9_.")) - (or ".com" ".net" ".org") - word-boundary)) - (optional - (and "/" - (1+ (char "-a-zA-Z0-9_=!?#$\@~`%&*+|\\/:;.,{}[]()")) - (char "-a-zA-Z0-9_=#$\@~`%&*+|\\/:;{}[]()"))))) + (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 "]" + "\\|" + "[" 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.") (defun rcirc-browse-url (&optional arg) |