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: Fri, 16 Oct 2009 11:22:30 -0400 [thread overview]
Message-ID: <jwvoco7z8a6.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <BLU0-SMTP98D6EDFB381A3CE5AA425EE2C40@phx.gbl> (Toru TSUNEYOSHI's message of "Fri, 16 Oct 2009 13:31:38 +0900")
> BTW, about save-match-data, I used it because of inhibiting changing old
> match data. Using it is wrong (as the style)?
save-match-data should only be used where it is really needed, not
defensively: 99% of the code may destroy the match-date (and could thus
use save-match-data defensively), whereas less than 1% of the code needs
the match-data to be saved.
> - (and (eq cmd0 'quote) (string= cmd1 "mdtm")))
> + (and (eq cmd0 'quote) (string-match-p "^\\(mdtm\\|size\\)$" cmd1)))
I used (member cmd1 '("mdtm" "size")) instead. The regexp equivalent
would be "\\`\\(mdtm\\|size\\)\\'".
> + (res (prog2
> + (unless ascii-mode
> + (ange-ftp-set-binary-mode host user))
> + (ange-ftp-send-cmd host user (list 'quote "size" name))
> + (unless ascii-mode
> + (ange-ftp-set-ascii-mode host user))))
Now that I look at it: isn't it problematic to set the mode to `ascii'
here? If the mode was binary before and we call it with ascii-mode=nil,
we end up switching to ascii mode unwittingly, don't we?
Stefan
next prev parent reply other threads:[~2009-10-16 15:22 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 ` ange-ftp-file-size Stefan Monnier
2009-10-16 4:31 ` ange-ftp-file-size Toru TSUNEYOSHI
2009-10-16 15:22 ` Stefan Monnier [this message]
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=jwvoco7z8a6.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).