annotate lisp/epa-dired.el @ 94417:1a8916b995cf

* epa-file.el (auto-encryption-mode): Rename from epa-file-mode. (epa-file-handler): Put 'safe-magic and 'operations properties. * epa.el (epa-global-minor-modes, epa-mode, epa-menu) (epa-menu-items): Remove. * epa-dired.el (epa-dired-do-decrypt, epa-dired-do-verify) (epa-dired-do-sign, epa-dired-do-encrypt): Add autoload cookie. (epa-dired-mode, epa-global-dired-mode): Remove. * dired.el (dired-mode-map): Bind encryption/decryption commands. * menu-bar.el (menu-bar-encryption-decryption-menu): New menu item. * files.el (insert-file-contents-literally): Inhibit epa-file-handler.
author Dan Nicolaescu <dann@ics.uci.edu>
date Sun, 27 Apr 2008 19:49:15 +0000
parents 457a4ba95667
children ee5932bf781d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
91647
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
1 ;;; epa-dired.el --- the EasyPG Assistant, dired extension
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
2 ;; Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
3
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
4 ;; Author: Daiki Ueno <ueno@unixuser.org>
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
5 ;; Keywords: PGP, GnuPG
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
6
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
7 ;; This file is part of GNU Emacs.
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
8
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
9 ;; GNU Emacs is free software; you can redistribute it and/or modify
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
10 ;; it under the terms of the GNU General Public License as published by
91654
3cd69d2e616a Update license to GPLv3+.
Glenn Morris <rgm@gnu.org>
parents: 91647
diff changeset
11 ;; the Free Software Foundation; either version 3, or (at your option)
91647
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
12 ;; any later version.
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
13
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
14 ;; GNU Emacs is distributed in the hope that it will be useful,
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
17 ;; GNU General Public License for more details.
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
18
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
20 ;; along with GNU Emacs; see the file COPYING. If not, write to the
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
21 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
22 ;; Boston, MA 02110-1301, USA.
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
23
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
24 ;;; Code:
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
25
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
26 (require 'epa)
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
27 (require 'dired)
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
28
91787
457a4ba95667 EasyPG: Update manual, menu label, epa-menu-mode->epa-mode, dired minor mode.
Michael Olson <mwolson@gnu.org>
parents: 91731
diff changeset
29 ;;;###autoload
91647
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
30 (defun epa-dired-do-decrypt ()
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
31 "Decrypt marked files."
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
32 (interactive)
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
33 (let ((file-list (dired-get-marked-files)))
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
34 (while file-list
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
35 (epa-decrypt-file (expand-file-name (car file-list)))
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
36 (setq file-list (cdr file-list)))
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
37 (revert-buffer)))
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
38
94417
1a8916b995cf * epa-file.el (auto-encryption-mode): Rename from epa-file-mode.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 91787
diff changeset
39 ;;;###autoload
91647
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
40 (defun epa-dired-do-verify ()
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
41 "Verify marked files."
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
42 (interactive)
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
43 (let ((file-list (dired-get-marked-files)))
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
44 (while file-list
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
45 (epa-verify-file (expand-file-name (car file-list)))
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
46 (setq file-list (cdr file-list)))))
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
47
94417
1a8916b995cf * epa-file.el (auto-encryption-mode): Rename from epa-file-mode.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 91787
diff changeset
48 ;;;###autoload
91647
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
49 (defun epa-dired-do-sign ()
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
50 "Sign marked files."
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
51 (interactive)
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
52 (let ((file-list (dired-get-marked-files)))
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
53 (while file-list
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
54 (epa-sign-file
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
55 (expand-file-name (car file-list))
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
56 (epa-select-keys (epg-make-context) "Select keys for signing.
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
57 If no one is selected, default secret key is used. "
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
58 nil t)
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
59 (y-or-n-p "Make a detached signature? "))
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
60 (setq file-list (cdr file-list)))
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
61 (revert-buffer)))
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
62
94417
1a8916b995cf * epa-file.el (auto-encryption-mode): Rename from epa-file-mode.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 91787
diff changeset
63 ;;;###autoload
91647
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
64 (defun epa-dired-do-encrypt ()
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
65 "Encrypt marked files."
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
66 (interactive)
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
67 (let ((file-list (dired-get-marked-files)))
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
68 (while file-list
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
69 (epa-encrypt-file
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
70 (expand-file-name (car file-list))
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
71 (epa-select-keys (epg-make-context) "Select recipents for encryption.
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
72 If no one is selected, symmetric encryption will be performed. "))
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
73 (setq file-list (cdr file-list)))
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
74 (revert-buffer)))
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
75
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
76 (provide 'epa-dired)
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
77
91687
d125b90283d2 Add arch tagline
Miles Bader <miles@gnu.org>
parents: 91654
diff changeset
78 ;; arch-tag: 2025700b-48d0-4684-bc94-228ad1f8e9ff
91647
f9692dfe86e7 EasyPG: Initial check-in.
Michael Olson <mwolson@gnu.org>
parents:
diff changeset
79 ;;; epa-dired.el ends here