Emacs: yes-or-no-p in Russian?

I use

(fset 'yes-or-no-p 'y-or-np) ;; Make all "yes or no" prompts show "y or n" instead. 

answer the question "yes" or "now." Is there a way to add Russian counterparts as possible answers? So that y and the Russian letter n will stand for "yes", and n and t will stand for "no"?

+4
source share
1 answer

According to y-or-np documentation

Ask the user the question "y or n". Return t if the answer is "y". Accepts one argument, which is a display string to ask a question. It should end in space; y-or-np' adds (y or n)'. No, a confirmation of the response is requested; just one character is enough. Also accepts Space to indicate yes, or Delete to indicate no. (Actually, this uses the bindings in query-replace-map'; see the documentation of that variable for more information. In this case, the useful bindings are act', skip', recenter' and `quit '.)

So you need to add keys to query-replace-map Something like this

 ;; use the Russian '' (which is on the same ;; physical key as 'y') or '' (which shares ;; the key with 'n') in query-replace-map (define-key query-replace-map "" 'act) (define-key query-replace-map "" 'skip) 
+4
source

Source: https://habr.com/ru/post/1393346/


All Articles