From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#39512: 28.0.50; Add command isearch-yank-region Date: Sun, 18 Apr 2021 17:34:00 +0200 Message-ID: <20210418153400.vf5bum44i4zw72i7@Ergus> References: <87v9hst5wv.fsf@gnus.org> <87mu33zchk.fsf@mail.linkov.net> <20200810011954.ro4utplq3ohpob2d@Ergus> <87v9hqjb27.fsf@mail.linkov.net> <20200811011246.bcciofvpzjtuy3jb@Ergus> <87k0y4n5dk.fsf@mail.linkov.net> <20200812174125.gicbgyrz7nhsdjsi@Ergus> <87h7t7ieqe.fsf@mail.linkov.net> <20200813031420.7vq5bz7loeqiuntx@Ergus> <8735vrgx8p.fsf@linkov.net> Reply-To: Ergus Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22427"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Tino Calancha , npostavs@gmail.com, 39512@debbugs.gnu.org, contovob@tcd.ie, Lars Ingebrigtsen , eliz@gnu.org, drew.adams@oracle.com To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 18 17:35:17 2021 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 1lY9S8-0005hC-DY for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 18 Apr 2021 17:35:16 +0200 Original-Received: from localhost ([::1]:42556 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lY9S7-0000U0-2T for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 18 Apr 2021 11:35:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35800) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lY9Ru-0000To-50 for bug-gnu-emacs@gnu.org; Sun, 18 Apr 2021 11:35:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35923) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lY9Rt-0007o1-Se for bug-gnu-emacs@gnu.org; Sun, 18 Apr 2021 11:35:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lY9Rt-0003lY-Oh for bug-gnu-emacs@gnu.org; Sun, 18 Apr 2021 11:35:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ergus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 18 Apr 2021 15:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39512 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 39512-submit@debbugs.gnu.org id=B39512.161876006814431 (code B ref 39512); Sun, 18 Apr 2021 15:35:01 +0000 Original-Received: (at 39512) by debbugs.gnu.org; 18 Apr 2021 15:34:28 +0000 Original-Received: from localhost ([127.0.0.1]:47469 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lY9RL-0003kg-N1 for submit@debbugs.gnu.org; Sun, 18 Apr 2021 11:34:28 -0400 Original-Received: from sonic305-2.consmr.mail.bf2.yahoo.com ([74.6.133.41]:36096) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lY9RK-0003kS-3x for 39512@debbugs.gnu.org; Sun, 18 Apr 2021 11:34:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1618760059; bh=ajQBKGwHebKybVSYgLJWChS6l6rSjC0S74E78PnPAws=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject:Reply-To; b=AfWOZMogkMInnYw0b6M96Lp4WB/1pno17iNIsI30olrOQuY7e9ckDxOs4+DtOYjrZnqLFtRfAeERfFHFguyCN80zS87MdYFcy4otIKWakYPSaglk1LZZMyY6KWyLP0528AEpC/sXq3Wb1ACVPxFoBlNdPZSqxOiRnlOnzJBQRK/FEWOoJH+/PR7QO/Wc+EADtaAp17dl9ToEaP6gzyXaDrBixQaThdaJlXDfmFnprx5Hq6M5yb3iCnbBxxFGsMVqCgeFmSjAGjDacSvLOdAEx+NA4kXpNXgE7ep/gAMZDLbGz3o/sn3ns3PGLdUCvzAQs9/QGacYuA8ThebDkClqRg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1618760059; bh=9Mkwt9K2y4PjWgYamwtlwbWmEjPu6Mud4Lcg7SyGibY=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=dnu5w/sHK+FFNtYxIKWJs0Cyq0IVqHQrQuC+8IcfmgYoB7sdWLT6xDbEnPLb3X9XhKJ+ThAYjQC7pl23JM82VOqFDNihV17Q3Ltxi0gOKtZuUbxRbUgilb2Ytxd7CbtdvrjRfiJhJcKApX7hX6SGHhdlP0OCq5+HK5i4pQa6aD9YfEGHPNRcc1d7uq5cgGZxnv1fuXTRthan6JQkFoaROf7ciyucNSW2BEPRv/pODYPkHgWYnYOqULiDkn54gHDQFDVND/NANK2eXjHigd2jLJcucN+adrhxSWxfsYznXbpNGsggnB5OPjtH70HnPHxws5+qJYnNG8lJs1OJnU4VyQ== X-YMail-OSG: FbAI3FsVM1l4PTfUYOrsgTwLfS3py9KVXum4uiT89m40sKQQjoSP.g315GWb6pG .bMzkYvU_0YmvmyUUaAAIQDuQZpmWwJT.CCi42G.2sZYZAnzNu18QjrdEiKL2Jb679accwTgcKZW 2bHH8FVtzBgdI85Ak3PLvFvqt9uX9TlcIovwH1BsY6qVDWT90u31xzBn9L3YTPfsNxlbueiaxUMG bBJruqDxKnfM_xcwAyw9ALcsDGKCyJuyGNBp9sQQbaCI2_vgQ43ipWfFdFiRUWw5OY7.msl21h4S IpbCG44UnaElLUTTKtb9wb4rdeKaCCdVfpT6OxYBi1FY4efzmX3Uhp5xDZ8az_ta0fQaEFQCYJzB He0SZa8mUgPVzIKs2kT3e9R5X_qR5BjAAb0Q4TpZkvIQAoWb30J4AqNq5TOU9Og2N3MG5x6PlA_i 5m.H8Vz5MzubmNVUth58cFoYU5xtTlQCK8z81RfjOyq2SN1HlLeWxKcyCkoSrUwm_Q7XgP4L7nn4 .m2_CpMy66IW2TbiWleLLNsWPUHzKEqtAvJED_QOgCYDZlcI7SrZp8J7u8BEcXURrFJglU7kjorJ Wcct7TgfM1_t9pgOo8N0AYY9AdUi0V.1gI2522hebxU0uXNN2TkKgU9PE8B3BPG2OhlphhNeJUmM 6X1FUJ3Jp8RHN_LyuRW5RX1qYA8xETzA22SHrQdDLwA6yXJGMcN64SVJZFUEUJDHlgiItn9Vbgc_ VOQhgaxCes.EwaGSOfBzIGjCr4fXnLJu_oZMVExl0YH7f9vZ0DBFKZ1SDiWNDKbdkXqfDZHhZP7X CKrB4ruWuRRD.N5ugA0vz3GgGfkfXfODQGv0JjXug0 X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.bf2.yahoo.com with HTTP; Sun, 18 Apr 2021 15:34:19 +0000 Original-Received: by kubenode534.mail-prod1.omega.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 2eab219d0932526f0ec32f1a2cacaa70; Sun, 18 Apr 2021 15:34:17 +0000 (UTC) Content-Disposition: inline In-Reply-To: <8735vrgx8p.fsf@linkov.net> X-Mailer: WebService/1.1.18121 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol Apache-HttpAsyncClient/4.1.4 (Java/16) 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:204353 Archived-At: On Thu, Apr 15, 2021 at 11:52:03PM +0300, Juri Linkov wrote: >> So without any other alternative, `M-s M-.` will be good enough. In >> general it would be better (for consistency) if we "reserve" `M-.` >> "suffixes" for future thing-at-point-or-region commands right? >> >>> In the previous message you sent a link to `ivy-thing-at-point` that >>> also uses (thing-at-point 'url) and also tries to get a filename at point. >>> Do you think `thing-at-point-or-region` should do the same? >> >> With the interactive experience in mind I think this could make sense as >> it does in `ivy-thing-at-point`. >> >> In my opinion from the api point of view, the important modification >> could be the method to know the "kind the thing" detected after calling >> the function (region, word, symbol, url) but also a function to get the >> bounds instead of the text (like bounds-of-thing-at-point-or-region). > >I continued trying to do what you suggested some time ago >and immediately stumbled upon a question what "thing" >to use by default as an argument of '(thing-at-point thing)'? > >Trying these priorities: > >(or (thing-at-point 'region) > (thing-at-point 'url) > ;; (thing-at-point 'filename) > ;; (thing-at-point 'list) > (thing-at-point 'symbol)) > >has several problems: > >1. There is no such "thing" as 'region'. Maybe could be added to thingatpt.el? > This was actually the most important part in the request. Maybe an extra optional parameter like use-region could be added to bounds-of-thing-at-point that uses the active region when region-active-p or use-region-p. As I already mentioned; IMO the idea is to follow the same logic than here: https://github.com/abo-abo/swiper/blob/471d644d6bdd7d5dc6ca4efb405e6a6389dff245/ivy.el#L427 where `(thing-at-point 'region)` is basically the first branch in the cond. >2. 'url' returns nil when there is no url at point, good. But > 'filename' returns non-nil on any string, not only on real filenames. > 'filename' must match a local filename or a path... but it may be costly to check in the filesystem if the match is an existing file... specially when using tramp... so I don't have a solution for this. But the linked code uses some ffap api for that. >3. It would be nice to use (thing-at-point 'list) only when point > is on the open/close parens. This is how double-clicking by mouse > selects the thing at point of mouse click. When clicked on a paren, > the whole list is selected by 'mouse-start-end'. > 'isearch-forward-thing-at-point' could be the same logic. now I use C-M-SPC for this selection and then M-w to copy and C-s C-y. If you add the command, then it will save the M-w and the C-y to copy the region, because region will be already active... But will require the M-s prefix any way... so not 2 but at least 1 bind will be saved. You can consider this option in the future if you want...