;;lyy 支持appload加载、命令行(load "xx")加载和直接拖曳加载
(vl-load-com)
(defun set_path (/ str n1 n2)
(while (/= 0 (getvar "cmdactive")) (command))
(princ "\n")
(setq str (getvar "lastprompt"))
(if (wcmatch (strcase str) "*(LOAD \"*")
(setq n1 (vl-string-search "(LOAD \"" str)
n2 (vl-string-search "\")" str)
str (substr str (+ n1 8) (- n2 n1 7))
)
(setq str
(vl-registry-read "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ComDlg32\\OpenSaveMRU\\*"
(substr (vl-registry-read "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ComDlg32\\OpenSaveMRU\\*" "MRUList") 1 1)
)
)
)
(setenv "ACAD" (strcat (getenv "ACAD") ";" (vl-filename-directory str)))
)
(set_path)
(setq set_path nil)