merged
authorOleksandr Gavenko <gavenkoa@gmail.com>
Sat, 24 Jul 2010 14:25:26 +0300
changeset 419 7a06c31e9c09
parent 418 dd77820b51c4 (diff)
parent 374 e64e256d2772 (current diff)
child 430 16e7a5a565a9
merged
.emacs-my
--- a/.emacs	Thu Apr 01 22:47:31 2010 +0300
+++ b/.emacs	Sat Jul 24 14:25:26 2010 +0300
@@ -19,11 +19,18 @@
 
 (defvar my-autoload (concat my-lisp-dir "/autoload-my.el")
   "Path to autoload for mode files.")
+(defvar dot-emacs-autogen (expand-file-name "~/.emacs-autogen")
+  "Path to automatically generated config file. It content depend on
+  installation environment and it was overridden on install.")
 (defvar dot-emacs-pre (expand-file-name "~/.emacs-pre")
   "Path to file with pre-loaded custom settings.")
 (defvar dot-emacs-post (expand-file-name "~/.emacs-post")
   "Path to file with post-loaded custom settings.")
 
+
+(if (file-exists-p dot-emacs-autogen)
+    (load dot-emacs-autogen))
+
 ;; pre-load custom settings
 (if (file-exists-p dot-emacs-pre)
     (load dot-emacs-pre))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.emacs-autogen	Sat Jul 24 14:25:26 2010 +0300
@@ -0,0 +1,3 @@
+;; -*- mode: lisp; coding: utf-8; fill-column: 78 -*-
+;;
+;; For load order see README.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.emacs-autogen.sh	Sat Jul 24 14:25:26 2010 +0300
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+if [ -z "$1" ]; then
+  echo "Where config file?"
+  exit 1
+fi
+
+cfg=$1
+
+if which aspell; then
+  echo >>$cfg
+  echo "(setq-default ispell-program-name \"aspell\")" >>$cfg
+  echo "(setq-default ispell-local-dictionary \"english\")" >>$cfg
+elif which ispell; then
+  echo >>$cfg
+  echo "(setq-default ispell-program-name \"ispell\")" >>$cfg
+  echo "(setq-default ispell-local-dictionary \"english\")" >>$cfg
+fi
--- a/.emacs-my	Thu Apr 01 22:47:31 2010 +0300
+++ b/.emacs-my	Sat Jul 24 14:25:26 2010 +0300
@@ -22,15 +22,37 @@
 ;; mode groups
 
 (defvar my-devel-mode-list
-  '(sh-mode script-mode java-mode c-mode
-            lisp-mode makefile-mode makefile-gmake-mode python-mode)
+  '(
+    outline-mode
+    sh-mode script-mode
+    c-mode c++-mode java-mode
+    python-mode
+    lisp-mode
+    emacs-lisp-mode
+    makefile-mode makefile-gmake-mode
+    )
   "List of development modes.")
 
 (defvar my-devel-mode-hook-list
-  '(sh-mode-hook script-mode-hook java-mode-hook c-mode-hook
-            lisp-mode-hook makefile-mode-hook makefile-gmake-mode-hook python-mode-hook)
+  '(sh-mode-hook script-mode-hook
+    c-mode-hook c++-mode-hook java-mode-hook
+    python-mode-hook
+    makefile-mode-hook makefile-gmake-mode-hook
+    lisp-mode-hook emacs-lisp-mode-hook)
   "List of development mode hooks.")
 
+(defvar my-scroll-margin-mode-hook-list
+  '(
+    vc-dir-mode-hook
+    recentf-dialog-mode-hook
+    org-agenda-grid-mode-hook           ; XXX for this item not worked!
+    log-view-mode-hook
+    diff-mode-hook
+    dired-mode-hook
+    compilation-mode-hook
+    )
+  "List of mode hooks for enabling scroll margin.")
+
 (defvar my-text-mode-list
   '(outline-mode text-mode)
   "List of text modes.")
@@ -67,8 +89,10 @@
 
 (menu-bar-mode -1)
 (tool-bar-mode -1)
-(when (>= emacs-major-version 22) (tooltip-mode -1))
-(scroll-bar-mode 1)
+(when window-system
+  (when (>= emacs-major-version 22) (tooltip-mode -1))
+  (scroll-bar-mode 1)
+  )
 
 (setq frame-title-format "Emacs - %b")
 
@@ -87,6 +111,7 @@
 ;; show column & line numbers in status bar
 (setq column-number-mode t)
 (setq line-number-mode t)
+(setq size-indication-mode t)
 
 ;; Also useful such format: (setq display-time-format " %H:%M %d-%m-%y ")
 (setq display-time-24hr-format t)
@@ -139,12 +164,12 @@
 ;; (require 'gnuserv)
 ;; (setq gnuserv-frame (selected-frame))
 
-(require 'server)
-(when (and (= emacs-major-version 23) (= emacs-minor-version 1) (equal window-system 'w32))
-  (defun server-ensure-safe-dir (dir) "Noop" t)) ; Suppress error directory ~/.emacs.d/server is unsafe on windows.
-
 (when (>= emacs-major-version 22)
-  (server-start))
+  (require 'server)
+  (when (and (= emacs-major-version 23) (>= emacs-minor-version 1) (<= emacs-minor-version 2) (equal window-system 'w32))
+    (defun server-ensure-safe-dir (dir) "Noop" t)) ; Suppress error directory ~/.emacs.d/server is unsafe on windows.
+  (server-start)
+  )
 
 ;; (desktop-load-default)
 ;; (desktop-read)
@@ -158,6 +183,9 @@
 ;; Try to speed things up, especially in VM.
 (setq gc-cons-threshold 2000000)
 
+;; Default 'command-history' length too short (in Emacs 23.2 is 30).
+(setq history-length 200)
+
 ;; Don't beep in my headphones!
 (setq ring-bell-function '(lambda () "Empty ring-bell-function." nil))
 (setq visible-bell t) ; With default ring-bell-function in text terminal
@@ -201,7 +229,6 @@
           "^\*Help\*"
           "^\*Quail Completions\*"
           "^\*Disabled Command\*"
-          "^\*vc\*"
           ))
 
 (require 'uniquify)
@@ -225,11 +252,10 @@
 (make-variable-buffer-local 'scroll-margin)
 (mapc (lambda (hook) (add-hook hook (lambda nil (setq scroll-margin my-scroll-margin))))
       ;; TODO its good invoke delete-dups for list, but delete-dups not exist in Emacs 21.4
-      (append my-text-mode-hook-list my-devel-mode-hook-list
-                           '(recentf-mode-hook)) )
+      (append my-text-mode-hook-list my-devel-mode-hook-list my-scroll-margin-mode-hook-list) )
 
 ;; ----------------------------------------------------------------------
-;; searching.
+;; search, isearch, occur.
 
 (setq case-fold-search t)
 
@@ -237,10 +263,6 @@
 (setq search-highlight t)               ; highlight incremental search
 
 ;; ----------------------------------------------------------------------
-;; *Occur*
-(global-set-key [f7] 'occur)            ; Key binding as in mc
-
-;; ----------------------------------------------------------------------
 ;; grep, find.
 
 ;; Assume that we have GNU grep, so -H available.
@@ -253,6 +275,8 @@
 ;; Do not set t because some grep do not has --color options.
 (setq grep-highlight-matches nil)
 (setq grep-use-null-device nil)
+;; For find-dired.
+;; (setq find-ls-option '("-exec ls -ld {} \\;" . "-ld"))
 
 (global-set-key [M-f7] 'rgrep)
 
@@ -260,7 +284,7 @@
 ;; syntax highlighting.
 
 (setq font-lock-maximum-decoration t)
-(global-font-lock-mode 1 t)
+(global-font-lock-mode 1)
 
 ;; ----------------------------------------------------------------------
 ;; highlight selected text.
@@ -299,18 +323,19 @@
 ;; ======================================================================
 ;; keyboard, mouse.
 
-;; cyrillic-jcuken  for 567 is :,.
-;; russian-computer for 567 is %^&
-(setq default-input-method 'cyrillic-jcuken)
-
+;; cyrillic-jis-russian  for 567 is :,.
+;; cyrillic-jcuken  for SHIFT 567 is :,.
+;; russian-computer for SHIFT 567 is %^&
+(if (>= emacs-major-version 22)
+    (setq default-input-method 'russian-computer)
+  (setq default-input-method 'cyrillic-jcuken))
 ;; (pc-bindings-mode) ; Myself define keybinding, see
 
 ;; ----------------------------------------------------------------------
-;; completition.
+;; completion.
 
-;; 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
+;; I remove partial-completion-mode because it depricated in Emacs 24.0.
+;; Completion controled by 'completion-styles' variable.
 
 ;; ----------------------------------------------------------------------
 ;; mouse.
@@ -449,7 +474,7 @@
 ;; Its take time and ask passwords!
 (setq recentf-auto-cleanup 'never)
 (recentf-mode t)
-(setq recentf-max-saved-items 200)
+(setq recentf-max-saved-items 1000)
 (global-set-key (kbd "\e\eq")  'recentf-open-files)
 
 ;; ----------------------------------------------------------------------
@@ -631,41 +656,33 @@
   commands. If nil, 'sh' will be used." )
 
 (when (eq window-system 'w32)           ; may require Cygwin or MSYS
-  (setenv "ESHELL" "bash")
   (if my-use-windows-shell
-      ;; Restore shell name if user set SHELL env var for Cygwin/MSYS.
-      (setq shell-file-name (concat exec-directory "cmdproxy.exe"))
-    ;; Use shell from Cygwin/MinGW.
-    (setq shell-file-name "sh")
+      (progn
+       ;; Restore shell name if user set SHELL env var for Cygwin/MSYS.
+       (setq shell-file-name (concat exec-directory "cmdproxy.exe"))
+       ;; Here is workaround: when explicit-shell-file-name is "bash" and shell-file-name is "cmdproxy.exe"
+       ;; find-dired incorrect quote args (in shell-quote-argument (w32-shell-name) return "bash", but
+       ;; shell-command used shell-file-name which value "cmdproxy.exe"). So I put additional space in pattern to
+       ;; prevent quoting.
+       (setq find-ls-option '("-exec ls -ld {}  ;" . "-ld"))
+       )
+    (progn
+     ;; Use shell from Cygwin/MinGW.
+     (setq shell-file-name "bash")
+     )
     )
   ;; (setq explicit-shell-file-name "bash")
   (setq explicit-bash-args '("-i"))
   (setq explicit-sh-args '("-i"))
-  ;; Here is workaround: when explicit-shell-file-name is "bash" and shell-file-name is "cmdproxy.exe"
-  ;; find-dired incorrect quote args (in shell-quote-argument (w32-shell-name) return "bash", but
-  ;; shell-command used shell-file-name which value "cmdproxy.exe"). So I put additional space in pattern to
-  ;; prevent quoting.
-  (setq find-ls-option '("-exec ls -ld {}  ;" . "-ld"))
   )
 
 ;; ======================================================================
-;; spell, ispall, aspell.
+;; spell, ispell, aspell.
 
-(setq ispell-program-name "ispell")
-;(setq ispell-dictionary "russianw"); default dictionary
-;(setq ispell-local-dictionary "russianw"); default dictionary
+;; Settings for spelling done in '.emacs-autogen'.
 ;(add-hook 'text-mode-hook 'flyspell-mode)
 ;(setq flyspell-default-dictionary "russianw")
 ;(setq flyspell-delay '1)
-;; (setq ispell-local-dictionary-alist
-;;   '((nil             ; default (english.aff)
-;;      "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil iso-8859-1)
-;;     ("UK-xlg"                ; english large version
-;;      "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B" "-d" "UK-xlg") nil iso-8859-1)
-;;     ("US-xlg"                ; american large version
-;;      "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B" "-d" "US-xlg") nil iso-8859-1)
-;;    )
-;; )
 
 ;; ======================================================================
 ;; GTD, PIM, organize, todo mode.
@@ -685,7 +702,7 @@
       (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
       (setq org-directory (expand-file-name "~/.gtd"))
       (setq org-default-notes-file (expand-file-name "~/.gtd/notes"))
-      (setq org-agenda-ndays 14
+      (setq org-agenda-ndays 31
             org-deadline-warning-days 7
             org-agenda-show-all-dates t
             org-agenda-format-date "%Y-%m-%d, %A %e %B"
@@ -702,7 +719,7 @@
 ;; ----------------------------------------------------------------------
 ;; remember-mode.
 
-(if (featurep 'remember)
+(if (or (featurep 'remember) (fboundp 'remember))
     (progn
       (setq remember-annotation-functions '(org-remember-annotation))
       (setq remember-handler-functions '(org-remember-handler))
@@ -796,6 +813,12 @@
 ;; ----------------------------------------------------------------------
 ;; erc.
 
+;; Take off noise message.
+(setq erc-track-exclude-types '("JOIN" "PART" "QUIT" "NICK" "MODE"))
+
+(setq erc-current-nick-highlight-type 'nick-or-keyword)
+(setq erc-track-use-faces t)
+
 (setq erc-server-coding-system 'utf-8)
 
 ;; ======================================================================
@@ -804,7 +827,8 @@
 (if (equal window-system 'w32)
     (progn
       (modify-coding-system-alist 'process "cvs" '(cp1251-dos . cp1251-dos))
-      (modify-coding-system-alist 'process "svn" '(cp866-dos . cp1251-dos))
+      (modify-coding-system-alist 'process "svn" '(cp1251 . cp1251))
+      (setq vc-svn-checkin-switches '("--encoding" "utf-8"))
       ))
 
 ;; (setq-default vc-svn-register-switches "--encoding cp1251")
--- a/.emacs-pre	Thu Apr 01 22:47:31 2010 +0300
+++ b/.emacs-pre	Sat Jul 24 14:25:26 2010 +0300
@@ -1,7 +1,3 @@
 ;; -*- mode: lisp; coding: utf-8; fill-column: 78 -*-
 ;;
 ;; For load order see README.
-
-;; Set frame width and heith. 150x46 for 13pt 1280x800, 150x60 for 13pt 1280x1024.
-;; (setq my-frame-width 150)
-;; (setq my-frame-height 60)
--- a/INSTALL	Thu Apr 01 22:47:31 2010 +0300
+++ b/INSTALL	Sat Jul 24 14:25:26 2010 +0300
@@ -31,12 +31,14 @@
 
 ** Setup INFOPATH.
 
-To browse info file inside Emacs set INFOPATH like this:
+To browse info file inside Emacs set INFOPATH like this for Cygwin:
+
+  INFOPATH=e:/opt/cygwin/usr/share/info;e:/home/usr/share/info;e:/bin/gnuwin32/info;e:/bin/gnuwin32/share/info:
+
+and like this for MinGW:
 
   INFOPATH=e:/bin/gnutls/share/info;e:/bin/gnuwin32/info;e:/bin/gnuwin32/share/info;e:/bin/MinGW/info;e:/bin/MinGW/share/info;e:/bin/wget/info:
 
-for MinGW.
-
 Note that last colon symbol is essential for include also Emacs info to list.
 
 * GTD (org-mode).
--- a/Makefile	Thu Apr 01 22:47:31 2010 +0300
+++ b/Makefile	Sat Jul 24 14:25:26 2010 +0300
@@ -6,6 +6,18 @@
   $(error Home env var not set!)
 endif
 
+host_os = unix
+ifneq '' '$(COMSPEC)'
+  host_os = windows
+endif
+
+# Special case for Windows if emacs-nox from Cygwin installed along with native Emacs.
+# So we run native Emacs to compile sources.
+EMACS = emacs
+ifeq 'windows' '$(host_os)'
+  EMACS = runemacs
+endif
+
 FILES_MODE_EL := $(wildcard *-mode.el)
 
 .PHONY: all
@@ -22,13 +34,15 @@
 		if [ ! -f $(HOME)/$$file ]; then cp $$file $(HOME)/$$file; fi; \
 	done
 	cp .emacs $(HOME)/.emacs
+	cp .emacs-autogen $(HOME)/.emacs-autogen
+	sh .emacs-autogen.sh $(HOME)/.emacs-autogen
 	cp .emacs-my $(HOME)/.emacs-my
 	rm -f -r $(HOME)/.emacs.d/my-lisp
 	mkdir -p $(HOME)/.emacs.d/my-lisp
 	for file in $(FILES_MODE_EL); do \
 		cp -f $$file $(HOME)/.emacs.d/my-lisp; \
 	done
-	emacs --batch \
+	$(EMACS) --batch \
 		--eval='(let ( (generated-autoload-file "~/.emacs.d/my-lisp/autoload-my.el") ) (update-directory-autoloads "~/.emacs.d/my-lisp") )'
 
 .PHONY: uninstall
--- a/README	Thu Apr 01 22:47:31 2010 +0300
+++ b/README	Sat Jul 24 14:25:26 2010 +0300
@@ -9,6 +9,9 @@
 Main Emacs config file is '~/.emacs'. I decide don't store beside it all
 customisations. Instead it simply load files in such order:
 
+  '~/.emacs-autogen'
+                It content depend on installation environment. Automatically
+                generated.
   '~/.emacs-pre'
                 For manually written customisation (usually for updating
                 load-path) which can affect on '.emacs-my'. Will not be