I was wondering if there is any way of searching (incremental search) for a UTF-8 character in julia mode, other than typing the character and copying it into the minibuffer.
I think you can use special input modes to enter unicode characters, but julia-mode is not using the standard tex input mode. Instead, it defines (kbd "TAB") on julia-mode-map which expands to the entry in the hash table, julia-latexsubs.
Also, I don't want to have to look-up the unicode character in the hash table and enter it manually.
EDIT
I'm going to attempt a brief explanation of Stefan's code. The tab key is redefined for isearch-mode-map. First, the binding of newstr creates a temporary buffer and inserts the text from isearch-string. Then run the julia-latexsub function to see if the previous characters are a hash table entry for a utf-8 character. If not, newstr will be nil; otherwise, it will now contain the new character.
If newstr is nil, continue on with isearch as normal; otherwise, update isearch-string with newstr. Then there is some code copied directly from isearch. I'm not familiar with it, but presumably the purpose is to update what happens in the major mode buffer when the isearch-string has changed.
I also found a way to limit the new behavior to Julia-mode. The following seems to work. Insert following newstr.
(if (eq (buffer-local-value 'major-mode (get-buffer (buffer-name)))
'julia-mode)
code-to-evaluate)
isearch
, and if I understand correctly, the fact that it'sjulia-mode
is not relevant. See the manual node for special input for incremental search.