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 6882 invoked from network); 25 Sep 2020 14:20:38 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 25 Sep 2020 14:20:38 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1601043638; b=Ezsrez7dPf1M7erddGya/2sxxX2MCidtl9NS5DPptLRhtfZcUrLBbIVxDz0B1eN5M6MBkcA9L+ wcG1lmwfK0rdAlVqXzDIrvn3pF6aqkfuJTSy1+eDCAjmIilGnm2/WIHDjOiCa8RJrx3zC8Osx/ vOp7twadUtf2da13pTePGmEMcp3UYhHMTnHpnOc0Pb13kWVsxgpEo4JKi7bLNj8wiA7FT9gGI4 0E4G6df3dnZi6gMmOu0LTJnXv8319V0NzwsEDo09rMqN1ohFOUbBBi5s4k9hHvH7JKwFQy89O7 E3zwpf4tyUhk5oHUh9xsXEsiswySzEmVTODMddwrmZ+HbA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f46.google.com) smtp.remote-ip=209.85.208.46; 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=1601043638; bh=2NmS5TUrR7PHORNlCpSfGOqZ9bDit8mhzzvib63ZLz0=; 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=e+z6T44wGA7o2h+YaoabbMI2GZ6JxrKMjmA7M53JEXnMNFOIANo/u96BU8183MI2Menhieo8BG 8kR1Sv7ih9kLgbNll6A8eMxIl6WPGNNme2of/us976JCsrnAkd6SHF1jixSiZgRr4woiPr76dR uURbgDZYZCJdGqLEWCByKweK5f6/tvDN8okdz7WULtPc2tp7GIHd6ZWeUMs4Av2BSJJLwp7oFS KKyzHASu12McTOjRZAll4WuQSBzu2DwL18Jl3ZTpnVT71HWf3lK2zulf+kBWosGqnlcCdDv9Rl cPHmJqpil6Kx5Cyu70o6/fm8MMQd7yfrPyqey33ZLVmdkA==; 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=pABwrGxkyzrFd0h2KDnXUZEvWp3o6KDBdy3K5Ky7VWM=; b=JWGCelrr+UOhyR4MKcrXpfEtOk 3FcIYiKgc/Ir87wHA5WG0IqO6NYWll0b0Eo4qU4dBpdhtm0/uJnxiSkdM22SzGKeoNkCeIYKtX4vc KA7W14aU7uD6VYFtUbgQQ8ffHwey3qlpMlQR+NWrg5TJ9slt/l4ZjSDpSBsICISQHSIXUK5HYTW12 9g1RPe5VO0XNVC4l6hNag3bXfHJHvOxUFpGUrpwvW3FZ3mMsapnQNUlzefg8Zxj7DQxkLqwvEF07U rpMQ2gcUxmVpSRNmJT63Dxgvm0pk6uj6Hm52lMozeW+Gw1FCDvKMFbH6LLW2xLfZRA6krAKVPCoC+ Z16Anbow==; Received: from authenticated user by zero.zsh.org with local id 1kLoaO-0002SH-Ht; Fri, 25 Sep 2020 14:20:32 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f46.google.com) smtp.remote-ip=209.85.208.46; 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-f46.google.com ([209.85.208.46]:45724) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kLoZu-00025H-1q; Fri, 25 Sep 2020 14:20:02 +0000 Received: by mail-ed1-f46.google.com with SMTP id l17so2638201edq.12 for ; Fri, 25 Sep 2020 07:20:01 -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=pABwrGxkyzrFd0h2KDnXUZEvWp3o6KDBdy3K5Ky7VWM=; b=V73KvFPAlaszyB8oFzACUg6bG97RxFxFWAdTfOq13Uak7cT4gUwBo2zXowiU4sDwF9 LtEE8dNdSPqdwPPtMqqcMD9F2nEVNRNH6Ai+CBVthNWVIvuMYEeaXjcTi2O4uQ0zBfmP aPb7bcAmugUa6I8aurV6oOUR/Y7Uy1blhNDwjr2V5AGkGgwxY6mkyD07Sre/LcoC7y4B mcF0E1IQaTroCQKLMn3CDnBAmgtnKGWMiLSZCHsdCDgC1KUe+5rRzc2EInoHH30GAF4g q7sdRJyM+CYimAGZ2Z6XlJz2IsyH4F+vLssbKe8qlSQCUnEYAF9wUohmSx4xZEvSqLbk XQww== 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=pABwrGxkyzrFd0h2KDnXUZEvWp3o6KDBdy3K5Ky7VWM=; b=Jtel7KVUokr6JjR6gu5JjOVnfzsLJ9IPHDTxBHojYlOVzy3wnVNFzYuk4VKkGgjsWr MBsNgzdsO3nChnj51gPX/JZb0Ekxrj53DTA078VExJdyAB6JH1HJZiXUD6D4UxHNqwac ED1hyr9o6KJHDSR+aEeZaqzhWBeM7vONVlra9OlQwrWSgGPMI3zlYK9Dn760sFY48tDy 8NrUW8Zrz5n0VzaZQICIoo9cyUxjaGs0QRi7uMEh2r7BFlKxMsNO/rfDWimFRaoLpSMN Rcm8cRdQrC9+1uYyrC7JwLdcks3eC2vDQm9BMKl2Aj+8fmPStDtgbtKPRLjMDfJSnu5k jazA== X-Gm-Message-State: AOAM5306eBtb/lDVpQ83OvmSsf+NwAD4rKevlXJi8BpV25XsPos73Xmb f/Pdc7SnnUUmTDtPTBZd47L7Gstl8hWzzSna56DH5vTkWhP6WmDG X-Google-Smtp-Source: ABdhPJzzEk84Zz3XeHlhSBDx0ZfjYQ4hM0lGMl5uF4fyXZMweR5b2oWY/t6ZebccGpJ4xMfGQyH18UoAmI3YBCmf8sM= X-Received: by 2002:aa7:cd90:: with SMTP id x16mr1569440edv.302.1601043601190; Fri, 25 Sep 2020 07:20:01 -0700 (PDT) MIME-Version: 1.0 References: <20200923182558.nfokboenuhdypz45@localhost> In-Reply-To: From: =?UTF-8?B?UGV0ZXIgU2zDrcW+aWs=?= Date: Fri, 25 Sep 2020 16:19:45 +0200 Message-ID: Subject: Re: How to avoid infinite recursion in ZLE widgets To: zsugabubus Cc: zsh-users@zsh.org Content-Type: multipart/alternative; boundary="0000000000001e746d05b02403ea" X-Seq: 26084 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: Archived-At: --0000000000001e746d05b02403ea Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable By the way, the documentation says that zle -R should be called after changing the command line from within a ZLE widget. > Redisplay the command line; this is to be called from within a user-defined widget to allow changes to become visible. However, when playing with LBUFFER and RBUFFER I realized that zle -R is not needed and the changes are visible immediately. Why is it so? Peter =D1=87=D0=B5=D1=82, 24. =D1=81=D0=B5=D0=BF 2020. =D1=83 11:55 Peter Sl=C3= =AD=C5=BEik =D1=98=D0=B5 =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BE/=D0=BB=D0=B0: > >> function insert-single-quotes() { >> LBUFFER+=3D"'" >> RBUFFER=3D"'$RBUFFER" >> } >> > > Yes, this would be the best way. I wonder why I overlooked this > possibility. > Thanks a lot, > Peter > --0000000000001e746d05b02403ea Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
By the way, the documentation says that zle -R should= be called after changing the command line from within a ZLE widget.
> Redisplay the command line; this is to be called from within a user-d= efined widget to allow changes to become visible.

How= ever, when playing with LBUFFER and RBUFFER I realized that zle -R is not n= eeded and the changes are visible immediately.

Why= is it so?

Peter

=D1=87=D0=B5=D1=82, 24. = =D1=81=D0=B5=D0=BF 2020. =D1=83 11:55 Peter Sl=C3=AD=C5=BEik <peter.slizik@gmail.com> =D1=98=D0=B5= =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BE/=D0=BB=D0=B0:

function insert-single-quotes() {
=C2=A0 LBUFFER+=3D"'"
=C2=A0 RBUFFER=3D"'$RBUFFER"
}

Yes, this would be the best way. I wo= nder why I overlooked this possibility.
Thanks a lot,
Peter
--0000000000001e746d05b02403ea--