emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/epa.el,v


From: Michael W. Olson
Subject: [Emacs-diffs] Changes to emacs/lisp/epa.el,v
Date: Sun, 10 Feb 2008 20:57:49 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Michael W. Olson <mwolson>      08/02/10 20:57:47

Index: lisp/epa.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/epa.el,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- lisp/epa.el 9 Feb 2008 21:59:33 -0000       1.3
+++ lisp/epa.el 10 Feb 2008 20:57:47 -0000      1.4
@@ -45,6 +45,14 @@
   :type 'integer
   :group 'epa)
 
+(defcustom epa-global-minor-modes '(epa-dired-mode
+                                   epa-file-mode
+                                   epa-mail-minor-mode
+                                   epa-menu-mode)
+  "Globally defined minor modes to hook into other modes."
+  :type '(repeat symbol)
+  :group 'epa)
+
 (defgroup epa-faces nil
   "Faces for epa-mode."
   :version "23.1"
@@ -229,6 +237,44 @@
     (define-key keymap "q" 'delete-window)
     keymap))
 
+(defvar epa-menu nil)
+
+(defconst epa-menu-items
+  '("EasyPG Assistant"
+    ("Decrypt"
+     ["File" epa-decrypt-file
+      :help "Decrypt a file"]
+     ["Region" epa-decrypt-region
+      :help "Decrypt the current region"])
+    ("Verify"
+     ["File" epa-verify-file
+      :help "Verify digital signature of a file"]
+     ["Region" epa-verify-region
+      :help "Verify digital signature of the current region"])
+    ("Sign"
+     ["File" epa-sign-file
+      :help "Create digital signature of a file"]
+     ["Region" epa-sign-region
+      :help "Create digital signature of the current region"])
+    ("Encrypt"
+     ["File" epa-encrypt-file
+      :help "Encrypt a file"]
+     ["Region" epa-encrypt-region
+      :help "Encrypt the current region"])
+    "----"
+    ["Browse keyring" epa-list-keys
+     :help "Browse your public keyring"]
+    ("Import keys"
+     ["File" epa-import-keys
+      :help "Import public keys from a file"]
+     ["Region" epa-import-keys-region
+      :help "Import public keys from the current region"])
+    ("Export key"
+     ["To a File" epa-export-keys
+      :help "Export public keys to a file"]
+     ["To a Buffer" epa-insert-keys
+      :help "Insert public keys after the current point"])))
+
 (defvar epa-exit-buffer-function #'bury-buffer)
 
 (define-widget 'epa-key 'push-button
@@ -1173,6 +1219,32 @@
 ;;     (message "Signing keys...done")))
 ;; (make-obsolete 'epa-sign-keys "Do not use.")
 
+;;;###autoload
+(define-minor-mode epa-menu-mode
+  "Minor mode to hook EasyPG into the menu-bar."
+  :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"
+  (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))
+       (message "`%S' not found" (car modes)))
+      (setq modes (cdr modes)))))
+
 (provide 'epa)
 
 ;; arch-tag: 38d20ced-20d5-4137-b17a-f206335423d7




reply via email to

[Prev in Thread] Current Thread [Next in Thread]