2011-09-07 27 views
4

我寫了一個新版本的「zap-to-char」。它只是突出顯示區域而不是殺死它。我認爲這會更靈活,因爲我們可以選擇殺死,或複製,或只是去這個字符。需要一個Elisp函數來推回一個輸入

下面是摘錄:

(defun new-zap-to-char (arg char) 
    (interactive "p\ncZap to char: ") 
    (push-mark) 
    (setq mark-active t) 
    (defun iter-zap() 
    (if (< arg 0) 
     (search-forward (char-to-string char) nil nil -1) 
     (search-forward (char-to-string char) nil nil 1)) 
    (if (char-equal char (setq c (read-char))) 
     (iter-zap) 
     (>>>>here is the "push-back-to-input" function"<<<<)) 
(iter-zap)) 

正如你看到的,我需要一個函數來推動的「讀取字符」結果回輸入,當你除了「char」類型的輸入。但我不知道Emacs是否提供了一個。所以我需要你的幫助。

我希望我已經說清楚了。

回答

4

您可以試試unread-command-events

例如:

(push ?a unread-command-events) 
+0

感謝,這是我真正想要的東西。 –

相關問題