diff -r c770f75a351f -r 6ae9e98a1d53 .emacs-my --- a/.emacs-my Sat Mar 13 16:20:30 2010 +0200 +++ b/.emacs-my Sun Mar 14 20:49:34 2010 +0200 @@ -18,6 +18,27 @@ ;; Set the debug option to enable a backtrace when a problem occurs. (setq debug-on-error nil) ; t/nil +;; ---------------------------------------------------------------------- +;; mode groups + +(defvar my-devel-mode-list + '(sh-mode script-mode java-mode c-mode + lisp-mode makefile-mode makefile-gmake-mode python-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) + "List of development mode hooks.") + +(defvar my-text-mode-list + '(outline-mode text-mode) + "List of text modes.") + +(defvar my-text-mode-hook-list + '(outline-mode-hook text-mode-hook) + "List of text mode hooks.") + ;; ====================================================================== ;; appearance. @@ -26,12 +47,24 @@ (tooltip-mode -1) (scroll-bar-mode 1) +(setq frame-title-format "Emacs - %b") + +;; show column & line numbers in status bar +(setq column-number-mode t) +(setq line-number-mode t) + +;; Also useful such format: (setq display-time-format " %H:%M %d-%m-%y ") +(setq display-time-24hr-format t) +(setq display-time-default-load-average nil) +(display-time) ; display-time-mode + (if window-system ;; For graphical environment. (progn (set-background-color "white") (set-foreground-color "black") (set-cursor-color "brown") + ;; (set-mouse-color "white") (setq cursor-type 'box) ; box, hollow, bar, hbar ;;(setq blink-matching-delay 0.01) (blink-cursor-mode 1) @@ -71,16 +104,26 @@ ;; ====================================================================== ;; standart/general settings. +(if (boundp 'confirm-kill-emacs) + (setq confirm-kill-emacs 'yes-or-no-p)) + +;; Try to speed things up, especially in VM. +(setq gc-cons-threshold 2000000) + +;; 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 + ; revert screen if press [end] or [home] + +;; Prompt before evaluating local bits of lisp. This stops people +;; putting things at the end of files which delete all your files! +(setq enable-local-variables t + enable-local-eval 1) + (setq kill-whole-line t) -;; show column & line numbers in status bar -(setq column-number-mode t) -(setq line-number-mode t) - (setq view-read-only t) -(setq frame-title-format "Emacs - %b") - (setq read-quoted-char-radix 16) ;; ---------------------------------------------------------------------- @@ -109,14 +152,20 @@ ;; ---------------------------------------------------------------------- ;; scrolling. +(defvar my-scroll-margin 4) + (setq-default scroll-step 1 - scroll-conservatively 100 - ;; При перемещении точка останавливается на расстоянии i строк к границе фрейма. - scroll-margin 2 + scroll-conservatively my-scroll-margin scroll-preserve-screen-position t ) +;; Set margin only for desired modes! Do not frustrate calendar any more. +(make-variable-buffer-local 'scroll-margin) +(mapc (lambda (hook) (add-hook hook (lambda nil (setq scroll-margin my-scroll-margin)))) + (delete-dups (append my-text-mode-hook-list my-devel-mode-hook-list + '(recentf-mode-hook))) ) + ;; ---------------------------------------------------------------------- ;; searching. @@ -130,10 +179,6 @@ (global-set-key [f7] 'occur) ; Key binding as in mc ;; ---------------------------------------------------------------------- -;; *Text* -(setq default-major-mode 'text-mode) - -;; ---------------------------------------------------------------------- ;; syntax highlighting. (setq font-lock-maximum-decoration t) @@ -287,33 +332,6 @@ ;; (set-language-environment "Russian") ; XXX not used as set default coding system to koi8-r. -;; ====================================================================== -;; -;; NON-STANDARD VARIABLES - -;; ====================================================================== -;; -;; STANDARD VARIABLES - -(if (boundp 'confirm-kill-emacs) - (setq confirm-kill-emacs 'yes-or-no-p)) - -;; Try to speed things up, especially in VM. -(setq gc-cons-threshold 2000000) - -;; 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 - ; revert screen if press [end] or [home] - -;; Prompt before evaluating local bits of lisp. This stops people -;; putting things at the end of files which delete all your files! -(setq enable-local-variables t - enable-local-eval 1) - -;; ====================================================================== -;; STANDARD LIBRARIES - ;; ---------------------------------------------------------------------- ;; dired. @@ -405,15 +423,6 @@ (setq browse-url-browser-function 'browse-url-mozilla))) ;; ---------------------------------------------------------------------- -;; time. - -;; Also useful such format: -;; (setq display-time-format " %H:%M %d-%m-%y ") -(setq display-time-24hr-format t) -(setq display-time-default-load-average nil) -(display-time) ; display-time-mode - -;; ---------------------------------------------------------------------- ;; calendar. ;; (setq mark-holidays-in-calendar t) @@ -434,6 +443,9 @@ (setq-default fill-column 78) +(defvar my-fill-column 100 + "I use greater value then 78 for comment in prog source.") + ;; By default used American convention - sentence and with two spaces. Change ;; it to one space. Has affect on filling and M-a, M-e commands. (setq sentence-end-double-space nil) @@ -597,6 +609,7 @@ (setq org-agenda-ndays 14 org-deadline-warning-days 7 org-agenda-show-all-dates t + org-agenda-format-date "%Y-%m-%d, %A %e %B" org-agenda-skip-deadline-if-done t org-agenda-skip-scheduled-if-done t org-agenda-start-on-weekday nil @@ -650,11 +663,6 @@ "Font for showing conflicts." :group 'basic-faces) -(defvar my-devel-mode-list - '(sh-mode script-mode java-mode c-mode outline-mode text-mode - lisp-mode makefile-mode makefile-gmake-mode python-mode) - "List of development modes." ) - (add-hook 'font-lock-mode-hook (function (lambda () (when (member major-mode my-devel-mode-list) (font-lock-add-keywords nil @@ -781,14 +789,10 @@ (setq-default comment-style (quote indent)) (setq-default comment-column 44) -(setq-default comment-fill-column 100) +(setq-default comment-fill-column my-fill-column) -(mapc (lambda (mode) - (add-hook mode - (lambda () - (setq fill-column 110) ) - )) - '(c-mode-hook lisp-mode-hook)) +(mapc (lambda (hook) (add-hook hook (lambda () (setq fill-column my-fill-column)) )) + my-devel-mode-hook-list) ;; ---------------------------------------------------------------------- ;; diff, patch.