Re: New warning (or at least I only noticed it now)

2023-05-06 Thread Scott Kostyshak
On Fri, May 05, 2023 at 08:39:22PM +0200, Jean-Marc Lasgouttes wrote:
> Le 21/11/2022 à 08:34, José Matos a écrit :
> > Hi,
> >I have been compiling and running 2.4 compiled with the latest
> > preview of gcc 13.
> > 
> > I got a new warning:
> > "note: the temporary was destroyed at the end of the full expression"
> 
> I managed to solve cleanly the ones related to Converter class at 3ae5d6bd.

Thanks. So there is still the warning in the following: InsetGraphics.cpp, 
BufferView.cpp, ParagraphMetrics.cpp, TextMetrics.cpp, and Text.cpp.

> I still think that these warning are more annoying than useful.

I don't understand the underlying issues well enough. But in this case, shall 
we disable these instances with #pragma ?

Scott


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


Re: OK to move Fullscreen preferences?

2023-05-06 Thread Scott Kostyshak
On Fri, May 05, 2023 at 07:26:37PM +0200, Jean-Marc Lasgouttes wrote:

> Make sense. I would have put it in Display subsection, though.

Thanks for taking a look.

Sounds good, I passed that comment on (on the ticket).

Scott


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


Re: Long string not ended by EndPreamble

2023-05-06 Thread lorenzobertini97
Il giorno sab, 06/05/2023 alle 19.00 -0400, Richard Kimberly Heck ha
scritto:
> Pushed.
> 
> Riki

Thank you for the quick fix.
-- 
Lorenzo
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Long string not ended by EndPreamble

2023-05-06 Thread Richard Kimberly Heck

On 5/6/23 16:05, Jean-Marc Lasgouttes wrote:

Le 06/05/2023 à 21:30, Richard Kimberly Heck a écrit :
I see the warning when opening Document> Settings. Still happens with 
some content in between, too.


It seems to happen if there's nothing after the "EndPreamble". If I 
add just a comment, for example, it does away. Is the test 
!pimpl_->is failing because we're at the end of the stream?


Perhaps the attached?


It looks good. Does it work?


Yes. And it won't affect functionality, only when the error is printed, 
so totally safe.


Pushed.

Riki


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


Re: Long string not ended by EndPreamble

2023-05-06 Thread Jean-Marc Lasgouttes

Le 06/05/2023 à 21:30, Richard Kimberly Heck a écrit :
I see the warning when opening Document> Settings. Still happens with 
some content in between, too.


It seems to happen if there's nothing after the "EndPreamble". If I add 
just a comment, for example, it does away. Is the test !pimpl_->is 
failing because we're at the end of the stream?


Perhaps the attached?


It looks good. Does it work?

JMarc

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


Re: Long string not ended by EndPreamble

2023-05-06 Thread Richard Kimberly Heck

On 5/6/23 09:04, lorenzobertin...@gmail.com wrote:

Il giorno sab, 06/05/2023 alle 14.18 +0200, Jean-Marc Lasgouttes ha
scritto:

Le 06/05/2023 à 14:06, lorenzobertin...@gmail.com a écrit :


LyX: Long string not ended by `EndPreamble' [around line 4 of
file
current token: 'EndPreamble' context: '']

I never saw this issue. Can you send an example file where this
happens?

JMarc


Thanks for the info about the prefix. However, it happens with
different indentations, and even with none at all. I've attached a
barebone example; the message appears in the terminal, so remember to
launch LyX from there.


I see the warning when opening Document> Settings. Still happens with 
some content in between, too.


It seems to happen if there's nothing after the "EndPreamble". If I add 
just a comment, for example, it does away. Is the test !pimpl_->is 
failing because we're at the end of the stream?


Perhaps the attached?

Riki

From b68deb31cc7e77fafd83246a437946cd42fe272a Mon Sep 17 00:00:00 2001
From: Richard Kimberly Heck 
Date: Sat, 6 May 2023 15:29:16 -0400
Subject: [PATCH] tmp

---
 src/Lexer.cpp | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/Lexer.cpp b/src/Lexer.cpp
index c6402aec6f..ab052f5b77 100644
--- a/src/Lexer.cpp
+++ b/src/Lexer.cpp
@@ -690,6 +690,7 @@ docstring Lexer::getLongString(docstring const & endtoken)
 	docstring str;
 	docstring prefix;
 	bool firstline = true;
+	bool foundend = false;
 
 	while (pimpl_->is) { //< eatLine only reads from is, not from pushTok
 		if (!eatLine())
@@ -701,8 +702,10 @@ docstring Lexer::getLongString(docstring const & endtoken)
 		LYXERR(Debug::PARSER, "LongString: `" << tmpstr << '\'');
 
 		// We do a case independent comparison, like searchKeyword does.
-		if (compare_no_case(token, endtoken) == 0)
+		if (compare_no_case(token, endtoken) == 0) {
+			foundend = true;
 			break;
+		}
 
 		if (firstline) {
 			size_t i = tmpstr.find_first_not_of(from_ascii(" \t"));
@@ -720,7 +723,7 @@ docstring Lexer::getLongString(docstring const & endtoken)
 		str += tmpstr + '\n';
 	}
 
-	if (!pimpl_->is)
+	if (!foundend)
 		printError("Long string not ended by `" + to_utf8(endtoken) + '\'');
 
 	return str;
-- 
2.40.0

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


Re: Long string not ended by EndPreamble

2023-05-06 Thread lorenzobertini97
Il giorno sab, 06/05/2023 alle 14.18 +0200, Jean-Marc Lasgouttes ha
scritto:
> Le 06/05/2023 à 14:06, lorenzobertin...@gmail.com a écrit :
> 
> > > LyX: Long string not ended by `EndPreamble' [around line 4 of
> > > file
> > > current token: 'EndPreamble' context: '']
> 
> I never saw this issue. Can you send an example file where this
> happens?
> 
> JMarc
> 

Thanks for the info about the prefix. However, it happens with
different indentations, and even with none at all. I've attached a
barebone example; the message appears in the terminal, so remember to
launch LyX from there.

-- 
Lorenzo


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


Re: Long string not ended by EndPreamble

2023-05-06 Thread Jean-Marc Lasgouttes

Le 06/05/2023 à 14:06, lorenzobertin...@gmail.com a écrit :

Dear list,
since at least a year I've been getting the following after validating
a local layout in document preferences:


Do you managed to find the particular code that causes issues?

The way these long strings work is as follow:
* the first line determines the prefix, i.e. the sequence of spaces and 
tabs that are the start of string.This prefix is remembered and remove 
from the string.
* the lines that follow should begin with this prefix, which will not be 
kept in the strings.
* the first line that contains only the end token (and spaces/tabs) ends 
the parsing.



LyX: Long string not ended by `EndPreamble' [around line 4 of file
current token: 'EndPreamble' context: '']


I never saw this issue. Can you send an example file where this happens?

JMarc

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


Long string not ended by EndPreamble

2023-05-06 Thread lorenzobertini97
Dear list,
since at least a year I've been getting the following after validating
a local layout in document preferences:

> LyX: Long string not ended by `EndPreamble' [around line 4 of file 
> current token: 'EndPreamble' context: '']

It happens with Preamble, AddToPreamble, HTMLPreamble,
AddToHTMLPreamble even when closed by EndPreamble. Can someone
reproduce?

All the best
-- 
Lorenzo
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel