From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Phil Sung" Newsgroups: gmane.emacs.devel,gmane.emacs.pretest.bugs Subject: Re: 23.0.50; Deleting files in wdired does not work Date: Fri, 25 Jan 2008 05:16:05 -0500 Message-ID: <60c603510801250216r7f62a876s37a86719d46d7633@mail.gmail.com> References: <60c603510801202141p7e4fdcfcmddf4d81b330a9715@mail.gmail.com> <4799915E.9090400@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1201256189 25459 80.91.229.12 (25 Jan 2008 10:16:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Jan 2008 10:16:29 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org To: "martin rudalics" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 25 11:16:48 2008 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 1JILc4-0007nx-Tv for ged-emacs-devel@m.gmane.org; Fri, 25 Jan 2008 11:16:45 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JILbe-0007Oe-CS for ged-emacs-devel@m.gmane.org; Fri, 25 Jan 2008 05:16:18 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JILbY-0007Mk-Aq for emacs-devel@gnu.org; Fri, 25 Jan 2008 05:16:12 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JILbX-0007Lw-Kh for emacs-devel@gnu.org; Fri, 25 Jan 2008 05:16:11 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JILbX-0007Lp-Aj for emacs-devel@gnu.org; Fri, 25 Jan 2008 05:16:11 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JILbX-0005Mo-12 for emacs-devel@gnu.org; Fri, 25 Jan 2008 05:16:11 -0500 Original-Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1JILbW-0007if-PI for emacs-pretest-bug@gnu.org; Fri, 25 Jan 2008 05:16:10 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1JILbT-0005ME-Jn for emacs-pretest-bug@gnu.org; Fri, 25 Jan 2008 05:16:10 -0500 Original-Received: from fg-out-1718.google.com ([72.14.220.157]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JILbT-0005Lo-6R for emacs-pretest-bug@gnu.org; Fri, 25 Jan 2008 05:16:07 -0500 Original-Received: by fg-out-1718.google.com with SMTP id d23so604308fga.30 for ; Fri, 25 Jan 2008 02:16:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=xRGRQTOQwUulcctOxr6HMKVqb0L/ehuEn8gK5U6RNxY=; b=bkdpBrVfQEsn5UDcYVSOIe07M//zdmTiAvxmcOE6Jhsa53D+r0Gn83ZBcfDN+TLACEC0Pf/D2DdmYI8T7jDLI4L9ya/rz4Q+xUvUeOoK6nf69e5Y7FAPz4NkgZH2bCL7qMc4T+wzx/6OIoZ1UPgCFiUUgRxCZSCvhroXTxpO75U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=ZJrcdaxAGy75XxyommKUlE870OtgO8ZtK42Mcm/aUf+pqosSF90ZsHFDFbIZYaIVV32r8ScKFUg5ioB26tQJWvaDX8XhTFhtdKBlwW68WCSEdRRnyyYA+UZyUHXXO5J2jTnfICZJf27xhE4OnOQrD1rxLinwEitBVZMK0QNJ/60= Original-Received: by 10.86.3.4 with SMTP id 4mr1649945fgc.55.1201256165226; Fri, 25 Jan 2008 02:16:05 -0800 (PST) Original-Received: by 10.86.68.9 with HTTP; Fri, 25 Jan 2008 02:16:05 -0800 (PST) In-Reply-To: <4799915E.9090400@gmx.at> Content-Disposition: inline X-Google-Sender-Auth: f9196cf574a5296d X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:87487 gmane.emacs.pretest.bugs:20747 Archived-At: On Jan 25, 2008 2:35 AM, martin rudalics wrote: > For the last filename [...] > > (setq file (buffer-substring-no-properties (1+ beg) end))) > > fails with a "Wrong type argument: integer-or-marker-p, nil", am I > right? That's correct. > However, I'd prefer if you replaced the original > > (setq end (next-single-property-change (1+ beg) 'end-name)) > > by something like the untested > > (if (get-text-property (1+ beg) 'end-name) > "" > (setq end (next-single-property-change (1+ beg) 'end-name)) > (setq file (buffer-substring-no-properties (1+ beg) end)))) > > It would allow this part of wdired to also work in the case where the > filename does not appear at the end of the line in dired listings. I > don't know how realistic that is - but we shouldn't hardcode anything > into wdired which wasn't there initially. Sure. The following works for me, assuming (wdired-get-filename t) ought to return "" rather than nil on a deleted filename: (if (get-text-property (1+ beg) 'end-name) (setq file "") (setq end (next-single-property-change (1+ beg) 'end-name)) (setq file (buffer-substring-no-properties (1+ beg) end))))) An updated patch follows. --Phil *** lisp/wdired.el 8 Jan 2008 20:44:46 -0000 1.33 --- lisp/wdired.el 25 Jan 2008 09:44:35 -0000 *************** *** 324,329 **** (if old (setq file (get-text-property beg 'old-name)) ! (setq end (next-single-property-change (1+ beg) 'end-name)) ! (setq file (buffer-substring-no-properties (1+ beg) end))) (and file (setq file (wdired-normalize-filename file)))) (if (or no-dir old) --- 324,331 ---- (if old (setq file (get-text-property beg 'old-name)) ! (if (get-text-property (1+ beg) 'end-name) ! (setq file "") ! (setq end (next-single-property-change (1+ beg) 'end-name)) ! (setq file (buffer-substring-no-properties (1+ beg) end))))) (and file (setq file (wdired-normalize-filename file)))) (if (or no-dir old) *************** *** 390,394 **** (when (and file-ori (not (equal file-new file-ori))) (setq changes t) ! (if (not file-new) ;empty filename! (setq files-deleted (cons file-ori files-deleted)) (setq file-new (substitute-in-file-name file-new)) --- 392,396 ---- (when (and file-ori (not (equal file-new file-ori))) (setq changes t) ! (if (zerop (length (wdired-get-filename t))) ; empty filename (setq files-deleted (cons file-ori files-deleted)) (setq file-new (substitute-in-file-name file-new))