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,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 2141 invoked from network); 23 Sep 2020 18:58:39 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 23 Sep 2020 18:58:39 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1600887519; b=FscKINzD7JI/S7dYtgkJC/Nx1yT4tkLnz9vNooppeYIfRcbCha8bArTQqa0+b10KKLu4fIUIEd DQ77kr3Tp0pD/K40KAj3q0mlJ6mD766OJSN9WzuIIMbIiZOHaeO4xq1e4iHHfxYADm7d6DH7Ie d6e9wjBeHnZmQM61VEg02s/SBEnXtY0bZt6zZn/Pazvo7dRRn1oC7UDwS+lQyyKLTxpm7KMVPh QYP6gi/+0hDTrwICBAxMDkSqdw+7RfznmFRtnZXmXCpHd2/09uhmriwpGwpWEKNkdwNbtgGrrj J/n7jrCpYfEUwsUZ3ZGdWOIELIykrnUgBW90rz/ZnoqX5Q==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail.cock.li) smtp.remote-ip=37.120.193.124; dkim=pass header.d=national.shitposting.agency header.s=mail header.a=rsa-sha256; dmarc=none header.from=national.shitposting.agency; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1600887519; bh=O03B4XH0IHU154DUOxESJLxF11dd8+RnVwrOzM252y4=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:DKIM-Signature:Date: DKIM-Signature; b=SQ8LojeqEbq6r2HyNASOUOV5O/wtAttsGsjx86MeH8/b9tLGj02YBLas3ug2WkQCYPoGhv4kQw JLwe0qa5Gg5XKVlkYkbqEXeNoEaOcMx3GCY1uFzLGIBw+Mx3+E3cvG02eO6mvkTL5pZicdS64m /4IJ9LeV1GWvcb9VAiXyzgC+IqCHVe70UV5m+neaBXwGpVGRokpk/Udm3teXeltWey0lBu6Fn0 EkSYp9uBsjzENjF61qfZJw2TBZ99s5hvaeDSPW3mK4uCp9VLL8FcEUEIahq1tsesO8t1qT4x0i IH7o4/ZN6jJzdHlFCCQfOBANjeL+oOQPsDWyWVpKdoqksA==; 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:In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID; bh=IxzrCSXU5B1ISFSUdcKbBSFufIWkFHSmRzn08dFmItg=; b=EFWo9yy6GGebbSx+Rc6Ixa4ide RnNVAj//aK4wEV7hB3NP2n3yDXk7WHi74s3qgd0Zrpjc0Zi63tST/0PPLMgxj4YETMJ6514LsR/es bB/FnEET1eo1x0iEK2SbaDdp24qBmlbu2y/w0FDucvd2lyINUh7OwM/CfRzkbd4Qe6+Pu9qSgbIfZ lHgzvXp9Nnn8BKE5Vk3f6UAp6kY2QeMcQQnZqwQHimAUH+p6c8HcMDS65SGPZb9AOhJSw553Ky4v2 Xl5WUGEw60YXX0tMOrChemRBeyG/OW45jiYxN41NbQZadOuY/pnvXz3RUzLz1V42kUAPVTNH32kLD 1Cnph1fw==; Received: from authenticated user by zero.zsh.org with local id 1kL9yM-000Ohr-Sd; Wed, 23 Sep 2020 18:58:34 +0000 Authentication-Results: zsh.org; iprev=pass (mail.cock.li) smtp.remote-ip=37.120.193.124; dkim=pass header.d=national.shitposting.agency header.s=mail header.a=rsa-sha256; dmarc=none header.from=national.shitposting.agency; arc=none Received: from mail.cock.li ([37.120.193.124]:41860) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1kL9Yz-000Njt-S3; Wed, 23 Sep 2020 18:32:22 +0000 Date: Wed, 23 Sep 2020 20:25:58 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=national.shitposting.agency; s=mail; t=1600885609; bh=O03B4XH0IHU154DUOxESJLxF11dd8+RnVwrOzM252y4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YBL/CyALFa9M37TXt9ILrJNS3PsoYxRXU+9HYyoaKeC7crKmzohAJSKjyxdoOP0F/ Q4q6R/1gX94ZZ4rRmICHhUaSTh9n8hV5qnf5hJZ8t8iqVXo7sxWS5/xWapFSuqJ3dn mmapNCnvG6C5z2CIvVxShTOG9cTm9eGZJdKIb//1hEEJ+L6YS8daTTaTSwEHjyBDFA HWQnB1XW0k055OnJkXj/JgS7rj2kvhRJhnbRRYkfBOjTzZID/hG1HM1wbalWvSwwsL mLYi3lwfvuGAMMFnY5oumVoQhUgS7cF7KhfSC0JgPIZAO6FhtfW+Sl095e5xjd40Ff DIkd8q/9+ALMg== From: zsugabubus To: Peter =?utf-8?B?U2zDrcW+aWs=?= Cc: zsh-users@zsh.org Subject: Re: How to avoid infinite recursion in ZLE widgets Message-ID: <20200923182558.nfokboenuhdypz45@localhost> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Validation-by: kb@spambri.de X-Seq: 26078 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: Hello, On Wed, Sep 23, 2020 at 10:34:50AM +0200, Peter Slížik wrote: > I'd like to replicate the functionality found in some text editors - namely > that if you press a single or double quote, the editor inserts two of them > and places the cursor inside the pair. What about simply modifying the buffer like this: function insert-single-quotes() { LBUFFER+="'" RBUFFER="'$RBUFFER" } > zle -N insert-single-quotes > bindkey "'" insert-single-quotes # that's "_'_" -- zsugabubus