Bug 470942 - xdvik ignores zeros in page movement commands
xdvik ignores zeros in page movement commands
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: xdvik (Show other bugs)
9
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jonathan Underwood
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-10 19:00 EST by Michal Jaegermann
Modified: 2008-11-22 11:56 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-11-22 11:56:07 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Michal Jaegermann 2008-11-10 19:00:54 EST
Description of problem:

After typing '<page_number>g' in xdvi window a page <page_number> is supposed to be displayed.  This does happen if a number is something like 5, 11 or 37. OTOH if you will try to type '20g' or '50g' then you will find yourself looking at pages 2 or 5 respectively.

/usr/share/texmf/doc/latex/refman/refman.dvi from texlive-texmf-doc package gives and example with a lot of pages to look at. :-)

Version-Release number of selected component (if applicable):
xdvik-22.84.14-3.fc9

Additional info:
A similar effect can be seen with an 'S' command.  That means that '30S' is undistinguishable from '3S' and quite distinct from '31S' with a difference between '99S' and '100S' likely the most dramatic. OTOH '0G' and '1G' seem to work as expected.
Comment 1 Jonathan Underwood 2008-11-11 12:29:28 EST
This has been reported upstream as well:

http://sourceforge.net/tracker/index.php?func=detail&aid=2067614&group_id=23164&atid=377580

there's a workaround there as well - I'll look at adding in the binding to the fedora package.
Comment 2 Michal Jaegermann 2008-11-11 13:44:14 EST
Thanks!  For others checking this bug the workaround in followups to the reference quoted in comment #1 is:
"... a workaround would be to put the
following into your X resources (e.g. ~/.Xdefaults):

XDvi.mainTranslations: #override\n\
    <Key>0: digit(0)

"

As a matter of fact I added that to /etc/texmf/xdvi/XDvi, to make it available system-wide, and it works.  It resolves also issues with 'S' command.  ~/.xdvirc would be a good place for a "private" modification too.

BTW - strace seems to show that xdvi attempts to read the following (in my case) files:
/etc/texmf/xdvi/XDvi\n
$HOME/en_CA.UTF-8/XDvi
$HOME/en/XDvi
$HOME/XDvi
$HOME/en_CA.UTF-8/XDvi
$HOME/en/XDvi
$HOME/XDvi
/etc/texmf/xdvi/en_CA/XDvi
/etc/texmf/xdvi/XDvi

but /usr/share/texmf/xdvi/XDvi from xdvik-22.84.14-3.fc9 package is not on that list. That because /etc/texmf/xdvi/XDvi read succeeded?
Comment 3 Jonathan Underwood 2008-11-11 19:38:02 EST
These packages should fix the issue:

http://koji.fedoraproject.org/koji/taskinfo?taskID=927893

Would be a great help if you could test them (remember to remove/comment those lines you added to .Xdefaults first).
Comment 4 Fedora Update System 2008-11-11 19:39:46 EST
xdvik-22.84.14-4.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/xdvik-22.84.14-4.fc10
Comment 5 Fedora Update System 2008-11-11 19:47:32 EST
xdvik-22.84.14-4.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/xdvik-22.84.14-4.fc9
Comment 6 Michal Jaegermann 2008-11-12 12:10:12 EST
I tested xdvik-22.84.14-4.fc10 and numbers used with 'g' and 'S' commands worked in an expected way while before this update they were misbehaving like described in the original report.  Thanks!
Comment 7 Jonathan Underwood 2008-11-12 13:00:06 EST
Thanks for testing Michal.
Comment 8 Fedora Update System 2008-11-12 22:37:38 EST
xdvik-22.84.14-4.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 9 Michal Jaegermann 2008-11-13 11:55:15 EST
Note!  The fix consist of translation lines, like those quoted in a comment #2, added to /usr/share/texmf/xdvi/XDvi.  If a customized /etc/texmf/xdvi/XDvi happens to exist then this is not effective as only the later file is read and not the former (it looks like 'kpathsea' library in operation) so in such case the change needs to be applied to /etc/texmf/xdvi/XDvi too.
Comment 10 Michal Jaegermann 2008-11-13 12:14:05 EST
Thinking a bit more about comment #9 maybe a %post section of xdvik package could apply the required fix automatically?  Something there along these lines:

if [ -f /etc/texmf/xdvi/XDvi ] ; then
  grep -q '<Key>0: digit(0)' /etc/texmf/xdvi/XDvi || echo '
*mainTranslations: #override\n\
        <Key>0: digit(0)' >> /etc/texmf/xdvi/XDvi
fi
Comment 11 Jonathan Underwood 2008-11-13 12:35:52 EST
Actually, Michal, you raise a good point. I think though that the right fix is to move our configuration file to /etc in any case - that's where configuration files are meant to live. Debian does this as well. I'll do that in a subsequent update.
Comment 12 Jonathan Underwood 2008-11-13 12:36:52 EST
Reopening bug to remind me to move the configuration file to the right place.
Comment 13 Michal Jaegermann 2008-11-13 12:56:03 EST
> I think though that the right fix is to move our configuration file to /etc ...

Maybe, maybe not.  You would need to check if that will work as expected with texconfig-sys adjusting, say, a paper size or a printer type for xdvi. Quite possibly yes, as kpathsea should help here, but something to think about.

Also files under /etc/texmf/ may be heavily customized for an installation so
they would have to be "config noreplace".  It means that "a fix by a new configuration file" would not work anyway without doing something in %post.  Just clobbering an old /etc/texmf/xdvi/XDvi would get you angry bug reports in no time at all.
Comment 14 Patrice Dumas 2008-11-13 16:50:49 EST
(In reply to comment #11)
> Actually, Michal, you raise a good point. I think though that the right fix is
> to move our configuration file to /etc in any case - that's where configuration
> files are meant to live. Debian does this as well. I'll do that in a subsequent
> update.

I don't think so. Files in /etc are for system-wide local customization. Config files for upstream and fedora packagers are in /usr/share/texmf/
Comment 15 Fedora Update System 2008-11-22 11:56:04 EST
xdvik-22.84.14-4.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.