Man and LANG issue.

2011-10-20 Thread Oleksandr Gavenko

My LANG=ru_RU.cp1251 so if man page was translated I get garbage
in output.

Problem lies out of 'cp1251' because /usr/share/man/ru store
man pages in different encoding:

  /usr/share/man/ru/man1/mc.1.gz is UTF-8
  /usr/share/man/ru/man1/mplayer.1.gz is koi8-r

Also man does not support page recoding on fly:

  $ ls -ld /usr/share/man/ru*
drwxr-xr-x+ 1 user root 0 июн 10  2010 /usr/share/man/ru
drwxr-xr-x+ 1 user root 0 окт 13 10:10 /usr/share/man/ru.KOI8-R
drwxr-xr-x+ 1 user root 0 окт 13 10:10 /usr/share/man/ru.UTF-8

  $ test -f /usr/share/man/ru.KOI8-R/ex.1.gz  OK
OK

  $ LANG=ru_RU.cp1251 man ex
... EN output ...
  $ LANG=ru_RU.UTF-8 man ex
... EN output ...

  $ LANG=ru.UTF-8-8 man ex
... !!RU output!! ...

so man can not strip '_RU' from 'ru_RU'!

I would like to see only EN man pages. According to 'man 1 man' I
need set 'LANG=C', but I like 'LANG=ru_RU.cp1251'!

I try add:

  LANG C

to /etc/man.conf, but got warning:

  Unrecognized line in config file (ignored)
  LANG C


In bash I can define alias:

  $ alias man='LANG=C man'

But how about Emacs M-x man? I need write a wrapper and set

  (setq manual-program LANG=C man)

In order to fix page lang for MC  and bash I put

  alias man='LANG=C man'

to ~/.bashrc

Seems I cover all my use cases but I have a questions:

 * Is it possible set LANG setting for man without setting LANG=C to
   all other apps (like Emacs, MC)? I would like see option in
   'man.conf'
 * Is it right provide /usr/share/man/ru/ with files with different
   encoding? I think packages must fixed to 'ru.UTF-8', ru.KOI8-R
   path.


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Man and LANG issue.

2011-10-20 Thread Markus Hoenicka

Oleksandr Gavenko gave...@bifit.com.ua was heard to say:



But how about Emacs M-x man? I need write a wrapper and set



Dunno about the rest, but have you tried M-x woman? This is a man page  
reader implemented in elisp. It may or may not handle language issues  
better than man.


regards,
Markus

--
Markus Hoenicka
http://www.mhoenicka.de
AQ score 38



--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Man and LANG issue.

2011-10-20 Thread Oleksandr Gavenko

20.10.2011 11:56, Markus Hoenicka пишет:

Oleksandr Gavenko gave...@bifit.com.ua was heard to say:



But how about Emacs M-x man? I need write a wrapper and set



Dunno about the rest, but have you tried M-x woman? This is a man page
reader implemented in elisp. It may or may not handle language issues
better than man.


Yes, I use M-x woman for a long time with Cygwin 1.5 when native Emacs
can not correctly invoke Cygwin man...

But some day with Cygwin 1.7 I discover that M-x man properly work so
stop using M-x woman (because of initial load delay to build index of
available man pages).

A few day ago I post my config how to get this:

  http://article.gmane.org/gmane.os.cygwin/129043

   # This allow access to man files from Cygwin and native Emacs
   # (with cygwin-mount.el enabled), M-x man/woman...
   # Take special attention to leading colon.


MANPATH=:/cygdrive/e/home/usr/share/man:/usr/share/man:/usr/local/share/man


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple