* Re: browse-url does not allow url with a dollar sign
2004-02-26 10:14 browse-url does not allow url with a dollar sign Harald Maier
@ 2004-02-27 2:11 ` Juri Linkov
[not found] ` <87r7wbigo9.fsf@mail.jurta.org>
0 siblings, 1 reply; 4+ messages in thread
From: Juri Linkov @ 2004-02-27 2:11 UTC (permalink / raw)
Cc: bug-gnu-emacs
Harald Maier <harald@maierh.de> writes:
> Start emacs with 'emacs -q'. Put into the *scratch* buffer the following line:
>
> http://www.warentest.de/pls/sw/SW$NAV.Startup?p_KNR=0&p_E1=2&p_E2=0&p_E3=50&p_E4=0&p_Inh=I:1162925
>
> Place point to the url and then type in the following function:
>
> M-x browse-url-at-point
>
> The browser program receives as url the following string:
>
> http://www.warentest.de/pls/sw/SW.Startup?p_KNR=0&p_E1=2&p_E2=0&p_E3=50&p_E4=0&p_Inh=I:1162925
Even if you said you started emacs with 'emacs -q', I don't know what
default browser you use. A suitable browser is selected by attempting
in this order: gnome-moz-remote, Mozilla, Galeon, Netscape, Mosaic,
IXI Mosaic, Lynx in an xterm, MMM, Konqueror, W3. It seems that
you are using a Mozilla-based browser. It substitutes environment
variables references even when they are quoted in the program arguments.
So, the dollar sign '$' in the url needs to be encoded in browse-url.el.
Index: emacs/lisp/net/browse-url.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/net/browse-url.el,v
retrieving revision 1.32
diff -c -r1.32 browse-url.el
*** emacs/lisp/net/browse-url.el 1 Sep 2003 15:45:33 -0000 1.32
--- emacs/lisp/net/browse-url.el 27 Feb 2004 01:38:23 -0000
***************
*** 818,825 ****
used instead of `browse-url-new-window-flag'."
(interactive (browse-url-interactive-arg "URL: "))
;; URL encode any `confusing' characters in the URL. This needs to
! ;; include at least commas; presumably also close parens.
! (while (string-match "[,)]" url)
(setq url (replace-match
(format "%%%x" (string-to-char (match-string 0 url))) t t url)))
(let* ((process-environment (browse-url-process-environment))
--- 818,825 ----
used instead of `browse-url-new-window-flag'."
(interactive (browse-url-interactive-arg "URL: "))
;; URL encode any `confusing' characters in the URL. This needs to
! ;; include at least commas; presumably also close parens and dollars.
! (while (string-match "[,)$]" url)
(setq url (replace-match
(format "%%%x" (string-to-char (match-string 0 url))) t t url)))
(let* ((process-environment (browse-url-process-environment))
***************
*** 889,896 ****
used instead of `browse-url-new-window-flag'."
(interactive (browse-url-interactive-arg "URL: "))
;; URL encode any `confusing' characters in the URL. This needs to
! ;; include at least commas; presumably also close parens.
! (while (string-match "[,)]" url)
(setq url (replace-match
(format "%%%x" (string-to-char (match-string 0 url))) t t url)))
(let* ((process-environment (browse-url-process-environment))
--- 889,896 ----
used instead of `browse-url-new-window-flag'."
(interactive (browse-url-interactive-arg "URL: "))
;; URL encode any `confusing' characters in the URL. This needs to
! ;; include at least commas; presumably also close parens and dollars.
! (while (string-match "[,)$]" url)
(setq url (replace-match
(format "%%%x" (string-to-char (match-string 0 url))) t t url)))
(let* ((process-environment (browse-url-process-environment))
***************
*** 942,949 ****
used instead of `browse-url-new-window-flag'."
(interactive (browse-url-interactive-arg "URL: "))
;; URL encode any `confusing' characters in the URL. This needs to
! ;; include at least commas; presumably also close parens.
! (while (string-match "[,)]" url)
(setq url (replace-match
(format "%%%x" (string-to-char (match-string 0 url))) t t url)))
(let* ((process-environment (browse-url-process-environment))
--- 942,949 ----
used instead of `browse-url-new-window-flag'."
(interactive (browse-url-interactive-arg "URL: "))
;; URL encode any `confusing' characters in the URL. This needs to
! ;; include at least commas; presumably also close parens and dollars.
! (while (string-match "[,)$]" url)
(setq url (replace-match
(format "%%%x" (string-to-char (match-string 0 url))) t t url)))
(let* ((process-environment (browse-url-process-environment))
***************
*** 991,998 ****
used instead of `browse-url-new-window-flag'."
(interactive (browse-url-interactive-arg "URL: "))
;; URL encode any `confusing' characters in the URL. This needs to
! ;; include at least commas; presumably also close parens.
! (while (string-match "[,)]" url)
(setq url (replace-match
(format "%%%x" (string-to-char (match-string 0 url))) t t url)))
(let* ((process-environment (browse-url-process-environment))
--- 991,998 ----
used instead of `browse-url-new-window-flag'."
(interactive (browse-url-interactive-arg "URL: "))
;; URL encode any `confusing' characters in the URL. This needs to
! ;; include at least commas; presumably also close parens and dollars.
! (while (string-match "[,)$]" url)
(setq url (replace-match
(format "%%%x" (string-to-char (match-string 0 url))) t t url)))
(let* ((process-environment (browse-url-process-environment))
--
http://www.jurta.org/emacs/
^ permalink raw reply [flat|nested] 4+ messages in thread