[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ange-ftp + cperl-mode + replace-string bug
From: |
Stefan Monnier |
Subject: |
Re: ange-ftp + cperl-mode + replace-string bug |
Date: |
Sun, 13 Jan 2002 17:21:09 -0500 |
> Is there any reason why we don't do `save-match-data'
> directly inside `ange-ftp-hook-function' once and for all instead
>
> It would certainly not be WRONG to do this. It could perhaps
> make an undesirable slowdown in some file operations
> that don't really touch the file system and therefore are fast.
> But perhaps even in that case the slowdown is insignificant.
> So please give this idea a try.
It can only be a slowdown if the rest of the code does not
do any regexp-matching (because if it does, it already does
save-match-data anyway) and I must say that I doubt there
are many file operations in ange-ftp (or in any other file handler)
that can be efficiently implemented without regexp-matching.
In other words, I'm confident that performance is a complete non-issue
in this case. The only question is correctness. So if you say
it's not WRONG to do the save-match-data in `ange-ftp-hook-function',
I'll do the change.
Stefan
PS: I actually think that the save-match-data should perhaps be done directly
at the points where the file-name-handlers are called (i.e. so that
ange-ftp and friends don't need to do save-match-data any more).
Better yet, the match-data should be saved and set to the match-data
result of matching the file-name-handler-alist regexp to the file name,
since most/all file-name-handlers begin by doing something
like (string-match handler-regexp file-name) in order to parse the
file-name.
But this is not a trivial change so I'll just keep it in my box of
ideas to try out.