2013-02-07 178 views
7

我需要在一個小小的腳本中使用update-directory-autoloads函數。當我試圖調用此函數是一個目錄的名稱的說法我收到此錯誤:錯誤類型參數:stringp,nil錯誤

Wrong type argument: stringp, nil.

呼叫看起來是這樣的: (update-directory-autoloads "~/test")

回答

6

生成自動加載的文件是不良記錄。您遇到由於您未設置變量generated-autoload-file而出現的問題。請嘗試以下操作:

(let ((generated-autoload-file "~/test/loaddefs.el")) 
    (update-directory-autoloads "~/test")) 

更新generated-autoloads-file結合是你想要的loaddefs.el文件住的位置。

+0

謝謝。問題確實在於未定義生成的自動加載文件。 –

9

當你得到Wrong type argument: foo, bar.,你應該M-: (setq debug-on-error t) RET,然後重現錯誤,以獲得回溯。實際上,您可以在您的.emacs中設置debug-on-error,Emacs通常保持完美可用。

+7

'M-x toggle-error-on-error'對於交互式案例來說有點更好。 – phils

+0

確實。甚至菜單中的「選項=>在錯誤中輸入調試器」。 – Stefan

相關問題