.emacs-my
changeset 296 e502c69ab80a
parent 295 5be44cff4683
child 297 d5e742141a44
equal deleted inserted replaced
295:5be44cff4683 296:e502c69ab80a
     8 ;; .emacs file for GNU Emacs.
     8 ;; .emacs file for GNU Emacs.
     9 ;;
     9 ;;
    10 ;; ~/.emacs load this file after ~/.emacs-pre, but before ~/.emacs-post.
    10 ;; ~/.emacs load this file after ~/.emacs-pre, but before ~/.emacs-post.
    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 ;; Appearance.
    22 ;; appearance.
    23 
    23 
    24 (menu-bar-mode -1)
    24 (menu-bar-mode -1)
    25 (tool-bar-mode -1)
    25 (tool-bar-mode -1)
    26 (tooltip-mode -1)
    26 (tooltip-mode -1)
    27 (scroll-bar-mode 1)
    27 (scroll-bar-mode 1)
    45 
    45 
    46 ;; See what I am typing immediately (for keystroke in minibuffer).
    46 ;; See what I am typing immediately (for keystroke in minibuffer).
    47 (setq echo-keystrokes 0.2)
    47 (setq echo-keystrokes 0.2)
    48 
    48 
    49 ;; ----------------------------------------------------------------------
    49 ;; ----------------------------------------------------------------------
    50 ;; Silent runing.
    50 ;; silent runing.
    51 
    51 
    52 ;; (setq inhibit-splash-screen t) ; nonexist on 21.4.1
    52 ;; (setq inhibit-splash-screen t) ; nonexist on 21.4.1
    53 (setq inhibit-startup-message t)
    53 (setq inhibit-startup-message t)
    54 
    54 
    55 ;; ======================================================================
    55 ;; ======================================================================
    56 ;; GNU Serv.
    56 ;; gnu serv, server.
    57 
    57 
    58 ;; (load "~/emacs/bin/gnuserv/gnuserv.el")
    58 ;; (load "~/emacs/bin/gnuserv/gnuserv.el")
    59 ;; (require 'gnuserv)
    59 ;; (require 'gnuserv)
    60 ;; (setq gnuserv-frame (selected-frame))
    60 ;; (setq gnuserv-frame (selected-frame))
    61 
    61 
    67 
    67 
    68 ;; (desktop-load-default)
    68 ;; (desktop-load-default)
    69 ;; (desktop-read)
    69 ;; (desktop-read)
    70 
    70 
    71 ;; ======================================================================
    71 ;; ======================================================================
    72 ;; standart/general settings
    72 ;; standart/general settings.
    73 
    73 
    74 (setq kill-whole-line t)
    74 (setq kill-whole-line t)
    75 
    75 
    76 ;; show column & line numbers in status bar
    76 ;; show column & line numbers in status bar
    77 (setq column-number-mode t)
    77 (setq column-number-mode t)
    82 (setq frame-title-format "Emacs - %b")
    82 (setq frame-title-format "Emacs - %b")
    83 
    83 
    84 (setq read-quoted-char-radix 16)
    84 (setq read-quoted-char-radix 16)
    85 
    85 
    86 ;; ----------------------------------------------------------------------
    86 ;; ----------------------------------------------------------------------
    87 ;; Switching, creating, selecting buffers.
    87 ;; switching, creating, selecting buffers.
    88 
    88 
    89 (iswitchb-mode 1)
    89 (iswitchb-mode 1)
    90 (setq iswitchb-buffer-ignore nil)
    90 (setq iswitchb-buffer-ignore nil)
    91 (mapc (lambda (arg) (add-to-list 'iswitchb-buffer-ignore arg))
    91 (mapc (lambda (arg) (add-to-list 'iswitchb-buffer-ignore arg))
    92         '("^ "
    92         '("^ "
   105 
   105 
   106 ;; buffer-menu better then buffer-list, but ibuffer much better.
   106 ;; buffer-menu better then buffer-list, but ibuffer much better.
   107 (global-set-key "\C-x\C-b" 'ibuffer)
   107 (global-set-key "\C-x\C-b" 'ibuffer)
   108 
   108 
   109 ;; ----------------------------------------------------------------------
   109 ;; ----------------------------------------------------------------------
   110 ;; Scrolling
   110 ;; scrolling.
   111 
   111 
   112 (setq-default
   112 (setq-default
   113  scroll-step 1
   113  scroll-step 1
   114  scroll-conservatively 100
   114  scroll-conservatively 100
   115  ;; При перемещении точка останавливается на расстоянии i строк к границе фрейма.
   115  ;; При перемещении точка останавливается на расстоянии i строк к границе фрейма.
   116  scroll-margin 2
   116  scroll-margin 2
   117  scroll-preserve-screen-position t
   117  scroll-preserve-screen-position t
   118  )
   118  )
   119 
   119 
   120 ;; ----------------------------------------------------------------------
   120 ;; ----------------------------------------------------------------------
   121 ;; search
   121 ;; searching.
   122 
   122 
   123 (setq case-fold-search t)
   123 (setq case-fold-search t)
   124 
   124 
   125 (setq query-replace-highlight t)        ; highlight during query
   125 (setq query-replace-highlight t)        ; highlight during query
   126 (setq search-highlight t)               ; highlight incremental search
   126 (setq search-highlight t)               ; highlight incremental search
   132 ;; ----------------------------------------------------------------------
   132 ;; ----------------------------------------------------------------------
   133 ;; *Text*
   133 ;; *Text*
   134 (setq default-major-mode 'text-mode)
   134 (setq default-major-mode 'text-mode)
   135 
   135 
   136 ;; ----------------------------------------------------------------------
   136 ;; ----------------------------------------------------------------------
   137 ;; syntax highlighting
   137 ;; syntax highlighting.
       
   138 
   138 (setq font-lock-maximum-decoration t)
   139 (setq font-lock-maximum-decoration t)
   139 (global-font-lock-mode 1 t)
   140 (global-font-lock-mode 1 t)
   140 
   141 
   141 ;; ----------------------------------------------------------------------
   142 ;; ----------------------------------------------------------------------
   142 ;; highlight selected text
   143 ;; highlight selected text.
   143 
   144 
   144 ;; 1/-1, when the mark is active, the region is highlighted.
   145 ;; 1/-1, when the mark is active, the region is highlighted.
   145 (transient-mark-mode 1)
   146 (transient-mark-mode 1)
   146 (delete-selection-mode 1)               ; 1/-1
   147 (delete-selection-mode 1)               ; 1/-1
   147 
   148 
   151 (setq pc-select-selection-keys-only t)
   152 (setq pc-select-selection-keys-only t)
   152 (setq pc-select-meta-moves-sexps t)     ; must set before pc-selection-mode enable
   153 (setq pc-select-meta-moves-sexps t)     ; must set before pc-selection-mode enable
   153 (pc-selection-mode 1)
   154 (pc-selection-mode 1)
   154 
   155 
   155 (when (eq window-system 'x)
   156 (when (eq window-system 'x)
   156   (setq x-select-enable-clipboard t)    ; from Emacs 21.2.1 and newer
   157   (setq x-select-enable-clipboard t)    ; for Emacs 21.2.1 and newer
   157   )
   158   )
   158 
   159 
   159 ;; ----------------------------------------------------------------------
   160 ;; ----------------------------------------------------------------------
   160 ;; line
   161 ;; highlighting current line.
   161 (if window-system
   162 
   162     (progn
   163 (when window-system
   163       (global-hl-line-mode t)
   164   (custom-set-faces '(hl-line ((t (:inherit highlight :background "light yellow")))))
   164       (custom-set-faces '(hl-line ((t (:inherit highlight :background "light yellow")))))
   165   (global-hl-line-mode 1)
   165       )
   166   )
   166   )
   167 
   167 
   168 ;; ----------------------------------------------------------------------
   168 ;; ----------------------------------------------------------------------
   169 ;; paren, braces.
   169 ;; paren, brace
       
   170 
   170 
   171 (show-paren-mode 1) ; Parenthesis matching via highlighting.
   171 (show-paren-mode 1) ; Parenthesis matching via highlighting.
   172 (setq show-paren-style (quote parenthesis))
   172 (setq show-paren-style (quote parenthesis))
   173 
   173 
   174 ;; ======================================================================
   174 ;; ======================================================================
   175 ;; Keyboard, mouse.
   175 ;; keyboard, mouse.
   176 
   176 
   177 ;; cyrillic-jcuken  for 567 is :,.
   177 ;; cyrillic-jcuken  for 567 is :,.
   178 ;; russian-computer for 567 is %^&
   178 ;; russian-computer for 567 is %^&
   179 (setq default-input-method 'cyrillic-jcuken)
   179 (setq default-input-method 'cyrillic-jcuken)
   180 
   180 
   181 ;; (pc-bindings-mode) ; Myself define keybinding, see
   181 ;; (pc-bindings-mode) ; Myself define keybinding, see
   182 
   182 
   183 ;; ----------------------------------------------------------------------
   183 ;; ----------------------------------------------------------------------
   184 ;; Completition
   184 ;; completition.
   185 
   185 
   186 ;; partial-completion-mode cause bug in read-file-name with Emacs v22.3.1 (but not with v23.1).
   186 ;; partial-completion-mode cause bug in read-file-name with Emacs v22.3.1 (but not with v23.1).
   187 ;; read-file-name used in rgrep, so I disable partial-completion-mode.
   187 ;; read-file-name used in rgrep, so I disable partial-completion-mode.
   188 (partial-completion-mode -1) ; For example, M-x p-c-m expands to M-x partial-completion-mode
   188 (partial-completion-mode -1) ; For example, M-x p-c-m expands to M-x partial-completion-mode
   189 
   189 
   190 ;; ----------------------------------------------------------------------
   190 ;; ----------------------------------------------------------------------
   191 ;; Mouse
   191 ;; mouse.
   192 
   192 
   193 ;; Scroll Bar gets dragged by mouse butn 1
   193 ;; Scroll Bar gets dragged by mouse butn 1
   194 (global-set-key [vertical-scroll-bar down-mouse-1] 'scroll-bar-drag)
   194 (global-set-key [vertical-scroll-bar down-mouse-1] 'scroll-bar-drag)
   195 ;; Paste at point NOT at cursor
   195 ;; Paste at point NOT at cursor
   196 (setq mouse-yank-at-point t)
   196 (setq mouse-yank-at-point t)
   197 (mouse-wheel-mode 1)
   197 (mouse-wheel-mode 1)
   198 
   198 
   199 ;; ----------------------------------------------------------------------
   199 ;; ----------------------------------------------------------------------
   200 ;; Key Binding (Short-keys).
   200 ;; key binding, short-keys.
   201 
   201 
   202 (global-set-key [home]    'beginning-of-line)
   202 (global-set-key [home]    'beginning-of-line)
   203 (global-set-key [end]     'end-of-line)
   203 (global-set-key [end]     'end-of-line)
   204 (global-set-key [C-home] 'beginning-of-buffer)
   204 (global-set-key [C-home] 'beginning-of-buffer)
   205 (global-set-key [C-end]  'end-of-buffer)
   205 (global-set-key [C-end]  'end-of-buffer)
   234 (if window-system (global-set-key (kbd "C-z") 'nil))
   234 (if window-system (global-set-key (kbd "C-z") 'nil))
   235 
   235 
   236 ;; (global-set-key [language-change] 'ignore)
   236 ;; (global-set-key [language-change] 'ignore)
   237 
   237 
   238 ;; ======================================================================
   238 ;; ======================================================================
   239 ;; Coding system, charset, locale, lang.
   239 ;; coding system, charset, locale, lang.
   240 
   240 
   241 ;; Emacs 23.1 no longer need codepage-setup.
   241 ;; Emacs 23.1 no longer need codepage-setup.
   242 (when (<= emacs-major-version 22)
   242 (when (<= emacs-major-version 22)
   243   (codepage-setup 866)
   243   (codepage-setup 866)
   244   (codepage-setup 1251)
   244   (codepage-setup 1251)
   314 
   314 
   315 ;; ======================================================================
   315 ;; ======================================================================
   316 ;; STANDARD LIBRARIES
   316 ;; STANDARD LIBRARIES
   317 
   317 
   318 ;; ----------------------------------------------------------------------
   318 ;; ----------------------------------------------------------------------
   319 ;; dired
   319 ;; dired.
   320 
   320 
   321 (setq dired-dwim-target t)
   321 (setq dired-dwim-target t)
   322 ;; dangerous
   322 ;; dangerous
   323 ;; (setq
   323 ;; (setq
   324 ;;  dired-recursive-copies 'top
   324 ;;  dired-recursive-copies 'top
   325 ;;  dired-recursive-deletes 'top)
   325 ;;  dired-recursive-deletes 'top)
   326 
   326 
   327 ;; ----------------------------------------------------------------------
   327 ;; ----------------------------------------------------------------------
   328 ;; compression, archive
   328 ;; compression, archive.
   329 
   329 
   330 (require 'jka-compr) ; Automatic decompression, hooks for tar-mode.
   330 (require 'jka-compr) ; Automatic decompression, hooks for tar-mode.
   331 (if (fboundp 'auto-compression-mode)
   331 (if (fboundp 'auto-compression-mode)
   332     (auto-compression-mode 1))
   332     (auto-compression-mode 1))
   333 
   333 
   334 ;; ----------------------------------------------------------------------
   334 (modify-coding-system-alist 'file "\\.\\(war\\|ear\\|sar\\|egg\\)\\'" 'no-conversion)
   335 ;; image
   335 
       
   336 (add-to-list 'auto-mode-alist '("\\.\\(war\\|ear\\|sar\\|egg\\)\\'" . archive-mode))
       
   337 
       
   338 ;; ----------------------------------------------------------------------
       
   339 ;; image.
   336 
   340 
   337 (when (fboundp 'auto-image-file-mode)
   341 (when (fboundp 'auto-image-file-mode)
   338   (auto-image-file-mode 1))
   342   (auto-image-file-mode 1))
   339 
   343 
   340 ;; ----------------------------------------------------------------------
   344 ;; ----------------------------------------------------------------------
   347 (recentf-mode t)
   351 (recentf-mode t)
   348 (setq recentf-max-saved-items 200)
   352 (setq recentf-max-saved-items 200)
   349 (global-set-key (kbd "\e\eq")  'recentf-open-files)
   353 (global-set-key (kbd "\e\eq")  'recentf-open-files)
   350 
   354 
   351 ;; ----------------------------------------------------------------------
   355 ;; ----------------------------------------------------------------------
   352 ;; revert
   356 ;; revert buffer.
       
   357 
   353 (global-set-key [f5]    'revert-buffer)
   358 (global-set-key [f5]    'revert-buffer)
   354 (setq revert-without-query (quote (".*")))
   359 (setq revert-without-query (quote (".*")))
   355 (setq auto-revert-interval 2)
   360 (setq auto-revert-interval 2)
   356 
   361 
   357 ;; ======================================================================
   362 ;; ======================================================================
   358 ;; Convenient
   363 ;; convenient.
   359 
   364 
   360 (defun reglen()
   365 (defun reglen()
   361   "Show region length."
   366   "Show region length."
   362   (interactive)
   367   (interactive)
   363   (message "%s" (- (region-end) (region-beginning))))
   368   (message "%s" (- (region-end) (region-beginning))))
   364 
   369 
   365 ;; ----------------------------------------------------------------------
   370 ;; ----------------------------------------------------------------------
   366 ;; minibuffer
   371 ;; minibuffer.
   367 
   372 
   368 (require 'icomplete) ; Interactive completion in minibuffer.
   373 (require 'icomplete) ; Interactive completion in minibuffer.
   369 (icomplete-mode 1)
   374 (icomplete-mode 1)
   370 
   375 
   371 (mapc (lambda (ext) (add-to-list 'completion-ignored-extensions ext))
   376 (mapc (lambda (ext) (add-to-list 'completion-ignored-extensions ext))
   382       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 "
   387       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 "
   383       grep-highlight-matches nil ; do not set t because some grep do not has --color options
   388       grep-highlight-matches nil ; do not set t because some grep do not has --color options
   384       grep-use-null-device t)
   389       grep-use-null-device t)
   385 
   390 
   386 ;; ----------------------------------------------------------------------
   391 ;; ----------------------------------------------------------------------
   387 ;; Music
   392 ;; music.
   388 (setq gnus-audio-au-player "winamp.exe"
   393 (setq gnus-audio-au-player "winamp.exe"
   389       gnus-audio-directory "D:\\music"
   394       gnus-audio-directory "D:\\music"
   390       gnus-audio-wav-player "winamp.exe")
   395       gnus-audio-wav-player "winamp.exe")
   391 
   396 
   392 ;; ----------------------------------------------------------------------
   397 ;; ----------------------------------------------------------------------
   393 ;; archive
   398 ;; browser.
   394 
       
   395 (modify-coding-system-alist 'file "\\.\\(war\\|ear\\|sar\\|egg\\)\\'" 'no-conversion)
       
   396 
       
   397 (add-to-list 'auto-mode-alist '("\\.\\(war\\|ear\\|sar\\|egg\\)\\'" . archive-mode))
       
   398 
       
   399 ;; ----------------------------------------------------------------------
       
   400 ;; browser
       
   401 
   399 
   402 (cond
   400 (cond
   403  ((equal window-system 'w32)
   401  ((equal window-system 'w32)
   404   (setq browse-url-browser-function 'browse-url-default-windows-browser))
   402   (setq browse-url-browser-function 'browse-url-default-windows-browser))
   405  (t
   403  (t
   406   (setq browse-url-browser-function 'browse-url-mozilla)))
   404   (setq browse-url-browser-function 'browse-url-mozilla)))
   407 
   405 
   408 ;; ======================================================================
   406 ;; ----------------------------------------------------------------------
   409 ;; TIME SETTING
   407 ;; time.
   410 
       
   411 ;; ----------------------------------------------------------------------
       
   412 ;; Time
       
   413 
   408 
   414 ;; Also useful such format:
   409 ;; Also useful such format:
   415 ;; (setq display-time-format " %H:%M %d-%m-%y ")
   410 ;; (setq display-time-format " %H:%M %d-%m-%y ")
   416 (setq display-time-24hr-format t)
   411 (setq display-time-24hr-format t)
   417 (setq display-time-default-load-average nil)
   412 (setq display-time-default-load-average nil)
   418 (display-time)                          ; display-time-mode
   413 (display-time)                          ; display-time-mode
   419 
   414 
   420 ;; ----------------------------------------------------------------------
   415 ;; ----------------------------------------------------------------------
   421 ;; Calendar
   416 ;; calendar.
       
   417 
   422 ;; (setq mark-holidays-in-calendar t)
   418 ;; (setq mark-holidays-in-calendar t)
   423 ;; (setq all-christian-calendar-holidays t)
   419 ;; (setq all-christian-calendar-holidays t)
   424 ;; (setq calendar-date-display-form (quote ((format "%04s-%02d-%02d" year (string-to-int month) (string-to-int day)))))
   420 ;; (setq calendar-date-display-form (quote ((format "%04s-%02d-%02d" year (string-to-int month) (string-to-int day)))))
   425 ;; (setq calendar-time-display-form (quote (24-hours ":" minutes (if time-zone " (") time-zone (if time-zone ")"))))
   421 ;; (setq calendar-time-display-form (quote (24-hours ":" minutes (if time-zone " (") time-zone (if time-zone ")"))))
   426 (setq calendar-week-start-day 1)
   422 (setq calendar-week-start-day 1)
   444 ;; Turn on auto-fill mode
   440 ;; Turn on auto-fill mode
   445 (add-hook 'html-mode-hook 'turn-on-auto-fill)
   441 (add-hook 'html-mode-hook 'turn-on-auto-fill)
   446 (add-hook 'text-mode-hook 'turn-on-auto-fill)
   442 (add-hook 'text-mode-hook 'turn-on-auto-fill)
   447 
   443 
   448 ;; ----------------------------------------------------------------------
   444 ;; ----------------------------------------------------------------------
   449 ;; unknown
   445 ;; unknown.
   450 
   446 
   451 ;; browse-url mailcrypt gnus message sendmail bbdb pilot bibtex eiffel-mode emacs-w3m
   447 ;; browse-url mailcrypt gnus message sendmail bbdb pilot bibtex eiffel-mode emacs-w3m
   452 ;; eudc filladapt hugs-mode mpg123 php-mode ps-print
   448 ;; eudc filladapt hugs-mode mpg123 php-mode ps-print
   453 ;; chord-mode - edit guitar music
   449 ;; chord-mode - edit guitar music
   454 ;; discography - variant of BibTeX mode for discographies
   450 ;; discography - variant of BibTeX mode for discographies
   464 (put 'narrow-to-page   'disabled nil)
   460 (put 'narrow-to-page   'disabled nil)
   465 (put 'narrow-to-region 'disabled nil)
   461 (put 'narrow-to-region 'disabled nil)
   466 (put 'scroll-left      'disabled nil)
   462 (put 'scroll-left      'disabled nil)
   467 
   463 
   468 ;; ======================================================================
   464 ;; ======================================================================
   469 ;; TEX
   465 ;; TEX.
       
   466 
   470 (setq tex-run-command "initex")
   467 (setq tex-run-command "initex")
   471 
   468 
   472 
   469 ;; ======================================================================
   473 ;; ======================================================================
   470 ;; AUC TeX.
   474 ;; AUC TeX
       
   475 
   471 
   476 ;(add-hook 'LaTeX-mode-hook 'LaTeX-install-toolbar)
   472 ;(add-hook 'LaTeX-mode-hook 'LaTeX-install-toolbar)
   477 ;; (setq TeX-parse-self t)             ; Enable parse on load.
   473 ;; (setq TeX-parse-self t)             ; Enable parse on load.
   478 ;; (setq TeX-auto-save t)              ; Enable parse on save.
   474 ;; (setq TeX-auto-save t)              ; Enable parse on save.
   479 ;; (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
   475 ;; (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
   503 ;     (add-to-list 'TeX-command-list
   499 ;     (add-to-list 'TeX-command-list
   504 ;         (list "All Texify run-viewer"
   500 ;         (list "All Texify run-viewer"
   505 ;           "texify --tex-opt=--src --run-viewer --clean %s.tex"
   501 ;           "texify --tex-opt=--src --run-viewer --clean %s.tex"
   506 ;           'TeX-run-command nil t))))
   502 ;           'TeX-run-command nil t))))
   507 
   503 
   508 
   504 ;; ======================================================================
   509 ;; ======================================================================
   505 ;; Reftex activation (Reftex is included with Emacs 21.1).
   510 ;;
       
   511 ;; Reftex activation (Reftex is included with Emacs 21.1)
       
   512 
   506 
   513 ;; (autoload 'reftex-mode     "reftex" "RefTeX Minor Mode" t)
   507 ;; (autoload 'reftex-mode     "reftex" "RefTeX Minor Mode" t)
   514 ;; (autoload 'turn-on-reftex  "reftex" "RefTeX Minor Mode" nil)
   508 ;; (autoload 'turn-on-reftex  "reftex" "RefTeX Minor Mode" nil)
   515 ;; (autoload 'reftex-citation "reftex-cite" "Make citation" nil)
   509 ;; (autoload 'reftex-citation "reftex-cite" "Make citation" nil)
   516 ;; (autoload 'reftex-index-phrase-mode "reftex-index" "Phrase mode" t)
   510 ;; (autoload 'reftex-index-phrase-mode "reftex-index" "Phrase mode" t)
   517 ;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex)   ; with AUCTeX LaTeX mode
   511 ;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex)   ; with AUCTeX LaTeX mode
   518 ;; (add-hook 'latex-mode-hook 'turn-on-reftex)   ; with Emacs latex mode
   512 ;; (add-hook 'latex-mode-hook 'turn-on-reftex)   ; with Emacs latex mode
   519 
   513 
   520 ;; ======================================================================
   514 ;; ======================================================================
   521 ;; PreviewLatex
   515 ;; PreviewLatex.
   522 
   516 
   523 ;(load "preview-latex.el" nil t t)
   517 ;(load "preview-latex.el" nil t t)
   524 
   518 
   525 ;(add-hook 'LaTeX-mode-hook #'LaTeX-preview-setup)
   519 ;(add-hook 'LaTeX-mode-hook #'LaTeX-preview-setup)
   526 ;(autoload 'LaTeX-preview-setup "preview")
   520 ;(autoload 'LaTeX-preview-setup "preview")
   527 
   521 
   528 
   522 ;; ======================================================================
   529 ;; ======================================================================
   523 ;; Info.
   530 ;;
       
   531 ;; Info
       
   532 
   524 
   533 (require 'info)
   525 (require 'info)
   534 (if (equal window-system 'w32)
   526 (if (equal window-system 'w32)
   535     (progn
   527     (progn
   536       ;; TODO Write which func to find runemacs.exe dir.
   528       ;; TODO Write which func to find runemacs.exe dir.
   537       ;; (setq Info-directory-list (list (expand-file-name "~/../bin/emacs/info")))
   529       ;; (setq Info-directory-list (list (expand-file-name "~/../bin/emacs/info")))
   538       ;; (add-to-list 'Info-directory-list (expand-file-name "~/../bin/MinGW/info") t) ; t - append to the end
   530       ;; (add-to-list 'Info-directory-list (expand-file-name "~/../bin/MinGW/info") t) ; t - append to the end
   539       ))
   531       ))
   540 
   532 
   541 ;; ======================================================================
   533 ;; ======================================================================
   542 ;; man, woman
   534 ;; man, woman.
       
   535 
   543 (require 'woman)
   536 (require 'woman)
   544 (setq woman-use-own-frame nil)
   537 (setq woman-use-own-frame nil)
   545 (setq woman-fill-frame t)
   538 (setq woman-fill-frame t)
   546 
   539 
   547 ;; ======================================================================
   540 ;; ======================================================================
   548 ;; shell, sh, bash
   541 ;; shell, sh, bash.
   549 
   542 
   550 ;; Setup Emacs to run bash as its primary shell.
   543 ;; Setup Emacs to run bash as its primary shell.
   551 ;; (setq binary-process-input t)
   544 ;; (setq binary-process-input t)
   552 ;; (setq shell-file-name "bash")
   545 ;; (setq shell-file-name "bash")
   553 ;; (setq shell-command-switch "-c")
   546 ;; (setq shell-command-switch "-c")
   565   ;; prevent quoting.
   558   ;; prevent quoting.
   566   (setq find-ls-option '("-exec ls -ld {}  ;" . "-ld"))
   559   (setq find-ls-option '("-exec ls -ld {}  ;" . "-ld"))
   567   )
   560   )
   568 
   561 
   569 ;; ======================================================================
   562 ;; ======================================================================
   570 ;; spell, ispall, aspell
   563 ;; spell, ispall, aspell.
   571 
   564 
   572 (setq ispell-program-name "ispell")
   565 (setq ispell-program-name "ispell")
   573 ;(setq ispell-dictionary "russianw"); default dictionary
   566 ;(setq ispell-dictionary "russianw"); default dictionary
   574 ;(setq ispell-local-dictionary "russianw"); default dictionary
   567 ;(setq ispell-local-dictionary "russianw"); default dictionary
   575 ;(add-hook 'text-mode-hook 'flyspell-mode)
   568 ;(add-hook 'text-mode-hook 'flyspell-mode)
   587 
   580 
   588 ;; ======================================================================
   581 ;; ======================================================================
   589 ;; GTD, PIM, organize, todo mode.
   582 ;; GTD, PIM, organize, todo mode.
   590 
   583 
   591 ;; ----------------------------------------------------------------------
   584 ;; ----------------------------------------------------------------------
   592 ;; org-mode
   585 ;; org-mode.
   593 
   586 
   594 (if (>= emacs-major-version 22)
   587 (if (>= emacs-major-version 22)
   595 (progn
   588 (progn
   596   (require 'org)
   589   (require 'org)
   597   ))
   590   ))
   615             )
   608             )
   616       (define-key global-map "\C-ca" 'org-agenda)
   609       (define-key global-map "\C-ca" 'org-agenda)
   617       (setq org-agenda-files '("~/.gtd/todo.org")) ))
   610       (setq org-agenda-files '("~/.gtd/todo.org")) ))
   618 
   611 
   619 ;; ----------------------------------------------------------------------
   612 ;; ----------------------------------------------------------------------
   620 ;; remember-mode
   613 ;; remember-mode.
       
   614 
   621 (if (featurep 'remember)
   615 (if (featurep 'remember)
   622     (progn
   616     (progn
   623       (setq remember-annotation-functions '(org-remember-annotation))
   617       (setq remember-annotation-functions '(org-remember-annotation))
   624       (setq remember-handler-functions '(org-remember-handler))
   618       (setq remember-handler-functions '(org-remember-handler))
   625       (add-hook 'remember-mode-hook 'org-remember-apply-template)
   619       (add-hook 'remember-mode-hook 'org-remember-apply-template)
   632       (setq
   626       (setq
   633        org-remember-store-without-prompt t
   627        org-remember-store-without-prompt t
   634        ) ))
   628        ) ))
   635 
   629 
   636 ;; ======================================================================
   630 ;; ======================================================================
   637 ;; whitespace
   631 ;; whitespaces.
   638 
   632 
   639 (setq-default show-trailing-whitespace t)
   633 (setq-default show-trailing-whitespace t)
   640 (setq-default indicate-empty-lines t)
   634 (setq-default indicate-empty-lines t)
   641 (setq next-line-add-newlines nil)
   635 (setq next-line-add-newlines nil)
   642 
   636 
   675        ("\t+" 0 'my-tab-face t)
   669        ("\t+" 0 'my-tab-face t)
   676        ("\\<\\(FIXME:?\\|XXX:?\\|TODO:?\\)\\>" 1 'my-todo-face t)
   670        ("\\<\\(FIXME:?\\|XXX:?\\|TODO:?\\)\\>" 1 'my-todo-face t)
   677        ("\\(=\\{7,\\}\\|<\\{7,\\}\\|>\\{7,\\}\\)" 1 'my-conflict-face t)
   671        ("\\(=\\{7,\\}\\|<\\{7,\\}\\|>\\{7,\\}\\)" 1 'my-conflict-face t)
   678        ))))))
   672        ))))))
   679 
   673 
   680 ;; ======================================================================
   674 ;; ----------------------------------------------------------------------
   681 ;; communication
   675 ;; jabber.
   682 
   676 
   683 ;; ----------------------------------------------------------------------
       
   684 ;; jabber
       
   685 (when (featurep 'jabber)
   677 (when (featurep 'jabber)
   686   (setq
   678   (setq
   687    jabber-history-enabled t
   679    jabber-history-enabled t
   688    jabber-use-global-history nil
   680    jabber-use-global-history nil
   689    jabber-backlog-number 15
   681    jabber-backlog-number 15
   706 (when (featurep 'fsm)
   698 (when (featurep 'fsm)
   707   (setq fsm-debug nil)                  ; Disable *fsm-debug* buffer.
   699   (setq fsm-debug nil)                  ; Disable *fsm-debug* buffer.
   708   )
   700   )
   709 
   701 
   710 ;; ----------------------------------------------------------------------
   702 ;; ----------------------------------------------------------------------
   711 ;; rcirc
   703 ;; rcirc.
   712 
   704 
   713 ;; Turn on logging everything to a special buffer, for debugging.
   705 ;; Turn on logging everything to a special buffer, for debugging.
   714 ;; (setq rcirc-debug-flag t)
   706 ;; (setq rcirc-debug-flag t)
   715 
   707 
   716 (add-hook 'rcirc-mode-hook (lambda () (rcirc-track-minor-mode 1)))
   708 (add-hook 'rcirc-mode-hook (lambda () (rcirc-track-minor-mode 1)))
   717 (setq rcirc-time-format "%H:%M ")
   709 (setq rcirc-time-format "%H:%M ")
   718 (defun rcirc-handler-301 (process cmd sender args)
   710 (defun rcirc-handler-301 (process cmd sender args)
   719   "/away message handler.")
   711   "/away message handler.")
   720 
   712 
   721 ;; ----------------------------------------------------------------------
   713 ;; ----------------------------------------------------------------------
   722 ;; erc
   714 ;; erc.
   723 
   715 
   724 (setq erc-server-coding-system 'utf-8)
   716 (setq erc-server-coding-system 'utf-8)
   725 
   717 
   726 ;; ======================================================================
   718 ;; ======================================================================
   727 ;; VCS, version control, cvs, svn.
   719 ;; VCS, version control, cvs, svn.
   763       )
   755       )
   764      )
   756      )
   765   )
   757   )
   766 
   758 
   767 ;; ----------------------------------------------------------------------
   759 ;; ----------------------------------------------------------------------
   768 ;; psvn
   760 ;; psvn.
       
   761 
   769 (setq svn-status-verbose t)
   762 (setq svn-status-verbose t)
   770 (setq svn-status-hide-unmodified t)
   763 (setq svn-status-hide-unmodified t)
   771 
   764 
   772 ;; ----------------------------------------------------------------------
   765 ;; ----------------------------------------------------------------------
   773 ;; DVC
   766 ;; DVC.
   774 
   767 
   775 (when (featurep 'dvc-emacs)
   768 (when (featurep 'dvc-emacs)
   776   (setq dvc-tips-enabled nil)
   769   (setq dvc-tips-enabled nil)
   777   )
   770   )
   778 
   771 
   779 ;; ======================================================================
   772 ;; ======================================================================
   780 ;; devel, prog, programming
   773 ;; devel, prog, programming.
   781 
   774 
   782 (add-to-list 'auto-mode-alist '("\\.cu$" . c-mode))
   775 (add-to-list 'auto-mode-alist '("\\.cu$" . c-mode))
   783 
   776 
   784 (setq-default comment-style (quote indent))
   777 (setq-default comment-style (quote indent))
   785 (setq-default comment-column 44)
   778 (setq-default comment-column 44)
   791                     (setq fill-column 110) )
   784                     (setq fill-column 110) )
   792                   ))
   785                   ))
   793       '(c-mode-hook lisp-mode-hook))
   786       '(c-mode-hook lisp-mode-hook))
   794 
   787 
   795 ;; ----------------------------------------------------------------------
   788 ;; ----------------------------------------------------------------------
   796 ;; Diff, patch
   789 ;; diff, patch.
       
   790 
   797 (setq diff-switches "-u")
   791 (setq diff-switches "-u")
   798 
   792 
   799 ;; ----------------------------------------------------------------------
   793 ;; ----------------------------------------------------------------------
   800 ;; Indent
   794 ;; indenting.
   801 
   795 
   802 (setq standard-indent 4)
   796 (setq standard-indent 4)
   803 (setq c-basic-offset 4)
   797 (setq c-basic-offset 4)
   804 (setq sh-basic-offset 2)
   798 (setq sh-basic-offset 2)
   805 (setq sgml-basic-offset 4)
   799 (setq sgml-basic-offset 4)
   815   (while (>= i 0)
   809   (while (>= i 0)
   816     (setq tab-stop-list (cons i tab-stop-list))
   810     (setq tab-stop-list (cons i tab-stop-list))
   817     (setq i (- i 4))))
   811     (setq i (- i 4))))
   818 
   812 
   819 ;; ----------------------------------------------------------------------
   813 ;; ----------------------------------------------------------------------
   820 ;; Diff.
   814 ;; diff.
       
   815 
   821 (setq ediff-diff-options "")
   816 (setq ediff-diff-options "")
   822 
   817 
   823 ;; ----------------------------------------------------------------------
   818 ;; ----------------------------------------------------------------------
   824 ;; *Compile*
   819 ;; *Compile*
       
   820 
   825 (setq compile-auto-highlight t
   821 (setq compile-auto-highlight t
   826       compile-command "make ")
   822       compile-command "make ")
   827 ;; compilation window shall scroll down if not 0
   823 ;; compilation window shall scroll down if not 0
   828 (setq compilation-scroll-output 1)
   824 (setq compilation-scroll-output 1)
   829 
   825 
   835 (add-to-list 'compilation-error-regexp-alist '("^\"?\\([^\"]*\\)\"?,\\([0-9]*\\) .*\\[.*\\]: " 1 2)) ; KEIL compiler
   831 (add-to-list 'compilation-error-regexp-alist '("^\"?\\([^\"]*\\)\"?,\\([0-9]*\\) .*\\[.*\\]: " 1 2)) ; KEIL compiler
   836 ;; (add-to-list 'compilation-mode-font-lock-keywords '("\\(/[Oo][Uu][Tt]:[^ 	]+\\)" . 1))
   832 ;; (add-to-list 'compilation-mode-font-lock-keywords '("\\(/[Oo][Uu][Tt]:[^ 	]+\\)" . 1))
   837 ;; (add-to-list 'compilation-mode-font-lock-keywords '("[ 	]\\(/F[oe][^ 	]+\\)" . 1))
   833 ;; (add-to-list 'compilation-mode-font-lock-keywords '("[ 	]\\(/F[oe][^ 	]+\\)" . 1))
   838 
   834 
   839 ;; ----------------------------------------------------------------------
   835 ;; ----------------------------------------------------------------------
   840 ;; makefile, make
   836 ;; makefile, make.
   841 
   837 
   842 (add-to-list 'auto-mode-alist '("\\(Makefile\\|Makefile\\..+\\)\\'" . makefile-gmake-mode))
   838 (add-to-list 'auto-mode-alist '("\\(Makefile\\|Makefile\\..+\\)\\'" . makefile-gmake-mode))
   843 
   839 
   844 ;; ----------------------------------------------------------------------
   840 ;; ----------------------------------------------------------------------
   845 ;; asm
   841 ;; asm, assembler.
       
   842 
   846 ;; (setq-default asm-comment-char 59)
   843 ;; (setq-default asm-comment-char 59)
   847 (add-hook 'asm-mode-hook '(lambda () (setq comment-start "/*") (setq comment-end "*/")) t)
   844 (add-hook 'asm-mode-hook '(lambda () (setq comment-start "/*") (setq comment-end "*/")) t)
   848 
   845 
   849 (add-to-list 'auto-mode-alist '("\\.\\([sS]79\\|[sS]\\)\\'" . asm-mode))
   846 (add-to-list 'auto-mode-alist '("\\.\\([sS]79\\|[sS]\\)\\'" . asm-mode))
   850 
   847 
   851 ;; (add-hook 'asm-mode-hook '(lambda () (local-unset-key ":")))
   848 ;; (add-hook 'asm-mode-hook '(lambda () (local-unset-key ":")))
   852 ;; (add-hook 'asm-mode-hook '(lambda () (local-set-key ":" ":")))
   849 ;; (add-hook 'asm-mode-hook '(lambda () (local-set-key ":" ":")))
   853 
   850 
   854 ;; ----------------------------------------------------------------------
   851 ;; ----------------------------------------------------------------------
   855 ;; linker
   852 ;; linker.
   856 
   853 
   857 (when (fboundp 'iar-linker-config-mode)
   854 (when (fboundp 'iar-linker-config-mode)
   858   (add-to-list 'auto-mode-alist '("\\.icf\\'" . iar-linker-config-mode))
   855   (add-to-list 'auto-mode-alist '("\\.icf\\'" . iar-linker-config-mode))
   859   )
   856   )
   860 (when (fboundp 'iar4-linker-config-mode)
   857 (when (fboundp 'iar4-linker-config-mode)
   861   (add-to-list 'auto-mode-alist '("\\.xcl\\'" . iar4-linker-config-mode))
   858   (add-to-list 'auto-mode-alist '("\\.xcl\\'" . iar4-linker-config-mode))
   862   )
   859   )
   863 
   860 
   864 ;; ----------------------------------------------------------------------
   861 ;; ----------------------------------------------------------------------
   865 ;; lisp
   862 ;; lisp.
       
   863 
   866 (setq list-command-history-max 256)
   864 (setq list-command-history-max 256)
   867 
   865 
   868 ;; ----------------------------------------------------------------------
   866 ;; ----------------------------------------------------------------------
   869 ;; C, c-mode, C++, c++-mode
   867 ;; C, c-mode, C++, c++-mode.
   870 
   868 
   871 (setq c-echo-syntactic-information-p t)
   869 (setq c-echo-syntactic-information-p t)
   872 (add-hook 'c-mode-common-hook
   870 (add-hook 'c-mode-common-hook
   873  (lambda ()
   871  (lambda ()
   874    ;; Automatically inserte newlines after special characters such as brace, comma, semi-colon, and colon.
   872    ;; Automatically inserte newlines after special characters such as brace, comma, semi-colon, and colon.
   922 (add-hook 'c-mode-common-hook
   920 (add-hook 'c-mode-common-hook
   923           (lambda () (c-add-style "my" my-c-style t)))
   921           (lambda () (c-add-style "my" my-c-style t)))
   924 (setq c-default-style '((java-mode . "my") (c-mode . "my") (csharp-mode . "my") (c++-mode . "my") (objc-mode . "my") (other . "my")))
   922 (setq c-default-style '((java-mode . "my") (c-mode . "my") (csharp-mode . "my") (c++-mode . "my") (objc-mode . "my") (other . "my")))
   925 
   923 
   926 ;; ----------------------------------------------------------------------
   924 ;; ----------------------------------------------------------------------
   927 ;; bat file, batch
   925 ;; bat file, batch.
   928 
   926 
   929 (when (fboundp 'bat-file-mode)
   927 (when (fboundp 'bat-file-mode)
   930   (add-to-list 'auto-mode-alist '("\\.[bB][aA][tT]\\'" . bat-file-mode))
   928   (add-to-list 'auto-mode-alist '("\\.[bB][aA][tT]\\'" . bat-file-mode))
   931   (add-to-list 'auto-mode-alist '("\\.[cC][mM][dD]\\'" . bat-file-mode))
   929   (add-to-list 'auto-mode-alist '("\\.[cC][mM][dD]\\'" . bat-file-mode))
   932   )
   930   )
   933 
   931 
   934 ;; ----------------------------------------------------------------------
   932 ;; ----------------------------------------------------------------------
   935 ;; nsis-mode
   933 ;; nsis-mode.
   936 
   934 
   937 (when (fboundp 'nsis-mode)
   935 (when (fboundp 'nsis-mode)
   938   (add-to-list 'auto-mode-alist '("\\.\\(nsi\\|nsh\\)\\'" . nsis-mode))
   936   (add-to-list 'auto-mode-alist '("\\.\\(nsi\\|nsh\\)\\'" . nsis-mode))
   939   )
   937   )
   940 
   938 
   941 ;; ----------------------------------------------------------------------
   939 ;; ----------------------------------------------------------------------
   942 ;; *csharp*, c-sharp
   940 ;; *csharp*, c-sharp.
   943 
   941 
   944 (autoload 'csharp-mode "csharp-mode" "Major mode for editing C# code." t)
   942 (autoload 'csharp-mode "csharp-mode" "Major mode for editing C# code." t)
   945 (add-to-list 'auto-mode-alist '("\\.cs$" . csharp-mode))
   943 (add-to-list 'auto-mode-alist '("\\.cs$" . csharp-mode))
   946 
   944 
   947 ;; ----------------------------------------------------------------------
   945 ;; ----------------------------------------------------------------------
   948 ;; *Java*
   946 ;; java.
       
   947 
   949 ;; Update the Emacs load-path to include the path to
   948 ;; Update the Emacs load-path to include the path to
   950 ;; the JDE and its require packages. This code assumes
   949 ;; the JDE and its require packages. This code assumes
   951 ;; that you have installed the packages in the emacs/site
   950 ;; that you have installed the packages in the emacs/site
   952 ;; subdirectory of your home directory.
   951 ;; subdirectory of your home directory.
   953 ;; (add-to-list 'load-path (expand-file-name "~/emacs/site/semantic"))
   952 ;; (add-to-list 'load-path (expand-file-name "~/emacs/site/semantic"))
   983 
   982 
   984 ;; (add-hook 'jde-mode-hook 'my-jde-mode-hook)
   983 ;; (add-hook 'jde-mode-hook 'my-jde-mode-hook)
   985 
   984 
   986 ;; (require 'jde)
   985 ;; (require 'jde)
   987 
   986 
   988 ;; ********************
   987 ;; ----------------------------------------------------------------------
   989 ;; ECB
   988 ;; ECB.
   990 ;; *******************
       
   991 
   989 
   992 (setq ecb-tip-of-the-day nil)
   990 (setq ecb-tip-of-the-day nil)
   993 ;; (add-to-list 'load-path  "~/emacs/site/ecb-2.32")
   991 ;; (add-to-list 'load-path  "~/emacs/site/ecb-2.32")
   994 ;; (require 'ecb)
   992 ;; (require 'ecb)
   995 
   993 
   996 ;; (global-set-key (kbd "\e\eE") 'ecb-activate)
   994 ;; (global-set-key (kbd "\e\eE") 'ecb-activate)
   997 
   995 
   998 ;; ----------------------------------------------------------------------
   996 ;; ----------------------------------------------------------------------
   999 ;; html
   997 ;; html.
  1000 
   998 
  1001 ;; ----------------------------------------------------------------------
   999 ;; ----------------------------------------------------------------------
  1002 ;; xml
  1000 ;; xml.
  1003 
  1001 
  1004 ;; ----------------------------------------------------------------------
  1002 ;; ----------------------------------------------------------------------
  1005 ;; psgml
  1003 ;; psgml.
       
  1004 
  1006 (setq sgml-set-face t)                  ; for highlighting in sgml
  1005 (setq sgml-set-face t)                  ; for highlighting in sgml
  1007 
  1006 
  1008 ;; ======================================================================
  1007 ;; ======================================================================
  1009 ;; printing
  1008 ;; printing.
  1010 
  1009 
  1011 ;; Use Notepad to print plain text files to the default Windows printer
  1010 ;; Use Notepad to print plain text files to the default Windows printer
  1012 ;(setq lpr-command "notepad")
  1011 ;(setq lpr-command "notepad")
  1013 ;(setq lpr-headers-switches '("/p"))    ; \ mis-use these
  1012 ;(setq lpr-headers-switches '("/p"))    ; \ mis-use these
  1014 ;(setq lpr-switches nil)                ; / two variables
  1013 ;(setq lpr-switches nil)                ; / two variables
  1015 ;(setq printer-name nil)        ; notepad takes the default
  1014 ;(setq printer-name nil)        ; notepad takes the default
  1016 ;(setq lpr-printer-switch "/P") ;; run notepad as batch printer
  1015 ;(setq lpr-printer-switch "/P") ;; run notepad as batch printer
  1017 ;;
  1016 ;;
  1018 
  1017 
  1019 ;; ----------------------------------------------------------------------
  1018 ;; ----------------------------------------------------------------------
  1020 ;; printing to file
  1019 ;; printing to file.
  1021 
  1020 
  1022 ;(setq printer-name "~/myprint.txt")
  1021 ;(setq printer-name "~/myprint.txt")
  1023 ;(setq ps-printer-name nil)
  1022 ;(setq ps-printer-name nil)
  1024 ;(setq ps-print-header nil)
  1023 ;(setq ps-print-header nil)
  1025 ;;; some more menu entries in the command list:
  1024 ;;; some more menu entries in the command list:
  1044 ;         (list "All Texify run-viewer"
  1043 ;         (list "All Texify run-viewer"
  1045 ;           "texify --tex-opt=--src --run-viewer --clean %s.tex"
  1044 ;           "texify --tex-opt=--src --run-viewer --clean %s.tex"
  1046 ;           'TeX-run-command nil t))))
  1045 ;           'TeX-run-command nil t))))
  1047 
  1046 
  1048 ;; ----------------------------------------------------------------
  1047 ;; ----------------------------------------------------------------
  1049 ;; SQL
  1048 ;; SQL.
  1050 
  1049 
  1051 (setq sql-password "")
  1050 (setq sql-password "")
  1052 
  1051 
  1053 ;; ======================================================================
  1052 ;; ======================================================================
  1054 ;; Backup
  1053 ;; backuping.
  1055 
  1054 
  1056 (setq
  1055 (setq
  1057  backup-by-copying t                           ; don't clobber symlinks
  1056  backup-by-copying t                           ; don't clobber symlinks
  1058  backup-directory-alist '(("." . "~/.backup")) ; don't litter my fs tree
  1057  backup-directory-alist '(("." . "~/.backup")) ; don't litter my fs tree
  1059  delete-old-versions t                         ; delete excess backup versions silently
  1058  delete-old-versions t                         ; delete excess backup versions silently
  1060  kept-old-versions 1                           ; store first original version
  1059  kept-old-versions 1                           ; store first original version
  1061  kept-new-versions 3                           ; store last 3 version
  1060  kept-new-versions 3                           ; store last 3 version
  1062  version-control t)                            ; use versioned backups
  1061  version-control t)                            ; use versioned backups
  1063 
  1062 
  1064 ;; ======================================================================
  1063 ;; ======================================================================
  1065 ;; auto save
  1064 ;; auto save.
  1066 
  1065 
  1067 (setq auto-save-default t)
  1066 (setq auto-save-default t)
  1068 ;; If nil autosave to different than original to buffer file.
  1067 ;; If nil autosave to different than original to buffer file.
  1069 (setq auto-save-visited-file-name nil)
  1068 (setq auto-save-visited-file-name nil)
  1070 ;; Note: if you kill unsaved file auto save file not deleted.
  1069 ;; Note: if you kill unsaved file auto save file not deleted.
  1071 (setq delete-auto-save-files t)
  1070 (setq delete-auto-save-files t)
  1072 
  1071 
  1073 ;; ======================================================================
  1072 ;; ======================================================================
  1074 ;; Setup user info.
  1073 ;; user info.
  1075 
  1074 
  1076 (cd "~/")
  1075 (cd "~/")
  1077 (setq user-full-name "Oleksandr Gavenko")
  1076 (setq user-full-name "Oleksandr Gavenko")
  1078 (setq user-mail-address "gavenkoa@gmail.com")
  1077 (setq user-mail-address "gavenkoa@gmail.com")
  1079 (setenv "ORGANIZATION" (concat user-full-name " <" user-mail-address  ">"))
  1078 (setenv "ORGANIZATION" (concat user-full-name " <" user-mail-address  ">"))