* gnus-art.el (gnus-button-handle-info-url)
authorJesper Harder <harder@ifa.au.dk>
Thu, 4 Sep 2003 02:06:05 +0000 (02:06 +0000)
committerJesper Harder <harder@ifa.au.dk>
Thu, 4 Sep 2003 02:06:05 +0000 (02:06 +0000)
(gnus-button-handle-info-url-gnome)
(gnus-button-handle-info-url-kde, gnus-button-alist): Handle GNOME
and KDE style Info URLs.

* gnus-util.el (gnus-url-unhex-string): Don't replace "+" with " ".

lisp/ChangeLog
lisp/gnus-art.el
lisp/gnus-util.el

index db96494..6f9467e 100644 (file)
@@ -1,3 +1,12 @@
+2003-09-04  Jesper Harder  <harder@ifa.au.dk>
+
+       * gnus-art.el (gnus-button-handle-info-url)
+       (gnus-button-handle-info-url-gnome)
+       (gnus-button-handle-info-url-kde, gnus-button-alist): Handle GNOME
+       and KDE style Info URLs.
+
+       * gnus-util.el (gnus-url-unhex-string): Don't replace "+" with " ".
+
 2003-09-02  Jesper Harder  <harder@ifa.au.dk>
 
        * rfc2047.el (rfc2047-fold-region): Don't fold at the beginning
index c92f394..e6d1ee1 100644 (file)
@@ -6056,9 +6056,15 @@ positives are possible."
       gnus-button-ctan-directory-regexp
       "/[-_.a-z0-9]+/[-_./a-z0-9]+[/a-z0-9]\\)")
      1 (>= gnus-button-tex-level 8) gnus-button-handle-ctan 1)
-    ;; This is info
-    ("\\binfo:\\(//\\)?\\([^'\">\n\t ]+\\)"
-     0 (>= gnus-button-emacs-level 1) gnus-button-handle-info-url 2)
+    ;; This is info (home-grown style) <info://foo/bar+baz>
+    ("\\binfo://\\([^'\">\n\t ]+\\)"
+     0 (>= gnus-button-emacs-level 1) gnus-button-handle-info-url 1)
+    ;; Info GNOME style <info:foo#bar_baz>
+    ("\\binfo:\\([^(][^'\n\t\r \"><]*\\)"
+     0 (>= gnus-button-emacs-level 1) gnus-button-handle-info-url-gnome 1)
+    ;; Info KDE style <info:(foo)bar baz>
+    ("<\\(info:\\(([^)]+)[^>\n\r]*\\)\\)>"
+     1 (>= gnus-button-emacs-level 1) gnus-button-handle-info-url-kde 2)
     ("\\((Info-goto-node\\|(info\\)[ \t\n]*\\(\"[^\"]*\"\\))" 0
      (>= gnus-button-emacs-level 1) gnus-button-handle-info-url 2)
     ("\\b\\(C-h\\|<?[Ff]1>?\\)[ \t\n]+i[ \t\n]+d?[ \t\n]?m[ \t\n]+\\([^ ]+ ?[^ ]+\\)[ \t\n]+RET"
@@ -6508,6 +6514,7 @@ specified by `gnus-button-alist'."
 
 (defun gnus-button-handle-info-url (url)
   "Fetch an info URL."
+  (setq url (mm-subst-char-in-string ?+ ?\  url))
   (cond
    ((string-match "^\\([^:/]+\\)?/\\(.*\\)" url)
     (gnus-info-find-node
@@ -6521,6 +6528,24 @@ specified by `gnus-button-alist'."
     (gnus-info-find-node url))
    (t (error "Can't parse %s" url))))
 
+(defun gnus-button-handle-info-url-gnome (url)
+  "Fetch GNOME style info URL."
+  (setq url (mm-subst-char-in-string ?_ ?\  url))
+  (if (string-match "\\([^#]+\\)#?\\(.*\\)" url)
+      (gnus-info-find-node
+       (concat "("
+              (gnus-url-unhex-string 
+                (match-string 1 url))
+              ")"
+              (or (gnus-url-unhex-string 
+                   (match-string 2 url))
+                  "Top")))
+    (error "Can't parse %s" url)))
+
+(defun gnus-button-handle-info-url-kde (url)
+  "Fetch KDE style info URL."
+  (gnus-info-find-node (gnus-url-unhex-string url)))
+
 (defun gnus-button-handle-info-keystrokes (url)
   "Call `info' when pushing the corresponding URL button."
   ;; For links like `C-h i d m gnus RET', `C-h i d m CC Mode RET'.
index 22fad65..45e830a 100644 (file)
@@ -1187,7 +1187,6 @@ If you find some problem with the directory separator character, try
 If optional second argument ALLOW-NEWLINES is non-nil, then allow the
 decoding of carriage returns and line feeds in the string, which is normally
 forbidden in URL encoding."
-  (setq str (or (mm-subst-char-in-string ?+ ?  str) "")) ; why `or'?
   (let ((tmp "")
        (case-fold-search t))
     (while (string-match "%[0-9a-f][0-9a-f]" str)