.emacs-my
changeset 547 9f098b5f9269
parent 542 22eb7a31b689
parent 546 083974006b4a
child 548 1bfa0cf51c9c
equal deleted inserted replaced
542:22eb7a31b689 547:9f098b5f9269
     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.
    21 ;; Prevent Emacs from loading 'default.el', which loaded after '.emacs'.
    21 ;; Prevent Emacs from loading 'default.el', which loaded after '.emacs'.
    22 ;; Also '-q' prevent loading your init file.
    22 ;; Also '-q' prevent loading your init file.
    23 (setq inhibit-default-init nil)         ; t/nil
    23 (setq inhibit-default-init nil)         ; t/nil
    24 
    24 
    25 ;;; ----------------------------------------------------------------
    25 ;;; ----------------------------------------------------------------
    26 ;;; user info.
    26 (message "user info")
    27 
    27 
    28 (setq user-full-name "Oleksandr Gavenko")
    28 (setq user-full-name "Oleksandr Gavenko")
    29 (setq user-mail-address "gavenkoa@gmail.com")
    29 (setq user-mail-address "gavenkoa@gmail.com")
    30 (setq user-nick "gavenkoa")
    30 (setq user-nick "gavenkoa")
    31 (setenv "ORGANIZATION" (concat user-full-name " <" user-mail-address  ">"))
    31 (setenv "ORGANIZATION" (concat user-full-name " <" user-mail-address  ">"))
    32 
    32 
    33 ;;; ----------------------------------------------------------------
    33 ;;; ----------------------------------------------------------------
    34 ;;; mode groups.
    34 (message "mode groups")
    35 
    35 
    36 (defun my-modelist-to-hooklist (modes)
    36 (defun my-modelist-to-hooklist (modes)
    37   "Convert list of MODES to list of hooks for these modes."
    37   "Convert list of MODES to list of hooks for these modes."
    38   (mapcar
    38   (mapcar
    39    (lambda (mode) (intern (concat (symbol-name mode) "-hook")))
    39    (lambda (mode) (intern (concat (symbol-name mode) "-hook")))
    80 (defvar my-text-mode-hook-list
    80 (defvar my-text-mode-hook-list
    81   (my-modelist-to-hooklist my-text-mode-list)
    81   (my-modelist-to-hooklist my-text-mode-list)
    82   "List of text mode hooks.")
    82   "List of text mode hooks.")
    83 
    83 
    84 ;;; ----------------------------------------------------------------
    84 ;;; ----------------------------------------------------------------
    85 ;;; appearance.
    85 (message "appearance")
    86 
       
    87 (setq default-directory "~/")
       
    88 
    86 
    89 ;; To maximize frame on full screen, not work with Windows Emacs 21.4.
    87 ;; To maximize frame on full screen, not work with Windows Emacs 21.4.
    90 ;; And maked different height with Emacs 22.3 and 23.1.
    88 ;; And maked different height with Emacs 22.3 and 23.1.
    91 ;; (setq initial-frame-alist '((fullscreen . fullboth)))
    89 ;; (setq initial-frame-alist '((fullscreen . fullboth)))
    92 
    90 
   166 
   164 
   167 ;; See what I am typing immediately (for keystroke in minibuffer).
   165 ;; See what I am typing immediately (for keystroke in minibuffer).
   168 (setq echo-keystrokes 0.2)
   166 (setq echo-keystrokes 0.2)
   169 
   167 
   170 ;;; ----------------------------------------------------------------
   168 ;;; ----------------------------------------------------------------
   171 ;;; silent runing.
   169 (message "silent runing")
   172 
   170 
   173 ;; (setq inhibit-splash-screen t) ; nonexist on 21.4.1
   171 ;; (setq inhibit-splash-screen t) ; nonexist on 21.4.1
   174 (setq inhibit-startup-message t)
   172 (setq inhibit-startup-message t)
   175 
   173 
   176 ;;; ----------------------------------------------------------------
   174 ;;; ----------------------------------------------------------------
   177 ;;; whitespaces.
   175 (message "whitespaces")
   178 
   176 
   179 (setq default-indicate-empty-lines t)
   177 (setq default-indicate-empty-lines t)
   180 (setq default-indicate-buffer-boundaries 'left)
   178 (setq default-indicate-buffer-boundaries 'left)
   181 
   179 
   182 (setq-default show-trailing-whitespace t)
   180 (setq-default show-trailing-whitespace t)
   185 
   183 
   186 ;; See also 'mode-require-final-newline'.
   184 ;; See also 'mode-require-final-newline'.
   187 (add-hook 'text-mode-hook (lambda () (setq require-final-newline nil)))
   185 (add-hook 'text-mode-hook (lambda () (setq require-final-newline nil)))
   188 
   186 
   189 ;;; ----------------------------------------------------------------
   187 ;;; ----------------------------------------------------------------
   190 ;;; gnu serv, server.
   188 (message "gnu serv, server")
   191 
   189 
   192 ;; (load "~/emacs/bin/gnuserv/gnuserv.el")
   190 ;; (load "~/emacs/bin/gnuserv/gnuserv.el")
   193 ;; (require 'gnuserv)
   191 ;; (require 'gnuserv)
   194 ;; (setq gnuserv-frame (selected-frame))
   192 ;; (setq gnuserv-frame (selected-frame))
   195 
   193 
   202 
   200 
   203 ;; (desktop-load-default)
   201 ;; (desktop-load-default)
   204 ;; (desktop-read)
   202 ;; (desktop-read)
   205 
   203 
   206 ;;; ----------------------------------------------------------------
   204 ;;; ----------------------------------------------------------------
   207 ;;; standart/general settings.
   205 (message "standart/general settings")
   208 
   206 
   209 (if (boundp 'confirm-kill-emacs)
   207 (if (boundp 'confirm-kill-emacs)
   210     (setq confirm-kill-emacs 'yes-or-no-p))
   208     (setq confirm-kill-emacs 'yes-or-no-p))
   211 
   209 
   212 ;; Try to speed things up, especially in VM.
   210 ;; Try to speed things up, especially in VM.
   261  use-dialog-box t
   259  use-dialog-box t
   262  x-gtk-show-hidden-files t
   260  x-gtk-show-hidden-files t
   263  )
   261  )
   264 
   262 
   265 ;;; ----------------------------------------------------------------
   263 ;;; ----------------------------------------------------------------
   266 ;;; switching, creating, selecting buffers.
   264 (message "switching, creating, selecting buffers")
   267 
   265 
   268 (iswitchb-mode 1)
   266 (iswitchb-mode 1)
   269 (setq iswitchb-buffer-ignore
   267 (setq iswitchb-buffer-ignore
   270       '("^ "
   268       '("^ "
   271         "^\*Buffer"
   269         "^\*Buffer"
   281 
   279 
   282 ;; buffer-menu better then buffer-list, but ibuffer much better.
   280 ;; buffer-menu better then buffer-list, but ibuffer much better.
   283 (global-set-key "\C-x\C-b" 'ibuffer)
   281 (global-set-key "\C-x\C-b" 'ibuffer)
   284 
   282 
   285 ;;; ----------------------------------------------------------------
   283 ;;; ----------------------------------------------------------------
   286 ;;; scrolling.
   284 (message "scrolling")
   287 
   285 
   288 (defvar my-scroll-margin 4)
   286 (defvar my-scroll-margin 4)
   289 
   287 
   290 (setq-default
   288 (setq-default
   291  scroll-step 1
   289  scroll-step 1
   298 (mapc (lambda (hook) (add-hook hook (lambda nil (setq scroll-margin my-scroll-margin))))
   296 (mapc (lambda (hook) (add-hook hook (lambda nil (setq scroll-margin my-scroll-margin))))
   299       ;; TODO its good invoke delete-dups for list, but delete-dups not exist in Emacs 21.4
   297       ;; TODO its good invoke delete-dups for list, but delete-dups not exist in Emacs 21.4
   300       (append my-text-mode-hook-list my-devel-mode-hook-list my-scroll-margin-mode-hook-list) )
   298       (append my-text-mode-hook-list my-devel-mode-hook-list my-scroll-margin-mode-hook-list) )
   301 
   299 
   302 ;;; ----------------------------------------------------------------
   300 ;;; ----------------------------------------------------------------
   303 ;;; search, isearch, occur.
   301 (message "search, isearch, occur")
   304 
   302 
   305 (setq case-fold-search t)
   303 (setq case-fold-search t)
   306 
   304 
   307 (setq query-replace-highlight t)        ; highlight during query
   305 (setq query-replace-highlight t)        ; highlight during query
   308 (setq search-highlight t)               ; highlight incremental search
   306 (setq search-highlight t)               ; highlight incremental search
   309 
   307 
   310 ;;; ----------------------------------------------------------------
   308 ;;; ----------------------------------------------------------------
   311 ;;; grep, find.
   309 (message "grep, find")
   312 
       
   313 ;; (require 'grep)
       
   314 
   310 
   315 ;; This settings have effect from Emacs 22.x.
   311 ;; This settings have effect from Emacs 22.x.
   316 (when (eq system-type 'windows-nt)
   312 (when (eq system-type 'windows-nt)
   317   ;; Workaround for Cygwin shell, when set 'CYGWIN=noglob'. By default 'shell-quote-argument'
   313   ;; Workaround for Cygwin shell, when set 'CYGWIN=noglob'. By default 'shell-quote-argument'
   318   ;; quoted by double '\' chars this cause failure.
   314   ;; quoted by double '\' chars this cause failure.
   331 
   327 
   332 ;; Do not set t because some grep do not has --color options.
   328 ;; Do not set t because some grep do not has --color options.
   333 (setq grep-highlight-matches nil)
   329 (setq grep-highlight-matches nil)
   334 (setq grep-use-null-device nil)
   330 (setq grep-use-null-device nil)
   335 
   331 
   336 (add-to-list 'grep-find-ignored-directories "build" t)
   332 (eval-after-load 'grep
   337 (add-to-list 'grep-find-ignored-directories "dist" t)
   333   (lambda nil
   338 (add-to-list 'grep-find-ignored-directories "lib" t)
   334     (add-to-list 'grep-find-ignored-directories "build" t)
   339 
   335     (add-to-list 'grep-find-ignored-directories "dist" t)
   340 (add-to-list 'grep-find-ignored-files "*TAGS")
   336     (add-to-list 'grep-find-ignored-directories "lib" t)
   341 (add-to-list 'grep-find-ignored-files "GPATH")
   337 
       
   338     (add-to-list 'grep-find-ignored-files "*TAGS")
       
   339     (add-to-list 'grep-find-ignored-files "GPATH")
       
   340     ))
   342 
   341 
   343 (global-set-key [M-f7] 'rgrep)
   342 (global-set-key [M-f7] 'rgrep)
   344 
   343 
   345 ;;; ----------------------------------------------------------------
   344 ;;; ----------------------------------------------------------------
   346 ;;; syntax highlighting.
   345 (message "syntax highlighting")
   347 
   346 
   348 (setq font-lock-maximum-decoration t)
   347 (setq font-lock-maximum-decoration t)
   349 (global-font-lock-mode 1)
   348 (global-font-lock-mode 1)
   350 
   349 
   351 ;;; ----------------------------------------------------------------
   350 ;;; ----------------------------------------------------------------
   352 ;;; highlight selected text.
   351 (message "highlight selected text")
   353 
   352 
   354 ;; 1/-1, when the mark is active, the region is highlighted.
   353 ;; 1/-1, when the mark is active, the region is highlighted.
   355 (transient-mark-mode 1)
   354 (transient-mark-mode 1)
   356 (delete-selection-mode 1)               ; 1/-1
   355 (delete-selection-mode 1)               ; 1/-1
   357 
   356 
   367 (when (eq window-system 'x)
   366 (when (eq window-system 'x)
   368   (setq x-select-enable-clipboard t)    ; for Emacs 21.2.1 and newer
   367   (setq x-select-enable-clipboard t)    ; for Emacs 21.2.1 and newer
   369   )
   368   )
   370 
   369 
   371 ;;; ----------------------------------------------------------------
   370 ;;; ----------------------------------------------------------------
   372 ;;; highlighting current line.
   371 (message "highlighting current line")
   373 
   372 
   374 (when window-system
   373 (when window-system
   375   (custom-set-faces '(hl-line ((t (:inherit highlight :background "light yellow")))))
   374   (custom-set-faces '(hl-line ((t (:inherit highlight :background "light yellow")))))
   376   (global-hl-line-mode 1)
   375   (global-hl-line-mode 1)
   377   )
   376   )
   378 
   377 
   379 ;;; ----------------------------------------------------------------
   378 ;;; ----------------------------------------------------------------
   380 ;;; paren, braces.
   379 (message "paren, braces")
   381 
   380 
   382 (show-paren-mode 1) ; Parenthesis matching via highlighting.
   381 (show-paren-mode 1) ; Parenthesis matching via highlighting.
   383 (setq show-paren-style (quote parenthesis))
   382 (setq show-paren-style (quote parenthesis))
   384 
   383 
   385 ;;; ----------------------------------------------------------------
   384 ;;; ----------------------------------------------------------------
   386 ;;; keyboard, mouse.
   385 (message "keyboard, mouse")
   387 
   386 
   388 ;; cyrillic-jis-russian  for 567 is :,.
   387 ;; cyrillic-jis-russian  for 567 is :,.
   389 ;; cyrillic-jcuken  for SHIFT 567 is :,.
   388 ;; cyrillic-jcuken  for SHIFT 567 is :,.
   390 ;; russian-computer for SHIFT 567 is %^&
   389 ;; russian-computer for SHIFT 567 is %^&
   391 (if (>= emacs-major-version 22)
   390 (if (>= emacs-major-version 22)
   392     (setq default-input-method 'russian-computer)
   391     (setq default-input-method 'russian-computer)
   393   (setq default-input-method 'cyrillic-jcuken))
   392   (setq default-input-method 'cyrillic-jcuken))
   394 ;; (pc-bindings-mode) ; Myself define keybinding, see
   393 ;; (pc-bindings-mode) ; Myself define keybinding, see
   395 
   394 
   396 ;;; ----------------------------------------------------------------
   395 ;;; ----------------------------------------------------------------
   397 ;;; completion.
   396 (message "completion")
   398 
   397 
   399 ;; I remove partial-completion-mode because it depricated in Emacs 24.0.
   398 ;; I remove partial-completion-mode because it depricated in Emacs 24.0.
   400 ;; Completion controled by 'completion-styles' variable.
   399 ;; Completion controled by 'completion-styles' variable.
   401 
   400 
   402 ;;; ----------------------------------------------------------------
   401 ;;; ----------------------------------------------------------------
   403 ;;; mouse.
   402 (message "mouse")
   404 
   403 
   405 ;; Scroll Bar gets dragged by mouse butn 1
   404 ;; Scroll Bar gets dragged by mouse butn 1
   406 (global-set-key [vertical-scroll-bar down-mouse-1] 'scroll-bar-drag)
   405 (global-set-key [vertical-scroll-bar down-mouse-1] 'scroll-bar-drag)
   407 ;; Paste at point NOT at cursor
   406 ;; Paste at point NOT at cursor
   408 (setq mouse-yank-at-point t)
   407 (setq mouse-yank-at-point t)
   409 (when window-system
   408 (when window-system
   410   (mouse-wheel-mode 1)
   409   (mouse-wheel-mode 1)
   411   )
   410   )
   412 
   411 
   413 ;;; ----------------------------------------------------------------
   412 ;;; ----------------------------------------------------------------
   414 ;;; key binding, short-keys.
   413 (message "key binding, short-keys")
   415 
   414 
   416 (global-set-key [home]    'beginning-of-line)
   415 (global-set-key [home]    'beginning-of-line)
   417 (global-set-key [end]     'end-of-line)
   416 (global-set-key [end]     'end-of-line)
   418 (global-set-key [C-home] 'beginning-of-buffer)
   417 (global-set-key [C-home] 'beginning-of-buffer)
   419 (global-set-key [C-end]  'end-of-buffer)
   418 (global-set-key [C-end]  'end-of-buffer)
   448   )
   447   )
   449 
   448 
   450 ;; (global-set-key [language-change] 'ignore)
   449 ;; (global-set-key [language-change] 'ignore)
   451 
   450 
   452 ;;; ----------------------------------------------------------------
   451 ;;; ----------------------------------------------------------------
   453 ;;; coding system, charset, locale, lang.
   452 (message "coding system, charset, locale, lang")
   454 
   453 
   455 ;; Emacs 23.1 no longer need codepage-setup.
   454 ;; Emacs 23.1 no longer need codepage-setup.
   456 (when (<= emacs-major-version 22)
   455 (when (<= emacs-major-version 22)
   457   (codepage-setup 866)
   456   (codepage-setup 866)
   458   (codepage-setup 1251)
   457   (codepage-setup 1251)
   489     (modify-coding-system-alist 'process ".*" 'utf-8-unix)
   488     (modify-coding-system-alist 'process ".*" 'utf-8-unix)
   490     ))
   489     ))
   491   )
   490   )
   492 
   491 
   493 ;;; ----------------------------------------------------------------
   492 ;;; ----------------------------------------------------------------
   494 ;;; open file, ffap.
   493 (message "open file, ffap")
   495 (setq-default save-place t)
   494 (setq-default save-place t)
   496 (require 'saveplace)
   495 (require 'saveplace)
   497 
   496 
   498 ;;; ----------------------------------------------------------------
   497 ;;; ----------------------------------------------------------------
   499 ;;; dired.
   498 (message "dired")
   500 
   499 
   501 (require 'dired)
   500 (require 'dired)
   502 
   501 
   503 ;; I usually mistype "C-x C-f" to "C-x d" or "C-x C-d", so always use find-file,
   502 ;; I usually mistype "C-x C-f" to "C-x d" or "C-x C-d", so always use find-file,
   504 ;; because when file if directory find-file load dired, if regular file open it.
   503 ;; because when file if directory find-file load dired, if regular file open it.
   560   )
   559   )
   561 
   560 
   562 (define-key dired-mode-map (kbd "`") 'my-dired-flag-tmp-files)
   561 (define-key dired-mode-map (kbd "`") 'my-dired-flag-tmp-files)
   563 
   562 
   564 ;;; ----------------------------------------------------------------
   563 ;;; ----------------------------------------------------------------
   565 ;;; ls-lisp, dired ls.
   564 (message "ls-lisp, dired ls")
   566 
   565 
   567 ;; If non-nil - use 'insert-directory-program', which I dislike.
   566 ;; If non-nil - use 'insert-directory-program', which I dislike.
   568 (setq ls-lisp-use-insert-directory-program nil)
   567 (setq ls-lisp-use-insert-directory-program nil)
   569 (setq ls-lisp-ignore-case t)
   568 (setq ls-lisp-ignore-case t)
   570 (setq ls-lisp-dirs-first t)
   569 (setq ls-lisp-dirs-first t)
   577       '("%Y-%m-%d %H:%M:%S"
   576       '("%Y-%m-%d %H:%M:%S"
   578         "%Y-%m-%d %H:%M   "))
   577         "%Y-%m-%d %H:%M   "))
   579 (require 'ls-lisp)
   578 (require 'ls-lisp)
   580 
   579 
   581 ;;; ----------------------------------------------------------------
   580 ;;; ----------------------------------------------------------------
   582 ;;; compression, archive.
   581 (message "compression, archive")
   583 
   582 
   584 (require 'jka-compr) ; Automatic decompression, hooks for tar-mode.
   583 (require 'jka-compr) ; Automatic decompression, hooks for tar-mode.
   585 (if (fboundp 'auto-compression-mode)
   584 (if (fboundp 'auto-compression-mode)
   586     (auto-compression-mode 1))
   585     (auto-compression-mode 1))
   587 
   586 
   588 (modify-coding-system-alist 'file "\\.\\(war\\|ear\\|sar\\|egg\\)\\'" 'no-conversion)
   587 (modify-coding-system-alist 'file "\\.\\(war\\|ear\\|sar\\|egg\\)\\'" 'no-conversion)
   589 
   588 
   590 (add-to-list 'auto-mode-alist '("\\.\\(war\\|ear\\|sar\\|egg\\)\\'" . archive-mode))
   589 (add-to-list 'auto-mode-alist '("\\.\\(war\\|ear\\|sar\\|egg\\)\\'" . archive-mode))
   591 
   590 
   592 ;;; ----------------------------------------------------------------
   591 ;;; ----------------------------------------------------------------
   593 ;;; image.
   592 (message "image")
   594 
   593 
   595 (when (fboundp 'auto-image-file-mode)
   594 (when (fboundp 'auto-image-file-mode)
   596   (auto-image-file-mode 1))
   595   (auto-image-file-mode 1))
   597 
   596 
   598 ;;; ----------------------------------------------------------------
   597 ;;; ----------------------------------------------------------------
   599 ;;; recentf.
   598 (message "recentf")
   600 
   599 
   601 (require 'recentf)
   600 (require 'recentf)
   602 ;; Prevent TRAMP to login on remote host when loading.
   601 ;; Prevent TRAMP to login on remote host when loading.
   603 ;; Its take time and ask passwords!
   602 ;; Its take time and ask passwords!
   604 (setq recentf-auto-cleanup 'never)
   603 (setq recentf-auto-cleanup 'never)
   605 (recentf-mode t)
   604 (recentf-mode t)
   606 (setq recentf-max-saved-items 1000)
   605 (setq recentf-max-saved-items 1000)
   607 (global-set-key (kbd "\e\eq")  'recentf-open-files)
   606 (global-set-key (kbd "\e\eq")  'recentf-open-files)
   608 
   607 
   609 ;;; ----------------------------------------------------------------
   608 ;;; ----------------------------------------------------------------
   610 ;;; revert buffer.
   609 (message "revert buffer")
   611 
   610 
   612 (global-set-key [f5]    'revert-buffer)
   611 (global-set-key [f5]    'revert-buffer)
   613 (setq revert-without-query (quote (".*")))
   612 (setq revert-without-query (quote (".*")))
   614 (setq auto-revert-interval 2)
   613 (setq auto-revert-interval 2)
   615 
   614 
   616 ;;; ----------------------------------------------------------------
   615 ;;; ----------------------------------------------------------------
   617 ;;; convenient.
   616 (message "convenient")
   618 
   617 
   619 (defun reglen()
   618 (defun reglen()
   620   "Show region length."
   619   "Show region length."
   621   (interactive)
   620   (interactive)
   622   (message "%s" (- (region-end) (region-beginning))))
   621   (message "%s" (- (region-end) (region-beginning))))
   623 
   622 
   624 ;;; ----------------------------------------------------------------
   623 ;;; ----------------------------------------------------------------
   625 ;;; minibuffer.
   624 (message "minibuffer")
   626 
   625 
   627 (require 'icomplete) ; Interactive completion in minibuffer.
   626 (require 'icomplete) ; Interactive completion in minibuffer.
   628 (icomplete-mode 1)
   627 (icomplete-mode 1)
   629 
   628 
   630 (mapc (lambda (ext) (add-to-list 'completion-ignored-extensions ext))
   629 (mapc (lambda (ext) (add-to-list 'completion-ignored-extensions ext))
   634         ;; Place dir at end to appear at the start of completion-ignored-extensions.
   633         ;; Place dir at end to appear at the start of completion-ignored-extensions.
   635         "CVS/" ".hg/" ".svn/" ".git/" ".bzr/"
   634         "CVS/" ".hg/" ".svn/" ".git/" ".bzr/"
   636         ) )
   635         ) )
   637 
   636 
   638 ;;; ----------------------------------------------------------------
   637 ;;; ----------------------------------------------------------------
   639 ;;; music.
   638 (message "music")
   640 (setq gnus-audio-au-player "winamp.exe"
   639 (setq gnus-audio-au-player "winamp.exe"
   641       gnus-audio-directory "D:\\music"
   640       gnus-audio-directory "D:\\music"
   642       gnus-audio-wav-player "winamp.exe")
   641       gnus-audio-wav-player "winamp.exe")
   643 
   642 
   644 ;;; ----------------------------------------------------------------
   643 ;;; ----------------------------------------------------------------
   645 ;;; browser.
   644 (message "browser")
   646 
   645 
   647 (cond
   646 (cond
   648  ((equal window-system 'w32)
   647  ((equal window-system 'w32)
   649   (setq browse-url-browser-function 'browse-url-default-windows-browser))
   648   (setq browse-url-browser-function 'browse-url-default-windows-browser))
   650  ((boundp 'debian-emacs-flavor)
   649  ((boundp 'debian-emacs-flavor)
   651   (setq browse-url-browser-function 'browse-url-firefox))
   650   (setq browse-url-browser-function 'browse-url-firefox))
   652  (t
   651  (t
   653   (setq browse-url-browser-function 'browse-url-mozilla)))
   652   (setq browse-url-browser-function 'browse-url-mozilla)))
   654 
   653 
   655 ;;; ----------------------------------------------------------------
   654 ;;; ----------------------------------------------------------------
   656 ;;; calendar.
   655 (message "calendar")
   657 
   656 
   658 ;; (setq mark-holidays-in-calendar t)
   657 ;; (setq mark-holidays-in-calendar t)
   659 ;; (setq all-christian-calendar-holidays t)
   658 ;; (setq all-christian-calendar-holidays t)
   660 ;; (setq calendar-date-display-form (quote ((format "%04s-%02d-%02d" year (string-to-int month) (string-to-int day)))))
   659 ;; (setq calendar-date-display-form (quote ((format "%04s-%02d-%02d" year (string-to-int month) (string-to-int day)))))
   661 ;; (setq calendar-time-display-form (quote (24-hours ":" minutes (if time-zone " (") time-zone (if time-zone ")"))))
   660 ;; (setq calendar-time-display-form (quote (24-hours ":" minutes (if time-zone " (") time-zone (if time-zone ")"))))
   662 (setq calendar-week-start-day 1)
   661 (setq calendar-week-start-day 1)
   663 (setq european-calendar-style t)
   662 (setq european-calendar-style t)
   664 
   663 
   665 ;;; ----------------------------------------------------------------
   664 ;;; ----------------------------------------------------------------
   666 ;;; STANDARD HOOKS.
   665 (message "standard hooks")
   667 
   666 
   668 (add-hook 'write-file-hooks 'time-stamp)
   667 (add-hook 'write-file-hooks 'time-stamp)
   669 
   668 
   670 ;;; ----------------------------------------------------------------
   669 ;;; ----------------------------------------------------------------
   671 ;;; auto-fill.
   670 (message "auto-fill")
   672 
   671 
   673 (setq-default fill-column 78)
   672 (setq-default fill-column 78)
   674 
   673 
   675 (defvar my-fill-column 100
   674 (defvar my-fill-column 100
   676   "I use greater value then 78 for comment in prog source.")
   675   "I use greater value then 78 for comment in prog source.")
   682 ;; Turn on auto-fill mode
   681 ;; Turn on auto-fill mode
   683 (add-hook 'html-mode-hook 'turn-on-auto-fill)
   682 (add-hook 'html-mode-hook 'turn-on-auto-fill)
   684 (add-hook 'text-mode-hook 'turn-on-auto-fill)
   683 (add-hook 'text-mode-hook 'turn-on-auto-fill)
   685 
   684 
   686 ;;; ----------------------------------------------------------------
   685 ;;; ----------------------------------------------------------------
   687 ;;; unknown.
   686 (message "unknown")
   688 
   687 
   689 ;; browse-url mailcrypt gnus message sendmail bbdb pilot bibtex eiffel-mode emacs-w3m
   688 ;; browse-url mailcrypt gnus message sendmail bbdb pilot bibtex eiffel-mode emacs-w3m
   690 ;; eudc filladapt hugs-mode mpg123 php-mode ps-print
   689 ;; eudc filladapt hugs-mode mpg123 php-mode ps-print
   691 ;; chord-mode - edit guitar music
   690 ;; chord-mode - edit guitar music
   692 ;; discography - variant of BibTeX mode for discographies
   691 ;; discography - variant of BibTeX mode for discographies
   693 
   692 
   694 ;;; ----------------------------------------------------------------
   693 ;;; ----------------------------------------------------------------
   695 ;;; cacl, calculator.
   694 (message "cacl, calculator")
   696 
   695 
   697 (setq-default calc-group-digits t)
   696 (setq-default calc-group-digits t)
   698 (setq-default calc-group-char "'")
   697 (setq-default calc-group-char "'")
   699 
   698 
   700 (defun my-calc-eval-region (arg beg end)
   699 (defun my-calc-eval-region (arg beg end)
   709       (goto-char end)
   708       (goto-char end)
   710       (save-excursion
   709       (save-excursion
   711         (insert result)))))
   710         (insert result)))))
   712 
   711 
   713 ;;; ----------------------------------------------------------------
   712 ;;; ----------------------------------------------------------------
   714 ;;; TeX, LaTeX.
   713 (message "TeX, LaTeX")
   715 
   714 
   716 (setq tex-run-command "initex")
   715 (setq tex-run-command "initex")
   717 
   716 
   718 ;;; ----------------------------------------------------------------
   717 ;;; ----------------------------------------------------------------
   719 ;;; AUC TeX.
   718 (message "AUC TeX")
   720 
   719 
   721 ;(add-hook 'LaTeX-mode-hook 'LaTeX-install-toolbar)
   720 ;(add-hook 'LaTeX-mode-hook 'LaTeX-install-toolbar)
   722 ;; (setq TeX-parse-self t)             ; Enable parse on load.
   721 ;; (setq TeX-parse-self t)             ; Enable parse on load.
   723 ;; (setq TeX-auto-save t)              ; Enable parse on save.
   722 ;; (setq TeX-auto-save t)              ; Enable parse on save.
   724 ;; Query for master file. If you often use \include or \input, you should make AUCTEX aware of the
   723 ;; Query for master file. If you often use \include or \input, you should make AUCTEX aware of the
   751 ;         (list "All Texify run-viewer"
   750 ;         (list "All Texify run-viewer"
   752 ;           "texify --tex-opt=--src --run-viewer --clean %s.tex"
   751 ;           "texify --tex-opt=--src --run-viewer --clean %s.tex"
   753 ;           'TeX-run-command nil t))))
   752 ;           'TeX-run-command nil t))))
   754 
   753 
   755 ;;; ----------------------------------------------------------------
   754 ;;; ----------------------------------------------------------------
   756 ;;; reftex.
   755 (message "reftex")
   757 
   756 
   758 ;; Reftex is included with Emacs 21.1.
   757 ;; Reftex is included with Emacs 21.1.
   759 
   758 
   760 ;; (autoload 'reftex-mode     "reftex" "RefTeX Minor Mode" t)
   759 ;; (autoload 'reftex-mode     "reftex" "RefTeX Minor Mode" t)
   761 ;; (autoload 'turn-on-reftex  "reftex" "RefTeX Minor Mode" nil)
   760 ;; (autoload 'turn-on-reftex  "reftex" "RefTeX Minor Mode" nil)
   763 ;; (autoload 'reftex-index-phrase-mode "reftex-index" "Phrase mode" t)
   762 ;; (autoload 'reftex-index-phrase-mode "reftex-index" "Phrase mode" t)
   764 ;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex)   ; with AUCTeX LaTeX mode
   763 ;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex)   ; with AUCTeX LaTeX mode
   765 ;; (add-hook 'latex-mode-hook 'turn-on-reftex)   ; with Emacs latex mode
   764 ;; (add-hook 'latex-mode-hook 'turn-on-reftex)   ; with Emacs latex mode
   766 
   765 
   767 ;;; ----------------------------------------------------------------
   766 ;;; ----------------------------------------------------------------
   768 ;;; PreviewLatex.
   767 (message "PreviewLatex")
   769 
   768 
   770 ;(load "preview-latex.el" nil t t)
   769 ;(load "preview-latex.el" nil t t)
   771 
   770 
   772 ;(add-hook 'LaTeX-mode-hook #'LaTeX-preview-setup)
   771 ;(add-hook 'LaTeX-mode-hook #'LaTeX-preview-setup)
   773 ;(autoload 'LaTeX-preview-setup "preview")
   772 ;(autoload 'LaTeX-preview-setup "preview")
   774 
   773 
   775 ;;; ----------------------------------------------------------------
   774 ;;; ----------------------------------------------------------------
   776 ;;; Info.
   775 (message "Info")
   777 
   776 
   778 ;; Because of Debian policy documentation covered by FDL license with invariant sections not allowed in packet
   777 ;; Because of Debian policy documentation covered by FDL license with invariant sections not allowed in packet
   779 ;; repository tree. So it must be installed manually. My usual configuration is install user local software
   778 ;; repository tree. So it must be installed manually. My usual configuration is install user local software
   780 ;; into ~/usr DISTDIR.
   779 ;; into ~/usr DISTDIR.
   781 (unless (getenv "INFOPATH")
   780 (unless (getenv "INFOPATH")
   782   (setenv "INFOPATH" "~/usr/share/info:"))
   781   (setenv "INFOPATH" "~/usr/share/info:"))
   783 
   782 
   784 ;;; ----------------------------------------------------------------
   783 ;;; ----------------------------------------------------------------
   785 ;;; man, woman.
   784 (message "man, woman")
   786 
   785 
   787 (setq woman-use-own-frame nil)
   786 (setq woman-use-own-frame nil)
   788 (setq woman-fill-frame t)
   787 (setq woman-fill-frame t)
   789 
   788 
   790 ;;; ----------------------------------------------------------------
   789 ;;; ----------------------------------------------------------------
   791 ;;; comint.
   790 (message "comint")
   792 
   791 
   793 ;; If non-nil, add a `/' to completed directories, ` ' to file names.
   792 ;; If non-nil, add a `/' to completed directories, ` ' to file names.
   794 (setq comint-completion-addsuffix t)
   793 (setq comint-completion-addsuffix t)
   795 ;; Non-nil means go to the end of the line before sending input.
   794 ;; Non-nil means go to the end of the line before sending input.
   796 (setq comint-eol-on-send t)
   795 (setq comint-eol-on-send t)
   797 
   796 
   798 ;;; ----------------------------------------------------------------
   797 ;;; ----------------------------------------------------------------
   799 ;;; shell, sh, bash.
   798 (message "shell, sh, bash")
   800 
   799 
   801 ;; Setup Emacs to run bash as its primary shell.
   800 ;; Setup Emacs to run bash as its primary shell.
   802 ;; (setq binary-process-input t)
   801 ;; (setq binary-process-input t)
   803 ;; (setq shell-file-name "bash")
   802 ;; (setq shell-file-name "bash")
   804 ;; (setq shell-command-switch "-c")
   803 ;; (setq shell-command-switch "-c")
   831   (setq explicit-bash-args '("-i"))
   830   (setq explicit-bash-args '("-i"))
   832   (setq explicit-sh-args '("-i"))
   831   (setq explicit-sh-args '("-i"))
   833   )
   832   )
   834 
   833 
   835 ;;; ----------------------------------------------------------------
   834 ;;; ----------------------------------------------------------------
   836 ;;; spell, ispell, aspell.
   835 (message "spell, ispell, aspell")
   837 
   836 
   838 ;; Settings for spelling done in '.emacs-autogen'.
   837 ;; Settings for spelling done in '.emacs-autogen'.
   839 ;(add-hook 'text-mode-hook 'flyspell-mode)
   838 ;(add-hook 'text-mode-hook 'flyspell-mode)
   840 ;(setq flyspell-default-dictionary "russianw")
   839 ;(setq flyspell-default-dictionary "russianw")
   841 ;(setq flyspell-delay '1)
   840 ;(setq flyspell-delay '1)
   842 
   841 
   843 ;;; ----------------------------------------------------------------
   842 ;;; ----------------------------------------------------------------
   844 ;;; GTD, PIM, organize, todo mode.
   843 (message "GTD, PIM, organize, todo mode")
   845 
   844 
   846 ;;; ----------------------------------------------------------------
   845 ;;; ----------------------------------------------------------------
   847 ;;; org-mode.
   846 (message "org-mode")
   848 
   847 
   849 (if (>= emacs-major-version 22)
   848 (if (>= emacs-major-version 22)
   850 (progn
   849 (progn
   851   (require 'org)
   850   (require 'org)
   852   ))
   851   ))
   871             )
   870             )
   872       (define-key global-map "\C-ca" 'org-agenda)
   871       (define-key global-map "\C-ca" 'org-agenda)
   873       (setq org-agenda-files '("~/.gtd/todo.org")) ))
   872       (setq org-agenda-files '("~/.gtd/todo.org")) ))
   874 
   873 
   875 ;;; ----------------------------------------------------------------
   874 ;;; ----------------------------------------------------------------
   876 ;;; remember-mode.
   875 (message "remember-mode")
   877 
   876 
   878 (if (or (featurep 'remember) (fboundp 'remember))
   877 (if (or (featurep 'remember) (fboundp 'remember))
   879     (progn
   878     (progn
   880       (setq remember-annotation-functions '(org-remember-annotation))
   879       (setq remember-annotation-functions '(org-remember-annotation))
   881       (setq remember-handler-functions '(org-remember-handler))
   880       (setq remember-handler-functions '(org-remember-handler))
   889       (setq
   888       (setq
   890        org-remember-store-without-prompt t
   889        org-remember-store-without-prompt t
   891        ) ))
   890        ) ))
   892 
   891 
   893 ;;; ----------------------------------------------------------------
   892 ;;; ----------------------------------------------------------------
   894 ;;; TODO, XXX, FIXME highlight.
   893 (message "TODO, XXX, FIXME highlight")
   895 ;; Show blanks and FIXME
   894 ;; Show blanks and FIXME
   896 ;; http://www.emacswiki.org/cgi-bin/wiki/EightyColumnRule
   895 ;; http://www.emacswiki.org/cgi-bin/wiki/EightyColumnRule
   897 
   896 
   898 (defface my-tab-face
   897 (defface my-tab-face
   899   '((t :background "gray"))
   898   '((t :background "gray"))
   916      ("\\([^[:space:]]\\)\\1\\{63\\}" 0 'my-contrasty-face t)
   915      ("\\([^[:space:]]\\)\\1\\{63\\}" 0 'my-contrasty-face t)
   917      ))
   916      ))
   918   )
   917   )
   919 
   918 
   920 ;;; ----------------------------------------------------------------
   919 ;;; ----------------------------------------------------------------
   921 ;;; communication.
   920 (message "communication")
   922 
   921 
   923 ;;; ----------------------------------------------------------------
   922 ;;; ----------------------------------------------------------------
   924 ;;; jabber.
   923 (message "jabber")
   925 
   924 
   926 (when (featurep 'jabber)
   925 (when (featurep 'jabber)
   927   (setq
   926   (setq
   928    jabber-history-enabled t
   927    jabber-history-enabled t
   929    jabber-use-global-history nil
   928    jabber-use-global-history nil
   947   (let ( (mgs-list '("Я тутачки, а где Вы меня ожидали?"
   946   (let ( (mgs-list '("Я тутачки, а где Вы меня ожидали?"
   948                      "Software Development == Church Development. Step 1. Build it. Step 2. Pray."
   947                      "Software Development == Church Development. Step 1. Build it. Step 2. Pray."
   949                      "А любит Б, Б любит С, что делать A? Найти другую Б!")) )
   948                      "А любит Б, Б любит С, что делать A? Найти другую Б!")) )
   950     (setq jabber-default-show (nth (random (length mgs-list)) mgs-list))
   949     (setq jabber-default-show (nth (random (length mgs-list)) mgs-list))
   951     (setq jabber-default-status (nth (random (length mgs-list)) mgs-list))
   950     (setq jabber-default-status (nth (random (length mgs-list)) mgs-list))
   952     )
   951     ) )
   953 
   952 
   954 ;; fsm used in emacs jabber
   953 ;; fsm used in emacs jabber
   955 (when (featurep 'fsm)
   954 (when (featurep 'fsm)
   956   (setq fsm-debug nil)                  ; Disable *fsm-debug* buffer.
   955   (setq fsm-debug nil)                  ; Disable *fsm-debug* buffer.
   957   )
   956   )
   981   )
   980   )
   982 
   981 
   983 (global-set-key (kbd "C-x C-j C-s") 'my-jabber-send)
   982 (global-set-key (kbd "C-x C-j C-s") 'my-jabber-send)
   984 
   983 
   985 ;;; ----------------------------------------------------------------
   984 ;;; ----------------------------------------------------------------
   986 ;;; rcirc.
   985 (message "rcirc")
   987 
   986 
   988 ;; Turn on logging everything to a special buffer, for debugging.
   987 ;; Turn on logging everything to a special buffer, for debugging.
   989 ;; (setq rcirc-debug-flag t)
   988 ;; (setq rcirc-debug-flag t)
   990 
   989 
   991 (add-hook 'rcirc-mode-hook (lambda () (rcirc-track-minor-mode 1)))
   990 (add-hook 'rcirc-mode-hook (lambda () (rcirc-track-minor-mode 1)))
   997 (setq rcirc-default-port 6667)
   996 (setq rcirc-default-port 6667)
   998 (setq rcirc-default-nick user-nick)
   997 (setq rcirc-default-nick user-nick)
   999 (setq rcirc-default-user-full-name user-full-name)
   998 (setq rcirc-default-user-full-name user-full-name)
  1000 
   999 
  1001 ;;; ----------------------------------------------------------------
  1000 ;;; ----------------------------------------------------------------
  1002 ;;; erc.
  1001 (message "erc")
  1003 
  1002 
  1004 ;; Take off noise message.
  1003 ;; Take off noise message.
  1005 (setq erc-track-exclude-types '("JOIN" "PART" "QUIT" "NICK" "MODE"))
  1004 (setq erc-track-exclude-types '("JOIN" "PART" "QUIT" "NICK" "MODE"))
  1006 
  1005 
  1007 (setq erc-current-nick-highlight-type 'nick-or-keyword)
  1006 (setq erc-current-nick-highlight-type 'nick-or-keyword)
  1008 (setq erc-track-use-faces t)
  1007 (setq erc-track-use-faces t)
  1009 
  1008 
  1010 (setq erc-server-coding-system 'utf-8)
  1009 (setq erc-server-coding-system 'utf-8)
  1011 
  1010 
  1012 ;;; ----------------------------------------------------------------
  1011 ;;; ----------------------------------------------------------------
  1013 ;;; VCS, version control, cvs, svn, mercurial, hg, bazaar, bzr, git, fossil.
  1012 (message "VCS, version control, cvs, svn, mercurial, hg, bazaar, bzr, git, fossil")
  1014 
  1013 
  1015 (if (equal window-system 'w32)
  1014 (if (equal window-system 'w32)
  1016     (progn
  1015     (progn
  1017       (modify-coding-system-alist 'process "cvs" '(cp1251-dos . cp1251-dos))
  1016       (modify-coding-system-alist 'process "cvs" '(cp1251-dos . cp1251-dos))
  1018       (modify-coding-system-alist 'process "svn" '(cp1251 . cp1251))
  1017       (modify-coding-system-alist 'process "svn" '(cp1251 . cp1251))
  1046          (360 . "#0D80E0")))
  1045          (360 . "#0D80E0")))
  1047       )
  1046       )
  1048   )
  1047   )
  1049 
  1048 
  1050 ;;; ----------------------------------------------------------------
  1049 ;;; ----------------------------------------------------------------
  1051 ;;; psvn.
  1050 (message "psvn")
  1052 
  1051 
  1053 (setq svn-status-verbose t)
  1052 (setq svn-status-verbose t)
  1054 (setq svn-status-hide-unmodified t)
  1053 (setq svn-status-hide-unmodified t)
  1055 
  1054 
  1056 ;;; ----------------------------------------------------------------
  1055 ;;; ----------------------------------------------------------------
  1057 ;;; DVC.
  1056 (message "DVC")
  1058 
  1057 
  1059 (when (featurep 'dvc-emacs)
  1058 (when (featurep 'dvc-emacs)
  1060   (setq dvc-tips-enabled nil)
  1059   (setq dvc-tips-enabled nil)
  1061   )
  1060   )
  1062 
  1061 
  1063 ;;; ----------------------------------------------------------------
  1062 ;;; ----------------------------------------------------------------
  1064 ;;; devel, prog, programming.
  1063 (message "devel, prog, programming")
  1065 
  1064 
  1066 (add-to-list 'auto-mode-alist '("\\.cu$" . c-mode))
  1065 (add-to-list 'auto-mode-alist '("\\.cu$" . c-mode))
  1067 
  1066 
  1068 (defun my-c++-header-file-p ()
  1067 (defun my-c++-header-file-p ()
  1069   "Return non-nil, if in a C++ header."
  1068   "Return non-nil, if in a C++ header."
  1083 
  1082 
  1084 (mapc (lambda (hook) (add-hook hook (lambda () (setq fill-column my-fill-column)) ))
  1083 (mapc (lambda (hook) (add-hook hook (lambda () (setq fill-column my-fill-column)) ))
  1085       my-devel-mode-hook-list)
  1084       my-devel-mode-hook-list)
  1086 
  1085 
  1087 ;;; ----------------------------------------------------------------
  1086 ;;; ----------------------------------------------------------------
  1088 ;;; diff, patch, ediff, emerge.
  1087 (message "diff, patch, ediff, emerge")
  1089 
  1088 
  1090 (setq diff-switches "-u")
  1089 (setq diff-switches "-u")
  1091 
  1090 
  1092 (setq ediff-diff-options "")
  1091 (setq ediff-diff-options "")
  1093 (setq ediff-custom-diff-options "-u")
  1092 (setq ediff-custom-diff-options "-u")
  1094 
  1093 
  1095 ;;; ----------------------------------------------------------------
  1094 ;;; ----------------------------------------------------------------
  1096 ;;; indenting.
  1095 (message "indenting")
  1097 
  1096 
  1098 (setq standard-indent 4)
  1097 (setq standard-indent 4)
  1099 (setq c-basic-offset 4)
  1098 (setq c-basic-offset 4)
  1100 (setq sh-basic-offset 2)
  1099 (setq sh-basic-offset 2)
  1101 (setq sgml-basic-offset 4)
  1100 (setq sgml-basic-offset 4)
  1111   (while (>= i 0)
  1110   (while (>= i 0)
  1112     (setq tab-stop-list (cons i tab-stop-list))
  1111     (setq tab-stop-list (cons i tab-stop-list))
  1113     (setq i (- i 4))))
  1112     (setq i (- i 4))))
  1114 
  1113 
  1115 ;;; ----------------------------------------------------------------
  1114 ;;; ----------------------------------------------------------------
  1116 ;;; compile.
  1115 (message "compile")
  1117 
  1116 
  1118 (setq compile-auto-highlight t
  1117 (setq compile-auto-highlight t
  1119       compile-command "make ")
  1118       compile-command "make ")
  1120 ;; compilation window shall scroll down if not 0
  1119 ;; compilation window shall scroll down if not 0
  1121 (setq compilation-scroll-output 1)
  1120 (setq compilation-scroll-output 1)
  1128 (add-to-list 'compilation-error-regexp-alist '("^\"?\\([^\"]*\\)\"?,\\([0-9]*\\) .*\\[.*\\]: " 1 2)) ; KEIL compiler
  1127 (add-to-list 'compilation-error-regexp-alist '("^\"?\\([^\"]*\\)\"?,\\([0-9]*\\) .*\\[.*\\]: " 1 2)) ; KEIL compiler
  1129 ;; (add-to-list 'compilation-mode-font-lock-keywords '("\\(/[Oo][Uu][Tt]:[^ 	]+\\)" . 1))
  1128 ;; (add-to-list 'compilation-mode-font-lock-keywords '("\\(/[Oo][Uu][Tt]:[^ 	]+\\)" . 1))
  1130 ;; (add-to-list 'compilation-mode-font-lock-keywords '("[ 	]\\(/F[oe][^ 	]+\\)" . 1))
  1129 ;; (add-to-list 'compilation-mode-font-lock-keywords '("[ 	]\\(/F[oe][^ 	]+\\)" . 1))
  1131 
  1130 
  1132 ;;; ----------------------------------------------------------------
  1131 ;;; ----------------------------------------------------------------
  1133 ;;; TAGS, etags, ctags, GNU GLOBAL.
  1132 (message "TAGS, etags, ctags, GNU GLOBAL")
  1134 
  1133 
  1135 ;; One of 'tags-table-list' or 'tags-file-name' control which TAGS files to
  1134 ;; One of 'tags-table-list' or 'tags-file-name' control which TAGS files to
  1136 ;; use.
  1135 ;; use.
  1137 
  1136 
  1138 (setq tags-add-tables t)
  1137 (setq tags-add-tables t)
  1145   )
  1144   )
  1146 
  1145 
  1147 (global-set-key "\M-\r" 'complete-tag)
  1146 (global-set-key "\M-\r" 'complete-tag)
  1148 
  1147 
  1149 ;;; ----------------------------------------------------------------
  1148 ;;; ----------------------------------------------------------------
  1150 ;;; CEDET, semantic.
  1149 (message "CEDET, semantic")
  1151 
  1150 
  1152 ;; For debug use 'semantic-debug-idle-function' and 'semantic-debug-idle-work-function'.
  1151 ;; For debug use 'semantic-debug-idle-function' and 'semantic-debug-idle-work-function'.
  1153 
  1152 
  1154 (unless (featurep 'cedet)
  1153 (unless (featurep 'cedet)
  1155   ;; (when (or (and (= emacs-major-version 23) (= emacs-minor-version 2)) (>= emacs-minor-version 24))
  1154   ;; (when (or (and (= emacs-major-version 23) (= emacs-minor-version 2)) (>= emacs-minor-version 24))
  1202   (global-set-key (kbd "C-c , D") 'semantic-ia-describe-class)
  1201   (global-set-key (kbd "C-c , D") 'semantic-ia-describe-class)
  1203   (global-set-key (kbd "C-c , c") 'semantic-ia-complete-symbol-menu)
  1202   (global-set-key (kbd "C-c , c") 'semantic-ia-complete-symbol-menu)
  1204   )
  1203   )
  1205 
  1204 
  1206 ;;; ----------------------------------------------------------------
  1205 ;;; ----------------------------------------------------------------
  1207 ;;; imenu.
  1206 (message "imenu")
  1208 
  1207 
  1209 (require 'imenu)
  1208 (require 'imenu)
  1210 (when window-system
  1209 (when window-system
  1211   (mapc (lambda (hook)
  1210   (mapc (lambda (hook)
  1212           (add-hook hook
  1211           (add-hook hook
  1216                       ) ))
  1215                       ) ))
  1217         (delq 'nsis-mode-hook my-devel-mode-hook-list))
  1216         (delq 'nsis-mode-hook my-devel-mode-hook-list))
  1218   )
  1217   )
  1219 
  1218 
  1220 ;;; ----------------------------------------------------------------
  1219 ;;; ----------------------------------------------------------------
  1221 ;;; windows inf files for driver installing
  1220 (message "windows inf files for driver installin")
  1222 
  1221 
  1223 (add-to-list 'auto-mode-alist '("\\.inf\\'" . conf-mode))
  1222 (add-to-list 'auto-mode-alist '("\\.inf\\'" . conf-mode))
  1224 
  1223 
  1225 ;;; ----------------------------------------------------------------
  1224 ;;; ----------------------------------------------------------------
  1226 ;;; makefile, make.
  1225 (message "makefile, make")
  1227 
  1226 
  1228 (add-to-list 'auto-mode-alist '("\\(Makefile\\|Makefile\\..+\\)\\'" . makefile-gmake-mode))
  1227 (add-to-list 'auto-mode-alist '("\\(Makefile\\|Makefile\\..+\\)\\'" . makefile-gmake-mode))
  1229 
  1228 
  1230 ;;; ----------------------------------------------------------------
  1229 ;;; ----------------------------------------------------------------
  1231 ;;; asm, assembler.
  1230 (message "asm, assembler")
  1232 
  1231 
  1233 ;; (setq-default asm-comment-char 59)
  1232 ;; (setq-default asm-comment-char 59)
  1234 (add-hook 'asm-mode-hook '(lambda () (setq comment-start "/*") (setq comment-end "*/")) t)
  1233 (add-hook 'asm-mode-hook '(lambda () (setq comment-start "/*") (setq comment-end "*/")) t)
  1235 
  1234 
  1236 (add-to-list 'auto-mode-alist '("\\.\\([sS]79\\|[sS]\\)\\'" . asm-mode))
  1235 (add-to-list 'auto-mode-alist '("\\.\\([sS]79\\|[sS]\\)\\'" . asm-mode))
  1237 
  1236 
  1238 ;; (add-hook 'asm-mode-hook '(lambda () (local-unset-key ":")))
  1237 ;; (add-hook 'asm-mode-hook '(lambda () (local-unset-key ":")))
  1239 ;; (add-hook 'asm-mode-hook '(lambda () (local-set-key ":" ":")))
  1238 ;; (add-hook 'asm-mode-hook '(lambda () (local-set-key ":" ":")))
  1240 
  1239 
  1241 ;;; ----------------------------------------------------------------
  1240 ;;; ----------------------------------------------------------------
  1242 ;;; linker.
  1241 (message "linker")
  1243 
  1242 
  1244 (when (fboundp 'iar-linker-config-mode)
  1243 (when (fboundp 'iar-linker-config-mode)
  1245   (add-to-list 'auto-mode-alist '("\\.icf\\'" . iar-linker-config-mode))
  1244   (add-to-list 'auto-mode-alist '("\\.icf\\'" . iar-linker-config-mode))
  1246   )
  1245   )
  1247 (when (fboundp 'iar4-linker-config-mode)
  1246 (when (fboundp 'iar4-linker-config-mode)
  1248   (add-to-list 'auto-mode-alist '("\\.xcl\\'" . iar4-linker-config-mode))
  1247   (add-to-list 'auto-mode-alist '("\\.xcl\\'" . iar4-linker-config-mode))
  1249   )
  1248   )
  1250 
  1249 
  1251 ;;; ----------------------------------------------------------------
  1250 ;;; ----------------------------------------------------------------
  1252 ;;; lisp.
  1251 (message "lisp")
  1253 
  1252 
  1254 (setq list-command-history-max 256)
  1253 (setq list-command-history-max 256)
  1255 
  1254 
  1256 ;;; ----------------------------------------------------------------
  1255 ;;; ----------------------------------------------------------------
  1257 ;;; C, c-mode, C++, c++-mode.
  1256 (message "C, c-mode, C++, c++-mode")
  1258 
  1257 
  1259 (setq c-echo-syntactic-information-p t)
  1258 (setq c-echo-syntactic-information-p t)
  1260 (add-hook 'c-mode-common-hook
  1259 (add-hook 'c-mode-common-hook
  1261  (lambda ()
  1260  (lambda ()
  1262    ;; Automatically inserte newlines after special characters such as brace, comma, semi-colon, and colon.
  1261    ;; Automatically inserte newlines after special characters such as brace, comma, semi-colon, and colon.
  1322             (other . "my")
  1321             (other . "my")
  1323             ))
  1322             ))
  1324     ))
  1323     ))
  1325 
  1324 
  1326 ;;; ----------------------------------------------------------------
  1325 ;;; ----------------------------------------------------------------
  1327 ;;; javascript, js.
  1326 (message "javascript, js")
  1328 
  1327 
  1329 (if (>= emacs-major-version 23)
  1328 (if (>= emacs-major-version 23)
  1330     (add-to-list 'auto-mode-alist '("\\.js$" . js-mode))
  1329     (add-to-list 'auto-mode-alist '("\\.js$" . js-mode))
  1331   (add-to-list 'auto-mode-alist '("\\.js$" . javascript-generic-mode))
  1330   (add-to-list 'auto-mode-alist '("\\.js$" . javascript-generic-mode))
  1332   )
  1331   )
  1333 
  1332 
  1334 ;;; ----------------------------------------------------------------
  1333 ;;; ----------------------------------------------------------------
  1335 ;;; bat file, batch.
  1334 (message "bat file, batch")
  1336 
  1335 
  1337 ;; loaded from 'generic-x.el'
  1336 ;; loaded from 'generic-x.el'
  1338 
  1337 
  1339 ;;; ----------------------------------------------------------------
  1338 ;;; ----------------------------------------------------------------
  1340 ;;; nsis-mode.
  1339 (message "nsis-mode")
  1341 
  1340 
  1342 (when (fboundp 'nsis-mode)
  1341 (when (fboundp 'nsis-mode)
  1343   (add-to-list 'auto-mode-alist '("\\.\\(nsi\\|nsh\\)\\'" . nsis-mode))
  1342   (add-to-list 'auto-mode-alist '("\\.\\(nsi\\|nsh\\)\\'" . nsis-mode))
  1344   )
  1343   )
  1345 
  1344 
  1346 ;;; ----------------------------------------------------------------
  1345 ;;; ----------------------------------------------------------------
  1347 ;;; csharp, c-sharp.
  1346 (message "csharp, c-sharp")
  1348 
  1347 
  1349 (autoload 'csharp-mode "csharp-mode" "Major mode for editing C# code." t)
  1348 (autoload 'csharp-mode "csharp-mode" "Major mode for editing C# code." t)
  1350 (add-to-list 'auto-mode-alist '("\\.cs$" . csharp-mode))
  1349 (add-to-list 'auto-mode-alist '("\\.cs$" . csharp-mode))
  1351 
  1350 
  1352 ;;; ----------------------------------------------------------------
  1351 ;;; ----------------------------------------------------------------
  1353 ;;; java.
  1352 (message "java")
  1354 
  1353 
  1355 ;;; ----------------------------------------------------------------
  1354 ;;; ----------------------------------------------------------------
  1356 ;;; ECB.
  1355 (message "ECB")
  1357 
  1356 
  1358 (setq ecb-tip-of-the-day nil)
  1357 (setq ecb-tip-of-the-day nil)
  1359 
  1358 
  1360 ;;; ----------------------------------------------------------------
  1359 ;;; ----------------------------------------------------------------
  1361 ;;; html.
  1360 (message "html")
  1362 
  1361 
  1363 ;;; ----------------------------------------------------------------
  1362 ;;; ----------------------------------------------------------------
  1364 ;;; nxml.
  1363 (message "nxml")
  1365 
  1364 
  1366 (setq nxml-sexp-element-flag t)
  1365 (setq nxml-sexp-element-flag t)
  1367 (setq nxml-child-indent 2)
  1366 (setq nxml-child-indent 2)
  1368 (setq nxml-attribute-indent 4)
  1367 (setq nxml-attribute-indent 4)
  1369 
  1368 
  1370 ;;; ----------------------------------------------------------------
  1369 ;;; ----------------------------------------------------------------
  1371 ;;; psgml.
  1370 (message "psgml")
  1372 
  1371 
  1373 (setq sgml-set-face t)                  ; for highlighting in sgml
  1372 (setq sgml-set-face t)                  ; for highlighting in sgml
  1374 
  1373 
  1375 ;;; ----------------------------------------------------------------
  1374 ;;; ----------------------------------------------------------------
  1376 ;;; sh, bash.
  1375 (message "sh, bash")
  1377 
  1376 
  1378 (add-to-list 'auto-mode-alist '("\\.cygport\\'" . shell-script-mode))
  1377 (add-to-list 'auto-mode-alist '("\\.cygport\\'" . shell-script-mode))
  1379 
  1378 
  1380 ;;; ----------------------------------------------------------------
  1379 ;;; ----------------------------------------------------------------
  1381 ;;; printing.
  1380 (message "printing")
  1382 
  1381 
  1383 ;; Use Notepad to print plain text files to the default Windows printer
  1382 ;; Use Notepad to print plain text files to the default Windows printer
  1384 ;(setq lpr-command "notepad")
  1383 ;(setq lpr-command "notepad")
  1385 ;(setq lpr-headers-switches '("/p"))    ; \ mis-use these
  1384 ;(setq lpr-headers-switches '("/p"))    ; \ mis-use these
  1386 ;(setq lpr-switches nil)                ; / two variables
  1385 ;(setq lpr-switches nil)                ; / two variables
  1415 ;         (list "All Texify run-viewer"
  1414 ;         (list "All Texify run-viewer"
  1416 ;           "texify --tex-opt=--src --run-viewer --clean %s.tex"
  1415 ;           "texify --tex-opt=--src --run-viewer --clean %s.tex"
  1417 ;           'TeX-run-command nil t))))
  1416 ;           'TeX-run-command nil t))))
  1418 
  1417 
  1419 ;;; ----------------------------------------------------------------
  1418 ;;; ----------------------------------------------------------------
  1420 ;;; SQL.
  1419 (message "SQL")
  1421 
  1420 
  1422 (setq sql-password "")
  1421 (setq sql-password "")
  1423 
  1422 
  1424 ;;; ----------------------------------------------------------------
  1423 ;;; ----------------------------------------------------------------
  1425 ;;; backuping.
  1424 (message "backuping")
  1426 
  1425 
  1427 (setq
  1426 (setq
  1428  make-backup-files t
  1427  make-backup-files t
  1429  ;; In other case (by renaming) you loose original file creation date.
  1428  ;; In other case (by renaming) you loose original file creation date.
  1430  backup-by-copying t
  1429  backup-by-copying t
  1433  kept-old-versions 1                           ; store first original version
  1432  kept-old-versions 1                           ; store first original version
  1434  kept-new-versions 3                           ; store last 3 version
  1433  kept-new-versions 3                           ; store last 3 version
  1435  version-control t)                            ; use versioned backups
  1434  version-control t)                            ; use versioned backups
  1436 
  1435 
  1437 ;;; ----------------------------------------------------------------
  1436 ;;; ----------------------------------------------------------------
  1438 ;;; auto save.
  1437 (message "auto save")
  1439 
  1438 
  1440 (setq auto-save-default t)
  1439 (setq auto-save-default t)
  1441 ;; If nil autosave to different than original to buffer file.
  1440 ;; If nil autosave to different than original to buffer file.
  1442 (setq auto-save-visited-file-name nil)
  1441 (setq auto-save-visited-file-name nil)
  1443 ;; Note: if you kill unsaved file auto save file not deleted.
  1442 ;; Note: if you kill unsaved file auto save file not deleted.
  1444 (setq delete-auto-save-files t)
  1443 (setq delete-auto-save-files t)
  1445 
  1444 
  1446 ;; ----------------------------------------------------------------
  1445 ;;; ----------------------------------------------------------------
  1447 ;; User welcome msg.
  1446 (message "User welcome msg")
  1448 
  1447 
  1449 (add-hook 'emacs-startup-hook
  1448 (add-hook 'emacs-startup-hook
  1450           (lambda ()
  1449           (lambda ()
  1451             (let ( (mgs-list '("Welcome to emacs, the thermonuclear editor."
  1450             (let ( (mgs-list '("Welcome to emacs, the thermonuclear editor."
  1452                                "You enter to Out Space. Emacs on."
  1451                                "You enter to Out Space. Emacs on."
  1453                                "Nice day for Emacsing!")) )
  1452                                "Nice day for Emacsing!")) )
  1454               (message (nth (random (length mgs-list)) mgs-list)))))
  1453               (message (nth (random (length mgs-list)) mgs-list)))))
  1455 
  1454 
       
  1455 (switch-to-buffer "*scratch*")
       
  1456 (setq default-directory "~/")
       
  1457 
  1456 ;;; End loading...
  1458 ;;; End loading...