From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Augusto Stoffel Newsgroups: gmane.emacs.devel Subject: Re: [External] : Re: [WIP PATCH] Controlling Isearch from the minibuffer Date: Wed, 12 May 2021 23:09:26 +0200 Message-ID: <877dk3r75l.fsf@gmail.com> References: <87zgx5cz33.fsf@gmail.com> <878s4n4wn8.fsf@gmail.com> <87y2clve4m.fsf@gmail.com> <87fsyswiv1.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29824"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cc: Alan Mackenzie , Drew Adams , "emacs-devel@gnu.org" To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed May 12 23:10:34 2021 Return-path: Envelope-to: ged-emacs-devel@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 1lgw7m-0007Zz-Os for ged-emacs-devel@m.gmane-mx.org; Wed, 12 May 2021 23:10:34 +0200 Original-Received: from localhost ([::1]:38874 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgw7l-0004XZ-Ka for ged-emacs-devel@m.gmane-mx.org; Wed, 12 May 2021 17:10:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56494) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgw6m-0003qP-D4 for emacs-devel@gnu.org; Wed, 12 May 2021 17:09:32 -0400 Original-Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:40646) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lgw6k-0000a3-PK for emacs-devel@gnu.org; Wed, 12 May 2021 17:09:32 -0400 Original-Received: by mail-ed1-x531.google.com with SMTP id c22so28683228edn.7 for ; Wed, 12 May 2021 14:09:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=+sg32vnXe37sQ69J03lIBiwmkP24+uy6C8bGe06OaQY=; b=vXK6iGTO6dvfihZ9O2NnBC604as7nVTGpprKHHNNcWtTPh4HLZUnsaco694WvbK/ub FfcCt9s99LkymM5tvAs0sDa8dkekljAS0omh3k1mtKuUISv3J1g90ezfP3LnZI09K+ra 1Qv7jeTXQM8Y7DtWUrnNfxw41O1gwwFlQ7aoaPPuwcDrfLmSUaqaOv/zG4thloQX+M7e PGqB1TwOr6k1fEAIwvXheNyZyIMpFRyPbsvGyeOBIxctmncDVKeOpN+3puix02dhPpwg kn4RdoNqzTiRu2Mo5CDetfeLR8PnS8x40isMabmWgzjZ31YO1JPhY9g4hQSm0e0V21Ls FUQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=+sg32vnXe37sQ69J03lIBiwmkP24+uy6C8bGe06OaQY=; b=JPLQCJ9NN1zmUPQh780/JOIr4TMw9JlhRV+McNceGzzYQ5avTw/orn5jzQuOfiOwZc 6fjeP0qH24zU54d50QJ061FwRk7oMTAuWUbZoEGvXYvV8LZGOPKeBaVHA6X1DQ9Uoeug jpamfKulKJdxOC3hEy+4kELl+cL3PIh29NYdN+S27FAiAeJyMB3xe3Fil+S0XRO+f58c OUhXgftpGXCGSTETkrLxhmiqj32pZg4IUm31JLefLzOEqK5m5cQLUxVoU8idmXAkvg49 6DoebdehBiYB/vaYihGqI+mjDAvwsNxy9fw5WE01NKteUmBEX/ljAohIAHI4lqKSj6+e pEpw== X-Gm-Message-State: AOAM530DofPHU2D2n1Ca1RCitHuRmwJFSkCNUSBvOdZf3zolZx994vpE G4plB4lRv9LHXTMRxcOAAGrfJr2lxUgTsw== X-Google-Smtp-Source: ABdhPJw/Py3xairi2oHcj3W9dZKSDnSSqe4aceFccyDws6wRdLlGy+aXNHYFhv1N2gpS2vrCCcW5Cg== X-Received: by 2002:a50:bec1:: with SMTP id e1mr45708778edk.116.1620853768198; Wed, 12 May 2021 14:09:28 -0700 (PDT) Original-Received: from ars3 ([2a02:908:2211:8540::68a]) by smtp.gmail.com with ESMTPSA id p5sm585041ejm.115.2021.05.12.14.09.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 May 2021 14:09:27 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Wed, 12 May 2021 08:44:19 -0400") Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=arstoffel@gmail.com; helo=mail-ed1-x531.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:269220 Archived-At: On Wed, 12 May 2021 at 08:44, Stefan Monnier wrote: >> You can think of my patch as (1) adding lazy highlight/count and an M-s >> prefix to the good old M-e, which is indeed a bit of work, > > [ Sorry I haven't followed this thread very closely, so just a comment > from the sidelines: ] > > I don't know what this `M-s` thingy refers to, but I for one would very > much welcome lazy highlighting during the `M-e` minibuffer editing. The `M-s' thingy would be a prefix keymap including `isearch-occur' `isearch-highlight-regexp' and what not. > >> and (2) adding the entirely optional minibuffer-controlled UI which >> only takes a dozen of extra lines to implement. > > I don't know what impacts it might have on the UI, but I've often wished > (from an implementation point of view) that Isearch used an actual plain > old minibuffer rather than mimicking one (which doesn't necessary mean > it'd be a good idea either, just that it would have some benefits and > that the downsides were not as immediately apparent ;-). So far, the biggest hurdle I can see concerns the handling of commands that end the search and read from the minibuffer afterwards, such as `isearch-query-replace'. This is tricky because one has to somehow unwind the `isearch-edit-string' minibuffer without relinquishing control to its caller. The first patch I sent in this thread used throw/catch of a continuation function for this. The second does the following in a pre-command hook, which seems to work: (when (member this-command isearch-edit--quitting-commands) (run-with-timer 0 nil 'command-execute this-command) (exit-minibuffer)) I can't think of any simpler alternatives (and I still prefer the throw/catch solution). > > > Stefan