22
|
1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
2 ;;
|
|
3 ;; File: dired-xy.el
|
116
|
4 ;; Dired Version: #Revision: 7.9 $
|
22
|
5 ;; RCS:
|
|
6 ;; Description: Commands for reading mail from dired.
|
|
7 ;;
|
|
8 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
9
|
|
10 ;;; Requirements and provisions
|
|
11 (provide 'dired-xy)
|
|
12 (require 'dired)
|
|
13
|
|
14 ;;; Special request: Will an mh-e user please write some mh support in here?
|
|
15
|
|
16 (defun dired-read-mail (&optional arg)
|
|
17 "Reads the current file as a mail folder.
|
|
18 Uses the setting of `dired-mail-reader' to determine which reader to use.
|
|
19 Possibilities are VM or RMAIL. With a prefix arg, visits the folder read-only\;
|
|
20 this only works with VM."
|
|
21 (interactive "P")
|
|
22 (cond
|
|
23 ((eq dired-mail-reader 'vm)
|
|
24 (dired-vm arg))
|
|
25 ((eq dired-mail-reader 'rmail)
|
|
26 (dired-rmail)) ; doesn't take read-only arg.
|
|
27 (t (error "Never heard of the mail reader %s" dired-mail-reader))))
|
|
28
|
|
29 ;; Read-only folders only work in VM 5, not in VM 4.
|
|
30 (defun dired-vm (&optional read-only)
|
|
31 "Run VM on this file.
|
|
32 With prefix arg, visit folder read-only (this requires at least VM 5).
|
|
33 See also variable `dired-vm-read-only-folders'."
|
|
34 (interactive "P")
|
|
35 (let ((dir (dired-current-directory))
|
|
36 (fil (dired-get-filename)))
|
|
37 ;; take care to supply 2nd arg only if requested - may still run VM 4!
|
|
38 (require 'vm) ; vm-visit-folder may not be an autoload
|
|
39 (setq this-command 'vm-visit-folder) ; for vm window config
|
|
40 (if read-only
|
|
41 (vm-visit-folder fil t)
|
|
42 (vm-visit-folder fil))
|
|
43 ;; so that pressing `v' inside VM does prompt within current directory:
|
|
44 (set (make-local-variable 'vm-folder-directory) dir)))
|
|
45
|
|
46 (defun dired-rmail ()
|
|
47 "Run RMAIL on this file."
|
|
48 (interactive)
|
|
49 (rmail (dired-get-filename)))
|
|
50
|
|
51 ;; end of dired-xy.el
|
|
52
|