From: okada Date: Fri, 20 Dec 2002 15:42:26 +0000 (+0000) Subject: * wl-news.el.in (wl-news): New function. X-Git-Tag: merged-trunk-to-elmo-mark-14~83 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=43bef88ef9bcbd1dc92cc14ee47e4755251d4ffb;p=elisp%2Fwanderlust.git * wl-news.el.in (wl-news): New function. (wl-news-mode): New function. (wl-news-next-line): New function. (wl-news-next-page): New function. (wl-news-exit): New function. (wl-news-buf-name): New variable. (wl-news-mode-map): New variable. (wl-news-winconf): New variable. (wl-news-append-news): Add an option. --- diff --git a/wl/ChangeLog b/wl/ChangeLog index f1a4a15..f1d3e0f 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,15 @@ +2002-12-21 Kenichi OKADA + + * wl-news.el.in (wl-news): New function. + (wl-news-mode): New function. + (wl-news-next-line): New function. + (wl-news-next-page): New function. + (wl-news-exit): New function. + (wl-news-buf-name): New variable. + (wl-news-mode-map): New variable. + (wl-news-winconf): New variable. + (wl-news-append-news): Add an option. + 2002-12-20 Kenichi OKADA * wl-news.el.in (wl-news-send-news): Add 'Date' header. diff --git a/wl/wl-news.el.in b/wl/wl-news.el.in index 5d1c987..32c2445 100644 --- a/wl/wl-news.el.in +++ b/wl/wl-news.el.in @@ -96,10 +96,12 @@ (message "%s is not writable." filename)) (kill-buffer tmp-buffer)))) -(defun wl-news-append-news (lang previous-version) +(defun wl-news-append-news (lang previous-version &optional no-mime-tag) (require 'wl-mime) (let* ((news-list (cdr (assoc lang wl-news-news-alist)))) - (mime-edit-insert-tag "text" "plain" "" "") + (if no-mime-tag + (insert "\n") + (mime-edit-insert-tag "text" "plain" "" "")) (while (< 0 (product-version-compare (car (car news-list)) @@ -135,6 +137,60 @@ (let (wl-interactive-send) (wl-draft-send 'kill-when-done))))) +;;; wl-news-mode + +(defvar wl-news-buf-name "NEWS") +(defvar wl-news-mode-map nil) +(defvar wl-news-winconf nil) + +(unless wl-news-mode-map + (setq wl-news-mode-map (make-sparse-keymap)) + (define-key wl-news-mode-map "q" 'wl-news-exit) + (define-key wl-news-mode-map "\C-m" 'wl-news-next-line) + (define-key wl-news-mode-map " " 'wl-news-next-page)) + +(defun wl-news-mode () + "Mode for Wanderlust NEWS(.ja)." + (interactive) + (kill-all-local-variables) + (use-local-map wl-news-mode-map) + (setq major-mode 'wl-news-mode) + (setq mode-name "NEWS") + (setq buffer-read-only t)) + +(defun wl-news () + (interactive) + (setq wl-news-winconf (current-window-configuration)) + (let* ((previous-version (wl-news-previous-version-load)) + (lang wl-news-lang) + window-lines lines) + (set-buffer (get-buffer-create wl-news-buf-name)) + (wl-news-mode) + (buffer-disable-undo (current-buffer)) + ;; insert news + (let ((buffer-read-only nil)) + (insert "--- Wanderlust NEWS --- press 'q' for exit\n\n") + (while (car lang) + (wl-news-append-news + (car lang) previous-version t) + (setq lang (cdr lang)))) + (switch-to-buffer wl-news-buf-name) + (goto-char (point-min)))) + +(defun wl-news-next-line () + (interactive) + (scroll-up 1)) + +(defun wl-news-next-page () + (interactive) + (scroll-up)) + +(defun wl-news-exit () + (interactive) + (kill-buffer (current-buffer)) + (if wl-news-winconf + (set-window-configuration wl-news-winconf))) + (require 'product) (product-provide (provide 'wl-news) (require 'wl-version))