Phi-pgp Installation Guide
Copyright (c) 1993, AIT, Computer Science Program, Thailand
	      see COPYRIGHT notice


GENERAL INSTALLATION

It needs to be  done by someone having  modification permission on GNU
Emacs   distribution files.   Else   jump   to section  "SINGLE   USER
INSTALLATION".

1) Extract  the autoload information.   This will create a file called
'loaddef.el' in  the directory where  is located the 'phi-pgp.el' Lisp
source file.

Run  the Emacs   command  M-x  update-file-autoloads on   the filename
'phi-pgp.el'.

Type M-C-c in the loaddef.el buffer. This will extract the information
and create the 'loaddef.el' file that holds information to Emacs about
pgp available commands.

2) Copy the 'phi-pgp.el' file to a valid Emacs Lisp library directory.
The  directory  for  a     default  installation  of   GNU   Emacs  is
/usr/local/lib/emacs/<version>/lisp

3) If the program pgp is not in the  users standards search path, edit
'phi-pgp.el'  and modified the  definition of the variable pgp-program
to reflect the absolute pathname of the pgp program.

4) Compile Phi-pgp, running Emacs command M-x byte-compile-file on the
filename 'phi-pgp.el'.

This will give you a lot of warning messags saying:

While compiling toplevel forms in file phi-pgp.el:
  ** assignment to free variable pgp-strconst-enter-pass
  ** assignment to free variable pgp-strconst-bad-pass
  ** assignment to free variable pgp-strconst-pass-key
  ** reference to free variable pgp-strconst-bad-pass
  ** reference to free variable pgp-strconst-good-sign
  ** reference to free variable pgp-strconst-bad-sign
  ...

but those messages are not important.

5) Modify the 'default.el' file  (create it if it  doesn't exist).  This
file   is   located in    the default   Emacs Lisp  library  directory
(/usr/local/lib/emacs/<version>/lisp for default installation).

a- add the following lines to the end of default.el buffer:

;;; bind the pgp keys only when needed
(setq after-load-alist
      (cons
       (list
	"sendmail"
	(list 'define-key 'mail-mode-map "\C-cs" (quote'pgp-sign))
	(list 'define-key 'mail-mode-map "\C-cS" (quote 'pgp-clear-sign))
	(list 'define-key 'mail-mode-map "\C-ck" (quote 'pgp-set-seckey))
	(list 'define-key 'mail-mode-map "\C-cK" (quote 'pgp-view-seckey))
	(list 'define-key 'mail-mode-map "\C-ce" (quote 'pgp-encrypt))
	(list 'define-key 'mail-mode-map "\C-cV" (quote 'pgp-encrypt-view))
	(list 'define-key 'mail-mode-map "\C-cR" (quote 'pgp-encrypt-region))
	(list 'define-key 'mail-mode-map "\C-cx" (quote 'pgp-append-pubkey))
	(list 'define-key 'mail-mode-map "\C-ct" (quote 'pgp-sign-encrypt))
	)
       (cons
	(list
	 "rmail"
	 (list 'define-key 'rmail-mode-map "\C-cd" (quote 'pgp-decr-mess))
	 (list 'define-key 'rmail-mode-map "\C-ca" (quote 'pgp-add-key))
	 )
	after-load-alist)))
;;; end of binding pgp keys

b- add the contents of the loaddef.el created at step 1  to the end of
default.el buffer.

c- save the default.el buffer.

6) Using    the local implementation   of  LaTeX-ware, edit  and print
'phi-pgp.tex' documentation file.

7) Jump to the section "CUSTOMIZING USER ENVIRONMENT"


SINGLE USER INSTALLATION

1) Extract  the autoload information.   This will create a file called
'loaddef.el' in  the directory where  is located the 'phi-pgp.el' Lisp
source file.

Run  the Emacs   command  M-x  update-file-autoloads on   the filename
'phi-pgp.el'.

Type M-C-c in the loaddef.el buffer. This will extract the information
and create the 'loaddef.el' file that holds information to Emacs about
pgp available commands.

2) Copy  the 'phi-pgp.el' file to a  directory  that handel Emacs Lisp
library.  This directory   should be defined  in the  load-path  Emacs
variable.

You can view the  load-path variable when running  Emacs, typing C-h v
then the name of the variable load-path.

If the directory is  not yet defined  in the load-path variable (for a
newly created directory for  example) add the  following lines  to the
end of your '~/.emacs' file:

;;; Add a Emacs Lisp libraby directory
(setq load-path
      (append
       (list
        "/user/me/my-directory-for-phi-pgp")
       load-path))
;;; End of the adding

The   line   "/user/me/my-directory-for-phi-pgp"   should reflect  the
absolute pathname of the directory where you are installing Phi-pgp.

3) If the program pgp is not in the  users standards search path, edit
'phi-pgp.el' and  modified the definition  of the variable pgp-program
to reflect the absolute pathname of the pgp program.

The line will look like:

(defvar pgp-program "/usr/local/pgp2.3a/pgp"
   "Define the name of the local...

for example, if pgp is installed in the /usr/local/pgp2.3a directory.

4) Compile Phi-pgp, running Emacs command M-x byte-compile-file on the
filename 'phi-pgp.el'.

This will give you a lot of warning messags saying:

While compiling toplevel forms in file phi-pgp.el:
  ** assignment to free variable pgp-strconst-enter-pass
  ** assignment to free variable pgp-strconst-bad-pass
  ** assignment to free variable pgp-strconst-pass-key
  ** reference to free variable pgp-strconst-bad-pass
  ** reference to free variable pgp-strconst-good-sign
  ** reference to free variable pgp-strconst-bad-sign
  ...

but those messages are not important.

5) Modify your '~/.emacs' file.

a- add the following lines to the end of .emacs buffer:

;;; bind the pgp keys only when needed
(setq after-load-alist
      (cons
       (list
	"sendmail"
	(list 'define-key 'mail-mode-map "\C-cs" (quote'pgp-sign))
	(list 'define-key 'mail-mode-map "\C-cS" (quote 'pgp-clear-sign))
	(list 'define-key 'mail-mode-map "\C-ck" (quote 'pgp-set-seckey))
	(list 'define-key 'mail-mode-map "\C-cK" (quote 'pgp-view-seckey))
	(list 'define-key 'mail-mode-map "\C-ce" (quote 'pgp-encrypt))
	(list 'define-key 'mail-mode-map "\C-cV" (quote 'pgp-encrypt-view))
	(list 'define-key 'mail-mode-map "\C-cR" (quote 'pgp-encrypt-region))
	(list 'define-key 'mail-mode-map "\C-cx" (quote 'pgp-append-pubkey))
	(list 'define-key 'mail-mode-map "\C-ct" (quote 'pgp-sign-encrypt))
	)
       (cons
        (list
	 "rmail"
	 (list 'define-key 'rmail-mode-map "\C-cd" (quote 'pgp-decr-mess))
	 (list 'define-key 'rmail-mode-map "\C-ca" (quote 'pgp-add-key))
	 )
       after-load-alist)))
;;; end of binding pgp keys

b- add the contents of the loaddef.el created at step 1  to the end of
.emacs buffer.

c- save the .emacs buffer.

6) Using the local    implementation  of LaTeX-ware, edit    and print
'phi-pgp.tex' documentation file.


CUSTOMIZING USER ENVIRONMENT

There are   few  variables  user   can  set   to  customize  it's  own
environment. They  are decribe with  more details in the documentation
of Phi-pgp. Here is a short list.

pgp-default-seckey: define  the  default secret   key to  use. It   is
meaningless untill one user have multiple secret keys.

pgp-delete-pass:  if set to non-nil the  pass phrases  associated to a
secret key are never kept between two pgp commands. This is a security
hole  to keep the  pass  phrase inside Emacs   memory during one Emacs
session as  the pass  phrase  will appears in  the core  file whenever
Emacs crashes.

pgp-self-crypt: always encrypt the  message with the user's own public
key. This is usefull when  a message bounces  or when user keep a copy
of the message for further uses.

pgp-auto-add-pubkey: automatically add user's public key at the end of
an encrypted message. This is meaningless for  a signed mesage and not
available is the mesage is to be encrypted as  'for your eyes only' or
only partially encrypted.

To  set    and   modify thoses   variables,    refer  to  the  Phi-pgp
documentation.
