Определение рабочего окружения и возможностей платформы в Emacs
Для правильной работы файла настроек
.emacs
на различных платформах и различных версиях Emacs требуется проверять множество условий.
Итак посмотрите на указанные переменные:
emacs-major-version
emacs-minor-version
window-system - 'nil' if in terminal, 'w32' if native Windows build, 'x' if under X Window
window-system-version - for windows only
operating-system-release - release of the operating system Emacs is running on
system-configuration - like configuration triplet: cpu-manufacturer-os
system-name - host name of the machine you are running on
system-time-locale
system-type - indicating the type of operating system you are using:
'gnu' (GNU Hurd), 'gnu/linux', 'gnu/kfreebsd' (FreeBSD),
'darwin' (GNU-Darwin, Mac OS X), 'ms-dos', 'windows-nt', 'cygwin'
system-uses-terminfo
window-size-fixed
а также указанные функции:
(fboundp ...) - return t if SYMBOL's function definition is not void
(featurep ...) - returns t if FEATURE is present in this Emacs
(display-graphic-p) - return non-nil if DISPLAY is a graphic display; graphical
displays are those which are capable of displaying several
frames and several different fonts at once
(display-multi-font-p) - same as 'display-graphic-p'
(display-multi-frame-p) - same as 'display-graphic-p'
(display-color-p) - return t if DISPLAY supports color
(display-images-p) - return non-nil if DISPLAY can display images
(display-grayscale-p) - return non-nil if frames on DISPLAY can display shades of gray
(display-mouse-p) - return non-nil if DISPLAY has a mouse available
(display-popup-menus-p) - return non-nil if popup menus are supported on DISPLAY
(display-selections-p) - return non-nil if DISPLAY supports selections
Виполняйте проверки наподобии того как делается ниже:
(when window-system ...)
(when (eq window-system 'x) ...)
(when (>= emacs-major-version 22) ...)
(when (fboundp '...) ...)
(when (featurep '...) ...)
0 comments:
Отправить комментарий