From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: John Shahid Newsgroups: gmane.emacs.devel Subject: Re: Let's make C-M-w in isearch yank symbol, not delete character Date: Sat, 10 Mar 2018 13:34:49 -0500 Message-ID: <87tvtn3hkm.fsf@gmail.com> References: <87po4slrg4.fsf@mail.linkov.net> <831sh82zyf.fsf@gnu.org> <87h8q2w29i.fsf@mail.linkov.net> <83tvu1zsru.fsf@gnu.org> <87tvtzjvh4.fsf@mail.linkov.net> <83tvtyx55a.fsf@gnu.org> <87efl0pz4d.fsf@mail.linkov.net> <83o9k3u9ku.fsf@gnu.org> <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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1520706784 29770 195.159.176.226 (10 Mar 2018 18:33:04 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 10 Mar 2018 18:33:04 +0000 (UTC) User-Agent: mu4e 1.0-alpha3; emacs 27.0.50 Cc: Eli Zaretskii , emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 10 19:32:59 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 1eujIh-0007cl-MA for ged-emacs-devel@m.gmane.org; Sat, 10 Mar 2018 19:32:59 +0100 Original-Received: from localhost ([::1]:51607 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eujKk-0005Gg-FU for ged-emacs-devel@m.gmane.org; Sat, 10 Mar 2018 13:35:06 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eujKd-0005GM-M3 for emacs-devel@gnu.org; Sat, 10 Mar 2018 13:35:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eujKa-0006w2-Im for emacs-devel@gnu.org; Sat, 10 Mar 2018 13:34:59 -0500 Original-Received: from mail-qk0-x22d.google.com ([2607:f8b0:400d:c09::22d]:40872) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eujKa-0006vo-EZ; Sat, 10 Mar 2018 13:34:56 -0500 Original-Received: by mail-qk0-x22d.google.com with SMTP id o25so7265502qkl.7; Sat, 10 Mar 2018 10:34:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=Pz+u8k1w2MWiDHm6wP31XaADGkGTsFZby5+zMlkHYgA=; b=TJgZB4sQUa+23NmAUgSoX2h5ga6XBpZ3cfPDgAH5JfV9g0oOSWLMt/OgT5mmh4v09E MoFtJmCgxVk1XFM0Tj5/zKl0O64ckcWDRGxwllo7wpOzQMUnjuvRF/NPpsz1uNHI+E8l s3IHC0gkup7KVTTLRUCLG7xPI9w8Xa8HeXz2yBs9Pq7mx/zI0F+cvu9zxwE5b8Mh43U4 /VrV8N3M4GyyMYBEgSIVlf82ik4zpmqzSLUYPSo0KWJaTvQlUt3ISO7GYBVKObiIcpGW OL3JvBiQGXVPuqsFcX4EWvd90qOmbgMHZh1NRy1gBliPl4SdHbJ7F0faI0X1NMAoThfX v/IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=Pz+u8k1w2MWiDHm6wP31XaADGkGTsFZby5+zMlkHYgA=; b=aaqhx/HV/vM+ONOfMrh4+ETudgj8yCBwnxq7efRpuFHCHG0AmZIoVLF9Al3UQ0dI+G WmKNB7KDyNPaU3oipM9IsqT0nr8CukVR9/l+e3FuMK5sNQsS2UtomuiqLcI2hi+4AM4p /wltpVTZ/C6OWeulUea5BBh8h/A41DyZu+hQ98Hx7ODgqHPxgLNifCkF+XsjPQtf0ZUH DIG71PuemittTzjfLNhAo3i3M91+0w2uapv8lg2SXgCd6j+fb0FocSobECje51AaP2Nr 9LYVsPDfPTBMtnkGYQ3aR67HywWY2VmQMtF/HpfW1lygLqgJgmud1lINz96DOce/9/sw 4IEQ== X-Gm-Message-State: AElRT7Esig0wf0bnTMzjjt+Dtw2fj570iE+nSazwhmGNyemEZYGnPlpf w3cd/APmMWHKLOgADngtsAntb0wN X-Google-Smtp-Source: AG47ELsEpjV+KlXvqbGdNRJdP2kdwWEMRnz/vDE/FljzkXBgj40N5UmKnuZgzFGLt8U/z+qUw+mzNw== X-Received: by 10.55.42.32 with SMTP id q32mr3968972qkh.297.1520706895194; Sat, 10 Mar 2018 10:34:55 -0800 (PST) Original-Received: from amun (cpe-184-152-54-116.nyc.res.rr.com. [184.152.54.116]) by smtp.gmail.com with ESMTPSA id f189sm2365300qkj.85.2018.03.10.10.34.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Mar 2018 10:34:54 -0800 (PST) In-reply-to: <878tb4vowd.fsf@mail.linkov.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::22d 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:223589 Archived-At: Does it make sense to set the `isearch-move' property on some common forward commands, e.g. `forward-char', `forward-symbol' & `forward-word'. I just compiled and tried the latest master to test this feature and it wasn't immediately obvious that I had to set the property for those commands. I was confused because I expected the built-in functions to work out of the box with this new feature. cheers, -js Juri Linkov writes: >>> >> Error in pre-command-hook (isearch-pre-command-hook): >>> >> (wrong-type-argument characterp right) >>> >> >>> >> Error in pre-command-hook (isearch-pre-command-hook): >>> >> (wrong-type-argument characterp 134217830) >>> > >>> > That's a bug that needs to be fixed, I think. >>> >>> Unfortunately, I have no idea what characters to append to the >>> search string in such cases. >> >> How about nothing? > > This reduces the usefulness of this feature. > But OK, here is a new option for it: > > diff --git a/lisp/isearch.el b/lisp/isearch.el > index 96faa27..b22a775 100644 > --- a/lisp/isearch.el > +++ b/lisp/isearch.el > @@ -82,6 +82,7 @@ search-exit-option > (const :tag "Edit the search string" edit) > (const :tag "Extend the search string by motion commands" move) > (const :tag "Extend the search string by shifted motion keys" shift-move) > + (const :tag "Append control characters to the search string" append) > (const :tag "Don't terminate incremental search" nil)) > :version "27.1") > > @@ -2452,13 +2453,18 @@ isearch-pre-command-hook > this-command-keys-shift-translated)) > (setq this-command-keys-shift-translated nil) > (setq isearch-pre-move-point (point))) > + ;; Append control characters to the search string > + ((eq search-exit-option 'append) > + (when (cl-every #'characterp key) > + (isearch-process-search-string key key)) > + (setq this-command 'ignore)) > ;; Other characters terminate the search and are then executed normally. > (search-exit-option > (isearch-done) > (isearch-clean-overlays)) > ;; If search-exit-option is nil, run the command without exiting Isearch. > (t > - (isearch-process-search-string key key))))) > + )))) > > (defun isearch-post-command-hook () > (cond