X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=utils%2Fim-wl.el;h=5f9e954b6a31996b6cc184cc060831b8b11e516a;hb=7577ad1b6ed9e227ce088a17bf93eda7d4ef0271;hp=947646cda7468576878f574b0e0dc2d8b13e2e01;hpb=1e366a559be4aec4ad4d3cf3e954b8e62a20d2f3;p=elisp%2Fwanderlust.git diff --git a/utils/im-wl.el b/utils/im-wl.el index 947646c..5f9e954 100644 --- a/utils/im-wl.el +++ b/utils/im-wl.el @@ -1,50 +1,48 @@ -;;; -;;; im-wl -- IM/Nifty4U+ interface for Wanderlust. -;;; ...not completed. -;;; -;;; Copyright (C) 1998,1999 OKUNISHI Fujikazu -;;; Copyright (C) 1998,1999 Yuuichi Teranishi -;;; -;;; Time-stamp: <1999-09-10 22:58:45 fuji0924> -;;; Author: OKUNISHI Fujikazu -;;; Yuuichi Teranishi -;;; Keywords: mail, news, Wanderlust, IM, Nifty4U+ - -;;; This program is free software; you can redistribute it and/or modify -;;; it under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 2, or (at your option) -;;; any later version. -;;; -;;; This program is distributed in the hope that it will be useful, -;;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Emacs; see the file COPYING. If not, write to the -;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;;; Boston, MA 02111-1307, USA. -;;; - -;;; -;;; General settings: -;;; (autoload 'wl-draft-send-with-imput-async "im-wl") -;;; (setq wl-draft-send-func 'wl-draft-send-with-imput-async) -;;; -;;; for Nifty4U+ users: -;;; (add-hook 'wl-mail-setup-hook '(lambda () (require 'im-wl))) -;;; (setq wl-draft-config-alist -;;; '(("^Newsgroups: nifty\\..*" -;;; ;; to avoid header-encoding. -;;; ;; [cf. slrn-ja-0.9.4.6.jp4/doc/README.macros.euc] -;;; ;(eword-field-encoding-method-alist . '((t . iso-2022-jp-2))) -;;; (wl-draft-send-func . 'wl-draft-send-with-imput-async) -;;; (im-wl-dispatcher . '("~/nifty4u-plus/inews-nifty4u" "-h")) -;;; (im-wl-dispatcher-error-msg -;;; . (format "^%s :" (expand-file-name (car im-wl-dispatcher))))))) +;;; im-wl.el -- IM/Nifty4U+ interface for Wanderlust. (not completed.) + +;; Copyright (C) 1998,1999 OKUNISHI Fujikazu +;; Copyright (C) 1998,1999 Yuuichi Teranishi + +;; Author: OKUNISHI Fujikazu +;; Yuuichi Teranishi +;; Keywords: mail, news, Wanderlust, IM, Nifty4U+ + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. +;; + +;;; Commentary: + +;; General settings: +;; (autoload 'wl-draft-send-with-imput-async "im-wl") +;; (setq wl-draft-send-function 'wl-draft-send-with-imput-async) +;; +;; for Nifty4U+ users: +;; (add-hook 'wl-mail-setup-hook '(lambda () (require 'im-wl))) +;; (setq wl-draft-config-alist +;; '(("^Newsgroups: nifty\\..*" +;; ;; to avoid header-encoding. +;; ;; [cf. slrn-ja-0.9.4.6.jp4/doc/README.macros.euc] +;; ;(eword-field-encoding-method-alist . '((t . iso-2022-jp-2))) +;; (wl-draft-send-function . 'wl-draft-send-with-imput-async) +;; (im-wl-dispatcher . '("~/nifty4u-plus/inews-nifty4u" "-h")) +;; (im-wl-dispatcher-error-msg +;; . (format "^%s :" (expand-file-name (car im-wl-dispatcher))))))) ;;; Code: -;(require 'emu) +;;;(require 'emu) ;;; Variables: (defvar im-wl-dispatcher @@ -53,7 +51,7 @@ This is most commonly `imput(impost)' or `inews-nifty4u'.") (defvar im-wl-dispatcher-error-msg (format "^%s: ERROR:" (car im-wl-dispatcher)) - "Error message of dispatcher") + "Error message of dispatcher.") (defvar im-wl-default-temp-file-name "~/.imput-temp" "Default temporary file name (for async).") @@ -77,12 +75,20 @@ This is most commonly `imput(impost)' or `inews-nifty4u'.") (let (buffer-process process-connection-type watch-buffer (sending-buffer (current-buffer)) (error-msg-regexp im-wl-dispatcher-error-msg) - (msg (save-excursion - (set-buffer editing-buffer) - (or wl-draft-buffer-file-name - (setq wl-draft-buffer-file-name - (expand-file-name - im-wl-default-temp-file-name)))))) + (number wl-draft-buffer-message-number) + msg) + (with-current-buffer editing-buffer + (if (elmo-message-file-p + (wl-folder-get-elmo-folder wl-draft-folder) + number) + (setq msg + (elmo-message-file-name + (wl-folder-get-elmo-folder wl-draft-folder) + number)) + (with-temp-file (setq msg (make-temp-file "im-wl")) + (elmo-message-fetch (wl-folder-get-elmo-folder wl-draft-folder) + number (elmo-make-fetch-strategy 'entire) + nil (current-buffer))))) ;; current buffer is raw buffer. (save-excursion (goto-char (point-max)) @@ -99,7 +105,7 @@ This is most commonly `imput(impost)' or `inews-nifty4u'.") (when (and wl-insert-message-id (not (re-search-forward "^Message-ID[ \t]*:" nil t))) (insert (concat "Message-ID: " - (wl-draft-make-message-id-string) "\n"))) + (funcall wl-message-id-function) "\n"))) ;; Insert date field. (goto-char (point-min)) (or (re-search-forward "^Date[ \t]*:" nil t) @@ -116,7 +122,7 @@ This is most commonly `imput(impost)' or `inews-nifty4u'.") (while (and (re-search-forward "\n\n\n*" delimline t) (< (point) delimline)) (replace-match "\n")) - ;; Find and handle any FCC fields. + ;; Find and handle any FCC fields. ;; 'cause imput can NOT handle `Fcc: %IMAP'. (goto-char (point-min)) (if (re-search-forward "^FCC:" delimline t)