changeset 91787:457a4ba95667

EasyPG: Update manual, menu label, epa-menu-mode->epa-mode, dired minor mode.
author Michael Olson <mwolson@gnu.org>
date Tue, 12 Feb 2008 01:24:20 +0000
parents 459312b90930
children 14206a515e37
files doc/misc/ChangeLog doc/misc/epa.texi lisp/ChangeLog lisp/epa-dired.el lisp/epa.el
diffstat 5 files changed, 50 insertions(+), 51 deletions(-) [+]
line wrap: on
line diff
--- a/doc/misc/ChangeLog	Tue Feb 12 01:18:35 2008 +0000
+++ b/doc/misc/ChangeLog	Tue Feb 12 01:24:20 2008 +0000
@@ -1,3 +1,7 @@
+2008-02-11  Daiki Ueno  <ueno@unixuser.org>
+
+	* epa.texi (Quick start): Remove the .emacs setting.
+
 2008-02-10  Daiki Ueno  <ueno@unixuser.org>
 
 	* epa.texi (Quick start): Use the command `epa-enable' instead of
--- a/doc/misc/epa.texi	Tue Feb 12 01:18:35 2008 +0000
+++ b/doc/misc/epa.texi	Tue Feb 12 01:24:20 2008 +0000
@@ -77,36 +77,23 @@
 @node  Quick start
 @chapter Quick start
 
-@c To install, just follow the standard CMMI installation instructions.
-
-@c @cartouche
-@c @example
-@c $ ./configure
-@c $ sudo make install
-@c @end example
-@c @end cartouche
-
-@c @noindent
-@c Then, add the following line to your @file{~/.emacs}
-
-Add the following line to your @file{~/.emacs}.
-
-@cartouche
-@lisp
-(epa-mode 1)
-@end lisp
-@end cartouche
-
-@noindent
-Restart emacs and type @kbd{M-x epa- @key{TAB}}, and you will see a
-lot of commands available.  For example,
+EasyPG Assistant commands are prefixed by @samp{epa-}.  For example,
 
 @itemize @bullet
 @item To browse your keyring, type @kbd{M-x epa-list-keys}
 
 @item To create a cleartext signature of the region, type @kbd{M-x epa-sign-region}
+
+@item To encrypt a file, type @kbd{M-x epa-encrypt-file}
 @end itemize
 
+EasyPG Assistant provides several cryptographic features which can be
+integrated into other Emacs functionalities.  For example, automatic
+encryption/decryption of @samp{*.gpg} files.
+
+To install these features, do @kbd{C-u 1 M-x epa-mode}.  It can also
+be turned on by customize.  Try @kbd{M-x customize-variable epa-mode}.
+
 @node Commands
 @chapter Commands
 
--- a/lisp/ChangeLog	Tue Feb 12 01:18:35 2008 +0000
+++ b/lisp/ChangeLog	Tue Feb 12 01:24:20 2008 +0000
@@ -1,3 +1,13 @@
+2008-02-11  Daiki Ueno  <ueno@unixuser.org>
+
+	* epa.el (epa-menu-mode): Merge into epa-mode.
+	(epa-menu-items): Rename the label "EasyPG Assistant" to
+	"Encryption/Decryption".
+
+	* epa-dired.el: Define a new minor-mode epa-dired-mode for dired.
+	(epa-dired-mode-map): Renamed from epa-dired-map.
+	(epa-global-dired-mode): Renamed the global minor mode.
+
 2008-02-11 Drew Adams  <drew.adams@oracle.com>
 
 	* isearch.el (isearch-fail): New face.
--- a/lisp/epa-dired.el	Tue Feb 12 01:18:35 2008 +0000
+++ b/lisp/epa-dired.el	Tue Feb 12 01:24:20 2008 +0000
@@ -26,18 +26,22 @@
 (require 'epa)
 (require 'dired)
 
-(defvar epa-dired-map
+(defvar epa-dired-mode-map
   (let ((keymap (make-sparse-keymap)))
-    (define-key keymap "d" 'epa-dired-do-decrypt)
-    (define-key keymap "v" 'epa-dired-do-verify)
-    (define-key keymap "s" 'epa-dired-do-sign)
-    (define-key keymap "e" 'epa-dired-do-encrypt)
+    (define-key keymap ":d" 'epa-dired-do-decrypt)
+    (define-key keymap ":v" 'epa-dired-do-verify)
+    (define-key keymap ":s" 'epa-dired-do-sign)
+    (define-key keymap ":e" 'epa-dired-do-encrypt)
     keymap))
 
-(fset 'epa-dired-prefix epa-dired-map)
+(defvar epa-dired-mode-hook nil)
+(defvar epa-dired-mode-on-hook nil)
+(defvar epa-dired-mode-off-hook nil)
 
-(defun epa-dired-mode-hook ()
-  (define-key dired-mode-map ":" 'epa-dired-prefix))
+;;;###autoload
+(define-minor-mode epa-dired-mode
+  "A minor-mode for encrypt/decrypt files with Dired."
+  nil " epa-dired" epa-dired-mode-map)
 
 (defun epa-dired-do-decrypt ()
   "Decrypt marked files."
@@ -83,12 +87,12 @@
     (revert-buffer)))
 
 ;;;###autoload
-(define-minor-mode epa-dired-mode
+(define-minor-mode epa-global-dired-mode
   "Minor mode to hook EasyPG into Dired."
   :global t :init-value nil :group 'epa-dired :version "23.1"
-  (remove-hook 'dired-mode-hook 'epa-dired-mode-hook)
-  (if epa-dired-mode
-      (add-hook 'dired-mode-hook 'epa-dired-mode-hook)))
+  (remove-hook 'dired-mode-hook 'epa-dired-mode)
+  (if epa-global-dired-mode
+      (add-hook 'dired-mode-hook 'epa-dired-mode)))
 
 (provide 'epa-dired)
 
--- a/lisp/epa.el	Tue Feb 12 01:18:35 2008 +0000
+++ b/lisp/epa.el	Tue Feb 12 01:24:20 2008 +0000
@@ -45,10 +45,9 @@
   :type 'integer
   :group 'epa)
 
-(defcustom epa-global-minor-modes '(epa-dired-mode
-				    epa-file-mode
+(defcustom epa-global-minor-modes '(epa-global-dired-mode
 				    epa-global-mail-mode
-				    epa-menu-mode)
+				    epa-file-mode)
   "Globally defined minor modes to hook into other modes."
   :type '(repeat symbol)
   :group 'epa)
@@ -240,7 +239,7 @@
 (defvar epa-menu nil)
 
 (defconst epa-menu-items
-  '("EasyPG Assistant"
+  '("Encryption/Decryption"
     ("Decrypt"
      ["File" epa-decrypt-file
       :help "Decrypt a file"]
@@ -1220,28 +1219,23 @@
 ;; (make-obsolete 'epa-sign-keys "Do not use.")
 
 ;;;###autoload
-(define-minor-mode epa-menu-mode
-  "Minor mode to hook EasyPG into the menu-bar."
+(define-minor-mode epa-mode
+  "Minor mode to hook EasyPG into various modes.
+See `epa-global-minor-modes'."
   :global t :init-value nil :group 'epa :version "23.1"
   (unless epa-menu
     (easy-menu-define epa-menu nil "EasyPG Assistant global menu"
       epa-menu-items))
-  (easy-menu-remove-item nil '("Tools") "EasyPG Assistant")
-  (if epa-menu-mode
-      (easy-menu-add-item nil '("Tools") epa-menu)))
-
-;;;###autoload
-(define-minor-mode epa-mode
-  "Minor mode to hook EasyPG into various modes.
-See `epa-global-minor-modes'."
-  :global t :init-value nil :group 'epa :version "23.1"
+  (easy-menu-remove-item nil '("Tools") "Encryption/Decryption")
+  (if epa-mode
+      (easy-menu-add-item nil '("Tools") epa-menu))
   (let ((modes epa-global-minor-modes)
 	symbol)
     (while modes
       (setq symbol (car modes))
       (if (and symbol
 	       (fboundp symbol))
-	  (funcall symbol (if epa-mode 1 0))
+	  (funcall symbol epa-mode)
 	(message "`%S' not found" (car modes)))
       (setq modes (cdr modes)))))