* Bug in ange-ftp parsing of ls output
@ 2005-10-19 14:08 Kim F. Storm
2005-10-20 20:11 ` Michael Albinus
0 siblings, 1 reply; 11+ messages in thread
From: Kim F. Storm @ 2005-10-19 14:08 UTC (permalink / raw)
In CVS emacs:
I'm using redhat 9.0, whose ftp server identifies itself as
FTP server (Version 5.60) ready.
I've digged out the following line from the response to an
ls -al command:
-rw------- 1 kfs 0 May 27 2003 .autorun.lck
Now, if I position the cursor at the beginning of that line
and enter
M-: (ange-ftp-parse-filename) RET
it returns:
"27 2003 .autorun.lck"
If I do
M-: (re-search-forward ange-ftp-date-regexp nil t) RET
at that position, point moves to the "M" in May.
This is obviously wrong, but the ange-ftp-date-regexp is beyond me:
"[0-9] \\(\\(\\([A-Za-z]\\|[^\0-\x7f]\\)\\([A-Za-z]\\|[^\0-\x7f]\\)+[.]?,? * [ 0-3][0-9][.]?\\|[ 0-3][0-9][.]? \\([A-Za-z]\\|[^\0-\x7f]\\)\\([A-Za-z]\\|[^\0-\x7f]\\)+[.]?,? *\\)\\|[ 0-1][0-9][^\0-\x7f] [ 0-3][0-9][.]?[^\0-\x7f]\\) "
If I change the line to
-rw------- 1 kfs 10 May 27 2003 .autorun.lck
it still fails, but this line works:
-rw------- 1 kfs 100 May 27 2003 .autorun.lck
What's going on?
--
Kim F. Storm <storm@cua.dk> http://www.cua.dk
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Bug in ange-ftp parsing of ls output
2005-10-19 14:08 Bug in ange-ftp parsing of ls output Kim F. Storm
@ 2005-10-20 20:11 ` Michael Albinus
2005-10-21 3:08 ` Stefan Monnier
0 siblings, 1 reply; 11+ messages in thread
From: Michael Albinus @ 2005-10-20 20:11 UTC (permalink / raw)
Cc: emacs-devel
storm@cua.dk (Kim F. Storm) writes:
> I've digged out the following line from the response to an
> ls -al command:
>
> -rw------- 1 kfs 0 May 27 2003 .autorun.lck
>
> Now, if I position the cursor at the beginning of that line
> and enter
>
> M-: (ange-ftp-parse-filename) RET
>
> it returns:
>
> "27 2003 .autorun.lck"
>
> If I do
> M-: (re-search-forward ange-ftp-date-regexp nil t) RET
> at that position, point moves to the "M" in May.
>
> This is obviously wrong, but the ange-ftp-date-regexp is beyond me:
>
> "[0-9] \\(\\(\\([A-Za-z]\\|[^\0-\x7f]\\)\\([A-Za-z]\\|[^\0-\x7f]\\)+[.]?,? * [ 0-3][0-9][.]?\\|[ 0-3][0-9][.]? \\([A-Za-z]\\|[^\0-\x7f]\\)\\([A-Za-z]\\|[^\0-\x7f]\\)+[.]?,? *\\)\\|[ 0-1][0-9][^\0-\x7f] [ 0-3][0-9][.]?[^\0-\x7f]\\) "
This way the regexp is beyond me, too. Fortunately, it is well
documented in the ange-ftp.el sources.
The problem is that the line you've digged does not contain a group
id. That's why, "kfs 0" is regarded as a date.
> If I change the line to
>
> -rw------- 1 kfs 10 May 27 2003 .autorun.lck
Same problem. "kfs 10" is regarded as a date.
> it still fails, but this line works:
>
> -rw------- 1 kfs 100 May 27 2003 .autorun.lck
"kfs 100" is not a date because "100" exceeds the range of days :-)
> What's going on?
I've submitted a fix which should solve your problem. I cannot check
whether it breaks the syntax for Japanese dates - could somebody,
please, check it?
Best regards, Michael.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Bug in ange-ftp parsing of ls output
2005-10-20 20:11 ` Michael Albinus
@ 2005-10-21 3:08 ` Stefan Monnier
2005-10-21 5:49 ` Michael Albinus
0 siblings, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2005-10-21 3:08 UTC (permalink / raw)
Cc: emacs-devel, Kim F. Storm
> I've submitted a fix which should solve your problem. I cannot check
> whether it breaks the syntax for Japanese dates - could somebody,
> please, check it?
Is there any hope we could get dired.el and ange-ftp.el to share the
same regexp. The dired regexp is kept fairly well uptodate, so if ange-ftp
could use it, it might help,
Stefan
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Bug in ange-ftp parsing of ls output
2005-10-21 3:08 ` Stefan Monnier
@ 2005-10-21 5:49 ` Michael Albinus
2005-10-21 6:07 ` Stefan Monnier
2005-10-21 22:19 ` Richard M. Stallman
0 siblings, 2 replies; 11+ messages in thread
From: Michael Albinus @ 2005-10-21 5:49 UTC (permalink / raw)
Cc: emacs-devel, Kim F. Storm
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> I've submitted a fix which should solve your problem. I cannot check
>> whether it breaks the syntax for Japanese dates - could somebody,
>> please, check it?
>
> Is there any hope we could get dired.el and ange-ftp.el to share the
> same regexp. The dired regexp is kept fairly well uptodate, so if ange-ftp
> could use it, it might help,
You're right, `dired-move-to-filename-regexp' looks more robust than
`ange-ftp-date-regexp' (and it hasn't the bug Kim reported). But for
common use, this regexp should be moved to a more general package
(files.el?, simple.el?) in order to avoid dependencies on dired.
Other packages, like tramp, could benefit also from this.
> Stefan
Best regards, Michael.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Bug in ange-ftp parsing of ls output
2005-10-21 5:49 ` Michael Albinus
@ 2005-10-21 6:07 ` Stefan Monnier
2005-10-21 22:19 ` Richard M. Stallman
1 sibling, 0 replies; 11+ messages in thread
From: Stefan Monnier @ 2005-10-21 6:07 UTC (permalink / raw)
Cc: emacs-devel, Kim F. Storm
> You're right, `dired-move-to-filename-regexp' looks more robust than
> `ange-ftp-date-regexp' (and it hasn't the bug Kim reported). But for
> common use, this regexp should be moved to a more general package
> (files.el?, simple.el?) in order to avoid dependencies on dired.
I'd put it in files.el nearby insert-directory.
Stefan
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Bug in ange-ftp parsing of ls output
2005-10-21 5:49 ` Michael Albinus
2005-10-21 6:07 ` Stefan Monnier
@ 2005-10-21 22:19 ` Richard M. Stallman
2005-10-23 12:37 ` Michael Albinus
2006-01-07 7:03 ` Daniel Brockman
1 sibling, 2 replies; 11+ messages in thread
From: Richard M. Stallman @ 2005-10-21 22:19 UTC (permalink / raw)
Cc: storm, monnier, emacs-devel
You're right, `dired-move-to-filename-regexp' looks more robust than
`ange-ftp-date-regexp' (and it hasn't the bug Kim reported). But for
common use, this regexp should be moved to a more general package
(files.el?, simple.el?) in order to avoid dependencies on dired.
Let's move it to files.el and rename it to
directory-listing-before-filename-regexp
Would you like to do it?
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Bug in ange-ftp parsing of ls output
2005-10-21 22:19 ` Richard M. Stallman
@ 2005-10-23 12:37 ` Michael Albinus
2005-10-24 1:00 ` Richard M. Stallman
2006-01-07 7:03 ` Daniel Brockman
1 sibling, 1 reply; 11+ messages in thread
From: Michael Albinus @ 2005-10-23 12:37 UTC (permalink / raw)
Cc: storm, monnier, emacs-devel
"Richard M. Stallman" <rms@gnu.org> writes:
> Let's move it to files.el and rename it to
> directory-listing-before-filename-regexp
>
> Would you like to do it?
Done. Changed files are files.el, dired.el, dired-x.el, locate.el,
vc.el and ange-ftp.el.
locate.el and vc.el use local values of
directory-listing-before-filename-regexp. In locate.el it doesn't seem
to be noteworthy; it is derived from the default value.
vc.el uses its own regexp, which is similar to
directory-listing-before-filename-regexp. Bringing this case into
directory-listing-before-filename-regexp would require to change it to
a macro, which might not be desirable. Or am I too stupid to see how
to handle an empty vc-SYS-dired-state-info?
Best regards, Michael.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Bug in ange-ftp parsing of ls output
2005-10-23 12:37 ` Michael Albinus
@ 2005-10-24 1:00 ` Richard M. Stallman
2005-10-25 6:07 ` Michael Albinus
0 siblings, 1 reply; 11+ messages in thread
From: Richard M. Stallman @ 2005-10-24 1:00 UTC (permalink / raw)
Cc: storm, monnier, emacs-devel
vc.el uses its own regexp, which is similar to
directory-listing-before-filename-regexp. Bringing this case into
directory-listing-before-filename-regexp would require to change it to
a macro, which might not be desirable. Or am I too stupid to see how
to handle an empty vc-SYS-dired-state-info?
For now, let's leave it alone. I hope Spiegel will start responding
again and that he will eventually DTRT. Could you add a comment
next to that variable, explaining this issue and what needs to be done?
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Bug in ange-ftp parsing of ls output
2005-10-24 1:00 ` Richard M. Stallman
@ 2005-10-25 6:07 ` Michael Albinus
0 siblings, 0 replies; 11+ messages in thread
From: Michael Albinus @ 2005-10-25 6:07 UTC (permalink / raw)
Cc: storm, monnier, emacs-devel
"Richard M. Stallman" <rms@gnu.org> writes:
> For now, let's leave it alone. I hope Spiegel will start responding
> again and that he will eventually DTRT. Could you add a comment
> next to that variable, explaining this issue and what needs to be done?
Done.
Best regards, Michael.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Bug in ange-ftp parsing of ls output
2005-10-21 22:19 ` Richard M. Stallman
2005-10-23 12:37 ` Michael Albinus
@ 2006-01-07 7:03 ` Daniel Brockman
2006-01-08 14:47 ` Richard M. Stallman
1 sibling, 1 reply; 11+ messages in thread
From: Daniel Brockman @ 2006-01-07 7:03 UTC (permalink / raw)
On Fri, 21 Oct 2005 18:19:45 -0400,
in <E1ET5En-0003kt-9y@fencepost.gnu.org>,
"Richard M. Stallman" <rms@gnu.org> wrote:
> Let's move it to files.el and rename it to
> directory-listing-before-filename-regexp
Quoting the GNU coding standards, updated January 1, 2005,
Please do not use the term "pathname" that is used in Unix
documentation; use "file name" (two words) instead. We use the term
"path" only for search paths, which are lists of directory names.
--- Section 6.1, (info "(standards)GNU Manuals")
The document explicitly states that "file name" should be spelled
with two words. If that's no longer considered important, perhaps
the standards document should be updated to reflect this?
--
Daniel Brockman <daniel@brockman.se>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Bug in ange-ftp parsing of ls output
2006-01-07 7:03 ` Daniel Brockman
@ 2006-01-08 14:47 ` Richard M. Stallman
0 siblings, 0 replies; 11+ messages in thread
From: Richard M. Stallman @ 2006-01-08 14:47 UTC (permalink / raw)
Cc: emacs-devel
The text you quoted applies primarily to documentation.
In Lisp symbols it is ok to write `filename' as one word,
though it might be better to use two words.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2006-01-08 14:47 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-19 14:08 Bug in ange-ftp parsing of ls output Kim F. Storm
2005-10-20 20:11 ` Michael Albinus
2005-10-21 3:08 ` Stefan Monnier
2005-10-21 5:49 ` Michael Albinus
2005-10-21 6:07 ` Stefan Monnier
2005-10-21 22:19 ` Richard M. Stallman
2005-10-23 12:37 ` Michael Albinus
2005-10-24 1:00 ` Richard M. Stallman
2005-10-25 6:07 ` Michael Albinus
2006-01-07 7:03 ` Daniel Brockman
2006-01-08 14:47 ` Richard M. Stallman
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).