.emacs-my
changeset 189 c3ec8e16a007
parent 188 e36736f245fd
parent 183 6454364c25cf
child 190 f511a2b4694b
--- a/.emacs-my	Sun Oct 18 11:09:44 2009 +0300
+++ b/.emacs-my	Sun Oct 18 11:10:35 2009 +0300
@@ -12,8 +12,7 @@
 ;; ======================================================================
 ;; Debugging.
 
-;; Shut off message buffer by setting nil. Note - if you need to debug emacs,
-;; comment these out so you can see what's going on.
+;; Shut off message buffer by setting nil.
 (setq message-log-max 100)
 
 ;;(add-hook 'after-init-hook
@@ -35,11 +34,6 @@
 (if window-system
     ;; Для X-window и Win
     (progn
-      ;; size of emacs area and position
-      (set-frame-height (selected-frame) 60)
-      (set-frame-width (selected-frame) 120)
-      ;; (set-frame-position (selected-frame) 10 25)
-
       ;;установка цветов экрана
       (set-background-color "white")
       (set-foreground-color "black")
@@ -49,6 +43,7 @@
       ;; курсор не мигает!
       ;; (blink-cursor-mode nil)
       ;; (set-face-font 'default "7x14")
+      (fringe-mode 'default)
       )
   ;; Для tty
   (progn
@@ -68,6 +63,10 @@
 ;; (require 'gnuserv)
 ;; (setq gnuserv-frame (selected-frame))
 
+(require 'server)
+(when (and (= emacs-major-version 23) (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)
@@ -86,6 +85,9 @@
 
 (setq frame-title-format "Emacs - %b")
 
+;; Always end a file with a newline.
+;; (setq require-final-newline t)
+
 ;; ----------------------------------------------------------------------
 ;; Switching, creating, selecting buffers.
 (iswitchb-mode 1)
@@ -120,9 +122,6 @@
  )
 
 ;; ----------------------------------------------------------------------
-;; fringe-mode
-
-;; ----------------------------------------------------------------------
 ;; *Text*
 (setq default-major-mode 'text-mode)
 
@@ -403,8 +402,6 @@
 ;; ======================================================================
 ;; *auto-fill*
 
-;; To enable/disable auto-fill mode type ESC M-f.
-
 (setq-default fill-column 78)
 
 ;; By default used American convention - sentence and with two spaces. Change
@@ -456,7 +453,6 @@
 ;; (desire 'abbrev)
 ;; (desire 'bibtex)
 ;; (desire 'calc)
-;; (desire 'cc-mode)
 ;; (desire 'ediff)
 ;; (desire 'eiffel-mode)
 ;; (desire 'emacs-w3m)
@@ -727,6 +723,10 @@
           )
   )
 
+;; fsm used in emacs jabber
+(when (featurep 'fsm)
+  (setq fsm-debug nil)                  ; Disable *fsm-debug* buffer.
+  )
 
 ;; ----------------------------------------------------------------------
 ;; rcirc
@@ -764,7 +764,32 @@
   )
 
 (if window-system
-    (setq-default vc-annotate-background "white")
+    (progn
+     (custom-set-variables
+      '(vc-annotate-very-old-color "#0b5b20")
+      '(vc-annotate-background "white")
+      '(vc-annotate-color-map
+        (quote (
+                (20 .  "#EE0000")
+                (40 .  "#E0800D")
+                (60 .  "#D3001A")
+                (80 .  "#C68027")
+                (100 . "#B90034")
+                (120 . "#AB8042")
+                (140 . "#9E004F")
+                (160 . "#91805C")
+                (180 . "#840069")
+                (200 . "#778077")
+                (220 . "#690084")
+                (240 . "#5C8091")
+                (260 . "#4F009E")
+                (280 . "#4280AB")
+                (300 . "#3400B9")
+                (320 . "#2780C6")
+                (340 . "#1A00D3")
+                (360 . "#0D80E0"))))
+      )
+     )
   )
 
 ;; ----------------------------------------------------------------------
@@ -779,7 +804,9 @@
 
 (add-to-list 'auto-mode-alist '("\\.cu$" . c-mode))
 
-(setq comment-style (quote indent))
+(setq-default comment-style (quote indent))
+(setq-default comment-column 44)
+(setq-default comment-fill-column 100)
 
 (setq-default show-trailing-whitespace t)
 
@@ -831,13 +858,24 @@
 ;; (setq-default asm-comment-char 59)
 (add-hook 'asm-mode-hook '(lambda () (setq comment-start "/*") (setq comment-end "*/")) t)
 
+;; (add-hook 'asm-mode-hook '(lambda () (local-unset-key ":")))
+;; (add-hook 'asm-mode-hook '(lambda () (local-set-key ":" ":")))
+
 ;; ----------------------------------------------------------------------
 ;; LISP
 (setq list-command-history-max 256)
 
 ;; ----------------------------------------------------------------------
-;; C, c-lang
+;; C, c-mode, C++, c++-mode
+
 (setq c-echo-syntactic-information-p t)
+(add-hook 'c-mode-common-hook
+ (lambda ()
+   ;; Automatically inserte newlines after special characters such as brace, comma, semi-colon, and colon.
+   (c-toggle-auto-newline -1)
+   ;; Delete all preceding whitespace by DEL.
+   (c-toggle-hungry-state -1)
+   ))
 
 (defconst my-c-style
   '((c-tab-always-indent . t)
@@ -881,24 +919,9 @@
     (c-echo-syntactic-information-p . t))
   "My C Programming Style")
 
-;; (objc-mode . "my-mode") (c++-mode . "cc-mode")
 (add-hook 'c-mode-common-hook
           (lambda () (c-add-style "my" my-c-style t)))
-(setq c-default-style '((java-mode . "my") (c-mode . "my") (csharp-mode . "my") (other . "my")))
-
-;; Customizations for all modes in CC Mode.
-;; (defun my-c-mode-common-hook ()
-;;   ;; add my personal style and set it for the current buffer
-;;   (c-add-style "PERSONAL" my-c-style t)
-;;   ;; other customizations
-;;   ;; we like auto-newline and hungry-delete
-;;   (c-toggle-auto-hungry-state 1)
-;;   ;; key bindings for all supported languages.  We can put these in
-;;   ;; c-mode-base-map because c-mode-map, c++-mode-map, objc-mode-map,
-;;   ;; java-mode-map, idl-mode-map, and pike-mode-map inherit from it.
-;;   (define-key c-mode-base-map "\C-m" 'c-context-line-break))
-
-;; (add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
+(setq c-default-style '((java-mode . "my") (c-mode . "my") (csharp-mode . "my") (c++-mode . "my") (objc-mode . "my") (other . "my")))
 
 ;; ----------------------------------------------------------------------
 ;; *csharp*, c-sharp