;;; The init.el file, which should reside in your home directory, allows you to ;;; customize the behavior of Emacs. In general, changes to your init.el file ;;; will not take effect until the next time you start up Emacs. You can load ;;; it explicitly with `M-x load-file RET ~/.xemacs/init.el RET'. ; ;;;;;;;;;;; ;; Aspell ispell (setq-default ispell-program-name "ispell") ; - 60 (setq auto-save-timeout 60) ;; (require 'tex-site) (setq TeX-auto-save t) (setq TeX-parse-self t) (setq-default TeX-master nil) ;; . (add-hook 'text-mode-hook '(lambda () (auto-fill-mode 1))) ;; (setq line-number-mode t) (setq default-major-mode 'text-mode scroll-step 1 european-calendar-style t) ;; (setq frame-title-format "%S: %f") (standard-display-european 1) (require 'case-table) (let* ((ruc "\341\342\367\347\344\345\263\366\372\351\352\353\354\355\356\357\360\362\363\364\365\346\350\343\376\373\375\370\371\377\374\340\361") (rlc "\301\302\327\307\304\305\243\326\332\311\312\313\314\315\316\317\320\322\323\324\325\306\310\303\336\333\335\330\331\337\334\300\321") (i 0) (len (length ruc))) (while (< i len) (modify-syntax-entry (elt ruc i) "w ") (modify-syntax-entry (elt rlc i) "w ") (set-case-syntax-pair (elt ruc i) (elt rlc i) (standard-case-table)) (setq i (+ i 1)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Basic Customization ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Enable the command `narrow-to-region' ("C-x n n"), a useful ;; command, but possibly confusing to a new user, so it's disabled by ;; default. (put 'narrow-to-region 'disabled nil) ;; Make the sequence "C-x w" execute the `what-line' command, ;; which prints the current line number in the echo area. (global-set-key "\C-xw" 'what-line) (global-set-key [(control f8)] 'what-line) (global-set-key [(meta f8)] 'goto-line) ;; set up the function keys to do common tasks to reduce Emacs pinky ;; and such. ;; Make F1 invoke help (global-set-key [f1] 'help-command) ;;; Make F2 be `save-buffer' (global-set-key [(meta backspace)] 'undo) ; C-x C-c (global-set-key "\C-x\C-c" nil) ;; ;; Ispell ;; ;(setq ispell-dictionary-alist ; (append ispell-dictionary-alist ; (list ; (list ; "russian" ; "[]" ; "[^]" ; "" ; nil ; ("-d" "russian") ; nil ; nil))) ; ispell-dictionary "russian") ;(require 'ispell) (setq ispell-dictionary-alist-100 '( ( "russianw" "[Ũ]" "[^Ũ]" "" nil ("-d" "russianw") nil nil )) ) (setq ispell-local-dictionary-alist ispell-dictionary-alist-100) (setq ispell-local-dictionary "russianw") ;(setq ispell-dictionary-alist ( ; append ispell-dictionary-alist-100 ispell-dictionary-alist ; ) ;) ;(setq ispell-dictionary-alist-6 '( ; ("russian" ; "[ţ]" ; "[^ţ]" ; "" ; nil ; ("-d" "russian") ; nil ; koi8-r) ;("svenska" "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-C") "~list" iso-8859-1))) (if (device-on-window-system-p) (progn (load "recent-files") (recent-files-initialize) (setq display-time-24hr-format t display-tme-mail-file nil display-time-form-list (list 'time) display-time-day-and-date nil) (display-time))) ;; . (require 'font-lock) (setq auto-mode-alist (append '( ( "\\.rao$" . rao-mode ) ) auto-mode-alist)) ;"\\<[0-3]?[0-9][/.-][0-1]?[0-9][/.-][0-9][0-9]([0-9][0-9])?\\>" . (defvar rao-font-lock-keywords '(("\\<\\w*\\(\ \\|\ \\|\ \\|\ \\)\\w*\\>" . font-lock-keyword-face) ( "\\b[0-3]?[0-9][-./][0-1]?[0-9][-./][0-9][0-9]\\([0-9][0-9]\\)?\\b" . font-lock-type-face) ( "\\b[0-3]?[0-9]\\s +\ \\b\\(\ []\\|\ []\\|\ []?\\|\ []\\|\ []\\|\ []\\|\ []\\|\ ?\\|\ []\\|\ []\\|\ []\\|\ []\\|\ []\\)\\b\ \\(\\s +[0-9][0-9]\\([0-9][0-9]\\)?\\b\\(\\s +\\b\\w*\\b\\)?\\)?" . font-lock-type-face) ) "Default expressions to highlight in RAO mode.") (defun rao-mode () " " (interactive) (kill-all-local-variables) (text-mode) (make-local-variable 'font-lock-defaults) (setq font-lock-defaults '(rao-font-lock-keywords nil t)) (font-lock-fontify-buffer) ) (defvar font-lock-maximum-size nil) ;(add-spec-list-to-specifier (face-property 'default 'font) ; '((global (nil . "Courier New:Regular:10::Cyrillic")))) ;; some parameters (setq my-font-set 1) ; my font set (setq my-is-xemacs ; not nil if XEmacs (string-match "XEmacs" emacs-version)) ;; ========== Appearance ;; Fonts (make-face-bold 'default) (make-face-unbold 'default) ;(setq bold default) (setq mswindows-font-menu-registry-encoding "Cyrillic") (if my-is-xemacs (cond ((= my-font-set 1) ;;=== XEmacs ;;=== set #1 === (set-face-font 'default "Courier New:Regular:10::Cyrillic") ;(set-face-font 'bold "Courier New:Regular:10::Cyrillic") ;(make-face-bold 'bold) ;(set-face-font 'default "Courier New::::Cyrillic") ;(set-face-font 'default "Courier New:Italic:10::Cyrillic") ;(set-face-font 'bold "Courier New:Regular:10::Cyrillic") ;(set-face-font 'italic "Times New Roman:Regular::10::Cyrillic") ;(set-face-font 'bold-italic "Courier:Bold Italic::10::Cyrillic") ) ((= my-font-set 2) ; ;;=== set #2 === (set-face-font 'default "Courier:Regular:12::Cyrillic")))) ; (cond ((= my-font-set 1) ; ;;=== NTEmacs ; ;;=== set #1 === ; (setq win32-enable-italics t) ; (set-default-font "-*-Courier New Cyr-normal-r-*-*-13-*-*-*-c-*-*-#204-") ; (set-face-font 'bold "-*-Courier New Cyr-bold-r-*-*-13-*-*-*-c-*-*-#204-") ; (set-face-font 'italic "-*-Courier New Cyr-normal-i-*-*-13-*-*-*-c-*-*-#204-") ; (set-face-font 'bold-italic "-*-Courier New Cyr-bold-i-*-*-13-*-*-*-c-*-*-#204-")) ; ((= my-font-set 2) ; ;;=== set #2 === ; (set-default-font "-*-Courier-normal-r-*-*-*-120-*-*-c-*-*-ansi-"))) ;;; ========== Win/Dos/Koi8 encoding support (standard-display-8bit 128 255) (setq my-wintab "Ũ" my-dostab "񦧨" my-koitab "ţ") (defun my-xemacs-set-dt (dt tab-from tab-to) (let ((i 0)) (while (< i (length tab-from)) (aset dt (char-to-int (aref tab-from i)) (char-to-string (aref tab-to i))) (setq i (1+ i))))) (defun my-xemacs-set-translation (&optional tab-from tab-to) ;; from - file, to - display/keyboard ;; display (standard-display-8bit 128 255) (if tab-from (frob-display-table (lambda (x) (my-xemacs-set-dt x tab-from tab-to)) nil)) ;; keyboard (setq key-translation-map (make-keymap)) (if tab-from (let ((i 0)) (while (< i (length tab-to)) (define-key key-translation-map (aref tab-to i) (vector (make-symbol (substring tab-from i (1+ i))))) (setq i (1+ i)))))) (defun my-ntemacs-set-translation (&optional tab-from tab-to) ;; from - file, to - display/keyboard (set-window-display-table (selected-window) nil) (setq keyboard-translate-table nil) (if tab-from (let ((disp-tab (make-display-table)) (keyb-tab (make-string 256 0)) (i 0)) (while (< i 256) (aset keyb-tab i i) (setq i (1+ i))) (setq i 0) (while (< i (length tab-from)) (aset disp-tab (aref tab-from i) (vector (aref tab-to i))) (aset keyb-tab (aref tab-to i) (aref tab-from i)) (setq i (1+ i))) (set-window-display-table (selected-window) disp-tab) (setq keyboard-translate-table keyb-tab)))) (defun my-koi () (interactive) (if my-is-xemacs (my-xemacs-set-translation my-koitab my-wintab) (my-ntemacs-set-translation my-koitab my-wintab))) (defun my-dos () (interactive) (if my-is-xemacs (my-xemacs-set-translation my-dostab my-wintab) (my-ntemacs-set-translation my-dostab my-wintab))) (defun my-win () (interactive) (if my-is-xemacs (my-xemacs-set-translation) (my-ntemacs-set-translation))) ;; . ;) ;; Not nesessary unless you set different values. (setq-default russian-buffer-name "win-cp1251") (setq-default russian-mode-name "win-cp1251") (setq russian-keyboard-name "win-cp1251") (setq russian-font-name "win-cp1251") ;; This is important. Make sure the program is on your ;; load-path (check it with C-h v load-path). (require 'russian)