changeset 110968:3958dbde1223

Merge changes made in Gnus trunk. auth.texi (GnuPG and EasyPG Assistant Configuration): Fix syntax and trim sentence. shr.el (shr-current-column): Remove buggy and unnecessary function. auth.texi: Fix up pxref/xref. auth.texi (GnuPG and EasyPG Assistant Configuration): Fix up the @item syntax for in-Emacs makeinfo. gnus-spec.el (gnus-parse-simple-format): princ doesn't really insert anything in Emacs. mm-decode.el (mm-shr): Allow use from non-Gnus users. nnimap.el (nnimap-parse-flags): Be more strict when looking for FETCH responses. nnimap.el, tls.el: Rip the STARTTLS stuff out of tls.el again, and just bind it directly from nnimap. shr.el (shr-find-fill-point): Use a filling algorithm that should probably work for CJVK text, too. nnimap.el (nnimap-open-connection): Fix open-tls-stream call. nnimap.el (nnimap-parse-flags): Fix regexp. tls.el (tls-program): Remove spurious %s from openssl. shr.el (shr-find-fill-point): Don't inloop on indented text.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Wed, 13 Oct 2010 22:21:20 +0000
parents 188673195616
children f8cb84d0e6ee
files doc/misc/ChangeLog doc/misc/auth.texi lisp/ChangeLog lisp/gnus/ChangeLog lisp/gnus/gnus-spec.el lisp/gnus/mm-decode.el lisp/gnus/nnimap.el lisp/gnus/shr.el lisp/net/tls.el
diffstat 9 files changed, 75 insertions(+), 59 deletions(-) [+]
line wrap: on
line diff
--- a/doc/misc/ChangeLog	Wed Oct 13 16:50:06 2010 +0200
+++ b/doc/misc/ChangeLog	Wed Oct 13 22:21:20 2010 +0000
@@ -1,3 +1,13 @@
+2010-10-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* auth.texi (GnuPG and EasyPG Assistant Configuration): Fix up the
+	@item syntax for in-Emacs makeinfo.
+
+2010-10-13  Teodor Zlatanov  <tzz@lifelogs.com>
+
+	* auth.texi (GnuPG and EasyPG Assistant Configuration): Fix syntax and
+	trim sentence.
+
 2010-10-12  Daiki Ueno  <ueno@unixuser.org>
 
 	* epa.texi (Caching Passphrases):
--- a/doc/misc/auth.texi	Wed Oct 13 16:50:06 2010 +0200
+++ b/doc/misc/auth.texi	Wed Oct 13 22:21:20 2010 +0000
@@ -177,8 +177,8 @@
 
 If you don't customize @code{auth-sources}, you'll have to live with
 the defaults: any host and any port are looked up in the netrc
-file @code{~/.authinfo.gpg}, which is a GnuPG encrypted file.
-@xref{GnuPG and EasyPG Assistant Configuration}.
+file @code{~/.authinfo.gpg}, which is a GnuPG encrypted file
+(@pxref{GnuPG and EasyPG Assistant Configuration}).
 
 The simplest working netrc line example is one without a port.
 
@@ -271,9 +271,8 @@
 reads @code{~/.authinfo.gpg}, which is a GnuPG encrypted file.
 
 In Emacs 23 or later there is an option @code{auto-encryption-mode} to
-automatically decrypt @code{*.gpg} files.  It is enabled by default so
-there is no setting is needed.  If you are using earlier versions of
-Emacs, you will need:
+automatically decrypt @code{*.gpg} files.  It is enabled by default.
+If you are using earlier versions of Emacs, you will need:
 
 @lisp
 (require 'epa-file)
@@ -282,14 +281,17 @@
 
 If you want your GnuPG passwords to be cached, set up @code{gpg-agent}
 or EasyPG Assitant
-@pxref{Caching Passphrases, , Caching Passphrases, epa}
+@xref{Caching Passphrases, , Caching Passphrases, epa}
 
 To quick start, here are some questions:
 
 @enumerate
-@item Do you use GnuPG version 2 instead of GnuPG version 1?
-@item Do you use symmetric encryption rather than public key encryption?
-@item Do you want to use gpg-agent?
+@item
+Do you use GnuPG version 2 instead of GnuPG version 1?
+@item
+Do you use symmetric encryption rather than public key encryption?
+@item
+Do you want to use gpg-agent?
 @end enumerate
 
 Here are configurations depending on your answers:
@@ -306,8 +308,8 @@
 @item No @tab No @tab No @tab You can't, without gpg-agent.
 @end multitable
 
-To set up gpg-agent, follow the instruction in GnuPG manual.
-@pxref{Invoking GPG-AGENT, , Invoking GPG-AGENT, gnupg}.
+To set up gpg-agent, follow the instruction in GnuPG manual
+(@pxref{Invoking GPG-AGENT, , Invoking GPG-AGENT, gnupg}).
 
 To set up elisp passphrase cache, set
 @code{epa-file-cache-passphrase-for-symmetric-encryption}.
--- a/lisp/ChangeLog	Wed Oct 13 16:50:06 2010 +0200
+++ b/lisp/ChangeLog	Wed Oct 13 22:21:20 2010 +0000
@@ -1,3 +1,10 @@
+2010-10-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* net/tls.el (tls-program): Remove spurious %s from openssl.
+	(tls-starttls-switches): Remove starttls hack.
+	(open-tls-stream): Ditto.
+	(tls-find-starttls-argument): Ditto.
+
 2010-10-13  Juanma Barranquero  <lekktu@gmail.com>
 
 	* image.el (image-library-alist): Declare as obsolete alias.
--- a/lisp/gnus/ChangeLog	Wed Oct 13 16:50:06 2010 +0200
+++ b/lisp/gnus/ChangeLog	Wed Oct 13 22:21:20 2010 +0000
@@ -1,3 +1,30 @@
+2010-10-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* shr.el (shr-find-fill-point): Don't inloop on indented text.
+
+	* nnimap.el (nnimap-open-connection): Fix open-tls-stream call.
+	(nnimap-parse-flags): Fix regexp.
+
+	* shr.el (shr-find-fill-point): Use a filling algorithm that should
+	probably work for CJVK text, too.
+
+	* nnimap.el (nnimap-extend-tls-programs): Removed.
+	(nnimap-open-connection): Bind STARTTLS to openssl explicitly.
+
+2010-10-13  Julien Danjou  <julien@danjou.info>
+
+	* nnimap.el (nnimap-parse-flags): Be more strict when looking for FETCH
+	responses.
+
+2010-10-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* mm-decode.el (mm-shr): Allow use from non-Gnus users.
+
+	* gnus-spec.el (gnus-parse-simple-format): princ doesn't really insert
+	anything in Emacs.
+
+	* shr.el (shr-current-column): Remove buggy and unnecessary function.
+
 2010-10-13  Julien Danjou  <julien@danjou.info>
 
 	* shr.el (shr-width): Make shr-width a defcustom with default to
--- a/lisp/gnus/gnus-spec.el	Wed Oct 13 16:50:06 2010 +0200
+++ b/lisp/gnus/gnus-spec.el	Wed Oct 13 22:21:20 2010 +0000
@@ -680,7 +680,7 @@
       ((string= fstring "%d")
        (setq dontinsert t)
        (if insert
-	   (list `(princ ,(car flist)))
+	   `(insert (int-to-string ,(car flist)))
 	 (list `(int-to-string ,(car flist)))))
       ;; Just lots of chars and strings.
       ((string-match "\\`\\(%[cs]\\)+\\'" fstring)
--- a/lisp/gnus/mm-decode.el	Wed Oct 13 16:50:06 2010 +0200
+++ b/lisp/gnus/mm-decode.el	Wed Oct 13 22:21:20 2010 +0000
@@ -1691,8 +1691,11 @@
   ;; Require since we bind its variables.
   (require 'shr)
   (let ((article-buffer (current-buffer))
-	(shr-blocked-images (with-current-buffer gnus-summary-buffer
-			      gnus-blocked-images))
+	(shr-blocked-images (if (and (boundp 'gnus-summary-buffer)
+				     (buffer-name gnus-summary-buffer))
+				(with-current-buffer gnus-summary-buffer
+				  gnus-blocked-images)
+			      shr-blocked-images))
 	(shr-content-function (lambda (id)
 				(let ((handle (mm-get-content-id id)))
 				  (when handle
--- a/lisp/gnus/nnimap.el	Wed Oct 13 16:50:06 2010 +0200
+++ b/lisp/gnus/nnimap.el	Wed Oct 13 22:21:20 2010 +0000
@@ -318,11 +318,10 @@
 		 (setq port (or nnimap-server-port "imap")))
 		'("imap"))
 	       ((eq nnimap-stream 'starttls)
-		(let ((tls-program (nnimap-extend-tls-programs)))
+		(let ((tls-program "openssl s_client %s -connect %h:%p -no_ssl2 -ign_eof -starttls imap"))
 		  (open-tls-stream
 		   "*nnimap*" (current-buffer) nnimap-address
-		   (setq port (or nnimap-server-port "imap"))
-		   'starttls))
+		   (setq port (or nnimap-server-port "imap"))))
 		'("imap"))
 	       ((memq nnimap-stream '(ssl tls))
 		(funcall (if (fboundp 'open-gnutls-stream)
@@ -419,19 +418,6 @@
 		(nnimap-command "ENABLE QRESYNC"))
 	      (nnimap-process nnimap-object))))))))
 
-(defun nnimap-extend-tls-programs ()
-  (let ((programs tls-program)
-	result)
-    (unless (consp programs)
-      (setq programs (list programs)))
-    (dolist (program programs)
-      (when (assoc (car (split-string program)) tls-starttls-switches)
-	(push (if (not (string-match "%s" program))
-		  (concat program " " "%s")
-		program)
-	      result)))
-    (nreverse result)))
-
 (defun nnimap-find-parameter (parameter elems)
   (let (result)
     (dolist (elem elems)
@@ -1303,7 +1289,7 @@
 		(setq start end))
 	    (setq start (point))
 	    (goto-char end))
-	  (while (search-forward " FETCH " start t)
+	  (while (re-search-forward "^\\* [0-9]+ FETCH " start t)
 	    (setq elems (read (current-buffer)))
 	    (push (cons (cadr (memq 'UID elems))
 			(cadr (memq 'FLAGS elems)))
--- a/lisp/gnus/shr.el	Wed Oct 13 16:50:06 2010 +0200
+++ b/lisp/gnus/shr.el	Wed Oct 13 22:21:20 2010 +0000
@@ -219,8 +219,8 @@
 	(unless shr-start
 	  (setq shr-start (point)))
 	(insert elem)
-	(when (> (shr-current-column) shr-width)
-	  (if (not (search-backward " " (line-beginning-position) t))
+	(while (> (current-column) shr-width)
+	  (if (not (shr-find-fill-point))
 	      (insert "\n")
 	    (delete-char 1)
 	    (insert "\n")
@@ -235,23 +235,16 @@
 (defun shr-find-fill-point ()
   (let ((found nil))
     (while (and (not found)
-		(not (bolp)))
-      (when (or (eq (preceding-char) ? )
-		(aref fill-find-break-point-function-table (preceding-char)))
+		(> (current-column) shr-indentation))
+      (when (and (or (eq (preceding-char) ? )
+		     (aref fill-find-break-point-function-table
+			   (preceding-char)))
+		 (<= (current-column) shr-width))
 	(setq found (point)))
       (backward-char 1))
     (or found
 	(end-of-line))))
 
-(defun shr-current-column ()
-  (let ((column 0))
-    (save-excursion
-      (beginning-of-line)
-      (while (not (eolp))
-	(incf column (char-width (following-char)))
-	(forward-char 1)))
-    column))
-
 (defun shr-ensure-newline ()
   (unless (zerop (current-column))
     (insert "\n")))
--- a/lisp/net/tls.el	Wed Oct 13 16:50:06 2010 +0200
+++ b/lisp/net/tls.el	Wed Oct 13 22:21:20 2010 +0000
@@ -75,13 +75,9 @@
   :type 'regexp
   :group 'tls)
 
-(defvar tls-starttls-switches
-  '(("openssl" "-starttls imap"))
-  "Alist of programs and the switches necessary to get starttls behaviour.")
-
 (defcustom tls-program '("gnutls-cli --insecure -p %p %h"
 			 "gnutls-cli --insecure -p %p %h --protocols ssl3"
-			 "openssl s_client %s -connect %h:%p -no_ssl2 -ign_eof")
+			 "openssl s_client -connect %h:%p -no_ssl2 -ign_eof")
   "List of strings containing commands to start TLS stream to a host.
 Each entry in the list is tried until a connection is successful.
 %h is replaced with server hostname, %p with port to connect to.
@@ -203,7 +199,7 @@
 	    (push (cons (match-string 1) (match-string 2)) vals))
 	  (nreverse vals))))))
 
-(defun open-tls-stream (name buffer host port &optional starttlsp)
+(defun open-tls-stream (name buffer host port)
   "Open a TLS connection for a port to a host.
 Returns a subprocess-object to represent the connection.
 Input and output work as for subprocesses; `delete-process' closes it.
@@ -233,9 +229,6 @@
 	       (format-spec
 		cmd
 		(format-spec-make
-		 ?s (if starttlsp
-			(tls-find-starttls-argument cmd)
-		      "")
 		 ?h host
 		 ?p (if (integerp port)
 			(int-to-string port)
@@ -307,11 +300,6 @@
       (kill-buffer buffer))
     done))
 
-(defun tls-find-starttls-argument (command)
-  (let ((command (car (split-string command))))
-    (or (cadr (assoc command tls-starttls-switches))
-	"")))
-
 (provide 'tls)
 
 ;;; tls.el ends here