How can I make an interactive function that interactively reads the key from the user (for example, when you press Ch k), and then writes some line as follows:
(global-set-key (kbd "C-x C-s") 'hello)
where part of Cx Cs is replaced accordingly by the read key.
Some novice users have a problem creating keys ... and I'm actually embarrassed too, so I thought let's just automate it.
It works:
(defun insert-key (key) (interactive (list (read-key-sequence "Key: "))) (insert "(global-set-key (kbd \"" (key-description key) "\") 'hello)\n"))
? , , , : global-set-key - . , (IIUC): (, ..), .
global-set-key
Source: https://habr.com/ru/post/1717366/More articles:How to make MySQL MAX () consider NULL the smallest possible value? - nullWhat is the best way to clear information from the public? - securityУсловная вставка в SqlServer Compact Edition - sqlWhy does with_progress do "Thread.new"? - ruby | fooobar.comGet rid of the last item counter - cssWhy does ServletContext # getRealPath ("/") return a relative path? - javaRequires: An elegant solution to the conditions of the race - c ++Conversion error in host variable or * N parameter - sqlGetting path from file descriptor or FILE *? - cBetween Passenger and Rails, lowercase underscores in URLs are not handled properly - ruby-on-railsAll Articles