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:36:56 +0200 Organization: LINKOV.NET Message-ID: <87efkpou13.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> <87k1uhqdkw.fsf@mail.linkov.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1520890532 13974 195.159.176.226 (12 Mar 2018 21:35:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 12 Mar 2018 21:35:32 +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:35:28 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 1evV6N-0003UV-0O for ged-emacs-devel@m.gmane.org; Mon, 12 Mar 2018 22:35:27 +0100 Original-Received: from localhost ([::1]:35051 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evV8P-00074E-Si for ged-emacs-devel@m.gmane.org; Mon, 12 Mar 2018 17:37:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38956) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evV8F-00072C-MQ for emacs-devel@gnu.org; Mon, 12 Mar 2018 17:37:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1evV8B-0000nn-PP for emacs-devel@gnu.org; Mon, 12 Mar 2018 17:37:23 -0400 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:42638 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 1evV8B-0000nP-GQ for emacs-devel@gnu.org; Mon, 12 Mar 2018 17:37:19 -0400 Original-Received: from homiemail-a15.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a15.g.dreamhost.com (Postfix) with ESMTP id F1E4A76C069; Mon, 12 Mar 2018 14:37:17 -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 D989376C065; Mon, 12 Mar 2018 14:37:16 -0700 (PDT) In-Reply-To: <87k1uhqdkw.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 12 Mar 2018 23:19:19 +0200") 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:223662 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. This patch clarifies the idea: diff --git a/lisp/isearch.el b/lisp/isearch.el index 84b121a..56a44d8 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2434,7 +2449,10 @@ isearch-pre-command-hook ;; 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)) + (or (eq (get this-command 'isearch-move) 'enabled) + (and (not (eq (get this-command 'isearch-move) 'disabled)) + (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)