Re: User template directory

2017-01-20 Thread Andrew Parsloe

On 21/01/2017 11:50 a.m., Paul A. Rubin wrote:

On 01/20/2017 05:26 PM, Guenter Milde wrote:

For easy access to both private and standard templates, I have

* set a custom template dir path under Tools>Settings>Paths
* added a symlink "stdtemplates" to the standard templates dir there.

Günter


Great idea! Just implemented it at my end. I'm still inclined to file an
enhancement request, though, unless it's either already in Trac
somewhere or has been discussed and voted down. I don't think a general
user, and particularly a Windows (or Mac?) user, should have to mess
with symlinks to fix this.

Paul

I'm puzzled. On my windows system, under Tools>Settings>Paths>Document 
templates I've simply entered the path to my user template directory  -- 
it happens to be


C:\Users\Andrew\AppData\Roaming\LyX2.2\templates

New from Template lists the templates in this directory, which are the 
ones I actually use. There's a store of other templates of course in the 
LyX Resources>templates directory. Should I ever need one I can simply 
copy it across to the user template directory, but in the meantime why 
clutter it with all those never-used and never-likely-to-be-used templates?


Andrew

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



Re: [LyX/master] Collect the outliner names for the children's tocs

2017-01-20 Thread Scott Kostyshak
On Sat, Jan 14, 2017 at 11:16:29PM +0100, Guillaume Munch wrote:
> commit 461fda9ca9a8079f235fe6d26031aa6b9c5ff36e
> Author: Guillaume Munch 
> Date:   Sat Jan 14 18:40:58 2017 +0100
> 
> Collect the outliner names for the children's tocs
> 
> Fixes missing outliner names in various situations. Now if the warning 
> "Missing
> outliner name" appears in the console, this correctly hints at an actual 
> issue
> with the layout.

I think this commit caused a change in behavior that I'm not sure was
intended.

To reproduce, do the following:

1. Open examples/beamer-article.lyx
2. Open the outliner
3. Click on the arrow in the outliner next to the left of "Section 3"
4. Click on the first item in the outliner under "Section 3", titled "Frame: 
What are overlays?"

LyX places the cursor at the correct spot, but the outliner is collapsed.
Before, the outliner was not collapsed.

There are other changes of behavior that can be seen, using this file.
For example, just clicking on "Section 2" or "Section 5", the outliner
does not highlight the section anymore like it used to.

I believe the issue is particular to having a child document.

Can you reproduce?

I imagine you will have higher priority issues to look at when you come back
before this one, so no worries if you don't get to it for a while.

Scott


signature.asc
Description: PGP signature


Re: [CONFIRMED] Display Problem in Stable with \notin, etc.

2017-01-20 Thread Richard Heck
On 01/20/2017 06:48 PM, Richard Heck wrote:
> I'll cherry pick it for stable. 

No, I won't

rh



Re: [CONFIRMED] Display Problem in Stable with \notin, etc.

2017-01-20 Thread Richard Heck
On 01/20/2017 06:37 PM, Enrico Forestieri wrote:
> On Fri, Jan 20, 2017 at 07:53:40PM +0100, Enrico Forestieri wrote:
>> On Thu, Jan 19, 2017 at 03:28:25PM -0500, Richard Heck wrote:
>>> On 01/19/2017 02:35 PM, Enrico Forestieri wrote:
 In conclusion, your patch textwidth2.diff is the right thing to do
 in master. For stable we have to make a decision. The alternatives are:

 1) The patch I posted earlier (textwidth.diff), amended to account
for single chars. This restores the previous behavior, where \not
only works properly with mathrel operators.

 2) The not1.diff patch. This is essentially equivalent to 1) but avoids
the \kern in the definition of \not.

 3) The not2.diff patch. This makes \ne, \neq, and \notin work again
and fixes the usage of \not with other non-mathrel characters,
while breaking it for \not=, \not\in and other mathrel operators.

 I would suggest to choose either 1) or 2), which simply restore the
 previous behavior.
>>> Either of those would be fine with me.
>> As I don't see what we gain from 2), I think 1) is the way to go. I attach
>> here the amended patch.
> Committed at 81465da5.

I'll cherry pick it for stable.

Richard

>



Re: [CONFIRMED] Display Problem in Stable with \notin, etc.

2017-01-20 Thread Enrico Forestieri
On Fri, Jan 20, 2017 at 07:53:40PM +0100, Enrico Forestieri wrote:
> On Thu, Jan 19, 2017 at 03:28:25PM -0500, Richard Heck wrote:
> > On 01/19/2017 02:35 PM, Enrico Forestieri wrote:
> > >
> > > In conclusion, your patch textwidth2.diff is the right thing to do
> > > in master. For stable we have to make a decision. The alternatives are:
> > >
> > > 1) The patch I posted earlier (textwidth.diff), amended to account
> > >for single chars. This restores the previous behavior, where \not
> > >only works properly with mathrel operators.
> > >
> > > 2) The not1.diff patch. This is essentially equivalent to 1) but avoids
> > >the \kern in the definition of \not.
> > >
> > > 3) The not2.diff patch. This makes \ne, \neq, and \notin work again
> > >and fixes the usage of \not with other non-mathrel characters,
> > >while breaking it for \not=, \not\in and other mathrel operators.
> > >
> > > I would suggest to choose either 1) or 2), which simply restore the
> > > previous behavior.
> > 
> > Either of those would be fine with me.
> 
> As I don't see what we gain from 2), I think 1) is the way to go. I attach
> here the amended patch.

Committed at 81465da5.

-- 
Enrico


Re: User template directory

2017-01-20 Thread Paul A. Rubin

On 01/20/2017 05:26 PM, Guenter Milde wrote:

For easy access to both private and standard templates, I have

* set a custom template dir path under Tools>Settings>Paths
* added a symlink "stdtemplates" to the standard templates dir there.

Günter

Great idea! Just implemented it at my end. I'm still inclined to file an 
enhancement request, though, unless it's either already in Trac 
somewhere or has been discussed and voted down. I don't think a general 
user, and particularly a Windows (or Mac?) user, should have to mess 
with symlinks to fix this.


Paul


Re: User template directory

2017-01-20 Thread Guenter Milde
On 2017-01-20, Paul A. Rubin wrote:
> Hi all,

> The File > New from Template... dialog defaults to listing "standard" 
> templates (in /usr/share/lyx/templates, at least on Ubuntu-like 
> systems). The directory panel on the left, on my system, sports icons 
> for "Computer" and my home directory, but nothing else.

...

For easy access to both private and standard templates, I have 

* set a custom template dir path under Tools>Settings>Paths
* added a symlink "stdtemplates" to the standard templates dir there.

Günter



User template directory

2017-01-20 Thread Paul A. Rubin

Hi all,

I was about to file an enhancement ticket on this, after striking out 
with a search of Trac, but it seems like such an obvious thing that I 
wanted to first check whether I'd be duplicating past effort.


The File > New from Template... dialog defaults to listing "standard" 
templates (in /usr/share/lyx/templates, at least on Ubuntu-like 
systems). The directory panel on the left, on my system, sports icons 
for "Computer" and my home directory, but nothing else. Clicking the 
home directory icon does the equivalent of "ls" rather than "ls -a", so 
the .lyx subdirectory is not listed. To get to a local template, I 
pretty much have to type the directory path "~/.lyx/templates" into the 
file name box and proceed from there.


It seems to me there are at least three ways to make this easier for the 
user. The first way would be to merge the listings of 
/usr/share/lyx/templates and ~/.lyx/templates in the default listing.The 
second way would be to put an icon for the local templates directory in 
the directory panel on the left. The third way would be to add the local 
templates directory to the drop-down "Look in:" list (and, I would 
argue, make it the default choice). This would be my preferred route.


Should I file a ticket, or has this been hashed over in the past?

Thanks,
Paul



Re: [CONFIRMED] Display Problem in Stable with \notin, etc.

2017-01-20 Thread Enrico Forestieri
On Thu, Jan 19, 2017 at 03:28:25PM -0500, Richard Heck wrote:
> On 01/19/2017 02:35 PM, Enrico Forestieri wrote:
> >
> > In conclusion, your patch textwidth2.diff is the right thing to do
> > in master. For stable we have to make a decision. The alternatives are:
> >
> > 1) The patch I posted earlier (textwidth.diff), amended to account
> >for single chars. This restores the previous behavior, where \not
> >only works properly with mathrel operators.
> >
> > 2) The not1.diff patch. This is essentially equivalent to 1) but avoids
> >the \kern in the definition of \not.
> >
> > 3) The not2.diff patch. This makes \ne, \neq, and \notin work again
> >and fixes the usage of \not with other non-mathrel characters,
> >while breaking it for \not=, \not\in and other mathrel operators.
> >
> > I would suggest to choose either 1) or 2), which simply restore the
> > previous behavior.
> 
> Either of those would be fine with me.

As I don't see what we gain from 2), I think 1) is the way to go. I attach
here the amended patch.

-- 
Enrico
diff --git a/src/frontends/qt4/GuiFontMetrics.cpp b/src/frontends/qt4/GuiFontMetrics.cpp
index f17ac37..83b2a1f 100644
--- a/src/frontends/qt4/GuiFontMetrics.cpp
+++ b/src/frontends/qt4/GuiFontMetrics.cpp
@@ -178,16 +178,27 @@ int GuiFontMetrics::width(docstring const & s) const
 	int * pw = strwidth_cache_[s];
 	if (pw)
 		return *pw;
+#endif
 	// For some reason QMetrics::width returns a wrong value with Qt5
-	// int w = metrics_.width(toqstr(s));
+	// with some arabic text. OTOH, QTextLayout is broken for single
+	// characters with null width (like \not in mathed). Also, as a
+	// safety measure, always use QMetrics::width with our math fonts.
+	int w = 0;
+	if (s.length() == 1
+#if QT_VERSION >= 0x040800
+	|| font_.styleName() == "LyX"
 #endif
-	QTextLayout tl;
-	tl.setText(toqstr(s));
-	tl.setFont(font_);
-	tl.beginLayout();
-	QTextLine line = tl.createLine();
-	tl.endLayout();
-	int w = int(line.naturalTextWidth());
+	   )
+		w = metrics_.width(toqstr(s));
+	else {
+		QTextLayout tl;
+		tl.setText(toqstr(s));
+		tl.setFont(font_);
+		tl.beginLayout();
+		QTextLine line = tl.createLine();
+		tl.endLayout();
+		w = int(line.naturalTextWidth());
+	}
 #ifdef CACHE_METRICS_WIDTH
 	strwidth_cache_.insert(s, new int(w), s.size() * sizeof(char_type));
 #endif


Re: System for continuous integration (CI) of LyX master branch, compiled on Ubuntu

2017-01-20 Thread Enrico Forestieri
On Thu, Jan 19, 2017 at 04:29:21PM -0800, Pavel Sanda wrote:

> Christian Ridderström wrote:
> > I actually wanted to test building with Qt5, but I couldn't (easily) get it
> > to work with autotools...
> > I assume I'm either missing some dependencies or I'm not using correct
> > arguments to e.g. ./configure.
> 
> If you have all deps, then configure needs --enable-qt5. Can't tell you more
> still on qt4.

If you use debian, you may also have to "export QT_SELECT=qt5" to force the
use of Qt5.

-- 
Enrico


Re: System for continuous integration (CI) of LyX master branch, compiled on Ubuntu

2017-01-20 Thread Kornel Benko
Am Donnerstag, 19. Januar 2017 um 23:47:49, schrieb Christian Ridderström 

> On 19 January 2017 at 16:30, Kornel Benko  wrote:
> 
> > > # Change directory to folder with cloned LyX repository
> >
> > Clone is not needed normally iff used only by cmake.
> >
> 
> The cloning is automatically done by the CI server / CI job, pulling the
> latest changes from git.lyx.org.
> 
> > This will build LyX and only then do 'make package_source'.  Anything else
> > > that should be in there?
> >
> > On ubuntu I use 'make package' to build everything.
> > E.g.
> > #CMAKE_OPTS= "-DLYX_USE_QT=QT5 -DLYX_CPACK=ON
> > -DCPACK_BINARY_DEB:BOOL=ON -DCPACK_SOURCE_TGZ:BOOL=ON -DLYX_NLS=ON
> > -DLYX_EXTERNAL_Z=ON -DLYX_EXTERNAL_ICONV=ON -DLYX_EXTERNAL_BOOST=OFF"
> > #cmake .. $CMAKE_OPTS && make package && make package_source
> >
> >
> I don't actually know what these options do, but the CI job is now using
> them.

-DLYX_CPACK=ON  Uses the cpack macros
-DCPACK_BINARY_DEB:BOOL=ON  configures for creation the debian .deb 
package,
(e.g. 'make 
package') ready to install with dpkg -i $packagename
-DCPACK_SOURCE_TGZ:BOOL=ON  configures for creation of source 
package (make package_source)
-DLYX_NLS=ONuse xgettext, msgfmt, msgmerge 
etc for creation of .gmo files
-DLYX_EXTERNAL_Z=ON use external libz because of 
conflicts with our supplied sources (valid for windows? only)
-DLYX_EXTERNAL_ICONV=ON use external libiconv because of 
conflicts with our supplied sources (valid for windows? only)
-DLYX_EXTERNAL_BOOST=OFFuse our supplied boost sources

> To be specific, this is the script that's being run to build:
> 
> https://github.com/DrChr/build-lyx-using-ubuntu-latest-qt5-cmake/blob/master/build_lyx.sh
> 

Yes, that should work.

The ultimate check would be
# make package_source
# mkdir src2
# cd src2
# tar axf ../LyX-2.3.tar.gz # creates source tree starting with 
"LyX-2.3/"
# mkdir build2  # e.g. $top/build/build2
# cd build2
# cmake ../LyX-2.3 $CMAKE_OPTS
# make package

> /Christian

Kornel

signature.asc
Description: This is a digitally signed message part.


Re: System for continuous integration (CI) of LyX master branch, compiled on Ubuntu

2017-01-20 Thread Christian Ridderström
On 20 January 2017 at 02:05, Pavel Sanda  wrote:

> Pavel Sanda wrote:
> > > However, I expect that this job will fail like before, but at least
> the job
> > > is setup.
> >
> > Yes, it will, hopefully we will get this fixed within next few days.
>
> distcheck works for me right now.
>

The job that builds with autotools and qt4 fails during 'make distclean'
within 'make distcheck'.
Here's a link to the console output:

https://ci.inria.fr/lyx/job/build-master-head/job/ubuntu-xenial-qt4-autotools-extended/4/console
I've copied in the last part of the output at the end of this email

The setup of the Docker container (sort of a light weight VM) that contains
the build environment can be seen here:

https://github.com/DrChr/build-lyx-using-ubuntu-xenial-qt4-autotools/blob/master/Dockerfile
but it's just these steps:
FROM ubuntu:16.04
MAINTAINER Christian Ridderström 

# Install tools and libraries needed to build LyX
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
build-essential \
automake \
autoconf \
zlib1g-dev \
pkg-config \
&& DEBIAN_FRONTEND=noninteractive apt-get build-dep -y \
lyx \

&& rm -rf /var/lib/apt/lists/*

The actual build commands are as seen in this script

https://github.com/DrChr/build-lyx-using-ubuntu-xenial-qt4-autotools/blob/master/build_lyx_extended.sh
which are just

do_or_fail ./autogen.sh
do_or_fail ./configure
do_or_fail make
do_or_fail make check
do_or_fail make distcheck

The log indicates it works up to "make check" and the error happens during
"make distcheck".
Below is the very last bit of the log output. Within the "make distcheck",
it seems that "make distclean" fails.
/Christian

rm -f Makefile
make[3]: Leaving directory '/usr/src/lyx/lyx-2.3.0dev/_build/sub/src/frontends'
Making distclean in .
make[3]: Entering directory '/usr/src/lyx/lyx-2.3.0dev/_build/sub/src'
Makefile:2453: support/tests/.deps/check_ExternalTransforms-dummy_functions.Po:
No such file or directory
Makefile:2454: support/tests/.deps/check_Length-dummy_functions.Po: No
such file or directory
Makefile:2455: support/tests/.deps/check_ListingsCaption-dummy_functions.Po:
No such file or directory
Makefile:2456: support/tests/.deps/check_layout-dummy_functions.Po: No
such file or directory
make[3]: *** No rule to make target
'support/tests/.deps/check_layout-dummy_functions.Po'.  Stop.
make[3]: Leaving directory '/usr/src/lyx/lyx-2.3.0dev/_build/sub/src'
Makefile:2909: recipe for target 'distclean-recursive' failed
make[2]: *** [distclean-recursive] Error 1
make[2]: Leaving directory '/usr/src/lyx/lyx-2.3.0dev/_build/sub/src'
Makefile:574: recipe for target 'distclean-recursive' failed
make[1]: Leaving directory '/usr/src/lyx/lyx-2.3.0dev/_build/sub'
make[1]: *** [distclean-recursive] Error 1
Makefile:779: recipe for target 'distcheck' failed
make: *** [distcheck] Error 1
Command 'make distcheck' failed, exiting





> Pavel
>