From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: kjonca@poczta.onet.pl (Kamil =?iso-8859-2?Q?Jo=F1ca?=) Newsgroups: gmane.emacs.help Subject: pattern matching and date formatting Date: Tue, 08 Jun 2010 19:21:08 +0200 Organization: Aster Sp. z o.o. Message-ID: <87r5kh302y.fsf@alfa.kjonca> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1291829528 32533 80.91.229.12 (8 Dec 2010 17:32:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 8 Dec 2010 17:32:08 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 08 18:32:04 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQNs3-00049S-Of for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 18:32:03 +0100 Original-Received: from localhost ([127.0.0.1]:49956 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQNs2-0004Pj-Ps for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 12:32:02 -0500 Original-Path: usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!t-online.de!plix.pl!newsfeed1.plix.pl!nntp.aster.pl!newsread1.aster.pl!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 35 Original-NNTP-Posting-Host: circinus.aster.net.pl Original-X-Trace: newsread1.aster.pl 1276018201 17042 85.222.105.11 (8 Jun 2010 17:30:01 GMT) Original-X-Complaints-To: abuse@aster.pl Original-NNTP-Posting-Date: Tue, 8 Jun 2010 17:30:01 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:VLBvAY5ifFeAZX+GA2lWheNfYNo= Original-Xref: usenet.stanford.edu gnu.emacs.help:178737 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:75701 Archived-At: (posted to gnu.emacs.gnus by mistake) I tried to make my own search engine for imap (I cannot make nnir-imap to search with multiple criteria like "from" & "sent-date" - am I missing somethig?) Code is at: http://strony.aster.pl/kjonca/nnir-local.el (shamelessly copied and modified nnir-imap code) My questions are: 1. #v+ (string-match "\\([[:digit:]]\\{1,2\\}/[[:digit:]]\\{1,2\\}/[[:digit:]]\\{4\\}\\)?-\\([[:digit:]]\\{1,2\\}/[[:digit:]]\\{1,2\\}/[[:digit:]]\\{4\\}\\)?" datestring) (message "Date range: %s " (match-string 1 datestring)) ( setq dmin (match-string 1 datestring )) ( setq dmax (match-string 2 datestring )) (message "Date range: dmin=%s dmax=%s end=%d" dmin dmax (match-end 0)) #v- when I used "(match-string 1)" instead of "(match-string 1 datestring)", it uses whole string not "datestring" variable as in "string-match". Why? 2. #v+ (format-time-string "%d-%b-%Y" (encode-time 0 0 0 (string-to-number dday) (string-to-number dmon) (string-to-number dyear) )) #v- %b - locale's abbreviated month name - can I make to use C locale here? KJ -- http://blogdebart.pl/2010/03/17/dalsze-przygody-swinki-w-new-jersey/ Niebawem ludziom, zwierzętom, i książkom wyrosną antenki. GW