From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Let's make C-M-w in isearch yank symbol, not delete character Date: Mon, 12 Mar 2018 23:19:19 +0200 Organization: LINKOV.NET Message-ID: <87k1uhqdkw.fsf@mail.linkov.net> References: <87371f34m6.fsf@mail.linkov.net> <83bmg3tczk.fsf@gnu.org> <83606atswi.fsf@gnu.org> <87d10i8bal.fsf@mail.linkov.net> <83ina9sx0o.fsf@gnu.org> <878tb4vowd.fsf@mail.linkov.net> <87tvtn3hkm.fsf@gmail.com> <87ina3zl7c.fsf@mail.linkov.net> <87bmfup9dx.fsf@mail.linkov.net> <20180312182458.GA4520@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1520889941 30313 195.159.176.226 (12 Mar 2018 21:25:41 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 12 Mar 2018 21:25:41 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: Stefan Monnier , emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 12 22:25:37 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1evUwq-0007kp-Vl for ged-emacs-devel@m.gmane.org; Mon, 12 Mar 2018 22:25:37 +0100 Original-Received: from localhost ([::1]:34762 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evUys-00014n-Ai for ged-emacs-devel@m.gmane.org; Mon, 12 Mar 2018 17:27:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evUyi-00013A-Cy for emacs-devel@gnu.org; Mon, 12 Mar 2018 17:27:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1evUyd-0003Na-FQ for emacs-devel@gnu.org; Mon, 12 Mar 2018 17:27:32 -0400 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:52911 helo=homiemail-a15.g.dreamhost.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1evUyd-0003NL-6O for emacs-devel@gnu.org; Mon, 12 Mar 2018 17:27:27 -0400 Original-Received: from homiemail-a15.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a15.g.dreamhost.com (Postfix) with ESMTP id 69EFC76C069; Mon, 12 Mar 2018 14:27:25 -0700 (PDT) Original-Received: from localhost.linkov.net (m91-129-108-46.cust.tele2.ee [91.129.108.46]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a15.g.dreamhost.com (Postfix) with ESMTPSA id 58EE176C065; Mon, 12 Mar 2018 14:27:24 -0700 (PDT) In-Reply-To: <20180312182458.GA4520@ACM> (Alan Mackenzie's message of "Mon, 12 Mar 2018 18:24:58 +0000") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-Received-From: 69.163.253.7 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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:223661 Archived-At: >> > Why only set those properties in the :setter rather tan just do it at >> > top-level? Also, would it be possible to avoid having to list those >> > commands and instead treat as `isearch-move` any command which uses the >> > handle-shift-selection? > >> Supporting only commands which use the handle-shift-selection >> makes the most sense. I tested this to confirm it works as expected: > >> diff --git a/lisp/isearch.el b/lisp/isearch.el >> index 84b121a..245bf8a 100644 >> --- a/lisp/isearch.el >> +++ b/lisp/isearch.el >> @@ -2433,8 +2448,8 @@ isearch-pre-command-hook >> (setq this-command 'isearch-edit-string)) >> ;; Don't terminate the search for motion commands. >> ((or (and (eq search-exit-option 'move) >> - (symbolp this-command) >> - (eq (get this-command 'isearch-move) t)) >> + (stringp (nth 1 (interactive-form this-command))) >> + (string-match-p "^^" (nth 1 (interactive-form this-command)))) >> (and (eq search-exit-option 'shift-move) >> this-command-keys-shift-translated)) >> (setq this-command-keys-shift-translated nil) > > Please don't do this. handle-shift-selection (whatever that might be) > is a different feature from the isearch extension, and users should be > able to customize them independently from each other. Correction: MUST > be able to customize them independently. This solution avoids the flaws of the isearch-allow-scroll feature that causes "customization hell" by requiring maintaining a long list of (put 'command 'isearch-scroll t) minutiae, and requiring adding the same for every new command. The feature should be smart enough to deduce a reasonable default set of supported commands, and adjustable enough to allow adding/deleting commands to/from the default set. > Although I haven't been following this thread all that closely, I'm a > little perturbed that in the space of little over a week, a small > definite proposal which makes a lot of sense has swollen into a > significant redesign of isearch, and an incompatible one at that. The main sub-thread was renamed to the subject "Isearch interaction model" where we are discussing significant changes such as merging regex and regular histories into a unified history, integrating find-and-replace into isearch, keeping toggleable parameters between searches, etc. > Disclosure: I've had an isearch-yank-symbol bound to C-S-w in my > isearch-mode-map for several years. Now isearch-yank-symbol is bound to C-M-w, so you can use the default key.