From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Toru TSUNEYOSHI <t_tuneyosi@hotmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: ange-ftp-file-size
Date: Thu, 15 Oct 2009 08:55:46 -0400 [thread overview]
Message-ID: <jwv63ag6cqx.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <BLU0-SMTP67F9951FACE3F24DCE802DE2C50@phx.gbl> (Toru TSUNEYOSHI's message of "Thu, 15 Oct 2009 12:20:16 +0900")
> Now, ange-ftp-file-attributes doesn't return the file size. It returns
> -1.
> I wish it returns the size exactly, so I make ange-ftp-file-size.
> If no problem, would you like to apply to ange-ftp.el, and modify code
> at the size of ange-ftp-file-attributes ?
That sounds like a useful improvement, yes. Could you send a patch to
do that?
[...]
> (line (cdr res))
> (size -1))
> (save-match-data
> (when (string-match "^213 \\([0-9]+\\)$" line)
> (setq size (string-to-number (match-string 1 line)))))
> size))
And here comes the version, in functional programming style:
(line (cdr res)))
(save-match-data
(if (string-match "^213 \\([0-9]+\\)$" line)
(string-to-number (match-string 1 line))
-1))))
BTW: the save-match-data seems completely unnecessary. Please remove
it, or add a clear comment explaining why it's needed.
Stefan
next prev parent reply other threads:[~2009-10-15 12:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-15 3:20 ange-ftp-file-size Toru TSUNEYOSHI
2009-10-15 12:55 ` Stefan Monnier [this message]
2009-10-16 4:31 ` ange-ftp-file-size Toru TSUNEYOSHI
2009-10-16 15:22 ` ange-ftp-file-size Stefan Monnier
2009-10-17 2:21 ` ange-ftp-file-size Toru TSUNEYOSHI
2009-10-18 2:03 ` ange-ftp-file-size Stefan Monnier
2009-10-18 3:07 ` ange-ftp-file-size Toru TSUNEYOSHI
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwv63ag6cqx.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=t_tuneyosi@hotmail.com \
/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 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).