(defmacro GNUEmacs (&rest x)
(list 'if (string-match "GNU Emacs" (prin1-to-string (version))) (cons 'progn x)))
(defmacro GNUEmacs20 (&rest x)
(list 'if (string-match "GNU Emacs 20" (prin1-to-string (version))) (cons 'progn x)))
(defmacro GNUEmacs21 (&rest x)
(list 'if (string-match "GNU Emacs 21" (prin1-to-string (version))) (cons 'progn x)))
(defmacro XEmacs (&rest x)
(list 'if (string-match "XEmacs 21" (prin1-to-string (version))) (cons 'progn x)))
(defmacro GNULinux (&rest x)
(list 'if (string-match "linux" (prin1-to-string system-type)) (cons 'progn x)))
(defmacro Windows (&rest x)
(list 'if (string-match "windows" (prin1-to-string system-type)) (cons 'progn x)))
(GNUEmacs
(setq load-path (cons "/emacs/user-lisp" load-path))
)
(Windows
(setq load-path (cons "/emacs/user-lisp" load-path))
)
(defvar cp866-decode-table
[ 255 240 nil nil 242 nil nil 244 nil nil nil nil nil nil 246 nil
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
252 241 nil nil 243 nil nil 245 nil nil nil nil nil nil 247 nil]
"Table for converting ISO-8859-5 characters into codepage 866 glyphs.")
(setplist 'cp866-decode-table
'(charset cyrillic-iso8859-5 language "Cyrillic-ISO" offset 160))
(defvar cp737-decode-table
[ 255 nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
248 nil 253 nil nil nil 234 250 235 236 237 nil 238 nil 239 240
nil 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
143 144 nil 145 146 147 148 149 150 151 244 245 225 226 227 229
nil 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
167 168 170 169 171 172 173 174 175 224 228 232 230 231 232 nil]
"Table for converting ISO-8859-7 characters into codepage 737 glyphs.")
(setplist 'cp737-decode-table
'(charset greek-iso8859-7 language "Greek" offset 160))
(GNUEmacs
(codepage-setup 437) (codepage-setup 737) (codepage-setup 869) (codepage-setup 851) (codepage-setup 866) (codepage-setup 1251)
(set-terminal-coding-system 'cp1251)
(set-keyboard-coding-system nil)
(setq default-buffer-file-coding-system 'cp1251)
(set-selection-coding-system 'cp1251)
(prefer-coding-system 'cp1251)
(define-coding-system-alias 'windows-1251 'cp1251)
(define-coding-system-alias 'microsoft-1251 'cp1251)
(define-coding-system-alias 'microsoft-cp1251 'cp1251)
(define-coding-system-alias 'windows-cp1251 'cp1251)
(define-coding-system-alias 'koi8-u 'cyrillic-koi8)
(define-coding-system-alias 'KOI8-R 'cyrillic-koi8)
(modify-coding-system-alist 'file "\.*" 'cp1251)
(modify-coding-system-alist 'file "\\.el$" 'iso-2022-7bit))
(standard-display-8bit 128 255)
(GNUEmacs
(pc-bindings-mode)
(pc-selection-mode))
(condition-case err
(require 'belarusian)
(error
(message "Cannot load belaruisan input method %s" (cdr err))))
(condition-case err
(require 'htmlize)
(error
(message "Cannot load htmlize %s" (cdr err))))
(condition-case err
(add-hook 'info-hook (require 'gc-info))
(error
(message "Cannot load gc-info %s" (cdr err))))
(condition-case err
(require 'msb)
(error
(message "Cannot load msb %s" (cdr err))))
(condition-case err
(require 'dictionary)
(error
(message "Cannot load dictionary %s" (cdr err))))
(condition-case err
(require 'blank-mode)
(error
(message "Cannot load blank-mode %s" (cdr err))))
(condition-case err
(require 'python-mode)
(error
(message "Cannot load python-mode %s" (cdr err))))
(condition-case err
(require 'css-mode)
(error
(message "Cannot load css-mode %s" (cdr err))))
(condition-case err
(require 'ansi-color)
(error
(message "Cannot load ansi-color %s" (cdr err))))
(autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
(cond ((fboundp 'global-font-lock-mode)
(global-font-lock-mode t)
(setq font-lock-maximum-decoration t)
(setq-default font-lock-maximum-size nil)
))
(add-hook 'font-lock-mode-hook 'turn-on-lazy-lock)
(setq lazy-lock-defer-on-scrolling t)
(GNUEmacs
(transient-mark-mode t))
(GNUEmacs
(show-paren-mode t))
(setq auto-mode-alist
(append
'(
("\\.h$" . c++-mode)
("\\.dps$" . pascal-mode)
("\\.l$" . c-mode)
("\\.y$" . c-mode)
("\\.py$" . python-mode)
("\\.css$" . css-mode)
("\\.Xdefaults$" . xrdb-mode)
("\\.Xenvironment$" . xrdb-mode)
("\\.Xresources$" . xrdb-mode)
("*.\\.ad$" . xrdb-mode)
) auto-mode-alist)
)
(setq display-time-24hr-format t)
(setq display-time-day-and-date t)
(display-time)
(resize-minibuffer-mode 1)
(setq european-calendar-style 't)
(setq calendar-week-start-day 1)
(setq calendar-latitude 51.05)
(setq calendar-longitude -2.39)
(setq calendar-location-name "Ieper")
(set-default 'case-fold-search t)
apropossuper-apropos(setq apropos-do-all t)
(add-hook 'comint-output-filter-functions 'shell-strip-ctrl-m nil t)
(column-number-mode 1)
(setq default-tab-width 2)
(add-hook 'text-mode-hook 'auto-fill-mode t)
(GNUEmacs
(hscroll-global-mode t))
(setq inhibit-startup-message t)
(setq next-line-add-newlines nil)
(setq delete-old-versions t)
(setq scroll-step 1)
(load "desktop")
(desktop-load-default)
(desktop-read)
(fset 'yes-or-no-p 'y-or-n-p)
(dynamic-completion-mode)
(Windows
(set-message-beep 'silent))
(setq-default
frame-title-format
(list
'((buffer-file-name
" %f"
(dired-directory
dired-directory
(revert-buffer-function
" %b"
("%b - Dir: " default-directory)))))))
(setq-default
icon-title-format
(list
'((buffer-file-name
" %f"
(dired-directory
dired-directory
(revert-buffer-function
" %b"
("%b - Dir: " default-directory)))))))
(custom-set-variables
'(url-be-asynchronous t)
'(url-external-retrieval-program "wget")
'(url-mail-command (quote mail)))
(eval-after-load "mule-sysdp"
'(push '("windows-1251" . cp1251) w3-mime-charset-coding-alist))
(setq user-name "yourname")
(setq user-full-name "Your Full Name")
(setq user-mail-address "your@ddress")
(setq mail-default-headers "Content-Type: text/plain; charset=windows-1251\n")
(setq mail-yank-prefix ">")
(setq mail-signature t)
(setq gnus-check-new-newsgroups nil
gnus-read-active-file nil
gnus-nov-is-evil nil
gnus-select-method '(nntp "ddt.demos.su")
system-name "localhost")
(gnus-mule-add-group "fido7.ru" 'cyrillic-koi8)
(defadvice dired-advertised-find-file (around
dired-subst-directory activate)
"Replace current buffer if file is a directory."
(interactive)
(let ((orig (current-buffer))
(filename (dired-get-filename)))
ad-do-it
(when (and (file-directory-p filename)
(not (eq (current-buffer) orig)))
(kill-buffer orig))))
(defun insert-userid ()
"Insert the my full name and address"
(interactive)
(insert user-full-name " <" user-mail-address ">"))
(defun insert-date ()
"Insert date at point."
(interactive)
(insert (format-time-string "%d.%m.%Y %H:%M")))
(setq ps-n-up-printing 2)
(setq ps-print-header nil)
(GNULinux
(define-key global-map [(delete)] "\C-d")
(create-fontset-from-fontset-spec
"-misc-*-medium-r-*-*-14-*-*-*-*-*-fontset-debian,
latin-iso8859-1:-misc-*-medium-r-*-*-14-*-*-*-*-*-*-1,
latin-iso8859-2:-misc-*-medium-r-*-*-14-*-*-*-*-*-*-2,
cyrillic-iso8859-5:-misc-*-medium-r-*-*-14-*-*-*-*-*-*-5")
(GNUEmacs20
(set-default-font "-adobe-courier-medium-r-*-*-14-*-*-*-*-*-*-*"))
)
(Windows
(set-w32-system-coding-system 'cp1251)
(setq w32-standard-fontset-spec
"-*-Courier New-normal-r-*-*-12-*-*-*-c-*-fontset-courier,
ascii:-*-Courier New-normal-r-*-*-12-*-*-*-c-*-iso8859-1,
latin-iso8859-1:-*-Courier New-normal-r-*-*-12-*-*-*-c-*-iso8859-1,
latin-iso8859-2:-*-Courier New-normal-r-*-*-12-*-*-*-c-*-iso8859-2,
latin-iso8859-3:-*-Courier New-normal-r-*-*-12-*-*-*-c-*-iso8859-3,
latin-iso8859-4:-*-Courier New-normal-r-*-*-12-*-*-*-c-*-iso8859-4,
latin-iso8859-9:-*-Courier New-normal-r-*-*-12-*-*-*-c-*-iso8859-9,
cyrillic-iso8859-5:-*-Courier New-normal-r-*-*-12-*-*-*-c-*-iso8859-5,
greek-iso8859-7:-*-Courier New-normal-r-*-*-12-*-*-*-c-*-iso8859-7,
hebrew-iso8859-8:-*-Rod-normal-r-*-*-12-*-*-*-c-*-iso8859-8,
ipa:-*-Lucida Sans Unicode-normal-r-*-*-12-*-*-*-c-*-muleipa*-*,
thai-tis620:-*-Tahoma-normal-r-*-*-12-*-*-*-c-*-tis620-*,
latin-jisx0201:-*-MS Gothic-normal-r-*-*-12-*-*-*-c-*-jisx0208-sjis,
katakana-jisx0201:-*-MS Gothic-normal-r-*-*-12-*-*-*-c-*-jisx0208-sjis,
japanese-jisx0208:-*-MS Gothic-normal-r-*-*-12-*-*-*-c-*-jisx0208-sjis,
japanese-jisx0208-1978:-*-MS Gothic-normal-r-*-*-12-*-*-*-c-*-jisx0208-sjis,
japanese-jisx0212:-*-MS Gothic-normal-r-*-*-12-*-*-*-c-*-jisx0212-sjis,
korean-ksc5601:-*-Gulim-normal-r-*-*-12-*-*-*-c-*-ksc5601-*,
chinese-gb2312:-*-MS Song-normal-r-*-*-12-*-*-*-c-*-gb2312-*,
chinese-big5-1:-*-MingLiU-normal-r-*-*-12-*-*-*-c-*-big5-*,
chinese-big5-2:-*-MingLiU-normal-r-*-*-12-*-*-*-c-*-big5-*")
(setq w32-enable-italics t)
(create-fontset-from-fontset-spec w32-standard-fontset-spec t)
(setq w32-use-w32-font-dialog nil)
(setq w32-fixed-font-alist '("Select Fontset"))
(setq bdf-directory-list
'("d:/intlfonts/Asian" "d:/intlfonts/Chinese"
"d:/intlfonts/Chinese.X" "d:/intlfonts/Ethiopic"
"d:/intlfonts/European" "d:/intlfonts/Japanese"
"d:/intlfonts/Japanese.X" "d:/intlfonts/Korean.X"
"d:/intlfonts/Misc/" "d:/intlfonts/Japanese.BIG"))
(setq w32-bdf-filename-alist (w32-find-bdf-fonts bdf-directory-list))
(setq ps-printer-name "//yourserver/yourprinter")
(load-library "ps-mule")
(setq ps-multibyte-buffer
'bdf-font
ps-mule-font-info-database ps-mule-font-info-database-bdf
bdf-directory-list
'(
"d:/intlfonts/Asian"
"d:/intlfonts/Chinese"
"d:/intlfonts/Chinese.X"
"d:/intlfonts/Ethiopic"
"d:/intlfonts/European"
"d:/intlfonts/Japanese"
"d:/intlfonts/Japanese.X"
"d:/intlfonts/Korean.X"
"d:/intlfonts/Misc"
"d:/intlfonts/Japanese.BIG")
)
(create-fontset-from-fontset-spec
"-*-fixed-medium-r-normal-*-16-*-*-*-c-*-fontset-bdf,
japanese-jisx0208:-*-*-medium-r-normal-*-16-*-*-*-c-*-jisx0208.1983-*,
katakana-jisx0201:-*-*-medium-r-normal-*-16-*-*-*-c-*-jisx0201*-*,
latin-jisx0201:-*-*-medium-r-normal-*-16-*-*-*-c-*-jisx0201*-*,
japanese-jisx0208-1978:-*-*-medium-r-normal-*-16-*-*-*-c-*-jisx0208.1978-*,
thai-tis620:-misc-fixed-medium-r-normal--16-160-72-72-m-80-tis620.2529-1,
lao:-misc-fixed-medium-r-normal--16-160-72-72-m-80-MuleLao-1,
tibetan-1-column:-TibMdXA-fixed-medium-r-normal--16-160-72-72-m-80-MuleTibetan-1,
ethiopic:-Admas-Ethiomx16f-Medium-R-Normal--16-150-100-100-M-160-Ethiopic-Unicode,
tibetan:-TibMdXA-fixed-medium-r-normal--16-160-72-72-m-160-MuleTibetan-0")
(setq font-encoding-alist
(append '(("MuleTibetan-0" (tibetan . 0))
("GB2312" (chinese-gb2312 . 0))
("JISX0208" (japanese-jisx0208 . 0))
("JISX0212" (japanese-jisx0212 . 0))
("VISCII" (vietnamese-viscii-lower . 0))
("KSC5601" (korean-ksc5601 . 0))
("MuleArabic-0" (arabic-digit . 0))
("MuleArabic-1" (arabic-1-column . 0))
("MuleArabic-2" (arabic-2-column . 0)))
font-encoding-alist))
(defun my-shell-setup ()
"For bash (cygwin 18) under Emacs 20"
(setq comint-scroll-show-maximum-output 'this)
(setq comint-completion-addsuffix t)
(setq comint-eol-on-send t)
(setq w32-quote-process-args ?\")
(make-variable-buffer-local 'comint-completion-addsuffix))
(setq shell-mode-hook 'my-shell-setup)
(setq binary-process-input t)
(setq process-coding-system-alist
(cons
'("bash" . cp1251)
process-coding-system-alist))
)
(GNULinux
(create-fontset-from-fontset-spec
"-adobe-courier-medium-r-*-*-14-*-*-*-*-*-fontset-adobe,
latin-iso8859-1:-adobe-courier-medium-r-*-*-14-*-*-*-*-*-*-1,
latin-iso8859-2:-adobe-courier-medium-r-*-*-14-*-*-*-*-*-*-2,
cyrillic-iso8859-5:-adobe-courier-medium-r-*-*-14-*-*-*-*-*-*-5")
(create-fontset-from-fontset-spec
"-adobe-courier-medium-o-*-*-14-*-*-*-*-*-fontset-adobe,
latin-iso8859-1:-adobe-courier-medium-o-*-*-14-*-*-*-*-*-*-1,
latin-iso8859-2:-adobe-courier-medium-o-*-*-14-*-*-*-*-*-*-2,
cyrillic-iso8859-5:-adobe-courier-medium-o-*-*-14-*-*-*-*-*-*-5")
(create-fontset-from-fontset-spec
"-adobe-courier-bold-o-*-*-14-*-*-*-*-*-fontset-adobe,
latin-iso8859-1:-adobe-courier-bold-o-*-*-14-*-*-*-*-*-*-1,
latin-iso8859-2:-adobe-courier-bold-o-*-*-14-*-*-*-*-*-*-2,
cyrillic-iso8859-5:-adobe-courier-bold-o-*-*-14-*-*-*-*-*-*-5")
(create-fontset-from-fontset-spec
"-adobe-courier-bold-r-*-*-14-*-*-*-*-*-fontset-adobe,
latin-iso8859-1:-adobe-courier-bold-r-*-*-14-*-*-*-*-*-*-1,
latin-iso8859-2:-adobe-courier-bold-r-*-*-14-*-*-*-*-*-*-2,
cyrillic-iso8859-5:-adobe-courier-bold-r-*-*-14-*-*-*-*-*-*-5")
(set-default-font "fontset-adobe")
(setq default-frame-alist
'(
(width . 110) (height . 43)
(cursor-color . "black")
(cursor-type . box)
(foreground-color . "black")
(background-color . "white")
)
)
)
(Windows
(setq default-frame-alist
'(
(top . 2) (left . 5)
(width . 120) (height . 43)
(cursor-color . "black")
(cursor-type . box)
(foreground-color . "black")
(background-color . "white")
(font . "-*-Courier
New-normal-r-*-*-12-*-*-*-c-*-fontset-courier")
)
)
)
(custom-set-faces
'(modeline ((t (:inverse-video nil :foreground "black" :background "skyblue"))))
'(font-lock-comment-face ((((class color)) (:foreground "firebrick" :italic t))))
'(font-lock-keyword-face ((((class color)) (:foreground "dodger blue" :bold t) )))
)
|