From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/38880 Path: main.gmane.org!not-for-mail From: Daiki Ueno Newsgroups: gmane.emacs.gnus.general Subject: specifying the charset of the query string with nnir/imap Date: Sun, 23 Sep 2001 11:48:14 +0900 Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Sun_Sep_23_11:48:14_2001-1" X-Trace: main.gmane.org 1035174677 24891 80.91.224.250 (21 Oct 2002 04:31:17 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 04:31:17 +0000 (UTC) Return-Path: Return-Path: Original-Received: (qmail 21797 invoked from network); 23 Sep 2001 02:43:53 -0000 Original-Received: from g96069.scn-net.ne.jp (HELO deisui.bug.org) (210.231.96.69) by gnus.org with SMTP; 23 Sep 2001 02:43:53 -0000 Original-Received: from deisui.bug.org (localhost [127.0.0.1]) by deisui.bug.org (8.12.0/8.12.0/Debian -3) with ESMTP id f8N2mFfs014049 for ; Sun, 23 Sep 2001 11:48:16 +0900 Original-To: ding@gnus.org X-Face: ki?-"~Ovqy(#SEZ2FpdUK,3>)p.@}$.vl{eIZ-Uy43$&[S1#'y{hX&A3T@xA)u0!_4Lg.vA ^{d(.VU0(X#Zf,~9Kha_$nl7W/(b9r;]%_&:OUA@g0LF'S2<%~T User-Agent: T-gnus/6.15.4 (based on Oort Gnus v0.04) (revision 06) Original-Lines: 77 Xref: main.gmane.org gmane.emacs.gnus.general:38880 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:38880 --Multipart_Sun_Sep_23_11:48:14_2001-1 Content-Type: text/plain; charset=US-ASCII I'm using nnir 1.72. Whenever I enter Japanese chars, I get the following error: >Search produced empty results. >Couldn't request group: Search produced empty results. The attached patch is just to bring it off by asserting optional CHARSET argument for the UID SEARCH command. --Multipart_Sun_Sep_23_11:48:14_2001-1 Content-Type: application/octet-stream; type=patch Content-Disposition: attachment; filename="nnir.el.diff" Content-Transfer-Encoding: 7bit --- nnir.el~ Sun Sep 23 11:30:13 2001 +++ nnir.el Sun Sep 23 10:55:45 2001 @@ -461,6 +461,11 @@ (defcustom nnir-excite-remove-prefix (co :type '(regexp) :group 'nnir) +(defcustom nnir-imap-search-charset nil + "*Name of the charset of the strings that appear in the search criteria." + :type '(choice (const nil) string) + :group 'nnir) + ;; Swish++. Next three variables Copyright (C) 2000, 2001 Christoph ;; Conrad . ;; Swish++ home page: http://homepage.mac.com/pauljlucas/software/swish/ @@ -959,6 +964,9 @@ (defun nnir-run-excite-search (query &op ;; send queries as literals ;; handle errors +(eval-and-compile + (autoload 'mm-charset-to-coding-system "mm-util")) + (defun nnir-run-imap (query &optional group) (require 'imap) (require 'nnimap) @@ -975,13 +983,21 @@ (defun nnir-run-imap (query &optional gr (setq buf nnimap-server-buffer) ;; xxx (message "Searching %s..." group) (let ((arts 0) - (mbx (gnus-group-real-name group))) + (mbx (gnus-group-real-name group)) + coding-system) (when (imap-mailbox-select mbx nil buf) (mapcar (lambda (artnum) (push (vector mbx artnum 1) artlist) (setq arts (1+ arts))) - (imap-search (concat "TEXT \"" qstring "\"") buf)) + (if (and nnir-imap-search-charset + (setq coding-system (mm-charset-to-coding-system + nnir-imap-search-charset))) + (imap-search + (concat "CHARSET " nnir-imap-search-charset " TEXT \"" + (mm-encode-coding-string qstring coding-system) + "\"") buf) + (imap-search (concat "TEXT \"" qstring "\"") buf))) (message "Searching %s... %d matches" mbx arts))) (message "Searching %s...done" group)) (quit nil)) --Multipart_Sun_Sep_23_11:48:14_2001-1 Content-Type: text/plain; charset=US-ASCII Regards, -- Daiki Ueno --Multipart_Sun_Sep_23_11:48:14_2001-1--