Re: [hackers] [dmenu][PATCH] Remove warning for int comparison as bool

2022-03-01 Thread Prathu Baronia

On 02-03-2022 03:18, Hiltjo Posthuma wrote:

On Fri, Feb 25, 2022 at 11:07:49AM +0530, Prathu Baronia wrote:

- Compare the result of the macro with 0 instead of treating as bool to remove
   the following warning.

dmenu.c: In function ‘setup’:
dmenu.c:24:30: warning: ‘*’ in boolean context, suggest ‘&&’ instead 
[-Wint-in-bool-context]
23 | #define INTERSECT(x,y,w,h,r)  (MAX(0, MIN((x)+(w),(r).x_org+(r).width) 
 - MAX((x),(r).x_org)) \
   |   
~
24 |  * MAX(0, 
MIN((y)+(h),(r).y_org+(r).height) - MAX((y),(r).y_org)))
   |  
^
dmenu.c:655:37: note: in expansion of macro ‘INTERSECT’
   655 | if (INTERSECT(x, y, 1, 1, info[i]))
   | ^

Signed-off-by: Prathu Baronia 
---
  dmenu.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dmenu.c b/dmenu.c
index d95e6c6..81b8567 100644
--- a/dmenu.c
+++ b/dmenu.c
@@ -652,7 +652,7 @@ setup(void)
/* no focused window is on screen, so use pointer location 
instead */
if (mon < 0 && !area && XQueryPointer(dpy, root, &dw, &dw, &x, &y, &di, 
&di, &du))
for (i = 0; i < n; i++)
-   if (INTERSECT(x, y, 1, 1, info[i]))
+   if (INTERSECT(x, y, 1, 1, info[i]) > 0)
break;
  
  		x = info[i].x_org;

--
2.35.1



Hi Prathu,

I slightly changed the patch to != 0 and pushed it, thanks!


Sure Hiltjo. Thanks for maintaining this awesome project.

Regards,

Prathu




Re: [hackers] [dmenu][PATCH] Remove warning for int comparison as bool

2022-03-01 Thread Hiltjo Posthuma
On Fri, Feb 25, 2022 at 11:07:49AM +0530, Prathu Baronia wrote:
> - Compare the result of the macro with 0 instead of treating as bool to remove
>   the following warning.
> 
> dmenu.c: In function ‘setup’:
> dmenu.c:24:30: warning: ‘*’ in boolean context, suggest ‘&&’ instead 
> [-Wint-in-bool-context]
>23 | #define INTERSECT(x,y,w,h,r)  (MAX(0, 
> MIN((x)+(w),(r).x_org+(r).width)  - MAX((x),(r).x_org)) \
>   |   
> ~
>24 |  * MAX(0, 
> MIN((y)+(h),(r).y_org+(r).height) - MAX((y),(r).y_org)))
>   |  
> ^
> dmenu.c:655:37: note: in expansion of macro ‘INTERSECT’
>   655 | if (INTERSECT(x, y, 1, 1, info[i]))
>   | ^
> 
> Signed-off-by: Prathu Baronia 
> ---
>  dmenu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/dmenu.c b/dmenu.c
> index d95e6c6..81b8567 100644
> --- a/dmenu.c
> +++ b/dmenu.c
> @@ -652,7 +652,7 @@ setup(void)
>   /* no focused window is on screen, so use pointer location 
> instead */
>   if (mon < 0 && !area && XQueryPointer(dpy, root, &dw, &dw, &x, 
> &y, &di, &di, &du))
>   for (i = 0; i < n; i++)
> - if (INTERSECT(x, y, 1, 1, info[i]))
> + if (INTERSECT(x, y, 1, 1, info[i]) > 0)
>   break;
>  
>   x = info[i].x_org;
> -- 
> 2.35.1
> 
> 

Hi Prathu,

I slightly changed the patch to != 0 and pushed it, thanks!

-- 
Kind regards,
Hiltjo



[hackers] [dmenu] remove false-positive warning for int comparison as bool || Hiltjo Posthuma

2022-03-01 Thread git
commit 3a505cebe8adab204e5619357e0bfe3f9f3a92ff
Author: Hiltjo Posthuma 
AuthorDate: Tue Mar 1 22:45:39 2022 +0100
Commit: Hiltjo Posthuma 
CommitDate: Tue Mar 1 22:45:39 2022 +0100

remove false-positive warning for int comparison as bool

Reported by Prathu Baronia , patch slightly 
changed.

Thanks!

diff --git a/dmenu.c b/dmenu.c
index d95e6c6..eca67ac 100644
--- a/dmenu.c
+++ b/dmenu.c
@@ -652,7 +652,7 @@ setup(void)
/* no focused window is on screen, so use pointer location 
instead */
if (mon < 0 && !area && XQueryPointer(dpy, root, &dw, &dw, &x, 
&y, &di, &di, &du))
for (i = 0; i < n; i++)
-   if (INTERSECT(x, y, 1, 1, info[i]))
+   if (INTERSECT(x, y, 1, 1, info[i]) != 0)
break;
 
x = info[i].x_org;



Re: [hackers] st][PATCH - proper escape sequence for CTRL+HOME

2022-03-01 Thread NRK
On Tue, Mar 01, 2022 at 01:52:07PM -0600, Dave Blanchard wrote:
> I'll see myself out, and let you get back to your daily circlejerk.

Please don't do that. It'll be a massive loss if the only civilized
person in here; whos also made some loonix distro, is also a mechanic
and an astronut and a plumber leaves! ;-;

- NRK



Re: [hackers] st][PATCH - proper escape sequence for CTRL+HOME

2022-03-01 Thread Quentin Rameau
Hi again Dave,

> > Let that be a poor lesson for everybody, to you that coming to
> > unfamiliar people with a negative attitude usually draws negative
> > attitude in response.  
> 
> Nothing was wrong with my comment. You just chose to interpret it poorly--for 
> selfish reasons.

Allright, but then there's no need to continue ranting on the list,
please just the nobler one here and go on with life.



Re: [hackers] st][PATCH - proper escape sequence for CTRL+HOME

2022-03-01 Thread Dave Blanchard
On Tue, 1 Mar 2022 11:15:45 -0800
Jeremy  wrote:

> I'm sorry

Yes, you are sorry. That's obvious. 

-- 
Dave Blanchard 



Re: [hackers] st][PATCH - proper escape sequence for CTRL+HOME

2022-03-01 Thread Dave Blanchard
On Tue, 1 Mar 2022 20:30:01 +0100
Quentin Rameau  wrote:

> Let that be a poor lesson for everybody, to you that coming to
> unfamiliar people with a negative attitude usually draws negative
> attitude in response.

Nothing was wrong with my comment. You just chose to interpret it poorly--for 
selfish reasons.

-- 
Dave Blanchard 



Re: [hackers] st][PATCH - proper escape sequence for CTRL+HOME

2022-03-01 Thread NRK
On Tue, Mar 01, 2022 at 01:21:51PM -0600, Dave Blanchard wrote:
> You could have stopped your comment here, and my response would have
> been simply 'Ah, I see; thank you.' But now, given the continuation of
> your response below, I'll have to response in kind.

There was nothing stopping you from simply replying just that and coming
out as the bigger man, and nothing that forced you to write this
embassing essay; other than your fragile ego it seems.

- NRK



Re: [hackers] st][PATCH - proper escape sequence for CTRL+HOME

2022-03-01 Thread Dave Blanchard
On Wed, 2 Mar 2022 01:26:28 +0600
NRK  wrote:

> On Tue, Mar 01, 2022 at 08:54:15AM -0500, Sebastian LaVine wrote:
> > Christ, why do you choose to be so rude to someone you've never talked
> > to over a simple email?
> 
> Similar question can be asked towards the initial mail. I'm not aware of
> any civilized culture where going into a community threatening to fork
> over comments (lol) is considered polite.

You could have just said "I'm not aware of any civilized culture", and nothing 
else, to make your response completely accurate.

Apparently in your headlong rush to being extremely offended and upset by my 
feedback, and 'threat' to fork (LOL), you overlooked the part where I said 
'unfortunately'--as in 'I don't really desire to do this, but sadly, I've come 
to believe it's necessary'--and the part where I complimented by saying it's a 
'great little program', and that I really like the 'suckless' initiative and 
what they're trying to do. Yes, what a total asshole I am to criticize you in 
any way while offering conciliatory remarks.

Sadly, at this point, given the gaggle of extremely rude assholes who have 
responded (Mr. LaVine excepted), my opinion has now changed. Clearly this is a 
group of antisocial cunts--yourself included. I'll see myself out, and let you 
get back to your daily circlejerk.

By the way, I provided similar feedback to the Squid mailing list the other 
day, and the two maintainers there, along with a couple others, went out of 
their way to address my problem--and not only accepted my feedback maturely, 
they actually *agreed* with me. Gasp! Shock! Horror! Maybe you should Google 
that, so you can learn what a 'civilized culture' actually looks like.

-- 
Dave Blanchard 



Re: [hackers] st][PATCH - proper escape sequence for CTRL+HOME

2022-03-01 Thread Dave Blanchard
On Tue, 01 Mar 2022 08:54:15 -0500
"Sebastian LaVine"  wrote:

> Christ, why do you choose to be so rude to someone you've never talked
> to over a simple email? He wants to write comments for a C program. It's
> not the end of the world. I personally will be interested in what he
> does; he isn't wrong that a lot of the main suckless code isn't well
> commented. You really think there's something wrong with "people like
> [him]" studying something he doesn't understand, and offering to share
> the results of his study with others, so that they too might have a
> better understanding? Weird. Drink some tea and calm down.

Thank you Sebastian for apparently being the only decent, well adjusted person 
in this group. There was nothing wrong with my observations, in either form or 
content. It's quite possible to maturely accept different viewpoints even while 
strongly disagreeing with them. 

In fact, as detailed in another response, I'm far from being an idiot, in the 
realm of computing or otherwise. I've created my own Linux distro starting from 
nothing at all, and expanding it to over a thousand packages, many of which are 
quite non-mainstream and have required extensive patching to make function 
smoothly. 

In the world of Linux software, I've seen it all, and every variation in 
between; good and bad build systems, great code and total dogshit. 'st' isn't 
the worst out there by any means, but nothing is perfect, and it is a fact that 
dozens of functions and variables in this code have zero comments, along with 
terse variable and function names that leave the non-expert end user scratching 
their head in confusion as to exactly what it's for or how it works.

I will indeed fork this code, which is now a necessity if for no other reason 
than to fix st's extremely poor memory storage design. 'malloc' is called for 
each individual console line any time the terminal is resized, which for a 
terminal with no scrollback functionality I guess is fine--but with the 
scrollback patch added and a large buffer allocated, this significantly slows 
down the terminal, especially on startup. The 'tresize' function is using a ton 
of CPU time, and there is about a quarter to half second delay when starting 
'st' with a scrollback history of 262,144 lines--which is completely 
unacceptable, when xterm starts *instantly* using the same setting. 

It will of course take almost a complete rewrite to accomplish this, as the 
whole terminal is built around the line buffer. That will be a good opportunity 
to add in all those comments which are so desperately needed, to properly 
document the code. My standard is 'so even a 8 year old, like the young me, 
could understand it.' 

Frankly I'm not a huge fan of the extreme minimalism aspect anyhow; it's 
probably better to configure the terminal with X resources and/or a config file 
for example, so the whole thing doesn't have to be recompiled just to change a 
config setting. Other features like a scrollbar would be nice to have. It would 
not bloat the code at all to have a few niceties added in.

If this sound interesting, I'll let you know if/when this has been 
accomplished. It might be a while, as I have a ton of other things on the todo 
list right now. (Like building an entire distro...) As for the various basement 
dwelling antisocial cunts who have responded with their angry, insecure, 
butthurt comments, they can feel free to go fuck themselves.

/UNSUBSCRIBE

-- 
Dave Blanchard 



Re: [hackers] st][PATCH - proper escape sequence for CTRL+HOME

2022-03-01 Thread Quentin Rameau
Hi Dave,

> It's not the language that's the problem, it's the piss-poor attitude.
> 
> At first, I thought his response might have been a fluke. But then after 
> reading the other extremely rude comments made in response to mine, it seems 
> this is a group of extremely toxic people who are absolutely uninterested in 
> receiving any kind of constructive criticism whatsoever.
> 
> I'll see myself out.

Let that be a poor lesson for everybody, to you that coming to
unfamiliar people with a negative attitude usually draws negative
attitude in response.
To others, that it isn't usually less constructive to just ignore such
bad attitude in the first and wait for a potential change in the
approach before answering anything.



Re: [hackers] st][PATCH - proper escape sequence for CTRL+HOME

2022-03-01 Thread NRK
On Tue, Mar 01, 2022 at 08:54:15AM -0500, Sebastian LaVine wrote:
> Christ, why do you choose to be so rude to someone you've never talked
> to over a simple email?

Similar question can be asked towards the initial mail. I'm not aware of
any civilized culture where going into a community threatening to fork
over comments (lol) is considered polite.

As far as I see, the response was well justified.

- NRK



Re: [hackers] st][PATCH - proper escape sequence for CTRL+HOME

2022-03-01 Thread Dave Blanchard
On Tue, 1 Mar 2022 11:18:41 +0100
"Roberto E. Vargas Caballero"  wrote:

>
> 'appkey' and 'appcursor' are modes in the vt100, you only have to search in 
> the
> vt100 documentation [1] for application mode and/or numeric mode. You can also
> search for the terminfo sequences rmkx and smkx in terminfo(5). 
> 

You could have stopped your comment here, and my response would have been 
simply 'Ah, I see; thank you.' But now, given the continuation of your response 
below, I'll have to response in kind.

> > On that note, regrettably it will be necessary for me to fork this project, 
> > if for no other reason than to properly comment it, so that its 
> > functionality can be understood and easily modified. It's a shame that such 
> > a nice little program is marred by its total lack of commentation, along 
> > with poorly chosen function and variable names. The use of tabs in the 
> > source code isn't particularly desirable either, IMO.
> 
> Please, fork it and leave us quiet, we don't need people like you
> that are proud of not knowing things. 

'Proud of not knowing things'? LOL.

You're speaking to the guy who built his own entire Linux distro from scratch, 
with over a thousand packages, based on LibreSSL and other non-everyday 
dependencies, and now almost fully ported over to musl-libc as well. This 
system is built using a very simple set of shell scripts with ccache and distcc 
integrated into the build process, along with other interesting, useful 
features. I use it exclusively on all my PCs. 

By the way, I'm not only good with computers; I'm an expert mechanic also, an 
expert distiller, an knowledgeable electrician, plumber, refrigeration 
technician, and am quite knowledgeable on numerous other things you likely know 
nothing about. But I'm "proud of not knowing things." Right.

I've compiled, built, and written patches for countless packages, including 
many patches to Chromium. I've seen every kind of source code under the sun, 
from great to piss poor. I'm well qualified to comment on the quality of your 
code, or *lack thereof*.

I was trying to be *nice* in my comment, but I guess that's hard to get across 
to someone who's determined to be offended.

> Appkey and Appcursor are related to the vt100 way of working, 

...Which was not at all made apparent to anyone anywhere, because THERE ARE NO 
COMMENTS EVEN HINTING AT THIS IN THE SOURCE. I shouldn't have to "just Google 
it" to learn a general idea of how YOUR SOURCE CODE works. Especially when the 
place in question where these terms were first introduced was on the 
config.def.h, a CONFIG FILE that the end user is expected to edit to suit his 
own purposes. How was I supposed to know that searching for these terms would 
even be a correct thing to do, when there is NOTHING to even hint that these 
are general VT100 terms, and not something specific to 'st' itself?

Do you expect your software to be used and configured only by people who are 
already terminal experts? Or are you foolish enough to think that "just Google 
it" is the correct answer to everything? What will you do when the Internet and 
Google is gone? You and all others who absolutely depend on it will be up shit 
creek. You will instantly lose 50 IQ points. Meanwhile I will keep computing as 
I always have--because I DOCUMENT EVERYTHING right at the place where it's 
used, instantly of lazily expecting myself or others to 'just Google it.'

> and the objective of the source code of st is not to teach you about how 
> terminals work. 

It's clear the objective of the source code of ST isn't to teach the user about 
ANYTHING; including basics like 'ok, the overall purpose of this function is 
'X', or 'this variable does Y, which you can obviously tell by its well-chosen 
name.'

> Please, the next time before going into a community with that total lack of 
> etiquette

You lecturing ME about etiquette? LOL. 

When was the last time you left your basement? Do you speak to your mother this 
way?

-- 
Dave Blanchard 



Re: [hackers] st][PATCH - proper escape sequence for CTRL+HOME

2022-03-01 Thread Jeremy
On 03/01/22 12:54PM, Dave Blanchard wrote:
> On Tue, 1 Mar 2022 07:49:21 -0800
> Jeremy  wrote:
> No, I really don't. I just made an offhand comment regarding my initial 
> impression of the code. I don't *need* to convince you of anything. After 
> reading your asshole response, I'm not interested in trying. 
> 
> I'd advise you to 'Go fuck yourself', but that's probably what you're already 
> doing every day anyway.
> 

Haha!

I'm sorry; I assumed you were trolling at first.
I should have given you the benefit of the doubt.

Jeremy



Re: [hackers] st][PATCH - proper escape sequence for CTRL+HOME

2022-03-01 Thread Dave Blanchard
On Tue, 1 Mar 2022 14:15:03 +0100
Hiltjo Posthuma  wrote:

> Hi David,

> It makes sense to me to add \033[1;5H. I'm not sure if \033[J is correct, it
> seems duplicate with XK_Home and XK_End also.  Please test it properly.

I'm not sure if it's correct either; I'm not a terminal expert. It seems to 
work well on my end so far, but then again, it could break something. I still 
need to do a lot of reading and learning on ANSI escape codes.

> Negative bikeshed comments and exagerations ("total lack of comments") don't
> help in making the project better.

I didn't exaggerate anything. There are dozens of functions which have 
absolutely no comments whatsoever, with variable and function names which are 
extremely terse. As a non-terminal expert, it's not quite clear what half of 
the these things, and no, I'm not an idiot or a 'retard' as one other person 
put it.

> I'd happily apply a general patch which improves in making the appkey and
> cursorkey sequences more consistent.

Thanks for your relatively positive reply, which is nice to see in a such a sea 
of extreme negativity.

-- 
Dave Blanchard 



Re: [hackers] st][PATCH - proper escape sequence for CTRL+HOME

2022-03-01 Thread Dave Blanchard
On Tue, 01 Mar 2022 09:13:15 -0500
"Greg Reagle"  wrote:

> Dave Blanchard, I am going to give you unsolicited advice on how to provide 
> *constructive* criticism and/or *useful* feedback:  Be specific, and give 
> examples.  Please read on for details.

What I *did* provide is constructive criticism and useful feedback, to those 
who have ears to listen. The problem is you're not interested in hearing it.

> If you were to give an example of a comment that you would like added, then 
> there is a chance that it might be accepted.  

Right, let me just go through the entire source code to deconstruct it, parsing 
out the meaning of every tersely-named variable and function name or totally 
undocumented function, so I can make a patch containing about a thousand 
comments that need to be added--then submit it here, so that y'all can pick it 
apart line by line and call me a moron. I'll get right on that.

> The only thing that your quoted statement above is going to accomplish is to 
> offend and/or to be ignored and/or to create ill will toward you.

Yes, of course; because this group is obviously, based on the responses, a 
gaggle of toxic, basement-dwelling dweebs who aren't actually interested in 
constructive criticism or feedback.

Free clue: Not everyone is a bunch of angry, closed minded dweebs as y'all 
apparently are. I just provided some similar feedback on the Squid mailing list 
the other day and it was well received, and politely so. They even agreed with 
what I was saying. Imagine that.

-- 
Dave Blanchard 



Re: [hackers] st][PATCH - proper escape sequence for CTRL+HOME

2022-03-01 Thread Dave Blanchard
On Tue, 1 Mar 2022 07:49:21 -0800
Jeremy  wrote:

> On 02/28/22 09:27PM, Dave Blanchard wrote:
> > On that note, regrettably it will be necessary for me to fork this project, 
> > if for no other reason than to properly comment it, so that its 
> > functionality can be understood and easily modified. It's a shame that such 
> > a nice little program is marred by its total lack of commentation, along 
> > with poorly chosen function and variable names. The use of tabs in the 
> > source code isn't particularly desirable either, IMO.
> 
> There's probably a good argument to be made in favor of some other
> formatting style; you just need to make it.
>
> [...]
>
> But clearly you're too retarded to make a decent critisism like that. ;)

No, I really don't. I just made an offhand comment regarding my initial 
impression of the code. I don't *need* to convince you of anything. After 
reading your asshole response, I'm not interested in trying. 

I'd advise you to 'Go fuck yourself', but that's probably what you're already 
doing every day anyway.




Re: [hackers] st][PATCH - proper escape sequence for CTRL+HOME

2022-03-01 Thread Dave Blanchard
On Tue, 1 Mar 2022 19:30:11 +0100
Hiltjo Posthuma  wrote:

> > But clearly you're too retarded to make a decent critisism like that. ;)
> > 
> 
> Please don't use language like this here.

It's not the language that's the problem, it's the piss-poor attitude.

At first, I thought his response might have been a fluke. But then after 
reading the other extremely rude comments made in response to mine, it seems 
this is a group of extremely toxic people who are absolutely uninterested in 
receiving any kind of constructive criticism whatsoever.

I'll see myself out.

-- 
Dave Blanchard 



Re: [hackers] st][PATCH - proper escape sequence for CTRL+HOME

2022-03-01 Thread Hiltjo Posthuma
On Tue, Mar 01, 2022 at 07:49:21AM -0800, Jeremy wrote:
> On 02/28/22 09:27PM, Dave Blanchard wrote:
> > On that note, regrettably it will be necessary for me to fork this project, 
> > if for no other reason than to properly comment it, so that its 
> > functionality can be understood and easily modified. It's a shame that such 
> > a nice little program is marred by its total lack of commentation, along 
> > with poorly chosen function and variable names. The use of tabs in the 
> > source code isn't particularly desirable either, IMO.
> 
> There's probably a good argument to be made in favor of some other
> formatting style; you just need to make it.
> 
> I felt similar regarding the commentation at first, but then I read
> through DVTM & found that what st was doing was self evident.
> 
> > Overall, I like the 'suckless' initiative. I'm sick of all the bloat in the 
> > Linux world. My distro is built to be light weight, simple, and fast. 'st' 
> > is proving to be a nice addition, and a good starting point for building 
> > something even better. Looking forward to integrating more of your code 
> > into my system as I spend more time exploring your different projects, and 
> > the useful patches you've provided. Thanks for your work.
> > 
> 
> If you really wanted to dab on st, you could have just
> - removed the `-l` argument
> - simplified ttywriteraw
> - suggested that st shouldn't be scheduling for modem lines
> - offer minicom as an alternative for those lead astray
> 
> But clearly you're too retarded to make a decent critisism like that. ;)
> 

Please don't use language like this here.

> Jeremy
> 

-- 
Kind regards,
Hiltjo



Re: [hackers] st][PATCH - proper escape sequence for CTRL+HOME

2022-03-01 Thread Jeremy
On 02/28/22 09:27PM, Dave Blanchard wrote:
> On that note, regrettably it will be necessary for me to fork this project, 
> if for no other reason than to properly comment it, so that its functionality 
> can be understood and easily modified. It's a shame that such a nice little 
> program is marred by its total lack of commentation, along with poorly chosen 
> function and variable names. The use of tabs in the source code isn't 
> particularly desirable either, IMO.

There's probably a good argument to be made in favor of some other
formatting style; you just need to make it.

I felt similar regarding the commentation at first, but then I read
through DVTM & found that what st was doing was self evident.

> Overall, I like the 'suckless' initiative. I'm sick of all the bloat in the 
> Linux world. My distro is built to be light weight, simple, and fast. 'st' is 
> proving to be a nice addition, and a good starting point for building 
> something even better. Looking forward to integrating more of your code into 
> my system as I spend more time exploring your different projects, and the 
> useful patches you've provided. Thanks for your work.
> 

If you really wanted to dab on st, you could have just
- removed the `-l` argument
- simplified ttywriteraw
- suggested that st shouldn't be scheduling for modem lines
- offer minicom as an alternative for those lead astray

But clearly you're too retarded to make a decent critisism like that. ;)

Jeremy



Re: [hackers] st][PATCH - proper escape sequence for CTRL+HOME

2022-03-01 Thread Roberto e. Vargas Caballero
Hi,

On Tue, Mar 01, 2022 at 08:54:15AM -0500, Sebastian LaVine wrote:
> 
> Christ, why do you choose to be so rude to someone you've never talked
> to over a simple email? He wants to write comments for a C program. It's
> not the end of the world. I personally will be interested in what he
> does; he isn't wrong that a lot of the main suckless code isn't well
> commented. You really think there's something wrong with "people like
> [him]" studying something he doesn't understand, and offering to share
> the results of his study with others, so that they too might have a
> better understanding? Weird. Drink some tea and calm down.
> 

Maybe we have different cultures, but my impression is that who was
rude was him. Sending a mail saying "you bad, I good, do what I tell you"
is VERY rude where I come from. We don't want people here with those
comments. If you want to send patches, send them otherwise just shut up.

There are a lot of ways of thinking and we don't want to force anyone
to change their way of thinking, but please don'try to do the same with us,
or at least be polite. I talked with other developers and they also were
offended.

He did a really bad comment and he mistook in his conclusions. The objective
of comments in St code is not to explain how a terminal must work, there
are plenty of documents explaining that. Do you imagine the code of the
linux kernel full of comments explaining how an operating system must work?
Do you have comments in man pages explaining what is a file descriptor
in evey man page?  You already have books for that.

If he had problems understanding something he could just ask, not
sending an arrrogant mail menacing others with the option of forking
the code. We don't want that here, if you like the code contribute,
if you don't like it contribute to do it better, but don't complain
if your patches are not accepted.

Regards,



Re: [hackers] st][PATCH - proper escape sequence for CTRL+HOME

2022-03-01 Thread Greg Reagle
Dave Blanchard, I am going to give you unsolicited advice on how to provide 
*constructive* criticism and/or *useful* feedback:  Be specific, and give 
examples.  Please read on for details.

On Mon, Feb 28, 2022, at 10:27 PM, Dave Blanchard wrote:
> It's a shame 
> that such a nice little program is marred by its total lack of 
> commentation,

If you were to give an example of a comment that you would like added, then 
there is a chance that it might be accepted.  The only thing that your quoted 
statement above is going to accomplish is to offend and/or to be ignored and/or 
to create ill will toward you.

> along with poorly chosen function and variable names.

If you were to give an example of a function/variable name and your proposed 
better name, then there is a chance that it might be accepted.  The only thing 
that your quoted statement above is going to accomplish is to offend and/or be 
ignored and/or create ill will toward you.



Re: [hackers] st][PATCH - proper escape sequence for CTRL+HOME

2022-03-01 Thread Sebastian LaVine
On Tue Mar 1, 2022 at 5:18 AM EST, Roberto E. Vargas Caballero wrote:
> > On that note, regrettably it will be necessary for me to fork this
> > project, if for no other reason than to properly comment it, so that
> > its functionality can be understood and easily modified. It's a
> > shame that such a nice little program is marred by its total lack of
> > commentation, along with poorly chosen function and variable names.
> > The use of tabs in the source code isn't particularly desirable
> > either, IMO.
>
> Please, fork it and leave us quiet, we don't need people like you
> that are proud of not knowing things. Appkey and Appcursor are related
> to the vt100 way of working, and the objective of the source code
> of st is not to teach you about how terminals work. You should learn that
> by yourself. As, you demostrated your zero capability to search for
> documentation I give you a link [2] that explains the topic. Please,
> the next time before going into a community with that total lack of
> etiquette try to search information about the topic, because you were
> requesting info for something that was not part of the structure of the
> code itself.
>

Christ, why do you choose to be so rude to someone you've never talked
to over a simple email? He wants to write comments for a C program. It's
not the end of the world. I personally will be interested in what he
does; he isn't wrong that a lot of the main suckless code isn't well
commented. You really think there's something wrong with "people like
[him]" studying something he doesn't understand, and offering to share
the results of his study with others, so that they too might have a
better understanding? Weird. Drink some tea and calm down.



Re: [hackers] st][PATCH - proper escape sequence for CTRL+HOME

2022-03-01 Thread Hiltjo Posthuma
On Mon, Feb 28, 2022 at 09:27:22PM -0600, Dave Blanchard wrote:
> Hello all,
> 

Hi David,

> This patch for 'st' causes CTRL+HOME to send the ANSI sequence \033[J and 
> \033[1;5H , which signals the user program  to scroll to the top of the 
> document, same as in Xterm. 
> 
> I have absolutely no idea what the 'appkey' and 'appcursor' fields do, as 
> there are almost no comments anywhere to be found in the source code, and I 
> haven't yet reverse engineered the code enough to figure out what the hell 
> it's actually doing with those values. The provided values seem to work fine, 
> though they may need to be changed if they're wrong.
> 

It makes sense to me to add \033[1;5H. I'm not sure if \033[J is correct, it
seems duplicate with XK_Home and XK_End also.  Please test it properly.

On a note the cursor keys in st don't seem consistent either with xterm.

> On that note, regrettably it will be necessary for me to fork this project, 
> if for no other reason than to properly comment it, so that its functionality 
> can be understood and easily modified. It's a shame that such a nice little 
> program is marred by its total lack of commentation, along with poorly chosen 
> function and variable names. The use of tabs in the source code isn't 
> particularly desirable either, IMO.
> 

Negative bikeshed comments and exagerations ("total lack of comments") don't
help in making the project better.

> Overall, I like the 'suckless' initiative. I'm sick of all the bloat in the 
> Linux world. My distro is built to be light weight, simple, and fast. 'st' is 
> proving to be a nice addition, and a good starting point for building 
> something even better. Looking forward to integrating more of your code into 
> my system as I spend more time exploring your different projects, and the 
> useful patches you've provided. Thanks for your work.
> 
> -- 
> Dave Blanchard 

I'd happily apply a general patch which improves in making the appkey and
cursorkey sequences more consistent.

Thanks,

-- 
Kind regards,
Hiltjo



Re: [hackers] st][PATCH - proper escape sequence for CTRL+HOME

2022-03-01 Thread Roberto E. Vargas Caballero
Hi,


On Mon, Feb 28, 2022 at 09:27:22PM -0600, Dave Blanchard wrote:
> 
> I have absolutely no idea what the 'appkey' and 'appcursor' fields do, as 
> there are almost no comments anywhere to be found in the source code, and I 
> haven't yet reverse engineered the code enough to figure out what the hell 
> it's actually doing with those values. The provided values seem to work fine, 
> though they may need to be changed if they're wrong.
> 

'appkey' and 'appcursor' are modes in the vt100, you only have to search in the
vt100 documentation [1] for application mode and/or numeric mode. You can also
search for the terminfo sequences rmkx and smkx in terminfo(5). 

> On that note, regrettably it will be necessary for me to fork this project, 
> if for no other reason than to properly comment it, so that its functionality 
> can be understood and easily modified. It's a shame that such a nice little 
> program is marred by its total lack of commentation, along with poorly chosen 
> function and variable names. The use of tabs in the source code isn't 
> particularly desirable either, IMO.

Please, fork it and leave us quiet, we don't need people like you
that are proud of not knowing things. Appkey and Appcursor are related
to the vt100 way of working, and the objective of the source code
of st is not to teach you about how terminals work. You should learn that
by yourself. As, you demostrated your zero capability to search for
documentation I give you a link [2] that explains the topic. Please,
the next time before going into a community with that total lack of
etiquette try to search information about the topic, because you were
requesting info for something that was not part of the structure of the
code itself.


Regards,

[1] https://vt100.net/docs/vt100-ug/
[2] https://ttssh2.osdn.jp/manual/4/en/usage/tips/appkeypad.html



[hackers] [libgrapheme] Properly handle cp == NULL in grapheme_decode_utf8() || Laslo Hunhold

2022-03-01 Thread git
commit 1930624b9a9703c3449d2a877640e33c6d71f190
Author: Laslo Hunhold 
AuthorDate: Tue Mar 1 09:27:12 2022 +0100
Commit: Laslo Hunhold 
CommitDate: Tue Mar 1 09:27:12 2022 +0100

Properly handle cp == NULL in grapheme_decode_utf8()

During refactoring I totally forgot about it. Instead of adding a
check every time we do anything, we save a lot of branching by doing
a single branch in the beginning, optionally setting cp, if NULL, to a
pointer to a local dummy variable.

Now it works as expected and documented, given my goal is that there
should be no case where a function segfaults due to a passed NULL
pointer.

Thanks a lot to Hécate (retro-freedom.nz) for reporting this!

Signed-off-by: Laslo Hunhold 

diff --git a/src/utf8.c b/src/utf8.c
index f386edf..3584c61 100644
--- a/src/utf8.c
+++ b/src/utf8.c
@@ -51,6 +51,15 @@ size_t
 grapheme_decode_utf8(const char *str, size_t len, uint_least32_t *cp)
 {
size_t off, i;
+   uint_least32_t tmp;
+
+   if (cp == NULL) {
+   /*
+* instead of checking every time if cp is NULL within
+* the decoder, simply point it at a dummy variable here.
+*/
+   cp = &tmp;
+   }
 
if (str == NULL || len == 0) {
/* a sequence must be at least 1 byte long */