From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#31796: 27.1; dired-do-find-regexp-and-replace fails to find multiline regexps Date: Tue, 01 Dec 2020 17:46:19 +0200 Message-ID: <83k0u1il6c.fsf@gnu.org> References: <10120030-8b8d-b702-add4-8f099f934ed5@chalmers.se> <831rgivl7l.fsf@gnu.org> <83lfequ30g.fsf@gnu.org> <83a6v6tss9.fsf@gnu.org> <08c0bbce-051e-7a49-106a-d6d0629b2224@yandex.ru> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32023"; mail-complaints-to="usenet@ciao.gmane.io" Cc: abela@chalmers.se, 31796@debbugs.gnu.org, dgutov@yandex.ru To: rms@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 01 16:47:50 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kk7sc-00089x-8Z for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Dec 2020 16:47:50 +0100 Original-Received: from localhost ([::1]:36422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk7sb-0005hY-AV for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Dec 2020 10:47:49 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk7rq-0005Oz-I5 for bug-gnu-emacs@gnu.org; Tue, 01 Dec 2020 10:47:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49748) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kk7rq-000454-9k for bug-gnu-emacs@gnu.org; Tue, 01 Dec 2020 10:47:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kk7rq-0006nE-61 for bug-gnu-emacs@gnu.org; Tue, 01 Dec 2020 10:47:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 01 Dec 2020 15:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31796 X-GNU-PR-Package: emacs Original-Received: via spool by 31796-submit@debbugs.gnu.org id=B31796.160683760226081 (code B ref 31796); Tue, 01 Dec 2020 15:47:02 +0000 Original-Received: (at 31796) by debbugs.gnu.org; 1 Dec 2020 15:46:42 +0000 Original-Received: from localhost ([127.0.0.1]:33061 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kk7rW-0006mb-AB for submit@debbugs.gnu.org; Tue, 01 Dec 2020 10:46:42 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49196) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kk7rU-0006mL-Hq for 31796@debbugs.gnu.org; Tue, 01 Dec 2020 10:46:41 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:56763) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk7rN-0003qv-Dr; Tue, 01 Dec 2020 10:46:33 -0500 Original-Received: from [176.228.60.248] (port=1572 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kk7rE-0004P5-Ge; Tue, 01 Dec 2020 10:46:24 -0500 In-Reply-To: (message from Richard Stallman on Tue, 01 Dec 2020 00:20:12 -0500) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:194746 Archived-At: > From: Richard Stallman > Cc: eliz@gnu.org, abela@chalmers.se, 31796@debbugs.gnu.org > Date: Tue, 01 Dec 2020 00:20:12 -0500 > > Can people think of a new feature that would be easy to add to GNU grep > that would make it easy for Dired to handle all cases correctly? Yes: it should detect encoding of each input file (and have a way of letting the user specify encoding for each file), convert the file's contents to some internal encoding (probably UTF-8), then report the hits encoded in UTF-8, regardless of the file's original encoding (and regardless of the current locale's codeset). > I don't know what the problem is, but if it has to do with parsing the > grep output, here's an idea: an option to tell GNU grep to use quoting > on file names and the match strings, Perhaps in the same way GNU ls > does. The problem is not with file names, it's with the matches. But since you mention it: Grep should, in this new mode, report file names also recoded into UTF-8. In a word, it should arrange for its output be in a single encoding known in advance, so that front ends like Emacs won't need to guess the encoding. > Another idea is an option to output numerical byte positions in the > file instead of the lines that are matched. Emacs can feed those byte > positions into byte-to-position to convert them into buffer positions. AFAIU, there's already such an option: -b. However, byte-to-position works only with UTF-8 encoded files; we need filepos-to-bufferpos (which requires to know the file's encoding, so we are back at the same problem).