From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: ange-ftp-file-size Date: Fri, 16 Oct 2009 11:22:30 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1255707321 17932 80.91.229.12 (16 Oct 2009 15:35:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 16 Oct 2009 15:35:21 +0000 (UTC) Cc: emacs-devel@gnu.org To: Toru TSUNEYOSHI Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 16 17:35:11 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Myopd-0005nf-0k for ged-emacs-devel@m.gmane.org; Fri, 16 Oct 2009 17:35:05 +0200 Original-Received: from localhost ([127.0.0.1]:45335 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Myopc-0004pr-GD for ged-emacs-devel@m.gmane.org; Fri, 16 Oct 2009 11:35:04 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MyodY-0005Fc-06 for emacs-devel@gnu.org; Fri, 16 Oct 2009 11:22:36 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MyodT-00058g-AQ for emacs-devel@gnu.org; Fri, 16 Oct 2009 11:22:35 -0400 Original-Received: from [199.232.76.173] (port=55602 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MyodT-00058T-0d for emacs-devel@gnu.org; Fri, 16 Oct 2009 11:22:31 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:3571 helo=ironport2-out.pppoe.ca) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MyodS-0007D7-Qg for emacs-devel@gnu.org; Fri, 16 Oct 2009 11:22:30 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqgEAHgs2EpFpY7q/2dsb2JhbACBUddthDAEgVuGIQ X-IronPort-AV: E=Sophos;i="4.44,574,1249272000"; d="scan'208";a="47690538" Original-Received: from 69-165-142-234.dsl.teksavvy.com (HELO pastel.home) ([69.165.142.234]) by ironport2-out.pppoe.ca with ESMTP; 16 Oct 2009 11:22:30 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 18EFE7F87; Fri, 16 Oct 2009 11:22:30 -0400 (EDT) In-Reply-To: (Toru TSUNEYOSHI's message of "Fri, 16 Oct 2009 13:31:38 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:116182 Archived-At: > 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