[Mew-dist 03654] text/html and mew-win32.el patch.

Shuichi Kitaguchi shuuic-k at example.com
1998年 2月 4日 (水) 22:38:32 JST


北口@奈良先端大 です。

酒井さんの text/html サポートパッチに対する Windows で幸せに
なるパッチと、mew-win32.el の browse-url との連携強化パッチです。


--==| Shuichi Kitaguchi : shuuic-k at example.com |
    |     / kit at example.com / shkit at example.com |==--

--- mew-mime.el.original	Wed Feb 04 09:55:43 1998
+++ mew-mime.el	Wed Feb 04 11:21:41 1998
@@ -169,7 +169,7 @@
 	  (funcall mew-prog-text/html (point-min) (point-max))))
        ((stringp mew-prog-text/html)
 	(if (> end begin)
-	    (let ((file (mew-make-temp-name))) ;; xxx append ".html"?
+	    (let ((file (format "%s.html" (mew-make-temp-name))))
 	      (save-excursion
 		(set-buffer (mew-current-get 'cache))
 		(mew-frwlet

--- mew-win32.el.original	Fri Jan 30 08:27:11 1998
+++ mew-win32.el	Wed Feb 04 12:10:42 1998
@@ -2,11 +2,11 @@
 
 ;; Author:  Shuichi Kitaguchi <kit at example.com>
 ;; Created: Dec 05, 1997
-;; Revised: Jan 30, 1998
+;; Revised: Feb 04, 1998
 
 ;;; Code:
 
-(defconst mew-win32-version "mew-win32.el 0.19")
+(defconst mew-win32-version "mew-win32.el 0.20")
 
 ;; Win32 programs.
 (setq mew-w32-exec         "fiber.exe")
@@ -31,13 +31,33 @@
 (setq mew-ext-prog-url       mew-w32-exec)
 (setq mew-ext-prog-url-args  nil)
 
+
 ;; browse-url.
-(defun browse-url-client (url)
-  (interactive (browse-url-interactive-arg "URL: "))
-  (x-set-selection 'PRIMARY url )
-  (start-process "WWW Browser" nil
-		 mew-w32-exec url))
-(setq browse-url-browser-function 'browse-url-client)
+(defvar mew-w32-browse-url-button [mouse-2]) ; mouse button
+(setq browse-url-regexp "\\(\\([^-A-Za-z0-9!_.%]\\|^\\)[-A-Za-z0-9._!%]+@[A-Za-z0-9][-A-Za-z0-9._!]+[A-Za-z0-9]\\)\\|\\(\\b\\(s?https?\\|ftp\\|file\\|gopher\\|news\\|telnet\\|wais\\|mailto\\):\\(//[-a-zA-Z0-9_.]+:[0-9]*\\)?[-a-zA-Z0-9_=?#$@~`%&*+|\\/.,]*[-a-zA-Z0-9_=#$@~`%&*+|\\/]+\\)")
+(defun browse-url-or-mew (url)
+  (interactive)
+  "browse-url or mew-send."
+  (message "Starting browse-url... or mew-send...")
+  (cond
+   ((string-match "^mailto:" url)
+    (mew-send (substring url 7 nil)))
+   ((string-match "^\\(s?https?\\|ftp\\|file\\|gopher\\|news\\|telnet\\|wais\\):" url)
+    (apply (function start-process)
+	   (format "*mew %s*" mew-ext-prog-url)
+	   mew-buffer-tmp mew-ext-prog-url
+	   (append mew-ext-prog-url-args (list url))))
+   (t (progn
+	(string-match "\\([A-Za-z0-9]\\)" url)
+	(mew-send (substring url (match-beginning 1) nil))))))
+(setq browse-url-browser-function 'browse-url-or-mew)
+(add-hook 'mew-init-hook
+	  (lambda ()
+	    (progn 
+	      (define-key mew-message-mode-map mew-w32-browse-url-button 'browse-url-at-mouse)
+	      )))
+;; if you want to use browse-url-at-mouse in global-map, uncomment this.
+;; (define-key global-map [S-mouse-2] 'browse-url-at-mouse)
 
 
 ;; Emacs version dependent variables.



Mew-dist メーリングリストの案内