emacs-devel
[Top][All Lists]
Advanced

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

Re: Adding ispell-multi.el and friends to Emacs


From: Agustin Martin
Subject: Re: Adding ispell-multi.el and friends to Emacs
Date: Tue, 19 Jun 2007 17:13:34 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

On Mon, Jun 18, 2007 at 02:37:20PM +0200, martin rudalics wrote:
> > Current ispell.el behavior wrt localwords when switching buffers with the
> > same language is to restart ispell if localwords are present, to avoid the
> > problem of conflicting localwords.
> 
> With the consequence that all "session-local" words are lost.

But the underlying problem is the lack of full support for buffer
session-local words. I have been playing a bit with ispell.el and flyspell.el
to try dealing with this. I am attaching a couple of patches with the current
status of my experiments. Note that they are minimally tested, but seem to
work reasonably.

A new buffer local variable `ispell-buffer-session-localwords' is used that
will contain a list of words accepted for session in each buffer. Each time
a buffer is parsed for localwords, those sesion localwords are sent to the
ispell process as accepted and the buffer marked as having localwords. same
when a word is accepted for session by either ispell.el or flyspell.el.

A new option CLEAR is added to (ispell-kill-ispell). For a buffer
`ispell-buffer-session-localwords' is cleaned when dict is explicitely changed
for that buffer with (ispell-change-dictionary) or when ispell process is
killed, either interactively or through the pop-up menu (using the 'clear).

flyspell.el is modified for the same purpose.

I will try to test this more in depth, but I think the ideas behind the
changes are reasonable.
 
> > If ispell-multi.el starts a new ispell
> > process in this case, keeping two processes for the same language, it 
> might
> > also be made aware that words are accepted for that buffer session.
> 
> ispell-multi.el seems to be able to retain "session-local" words for the
> original buffer.  If they are present (or introduced) it should probably
> start a new process for the second buffer.

As long as the ispell process is not killed those words will remain
accepted.

> A different problem occurs when you check one and the same buffer with
> multiple processes: In this case "session-local" words should be shared
> by all processes checking this buffer.  Otherwise, an abbreviation would
> be marked erroneous by the French process and not marked by the Italian
> one.  As I mentioned earlier, it's much simpler to have Emacs maintain
> these words in buffer-local hash-lists and have Emacs override the
> results reported by the spell processes.

I do not think there is currently support for multi-language buffer accepted
localwords, so that seems indeed simpler.

-- 
Agustin

Attachment: flyspell.el_session_localwords.diff
Description: Text Data

Attachment: ispell.el_session_localwords.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]