emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/notes-mode 3fa8751 1/2: Merge in changes from upstream'


From: Stefan Monnier
Subject: [elpa] externals/notes-mode 3fa8751 1/2: Merge in changes from upstream's 1.30
Date: Tue, 1 Dec 2020 12:12:05 -0500 (EST)

branch: externals/notes-mode
commit 3fa87519762fc832f059e6739d600de23fea6f56
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    Merge in changes from upstream's 1.30
---
 HTML/notes-mode.html     | 30 +++++++++--------
 HTML/notes-mode_1.html   |  4 +--
 HTML/notes-mode_2.html   |  6 ++--
 HTML/notes-mode_3.html   | 20 +++++-------
 HTML/notes-mode_4.html   | 10 ++++--
 HTML/notes-mode_5.html   |  4 +--
 HTML/notes-mode_6.html   |  4 +--
 HTML/notes-mode_7.html   |  4 +--
 HTML/notes-mode_abt.html |  6 ++--
 HTML/notes-mode_fot.html |  4 +--
 HTML/notes-mode_toc.html |  4 +--
 Makefile.in              |  2 +-
 README                   | 10 ++++++
 notes-mode.el            | 85 ++++++++++++++++++++++++++++++------------------
 notes-mode.texi          | 22 ++++++++-----
 15 files changed, 130 insertions(+), 85 deletions(-)

diff --git a/HTML/notes-mode.html b/HTML/notes-mode.html
index 737a88e..afd6ff8 100644
--- a/HTML/notes-mode.html
+++ b/HTML/notes-mode.html
@@ -1,6 +1,6 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html401/loose.dtd";>
 <html>
-<!-- Created on April 4, 2012 by texi2html 1.82
+<!-- Created on December 19, 2014 by texi2html 1.82
 texi2html was written by: 
             Lionel Cons <Lionel.Cons@cern.ch> (original author)
             Karl Berry  <karl@freefriends.org>
@@ -809,7 +809,7 @@ Notes-mode will help you out with some of these convetions
  (thanks to Tim Carroll for pointing this out).
 Outline-mode supports hiding and revealing text and other helpful
  features beyond the scope of this document.
-See <a href="emacs.html#Outline-Mode">Outline Mode: (emacs)Outline Mode</a> 
section &lsquo;Outline Mode&rsquo; in <cite>The Emacs Editor</cite>, for 
details.
+See <a href="${EMACS}/html_mono/emacs.html#Outline-Mode">Outline Mode: 
(emacs)Outline Mode</a> section &lsquo;Outline Mode&rsquo; in <cite>The Emacs 
Editor</cite>, for details.
 </p>
 <hr size="6">
 <a name="The-notes-index"></a>
@@ -1165,12 +1165,10 @@ In such systems,
 <p>Notes-mode encryption is based
  Phill Zimmerman&rsquo;s PGP (Pretty Good Privacy)
 (see &lsquo;<tt>http://www.mantis.co.uk/pgp/pgp.html</tt>&rsquo;)
- and either
- with Rick Campbell&rsquo;s
- emacs interface, PAM (PGP Augmented Messaging)
-(from &lsquo;<tt>ftp://h.gp.cs.cmu.edu/usr/rfb/pam/</tt>&rsquo;)
- (note that as of January 1997, PAM is no longer at this ftp site
- and appears to not be publicly available),
+ and requires either
+ EasyPG
+ (installed with emacs-24)
+ or
  or LoPresti and Choi&rsquo;s mailcrypt
 (from &lsquo;<tt>http://cag-www.lcs.mit.edu/mailcrypt/</tt>&rsquo;).
 <a name="index-PGP"></a>
@@ -1196,11 +1194,11 @@ With a prefix argument,
 </dl>
 <a name="index-C_002dc-C_002dd"></a>
 
-<p>By default notes-mode determines your public key by looking 
- up your <code>user-full-name</code> in your PGP keyring.
+<p>By default notes-mode determines your public key by
+ asking you.
 You can override this default by setting
  <code>notes-encryption-key-id</code>
- to the desired key-id.
+ to the desired key-id (usually 8 hex digits).
 <a name="index-key_002did"></a>
 </p>
 
@@ -1835,6 +1833,12 @@ of buffers without going into an infinite loop.
 Clearly wrong code, but you have to ask this guy for why he tried:
 Bug report from Geoff Kuenning.
 </p>
+<p>Changed (2014-12-19): version 1.30
+</p>
+<p>Added support for EasyPG.
+Support for mailcrypt remains, but that library has seen no progress since 
2002.
+Support for npgp is gone.
+</p>
 
 
 <hr size="6">
@@ -2253,7 +2257,7 @@ and the many other normal people who triggered landmark 
cases.
 </tr></table>
 <h1>About This Document</h1>
 <p>
-  This document was generated by <em>John Heidemann</em> on <em>April 4, 
2012</em> using <a href="http://www.nongnu.org/texi2html/";><em>texi2html 
1.82</em></a>.
+  This document was generated on <i>December 19, 2014</i> using <a 
href="http://www.nongnu.org/texi2html/";><i>texi2html 1.82</i></a>.
 </p>
 <p>
   The buttons in the navigation panels have the following meaning:
@@ -2355,7 +2359,7 @@ and the many other normal people who triggered landmark 
cases.
 <hr size="1">
 <p>
  <font size="-1">
-  This document was generated by <em>John Heidemann</em> on <em>April 4, 
2012</em> using <a href="http://www.nongnu.org/texi2html/";><em>texi2html 
1.82</em></a>.
+  This document was generated on <i>December 19, 2014</i> using <a 
href="http://www.nongnu.org/texi2html/";><i>texi2html 1.82</i></a>.
  </font>
  <br>
 
diff --git a/HTML/notes-mode_1.html b/HTML/notes-mode_1.html
index 45f7ec2..d7736a1 100644
--- a/HTML/notes-mode_1.html
+++ b/HTML/notes-mode_1.html
@@ -1,6 +1,6 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html401/loose.dtd";>
 <html>
-<!-- Created on April 4, 2012 by texi2html 1.82
+<!-- Created on December 19, 2014 by texi2html 1.82
 texi2html was written by: 
             Lionel Cons <Lionel.Cons@cern.ch> (original author)
             Karl Berry  <karl@freefriends.org>
@@ -524,7 +524,7 @@ and so is guaranteed to be very low bandwidth.
 </tr></table>
 <p>
  <font size="-1">
-  This document was generated by <em>John Heidemann</em> on <em>April 4, 
2012</em> using <a href="http://www.nongnu.org/texi2html/";><em>texi2html 
1.82</em></a>.
+  This document was generated on <i>December 19, 2014</i> using <a 
href="http://www.nongnu.org/texi2html/";><i>texi2html 1.82</i></a>.
  </font>
  <br>
 
diff --git a/HTML/notes-mode_2.html b/HTML/notes-mode_2.html
index 0f5af2d..470a21a 100644
--- a/HTML/notes-mode_2.html
+++ b/HTML/notes-mode_2.html
@@ -1,6 +1,6 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html401/loose.dtd";>
 <html>
-<!-- Created on April 4, 2012 by texi2html 1.82
+<!-- Created on December 19, 2014 by texi2html 1.82
 texi2html was written by: 
             Lionel Cons <Lionel.Cons@cern.ch> (original author)
             Karl Berry  <karl@freefriends.org>
@@ -249,7 +249,7 @@ Notes-mode will help you out with some of these convetions
  (thanks to Tim Carroll for pointing this out).
 Outline-mode supports hiding and revealing text and other helpful
  features beyond the scope of this document.
-See <a href="../emacs/Outline-Mode.html#Outline-Mode">Outline Mode: 
(emacs)Outline Mode</a> section &lsquo;Outline Mode&rsquo; in <cite>The Emacs 
Editor</cite>, for details.
+See <a href="${EMACS}/html_mono/emacs.html#Outline-Mode">Outline Mode: 
(emacs)Outline Mode</a> section &lsquo;Outline Mode&rsquo; in <cite>The Emacs 
Editor</cite>, for details.
 </p>
 <hr size="6">
 <a name="The-notes-index"></a>
@@ -410,7 +410,7 @@ Notes are personal things.
 </tr></table>
 <p>
  <font size="-1">
-  This document was generated by <em>John Heidemann</em> on <em>April 4, 
2012</em> using <a href="http://www.nongnu.org/texi2html/";><em>texi2html 
1.82</em></a>.
+  This document was generated on <i>December 19, 2014</i> using <a 
href="http://www.nongnu.org/texi2html/";><i>texi2html 1.82</i></a>.
  </font>
  <br>
 
diff --git a/HTML/notes-mode_3.html b/HTML/notes-mode_3.html
index cdfd7e6..04c0004 100644
--- a/HTML/notes-mode_3.html
+++ b/HTML/notes-mode_3.html
@@ -1,6 +1,6 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html401/loose.dtd";>
 <html>
-<!-- Created on April 4, 2012 by texi2html 1.82
+<!-- Created on December 19, 2014 by texi2html 1.82
 texi2html was written by: 
             Lionel Cons <Lionel.Cons@cern.ch> (original author)
             Karl Berry  <karl@freefriends.org>
@@ -251,12 +251,10 @@ In such systems,
 <p>Notes-mode encryption is based
  Phill Zimmerman&rsquo;s PGP (Pretty Good Privacy)
 (see &lsquo;<tt>http://www.mantis.co.uk/pgp/pgp.html</tt>&rsquo;)
- and either
- with Rick Campbell&rsquo;s
- emacs interface, PAM (PGP Augmented Messaging)
-(from &lsquo;<tt>ftp://h.gp.cs.cmu.edu/usr/rfb/pam/</tt>&rsquo;)
- (note that as of January 1997, PAM is no longer at this ftp site
- and appears to not be publicly available),
+ and requires either
+ EasyPG
+ (installed with emacs-24)
+ or
  or LoPresti and Choi&rsquo;s mailcrypt
 (from &lsquo;<tt>http://cag-www.lcs.mit.edu/mailcrypt/</tt>&rsquo;).
 <a name="index-PGP"></a>
@@ -282,11 +280,11 @@ With a prefix argument,
 </dl>
 <a name="index-C_002dc-C_002dd"></a>
 
-<p>By default notes-mode determines your public key by looking 
- up your <code>user-full-name</code> in your PGP keyring.
+<p>By default notes-mode determines your public key by
+ asking you.
 You can override this default by setting
  <code>notes-encryption-key-id</code>
- to the desired key-id.
+ to the desired key-id (usually 8 hex digits).
 <a name="index-key_002did"></a>
 </p>
 
@@ -502,7 +500,7 @@ These variables are documented in the file
 </tr></table>
 <p>
  <font size="-1">
-  This document was generated by <em>John Heidemann</em> on <em>April 4, 
2012</em> using <a href="http://www.nongnu.org/texi2html/";><em>texi2html 
1.82</em></a>.
+  This document was generated on <i>December 19, 2014</i> using <a 
href="http://www.nongnu.org/texi2html/";><i>texi2html 1.82</i></a>.
  </font>
  <br>
 
diff --git a/HTML/notes-mode_4.html b/HTML/notes-mode_4.html
index eb785a3..85ab60c 100644
--- a/HTML/notes-mode_4.html
+++ b/HTML/notes-mode_4.html
@@ -1,6 +1,6 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html401/loose.dtd";>
 <html>
-<!-- Created on April 4, 2012 by texi2html 1.82
+<!-- Created on December 19, 2014 by texi2html 1.82
 texi2html was written by: 
             Lionel Cons <Lionel.Cons@cern.ch> (original author)
             Karl Berry  <karl@freefriends.org>
@@ -475,6 +475,12 @@ of buffers without going into an infinite loop.
 Clearly wrong code, but you have to ask this guy for why he tried:
 Bug report from Geoff Kuenning.
 </p>
+<p>Changed (2014-12-19): version 1.30
+</p>
+<p>Added support for EasyPG.
+Support for mailcrypt remains, but that library has seen no progress since 
2002.
+Support for npgp is gone.
+</p>
 
 
 <hr size="6">
@@ -521,7 +527,7 @@ are indexed but not date-based.
 </tr></table>
 <p>
  <font size="-1">
-  This document was generated by <em>John Heidemann</em> on <em>April 4, 
2012</em> using <a href="http://www.nongnu.org/texi2html/";><em>texi2html 
1.82</em></a>.
+  This document was generated on <i>December 19, 2014</i> using <a 
href="http://www.nongnu.org/texi2html/";><i>texi2html 1.82</i></a>.
  </font>
  <br>
 
diff --git a/HTML/notes-mode_5.html b/HTML/notes-mode_5.html
index 7e28399..d044f3e 100644
--- a/HTML/notes-mode_5.html
+++ b/HTML/notes-mode_5.html
@@ -1,6 +1,6 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html401/loose.dtd";>
 <html>
-<!-- Created on April 4, 2012 by texi2html 1.82
+<!-- Created on December 19, 2014 by texi2html 1.82
 texi2html was written by: 
             Lionel Cons <Lionel.Cons@cern.ch> (original author)
             Karl Berry  <karl@freefriends.org>
@@ -115,7 +115,7 @@ before running it.
 </tr></table>
 <p>
  <font size="-1">
-  This document was generated by <em>John Heidemann</em> on <em>April 4, 
2012</em> using <a href="http://www.nongnu.org/texi2html/";><em>texi2html 
1.82</em></a>.
+  This document was generated on <i>December 19, 2014</i> using <a 
href="http://www.nongnu.org/texi2html/";><i>texi2html 1.82</i></a>.
  </font>
  <br>
 
diff --git a/HTML/notes-mode_6.html b/HTML/notes-mode_6.html
index 9cbb6d9..1f19a2b 100644
--- a/HTML/notes-mode_6.html
+++ b/HTML/notes-mode_6.html
@@ -1,6 +1,6 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html401/loose.dtd";>
 <html>
-<!-- Created on April 4, 2012 by texi2html 1.82
+<!-- Created on December 19, 2014 by texi2html 1.82
 texi2html was written by: 
             Lionel Cons <Lionel.Cons@cern.ch> (original author)
             Karl Berry  <karl@freefriends.org>
@@ -140,7 +140,7 @@ ul.toc {list-style: none}
 </tr></table>
 <p>
  <font size="-1">
-  This document was generated by <em>John Heidemann</em> on <em>April 4, 
2012</em> using <a href="http://www.nongnu.org/texi2html/";><em>texi2html 
1.82</em></a>.
+  This document was generated on <i>December 19, 2014</i> using <a 
href="http://www.nongnu.org/texi2html/";><i>texi2html 1.82</i></a>.
  </font>
  <br>
 
diff --git a/HTML/notes-mode_7.html b/HTML/notes-mode_7.html
index 3ad23bd..c1a6806 100644
--- a/HTML/notes-mode_7.html
+++ b/HTML/notes-mode_7.html
@@ -1,6 +1,6 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html401/loose.dtd";>
 <html>
-<!-- Created on April 4, 2012 by texi2html 1.82
+<!-- Created on December 19, 2014 by texi2html 1.82
 texi2html was written by: 
             Lionel Cons <Lionel.Cons@cern.ch> (original author)
             Karl Berry  <karl@freefriends.org>
@@ -211,7 +211,7 @@ ul.toc {list-style: none}
 </tr></table>
 <p>
  <font size="-1">
-  This document was generated by <em>John Heidemann</em> on <em>April 4, 
2012</em> using <a href="http://www.nongnu.org/texi2html/";><em>texi2html 
1.82</em></a>.
+  This document was generated on <i>December 19, 2014</i> using <a 
href="http://www.nongnu.org/texi2html/";><i>texi2html 1.82</i></a>.
  </font>
  <br>
 
diff --git a/HTML/notes-mode_abt.html b/HTML/notes-mode_abt.html
index 0671729..3a173c7 100644
--- a/HTML/notes-mode_abt.html
+++ b/HTML/notes-mode_abt.html
@@ -1,6 +1,6 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html401/loose.dtd";>
 <html>
-<!-- Created on April 4, 2012 by texi2html 1.82
+<!-- Created on December 19, 2014 by texi2html 1.82
 texi2html was written by: 
             Lionel Cons <Lionel.Cons@cern.ch> (original author)
             Karl Berry  <karl@freefriends.org>
@@ -50,7 +50,7 @@ ul.toc {list-style: none}
 </tr></table>
 <h1>About This Document</h1>
 <p>
-  This document was generated by <em>John Heidemann</em> on <em>April 4, 
2012</em> using <a href="http://www.nongnu.org/texi2html/";><em>texi2html 
1.82</em></a>.
+  This document was generated on <i>December 19, 2014</i> using <a 
href="http://www.nongnu.org/texi2html/";><i>texi2html 1.82</i></a>.
 </p>
 <p>
   The buttons in the navigation panels have the following meaning:
@@ -158,7 +158,7 @@ ul.toc {list-style: none}
 </tr></table>
 <p>
  <font size="-1">
-  This document was generated by <em>John Heidemann</em> on <em>April 4, 
2012</em> using <a href="http://www.nongnu.org/texi2html/";><em>texi2html 
1.82</em></a>.
+  This document was generated on <i>December 19, 2014</i> using <a 
href="http://www.nongnu.org/texi2html/";><i>texi2html 1.82</i></a>.
  </font>
  <br>
 
diff --git a/HTML/notes-mode_fot.html b/HTML/notes-mode_fot.html
index 088f9d6..e78124f 100644
--- a/HTML/notes-mode_fot.html
+++ b/HTML/notes-mode_fot.html
@@ -1,6 +1,6 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html401/loose.dtd";>
 <html>
-<!-- Created on April 4, 2012 by texi2html 1.82
+<!-- Created on December 19, 2014 by texi2html 1.82
 texi2html was written by: 
             Lionel Cons <Lionel.Cons@cern.ch> (original author)
             Karl Berry  <karl@freefriends.org>
@@ -76,7 +76,7 @@ and the many other normal people who triggered landmark cases.
 </tr></table>
 <p>
  <font size="-1">
-  This document was generated by <em>John Heidemann</em> on <em>April 4, 
2012</em> using <a href="http://www.nongnu.org/texi2html/";><em>texi2html 
1.82</em></a>.
+  This document was generated on <i>December 19, 2014</i> using <a 
href="http://www.nongnu.org/texi2html/";><i>texi2html 1.82</i></a>.
  </font>
  <br>
 
diff --git a/HTML/notes-mode_toc.html b/HTML/notes-mode_toc.html
index f03a834..41a4fe6 100644
--- a/HTML/notes-mode_toc.html
+++ b/HTML/notes-mode_toc.html
@@ -1,6 +1,6 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html401/loose.dtd";>
 <html>
-<!-- Created on April 4, 2012 by texi2html 1.82
+<!-- Created on December 19, 2014 by texi2html 1.82
 texi2html was written by: 
             Lionel Cons <Lionel.Cons@cern.ch> (original author)
             Karl Berry  <karl@freefriends.org>
@@ -102,7 +102,7 @@ ul.toc {list-style: none}
 </tr></table>
 <p>
  <font size="-1">
-  This document was generated by <em>John Heidemann</em> on <em>April 4, 
2012</em> using <a href="http://www.nongnu.org/texi2html/";><em>texi2html 
1.82</em></a>.
+  This document was generated on <i>December 19, 2014</i> using <a 
href="http://www.nongnu.org/texi2html/";><i>texi2html 1.82</i></a>.
  </font>
  <br>
 
diff --git a/Makefile.in b/Makefile.in
index 286bf63..d37bd00 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -152,7 +152,7 @@ html:
 texi: notes-mode.info notes-mode.dvi notes-mode.ps.gz html
 
 # Install_www is only for me.
-WWW_DIR=$$HOME/LIB/WWW/SOFTWARE/NOTES_MODE
+WWW_DIR=$$HOME/WORKING/JOHNH_WWW/SOFTWARE/NOTES_MODE
 install_www: texi
        cp HTML/*.html $(WWW_DIR)
        cp notes-mode.ps.gz $(WWW_DIR)
diff --git a/README b/README
index d26c446..a86d4d2 100644
--- a/README
+++ b/README
@@ -8,6 +8,16 @@ For documentation, see
 or     <http://www.isi.edu/~johnh/SOFTWARE/NOTES_MODE/>
 
 
+ WHAT'S NEW IN NOTES-MODE?
+ -------------------------
+ 
+Changed (2014-12-19): version 1.30
+ 
+Added support for EasyPG.
+Support for mailcrypt remains, but that library has seen no progress since 
2002.
+Support for npgp is gone.
+ 
+ 
 WHAT IS NOTES-MODE?
 -------------------
 
diff --git a/notes-mode.el b/notes-mode.el
index 2f7d766..eb48eb3 100644
--- a/notes-mode.el
+++ b/notes-mode.el
@@ -103,7 +103,8 @@ we go to the last note based upon the index file."
                (goto-char beginning-of-note)))
          (if (re-search-forward (concat "^"
                                         (if (eq which 'next) "next" "prev")
-                                        ":[ ]+<") end-of-note t)
+                                        ":[ ]+<")
+                                end-of-note t)
              (progn ; link exists, just take it
                (beginning-of-line)
                (notes-w3-follow-link (point))
@@ -133,8 +134,7 @@ we go to the last note based upon the index file."
   (notes-follow-link 'prev))
 
 (defvar notes-complete-subject-abbrevs-alist
-  '(("SP2010" "USC/Classes/CS551/SP2010")
-    ("FA2011" "USC/Classes/CS551/FA2011"))
+  '(("FA2014" "USC/Classes/CS551/FA2014"))
   "Alist of simple substitution of subjects.
 If subject completion is requested, then subject that matches
 the left-side of an alist value is replaced by the right-side value.")
@@ -243,7 +243,11 @@ Currently this code only handles brand new entries."
 (defun notes-current-url-as-kill ()
   "* Put the notes-URL of the current entry into the kill ring."
   (interactive)
-  (kill-new (notes-current-url)))
+  (let ((url (notes-current-url)))
+    (message (concat "url to kill: " url))
+
+    (x-set-selection nil url)
+    (kill-new url)))
 
 (defun notes-goto-index-entry (&optional direction)
   "* Jump to the index entry corresponding to our current note entry.
@@ -419,7 +423,8 @@ Use the mknew cache if possible."
 ;;
 
 (defvar notes-encryption-library
-  'mailcrypt
+  'epg
+;  'mailcrypt
 ;  (cond
 ;   ((fboundp 'mc-encrypt-region) 'mailcrypt)
 ;   ((fboundp 'npgp:encrypt-region) 'npgp)
@@ -430,26 +435,6 @@ Use the mknew cache if possible."
   'gpg
   "Variant of mailcrypt to use (`pgp', `pgp50', or `gpg').")
 
-(defvar notes-encryption-npgp-userid nil
-  "PGP key for the current user.")
-
-(defvar notes-encryption-npgp-key-id nil
-  "Keyid of PGP key for the current user.
-Useful if your \\[user-full-name] doesn't match a unique key.
-Should have a leading 0x.")
-
-(defun notes-encryption-npgp-userid ()
-  "Return notes-encryption-userid, initializing it if necessary."
-  (require 'pam)
-  (if (and notes-encryption-userid
-          npgp:*pass-phrases*)
-      notes-encryption-userid
-    (setq notes-encryption-userid
-         (list
-          (if notes-encryption-key-id
-              (npgp:get-key-by-key-id notes-encryption-key-id)
-            (pam:read-name-key (user-full-name)))))))
-
 (defun notes-encryption-mailcrypt-keyid ()
   "Do the right thing."
   (require 'mailcrypt)
@@ -462,6 +447,29 @@ Should have a leading 0x.")
     (cdr (mc-gpg-lookup-key mc-gpg-user-id)))
    (t (error "notes-encryption-decrypt-region: no pgp sub-library."))))
 
+(defvar notes-encryption-key-id nil
+  "The PGP ID of the user's key (usually 8 hex digits).")
+  
+(defvar notes-encryption-epg-key nil
+  "A cached copy of the users epg key.")
+  
+(defun notes-encryption-epg-key (context)
+  "Pick a key-id, if not set."
+  (require 'epg)
+  (cond
+   (notes-encryption-epg-key notes-encryption-epg-key) ;; cache
+   ((null notes-encryption-user-id)
+    (require 'epa)
+    (setq notes-encryption-epg-key
+         (epa-select-keys
+          context
+          "Select your key (or set epg-user-id).  "
+          (user-login-name))))
+   ;; have notes-encryption-user-id, look it up
+   (t (setq notes-encryption-epg-key
+           (epg-list-keys (epg-make-context 'OpenPGP) 
notes-encryption-user-id)))))
+   
+
 (defun notes-encryption-load-mailcrypt ()
   (require 'mailcrypt)
   ;; ick ick ick this code needs to be cleaned up
@@ -478,10 +486,16 @@ Should have a leading 0x.")
 
 (defun notes-encryption-decrypt-region (start end)
   (cond
-   ((eq notes-encryption-library 'npgp)
-    (require 'pam)
-    (require 'npgp)
-    (npgp:decrypt-region start end))
+   ((eq notes-encryption-library 'epg)
+    (let*
+       ((context (epg-make-context 'OpenPGP))
+        (plain
+         (decode-coding-string
+          (epg-decrypt-string context (buffer-substring start end))
+          'utf-8)))
+      (delete-region start end)
+      (goto-char start)
+      (insert plain)))
    ((eq notes-encryption-library 'mailcrypt)
     (notes-encryption-load-mailcrypt)
     (cond
@@ -496,8 +510,17 @@ Should have a leading 0x.")
 
 (defun notes-encryption-encrypt-region (start end)
   (cond
-   ((eq notes-encryption-library 'npgp)
-    (npgp:encrypt-region (notes-encryption-npgp-userid) start end))
+   ((eq notes-encryption-library 'epg)
+    (let*
+       ((context (epg-make-context 'OpenPGP t))
+        (cipher
+         (epg-encrypt-string
+          context
+          (encode-coding-string (buffer-substring start end) 'utf-8)
+          (notes-encryption-epg-key context))))
+      (delete-region start end)
+      (goto-char start)
+      (insert cipher)))
    ((eq notes-encryption-library 'mailcrypt)
     (notes-encryption-load-mailcrypt)
     (let ((old-sign mc-pgp-always-sign)
diff --git a/notes-mode.texi b/notes-mode.texi
index 60382c2..b657a6d 100644
--- a/notes-mode.texi
+++ b/notes-mode.texi
@@ -929,12 +929,10 @@ In such systems,
 Notes-mode encryption is based
  Phill Zimmerman's PGP (Pretty Good Privacy)
 (see @file{http://www.mantis.co.uk/pgp/pgp.html})
- and either
- with Rick Campbell's
- emacs interface, PAM (PGP Augmented Messaging)
-(from @file{ftp://h.gp.cs.cmu.edu/usr/rfb/pam/})
- (note that as of January 1997, PAM is no longer at this ftp site
- and appears to not be publicly available),
+ and requires either
+ EasyPG
+ (installed with emacs-24)
+ or
  or LoPresti and Choi's mailcrypt
 (from @file{http://cag-www.lcs.mit.edu/mailcrypt/}).
 @cindex PGP
@@ -958,11 +956,11 @@ Decrypt the current note
 @end table
 @kindex C-c C-d
 
-By default notes-mode determines your public key by looking 
- up your @code{user-full-name} in your PGP keyring.
+By default notes-mode determines your public key by
+ asking you.
 You can override this default by setting
  @code{notes-encryption-key-id}
- to the desired key-id.
+ to the desired key-id (usually 8 hex digits).
 @cindex key-id
 
 
@@ -1484,6 +1482,12 @@ of buffers without going into an infinite loop.
 Clearly wrong code, but you have to ask this guy for why he tried:
 Bug report from Geoff Kuenning.
 
+Changed (2014-12-19): version 1.30
+
+Added support for EasyPG.
+Support for mailcrypt remains, but that library has seen no progress since 
2002.
+Support for npgp is gone.
+
 
 @c ----------------------------------------------------------------------
 



reply via email to

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