gnus-html.el (gnus-html-encode-url-chars): New function, that's an alias to browse...
authorKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 24 Sep 2010 00:34:40 +0000 (00:34 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 24 Sep 2010 00:34:40 +0000 (00:34 +0000)
nnir.el: Silence the byte compiler.

lisp/ChangeLog
lisp/gnus-html.el
lisp/nnir.el

index d74e98c..68e46c6 100644 (file)
@@ -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.
index a693a2b..5199f7d 100644 (file)
@@ -88,9 +88,27 @@ fit these criteria."
     (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."
index 9fe37ba..ec22c78 100644 (file)
@@ -956,6 +956,11 @@ pairs (also vectors, actually)."
 (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