Re: Make "wrap" the default in find for 2.4.0?

2021-07-16 Thread Scott Kostyshak
On Sat, Jul 17, 2021 at 02:08:57AM +0200, Kornel Benko wrote:
> Am Fri, 16 Jul 2021 16:02:59 -0400
> schrieb Scott Kostyshak :
> 
> > On Fri, Jul 16, 2021 at 04:30:07PM +0200, Kornel Benko wrote:
> > > Am Fri, 16 Jul 2021 15:37:12 +0200
> > > schrieb Kornel Benko :
> > >   
> > > > Am Thu, 15 Jul 2021 23:03:14 +0100
> > > > schrieb José Abílio Matos :
> > > >   
> > > > > On Thursday, 15 July 2021 16.37.19 WEST Scott Kostyshak wrote:
> > > > > > Bump. I know most people are lacking time, and I also have not been 
> > > > > > giving
> > > > > > feedback on others' patches (sorry, racoon!). But I prefer not to 
> > > > > > push this
> > > > > > change without at least a few more opinions. That said, I'm happy 
> > > > > > to wait
> > > > > > until more people are around.
> > > > > > 
> > > > > > Thanks,
> > > > > > Scott
> > > > > 
> > > > > I am used to emacs that also wraps by default. I have just tested 
> > > > > other 
> > > > > editors that have open at the moment like the octave editor, spyder 
> > > > > or R 
> > > > > Studio and all of them wrap.
> > > > > 
> > > > > I can see why you do not want to wrap but I think that it should be 
> > > > > on by 
> > > > > default.
> > > > > 
> > > > > Regards,
> > > > 
> > > > No problems with a new default.
> > > > 
> > > > Kornel  
> > > 
> > > OTOH, in advanced find there is no button to select wrap/nopwrap.
> > > (And your patch does not touch this part)  
> > 
> > Indeed. I can work on this, although it might take me a bit.
> 
> Thanks Scott.
> 
> > Do you
> > think the checkbox should go in the "Search" tab or in the "Settings"
> > tab? My first thought is that it should got in "Settings" since from
> > what I understand most users do not often toggle "wrap", as opposed to
> > the other three check boxes; that is, I think that users either prefer
> > to always wrap or to always not wrap.
> 
> Some people don't even look into the settings tab, so to make it more 
> prominent
> I'd prefer the button in the search tab.
> Of course, it is OK in the settings tab too, that is I would not oppose.

Search tab is fine with me. Thanks for the feedback.

Scott

> 
> > That said, if others prefer for the checkbox to go in "Search", that's
> > also fine with me.
> > 
> > Scott
> 
>   Kornel



> -- 
> lyx-devel mailing list
> lyx-devel@lists.lyx.org
> http://lists.lyx.org/mailman/listinfo/lyx-devel



signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Make "wrap" the default in find for 2.4.0?

2021-07-16 Thread Kornel Benko
Am Fri, 16 Jul 2021 16:02:59 -0400
schrieb Scott Kostyshak :

> On Fri, Jul 16, 2021 at 04:30:07PM +0200, Kornel Benko wrote:
> > Am Fri, 16 Jul 2021 15:37:12 +0200
> > schrieb Kornel Benko :
> >   
> > > Am Thu, 15 Jul 2021 23:03:14 +0100
> > > schrieb José Abílio Matos :
> > >   
> > > > On Thursday, 15 July 2021 16.37.19 WEST Scott Kostyshak wrote:
> > > > > Bump. I know most people are lacking time, and I also have not been 
> > > > > giving
> > > > > feedback on others' patches (sorry, racoon!). But I prefer not to 
> > > > > push this
> > > > > change without at least a few more opinions. That said, I'm happy to 
> > > > > wait
> > > > > until more people are around.
> > > > > 
> > > > > Thanks,
> > > > > Scott
> > > > 
> > > > I am used to emacs that also wraps by default. I have just tested other 
> > > > editors that have open at the moment like the octave editor, spyder or 
> > > > R 
> > > > Studio and all of them wrap.
> > > > 
> > > > I can see why you do not want to wrap but I think that it should be on 
> > > > by 
> > > > default.
> > > > 
> > > > Regards,
> > > 
> > > No problems with a new default.
> > > 
> > >   Kornel  
> > 
> > OTOH, in advanced find there is no button to select wrap/nopwrap.
> > (And your patch does not touch this part)  
> 
> Indeed. I can work on this, although it might take me a bit.

Thanks Scott.

> Do you
> think the checkbox should go in the "Search" tab or in the "Settings"
> tab? My first thought is that it should got in "Settings" since from
> what I understand most users do not often toggle "wrap", as opposed to
> the other three check boxes; that is, I think that users either prefer
> to always wrap or to always not wrap.

Some people don't even look into the settings tab, so to make it more prominent
I'd prefer the button in the search tab.
Of course, it is OK in the settings tab too, that is I would not oppose.

> That said, if others prefer for the checkbox to go in "Search", that's
> also fine with me.
> 
> Scott

Kornel


pgp2skBv9_wfP.pgp
Description: Digitale Signatur von OpenPGP
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Make "wrap" the default in find for 2.4.0?

2021-07-16 Thread Scott Kostyshak
On Fri, Jul 16, 2021 at 04:30:07PM +0200, Kornel Benko wrote:
> Am Fri, 16 Jul 2021 15:37:12 +0200
> schrieb Kornel Benko :
> 
> > Am Thu, 15 Jul 2021 23:03:14 +0100
> > schrieb José Abílio Matos :
> > 
> > > On Thursday, 15 July 2021 16.37.19 WEST Scott Kostyshak wrote:  
> > > > Bump. I know most people are lacking time, and I also have not been 
> > > > giving
> > > > feedback on others' patches (sorry, racoon!). But I prefer not to push 
> > > > this
> > > > change without at least a few more opinions. That said, I'm happy to 
> > > > wait
> > > > until more people are around.
> > > > 
> > > > Thanks,
> > > > Scott  
> > > 
> > > I am used to emacs that also wraps by default. I have just tested other 
> > > editors that have open at the moment like the octave editor, spyder or R 
> > > Studio and all of them wrap.
> > > 
> > > I can see why you do not want to wrap but I think that it should be on by 
> > > default.
> > > 
> > > Regards,  
> > 
> > No problems with a new default.
> > 
> > Kornel
> 
> OTOH, in advanced find there is no button to select wrap/nopwrap.
> (And your patch does not touch this part)

Indeed. I can work on this, although it might take me a bit. Do you
think the checkbox should go in the "Search" tab or in the "Settings"
tab? My first thought is that it should got in "Settings" since from
what I understand most users do not often toggle "wrap", as opposed to
the other three check boxes; that is, I think that users either prefer
to always wrap or to always not wrap.

That said, if others prefer for the checkbox to go in "Search", that's
also fine with me.

Scott


signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Make "wrap" the default in find for 2.4.0?

2021-07-16 Thread Scott Kostyshak
On Fri, Jul 16, 2021 at 03:37:12PM +0200, Kornel Benko wrote:
> Am Thu, 15 Jul 2021 23:03:14 +0100
> schrieb José Abílio Matos :
> 
> > On Thursday, 15 July 2021 16.37.19 WEST Scott Kostyshak wrote:
> > > Bump. I know most people are lacking time, and I also have not been giving
> > > feedback on others' patches (sorry, racoon!). But I prefer not to push 
> > > this
> > > change without at least a few more opinions. That said, I'm happy to wait
> > > until more people are around.
> > > 
> > > Thanks,
> > > Scott
> > 
> > I am used to emacs that also wraps by default. I have just tested other 
> > editors that have open at the moment like the octave editor, spyder or R 
> > Studio and all of them wrap.
> > 
> > I can see why you do not want to wrap but I think that it should be on by 
> > default.
> > 
> > Regards,
> 
> No problems with a new default.

Thanks all for the feedback! I pushed the set of commits to master at abc65d47, 
47b0c338, and bea7ef04.

Scott


signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [PATCH] Reduce warnings with Apple clang in InsetMathScript.cpp

2021-07-16 Thread Stephan Witt
Am 16.07.2021 um 18:37 schrieb Jean-Marc Lasgouttes :
> 
> Le 16/07/2021 à 18:24, Stephan Witt a écrit :
>> Hi Thibaut,
>> the Apple clang compiler spits warnings for InsetMathScript.cpp:
> 
> Hi Stephan,
> 
> I was about to push the following patch :) I'll let you decide what to do.

Ha, that’s funny.

In fact I think the clang generated proposal has the problem to make a "senior 
developer“ wonder why we want to send a nullptr to the stream. So one has to 
decode the logic code flow again and again. But mine isn’t much better. Perhaps 
your patch plus a dedicated comment is the optimum?

> 
> JMarc
> 
> 
> 
>> /Users/lyx/Development/lyx/src/mathed/InsetMathScript.cpp:619:11: warning: 
>> variable 'tag' is used uninitialized whenever 'if' condition is false 
>> [-Wsometimes-uninitialized]
>> else if (d)
>>  ^
>> /Users/lyx/Development/lyx/src/mathed/InsetMathScript.cpp:622:13: note: 
>> uninitialized use occurs here
>> ms << MTag(tag);
>>^~~
>> /Users/lyx/Development/lyx/src/mathed/InsetMathScript.cpp:619:7: note: 
>> remove the 'if' if its condition is always true
>> else if (d)
>>  ^~
>> /Users/lyx/Development/lyx/src/mathed/InsetMathScript.cpp:614:18: note: 
>> initialize the variable 'tag' to silence this warning
>> const char * tag;
>> ^
>>  = nullptr
>> The attached patch makes it happy. It avoids the superfluous test for the 
>> bool d but I left it in comment to make the logic clear. Do you like it?
>> BR, Stephan
> 
> <0001-Work-around-compilation-warning.patch>-- 
> lyx-devel mailing list
> lyx-devel@lists.lyx.org
> http://lists.lyx.org/mailman/listinfo/lyx-devel

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [PATCH] Reduce warnings with Apple clang in InsetMathScript.cpp

2021-07-16 Thread Jean-Marc Lasgouttes

Le 16/07/2021 à 18:24, Stephan Witt a écrit :

Hi Thibaut,

the Apple clang compiler spits warnings for InsetMathScript.cpp:


Hi Stephan,

I was about to push the following patch :) I'll let you decide what to do.

JMarc






/Users/lyx/Development/lyx/src/mathed/InsetMathScript.cpp:619:11: warning: 
variable 'tag' is used uninitialized whenever 'if' condition is false 
[-Wsometimes-uninitialized]
 else if (d)
  ^
/Users/lyx/Development/lyx/src/mathed/InsetMathScript.cpp:622:13: note: 
uninitialized use occurs here
 ms << MTag(tag);
^~~
/Users/lyx/Development/lyx/src/mathed/InsetMathScript.cpp:619:7: note: remove 
the 'if' if its condition is always true
 else if (d)
  ^~
/Users/lyx/Development/lyx/src/mathed/InsetMathScript.cpp:614:18: note: 
initialize the variable 'tag' to silence this warning
 const char * tag;
 ^
  = nullptr

The attached patch makes it happy. It avoids the superfluous test for the bool 
d but I left it in comment to make the logic clear. Do you like it?

BR, Stephan




>From e1f627939a950cd385f87b45661b17b4ffbb9f37 Mon Sep 17 00:00:00 2001
From: Jean-Marc Lasgouttes 
Date: Fri, 16 Jul 2021 18:27:15 +0200
Subject: [PATCH] Work around compilation warning

Clang 12 (at least) misses the fact that tag is always initialized,
because the if/else sequence does cover all cases.

Initialize the variable although it is not required. It does not hurt
at least.
---
 src/mathed/InsetMathScript.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mathed/InsetMathScript.cpp b/src/mathed/InsetMathScript.cpp
index 9f391f66f9..a5f286b3a5 100644
--- a/src/mathed/InsetMathScript.cpp
+++ b/src/mathed/InsetMathScript.cpp
@@ -611,7 +611,7 @@ void InsetMathScript::mathmlize(MathMLStream & ms) const
 	if (!d && !u)
 		return;
 
-	const char * tag;
+	const char * tag = nullptr;
 	if (u && d)
 		tag = has_limits ? "munderover" : "msubsup";
 	else if (u)
-- 
2.30.2

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


[PATCH] Reduce warnings with Apple clang in InsetMathScript.cpp

2021-07-16 Thread Stephan Witt
Hi Thibaut,

the Apple clang compiler spits warnings for InsetMathScript.cpp:


/Users/lyx/Development/lyx/src/mathed/InsetMathScript.cpp:619:11: warning: 
variable 'tag' is used uninitialized whenever 'if' condition is false 
[-Wsometimes-uninitialized]
else if (d)
 ^
/Users/lyx/Development/lyx/src/mathed/InsetMathScript.cpp:622:13: note: 
uninitialized use occurs here
ms << MTag(tag);
   ^~~
/Users/lyx/Development/lyx/src/mathed/InsetMathScript.cpp:619:7: note: remove 
the 'if' if its condition is always true
else if (d)
 ^~
/Users/lyx/Development/lyx/src/mathed/InsetMathScript.cpp:614:18: note: 
initialize the variable 'tag' to silence this warning
const char * tag;
^
 = nullptr

The attached patch makes it happy. It avoids the superfluous test for the bool 
d but I left it in comment to make the logic clear. Do you like it?

BR, Stephan



patch.diff
Description: Binary data
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Make "wrap" the default in find for 2.4.0?

2021-07-16 Thread Kornel Benko
Am Fri, 16 Jul 2021 15:37:12 +0200
schrieb Kornel Benko :

> Am Thu, 15 Jul 2021 23:03:14 +0100
> schrieb José Abílio Matos :
> 
> > On Thursday, 15 July 2021 16.37.19 WEST Scott Kostyshak wrote:  
> > > Bump. I know most people are lacking time, and I also have not been giving
> > > feedback on others' patches (sorry, racoon!). But I prefer not to push 
> > > this
> > > change without at least a few more opinions. That said, I'm happy to wait
> > > until more people are around.
> > > 
> > > Thanks,
> > > Scott  
> > 
> > I am used to emacs that also wraps by default. I have just tested other 
> > editors that have open at the moment like the octave editor, spyder or R 
> > Studio and all of them wrap.
> > 
> > I can see why you do not want to wrap but I think that it should be on by 
> > default.
> > 
> > Regards,  
> 
> No problems with a new default.
> 
>   Kornel

OTOH, in advanced find there is no button to select wrap/nopwrap.
(And your patch does not touch this part)

Kornel


pgpL60Ru9TMmS.pgp
Description: Digitale Signatur von OpenPGP
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Make "wrap" the default in find for 2.4.0?

2021-07-16 Thread Stephan Witt
Am 15.07.2021 um 17:37 schrieb Scott Kostyshak :
> 
> On Wed, Jun 02, 2021 at 12:26:44AM -0400, Scott Kostyshak wrote:
>> I've been using the new find bar in master and it's great! Thank you Jürgen 
>> for the nice feature.
>> 
>> Is there any interest in enabling the "wrap" checkbox for find as default? I 
>> have no idea what most users prefer. I could make a poll on the lyx-users 
>> list if there is interest in considering it.
>> 
>> I'm not sure how relevant the following comparison is given that LyX is 
>> different, but in case it is helpful for discussion:
>> 
>> LibreOffice Writer, Gedit, Chromium, and Firefox automatically wrap. I'm not 
>> sure any of them even has an option to not wrap or to prompt. The only 
>> application I'm aware of that has wrap as an option is Vim (see config 
>> "wrapscan"), although the default is to wrap.
>> 
>> I attach a small set of patches related to find. In addition to setting wrap 
>> as default, the patches introduce a status message when there is auto-wrap.
> 
> Bump. I know most people are lacking time, and I also have not been giving 
> feedback on others' patches (sorry, racoon!). But I prefer not to push this 
> change without at least a few more opinions. That said, I'm happy to wait 
> until more people are around.

I think it’s better to wrap around.

Stephan
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Make "wrap" the default in find for 2.4.0?

2021-07-16 Thread Jean-Marc Lasgouttes

Le 02/06/2021 à 06:26, Scott Kostyshak a écrit :

I've been using the new find bar in master and it's great! Thank you Jürgen for 
the nice feature.

Is there any interest in enabling the "wrap" checkbox for find as default? I 
have no idea what most users prefer. I could make a poll on the lyx-users list if there 
is interest in considering it.


I am all for it.

JMarc
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Make "wrap" the default in find for 2.4.0?

2021-07-16 Thread Kornel Benko
Am Thu, 15 Jul 2021 23:03:14 +0100
schrieb José Abílio Matos :

> On Thursday, 15 July 2021 16.37.19 WEST Scott Kostyshak wrote:
> > Bump. I know most people are lacking time, and I also have not been giving
> > feedback on others' patches (sorry, racoon!). But I prefer not to push this
> > change without at least a few more opinions. That said, I'm happy to wait
> > until more people are around.
> > 
> > Thanks,
> > Scott
> 
> I am used to emacs that also wraps by default. I have just tested other 
> editors that have open at the moment like the octave editor, spyder or R 
> Studio and all of them wrap.
> 
> I can see why you do not want to wrap but I think that it should be on by 
> default.
> 
> Regards,

No problems with a new default.

Kornel


pgp_nn7EGjsAj.pgp
Description: Digitale Signatur von OpenPGP
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel