From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#35354: 26.2; `dired-do-query-replace-regexp': How to replace only word-delimited matches? Date: Sun, 21 Apr 2019 16:57:57 -0700 (PDT) Message-ID: References: <08ee0770-3f50-433e-955e-f8e13547ec21@default> <8f6f6e13-c150-a09f-06e5-aed3bfa21933@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="85944"; mail-complaints-to="usenet@blaine.gmane.org" To: Dmitry Gutov , 35354@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 22 02:13:16 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.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hIMaB-000MFf-S5 for geb-bug-gnu-emacs@m.gmane.org; Mon, 22 Apr 2019 02:13:16 +0200 Original-Received: from localhost ([127.0.0.1]:58509 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIMaA-0002nG-Pu for geb-bug-gnu-emacs@m.gmane.org; Sun, 21 Apr 2019 20:13:14 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:35924) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIMYt-0001zq-Pr for bug-gnu-emacs@gnu.org; Sun, 21 Apr 2019 20:11:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hIMMQ-0003Uw-Bu for bug-gnu-emacs@gnu.org; Sun, 21 Apr 2019 19:59:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35824) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hIMMQ-0003Ul-7t for bug-gnu-emacs@gnu.org; Sun, 21 Apr 2019 19:59:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hIMMP-00033h-NW for bug-gnu-emacs@gnu.org; Sun, 21 Apr 2019 19:59:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Apr 2019 23:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35354 X-GNU-PR-Package: emacs Original-Received: via spool by 35354-submit@debbugs.gnu.org id=B35354.155589108911698 (code B ref 35354); Sun, 21 Apr 2019 23:59:01 +0000 Original-Received: (at 35354) by debbugs.gnu.org; 21 Apr 2019 23:58:09 +0000 Original-Received: from localhost ([127.0.0.1]:49367 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIMLZ-00032c-CE for submit@debbugs.gnu.org; Sun, 21 Apr 2019 19:58:09 -0400 Original-Received: from aserp2130.oracle.com ([141.146.126.79]:57142) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIMLX-00032I-3K for 35354@debbugs.gnu.org; Sun, 21 Apr 2019 19:58:07 -0400 Original-Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x3LNmmWS143892; Sun, 21 Apr 2019 23:58:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=eH4iR3piNTmVnNyVvhwzsN/wQbNnJcdo9OMG2cDCIQE=; b=2qxhiKnrF8FiH85rv+fDRzZeNRGcThHz0hV20GbhheFrL3f1HfUBvzXOJei6dhIBAd1W j6bzHVADHw1ZiybPkNtJvQtFAxIojXenXqHGDFkTYnwPsxsoiEtalCyG3gh6LjCObGmI Wvy0JXOuHcD3eVzNM0ckWmwDp/RqeAKPt4edFwXG0v+DXlizz3RYxbCxeTWF1i8YID4y +KvPLqtJSwCzS2ve0OBNMXsd5ujvVC0NA0t+UOHpnNHUX0lfWqQ8jXGapNxzCB+AgqZM +QVnPD2Z2jv2+n40baHnFxoCJdUGGNbjZA/ez5i9mWckghI0d+ddH/HnVjJWBcHew6hn Tg== Original-Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2130.oracle.com with ESMTP id 2ryrxckx2y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 21 Apr 2019 23:58:00 +0000 Original-Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x3LNuOnT153760; Sun, 21 Apr 2019 23:58:00 GMT Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 2s0fv267st-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 21 Apr 2019 23:57:59 +0000 Original-Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x3LNvw6H032657; Sun, 21 Apr 2019 23:57:58 GMT In-Reply-To: <8f6f6e13-c150-a09f-06e5-aed3bfa21933@yandex.ru> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4834.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9234 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=18 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904210189 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9234 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=18 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904210189 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:157975 Archived-At: > > `dired-do-query-replace-regexp' has taken the key binding of > > `dired-do-find-regexp-and-replace'. (I obviously said that backward. The latter took the binding of the former.) > > I was expecting that it would do > > all that the latter does plus more. >=20 > I don't really understand how we can both expect FROM > to be a regexp and have a separate argument DELIMITED. Why is that a problem? That's exactly what `dired-do-query-replace-regexp' does. Its FROM is a REGEXP. Doc string: Do =E2=80=98query-replace-regexp=E2=80=99 of FROM with TO, on all marked f= iles. Third arg DELIMITED (prefix arg) means replace only word-delimited matches. If you exit (C-g, RET or q), you can resume the query replace with the command M-x tags-loop-continue. (Of course, before the loss of key bindings, the last line read simply "with the command M-,.) > > How does a user use `dired-do-query-replace-regexp' to > > replace only word-delimited matches? (Again, I meant `dired-do-find-regexp-and-replace'.) > How about \? How do you specify delimited _replacement_? It's about the 3rd element returned by `query-replace-read-args', which you're not currently using anywhere (even though it is provided). It's no different than it is for `query-replace-regexp' or other commands that use `query-replace-read-args'. But `xref-query-replace-in-results' doesn't accept that 3rd element, DELIMITED. This bug report asks it to do so. Also, args FROM and TO for `xref-query-replace-in-results' aren't even described in its doc string. They should be. The doc string of `dired-do-query-replace-regexp' refers to `query-replace-regexp', so users can tell that FROM is in fact a REGEXP. They deserve similar help for `xref-query-replace-in-results', no? `dired-do-query-replace-regexp' lets you use a prefix arg to specify word-delimiting. A prefix arg isn't even used for `dired-do-find-regexp-and-replace'. It would be simple to do the same, provided `xref-query-replace-in-results' could handle the DELIMITED arg.