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,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 5003 invoked from network); 4 Sep 2022 10:53:44 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 4 Sep 2022 10:53:44 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1662288824; b=j1mKhDo7Mug2u04KT0p/tZBZ5G0W9p+HnqgZmkKw/Ft9jgkHZg0PgcJ2eRMFrZHPEd9JbrRdcG XJJEpfgG7p6IwFBnuyuzM4iz/eVz+D7fEh/suTZC/qZT7vNWLPkM5OBuZVVLf9uxfeTlTmH25H R4dxb8KfwsoW6ze3Jl8qzbpyxwN33VCpu1q+cs50Px+4icdnb0UXA1DywCOce8Q5SvrckPz9HR KHFWA1wdujI+rvFS9UqicBfqRS9t/3V36ATVKLef7l9TcidLQ6B8Mbl4ESUtbJu+K/B22kljWK X7UC3gxIIWbdqaRovZx2Xa7WBHHncqZo0mz4fNGctzuSDg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ot1-f43.google.com) smtp.remote-ip=209.85.210.43; dkim=pass header.d=gmail.com header.s=20210112 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-20210803; t=1662288824; bh=Z7y++OZwf0P6/k+l8xKmAaQdcCVcJL2Wh6GE/5HIBLk=; 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:References:In-Reply-To:MIME-Version:DKIM-Signature: DKIM-Signature; b=BG1i3Psne06tp8fN3OitgFf5rYNqqBA3XK950qNM6sP28dWgoKyVqGeIc6rt0BOMQnzeQt6uDq pCfeLGLipmHjcuYtfWstI77Wv4+k1LrGrDcwMEPFoV3gSGaf98cHTkUJsHNMWdhYkZU6tyt7ny 4ZayDqanHT2EiWQomToKbzGMYm2aDBhKRkku3Du6nJdDI/Ve0EwG4Elg9EhmVWYQJDiZ1oAjbZ mzJq8Rsioxm2gdrRNaZJn6r+uIyCN9ZtlflTx5Aa+JWsBENgMbjpw/NcpS4Sdh8li6pn6Lgt6f 9y3Efz45v6FFqwiijGhKleOa3oT5jH/wtFeMul4P9g9y/w==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; 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:References:In-Reply-To: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=Z7y++OZwf0P6/k+l8xKmAaQdcCVcJL2Wh6GE/5HIBLk=; b=Hks/37Q0O6l2PeoeYuLQOYkS6O 75fusl6EP+porMvB+HlxtC007WmOKyDz3bbS/CJHTts8HKRLfeLB4K2wYC2cwEd3/h7X3W8gezo0l gpBugR8LtXt/FY2wMK0Kw89cS+qZByMWDGo13/s9+Ffs28/DLZY8lk/Z1X24Xb9DRyOLJGkHXbYhg Y1puXY51E/GQSkc1+Xus4bhqo+yXjmfCpn3DljWWvvlRf8ktOQlAw6Bdmxp4SFo/hOMFwPnRsOoqJ qnNbaHuxQa8A+kN6CBqpSU8SbhclKbO5kyxaPQn+I/4IM4902iqegrhGNVdpehSGTCDYDe1hZ3K5+ 2deUuBXg==; Received: from authenticated user by zero.zsh.org with local id 1oUnG3-0001ZL-EQ; Sun, 04 Sep 2022 10:53:43 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ot1-f43.google.com) smtp.remote-ip=209.85.210.43; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-ot1-f43.google.com ([209.85.210.43]:43805) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1oUnAs-00018r-BJ; Sun, 04 Sep 2022 10:48:23 +0000 Received: by mail-ot1-f43.google.com with SMTP id 92-20020a9d0be5000000b0063946111607so4482818oth.10 for ; Sun, 04 Sep 2022 03:48:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:from:to:cc:subject:date; bh=Z7y++OZwf0P6/k+l8xKmAaQdcCVcJL2Wh6GE/5HIBLk=; b=j6PlWnD9Cymu9Jl02Vtp0aV/kJTpmx1wJx8KYaOBq6rNUAOXgwEgIS8+VEcRY90g/S ulPbbJy5OTOqz+H0jD81kOjTdeznJIQhSHlp1sX3ocrNX/VfmFuNMIn/OnjK01zvFqKO iZi1ZkwBN0wxuoGVJHr9o0xHm5jXL2flC+4vaKcqxjRwJElcRMcpI2qiJNXAVq+MuuWm ClzY1swOrqIZKOdlMOUpGIU8v3C1hCEaDWV8TVpZoM6UgAuKKMfX6xooQVfdA5lsXrfZ oZXKpoZNe9MnBvrsoFHpU9+0otiTcsRQUbvlv3zhHs/oNBQPCU7znzd5PxoKpCccaJN8 GUHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:x-gm-message-state:from:to:cc :subject:date; bh=Z7y++OZwf0P6/k+l8xKmAaQdcCVcJL2Wh6GE/5HIBLk=; b=uqISuOEJy8rUfSGp6CPjwrer9jPfxdM9pqogDSS05WhnSY7vk11162YKYUQlWNM4wZ WU5hzlEeIAnROgkPOsG2EKecANjvdQKicBLM6uZe59atjOFslAs0YDF++GF6PoDQqebA pj6dAim0dTyoLGWee0y+bOb2h2w5F09afSfLQpNlOS911KeZjn/TqcYoESrVaIYS3Kcn ERKXDQ+5v0b6R/ezaQ+MkZRVpcwpNSe6VAPSEpo+rRzjP1Rugbm0Kc0EBZazDl9BpYD3 tLsVuGcxvTAoFvzj8SWm0Ox7zHsq3ObudhsETJyBh2ToFrVvnolt6xt9FSFFezj3eG+I a2LA== X-Gm-Message-State: ACgBeo2ZFKBQzunwvsvYETiN/jqhPPs/aySrQ2VCNUo4TBDehyxkopl7 9b4z781eDJXyQ4m4CMLF9ealZpbQAWXePZd2+GZ4Xj8n X-Google-Smtp-Source: AA6agR68r6F5XyAlKvM2o8A7N3mODwWjC83QkQgR5MsIGjVcTT/xH7WhVBTUVXt1Nh6CqE82hrBZxedQ5tlTLfK+IwI= X-Received: by 2002:a05:6830:1be4:b0:636:d697:42e8 with SMTP id k4-20020a0568301be400b00636d69742e8mr17838615otb.248.1662288500954; Sun, 04 Sep 2022 03:48:20 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac9:7717:0:0:0:0:0 with HTTP; Sun, 4 Sep 2022 03:48:20 -0700 (PDT) In-Reply-To: <20220904094216.GV5920@tarpaulin.shahaf.local2> References: <20220831122842.GC992100@zira.vinc17.org> <20220901002300.GD992100@zira.vinc17.org> <20220901012122.GA1046913@zira.vinc17.org> <20220902000406.GB1046913@zira.vinc17.org> <20220902131533.GC255755@cventin.lip.ens-lyon.fr> <20220904094216.GV5920@tarpaulin.shahaf.local2> From: Mikael Magnusson Date: Sun, 4 Sep 2022 12:48:20 +0200 Message-ID: Subject: Re: ${EDITOR} with spaces (was: Re: [PATCH] initialization of main keymap) To: Daniel Shahaf Cc: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 50603 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 9/4/22, Daniel Shahaf wrote: > Vincent Lefevre wrote on Fri, Sep 02, 2022 at 15:15:33 +0200: >> On 2022-09-01 22:06:03 -0700, Bart Schaefer wrote: >> > Upon further thought ... >> > 1) It's a bit odd that if both VISUAL and EDITOR are set, and VISUAL >> > is not set to a variant of vi, but EDITOR is, then zsh prefers to use >> > the bindings corresponding to EDITOR. >> > 2) As written the patch will always give Vincent the emacs bindings >> > because strstr() starts at the beginning and finds "vinc17" before >> > ever looking beyond the rindex(). >> > >> > Perhaps we should prefer VISUAL any time it is set? >> >> Yes, the current behavior (with or without the patch) is definitely >> incorrect. For instance, https://unix.stackexchange.com/a/4861/74516 >> suggests to set VISUAL to the full-screen editor, and either leave >> EDITOR unset or set it to "vi -e" (just in case a special line mode >> would be needed in some context). So a user who would use VISUAL=3Demacs >> and EDITOR=3D"vi -e" would probably be annoyed by the current behavior. > > Is $EDITOR meant to be used in a system(3) manner, as =C2=ABsystem("${EDI= TOR} > ${(q-)filename}")=C2=BB, > or in an execve(2) manner, as =C2=ABexecl($EDITOR, $EDITOR, $filename)=C2= =BB? > (plus or minus a =C2=AB--=C2=BB guard in both cases) In practice, if you want $EDITOR to contain options to your editor, you have to make a wrapper script and put it in a path without spaces, because programs all assume different answers to your question. --=20 Mikael Magnusson