2011-07-19 64 views

回答

2

你只需要重寫/調整,爲了這個創建打印格式的程序。將以下內容添加到您的.emacs中,您將會很好。

(require 'simple) 
(defun eval-expression-print-format (value) 
    "Format VALUE as a result of evaluated expression. 
Return a formatted string which is displayed in the echo area 
in addition to the value printed by prin1 in functions which 
display the result of expression evaluation." 
    (if (and (integerp value) 
      (or (not (memq this-command '(eval-last-sexp eval-print-last-sexp))) 
       (eq this-command last-command) 
       (if (boundp 'edebug-active) edebug-active))) 
     (let ((char-string 
      (if (or (if (boundp 'edebug-active) edebug-active) 
        (memq this-command '(eval-last-sexp eval-print-last-sexp))) 
       (prin1-char value)))) 
     (format " (#x%x)" value value)))) 
+0

謝謝!爲構成emacs發行版的函數編寫替代品是否是標準做法? – sigjuice

+0

@sigjuice標準?沒有。大部分人想要的定製都是通過變量/鉤子變化來滿足的,或者最糟糕的情況是使用一些建議。也就是說,有時獲得您想要的唯一方法是修改/覆蓋原始代碼,這是Emacs(和GPL)設計的一部分。 –