# HG changeset patch # User Oleksandr Gavenko # Date 1255853435 -10800 # Node ID c3ec8e16a00717c8d933501c5a05ff0135b64ce5 # Parent e36736f245fddae40ca5f44ba56738f8419d21f0# Parent 6454364c25cf1c1cc58e2cfb079ed97024f63f61 merged diff -r e36736f245fd -r c3ec8e16a007 .emacs-my --- 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 diff -r e36736f245fd -r c3ec8e16a007 Makefile --- a/Makefile Sun Oct 18 11:09:44 2009 +0300 +++ b/Makefile Sun Oct 18 11:10:35 2009 +0300 @@ -4,23 +4,47 @@ $(error Home env var not set!) endif -.PHONY: all install install-all +.PHONY: all install preinstall install-all preinstall-all update-dot-emacs-pre update-dot-emacs-post tar all: install -install: .emacs .emacs-my .emacs-pre .emacs-post +install: preinstall update-dot-emacs-pre update-dot-emacs-post + +preinstall: .emacs .emacs-my .emacs-pre .emacs-post for file in .emacs-pre .emacs-post; do \ if [ ! -f $(HOME)/$$file ]; then cp $$file $(HOME)/$$file; fi; \ done cp .emacs $(HOME)/.emacs cp .emacs-my $(HOME)/.emacs-my -install-all: .emacs .emacs-my .emacs-pre .emacs-post +install-all: preinstall-all update-dot-emacs-pre update-dot-emacs-post + +preinstall-all: .emacs .emacs-my .emacs-pre .emacs-post for file in $^; do \ cp $$file $(HOME)/$$file; \ done -dist-tar: +update-dot-emacs-pre: + for file in `cd template-pre; ls *.el`; do \ + tag=$${file%.el}; \ + if grep "DO NOT EDIT COMMENT! TAG: $$tag" $(HOME)/.emacs-pre; then \ + :; \ + else \ + cat template-pre/$$file >>$(HOME)/.emacs-pre; \ + fi; \ + done + +update-dot-emacs-post: + for file in `cd template-post; ls *.el`; do \ + tag=$${file%.el}; \ + if grep "DO NOT EDIT COMMENT! TAG: $$tag" $(HOME)/.emacs-post; then \ + :; \ + else \ + cat template-post/$$file >>$(HOME)/.emacs-post; \ + fi; \ + done + +tar: tar cf dot-emacs.tar .emacs .emacs-my clean: diff -r e36736f245fd -r c3ec8e16a007 template-post/resize-frame.el --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/template-post/resize-frame.el Sun Oct 18 11:10:35 2009 +0300 @@ -0,0 +1,8 @@ +;; DO NOT EDIT COMMENT! TAG: resize-frame +;; Size of emacs area and its position. +(when window-system + ;; This size for 1280x1024 resolusion and 13pt font to occupy almost all screen. + (run-at-time (format "%d sec" 1) nil '(lambda () (set-frame-position (selected-frame) 1 1))) + (run-at-time (format "%d sec" 2) nil '(lambda () (set-frame-width (selected-frame) 150 t))) + (run-at-time (format "%d sec" 3) nil '(lambda () (set-frame-height (selected-frame) 60 t))) + ) diff -r e36736f245fd -r c3ec8e16a007 template-pre/nsis-mode.el --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/template-pre/nsis-mode.el Sun Oct 18 11:10:35 2009 +0300 @@ -0,0 +1,11 @@ +;; DO NOT EDIT COMMENT! TAG: nsis-mode +(when (eq window-system 'w32) + (define-generic-mode 'nsis-generic-mode + (list ?\;) + '("Section" "SectionEnd" "Function" "FunctionEnd" "Call" "Goto") + '(("!\\([A-Za-z]+\\)" (1 'font-lock-builtin-face)) + ("$[({]?\\([A-Za-z0-9_]+\\)[)}]?" (1 'font-lock-variable-name-face)) + ) + (list "\\.\\(nsi\\|nsh\\)$") + nil + "Generic mode for nsis files."))