Re: Document viewer preferences (was: Fwd: X-Apps)

2017-01-23 Thread Stephan Witt
Am 23.01.2017 um 15:06 schrieb Guenter Milde :
> 
> On 2017-01-22, Stephan Witt wrote:
>> Am 11.01.2017 um 21:57 schrieb Guenter Milde :
> 
>>> I added some X-Apps just behind their anchestors (GNOME equivalents) to
>>> configure.py.
> 
> ...
> 
>> What if some command in this list does different things on different
>> platforms?
> 
> In case of a program name belonging to some out-of-scope program on a
> platform, we have to refine the checks:
> 
> * placing a "catchall" for the platform in question before the false
>  friend, or 
> * adding a platform check to the configure script and use different lists.
> 
>> ATM, the command xed on Mac is presumable comparable with xed on Linux.
>> It’s the Xcode editor (from the man page: The xed tool launches the 
>> Xcode application and opens the given documents, or opens a new
>> untitled document, optionally with the contents of standard in).
> 
> Fortunately, this seems still a good choice to have a look at text files and
> LaTeX sources. If there is a better (or more obvious) choice for the Mac, we
> can insert it at an earlier location (after checking it does not interfere 
> with
> other plattforms;)

I’m trying to understand the current situation on a Mac and there are some 
questions.

The flow as I understood it is as follows:
1. configure.py checks for an editor and an viewer - but not always
2. in case of a tested but missing editor/viewer this results in „auto“
3. at runtime LyX tests a given format with a command or „auto“ for an 
OS-defined command (on Mac and Windows)
4. this test is made by the first extension only (e.g jpg for {„jpg“,“jpeg“})
5. if a matching command is found the viewer/editor is set to „auto“ 
(regardless of the command at configure time)
6. if a command has an editor but no viewer is expected by configure.py the 
viewer remains undefined (see 1)

Why all these tests in step 2?
Why is an editor not an viewer too?
Where is a viewer used by LyX? (I didn’t find the time to look it up myself)
Why not testing for all extensions until a matching command is there?
Why not using the mime-types at all?

I don’t ask you to answer these questions. I only want to clarify that ATM it 
doesn’t matter
if configure.py finds „xed“ or something else for e.g. the „asciichess“ format.

Stephan

Re: Document viewer preferences (was: Fwd: X-Apps)

2017-01-23 Thread Guenter Milde
On 2017-01-22, Stephan Witt wrote:
> Am 11.01.2017 um 21:57 schrieb Guenter Milde :

>> I added some X-Apps just behind their anchestors (GNOME equivalents) to
>> configure.py.

...

> What if some command in this list does different things on different
> platforms?

In case of a program name belonging to some out-of-scope program on a
platform, we have to refine the checks:

* placing a "catchall" for the platform in question before the false
  friend, or 
* adding a platform check to the configure script and use different lists.

> ATM, the command xed on Mac is presumable comparable with xed on Linux.
> It’s the Xcode editor (from the man page: The xed tool launches the 
> Xcode application and opens the given documents, or opens a new
> untitled document, optionally with the contents of standard in).

Fortunately, this seems still a good choice to have a look at text files and
LaTeX sources. If there is a better (or more obvious) choice for the Mac, we
can insert it at an earlier location (after checking it does not interfere with
other plattforms;)

Thanks,

Günter



Re: Document viewer preferences (was: Fwd: X-Apps)

2017-01-22 Thread Stephan Witt
Am 11.01.2017 um 21:57 schrieb Guenter Milde :
> 
> Dear LyX developers,
> 
> I added some X-Apps just behind their anchestors (GNOME equivalents) to
> configure.py.
> 
> However, there are open points from the discussion:
> 
> On 2017-01-08, Paul A. Rubin wrote:
> 
>> My default text editor would be 
>> notepad, which would require running the Wine emulator. 
> 
> I propose to place "notepad" at the end of the text editor selection list:
> 
> checkViewerEditor('a text editor',
> ['xemacs', 'gvim', 'kedit', 'kwrite', 'kate',
> - 'nedit', 'gedit', 'notepad',
> - 'geany', 'leafpad', 'mousepad', 'xed'],
> + 'nedit', 'gedit', 'geany', 'leafpad', 'mousepad', 'xed', 'notepad‘],

What if some command in this list does different things on different platforms?

ATM, the command xed on Mac is presumable comparable with xed on Linux.
It’s the Xcode editor (from the man page: The xed tool launches the 
Xcode application and opens the given documents, or opens a new untitled 
document,
optionally with the contents of standard in).

Stephan
 
> 
> * Notepad under Wine is not a good choice for Linux 
>   (but comes with wine by default)
> * Windows users will not have the Linux programs and not be disturbed.
>   An exception is "geany" that may also be present under Windows.
>   If this is an issue, we can put "geany" at the end, too.
> 
>> My default image viewer would be gimp, which I find much too cumbersome
>> just for looking at an image.
> 
> Here, I propose to add the most common image viewers to the selection list:
> 
> -path, iv = checkViewerNoRC('a raster image viewer', ['xv', 'kview', 
> 'gimp-remote', 'gimp'], rc_entry = [imageformats])
> -path, ie = checkEditorNoRC('a raster image editor', ['gimp-remote', 
> 'gimp'], rc_entry = [imageformats])
> +path, iv = checkViewerNoRC('a raster image viewer',
> +['xv', 'kview', 'eog', 'xviewer', 'ristretto', 'gpicview', 
> 'lximage-qt', 
> + 'gimp-remote', 'gimp'],
> +rc_entry = [imageformats])
> +path, ie = checkEditorNoRC('a raster image editor', 
> +['gimp-remote', 'gimp'], rc_entry = [imageformats])
> 
> eog: Eye of Gnome, the Gnome default viewer
> xviewer: Eye of Gnome successor for MATE and Cinnamon
> ristretto:   XFCE image viewer
> gpicview:LXDE image viewer
> lximage-qt:  QXDE image viewer
> 
> 
> Possible other additions:
> 
> gwenview:KDE image viewer
> 
> xdg-open:generic file handler
> 
> The problem with xdg-open is, that it calls the browser
> (firefox) as fallback. This is not good for DVI and PDF, but
> may be better than Gimp for raster images.
> 
> Günter
> 



Document viewer preferences (was: Fwd: X-Apps)

2017-01-11 Thread Guenter Milde
Dear LyX developers,

I added some X-Apps just behind their anchestors (GNOME equivalents) to
configure.py.

However, there are open points from the discussion:

On 2017-01-08, Paul A. Rubin wrote:

> My default text editor would be 
> notepad, which would require running the Wine emulator. 

I propose to place "notepad" at the end of the text editor selection list:

 checkViewerEditor('a text editor',
 ['xemacs', 'gvim', 'kedit', 'kwrite', 'kate',
- 'nedit', 'gedit', 'notepad',
- 'geany', 'leafpad', 'mousepad', 'xed'],
+ 'nedit', 'gedit', 'geany', 'leafpad', 'mousepad', 'xed', 'notepad'],

 * Notepad under Wine is not a good choice for Linux 
   (but comes with wine by default)
 * Windows users will not have the Linux programs and not be disturbed.
   An exception is "geany" that may also be present under Windows.
   If this is an issue, we can put "geany" at the end, too.

> My default image viewer would be gimp, which I find much too cumbersome
> just for looking at an image.

Here, I propose to add the most common image viewers to the selection list:

-path, iv = checkViewerNoRC('a raster image viewer', ['xv', 'kview', 
'gimp-remote', 'gimp'], rc_entry = [imageformats])
-path, ie = checkEditorNoRC('a raster image editor', ['gimp-remote', 
'gimp'], rc_entry = [imageformats])
+path, iv = checkViewerNoRC('a raster image viewer',
+['xv', 'kview', 'eog', 'xviewer', 'ristretto', 'gpicview', 
'lximage-qt', 
+ 'gimp-remote', 'gimp'],
+rc_entry = [imageformats])
+path, ie = checkEditorNoRC('a raster image editor', 
+['gimp-remote', 'gimp'], rc_entry = [imageformats])

 eog: Eye of Gnome, the Gnome default viewer
 xviewer: Eye of Gnome successor for MATE and Cinnamon
 ristretto:   XFCE image viewer
 gpicview:LXDE image viewer
 lximage-qt:  QXDE image viewer
 
 
Possible other additions:

 gwenview:KDE image viewer
 
 xdg-open:generic file handler
 
  The problem with xdg-open is, that it calls the browser
  (firefox) as fallback. This is not good for DVI and PDF, but
  may be better than Gimp for raster images.
  
Günter



Re: Fwd: X-Apps

2017-01-10 Thread Guenter Milde
On 2017-01-08, Paul A. Rubin wrote:
> On 01/07/2017 11:03 PM, Pavel Sanda wrote:

...
>> While I see what you are saying about image viewer/text editor I don't see
>> how that "earns"
>> xreader > 'gv', 'ghostview -swap', 'gsview64', 'gsview32'
>> xreader > 'kghostview', 'xpdf', 'SumatraPDF', 'acrobat', 'acroread', 'mupdf'
>> xreader > 'kdvi', 'okular', 'yap', 'dviout -Set=!m'
>> for people out of your distro.

...

> I can understand your being concerned about users suddenly finding a
> different viewer than what they previously had, but my understanding is
> that the X-Apps are direct substitutes for evince, gedit and (I think)
> xv, so it makes sense to me that their precedence in the list would
> match the precedence assigned to the apps they're replacing.

Let me second that: 

`xreader` "earns" the place just after `evince` by inheritance:

* for people using the XFCE, Cinnamon, or MATE desktop, `xreader` replaces
  `evince` (same functionality, traditional UI),
  
* KDE and GNOME users will not see any difference, as the respective viewers
  have higher priority.  

* most other users will not be disturbed, because
  nothing changes if the "X-Apps" are not installed at the users system.

* for the rare case of users that did not have evince but now install
  `xreader`, the change is more likely intended than not.

Günter  



Re: Fwd: X-Apps

2017-01-08 Thread Paul A. Rubin

On 01/07/2017 11:03 PM, Pavel Sanda wrote:

My understanding of your issue was that suddenly you were left without _any_
pdf viewer. For this putting the new pdf viewer at the end of list should work
and I am happy to fix that.
You are right about my not having any viewer, but that was in part 
because I had just done a system upgrade (which is what caused evince, 
gedit and the previous image viewer to be replaced by the X-Apps) and 
had not yet gotten around to reinstalling other programs that were 
deleted during the upgrade.

I don't feel like entering discussion what 'typical user' wants and start
messing up with order of viewers/editors.
While I see what you are saying about image viewer/text editor I don't see
how that "earns"
xreader > 'gv', 'ghostview -swap', 'gsview64', 'gsview32'
xreader > 'kghostview', 'xpdf', 'SumatraPDF', 'acrobat', 'acroread', 'mupdf'
xreader > 'kdvi', 'okular', 'yap', 'dviout -Set=!m'
for people out of your distro.

At this point (having reloaded some programs), if I were to put the 
X-Apps at the end of their respective vectors and reconfigure LyX, none 
of the X-Apps would be selected. My default text editor would be 
notepad, which would require running the Wine emulator. My default PDF 
viewer would be Acrobat Reader (which would be okay with me). My default 
image viewer would be gimp, which I find much too cumbersome just for 
looking at an image. So I would end up having to edit the viewers in 
Tools > Preferences, which is exactly what I would be doing with the 
previous configuration script.


Putting the X-Apps last in their respective vectors helps anyone who has 
none of the other tools installed, so it's certainly better than 
nothing. I can understand your being concerned about users suddenly 
finding a different viewer than what they previously had, but my 
understanding is that the X-Apps are direct substitutes for evince, 
gedit and (I think) xv, so it makes sense to me that their precedence in 
the list would match the precedence assigned to the apps they're replacing.


Paul



Re: Fwd: X-Apps

2017-01-07 Thread Pavel Sanda
Paul A. Rubin wrote:
> Pavel,
>
> I reran diff with the -u flag and am attaching the result.
>
> Regarding the positioning of the X-Apps entries in the lists, that may need 
> some discussion. I'm not sure end of the list always works. I assume the 

My understanding of your issue was that suddenly you were left without _any_
pdf viewer. For this putting the new pdf viewer at the end of list should work
and I am happy to fix that.

I don't feel like entering discussion what 'typical user' wants and start 
messing up with order of viewers/editors. 
While I see what you are saying about image viewer/text editor I don't see
how that "earns"
xreader > 'gv', 'ghostview -swap', 'gsview64', 'gsview32'
xreader > 'kghostview', 'xpdf', 'SumatraPDF', 'acrobat', 'acroread', 'mupdf'
xreader > 'kdvi', 'okular', 'yap', 'dviout -Set=!m'
for people out of your distro.

Pavel


Re: Fwd: X-Apps

2017-01-06 Thread Paul A. Rubin

On 01/06/2017 12:52 PM, Pavel Sanda wrote:

Paul A. Rubin wrote:

I've opened a ticket (10534) and attached the diff file for an attempt by
me to add them to the script.

Would the patch work if you put all the 'x..' entries at the end of the list?
I don't see reason why we should suddenly change the order for other people.

If you post directly to list I can apply it for you. Also diff -u is nicer
to read.

Pavel

Pavel,

I reran diff with the -u flag and am attaching the result.

Regarding the positioning of the X-Apps entries in the lists, that may 
need some discussion. I'm not sure end of the list always works. I 
assume the first one found in each list becomes the default. Putting 
xviewer (image viewer) after gimp strikes me as undesirable: does a 
typical user really want to open up gimp just to look at an image? With 
text editors it's a bit harder to say, but putting xed at the end of the 
list would, on my system, result in notepad (running under wine) 
becoming the default text editor. I'd much rather use the Linux application.


On Mint, at least, xed directly replaced gedit and xreader directly 
replaced evince, so my logic was to put xed immediately after gedit and 
xreader immediately after evince on theory that, however gedit and 
evince had "earned" their positions, their substitutes would reasonably 
fit in the same spots. With xviewer, I frankly couldn't remember which 
image viewer it replaced. Moving it after, rather than before, kview is 
likely to make no difference (I suspect not many systems would have 
both), but I'm fine with doing that. I'm just not crazy about moving it 
after gimp.


Paul

--- /usr/share/lyx/configure.py.bak 2016-10-23 05:39:10.0 -0400
+++ ./configure.py  2017-01-06 12:14:11.357109609 -0500
@@ -595,13 +595,13 @@
 \Format tiff   tif TIFF   "" "%s"  "%s"""  
"image/tiff"
 \Format xbmxbm XBM"" "%s"  "%s"""  
"image/x-xbitmap"
 \Format xpmxpm XPM"" "%s"  "%s"""  
"image/x-xpixmap"'''
-path, iv = checkViewerNoRC('a raster image viewer', ['xv', 'kview', 
'gimp-remote', 'gimp'], rc_entry = [imageformats])
+path, iv = checkViewerNoRC('a raster image viewer', ['xv', 'xviewer', 
'kview', 'gimp-remote', 'gimp'], rc_entry = [imageformats])
 path, ie = checkEditorNoRC('a raster image editor', ['gimp-remote', 
'gimp'], rc_entry = [imageformats])
 addToRC(imageformats % \
 (iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, 
ie, iv, ie) )
 #
 checkViewerEditor('a text editor', ['xemacs', 'gvim', 'kedit', 'kwrite', 
'kate', \
-'nedit', 'gedit', 'notepad', 'geany', 'leafpad', 'mousepad'],
+'nedit', 'gedit', 'xed', 'notepad', 'geany', 'leafpad', 'mousepad'],
 rc_entry = [r'''\Format asciichess asc"Plain text (chess output)"  
"" ""   "%%"""  ""
 \Format asciiimage asc"Plain text (image)" "" ""   "%%"""  
""
 \Format asciixfig  asc"Plain text (Xfig output)"   "" ""   "%%"""  
""
@@ -644,19 +644,19 @@
 'kbibtex', 'sixpack', 'bibedit', 'tkbibtex' \
 'xemacs', 'gvim', 'kedit', 'kwrite', 'kate', \
 'jedit', 'TeXnicCenter', 'WinEdt', 'WinShell', 'PSPad', \
-'nedit', 'gedit', 'notepad', 'geany', 'leafpad', 'mousepad'],
+'nedit', 'gedit', 'xed', 'notepad', 'geany', 'leafpad', 'mousepad'],
 rc_entry = [r'''\Format bibtex bib"BibTeX" "" ""   "%%"
""  "text/x-bibtex"''' ])
 #
 #checkProg('a Postscript interpreter', ['gs'],
 #  rc_entry = [ r'\ps_command "%%"' ])
-checkViewer('a Postscript previewer', ['kghostview', 'okular', 'qpdfview 
--unique', 'evince', 'gv', 'ghostview -swap', 'gsview64', 'gsview32'],
+checkViewer('a Postscript previewer', ['kghostview', 'okular', 'qpdfview 
--unique', 'evince', 'xreader', '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"  ""
 \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', 'qpdfview 
--unique', 'evince', 'kghostview', 'xpdf', 'SumatraPDF', 'acrobat', 'acroread', 
'mupdf', \
+checkViewer('a PDF previewer', ['pdfview', 'kpdf', 'okular', 'qpdfview 
--unique', 'evince', 'xreader', 'kghostview', 'xpdf', 'SumatraPDF', 'acrobat', 
'acroread', 'mupdf', \

Re: Fwd: X-Apps

2017-01-06 Thread Pavel Sanda
Paul A. Rubin wrote:
> I've opened a ticket (10534) and attached the diff file for an attempt by 
> me to add them to the script.

Would the patch work if you put all the 'x..' entries at the end of the list?
I don't see reason why we should suddenly change the order for other people.

If you post directly to list I can apply it for you. Also diff -u is nicer
to read.

Pavel


Re: Fwd: X-Apps

2017-01-06 Thread Paul A. Rubin

On 12/31/2016 04:26 AM, Guenter Milde wrote:

On 2016-12-27, Paul A. Rubin wrote:


With version 18 (Sarah), Linux Mint switched to a new set of tools
called "X-Apps
", at least
for Cinnamon users. In particular, the new default PDF viewer is
"xreader", and /Evince is no longer installed by default/.

...

My question to the group is whether we should include xreader in the
list of viewers that the configuration script looks for. If so, should
we also add xed (the new text editor) and xviewer (the new image
viewer)?

Yes, these tools should be added to the respective check-lists in
lib/configure.py.

Günter
I've opened a ticket (10534) and attached the diff file for an attempt 
by me to add them to the script.


Paul



Re: Fwd: X-Apps

2016-12-31 Thread Guenter Milde
On 2016-12-27, Paul A. Rubin wrote:

> With version 18 (Sarah), Linux Mint switched to a new set of tools 
> called "X-Apps 
>", at least 
> for Cinnamon users. In particular, the new default PDF viewer is 
> "xreader", and /Evince is no longer installed by default/.
...
> My question to the group is whether we should include xreader in the
> list of viewers that the configuration script looks for. If so, should
> we also add xed (the new text editor) and xviewer (the new image
> viewer)?

Yes, these tools should be added to the respective check-lists in
lib/configure.py.

Günter



Fwd: X-Apps

2016-12-27 Thread Paul A. Rubin

This bounced for a few days (server down?), so I'm retrying it.


 Forwarded Message 

Apologies if this has already been brought up ...

With version 18 (Sarah), Linux Mint switched to a new set of tools 
called "X-Apps 
", at least 
for Cinnamon users. In particular, the new default PDF viewer is 
"xreader", and /Evince is no longer installed by default/. I discovered 
this the hard way today, after an OS upgrade. I tried to preview a 
document in LyX (pdflatex). The status line happily told me that the 
preview was successful, but no viewer opened.


Once I figured out what was going on, I switched all the PDF (whatever) 
file formats from evince to Custom/xreader, a mild PITA. My question to 
the group is whether we should include xreader in the list of viewers 
that the configuration script looks for. If so, should we also add xed 
(the new text editor) and xviewer (the new image viewer)?


Cheers,
Paul