~taiite/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
3 2

[PATCH senpai] doc/senpai.5: mention the issue with \ disappearing

Details
Message ID
<20210527135359.28635-1-yyp@disroot.org>
DKIM signature
pass
Download raw message
Patch: +18 -1
Fixes #65
---
 doc/senpai.5.scd | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/doc/senpai.5.scd b/doc/senpai.5.scd
index 8b6a453..3fe8dac 100644
--- a/doc/senpai.5.scd
+++ b/doc/senpai.5.scd
@@ -53,6 +53,20 @@ Some settings are required, the others are optional.
|  SENDER
:  nickname of the sender

	Note: when passing those to *notify-send*(1), some notification daemons use
	*\* for escape sequences in the body, which causes *\* to disappear from the
	message or triggers unintended side-effects (like newlines).

	To get around this, you can double the backslash with the following snippet:

```
on-highlight: |
    escape() {
        printf "%s" "$1" | sed 's#\\#\\\\#g'
    }
    notify-send "[$BUFFER] $SENDER" "$(escape "$MESSAGE")"
```

*nick-column-width*
	The number of cell that the column for nicknames occupies in the timeline.
	By default, 16.
@@ -98,9 +112,12 @@ highlights:
	- guest
	- senpai
on-highlight: |
    escape() {
        printf "%s" "$1" | sed 's#\\#\\\\#g'
    }
    FOCUS=$(swaymsg -t get_tree | jq '..|objects|select(.focused==true)|.name' | grep senpai | wc -l)
    if [ "$HERE" -eq 0 ] || [ $FOCUS -eq 0 ]; then
        notify-send "[$BUFFER] $SENDER" "$MESSAGE"
        notify-send "[$BUFFER] $SENDER" "$(escape "$MESSAGE")"
    fi
nick-column-width: 12
```
-- 
2.31.1
Details
Message ID
<20210528100635.7c82e508@vroom.localdomain>
In-Reply-To
<20210527135359.28635-1-yyp@disroot.org> (view parent)
DKIM signature
pass
Download raw message
Thank you for looking into this!

It's weird how some escape sequences in my notification deamon are
processed, while others are not.  Good to know this, anyway.

Just some minor changes:

On Thu, 27 May 2021 16:53:59 +0300, Alexey Yerin wrote:
> Fixes #65
> ---
>  doc/senpai.5.scd | 19 ++++++++++++++++++-
>  1 file changed, 18 insertions(+), 1 deletion(-)
> 
> diff --git a/doc/senpai.5.scd b/doc/senpai.5.scd
> index 8b6a453..3fe8dac 100644
> --- a/doc/senpai.5.scd
> +++ b/doc/senpai.5.scd
> @@ -53,6 +53,20 @@ Some settings are required, the others are optional.
>  |  SENDER
>  :  nickname of the sender
>  
> +	Note: when passing those to *notify-send*(1), some notification daemons use
> +	*\* for escape sequences in the body, which causes *\* to disappear from the
> +	message or triggers unintended side-effects (like newlines).
> +
> +	To get around this, you can double the backslash with the following snippet:
> +
> +```
> +on-highlight: |
> +    escape() {
> +        printf "%s" "$1" | sed 's#\\#\\\\#g'
> +    }
> +    notify-send "[$BUFFER] $SENDER" "$(escape "$MESSAGE")"
> +```
> +

Since there is already an example of this at the bottom of the manpage,
can you remove this one?

>  *nick-column-width*
>  	The number of cell that the column for nicknames occupies in the timeline.
>  	By default, 16.
> @@ -98,9 +112,12 @@ highlights:
>  	- guest
>  	- senpai
>  on-highlight: |
> +    escape() {
> +        printf "%s" "$1" | sed 's#\\#\\\\#g'
> +    }
>      FOCUS=$(swaymsg -t get_tree | jq '..|objects|select(.focused==true)|.name' | grep senpai | wc -l)
>      if [ "$HERE" -eq 0 ] || [ $FOCUS -eq 0 ]; then
> -        notify-send "[$BUFFER] $SENDER" "$MESSAGE"
> +        notify-send "[$BUFFER] $SENDER" "$(escape "$MESSAGE")"
>      fi
>  nick-column-width: 12
>  ```
Details
Message ID
<CBOSLN138CE4.3KMSAW64IQTF@desktop>
In-Reply-To
<20210528100635.7c82e508@vroom.localdomain> (view parent)
DKIM signature
pass
Download raw message
On Fri May 28, 2021 at 11:06 AM MSK, Hubert Hirtz wrote:
> > +	Note: when passing those to *notify-send*(1), some notification daemons use
> > +	*\* for escape sequences in the body, which causes *\* to disappear from the
> > +	message or triggers unintended side-effects (like newlines).
> > +
> > +	To get around this, you can double the backslash with the following snippet:
> > +
> > +```
> > +on-highlight: |
> > +    escape() {
> > +        printf "%s" "$1" | sed 's#\\#\\\\#g'
> > +    }
> > +    notify-send "[$BUFFER] $SENDER" "$(escape "$MESSAGE")"
> > +```
> > +
>
> Since there is already an example of this at the bottom of the manpage,
> can you remove this one?

I don't think so, this serves as an example on how to double the
backslash, instead of implicitly directing users to find their own way
around.
Details
Message ID
<20210529105634.5806d5e3@vroom.localdomain>
In-Reply-To
<CBOSLN138CE4.3KMSAW64IQTF@desktop> (view parent)
DKIM signature
pass
Download raw message
On Fri, 28 May 2021 13:05:14 +0300, Alexey Yerin wrote:
> I don't think so, this serves as an example on how to double the
> backslash, instead of implicitly directing users to find their own way
> around.

Ok, I see your point. Pushed with your colors.prompt patch. Thanks!

To git.sr.ht:~taiite/senpai
   eafb0dd..6be7183  master -> master
Reply to thread Export thread (mbox)