From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#35609: 26.2; wdired-finish-edit clears find-dired listing Date: Mon, 15 Jul 2019 12:54:34 +0200 Message-ID: <87sgr7tvo5.fsf@gmx.net> References: <87k1crewp3.fsf@mouse.gnus.org> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="230668"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Alvaro Ramirez , 35609@debbugs.gnu.org, Roland Winkler To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 15 12:55:09 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hmydQ-000xqw-Vs for geb-bug-gnu-emacs@m.gmane.org; Mon, 15 Jul 2019 12:55:09 +0200 Original-Received: from localhost ([::1]:36962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmydP-0004a0-Jl for geb-bug-gnu-emacs@m.gmane.org; Mon, 15 Jul 2019 06:55:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42115) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmydM-0004WP-5K for bug-gnu-emacs@gnu.org; Mon, 15 Jul 2019 06:55:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hmydK-0006zr-UV for bug-gnu-emacs@gnu.org; Mon, 15 Jul 2019 06:55:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37721) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hmydK-0006zl-RS for bug-gnu-emacs@gnu.org; Mon, 15 Jul 2019 06:55:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hmydK-0000We-LT for bug-gnu-emacs@gnu.org; Mon, 15 Jul 2019 06:55:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 15 Jul 2019 10:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35609 X-GNU-PR-Package: emacs Original-Received: via spool by 35609-submit@debbugs.gnu.org id=B35609.15631880921994 (code B ref 35609); Mon, 15 Jul 2019 10:55:02 +0000 Original-Received: (at 35609) by debbugs.gnu.org; 15 Jul 2019 10:54:52 +0000 Original-Received: from localhost ([127.0.0.1]:46542 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmydA-0000W5-4V for submit@debbugs.gnu.org; Mon, 15 Jul 2019 06:54:52 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:37929) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmyd8-0000Vn-7N for 35609@debbugs.gnu.org; Mon, 15 Jul 2019 06:54:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1563188077; bh=9NoIewCMBzMAAHHdPiAjqZGBOGX1uQwiDjgFDEwSqG4=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date; b=CTNOQXs2tijJ52vI6gTvVoIaDueg+ECCfxFSbYWr0TuLO0/NNhjUCV52YSnF7ahKf D21/FRNAlWlD7VgCrIOQf7c6xLDcOZmJ9Bkzk2Im7Gkoxfe/RknHCNUlxehCa8LXLB Jjn9/T9T34+u/vBMDwrnZDHeV7H81kkFljYYM+qY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from strobe-lfs84 ([188.101.20.117]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MaqqY-1i2qW63APi-00KRlZ; Mon, 15 Jul 2019 12:54:36 +0200 X-Provags-ID: V03:K1:xln4rA2I3fmQf2+7dyQuGk/8XEz6QJ/1koH7jzUjnLGtTddI1MT etpXPnrOi96aOWPJN7z984+WNqdBR8ZC2A20oZALSrICDQJ8C5YpLayXwxIzO48scc+THAu pgiY/OV//vqoayUiwchegwukObM84c+vEvsfbEgg7HodTZioeHiX2crLA8tIhVqZJIY+BgT 2brd8kDE/+1gZ3GpusnhA== X-UI-Out-Filterresults: notjunk:1;V03:K0:/sq3iFbzU5M=:xopuhVKrbGaHFl4qURHv/C b39SAJa6/6yigEMm+IcZfG9ogE/JN2Legpk0+D1YaFBpUQET3am1GR1hxD+LjSS4xEU9qFCKc wIp4hhBxikWMNPEJY4hdw8vJ1LP2AX2dZ8OP2zhKp2kv80ThAc7tHI1SbAvwDalIX5oq6FdTB C3I+S0rojJNLjN4ghGVY1/3iS8PkFmxjvBpNADU8m9rQhlFLLm0GfPeeph9Q3XaZwiaR3RVpc bH74BK7mqvykChFmKaPNHZ4Pdoqy8+cSh/jnj6+TMuDR9thm/2aic5qnQxiwHp2rXfqGfClsV iK20sRw09MuCMlAIgjisGjfe6Xg9tdn1fajV3VeOHdgLQsYh7DfAfhtVwRlqQxsPsmkYopXjd YjufJpBnb3AwGD758j64xbtCaiiNCekdf8U91vV/p05lNrnocuz6vaJVVxJ2By5jCb56y+k9B nRWOvA/RfEm6siMSDjjptGjoan5clW3XLMT9Vi1HgtClBnXPncThKZF4zzIEnVJaoLaHnUYDz ob2kDzQdnDJ33iAvyY0D4nCQbH7vthK8+gXM64LvIWtaZdIPye/2C+M+/bAR7+xWc35iWyeV2 pSnFgXiy2NGjmkPWpIXYJzobFKZi09yfeeUfw16n8kFd0VYvK9ki6X+UmOJalnbjMNl6KDVVC lpQJWkM6HMLbrK4bDNiTqDEl8KM5kplz083UBM/aBYIO3ghrPOUuDkySoHLJlW27BKneGo/3b ET3wfIYf8/FPg9o2H6zn0v6chETdKgziHjB1AP50l2J6PXxlTopyYpU1rQGVfuOz0VMBeYAY X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:163083 Archived-At: On Tue, 09 Jul 2019 05:03:20 +0200 Lars Ingebrigtsen wrot= e: > Alvaro Ramirez writes: > >> Editing a find-dired buffer (via wdired) clears the list of files after >> saving changes. >> >> Steps: >> >> 1. M-x find-dired RET >> 2. RET (empty or any find args should do) >> 3. C-x C-q (dired-toggle-read-only) > > In Emacs 27 (on GNU/Linux), it hangs there in > > Debugger entered--Lisp error: (quit) > looking-at("^. [0-9 \11]*[.,0-9]*[BkKMGTPEZY]?[ \11]*l[^:]") > wdired-preprocess-symlinks() > > So there's been further regressions in this area, I guess... I don't have a fix for the find-dired listing being cleared, but the hang is due to this change: commit 249902d5ad5d3ae3e25323c23a2f442913729ceb Author: Roland Winkler Date: Tue Jun 11 16:04:45 2019 -0500 Allow refining the *Find* buffer of find-dired. (Bug#29513) * find-dired.el (find-dired-refine-function): New user variable. (find-dired-sentinel): Use it. Simplify. (find-dired-sort-by-filename): New function. Specifically, the change in find-dired-sentinel from this: - (insert "\n find " state) - (forward-char -1) ;Back up before \n at end of STATE. - (insert " at " (substring (current-time-string) 0 19)) to this: + (insert "\n find " + (substring state 0 -1) ; omit \n at end of STAT= E. + " at " (substring (current-time-string) 0 19)) Reverting this change (i.e. just these three lines) prevents the hang, but it's not clear to me whether this was just meant to simplify the code, as stated in the ChangeLog, or omitting the final newline is needed for some find-dired use case. Roland, can you elucidate? However, independently of reverting or retaining the above lines, the hang can also be prevented by changing wdired-preprocess-symlinks thus: diff --git a/lisp/wdired.el b/lisp/wdired.el index 0ccaaaca74..44f083bb7f 100644 =2D-- a/lisp/wdired.el +++ b/lisp/wdired.el @@ -677,8 +677,7 @@ wdired-preprocess-symlinks 'rear-nonsticky '(read-only)) (put-text-property (match-beginning 1) (match-end 1) 'read-only nil))) - (forward-line) - (beginning-of-line))))) + (forward-line))))) (defun wdired-get-previous-link (&optional old move) These lines are at the end of a while (not (eobp)) loop and, unless I'm overlooking something, prior to the change to find-dired-sentinel, the use of beginning-of-line here was a noop, since forward-line always puts point at BOL -- except when the buffer doesn't end with a newline, and that's why the change to find-dired-sentinel caused the find-dired hang. Thus, reverting the above three lines of the find-dired-sentinel change makes beginning-of-line in wdired-preprocess-symlinks strictly a noop, while retaining that change makes calling beginning-of-line harmful, so in any case that call should removed. Or does anyone see a problem with that? Steve Berman