]> git.eshelyaron.com Git - emacs.git/commitdiff
(rcirc-url-regexp): Replace definition by copying from gnus-button-url-regexp.
authorRichard M. Stallman <rms@gnu.org>
Sun, 10 Feb 2008 14:04:01 +0000 (14:04 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sun, 10 Feb 2008 14:04:01 +0000 (14:04 +0000)
lisp/ChangeLog
lisp/net/rcirc.el

index c1cd83312bc2cb5e8c62c2bdcd637c568d8b8254..9bc3a32df6f0f03b85a8bae8daf16b4c2d238fb1 100644 (file)
@@ -1,3 +1,8 @@
+2008-02-10  \e,AF\e(Bvar Arnfj\e,Av\e(Br\e,Ap\e(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.
index 5bc775b8957a55cd752463d08e84c90140e4225b..d885b05924000508aaae9faa45dcdf7a5865d603 100644 (file)
@@ -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)