changeset 110517:64945cefe6a6

Merge changes made in Gnus trunk. gnus-html.el (gnus-html-encode-url-chars): New function, that's an alias to browse-url-url-encode-chars if any. nnir.el: Silence the byte compiler.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Fri, 24 Sep 2010 00:38:10 +0000
parents 4d2f8b81bb01
children 826d60163924
files lisp/gnus/ChangeLog lisp/gnus/gnus-html.el lisp/gnus/nnir.el
diffstat 3 files changed, 32 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/ChangeLog	Thu Sep 23 23:14:02 2010 +0000
+++ b/lisp/gnus/ChangeLog	Fri Sep 24 00:38:10 2010 +0000
@@ -1,3 +1,11 @@
+2010-09-24  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* nnir.el: Silence the byte compiler.
+
+	* gnus-html.el (gnus-html-encode-url-chars): New function, that's an
+	alias to browse-url-url-encode-chars if any.
+	(gnus-html-encode-url): Use it.
+
 2010-09-23  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
 	* gnus-start.el (gnus-use-backend-marks): New variable.
--- a/lisp/gnus/gnus-html.el	Thu Sep 23 23:14:02 2010 +0000
+++ b/lisp/gnus/gnus-html.el	Fri Sep 24 00:38:10 2010 +0000
@@ -88,9 +88,27 @@
     (define-key map [tab] 'widget-forward)
     map))
 
+(eval-and-compile
+  (defalias 'gnus-html-encode-url-chars
+    (if (fboundp 'browse-url-url-encode-chars)
+	'browse-url-url-encode-chars
+      (lambda (text chars)
+	"URL-encode the chars in TEXT that match CHARS.
+CHARS is a regexp-like character alternative (e.g., \"[)$]\")."
+	(let ((encoded-text (copy-sequence text))
+	      (s 0))
+	  (while (setq s (string-match chars encoded-text s))
+	    (setq encoded-text
+		  (replace-match (format "%%%x"
+					 (string-to-char
+					  (match-string 0 encoded-text)))
+				 t t encoded-text)
+		  s (1+ s)))
+	  encoded-text)))))
+
 (defun gnus-html-encode-url (url)
   "Encode URL."
-  (browse-url-url-encode-chars url "[)$ ]"))
+  (gnus-html-encode-url-chars url "[)$ ]"))
 
 (defun gnus-html-cache-expired (url ttl)
   "Check if URL is cached for more than TTL."
--- a/lisp/gnus/nnir.el	Thu Sep 23 23:14:02 2010 +0000
+++ b/lisp/gnus/nnir.el	Fri Sep 24 00:38:10 2010 +0000
@@ -956,6 +956,11 @@
 (autoload 'imap-search "imap")
 (autoload 'imap-quote-specials "imap")
 
+(eval-when-compile
+  (autoload 'nnimap-buffer "nnimap")
+  (autoload 'nnimap-command "nnimap")
+  (autoload 'nnimap-possibly-change-group "nnimap"))
+
 (defun nnir-run-imap (query srv &optional group-option)
   "Run a search against an IMAP back-end server.
 This uses a custom query language parser; see `nnir-imap-make-query' for