From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.devel Subject: Re: /srv/bzr/emacs/trunk r107646: * lisp/files.el (move-file-to-trash): Files aren't regexps. Date: Wed, 21 Mar 2012 15:10:16 -0400 Message-ID: <5sfwd1lqhz.fsf@fencepost.gnu.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1332357033 628 80.91.229.3 (21 Mar 2012 19:10:33 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 21 Mar 2012 19:10:33 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 21 20:10:32 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SAQvY-0005vZ-J5 for ged-emacs-devel@m.gmane.org; Wed, 21 Mar 2012 20:10:32 +0100 Original-Received: from localhost ([::1]:36723 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SAQvX-0000nG-S2 for ged-emacs-devel@m.gmane.org; Wed, 21 Mar 2012 15:10:31 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58143) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SAQvQ-0000mK-Fc for emacs-devel@gnu.org; Wed, 21 Mar 2012 15:10:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SAQvK-0004VW-2Y for emacs-devel@gnu.org; Wed, 21 Mar 2012 15:10:24 -0400 Original-Received: from fencepost.gnu.org ([208.118.235.10]:45492) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SAQvK-0004VN-05 for emacs-devel@gnu.org; Wed, 21 Mar 2012 15:10:18 -0400 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1SAQvI-0000ij-L9; Wed, 21 Mar 2012 15:10:16 -0400 X-Spook: monarchist computer terrorism Ft. Knox hackers credit X-Ran: "J8bQTd>0SI$rb8(Uy|eSFdz1([$Ur2(LU_wUK$/umA"YdnRndC`{2S4Vzsmp9@zr\>.K: X-Hue: magenta X-Attribution: GM User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.10 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:149157 Archived-At: Stefan Monnier wrote: > ;; We can't trash a parent directory of trash-directory. > - (if (string-match fn trash-dir) > + (if (string-prefix-p fn trash-dir) > (error "Trash directory `%s' is a subdirectory of `%s'" > trash-dir filename)) Would the recently added file-subdir-of-p be more appropriate? Also, I'd never heard of string-prefix-p (added in 23.2). It was never mentioned in NEWS or documented in the manual. It also exists as vc-string-prefix-p, latex-string-prefix-p, tex-string-prefix-p, cvs-string-prefix-p, mpc-string-prefix-p...