Я работаю над специальным файлом .emacs, который смогу использовать на нескольких разных компьютерах. Я хотел бы иметь возможность загружать режим, если он существует в системе. Если его не существует, я бы хотел, чтобы Emacs перестал показывать ошибку: File error: Cannot open load file, X
.
Например:
(require 'darkroom-mode)
Результаты в:
File error: Cannot open load file, darkroom-mode
Я использую file-exists-p
, чтобы проверить, существуют ли какие-то другие файлы, но для этого теста я предполагаю, что мне нужно найти свой путь загрузки. Я новичок в Lisp, так что это меня ставит в тупик.
(ignore-errors (require 'whatever))
. - person jrockway   schedule 12.05.2010