From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#24305: 25.1; dired can't replace '\n' in file content (dired-do-find-regexp-and-replace) Date: Thu, 25 Aug 2016 14:35:52 +0900 (JST) Message-ID: References: <877fb53j8i.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Trace: blaine.gmane.org 1472103445 21246 195.159.176.226 (25 Aug 2016 05:37:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 25 Aug 2016 05:37:25 +0000 (UTC) User-Agent: Alpine 2.20 (DEB 67 2015-01-07) Cc: mc.maxcanal@gmail.com, dgutov@yandex.ru, tino.calancha@gmail.com To: 24305@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 25 07:37:20 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bcnLr-0004tm-LZ for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Aug 2016 07:37:20 +0200 Original-Received: from localhost ([::1]:54582 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcnLq-0003xA-39 for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Aug 2016 01:37:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33245) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcnLd-0003uM-8C for bug-gnu-emacs@gnu.org; Thu, 25 Aug 2016 01:37:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bcnLa-0000pn-3J for bug-gnu-emacs@gnu.org; Thu, 25 Aug 2016 01:37:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42165) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcnLZ-0000pj-WC for bug-gnu-emacs@gnu.org; Thu, 25 Aug 2016 01:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bcnLZ-0001aj-Ii for bug-gnu-emacs@gnu.org; Thu, 25 Aug 2016 01:37:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <877fb53j8i.fsf@gmail.com> Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Aug 2016 05:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24305 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24305-submit@debbugs.gnu.org id=B24305.14721033696056 (code B ref 24305); Thu, 25 Aug 2016 05:37:01 +0000 Original-Received: (at 24305) by debbugs.gnu.org; 25 Aug 2016 05:36:09 +0000 Original-Received: from localhost ([127.0.0.1]:39876 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bcnKj-0001Zb-8X for submit@debbugs.gnu.org; Thu, 25 Aug 2016 01:36:09 -0400 Original-Received: from mail-pf0-f180.google.com ([209.85.192.180]:32833) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bcnKg-0001Z1-Rl for 24305@debbugs.gnu.org; Thu, 25 Aug 2016 01:36:08 -0400 Original-Received: by mail-pf0-f180.google.com with SMTP id y134so14279876pfg.0 for <24305@debbugs.gnu.org>; Wed, 24 Aug 2016 22:36:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:user-agent:mime-version; bh=Rf9CNqwDUiVwkxHcYmWVnSdBwCECMySQJ5B2ir/dVcE=; b=NHaOMAzsZ6omIB65BtLonlCylbZj8Gt94Tnah3HwvF9N+WgAF5mXszIgMhcmweT/mU de9Ai4EygIMw7Wg4uWOCz6wn/C8IzJZW+Wu9NuP8eRS35Vn8VPPUFxFTkNJaySJaGQUr iHecUMnj9GSsZV6RtGVTMRz6URsEq6WR7JjDn3xowsfBYmAY7TSzriIoAJ16nSzI7LmL AS0lIwXoqdCEh4SgDXGLl1rplvGtH7VB/kY6H4lKvupMCLe/Psbq6pgJPkhflUkw+Psi MvWG0ilvUeVnUAlWjNLY1EZr1lBcQm1/ORd+8RoyZGkzxfgNMTT/GzBBzt1+0eq5QLxb pZpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:message-id:user-agent :mime-version; bh=Rf9CNqwDUiVwkxHcYmWVnSdBwCECMySQJ5B2ir/dVcE=; b=dkX8WMSHT3KWiuHJg3Efe3t1iqDb2eYE2h2Us9mXG5vRbtK7UdDidmPwdai+cCxW++ 4ynIpgETHZkDFNxl1hSZBJuamvY3GJ0XwEHdY46QhPsW8ov9tigJ/wu8BoQhI5inLNSb oo6WX4h/OrUr+fm2kGmc7NYM4LVEIp+9UQ/uKeAn77cs5ZAl0rGRuV8Qo9XZjtJbqbDY i7O5I6DtoV1jJRRqC122tccHyk2P/Uw9ch4Oa9gR3By2i1tcTvyxuWxC9Vb/v0pMCscv xYYx62M5DL+eOU4D1KgBFzUMtWH+yD5S7TI0UIlFgSCOnUjSjIj+ModBNcY4I6xc4H1o F0vw== X-Gm-Message-State: AE9vXwP7Q4tGinslLMVhHSdLCULo6835wZwFLEQbNUMXZUq91GO7qabmHcbtsElivBYeaw== X-Received: by 10.98.56.207 with SMTP id f198mr12856189pfa.83.1472103356315; Wed, 24 Aug 2016 22:35:56 -0700 (PDT) Original-Received: from calancha-pc ([103.5.140.138]) by smtp.gmail.com with ESMTPSA id cp11sm17669607pac.28.2016.08.24.22.35.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Aug 2016 22:35:55 -0700 (PDT) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc 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: 208.118.235.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:122624 Archived-At: Thank you for the report. As reported in NEWS file, since Emas 25.1 the key 'Q' is bound to a new command 'dired-do-find-regexp-and-replace'. The key 'A' is also bound to a new command: dired-do-find-regexp. The old commands use Emacs regexp engine, while the new commands use grep: this may cause that regexps which previously matched results, with the new commands don't match anymore. That seems the case in your example: the old command matches '\n', but the new one cannot: ;; old command (let ((file "/tmp/bug24305/file")) (with-temp-file file (insert "\n")) (dired-other-window (file-name-directory file)) (dired-goto-file file) (when (null (dired-do-search "\n")) (message "Found new line!"))) ;; new command (let ((file "/tmp/bug24305/file")) (with-temp-file file (insert "\n")) (dired-other-window (file-name-directory file)) (dired-goto-file file) (save-excursion (dired-mark 1)) (dired-do-find-regexp "\n")) In your example, 'dired-do-find-regexp-and-replace' internally builds the following `find' command (using `xref--rgrep-command'): find /tmp/bug24305 -type f \( -iname file \) -exec grep --color -i -nH -e '\n' {} + As you have noticed, this command fails. Following commands would work: find /tmp/bug24305 -type f \( -iname file \) -exec grep --color -i -nH -e '^$' {} + find /tmp/bug24305 -type f \( -iname file \) -exec grep --color -i -nH -e ' ' {} + Maybe `xref--rgrep-command' might be updated to account for this? In the meantime, as a temporary solution, you might wish to restore the previous bindings. For instance, adding following in your .emacs file: (require 'dired-aux) (define-key dired-mode-map "A" 'dired-do-search) (define-key dired-mode-map "Q" 'dired-do-query-replace-regexp) Tino