.emacs-my
changeset 718 19ab21ec7640
parent 717 b958f182d0d4
child 719 694f7e388f2b
equal deleted inserted replaced
717:b958f182d0d4 718:19ab21ec7640
     1 ;; -*- mode: emacs-lisp; mode: outline-minor; coding: utf-8; fill-column: 78 -*-
     1 ;; -*- mode: emacs-lisp; 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 (message "recentf")
    13 (message "recentf")
    14 
    14 
    15 (require 'recentf)
    15 (require 'recentf)
    16 ;; Prevent TRAMP to login on remote host when loading.
    16 ;; Prevent TRAMP to login on remote host when loading.
    17 ;; Its take time and ask passwords!
    17 ;; Its take time and ask passwords!
    18 (setq recentf-auto-cleanup 'never)
    18 (setq recentf-auto-cleanup 'never)
    19 (recentf-mode t)
    19 (recentf-mode t)
    20 (setq recentf-max-saved-items 1000)
    20 (setq recentf-max-saved-items 1000)
    21 (global-set-key (kbd "\e\eq")  'recentf-open-files)
    21 (global-set-key (kbd "\e\eq")  'recentf-open-files)
    22 
    22 
    23 ;;; ----------------------------------------------------------------
    23 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    24 (message "revert buffer")
    24 (message "revert buffer")
    25 
    25 
    26 (global-set-key [f5]    'revert-buffer)
    26 (global-set-key [f5]    'revert-buffer)
    27 (setq revert-without-query (quote (".*")))
    27 (setq revert-without-query (quote (".*")))
    28 (setq auto-revert-interval 2)
    28 (setq auto-revert-interval 2)
    29 
    29 
    30 ;;; ----------------------------------------------------------------
    30 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    31 (message "debugging")
    31 (message "debugging")
    32 
    32 
    33 ;; Shut off message buffer by setting nil.
    33 ;; Shut off message buffer by setting nil.
    34 (setq message-log-max 512)
    34 (setq message-log-max 512)
    35 
    35 
    42 
    42 
    43 ;; Prevent Emacs from loading 'default.el', which loaded after '.emacs'.
    43 ;; Prevent Emacs from loading 'default.el', which loaded after '.emacs'.
    44 ;; Also '-q' prevent loading your init file.
    44 ;; Also '-q' prevent loading your init file.
    45 (setq inhibit-default-init nil)         ; t/nil
    45 (setq inhibit-default-init nil)         ; t/nil
    46 
    46 
    47 ;;; ----------------------------------------------------------------
    47 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    48 (message "user info")
    48 (message "user info")
    49 
    49 
    50 (setq user-full-name "Oleksandr Gavenko")
    50 (setq user-full-name "Oleksandr Gavenko")
    51 (setq user-mail-address "gavenkoa@gmail.com")
    51 (setq user-mail-address "gavenkoa@gmail.com")
    52 (setq user-nick "gavenkoa")
    52 (setq user-nick "gavenkoa")
    53 (setenv "ORGANIZATION" (concat user-full-name " <" user-mail-address  ">"))
    53 (setenv "ORGANIZATION" (concat user-full-name " <" user-mail-address  ">"))
    54 
    54 
    55 ;;; ----------------------------------------------------------------
    55 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    56 (message "my defun, defmacro, defvar")
    56 (message "my defun, defmacro, defvar")
    57 
    57 
    58 (defmacro my-filter (condfunc list)
    58 (defmacro my-filter (condfunc list)
    59   "Construct list with elements from LIST which satisfy CONDFUNC."
    59   "Construct list with elements from LIST which satisfy CONDFUNC."
    60   `(let (r)
    60   `(let (r)
    74       (setq x2 (funcall f x2 (pop li)))
    74       (setq x2 (funcall f x2 (pop li)))
    75       )
    75       )
    76     x2
    76     x2
    77     ) )
    77     ) )
    78 
    78 
    79 ;;; ----------------------------------------------------------------
    79 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    80 (message "mode groups")
    80 (message "mode groups")
    81 
    81 
    82 (defmacro my-defun-rename-symb-tree (name doc func)
    82 (defmacro my-defun-rename-symb-tree (name doc func)
    83   "Travel by TREE and applies FUNC to each symbol."
    83   "Travel by TREE and applies FUNC to each symbol."
    84   `(defun ,name (tree)
    84   `(defun ,name (tree)
   155 
   155 
   156 (defvar my-text-mode-hook-list
   156 (defvar my-text-mode-hook-list
   157   (my-mode2hook my-text-mode-list)
   157   (my-mode2hook my-text-mode-list)
   158   "List of text mode hooks.")
   158   "List of text mode hooks.")
   159 
   159 
   160 ;;; ----------------------------------------------------------------
   160 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   161 (message "appearance")
   161 (message "appearance")
   162 
   162 
   163 ;; To maximize frame on full screen, not work with Windows Emacs 21.4.
   163 ;; To maximize frame on full screen, not work with Windows Emacs 21.4.
   164 ;; And maked different height with Emacs 22.3 and 23.1.
   164 ;; And maked different height with Emacs 22.3 and 23.1.
   165 ;; (setq initial-frame-alist '((fullscreen . fullboth)))
   165 ;; (setq initial-frame-alist '((fullscreen . fullboth)))
   250 (fset 'yes-or-no-p 'y-or-n-p)
   250 (fset 'yes-or-no-p 'y-or-n-p)
   251 
   251 
   252 (when (boundp 'confirm-kill-emacs)
   252 (when (boundp 'confirm-kill-emacs)
   253   (setq confirm-kill-emacs 'y-or-n-p))
   253   (setq confirm-kill-emacs 'y-or-n-p))
   254 
   254 
   255 ;;; ----------------------------------------------------------------
   255 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   256 (message "silent runing")
   256 (message "silent runing")
   257 
   257 
   258 ;; (setq inhibit-splash-screen t) ; nonexist on 21.4.1
   258 ;; (setq inhibit-splash-screen t) ; nonexist on 21.4.1
   259 (setq inhibit-startup-message t)
   259 (setq inhibit-startup-message t)
   260 
   260 
   300 (ansi-color-for-comint-mode-on)
   300 (ansi-color-for-comint-mode-on)
   301 
   301 
   302 (setq explicit-bash-args '("-i"))
   302 (setq explicit-bash-args '("-i"))
   303 (setq explicit-sh-args '("-i"))
   303 (setq explicit-sh-args '("-i"))
   304 
   304 
   305 ;;; ----------------------------------------------------------------
   305 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   306 (message "whitespaces")
   306 (message "whitespaces")
   307 
   307 
   308 (setq default-indicate-empty-lines t)
   308 (setq default-indicate-empty-lines t)
   309 (setq default-indicate-buffer-boundaries 'left)
   309 (setq default-indicate-buffer-boundaries 'left)
   310 
   310 
   318 (setq next-line-add-newlines nil)
   318 (setq next-line-add-newlines nil)
   319 
   319 
   320 ;; See also 'mode-require-final-newline'.
   320 ;; See also 'mode-require-final-newline'.
   321 (add-hook 'text-mode-hook (lambda () (setq require-final-newline nil)))
   321 (add-hook 'text-mode-hook (lambda () (setq require-final-newline nil)))
   322 
   322 
   323 ;;; ----------------------------------------------------------------
   323 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   324 (message "gnu serv, server")
   324 (message "gnu serv, server")
   325 
   325 
   326 ;; (load "~/emacs/bin/gnuserv/gnuserv.el")
   326 ;; (load "~/emacs/bin/gnuserv/gnuserv.el")
   327 ;; (require 'gnuserv)
   327 ;; (require 'gnuserv)
   328 ;; (setq gnuserv-frame (selected-frame))
   328 ;; (setq gnuserv-frame (selected-frame))
   333     (defun server-ensure-safe-dir (dir) "Noop" t)) ; Suppress error directory ~/.emacs.d/server is unsafe on windows.
   333     (defun server-ensure-safe-dir (dir) "Noop" t)) ; Suppress error directory ~/.emacs.d/server is unsafe on windows.
   334   (when (or (= emacs-major-version 22) (not (eq (server-running-p server-name) t)))
   334   (when (or (= emacs-major-version 22) (not (eq (server-running-p server-name) t)))
   335     (server-start))
   335     (server-start))
   336   )
   336   )
   337 
   337 
   338 ;;; ----------------------------------------------------------------
   338 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   339 (message "standart/general settings")
   339 (message "standart/general settings")
   340 
   340 
   341 ;; Try to speed things up, especially in VM.
   341 ;; Try to speed things up, especially in VM.
   342 (setq gc-cons-threshold 2000000)
   342 (setq gc-cons-threshold 2000000)
   343 
   343 
   391 (setq
   391 (setq
   392  use-dialog-box t
   392  use-dialog-box t
   393  x-gtk-show-hidden-files t
   393  x-gtk-show-hidden-files t
   394  )
   394  )
   395 
   395 
   396 ;;; ----------------------------------------------------------------
   396 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   397 (message "switching, creating, selecting buffers")
   397 (message "switching, creating, selecting buffers")
   398 
   398 
   399 (iswitchb-mode 1)
   399 (iswitchb-mode 1)
   400 (setq iswitchb-buffer-ignore
   400 (setq iswitchb-buffer-ignore
   401       '("^ "
   401       '("^ "
   414 (setq uniquify-after-kill-buffer-p t)
   414 (setq uniquify-after-kill-buffer-p t)
   415 
   415 
   416 ;; buffer-menu better then buffer-list, but ibuffer much better.
   416 ;; buffer-menu better then buffer-list, but ibuffer much better.
   417 (global-set-key "\C-x\C-b" 'ibuffer)
   417 (global-set-key "\C-x\C-b" 'ibuffer)
   418 
   418 
   419 ;;; ----------------------------------------------------------------
   419 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   420 (message "scrolling")
   420 (message "scrolling")
   421 
   421 
   422 (defvar my-scroll-margin 4)
   422 (defvar my-scroll-margin 4)
   423 
   423 
   424 (setq-default
   424 (setq-default
   431 (make-variable-buffer-local 'scroll-margin)
   431 (make-variable-buffer-local 'scroll-margin)
   432 (mapc (lambda (hook) (add-hook hook (lambda nil (setq scroll-margin my-scroll-margin))))
   432 (mapc (lambda (hook) (add-hook hook (lambda nil (setq scroll-margin my-scroll-margin))))
   433       ;; TODO its good invoke delete-dups for list, but delete-dups not exist in Emacs 21.4
   433       ;; TODO its good invoke delete-dups for list, but delete-dups not exist in Emacs 21.4
   434       (append my-text-mode-hook-list my-devel-mode-hook-list my-scroll-margin-mode-hook-list) )
   434       (append my-text-mode-hook-list my-devel-mode-hook-list my-scroll-margin-mode-hook-list) )
   435 
   435 
   436 ;;; ----------------------------------------------------------------
   436 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   437 (message "search, isearch, occur")
   437 (message "search, isearch, occur")
   438 
   438 
   439 (setq case-fold-search t)
   439 (setq case-fold-search t)
   440 
   440 
   441 (setq query-replace-highlight t)        ; highlight during query
   441 (setq query-replace-highlight t)        ; highlight during query
   445 (when (< emacs-major-version 23)
   445 (when (< emacs-major-version 23)
   446   (global-set-key (kbd "M-s o") 'occur)
   446   (global-set-key (kbd "M-s o") 'occur)
   447   )
   447   )
   448 (global-set-key [f7] 'occur)
   448 (global-set-key [f7] 'occur)
   449 
   449 
   450 ;;; ----------------------------------------------------------------
   450 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   451 (message "grep, find")
   451 (message "grep, find")
   452 
   452 
   453 ;; -ls produce very noisy output:
   453 ;; -ls produce very noisy output:
   454 ;; (setq find-ls-option '("-ls" . ""))
   454 ;; (setq find-ls-option '("-ls" . ""))
   455 ;; So I use next expression, which work with GNU find, I replace %s with '0'
   455 ;; So I use next expression, which work with GNU find, I replace %s with '0'
   472        )
   472        )
   473      ))
   473      ))
   474 
   474 
   475 (global-set-key [M-f7] 'rgrep)
   475 (global-set-key [M-f7] 'rgrep)
   476 
   476 
   477 ;;; ----------------------------------------------------------------
   477 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   478 (message "syntax highlighting")
   478 (message "syntax highlighting")
   479 
   479 
   480 (setq font-lock-maximum-decoration t)
   480 (setq font-lock-maximum-decoration t)
   481 (global-font-lock-mode 1)
   481 (global-font-lock-mode 1)
   482 
   482 
   483 ;;; ----------------------------------------------------------------
   483 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   484 (message "highlight selected text")
   484 (message "highlight selected text")
   485 
   485 
   486 ;; 1/-1, when the mark is active, the region is highlighted.
   486 ;; 1/-1, when the mark is active, the region is highlighted.
   487 (transient-mark-mode 1)
   487 (transient-mark-mode 1)
   488 (delete-selection-mode 1)               ; 1/-1
   488 (delete-selection-mode 1)               ; 1/-1
   498 
   498 
   499 (when (eq window-system 'x)
   499 (when (eq window-system 'x)
   500   (setq x-select-enable-clipboard t)    ; for Emacs 21.2.1 and newer
   500   (setq x-select-enable-clipboard t)    ; for Emacs 21.2.1 and newer
   501   )
   501   )
   502 
   502 
   503 ;;; ----------------------------------------------------------------
   503 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   504 (message "highlighting current line")
   504 (message "highlighting current line")
   505 
   505 
   506 (when window-system
   506 (when window-system
   507   (custom-set-faces '(hl-line ((t (:inherit highlight :background "light yellow")))))
   507   (custom-set-faces '(hl-line ((t (:inherit highlight :background "light yellow")))))
   508   (global-hl-line-mode 1)
   508   (global-hl-line-mode 1)
   509   )
   509   )
   510 
   510 
   511 ;;; ----------------------------------------------------------------
   511 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   512 (message "paren, braces")
   512 (message "paren, braces")
   513 
   513 
   514 (show-paren-mode 1) ; Parenthesis matching via highlighting.
   514 (show-paren-mode 1) ; Parenthesis matching via highlighting.
   515 (setq show-paren-style (quote parenthesis))
   515 (setq show-paren-style (quote parenthesis))
   516 
   516 
   517 ;;; ----------------------------------------------------------------
   517 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   518 (message "keyboard, mouse")
   518 (message "keyboard, mouse")
   519 
   519 
   520 ;; cyrillic-jis-russian  for 567 is :,.
   520 ;; cyrillic-jis-russian  for 567 is :,.
   521 ;; cyrillic-jcuken  for SHIFT 567 is :,.
   521 ;; cyrillic-jcuken  for SHIFT 567 is :,.
   522 ;; russian-computer for SHIFT 567 is %^&
   522 ;; russian-computer for SHIFT 567 is %^&
   523 (if (>= emacs-major-version 22)
   523 (if (>= emacs-major-version 22)
   524     (setq default-input-method 'russian-computer)
   524     (setq default-input-method 'russian-computer)
   525   (setq default-input-method 'cyrillic-jcuken))
   525   (setq default-input-method 'cyrillic-jcuken))
   526 ;; (pc-bindings-mode) ; Myself define keybinding, see
   526 ;; (pc-bindings-mode) ; Myself define keybinding, see
   527 
   527 
   528 ;;; ----------------------------------------------------------------
   528 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   529 (message "completion")
   529 (message "completion")
   530 
   530 
   531 ;; I remove partial-completion-mode because it depricated in Emacs 24.0.
   531 ;; I remove partial-completion-mode because it depricated in Emacs 24.0.
   532 ;; Completion controled by 'completion-styles' variable.
   532 ;; Completion controled by 'completion-styles' variable.
   533 
   533 
   534 ;;; ----------------------------------------------------------------
   534 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   535 (message "mouse")
   535 (message "mouse")
   536 
   536 
   537 ;; Scroll Bar gets dragged by mouse butn 1
   537 ;; Scroll Bar gets dragged by mouse butn 1
   538 (global-set-key [vertical-scroll-bar down-mouse-1] 'scroll-bar-drag)
   538 (global-set-key [vertical-scroll-bar down-mouse-1] 'scroll-bar-drag)
   539 ;; Paste at point NOT at cursor
   539 ;; Paste at point NOT at cursor
   540 (setq mouse-yank-at-point t)
   540 (setq mouse-yank-at-point t)
   541 (when window-system
   541 (when window-system
   542   (mouse-wheel-mode 1)
   542   (mouse-wheel-mode 1)
   543   )
   543   )
   544 
   544 
   545 ;;; ----------------------------------------------------------------
   545 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   546 (message "key binding, short-keys")
   546 (message "key binding, short-keys")
   547 
   547 
   548 (global-set-key [home]    'beginning-of-line)
   548 (global-set-key [home]    'beginning-of-line)
   549 (global-set-key [end]     'end-of-line)
   549 (global-set-key [end]     'end-of-line)
   550 (global-set-key [C-home] 'beginning-of-buffer)
   550 (global-set-key [C-home] 'beginning-of-buffer)
   576   (global-set-key (kbd "C-z") nil))
   576   (global-set-key (kbd "C-z") nil))
   577 (global-set-key (kbd "C-x C-z") nil)
   577 (global-set-key (kbd "C-x C-z") nil)
   578 
   578 
   579 ;; (global-set-key [language-change] 'ignore)
   579 ;; (global-set-key [language-change] 'ignore)
   580 
   580 
   581 ;;; ----------------------------------------------------------------
   581 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   582 (message "coding system, charset, locale, lang")
   582 (message "coding system, charset, locale, lang")
   583 
   583 
   584 ;; Emacs 23.1 no longer need codepage-setup.
   584 ;; Emacs 23.1 no longer need codepage-setup.
   585 (when (<= emacs-major-version 22)
   585 (when (<= emacs-major-version 22)
   586   (codepage-setup 866)
   586   (codepage-setup 866)
   618   (prefer-coding-system 'utf-8-unix)
   618   (prefer-coding-system 'utf-8-unix)
   619   (modify-coding-system-alist 'process ".*" 'utf-8-unix)
   619   (modify-coding-system-alist 'process ".*" 'utf-8-unix)
   620   )
   620   )
   621  )
   621  )
   622 
   622 
   623 ;;; ----------------------------------------------------------------
   623 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   624 (message "open file, ffap, dired")
   624 (message "open file, ffap, dired")
   625 
   625 
   626 (setq-default save-place t)
   626 (setq-default save-place t)
   627 (require 'saveplace)
   627 (require 'saveplace)
   628 
   628 
   706    )
   706    )
   707   )
   707   )
   708 
   708 
   709 (define-key dired-mode-map (kbd "`") 'my-dired-flag-tmp-files)
   709 (define-key dired-mode-map (kbd "`") 'my-dired-flag-tmp-files)
   710 
   710 
   711 ;;; ----------------------------------------------------------------
   711 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   712 (message "ls-lisp, dired ls")
   712 (message "ls-lisp, dired ls")
   713 
   713 
   714 ;; If non-nil - use 'insert-directory-program', which I dislike.
   714 ;; If non-nil - use 'insert-directory-program', which I dislike.
   715 (setq ls-lisp-use-insert-directory-program nil)
   715 (setq ls-lisp-use-insert-directory-program nil)
   716 (setq ls-lisp-ignore-case t)
   716 (setq ls-lisp-ignore-case t)
   723 (setq ls-lisp-format-time-list
   723 (setq ls-lisp-format-time-list
   724       '("%Y-%m-%d %H:%M:%S"
   724       '("%Y-%m-%d %H:%M:%S"
   725         "%Y-%m-%d %H:%M   "))
   725         "%Y-%m-%d %H:%M   "))
   726 (require 'ls-lisp)
   726 (require 'ls-lisp)
   727 
   727 
   728 ;;; ----------------------------------------------------------------
   728 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   729 (message "compression, archive")
   729 (message "compression, archive")
   730 
   730 
   731 (require 'jka-compr) ; Automatic decompression, hooks for tar-mode.
   731 (require 'jka-compr) ; Automatic decompression, hooks for tar-mode.
   732 (when (fboundp 'auto-compression-mode)
   732 (when (fboundp 'auto-compression-mode)
   733   (auto-compression-mode 1))
   733   (auto-compression-mode 1))
   734 
   734 
   735 (modify-coding-system-alist 'file "\\.\\(war\\|ear\\|sar\\|egg\\)\\'" 'no-conversion)
   735 (modify-coding-system-alist 'file "\\.\\(war\\|ear\\|sar\\|egg\\)\\'" 'no-conversion)
   736 
   736 
   737 (add-to-list 'auto-mode-alist '("\\.\\(war\\|ear\\|sar\\|egg\\)\\'" . archive-mode))
   737 (add-to-list 'auto-mode-alist '("\\.\\(war\\|ear\\|sar\\|egg\\)\\'" . archive-mode))
   738 
   738 
   739 ;;; ----------------------------------------------------------------
   739 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   740 (message "image, png, svg")
   740 (message "image, png, svg")
   741 
   741 
   742 (when (fboundp 'auto-image-file-mode)
   742 (when (fboundp 'auto-image-file-mode)
   743   (auto-image-file-mode 1))
   743   (auto-image-file-mode 1))
   744 (eval-after-load 'image-file
   744 (eval-after-load 'image-file
   748      (setq image-file-name-extensions (remove "svg" image-file-name-extensions))
   748      (setq image-file-name-extensions (remove "svg" image-file-name-extensions))
   749      ;; Re-initialize the image-file handler.
   749      ;; Re-initialize the image-file handler.
   750      (auto-image-file-mode t)
   750      (auto-image-file-mode t)
   751      ))
   751      ))
   752 
   752 
   753 ;;; ----------------------------------------------------------------
   753 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   754 (message "minibuffer")
   754 (message "minibuffer")
   755 
   755 
   756 (require 'icomplete) ; Interactive completion in minibuffer.
   756 (require 'icomplete) ; Interactive completion in minibuffer.
   757 (icomplete-mode 1)
   757 (icomplete-mode 1)
   758 
   758 
   763         ;; Place dir at end to appear at the start of completion-ignored-extensions.
   763         ;; Place dir at end to appear at the start of completion-ignored-extensions.
   764         "CVS/" ".hg/" ".svn/" ".git/" ".bzr/"
   764         "CVS/" ".hg/" ".svn/" ".git/" ".bzr/"
   765         ) )
   765         ) )
   766 (setq read-file-name-completion-ignore-case t)
   766 (setq read-file-name-completion-ignore-case t)
   767 
   767 
   768 ;;; ----------------------------------------------------------------
   768 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   769 (message "music")
   769 (message "music")
   770 (setq gnus-audio-au-player "winamp.exe"
   770 (setq gnus-audio-au-player "winamp.exe"
   771       gnus-audio-directory "D:\\music"
   771       gnus-audio-directory "D:\\music"
   772       gnus-audio-wav-player "winamp.exe")
   772       gnus-audio-wav-player "winamp.exe")
   773 
   773 
   774 ;;; ----------------------------------------------------------------
   774 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   775 (message "url")
   775 (message "url")
   776 
   776 
   777 ;; http://tools.ietf.org/html/rfc3986
   777 ;; http://tools.ietf.org/html/rfc3986
   778 ;; http://en.wikipedia.org/wiki/Percent-encoding
   778 ;; http://en.wikipedia.org/wiki/Percent-encoding
   779 (defun my-percent-decode (str)
   779 (defun my-percent-decode (str)
   796         (message result)
   796         (message result)
   797       (delete-region beg end)
   797       (delete-region beg end)
   798       (insert result))
   798       (insert result))
   799     ) )
   799     ) )
   800 
   800 
   801 ;;; ----------------------------------------------------------------
   801 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   802 (message "browser")
   802 (message "browser")
   803 
   803 
   804 (cond
   804 (cond
   805  ((equal window-system 'w32)
   805  ((equal window-system 'w32)
   806   (setq browse-url-browser-function 'browse-url-default-windows-browser))
   806   (setq browse-url-browser-function 'browse-url-default-windows-browser))
   813   "Search for Cygwin package on-line."
   813   "Search for Cygwin package on-line."
   814   (interactive (list (read-input "Search for Cygwin package on-line: ")))
   814   (interactive (list (read-input "Search for Cygwin package on-line: ")))
   815   (browse-url (format "http://cygwin.com/cgi-bin2/package-grep.cgi?grep=%s" str))
   815   (browse-url (format "http://cygwin.com/cgi-bin2/package-grep.cgi?grep=%s" str))
   816   )
   816   )
   817 
   817 
   818 ;;; ----------------------------------------------------------------
   818 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   819 (message "calendar")
   819 (message "calendar")
   820 
   820 
   821 ;; (setq mark-holidays-in-calendar t)
   821 ;; (setq mark-holidays-in-calendar t)
   822 ;; (setq all-christian-calendar-holidays t)
   822 ;; (setq all-christian-calendar-holidays t)
   823 ;; (setq calendar-date-display-form (quote ((format "%04s-%02d-%02d" year (string-to-int month) (string-to-int day)))))
   823 ;; (setq calendar-date-display-form (quote ((format "%04s-%02d-%02d" year (string-to-int month) (string-to-int day)))))
   824 ;; (setq calendar-time-display-form (quote (24-hours ":" minutes (if time-zone " (") time-zone (if time-zone ")"))))
   824 ;; (setq calendar-time-display-form (quote (24-hours ":" minutes (if time-zone " (") time-zone (if time-zone ")"))))
   825 (setq calendar-week-start-day 1)
   825 (setq calendar-week-start-day 1)
   826 (setq european-calendar-style t)
   826 (setq european-calendar-style t)
   827 
   827 
   828 ;;; ----------------------------------------------------------------
   828 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   829 (message "standard hooks")
   829 (message "standard hooks")
   830 
   830 
   831 (add-hook 'write-file-hooks 'time-stamp)
   831 (add-hook 'write-file-hooks 'time-stamp)
   832 
   832 
   833 ;;; ----------------------------------------------------------------
   833 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   834 (message "auto-fill")
   834 (message "auto-fill")
   835 
   835 
   836 (setq-default fill-column 78)
   836 (setq-default fill-column 78)
   837 
   837 
   838 (defvar my-fill-column 100
   838 (defvar my-fill-column 100
   844 
   844 
   845 ;; Turn on auto-fill mode
   845 ;; Turn on auto-fill mode
   846 (add-hook 'html-mode-hook 'turn-on-auto-fill)
   846 (add-hook 'html-mode-hook 'turn-on-auto-fill)
   847 (add-hook 'text-mode-hook 'turn-on-auto-fill)
   847 (add-hook 'text-mode-hook 'turn-on-auto-fill)
   848 
   848 
   849 ;;; ----------------------------------------------------------------
   849 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   850 (message "unknown")
   850 (message "unknown")
   851 
   851 
   852 ;; mailcrypt gnus message sendmail bbdb pilot bibtex eiffel-mode emacs-w3m
   852 ;; mailcrypt gnus message sendmail bbdb pilot bibtex eiffel-mode emacs-w3m
   853 ;; eudc filladapt hugs-mode mpg123 php-mode ps-print
   853 ;; eudc filladapt hugs-mode mpg123 php-mode ps-print
   854 ;; chord-mode - edit guitar music
   854 ;; chord-mode - edit guitar music
   855 ;; discography - variant of BibTeX mode for discographies
   855 ;; discography - variant of BibTeX mode for discographies
   856 
   856 
   857 ;;; ----------------------------------------------------------------
   857 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   858 (message "cacl, calculator")
   858 (message "cacl, calculator")
   859 
   859 
   860 (setq-default calc-group-digits t)
   860 (setq-default calc-group-digits t)
   861 (setq-default calc-group-char "'")
   861 (setq-default calc-group-char "'")
   862 
   862 
   889         '(rst-level-4-face ((t (:background "yellow"))) t)
   889         '(rst-level-4-face ((t (:background "yellow"))) t)
   890         '(rst-level-5-face ((t (:background "yellow"))) t)
   890         '(rst-level-5-face ((t (:background "yellow"))) t)
   891         '(rst-level-6face ((t (:background "yellow"))) t)
   891         '(rst-level-6face ((t (:background "yellow"))) t)
   892         ) ) ) )
   892         ) ) ) )
   893 
   893 
   894 ;;; ----------------------------------------------------------------
   894 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   895 (message "TeX, LaTeX")
   895 (message "TeX, LaTeX")
   896 
   896 
   897 (setq tex-run-command "initex")
   897 (setq tex-run-command "initex")
   898 
   898 
   899 ;;; ----------------------------------------------------------------
   899 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   900 (message "AUC TeX")
   900 (message "AUC TeX")
   901 
   901 
   902 ;(add-hook 'LaTeX-mode-hook 'LaTeX-install-toolbar)
   902 ;(add-hook 'LaTeX-mode-hook 'LaTeX-install-toolbar)
   903 ;; (setq TeX-parse-self t)             ; Enable parse on load.
   903 ;; (setq TeX-parse-self t)             ; Enable parse on load.
   904 ;; (setq TeX-auto-save t)              ; Enable parse on save.
   904 ;; (setq TeX-auto-save t)              ; Enable parse on save.
   931 ;     (add-to-list 'TeX-command-list
   931 ;     (add-to-list 'TeX-command-list
   932 ;         (list "All Texify run-viewer"
   932 ;         (list "All Texify run-viewer"
   933 ;           "texify --tex-opt=--src --run-viewer --clean %s.tex"
   933 ;           "texify --tex-opt=--src --run-viewer --clean %s.tex"
   934 ;           'TeX-run-command nil t))))
   934 ;           'TeX-run-command nil t))))
   935 
   935 
   936 ;;; ----------------------------------------------------------------
   936 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   937 (message "reftex")
   937 (message "reftex")
   938 
   938 
   939 ;; Reftex is included with Emacs 21.1.
   939 ;; Reftex is included with Emacs 21.1.
   940 
   940 
   941 ;; (autoload 'reftex-mode     "reftex" "RefTeX Minor Mode" t)
   941 ;; (autoload 'reftex-mode     "reftex" "RefTeX Minor Mode" t)
   943 ;; (autoload 'reftex-citation "reftex-cite" "Make citation" nil)
   943 ;; (autoload 'reftex-citation "reftex-cite" "Make citation" nil)
   944 ;; (autoload 'reftex-index-phrase-mode "reftex-index" "Phrase mode" t)
   944 ;; (autoload 'reftex-index-phrase-mode "reftex-index" "Phrase mode" t)
   945 ;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex)   ; with AUCTeX LaTeX mode
   945 ;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex)   ; with AUCTeX LaTeX mode
   946 ;; (add-hook 'latex-mode-hook 'turn-on-reftex)   ; with Emacs latex mode
   946 ;; (add-hook 'latex-mode-hook 'turn-on-reftex)   ; with Emacs latex mode
   947 
   947 
   948 ;;; ----------------------------------------------------------------
   948 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   949 (message "PreviewLatex")
   949 (message "PreviewLatex")
   950 
   950 
   951 ;(load "preview-latex.el" nil t t)
   951 ;(load "preview-latex.el" nil t t)
   952 
   952 
   953 ;(add-hook 'LaTeX-mode-hook #'LaTeX-preview-setup)
   953 ;(add-hook 'LaTeX-mode-hook #'LaTeX-preview-setup)
   954 ;(autoload 'LaTeX-preview-setup "preview")
   954 ;(autoload 'LaTeX-preview-setup "preview")
   955 
   955 
   956 ;;; ----------------------------------------------------------------
   956 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   957 (message "Info")
   957 (message "Info")
   958 
   958 
   959 ;; Because of Debian policy documentation covered by FDL license with invariant sections not allowed in packet
   959 ;; Because of Debian policy documentation covered by FDL license with invariant sections not allowed in packet
   960 ;; repository tree. So it must be installed manually. My usual configuration is install user local software
   960 ;; repository tree. So it must be installed manually. My usual configuration is install user local software
   961 ;; into ~/usr DISTDIR.
   961 ;; into ~/usr DISTDIR.
   962 (unless (getenv "INFOPATH")
   962 (unless (getenv "INFOPATH")
   963   (setenv "INFOPATH" "~/usr/share/info:"))
   963   (setenv "INFOPATH" "~/usr/share/info:"))
   964 
   964 
   965 ;;; ----------------------------------------------------------------
   965 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   966 (message "man, woman")
   966 (message "man, woman")
   967 
   967 
   968 (setq woman-use-own-frame nil)
   968 (setq woman-use-own-frame nil)
   969 (setq woman-fill-frame t)
   969 (setq woman-fill-frame t)
   970 
   970 
   971 ;;; ----------------------------------------------------------------
   971 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   972 (message "comint")
   972 (message "comint")
   973 
   973 
   974 ;; If non-nil, add a `/' to completed directories, ` ' to file names.
   974 ;; If non-nil, add a `/' to completed directories, ` ' to file names.
   975 (setq comint-completion-addsuffix t)
   975 (setq comint-completion-addsuffix t)
   976 ;; Non-nil means go to the end of the line before sending input.
   976 ;; Non-nil means go to the end of the line before sending input.
   977 (setq comint-eol-on-send t)
   977 (setq comint-eol-on-send t)
   978 
   978 
   979 ;;; ----------------------------------------------------------------
   979 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   980 (message "spell, ispell, aspell")
   980 (message "spell, ispell, aspell")
   981 
   981 
   982 ;; Settings for spelling done in '.emacs-autogen'.
   982 ;; Settings for spelling done in '.emacs-autogen'.
   983 ;(add-hook 'text-mode-hook 'flyspell-mode)
   983 ;(add-hook 'text-mode-hook 'flyspell-mode)
   984 ;(setq flyspell-default-dictionary "russianw")
   984 ;(setq flyspell-default-dictionary "russianw")
   985 ;(setq flyspell-delay '1)
   985 ;(setq flyspell-delay '1)
   986 
   986 
   987 ;;; ----------------------------------------------------------------
   987 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   988 (message "dict, dictd, dictionary")
   988 (message "dict, dictd, dictionary")
   989 
   989 
   990 (when (fboundp 'dict-c5-mode)
   990 (when (fboundp 'dict-c5-mode)
   991   (add-to-list 'auto-mode-alist '("\\.dict-c5$" . dict-c5-mode))
   991   (add-to-list 'auto-mode-alist '("\\.dict-c5$" . dict-c5-mode))
   992   )
   992   )
   993 
   993 
   994 ;;; ----------------------------------------------------------------
   994 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   995 (message "remember-mode")
   995 (message "remember-mode")
   996 
   996 
   997 (when (>= emacs-major-version 23)
   997 (when (>= emacs-major-version 23)
   998   (require 'remember))
   998   (require 'remember))
   999 
   999 
  1000 ;;; ----------------------------------------------------------------
  1000 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1001 (message "org-mode, GTD, PIM, organize, todo")
  1001 (message "org-mode, GTD, PIM, organize, todo")
  1002 
  1002 
  1003 (when (>= emacs-major-version 22)
  1003 (when (>= emacs-major-version 22)
  1004   (require 'org))
  1004   (require 'org))
  1005 
  1005 
  1065   ;;       '(("TODO" . (:foreground "red" :weight bold))
  1065   ;;       '(("TODO" . (:foreground "red" :weight bold))
  1066   ;;         ("WAIT" . (:foreground "orange" :weight bold))
  1066   ;;         ("WAIT" . (:foreground "orange" :weight bold))
  1067   ;;         ("DONE" . (:foreground "green" :weight bold))) )
  1067   ;;         ("DONE" . (:foreground "green" :weight bold))) )
  1068   )
  1068   )
  1069 
  1069 
  1070 ;;; ----------------------------------------------------------------
  1070 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1071 (message "TODO, XXX, FIXME highlight")
  1071 (message "TODO, XXX, FIXME highlight")
  1072 ;; Show blanks and FIXME
  1072 ;; Show blanks and FIXME
  1073 ;; http://www.emacswiki.org/cgi-bin/wiki/EightyColumnRule
  1073 ;; http://www.emacswiki.org/cgi-bin/wiki/EightyColumnRule
  1074 
  1074 
  1075 (defface my-tab-face
  1075 (defface my-tab-face
  1092      ;; 64 times, for highlight C-u C-u C-u <key>
  1092      ;; 64 times, for highlight C-u C-u C-u <key>
  1093      ("\\([^[:space:]]\\)\\1\\{63\\}" 0 'my-contrasty-face t)
  1093      ("\\([^[:space:]]\\)\\1\\{63\\}" 0 'my-contrasty-face t)
  1094      ))
  1094      ))
  1095   )
  1095   )
  1096 
  1096 
  1097 ;;; ----------------------------------------------------------------
  1097 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1098 (message "fortune")
  1098 (message "fortune")
  1099 (setq fortune-file "~/XXX")
  1099 (setq fortune-file "~/XXX")
  1100 
  1100 
  1101 ;;; ----------------------------------------------------------------
  1101 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1102 (message "mail, mh-e")
  1102 (message "mail, mh-e")
  1103 
  1103 
  1104 (setq mail-signature t)
  1104 (setq mail-signature t)
  1105 (setq mail-signature-file "~/.signature")
  1105 (setq mail-signature-file "~/.signature")
  1106 ;; (add-hook 'mail-setup-hook 'fortune-to-signature)
  1106 ;; (add-hook 'mail-setup-hook 'fortune-to-signature)
  1107 
  1107 
  1108 ;; (setq mail-user-agent 'mh-e-user-agent)
  1108 ;; (setq mail-user-agent 'mh-e-user-agent)
  1109 
  1109 
  1110 ;;; ----------------------------------------------------------------
  1110 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1111 (message "jabber")
  1111 (message "jabber")
  1112 
  1112 
  1113 (autoload 'jabber-connect-all "jabber")
  1113 (autoload 'jabber-connect-all "jabber")
  1114 
  1114 
  1115 (setq
  1115 (setq
  1174     )
  1174     )
  1175   )
  1175   )
  1176 
  1176 
  1177 (global-set-key (kbd "C-x C-j C-s") 'my-jabber-send)
  1177 (global-set-key (kbd "C-x C-j C-s") 'my-jabber-send)
  1178 
  1178 
  1179 ;;; ----------------------------------------------------------------
  1179 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1180 (message "rcirc")
  1180 (message "rcirc")
  1181 
  1181 
  1182 ;; Turn on logging everything to a special buffer, for debugging.
  1182 ;; Turn on logging everything to a special buffer, for debugging.
  1183 ;; (setq rcirc-debug-flag t)
  1183 ;; (setq rcirc-debug-flag t)
  1184 
  1184 
  1190 (setq rcirc-default-server "irc.freenode.net")
  1190 (setq rcirc-default-server "irc.freenode.net")
  1191 (setq rcirc-default-port 6667)
  1191 (setq rcirc-default-port 6667)
  1192 (setq rcirc-default-nick user-nick)
  1192 (setq rcirc-default-nick user-nick)
  1193 (setq rcirc-default-user-full-name user-full-name)
  1193 (setq rcirc-default-user-full-name user-full-name)
  1194 
  1194 
  1195 ;;; ----------------------------------------------------------------
  1195 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1196 (message "erc")
  1196 (message "erc")
  1197 
  1197 
  1198 ;; (add-to-list 'erc-modules 'notify)
  1198 ;; (add-to-list 'erc-modules 'notify)
  1199 ;; (setq erc-notify-list '(""))
  1199 ;; (setq erc-notify-list '(""))
  1200 
  1200 
  1223 ;; Kill buffers for private queries after quitting the server
  1223 ;; Kill buffers for private queries after quitting the server
  1224 ;; (setq erc-kill-queries-on-quit t)
  1224 ;; (setq erc-kill-queries-on-quit t)
  1225 ;; Kill buffers for server messages after quitting the server
  1225 ;; Kill buffers for server messages after quitting the server
  1226 ;; (setq erc-kill-server-buffer-on-quit t)
  1226 ;; (setq erc-kill-server-buffer-on-quit t)
  1227 
  1227 
  1228 ;;; ----------------------------------------------------------------
  1228 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1229 (message "vc-mode, VCS, version control, cvs, svn, mercurial, hg, bazaar, bzr, git, fossil")
  1229 (message "vc-mode, VCS, version control, cvs, svn, mercurial, hg, bazaar, bzr, git, fossil")
  1230 
  1230 
  1231 ;; `-b' switch to ignore changes in whitespaces.
  1231 ;; `-b' switch to ignore changes in whitespaces.
  1232 ;; (setq vc-git-diff-switches "-b")
  1232 ;; (setq vc-git-diff-switches "-b")
  1233 ;; (setq vc-diff-switches "-b")
  1233 ;; (setq vc-diff-switches "-b")
  1262      (320 . "#2780C6")
  1262      (320 . "#2780C6")
  1263      (340 . "#1A00D3")
  1263      (340 . "#1A00D3")
  1264      (360 . "#0D80E0")))
  1264      (360 . "#0D80E0")))
  1265   )
  1265   )
  1266 
  1266 
  1267 ;;; ----------------------------------------------------------------
  1267 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1268 (message "psvn")
  1268 (message "psvn")
  1269 
  1269 
  1270 (setq svn-status-verbose t)
  1270 (setq svn-status-verbose t)
  1271 (setq svn-status-hide-unmodified t)
  1271 (setq svn-status-hide-unmodified t)
  1272 
  1272 
  1273 ;;; ----------------------------------------------------------------
  1273 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1274 (message "DVC")
  1274 (message "DVC")
  1275 
  1275 
  1276 (when (featurep 'dvc-emacs)
  1276 (when (featurep 'dvc-emacs)
  1277   (setq dvc-tips-enabled nil)
  1277   (setq dvc-tips-enabled nil)
  1278   )
  1278   )
  1279 
  1279 
  1280 ;;; ----------------------------------------------------------------
  1280 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1281 (message "devel, prog, programming")
  1281 (message "devel, prog, programming")
  1282 
  1282 
  1283 (which-func-mode 1)
  1283 (which-func-mode 1)
  1284 
  1284 
  1285 (add-to-list 'auto-mode-alist '("\\.cu$" . c-mode))
  1285 (add-to-list 'auto-mode-alist '("\\.cu$" . c-mode))
  1301 (setq-default comment-fill-column my-fill-column)
  1301 (setq-default comment-fill-column my-fill-column)
  1302 
  1302 
  1303 (mapc (lambda (hook) (add-hook hook (lambda () (setq fill-column my-fill-column)) ))
  1303 (mapc (lambda (hook) (add-hook hook (lambda () (setq fill-column my-fill-column)) ))
  1304       (append my-devel-mode-hook-list my-text-mode-hook-list))
  1304       (append my-devel-mode-hook-list my-text-mode-hook-list))
  1305 
  1305 
  1306 ;;; ----------------------------------------------------------------
  1306 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1307 (message "diff, patch, ediff, emerge")
  1307 (message "diff, patch, ediff, emerge")
  1308 
  1308 
  1309 (setq diff-switches "-u")
  1309 (setq diff-switches "-u")
  1310 
  1310 
  1311 (setq ediff-diff-options "")
  1311 (setq ediff-diff-options "")
  1316     '(progn
  1316     '(progn
  1317        (set-face-foreground 'diff-added-face "DarkGreen")
  1317        (set-face-foreground 'diff-added-face "DarkGreen")
  1318        (set-face-foreground 'diff-removed-face "DarkRed")
  1318        (set-face-foreground 'diff-removed-face "DarkRed")
  1319   )))
  1319   )))
  1320 
  1320 
  1321 ;;; ----------------------------------------------------------------
  1321 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1322 (message "indenting")
  1322 (message "indenting")
  1323 
  1323 
  1324 (setq standard-indent 4)
  1324 (setq standard-indent 4)
  1325 (setq c-basic-offset 4)
  1325 (setq c-basic-offset 4)
  1326 (setq sh-basic-offset 2)
  1326 (setq sh-basic-offset 2)
  1336   (setq tab-stop-list nil)
  1336   (setq tab-stop-list nil)
  1337   (while (>= i 0)
  1337   (while (>= i 0)
  1338     (setq tab-stop-list (cons i tab-stop-list))
  1338     (setq tab-stop-list (cons i tab-stop-list))
  1339     (setq i (- i 4))))
  1339     (setq i (- i 4))))
  1340 
  1340 
  1341 ;;; ----------------------------------------------------------------
  1341 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1342 (message "compile")
  1342 (message "compile")
  1343 
  1343 
  1344 ;; Prompt for compilation command.
  1344 ;; Prompt for compilation command.
  1345 (setq compilation-read-command 1)
  1345 (setq compilation-read-command 1)
  1346 (setq compile-auto-highlight t)
  1346 (setq compile-auto-highlight t)
  1380 (eval-after-load 'compile
  1380 (eval-after-load 'compile
  1381   '(progn
  1381   '(progn
  1382      (define-key compilation-mode-map [C-return] 'my-comint-send-string)
  1382      (define-key compilation-mode-map [C-return] 'my-comint-send-string)
  1383      ))
  1383      ))
  1384 
  1384 
  1385 ;;; ----------------------------------------------------------------
  1385 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1386 (message "TAGS, etags, ctags, GNU GLOBAL")
  1386 (message "TAGS, etags, ctags, GNU GLOBAL")
  1387 
  1387 
  1388 ;; One of 'tags-table-list' or 'tags-file-name' control which TAGS files to
  1388 ;; One of 'tags-table-list' or 'tags-file-name' control which TAGS files to
  1389 ;; use.
  1389 ;; use.
  1390 
  1390 
  1396   )
  1396   )
  1397 
  1397 
  1398 (setq tags-add-tables t)
  1398 (setq tags-add-tables t)
  1399 (global-set-key "\M-\r" 'complete-tag)
  1399 (global-set-key "\M-\r" 'complete-tag)
  1400 
  1400 
  1401 ;;; ----------------------------------------------------------------
  1401 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1402 (message "CEDET, semantic")
  1402 (message "CEDET, semantic")
  1403 
  1403 
  1404 ;; For debug use 'semantic-debug-idle-function' and 'semantic-debug-idle-work-function'.
  1404 ;; For debug use 'semantic-debug-idle-function' and 'semantic-debug-idle-work-function'.
  1405 
  1405 
  1406 (unless (featurep 'cedet)
  1406 (unless (featurep 'cedet)
  1446   (global-set-key (kbd "C-c , d") 'semantic-ia-show-doc)
  1446   (global-set-key (kbd "C-c , d") 'semantic-ia-show-doc)
  1447   (global-set-key (kbd "C-c , D") 'semantic-ia-describe-class)
  1447   (global-set-key (kbd "C-c , D") 'semantic-ia-describe-class)
  1448   (global-set-key (kbd "C-c , c") 'semantic-ia-complete-symbol-menu)
  1448   (global-set-key (kbd "C-c , c") 'semantic-ia-complete-symbol-menu)
  1449   )
  1449   )
  1450 
  1450 
  1451 ;;; ----------------------------------------------------------------
  1451 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1452 (message "imenu")
  1452 (message "imenu")
  1453 
  1453 
  1454 (defun my-imenu-to-menubar ()
  1454 (defun my-imenu-to-menubar ()
  1455   (imenu-add-menubar-index)
  1455   (imenu-add-menubar-index)
  1456   (run-hooks 'menu-bar-update-hook)
  1456   (run-hooks 'menu-bar-update-hook)
  1458 
  1458 
  1459 (require 'imenu)
  1459 (require 'imenu)
  1460 (mapc (lambda (hook) (add-hook hook 'my-imenu-to-menubar))
  1460 (mapc (lambda (hook) (add-hook hook 'my-imenu-to-menubar))
  1461       my-devel-mode-hook-list)
  1461       my-devel-mode-hook-list)
  1462 
  1462 
  1463 ;;; ----------------------------------------------------------------
  1463 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1464 (message "windows inf files for driver installin")
  1464 (message "windows inf files for driver installin")
  1465 
  1465 
  1466 (add-to-list 'auto-mode-alist '("\\.inf\\'" . conf-mode))
  1466 (add-to-list 'auto-mode-alist '("\\.inf\\'" . conf-mode))
  1467 
  1467 
  1468 ;;; ----------------------------------------------------------------
  1468 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1469 (message "makefile, make")
  1469 (message "makefile, make")
  1470 
  1470 
  1471 (add-to-list 'auto-mode-alist '("\\(Makefile\\|Makefile\\..+\\)\\'" . makefile-gmake-mode))
  1471 (add-to-list 'auto-mode-alist '("\\(Makefile\\|Makefile\\..+\\)\\'" . makefile-gmake-mode))
  1472 
  1472 
  1473 ;;; ----------------------------------------------------------------
  1473 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1474 (message "asm, assembler")
  1474 (message "asm, assembler")
  1475 
  1475 
  1476 ;; (setq-default asm-comment-char 59)
  1476 ;; (setq-default asm-comment-char 59)
  1477 (add-hook 'asm-mode-hook '(lambda () (setq comment-start "/*") (setq comment-end "*/")) t)
  1477 (add-hook 'asm-mode-hook '(lambda () (setq comment-start "/*") (setq comment-end "*/")) t)
  1478 
  1478 
  1479 (add-to-list 'auto-mode-alist '("\\.\\([sS]79\\|[sS]\\)\\'" . asm-mode))
  1479 (add-to-list 'auto-mode-alist '("\\.\\([sS]79\\|[sS]\\)\\'" . asm-mode))
  1480 
  1480 
  1481 ;; (add-hook 'asm-mode-hook '(lambda () (local-unset-key ":")))
  1481 ;; (add-hook 'asm-mode-hook '(lambda () (local-unset-key ":")))
  1482 ;; (add-hook 'asm-mode-hook '(lambda () (local-set-key ":" ":")))
  1482 ;; (add-hook 'asm-mode-hook '(lambda () (local-set-key ":" ":")))
  1483 
  1483 
  1484 ;;; ----------------------------------------------------------------
  1484 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1485 (message "linker")
  1485 (message "linker")
  1486 
  1486 
  1487 (when (fboundp 'iar-linker-config-mode)
  1487 (when (fboundp 'iar-linker-config-mode)
  1488   (add-to-list 'auto-mode-alist '("\\.icf\\'" . iar-linker-config-mode))
  1488   (add-to-list 'auto-mode-alist '("\\.icf\\'" . iar-linker-config-mode))
  1489   )
  1489   )
  1490 (when (fboundp 'iar4-linker-config-mode)
  1490 (when (fboundp 'iar4-linker-config-mode)
  1491   (add-to-list 'auto-mode-alist '("\\.xcl\\'" . iar4-linker-config-mode))
  1491   (add-to-list 'auto-mode-alist '("\\.xcl\\'" . iar4-linker-config-mode))
  1492   )
  1492   )
  1493 
  1493 
  1494 ;;; ----------------------------------------------------------------
  1494 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1495 (message "lisp, elisp")
  1495 (message "lisp, elisp")
  1496 
  1496 
  1497 (setq list-command-history-max 256)
  1497 (setq list-command-history-max 256)
  1498 
  1498 
  1499 (add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode)
  1499 (add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode)
  1515    ("(\\<\\(lambda\\)\\>"
  1515    ("(\\<\\(lambda\\)\\>"
  1516     (1 (progn (compose-region (match-beginning 1) (match-end 1) ,(make-char 'greek-iso8859-7 107)) font-lock-keyword-face))
  1516     (1 (progn (compose-region (match-beginning 1) (match-end 1) ,(make-char 'greek-iso8859-7 107)) font-lock-keyword-face))
  1517     )
  1517     )
  1518    ))
  1518    ))
  1519 
  1519 
  1520 ;;; ----------------------------------------------------------------
  1520 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1521 (message "C, c-mode, C++, c++-mode")
  1521 (message "C, c-mode, C++, c++-mode")
  1522 
  1522 
  1523 ;; Minor mode that highlights suspicious C and C++ constructions.
  1523 ;; Minor mode that highlights suspicious C and C++ constructions.
  1524 (cwarn-mode 1)
  1524 (cwarn-mode 1)
  1525 
  1525 
  1592           (other . "my")
  1592           (other . "my")
  1593           ))
  1593           ))
  1594   )
  1594   )
  1595 (add-hook 'c-mode-common-hook 'my-c-mode-style-hook)
  1595 (add-hook 'c-mode-common-hook 'my-c-mode-style-hook)
  1596 
  1596 
  1597 ;;; ----------------------------------------------------------------
  1597 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1598 (message "python")
  1598 (message "python")
  1599 
  1599 
  1600 (when (equal window-system 'w32)
  1600 (when (equal window-system 'w32)
  1601   (add-to-list 'process-coding-system-alist '("python" cp1251-unix . cp1251-unix))
  1601   (add-to-list 'process-coding-system-alist '("python" cp1251-unix . cp1251-unix))
  1602   )
  1602   )
  1603 
  1603 
  1604 ;;; ----------------------------------------------------------------
  1604 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1605 (message "javascript, js")
  1605 (message "javascript, js")
  1606 
  1606 
  1607 ;; (if (>= emacs-major-version 23)
  1607 ;; (if (>= emacs-major-version 23)
  1608 ;;     (add-to-list 'auto-mode-alist '("\\.js$" . js-mode))
  1608 ;;     (add-to-list 'auto-mode-alist '("\\.js$" . js-mode))
  1609 ;;   (add-to-list 'auto-mode-alist '("\\.js$" . javascript-generic-mode))
  1609 ;;   (add-to-list 'auto-mode-alist '("\\.js$" . javascript-generic-mode))
  1610 ;;   )
  1610 ;;   )
  1611 
  1611 
  1612 (setq auto-mode-alist (rassq-delete-all 'js-mode auto-mode-alist))
  1612 (setq auto-mode-alist (rassq-delete-all 'js-mode auto-mode-alist))
  1613 (add-to-list 'auto-mode-alist '("\\.js$" . c++-mode))
  1613 (add-to-list 'auto-mode-alist '("\\.js$" . c++-mode))
  1614 
  1614 
  1615 ;;; ----------------------------------------------------------------
  1615 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1616 (message "bat file, batch")
  1616 (message "bat file, batch")
  1617 
  1617 
  1618 ;; loaded from 'generic-x.el'
  1618 ;; loaded from 'generic-x.el'
  1619 
  1619 
  1620 ;;; ----------------------------------------------------------------
  1620 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1621 (message "nsis-mode")
  1621 (message "nsis-mode")
  1622 
  1622 
  1623 (when (fboundp 'nsis-mode)
  1623 (when (fboundp 'nsis-mode)
  1624   (add-to-list 'auto-mode-alist '("\\.\\(nsi\\|nsh\\)\\'" . nsis-mode))
  1624   (add-to-list 'auto-mode-alist '("\\.\\(nsi\\|nsh\\)\\'" . nsis-mode))
  1625   )
  1625   )
  1626 
  1626 
  1627 ;;; ----------------------------------------------------------------
  1627 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1628 (message "csharp, c-sharp")
  1628 (message "csharp, c-sharp")
  1629 
  1629 
  1630 (autoload 'csharp-mode "csharp-mode" "Major mode for editing C# code." t)
  1630 (autoload 'csharp-mode "csharp-mode" "Major mode for editing C# code." t)
  1631 (add-to-list 'auto-mode-alist '("\\.cs$" . csharp-mode))
  1631 (add-to-list 'auto-mode-alist '("\\.cs$" . csharp-mode))
  1632 
  1632 
  1633 ;;; ----------------------------------------------------------------
  1633 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1634 (message "java")
  1634 (message "java")
  1635 
  1635 
  1636 ;;; ----------------------------------------------------------------
  1636 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1637 (message "ECB")
  1637 (message "ECB")
  1638 
  1638 
  1639 (setq ecb-tip-of-the-day nil)
  1639 (setq ecb-tip-of-the-day nil)
  1640 
  1640 
  1641 ;;; ----------------------------------------------------------------
  1641 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1642 (message "html")
  1642 (message "html")
  1643 
  1643 
  1644 (defun html-charref-escape-region (start end)
  1644 (defun html-charref-escape-region (start end)
  1645   (interactive "r")
  1645   (interactive "r")
  1646   (save-excursion
  1646   (save-excursion
  1691         (goto-char begin)
  1691         (goto-char begin)
  1692         (insert (html-charref-to-string (delete-and-extract-region begin end))))
  1692         (insert (html-charref-to-string (delete-and-extract-region begin end))))
  1693     (html-charref-to-string (buffer-substring begin end))
  1693     (html-charref-to-string (buffer-substring begin end))
  1694     ))
  1694     ))
  1695 
  1695 
  1696 ;;; ----------------------------------------------------------------
  1696 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1697 (message "nxml")
  1697 (message "nxml")
  1698 
  1698 
  1699 (setq nxml-sexp-element-flag t)
  1699 (setq nxml-sexp-element-flag t)
  1700 (setq nxml-child-indent 2)
  1700 (setq nxml-child-indent 2)
  1701 (setq nxml-attribute-indent 4)
  1701 (setq nxml-attribute-indent 4)
  1702 
  1702 
  1703 (eval-after-load 'rng-loc
  1703 (eval-after-load 'rng-loc
  1704   '(add-to-list 'rng-schema-locating-files "~/.emacs.d/rnc/schemas.xml")
  1704   '(add-to-list 'rng-schema-locating-files "~/.emacs.d/rnc/schemas.xml")
  1705   )
  1705   )
  1706 
  1706 
  1707 ;;; ----------------------------------------------------------------
  1707 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1708 (message "psgml")
  1708 (message "psgml")
  1709 
  1709 
  1710 (setq my-html-template
  1710 (setq my-html-template
  1711       '("html"
  1711       '("html"
  1712         (nil
  1712         (nil
  1732               (my-filter
  1732               (my-filter
  1733                (lambda (item) (not (equal (car item) "html")))
  1733                (lambda (item) (not (equal (car item) "html")))
  1734                html-tag-alist)))
  1734                html-tag-alist)))
  1735      )))
  1735      )))
  1736 
  1736 
  1737 ;;; ----------------------------------------------------------------
  1737 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1738 (message "sh, bash")
  1738 (message "sh, bash")
  1739 
  1739 
  1740 (add-to-list 'auto-mode-alist '("\\.cygport\\'" . shell-script-mode))
  1740 (add-to-list 'auto-mode-alist '("\\.cygport\\'" . shell-script-mode))
  1741 
  1741 
  1742 ;;; ----------------------------------------------------------------
  1742 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1743 (message "printing")
  1743 (message "printing")
  1744 
  1744 
  1745 ;; Use Notepad to print plain text files to the default Windows printer
  1745 ;; Use Notepad to print plain text files to the default Windows printer
  1746 ;(setq lpr-command "notepad")
  1746 ;(setq lpr-command "notepad")
  1747 ;(setq lpr-headers-switches '("/p"))    ; \ mis-use these
  1747 ;(setq lpr-headers-switches '("/p"))    ; \ mis-use these
  1754 
  1754 
  1755 ;(setq printer-name "~/myprint.txt")
  1755 ;(setq printer-name "~/myprint.txt")
  1756 ;(setq ps-printer-name nil)
  1756 ;(setq ps-printer-name nil)
  1757 ;(setq ps-print-header nil)
  1757 ;(setq ps-print-header nil)
  1758 
  1758 
  1759 ;;; ----------------------------------------------------------------
  1759 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1760 (message "SQL")
  1760 (message "SQL")
  1761 
  1761 
  1762 (setq sql-password "")
  1762 (setq sql-password "")
  1763 
  1763 
  1764 ;;; ----------------------------------------------------------------
  1764 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1765 (message "backuping")
  1765 (message "backuping")
  1766 
  1766 
  1767 (setq
  1767 (setq
  1768  make-backup-files t
  1768  make-backup-files t
  1769  ;; In other case (by renaming) you loose original file creation date.
  1769  ;; In other case (by renaming) you loose original file creation date.
  1772  delete-old-versions t                         ; delete excess backup versions silently
  1772  delete-old-versions t                         ; delete excess backup versions silently
  1773  kept-old-versions 1                           ; store first original version
  1773  kept-old-versions 1                           ; store first original version
  1774  kept-new-versions 3                           ; store last 3 version
  1774  kept-new-versions 3                           ; store last 3 version
  1775  version-control t)                            ; use versioned backups
  1775  version-control t)                            ; use versioned backups
  1776 
  1776 
  1777 ;;; ----------------------------------------------------------------
  1777 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1778 (message "auto save")
  1778 (message "auto save")
  1779 
  1779 
  1780 (setq auto-save-default t)
  1780 (setq auto-save-default t)
  1781 ;; If nil autosave to different than original to buffer file.
  1781 ;; If nil autosave to different than original to buffer file.
  1782 (setq auto-save-visited-file-name nil)
  1782 (setq auto-save-visited-file-name nil)
  1783 (setq auto-save-interval 300)
  1783 (setq auto-save-interval 300)
  1784 ;; Note: if you kill unsaved file auto save file not deleted.
  1784 ;; Note: if you kill unsaved file auto save file not deleted.
  1785 (setq delete-auto-save-files t)
  1785 (setq delete-auto-save-files t)
  1786 
  1786 
  1787 ;;; ----------------------------------------------------------------
  1787 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1788 ;; Save and restore my buffers every time.
  1788 ;; Save and restore my buffers every time.
  1789 (setq desktop-dirname "~/.emacs.d")
  1789 (setq desktop-dirname "~/.emacs.d")
  1790 (when (>= emacs-major-version 22)
  1790 (when (>= emacs-major-version 22)
  1791   (desktop-save-mode 1)
  1791   (desktop-save-mode 1)
  1792   )
  1792   )
  1793 
  1793 
  1794 ;;; ----------------------------------------------------------------
  1794 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1795 (message "User welcome msg")
  1795 (message "User welcome msg")
  1796 
  1796 
  1797 (add-hook 'emacs-startup-hook
  1797 (add-hook 'emacs-startup-hook
  1798           (lambda ()
  1798           (lambda ()
  1799             (let ( (mgs-list '("Welcome to emacs, the thermonuclear editor."
  1799             (let ( (mgs-list '("Welcome to emacs, the thermonuclear editor."
  1805 (setq default-directory "~/")
  1805 (setq default-directory "~/")
  1806 (switch-to-buffer "*scratch*")
  1806 (switch-to-buffer "*scratch*")
  1807 (setq default-directory "~/")
  1807 (setq default-directory "~/")
  1808 
  1808 
  1809 ;;; End loading...
  1809 ;;; End loading...
       
  1810 
       
  1811 ;; Local variables:
       
  1812 ;; mode: outline-minor
       
  1813 ;; outline-regexp: "(message \""
       
  1814 ;; End: