Mercurial > emacs
comparison lisp/net/browse-url.el @ 54237:c29ef88b691f
(browse-url-netscape, browse-url-mozilla, browse-url-galeon,
browse-url-epiphany): Encode dollar signs in URL to prevent their
substitution with the environment variable values by browsers.
author | Juri Linkov <juri@jurta.org> |
---|---|
date | Tue, 02 Mar 2004 14:55:32 +0000 |
parents | 695cf19ef79e |
children | c53b285fdf88 |
comparison
equal
deleted
inserted
replaced
54236:418982e727f9 | 54237:c29ef88b691f |
---|---|
816 | 816 |
817 When called non-interactively, optional second argument NEW-WINDOW is | 817 When called non-interactively, optional second argument NEW-WINDOW is |
818 used instead of `browse-url-new-window-flag'." | 818 used instead of `browse-url-new-window-flag'." |
819 (interactive (browse-url-interactive-arg "URL: ")) | 819 (interactive (browse-url-interactive-arg "URL: ")) |
820 ;; URL encode any `confusing' characters in the URL. This needs to | 820 ;; URL encode any `confusing' characters in the URL. This needs to |
821 ;; include at least commas; presumably also close parens. | 821 ;; include at least commas; presumably also close parens and dollars. |
822 (while (string-match "[,)]" url) | 822 (while (string-match "[,)$]" url) |
823 (setq url (replace-match | 823 (setq url (replace-match |
824 (format "%%%x" (string-to-char (match-string 0 url))) t t url))) | 824 (format "%%%x" (string-to-char (match-string 0 url))) t t url))) |
825 (let* ((process-environment (browse-url-process-environment)) | 825 (let* ((process-environment (browse-url-process-environment)) |
826 (process (apply 'start-process | 826 (process (apply 'start-process |
827 (concat "netscape " url) nil | 827 (concat "netscape " url) nil |
887 | 887 |
888 When called non-interactively, optional second argument NEW-WINDOW is | 888 When called non-interactively, optional second argument NEW-WINDOW is |
889 used instead of `browse-url-new-window-flag'." | 889 used instead of `browse-url-new-window-flag'." |
890 (interactive (browse-url-interactive-arg "URL: ")) | 890 (interactive (browse-url-interactive-arg "URL: ")) |
891 ;; URL encode any `confusing' characters in the URL. This needs to | 891 ;; URL encode any `confusing' characters in the URL. This needs to |
892 ;; include at least commas; presumably also close parens. | 892 ;; include at least commas; presumably also close parens and dollars. |
893 (while (string-match "[,)]" url) | 893 (while (string-match "[,)$]" url) |
894 (setq url (replace-match | 894 (setq url (replace-match |
895 (format "%%%x" (string-to-char (match-string 0 url))) t t url))) | 895 (format "%%%x" (string-to-char (match-string 0 url))) t t url))) |
896 (let* ((process-environment (browse-url-process-environment)) | 896 (let* ((process-environment (browse-url-process-environment)) |
897 (process | 897 (process |
898 (apply 'start-process | 898 (apply 'start-process |
940 | 940 |
941 When called non-interactively, optional second argument NEW-WINDOW is | 941 When called non-interactively, optional second argument NEW-WINDOW is |
942 used instead of `browse-url-new-window-flag'." | 942 used instead of `browse-url-new-window-flag'." |
943 (interactive (browse-url-interactive-arg "URL: ")) | 943 (interactive (browse-url-interactive-arg "URL: ")) |
944 ;; URL encode any `confusing' characters in the URL. This needs to | 944 ;; URL encode any `confusing' characters in the URL. This needs to |
945 ;; include at least commas; presumably also close parens. | 945 ;; include at least commas; presumably also close parens and dollars. |
946 (while (string-match "[,)]" url) | 946 (while (string-match "[,)$]" url) |
947 (setq url (replace-match | 947 (setq url (replace-match |
948 (format "%%%x" (string-to-char (match-string 0 url))) t t url))) | 948 (format "%%%x" (string-to-char (match-string 0 url))) t t url))) |
949 (let* ((process-environment (browse-url-process-environment)) | 949 (let* ((process-environment (browse-url-process-environment)) |
950 (process (apply 'start-process | 950 (process (apply 'start-process |
951 (concat "galeon " url) | 951 (concat "galeon " url) |
989 | 989 |
990 When called non-interactively, optional second argument NEW-WINDOW is | 990 When called non-interactively, optional second argument NEW-WINDOW is |
991 used instead of `browse-url-new-window-flag'." | 991 used instead of `browse-url-new-window-flag'." |
992 (interactive (browse-url-interactive-arg "URL: ")) | 992 (interactive (browse-url-interactive-arg "URL: ")) |
993 ;; URL encode any `confusing' characters in the URL. This needs to | 993 ;; URL encode any `confusing' characters in the URL. This needs to |
994 ;; include at least commas; presumably also close parens. | 994 ;; include at least commas; presumably also close parens and dollars. |
995 (while (string-match "[,)]" url) | 995 (while (string-match "[,)$]" url) |
996 (setq url (replace-match | 996 (setq url (replace-match |
997 (format "%%%x" (string-to-char (match-string 0 url))) t t url))) | 997 (format "%%%x" (string-to-char (match-string 0 url))) t t url))) |
998 (let* ((process-environment (browse-url-process-environment)) | 998 (let* ((process-environment (browse-url-process-environment)) |
999 (process (apply 'start-process | 999 (process (apply 'start-process |
1000 (concat "epiphany " url) | 1000 (concat "epiphany " url) |