Newsgroups: fj.editor.emacs
Path: galaxy.trc.rwcp.or.jp!jaist-news!cs.titech!nirvana.cs.titech!wnoc-tyo-news!news.u-tokyo.ac.jp!news.tisn.ad.jp!s.u-tokyo!kuis!kurims!hattori
From: hattori@kurims.kyoto-u.ac.jp (Takashi Hattori)
Subject: VM thread utility
Message-ID: <HATTORI.93Dec10201520@tanpopo.kurims.kyoto-u.ac.jp>
Lines: 53
Sender: news@kurims.kurims.kyoto-u.ac.jp
Nntp-Posting-Host: tanpopo
Organization: Research Institute for Mathematical Sciences, Kyoto, Japan.
Distribution: fj
Date: Fri, 10 Dec 1993 11:15:19 GMT
Xref: galaxy.trc.rwcp.or.jp fj.editor.emacs:4273
X-originally-archived-at: http://galaxy.rwcp.or.jp/text/cgi-bin/newsarticle2?ng=fj.editor.emacs&nb=4273&hd=a
X-reformat-date: Mon, 18 Oct 2004 15:18:22 +0900
X-reformat-comment: Tabs were expanded into 4 column tabstops by the Galaxy's archiver. See http://katsu.watanabe.name/ancientfj/galaxy-format.html for more info.

$BI~It!w5~Bg$G$9!#(B

$B$$$D$b(B vm-thread $B$rM-Fq$/;H$o$;$F$b$i$C$F$^$9!#(Bvm-thread.el $B$NCf$rGA$$(B
$B$F!"<!$N$h$&$J4X?t$r$G$C$A$"$2$F$_$^$7$?$N$G!"0lEY$*;n$72<$5$$!#(B

  y    $BF1$8?F$r;}$D<!$N%a%C%;!<%8$X9T$/(B
  M t  $B8=:_$N%a%C%;!<%8$H$=$N;RB9$K%^!<%/$r$D$1$k(B
$B!J(Bthread-reading mode $B$N;~$N$_!K(B

VM5.35W VM-thread 1.02 $B$GF0:n$7$^$9!#(B

$BI~It!w?t8&!%5~Bg(B

----------------------------------------------------------------------
(defun vm-find-sibling-message ()
  "Search the first sibling message of the current message"
  (interactive)
  (vm-select-folder-buffer)
  (vm-check-for-killed-summary)
  (vm-error-if-folder-empty)
  (let ((rest (cdr (memq (car vm-message-pointer) vm-message-list)))
(id (vm-parent-id-of (car vm-message-pointer)))
m-id)
    (if (null id)
(message "This is a root message.")
      (while (and rest
  (not (and
(setq m-id (vm-parent-id-of (car rest)))
(string-match m-id id))))
(setq rest (cdr rest)))
      (if rest
  (vm-goto-message (string-to-int (vm-number-of (car rest))))
(message "No more sibling messages.")))))

(defun vm-mark-thread ()
  "Mark all descendant messages."
  (interactive)
  (vm-select-folder-buffer)
  (vm-check-for-killed-summary)
  (vm-error-if-folder-empty)
  (if (not vm-show-threads)
      (error "Not in threaded-reading mode."))
  (let ((rest (cdr (memq (car vm-message-pointer) vm-message-list)))
(depth (vm-depth-of (car vm-message-pointer)))
(count 1))
    (while (and rest
(< depth (vm-depth-of (car rest))))
      (setq count (1+ count)
    rest (cdr rest)))
    (vm-mark-message count)))

(define-key vm-mode-map "y" 'vm-find-sibling-message)
(define-key vm-mode-map "Mt" 'vm-mark-thread)
