Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Does emacs have an incremental search mode, where searching for a character will search for itself and for any other versions of the character with accent marks, similar to how Google Chrome (at least v27) will do when searching in a page?

Alternatively, is there an additional library or piece of elisp code that can put incremental search in such a mode?

For example, incremental search for:

  • 'manana', would find 'manana' or 'mañana'
  • 'motley crue', would also find 'Mötley Crüe' (with case-sensitivity off).

Even a solution that only covers a subset of these characters would be helpful.

share|improve this question
    
Great question. Juri Linkov was talking about implementing this for Emacs, but nothing has come of it so far. See these two Emacs bug threads: (1) debbugs.gnu.org/cgi/bugreport.cgi?bug=13041 and (2) debbugs.gnu.org/cgi/bugreport.cgi?bug=13480#41. –  Drew Nov 12 '13 at 4:14
    
Not the solution, but there are libraries that can at least remove accents from text. You might be able to get some of what you want done using one of those (remove accents temporarily etc.). I believe there are several such libraries, but I only know of one that I wrote long ago: unaccent.el. You can no doubt find something more recent and better. But we really need a solution such as that discussed in the first bug thread cited above. –  Drew Nov 12 '13 at 4:17
    
This link (thread.gmane.org/gmane.emacs.devel/117003/focus=117959) in the first bug you mentioned meets my current need perfectly. Is there a way to have you enter your comment (and maybe the code snippet) as a reply so I can accept it as an answer? –  user38983 Nov 12 '13 at 20:41
    
Done - below. Thanks! –  Drew Nov 12 '13 at 23:13

2 Answers 2

up vote 3 down vote accepted

Great question. Juri Linkov was talking about implementing this for Emacs, but nothing has come of it so far. See these two Emacs bug threads:

See this part of the first bug thread, for instance. It includes this code from Ulrich Mueller:

   (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))
share|improve this answer

I've no perfect solution, but I use incremental regexp search : C-S-s ma[nñ]ana or C-S-s ma.ana but this is not ideal.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.