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: /srv/bzr/emacs/trunk r107646: * lisp/files.el (move-file-to-trash): Files aren't regexps. Date: Wed, 21 Mar 2012 17:14:53 -0400 Message-ID: References: <5sfwd1lqhz.fsf@fencepost.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1332364503 28579 80.91.229.3 (21 Mar 2012 21:15:03 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 21 Mar 2012 21:15:03 +0000 (UTC) Cc: emacs-devel@gnu.org To: Glenn Morris Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 21 22:15:03 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 1SASs2-0006a6-Hp for ged-emacs-devel@m.gmane.org; Wed, 21 Mar 2012 22:15:02 +0100 Original-Received: from localhost ([::1]:38731 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SASs1-0004MG-R3 for ged-emacs-devel@m.gmane.org; Wed, 21 Mar 2012 17:15:01 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SASry-0004M1-MS for emacs-devel@gnu.org; Wed, 21 Mar 2012 17:14:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SASrw-0000SW-Q6 for emacs-devel@gnu.org; Wed, 21 Mar 2012 17:14:58 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:30742) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SASrw-0000Rh-Mi; Wed, 21 Mar 2012 17:14:56 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AicFAKU/KE9FxKFU/2dsb2JhbACBX5x7eYhwnhmGGQSbGYQJ X-IronPort-AV: E=Sophos;i="4.73,1,1325480400"; d="scan'208";a="169251524" Original-Received: from 69-196-161-84.dsl.teksavvy.com (HELO pastel.home) ([69.196.161.84]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 21 Mar 2012 17:14:54 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id EC7C758C3D; Wed, 21 Mar 2012 17:14:53 -0400 (EDT) In-Reply-To: <5sfwd1lqhz.fsf@fencepost.gnu.org> (Glenn Morris's message of "Wed, 21 Mar 2012 15:10:16 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 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:149158 Archived-At: >> ;; 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? Oh, yes, even better. > It also exists as vc-string-prefix-p, latex-string-prefix-p, > tex-string-prefix-p, cvs-string-prefix-p, mpc-string-prefix-p... These should be replaced, I guess, Stefan