Re: [OFFTOPIC] Comments in the source code

2023-03-17 Thread Scott Kostyshak
On Fri, Mar 17, 2023 at 05:58:08PM +0100, Pavel Sanda wrote:
> Hi,
> 
> just a food of thought that did not occur to me earlier, but if we improved on
> the way we comment our own code, it might be that we could get helping hand
> with new code from the automate side of things. Current chatbots are already
> pretty good with translating simple task in human language into the generic
> codebase, and more literate-type of patches to the code could ease our own
> development of simple routines in not too distant future...

Interesting stuff.

By which year will it be able to address the 1285 FIXMEs in our source code? :)

Scott


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


Re: [OFFTOPIC] Comments in the source code

2023-03-17 Thread José Matos
On Fri, 2023-03-17 at 17:58 +0100, Pavel Sanda wrote:
> *A: As of my knowledge cutoff date of 2021, the forthcoming major
> version of LyX being developed was version 3.0.0. The development of
> this version had been ongoing for several years, with a number of new
> features and improvements planned, such as better support for
> collaborative editing, improved handling of large documents, and a
> new user interface based on Qt5.

At least someone... cough... something understands me. :-D
-- 
José Abílio
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: reversed parentheses with babel and xe/luatex

2023-03-17 Thread Jürgen Spitzmüller
Am Freitag, dem 17.03.2023 um 19:05 + schrieb Udicoudco:
> Yes, I was only considering parentheses for some reason. Thank you
> for the correction (as usual ;)).

Thanks, committed.

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


Re: reversed parentheses with babel and xe/luatex

2023-03-17 Thread Udicoudco
On Fri, Mar 17, 2023 at 4:45 PM Jürgen Spitzmüller 
wrote:
>
> Am Freitag, dem 17.03.2023 um 14:45 + schrieb Udicoudco:
> > Please ignore the last patch, here is the correct one.
>
> Isn't this the right patch? AFAIU we do not need to swap at all if
> babel is used with Xe/LuaTeX, right?
>

Yes, I was only considering parentheses for some reason. Thank you for the
correction (as usual ;)).

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


[OFFTOPIC] Comments in the source code

2023-03-17 Thread Pavel Sanda
Hi,

just a food of thought that did not occur to me earlier, but if we improved on
the way we comment our own code, it might be that we could get helping hand
with new code from the automate side of things. Current chatbots are already
pretty good with translating simple task in human language into the generic
codebase, and more literate-type of patches to the code could ease our own
development of simple routines in not too distant future...

Pavel


PS: I belive older GPT-3.5 is still under the hood for the chat.


*Q: Can you generate python code?

*A: Yes, I can generate Python code. However, I would need more specific 
instructions on what type of code you would like me to generate. For example, 
if you tell me what problem you are trying to solve or what functionality you 
need, I can try to generate Python code to solve that problem or implement that 
functionality.

*Q: I need python code which generates array of strings "sub1.txt", "sub2.txt", 
..., "subi.txt" for 1..i

*A: Sure, here's Python code that generates an array of strings in the format 
"sub1.txt", "sub2.txt", ..., "subi.txt" for 1..i:

python:

n = int(input("Enter the value of i: "))  # Get the value of i from user

arr = []  # Create an empty array to store the file names

# Loop through the range 1 to n and append the file names to the array
for i in range(1, n+1):
file_name = "sub" + str(i) + ".txt"
arr.append(file_name)

print(arr)  # Print the array of file names

You can adjust the value of n to change the number of file names generated. 
This code prompts the user to enter the value of i, but you can also hardcode a 
value if you prefer.

*Q: Thanks for saving my time bro.

*A: You're welcome! I'm glad I could help you. Don't hesitate to ask if you 
have any more questions or if you need further assistance.

*Q: Do you have access to source codes of large open source project on the 
internet?

*A: As an AI language model, I don't have direct access to the source codes of 
open source projects on the internet. However, I have been trained on a large 
corpus of text data, which includes many open source projects and their 
documentation. So, I can provide information on open source projects and their 
functionality, but I can't directly access their source code or modify them.

*Q: Can you access list of open source projects you have been trained upon?

*A: As an AI language model, I don't have a direct list of the open source 
projects I have been trained upon. My training data consists of a large corpus 
of text data from the internet, including publicly available sources such as 
websites, books, and articles. The text data is pre-processed to remove 
identifying information and to ensure that it is appropriate for training 
machine learning models.

The pre-processing steps include cleaning the text data, removing sensitive 
information, and anonymizing the data to ensure privacy and security. 
Therefore, I don't have access to a list of the specific open source projects 
or other sources that were used to train me, as this information has been 
removed from the training data for privacy and security reasons.

*Q: Is there a way I can check whether you have understanding of the code of a 
particular open source project?

*A: As an AI language model, I have been trained on a vast amount of text data 
that includes information on many open source projects. So, I can try to 
provide information on specific open source projects and their functionality.

However, my understanding of the code of a particular open source project may 
be limited to the information that is available in the text data that I have 
been trained on. Additionally, my understanding of the code may not be as 
nuanced or comprehensive as that of a human who has actually worked on the 
project.

If you have specific questions or tasks related to an open source project, I 
can try to provide guidance and suggestions based on the information available 
to me. However, for more detailed or complex tasks, it may be necessary to 
consult with an expert who has more experience with the project.

*Q: Let's give it a try. There is OSS project called LyX. In it's source could 
there is a concept of Inset. Can you try to give an explanation what that 
concept is?

*A: Yes, I can provide an explanation of what the "Inset" concept is in the LyX 
source code.

In LyX, an Inset is a graphical object that represents a specific type of 
content within a LyX document. It can be thought of as a container for a 
particular type of content, such as a formula, a table, an image, or a 
citation. Each Inset has a specific set of attributes that determine its 
appearance and behavior within the document.

The Inset concept is important because it allows LyX to provide a flexible and 
extensible framework for creating and manipulating complex documents. By 
defining a set of predefined Inset types and allowing users to create custom 
Inset types, LyX enables users to easily c

Re: reversed parentheses with babel and xe/luatex

2023-03-17 Thread Jürgen Spitzmüller
Am Freitag, dem 17.03.2023 um 14:45 + schrieb Udicoudco:
> Please ignore the last patch, here is the correct one.

Isn't this the right patch? AFAIU we do not need to swap at all if
babel is used with Xe/LuaTeX, right?

-- 
Jürgen
diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 8650826e4f..c43421b376 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -2027,9 +2027,11 @@ char_type Paragraph::getUChar(BufferParams const & bparams,
 	char_type c = d->text_[pos];
 
 	// Return unchanged character in LTR languages
-	// or if we use poylglossia/bidi (XeTeX).
-	if (rp.useBidiPackage()
-	|| !getFontSettings(bparams, pos).isRightToLeft())
+	// or if we use poylglossia/bidi (XeTeX)
+	// or with babel and Xe/LuaTeX.
+	if (!getFontSettings(bparams, pos).isRightToLeft()
+	|| rp.useBidiPackage()
+	|| (rp.use_babel && rp.isFullUnicode()))
 		return c;
 
 	// Without polyglossia/bidi, we need to account for some special cases.
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Elipses

2023-03-17 Thread Scott Kostyshak
On Fri, Mar 17, 2023 at 07:30:28AM +0100, Jürgen Spitzmüller wrote:
> Am Mittwoch, dem 15.03.2023 um 14:29 -0400 schrieb Richard Kimberly
> Heck:
> > I think I was on the 'don't do this side' back when we had that 
> > discussion. 
> 
> Me, too. And I still am. I wish we had an option to opt-out to the
> previous behavior where it was more clearly visible which kind of dash
> you have.

+1. On the one hand, I feel like this type of feature is common in GUI
editors. On the other hand, this type of feature is one of the reasons
why I don't like using GUI editors :). Also, it seems more WYSIWYG, not
WYSIWYM.

Scott


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


Re: reversed parentheses with babel and xe/luatex

2023-03-17 Thread Udicoudco
On Fri, Mar 17, 2023 at 2:41 PM Udicoudco  wrote:
>
> Hello all,
>
> Currently LyX reverse parentheses when babel and xe/luatex is used
> with Hebrew, and it should not do so. Attached a patch that fixes this matter.

Please ignore the last patch, here is the correct one.
> Best Regards,
> Udi
From 8c7b6228dccfb7b0ac8c786d86a1079516ba0d5d Mon Sep 17 00:00:00 2001
From: Udi Fogiel 
Date: Fri, 17 Mar 2023 14:30:13 +
Subject: [PATCH] reversed parentheses with babel and Xe/LuaTeX

---
 src/Paragraph.cpp | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 8650826e4f..9e74120155 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -2048,8 +2048,10 @@ char_type Paragraph::getUChar(BufferParams const & bparams,
 	char_type uc = c;
 
 	// 1. In the following languages, parentheses need to be reversed.
-	//Also with polyglodia/luabidi
-	bool const reverseparens = (lang == "hebrew" || rp.use_polyglossia);
+	//Also with polyglossia/luabidi
+	bool const reverseparens = (lang == "hebrew" || rp.use_polyglossia)
+	// With babel and Xe/LuaTeX parentheses should not be reversed 
+	&& (!rp.isFullUnicode() || !rp.use_babel);
 
 	// 2. In the following languages, brackets don't need to be reversed.
 	bool const reversebrackets = lang != "arabic_arabtex"
-- 
2.35.1

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


reversed parentheses with babel and xe/luatex

2023-03-17 Thread Udicoudco
Hello all,

Currently LyX reverse parentheses when babel and xe/luatex is used
with Hebrew, and it should not do so. Attached a patch that fixes this matter.

Best Regards,
Udi
From 8c7b6228dccfb7b0ac8c786d86a1079516ba0d5d Mon Sep 17 00:00:00 2001
From: Udi Fogiel 
Date: Fri, 17 Mar 2023 14:30:13 +
Subject: [PATCH] reversed parentheses with babel and Xe/LuaTeX

---
 src/Paragraph.cpp | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 8650826e4f..9e74120155 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -2048,8 +2048,10 @@ char_type Paragraph::getUChar(BufferParams const & bparams,
 	char_type uc = c;
 
 	// 1. In the following languages, parentheses need to be reversed.
-	//Also with polyglodia/luabidi
-	bool const reverseparens = (lang == "hebrew" || rp.use_polyglossia);
+	//Also with polyglossia/luabidi
+	bool const reverseparens = (lang == "hebrew" || rp.use_polyglossia)
+	// With babel and Xe/LuaTeX parentheses should not be reversed 
+	&& (!runparams.isFullUnicode() || !runparams.use_babel);
 
 	// 2. In the following languages, brackets don't need to be reversed.
 	bool const reversebrackets = lang != "arabic_arabtex"
-- 
2.35.1

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