Re: Insanely long messages in gnome-lokkit



teg@redhat.com (Trond Eivind Glomsrød) writes:

> Another thing which would be useful in po-mode, is spell checking of
> the translated text (using flyspell mode works great, but you can't
> check already translated items that way).

I've saved an old mail (yes, I should use ispell more often):

From: Martin Quinson <mquinson@zeppelin-cb.de>
Subject: Some new ideas to have ispell working in po-mode
To: Karl Eichwalder <ke@gnu.franken.de>
Cc: po-utils-forum@iro.umontreal.ca
Date: Wed, 24 May 2000 00:10:50 +0200

Here it is :

 (defun po-ispell-next ()
   "Search the next entry to check"
           (po-find-span-of-entry)
           (let ((here (point)))
             (goto-char po-end-of-entry)
             (if (re-search-forward po-any-msgstr-regexp nil t)
                 (progn
                   (goto-char (match-beginning 0))
                   (po-current-entry)
                   t)                          ;*2*
               nil)))                          ;*2*
 (defun po-ispell-entry ()
   "Check the current entry"
   (po-find-span-of-entry)
   (ispell-region (+ po-start-of-msgstr 6) po-end-of-entry)) ;*2*
 
 (defun po-ispell ()
   "Check the spelling of the po file"
   (interactive)
   (save-excursion
     (save-restriction                         ;*1*
       (let ((buffer-read-only po-read-only))  ;*1*
         (po-first-entry)
         (while                                ;*2* 
             (and (po-ispell-next)             ;*2*
                  (po-ispell-entry)))))))      ;*2*


The function you have to call is po-ispell. 
You may want to change the general ispell dictionary before, as it is the 
one used...

The advantage over your solution is that you don't have to 'E'xit the po-mode 
to run it (lines marked with *1*). And if you stop ispell, it don't go one 
for the next entry (lines marked with *2*, stops if ispell-region returns 
false).

rq: I didn't read you patch very well. I wrote this one before I ever heard of 
you patch, sorry. It may be possible your version manage this also, but I 
don't think so...

The problem still not solved is that it fires a ispell process per entry.
The way to solve it is, IHMO, to understand the magic of auctex for LaTeX. But 
I didn't manage it (is few lines are the first ones I ever wrote in elisp :)

Other problem, the (+ po-start-of-msgstr 6) part. I don't find it really ok. 
This '6' is a bad idea, but I wanted to use the po-find-span-of-entry,
po-start-of-msgstr and po-end-of-entry function, as they are defined in 
po-mode... For example, it don't work for obsolet entries, as there is 
'#~ ' more on the line. Need to check angain how it is done when you ask 
to edit an entry (the part where I stolen the main parts of my code).
[But you don't have to ispell obsolet entries, you have to remove them.
 and it works for others.  ;]

Any ideas about how to fix this shortcomings ?

Another problem is that it ask ispell AND po-mode to be loaded. So, it won't 
be so easy to add this in po-mode... We can't put a (require ispell) in 
po-mode.el... We may create a new file. No idea.

I hope this could be helpful, Mt.

PS: sorry for the bad english...

-=-=-=-=-=-=-=-=-=-=-=-=-=- cut here -=-=-=-=-=-=-=-=-=-=-=-=-=-


-- 
ke@suse.de (work) / keichwa@gmx.net (home):              |
http://www.suse.de/~ke/                                  |      ,__o
Free Translation Project:                                |    _-\_<,
http://www.iro.umontreal.ca/contrib/po/HTML/             |   (*)/'(*)




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]