debian/0000755000000000000000000000000012257031032007161 5ustar debian/mew.prerm0000644000000000000000000000044612251345356011037 0ustar #!/bin/sh set -e # Workaround to compatible with emacsen-common <2.0.0 if [ ! -e /var/lib/emacsen-common/state/package/installed/emacsen-common ]; then if [ -x /usr/lib/emacsen-common/emacs-package-remove ]; then /usr/lib/emacsen-common/emacs-package-remove mew fi else #DEBHELPER# fi debian/dirs.in0000644000000000000000000000013312142220604010445 0ustar usr/share/doc/@PACKAGE@ usr/share/emacs/site-lisp/mew usr/share/pixmaps/mew usr/share/info debian/emacsen-startup.in0000644000000000000000000000230112142204746012627 0ustar ;;; 50@PACKAGE@.el --- Debian @PACKAGE@ startup file -*-mode: emacs-lisp;-*- (let* ((pkg "@PACKAGE@") (pkg-sname "mew") (flavor-name (if (boundp 'debian-emacs-flavor) (symbol-name debian-emacs-flavor) "emacs")) (pkg-inst (concat "/usr/lib/emacsen-common/packages/install/" pkg)) (elc-dir (concat "/usr/share/" flavor-name "/site-lisp/" pkg-sname))) (when (and (file-exists-p elc-dir) (file-exists-p pkg-inst)) (if (fboundp 'debian-pkg-add-load-path-item) (debian-pkg-add-load-path-item elc-dir) (setq load-path (cons elc-dir load-path))) ;; (autoload 'mew-user-agent-compose "mew" nil t) (if (fboundp 'define-mail-user-agent) (define-mail-user-agent 'mew-user-agent 'mew-user-agent-compose 'mew-draft-send-message 'mew-draft-kill 'mew-send-hook)) (autoload 'mew "mew" nil t) (autoload 'mew-send "mew" nil t) (setq mew-icon-directory "/usr/share/pixmaps/mew") (setq mew-prog-ssl "mewstunnel") (setq mew-ssl-cert-directory "/etc/ssl/certs") (setq mew-ssl-verify-level 2) (setq mew-unix-browser "/usr/bin/sensible-browser") (setq mew-unix-browser-arg nil) ;; )) ;;; 50@PACKAGE@.el ends here debian/compat0000644000000000000000000000000212142204746010366 0ustar 7 debian/rules0000755000000000000000000001031712142204752010247 0ustar #!/usr/bin/make -f #export DH_VERBOSE=1 export DH_OPTIONS PACKAGE=`cat debian/PACKAGE` PKGSNAME=mew export DEB_BUILD_MAINT_OPTIONS = hardening=+all dpkg_buildflags = DEB_BUILD_MAINT_OPTIONS=$(DEB_BUILD_MAINT_OPTIONS) dpkg-buildflags CFLAGS=$(shell $(dpkg_buildflags) --get CFLAGS) CPPFLAGS=$(shell $(dpkg_buildflags) --get CPPFLAGS) LDFLAGS=$(shell $(dpkg_buildflags) --get LDFLAGS) configure-stamp: configure dh_testdir CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man grep '^Package: ' debian/control | head -1 | sed -e "s/^Package: //g" > debian/PACKAGE sed -e "s/@PACKAGE@/$(PACKAGE)/g" debian/README.Debian.in > debian/README.Debian sed -e "s/@PACKAGE@/$(PACKAGE)/g" debian/dirs.in > debian/dirs sed -e "s/@PACKAGE@/$(PACKAGE)/g" debian/emacsen-install.in > debian/emacsen-install sed -e "s/@PACKAGE@/$(PACKAGE)/g" debian/emacsen-remove.in > debian/emacsen-remove sed -e "s/@PACKAGE@/$(PACKAGE)/g" debian/emacsen-startup.in > debian/emacsen-startup ls -1 00* | egrep -v '(^00copyright$$|^00changes)' > debian/docs ls -1 *dot.* > debian/examples ls -1 info/mew.*info* > debian/info touch $@ build: build-arch build-indep build-arch: build-arch-stamp build-arch-stamp: configure-stamp $(MAKE) bin touch $@ build-indep: build-indep-stamp build-indep-stamp: configure-stamp touch $@ clean: dh_testdir dh_testroot rm -f build-arch-stamp build-indep-stamp configure-stamp debian/PACKAGE debian/README.Debian debian/dirs debian/emacsen-install debian/emacsen-remove debian/emacsen-startup debian/docs debian/examples debian/info [ ! -f Makefile ] || $(MAKE) distclean dh_clean install: install-arch install-indep install-indep: DH_OPTIONS=-i install-indep: dh_testdir dh_testroot dh_prep dh_installdirs cp mew*.el debian/$(PACKAGE)/usr/share/emacs/site-lisp/$(PKGSNAME) for f in debian/mew*.el; do \ if [ -f "$$f" ]; then \ cp "$$f" debian/$(PACKAGE)/usr/share/emacs/site-lisp/$(PKGSNAME); \ fi; \ done for f in 00changes.*; do \ if [ -f "$$f" ]; then \ cp "$$f" debian/$(PACKAGE)/usr/share/doc/$(PACKAGE)/changelog.`echo $$f | sed -e s/00changes.//`; \ fi; \ done cp -r etc/* debian/$(PACKAGE)/usr/share/pixmaps/$(PKGSNAME) if [ -d contrib ]; then \ mkdir debian/$(PACKAGE)/usr/share/emacs/site-lisp/$(PKGSNAME)/contrib; \ cp contrib/mew*.el debian/$(PACKAGE)/usr/share/emacs/site-lisp/$(PKGSNAME)/contrib; \ fi for f in alpha beta; do \ if [ -d "$$f" ]; then \ cp -r "$$f" debian/$(PACKAGE)/usr/share/doc/$(PACKAGE); \ fi; \ done install-arch: DH_OPTIONS=-a install-arch: dh_testdir dh_testroot dh_prep dh_installdirs $(MAKE) DESTDIR=$(CURDIR)/debian/$(PACKAGE)-bin install-bin install -m 755 debian/mewstunnel debian/$(PACKAGE)-bin/usr/bin install -m 644 debian/mewstunnel.1 debian/$(PACKAGE)-bin/usr/share/man/man1 rm -f debian/$(PACKAGE)-bin/usr/bin/mewdecode rm -f debian/$(PACKAGE)-bin/usr/bin/mewcat rm -f debian/$(PACKAGE)-bin/usr/share/man/man1/mewdecode.1* rm -f debian/$(PACKAGE)-bin/usr/share/man/man1/mewcat.1* binary-indep: DH_OPTIONS=-i binary-indep: build-indep install-indep dh_testdir dh_testroot # dh_installdebconf dh_installdocs dh_installexamples dh_installmenu dh_installemacsen dh_installman dh_installinfo dh_installchangelogs 00changes dh_link -p$(PACKAGE) usr/share/pixmaps/$(PKGSNAME) usr/share/emacs/site-lisp/$(PKGSNAME)/etc dh_compress dh_fixperms dh_installdeb dh_gencontrol dh_md5sums dh_builddeb binary-arch: DH_OPTIONS=-a binary-arch: build-arch install-arch dh_testdir dh_testroot # dh_installdebconf dh_installdocs dh_installexamples dh_installmenu dh_installman dh_installinfo dh_installchangelogs 00changes dh_strip dh_link -p$(PACKAGE)-bin usr/bin/mewencode usr/bin/mewdecode dh_link -p$(PACKAGE)-bin usr/bin/mewencode usr/bin/mewcat dh_link -p$(PACKAGE)-bin usr/share/man/man1/mewencode.1 usr/share/man/man1/mewdecode.1 dh_link -p$(PACKAGE)-bin usr/share/man/man1/mewencode.1 usr/share/man/man1/mewcat.1 dh_compress dh_fixperms dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch build-indep build-arch debian/mew-bin.prerm0000644000000000000000000000021512142204745011572 0ustar #! /bin/sh set -e if [ "$1" = remove ]; then update-alternatives --quiet --remove pinentry /usr/bin/mew-pinentry fi #DEBHELPER# exit 0 debian/copyright0000644000000000000000000001306212142217046011122 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: Mew Source: https://github.com/kazu-yamamoto/Mew Files: * Copyright: 1994-2012, Mew developing team 1994-2012, Kazu Yamamoto License: BSD-3-clause Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the team nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE TEAM AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE TEAM OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Files: etc/mew-*.xpm Copyright: 1997, Yoshiaki Kasahara 2003, Yuuichi Teranishi 2003, Kazu Yamamoto 2004, Yoshifumi Nishida License: Copyright notice is the same as Mew's one. Files: info/* Copyright: 1996-2011, Kazuhiko Yamamoto License: The copyright of this manual belongs to the author. Permission is granted to copy, modify, redistribute this manual but no warranty. Files: install-sh Copyright: 1991, the Massachusetts Institute of Technology License: Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of M.I.T. not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. M.I.T. makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. Files: bin/configure configure Copyright: 1992-2009, Free Software Foundation License: This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Files: contrib/* Copyright: 1994-2007, Mew developing team 1998-2007, Hideyuki SHIRAI 2001, Shun-ichi TAHARA License: BSD-3-clause Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the team nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE TEAM AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE TEAM OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Comment: The upstream is . mew-nmz.el is from . Files: contrib/mew-absfilter.el Copyright: 2005-2007, SAITO Takuya License: You can use, copy, distribute, and/or modify this file for any purpose. There is NO WARRANTY. Comment: mew-absfilter.el is from . Files: debian/* Copyright: 2003-2013, Tatsuya Kinoshita 2001-2003, NOSHIRO Shigeo 1999-2001, ISHIKAWA Mutsumi 1996-1998, Yoshiaki Yanagihara License: The Debian packaging is distributed under the same conditions as the upstream. Files: debian/mewstunnel* Copyright: 2005-2011, Tatsuya Kinoshita License: Redistribution and use in source and binary forms, with or without modification, are permitted without restriction, with NO WARRANTY. debian/README.Debian.in0000644000000000000000000000237612142204745011645 0ustar @PACKAGE@ for Debian -------------------- mail-user-agent =============== The following configuration enables you to run Mew as a default mail user agent of emacsen. (if (boundp 'mail-user-agent) (setq mail-user-agent 'mew-user-agent)) (if (boundp 'read-mail-command) (setq read-mail-command 'mew)) Local mailbox ============= If you want to use a local mailbox instead of POP, you need the following configuration. (setq mew-mailbox-type 'mbox) ;; 'pop is used by default (setq mew-mbox-command "incm") ;; incm gets mails from maildir or mbox (setq mew-mbox-command-arg "-u -a") ;; See also incm manual mew-ssl ======= If you want to use the mew-ssl feature, install the stunnel4 package (or the stunnel package) and the ca-certificates package. By default, in the startup file, the mew-prog-ssl variable is set to "mewstunnel" (wrapper script for using stunnel4 or stunnel), the mew-ssl-cert-directory variable is set to "/etc/ssl/certs" (directory to store CA certificates in), and the mew-ssl-verify-level variable is set to 2 (verify server's certificate). See also "Mew manual", section "SSL". contrib ======= contrib/*.el files are installed in the site-lisp directory. -- Tatsuya Kinoshita , Sun, 4 Nov 2007 22:29:27 +0900 debian/patches/0000755000000000000000000000000012253341576010625 5ustar debian/patches/020_Fix-segfault-of-mewl.patch0000644000000000000000000000076012151670101016116 0ustar Subject: Fix segfault of mewl From: Tatsuya Kinoshita Origin: upstream, https://github.com/kazu-yamamoto/Mew/commit/9dc16e96fd4767a5c3ffa3a459d28edee020fb49 --- a/bin/mewl.c +++ b/bin/mewl.c @@ -348,7 +348,7 @@ nextfield(char *p, char *lim, char **truncated_end, char **prev_beg, int hdr_onl do { q = p; p = nextline(p, lim, hdr_only); - if (p == NULL) return NULL; + if (p == NULL) break; i++; if (Field_len != 0 && i == Field_len) *truncated_end = p; debian/patches/060_cache-long-scans.patch0000644000000000000000000000104312253341576015336 0ustar Subject: Bind cache-long-scans to nil for mew-scan-body due to Emacs crash From: Tatsuya Kinoshita Bug: http://www.mew.org/pipermail/mew-dist/2013-November/029339.html diff --git a/mew-scan.el b/mew-scan.el index f829554..2b2f99c 100644 --- a/mew-scan.el +++ b/mew-scan.el @@ -534,6 +534,7 @@ Address is converted by 'mew-summary-form-extract-addr'. See also (cte (MEW-CTE)) (body "") (case-fold-search t) + (cache-long-scans nil) textp charset cs beg skip boundary found regex) (catch 'break (cond debian/patches/030_Use-auth-user-for-smtp-passtag.patch0000644000000000000000000000063312161232342020072 0ustar Subject: Use auth-user for smtp-passtag From: Tatsuya Kinoshita Forwarded: https://github.com/kazu-yamamoto/Mew/issues/24 --- a/mew-smtp.el +++ b/mew-smtp.el @@ -357,7 +357,7 @@ (message "SMTP time out")))) (defun mew-smtp-passtag (pnm) - (concat (mew-smtp-get-user pnm) + (concat (mew-smtp-get-auth-user pnm) "@" (mew-smtp-get-server pnm) ":" (mew-smtp-get-port pnm))) debian/patches/050_Use-ppmtogif.patch0000644000000000000000000000103112246644547014612 0ustar Subject: Use ppmtogif rather than pnmtogif From: Tatsuya Kinoshita diff --git a/mew-gemacs.el b/mew-gemacs.el index 67dffe5..c6a982d 100644 --- a/mew-gemacs.el +++ b/mew-gemacs.el @@ -248,7 +248,7 @@ (defvar mew-image-alist '((jpeg mew-jpeg-size "jpegtopnm" "pnmtojpeg") (png mew-png-size "pngtopnm" "pnmtopng") - (gif mew-gif-size "giftopnm" "pnmtogif") + (gif mew-gif-size "giftopnm" "ppmtogif") (tiff mew-tiff-size "tifftopnm" "pnmtotiff"))) (defun mew-image-format-ent (format) debian/patches/010_contrib.patch0000644000000000000000000044732612142204752013675 0ustar Description: contribution files to Mew Forked to to maintain patches. Added mew-nmz.el from . Added mew-absfilter.el from . Origin: upstream, https://github.com/kazu-yamamoto/mew-contrib diff -urN mew.orig/contrib/mew-absfilter.el mew/contrib/mew-absfilter.el --- mew.orig/contrib/mew-absfilter.el 1970-01-01 09:00:00.000000000 +0900 +++ mew/contrib/mew-absfilter.el 2011-06-20 01:46:19.000000000 +0900 @@ -0,0 +1,476 @@ +;;; mew-absfilter.el --- spam filter with bsfilter for Mew + +;; Author: SAITO Takuya +;; $Id$ + +;; You can use, copy, distribute, and/or modify this file for any purpose. +;; There is NO WARRANTY. + +;;; Commentary: + +;; You can find bsfilter at http://bsfilter.org/ + +;; To enable spam check after retrieve, put below into your ~/.emacs: +;; (mew-absfilter-mode 1) + +;; If you want to do spam checking after shimbun retrieve, +;; do not use `mew-shimbun-retrieve-all' because it kills the shimbun buffer. + +;; When you find bsfilter marks the clean message as spam, +;; use "bc" (mew-absfilter-learn-clean) instead of "u" (mew-summary-undo) + +;; With "bx" (mew-absfilter-summary-exec-spam), you can process spam mark +;; even in nntp. + +;;; History: +;; v1.38, 2006-06-11 +;; Masayuki Ataka Support Mew 5 +;; v1.39, 2007-01-17 +;; Masayuki Ataka Support non-nil mew-use-suffix +;; v1.40, 2007-01-28 +;; SAITO Takuya tiny fix + +;;; Code: + +(require 'mew) + +;;; spam mark +(defvar mew-absfilter-mark-spam ?\;) + +(defvar mew-absfilter-spam-folder "+spam" + "*Spam folder. Must be a local folder.") + +(defface mew-absfilter-face-mark-spam + '((((class color) (type tty)) (:foreground "green")) + (((class color) (background light)) (:foreground "DimGray")) + (((class color) (background dark)) (:foreground "gray")) + (t nil)) + "*Face to highlight the spam mark" + :group 'mew-highlight) + +(defun mew-absfilter-mark-kill-spam (src msg) + "Return t if kill summary line." + (not (string= src mew-absfilter-spam-folder))) + +(defun mew-absfilter-mark-exec-spam (src msgs) + "Refile MSGs from the SRC folder to `mew-absfilter-spam-folder'." + (unless (string= src mew-absfilter-spam-folder) + (let ((mew-trash-folder mew-absfilter-spam-folder) + (mew-trash-folder-list nil)) + (mew-mark-exec-delete src msgs)))) + +(defun mew-absfilter-summary-spam-one (&optional no-msg) + "Put the spam mark(default is ';') on this message." + (mew-mark-put-mark mew-absfilter-mark-spam no-msg 'valid-only)) + +;; register spam mark +(add-to-list 'mew-mark-afterstep-spec + (list mew-absfilter-mark-spam 2 2 2 2 0 2 0)) +(add-to-list 'mew-mark-spec + (list mew-absfilter-mark-spam "spam" 2 nil + 'mew-absfilter-mark-kill-spam nil + 'mew-absfilter-mark-exec-spam nil)) +(add-to-list 'mew-highlight-mark-keywords + (cons mew-absfilter-mark-spam 'mew-absfilter-face-mark-spam)) + + +(defvar mew-absfilter-program "bsfilter") +(defvar mew-absfilter-arg-check '("--quiet" "--list-spam")) +(defvar mew-absfilter-arg-clean '("--sub-spam" "--add-clean" "--update")) +(defvar mew-absfilter-arg-spam '("--sub-clean" "--add-spam" "--update")) + +(defvar mew-absfilter-spam-folder-max-msgs 3000) + +;; like mew-prog-grep-max-msgs +(defvar mew-absfilter-max-msgs 10000) + +(defvar mew-absfilter-map + (let ((map (make-sparse-keymap))) + (define-key map "c" 'mew-absfilter-learn-clean) + (define-key map "s" 'mew-absfilter-learn-spam) + (define-key map "C" 'mew-absfilter-mark-learn-clean) + (define-key map "S" 'mew-absfilter-mark-learn-spam) + (define-key map "b" 'mew-absfilter-check-spam) + (define-key map "x" 'mew-absfilter-summary-exec-spam) + (define-key map "D" 'mew-absfilter-clean-spam-folder) + map)) + +(define-key mew-summary-mode-map "b" mew-absfilter-map) +;; (define-key mew-summary-mode-map +;; [remap mew-summary-learn-spam] 'mew-absfilter-learn-spam) +;; (define-key mew-summary-mode-map +;; [remap mew-summary-learn-ham] 'mew-absfilter-learn-clean) + + +(defvar mew-absfilter-summary-buffer-process nil) +(make-variable-buffer-local 'mew-absfilter-summary-buffer-process) +;; Use buffer-local-variable in process-buffer. +;; process-{put,get} is avairable only in Emacs-21.4 or above. +(defvar mew-absfilter-process-folder nil) + +(defun mew-absfilter-add-clean (files) + (apply 'call-process + mew-absfilter-program nil 0 nil + (append mew-absfilter-arg-clean files))) + +(defun mew-absfilter-add-spam (files) + (apply 'call-process + mew-absfilter-program nil 0 nil + (append mew-absfilter-arg-spam files))) + +(defmacro mew-absfilter-expand-msg (folder msg) + "Expand message MSG in FOLDER. +Function `mew-expand-msg' is defined after Mew 4.2.53. +Use `mew-expand-folder' iff `mew-expand-msg' is not available." + (if (fboundp 'mew-expand-msg) + `(mew-expand-msg ,folder ,msg) + `(mew-expand-folder ,folder ,msg))) + +(defmacro mew-absfilter-sumsyn-filename () + "Get filename" + (if (fboundp 'mew-msg-get-filename) + `(mew-msg-get-filename (mew-sumsyn-message-number)) + `(mew-sumsyn-message-number))) + +(defun mew-absfilter-match-string-message-number () + (if (and (boundp 'mew-use-suffix) + (boundp 'mew-suffix)) + (mew-match-string 1) + (mew-match-string 0))) + +;; spam check +(defun mew-absfilter-collect-message-region (begin end) + "Returns a list of message file name in region." + (when (> end begin) + (let (msgs) + (save-excursion + (save-restriction + (narrow-to-region begin end) + (goto-char (point-min)) + (while (not (eobp)) + (when (and (mew-summary-markable) + (mew-sumsyn-match mew-regex-sumsyn-short)) + (push (mew-absfilter-sumsyn-filename) msgs)) + (forward-line)))) + (nreverse msgs)))) + +(defun mew-absfilter-collect-spam-message () + (let (spam) + (save-excursion + (goto-char (point-min)) + (while (not (eobp)) + (when (looking-at mew-regex-message-files2) + (push (mew-absfilter-match-string-message-number) spam)) + (forward-line))) + (nreverse spam))) + +(defun mew-absfilter-check-spam-region (case:folder begin end) + (with-current-buffer case:folder + (mew-pickable + (let ((msgs (mew-absfilter-collect-message-region begin end)) + nxt) + (when msgs + (message "Spam checking %s..." case:folder)) + (while msgs + (let ((buf (get-buffer-create + (generate-new-buffer-name " *mew bsfilter*"))) + process) + (with-current-buffer buf + (cd (mew-expand-folder case:folder)) + (mew-erase-buffer) + (set (make-local-variable 'mew-absfilter-process-folder) + case:folder)) + (setq nxt (nthcdr mew-absfilter-max-msgs msgs)) + (when nxt + (setcdr (nthcdr (1- mew-absfilter-max-msgs) msgs) nil)) + (setq process (apply 'start-process "mew-absfilter" buf + mew-absfilter-program + (append mew-absfilter-arg-check msgs))) + (set-process-sentinel process 'mew-absfilter-sentinel) + (add-to-list 'mew-absfilter-summary-buffer-process process)) + (setq msgs nxt))))) + (when mew-absfilter-summary-buffer-process + (force-mode-line-update))) + +(defun mew-absfilter-apply-spam-action (case:folder spam) + (when (and spam + (get-buffer case:folder)) + (save-excursion + (let ((vfolder (mew-folder-to-thread case:folder))) + ;; mark in thread if exists + (when (and (get-buffer vfolder) + (mew-virtual-thread-p vfolder) + (with-current-buffer case:folder + (mew-thread-cache-valid-p vfolder))) + (let ((msgs spam)) + (setq spam nil) + (set-buffer vfolder) + (save-excursion + (dolist (msg msgs) + (if (or (re-search-forward (mew-regex-sumsyn-msg msg) nil t) + (re-search-backward (mew-regex-sumsyn-msg msg) nil t)) + (mew-absfilter-summary-spam-one 'no-msg) + ;; if msg is not found, try to mark in physical folder + (push msg spam))))))) + (when spam + (set-buffer case:folder) + (save-excursion + (dolist (msg spam) + (when (or (re-search-forward (mew-regex-sumsyn-msg msg) nil t) + (re-search-backward (mew-regex-sumsyn-msg msg) nil t)) + (mew-absfilter-summary-spam-one 'no-msg)))))))) + +(defun mew-absfilter-sentinel (process event) + ;; exit status of "bsfilter --list-spam" + ;; 0: some spams are found + ;; 1: spam not found + (mew-filter + (let ((status (process-exit-status process)) + (case:folder mew-absfilter-process-folder) + (spam (mew-absfilter-collect-spam-message))) + (when (zerop status) + (mew-absfilter-apply-spam-action case:folder spam)) + (with-current-buffer case:folder + (setq mew-absfilter-summary-buffer-process + (delq process mew-absfilter-summary-buffer-process))) + (message "Spam checking %s...%s" + case:folder + (cond + ((= status 0) + (format "done (%d spam)" (length spam))) + ((= status 1) + (concat "done (spam not found)")) + (t + (concat "failed. " event)))) + (kill-buffer (current-buffer))))) + +;; commands +(defun mew-absfilter-learn-clean (&optional mark-only) + "Learn this message as clean (not spam)." + (interactive "P") + (mew-summary-msg-or-part + (mew-summary-goto-message) + (when (mew-sumsyn-match mew-regex-sumsyn-short) + (let* ((msg (mew-sumsyn-message-number)) + (case:folder (mew-sumsyn-folder-name)) + (file (mew-absfilter-expand-msg case:folder msg))) + (when (eq (mew-summary-get-mark) mew-absfilter-mark-spam) + (mew-summary-undo)) + (unless mark-only + (mew-absfilter-add-clean (list file)) + (message "Learned as clean")))))) + +(defun mew-absfilter-learn-spam (&optional mark-only) + "Learn this message as spam." + (interactive "P") + (mew-summary-msg-or-part + (mew-summary-goto-message) + (when (mew-sumsyn-match mew-regex-sumsyn-short) + (let* ((msg (mew-sumsyn-message-number)) + (case:folder (mew-sumsyn-folder-name)) + (file (mew-absfilter-expand-msg case:folder msg))) + (mew-absfilter-summary-spam-one) + (unless mark-only + (mew-absfilter-add-spam (list file)) + (message "Learned as spam")))))) + +(defun mew-absfilter-mark-learn-clean (&optional mark-only) + "Learn all messages marked with '*' as clean (not spam)." + (interactive "P") + (mew-summary-multi-msgs + (mew-mark-undo-mark mew-mark-review) + (unless mark-only + (message "Learning as clean...") + (mew-absfilter-add-clean FILES) + (message "Learning as clean...done")))) + +(defun mew-absfilter-mark-learn-spam (&optional mark-only) + "Learn all messages marked with '*' as spam." + (interactive "P") + (mew-summary-multi-msgs + (mew-mark-undo-mark mew-mark-review) + (unless mark-only + (message "Learning as spam...") + (mew-absfilter-add-spam FILES) + (message "Learning as spam...done")))) + +;; (defun mew-absfilter-thread-mark-learn-spam () +;; "Put the ';' mark on all messages of the current sub-thread." +;; (interactive) +;; (mew-thread-mark mew-absfilter-mark-spam 'valid-only)) + +(defun mew-absfilter-summary-exec-spam () + "Process messages marked with ';'." + (interactive) + (let* ((ent (assoc mew-absfilter-mark-spam mew-mark-spec)) + (mew-mark-spec (list ent))) + ;; call `mew-summary-exec-local' even for imap or nntp + (cond + ((mew-virtual-p) + (mew-summary-go-back-summary + (mew-substitute-for-summary "\\[mew-summary-exec]"))) + (t + ;; This message can not be changed because + ;; (message "Refiling and deleting...done") is called in + ;; `mew-summary-exec-local'. + (message "Refiling and deleting...") + (force-mode-line-update) + (mew-summary-exec-local (point-min) (point-max)))))) + +(defun mew-absfilter-check-spam (&optional arg) + "Check spam messages with bsfilter." + (interactive "P") + (let ((region (if (or arg (mew-mark-active-p)) + (mew-summary-get-region) + (cons (point-min) (point-max))))) + (mew-absfilter-check-spam-region (mew-summary-folder-name 'ext) + (car region) (cdr region)))) + +(defun mew-absfilter-clean-spam-folder (&optional unlink) + "Remove old spam. +Save `mew-absfilter-spam-folder-max-msgs' messages." + (interactive "P") + (mew-summary-visit-folder mew-absfilter-spam-folder) + (mew-rendezvous mew-summary-buffer-process) + (mew-decode-syntax-delete) + (save-excursion + (goto-char (point-max)) + (forward-line (- mew-absfilter-spam-folder-max-msgs)) + (let ((pos (point))) + (while (zerop (forward-line -1)) + (mew-summary-mark-as (if unlink mew-mark-unlink mew-mark-delete))) + (mew-summary-exec-region (point) pos)))) + + +;;; Check after retrieve +(defvar mew-absfilter-check t + "When to check with bsfilter. +If t, do full check. Otherwise, the value should be a list whose element +is one of `local', `pop', `imap', `nntp', or `shimbun'.") + +;; biff scan inc sync exec get list jobs +(defvar mew-absfilter-check-directive-list '(("+" inc) + ("$" . nil) + ("%" inc scan) + ("-" scan))) + +;; Suppress byte-compiler warning. +;; bnm and directive is local variable which can be used in +;; mew-{local,pop,imap,nntp}-sentinel. +(defvar bnm) +(defvar directive) + +(defun mew-absfilter-check-spam-after-retrieve () + "Check spam messages with bsfilter after retrieve." + (when (stringp bnm) + (let* ((proto (mew-folder-prefix (mew-case:folder-folder bnm))) + (check (cdr (assoc proto mew-absfilter-check-directive-list)))) + (when (memq directive check) + (with-current-buffer bnm + (mew-absfilter-check-spam-region bnm + (mew-sinfo-get-start-point) + (point-max))))))) + +;; mew-local-sentinel does not let-bind `directive' +;; and that information is lost by (mew-info-clean-up pnm) +;; when mew-scan-sentinel-hook is called. +(defadvice mew-local-sentinel (around absfilter-check disable) + "Bind `directive' for spam checking. +Advised in mew-absfilter.el" + (let ((directive (mew-local-get-directive (process-name process)))) + ad-do-it)) + +;; Check after `mew-shimbun-retrieve' +(defun mew-absfilter-shimbun-retrieve-set-start-point () + "Set retrieve start point." + (mew-sinfo-set-start-point (point-max))) + +(defun mew-absfilter-check-spam-after-shimbun-retrieve () + "Check spam messages with absfilter after shimbun-retrieve." + (mew-absfilter-check-spam-region (mew-summary-folder-name 'ext) + (mew-sinfo-get-start-point) (point-max))) + +;; modeline +(defadvice mew-summary-setup-mode-line (after absfilter-process disable) + "Display \"bsfilter\" in mode line. +Advised in mew-absfilter.el" + (add-to-list 'mode-line-process + (list 'mew-absfilter-summary-buffer-process " bsfilter"))) + +;; inhibit pack, exec +(defadvice mew-summary-exclusive-p (after absfilter-process disable) + "Return nil when operation may break marking spam. +`mew-absfilter-apply-spam-action' may put spam mark on the wrong message +if message number is changed during bsfilter is running. +The example of such operations are: + - \"O\" (mew-summary-pack) + - 'Refile' + \"i\" (mew-summary-retrieve) + +Advised in mew-absfilter.el" + (when (and mew-absfilter-summary-buffer-process + (memq this-command '(mew-summary-exec mew-summary-pack))) + (unless no-msg + (message "bsfilter is running. Try again later")) + (setq ad-return-value nil))) + +(defun mew-absfilter-mode-activate (initialize) + (let ((all '(local pop imap nntp shimbun)) + ad-func hook-func) + (when (eq initialize t) + (setq initialize all)) + (if initialize + (setq ad-func 'ad-enable-advice + hook-func 'add-hook) + (setq initialize all + ad-func 'ad-disable-advice + hook-func 'remove-hook)) + (when (memq 'local initialize) + (funcall ad-func 'mew-local-sentinel 'around 'absfilter-check) + (ad-activate 'mew-local-sentinel) + (funcall hook-func + 'mew-scan-sentinel-hook + 'mew-absfilter-check-spam-after-retrieve)) + (when (memq 'pop initialize) + (funcall hook-func + 'mew-pop-sentinel-non-biff-hook + 'mew-absfilter-check-spam-after-retrieve)) + (when (memq 'imap initialize) + (funcall hook-func + 'mew-imap-sentinel-non-biff-hook + 'mew-absfilter-check-spam-after-retrieve)) + (when (memq 'nntp initialize) + (funcall hook-func + 'mew-nntp-sentinel-hook + 'mew-absfilter-check-spam-after-retrieve)) + (when (memq 'shimbun initialize) + (funcall hook-func + 'mew-shimbun-before-retrieve-hook + 'mew-absfilter-shimbun-retrieve-set-start-point) + (funcall hook-func + 'mew-shimbun-retrieve-hook + 'mew-absfilter-check-spam-after-shimbun-retrieve)) + (funcall ad-func 'mew-summary-setup-mode-line 'after 'absfilter-process) + (funcall ad-func 'mew-summary-exclusive-p 'after 'absfilter-process) + (ad-activate 'mew-summary-setup-mode-line) + (ad-activate 'mew-summary-exclusive-p))) + +(defvar mew-absfilter-mode nil) +;;;###autoload +(defun mew-absfilter-mode (&optional arg) + "Enable or disable bsfilter checking. +See `mew-absfilter-check' when bsfilter is run." + (interactive "P") + (let ((mode (if arg + (> (prefix-numeric-value arg) 0) + (not mew-absfilter-mode)))) + (when (and mode + (not (mew-which-exec mew-absfilter-program))) + (error "`%s' not found" mew-absfilter-program)) + (setq mew-absfilter-mode mode) + (mew-absfilter-mode-activate (if mode mew-absfilter-check)) + (when (interactive-p) + (message "bsfilter checking is %s" (if mode "enabled" "disabled"))))) + +(provide 'mew-absfilter) + +;;; mew-absfilter.el ends here diff -urN mew.orig/contrib/mew-browse.el mew/contrib/mew-browse.el --- mew.orig/contrib/mew-browse.el 1970-01-01 09:00:00.000000000 +0900 +++ mew/contrib/mew-browse.el 2011-06-15 00:20:15.000000000 +0900 @@ -0,0 +1,343 @@ +;;; mew-browse.el --- Handling URI with browse-url.el + +;; Author: Hideyuki SHIRAI +;; Modify: Shuichi Kitaguchi +;; Created: May 19, 1999 +;; Revised: Nov 08, 2004 + +;;; +;;; ~/.emacs settings. +;;; +;;; ... anything browse-url setting ... +;; (require 'mew-browse) + +;;; SHIFT + (Middle|Right)-Click = browse-url or mew-user-agent-compose +;;; for Emacs +;; (define-key global-map [S-mouse-2] 'browse-url-at-mouse) +;;; for XEmacs +;; (define-key global-map [(shift button2)] 'browse-url-at-mouse) +;; + +;;; Appending URI to specified file. +;; +;; mew-browse-noask ... ask or not when browse +;; mew-browse-append-file ... URL collection file name +;; mew-browse-append-always-file ... always, append URL to file (for dial-up) +;; mew-browse-append-always-mailto ... always, URL is mailto: (for emacs19.28) +;; mew-browse-append-file-sort ... always, sort URL file +;; +;;; example: +;; (setq mew-browse-noask nil) +;; (setq mew-browse-append-file "~/.browse") +;; (setq mew-browse-append-always-file nil) +;; (setq mew-browse-append-always-mailto nil) +;; (setq mew-browse-append-file-sort nil) +;; + +;;; Use mew-url-mailto instead of url-mailto in W3, add followings in your ~/.emacs file. +;; +;; (cond +;; ((locate-library "url-mail") +;; (eval-after-load "url-mail" +;; '(fset 'url-mailto (symbol-function 'mew-url-mailto)))) +;; ((locate-library "url") +;; (eval-after-load "url" +;; '(fset 'url-mailto (symbol-function 'mew-url-mailto))))) +;; + +;;; Use from emacs-w3m, add followings in your ~/.emacs file. +;; (setq w3m-mailto-url-function 'mew-url-mailto) +;; + +;;; Use from MS-Windows application, set followings in your registry. +;; registry key: '\\HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\mailto\\shell\\open\\command' +;; registry value: 'drive:\\path\\gnudoitw.exe \"(mew-url-mailto \"%%1\")\"'" +;; + +;;; Use from Mozilla & Firefox with MozEx, set followings on Mailer form of MozEx. +;; "/path/gnudoit (mew-url-mailto-mozex "%r")" +;; or +;; "/path/emacseval (mew-url-mailto-mozex "%r")" +;; +;; `emacseval' is a shell script like this, +;; ----cut here---- +;; #!/bin/sh +;; /usr/local/bin/emacsclient --eval "`echo $*`" +;; ----cut here----" +;; + +(eval-when-compile (require 'mew)) + +(if (string-match "XEmacs" emacs-version) + (defvar mew-browse-button [(button2)] "*Mouse button in message mode.") + (defvar mew-browse-button [mouse-2] "*Mouse button in message mode.")) + +(defvar mew-ext-prog-url mew-prog-text/html-ext) +(defvar mew-ext-prog-url-args nil) + +(setq browse-url-browser-function 'mew-browse-url) + +(defvar mew-browse-url-mailto-switch-func nil + "*Which do you like, nil, 'switch-to-buffer-other-window or 'switch-to-buffer-other-frame ?") + +(setq browse-url-regexp "\\(\\b\\(s?https?\\|ftp\\|file\\|gopher\\|news\\|telnet\\|wais\\|mailto\\):\\(//[-a-zA-Z0-9_.]+:[0-9]*\\)?[-a-zA-Z0-9_=?#$@~`%&*+|\\/.,]*[-a-zA-Z0-9_=#$@~`%&*+|\\/]+\\)\\|\\(\\([^-A-Za-z0-9!_.%]\\|^\\)[-A-Za-z0-9._!%]+@[A-Za-z0-9][-A-Za-z0-9._!]+[A-Za-z0-9]\\)") + +(defvar mew-browse-noask t "*Ask or not when browse.") +(defvar mew-browse-append-file nil "*URL collection file.") +(defvar mew-browse-append-always-file nil "*For dialup user.") +(defvar mew-browse-append-always-mailto nil "*For emacs19.28.") +(defvar mew-browse-append-file-sort nil "*Sort URL file.") + +(defun mew-browse-url (url &optional args) + "Exec browse URL or mew-user-agent-compose with parsing RFC2368." + (interactive + (list (read-from-minibuffer "Mew URL: "))) + (when (or (not (boundp 'mew-init-p)) (null mew-init-p)) + (save-excursion + (require 'mew) + (mew-init))) + (let* ((append-buffer (and mew-browse-append-file + (string= buffer-file-name + (expand-file-name mew-browse-append-file)))) + (append-nil (or append-buffer (not mew-browse-append-file))) + (append-all (and (not append-nil) mew-browse-append-always-file)) + (append-ask (and (not append-nil) (not mew-browse-append-always-file))) + (browse-all (or append-buffer mew-browse-noask)) + (browse-ask (and (not append-buffer) (not mew-browse-noask)))) + (string-match "\\([a-zA-Z0-9][-a-zA-Z0-9!_=?#$@~`%&*+|\\/.,:]+\\)" url) + (setq url (substring url (match-beginning 0) (match-end 0))) + (unless (string-match ":" url) ;; emacs19.28 only + (if (and (not mew-browse-append-always-mailto) + (not (y-or-n-p (format "mailto:%s(y) or ftp://%s(n)? " url url)))) + (setq url (concat "ftp://" url)) + (setq url (concat "mailto:" url)))) + (cond + ((and append-all browse-all) + (mew-browse-url-append url) + (mew-browse-url-start url)) + ((and append-ask browse-all) + (when (y-or-n-p (format "Append %s? " url)) + (mew-browse-url-append url)) + (mew-browse-url-start url)) + ((and append-nil browse-all) + (mew-browse-url-start url)) + ((and append-all browse-ask) + (mew-browse-url-append url) + (when (y-or-n-p (format "Browse %s? " url)) + (mew-browse-url-start url))) + ((and append-nil browse-ask) + (when (y-or-n-p (format "Browse %s? " url)) + (mew-browse-url-start url))) + (t ;; (and append-ask browse-ask) + (if (y-or-n-p (format "Browse %s(y) or Append(n)? " url)) + (mew-browse-url-start url) + (mew-browse-url-append url))) + ))) + +(defun mew-browse-url-append (url) + (let ((file (expand-file-name mew-browse-append-file)) + (beg)) + (save-excursion + (find-file file) + (set-buffer (current-buffer)) + (goto-char (point-min)) + (while (search-forward url nil t) + (progn + (beginning-of-line) + (setq beg (point)) + (forward-line) + (delete-region beg (point)))) + (goto-char (point-max)) + (insert url "\n") + (when mew-browse-append-file-sort + (sort-lines nil (point-min) (point-max))) + (write-file file) + (kill-buffer (current-buffer)) + (message "Append %s to %s done" url file) + ))) + +(defun mew-browse-url-start (url) + (message "Browse %s" url) + (cond + ((string-match "^mailto:" url) + (mew-url-mailto url)) + ((and (symbolp mew-ext-prog-url) (fboundp mew-ext-prog-url)) + (funcall mew-ext-prog-url url)) + ((equal mew-ext-prog-url "w3") + (require 'w3) + (w3-fetch-other-frame url)) + (t + (let ((orig mew-ext-prog-url-args) + args replace) + (while orig + (if (string-match "%s" (car orig)) + (progn + (setq args (cons (format (car orig) url) args)) + (setq esqp t) + (setq replace t)) + (setq args (cons (car orig) args))) + (setq orig (cdr orig))) + (setq args (nreverse args)) + (apply (function start-process) + (format "*mew %s*" mew-ext-prog-url) + nil mew-ext-prog-url + (if replace + args + (append args (list url)))))))) + +(defun mew-url-mailto (url) + "Execute mew-user-agent-compose with parsing RFC2368. + +If use from emacs-w3m, add followings in your ~/.emacs file. + (setq w3m-mailto-url-function 'mew-url-mailto) + +If use from MS-Windows application, set followings in your registry. + registry key: '\\HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\mailto\\shell\\open\\command' + registry value: 'drive:\\path\\gnudoitw.exe \"(mew-url-mailto \"%%1\")\"'" + (interactive + (list (read-from-minibuffer "Mew mailto: "))) + (when (or (not (boundp 'mew-init-p)) (null mew-init-p)) + (save-excursion + (require 'mew) + (mew-init))) + (let ((lst (mew-browse-url-mailto-analysis url))) + (mew-user-agent-compose (nth 0 lst) ;; to + (nth 1 lst) ;; subject + (nth 2 lst) ;; other + nil mew-browse-url-mailto-switch-func))) + +(defun mew-url-mailto-mozex (url) + "Execute mew-user-agent-compose from Mozilla and Firefox with MozEx. + +If use this command, set followings on Mailer form of MozEx. +\"/path/gnudoit (mew-url-mailto-mozex \"%r\")\" +or +\"/path/emacseval (mew-url-mailto-mozex \"%r\")\" + +`emacseval' is a shell script like this, +----cut here---- +#!/bin/sh +/usr/local/bin/emacsclient --eval \"`echo $*`\" +----cut here----" + (interactive) + (when (or (not (boundp 'mew-init-p)) (null mew-init-p)) + (save-excursion + (require 'mew) + (mew-init))) + (let ((lst (mew-browse-url-mailto-analysis url 'mozex))) + (mew-user-agent-compose (nth 0 lst) ;; to + (nth 1 lst) ;; subject + (nth 2 lst) ;; other + nil mew-browse-url-mailto-switch-func))) + +;; return '(to subject other)" +(defun mew-browse-url-mailto-analysis (url &optional mozex) + (let (to subject other) + (while (string-match "[ \t]+" url) + (setq url (concat (substring url 0 (match-beginning 0)) + (substring url (match-end 0))))) + (if (string-match "^mailto:" url) + (setq url (mew-browse-url-mailto-decamp (substring url (match-end 0)))) + (setq url (mew-browse-url-mailto-decamp url))) + (when (string-match "^\\([^?]+\\)" url) + (setq to (mew-browse-url-mailto-hex-to-string + (substring url (match-beginning 1) (match-end 1)))) + (setq url (substring url (match-end 0)))) + (while (string-match "^[?&]\\([^=]+\\)=\\([^&]*\\)" url) + (let ((hname (substring url (match-beginning 1) (match-end 1))) + (hvalue (mew-browse-url-mailto-hex-to-string + (substring url (match-beginning 2) (match-end 2))))) + (setq url (substring url (match-end 0))) + (when mozex + (setq hname (mew-browse-url-mailto-hex-to-string hname)) + (while (string-match "[ \t\n]+" hname) + (setq hname (replace-match "" nil nil hname))) + (when (string-match "[ \t\n]+$" hvalue) + (setq hvalue (replace-match "" nil nil hvalue)))) + (cond + ((string-match "^to$" hname) + (if to + (setq to (concat to ", " hvalue)) + (setq to hvalue))) + ((string-match "^subject$" hname) + (setq subject hvalue)) + (t + (setq other (cons (cons (capitalize hname) hvalue) other)))))) + `(,to ,subject ,other))) + +(defun mew-browse-url-mailto-decamp (str) + (save-match-data + (while (string-match "&" str) + (setq str (concat (substring str 0 (match-beginning 0)) + "&" + (substring str (match-end 0))))) + str)) + +(defun mew-browse-url-mailto-hex-to-string (str) + (save-match-data + (with-temp-buffer + (insert str) + (goto-char (point-min)) + (let ((doit t) char cs) + (while (re-search-forward "%\\([0-9a-fA-F][0-9a-fA-F]\\)" nil t) + (setq char (mew-browse-url-mailto-2hexs-to-int + (buffer-substring (match-beginning 1) (match-end 1)))) + (delete-region (match-beginning 0) (match-end 0)) + (insert char)) + (setq cs (mew-charset-to-cs + (mew-charset-guess-region (point-min) (point-max)))) + (when (or (not cs) + (eq cs mew-cs-unknown)) + (setq cs mew-cs-autoconv)) + (when (and (eq cs 'utf-8) + (not mew-internal-utf-8p) + (not (featurep 'un-define))) + (condition-case nil + (require 'un-define) + (file-error + (setq doit nil) + (delete-region (point-min) (point-max)) + (insert "Install Mule-UCS for UTF-8.\n")))) + (when doit + (mew-set-buffer-multibyte nil) + (decode-coding-region (point-min) (point-max) cs) + (mew-set-buffer-multibyte t)) + (buffer-string))))) + +(defun mew-browse-url-mailto-2hexs-to-int (hex) + (+ (* 16 (mew-hexchar-to-int (aref hex 0))) + (mew-hexchar-to-int (aref hex 1)))) + +(provide 'mew-browse) + +;;; Copyright Notice: + +;; Copyright (C) 1999-2004 Mew developing team. +;; All rights reserved. + +;; Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions +;; are met: +;; +;; 1. Redistributions of source code must retain the above copyright +;; notice, this list of conditions and the following disclaimer. +;; 2. Redistributions in binary form must reproduce the above copyright +;; notice, this list of conditions and the following disclaimer in the +;; documentation and/or other materials provided with the distribution. +;; 3. Neither the name of the team nor the names of its contributors +;; may be used to endorse or promote products derived from this software +;; without specific prior written permission. +;; +;; THIS SOFTWARE IS PROVIDED BY THE TEAM AND CONTRIBUTORS ``AS IS'' AND +;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +;; PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE TEAM OR CONTRIBUTORS BE +;; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +;;; mew-browse.el ends here diff -urN mew.orig/contrib/mew-caesar.el mew/contrib/mew-caesar.el --- mew.orig/contrib/mew-caesar.el 1970-01-01 09:00:00.000000000 +0900 +++ mew/contrib/mew-caesar.el 2011-06-15 00:20:15.000000000 +0900 @@ -0,0 +1,242 @@ +;; -*- emacs-lisp -*- +;; +;; mew-caesar.el --- Caesar encrypt/decrypt assistant package for Mew. +;; +;; Author: Hideyuki SHIRAI +;; Created: <02/07/1998> +;; +;; To use mew-caesar.el, install (tm|SEMI) package or "nkf" +;; , and put the following codes in your .emacs. +;; +;; (add-hook 'mew-init-hook +;; (lambda () +;; (require 'mew-caesar))) +;; + +(eval-when-compile + (require 'mew)) + +(defconst mew-caesar-version "mew-caesar.el 0.21") + +(defvar mew-caesar-ext-prog + (let (extprog) + (cond + ((or (memq system-type '(OS/2 emx)) + (eq system-type 'windows-nt)) + (cond + ((setq extprog (mew-which "nkf.exe" exec-path)) + extprog) + ((setq extprog (mew-which "nkf32.exe" exec-path)) + extprog) + (t nil))) + (t (setq extprog (mew-which "nkf" exec-path)) + extprog))) + "mew-caesar external program. + Usually, auto searched \"nkf\", \"nkf.exe\" or \"nkf32.exe\"." + ) + +(defvar mew-caesar-ext-prog-arg '("-r")) + +(defvar mew-caesar-function + (cond + ((or (featurep 'mule-caesar) + (locate-library "mule-caesar")) + (require 'mule-caesar) + 'semi) + ((or (featurep 'tm-def) + (locate-library "tm-def")) + (require 'tm-def) + 'tm) + (mew-caesar-ext-prog + 'ext) + (t + (message "mew-caesar: program is not found") + nil)) + "mew-caesar function select. + Usually auto selected, which + 'semi(mule-caesar), 'tm(tm:caesar-region) or 'ext(mew-caesar-ext-prog)." + ) + +(defvar mew-caesar-prog-xrot '(mew-caesar-mime-text/x-rot () nil)) +(defconst mew-caesar-ct-rot13 "Text/X-Rot13-47-48") +(defconst mew-caesar-rot13-suffix ".rot") + +(define-key mew-summary-mode-map "\C-cr" 'mew-caesar-summary-insert-xrot) +(define-key mew-draft-attach-map "R" 'mew-caesar-attach-find-new-xrot) + +(setq mew-mime-content-type + (append + '(("text/x-rot13-47-48" "\\.rot$" nil mew-caesar-prog-xrot mew-icon-text) + ("text/x-rot13.*" "\\.rot$" nil mew-caesar-prog-xrot mew-icon-text)) + mew-mime-content-type)) + +(defun mew-caesar-mime-text/x-rot (cache beg end &optional params execute) + (if (> end beg) + (save-excursion + (set-buffer (mew-buffer-message)) + (let ((buffer-read-only nil)) + (insert " # # ###### ####### ####### # #####\n" + " # # # # # # # ## # #\n" + " # # # # # # # # # #\n" + " # ##### ###### # # # # #####\n" + " # # # # # # # # #\n" + " # # # # # # # # # #\n" + " # # # # ####### # ##### #####\n" + "\n") + (insert "To save this part, type " + (substitute-command-keys + "\\\\[mew-summary-save].") + "\nTo display this part in Message mode, type " + (substitute-command-keys + "\\\\[mew-caesar-summary-insert-xrot].")) + (insert "\n\n-------------------- Original \"X-ROT13\" follows --------------------\n") + (insert-buffer-substring cache beg end) + )))) + +(defun mew-caesar-summary-insert-xrot () + (interactive) + (mew-summary-part + (let* ((fld (mew-current-get-fld (mew-frame-id))) + (msg (mew-current-get-msg (mew-frame-id))) + (part (mew-syntax-nums)) + (cache (mew-cache-hit fld msg 'must-hit)) + (syntax (mew-cache-decode-syntax cache)) + (stx (mew-syntax-get-entry syntax part)) + (beg (mew-syntax-get-begin stx)) + (end (mew-syntax-get-end stx)) + (win (selected-window))) + (unwind-protect + (progn + (mew-summary-toggle-disp-msg 'on) + (mew-window-configure 'message) + (set-buffer (mew-buffer-message)) + (mew-elet + (mew-summary-display-preamble) + (insert-buffer-substring cache beg end) + (mew-caesar-whole-buffer) + ;; (goto-char (point-min)) + (mew-summary-display-postscript))) + (select-window win))))) + +(defun mew-caesar-attach-find-new-xrot () + "Open a new Caesar encrypt file into a buffer on \".\" in attachments." + (interactive) + (if (not (mew-attach-not-line012-1)) + (message "Cannot find a new file here") + (let* ((nums (mew-syntax-nums)) + (subdir (mew-attach-expand-path mew-encode-syntax nums)) + (attachdir (mew-attachdir)) + file filepath) + ;; attachdir / {subdir/} dir + (if (not (equal subdir "")) + (setq attachdir (expand-file-name subdir attachdir))) + ;; attachdir / file + (setq filepath (mew-random-filename attachdir 1 nil mew-caesar-rot13-suffix)) + (if (null filepath) + (message "Could not make a text file, sorry") + (setq file (file-name-nondirectory filepath)) + (setq mew-encode-syntax + (mew-syntax-insert-entry + mew-encode-syntax + nums + (mew-encode-syntax-single file (list mew-caesar-ct-rot13)))) + (mew-encode-syntax-print mew-encode-syntax) + ;; + (find-file filepath) + ;; buffer switched + (setq mode-name "X-Rot13") + (setq mode-line-buffer-identification mew-mode-line-id) + (local-set-key "\C-c\C-q" 'mew-kill-buffer) + (local-set-key "\C-cr" 'mew-caesar-whole-buffer) + (local-set-key "\C-c\C-s" 'mew-caesar-save-exit) + (insert " # # ###### ####### ####### # #####\n" + " # # # # # # # ## # #\n" + " # # # # # # # # # #\n" + " # ##### ###### # # # # #####\n" + " # # # # # # # # #\n" + " # # # # # # # # # #\n" + " # # # # ####### # ##### #####\n") + (insert "\n define-key \"\\C-cr\" -> mew-caesar-whole-buffer.") + (insert "\n define-key \"\\C-c\\C-s\" -> mew-caesar-save-exit.") + (insert "\n\n Press any key to start editting.") + (read-char-exclusive) + (delete-region (point-min) (point-max)) + (run-hooks 'mew-caesar-xrot-mode-hook) + )))) + +(defun mew-caesar-save-exit () + "Caesar encrypt/decrypt at whole buffer, save and exit." + (interactive) + (mew-caesar-whole-buffer) + (if (y-or-n-p (format "Save & Exit ?")) + (progn + (save-buffer) + (kill-buffer (current-buffer))) + (mew-caesar-whole-buffer))) + +(defun mew-caesar-whole-buffer () + "Caesar encrypt/decrypt at whole buffer." + (interactive) + (mew-caesar-region (point-min) (point-max))) + +(defun mew-caesar-region (min max) + "Caesar encrypt/decrypt in region." + (interactive "r") + (save-excursion + (cond + ((eq mew-caesar-function 'semi) + (mule-caesar-region min max)) + ((eq mew-caesar-function 'tm) + (progn + (goto-char min) + (push-mark (point) nil t) + (goto-char max) + (tm:caesar-region))) + ((and (eq mew-caesar-function 'ext) + mew-caesar-ext-prog mew-caesar-ext-prog-arg) + (save-excursion + (mew-piolet + mew-cs-autoconv mew-cs-m17n + (apply (function call-process-region) + min max + mew-caesar-ext-prog + t t nil + mew-caesar-ext-prog-arg)))) + (t + (message "mew-caesar: program is not found"))) + )) + +(provide 'mew-caesar) + +;;; Copyright Notice: + +;; Copyright (C) 1998-2000 Hideyuki SHIRAI +;; Copyright (C) 1994-2000 Mew developing team. +;; All rights reserved. + +;; Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions +;; are met: +;; +;; 1. Redistributions of source code must retain the above copyright +;; notice, this list of conditions and the following disclaimer. +;; 2. Redistributions in binary form must reproduce the above copyright +;; notice, this list of conditions and the following disclaimer in the +;; documentation and/or other materials provided with the distribution. +;; 3. Neither the name of the team nor the names of its contributors +;; may be used to endorse or promote products derived from this software +;; without specific prior written permission. +;; +;; THIS SOFTWARE IS PROVIDED BY THE TEAM AND CONTRIBUTORS ``AS IS'' AND +;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +;; PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE TEAM OR CONTRIBUTORS BE +;; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +;;; mew-caesar.el ends here diff -urN mew.orig/contrib/mew-edebug.el mew/contrib/mew-edebug.el --- mew.orig/contrib/mew-edebug.el 1970-01-01 09:00:00.000000000 +0900 +++ mew/contrib/mew-edebug.el 2011-06-20 01:46:27.000000000 +0900 @@ -0,0 +1,145 @@ +;; mew-edebug.el --- Help for using edebug for macros in Mew + +;; Author: Sen Nagata +;; Created: Nov 11, 2001 +;; Version: 0.3 + +;; Set-up: +;; +;; Put this file somewhere in your `load-path' and the following in +;; your .emacs: +;; +;; (add-hook 'mew-init-hook +;; '(lambda () +;; (require 'mew-edebug))) +;; +;; Upon instrumenting a function with `edebug-defun', +;; `mew-edebug-macro-init' will be run to instrument Mew macros. + +;; Issues: +;; +;; I've tested many of the macros below with edebug. Although most +;; appear to work, I experienced problems with some +;; (e.g. `mew-time-rfc-*'). I don't know what the problem is yet, but +;; my current suspicion is that it has something to do with +;; `defsubst'. + +;;; Code: + +(require 'mew) + +(defvar mew-macro-names + '( + mew-header-encode-cond + mew-header-encode-cond2 + mew-complete-proto-folder + mew-decode-narrow-to-header + mew-draft-privacy-switch + mew-summary-header-mode + mew-no-warning-defvar + mew-no-warning-defun + mew-ntake + mew-add-first + mew-addq + mew-insert-after + mew-replace-with + mew-remove-entry + mew-folder-insert + mew-folder-delete + mew-elet + mew-filter + mew-time-rfc-day + mew-time-rfc-mon + mew-time-rfc-year + mew-time-rfc-hour + mew-time-rfc-min + mew-time-rfc-sec + mew-time-rfc-tmzn + mew-rendezvous + mew-defstruct + mew-defstruct-constructor + mew-defstruct-s/getter + mew-addrstr-parse-syntax-list-check-depth + mew-mark-alist-set + mew-mode-input-file-name + mew-mode-input-directory-name + mew-plet + mew-piolet + mew-flet + mew-frwlet + mew-alet + mew-passwd-rendezvous + mew-dolist-eob + mew-pick-lex-cut + mew-summary-refilable + mew-msgid-check + mew-summary-msg-or-part + mew-summary-msg + mew-summary-part + mew-summary-multi-msgs + mew-summary-only + mew-virtual-only + mew-thread-only + mew-pickable + mew-summary-not-in-queue + mew-summary-not-in-draft + mew-summary-not-in-nntp + mew-summary-local-or-imap + mew-summary-local-only + mew-summary-with-mewl + mew-summary-prepare-draft + mew-setface + mew-setface-bold + mew-defface + mew-defface-bold + )) + +(defun mew-edebug-macro-init () + "Call `def-edebug-spec' for each macro in `mew-macro-names'. + +This function should be invoked before instrumenting a function for +use with edebug." + (interactive) + (let ((macro-names mew-macro-names)) + (while macro-names + (eval `(def-edebug-spec ,(car macro-names) t)) + (setq macro-names (cdr macro-names))))) + +;; instrument Mew macros when edebug is used +(add-hook 'edebug-setup-hook + '(lambda () + (mew-edebug-macro-init))) + +(provide 'mew-edebug) + +;;; Copyright Notice: + +;; Copyright (C) 2001 Mew developing team. +;; All rights reserved. + +;; Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions +;; are met: +;; +;; 1. Redistributions of source code must retain the above copyright +;; notice, this list of conditions and the following disclaimer. +;; 2. Redistributions in binary form must reproduce the above copyright +;; notice, this list of conditions and the following disclaimer in the +;; documentation and/or other materials provided with the distribution. +;; 3. Neither the name of the team nor the names of its contributors +;; may be used to endorse or promote products derived from this software +;; without specific prior written permission. +;; +;; THIS SOFTWARE IS PROVIDED BY THE TEAM AND CONTRIBUTORS ``AS IS'' AND +;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +;; PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE TEAM OR CONTRIBUTORS BE +;; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +;;; mew-edebug.el ends here diff -urN mew.orig/contrib/mew-fancy-summary.el mew/contrib/mew-fancy-summary.el --- mew.orig/contrib/mew-fancy-summary.el 1970-01-01 09:00:00.000000000 +0900 +++ mew/contrib/mew-fancy-summary.el 2011-06-15 00:20:15.000000000 +0900 @@ -0,0 +1,565 @@ +;;; mew-fancy-summary.el --- Fontify Mew summary buffer +;; +;; Author: Shun-ichi TAHARA +;; Hideyuki SHIRAI +;; +;; Time-stamp: <03/13/2002 20:45 shirai> + +;;; Commentary: +;; +;; HOW TO USE +;; +;; 1. Set some customize variables and faces as you like. +;; +;; 2. Require this file in your init file of Emacsen. +;; +;; (add-hook 'mew-init-hook (lambda () (require 'mew-fancy-summary))) +;; +;; 3. BE SURE TO USE jit-lock, lazy-shot or lazy-lock. +;; +;; ;;; common setting +;; (require 'font-lock) +;; ;; (global-font-lock-mode t) ;; as you like. +;; +;; ;;; jit-lock-mode (for Emacs-21) +;; (setq font-lock-support-mode 'jit-lock-mode) ;; system default value. +;; +;; ;;; lazy-shot-mode (for XEmacs) +;; (require 'font-lock) +;; (setq font-lock-support-mode 'lazy-shot-mode) +;; (setq lazy-shot-verbose nil) +;; (setq lazy-shot-stealth-verbose nil) +;; +;; ;;; lazy-lock-mode (for All Emacsen) +;; (require 'font-lock) +;; (setq font-lock-support-mode 'lazy-lock-mode) +;; (when (featurep 'xemacs) +;; (setq lazy-lock-minimum-size 0)) +;; +;; 4. If you use 'jit-lock-mode' and feel 'scan is too slow' +;; , please put bellow code to your init file. +;; +;; (add-hook 'mew-init-hook +;; (lambda () +;; (defvar mew-fancy-disable nil) +;; (make-variable-buffer-local 'mew-fancy-disable) +;; (defadvice mew-scan (before fancy-disable activate) +;; (setq mew-fancy-disable t)) +;; (defadvice mew-scan-filter (before fancy-disable activate) +;; (when (and mew-fancy-disable font-lock-mode) +;; (setq mew-fancy-disable nil) +;; (font-lock-mode -1))) +;; )) +;; +;; BUGS +;; +;; 1. If you choice 'lazy-lock-mode', mew-summary-cook-folders() becomes +;; too slow. +;; + +;;; Code: + +(eval-when-compile (require 'mew)) +(defconst mew-fancy-summary-version "mew-fancy-summary 0.23") + +;;; User-customizable variables + +(defcustom mew-fancy-summary-face-spec + '((num . mew-fancy-summary-face-marginal) + (size . mew-fancy-summary-face-marginal) + (type . mew-fancy-summary-face-type) + (from . "From:") + (subj . "Subject:") + (date . "Date:") + (year . "Date:") + (time . "Date:")) + "*Alist of face specs for fancy-summary mode, corresponding to +scan-form entries. Each entry consists of a pair of symbol or string +and face, header name or function. + +The symbol is what can be set in scan-form, including user-extended +entry. + +If you want to highlight the raw string in 'mew-scan-form', put the +string and the corresponding face (or another possible) in this alist. +Also define the face, if needed. + +The face and the function are both set as a symbol in cdr of each +entry. As a special case, you can specify 'nil' not to highlight the +field. + +If the symbol is a function name, the function is called with an +integer argument indicating the width of the field (or 0 means +unlimited) and with the pointer pointing the top of the field to be +highlighted. In the function, you can fontify it as you like, and no +return values are needed (even the cursor position need not be cared). + +The string in cdr of the entry indicates a header name, and a face is +decided by 'mew-field-spec' with the header name." + :group 'mew-highlight + :type '(repeat (cons (choice symbol string) (choice face string function)))) + +(defcustom mew-fancy-summary-extended-face-spec + '((truncated . mew-fancy-summary-face-truncated) + (thread . mew-fancy-summary-face-marginal) + (special . mew-fancy-summary-face-special) + (ml . mew-fancy-summary-face-tag) + (attach . mew-fancy-summary-face-marginal) + (to . "To:")) + "*Alist of face specs for fancy-summary mode, not corresponding to +scan-form entries. Each entry consists of a pair of symbol and face, +header name or function. + +Symbol is one of those: 'truncated' for 'T' mark in the 'type' field +in scan-form, 'thread' for a thread indent, 'special' for the special +person (see also 'mew-fancy-summary-special-*'), 'ml' for a subject +prefix of ML (see also 'mew-fancy-summary-ml-regex'), and 'attach' for +a attachment line. + +For cdr of each element, see 'mew-fancy-summary-face-spec'." + :group 'mew-highlight + :type '(repeat (cons (choice symbol string) (choice face string function)))) + +(defcustom mew-fancy-summary-special-persons nil + "*List of the 'special' persons. + +If the From: header matches a member of this list, 'special' entry of +'mew-fancy-summary-extended-face-spec' is used for highlighting 'from' +part of scan-form." + :group 'mew-highlight + :type '(repeat string)) + +(defcustom mew-fancy-summary-special-addrbook nil + "*If non-nil, nicknames in the addrbook are treated as 'special' +person." + :group 'mew-highlight + :type 'boolean) + +(defcustom mew-fancy-summary-special-to t + "*If non-nil, 'from' part of scan-form about an entry of the mail +destinated to 'special' person (then displayed To: header) are also +highlighted specially." + :group 'mew-highlight + :type 'boolean) + +(defcustom mew-fancy-summary-ml-regex "[\[(][^])|\n\r]*[\])|]" + "*Regex string as a prefix of the subject of mails posted to ML." + :group 'mew-highlight + :type 'regexp) + +(defcustom mew-fancy-summary-external-highlighting-hook nil + "*Hook called to highlight an abnormal line. + +If the function in the hook highlighted the line successfully, it must +return t, otherwise nil." + :group 'mew-highlight + :type 'hook) + +;;; Faces + +(defface mew-fancy-summary-face-marginal nil + "*Face to highlight the marginal part of Summary buffer." + :group 'mew-highlight) + +(defface mew-fancy-summary-face-type nil + "*Face to highlight 'type' part of Summary buffer (except 'T' mark)." + :group 'mew-highlight) + +(defface mew-fancy-summary-face-truncated nil + "*Face to highlight 'T' mark at 'type' part of Summary buffer." + :group 'mew-highlight) + +(defface mew-fancy-summary-face-special nil + "*Face to highlight the special person in 'from' part of Summary buffer." + :group 'mew-highlight) + +(defface mew-fancy-summary-face-tag nil + "*Face to highlight the tag part of Summary buffer." + :group 'mew-highlight) + +;;; End of user-customizable stuffs + +;;; Internal variables + +(defvar mew-fancy-summary-special-list nil) +(defvar mew-fancy-summary-special-alist nil) + +(defvar mew-fancy-summary-scan-form nil) +(make-variable-buffer-local 'mew-fancy-summary-scan-form) + +(defvar mew-fancy-summary-thread-column nil) +(make-variable-buffer-local 'mew-fancy-summary-thread-column) + +;;; Initialization + +(add-hook 'mew-summary-mode-hook 'mew-fancy-summary-enable) +(add-hook 'mew-virtual-mode-hook 'mew-fancy-summary-enable) +(add-hook 'mew-thread-display-hook 'mew-fancy-summary-thread-enable) +(add-hook 'mew-pop-sentinel-hook 'mew-fancy-summary-block) +(add-hook 'mew-scan-sentinel-hook 'mew-fancy-summary-block) + +(setq mew-use-highlight-mark nil) ; Hilight mark by itself, not by Mew + +(defalias 'mew-summary-cook-region 'mew-fancy-summary-make-invisible-region) +(defalias 'mew-highlight-mark-line 'mew-fancy-summary-mark-line) +(defalias 'mew-highlight-unmark-line 'mew-fancy-summary-mark-line) + +;;; Setup + +(defadvice mew-addrbook-setup (after hl-setup activate) + "Setup fancy-summary when starting up Mew or executing \"Z\"." + (mew-fancy-summary-special-setup)) + +(defun mew-fancy-summary-special-setup () + (setq mew-fancy-summary-special-list mew-fancy-summary-special-persons) + (when mew-fancy-summary-special-addrbook + (let ((addrbook mew-addrbook-alist) nickname) + (while addrbook + (setq nickname (nth 2 (car addrbook))) + (when (and (stringp nickname) + (not (member nickname mew-fancy-summary-special-list))) + (setq mew-fancy-summary-special-list + (cons nickname mew-fancy-summary-special-list))) + (setq addrbook (cdr addrbook)))))) + +;;; Workarounds about highlighting in Mew + +(defun mew-fancy-summary-remove-invisible () + "Remove the invisible hook in Mew." + (jit-lock-unregister 'mew-summary-cook-region) + (remove-hook 'window-scroll-functions 'mew-summary-cook-window 'local) + (remove-hook 'pre-idle-hook 'mew-summary-cook-window)) + +(defun mew-fancy-summary-make-invisible-region (beg end &optional interrupt) + "Faster invisible function for summary with many text properties." + (when (and (memq major-mode + '(mew-summary-mode mew-virtual-mode mew-refile-view-mode)) + mew-summary-buffer-raw) + (let ((inhibit-point-motion-hooks t) ret start) + (catch 'loop + (mew-elet + (save-excursion + (goto-char beg) + (while (and (< (point) end) + (search-forward "\r" end t)) + (setq start (match-beginning 0)) + (unless (get-text-property start 'invisible) + (put-text-property start (line-end-position) 'invisible t)) + (forward-line) + (when (and interrupt (input-pending-p)) + (throw 'loop (setq ret t))))))) + (set-buffer-modified-p nil) + ret))) + +(defun mew-fancy-summary-mark-line (&rest args) + "Highlighting mark and unmark line is done by mew-fancy-summary." + (save-excursion + (mew-fancy-summary-region (point) (point) nil 'strip))) + +;;; Activating fancy summary + +(defun mew-fancy-summary-enable () + "Activate mew-fancy-summary in summary or virtual buffer." + (mew-fancy-summary-remove-invisible) + (unless (mew-thread-p) + (set (make-local-variable 'font-lock-fontify-buffer-function) + 'mew-fancy-summary-buffer) + (when (boundp 'font-lock-function) + (set (make-local-variable 'font-lock-function) + 'mew-fancy-summary-font-lock-function)) + (set (make-local-variable 'font-lock-fontify-region-function) + 'mew-fancy-summary-region) + (setq mew-fancy-summary-scan-form + (mew-get-summary-form (mew-summary-folder-name 'ext))) + (setq mew-fancy-summary-thread-column -1) + (font-lock-mode 1))) + +(defun mew-fancy-summary-font-lock-function (font-lock-mode) + (when font-lock-mode + (add-hook 'after-change-functions 'font-lock-after-change-function t t) + (font-lock-turn-on-thing-lock)) + (unless font-lock-mode + (remove-hook 'after-change-functions 'font-lock-after-change-function t) + (font-lock-unfontify-buffer) + (font-lock-turn-off-thing-lock))) + +(defun mew-fancy-summary-thread-enable () + "Activate mew-fancy-summary in thread buffer." + (when (mew-thread-p) + (mew-fancy-summary-remove-invisible) + (setq mew-fancy-summary-scan-form + (mew-get-summary-form (substring (mew-summary-folder-name 'ext) 1))) + (setq mew-fancy-summary-thread-column (mew-vinfo-get-column)) + (when (boundp 'font-lock-function) + (set (make-local-variable 'font-lock-function) + 'mew-fancy-summary-font-lock-function)) + (set (make-local-variable 'font-lock-fontify-buffer-function) + 'mew-fancy-summary-buffer) + (set (make-local-variable 'font-lock-fontify-region-function) + 'mew-fancy-summary-region) + (font-lock-mode 1))) + +;;; macros + +(defmacro mew-fancy-summary-get-face (key extended) + `(let ((face (cdr (assoc ,key (if ,extended + mew-fancy-summary-extended-face-spec + mew-fancy-summary-face-spec))))) + (if (stringp face) + (or (mew-nspec-valface (mew-nspec-by-key face)) + 'mew-face-header-marginal) + face))) + +(defsubst mew-fancy-summary-special-p (key len) + (when (and mew-fancy-summary-special-list (> (length key) 0)) + (member key (or (cdr (assq len mew-fancy-summary-special-alist)) + (let ((special mew-fancy-summary-special-list) + lst str) + (while special + (setq str (truncate-string-to-width (car special) len)) + (when (string-match "^.+\\( +\\)$" str) + (setq str (substring str 0 (match-beginning 1)))) + (setq lst (cons str lst)) + (setq special (cdr special))) + (setq mew-fancy-summary-special-alist + (cons (cons len lst) mew-fancy-summary-special-alist)) + lst))))) + +;;; Main + +(defun mew-fancy-summary-block () + (font-lock-mode 1)) + +(defun mew-fancy-summary-buffer () + "Highlight summary buffer with font-lock-mode." + (interactive) + (mew-fancy-summary-region (point-min) (point-max))) + +(defun mew-fancy-summary-region (beg end &optional loudly strip) + "Highlight the region of summary buffer with font-lock-mode." + (interactive "r") + (let ((pos (point)) linebeg lineend col numend) + (when (memq major-mode + '(mew-summary-mode mew-virtual-mode mew-refile-view-mode)) + (mew-elet + (setq end (progn (goto-char end) + (forward-line) + (point))) + (setq beg (progn (goto-char beg) + (beginning-of-line) + (point))) + (when strip + (put-text-property beg end 'face nil)) + (mew-fancy-summary-make-invisible-region beg end) + ;; Highlight each line + (while (< (point) end) + (setq linebeg (point)) + (setq col 0) + (cond + ;; unread line + ((and (not (mew-in-decode-syntax-p)) + (setq numend (point-min)) + (eq (char-after) mew-mark-unread)) + (let ((form mew-fancy-summary-scan-form) entry) + (while form + (setq entry (car form)) + (when (= col mew-fancy-summary-thread-column) + (setq col (+ col (mew-fancy-summary-do-highlight 'thread t)))) + (setq col (+ col (mew-fancy-summary-do-highlight entry nil numend))) + (setq form (cdr form)))) + (looking-at "[^\r\n]*") + (setq lineend (match-end 0)) + (put-text-property linebeg (1+ linebeg) 'face 'mew-face-mark-unread)) + ;; Normal line + ((and (not (mew-in-decode-syntax-p)) + (setq numend (point-min)) + (not (looking-at mew-regex-mark))) + (let ((form mew-fancy-summary-scan-form) entry) + (while form + (setq entry (car form)) + (when (= col mew-fancy-summary-thread-column) + (setq col (+ col (mew-fancy-summary-do-highlight 'thread t)))) + (setq col (+ col (mew-fancy-summary-do-highlight entry nil numend))) + (setq form (cdr form)))) + (looking-at "[^\r\n]*") + (setq lineend (match-end 0))) + ;; Marked line + ((and (not (mew-in-decode-syntax-p)) + (looking-at mew-regex-mark)) + (let ((mark (string-to-char (match-string 0)))) + (looking-at "[^\r\n]*") + (setq lineend (match-end 0)) + (put-text-property linebeg lineend + 'face (mew-highlight-mark-get-face mark)))) + ;; Others (usually, expanded multi-part) + (t + (unless (run-hook-with-args-until-success + ;; Highlight thread separator or folder of refile-view + ;; by your custom function + 'mew-fancy-summary-external-highlighting-hook nil) + (setq lineend (progn (end-of-line) (point))) + (put-text-property linebeg lineend + 'face (mew-fancy-summary-get-face 'attach t)) + (when mew-use-highlight-mouse-line + (remove-text-properties linebeg (min (1+ lineend) (point-max)) + '(mouse-face)))))) + (when mew-use-highlight-mouse-line + (put-text-property linebeg lineend + 'mouse-face mew-highlight-mouse-line-face)) + (forward-line))) + (set-buffer-modified-p nil) + (goto-char pos)))) + +;;; +(defun mew-fancy-summary-do-highlight (entry &optional extended numend) + (let ((l 0) (col (current-column)) beg end range face + (spec (mew-fancy-summary-get-spec entry extended))) + (while spec + (setq range (car (car spec))) + (setq face (cdr (car spec))) + (cond + ((eq range 'num) + (if (fboundp face) + (funcall face (- numend (point))) + (put-text-property (point) numend 'face face)) + (setq l (+ l (- numend (point)))) + (goto-char numend) + (setq col (current-column))) + ((stringp range) + (when (looking-at range) + (setq beg (match-beginning 0)) + (setq end (match-end 0)) + (if (fboundp face) + (funcall face range) + (put-text-property beg end 'face face)) + (goto-char end) + (setq l (+ l (- (current-column) col))) + (setq col (current-column)))) + ((> range 0) + (setq col (+ col (- range l))) + (setq beg (point)) + (if (fboundp face) + (funcall face (- range l)) + (move-to-column col) + (put-text-property beg (point) 'face face)) + (setq l range))) + (setq spec (cdr spec))) + l)) + +(defun mew-fancy-summary-get-spec (entry extended) + (let ((range (cond + ((stringp entry) (string-width entry)) + ((listp entry) (abs (car entry))) + (t 1))) + (elem (cond + ((listp entry) (nth 1 entry)) + (t entry))) + face) + (if (= range 0) ; To the tail of line + (setq range "[^\r\n]*[^ \r\n]")) + (setq face (mew-fancy-summary-get-face elem extended)) + (cond + ((eq elem t) ;; thread indent + nil) + ((eq elem 'num) + (list (cons elem face))) + ((eq elem 'type) + (cond + ((looking-at "T") + (list (cons range (mew-fancy-summary-get-face 'truncated t)))) + ((looking-at "[^ ]") + (list (cons range face))) + (t + (list (cons range nil))))) + ((eq elem 'thread) + (let ((indent (get-text-property (point) 'mew-thread-indent))) + (if (or (null indent) (= indent 0)) + nil + (list (cons (string-width + (mew-buffer-substring + (point) + (next-single-property-change (point) 'mew-thread-indent))) + face))))) + ((eq elem 'from) + (let* ((beg (point)) + (entry (mew-buffer-substring + beg + (prog2 + (move-to-column (+ (current-column) range)) + (point) + (goto-char beg)))) + (prelen (and (stringp mew-summary-form-from-me-prefix) + (string-width mew-summary-form-from-me-prefix))) + elen) + (if (string-match "[^\r\n]*[^ \r\n]" entry) + (setq entry (substring entry (match-beginning 0) (match-end 0))) + (setq entry "")) + (setq elen (string-width entry)) + (if (not (and prelen (> prelen 0) + (eq (string-match mew-summary-form-from-me-prefix entry) 0))) + ;; Mail to me + (if (mew-fancy-summary-special-p entry range) + (list (cons elen (mew-fancy-summary-get-face 'special t)) + (cons range nil)) + (list (cons elen face) (cons range nil))) + ;; Mail from me + (setq face (mew-fancy-summary-get-face 'to t)) + (if (and prelen mew-fancy-summary-special-to + (mew-fancy-summary-special-p (substring entry prelen) + (- range prelen))) + (list (cons prelen face) + (cons elen (mew-fancy-summary-get-face 'special t)) + (cons range nil)) + (list (cons elen face) (cons range nil)))))) + ((eq elem 'subj) + (list (cons mew-fancy-summary-ml-regex + (mew-fancy-summary-get-face 'ml t)) + (cons + (if (> mew-fancy-summary-thread-column 0) + (save-excursion + (move-to-column mew-fancy-summary-thread-column) + (- range + (* (mew-thread-get-property (point)) + mew-thread-indent-width))) + range) + face))) + (t + (list (cons range face)))))) + +;;; + +(provide 'mew-fancy-summary) + +;;; Copyright Notice: + +;; Copyright (C) 2001 Shun-ichi TAHARA +;; Copyright (C) 1999-2001 Hideyuki SHIRAI +;; Copyright (C) 1994-2001 Mew developing team. +;; All rights reserved. + +;; Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions +;; are met: +;; +;; 1. Redistributions of source code must retain the above copyright +;; notice, this list of conditions and the following disclaimer. +;; 2. Redistributions in binary form must reproduce the above copyright +;; notice, this list of conditions and the following disclaimer in the +;; documentation and/or other materials provided with the distribution. +;; 3. Neither the name of the team nor the names of its contributors +;; may be used to endorse or promote products derived from this software +;; without specific prior written permission. +;; +;; THIS SOFTWARE IS PROVIDED BY THE TEAM AND CONTRIBUTORS ``AS IS'' AND +;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +;; PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE TEAM OR CONTRIBUTORS BE +;; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +;;; mew-fancy-summary.el ends here diff -urN mew.orig/contrib/mew-nmz-fixer.el mew/contrib/mew-nmz-fixer.el --- mew.orig/contrib/mew-nmz-fixer.el 1970-01-01 09:00:00.000000000 +0900 +++ mew/contrib/mew-nmz-fixer.el 2011-06-15 00:20:15.000000000 +0900 @@ -0,0 +1,138 @@ +;; -*- mode: Emacs-Lisp -*- +;; +;;; mew-nmz-fixer.el +;; +;; Author: Hideyuki SHIRAI +;; Created: 2001-01-14(Sun) +;; +;; nmz-mew-summary-fixer.pl $B$r;H$C$F!"(Bpack $B$d(B sort $B$7$?8e$K(B +;; mew-nmz $B7O(B Namazu index $B$r:G?7$KJ]$A$^$9!#(B +;; +;;; nmz-mew-summary-fixer.pl $B$O(B Rei FURUKAWA $B$5$s(B +;;; $B$,:n@.$7$?(B message $B$H(B index $B$NBP1~99?7(B Program $B$G$9!#(B +;; +;; +;;;; $B;H$$J}(B ($B$^$:(B mew-nmz $B$r;H$($k$h$&$K$7$F$*$-$^$7$g$&(B) +;; (eval-after-load "mew-nmz" '(require 'mew-nmz-fixer)) +;; + +(eval-when-compile + (require 'mew) + (require 'mew-nmz)) + +;;;; $B$3$s$J46$8$G(B key $B$K(B bind $B$9$k$bNI$7!#(B + +(add-hook 'mew-summary-mode-hook + (lambda () + (define-key mew-summary-mode-map "zf" 'mew-nmz-fixer-exec))) + +;; add-hook +(add-hook 'mew-sort-hook 'mew-nmz-fixer-exec) +(add-hook 'mew-pack-hook 'mew-nmz-fixer-exec) + +;; variable +(defvar mew-nmz-prog-fixer "nmz-mew-summary-fixer.pl" + "*nmz-mew-summary-fixer.pl $B$N(B Program $BL>!#(B +Windows $B$N?M$O(B \"nmz-mew-summary-fixer\" $B$N$h$&$K3HD%;R$rL5$/$7$?J}$,9,$;$+$b!#(B") + +(defvar mew-nmz-prog-fixer-args + (if (memq system-type '(OS/2 emx windows-nt)) + '("--windows-drive") '()) + "*nmz-mew-summary-fixer.pl $B$KM?$($k(B option$B!#(B") + +;; internal variable +(defvar mew-nmz-fixer-process nil) +(make-variable-buffer-local 'mew-nmz-fixer-process) + +;; function +(defun mew-nmz-fixer-exec (&optional arg) + "Sort/Pack $B$N8e$G(B \"mew-nmz-summary-fixer\" $B$r5/F0$9$k!#(B +\"Another fixer running.\" $B$H$$$o$l$F:$$C$?$H$-$O!"(B'\\[universal-argument]' $BIU$-$G8F$S$^$7$g$&!#(B" + (interactive "P") + (mew-summary-only + (let* ((interactive-p (interactive-p)) + (fld (if interactive-p + (mew-input-folder (mew-sinfo-get-case) + (mew-summary-folder-name)) + (mew-summary-folder-name))) + (fixer (if (fboundp 'mew-which-exec) + (mew-which-exec mew-nmz-prog-fixer) + (mew-which mew-nmz-prog-fixer exec-path))) + (args mew-nmz-prog-fixer-args) + nmzdir) + (if arg + (progn + (setq mew-nmz-fixer-process nil) + (and interactive-p + (message "Set %s to free" mew-nmz-prog-fixer))) + (if (not (and fld fixer)) + (and interactive-p + (message "Cannot exec %s" mew-nmz-prog-fixer)) + (setq nmzdir (mew-nmz-expand-folder fld)) + (if mew-nmz-fixer-process + (message "Another fixer running") + (if (and + nmzdir + (file-exists-p nmzdir) + (file-directory-p nmzdir) + (file-exists-p (expand-file-name "NMZ.i" nmzdir)) + (file-exists-p (expand-file-name "NMZ.field.message-id" nmzdir)) + (file-exists-p (expand-file-name "NMZ.field.size" nmzdir)) + (file-exists-p (expand-file-name "NMZ.field.date" nmzdir)) + (not (file-name-all-completions "NMZ.lock" nmzdir))) + (progn + (and interactive-p + (message "Exec %s (%s)..." mew-nmz-prog-fixer fld)) + (mew-nmz-timestamp-new fld) + (setq mew-nmz-fixer-process + (apply (function start-process) + "nmz-fixer" (current-buffer) fixer + (append args + (list (mew-expand-folder fld) nmzdir)))) + (set-process-sentinel mew-nmz-fixer-process 'mew-nmz-fixer-sentinel)) + (and interactive-p + (message "Cannot exec %s at %s" mew-nmz-prog-fixer nmzdir))))))))) + +(defun mew-nmz-fixer-sentinel (process event) + (save-excursion + (when (and (get-buffer (process-buffer process)) + (buffer-live-p (process-buffer process))) + (set-buffer (process-buffer process)) + (setq mew-nmz-fixer-process nil) + (mew-nmz-timestamp-rename (buffer-name)) + (message "Exec %s (%s)...done" + mew-nmz-prog-fixer (buffer-name))))) + +(provide 'mew-nmz-fixer) + +;;; Copyright Notice: + +;; Copyright (C) 2001 Mew developing team. +;; All rights reserved. + +;; Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions +;; are met: +;; +;; 1. Redistributions of source code must retain the above copyright +;; notice, this list of conditions and the following disclaimer. +;; 2. Redistributions in binary form must reproduce the above copyright +;; notice, this list of conditions and the following disclaimer in the +;; documentation and/or other materials provided with the distribution. +;; 3. Neither the name of the team nor the names of its contributors +;; may be used to endorse or promote products derived from this software +;; without specific prior written permission. +;; +;; THIS SOFTWARE IS PROVIDED BY THE TEAM AND CONTRIBUTORS ``AS IS'' AND +;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +;; PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE TEAM OR CONTRIBUTORS BE +;; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +;;; mew-nmz-fixer.el ends here diff -urN mew.orig/contrib/mew-nmz.el mew/contrib/mew-nmz.el --- mew.orig/contrib/mew-nmz.el 1970-01-01 09:00:00.000000000 +0900 +++ mew/contrib/mew-nmz.el 2011-06-20 01:46:10.000000000 +0900 @@ -0,0 +1,1686 @@ +;; -*- Mode: Emacs-Lisp -*- +;; +;; mew-nmz.el --- Namazu interfaces for Mew +;; +;; Author: Hideyuki SHIRAI +;; Created: Dec 24, 2004 +;; +;; Put your ~/.mew.el +;; (require 'mew-nmz) +;; (setq mew-search-method 'namazu) +;; + +(require 'mew) + +(eval-when-compile + (condition-case nil + (require 'w3m-namazu) + (error nil))) + +;; Variables +(defconst mew-nmz-version "2010-06-08") + +(defgroup mew-nmz nil + "Namazu support with Mew." + :group 'mew) + +(defcustom mew-nmz-index-path "~/Namazu" + "*Namazu index top directory." + :group 'mew-nmz + :type 'directory) + +(defcustom mew-nmz-index-mail "Mail" + "*Namazu index mail directory name." + :group 'mew-nmz + :type 'string) + +(defcustom mew-nmz-setup-hook nil + "*Hook called on mew-nmz-setup." + :group 'mew-nmz + :type 'hook) + +(defcustom mew-nmz-prog "namazu" + "*Namazu program name." + :group 'mew-nmz + :type 'string) + +(defcustom mew-nmz-prog-args nil + "*Namazu's arguments." + :group 'mew-nmz + :type '(repeat string)) + +(defcustom mew-nmz-prog-mknmz "mknmz" + "*Namazu make index program." + :group 'mew-nmz + :type 'string) + +(defcustom mew-nmz-prog-mknmz-args '("--decode-base64") + "*Mknmz's argument, in addition to \"--no-encode-uri\", \"--mailnews\"." + :group 'mew-nmz + :type '(repeat string)) + +(defcustom mew-nmz-prog-mknmz-include "~/Namazu/mknmz-inc.pl" + "*Include file for mknmz." + :group 'mew-nmz + :type 'file) + +(defcustom mew-nmz-mknmz-skip-folders-regexp + (mapcar 'regexp-quote + (delq nil + `(,mew-draft-folder ,mew-trash-folder ,mew-queue-folder ,mew-attach-folder + ,mew-imap-queue-folder ,mew-imap-trash-folder ,mew-postq-folder + ,@mew-trash-folder-list ,@mew-imap-trash-folder-list + "+schedule"))) + "*Folders regexp to skip the index creating." + :group 'mew-nmz + :type '(repeat regexp)) + +(defcustom mew-nmz-mknmz-use-mode-line t + "*Display indicator of namazu in mode line." + :group 'mew-nmz + :type 'boolean) + +(defcustom mew-nmz-line-id '("Mew(nmz): %7b") + "*A value of mode-line-buffer-identification for Mew summary mode, when mknmzing." + :group 'mew-nmz + :type '(list string)) + +(defcustom mew-nmz-mknmz-timer-interval 0.1 + "*Seconds of interval to execute next mknmz." + :group 'mew-nmz + :type 'number) + +(defcustom mew-nmz-pick-default-field nil + "*Default prefix string to be appeared when inputting a namazu pick pattern. +A good example is \"+from:\"." + :group 'mew-nmz + :type '(choice string (const nil))) + +(defcustom mew-nmz-pick-field-list + '("subject=" "from=" "to=" "newsgroups=" "date=" + "message-id=" "cc=" "in-reply-to=" "references=") + "*A list of key for namazu pick pattern." + :group 'mew-nmz + :type '(repeat string)) + +(defcustom mew-nmz-pick-gather-field-list + `((,mew-from: address "from=" "to=" "cc=") + (,mew-to: address "from=" "to=" "cc=") + (,mew-cc: address "from=" "to=" "cc=") + (,mew-message-id: msgid "message-id=" "in-reply-to=" "references=") + (,mew-in-reply-to: msgid "message-id=" "in-reply-to=" "references=") + (,mew-references: msgid "message-id=" "in-reply-to=" "references=")) + "*A list of completion keyword from message." + :group 'mew-nmz + :type '(repeat (list string + (choice (const address) (const msgid)) + string string string))) + +(defcustom mew-nmz-search-parent-folder `(,mew-inbox-folder) + "*Search folder for parent or child, " + :group 'mew-nmz + :type '(repeat string)) + +(defcustom mew-nmz-db-max 64 + "*Namazu max index. +This value MUST be less then equal `INDEX_MAX' of libnamazu.h." + :group 'mew-nmz + :type 'integer) + +(defcustom mew-nmz-query-max-length 256 + "*Namazu query string max length. + This value MUST be less then equal `QUERY_MAX' of libnamazu.h." + :group 'mew-nmz + :type 'integer) + +(defcustom mew-nmz-mark-pick mew-mark-review + "*Mark for Namazu pick." + :group 'mew-nmz + :type 'character) + +(defcustom mew-nmz-mark-unindexed mew-mark-review + "*Mark for type unindexed messages." + :group 'mew-nmz + :type 'character) + +(defcustom mew-ask-virtual-folder-name nil + "*If *non-nil*, ask a virtual folder name." + :group 'mew-summary + :type 'boolean) + +(defcustom mew-nmz-cache-file-prefix ".mew-nmz-" + "*Prefix of the cache filename. Expand with mew-conf-path when use it." + :group 'mew-nmz + :type 'string) + +(defcustom mew-nmz-mknmz-index-file ".mewmknmz" + "*File name of the input file of mewmknmz. Expand with mew-conf-path when use it." + :group 'mew-nmz + :type 'string) + +(defcustom mew-nmz-input-folders-asterisk t + "*Add \"*\" at the end of input folder name." + :group 'mew-nmz + :type 'boolean) + +(defcustom mew-nmz-prog-gcnmz "gcnmz" + "*Program name for the garbage collection." + :group 'mew-nmz + :type 'string) + +(defcustom mew-nmz-use-gcnmz-folders-regexp `(,(regexp-quote mew-inbox-folder)) + "*Folders regexp to execute gcnmz." + :group 'mew-nmz + :type '(repeat regexp)) + +(defcustom mew-nmz-gcnmz-line-id '("Mew(gcn): %7b") + "*A value of mode-line-buffer-identification for Mew summary mode, when gcnmzing." + :group 'mew-nmz + :type '(list string)) + +(defcustom mew-nmz-prog-rfnmz "rfnmz" + "*Program name for the re-index." + :group 'mew-nmz + :type 'string) + +(defcustom mew-nmz-mknmz-index-file-coding-system + (when (boundp 'default-file-name-coding-system) + default-file-name-coding-system) + "*Coding system of index-file." + :group 'mew-nmz + :type '(coding-system :size 0)) + +;; internal variable, don't modify. +(defvar mew-nmz-gather-header-list nil) +(defvar mew-nmz-indexed-folders nil) + +(defvar mew-nmz-input-folder-hist nil) + +(defvar mew-nmz-mknmz-process nil) +(defvar mew-nmz-mknmz-process-folder nil) +(defvar mew-nmz-mknmz-process-file nil) + +(make-variable-buffer-local 'mew-nmz-mknmz-process) +(make-variable-buffer-local 'mew-nmz-mknmz-process-folder) +(make-variable-buffer-local 'mew-nmz-mknmz-process-file) + +(defconst mew-nmz-namazu-index-alias "_mew-namazu" + "*Alias name for mew-nmz-namazu.") +(defvar mew-nmz-namazu-content-type "message/mew") +(defvar mew-nmz-namazu-pattern nil) +(defvar mew-nmz-namazu-miss-folders nil) + +(defvar mew-nmz-setup-p nil) +(defvar mew-nmz-imap-case-alist nil) +(defvar mew-nmz-nntp-case-alist nil) +(defvar mew-nmz-pop-case-alist nil) +(defvar mew-nmz-fld-index-alist nil) +(defvar mew-nmz-url-fld-alist nil) +(defvar mew-nmz-mknmz-all-folders nil) +(defvar mew-nmz-mknmz-continue-timer nil) + +(defvar mew-nmz-mknmz-lang-alist + '(("Japanese" "ja"))) + +(defvar mew-nmz-cs-index (cond + ((mew-coding-system-p 'euc-japan-unix) + 'euc-japan-unix) + ((mew-coding-system-p 'euc-jp-unix) + 'euc-jp-unix) + (t mew-cs-text-for-write)) + "*Coding system to write 'NMZ.field.uri'.") + +(defconst mew-nmz-result-regex + (concat "^\\(.*\\)" (regexp-quote mew-path-separator) "\\([0-9]+\\)")) + +(defconst mew-nmz-use-drive-letter + (memq system-type '(OS/2 emx windows-nt cygwin))) + +;; Set up +(defvar mew-nmz-search-method `(namazu "Namazu" ,mew-nmz-prog + mew-nmz-search + mew-nmz-search-virtual + mew-nmz-mknmz + mew-nmz-mknmz-all-folders + mew-nmz-pick-canonicalize-pattern)) + +(eval-after-load "mew-search" + `(setq mew-search-switch + (cons mew-nmz-search-method mew-search-switch))) + +;; (define-key mew-summary-mode-map "k" (make-sparse-keymap)) +;; (define-key mew-summary-mode-map "kc" 'mew-summary-search-change-method) +;; (define-key mew-summary-mode-map "k?" 'mew-summary-search) +;; (define-key mew-summary-mode-map "k/" 'mew-summary-selection-by-search) +;; (define-key mew-summary-mode-map "km" 'mew-summary-make-index-folder) +;; (define-key mew-summary-mode-map "kM" 'mew-summary-make-index-all) + +(add-hook 'mew-summary-mode-hook + (lambda () + (define-key mew-summary-mode-map "kg" 'mew-nmz-gcnmz) + (define-key mew-summary-mode-map "ks" 'mew-nmz-mknmz-save-mewmknmz) + (define-key mew-summary-mode-map "kK" 'mew-nmz-mknmz-kill-process) + (define-key mew-summary-mode-map "ku" 'mew-nmz-mark-unindexed) + (define-key mew-summary-mode-map "k^" 'mew-nmz-search-parent) + (define-key mew-summary-mode-map "kp" 'mew-nmz-search-parent) + (define-key mew-summary-mode-map "kn" 'mew-nmz-search-child) + (define-key mew-summary-mode-map "kN" 'mew-nmz-namazu) + (define-key mew-summary-mode-map "kj" 'mew-nmz-jump-message))) + +(add-hook 'mew-message-mode-hook + (lambda () + (define-key mew-message-mode-map "k" (make-sparse-keymap)) + (define-key mew-message-mode-map "kp" 'mew-nmz-search-msgid-at-point) + (define-key mew-message-mode-map "kr" 'mew-nmz-search-msgid-region))) + +(defun mew-nmz-pick-field-list () + (let ((lst (append mew-pick-field-list + mew-nmz-pick-field-list + (mew-nmz-pick-pattern-gather-header)))) + (mew-uniq-list lst))) + +(defadvice mew-summary-search (around mew-nmz activate compile) + "Use mew-nmz gather-header." + (if (eq mew-search-method 'namazu) + (let ((mew-pick-field-list (mew-nmz-pick-field-list))) + ad-do-it) + ad-do-it)) + +(defadvice mew-summary-selection-by-search (around mew-nmz activate compile) + "Use mew-nmz gather-header." + (if (eq mew-search-method 'namazu) + (let ((mew-pick-field-list (mew-nmz-pick-field-list))) + ad-do-it) + ad-do-it)) + +(add-hook 'mew-summary-rename-folder-hook 'mew-nmz-folder-index-rename) +(add-hook 'mew-summary-delete-folder-hook 'mew-nmz-folder-index-delete) +(add-hook 'mew-status-update-hook 'mew-nmz-status-update) +(add-hook 'mew-quit-hook 'mew-nmz-cleanup) + +(when (and (featurep 'mw32script) + (fboundp 'define-process-argument-editing)) + ;; Argument setting for mknmz.bat, gcnmz.bat, rfnmz.bat + (let ((progs '("mknmz" "gcnmz" "rfnmz")) + prog) + (while progs + (setq prog (mew-which-exec (car progs))) + (setq progs (cdr progs)) + (when (and prog (string-match "\\.bat$" prog)) + (setq prog (regexp-quote prog)) + ;; (general-process-argument-editing-function + ;; ARGUMENT QUOTING ARGV0ISP &optional EP H2SP QP S2ISP) + (define-process-argument-editing + prog + (lambda (x) (general-process-argument-editing-function x nil nil)) + 'first))))) + +;; macro +(defmacro mew-nmz-imap-directory-file-name (fld case) + `(condition-case nil + (mew-imap-directory-file-name ,fld ,case) + (error ,fld))) + +(defmacro mew-nmz-cache-file-name (part) + `(expand-file-name (concat mew-nmz-cache-file-prefix + (symbol-name ,part) + "-alist") + mew-conf-path)) + +(defmacro mew-nmz-cache-alist-name (part) + `(intern (concat "mew-nmz-" (symbol-name ,part) "-alist"))) + +(defsubst mew-nmz-expand-folder (case:folder) + "Convert case:folder to the directory name of namazu's index." + (let* ((fld (mew-case:folder-folder case:folder)) + (imapp (mew-folder-imapp fld)) + (mew-mail-path (concat (file-name-as-directory mew-nmz-index-path) + mew-nmz-index-mail)) + (nmzdir (directory-file-name (mew-expand-folder case:folder)))) + (if (not imapp) + nmzdir + (while (string-match "[][]" nmzdir) + (setq nmzdir (concat (substring nmzdir 0 (match-beginning 0)) + "%%" + (substring nmzdir (match-end 0))))) + nmzdir))) + +(defsubst mew-nmz-case-folder-normalize (case:folder) + (let ((case (mew-case:folder-case case:folder)) + (fld (mew-case:folder-folder case:folder)) + (newcase "")) + (setq fld (directory-file-name fld)) + (when (mew-folder-imapp fld) + (setq fld (mew-nmz-imap-directory-file-name fld case))) + (cond + ((or (string= fld "") + (string= fld "*") + (mew-folder-imapp fld)) + (setq newcase (or (cdr (assoc case mew-nmz-imap-case-alist)) ""))) + ((mew-folder-popp fld) + (setq newcase (or (cdr (assoc case mew-nmz-pop-case-alist)) ""))) + ((mew-folder-nntpp fld) + (setq newcase (or (cdr (assoc case mew-nmz-nntp-case-alist)) "")))) + (if (string= newcase "") + fld + (concat newcase ":" fld)))) + +(defsubst mew-nmz-case-normalize (case:folder) + (let ((case (mew-case:folder-case case:folder)) + (fld (mew-case:folder-folder case:folder)) + (newcase "")) + (cond + ((or (string= fld "") + (string= fld "*") + (mew-folder-imapp fld)) + (setq newcase (or (cdr (assoc case mew-nmz-imap-case-alist)) ""))) + ((mew-folder-popp fld) + (setq newcase (or (cdr (assoc case mew-nmz-pop-case-alist)) ""))) + ((mew-folder-nntpp fld) + (setq newcase (or (cdr (assoc case mew-nmz-nntp-case-alist)) "")))) + newcase)) + +(defsubst mew-nmz-folder-to-nmzdir (folder) + (mew-nmz-setup) + (cdr (assoc (directory-file-name folder) mew-nmz-fld-index-alist))) + +(defsubst mew-nmz-url-to-folder (url) + (mew-nmz-setup) + (when (and mew-nmz-use-drive-letter + (string-match "^/\\([a-zA-Z]\\)|\\(/.*\\)" url)) + (setq url (concat + (substring url (match-beginning 1) (match-end 1)) + ":" + (substring url (match-beginning 2) (match-end 2))))) + (cdr (assoc (expand-file-name url) mew-nmz-url-fld-alist))) + +(defsubst mew-nmz-indexed-folder-p (fld) + (let ((nmzdir (mew-nmz-expand-folder fld))) + (and nmzdir + (file-directory-p nmzdir) + (file-exists-p (expand-file-name "NMZ.i" nmzdir))))) + +;; Mew interface +(defun mew-nmz-search (pattern folder &rest args) + (mew-nmz-multi-pick + (list (mew-nmz-expand-folder folder)) pattern nil 'single)) + +(defun mew-nmz-search-virtual (pattern flds &rest args) + (mew-nmz-setup) + (let* ((nmzdirs (mew-nmz-flds-to-indexs (or flds (list "*:*")))) + (fldmsgs (mew-nmz-multi-pick nmzdirs pattern nil)) + (file (mew-make-temp-name)) + (rttl 0) + fld) + (with-temp-buffer + (dolist (fldmsg fldmsgs) + (setq fld (car fldmsg)) + (unless (mew-folder-localp fld) + (setq fld (mew-path-to-folder (mew-expand-folder fld)))) + (insert (format "CD:%s\n" fld)) + (dolist (msg (cdr fldmsg)) + (insert msg "\n") + (setq rttl (1+ rttl)))) + (mew-frwlet + mew-cs-text-for-read mew-cs-text-for-write + (write-region (point-min) (point-max) file nil 'no-msg))) + (list file rttl))) + +;; codes +(defun mew-nmz-jump-message () + "Jump to physical folder and message from virtual folder +or jump to virtual folder from physical folder." + (interactive) + (let ((disp (mew-sinfo-get-disp-msg)) + fld msg) + (cond + ((mew-thread-p) + (mew-summary-goto-message) + (setq fld (or (mew-vinfo-get-original-folder) + (mew-vinfo-get-physical-folder))) + (setq msg (mew-summary-message-number))) + ((mew-virtual-p) + (mew-summary-goto-message) + (setq fld (mew-summary-folder-name)) + (setq msg (mew-summary-message-number))) + (t + (setq fld (mew-summary-folder-name)) + (setq msg (mew-summary-message-number)) + (save-excursion + (let ((regex (format "\r %s %s[^0-9]" (regexp-quote fld) msg))) + (setq fld (catch 'detect + (dolist (buf (delq (current-buffer) (buffer-list))) + (set-buffer buf) + (save-excursion + (when (and (mew-virtual-p) + (or (re-search-forward regex nil t) + (re-search-backward regex nil t))) + (throw 'detect (buffer-name buf))))) + nil)))))) + (if (not fld) + (message "Nothing to do") + (mew-nmz-goto-folder-msg fld msg nil disp) + (message "Jump to %s/%s" fld msg)))) + +(defun mew-nmz-mknmz-lang-arg () + (when (boundp 'current-language-environment) + (let* ((env current-language-environment) + (alist mew-nmz-mknmz-lang-alist) + (lang (nth 1 (assoc env alist)))) + (if lang (format "--indexing-lang=%s" lang))))) + +;; "Make Index" functions. +(defun mew-nmz-mknmz (&optional fld all disp) + "Make namazu index for mew-nmz. +If executed with '\\[universal-argument]', make indices without the check of timestamp files. +If executed with '\\[universal-argument] 0', remove indices before make index." + (interactive + (list (directory-file-name + (mew-input-folder (mew-sinfo-get-case) + (or (mew-sinfo-get-folder) mew-inbox-folder))) + nil)) + (save-excursion + (let ((msgenb (or (interactive-p) + (eq this-command 'mew-summary-make-index-folder) + disp)) + (force (and current-prefix-arg + (not (eq current-prefix-arg 0)))) + (remove (eq current-prefix-arg 0)) + (flddir (mew-expand-folder fld)) + (nmzdir (mew-nmz-expand-folder fld)) + (bufname (format "%s*Mew* mknmz*%s" + (if (memq mew-debug '(namazu t)) "" " ") + fld)) + (args mew-nmz-prog-mknmz-args) + (procname (concat mew-nmz-prog-mknmz "-" fld)) + (procname2 (concat mew-nmz-prog-gcnmz "-" fld)) + (incfile (and mew-nmz-prog-mknmz-include + (expand-file-name mew-nmz-prog-mknmz-include))) + (tmpfile (mew-make-temp-name)) + flist continue) + (unless fld + (setq fld (directory-file-name + (mew-input-folder (mew-sinfo-get-case) (mew-sinfo-get-folder))))) + (cond + ((not (mew-which-exec mew-nmz-prog-mknmz)) + (message "Please install mknmz")) + ((or (mew-folder-virtualp fld) (mew-nmz-skip-folder-p fld)) + (and msgenb (message "Cannot make namazu index in %s" fld)) + (setq continue t)) + ((or (get-process procname) (get-process procname2)) + (and msgenb (message "Detect running mknmz/gcnmz process in %s" fld)) + (setq continue t)) + ((and (not remove) (not force) (mew-nmz-index-new-p fld)) + (and msgenb (message "%s has a newer namazu index" fld)) + (setq continue t)) + ((and (not remove) (file-exists-p (expand-file-name "NMZ.lock2" nmzdir))) + (message "Something error in %s's index" fld) + (setq continue t)) + ((not (setq flist (mew-dir-messages (file-chase-links flddir) + nil 'full))) + (and msgenb (message "%s has no message" fld)) + (mew-nmz-index-delete nmzdir) + (setq continue t)) + ((and flddir nmzdir (file-directory-p flddir)) + (with-temp-buffer + (dolist (file flist) + (insert file "\n")) + (mew-frwlet + mew-cs-autoconv mew-cs-text-for-write + (write-region (point-min) (point-max) tmpfile nil 'nomsg))) + (setq args (delq nil + (append args + (list "--no-encode-uri" + ;; "--mailnews" + (mew-nmz-mknmz-lang-arg) + (when (and incfile (file-exists-p incfile)) + (format "--include=%s" incfile)) + (format "--target-list=%s" tmpfile) + ;; (format "--exclude=%s" + ;; (expand-file-name ".+/" flddir)) + (format "--output-dir=%s" nmzdir))))) + ;; flddir)))) + (unless (file-directory-p nmzdir) + (mew-make-directory nmzdir)) + (when remove + (mew-nmz-index-delete nmzdir)) + (set-buffer (get-buffer-create bufname)) + (erase-buffer) + ;; folder set + (and msgenb (message "Namazu indexing for %s..." fld)) + (insert (format "mew-mknmz-prog: %s\nmew-mknmz-args: %s\n" + (mew-which-exec mew-nmz-prog-mknmz) + (mapconcat 'identity args " "))) + (mew-nmz-timestamp-new fld) + (mew-piolet + mew-cs-autoconv mew-cs-text-for-write + (setq mew-nmz-mknmz-process + (apply (function start-process) + procname (current-buffer) mew-nmz-prog-mknmz args))) + (setq mew-nmz-mknmz-process-folder fld) + (setq mew-nmz-mknmz-process-file tmpfile) + (set-process-sentinel mew-nmz-mknmz-process 'mew-nmz-mknmz-sentinel) + (when (and mew-nmz-mknmz-use-mode-line + fld (get-buffer fld) (buffer-name (get-buffer fld))) + (save-excursion + (set-buffer (get-buffer fld)) + (setq mode-line-buffer-identification mew-nmz-line-id) + (set-buffer-modified-p nil))))) + (when (and continue all mew-nmz-mknmz-all-folders) + (mew-nmz-mknmz-continue-with-timer))))) + +(defun mew-nmz-mknmz-continue-with-timer () + (unless mew-nmz-mknmz-continue-timer + (setq mew-nmz-mknmz-continue-timer + (run-at-time mew-nmz-mknmz-timer-interval nil 'mew-nmz-mknmz-continue)))) + +(defun mew-nmz-mknmz-continue () + (when mew-nmz-mknmz-continue-timer + (cancel-timer mew-nmz-mknmz-continue-timer) + (setq mew-nmz-mknmz-continue-timer nil)) + (setq mew-nmz-mknmz-all-folders (cdr mew-nmz-mknmz-all-folders)) + (if mew-nmz-mknmz-all-folders + (mew-nmz-mknmz (car mew-nmz-mknmz-all-folders) 'all) + (ding) + (message "All mknmz done"))) + +(defun mew-nmz-mknmz-sentinel (process event) + (save-excursion + (set-buffer (process-buffer process)) + (let* ((fld mew-nmz-mknmz-process-folder) + (nmzdir (mew-nmz-expand-folder fld)) + msg success) + (when (and (file-exists-p mew-nmz-mknmz-process-file) + (file-writable-p mew-nmz-mknmz-process-file)) + (delete-file mew-nmz-mknmz-process-file)) + (goto-char (point-min)) + (if (search-forward-regexp "^ERROR:.*$" nil t) + (progn + (setq msg (format "Mew mknmz (%s)...%s" fld (match-string 0))) + (condition-case nil + (progn + (mew-nmz-index-delete nmzdir 'tmpfiles) + (delete-file (expand-file-name "NMZ.lock2" nmzdir)) + (delete-file (expand-file-name "NMZ.stamp.new" nmzdir))) + (error nil))) + (setq success t) + (mew-nmz-timestamp-rename fld) + (setq msg (format "Namazu indexing %s...done" fld)) + (when mew-nmz-setup-p + (setq fld (mew-nmz-case-folder-normalize fld)) + (unless (mew-nmz-folder-to-nmzdir fld) + (setq mew-nmz-fld-index-alist + (cons (cons fld nmzdir) mew-nmz-fld-index-alist)) + (setq mew-nmz-url-fld-alist + (cons (cons (mew-expand-folder fld) fld) + mew-nmz-url-fld-alist)) + (mew-nmz-cache-save)))) + (setq mew-nmz-mknmz-process nil) + (setq mew-nmz-mknmz-process-folder nil) + (when (and mew-nmz-mknmz-use-mode-line + fld (get-buffer fld) (buffer-name (get-buffer fld))) + (save-excursion + (set-buffer (get-buffer fld)) + (setq mode-line-buffer-identification + (if (fboundp 'mew-mode-line-id) + (mew-mode-line-id) + mew-mode-line-id)) + (set-buffer-modified-p nil))) + (set-buffer-modified-p nil) + (unless (memq mew-debug '(namazu t)) + (kill-buffer (current-buffer))) + (message "%s" msg) + (when (and success (mew-nmz-gcnmz-folder-p fld)) + (mew-nmz-gcnmz fld nmzdir)) + (when mew-nmz-mknmz-all-folders + (mew-nmz-mknmz-continue-with-timer))))) + +(defun mew-nmz-gcnmz (&optional fld nmzdir) + "Garbage collection for mew-nmz." + (interactive + (list (directory-file-name + (mew-input-folder (mew-sinfo-get-case) + (or (mew-sinfo-get-folder) mew-inbox-folder))) + nil)) + (unless nmzdir + (setq nmzdir (mew-nmz-expand-folder fld))) + (if (and (mew-which-exec mew-nmz-prog-gcnmz) + (file-directory-p nmzdir) + (file-exists-p (expand-file-name "NMZ.i" nmzdir))) + (let ((buf (get-buffer-create + (format "%s*Mew* gcnmz*%s" + (if (memq mew-debug '(namazu t)) "" " ") + fld))) + (procname (concat mew-nmz-prog-gcnmz "-" fld)) + (args `("--no-backup" ,nmzdir)) + process) + (save-excursion + (set-buffer buf) + (erase-buffer) + (setq mew-nmz-mknmz-process-folder fld) + (message "Mew gcnmz (%s)..." mew-nmz-mknmz-process-folder) + (insert (format "mew-gcnmz-prog: %s\nmew-gcnmz-args: %s\n" + (mew-which-exec mew-nmz-prog-gcnmz) + (mapconcat 'identity args " "))) + (setq process + (apply (function start-process) + procname (current-buffer) mew-nmz-prog-gcnmz args)) + (set-process-sentinel process 'mew-nmz-gcnmz-sentinel) + (when (and mew-nmz-mknmz-use-mode-line + fld (get-buffer fld) (buffer-name (get-buffer fld))) + (save-excursion + (set-buffer (get-buffer fld)) + (setq mode-line-buffer-identification mew-nmz-gcnmz-line-id) + (set-buffer-modified-p nil))))) + (when (interactive-p) + (message "gcnmz cannot run on %s" fld)))) + +(defun mew-nmz-gcnmz-sentinel (process event) + (when (buffer-name (process-buffer process)) + (set-buffer (process-buffer process)) + (let ((fld mew-nmz-mknmz-process-folder)) + (if (and fld event (stringp event) (string= event "kill")) + (progn + (message "Mew gcnmz (%s)...kill from user" fld) + (condition-case nil + (mew-nmz-index-delete (mew-nmz-expand-folder fld) 'tmpfiles) + (error nil))) + (message "Mew gcnmz (%s)...done" fld)) + (when (and mew-nmz-mknmz-use-mode-line + fld (get-buffer fld) (buffer-name (get-buffer fld))) + (save-excursion + (set-buffer (get-buffer fld)) + (setq mode-line-buffer-identification + (if (fboundp 'mew-mode-line-id) + (mew-mode-line-id) + mew-mode-line-id)) + (set-buffer-modified-p nil))) + (unless (memq mew-debug '(namazu t)) + (kill-buffer (current-buffer)))))) + +(defun mew-nmz-mknmz-kill-process () + "Kill the all processes of mknmz." + (interactive) + (when mew-nmz-mknmz-continue-timer + (cancel-timer mew-nmz-mknmz-continue-timer) + (setq mew-nmz-mknmz-continue-timer nil)) + (let ((proc-list (process-list)) + (regex1 (concat "^" mew-nmz-prog-mknmz "-")) + (regex2 (concat "^" mew-nmz-prog-gcnmz "-")) + buf kill) + (dolist (process proc-list) + (cond + ((string-match regex1 (process-name process)) + ;; mknmz + (setq buf (process-buffer process)) + (when (buffer-name buf) + (save-excursion + (set-buffer buf) + (set-process-sentinel process 'ignore) + (goto-char (point-max)) + (insert "\nERROR: Kill from user.\n") + (kill-process process) + (mew-nmz-mknmz-sentinel process "kill") + (setq kill t)))) + ((string-match regex2 (process-name process)) + ;; gcnmz + (setq buf (process-buffer process)) + (when (buffer-name buf) + (set-process-sentinel process 'ignore) + (kill-process process) + (mew-nmz-gcnmz-sentinel process "kill") + (setq kill t))))) + (setq mew-nmz-mknmz-all-folders nil) + (when (interactive-p) + (if kill + (message "All process of mknmz killed") + (message "No process of mknmz"))))) + +(defun mew-nmz-mknmz-get-all-folders () + (let ((protos (delq mew-folder-virtual (copy-sequence mew-folder-prefixes))) + (allcases (or mew-config-cases '(""))) + flist cases donecases flds fld dir) + (message "mew-nmz getting all folders...") + (dolist (proto protos) + (setq flds nil) + (setq cases allcases) + (setq donecases nil) + (dolist (case cases) + (if (or (string= case mew-case-default) + (string= case "")) + (setq case (mew-nmz-case-normalize proto)) + (setq case (mew-nmz-case-normalize + (concat case ":" proto)))) + (unless (member case donecases) + (setq donecases (cons case donecases)) + (setq flds + (cond + ((mew-folder-imapp proto) + (mapcar (lambda (x) (car x)) + (mew-imap-folder-alist case))) + ((mew-folder-nntpp proto) + (mapcar (lambda (x) (car x)) + (mew-nntp-folder-alist case))) + ((mew-folder-popp proto) + (mapcar (lambda (x) (car x)) + (mew-pop-folder-alist))) + (t + (mapcar (lambda (x) (car x)) + (mew-local-folder-alist))))) + (setq case (if (string= case "") + "" + (concat case ":"))) + (dolist (fld flds) + (setq fld (concat case fld)) + (setq dir (mew-expand-folder fld)) + (when (and dir + (file-exists-p dir) + (file-directory-p dir) + (file-exists-p (expand-file-name mew-summary-touch-file dir))) + (setq flist (cons (directory-file-name fld) flist))))))) + (prog1 + (setq flist (nreverse flist)) + (with-temp-buffer + (dolist (fld flist) + (unless (mew-nmz-skip-folder-p fld) + (insert (format "%s\t%s\t%s\n" + fld + (mew-expand-folder fld) + (mew-nmz-expand-folder fld)))) + (setq flist (cdr flist))) + (mew-frwlet + mew-cs-text-for-read mew-nmz-mknmz-index-file-coding-system + (write-region (point-min) (point-max) + (expand-file-name mew-nmz-mknmz-index-file mew-conf-path) + nil 'nomsg))) + (message "mew-nmz getting all folders...done")))) + +(defun mew-nmz-mknmz-all-folders (&optional args) + "Make namazu index all folders." + (interactive "P") + (setq args (or args current-prefix-arg)) + (when (or (null mew-nmz-mknmz-all-folders) + (and mew-nmz-mknmz-all-folders + (prog1 + (y-or-n-p "Another mew-nmz-mknmz-all-folders() detect. Kill it? ") + (mew-nmz-mknmz-kill-process)))) + (when (y-or-n-p (format "Make index in all %s? " + (if args "folders" "indexed folders"))) + (let (alist flist) + (if args + (progn + ;; all exist folder + (mew-nmz-cleanup 'remove) + (setq flist (mew-nmz-mknmz-get-all-folders))) + ;; all indexed folder + (mew-nmz-setup) + (setq alist mew-nmz-fld-index-alist) + (while alist + (setq flist (cons (car (car alist)) flist)) + (setq alist (cdr alist)))) + (setq flist (nreverse flist)) + ;; for mew-nmz-mknmz() + (setq current-prefix-arg nil) + (setq mew-nmz-mknmz-all-folders flist) + (when flist + (mew-nmz-mknmz (car flist) 'all)))))) + +(defun mew-nmz-mknmz-save-mewmknmz () + "Save the information for mknmz." + (interactive) + (mew-nmz-cleanup 'remove) + (mew-nmz-setup) + (mew-nmz-mknmz-get-all-folders)) + +(defun mew-nmz-mark-unindexed () + "Mark unindexed messages." + (interactive) + (mew-summary-only + (if (mew-summary-exclusive-p) + (save-excursion + (if (and (mew-summary-mark-collect + mew-nmz-mark-unindexed (point-min) (point-max)) + (y-or-n-p (format "Unmark '%c'? " mew-nmz-mark-unindexed))) + (mew-mark-undo-mark mew-nmz-mark-unindexed 'nomsg)) + (let* ((ufname + (expand-file-name "NMZ.field.uri" + (mew-nmz-expand-folder (buffer-name)))) + (mmsgs 0) + (umsgs 0) + msgnums) + (if (not (file-exists-p ufname)) + (message "%s has no index file" (buffer-name)) + (with-temp-buffer + (message "checking %s..." (file-name-nondirectory ufname)) + (insert-file-contents ufname) + (while (re-search-forward "/\\([0-9]+\\)$" nil t) + (setq msgnums (cons (string-to-number (match-string 1)) msgnums)))) + (message "checking %s..." (buffer-name)) + (goto-char (point-min)) + (while (not (eobp)) + (if (and (mew-sumsyn-match mew-regex-sumsyn-short) + (not (memq (string-to-number (mew-sumsyn-message-number)) msgnums)) + (not (mew-in-decode-syntax-p))) + (progn + (setq umsgs (1+ umsgs)) + (when (mew-summary-markable) + (mew-summary-mark-as mew-nmz-mark-unindexed) + (setq mmsgs (1+ mmsgs))))) + (forward-line)) + (cond + ((= umsgs 1) + (message "%d message does not have index, %d marked" + umsgs mmsgs)) + ((> umsgs 1) + (message "%d messages do not have index, %d marked" + umsgs mmsgs)) + (t + (message "all messages have index"))))))))) + +;; "search Message-ID" functions. +(defun mew-nmz-search-parent (&optional child mid) + "Search *parent* message and jump to that. +If executed with '\\[universal-argument]', search *child* message." + (interactive "P") + (when (memq major-mode '(mew-summary-mode mew-virtual-mode)) + (mew-summary-goto-message)) + (let ((fld (mew-summary-folder-name)) + (msg (mew-summary-message-number)) + (idh (list (list mew-in-reply-to: mew-references:) + (list mew-message-id:))) + (message (if child "children" "parent")) + (refilefld (copy-sequence mew-nmz-search-parent-folder)) + (proto (or (mew-proto-to-refile (or (mew-sinfo-get-folder) + (mew-minfo-get-summary) + "+")) + "+")) + (case (mew-sinfo-get-case)) + refiledir mess ref pid pos killbuff) + (if mid + (setq pid (list mid) idh nil) + (if (not (or msg (mew-syntax-number))) + (message "No message here") + (save-excursion + (mew-nmz-setup) + (mew-summary-display) + (if (setq mess (mew-cache-hit fld msg)) + (set-buffer mess) + (setq mess (generate-new-buffer mew-buffer-prefix)) + (setq killbuff t) + (set-buffer mess) + (mew-erase-buffer) + (mew-insert-message + fld msg mew-cs-text-for-read mew-header-reasonable-size)) + (let ((mew-inherit-refile-proto proto) + (mew-inherit-refile-case case)) + (setq refilefld (append (car (mew-refile-guess nil t)) refilefld))) + (if child + (setq idh (car (cdr idh))) + (setq idh (car idh))) + (dolist (rh idh) + (setq ref (mew-header-get-value rh)) + (while (and ref (string-match "<\\([^>]+\\)>" ref)) + (setq pid (cons (concat "\"" (match-string 1 ref) "\"") pid)) + (setq refilefld + (cons (nth 1 (assoc (car pid) mew-refile-msgid-alist)) refilefld)) + (setq ref (substring ref (match-end 0))))) + (setq refilefld (cons fld refilefld)) + (setq refilefld (mew-uniq-list (delete nil refilefld))) + (setq refiledir + (delete nil (mapcar + (lambda (x) + (mew-nmz-expand-folder x)) + refilefld)))))) + (when killbuff (mew-kill-buffer mess)) + (if (null pid) + (message "No required header") + (if (mew-syntax-number) + (while (not (mew-summary-message-number)) + (forward-line -1))) + (mew-sinfo-set-ret-pos (point)) + (let ((pattern1 "") + (pattern2 "") + (addpattern (if child "+in-reply-to:" "+message-id:")) + (range nil)) + (if (not child) + (setq pattern1 (concat addpattern (car pid))) + (setq pattern1 (concat addpattern (car pid))) + (setq addpattern "+references:") + (setq pattern1 (concat pattern1 " | " addpattern (car pid)))) + (setq pid (delete (car pid) pid)) + (while pid + (if (> (length (concat pattern2 addpattern (car pid))) + mew-nmz-query-max-length) + (setq pid nil) + (setq pattern2 (concat pattern2 addpattern (car pid))) + (setq addpattern (if child " | +references:" " | +message-id:")) + (setq pid (delete (car pid) pid)))) + (message "Searching %s..." message) + (let ((pattern (list pattern1 pattern2))) + (while (and (null range) pattern) + (if mid + () + (message "Searching %s...%s" message (mew-join ", " refilefld)) + (setq range (mew-nmz-multi-pick refiledir (car pattern))) + (when range + (catch 'detect + (dolist (ref refilefld) + (if (null (setq idh (assoc ref range))) + () + (setq fld (car idh)) + (if child + (setq range (cdr idh)) + (setq range (nreverse (cdr idh)))) + (throw 'detect t))) + nil))) + (unless range + ;; all folder search + (message "Searching %s...all folders" message) + (setq range (mew-nmz-multi-pick + (mew-nmz-expand-folder-regexp "*:*") + (car pattern) 'catch)) + (if (null range) + (setq pattern (cdr pattern)) + (setq fld (car (car range))) + (setq range (cdr (car range))) + (if (not child) (setq range (nreverse range))) + )))) + (if (null range) + (message "No message found") + (when (or (and (mew-thread-p) + (string= (mew-summary-folder-name) fld)) + (and (mew-virtual-p) + (not (mew-thread-p)))) + (save-excursion + (goto-char (point-min)) + (when (re-search-forward + (concat "\r \\(" (regexp-quote fld) "\\)? +" (car range) " ") nil t) + (setq fld (buffer-name)) + (goto-char (match-beginning 0)) + (beginning-of-line) + (setq pos (point))))) + (if (listp (car range)) + (setq fld (car (car range)) + mess (car (cdr (car range)))) + (setq mess (car range))) + (mew-nmz-goto-folder-msg fld mess pos) + (message "Searching %s...%s/%s" message fld mess)))))) + +(defun mew-nmz-search-child (&optional arg) + (interactive "P") + (mew-nmz-search-parent (not arg))) + +(defun mew-nmz-search-msgid-at-point () + (interactive) + (let (start end) + (if (and (re-search-backward "<" (save-excursion (beginning-of-line) (point)) t) + (setq start (point)) + (re-search-forward ">" (save-excursion (end-of-line) (point)) t) + (setq end (point))) + (mew-nmz-search-msgid (buffer-substring start end)) + (message "No Message-ID")))) + +(defun mew-nmz-search-msgid-region (start end) + (interactive "r") + (mew-nmz-search-msgid (buffer-substring start end))) + +(defun mew-nmz-search-msgid (mid) + (interactive "sMessage-ID: ") + (if (string-match "<\\([^>]+\\)>" mid) + (let ((mew-use-full-window t) + (pattern (concat "\"" (mew-match-string 1 mid) "\""))) + (when (eq major-mode 'mew-message-mode) + (mew-message-goto-summary)) + (mew-nmz-search-parent nil pattern)) + (message "No Message-ID"))) + +;; "Namazu virtual" function. +(defun mew-nmz-input-folders () + (mew-input-clear) + (mew-input-folder-clean-up) + (let ((map (copy-keymap mew-input-folder-map)) + (case:folder (concat (or (mew-summary-folder-name) "+") + (if mew-nmz-input-folders-asterisk "*" "")))) + (define-key map "*" 'mew-input-folder-self-insert) + (let* ((init "+*") ;; (mew-canonicalize-case-folder case:folder)) + (mew-input-complete-function 'mew-complete-folder) + (mew-circular-complete-function 'mew-circular-complete-case:) + (mew-input-folder-search-multi t) + (minibuffer-setup-hook (cons 'backward-char minibuffer-setup-hook)) + ;; mew-inherit-case must be nil + (ret (read-from-minibuffer "Namazu folder name: " + init map nil + 'mew-nmz-input-folder-hist))) + (when (string= ret "") + (setq ret init)) + (setq ret (mapcar 'mew-chop (mew-split ret ?,)))))) + +;; Use namazu-mode. +;; (setq w3m-namazu-arguments +;; '("-r" "-h" "-H" "-n" w3m-namazu-page-max "-w" whence)) + +(defun mew-nmz-namazu (&optional pattern indexs) + "Execute w3m-namazu. +If executed with '\\[universal-argument]', search result indexes." + (interactive) + (if (not (or (featurep 'w3m-namazu) + (condition-case nil + (require 'w3m-namazu) + (error nil)))) + (message "Please install \"emacs-w3m\"") + (mew-nmz-setup) + (if current-prefix-arg + ;; rest indexes + (let (current-prefix-arg) + (mew-nmz-namazu mew-nmz-namazu-pattern mew-nmz-namazu-miss-folders)) + (let ((i mew-nmz-db-max) + flds nmzdirs fldmsgs pickflds overmsg) + (setq flds (or indexs (mew-nmz-input-folders))) + (setq mew-nmz-namazu-pattern + (setq pattern + (or pattern + (let ((mew-pick-field-list (mew-nmz-pick-field-list))) + (mew-nmz-pick-canonicalize-pattern + (mew-input-pick-pattern "Namazu pick")))))) + (setq mew-nmz-namazu-miss-folders nil) + (setq nmzdirs (mew-nmz-flds-to-indexs flds)) + (when (> (length nmzdirs) mew-nmz-db-max) + (setq fldmsgs (mew-nmz-multi-pick nmzdirs pattern)) + (when fldmsgs + (dolist (fldmsg fldmsgs) + (setq pickflds (cons (car fldmsg) pickflds))) + (when (> (length pickflds) mew-nmz-db-max) + (setq mew-nmz-namazu-miss-folders + (nthcdr mew-nmz-db-max (nreverse pickflds))) + (setq overmsg (format "Warning: %d indexes over" + (length mew-nmz-namazu-miss-folders)))) + (setq nmzdirs nil) + (while (and pickflds (> i 0)) + (setq nmzdirs (cons (mew-nmz-expand-folder (car pickflds)) + nmzdirs)) + (setq pickflds (cdr pickflds)) + (setq i (1- i))))) + ;; message viewer set + (unless (assoc mew-nmz-namazu-content-type w3m-content-type-alist) + (setq w3m-content-type-alist + (cons `(,mew-nmz-namazu-content-type "/[0-9]+$" nil "text/plain") + w3m-content-type-alist))) + (add-hook 'w3m-display-hook 'w3m-mew-message-view t) + ;; remove pre mew-nmz-namazu's alist + (when (assoc mew-nmz-namazu-index-alias w3m-namazu-index-alist) + (setq w3m-namazu-index-alist + (delete (assoc mew-nmz-namazu-index-alias w3m-namazu-index-alist) + w3m-namazu-index-alist))) + ;; for next page + (setq w3m-namazu-index-alist + (append (list (cons mew-nmz-namazu-index-alias nmzdirs)) + w3m-namazu-index-alist)) + (w3m-namazu mew-nmz-namazu-index-alias pattern 'reload) + (when overmsg (message overmsg)))))) + +(defun w3m-mew-message-view (url) + (if (and (boundp 'mew-mail-path) + (w3m-url-local-p url) + (string-match (concat (file-name-as-directory + (expand-file-name mew-mail-path)) + ".+/[0-9]+$") + (expand-file-name (w3m-url-to-file-name url)))) + (unless (get-text-property (point-min) 'w3m-mew-namazu) + (mew-elet + (goto-char (point-min)) + (condition-case nil + (let (pos) + (mew-decode-rfc822-header) + (mew-header-goto-end) + (mew-header-arrange (point-min) (point)) + (mew-highlight-body-region (point) (point-max)) + ;; for emacs-w3m + (remove-text-properties (point-min) (point-max) + '(read-only nil)) + (setq pos (if (get-text-property (point-min) 'mew-visible) + (point-min) + (or (next-single-property-change (point-min) 'mew-visible) + (point-min)))) + (set-window-start (selected-window) pos)) + (error nil)) + (put-text-property (point-min) (point-min) 'w3m-mew-namazu t) + (set-buffer-modified-p nil))) + (remove-text-properties (point-min) (point-min) '(w3m-mew-namazu nil)))) + +;; Input "Namazu pattern" functions. + +;; Mew pickpattern converter +(defun mew-nmz-pick-canonicalize-pattern (pattern) + (let ((mew-inherit-pick-omit-and t)) + (mapconcat + 'mew-nmz-pick-native-text-namazu + (mew-pick-parse (mew-pick-lex pattern)) + " "))) + +(defun mew-nmz-pick-native-text-namazu (token) + (mew-pick-native-text "mew-nmz-pick-pattern-namazu-" token)) + +(defun mew-nmz-pick-pattern-namazu-and (sym) "and") +(defun mew-nmz-pick-pattern-namazu-or (sym) "or") +(defun mew-nmz-pick-pattern-namazu-open (sym) "(") +(defun mew-nmz-pick-pattern-namazu-close (sym) ")") +(defun mew-nmz-pick-pattern-namazu-not (sym) "not") +(defun mew-nmz-pick-pattern-namazu-key (key) key) +(defun mew-nmz-pick-pattern-namazu-kyvl (kyvl) + (when (string= (nth 0 kyvl) "=") + (format "+%s:%s" (nth 1 kyvl) (nth 2 kyvl)))) + +(defun mew-nmz-pick-pattern-gather-header () + (when mew-nmz-pick-gather-field-list + (save-excursion + (let* ((fld (mew-summary-folder-name)) + (msg (mew-summary-message-number)) + (buf (mew-cache-hit fld msg)) + (gathers mew-nmz-pick-gather-field-list) + killbuff retlst gather header duplchk mid addrs addr prefix) + (when (and (not buf) fld msg) + (setq buf (generate-new-buffer mew-buffer-prefix)) + (setq killbuff t) + (set-buffer buf) + (mew-erase-buffer) + (mew-insert-message + fld msg mew-cs-text-for-read mew-header-reasonable-size)) + (when (and buf (get-buffer buf) (buffer-name (get-buffer buf))) + (set-buffer buf) + (while gathers + (setq gather (car gathers)) + (setq header (mew-header-get-value (car gather))) + (when (and header (car (cdr gather))) + (cond + ((eq (car (cdr gather)) 'msgid) + (while (and header (string-match "<\\([^>]+\\)>" header)) + (setq mid (match-string 1 header)) + (setq header (substring header (match-end 0))) + (if (member mid duplchk) + () + (setq prefix (nthcdr 2 gather)) + (setq duplchk (cons mid duplchk)) + (while prefix + (setq retlst (cons (concat (car prefix) mid) retlst)) + (setq prefix (cdr prefix)))))) + ((eq (car (cdr gather)) 'address) + (setq addrs (mew-addrstr-parse-address-list header)) + (while (setq addr (car addrs)) + (setq addr (downcase addr)) + (if (not (member addr duplchk)) + (let ((prefix (nthcdr 2 gather))) + (setq duplchk (cons addr duplchk)) + (while prefix + (setq retlst (cons (concat (car prefix) addr) retlst)) + (setq prefix (cdr prefix))))) + (setq addrs (cdr addrs)))))) + (setq gathers (cdr gathers))) + (when killbuff (mew-kill-buffer buf)) + (when retlst + (setq retlst (append + retlst + (list + (concat " " (make-string (- (window-width) 10) ?-)))))) + (nreverse retlst)))))) + +;; "Namazu search engine" functions. +(defun mew-nmz-multi-pick (nmzdirs pattern &optional catch single) + "Get message numbers with many folders." + (let ((tmpdirs nmzdirs) + (defaultregex + (concat "^" (regexp-opt + (delq mew-folder-virtual (copy-sequence mew-folder-prefixes))))) + nxt prog-args intmsgs retmsgs sortfld defmsgs casemsgs cell) + (setq pattern (mew-cs-encode-arg pattern)) + (setq nmzdirs nil) + (while tmpdirs + (setq nxt (nthcdr mew-nmz-db-max tmpdirs)) + (if nxt (setcdr (nthcdr (1- mew-nmz-db-max) tmpdirs) nil)) + (setq nmzdirs (cons tmpdirs nmzdirs)) + (setq tmpdirs nxt)) + (setq nmzdirs (nreverse nmzdirs)) + (with-temp-buffer + (while (and nmzdirs + (or (not catch) + (and catch (null intmsgs)))) + (setq prog-args (delq nil (append mew-nmz-prog-args + (list "--all" "--list" "--no-decode-uri") + (list pattern) + (car nmzdirs)))) + (erase-buffer) + (mew-piolet + mew-cs-text-for-read mew-cs-text-for-write + (let ((file-name-coding-system nil)) + (apply (function call-process) + mew-nmz-prog nil t nil prog-args))) + (goto-char (point-min)) + (let (dir msgnum) + (while (not (eobp)) + (when (looking-at mew-nmz-result-regex) + (setq dir (mew-buffer-substring (match-beginning 1) (match-end 1))) + (setq msgnum (string-to-number + (mew-buffer-substring (match-beginning 2) (match-end 2)))) + (if (not (setq cell (assoc dir intmsgs))) + (setq intmsgs (cons (list dir (list msgnum)) intmsgs)) + (unless (memq msgnum (car (cdr cell))) + (nconc (car (cdr cell)) (list msgnum))))) + (forward-line)) + (setq nmzdirs (cdr nmzdirs)))) + (when intmsgs + (if single + ;; for search-mark + (mapcar 'number-to-string (sort (car (cdr (car intmsgs))) '<)) + ;; for virtual or w3m-namazu + (setq retmsgs intmsgs) + (while retmsgs + (setq sortfld (cons (car (car retmsgs)) sortfld)) + (setq retmsgs (cdr retmsgs))) + ;; no sort + ;; (setq sortfld (sort sortfld 'string<)) + (while sortfld + (setq cell (assoc (car sortfld) intmsgs)) + (setq retmsgs + (cons + (cons (mew-nmz-url-to-folder (car cell)) + (mapcar 'number-to-string (sort (car (cdr cell)) '<))) + retmsgs)) + (setq sortfld (cdr sortfld))) + ;; '((folder msg ...) (folder msg ...) ...) + (while retmsgs + (when (car (car retmsgs)) + (if (string-match defaultregex (car (car retmsgs))) + (setq defmsgs (cons (car retmsgs) defmsgs)) + (setq casemsgs (cons (car retmsgs) casemsgs)))) + (setq retmsgs (cdr retmsgs))) + (append defmsgs casemsgs)))))) + +;; miscellaneous functions +(defun mew-nmz-flds-to-indexs (flds) + (let ((suffix (append + '("*") + (delq mew-folder-virtual (copy-sequence mew-folder-prefixes)))) + nmzdirs tmp) + (setq suffix (concat (regexp-opt suffix) "$")) + (dolist (fld flds) + (setq fld (mew-nmz-case-folder-normalize fld)) + (cond + ((or (string-match suffix fld) + (string-match "^\\*" fld)) + (setq nmzdirs (append nmzdirs + (mew-nmz-expand-folder-regexp fld)))) + ((setq tmp (mew-nmz-folder-to-nmzdir fld)) + (setq nmzdirs (cons tmp nmzdirs))))) + (nreverse (mew-uniq-list nmzdirs)))) + +(defun mew-nmz-expand-folder-regexp (case:folder) + (mew-nmz-setup) + (let ((alist mew-nmz-fld-index-alist) + case fld caseregex nmzdirs tmpfld nmzdir protos newcase lst) + (if (string= case:folder "*:*") + ;; all case, all proto, all folder + (dolist (lst alist) + (setq nmzdirs (cons (cdr lst) nmzdirs))) + (if (string-match "^\\([^:]+\\):\\(.*\\)$" case:folder) + (setq case (match-string 1 case:folder) + fld (match-string 2 case:folder)) + (setq case "") + (setq fld case:folder)) + (when (string-match "^.*\\*$" fld) + (setq fld (substring fld 0 -1)) + (setq fld (directory-file-name fld))) + (cond + ((string= case "*") + ;; all case + (setq caseregex "^\\([^:]+:\\)?")) + ((or (string= case "") (string= mew-case-default case)) + ;; default case + (setq caseregex "^")) + ((string= fld "") + (setq protos (delq mew-folder-virtual (copy-sequence mew-folder-prefixes))) + (setq caseregex + (concat "^\\(\\(" + (mapconcat + (lambda (x) + (setq newcase (mew-nmz-case-normalize + (concat case ":" x))) + (if (string= newcase "") + (regexp-quote x) + (regexp-quote (concat case ":" x)))) + protos "\\)\\|\\(") + "\\)\\)"))) + (t + (setq case (mew-nmz-case-normalize (concat case ":" fld))) + (if (string= case "") + (setq caseregex "^") + (setq caseregex (concat "^" (regexp-quote case) ":"))))) + (if (string= fld "") + (setq caseregex (concat caseregex "[^:]+$")) + (setq caseregex (concat caseregex (regexp-quote fld)))) + (dolist (lst alist) + (setq tmpfld (car lst)) + (setq nmzdir (cdr lst)) + (when (string-match caseregex tmpfld) + (setq nmzdirs (cons nmzdir nmzdirs))))) + nmzdirs)) + +(defun mew-nmz-goto-folder-msg (fld msg &optional pos disp) + (when (string-match "^+#" fld) + (mew-nmz-setup) + (setq fld (or (cdr (assoc (mew-expand-folder fld) mew-nmz-url-fld-alist)) + fld))) + (mew-summary-visit-folder fld) + (if (mew-virtual-p) + (mew-summary-move-and-display msg disp) + (goto-char (point-min)) + (if (mew-nmz-re-search-message msg) + (setq pos (point)) + (setq pos + (catch 'det + (while mew-summary-buffer-process + (sit-for 0.1) + ;; accept-process-output or sleep-for is not enough + (discard-input) + (unless pos + (goto-char (point-min)) + (when (mew-nmz-re-search-message msg) + (setq pos (point)) + (throw 'det t)))) + pos))) + (if pos (goto-char pos)) + (mew-thread-move-cursor) + (mew-summary-display disp))) + +(defun mew-nmz-index-new-p (fld) + (let ((touchtime (mew-file-get-time + (expand-file-name + mew-summary-touch-file + (file-chase-links (mew-expand-folder fld))))) + (stamptime (mew-file-get-time + (expand-file-name + "NMZ.stamp" (mew-nmz-expand-folder fld))))) + (cond + ((null touchtime) nil) + ((null stamptime) nil) + ((> (nth 0 stamptime) (nth 0 touchtime)) t) + ((and (= (nth 0 stamptime) (nth 0 touchtime)) + (> (nth 1 stamptime) (nth 1 touchtime))) t) + (t nil)))) + +(defun mew-nmz-index-delete (nmzdir &optional tmpfiles) + "Delete namazu index files." + (when (file-directory-p nmzdir) + (let* ((regex (if tmpfiles "^NMZ\..*tmp$" "^NMZ\.")) + (flist (directory-files nmzdir 'full regex 'nosort))) + (dolist (file flist) + (setq file (expand-file-name file nmzdir)) + (and (file-exists-p file) + (file-writable-p file) + (delete-file file)))))) + +(defun mew-nmz-skip-folder-p (fld) + (let ((skips mew-nmz-mknmz-skip-folders-regexp)) + (catch 'match + (setq fld (mew-nmz-case-folder-normalize fld)) + (dolist (skip skips) + (when (string-match skip fld) + (throw 'match t))) + nil))) + +(defun mew-nmz-gcnmz-folder-p (fld) + (let ((regexps mew-nmz-use-gcnmz-folders-regexp)) + (catch 'match + (setq fld (mew-nmz-case-folder-normalize fld)) + (while regexps + (when (string-match (car regexps) fld) + (throw 'match t)) + (setq regexps (cdr regexps))) + nil))) + +(defun mew-nmz-timestamp-new (fld) + (let ((file (expand-file-name "NMZ.stamp.new" (mew-nmz-expand-folder fld)))) + (if (file-writable-p file) + (write-region "touched by Mew." nil file nil 'no-msg)))) + +(defun mew-nmz-timestamp-rename (fld) + (let ((nfile (expand-file-name "NMZ.stamp.new" (mew-nmz-expand-folder fld))) + (tfile (expand-file-name "NMZ.stamp" (mew-nmz-expand-folder fld)))) + (if (and (file-readable-p nfile) (file-writable-p tfile)) + (rename-file nfile tfile 'ok) + (if (file-writable-p nfile) + (delete-file nfile))))) + +(defun mew-nmz-re-search-message (msg) + (let ((here (point))) + (if (not (re-search-forward (concat "^.*\r +" msg "[^0-9]") nil t)) + (progn (goto-char here) + nil) + (beginning-of-line) + t))) + +;; index delete/rename +;; call from mew-summary-delete-folder() +;; case:folder MUST not branch +(defun mew-nmz-folder-index-delete (case:folder) + (let ((nmzdir (mew-nmz-expand-folder case:folder)) + (fld (mew-nmz-case-folder-normalize case:folder))) + (when (and (file-exists-p nmzdir) (file-directory-p nmzdir)) + (mew-delete-directory-recursively nmzdir) + (setq mew-nmz-fld-index-alist + (delete (assoc fld mew-nmz-fld-index-alist) mew-nmz-fld-index-alist)) + (setq mew-nmz-url-fld-alist + (delete (assoc (mew-expand-folder fld) mew-nmz-url-fld-alist) + mew-nmz-url-fld-alist)) + (mew-nmz-cache-save)))) + +;; call from mew-summary-rename-folder() +(defun mew-nmz-folder-index-rename (case:folder case:new-folder) + (let ((nmzdir (mew-nmz-expand-folder case:folder)) + (new-nmzdir (mew-nmz-expand-folder case:new-folder)) + (dir (file-name-as-directory (mew-expand-folder case:folder))) + (new-dir (file-name-as-directory (mew-expand-folder case:new-folder)))) + (when (and (file-exists-p nmzdir) (file-directory-p nmzdir) + (not (file-exists-p new-nmzdir))) + (mew-nmz-cleanup 'remove) + (rename-file nmzdir new-nmzdir) + (when mew-nmz-use-drive-letter + (when (string-match "^\\([a-zA-Z]\\):\\(/.*\\)" dir) + (setq dir (concat "/" + (substring dir (match-beginning 1) (match-end 1)) + "|" + (substring dir (match-beginning 2) (match-end 2))))) + (when (string-match "^\\([a-zA-Z]\\):\\(/.*\\)" new-dir) + (setq new-dir (concat "/" + (substring new-dir (match-beginning 1) (match-end 1)) + "|" + (substring new-dir (match-beginning 2) (match-end 2)))))) + (mew-nmz-folder-reindex-recursively new-nmzdir dir new-dir)))) + +(defun mew-nmz-folder-reindex-recursively (dir from to) + (let ((files (directory-files dir 'full mew-regex-files 'no-sort)) + urifile) + (when (member (setq urifile (expand-file-name "NMZ.field.uri" dir)) files) + (mew-nmz-folder-index-reindex dir urifile from to)) + (dolist (file files) + (when (file-directory-p file) + (mew-nmz-folder-reindex-recursively file from to))))) + +(defun mew-nmz-folder-index-reindex (dir file from to) + (setq from (concat "^" (regexp-quote from))) + (when (and (file-readable-p file) (file-regular-p file)) + (message "mew-nmz: reindexing %s..." dir) + (with-temp-buffer + (mew-frwlet + mew-cs-autoconv mew-nmz-cs-index + (insert-file-contents file) + (goto-char (point-min)) + (while (not (eobp)) + (when (looking-at from) + (delete-region (match-beginning 0) (match-end 0)) + (insert to)) + (forward-line 1)) + (write-region (point-min) (point-max) file nil 'nomsg))) + (when (mew-which-exec mew-nmz-prog-rfnmz) + (call-process mew-nmz-prog-rfnmz nil nil nil dir)) + (message "mew-nmz: reindexing %s...done" dir))) + +;; mew-nmz-setup +(defun mew-nmz-gather-indexed-folder (case folders-alist &optional proto) + (let ((ocase case) + fld nmzdir fld-index-alist url-fld-alist) + (unless case (setq case "")) + (dolist (flds folders-alist) + (setq fld (car flds)) + (when fld + (when (eq proto 'imap) + (setq fld (mew-nmz-imap-directory-file-name fld ocase))) + (setq fld (directory-file-name (if (string= case "") + fld + (concat case ":" fld)))) + (when (and (or (not (eq proto 'nntp)) + (file-directory-p (mew-expand-folder fld))) + (setq nmzdir (mew-nmz-expand-folder fld)) + (file-directory-p nmzdir) + (file-exists-p (expand-file-name "NMZ.i" nmzdir))) + (setq fld-index-alist (cons (cons fld nmzdir) fld-index-alist)) + (setq url-fld-alist (cons (cons (mew-expand-folder fld) fld) url-fld-alist))))) + (setq mew-nmz-fld-index-alist + (append mew-nmz-fld-index-alist (nreverse fld-index-alist))) + (setq mew-nmz-url-fld-alist + (append mew-nmz-url-fld-alist (nreverse url-fld-alist))))) + +(defun mew-nmz-setup () + (unless mew-nmz-setup-p + (unless (and (mew-which-exec mew-nmz-prog-mknmz) + (mew-which-exec mew-nmz-prog)) + (error "Please install namazu")) + (message "mew-nmz setup...") + (unless (mew-nmz-cache-load) + (mew-nmz-cleanup) + (let ((prefixes (delq mew-folder-virtual (copy-sequence mew-folder-prefixes))) + nmzdir-case-alist + case-alist cases case ocase gcase nmzdir alst) + (dolist (prefix prefixes) + (setq cases (mapcar (lambda (x) + (if (string= x mew-case-default) "" x)) + mew-config-cases)) + (when (member "" cases) + (setq cases (cons "" (delete "" cases)))) + (setq nmzdir-case-alist nil) + (setq case-alist nil) + (setq gcase nil) + (while (setq case (car cases)) + (setq nmzdir (mew-nmz-expand-folder (if (string= case "") + prefix + (concat case ":" prefix)))) + (if (setq alst (assoc nmzdir nmzdir-case-alist)) + (progn + (setq ocase (car (assoc (cdr alst) case-alist))) + (setq case-alist (cons (cons case ocase) case-alist))) + (setq nmzdir-case-alist + (cons (cons nmzdir case) nmzdir-case-alist)) + (setq case-alist (cons (cons case case) case-alist)) + (setq gcase (cons case gcase))) + (setq cases (cdr cases))) + (setq gcase (nreverse gcase)) + (cond + ((mew-folder-imapp prefix) + (setq mew-nmz-imap-case-alist (nreverse case-alist)) + (while (setq case (car gcase)) + (mew-nmz-gather-indexed-folder case (mew-imap-folder-alist case) 'imap) + (setq gcase (cdr gcase)))) + ((mew-folder-popp prefix) + (setq mew-nmz-pop-case-alist (nreverse case-alist)) + (while (setq case (car gcase)) + (mew-nmz-gather-indexed-folder case `((,mew-pop-inbox-folder))) + (setq gcase (cdr gcase)))) + ((mew-folder-nntpp prefix) + (setq mew-nmz-nntp-case-alist (nreverse case-alist)) + (while (setq case (car gcase)) + (mew-nmz-gather-indexed-folder case (mew-nntp-folder-alist case) 'nntp) + (setq gcase (cdr gcase)))) + (t ;; local + (mew-nmz-gather-indexed-folder nil (mew-local-folder-alist))))) + (mew-nmz-cache-save))) + (message "mew-nmz setup...done") + (setq mew-nmz-setup-p t) + (run-hooks 'mew-nmz-setup-hook))) + +(defun mew-nmz-status-update () + (mew-nmz-cleanup 'remove)) + +(defconst mew-nmz-cache-parts '(imap-case nntp-case pop-case fld-index url-fld)) + +(defun mew-nmz-cleanup (&optional remove) + (if remove (mew-nmz-cache-remove)) + (setq mew-nmz-setup-p nil) + (let ((parts (copy-sequence mew-nmz-cache-parts))) + (dolist (part parts) + (set (mew-nmz-cache-alist-name part) nil)))) + +(defun mew-nmz-cache-save () + (when (stringp mew-nmz-cache-file-prefix) + (let ((parts (copy-sequence mew-nmz-cache-parts)) + file alist) + (dolist (part parts) + (setq file (mew-nmz-cache-file-name part)) + (setq alist (symbol-value (mew-nmz-cache-alist-name part))) + (mew-lisp-save file alist 'nobackup 'unlimit))))) + +(defun mew-nmz-cache-load () + (when (stringp mew-nmz-cache-file-prefix) + (let ((parts (copy-sequence mew-nmz-cache-parts)) + file) + (catch 'noexist + (dolist (part parts) + (setq file (mew-nmz-cache-file-name part)) + (if (file-readable-p file) + (set (mew-nmz-cache-alist-name part) (mew-lisp-load file)) + (throw 'noexist nil))) + t)))) + +(defun mew-nmz-cache-remove () + (when (stringp mew-nmz-cache-file-prefix) + (let ((parts (copy-sequence mew-nmz-cache-parts)) + file) + (dolist (part parts) + (setq file (mew-nmz-cache-file-name part)) + (when (and (file-exists-p file) (file-writable-p file)) + (delete-file file)))))) + +;; mew-nmz-fixer +;; to be continue ... + +(provide 'mew-nmz) + +;;; Copyright Notice: + +;; Copyright (C) 1999-2007 Hideyuki SHIRAI +;; Copyright (C) 1994-2007 Mew developing team. +;; All rights reserved. + +;; Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions +;; are met: +;; +;; 1. Redistributions of source code must retain the above copyright +;; notice, this list of conditions and the following disclaimer. +;; 2. Redistributions in binary form must reproduce the above copyright +;; notice, this list of conditions and the following disclaimer in the +;; documentation and/or other materials provided with the distribution. +;; 3. Neither the name of the team nor the names of its contributors +;; may be used to endorse or promote products derived from this software +;; without specific prior written permission. +;; +;; THIS SOFTWARE IS PROVIDED BY THE TEAM AND CONTRIBUTORS ``AS IS'' AND +;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +;; PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE TEAM OR CONTRIBUTORS BE +;; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +;;; mew-nmz.el ends here diff -urN mew.orig/contrib/mew-refile-view.el mew/contrib/mew-refile-view.el --- mew.orig/contrib/mew-refile-view.el 1970-01-01 09:00:00.000000000 +0900 +++ mew/contrib/mew-refile-view.el 2011-06-15 00:20:15.000000000 +0900 @@ -0,0 +1,443 @@ +;;; mew-refile-view.el --- View refile alist + +;; Author: Takashi P.KATOH +;; Created: Oct 22, 1998 +;; Revised: Jan 06, 2004 + +;;; Code: + +(defconst mew-refile-view-version "mew-refile-view.el version 0.07") + +(require 'mew) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; User customize variables +;;; + +;; -> mew-vars.el ? +(defvar mew-refile-view-exec-confirm t + "*Non nil means `mew-refile-view-exec' prompts the user for +confirmation before refiling.") + +(defvar mew-refile-view-show-trash nil + "*Non nil means trash folder (i.e. delete-marked messages) +will be also shown.") + +(defvar mew-refile-view-mode-hook nil) +(defvar mew-refile-view-mode-map nil) + +(defvar mew-refile-view-mode-menu-spec + '("Mew/RefileView" + ["Next page" scroll-up t] + ["Prev page" scroll-down t] + ["Top" beginning-of-buffer t] + ["Bottom" end-of-buffer t] + ["Prev message" mew-refile-view-prev-msg t] + ["Next message" mew-refile-view-next-msg t] + "----" + ["Show again" mew-refile-view-again t] + ["Goto summary" mew-refile-view-goto-summary t] + ["Unmark (single refile folder)" mew-refile-view-unmark-one t] + ["Unmark" mew-refile-view-unmark t] + ["Refile" mew-refile-view-refile t] + ["Delete" mew-refile-view-delete t] + ["Quit" mew-refile-view-quit t] + )) + +(if mew-refile-view-mode-map + () + (setq mew-refile-view-mode-map (make-sparse-keymap)) + (define-key mew-refile-view-mode-map " " 'scroll-up) + (define-key mew-refile-view-mode-map "\177" 'scroll-down) + (define-key mew-refile-view-mode-map "." 'mew-refile-view-goto-summary) + (define-key mew-refile-view-mode-map "h" 'mew-refile-view-goto-summary) + (define-key mew-refile-view-mode-map "n" 'mew-refile-view-next-msg) + (define-key mew-refile-view-mode-map "p" 'mew-refile-view-prev-msg) + (define-key mew-refile-view-mode-map "N" 'mew-refile-view-next-fld) + (define-key mew-refile-view-mode-map "P" 'mew-refile-view-prev-fld) + (define-key mew-refile-view-mode-map "l" 'mew-refile-view-again) + (define-key mew-refile-view-mode-map "u" 'mew-refile-view-unmark-one) + (define-key mew-refile-view-mode-map "U" 'mew-refile-view-unmark) + (define-key mew-refile-view-mode-map "o" 'mew-refile-view-refile) + (define-key mew-refile-view-mode-map "d" 'mew-refile-view-delete) + (define-key mew-refile-view-mode-map "x" 'mew-refile-view-exec) + (define-key mew-refile-view-mode-map "q" 'mew-refile-view-quit) + (define-key mew-refile-view-mode-map "Q" 'mew-refile-view-exit) + (define-key mew-refile-view-mode-map "<" 'beginning-of-buffer) + (define-key mew-refile-view-mode-map ">" 'end-of-buffer) + ) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Refile view mode +;;; + +(defun mew-re-search-forward-and-backward (regexp bound noerror) + (or (re-search-forward regexp bound noerror) + (re-search-backward regexp bound noerror))) + +;; -> mew-vars ? +(defconst mew-refile-view-folder-regex "^[*+=]") +(defvar mew-original-folder nil) + +(defun mew-assoc-add (key alist mem) + (append (list (append (or (assoc key alist) (list key)) (list mem))) + (delete (assoc key alist) alist))) + +(defun mew-car-string< (a1 a2) + (let ((k1 (car a1)) (k2 (car a2))) + (string< k1 k2))) + +(defun mew-refile-view-make-alist (msg) + ;; (mew-sinfo-get-refile) -> '(("+foo" "1" "2") ("+bar" "4" "3")) + (let ((alist + (mapcar '(lambda (msg) (assoc msg (mew-sinfo-get-refile))) msg)) + result) + (while alist + (let ((flist (cdr (car alist)))) + (while flist + (setq result (mew-assoc-add (car flist) result (car (car alist))) + flist (cdr flist)))) + (setq alist (cdr alist))) + result)) + +(defun mew-refile-view (&optional prefix) + (interactive "P") + (mew-pickable + (if (interactive-p) + (mew-current-set-window-config)) + (let* ((folder (buffer-name)) + (bufname (format "*Mew refile view* (%s)" folder)) + (mew-refile-view-show-trash (or prefix mew-refile-view-show-trash)) + (refile (mew-summary-mark-collect mew-mark-refile + (point-min) (point-max))) + (trash + (if mew-refile-view-show-trash + (mew-summary-mark-collect mew-mark-delete + (point-min) (point-max)) + nil)) + (unlink + (if mew-refile-view-show-trash + (mew-summary-mark-collect mew-mark-unlink + (point-min) (point-max)) + nil)) + (ofld (substring folder 1)) + tmp) + (if (and (mew-thread-p) (get-buffer ofld)) + (progn + (save-excursion + (set-buffer ofld) + (setq tmp (mew-sinfo-get-refile))) + (mew-sinfo-set-refile tmp))) + (if (not (or refile trash unlink)) + (progn + (message "No refile marks") + (if (buffer-live-p (get-buffer bufname)) + (progn + (set-buffer bufname) + (setq buffer-read-only nil) + (erase-buffer) + (insert "No refile marks\n") + (setq buffer-read-only t)))) + (let ((alist (mew-refile-view-make-alist refile)) + tmpalist view summary num numlist) + (setq view (pop-to-buffer bufname)) + (setq buffer-read-only nil) + (erase-buffer) + (mew-buffers-setup bufname) + + (setq tmpalist alist) + (setq alist nil) + (while tmpalist + (if (string= mew-trash-folder (car (car tmpalist))) + (progn + (setq trash (append (cdr (car tmpalist)) trash)) + (setq alist (append (cdr tmpalist) alist)) + (setq tmpalist nil)) + (setq alist (cons (car tmpalist) alist)) + (setq tmpalist (cdr tmpalist)))) + ;; + (setq alist (sort alist 'mew-car-string<)) + (if trash + (setq alist (append alist (list (cons mew-trash-folder trash))))) + (if unlink + (setq alist (append alist (list (cons "+REMOVE" unlink))))) + (while alist + (set-buffer view) + (insert (concat (car (car alist)) "\n")) + (setq numlist (sort (mapcar 'string-to-int (cdr (car alist))) '<)) + (while numlist + (setq num (car numlist) + numlist (cdr numlist)) + ;; + (set-buffer (get-buffer folder)) + ;; Mew4 + (when (mew-re-search-forward-and-backward + (mew-regex-sumsyn-msg (int-to-string num)) nil t) + (if (mew-thread-p) + (setq summary + (concat + (mew-buffer-substring (line-beginning-position) + (progn (move-to-column (mew-vinfo-get-column)) + (point))) + (mew-buffer-substring (let ((mew-use-thread-cursor t)) + (progn (mew-thread-move-cursor) (point))) + (line-end-position)))) + (setq summary (mew-buffer-substring (line-beginning-position) + (line-end-position)))) + ;; + (set-buffer view) + (insert summary) + (let ((mew-highlight-mark-folder-list (list bufname))) + (mew-mark-unmark)) + (insert "\n"))) + (insert "\n") + (setq alist (cdr alist))) + (goto-char (point-min)) + (mew-refile-view-mode + (if (string-match mew-refile-view-folder-regex folder) + folder nil))) + )))) + +(defun mew-refile-view-goto-summary () + "Get back to Summary mode." + (interactive) + (let (num) + (save-excursion + (beginning-of-line) + (setq num (if (looking-at (concat "^[^\r\n]+" mew-regex-sumsyn-short)) + (mew-match-string 2)))) + (if (not (and mew-original-folder (get-buffer mew-original-folder))) + (progn + (message "No Summary buffer for %s" mew-original-folder) + nil) + (if (get-buffer-window mew-original-folder) + (select-window (get-buffer-window mew-original-folder)) + (mew-summary-switch-to-folder mew-original-folder)) + (if num (mew-summary-move-and-display num)) + t))) + +(defun mew-refile-view-again () + (interactive) + (if (not (and mew-original-folder (get-buffer mew-original-folder))) + (message "No Summary buffer for %s" mew-original-folder) + (set-buffer mew-original-folder) + (mew-refile-view))) + +(defun mew-refile-view-quit () + "Exit from mew-refile-view-mode." + (interactive) + (bury-buffer (current-buffer)) + (delete-windows-on (current-buffer)) + (mew-current-get-window-config)) + +(defun mew-refile-view-exit () + "Exit from mew-refile-view-mode." + (interactive) + (let ((buf (current-buffer))) + (delete-windows-on (current-buffer)) + (kill-buffer buf) + (mew-current-get-window-config))) + +(defun mew-refile-view-next-msg () + "Move to next message in Mew refile view buffer." + (interactive) + (let ((orig (point))) + (end-of-line) + (if (re-search-forward mew-regex-sumsyn-short nil t) + (beginning-of-line) + (goto-char orig)))) + +(defun mew-refile-view-prev-msg () + "Move to previous message in Mew refile view buffer." + (interactive) + (let ((orig (point))) + (beginning-of-line) + (if (re-search-backward mew-regex-sumsyn-short nil t) + (beginning-of-line) + (goto-char orig)))) + +(defun mew-refile-view-next-fld () + (interactive) + (let ((orig (point))) + (end-of-line) + (if (or (re-search-forward "^[+%=]" nil t) + (re-search-forward "^$" nil t)) + (beginning-of-line) + (goto-char orig)))) + +(defun mew-refile-view-prev-fld () + (interactive) + (let ((orig (point))) + (beginning-of-line) + (if (re-search-backward "^[+%=]" nil t) + (beginning-of-line) + (goto-char orig)))) + +(defun mew-refile-view-exec () + (interactive) + (if (not (and mew-original-folder (get-buffer mew-original-folder))) + (message "No Summary buffer for %s" mew-original-folder) + (if (or (not mew-refile-view-exec-confirm) + ;; or yes-or-no-p? + (y-or-n-p "Execute refiling for these messages? ")) + (let ((fld mew-original-folder) + thread) + (save-excursion + (if (save-excursion + (set-buffer fld) + (and (mew-thread-p) + (get-buffer (substring fld 1)))) + (progn + (setq thread t) + (set-buffer (substring fld 1))) + (set-buffer fld)) + (mew-summary-exec)) + (mew-refile-view-exit) + (if thread + (progn + (mew-kill-buffer fld) + (mew-summary-switch-to-folder (substring fld 1)))))))) + + +(defun mew-refile-view-unmark-one () + "Unmark this message. +If this message has multi-refile folders, remove one of them." + (interactive) + (mew-refile-view-msg 'undo 'one)) + +(defun mew-refile-view-unmark () + "Unmark this message." + (interactive) + (mew-refile-view-msg 'undo)) + +(defun mew-refile-view-refile () + "Refile this message." + (interactive) + (mew-refile-view-msg 'refile)) + +(defun mew-refile-view-delete () + "Delete this message." + (interactive) + (mew-refile-view-msg 'delete)) + +(defun mew-refile-view-msg (op &optional one) + (beginning-of-line) + (let ((orig-point (point)) + (orig-buff (current-buffer)) + msg reffld bufref fld ofld tmp) + (if (not (looking-at (concat "^[^\r\n]+" mew-regex-sumsyn-short))) + (message "No message") + (setq msg (mew-match-string 2)) + (if one + (save-excursion + (if (re-search-backward + (concat mew-refile-view-folder-regex ".+$") + nil t) + (setq reffld (buffer-substring (match-beginning 0) + (match-end 0)))))) + ;; in mew summary buffer + (if (mew-refile-view-goto-summary) + (mew-pickable + (cond + ((eq op 'refile) + (mew-summary-refile)) + ((eq op 'undo) + (if (not (and one msg reffld)) + (mew-summary-undo 1) + (setq bufref (assoc msg (mew-sinfo-get-refile))) + (if (< (length bufref) 3) + (mew-summary-undo 1) + ;; remove 1 folder + (setq bufref (delete reffld bufref)) + (setq tmp (mew-sinfo-get-refile)) + (mew-replace-with tmp bufref msg) + (mew-sinfo-set-refile tmp) + (if (mew-thread-p) + (progn + (setq fld (mew-summary-folder-name 'ext)) + (setq ofld (substring fld 1)) + (if (get-buffer ofld) + (save-excursion + (set-buffer ofld) + (mew-sinfo-set-refile tmp)))))))) + ((eq op 'delete) + (mew-summary-delete 1))) + (mew-refile-view))) + ;; we are out of mew summary buffer now + (pop-to-buffer orig-buff) + (if (< orig-point (point-max)) + (goto-char orig-point) + (goto-char (point-max))) + (beginning-of-line)))) + +(defun mew-refile-view-mode (&optional folder) + "Major mode for viewing refile alist. +The keys defined for this mode are: + +SPC Scroll up this message. +DEL Back-scroll this message. +. Get back to Summary mode. +h Get back to Summary mode. +n Move to next message. +p Move to previous message. +N Move to next folder. +P Move to previous folder. +l Reshow . +u Unmark. +o Refile again. +d Put delete mark on this message. +x Process marked messages. +q Quit. +Q Exit. +< Go to top. +> Go to bottom. +" + (interactive) + (setq major-mode 'mew-refile-view-mode) + (setq mode-name "Refile-View") + (setq mode-line-buffer-identification mew-mode-line-id) + (use-local-map mew-refile-view-mode-map) + (setq buffer-read-only t) + (setq selective-display t) + (setq selective-display-ellipses nil) + (setq truncate-lines t) + (make-local-variable 'mew-original-folder) + (setq mew-original-folder folder) + (mew-buffers-setup (buffer-name)) + (run-hooks 'mew-refile-view-mode-hook)) + +(provide 'mew-refile-view) + +;;; Copyright Notice: + +;; Copyright (C) 1998, 1999 Mew developing team. +;; All rights reserved. + +;; Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions +;; are met: +;; +;; 1. Redistributions of source code must retain the above copyright +;; notice, this list of conditions and the following disclaimer. +;; 2. Redistributions in binary form must reproduce the above copyright +;; notice, this list of conditions and the following disclaimer in the +;; documentation and/or other materials provided with the distribution. +;; 3. Neither the name of the team nor the names of its contributors +;; may be used to endorse or promote products derived from this software +;; without specific prior written permission. +;; +;; THIS SOFTWARE IS PROVIDED BY THE TEAM AND CONTRIBUTORS ``AS IS'' AND +;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +;; PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE TEAM OR CONTRIBUTORS BE +;; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +;;; mew-refile-view.el ends here diff -urN mew.orig/contrib/mew-toolbar-frame.el mew/contrib/mew-toolbar-frame.el --- mew.orig/contrib/mew-toolbar-frame.el 1970-01-01 09:00:00.000000000 +0900 +++ mew/contrib/mew-toolbar-frame.el 2011-06-15 00:20:15.000000000 +0900 @@ -0,0 +1,90 @@ +;;; mew-toolbar-frame.el -*-Emacs-Lisp-*- +;;; +;;; Commentary: +;;; Run Mew from toolbar in a separate frame. +;;; +;;; Keywords: +;;; Mew Xemacs ToolBar Frame +;;; +;;; Time-stamp: <99/07/02 16:37:17 jado@sophia> + +;;; How to use: +;;; Require it when initialize. + +;;; Code: + +(provide 'mew-toolbar-frame) + +;;; + +(setq toolbar-mail-reader 'Mew) +(setq toolbar-mail-commands-alist + (cons '(Mew . toolbar-mew) toolbar-mail-commands-alist)) + +(defvar toolbar-mail-use-separate-frame t + "*Whether Mew is invoked in a separate frame.") +(defvar toolbar-mail-frame nil + "The frame in which Mew is displayed.") +(defvar toolbar-mail-frame-plist nil + "*The properties of the frame in which mail is displayed.") +(define-obsolete-variable-alias 'toolbar-mail-frame-properties + 'toolbar-mail-frame-plist) + +(defun toolbar-mew () + "Run Mew in a separate frame." + (interactive) + (if (not toolbar-mail-use-separate-frame) + (mew) + (unless (frame-live-p toolbar-mail-frame) + (setq toolbar-mail-frame (make-frame toolbar-mail-frame-plist)) + (add-hook 'mew-suspend-hook + (lambda () + (when (frame-live-p toolbar-mail-frame) + (if (cdr (frame-list)) + (delete-frame toolbar-mail-frame)) + (setq toolbar-mail-frame nil)))) + (add-hook 'mew-quit-hook + (lambda () + (when (frame-live-p toolbar-mail-frame) + (if (cdr (frame-list)) + (delete-frame toolbar-mail-frame)) + (setq toolbar-mail-frame nil)))) + (select-frame toolbar-mail-frame) + (mew)) + (when (framep toolbar-mail-frame) + (when (frame-iconified-p toolbar-mail-frame) + (deiconify-frame toolbar-mail-frame)) + (select-frame toolbar-mail-frame) + (raise-frame toolbar-mail-frame)))) + +;;; Copyright Notice: + +;; Copyright (C) 1999 Mew developing team. +;; All rights reserved. + +;; Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions +;; are met: +;; +;; 1. Redistributions of source code must retain the above copyright +;; notice, this list of conditions and the following disclaimer. +;; 2. Redistributions in binary form must reproduce the above copyright +;; notice, this list of conditions and the following disclaimer in the +;; documentation and/or other materials provided with the distribution. +;; 3. Neither the name of the team nor the names of its contributors +;; may be used to endorse or promote products derived from this software +;; without specific prior written permission. +;; +;; THIS SOFTWARE IS PROVIDED BY THE TEAM AND CONTRIBUTORS ``AS IS'' AND +;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +;; PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE TEAM OR CONTRIBUTORS BE +;; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +;;; mew-toolbar-frame.el ends here debian/patches/040_Define-mew-regex-url-in-mew-lang-jp.patch0000644000000000000000000000213412161236601020627 0ustar Subject: Define mew-regex-url in mew-lang-jp.el From: Tatsuya Kinoshita Forwarded: https://github.com/kazu-yamamoto/Mew/pull/29 diff --git a/mew-lang-jp.el b/mew-lang-jp.el index ca811d5..1f0b55c 100644 --- a/mew-lang-jp.el +++ b/mew-lang-jp.el @@ -172,6 +172,16 @@ (defvar mew-highlight-body-regex-cite "^\\(\\([ \t]\\{,7\\}\\([>:|$B!S!d!U"d!'!C(B]\\|\\w+\\([._-]+\\w+\\)*>+\\)\\)+\\).*") +(defvar mew-regex-url + (concat + "\\b\\(" + "\\(\\(file\\|news\\|mailto\\):\\)" + "\\|" + "\\(\\(s?https?\\|ftp\\|gopher\\|telnet\\|wais\\)://\\)" + "\\)" + "[^ $B!!(B\t\n>)\"]*" + "[^ $B!!(B\t\n>.,:)\"]+")) + (provide 'mew-lang-jp) ;;; Copyright Notice: diff --git a/mew-vars.el b/mew-vars.el index 292cbc4..6fb5e85 100644 --- a/mew-vars.el +++ b/mew-vars.el @@ -2856,8 +2856,8 @@ in Summary/Virtual mode." "\\|" "\\(\\(s?https?\\|ftp\\|gopher\\|telnet\\|wais\\)://\\)" "\\)" - "[^ $B!!(B\t\n>)\"]*" - "[^ $B!!(B\t\n>.,:)\"]+") + "[^ \t\n>)\"]*" + "[^ \t\n>.,:)\"]+") "*Regular expression to find URL." :group 'mew-highlight :type 'regexp) debian/patches/series0000644000000000000000000000027212253341225012032 0ustar 010_contrib.patch 020_Fix-segfault-of-mewl.patch 030_Use-auth-user-for-smtp-passtag.patch 040_Define-mew-regex-url-in-mew-lang-jp.patch 050_Use-ppmtogif.patch 060_cache-long-scans.patch debian/emacsen-remove.in0000644000000000000000000000051212142204746012424 0ustar #! /bin/sh # /usr/lib/emacsen-common/packages/remove/@PACKAGE@ set -e FLAVOR=$1 PACKAGE=@PACKAGE@ PKGSNAME=mew case $FLAVOR in emacs|*xemacs*|emacs20|emacs19|mule2) exit 0 ;; esac ELCDIR=/usr/share/$FLAVOR/site-lisp/$PKGSNAME echo "remove/$PACKAGE: purging byte-compiled files for $FLAVOR" rm -rf "$ELCDIR" exit 0 debian/control0000644000000000000000000000454012246644701010602 0ustar Source: mew Section: mail Priority: optional Maintainer: Tatsuya Kinoshita Build-Depends: debhelper (>= 7), zlib1g-dev (>= 1:1.1.3) Standards-Version: 3.9.5 Vcs-Git: git://anonscm.debian.org/collab-maint/mew.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/mew.git Homepage: http://www.mew.org/ Package: mew Section: lisp Architecture: all Depends: mew-bin (>= 1:5.3), emacs | emacs24 | emacs23 | emacs22 | emacs21 | emacs-snapshot, dpkg (>= 1.15.4) | install-info, ${misc:Depends} Suggests: w3m-el, gnupg, gpgsm, ssh, wv, xlhtml, ppthtml, compface, netpbm, x-face-el, mu-cite, mule-ucs, bogofilter | bsfilter | spamassassin, hyperestraier, namazu2, namazu2-index-tools, mhc Replaces: mew-beta Conflicts: mew-beta Provides: mail-reader, imap-client, news-reader Description: mail reader supporting PGP/MIME for Emacs Mew (Messaging in the Emacs World) is a user interface for text messages, multimedia messages (MIME), news articles and security functionality including PGP, S/MIME, SSH and SSL. . The features of Mew are as follows: . - POP, SMTP, NNTP and IMAP are supported. - You can easily display a very complicated structured message. - You can start to read messages before they are all fully listed. - For refiling, default folders are neatly suggested. - You can complete field names, e-mail addresses, receiver's names, domain names and folder names. - You can easily search messages with keywords etc. - Thread, a mechanism to display the flow of messages, is supported. Package: mew-bin Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Recommends: stunnel4 | stunnel, ca-certificates, hyperestraier, ruby | ruby-interpreter, ruby-sqlite3 Enhances: mew, gnupg-agent Replaces: mew-beta-bin Conflicts: mew-beta-bin, mew (<< 1:4) Provides: mail-reader, pinentry Description: external commands for Mew The mew-bin package contains external commands for the mew package. . - mewencode: encode/decode MIME objects - mewl: extract necessary fields from messages stored in folders - incm: incoporate new mails from maildir or mbox to Mew's inbox folder - mewest: update indexes of Hyper Estraier - mew-pinentry: front end of gpg-agent to ask a passphrase to a user - mewstunnel: wrapper script for using stunnel - cmew: create Mew's database file - smew: search related messages from Mew's database file debian/watch0000644000000000000000000000017112142204744010216 0ustar version=3 opts="uversionmangle=s/rc/~rc/;s/pre/~pre/" \ http://www.mew.org/Release/mew-([0-9].*)\.tar\.gz debian uupdate debian/mewstunnel0000644000000000000000000000114112142204752011306 0ustar #!/bin/sh # mewstunnel: stunnel wrapper for Mew # # Author: Tatsuya Kinoshita # Created: 31 Jan 2005 # Revised: 19 Oct 2011 # # Copyright (c) 2005-2011 Tatsuya Kinoshita # # Redistribution and use in source and binary forms, with or without # modification, are permitted without restriction, with NO WARRANTY. prog=/usr/sbin/stunnel for f in "$MEW_PROG_STUNNEL" "`which stunnel4`" /usr/local/sbin/stunnel4 \ /usr/sbin/stunnel4 "`which stunnel`" /usr/local/sbin/stunnel; do if [ -n "$f" ] && [ -x "$f" ]; then prog=$f break fi done LC_ALL=C export LC_ALL "$prog" "$@" debian/mew-bin.postinst0000644000000000000000000000042112142204745012327 0ustar #! /bin/sh set -e if [ "$1" = configure ]; then update-alternatives --quiet \ --install /usr/bin/pinentry pinentry /usr/bin/mew-pinentry 0 \ --slave /usr/share/man/man1/pinentry.1.gz pinentry.1.gz /usr/share/man/man1/mew-pinentry.1.gz fi #DEBHELPER# exit 0 debian/emacsen-install.in0000644000000000000000000000341012142204752012572 0ustar #! /bin/sh # /usr/lib/emacsen-common/packages/install/@PACKAGE@ set -e FLAVOR=$1 PACKAGE=@PACKAGE@ PKGSNAME=mew case $FLAVOR in emacs|*xemacs*|emacs20|emacs19|mule2) exit 0 ;; esac ELCDIR=/usr/share/$FLAVOR/site-lisp/$PKGSNAME ELDIR=/usr/share/emacs/site-lisp/$PKGSNAME TOELDIR=../../../emacs/site-lisp/$PKGSNAME ELCSTAMP=$ELCDIR/compile-stamp if [ -f "$ELCSTAMP" ]; then echo "install/$PACKAGE: already byte-compiled for $FLAVOR, skipped" exit 0 fi LOG=`mktemp -t elc.XXXXXXXXXXXX` chmod 644 "$LOG" echo "install/$PACKAGE: byte-compiling for $FLAVOR, logged in $LOG" cd "$ELDIR" LINKS=`echo *.el etc` if [ -d contrib ]; then LINKS="$LINKS "`echo contrib/*.el` fi if [ ! -d "$ELCDIR" ]; then mkdir "$ELCDIR" chmod 755 "$ELCDIR" fi cd "$ELCDIR" rm -f *.elc __myinit.el for f in $LINKS; do ln -sf "$TOELDIR/$f" . done FILES=`/bin/ls -1 *.el | grep -v ^mew-nmz` cat > __myinit.el << EOF (setq load-path (cons "." load-path)) (setq byte-compile-warnings nil) (setq mew-compiling t) (require 'cl) EOF FLAGS="-q -no-site-file -batch -l __myinit.el -f batch-byte-compile" echo "$FLAVOR" $FLAGS $FILES >> "$LOG" "$FLAVOR" $FLAGS $FILES >> "$LOG" 2>&1 chmod 644 *.elc echo "install/$PACKAGE: deleting $LOG" rm -f "$LOG" __myinit.el* echo "install/$PACKAGE: byte-compiling for reverse dependency" pkgs= for p in mhc w3m-el:w3m w3m-el-snapshot:w3m; do pkg=`echo $p | cut -d : -f 1` sname=`echo $p | cut -d : -f 2` dir=/usr/share/$FLAVOR/site-lisp/$sname if [ -n "$sname" ] && [ -d "$dir" ] && [ -f "/usr/lib/emacsen-common/packages/install/$pkg" ]; then rm -f "$dir"/*.elc "$dir"/*/*.elc "$dir"/*-stamp pkgs="$pkg $pkgs" fi done for pkg in $pkgs; do "/usr/lib/emacsen-common/packages/install/$pkg" "$FLAVOR" done touch "$ELCSTAMP" exit 0 debian/mew.postinst0000644000000000000000000000050212251345346011565 0ustar #!/bin/sh set -e # Workaround to compatible with emacsen-common <2.0.0 if [ ! -e /var/lib/emacsen-common/state/package/installed/emacsen-common ]; then if [ "$1" = "configure" ] && [ -x /usr/lib/emacsen-common/emacs-package-install ]; then /usr/lib/emacsen-common/emacs-package-install mew fi else #DEBHELPER# fi debian/source/0000755000000000000000000000000012142204750010463 5ustar debian/source/format0000644000000000000000000000001412142204750011671 0ustar 3.0 (quilt) debian/changelog0000644000000000000000000015532212257031032011043 0ustar mew (1:6.5-7) unstable; urgency=low * New patch 060_cache-long-scans.patch due to emacs-snapshot crash * Workaround for emacsen-common <2 and debhelper <9.20131104 -- Tatsuya Kinoshita Thu, 26 Dec 2013 22:41:45 +0900 mew (1:6.5-6) unstable; urgency=low * Add workaround to compatible with emacsen-common <2.0.0 -- Tatsuya Kinoshita Sun, 08 Dec 2013 15:15:34 +0900 mew (1:6.5-5) unstable; urgency=low * New patch 050_Use-ppmtogif.patch * Update Standards-Version to 3.9.5 -- Tatsuya Kinoshita Sun, 01 Dec 2013 23:39:44 +0900 mew (1:6.5-4) unstable; urgency=low * Replace libsqlite3-ruby by ruby-sqlite3 (closes: #726746) -- Tatsuya Kinoshita Sat, 19 Oct 2013 14:35:26 +0900 mew (1:6.5-3) unstable; urgency=low * New patch 030_Use-auth-user-for-smtp-passtag.patch * New patch 040_Define-mew-regex-url-in-mew-lang-jp.patch * Set Homepage to http://www.mew.org/ -- Tatsuya Kinoshita Sat, 22 Jun 2013 15:05:00 +0900 mew (1:6.5-2) unstable; urgency=low * New patch 020_Fix-segfault-of-mewl.patch * Update Homepage to the /en/ page -- Tatsuya Kinoshita Fri, 31 May 2013 00:31:36 +0900 mew (1:6.5-1) unstable; urgency=low * Imported Upstream version 6.5 * Remove 070_stunnel453.patch (merged upstream) * Remove 060_cmew-blob.patch (merged upstream) * Remove 050_cmew.patch (merged upstream) * Remove 040_stunnel451.patch (merged upstream) * debian/copyright: Updated * Remove contrib from debian/dirs * Add Vcs-Git and Vcs-Browser * Update Standards-Version to 3.9.4 -- Tatsuya Kinoshita Wed, 08 May 2013 00:47:35 +0900 mew (1:6.4-3) unstable; urgency=low * debian/rules: Use dpkg-buildflags to support hardening flags * debian/control: Add emacs24 to Depends -- Tatsuya Kinoshita Sat, 07 Jul 2012 00:15:53 +0900 mew (1:6.4-2) unstable; urgency=low * debian/patches/060_cmew-blob.patch: New patch from upstream to prevent that Ruby 1.9 stores blob data into id.db. * debian/patches/070_stunnel453.patch: New patch to support stunnel 4.53 from [mew-dist 29486] on 2012-03-28, provided by TAKANO Yuji. -- Tatsuya Kinoshita Sat, 31 Mar 2012 01:20:01 +0900 mew (1:6.4-1) unstable; urgency=low * New upstream release. * debian/patches/010_contrib.patch: New patch from upstream for contribution files to Mew. * debian/patches/020_ruby1.8.patch: Removed. (unneeded) * debian/patches/030_stunnel4.patch: Removed. (merged upstream) * debian/patches/050_cmew.patch: New patch from upstream to fix cmew bugs. * debian/*: Merge from mew-beta. -- Tatsuya Kinoshita Sun, 11 Mar 2012 22:54:14 +0900 mew (1:6.3-4) unstable; urgency=low * debian/patches/040_stunnel451.patch: Patch from upstream to support stunnel 4.51 and later. * debian/copyright: Update copyright-format version to 1.0. * debian/control: Update Standards-Version to 3.9.3. -- Tatsuya Kinoshita Wed, 07 Mar 2012 23:15:51 +0900 mew (1:6.3-3) unstable; urgency=low * debian/patches/030_stunnel4.patch: Patch from upstream to catch up to stunnel 4.39. * debian/patches/020_ruby1.8.patch: Patch to use ruby1.8 instead of ruby. * debian/control: - Recommends ruby1.8 instead of ruby. - Update Standards-Version to 3.9.2. * debian/copyright: Switch to the DEP-5 format. * Switch to dpkg-source 3.0 (quilt) format. -- Tatsuya Kinoshita Thu, 01 Sep 2011 00:01:33 +0900 mew (1:6.3-2) unstable; urgency=low * debian/control: - Add `emacs-snapshot' to Depends. - Set Section of mew to lisp. * debian/copyright: Updated. -- Tatsuya Kinoshita Wed, 06 Jan 2010 23:55:26 +0900 mew (1:6.3-1) unstable; urgency=low * New upstream release. - UTF-8 hack for Emacs 23. (closes: #542049) * debian/*: Merged from mew-beta. -- Tatsuya Kinoshita Sat, 21 Nov 2009 07:37:16 +0900 mew (1:6.2-1) unstable; urgency=low * New upstream release. (closes: #484937) - XEmacs is no longer supported. - Guarding broken UTF-7. (closes: #492428) - Implementing encoding of format=flowed. * debian/*: Merged from mew-beta. -- Tatsuya Kinoshita Mon, 16 Feb 2009 21:30:41 +0900 mew (1:5.2-4) unstable; urgency=low * debian/mew-bin.postinst, debian/mew-bin.prerm: New files to provide an alternative for pinentry. * debian/control: - Move `Homepage:' from Description to the header. - Set Standards-Version to 3.7.3. * debian/copyright: Updated. * debian/README.Debian.in: Clarify the default configuration for mew-ssl. -- Tatsuya Kinoshita Fri, 22 Feb 2008 22:22:59 +0900 mew (1:5.2-3) unstable; urgency=low * debian/control: Prefer emacs to emacs21. * debian/rules (clean): Check whether Makefile exists. -- Tatsuya Kinoshita Sun, 15 Jul 2007 00:17:43 +0900 mew (1:5.2-2) unstable; urgency=medium * mew-pop.el: Preventing APOP attack. [CVE-2007-1558] * debian/emacsen-install.in: Rename path.el to __path.el. -- Tatsuya Kinoshita Mon, 23 Apr 2007 20:51:39 +0900 mew (1:5.2-1) unstable; urgency=low * New upstream release. * debian/control, debian/rules: Merged from mew-beta. * debian/watch: Detect "rc" and "pre". * debian/copyright: Updated. -- Tatsuya Kinoshita Sun, 08 Apr 2007 19:55:48 +0900 mew (1:4.2-3) unstable; urgency=low * debian/emacsen-startup.in: Load `timer' on XEmacs to use `cancel-timer'. (closes: #372807) -- Tatsuya Kinoshita Sat, 17 Jun 2006 22:19:17 +0900 mew (1:4.2-2) unstable; urgency=low * debian/watch: Update URL. * debian/control: Suggests ca-certificates. * debian/copyright: Updated. * debian/control (Build-Depends): Depend on debhelper version 5. * debian/compat: 3 -> 5. * debian/control (Standards-Version): 3.6.1 -> 3.7.2. * debian/control (Maintainer): tats@vega.ocn.ne.jp -> tats@debian.org. * debian/copyright: Ditto. -- Tatsuya Kinoshita Thu, 8 Jun 2006 01:24:04 +0900 mew (1:4.2-1) unstable; urgency=low * New upstream release. (closes: #278643) * debian/control: Update dependency. * debian/control: Suggests namazu2-index-tools. * debian/README.Debian.in: Modify sample of mew-mbox-command-arg. * debian/emacsen-install.in: mew-nmz depends on w3m-namazu. * debian/emacsen-install.in: Ready for emacsen flavors sxemacs*. * debian/rules: Generate debian/docs, debian/examples and debian/info at build time. * debian/rules: Use the configure script. * debian/rules: Don't install contrib/*.texi. * debian/rules: Don't install `CVS' directories. * debian/watch: New file. * Ready for dpatch. -- Tatsuya Kinoshita Sat, 4 Jun 2005 14:40:08 +0900 mew (1:3.3+0.20040715-6) unstable; urgency=medium * debian/mewstunnel: New file, wrapper script for using stunnel4 or stunnel. * debian/mewstunnel.1: New file, manpage for mewstunnel. * debian/rules: Install mewstunnel and mewstunnel.1. * debian/emacsen-startup.in: Set the mew-prog-ssl variable to "mewstunnel", set the mew-ssl-cert-directory variable to "/etc/ssl/certs", and set the mew-ssl-verify-level variable to 2. * debian/README.Debian.in: Revise for "mew-ssl". * debian/emacsen-install.in: Recompile w3m-el for mew-w3m. * debian/control: Revise description. * debian/copyright: Updated. -- Tatsuya Kinoshita Sat, 23 Apr 2005 23:53:59 +0900 mew (1:3.3+0.20040715-5) unstable; urgency=medium * bin/incm.c: Fix a format string bug which causes crashes from environment variable. (closes: #278883) * mew-ssl.el: Removing mew-timing() from the SSL code. (patch from Mew 4.1.50) * debian/emacsen-startup.in: Set the mew-prog-ssl variable to "/usr/sbin/stunnel4" if it is executable. (closes: #278735) * debian/README.Debian.in: Add information for mew-prog-ssl. * debian/control: Suggests `stunnel4'. -- Tatsuya Kinoshita Sat, 30 Oct 2004 17:49:56 +0900 mew (1:3.3+0.20040715-4) unstable; urgency=high * Fix race condition problem of +queue again. - mew-net.el: An error is signaled if rename-file fails in +queue. -- Tatsuya Kinoshita Mon, 23 Aug 2004 20:40:10 +0900 mew (1:3.3+0.20040715-3) unstable; urgency=high * Fix that mails in +queue are lost by accident. (patch from pre 4.0.66) - Defining mew-queue-check-new-message to avoid race condition of +queue. * mew-edit.el: Fix that mew-queue-backup doesn't work in mew-summary-reedit-for-queue. -- Tatsuya Kinoshita Sun, 22 Aug 2004 17:02:46 +0900 mew (1:3.3+0.20040715-2) unstable; urgency=low * debian/control: Suggests `mu-cite'. -- Tatsuya Kinoshita Wed, 11 Aug 2004 20:41:51 +0900 mew (1:3.3+0.20040715-1) unstable; urgency=low * New upstream release. (CVS snapshot, stable-3-2 branch on 2004-07-15 at 17:35 +0900) - Many bug fixes from Mew 4. -- Tatsuya Kinoshita Thu, 15 Jul 2004 18:06:38 +0900 mew (1:3.3+0.20040512-1) unstable; urgency=low * New upstream release. (CVS snapshot, stable-3-2 branch on 2004-05-12 at 22:39 +0900) - Fix that mewls fails when file size is zero. * debian/emacsen-startup.in: Set the mew-prog-ssl variable to "/usr/sbin/stunnel". (closes: #248466) * debian/control (Depends): Remove `emacs20'. (closes: #232772) * debian/emacsen-install.in: Create *.el symlinks. -- Tatsuya Kinoshita Wed, 12 May 2004 22:56:18 +0900 mew (1:3.3+0.20040130-1) unstable; urgency=low * New upstream release. (CVS snapshot, stable-3-2 branch on 2004-01-30 at 23:00 +0900) - contrib/00readme-namazu.jis: Updated for IM145 and later. - contrib/mew-smime-ja.texi: Apply free software license. * Apply CVS patches correctly. * debian/copyright: Revised. -- Tatsuya Kinoshita Fri, 30 Jan 2004 23:05:30 +0900 mew (1:3.3+0.20040107-1) unstable; urgency=low * New upstream release. (CVS snapshot, stable-3-2 branch on 2004-01-07) - incm handles a read-only file system. - A bug fix for mew-decode-rfc822-header(). * debian/copyright: Further clarification. -- Tatsuya Kinoshita Sun, 11 Jan 2004 18:35:19 +0900 mew (1:3.3+0.20031003-1) unstable; urgency=low * New upstream release. (CVS snapshot, stable-3-2 branch on 2003-10-03) - mew-func.el: Fix mew-region-bytes problem. - mew-encode.el: Replace ":" with "_" in boundary strings. * debian/rules: Install mew*.el instead of *.el. * debian/README.Debian.in: Support for mew and mew-beta. * debian/rules: Handle README.Debian.in to install README.Debian. * debian/emacsen-install.in: Set *.elc file mode to 644 explicitly. * debian/copyright: Add mirror site of upstream source for HTTP. * debian/control (Build-Depends): debhelper (>= 3.4.4). * debian/control (Standards-Version): 3.6.0 -> 3.6.1. -- Tatsuya Kinoshita Sat, 4 Oct 2003 00:04:28 +0900 mew (1:3.3-2) unstable; urgency=low * debian/control (Suggests): Add `x-face-el, mule-ucs, mhc'. * debian/control (Description): Revised. * debian/rules: Don't use dh_undocumented. * debian/*: Ready for mew-beta. -- Tatsuya Kinoshita Sun, 10 Aug 2003 07:33:42 +0900 mew (1:3.3-1) unstable; urgency=high * New upstream release (closes: #190843) - Fix that recipients are dropped from .mqi file in +queue. (closes: #194290) - mew-ssl.el: Fix that stunnel allows access from remote host. * debian/rules: Revise 00changes.* installation. * debian/*: Apply unofficial patches. - debian/control: Remove dependency on emacs20-dl. (it was orphaned and removed, closes: #190829) - Install contrib files. (closes: #195457) - debian/control: Fix XEmacs dependency problem. - Cleanup installation scripts. * debian/copyright: Revised. * New maintainer. (with previous maintainer's consent) -- Tatsuya Kinoshita Thu, 24 Jul 2003 22:47:51 +0900 mew (1:3.2+3.3rc4-0.0.2) unstable; urgency=low * debian/emacsen-install.in: Revised messages for XEmacs mule/nomule. * debian/control (Standards-Version): 3.5.10 -> 3.6.0. -- Tatsuya Kinoshita Sun, 20 Jul 2003 07:35:35 +0900 mew (1:3.2+3.3rc4-0.0.1) unstable; urgency=high * New upstream release - Security fix: stunnel now allows access from localhost only. * Cleanup installation scripts. -- Tatsuya Kinoshita Wed, 16 Jul 2003 21:58:16 +0900 mew (1:3.2+3.3rc3-0.0.2) unstable; urgency=medium * debian/rules: Fix bashism. * debian/emacsen-startup: Don't add xemacs mule/nomule directory if it doesn't exist. -- Tatsuya Kinoshita Tue, 1 Jul 2003 22:19:15 +0900 mew (1:3.2+3.3rc3-0.0.1) unstable; urgency=low * New upstream release -- Tatsuya Kinoshita Mon, 23 Jun 2003 22:10:41 +0900 mew (1:3.2+3.3rc1-0.0.6) unstable; urgency=low * debian/emacsen-install: Fix failing XEmacs byte-compilation. -- Tatsuya Kinoshita Tue, 17 Jun 2003 00:24:26 +0900 mew (1:3.2+3.3rc1-0.0.5) unstable; urgency=low * debian/emacsen-install: Add symlinks from mule/nomule directory for compatibility. -- Tatsuya Kinoshita Sat, 14 Jun 2003 00:33:45 +0900 mew (1:3.2+3.3rc1-0.0.4) unstable; urgency=low * debian/emacsen-install: Byte-compilation for xemacs*-nomule*. * debian/emacsen-startup: Set load-path to use *.elc for xemacs*-nomule*. * debian/emacsen-startup: Use debian-pkg-add-load-path-item. * debian/control: Add `xemacs21-gnome-nomule' to `Depends'. -- Tatsuya Kinoshita Thu, 12 Jun 2003 21:22:34 +0900 mew (1:3.2+3.3rc1-0.0.3) unstable; urgency=low * debian/emacsen-install: Fix warning error in awk script. -- Tatsuya Kinoshita Sat, 7 Jun 2003 16:33:47 +0900 mew (1:3.2+3.3rc1-0.0.2) unstable; urgency=low * debian/README.Debian: Revised. * debian/rules: Install contrib/*.el files in the site-lisp directory. * debian/emacsen-install: Byte-compile contrib/*.el files. * debian/emacsen-startup: Add the contrib directory to the load-path variable for xemacs*-nomule. * debian/dirs: Add `usr/share/doc/mew/contrib' and `usr/share/emacs/site-lisp/mew/contrib'. -- Tatsuya Kinoshita Sat, 31 May 2003 00:47:37 +0900 mew (1:3.2+3.3rc1-0.0.1) unstable; urgency=high * New upstream release - Fix that recipients are dropped from .mqi file in +queue. -- Tatsuya Kinoshita Thu, 22 May 2003 19:14:49 +0900 mew (1:3.2-1.0.2) unstable; urgency=low * A bug fix for handling Message-Id: in citation. (from stable-3-2 of cvsmew on 2003-05-16) * debian/control: Standards-Version: 3.5.10 -- Tatsuya Kinoshita Fri, 16 May 2003 22:29:11 +0900 mew (1:3.2-1.0.1) unstable; urgency=low * Bug fixes from stable-3-2 of cvsmew on 2003-04-26. * debian/control: Remove dependency on emacs20-dl. (it was orphaned and removed) * debian/control: Favor emacs21 over emacs20. * debian/control: Fix XEmacs version, (>= 21.1.11) -> (>= 21.1.14). * debian/control: Standards-Version: 3.5.9 * debian/copyright: Revised. * Use debian/compat instead of DH_COMPAT. - debian/compat: New file. - debian/rules: Remove `export DH_COMPAT=3'. - debian/control: Build-Depends: debhelper (>> 3.4.4) -- Tatsuya Kinoshita Sat, 26 Apr 2003 19:06:57 +0900 mew (1:3.2-1) unstable; urgency=low * New upstream Official release. -- NOSHIRO Shigeo Tue, 25 Feb 2003 19:42:32 +0900 mew (1:3.1.999rc1-0.0.1) unstable; urgency=low * New upstream release (3.2rc1) -- Tatsuya Kinoshita Wed, 19 Feb 2003 01:08:41 +0900 mew (1:3.1.51-999.0.1) unstable; urgency=low * New upstream release. * Add `stunnel, compface, netpbm' to `Suggests:'. * Delete `fetchmail, procmail, openssl' from `Suggests:'. * emacsen-startup: Delete setting of mew-prog-uncompface and mew-x-face-filter. -- Tatsuya Kinoshita Mon, 20 Jan 2003 20:54:44 +0900 mew (1:3.1.50-999.1tats) unstable; urgency=low * New upstream release. * debian/dirs: usr/share/doc -> usr/share/doc/mew. * debian/rules: Install old changelog files. * debian/rules: Delete redundant operations. * Add ssh and openssl to `Suggests'. * Standards-Version: 3.5.8 -- Tatsuya Kinoshita Wed, 25 Dec 2002 00:05:27 +0900 mew (1:3.1-1) unstable; urgency=low * New upstream Official release, closes: Bug#164100, Bug#165288 -- NOSHIRO Shigeo Tue, 3 Dec 2002 13:51:02 +0900 mew (1:3.0.73+3.1rc2-1) unstable; urgency=low * New upstream release * adopt policy 3.5.7 -- NOSHIRO Shigeo Tue, 26 Nov 2002 01:24:44 +0900 mew (1:3.0.73+3.1rc1-1) unstable; urgency=low * New upstream release -- NOSHIRO Shigeo Sun, 3 Nov 2002 03:30:58 +0900 mew (1:3.0.73-1) unstable; urgency=low * New upstream release -- NOSHIRO Shigeo Fri, 1 Nov 2002 03:51:53 +0900 mew (1:3.0.72-1) unstable; urgency=low * New upstream release -- NOSHIRO Shigeo Tue, 29 Oct 2002 12:41:03 +0900 mew (1:3.0.71-1) unstable; urgency=low * New upstream release -- NOSHIRO Shigeo Thu, 24 Oct 2002 19:07:43 +0900 mew (1:3.0.70-1) unstable; urgency=low * New upstream release -- NOSHIRO Shigeo Sat, 19 Oct 2002 22:57:16 +0900 mew (1:3.0.68-1) unstable; urgency=low * New upstream release -- NOSHIRO Shigeo Wed, 9 Oct 2002 14:22:51 +0900 mew (1:3.0.67-1) unstable; urgency=low * New upstream release -- NOSHIRO Shigeo Tue, 1 Oct 2002 16:57:46 +0900 mew (1:3.0.65-1) unstable; urgency=low * New upstream release * debian/emacsen-startup: Add (setq mew-prog-uncompface "uncompface") -- NOSHIRO Shigeo Thu, 29 Aug 2002 15:06:22 +0900 mew (1:3.0.63-1) unstable; urgency=low * New upstream release. This is one of beta releases of Mew 3.1. * debian/control: mew: Update Description. * debian/control: mew: Add imap-client and news-reader to Provides. * debian/control: mew: Depends: mew-bin (>= 1:3.0.61). * debian/control: mew-bin: Conflicts: mew (<< 1:3.0.61). * debian/info: Add `mew.info-4'. * debian/examples: Add `mew.dot.mew'. * debian/emacsen-startup: Add the mew-x-face-filter configuration and remove unnecessary lines. * debian/rules: Prevent an error of the `clean' target. -- NOSHIRO Shigeo Wed, 21 Aug 2002 00:03:57 +0900 mew (1:2.2-7) unstable; urgency=low * FIX policy violation of changelog, typos in copyright, etc. Thanks for Tatsuya Kinoshita. closes: Bug#154697 -- NOSHIRO Shigeo Thu, 15 Aug 2002 17:20:14 +0900 mew (1:2.2-6) unstable; urgency=low * reopen FIX mew does not remove cleanly, closes: Bug#152028 -- NOSHIRO Shigeo Sat, 6 Jul 2002 13:02:07 +0900 mew (1:2.2-5) unstable; urgency=low * FIX mew does not remove cleanly and Add to Suggests, Thanks for Tatsuya Kinoshita. closes: Bug#152028, Bug#150432 -- NOSHIRO Shigeo Sat, 6 Jul 2002 03:05:32 +0900 mew (1:2.2-4) unstable; urgency=low * Add to Depends (xemacs21-gnome-mule-canna-wnn | xemacs21-gnome-mule) -- NOSHIRO Shigeo Thu, 9 May 2002 14:12:51 +0900 mew (1:2.2-3) unstable; urgency=low * FIX debian/emacs-startup (setq mew-icon-directory), closes: Bug#142302 -- NOSHIRO Shigeo Thu, 11 Apr 2002 17:52:53 +0900 mew (1:2.2-2) unstable; urgency=low * FIX rules file contains bashism, closes: Bug#138235 -- NOSHIRO Shigeo Sun, 24 Mar 2002 13:13:38 +0900 mew (1:2.2-1) unstable; urgency=low * New upstream release. (Official Release version) * Corrected emacs-install,emacs-remove,emacs-startup. -- NOSHIRO Shigeo Tue, 26 Feb 2002 09:28:49 +0900 mew (1:2.1.52+2.2rc4-1) unstable; urgency=low * New upstream release -- NOSHIRO Shigeo Thu, 21 Feb 2002 16:19:36 +0900 mew (1:2.1.52+2.2rc3-2) unstable; urgency=low * FIX wrong Conflicts in control, closes: Bug#124078 -- NOSHIRO Shigeo Thu, 14 Feb 2002 14:50:21 +0900 mew (1:2.1.52+2.2rc3-1) unstable; urgency=low * New upstream release * FIX hangs when viewing PGP message, closes: Bug#106188 * A patch for README.Debian, closes: Bug#106638, Bug#125129 * pixmaps move from /usr/X11R6/include/X11/pixmaps to /usr/share/pixmaps/mew, closes: Bug#126060 -- NOSHIRO Shigeo Wed, 13 Feb 2002 19:22:52 +0900 mew (1:2.1.52+2.2rc2-2) unstable; urgency=low * New upstream release -- Akira TAGOH Sat, 19 Jan 2002 18:12:50 +0900 mew (1:2.1.52-2) unstable; urgency=low * FIX Oops typo in emacs-install. -- NOSHIRO Shigeo Fri, 14 Dec 2001 08:57:16 +0900 mew (1:2.1.52-1) unstable; urgency=low * New upstream Version. * Typo FIX Description. * FIX Installation fails xemacs21-nomule, closes: Bug#119049 -- NOSHIRO Shigeo Wed, 12 Dec 2001 09:50:38 +0900 mew (1:2.1.0-1) unstable; urgency=low * New upstream Version. (Official Release version) , closes: Bug#116325 -- NOSHIRO Shigeo Fri, 2 Nov 2001 14:42:56 +0900 mew (1:2.0.60-2) unstable; urgency=low * Add Depends: emacs21, closes: Bug#116725 -- NOSHIRO Shigeo Mon, 29 Oct 2001 14:30:01 +0900 mew (1:2.0.60-1) unstable; urgency=low * New upstream Version. * Use the "--decrypt" option instead of "--verify" for GnuPG. closes: Bug#106188, Bug#106502 -- NOSHIRO Shigeo Tue, 16 Oct 2001 11:05:35 +0900 mew (1:2.0.56-1) unstable; urgency=low * New upstream Version. * FIX Build-Depends: debhelper (>> 3.0.0), closes: Bug#113247 * FIX Support UIDL pop3 server, closes: Bug#114272, Bug#114273 -- NOSHIRO Shigeo Thu, 4 Oct 2001 09:40:47 +0900 mew (1:2.0.55-1) unstable; urgency=low * New upstream Version. -- NOSHIRO Shigeo Mon, 1 Oct 2001 17:13:28 +0900 mew (1:2.0.54-1) unstable; urgency=low * New upstream Version (Please read 00changes) * FIX featurep 'emacs21, closes: Bug#106664 -- NOSHIRO Shigeo Sun, 23 Sep 2001 19:01:52 +0900 mew (1:2.0.50-1) unstable; urgency=low * New upstream Version * FIX featurep 'emacs21, closes: Bug#106564 * reopen fix. FIX mew in postinst is too noisy, closes: Bug#106569 * change mew-x-face-prog (xv -> see), closes: Bug#107570 * add Suggests: fetchmail, procmail -- NOSHIRO Shigeo Fri, 17 Aug 2001 17:54:02 +0900 mew (1:2.0-1) unstable; urgency=low * New upstream Version * FIX mew in postinst is too noisy, closes: Bug#106569 * remove featurep 'emacs21, closes: Bug#106664 -- NOSHIRO Shigeo Sun, 29 Jul 2001 19:37:53 +0900 mew (1:2+0pre4-1) unstable; urgency=low * New Pre-Release version. -- NOSHIRO Shigeo Mon, 23 Jul 2001 20:48:22 +0900 mew (1:2+0pre1-1) unstable; urgency=low * New Maintainer * New Pre-Release version. * This bug is fixed in mew1.95beta, closes: #103570 -- NOSHIRO Shigeo Thu, 12 Jul 2001 10:53:21 +0900 mew (1:1.94.2-7) unstable; urgency=low * fix eeyes execution problem, closes: Bug#100479 -- ISHIKAWA Mutsumi Fri, 15 Jun 2001 16:29:45 +0900 mew (1:1.94.2-6) unstable; urgency=low * typo fix in control, closes: #91876 -- ISHIKAWA Mutsumi Tue, 27 Mar 2001 21:16:37 +0900 mew (1:1.94.2-5) unstable; urgency=low * pixmaps move from /usr/X11R6/include/X11/pixmaps to /usr/share/pixmaps -- ISHIKAWA Mutsumi Thu, 15 Feb 2001 10:40:53 +0900 mew (1:1.94.2-4) unstable; urgency=low * change default values of external viewers not to user non-free programs (xv -> eeys, mpeg_play -> xmps, acroread -> ghostview), and add Suggests: these programs, closes: #66370 * add Build-Depends: debhelper. -- ISHIKAWA Mutsumi Mon, 23 Oct 2000 06:04:49 +0900 mew (1:1.94.2-3) unstable; urgency=low * rebuild with glibc 2.1.94 -- ISHIKAWA Mutsumi Fri, 29 Sep 2000 08:45:30 +0900 mew (1:1.94.2-2) stable unstable; urgency=low * fix the problem if set langage environment is non English (e.g LANG=ja_JP.eucJP), Mew freeze with gpg. Backport patches from Mew-1.95beta closes: Bug#71804 -- ISHIKAWA Mutsumi Mon, 18 Sep 2000 18:09:51 +0900 mew (1:1.94.2-1) unstable; urgency=low * New upstream Version -- ISHIKAWA Mutsumi Tue, 29 Feb 2000 13:26:29 +0900 mew (1:1.94.1-2) unstable; urgency=low * delete README.debian, closes: Bug#51481 * adopt policy 3.1.1.1 -- ISHIKAWA Mutsumi Mon, 3 Jan 2000 19:17:28 +0900 mew (1:1.94.1-1) unstable; urgency=low * New Upstream version -- ISHIKAWA Mutsumi Mon, 25 Oct 1999 13:40:52 +0900 mew (1:1.94-7) unstable; urgency=low * add setq mew-mail-domain-list as mail-host-address. * remove info files for XEmacs. -- ISHIKAWA Mutsumi Fri, 15 Oct 1999 11:18:09 +0900 mew (1:1.94-6) unstable; urgency=low * change from (eq debian-emacs-flavor 'xemacs20) to (featurep 'xemacs) to decide XEmacs or not in mew-init.el. (for XEmacs21) -- ISHIKAWA Mutsumi Sun, 10 Oct 1999 03:35:17 +0900 mew (1:1.94-5) unstable; urgency=low * add EUC-JP info files for info command, closes: Bug#46226 * Ooops info files for XEmacs has not been included in previous version. Add it. * postinst and prerm install-info change to point from /usr/info to /usr/share/info -- ISHIKAWA Mutsumi Thu, 7 Oct 1999 20:57:44 +0900 mew (1:1.94-4) unstable; urgency=low * add some elisp lines in /etc/emacs/site-start.d/50mew.el from 00readme, Thanks for Ryuichi Arafune. closes: Bug#44722 -- ISHIKAWA Mutsumi Sat, 11 Sep 1999 21:59:13 +0900 mew (1:1.94-3) unstable; urgency=low * Oops typo in emacsen.install of 1.94-2, so can't install... fixed. -- ISHIKAWA Mutsumi Thu, 9 Sep 1999 04:48:53 +0000 mew (1:1.94-2) unstable; urgency=low * add mew-addrbook.el to byte compile in emacsen.install, closes: Bug#44637 -- ISHIKAWA Mutsumi Thu, 9 Sep 1999 04:40:17 +0000 mew (1:1.94-1) unstable; urgency=low * New upstream version, closes: Bug#44567 -- ISHIKAWA Mutsumi Wed, 8 Sep 1999 17:16:08 +0900 mew (1:1.93-4) unstable; urgency=low * adopt new perl policy -- ISHIKAWA Mutsumi Tue, 6 Jul 1999 00:23:38 +0900 mew (1:1.93-3) unstable; urgency=low * New Maintainer * add "install-info --quiet --remove /usr/info/mew.jisx.info" in prerm script and other "install-info --remove"s move from postrm to prerm (Bug#33554,Bugs#JP/904) -- ISHIKAWA Mutsumi Sat, 29 May 1999 11:39:42 +0900 mew (1:1.93-2) frozen unstable; urgency=low * Can't display Japanese Info file on XEmacs. Added new japanese info file for XEmacs. (#JP/703) * Output compile log to logfile. (#28157) * Checked with lintian 0.9.4 -- Yoshiaki Yanagihara Fri, 25 Dec 1998 20:08:27 +0900 mew (1:1.93-1) unstable; urgency=low * New upstream version (Official Release version) * Checked with lintian v0.8.1 -- Yoshiaki Yanagihara Mon, 7 Sep 1998 11:18:50 +0900 mew (1.93pre3-1) unstable; urgency=low * New Pre-Release version. * Checked with lintian v0.8.1 -- Yoshiaki Yanagihara Thu, 3 Sep 1998 09:35:27 +0900 mew (1.93pre2-1) unstable; urgency=low * New Pre-Release version. * Checked with lintian v0.8.1 -- Yoshiaki Yanagihara Tue, 1 Sep 1998 10:45:51 +0900 mew (1.93pre1-1) unstable; urgency=low * New Pre-Release version. * Changed COPYRIGHT. * Added to remove japanese info files in postrm. * Checked with lintian v0.7.5. -- Yoshiaki Yanagihara Tue, 25 Aug 1998 11:22:52 +0900 mew (1.93b56-1) unstable; urgency=low * New Beta Release version. * Checked with lintian v0.7.5. -- Yoshiaki Yanagihara Tue, 25 Aug 1998 10:02:52 +0900 mew (1.93b55-1) unstable; urgency=low * New Beta Release version. * Checked with lintian v0.7.5. -- Yoshiaki Yanagihara Thu, 20 Aug 1998 09:51:00 +0900 mew (1.93b54-1) unstable; urgency=low * New Beta Release version. * Checked with lintian v0.7.4. -- Yoshiaki Yanagihara Mon, 17 Aug 1998 14:44:34 +0900 mew (1.93b53-1) unstable; urgency=low * New Beta Release version. * Update Standard-Version 2.4.1.3. * Added perl to dependency package. * Passwd lintian check. -- Yoshiaki Yanagihara Thu, 13 Aug 1998 13:25:01 +0900 mew (1.93b52-1) unstable; urgency=low * New Beta Release version. * Passwd lintian check. * Change from 1.93b50 to 1.93b52: 1.93b52 (98/08/04) - Bug fix for mew-summary-convert-local-cs. - mew-mark-clean-up before mew-buffers-clean-up. - Bug fix for mew-summary-scroll-{up,down} - Small patch to mew-env.el. - Patch to mew-os2.el to get along with Mule 3. - Clean up mew-header.el. - Bug fix for mew-string<. - mew-config-clean-up was added to mew-summary-quit. 1.93b51 (98/08/01) - CDP: is used for the temporary file to pass an external program. - Ensuring overlay-arrow-{string,position} is buffer-local. - mew-local-variable-p again. - Defined mew-use-cursor-mark. - Deleted mew-folder-alist-reverse. Sort mew-folder-alist with mew-string< instead. - Define mew-lc-kana for non-Mule. - Tiny fix for mew-refile-guess-by-newsgroups. -- Yoshiaki Yanagihara Mon, 10 Aug 1998 15:27:32 +0900 mew (1.93b50-1) unstable; urgency=low * New Beta Release version. * Passwd lintian check. * Change from 1.93b49 to 1.93b50: - mew-prog-audio2 for Win. - Even unless MIME analysis, RFC 2047 header decoding is applied. - Cleaning up setup, clean-up, clear, and init functions. - Let "ma" not to mark multipart. - One more Bug fix for toolbar. - One more bug fix for mew-attach-audio. - Bug fix for join. -- Yoshiaki Yanagihara Thu, 30 Jul 1998 20:49:09 +0900 mew (1.93b49-1) unstable; urgency=low * New Beta Release version. * Passwd lintian check. * Change from 1.93b48 to 1.93b49: - Get along with XEmacs compiled with --without-toolbars. - If attachments are not valid, make single. - Yet another bug fix for mew-draft-header-keymap. - mew-summary-ls preserves preview marks if range is "all". Is this desired? - mew-summary-folder-cache-save deletes mew-decode-syntax if printed. - Clear decode-syntax markers if nothing is printed. - Bug fix for attach-audio. - Fix for message search for pick. - The scroll-up problem of forward is fixed. - The cursor position problem of forward is fixed. - The boundary problem of overlay is fixed. -- Yoshiaki Yanagihara Mon, 27 Jul 1998 10:43:33 +0900 mew (1.93b48-1) unstable; urgency=low * New Beta Release version. * Passwd lintian check. * Change from 1.93b46 to 1.93b48: 1.93b48 (98/07/18) - widen for mew-summary-folder-cache-save. - Set inhibit-read-only to t in draft-undo. - Bug fix for CD: encoding. - Specify cs-draft for make-backup and undo. - Typo fix for mew-addrstr-parse-address. - rear-nonsticky for header separator. - Bug fix for read-only header separator when undo. - Only parameter value can be quoted. - Define mew-header-sanity-check. - Header encoding now gets along with Emacs 20.2. - Add mew-mule.el to Makefile. 1.93b47 (98/07/16) - Define mew-aref and mew-charlen to support all Mule versions. - s/redist/resend/g. - mew-addrstr-parse-syntax-list checks mew-header-max-depth. - Tiny fix for mew-summary-redist. - Make attachments read-only. - mew-summary-save sets file to nil if the charset of filename is unknown. - mew-charset-sanity-check is defined. - New RFC 2047 header encoding. - Make mew-gnus.el synchronized with mew-header.el. -- Yoshiaki Yanagihara Wed, 22 Jul 1998 09:54:43 +0900 mew (1.93b46-1) unstable; urgency=low * New Beta Release version. * Passwd lintian check. * Fixed "Provides" spell in debian/control. * Change from 1.93b45 to 1.93b46: - Fixes of draft toolbar. - mew-syntax-number bug fix for XEmacs. - mew-draft-mode-map inherits mew-draft-body-map if mew-use-overlay-keymap is t. - Corporate with Emacs which returns mule-version of 4. - mew-attach-undo clears decrypters. - Defined mew-summary-clear-end-of. - Bug fix of mew-end-of-* for mew-summary-insert. - mew-header.el is drastically modified. - Integrated mew-split, mew-header-split, mew-split-number. - s/equal/mew-case-equal/g if necessary. - s/string-equal/string=/g. - Added missing options for search-forward. - Make (setq mew-use-overlay-keymap nil) work on Emacs 19.34. - Mark patch for mew-gnus.el. -- Yoshiaki Yanagihara Tue, 14 Jul 1998 09:17:52 +0900 mew (1.93b45-1) unstable; urgency=low * New Beta Release version. * Passwd lintian check. * Change from 1.93b44 to 1.93b45: - Two bug fixes for mew-ext.el. - mew-draft-keyswitch is back. - mew-draft-show-attach deletes only glyph extents. - mew-pgp-verify-check checks if the signature is supported or not. - mew-pgp-verify-check bug fix. - Don't assign mew-attach-dummy for C-u. - Keymap of attachments also uses overlay. - Bug fix for mew-highlight-body. -- Yoshiaki Yanagihara Mon, 6 Jul 1998 19:19:52 +0900 mew (1.93b44-1) unstable; urgency=low * New Beta Release version. * Change from 1.93b38 to 1.93b44: o 1.93b44 (98/07/02) - Obsolete mew-header-insert-value. Use mew-complete-insert instead to use right colors. - mew-message-set-end-of now sees if extents exist. - Separated mew-summary-display-part to mew-mime-part so that mew-end-of-* are displayed correctly. - Obsoleted mew-message-citation. Use marker instead. - Changed convention of marker naming. - s/jepg/jpeg/g. - Replaced defun with defmacro in mew-mule*.el. - Make mew-cs-post-conv safer. o 1.93b43 (98/07/01) - Mew now takes care of composite character set like tis620!! - Define mew-header-insert-value. - mew-refile-guess-by-folder is now customizable by mew-refile-guess-key-list. - Check if mew-buffer-hello exists when kills it. - widen when replys. - widen when inserts end-of-*. o 1.93b42 (98/06/30) - Bug fix for local-map of draft header. - Bug fix for end-of-*. - Define mew-frame-id to make unique string independent on frame-title-format. - Add an optional argment to mew-draft-{yank,cite} to cooperate with xcite.el. - Syntax fixes for mew-mule0.el. - A patch for mew-summary-virtual. o 1.93b41 (98/06/26) - Use overlay-arrow-string for mew-end-of-message-string and mew-end-of-part-string. - mew-draft-keyswitch is now obsoleted. Use the 'local-key property instead. - Use set-window-start to the header and attachments visible. - Bug fixes for the header separator. - Marker bug fixes. - Bug fix for header separator of reedit. - Deleting the variables to prevent warning due to many side effects, sigh. o 1.93b40 (98/06/24) - Use PNG for opening instead of XPM. - Use valid-image-instantiator-format-p instead of featurep. - Defined mew-summary-reply-position and mew-summary-reply-with-citation-position. - Marker stuff was brushed up. - mew-summary-reply-with-citation sets disp-msg on anyway. - mew-draft-cite and mew-summary-reply select a buffer from where header info is retrieved in the following order: (1) Message buffer if header exists (2) Cache buffer if exists. Typing "a" on a part (not on a message) means replying to the part(e.g. message/rfc822). So, prefix argument of mew-summary-reply was removed. - mew-current-{get,set} is now frame-local. - Bug fix for insert. - mew-summary-goto-folder takes care of virtual folders. - TIS(Thai) 620 support. - mew-summary-join was back. o 1.93b39 (98/06/11) - Commands for Summary and Virtual mode were drastically re-written with new macros. * Passwd lintian check. -- Yoshiaki Yanagihara Fri, 3 Jul 1998 13:53:43 +0900 mew (1.93b38-1) unstable; urgency=low * New Beta Release version. * Change from 1.93b37 to 1.93b38: - Obsoleted mew-use-pgp5. PGP version is automatically detected. - mew-summary-save use the filename parameter of CDP: even if "inline". - Defined mew-end-of-message-string and mew-end-of-part-string. Obsoleted mew-eof-string. - Key assignment of mew-summary-exchange-point was changed from "C-xC-x" to "C-cC-b". - New mew-win32.el. - Bug fix of "n" when the cursor locates in the middle of a line. -- Yoshiaki Yanagihara Tue, 9 Jun 1998 10:29:32 +0900 mew (1.93b37-1) unstable; urgency=low * New Beta Release version. * Changes mew 1.93b33 to 1.93b37: o 1.93b37 - Defined mew-pick-canonicalize-pattern. - Refine unfolding of mew-header-decode-region. - Bug fix of mew-update-range. - Patches for X-Face: and mew-os2.el. - C-uC-cC-l asks coding-system. - Old replace-match doesn't support string, sigh. - A patch to mew-xface-mule.el - mew-header-decode-region unfolds folded lines. o 1.93b36 - Remove all illegal characters in decoded string if exist. - PGP key server is changed from ICAT to JPNIC. - Bug fix for other fields. - Default value of mew-folder-list-skip-pattern is changed. o 1.93b35 - An error message is displayed unless mew-prog decode exists. - Regexs in mew-field-spec were fixed. - mew-highlight-header-region bug fix. - When the file which Mew believe doesn't exit unfortunately exists (probably because of NFS bugs), Mew asks you to input a message number instead of causing an error. - Some of mew-input-* calls mew-decode-syntax-delete after its retern value is fixed. - mew-summary-display-message deletes extents as mew-summary-display-part does. - mew-prog-xxx is dynamically evaluated to get along with window-system which has different value for each frame. - mew-header-decode-address and mew-header-decode-text were integrated into mew-header-decode-region. - A patch for mew-input-sort-key. o 1.93b34 - Removed mew-rfc822-field. See mew-address-fields. - visible/invisible and header-highlight is integrated. See mew-field-spec. This makes mew-header-arrange much faster. - mew-ask-subject works when C-cC-m is typed. - Required faces.el only if window-system. This pacifies the "void: frame-face-alist" error. - Fixed "mo". - Use mew-make-directory instead of make-directory to prevent an error if Mail doesn't exist. - Deleted mew-folder-list-use-file-attributes. If mew-folder-list-skip-pattern is nil. use link count. The default value mew-folder-list-skip-pattern is nil. For Win95, "^[0-9]+" is set. - Made messages in Massage more safer. - Header arrange. - Deleted mew-member-del. - Input functions were integrated. Completion functions were also integrated:: pick pattern, folder, folders, address, address2, rfile, sort. - Specify Content-ID: instead of Message-ID: for external-body. - Ignore quoted-strings during MIME header decoding. - The value of mew-keyval was changed to prevent mismatching errors. -- Yoshiaki Yanagihara Wed, 3 Jun 1998 20:29:47 +0900 mew (1.93b33-1) frozen unstable; urgency=low * New Beta Release version. * Changes mew 1.93b32 to 1.93b33: - C-cC-f tries fetching a public key with the From: field unless the X-Mew: field exists. - Logic change for CD: and CDP: The default value is decided as follows: (1) If its value exists, use it. (2) If not exist, use its file name. (3) If its file name does not exist, use "". - Some fixes for mew-draft-prepare-attachments. - Specified "=" in addition to "+" for folder completion. - Updated menubars and mode descriptions. - Brushed up PGP key fetch. - Fixed range of sort-region. - Brush up the message when attachments were deleted. - The window of completion candidates scrolls up when TAB is typed repeatedly. - Small fixes for Makefile. -- Yoshiaki Yanagihara Thu, 14 May 1998 10:44:55 +0900 mew (1.93b32-1) frozen unstable; urgency=low * New Beta Release version. * Changes mew 1.93b31 to 1.93b32: - mew-draft-make-mime -> mew-draft-make-message. - The old IM Config variables were cleaned up. The new variables are: mew-config-guess-alist mew-config-insert-when-prepared mew-config-insert-when-composed If you want the old feature of mew-config, set (setq mew-config-guess-alist '((nil . value))). - Set mark the original position when Config: is inserted. - C-uC-cC-c preserves a multi-part draft and doesn't remove the files under +draft/mime for undo. - Added "install-info" to Makefile - Ah-hoc Emacs 20.2.9x support. -- Yoshiaki Yanagihara Tue, 12 May 1998 10:38:01 +0900 mew (1.93b31-1) frozen unstable; urgency=low * New Beta Release version. * Changes mew 1.93b30 to 1.93b31: - Refine Makefile. - Delete files when error occurs in Multipart/Encrypted and Multipart/Signed. - More ad-hoc support for PGP 5. - file-writable-p returns t even if the file doesn't exist. Ugh! Added file-exists-p. - mew-summary-scan-filter bug fix. - Defined mew-ask-pack. - mew-auto-add-content-type -> mew-ack-send (negated) -- Yoshiaki Yanagihara Mon, 11 May 1998 10:14:55 +0900 mew (1.93b30-1) frozen unstable; urgency=low * mew 1.93 is Beta released now. * New upstream source version (Mew 1.93 Beta30). - mew-message-goto-summary displays the "No Summary mode" message if the corresponding Summary mode doesn't exist. - All functions for circular completion now have the prefix mew-circular-complete. - If mew-summary-buffer-disp-msg is nil, "A" displays the "Type v first" message. - If MIME decoding is quitted by C-g, its cache is removed. - Made mew-summary-scroll-{up,down} symmetric. - New mew-ext-url. - Defined mew-pick-default-field. - Got rid of insert-before-markers from the scan filter so that the side-effect to mew-summary-buffer-end is resolved. Now mew-decode-syntax-delete is safe even if the final message is multipart. - Defined error messages in mew-vars.el. - Mew now incorporates with XEmacs without the --with-mule option. - PNG support. - bug fix for PGP error report. - CDP: patch for "F" in attachments. -- Yoshiaki Yanagihara Thu, 7 May 1998 09:46:53 +0900 mew (1.93b29-1) frozen unstable; urgency=low * mew 1.93 is Beta released now. * New upstream source version (Mew 1.93 Beta29). - Made mew-complete-window-config buffer-local to make completion safer against multiple draft buffer. - Explicitly notify unknown PGP micalg. - Made mew-summary-prog-exec safer for OS/2. - mew-save-dir for uudecode and unshar. - Clear jam-zcat-filename-list and jka-compr-compression-info-list in mew-flet and mew-frwlet. - CDP: is displayed as it is. Filename is displayed with "*" appended. - mew-encode-syntax-single fix. - Avoid inserting CDP: for signature. - Bug fix for missing subject when forwarding a forwarded message. - Bug fix for "A" in attachment. - mew-summary-toggle-analysis stays on the current message always. - Ignore charsets other than US-ASCII and ISO-8859-1 on bilingual Emacs. - Use substring if mew-substring is not bound. * Update standard-version to 2.4.1.0. -- Yoshiaki Yanagihara Wed, 6 May 1998 11:57:37 +0900 mew (1.93b28-1) frozen unstable; urgency=low * mew 1.93 is released for Beta-Test. * New upstream source version (Mew 1.93 Beta 28). - When compsing, CDP: is automatically set unless it matches mew-mime-content-type-ignore-cdp. Type just RET for 'N' to clear CDP:. - Set inhibit-quit to t in functions to enter Draft mode. - Pack now preserves the * mark. - Defined mew-pop-to-buffer to fix all bugs on XEmacs. - Integrated config valuables and functions. - Use copy instead link for signature attachment to protect the original signature file anyway. - gzip hack for OS/2. - mew-summary-toggle-disp-msg stays on the current message always. - Defined mew-string-width because string-width is not available on some Emacses. - save-excursion for mew-summary-mark-refile. - PGP fetch patch. - Info on sort. - XPM support. - Eliminated the "no messages" message when scan. - Made mew-input-{folder,folders} symmetric. - Made mew-summary-{next,prev}-page symmetric. - Call mew-highlight-{url,body} only in text/plain. - Set modes of Mail and News to mew-folder-mode when init. - Defined mew-folder-mode and mew-file-mode for privacy reasons. - Made folder operations safer. - mew-config-imget is displayed when incing if not default. * Add japanese info data. -- Yoshiaki Yanagihara Thu, 23 Apr 1998 10:08:58 +0900 mew (1.93b27-1) frozen unstable; urgency=low * mew 1.93 is released for Beta-Test. * New upstream source version (Mew 1.93 Beta 27). - mew-summary-config-imget. ("C" in Summary mode, anyway.) - Set mark the point in inbox before get so that we can get back to that position with C-xC-x. - mew-save-dir. - Set mew-use-highlight-x-face when refiling. - imget.sh and imls.sh. - imput.sh. - IMAP regex fix. - New mew-caesar.el * Installed contribute tools and files under /usr/doc/mew/examples. * Check with lintian. -- Yoshiaki Yanagihara Thu, 9 Apr 1998 16:01:52 +0900 mew (1.93b26-1) frozen unstable; urgency=low * I upload for Hamm because mew 1.93 is released for Beta-Test now. * New upstream source version (Mew 1.93 Beta 26). - MIME decoder and decode-syntax displayer was elegantly re-written. - guess" -> "us-ascii" when decoding. - Openp, again. - Defined mew-folder-list-function. * Check with lintian. -- Yoshiaki Yanagihara Tue, 31 Mar 1998 11:11:08 +0900 mew (1.93b25-2) frozen unstable; urgency=low * (control): Add one space for Item list of description. (Bug#20074) -- Yoshiaki Yanagihara Wed, 25 Mar 1998 11:45:00 +0900 mew (1.93b25-1) unstable; urgency=low * Frist Public Release. * New upstream source version (Mew 1.93 Beta 25). - Displaying filename when executing a program. - Bug fix for cursor position when "x". - An ad-hoc hack for left click on Draft mode. - A patch to support Mew.img and to make it safer. - Several patches for elisp impath. * Check with lintian. -- Yoshiaki Yanagihara Mon, 16 Mar 1998 01:07:48 +0900 mew (1.93b24-3) unstable; urgency=low * New files: Added icon files for xemacs. * (mew-init.el): Delete comment out of load-path. * (mew-init.el): Added elisp code to set mew-icon-directory. -- Yoshiaki Yanagihara Fri, 13 Mar 1998 19:38:34 +0900 mew (1.93b24-2) unstable; urgency=low * Standrard: debian-emacs-policy * New file: emacsen.install * New file: emacsen.remove * New file: prerm. * (dirs): added usr/lib/emacsen-common/packages/install added usr/lib/emacsen-common/packages/remove Changed usr/lib/emacs/site-lisp/mew to usr/share/emacs/site-lisp/mew * (control): Changed "Dependency": "mule|emacs" -> "emacsen". Now support emacs19 and emacs20, not Xemacs. * (control): provided "mail-reader" and "imap-client" (Bug#JP/220). * (mew-init.el): comment out load-path. * (mew-init.el): change installed filename 50mew-init.el to 50mew.el. -- Yoshiaki Yanagihara Thu, 12 Mar 1998 15:30:36 +0900 mew (1.93b24-1) unstable; urgency=low * New upstream source version (Mew 1.93 Beta 24). * Changes Beta23 to Beta24. - Elisp version of impath to list up folders. - Bug fix for mew-attach-duplicate. - Several patches including x-face, mew-os2.el, etc. - The first part is displayed with its header in Summary mode if it is text/plain. - A tiny patch for imjoin. * Check with lintian. -- Yoshiaki Yanagihara Wed, 11 Mar 1998 11:30:55 +0900 mew (1.93b23-1) hamm-jp; urgency=low * New upstream source version (Mew 1.93 Beta 23). * Changes Beta22 to Beta23 - IMAP is back. - set-buffer in addition to select-window. * Check with lintian. -- Yoshiaki Yanagihara Tue, 3 Mar 1998 13:27:42 +0900 mew (1.93b22-1) hamm-jp; urgency=low * New upstream source version (Mew 1.93 Beta 22). * Changes Beta21 to Beta22 - mew-{symbolic-,}link checks if the target file is a regular file. - Another terrible multipart bug of "f" was fixed. - Multiple frame problem on XEmacs was fixed. - Stupid completion bug fix. - Fixed icon problems in Draft mode on XEmacs. * Check with lintian. -- Yoshiaki Yanagihara Mon, 2 Mar 1998 10:53:40 +0900 mew (1.93b21-1) unstable; urgency=low * New upstream source version (Mew 1.93 Beta 21). * Change file mode of 50mew-init.el to 644. * Added undocumented manpage: mewcat.1 mewencode.1 mewdecode.1 uumerge.1 -- Yoshiaki Yanagihara Fri, 27 Feb 1998 09:56:55 +0900 mew (1.93b20-1) hamm-jp; urgency=low * New upstream source version (Mew 1.93 Beta 20). -- Yoshiaki Yanagihara Thu, 26 Feb 1998 19:13:16 +0900 mew (1.93b13-2) hamm-jp; urgency=low * Fixed Bug: Can't look info files. -- Yoshiaki Yanagihara Mon, 16 Feb 1998 18:18:05 +0900 mew (1.93b13-1) hamm-jp; urgency=low * New upstream source version (Mew 1.93 Beta 13). * Build with debhelper. -- Yoshiaki Yanagihara Thu, 12 Feb 1998 16:01:05 +0900 mew (1.93b11-1) hamm-jp; urgency=low * Mew 1.93 Beta Release Version. * Change maintainer e-mail address. * Build with debhelper. -- Yoshiaki Yanagihara Fri, 30 Jan 1998 12:51:32 +0900 mew (1.92-6) hamm-jp; urgency=low * Mew BugFixed Release. * Mew version is 1.92.4. * Applied the mew-1.92.3-1.92.4.patch.gz patch file. -- Yoshiaki Yanagihara Wed, 19 Nov 1997 09:56:39 +0900 mew (1.92-5) hamm-jp; urgency=low * Mew version is 1.92.3. * Applied the mew-1.92.2-1.92.3.patch.gz patch file. * mew-gnus.elc is being supported in this package. But, it will be removed when mew program support USENET news in the future. -- Yoshiaki Yanagihara Tue, 11 Nov 1997 12:54:04 +0900 mew (1.92-4) hamm-jp; urgency=low * Added mew-gnus.elc. -- Yoshiaki Yanagihara Mon, 10 Nov 1997 22:09:29 +0900 mew (1.92-3) hamm-jp; urgency=low * Mew version is 1.92.2. * Applied the mew-1.92.1-1.92.2.patch.gz patch file. -- Yoshiaki Yanagihara Mon, 10 Nov 1997 12:43:42 +0900 mew (1.92-2) hamm-jp; urgency=low * Mew version is 1.92.1. * Applied the mew-1.92-1.92.1.patch.gz patch file. -- Yoshiaki Yanagihara Wed, 29 Oct 1997 10:39:06 +0900 mew (1.92-1) hamm-jp; urgency=low * New upstream version. * Compiled with libc6. -- Yoshiaki Yanagihara Tue, 28 Oct 1997 12:50:16 +0900 mew (1.91-1) hamm-jp; urgency=low * New upstream version. * Libc5 version. -- Yoshiaki Yanagihara Thu, 25 Sep 1997 13:07:27 +0900 mew (1.90-1) hamm-jp; urgency=low * New upstream version. -- Yoshiaki Yanagihara Fri, 5 Sep 1997 15:01:54 +0900 mew (1.70-2) bo-jp hamm-jp; urgency=low * Added contributed .el files. * Added /etc/site-start.d/50mew.el file. -- Yoshiaki Yanagihara Sat, 16 Aug 1997 00:48:28 +0900 mew (1.70-1) unstable; urgency=low * New source version. * Changes: - Retrieve the body of Message/External-Body only if typing C-cC-e. - Many syntaxes are uniformed. - Pretty good regular expressions. - Summary mode now reports the reason when an error occurs. - Yet another bug fix for mew-attach-undo. - Catch up to XEmacs 20.1 b15. - Defined mew-subsequence. - mew-draft-keyswitch bug fix. SAKAI Kiyotaka . -- Yoshiaki Yanagihara Thu, 24 Apr 1997 19:52:10 +0900 mew (1.69-1) unstable; urgency=low * New source version. * Changes: - Add many explanations to variables and functions. - mew-mark-process-all-folders is set to kill-emacs-hook by default. REMOVE THIS CONFIGURATION FROM YOUR .EMACS. - Yet another mew-draft-keyswitch bug fix from SAKAI Kiyotaka . But his patch couldn't handle vector sequence. So I modified. - mew-attach-line bug fix. SAKAI Kiyotaka - A fix for mew-attach-undo fatal bug. It calls mew-syntax-clear-marks now. - "'" -> "function". -- Yoshiaki Yanagihara Thu, 3 Apr 1997 17:37:29 +0900 mew (1.68-1) unstable; urgency=low * New source version. -- Yoshiaki Yanagihara Mon, 31 Mar 1997 18:36:12 +0900 mew (1.67-1) unstable; urgency=low * New source version. -- Yoshiaki Yanagihara Thu, 27 Mar 1997 11:46:18 +0900 mew (1.55-3) unstable; urgency=low * Fixed Description Field in control file. -- Yoshiaki Yanagihara Thu, 13 Mar 1997 14:23:32 +0900 mew (1.55-2) unstable; urgency=low * Added mew.dot.emacs sample file. * Added patch files on /usr/doc/mew. * Change install directory: ..site-lisp/Mew -> ..site-lisp/mew -- Yoshiaki Yanagihara Thu, 13 Mar 1997 13:15:58 +0900 mew (1.55-1) unstable; urgency=low * New source version. -- Yoshiaki Yanagihara Tue, 11 Mar 1997 14:17:32 +0900 mew (1.54-1) unstable; urgency=low * Initial Release (for Debian-JP project member). * Applied first patch. -- Yoshiaki Yanagihara Tue, 3 Dec 1996 00:55:53 +0900 debian/mewstunnel.10000644000000000000000000000164612142204752011457 0ustar .\" Author: Tatsuya Kinoshita .\" Created: 31 Jan 2005 .\" .\" Copyright (c) 2005-2011 Tatsuya Kinoshita .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted without restriction, with NO WARRANTY. .TH MEWSTUNNEL 1 "October 19, 2011" .SH NAME mewstunnel - stunnel wrapper for Mew .\" .SH SYNOPSIS mewstunnel .RI [ options ] .\" .SH DESCRIPTION The .B mewstunnel utility is a wrapper script for using stunnel. This command is necessary for the mew-ssl feature to keep a process of stunnel. The options are for stunnel4 or stunnel. If stunnel4 is installed, it is executed. If stunnel4 is not installed, stunnel is executed. If the MEW_PROG_STUNNEL environment variable is set, it is executed instead. .\" .SH BUGS This command is provided by Debian. This command is not integrated in the upstream source. .\" .SH SEE ALSO .BR stunnel4 (8), .BR stunnel (8) .\"