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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31612 invoked from network); 21 Apr 2021 21:58:26 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 21 Apr 2021 21:58:26 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1619042306; b=Gjr5J/qtXPHn70XG7FbT+a8MGrvoL0MBjCkQYUbQQWw9UolJ9b+h6G0VYA/csboRV1FwmQAWAU PdTNJVGLvzmsj2G8LQM7dnRuAfirNy6+/c9oxwzmw/PhNDUldr10lcvkRBqU1uppFYrc2EhkR3 ycvU0aIJQBYob22n5TVafo5+KHX9h7bQ8Q4F+8jZwpFwbj9dQ9PlQtYBqElM225Zd6ipT8lHDv UQldhSZlvNQrCl6zAWtPSpA3aVLgzdS73Yz5AC/lqDZHNcnC3vEm7KBZEIgxkP6C278uk2rq0g ybXAVX8OwB606Fj/4PvDSAmqu60aLC8e8z4qA8T+kmtCPw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ot1-f47.google.com) smtp.remote-ip=209.85.210.47; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1619042306; bh=7bU4LMT/4LlkSZN8ZMVcJsCo1w5U6csz5Hw6ugQCPXQ=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=u9bMPOvwdYgfaiE+CI/9y3FLyWW4sKV48Bi5b/0qLlNptQA5kBShcQdIUqNHrZGQz+KzcVuQjD DxAsUiQwtEAxJR42N99av1ZQDZ6nuz9/kbAohcC4Go9XTUGWl0zoHbcnix1H9Tbkp7GjdyyuVM JNAp17ItjxrYCB3tOiqgCHf2J8bWwY5G3+nz5PrqED8KZ435UWp20ONRkRMINsAplfpdn4Yz5W NIgBDxjMWe57vZUotzT1K5VK0dW+A/GjIBIuprpyeZfpoNJIGyF/HkKUl/ScZ9LQWzqmUXtVvj i6myxTBfZcLZS/J/msQg0xZud0a9KUrbm0A3a0P+sizosA==; 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-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=SmhGdWu/zyzBsGXTV7IserRZNIHuE+QSTTrxcOBRVdE=; b=ZbpgSk5IRGUsedIDuzO24VaOCb gJvf3mGlD8ry7ojQEVIqV1+uri5LYXz6bMDyq44tpO68LwBKzbBVurj/a8d425U1iCWch8EsLa+M3 RRVDE261PUgZfAg9NFKSbFpZGv7RT6lYamI4+73ew02aqhHcs18wo0TVONl8/9DJI25qUzjFrdVBX crzibvNmdVL23KFMl74NU8VhbafeL7TM+dXTSVRTYIxfTJjlhrPkpGIxZomlxW0JpBig49JuTgtqk SS6ZH8ZOmPtjPAxLn/3zdJyn1oKMXsTupw77WipRIbLMnlRVcHan/r8JkW+CyP+o+ljLkJdWQMnhS 9Ah1Qw7w==; Received: from authenticated user by zero.zsh.org with local id 1lZKra-0004Pj-4t; Wed, 21 Apr 2021 21:58:26 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ot1-f47.google.com) smtp.remote-ip=209.85.210.47; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ot1-f47.google.com ([209.85.210.47]:40665) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1lZKrM-0004BF-Ny; Wed, 21 Apr 2021 21:58:14 +0000 Received: by mail-ot1-f47.google.com with SMTP id g4-20020a9d6b040000b029029debbbb3ecso7327677otp.7 for ; Wed, 21 Apr 2021 14:58:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=SmhGdWu/zyzBsGXTV7IserRZNIHuE+QSTTrxcOBRVdE=; b=I3hUTeRFzxX8a1+5NcaiCsOj1ZSJpQAoL2yd/uwWf0eofgdPjMMzjMSeKSBlpeH0EU DMgnm1+UWTvUz4S3AQcx+Z8QltNc+ImFRhYaB8K0Eol/lDGdAf8CvHMmNs0uTjl8weMz JhdLWoEYasQVasY5n5MbziORvVJujwX4vtK8tusIljVz6xghCXtFc56MWM7BW+ICko3t xIobV5UlqOVNBHSLtwEb6gdyyPIQD6P7J9tj15onoZZnrMzKV9pNK2XJxMJKBYG1O5Hp DD935JAqIwvPlyH/zC7kNpTu3efBEvx+bPtZEtIImC9Yqd2q72HvH+A36VRZ2tdLTT8B /RSA== 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:content-transfer-encoding; bh=SmhGdWu/zyzBsGXTV7IserRZNIHuE+QSTTrxcOBRVdE=; b=TCeg/LPoIBcR81dn1Vpn4rnwz5x+R2Bs+ikkBqaAQVLPWeq2a0lBffc1QJrOAJi7ky o2VcokFeippYZ+E0a484BdogwcF/HUiiPoBO97e5PpcaBY6IfGh6G7sTnfUuqxT0tWGV Ja1BEe3xPwlNDchR+onQ+28PgEA0/TZ3CfIJQN3KvwH5Y9DIrQFIV+nhrwnDi9a4v9rm dJPA6rk8ZrTCr+rPFXPj3uh3hx91+pVvoG+DVZBVkYUD4d73SLwXj9/4PPkQ6+g72e42 Z3h77Q50c1biVev5IceEKayTuNZ5JLeME8EhAkEhw+GK0PeGrmdLZ3p+M4c9jVokzJwe MbaA== X-Gm-Message-State: AOAM530pMe0Qo8di6lw4aLWTZoyeG2rnN0CF78X/g9tyBJIoQieJF2A0 nV9Sndt3sXxYiG6E7PNv6JGnY9zAe2rslJIqDDXeTQ== X-Google-Smtp-Source: ABdhPJywt9AqKBbjGUFeFPXzjvQQlxGIfho0WJIWZNadeBYwGK5yYPswc548cuwiex0TEyqay3+q4YbZ371ZiB7uXaI= X-Received: by 2002:a05:6830:55b:: with SMTP id l27mr231666otb.260.1619042291653; Wed, 21 Apr 2021 14:58:11 -0700 (PDT) MIME-Version: 1.0 References: <95CDA630-4EE5-4003-8D9C-CCCB9A47F109@gmail.com> <4D587C0C-EB5F-4A58-A0AE-D45E43F432CD@gmail.com> <20210421212717.GE21343@tarpaulin.shahaf.local2> In-Reply-To: <20210421212717.GE21343@tarpaulin.shahaf.local2> From: Bart Schaefer Date: Wed, 21 Apr 2021 14:58:00 -0700 Message-ID: Subject: Re: [PATCH] Add execute-command() widget function (was Re: [RFC][PATCH] Add change-directory() widget function) To: Daniel Shahaf Cc: Marlon Richert , Zsh hackers list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 48649 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On Wed, Apr 21, 2021 at 2:28 PM Daniel Shahaf wrot= e: > > [ Aside: does anyone use zyodl.vim? I see I have some local mods and > not sure how much to prioritize cleaning them up and pushing them. ] I've got an emacs yodl-mode somewhere, which is what I use when I happen to find it ... it may be lurking on a host I rarely access any more. > Again, please wrap long lines in your prose. This is the third time you > are being asked to do so. In order of (my personal) preference ... ++ send messages to the list in plain text with 78-column-or so lines (except don't line-wrap code**) ++ or send in plain text with long lines to avoid wrapping code ++ or send in HTML so lines are automatically wrapped*** ** which admittedly is something I can't currently enforce on my own mailer= . *** which I sometimes do by accident because gmail replies in HTML if the replied-to message was HTML. > As to PUSHD_MINUS and PUSHD_SILENT, it would be better to give an > example doesn't change them from their default values. Using "pushd -q ..." avoids the need for PUSHD_SILENT. Sadly there's no way to temporarily disable PUSHD_MINUS except to setopt it in the widget body. > [...] the implementation uses =C2=ABBUFFER=3D"$*"=C2=BB but > the command is passed as an array [... either] > commands should be passed as a single string, or the assignment to > BUFFER should be changed For example, =C2=ABBUFFER=3D"${(q-)*}"=C2=BB > > @@ -0,0 +1,54 @@ > > +# This function lets you implement widgets that can execute arbitrary = commands > > DRY. This information is in the manual, so it isn't needed here. There's precedent for having similar doc in function source files and also in the manual, so that someone perusing the files doesn't have to then look to see whether the function is also in the manual. > > + # Move the entire current multiline construct into the editor buff= er. This > > + # function is then aborted and we return to the top-level prompt, = which > > + # triggers the hook above. > > + zle .push-line-or-edit > > + return # Not actually necessary, but for clarity's sake > > How is it not necessary? If control flow continued past the =C2=ABesac= =C2=BB, > code would be executed. Flow can't continue past =C2=ABzle .push-line-or-edit=C2=BB because it invo= kes the equivalent of send-break and kills the widget. But I still don't understand why he wants this here. > If the user presses the bound key at the select prompt or in vared, why > should the library function disregard that? This was my suggestion, because at a select prompt the command wouldn't be "executed", it'd be fed to select as the value of the selection, which would be surprising at the least. In vared it would replace the contents of the variable with the command string and then exit vared, which is probably also not wanted. I didn't think of that case, but it's a good catch IMO. > Shouldn't this behaviour be > changed? Or failing that, documented? Documented, unless you have a suggestion for what to change it to be.