From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#41692: 26.3; Enhancement request, `query-replace': let user use text at point as default Date: Wed, 3 Jun 2020 11:35:41 -0700 (PDT) Message-ID: <3705c67a-f3a1-4667-8c3f-67b41752f355@default> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="12600"; mail-complaints-to="usenet@ciao.gmane.io" To: 41692@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 03 20:36:15 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 1jgYFK-0003Af-Lz for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Jun 2020 20:36:14 +0200 Original-Received: from localhost ([::1]:59180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jgYFJ-0008Qf-Jf for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Jun 2020 14:36:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59686) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgYF8-0008QK-Hn for bug-gnu-emacs@gnu.org; Wed, 03 Jun 2020 14:36:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33000) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jgYF8-0005SQ-8b for bug-gnu-emacs@gnu.org; Wed, 03 Jun 2020 14:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jgYF8-0007Bx-5X for bug-gnu-emacs@gnu.org; Wed, 03 Jun 2020 14:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Jun 2020 18:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41692 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.159120935427629 (code B ref -1); Wed, 03 Jun 2020 18:36:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Jun 2020 18:35:54 +0000 Original-Received: from localhost ([127.0.0.1]:44546 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jgYEz-0007BZ-V1 for submit@debbugs.gnu.org; Wed, 03 Jun 2020 14:35:54 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:33256) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jgYEy-0007BR-8L for submit@debbugs.gnu.org; Wed, 03 Jun 2020 14:35:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59618) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgYEy-0008Mj-1p for bug-gnu-emacs@gnu.org; Wed, 03 Jun 2020 14:35:52 -0400 Original-Received: from userp2130.oracle.com ([156.151.31.86]:42858) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgYEw-0005Kj-7w for bug-gnu-emacs@gnu.org; Wed, 03 Jun 2020 14:35:51 -0400 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 053IVwtH033962 for ; Wed, 3 Jun 2020 18:35:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=FfILFJV+34BvyUm1SDFzOdrcrj/lsbuW+0M1rMck+Bg=; b=rYWqkeqs1iTRvGhDA85Ur/9n3ccuPxPEbhVv1kLDHMWJfxH148HxsG9fqCvtu6HVLOD8 PADhgPisdlTUoFEuiNNWtX0cDnpa4SD+nQABXvjfm1x3TC82owwUK4wwLUQUre5b61nF Odncssniq6VzYiXByxtdox+F96YUYb432ZGZAWKRd6qSyzRR3PGYp5RS4ZprwLI+yoS2 fyug/cZ3aeh/t55ZA0UvW+oLXpFMDnyuz4JjYt2upF2xywopZieUm93qxsj8bJEFSx/y uvXhnaoOUpUkAAjNdWt2N1MgFmR28g/5xAh2BbXLb+9xibcASx1L76/qL8SnKzC6J05M tg== Original-Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 31bewr2wse-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 03 Jun 2020 18:35:46 +0000 Original-Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 053ITSxA160123 for ; Wed, 3 Jun 2020 18:35:45 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 31c12ra3x5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 03 Jun 2020 18:35:45 +0000 Original-Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 053IZiom020265 for ; Wed, 3 Jun 2020 18:35:44 GMT X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.5005.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9641 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 phishscore=0 malwarescore=0 adultscore=0 suspectscore=1 spamscore=0 bulkscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006030143 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9641 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 bulkscore=0 phishscore=0 suspectscore=1 impostorscore=0 cotscore=-2147483648 lowpriorityscore=0 mlxscore=0 adultscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006030143 Received-SPF: pass client-ip=156.151.31.86; envelope-from=drew.adams@oracle.com; helo=userp2130.oracle.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/03 14:35:46 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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:181472 Archived-At: If you want to default the FROM or TO text for `query-replace' to some text at point, you currently need to first isearch for it. This request is essentially to be able to skip doing that. As an example (only), in my own code, my version of `query-replace-read-from' can get the default any of these ways: * Text of nonempty active region, if option `search/replace-region-as-default-flag' is non-nil. * Text of secondary selection, if option `search/replace-2nd-sel-as-default-flag' is non-nil. * What the (function) value of option `search/replace-default-fn' returns, when called. This defaults to a function that grabs text at point. (If the function returns a list of strings, then those are the multiple default values.) (As with vanilla query-replace, you can also use the history lists, and you can enter nothing to repeat the previous query replacement operation.) I don't say that vanilla Emacs should do all of that. But maybe at least something like the third one - a function that returns a string or list of strings to be used as default values, and with, as its default value, a function that grabs some text at point. In GNU Emacs 26.3 (build 1, x86_64-w64-mingw32) of 2019-08-29 Repository revision: 96dd0196c28bc36779584e47fffcca433c9309cd Windowing system distributor `Microsoft Corp.', version 10.0.18362 Configured using: `configure --without-dbus --host=3Dx86_64-w64-mingw32 --without-compress-install 'CFLAGS=3D-O2 -static -g3''