unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* patch to include EasyPG to Emacs
@ 2008-02-07  4:58 Daiki Ueno
  2008-02-07  5:13 ` Dan Nicolaescu
                   ` (2 more replies)
  0 siblings, 3 replies; 44+ messages in thread
From: Daiki Ueno @ 2008-02-07  4:58 UTC (permalink / raw)
  To: emacs-devel

Hello,

I believe that all the copyright issues of EasyPG were solved now and
EasyPG is ready to be installed.  The following is a preliminary patch
to the trunk: http://www.easypg.org/add-epg-to-emacs.diff.gz

Quick usage:

$ cd emacs
$ gzip -dc add-epg-to-emacs.diff.gz | patch -p0
... build and install emacs ...
$ emacs -Q

Then `M-x epa-file-enable' and open *.gpg files.

Comments and suggestions are appreciated.

NOTE: When making the patch, I intentionally left lisp/ChangeLog and
info/dir untouched to avoid conflict with changes expected in near
future.

Regards,
-- 
Daiki Ueno




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-07  4:58 patch to include EasyPG to Emacs Daiki Ueno
@ 2008-02-07  5:13 ` Dan Nicolaescu
  2008-02-07  9:28   ` Daiki Ueno
  2008-02-08  4:14 ` Richard Stallman
  2008-02-08  7:03 ` Michael Olson
  2 siblings, 1 reply; 44+ messages in thread
From: Dan Nicolaescu @ 2008-02-07  5:13 UTC (permalink / raw)
  To: Daiki Ueno; +Cc: emacs-devel

Daiki Ueno <ueno@unixuser.org> writes:

  > Hello,
  > 
  > I believe that all the copyright issues of EasyPG were solved now and
  > EasyPG is ready to be installed.  The following is a preliminary patch
  > to the trunk: http://www.easypg.org/add-epg-to-emacs.diff.gz

Could you please add menus to the new modes that you are adding?  Menus
are very helpful for users that are not yet familiar with the key
bindings and a good way to discover functionality.  (Don't forget :help
for the menu items that you add).
(Obviously this can be done after the initial check in)




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-07  5:13 ` Dan Nicolaescu
@ 2008-02-07  9:28   ` Daiki Ueno
  2008-02-07 16:24     ` Leo
  2008-02-08  7:15     ` Dan Nicolaescu
  0 siblings, 2 replies; 44+ messages in thread
From: Daiki Ueno @ 2008-02-07  9:28 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: emacs-devel

2008/2/7, Dan Nicolaescu <dann@ics.uci.edu>:
> Could you please add menus to the new modes that you are adding?  Menus
> are very helpful for users that are not yet familiar with the key
> bindings and a good way to discover functionality.  (Don't forget :help
> for the menu items that you add).
> (Obviously this can be done after the initial check in)

Sure.  I'll add them after the initial check in (to keep the merge simple).

Regards,
-- 
Daiki Ueno




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-07  9:28   ` Daiki Ueno
@ 2008-02-07 16:24     ` Leo
  2008-02-08  4:42       ` Daiki Ueno
  2008-02-08  7:15     ` Dan Nicolaescu
  1 sibling, 1 reply; 44+ messages in thread
From: Leo @ 2008-02-07 16:24 UTC (permalink / raw)
  To: emacs-devel

On 2008-02-07 09:28 +0000, Daiki Ueno wrote:
> 2008/2/7, Dan Nicolaescu <dann@ics.uci.edu>:
>> Could you please add menus to the new modes that you are adding?  Menus
>> are very helpful for users that are not yet familiar with the key
>> bindings and a good way to discover functionality.  (Don't forget :help
>> for the menu items that you add).
>> (Obviously this can be done after the initial check in)
>
> Sure.  I'll add them after the initial check in (to keep the merge
> simple).
>
> Regards,

I look forward for the merge as epg.

Should pgg be obsolete by epg?

Thanks for this wonderful package.

Best,
-- 
.:  Leo  :.  [ sdl.web AT gmail.com ]  .:  [ GPG Key: 9283AA3F ]  :.

          Use the best OS -- http://www.fedoraproject.org/





^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-07  4:58 patch to include EasyPG to Emacs Daiki Ueno
  2008-02-07  5:13 ` Dan Nicolaescu
@ 2008-02-08  4:14 ` Richard Stallman
  2008-02-08  7:03 ` Michael Olson
  2 siblings, 0 replies; 44+ messages in thread
From: Richard Stallman @ 2008-02-08  4:14 UTC (permalink / raw)
  To: Daiki Ueno; +Cc: emacs-devel

Things are rather unstable right now, and there are many bugs to fix.
So if nobody does this soon, please remind us again in two weeks,
and then again every two weeks.




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-07 16:24     ` Leo
@ 2008-02-08  4:42       ` Daiki Ueno
  0 siblings, 0 replies; 44+ messages in thread
From: Daiki Ueno @ 2008-02-08  4:42 UTC (permalink / raw)
  To: Leo; +Cc: emacs-devel

2008/2/8, Leo <sdl.web@gmail.com>:

> Should pgg be obsolete by epg?

Well, it has been planned, but I think that it will requires several
steps.  I recall that Richard suggested to make PGG compatible library
implemented with EasyPG for smooth transition.
Although it is not difficult if it is based on pgg-epg.el which had
been distributed along with EasyPG, but it might also require some
more paper works.

BTW, here are the list of other plans/ideas after the merge.

- Make `insert-file-contents-literally' take care of epa-file-handler.
 Currently it only cares of jka-compr-handler and image-file-handler.

- Implement menus as suggested by Dan Nicolaescu.

- Provide `auto-encryption-mode' command/option which is an analogue
of `auto-compression-mode'.

- Remove no longer appropriate item in etc/TODO:
"Implement a variant of uncompress.el or jka-compr.el that works with
GNU Privacy Guard for encryption."

Regards,
-- 
Daiki Ueno




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-07  4:58 patch to include EasyPG to Emacs Daiki Ueno
  2008-02-07  5:13 ` Dan Nicolaescu
  2008-02-08  4:14 ` Richard Stallman
@ 2008-02-08  7:03 ` Michael Olson
  2008-02-10  7:04   ` Daiki Ueno
  2 siblings, 1 reply; 44+ messages in thread
From: Michael Olson @ 2008-02-08  7:03 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1913 bytes --]

Daiki Ueno <ueno@unixuser.org> writes:

> Hello,
>
> I believe that all the copyright issues of EasyPG were solved now and
> EasyPG is ready to be installed.  The following is a preliminary patch
> to the trunk: http://www.easypg.org/add-epg-to-emacs.diff.gz

I've checked in this patch, with the following changes.

epa.texi:
 - Re-arranged header slightly to fit convention.
 - Set title to "EasyPG Assistant User's Manual".

> NOTE: When making the patch, I intentionally left lisp/ChangeLog and
> info/dir untouched to avoid conflict with changes expected in near
> future.

I've added simple entries to various ChangeLog files.  For future
reference, it's preferable to provide these entries in the initial email
to the list.

I've modified info/dir so that the EasyPG Assistant manual is in the
"Emacs misc features" section.

Here are some minor things I've noticed which could possibly need some
changes made.

 - epg-package-info.el is very small.  Perhaps it should be merged with
   epg.el.
 - epa-setup.el is also small.  It might be best to:
   - Remove the autoload for epa-list-keys.
   - Add an ;;;###autoload tag for epa-dired-mode-hook.
   - Add an ;;;###autoload tag for epa-mail-mode.
   - Move most of the remainder into a function called `epa-setup' (or
     something similar).  That function could take an optional argument
     which if positive or t would enable this functionality, or if
     negative would disable it (remove-hook, call epa-file-disable,
     etc.).
 - Several of these files have trailing whitespace.  Once the initial
   flurry of changes has been made, these should be dealt with.

-- 
|       Michael Olson  |  FSF Associate Member #652     |
| http://mwolson.org/  |  Hobbies: Lisp, HCoop          |
| Projects: Emacs, Muse, ERC, EMMS, ErBot, DVC, Planner |
`-------------------------------------------------------'

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-07  9:28   ` Daiki Ueno
  2008-02-07 16:24     ` Leo
@ 2008-02-08  7:15     ` Dan Nicolaescu
  1 sibling, 0 replies; 44+ messages in thread
From: Dan Nicolaescu @ 2008-02-08  7:15 UTC (permalink / raw)
  To: Daiki Ueno; +Cc: emacs-devel

"Daiki Ueno" <ueno@unixuser.org> writes:

  > 2008/2/7, Dan Nicolaescu <dann@ics.uci.edu>:
  > > Could you please add menus to the new modes that you are adding?  Menus
  > > are very helpful for users that are not yet familiar with the key
  > > bindings and a good way to discover functionality.  (Don't forget :help
  > > for the menu items that you add).
  > > (Obviously this can be done after the initial check in)
  > 
  > Sure.  I'll add them after the initial check in (to keep the merge simple).

Could you please add some more details to the NEWS entry?  Ideally after
reading the NEWS entry a user should have a good idea what the feature
it describes is all about.   Maybe describe what it can do instead of
what it is made out off.

Just my 2 cents.




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-08  7:03 ` Michael Olson
@ 2008-02-10  7:04   ` Daiki Ueno
  2008-02-10 15:44     ` Stefan Monnier
  0 siblings, 1 reply; 44+ messages in thread
From: Daiki Ueno @ 2008-02-10  7:04 UTC (permalink / raw)
  To: Michael Olson; +Cc: emacs-devel

Michael Olson <mwolson@gnu.org> writes:

>> I believe that all the copyright issues of EasyPG were solved now and
>> EasyPG is ready to be installed.  The following is a preliminary patch
>> to the trunk: http://www.easypg.org/add-epg-to-emacs.diff.gz
>
> I've checked in this patch, with the following changes.

Thanks.  (I'm sorry for that I sent a previous reply to you without
Cc-ing the ML by mistake).

> Here are some minor things I've noticed which could possibly need some
> changes made.
>
>  - epg-package-info.el is very small.  Perhaps it should be merged with
>    epg.el.
>  - epa-setup.el is also small.  It might be best to:
>    - Remove the autoload for epa-list-keys.
>    - Add an ;;;###autoload tag for epa-dired-mode-hook.
>    - Add an ;;;###autoload tag for epa-mail-mode.
>    - Move most of the remainder into a function called `epa-setup' (or
>      something similar).  That function could take an optional argument
>      which if positive or t would enable this functionality, or if
>      negative would disable it (remove-hook, call epa-file-disable,
>      etc.).
>  - Several of these files have trailing whitespace.  Once the initial
>    flurry of changes has been made, these should be dealt with.

The attached patch will fix them.  It does:

- merge epg-package-info.el into epg-config.el,
- add autoload cookies for epa-dired-mode-hook and epa-mail-mode,
- provide epa-*-enable/disable commands for several "intrusive" features for
  other modes (dired, mail-mode, menu-bars),
- replace (require 'epa-setup) with (epa-enable),
- remove trailing whitespaces,
- define menus, and
- clarify EasyPG functionalities in NEWS.

After applying this patch, epg-package-info.el and epa-setup.el can be
safely removed.

Index: doc/misc/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/doc/misc/ChangeLog,v
retrieving revision 1.90
diff -c -r1.90 ChangeLog
*** doc/misc/ChangeLog	8 Feb 2008 10:20:27 -0000	1.90
--- doc/misc/ChangeLog	10 Feb 2008 07:02:30 -0000
***************
*** 1,3 ****
--- 1,8 ----
+ 2008-02-10  Daiki Ueno  <ueno@unixuser.org>
+ 
+ 	* epa.texi (Quick start): Use the command `epa-enable' instead of
+ 	loading `epa-setup'.
+ 
  2008-02-08  Juanma Barranquero  <lekktu@gmail.com>
  
  	* makefile.w32-in (INFO_TARGETS, DVI_TARGETS, clean): Add epa.
Index: doc/misc/epa.texi
===================================================================
RCS file: /sources/emacs/emacs/doc/misc/epa.texi,v
retrieving revision 1.2
diff -c -r1.2 epa.texi
*** doc/misc/epa.texi	9 Feb 2008 02:29:01 -0000	1.2
--- doc/misc/epa.texi	10 Feb 2008 07:02:30 -0000
***************
*** 77,97 ****
  @node  Quick start
  @chapter Quick start
  
! To install, just follow the standard CMMI installation instructions.
  
! @cartouche
! @example
! $ ./configure
! $ sudo make install
! @end example
! @end cartouche
  
! @noindent
! Then, add the following line to your @file{~/.emacs}
  
  @cartouche
  @lisp
! (require 'epa-setup)
  @end lisp
  @end cartouche
  
--- 77,99 ----
  @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-enable)
  @end lisp
  @end cartouche
  
Index: etc/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/etc/ChangeLog,v
retrieving revision 1.678
diff -c -r1.678 ChangeLog
*** etc/ChangeLog	8 Feb 2008 08:57:40 -0000	1.678
--- etc/ChangeLog	10 Feb 2008 07:02:30 -0000
***************
*** 1,3 ****
--- 1,7 ----
+ 2008-02-10  Daiki Ueno  <ueno@unixuser.org>
+ 
+ 	* NEWS: Clarify EasyPG functionalities.
+ 
  2008-02-08  Jan Djärv  <jan.h.d@swipnet.se>
  
  	* NEWS: Mention XEmbed and --parent-id.
Index: etc/NEWS
===================================================================
RCS file: /sources/emacs/emacs/etc/NEWS,v
retrieving revision 1.1652
diff -c -r1.1652 NEWS
*** etc/NEWS	10 Feb 2008 02:06:57 -0000	1.1652
--- etc/NEWS	10 Feb 2008 07:02:31 -0000
***************
*** 242,254 ****
  inter-process communication mechanism for applications residing on the
  same host, based on messages.  See the manual for further details.
  
! ** EasyPG is now part of the Emacs distribution.
! EasyPG is an all-in-one GnuPG interface for Emacs. It consists of two
! parts: EasyPG Assistant and EasyPG Library.
! 
! EasyPG Assistant is a set of convenient tools to use GnuPG from
! Emacs. EasyPG Library is a sort of an elisp port of GPGME, a wrapper
! library which provides API to access some of the GnuPG functions.
  \f
  * Changes in Specialized Modes and Packages in Emacs 23.1
  
--- 242,251 ----
  inter-process communication mechanism for applications residing on the
  same host, based on messages.  See the manual for further details.
  
! ** EasyPG is now part of the Emacs distribution.  It is an all-in-one
! GnuPG interface which includes GnuPG keyring browser, cryptographic
! operations on regions and files, and automatic encryption of *.gpg
! files.  See the EasyPG Assistant User's Manual for further details.
  \f
  * Changes in Specialized Modes and Packages in Emacs 23.1
  
Index: lisp/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.12749
diff -c -r1.12749 ChangeLog
*** lisp/ChangeLog	9 Feb 2008 23:15:54 -0000	1.12749
--- lisp/ChangeLog	10 Feb 2008 07:02:33 -0000
***************
*** 1,3 ****
--- 1,26 ----
+ 2008-02-10  Daiki Ueno  <ueno@unixuser.org>
+ 
+ 	* epg-config.el: Expand the contents of epg-package-info.el.
+ 	(epg-package-name): New constant.
+ 	(epg-version-number): New constant.
+ 	(epg-bug-report-address): New constant.
+ 
+ 	* epa-mail.el (epa-mail-mode): Add autoload cookie.
+ 	(epa-mail-enable): New command.
+ 	(epa-mail-disable): New command.
+ 
+ 	* epa-dired.el (epa-dired-mode-hook): Add autoload cookie.
+ 	(epa-dired-enable): New command.
+ 	(epa-dired-disable): New command.
+ 
+ 	* epa.el (epa-menu): New variable.
+ 	(epa-menu-items): New variable.
+ 	(epa-menu-enable): New command.
+ 	(epa-menu-disable): New command.
+ 	(epa-features): New user option.
+ 	(epa-enable): New command.
+ 	(epa-disable): New command.
+ 
  2008-02-09  Jason Rumney  <jasonr@gnu.org>
  
  	* button.el (button-map):
Index: lisp/epa-dired.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/epa-dired.el,v
retrieving revision 1.3
diff -c -r1.3 epa-dired.el
*** lisp/epa-dired.el	9 Feb 2008 02:29:01 -0000	1.3
--- lisp/epa-dired.el	10 Feb 2008 07:02:33 -0000
***************
*** 82,87 ****
--- 82,106 ----
        (setq file-list (cdr file-list)))
      (revert-buffer)))
  
+ ;;;###autoload
+ (defun epa-dired-enable ()
+   (interactive)
+   (if (and (boundp 'dired-mode-hook)
+ 	   (memq 'epa-dired-mode-hook dired-mode-hook))
+       (message "`epa-dired' already enabled")
+     (add-hook 'dired-mode-hook 'epa-dired-mode-hook)
+     (message "`epa-dired' enabled")))
+ 
+ ;;;###autoload
+ (defun epa-dired-disable ()
+   (interactive)
+   (if (and (boundp 'dired-mode-hook)
+ 	   (memq 'epa-dired-mode-hook dired-mode-hook))
+       (progn
+ 	(remove-hook 'dired-mode-hook 'epa-dired-mode-hook)
+ 	(message "`epa-dired' disabled"))
+     (message "`epa-dired' already disabled")))
+ 
  (provide 'epa-dired)
  
  ;; arch-tag: 2025700b-48d0-4684-bc94-228ad1f8e9ff
Index: lisp/epa-mail.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/epa-mail.el,v
retrieving revision 1.2
diff -c -r1.2 epa-mail.el
*** lisp/epa-mail.el	9 Feb 2008 02:29:01 -0000	1.2
--- lisp/epa-mail.el	10 Feb 2008 07:02:33 -0000
***************
*** 40,45 ****
--- 40,46 ----
  (defvar epa-mail-mode-on-hook nil)
  (defvar epa-mail-mode-off-hook nil)
  
+ ;;;###autoload
  (define-minor-mode epa-mail-mode
    "A minor-mode for composing encrypted/clearsigned mails."
    nil " epa-mail" epa-mail-mode-map)
***************
*** 173,178 ****
--- 174,198 ----
    (interactive)
    (epa-import-armor-in-region (point-min) (point-max)))
  
+ ;;;###autoload
+ (defun epa-mail-enable ()
+   (interactive)
+   (if (and (boundp 'mail-mode-hook)
+ 	   (memq 'epa-mail-mode mail-mode-hook))
+       (message "`epa-mail' already enabled")
+     (add-hook 'mail-mode-hook 'epa-mail-mode)
+     (message "`epa-mail' enabled")))
+ 
+ ;;;###autoload
+ (defun epa-mail-disable ()
+   (interactive)
+   (if (and (boundp 'mail-mode-hook)
+ 	   (memq 'epa-mail-mode mail-mode-hook))
+       (progn
+ 	(remove-hook 'mail-mode-hook 'epa-mail-mode)
+ 	(message "`epa-mail' disabled"))
+     (message "`epa-mail' already disabled")))
+ 
  (provide 'epa-mail)
  
  ;; arch-tag: a6f82b3f-d177-4a11-af95-040da55927d2
Index: lisp/epa.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/epa.el,v
retrieving revision 1.3
diff -c -r1.3 epa.el
*** lisp/epa.el	9 Feb 2008 21:59:33 -0000	1.3
--- lisp/epa.el	10 Feb 2008 07:02:33 -0000
***************
*** 45,50 ****
--- 45,55 ----
    :type 'integer
    :group 'epa)
  
+ (defcustom epa-features '(epa-dired epa-file epa-mail epa-menu)
+   "Add-on features to other modes."
+   :type '(repeat symbol)
+   :group 'epa)
+ 
  (defgroup epa-faces nil
    "Faces for epa-mode."
    :version "23.1"
***************
*** 229,234 ****
--- 234,277 ----
      (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
***************
*** 372,378 ****
  				     'end-open t))
  	  (widget-create 'epa-key :value (car keys))
  	  (insert "\n")
! 	  (setq keys (cdr keys))))      
        (add-text-properties (point-min) (point-max)
  			   (list 'epa-list-keys t
  				 'front-sticky nil
--- 415,421 ----
  				     'end-open t))
  	  (widget-create 'epa-key :value (car keys))
  	  (insert "\n")
! 	  (setq keys (cdr keys))))
        (add-text-properties (point-min) (point-max)
  			   (list 'epa-list-keys t
  				 'front-sticky nil
***************
*** 1173,1178 ****
--- 1216,1273 ----
  ;;     (message "Signing keys...done")))
  ;; (make-obsolete 'epa-sign-keys "Do not use.")
  
+ ;;;###autoload
+ (defun epa-menu-enable ()
+   "Add the EasyPG Assistant menu on the menu-bar."
+   (interactive)
+   (if epa-menu
+       (message "`epa-menu' alread enabled")
+     (easy-menu-define epa-menu nil "EasyPG Assistant global menu"
+       epa-menu-items)
+     (easy-menu-add-item nil '("Tools") epa-menu)
+     (message "`epa-menu' enabled")))
+ 
+ ;;;###autoload
+ (defun epa-menu-disable ()
+   "Remove the EasyPG Assistant menu from the menu-bar."
+   (interactive)
+   (if epa-menu
+       (progn
+ 	(easy-menu-remove-item nil '("Tools") "EasyPG Assistant")
+ 	(setq epa-menu nil)
+ 	(message "`epa-menu' disabled"))
+     (message "`epa-menu' already disabled")))
+ 
+ ;;;###autoload
+ (defun epa-enable ()
+   "Enable EasyPG Assistant features.
+ See `epa-features'."
+   (interactive)
+   (let ((pointer epa-features)
+ 	symbol)
+     (while pointer
+       (setq symbol (intern-soft (format "%S-enable" (car pointer))))
+       (if (and symbol
+ 	       (fboundp symbol))
+ 	  (funcall symbol)
+ 	(message "`%S' not found" (car pointer)))
+       (setq pointer (cdr pointer)))))
+ 
+ ;;;###autoload
+ (defun epa-disable ()
+   "Disable EasyPG Assistant features.
+ See `epa-features'."
+   (interactive)
+   (let ((pointer epa-features)
+ 	symbol)
+     (while pointer
+       (setq symbol (intern-soft (format "%S-disable" (car pointer))))
+       (if (and symbol
+ 	       (fboundp symbol))
+ 	  (funcall symbol)
+ 	(message "`%S' not found" (car pointer)))
+       (setq pointer (cdr pointer)))))
+ 
  (provide 'epa)
  
  ;; arch-tag: 38d20ced-20d5-4137-b17a-f206335423d7
Index: lisp/epg-config.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/epg-config.el,v
retrieving revision 1.3
diff -c -r1.3 epg-config.el
*** lisp/epg-config.el	9 Feb 2008 21:59:33 -0000	1.3
--- lisp/epg-config.el	10 Feb 2008 07:02:33 -0000
***************
*** 23,29 ****
  
  ;;; Code:
  
! (require 'epg-package-info)
  
  (defgroup epg ()
    "The EasyPG Library"
--- 23,36 ----
  
  ;;; Code:
  
! (defconst epg-package-name "epg"
!   "Name of this package.")
! 
! (defconst epg-version-number "1.0.0"
!   "Version number of this package.")
! 
! (defconst epg-bug-report-address "ueno@unixuser.org"
!   "Report bugs to this address.")
  
  (defgroup epg ()
    "The EasyPG Library"
Index: lisp/epg.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/epg.el,v
retrieving revision 1.2
diff -c -r1.2 epg.el
*** lisp/epg.el	9 Feb 2008 02:29:02 -0000	1.2
--- lisp/epg.el	10 Feb 2008 07:02:36 -0000
***************
*** 1430,1436 ****
         signature
         (string-to-number (match-string 4 string)))
        (epg-signature-set-pubkey-algorithm
!        signature 
         (string-to-number (match-string 5 string)))
        (epg-signature-set-digest-algorithm
         signature
--- 1430,1436 ----
         signature
         (string-to-number (match-string 4 string)))
        (epg-signature-set-pubkey-algorithm
!        signature
         (string-to-number (match-string 5 string)))
        (epg-signature-set-digest-algorithm
         signature
***************
*** 1744,1750 ****
  (defun epg-list-keys (context &optional name mode)
    "Return a list of epg-key objects matched with NAME.
  If MODE is nil or 'public, only public keyring should be searched.
! If MODE is t or 'secret, only secret keyring should be searched. 
  Otherwise, only public keyring should be searched and the key
  signatures should be included.
  NAME is either a string or a list of strings."
--- 1744,1750 ----
  (defun epg-list-keys (context &optional name mode)
    "Return a list of epg-key objects matched with NAME.
  If MODE is nil or 'public, only public keyring should be searched.
! If MODE is t or 'secret, only secret keyring should be searched.
  Otherwise, only public keyring should be searched and the key
  signatures should be included.
  NAME is either a string or a list of strings."

Regards,
-- 
Daiki Ueno




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-10  7:04   ` Daiki Ueno
@ 2008-02-10 15:44     ` Stefan Monnier
  2008-02-10 19:15       ` Daiki Ueno
  0 siblings, 1 reply; 44+ messages in thread
From: Stefan Monnier @ 2008-02-10 15:44 UTC (permalink / raw)
  To: Daiki Ueno; +Cc: Michael Olson, emacs-devel

> - provide epa-*-enable/disable commands for several "intrusive" features for
>   other modes (dired, mail-mode, menu-bars),

Please define them as (global) minor modes instead,

Oh and (memq 'epa-mail-mode mail-mode-hook) is not a good test because
mail-mode-hook may be buffer-local and epa-mail-mode would be only be on
the global part of it.  You can fix the test, but I recommend you don't:
just do the `remove-hook' without checking whether it's done redundantly
or not.

E.g.

  (define-minor-mode epa-mail-mode
    "Minor mode to hook EasyPG into Mail mode."
    :global t
    (remove-hook 'mail-mode-hook 'epa-mail-mode)
    (if epa-mail-mode
        (add-hook 'mail-mode-hook 'epa-mail-mode)))


-- Stefan




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-10 15:44     ` Stefan Monnier
@ 2008-02-10 19:15       ` Daiki Ueno
  2008-02-10 19:30         ` Daiki Ueno
                           ` (2 more replies)
  0 siblings, 3 replies; 44+ messages in thread
From: Daiki Ueno @ 2008-02-10 19:15 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Michael Olson, emacs-devel

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

>> - provide epa-*-enable/disable commands for several "intrusive" features for
>>   other modes (dired, mail-mode, menu-bars),
>
> Please define them as (global) minor modes instead,

Wow, it also greatly simplifies the code.  Thanks for the suggestion.
However, if there is already a (local) minor mode called epa-mail-mode,
what is a good name for global minor mode?

Anyway, here is an up-to-date patch.

Index: doc/misc/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/doc/misc/ChangeLog,v
retrieving revision 1.90
diff -c -r1.90 ChangeLog
*** doc/misc/ChangeLog	8 Feb 2008 10:20:27 -0000	1.90
--- doc/misc/ChangeLog	10 Feb 2008 19:14:54 -0000
***************
*** 1,3 ****
--- 1,8 ----
+ 2008-02-10  Daiki Ueno  <ueno@unixuser.org>
+ 
+ 	* epa.texi (Quick start): Use the command `epa-enable' instead of
+ 	loading `epa-setup'.
+ 
  2008-02-08  Juanma Barranquero  <lekktu@gmail.com>
  
  	* makefile.w32-in (INFO_TARGETS, DVI_TARGETS, clean): Add epa.
Index: doc/misc/epa.texi
===================================================================
RCS file: /sources/emacs/emacs/doc/misc/epa.texi,v
retrieving revision 1.2
diff -c -r1.2 epa.texi
*** doc/misc/epa.texi	9 Feb 2008 02:29:01 -0000	1.2
--- doc/misc/epa.texi	10 Feb 2008 19:14:54 -0000
***************
*** 77,102 ****
  @node  Quick start
  @chapter Quick start
  
! To install, just follow the standard CMMI installation instructions.
  
! @cartouche
! @example
! $ ./configure
! $ sudo make install
! @end example
! @end cartouche
  
! @noindent
! Then, add the following line to your @file{~/.emacs}
  
  @cartouche
  @lisp
! (require 'epa-setup)
  @end lisp
  @end cartouche
  
  @noindent
! That's all.  Restart emacs and type @kbd{M-x epa- @key{TAB}}, and you will see a
  lot of commands available.  For example,
  
  @itemize @bullet
--- 77,104 ----
  @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,
  
  @itemize @bullet
Index: etc/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/etc/ChangeLog,v
retrieving revision 1.678
diff -c -r1.678 ChangeLog
*** etc/ChangeLog	8 Feb 2008 08:57:40 -0000	1.678
--- etc/ChangeLog	10 Feb 2008 19:14:54 -0000
***************
*** 1,3 ****
--- 1,7 ----
+ 2008-02-10  Daiki Ueno  <ueno@unixuser.org>
+ 
+ 	* NEWS: Clarify EasyPG functionalities.
+ 
  2008-02-08  Jan Djärv  <jan.h.d@swipnet.se>
  
  	* NEWS: Mention XEmbed and --parent-id.
Index: etc/NEWS
===================================================================
RCS file: /sources/emacs/emacs/etc/NEWS,v
retrieving revision 1.1652
diff -c -r1.1652 NEWS
*** etc/NEWS	10 Feb 2008 02:06:57 -0000	1.1652
--- etc/NEWS	10 Feb 2008 19:14:55 -0000
***************
*** 242,254 ****
  inter-process communication mechanism for applications residing on the
  same host, based on messages.  See the manual for further details.
  
! ** EasyPG is now part of the Emacs distribution.
! EasyPG is an all-in-one GnuPG interface for Emacs. It consists of two
! parts: EasyPG Assistant and EasyPG Library.
! 
! EasyPG Assistant is a set of convenient tools to use GnuPG from
! Emacs. EasyPG Library is a sort of an elisp port of GPGME, a wrapper
! library which provides API to access some of the GnuPG functions.
  \f
  * Changes in Specialized Modes and Packages in Emacs 23.1
  
--- 242,251 ----
  inter-process communication mechanism for applications residing on the
  same host, based on messages.  See the manual for further details.
  
! ** EasyPG is now part of the Emacs distribution.  It is an all-in-one
! GnuPG interface which includes GnuPG keyring browser, cryptographic
! operations on regions and files, and automatic encryption of *.gpg
! files.  See the EasyPG Assistant User's Manual for further details.
  \f
  * Changes in Specialized Modes and Packages in Emacs 23.1
  
Index: lisp/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.12750
diff -c -r1.12750 ChangeLog
*** lisp/ChangeLog	10 Feb 2008 18:38:05 -0000	1.12750
--- lisp/ChangeLog	10 Feb 2008 19:14:58 -0000
***************
*** 1,3 ****
--- 1,23 ----
+ 2008-02-10  Daiki Ueno  <ueno@unixuser.org>
+ 
+ 	* epg-config.el: Expand the contents of epg-package-info.el.
+ 	(epg-package-name): New constant.
+ 	(epg-version-number): New constant.
+ 	(epg-bug-report-address): New constant.
+ 
+ 	* epa-mail.el (epa-mail-mode): Add autoload cookie.
+ 	(epa-mail-minor-mode): New global minor mode.
+ 
+ 	* epa-file.el (epa-file-mode): New global minor mode.
+ 
+ 	* epa-dired.el (epa-dired-mode): New global minor mode.
+ 
+ 	* epa.el (epa-menu): New variable.
+ 	(epa-menu-items): New variable.
+ 	(epa-menu-mode): New global minor mode.
+ 	(epa-global-minor-modes): New user option.
+ 	(epa-mode): New global minor mode.
+ 
  2008-02-10  Dan Nicolaescu  <dann@ics.uci.edu>
  
  	* diff-mode.el (diff-add-change-log-entries-other-window): Use
Index: lisp/epa-dired.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/epa-dired.el,v
retrieving revision 1.3
diff -c -r1.3 epa-dired.el
*** lisp/epa-dired.el	9 Feb 2008 02:29:01 -0000	1.3
--- lisp/epa-dired.el	10 Feb 2008 19:14:58 -0000
***************
*** 82,87 ****
--- 82,95 ----
        (setq file-list (cdr file-list)))
      (revert-buffer)))
  
+ ;;;###autoload
+ (define-minor-mode epa-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)))
+ 
  (provide 'epa-dired)
  
  ;; arch-tag: 2025700b-48d0-4684-bc94-228ad1f8e9ff
Index: lisp/epa-file.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/epa-file.el,v
retrieving revision 1.3
diff -c -r1.3 epa-file.el
*** lisp/epa-file.el	9 Feb 2008 21:59:33 -0000	1.3
--- lisp/epa-file.el	10 Feb 2008 19:14:58 -0000
***************
*** 314,319 ****
--- 314,337 ----
  	(message "`epa-file' disabled"))
      (message "`epa-file' already disabled")))
  
+ ;;;###autoload
+ (define-minor-mode epa-file-mode
+   "Toggle automatic file encryption and decryption.
+ With prefix argument ARG, turn auto encryption on if positive, else off.
+ Return the new status of auto encryption (non-nil means on)."
+   :global t :init-value nil :group 'epa-file :version "23.1"
+   (setq file-name-handler-alist
+ 	(delq epa-file-handler file-name-handler-alist))
+   (remove-hook 'find-file-hooks 'epa-file-find-file-hook)
+   (setq auto-mode-alist (delq epa-file-auto-mode-alist-entry
+ 			      auto-mode-alist))
+   (when epa-file-mode
+     (setq file-name-handler-alist
+ 	  (cons epa-file-handler file-name-handler-alist))
+     (add-hook 'find-file-hooks 'epa-file-find-file-hook)
+     (setq auto-mode-alist (cons epa-file-auto-mode-alist-entry
+ 				auto-mode-alist))))
+ 
  (provide 'epa-file)
  
  ;; arch-tag: 5715152f-0eb1-4dbc-9008-07098775314d
Index: lisp/epa-mail.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/epa-mail.el,v
retrieving revision 1.2
diff -c -r1.2 epa-mail.el
*** lisp/epa-mail.el	9 Feb 2008 02:29:01 -0000	1.2
--- lisp/epa-mail.el	10 Feb 2008 19:14:58 -0000
***************
*** 40,45 ****
--- 40,46 ----
  (defvar epa-mail-mode-on-hook nil)
  (defvar epa-mail-mode-off-hook nil)
  
+ ;;;###autoload
  (define-minor-mode epa-mail-mode
    "A minor-mode for composing encrypted/clearsigned mails."
    nil " epa-mail" epa-mail-mode-map)
***************
*** 173,178 ****
--- 174,187 ----
    (interactive)
    (epa-import-armor-in-region (point-min) (point-max)))
  
+ ;;;###autoload
+ (define-minor-mode epa-mail-minor-mode
+   "Minor mode to hook EasyPG into Mail mode."
+   :global t :init-value nil :group 'epa-mail :version "23.1"
+   (remove-hook 'mail-mode-hook 'epa-mail-mode)
+   (if epa-mail-minor-mode
+       (add-hook 'mail-mode-hook 'epa-mail-mode)))
+ 
  (provide 'epa-mail)
  
  ;; arch-tag: a6f82b3f-d177-4a11-af95-040da55927d2
Index: lisp/epa.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/epa.el,v
retrieving revision 1.3
diff -c -r1.3 epa.el
*** lisp/epa.el	9 Feb 2008 21:59:33 -0000	1.3
--- lisp/epa.el	10 Feb 2008 19:14:58 -0000
***************
*** 45,50 ****
--- 45,58 ----
    :type 'integer
    :group 'epa)
  
+ (defcustom epa-global-minor-modes '(epa-dired-mode
+ 				    epa-file-mode
+ 				    epa-mail-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,234 ****
--- 237,280 ----
      (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
***************
*** 372,378 ****
  				     'end-open t))
  	  (widget-create 'epa-key :value (car keys))
  	  (insert "\n")
! 	  (setq keys (cdr keys))))      
        (add-text-properties (point-min) (point-max)
  			   (list 'epa-list-keys t
  				 'front-sticky nil
--- 418,424 ----
  				     'end-open t))
  	  (widget-create 'epa-key :value (car keys))
  	  (insert "\n")
! 	  (setq keys (cdr keys))))
        (add-text-properties (point-min) (point-max)
  			   (list 'epa-list-keys t
  				 'front-sticky nil
***************
*** 1173,1178 ****
--- 1219,1250 ----
  ;;     (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
Index: lisp/epg-config.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/epg-config.el,v
retrieving revision 1.3
diff -c -r1.3 epg-config.el
*** lisp/epg-config.el	9 Feb 2008 21:59:33 -0000	1.3
--- lisp/epg-config.el	10 Feb 2008 19:14:58 -0000
***************
*** 23,29 ****
  
  ;;; Code:
  
! (require 'epg-package-info)
  
  (defgroup epg ()
    "The EasyPG Library"
--- 23,36 ----
  
  ;;; Code:
  
! (defconst epg-package-name "epg"
!   "Name of this package.")
! 
! (defconst epg-version-number "1.0.0"
!   "Version number of this package.")
! 
! (defconst epg-bug-report-address "ueno@unixuser.org"
!   "Report bugs to this address.")
  
  (defgroup epg ()
    "The EasyPG Library"
Index: lisp/epg.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/epg.el,v
retrieving revision 1.2
diff -c -r1.2 epg.el
*** lisp/epg.el	9 Feb 2008 02:29:02 -0000	1.2
--- lisp/epg.el	10 Feb 2008 19:14:58 -0000
***************
*** 1430,1436 ****
         signature
         (string-to-number (match-string 4 string)))
        (epg-signature-set-pubkey-algorithm
!        signature 
         (string-to-number (match-string 5 string)))
        (epg-signature-set-digest-algorithm
         signature
--- 1430,1436 ----
         signature
         (string-to-number (match-string 4 string)))
        (epg-signature-set-pubkey-algorithm
!        signature
         (string-to-number (match-string 5 string)))
        (epg-signature-set-digest-algorithm
         signature
***************
*** 1744,1750 ****
  (defun epg-list-keys (context &optional name mode)
    "Return a list of epg-key objects matched with NAME.
  If MODE is nil or 'public, only public keyring should be searched.
! If MODE is t or 'secret, only secret keyring should be searched. 
  Otherwise, only public keyring should be searched and the key
  signatures should be included.
  NAME is either a string or a list of strings."
--- 1744,1750 ----
  (defun epg-list-keys (context &optional name mode)
    "Return a list of epg-key objects matched with NAME.
  If MODE is nil or 'public, only public keyring should be searched.
! If MODE is t or 'secret, only secret keyring should be searched.
  Otherwise, only public keyring should be searched and the key
  signatures should be included.
  NAME is either a string or a list of strings."


Regards,
-- 
Daiki Ueno




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-10 19:15       ` Daiki Ueno
@ 2008-02-10 19:30         ` Daiki Ueno
  2008-02-10 20:58           ` Michael Olson
  2008-02-10 19:46         ` Stefan Monnier
  2008-02-10 22:36         ` Dan Nicolaescu
  2 siblings, 1 reply; 44+ messages in thread
From: Daiki Ueno @ 2008-02-10 19:30 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Michael Olson, emacs-devel

Daiki Ueno <ueno@unixuser.org> writes:

> Anyway, here is an up-to-date patch.

Sorry, there was a typo.

> *** lisp/epa.el	9 Feb 2008 21:59:33 -0000	1.3
> --- lisp/epa.el	10 Feb 2008 19:14:58 -0000
> ***************
> *** 45,50 ****
> --- 45,58 ----
>     :type 'integer
>     :group 'epa)
>   
> + (defcustom epa-global-minor-modes '(epa-dired-mode
> + 				    epa-file-mode
> + 				    epa-mail-mode

s/epa-mail-mode/epa-mail-minor-mode/

Regards,
-- 
Daiki Ueno




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-10 19:15       ` Daiki Ueno
  2008-02-10 19:30         ` Daiki Ueno
@ 2008-02-10 19:46         ` Stefan Monnier
  2008-02-10 22:36         ` Dan Nicolaescu
  2 siblings, 0 replies; 44+ messages in thread
From: Stefan Monnier @ 2008-02-10 19:46 UTC (permalink / raw)
  To: Daiki Ueno; +Cc: Michael Olson, emacs-devel

> Wow, it also greatly simplifies the code.  Thanks for the suggestion.
> However, if there is already a (local) minor mode called epa-mail-mode,
> what is a good name for global minor mode?

I'd choice something like epa-auto-mail-mode, epa-global-mail-mode,
epa-mail-auto-mode, epa-mail-global-mode, or global-epa-mail-mode.
Or rename the other to epa-mail-local-mode, depending on the specifics.


        Stefan




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-10 19:30         ` Daiki Ueno
@ 2008-02-10 20:58           ` Michael Olson
  2008-02-10 21:29             ` Daiki Ueno
  0 siblings, 1 reply; 44+ messages in thread
From: Michael Olson @ 2008-02-10 20:58 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 429 bytes --]

Daiki Ueno <ueno@unixuser.org> writes:

> Daiki Ueno <ueno@unixuser.org> writes:
>
>> Anyway, here is an up-to-date patch.
>
> Sorry, there was a typo.

Applied, with typo fix.

-- 
|       Michael Olson  |  FSF Associate Member #652     |
| http://mwolson.org/  |  Hobbies: Lisp, HCoop          |
| Projects: Emacs, Muse, ERC, EMMS, ErBot, DVC, Planner |
`-------------------------------------------------------'

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-10 20:58           ` Michael Olson
@ 2008-02-10 21:29             ` Daiki Ueno
  2008-02-11  0:03               ` Michael Olson
  0 siblings, 1 reply; 44+ messages in thread
From: Daiki Ueno @ 2008-02-10 21:29 UTC (permalink / raw)
  To: Michael Olson; +Cc: emacs-devel

Michael Olson <mwolson@gnu.org> writes:

> Applied, with typo fix.

Thanks.  And sorry for bothering you again and again, could you rename
epa-mail-minor-mode with epa-global-mail-mode (from Stefan's choices)?
Here is a patch.

Index: lisp/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.12752
diff -c -r1.12752 ChangeLog
*** lisp/ChangeLog	10 Feb 2008 20:57:45 -0000	1.12752
--- lisp/ChangeLog	10 Feb 2008 21:18:33 -0000
***************
*** 6,12 ****
  	(epg-bug-report-address): New constant.
  
  	* epa-mail.el (epa-mail-mode): Add autoload cookie.
! 	(epa-mail-minor-mode): New global minor mode.
  
  	* epa-file.el (epa-file-mode): New global minor mode.
  
--- 6,12 ----
  	(epg-bug-report-address): New constant.
  
  	* epa-mail.el (epa-mail-mode): Add autoload cookie.
! 	(epa-global-mail-mode): New global minor mode.
  
  	* epa-file.el (epa-file-mode): New global minor mode.
  
Index: lisp/epa-mail.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/epa-mail.el,v
retrieving revision 1.3
diff -c -r1.3 epa-mail.el
*** lisp/epa-mail.el	10 Feb 2008 20:57:47 -0000	1.3
--- lisp/epa-mail.el	10 Feb 2008 21:18:34 -0000
***************
*** 175,185 ****
    (epa-import-armor-in-region (point-min) (point-max)))
  
  ;;;###autoload
! (define-minor-mode epa-mail-minor-mode
    "Minor mode to hook EasyPG into Mail mode."
    :global t :init-value nil :group 'epa-mail :version "23.1"
    (remove-hook 'mail-mode-hook 'epa-mail-mode)
!   (if epa-mail-minor-mode
        (add-hook 'mail-mode-hook 'epa-mail-mode)))
  
  (provide 'epa-mail)
--- 175,185 ----
    (epa-import-armor-in-region (point-min) (point-max)))
  
  ;;;###autoload
! (define-minor-mode epa-global-mail-mode
    "Minor mode to hook EasyPG into Mail mode."
    :global t :init-value nil :group 'epa-mail :version "23.1"
    (remove-hook 'mail-mode-hook 'epa-mail-mode)
!   (if epa-global-mail-mode
        (add-hook 'mail-mode-hook 'epa-mail-mode)))
  
  (provide 'epa-mail)
Index: lisp/epa.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/epa.el,v
retrieving revision 1.4
diff -c -r1.4 epa.el
*** lisp/epa.el	10 Feb 2008 20:57:47 -0000	1.4
--- lisp/epa.el	10 Feb 2008 21:18:34 -0000
***************
*** 47,53 ****
  
  (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)
--- 47,53 ----
  
  (defcustom epa-global-minor-modes '(epa-dired-mode
  				    epa-file-mode
! 				    epa-global-mail-mode
  				    epa-menu-mode)
    "Globally defined minor modes to hook into other modes."
    :type '(repeat symbol)

Regards,
-- 
Daiki Ueno




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-10 19:15       ` Daiki Ueno
  2008-02-10 19:30         ` Daiki Ueno
  2008-02-10 19:46         ` Stefan Monnier
@ 2008-02-10 22:36         ` Dan Nicolaescu
  2008-02-10 23:34           ` Daiki Ueno
  2 siblings, 1 reply; 44+ messages in thread
From: Dan Nicolaescu @ 2008-02-10 22:36 UTC (permalink / raw)
  To: Daiki Ueno; +Cc: Michael Olson, Stefan Monnier, emacs-devel

Daiki Ueno <ueno@unixuser.org> writes:


  > ! @c To install, just follow the standard CMMI installation instructions.

CMMI?


  > ! @c @cartouche
  > ! @c @example
  > ! @c $ ./configure
  > ! @c $ sudo make install
  > ! @c @end example
  > ! @c @end cartouche

Not needed given that it's installed by default now.

  > ! @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)

Is this still needed now that epa is part of emacs?
If yes, can't it be done with customize instead of editing .emacs?
Ideally the user should have to do nothing by default...



  >   @end lisp
  >   @end cartouche
  >   
  >   @noindent
  > ! Restart emacs and type @kbd{M-x epa- @key{TAB}}, 


  > and you will see a lot of commands available.
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Omit, not very useful information for a user.

+ (defconst epa-menu-items
+   '("EasyPG Assistant"

Please replace this with something more obvious to someone that does not
know what "EasyPG Assistant" is.  Maybe something like "Encryption/Decryption"? 


  > + ;;;###autoload
  > + (define-minor-mode epa-menu-mode
  > +   "Minor mode to hook EasyPG into the menu-bar."

Isn't this overkill, a global minor mode just to hook into the menu-bar?

Hope this helps...




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-10 22:36         ` Dan Nicolaescu
@ 2008-02-10 23:34           ` Daiki Ueno
  2008-02-11  6:30             ` Daiki Ueno
  0 siblings, 1 reply; 44+ messages in thread
From: Daiki Ueno @ 2008-02-10 23:34 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: Michael Olson, Stefan Monnier, emacs-devel

2008/2/11, Dan Nicolaescu <dann@ics.uci.edu>:

>   > ! @c @cartouche
>   > ! @c @example
>   > ! @c $ ./configure
>   > ! @c $ sudo make install
>   > ! @c @end example
>   > ! @c @end cartouche
>
> Not needed given that it's installed by default now.

So, they are commented.  I thought that it makes easy to maintain the
external EasyPG package (I looked at tramp.texi for reference), but I
have no strong opinion to leave them.  .

>   > ! @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)
>
> Is this still needed now that epa is part of emacs?

> If yes, can't it be done with customize instead of editing .emacs?
> Ideally the user should have to do nothing by default...

Totally agreed.  I'll give some thought.

> + (defconst epa-menu-items
> +   '("EasyPG Assistant"
>
> Please replace this with something more obvious to someone that does not
> know what "EasyPG Assistant" is.  Maybe something like "Encryption/Decryption"?

I didn't know the convention of menu labels.  If it is okay to have
generic labels, I'd rather prefer them.  Me too thought of some labels
like "Cryptography" and "GnuPG", but I chose the most specific one.

>   > + ;;;###autoload
>   > + (define-minor-mode epa-menu-mode
>   > +   "Minor mode to hook EasyPG into the menu-bar."
>
> Isn't this overkill, a global minor mode just to hook into the menu-bar?

I worried about someone will not like the "Tools" menu being too high.

Regards,
-- 
Daiki Ueno




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-10 21:29             ` Daiki Ueno
@ 2008-02-11  0:03               ` Michael Olson
  0 siblings, 0 replies; 44+ messages in thread
From: Michael Olson @ 2008-02-11  0:03 UTC (permalink / raw)
  To: Daiki Ueno; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 564 bytes --]

Daiki Ueno <ueno@unixuser.org> writes:

> Michael Olson <mwolson@gnu.org> writes:
>
>> Applied, with typo fix.
>
> Thanks.  And sorry for bothering you again and again, could you rename
> epa-mail-minor-mode with epa-global-mail-mode (from Stefan's choices)?
> Here is a patch.

Not a problem.  Patch applied.

-- 
|       Michael Olson  |  FSF Associate Member #652     |
| http://mwolson.org/  |  Hobbies: Lisp, HCoop          |
| Projects: Emacs, Muse, ERC, EMMS, ErBot, DVC, Planner |
`-------------------------------------------------------'

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-10 23:34           ` Daiki Ueno
@ 2008-02-11  6:30             ` Daiki Ueno
  2008-02-12  1:24               ` Michael Olson
  2008-02-12  3:48               ` Dan Nicolaescu
  0 siblings, 2 replies; 44+ messages in thread
From: Daiki Ueno @ 2008-02-11  6:30 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: Michael Olson, Stefan Monnier, emacs-devel

Here is up-to-date patch.  It does:

- remove the installation instruction from epa.texi at all,
- rename the menu label "EasyPG Assistant" to "Encryption/Decryption",
- merge epa-menu-mode into epa-mode, and
- define a minor mode for dired instead of directly modifying the keymap.

Thanks Dan for the suggestions.

Index: lisp/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.12763
diff -c -r1.12763 ChangeLog
*** lisp/ChangeLog	11 Feb 2008 04:11:00 -0000	1.12763
--- lisp/ChangeLog	11 Feb 2008 06:21:19 -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  Glenn Morris  <rgm@gnu.org>
  
  	* progmodes/compile.el (compilation-error-regexp-alist-alist):
Index: lisp/epa-dired.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/epa-dired.el,v
retrieving revision 1.4
diff -c -r1.4 epa-dired.el
*** lisp/epa-dired.el	10 Feb 2008 20:57:46 -0000	1.4
--- lisp/epa-dired.el	11 Feb 2008 06:21:19 -0000
***************
*** 26,43 ****
  (require 'epa)
  (require 'dired)
  
! (defvar epa-dired-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)
      keymap))
  
! (fset 'epa-dired-prefix epa-dired-map)
  
! (defun epa-dired-mode-hook ()
!   (define-key dired-mode-map ":" 'epa-dired-prefix))
  
  (defun epa-dired-do-decrypt ()
    "Decrypt marked files."
--- 26,47 ----
  (require 'epa)
  (require 'dired)
  
! (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)
      keymap))
  
! (defvar epa-dired-mode-hook nil)
! (defvar epa-dired-mode-on-hook nil)
! (defvar epa-dired-mode-off-hook nil)
  
! ;;;###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,94 ****
      (revert-buffer)))
  
  ;;;###autoload
! (define-minor-mode epa-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)))
  
  (provide 'epa-dired)
  
--- 87,98 ----
      (revert-buffer)))
  
  ;;;###autoload
! (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)
!   (if epa-global-dired-mode
!       (add-hook 'dired-mode-hook 'epa-dired-mode)))
  
  (provide 'epa-dired)
  
Index: lisp/epa.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/epa.el,v
retrieving revision 1.5
diff -c -r1.5 epa.el
*** lisp/epa.el	10 Feb 2008 21:59:27 -0000	1.5
--- lisp/epa.el	11 Feb 2008 06:21:19 -0000
***************
*** 45,54 ****
    :type 'integer
    :group 'epa)
  
! (defcustom epa-global-minor-modes '(epa-dired-mode
! 				    epa-file-mode
  				    epa-global-mail-mode
! 				    epa-menu-mode)
    "Globally defined minor modes to hook into other modes."
    :type '(repeat symbol)
    :group 'epa)
--- 45,53 ----
    :type 'integer
    :group 'epa)
  
! (defcustom epa-global-minor-modes '(epa-global-dired-mode
  				    epa-global-mail-mode
! 				    epa-file-mode)
    "Globally defined minor modes to hook into other modes."
    :type '(repeat symbol)
    :group 'epa)
***************
*** 240,246 ****
  (defvar epa-menu nil)
  
  (defconst epa-menu-items
!   '("EasyPG Assistant"
      ("Decrypt"
       ["File" epa-decrypt-file
        :help "Decrypt a file"]
--- 239,245 ----
  (defvar epa-menu nil)
  
  (defconst epa-menu-items
!   '("Encryption/Decryption"
      ("Decrypt"
       ["File" epa-decrypt-file
        :help "Decrypt a file"]
***************
*** 1220,1247 ****
  ;; (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)))))
  
--- 1219,1241 ----
  ;; (make-obsolete 'epa-sign-keys "Do not use.")
  
  ;;;###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"
+   (unless epa-menu
+     (easy-menu-define epa-menu nil "EasyPG Assistant global menu"
+       epa-menu-items))
+   (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 epa-mode)
  	(message "`%S' not found" (car modes)))
        (setq modes (cdr modes)))))
  
Index: doc/misc/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/doc/misc/ChangeLog,v
retrieving revision 1.91
diff -c -r1.91 ChangeLog
*** doc/misc/ChangeLog	10 Feb 2008 20:57:44 -0000	1.91
--- doc/misc/ChangeLog	11 Feb 2008 06:21:19 -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
Index: doc/misc/epa.texi
===================================================================
RCS file: /sources/emacs/emacs/doc/misc/epa.texi,v
retrieving revision 1.3
diff -c -r1.3 epa.texi
*** doc/misc/epa.texi	10 Feb 2008 20:57:44 -0000	1.3
--- doc/misc/epa.texi	11 Feb 2008 06:21:19 -0000
***************
*** 77,112 ****
  @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,
  
  @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}
  @end itemize
  
  @node Commands
  @chapter Commands
  
--- 77,99 ----
  @node  Quick start
  @chapter Quick start
  
! 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
  
Regards,
-- 
Daiki Ueno




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-11  6:30             ` Daiki Ueno
@ 2008-02-12  1:24               ` Michael Olson
  2008-02-12  3:48               ` Dan Nicolaescu
  1 sibling, 0 replies; 44+ messages in thread
From: Michael Olson @ 2008-02-12  1:24 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 608 bytes --]

Daiki Ueno <ueno@unixuser.org> writes:

> Here is up-to-date patch.  It does:
>
> - remove the installation instruction from epa.texi at all,
> - rename the menu label "EasyPG Assistant" to "Encryption/Decryption",
> - merge epa-menu-mode into epa-mode, and
> - define a minor mode for dired instead of directly modifying the
>   keymap.

Patch applied.

-- 
|       Michael Olson  |  FSF Associate Member #652     |
| http://mwolson.org/  |  Hobbies: Lisp, HCoop          |
| Projects: Emacs, Muse, ERC, EMMS, ErBot, DVC, Planner |
`-------------------------------------------------------'

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-11  6:30             ` Daiki Ueno
  2008-02-12  1:24               ` Michael Olson
@ 2008-02-12  3:48               ` Dan Nicolaescu
  2008-02-12  6:04                 ` Daiki Ueno
  2008-02-12 17:45                 ` Richard Stallman
  1 sibling, 2 replies; 44+ messages in thread
From: Dan Nicolaescu @ 2008-02-12  3:48 UTC (permalink / raw)
  To: Daiki Ueno; +Cc: Michael Olson, Stefan Monnier, emacs-devel

Daiki Ueno <ueno@unixuser.org> writes:

  >   
  >   ;;;###autoload
  > ! (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)
  > !   (if epa-global-dired-mode
  > !       (add-hook 'dired-mode-hook 'epa-dired-mode)))

This mode only adds key bindings, right? Then why not add the key
bindings directly to dired?
(And menu entries for 4 operations to the dired "Operate" 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"
  > +   (unless epa-menu
  > +     (easy-menu-define epa-menu nil "EasyPG Assistant global menu"
  > +       epa-menu-items))

Can't these menus be added unconditionally?  This seems like good
functionality to have (and it would simplify the code too).  
Why not ask RMS for permission?

Also ask RMS about having .gpg automatically decrypted.  This is analog
to what we do for compressed files... (This would simplify the code and
also the documentation). 

For the docs:


    @node Key management
    @section Key management
    Probably the first step of using EasyPG Assistant is to browse your
    keyring.  @kbd{M-x epa-list-keys} is corresponding to @samp{gpg

IMHO the first step would be to create the keyring.

Hope this helps.

          --dan




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-12  3:48               ` Dan Nicolaescu
@ 2008-02-12  6:04                 ` Daiki Ueno
  2008-02-12 17:45                 ` Richard Stallman
  1 sibling, 0 replies; 44+ messages in thread
From: Daiki Ueno @ 2008-02-12  6:04 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: Michael Olson, Stefan Monnier, emacs-devel

2008/2/12, Dan Nicolaescu <dann@ics.uci.edu>:

> Can't these menus be added unconditionally?  This seems like good
> functionality to have (and it would simplify the code too).
> Why not ask RMS for permission?
>
> Also ask RMS about having .gpg automatically decrypted.  This is analog
> to what we do for compressed files... (This would simplify the code and
> also the documentation).

Thanks for the comments.  I'll ask him and the list, since I have been
still worried about the threshold between intrusive vs. non-intrusive
features...

>     Probably the first step of using EasyPG Assistant is to browse your
>     keyring.  @kbd{M-x epa-list-keys} is corresponding to @samp{gpg
>
> IMHO the first step would be to create the keyring.

The empty keyring is automatically created by epa-list-keys (gpg
--list-keys).  So I think the missing feature is an interactive
key-generation command in epa-key-list-mode.  (The API functions
epg-generate-key-from-* are already there but some work is needed to
implement the command).

Regards,
-- 
Daiki Ueno




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-12  3:48               ` Dan Nicolaescu
  2008-02-12  6:04                 ` Daiki Ueno
@ 2008-02-12 17:45                 ` Richard Stallman
  2008-02-13 17:28                   ` Dan Nicolaescu
  1 sibling, 1 reply; 44+ messages in thread
From: Richard Stallman @ 2008-02-12 17:45 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: ueno, mwolson, monnier, emacs-devel

    Also ask RMS about having .gpg automatically decrypted.

What exactly is the question?




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-12 17:45                 ` Richard Stallman
@ 2008-02-13 17:28                   ` Dan Nicolaescu
  2008-02-14  4:43                     ` Richard Stallman
  0 siblings, 1 reply; 44+ messages in thread
From: Dan Nicolaescu @ 2008-02-13 17:28 UTC (permalink / raw)
  To: rms; +Cc: ueno, mwolson, monnier, emacs-devel

Richard Stallman <rms@gnu.org> writes:

  >     Also ask RMS about having .gpg automatically decrypted.
  > 
  > What exactly is the question?

- allow files with a .gpg suffix to be automatically
  encrypted/decrypted, similar to what we do for .gz files now
  (this depends on a minor-mode being turned on now)
- add an "Encryption/Decryption" menu entry to the "Tools" menu
  (this depends on a minor-mode being turned on now)
- add key bindings and menu entries to dired-mode to
  encrypt/decrypt/sign/verify files
  (this depends on a minor-mode being turned on now)

All these are operations that are useful, we should make it easier for
the user to use them by default without having to fiddle with minor
modes.




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-13 17:28                   ` Dan Nicolaescu
@ 2008-02-14  4:43                     ` Richard Stallman
  2008-02-14 11:26                       ` Daiki Ueno
  0 siblings, 1 reply; 44+ messages in thread
From: Richard Stallman @ 2008-02-14  4:43 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: ueno, mwolson, monnier, emacs-devel

    - allow files with a .gpg suffix to be automatically
      encrypted/decrypted, similar to what we do for .gz files now
      (this depends on a minor-mode being turned on now)

How can that work?  You need to give the key each time you decrypt.

    - add an "Encryption/Decryption" menu entry to the "Tools" menu
      (this depends on a minor-mode being turned on now)

I see no harm in that.

    - add key bindings and menu entries to dired-mode to
      encrypt/decrypt/sign/verify files
      (this depends on a minor-mode being turned on now)

I see no harm in that.




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-14  4:43                     ` Richard Stallman
@ 2008-02-14 11:26                       ` Daiki Ueno
  2008-02-14 15:37                         ` Sascha Wilde
                                           ` (2 more replies)
  0 siblings, 3 replies; 44+ messages in thread
From: Daiki Ueno @ 2008-02-14 11:26 UTC (permalink / raw)
  To: rms; +Cc: Dan Nicolaescu, mwolson, monnier, emacs-devel

2008/2/14, Richard Stallman <rms@gnu.org>:
>     - allow files with a .gpg suffix to be automatically
>       encrypted/decrypted, similar to what we do for .gz files now
>       (this depends on a minor-mode being turned on now)
>
> How can that work?  You need to give the key each time you decrypt.

(I guess that you mean "encrypt" rather than "decrypt").
In that case, a new buffer will show up to prompt the user to select
recipients' keys.
This happens only the first time when .gpg file is created (or the
user changes some encryption related parameters for the file).

>     - add an "Encryption/Decryption" menu entry to the "Tools" menu
>       (this depends on a minor-mode being turned on now)
>
> I see no harm in that.
>
>     - add key bindings and menu entries to dired-mode to
>       encrypt/decrypt/sign/verify files
>       (this depends on a minor-mode being turned on now)
>
> I see no harm in that.

Okay, I'll prepare a patch to do these this weekend.

Regards,
-- 
Daiki Ueno




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-14 11:26                       ` Daiki Ueno
@ 2008-02-14 15:37                         ` Sascha Wilde
  2008-02-14 18:43                           ` Daiki Ueno
  2008-02-15  0:02                         ` Richard Stallman
  2008-02-18  8:55                         ` auto-encryption-mode, etc. (Re: " Daiki Ueno
  2 siblings, 1 reply; 44+ messages in thread
From: Sascha Wilde @ 2008-02-14 15:37 UTC (permalink / raw)
  To: Daiki Ueno; +Cc: emacs-devel, Dan Nicolaescu, mwolson, rms, monnier

"Daiki Ueno" <ueno@unixuser.org> wrote:

> 2008/2/14, Richard Stallman <rms@gnu.org>:
>>     - allow files with a .gpg suffix to be automatically
>>       encrypted/decrypted, similar to what we do for .gz files now
>>       (this depends on a minor-mode being turned on now)
>>
>> How can that work?  You need to give the key each time you decrypt.
>
> (I guess that you mean "encrypt" rather than "decrypt").
> In that case, a new buffer will show up to prompt the user to select
> recipients' keys.
> This happens only the first time when .gpg file is created (or the
> user changes some encryption related parameters for the file).

How secure will this feature be?  A file that is encrypted should never
be automatically or unintentionally saved unencrypted.  So whats about
backup and auto-save files and the like?

cheers
sascha
-- 
Sascha Wilde
God put me on earth to accomplish a certain number of things.
Right now I am so far behind I will never die.
                       -- Bill Waterson, Calvin and Hobbes




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-14 15:37                         ` Sascha Wilde
@ 2008-02-14 18:43                           ` Daiki Ueno
  2008-02-15 10:07                             ` Sascha Wilde
  0 siblings, 1 reply; 44+ messages in thread
From: Daiki Ueno @ 2008-02-14 18:43 UTC (permalink / raw)
  To: Sascha Wilde; +Cc: Dan Nicolaescu, mwolson, rms, monnier, emacs-devel

2008/2/15, Sascha Wilde <wilde@sha-bang.de>:
> "Daiki Ueno" <ueno@unixuser.org> wrote:
>
>  > 2008/2/14, Richard Stallman <rms@gnu.org>:
>  >>     - allow files with a .gpg suffix to be automatically
>  >>       encrypted/decrypted, similar to what we do for .gz files now
>  >>       (this depends on a minor-mode being turned on now)
>  >>
>  >> How can that work?  You need to give the key each time you decrypt.
>  >
>  > (I guess that you mean "encrypt" rather than "decrypt").
>  > In that case, a new buffer will show up to prompt the user to select
>  > recipients' keys.
>  > This happens only the first time when .gpg file is created (or the
>  > user changes some encryption related parameters for the file).
>
> How secure will this feature be?  A file that is encrypted should never
>  be automatically or unintentionally saved unencrypted.  So whats about
>  backup and auto-save files and the like?

Backup files are subject to be encrypted, and auto-save is disabled by default.

Regards,
-- 
Daiki Ueno




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-14 11:26                       ` Daiki Ueno
  2008-02-14 15:37                         ` Sascha Wilde
@ 2008-02-15  0:02                         ` Richard Stallman
  2008-02-15  2:20                           ` Daiki Ueno
  2008-02-18  8:55                         ` auto-encryption-mode, etc. (Re: " Daiki Ueno
  2 siblings, 1 reply; 44+ messages in thread
From: Richard Stallman @ 2008-02-15  0:02 UTC (permalink / raw)
  To: Daiki Ueno; +Cc: dann, mwolson, monnier, emacs-devel

    > How can that work?  You need to give the key each time you decrypt.

    (I guess that you mean "encrypt" rather than "decrypt").

I should have said "give your passphrase".  That's needed for
decryption.




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-15  0:02                         ` Richard Stallman
@ 2008-02-15  2:20                           ` Daiki Ueno
  0 siblings, 0 replies; 44+ messages in thread
From: Daiki Ueno @ 2008-02-15  2:20 UTC (permalink / raw)
  To: rms; +Cc: dann, mwolson, monnier, emacs-devel

2008/2/15, Richard Stallman <rms@gnu.org>:
>     > How can that work?  You need to give the key each time you decrypt.
>
>     (I guess that you mean "encrypt" rather than "decrypt").
>
> I should have said "give your passphrase".  That's needed for
>  decryption.

That depends on situations (reading or writing, symmetric encryption
or public key encryption, and gpg-agent is running or not).  I believe
the current behavior reasonable enough and intuitive for users.  Here
is the accurate logic in pseudo code.

When reading:

If the file is encrypted in symmetric encryption
  If gpg-agent is running
    use gpg-agent; gpg is able to by-pass the interaction with Emacs,
    and it will directly ask the user with pinentry.  gpg-agent doesn't
    cache passphrase for symmetric encryption in this case.
  Else
    the user will be prompted for passphrase from the minibuffer.  The
    passphrase may be cached if certain variable is set.
  End
Else
  If gpg-agent is running
    use gpg-agent.  gpg-agent may cache the passphrase in this case.
  Else
    the user will be prompted for passphrase from the minibuffer.  The
    passphrase will never be cached.
  End
End

When writing:

If the file is being created
  ask user how to encrypt the content
Else
  inherit the encryption parameters of the file
End

If the user select symmetric encryption
  the same behavior with the reading case, except that passphrase will
  be prompted twice for confirmation.
Else
  the same behavior with the reading case
End
-- 
Daiki Ueno




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-14 18:43                           ` Daiki Ueno
@ 2008-02-15 10:07                             ` Sascha Wilde
  2008-02-15 17:05                               ` Daiki Ueno
  2008-02-16  5:53                               ` Richard Stallman
  0 siblings, 2 replies; 44+ messages in thread
From: Sascha Wilde @ 2008-02-15 10:07 UTC (permalink / raw)
  To: Daiki Ueno; +Cc: Dan Nicolaescu, mwolson, rms, monnier, emacs-devel

"Daiki Ueno" <ueno@unixuser.org> wrote:

> 2008/2/15, Sascha Wilde <wilde@sha-bang.de>:
>> "Daiki Ueno" <ueno@unixuser.org> wrote:
>>
>>  > 2008/2/14, Richard Stallman <rms@gnu.org>:
>>  >>     - allow files with a .gpg suffix to be automatically
>>  >>       encrypted/decrypted, similar to what we do for .gz files now
>>  >>       (this depends on a minor-mode being turned on now)
>>  >>
>>  >> How can that work?  You need to give the key each time you decrypt.
>>  >
>>  > (I guess that you mean "encrypt" rather than "decrypt").
>>  > In that case, a new buffer will show up to prompt the user to select
>>  > recipients' keys.
>>  > This happens only the first time when .gpg file is created (or the
>>  > user changes some encryption related parameters for the file).
>>
>> How secure will this feature be?  A file that is encrypted should never
>>  be automatically or unintentionally saved unencrypted.  So whats about
>>  backup and auto-save files and the like?
>
> Backup files are subject to be encrypted, and auto-save is disabled by default.

Sounds good.  I really do like the new EasyPG stuff.  :-)

There is still the problem, that one can't prevent Emacs from swapping
out the content of such an buffer -- but that's a more generic problem
(which was discussed briefly in an earlier thread IIRC).

cheers
sascha
-- 
Sascha Wilde : xedit? Das sieht zwar wie vi aus als könne es nix, aber im
             : Gegensatz zu vi kann es wirklich nix und nix ist noch geschönt!
             : (Michael Core in dafc)




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-15 10:07                             ` Sascha Wilde
@ 2008-02-15 17:05                               ` Daiki Ueno
  2008-02-15 18:34                                 ` Sascha Wilde
  2008-02-16  5:53                               ` Richard Stallman
  1 sibling, 1 reply; 44+ messages in thread
From: Daiki Ueno @ 2008-02-15 17:05 UTC (permalink / raw)
  To: Sascha Wilde; +Cc: Dan Nicolaescu, mwolson, rms, monnier, emacs-devel

2008/2/15, Sascha Wilde <wilde@sha-bang.de>:
>  There is still the problem, that one can't prevent Emacs from swapping
>  out the content of such an buffer -- but that's a more generic problem
>  (which was discussed briefly in an earlier thread IIRC).

Of course.  However, I think that it is a reasonable trade-off between
security and usability.  If it is a real problem, every program
(outside Emacs) which interacts with GnuPG has the same problem unless
it does mprotect(2) decrypted content by themselves, which requires
root privilege at all times.

IMHO, there is the order of priority of credentials.  That is:

public key encryption passphrases > symmetric encryption passphrases >
decrypted contents

I think the first two should always be protected, but for the last
one, the way of protection is application dependent.

Regards,
-- 
Daiki Ueno




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-15 17:05                               ` Daiki Ueno
@ 2008-02-15 18:34                                 ` Sascha Wilde
  0 siblings, 0 replies; 44+ messages in thread
From: Sascha Wilde @ 2008-02-15 18:34 UTC (permalink / raw)
  To: Daiki Ueno; +Cc: Dan Nicolaescu, mwolson, rms, monnier, emacs-devel

"Daiki Ueno" <ueno@unixuser.org> wrote:
[...]
> IMHO, there is the order of priority of credentials.  That is:
>
> public key encryption passphrases > symmetric encryption passphrases >
> decrypted contents
>
> I think the first two should always be protected, but for the last
> one, the way of protection is application dependent.

Full Ack.

cheers
sascha
-- 
Sascha Wilde
Nota bene: wenn Word für Längeres geeignet wäre, würde es schließlich
nicht Word, sondern Sentence, Page oder Article heißen
 	-- Matthias Mühlich in dctt




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-15 10:07                             ` Sascha Wilde
  2008-02-15 17:05                               ` Daiki Ueno
@ 2008-02-16  5:53                               ` Richard Stallman
  2008-02-16 10:25                                 ` Jan Djärv
  1 sibling, 1 reply; 44+ messages in thread
From: Richard Stallman @ 2008-02-16  5:53 UTC (permalink / raw)
  To: Sascha Wilde; +Cc: dann, ueno, mwolson, monnier, emacs-devel

    There is still the problem, that one can't prevent Emacs from swapping
    out the content of such an buffer -- but that's a more generic problem
    (which was discussed briefly in an earlier thread IIRC).

Isn't there a way to tell the system not to swap out certain pages?




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-16  5:53                               ` Richard Stallman
@ 2008-02-16 10:25                                 ` Jan Djärv
  2008-02-16 11:16                                   ` Andreas Schwab
  2008-02-17 13:23                                   ` Richard Stallman
  0 siblings, 2 replies; 44+ messages in thread
From: Jan Djärv @ 2008-02-16 10:25 UTC (permalink / raw)
  To: rms; +Cc: mwolson, Sascha Wilde, ueno, emacs-devel, dann, monnier



Richard Stallman skrev:
>     There is still the problem, that one can't prevent Emacs from swapping
>     out the content of such an buffer -- but that's a more generic problem
>     (which was discussed briefly in an earlier thread IIRC).
> 
> Isn't there a way to tell the system not to swap out certain pages?
> 
> 

There is mlock(2).

	Jan D.




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-16 10:25                                 ` Jan Djärv
@ 2008-02-16 11:16                                   ` Andreas Schwab
  2008-02-16 23:00                                     ` Jeremy Maitin-Shepard
  2008-02-17 13:23                                   ` Richard Stallman
  1 sibling, 1 reply; 44+ messages in thread
From: Andreas Schwab @ 2008-02-16 11:16 UTC (permalink / raw)
  To: Jan Djärv
  Cc: mwolson, rms, Sascha Wilde, ueno, emacs-devel, dann, monnier

Jan Djärv <jan.h.d@swipnet.se> writes:

> Richard Stallman skrev:
>>     There is still the problem, that one can't prevent Emacs from swapping
>>     out the content of such an buffer -- but that's a more generic problem
>>     (which was discussed briefly in an earlier thread IIRC).
>>
>> Isn't there a way to tell the system not to swap out certain pages?
>>
>>
>
> There is mlock(2).

The amount of memory that can be locked (by unprivileged processes) is
quite limited (128kb typically).

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-16 11:16                                   ` Andreas Schwab
@ 2008-02-16 23:00                                     ` Jeremy Maitin-Shepard
  2008-02-17 20:29                                       ` Richard Stallman
  0 siblings, 1 reply; 44+ messages in thread
From: Jeremy Maitin-Shepard @ 2008-02-16 23:00 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: mwolson, rms, Sascha Wilde, ueno, emacs-devel, dann, monnier,
	Jan Djärv

Andreas Schwab <schwab@suse.de> writes:

> Jan Djärv <jan.h.d@swipnet.se> writes:
>> Richard Stallman skrev:
>>> There is still the problem, that one can't prevent Emacs from swapping
>>> out the content of such an buffer -- but that's a more generic problem
>>> (which was discussed briefly in an earlier thread IIRC).
>>> 
>>> Isn't there a way to tell the system not to swap out certain pages?
>>> 
>>> 
>> 
>> There is mlock(2).

> The amount of memory that can be locked (by unprivileged processes) is
> quite limited (128kb typically).

Even if you somehow manage to prevent the system from swapping out the
memory used by Emacs to directly represent the buffer, other elisp code
that interacts with the buffer may end up copying portions of the buffer
contents to other locations in memory, or copied to other programs,
e.g. if a spell checking mode is used.

-- 
Jeremy Maitin-Shepard




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-16 10:25                                 ` Jan Djärv
  2008-02-16 11:16                                   ` Andreas Schwab
@ 2008-02-17 13:23                                   ` Richard Stallman
  2008-02-18  6:58                                     ` Jan Djärv
  1 sibling, 1 reply; 44+ messages in thread
From: Richard Stallman @ 2008-02-17 13:23 UTC (permalink / raw)
  To: Jan Djärv; +Cc: mwolson, wilde, ueno, emacs-devel, dann, monnier

    There is mlock(2).

Can you send documentation for `mlock'?  My machine has none.  Can it
be used if you're not root?  Would it make sense for Emacs to use it?

    The amount of memory that can be locked (by unprivileged processes) is
    quite limited (128kb typically).

If the decrypted message is under 128k, which it usually will be,
this will suffice.

It might be desirable to lock the core used to hold the display glyphs
too, but maybe there's another method, such as to clear them out if a
certain time elapses.  This would lead to some spurious redisplay,
but not too much or too often.




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-16 23:00                                     ` Jeremy Maitin-Shepard
@ 2008-02-17 20:29                                       ` Richard Stallman
  0 siblings, 0 replies; 44+ messages in thread
From: Richard Stallman @ 2008-02-17 20:29 UTC (permalink / raw)
  To: Jeremy Maitin-Shepard
  Cc: mwolson, wilde, schwab, ueno, emacs-devel, dann, monnier, jan.h.d

    Even if you somehow manage to prevent the system from swapping out the
    memory used by Emacs to directly represent the buffer, other elisp code
    that interacts with the buffer may end up copying portions of the buffer
    contents to other locations in memory, or copied to other programs,
    e.g. if a spell checking mode is used.

It should be straightforward to prevent those modes from being enabled
in a buffer where you read a decrypted message.  That buffer should
normally be read-only, right?

Normally we should not enable these modes in read-only buffers, right?
Is that not implemented now?




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-17 13:23                                   ` Richard Stallman
@ 2008-02-18  6:58                                     ` Jan Djärv
  2008-02-18  7:11                                       ` Miles Bader
  0 siblings, 1 reply; 44+ messages in thread
From: Jan Djärv @ 2008-02-18  6:58 UTC (permalink / raw)
  To: rms; +Cc: mwolson, wilde, ueno, emacs-devel, dann, monnier



Richard Stallman skrev:
>     There is mlock(2).
> 
> Can you send documentation for `mlock'?  My machine has none.  Can it
> be used if you're not root?  Would it make sense for Emacs to use it?

Sent offline.

Some system (Solaris for example) require superuser privilegies, so that makes 
it hard for Emacs to use generally.

	Jan D.





^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: patch to include EasyPG to Emacs
  2008-02-18  6:58                                     ` Jan Djärv
@ 2008-02-18  7:11                                       ` Miles Bader
  0 siblings, 0 replies; 44+ messages in thread
From: Miles Bader @ 2008-02-18  7:11 UTC (permalink / raw)
  To: Jan Djärv; +Cc: mwolson, rms, wilde, ueno, emacs-devel, dann, monnier

Jan Djärv <jan.h.d@swipnet.se> writes:
> Some system (Solaris for example) require superuser privilegies, so that
> makes it hard for Emacs to use generally.

In the end though, all emacs can do is try.  If a system makes it very
hard to do something that helps security, well, that system will be a
bit (though only a bit) less secure.

-Miles

-- 
Helpmate, n. A wife, or bitter half.




^ permalink raw reply	[flat|nested] 44+ messages in thread

* auto-encryption-mode, etc. (Re: patch to include EasyPG to Emacs
  2008-02-14 11:26                       ` Daiki Ueno
  2008-02-14 15:37                         ` Sascha Wilde
  2008-02-15  0:02                         ` Richard Stallman
@ 2008-02-18  8:55                         ` Daiki Ueno
  2008-02-18 17:30                           ` Richard Stallman
  2008-02-18 19:51                           ` Dan Nicolaescu
  2 siblings, 2 replies; 44+ messages in thread
From: Daiki Ueno @ 2008-02-18  8:55 UTC (permalink / raw)
  To: rms; +Cc: Dan Nicolaescu, mwolson, monnier, emacs-devel

>>>>> In <54a15d860802140326t1ede84c9v9ca8abd62f837e21@mail.gmail.com> 
>>>>>	"Daiki Ueno" <ueno@unixuser.org> wrote:
> Okay, I'll prepare a patch to do these this weekend.

The attached is a patch which makes the EasyPG integration a bit
intrusive.  It does:

- add `auto-encryption-mode' which is an analog to
  `auto-compression-mode',
- make `auto-encryption-mode' active by default,
- remove an entry in etc/TODO, which states "Implement a variant of
  uncompress.el or jka-compr.el that works with GNU Privacy Guard for
  encryption",
- make insert-file-contents-literally inhibit epa-file-handler as well
  as jka-compr-handler and image-file-handler,
- define "Encryption/Decryption" submenu in the "Tools" menu, and
- bind encryption commands in dired-mode-map.

This patch is intended for review.  Comments are welcome.

lisp/ChangeLog:

2008-02-18  Daiki Ueno  <ueno@unixuser.org>

	* epg.el (epg-start-receive-keys): Fix typo in docstring.

	* epa.el (epa-global-minor-modes): Abolish.
	(epa-mode): Abolish.

	* loadup.el: Load epa-file-hook.
	* epa-file-hook.el: New file splitted from epa-file.el.

	* dired.el (dired-mode-map): Bind encryption/decryption commands.
	* epa-dired.el (epa-dired-do-decrypt): Add autoload cookie.
	(epa-dired-do-verify): Ditto.
	(epa-dired-do-sign): Ditto.
	(epa-dired-do-encrypt): Ditto.
	(epa-dired-mode): Abolish.
	(epa-global-dired-mode): Abolish.

	* menu-bar.el (menu-bar-encryption-decryption-menu): New menu item.
	* epa.el (epa-menu): Abolish.
	(epa-menu-items): Abolish.

	* files.el (insert-file-contents-literally): Inhibit epa-file-handler.

etc/ChangeLog:

2008-02-18  Daiki Ueno  <ueno@unixuser.org>

	* TODO: Remove auto-encryption task.

Index: etc/TODO
===================================================================
RCS file: /sources/emacs/emacs/etc/TODO,v
retrieving revision 1.184
diff -c -r1.184 TODO
*** etc/TODO	11 Feb 2008 07:39:25 -0000	1.184
--- etc/TODO	18 Feb 2008 08:27:05 -0000
***************
*** 323,334 ****
  
  ** Add a cpio mode, more or less like tar mode.
  
- ** Implement a variant of uncompress.el or jka-compr.el that works with
-   GNU Privacy Guard for encryption.  [Code exists but isn't assigned.
-   See the Gnus development sources for assigned code concerning GPG
-   use with mail, which is probably a good start.]  See also
-   http://www.loveshack.ukfsn.org/emacs/auto-crypt.tgz.
- 
  ** Save undo information in special temporary files, and reload it
    when needed for undoing.  This could extend undo capacity.
  
--- 323,328 ----
Index: lisp/dired.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/dired.el,v
retrieving revision 1.378
diff -c -r1.378 dired.el
*** lisp/dired.el	8 Jan 2008 20:44:46 -0000	1.378
--- lisp/dired.el	18 Feb 2008 08:27:15 -0000
***************
*** 1280,1285 ****
--- 1280,1290 ----
      (define-key map "\C-tf" 'image-dired-mark-tagged-files)
      (define-key map "\C-t\C-t" 'image-dired-dired-insert-marked-thumbs)
      (define-key map "\C-te" 'image-dired-dired-edit-comment-and-tags)
+     ;; encryption and decryption
+     (define-key map ":d" 'epa-dired-do-decrypt)
+     (define-key map ":v" 'epa-dired-do-verify)
+     (define-key map ":s" 'epa-dired-do-sign)
+     (define-key map ":e" 'epa-dired-do-encrypt)
  
      ;; Make menu bar items.
  
***************
*** 1326,1331 ****
--- 1331,1359 ----
        (cons "Immediate" (make-sparse-keymap "Immediate")))
  
      (define-key map
+       [menu-bar immediate epa-dired-do-decrypt]
+       '(menu-item "Decrypt" epa-dired-do-decrypt
+ 		  :help "Decrypt file at cursor"))
+ 
+     (define-key map
+       [menu-bar immediate epa-dired-do-verify]
+       '(menu-item "Verify" epa-dired-do-verify
+ 		  :help "Verify digital signature of file at cursor"))
+ 
+     (define-key map
+       [menu-bar immediate epa-dired-do-sign]
+       '(menu-item "Sign" epa-dired-do-sign
+ 		  :help "Create digital signature of file at cursor"))
+ 
+     (define-key map
+       [menu-bar immediate epa-dired-do-encrypt]
+       '(menu-item "Encrypt" epa-dired-do-encrypt
+ 		  :help "Encrypt file at cursor"))
+ 
+     (define-key map [menu-bar immediate dashes-4]
+       '("--"))
+ 
+     (define-key map
        [menu-bar immediate image-dired-dired-display-external]
        '(menu-item "Display Image Externally" image-dired-dired-display-external
                    :help "Display image in external viewer"))
Index: lisp/epa-dired.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/epa-dired.el,v
retrieving revision 1.5
diff -c -r1.5 epa-dired.el
*** lisp/epa-dired.el	12 Feb 2008 01:24:20 -0000	1.5
--- lisp/epa-dired.el	18 Feb 2008 08:27:15 -0000
***************
*** 26,48 ****
  (require 'epa)
  (require 'dired)
  
- (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)
-     keymap))
- 
- (defvar epa-dired-mode-hook nil)
- (defvar epa-dired-mode-on-hook nil)
- (defvar epa-dired-mode-off-hook nil)
- 
  ;;;###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."
    (interactive)
--- 26,32 ----
***************
*** 52,57 ****
--- 36,42 ----
        (setq file-list (cdr file-list)))
      (revert-buffer)))
  
+ ;;;###autoload
  (defun epa-dired-do-verify ()
    "Verify marked files."
    (interactive)
***************
*** 60,65 ****
--- 45,51 ----
        (epa-verify-file (expand-file-name (car file-list)))
        (setq file-list (cdr file-list)))))
  
+ ;;;###autoload
  (defun epa-dired-do-sign ()
    "Sign marked files."
    (interactive)
***************
*** 74,79 ****
--- 60,66 ----
        (setq file-list (cdr file-list)))
      (revert-buffer)))
  
+ ;;;###autoload
  (defun epa-dired-do-encrypt ()
    "Encrypt marked files."
    (interactive)
***************
*** 86,99 ****
        (setq file-list (cdr file-list)))
      (revert-buffer)))
  
- ;;;###autoload
- (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)
-   (if epa-global-dired-mode
-       (add-hook 'dired-mode-hook 'epa-dired-mode)))
- 
  (provide 'epa-dired)
  
  ;; arch-tag: 2025700b-48d0-4684-bc94-228ad1f8e9ff
--- 73,78 ----
Index: lisp/epa-file-hook.el
===================================================================
RCS file: lisp/epa-file-hook.el
diff -N lisp/epa-file-hook.el
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- lisp/epa-file-hook.el	18 Feb 2008 08:27:15 -0000
***************
*** 0 ****
--- 1,106 ----
+ ;;; epa-file-hook.el --- preloaded code to enable epa-file.el
+ ;; Copyright (C) 2008 Free Software Foundation, Inc.
+ 
+ ;; Author: Daiki Ueno <ueno@unixuser.org>
+ ;; Keywords: PGP, GnuPG
+ 
+ ;; This file is part of GNU Emacs.
+ 
+ ;; GNU Emacs is free software; you can redistribute it and/or modify
+ ;; it under the terms of the GNU General Public License as published by
+ ;; the Free Software Foundation; either version 3, or (at your option)
+ ;; any later version.
+ 
+ ;; GNU Emacs is distributed in the hope that it will be useful,
+ ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ ;; GNU General Public License for more details.
+ 
+ ;; You should have received a copy of the GNU General Public License
+ ;; along with GNU Emacs; see the file COPYING.  If not, write to the
+ ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ ;; Boston, MA 02110-1301, USA.
+ 
+ ;;; Code:
+ 
+ (defgroup epa-file nil
+   "The EasyPG Assistant hooks for transparent file encryption"
+   :version "23.1"
+   :group 'epa)
+ 
+ (defun epa-file--file-name-regexp-set (variable value)
+   (set-default variable value)
+   (if (fboundp 'epa-file-name-regexp-update)
+       (epa-file-name-regexp-update)))
+ 
+ (defcustom epa-file-name-regexp "\\.gpg\\(~\\|\\.~[0-9]+~\\)?\\'"
+   "Regexp which matches filenames to be encrypted with GnuPG.
+ 
+ If you set this outside Custom while epa-file is already enabled, you
+ have to call `epa-file-name-regexp-update' after setting it to
+ properly update file-name-handler-alist.  Setting this through Custom
+ does that automatically."
+   :type 'regexp
+   :group 'epa-file
+   :set 'epa-file--file-name-regexp-set)
+ 
+ (defcustom epa-file-inhibit-auto-save t
+   "If non-nil, disable auto-saving when opening an encrypted file."
+   :type 'boolean
+   :group 'epa-file)
+ 
+ (defvar epa-file-encrypt-to nil
+   "*Recipient(s) used for encrypting files.
+ May either be a string or a list of strings.")
+ 
+ (put 'epa-file-encrypt-to 'safe-local-variable
+      (lambda (val)
+        (or (stringp val)
+ 	   (and (listp val)
+ 		(catch 'safe
+ 		  (mapc (lambda (elt)
+ 			  (unless (stringp elt)
+ 			    (throw 'safe nil)))
+ 			val)
+ 		  t)))))
+ 
+ (put 'epa-file-encrypt-to 'permanent-local t)
+ 
+ (defvar epa-file-handler
+   (cons epa-file-name-regexp 'epa-file-handler))
+ 
+ (defvar epa-file-auto-mode-alist-entry
+   (list epa-file-name-regexp nil 'epa-file))
+ 
+ (defun epa-file-find-file-hook ()
+   (if (and buffer-file-name
+ 	   (string-match epa-file-name-regexp buffer-file-name)
+ 	   epa-file-inhibit-auto-save)
+       (auto-save-mode 0))
+   (set-buffer-modified-p nil))
+ 
+ (define-minor-mode auto-encryption-mode
+   "Toggle automatic file encryption and decryption.
+ With prefix argument ARG, turn auto encryption on if positive, else off.
+ Return the new status of auto encryption (non-nil means on)."
+   :global t :init-value t :group 'epa-file :version "23.1"
+   (setq file-name-handler-alist
+ 	(delq epa-file-handler file-name-handler-alist))
+   (remove-hook 'find-file-hooks 'epa-file-find-file-hook)
+   (setq auto-mode-alist (delq epa-file-auto-mode-alist-entry
+ 			      auto-mode-alist))
+   (when auto-encryption-mode
+     (setq file-name-handler-alist
+ 	  (cons epa-file-handler file-name-handler-alist))
+     (add-hook 'find-file-hooks 'epa-file-find-file-hook)
+     (setq auto-mode-alist (cons epa-file-auto-mode-alist-entry
+ 				auto-mode-alist))))
+ 
+ (put 'epa-file-handler 'safe-magic t)
+ (put 'epa-file-handler 'operations '(write-region insert-file-contents))
+ 
+ (when auto-encryption-mode (auto-encryption-mode 1))
+ 
+ (provide 'epa-file-hook)
+ 
+ ;;; epa-file-hook.el ends here
Index: lisp/epa-file.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/epa-file.el,v
retrieving revision 1.4
diff -c -r1.4 epa-file.el
*** lisp/epa-file.el	10 Feb 2008 20:57:46 -0000	1.4
--- lisp/epa-file.el	18 Feb 2008 08:27:15 -0000
***************
*** 24,91 ****
  ;;; Code:
  
  (require 'epa)
! 
! (defgroup epa-file nil
!   "The EasyPG Assistant hooks for transparent file encryption"
!   :version "23.1"
!   :group 'epa)
! 
! (defun epa-file--file-name-regexp-set (variable value)
!   (set-default variable value)
!   (if (fboundp 'epa-file-name-regexp-update)
!       (epa-file-name-regexp-update)))
! 
! (defcustom epa-file-name-regexp "\\.gpg\\(~\\|\\.~[0-9]+~\\)?\\'"
!   "Regexp which matches filenames to be encrypted with GnuPG.
! 
! If you set this outside Custom while epa-file is already enabled, you
! have to call `epa-file-name-regexp-update' after setting it to
! properly update file-name-handler-alist.  Setting this through Custom
! does that automatically."
!   :type 'regexp
!   :group 'epa-file
!   :set 'epa-file--file-name-regexp-set)
  
  (defcustom epa-file-cache-passphrase-for-symmetric-encryption nil
    "If non-nil, cache passphrase for symmetric encryption."
    :type 'boolean
    :group 'epa-file)
  
- (defcustom epa-file-inhibit-auto-save t
-   "If non-nil, disable auto-saving when opening an encrypted file."
-   :type 'boolean
-   :group 'epa-file)
- 
  (defcustom epa-file-select-keys nil
    "If non-nil, always asks user to select recipients."
    :type 'boolean
    :group 'epa-file)
  
- (defvar epa-file-encrypt-to nil
-   "*Recipient(s) used for encrypting files.
- May either be a string or a list of strings.")
- 
- ;;;###autoload
- (put 'epa-file-encrypt-to 'safe-local-variable
-      (lambda (val)
-        (or (stringp val)
- 	   (and (listp val)
- 		(catch 'safe
- 		  (mapc (lambda (elt)
- 			  (unless (stringp elt)
- 			    (throw 'safe nil)))
- 			val)
- 		  t)))))
- 
- ;;;###autoload
- (put 'epa-file-encrypt-to 'permanent-local t)
- 
- (defvar epa-file-handler
-   (cons epa-file-name-regexp 'epa-file-handler))
- 
- (defvar epa-file-auto-mode-alist-entry
-   (list epa-file-name-regexp nil 'epa-file))
- 
  (defvar epa-file-passphrase-alist nil)
  
  (eval-and-compile
--- 24,41 ----
  ;;; Code:
  
  (require 'epa)
! (require 'epa-file-hook)
  
  (defcustom epa-file-cache-passphrase-for-symmetric-encryption nil
    "If non-nil, cache passphrase for symmetric encryption."
    :type 'boolean
    :group 'epa-file)
  
  (defcustom epa-file-select-keys nil
    "If non-nil, always asks user to select recipients."
    :type 'boolean
    :group 'epa-file)
  
  (defvar epa-file-passphrase-alist nil)
  
  (eval-and-compile
***************
*** 123,128 ****
--- 73,79 ----
  		passphrase))))
      (epa-passphrase-callback-function context key-id nil)))
  
+ ;;;###autoload
  (defun epa-file-handler (operation &rest args)
    (save-match-data
      (let ((op (get operation 'epa-file)))
***************
*** 273,285 ****
  	(message "Wrote %s" buffer-file-name))))
  (put 'write-region 'epa-file 'epa-file-write-region)
  
- (defun epa-file-find-file-hook ()
-   (if (and buffer-file-name
- 	   (string-match epa-file-name-regexp buffer-file-name)
- 	   epa-file-inhibit-auto-save)
-       (auto-save-mode 0))
-   (set-buffer-modified-p nil))
- 
  (defun epa-file-select-keys ()
    "Select recipients for encryption."
    (interactive)
--- 224,229 ----
***************
*** 314,337 ****
  	(message "`epa-file' disabled"))
      (message "`epa-file' already disabled")))
  
- ;;;###autoload
- (define-minor-mode epa-file-mode
-   "Toggle automatic file encryption and decryption.
- With prefix argument ARG, turn auto encryption on if positive, else off.
- Return the new status of auto encryption (non-nil means on)."
-   :global t :init-value nil :group 'epa-file :version "23.1"
-   (setq file-name-handler-alist
- 	(delq epa-file-handler file-name-handler-alist))
-   (remove-hook 'find-file-hooks 'epa-file-find-file-hook)
-   (setq auto-mode-alist (delq epa-file-auto-mode-alist-entry
- 			      auto-mode-alist))
-   (when epa-file-mode
-     (setq file-name-handler-alist
- 	  (cons epa-file-handler file-name-handler-alist))
-     (add-hook 'find-file-hooks 'epa-file-find-file-hook)
-     (setq auto-mode-alist (cons epa-file-auto-mode-alist-entry
- 				auto-mode-alist))))
- 
  (provide 'epa-file)
  
  ;; arch-tag: 5715152f-0eb1-4dbc-9008-07098775314d
--- 258,263 ----
Index: lisp/epa.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/epa.el,v
retrieving revision 1.6
diff -c -r1.6 epa.el
*** lisp/epa.el	12 Feb 2008 01:24:20 -0000	1.6
--- lisp/epa.el	18 Feb 2008 08:27:16 -0000
***************
*** 45,57 ****
    :type 'integer
    :group 'epa)
  
- (defcustom epa-global-minor-modes '(epa-global-dired-mode
- 				    epa-global-mail-mode
- 				    epa-file-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"
--- 45,50 ----
***************
*** 236,279 ****
      (define-key keymap "q" 'delete-window)
      keymap))
  
- (defvar epa-menu nil)
- 
- (defconst epa-menu-items
-   '("Encryption/Decryption"
-     ("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
--- 229,234 ----
***************
*** 1218,1244 ****
  ;;     (message "Signing keys...done")))
  ;; (make-obsolete 'epa-sign-keys "Do not use.")
  
- ;;;###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"
-   (unless epa-menu
-     (easy-menu-define epa-menu nil "EasyPG Assistant global menu"
-       epa-menu-items))
-   (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 epa-mode)
- 	(message "`%S' not found" (car modes)))
-       (setq modes (cdr modes)))))
- 
  (provide 'epa)
  
  ;; arch-tag: 38d20ced-20d5-4137-b17a-f206335423d7
--- 1173,1178 ----
Index: lisp/epg.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/epg.el,v
retrieving revision 1.3
diff -c -r1.3 epg.el
*** lisp/epg.el	10 Feb 2008 20:57:47 -0000	1.3
--- lisp/epg.el	18 Feb 2008 08:27:16 -0000
***************
*** 2412,2418 ****
  `epg-gpg-program' by using `epg-wait-for-completion' and call
  `epg-reset' to clear a temporaly output file.
  If you are unsure, use synchronous version of this function
! `epg-generate-key-from-file' or `epg-generate-key-from-string' instead."
    (epg-context-set-operation context 'receive-keys)
    (epg-context-set-result context nil)
    (epg--start context (cons "--recv-keys" key-id-list)))
--- 2412,2418 ----
  `epg-gpg-program' by using `epg-wait-for-completion' and call
  `epg-reset' to clear a temporaly output file.
  If you are unsure, use synchronous version of this function
! `epg-receive-keys' instead."
    (epg-context-set-operation context 'receive-keys)
    (epg-context-set-result context nil)
    (epg--start context (cons "--recv-keys" key-id-list)))
Index: lisp/files.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/files.el,v
retrieving revision 1.960
diff -c -r1.960 files.el
*** lisp/files.el	16 Feb 2008 21:39:30 -0000	1.960
--- lisp/files.el	18 Feb 2008 08:27:18 -0000
***************
*** 1772,1778 ****
               (symbol-function 'find-buffer-file-type)
             nil))
          (inhibit-file-name-handlers
!          (append '(jka-compr-handler image-file-handler)
                   inhibit-file-name-handlers))
          (inhibit-file-name-operation 'insert-file-contents))
      (unwind-protect
--- 1772,1778 ----
               (symbol-function 'find-buffer-file-type)
             nil))
          (inhibit-file-name-handlers
!          (append '(jka-compr-handler image-file-handler epa-file-handler)
                   inhibit-file-name-handlers))
          (inhibit-file-name-operation 'insert-file-contents))
      (unwind-protect
Index: lisp/loadup.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/loadup.el,v
retrieving revision 1.160
diff -c -r1.160 loadup.el
*** lisp/loadup.el	1 Feb 2008 22:43:10 -0000	1.160
--- lisp/loadup.el	18 Feb 2008 08:27:18 -0000
***************
*** 87,92 ****
--- 87,93 ----
  (load "help")
  
  (load "jka-cmpr-hook")
+ (load "epa-file-hook")
  ;; Any Emacs Lisp source file (*.el) loaded here after can contain
  ;; multilingual text.
  (load "international/mule-cmds")
Index: lisp/menu-bar.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/menu-bar.el,v
retrieving revision 1.318
diff -c -r1.318 menu-bar.el
*** lisp/menu-bar.el	8 Jan 2008 20:44:39 -0000	1.318
--- lisp/menu-bar.el	18 Feb 2008 08:27:18 -0000
***************
*** 1084,1089 ****
--- 1084,1153 ----
  	 (known (assq read-mail-command known-rmail-commands)))
      (if known (cdr known) (symbol-name read-mail-command))))
  
+ (defvar menu-bar-encryption-decryption-menu
+   (make-sparse-keymap "Encryption/Decryption"))
+ 
+ (define-key menu-bar-tools-menu [encryption-decryption]
+   (list 'menu-item "Encryption/Decryption" menu-bar-encryption-decryption-menu))
+ 
+ (define-key menu-bar-tools-menu [separator-encryption-decryption]
+   '("--"))
+ 
+ (define-key menu-bar-encryption-decryption-menu [insert-keys]
+   '(menu-item "Insert Keys" epa-insert-keys
+ 	      :help "Insert public keys after the current point"))
+ 
+ (define-key menu-bar-encryption-decryption-menu [export-keys]
+   '(menu-item "Export Keys" epa-export-keys
+ 	      :help "Export public keys to a file"))
+ 
+ (define-key menu-bar-encryption-decryption-menu [import-keys-region]
+   '(menu-item "Import Keys from Region" epa-import-keys-region
+ 	      :help "Import public keys from the current region"))
+ 
+ (define-key menu-bar-encryption-decryption-menu [import-keys]
+   '(menu-item "Import Keys from File" epa-import-keys
+ 	      :help "Import public keys from a file"))
+ 
+ (define-key menu-bar-encryption-decryption-menu [list-keys]
+   '(menu-item "List Keys" epa-list-keys
+ 	      :help "Browse your public keyring"))
+ 
+ (define-key menu-bar-encryption-decryption-menu [separator-keys]
+   '("--"))
+ 
+ (define-key menu-bar-encryption-decryption-menu [encrypt-region]
+   '(menu-item "Encrypt Region" epa-encrypt-region
+ 	      :help "Encrypt the current region"))
+ 
+ (define-key menu-bar-encryption-decryption-menu [encrypt-file]
+   '(menu-item "Encrypt File" epa-encrypt-file
+ 	      :help "Encrypt a file"))
+ 
+ (define-key menu-bar-encryption-decryption-menu [sign-region]
+   '(menu-item "Sign Region" epa-sign-region
+ 	      :help "Create digital signature of the current region"))
+ 
+ (define-key menu-bar-encryption-decryption-menu [sign-file]
+   '(menu-item "Sign File" epa-sign-file
+ 	      :help "Create digital signature of a file"))
+ 
+ (define-key menu-bar-encryption-decryption-menu [verify-region]
+   '(menu-item "Verify Region" epa-verify-region
+ 	      :help "Verify digital signature of the current region"))
+ 
+ (define-key menu-bar-encryption-decryption-menu [verify-file]
+   '(menu-item "Verify File" epa-verify-file
+ 	      :help "Verify digital signature of a file"))
+ 
+ (define-key menu-bar-encryption-decryption-menu [decrypt-region]
+   '(menu-item "Decrypt Region" epa-decrypt-region
+ 	      :help "Decrypt the current region"))
+ 
+ (define-key menu-bar-encryption-decryption-menu [decrypt-file]
+   '(menu-item "Decrypt File" epa-decrypt-file
+ 	      :help "Decrypt a file"))
+ 
  (defvar menu-bar-games-menu (make-sparse-keymap "Games"))
  
  (define-key menu-bar-tools-menu [games]

Regards,
-- 
Daiki Ueno




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: auto-encryption-mode, etc. (Re: patch to include EasyPG to Emacs
  2008-02-18  8:55                         ` auto-encryption-mode, etc. (Re: " Daiki Ueno
@ 2008-02-18 17:30                           ` Richard Stallman
  2008-02-18 19:51                           ` Dan Nicolaescu
  1 sibling, 0 replies; 44+ messages in thread
From: Richard Stallman @ 2008-02-18 17:30 UTC (permalink / raw)
  To: Daiki Ueno; +Cc: dann, mwolson, monnier, emacs-devel

    - add `auto-encryption-mode' which is an analog to
      `auto-compression-mode',
    - make `auto-encryption-mode' active by default,
    - remove an entry in etc/TODO, which states "Implement a variant of
      uncompress.el or jka-compr.el that works with GNU Privacy Guard for
      encryption",
    - make insert-file-contents-literally inhibit epa-file-handler as well
      as jka-compr-handler and image-file-handler,
    - define "Encryption/Decryption" submenu in the "Tools" menu, and
    - bind encryption commands in dired-mode-map.

All this sounds good, but it might be desirable for Auto Encryption mode
to ask for confirmation before it decrypts any newly visited file for
the first time.

(I have not studied the patch's code carefully.)




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: auto-encryption-mode, etc. (Re: patch to include EasyPG to Emacs
  2008-02-18  8:55                         ` auto-encryption-mode, etc. (Re: " Daiki Ueno
  2008-02-18 17:30                           ` Richard Stallman
@ 2008-02-18 19:51                           ` Dan Nicolaescu
  1 sibling, 0 replies; 44+ messages in thread
From: Dan Nicolaescu @ 2008-02-18 19:51 UTC (permalink / raw)
  To: Daiki Ueno; +Cc: emacs-devel, mwolson, rms, monnier

Daiki Ueno <ueno@unixuser.org> writes:

  > >>>>> In <54a15d860802140326t1ede84c9v9ca8abd62f837e21@mail.gmail.com> 
  > >>>>>	"Daiki Ueno" <ueno@unixuser.org> wrote:
  > > Okay, I'll prepare a patch to do these this weekend.
  > 
  > The attached is a patch which makes the EasyPG integration a bit
  > intrusive.  It does:
  > 
  > - add `auto-encryption-mode' which is an analog to
  >   `auto-compression-mode',
  > - make `auto-encryption-mode' active by default,
  > - remove an entry in etc/TODO, which states "Implement a variant of
  >   uncompress.el or jka-compr.el that works with GNU Privacy Guard for
  >   encryption",
  > - make insert-file-contents-literally inhibit epa-file-handler as well
  >   as jka-compr-handler and image-file-handler,
  > - define "Encryption/Decryption" submenu in the "Tools" menu, and
  > - bind encryption commands in dired-mode-map.
  > 
  > This patch is intended for review.  Comments are welcome.

  > + (when auto-encryption-mode (auto-encryption-mode 1))

Turning on a mode when loading a file does not seem like not a good idea.
Instead, you could add a custom-reevaluate-setting call in startup.el





^ permalink raw reply	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2008-02-18 19:51 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-07  4:58 patch to include EasyPG to Emacs Daiki Ueno
2008-02-07  5:13 ` Dan Nicolaescu
2008-02-07  9:28   ` Daiki Ueno
2008-02-07 16:24     ` Leo
2008-02-08  4:42       ` Daiki Ueno
2008-02-08  7:15     ` Dan Nicolaescu
2008-02-08  4:14 ` Richard Stallman
2008-02-08  7:03 ` Michael Olson
2008-02-10  7:04   ` Daiki Ueno
2008-02-10 15:44     ` Stefan Monnier
2008-02-10 19:15       ` Daiki Ueno
2008-02-10 19:30         ` Daiki Ueno
2008-02-10 20:58           ` Michael Olson
2008-02-10 21:29             ` Daiki Ueno
2008-02-11  0:03               ` Michael Olson
2008-02-10 19:46         ` Stefan Monnier
2008-02-10 22:36         ` Dan Nicolaescu
2008-02-10 23:34           ` Daiki Ueno
2008-02-11  6:30             ` Daiki Ueno
2008-02-12  1:24               ` Michael Olson
2008-02-12  3:48               ` Dan Nicolaescu
2008-02-12  6:04                 ` Daiki Ueno
2008-02-12 17:45                 ` Richard Stallman
2008-02-13 17:28                   ` Dan Nicolaescu
2008-02-14  4:43                     ` Richard Stallman
2008-02-14 11:26                       ` Daiki Ueno
2008-02-14 15:37                         ` Sascha Wilde
2008-02-14 18:43                           ` Daiki Ueno
2008-02-15 10:07                             ` Sascha Wilde
2008-02-15 17:05                               ` Daiki Ueno
2008-02-15 18:34                                 ` Sascha Wilde
2008-02-16  5:53                               ` Richard Stallman
2008-02-16 10:25                                 ` Jan Djärv
2008-02-16 11:16                                   ` Andreas Schwab
2008-02-16 23:00                                     ` Jeremy Maitin-Shepard
2008-02-17 20:29                                       ` Richard Stallman
2008-02-17 13:23                                   ` Richard Stallman
2008-02-18  6:58                                     ` Jan Djärv
2008-02-18  7:11                                       ` Miles Bader
2008-02-15  0:02                         ` Richard Stallman
2008-02-15  2:20                           ` Daiki Ueno
2008-02-18  8:55                         ` auto-encryption-mode, etc. (Re: " Daiki Ueno
2008-02-18 17:30                           ` Richard Stallman
2008-02-18 19:51                           ` Dan Nicolaescu

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).