[mew-dist 26297] `i' in remote folder

Shun-ichi TAHARA ( 田原 俊一 ) jado at example.com
2005年 5月 17日 (火) 11:30:28 JST


IMAPな生活でも、やはりついつい i を押してしまいます。

case で use-retrieve を nil にしておけば事故は起きないのですが、身に染
み付いた癖はそうそう抜けないことと、タスクバーにある "check" をつつき
たくなる誘惑には抗いがたいということで、こんなのをでっち上げてみました。

require すると、i (mew-summary-retrieve) がちょっと拡張されます。

・リモートフォルダ上では、そのプロトコルの inbox に飛んで s update
  (%hogehoge → %inbox で s update)

・(setq mew-visit-inbox-before-retrieve t) とすると、i を押したときに
  まず現在の case での inbox に移動するようになる
  (mew-visit-inbox-after-setting-case を t にして C したときと同様)
_______________________________
田原 俊一   jado at example.com, shunichi_tahara at example.com
                                  http://flowernet.gr.jp/jado/
FingerPrint:  16 9E 70 3B 05 86 5D 08  B8 4C 47 3A E7 E9 8E D9
 ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄
-------------- next part --------------
;;; mew-remote-retrieve.el	-*-Emacs-Lisp-*-
;;;
;;; Time-stamp: <2005/05/13 13:47:14 jado at example.com>
;;;
;;; Commentary:
;;;  Do "s update" for "i" on remote folders.
;;;  How to use:
;;;   Require it when initialize.

;;; Code:

(provide 'mew-remote-retrieve)

;;;

(defvar mew-visit-inbox-before-retrieve nil
  "If *non-nil*, visit to an appropriate inbox before retrieve (or scan)
new messages.")

(defconst mew-summary-retrieve:force-scan-range nil)

(defadvice mew-input-range-remote (around mew-remote-retrieve activate)
  (if mew-summary-retrieve:force-scan-range nil ad-do-it))

(defun mew-case-proto-inbox-folder (proto case)
  (mew-case-folder case (mew-proto-inbox-folder proto case)))

(defadvice mew-summary-retrieve (around mew-remote-retrieve activate)
  "Do retrieve only on local folder, otherwise update.
If `mew-visit-inbox-before-retrieve' is *non-nil*, visit to an
appropriate inbox first."
  (mew-summary-only
   (when mew-visit-inbox-before-retrieve
     (mew-summary-visit-folder
      (mew-case-proto-inbox-folder nil mew-case-input)))
   (if (mew-folder-localp (mew-sinfo-get-folder))
       ad-do-it
     (unless mew-visit-inbox-before-retrieve
       (mew-summary-visit-folder
	(mew-case-proto-inbox-folder
	 (mew-sinfo-get-proto) (mew-sinfo-get-case))))
     (let ((mew-summary-retrieve:force-scan-range t))
       (call-interactively 'mew-summary-ls)))))

;;; Copyright Notice:

;; Copyright (C) 2005 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-remote-retrieve.el ends here


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