unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* predictive mode and 'ã'
@ 2007-07-13 13:24 weber
  2007-07-14 10:14 ` Anselm Helbig
  2007-07-16 16:16 ` Mathias Dahl
  0 siblings, 2 replies; 4+ messages in thread
From: weber @ 2007-07-13 13:24 UTC (permalink / raw)
  To: help-gnu-emacs

Hello folks.
I'm trying to start using predictive and have this annoying problem.
It looks like predictive considers portuguese characters like ã or ó
as end-of-word characters (I have to type them pressing ~ then a,
maybe that's a problem?)

Here's the situation: when I type 'n', predictive suggests '(0) nil'.
If I continue typing 'não' , I end up getting 'nilão'. The nil is
inserted...

Anyone can help me?
Many thanks,
weber

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

* Re: predictive mode and 'ã'
  2007-07-13 13:24 predictive mode and 'ã' weber
@ 2007-07-14 10:14 ` Anselm Helbig
  2007-07-15  0:42   ` Rupert
  2007-07-16 16:16 ` Mathias Dahl
  1 sibling, 1 reply; 4+ messages in thread
From: Anselm Helbig @ 2007-07-14 10:14 UTC (permalink / raw)
  To: help-gnu-emacs

> I'm trying to start using predictive and have this annoying problem.
> It looks like predictive considers portuguese characters like ã or ó
> as end-of-word characters (I have to type them pressing ~ then a,
> maybe that's a problem?)
> 
> Here's the situation: when I type 'n', predictive suggests '(0) nil'.
> If I continue typing 'não' , I end up getting 'nilão'. The nil is
> inserted...

I haven't used predictive mode yet, so I can't comment on that. But
the usual way emacs determines if some character belongs to a word or
not is by syntax tables; these tables are mode-specific. When I put
point on the letter `ã', `C-u C-x =' gives me some information about
the character (I'm using GNU Emacs 22), and it says that it's syntax
is "w which means: word".

What emacs are you using, and what mode are you in? Does M-f
(forward-word) and M-b (backward-word) stop at accented characters?
Maybe you can do something about it by fiddling with the syntax
table (look them up in the elisp manual). 

HTH, 

Anselm

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

* Re: predictive mode and 'ã'
  2007-07-14 10:14 ` Anselm Helbig
@ 2007-07-15  0:42   ` Rupert
  0 siblings, 0 replies; 4+ messages in thread
From: Rupert @ 2007-07-15  0:42 UTC (permalink / raw)
  To: help-gnu-emacs

On Jul 14, 11:14 am, Anselm Helbig <ans...@chemie.fu-berlin.de> wrote:
>
> I haven't used predictive mode yet, so I can't comment on that. But
> the usual way emacs determines if some character belongs to a word or
> not is by syntax tables; these tables are mode-specific. When I put
> point on the letter `ã', `C-u C-x =' gives me some information about
> the character (I'm using GNU Emacs 22), and it says that it's syntax
> is "w which means: word".
>
> What emacs are you using, and what mode are you in? Does M-f
> (forward-word) and M-b (backward-word) stop at accented characters?
> Maybe you can do something about it by fiddling with the syntax
> table (look them up in the elisp manual).
>
> HTH,
>
> Anselm

Could it be that the predictive mode is interpreting your hitting the
~ key as an input of "~" (which would end the word, as it's
punctuation)? Then you'd get the rubbish completion you're describing.
Once you type the following a, however, the string "~a" is squished
into just "ã" and so you end up with "não", which emacs correctly once
again decides is a single word.

The fundamental problem seems to be that predictive mode has no way of
knowing which bit of a "multi-key character" is the last bit and thus
at which point it should decide whether to expand. Maybe there's a
different hook that predictive mode could be using (does emacs send
out one when it finally decides on a character?)

A work-around might be to have a look at different input systems you
might use:

1) If you're in X, you could set, say, your Alt-Gr key to act as
compose. Then you could type something like Alt-Gr ~, a
2) Possibly faster to type with: I know that the German entry mode for
emacs has a "post" form, so you can type ä by ae. Is there a
Portuguese mode similar? Then the punctuation would happen after the
letter and maybe predictive mode wouldn't get confused.

Rupert

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

* Re: predictive mode and 'ã'
  2007-07-13 13:24 predictive mode and 'ã' weber
  2007-07-14 10:14 ` Anselm Helbig
@ 2007-07-16 16:16 ` Mathias Dahl
  1 sibling, 0 replies; 4+ messages in thread
From: Mathias Dahl @ 2007-07-16 16:16 UTC (permalink / raw)
  To: help-gnu-emacs

weber <hugows@gmail.com> writes:

> Hello folks.
> I'm trying to start using predictive and have this annoying problem.
> It looks like predictive considers portuguese characters like ã or ó
> as end-of-word characters (I have to type them pressing ~ then a,
> maybe that's a problem?)
>
> Here's the situation: when I type 'n', predictive suggests '(0)
> nil'.  If I continue typing 'não' , I end up getting 'nilão'. The
> nil is inserted...

I had the exact same problem and, Toby, the author, helped me debug
it. I don't remember the exact cause, but it didn't help playing with
syntax tables ("some maybe almost might be possibly bug"). Instead I
had to do this, which works and which I hope will help you as well:

(eval-after-load "predictive"
  '(progn
     (completion-define-word-constituent-binding (kbd "é") ?é)
     (completion-define-word-constituent-binding (kbd "å") ?å)
     (completion-define-word-constituent-binding (kbd "ä") ?ä)
     (completion-define-word-constituent-binding (kbd "ö") ?ö)
     (completion-define-word-constituent-binding (kbd "Å") ?Å)
     (completion-define-word-constituent-binding (kbd "Ä") ?Ä)
     (completion-define-word-constituent-binding (kbd "Ö") ?Ö)))

/Mathias

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

end of thread, other threads:[~2007-07-16 16:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-13 13:24 predictive mode and 'ã' weber
2007-07-14 10:14 ` Anselm Helbig
2007-07-15  0:42   ` Rupert
2007-07-16 16:16 ` Mathias Dahl

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).