1 ;; -*- mode: lisp; coding: cp1251 -*- |
1 ;; -*- mode: lisp; coding: utf-8 -*- |
2 ;; |
2 ;; |
3 ;; Written by Oleksandr Gavenko <gavenkoa@gmail.com>, 2008-2010. |
3 ;; Written by Oleksandr Gavenko <gavenkoa@gmail.com>, 2008-2010. |
4 ;; |
4 ;; |
5 ;; This file formed from parts and ideas from many sites/docs and |
5 ;; This file formed from parts and ideas from many sites/docs and |
6 ;; placed in public domain. |
6 ;; placed in public domain. |
7 ;; |
7 ;; |
8 ;; .emacs file for GNU Emacs. |
8 ;; Config file for GNU Emacs. |
9 ;; |
9 ;; |
10 ;; ~/.emacs load this file after ~/.emacs-pre, but before ~/.emacs-post. |
10 ;; For loading order see README. |
11 |
11 |
12 ;; ====================================================================== |
12 ;; ====================================================================== |
13 ;; Debugging. |
13 ;; debugging. |
14 |
14 |
15 ;; Shut off message buffer by setting nil. |
15 ;; Shut off message buffer by setting nil. |
16 (setq message-log-max 512) |
16 (setq message-log-max 512) |
17 |
17 |
18 ;; Set the debug option to enable a backtrace when a problem occurs. |
18 ;; Set the debug option to enable a backtrace when a problem occurs. |
19 (setq debug-on-error nil) ; t/nil |
19 (setq debug-on-error nil) ; t/nil |
20 |
20 |
21 ;; ====================================================================== |
21 ;; ====================================================================== |
22 ;; Настройка внешнего вида редактора. |
22 ;; appearance. |
23 ;; View. |
|
24 |
23 |
25 (menu-bar-mode -1) |
24 (menu-bar-mode -1) |
26 (tool-bar-mode -1) |
25 (tool-bar-mode -1) |
27 (tooltip-mode -1) |
26 (tooltip-mode -1) |
28 (scroll-bar-mode 1) |
27 (scroll-bar-mode 1) |
106 |
105 |
107 ;; buffer-menu better then buffer-list, but ibuffer much better. |
106 ;; buffer-menu better then buffer-list, but ibuffer much better. |
108 (global-set-key "\C-x\C-b" 'ibuffer) |
107 (global-set-key "\C-x\C-b" 'ibuffer) |
109 |
108 |
110 ;; ---------------------------------------------------------------------- |
109 ;; ---------------------------------------------------------------------- |
111 ;; Scrolling |
110 ;; scrolling. |
112 |
111 |
113 (setq-default |
112 (setq-default |
114 scroll-step 1 |
113 scroll-step 1 |
115 scroll-conservatively 100 |
114 scroll-conservatively 100 |
116 ;; при перемещении точка останавливается на расстоянии i строк к границе фрейма, |
115 ;; При перемещении точка останавливается на расстоянии i строк к границе фрейма. |
117 scroll-margin 2 |
116 scroll-margin 2 |
118 scroll-preserve-screen-position t |
117 scroll-preserve-screen-position t |
119 ) |
118 ) |
120 |
119 |
121 ;; ---------------------------------------------------------------------- |
120 ;; ---------------------------------------------------------------------- |
122 ;; search |
121 ;; searching. |
123 |
122 |
124 (setq case-fold-search t) |
123 (setq case-fold-search t) |
125 |
124 |
126 (setq query-replace-highlight t) ; highlight during query |
125 (setq query-replace-highlight t) ; highlight during query |
127 (setq search-highlight t) ; highlight incremental search |
126 (setq search-highlight t) ; highlight incremental search |
133 ;; ---------------------------------------------------------------------- |
132 ;; ---------------------------------------------------------------------- |
134 ;; *Text* |
133 ;; *Text* |
135 (setq default-major-mode 'text-mode) |
134 (setq default-major-mode 'text-mode) |
136 |
135 |
137 ;; ---------------------------------------------------------------------- |
136 ;; ---------------------------------------------------------------------- |
138 ;; syntax highlighting |
137 ;; syntax highlighting. |
|
138 |
139 (setq font-lock-maximum-decoration t) |
139 (setq font-lock-maximum-decoration t) |
140 (global-font-lock-mode 1 t) |
140 (global-font-lock-mode 1 t) |
141 |
141 |
142 ;; ---------------------------------------------------------------------- |
142 ;; ---------------------------------------------------------------------- |
143 ;; highlight selected text |
143 ;; highlight selected text. |
144 |
144 |
145 ;; 1/-1, when the mark is active, the region is highlighted. |
145 ;; 1/-1, when the mark is active, the region is highlighted. |
146 (transient-mark-mode 1) |
146 (transient-mark-mode 1) |
147 (delete-selection-mode 1) ; 1/-1 |
147 (delete-selection-mode 1) ; 1/-1 |
148 |
148 |
149 ;; Order of next item is important. |
149 ;; Order of next items is important, (assignment must done before pc-selection-mode enabled). |
150 (require 'pc-select) |
150 (require 'pc-select) |
151 ;; To avoid some key bindings as F6, etc. Must set before 'pc-selection-mode' invoke. |
151 (setq pc-select-selection-keys-only t) ; To avoid some key bindings as F6, etc. |
152 (setq pc-select-selection-keys-only t) |
152 (setq pc-select-meta-moves-sexps t) |
153 (pc-selection-mode 1) |
153 (pc-selection-mode 1) |
154 |
154 |
155 (when (eq window-system 'x) |
155 (when (eq window-system 'x) |
156 (setq x-select-enable-clipboard t) ; from Emacs 21.2.1 and newer |
156 (setq x-select-enable-clipboard t) ; for Emacs 21.2.1 and newer |
157 ) |
157 ) |
158 |
158 |
159 ;; ---------------------------------------------------------------------- |
159 ;; ---------------------------------------------------------------------- |
160 ;; line |
160 ;; highlighting current line. |
161 (if window-system |
161 |
162 (progn |
162 (when window-system |
163 (global-hl-line-mode t) |
163 (custom-set-faces '(hl-line ((t (:inherit highlight :background "light yellow"))))) |
164 (custom-set-faces '(hl-line ((t (:inherit highlight :background "light yellow"))))) |
164 (global-hl-line-mode 1) |
165 ) |
165 ) |
166 ) |
166 |
167 |
167 ;; ---------------------------------------------------------------------- |
168 ;; ---------------------------------------------------------------------- |
168 ;; paren, braces. |
169 ;; paren, brace |
|
170 |
169 |
171 (show-paren-mode 1) ; Parenthesis matching via highlighting. |
170 (show-paren-mode 1) ; Parenthesis matching via highlighting. |
172 ;; (setq show-paren-style 'expression) ; выделять все выражение в скобках |
|
173 (setq show-paren-style (quote parenthesis)) |
171 (setq show-paren-style (quote parenthesis)) |
174 |
172 |
175 ;; ====================================================================== |
173 ;; ====================================================================== |
176 ;; Keyboard, mouse. |
174 ;; keyboard, mouse. |
177 |
175 |
178 ;; cyrillic-jcuken for 567 is :,. |
176 ;; cyrillic-jcuken for 567 is :,. |
179 ;; russian-computer for 567 is %^& |
177 ;; russian-computer for 567 is %^& |
180 (setq default-input-method 'cyrillic-jcuken) |
178 (setq default-input-method 'cyrillic-jcuken) |
181 |
179 |
182 ;; (pc-bindings-mode) ; Myself define keybinding, see |
180 ;; (pc-bindings-mode) ; Myself define keybinding, see |
183 |
181 |
184 ;; ---------------------------------------------------------------------- |
182 ;; ---------------------------------------------------------------------- |
185 ;; Completition |
183 ;; completition. |
186 |
184 |
187 ;; partial-completion-mode cause bug in read-file-name with Emacs v22.3.1 (but not with v23.1). |
185 ;; partial-completion-mode cause bug in read-file-name with Emacs v22.3.1 (but not with v23.1). |
188 ;; read-file-name used in rgrep, so I disable partial-completion-mode. |
186 ;; read-file-name used in rgrep, so I disable partial-completion-mode. |
189 (partial-completion-mode -1) ; For example, M-x p-c-m expands to M-x partial-completion-mode |
187 (partial-completion-mode -1) ; For example, M-x p-c-m expands to M-x partial-completion-mode |
190 |
188 |
191 ;; ---------------------------------------------------------------------- |
189 ;; ---------------------------------------------------------------------- |
192 ;; Mouse |
190 ;; mouse. |
193 |
191 |
194 ;; Scroll Bar gets dragged by mouse butn 1 |
192 ;; Scroll Bar gets dragged by mouse butn 1 |
195 (global-set-key [vertical-scroll-bar down-mouse-1] 'scroll-bar-drag) |
193 (global-set-key [vertical-scroll-bar down-mouse-1] 'scroll-bar-drag) |
196 ;; Paste at point NOT at cursor |
194 ;; Paste at point NOT at cursor |
197 (setq mouse-yank-at-point t) |
195 (setq mouse-yank-at-point t) |
198 (mouse-wheel-mode 1) |
196 (mouse-wheel-mode 1) |
199 |
197 |
200 ;; ---------------------------------------------------------------------- |
198 ;; ---------------------------------------------------------------------- |
201 ;; Key Binding (Short-keys). |
199 ;; key binding, short-keys. |
202 |
200 |
203 (global-set-key [home] 'beginning-of-line) |
201 (global-set-key [home] 'beginning-of-line) |
204 (global-set-key [end] 'end-of-line) |
202 (global-set-key [end] 'end-of-line) |
205 (global-set-key [C-home] 'beginning-of-buffer) |
203 (global-set-key [C-home] 'beginning-of-buffer) |
206 (global-set-key [C-end] 'end-of-buffer) |
204 (global-set-key [C-end] 'end-of-buffer) |
315 |
313 |
316 ;; ====================================================================== |
314 ;; ====================================================================== |
317 ;; STANDARD LIBRARIES |
315 ;; STANDARD LIBRARIES |
318 |
316 |
319 ;; ---------------------------------------------------------------------- |
317 ;; ---------------------------------------------------------------------- |
320 ;; dired |
318 ;; dired. |
321 |
319 |
322 (setq dired-dwim-target t) |
320 (setq dired-dwim-target t) |
323 ;; dangerous |
321 ;; dangerous |
324 ;; (setq |
322 ;; (setq |
325 ;; dired-recursive-copies 'top |
323 ;; dired-recursive-copies 'top |
326 ;; dired-recursive-deletes 'top) |
324 ;; dired-recursive-deletes 'top) |
327 |
325 |
328 ;; ---------------------------------------------------------------------- |
326 ;; ---------------------------------------------------------------------- |
329 ;; compression, archive |
327 ;; compression, archive. |
330 |
328 |
331 (require 'jka-compr) ; Automatic decompression, hooks for tar-mode. |
329 (require 'jka-compr) ; Automatic decompression, hooks for tar-mode. |
332 (if (fboundp 'auto-compression-mode) |
330 (if (fboundp 'auto-compression-mode) |
333 (auto-compression-mode 1)) |
331 (auto-compression-mode 1)) |
334 |
332 |
335 ;; ---------------------------------------------------------------------- |
333 (modify-coding-system-alist 'file "\\.\\(war\\|ear\\|sar\\|egg\\)\\'" 'no-conversion) |
336 ;; image |
334 |
|
335 (add-to-list 'auto-mode-alist '("\\.\\(war\\|ear\\|sar\\|egg\\)\\'" . archive-mode)) |
|
336 |
|
337 ;; ---------------------------------------------------------------------- |
|
338 ;; image. |
337 |
339 |
338 (when (fboundp 'auto-image-file-mode) |
340 (when (fboundp 'auto-image-file-mode) |
339 (auto-image-file-mode 1)) |
341 (auto-image-file-mode 1)) |
340 |
342 |
341 ;; ---------------------------------------------------------------------- |
343 ;; ---------------------------------------------------------------------- |
348 (recentf-mode t) |
350 (recentf-mode t) |
349 (setq recentf-max-saved-items 200) |
351 (setq recentf-max-saved-items 200) |
350 (global-set-key (kbd "\e\eq") 'recentf-open-files) |
352 (global-set-key (kbd "\e\eq") 'recentf-open-files) |
351 |
353 |
352 ;; ---------------------------------------------------------------------- |
354 ;; ---------------------------------------------------------------------- |
353 ;; revert |
355 ;; revert buffer. |
|
356 |
354 (global-set-key [f5] 'revert-buffer) |
357 (global-set-key [f5] 'revert-buffer) |
355 (setq revert-without-query (quote (".*"))) |
358 (setq revert-without-query (quote (".*"))) |
356 (setq auto-revert-interval 2) |
359 (setq auto-revert-interval 2) |
357 |
360 |
358 ;; ====================================================================== |
361 ;; ====================================================================== |
359 ;; Convenient |
362 ;; convenient. |
360 |
363 |
361 (defun reglen() |
364 (defun reglen() |
362 "Show region length." |
365 "Show region length." |
363 (interactive) |
366 (interactive) |
364 (message "%s" (- (region-end) (region-beginning)))) |
367 (message "%s" (- (region-end) (region-beginning)))) |
365 |
368 |
366 ;; ---------------------------------------------------------------------- |
369 ;; ---------------------------------------------------------------------- |
367 ;; minibuffer |
370 ;; minibuffer. |
368 |
371 |
369 (require 'icomplete) ; Interactive completion in minibuffer. |
372 (require 'icomplete) ; Interactive completion in minibuffer. |
370 (icomplete-mode 1) |
373 (icomplete-mode 1) |
371 |
374 |
372 (mapc (lambda (ext) (add-to-list 'completion-ignored-extensions ext)) |
375 (mapc (lambda (ext) (add-to-list 'completion-ignored-extensions ext)) |
383 grep-find-command "find . '(' -name .svn -o -name CVS -o -name .hg -o -name _darcs -o -name .git ')' -prune -o -type f -name '*' -print0 | xargs -0 -e grep -nH " |
386 grep-find-command "find . '(' -name .svn -o -name CVS -o -name .hg -o -name _darcs -o -name .git ')' -prune -o -type f -name '*' -print0 | xargs -0 -e grep -nH " |
384 grep-highlight-matches nil ; do not set t because some grep do not has --color options |
387 grep-highlight-matches nil ; do not set t because some grep do not has --color options |
385 grep-use-null-device t) |
388 grep-use-null-device t) |
386 |
389 |
387 ;; ---------------------------------------------------------------------- |
390 ;; ---------------------------------------------------------------------- |
388 ;; Music |
391 ;; music. |
389 (setq gnus-audio-au-player "winamp.exe" |
392 (setq gnus-audio-au-player "winamp.exe" |
390 gnus-audio-directory "D:\\music" |
393 gnus-audio-directory "D:\\music" |
391 gnus-audio-wav-player "winamp.exe") |
394 gnus-audio-wav-player "winamp.exe") |
392 |
395 |
393 ;; ---------------------------------------------------------------------- |
396 ;; ---------------------------------------------------------------------- |
394 ;; archive |
397 ;; browser. |
395 |
|
396 (modify-coding-system-alist 'file "\\.\\(war\\|ear\\|sar\\|egg\\)\\'" 'no-conversion) |
|
397 |
|
398 (add-to-list 'auto-mode-alist '("\\.\\(war\\|ear\\|sar\\|egg\\)\\'" . archive-mode)) |
|
399 |
|
400 ;; ---------------------------------------------------------------------- |
|
401 ;; browser |
|
402 |
398 |
403 (cond |
399 (cond |
404 ((equal window-system 'w32) |
400 ((equal window-system 'w32) |
405 (setq browse-url-browser-function 'browse-url-default-windows-browser)) |
401 (setq browse-url-browser-function 'browse-url-default-windows-browser)) |
406 (t |
402 (t |
407 (setq browse-url-browser-function 'browse-url-mozilla))) |
403 (setq browse-url-browser-function 'browse-url-mozilla))) |
408 |
404 |
409 ;; ====================================================================== |
405 ;; ---------------------------------------------------------------------- |
410 ;; TIME SETTING |
406 ;; time. |
411 |
|
412 ;; ---------------------------------------------------------------------- |
|
413 ;; Time |
|
414 |
407 |
415 ;; Also useful such format: |
408 ;; Also useful such format: |
416 ;; (setq display-time-format " %H:%M %d-%m-%y ") |
409 ;; (setq display-time-format " %H:%M %d-%m-%y ") |
417 (setq display-time-24hr-format t) |
410 (setq display-time-24hr-format t) |
418 (setq display-time-default-load-average nil) |
411 (setq display-time-default-load-average nil) |
419 (display-time) ; display-time-mode |
412 (display-time) ; display-time-mode |
420 |
413 |
421 ;; ---------------------------------------------------------------------- |
414 ;; ---------------------------------------------------------------------- |
422 ;; Calendar |
415 ;; calendar. |
|
416 |
423 ;; (setq mark-holidays-in-calendar t) |
417 ;; (setq mark-holidays-in-calendar t) |
424 ;; (setq all-christian-calendar-holidays t) |
418 ;; (setq all-christian-calendar-holidays t) |
425 ;; (setq calendar-date-display-form (quote ((format "%04s-%02d-%02d" year (string-to-int month) (string-to-int day))))) |
419 ;; (setq calendar-date-display-form (quote ((format "%04s-%02d-%02d" year (string-to-int month) (string-to-int day))))) |
426 ;; (setq calendar-time-display-form (quote (24-hours ":" minutes (if time-zone " (") time-zone (if time-zone ")")))) |
420 ;; (setq calendar-time-display-form (quote (24-hours ":" minutes (if time-zone " (") time-zone (if time-zone ")")))) |
427 (setq calendar-week-start-day 1) |
421 (setq calendar-week-start-day 1) |
465 (put 'narrow-to-page 'disabled nil) |
459 (put 'narrow-to-page 'disabled nil) |
466 (put 'narrow-to-region 'disabled nil) |
460 (put 'narrow-to-region 'disabled nil) |
467 (put 'scroll-left 'disabled nil) |
461 (put 'scroll-left 'disabled nil) |
468 |
462 |
469 ;; ====================================================================== |
463 ;; ====================================================================== |
470 ;; TEX |
464 ;; TEX. |
|
465 |
471 (setq tex-run-command "initex") |
466 (setq tex-run-command "initex") |
472 |
467 |
473 |
468 ;; ====================================================================== |
474 ;; ====================================================================== |
469 ;; AUC TeX. |
475 ;; AUC TeX |
|
476 |
470 |
477 ;(add-hook 'LaTeX-mode-hook 'LaTeX-install-toolbar) |
471 ;(add-hook 'LaTeX-mode-hook 'LaTeX-install-toolbar) |
478 ;; (setq TeX-parse-self t) ; Enable parse on load. |
472 ;; (setq TeX-parse-self t) ; Enable parse on load. |
479 ;; (setq TeX-auto-save t) ; Enable parse on save. |
473 ;; (setq TeX-auto-save t) ; Enable parse on save. |
480 ;; (setq-default TeX-master nil) ; Query for master file. Finally, if you often use \include or \input, you should make AUCTEX aware of the multi-file document structure |
474 ;; (setq-default TeX-master nil) ; Query for master file. Finally, if you often use \include or \input, you should make AUCTEX aware of the multi-file document structure |
481 |
475 |
482 ;(setq TeX-PDF-mode t) |
476 ;(setq TeX-PDF-mode t) |
483 ;(setq TeX-interactive-mode t) |
477 ;(setq TeX-interactive-mode t) |
484 ;(setq TeX-source-specials-mode 1) |
478 ;(setq TeX-source-specials-mode 1) |
485 |
479 |
486 ;;модифицируем меню |
|
487 ;;; some more menu entries in the command list: |
480 ;;; some more menu entries in the command list: |
488 ;;; see tex-mik.el from package auctex: %v is defined in tex-mik.el |
481 ;;; see tex-mik.el from package auctex: %v is defined in tex-mik.el |
489 ;;; other variables are defined in tex.el from auctex |
482 ;;; other variables are defined in tex.el from auctex |
490 ;;; the meaning of some auctex-varibles: |
483 ;;; the meaning of some auctex-varibles: |
491 ;symbols defined in tex.el and tex-mik.el: |
484 ;symbols defined in tex.el and tex-mik.el: |
505 ; (add-to-list 'TeX-command-list |
498 ; (add-to-list 'TeX-command-list |
506 ; (list "All Texify run-viewer" |
499 ; (list "All Texify run-viewer" |
507 ; "texify --tex-opt=--src --run-viewer --clean %s.tex" |
500 ; "texify --tex-opt=--src --run-viewer --clean %s.tex" |
508 ; 'TeX-run-command nil t)))) |
501 ; 'TeX-run-command nil t)))) |
509 |
502 |
510 |
503 ;; ====================================================================== |
511 ;; ====================================================================== |
504 ;; Reftex activation (Reftex is included with Emacs 21.1). |
512 ;; |
|
513 ;; Reftex activation (Reftex is included with Emacs 21.1) |
|
514 |
505 |
515 ;; (autoload 'reftex-mode "reftex" "RefTeX Minor Mode" t) |
506 ;; (autoload 'reftex-mode "reftex" "RefTeX Minor Mode" t) |
516 ;; (autoload 'turn-on-reftex "reftex" "RefTeX Minor Mode" nil) |
507 ;; (autoload 'turn-on-reftex "reftex" "RefTeX Minor Mode" nil) |
517 ;; (autoload 'reftex-citation "reftex-cite" "Make citation" nil) |
508 ;; (autoload 'reftex-citation "reftex-cite" "Make citation" nil) |
518 ;; (autoload 'reftex-index-phrase-mode "reftex-index" "Phrase mode" t) |
509 ;; (autoload 'reftex-index-phrase-mode "reftex-index" "Phrase mode" t) |
519 ;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode |
510 ;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode |
520 ;; (add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode |
511 ;; (add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode |
521 |
512 |
522 ;; ====================================================================== |
513 ;; ====================================================================== |
523 ;; |
514 ;; PreviewLatex. |
524 ;;Настройки PreviewLatex |
|
525 |
515 |
526 ;(load "preview-latex.el" nil t t) |
516 ;(load "preview-latex.el" nil t t) |
527 |
517 |
528 ;(add-hook 'LaTeX-mode-hook #'LaTeX-preview-setup) |
518 ;(add-hook 'LaTeX-mode-hook #'LaTeX-preview-setup) |
529 ;(autoload 'LaTeX-preview-setup "preview") |
519 ;(autoload 'LaTeX-preview-setup "preview") |
530 |
520 |
531 |
521 ;; ====================================================================== |
532 ;; ====================================================================== |
522 ;; Info. |
533 ;; |
523 |
534 ;; Info |
524 ;; ====================================================================== |
535 |
525 ;; man, woman. |
536 (require 'info) |
526 |
537 (if (equal window-system 'w32) |
|
538 (progn |
|
539 ;; TODO Write which func to find runemacs.exe dir. |
|
540 ;; (setq Info-directory-list (list (expand-file-name "~/../bin/emacs/info"))) |
|
541 ;; (add-to-list 'Info-directory-list (expand-file-name "~/../bin/MinGW/info") t) ; t - append to the end |
|
542 )) |
|
543 |
|
544 ;; ====================================================================== |
|
545 ;; man, woman |
|
546 (require 'woman) |
|
547 (setq woman-use-own-frame nil) |
527 (setq woman-use-own-frame nil) |
548 (setq woman-fill-frame t) |
528 (setq woman-fill-frame t) |
549 |
529 |
550 ;; ====================================================================== |
530 ;; ====================================================================== |
551 ;; shell, sh, bash |
531 ;; shell, sh, bash. |
552 |
532 |
553 ;; Setup Emacs to run bash as its primary shell. |
533 ;; Setup Emacs to run bash as its primary shell. |
554 ;; (setq binary-process-input t) |
534 ;; (setq binary-process-input t) |
555 ;; (setq shell-file-name "bash") |
535 ;; (setq shell-file-name "bash") |
556 ;; (setq shell-command-switch "-c") |
536 ;; (setq shell-command-switch "-c") |
590 |
570 |
591 ;; ====================================================================== |
571 ;; ====================================================================== |
592 ;; GTD, PIM, organize, todo mode. |
572 ;; GTD, PIM, organize, todo mode. |
593 |
573 |
594 ;; ---------------------------------------------------------------------- |
574 ;; ---------------------------------------------------------------------- |
595 ;; org-mode |
575 ;; org-mode. |
596 |
576 |
597 (if (>= emacs-major-version 22) |
577 (if (>= emacs-major-version 22) |
598 (progn |
578 (progn |
599 (require 'org) |
579 (require 'org) |
600 )) |
580 )) |
601 |
581 |
602 ;; XXX org-todo-keywords '((sequence "TODO" "START" "|" "DONE")) для org-version 4.67c |
582 ;; XXX org-todo-keywords '((sequence "TODO" "START" "|" "DONE")) for org-version 4.67c |
603 ;; XXX (setq org-todo-keywords '("TODO" "START" "DONE")) для org-version 6.05b |
583 ;; XXX (setq org-todo-keywords '("TODO" "START" "DONE")) for org-version 6.05b |
604 (if (or (featurep 'org) (featurep 'org-install)) |
584 (if (or (featurep 'org) (featurep 'org-install)) |
605 (progn |
585 (progn |
606 (add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) |
586 (add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) |
607 (setq org-directory (expand-file-name "~/.gtd")) |
587 (setq org-directory (expand-file-name "~/.gtd")) |
608 (setq org-default-notes-file (expand-file-name "~/.gtd/notes")) |
588 (setq org-default-notes-file (expand-file-name "~/.gtd/notes")) |
719 (when (featurep 'fsm) |
701 (when (featurep 'fsm) |
720 (setq fsm-debug nil) ; Disable *fsm-debug* buffer. |
702 (setq fsm-debug nil) ; Disable *fsm-debug* buffer. |
721 ) |
703 ) |
722 |
704 |
723 ;; ---------------------------------------------------------------------- |
705 ;; ---------------------------------------------------------------------- |
724 ;; rcirc |
706 ;; rcirc. |
725 |
707 |
726 ;; Turn on logging everything to a special buffer, for debugging. |
708 ;; Turn on logging everything to a special buffer, for debugging. |
727 ;; (setq rcirc-debug-flag t) |
709 ;; (setq rcirc-debug-flag t) |
728 |
710 |
729 (add-hook 'rcirc-mode-hook (lambda () (rcirc-track-minor-mode 1))) |
711 (add-hook 'rcirc-mode-hook (lambda () (rcirc-track-minor-mode 1))) |
730 (setq rcirc-time-format "%H:%M ") |
712 (setq rcirc-time-format "%H:%M ") |
731 (defun rcirc-handler-301 (process cmd sender args) |
713 (defun rcirc-handler-301 (process cmd sender args) |
732 "/away message handler.") |
714 "/away message handler.") |
733 |
715 |
734 ;; ---------------------------------------------------------------------- |
716 ;; ---------------------------------------------------------------------- |
735 ;; erc |
717 ;; erc. |
736 |
718 |
737 (setq erc-server-coding-system 'utf-8) |
719 (setq erc-server-coding-system 'utf-8) |
738 |
720 |
739 ;; ====================================================================== |
721 ;; ====================================================================== |
740 ;; VCS, version control, cvs, svn. |
722 ;; VCS, version control, cvs, svn. |
776 ) |
758 ) |
777 ) |
759 ) |
778 ) |
760 ) |
779 |
761 |
780 ;; ---------------------------------------------------------------------- |
762 ;; ---------------------------------------------------------------------- |
781 ;; psvn |
763 ;; psvn. |
|
764 |
782 (setq svn-status-verbose t) |
765 (setq svn-status-verbose t) |
783 (setq svn-status-hide-unmodified t) |
766 (setq svn-status-hide-unmodified t) |
784 |
767 |
785 ;; ---------------------------------------------------------------------- |
768 ;; ---------------------------------------------------------------------- |
786 ;; DVC |
769 ;; DVC. |
787 |
770 |
788 (when (featurep 'dvc-emacs) |
771 (when (featurep 'dvc-emacs) |
789 (setq dvc-tips-enabled nil) |
772 (setq dvc-tips-enabled nil) |
790 ) |
773 ) |
791 |
774 |
792 ;; ====================================================================== |
775 ;; ====================================================================== |
793 ;; devel, prog, programming |
776 ;; devel, prog, programming. |
794 |
777 |
795 (add-to-list 'auto-mode-alist '("\\.cu$" . c-mode)) |
778 (add-to-list 'auto-mode-alist '("\\.cu$" . c-mode)) |
796 |
779 |
797 (setq-default comment-style (quote indent)) |
780 (setq-default comment-style (quote indent)) |
798 (setq-default comment-column 44) |
781 (setq-default comment-column 44) |
828 (while (>= i 0) |
812 (while (>= i 0) |
829 (setq tab-stop-list (cons i tab-stop-list)) |
813 (setq tab-stop-list (cons i tab-stop-list)) |
830 (setq i (- i 4)))) |
814 (setq i (- i 4)))) |
831 |
815 |
832 ;; ---------------------------------------------------------------------- |
816 ;; ---------------------------------------------------------------------- |
833 ;; Diff. |
817 ;; diff. |
|
818 |
834 (setq ediff-diff-options "") |
819 (setq ediff-diff-options "") |
835 |
820 |
836 ;; ---------------------------------------------------------------------- |
821 ;; ---------------------------------------------------------------------- |
837 ;; *Compile* |
822 ;; *Compile* |
|
823 |
838 (setq compile-auto-highlight t |
824 (setq compile-auto-highlight t |
839 compile-command "make ") |
825 compile-command "make ") |
840 ;; compilation window shall scroll down if not 0 |
826 ;; compilation window shall scroll down if not 0 |
841 (setq compilation-scroll-output 1) |
827 (setq compilation-scroll-output 1) |
842 |
828 |
843 ;; My funny error messages. |
829 ;; My funny error messages. |
844 ;; XXX нужно реализовать через hook. |
830 ;; XXX нужно реализовать через hook. |
845 (require 'compile) |
831 (require 'compile) |
846 (add-to-list 'compilation-error-regexp-alist '("^\\( +\\[csc\\] \\|\\)\\(.*\\)(\\([0-9]*\\),\\([0-9]*\\)):" 2 3 4)) |
832 (add-to-list 'compilation-error-regexp-alist '("^\\( +\\[csc\\] \\|\\)\\(.*\\)(\\([0-9]*\\),\\([0-9]*\\)):" 2 3 4)) |
847 (add-to-list 'compilation-error-regexp-alist '("^ *\\(.*\\)(\\([0-9]*\\)) +:" 1 2)) |
833 (add-to-list 'compilation-error-regexp-alist '("^ *\\(.*\\)(\\([0-9]*\\)) +:" 1 2)) |
848 (add-to-list 'compilation-error-regexp-alist '("^\"?\\([^\"]*\\)\"?,\\([0-9]*\\) .*\\[.*\\]: " 1 2)) ; KEIL compiler |
834 (add-to-list 'compilation-error-regexp-alist '("^\"?\\([^\"]*\\)\"?,\\([0-9]*\\) .*\\[.*\\]: " 1 2)) ; KEIL compiler |
849 ;; (add-to-list 'compilation-mode-font-lock-keywords '("\\(/[Oo][Uu][Tt]:[^ ]+\\)" . 1)) |
835 ;; (add-to-list 'compilation-mode-font-lock-keywords '("\\(/[Oo][Uu][Tt]:[^ ]+\\)" . 1)) |
850 ;; (add-to-list 'compilation-mode-font-lock-keywords '("[ ]\\(/F[oe][^ ]+\\)" . 1)) |
836 ;; (add-to-list 'compilation-mode-font-lock-keywords '("[ ]\\(/F[oe][^ ]+\\)" . 1)) |
851 |
837 |
852 ;; ---------------------------------------------------------------------- |
838 ;; ---------------------------------------------------------------------- |
853 ;; windows inf files for installing drivers |
839 ;; windows inf files for driver installing |
|
840 |
854 (add-to-list 'auto-mode-alist '("\\.inf\\'" . conf-mode)) |
841 (add-to-list 'auto-mode-alist '("\\.inf\\'" . conf-mode)) |
855 |
842 |
856 ;; ---------------------------------------------------------------------- |
843 ;; ---------------------------------------------------------------------- |
857 ;; makefile, make |
844 ;; makefile, make. |
858 |
845 |
859 (add-to-list 'auto-mode-alist '("\\(Makefile\\|Makefile\\..+\\)\\'" . makefile-gmake-mode)) |
846 (add-to-list 'auto-mode-alist '("\\(Makefile\\|Makefile\\..+\\)\\'" . makefile-gmake-mode)) |
860 |
847 |
861 ;; ---------------------------------------------------------------------- |
848 ;; ---------------------------------------------------------------------- |
862 ;; asm |
849 ;; asm, assembler. |
|
850 |
863 ;; (setq-default asm-comment-char 59) |
851 ;; (setq-default asm-comment-char 59) |
864 (add-hook 'asm-mode-hook '(lambda () (setq comment-start "/*") (setq comment-end "*/")) t) |
852 (add-hook 'asm-mode-hook '(lambda () (setq comment-start "/*") (setq comment-end "*/")) t) |
865 |
853 |
866 (add-to-list 'auto-mode-alist '("\\.\\([sS]79\\|[sS]\\)\\'" . asm-mode)) |
854 (add-to-list 'auto-mode-alist '("\\.\\([sS]79\\|[sS]\\)\\'" . asm-mode)) |
867 |
855 |
868 ;; (add-hook 'asm-mode-hook '(lambda () (local-unset-key ":"))) |
856 ;; (add-hook 'asm-mode-hook '(lambda () (local-unset-key ":"))) |
869 ;; (add-hook 'asm-mode-hook '(lambda () (local-set-key ":" ":"))) |
857 ;; (add-hook 'asm-mode-hook '(lambda () (local-set-key ":" ":"))) |
870 |
858 |
871 ;; ---------------------------------------------------------------------- |
859 ;; ---------------------------------------------------------------------- |
872 ;; linker |
860 ;; linker. |
873 |
861 |
874 (when (fboundp 'iar-linker-config-mode) |
862 (when (fboundp 'iar-linker-config-mode) |
875 (add-to-list 'auto-mode-alist '("\\.icf\\'" . iar-linker-config-mode)) |
863 (add-to-list 'auto-mode-alist '("\\.icf\\'" . iar-linker-config-mode)) |
876 ) |
864 ) |
877 (when (fboundp 'iar4-linker-config-mode) |
865 (when (fboundp 'iar4-linker-config-mode) |
878 (add-to-list 'auto-mode-alist '("\\.xcl\\'" . iar4-linker-config-mode)) |
866 (add-to-list 'auto-mode-alist '("\\.xcl\\'" . iar4-linker-config-mode)) |
879 ) |
867 ) |
880 |
868 |
881 ;; ---------------------------------------------------------------------- |
869 ;; ---------------------------------------------------------------------- |
882 ;; lisp |
870 ;; lisp. |
|
871 |
883 (setq list-command-history-max 256) |
872 (setq list-command-history-max 256) |
884 |
873 |
885 ;; ---------------------------------------------------------------------- |
874 ;; ---------------------------------------------------------------------- |
886 ;; C, c-mode, C++, c++-mode |
875 ;; C, c-mode, C++, c++-mode. |
887 |
876 |
888 (setq c-echo-syntactic-information-p t) |
877 (setq c-echo-syntactic-information-p t) |
889 (add-hook 'c-mode-common-hook |
878 (add-hook 'c-mode-common-hook |
890 (lambda () |
879 (lambda () |
891 ;; Automatically inserte newlines after special characters such as brace, comma, semi-colon, and colon. |
880 ;; Automatically inserte newlines after special characters such as brace, comma, semi-colon, and colon. |
939 (add-hook 'c-mode-common-hook |
928 (add-hook 'c-mode-common-hook |
940 (lambda () (c-add-style "my" my-c-style t))) |
929 (lambda () (c-add-style "my" my-c-style t))) |
941 (setq c-default-style '((java-mode . "my") (c-mode . "my") (csharp-mode . "my") (c++-mode . "my") (objc-mode . "my") (other . "my"))) |
930 (setq c-default-style '((java-mode . "my") (c-mode . "my") (csharp-mode . "my") (c++-mode . "my") (objc-mode . "my") (other . "my"))) |
942 |
931 |
943 ;; ---------------------------------------------------------------------- |
932 ;; ---------------------------------------------------------------------- |
944 ;; bat file, batch |
933 ;; bat file, batch. |
945 |
934 |
946 (when (fboundp 'bat-file-mode) |
935 (when (fboundp 'bat-file-mode) |
947 (add-to-list 'auto-mode-alist '("\\.[bB][aA][tT]\\'" . bat-file-mode)) |
936 (add-to-list 'auto-mode-alist '("\\.[bB][aA][tT]\\'" . bat-file-mode)) |
948 (add-to-list 'auto-mode-alist '("\\.[cC][mM][dD]\\'" . bat-file-mode)) |
937 (add-to-list 'auto-mode-alist '("\\.[cC][mM][dD]\\'" . bat-file-mode)) |
949 ) |
938 ) |
950 |
939 |
951 ;; ---------------------------------------------------------------------- |
940 ;; ---------------------------------------------------------------------- |
952 ;; nsis-mode |
941 ;; nsis-mode. |
953 |
942 |
954 (when (fboundp 'nsis-mode) |
943 (when (fboundp 'nsis-mode) |
955 (add-to-list 'auto-mode-alist '("\\.\\(nsi\\|nsh\\)\\'" . nsis-mode)) |
944 (add-to-list 'auto-mode-alist '("\\.\\(nsi\\|nsh\\)\\'" . nsis-mode)) |
956 ) |
945 ) |
957 |
946 |
958 ;; ---------------------------------------------------------------------- |
947 ;; ---------------------------------------------------------------------- |
959 ;; *csharp*, c-sharp |
948 ;; *csharp*, c-sharp. |
960 |
949 |
961 (autoload 'csharp-mode "csharp-mode" "Major mode for editing C# code." t) |
950 (autoload 'csharp-mode "csharp-mode" "Major mode for editing C# code." t) |
962 (add-to-list 'auto-mode-alist '("\\.cs$" . csharp-mode)) |
951 (add-to-list 'auto-mode-alist '("\\.cs$" . csharp-mode)) |
963 |
952 |
964 ;; ---------------------------------------------------------------------- |
953 ;; ---------------------------------------------------------------------- |
965 ;; *Java* |
954 ;; java. |
|
955 |
966 ;; Update the Emacs load-path to include the path to |
956 ;; Update the Emacs load-path to include the path to |
967 ;; the JDE and its require packages. This code assumes |
957 ;; the JDE and its require packages. This code assumes |
968 ;; that you have installed the packages in the emacs/site |
958 ;; that you have installed the packages in the emacs/site |
969 ;; subdirectory of your home directory. |
959 ;; subdirectory of your home directory. |
970 ;; (add-to-list 'load-path (expand-file-name "~/emacs/site/semantic")) |
960 ;; (add-to-list 'load-path (expand-file-name "~/emacs/site/semantic")) |
1000 |
990 |
1001 ;; (add-hook 'jde-mode-hook 'my-jde-mode-hook) |
991 ;; (add-hook 'jde-mode-hook 'my-jde-mode-hook) |
1002 |
992 |
1003 ;; (require 'jde) |
993 ;; (require 'jde) |
1004 |
994 |
1005 ;; ******************** |
995 ;; ---------------------------------------------------------------------- |
1006 ;; ECB |
996 ;; ECB. |
1007 ;; ******************* |
|
1008 |
997 |
1009 (setq ecb-tip-of-the-day nil) |
998 (setq ecb-tip-of-the-day nil) |
1010 ;; (add-to-list 'load-path "~/emacs/site/ecb-2.32") |
999 ;; (add-to-list 'load-path "~/emacs/site/ecb-2.32") |
1011 ;; (require 'ecb) |
1000 ;; (require 'ecb) |
1012 |
1001 |
1013 ;; (global-set-key (kbd "\e\eE") 'ecb-activate) |
1002 ;; (global-set-key (kbd "\e\eE") 'ecb-activate) |
1014 |
1003 |
1015 ;; ---------------------------------------------------------------------- |
1004 ;; ---------------------------------------------------------------------- |
1016 ;; html |
1005 ;; html. |
1017 |
1006 |
1018 ;; ---------------------------------------------------------------------- |
1007 ;; ---------------------------------------------------------------------- |
1019 ;; xml |
1008 ;; xml. |
1020 |
1009 |
1021 ;; ---------------------------------------------------------------------- |
1010 ;; ---------------------------------------------------------------------- |
1022 ;; psgml |
1011 ;; psgml. |
|
1012 |
1023 (setq sgml-set-face t) ; for highlighting in sgml |
1013 (setq sgml-set-face t) ; for highlighting in sgml |
1024 |
1014 |
1025 ;; ====================================================================== |
1015 ;; ====================================================================== |
1026 ;; Printing |
1016 ;; printing. |
1027 |
1017 |
1028 ;; Use Notepad to print plain text files to the default Windows printer |
1018 ;; Use Notepad to print plain text files to the default Windows printer |
1029 ;(setq lpr-command "notepad") |
1019 ;(setq lpr-command "notepad") |
1030 ;(setq lpr-headers-switches '("/p")) ; \ mis-use these |
1020 ;(setq lpr-headers-switches '("/p")) ; \ mis-use these |
1031 ;(setq lpr-switches nil) ; / two variables |
1021 ;(setq lpr-switches nil) ; / two variables |
1032 ;(setq printer-name nil) ; notepad takes the default |
1022 ;(setq printer-name nil) ; notepad takes the default |
1033 ;(setq lpr-printer-switch "/P") ;; run notepad as batch printer |
1023 ;(setq lpr-printer-switch "/P") ;; run notepad as batch printer |
1034 ;; |
1024 ;; |
1035 ;;Печать в файл |
1025 |
|
1026 ;; ---------------------------------------------------------------------- |
|
1027 ;; printing to file. |
|
1028 |
1036 ;(setq printer-name "~/myprint.txt") |
1029 ;(setq printer-name "~/myprint.txt") |
1037 ;(setq ps-printer-name nil) |
1030 ;(setq ps-printer-name nil) |
1038 ;(setq ps-print-header nil) |
1031 ;(setq ps-print-header nil) |
1039 ;;модифицируем меню |
|
1040 ;;; some more menu entries in the command list: |
1032 ;;; some more menu entries in the command list: |
1041 ;;; see tex-mik.el from package auctex: %v is defined in tex-mik.el |
1033 ;;; see tex-mik.el from package auctex: %v is defined in tex-mik.el |
1042 ;;; other variables are defined in tex.el from auctex |
1034 ;;; other variables are defined in tex.el from auctex |
1043 ;;; the meaning of some auctex-varibles: |
1035 ;;; the meaning of some auctex-varibles: |
1044 ;symbols defined in tex.el and tex-mik.el: |
1036 ;symbols defined in tex.el and tex-mik.el: |
1059 ; (list "All Texify run-viewer" |
1051 ; (list "All Texify run-viewer" |
1060 ; "texify --tex-opt=--src --run-viewer --clean %s.tex" |
1052 ; "texify --tex-opt=--src --run-viewer --clean %s.tex" |
1061 ; 'TeX-run-command nil t)))) |
1053 ; 'TeX-run-command nil t)))) |
1062 |
1054 |
1063 ;; ---------------------------------------------------------------- |
1055 ;; ---------------------------------------------------------------- |
1064 ;; SQL |
1056 ;; SQL. |
1065 |
1057 |
1066 (setq sql-password "") |
1058 (setq sql-password "") |
1067 |
1059 |
1068 ;; ====================================================================== |
1060 ;; ====================================================================== |
1069 ;; Backup |
1061 ;; backuping. |
1070 |
1062 |
1071 (setq |
1063 (setq |
1072 backup-by-copying t ; don't clobber symlinks |
1064 backup-by-copying t ; don't clobber symlinks |
1073 backup-directory-alist '(("." . "~/.backup")) ; don't litter my fs tree |
1065 backup-directory-alist '(("." . "~/.backup")) ; don't litter my fs tree |
1074 delete-old-versions t ; delete excess backup versions silently |
1066 delete-old-versions t ; delete excess backup versions silently |
1075 kept-old-versions 1 ; store first original version |
1067 kept-old-versions 1 ; store first original version |
1076 kept-new-versions 3 ; store last 3 version |
1068 kept-new-versions 3 ; store last 3 version |
1077 version-control t) ; use versioned backups |
1069 version-control t) ; use versioned backups |
1078 |
1070 |
1079 ;; ====================================================================== |
1071 ;; ====================================================================== |
1080 ;; auto save |
1072 ;; auto save. |
1081 |
1073 |
1082 (setq auto-save-default t) |
1074 (setq auto-save-default t) |
1083 ;; If nil autosave to different than original to buffer file. |
1075 ;; If nil autosave to different than original to buffer file. |
1084 (setq auto-save-visited-file-name nil) |
1076 (setq auto-save-visited-file-name nil) |
1085 ;; Note: if you kill unsaved file auto save file not deleted. |
1077 ;; Note: if you kill unsaved file auto save file not deleted. |
1086 (setq delete-auto-save-files t) |
1078 (setq delete-auto-save-files t) |
1087 |
1079 |
1088 ;; ====================================================================== |
1080 ;; ====================================================================== |
1089 ;; Setup user info. |
1081 ;; user info. |
1090 |
1082 |
1091 (cd "~/") |
1083 (cd "~/") |
1092 (setq user-full-name "Oleksandr Gavenko") |
1084 (setq user-full-name "Oleksandr Gavenko") |
1093 (setq user-mail-address "gavenkoa@gmail.com") |
1085 (setq user-mail-address "gavenkoa@gmail.com") |
1094 (setenv "ORGANIZATION" (concat user-full-name " <" user-mail-address ">")) |
1086 (setenv "ORGANIZATION" (concat user-full-name " <" user-mail-address ">")) |