annotate lisp/efs/dired-xy.el @ 42:8b8b7f3559a2 r19-15b104

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