From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 12113 invoked from network); 27 Jul 2021 15:10:06 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 27 Jul 2021 15:10:06 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1627398606; b=ZZ4F63BxNEakoFdRgrHZRjLWGp8zCf5MRqQShhT+4zq12DvhVJPWUYFdrAeL3Eln7uQhSAO2nR E8b8uL9NuzUwtncJ/AzIzkIXtYcNNAi2mHTut0TD2/Qx6H6b23KZ3x/01rFy8jhXJ5JTzTIYJL ZCITHlJDb2oiHVII37lcNWFUB1nDbZEwxYLLi21oxYnL41A1oPtgFDbWLutcTNnHFx+diJuzc6 2jFDsw8xwM7wG9NX7xQpCKR4XKv7xoz1oVhp8fjOzP3MLz7nFjlfmphN1YHGSwkjHFHuA467ED rjNxtjLVapALjE7NT3xuZ/7hzcGOfkGtl/PLPcHSsDRmcw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f49.google.com) smtp.remote-ip=209.85.208.49; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1627398606; bh=fmlyPJcHK3/JucZfEfK+FkqPZu/hgyGiElT0clQ1CC8=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=zOddCfcUqc+VdKHVDjFKdz7LBtSxW60rtCzj30Tcpv1Mynv8lOs5xc39aWmsXwFWtkltqa67nv z6MQZlvci2r1cwYPRWO8iMIJ1VXsGvmlQSVMOzKistZIpsTXhTrFffl7WFwgT30ZwbUmOvZ4hl hn5EOcsCtp3fJnWYPn60ertZ3wJA1T33rNQaaclRETHy8XY7MYm1uw19wGkpROdxyY3RbKk8he /9CNrlJvSBlliLsKrEzhhdk+V1BtAHsoaH4PTTCmWNscyiFnI8U3ymVXm+CE1WkYdyKdKz9eZx OF2XNqEsIYwRnQ9ET4B0m8Hq2gydUjwaU3mTsLOXma3HxQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=eWCMJIdBfx6aadErs/gVXfj8fhQdLi0WLtqk2KaLg/E=; b=vbm8ghYO1DrYdEElgiib3pBGM+ /lGda8HfG0qQWt3Twm0tE+fAz7laTGc/SMJdj3p+sliclH9uFvBLGelNJJnkNoCgOSeeligzEkZFk ulfGDo4/jDTdvf4hchC6BWmSvf65sMP6/qNxDv2IEbb31Pnh1yQ3rW2/o7XQPUTTAr0aq4wZqdX3h ofyfG56YhmMCRHT5V/ZDVss8eIc75a1ual2G4CQhrOh0bLSWP+etnhVFzYFq4pwEPchmjJCMFLWN4 5QFaqh1M0FTjEFxGNYu1AWz6W9hXA6rAkpqOtcRr5HEGYdt5bZJ4V8LGIeRfKZit0trrukF4zY65H XnEiD4tg==; Received: from authenticated user by zero.zsh.org with local id 1m8Oib-000G8H-ML; Tue, 27 Jul 2021 15:10:05 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f49.google.com) smtp.remote-ip=209.85.208.49; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-ed1-f49.google.com ([209.85.208.49]:42505) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1m8Ohr-000FOv-O8; Tue, 27 Jul 2021 15:09:21 +0000 Received: by mail-ed1-f49.google.com with SMTP id p21so8672749edi.9 for ; Tue, 27 Jul 2021 08:09:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eWCMJIdBfx6aadErs/gVXfj8fhQdLi0WLtqk2KaLg/E=; b=q23VFWINMtPRKQu/Zy7ckYus/eiVRhqQPFKbnwCYggUNo3MV0aRUvEt6C9KMez8tmr jb/ga8I7zsCgjhoZRikEMaGn4o7qCYtDicTaeX1tdr0zmvVNxF763W0UyMYHqxX1EM0l YERrGBOJzTcueuQtCMRTk+I0dNGrvufnv9JsQspWwq1N35ZMnZnW/MkTA1WvxaToKlE+ 8zEtyp3/WSg+YXTXkT86Ck4rT77fjFczfEP+abR3N/jVohP6Yz/RoI6C8SIci1rkhbMx iaH/vAhUBMtGX6/ph5Q/yDNq+W0EMQBHSpS//pH2USr7E38ETRjWuzN58sFfsFH38/pk p0ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eWCMJIdBfx6aadErs/gVXfj8fhQdLi0WLtqk2KaLg/E=; b=CPlohmKSU7V88gqnczm1SoeVZD5xKOJq0rm0E66ahUc//SYF2NdipaWSukxlLFw64y Y++mQcbyucR/WJgYEivrGw5EuXym9DkS/mch5LPB/o702GcXyQ/LzInhf8R4MtOsIXCs QfwkTQ6dPu24tKxBr82uC0fN9UaHmoJPwXyM1joR1XNeRisSBYHE14sPMYU5atQUMxzF uHRnz2h4medbR/wGlz837d23RG3BCsRf65EhIHIerekl+UmimzDYCuqLGFX7l6HapimQ WbSqsBsJUFBVoWm3DdXS0oYEznygNuiwgptKOdmDXt8RNmmR9Eqx/HCiS86WV0Nx2fts pvlg== X-Gm-Message-State: AOAM5325lZqfzFeIOaLdRw1L/2fHfyF8pUsCdUGkqmjuGK0EgszinW4n C27+lQq58KoT7UNOf4zpKkLvyyK4yqE4zQt8I5Ew7q7s X-Google-Smtp-Source: ABdhPJwwr7F/zTNIAXcWjBD6iTIS/aY9bfy/gpzcc038RuSh2nwNYocd5ioCB09B7OGFqV1suMGaNKHuTIvSUjqqFt4= X-Received: by 2002:a05:6402:514e:: with SMTP id n14mr17403316edd.129.1627398559448; Tue, 27 Jul 2021 08:09:19 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?B?UGV0ZXIgU2zDrcW+aWs=?= Date: Tue, 27 Jul 2021 17:09:02 +0200 Message-ID: Subject: Re: A wrong bindkey command breaks the way bck-i-search (Ctrl+R) works To: Bart Schaefer Cc: zsh Content-Type: multipart/alternative; boundary="0000000000000b40ca05c81c41c3" X-Seq: 26814 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: --0000000000000b40ca05c81c41c3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thank you very much for all the answers. If I may have one more question - hopefully the last one on this topic. ;-) As I mentioned before, I used a similar function to take care of " and ' characters. - Pressing a " inserts two of them and places the cursor inside the pair. Pressing an ' works in a similar fashion. - Pressing a backspace inside the pair ("|" or '|', where | is the cursor) deletes both quotes - the left and the right at the same time. Now, binding the backspace breaks it for isearch. zle -N insert-single-quotes _insert_single_quotes zle -N insert-double-quotes _insert_double_quotes zle -N remove-quotes _remove_quotes bindkey "'" insert-single-quotes # " ' " bindkey '"' insert-double-quotes # ' " ' bindkey "^?" remove-quotes # backspace remove the whole pair bindkey -M isearch '^?' self-insert # This does NOT restore the original functionality. Instead of restoring the original functionality (deleting the last char), ^? is just inserted into the searched text. Best regards, Peter =D1=83=D1=82=D0=BE, 27. =D1=98=D1=83=D0=BB 2021. =D1=83 16:51 Bart Schaefer= =D1=98=D0=B5 =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BE/=D0=BB=D0=B0: > On Tue, Jul 27, 2021 at 3:31 AM Peter Sl=C3=AD=C5=BEik > wrote: > > > > bindkey -M emacs ' ' expand_abbreviations > > > > But alas, this changes the behavior of isearch, too. The documentation > is really sometimes too wordy and, in cases like this, too terse. > > I think that's because emacs =3D=3D main and isearch is initialized from > main ... so if you did that bindkey but only after isearch was > initialized, it might work. I don't know how you assure that order of > events, though. > --0000000000000b40ca05c81c41c3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thank you very much for all the answers. If I may hav= e one more question - hopefully the last one on this topic. ;-)
<= br>
As I mentioned before, I used a similar function to take care= of " and ' characters.
- Pressing a " inserts = two of them and places the cursor inside the pair. Pressing an ' works = in a similar fashion.
- Pressing a backspace inside the pair (&qu= ot;|" or '|', where | is the cursor) deletes both quotes - the= left and the right at the same time.

Now, binding= the backspace breaks it for isearch.

zle -N inser= t-single-quotes _insert_single_quotes
zle -N insert-double-quotes= _insert_double_quotes
zle -N remove-quotes _remove_quotes
bindkey "'" insert-single-quotes=C2=A0=C2=A0=C2= =A0 # " ' "
bindkey '"' insert-dou= ble-quotes=C2=A0=C2=A0=C2=A0 # ' " '
bindkey "^= ?" remove-quotes=C2=A0=C2=A0=C2=A0 # backspace remove the whole pair
bindkey -M isearch '^?' self-insert=C2=A0=C2=A0=C2=A0 # Th= is does NOT restore the original functionality.

In= stead of restoring the original functionality (deleting the last char), ^? = is just inserted into the searched text.

Best rega= rds,
Peter


=D1=83=D1=82=D0=BE, 27. = =D1=98=D1=83=D0=BB 2021. =D1=83 16:51 Bart Schaefer <schaefer@brasslantern.com> =D1=98=D0=B5 = =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BE/=D0=BB=D0=B0:
On Tue, Jul 27, 2021 at 3:31 AM Pe= ter Sl=C3=AD=C5=BEik <peter.slizik@gmail.com> wrote:
>
> bindkey -M emacs ' ' expand_abbreviations
>
> But alas, this changes the behavior of isearch, too. The documentation= is really sometimes too wordy and, in cases like this, too terse.

I think that's because emacs =3D=3D main and isearch is initialized fro= m
main ... so if you did that bindkey but only after isearch was
initialized, it might work.=C2=A0 I don't know how you assure that orde= r of
events, though.
--0000000000000b40ca05c81c41c3--