Re: [LyX/master] Add warning message if we do no conversion.

2015-11-03 Thread Richard Heck

On 11/01/2015 08:26 PM, Scott Kostyshak wrote:

On Sun, Nov 01, 2015 at 08:04:28PM -0500, Richard Heck wrote:

So it would only happen from the command line in which case the warning
can be ignored easily enough.

I don't know if I like this asymmetry between GUI and command line.


All I meant was that LyX never calls lyx2lyx to "convert" a format to 
itself---we check whether the format is the current format before 
calling lyx2lyx---so in that sense the warning isn't relevant to the GUI.


Richard



Re: [LyX/master] Add warning message if we do no conversion.

2015-11-03 Thread Scott Kostyshak
On Tue, Nov 03, 2015 at 08:14:30PM -0500, Richard Heck wrote:
> On 11/01/2015 08:26 PM, Scott Kostyshak wrote:
> >On Sun, Nov 01, 2015 at 08:04:28PM -0500, Richard Heck wrote:
> >>So it would only happen from the command line in which case the warning
> >>can be ignored easily enough.
> >I don't know if I like this asymmetry between GUI and command line.
> 
> All I meant was that LyX never calls lyx2lyx to "convert" a format to
> itself---we check whether the format is the current format before calling
> lyx2lyx---so in that sense the warning isn't relevant to the GUI.

I see what you mean now. Thanks.

Scott


Re: [LyX/master] Add warning message if we do no conversion.

2015-11-01 Thread Scott Kostyshak
On Sun, Nov 01, 2015 at 08:04:28PM -0500, Richard Heck wrote:
> On 11/01/2015 07:54 PM, Scott Kostyshak wrote:
> >On Sun, Nov 01, 2015 at 10:33:09PM +0100, Richard Heck wrote:
> >>commit 4c16c61579d37f00c252ace8cf79d0573ca626bb
> >>Author: Richard Heck 
> >>Date:   Sun Nov 1 16:32:52 2015 -0500
> >>
> >> Add warning message if we do no conversion.
> >Why have a warning?
> >
> >We do not have a warning for:
> >lyx -e lyx21x Customization.21.lyx
> >where Customization.21.lyx is already in 2.1.x format.
> >
> >There is no warning for:
> >convert abc.jpg abc.jpg
> 
> > convert nipaudit2014-004.jpg a.jpg
> > diff nipaudit2014-004.jpg a.jpg
> Binary files nipaudit2014-004.jpg and a.jpg differ
> 
> So apparently not a no-op.
> 
> >ffmpeg -i abc.flac abc.flac
> >
> >These are a little different though because I think they do actually do
> >something (not sure what though).
> 
> Yes, I think because there are certain defaults in place. In fact, I get:
> >ffmpeg -i a.mp4 b.mp4
> [aac @ 0x16ec700] The encoder 'aac' is experimental but experimental codecs
> are not enabled, add '-strict -2' if you want to use it.

OK those were indeed bad examples by me then.

dos2unix seems like a better example:

$ mv mynotes testing1
$ cp testing1 testing2
$ dos2unix testing1
dos2unix: converting file testing1 to Unix format ...
$ md5sum testing1 testing2
9ca7056b4ba26136eb22fe885a6704b2  testing1
9ca7056b4ba26136eb22fe885a6704b2  testing2

> >On the other hand, I do see some reasoning for the change. Why would
> >someone try to convert a file to the same format? If they are doing
> >that, then maybe they misunderstood something so we should give a
> >warning to make sure they did not make a mistake and want to export to a
> >different format. Is that the correct reasoning?
> 
> Yes, that was the idea. It's a somewhat strange thing to do. As I said,
> there's a perfectly good reason to do it---batch conversion---but it's not
> the normal case, and it seems worth at least saying, "Hey, you might want to
> check this".

Makes sense. I just wonder why no other conversion tool (either on
command line, or in a programming language) that I know of behaves like
this. Sometimes though it is good to break convention.

> The way lyx2lyx is called from LyX itself, this would never happen: We don't
> try to do that ourselves.

> So it would only happen from the command line in which case the warning
> can be ignored easily enough.

I don't know if I like this asymmetry between GUI and command line.

In any case, my objection falls under the category of "nitpicking" so
I'm fine with the change. We should discuss more important things :)
Sometimes I have to remind myself of that.

Scott


Re: [LyX/master] Add warning message if we do no conversion.

2015-11-01 Thread Scott Kostyshak
On Sun, Nov 01, 2015 at 10:33:09PM +0100, Richard Heck wrote:
> commit 4c16c61579d37f00c252ace8cf79d0573ca626bb
> Author: Richard Heck 
> Date:   Sun Nov 1 16:32:52 2015 -0500
> 
> Add warning message if we do no conversion.

Why have a warning?

We do not have a warning for:
lyx -e lyx21x Customization.21.lyx
where Customization.21.lyx is already in 2.1.x format.

There is no warning for:
convert abc.jpg abc.jpg
ffmpeg -i abc.flac abc.flac

These are a little different though because I think they do actually do
something (not sure what though).

In the programming languages I know, there is no warning for something
like:

tolower('abc')

Or

echo "abc" | sed 's/a/a/'

On the other hand, I do see some reasoning for the change. Why would
someone try to convert a file to the same format? If they are doing
that, then maybe they misunderstood something so we should give a
warning to make sure they did not make a mistake and want to export to a
different format. Is that the correct reasoning?

Scott


Re: [LyX/master] Add warning message if we do no conversion.

2015-11-01 Thread Richard Heck

On 11/01/2015 07:54 PM, Scott Kostyshak wrote:

On Sun, Nov 01, 2015 at 10:33:09PM +0100, Richard Heck wrote:

commit 4c16c61579d37f00c252ace8cf79d0573ca626bb
Author: Richard Heck 
Date:   Sun Nov 1 16:32:52 2015 -0500

 Add warning message if we do no conversion.

Why have a warning?

We do not have a warning for:
lyx -e lyx21x Customization.21.lyx
where Customization.21.lyx is already in 2.1.x format.

There is no warning for:
convert abc.jpg abc.jpg


> convert nipaudit2014-004.jpg a.jpg
> diff nipaudit2014-004.jpg a.jpg
Binary files nipaudit2014-004.jpg and a.jpg differ

So apparently not a no-op.


ffmpeg -i abc.flac abc.flac

These are a little different though because I think they do actually do
something (not sure what though).


Yes, I think because there are certain defaults in place. In fact, I get:
>ffmpeg -i a.mp4 b.mp4
[aac @ 0x16ec700] The encoder 'aac' is experimental but experimental 
codecs are not enabled, add '-strict -2' if you want to use it.



In the programming languages I know, there is no warning for something
like:

tolower('abc')

Or

echo "abc" | sed 's/a/a/'

On the other hand, I do see some reasoning for the change. Why would
someone try to convert a file to the same format? If they are doing
that, then maybe they misunderstood something so we should give a
warning to make sure they did not make a mistake and want to export to a
different format. Is that the correct reasoning?


Yes, that was the idea. It's a somewhat strange thing to do. As I said, 
there's a perfectly good reason to do it---batch conversion---but it's 
not the normal case, and it seems worth at least saying, "Hey, you might 
want to check this".


The way lyx2lyx is called from LyX itself, this would never happen: We 
don't try to do that ourselves. So it would only happen from the command 
line, in which case the warning can be ignored easily enough.


Richard