deft icon indicating copy to clipboard operation
deft copied to clipboard

Does Deft prohibit none English searching?

Open soulawaker opened this issue 5 years ago • 8 comments

I want to search with Korean language in Deft. Though my Emacs input method indicates Korean language mode, all key inputs appear in English in Deft search line only. I don't know yet whether this problem is just my Emacs settings or related in Deft. Does Deft itself prevent users from inputting none English character in search line?

soulawaker avatar Oct 06 '18 01:10 soulawaker

From my experience I can say, that generally you can input non-Latin, e.g. Cyrillic characters in the search line.

saf-dmitry avatar Oct 10 '18 13:10 saf-dmitry

@saf-dmitry I tried cyrillic-translit with Emacs set-input-method. In my case, Deft did not recognize its input method type at all. All keyboard inputs were recognized as English in Deft only. How could you do that?

soulawaker avatar Oct 10 '18 15:10 soulawaker

@soulawaker As far as I can see from the code, Deft does not play well with the Emacs input methods, just mapping the first 256 key codes to the corresponding self-inserting commands and appending the letters to the filter string. I do switch the keyboard layout on the OS level.

saf-dmitry avatar Oct 11 '18 06:10 saf-dmitry

@saf-dmitry Thanks for the information. I confirmed OS level input method switching worked. But it's quite inconvenient than internal input-method.

soulawaker avatar Oct 11 '18 07:10 soulawaker

@soulawaker You can edit the filter string in the minibuffer by pressing C-c C-l. Then while in minibuffer you can enable input method by pressing C-\, type your filter string and hit RET. While certainly not so convenient like an incremental search, this works quite well.

@jrblevin Could it be possible to implement toggling of input method in incremental search mode, like I-search does it?

saf-dmitry avatar Oct 11 '18 13:10 saf-dmitry

@saf-dmitry Many thanks! I found it just yesterday. And I tried to implant Korean language, "Hangul" keycode imitating original deft source in deft-mode-map, then still it can not be inputted. Maybe need more study. @jrblevin Thanks for making deft.

soulawaker avatar Oct 12 '18 12:10 soulawaker

That would be amazing to have other input-methods available in the incremental filtering mode! +1

JonatanSahar avatar May 20 '20 13:05 JonatanSahar

Apparently the deft code is based on isearch. isearch-mode-map is very similar to deft-mode-map, isn't it? And isearch-printing-char is a prototype of deft-filter-increment, except for processing multibyte strings.

There is also an isearch-minibuffer-local-map, which most likely catches bytes, but I don't understand by whom it is evaluated.

Someone can try to take support for multibyte strings from there. Maybe someone who know elisp more than me will be able to add it there, I haven't succeeded yet. :cry:

The problem is that isearch works in a minibuffer, deft - in regular. I tried to convert the string using this post, but so far it has been possible to collect all the bytes.

PRESFIL avatar Mar 08 '22 11:03 PRESFIL