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: Mon, 26 Aug 2019 00:20:58 -0500 Message-ID: <871rx87b9h.fsf@red-bean.com> References: <87tvakfnv4.fsf@red-bean.com> <87lfvvjxjs.fsf@mail.linkov.net> <87sgq1r9rb.fsf@red-bean.com> <87lfvt6m1e.fsf@mail.linkov.net> <877e7256uc.fsf@red-bean.com> <604cbbef-7e25-486a-a97a-9bc1adf23928@default> 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="158383"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 26 07:21:37 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 1i27Rg-000f4e-Fb for ged-emacs-devel@m.gmane.org; Mon, 26 Aug 2019 07:21:36 +0200 Original-Received: from localhost ([::1]:49966 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i27Re-0007c4-Mh for ged-emacs-devel@m.gmane.org; Mon, 26 Aug 2019 01:21:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52702) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i27RA-0007bm-K4 for emacs-devel@gnu.org; Mon, 26 Aug 2019 01:21:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i27R8-0002Vr-Ch for emacs-devel@gnu.org; Mon, 26 Aug 2019 01:21:03 -0400 Original-Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]:38341) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i27R8-0002V1-6Q for emacs-devel@gnu.org; Mon, 26 Aug 2019 01:21:02 -0400 Original-Received: by mail-oi1-x230.google.com with SMTP id q8so10920418oij.5 for ; Sun, 25 Aug 2019 22:21:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:references:reply-to:date:in-reply-to :message-id:user-agent:mime-version; bh=OeteJq+9kh7fGMZ7M0B0UnXp67ptkMedRJubUSifhvw=; b=ZLcw6KSjU2Yl8KW6Z9WHSDEF3fF7+B73B0/ePtx2VmWnGMgM0ZJ6FE12TZHWAFJ6nt 6xVyfbe/nI0IlZmZqaxcE0XlnpvNok/r6DY0a/BeTKzuchLozj+4oAyYg3Rf8iYs6BdJ RgG9ifYM9Ymh8L50yv+noXCWO5PTjRTWMESLxikiePzCjR/S6+GwvDJBkQ2uywYGMHhS 83SfdtOhUWl0N/juchhMslTvILelrjcA6SBuyrCamFMJFRDgKCZHA9KSlK3FG1Qxz8jI fW1uTCz8BF6C1qN7AhUdatBzvFonTep2E2LdZJZgwXKImsOiqmeXOGOFz0ohIqNnxCDv Bmeg== 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:subject:references:reply-to:date :in-reply-to:message-id:user-agent:mime-version; bh=OeteJq+9kh7fGMZ7M0B0UnXp67ptkMedRJubUSifhvw=; b=ZH+BHITJDukTdnBKcZbYcY5SBXwtn0PctYy1Wpk3UyXxZQTpuBjHbykqDa0HK0V70p QBLKN8fGdjAGmuPo//UaxzpQTjRuctKeYiEkKfGmbEag6nBZ8n99me2HL3/fUE2RM2UK HA4laKQRclSXazMlsqfYra8KojmlsbbUrXPFnI0J1pNwsepIm3+wzJQNiXT/Y46zG3YG TtYbVnntXjB5hiKgcjOHW46Azzii3bI24/HjWvtWkovzLUiGvcAYSzv0rVF9OKzuPcal ezXJ3PeH/kVF3VSiQ8gW5I7Y1kIq2MA6erWslQLSRAtViTCbuIJaCryHLwBy4snaN7A0 Xp2w== X-Gm-Message-State: APjAAAUpB+svO2PtR2h+SiVWgzyN69eL1c4qsL776c2HBznXBF04Wy3d DcFavcmoO07KVoPi6OvPWOPBJLex X-Google-Smtp-Source: APXvYqzkKRhI2xvPiUEMA7yP5SUzWQTNjBTI56ITiOW7FvGeMVm6nEPmyB/9T//cguAW0iHyA2YZAA== X-Received: by 2002:aca:3887:: with SMTP id f129mr10541841oia.108.1566796860400; Sun, 25 Aug 2019 22:21:00 -0700 (PDT) Original-Received: from floss ([2602:306:3707:da30:ad9c:44ea:f06c:906c]) by smtp.gmail.com with ESMTPSA id a21sm3037569oie.9.2019.08.25.22.20.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2019 22:20:59 -0700 (PDT) In-Reply-To: <604cbbef-7e25-486a-a97a-9bc1adf23928@default> (Drew Adams's message of "Sat, 24 Aug 2019 20:22:12 -0700 (PDT)") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::230 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:239567 Archived-At: On 24 Aug 2019, Drew Adams wrote: >> I've left the code as-is; the current patch is attached here. >> Do we have consensus to install it? > >Well, I don't agree, FWIW. You seem to have ignored >my message & patch (Aug 20). Did you read or try it? >(You were cc'd: "RE: PATCH: isearch-yank-until-match".) No, I didn't. I mean, I saw it, but didn't have time to try it. Remember that you started out that new thread (on August 14th) with these words: > This is similar to what Karl submitted today. > Not a replacement for that; something different. Since your followups were all in that thread, I assumed they were about something that was "not a replacement" for what I'd posted, and therefore wouldn't affect the question of whether what I posted should be installed. (I rely pretty heavily on thread discipline, not just in Emacs Devel but generally.) >Commands like `isearch-yank-until-char', which yank >consecutive buffer text at the search point, are better >if they can also work with backward search. My patch >implements that for this command and others. It sounds like your patch does two conceptually distinct things: 1) Implement one or more new commands. 2) Make a bunch of isearch commands work with backward search. If I were to install my patch (as it's currently written, though maybe with the keybinding changed), that doesn't really affect any of your new code. However, I would still say your patch should be divided into two conceptually distinct patches, one for (1) and one for (2). This is not a judgement about the technical merits or the UX merits of your patch. I'm just saying that we should do one thing at a time. >And I argued that `C-M-c' would be better used in >Isearch for my command `isearch-yank-through-move', >which initiates a recursive edit to allow arbitrary >cursor movement. In that case, `C-M-c' both starts >and ends such movement (since globally it is >`exit-recursive-edit'). *nod* That's a separate question from the above. I don't think it's very important that C-M-c be the binding for `isearch-yank-until-char'. If we want to save C-M-c for this other potential use, that seems reasonable to me. Your patch suggested "C-M-." for 'isearch-yank-until-char', which seems good. Another possibility, to keep the "c" for "char" mnemonic, is to use M-c. Right now that key seems to toggle case-sensitivity, but I'm not sure that's deliberate -- according to the `isearch-forward' documentation, "M-s c" is for that, while "M-c" isn't documented at all. Given that the current action of M-c isn't documented, and given that another keybinding both does that action and is documented to do so, using "M-c" for `isearch-yank-until-char' might be okay. The code and comments around "M-c" vs "M-s c" are a little more complex than I expected. Here's the relevant block from the definition of `isearch-mode-map': ;; Some bindings you may want to put in your isearch-mode-hook. ;; Suggest some alternates... (define-key map "\M-c" 'isearch-toggle-case-fold) (define-key map "\M-r" 'isearch-toggle-regexp) (define-key map "\M-e" 'isearch-edit-string) (put 'isearch-toggle-case-fold :advertised-binding "\M-sc") (put 'isearch-toggle-regexp :advertised-binding "\M-sr") (put 'isearch-edit-string :advertised-binding "\M-se") Both bindings actually work. But you won't see "\M-sc" explicitly bound anywhere in the map, even though it's the advertised binding! Instead, the actual binding happens elsewhere via a call to the macro `isearch-define-mode-toggle': (isearch-define-mode-toggle case-fold "c" nil ...) The code above suggests that it is not important for M-c to remain redundantly bound to `isearch-toggle-case-fold', but I could be wrong. If anyone knows more, please say. If we can't figure out the answer, I guess I'd say let's go with "C-M-.", out of general conservatism. Best regards, -Karl