all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: kjonca@poczta.onet.pl (Kamil Jońca)
To: help-gnu-emacs@gnu.org
Subject: pattern matching and date formatting
Date: Tue, 08 Jun 2010 19:21:08 +0200	[thread overview]
Message-ID: <87r5kh302y.fsf@alfa.kjonca> (raw)


(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


                 reply	other threads:[~2010-06-08 17:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r5kh302y.fsf@alfa.kjonca \
    --to=kjonca@poczta.onet.pl \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.