annotate lisp/gnus/gnus-dired.el @ 97350:f0689cd563e3

Merge from gnus--devo--0 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1372
author Miles Bader <miles@gnu.org>
date Thu, 07 Aug 2008 07:18:07 +0000
parents f42ef85caf91
children c041e66ce8eb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
1 ;;; gnus-dired.el --- utility functions where gnus and dired meet
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
2
64754
fafd692d1e40 Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 64085
diff changeset
3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004,
79708
1cb31606209f Add 2008 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 78224
diff changeset
4 ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
5
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
6 ;; Authors: Benjamin Rutt <brutt@bloomington.in.us>,
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
7 ;; Shenghuo Zhu <zsh@cs.rochester.edu>
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
8 ;; Keywords: mail, news, extensions
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
9
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
10 ;; This file is part of GNU Emacs.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
11
94662
f42ef85caf91 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
12 ;; GNU Emacs is free software: you can redistribute it and/or modify
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
13 ;; it under the terms of the GNU General Public License as published by
94662
f42ef85caf91 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
14 ;; the Free Software Foundation, either version 3 of the License, or
f42ef85caf91 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
15 ;; (at your option) any later version.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
16
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
17 ;; GNU Emacs is distributed in the hope that it will be useful,
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
20 ;; GNU General Public License for more details.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
21
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
94662
f42ef85caf91 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
24
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
25 ;;; Commentary:
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
26
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
27 ;; This package provides utility functions for intersections of gnus
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
28 ;; and dired. To enable the gnus-dired-mode minor mode which will
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
29 ;; have the effect of installing keybindings in dired-mode, place the
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
30 ;; following in your ~/.gnus:
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
31
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
32 ;; (require 'gnus-dired) ;, isn't needed due to autoload cookies
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
33 ;; (add-hook 'dired-mode-hook 'turn-on-gnus-dired-mode)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
34
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
35 ;; Note that if you visit dired buffers before your ~/.gnus file has
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
36 ;; been read, those dired buffers won't have the keybindings in
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
37 ;; effect. To get around that problem, you may want to add the above
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
38 ;; statements to your ~/.emacs instead.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
39
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
40 ;;; Code:
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
41
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
42 (require 'dired)
87097
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
43 (autoload 'mml-attach-file "mml")
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
44 (autoload 'mm-default-file-encoding "mm-decode");; Shift this to `mailcap.el'?
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
45 (autoload 'mailcap-extension-to-mime "mailcap")
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
46 (autoload 'mailcap-mime-info "mailcap")
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
47
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
48 ;; Maybe shift this function to `mailcap.el'?
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
49 (autoload 'mm-mailcap-command "mm-decode")
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
50
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
51 (autoload 'ps-print-preprint "ps-print")
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
52
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
53 ;; Autoloads to avoid byte-compiler warnings. These are used only if the user
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
54 ;; customizes `gnus-dired-mail-mode' to use Message and/or Gnus.
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
55 (autoload 'message-buffers "message")
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
56 (autoload 'gnus-setup-message "gnus-msg")
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
57 (autoload 'gnus-print-buffer "gnus-sum")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
58
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
59 (defvar gnus-dired-mode nil
87097
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
60 "Minor mode for intersections of MIME mail composition and dired.")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
61
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
62 (defvar gnus-dired-mode-map nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
63
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
64 (unless gnus-dired-mode-map
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
65 (setq gnus-dired-mode-map (make-sparse-keymap))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
66
87097
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
67 (define-key gnus-dired-mode-map "\C-c\C-m\C-a" 'gnus-dired-attach)
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
68 (define-key gnus-dired-mode-map "\C-c\C-m\C-l" 'gnus-dired-find-file-mailcap)
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
69 (define-key gnus-dired-mode-map "\C-c\C-m\C-p" 'gnus-dired-print))
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
70
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
71 ;; FIXME: Make it customizable, change the default to `mail-user-agent' when
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
72 ;; this file if renamed (e.g. to `dired-mime.el').
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
73
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
74 (defcustom gnus-dired-mail-mode 'gnus-user-agent ;; mail-user-agent
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
75 "Your preference for a mail composition package.
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
76 See `mail-user-agent' for more information."
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
77 :group 'mail ;; dired?
92336
5f827896103e Change defcustom :version from 23.0 to 23.1.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
78 :version "23.1" ;; No Gnus
87097
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
79 :type '(radio (function-item :tag "Default Emacs mail"
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
80 :format "%t\n"
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
81 sendmail-user-agent)
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
82 (function-item :tag "Emacs interface to MH"
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
83 :format "%t\n"
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
84 mh-e-user-agent)
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
85 (function-item :tag "Gnus Message package"
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
86 :format "%t\n"
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
87 message-user-agent)
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
88 (function-item :tag "Gnus Message with full Gnus features"
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
89 :format "%t\n"
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
90 gnus-user-agent)
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
91 (function :tag "Other")))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
92
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
93 (defun gnus-dired-mode (&optional arg)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
94 "Minor mode for intersections of gnus and dired.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
95
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
96 \\{gnus-dired-mode-map}"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
97 (interactive "P")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
98 (when (eq major-mode 'dired-mode)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
99 (set (make-local-variable 'gnus-dired-mode)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
100 (if (null arg) (not gnus-dired-mode)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
101 (> (prefix-numeric-value arg) 0)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
102 (when gnus-dired-mode
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
103 (add-minor-mode 'gnus-dired-mode "" gnus-dired-mode-map)
87097
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
104 (save-current-buffer
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
105 (run-hooks 'gnus-dired-mode-hook)))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
106
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
107 ;;;###autoload
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
108 (defun turn-on-gnus-dired-mode ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
109 "Convenience method to turn on gnus-dired-mode."
87097
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
110 (interactive)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
111 (gnus-dired-mode 1))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
112
87097
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
113 (defun gnus-dired-mail-buffers ()
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
114 "Return a list of active mail composition buffers."
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
115 (if (and (memq gnus-dired-mail-mode '(message-user-agent gnus-user-agent))
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
116 (require 'message)
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
117 (fboundp 'message-buffers))
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
118 (message-buffers)
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
119 ;; Cf. `message-buffers' in `message.el':
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
120 (let (buffers)
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
121 (save-excursion
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
122 (dolist (buffer (buffer-list t))
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
123 (set-buffer buffer)
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
124 (when (eq major-mode 'mail-mode)
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
125 (push (buffer-name buffer) buffers))))
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
126 (nreverse buffers))))
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
127
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
128 ;; Method to attach files to a mail composition.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
129 (defun gnus-dired-attach (files-to-attach)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
130 "Attach dired's marked files to a gnus message composition.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
131 If called non-interactively, FILES-TO-ATTACH should be a list of
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
132 filenames."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
133 (interactive
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
134 (list
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
135 (delq nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
136 (mapcar
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
137 ;; don't attach directories
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
138 (lambda (f) (if (file-directory-p f) nil f))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
139 (nreverse (dired-map-over-marks (dired-get-filename) nil))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
140 (let ((destination nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
141 (files-str nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
142 (bufs nil))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
143 ;; warn if user tries to attach without any files marked
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
144 (if (null files-to-attach)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
145 (error "No files to attach")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
146 (setq files-str
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
147 (mapconcat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
148 (lambda (f) (file-name-nondirectory f))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
149 files-to-attach ", "))
87097
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
150 (setq bufs (gnus-dired-mail-buffers))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
151
87097
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
152 ;; set up destination mail composition buffer
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
153 (if (and bufs
87097
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
154 (y-or-n-p "Attach files to existing mail composition buffer? "))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
155 (setq destination
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
156 (if (= (length bufs) 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
157 (get-buffer (car bufs))
87097
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
158 (completing-read "Attach to which mail composition buffer: "
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
159 (mapcar
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
160 (lambda (b)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
161 (cons b (get-buffer b)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
162 bufs)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
163 nil t)))
87097
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
164 ;; setup a new mail composition buffer
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
165 (if (eq gnus-dired-mail-mode 'gnus-user-agent)
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
166 (gnus-setup-message 'message (message-mail))
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
167 ;; FIXME: Is this the right thing?
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
168 (compose-mail))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
169 (setq destination (current-buffer)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
170
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
171 ;; set buffer to destination buffer, and attach files
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
172 (set-buffer destination)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
173 (goto-char (point-max)) ;attach at end of buffer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
174 (while files-to-attach
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
175 (mml-attach-file (car files-to-attach)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
176 (or (mm-default-file-encoding (car files-to-attach))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
177 "application/octet-stream") nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
178 (setq files-to-attach (cdr files-to-attach)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
179 (message "Attached file(s) %s" files-str))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
180
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
181 (autoload 'mailcap-parse-mailcaps "mailcap" "" t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
182
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
183 (defun gnus-dired-find-file-mailcap (&optional file-name arg)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
184 "In dired, visit FILE-NAME according to the mailcap file.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
185 If ARG is non-nil, open it in a new buffer."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
186 (interactive (list
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
187 (file-name-sans-versions (dired-get-filename) t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
188 current-prefix-arg))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
189 (mailcap-parse-mailcaps)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
190 (if (file-exists-p file-name)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
191 (let (mime-type method)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
192 (if (and (not arg)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
193 (not (file-directory-p file-name))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
194 (string-match "\\.[^\\.]+$" file-name)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
195 (setq mime-type
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
196 (mailcap-extension-to-mime
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
197 (match-string 0 file-name)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
198 (stringp
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
199 (setq method
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
200 (cdr (assoc 'viewer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
201 (car (mailcap-mime-info mime-type
87097
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
202 'all
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
203 'no-decode)))))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
204 (let ((view-command (mm-mailcap-command method file-name nil)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
205 (message "viewing via %s" view-command)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
206 (start-process "*display*"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
207 nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
208 shell-file-name
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
209 shell-command-switch
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
210 view-command))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
211 (find-file file-name)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
212 (if (file-symlink-p file-name)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
213 (error "File is a symlink to a nonexistent target")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
214 (error "File no longer exists; type `g' to update Dired buffer"))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
215
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
216 (defun gnus-dired-print (&optional file-name print-to)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
217 "In dired, print FILE-NAME according to the mailcap file.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
218
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
219 If there is no print command, print in a PostScript image. If the
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
220 optional argument PRINT-TO is nil, send the image to the printer. If
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
221 PRINT-TO is a string, save the PostScript image in a file with that
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
222 name. If PRINT-TO is a number, prompt the user for the name of the
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
223 file to save in."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
224 (interactive (list
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
225 (file-name-sans-versions (dired-get-filename) t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
226 (ps-print-preprint current-prefix-arg)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
227 (mailcap-parse-mailcaps)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
228 (cond
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
229 ((file-directory-p file-name)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
230 (error "Can't print a directory"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
231 ((file-exists-p file-name)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
232 (let (mime-type method)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
233 (if (and (string-match "\\.[^\\.]+$" file-name)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
234 (setq mime-type
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
235 (mailcap-extension-to-mime
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
236 (match-string 0 file-name)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
237 (stringp
87097
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
238 (setq method (mailcap-mime-info mime-type "print"
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
239 'no-decode))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
240 (call-process shell-file-name nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
241 (generate-new-buffer " *mm*")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
242 nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
243 shell-command-switch
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
244 (mm-mailcap-command method file-name mime-type))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
245 (with-temp-buffer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
246 (insert-file-contents file-name)
87097
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
247 (if (eq gnus-dired-mail-mode 'gnus-user-agent)
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
248 (gnus-print-buffer)
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
249 ;; FIXME:
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
250 (error "MIME print only implemeted via Gnus")))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
251 (ps-despool print-to))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
252 ((file-symlink-p file-name)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
253 (error "File is a symlink to a nonexistent target"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
254 (t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
255 (error "File no longer exists; type `g' to update Dired buffer"))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
256
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
257 (provide 'gnus-dired)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
258
93975
1e3a407766b9 Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 92336
diff changeset
259 ;; arch-tag: 44737731-e445-4638-a31e-713c7590ec76
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
260 ;;; gnus-dired.el ends here