Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

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

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)

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)
replaced http://emacs.stackexchange.com/ with https://emacs.stackexchange.com/
Source Link

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 codeStefan'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)

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)

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)
Further explanation of answer
Source Link
Todd
  • 211
  • 1
  • 8

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)

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.

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)
Source Link
Todd
  • 211
  • 1
  • 8
Loading