.emacs-my
changeset 461 1639d2540bbd
parent 460 9bd638f8f74c
child 462 f99a3783e44e
equal deleted inserted replaced
460:9bd638f8f74c 461:1639d2540bbd
     1 ;; -*- mode: lisp; coding: utf-8; fill-column: 78 -*-
     1 ;; -*- mode: lisp; mode: outline-minor; coding: utf-8; fill-column: 78 -*-
     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 ;; Config file for GNU Emacs.
     8 ;; Config file for GNU Emacs.
     9 ;;
     9 ;;
    10 ;; For load order see README.
    10 ;; For load order see README.
    11 
    11 
    12 ;; ======================================================================
    12 ;;; ----------------------------------------------------------------
    13 ;; emacs 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 ;; mode groups
    22 ;;; mode groups.
    23 
    23 
    24 (defvar my-devel-mode-list
    24 (defvar my-devel-mode-list
    25   '(
    25   '(
    26     outline-mode
    26     outline-mode
    27     sh-mode script-mode
    27     sh-mode script-mode
    61 
    61 
    62 (defvar my-text-mode-hook-list
    62 (defvar my-text-mode-hook-list
    63   '(outline-mode-hook text-mode-hook)
    63   '(outline-mode-hook text-mode-hook)
    64   "List of text mode hooks.")
    64   "List of text mode hooks.")
    65 
    65 
    66 ;; ======================================================================
    66 
    67 ;; appearance.
    67 ;;; ----------------------------------------------------------------
       
    68 ;;; appearance.
    68 
    69 
    69 (setq default-directory "~/")
    70 (setq default-directory "~/")
    70 
    71 
    71 ;; To maximize frame on full screen, not work with Windows Emacs 21.4.
    72 ;; To maximize frame on full screen, not work with Windows Emacs 21.4.
    72 ;; And maked different height with Emacs 22.3 and 23.1.
    73 ;; And maked different height with Emacs 22.3 and 23.1.
   145 )
   146 )
   146 
   147 
   147 ;; See what I am typing immediately (for keystroke in minibuffer).
   148 ;; See what I am typing immediately (for keystroke in minibuffer).
   148 (setq echo-keystrokes 0.2)
   149 (setq echo-keystrokes 0.2)
   149 
   150 
   150 ;; ----------------------------------------------------------------------
   151 ;;; ----------------------------------------------------------------
   151 ;; silent runing.
   152 ;;; silent runing.
   152 
   153 
   153 ;; (setq inhibit-splash-screen t) ; nonexist on 21.4.1
   154 ;; (setq inhibit-splash-screen t) ; nonexist on 21.4.1
   154 (setq inhibit-startup-message t)
   155 (setq inhibit-startup-message t)
   155 
   156 
   156 ;; ----------------------------------------------------------------------
   157 ;;; ----------------------------------------------------------------
   157 ;; whitespaces.
   158 ;;; whitespaces.
   158 
   159 
   159 (setq default-indicate-empty-lines t)
   160 (setq default-indicate-empty-lines t)
   160 (setq default-indicate-buffer-boundaries 'left)
   161 (setq default-indicate-buffer-boundaries 'left)
   161 
   162 
   162 (setq-default show-trailing-whitespace t)
   163 (setq-default show-trailing-whitespace t)
   164 (setq next-line-add-newlines nil)
   165 (setq next-line-add-newlines nil)
   165 
   166 
   166 ;; See also 'mode-require-final-newline'.
   167 ;; See also 'mode-require-final-newline'.
   167 (add-hook 'text-mode-hook (lambda () (setq require-final-newline nil)))
   168 (add-hook 'text-mode-hook (lambda () (setq require-final-newline nil)))
   168 
   169 
   169 ;; ======================================================================
   170 ;;; ----------------------------------------------------------------
   170 ;; gnu serv, server.
   171 ;;; gnu serv, server.
   171 
   172 
   172 ;; (load "~/emacs/bin/gnuserv/gnuserv.el")
   173 ;; (load "~/emacs/bin/gnuserv/gnuserv.el")
   173 ;; (require 'gnuserv)
   174 ;; (require 'gnuserv)
   174 ;; (setq gnuserv-frame (selected-frame))
   175 ;; (setq gnuserv-frame (selected-frame))
   175 
   176 
   181   )
   182   )
   182 
   183 
   183 ;; (desktop-load-default)
   184 ;; (desktop-load-default)
   184 ;; (desktop-read)
   185 ;; (desktop-read)
   185 
   186 
   186 ;; ======================================================================
   187 ;;; ----------------------------------------------------------------
   187 ;; standart/general settings.
   188 ;;; standart/general settings.
   188 
   189 
   189 (if (boundp 'confirm-kill-emacs)
   190 (if (boundp 'confirm-kill-emacs)
   190     (setq confirm-kill-emacs 'yes-or-no-p))
   191     (setq confirm-kill-emacs 'yes-or-no-p))
   191 
   192 
   192 ;; Try to speed things up, especially in VM.
   193 ;; Try to speed things up, especially in VM.
   227 (setq
   228 (setq
   228  use-dialog-box t
   229  use-dialog-box t
   229  x-gtk-show-hidden-files t
   230  x-gtk-show-hidden-files t
   230  )
   231  )
   231 
   232 
   232 ;; ----------------------------------------------------------------------
   233 ;;; ----------------------------------------------------------------
   233 ;; switching, creating, selecting buffers.
   234 ;;; switching, creating, selecting buffers.
   234 
   235 
   235 (iswitchb-mode 1)
   236 (iswitchb-mode 1)
   236 (setq iswitchb-buffer-ignore nil)
   237 (setq iswitchb-buffer-ignore nil)
   237 (mapc (lambda (arg) (add-to-list 'iswitchb-buffer-ignore arg))
   238 (mapc (lambda (arg) (add-to-list 'iswitchb-buffer-ignore arg))
   238         '("^ "
   239         '("^ "
   249 (setq uniquify-buffer-name-style 'post-forward)
   250 (setq uniquify-buffer-name-style 'post-forward)
   250 
   251 
   251 ;; buffer-menu better then buffer-list, but ibuffer much better.
   252 ;; buffer-menu better then buffer-list, but ibuffer much better.
   252 (global-set-key "\C-x\C-b" 'ibuffer)
   253 (global-set-key "\C-x\C-b" 'ibuffer)
   253 
   254 
   254 ;; ----------------------------------------------------------------------
   255 ;;; ----------------------------------------------------------------
   255 ;; scrolling.
   256 ;;; scrolling.
   256 
   257 
   257 (defvar my-scroll-margin 4)
   258 (defvar my-scroll-margin 4)
   258 
   259 
   259 (setq-default
   260 (setq-default
   260  scroll-step 1
   261  scroll-step 1
   266 (make-variable-buffer-local 'scroll-margin)
   267 (make-variable-buffer-local 'scroll-margin)
   267 (mapc (lambda (hook) (add-hook hook (lambda nil (setq scroll-margin my-scroll-margin))))
   268 (mapc (lambda (hook) (add-hook hook (lambda nil (setq scroll-margin my-scroll-margin))))
   268       ;; TODO its good invoke delete-dups for list, but delete-dups not exist in Emacs 21.4
   269       ;; TODO its good invoke delete-dups for list, but delete-dups not exist in Emacs 21.4
   269       (append my-text-mode-hook-list my-devel-mode-hook-list my-scroll-margin-mode-hook-list) )
   270       (append my-text-mode-hook-list my-devel-mode-hook-list my-scroll-margin-mode-hook-list) )
   270 
   271 
   271 ;; ----------------------------------------------------------------------
   272 ;;; ----------------------------------------------------------------
   272 ;; search, isearch, occur.
   273 ;;; search, isearch, occur.
   273 
   274 
   274 (setq case-fold-search t)
   275 (setq case-fold-search t)
   275 
   276 
   276 (setq query-replace-highlight t)        ; highlight during query
   277 (setq query-replace-highlight t)        ; highlight during query
   277 (setq search-highlight t)               ; highlight incremental search
   278 (setq search-highlight t)               ; highlight incremental search
   278 
   279 
   279 ;; ----------------------------------------------------------------------
   280 ;;; ----------------------------------------------------------------
   280 ;; grep, find.
   281 ;;; grep, find.
   281 
   282 
   282 ;; This settings have effect from Emacs 22.x.
   283 ;; This settings have effect from Emacs 22.x.
   283 (when (eq system-type 'windows-nt)
   284 (when (eq system-type 'windows-nt)
   284   ;; Workaround for Cygwin shell, when set 'CYGWIN=noglob'. By default 'shell-quote-argument'
   285   ;; Workaround for Cygwin shell, when set 'CYGWIN=noglob'. By default 'shell-quote-argument'
   285   ;; quoted by double '\' chars this cause failure.
   286   ;; quoted by double '\' chars this cause failure.
   294 (setq grep-highlight-matches nil)
   295 (setq grep-highlight-matches nil)
   295 (setq grep-use-null-device nil)
   296 (setq grep-use-null-device nil)
   296 
   297 
   297 (global-set-key [M-f7] 'rgrep)
   298 (global-set-key [M-f7] 'rgrep)
   298 
   299 
   299 ;; ----------------------------------------------------------------------
   300 ;;; ----------------------------------------------------------------
   300 ;; syntax highlighting.
   301 ;;; syntax highlighting.
   301 
   302 
   302 (setq font-lock-maximum-decoration t)
   303 (setq font-lock-maximum-decoration t)
   303 (global-font-lock-mode 1)
   304 (global-font-lock-mode 1)
   304 
   305 
   305 ;; ----------------------------------------------------------------------
   306 ;;; ----------------------------------------------------------------
   306 ;; highlight selected text.
   307 ;;; highlight selected text.
   307 
   308 
   308 ;; 1/-1, when the mark is active, the region is highlighted.
   309 ;; 1/-1, when the mark is active, the region is highlighted.
   309 (transient-mark-mode 1)
   310 (transient-mark-mode 1)
   310 (delete-selection-mode 1)               ; 1/-1
   311 (delete-selection-mode 1)               ; 1/-1
   311 
   312 
   320 
   321 
   321 (when (eq window-system 'x)
   322 (when (eq window-system 'x)
   322   (setq x-select-enable-clipboard t)    ; for Emacs 21.2.1 and newer
   323   (setq x-select-enable-clipboard t)    ; for Emacs 21.2.1 and newer
   323   )
   324   )
   324 
   325 
   325 ;; ----------------------------------------------------------------------
   326 ;;; ----------------------------------------------------------------
   326 ;; highlighting current line.
   327 ;;; highlighting current line.
   327 
   328 
   328 (when window-system
   329 (when window-system
   329   (custom-set-faces '(hl-line ((t (:inherit highlight :background "light yellow")))))
   330   (custom-set-faces '(hl-line ((t (:inherit highlight :background "light yellow")))))
   330   (global-hl-line-mode 1)
   331   (global-hl-line-mode 1)
   331   )
   332   )
   332 
   333 
   333 ;; ----------------------------------------------------------------------
   334 ;;; ----------------------------------------------------------------
   334 ;; paren, braces.
   335 ;;; paren, braces.
   335 
   336 
   336 (show-paren-mode 1) ; Parenthesis matching via highlighting.
   337 (show-paren-mode 1) ; Parenthesis matching via highlighting.
   337 (setq show-paren-style (quote parenthesis))
   338 (setq show-paren-style (quote parenthesis))
   338 
   339 
   339 ;; ======================================================================
   340 ;;; ----------------------------------------------------------------
   340 ;; keyboard, mouse.
   341 ;;; keyboard, mouse.
   341 
   342 
   342 ;; cyrillic-jis-russian  for 567 is :,.
   343 ;; cyrillic-jis-russian  for 567 is :,.
   343 ;; cyrillic-jcuken  for SHIFT 567 is :,.
   344 ;; cyrillic-jcuken  for SHIFT 567 is :,.
   344 ;; russian-computer for SHIFT 567 is %^&
   345 ;; russian-computer for SHIFT 567 is %^&
   345 (if (>= emacs-major-version 22)
   346 (if (>= emacs-major-version 22)
   346     (setq default-input-method 'russian-computer)
   347     (setq default-input-method 'russian-computer)
   347   (setq default-input-method 'cyrillic-jcuken))
   348   (setq default-input-method 'cyrillic-jcuken))
   348 ;; (pc-bindings-mode) ; Myself define keybinding, see
   349 ;; (pc-bindings-mode) ; Myself define keybinding, see
   349 
   350 
   350 ;; ----------------------------------------------------------------------
   351 ;;; ----------------------------------------------------------------
   351 ;; completion.
   352 ;;; completion.
   352 
   353 
   353 ;; I remove partial-completion-mode because it depricated in Emacs 24.0.
   354 ;; I remove partial-completion-mode because it depricated in Emacs 24.0.
   354 ;; Completion controled by 'completion-styles' variable.
   355 ;; Completion controled by 'completion-styles' variable.
   355 
   356 
   356 ;; ----------------------------------------------------------------------
   357 ;;; ----------------------------------------------------------------
   357 ;; mouse.
   358 ;;; mouse.
   358 
   359 
   359 ;; Scroll Bar gets dragged by mouse butn 1
   360 ;; Scroll Bar gets dragged by mouse butn 1
   360 (global-set-key [vertical-scroll-bar down-mouse-1] 'scroll-bar-drag)
   361 (global-set-key [vertical-scroll-bar down-mouse-1] 'scroll-bar-drag)
   361 ;; Paste at point NOT at cursor
   362 ;; Paste at point NOT at cursor
   362 (setq mouse-yank-at-point t)
   363 (setq mouse-yank-at-point t)
   363 (when window-system
   364 (when window-system
   364   (mouse-wheel-mode 1)
   365   (mouse-wheel-mode 1)
   365   )
   366   )
   366 
   367 
   367 ;; ----------------------------------------------------------------------
   368 ;;; ----------------------------------------------------------------
   368 ;; key binding, short-keys.
   369 ;;; key binding, short-keys.
   369 
   370 
   370 (global-set-key [home]    'beginning-of-line)
   371 (global-set-key [home]    'beginning-of-line)
   371 (global-set-key [end]     'end-of-line)
   372 (global-set-key [end]     'end-of-line)
   372 (global-set-key [C-home] 'beginning-of-buffer)
   373 (global-set-key [C-home] 'beginning-of-buffer)
   373 (global-set-key [C-end]  'end-of-buffer)
   374 (global-set-key [C-end]  'end-of-buffer)
   396 (if window-system (global-set-key (kbd "C-z") nil))
   397 (if window-system (global-set-key (kbd "C-z") nil))
   397 (global-set-key (kbd "C-x C-z") nil)
   398 (global-set-key (kbd "C-x C-z") nil)
   398 
   399 
   399 ;; (global-set-key [language-change] 'ignore)
   400 ;; (global-set-key [language-change] 'ignore)
   400 
   401 
   401 ;; ======================================================================
   402 ;;; ----------------------------------------------------------------
   402 ;; coding system, charset, locale, lang.
   403 ;;; coding system, charset, locale, lang.
   403 
   404 
   404 ;; Emacs 23.1 no longer need codepage-setup.
   405 ;; Emacs 23.1 no longer need codepage-setup.
   405 (when (<= emacs-major-version 22)
   406 (when (<= emacs-major-version 22)
   406   (codepage-setup 866)
   407   (codepage-setup 866)
   407   (codepage-setup 1251)
   408   (codepage-setup 1251)
   441 
   442 
   442 ;;; open file, ffap
   443 ;;; open file, ffap
   443 (setq-default save-place t)
   444 (setq-default save-place t)
   444 (require 'saveplace)
   445 (require 'saveplace)
   445 
   446 
   446 ;; ----------------------------------------------------------------------
   447 ;;; ----------------------------------------------------------------
   447 ;; dired.
   448 ;;; dired.
   448 
   449 
   449 (require 'dired)
   450 (require 'dired)
   450 
   451 
   451 ;; I usually mistype "C-x C-f" to "C-x d" or "C-x C-d", so always use find-file,
   452 ;; I usually mistype "C-x C-f" to "C-x d" or "C-x C-d", so always use find-file,
   452 ;; because when file if directory find-file load dired, if regular file open it.
   453 ;; because when file if directory find-file load dired, if regular file open it.
   467     'dired-find-alternate-file)
   468     'dired-find-alternate-file)
   468   (define-key dired-mode-map (kbd "<backspace>")
   469   (define-key dired-mode-map (kbd "<backspace>")
   469     (lambda () (interactive) (find-alternate-file "..")))
   470     (lambda () (interactive) (find-alternate-file "..")))
   470   )
   471   )
   471 
   472 
   472 ;; ----------------------------------------------------------------------
   473 ;;; ----------------------------------------------------------------
   473 ;; compression, archive.
   474 ;;; compression, archive.
   474 
   475 
   475 (require 'jka-compr) ; Automatic decompression, hooks for tar-mode.
   476 (require 'jka-compr) ; Automatic decompression, hooks for tar-mode.
   476 (if (fboundp 'auto-compression-mode)
   477 (if (fboundp 'auto-compression-mode)
   477     (auto-compression-mode 1))
   478     (auto-compression-mode 1))
   478 
   479 
   479 (modify-coding-system-alist 'file "\\.\\(war\\|ear\\|sar\\|egg\\)\\'" 'no-conversion)
   480 (modify-coding-system-alist 'file "\\.\\(war\\|ear\\|sar\\|egg\\)\\'" 'no-conversion)
   480 
   481 
   481 (add-to-list 'auto-mode-alist '("\\.\\(war\\|ear\\|sar\\|egg\\)\\'" . archive-mode))
   482 (add-to-list 'auto-mode-alist '("\\.\\(war\\|ear\\|sar\\|egg\\)\\'" . archive-mode))
   482 
   483 
   483 ;; ----------------------------------------------------------------------
   484 ;;; ----------------------------------------------------------------
   484 ;; image.
   485 ;;; image.
   485 
   486 
   486 (when (fboundp 'auto-image-file-mode)
   487 (when (fboundp 'auto-image-file-mode)
   487   (auto-image-file-mode 1))
   488   (auto-image-file-mode 1))
   488 
   489 
   489 ;; ----------------------------------------------------------------------
   490 ;;; ----------------------------------------------------------------
   490 ;; *Recentf*
   491 ;;; recentf.
   491 
   492 
   492 (require 'recentf)
   493 (require 'recentf)
   493 ;; Prevent TRAMP to login on remote host when loading.
   494 ;; Prevent TRAMP to login on remote host when loading.
   494 ;; Its take time and ask passwords!
   495 ;; Its take time and ask passwords!
   495 (setq recentf-auto-cleanup 'never)
   496 (setq recentf-auto-cleanup 'never)
   496 (recentf-mode t)
   497 (recentf-mode t)
   497 (setq recentf-max-saved-items 1000)
   498 (setq recentf-max-saved-items 1000)
   498 (global-set-key (kbd "\e\eq")  'recentf-open-files)
   499 (global-set-key (kbd "\e\eq")  'recentf-open-files)
   499 
   500 
   500 ;; ----------------------------------------------------------------------
   501 ;;; ----------------------------------------------------------------
   501 ;; revert buffer.
   502 ;;; revert buffer.
   502 
   503 
   503 (global-set-key [f5]    'revert-buffer)
   504 (global-set-key [f5]    'revert-buffer)
   504 (setq revert-without-query (quote (".*")))
   505 (setq revert-without-query (quote (".*")))
   505 (setq auto-revert-interval 2)
   506 (setq auto-revert-interval 2)
   506 
   507 
   507 ;; ======================================================================
   508 ;;; ----------------------------------------------------------------
   508 ;; convenient.
   509 ;;; convenient.
   509 
   510 
   510 (defun reglen()
   511 (defun reglen()
   511   "Show region length."
   512   "Show region length."
   512   (interactive)
   513   (interactive)
   513   (message "%s" (- (region-end) (region-beginning))))
   514   (message "%s" (- (region-end) (region-beginning))))
   514 
   515 
   515 ;; ----------------------------------------------------------------------
   516 ;;; ----------------------------------------------------------------
   516 ;; minibuffer.
   517 ;;; minibuffer.
   517 
   518 
   518 (require 'icomplete) ; Interactive completion in minibuffer.
   519 (require 'icomplete) ; Interactive completion in minibuffer.
   519 (icomplete-mode 1)
   520 (icomplete-mode 1)
   520 
   521 
   521 (mapc (lambda (ext) (add-to-list 'completion-ignored-extensions ext))
   522 (mapc (lambda (ext) (add-to-list 'completion-ignored-extensions ext))
   524         ".o" ".obj" ".map" ".lib" ".lo" ".la" ".a" ".bin" ".exe"
   525         ".o" ".obj" ".map" ".lib" ".lo" ".la" ".a" ".bin" ".exe"
   525         ;; Place dir at end to appear at the start of completion-ignored-extensions.
   526         ;; Place dir at end to appear at the start of completion-ignored-extensions.
   526         "CVS/" ".hg/" ".svn/" ".git/" ".bzr/"
   527         "CVS/" ".hg/" ".svn/" ".git/" ".bzr/"
   527         ) )
   528         ) )
   528 
   529 
   529 ;; ----------------------------------------------------------------------
   530 ;;; ----------------------------------------------------------------
   530 ;; music.
   531 ;;; music.
   531 (setq gnus-audio-au-player "winamp.exe"
   532 (setq gnus-audio-au-player "winamp.exe"
   532       gnus-audio-directory "D:\\music"
   533       gnus-audio-directory "D:\\music"
   533       gnus-audio-wav-player "winamp.exe")
   534       gnus-audio-wav-player "winamp.exe")
   534 
   535 
   535 ;; ----------------------------------------------------------------------
   536 ;;; ----------------------------------------------------------------
   536 ;; browser.
   537 ;;; browser.
   537 
   538 
   538 (cond
   539 (cond
   539  ((equal window-system 'w32)
   540  ((equal window-system 'w32)
   540   (setq browse-url-browser-function 'browse-url-default-windows-browser))
   541   (setq browse-url-browser-function 'browse-url-default-windows-browser))
   541  (t
   542  (t
   542   (setq browse-url-browser-function 'browse-url-mozilla)))
   543   (setq browse-url-browser-function 'browse-url-mozilla)))
   543 
   544 
   544 ;; ----------------------------------------------------------------------
   545 ;;; ----------------------------------------------------------------
   545 ;; calendar.
   546 ;;; calendar.
   546 
   547 
   547 ;; (setq mark-holidays-in-calendar t)
   548 ;; (setq mark-holidays-in-calendar t)
   548 ;; (setq all-christian-calendar-holidays t)
   549 ;; (setq all-christian-calendar-holidays t)
   549 ;; (setq calendar-date-display-form (quote ((format "%04s-%02d-%02d" year (string-to-int month) (string-to-int day)))))
   550 ;; (setq calendar-date-display-form (quote ((format "%04s-%02d-%02d" year (string-to-int month) (string-to-int day)))))
   550 ;; (setq calendar-time-display-form (quote (24-hours ":" minutes (if time-zone " (") time-zone (if time-zone ")"))))
   551 ;; (setq calendar-time-display-form (quote (24-hours ":" minutes (if time-zone " (") time-zone (if time-zone ")"))))
   551 (setq calendar-week-start-day 1)
   552 (setq calendar-week-start-day 1)
   552 (setq european-calendar-style t)
   553 (setq european-calendar-style t)
   553 
   554 
   554 ;; ======================================================================
   555 ;;; ----------------------------------------------------------------
   555 ;;
   556 ;;; STANDARD HOOKS.
   556 ;; STANDARD HOOKS
       
   557 
   557 
   558 (add-hook 'write-file-hooks 'time-stamp)
   558 (add-hook 'write-file-hooks 'time-stamp)
   559 
   559 
   560 ;; ======================================================================
   560 ;;; ----------------------------------------------------------------
   561 ;; *auto-fill*
   561 ;;; auto-fill.
   562 
   562 
   563 (setq-default fill-column 78)
   563 (setq-default fill-column 78)
   564 
   564 
   565 (defvar my-fill-column 100
   565 (defvar my-fill-column 100
   566   "I use greater value then 78 for comment in prog source.")
   566   "I use greater value then 78 for comment in prog source.")
   571 
   571 
   572 ;; Turn on auto-fill mode
   572 ;; Turn on auto-fill mode
   573 (add-hook 'html-mode-hook 'turn-on-auto-fill)
   573 (add-hook 'html-mode-hook 'turn-on-auto-fill)
   574 (add-hook 'text-mode-hook 'turn-on-auto-fill)
   574 (add-hook 'text-mode-hook 'turn-on-auto-fill)
   575 
   575 
   576 ;; ----------------------------------------------------------------------
   576 ;;; ----------------------------------------------------------------
   577 ;; unknown.
   577 ;;; unknown.
   578 
   578 
   579 ;; browse-url mailcrypt gnus message sendmail bbdb pilot bibtex eiffel-mode emacs-w3m
   579 ;; browse-url mailcrypt gnus message sendmail bbdb pilot bibtex eiffel-mode emacs-w3m
   580 ;; eudc filladapt hugs-mode mpg123 php-mode ps-print
   580 ;; eudc filladapt hugs-mode mpg123 php-mode ps-print
   581 ;; chord-mode - edit guitar music
   581 ;; chord-mode - edit guitar music
   582 ;; discography - variant of BibTeX mode for discographies
   582 ;; discography - variant of BibTeX mode for discographies
   583 
   583 
   584 ;; ----------------------------------------------------------------------
   584 ;;; ----------------------------------------------------------------
   585 ;; cacl, calculator.
   585 ;;; cacl, calculator.
   586 
   586 
   587 (setq-default calc-group-digits t)
   587 (setq-default calc-group-digits t)
   588 (setq-default calc-group-char "'")
   588 (setq-default calc-group-char "'")
   589 
   589 
   590 ;; ======================================================================
   590 ;;; ----------------------------------------------------------------
   591 ;; TeX, LaTeX.
   591 ;;; TeX, LaTeX.
   592 
   592 
   593 (setq tex-run-command "initex")
   593 (setq tex-run-command "initex")
   594 
   594 
   595 ;; ----------------------------------------------------------------------
   595 ;;; ----------------------------------------------------------------
   596 ;; AUC TeX.
   596 ;;; AUC TeX.
   597 
   597 
   598 ;(add-hook 'LaTeX-mode-hook 'LaTeX-install-toolbar)
   598 ;(add-hook 'LaTeX-mode-hook 'LaTeX-install-toolbar)
   599 ;; (setq TeX-parse-self t)             ; Enable parse on load.
   599 ;; (setq TeX-parse-self t)             ; Enable parse on load.
   600 ;; (setq TeX-auto-save t)              ; Enable parse on save.
   600 ;; (setq TeX-auto-save t)              ; Enable parse on save.
   601 ;; Query for master file. If you often use \include or \input, you should make AUCTEX aware of the
   601 ;; Query for master file. If you often use \include or \input, you should make AUCTEX aware of the
   627 ;     (add-to-list 'TeX-command-list
   627 ;     (add-to-list 'TeX-command-list
   628 ;         (list "All Texify run-viewer"
   628 ;         (list "All Texify run-viewer"
   629 ;           "texify --tex-opt=--src --run-viewer --clean %s.tex"
   629 ;           "texify --tex-opt=--src --run-viewer --clean %s.tex"
   630 ;           'TeX-run-command nil t))))
   630 ;           'TeX-run-command nil t))))
   631 
   631 
   632 ;; ----------------------------------------------------------------------
   632 ;;; ----------------------------------------------------------------
   633 ;; Reftex activation (Reftex is included with Emacs 21.1).
   633 ;;; reftex.
       
   634 
       
   635 ;; Reftex is included with Emacs 21.1.
   634 
   636 
   635 ;; (autoload 'reftex-mode     "reftex" "RefTeX Minor Mode" t)
   637 ;; (autoload 'reftex-mode     "reftex" "RefTeX Minor Mode" t)
   636 ;; (autoload 'turn-on-reftex  "reftex" "RefTeX Minor Mode" nil)
   638 ;; (autoload 'turn-on-reftex  "reftex" "RefTeX Minor Mode" nil)
   637 ;; (autoload 'reftex-citation "reftex-cite" "Make citation" nil)
   639 ;; (autoload 'reftex-citation "reftex-cite" "Make citation" nil)
   638 ;; (autoload 'reftex-index-phrase-mode "reftex-index" "Phrase mode" t)
   640 ;; (autoload 'reftex-index-phrase-mode "reftex-index" "Phrase mode" t)
   639 ;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex)   ; with AUCTeX LaTeX mode
   641 ;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex)   ; with AUCTeX LaTeX mode
   640 ;; (add-hook 'latex-mode-hook 'turn-on-reftex)   ; with Emacs latex mode
   642 ;; (add-hook 'latex-mode-hook 'turn-on-reftex)   ; with Emacs latex mode
   641 
   643 
   642 ;; ----------------------------------------------------------------------
   644 ;;; ----------------------------------------------------------------
   643 ;; PreviewLatex.
   645 ;;; PreviewLatex.
   644 
   646 
   645 ;(load "preview-latex.el" nil t t)
   647 ;(load "preview-latex.el" nil t t)
   646 
   648 
   647 ;(add-hook 'LaTeX-mode-hook #'LaTeX-preview-setup)
   649 ;(add-hook 'LaTeX-mode-hook #'LaTeX-preview-setup)
   648 ;(autoload 'LaTeX-preview-setup "preview")
   650 ;(autoload 'LaTeX-preview-setup "preview")
   649 
   651 
   650 ;; ======================================================================
   652 ;;; ----------------------------------------------------------------
   651 ;; Info.
   653 ;;; Info.
   652 
   654 
   653 ;; Because of Debian policy documentation covered by FDL license with invariant sections not allowed in packet
   655 ;; Because of Debian policy documentation covered by FDL license with invariant sections not allowed in packet
   654 ;; repository tree. So it must be installed manually. My usual configuration is install user local software
   656 ;; repository tree. So it must be installed manually. My usual configuration is install user local software
   655 ;; into ~/usr DISTDIR.
   657 ;; into ~/usr DISTDIR.
   656 (unless (getenv "INFOPATH")
   658 (unless (getenv "INFOPATH")
   657   (setenv "INFOPATH" "~/usr/share/info:"))
   659   (setenv "INFOPATH" "~/usr/share/info:"))
   658 
   660 
   659 ;; ======================================================================
   661 ;;; ----------------------------------------------------------------
   660 ;; man, woman.
   662 ;;; man, woman.
   661 
   663 
   662 (setq woman-use-own-frame nil)
   664 (setq woman-use-own-frame nil)
   663 (setq woman-fill-frame t)
   665 (setq woman-fill-frame t)
   664 
   666 
   665 ;; ----------------------------------------------------------------------
   667 ;;; ----------------------------------------------------------------
   666 ;; comint
   668 ;;; comint.
   667 
   669 
   668 ;; If non-nil, add a `/' to completed directories, ` ' to file names.
   670 ;; If non-nil, add a `/' to completed directories, ` ' to file names.
   669 (setq comint-completion-addsuffix t)
   671 (setq comint-completion-addsuffix t)
   670 ;; Non-nil means go to the end of the line before sending input.
   672 ;; Non-nil means go to the end of the line before sending input.
   671 (setq comint-eol-on-send t)
   673 (setq comint-eol-on-send t)
   672 
   674 
   673 ;; ======================================================================
   675 ;;; ----------------------------------------------------------------
   674 ;; shell, sh, bash.
   676 ;;; shell, sh, bash.
   675 
   677 
   676 ;; Setup Emacs to run bash as its primary shell.
   678 ;; Setup Emacs to run bash as its primary shell.
   677 ;; (setq binary-process-input t)
   679 ;; (setq binary-process-input t)
   678 ;; (setq shell-file-name "bash")
   680 ;; (setq shell-file-name "bash")
   679 ;; (setq shell-command-switch "-c")
   681 ;; (setq shell-command-switch "-c")
   702   ;; (setq explicit-shell-file-name "bash")
   704   ;; (setq explicit-shell-file-name "bash")
   703   (setq explicit-bash-args '("-i"))
   705   (setq explicit-bash-args '("-i"))
   704   (setq explicit-sh-args '("-i"))
   706   (setq explicit-sh-args '("-i"))
   705   )
   707   )
   706 
   708 
   707 ;; ======================================================================
   709 ;;; ----------------------------------------------------------------
   708 ;; spell, ispell, aspell.
   710 ;;; spell, ispell, aspell.
   709 
   711 
   710 ;; Settings for spelling done in '.emacs-autogen'.
   712 ;; Settings for spelling done in '.emacs-autogen'.
   711 ;(add-hook 'text-mode-hook 'flyspell-mode)
   713 ;(add-hook 'text-mode-hook 'flyspell-mode)
   712 ;(setq flyspell-default-dictionary "russianw")
   714 ;(setq flyspell-default-dictionary "russianw")
   713 ;(setq flyspell-delay '1)
   715 ;(setq flyspell-delay '1)
   714 
   716 
   715 ;; ======================================================================
   717 ;;; ----------------------------------------------------------------
   716 ;; GTD, PIM, organize, todo mode.
   718 ;;; GTD, PIM, organize, todo mode.
   717 
   719 
   718 ;; ----------------------------------------------------------------------
   720 ;;; ----------------------------------------------------------------
   719 ;; org-mode.
   721 ;;; org-mode.
   720 
   722 
   721 (if (>= emacs-major-version 22)
   723 (if (>= emacs-major-version 22)
   722 (progn
   724 (progn
   723   (require 'org)
   725   (require 'org)
   724   ))
   726   ))
   742             org-tags-column 64
   744             org-tags-column 64
   743             )
   745             )
   744       (define-key global-map "\C-ca" 'org-agenda)
   746       (define-key global-map "\C-ca" 'org-agenda)
   745       (setq org-agenda-files '("~/.gtd/todo.org")) ))
   747       (setq org-agenda-files '("~/.gtd/todo.org")) ))
   746 
   748 
   747 ;; ----------------------------------------------------------------------
   749 ;;; ----------------------------------------------------------------
   748 ;; remember-mode.
   750 ;;; remember-mode.
   749 
   751 
   750 (if (or (featurep 'remember) (fboundp 'remember))
   752 (if (or (featurep 'remember) (fboundp 'remember))
   751     (progn
   753     (progn
   752       (setq remember-annotation-functions '(org-remember-annotation))
   754       (setq remember-annotation-functions '(org-remember-annotation))
   753       (setq remember-handler-functions '(org-remember-handler))
   755       (setq remember-handler-functions '(org-remember-handler))
   760               ))
   762               ))
   761       (setq
   763       (setq
   762        org-remember-store-without-prompt t
   764        org-remember-store-without-prompt t
   763        ) ))
   765        ) ))
   764 
   766 
   765 ;; ----------------------------------------------------------------------
   767 ;;; ----------------------------------------------------------------------
   766 ;; TODO, XXX, FIXME highlight.
   768 ;;; TODO, XXX, FIXME highlight.
   767 ;; Show blanks and FIXME
   769 ;; Show blanks and FIXME
   768 ;; http://www.emacswiki.org/cgi-bin/wiki/EightyColumnRule
   770 ;; http://www.emacswiki.org/cgi-bin/wiki/EightyColumnRule
   769 
   771 
   770 (defface my-tab-face
   772 (defface my-tab-face
   771   '((t :background "gray"))
   773   '((t :background "gray"))
   794 ;;                 emacs-lisp-mode))
   796 ;;                 emacs-lisp-mode))
   795 ;;   (font-lock-add-keywords mode
   797 ;;   (font-lock-add-keywords mode
   796 ;;                           '(("\\(XXX\\|FIXME\\|TODO\\)"
   798 ;;                           '(("\\(XXX\\|FIXME\\|TODO\\)"
   797 ;;                              1 font-lock-warning-face prepend))))
   799 ;;                              1 font-lock-warning-face prepend))))
   798 
   800 
   799 ;; ======================================================================
   801 ;;; ----------------------------------------------------------------
   800 ;; communication
   802 ;;; communication.
   801 
   803 
   802 ;; ----------------------------------------------------------------------
   804 ;;; ----------------------------------------------------------------
   803 ;; jabber.
   805 ;;; jabber.
   804 
   806 
   805 (when (featurep 'jabber)
   807 (when (featurep 'jabber)
   806   (setq
   808   (setq
   807    jabber-history-enabled t
   809    jabber-history-enabled t
   808    jabber-use-global-history nil
   810    jabber-use-global-history nil
   825 ;; fsm used in emacs jabber
   827 ;; fsm used in emacs jabber
   826 (when (featurep 'fsm)
   828 (when (featurep 'fsm)
   827   (setq fsm-debug nil)                  ; Disable *fsm-debug* buffer.
   829   (setq fsm-debug nil)                  ; Disable *fsm-debug* buffer.
   828   )
   830   )
   829 
   831 
   830 ;; ----------------------------------------------------------------------
   832 ;;; ----------------------------------------------------------------
   831 ;; rcirc.
   833 ;;; rcirc.
   832 
   834 
   833 ;; Turn on logging everything to a special buffer, for debugging.
   835 ;; Turn on logging everything to a special buffer, for debugging.
   834 ;; (setq rcirc-debug-flag t)
   836 ;; (setq rcirc-debug-flag t)
   835 
   837 
   836 (add-hook 'rcirc-mode-hook (lambda () (rcirc-track-minor-mode 1)))
   838 (add-hook 'rcirc-mode-hook (lambda () (rcirc-track-minor-mode 1)))
   837 (setq rcirc-time-format "%H:%M ")
   839 (setq rcirc-time-format "%H:%M ")
   838 (defun rcirc-handler-301 (process cmd sender args)
   840 (defun rcirc-handler-301 (process cmd sender args)
   839   "/away message handler.")
   841   "/away message handler.")
   840 
   842 
   841 ;; ----------------------------------------------------------------------
   843 ;;; ----------------------------------------------------------------
   842 ;; erc.
   844 ;;; erc.
   843 
   845 
   844 ;; Take off noise message.
   846 ;; Take off noise message.
   845 (setq erc-track-exclude-types '("JOIN" "PART" "QUIT" "NICK" "MODE"))
   847 (setq erc-track-exclude-types '("JOIN" "PART" "QUIT" "NICK" "MODE"))
   846 
   848 
   847 (setq erc-current-nick-highlight-type 'nick-or-keyword)
   849 (setq erc-current-nick-highlight-type 'nick-or-keyword)
   848 (setq erc-track-use-faces t)
   850 (setq erc-track-use-faces t)
   849 
   851 
   850 (setq erc-server-coding-system 'utf-8)
   852 (setq erc-server-coding-system 'utf-8)
   851 
   853 
   852 ;; ======================================================================
   854 ;;; ----------------------------------------------------------------
   853 ;; VCS, version control, cvs, svn, mercurial, hg, bazaar, bzr, git, fossil.
   855 ;;; VCS, version control, cvs, svn, mercurial, hg, bazaar, bzr, git, fossil.
   854 
   856 
   855 (if (equal window-system 'w32)
   857 (if (equal window-system 'w32)
   856     (progn
   858     (progn
   857       (modify-coding-system-alist 'process "cvs" '(cp1251-dos . cp1251-dos))
   859       (modify-coding-system-alist 'process "cvs" '(cp1251-dos . cp1251-dos))
   858       (modify-coding-system-alist 'process "svn" '(cp1251 . cp1251))
   860       (modify-coding-system-alist 'process "svn" '(cp1251 . cp1251))
   885          (340 . "#1A00D3")
   887          (340 . "#1A00D3")
   886          (360 . "#0D80E0")))
   888          (360 . "#0D80E0")))
   887       )
   889       )
   888   )
   890   )
   889 
   891 
   890 ;; ----------------------------------------------------------------------
   892 ;;; ----------------------------------------------------------------
   891 ;; psvn.
   893 ;;; psvn.
   892 
   894 
   893 (setq svn-status-verbose t)
   895 (setq svn-status-verbose t)
   894 (setq svn-status-hide-unmodified t)
   896 (setq svn-status-hide-unmodified t)
   895 
   897 
   896 ;; ----------------------------------------------------------------------
   898 ;;; ----------------------------------------------------------------
   897 ;; DVC.
   899 ;;; DVC.
   898 
   900 
   899 (when (featurep 'dvc-emacs)
   901 (when (featurep 'dvc-emacs)
   900   (setq dvc-tips-enabled nil)
   902   (setq dvc-tips-enabled nil)
   901   )
   903   )
   902 
   904 
   903 ;; ======================================================================
   905 ;;; ----------------------------------------------------------------
   904 ;; devel, prog, programming.
   906 ;;; devel, prog, programming.
   905 
   907 
   906 (add-to-list 'auto-mode-alist '("\\.cu$" . c-mode))
   908 (add-to-list 'auto-mode-alist '("\\.cu$" . c-mode))
   907 
   909 
   908 (setq-default comment-style (quote indent))
   910 (setq-default comment-style (quote indent))
   909 (setq-default comment-column 44)
   911 (setq-default comment-column 44)
   910 (setq-default comment-fill-column my-fill-column)
   912 (setq-default comment-fill-column my-fill-column)
   911 
   913 
   912 (mapc (lambda (hook) (add-hook hook (lambda () (setq fill-column my-fill-column)) ))
   914 (mapc (lambda (hook) (add-hook hook (lambda () (setq fill-column my-fill-column)) ))
   913       my-devel-mode-hook-list)
   915       my-devel-mode-hook-list)
   914 
   916 
   915 ;; ----------------------------------------------------------------------
   917 ;;; ----------------------------------------------------------------
   916 ;; diff, patch, ediff, emerge.
   918 ;;; diff, patch, ediff, emerge.
   917 
   919 
   918 (setq diff-switches "-u")
   920 (setq diff-switches "-u")
   919 
   921 
   920 (setq ediff-diff-options "")
   922 (setq ediff-diff-options "")
   921 
   923 
   922 ;; ----------------------------------------------------------------------
   924 ;;; ----------------------------------------------------------------
   923 ;; indenting.
   925 ;;; indenting.
   924 
   926 
   925 (setq standard-indent 4)
   927 (setq standard-indent 4)
   926 (setq c-basic-offset 4)
   928 (setq c-basic-offset 4)
   927 (setq sh-basic-offset 2)
   929 (setq sh-basic-offset 2)
   928 (setq sgml-basic-offset 4)
   930 (setq sgml-basic-offset 4)
   937   (setq tab-stop-list nil)
   939   (setq tab-stop-list nil)
   938   (while (>= i 0)
   940   (while (>= i 0)
   939     (setq tab-stop-list (cons i tab-stop-list))
   941     (setq tab-stop-list (cons i tab-stop-list))
   940     (setq i (- i 4))))
   942     (setq i (- i 4))))
   941 
   943 
   942 ;; ----------------------------------------------------------------------
   944 ;;; ----------------------------------------------------------------
   943 ;; *Compile*
   945 ;;; compile.
   944 
   946 
   945 (setq compile-auto-highlight t
   947 (setq compile-auto-highlight t
   946       compile-command "make ")
   948       compile-command "make ")
   947 ;; compilation window shall scroll down if not 0
   949 ;; compilation window shall scroll down if not 0
   948 (setq compilation-scroll-output 1)
   950 (setq compilation-scroll-output 1)
   954 (add-to-list 'compilation-error-regexp-alist '("^ *\\(.*\\)(\\([0-9]*\\)) +:" 1 2))
   956 (add-to-list 'compilation-error-regexp-alist '("^ *\\(.*\\)(\\([0-9]*\\)) +:" 1 2))
   955 (add-to-list 'compilation-error-regexp-alist '("^\"?\\([^\"]*\\)\"?,\\([0-9]*\\) .*\\[.*\\]: " 1 2)) ; KEIL compiler
   957 (add-to-list 'compilation-error-regexp-alist '("^\"?\\([^\"]*\\)\"?,\\([0-9]*\\) .*\\[.*\\]: " 1 2)) ; KEIL compiler
   956 ;; (add-to-list 'compilation-mode-font-lock-keywords '("\\(/[Oo][Uu][Tt]:[^ 	]+\\)" . 1))
   958 ;; (add-to-list 'compilation-mode-font-lock-keywords '("\\(/[Oo][Uu][Tt]:[^ 	]+\\)" . 1))
   957 ;; (add-to-list 'compilation-mode-font-lock-keywords '("[ 	]\\(/F[oe][^ 	]+\\)" . 1))
   959 ;; (add-to-list 'compilation-mode-font-lock-keywords '("[ 	]\\(/F[oe][^ 	]+\\)" . 1))
   958 
   960 
   959 ;; ----------------------------------------------------------------------
   961 ;;; ----------------------------------------------------------------
   960 ;; TAGS, etags, ctags, GNU GLOBAL.
   962 ;;; TAGS, etags, ctags, GNU GLOBAL.
   961 
   963 
   962 (when (featurep 'etags-table)
   964 (when (featurep 'etags-table)
   963   (setq etags-table-search-up-depth 1)
   965   (setq etags-table-search-up-depth 1)
   964   )
   966   )
   965 
   967 
   966 ;; ----------------------------------------------------------------------
   968 ;;; ----------------------------------------------------------------
   967 ;; CEDET, semantic.
   969 ;;; CEDET, semantic.
   968 
   970 
   969 ;; For debug use 'semantic-debug-idle-function' and 'semantic-debug-idle-work-function'.
   971 ;; For debug use 'semantic-debug-idle-function' and 'semantic-debug-idle-work-function'.
   970 
   972 
   971 (unless (featurep 'cedet)
   973 (unless (featurep 'cedet)
   972   (when (or (and (= emacs-major-version 23) (= emacs-minor-version 2)) (>= emacs-minor-version 24))
   974   (when (or (and (= emacs-major-version 23) (= emacs-minor-version 2)) (>= emacs-minor-version 24))
  1000   (global-set-key (kbd "C-c , d") 'semantic-ia-show-doc)
  1002   (global-set-key (kbd "C-c , d") 'semantic-ia-show-doc)
  1001   (global-set-key (kbd "C-c , D") 'semantic-ia-describe-class)
  1003   (global-set-key (kbd "C-c , D") 'semantic-ia-describe-class)
  1002   (global-set-key (kbd "C-c , c") 'semantic-ia-complete-symbol-menu)
  1004   (global-set-key (kbd "C-c , c") 'semantic-ia-complete-symbol-menu)
  1003   )
  1005   )
  1004 
  1006 
  1005 ;; ----------------------------------------------------------------------
  1007 ;;; ----------------------------------------------------------------
  1006 ;; imenu.
  1008 ;;; imenu.
  1007 
  1009 
  1008 (require 'imenu)
  1010 (require 'imenu)
  1009 (when window-system
  1011 (when window-system
  1010   (mapc (lambda (hook)
  1012   (mapc (lambda (hook)
  1011           (add-hook hook
  1013           (add-hook hook
  1014                       (run-hooks 'menu-bar-update-hook)
  1016                       (run-hooks 'menu-bar-update-hook)
  1015                       ) ))
  1017                       ) ))
  1016         my-devel-mode-hook-list)
  1018         my-devel-mode-hook-list)
  1017   )
  1019   )
  1018 
  1020 
  1019 ;; ----------------------------------------------------------------------
  1021 ;;; ----------------------------------------------------------------
  1020 ;; windows inf files for driver installing
  1022 ;;; windows inf files for driver installing
  1021 
  1023 
  1022 (add-to-list 'auto-mode-alist '("\\.inf\\'" . conf-mode))
  1024 (add-to-list 'auto-mode-alist '("\\.inf\\'" . conf-mode))
  1023 
  1025 
  1024 ;; ----------------------------------------------------------------------
  1026 ;;; ----------------------------------------------------------------
  1025 ;; makefile, make.
  1027 ;;; makefile, make.
  1026 
  1028 
  1027 (add-to-list 'auto-mode-alist '("\\(Makefile\\|Makefile\\..+\\)\\'" . makefile-gmake-mode))
  1029 (add-to-list 'auto-mode-alist '("\\(Makefile\\|Makefile\\..+\\)\\'" . makefile-gmake-mode))
  1028 
  1030 
  1029 ;; ----------------------------------------------------------------------
  1031 ;;; ----------------------------------------------------------------
  1030 ;; asm, assembler.
  1032 ;;; asm, assembler.
  1031 
  1033 
  1032 ;; (setq-default asm-comment-char 59)
  1034 ;; (setq-default asm-comment-char 59)
  1033 (add-hook 'asm-mode-hook '(lambda () (setq comment-start "/*") (setq comment-end "*/")) t)
  1035 (add-hook 'asm-mode-hook '(lambda () (setq comment-start "/*") (setq comment-end "*/")) t)
  1034 
  1036 
  1035 (add-to-list 'auto-mode-alist '("\\.\\([sS]79\\|[sS]\\)\\'" . asm-mode))
  1037 (add-to-list 'auto-mode-alist '("\\.\\([sS]79\\|[sS]\\)\\'" . asm-mode))
  1036 
  1038 
  1037 ;; (add-hook 'asm-mode-hook '(lambda () (local-unset-key ":")))
  1039 ;; (add-hook 'asm-mode-hook '(lambda () (local-unset-key ":")))
  1038 ;; (add-hook 'asm-mode-hook '(lambda () (local-set-key ":" ":")))
  1040 ;; (add-hook 'asm-mode-hook '(lambda () (local-set-key ":" ":")))
  1039 
  1041 
  1040 ;; ----------------------------------------------------------------------
  1042 ;;; ----------------------------------------------------------------
  1041 ;; linker.
  1043 ;;; linker.
  1042 
  1044 
  1043 (when (fboundp 'iar-linker-config-mode)
  1045 (when (fboundp 'iar-linker-config-mode)
  1044   (add-to-list 'auto-mode-alist '("\\.icf\\'" . iar-linker-config-mode))
  1046   (add-to-list 'auto-mode-alist '("\\.icf\\'" . iar-linker-config-mode))
  1045   )
  1047   )
  1046 (when (fboundp 'iar4-linker-config-mode)
  1048 (when (fboundp 'iar4-linker-config-mode)
  1047   (add-to-list 'auto-mode-alist '("\\.xcl\\'" . iar4-linker-config-mode))
  1049   (add-to-list 'auto-mode-alist '("\\.xcl\\'" . iar4-linker-config-mode))
  1048   )
  1050   )
  1049 
  1051 
  1050 ;; ----------------------------------------------------------------------
  1052 ;;; ----------------------------------------------------------------
  1051 ;; lisp.
  1053 ;;; lisp.
  1052 
  1054 
  1053 (setq list-command-history-max 256)
  1055 (setq list-command-history-max 256)
  1054 
  1056 
  1055 ;; ----------------------------------------------------------------------
  1057 ;;; ----------------------------------------------------------------
  1056 ;; C, c-mode, C++, c++-mode.
  1058 ;;; C, c-mode, C++, c++-mode.
  1057 
  1059 
  1058 (setq c-echo-syntactic-information-p t)
  1060 (setq c-echo-syntactic-information-p t)
  1059 (add-hook 'c-mode-common-hook
  1061 (add-hook 'c-mode-common-hook
  1060  (lambda ()
  1062  (lambda ()
  1061    ;; Automatically inserte newlines after special characters such as brace, comma, semi-colon, and colon.
  1063    ;; Automatically inserte newlines after special characters such as brace, comma, semi-colon, and colon.
  1120             (other . "my")
  1122             (other . "my")
  1121             ))
  1123             ))
  1122     ))
  1124     ))
  1123 
  1125 
  1124 
  1126 
  1125 ;; ----------------------------------------------------------------------
  1127 ;;; ----------------------------------------------------------------
  1126 ;; bat file, batch, loaded from 'generic-x.el'.
  1128 ;;; bat file, batch.
  1127 
  1129 
  1128 ;; ----------------------------------------------------------------------
  1130 ;; loaded from 'generic-x.el'
  1129 ;; nsis-mode.
  1131 
       
  1132 ;;; ----------------------------------------------------------------
       
  1133 ;;; nsis-mode.
  1130 
  1134 
  1131 (when (fboundp 'nsis-mode)
  1135 (when (fboundp 'nsis-mode)
  1132   (add-to-list 'auto-mode-alist '("\\.\\(nsi\\|nsh\\)\\'" . nsis-mode))
  1136   (add-to-list 'auto-mode-alist '("\\.\\(nsi\\|nsh\\)\\'" . nsis-mode))
  1133   )
  1137   )
  1134 
  1138 
  1135 ;; ----------------------------------------------------------------------
  1139 ;;; ----------------------------------------------------------------
  1136 ;; *csharp*, c-sharp.
  1140 ;;; csharp, c-sharp.
  1137 
  1141 
  1138 (autoload 'csharp-mode "csharp-mode" "Major mode for editing C# code." t)
  1142 (autoload 'csharp-mode "csharp-mode" "Major mode for editing C# code." t)
  1139 (add-to-list 'auto-mode-alist '("\\.cs$" . csharp-mode))
  1143 (add-to-list 'auto-mode-alist '("\\.cs$" . csharp-mode))
  1140 
  1144 
  1141 ;; ----------------------------------------------------------------------
  1145 ;;; ----------------------------------------------------------------
  1142 ;; java.
  1146 ;;; java.
  1143 
  1147 
  1144 ;; If you want Emacs to defer loading the JDE until you open a Java file, edit
  1148 ;; If you want Emacs to defer loading the JDE until you open a Java file, edit
  1145 ;; the following line:
  1149 ;; the following line:
  1146 
  1150 
  1147 ;; (setq defer-loading-jde t)
  1151 ;; (setq defer-loading-jde t)
  1149 ;;     (progn
  1153 ;;     (progn
  1150 ;;       (autoload 'jde-mode "jde" "JDE mode." t)
  1154 ;;       (autoload 'jde-mode "jde" "JDE mode." t)
  1151 ;;       (add-to-list 'auto-mode-alist '("\\.java\\'" . jde-mode))
  1155 ;;       (add-to-list 'auto-mode-alist '("\\.java\\'" . jde-mode))
  1152 ;;       (require 'jde)))
  1156 ;;       (require 'jde)))
  1153 
  1157 
  1154 ;; ----------------------------------------------------------------------
  1158 ;;; ----------------------------------------------------------------
  1155 ;; ECB.
  1159 ;;; ECB.
  1156 
  1160 
  1157 (setq ecb-tip-of-the-day nil)
  1161 (setq ecb-tip-of-the-day nil)
  1158 
  1162 
  1159 ;; ----------------------------------------------------------------------
  1163 ;;; ----------------------------------------------------------------
  1160 ;; html.
  1164 ;;; html.
  1161 
  1165 
  1162 ;; ----------------------------------------------------------------------
  1166 ;;; ----------------------------------------------------------------
  1163 ;; xml.
  1167 ;;; xml.
  1164 
  1168 
  1165 ;; ----------------------------------------------------------------------
  1169 ;;; ----------------------------------------------------------------
  1166 ;; psgml.
  1170 ;;; psgml.
  1167 
  1171 
  1168 (setq sgml-set-face t)                  ; for highlighting in sgml
  1172 (setq sgml-set-face t)                  ; for highlighting in sgml
  1169 
  1173 
  1170 ;; ----------------------------------------------------------------------
  1174 ;;; ----------------------------------------------------------------
  1171 ;; sh, bash.
  1175 ;;; sh, bash.
  1172 
  1176 
  1173 (add-to-list 'auto-mode-alist '("\\.cygport\\'" . shell-script-mode))
  1177 (add-to-list 'auto-mode-alist '("\\.cygport\\'" . shell-script-mode))
  1174 
  1178 
  1175 ;; ======================================================================
  1179 ;;; ----------------------------------------------------------------
  1176 ;; printing.
  1180 ;;; printing.
  1177 
  1181 
  1178 ;; Use Notepad to print plain text files to the default Windows printer
  1182 ;; Use Notepad to print plain text files to the default Windows printer
  1179 ;(setq lpr-command "notepad")
  1183 ;(setq lpr-command "notepad")
  1180 ;(setq lpr-headers-switches '("/p"))    ; \ mis-use these
  1184 ;(setq lpr-headers-switches '("/p"))    ; \ mis-use these
  1181 ;(setq lpr-switches nil)                ; / two variables
  1185 ;(setq lpr-switches nil)                ; / two variables
  1182 ;(setq printer-name nil)        ; notepad takes the default
  1186 ;(setq printer-name nil)        ; notepad takes the default
  1183 ;(setq lpr-printer-switch "/P") ;; run notepad as batch printer
  1187 ;(setq lpr-printer-switch "/P") ;; run notepad as batch printer
  1184 ;;
  1188 ;;
  1185 
  1189 
  1186 ;; ----------------------------------------------------------------------
  1190 ;; Printing to file.
  1187 ;; printing to file.
       
  1188 
  1191 
  1189 ;(setq printer-name "~/myprint.txt")
  1192 ;(setq printer-name "~/myprint.txt")
  1190 ;(setq ps-printer-name nil)
  1193 ;(setq ps-printer-name nil)
  1191 ;(setq ps-print-header nil)
  1194 ;(setq ps-print-header nil)
  1192 ;;; some more menu entries in the command list:
  1195 ;; some more menu entries in the command list:
  1193 ;;; see tex-mik.el from package auctex: %v is defined in tex-mik.el
  1196 ;; see tex-mik.el from package auctex: %v is defined in tex-mik.el
  1194 ;;; other variables are defined in tex.el from auctex
  1197 ;; other variables are defined in tex.el from auctex
  1195 ;;; the meaning of some auctex-varibles:
  1198 ;; the meaning of some auctex-varibles:
  1196         ;symbols defined in tex.el and tex-mik.el:
  1199         ;symbols defined in tex.el and tex-mik.el:
  1197         ;%b name slave tex-file  %t name master tex-file
  1200         ;%b name slave tex-file  %t name master tex-file
  1198         ;%d dvi-file  %f ps-file
  1201         ;%d dvi-file  %f ps-file
  1199         ;%l "latex --src-specials"
  1202         ;%l "latex --src-specials"
  1200         ;%n line number  %p printcommand  %q "lpq"
  1203         ;%n line number  %p printcommand  %q "lpq"
  1210 ;     (add-to-list 'TeX-command-list
  1213 ;     (add-to-list 'TeX-command-list
  1211 ;         (list "All Texify run-viewer"
  1214 ;         (list "All Texify run-viewer"
  1212 ;           "texify --tex-opt=--src --run-viewer --clean %s.tex"
  1215 ;           "texify --tex-opt=--src --run-viewer --clean %s.tex"
  1213 ;           'TeX-run-command nil t))))
  1216 ;           'TeX-run-command nil t))))
  1214 
  1217 
  1215 ;; ----------------------------------------------------------------
  1218 ;;; ----------------------------------------------------------------
  1216 ;; SQL.
  1219 ;;; SQL.
  1217 
  1220 
  1218 (setq sql-password "")
  1221 (setq sql-password "")
  1219 
  1222 
  1220 ;; ======================================================================
  1223 ;;; ----------------------------------------------------------------
  1221 ;; backuping.
  1224 ;;; backuping.
  1222 
  1225 
  1223 (setq
  1226 (setq
  1224  make-backup-files t
  1227  make-backup-files t
  1225  ;; In other case (by renaming) you loose original file creation date.
  1228  ;; In other case (by renaming) you loose original file creation date.
  1226  backup-by-copying t
  1229  backup-by-copying t
  1228  delete-old-versions t                         ; delete excess backup versions silently
  1231  delete-old-versions t                         ; delete excess backup versions silently
  1229  kept-old-versions 1                           ; store first original version
  1232  kept-old-versions 1                           ; store first original version
  1230  kept-new-versions 3                           ; store last 3 version
  1233  kept-new-versions 3                           ; store last 3 version
  1231  version-control t)                            ; use versioned backups
  1234  version-control t)                            ; use versioned backups
  1232 
  1235 
  1233 ;; ======================================================================
  1236 ;;; ----------------------------------------------------------------
  1234 ;; auto save.
  1237 ;;; auto save.
  1235 
  1238 
  1236 (setq auto-save-default t)
  1239 (setq auto-save-default t)
  1237 ;; If nil autosave to different than original to buffer file.
  1240 ;; If nil autosave to different than original to buffer file.
  1238 (setq auto-save-visited-file-name nil)
  1241 (setq auto-save-visited-file-name nil)
  1239 ;; Note: if you kill unsaved file auto save file not deleted.
  1242 ;; Note: if you kill unsaved file auto save file not deleted.
  1240 (setq delete-auto-save-files t)
  1243 (setq delete-auto-save-files t)
  1241 
  1244 
  1242 ;; ======================================================================
  1245 ;;; ----------------------------------------------------------------
  1243 ;; user info.
  1246 ;;; user info.
  1244 
  1247 
  1245 (setq user-full-name "Oleksandr Gavenko")
  1248 (setq user-full-name "Oleksandr Gavenko")
  1246 (setq user-mail-address "gavenkoa@gmail.com")
  1249 (setq user-mail-address "gavenkoa@gmail.com")
  1247 (setenv "ORGANIZATION" (concat user-full-name " <" user-mail-address  ">"))
  1250 (setenv "ORGANIZATION" (concat user-full-name " <" user-mail-address  ">"))
  1248 
  1251 
  1251             (let ( (mgs-list '("Welcome to emacs, the thermonuclear editor."
  1254             (let ( (mgs-list '("Welcome to emacs, the thermonuclear editor."
  1252                                "You enter to Out Space. Emacs on."
  1255                                "You enter to Out Space. Emacs on."
  1253                                "Nice day for Emacsing!")) )
  1256                                "Nice day for Emacsing!")) )
  1254               (message (nth (random (length mgs-list)) mgs-list)))))
  1257               (message (nth (random (length mgs-list)) mgs-list)))))
  1255 
  1258 
  1256 ;; End loading...
  1259 ;;; End loading...