unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
Cc: bug-gnu-emacs@gnu.org
Subject: Re: browse-url does not allow url with a dollar sign
Date: Fri, 27 Feb 2004 04:11:52 +0200	[thread overview]
Message-ID: <87n075p8yg.fsf@mail.jurta.org> (raw)
In-Reply-To: <20040226101410.805BE1337C@ate.maierh> (Harald Maier's message of "Thu, 26 Feb 2004 11:14:10 +0100 (CET)")

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/

  reply	other threads:[~2004-02-27  2:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-26 10:14 browse-url does not allow url with a dollar sign Harald Maier
2004-02-27  2:11 ` Juri Linkov [this message]
     [not found]   ` <87r7wbigo9.fsf@mail.jurta.org>
2004-03-02 12:32     ` Harald Maier
     [not found] <mailman.559.1077790489.340.bug-gnu-emacs@gnu.org>
2004-02-26 17:59 ` Kevin Rodgers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87n075p8yg.fsf@mail.jurta.org \
    --to=juri@jurta.org \
    --cc=bug-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).