exopen-suffix-cmdがnilのときにエラーになる不具合を回避
[exopen-mode.git] / exopen-mode.el
index 0e0ffec..46aa2f1 100644 (file)
        ((eq window-system 'w32) "cmd.exe /c start")))
 
 ;; exopen-modeでの拡張子とプログラムの関連付けリスト
-(defvar exopen-suffix-cmd)
+(defvar exopen-suffix-cmd nil)
 
 ;;; ファイルを外部プログラムでオープン
 ;;; exopen-std-cmdで指定されたプログラムを使用
 (defun exopen-file (file)
   "open file in external program"
   (let ((process-connection-type nil) (cmd))
-    (setq cmd (cdr(assoc (file-name-extension file 1) exopen-suffix-cmd)))
+    (if exopen-suffix-cmd
+        (setq cmd (cdr(assoc (file-name-extension file 1) exopen-suffix-cmd))))
     (if (null cmd)
         (setq cmd exopen-std-cmd))
     (start-process "exopen" nil cmd file)