help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: changing word boundaries


From: Dave Love
Subject: Re: changing word boundaries
Date: Sun, 01 Nov 2009 19:09:53 +0000
User-agent: Gnus/5.110011 (No Gnus v0.11)

Ernest Adrogué <address@hidden> writes:

> Hi there,
>
> The Catalan language has a ligature consisting in one
> "l" character, followed by a middle dot ("·"), followed
> by another "l". See here for more details:
> http://en.wikipedia.org/wiki/L·l#Catalan
>
> Is there a way to make emacs aware of this, so that it
> doesn't treat a word containing "l·l" as two separate
> words?

[You're probably not really interested in word boundaries, just word
constituents.  For an illustration of the difference, see variable
`word-combining-categories' and what capitalized-words-mode does in
Emacs 23.]

You should define a Catalan language environment to be used in ca_ES
locales.  (I'm surprised I didn't do it, as there's a relevant input
method.)  It should set the base syntax of · to word, and set a suitable
default input method.  The existing one, `catalan-prefix', should
presumably bind `~.' to `·', as in latin-prefix; it doesn't currently,
and maybe needs other fixes.

The environment would be something like this (untested), which is
probably better then trying to use categories.  [The default Latin-1
character set is overridden in, say, ca_ES.UTF-8.]
  
  (push '("ca" . "Catalan") locale-language-names)

  (set-language-info-alist
   "Catalan" '((tutorial . "TUTORIAL.es")       ; maybe...
            (charset iso-8859-1)
            (coding-system iso-latin-1 iso-latin-9)
            (coding-priority iso-latin-1)
            (input-method . "catalan-prefix")
            (nonascii-translation . iso-8859-1)
            (unibyte-display . iso-latin-1)
            (setup-function
             . (lambda ()
                 (modify-syntax-entry ?· "w" (standard-syntax-table))))
            (exit-function
             . (lambda ()
                 (modify-syntax-entry ?· "_" (standard-syntax-table))))
            ;; Fixme:
            ;; (sample-text . "Spanish (Español)        ¡Hola!")
            (documentation . "\
  This language environment uses the Latin-1 character set, sets
  the default input method to \"catalan-prefix\", and sets the
  syntax of `·' to word.  It selects the Spanish tutorial, in the
  absence of a Catalan translation."))
   '("European"))

You could make a bug report if you have more luck than me with reports
about stuff I worked on.




reply via email to

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