From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Karl Fogel Newsgroups: gmane.emacs.devel Subject: Re: PATCH: isearch-yank-until-char Date: Fri, 16 Aug 2019 00:11:50 -0500 Message-ID: <87pnl5pucp.fsf@red-bean.com> References: <87tvakfnv4.fsf@red-bean.com> Reply-To: Karl Fogel Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="199885"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Emacs developers To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 16 07:12:54 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hyUXm-000poK-I6 for ged-emacs-devel@m.gmane.org; Fri, 16 Aug 2019 07:12:54 +0200 Original-Received: from localhost ([::1]:49360 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hyUXf-0006Kf-Ov for ged-emacs-devel@m.gmane.org; Fri, 16 Aug 2019 01:12:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49335) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hyUWp-0006JH-Br for emacs-devel@gnu.org; Fri, 16 Aug 2019 01:11:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hyUWo-0001Gl-9j for emacs-devel@gnu.org; Fri, 16 Aug 2019 01:11:55 -0400 Original-Received: from mail-ot1-x32b.google.com ([2607:f8b0:4864:20::32b]:41220) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hyUWn-0001FY-MZ for emacs-devel@gnu.org; Fri, 16 Aug 2019 01:11:53 -0400 Original-Received: by mail-ot1-x32b.google.com with SMTP id o101so8541388ota.8 for ; Thu, 15 Aug 2019 22:11:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:reply-to:date:in-reply-to :message-id:user-agent:mime-version; bh=0ls3R2kj1+GpHLGg+NP8wdDP5RwKZcbBQXwSV/2E4pQ=; b=QMLTthRF3uVDrtIHz8vfk7KGofy8/9mEbNLS3Sao2YxSERkhAkD9yjmTYw08YGA8cA 0zmGJkONDWEN3MtAHDsDkDPu5wn6B4v3e5jNKO00o66Cnd2RYXY5de6rNbHJkVrhhUe2 /5pDXp2TZB1qIhfvUMgSG6WLBhN13sh13qL30Y+Frntcj5m0lvWJNes1DQWMOs9ImR7F 0837JtxIwzLpSBszo8eIyGr4Dv5rN3w6/V8ByfanrNZysAjmOA/lDukuNNtnjIW3q/ZM 3PmQEZ0Yiy/5p/VLG53Iadt/fQAE2WBDUKvjI8c6hE0AKgJXHl7t8wFhKRniEaD1Q1im 0v0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:reply-to :date:in-reply-to:message-id:user-agent:mime-version; bh=0ls3R2kj1+GpHLGg+NP8wdDP5RwKZcbBQXwSV/2E4pQ=; b=ttiFdA4EFuLRCGukgVHI0sq2xjAWDJERqYETpfU57rT14Chc+TIGR46y2xuJMoyjKG Gbfx4vZsjpjxlypyoGP7xfhtJtYl62fAldgiD0pJ0QcKxTojHiVVgLGBuY2sgdJTgtrF 2ETZ2EyGcTkTtuOmGuD7jgtIf21XzHcGTXXCi8s7w3tBZdwzFUWPCIVFd5eDuYnfeGuS VgLzrA8swiVe9DDRf5c0DVH5zSAqqHGfas6yLYegaY6bdnfhHKxpiny1zyNU0AmtmixB O3//PI767jiWD47jTQ+PF+4e2k2ZRvqLitpf64cAduuGX7e8rLnh/EY9369Xtck8VAjM QHOw== X-Gm-Message-State: APjAAAVjWNtAdOToPFpKCHob2ZuQGrdRA9VgwllpOqlXUjKUe2qkGKow oZpD0rxsacQvfeY9j+8SJFqlDtFV X-Google-Smtp-Source: APXvYqzsDTtnFxKL0IjQHRxOM7yksYxAntqUs2LSAUB2muQF6UavJiPxtvA/iOvv5tX+k2iqOTHDag== X-Received: by 2002:a9d:480e:: with SMTP id c14mr5571095otf.10.1565932312478; Thu, 15 Aug 2019 22:11:52 -0700 (PDT) Original-Received: from floss ([2602:306:3707:da30:684e:72dc:19ec:6d53]) by smtp.gmail.com with ESMTPSA id t10sm1320709otb.13.2019.08.15.22.11.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2019 22:11:51 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Wed, 14 Aug 2019 18:26:23 -0400") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::32b X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:239391 Archived-At: On 14 Aug 2019, Stefan Monnier wrote: >> This patch implements 'isearch-yank-until-char', a new yank command in isearch. > >I like the idea, but would welcome even more warmly an isearch which >yanks "whatever text is skipped by the next command" so it can be used >to yank the next word, sexp, char, ... I think Juri's point that for the generalized case one should just set `isearch-yank-on-move' to `t' may be the right answer. After all, the command most commonly used to skip over some text is isearch itself :-). Aside from that and the sexp motion commands, the things one would normally use to skip over a predictable amount of text are already represented in isearch-mode. For example, the equivalent of M-f in normal mode is C-w in isearch-mode (`isearch-yank-word-or-char'). and the equivalent of C-e in normal mode is M-s C-e (`isearch-yank-line') in isearch-mode. It's hard for me to think of further generalizations that aren't already adequately handled by setting `isearch-yank-on-move' to t. In practice, I find that when I use `isearch-yank-until-char', it's in a macro in a programming mode or markup language mode, and the relevant syntax delimiter is some single character. This is such a common case that IMHO it's worth supporting directly in isearch. But Juri's idea of defining a new function `skip-to-char' and relying on `isearch-yank-on-move' is also interesting (and not mutually exclusive, of course). Best regards, -Karl