all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Drew Adams" <drew.adams@oracle.com>
Cc: 'Eli Zaretskii' <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: next emacs version?
Date: Sun, 21 Mar 2010 21:22:12 -0400	[thread overview]
Message-ID: <jwvsk7tdutr.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <A0F8070B5E0947C2AEBA46B5152946E3@us.oracle.com> (Drew Adams's message of "Sat, 20 Mar 2010 16:09:23 -0700")

>>> That would involve my code with the bug-fix code (logic).
>> Not at all.  It simply amounts to writing the unit-test that checks
>> whether the bug is fixed: (string-match <regexp> <problematic-dired-line>)
>> It's simple and robust.

> That's precisely what I mean by involving my code with the bug-fix
> code: adding a unit-test for an unrelated bug fix in the middle of
> font-lock keywords. Extra code-coupling.

> *Why* the regexp is the way it is (better support for file names that
> include ISO dates, or whatever) is unimportant for the font-lock code
> logic. That code should not care how the regexp does its job of
> matching a date and file-name or which formats are currently
> supported. All that the font-lock code cares about is picking up the
> correct regexp group for the date+time info.

Now that you say what you want, I can even agree that there's a better
solution which is to just check what you want:

   (list dired-move-to-filename-regexp
         (let ((test "<some random dired line>"))
           (when (string-match dired-move-to-filename-regexp test)
             (list
              (cond
               ((equal (match-string 2 test) "<the line's date>") 2)
               ((equal (match-string 1 test) "<the line's date>") 1))
              'diredp-date-time t t)))
           (list 1 'diredp-date-time t t))
         (list "\\(.+\\)$" nil nil   ; File w/o suffix
               (list 0 diredp-file-name 'keep t)))

You could even loop through all submatches to find the one which matches
the date.


        Stefan




  parent reply	other threads:[~2010-03-22  1:22 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-19 11:23 next emacs version? Drew Adams
2010-03-19 13:22 ` Eli Zaretskii
2010-03-19 17:29   ` Drew Adams
2010-03-19 18:09     ` Eli Zaretskii
2010-03-19 18:46       ` Drew Adams
2010-03-19 19:02         ` Eli Zaretskii
2010-03-19 20:02           ` Drew Adams
2010-03-19 21:15             ` Eli Zaretskii
2010-03-19 21:23               ` Drew Adams
2010-03-20  2:35                 ` Ken Raeburn
2010-03-20  2:39                   ` Lennart Borgman
2010-03-20  3:42                     ` Óscar Fuentes
2010-03-20 15:51                       ` Lennart Borgman
2010-03-20  5:31                     ` Ken Raeburn
2010-03-23  2:05                     ` Stephen J. Turnbull
2010-03-20  3:38                   ` Drew Adams
2010-03-20  5:31                     ` Ken Raeburn
2010-03-20  6:51                       ` Drew Adams
2010-03-20  5:31                     ` Ken Raeburn
2010-03-20  6:51                       ` Drew Adams
2010-03-23  2:34                     ` Stephen J. Turnbull
2010-03-23  5:01                       ` Miles Bader
2010-03-23  5:39                       ` Drew Adams
2010-03-20  3:51                 ` Jason Rumney
2010-03-20  6:47                   ` Drew Adams
2010-03-20  8:39                   ` Eli Zaretskii
2010-03-20 14:58                     ` Drew Adams
2010-03-20 16:22                       ` Eli Zaretskii
2010-03-20  8:11                 ` Eli Zaretskii
2010-03-19 20:55           ` Stefan Monnier
2010-03-19 21:16             ` Drew Adams
2010-03-20 19:10               ` Stefan Monnier
2010-03-20 20:29                 ` Drew Adams
2010-03-20 21:53                   ` Stefan Monnier
2010-03-20 23:09                     ` Drew Adams
2010-03-20 23:26                       ` Drew Adams
2010-03-22  1:22                       ` Stefan Monnier [this message]
2010-03-22  7:22                         ` Drew Adams
2010-03-22 13:52                           ` Stefan Monnier
2010-03-21 21:34     ` Thien-Thi Nguyen
2010-03-21 23:20       ` Drew Adams
2010-03-19 14:52 ` Chong Yidong

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=jwvsk7tdutr.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=drew.adams@oracle.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@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.