diff lisp/w3/url-misc.el @ 134:34a5b81f86ba r20-2b1

Import from CVS: tag r20-2b1
author cvs
date Mon, 13 Aug 2007 09:30:11 +0200
parents cca96a509cfe
children 6608ceec7cf8
line wrap: on
line diff
--- a/lisp/w3/url-misc.el	Mon Aug 13 09:29:37 2007 +0200
+++ b/lisp/w3/url-misc.el	Mon Aug 13 09:30:11 2007 +0200
@@ -1,7 +1,7 @@
 ;;; url-misc.el --- Misc Uniform Resource Locator retrieval code
 ;; Author: wmperry
-;; Created: 1997/04/07 13:24:49
-;; Version: 1.14
+;; Created: 1997/04/16 05:11:58
+;; Version: 1.16
 ;; Keywords: comm, data, processes
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -137,6 +137,36 @@
 	(proxyobj (url-generic-parse-url url-using-proxy)))
     (url-http url-using-proxy url)))
 
+(defvar url-webmail-gateway "w3mail@gmd.de"
+  "*Where to send webmail requests")
+
+(defvar url-webmail-switches '(" " "-uu -z" "-uu -z -s 100"))
+
+(defun url-proxy-via-mail (url)
+  ;; Return URL from a web->mail gateway
+  (let ((urlobj (url-generic-parse-url url)))
+    (funcall url-mail-command)
+    (set (make-local-variable 'inhibit-read-only) t)
+    (goto-char (point-min))
+    (if (search-forward mail-header-separator nil t)
+	(progn
+	  (forward-char 1)
+	  (delete-region (point) (point-max)))
+      (goto-char (point-max)))
+    (if (fboundp 'widget-minor-mode)
+	(widget-minor-mode 1))
+    (apply 'widget-create 'menu-choice
+	   :value " "
+	   :format "%[%t%] %v"
+	   :tag "get"
+	   (mapcar (lambda (x) (list 'choice-item :format "%v" x))
+		   url-webmail-switches))
+    (insert " " url)
+    (if url-request-data
+	(insert "?" url-request-data))
+    (url-mail-goto-field "To")
+    (insert url-webmail-gateway)))
+
 ;; ftp://ietf.org/internet-drafts/draft-masinter-url-data-02.txt
 (defun url-data (url)
   (set-buffer (get-buffer-create url-working-buffer))