Re: Subtract value for word/character count

2024-04-04 Thread Richard Kimberly Heck

On 4/4/24 17:15, Pavel Sanda wrote:

On Tue, Apr 02, 2024 at 10:23:10PM -0400, Richard Kimberly Heck wrote:

Actually, I am not sure how it helps. Knowing that you need to remove 140
words is not useful in itself.

The idea is that I set the difference value to the current count and
I am aiming for -140.

Which brings me to even simpler UI than I previously thought.
Instead of entering some values as an argument I could simply
have lfun that sets the difference to the current statistics
value and be done with it.

If you want to post it when/if it's done, I'll be happy to look at it.

Essentially the attached.

Variables should be more hidden and I can add reset mechanism if this
feature looks ok. I am happy even without context menu change, still
less code out of the tree to maintain.

I can easily imagine using this. I'd say go ahead, for 2.4.1.

Good, I fixed the scope of variables and added reset mechanism.
Will commit the attached to 2.4.1 if there is no other feedback.


Looks good to me.

Riki


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


Re: [LyX/master] Clarify quote-insert LFUN.

2024-04-04 Thread Richard Kimberly Heck

On 4/4/24 15:02, Pavel Sanda wrote:

On Tue, Apr 02, 2024 at 09:07:10PM +0200, Pavel Sanda wrote:

On Tue, Apr 02, 2024 at 12:46:13PM -0400, Richard Kimberly Heck wrote:

On 4/2/24 05:22, Pavel Sanda wrote:

On Mon, Apr 01, 2024 at 09:28:51PM +, Richard Kimberly Heck wrote:

commit b0c4681cd8f4dedb975aac80dcb717c40aa8
Author: Richard Kimberly Heck 
Date:   Mon Apr 1 17:26:01 2024 -0400

 Clarify quote-insert LFUN.
 And add remark about multiple optional arguments.
 (cherry picked from commit 29be057a073fde4e36c9adbf31c6cd764f62bda2)

Riki, this file is unf autogenerated. Everything needs to go to LyXAction.cpp
first and later regenerated via "make lfundoc".'

Oh, right. Where can I change the stuff at the beginning of the file?

development/tools/gen_lfuns.py

If you are asking because of file format, just resaving in lyx itself
and letting lyx2lyx do its work is probably better idea than trying
to produce up-to-date format (you might need to change the mid-file
as well and it's way to easy to shoot yourself in the leg...)

I see now, that you are asking because of the change in the begining of the 
file. But isn't the main part solved just by the attached patch?


Yes, though I was thinking the more general point was worth making 
somewhere. I'll look at it at some point, and maybe update to current 
format.


Riki


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


Re: Subtract value for word/character count

2024-04-04 Thread Pavel Sanda
On Tue, Apr 02, 2024 at 10:23:10PM -0400, Richard Kimberly Heck wrote:
> Actually, I am not sure how it helps. Knowing that you need to remove 140
> words is not useful in itself.
> >>>The idea is that I set the difference value to the current count and
> >>>I am aiming for -140.
> >>>
> >>>Which brings me to even simpler UI than I previously thought.
> >>>Instead of entering some values as an argument I could simply
> >>>have lfun that sets the difference to the current statistics
> >>>value and be done with it.
> >>If you want to post it when/if it's done, I'll be happy to look at it.
> >Essentially the attached.
> >
> >Variables should be more hidden and I can add reset mechanism if this
> >feature looks ok. I am happy even without context menu change, still
> >less code out of the tree to maintain.
> 
> I can easily imagine using this. I'd say go ahead, for 2.4.1.

Good, I fixed the scope of variables and added reset mechanism.
Will commit the attached to 2.4.1 if there is no other feedback.

Pavel
diff --git a/lib/ui/stdcontext.inc b/lib/ui/stdcontext.inc
index 32d76e603e..24e51fd685 100644
--- a/lib/ui/stdcontext.inc
+++ b/lib/ui/stdcontext.inc
@@ -774,6 +774,8 @@ Menuset
Item "Word Count|W" "ui-toggle statistics-w"
Item "Character Count|C" "ui-toggle statistics-cb"
Item "Character Count (No Blanks)|h" "ui-toggle statistics-c"
+   Item "Clamp statistics to the current value" 
"statistics-reference-clamp"
+   OptItem "Reset statistics to the absolute value" 
"statistics-reference-clamp reset"
End
 
 End
diff --git a/src/BufferView.cpp b/src/BufferView.cpp
index 39fffed68e..7386c79a75 100644
--- a/src/BufferView.cpp
+++ b/src/BufferView.cpp
@@ -298,6 +298,12 @@ struct BufferView::Private
frontend::CaretGeometry caret_geometry_;
///
bool mouse_selecting_ = false;
+   /// Reference value for statistics (essentially subtract this from the 
actual value to see relative counts)
+   /// (words/chars/chars no blanks)
+   int stats_ref_value_w_ = 0;
+   int stats_ref_value_c_ = 0;
+   int stats_ref_value_nb_ = 0;
+
 };
 
 
@@ -1337,6 +1343,17 @@ bool BufferView::getStatus(FuncRequest const & cmd, 
FuncStatus & flag)
flag.setEnabled(cur.selection());
break;
 
+   case LFUN_STATISTICS_REFERENCE_CLAMP: {
+   // disable optitem reset if clamp not used
+   if  (cmd.argument() == "reset" && d->stats_ref_value_c_ == 0) {
+   flag.setEnabled(false);
+   break;
+   }
+   flag.setEnabled(true);
+   break;
+
+   }
+
default:
return false;
}
@@ -2008,6 +2025,24 @@ void BufferView::dispatch(FuncRequest const & cmd, 
DispatchResult & dr)
}
break;
 
+   case LFUN_STATISTICS_REFERENCE_CLAMP: {
+   if  (cmd.argument() == "reset") {
+   d->stats_ref_value_w_ = d->stats_ref_value_c_ = 
d->stats_ref_value_nb_ = 0;
+   break;
+   }
+
+   DocIterator from, to;
+   from = doc_iterator_begin(_);
+   to = doc_iterator_end(_);
+   buffer_.updateStatistics(from, to);
+
+   d->stats_ref_value_w_ = buffer_.wordCount();
+   d->stats_ref_value_c_ = buffer_.charCount(true);
+   d->stats_ref_value_nb_ = buffer_.charCount(false);
+   break;
+   }
+
+
case LFUN_SCREEN_UP:
case LFUN_SCREEN_DOWN: {
Point p = getPos(cur);
@@ -2615,6 +2650,24 @@ bool BufferView::mouseSelecting() const
 }
 
 
+int BufferView::stats_ref_value_w() const
+{
+   return d->stats_ref_value_w_;
+}
+
+
+int BufferView::stats_ref_value_c() const
+{
+   return d->stats_ref_value_c_;
+}
+
+
+int BufferView::stats_ref_value_nb() const
+{
+   return d->stats_ref_value_nb_;
+}
+
+
 void BufferView::mouseEventDispatch(FuncRequest const & cmd0)
 {
//lyxerr << "[ cmd0 " << cmd0 << "]" << endl;
diff --git a/src/BufferView.h b/src/BufferView.h
index b46ade3df5..eed48209bb 100644
--- a/src/BufferView.h
+++ b/src/BufferView.h
@@ -398,6 +398,12 @@ public:
/// Are we currently performing a selection with the mouse?
bool mouseSelecting() const;
 
+   /// Reference value for statistics (essentially subtract this from the 
actual value to see relative counts)
+   /// (words/chars/chars no blanks)
+   int stats_ref_value_w() const;
+   int stats_ref_value_c() const;
+   int stats_ref_value_nb() const;
+
 private:
/// noncopyable
BufferView(BufferView const &);
diff --git a/src/FuncCode.h b/src/FuncCode.h
index 19f41295b1..a5f638d6d7 100644
--- a/src/FuncCode.h
+++ b/src/FuncCode.h
@@ -508,6 +508,7 @@ enum FuncCode
LFUN_TAB_GROUP_NEXT,// daniel 20220130

Re: [LyX/master] Clarify quote-insert LFUN.

2024-04-04 Thread Pavel Sanda
On Tue, Apr 02, 2024 at 09:07:10PM +0200, Pavel Sanda wrote:
> On Tue, Apr 02, 2024 at 12:46:13PM -0400, Richard Kimberly Heck wrote:
> > On 4/2/24 05:22, Pavel Sanda wrote:
> > >On Mon, Apr 01, 2024 at 09:28:51PM +, Richard Kimberly Heck wrote:
> > >>commit b0c4681cd8f4dedb975aac80dcb717c40aa8
> > >>Author: Richard Kimberly Heck 
> > >>Date:   Mon Apr 1 17:26:01 2024 -0400
> > >>
> > >> Clarify quote-insert LFUN.
> > >> And add remark about multiple optional arguments.
> > >> (cherry picked from commit 29be057a073fde4e36c9adbf31c6cd764f62bda2)
> > >Riki, this file is unf autogenerated. Everything needs to go to 
> > >LyXAction.cpp
> > >first and later regenerated via "make lfundoc".'
> > 
> > Oh, right. Where can I change the stuff at the beginning of the file?
> 
> development/tools/gen_lfuns.py
> 
> If you are asking because of file format, just resaving in lyx itself
> and letting lyx2lyx do its work is probably better idea than trying
> to produce up-to-date format (you might need to change the mid-file
> as well and it's way to easy to shoot yourself in the leg...)

I see now, that you are asking because of the change in the begining of the 
file.
But isn't the main part solved just by the attached patch?

Pavel
diff --git a/po/cs.gmo b/po/cs.gmo
index 77e6cdb0b6..a2e7997798 100644
Binary files a/po/cs.gmo and b/po/cs.gmo differ
diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp
index b6bb52152c..96b41c18a5 100644
--- a/src/LyXAction.cpp
+++ b/src/LyXAction.cpp
@@ -3466,7 +3466,7 @@ void LyXAction::init()
  * \var lyx::FuncCode lyx::LFUN_QUOTE_INSERT
  * \li Action: Inserts quotes according to the type and quote-language 
preference.
  * \li Notion: Currently 15 different quote styles are distinguished (see 
params).
- * \li Syntax: quote-insert [] [] 

Re: Compiling With Qt5

2024-04-04 Thread Richard Kimberly Heck

On 4/3/24 06:34, Jean-Marc Lasgouttes wrote:

Le 03/04/2024 à 12:27, Pavel Sanda a écrit :

On Tue, Apr 02, 2024 at 09:54:22PM -0400, Richard Kimberly Heck wrote:
Also, do we want Qt6 to be the default with 2.4.x? In master, that 
might

make sense, but it seems odd to change that now.


I would not do that for 2.4 at this stage.


I guess we could do that in a later 2.4 version, but this will need a 
discussion.


I think it already is the default in the 2.4.x branch:

../lyx-2.4.x/build/ [2.4.x] > cmake ..
CMake Deprecation Warning at CMakeLists.txt:7 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument  value or use a ... suffix to tell
  CMake that the project does not need compatibility with older versions.


-- TOP_SRC_DIR = /cvs/lyx/lyx-2.4.x
--

[snip]

-- Performing Test HAVE_STDATOMIC - Success
-- Qt6Core_VERSION = 6.6.0
-- Performing Test CHECK_WNODEPRECATEDCOPY_FLAG
-- Performing Test CHECK_WNODEPRECATEDCOPY_FLAG - Success
-- LYX_USE_QT = QT6
-- Found OpenGL: /usr/lib64/libOpenGL.so

[snip]

CMake Error at CMakeLists.txt:826 (find_package):
  Could not find a package configuration file provided by "Qt6Svg" with any
  of the following names:

    Qt6SvgConfig.cmake
    qt6svg-config.cmake

  Add the installation prefix of "Qt6Svg" to CMAKE_PREFIX_PATH or set
  "Qt6Svg_DIR" to a directory containing one of the above files.  If 
"Qt6Svg"

  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  src/frontends/qt/CMakeLists.txt:50 (qt_use_modules)

If I explicitly set Qt5, then it works.

Riki


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


LyX 2.3.8: Release Schedule

2024-04-04 Thread Richard Kimberly Heck
We are intending to release LyX 2.3.8, the final maintenance release in 
the 2.3.x series, soon. There should not have been many changes to 
translatable strings since 2.3.7, but there will have been some. If 
you'd like to update the translation, please do so by Friday, 12 April. 
I'll plan to package the release the following weekend.


Riki


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


Re: LyX 2.4.0 RC4

2024-04-04 Thread Rich Shepard

On Sun, 31 Mar 2024, Richard Kimberly Heck wrote:

What we hope will be the final release candidate for 2.4.0 is now available 
here:

http://ftp.lyx.org/pub/lyx/devel/lyx-2.4/

Please report bugs to lyx-devel@lists.lyx.org.


Riki,

Just upgraded from 2.3.7.1 to 2.4.0~RC4 on Slackware64-15.0 on a ThinkPad
T430; no bugs seen crawling around. The issues that bugged me in 2.3.6.2 and
2.3.7.1 (not finding biblatex.sty and biber, needing to use the File menu to
export a pdflatex because c-x h wouldn't work) are gone.

I had a concern about Tools -> Preferences -> Look & Feel -> Display showed
Default when I use emacs turned out that (at least on my system) emacs key
chords are the default.

Congratulations and many thanks to all devs.

Best regards,

Rich

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


Re: Alt-M shortcuts broken

2024-04-04 Thread Pavel Sanda
On Thu, Apr 04, 2024 at 11:33:50AM -0400, Max Mueggler wrote:
> > > If I press Alt-M, a list of shortcuts appear in the status bar, but none 
> > > of
> > > them have any effect (for example, Alt-M F just types an f).
> > > 
> > > I tried resetting my keybinds by deleting ~/.lyx/bind/, to no effect.
> > > 
> > > Version: 2.4.0~RC3, but I reproduced the bug in 2.3.7.
> > > 
> > > System: Debian Testing
> > Do you self compile or do you use debian's default package?
> > (Sounds little bit like qt6 issue, but IIRC debian default still uses qt5).
>
> This is Debian's default package, yes. It is using qt5.

Ok, let's keep this on the mailling list. Is there anyone around still using 
debian
testing to check this or everyone already moved to stable due to xz backdoor? :)

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


Re: LyX 2.3.8

2024-04-04 Thread Jürgen Spitzmüller
Am Donnerstag, dem 04.04.2024 um 11:55 -0400 schrieb Richard Kimberly
Heck:
> Should we go ahead and release the last of the 2.3.x series? It seems
> exceedingly unlikely that there will be a format change in 2.4.0 at
> this point.

Yes.

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


LyX 2.3.8

2024-04-04 Thread Richard Kimberly Heck
Should we go ahead and release the last of the 2.3.x series? It seems 
exceedingly unlikely that there will be a format change in 2.4.0 at this 
point.


Riki


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


Re: c2248 compile error with qcompare and Qt 6.7.0

2024-04-04 Thread Jean-Marc Lasgouttes

Le 03/04/2024 à 17:03, Yu Jin a écrit :
I am not able to compile LyX with the newest Qt (6.7.0), I get these 
error when compiling factory.cpp:
1>C:\Qt\6.7.0\msvc2019_64\include\QtCore\qcompare.h(228,30): error 
C2248: 'Qt::partial_ordering::partial_ordering': cannot access private 
member declared in class 'Qt::partial_ordering'
1>Note: including file:   
C:\Qt\6.7.0\msvc2019_64\include\QtCore/qlatin1stringview.h
1>Note: including file:   
  C:\Qt\6.7.0\msvc2019_64\include\QtCore/qchar.h

1>(compiling source file '../../master/src/factory.cpp')


Hi,

I believe that the reason factory.cpp triggers this bug is that 
InsetInfo.h includes . I fixed that in git master, because it is 
a bad idea and it is not really necessary.


You should now experience a compiler error somewhere else %-] At least 
it should be a less weird message.


What we learn here is that including  might be enough to trigger 
an error.


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


Re: Errors compiling lyx2.4 with gcc 5.4.0

2024-04-04 Thread Richard Kimberly Heck

On 4/3/24 06:43, Jean-Marc Lasgouttes wrote:

Le 02/04/2024 à 14:11, Kornel Benko a écrit :

Am Mon, 01 Apr 2024 20:24:10 +0100
schrieb José Matos :

What Qt version is available there?


This is qt5.4.0. And probably you are right.


This one should be fixed in master at 6260689fd552. Please confirm.

Riki, this will be candidate for 2.4.0.


Yes, go ahead.

Riki


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