[mew-dist 25414] Re: unread-mark

Hideyuki SHIRAI ( 白井秀行 ) shirai at example.com
2004年 10月 6日 (水) 16:18:36 JST


マークにはうるさい白井です。

From: Masamichi HOSODA <trueroad at example.com> さん曰く
Subject: [mew-dist 25408] Re: unread-mark
Message-ID: <20041006.151728.60851533.trueroad at example.com>
Date: Wed, 06 Oct 2004 15:17:28 +0900 (JST)

> 未読メールに対して一括でなにか操作するために、
> `U' -> `*' の変換ができるとうれしいと思います。

これやるなら「任意の mark から任意の mark に変換」というのがいい
な。

以下、雛形。昔作ったのだけど、今も動くかどうか不明。

(define-key mew-summary-mode-map "me" 'mew-summary-mark-exchange)

(defun mew-summary-mark-exchange (&optional oldmark newmark)
  "Exchange the 'old mark' into the 'new mark'."
  (interactive)
  (let ((ociea cursor-in-echo-area))
    (if (null oldmark)
        (unwind-protect
            (progn
              (message "Old mark : ")
              (setq cursor-in-echo-area t)
              (setq oldmark (read-char-exclusive))
              (message "Old mark : '%s' to New mark : " (char-to-string oldmark)))
          (setq cursor-in-echo-area ociea)))
    (if (not (or (mew-markdb-by-mark oldmark) (eq oldmark ? )))
        (message "Old mark '%s' is not supported." (char-to-string oldmark))
      (if (null newmark)
          (unwind-protect
              (progn
                (setq cursor-in-echo-area t)
                (setq newmark (read-char-exclusive))
                (message "Old mark : '%s' to New mark : '%s'..."
                         (char-to-string oldmark) (char-to-string newmark)))
            (setq cursor-in-echo-area ociea)))
      (if (not (or (mew-markdb-by-mark newmark) (eq newmark ? )))
          (message "New mark '%s' is not supported." (char-to-string newmark))
        (if (eq oldmark newmark)
            (message "Same mark: '%s' ." (char-to-string newmark))
          (if (eq oldmark mew-mark-refile)
              (let ((cfld (current-buffer)) fldmsgs fld msg)
		(mew-sinfo-set-refile nil)
                (if (mew-virtual-p)
                    (save-excursion
                      (setq fldmsgs (mew-summary-mark-collect2 mew-mark-refile))
                      (while fldmsgs
                        (setq fld (car (car fldmsgs)))
                        (setq msg (cdr (car fldmsgs)))
                        (when (setq fld (get-buffer fld))
			  (let (sinfo)
			    (set-buffer fld)
			    (setq sinfo (mew-sinfo-get-refile))
			    (setq sinfo (delete (assoc msg sinfo) sinfo))
			    (mew-sinfo-set-refile sinfo)))
                        (setq fldmsgs (cdr fldmsgs)))))))
          (if (eq newmark mew-mark-refile)
              (let ((mew-regex-msg-review (mew-mark-regex oldmark)))
                (mew-summary-mark-refile))
            (when (eq newmark ? )
              (save-excursion
                (let ((regex (mew-mark-regex oldmark)))
                  (goto-char (point-min))
                  (mew-elet
                   (while (re-search-forward regex nil t)
                     (mew-highlight-unmark-line)
                     (forward-line))))))
            (mew-summary-exchange-mark oldmark newmark))
          (message "Old mark : '%s' to New mark : '%s'...done"
                   (char-to-string oldmark) (char-to-string newmark)))))))



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