Re: [dev] [st][patch] Allow mouse selection override using ShiftMask

2014-05-14 Thread Roberto E. Vargas Caballero
I attached the updated patch so in config.def.h forceselmod is by default set to 0, so the behaviour is exactly the same as without the patch by default. Yes, my idea is to apply it. I will wait some days in order to allow people read this thread, because maybe someone could add some

Re: [dev] [st][patch] Allow mouse selection override using ShiftMask

2014-05-13 Thread Roberto E. Vargas Caballero
One reason, it seems to me, is to confine the action to one dvtm/tmux pane when selecting a multiline region of text. st has no awareness that its window has been divided into more than one pane and therefore cannot wrap the selection at pane boundaries. Ok, makes sense. It's a bit ugly, but

Re: [dev] [st][patch] Allow mouse selection override using ShiftMask

2014-05-12 Thread Raphaël Proust
On 11 May 2014 12:34, Hiltjo Posthuma hil...@codemadness.org wrote: Hi, The attached patch allows to force override mouse selection copy using the ShiftKey, similar to xterm. For example in tmux with mode-mouse on. There was a similar idea proposed sometime ago on the mailing list[0]. And a

Re: [dev] [st][patch] Allow mouse selection override using ShiftMask

2014-05-12 Thread Hiltjo Posthuma
On Mon, May 12, 2014 at 11:44 AM, Raphaël Proust raphla...@gmail.com wrote: There was a similar idea proposed sometime ago on the mailing list[0]. Interesting, I have not seen that patch before but it looks almost identical :) And a discussion following about who's responsibility it is to

Re: [dev] [st][patch] Allow mouse selection override using ShiftMask

2014-05-12 Thread Raphaël Proust
On 12 May 2014 11:47, Hiltjo Posthuma hil...@codemadness.org wrote: On Mon, May 12, 2014 at 11:44 AM, Raphaël Proust raphla...@gmail.com wrote: Anyone has further ideas about such a feature and whether it belongs to the terminal? In st's-case I think it belongs in st, since it's an X

Re: [dev] [st][patch] Allow mouse selection override using ShiftMask

2014-05-12 Thread Hiltjo Posthuma
On Mon, May 12, 2014 at 1:07 PM, Raphaël Proust raphla...@gmail.com wrote: [...] It makes sense. Although applications might be binding Shift+Mouse for their own purpose (not expecting X to interfere with their input). I don't care too much which is chosen because I tend to not use the mouse

Re: [dev] [st][patch] Allow mouse selection override using ShiftMask

2014-05-12 Thread Hiltjo Posthuma
On Mon, May 12, 2014 at 2:19 PM, Hiltjo Posthuma The attached updated patch makes ShiftMask configurable and allows to use selmasks too (SEL_RECTANGULAR). Whoops, made a mistake, forgot to include config.def.h (forceselmod). Attached is the fixed-up patch. From

Re: [dev] [st][patch] Allow mouse selection override using ShiftMask

2014-05-12 Thread Roberto E. Vargas Caballero
Anyone has further ideas about such a feature and whether it belongs to the terminal? I don't understand here why an application should take care of this feature, and I don't know what is the point here.If someone could explain a bit more about it could be good. [1]: from dvtm(1) manpage:

Re: [dev] [st][patch] Allow mouse selection override using ShiftMask

2014-05-12 Thread Raphaël Proust
On 12 May 2014 15:41, Roberto E. Vargas Caballero k...@shike2.com wrote: [1]: from dvtm(1) manpage: Copy and Paste By default dvtm captures mouse events to provide the actions listed below. Unfortunately this Why these actions should be provided by dvtm? X server

Re: [dev] [st][patch] Allow mouse selection override using ShiftMask

2014-05-12 Thread Raphaël Proust
On 12 May 2014 15:41, Roberto E. Vargas Caballero k...@shike2.com wrote: [1]: from dvtm(1) manpage: Copy and Paste By default dvtm captures mouse events to provide the actions listed below. Unfortunately this Why these actions should be provided by dvtm? X server

Re: [dev] [st][patch] Allow mouse selection override using ShiftMask

2014-05-12 Thread Charlie Kester
On Mon 12 May 2014 at 07:41:49 PDT Roberto E. Vargas Caballero wrote: [1]: from dvtm(1) manpage: Copy and Paste By default dvtm captures mouse events to provide the actions listed below. Unfortunately this Why these actions should be provided by dvtm? X server supplies

[dev] [st][patch] Allow mouse selection override using ShiftMask

2014-05-11 Thread Hiltjo Posthuma
Hi, The attached patch allows to force override mouse selection copy using the ShiftKey, similar to xterm. For example in tmux with mode-mouse on. Patch applies cleanly against the latest (as of now) git commit bdb850a16a6d7a2d12b2bd5500a3b7d70290a74a Patch also downloadable at:

Re: [dev] [st][patch] Allow mouse selection override using ShiftMask

2014-05-11 Thread FRIGN
On Sun, 11 May 2014 13:34:11 +0200 Hiltjo Posthuma hil...@codemadness.org wrote: The attached patch allows to force override mouse selection copy using the ShiftKey, similar to xterm. For example in tmux with mode-mouse on. Nice idea! It sure will be useful to have a way to override this and

Re: [dev] [st] [PATCH] Clear the full screen on reverse terminal mode change.

2014-05-09 Thread Roberto E. Vargas Caballero
(introduction of term.dirty) which, on change of reverse mode (DECSCNM), caused only dirty lines to be redrawn with the new mode instead of the whole screen. Maybe could be better idea revert 0dbf9c, because I think this problem affects all the calls to redraw: void expose(XEvent *ev) {

[dev] [st] [PATCH] End a sequence only on CAN, SUB, \a and C1s.

2014-05-09 Thread Colona
--- st.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/st.c b/st.c index fe44608..da5e493 100644 --- a/st.c +++ b/st.c @@ -2335,19 +2335,19 @@ tcontrolcode(uchar ascii) { switch(ascii) { case '\t': /* HT */ tputtab(1); -

Re: [dev] [st] [PATCH] Clear the full screen on reverse terminal mode change.

2014-05-09 Thread Colona
On Fri, May 09, 2014 at 08:54:52AM +0200, Roberto E. Vargas Caballero wrote: (introduction of term.dirty) which, on change of reverse mode (DECSCNM), caused only dirty lines to be redrawn with the new mode instead of the whole screen. Maybe could be better idea revert 0dbf9c, because I

Re: [dev] [st] [PATCH] Clear the full screen on reverse terminal mode change.

2014-05-09 Thread Christoph Lohmann
Greetings. On Fri, 09 May 2014 17:10:43 +0200 Roberto E. Vargas Caballero k...@shike2.com wrote: (introduction of term.dirty) which, on change of reverse mode (DECSCNM), caused only dirty lines to be redrawn with the new mode instead of the whole screen. [...] Christoph (you are the

[dev] [st] [PATCH] Clear the full screen on reverse terminal mode change.

2014-05-08 Thread Colona
Fix a bug introduced by 0dbf9c8c12a5de35d1cef22349ab80e8f0a8f10e (introduction of term.dirty) which, on change of reverse mode (DECSCNM), caused only dirty lines to be redrawn with the new mode instead of the whole screen. A good test-case is `echo foobar; tput flash`. --- st.c | 4 +++- 1 file

[dev] [st] [PATCH] Also clears ESC_START on interrupt characters during sequences.

2014-05-07 Thread Colona
Otherwise, the rest of the input is interpreted as a new escape sequence. For the ESC character, ESC_START is re-set in tcontrolcode. --- st.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/st.c b/st.c index fe44608..baab589 100644 --- a/st.c +++ b/st.c @@ -2446,7 +2446,7 @@

[dev] [st] [PATCH] Set ESC_STR_END on a '\' character in a DCS.

2014-05-07 Thread Colona
The strhandle() in the case '\\' below (line 2565) couldn’t be reached. --- st.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/st.c b/st.c index baab589..13c2b01 100644 --- a/st.c +++ b/st.c @@ -2448,6 +2448,9 @@ tputc(char *c, int len) { ISCONTROLC1(unicodep))) {

Re: [dev] [st] [PATCH] Also clears ESC_START on interrupt characters during sequences.

2014-05-07 Thread Roberto E. Vargas Caballero
Otherwise, the rest of the input is interpreted as a new escape sequence. For the ESC character, ESC_START is re-set in tcontrolcode. Good catch, I'll apply it (and sorry for this error ;)). Regards, -- Roberto E. Vargas Caballero

Re: [dev] [st] [PATCH] Set ESC_STR_END on a '\' character in a DCS.

2014-05-07 Thread Roberto E. Vargas Caballero
The strhandle() in the case '\\' below (line 2565) couldn’t be reached. I think this patch is incorrect, because '\\' doesn't end a string command. ESC \ ends it. Let me know if I am wrong. -- Roberto E. Vargas Caballero

Re: [dev] [st] [PATCH] Set ESC_STR_END on a '\' character in a DCS.

2014-05-07 Thread Colona
On Wed, May 07, 2014 at 10:21:26AM +0200, Roberto E. Vargas Caballero wrote: The strhandle() in the case '\\' below (line 2565) couldn’t be reached. I think this patch is incorrect, because '\\' doesn't end a string command. ESC \ ends it. Let me know if I am wrong. Yeah, you’re right, I

Re: [dev] [st][PATCH v3] Cancel DCS with SUB, CAN, ESC or any CC1 code

2014-05-07 Thread Colona
Hi, On Sun, Apr 27, 2014 at 11:37:42AM +0200, Roberto E. Vargas Caballero wrote: From http://www.vt100.net/docs/vt510-rm/chapter4: *The VT510 ignores all following characters until it receives a SUB, ST, or any other C1 control character. So OSC, PM and APC sequence ends with

Re: [dev] [st][PATCH v3] Cancel DCS with SUB, CAN, ESC or any CC1 code

2014-05-07 Thread Roberto E. Vargas Caballero
+ term.esc = ~(ESC_STR_END|ESC_STR); Shouldn’t these flags be cleared only on SUB, CAN, ST, C1s and \a ? You are right. There are some 'break' that should be a return. Regards, -- Roberto E. Vargas Caballero

Re: [dev] [st PATCH] Simplify tdeftran.

2014-05-02 Thread Roberto E. Vargas Caballero
Idea behind tdeftran is allowing to users create new charsets if they want, and it is the reason why it is built as a data driven function. I don't think is a good idea implement a lookup table using a switch statement, but it is true that it can be written better. What do you think about this

Re: [dev] [st] [PATCH] Fix techo handling of control and multibyte characters.

2014-05-02 Thread Markus Wichmann
On Fri, Apr 25, 2014 at 04:42:09PM +0200, Roberto E. Vargas Caballero wrote: The problem is Wall change from one system to another (this is something OpenBSD users know with strcpy calls...), and it doesn't force how to remove the warning, so at the end I think style is not really improved

Re: [dev] [st patch queue 05/12] Consistent FALLTHROUGH comments.

2014-04-30 Thread noname
On Fri, Apr 25, 2014 at 06:21:10PM +0200, Roberto E. Vargas Caballero wrote: It is true that it is ugly to have different styles in fall through, but it is also true that we have a lot of fall through where we don't put any comment. Put a comment in all these places is a very bad idea, but I

Re: [dev] [st PATCH] Do not save cursor in tresize.

2014-04-29 Thread Roberto E. Vargas Caballero
Applied, thanks -- Roberto E. Vargas Caballero

Re: [dev] [st] [PATCH] Simplify selected().

2014-04-29 Thread Roberto E. Vargas Caballero
If you select rectangle, then y should be between first and last line and x should between first and last column. As nobody, except you, have answer, I have applied the patch. -- Roberto E. Vargas Caballero

[dev] [st][PATCH 4/4] Simplify expressions in tputc()

2014-04-28 Thread Roberto E. Vargas Caballero
--- st.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/st.c b/st.c index 339d8a9..470a34e 100644 --- a/st.c +++ b/st.c @@ -2450,6 +2450,7 @@ tputc(char *c, int len) { bool control; long unicodep; int width; + Glyph *gp;

Re: [dev] [st PATCH 2/6] Use MODBIT in xseturgency.

2014-04-28 Thread Roberto E. Vargas Caballero
I'll apply it, thanks. -- Roberto E. Vargas Caballero

Re: [dev] [st PATCH 3/6] Add missing function prototypes.

2014-04-28 Thread Roberto E. Vargas Caballero
I'll apply it, thanks. -- Roberto E. Vargas Caballero

Re: [dev] [st PATCH 6/6] Remove one indentation level in getsel().

2014-04-28 Thread Roberto E. Vargas Caballero
I'll apply it, thanks. -- Roberto E. Vargas Caballero

Re: [dev] [st PATCH] tresize return value is not used

2014-04-28 Thread Roberto E. Vargas Caballero
I think instead of removing the return value, we should check the value returned, and in case of not being possible the resize command then print a warning in stderr. Regards, -- Roberto E. Vargas Caballero

Re: [dev] [st PATCH] Simplify tputtab.

2014-04-28 Thread Roberto E. Vargas Caballero
- for(++x; x term.col !term.tabs[x]; ++x) + while(++x term.col !term.tabs[x]) ... - for(--x; x 0 !term.tabs[x]; --x) + while(--x 0 !term.tabs[x]) I'm sorry, but this patch is incorrect, because it is

Re: [dev] [st] [PATCH] Fix techo handling of control and multibyte characters.

2014-04-28 Thread Roberto E. Vargas Caballero
The problem is Wall change from one system to another (this is something OpenBSD users know with strcpy calls...), and it doesn't force how to remove the warning, so at the end I think style is not really improved with Wall (and guys, some of the warning are really, really stupid). There

Re: [dev] [st PATCH] Simplify xunloadfonts.

2014-04-28 Thread Roberto E. Vargas Caballero
+ while(frclen 0) + XftFontClose(xw.dpy, frc[--frclen].font); I'll apply the patch. -- Roberto E. Vargas Caballero

Re: [dev] [st] [PATCH] Simplify selected().

2014-04-28 Thread noname
On Mon, Apr 28, 2014 at 06:58:29PM +0200, Roberto E. Vargas Caballero wrote: Uhmmm, I am not sure about this patch, because it is related to some parts of st that are not handled by me, and I am not sure if these modifications are correct. Could someone else take care of this patch? Regards,

Re: [dev] [st PATCH] Simplify tputtab.

2014-04-28 Thread noname
On Mon, Apr 28, 2014 at 10:54:21AM +0200, Roberto E. Vargas Caballero wrote: - for(++x; x term.col !term.tabs[x]; ++x) + while(++x term.col !term.tabs[x]) ... - for(--x; x 0 !term.tabs[x]; --x) + while(--x 0

Re: [dev] [st PATCH] Simplify tputtab.

2014-04-28 Thread koneu
Roberto E. Vargas Caballero wrote: But I feel that the patch is a bit confusing. I use sometime this kind of expressions (for example (!(p = f()) || p != q), and I get confussed here, so maybe it is not a good idea. If another suckless developers think the patch should be applied then I will

[dev] [st PATCH] Do not save cursor in tresize.

2014-04-28 Thread noname
This patch fixes the bug introduced in 8f11e1cd034ff28ca47bb4955505db7fa8016ba8 To reproduce the bug: 1. Save cursor: printf '\e[s' 2. Load cursor: printf '\e[u' 3. Resize st window. 4. Load cursor again: printf '\e[u' --- st.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git

[dev] [st][PATCH v3] Cancel DCS with SUB, CAN, ESC or any CC1 code

2014-04-27 Thread Roberto E. Vargas Caballero
From http://www.vt100.net/docs/vt510-rm/chapter4: *The VT510 ignores all following characters until it receives a SUB, ST, or any other C1 control character. So OSC, PM and APC sequence ends with a SUB (it cancels the sequence and show a question mark as error), ST or any

[dev] [st] [PATCH] Simplify selected().

2014-04-27 Thread noname
--- st.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/st.c b/st.c index 237ce8e..bd0d3ca 100644 --- a/st.c +++ b/st.c @@ -665,18 +665,13 @@ selsort(void) { static inline bool selected(int x, int y) { - if(sel.ne.y == y sel.nb.y == y) -

[dev] [st PATCH 1/6] Compute ena_sel as one expression.

2014-04-27 Thread noname
--- st.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/st.c b/st.c index bd0d3ca..41a3e3c 100644 --- a/st.c +++ b/st.c @@ -3441,12 +3441,9 @@ drawregion(int x1, int y1, int x2, int y2) { int ic, ib, x, y, ox, sl; Glyph base, new; char

[dev] [st PATCH 2/6] Use MODBIT in xseturgency.

2014-04-27 Thread noname
--- st.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/st.c b/st.c index 41a3e3c..afede52 100644 --- a/st.c +++ b/st.c @@ -3520,7 +3520,7 @@ void xseturgency(int add) { XWMHints *h = XGetWMHints(xw.dpy, xw.win); - h-flags = add ? (h-flags | XUrgencyHint) :

[dev] [st PATCH 5/6] Remove unused dump() function.

2014-04-27 Thread noname
--- st.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/st.c b/st.c index 6abda84..aa804eb 100644 --- a/st.c +++ b/st.c @@ -394,7 +394,6 @@ static int32_t tdefcolor(int *, int *, int); static void tselcs(void); static void tdeftran(char); static inline bool match(uint, uint);

[dev] [st PATCH 3/6] Add missing function prototypes.

2014-04-27 Thread noname
--- st.c | 5 + 1 file changed, 5 insertions(+) diff --git a/st.c b/st.c index afede52..6abda84 100644 --- a/st.c +++ b/st.c @@ -394,6 +394,7 @@ static int32_t tdefcolor(int *, int *, int); static void tselcs(void); static void tdeftran(char); static inline bool match(uint, uint); +static

[dev] [st PATCH 4/6] Do not export chscale and cwscale.

2014-04-27 Thread noname
--- config.def.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.def.h b/config.def.h index d69c9ba..646a88a 100644 --- a/config.def.h +++ b/config.def.h @@ -10,8 +10,8 @@ static int borderpx = 2; static char shell[] = /bin/sh; /* Kerning / character

[dev] [st PATCH 6/6] Remove one indentation level in getsel().

2014-04-27 Thread noname
--- st.c | 91 ++-- 1 file changed, 45 insertions(+), 46 deletions(-) diff --git a/st.c b/st.c index aa804eb..2750bfa 100644 --- a/st.c +++ b/st.c @@ -912,60 +912,59 @@ getsel(void) { int x, y, bufsize, size, i, ex;

[dev] [st PATCH] Simplify tputtab.

2014-04-27 Thread noname
--- st.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/st.c b/st.c index 2750bfa..689dce0 100644 --- a/st.c +++ b/st.c @@ -2267,11 +2267,11 @@ tputtab(int n) { if(n 0) { while(x term.col n--) - for(++x; x term.col

Re: [dev] [st PATCH 3/6] Add missing function prototypes.

2014-04-27 Thread Markus Teich
noname wrote: +static void dump(char c); Heyho, Wasn't this the function, which is never used? --Markus

Re: [dev] [st PATCH 3/6] Add missing function prototypes.

2014-04-27 Thread noname
On Sun, Apr 27, 2014 at 06:32:36PM +0200, Markus Teich wrote: noname wrote: +static void dump(char c); Heyho, Wasn't this the function, which is never used? --Markus It is. After I made it static, gcc gives a warning about it, so I removed it later in the same patchset.

[dev] [st PATCH] tresize return value is not used

2014-04-27 Thread noname
--- st.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/st.c b/st.c index b8fec4c..25da193 100644 --- a/st.c +++ b/st.c @@ -378,7 +378,7 @@ static void tnewline(int); static void tputtab(int); static void tputc(char *, int); static void treset(void); -static int

[dev] [st PATCH] Use tfulldirt instead of setting all lines dirty in tresize.

2014-04-27 Thread noname
--- st.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/st.c b/st.c index 25da193..57cc4c4 100644 --- a/st.c +++ b/st.c @@ -2621,14 +2621,12 @@ tresize(int col, int row) { /* resize each row to new width, zero-pad if needed */ for(i = 0; i minrow; i++) {

Re: [dev] [st PATCH] Use tfulldirt instead of setting all lines dirty in tresize.

2014-04-27 Thread noname
In fact tfulldirt should be removed completely, as tswapscreen calls tfulldirt later (twice).

[dev] [st PATCH] Simplify xunloadfonts.

2014-04-27 Thread noname
--- st.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/st.c b/st.c index 57cc4c4..087d2c9 100644 --- a/st.c +++ b/st.c @@ -2940,13 +2940,9 @@ xunloadfont(Font *f) { void xunloadfonts(void) { - int i; - /* Free the loaded fonts in the font cache. */

[dev] [st][PATCH] Cancel DCS with SUB, CAN, ESC or any CC1 code

2014-04-26 Thread Roberto E. Vargas Caballero
From http://www.vt100.net/docs/vt510-rm/chapter4: *The VT510 ignores all following characters until it receives a SUB, ST, or any other C1 control character. So OSC, PM and APC sequence ends with a SUB (it cancels the sequence and show a question mark as error), ST or any

[dev] [st][PATCH v2] Cancel DCS with SUB, CAN, ESC or any CC1 code

2014-04-26 Thread Roberto E. Vargas Caballero
From http://www.vt100.net/docs/vt510-rm/chapter4: *The VT510 ignores all following characters until it receives a SUB, ST, or any other C1 control character. So OSC, PM and APC sequence ends with a SUB (it cancels the sequence and show a question mark as error), ST or any

Re: [dev] [st] [PATCH] Fix techo handling of control and multibyte characters.

2014-04-25 Thread noname
On Thu, Apr 24, 2014 at 07:29:35AM +0200, Roberto E. Vargas Caballero wrote: Hello, u suffix was here for a purpose. The patch has comment about multibyte characters. As 0x20u is unsigned, c was converted to unsigned char before comparison so multibyte characters were not considered

[dev] [st patch queue 01/12] Simplify tsetscroll.

2014-04-25 Thread noname
--- st.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/st.c b/st.c index 60243a7..816caf7 100644 --- a/st.c +++ b/st.c @@ -1762,17 +1762,10 @@ tsetattr(int *attr, int l) { void tsetscroll(int t, int b) { - int temp; - LIMIT(t, 0, term.row-1);

[dev] [st patch queue 02/12] Use BETWEEN macro in xsetcolorname and fix style.

2014-04-25 Thread noname
--- st.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/st.c b/st.c index 816caf7..35bbe9c 100644 --- a/st.c +++ b/st.c @@ -2746,10 +2746,10 @@ int xsetcolorname(int x, const char *name) { XRenderColor color = { .alpha = 0x }; Colour colour; -

[dev] [st patch queue 03/12] Use != instead of ^ for logical values.

2014-04-25 Thread noname
sel.alt is only changed by sel.alt = IS_SET(MODE_ALTSCREEN); --- st.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/st.c b/st.c index 35bbe9c..083d1c1 100644 --- a/st.c +++ b/st.c @@ -3445,7 +3445,7 @@ drawregion(int x1, int y1, int x2, int y2) { bool ena_sel

[dev] [st patch queue 04/12] Comment fix.

2014-04-25 Thread noname
--- st.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/st.c b/st.c index 083d1c1..fd342aa 100644 --- a/st.c +++ b/st.c @@ -990,7 +990,7 @@ selnotify(XEvent *e) { } /* -* As seen in selcopy: +* As seen in

[dev] [st patch queue 07/12] Remove unnecessary break;s

2014-04-25 Thread noname
--- st.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/st.c b/st.c index 9de7f81..061dafd 100644 --- a/st.c +++ b/st.c @@ -1778,7 +1778,6 @@ tsetmode(bool priv, bool set, int *args, int narg) { for(lim = args + narg; args lim; ++args) { if(priv) {

[dev] [st patch queue 05/12] Consistent FALLTHROUGH comments.

2014-04-25 Thread noname
--- st.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/st.c b/st.c index fd342aa..dae23c5 100644 --- a/st.c +++ b/st.c @@ -1839,7 +1839,7 @@ tsetmode(bool priv, bool set, int *args, int narg) { if (!allowaltscreen)

[dev] [st patch queue 06/12] Avoid integer overflow in dump().

2014-04-25 Thread noname
--- st.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/st.c b/st.c index dae23c5..9de7f81 100644 --- a/st.c +++ b/st.c @@ -1234,8 +1234,10 @@ dump(char c) { static int col; fprintf(stderr, %02x '%c' , c, isprint(c)?c:'.'); - if(++col % 10 == 0) +

[dev] [st patch queue 12/12] Do not eat ESC character if control string is not properly terminated.

2014-04-25 Thread noname
Currently tputc handles the case of too long control string waiting for the end of control string. Another case is when there is ESC character is encountered but is not followed by '\\'. In this case st stops processing control string, but ESC character is ignored. After this patch st processes

[dev] [st patch queue 10/12] s/DSC/DCS/ DCS stands for DEVICE CONTROL STRING

2014-04-25 Thread noname
--- st.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/st.c b/st.c index 5477c81..22ce4fb 100644 --- a/st.c +++ b/st.c @@ -149,7 +149,7 @@ enum charset { enum escape_state { ESC_START = 1, ESC_CSI= 2, - ESC_STR= 4, /* DSC,

[dev] [st patch queue 09/12] Simplify tdeletechar and tinsertblank and fix memory corruption.

2014-04-25 Thread noname
Removed special handling of corner case. Current CSI parsing code uses strtol to parse arguments and allows them to be negative. Negative argument is not properly handled in tdeletechar and tinsertblank and results in memory corruption in memmove. Reproduce with printf '\e[-500@' --- st.c | 26

Re: [dev] [st] [PATCH] Fix techo handling of control and multibyte characters.

2014-04-25 Thread Roberto E. Vargas Caballero
Hi, We use ‐Wall to show all warnings. If the compiler complains, fix the warning. Easy. At least this keeps the code to a certain style. St was The problem is Wall change from one system to another (this is something OpenBSD users know with strcpy calls...), and it doesn't force how to

Re: [dev] [st] [PATCH] Fix techo handling of control and multibyte characters.

2014-04-25 Thread Christoph Lohmann
Greetings. On Fri, 25 Apr 2014 16:51:15 +0200 Roberto E. Vargas Caballero k...@shike2.com wrote: Hi, We use ‐Wall to show all warnings. If the compiler complains, fix the warning. Easy. At least this keeps the code to a certain style. St was The problem is Wall change from one

Re: [dev] [st] [PATCH] Fix techo handling of control and multibyte characters.

2014-04-25 Thread Roberto E. Vargas Caballero
We can modify it as follows: if(BETWEEN(c, 0x00, 0x1f) || c == 0x7f) { /* control code */ I like this solution because make explicit what we want to do. With the u suffix is a bit obscure and can generate some errors. I also thought about using incntrl(). It should work the same way

Re: [dev] [st PATCH 1/4] Simplify tsetscroll.

2014-04-25 Thread Roberto E. Vargas Caballero
Applied, thanks! -- Roberto E. Vargas Caballero

[dev] [st][PATCH] Simplify a bit more tdeletechar and tinsertblank

2014-04-25 Thread Roberto E. Vargas Caballero
The large and repeated expression used in memmove to indirect the line can be simplified using a pointer, that makes more clear where begins and where ends the movement. --- st.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/st.c b/st.c index 263abaa..e468d73

Re: [dev] [st PATCH 2/4] Use BETWEEN macro in xsetcolorname and fix style.

2014-04-25 Thread Roberto E. Vargas Caballero
Hi, It makes sense with the rest of the code, so I'll apply it. Regards, -- Roberto E. Vargas Caballero

Re: [dev] [st PATCH 3/4] Use != instead of ^ for logical values.

2014-04-25 Thread Roberto E. Vargas Caballero
- if(sel.alt ^ IS_SET(MODE_ALTSCREEN)) + if(sel.alt != IS_SET(MODE_ALTSCREEN)) This bit logical operation comes from another age when IS_SET had not a comparision operator. It does not make sense anymore, so this change is good. Regards, -- Roberto E. Vargas Caballero

Re: [dev] [st PATCH 4/4] Optimize tputtab.

2014-04-25 Thread Roberto E. Vargas Caballero
Before this patch executing printf '\e[100I' or printf '\e[100Z' resulted in long delay. I don't mind this delay, because it is a uncommon case, but code feels better with this patch (the while in the switch was a bit ugly), so I will apply it to. Regards, --

Re: [dev] [st] [PATCH] On terminal resize, clear the alt screen with its own cursor.

2014-04-25 Thread Roberto E. Vargas Caballero
Currently the alternate screen get messed up on resize if it has different colors or mode. Good catch, I'll apply it. Regards, -- Roberto E. Vargas Caballero

Re: [dev] [st patch queue 01/12] Simplify tsetscroll.

2014-04-25 Thread Roberto E. Vargas Caballero
This patch is duplicated. I usually wait some days before of applying a patch, so if someone has something to say he can do it. If you see that in a longer time there is no reply for your patch, please send a ping. Due to the repetion I have to verify that the patches are identical and they are

Re: [dev] [st patch queue 04/12] Comment fix.

2014-04-25 Thread Roberto E. Vargas Caballero
- * As seen in selcopy: + * As seen in getsel: Good catch, I'll apply it. Regards, -- Roberto E. Vargas Caballero

Re: [dev] [st patch queue 06/12] Avoid integer overflow in dump().

2014-04-25 Thread Roberto E. Vargas Caballero
@@ -1234,8 +1234,10 @@ dump(char c) { static int col; fprintf(stderr, %02x '%c' , c, isprint(c)?c:'.'); - if(++col % 10 == 0) + if(++col == 10) { fprintf(stderr, \n); + col = 0; + } } dump is not used in any place. It is dead code,

Re: [dev] [st patch queue 07/12] Remove unnecessary break;s

2014-04-25 Thread Markus Teich
noname wrote: @@ -1897,7 +1896,6 @@ tsetmode(bool priv, bool set, int *args, int narg) { fprintf(stderr, erresc: unknown set/reset mode %d\n, *args); - break;

Re: [dev] [st patch queue 05/12] Consistent FALLTHROUGH comments.

2014-04-25 Thread Roberto E. Vargas Caballero
It is true that it is ugly to have different styles in fall through, but it is also true that we have a lot of fall through where we don't put any comment. Put a comment in all these places is a very bad idea, but I think maybe there are more places where we should put a comment. I agree with you

Re: [dev] [st patch queue 07/12] Remove unnecessary break;s

2014-04-25 Thread Roberto E. Vargas Caballero
although a break statement in the last case is unnecessary, I think it should be left there. If someone appends a new case, he could forget to break this one and get an unwanted fallthrough. The style in st.c is not consistent, there are multiple places without the break in the last case

Re: [dev] [st patch queue 10/12] s/DSC/DCS/ DCS stands for DEVICE CONTROL STRING

2014-04-25 Thread Roberto E. Vargas Caballero
- case 'P': /* DSC -- Device Control String */ + case 'P': /* DCS -- Device Control String */ I begin to think that you have a very good eyes, because we didn't realise this stupid typo. Thanks!!! -- Roberto E. Vargas Caballero

Re: [dev] [st patch queue 11/12] Fix for multibyte characters in techo.

2014-04-25 Thread Roberto E. Vargas Caballero
Applied to, thanks!!! -- Roberto E. Vargas Caballero

[dev] [st PATCH] X geometry changes

2014-04-25 Thread suckless
From: Yuri Karaban suckl...@dev97.com Hello, Currently st does not follow X geometry specification. Implementation is incomplete and partially broken: - There is calculation of offset parameters, but these parameters are never saved in window manager hints. Therefore setting offsets has no

[dev] [st PATCH] Honor X geometry specifications

2014-04-25 Thread suckless
From: Yuri Karaban suckl...@dev97.com - Interpret width and height as rows and columns (common behavior for X applications with resize increment hints set) - Obey the offset parameters --- st.c | 98 ++-- 1 file changed, 38

Re: [dev] [st PATCH] X geometry changes

2014-04-25 Thread Amadeus Folego
I don't usually have problems with the geometry specified by rows and columns, it would be nice if we could retain this behaviour from the patch. Even though X11 may have introduced a lot of bad stuff, this one makes sense and simplifies a lot of code and logic. If you are specifying geometry,

Re: [dev] [st PATCH] X geometry changes

2014-04-25 Thread Amadeus Folego
So if bloat is our problem, let's remove all geometry handling code.

Re: [dev] [st PATCH] X geometry changes

2014-04-25 Thread Amadeus Folego
So if bloat is our problem, let's remove all geometry handling code. But the geom setting would still be useful for handling the floating and non tiled wms cases.

Re: [dev] [st PATCH] X geometry changes

2014-04-25 Thread Yuri Karaban
CL == Christoph Lohmann 2...@r-36.net writes: CL Suckless is writing software for dwm. A specified geometry is CL fixed. Otherwise st is not floating by default when forcing a CL size. If st was designed only to support tiling window managers then I guess I made a wrong choice.

Re: [dev] [st patch queue 12/12] Do not eat ESC character if control string is not properly terminated.

2014-04-25 Thread Roberto E. Vargas Caballero
Well you fixed a bug, but not all the bugs relatd to control strings. After your patch a control string ends with a '\a' or a ESC \\, but if you read [1]: *The VT510 ignores all following characters until it receives a SUB, ST, or any other C1 control character. So OSC, PM and

Re: [dev] [st] [PATCH] Fix techo handling of control and multibyte characters.

2014-04-24 Thread Christoph Lohmann
Greetings. On Thu, 24 Apr 2014 18:20:20 +0200 Roberto E. Vargas Caballero k...@shike2.com wrote: Thinking a bit more about this, I don't know why we are using -Wall, because it moves people to follow the GNU criteria, that is the more suck criteria I know (I think it is because they come from

[dev] [st] [PATCH] On terminal resize, clear the alt screen with its own cursor.

2014-04-24 Thread Colona
Currently the alternate screen get messed up on resize if it has different colors or mode. --- st.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/st.c b/st.c index 60243a7..c1f983f 100644 --- a/st.c +++ b/st.c @@ -2680,7 +2680,9 @@ tresize(int col, int row) { if(0 col

Re: [dev] [st] [patch] misplaced parenthesis in LEN macro

2014-04-23 Thread Rob
Martti Kühne, 22 April 2014 mysat...@gmail.com: On Sun, Apr 20, 2014 at 9:24 PM, Rob robpill...@gmail.com wrote: Into the bikeshed I go... LEN(a + 2) doesn't mean anything anyway, as a's type decays. To do it properly there should be some kind of static assert in the macro that the argument

Re: [dev] [st] [PATCH] Fix techo handling of control and multibyte characters.

2014-04-23 Thread Roberto E. Vargas Caballero
Applied with a small modification. Thanks -- Roberto E. Vargas Caballero

[dev] [st PATCH 1/4] Simplify tsetscroll.

2014-04-23 Thread noname
--- st.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/st.c b/st.c index aba034f..ede90d5 100644 --- a/st.c +++ b/st.c @@ -1765,17 +1765,11 @@ tsetattr(int *attr, int l) { void tsetscroll(int t, int b) { - int temp; - LIMIT(t, 0, term.row-1);

[dev] [st PATCH 2/4] Use BETWEEN macro in xsetcolorname and fix style.

2014-04-23 Thread noname
--- st.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/st.c b/st.c index ede90d5..07f408c 100644 --- a/st.c +++ b/st.c @@ -2750,10 +2750,10 @@ int xsetcolorname(int x, const char *name) { XRenderColor color = { .alpha = 0x }; Colour colour; -

<    1   2   3   4   5   6   7   8   9   10   >