emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: find-file-noselect needs save-match-data


From: Herbert Euler
Subject: Re: find-file-noselect needs save-match-data
Date: Wed, 06 Jun 2007 09:44:15 +0800

> While you're there, could you look at some other functions in
> files.el as well?  At least `convert-standard-filename',
> `file-truename', `file-name-sans-versions', `insert-directory',
> could benefit from `save-match-data' too.

No.  Most functions should not need to save-match-data (which is an
expensive operation very rarely needed).  The place to save-match-data is
typically on functions that use regexps and are placed on some sensitive
hooks (or at the pbvious place when a function needs to call
regexp-manipulating code between a regexp-match and its use of the
match-data).

I don't understand.  In this case, `find-file-noselect' uses regexps,
and is placed on `post-command-hook' indirectly (I don't know whether
`post-command-hook' is sensitive).

Following your opinion, I conclude that it's type-break's
responsibility to know `find-file-noselect' uses regexps and so it
should use `save-match-data' when placing it to `post-command-hook'.
While the name `find-file-noselect' does not indicate it uses regexps,
and so does its document, it is more or less not appropriate of this
conclusion to me.

Regards,
Guanpeng Xu

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]