से भी कम keypresses मुझे नहीं लगता कि आप Emacs कॉन्फ़िगर कर सकते हैं कि वह सभी आदेशों के लिए करता है कि है। हालांकि, आप स्वयं को कमांड में इस कार्यक्षमता को कार्यान्वित कर सकते हैं। यह सी-एक्स ई के लिए किया जाता है।
(defmacro with-easy-repeat (&rest body)
"Execute BODY and repeat while the user presses the last key."
(declare (indent 0))
`(let* ((repeat-key (and (> (length (this-single-command-keys)) 1)
last-input-event))
(repeat-key-str (format-kbd-macro (vector repeat-key) nil)))
,@body
(while repeat-key
(message "(Type %s to repeat)" repeat-key-str)
(let ((event (read-event)))
(clear-this-command-keys t)
(if (equal event repeat-key)
(progn ,@body
(setq last-input-event nil))
(setq repeat-key nil)
(push last-input-event unread-command-events))))))
यहाँ आप कैसे उपयोग है: यहाँ एक मैक्रो मैं सिर्फआपके स्वयं के आदेशों को यह कार्यक्षमता जोड़ने के लिए बनाता है (जीएनयू Emacs 23.1.1 में kmacro-call-macro
की मानक परिभाषा के द्वारा निर्देशित) ने लिखा है यह:
(defun hello-world()
(interactive)
(with-easy-repeat
(insert "Hello, World!\n")))
(global-set-key (kbd "C-c x y z") 'hello-world)
अब आप प्रतिलिपि xyzzzHello, World!
तीन बार सम्मिलित करने के लिए लिख सकते हैं। इस तरह
स्रोत
2011-09-26 19:43:12
पूरी तरह से काम करता है। धन्यवाद! – TheEzEzz
Emacs 'repeat' पैकेज भी देखें। –
@event_jr अच्छा !! पारितोषिक के लिए धन्यवाद। –