.emacs-my
changeset 303 1fee37963d5a
parent 288 5009c3f4afef
parent 302 e93ff9360a51
child 322 b1bd2648b826
child 326 ded53e19d23a
child 329 83096ccf1367
--- a/.emacs-my	Tue Feb 02 16:45:30 2010 +0200
+++ b/.emacs-my	Thu Feb 04 00:04:17 2010 +0200
@@ -1,16 +1,16 @@
-;; -*- mode: lisp; coding: cp1251 -*-
+;; -*- mode: lisp; coding: utf-8 -*-
 ;;
 ;; Written by Oleksandr Gavenko <gavenkoa@gmail.com>, 2008-2010.
 ;;
 ;; This file formed from parts and ideas from many sites/docs and
 ;; placed in public domain.
 ;;
-;; .emacs file for GNU Emacs.
+;; Config file for GNU Emacs.
 ;;
-;; ~/.emacs load this file after ~/.emacs-pre, but before ~/.emacs-post.
+;; For loading order see README.
 
 ;; ======================================================================
-;; Debugging.
+;; debugging.
 
 ;; Shut off message buffer by setting nil.
 (setq message-log-max 512)
@@ -19,8 +19,7 @@
 (setq debug-on-error nil)               ; t/nil
 
 ;; ======================================================================
-;; Настройка внешнего вида редактора.
-;; View.
+;; appearance.
 
 (menu-bar-mode -1)
 (tool-bar-mode -1)
@@ -48,13 +47,13 @@
 (setq echo-keystrokes 0.2)
 
 ;; ----------------------------------------------------------------------
-;; Silent runing.
+;; silent runing.
 
 ;; (setq inhibit-splash-screen t) ; nonexist on 21.4.1
 (setq inhibit-startup-message t)
 
 ;; ======================================================================
-;; GNU Serv.
+;; gnu serv, server.
 
 ;; (load "~/emacs/bin/gnuserv/gnuserv.el")
 ;; (require 'gnuserv)
@@ -70,7 +69,7 @@
 ;; (desktop-read)
 
 ;; ======================================================================
-;; standart/general settings
+;; standart/general settings.
 
 (setq kill-whole-line t)
 
@@ -85,7 +84,7 @@
 (setq read-quoted-char-radix 16)
 
 ;; ----------------------------------------------------------------------
-;; Switching, creating, selecting buffers.
+;; switching, creating, selecting buffers.
 
 (iswitchb-mode 1)
 (setq iswitchb-buffer-ignore nil)
@@ -108,18 +107,18 @@
 (global-set-key "\C-x\C-b" 'ibuffer)
 
 ;; ----------------------------------------------------------------------
-;; Scrolling
+;; scrolling.
 
 (setq-default
  scroll-step 1
  scroll-conservatively 100
- ;; при перемещении точка останавливается на расстоянии i строк к границе фрейма,
+ ;; При перемещении точка останавливается на расстоянии i строк к границе фрейма.
  scroll-margin 2
  scroll-preserve-screen-position t
  )
 
 ;; ----------------------------------------------------------------------
-;; search
+;; searching.
 
 (setq case-fold-search t)
 
@@ -135,45 +134,44 @@
 (setq default-major-mode 'text-mode)
 
 ;; ----------------------------------------------------------------------
-;; syntax highlighting
+;; syntax highlighting.
+
 (setq font-lock-maximum-decoration t)
 (global-font-lock-mode 1 t)
 
 ;; ----------------------------------------------------------------------
-;; highlight selected text
+;; highlight selected text.
 
 ;; 1/-1, when the mark is active, the region is highlighted.
 (transient-mark-mode 1)
 (delete-selection-mode 1)               ; 1/-1
 
-;; Order of next item is important.
+;; Order of next items is important, (assignment must done before pc-selection-mode enabled).
 (require 'pc-select)
-;; To avoid some key bindings as F6, etc. Must set before 'pc-selection-mode' invoke.
-(setq pc-select-selection-keys-only t)
+(setq pc-select-selection-keys-only t)  ; To avoid some key bindings as F6, etc.
+(setq pc-select-meta-moves-sexps t)
 (pc-selection-mode 1)
 
 (when (eq window-system 'x)
-  (setq x-select-enable-clipboard t)    ; from Emacs 21.2.1 and newer
+  (setq x-select-enable-clipboard t)    ; for Emacs 21.2.1 and newer
   )
 
 ;; ----------------------------------------------------------------------
-;; line
-(if window-system
-    (progn
-      (global-hl-line-mode t)
-      (custom-set-faces '(hl-line ((t (:inherit highlight :background "light yellow")))))
-      )
+;; highlighting current line.
+
+(when window-system
+  (custom-set-faces '(hl-line ((t (:inherit highlight :background "light yellow")))))
+  (global-hl-line-mode 1)
   )
 
 ;; ----------------------------------------------------------------------
-;; paren, brace
+;; paren, braces.
 
 (show-paren-mode 1) ; Parenthesis matching via highlighting.
-;; (setq show-paren-style 'expression) ; выделять все выражение в скобках
 (setq show-paren-style (quote parenthesis))
 
 ;; ======================================================================
-;; Keyboard, mouse.
+;; keyboard, mouse.
 
 ;; cyrillic-jcuken  for 567 is :,.
 ;; russian-computer for 567 is %^&
@@ -182,14 +180,14 @@
 ;; (pc-bindings-mode) ; Myself define keybinding, see
 
 ;; ----------------------------------------------------------------------
-;; Completition
+;; completition.
 
 ;; partial-completion-mode cause bug in read-file-name with Emacs v22.3.1 (but not with v23.1).
 ;; read-file-name used in rgrep, so I disable partial-completion-mode.
 (partial-completion-mode -1) ; For example, M-x p-c-m expands to M-x partial-completion-mode
 
 ;; ----------------------------------------------------------------------
-;; Mouse
+;; mouse.
 
 ;; Scroll Bar gets dragged by mouse butn 1
 (global-set-key [vertical-scroll-bar down-mouse-1] 'scroll-bar-drag)
@@ -198,7 +196,7 @@
 (mouse-wheel-mode 1)
 
 ;; ----------------------------------------------------------------------
-;; Key Binding (Short-keys).
+;; key binding, short-keys.
 
 (global-set-key [home]    'beginning-of-line)
 (global-set-key [end]     'end-of-line)
@@ -237,7 +235,7 @@
 ;; (global-set-key [language-change] 'ignore)
 
 ;; ======================================================================
-;; Coding system, charset, locale, lang.
+;; coding system, charset, locale, lang.
 
 ;; Emacs 23.1 no longer need codepage-setup.
 (when (<= emacs-major-version 22)
@@ -317,7 +315,7 @@
 ;; STANDARD LIBRARIES
 
 ;; ----------------------------------------------------------------------
-;; dired
+;; dired.
 
 (setq dired-dwim-target t)
 ;; dangerous
@@ -326,14 +324,18 @@
 ;;  dired-recursive-deletes 'top)
 
 ;; ----------------------------------------------------------------------
-;; compression, archive
+;; compression, archive.
 
 (require 'jka-compr) ; Automatic decompression, hooks for tar-mode.
 (if (fboundp 'auto-compression-mode)
     (auto-compression-mode 1))
 
+(modify-coding-system-alist 'file "\\.\\(war\\|ear\\|sar\\|egg\\)\\'" 'no-conversion)
+
+(add-to-list 'auto-mode-alist '("\\.\\(war\\|ear\\|sar\\|egg\\)\\'" . archive-mode))
+
 ;; ----------------------------------------------------------------------
-;; image
+;; image.
 
 (when (fboundp 'auto-image-file-mode)
   (auto-image-file-mode 1))
@@ -350,13 +352,14 @@
 (global-set-key (kbd "\e\eq")  'recentf-open-files)
 
 ;; ----------------------------------------------------------------------
-;; revert
+;; revert buffer.
+
 (global-set-key [f5]    'revert-buffer)
 (setq revert-without-query (quote (".*")))
 (setq auto-revert-interval 2)
 
 ;; ======================================================================
-;; Convenient
+;; convenient.
 
 (defun reglen()
   "Show region length."
@@ -364,7 +367,7 @@
   (message "%s" (- (region-end) (region-beginning))))
 
 ;; ----------------------------------------------------------------------
-;; minibuffer
+;; minibuffer.
 
 (require 'icomplete) ; Interactive completion in minibuffer.
 (icomplete-mode 1)
@@ -385,20 +388,13 @@
       grep-use-null-device t)
 
 ;; ----------------------------------------------------------------------
-;; Music
+;; music.
 (setq gnus-audio-au-player "winamp.exe"
       gnus-audio-directory "D:\\music"
       gnus-audio-wav-player "winamp.exe")
 
 ;; ----------------------------------------------------------------------
-;; archive
-
-(modify-coding-system-alist 'file "\\.\\(war\\|ear\\|sar\\|egg\\)\\'" 'no-conversion)
-
-(add-to-list 'auto-mode-alist '("\\.\\(war\\|ear\\|sar\\|egg\\)\\'" . archive-mode))
-
-;; ----------------------------------------------------------------------
-;; browser
+;; browser.
 
 (cond
  ((equal window-system 'w32)
@@ -406,11 +402,8 @@
  (t
   (setq browse-url-browser-function 'browse-url-mozilla)))
 
-;; ======================================================================
-;; TIME SETTING
-
 ;; ----------------------------------------------------------------------
-;; Time
+;; time.
 
 ;; Also useful such format:
 ;; (setq display-time-format " %H:%M %d-%m-%y ")
@@ -419,7 +412,8 @@
 (display-time)                          ; display-time-mode
 
 ;; ----------------------------------------------------------------------
-;; Calendar
+;; calendar.
+
 ;; (setq mark-holidays-in-calendar t)
 ;; (setq all-christian-calendar-holidays t)
 ;; (setq calendar-date-display-form (quote ((format "%04s-%02d-%02d" year (string-to-int month) (string-to-int day)))))
@@ -447,7 +441,7 @@
 (add-hook 'text-mode-hook 'turn-on-auto-fill)
 
 ;; ----------------------------------------------------------------------
-;; unknown
+;; unknown.
 
 ;; browse-url mailcrypt gnus message sendmail bbdb pilot bibtex eiffel-mode emacs-w3m
 ;; eudc filladapt hugs-mode mpg123 php-mode ps-print
@@ -467,12 +461,12 @@
 (put 'scroll-left      'disabled nil)
 
 ;; ======================================================================
-;; TEX
+;; TEX.
+
 (setq tex-run-command "initex")
 
-
 ;; ======================================================================
-;; AUC TeX
+;; AUC TeX.
 
 ;(add-hook 'LaTeX-mode-hook 'LaTeX-install-toolbar)
 ;; (setq TeX-parse-self t)             ; Enable parse on load.
@@ -483,7 +477,6 @@
 ;(setq TeX-interactive-mode t)
 ;(setq TeX-source-specials-mode 1)
 
-;;модифицируем меню
 ;;; some more menu entries in the command list:
 ;;; see tex-mik.el from package auctex: %v is defined in tex-mik.el
 ;;; other variables are defined in tex.el from auctex
@@ -507,10 +500,8 @@
 ;           "texify --tex-opt=--src --run-viewer --clean %s.tex"
 ;           'TeX-run-command nil t))))
 
-
 ;; ======================================================================
-;;
-;; Reftex activation (Reftex is included with Emacs 21.1)
+;; Reftex activation (Reftex is included with Emacs 21.1).
 
 ;; (autoload 'reftex-mode     "reftex" "RefTeX Minor Mode" t)
 ;; (autoload 'turn-on-reftex  "reftex" "RefTeX Minor Mode" nil)
@@ -520,35 +511,24 @@
 ;; (add-hook 'latex-mode-hook 'turn-on-reftex)   ; with Emacs latex mode
 
 ;; ======================================================================
-;;
-;;Настройки PreviewLatex
+;; PreviewLatex.
 
 ;(load "preview-latex.el" nil t t)
 
 ;(add-hook 'LaTeX-mode-hook #'LaTeX-preview-setup)
 ;(autoload 'LaTeX-preview-setup "preview")
 
+;; ======================================================================
+;; Info.
 
 ;; ======================================================================
-;;
-;; Info
+;; man, woman.
 
-(require 'info)
-(if (equal window-system 'w32)
-    (progn
-      ;; TODO Write which func to find runemacs.exe dir.
-      ;; (setq Info-directory-list (list (expand-file-name "~/../bin/emacs/info")))
-      ;; (add-to-list 'Info-directory-list (expand-file-name "~/../bin/MinGW/info") t) ; t - append to the end
-      ))
-
-;; ======================================================================
-;; man, woman
-(require 'woman)
 (setq woman-use-own-frame nil)
 (setq woman-fill-frame t)
 
 ;; ======================================================================
-;; shell, sh, bash
+;; shell, sh, bash.
 
 ;; Setup Emacs to run bash as its primary shell.
 ;; (setq binary-process-input t)
@@ -570,7 +550,7 @@
   )
 
 ;; ======================================================================
-;; spell, ispall, aspell
+;; spell, ispall, aspell.
 
 (setq ispell-program-name "ispell")
 ;(setq ispell-dictionary "russianw"); default dictionary
@@ -592,15 +572,15 @@
 ;; GTD, PIM, organize, todo mode.
 
 ;; ----------------------------------------------------------------------
-;; org-mode
+;; org-mode.
 
 (if (>= emacs-major-version 22)
 (progn
   (require 'org)
   ))
 
-;; XXX org-todo-keywords '((sequence "TODO" "START" "|" "DONE")) для org-version 4.67c
-;; XXX (setq org-todo-keywords '("TODO" "START" "DONE")) для org-version 6.05b
+;; XXX org-todo-keywords '((sequence "TODO" "START" "|" "DONE")) for org-version 4.67c
+;; XXX (setq org-todo-keywords '("TODO" "START" "DONE")) for org-version 6.05b
 (if (or (featurep 'org) (featurep 'org-install))
     (progn
       (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
@@ -620,7 +600,8 @@
       (setq org-agenda-files '("~/.gtd/todo.org")) ))
 
 ;; ----------------------------------------------------------------------
-;; remember-mode
+;; remember-mode.
+
 (if (featurep 'remember)
     (progn
       (setq remember-annotation-functions '(org-remember-annotation))
@@ -637,7 +618,7 @@
        ) ))
 
 ;; ======================================================================
-;; whitespace
+;; whitespaces.
 
 (setq-default show-trailing-whitespace t)
 (setq-default indicate-empty-lines t)
@@ -694,7 +675,8 @@
 ;; communication
 
 ;; ----------------------------------------------------------------------
-;; jabber
+;; jabber.
+
 (when (featurep 'jabber)
   (setq
    jabber-history-enabled t
@@ -721,7 +703,7 @@
   )
 
 ;; ----------------------------------------------------------------------
-;; rcirc
+;; rcirc.
 
 ;; Turn on logging everything to a special buffer, for debugging.
 ;; (setq rcirc-debug-flag t)
@@ -732,7 +714,7 @@
   "/away message handler.")
 
 ;; ----------------------------------------------------------------------
-;; erc
+;; erc.
 
 (setq erc-server-coding-system 'utf-8)
 
@@ -778,19 +760,20 @@
   )
 
 ;; ----------------------------------------------------------------------
-;; psvn
+;; psvn.
+
 (setq svn-status-verbose t)
 (setq svn-status-hide-unmodified t)
 
 ;; ----------------------------------------------------------------------
-;; DVC
+;; DVC.
 
 (when (featurep 'dvc-emacs)
   (setq dvc-tips-enabled nil)
   )
 
 ;; ======================================================================
-;; devel, prog, programming
+;; devel, prog, programming.
 
 (add-to-list 'auto-mode-alist '("\\.cu$" . c-mode))
 
@@ -806,11 +789,12 @@
       '(c-mode-hook lisp-mode-hook))
 
 ;; ----------------------------------------------------------------------
-;; Diff, patch
+;; diff, patch.
+
 (setq diff-switches "-u")
 
 ;; ----------------------------------------------------------------------
-;; Indent
+;; indenting.
 
 (setq standard-indent 4)
 (setq c-basic-offset 4)
@@ -830,18 +814,20 @@
     (setq i (- i 4))))
 
 ;; ----------------------------------------------------------------------
-;; Diff.
+;; diff.
+
 (setq ediff-diff-options "")
 
 ;; ----------------------------------------------------------------------
 ;; *Compile*
+
 (setq compile-auto-highlight t
       compile-command "make ")
 ;; compilation window shall scroll down if not 0
 (setq compilation-scroll-output 1)
 
 ;; My funny error messages.
-;; XXX нужно реализовать через hook.
+;; XXX нужно реализовать через hook.
 (require 'compile)
 (add-to-list 'compilation-error-regexp-alist '("^\\( +\\[csc\\] \\|\\)\\(.*\\)(\\([0-9]*\\),\\([0-9]*\\)):" 2 3 4))
 (add-to-list 'compilation-error-regexp-alist '("^ *\\(.*\\)(\\([0-9]*\\)) +:" 1 2))
@@ -850,16 +836,18 @@
 ;; (add-to-list 'compilation-mode-font-lock-keywords '("[ 	]\\(/F[oe][^ 	]+\\)" . 1))
 
 ;; ----------------------------------------------------------------------
-;; windows inf files for installing drivers
+;; windows inf files for driver installing
+
 (add-to-list 'auto-mode-alist '("\\.inf\\'" . conf-mode))
 
 ;; ----------------------------------------------------------------------
-;; makefile, make
+;; makefile, make.
 
 (add-to-list 'auto-mode-alist '("\\(Makefile\\|Makefile\\..+\\)\\'" . makefile-gmake-mode))
 
 ;; ----------------------------------------------------------------------
-;; asm
+;; asm, assembler.
+
 ;; (setq-default asm-comment-char 59)
 (add-hook 'asm-mode-hook '(lambda () (setq comment-start "/*") (setq comment-end "*/")) t)
 
@@ -869,7 +857,7 @@
 ;; (add-hook 'asm-mode-hook '(lambda () (local-set-key ":" ":")))
 
 ;; ----------------------------------------------------------------------
-;; linker
+;; linker.
 
 (when (fboundp 'iar-linker-config-mode)
   (add-to-list 'auto-mode-alist '("\\.icf\\'" . iar-linker-config-mode))
@@ -879,11 +867,12 @@
   )
 
 ;; ----------------------------------------------------------------------
-;; lisp
+;; lisp.
+
 (setq list-command-history-max 256)
 
 ;; ----------------------------------------------------------------------
-;; C, c-mode, C++, c++-mode
+;; C, c-mode, C++, c++-mode.
 
 (setq c-echo-syntactic-information-p t)
 (add-hook 'c-mode-common-hook
@@ -941,7 +930,7 @@
 (setq c-default-style '((java-mode . "my") (c-mode . "my") (csharp-mode . "my") (c++-mode . "my") (objc-mode . "my") (other . "my")))
 
 ;; ----------------------------------------------------------------------
-;; bat file, batch
+;; bat file, batch.
 
 (when (fboundp 'bat-file-mode)
   (add-to-list 'auto-mode-alist '("\\.[bB][aA][tT]\\'" . bat-file-mode))
@@ -949,20 +938,21 @@
   )
 
 ;; ----------------------------------------------------------------------
-;; nsis-mode
+;; nsis-mode.
 
 (when (fboundp 'nsis-mode)
   (add-to-list 'auto-mode-alist '("\\.\\(nsi\\|nsh\\)\\'" . nsis-mode))
   )
 
 ;; ----------------------------------------------------------------------
-;; *csharp*, c-sharp
+;; *csharp*, c-sharp.
 
 (autoload 'csharp-mode "csharp-mode" "Major mode for editing C# code." t)
 (add-to-list 'auto-mode-alist '("\\.cs$" . csharp-mode))
 
 ;; ----------------------------------------------------------------------
-;; *Java*
+;; java.
+
 ;; Update the Emacs load-path to include the path to
 ;; the JDE and its require packages. This code assumes
 ;; that you have installed the packages in the emacs/site
@@ -1002,9 +992,8 @@
 
 ;; (require 'jde)
 
-;; ********************
-;; ECB
-;; *******************
+;; ----------------------------------------------------------------------
+;; ECB.
 
 (setq ecb-tip-of-the-day nil)
 ;; (add-to-list 'load-path  "~/emacs/site/ecb-2.32")
@@ -1013,17 +1002,18 @@
 ;; (global-set-key (kbd "\e\eE") 'ecb-activate)
 
 ;; ----------------------------------------------------------------------
-;; html
+;; html.
 
 ;; ----------------------------------------------------------------------
-;; xml
+;; xml.
 
 ;; ----------------------------------------------------------------------
-;; psgml
+;; psgml.
+
 (setq sgml-set-face t)                  ; for highlighting in sgml
 
 ;; ======================================================================
-;; Printing
+;; printing.
 
 ;; Use Notepad to print plain text files to the default Windows printer
 ;(setq lpr-command "notepad")
@@ -1032,11 +1022,13 @@
 ;(setq printer-name nil)        ; notepad takes the default
 ;(setq lpr-printer-switch "/P") ;; run notepad as batch printer
 ;;
-;;Печать в файл
+
+;; ----------------------------------------------------------------------
+;; printing to file.
+
 ;(setq printer-name "~/myprint.txt")
 ;(setq ps-printer-name nil)
 ;(setq ps-print-header nil)
-;;модифицируем меню
 ;;; some more menu entries in the command list:
 ;;; see tex-mik.el from package auctex: %v is defined in tex-mik.el
 ;;; other variables are defined in tex.el from auctex
@@ -1061,12 +1053,12 @@
 ;           'TeX-run-command nil t))))
 
 ;; ----------------------------------------------------------------
-;; SQL
+;; SQL.
 
 (setq sql-password "")
 
 ;; ======================================================================
-;; Backup
+;; backuping.
 
 (setq
  backup-by-copying t                           ; don't clobber symlinks
@@ -1077,7 +1069,7 @@
  version-control t)                            ; use versioned backups
 
 ;; ======================================================================
-;; auto save
+;; auto save.
 
 (setq auto-save-default t)
 ;; If nil autosave to different than original to buffer file.
@@ -1086,7 +1078,7 @@
 (setq delete-auto-save-files t)
 
 ;; ======================================================================
-;; Setup user info.
+;; user info.
 
 (cd "~/")
 (setq user-full-name "Oleksandr Gavenko")