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 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 14937 invoked from network); 17 Oct 2022 09:33:05 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 17 Oct 2022 09:33:05 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1665999185; b=QvE2iEWNUWp2iRZBMHinfKB7Xa595sTbGqx+OTJshAoyZKLvhrAsywUWg4wKCXML/byEiq39Gb xt5ah04pWkPf45jYMzSG85JzsBeaYy4O4zj+C7NexmbcozBE8bYh6iypX4rMqC4rcF9XxneKCq UAXrqdCEAb9bPnCgx6z3ujhn0cKR9mdo1zL1aTRl54EJD+/reLqCLeRfir71RzfgwbQN0nNbWG 2TPmFs2kY8pu+pJRkWTxO0+uHl9IvMmhT4MHm8j1z3ZBXn1KByGqIgR+NmE18AkQ6DX5Cg0NzR B7F/CpEq1SK9/kQHFGexQMqbRmWd72kCIYAUtFCqdGr65g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-pf1-f182.google.com) smtp.remote-ip=209.85.210.182; 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=1665999185; bh=y+BysfBS/ljkqNPD5jIgJ/jBvWDdrI+XDmjGs8LNIZs=; 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=EplrcJ1oLj8brWj9JESo1+BF0FgLjkInCWIcSvMO52cZlZY89t6JRKmz54bu8X9V9idZGOH4Ac U497qGXNQkVXT8+iHIGO4wtrZtTlj4RCG/RN+5VVnlL76pZjBjJUwjUwo0FlUFbBVHhhSQGSf/ /fT9/FDEaUMZiQsYQSiQ5Ds2DjH3CmN+LWXvcjZ5wcJtrmktfiMESUezDhfMbDL1XM7wIgnzcd RLTFeBpGJfnw8mqu4eMg4sRHt0fHTUrdFS+roPoL7Jorh9sHK0eDwriRTBOtSd/C9XwJVYrX1m BO0rRLptQAyG9+yzWpXp2LNsZtMhmj4M0a6npvK50n22gQ==; 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-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=Rp8SnfT6oyJTNL6grQmPelmeCt+1Si+E4gxom1iLK9U=; b=DEFHwQppA92m742PW7apSX5jtT 9TrI6EcM0gbb/czCfvxuWr1UA7ifAOqqhHLcIVgfaq1dv5AWg3GgEmcjY/uWlEZwr66SnCEdItJi8 JlAWEnkkR2I49tvZiwS67cCGRB6Uowytqtzh8y8o7g7v9SWOwDzbTIR5kmYIGWx8QTzMCS4JGNNyo 20ZDq5qU3hNEirJio83knRIDbnEsaJuSWNmv2/kdcA6uPHGMef+A8hGXqP+vJMOyI0aDcnhrPpGhM oNe36pXKWxSxSqQZcWqJVhRzz02k80+cHK3A81uvj63pH/NfGLvAIWxDQx/CBs8AnDkqpCq3AYoxi IHQj88Iw==; Received: by zero.zsh.org with local id 1okMUa-0001ZL-I7; Mon, 17 Oct 2022 09:33:04 +0000 Authentication-Results: zsh.org; iprev=pass (mail-pf1-f182.google.com) smtp.remote-ip=209.85.210.182; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-pf1-f182.google.com ([209.85.210.182]:41633) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1okMTl-0000pM-JP; Mon, 17 Oct 2022 09:32:14 +0000 Received: by mail-pf1-f182.google.com with SMTP id g28so10544692pfk.8 for ; Mon, 17 Oct 2022 02:32:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Rp8SnfT6oyJTNL6grQmPelmeCt+1Si+E4gxom1iLK9U=; b=GFudVaBXKfIRTXgX/nSl5fQnZlBvhZm/UQGr9dW8PE2c7lZcWfk7Vj0aNLhOQjOYk2 /RjGoLAGuV767cqei2nHRtZFXbjSd8sspTDUNyAaZXdiq7j+Jm1fEFW2IO9Ogl0R+Ryz z72ZzO7CaLEfkwC5DjGrhIu9SvLmhHNvsSBpTd/5DNC74lyg3drSKkGwG2TDiC4haD/o zr8jaXh7nSO+JP5i4KONU59ROxOUpmA4upy+kboUN84So7/i9kdrz7yGT8Lu2/R7PEPq LU7XiAlhdafTuPcO5HMt+xhMAQ0DiHsUreuiOYjvY1xboCkpwfWP6cBR/Uc/VnJvdXN9 YZfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Rp8SnfT6oyJTNL6grQmPelmeCt+1Si+E4gxom1iLK9U=; b=C7ZH2uwzP6wIJy7OSowxXJP9qtjafZTkkym4PcgyHpIpf7gD9ZEXGRyp4I6kCMDlIO SC51FWlkMRIFKSnG+870Idn9EwEb7Hf7uYrvxN9sOAYjlZl8d+QzOD9Y+eGYqbvfy45+ HDF/B+nbPnPJYCyhfOO6aLCQG7NPHL01159BfBrgu3OlueqqrfTInGuE7kt68opsQ/3l Fq5JjsydFVUpvMKb11sD0k7WIIKi6mKoWb4vCDplh+lJ8SCADQkMDaSVZZNYrqISKOVI 3ZXuIekxfLLvqEVddhSeJ5Upt0FUg1i23BzmhADE0JTQseGn2E2ogSz6D7MeHDDW6Yhi H+bA== X-Gm-Message-State: ACrzQf29pjhMYKna6Xgwxp7eCxoyCmiJsZV9NW41Alo8JG64fkICOcjM H0eJKEtLRLdcVjcgrPOtbUNqg+VL7mYfum+TqAc6H06Fy4NR0A== X-Google-Smtp-Source: AMsMyM4d2pHHACQAftVqcx7j16mwle06VTc8novuCQ3ZEdhpMHksbZ7Q5XBfQbXWmrlkUwLav92nkcfAygQSfyTmv8Y= X-Received: by 2002:a65:6955:0:b0:439:a99b:bca5 with SMTP id w21-20020a656955000000b00439a99bbca5mr9953485pgq.80.1665999132103; Mon, 17 Oct 2022 02:32:12 -0700 (PDT) MIME-Version: 1.0 References: <9184bbff-9e68-7b02-2595-3474b016dfff@eastlink.ca> <4e4d53a2-226e-a0ae-a1f7-87619eaff155@eastlink.ca> <782c7588-4b07-a651-ef83-2d36a7d1d568@eastlink.ca> In-Reply-To: From: Pier Paolo Grassi Date: Mon, 17 Oct 2022 11:31:34 +0200 Message-ID: Subject: Re: line continuation with sed To: Bart Schaefer Cc: Ray Andrews , zsh-users@zsh.org Content-Type: multipart/alternative; boundary="000000000000771afc05eb37a6bd" X-Seq: 28221 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: --000000000000771afc05eb37a6bd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable When the buffer is on multiple lines there is this corner case (zsh 5.8): E \ cdcd=E2=86=A9 ie the space is on the first line but the eol marker is on the last line of the buffer, is there a POSTDISPLAY equivalent at row level? Pier Paolo Grassi Il giorno lun 17 ott 2022 alle ore 11:24 Pier Paolo Grassi < pierpaolog@gmail.com> ha scritto: > I answered myself with > > autoload -U add-zle-hook-widget > > Pier Paolo Grassi > > > Il giorno lun 17 ott 2022 alle ore 11:19 Pier Paolo Grassi < > pierpaolog@gmail.com> ha scritto: > >> add-zle-hook-widget >> zsh: command not found: add-zle-hook-widget >> >> locate add-zle-hook-widget >> /usr/local/share/zsh/5.8/functions/_add-zle-hook-widget >> /usr/local/share/zsh/5.8/functions/_add-zle-hook-widget.zwc >> /usr/local/share/zsh/5.8/functions/add-zle-hook-widget >> /usr/local/share/zsh/5.8/functions/add-zle-hook-widget.zwc >> >> echo $fpath >> /root/scripts//zsh/functions/zle/ /usr/local/share/zsh/5.8/functions/ >> >> why the command is not found? Should I do something to load the function= s >> from fpath? >> thanks >> >> Pier Paolo Grassi >> >> >> Il giorno lun 17 ott 2022 alle ore 06:22 Bart Schaefer < >> schaefer@brasslantern.com> ha scritto: >> >>> On Sun, Oct 16, 2022 at 8:40 PM Ray Andrews >>> wrote: >>> > >>> > On 2022-10-16 18:07, Bart Schaefer wrote: >>> > > You might find something like this interesting: >>> > That is really elegant. >>> >>> Actually that implementation is kind of ugly. I completely forgot >>> about this much prettier way: >>> >>> show-trailing-space() { >>> if [[ $BUFFER =3D *(' '|$' \n'*) >>> || $PREBUFFER =3D *$' \n'* ]] >>> then POSTDISPLAY=3D$'\u21a9' >>> else unset POSTDISPLAY >>> fi >>> } >>> zle -N show-trailing-space >>> add-zle-hook-widget line-pre-redraw show-trailing-space >>> add-zle-hook-widget history-line-set show-trailing-space >>> >>> --000000000000771afc05eb37a6bd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
When the buffer is on multiple lines there is this corner = case (zsh 5.8):

E \ =C2=A0
cdcd=E2=86=A9

ie the space is on the first line but the eol marker is on= the last line of the buffer, is there a POSTDISPLAY equivalent at row leve= l?

Pier Paolo Grassi
<= /div>

Il giorno lun 17 ott 2022 alle ore 11:24 Pier Paolo Gr= assi <pierpaolog@gmail.com&g= t; ha scritto:
<= div dir=3D"ltr">I answered myself with

autoload -U add-z= le-hook-widget

Pier Paolo Gras= si


Il giorno lun 17 ott 20= 22 alle ore 11:19 Pier Paolo Grassi <pierpaolog@gmail.com> ha scritto:
add-z= le-hook-widget =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
zsh:= command not found: add-zle-hook-widget

locate= add-zle-hook-widget
/usr/local/share/zsh/5.8/functions/_add-zle-hook-wi= dget
/usr/local/share/zsh/5.8/functions/_add-zle-hook-widget.zwc
/usr= /local/share/zsh/5.8/functions/add-zle-hook-widget
/usr/local/share/zsh/= 5.8/functions/add-zle-hook-widget.zwc

echo $fp= ath
/root/scripts//zsh/functions/zle/=C2=A0 /usr/local/share/zsh/5.8/functions/

why the command = is not found? Should I do something to load the functions from fpath?
=
thanks

Pier Paolo Grassi


Il giorno lun 17 ott= 2022 alle ore 06:22 Bart Schaefer <schaefer@brasslantern.com> ha scritto:
On Sun, Oct 16, 20= 22 at 8:40 PM Ray Andrews <rayandrews@eastlink.ca> wrote:
>
> On 2022-10-16 18:07, Bart Schaefer wrote:
> > You might find something like this interesting:
> That is really elegant.

Actually that implementation is kind of ugly.=C2=A0 I completely forgot
about this much prettier way:

show-trailing-space() {
=C2=A0 if [[ $BUFFER =3D *(' '|$' \n'*)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 || $PREBUFFER =3D *$' \n'* ]]
=C2=A0 then POSTDISPLAY=3D$'\u21a9'
=C2=A0 else unset POSTDISPLAY
=C2=A0 fi
}
zle -N show-trailing-space
add-zle-hook-widget line-pre-redraw show-trailing-space
add-zle-hook-widget history-line-set show-trailing-space

--000000000000771afc05eb37a6bd--