emacs-devel
[Top][All Lists]
Advanced

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

Re: Case mapping of sharp s


From: Juri Linkov
Subject: Re: Case mapping of sharp s
Date: Mon, 30 Nov 2009 14:01:04 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu)

> I'm not sure if it's exactly what you need, but I use the following to
> search for characters while ignoring any accents:
>
>    (let ((eqv-list '("aAàÀáÁâÂãÃäÄåÅ"
>                    "cCçÇ"
>                    "eEèÈéÉêÊëË"
>                    "iIìÌíÍîÎïÏ"
>                    "nNñÑ"
>                    "oOòÒóÓôÔõÕöÖøØ"
>                    "uUùÙúÚûÛüÜ"
>                    "yYýÝÿ"))
>        (table (standard-case-table))
>        canon)
>      (setq canon (copy-sequence table))
>      (mapcar (lambda (s)
>              (mapcar (lambda (c) (aset canon c (aref s 0))) s))
>            eqv-list)
>      (set-char-table-extra-slot table 1 canon)
>      (set-char-table-extra-slot table 2 nil)
>      (set-standard-case-table table))
>
> I don't know if there is a simpler way to achieve this.

This is exactly what I need - to ignore accents while searching.
I wonder why there is no mode like `search-ignore-accents-mode'
that does this.

-- 
Juri Linkov
http://www.jurta.org/emacs/




reply via email to

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