unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* emacs cyrillic
@ 2006-11-04 16:38 Martin Ivanov
  2006-11-04 20:08 ` Peter Dyballa
  0 siblings, 1 reply; 9+ messages in thread
From: Martin Ivanov @ 2006-11-04 16:38 UTC (permalink / raw)


Hello!

I am running Slackware Linux 11.0 with   kernel 2.6.18 and Gnu Emacs 21.4a.
I set emacs to be able to write cyrillic using the bulgarian.el file:
http://debian.fmi.uni-sofia.bg/~ogi/bulgarian.el
My problem is, what should I do so that when I open a file with cyrillic letters, after having saved it, it is displayed correctly. I tried saving with a variety of encodins, but in vain. Besides, I want to enable spell-check for bulgarian, but I do not know how. I have installed ispell-bg and in /usr/lib/ispell I have the files bulgarian.hash and bulgarian.aff, but emacs does not seem to see them. 

I would be thankful to any suggestions.

Thank you very much in advance.

Regards,
Martin




-----------------------------------------------------------------
Survivor BG. Оцеляването продължава на www.survivor.btv.bg 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: emacs cyrillic
  2006-11-04 16:38 Martin Ivanov
@ 2006-11-04 20:08 ` Peter Dyballa
  2006-11-05  1:44   ` ken
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Dyballa @ 2006-11-04 20:08 UTC (permalink / raw)
  Cc: GNU Emacs List


Am 04.11.2006 um 17:38 schrieb Martin Ivanov:

> Hello!
>
> I am running Slackware Linux 11.0 with   kernel 2.6.18 and Gnu  
> Emacs 21.4a.
> I set emacs to be able to write cyrillic using the bulgarian.el file:
> http://debian.fmi.uni-sofia.bg/~ogi/bulgarian.el

IMO this file is too old for a modern Emacs.

> My problem is, what should I do so that when I open a file with  
> cyrillic letters, after having saved it, it is displayed correctly.  
> I tried saving with a variety of encodins, but in vain.

Instead set an environment variable LANG or LC_CTYPE with a locale  
value your OS provides. I have for the purpose to use Unicode set it  
to de_DE.UTF-8, you need something Bulgarian + an adequate encoding,  
bg_BG.CP1251 or bg_BG.ISO8859-5? bg_BG.UTF-8 might be also a useful  
value. GNU Emacs learns from this environment variable and sets a few  
things automatically right. You can direct GNU Emacs by setting for  
example (there are more!):

	(set-default-coding-systems             'value)
	(setq file-name-coding-system           'value)
	(setq default-buffer-file-coding-system 'value)
	(set-keyboard-coding-system             'value)
	(set-terminal-coding-system             'value)
	(set-clipboard-coding-system            'value)
	(set-selection-coding-system            'value)
	(prefer-coding-system                   'iso-8859-5)	; for example


> Besides, I want to enable spell-check for bulgarian, but I do not  
> know how. I have installed ispell-bg and in /usr/lib/ispell I have  
> the files bulgarian.hash and bulgarian.aff, but emacs does not seem  
> to see them.

To check what ispell sees, first check whether GNU Emacs is really  
set to use ispell! Some time ago a decision was made to substitute  
ispell with aspell. You can correct this fault:

	(setq ispell-program-name "ispell")

You can make this corrective setting active when eval the expression  
in *scratch* buffer. Now select from the Tools menu "Spell Checking"  
and then "Change Dictionary..." Now press TAB in mini-buffer. Voilà,  
there they are!

For flexibility I have set:

      (setq ispell-dictionary "german8")
      (if (string= "aspell" ispell-program-name)
         (progn
;         (setq ispell-extra-args "--norm-form=comp --norm-required -- 
run-together")?
;         (setq ispell-dictionary "en_GB-ise-w_accents")
           (set-default 'ispell-local-dictionary ispell-dictionary)
           (add-hook 'TeX-language-en-hook
		    (function (lambda () (ispell-change-dictionary "british"))))
           (add-hook 'TeX-language-de-hook
		    (function (lambda () (ispell-change-dictionary ispell- 
dictionary))))
           (message "Alles für «a»spell")
	)
         (setq ispell-dictionary "german8")
         (add-hook 'TeX-language-en-hook
		  (function (lambda () (ispell-change-dictionary "british"))))
         (add-hook 'TeX-language-de-hook
		  (function (lambda () (ispell-change-dictionary "deutsch8"))))
         (message "Alles für »i«spell")
       )
       (add-hook 'LaTeX-mode-hook
		(function (lambda () (setq ispell-extra-args '("-t")))))


--
Greetings

   Pete

"It isn't pollution that's harming the environment. It's the  
impurities in our air and water that are doing it."

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: emacs cyrillic
  2006-11-04 20:08 ` Peter Dyballa
@ 2006-11-05  1:44   ` ken
  2006-11-05  8:53     ` Peter Dyballa
  0 siblings, 1 reply; 9+ messages in thread
From: ken @ 2006-11-05  1:44 UTC (permalink / raw)


On 11/04/2006 03:08 PM somebody named Peter Dyballa wrote:
> 
> ....
> 
> Instead set an environment variable LANG or LC_CTYPE with a locale value
> your OS provides. I have for the purpose to use Unicode set it to
> de_DE.UTF-8, you need something Bulgarian + an adequate encoding,
> bg_BG.CP1251 or bg_BG.ISO8859-5? bg_BG.UTF-8 might be also a useful
> value. GNU Emacs learns from this environment variable and sets a few
> things automatically right. You can direct GNU Emacs by setting for
> example (there are more!):
> 
>     (set-default-coding-systems             'value)
>     (setq file-name-coding-system           'value)
>     (setq default-buffer-file-coding-system 'value)
>     (set-keyboard-coding-system             'value)
>     (set-terminal-coding-system             'value)
>     (set-clipboard-coding-system            'value)
>     (set-selection-coding-system            'value)
>     (prefer-coding-system                   'iso-8859-5)    ; for example

Do you mean the literal "value"...?  Or do you mean "some appropriate
value should be here"?

BTW... Thanks for all the tips.

-- 
To announce that there must be no criticism of the president, or that
we are to stand by the president, right or wrong, is not only
unpatriotic and servile, but is morally treasonable to the American
public.
	--Theodore Roosevelt, 1918

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: emacs cyrillic
  2006-11-05  1:44   ` ken
@ 2006-11-05  8:53     ` Peter Dyballa
  0 siblings, 0 replies; 9+ messages in thread
From: Peter Dyballa @ 2006-11-05  8:53 UTC (permalink / raw)
  Cc: GNU Emacs List


Am 05.11.2006 um 02:44 schrieb ken:

> Do you mean the literal "value"...?  Or do you mean "some appropriate
> value should be here"?

The latter. Only the last was given as an actual example.

Don't use too many of these! GNU Emacs should be able to set most of  
them right from LANG or LC_CTYPE.

--
Greetings

   Pete

A lot of us are working harder than we want, at things we don't like  
to do. Why? ...In order to afford the sort of existence we don't care  
to live.
                                    -- Bradford Angier

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: emacs cyrillic
       [not found] <2032892203.462561162683925062.JavaMail.nobody@mail08.abv.bg>
@ 2006-11-05 15:03 ` Peter Dyballa
  2006-11-05 16:54   ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Dyballa @ 2006-11-05 15:03 UTC (permalink / raw)
  Cc: GNU Emacs List


Am 05.11.2006 um 00:45 schrieb Martin Ivanov:

> What should I do so that there is an option "bulgarian" to choose  
> when I do
> M-x ispell-change-dictionary

It's possible that the makers of your ispell or ispell-bg packages  
changed some default values in the ispell binary. You could search  
for useful strings inside the binary with the strings programme. It  
should output ISPELL_DICTDIR and then a path. If this is true, then  
you can set ispell-library-directory to the proper value. Could be  
you need first to (require 'ispell) to effectively change these  
values, a standard GNU Emacs setup has this require statement  
somewhere in its start-up set.

The second, which you probably did not want to read, understand, and  
check is that GNU Emacs understands "ispell" as "aspell" (a different  
programme with a different set of dictionaries: ftp://ftp.gnu.org/gnu/ 
aspell/dict/bg/) in the last years. What is your ispell-program-name?  
If you set it right, to "ispell," does ispell-program-name still not  
see bulgarian.{aff,hash}?

--
Greetings

   Pete

   It's not the valleys in life I dread so much as the dips.
                     -- Garfield

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: emacs cyrillic
  2006-11-05 15:03 ` emacs cyrillic Peter Dyballa
@ 2006-11-05 16:54   ` Eli Zaretskii
  2006-11-05 20:29     ` Peter Dyballa
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2006-11-05 16:54 UTC (permalink / raw)


> From: Peter Dyballa <Peter_Dyballa@Web.DE>
> Date: Sun, 5 Nov 2006 16:03:28 +0100
> Cc: GNU Emacs List <help-gnu-emacs@gnu.org>
> 
> It's possible that the makers of your ispell or ispell-bg packages  
> changed some default values in the ispell binary. You could search  
> for useful strings inside the binary with the strings programme.

There's no need for such extreme measures: "ispell -vv" should display
all those strings in human-readable English.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: emacs cyrillic
  2006-11-05 16:54   ` Eli Zaretskii
@ 2006-11-05 20:29     ` Peter Dyballa
  0 siblings, 0 replies; 9+ messages in thread
From: Peter Dyballa @ 2006-11-05 20:29 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 05.11.2006 um 17:54 schrieb Eli Zaretskii:

>> From: Peter Dyballa <Peter_Dyballa@Web.DE>
>> Date: Sun, 5 Nov 2006 16:03:28 +0100
>> Cc: GNU Emacs List <help-gnu-emacs@gnu.org>
>>
>> It's possible that the makers of your ispell or ispell-bg packages
>> changed some default values in the ispell binary. You could search
>> for useful strings inside the binary with the strings programme.
>
> There's no need for such extreme measures: "ispell -vv" should display
> all those strings in human-readable English.

And it's even less output!

--
Greetings

   Pete

The human animal differs from the lesser primates in his passion for  
lists of "Ten Best".
                                      -- H. Allen Smith

^ permalink raw reply	[flat|nested] 9+ messages in thread

* emacs cyrillic
@ 2006-11-07 13:03 Martin Ivanov
  2006-11-07 23:47 ` Kevin Rodgers
  0 siblings, 1 reply; 9+ messages in thread
From: Martin Ivanov @ 2006-11-07 13:03 UTC (permalink / raw)


Hello again!

I changed LANG fron en.us to bg_BG. Then I started emacs with the option -q and opened a file previously saved with cyrillic text. It was not displayed correctly. Then I started emacs without the option -q and the file was diplayed as it should have been. Obvoiusly the bulgarian.el file is necessary, I do not know why. This is the complete list of choices I have when I choose to change the ispell dictionary:

american			   brasileiro
british				   castellano
castellano8			   czech
dansk				   default
deutsch				   deutsch8
english				   esperanto
esperanto-tex			   francais
francais-tex			   francais7
german				   german8
italiano			   nederlands
nederlands8			   norsk
norsk7-tex			   polish
portugues			   russian
slovak				   svenska

What can be done so that bulgarian appears in that menu? 
If I choose something different from american or english, emacs complains it cannot find the respective .hash file in /usr/lib/ispell. And it is ok, since the contents of /usr/lib ispell is :

american.hash@    bg.multi       bulgarian.aff    bulgarian.kbd  english.hash@
americanmed.hash  bg.rws         bulgarian.alias  cp1251.dat
bg.dat            bg_phonet.dat  bulgarian.hash   english.aff

I am sorry if I bore you, but I wish to be as clear as possible with the risk of repeating things.
Besides, there is another point. If I run ispell american in flyspell mode on a file that contains both cyrillic and latin words, only the latin words are underlined. the cyrillic word are not considered mistake, which is strange to me.

I am so thankful to you for your responsiveness.

Regards,
Martin


 >-------- Оригинално писмо --------
 >От:  Peter Dyballa <Peter_Dyballa@Web.DE>
 >Относно: Re: emacs cyrillic
 >До: Martin Ivanov <tramni@abv.bg>
 >Изпратено на: Вторник, 2006, Ноември 7 12:49:05 GMT+02:00
 >----------------------------------
 >
 >
 >Am 07.11.2006 um 10:46 schrieb Martin Ivanov:
 >
 >> without the bulgarian.el file, I canot set the language environment  
 >> to "Bulgarian standard, I cannot at all write cyrillic. A have the  
 >> LANG variable on my system. Concerning bulgarian it says:
 >> bg_BG
 >> bg_BG.utf8
 >
 >Usually 'locale -a | grep -i bg' should display all choices you have  
 >for Bulgarian. Once in the shell environment LANG or LC_CTYPE are  
 >set, GNU Emacs reads them and sets itself to handle this world. There  
 >is not much Elisp code needed, it's all already written.
 >
 >Bulgarian.el is similar in that purpose, but restricted to one  
 >particular environment. Since I have no Bulgarian environment here  
 >and no Slackware, not even a PC, I think I cannot be of more help in  
 >this particular issue.
 >
 >> "ispell -vv" as attachment.
 >
 >LIBDIR = "/usr/lib/ispell"
 >
 >is the important line. So your system seems to be ready. If it  
 >continues to fail, then some Elisp code must be wrong. You can launch  
 >GNU Emacs with the options -q or -Q, which do not load personal or  
 >all initialisation files. You should try to launch GNU Emacs with  
 >either of these options and see whether you can setup for using  
 >ispell and the Bulgarian dictionary. If this has success, you can try  
 >to determine which file is faulty, by commenting load or require  
 >statements. In the faulty Elisp file you can comment halves to see  
 >where the bug happens. And by commenting one half of this half  
 >successively, step by step, you might be able to determine the faulty  
 >line of code.
 >
 >If it fails to use the Bulgarian dictionary *without* personal or  
 >system initialisation files, then there is some evidence of a bug in  
 >GNU Emacs and you should choose from the Help menu the "Send Bug  
 >Report..." item and write a bug report. You can invoke Emacs as  
 >'emacs --help' so see the meaning of the options it supports.
 >
 >
 >--
 >Greetings
 >
 >   Pete
 >
 >If my theory of relativity is proven successful, Germany will claim  
 >me as a German, and France will declare that I am a citizen of the  
 >world. Should my theory prove untrue, France will say that I am a  
 >German, and Germany will declare that I am a Jew.
 >                                                 -- Albert Einstein,  
 >1929
 >
 >
 >

-----------------------------------------------------------------
Survivor BG. Оцеляването продължава на www.survivor.btv.bg 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: emacs cyrillic
  2006-11-07 13:03 Martin Ivanov
@ 2006-11-07 23:47 ` Kevin Rodgers
  0 siblings, 0 replies; 9+ messages in thread
From: Kevin Rodgers @ 2006-11-07 23:47 UTC (permalink / raw)


[Please don't top-post.]

Martin Ivanov wrote:
 > I changed LANG fron en.us to bg_BG. Then I started emacs with the
 > option -q and opened a file previously saved with cyrillic text. It
 > was not displayed correctly.

At that point, what does `C-h C RET' display?

 > Then I started emacs without the option
 > -q and the file was diplayed as it should have been. Obvoiusly the
 > bulgarian.el file is necessary, I do not know why.

At that point, what does `C-h C RET' display?

-- 
Kevin

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-11-07 23:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <2032892203.462561162683925062.JavaMail.nobody@mail08.abv.bg>
2006-11-05 15:03 ` emacs cyrillic Peter Dyballa
2006-11-05 16:54   ` Eli Zaretskii
2006-11-05 20:29     ` Peter Dyballa
2006-11-07 13:03 Martin Ivanov
2006-11-07 23:47 ` Kevin Rodgers
  -- strict thread matches above, loose matches on Subject: below --
2006-11-04 16:38 Martin Ivanov
2006-11-04 20:08 ` Peter Dyballa
2006-11-05  1:44   ` ken
2006-11-05  8:53     ` Peter Dyballa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).