[LyX/master] Add getStatus check that 1 tab for switching

2015-04-07 Thread Scott Kostyshak
commit e26ac5c5506a7e37ac24e696aaa3b7b1e721dbcb
Author: Scott Kostyshak skost...@lyx.org
Date:   Tue Apr 7 22:55:20 2015 -0400

Add getStatus check that 1 tab for switching

buffer-next and buffer-previous are now only enabled
if there is more than one tab. Note that it does not
matter whether we are at the first or last tab because
we cycle.

diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index 6ac7471..65fe919 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -1922,9 +1922,12 @@ bool GuiView::getStatus(FuncRequest const  cmd, 
FuncStatus  flag)
break;
 
case LFUN_BUFFER_NEXT:
-   case LFUN_BUFFER_PREVIOUS:
-   // FIXME: should we check is there is an previous or next 
buffer?
+   case LFUN_BUFFER_PREVIOUS: {
+   // because we cycle, it doesn't matter whether on first or last
+   if (d.currentTabWorkArea()-count() = 1)
+   enable = false;
break;
+   }
case LFUN_BUFFER_SWITCH:
// toggle on the current buffer, but do not toggle off
// the other ones (is that a good idea?)


[LyX/master] Simplify previous commit

2015-04-07 Thread Scott Kostyshak
commit dabb534a369efe529cd57be714005efd8e046610
Author: Scott Kostyshak skost...@lyx.org
Date:   Tue Apr 7 22:59:34 2015 -0400

Simplify previous commit

The brackets are not necessary.

diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index 65fe919..f94a709 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -1922,12 +1922,12 @@ bool GuiView::getStatus(FuncRequest const  cmd, 
FuncStatus  flag)
break;
 
case LFUN_BUFFER_NEXT:
-   case LFUN_BUFFER_PREVIOUS: {
+   case LFUN_BUFFER_NEXT:
+   case LFUN_BUFFER_PREVIOUS:
// because we cycle, it doesn't matter whether on first or last
if (d.currentTabWorkArea()-count() = 1)
enable = false;
break;
-   }
case LFUN_BUFFER_SWITCH:
// toggle on the current buffer, but do not toggle off
// the other ones (is that a good idea?)


[LyX/master] Correct typo from last commit

2015-04-07 Thread Scott Kostyshak
commit 2b77b2e8addbbfc72abab883b9c3e265a7991df8
Author: Scott Kostyshak skost...@lyx.org
Date:   Tue Apr 7 23:00:51 2015 -0400

Correct typo from last commit

diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index f94a709..e85d042 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -1922,7 +1922,6 @@ bool GuiView::getStatus(FuncRequest const  cmd, 
FuncStatus  flag)
break;
 
case LFUN_BUFFER_NEXT:
-   case LFUN_BUFFER_NEXT:
case LFUN_BUFFER_PREVIOUS:
// because we cycle, it doesn't matter whether on first or last
if (d.currentTabWorkArea()-count() = 1)


[LyX/master] Document buffer-view-cache in RELEASE-NOTES

2015-04-07 Thread Scott Kostyshak
commit 06729bf0bbc0c0b13075dfd71be9a429c56dd4de
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Tue Apr 7 03:03:46 2015 -0400

Document buffer-view-cache in RELEASE-NOTES

diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index a0180f3..f859e48 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -26,6 +26,8 @@ The following pref variables are obsoleted in 2.2:
 
 The following new LyX functions have been introduced in 2.2:
 
+- buffer-view-cache
+  Opens the last previewed output of the buffer, if it exists.
 
 
 The following LyX functions have been changed in 2.2:


[LyX/master] Continue compilation despite errors (#8739)

2015-04-07 Thread Scott Kostyshak
commit 03b17b5272e052f75161c85bf744165b1bad456c
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Tue Apr 7 02:55:59 2015 -0400

Continue compilation despite errors (#8739)

Now that we have the "Show Output Anyway" button (09700d5b),
it makes sense to continue compilation even if there is an error.

diff --git a/src/Converter.cpp b/src/Converter.cpp
index 0f97b73..3d3181a 100644
--- a/src/Converter.cpp
+++ b/src/Converter.cpp
@@ -653,8 +653,12 @@ bool Converters::runLaTeX(Buffer const & buffer, string 
const & command,
if (result & LaTeX::ERRORS)
buffer.bufferErrors(terr, errorList);
 
-   // check return value from latex.run().
-   if (result & LaTeX::NO_LOGFILE) {
+   if (!errorList.empty()) {
+ // We will show the LaTeX Errors GUI later which contains
+ // specific error messages so it would be repetitive to give
+ // e.g. the "finished with an error" dialog in addition.
+   }
+   else if (result & LaTeX::NO_LOGFILE) {
docstring const str =
bformat(_("LaTeX did not run successfully. "
   "Additionally, LyX could not 
locate "
@@ -666,7 +670,6 @@ bool Converters::runLaTeX(Buffer const & buffer, string 
const & command,
  "finished with an error. "
  "It is recommended you fix the cause of the 
external "
  "program's error (check the logs). "), 
from_utf8(command));
-   // FIXME: In LyX 2.3.0 the warning will be converted to an 
error.
Alert::error(_("LaTeX failed"), str);
} else if (result & LaTeX::NO_OUTPUT) {
Alert::warning(_("Output is empty"),
diff --git a/src/LaTeX.cpp b/src/LaTeX.cpp
index ce78b14..38a457d 100644
--- a/src/LaTeX.cpp
+++ b/src/LaTeX.cpp
@@ -240,13 +240,6 @@ int LaTeX::run(TeXErrors & terr)
scanres = scanLogFile(terr);
}
 
-   if (scanres & ERRORS) {
-   // We no longer run deleteFilesOnError() here
-   // because we now show a resulting PDF even if
-   // there was an error.
-   return scanres; // return on error
-   }
-
vector const bibtex_info = scanAuxFiles(aux_file);
if (!run_bibtex && bibtex_info_old != bibtex_info)
run_bibtex = true;
@@ -335,8 +328,6 @@ int LaTeX::run(TeXErrors & terr)
message(runMessage(count));
startscript();
scanres = scanLogFile(terr);
-   if (scanres & ERRORS)
-   return scanres; // return on error
 
// update the depedencies
deplog(head); // reads the latex log
@@ -407,8 +398,6 @@ int LaTeX::run(TeXErrors & terr)
message(runMessage(count));
startscript();
scanres = scanLogFile(terr);
-   if (scanres & ERRORS)
-   return scanres; // return on error
 
// keep this updated
head.update();


[LyX/master] Add getStatus check that >1 tab for switching

2015-04-07 Thread Scott Kostyshak
commit e26ac5c5506a7e37ac24e696aaa3b7b1e721dbcb
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Tue Apr 7 22:55:20 2015 -0400

Add getStatus check that >1 tab for switching

buffer-next and buffer-previous are now only enabled
if there is more than one tab. Note that it does not
matter whether we are at the first or last tab because
we cycle.

diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index 6ac7471..65fe919 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -1922,9 +1922,12 @@ bool GuiView::getStatus(FuncRequest const & cmd, 
FuncStatus & flag)
break;
 
case LFUN_BUFFER_NEXT:
-   case LFUN_BUFFER_PREVIOUS:
-   // FIXME: should we check is there is an previous or next 
buffer?
+   case LFUN_BUFFER_PREVIOUS: {
+   // because we cycle, it doesn't matter whether on first or last
+   if (d.currentTabWorkArea()->count() <= 1)
+   enable = false;
break;
+   }
case LFUN_BUFFER_SWITCH:
// toggle on the current buffer, but do not toggle off
// the other ones (is that a good idea?)


[LyX/master] Simplify previous commit

2015-04-07 Thread Scott Kostyshak
commit dabb534a369efe529cd57be714005efd8e046610
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Tue Apr 7 22:59:34 2015 -0400

Simplify previous commit

The brackets are not necessary.

diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index 65fe919..f94a709 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -1922,12 +1922,12 @@ bool GuiView::getStatus(FuncRequest const & cmd, 
FuncStatus & flag)
break;
 
case LFUN_BUFFER_NEXT:
-   case LFUN_BUFFER_PREVIOUS: {
+   case LFUN_BUFFER_NEXT:
+   case LFUN_BUFFER_PREVIOUS:
// because we cycle, it doesn't matter whether on first or last
if (d.currentTabWorkArea()->count() <= 1)
enable = false;
break;
-   }
case LFUN_BUFFER_SWITCH:
// toggle on the current buffer, but do not toggle off
// the other ones (is that a good idea?)


[LyX/master] Correct typo from last commit

2015-04-07 Thread Scott Kostyshak
commit 2b77b2e8addbbfc72abab883b9c3e265a7991df8
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Tue Apr 7 23:00:51 2015 -0400

Correct typo from last commit

diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index f94a709..e85d042 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -1922,7 +1922,6 @@ bool GuiView::getStatus(FuncRequest const & cmd, 
FuncStatus & flag)
break;
 
case LFUN_BUFFER_NEXT:
-   case LFUN_BUFFER_NEXT:
case LFUN_BUFFER_PREVIOUS:
// because we cycle, it doesn't matter whether on first or last
if (d.currentTabWorkArea()->count() <= 1)


[LyX/master] Button for showing PDF if compilation error

2015-04-04 Thread Scott Kostyshak
commit 09700d5b717baec2c34a9451ca13b09a1d47e330
Author: Scott Kostyshak skost...@lyx.org
Date:   Tue Mar 31 18:54:49 2015 -0400

Button for showing PDF if compilation error

Building on cd8be655, we still allow viewing a produced PDF even if
there were compilation errors. However, now the user must click the
Show Output Anyway button in the LaTeX Errors dialog. The reason
is that before, there was a chance that the user would not realize
there was an error (because the PDF would be shown over the error
dialog). The approach in this commit makes it more clear that there
is an error.

A new LFUN is introduced, LFUN_BUFFER_VIEW_CACHE. It is useful not
just for the implementation of the Show Output Anyway button, but
also to show the last compiled version of a document, which can save
time if a document takes a long time to compile (e.g. heavy use of
knitr).

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 10e6727..7022139 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -285,6 +285,10 @@ public:
/// we ran updateBuffer(), i.e., whether citation labels may need
/// to be updated.
mutable bool cite_labels_valid_;
+   /// these hold the file name and format, written to by Buffer::preview
+   /// and read from by LFUN_BUFFER_VIEW_CACHE.
+   FileName preview_file_;
+   string preview_format_;
 
mutable RefCache ref_cache_;
 
@@ -420,6 +424,8 @@ Buffer::Impl::Impl(Buffer * owner, FileName const  file, 
bool readonly_,
cite_labels_valid_ = cloned_buffer_-d-cite_labels_valid_;
unnamed = cloned_buffer_-d-unnamed;
internal_buffer = cloned_buffer_-d-internal_buffer;
+   preview_file_ = cloned_buffer_-d-preview_file_;
+   preview_format_ = cloned_buffer_-d-preview_format_;
 }
 
 
@@ -2420,6 +2426,10 @@ bool Buffer::getStatus(FuncRequest const  cmd, 
FuncStatus  flag)
enable = !isReadonly();
break;
 
+   case LFUN_BUFFER_VIEW_CACHE:
+   enable = (d-preview_file_).exists();
+   break;
+
default:
return false;
}
@@ -2759,6 +2769,12 @@ void Buffer::dispatch(FuncRequest const  func, 
DispatchResult  dr)
break;
}
 
+   case LFUN_BUFFER_VIEW_CACHE:
+   if (!formats.view(*this, d-preview_file_,
+ d-preview_format_))
+   dr.setMessage(_(Error viewing the output file.));
+   break;
+
default:
dispatched = false;
break;
@@ -4212,13 +4228,18 @@ Buffer::ExportStatus Buffer::preview(string const  
format, bool includeall) con
// (2) export with included children only
ExportStatus const status = doExport(format, true, false, result_file);
FileName const previewFile(result_file);
+
+   LATTEST (isClone());
+   d-cloned_buffer_-d-preview_file_ = previewFile;
+   d-cloned_buffer_-d-preview_format_ = format;
+
+   if (status != ExportSuccess)
+   return status;
if (previewFile.exists()) {
if (!formats.view(*this, previewFile, format))
return PreviewError;
-   else if (status == ExportSuccess)
-   return PreviewSuccess;
else
-   return status;
+   return PreviewSuccess;
}
else {
// Successful export but no output file?
diff --git a/src/FuncCode.h b/src/FuncCode.h
index 3bd0cd0..b590b38 100644
--- a/src/FuncCode.h
+++ b/src/FuncCode.h
@@ -459,6 +459,7 @@ enum FuncCode
LFUN_SPELLING_CONTINUOUSLY, // vfr, 20130324
LFUN_SEPARATOR_INSERT,  // ef 20140502
LFUN_SERVER_GET_STATISTICS, // brokenclock 20141010
+   LFUN_BUFFER_VIEW_CACHE, // skostysh 20150401
LFUN_LASTACTION // end of the table
 };
 
diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp
index 4ac1a0e..1ba2ef8 100644
--- a/src/LyXAction.cpp
+++ b/src/LyXAction.cpp
@@ -1578,6 +1578,17 @@ void LyXAction::init()
  */
{ LFUN_LAYOUT_RELOAD, layout-reload, NoInternal, Layout },
 /*!
+ * \var lyx::FuncCode lyx::LFUN_BUFFER_VIEW_CACHE
+ * \li Action: Opens the file that was created from last preview of this 
buffer.
+ * \li Notion: This LFUN is called by the Show Output Anyway button in the 
LaTeX
+ * Errors dialog. It can also be called by the user, which is 
useful
+ * if the document takes a long time to compile, and you just
+ * want to see the last previewed version.
+ * \li Syntax: buffer-view-cache
+ * \endvar
+ */
+   { LFUN_BUFFER_VIEW_CACHE, buffer-view-cache, ReadOnly, Buffer 
},
+/*!
  * \var lyx::FuncCode lyx::LFUN_TEXTCLASS_APPLY
  * \li Action: Sets the text class for the current buffer.
  * \li Syntax: textclass-apply TEXTCLASS
diff --git a/src

[LyX/master] Detect when an external command crashes

2015-04-04 Thread Scott Kostyshak
commit 7032b0374801d7e2621c221ce43f409855a901d6
Author: Scott Kostyshak skost...@lyx.org
Date:   Sat Apr 4 13:39:42 2015 -0400

Detect when an external command crashes

This fixes a situation where LyX did not detect that something went
wrong (that an external comman crashed) and reported that export was
successful. To reproduce, use the following version of LuaTeX (the
bug in LuaTeX causing the crash has since been fixed):
LuaTeX, Version beta-0.79.1 (TeX Live 2014) (rev 4971)
Then open FeynmanDiagrams.lyx and export with PDF (LuaTeX).

In the documentation [1] for QProcess::exitCode() it states:
This value is not valid unless exitStatus() returns NormalExit.

For more information, see:
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg185317.html

[1] http://doc.qt.io/qt-5/qprocess.html#exitCode

diff --git a/src/support/Systemcall.cpp b/src/support/Systemcall.cpp
index 9327613..2f277f6 100644
--- a/src/support/Systemcall.cpp
+++ b/src/support/Systemcall.cpp
@@ -610,6 +610,10 @@ int SystemcallPrivate::exitCode()
if (!process_)
return -1;
 
+   // From Qt's documentation, in regards to QProcess::exitCode(),
+   // This value is not valid unless exitStatus() returns NormalExit
+   if (process_-exitStatus() != QProcess::NormalExit)
+   return -1;
return process_-exitCode();
 }
 


[LyX/master] Simplify code

2015-04-04 Thread Scott Kostyshak
commit 90772a01e78ff7de2dd27b9284b99b2085542225
Author: Scott Kostyshak skost...@lyx.org
Date:   Sat Apr 4 14:56:29 2015 -0400

Simplify code

diff --git a/src/support/Systemcall.cpp b/src/support/Systemcall.cpp
index 2f277f6..28cbdc8 100644
--- a/src/support/Systemcall.cpp
+++ b/src/support/Systemcall.cpp
@@ -607,13 +607,11 @@ QString SystemcallPrivate::exitStatusMessage() const
 
 int SystemcallPrivate::exitCode()
 {
-   if (!process_)
-   return -1;
-
// From Qt's documentation, in regards to QProcess::exitCode(),
// This value is not valid unless exitStatus() returns NormalExit
-   if (process_-exitStatus() != QProcess::NormalExit)
+   if (!process_ || process_-exitStatus() != QProcess::NormalExit)
return -1;
+
return process_-exitCode();
 }
 


[LyX/master] Button for showing PDF if compilation error

2015-04-04 Thread Scott Kostyshak
commit 09700d5b717baec2c34a9451ca13b09a1d47e330
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Tue Mar 31 18:54:49 2015 -0400

Button for showing PDF if compilation error

Building on cd8be655, we still allow viewing a produced PDF even if
there were compilation errors. However, now the user must click the
"Show Output Anyway" button in the LaTeX Errors dialog. The reason
is that before, there was a chance that the user would not realize
there was an error (because the PDF would be shown over the error
dialog). The approach in this commit makes it more clear that there
is an error.

A new LFUN is introduced, LFUN_BUFFER_VIEW_CACHE. It is useful not
just for the implementation of the "Show Output Anyway" button, but
also to show the last compiled version of a document, which can save
time if a document takes a long time to compile (e.g. heavy use of
knitr).

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 10e6727..7022139 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -285,6 +285,10 @@ public:
/// we ran updateBuffer(), i.e., whether citation labels may need
/// to be updated.
mutable bool cite_labels_valid_;
+   /// these hold the file name and format, written to by Buffer::preview
+   /// and read from by LFUN_BUFFER_VIEW_CACHE.
+   FileName preview_file_;
+   string preview_format_;
 
mutable RefCache ref_cache_;
 
@@ -420,6 +424,8 @@ Buffer::Impl::Impl(Buffer * owner, FileName const & file, 
bool readonly_,
cite_labels_valid_ = cloned_buffer_->d->cite_labels_valid_;
unnamed = cloned_buffer_->d->unnamed;
internal_buffer = cloned_buffer_->d->internal_buffer;
+   preview_file_ = cloned_buffer_->d->preview_file_;
+   preview_format_ = cloned_buffer_->d->preview_format_;
 }
 
 
@@ -2420,6 +2426,10 @@ bool Buffer::getStatus(FuncRequest const & cmd, 
FuncStatus & flag)
enable = !isReadonly();
break;
 
+   case LFUN_BUFFER_VIEW_CACHE:
+   enable = (d->preview_file_).exists();
+   break;
+
default:
return false;
}
@@ -2759,6 +2769,12 @@ void Buffer::dispatch(FuncRequest const & func, 
DispatchResult & dr)
break;
}
 
+   case LFUN_BUFFER_VIEW_CACHE:
+   if (!formats.view(*this, d->preview_file_,
+ d->preview_format_))
+   dr.setMessage(_("Error viewing the output file."));
+   break;
+
default:
dispatched = false;
break;
@@ -4212,13 +4228,18 @@ Buffer::ExportStatus Buffer::preview(string const & 
format, bool includeall) con
// (2) export with included children only
ExportStatus const status = doExport(format, true, false, result_file);
FileName const previewFile(result_file);
+
+   LATTEST (isClone());
+   d->cloned_buffer_->d->preview_file_ = previewFile;
+   d->cloned_buffer_->d->preview_format_ = format;
+
+   if (status != ExportSuccess)
+   return status;
if (previewFile.exists()) {
if (!formats.view(*this, previewFile, format))
return PreviewError;
-   else if (status == ExportSuccess)
-   return PreviewSuccess;
else
-   return status;
+   return PreviewSuccess;
}
else {
// Successful export but no output file?
diff --git a/src/FuncCode.h b/src/FuncCode.h
index 3bd0cd0..b590b38 100644
--- a/src/FuncCode.h
+++ b/src/FuncCode.h
@@ -459,6 +459,7 @@ enum FuncCode
LFUN_SPELLING_CONTINUOUSLY, // vfr, 20130324
LFUN_SEPARATOR_INSERT,  // ef 20140502
LFUN_SERVER_GET_STATISTICS, // brokenclock 20141010
+   LFUN_BUFFER_VIEW_CACHE, // skostysh 20150401
LFUN_LASTACTION // end of the table
 };
 
diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp
index 4ac1a0e..1ba2ef8 100644
--- a/src/LyXAction.cpp
+++ b/src/LyXAction.cpp
@@ -1578,6 +1578,17 @@ void LyXAction::init()
  */
{ LFUN_LAYOUT_RELOAD, "layout-reload", NoInternal, Layout },
 /*!
+ * \var lyx::FuncCode lyx::LFUN_BUFFER_VIEW_CACHE
+ * \li Action: Opens the file that was created from last preview of this 
buffer.
+ * \li Notion: This LFUN is called by the "Show Output Anyway" button in the 
LaTeX
+ * Errors dialog. It can also be called by the user, which is 
useful
+ * if the document takes a long time to compile, and you just
+ * want to see the last previewed version.
+ * \li Syntax: buffer-view-cache
+ * \endvar
+ */
+   { LFUN_BUFFER_VIEW_CACHE, "buffer-view-cache", ReadOnly, Buf

[LyX/master] Detect when an external command crashes

2015-04-04 Thread Scott Kostyshak
commit 7032b0374801d7e2621c221ce43f409855a901d6
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Sat Apr 4 13:39:42 2015 -0400

Detect when an external command crashes

This fixes a situation where LyX did not detect that something went
wrong (that an external comman crashed) and reported that export was
successful. To reproduce, use the following version of LuaTeX (the
bug in LuaTeX causing the crash has since been fixed):
LuaTeX, Version beta-0.79.1 (TeX Live 2014) (rev 4971)
Then open FeynmanDiagrams.lyx and export with PDF (LuaTeX).

In the documentation [1] for QProcess::exitCode() it states:
"This value is not valid unless exitStatus() returns NormalExit."

For more information, see:
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg185317.html

[1] http://doc.qt.io/qt-5/qprocess.html#exitCode

diff --git a/src/support/Systemcall.cpp b/src/support/Systemcall.cpp
index 9327613..2f277f6 100644
--- a/src/support/Systemcall.cpp
+++ b/src/support/Systemcall.cpp
@@ -610,6 +610,10 @@ int SystemcallPrivate::exitCode()
if (!process_)
return -1;
 
+   // From Qt's documentation, in regards to QProcess::exitCode(),
+   // "This value is not valid unless exitStatus() returns NormalExit"
+   if (process_->exitStatus() != QProcess::NormalExit)
+   return -1;
return process_->exitCode();
 }
 


[LyX/master] Simplify code

2015-04-04 Thread Scott Kostyshak
commit 90772a01e78ff7de2dd27b9284b99b2085542225
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Sat Apr 4 14:56:29 2015 -0400

Simplify code

diff --git a/src/support/Systemcall.cpp b/src/support/Systemcall.cpp
index 2f277f6..28cbdc8 100644
--- a/src/support/Systemcall.cpp
+++ b/src/support/Systemcall.cpp
@@ -607,13 +607,11 @@ QString SystemcallPrivate::exitStatusMessage() const
 
 int SystemcallPrivate::exitCode()
 {
-   if (!process_)
-   return -1;
-
// From Qt's documentation, in regards to QProcess::exitCode(),
// "This value is not valid unless exitStatus() returns NormalExit"
-   if (process_->exitStatus() != QProcess::NormalExit)
+   if (!process_ || process_->exitStatus() != QProcess::NormalExit)
return -1;
+
return process_->exitCode();
 }
 


[LyX/master] Fix selection at borders of insets (#9487)

2015-04-03 Thread Scott Kostyshak
commit 032da815fabf5478b447cc5b093ca2a44d72ae2f
Author: Scott Kostyshak skost...@lyx.org
Date:   Tue Mar 31 12:53:23 2015 -0400

Fix selection at borders of insets (#9487)

When at the last position in an inset, selecting to the right
should select the entire inset. This only worked if there was
already a selection (i.e. the selection was started not at the
boundary).

The behavior of this bug was changed by commit 73a7bf9d.  Before
that commit, if at the last position of an inset you select to
the right, nothing is selected but the selection is set. If you
select once more to the right, because the selection is set the
needsUpdate condition is satisfied so the whole inset is selected.

Note that everything here applies also to first position of an
inset and selecting to the left. By selecting, I am referring
to LFUN_{CHAR,WORD}_{FORWARD,BACKWARD}_SELECT.

diff --git a/src/Text3.cpp b/src/Text3.cpp
index 517998b..af15c31 100644
--- a/src/Text3.cpp
+++ b/src/Text3.cpp
@@ -605,13 +605,14 @@ void Text::dispatch(Cursor  cur, FuncRequest  cmd)
break;
 
case LFUN_CHAR_FORWARD:
-   case LFUN_CHAR_FORWARD_SELECT:
+   case LFUN_CHAR_FORWARD_SELECT: {
//LYXERR0( LFUN_CHAR_FORWARD[SEL]:\n  cur);
needsUpdate |= cur.selHandle(act == LFUN_CHAR_FORWARD_SELECT);
-   needsUpdate |= cursorForward(cur);
+   bool const cur_moved = cursorForward(cur);
+   needsUpdate |= cur_moved;
 
-   if (!needsUpdate  oldTopSlice == cur.top()
-cur.boundary() == oldBoundary) {
+   if (!cur_moved  oldTopSlice == cur.top()
+   cur.boundary() == oldBoundary) {
cur.undispatched();
cmd = FuncRequest(LFUN_FINISHED_FORWARD);
 
@@ -630,15 +631,17 @@ void Text::dispatch(Cursor  cur, FuncRequest  cmd)
}
}
break;
+   }
 
case LFUN_CHAR_BACKWARD:
-   case LFUN_CHAR_BACKWARD_SELECT:
+   case LFUN_CHAR_BACKWARD_SELECT: {
//lyxerr  handle LFUN_CHAR_BACKWARD[_SELECT]:\n  cur  
endl;
needsUpdate |= cur.selHandle(act == LFUN_CHAR_BACKWARD_SELECT);
-   needsUpdate |= cursorBackward(cur);
+   bool const cur_moved = cursorBackward(cur);
+   needsUpdate |= cur_moved;
 
-   if (!needsUpdate  oldTopSlice == cur.top()
-cur.boundary() == oldBoundary) {
+   if (!cur_moved  oldTopSlice == cur.top()
+   cur.boundary() == oldBoundary) {
cur.undispatched();
cmd = FuncRequest(LFUN_FINISHED_BACKWARD);
 
@@ -657,14 +660,16 @@ void Text::dispatch(Cursor  cur, FuncRequest  cmd)
}
}
break;
+   }
 
case LFUN_CHAR_LEFT:
case LFUN_CHAR_LEFT_SELECT:
if (lyxrc.visual_cursor) {
needsUpdate |= cur.selHandle(act == 
LFUN_CHAR_LEFT_SELECT);
-   needsUpdate |= cursorVisLeft(cur);
-   if (!needsUpdate  oldTopSlice == cur.top()
-cur.boundary() == oldBoundary) {
+   bool const cur_moved = cursorVisLeft(cur);
+   needsUpdate |= cur_moved;
+   if (!cur_moved  oldTopSlice == cur.top()
+   cur.boundary() == oldBoundary) {
cur.undispatched();
cmd = FuncRequest(LFUN_FINISHED_LEFT);
}
@@ -685,9 +690,10 @@ void Text::dispatch(Cursor  cur, FuncRequest  cmd)
case LFUN_CHAR_RIGHT_SELECT:
if (lyxrc.visual_cursor) {
needsUpdate |= cur.selHandle(cmd.action() == 
LFUN_CHAR_RIGHT_SELECT);
-   needsUpdate |= cursorVisRight(cur);
-   if (!needsUpdate  oldTopSlice == cur.top()
-cur.boundary() == oldBoundary) {
+   bool const cur_moved = cursorVisRight(cur);
+   needsUpdate |= cur_moved;
+   if (!cur_moved  oldTopSlice == cur.top()
+   cur.boundary() == oldBoundary) {
cur.undispatched();
cmd = FuncRequest(LFUN_FINISHED_RIGHT);
}
@@ -796,9 +802,10 @@ void Text::dispatch(Cursor  cur, FuncRequest  cmd)
case LFUN_WORD_RIGHT_SELECT:
if (lyxrc.visual_cursor) {
needsUpdate |= cur.selHandle(cmd.action() == 
LFUN_WORD_RIGHT_SELECT);
-   needsUpdate |= cursorVisRightOneWord(cur);
-   if (!needsUpdate

[LyX/master] Fix selection at borders of insets (#9487)

2015-04-03 Thread Scott Kostyshak
commit 032da815fabf5478b447cc5b093ca2a44d72ae2f
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Tue Mar 31 12:53:23 2015 -0400

Fix selection at borders of insets (#9487)

When at the last position in an inset, selecting to the right
should select the entire inset. This only worked if there was
already a selection (i.e. the selection was started not at the
boundary).

The behavior of this bug was changed by commit 73a7bf9d.  Before
that commit, if at the last position of an inset you select to
the right, nothing is selected but the selection is set. If you
select once more to the right, because the selection is set the
needsUpdate condition is satisfied so the whole inset is selected.

Note that everything here applies also to "first position of an
inset" and selecting to the left. By "selecting", I am referring
to LFUN_{CHAR,WORD}_{FORWARD,BACKWARD}_SELECT.

diff --git a/src/Text3.cpp b/src/Text3.cpp
index 517998b..af15c31 100644
--- a/src/Text3.cpp
+++ b/src/Text3.cpp
@@ -605,13 +605,14 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
break;
 
case LFUN_CHAR_FORWARD:
-   case LFUN_CHAR_FORWARD_SELECT:
+   case LFUN_CHAR_FORWARD_SELECT: {
//LYXERR0(" LFUN_CHAR_FORWARD[SEL]:\n" << cur);
needsUpdate |= cur.selHandle(act == LFUN_CHAR_FORWARD_SELECT);
-   needsUpdate |= cursorForward(cur);
+   bool const cur_moved = cursorForward(cur);
+   needsUpdate |= cur_moved;
 
-   if (!needsUpdate && oldTopSlice == cur.top()
-   && cur.boundary() == oldBoundary) {
+   if (!cur_moved && oldTopSlice == cur.top()
+  && cur.boundary() == oldBoundary) {
cur.undispatched();
cmd = FuncRequest(LFUN_FINISHED_FORWARD);
 
@@ -630,15 +631,17 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
}
}
break;
+   }
 
case LFUN_CHAR_BACKWARD:
-   case LFUN_CHAR_BACKWARD_SELECT:
+   case LFUN_CHAR_BACKWARD_SELECT: {
//lyxerr << "handle LFUN_CHAR_BACKWARD[_SELECT]:\n" << cur << 
endl;
needsUpdate |= cur.selHandle(act == LFUN_CHAR_BACKWARD_SELECT);
-   needsUpdate |= cursorBackward(cur);
+   bool const cur_moved = cursorBackward(cur);
+   needsUpdate |= cur_moved;
 
-   if (!needsUpdate && oldTopSlice == cur.top()
-   && cur.boundary() == oldBoundary) {
+   if (!cur_moved && oldTopSlice == cur.top()
+  && cur.boundary() == oldBoundary) {
cur.undispatched();
cmd = FuncRequest(LFUN_FINISHED_BACKWARD);
 
@@ -657,14 +660,16 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
}
}
break;
+   }
 
case LFUN_CHAR_LEFT:
case LFUN_CHAR_LEFT_SELECT:
if (lyxrc.visual_cursor) {
needsUpdate |= cur.selHandle(act == 
LFUN_CHAR_LEFT_SELECT);
-   needsUpdate |= cursorVisLeft(cur);
-   if (!needsUpdate && oldTopSlice == cur.top()
-   && cur.boundary() == oldBoundary) {
+   bool const cur_moved = cursorVisLeft(cur);
+   needsUpdate |= cur_moved;
+   if (!cur_moved && oldTopSlice == cur.top()
+  && cur.boundary() == oldBoundary) {
cur.undispatched();
cmd = FuncRequest(LFUN_FINISHED_LEFT);
}
@@ -685,9 +690,10 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
case LFUN_CHAR_RIGHT_SELECT:
if (lyxrc.visual_cursor) {
needsUpdate |= cur.selHandle(cmd.action() == 
LFUN_CHAR_RIGHT_SELECT);
-   needsUpdate |= cursorVisRight(cur);
-   if (!needsUpdate && oldTopSlice == cur.top()
-   && cur.boundary() == oldBoundary) {
+   bool const cur_moved = cursorVisRight(cur);
+   needsUpdate |= cur_moved;
+   if (!cur_moved && oldTopSlice == cur.top()
+  && cur.boundary() == oldBoundary) {
cur.undispatched();
cmd = FuncRequest(LFUN_FINISHED_RIGHT);
}
@@ -796,9 +802,10 @@ void Text::dispatch(Cursor & 

[LyX/master] Remove an outdated comment

2015-03-20 Thread Scott Kostyshak
commit 4f0593f91b1b61a196b88975310e426413eccd67
Author: Scott Kostyshak skost...@lyx.org
Date:   Fri Feb 20 17:31:53 2015 -0500

Remove an outdated comment

LaTeX::deleteFilesOnError is no longer a dummy function.

This comment was interoduced with the first version of this
function, at e6d063c4.

diff --git a/src/LaTeX.cpp b/src/LaTeX.cpp
index b9f7212..22e32d3 100644
--- a/src/LaTeX.cpp
+++ b/src/LaTeX.cpp
@@ -110,8 +110,6 @@ LaTeX::LaTeX(string const  latex, OutputParams const  rp,
 
 void LaTeX::deleteFilesOnError() const
 {
-   // currently just a dummy function.
-
// What files do we have to delete?
 
// This will at least make latex do all the runs


[LyX/master] Check exit code of LaTeX process in LaTeX::run

2015-03-20 Thread Scott Kostyshak
commit 1dbf0e5aab732bdba4eed1af2866c357bc30a526
Author: Scott Kostyshak skost...@lyx.org
Date:   Fri Mar 20 00:40:01 2015 -0400

Check exit code of LaTeX process in LaTeX::run

Systemcall::startscript returns the exit code of the LaTeX command
that is run, but the return value was not being checked by
LaTeX::run.  Instead, we relied on parsing log files. However, this
parsing is not perfect.

The return value is now checked and if the exit code of the command
is non-zero, an enum value is added to the return and the user is
notified of the error.

At a higher level, if the LaTeX command returns a non-zero exit code,
in the GUI a message such as
Error while exporting format: PDF (LuaTeX) will be given instead of
Successful preview of format: PDF (LuaTeX).

When run on the commandline, lyx -e lualatex example.lyx
will give Error: LaTeX failed and a non-zero exit code
where before it gave a zero exit code.

A real example of the bug this commit fixes is LyX's (as of this commit)
ACM-sigplan.lyx template.
Before this commit:
  $ lyx -e pdf2 ACM-sigplan.lyx
  [...snip...]
  support/Systemcall.cpp (288): Systemcall: 'pdflatex  ACM-sigplan.tex'
  finished with exit code 1
  $ echo $?
  0
Starting with this commit:
  $ mylyx master -e pdf2 ACM-sigplan.lyx
  support/Systemcall.cpp (288): Systemcall: 'pdflatex  ACM-sigplan.tex'
  finished with exit code 1
  Error: LaTeX failed
  
  LaTeX did not run successfully. The command that was run exited with
  error.
  $ echo $?
  1

diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index 258d32b..6e9655e 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -52,6 +52,8 @@ Changes with respect to external programs and libraries in 
2.2:
   run LyX against Qt 4.8.x. On Windows, Qt 4.8.5 suffers from a bug that 
   breaks the use of shortcuts, so on Windows Qt 4.8.4 is advised.
 
+- LyX now gives an error if the underlying LaTeX command exited with error.
+
 
 Known issues in version 2.2.0
 -
diff --git a/src/Converter.cpp b/src/Converter.cpp
index b78ee90..933e2f6 100644
--- a/src/Converter.cpp
+++ b/src/Converter.cpp
@@ -660,6 +660,14 @@ bool Converters::runLaTeX(Buffer const  buffer, string 
const  command,
   Additionally, LyX could not 
locate 
   the LaTeX log %1$s.), 
from_utf8(name));
Alert::error(_(LaTeX failed), str);
+   } else if (result  LaTeX::NONZERO_ERROR) {
+   docstring const str =
+   bformat(_( The external program\n%1$s\n
+ finished with an error. 
+ It is recommended you fix the cause of the 
external 
+ program's error (check the logs). ), 
from_utf8(command));
+   // FIXME: In LyX 2.3.0 the warning will be converted to an 
error.
+   Alert::error(_(LaTeX failed), str);
} else if (result  LaTeX::NO_OUTPUT) {
Alert::warning(_(Output is empty),
   _(No output file was generated.));
diff --git a/src/LaTeX.cpp b/src/LaTeX.cpp
index 22e32d3..588ca52 100644
--- a/src/LaTeX.cpp
+++ b/src/LaTeX.cpp
@@ -226,7 +226,8 @@ int LaTeX::run(TeXErrors  terr)
LYXERR(Debug::LATEX, Run #  count);
message(runMessage(count));
 
-   startscript();
+   int const exit_code = startscript();
+
scanres = scanLogFile(terr);
if (scanres  ERROR_RERUN) {
LYXERR(Debug::LATEX, Rerunning LaTeX);
@@ -422,6 +423,7 @@ int LaTeX::run(TeXErrors  terr)
 
// Write the dependencies to file.
head.write(depfile);
+
if (scanres  NO_OUTPUT) {
// A previous run could have left a PDF and since
// no PDF is created if NO_OUTPUT, we remove any
@@ -431,6 +433,10 @@ int LaTeX::run(TeXErrors  terr)
// be the same so any lingering PDF will be viewed.
deleteFilesOnError();
}
+
+   if (exit_code)
+   scanres |= NONZERO_ERROR;
+
LYXERR(Debug::LATEX, Done.);
return scanres;
 }
diff --git a/src/LaTeX.h b/src/LaTeX.h
index 615d974..7fa6798 100644
--- a/src/LaTeX.h
+++ b/src/LaTeX.h
@@ -138,10 +138,12 @@ public:
///
BIBTEX_ERROR = 16384,
///
+   NONZERO_ERROR = 32768, // the command exited with nonzero status
+   ///
//FIXME: BIBTEX_ERROR has been removed from ERRORS for now, 
since users were irritated
//   about those errors which prevented compilation of 
previously compiling documents.
//   Think about a gentle transfer to BibTeX error 
reporting.
-   ERRORS = TEX_ERROR + LATEX_ERROR

[LyX/master] Export/view a PDF even if error

2015-03-20 Thread Scott Kostyshak
commit cd8be655f1895957fb169cdf361297d9ecc40ec9
Author: Scott Kostyshak skost...@lyx.org
Date:   Wed Mar 18 16:51:12 2015 -0400

Export/view a PDF even if error

A PDF is often still produced after a LaTeX error.

If there was an error when exporting a PDF, we now give an error
and the PDF (if it exists), where before we gave the error and
not the PDF. The GUI and command line behaviors are consistent:
in the GUI an error is given and the PDF is viewed; on the
command line, a non-zero exit code is given and a PDF is created.

This also solves what was in my mind an inconsistency: if the user
updated a document and there was an error, the resulting
PDF would be shown; but if the user viewed a document and there
was an error, the document would not be shown.

Note that this applies to all output formats, not just PDF.

For discussion, see:
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg186454.html

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index f9da416..e045e01 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -4119,12 +4119,10 @@ Buffer::ExportStatus Buffer::doExport(string const  
target, bool put_in_tempdir
d-cloned_buffer_-d-errorLists[error_type] = 
d-errorLists[error_type];
}
 
-   if (!success)
-   return ExportConverterError;
 
if (put_in_tempdir) {
result_file = tmp_result_file.absFileName();
-   return ExportSuccess;
+   return success ? ExportSuccess : ExportConverterError;
}
 
if (dest_filename.empty())
@@ -4189,7 +4187,7 @@ Buffer::ExportStatus Buffer::doExport(string const  
target, bool put_in_tempdir
formats.prettyName(format)));
}
 
-   return ExportSuccess;
+   return success ? ExportSuccess : ExportConverterError;
 }
 
 
@@ -4214,11 +4212,10 @@ Buffer::ExportStatus Buffer::preview(string const  
format, bool includeall) con
}
// (2) export with included children only
ExportStatus const status = doExport(format, true, false, result_file);
-   if (status != ExportSuccess)
-   return status;
-   if (!formats.view(*this, FileName(result_file), format))
+   FileName const previewFile(result_file);
+   if (previewFile.exists()  !formats.view(*this, previewFile, format))
return PreviewError;
-   return PreviewSuccess;
+   return (status == ExportSuccess) ? PreviewSuccess : status;
 }
 
 
diff --git a/src/LaTeX.cpp b/src/LaTeX.cpp
index e4f8b4b..ed59181 100644
--- a/src/LaTeX.cpp
+++ b/src/LaTeX.cpp
@@ -110,6 +110,10 @@ LaTeX::LaTeX(string const  latex, OutputParams const  rp,
 
 void LaTeX::deleteFilesOnError() const
 {
+   // Note that we do not always call this function when there is an error.
+   // For example, if there is an error but an output file is produced we
+   // still would like to output (export/view) the file.
+
// What files do we have to delete?
 
// This will at least make latex do all the runs
@@ -236,7 +240,9 @@ int LaTeX::run(TeXErrors  terr)
}
 
if (scanres  ERRORS) {
-   deleteFilesOnError();
+   // We no longer run deleteFilesOnError() here
+   // because we now show a resulting PDF even if
+   // there was an error.
return scanres; // return on error
}
 


[LyX/master] Remove output file in temporary folder on error

2015-03-20 Thread Scott Kostyshak
commit 2bfbf75eedc12817e5ee35603861067c68cedb44
Author: Scott Kostyshak skost...@lyx.org
Date:   Fri Mar 20 02:03:51 2015 -0400

Remove output file in temporary folder on error

This commit solves two issues:

(1) A PDF from a previous run could have been the result of a command
that exited with error (e.g. sometimes pdflatex still produces a PDF if
it exits with error). If the View button were clicked a second time
without changing the .lyx file, then the checksum of the .tex file would
not have changed so LyX would show the PDF (which was created from the
first run that exited with error), and this time LyX would not report
the error (because the parsing of the logs only happens when the .tex
file is compiled).

(2) A myfile.tex that results in no output does not yield a myfile.pdf.
Thus, Any myfile.pdf in the temporary directory will not be overwritten.
Before this commit, the following scenario was possible: LyX runs
pdflatex which processes myfile.tex and no error is given so LyX opens
myfile.pdf. However, it could have been the scenario that pdflatex did
not exit with error and did not create myfile.pdf, in which case
whichever myfile.pdf is being shown is not correct. To see this bug in
action, start a new document, type abc, view the PDF, delete abc,
view the PDF (this correctly gives an error that empty output was
created), view the PDF again (this does not give an error because the
checksum has not changed). The PDF shown will contain abc.

Note that the above also applies to DVI files and that the fix is
general.

diff --git a/src/LaTeX.cpp b/src/LaTeX.cpp
index e787e1a..b9f7212 100644
--- a/src/LaTeX.cpp
+++ b/src/LaTeX.cpp
@@ -142,6 +142,9 @@ void LaTeX::deleteFilesOnError() const
// Also remove the aux file
FileName const aux(changeExtension(file.absFileName(), .aux));
aux.removeFile();
+
+   // Remove the output file, which is often generated even if error
+   output_file.removeFile();
 }
 
 
@@ -421,6 +424,15 @@ int LaTeX::run(TeXErrors  terr)
 
// Write the dependencies to file.
head.write(depfile);
+   if (scanres  NO_OUTPUT) {
+   // A previous run could have left a PDF and since
+   // no PDF is created if NO_OUTPUT, we remove any
+   // existing PDF and temporary files so that an
+   // incorrect PDF is not displayed, which could otherwise
+   // happen if View is run again because the checksum will
+   // be the same so any lingering PDF will be viewed.
+   deleteFilesOnError();
+   }
LYXERR(Debug::LATEX, Done.);
return scanres;
 }


[LyX/master] Allow cloned buffers to give alerts in runLaTeX()

2015-03-20 Thread Scott Kostyshak
commit f74b2b79c7925454ba01b42bbd30c64f0ab30d31
Author: Scott Kostyshak skost...@lyx.org
Date:   Fri Feb 20 17:45:36 2015 -0500

Allow cloned buffers to give alerts in runLaTeX()

This was disabled in 2009 in bea0925f but it is now safe.

From Richard:
I am pretty sure that all the work that Peter Kümmel did with the
InGuiThread classes dealt with this issue.

diff --git a/src/Converter.cpp b/src/Converter.cpp
index a00b0f4..b78ee90 100644
--- a/src/Converter.cpp
+++ b/src/Converter.cpp
@@ -654,13 +654,13 @@ bool Converters::runLaTeX(Buffer const  buffer, string 
const  command,
buffer.bufferErrors(terr, errorList);
 
// check return value from latex.run().
-   if ((result  LaTeX::NO_LOGFILE)  !buffer.isClone()) {
+   if (result  LaTeX::NO_LOGFILE) {
docstring const str =
bformat(_(LaTeX did not run successfully. 
   Additionally, LyX could not 
locate 
   the LaTeX log %1$s.), 
from_utf8(name));
Alert::error(_(LaTeX failed), str);
-   } else if ((result  LaTeX::NO_OUTPUT)  !buffer.isClone()) {
+   } else if (result  LaTeX::NO_OUTPUT) {
Alert::warning(_(Output is empty),
   _(No output file was generated.));
}


[LyX/master] Assert if successful export but no output file

2015-03-20 Thread Scott Kostyshak
commit 74160640337b63b1fb21c9690289f0ebb29c0820
Author: Scott Kostyshak skost...@lyx.org
Date:   Fri Mar 20 00:13:50 2015 -0400

Assert if successful export but no output file

If LyX thinks the export was successful but no output file was
produced for preview, then something is wrong (most likely LyX
did not detect an error that occurred during export).

Also clean up some logic.

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index e045e01..dd18db2 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -4213,9 +4213,21 @@ Buffer::ExportStatus Buffer::preview(string const  
format, bool includeall) con
// (2) export with included children only
ExportStatus const status = doExport(format, true, false, result_file);
FileName const previewFile(result_file);
-   if (previewFile.exists()  !formats.view(*this, previewFile, format))
-   return PreviewError;
-   return (status == ExportSuccess) ? PreviewSuccess : status;
+   if (previewFile.exists()) {
+   if (!formats.view(*this, previewFile, format))
+   return PreviewError;
+   else if (status == ExportSuccess)
+   return PreviewSuccess;
+   else
+   return status;
+   }
+   else {
+   // Successful export but no output file?
+   // Probably a bug in error detection.
+   LATTEST (status != ExportSuccess);
+
+   return status;
+   }
 }
 
 
diff --git a/src/Buffer.h b/src/Buffer.h
index 9ff7752..05cf8aa 100644
--- a/src/Buffer.h
+++ b/src/Buffer.h
@@ -134,7 +134,10 @@ public:
ExportTexPathHasSpaces,
ExportConverterError,
// preview
+   // Implies ExportSuccess.
PreviewSuccess,
+   // The exported file exists but there was an error when opening
+   // it in a viewer.
PreviewError
};
 


[LyX/master] Clarify message about an empty file

2015-03-20 Thread Scott Kostyshak
commit 6343d9941a63dbf788516eb325e589f70f06c6f1
Author: Scott Kostyshak skost...@lyx.org
Date:   Sat Feb 21 23:46:42 2015 -0500

Clarify message about an empty file

When empty output is generated, no PDF is produced. The previous
message made it seem like an empty PDF was produced.

diff --git a/src/Converter.cpp b/src/Converter.cpp
index 4fa740e..a00b0f4 100644
--- a/src/Converter.cpp
+++ b/src/Converter.cpp
@@ -662,7 +662,7 @@ bool Converters::runLaTeX(Buffer const  buffer, string 
const  command,
Alert::error(_(LaTeX failed), str);
} else if ((result  LaTeX::NO_OUTPUT)  !buffer.isClone()) {
Alert::warning(_(Output is empty),
-  _(An empty output file was generated.));
+  _(No output file was generated.));
}
 
 


[LyX/master] Improve log scanner to correctly report error

2015-03-20 Thread Scott Kostyshak
commit 0a6120cb7f940bc010efa9f2873afaeee6381a9e
Author: Scott Kostyshak skost...@lyx.org
Date:   Sat Feb 21 00:00:51 2015 -0500

Improve log scanner to correctly report error

When scanning the LaTeX log, previously we only looked ahead 10 lines
after a ! line and if we did not find a line number we did not count
an error. This lead to the problem that templates/ACM-sigplan.lyx was
showing a successful export and the PDF was shown (it is still
created despite the error). Now that the exit code of the latex
command is checked (as of the previous commit), an error is correctly
given, but by parsing the log better with this commit, a more
informative error is given.

Increasing the look-ahead to 15 lines leads to correct parsing of
the ACM-sigplan log. The excerpt in the log file where there are more
than 10 lines in-between the ! line and the line number is below:

! Undefined control sequence.
\@toappear ...ent http://dx.doi.org/10.1145/\@doi

argument ...n is removed.]\par \else \@toappear
  \fi \if \@reprint
\noinden...

\@begin@tempboxa ...mpboxa #1{\color@begingroup #2
  \color@endgroup }\def
\wid...

\@iiiparbox ...tempdima \@parboxrestore #5\@@par }
  \ifx \relax #2\else
\setle...

\@copyrightspace ...planconf@finalpage}.\par \fi }
  }\end@float
\maketitle ... \@copyrightwanted \@copyrightspace
  \fi
l.34 \maketitle

Another example is posted here:

http://tex.stackexchange.com/questions/231655/lyx-cannot-output-to-pdflatex-for-a-specific-file

diff --git a/src/LaTeX.cpp b/src/LaTeX.cpp
index 588ca52..e4f8b4b 100644
--- a/src/LaTeX.cpp
+++ b/src/LaTeX.cpp
@@ -825,7 +825,10 @@ int LaTeX::scanLogFile(TeXErrors  terr)
if (!getline(ifs, tmp))
break;
tmp = rtrim(tmp, \r);
-   if (++count  10)
+   // 15 is somewhat arbitrarily chosen, based on 
practice.
+   // We used 10 for 14 years and increased it to 
15 when we
+   // saw one case.
+   if (++count  15)
break;
} while (!prefixIs(tmp, l.));
if (prefixIs(tmp, l.)) {


[LyX/master] Allow cloned buffers to give alerts in runLaTeX()

2015-03-20 Thread Scott Kostyshak
commit f74b2b79c7925454ba01b42bbd30c64f0ab30d31
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Fri Feb 20 17:45:36 2015 -0500

Allow cloned buffers to give alerts in runLaTeX()

This was disabled in 2009 in bea0925f but it is now safe.

From Richard:
"I am pretty sure that all the work that Peter Kümmel did with the
InGuiThread classes dealt with this issue."

diff --git a/src/Converter.cpp b/src/Converter.cpp
index a00b0f4..b78ee90 100644
--- a/src/Converter.cpp
+++ b/src/Converter.cpp
@@ -654,13 +654,13 @@ bool Converters::runLaTeX(Buffer const & buffer, string 
const & command,
buffer.bufferErrors(terr, errorList);
 
// check return value from latex.run().
-   if ((result & LaTeX::NO_LOGFILE) && !buffer.isClone()) {
+   if (result & LaTeX::NO_LOGFILE) {
docstring const str =
bformat(_("LaTeX did not run successfully. "
   "Additionally, LyX could not 
locate "
   "the LaTeX log %1$s."), 
from_utf8(name));
Alert::error(_("LaTeX failed"), str);
-   } else if ((result & LaTeX::NO_OUTPUT) && !buffer.isClone()) {
+   } else if (result & LaTeX::NO_OUTPUT) {
Alert::warning(_("Output is empty"),
   _("No output file was generated."));
}


[LyX/master] Assert if successful export but no output file

2015-03-20 Thread Scott Kostyshak
commit 74160640337b63b1fb21c9690289f0ebb29c0820
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Fri Mar 20 00:13:50 2015 -0400

Assert if successful export but no output file

If LyX thinks the export was successful but no output file was
produced for preview, then something is wrong (most likely LyX
did not detect an error that occurred during export).

Also clean up some logic.

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index e045e01..dd18db2 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -4213,9 +4213,21 @@ Buffer::ExportStatus Buffer::preview(string const & 
format, bool includeall) con
// (2) export with included children only
ExportStatus const status = doExport(format, true, false, result_file);
FileName const previewFile(result_file);
-   if (previewFile.exists() && !formats.view(*this, previewFile, format))
-   return PreviewError;
-   return (status == ExportSuccess) ? PreviewSuccess : status;
+   if (previewFile.exists()) {
+   if (!formats.view(*this, previewFile, format))
+   return PreviewError;
+   else if (status == ExportSuccess)
+   return PreviewSuccess;
+   else
+   return status;
+   }
+   else {
+   // Successful export but no output file?
+   // Probably a bug in error detection.
+   LATTEST (status != ExportSuccess);
+
+   return status;
+   }
 }
 
 
diff --git a/src/Buffer.h b/src/Buffer.h
index 9ff7752..05cf8aa 100644
--- a/src/Buffer.h
+++ b/src/Buffer.h
@@ -134,7 +134,10 @@ public:
ExportTexPathHasSpaces,
ExportConverterError,
// preview
+   // Implies ExportSuccess.
PreviewSuccess,
+   // The exported file exists but there was an error when opening
+   // it in a viewer.
PreviewError
};
 


[LyX/master] Clarify message about an empty file

2015-03-20 Thread Scott Kostyshak
commit 6343d9941a63dbf788516eb325e589f70f06c6f1
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Sat Feb 21 23:46:42 2015 -0500

Clarify message about an empty file

When empty output is generated, no PDF is produced. The previous
message made it seem like an empty PDF was produced.

diff --git a/src/Converter.cpp b/src/Converter.cpp
index 4fa740e..a00b0f4 100644
--- a/src/Converter.cpp
+++ b/src/Converter.cpp
@@ -662,7 +662,7 @@ bool Converters::runLaTeX(Buffer const & buffer, string 
const & command,
Alert::error(_("LaTeX failed"), str);
} else if ((result & LaTeX::NO_OUTPUT) && !buffer.isClone()) {
Alert::warning(_("Output is empty"),
-  _("An empty output file was generated."));
+  _("No output file was generated."));
}
 
 


[LyX/master] Improve log scanner to correctly report error

2015-03-20 Thread Scott Kostyshak
commit 0a6120cb7f940bc010efa9f2873afaeee6381a9e
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Sat Feb 21 00:00:51 2015 -0500

Improve log scanner to correctly report error

When scanning the LaTeX log, previously we only looked ahead 10 lines
after a "!" line and if we did not find a line number we did not count
an error. This lead to the problem that templates/ACM-sigplan.lyx was
showing a successful export and the PDF was shown (it is still
created despite the error). Now that the exit code of the latex
command is checked (as of the previous commit), an error is correctly
given, but by parsing the log better with this commit, a more
informative error is given.

Increasing the look-ahead to 15 lines leads to correct parsing of
the ACM-sigplan log. The excerpt in the log file where there are more
than 10 lines in-between the "!" line and the line number is below:

! Undefined control sequence.
\@toappear ...ent http://dx.doi.org/10.1145/\@doi

 ...n is removed.]\par \else \@toappear
  \fi \if \@reprint
\noinden...

\@begin@tempboxa ...mpboxa #1{\color@begingroup #2
  \color@endgroup }\def
\wid...

\@iiiparbox ...tempdima \@parboxrestore #5\@@par }
  \ifx \relax #2\else
\setle...

\@copyrightspace ...planconf@finalpage}.\par \fi }
  }\end@float
\maketitle ... \@copyrightwanted \@copyrightspace
  \fi
l.34 \maketitle

Another example is posted here:

http://tex.stackexchange.com/questions/231655/lyx-cannot-output-to-pdflatex-for-a-specific-file

diff --git a/src/LaTeX.cpp b/src/LaTeX.cpp
index 588ca52..e4f8b4b 100644
--- a/src/LaTeX.cpp
+++ b/src/LaTeX.cpp
@@ -825,7 +825,10 @@ int LaTeX::scanLogFile(TeXErrors & terr)
if (!getline(ifs, tmp))
break;
tmp = rtrim(tmp, "\r");
-   if (++count > 10)
+   // 15 is somewhat arbitrarily chosen, based on 
practice.
+   // We used 10 for 14 years and increased it to 
15 when we
+   // saw one case.
+   if (++count > 15)
break;
} while (!prefixIs(tmp, "l."));
if (prefixIs(tmp, "l.")) {


[LyX/master] Remove an outdated comment

2015-03-20 Thread Scott Kostyshak
commit 4f0593f91b1b61a196b88975310e426413eccd67
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Fri Feb 20 17:31:53 2015 -0500

Remove an outdated comment

LaTeX::deleteFilesOnError is no longer a dummy function.

This comment was interoduced with the first version of this
function, at e6d063c4.

diff --git a/src/LaTeX.cpp b/src/LaTeX.cpp
index b9f7212..22e32d3 100644
--- a/src/LaTeX.cpp
+++ b/src/LaTeX.cpp
@@ -110,8 +110,6 @@ LaTeX::LaTeX(string const & latex, OutputParams const & rp,
 
 void LaTeX::deleteFilesOnError() const
 {
-   // currently just a dummy function.
-
// What files do we have to delete?
 
// This will at least make latex do all the runs


[LyX/master] Check exit code of LaTeX process in LaTeX::run

2015-03-20 Thread Scott Kostyshak
commit 1dbf0e5aab732bdba4eed1af2866c357bc30a526
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Fri Mar 20 00:40:01 2015 -0400

Check exit code of LaTeX process in LaTeX::run

Systemcall::startscript returns the exit code of the LaTeX command
that is run, but the return value was not being checked by
LaTeX::run.  Instead, we relied on parsing log files. However, this
parsing is not perfect.

The return value is now checked and if the exit code of the command
is non-zero, an enum value is added to the return and the user is
notified of the error.

At a higher level, if the LaTeX command returns a non-zero exit code,
in the GUI a message such as
"Error while exporting format: PDF (LuaTeX)" will be given instead of
"Successful preview of format: PDF (LuaTeX)".

When run on the commandline, lyx -e lualatex example.lyx
will give "Error: LaTeX failed" and a non-zero exit code
where before it gave a zero exit code.

A real example of the bug this commit fixes is LyX's (as of this commit)
ACM-sigplan.lyx template.
Before this commit:
  $ lyx -e pdf2 ACM-sigplan.lyx
  [...snip...]
  support/Systemcall.cpp (288): Systemcall: 'pdflatex  "ACM-sigplan.tex"'
  finished with exit code 1
  $ echo $?
  0
Starting with this commit:
  $ mylyx master -e pdf2 ACM-sigplan.lyx
  support/Systemcall.cpp (288): Systemcall: 'pdflatex  "ACM-sigplan.tex"'
  finished with exit code 1
  Error: LaTeX failed
  
  LaTeX did not run successfully. The command that was run exited with
  error.
  $ echo $?
  1

diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index 258d32b..6e9655e 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -52,6 +52,8 @@ Changes with respect to external programs and libraries in 
2.2:
   run LyX against Qt 4.8.x. On Windows, Qt 4.8.5 suffers from a bug that 
   breaks the use of shortcuts, so on Windows Qt 4.8.4 is advised.
 
+- LyX now gives an error if the underlying LaTeX command exited with error.
+
 
 Known issues in version 2.2.0
 -
diff --git a/src/Converter.cpp b/src/Converter.cpp
index b78ee90..933e2f6 100644
--- a/src/Converter.cpp
+++ b/src/Converter.cpp
@@ -660,6 +660,14 @@ bool Converters::runLaTeX(Buffer const & buffer, string 
const & command,
   "Additionally, LyX could not 
locate "
   "the LaTeX log %1$s."), 
from_utf8(name));
Alert::error(_("LaTeX failed"), str);
+   } else if (result & LaTeX::NONZERO_ERROR) {
+   docstring const str =
+   bformat(_( "The external program\n%1$s\n"
+ "finished with an error. "
+ "It is recommended you fix the cause of the 
external "
+ "program's error (check the logs). "), 
from_utf8(command));
+   // FIXME: In LyX 2.3.0 the warning will be converted to an 
error.
+   Alert::error(_("LaTeX failed"), str);
} else if (result & LaTeX::NO_OUTPUT) {
Alert::warning(_("Output is empty"),
   _("No output file was generated."));
diff --git a/src/LaTeX.cpp b/src/LaTeX.cpp
index 22e32d3..588ca52 100644
--- a/src/LaTeX.cpp
+++ b/src/LaTeX.cpp
@@ -226,7 +226,8 @@ int LaTeX::run(TeXErrors & terr)
LYXERR(Debug::LATEX, "Run #" << count);
message(runMessage(count));
 
-   startscript();
+   int const exit_code = startscript();
+
scanres = scanLogFile(terr);
if (scanres & ERROR_RERUN) {
LYXERR(Debug::LATEX, "Rerunning LaTeX");
@@ -422,6 +423,7 @@ int LaTeX::run(TeXErrors & terr)
 
// Write the dependencies to file.
head.write(depfile);
+
if (scanres & NO_OUTPUT) {
// A previous run could have left a PDF and since
// no PDF is created if NO_OUTPUT, we remove any
@@ -431,6 +433,10 @@ int LaTeX::run(TeXErrors & terr)
// be the same so any lingering PDF will be viewed.
deleteFilesOnError();
}
+
+   if (exit_code)
+   scanres |= NONZERO_ERROR;
+
LYXERR(Debug::LATEX, "Done.");
return scanres;
 }
diff --git a/src/LaTeX.h b/src/LaTeX.h
index 615d974..7fa6798 100644
--- a/src/LaTeX.h
+++ b/src/LaTeX.h
@@ -138,10 +138,12 @@ public:
///
BIBTEX_ERROR = 16384,
///
+   NONZERO_ERROR = 32768, // the command exited with nonzero status
+   ///
//FIXME: BIBTEX_ERROR has been removed from ERRORS 

[LyX/master] Export/view a PDF even if error

2015-03-20 Thread Scott Kostyshak
commit cd8be655f1895957fb169cdf361297d9ecc40ec9
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Wed Mar 18 16:51:12 2015 -0400

Export/view a PDF even if error

A PDF is often still produced after a LaTeX error.

If there was an error when exporting a PDF, we now give an error
and the PDF (if it exists), where before we gave the error and
not the PDF. The GUI and command line behaviors are consistent:
in the GUI an error is given and the PDF is viewed; on the
command line, a non-zero exit code is given and a PDF is created.

This also solves what was in my mind an inconsistency: if the user
"updated" a document and there was an error, the resulting
PDF would be shown; but if the user viewed a document and there
was an error, the document would not be shown.

Note that this applies to all output formats, not just PDF.

For discussion, see:
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg186454.html

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index f9da416..e045e01 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -4119,12 +4119,10 @@ Buffer::ExportStatus Buffer::doExport(string const & 
target, bool put_in_tempdir
d->cloned_buffer_->d->errorLists[error_type] = 
d->errorLists[error_type];
}
 
-   if (!success)
-   return ExportConverterError;
 
if (put_in_tempdir) {
result_file = tmp_result_file.absFileName();
-   return ExportSuccess;
+   return success ? ExportSuccess : ExportConverterError;
}
 
if (dest_filename.empty())
@@ -4189,7 +4187,7 @@ Buffer::ExportStatus Buffer::doExport(string const & 
target, bool put_in_tempdir
formats.prettyName(format)));
}
 
-   return ExportSuccess;
+   return success ? ExportSuccess : ExportConverterError;
 }
 
 
@@ -4214,11 +4212,10 @@ Buffer::ExportStatus Buffer::preview(string const & 
format, bool includeall) con
}
// (2) export with included children only
ExportStatus const status = doExport(format, true, false, result_file);
-   if (status != ExportSuccess)
-   return status;
-   if (!formats.view(*this, FileName(result_file), format))
+   FileName const previewFile(result_file);
+   if (previewFile.exists() && !formats.view(*this, previewFile, format))
return PreviewError;
-   return PreviewSuccess;
+   return (status == ExportSuccess) ? PreviewSuccess : status;
 }
 
 
diff --git a/src/LaTeX.cpp b/src/LaTeX.cpp
index e4f8b4b..ed59181 100644
--- a/src/LaTeX.cpp
+++ b/src/LaTeX.cpp
@@ -110,6 +110,10 @@ LaTeX::LaTeX(string const & latex, OutputParams const & rp,
 
 void LaTeX::deleteFilesOnError() const
 {
+   // Note that we do not always call this function when there is an error.
+   // For example, if there is an error but an output file is produced we
+   // still would like to output (export/view) the file.
+
// What files do we have to delete?
 
// This will at least make latex do all the runs
@@ -236,7 +240,9 @@ int LaTeX::run(TeXErrors & terr)
}
 
if (scanres & ERRORS) {
-   deleteFilesOnError();
+   // We no longer run deleteFilesOnError() here
+   // because we now show a resulting PDF even if
+   // there was an error.
return scanres; // return on error
}
 


[LyX/master] Remove output file in temporary folder on error

2015-03-20 Thread Scott Kostyshak
commit 2bfbf75eedc12817e5ee35603861067c68cedb44
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Fri Mar 20 02:03:51 2015 -0400

Remove output file in temporary folder on error

This commit solves two issues:

(1) A PDF from a previous run could have been the result of a command
that exited with error (e.g. sometimes pdflatex still produces a PDF if
it exits with error). If the "View" button were clicked a second time
without changing the .lyx file, then the checksum of the .tex file would
not have changed so LyX would show the PDF (which was created from the
first run that exited with error), and this time LyX would not report
the error (because the parsing of the logs only happens when the .tex
file is compiled).

(2) A myfile.tex that results in no output does not yield a myfile.pdf.
Thus, Any myfile.pdf in the temporary directory will not be overwritten.
Before this commit, the following scenario was possible: LyX runs
pdflatex which processes myfile.tex and no error is given so LyX opens
myfile.pdf. However, it could have been the scenario that pdflatex did
not exit with error and did not create myfile.pdf, in which case
whichever myfile.pdf is being shown is not correct. To see this bug in
action, start a new document, type "abc", view the PDF, delete "abc",
view the PDF (this correctly gives an error that empty output was
created), view the PDF again (this does not give an error because the
checksum has not changed). The PDF shown will contain "abc".

Note that the above also applies to DVI files and that the fix is
general.

diff --git a/src/LaTeX.cpp b/src/LaTeX.cpp
index e787e1a..b9f7212 100644
--- a/src/LaTeX.cpp
+++ b/src/LaTeX.cpp
@@ -142,6 +142,9 @@ void LaTeX::deleteFilesOnError() const
// Also remove the aux file
FileName const aux(changeExtension(file.absFileName(), ".aux"));
aux.removeFile();
+
+   // Remove the output file, which is often generated even if error
+   output_file.removeFile();
 }
 
 
@@ -421,6 +424,15 @@ int LaTeX::run(TeXErrors & terr)
 
// Write the dependencies to file.
head.write(depfile);
+   if (scanres & NO_OUTPUT) {
+   // A previous run could have left a PDF and since
+   // no PDF is created if NO_OUTPUT, we remove any
+   // existing PDF and temporary files so that an
+   // incorrect PDF is not displayed, which could otherwise
+   // happen if View is run again because the checksum will
+   // be the same so any lingering PDF will be viewed.
+   deleteFilesOnError();
+   }
LYXERR(Debug::LATEX, "Done.");
return scanres;
 }


[LyX/master] ctests: revert a MultilingualCaptions XeTeX test

2015-03-10 Thread Scott Kostyshak
commit 50b570e05aef2ff4b2f7b0fb25acc0600fba6bdd
Author: Scott Kostyshak skost...@lyx.org
Date:   Tue Mar 10 23:35:49 2015 -0400

ctests: revert a MultilingualCaptions XeTeX test

This file and format exports correctly since 5753760b.

diff --git a/development/autotests/revertedTests 
b/development/autotests/revertedTests
index cb9c264..008d973 100644
--- a/development/autotests/revertedTests
+++ b/development/autotests/revertedTests
@@ -48,7 +48,7 @@ export/doc/attic/eu_UserGuide_pdf4_systemF
 export/doc/es/Tutorial_pdf4_systemF
 export/doc/gl/Tutorial_dvi3_systemF
 export/doc/(nb|sk|sv)/Intro_pdf4_systemF
-export/examples/(MultilingualCaptions|aas_sample|simplecv)_pdf4_systemF
+export/examples/(aas_sample|simplecv)_pdf4_systemF
 export/examples/de/Lebenslauf_pdf4_systemF
 export/examples/es/ejemplo_con_lyx_pdf5_systemF
 export/examples/eu/adibide_lyx-atua_(dvi3|pdf5)_systemF


[LyX/master] ctests: revert a MultilingualCaptions XeTeX test

2015-03-10 Thread Scott Kostyshak
commit 50b570e05aef2ff4b2f7b0fb25acc0600fba6bdd
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Tue Mar 10 23:35:49 2015 -0400

ctests: revert a MultilingualCaptions XeTeX test

This file and format exports correctly since 5753760b.

diff --git a/development/autotests/revertedTests 
b/development/autotests/revertedTests
index cb9c264..008d973 100644
--- a/development/autotests/revertedTests
+++ b/development/autotests/revertedTests
@@ -48,7 +48,7 @@ export/doc/attic/eu_UserGuide_pdf4_systemF
 export/doc/es/Tutorial_pdf4_systemF
 export/doc/gl/Tutorial_dvi3_systemF
 export/doc/(nb|sk|sv)/Intro_pdf4_systemF
-export/examples/(MultilingualCaptions|aas_sample|simplecv)_pdf4_systemF
+export/examples/(aas_sample|simplecv)_pdf4_systemF
 export/examples/de/Lebenslauf_pdf4_systemF
 export/examples/es/ejemplo_con_lyx_pdf5_systemF
 export/examples/eu/adibide_lyx-atua_(dvi3|pdf5)_systemF


[LyX/master] ctests: invert some of the PDF-comment tests

2015-02-21 Thread Scott Kostyshak
commit 29e96634df320dbed557b8636cbcc1e2d0fae12f
Author: Scott Kostyshak skost...@lyx.org
Date:   Sat Feb 21 13:53:23 2015 -0500

ctests: invert some of the PDF-comment tests

Only pdflatex is expected to work reliably.
lualatex also appears to compile.

diff --git a/development/autotests/revertedTests 
b/development/autotests/revertedTests
index 01469cc..cb9c264 100644
--- a/development/autotests/revertedTests
+++ b/development/autotests/revertedTests
@@ -100,3 +100,8 @@ export/templates/aa_(dvi3|pdf4|pdf5)_(texF|systemF)
 # without error on TeX Live 2013, the resulting PDFs had gibberish.
 export/doc/he/(Intro|Tutorial)_pdf4_texF
 export/examples/he/(example_lyxified|example_raw|splash)_pdf4_texF
+#
+# Inside the file we state
+# Due to technical reasons PDF-Reply works only when using pdflatex.
+# The file also seems to compile with lualatex as well.
+export/examples/PDF-comment_(dvi.*|pdf[^25]*)


[LyX/master] ctests: invert some of the PDF-comment tests

2015-02-21 Thread Scott Kostyshak
commit 29e96634df320dbed557b8636cbcc1e2d0fae12f
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Sat Feb 21 13:53:23 2015 -0500

ctests: invert some of the PDF-comment tests

Only pdflatex is expected to work reliably.
lualatex also appears to compile.

diff --git a/development/autotests/revertedTests 
b/development/autotests/revertedTests
index 01469cc..cb9c264 100644
--- a/development/autotests/revertedTests
+++ b/development/autotests/revertedTests
@@ -100,3 +100,8 @@ export/templates/aa_(dvi3|pdf4|pdf5)_(texF|systemF)
 # without error on TeX Live 2013, the resulting PDFs had gibberish.
 export/doc/he/(Intro|Tutorial)_pdf4_texF
 export/examples/he/(example_lyxified|example_raw|splash)_pdf4_texF
+#
+# Inside the file we state
+# "Due to technical reasons PDF-Reply works only when using pdflatex."
+# The file also seems to compile with lualatex as well.
+export/examples/PDF-comment_(dvi.*|pdf[^25]*)


[LyX/master] ctests: revert Russian XeLaTeX and LuaLaTeX tests

2015-02-18 Thread Scott Kostyshak
commit 68c6d7943df661fb29640df4704ceef3d0492b3f
Author: Scott Kostyshak skost...@lyx.org
Date:   Wed Feb 18 03:25:33 2015 -0500

ctests: revert Russian XeLaTeX and LuaLaTeX tests

These exports (with TeX fonts) have been successful since support
for proper font encoding for Russian was added at d7cf6ca7.

diff --git a/development/autotests/revertedTests 
b/development/autotests/revertedTests
index d8a1d0f..01469cc 100644
--- a/development/autotests/revertedTests
+++ b/development/autotests/revertedTests
@@ -48,7 +48,6 @@ export/doc/attic/eu_UserGuide_pdf4_systemF
 export/doc/es/Tutorial_pdf4_systemF
 export/doc/gl/Tutorial_dvi3_systemF
 export/doc/(nb|sk|sv)/Intro_pdf4_systemF
-export/doc/ru/Intro_pdf4_texF
 export/examples/(MultilingualCaptions|aas_sample|simplecv)_pdf4_systemF
 export/examples/de/Lebenslauf_pdf4_systemF
 export/examples/es/ejemplo_con_lyx_pdf5_systemF
@@ -63,9 +62,6 @@ export/templates/RJournal_(dvi3|pdf[45])_systemF
 export/templates/IEEEtran-(Journal|TransMag)_pdf4_systemF
 export/templates/kluwer_pdf4_systemF
 #
-# There is no Russian LuaTeX TeX font support yet.
-export/.*/ru/(splash|Intro|Tutorial)_(pdf5|dvi3)_texF
-#
 # There is no Chinese LuaTeX or XeTeX TeX font support yet.
 export/.*/zh_CN/.*(pdf[45]|dvi3)_texF
 export/templates/ctex_pdf4_texF


[LyX/master] ctests: revert Russian XeLaTeX and LuaLaTeX tests

2015-02-18 Thread Scott Kostyshak
commit 68c6d7943df661fb29640df4704ceef3d0492b3f
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Wed Feb 18 03:25:33 2015 -0500

ctests: revert Russian XeLaTeX and LuaLaTeX tests

These exports (with TeX fonts) have been successful since support
for proper font encoding for Russian was added at d7cf6ca7.

diff --git a/development/autotests/revertedTests 
b/development/autotests/revertedTests
index d8a1d0f..01469cc 100644
--- a/development/autotests/revertedTests
+++ b/development/autotests/revertedTests
@@ -48,7 +48,6 @@ export/doc/attic/eu_UserGuide_pdf4_systemF
 export/doc/es/Tutorial_pdf4_systemF
 export/doc/gl/Tutorial_dvi3_systemF
 export/doc/(nb|sk|sv)/Intro_pdf4_systemF
-export/doc/ru/Intro_pdf4_texF
 export/examples/(MultilingualCaptions|aas_sample|simplecv)_pdf4_systemF
 export/examples/de/Lebenslauf_pdf4_systemF
 export/examples/es/ejemplo_con_lyx_pdf5_systemF
@@ -63,9 +62,6 @@ export/templates/RJournal_(dvi3|pdf[45])_systemF
 export/templates/IEEEtran-(Journal|TransMag)_pdf4_systemF
 export/templates/kluwer_pdf4_systemF
 #
-# There is no Russian LuaTeX TeX font support yet.
-export/.*/ru/(splash|Intro|Tutorial)_(pdf5|dvi3)_texF
-#
 # There is no Chinese LuaTeX or XeTeX TeX font support yet.
 export/.*/zh_CN/.*(pdf[45]|dvi3)_texF
 export/templates/ctex_pdf4_texF


[LyX/master] Correct the \lyxformat of aastex template

2015-02-17 Thread Scott Kostyshak
commit 02b3a7b35e8cd47a5217641fbf41e17ae07c469a
Author: Scott Kostyshak skost...@lyx.org
Date:   Wed Feb 18 00:15:49 2015 -0500

Correct the \lyxformat of aastex template

The current format is 480. Commit 6594289d changed
the format in this file to 481, which caused the file
to not be loadable in LyX.

diff --git a/lib/templates/aastex.lyx b/lib/templates/aastex.lyx
index b233ac1..3c271f3 100644
--- a/lib/templates/aastex.lyx
+++ b/lib/templates/aastex.lyx
@@ -1,5 +1,5 @@
 #LyX 2.2 created this file. For more info see http://www.lyx.org/
-\lyxformat 481
+\lyxformat 480
 \begin_document
 \begin_header
 \textclass aastex


[LyX/master] ctests: invert many of the ja template tests

2015-02-17 Thread Scott Kostyshak
commit a6f7c598cda5c7857e2b716b4b83252153194290
Author: Scott Kostyshak skost...@lyx.org
Date:   Wed Feb 18 02:35:05 2015 -0500

ctests: invert many of the ja template tests

We only expect pdf and pdf3 to pass. This is consistent with
other LyX Japanese documents.

diff --git a/development/autotests/revertedTests 
b/development/autotests/revertedTests
index fa9d3e0..d8a1d0f 100644
--- a/development/autotests/revertedTests
+++ b/development/autotests/revertedTests
@@ -92,6 +92,7 @@ export/templates/DocBook_article_(dvi3_|pdf2|pdf[45]_).*
 export/templates/JSS-article_(dvi|dvi3_.*|pdf3?)
 export/templates/attic/latex8_(dvi|dvi3_.*)
 export/templates/ctex_pdf[23]?
+export/templates/ja_.*(pdf[245]|dvi3).*
 #
 # The following exports worked with TeX Live 2013, but not in 2014.
 # For a workaround, see:


[LyX/master] Correct the \lyxformat of aastex template

2015-02-17 Thread Scott Kostyshak
commit 02b3a7b35e8cd47a5217641fbf41e17ae07c469a
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Wed Feb 18 00:15:49 2015 -0500

Correct the \lyxformat of aastex template

The current format is 480. Commit 6594289d changed
the format in this file to 481, which caused the file
to not be loadable in LyX.

diff --git a/lib/templates/aastex.lyx b/lib/templates/aastex.lyx
index b233ac1..3c271f3 100644
--- a/lib/templates/aastex.lyx
+++ b/lib/templates/aastex.lyx
@@ -1,5 +1,5 @@
 #LyX 2.2 created this file. For more info see http://www.lyx.org/
-\lyxformat 481
+\lyxformat 480
 \begin_document
 \begin_header
 \textclass aastex


[LyX/master] ctests: invert many of the ja template tests

2015-02-17 Thread Scott Kostyshak
commit a6f7c598cda5c7857e2b716b4b83252153194290
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Wed Feb 18 02:35:05 2015 -0500

ctests: invert many of the ja template tests

We only expect pdf and pdf3 to pass. This is consistent with
other LyX Japanese documents.

diff --git a/development/autotests/revertedTests 
b/development/autotests/revertedTests
index fa9d3e0..d8a1d0f 100644
--- a/development/autotests/revertedTests
+++ b/development/autotests/revertedTests
@@ -92,6 +92,7 @@ export/templates/DocBook_article_(dvi3_|pdf2|pdf[45]_).*
 export/templates/JSS-article_(dvi|dvi3_.*|pdf3?)
 export/templates/attic/latex8_(dvi|dvi3_.*)
 export/templates/ctex_pdf[23]?
+export/templates/ja_.*(pdf[245]|dvi3).*
 #
 # The following exports worked with TeX Live 2013, but not in 2014.
 # For a workaround, see:


[LyX/master] CREDITS: change --userdir to -userdir

2015-02-10 Thread Scott Kostyshak
commit c924692e5a402d7986d2ace5403d9fa329aca6dc
Author: Scott Kostyshak skost...@lyx.org
Date:   Tue Feb 10 11:58:37 2015 -0500

CREDITS: change --userdir to -userdir

diff --git a/lib/CREDITS b/lib/CREDITS
index e5140ce..9a4d728 100644
--- a/lib/CREDITS
+++ b/lib/CREDITS
@@ -497,7 +497,7 @@
Fast parsing with lyxlex, pseudoactions, mathpanel, Math Editor, combox and 
more
 @bLior Silberman
 @iE-mail: lior3.1415 () gmail ! com
-   Tweaks to various XForms dialogs. Implemented the --userdir command line 
option, enabling LyX to run with multiple configurations for different users. 
Implemented the original code to make colours for different inset properties 
configurable.
+   Tweaks to various XForms dialogs. Implemented the -userdir command line 
option, enabling LyX to run with multiple configurations for different users. 
Implemented the original code to make colours for different inset properties 
configurable.
 @bWaluyo Adi Siswanto
 @iE-mail: was.uthm () gmail ! com
Indonesian translation


[LyX/master] CREDITS: change "--userdir" to "-userdir"

2015-02-10 Thread Scott Kostyshak
commit c924692e5a402d7986d2ace5403d9fa329aca6dc
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Tue Feb 10 11:58:37 2015 -0500

CREDITS: change "--userdir" to "-userdir"

diff --git a/lib/CREDITS b/lib/CREDITS
index e5140ce..9a4d728 100644
--- a/lib/CREDITS
+++ b/lib/CREDITS
@@ -497,7 +497,7 @@
Fast parsing with lyxlex, pseudoactions, mathpanel, Math Editor, combox and 
more
 @bLior Silberman
 @iE-mail: lior3.1415 () gmail ! com
-   Tweaks to various XForms dialogs. Implemented the --userdir command line 
option, enabling LyX to run with multiple configurations for different users. 
Implemented the original code to make colours for different inset properties 
configurable.
+   Tweaks to various XForms dialogs. Implemented the -userdir command line 
option, enabling LyX to run with multiple configurations for different users. 
Implemented the original code to make colours for different inset properties 
configurable.
 @bWaluyo Adi Siswanto
 @iE-mail: was.uthm () gmail ! com
Indonesian translation


[LyX/master] Correct the spelling of occured to occurred

2015-02-09 Thread Scott Kostyshak
commit 36c3495a3aea43e7dcda53eafadcc6592073b17e
Author: Scott Kostyshak skost...@lyx.org
Date:   Mon Feb 9 18:42:35 2015 -0500

Correct the spelling of occured to occurred

diff --git a/NEWS b/NEWS
index 762f31a..666439e 100644
--- a/NEWS
+++ b/NEWS
@@ -356,7 +356,7 @@ What's new in version 1.5.5?
 This release further improves the stability and usability of the
 application. Besides this, it also introduces some new features.  Most
 notably, LyX is now prepared to be compiled with Qt 4.4 that has just
-been released: the stability issues that occured in previous versions
+been released: the stability issues that occurred in previous versions
 of LyX when compiled against Qt 4.4 have been resolved.
 
 
diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4
index 22e10bc..aa53e9a 100644
--- a/config/lyxinclude.m4
+++ b/config/lyxinclude.m4
@@ -91,7 +91,7 @@ AC_MSG_ERROR([cannot find $1. Please check that the $2 library
 
 
 dnl Usage: LYX_CHECK_WARNINGS  Displays a warning message if a LYX_WARNING
-dnl   has occured previously.
+dnl   has occurred previously.
 AC_DEFUN([LYX_CHECK_WARNINGS],[
 if test x$lyx_warning = xyes; then
 cat EOF
diff --git a/development/attic/changelogs/ChangeLog-1.txt 
b/development/attic/changelogs/ChangeLog-1.txt
index 364f2c2..89d6eb6 100644
--- a/development/attic/changelogs/ChangeLog-1.txt
+++ b/development/attic/changelogs/ChangeLog-1.txt
@@ -10287,7 +10287,7 @@
 
 2000-02-18  Lars Gullik Bj�nnes  lar...@lyx.org
 
-   * WorkArea, Painter, LyXScreen: Fixed the crash that occured on
+   * WorkArea, Painter, LyXScreen: Fixed the crash that occurred on
resize due to wrong pixmap beeing used. Also took the opurtunity
to make the LyXScreen stateless on regard to WorkArea and some
general cleanup in the same files.
diff --git a/development/attic/changelogs/OLD-CHANGES 
b/development/attic/changelogs/OLD-CHANGES
index 9c1249c..36add72 100644
--- a/development/attic/changelogs/OLD-CHANGES
+++ b/development/attic/changelogs/OLD-CHANGES
@@ -2847,7 +2847,7 @@ since 0.11.8(-2)
 - Updated README file. (Asger)
 - Comment about -sDEVICE=x11alpha in system.lyxrc.in added. (Asger)
 - Help text updated with the new -xpos and -ypos parameters. (Asger)
-- Fixed small bug that occured if you provided background_color, but not
+- Fixed small bug that occurred if you provided background_color, but not
   selection_color. (Asger)
 - Made margins in the main window smaller so that the editing area is
   bigger. Should improve usage on small screen. (Asger)
@@ -3838,7 +3838,7 @@ since 1.05
 since 1.04
 - new font handling (saver and more variable) since
   a lot of segementationt faults (that nowbody told
-  me :-( ) occured on systems that had other fonts
+  me :-( ) occurred on systems that had other fonts
   installed.
 - less bugs (specifying a file at the commandline,
   user defined preambles, generated tex-code)
diff --git a/po/ar.po b/po/ar.po
index 7d467f1..9654234 100644
--- a/po/ar.po
+++ b/po/ar.po
@@ -25360,7 +25360,7 @@ msgstr خطأ مراجعة التحكم.
 #: src/VCBackend.cpp:61
 #, fuzzy, c-format
 msgid 
-Some problem occured while running the command:\n
+Some problem occurred while running the command:\n
 '%1$s'.
 msgstr حدث خطا أثناء تشغيل %1$s
 
diff --git a/po/bg.po b/po/bg.po
index 27ed618..07d361b 100644
--- a/po/bg.po
+++ b/po/bg.po
@@ -31599,7 +31599,7 @@ msgstr Система за контрол на версиите
 #: src/VCBackend.cpp:61
 #, fuzzy, c-format
 msgid 
-Some problem occured while running the command:\n
+Some problem occurred while running the command:\n
 '%1$s'.
 msgstr Грешка при четене 
 
diff --git a/po/ca.po b/po/ca.po
index 3e6b212..1d83070 100644
--- a/po/ca.po
+++ b/po/ca.po
@@ -26636,7 +26636,7 @@ msgstr Control de versions
 #: src/VCBackend.cpp:61
 #, c-format
 msgid 
-Some problem occured while running the command:\n
+Some problem occurred while running the command:\n
 '%1$s'.
 msgstr 
 
diff --git a/po/cs.po b/po/cs.po
index 7b87066..2d24ff5 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -25430,7 +25430,7 @@ msgstr Chyba správy verzí.
 #: src/VCBackend.cpp:61
 #, c-format
 msgid 
-Some problem occured while running the command:\n
+Some problem occurred while running the command:\n
 '%1$s'.
 msgstr 
 Nastala chyba při spuštění příkazu:\n
diff --git a/po/da.po b/po/da.po
index ceb8488..a30e71d 100644
--- a/po/da.po
+++ b/po/da.po
@@ -26570,7 +26570,7 @@ msgstr Versionsstyringsfejl.
 #: src/VCBackend.cpp:61
 #, c-format
 msgid 
-Some problem occured while running the command:\n
+Some problem occurred while running the command:\n
 '%1$s'.
 msgstr 
 Et problem opstod under kørslen af kommandoen:\n
diff --git a/po/de.po b/po/de.po
index bb91165..1e36875 100644
--- a/po/de.po
+++ b/po/de.po
@@ -25695,7 +25695,7 @@ msgstr Fehler der Versionskontrolle.
 #: src/VCBackend.cpp:61
 #, c-format
 msgid 
-Some problem occured while running the command:\n
+Some problem occurred while running the command:\n
 '%1$s'.
 msgstr 
 Bei der Ausführung des Befehls\n
diff --git

[LyX/master] Correct the spelling of "occured" to "occurred"

2015-02-09 Thread Scott Kostyshak
commit 36c3495a3aea43e7dcda53eafadcc6592073b17e
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Mon Feb 9 18:42:35 2015 -0500

Correct the spelling of "occured" to "occurred"

diff --git a/NEWS b/NEWS
index 762f31a..666439e 100644
--- a/NEWS
+++ b/NEWS
@@ -356,7 +356,7 @@ What's new in version 1.5.5?
 This release further improves the stability and usability of the
 application. Besides this, it also introduces some new features.  Most
 notably, LyX is now prepared to be compiled with Qt 4.4 that has just
-been released: the stability issues that occured in previous versions
+been released: the stability issues that occurred in previous versions
 of LyX when compiled against Qt 4.4 have been resolved.
 
 
diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4
index 22e10bc..aa53e9a 100644
--- a/config/lyxinclude.m4
+++ b/config/lyxinclude.m4
@@ -91,7 +91,7 @@ AC_MSG_ERROR([cannot find $1. Please check that the $2 library
 
 
 dnl Usage: LYX_CHECK_WARNINGS  Displays a warning message if a LYX_WARNING
-dnl   has occured previously.
+dnl   has occurred previously.
 AC_DEFUN([LYX_CHECK_WARNINGS],[
 if test x$lyx_warning = xyes; then
 cat <
 
-   * WorkArea, Painter, LyXScreen: Fixed the crash that occured on
+   * WorkArea, Painter, LyXScreen: Fixed the crash that occurred on
resize due to wrong pixmap beeing used. Also took the opurtunity
to make the LyXScreen stateless on regard to WorkArea and some
general cleanup in the same files.
diff --git a/development/attic/changelogs/OLD-CHANGES 
b/development/attic/changelogs/OLD-CHANGES
index 9c1249c..36add72 100644
--- a/development/attic/changelogs/OLD-CHANGES
+++ b/development/attic/changelogs/OLD-CHANGES
@@ -2847,7 +2847,7 @@ since 0.11.8(-2)
 - Updated README file. (Asger)
 - Comment about -sDEVICE=x11alpha in system.lyxrc.in added. (Asger)
 - Help text updated with the new -xpos and -ypos parameters. (Asger)
-- Fixed small bug that occured if you provided background_color, but not
+- Fixed small bug that occurred if you provided background_color, but not
   selection_color. (Asger)
 - Made margins in the main window smaller so that the editing area is
   bigger. Should improve usage on small screen. (Asger)
@@ -3838,7 +3838,7 @@ since 1.05
 since 1.04
 - new font handling (saver and more variable) since
   a lot of segementationt faults (that nowbody told
-  me :-( ) occured on systems that had other fonts
+  me :-( ) occurred on systems that had other fonts
   installed.
 - less bugs (specifying a file at the commandline,
   user defined preambles, generated tex-code)
diff --git a/po/ar.po b/po/ar.po
index 7d467f1..9654234 100644
--- a/po/ar.po
+++ b/po/ar.po
@@ -25360,7 +25360,7 @@ msgstr "خطأ مراجعة التحكم."
 #: src/VCBackend.cpp:61
 #, fuzzy, c-format
 msgid ""
-"Some problem occured while running the command:\n"
+"Some problem occurred while running the command:\n"
 "'%1$s'."
 msgstr "حدث خطا أثناء تشغيل %1$s"
 
diff --git a/po/bg.po b/po/bg.po
index 27ed618..07d361b 100644
--- a/po/bg.po
+++ b/po/bg.po
@@ -31599,7 +31599,7 @@ msgstr "Система за контрол на версиите"
 #: src/VCBackend.cpp:61
 #, fuzzy, c-format
 msgid ""
-"Some problem occured while running the command:\n"
+"Some problem occurred while running the command:\n"
 "'%1$s'."
 msgstr "Грешка при четене "
 
diff --git a/po/ca.po b/po/ca.po
index 3e6b212..1d83070 100644
--- a/po/ca.po
+++ b/po/ca.po
@@ -26636,7 +26636,7 @@ msgstr "Control de versions"
 #: src/VCBackend.cpp:61
 #, c-format
 msgid ""
-"Some problem occured while running the command:\n"
+"Some problem occurred while running the command:\n"
 "'%1$s'."
 msgstr ""
 
diff --git a/po/cs.po b/po/cs.po
index 7b87066..2d24ff5 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -25430,7 +25430,7 @@ msgstr "Chyba správy verzí."
 #: src/VCBackend.cpp:61
 #, c-format
 msgid ""
-"Some problem occured while running the command:\n"
+"Some problem occurred while running the command:\n"
 "'%1$s'."
 msgstr ""
 "Nastala chyba při spuštění příkazu:\n"
diff --git a/po/da.po b/po/da.po
index ceb8488..a30e71d 100644
--- a/po/da.po
+++ b/po/da.po
@@ -26570,7 +26570,7 @@ msgstr "Versionsstyringsfejl."
 #: src/VCBackend.cpp:61
 #, c-format
 msgid ""
-"Some problem occured while running the command:\n"
+"Some problem occurred while running the command:\n"
 "'%1$s'."
 msgstr ""
 "Et problem opstod under kørslen af kommandoen:\n"
diff --git a/po/de.po b/po/de.po
index bb91165..1e36875 100644
--- a/po/de.po
+++ b/po/de.po
@@ -25695,7 +25695,7 @@ msgstr "Fehler der Versionskontrolle."
 #: src/VCBackend.cpp:61
 #, c-format
 msgid ""
-"Some problem occured while 

[LyX/master] Do not modify the changed() status of rows when no drawing has taken place

2015-02-08 Thread Scott Kostyshak
commit c6f8f51525f711fdb85b4ef3d41cb6ee391bb919
Author: Jean-Marc Lasgouttes lasgout...@lyx.org
Date:   Fri Jan 30 11:18:04 2015 +0100

Do not modify the changed() status of rows when no drawing has taken place

There are several places in the code where a row is painted with drawing 
disabled in the painter. The goal is only to recompute inset positions.

Such a case happens in BufferView::checkCursorScrollOffset, as part of the 
horizontal scrolling patch.

It makes sens to consider that only a real painting of a row should change 
its status. However, I would not be surprised if this change would break other 
things.

Fixes: #9388

diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp
index f29202c..2119f8e 100644
--- a/src/TextMetrics.cpp
+++ b/src/TextMetrics.cpp
@@ -1878,7 +1878,8 @@ void TextMetrics::drawParagraph(PainterInfo  pi, 
pit_type const pit, int const
}
 
// Row signature; has row changed since last paint?
-   row.setCrc(pm.computeRowSignature(row, bparams));
+   if (pi.pain.isDrawingEnabled())
+   row.setCrc(pm.computeRowSignature(row, bparams));
bool row_has_changed = row.changed()
|| rowSlice == bv_-lastRowSlice();
 
@@ -1916,7 +1917,8 @@ void TextMetrics::drawParagraph(PainterInfo  pi, 
pit_type const pit, int const
LYXERR(Debug::PAINTING, foreword  pit=  pit   
row=  i
  row_selection= row.selection()
  full_repaint=  pi.full_repaint
- row_has_changed=   row_has_changed);
+ row_has_changed=   row_has_changed
+ drawingEnabled=  
pi.pain.isDrawingEnabled());
}
 
// Backup full_repaint status and force full repaint


[LyX/master] Typo

2015-02-08 Thread Scott Kostyshak
commit 460976eea8ec8567066bf66a956755091cd90010
Author: Scott Kostyshak skost...@lyx.org
Date:   Sun Feb 8 16:18:29 2015 -0500

Typo

diff --git a/lib/doc/Development.lyx b/lib/doc/Development.lyx
index 7427992..260dc6c 100644
--- a/lib/doc/Development.lyx
+++ b/lib/doc/Development.lyx
@@ -198,7 +198,7 @@ When is an update of the .lyx file format number needed?
 \end_layout
 
 \begin_layout Standard
-When you ware working on a new feature you may ask yourself whether it needs
+When you are working on a new feature you may ask yourself whether it needs
  an update of the .lyx file format number.
  Whether an update is needed or not is not always obvious.
  Below you can find a list of reasons for file format updates with 
explanations:


[LyX/master] Revert Do not modify the changed() status of rows when no drawing has taken place

2015-02-08 Thread Scott Kostyshak
commit d81fe084a633188555feea6aab191fe8597e1dc2
Author: Scott Kostyshak skost...@lyx.org
Date:   Sun Feb 8 16:39:06 2015 -0500

Revert Do not modify the changed() status of rows when no drawing has 
taken place

This reverts commit c6f8f51525f711fdb85b4ef3d41cb6ee391bb919.

I accidentally committed this patch, which I am testing as
a fix to 9388.

diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp
index 2119f8e..f29202c 100644
--- a/src/TextMetrics.cpp
+++ b/src/TextMetrics.cpp
@@ -1878,8 +1878,7 @@ void TextMetrics::drawParagraph(PainterInfo  pi, 
pit_type const pit, int const
}
 
// Row signature; has row changed since last paint?
-   if (pi.pain.isDrawingEnabled())
-   row.setCrc(pm.computeRowSignature(row, bparams));
+   row.setCrc(pm.computeRowSignature(row, bparams));
bool row_has_changed = row.changed()
|| rowSlice == bv_-lastRowSlice();
 
@@ -1917,8 +1916,7 @@ void TextMetrics::drawParagraph(PainterInfo  pi, 
pit_type const pit, int const
LYXERR(Debug::PAINTING, foreword  pit=  pit   
row=  i
  row_selection= row.selection()
  full_repaint=  pi.full_repaint
- row_has_changed=   row_has_changed
- drawingEnabled=  
pi.pain.isDrawingEnabled());
+ row_has_changed=   row_has_changed);
}
 
// Backup full_repaint status and force full repaint


[LyX/master] Do not modify the changed() status of rows when no drawing has taken place

2015-02-08 Thread Scott Kostyshak
commit c6f8f51525f711fdb85b4ef3d41cb6ee391bb919
Author: Jean-Marc Lasgouttes 
Date:   Fri Jan 30 11:18:04 2015 +0100

Do not modify the changed() status of rows when no drawing has taken place

There are several places in the code where a row is painted with drawing 
disabled in the painter. The goal is only to recompute inset positions.

Such a case happens in BufferView::checkCursorScrollOffset, as part of the 
horizontal scrolling patch.

It makes sens to consider that only a real painting of a row should change 
its status. However, I would not be surprised if this change would break other 
things.

Fixes: #9388

diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp
index f29202c..2119f8e 100644
--- a/src/TextMetrics.cpp
+++ b/src/TextMetrics.cpp
@@ -1878,7 +1878,8 @@ void TextMetrics::drawParagraph(PainterInfo & pi, 
pit_type const pit, int const
}
 
// Row signature; has row changed since last paint?
-   row.setCrc(pm.computeRowSignature(row, bparams));
+   if (pi.pain.isDrawingEnabled())
+   row.setCrc(pm.computeRowSignature(row, bparams));
bool row_has_changed = row.changed()
|| rowSlice == bv_->lastRowSlice();
 
@@ -1916,7 +1917,8 @@ void TextMetrics::drawParagraph(PainterInfo & pi, 
pit_type const pit, int const
LYXERR(Debug::PAINTING, foreword << "pit=" << pit << " 
row=" << i
<< " row_selection="<< row.selection()
<< " full_repaint=" << pi.full_repaint
-   << " row_has_changed="  << row_has_changed);
+   << " row_has_changed="  << row_has_changed
+   << " drawingEnabled=" << 
pi.pain.isDrawingEnabled());
}
 
// Backup full_repaint status and force full repaint


[LyX/master] Typo

2015-02-08 Thread Scott Kostyshak
commit 460976eea8ec8567066bf66a956755091cd90010
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Sun Feb 8 16:18:29 2015 -0500

Typo

diff --git a/lib/doc/Development.lyx b/lib/doc/Development.lyx
index 7427992..260dc6c 100644
--- a/lib/doc/Development.lyx
+++ b/lib/doc/Development.lyx
@@ -198,7 +198,7 @@ When is an update of the .lyx file format number needed?
 \end_layout
 
 \begin_layout Standard
-When you ware working on a new feature you may ask yourself whether it needs
+When you are working on a new feature you may ask yourself whether it needs
  an update of the .lyx file format number.
  Whether an update is needed or not is not always obvious.
  Below you can find a list of reasons for file format updates with 
explanations:


[LyX/master] Revert "Do not modify the changed() status of rows when no drawing has taken place"

2015-02-08 Thread Scott Kostyshak
commit d81fe084a633188555feea6aab191fe8597e1dc2
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Sun Feb 8 16:39:06 2015 -0500

Revert "Do not modify the changed() status of rows when no drawing has 
taken place"

This reverts commit c6f8f51525f711fdb85b4ef3d41cb6ee391bb919.

I accidentally committed this patch, which I am testing as
a fix to 9388.

diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp
index 2119f8e..f29202c 100644
--- a/src/TextMetrics.cpp
+++ b/src/TextMetrics.cpp
@@ -1878,8 +1878,7 @@ void TextMetrics::drawParagraph(PainterInfo & pi, 
pit_type const pit, int const
}
 
// Row signature; has row changed since last paint?
-   if (pi.pain.isDrawingEnabled())
-   row.setCrc(pm.computeRowSignature(row, bparams));
+   row.setCrc(pm.computeRowSignature(row, bparams));
bool row_has_changed = row.changed()
|| rowSlice == bv_->lastRowSlice();
 
@@ -1917,8 +1916,7 @@ void TextMetrics::drawParagraph(PainterInfo & pi, 
pit_type const pit, int const
LYXERR(Debug::PAINTING, foreword << "pit=" << pit << " 
row=" << i
<< " row_selection="<< row.selection()
<< " full_repaint=" << pi.full_repaint
-   << " row_has_changed="  << row_has_changed
-   << " drawingEnabled=" << 
pi.pain.isDrawingEnabled());
+   << " row_has_changed="  << row_has_changed);
}
 
// Backup full_repaint status and force full repaint


[LyX/master] Remove an item in RELEASE-NOTES that is in 2.1.3

2015-01-21 Thread Scott Kostyshak
commit 48514e49ff71838394452b2d53fe229806b9c639
Author: Scott Kostyshak skost...@lyx.org
Date:   Wed Jan 21 22:09:57 2015 -0500

Remove an item in RELEASE-NOTES that is in 2.1.3

We put the binding change of C-a in 2.1.x so it is not
new in 2.2.

diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index e9ea1df..258d32b 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -34,9 +34,6 @@ The following LyX functions have been changed in 2.2:
 
 The following LyX key bindings have been changed in 2.2:
 
-- C-a is now bound to inset-select-all and C-M-a is now
-  bound to the old function (a command-sequence to select the
-  entire buffer).
 
 
 The following LyX documents have been moved in 2.2:


[LyX/master] Remove an item in RELEASE-NOTES that is in 2.1.3

2015-01-21 Thread Scott Kostyshak
commit 48514e49ff71838394452b2d53fe229806b9c639
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Wed Jan 21 22:09:57 2015 -0500

Remove an item in RELEASE-NOTES that is in 2.1.3

We put the binding change of C-a in 2.1.x so it is not
new in 2.2.

diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index e9ea1df..258d32b 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -34,9 +34,6 @@ The following LyX functions have been changed in 2.2:
 
 The following LyX key bindings have been changed in 2.2:
 
-- "C-a" is now bound to "inset-select-all" and "C-M-a" is now
-  bound to the old function (a command-sequence to select the
-  entire buffer).
 
 
 The following LyX documents have been moved in 2.2:


[LyX/master] Typo

2015-01-20 Thread Scott Kostyshak
commit 6773042d0cca385f409092924556d935dcd86fc1
Author: Scott Kostyshak skost...@lyx.org
Date:   Tue Jan 20 22:08:00 2015 -0500

Typo

diff --git a/INSTALL b/INSTALL
index 2c36846..4d5c0e8 100644
--- a/INSTALL
+++ b/INSTALL
@@ -274,7 +274,7 @@ you want the object files and executables to go and run the
 `configure' script.  `configure' automatically checks for the source
 code in the directory that `configure' is in and in `..'.
 
-If you have to use a `make' that does not supports the `VPATH'
+If you have to use a `make' that does not support the `VPATH'
 variable, you have to compile LyX for one architecture at a time in
 the source code directory.  After you have installed LyX for one
 architecture, use `make distclean' before reconfiguring for another


[LyX/master] Typo

2015-01-20 Thread Scott Kostyshak
commit 6773042d0cca385f409092924556d935dcd86fc1
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Tue Jan 20 22:08:00 2015 -0500

Typo

diff --git a/INSTALL b/INSTALL
index 2c36846..4d5c0e8 100644
--- a/INSTALL
+++ b/INSTALL
@@ -274,7 +274,7 @@ you want the object files and executables to go and run the
 `configure' script.  `configure' automatically checks for the source
 code in the directory that `configure' is in and in `..'.
 
-If you have to use a `make' that does not supports the `VPATH'
+If you have to use a `make' that does not support the `VPATH'
 variable, you have to compile LyX for one architecture at a time in
 the source code directory.  After you have installed LyX for one
 architecture, use `make distclean' before reconfiguring for another


[LyX/master] Whitespace

2014-12-21 Thread Scott Kostyshak
commit 625cea15286f639e7861a22c5354dae258bee3e0
Author: Scott Kostyshak skost...@lyx.org
Date:   Sun Dec 21 19:01:26 2014 -0500

Whitespace

diff --git a/src/insets/InsetCommand.cpp b/src/insets/InsetCommand.cpp
index b2fbc69..3cc8f70 100644
--- a/src/insets/InsetCommand.cpp
+++ b/src/insets/InsetCommand.cpp
@@ -197,7 +197,7 @@ bool InsetCommand::getStatus(Cursor  cur, FuncRequest 
const  cmd,
string const newtype = cmd.getArg(1);
status.setEnabled(p_.isCompatibleCommand(p_.code(), 
newtype));
status.setOnOff(newtype == p_.getCmdName());
-   } 
+   }
status.setEnabled(true);
return true;



[LyX/master] Whitespace

2014-12-21 Thread Scott Kostyshak
commit 625cea15286f639e7861a22c5354dae258bee3e0
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Sun Dec 21 19:01:26 2014 -0500

Whitespace

diff --git a/src/insets/InsetCommand.cpp b/src/insets/InsetCommand.cpp
index b2fbc69..3cc8f70 100644
--- a/src/insets/InsetCommand.cpp
+++ b/src/insets/InsetCommand.cpp
@@ -197,7 +197,7 @@ bool InsetCommand::getStatus(Cursor & cur, FuncRequest 
const & cmd,
string const newtype = cmd.getArg(1);
status.setEnabled(p_.isCompatibleCommand(p_.code(), 
newtype));
status.setOnOff(newtype == p_.getCmdName());
-   } 
+   }
status.setEnabled(true);
return true;



[LyX/master] Whitespace

2014-12-20 Thread Scott Kostyshak
commit 6da7ee1be170629aa6647aa8b2d6cf66ea928a9b
Author: Scott Kostyshak skost...@lyx.org
Date:   Sat Dec 20 15:03:40 2014 -0500

Whitespace

diff --git a/src/insets/InsetLayout.cpp b/src/insets/InsetLayout.cpp
index 98f9775..468b847 100644
--- a/src/insets/InsetLayout.cpp
+++ b/src/insets/InsetLayout.cpp
@@ -42,7 +42,7 @@ InsetLayout::InsetLayout() :
keepempty_(false), forceltr_(false), 
needprotect_(false), intoc_(false), spellcheck_(true), 
resetsfont_(false), display_(true), forcelocalfontswitch_(false)
-{ 
+{
labelfont_.setColor(Color_error);
 }
 


[LyX/master] Initialize recently added forceownlines_ bool

2014-12-20 Thread Scott Kostyshak
commit 15ae3eb85c5494b4343936108cb3b5b7c53bafe4
Author: Scott Kostyshak skost...@lyx.org
Date:   Sat Dec 20 15:05:20 2014 -0500

Initialize recently added forceownlines_ bool

This adds on to the fix for #8875 (a25569eb).

diff --git a/lib/doc/Customization.lyx b/lib/doc/Customization.lyx
index 073ef9a..2b804d5 100644
--- a/lib/doc/Customization.lyx
+++ b/lib/doc/Customization.lyx
@@ -151,6 +151,7 @@ End
 \html_css_as_file 0
 \html_be_strict true
 \author -712698321 Jürgen Spitzmüller 
+\author 274215730 scott 
 \end_header
 
 \begin_body
@@ -17070,6 +17071,9 @@ status collapsed
 ] Force a a line break in the LaTeX output before the inset starts and after
  the inset ends.
  This assures the inset itself is output on its own lines, for parsing 
purposes.
+
+\change_inserted 274215730 1419105878
+ Default is false.
 \change_unchanged
 
 \end_layout
diff --git a/src/insets/InsetLayout.cpp b/src/insets/InsetLayout.cpp
index 468b847..aa8c81b 100644
--- a/src/insets/InsetLayout.cpp
+++ b/src/insets/InsetLayout.cpp
@@ -41,7 +41,8 @@ InsetLayout::InsetLayout() :
passthru_(false), parbreakisnewline_(false), freespacing_(false), 
keepempty_(false), forceltr_(false), 
needprotect_(false), intoc_(false), spellcheck_(true), 
-   resetsfont_(false), display_(true), forcelocalfontswitch_(false)
+   resetsfont_(false), display_(true), forcelocalfontswitch_(false),
+   forceownlines_(false)
 {
labelfont_.setColor(Color_error);
 }


[LyX/master] Whitespace

2014-12-20 Thread Scott Kostyshak
commit 6da7ee1be170629aa6647aa8b2d6cf66ea928a9b
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Sat Dec 20 15:03:40 2014 -0500

Whitespace

diff --git a/src/insets/InsetLayout.cpp b/src/insets/InsetLayout.cpp
index 98f9775..468b847 100644
--- a/src/insets/InsetLayout.cpp
+++ b/src/insets/InsetLayout.cpp
@@ -42,7 +42,7 @@ InsetLayout::InsetLayout() :
keepempty_(false), forceltr_(false), 
needprotect_(false), intoc_(false), spellcheck_(true), 
resetsfont_(false), display_(true), forcelocalfontswitch_(false)
-{ 
+{
labelfont_.setColor(Color_error);
 }
 


[LyX/master] Initialize recently added forceownlines_ bool

2014-12-20 Thread Scott Kostyshak
commit 15ae3eb85c5494b4343936108cb3b5b7c53bafe4
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Sat Dec 20 15:05:20 2014 -0500

Initialize recently added forceownlines_ bool

This adds on to the fix for #8875 (a25569eb).

diff --git a/lib/doc/Customization.lyx b/lib/doc/Customization.lyx
index 073ef9a..2b804d5 100644
--- a/lib/doc/Customization.lyx
+++ b/lib/doc/Customization.lyx
@@ -151,6 +151,7 @@ End
 \html_css_as_file 0
 \html_be_strict true
 \author -712698321 "Jürgen Spitzmüller" 
+\author 274215730 "scott" 
 \end_header
 
 \begin_body
@@ -17070,6 +17071,9 @@ status collapsed
 ] Force a a line break in the LaTeX output before the inset starts and after
  the inset ends.
  This assures the inset itself is output on its own lines, for parsing 
purposes.
+
+\change_inserted 274215730 1419105878
+ Default is false.
 \change_unchanged
 
 \end_layout
diff --git a/src/insets/InsetLayout.cpp b/src/insets/InsetLayout.cpp
index 468b847..aa8c81b 100644
--- a/src/insets/InsetLayout.cpp
+++ b/src/insets/InsetLayout.cpp
@@ -41,7 +41,8 @@ InsetLayout::InsetLayout() :
passthru_(false), parbreakisnewline_(false), freespacing_(false), 
keepempty_(false), forceltr_(false), 
needprotect_(false), intoc_(false), spellcheck_(true), 
-   resetsfont_(false), display_(true), forcelocalfontswitch_(false)
+   resetsfont_(false), display_(true), forcelocalfontswitch_(false),
+   forceownlines_(false)
 {
labelfont_.setColor(Color_error);
 }


[LyX/master] C-a is now bound to inset-select-all

2014-11-20 Thread Scott Kostyshak
commit 4eb4cbb04f975cb94f79519b805a606465c5940a
Author: Scott Kostyshak skost...@lyx.org
Date:   Mon Nov 17 20:14:22 2014 -0500

C-a is now bound to inset-select-all

C-M-a is bound to the global select all. The
reason for this change is that selecting an inset
is a more common operation that selecting an entire
document.

This patch is the result of discussion on #7727.

diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index 00d57ae..b510426 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -30,6 +30,9 @@ The following LyX functions have been changed in 2.2:
 
 The following LyX key bindings have been changed in 2.2:
 
+- C-a is now bound to inset-select-all and C-M-a is now
+  bound to the old function (a command-sequence to select the
+  entire buffer).
 
 
 The following LyX documents have been moved in 2.2:
diff --git a/lib/bind/cua.bind b/lib/bind/cua.bind
index 58e18f2..359e1d4 100644
--- a/lib/bind/cua.bind
+++ b/lib/bind/cua.bind
@@ -87,8 +87,8 @@ Format 2
 \bind C-yredo
 \bind C-S-Z  redo
 
-\bind C-acommand-sequence buffer-begin ; 
buffer-end-select   # select all
-\bind C-M-a  inset-select-all
+\bind C-M-a  command-sequence buffer-begin ; 
buffer-end-select   # select all
+\bind C-ainset-select-all
 
 \bind C-S-E  changes-track  # it's what MS Word uses
 \bind ~S-M-quotedbl  quote-insert single
diff --git a/lib/bind/mac.bind b/lib/bind/mac.bind
index efee7b2..ecdd3ad 100644
--- a/lib/bind/mac.bind
+++ b/lib/bind/mac.bind
@@ -123,8 +123,8 @@ Format 2
 #  +: Shift-Command-4  # Capture a selection to a file
 #  +: Shift-Control-Command-4  # Capture a selection to the Clipboard
 #  +: Command-A# Highlight every item in a document or 
window, or all characters in a text field
-\bind C-a  command-sequence buffer-begin ; 
buffer-end-select
-\bind C-M-ainset-select-all
+\bind C-M-acommand-sequence buffer-begin ; 
buffer-end-select
+\bind C-a  inset-select-all
 #  +: Command-B# Boldface the selected text or toggle 
boldfaced text on and off
 \bind C-M-bfont-boldsymbol
 \bind C-b  font-bold
diff --git a/lib/bind/sciword.bind b/lib/bind/sciword.bind
index 533d6b1..b3814f4 100644
--- a/lib/bind/sciword.bind
+++ b/lib/bind/sciword.bind
@@ -113,7 +113,8 @@ Format 2
 \bind C-xcut
 \bind C-zundo
 \bind S-C-Z  redo
-\bind C-acommand-sequence buffer-begin ; buffer-end-select   # select 
all
+\bind C-ainset-select-all
+\bind C-M-a  command-sequence buffer-begin ; buffer-end-select   # select 
all
 
 
 # This combination makes an umlaut accent now.


[LyX/master] Clean RELEASE-NOTES for 2.2

2014-11-20 Thread Scott Kostyshak
commit ef71f667c74aaf042532b3d4a50f6be246e592e6
Author: Scott Kostyshak skost...@lyx.org
Date:   Thu Nov 20 02:25:12 2014 -0500

Clean RELEASE-NOTES for 2.2

I kept the notes on Python 3 incompatibility and the advice to
compile with Qt 4.8.x.

diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index f680014..8cf4e7e 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -1,218 +1,55 @@
-This file lists interface changes that might affect users in 2.1.0, some
-known problems in LyX 2.1.0 and some things you have to take into account
-when upgrading from earlier versions to a version of the 2.1.x series.
+This file lists interface changes that might affect users in 2.2.0, some
+known problems in LyX 2.2.0 and some things you have to take into account
+when upgrading from earlier versions to a version of the 2.2.x series.
 
 
 Interface changes
 -
 
-- There have been changes to some often used menu items.
 
-  The following menu items moved from View to Document:
-* View (Default format)
-* View (Other formats)
-* Update (Default format)
-* Update (Other formats)
 
-  The following menu item moved from Document to View:
-* Outline - Outline Pane
+The following pref variables were added in 2.2:
 
-- Whenever the user closes a (tabbed) view on a document, either by
-  clicking on the tab close button, or by using the File-Close menu,
-  LyX now closes exclusively that specific view. If there are other
-  views showing the same document, they are not closed. When the user
-  closes the last view, LyX can be configured for either closing the
-  document, or keeping it in memory as a hidden document (that can be
-  shown again through the View-Hidden- submenu).
 
-  A new configurable preference option has been added, allowing for
-  either (close_buffer_with_last_view).
 
-- There have been some changes to the LyX command line. The following
-  new options have been added:
+The following pref variables were changed in 2.2:
 
-  --export-to format dest(-E format dest)
 
-Allows one to perform a batch export of the LyX file that is
-opened to the specified destination file dest and format
-format. For example, to create a PDF of a LyX document,
-you can run:
-  lyx --export-to pdf /path/to/dest.pdf /path/to/source.lyx
-See the manual page for details.
 
-This functionality is also available via a new menu voice
-Export-Export As..., that pops up a dialog allowing one to
-choose the export format, as well as the destination pathname.
-Also, it is available via the mini-buffer (or the -x switch)
-through a proper new LFUN (see below).
+The following pref variables are obsoleted in 2.2:
 
-- The Advanced Find and Replace feature now supports cancel of a
-  long search operation by hitting the ESC key.
-
-- The format pdf aka PDF (ps2pdf) was split in two formats: pdf aka
-  PDF (ps2pdf) and pdf6 aka PDF (graphics). pdf6 is used for PDF
-  files included as graphics. Custom external templates and converters
-  might need to be adjusted. The format split was needed since otherwise
-  an odt-pdf converter which is intended for included graphics only
-  did interfere with document export via ps2pdf.
-
-- The support for ArmTeX (a special typesetting engine for Armenian)
-  was removed. Writing text in Armenian is now possible in a native
-  way using XeTeX.
-
-
-The following pref variables were added in 2.1:
-
-- \\close_buffer_with_last_view [yes|no|ask]
-  When the user closes the last view on a document, close the
-  document as well (yes), or hide the document (no), or ask
-  the user (ask).
-
-- \\completion_minlength
-  Defines the minimal length of a word to be added to the list of
-  words for text completion.
-
-- \\default_length_unit
-  Defines the default length unit: 2 for centimers, 6 for inches.
-
-- \\default_otf_view_format
-  Defines the default output format for documents with non-tex
-  fonts (OpenType fonts).
-
-- \\fullscreen_statusbar
-  Controls whether the statusbar is shown in fullscreen mode.
-
-- \\texinputs_prefix
-  Defines the prefix for the TEXINPUTS environment variable. A
-  single '.' in the paths will get replaced with the current
-  document dir and also non-absolute paths will be prefixed with
-  that dir.
-
-  The default semantics of TEXINPUTS apply, such that, for example,
-  if a path is terminated with a double slash, all subdirectories
-  will also be searched by both the TeX engine and ancillary programs
-  such as dvi previewers or dvips.
-
-  (see also commit 1717ef20)
-
-- \\use_qimage
-  See Caveats section below.
-
-- \\use_system_theme_icons
-  If set to true, LyX tries to use the theme icons as defined by
-  the OS.
-
-
-The following pref variables were changed in 2.1:
-
-- \\mac_like_word_movement - \\mac_like_cursor_movement
-  When this option is set, the cursor is now moved to the end of
-  the current paragraph on paragraph-down. The pref variable was
-  renamed to better

[LyX/master] Make style of RELEASE-NOTES consistent

2014-11-20 Thread Scott Kostyshak
commit 7a2ebf5604de097385b8d04fa8400c4478d278a9
Author: Scott Kostyshak skost...@lyx.org
Date:   Thu Nov 20 02:43:55 2014 -0500

Make style of RELEASE-NOTES consistent

diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index 8cf4e7e..00d57ae 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -20,27 +20,27 @@ The following pref variables are obsoleted in 2.2:
 
 
 
-The following new LyX functions have been introduced:
+The following new LyX functions have been introduced in 2.2:
 
 
 
-The following LyX functions have been changed:
+The following LyX functions have been changed in 2.2:
 
 
 
-The following LyX key bindings have been changed:
+The following LyX key bindings have been changed in 2.2:
 
 
 
-The following LyX documents have been moved:
+The following LyX documents have been moved in 2.2:
 
 
 
-The following metadata files have been added to the tarball:
+The following metadata files have been added to the tarball in 2.2:
 
 
 
-Changes with respect to external programs and libraries:
+Changes with respect to external programs and libraries in 2.2:
 
 
 


[LyX/master] RELEASE-NOTES: Describe obsoletion of \\rtl

2014-11-20 Thread Scott Kostyshak
commit 0e0746c703b68bf0da9992717a6c6234299f7004
Author: Scott Kostyshak skost...@lyx.org
Date:   Thu Nov 20 03:17:37 2014 -0500

RELEASE-NOTES: Describe obsoletion of \\rtl

diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index b510426..e9ea1df 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -18,6 +18,10 @@ The following pref variables were changed in 2.2:
 
 The following pref variables are obsoleted in 2.2:
 
+- \\rtl
+  This variable was introduced to guard against any bad consequence of
+  the then-new right-to-left languages support. It is no longer needed
+  because of improvements. Now right-to-left support is always enabled.
 
 
 The following new LyX functions have been introduced in 2.2:


[LyX/master] C-a is now bound to inset-select-all

2014-11-20 Thread Scott Kostyshak
commit 4eb4cbb04f975cb94f79519b805a606465c5940a
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Mon Nov 17 20:14:22 2014 -0500

C-a is now bound to inset-select-all

C-M-a is bound to the global "select all". The
reason for this change is that selecting an inset
is a more common operation that selecting an entire
document.

This patch is the result of discussion on #7727.

diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index 00d57ae..b510426 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -30,6 +30,9 @@ The following LyX functions have been changed in 2.2:
 
 The following LyX key bindings have been changed in 2.2:
 
+- "C-a" is now bound to "inset-select-all" and "C-M-a" is now
+  bound to the old function (a command-sequence to select the
+  entire buffer).
 
 
 The following LyX documents have been moved in 2.2:
diff --git a/lib/bind/cua.bind b/lib/bind/cua.bind
index 58e18f2..359e1d4 100644
--- a/lib/bind/cua.bind
+++ b/lib/bind/cua.bind
@@ -87,8 +87,8 @@ Format 2
 \bind "C-y""redo"
 \bind "C-S-Z"  "redo"
 
-\bind "C-a""command-sequence buffer-begin ; 
buffer-end-select"   # select all
-\bind "C-M-a"  "inset-select-all"
+\bind "C-M-a"  "command-sequence buffer-begin ; 
buffer-end-select"   # select all
+\bind "C-a""inset-select-all"
 
 \bind "C-S-E"  "changes-track"  # it's what MS Word uses
 \bind "~S-M-quotedbl"  "quote-insert single"
diff --git a/lib/bind/mac.bind b/lib/bind/mac.bind
index efee7b2..ecdd3ad 100644
--- a/lib/bind/mac.bind
+++ b/lib/bind/mac.bind
@@ -123,8 +123,8 @@ Format 2
 #  +: "Shift-Command-4"  # Capture a selection to a file
 #  +: "Shift-Control-Command-4"  # Capture a selection to the Clipboard
 #  +: "Command-A"# Highlight every item in a document or 
window, or all characters in a text field
-\bind "C-a"  "command-sequence buffer-begin ; 
buffer-end-select"
-\bind "C-M-a""inset-select-all"
+\bind "C-M-a""command-sequence buffer-begin ; 
buffer-end-select"
+\bind "C-a"  "inset-select-all"
 #  +: "Command-B"# Boldface the selected text or toggle 
boldfaced text on and off
 \bind "C-M-b""font-boldsymbol"
 \bind "C-b"  "font-bold"
diff --git a/lib/bind/sciword.bind b/lib/bind/sciword.bind
index 533d6b1..b3814f4 100644
--- a/lib/bind/sciword.bind
+++ b/lib/bind/sciword.bind
@@ -113,7 +113,8 @@ Format 2
 \bind "C-x""cut"
 \bind "C-z""undo"
 \bind "S-C-Z"  "redo"
-\bind "C-a""command-sequence buffer-begin ; buffer-end-select"   # select 
all
+\bind "C-a""inset-select-all"
+\bind "C-M-a"  "command-sequence buffer-begin ; buffer-end-select"   # select 
all
 
 
 # This combination makes an umlaut accent now.


[LyX/master] Clean RELEASE-NOTES for 2.2

2014-11-20 Thread Scott Kostyshak
commit ef71f667c74aaf042532b3d4a50f6be246e592e6
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Thu Nov 20 02:25:12 2014 -0500

Clean RELEASE-NOTES for 2.2

I kept the notes on Python 3 incompatibility and the advice to
compile with Qt 4.8.x.

diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index f680014..8cf4e7e 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -1,218 +1,55 @@
-This file lists interface changes that might affect users in 2.1.0, some
-known problems in LyX 2.1.0 and some things you have to take into account
-when upgrading from earlier versions to a version of the 2.1.x series.
+This file lists interface changes that might affect users in 2.2.0, some
+known problems in LyX 2.2.0 and some things you have to take into account
+when upgrading from earlier versions to a version of the 2.2.x series.
 
 
 Interface changes
 -
 
-- There have been changes to some often used menu items.
 
-  The following menu items moved from View to Document:
-* View (Default format)
-* View (Other formats)
-* Update (Default format)
-* Update (Other formats)
 
-  The following menu item moved from Document to View:
-* Outline -> Outline Pane
+The following pref variables were added in 2.2:
 
-- Whenever the user closes a (tabbed) view on a document, either by
-  clicking on the tab close button, or by using the File->Close menu,
-  LyX now closes exclusively that specific view. If there are other
-  views showing the same document, they are not closed. When the user
-  closes the last view, LyX can be configured for either closing the
-  document, or keeping it in memory as a hidden document (that can be
-  shown again through the View->Hidden-> submenu).
 
-  A new configurable preference option has been added, allowing for
-  either (close_buffer_with_last_view).
 
-- There have been some changes to the LyX command line. The following
-  new options have been added:
+The following pref variables were changed in 2.2:
 
-  --export-to  (-E  )
 
-Allows one to perform a batch export of the LyX file that is
-opened to the specified destination file  and format
-. For example, to create a PDF of a LyX document,
-you can run:
-  lyx --export-to pdf /path/to/dest.pdf /path/to/source.lyx
-See the manual page for details.
 
-This functionality is also available via a new menu voice
-Export->Export As..., that pops up a dialog allowing one to
-choose the export format, as well as the destination pathname.
-Also, it is available via the mini-buffer (or the -x switch)
-through a proper new LFUN (see below).
+The following pref variables are obsoleted in 2.2:
 
-- The Advanced Find and Replace feature now supports cancel of a
-  long search operation by hitting the ESC key.
-
-- The format pdf aka "PDF (ps2pdf)" was split in two formats: pdf aka
-  "PDF (ps2pdf)" and pdf6 aka "PDF (graphics)". pdf6 is used for PDF
-  files included as graphics. Custom external templates and converters
-  might need to be adjusted. The format split was needed since otherwise
-  an odt->pdf converter which is intended for included graphics only
-  did interfere with document export via ps2pdf.
-
-- The support for ArmTeX (a special typesetting engine for Armenian)
-  was removed. Writing text in Armenian is now possible in a native
-  way using XeTeX.
-
-
-The following pref variables were added in 2.1:
-
-- \\close_buffer_with_last_view [yes|no|ask]
-  When the user closes the last view on a document, close the
-  document as well ("yes"), or hide the document ("no"), or ask
-  the user ("ask").
-
-- \\completion_minlength
-  Defines the minimal length of a word to be added to the list of
-  words for text completion.
-
-- \\default_length_unit
-  Defines the default length unit: 2 for centimers, 6 for inches.
-
-- \\default_otf_view_format
-  Defines the default output format for documents with non-tex
-  fonts (OpenType fonts).
-
-- \\fullscreen_statusbar
-  Controls whether the statusbar is shown in fullscreen mode.
-
-- \\texinputs_prefix
-  Defines the prefix for the TEXINPUTS environment variable. A
-  single '.' in the paths will get replaced with the current
-  document dir and also non-absolute paths will be prefixed with
-  that dir.
-
-  The default semantics of TEXINPUTS apply, such that, for example,
-  if a path is terminated with a double slash, all subdirectories
-  will also be searched by both the TeX engine and ancillary programs
-  such as dvi previewers or dvips.
-
-  (see also commit 1717ef20)
-
-- \\use_qimage
-  See Caveats section below.
-
-- \\use_system_theme_icons
-  If set to true, LyX tries to use the theme icons as defined by
-  the OS.
-
-
-The following pref variables were changed in 2.1:
-
-- \\mac_like_word_movement -> \\mac_like_cursor_movement
-  When this option is set, the cursor is now moved to the end of
-  the 

[LyX/master] Make style of RELEASE-NOTES consistent

2014-11-20 Thread Scott Kostyshak
commit 7a2ebf5604de097385b8d04fa8400c4478d278a9
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Thu Nov 20 02:43:55 2014 -0500

Make style of RELEASE-NOTES consistent

diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index 8cf4e7e..00d57ae 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -20,27 +20,27 @@ The following pref variables are obsoleted in 2.2:
 
 
 
-The following new LyX functions have been introduced:
+The following new LyX functions have been introduced in 2.2:
 
 
 
-The following LyX functions have been changed:
+The following LyX functions have been changed in 2.2:
 
 
 
-The following LyX key bindings have been changed:
+The following LyX key bindings have been changed in 2.2:
 
 
 
-The following LyX documents have been moved:
+The following LyX documents have been moved in 2.2:
 
 
 
-The following metadata files have been added to the tarball:
+The following metadata files have been added to the tarball in 2.2:
 
 
 
-Changes with respect to external programs and libraries:
+Changes with respect to external programs and libraries in 2.2:
 
 
 


[LyX/master] RELEASE-NOTES: Describe obsoletion of \\rtl

2014-11-20 Thread Scott Kostyshak
commit 0e0746c703b68bf0da9992717a6c6234299f7004
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Thu Nov 20 03:17:37 2014 -0500

RELEASE-NOTES: Describe obsoletion of \\rtl

diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index b510426..e9ea1df 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -18,6 +18,10 @@ The following pref variables were changed in 2.2:
 
 The following pref variables are obsoleted in 2.2:
 
+- \\rtl
+  This variable was introduced to guard against any bad consequence of
+  the then-new right-to-left languages support. It is no longer needed
+  because of improvements. Now right-to-left support is always enabled.
 
 
 The following new LyX functions have been introduced in 2.2:


[LyX/master] Do nothing if converting to the same type of Note

2014-11-17 Thread Scott Kostyshak
commit 937a52b64d184c4d9ac69a842fc9a6ed0dcee40b
Author: Scott Kostyshak skost...@lyx.org
Date:   Wed Nov 12 20:31:38 2014 -0500

Do nothing if converting to the same type of Note

The advantage is that the buffer will no longer be
marked as dirty when converting to the same type.

A quick break here is done instead of disabling the
LFUN because disabling the LFUN would lead to a greyed out
entry, which might confuse users. In the future, we might
want to have a radio button for switching between notes.

diff --git a/src/insets/InsetNote.cpp b/src/insets/InsetNote.cpp
index 6bb294d..3705502 100644
--- a/src/insets/InsetNote.cpp
+++ b/src/insets/InsetNote.cpp
@@ -149,7 +149,18 @@ void InsetNote::doDispatch(Cursor  cur, FuncRequest  cmd)
 {
switch (cmd.action()) {
 
-   case LFUN_INSET_MODIFY:
+   case LFUN_INSET_MODIFY: {
+   // Do not do anything if converting to the same type of Note.
+   // A quick break here is done instead of disabling the LFUN
+   // because disabling the LFUN would lead to a greyed out
+   // entry, which might confuse users.
+   // In the future, we might want to have a radio button for
+   // switching between notes.
+   InsetNoteParams params;
+   string2params(to_utf8(cmd.argument()), params);
+   if (params_.type == params.type)
+ break;
+
cur.recordUndoInset(ATOMIC_UNDO, this);
string2params(to_utf8(cmd.argument()), params_);
setButtonLabel();
@@ -157,6 +168,7 @@ void InsetNote::doDispatch(Cursor  cur, FuncRequest  cmd)
// a full buffer update
cur.forceBufferUpdate();
break;
+   }
 
case LFUN_INSET_DIALOG_UPDATE:
cur.bv().updateDialog(note, params2string(params()));


[LyX/master] Do nothing if converting to the same type of Note

2014-11-17 Thread Scott Kostyshak
commit 937a52b64d184c4d9ac69a842fc9a6ed0dcee40b
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Wed Nov 12 20:31:38 2014 -0500

Do nothing if converting to the same type of Note

The advantage is that the buffer will no longer be
marked as dirty when converting to the same type.

A quick break here is done instead of disabling the
LFUN because disabling the LFUN would lead to a greyed out
entry, which might confuse users. In the future, we might
want to have a radio button for switching between notes.

diff --git a/src/insets/InsetNote.cpp b/src/insets/InsetNote.cpp
index 6bb294d..3705502 100644
--- a/src/insets/InsetNote.cpp
+++ b/src/insets/InsetNote.cpp
@@ -149,7 +149,18 @@ void InsetNote::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
switch (cmd.action()) {
 
-   case LFUN_INSET_MODIFY:
+   case LFUN_INSET_MODIFY: {
+   // Do not do anything if converting to the same type of Note.
+   // A quick break here is done instead of disabling the LFUN
+   // because disabling the LFUN would lead to a greyed out
+   // entry, which might confuse users.
+   // In the future, we might want to have a radio button for
+   // switching between notes.
+   InsetNoteParams params;
+   string2params(to_utf8(cmd.argument()), params);
+   if (params_.type == params.type)
+ break;
+
cur.recordUndoInset(ATOMIC_UNDO, this);
string2params(to_utf8(cmd.argument()), params_);
setButtonLabel();
@@ -157,6 +168,7 @@ void InsetNote::doDispatch(Cursor & cur, FuncRequest & cmd)
// a full buffer update
cur.forceBufferUpdate();
break;
+   }
 
case LFUN_INSET_DIALOG_UPDATE:
cur.bv().updateDialog("note", params2string(params()));


[LyX/master] Typo

2014-11-15 Thread Scott Kostyshak
commit 5934827382a4878f10c84b4946bfbb31651c5ecb
Author: Scott Kostyshak skost...@lyx.org
Date:   Sat Nov 15 19:21:13 2014 -0500

Typo

diff --git a/lib/templates/letter.lyx b/lib/templates/letter.lyx
index 7b2f28e..ae2cfb4 100644
--- a/lib/templates/letter.lyx
+++ b/lib/templates/letter.lyx
@@ -126,7 +126,7 @@ This field MUST be before the Opening field!
 
 \begin_layout Standard
 Text of Your Letter.
- To create a real letter, just replace erase all the text in  (including
+ To create a real letter, just replace all the text in  (including
  the 
 \begin_inset Quotes eld
 \end_inset


[LyX/master] Typo

2014-11-15 Thread Scott Kostyshak
commit 5934827382a4878f10c84b4946bfbb31651c5ecb
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Sat Nov 15 19:21:13 2014 -0500

Typo

diff --git a/lib/templates/letter.lyx b/lib/templates/letter.lyx
index 7b2f28e..ae2cfb4 100644
--- a/lib/templates/letter.lyx
+++ b/lib/templates/letter.lyx
@@ -126,7 +126,7 @@ This field MUST be before the "Opening" field!
 
 \begin_layout Standard
  (including
+ To create a real letter, just replace all the text in <> (including
  the 
 \begin_inset Quotes eld
 \end_inset


[LyX/master] Typo

2014-11-11 Thread Scott Kostyshak
commit 95f9bafff2f6387ffcd72fb47eb654d3e5f79b92
Author: Scott Kostyshak skost...@lyx.org
Date:   Tue Nov 11 22:39:14 2014 -0500

Typo

diff --git a/lib/doc/Customization.lyx b/lib/doc/Customization.lyx
index f25ca0b..1419957 100644
--- a/lib/doc/Customization.lyx
+++ b/lib/doc/Customization.lyx
@@ -11685,7 +11685,7 @@ int=0
 
 ] Used for backporting new styles to stable LyX versions.
  The first stable version that supports this tag is LyX 2.1.0.
- The argment is a number which may either be 0, -1 or any value greater
+ The argument is a number which may either be 0, -1 or any value greater
  than zero.
  If the 
 \begin_inset Flex Code


[LyX/master] Typo

2014-11-11 Thread Scott Kostyshak
commit 95f9bafff2f6387ffcd72fb47eb654d3e5f79b92
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Tue Nov 11 22:39:14 2014 -0500

Typo

diff --git a/lib/doc/Customization.lyx b/lib/doc/Customization.lyx
index f25ca0b..1419957 100644
--- a/lib/doc/Customization.lyx
+++ b/lib/doc/Customization.lyx
@@ -11685,7 +11685,7 @@ int=0
 
 ] Used for backporting new styles to stable LyX versions.
  The first stable version that supports this tag is LyX 2.1.0.
- The argment is a number which may either be 0, -1 or any value greater
+ The argument is a number which may either be 0, -1 or any value greater
  than zero.
  If the 
 \begin_inset Flex Code


[LyX/master] No space after inline math for text export (#9282)

2014-10-15 Thread Scott Kostyshak
commit 5636906aee2b9fd74d0016d4e56536c749eb2a02
Author: Scott Kostyshak skost...@lyx.org
Date:   Thu Oct 2 01:51:24 2014 -0400

No space after inline math for text export (#9282)

This extra space was the result of the fix for #6094
(at 7e624928).

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index eb239ed..103428a 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -3382,8 +3382,6 @@ docstring Paragraph::asString(pos_type beg, pos_type end, 
int options, const Out
getInset(i)-plaintext(os, *runparams);
} else {
getInset(i)-toString(os);
-   if (getInset(i)-asInsetMath())
-   os   ;
}
}
}


[LyX/master] Remove line in text export of inline math (#9282)

2014-10-15 Thread Scott Kostyshak
commit 3b96c6e901904cb7d5e1c13e76b84541d090075a
Author: Scott Kostyshak skost...@lyx.org
Date:   Thu Oct 2 01:29:00 2014 -0400

Remove line in text export of inline math (#9282)

If there is only one row, a new line should not be appended. If
there is more than one row, the new line should not be appended for
the last row.

For example, if in LyX there was as you can see in $x$ there... a
copy/paste would lead to a newline after x.

diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp
index 386c373..4b9e0ce 100644
--- a/src/mathed/InsetMathHull.cpp
+++ b/src/mathed/InsetMathHull.cpp
@@ -1970,7 +1970,8 @@ int InsetMathHull::plaintext(odocstringstream  os,
// and do not include the newline.
if (op.for_toc || op.for_tooltip || oss.str().size() = 
max_length)
break;
-   wi  \n;
+if (r  nrows() - 1)
+   wi  \n;
}
}
docstring const str = oss.str();


[LyX/master] No space after inline math for text export (#9282)

2014-10-15 Thread Scott Kostyshak
commit 5636906aee2b9fd74d0016d4e56536c749eb2a02
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Thu Oct 2 01:51:24 2014 -0400

No space after inline math for text export (#9282)

This extra space was the result of the fix for #6094
(at 7e624928).

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index eb239ed..103428a 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -3382,8 +3382,6 @@ docstring Paragraph::asString(pos_type beg, pos_type end, 
int options, const Out
getInset(i)->plaintext(os, *runparams);
} else {
getInset(i)->toString(os);
-   if (getInset(i)->asInsetMath())
-   os << " ";
}
}
}


[LyX/master] Remove line in text export of inline math (#9282)

2014-10-15 Thread Scott Kostyshak
commit 3b96c6e901904cb7d5e1c13e76b84541d090075a
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Thu Oct 2 01:29:00 2014 -0400

Remove line in text export of inline math (#9282)

If there is only one row, a new line should not be appended. If
there is more than one row, the new line should not be appended for
the last row.

For example, if in LyX there was "as you can see in $x$ there..." a
copy/paste would lead to a newline after "x".

diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp
index 386c373..4b9e0ce 100644
--- a/src/mathed/InsetMathHull.cpp
+++ b/src/mathed/InsetMathHull.cpp
@@ -1970,7 +1970,8 @@ int InsetMathHull::plaintext(odocstringstream & os,
// and do not include the newline.
if (op.for_toc || op.for_tooltip || oss.str().size() >= 
max_length)
break;
-   wi << "\n";
+if (r < nrows() - 1)
+   wi << "\n";
}
}
docstring const str = oss.str();


[LyX/2.1.x] Reset status file after 2.1.2 release

2014-09-26 Thread Scott Kostyshak
commit 427d0ef390088c9f308ab85053108b2f4a898409
Author: Scott Kostyshak skost...@lyx.org
Date:   Fri Sep 26 22:34:01 2014 -0400

Reset status file after 2.1.2 release

diff --git a/status.21x b/status.21x
index 01e7ab8..10841f2 100644
--- a/status.21x
+++ b/status.21x
@@ -1,6 +1,6 @@
 -*- text -*-
 
-This file describes what has been done in the preparation of LyX 2.1.2.
+This file describes what has been done in the preparation of LyX 2.1.3.
 All comments are welcome.
 
 We try to group things by topic and in decreasing order of importance. 
@@ -13,7 +13,7 @@ For more details on how to use the repository, please visit:
   http://wiki.lyx.org/Devel/LyXGit
 A list of bugs fixed for this release can also be found at:
   http://www.lyx.org/trac/wiki/BugTrackerHome
-as well as a list of bugs still targeted to the 2.1.2 release.
+as well as a list of bugs still targeted to the 2.1.3 release.
 
 Richard Heck
 Branch Maintainer
@@ -36,21 +36,14 @@ What's new
 
 * USER INTERFACE
 
-- Detect some additional postscript and pdf viewers when they are on the
-  system PATH (AcroRd32, SumatraPDF, gsview and qpdfview).
 
 
 * DOCUMENTATION AND LOCALIZATION
 
-- Update docs explaining how to activate reverse search in qpdfview.
-
-- New French translations of the beamer examples.
 
 
 * BUILD/INSTALLATION
 
-- On Cygwin, use getent instead of grepping /etc/passwd for determining
-  the user's home directory when launching LyX through the gui wrapper.
 
 
 
@@ -59,56 +52,18 @@ What's new
 
 * DOCUMENT INPUT/OUTPUT
 
-- Fix crash when saving certain documents with tables (bug 9049).
-
-- Fix crash when saving default template (bug 9236).
-
-- Do not sort advanced listings settings, since their insertion order is
-  relevant (bug 5203).
-
-- Fix import of latex documents with scaled fonts.
-
 
 
 * LYX2LYX
 
-- Fix warning Missing \use_indices when converting from 1.6.x format
-  or older.
-
-- Fix several conversion problems of beamer box arguments when the
-  arguments use multiple ERTs (part of bug 9208, bug 9225, bug 9144).
-
-- Fix conversion of beamer overlay arguments when the module
-  beamer-resenumerate is used (part of bug 9208).
-
 
 
 * USER INTERFACE
 
-- Do not forget last words of paragraphs in completion possibilities.
-
-- Select word on double click even when at boundary (bug 9159).
-
-- Fix listings inset parameter validation when font size is selected
-  (bug 8144).
-
-- Fix listings validator with regard to aboveskip and belowskip (bug 7373).
-
-- Fix reverse search in insets (figures, tables, branches, etc.) (bug 9151).
-
-- Fix on-screen display of images whose type is not known to LyX (bug 9146).
-
-- Fix the -geometry command line argument for Windows.
 
 
 * INTERNALS
 
-- Improve thread-safety.
-
-- Fix potential bug spotted by cppcheck.
-
-- Fix problems arising when converting floating point values to the
-  corresponding string representation (bugs 9190 and 9193).
 
 
 * DOCUMENTATION AND LOCALIZATION
@@ -129,4 +84,3 @@ What's new
 
 * BUILD/INSTALLATION
 
-- Fix compatibility issue with 64-bit cygwin.


[LyX/2.1.x] Fix alignment rendering of multirow in LyX (#8976)

2014-09-26 Thread Scott Kostyshak
commit 2cc0de8b8b80758d7d75c56cff6556928b114670
Author: Scott Kostyshak skost...@princeton.edu
Date:   Thu Feb 13 21:17:20 2014 -0500

Fix alignment rendering of multirow in LyX (#8976)

Multirow cells now have the same alignment rendering in LyX
as in the output. The alignment of a multirow can change as
long as the column is not of fixed width. If the column is
of fixed width, the multirow is left-aligned.

When setting a multirow, the alignment is copied from
the last cell in the selection.

diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index 39fa2f9..3f12358 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -1154,7 +1154,7 @@ void Tabular::setColumnPWidth(Cursor  cur, idx_type cell,
col_type const c = cellColumn(cell);
 
column_info[c].p_width = width;
-   // reset the vertical alignment to top if the fixed with
+   // reset the vertical alignment to top if the fixed width
// is removed or zero because only fixed width columns can
// have a vertical alignment
if (column_info[c].p_width.zero())
@@ -1164,6 +1164,8 @@ void Tabular::setColumnPWidth(Cursor  cur, idx_type cell,
// because of multicolumns
toggleFixedWidth(cur, cellInset(cell).get(),
 !getPWidth(cell).zero());
+   if (isMultiRow(cell))
+   setAlignment(cell, LYX_ALIGN_LEFT, false);
}
// cur paragraph can become invalid after paragraphs were merged
if (cur.pit()  cur.lastpit())
@@ -1718,7 +1720,8 @@ bool Tabular::hasMultiRow(row_type r) const
 }
 
 Tabular::idx_type Tabular::setMultiRow(idx_type cell, idx_type number,
-  bool const bottom_border)
+  bool const bottom_border,
+  LyXAlignment const halign)
 {
idx_type const col = cellColumn(cell);
idx_type const row = cellRow(cell);
@@ -1734,10 +1737,10 @@ Tabular::idx_type Tabular::setMultiRow(idx_type cell, 
idx_type number,
// be changed for the whole table row,
// support changing this only for the multirow cell can be done via
// \multirowsetup
-   // this feature would be a fileformat change
-   // until LyX supports this, use the deault alignment of multirow
-   // cells: left
-   cs.alignment = LYX_ALIGN_LEFT;
+   if (getPWidth(cell).zero())
+   cs.alignment = halign;
+   else
+   cs.alignment = LYX_ALIGN_LEFT;
 
// set the bottom line of the last selected cell
setBottomLine(cell, bottom_border);
@@ -5707,7 +5710,8 @@ void InsetTabular::tabularFeatures(Cursor  cur,
// check whether we are completely in a multirow
if (!tabular.isMultiRow(cur.idx()))
tabular.setMultiRow(cur.idx(), 1,
-   
tabular.bottomLine(cur.idx()));
+   
tabular.bottomLine(cur.idx()),
+   
tabular.getAlignment(cur.idx()));
break;
}
// we have a selection so this means we just add all this
@@ -5716,7 +5720,8 @@ void InsetTabular::tabularFeatures(Cursor  cur,
row_type const row_start = tabular.cellRow(s_start);
row_type const row_end = tabular.cellRow(cur.selEnd().idx());
cur.idx() = tabular.setMultiRow(s_start, row_end - row_start + 
1,
-   
tabular.bottomLine(cur.selEnd().idx()));
+   
tabular.bottomLine(cur.selEnd().idx()),
+   
tabular.getAlignment(cur.selEnd().idx()));
cur.pit() = 0;
cur.pos() = 0;
cur.setSelection(false);
diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h
index 565d5f6..8ef3709 100644
--- a/src/insets/InsetTabular.h
+++ b/src/insets/InsetTabular.h
@@ -525,7 +525,8 @@ public:
bool hasMultiRow(row_type r) const;
///
idx_type setMultiRow(idx_type cell, idx_type number,
-bool const bottom_border);
+bool const bottom_border,
+LyXAlignment const halign);
///
void unsetMultiRow(idx_type cell);
///
diff --git a/status.21x b/status.21x
index 10841f2..de54c03 100644
--- a/status.21x
+++ b/status.21x
@@ -60,6 +60,7 @@ What's new
 
 * USER INTERFACE
 
+- Fix alignment rendering of multirow in LyX (#8976)
 
 
 * INTERNALS


[LyX/2.1.x] Reset status file after 2.1.2 release

2014-09-26 Thread Scott Kostyshak
commit 427d0ef390088c9f308ab85053108b2f4a898409
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Fri Sep 26 22:34:01 2014 -0400

Reset status file after 2.1.2 release

diff --git a/status.21x b/status.21x
index 01e7ab8..10841f2 100644
--- a/status.21x
+++ b/status.21x
@@ -1,6 +1,6 @@
 -*- text -*-
 
-This file describes what has been done in the preparation of LyX 2.1.2.
+This file describes what has been done in the preparation of LyX 2.1.3.
 All comments are welcome.
 
 We try to group things by topic and in decreasing order of importance. 
@@ -13,7 +13,7 @@ For more details on how to use the repository, please visit:
   http://wiki.lyx.org/Devel/LyXGit
 A list of bugs fixed for this release can also be found at:
   http://www.lyx.org/trac/wiki/BugTrackerHome
-as well as a list of bugs still targeted to the 2.1.2 release.
+as well as a list of bugs still targeted to the 2.1.3 release.
 
 Richard Heck
 Branch Maintainer
@@ -36,21 +36,14 @@ What's new
 
 * USER INTERFACE
 
-- Detect some additional postscript and pdf viewers when they are on the
-  system PATH (AcroRd32, SumatraPDF, gsview and qpdfview).
 
 
 * DOCUMENTATION AND LOCALIZATION
 
-- Update docs explaining how to activate reverse search in qpdfview.
-
-- New French translations of the beamer examples.
 
 
 * BUILD/INSTALLATION
 
-- On Cygwin, use getent instead of grepping /etc/passwd for determining
-  the user's home directory when launching LyX through the gui wrapper.
 
 
 
@@ -59,56 +52,18 @@ What's new
 
 * DOCUMENT INPUT/OUTPUT
 
-- Fix crash when saving certain documents with tables (bug 9049).
-
-- Fix crash when saving default template (bug 9236).
-
-- Do not sort advanced listings settings, since their insertion order is
-  relevant (bug 5203).
-
-- Fix import of latex documents with scaled fonts.
-
 
 
 * LYX2LYX
 
-- Fix warning "Missing \use_indices" when converting from 1.6.x format
-  or older.
-
-- Fix several conversion problems of beamer box arguments when the
-  arguments use multiple ERTs (part of bug 9208, bug 9225, bug 9144).
-
-- Fix conversion of beamer overlay arguments when the module
-  "beamer-resenumerate" is used (part of bug 9208).
-
 
 
 * USER INTERFACE
 
-- Do not forget last words of paragraphs in completion possibilities.
-
-- Select word on double click even when at boundary (bug 9159).
-
-- Fix listings inset parameter validation when font size is selected
-  (bug 8144).
-
-- Fix listings validator with regard to aboveskip and belowskip (bug 7373).
-
-- Fix reverse search in insets (figures, tables, branches, etc.) (bug 9151).
-
-- Fix on-screen display of images whose type is not known to LyX (bug 9146).
-
-- Fix the -geometry command line argument for Windows.
 
 
 * INTERNALS
 
-- Improve thread-safety.
-
-- Fix potential bug spotted by cppcheck.
-
-- Fix problems arising when converting floating point values to the
-  corresponding string representation (bugs 9190 and 9193).
 
 
 * DOCUMENTATION AND LOCALIZATION
@@ -129,4 +84,3 @@ What's new
 
 * BUILD/INSTALLATION
 
-- Fix compatibility issue with 64-bit cygwin.


[LyX/2.1.x] Fix alignment rendering of multirow in LyX (#8976)

2014-09-26 Thread Scott Kostyshak
commit 2cc0de8b8b80758d7d75c56cff6556928b114670
Author: Scott Kostyshak <skost...@princeton.edu>
Date:   Thu Feb 13 21:17:20 2014 -0500

Fix alignment rendering of multirow in LyX (#8976)

Multirow cells now have the same alignment rendering in LyX
as in the output. The alignment of a multirow can change as
long as the column is not of fixed width. If the column is
of fixed width, the multirow is left-aligned.

When setting a multirow, the alignment is copied from
the last cell in the selection.

diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index 39fa2f9..3f12358 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -1154,7 +1154,7 @@ void Tabular::setColumnPWidth(Cursor & cur, idx_type cell,
col_type const c = cellColumn(cell);
 
column_info[c].p_width = width;
-   // reset the vertical alignment to top if the fixed with
+   // reset the vertical alignment to top if the fixed width
// is removed or zero because only fixed width columns can
// have a vertical alignment
if (column_info[c].p_width.zero())
@@ -1164,6 +1164,8 @@ void Tabular::setColumnPWidth(Cursor & cur, idx_type cell,
// because of multicolumns
toggleFixedWidth(cur, cellInset(cell).get(),
 !getPWidth(cell).zero());
+   if (isMultiRow(cell))
+   setAlignment(cell, LYX_ALIGN_LEFT, false);
}
// cur paragraph can become invalid after paragraphs were merged
if (cur.pit() > cur.lastpit())
@@ -1718,7 +1720,8 @@ bool Tabular::hasMultiRow(row_type r) const
 }
 
 Tabular::idx_type Tabular::setMultiRow(idx_type cell, idx_type number,
-  bool const bottom_border)
+  bool const bottom_border,
+  LyXAlignment const halign)
 {
idx_type const col = cellColumn(cell);
idx_type const row = cellRow(cell);
@@ -1734,10 +1737,10 @@ Tabular::idx_type Tabular::setMultiRow(idx_type cell, 
idx_type number,
// be changed for the whole table row,
// support changing this only for the multirow cell can be done via
// \multirowsetup
-   // this feature would be a fileformat change
-   // until LyX supports this, use the deault alignment of multirow
-   // cells: left
-   cs.alignment = LYX_ALIGN_LEFT;
+   if (getPWidth(cell).zero())
+   cs.alignment = halign;
+   else
+   cs.alignment = LYX_ALIGN_LEFT;
 
// set the bottom line of the last selected cell
setBottomLine(cell, bottom_border);
@@ -5707,7 +5710,8 @@ void InsetTabular::tabularFeatures(Cursor & cur,
// check whether we are completely in a multirow
if (!tabular.isMultiRow(cur.idx()))
tabular.setMultiRow(cur.idx(), 1,
-   
tabular.bottomLine(cur.idx()));
+   
tabular.bottomLine(cur.idx()),
+   
tabular.getAlignment(cur.idx()));
break;
}
// we have a selection so this means we just add all this
@@ -5716,7 +5720,8 @@ void InsetTabular::tabularFeatures(Cursor & cur,
row_type const row_start = tabular.cellRow(s_start);
row_type const row_end = tabular.cellRow(cur.selEnd().idx());
cur.idx() = tabular.setMultiRow(s_start, row_end - row_start + 
1,
-   
tabular.bottomLine(cur.selEnd().idx()));
+   
tabular.bottomLine(cur.selEnd().idx()),
+   
tabular.getAlignment(cur.selEnd().idx()));
cur.pit() = 0;
cur.pos() = 0;
cur.setSelection(false);
diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h
index 565d5f6..8ef3709 100644
--- a/src/insets/InsetTabular.h
+++ b/src/insets/InsetTabular.h
@@ -525,7 +525,8 @@ public:
bool hasMultiRow(row_type r) const;
///
idx_type setMultiRow(idx_type cell, idx_type number,
-bool const bottom_border);
+bool const bottom_border,
+LyXAlignment const halign);
///
void unsetMultiRow(idx_type cell);
///
diff --git a/status.21x b/status.21x
index 10841f2..de54c03 100644
--- a/status.21x
+++ b/status.21x
@@ -60,6 +60,7 @@ What's new
 
 * USER INTERFACE
 
+- Fix alignment rendering of multirow in LyX (#8976)
 
 
 * INTERNALS


[LyX/master] Insert menu accelerator 'x' now goes to box menu

2014-08-22 Thread Scott Kostyshak
commit f63146c0198bc9f2598d236bf69769deb905b028
Author: Scott Kostyshak skost...@lyx.org
Date:   Wed Aug 6 03:36:31 2014 -0400

Insert menu accelerator 'x' now goes to box menu

Before, 'x' would go to TeX Code but that already has a shortcut
in the common bind files.

Reported and discussed on lyx-devel at:
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg185082.html

diff --git a/lib/ui/stdmenus.inc b/lib/ui/stdmenus.inc
index 32ed83e..d26456d 100644
--- a/lib/ui/stdmenus.inc
+++ b/lib/ui/stdmenus.inc
@@ -365,7 +365,7 @@ Menuset
Submenu Branch|B insert_branches
Submenu Custom Insets insert_custom
Submenu File|e insert_file
-   Submenu Box[[Menu]] insert_box
+   Submenu Box[[Menu]]|x insert_box
OptSubmenu Insert Regular Expression context-edit-regexp
Separator
Item Citation...|C dialog-show-new-inset citation
@@ -382,7 +382,7 @@ Menuset
Item Footnote|F footnote-insert
Item Marginal Note|M marginalnote-insert
Arguments
-   Item TeX Code|X ert-insert
+   Item TeX Code ert-insert
Item Program Listing[[Menu]] listing-insert
Item Date date-insert
Item Preview|w preview-insert


[LyX/master] Insert menu accelerator 'x' now goes to box menu

2014-08-22 Thread Scott Kostyshak
commit f63146c0198bc9f2598d236bf69769deb905b028
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Wed Aug 6 03:36:31 2014 -0400

Insert menu accelerator 'x' now goes to box menu

Before, 'x' would go to "TeX Code" but that already has a shortcut
in the common bind files.

Reported and discussed on lyx-devel at:
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg185082.html

diff --git a/lib/ui/stdmenus.inc b/lib/ui/stdmenus.inc
index 32ed83e..d26456d 100644
--- a/lib/ui/stdmenus.inc
+++ b/lib/ui/stdmenus.inc
@@ -365,7 +365,7 @@ Menuset
Submenu "Branch|B" "insert_branches"
Submenu "Custom Insets" "insert_custom"
Submenu "File|e" "insert_file"
-   Submenu "Box[[Menu]]" "insert_box"
+   Submenu "Box[[Menu]]|x" "insert_box"
OptSubmenu "Insert Regular Expression" "context-edit-regexp"
Separator
Item "Citation...|C" "dialog-show-new-inset citation"
@@ -382,7 +382,7 @@ Menuset
Item "Footnote|F" "footnote-insert"
Item "Marginal Note|M" "marginalnote-insert"
Arguments
-   Item "TeX Code|X" "ert-insert"
+   Item "TeX Code" "ert-insert"
Item "Program Listing[[Menu]]" "listing-insert"
Item "Date" "date-insert"
Item "Preview|w" "preview-insert"


[LyX/master] Revert Clear empty selections in GuiView after dispatch

2014-08-03 Thread Scott Kostyshak
commit 453ce611919ff66d8b00bda9a9dcc32f4d38a843
Author: Scott Kostyshak skost...@lyx.org
Date:   Sun Aug 3 18:37:45 2014 -0400

Revert Clear empty selections in GuiView after dispatch

This reverts commit fb05011ad0db2e2c5e557d91f398970d75cf8d15,
which lead to various menu-related crashes, such as when
going to Help  About.

diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index d4ad5ad..a7cbbe4 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -3834,11 +3834,6 @@ void GuiView::dispatch(FuncRequest const  cmd, 
DispatchResult  dr)
if (menuBar()-isVisible()  lyxrc.full_screen_menubar)
menuBar()-hide();
}
-
-   // Clear non-empty selections
-   Cursor  cur = bv-cursor();
-   if (cur.selection()  cur.selBegin() == cur.selEnd())
-   cur.clearSelection();
 }
 
 


[LyX/master] Revert "Clear empty selections in GuiView after dispatch"

2014-08-03 Thread Scott Kostyshak
commit 453ce611919ff66d8b00bda9a9dcc32f4d38a843
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Sun Aug 3 18:37:45 2014 -0400

Revert "Clear empty selections in GuiView after dispatch"

This reverts commit fb05011ad0db2e2c5e557d91f398970d75cf8d15,
which lead to various menu-related crashes, such as when
going to Help > About.

diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index d4ad5ad..a7cbbe4 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -3834,11 +3834,6 @@ void GuiView::dispatch(FuncRequest const & cmd, 
DispatchResult & dr)
if (menuBar()->isVisible() && lyxrc.full_screen_menubar)
menuBar()->hide();
}
-
-   // Clear non-empty selections
-   Cursor & cur = bv->cursor();
-   if (cur.selection() && cur.selBegin() == cur.selEnd())
-   cur.clearSelection();
 }
 
 


[LyX/master] Revert AGUTeX template/layout: support the new cls name

2014-07-29 Thread Scott Kostyshak
commit e9c1a1943b167035511d35c10bc06ed68a7f21f9
Author: Scott Kostyshak skost...@lyx.org
Date:   Tue Jul 29 15:46:16 2014 -0400

Revert AGUTeX template/layout: support the new cls name

This reverts commit cde8707 and changes AGUTeX back to agutex.
The maintainer has changed AGUTeX.cls back to agutex.cls and has
confirmed (through private email) that he plans to keep the filename
all lowercase now that he is aware of case-sensitive file systems.

diff --git a/lib/layouts/agutex.layout b/lib/layouts/agutex.layout
index 514d45a..0a8b380 100644
--- a/lib/layouts/agutex.layout
+++ b/lib/layouts/agutex.layout
@@ -1,5 +1,5 @@
 #% Do not delete the line below; configure depends on this
-#  \DeclareLaTeXClass[AGUTeX]{American Geophysical Union (AGUTeX)}
+#  \DeclareLaTeXClass[agutex]{American Geophysical Union (AGUTeX)}
 #  \DeclareCategory{Articles}
 # AGUTeX textclass definition file.
 # Author: Uwe Stöhr (uwesto...@web.de)


[LyX/master] Revert "AGUTeX template/layout: support the new cls name"

2014-07-29 Thread Scott Kostyshak
commit e9c1a1943b167035511d35c10bc06ed68a7f21f9
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Tue Jul 29 15:46:16 2014 -0400

Revert "AGUTeX template/layout: support the new cls name"

This reverts commit cde8707 and changes "AGUTeX" back to "agutex".
The maintainer has changed "AGUTeX.cls" back to "agutex.cls" and has
confirmed (through private email) that he plans to keep the filename
all lowercase now that he is aware of case-sensitive file systems.

diff --git a/lib/layouts/agutex.layout b/lib/layouts/agutex.layout
index 514d45a..0a8b380 100644
--- a/lib/layouts/agutex.layout
+++ b/lib/layouts/agutex.layout
@@ -1,5 +1,5 @@
 #% Do not delete the line below; configure depends on this
-#  \DeclareLaTeXClass[AGUTeX]{American Geophysical Union (AGUTeX)}
+#  \DeclareLaTeXClass[agutex]{American Geophysical Union (AGUTeX)}
 #  \DeclareCategory{Articles}
 # AGUTeX textclass definition file.
 # Author: Uwe Stöhr (uwesto...@web.de)


[LyX/master] Clear empty selections in GuiView after dispatch

2014-07-28 Thread Scott Kostyshak
commit fb05011ad0db2e2c5e557d91f398970d75cf8d15
Author: Scott Kostyshak skost...@lyx.org
Date:   Wed Jun 25 16:50:31 2014 -0400

Clear empty selections in GuiView after dispatch

Empty selections can cause confusing behavior for a few reasons:

(1) some functions behave differently depending on whether there is a
selection. If I press delete, nothing happens (where I expect the
character or inset before the cusor to be deleted). If I toggle bold or
emphasize nothing happens (where if there is no selection the entire
word is toggled). There are other LyX functions that depend on whether
there is a selection or not. Further, I wonder if any part of LyX's code
assumes that if there is a selection it is non-empty.

(2) menu options are incorrectly set. For example, the scissors icon.

For remaining empty selection issues, see #9222.

For more information, see:
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg184758.html

diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index a7cbbe4..d4ad5ad 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -3834,6 +3834,11 @@ void GuiView::dispatch(FuncRequest const  cmd, 
DispatchResult  dr)
if (menuBar()-isVisible()  lyxrc.full_screen_menubar)
menuBar()-hide();
}
+
+   // Clear non-empty selections
+   Cursor  cur = bv-cursor();
+   if (cur.selection()  cur.selBegin() == cur.selEnd())
+   cur.clearSelection();
 }
 
 


[LyX/master] Disable branches insert menu if read only

2014-07-28 Thread Scott Kostyshak
commit 48436186558b8a8610a3ba88468d05799d0df01c
Author: Scott Kostyshak skost...@lyx.org
Date:   Wed Feb 19 16:58:31 2014 -0500

Disable branches insert menu if read only

diff --git a/src/frontends/qt4/Menus.cpp b/src/frontends/qt4/Menus.cpp
index eaf9f24..5a901d8 100644
--- a/src/frontends/qt4/Menus.cpp
+++ b/src/frontends/qt4/Menus.cpp
@@ -1392,7 +1392,7 @@ void MenuDefinition::expandToolbars()
 
 void MenuDefinition::expandBranches(Buffer const * buf)
 {
-   if (!buf)
+   if (!buf || buf-isReadonly())
return;
 
BufferParams const  master_params = buf-masterBuffer()-params();


[LyX/master] Submenus now expand even if all items are disabled

2014-07-28 Thread Scott Kostyshak
commit d449e7e64e1f074fcd9621f3675796cbac9d2656
Author: Scott Kostyshak skost...@lyx.org
Date:   Fri Feb 21 10:26:36 2014 -0500

Submenus now expand even if all items are disabled

As stated in the Apple HIG[1] (via JMarc):

  Ensure that a submenu’s title is undimmed even when all its commands
  are unavailable. As with menu titles, it’s important for users to be
  able to view a submenu’s contents, even if none of them are
  available in the current context.

[1]

https://developer.apple.com/library/mac/documentation/UserExperience/Conceptual/AppleHIGuidelines/Menus/Menus.html#//apple_ref/doc/uid/TP3356-TP6

diff --git a/src/frontends/qt4/Menus.cpp b/src/frontends/qt4/Menus.cpp
index 707251d..7fa219b 100644
--- a/src/frontends/qt4/Menus.cpp
+++ b/src/frontends/qt4/Menus.cpp
@@ -418,8 +418,7 @@ void MenuDefinition::addWithStatusCheck(MenuItem const  i)
// Only these kind of items affect the status 
of the submenu
if ((cit-kind() == MenuItem::Command
|| cit-kind() == MenuItem::Submenu
-   || cit-kind() == MenuItem::Help)
-cit-status().enabled()) {
+   || cit-kind() == MenuItem::Help)) {
enabled = true;
break;
}


[LyX/master] Disable custom insets insert menu if read only

2014-07-28 Thread Scott Kostyshak
commit 0bf61a48c0077121dc07d5ac1cfc090213409cf0
Author: Scott Kostyshak skost...@lyx.org
Date:   Wed Feb 19 16:58:29 2014 -0500

Disable custom insets insert menu if read only

Before, if a document was read only and had no custom insets
defined, the submenu would be enabled.

diff --git a/src/frontends/qt4/Menus.cpp b/src/frontends/qt4/Menus.cpp
index 7fa219b..eaf9f24 100644
--- a/src/frontends/qt4/Menus.cpp
+++ b/src/frontends/qt4/Menus.cpp
@@ -1214,7 +1214,7 @@ void MenuDefinition::expandFlexInsert(
}
}
// FIXME This is a little clunky.
-   if (items_.empty()  type == InsetLayout::CUSTOM)
+   if (items_.empty()  type == InsetLayout::CUSTOM  !buf-isReadonly())
add(MenuItem(MenuItem::Help, qt_(No Custom Insets Defined!)));
 }
 


[LyX/master] Clear empty selections in GuiView after dispatch

2014-07-28 Thread Scott Kostyshak
commit fb05011ad0db2e2c5e557d91f398970d75cf8d15
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Wed Jun 25 16:50:31 2014 -0400

Clear empty selections in GuiView after dispatch

Empty selections can cause confusing behavior for a few reasons:

(1) some functions behave differently depending on whether there is a
selection. If I press delete, nothing happens (where I expect the
character or inset before the cusor to be deleted). If I toggle bold or
emphasize nothing happens (where if there is no selection the entire
word is toggled). There are other LyX functions that depend on whether
there is a selection or not. Further, I wonder if any part of LyX's code
assumes that if there is a selection it is non-empty.

(2) menu options are incorrectly set. For example, the scissors icon.

For remaining empty selection issues, see #9222.

For more information, see:
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg184758.html

diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index a7cbbe4..d4ad5ad 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -3834,6 +3834,11 @@ void GuiView::dispatch(FuncRequest const & cmd, 
DispatchResult & dr)
if (menuBar()->isVisible() && lyxrc.full_screen_menubar)
menuBar()->hide();
}
+
+   // Clear non-empty selections
+   Cursor & cur = bv->cursor();
+   if (cur.selection() && cur.selBegin() == cur.selEnd())
+   cur.clearSelection();
 }
 
 


[LyX/master] Disable branches insert menu if read only

2014-07-28 Thread Scott Kostyshak
commit 48436186558b8a8610a3ba88468d05799d0df01c
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Wed Feb 19 16:58:31 2014 -0500

Disable branches insert menu if read only

diff --git a/src/frontends/qt4/Menus.cpp b/src/frontends/qt4/Menus.cpp
index eaf9f24..5a901d8 100644
--- a/src/frontends/qt4/Menus.cpp
+++ b/src/frontends/qt4/Menus.cpp
@@ -1392,7 +1392,7 @@ void MenuDefinition::expandToolbars()
 
 void MenuDefinition::expandBranches(Buffer const * buf)
 {
-   if (!buf)
+   if (!buf || buf->isReadonly())
return;
 
BufferParams const & master_params = buf->masterBuffer()->params();


[LyX/master] Submenus now expand even if all items are disabled

2014-07-28 Thread Scott Kostyshak
commit d449e7e64e1f074fcd9621f3675796cbac9d2656
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Fri Feb 21 10:26:36 2014 -0500

Submenus now expand even if all items are disabled

As stated in the Apple HIG[1] (via JMarc):

  Ensure that a submenu’s title is undimmed even when all its commands
  are unavailable. As with menu titles, it’s important for users to be
  able to view a submenu’s contents, even if none of them are
  available in the current context.

[1]

https://developer.apple.com/library/mac/documentation/UserExperience/Conceptual/AppleHIGuidelines/Menus/Menus.html#//apple_ref/doc/uid/TP3356-TP6

diff --git a/src/frontends/qt4/Menus.cpp b/src/frontends/qt4/Menus.cpp
index 707251d..7fa219b 100644
--- a/src/frontends/qt4/Menus.cpp
+++ b/src/frontends/qt4/Menus.cpp
@@ -418,8 +418,7 @@ void MenuDefinition::addWithStatusCheck(MenuItem const & i)
// Only these kind of items affect the status 
of the submenu
if ((cit->kind() == MenuItem::Command
|| cit->kind() == MenuItem::Submenu
-   || cit->kind() == MenuItem::Help)
-   && cit->status().enabled()) {
+   || cit->kind() == MenuItem::Help)) {
enabled = true;
break;
}


[LyX/master] Disable custom insets insert menu if read only

2014-07-28 Thread Scott Kostyshak
commit 0bf61a48c0077121dc07d5ac1cfc090213409cf0
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Wed Feb 19 16:58:29 2014 -0500

Disable custom insets insert menu if read only

Before, if a document was read only and had no custom insets
defined, the submenu would be enabled.

diff --git a/src/frontends/qt4/Menus.cpp b/src/frontends/qt4/Menus.cpp
index 7fa219b..eaf9f24 100644
--- a/src/frontends/qt4/Menus.cpp
+++ b/src/frontends/qt4/Menus.cpp
@@ -1214,7 +1214,7 @@ void MenuDefinition::expandFlexInsert(
}
}
// FIXME This is a little clunky.
-   if (items_.empty() && type == InsetLayout::CUSTOM)
+   if (items_.empty() && type == InsetLayout::CUSTOM && !buf->isReadonly())
add(MenuItem(MenuItem::Help, qt_("No Custom Insets Defined!")));
 }
 


[LyX/2.1.x] Backport 'select word on double click at boundary'

2014-07-26 Thread Scott Kostyshak
commit 63f980bc040581d6ac0f25a8521978afae1ed316
Author: Scott Kostyshak skost...@lyx.org
Date:   Fri Jun 13 09:43:26 2014 -0400

Backport 'select word on double click at boundary'

Now when double clicking on a boundary of a word, the
word is selected. This also causes single-letter words
to now be selected (fixes #9159).

Backported from bcbc162.

diff --git a/src/Text3.cpp b/src/Text3.cpp
index 41e47a5..5231391 100644
--- a/src/Text3.cpp
+++ b/src/Text3.cpp
@@ -1514,7 +1514,7 @@ void Text::dispatch(Cursor  cur, FuncRequest  cmd)
 
case LFUN_MOUSE_DOUBLE:
if (cmd.button() == mouse_button::button1) {
-   selectWord(cur, WHOLE_WORD_STRICT);
+   selectWord(cur, WHOLE_WORD);
bv-cursor() = cur;
}
break;
diff --git a/status.21x b/status.21x
index 46333c2..7b7e6d2 100644
--- a/status.21x
+++ b/status.21x
@@ -63,6 +63,7 @@ What's new
 * USER INTERFACE
 
 - Do not forget last words of paragraphs in completion possibilities.
+- Select word on double click even when at boundary (#9159).
 
 
 * INTERNALS


[LyX/2.1.x] Backport 'select word on double click at boundary'

2014-07-26 Thread Scott Kostyshak
commit 63f980bc040581d6ac0f25a8521978afae1ed316
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Fri Jun 13 09:43:26 2014 -0400

Backport 'select word on double click at boundary'

Now when double clicking on a boundary of a word, the
word is selected. This also causes single-letter words
to now be selected (fixes #9159).

Backported from bcbc162.

diff --git a/src/Text3.cpp b/src/Text3.cpp
index 41e47a5..5231391 100644
--- a/src/Text3.cpp
+++ b/src/Text3.cpp
@@ -1514,7 +1514,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
 
case LFUN_MOUSE_DOUBLE:
if (cmd.button() == mouse_button::button1) {
-   selectWord(cur, WHOLE_WORD_STRICT);
+   selectWord(cur, WHOLE_WORD);
bv->cursor() = cur;
}
break;
diff --git a/status.21x b/status.21x
index 46333c2..7b7e6d2 100644
--- a/status.21x
+++ b/status.21x
@@ -63,6 +63,7 @@ What's new
 * USER INTERFACE
 
 - Do not forget last words of paragraphs in completion possibilities.
+- Select word on double click even when at boundary (#9159).
 
 
 * INTERNALS


<    5   6   7   8   9   10   11   12   13   14   >