[LyX/master] Use getent instead of grepping /etc/passwd.

2014-07-13 Thread Enrico Forestieri
commit ff506c8e427e71b36759d09a012076cf59369e7e
Author: Enrico Forestieri for...@lyx.org
Date:   Sun Jul 13 14:39:05 2014 +0200

Use getent instead of grepping /etc/passwd.

Forthcoming versions of cygwin will use a different mechanism for
obtaining passwd/group information based on /etc/nsswitch.conf.
Thus, it will not be guaranteed that the files /etc/passwd and
/etc/group even exist. The recommended way for obtaining those
info is by using the getent command, which already works in
current versions.

diff --git a/development/cygwin/lyxprofile b/development/cygwin/lyxprofile
index f51bd55..afa21be 100644
--- a/development/cygwin/lyxprofile
+++ b/development/cygwin/lyxprofile
@@ -1,7 +1,7 @@
 # Set up the home directory if not already set in the system environment.
 if [ -z ${HOME} ]; then
   USER=`id -un`
-  HOME=`grep ^${USER}: /etc/passwd | cut -d: -f6`
+  HOME=`getent passwd ${USER} | cut -d: -f6`
   if [ -z ${HOME} -o ! -d ${HOME} ]; then
 HOME=/home/${USER}
 test -d ${HOME} || HOME=/tmp


[LyX/master] Add some postscript and pdf viewers for Unix and Windows.

2014-07-13 Thread Enrico Forestieri
commit d5210c555a4b51fa73eb447f2d86172185562a11
Author: Enrico Forestieri for...@lyx.org
Date:   Sun Jul 13 19:59:31 2014 +0200

Add some postscript and pdf viewers for Unix and Windows.

For Windows: AcroRd32 and gsview (both 32 and 64 bit versions).
For Unix: qpdfview.

Qpdfview is a nice alternative to Okular for KDE users and a superior
alternative to Evince for Gnome users, due to its complete synctex
support. It only depends on Qt libraries for the graphical interface.

diff --git a/lib/configure.py b/lib/configure.py
index c8e8267..db2df66 100644
--- a/lib/configure.py
+++ b/lib/configure.py
@@ -646,15 +646,15 @@ def checkFormatEntries(dtl_tools):
 #
 #checkProg('a Postscript interpreter', ['gs'],
 #  rc_entry = [ r'\ps_command %%' ])
-checkViewer('a Postscript previewer', ['kghostview', 'okular', 'evince', 
'gv', 'ghostview -swap'],
+checkViewer('a Postscript previewer', ['kghostview', 'okular', 'qpdfview 
--unique', 'evince', 'gv', 'ghostview -swap', 'gsview64', 'gsview32'],
 rc_entry = [r'''\Format epseps EPS 
%%vectorimage/x-eps
 \Format eps2   epsEPS (uncropped)%%
vector
 \Format eps3   epsEPS (cropped)  %%
document,menu=export  
 \Format ps ps  Postscript t  %%
document,vector,menu=export   application/postscript'''])
 # for xdg-open issues look here: 
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg151818.html
 # the MIME type is set for pdf6, because that one needs to be 
autodetectable by libmime
-checkViewer('a PDF previewer', ['pdfview', 'kpdf', 'okular', 'evince', 
'kghostview', 'xpdf', 'SumatraPDF', 'acrobat', 'acroread', 'mupdf', \
-   'gv', 'ghostview'],
+checkViewer('a PDF previewer', ['pdfview', 'kpdf', 'okular', 'qpdfview 
--unique', 'evince', 'kghostview', 'xpdf', 'SumatraPDF', 'acrobat', 'acroread', 
'mupdf', \
+   'gv', 'ghostview', 'AcroRd32', 'gsview64', 'gsview32'],
 rc_entry = [r'''\Format pdfpdfPDF (ps2pdf)  P  
%%document,vector,menu=export   
 \Format pdf2   pdfPDF (pdflatex)F  %%
document,vector,menu=export   
 \Format pdf3   pdfPDF (dvipdfm) m  %%
document,vector,menu=export   


[LyX/master] Add forward search command for qpdfview.

2014-07-13 Thread Enrico Forestieri
commit 294d08b1bfd58452fe4f43049b957fb145d4fb52
Author: Enrico Forestieri for...@lyx.org
Date:   Sun Jul 13 20:08:43 2014 +0200

Add forward search command for qpdfview.

Also update docs explaining how to activate reverse search in qpdfview.

diff --git a/lib/doc/Additional.lyx b/lib/doc/Additional.lyx
index 2d76f55..fdf693f 100644
--- a/lib/doc/Additional.lyx
+++ b/lib/doc/Additional.lyx
@@ -131,11 +131,12 @@ End
 \papercolumns 1
 \papersides 2
 \paperpagestyle headings
-\tracking_changes false
+\tracking_changes true
 \output_changes false
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict true
+\author 711066561 Enrico Forestieri 
 \end_header
 
 \begin_body
@@ -5252,7 +5253,47 @@ lyxpipe
 
 \end_inset
 
- on Windows (but any working path can be used).
+ on Windows (
+\change_deleted 711066561 1405258697
+but
+\change_inserted 711066561 1405258701
+where
+\change_unchanged
+ any working path 
+\change_inserted 711066561 1405258613
+instead of lyxpipe 
+\change_unchanged
+can be used
+\change_inserted 711066561 1405258962
+, for example 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 711066561 1405258868
+
+\backslash
+
+\backslash
+.
+\backslash
+pipe
+\backslash
+my
+\backslash
+lyx
+\backslash
+pipe
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+ would also work
+\change_unchanged
+).
  You 
 \emph on
 must
@@ -5341,13 +5382,20 @@ lyx -dbg lyxserver
 \end_layout
 
 \begin_layout Standard
-You can find a complete example client written in C in the source distribution
- as 
+You can find a complete example client written in C
+\change_inserted 711066561 1405258366
+++
+\change_unchanged
+ in the source distribution as 
 \begin_inset Flex Code
 status collapsed
 
 \begin_layout Plain Layout
 development/lyxserver/server_monitor.c
+\change_inserted 711066561 1405258386
+pp
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -5356,7 +5404,11 @@ development/lyxserver/server_monitor.c
 \end_layout
 
 \begin_layout Standard
-Another useful tool is the command-line based clientfound in 
+Another useful tool is the command-line based client
+\change_inserted 711066561 1405258403
+ 
+\change_unchanged
+found in 
 \begin_inset Flex Code
 status collapsed
 
@@ -5696,8 +5748,11 @@ Some DVI/PDF viewers
 status collapsed
 
 \begin_layout Plain Layout
-The following viewers offer the reverse PDF search feature: Okular on 
KDE/Linux,
- Skim on Mac OSX and SumatraPDF on Windows.
+The following viewers offer the reverse PDF search feature: Okular on KDE/Linux
+\change_inserted 711066561 1405273809
+, Qpdfview on Unix
+\change_unchanged
+, Skim on Mac OSX and SumatraPDF on Windows.
 \end_layout
 
 \end_inset
@@ -5842,7 +5897,13 @@ synctex=-1
 \end_layout
 
 \begin_layout Standard
-Please aöso note that including the 
+Please a
+\change_deleted 711066561 1405259326
+ö
+\change_inserted 711066561 1405259326
+l
+\change_unchanged
+so note that including the 
 \begin_inset Flex Code
 status collapsed
 
@@ -6154,8 +6215,11 @@ The generation of the required info can be forced by 
changing the converter
 \end_inset
 
 .
- Also note that only a few PDF viewers (Skim on the Mac, SumatraPDF on Windows)
- already provide SyncTeX support.
+ Also note that only a few PDF viewers (
+\change_inserted 711066561 1405273879
+Okular and Qpdfview on Unix, 
+\change_unchanged
+Skim on the Mac, SumatraPDF on Windows) already provide SyncTeX support.
 \end_layout
 
 \begin_layout Standard
@@ -6636,6 +6700,68 @@ lyxclient -g %f %l
 
 \begin_layout Standard
 Reverse search is triggered by SHIFT-click.
+\change_inserted 711066561 1405259853
+
+\end_layout
+
+\begin_layout Subsubsection*
+
+\change_inserted 711066561 1405273730
+Qpdfview (Unix)
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 711066561 1405263147
+Qpdfview supports SyncTeX since version 0.3.5.
+ Go to 
+\begin_inset Flex MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 711066561 1405260331
+Edit\SpecialChar \menuseparator
+Settings\SpecialChar \ldots{}
+\SpecialChar \menuseparator
+Behavior
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+, click on the input field of the 
+\begin_inset Quotes eld
+\end_inset
+
+Source editor
+\begin_inset Quotes erd
+\end_inset
+
+ item and add the command 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 711066561 1405260473
+lyxclient -g %1 %2
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 711066561 1405260506
+Reverse search is triggered by double-click.
+\change_unchanged
+
 \end_layout
 
 \begin_layout Subsubsection*
@@ -7181,7 +7307,7 @@ $$o
 Note that only some of the viewers provide full forward search functionality,
  among them yap, xdvi, okular
 \begin_inset Foot
-status open
+status collapsed
 
 \begin_layout Plain Layout
 You might want to set 
@@ -7216,15 +7342,35 @@ Formats
 
 \end_inset
 
- and Sumatra PDF
+

[LyX/master] Use getent instead of grepping /etc/passwd.

2014-07-13 Thread Enrico Forestieri
commit ff506c8e427e71b36759d09a012076cf59369e7e
Author: Enrico Forestieri 
Date:   Sun Jul 13 14:39:05 2014 +0200

Use getent instead of grepping /etc/passwd.

Forthcoming versions of cygwin will use a different mechanism for
obtaining passwd/group information based on /etc/nsswitch.conf.
Thus, it will not be guaranteed that the files /etc/passwd and
/etc/group even exist. The recommended way for obtaining those
info is by using the getent command, which already works in
current versions.

diff --git a/development/cygwin/lyxprofile b/development/cygwin/lyxprofile
index f51bd55..afa21be 100644
--- a/development/cygwin/lyxprofile
+++ b/development/cygwin/lyxprofile
@@ -1,7 +1,7 @@
 # Set up the home directory if not already set in the system environment.
 if [ -z "${HOME}" ]; then
   USER=`id -un`
-  HOME=`grep "^${USER}:" /etc/passwd | cut -d: -f6`
+  HOME=`getent passwd "${USER}" | cut -d: -f6`
   if [ -z "${HOME}" -o ! -d "${HOME}" ]; then
 HOME="/home/${USER}"
 test -d "${HOME}" || HOME=/tmp


[LyX/master] Add some postscript and pdf viewers for Unix and Windows.

2014-07-13 Thread Enrico Forestieri
commit d5210c555a4b51fa73eb447f2d86172185562a11
Author: Enrico Forestieri 
Date:   Sun Jul 13 19:59:31 2014 +0200

Add some postscript and pdf viewers for Unix and Windows.

For Windows: AcroRd32 and gsview (both 32 and 64 bit versions).
For Unix: qpdfview.

Qpdfview is a nice alternative to Okular for KDE users and a superior
alternative to Evince for Gnome users, due to its complete synctex
support. It only depends on Qt libraries for the graphical interface.

diff --git a/lib/configure.py b/lib/configure.py
index c8e8267..db2df66 100644
--- a/lib/configure.py
+++ b/lib/configure.py
@@ -646,15 +646,15 @@ def checkFormatEntries(dtl_tools):
 #
 #checkProg('a Postscript interpreter', ['gs'],
 #  rc_entry = [ r'\ps_command "%%"' ])
-checkViewer('a Postscript previewer', ['kghostview', 'okular', 'evince', 
'gv', 'ghostview -swap'],
+checkViewer('a Postscript previewer', ['kghostview', 'okular', 'qpdfview 
--unique', 'evince', 'gv', 'ghostview -swap', 'gsview64', 'gsview32'],
 rc_entry = [r'''\Format epseps EPS"" 
"%%"  ""  "vector""image/x-eps"
 \Format eps2   eps"EPS (uncropped)"   "" "%%"  ""  
"vector"""
 \Format eps3   eps"EPS (cropped)" "" "%%"  ""  
"document,menu=export"  ""
 \Format ps ps  Postscript t  "%%"  ""  
"document,vector,menu=export"   "application/postscript"'''])
 # for xdg-open issues look here: 
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg151818.html
 # the MIME type is set for pdf6, because that one needs to be 
autodetectable by libmime
-checkViewer('a PDF previewer', ['pdfview', 'kpdf', 'okular', 'evince', 
'kghostview', 'xpdf', 'SumatraPDF', 'acrobat', 'acroread', 'mupdf', \
-   'gv', 'ghostview'],
+checkViewer('a PDF previewer', ['pdfview', 'kpdf', 'okular', 'qpdfview 
--unique', 'evince', 'kghostview', 'xpdf', 'SumatraPDF', 'acrobat', 'acroread', 
'mupdf', \
+   'gv', 'ghostview', 'AcroRd32', 'gsview64', 'gsview32'],
 rc_entry = [r'''\Format pdfpdf"PDF (ps2pdf)"  P  
"%%"  ""  "document,vector,menu=export"   ""
 \Format pdf2   pdf"PDF (pdflatex)"F  "%%"  ""  
"document,vector,menu=export"   ""
 \Format pdf3   pdf"PDF (dvipdfm)" m  "%%"  ""  
"document,vector,menu=export"   ""


[LyX/master] Add forward search command for qpdfview.

2014-07-13 Thread Enrico Forestieri
commit 294d08b1bfd58452fe4f43049b957fb145d4fb52
Author: Enrico Forestieri 
Date:   Sun Jul 13 20:08:43 2014 +0200

Add forward search command for qpdfview.

Also update docs explaining how to activate reverse search in qpdfview.

diff --git a/lib/doc/Additional.lyx b/lib/doc/Additional.lyx
index 2d76f55..fdf693f 100644
--- a/lib/doc/Additional.lyx
+++ b/lib/doc/Additional.lyx
@@ -131,11 +131,12 @@ End
 \papercolumns 1
 \papersides 2
 \paperpagestyle headings
-\tracking_changes false
+\tracking_changes true
 \output_changes false
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict true
+\author 711066561 "Enrico Forestieri" 
 \end_header
 
 \begin_body
@@ -5252,7 +5253,47 @@ lyxpipe"
 
 \end_inset
 
- on Windows (but any working path can be used).
+ on Windows (
+\change_deleted 711066561 1405258697
+but
+\change_inserted 711066561 1405258701
+where
+\change_unchanged
+ any working path 
+\change_inserted 711066561 1405258613
+instead of lyxpipe 
+\change_unchanged
+can be used
+\change_inserted 711066561 1405258962
+, for example 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 711066561 1405258868
+"
+\backslash
+
+\backslash
+.
+\backslash
+pipe
+\backslash
+my
+\backslash
+lyx
+\backslash
+pipe"
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+ would also work
+\change_unchanged
+).
  You 
 \emph on
 must
@@ -5341,13 +5382,20 @@ lyx -dbg lyxserver
 \end_layout
 
 \begin_layout Standard
-You can find a complete example client written in C in the source distribution
- as 
+You can find a complete example client written in C
+\change_inserted 711066561 1405258366
+++
+\change_unchanged
+ in the source distribution as 
 \begin_inset Flex Code
 status collapsed
 
 \begin_layout Plain Layout
 development/lyxserver/server_monitor.c
+\change_inserted 711066561 1405258386
+pp
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -5356,7 +5404,11 @@ development/lyxserver/server_monitor.c
 \end_layout
 
 \begin_layout Standard
-Another useful tool is the command-line based clientfound in 
+Another useful tool is the command-line based client
+\change_inserted 711066561 1405258403
+ 
+\change_unchanged
+found in 
 \begin_inset Flex Code
 status collapsed
 
@@ -5696,8 +5748,11 @@ Some DVI/PDF viewers
 status collapsed
 
 \begin_layout Plain Layout
-The following viewers offer the reverse PDF search feature: Okular on 
KDE/Linux,
- Skim on Mac OSX and SumatraPDF on Windows.
+The following viewers offer the reverse PDF search feature: Okular on KDE/Linux
+\change_inserted 711066561 1405273809
+, Qpdfview on Unix
+\change_unchanged
+, Skim on Mac OSX and SumatraPDF on Windows.
 \end_layout
 
 \end_inset
@@ -5842,7 +5897,13 @@ synctex=-1
 \end_layout
 
 \begin_layout Standard
-Please aöso note that including the 
+Please a
+\change_deleted 711066561 1405259326
+ö
+\change_inserted 711066561 1405259326
+l
+\change_unchanged
+so note that including the 
 \begin_inset Flex Code
 status collapsed
 
@@ -6154,8 +6215,11 @@ The generation of the required info can be forced by 
changing the converter
 \end_inset
 
 .
- Also note that only a few PDF viewers (Skim on the Mac, SumatraPDF on Windows)
- already provide SyncTeX support.
+ Also note that only a few PDF viewers (
+\change_inserted 711066561 1405273879
+Okular and Qpdfview on Unix, 
+\change_unchanged
+Skim on the Mac, SumatraPDF on Windows) already provide SyncTeX support.
 \end_layout
 
 \begin_layout Standard
@@ -6636,6 +6700,68 @@ lyxclient -g %f %l
 
 \begin_layout Standard
 Reverse search is triggered by SHIFT-click.
+\change_inserted 711066561 1405259853
+
+\end_layout
+
+\begin_layout Subsubsection*
+
+\change_inserted 711066561 1405273730
+Qpdfview (Unix)
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 711066561 1405263147
+Qpdfview supports SyncTeX since version 0.3.5.
+ Go to 
+\begin_inset Flex MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 711066561 1405260331
+Edit\SpecialChar \menuseparator
+Settings\SpecialChar \ldots{}
+\SpecialChar \menuseparator
+Behavior
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+, click on the input field of the 
+\begin_inset Quotes eld
+\end_inset
+
+Source editor
+\begin_inset Quotes erd
+\end_inset
+
+ item and add the command 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 711066561 1405260473
+lyxclient -g %1 %2
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 711066561 1405260506
+Reverse search is triggered by double-click.
+\change_unchanged
+
 \end_layout
 
 \begin_layout Subsubsection*
@@ -7181,7 +7307,7 @@ $$o
 Note that only some of the viewers provide full forward search functionality,
  among them yap, xdvi, okular
 \begin_inset Foot
-status open
+status collapsed
 
 \begin_layout Plain Layout
 You might want to set 
@@ -7216,15 +7342,35 @@ Formats
 
 \end_inset
 
- and Sumatra PDF
+