.emacs-my
changeset 615 22cf0c9014d9
parent 614 41c826f2b24f
child 616 c8a07683bc57
equal deleted inserted replaced
614:41c826f2b24f 615:22cf0c9014d9
   190 ;; Also useful such format: (setq display-time-format " %H:%M %d-%m-%y ")
   190 ;; Also useful such format: (setq display-time-format " %H:%M %d-%m-%y ")
   191 (setq display-time-24hr-format t)
   191 (setq display-time-24hr-format t)
   192 (setq display-time-default-load-average nil)
   192 (setq display-time-default-load-average nil)
   193 (display-time)                          ; display-time-mode
   193 (display-time)                          ; display-time-mode
   194 
   194 
   195 (if window-system
   195 (when window-system
   196     ;; For graphical environment.
   196   (set-background-color "white")
   197     (progn
   197   (set-foreground-color "black")
   198       (set-background-color "white")
   198   (set-cursor-color "brown")
   199       (set-foreground-color "black")
   199   ;; (set-mouse-color "white")
   200       (set-cursor-color "brown")
   200   (setq cursor-type 'box)           ; box, hollow, bar, hbar
   201       ;; (set-mouse-color "white")
   201   ;;(setq blink-matching-delay 0.01)
   202       (setq cursor-type 'box)           ; box, hollow, bar, hbar
   202   (blink-cursor-mode 1)
   203       ;;(setq blink-matching-delay 0.01)
   203   ;; (set-face-font 'default "7x14")
   204       (blink-cursor-mode 1)
   204   )
   205       ;; (set-face-font 'default "7x14")
       
   206       )
       
   207   ;; For tty.
       
   208   (progn
       
   209     )
       
   210 )
       
   211 
   205 
   212 ;; See what I am typing immediately (for keystroke in minibuffer).
   206 ;; See what I am typing immediately (for keystroke in minibuffer).
   213 (setq echo-keystrokes 0.2)
   207 (setq echo-keystrokes 0.2)
   214 
   208 
   215 ;;; ----------------------------------------------------------------
   209 ;;; ----------------------------------------------------------------
   249 ;; (desktop-read)
   243 ;; (desktop-read)
   250 
   244 
   251 ;;; ----------------------------------------------------------------
   245 ;;; ----------------------------------------------------------------
   252 (message "standart/general settings")
   246 (message "standart/general settings")
   253 
   247 
   254 (if (boundp 'confirm-kill-emacs)
   248 (when (boundp 'confirm-kill-emacs)
   255     (setq confirm-kill-emacs 'yes-or-no-p))
   249   (setq confirm-kill-emacs 'yes-or-no-p))
   256 
   250 
   257 ;; Try to speed things up, especially in VM.
   251 ;; Try to speed things up, especially in VM.
   258 (setq gc-cons-threshold 2000000)
   252 (setq gc-cons-threshold 2000000)
   259 
   253 
   260 ;; Default 'command-history' length too short (in Emacs 23.2 is 30).
   254 ;; Default 'command-history' length too short (in Emacs 23.2 is 30).
   495 
   489 
   496 (global-set-key (kbd "\e\eg") 'goto-line)
   490 (global-set-key (kbd "\e\eg") 'goto-line)
   497 (global-set-key (kbd "\e\er") 'query-replace-regexp)
   491 (global-set-key (kbd "\e\er") 'query-replace-regexp)
   498 
   492 
   499 ;; Disable suspend. It ugly.
   493 ;; Disable suspend. It ugly.
   500 (if window-system (global-set-key (kbd "C-z") nil))
   494 (when window-system
       
   495   (global-set-key (kbd "C-z") nil))
   501 (global-set-key (kbd "C-x C-z") nil)
   496 (global-set-key (kbd "C-x C-z") nil)
   502 
   497 
   503 ;; (global-set-key [language-change] 'ignore)
   498 ;; (global-set-key [language-change] 'ignore)
   504 
   499 
   505 ;;; ----------------------------------------------------------------
   500 ;;; ----------------------------------------------------------------
   521 ;; (set-keyboard-coding-system 'cp1251)
   516 ;; (set-keyboard-coding-system 'cp1251)
   522 
   517 
   523 (modify-coding-system-alist 'file "\\.el" 'iso-2022-7bit)
   518 (modify-coding-system-alist 'file "\\.el" 'iso-2022-7bit)
   524 (cond
   519 (cond
   525  ((equal window-system 'w32)          ; also (string-equal system-type "windows-nt")
   520  ((equal window-system 'w32)          ; also (string-equal system-type "windows-nt")
   526   (progn
   521   (set-selection-coding-system 'utf-16-le-dos)
   527     (set-selection-coding-system 'utf-16-le-dos)
   522   (setq-default buffer-file-coding-system 'cp1251)
   528     (setq-default buffer-file-coding-system 'cp1251)
   523   (setq default-file-name-coding-system 'cp1251)
   529     (setq default-file-name-coding-system 'cp1251)
   524   (setq default-process-coding-system '(cp1251 . cp1251))
   530     (setq default-process-coding-system '(cp1251 . cp1251))
   525   )
   531     ))
       
   532  ((equal window-system 'x)
   526  ((equal window-system 'x)
   533   (progn
   527   (prefer-coding-system 'utf-8-unix)
   534     (prefer-coding-system 'utf-8-unix)
   528   (setq selection-coding-system 'compound-text-with-extensions)
   535     (setq selection-coding-system 'compound-text-with-extensions)
   529   (setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))
   536     (setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))
   530   (modify-coding-system-alist 'process ".*" 'utf-8-unix)
   537     (modify-coding-system-alist 'process ".*" 'utf-8-unix)
   531   )
   538     ))
       
   539  (t
   532  (t
   540   (progn
   533   (prefer-coding-system 'cp1251-dos)
   541     (prefer-coding-system 'cp1251-dos)
   534   (prefer-coding-system 'utf-8-unix)
   542     (prefer-coding-system 'utf-8-unix)
   535   (modify-coding-system-alist 'process ".*" 'utf-8-unix)
   543     (modify-coding-system-alist 'process ".*" 'utf-8-unix)
   536   )
   544     ))
   537  )
   545   )
       
   546 
   538 
   547 ;;; ----------------------------------------------------------------
   539 ;;; ----------------------------------------------------------------
   548 (message "open file, ffap, dired")
   540 (message "open file, ffap, dired")
   549 
   541 
   550 (setq-default save-place t)
   542 (setq-default save-place t)
   640 
   632 
   641 ;;; ----------------------------------------------------------------
   633 ;;; ----------------------------------------------------------------
   642 (message "compression, archive")
   634 (message "compression, archive")
   643 
   635 
   644 (require 'jka-compr) ; Automatic decompression, hooks for tar-mode.
   636 (require 'jka-compr) ; Automatic decompression, hooks for tar-mode.
   645 (if (fboundp 'auto-compression-mode)
   637 (when (fboundp 'auto-compression-mode)
   646     (auto-compression-mode 1))
   638   (auto-compression-mode 1))
   647 
   639 
   648 (modify-coding-system-alist 'file "\\.\\(war\\|ear\\|sar\\|egg\\)\\'" 'no-conversion)
   640 (modify-coding-system-alist 'file "\\.\\(war\\|ear\\|sar\\|egg\\)\\'" 'no-conversion)
   649 
   641 
   650 (add-to-list 'auto-mode-alist '("\\.\\(war\\|ear\\|sar\\|egg\\)\\'" . archive-mode))
   642 (add-to-list 'auto-mode-alist '("\\.\\(war\\|ear\\|sar\\|egg\\)\\'" . archive-mode))
   651 
   643 
   903 (when (>= emacs-major-version 22)
   895 (when (>= emacs-major-version 22)
   904   (require 'org))
   896   (require 'org))
   905 
   897 
   906 ;; XXX org-todo-keywords '((sequence "TODO" "START" "|" "DONE")) for org-version 4.67c
   898 ;; XXX org-todo-keywords '((sequence "TODO" "START" "|" "DONE")) for org-version 4.67c
   907 ;; XXX (setq org-todo-keywords '("TODO" "START" "DONE")) for org-version 6.05b
   899 ;; XXX (setq org-todo-keywords '("TODO" "START" "DONE")) for org-version 6.05b
   908 (if (or (featurep 'org) (featurep 'org-install))
   900 (when (or (featurep 'org) (featurep 'org-install))
   909     (progn
   901   (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
   910       (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
   902   (setq
   911       (setq
   903    org-directory "~/.gtd"
   912        org-directory "~/.gtd"
   904    org-default-notes-file nil
   913        org-default-notes-file nil
   905    org-agenda-ndays 31
   914        org-agenda-ndays 31
   906    org-deadline-warning-days 7
   915        org-deadline-warning-days 7
   907    org-agenda-show-all-dates t
   916        org-agenda-show-all-dates t
   908    org-agenda-format-date "%Y-%m-%d, %A %e %B"
   917        org-agenda-format-date "%Y-%m-%d, %A %e %B"
   909    org-agenda-skip-deadline-if-done t
   918        org-agenda-skip-deadline-if-done t
   910    org-agenda-skip-scheduled-if-done t
   919        org-agenda-skip-scheduled-if-done t
   911    org-agenda-start-on-weekday nil
   920        org-agenda-start-on-weekday nil
   912    org-reverse-note-order t
   921        org-reverse-note-order t
   913    org-hide-leading-stars t
   922        org-hide-leading-stars t
   914    org-tags-column 64
   923        org-tags-column 64
   915    )
   924        )
   916   (setq my-org-agenda-todo-file "~/.gtd/TODO.org")
   925       (setq my-org-agenda-todo-file "~/.gtd/TODO.org")
   917   (setq my-org-agenda-note-file "~/.gtd/NOTE.org")
   926       (setq my-org-agenda-note-file "~/.gtd/NOTE.org")
   918   (setq org-agenda-files `(,my-org-agenda-todo-file ,my-org-agenda-note-file))
   927       (setq org-agenda-files `(,my-org-agenda-todo-file ,my-org-agenda-note-file))
   919   (define-key global-map "\C-ca" 'org-agenda)
   928       (define-key global-map "\C-ca" 'org-agenda)
   920   (define-key global-map "\C-ct" (lambda nil (interactive) (find-file my-org-agenda-note-file)))
   929       (define-key global-map "\C-ct" (lambda nil (interactive) (find-file my-org-agenda-note-file)))
   921 
   930 
   922   (when (or (featurep 'remember) (fboundp 'remember))
   931       (when
   923     (setq remember-annotation-functions '(org-remember-annotation))
   932           (or (featurep 'remember) (fboundp 'remember))
   924     (setq remember-handler-functions '(org-remember-handler))
   933         (progn
   925     (add-hook 'remember-mode-hook 'org-remember-apply-template)
   934           (setq remember-annotation-functions '(org-remember-annotation))
   926     (define-key global-map "\C-cr" 'org-remember)
   935           (setq remember-handler-functions '(org-remember-handler))
   927     (setq org-remember-templates
   936           (add-hook 'remember-mode-hook 'org-remember-apply-template)
   928           ;; With one item org-mode do not prompt choose template.
   937           (define-key global-map "\C-cr" 'org-remember)
   929           `(
   938           (setq org-remember-templates
   930             ("todo" ?t "* TODO %?" ,my-org-agenda-todo-file)
   939                 ;; With one item org-mode do not prompt choose template.
   931             ;; ("note" ?n "* %?\n" ,my-org-agenda-note-file)
   940                 `(
   932             ))
   941                   ("todo" ?t "* TODO %?" ,my-org-agenda-todo-file)
   933     (setq org-remember-store-without-prompt t)
   942                   ;; ("note" ?n "* %?\n" ,my-org-agenda-note-file)
   934     (org-remember-insinuate)
   943                   ))
   935     )
   944           (setq org-remember-store-without-prompt t)
   936 
   945           (org-remember-insinuate)
   937   ;; (setq org-todo-keyword-faces
   946           ))
   938   ;;       '(("TODO" . (:foreground "red" :weight bold))
   947 
   939   ;;         ("WAIT" . (:foreground "orange" :weight bold))
   948       ;; (setq org-todo-keyword-faces
   940   ;;         ("DONE" . (:foreground "green" :weight bold))) )
   949       ;;       '(("TODO" . (:foreground "red" :weight bold))
   941   )
   950       ;;         ("WAIT" . (:foreground "orange" :weight bold))
       
   951       ;;         ("DONE" . (:foreground "green" :weight bold))) )
       
   952       ))
       
   953 
   942 
   954 ;;; ----------------------------------------------------------------
   943 ;;; ----------------------------------------------------------------
   955 (message "TODO, XXX, FIXME highlight")
   944 (message "TODO, XXX, FIXME highlight")
   956 ;; Show blanks and FIXME
   945 ;; Show blanks and FIXME
   957 ;; http://www.emacswiki.org/cgi-bin/wiki/EightyColumnRule
   946 ;; http://www.emacswiki.org/cgi-bin/wiki/EightyColumnRule
  1075 (setq erc-server-coding-system 'utf-8)
  1064 (setq erc-server-coding-system 'utf-8)
  1076 
  1065 
  1077 ;;; ----------------------------------------------------------------
  1066 ;;; ----------------------------------------------------------------
  1078 (message "VCS, version control, cvs, svn, mercurial, hg, bazaar, bzr, git, fossil")
  1067 (message "VCS, version control, cvs, svn, mercurial, hg, bazaar, bzr, git, fossil")
  1079 
  1068 
  1080 (if (equal window-system 'w32)
  1069 (when (equal window-system 'w32)
  1081     (progn
  1070   (modify-coding-system-alist 'process "cvs" '(cp1251-dos . cp1251-dos))
  1082       (modify-coding-system-alist 'process "cvs" '(cp1251-dos . cp1251-dos))
  1071   (modify-coding-system-alist 'process "svn" '(cp1251 . cp1251))
  1083       (modify-coding-system-alist 'process "svn" '(cp1251 . cp1251))
  1072   (setq vc-svn-checkin-switches '("--encoding" "UTF-8"))
  1084       (setq vc-svn-checkin-switches '("--encoding" "UTF-8"))
  1073   )
  1085       ))
  1074 
  1086 
  1075 (when window-system
  1087 (if window-system
  1076   (setq
  1088     (progn
  1077    vc-annotate-very-old-color "#0b5b20"
  1089       (setq
  1078    vc-annotate-background "white"
  1090        vc-annotate-very-old-color "#0b5b20"
  1079    vc-annotate-color-map
  1091        vc-annotate-background "white"
  1080    '(
  1092        vc-annotate-color-map
  1081      (20 .  "#EE0000")
  1093        '(
  1082      (40 .  "#E0800D")
  1094          (20 .  "#EE0000")
  1083      (60 .  "#D3001A")
  1095          (40 .  "#E0800D")
  1084      (80 .  "#C68027")
  1096          (60 .  "#D3001A")
  1085      (100 . "#B90034")
  1097          (80 .  "#C68027")
  1086      (120 . "#AB8042")
  1098          (100 . "#B90034")
  1087      (140 . "#9E004F")
  1099          (120 . "#AB8042")
  1088      (160 . "#91805C")
  1100          (140 . "#9E004F")
  1089      (180 . "#840069")
  1101          (160 . "#91805C")
  1090      (200 . "#778077")
  1102          (180 . "#840069")
  1091      (220 . "#690084")
  1103          (200 . "#778077")
  1092      (240 . "#5C8091")
  1104          (220 . "#690084")
  1093      (260 . "#4F009E")
  1105          (240 . "#5C8091")
  1094      (280 . "#4280AB")
  1106          (260 . "#4F009E")
  1095      (300 . "#3400B9")
  1107          (280 . "#4280AB")
  1096      (320 . "#2780C6")
  1108          (300 . "#3400B9")
  1097      (340 . "#1A00D3")
  1109          (320 . "#2780C6")
  1098      (360 . "#0D80E0")))
  1110          (340 . "#1A00D3")
       
  1111          (360 . "#0D80E0")))
       
  1112       )
       
  1113   )
  1099   )
  1114 
  1100 
  1115 ;;; ----------------------------------------------------------------
  1101 ;;; ----------------------------------------------------------------
  1116 (message "psvn")
  1102 (message "psvn")
  1117 
  1103