unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* pattern matching and date formatting
@ 2010-06-08 17:21 Kamil Jońca
  0 siblings, 0 replies; only message in thread
From: Kamil Jońca @ 2010-06-08 17:21 UTC (permalink / raw)
  To: help-gnu-emacs


(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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-06-08 17:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-08 17:21 pattern matching and date formatting Kamil Jońca

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).