.emacs-my
changeset 545 24992bae7599
parent 544 4095ef5f1346
child 546 083974006b4a
equal deleted inserted replaced
544:4095ef5f1346 545:24992bae7599
     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 ;;; debugging.
    13 (message "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 ;;; user info.
    22 (message "user info")
    23 
    23 
    24 (setq user-full-name "Oleksandr Gavenko")
    24 (setq user-full-name "Oleksandr Gavenko")
    25 (setq user-mail-address "gavenkoa@gmail.com")
    25 (setq user-mail-address "gavenkoa@gmail.com")
    26 (setq user-nick "gavenkoa")
    26 (setq user-nick "gavenkoa")
    27 (setenv "ORGANIZATION" (concat user-full-name " <" user-mail-address  ">"))
    27 (setenv "ORGANIZATION" (concat user-full-name " <" user-mail-address  ">"))
    28 
    28 
    29 ;;; ----------------------------------------------------------------
    29 ;;; ----------------------------------------------------------------
    30 ;;; mode groups.
    30 (message "mode groups")
    31 
    31 
    32 (defun my-modelist-to-hooklist (modes)
    32 (defun my-modelist-to-hooklist (modes)
    33   "Convert list of MODES to list of hooks for these modes."
    33   "Convert list of MODES to list of hooks for these modes."
    34   (mapcar
    34   (mapcar
    35    (lambda (mode) (intern (concat (symbol-name mode) "-hook")))
    35    (lambda (mode) (intern (concat (symbol-name mode) "-hook")))
    76 (defvar my-text-mode-hook-list
    76 (defvar my-text-mode-hook-list
    77   (my-modelist-to-hooklist my-text-mode-list)
    77   (my-modelist-to-hooklist my-text-mode-list)
    78   "List of text mode hooks.")
    78   "List of text mode hooks.")
    79 
    79 
    80 ;;; ----------------------------------------------------------------
    80 ;;; ----------------------------------------------------------------
    81 ;;; appearance.
    81 (message "appearance")
    82 
    82 
    83 (setq default-directory "~/")
    83 (setq default-directory "~/")
    84 
    84 
    85 ;; To maximize frame on full screen, not work with Windows Emacs 21.4.
    85 ;; To maximize frame on full screen, not work with Windows Emacs 21.4.
    86 ;; And maked different height with Emacs 22.3 and 23.1.
    86 ;; And maked different height with Emacs 22.3 and 23.1.
   162 
   162 
   163 ;; See what I am typing immediately (for keystroke in minibuffer).
   163 ;; See what I am typing immediately (for keystroke in minibuffer).
   164 (setq echo-keystrokes 0.2)
   164 (setq echo-keystrokes 0.2)
   165 
   165 
   166 ;;; ----------------------------------------------------------------
   166 ;;; ----------------------------------------------------------------
   167 ;;; silent runing.
   167 (message "silent runing")
   168 
   168 
   169 ;; (setq inhibit-splash-screen t) ; nonexist on 21.4.1
   169 ;; (setq inhibit-splash-screen t) ; nonexist on 21.4.1
   170 (setq inhibit-startup-message t)
   170 (setq inhibit-startup-message t)
   171 
   171 
   172 ;;; ----------------------------------------------------------------
   172 ;;; ----------------------------------------------------------------
   173 ;;; whitespaces.
   173 (message "whitespaces")
   174 
   174 
   175 (setq default-indicate-empty-lines t)
   175 (setq default-indicate-empty-lines t)
   176 (setq default-indicate-buffer-boundaries 'left)
   176 (setq default-indicate-buffer-boundaries 'left)
   177 
   177 
   178 (setq-default show-trailing-whitespace t)
   178 (setq-default show-trailing-whitespace t)
   181 
   181 
   182 ;; See also 'mode-require-final-newline'.
   182 ;; See also 'mode-require-final-newline'.
   183 (add-hook 'text-mode-hook (lambda () (setq require-final-newline nil)))
   183 (add-hook 'text-mode-hook (lambda () (setq require-final-newline nil)))
   184 
   184 
   185 ;;; ----------------------------------------------------------------
   185 ;;; ----------------------------------------------------------------
   186 ;;; gnu serv, server.
   186 (message "gnu serv, server")
   187 
   187 
   188 ;; (load "~/emacs/bin/gnuserv/gnuserv.el")
   188 ;; (load "~/emacs/bin/gnuserv/gnuserv.el")
   189 ;; (require 'gnuserv)
   189 ;; (require 'gnuserv)
   190 ;; (setq gnuserv-frame (selected-frame))
   190 ;; (setq gnuserv-frame (selected-frame))
   191 
   191 
   198 
   198 
   199 ;; (desktop-load-default)
   199 ;; (desktop-load-default)
   200 ;; (desktop-read)
   200 ;; (desktop-read)
   201 
   201 
   202 ;;; ----------------------------------------------------------------
   202 ;;; ----------------------------------------------------------------
   203 ;;; standart/general settings.
   203 (message "standart/general settings")
   204 
   204 
   205 (if (boundp 'confirm-kill-emacs)
   205 (if (boundp 'confirm-kill-emacs)
   206     (setq confirm-kill-emacs 'yes-or-no-p))
   206     (setq confirm-kill-emacs 'yes-or-no-p))
   207 
   207 
   208 ;; Try to speed things up, especially in VM.
   208 ;; Try to speed things up, especially in VM.
   257  use-dialog-box t
   257  use-dialog-box t
   258  x-gtk-show-hidden-files t
   258  x-gtk-show-hidden-files t
   259  )
   259  )
   260 
   260 
   261 ;;; ----------------------------------------------------------------
   261 ;;; ----------------------------------------------------------------
   262 ;;; switching, creating, selecting buffers.
   262 (message "switching, creating, selecting buffers")
   263 
   263 
   264 (iswitchb-mode 1)
   264 (iswitchb-mode 1)
   265 (setq iswitchb-buffer-ignore
   265 (setq iswitchb-buffer-ignore
   266       '("^ "
   266       '("^ "
   267         "^\*Buffer"
   267         "^\*Buffer"
   277 
   277 
   278 ;; buffer-menu better then buffer-list, but ibuffer much better.
   278 ;; buffer-menu better then buffer-list, but ibuffer much better.
   279 (global-set-key "\C-x\C-b" 'ibuffer)
   279 (global-set-key "\C-x\C-b" 'ibuffer)
   280 
   280 
   281 ;;; ----------------------------------------------------------------
   281 ;;; ----------------------------------------------------------------
   282 ;;; scrolling.
   282 (message "scrolling")
   283 
   283 
   284 (defvar my-scroll-margin 4)
   284 (defvar my-scroll-margin 4)
   285 
   285 
   286 (setq-default
   286 (setq-default
   287  scroll-step 1
   287  scroll-step 1
   294 (mapc (lambda (hook) (add-hook hook (lambda nil (setq scroll-margin my-scroll-margin))))
   294 (mapc (lambda (hook) (add-hook hook (lambda nil (setq scroll-margin my-scroll-margin))))
   295       ;; TODO its good invoke delete-dups for list, but delete-dups not exist in Emacs 21.4
   295       ;; TODO its good invoke delete-dups for list, but delete-dups not exist in Emacs 21.4
   296       (append my-text-mode-hook-list my-devel-mode-hook-list my-scroll-margin-mode-hook-list) )
   296       (append my-text-mode-hook-list my-devel-mode-hook-list my-scroll-margin-mode-hook-list) )
   297 
   297 
   298 ;;; ----------------------------------------------------------------
   298 ;;; ----------------------------------------------------------------
   299 ;;; search, isearch, occur.
   299 (message "search, isearch, occur")
   300 
   300 
   301 (setq case-fold-search t)
   301 (setq case-fold-search t)
   302 
   302 
   303 (setq query-replace-highlight t)        ; highlight during query
   303 (setq query-replace-highlight t)        ; highlight during query
   304 (setq search-highlight t)               ; highlight incremental search
   304 (setq search-highlight t)               ; highlight incremental search
   305 
   305 
   306 ;;; ----------------------------------------------------------------
   306 ;;; ----------------------------------------------------------------
   307 ;;; grep, find.
   307 (message "grep, find")
   308 
   308 
   309 ;; This settings have effect from Emacs 22.x.
   309 ;; This settings have effect from Emacs 22.x.
   310 (when (eq system-type 'windows-nt)
   310 (when (eq system-type 'windows-nt)
   311   ;; Workaround for Cygwin shell, when set 'CYGWIN=noglob'. By default 'shell-quote-argument'
   311   ;; Workaround for Cygwin shell, when set 'CYGWIN=noglob'. By default 'shell-quote-argument'
   312   ;; quoted by double '\' chars this cause failure.
   312   ;; quoted by double '\' chars this cause failure.
   332     ))
   332     ))
   333 
   333 
   334 (global-set-key [M-f7] 'rgrep)
   334 (global-set-key [M-f7] 'rgrep)
   335 
   335 
   336 ;;; ----------------------------------------------------------------
   336 ;;; ----------------------------------------------------------------
   337 ;;; syntax highlighting.
   337 (message "syntax highlighting")
   338 
   338 
   339 (setq font-lock-maximum-decoration t)
   339 (setq font-lock-maximum-decoration t)
   340 (global-font-lock-mode 1)
   340 (global-font-lock-mode 1)
   341 
   341 
   342 ;;; ----------------------------------------------------------------
   342 ;;; ----------------------------------------------------------------
   343 ;;; highlight selected text.
   343 (message "highlight selected text")
   344 
   344 
   345 ;; 1/-1, when the mark is active, the region is highlighted.
   345 ;; 1/-1, when the mark is active, the region is highlighted.
   346 (transient-mark-mode 1)
   346 (transient-mark-mode 1)
   347 (delete-selection-mode 1)               ; 1/-1
   347 (delete-selection-mode 1)               ; 1/-1
   348 
   348 
   358 (when (eq window-system 'x)
   358 (when (eq window-system 'x)
   359   (setq x-select-enable-clipboard t)    ; for Emacs 21.2.1 and newer
   359   (setq x-select-enable-clipboard t)    ; for Emacs 21.2.1 and newer
   360   )
   360   )
   361 
   361 
   362 ;;; ----------------------------------------------------------------
   362 ;;; ----------------------------------------------------------------
   363 ;;; highlighting current line.
   363 (message "highlighting current line")
   364 
   364 
   365 (when window-system
   365 (when window-system
   366   (custom-set-faces '(hl-line ((t (:inherit highlight :background "light yellow")))))
   366   (custom-set-faces '(hl-line ((t (:inherit highlight :background "light yellow")))))
   367   (global-hl-line-mode 1)
   367   (global-hl-line-mode 1)
   368   )
   368   )
   369 
   369 
   370 ;;; ----------------------------------------------------------------
   370 ;;; ----------------------------------------------------------------
   371 ;;; paren, braces.
   371 (message "paren, braces")
   372 
   372 
   373 (show-paren-mode 1) ; Parenthesis matching via highlighting.
   373 (show-paren-mode 1) ; Parenthesis matching via highlighting.
   374 (setq show-paren-style (quote parenthesis))
   374 (setq show-paren-style (quote parenthesis))
   375 
   375 
   376 ;;; ----------------------------------------------------------------
   376 ;;; ----------------------------------------------------------------
   377 ;;; keyboard, mouse.
   377 (message "keyboard, mouse")
   378 
   378 
   379 ;; cyrillic-jis-russian  for 567 is :,.
   379 ;; cyrillic-jis-russian  for 567 is :,.
   380 ;; cyrillic-jcuken  for SHIFT 567 is :,.
   380 ;; cyrillic-jcuken  for SHIFT 567 is :,.
   381 ;; russian-computer for SHIFT 567 is %^&
   381 ;; russian-computer for SHIFT 567 is %^&
   382 (if (>= emacs-major-version 22)
   382 (if (>= emacs-major-version 22)
   383     (setq default-input-method 'russian-computer)
   383     (setq default-input-method 'russian-computer)
   384   (setq default-input-method 'cyrillic-jcuken))
   384   (setq default-input-method 'cyrillic-jcuken))
   385 ;; (pc-bindings-mode) ; Myself define keybinding, see
   385 ;; (pc-bindings-mode) ; Myself define keybinding, see
   386 
   386 
   387 ;;; ----------------------------------------------------------------
   387 ;;; ----------------------------------------------------------------
   388 ;;; completion.
   388 (message "completion")
   389 
   389 
   390 ;; I remove partial-completion-mode because it depricated in Emacs 24.0.
   390 ;; I remove partial-completion-mode because it depricated in Emacs 24.0.
   391 ;; Completion controled by 'completion-styles' variable.
   391 ;; Completion controled by 'completion-styles' variable.
   392 
   392 
   393 ;;; ----------------------------------------------------------------
   393 ;;; ----------------------------------------------------------------
   394 ;;; mouse.
   394 (message "mouse")
   395 
   395 
   396 ;; Scroll Bar gets dragged by mouse butn 1
   396 ;; Scroll Bar gets dragged by mouse butn 1
   397 (global-set-key [vertical-scroll-bar down-mouse-1] 'scroll-bar-drag)
   397 (global-set-key [vertical-scroll-bar down-mouse-1] 'scroll-bar-drag)
   398 ;; Paste at point NOT at cursor
   398 ;; Paste at point NOT at cursor
   399 (setq mouse-yank-at-point t)
   399 (setq mouse-yank-at-point t)
   400 (when window-system
   400 (when window-system
   401   (mouse-wheel-mode 1)
   401   (mouse-wheel-mode 1)
   402   )
   402   )
   403 
   403 
   404 ;;; ----------------------------------------------------------------
   404 ;;; ----------------------------------------------------------------
   405 ;;; key binding, short-keys.
   405 (message "key binding, short-keys")
   406 
   406 
   407 (global-set-key [home]    'beginning-of-line)
   407 (global-set-key [home]    'beginning-of-line)
   408 (global-set-key [end]     'end-of-line)
   408 (global-set-key [end]     'end-of-line)
   409 (global-set-key [C-home] 'beginning-of-buffer)
   409 (global-set-key [C-home] 'beginning-of-buffer)
   410 (global-set-key [C-end]  'end-of-buffer)
   410 (global-set-key [C-end]  'end-of-buffer)
   439   )
   439   )
   440 
   440 
   441 ;; (global-set-key [language-change] 'ignore)
   441 ;; (global-set-key [language-change] 'ignore)
   442 
   442 
   443 ;;; ----------------------------------------------------------------
   443 ;;; ----------------------------------------------------------------
   444 ;;; coding system, charset, locale, lang.
   444 (message "coding system, charset, locale, lang")
   445 
   445 
   446 ;; Emacs 23.1 no longer need codepage-setup.
   446 ;; Emacs 23.1 no longer need codepage-setup.
   447 (when (<= emacs-major-version 22)
   447 (when (<= emacs-major-version 22)
   448   (codepage-setup 866)
   448   (codepage-setup 866)
   449   (codepage-setup 1251)
   449   (codepage-setup 1251)
   480     (modify-coding-system-alist 'process ".*" 'utf-8-unix)
   480     (modify-coding-system-alist 'process ".*" 'utf-8-unix)
   481     ))
   481     ))
   482   )
   482   )
   483 
   483 
   484 ;;; ----------------------------------------------------------------
   484 ;;; ----------------------------------------------------------------
   485 ;;; open file, ffap.
   485 (message "open file, ffap")
   486 (setq-default save-place t)
   486 (setq-default save-place t)
   487 (require 'saveplace)
   487 (require 'saveplace)
   488 
   488 
   489 ;;; ----------------------------------------------------------------
   489 ;;; ----------------------------------------------------------------
   490 ;;; dired.
   490 (message "dired")
   491 
   491 
   492 (require 'dired)
   492 (require 'dired)
   493 
   493 
   494 ;; I usually mistype "C-x C-f" to "C-x d" or "C-x C-d", so always use find-file,
   494 ;; I usually mistype "C-x C-f" to "C-x d" or "C-x C-d", so always use find-file,
   495 ;; because when file if directory find-file load dired, if regular file open it.
   495 ;; because when file if directory find-file load dired, if regular file open it.
   551   )
   551   )
   552 
   552 
   553 (define-key dired-mode-map (kbd "`") 'my-dired-flag-tmp-files)
   553 (define-key dired-mode-map (kbd "`") 'my-dired-flag-tmp-files)
   554 
   554 
   555 ;;; ----------------------------------------------------------------
   555 ;;; ----------------------------------------------------------------
   556 ;;; ls-lisp, dired ls.
   556 (message "ls-lisp, dired ls")
   557 
   557 
   558 ;; If non-nil - use 'insert-directory-program', which I dislike.
   558 ;; If non-nil - use 'insert-directory-program', which I dislike.
   559 (setq ls-lisp-use-insert-directory-program nil)
   559 (setq ls-lisp-use-insert-directory-program nil)
   560 (setq ls-lisp-ignore-case t)
   560 (setq ls-lisp-ignore-case t)
   561 (setq ls-lisp-dirs-first t)
   561 (setq ls-lisp-dirs-first t)
   568       '("%Y-%m-%d %H:%M:%S"
   568       '("%Y-%m-%d %H:%M:%S"
   569         "%Y-%m-%d %H:%M   "))
   569         "%Y-%m-%d %H:%M   "))
   570 (require 'ls-lisp)
   570 (require 'ls-lisp)
   571 
   571 
   572 ;;; ----------------------------------------------------------------
   572 ;;; ----------------------------------------------------------------
   573 ;;; compression, archive.
   573 (message "compression, archive")
   574 
   574 
   575 (require 'jka-compr) ; Automatic decompression, hooks for tar-mode.
   575 (require 'jka-compr) ; Automatic decompression, hooks for tar-mode.
   576 (if (fboundp 'auto-compression-mode)
   576 (if (fboundp 'auto-compression-mode)
   577     (auto-compression-mode 1))
   577     (auto-compression-mode 1))
   578 
   578 
   579 (modify-coding-system-alist 'file "\\.\\(war\\|ear\\|sar\\|egg\\)\\'" 'no-conversion)
   579 (modify-coding-system-alist 'file "\\.\\(war\\|ear\\|sar\\|egg\\)\\'" 'no-conversion)
   580 
   580 
   581 (add-to-list 'auto-mode-alist '("\\.\\(war\\|ear\\|sar\\|egg\\)\\'" . archive-mode))
   581 (add-to-list 'auto-mode-alist '("\\.\\(war\\|ear\\|sar\\|egg\\)\\'" . archive-mode))
   582 
   582 
   583 ;;; ----------------------------------------------------------------
   583 ;;; ----------------------------------------------------------------
   584 ;;; image.
   584 (message "image")
   585 
   585 
   586 (when (fboundp 'auto-image-file-mode)
   586 (when (fboundp 'auto-image-file-mode)
   587   (auto-image-file-mode 1))
   587   (auto-image-file-mode 1))
   588 
   588 
   589 ;;; ----------------------------------------------------------------
   589 ;;; ----------------------------------------------------------------
   590 ;;; recentf.
   590 (message "recentf")
   591 
   591 
   592 (require 'recentf)
   592 (require 'recentf)
   593 ;; Prevent TRAMP to login on remote host when loading.
   593 ;; Prevent TRAMP to login on remote host when loading.
   594 ;; Its take time and ask passwords!
   594 ;; Its take time and ask passwords!
   595 (setq recentf-auto-cleanup 'never)
   595 (setq recentf-auto-cleanup 'never)
   596 (recentf-mode t)
   596 (recentf-mode t)
   597 (setq recentf-max-saved-items 1000)
   597 (setq recentf-max-saved-items 1000)
   598 (global-set-key (kbd "\e\eq")  'recentf-open-files)
   598 (global-set-key (kbd "\e\eq")  'recentf-open-files)
   599 
   599 
   600 ;;; ----------------------------------------------------------------
   600 ;;; ----------------------------------------------------------------
   601 ;;; revert buffer.
   601 (message "revert buffer")
   602 
   602 
   603 (global-set-key [f5]    'revert-buffer)
   603 (global-set-key [f5]    'revert-buffer)
   604 (setq revert-without-query (quote (".*")))
   604 (setq revert-without-query (quote (".*")))
   605 (setq auto-revert-interval 2)
   605 (setq auto-revert-interval 2)
   606 
   606 
   607 ;;; ----------------------------------------------------------------
   607 ;;; ----------------------------------------------------------------
   608 ;;; convenient.
   608 (message "convenient")
   609 
   609 
   610 (defun reglen()
   610 (defun reglen()
   611   "Show region length."
   611   "Show region length."
   612   (interactive)
   612   (interactive)
   613   (message "%s" (- (region-end) (region-beginning))))
   613   (message "%s" (- (region-end) (region-beginning))))
   614 
   614 
   615 ;;; ----------------------------------------------------------------
   615 ;;; ----------------------------------------------------------------
   616 ;;; minibuffer.
   616 (message "minibuffer")
   617 
   617 
   618 (require 'icomplete) ; Interactive completion in minibuffer.
   618 (require 'icomplete) ; Interactive completion in minibuffer.
   619 (icomplete-mode 1)
   619 (icomplete-mode 1)
   620 
   620 
   621 (mapc (lambda (ext) (add-to-list 'completion-ignored-extensions ext))
   621 (mapc (lambda (ext) (add-to-list 'completion-ignored-extensions ext))
   625         ;; Place dir at end to appear at the start of completion-ignored-extensions.
   625         ;; Place dir at end to appear at the start of completion-ignored-extensions.
   626         "CVS/" ".hg/" ".svn/" ".git/" ".bzr/"
   626         "CVS/" ".hg/" ".svn/" ".git/" ".bzr/"
   627         ) )
   627         ) )
   628 
   628 
   629 ;;; ----------------------------------------------------------------
   629 ;;; ----------------------------------------------------------------
   630 ;;; music.
   630 (message "music")
   631 (setq gnus-audio-au-player "winamp.exe"
   631 (setq gnus-audio-au-player "winamp.exe"
   632       gnus-audio-directory "D:\\music"
   632       gnus-audio-directory "D:\\music"
   633       gnus-audio-wav-player "winamp.exe")
   633       gnus-audio-wav-player "winamp.exe")
   634 
   634 
   635 ;;; ----------------------------------------------------------------
   635 ;;; ----------------------------------------------------------------
   636 ;;; browser.
   636 (message "browser")
   637 
   637 
   638 (cond
   638 (cond
   639  ((equal window-system 'w32)
   639  ((equal window-system 'w32)
   640   (setq browse-url-browser-function 'browse-url-default-windows-browser))
   640   (setq browse-url-browser-function 'browse-url-default-windows-browser))
   641  ((boundp 'debian-emacs-flavor)
   641  ((boundp 'debian-emacs-flavor)
   642   (setq browse-url-browser-function 'browse-url-firefox))
   642   (setq browse-url-browser-function 'browse-url-firefox))
   643  (t
   643  (t
   644   (setq browse-url-browser-function 'browse-url-mozilla)))
   644   (setq browse-url-browser-function 'browse-url-mozilla)))
   645 
   645 
   646 ;;; ----------------------------------------------------------------
   646 ;;; ----------------------------------------------------------------
   647 ;;; calendar.
   647 (message "calendar")
   648 
   648 
   649 ;; (setq mark-holidays-in-calendar t)
   649 ;; (setq mark-holidays-in-calendar t)
   650 ;; (setq all-christian-calendar-holidays t)
   650 ;; (setq all-christian-calendar-holidays t)
   651 ;; (setq calendar-date-display-form (quote ((format "%04s-%02d-%02d" year (string-to-int month) (string-to-int day)))))
   651 ;; (setq calendar-date-display-form (quote ((format "%04s-%02d-%02d" year (string-to-int month) (string-to-int day)))))
   652 ;; (setq calendar-time-display-form (quote (24-hours ":" minutes (if time-zone " (") time-zone (if time-zone ")"))))
   652 ;; (setq calendar-time-display-form (quote (24-hours ":" minutes (if time-zone " (") time-zone (if time-zone ")"))))
   653 (setq calendar-week-start-day 1)
   653 (setq calendar-week-start-day 1)
   654 (setq european-calendar-style t)
   654 (setq european-calendar-style t)
   655 
   655 
   656 ;;; ----------------------------------------------------------------
   656 ;;; ----------------------------------------------------------------
   657 ;;; STANDARD HOOKS.
   657 (message "standard hooks")
   658 
   658 
   659 (add-hook 'write-file-hooks 'time-stamp)
   659 (add-hook 'write-file-hooks 'time-stamp)
   660 
   660 
   661 ;;; ----------------------------------------------------------------
   661 ;;; ----------------------------------------------------------------
   662 ;;; auto-fill.
   662 (message "auto-fill")
   663 
   663 
   664 (setq-default fill-column 78)
   664 (setq-default fill-column 78)
   665 
   665 
   666 (defvar my-fill-column 100
   666 (defvar my-fill-column 100
   667   "I use greater value then 78 for comment in prog source.")
   667   "I use greater value then 78 for comment in prog source.")
   673 ;; Turn on auto-fill mode
   673 ;; Turn on auto-fill mode
   674 (add-hook 'html-mode-hook 'turn-on-auto-fill)
   674 (add-hook 'html-mode-hook 'turn-on-auto-fill)
   675 (add-hook 'text-mode-hook 'turn-on-auto-fill)
   675 (add-hook 'text-mode-hook 'turn-on-auto-fill)
   676 
   676 
   677 ;;; ----------------------------------------------------------------
   677 ;;; ----------------------------------------------------------------
   678 ;;; unknown.
   678 (message "unknown")
   679 
   679 
   680 ;; browse-url mailcrypt gnus message sendmail bbdb pilot bibtex eiffel-mode emacs-w3m
   680 ;; browse-url mailcrypt gnus message sendmail bbdb pilot bibtex eiffel-mode emacs-w3m
   681 ;; eudc filladapt hugs-mode mpg123 php-mode ps-print
   681 ;; eudc filladapt hugs-mode mpg123 php-mode ps-print
   682 ;; chord-mode - edit guitar music
   682 ;; chord-mode - edit guitar music
   683 ;; discography - variant of BibTeX mode for discographies
   683 ;; discography - variant of BibTeX mode for discographies
   684 
   684 
   685 ;;; ----------------------------------------------------------------
   685 ;;; ----------------------------------------------------------------
   686 ;;; cacl, calculator.
   686 (message "cacl, calculator")
   687 
   687 
   688 (setq-default calc-group-digits t)
   688 (setq-default calc-group-digits t)
   689 (setq-default calc-group-char "'")
   689 (setq-default calc-group-char "'")
   690 
   690 
   691 (defun my-calc-eval-region (arg beg end)
   691 (defun my-calc-eval-region (arg beg end)
   700       (goto-char end)
   700       (goto-char end)
   701       (save-excursion
   701       (save-excursion
   702         (insert result)))))
   702         (insert result)))))
   703 
   703 
   704 ;;; ----------------------------------------------------------------
   704 ;;; ----------------------------------------------------------------
   705 ;;; TeX, LaTeX.
   705 (message "TeX, LaTeX")
   706 
   706 
   707 (setq tex-run-command "initex")
   707 (setq tex-run-command "initex")
   708 
   708 
   709 ;;; ----------------------------------------------------------------
   709 ;;; ----------------------------------------------------------------
   710 ;;; AUC TeX.
   710 (message "AUC TeX")
   711 
   711 
   712 ;(add-hook 'LaTeX-mode-hook 'LaTeX-install-toolbar)
   712 ;(add-hook 'LaTeX-mode-hook 'LaTeX-install-toolbar)
   713 ;; (setq TeX-parse-self t)             ; Enable parse on load.
   713 ;; (setq TeX-parse-self t)             ; Enable parse on load.
   714 ;; (setq TeX-auto-save t)              ; Enable parse on save.
   714 ;; (setq TeX-auto-save t)              ; Enable parse on save.
   715 ;; Query for master file. If you often use \include or \input, you should make AUCTEX aware of the
   715 ;; Query for master file. If you often use \include or \input, you should make AUCTEX aware of the
   742 ;         (list "All Texify run-viewer"
   742 ;         (list "All Texify run-viewer"
   743 ;           "texify --tex-opt=--src --run-viewer --clean %s.tex"
   743 ;           "texify --tex-opt=--src --run-viewer --clean %s.tex"
   744 ;           'TeX-run-command nil t))))
   744 ;           'TeX-run-command nil t))))
   745 
   745 
   746 ;;; ----------------------------------------------------------------
   746 ;;; ----------------------------------------------------------------
   747 ;;; reftex.
   747 (message "reftex")
   748 
   748 
   749 ;; Reftex is included with Emacs 21.1.
   749 ;; Reftex is included with Emacs 21.1.
   750 
   750 
   751 ;; (autoload 'reftex-mode     "reftex" "RefTeX Minor Mode" t)
   751 ;; (autoload 'reftex-mode     "reftex" "RefTeX Minor Mode" t)
   752 ;; (autoload 'turn-on-reftex  "reftex" "RefTeX Minor Mode" nil)
   752 ;; (autoload 'turn-on-reftex  "reftex" "RefTeX Minor Mode" nil)
   754 ;; (autoload 'reftex-index-phrase-mode "reftex-index" "Phrase mode" t)
   754 ;; (autoload 'reftex-index-phrase-mode "reftex-index" "Phrase mode" t)
   755 ;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex)   ; with AUCTeX LaTeX mode
   755 ;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex)   ; with AUCTeX LaTeX mode
   756 ;; (add-hook 'latex-mode-hook 'turn-on-reftex)   ; with Emacs latex mode
   756 ;; (add-hook 'latex-mode-hook 'turn-on-reftex)   ; with Emacs latex mode
   757 
   757 
   758 ;;; ----------------------------------------------------------------
   758 ;;; ----------------------------------------------------------------
   759 ;;; PreviewLatex.
   759 (message "PreviewLatex")
   760 
   760 
   761 ;(load "preview-latex.el" nil t t)
   761 ;(load "preview-latex.el" nil t t)
   762 
   762 
   763 ;(add-hook 'LaTeX-mode-hook #'LaTeX-preview-setup)
   763 ;(add-hook 'LaTeX-mode-hook #'LaTeX-preview-setup)
   764 ;(autoload 'LaTeX-preview-setup "preview")
   764 ;(autoload 'LaTeX-preview-setup "preview")
   765 
   765 
   766 ;;; ----------------------------------------------------------------
   766 ;;; ----------------------------------------------------------------
   767 ;;; Info.
   767 (message "Info")
   768 
   768 
   769 ;; Because of Debian policy documentation covered by FDL license with invariant sections not allowed in packet
   769 ;; Because of Debian policy documentation covered by FDL license with invariant sections not allowed in packet
   770 ;; repository tree. So it must be installed manually. My usual configuration is install user local software
   770 ;; repository tree. So it must be installed manually. My usual configuration is install user local software
   771 ;; into ~/usr DISTDIR.
   771 ;; into ~/usr DISTDIR.
   772 (unless (getenv "INFOPATH")
   772 (unless (getenv "INFOPATH")
   773   (setenv "INFOPATH" "~/usr/share/info:"))
   773   (setenv "INFOPATH" "~/usr/share/info:"))
   774 
   774 
   775 ;;; ----------------------------------------------------------------
   775 ;;; ----------------------------------------------------------------
   776 ;;; man, woman.
   776 (message "man, woman")
   777 
   777 
   778 (setq woman-use-own-frame nil)
   778 (setq woman-use-own-frame nil)
   779 (setq woman-fill-frame t)
   779 (setq woman-fill-frame t)
   780 
   780 
   781 ;;; ----------------------------------------------------------------
   781 ;;; ----------------------------------------------------------------
   782 ;;; comint.
   782 (message "comint")
   783 
   783 
   784 ;; If non-nil, add a `/' to completed directories, ` ' to file names.
   784 ;; If non-nil, add a `/' to completed directories, ` ' to file names.
   785 (setq comint-completion-addsuffix t)
   785 (setq comint-completion-addsuffix t)
   786 ;; Non-nil means go to the end of the line before sending input.
   786 ;; Non-nil means go to the end of the line before sending input.
   787 (setq comint-eol-on-send t)
   787 (setq comint-eol-on-send t)
   788 
   788 
   789 ;;; ----------------------------------------------------------------
   789 ;;; ----------------------------------------------------------------
   790 ;;; shell, sh, bash.
   790 (message "shell, sh, bash")
   791 
   791 
   792 ;; Setup Emacs to run bash as its primary shell.
   792 ;; Setup Emacs to run bash as its primary shell.
   793 ;; (setq binary-process-input t)
   793 ;; (setq binary-process-input t)
   794 ;; (setq shell-file-name "bash")
   794 ;; (setq shell-file-name "bash")
   795 ;; (setq shell-command-switch "-c")
   795 ;; (setq shell-command-switch "-c")
   822   (setq explicit-bash-args '("-i"))
   822   (setq explicit-bash-args '("-i"))
   823   (setq explicit-sh-args '("-i"))
   823   (setq explicit-sh-args '("-i"))
   824   )
   824   )
   825 
   825 
   826 ;;; ----------------------------------------------------------------
   826 ;;; ----------------------------------------------------------------
   827 ;;; spell, ispell, aspell.
   827 (message "spell, ispell, aspell")
   828 
   828 
   829 ;; Settings for spelling done in '.emacs-autogen'.
   829 ;; Settings for spelling done in '.emacs-autogen'.
   830 ;(add-hook 'text-mode-hook 'flyspell-mode)
   830 ;(add-hook 'text-mode-hook 'flyspell-mode)
   831 ;(setq flyspell-default-dictionary "russianw")
   831 ;(setq flyspell-default-dictionary "russianw")
   832 ;(setq flyspell-delay '1)
   832 ;(setq flyspell-delay '1)
   833 
   833 
   834 ;;; ----------------------------------------------------------------
   834 ;;; ----------------------------------------------------------------
   835 ;;; GTD, PIM, organize, todo mode.
   835 (message "GTD, PIM, organize, todo mode")
   836 
   836 
   837 ;;; ----------------------------------------------------------------
   837 ;;; ----------------------------------------------------------------
   838 ;;; org-mode.
   838 (message "org-mode")
   839 
   839 
   840 (if (>= emacs-major-version 22)
   840 (if (>= emacs-major-version 22)
   841 (progn
   841 (progn
   842   (require 'org)
   842   (require 'org)
   843   ))
   843   ))
   862             )
   862             )
   863       (define-key global-map "\C-ca" 'org-agenda)
   863       (define-key global-map "\C-ca" 'org-agenda)
   864       (setq org-agenda-files '("~/.gtd/todo.org")) ))
   864       (setq org-agenda-files '("~/.gtd/todo.org")) ))
   865 
   865 
   866 ;;; ----------------------------------------------------------------
   866 ;;; ----------------------------------------------------------------
   867 ;;; remember-mode.
   867 (message "remember-mode")
   868 
   868 
   869 (if (or (featurep 'remember) (fboundp 'remember))
   869 (if (or (featurep 'remember) (fboundp 'remember))
   870     (progn
   870     (progn
   871       (setq remember-annotation-functions '(org-remember-annotation))
   871       (setq remember-annotation-functions '(org-remember-annotation))
   872       (setq remember-handler-functions '(org-remember-handler))
   872       (setq remember-handler-functions '(org-remember-handler))
   880       (setq
   880       (setq
   881        org-remember-store-without-prompt t
   881        org-remember-store-without-prompt t
   882        ) ))
   882        ) ))
   883 
   883 
   884 ;;; ----------------------------------------------------------------
   884 ;;; ----------------------------------------------------------------
   885 ;;; TODO, XXX, FIXME highlight.
   885 (message "TODO, XXX, FIXME highlight")
   886 ;; Show blanks and FIXME
   886 ;; Show blanks and FIXME
   887 ;; http://www.emacswiki.org/cgi-bin/wiki/EightyColumnRule
   887 ;; http://www.emacswiki.org/cgi-bin/wiki/EightyColumnRule
   888 
   888 
   889 (defface my-tab-face
   889 (defface my-tab-face
   890   '((t :background "gray"))
   890   '((t :background "gray"))
   907      ("\\([^[:space:]]\\)\\1\\{63\\}" 0 'my-contrasty-face t)
   907      ("\\([^[:space:]]\\)\\1\\{63\\}" 0 'my-contrasty-face t)
   908      ))
   908      ))
   909   )
   909   )
   910 
   910 
   911 ;;; ----------------------------------------------------------------
   911 ;;; ----------------------------------------------------------------
   912 ;;; communication.
   912 (message "communication")
   913 
   913 
   914 ;;; ----------------------------------------------------------------
   914 ;;; ----------------------------------------------------------------
   915 ;;; jabber.
   915 (message "jabber")
   916 
   916 
   917 (when (featurep 'jabber)
   917 (when (featurep 'jabber)
   918   (setq
   918   (setq
   919    jabber-history-enabled t
   919    jabber-history-enabled t
   920    jabber-use-global-history nil
   920    jabber-use-global-history nil
   972   )
   972   )
   973 
   973 
   974 (global-set-key (kbd "C-x C-j C-s") 'my-jabber-send)
   974 (global-set-key (kbd "C-x C-j C-s") 'my-jabber-send)
   975 
   975 
   976 ;;; ----------------------------------------------------------------
   976 ;;; ----------------------------------------------------------------
   977 ;;; rcirc.
   977 (message "rcirc")
   978 
   978 
   979 ;; Turn on logging everything to a special buffer, for debugging.
   979 ;; Turn on logging everything to a special buffer, for debugging.
   980 ;; (setq rcirc-debug-flag t)
   980 ;; (setq rcirc-debug-flag t)
   981 
   981 
   982 (add-hook 'rcirc-mode-hook (lambda () (rcirc-track-minor-mode 1)))
   982 (add-hook 'rcirc-mode-hook (lambda () (rcirc-track-minor-mode 1)))
   988 (setq rcirc-default-port 6667)
   988 (setq rcirc-default-port 6667)
   989 (setq rcirc-default-nick user-nick)
   989 (setq rcirc-default-nick user-nick)
   990 (setq rcirc-default-user-full-name user-full-name)
   990 (setq rcirc-default-user-full-name user-full-name)
   991 
   991 
   992 ;;; ----------------------------------------------------------------
   992 ;;; ----------------------------------------------------------------
   993 ;;; erc.
   993 (message "erc")
   994 
   994 
   995 ;; Take off noise message.
   995 ;; Take off noise message.
   996 (setq erc-track-exclude-types '("JOIN" "PART" "QUIT" "NICK" "MODE"))
   996 (setq erc-track-exclude-types '("JOIN" "PART" "QUIT" "NICK" "MODE"))
   997 
   997 
   998 (setq erc-current-nick-highlight-type 'nick-or-keyword)
   998 (setq erc-current-nick-highlight-type 'nick-or-keyword)
   999 (setq erc-track-use-faces t)
   999 (setq erc-track-use-faces t)
  1000 
  1000 
  1001 (setq erc-server-coding-system 'utf-8)
  1001 (setq erc-server-coding-system 'utf-8)
  1002 
  1002 
  1003 ;;; ----------------------------------------------------------------
  1003 ;;; ----------------------------------------------------------------
  1004 ;;; VCS, version control, cvs, svn, mercurial, hg, bazaar, bzr, git, fossil.
  1004 (message "VCS, version control, cvs, svn, mercurial, hg, bazaar, bzr, git, fossil")
  1005 
  1005 
  1006 (if (equal window-system 'w32)
  1006 (if (equal window-system 'w32)
  1007     (progn
  1007     (progn
  1008       (modify-coding-system-alist 'process "cvs" '(cp1251-dos . cp1251-dos))
  1008       (modify-coding-system-alist 'process "cvs" '(cp1251-dos . cp1251-dos))
  1009       (modify-coding-system-alist 'process "svn" '(cp1251 . cp1251))
  1009       (modify-coding-system-alist 'process "svn" '(cp1251 . cp1251))
  1037          (360 . "#0D80E0")))
  1037          (360 . "#0D80E0")))
  1038       )
  1038       )
  1039   )
  1039   )
  1040 
  1040 
  1041 ;;; ----------------------------------------------------------------
  1041 ;;; ----------------------------------------------------------------
  1042 ;;; psvn.
  1042 (message "psvn")
  1043 
  1043 
  1044 (setq svn-status-verbose t)
  1044 (setq svn-status-verbose t)
  1045 (setq svn-status-hide-unmodified t)
  1045 (setq svn-status-hide-unmodified t)
  1046 
  1046 
  1047 ;;; ----------------------------------------------------------------
  1047 ;;; ----------------------------------------------------------------
  1048 ;;; DVC.
  1048 (message "DVC")
  1049 
  1049 
  1050 (when (featurep 'dvc-emacs)
  1050 (when (featurep 'dvc-emacs)
  1051   (setq dvc-tips-enabled nil)
  1051   (setq dvc-tips-enabled nil)
  1052   )
  1052   )
  1053 
  1053 
  1054 ;;; ----------------------------------------------------------------
  1054 ;;; ----------------------------------------------------------------
  1055 ;;; devel, prog, programming.
  1055 (message "devel, prog, programming")
  1056 
  1056 
  1057 (add-to-list 'auto-mode-alist '("\\.cu$" . c-mode))
  1057 (add-to-list 'auto-mode-alist '("\\.cu$" . c-mode))
  1058 
  1058 
  1059 (defun my-c++-header-file-p ()
  1059 (defun my-c++-header-file-p ()
  1060   "Return non-nil, if in a C++ header."
  1060   "Return non-nil, if in a C++ header."
  1074 
  1074 
  1075 (mapc (lambda (hook) (add-hook hook (lambda () (setq fill-column my-fill-column)) ))
  1075 (mapc (lambda (hook) (add-hook hook (lambda () (setq fill-column my-fill-column)) ))
  1076       my-devel-mode-hook-list)
  1076       my-devel-mode-hook-list)
  1077 
  1077 
  1078 ;;; ----------------------------------------------------------------
  1078 ;;; ----------------------------------------------------------------
  1079 ;;; diff, patch, ediff, emerge.
  1079 (message "diff, patch, ediff, emerge")
  1080 
  1080 
  1081 (setq diff-switches "-u")
  1081 (setq diff-switches "-u")
  1082 
  1082 
  1083 (setq ediff-diff-options "")
  1083 (setq ediff-diff-options "")
  1084 (setq ediff-custom-diff-options "-u")
  1084 (setq ediff-custom-diff-options "-u")
  1085 
  1085 
  1086 ;;; ----------------------------------------------------------------
  1086 ;;; ----------------------------------------------------------------
  1087 ;;; indenting.
  1087 (message "indenting")
  1088 
  1088 
  1089 (setq standard-indent 4)
  1089 (setq standard-indent 4)
  1090 (setq c-basic-offset 4)
  1090 (setq c-basic-offset 4)
  1091 (setq sh-basic-offset 2)
  1091 (setq sh-basic-offset 2)
  1092 (setq sgml-basic-offset 4)
  1092 (setq sgml-basic-offset 4)
  1102   (while (>= i 0)
  1102   (while (>= i 0)
  1103     (setq tab-stop-list (cons i tab-stop-list))
  1103     (setq tab-stop-list (cons i tab-stop-list))
  1104     (setq i (- i 4))))
  1104     (setq i (- i 4))))
  1105 
  1105 
  1106 ;;; ----------------------------------------------------------------
  1106 ;;; ----------------------------------------------------------------
  1107 ;;; compile.
  1107 (message "compile")
  1108 
  1108 
  1109 (setq compile-auto-highlight t
  1109 (setq compile-auto-highlight t
  1110       compile-command "make ")
  1110       compile-command "make ")
  1111 ;; compilation window shall scroll down if not 0
  1111 ;; compilation window shall scroll down if not 0
  1112 (setq compilation-scroll-output 1)
  1112 (setq compilation-scroll-output 1)
  1119 (add-to-list 'compilation-error-regexp-alist '("^\"?\\([^\"]*\\)\"?,\\([0-9]*\\) .*\\[.*\\]: " 1 2)) ; KEIL compiler
  1119 (add-to-list 'compilation-error-regexp-alist '("^\"?\\([^\"]*\\)\"?,\\([0-9]*\\) .*\\[.*\\]: " 1 2)) ; KEIL compiler
  1120 ;; (add-to-list 'compilation-mode-font-lock-keywords '("\\(/[Oo][Uu][Tt]:[^ 	]+\\)" . 1))
  1120 ;; (add-to-list 'compilation-mode-font-lock-keywords '("\\(/[Oo][Uu][Tt]:[^ 	]+\\)" . 1))
  1121 ;; (add-to-list 'compilation-mode-font-lock-keywords '("[ 	]\\(/F[oe][^ 	]+\\)" . 1))
  1121 ;; (add-to-list 'compilation-mode-font-lock-keywords '("[ 	]\\(/F[oe][^ 	]+\\)" . 1))
  1122 
  1122 
  1123 ;;; ----------------------------------------------------------------
  1123 ;;; ----------------------------------------------------------------
  1124 ;;; TAGS, etags, ctags, GNU GLOBAL.
  1124 (message "TAGS, etags, ctags, GNU GLOBAL")
  1125 
  1125 
  1126 ;; One of 'tags-table-list' or 'tags-file-name' control which TAGS files to
  1126 ;; One of 'tags-table-list' or 'tags-file-name' control which TAGS files to
  1127 ;; use.
  1127 ;; use.
  1128 
  1128 
  1129 (setq tags-add-tables t)
  1129 (setq tags-add-tables t)
  1134     (global-set-key "\M-." 'etags-select-find-tag)
  1134     (global-set-key "\M-." 'etags-select-find-tag)
  1135     )
  1135     )
  1136   )
  1136   )
  1137 
  1137 
  1138 ;;; ----------------------------------------------------------------
  1138 ;;; ----------------------------------------------------------------
  1139 ;;; CEDET, semantic.
  1139 (message "CEDET, semantic")
  1140 
  1140 
  1141 ;; For debug use 'semantic-debug-idle-function' and 'semantic-debug-idle-work-function'.
  1141 ;; For debug use 'semantic-debug-idle-function' and 'semantic-debug-idle-work-function'.
  1142 
  1142 
  1143 (unless (featurep 'cedet)
  1143 (unless (featurep 'cedet)
  1144   ;; (when (or (and (= emacs-major-version 23) (= emacs-minor-version 2)) (>= emacs-minor-version 24))
  1144   ;; (when (or (and (= emacs-major-version 23) (= emacs-minor-version 2)) (>= emacs-minor-version 24))
  1191   (global-set-key (kbd "C-c , D") 'semantic-ia-describe-class)
  1191   (global-set-key (kbd "C-c , D") 'semantic-ia-describe-class)
  1192   (global-set-key (kbd "C-c , c") 'semantic-ia-complete-symbol-menu)
  1192   (global-set-key (kbd "C-c , c") 'semantic-ia-complete-symbol-menu)
  1193   )
  1193   )
  1194 
  1194 
  1195 ;;; ----------------------------------------------------------------
  1195 ;;; ----------------------------------------------------------------
  1196 ;;; imenu.
  1196 (message "imenu")
  1197 
  1197 
  1198 (require 'imenu)
  1198 (require 'imenu)
  1199 (when window-system
  1199 (when window-system
  1200   (mapc (lambda (hook)
  1200   (mapc (lambda (hook)
  1201           (add-hook hook
  1201           (add-hook hook
  1205                       ) ))
  1205                       ) ))
  1206         (delq 'nsis-mode-hook my-devel-mode-hook-list))
  1206         (delq 'nsis-mode-hook my-devel-mode-hook-list))
  1207   )
  1207   )
  1208 
  1208 
  1209 ;;; ----------------------------------------------------------------
  1209 ;;; ----------------------------------------------------------------
  1210 ;;; windows inf files for driver installing
  1210 (message "windows inf files for driver installin")
  1211 
  1211 
  1212 (add-to-list 'auto-mode-alist '("\\.inf\\'" . conf-mode))
  1212 (add-to-list 'auto-mode-alist '("\\.inf\\'" . conf-mode))
  1213 
  1213 
  1214 ;;; ----------------------------------------------------------------
  1214 ;;; ----------------------------------------------------------------
  1215 ;;; makefile, make.
  1215 (message "makefile, make")
  1216 
  1216 
  1217 (add-to-list 'auto-mode-alist '("\\(Makefile\\|Makefile\\..+\\)\\'" . makefile-gmake-mode))
  1217 (add-to-list 'auto-mode-alist '("\\(Makefile\\|Makefile\\..+\\)\\'" . makefile-gmake-mode))
  1218 
  1218 
  1219 ;;; ----------------------------------------------------------------
  1219 ;;; ----------------------------------------------------------------
  1220 ;;; asm, assembler.
  1220 (message "asm, assembler")
  1221 
  1221 
  1222 ;; (setq-default asm-comment-char 59)
  1222 ;; (setq-default asm-comment-char 59)
  1223 (add-hook 'asm-mode-hook '(lambda () (setq comment-start "/*") (setq comment-end "*/")) t)
  1223 (add-hook 'asm-mode-hook '(lambda () (setq comment-start "/*") (setq comment-end "*/")) t)
  1224 
  1224 
  1225 (add-to-list 'auto-mode-alist '("\\.\\([sS]79\\|[sS]\\)\\'" . asm-mode))
  1225 (add-to-list 'auto-mode-alist '("\\.\\([sS]79\\|[sS]\\)\\'" . asm-mode))
  1226 
  1226 
  1227 ;; (add-hook 'asm-mode-hook '(lambda () (local-unset-key ":")))
  1227 ;; (add-hook 'asm-mode-hook '(lambda () (local-unset-key ":")))
  1228 ;; (add-hook 'asm-mode-hook '(lambda () (local-set-key ":" ":")))
  1228 ;; (add-hook 'asm-mode-hook '(lambda () (local-set-key ":" ":")))
  1229 
  1229 
  1230 ;;; ----------------------------------------------------------------
  1230 ;;; ----------------------------------------------------------------
  1231 ;;; linker.
  1231 (message "linker")
  1232 
  1232 
  1233 (when (fboundp 'iar-linker-config-mode)
  1233 (when (fboundp 'iar-linker-config-mode)
  1234   (add-to-list 'auto-mode-alist '("\\.icf\\'" . iar-linker-config-mode))
  1234   (add-to-list 'auto-mode-alist '("\\.icf\\'" . iar-linker-config-mode))
  1235   )
  1235   )
  1236 (when (fboundp 'iar4-linker-config-mode)
  1236 (when (fboundp 'iar4-linker-config-mode)
  1237   (add-to-list 'auto-mode-alist '("\\.xcl\\'" . iar4-linker-config-mode))
  1237   (add-to-list 'auto-mode-alist '("\\.xcl\\'" . iar4-linker-config-mode))
  1238   )
  1238   )
  1239 
  1239 
  1240 ;;; ----------------------------------------------------------------
  1240 ;;; ----------------------------------------------------------------
  1241 ;;; lisp.
  1241 (message "lisp")
  1242 
  1242 
  1243 (setq list-command-history-max 256)
  1243 (setq list-command-history-max 256)
  1244 
  1244 
  1245 ;;; ----------------------------------------------------------------
  1245 ;;; ----------------------------------------------------------------
  1246 ;;; C, c-mode, C++, c++-mode.
  1246 (message "C, c-mode, C++, c++-mode")
  1247 
  1247 
  1248 (setq c-echo-syntactic-information-p t)
  1248 (setq c-echo-syntactic-information-p t)
  1249 (add-hook 'c-mode-common-hook
  1249 (add-hook 'c-mode-common-hook
  1250  (lambda ()
  1250  (lambda ()
  1251    ;; Automatically inserte newlines after special characters such as brace, comma, semi-colon, and colon.
  1251    ;; Automatically inserte newlines after special characters such as brace, comma, semi-colon, and colon.
  1311             (other . "my")
  1311             (other . "my")
  1312             ))
  1312             ))
  1313     ))
  1313     ))
  1314 
  1314 
  1315 ;;; ----------------------------------------------------------------
  1315 ;;; ----------------------------------------------------------------
  1316 ;;; javascript, js.
  1316 (message "javascript, js")
  1317 
  1317 
  1318 (if (>= emacs-major-version 23)
  1318 (if (>= emacs-major-version 23)
  1319     (add-to-list 'auto-mode-alist '("\\.js$" . js-mode))
  1319     (add-to-list 'auto-mode-alist '("\\.js$" . js-mode))
  1320   (add-to-list 'auto-mode-alist '("\\.js$" . javascript-generic-mode))
  1320   (add-to-list 'auto-mode-alist '("\\.js$" . javascript-generic-mode))
  1321   )
  1321   )
  1322 
  1322 
  1323 ;;; ----------------------------------------------------------------
  1323 ;;; ----------------------------------------------------------------
  1324 ;;; bat file, batch.
  1324 (message "bat file, batch")
  1325 
  1325 
  1326 ;; loaded from 'generic-x.el'
  1326 ;; loaded from 'generic-x.el'
  1327 
  1327 
  1328 ;;; ----------------------------------------------------------------
  1328 ;;; ----------------------------------------------------------------
  1329 ;;; nsis-mode.
  1329 (message "nsis-mode")
  1330 
  1330 
  1331 (when (fboundp 'nsis-mode)
  1331 (when (fboundp 'nsis-mode)
  1332   (add-to-list 'auto-mode-alist '("\\.\\(nsi\\|nsh\\)\\'" . nsis-mode))
  1332   (add-to-list 'auto-mode-alist '("\\.\\(nsi\\|nsh\\)\\'" . nsis-mode))
  1333   )
  1333   )
  1334 
  1334 
  1335 ;;; ----------------------------------------------------------------
  1335 ;;; ----------------------------------------------------------------
  1336 ;;; csharp, c-sharp.
  1336 (message "csharp, c-sharp")
  1337 
  1337 
  1338 (autoload 'csharp-mode "csharp-mode" "Major mode for editing C# code." t)
  1338 (autoload 'csharp-mode "csharp-mode" "Major mode for editing C# code." t)
  1339 (add-to-list 'auto-mode-alist '("\\.cs$" . csharp-mode))
  1339 (add-to-list 'auto-mode-alist '("\\.cs$" . csharp-mode))
  1340 
  1340 
  1341 ;;; ----------------------------------------------------------------
  1341 ;;; ----------------------------------------------------------------
  1342 ;;; java.
  1342 (message "java")
  1343 
  1343 
  1344 ;;; ----------------------------------------------------------------
  1344 ;;; ----------------------------------------------------------------
  1345 ;;; ECB.
  1345 (message "ECB")
  1346 
  1346 
  1347 (setq ecb-tip-of-the-day nil)
  1347 (setq ecb-tip-of-the-day nil)
  1348 
  1348 
  1349 ;;; ----------------------------------------------------------------
  1349 ;;; ----------------------------------------------------------------
  1350 ;;; html.
  1350 (message "html")
  1351 
  1351 
  1352 ;;; ----------------------------------------------------------------
  1352 ;;; ----------------------------------------------------------------
  1353 ;;; nxml.
  1353 (message "nxml")
  1354 
  1354 
  1355 (setq nxml-sexp-element-flag t)
  1355 (setq nxml-sexp-element-flag t)
  1356 (setq nxml-child-indent 2)
  1356 (setq nxml-child-indent 2)
  1357 (setq nxml-attribute-indent 4)
  1357 (setq nxml-attribute-indent 4)
  1358 
  1358 
  1359 ;;; ----------------------------------------------------------------
  1359 ;;; ----------------------------------------------------------------
  1360 ;;; psgml.
  1360 (message "psgml")
  1361 
  1361 
  1362 (setq sgml-set-face t)                  ; for highlighting in sgml
  1362 (setq sgml-set-face t)                  ; for highlighting in sgml
  1363 
  1363 
  1364 ;;; ----------------------------------------------------------------
  1364 ;;; ----------------------------------------------------------------
  1365 ;;; sh, bash.
  1365 (message "sh, bash")
  1366 
  1366 
  1367 (add-to-list 'auto-mode-alist '("\\.cygport\\'" . shell-script-mode))
  1367 (add-to-list 'auto-mode-alist '("\\.cygport\\'" . shell-script-mode))
  1368 
  1368 
  1369 ;;; ----------------------------------------------------------------
  1369 ;;; ----------------------------------------------------------------
  1370 ;;; printing.
  1370 (message "printing")
  1371 
  1371 
  1372 ;; Use Notepad to print plain text files to the default Windows printer
  1372 ;; Use Notepad to print plain text files to the default Windows printer
  1373 ;(setq lpr-command "notepad")
  1373 ;(setq lpr-command "notepad")
  1374 ;(setq lpr-headers-switches '("/p"))    ; \ mis-use these
  1374 ;(setq lpr-headers-switches '("/p"))    ; \ mis-use these
  1375 ;(setq lpr-switches nil)                ; / two variables
  1375 ;(setq lpr-switches nil)                ; / two variables
  1404 ;         (list "All Texify run-viewer"
  1404 ;         (list "All Texify run-viewer"
  1405 ;           "texify --tex-opt=--src --run-viewer --clean %s.tex"
  1405 ;           "texify --tex-opt=--src --run-viewer --clean %s.tex"
  1406 ;           'TeX-run-command nil t))))
  1406 ;           'TeX-run-command nil t))))
  1407 
  1407 
  1408 ;;; ----------------------------------------------------------------
  1408 ;;; ----------------------------------------------------------------
  1409 ;;; SQL.
  1409 (message "SQL")
  1410 
  1410 
  1411 (setq sql-password "")
  1411 (setq sql-password "")
  1412 
  1412 
  1413 ;;; ----------------------------------------------------------------
  1413 ;;; ----------------------------------------------------------------
  1414 ;;; backuping.
  1414 (message "backuping")
  1415 
  1415 
  1416 (setq
  1416 (setq
  1417  make-backup-files t
  1417  make-backup-files t
  1418  ;; In other case (by renaming) you loose original file creation date.
  1418  ;; In other case (by renaming) you loose original file creation date.
  1419  backup-by-copying t
  1419  backup-by-copying t
  1422  kept-old-versions 1                           ; store first original version
  1422  kept-old-versions 1                           ; store first original version
  1423  kept-new-versions 3                           ; store last 3 version
  1423  kept-new-versions 3                           ; store last 3 version
  1424  version-control t)                            ; use versioned backups
  1424  version-control t)                            ; use versioned backups
  1425 
  1425 
  1426 ;;; ----------------------------------------------------------------
  1426 ;;; ----------------------------------------------------------------
  1427 ;;; auto save.
  1427 (message "auto save")
  1428 
  1428 
  1429 (setq auto-save-default t)
  1429 (setq auto-save-default t)
  1430 ;; If nil autosave to different than original to buffer file.
  1430 ;; If nil autosave to different than original to buffer file.
  1431 (setq auto-save-visited-file-name nil)
  1431 (setq auto-save-visited-file-name nil)
  1432 ;; Note: if you kill unsaved file auto save file not deleted.
  1432 ;; Note: if you kill unsaved file auto save file not deleted.
  1433 (setq delete-auto-save-files t)
  1433 (setq delete-auto-save-files t)
  1434 
  1434 
  1435 ;;; ----------------------------------------------------------------
  1435 ;;; ----------------------------------------------------------------
  1436 ;;; User welcome msg.
  1436 (message "User welcome msg")
  1437 
  1437 
  1438 (add-hook 'emacs-startup-hook
  1438 (add-hook 'emacs-startup-hook
  1439           (lambda ()
  1439           (lambda ()
  1440             (let ( (mgs-list '("Welcome to emacs, the thermonuclear editor."
  1440             (let ( (mgs-list '("Welcome to emacs, the thermonuclear editor."
  1441                                "You enter to Out Space. Emacs on."
  1441                                "You enter to Out Space. Emacs on."