.emacs-my
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sun, 26 Feb 2012 19:45:31 +0200
changeset 864 adacfc97125b
parent 863 d48ba6196046
child 865 2a99ede322cd
permissions -rw-r--r--
Load 'pymacs' and 'ropemacs' automatically.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
     1
;; -*- mode: emacs-lisp; coding: utf-8; fill-column: 78 -*-
6
d1c4515c3cfa Add copyright notice.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 5
diff changeset
     2
;;
279
fd6164dfec82 Update copyright statement and year.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 272
diff changeset
     3
;; Written by Oleksandr Gavenko <gavenkoa@gmail.com>, 2008-2010.
6
d1c4515c3cfa Add copyright notice.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 5
diff changeset
     4
;;
121
864a0daf737e Update copiright.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 120
diff changeset
     5
;; This file formed from parts and ideas from many sites/docs and
110
6b6e3f8cb371 Set copyright notice.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 109
diff changeset
     6
;; placed in public domain.
6b6e3f8cb371 Set copyright notice.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 109
diff changeset
     7
;;
302
e93ff9360a51 Point to README from config file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 299
diff changeset
     8
;; Config file for GNU Emacs.
83
d2eaf2ed6d1c Added basic jabber customization.
gavenkoa@gavenko.bifit.int
parents: 82
diff changeset
     9
;;
351
e30e4bd7e85e Small spell correction.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 348
diff changeset
    10
;; For load order see README.
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
    11
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
    12
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
611
49c993d41d3f Firstly enable 'recentf' to easy access to recently edited file when Emacs
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 610
diff changeset
    13
(message "recentf")
49c993d41d3f Firstly enable 'recentf' to easy access to recently edited file when Emacs
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 610
diff changeset
    14
766
31b6b63917df Use different 'recentf' and 'desktop' files and do not enable
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 764
diff changeset
    15
(setq recentf-save-file "~/.recentf")
31b6b63917df Use different 'recentf' and 'desktop' files and do not enable
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 764
diff changeset
    16
(when (eq system-type 'cygwin)
31b6b63917df Use different 'recentf' and 'desktop' files and do not enable
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 764
diff changeset
    17
  (setq recentf-save-file "~/.recentf-cygwin")
31b6b63917df Use different 'recentf' and 'desktop' files and do not enable
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 764
diff changeset
    18
  )
611
49c993d41d3f Firstly enable 'recentf' to easy access to recently edited file when Emacs
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 610
diff changeset
    19
(require 'recentf)
49c993d41d3f Firstly enable 'recentf' to easy access to recently edited file when Emacs
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 610
diff changeset
    20
;; Prevent TRAMP to login on remote host when loading.
49c993d41d3f Firstly enable 'recentf' to easy access to recently edited file when Emacs
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 610
diff changeset
    21
;; Its take time and ask passwords!
49c993d41d3f Firstly enable 'recentf' to easy access to recently edited file when Emacs
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 610
diff changeset
    22
(setq recentf-auto-cleanup 'never)
49c993d41d3f Firstly enable 'recentf' to easy access to recently edited file when Emacs
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 610
diff changeset
    23
(recentf-mode t)
49c993d41d3f Firstly enable 'recentf' to easy access to recently edited file when Emacs
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 610
diff changeset
    24
(setq recentf-max-saved-items 1000)
49c993d41d3f Firstly enable 'recentf' to easy access to recently edited file when Emacs
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 610
diff changeset
    25
(global-set-key (kbd "\e\eq")  'recentf-open-files)
49c993d41d3f Firstly enable 'recentf' to easy access to recently edited file when Emacs
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 610
diff changeset
    26
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
    27
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
658
b8a1ffa6408f Make revert buffer available more early.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 657
diff changeset
    28
(message "revert buffer")
b8a1ffa6408f Make revert buffer available more early.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 657
diff changeset
    29
b8a1ffa6408f Make revert buffer available more early.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 657
diff changeset
    30
(global-set-key [f5]    'revert-buffer)
b8a1ffa6408f Make revert buffer available more early.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 657
diff changeset
    31
(setq revert-without-query (quote (".*")))
b8a1ffa6408f Make revert buffer available more early.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 657
diff changeset
    32
(setq auto-revert-interval 2)
b8a1ffa6408f Make revert buffer available more early.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 657
diff changeset
    33
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
    34
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
    35
(message "debugging")
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
    36
175
a505ab71060a Make comment shorter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 174
diff changeset
    37
;; Shut off message buffer by setting nil.
252
330b4cdfaddf Increase log message count.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 251
diff changeset
    38
(setq message-log-max 512)
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
    39
539
4e0728ed912a Document 'inhibit-default-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 538
diff changeset
    40
;; Prevent Emacs from loading 'default.el', which loaded after '.emacs'.
4e0728ed912a Document 'inhibit-default-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 538
diff changeset
    41
;; Also '-q' prevent loading your init file.
4e0728ed912a Document 'inhibit-default-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 538
diff changeset
    42
(setq inhibit-default-init nil)         ; t/nil
4e0728ed912a Document 'inhibit-default-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 538
diff changeset
    43
743
234a9934b957 With prefix enable debug backtrace when problems occur else disable.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 742
diff changeset
    44
(defun my-debug (mode)
234a9934b957 With prefix enable debug backtrace when problems occur else disable.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 742
diff changeset
    45
  "With prefix enable debug backtrace when problems occur else disable."
234a9934b957 With prefix enable debug backtrace when problems occur else disable.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 742
diff changeset
    46
  (interactive "P")
234a9934b957 With prefix enable debug backtrace when problems occur else disable.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 742
diff changeset
    47
  (when mode
756
8dbeaf05129d Don't call the debugger regardless of condition handlers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 755
diff changeset
    48
    ;; (setq debug-on-signal t)
743
234a9934b957 With prefix enable debug backtrace when problems occur else disable.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 742
diff changeset
    49
    (setq mode t))
234a9934b957 With prefix enable debug backtrace when problems occur else disable.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 742
diff changeset
    50
  (setq debug-on-error mode)
234a9934b957 With prefix enable debug backtrace when problems occur else disable.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 742
diff changeset
    51
  ;; Get trace when press C-g.
234a9934b957 With prefix enable debug backtrace when problems occur else disable.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 742
diff changeset
    52
  (setq debug-on-quit mode)
234a9934b957 With prefix enable debug backtrace when problems occur else disable.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 742
diff changeset
    53
  )
234a9934b957 With prefix enable debug backtrace when problems occur else disable.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 742
diff changeset
    54
234a9934b957 With prefix enable debug backtrace when problems occur else disable.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 742
diff changeset
    55
(my-debug nil)
234a9934b957 With prefix enable debug backtrace when problems occur else disable.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 742
diff changeset
    56
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
    57
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
    58
(message "user info")
531
a6466b47121e Move user info to top.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 530
diff changeset
    59
774
ebfb1eb5cf56 Set following in ~/.emacs-auth.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 773
diff changeset
    60
;; Set following in ~/.emacs-auth:
ebfb1eb5cf56 Set following in ~/.emacs-auth.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 773
diff changeset
    61
;; (setq user-full-name "Oleksandr Gavenko")
ebfb1eb5cf56 Set following in ~/.emacs-auth.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 773
diff changeset
    62
;; (setq user-mail-address "gavenkoa@gmail.com")
ebfb1eb5cf56 Set following in ~/.emacs-auth.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 773
diff changeset
    63
;; (setq user-nick "gavenkoa")
ebfb1eb5cf56 Set following in ~/.emacs-auth.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 773
diff changeset
    64
825
92790cbc5fd2 Set 'user-nick' if it was not defined in ~/.emacs-auth or somewhere.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 824
diff changeset
    65
(unless (and (boundp 'user-nick) (stringp user-nick))
92790cbc5fd2 Set 'user-nick' if it was not defined in ~/.emacs-auth or somewhere.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 824
diff changeset
    66
  (setq user-nick (user-login-name)) )
531
a6466b47121e Move user info to top.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 530
diff changeset
    67
(setenv "ORGANIZATION" (concat user-full-name " <" user-mail-address  ">"))
a6466b47121e Move user info to top.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 530
diff changeset
    68
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
    69
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
670
d10f2e70ff5e Redefine action to put 'html' tag in sgml-mode (more pretty look).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 669
diff changeset
    70
(message "my defun, defmacro, defvar")
d10f2e70ff5e Redefine action to put 'html' tag in sgml-mode (more pretty look).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 669
diff changeset
    71
d10f2e70ff5e Redefine action to put 'html' tag in sgml-mode (more pretty look).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 669
diff changeset
    72
(defmacro my-filter (condfunc list)
d10f2e70ff5e Redefine action to put 'html' tag in sgml-mode (more pretty look).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 669
diff changeset
    73
  "Construct list with elements from LIST which satisfy CONDFUNC."
d10f2e70ff5e Redefine action to put 'html' tag in sgml-mode (more pretty look).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 669
diff changeset
    74
  `(let (r)
d10f2e70ff5e Redefine action to put 'html' tag in sgml-mode (more pretty look).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 669
diff changeset
    75
     (mapc (lambda (item)
d10f2e70ff5e Redefine action to put 'html' tag in sgml-mode (more pretty look).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 669
diff changeset
    76
             (when (,condfunc item)
d10f2e70ff5e Redefine action to put 'html' tag in sgml-mode (more pretty look).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 669
diff changeset
    77
               (if r
d10f2e70ff5e Redefine action to put 'html' tag in sgml-mode (more pretty look).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 669
diff changeset
    78
                   (nconc r (cons item nil))
d10f2e70ff5e Redefine action to put 'html' tag in sgml-mode (more pretty look).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 669
diff changeset
    79
                 (setq r (cons item nil)))))
d10f2e70ff5e Redefine action to put 'html' tag in sgml-mode (more pretty look).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 669
diff changeset
    80
           ,list)
d10f2e70ff5e Redefine action to put 'html' tag in sgml-mode (more pretty look).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 669
diff changeset
    81
     r))
d10f2e70ff5e Redefine action to put 'html' tag in sgml-mode (more pretty look).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 669
diff changeset
    82
716
a3f42d9dd281 my-percent-decode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 715
diff changeset
    83
(defun my-fold (f x list)
a3f42d9dd281 my-percent-decode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 715
diff changeset
    84
  "Recursively applies (F i j) to LIST starting with X.
a3f42d9dd281 my-percent-decode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 715
diff changeset
    85
For example, (fold F X '(1 2 3)) computes (F (F (F X 1) 2) 3)."
a3f42d9dd281 my-percent-decode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 715
diff changeset
    86
  (let ((li list) (x2 x))
a3f42d9dd281 my-percent-decode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 715
diff changeset
    87
    (while li
a3f42d9dd281 my-percent-decode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 715
diff changeset
    88
      (setq x2 (funcall f x2 (pop li)))
a3f42d9dd281 my-percent-decode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 715
diff changeset
    89
      )
a3f42d9dd281 my-percent-decode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 715
diff changeset
    90
    x2
a3f42d9dd281 my-percent-decode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 715
diff changeset
    91
    ) )
a3f42d9dd281 my-percent-decode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 715
diff changeset
    92
720
e50b78c6a53d Fix: ignore-errors does not defined under Emacs 22.2.1 (on Debian).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 699
diff changeset
    93
(unless (fboundp 'ignore-errors)
e50b78c6a53d Fix: ignore-errors does not defined under Emacs 22.2.1 (on Debian).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 699
diff changeset
    94
  (defmacro ignore-errors (&rest body)
e50b78c6a53d Fix: ignore-errors does not defined under Emacs 22.2.1 (on Debian).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 699
diff changeset
    95
    "Execute BODY; if an error occurs, return nil.
e50b78c6a53d Fix: ignore-errors does not defined under Emacs 22.2.1 (on Debian).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 699
diff changeset
    96
Otherwise, return result of last form in BODY."
e50b78c6a53d Fix: ignore-errors does not defined under Emacs 22.2.1 (on Debian).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 699
diff changeset
    97
    (declare (debug t) (indent 0))
e50b78c6a53d Fix: ignore-errors does not defined under Emacs 22.2.1 (on Debian).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 699
diff changeset
    98
    `(condition-case nil (progn ,@body) (error nil)))
e50b78c6a53d Fix: ignore-errors does not defined under Emacs 22.2.1 (on Debian).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 699
diff changeset
    99
  )
e50b78c6a53d Fix: ignore-errors does not defined under Emacs 22.2.1 (on Debian).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 699
diff changeset
   100
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   101
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
   102
(message "mode groups")
333
14b07ca8335a Set margin only for desired modes! Do not frustrate calendar any more.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 332
diff changeset
   103
606
959d64f49788 Generalize code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 605
diff changeset
   104
(defmacro my-defun-rename-symb-tree (name doc func)
959d64f49788 Generalize code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 605
diff changeset
   105
  "Travel by TREE and applies FUNC to each symbol."
959d64f49788 Generalize code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 605
diff changeset
   106
  `(defun ,name (tree)
959d64f49788 Generalize code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 605
diff changeset
   107
     ,doc
959d64f49788 Generalize code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 605
diff changeset
   108
     (cond
959d64f49788 Generalize code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 605
diff changeset
   109
      ((symbolp tree)
959d64f49788 Generalize code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 605
diff changeset
   110
       (,func tree)
959d64f49788 Generalize code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 605
diff changeset
   111
       )
959d64f49788 Generalize code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 605
diff changeset
   112
      ((listp tree)
959d64f49788 Generalize code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 605
diff changeset
   113
       (mapcar ',name tree)
959d64f49788 Generalize code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 605
diff changeset
   114
       )
959d64f49788 Generalize code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 605
diff changeset
   115
      (t (error "Only tree of symbols allowed."))
959d64f49788 Generalize code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 605
diff changeset
   116
      )))
605
c228c0414e0b Generalize logic to rename symbols.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 604
diff changeset
   117
606
959d64f49788 Generalize code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 605
diff changeset
   118
(my-defun-rename-symb-tree
959d64f49788 Generalize code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 605
diff changeset
   119
 my-feature2mode
959d64f49788 Generalize code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 605
diff changeset
   120
 "Convert TREE of features to TREE of modes for these features. Single symbol allowed."
959d64f49788 Generalize code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 605
diff changeset
   121
 (lambda (symb) (intern (concat (symbol-name symb) "-mode"))))
605
c228c0414e0b Generalize logic to rename symbols.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 604
diff changeset
   122
606
959d64f49788 Generalize code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 605
diff changeset
   123
(my-defun-rename-symb-tree
959d64f49788 Generalize code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 605
diff changeset
   124
 my-mode2hook
959d64f49788 Generalize code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 605
diff changeset
   125
 "Convert TREE of modes to TREE of hooks for these modes. Single symbol allowed."
959d64f49788 Generalize code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 605
diff changeset
   126
 (lambda (symb) (intern (concat (symbol-name symb) "-hook")))
959d64f49788 Generalize code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 605
diff changeset
   127
 )
605
c228c0414e0b Generalize logic to rename symbols.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 604
diff changeset
   128
606
959d64f49788 Generalize code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 605
diff changeset
   129
(my-defun-rename-symb-tree
959d64f49788 Generalize code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 605
diff changeset
   130
 my-mode2modemap
959d64f49788 Generalize code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 605
diff changeset
   131
 "Convert TREE of modes to TREE of keymaps for these modes. Single symbol allowed."
959d64f49788 Generalize code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 605
diff changeset
   132
 (lambda (symb) (intern (concat (symbol-name symb) "-map")))
959d64f49788 Generalize code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 605
diff changeset
   133
 )
493
4f91b5ccab17 'my-modelist-to-hooklist' convert list of MODES to list of hooks for these
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 492
diff changeset
   134
333
14b07ca8335a Set margin only for desired modes! Do not frustrate calendar any more.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 332
diff changeset
   135
(defvar my-devel-mode-list
401
4e91288dbd84 Highlight TODO FIXME in outline-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 400
diff changeset
   136
  '(
695
273e9d5c4f86 Add 'tcl-mode' to 'my-devel-mode-list'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 692
diff changeset
   137
    sh-mode script-mode tcl-mode
488
a3e4b656e4e6 Added js-mode to my list of development modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 487
diff changeset
   138
    c-mode c++-mode java-mode js-mode
401
4e91288dbd84 Highlight TODO FIXME in outline-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 400
diff changeset
   139
    python-mode
4e91288dbd84 Highlight TODO FIXME in outline-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 400
diff changeset
   140
    lisp-mode
4e91288dbd84 Highlight TODO FIXME in outline-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 400
diff changeset
   141
    emacs-lisp-mode
4e91288dbd84 Highlight TODO FIXME in outline-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 400
diff changeset
   142
    makefile-mode makefile-gmake-mode
494
e388310789d1 Added 'nsis-mode' to 'my-devel-mode-list'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 493
diff changeset
   143
    nsis-mode
692
6e566f6c7386 Add 'bat-generic-mode' to 'my-devel-mode-list'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 691
diff changeset
   144
    bat-generic-mode
631
eb5ce5b0b208 Add 'html-mode' to devel mode list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 629
diff changeset
   145
    html-mode
737
fb4d18368c1f Add 'LilyPond-mode' to 'my-devel-mode-list' for enabling scroll-margin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 736
diff changeset
   146
    LilyPond-mode
401
4e91288dbd84 Highlight TODO FIXME in outline-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 400
diff changeset
   147
    )
333
14b07ca8335a Set margin only for desired modes! Do not frustrate calendar any more.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 332
diff changeset
   148
  "List of development modes.")
14b07ca8335a Set margin only for desired modes! Do not frustrate calendar any more.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 332
diff changeset
   149
14b07ca8335a Set margin only for desired modes! Do not frustrate calendar any more.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 332
diff changeset
   150
(defvar my-devel-mode-hook-list
605
c228c0414e0b Generalize logic to rename symbols.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 604
diff changeset
   151
   (my-mode2hook my-devel-mode-list)
493
4f91b5ccab17 'my-modelist-to-hooklist' convert list of MODES to list of hooks for these
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 492
diff changeset
   152
  "List of development mode hooks.")
4f91b5ccab17 'my-modelist-to-hooklist' convert list of MODES to list of hooks for these
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 492
diff changeset
   153
4f91b5ccab17 'my-modelist-to-hooklist' convert list of MODES to list of hooks for these
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 492
diff changeset
   154
(defvar my-scroll-margin-mode-list
427
69d3c7df190f Added outline-mode-hook to my-devel-mode-hook-list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 426
diff changeset
   155
  '(
493
4f91b5ccab17 'my-modelist-to-hooklist' convert list of MODES to list of hooks for these
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 492
diff changeset
   156
    vc-dir-mode
4f91b5ccab17 'my-modelist-to-hooklist' convert list of MODES to list of hooks for these
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 492
diff changeset
   157
    recentf-dialog-mode
4f91b5ccab17 'my-modelist-to-hooklist' convert list of MODES to list of hooks for these
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 492
diff changeset
   158
    org-agenda-grid-mode           ; XXX for this item not worked!
4f91b5ccab17 'my-modelist-to-hooklist' convert list of MODES to list of hooks for these
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 492
diff changeset
   159
    log-view-mode
4f91b5ccab17 'my-modelist-to-hooklist' convert list of MODES to list of hooks for these
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 492
diff changeset
   160
    dired-mode
4f91b5ccab17 'my-modelist-to-hooklist' convert list of MODES to list of hooks for these
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 492
diff changeset
   161
    compilation-mode
4f91b5ccab17 'my-modelist-to-hooklist' convert list of MODES to list of hooks for these
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 492
diff changeset
   162
    )
4f91b5ccab17 'my-modelist-to-hooklist' convert list of MODES to list of hooks for these
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 492
diff changeset
   163
  "List of modes for enabling scroll margin.")
333
14b07ca8335a Set margin only for desired modes! Do not frustrate calendar any more.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 332
diff changeset
   164
391
09cfea42153e Added list of mode hooks for enabling scroll margin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 389
diff changeset
   165
(defvar my-scroll-margin-mode-hook-list
605
c228c0414e0b Generalize logic to rename symbols.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 604
diff changeset
   166
  (my-mode2hook my-scroll-margin-mode-list)
391
09cfea42153e Added list of mode hooks for enabling scroll margin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 389
diff changeset
   167
  "List of mode hooks for enabling scroll margin.")
09cfea42153e Added list of mode hooks for enabling scroll margin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 389
diff changeset
   168
333
14b07ca8335a Set margin only for desired modes! Do not frustrate calendar any more.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 332
diff changeset
   169
(defvar my-text-mode-list
631
eb5ce5b0b208 Add 'html-mode' to devel mode list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 629
diff changeset
   170
  '(
eb5ce5b0b208 Add 'html-mode' to devel mode list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 629
diff changeset
   171
    text-mode
eb5ce5b0b208 Add 'html-mode' to devel mode list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 629
diff changeset
   172
    outline-mode
665
9761254a1260 Maintaining the table of contents up-to-date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 664
diff changeset
   173
    rst-mode
723
ff912b026ad2 Move 'diff-mode' to 'my-text-mode-list' for trailing spaces highlighting.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 721
diff changeset
   174
    diff-mode
691
0722f3949eda Enable dict-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 689
diff changeset
   175
    dict-c5-mode
631
eb5ce5b0b208 Add 'html-mode' to devel mode list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 629
diff changeset
   176
    )
333
14b07ca8335a Set margin only for desired modes! Do not frustrate calendar any more.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 332
diff changeset
   177
  "List of text modes.")
14b07ca8335a Set margin only for desired modes! Do not frustrate calendar any more.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 332
diff changeset
   178
14b07ca8335a Set margin only for desired modes! Do not frustrate calendar any more.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 332
diff changeset
   179
(defvar my-text-mode-hook-list
605
c228c0414e0b Generalize logic to rename symbols.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 604
diff changeset
   180
  (my-mode2hook my-text-mode-list)
333
14b07ca8335a Set margin only for desired modes! Do not frustrate calendar any more.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 332
diff changeset
   181
  "List of text mode hooks.")
14b07ca8335a Set margin only for desired modes! Do not frustrate calendar any more.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 332
diff changeset
   182
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   183
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
   184
(message "appearance")
362
f4bd431ad549 By default start from user home directory (HOME point to it).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 361
diff changeset
   185
370
378a4dc8ea1c Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 369
diff changeset
   186
;; To maximize frame on full screen, not work with Windows Emacs 21.4.
378a4dc8ea1c Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 369
diff changeset
   187
;; And maked different height with Emacs 22.3 and 23.1.
378a4dc8ea1c Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 369
diff changeset
   188
;; (setq initial-frame-alist '((fullscreen . fullboth)))
378a4dc8ea1c Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 369
diff changeset
   189
550
d8092299457a (setq display-buffer-reuse-frames t)
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 549
diff changeset
   190
(setq display-buffer-reuse-frames t)
d8092299457a (setq display-buffer-reuse-frames t)
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 549
diff changeset
   191
370
378a4dc8ea1c Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 369
diff changeset
   192
;; Next code work with Emacs 21.4, 22.3, 23.1.
378a4dc8ea1c Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 369
diff changeset
   193
(when window-system
378a4dc8ea1c Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 369
diff changeset
   194
  (let (
378a4dc8ea1c Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 369
diff changeset
   195
        (px (display-pixel-width))
378a4dc8ea1c Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 369
diff changeset
   196
        (py (display-pixel-height))
378a4dc8ea1c Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 369
diff changeset
   197
        (fx (frame-char-width))
378a4dc8ea1c Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 369
diff changeset
   198
        (fy (frame-char-height))
378a4dc8ea1c Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 369
diff changeset
   199
        tx ty
378a4dc8ea1c Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 369
diff changeset
   200
        )
378a4dc8ea1c Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 369
diff changeset
   201
    ;; Next formulas discovered empiric on Windows host with default font.
373
bdf2522ad35c On Debian with font 7x13 right part of windows go out of display border.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 372
diff changeset
   202
    (setq tx (- (/ px fx) 7))
370
378a4dc8ea1c Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 369
diff changeset
   203
    (setq ty (- (/ py fy) 4))
625
78017f6d5b43 Indent initial frame to 2 pixel.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 624
diff changeset
   204
    (setq initial-frame-alist '((top . 2) (left . 2)))
370
378a4dc8ea1c Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 369
diff changeset
   205
    (add-to-list 'initial-frame-alist (cons 'width tx))
378a4dc8ea1c Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 369
diff changeset
   206
    (add-to-list 'initial-frame-alist (cons 'height ty))
378a4dc8ea1c Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 369
diff changeset
   207
    ) )
378a4dc8ea1c Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 369
diff changeset
   208
151
0b6f4adf5096 Minor changes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 150
diff changeset
   209
(menu-bar-mode -1)
415
a325b9a15b8e Fix: 'scroll-bar-mode' and 'tooltip-mode' do not defined in Cygwin nox Emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 412
diff changeset
   210
(when window-system
585
2431be336034 mouse-avoidance-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 584
diff changeset
   211
  (mouse-avoidance-mode 'animate)
502
64a475fa36e2 tool-bar-mode not available under Cygwin console Emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 501
diff changeset
   212
  (scroll-bar-mode 1)
64a475fa36e2 tool-bar-mode not available under Cygwin console Emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 501
diff changeset
   213
  (tool-bar-mode -1)
429
998f33a8ec6e Open menu by f10 like by C-Mouse-3 without mouse!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 428
diff changeset
   214
  (defun my-popup-menu ()
998f33a8ec6e Open menu by f10 like by C-Mouse-3 without mouse!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 428
diff changeset
   215
    (interactive)
490
d6c84d84af9b 'mouse-menu-bar-map' appear only in Emacs 23.x. To get work on any Emacs used
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 489
diff changeset
   216
    (mouse-popup-menubar
d6c84d84af9b 'mouse-menu-bar-map' appear only in Emacs 23.x. To get work on any Emacs used
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 489
diff changeset
   217
     (list (list (/ (display-pixel-width) 2) 10) (get-buffer-window (buffer-name)))
d6c84d84af9b 'mouse-menu-bar-map' appear only in Emacs 23.x. To get work on any Emacs used
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 489
diff changeset
   218
     nil)
d6c84d84af9b 'mouse-menu-bar-map' appear only in Emacs 23.x. To get work on any Emacs used
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 489
diff changeset
   219
    )
429
998f33a8ec6e Open menu by f10 like by C-Mouse-3 without mouse!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 428
diff changeset
   220
  (global-set-key [f10] 'my-popup-menu)
436
95dfd88eee58 Open *Global menu* by <apps> key.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 435
diff changeset
   221
  (global-set-key [apps] 'my-popup-menu)
491
72d77b2117d1 Menu key under X have name 'menu' (in contrast to Windows - 'app').
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 490
diff changeset
   222
  (global-set-key [menu] 'my-popup-menu)
415
a325b9a15b8e Fix: 'scroll-bar-mode' and 'tooltip-mode' do not defined in Cygwin nox Emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 412
diff changeset
   223
  (when (>= emacs-major-version 22) (tooltip-mode -1))
a325b9a15b8e Fix: 'scroll-bar-mode' and 'tooltip-mode' do not defined in Cygwin nox Emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 412
diff changeset
   224
  )
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   225
595
be6c27e4c776 Fix "Prefer horizontal windows splitting" for terminals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 594
diff changeset
   226
;; Prefer horizontal windows splitting.
612
1c59e45f5358 split-height-threshold/split-width-threshold can not be nil in Emacs 21.x/22.x.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 611
diff changeset
   227
(when (>= emacs-major-version 23)
1c59e45f5358 split-height-threshold/split-width-threshold can not be nil in Emacs 21.x/22.x.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 611
diff changeset
   228
  (setq split-height-threshold nil)
1c59e45f5358 split-height-threshold/split-width-threshold can not be nil in Emacs 21.x/22.x.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 611
diff changeset
   229
  (setq split-width-threshold nil)
1c59e45f5358 split-height-threshold/split-width-threshold can not be nil in Emacs 21.x/22.x.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 611
diff changeset
   230
  )
573
c28b88b60ed0 Prefer horizontal windows splitting.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 524
diff changeset
   231
641
712eec51428a Change 'frame-title-format'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 640
diff changeset
   232
(setq frame-title-format "EMACS: %b")
338
ebf88f988c37 Move some appearance related switch together.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 337
diff changeset
   233
363
17df92226b5a Set default-header-line-format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 362
diff changeset
   234
(setq default-header-line-format nil)
17df92226b5a Set default-header-line-format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 362
diff changeset
   235
;; (setq default-mode-line-format nil)
17df92226b5a Set default-header-line-format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 362
diff changeset
   236
364
3d18cfe179cc Set default fringe and margin width.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 363
diff changeset
   237
(setq default-left-fringe-width nil)
3d18cfe179cc Set default fringe and margin width.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 363
diff changeset
   238
(setq default-right-fringe-width nil)
3d18cfe179cc Set default fringe and margin width.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 363
diff changeset
   239
(setq default-left-margin-width nil)
3d18cfe179cc Set default fringe and margin width.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 363
diff changeset
   240
(setq default-right-margin-width nil)
3d18cfe179cc Set default fringe and margin width.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 363
diff changeset
   241
365
913375395214 No spasing between text lines.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 364
diff changeset
   242
(setq default-line-spacing nil)
913375395214 No spasing between text lines.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 364
diff changeset
   243
366
223c01e1a084 Don't truncate long lines.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 365
diff changeset
   244
(setq default-truncate-lines nil)
223c01e1a084 Don't truncate long lines.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 365
diff changeset
   245
338
ebf88f988c37 Move some appearance related switch together.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 337
diff changeset
   246
;; show column & line numbers in status bar
ebf88f988c37 Move some appearance related switch together.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 337
diff changeset
   247
(setq column-number-mode t)
ebf88f988c37 Move some appearance related switch together.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 337
diff changeset
   248
(setq line-number-mode t)
413
5b28a08bf61b Set size-indication-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 412
diff changeset
   249
(setq size-indication-mode t)
338
ebf88f988c37 Move some appearance related switch together.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 337
diff changeset
   250
ebf88f988c37 Move some appearance related switch together.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 337
diff changeset
   251
;; Also useful such format: (setq display-time-format " %H:%M %d-%m-%y ")
ebf88f988c37 Move some appearance related switch together.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 337
diff changeset
   252
(setq display-time-24hr-format t)
683
b50b879b9e04 display-time-day-and-date
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 682
diff changeset
   253
(setq display-time-day-and-date nil)
338
ebf88f988c37 Move some appearance related switch together.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 337
diff changeset
   254
(setq display-time-default-load-average nil)
ebf88f988c37 Move some appearance related switch together.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 337
diff changeset
   255
(display-time)                          ; display-time-mode
ebf88f988c37 Move some appearance related switch together.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 337
diff changeset
   256
615
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   257
(when window-system
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   258
  (set-background-color "white")
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   259
  (set-foreground-color "black")
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   260
  (set-cursor-color "brown")
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   261
  ;; (set-mouse-color "white")
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   262
  (setq cursor-type 'box)           ; box, hollow, bar, hbar
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   263
  ;;(setq blink-matching-delay 0.01)
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   264
  (blink-cursor-mode 1)
686
563751ecd385 Bind 'yes-or-no-p' to 'y-or-n-p'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 685
diff changeset
   265
  (setq use-file-dialog t)
563751ecd385 Bind 'yes-or-no-p' to 'y-or-n-p'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 685
diff changeset
   266
  (setq use-dialog-box t)
615
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   267
  ;; (set-face-font 'default "7x14")
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   268
  )
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   269
218
1a48dde2dfa3 See what I am typing immediately (for keystroke in minibuffer).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 217
diff changeset
   270
;; See what I am typing immediately (for keystroke in minibuffer).
1a48dde2dfa3 See what I am typing immediately (for keystroke in minibuffer).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 217
diff changeset
   271
(setq echo-keystrokes 0.2)
1a48dde2dfa3 See what I am typing immediately (for keystroke in minibuffer).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 217
diff changeset
   272
686
563751ecd385 Bind 'yes-or-no-p' to 'y-or-n-p'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 685
diff changeset
   273
(fset 'yes-or-no-p 'y-or-n-p)
563751ecd385 Bind 'yes-or-no-p' to 'y-or-n-p'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 685
diff changeset
   274
563751ecd385 Bind 'yes-or-no-p' to 'y-or-n-p'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 685
diff changeset
   275
(when (boundp 'confirm-kill-emacs)
563751ecd385 Bind 'yes-or-no-p' to 'y-or-n-p'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 685
diff changeset
   276
  (setq confirm-kill-emacs 'y-or-n-p))
563751ecd385 Bind 'yes-or-no-p' to 'y-or-n-p'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 685
diff changeset
   277
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   278
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
   279
(message "silent runing")
85
2bb7e6aceac9 Added target dist-tar.
gavenkoa@gavenko.bifit.int
parents: 83
diff changeset
   280
2bb7e6aceac9 Added target dist-tar.
gavenkoa@gavenko.bifit.int
parents: 83
diff changeset
   281
;; (setq inhibit-splash-screen t) ; nonexist on 21.4.1
2bb7e6aceac9 Added target dist-tar.
gavenkoa@gavenko.bifit.int
parents: 83
diff changeset
   282
(setq inhibit-startup-message t)
2bb7e6aceac9 Added target dist-tar.
gavenkoa@gavenko.bifit.int
parents: 83
diff changeset
   283
734
d5281f386f48 Fix headline.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 733
diff changeset
   284
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
676
0accf646e451 Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 675
diff changeset
   285
(message "shell, bash, Cygwin, MSYS")
675
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
   286
676
0accf646e451 Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 675
diff changeset
   287
(defvar my-use-windows-shell nil
0accf646e451 Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 675
diff changeset
   288
  "If t 'cmdproxy.exe' will be used as shell. Affect on M-x shell like
0accf646e451 Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 675
diff changeset
   289
  commands. If nil, 'sh' will be used." )
0accf646e451 Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 675
diff changeset
   290
709
2cb49be54b21 Follow new-style (and also UCS-16) Cygwin symlinks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
   291
(defun follow-cygwin-symlink ()
2cb49be54b21 Follow new-style (and also UCS-16) Cygwin symlinks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
   292
  "Follow new-style (and also UCS-16) Cygwin symlinks."
2cb49be54b21 Follow new-style (and also UCS-16) Cygwin symlinks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
   293
  (save-excursion
2cb49be54b21 Follow new-style (and also UCS-16) Cygwin symlinks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
   294
    (goto-char 0)
2cb49be54b21 Follow new-style (and also UCS-16) Cygwin symlinks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
   295
    (when (looking-at "!<symlink>\xff\xfe")
2cb49be54b21 Follow new-style (and also UCS-16) Cygwin symlinks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
   296
      (find-alternate-file
2cb49be54b21 Follow new-style (and also UCS-16) Cygwin symlinks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
   297
       (substring
2cb49be54b21 Follow new-style (and also UCS-16) Cygwin symlinks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
   298
        (decode-coding-string
2cb49be54b21 Follow new-style (and also UCS-16) Cygwin symlinks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
   299
         (buffer-substring (match-end 0) (point-max))
2cb49be54b21 Follow new-style (and also UCS-16) Cygwin symlinks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
   300
         'utf-16-le)
2cb49be54b21 Follow new-style (and also UCS-16) Cygwin symlinks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
   301
        0 -1)                           ; -1 for stripping final \0.
2cb49be54b21 Follow new-style (and also UCS-16) Cygwin symlinks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
   302
       ))))
2cb49be54b21 Follow new-style (and also UCS-16) Cygwin symlinks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
   303
731
5b6105640c0e my-dos2cygwin-path
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 730
diff changeset
   304
(defun my-dos2cygwin-path (path)
5b6105640c0e my-dos2cygwin-path
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 730
diff changeset
   305
  "Convert DOS path to Cygwin according to current mount table."
732
139665dd6ada my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 731
diff changeset
   306
  (interactive (list (read-directory-name "Enter DOS path: ")))
731
5b6105640c0e my-dos2cygwin-path
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 730
diff changeset
   307
  (setq path (replace-regexp-in-string "\\\\" "/" (expand-file-name path)))
5b6105640c0e my-dos2cygwin-path
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 730
diff changeset
   308
  (let ( (table cygwin-mount-table--internal) item prefix )
5b6105640c0e my-dos2cygwin-path
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 730
diff changeset
   309
    (while table
5b6105640c0e my-dos2cygwin-path
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 730
diff changeset
   310
      (setq item (car table))
5b6105640c0e my-dos2cygwin-path
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 730
diff changeset
   311
      (setq prefix (concat "\\`" (regexp-quote (car item))))
5b6105640c0e my-dos2cygwin-path
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 730
diff changeset
   312
      (setq table (cdr table))
5b6105640c0e my-dos2cygwin-path
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 730
diff changeset
   313
      (when (string-match prefix path)
5b6105640c0e my-dos2cygwin-path
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 730
diff changeset
   314
        (setq path (replace-regexp-in-string prefix (cdr item) path))
5b6105640c0e my-dos2cygwin-path
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 730
diff changeset
   315
        (setq table nil)
5b6105640c0e my-dos2cygwin-path
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 730
diff changeset
   316
        ) )
5b6105640c0e my-dos2cygwin-path
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 730
diff changeset
   317
    path
5b6105640c0e my-dos2cygwin-path
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 730
diff changeset
   318
    ))
5b6105640c0e my-dos2cygwin-path
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 730
diff changeset
   319
676
0accf646e451 Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 675
diff changeset
   320
(when (eq system-type 'windows-nt)
675
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
   321
  (ignore-errors
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
   322
    (require 'cygwin-mount)
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
   323
    (cygwin-mount-activate)
676
0accf646e451 Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 675
diff changeset
   324
    )
733
67e6d0381996 Use 'find-file-hook' as 'find-file-hooks' marked as deprecated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 724
diff changeset
   325
  (add-hook 'find-file-hook 'follow-cygwin-symlink)
676
0accf646e451 Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 675
diff changeset
   326
  ;; Workaround for Cygwin shell, when set 'CYGWIN=noglob'. By default 'shell-quote-argument'
0accf646e451 Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 675
diff changeset
   327
  ;; quoted by double '\' chars this cause failure.
0accf646e451 Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 675
diff changeset
   328
  (defun shell-quote-argument (argument)
0accf646e451 Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 675
diff changeset
   329
    (concat "'" argument "'")
0accf646e451 Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 675
diff changeset
   330
    )
0accf646e451 Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 675
diff changeset
   331
  ;; Workaround for Cygwin when 'shell-file-name' is 'bash'.
0accf646e451 Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 675
diff changeset
   332
  (setq null-device "/dev/null")
0accf646e451 Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 675
diff changeset
   333
  ;; Use shell from Cygwin/MinGW.
0accf646e451 Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 675
diff changeset
   334
  (setq shell-file-name "bash")
0accf646e451 Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 675
diff changeset
   335
  (setenv "SHELL" "/bin/bash")
0accf646e451 Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 675
diff changeset
   336
  (modify-coding-system-alist 'process "bash" '(cp1251-unix . cp1251-unix))
0accf646e451 Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 675
diff changeset
   337
  )
0accf646e451 Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 675
diff changeset
   338
746
f7ce19afa666 Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 745
diff changeset
   339
(when (eq window-system 'w32)
f7ce19afa666 Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 745
diff changeset
   340
  ;; Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
f7ce19afa666 Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 745
diff changeset
   341
  ;; 'gnutls-cli' run with '-s' opt and process wait for SIGALRM.
f7ce19afa666 Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 745
diff changeset
   342
  ;; But build-in native Emacs 'kill' command can not send such Cygwin
f7ce19afa666 Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 745
diff changeset
   343
  ;; specific sygnal. So 'starttls-negotiate-gnutls' function infinitely
f7ce19afa666 Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 745
diff changeset
   344
  ;; wait for 'gnutls-cli' output.
f7ce19afa666 Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 745
diff changeset
   345
  (defadvice signal-process (around cygwin (process sigcode))
f7ce19afa666 Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 745
diff changeset
   346
    "Use 'kill.exe' instead build-in Emacs 'kill'."
f7ce19afa666 Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 745
diff changeset
   347
    (if (eq sigcode 'SIGALRM)
f7ce19afa666 Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 745
diff changeset
   348
        (shell-command
f7ce19afa666 Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 745
diff changeset
   349
         (format "kill.exe -s SIGALRM %d"
f7ce19afa666 Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 745
diff changeset
   350
                 (if (processp process) (process-id process) process)))
f7ce19afa666 Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 745
diff changeset
   351
      ad-do-it
f7ce19afa666 Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 745
diff changeset
   352
      ))
f7ce19afa666 Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 745
diff changeset
   353
  (ad-activate 'signal-process)
748
a42f5a803c98 Do not convert output of 'gnutls-cli'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 747
diff changeset
   354
  (modify-coding-system-alist 'process "gnutls-cli" '(binary . binary))
746
f7ce19afa666 Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 745
diff changeset
   355
  )
f7ce19afa666 Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 745
diff changeset
   356
858
81c925713d9c Add '.py' and '.sh' as allowed executable extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 857
diff changeset
   357
(when (eq window-system 'w32)
81c925713d9c Add '.py' and '.sh' as allowed executable extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 857
diff changeset
   358
  (add-to-list 'exec-suffixes ".py")
81c925713d9c Add '.py' and '.sh' as allowed executable extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 857
diff changeset
   359
  (add-to-list 'exec-suffixes ".sh")
81c925713d9c Add '.py' and '.sh' as allowed executable extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 857
diff changeset
   360
  (defun executable-find (command) (locate-file command exec-path exec-suffixes))
81c925713d9c Add '.py' and '.sh' as allowed executable extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 857
diff changeset
   361
  )
81c925713d9c Add '.py' and '.sh' as allowed executable extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 857
diff changeset
   362
676
0accf646e451 Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 675
diff changeset
   363
(ansi-color-for-comint-mode-on)
0accf646e451 Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 675
diff changeset
   364
0accf646e451 Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 675
diff changeset
   365
(setq explicit-bash-args '("-i"))
0accf646e451 Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 675
diff changeset
   366
(setq explicit-sh-args '("-i"))
675
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
   367
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   368
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
   369
(message "whitespaces")
361
9dbe92b8b329 Added indicate-buffer-boundaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 360
diff changeset
   370
9dbe92b8b329 Added indicate-buffer-boundaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 360
diff changeset
   371
(setq default-indicate-empty-lines t)
368
a9c688c1b85f More verbose buffer-boundaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 366
diff changeset
   372
(setq default-indicate-buffer-boundaries 'left)
361
9dbe92b8b329 Added indicate-buffer-boundaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 360
diff changeset
   373
624
9db0b51b229c Enable showing of trailing whitespace only in developer modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 623
diff changeset
   374
;; (setq-default show-trailing-whitespace t)
9db0b51b229c Enable showing of trailing whitespace only in developer modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 623
diff changeset
   375
(defun my-show-trailing-whitespace ()
9db0b51b229c Enable showing of trailing whitespace only in developer modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 623
diff changeset
   376
  (setq show-trailing-whitespace t)
9db0b51b229c Enable showing of trailing whitespace only in developer modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 623
diff changeset
   377
  )
9db0b51b229c Enable showing of trailing whitespace only in developer modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 623
diff changeset
   378
(mapc (lambda (hook) (add-hook hook 'my-show-trailing-whitespace))
669
12851e09e1ae Remove rst-mode from my-devel-mode-list as it does not support imenu (I get
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 668
diff changeset
   379
      (append my-devel-mode-hook-list my-text-mode-hook-list))
361
9dbe92b8b329 Added indicate-buffer-boundaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 360
diff changeset
   380
9dbe92b8b329 Added indicate-buffer-boundaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 360
diff changeset
   381
(setq next-line-add-newlines nil)
9dbe92b8b329 Added indicate-buffer-boundaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 360
diff changeset
   382
9dbe92b8b329 Added indicate-buffer-boundaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 360
diff changeset
   383
;; See also 'mode-require-final-newline'.
9dbe92b8b329 Added indicate-buffer-boundaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 360
diff changeset
   384
(add-hook 'text-mode-hook (lambda () (setq require-final-newline nil)))
9dbe92b8b329 Added indicate-buffer-boundaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 360
diff changeset
   385
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   386
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
741
cd25b9526e76 'gnuserv' now dead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 740
diff changeset
   387
(message "server")
85
2bb7e6aceac9 Added target dist-tar.
gavenkoa@gavenko.bifit.int
parents: 83
diff changeset
   388
766
31b6b63917df Use different 'recentf' and 'desktop' files and do not enable
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 764
diff changeset
   389
(when (and (>= emacs-major-version 22) (not (eq system-type 'cygwin)))
394
03d8b85ff815 Do not load server.el for Emacs 21.x.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 393
diff changeset
   390
  (require 'server)
398
47a3e4de976e Fix compare func name.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 397
diff changeset
   391
  (when (and (= emacs-major-version 23) (>= emacs-minor-version 1) (<= emacs-minor-version 2) (equal window-system 'w32))
394
03d8b85ff815 Do not load server.el for Emacs 21.x.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 393
diff changeset
   392
    (defun server-ensure-safe-dir (dir) "Noop" t)) ; Suppress error directory ~/.emacs.d/server is unsafe on windows.
662
81ca1335730a Fix condition as it stop server from loading.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 660
diff changeset
   393
  (when (or (= emacs-major-version 22) (not (eq (server-running-p server-name) t)))
640
b430ca70e6b0 Start the emacs server only if another instance of the server is not running.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 639
diff changeset
   394
    (server-start))
394
03d8b85ff815 Do not load server.el for Emacs 21.x.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 393
diff changeset
   395
  )
85
2bb7e6aceac9 Added target dist-tar.
gavenkoa@gavenko.bifit.int
parents: 83
diff changeset
   396
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   397
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
   398
(message "standart/general settings")
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   399
336
a252995f7d6b Move general getting into one place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 335
diff changeset
   400
;; Try to speed things up, especially in VM.
a252995f7d6b Move general getting into one place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 335
diff changeset
   401
(setq gc-cons-threshold 2000000)
a252995f7d6b Move general getting into one place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 335
diff changeset
   402
408
78cf8a4feb66 Fix: default 'command-history' length too short (in Emacs 23.2 is 30).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 404
diff changeset
   403
;; Default 'command-history' length too short (in Emacs 23.2 is 30).
78cf8a4feb66 Fix: default 'command-history' length too short (in Emacs 23.2 is 30).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 404
diff changeset
   404
(setq history-length 200)
78cf8a4feb66 Fix: default 'command-history' length too short (in Emacs 23.2 is 30).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 404
diff changeset
   405
336
a252995f7d6b Move general getting into one place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 335
diff changeset
   406
;; Don't beep in my headphones!
a252995f7d6b Move general getting into one place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 335
diff changeset
   407
(setq ring-bell-function '(lambda () "Empty ring-bell-function." nil))
a252995f7d6b Move general getting into one place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 335
diff changeset
   408
(setq visible-bell t) ; With default ring-bell-function in text terminal
a252995f7d6b Move general getting into one place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 335
diff changeset
   409
                      ; revert screen if press [end] or [home]
a252995f7d6b Move general getting into one place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 335
diff changeset
   410
a252995f7d6b Move general getting into one place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 335
diff changeset
   411
;; Prompt before evaluating local bits of lisp.  This stops people
a252995f7d6b Move general getting into one place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 335
diff changeset
   412
;; putting things at the end of files which delete all your files!
a252995f7d6b Move general getting into one place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 335
diff changeset
   413
(setq enable-local-variables t
a252995f7d6b Move general getting into one place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 335
diff changeset
   414
      enable-local-eval      1)
a252995f7d6b Move general getting into one place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 335
diff changeset
   415
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   416
(setq kill-whole-line t)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   417
102
25585e240b4a Move customization from .emacs (custom-set-variables) to .emacs-my. Remove duplication.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 101
diff changeset
   418
(setq view-read-only t)
25585e240b4a Move customization from .emacs (custom-set-variables) to .emacs-my. Remove duplication.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 101
diff changeset
   419
171
2f2aae1d394c Set read-quoted-char-radix.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 169
diff changeset
   420
(setq read-quoted-char-radix 16)
2f2aae1d394c Set read-quoted-char-radix.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 169
diff changeset
   421
622
596406094fd1 Port to Mac OS X console Emacs 22.1.1.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   422
(when (and (>= emacs-major-version 22) (not (eq system-type 'darwin)))
613
1e7314bb84bc Fix loading error for Emacs 21.3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 612
diff changeset
   423
  (setq standard-display-table (make-display-table))
1e7314bb84bc Fix loading error for Emacs 21.3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 612
diff changeset
   424
  (let ( (i ?\x80) hex hi low )
1e7314bb84bc Fix loading error for Emacs 21.3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 612
diff changeset
   425
    (while (<= i ?\xff)
1e7314bb84bc Fix loading error for Emacs 21.3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 612
diff changeset
   426
      (setq hex (format "%x" i))
1e7314bb84bc Fix loading error for Emacs 21.3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 612
diff changeset
   427
      (setq hi (elt hex 0))
1e7314bb84bc Fix loading error for Emacs 21.3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 612
diff changeset
   428
      (setq low (elt hex 1))
1e7314bb84bc Fix loading error for Emacs 21.3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 612
diff changeset
   429
      (aset standard-display-table (unibyte-char-to-multibyte i)
1e7314bb84bc Fix loading error for Emacs 21.3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 612
diff changeset
   430
            (vector (make-glyph-code ?\\ 'escape-glyph)
1e7314bb84bc Fix loading error for Emacs 21.3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 612
diff changeset
   431
                    (make-glyph-code ?x 'escape-glyph)
1e7314bb84bc Fix loading error for Emacs 21.3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 612
diff changeset
   432
                    (make-glyph-code hi 'escape-glyph)
1e7314bb84bc Fix loading error for Emacs 21.3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 612
diff changeset
   433
                    (make-glyph-code low 'escape-glyph)))
1e7314bb84bc Fix loading error for Emacs 21.3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 612
diff changeset
   434
      (setq i (+ i 1))))
1e7314bb84bc Fix loading error for Emacs 21.3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 612
diff changeset
   435
  )
525
c8d4f5368b04 Show non printable characters in hex, not in octal.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 524
diff changeset
   436
863
d48ba6196046 Add sign for euro and hryvnia.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 862
diff changeset
   437
(when (>= emacs-major-version 23)
d48ba6196046 Add sign for euro and hryvnia.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 862
diff changeset
   438
  (define-key global-map "\C-x8g" (lambda nil (interactive) (ucs-insert `,(cdr (assoc-string "HRYVNIA SIGN" (ucs-names) t)))))
d48ba6196046 Add sign for euro and hryvnia.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 862
diff changeset
   439
  (define-key global-map "\C-x8e" (lambda nil (interactive) (ucs-insert `,(cdr (assoc-string "EURO SIGN" (ucs-names) t)))))
d48ba6196046 Add sign for euro and hryvnia.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 862
diff changeset
   440
  )
d48ba6196046 Add sign for euro and hryvnia.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 862
diff changeset
   441
344
b7d0989d9472 generic-define-* before (require 'generic-x) allow load all useful extra modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 342
diff changeset
   442
;; generic-define-* before (require 'generic-x) allow load all useful extra modes.
b7d0989d9472 generic-define-* before (require 'generic-x) allow load all useful extra modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 342
diff changeset
   443
(setq generic-define-mswindows-modes t)
b7d0989d9472 generic-define-* before (require 'generic-x) allow load all useful extra modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 342
diff changeset
   444
(setq generic-define-unix-modes t)
341
84db44766351 Remove bat-file-mode as it present in generic-x.el.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 339
diff changeset
   445
(require 'generic-x)
84db44766351 Remove bat-file-mode as it present in generic-x.el.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 339
diff changeset
   446
345
90b5ae643a6d Move code to proper place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 344
diff changeset
   447
;; The following commands are usually disabled by default. Enable them...
90b5ae643a6d Move code to proper place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 344
diff changeset
   448
(put 'eval-expression  'disabled nil)
90b5ae643a6d Move code to proper place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 344
diff changeset
   449
(put 'downcase-region  'disabled nil)
90b5ae643a6d Move code to proper place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 344
diff changeset
   450
(put 'upcase-region    'disabled nil)
90b5ae643a6d Move code to proper place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 344
diff changeset
   451
(put 'narrow-to-page   'disabled nil)
90b5ae643a6d Move code to proper place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 344
diff changeset
   452
(put 'narrow-to-region 'disabled nil)
90b5ae643a6d Move code to proper place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 344
diff changeset
   453
(put 'scroll-left      'disabled nil)
90b5ae643a6d Move code to proper place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 344
diff changeset
   454
432
650ccece6b01 use-dialog-box set to t.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 431
diff changeset
   455
(setq
650ccece6b01 use-dialog-box set to t.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 431
diff changeset
   456
 use-dialog-box t
650ccece6b01 use-dialog-box set to t.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 431
diff changeset
   457
 x-gtk-show-hidden-files t
650ccece6b01 use-dialog-box set to t.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 431
diff changeset
   458
 )
650ccece6b01 use-dialog-box set to t.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 431
diff changeset
   459
719
694f7e388f2b Add func 'my-prevent-kill-buffer' and prevent kill '*scratch*' buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 718
diff changeset
   460
(defun my-prevent-kill-buffer ()
694f7e388f2b Add func 'my-prevent-kill-buffer' and prevent kill '*scratch*' buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 718
diff changeset
   461
  (if (equal (buffer-name) "*scratch*") nil t))
694f7e388f2b Add func 'my-prevent-kill-buffer' and prevent kill '*scratch*' buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 718
diff changeset
   462
(add-to-list 'kill-buffer-query-functions 'my-prevent-kill-buffer)
694f7e388f2b Add func 'my-prevent-kill-buffer' and prevent kill '*scratch*' buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 718
diff changeset
   463
722
7d43d5ae86fe Use "*scratch*" as temp buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 721
diff changeset
   464
(define-key global-map "\C-ct" (lambda nil (interactive) (switch-to-buffer "*scratch*")))
7d43d5ae86fe Use "*scratch*" as temp buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 721
diff changeset
   465
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   466
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
   467
(message "switching, creating, selecting buffers")
244
5db897a3f1cd buffer-menu better then buffer-list, but ibuffer much better.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 243
diff changeset
   468
34
075552143886 Added iswitchb mode.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 33
diff changeset
   469
(iswitchb-mode 1)
505
eb7d261fa539 Simplify expression.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 498
diff changeset
   470
(setq iswitchb-buffer-ignore
eb7d261fa539 Simplify expression.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 498
diff changeset
   471
      '("^ "
eb7d261fa539 Simplify expression.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 498
diff changeset
   472
        "^\*Buffer"
eb7d261fa539 Simplify expression.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 498
diff changeset
   473
        "^\*Completions\*"
eb7d261fa539 Simplify expression.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 498
diff changeset
   474
        "^\*tramp"
eb7d261fa539 Simplify expression.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 498
diff changeset
   475
        "^\*Dired log\*"
eb7d261fa539 Simplify expression.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 498
diff changeset
   476
        "^\*Quail Completions\*"
eb7d261fa539 Simplify expression.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 498
diff changeset
   477
        "^\*Disabled Command\*"
555
7b2833356d27 Add TAGS file to 'iswitchb-buffer-ignore'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 554
diff changeset
   478
        "^TAGS"
505
eb7d261fa539 Simplify expression.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 498
diff changeset
   479
        ))
34
075552143886 Added iswitchb mode.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 33
diff changeset
   480
35
691635158df5 More pretty buffer switch and naming.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 34
diff changeset
   481
(require 'uniquify)
691635158df5 More pretty buffer switch and naming.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 34
diff changeset
   482
(setq uniquify-buffer-name-style 'post-forward)
685
dccfef291718 Add uniquify settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 684
diff changeset
   483
(setq uniquify-separator "|")
dccfef291718 Add uniquify settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 684
diff changeset
   484
(setq uniquify-after-kill-buffer-p t)
35
691635158df5 More pretty buffer switch and naming.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 34
diff changeset
   485
244
5db897a3f1cd buffer-menu better then buffer-list, but ibuffer much better.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 243
diff changeset
   486
;; buffer-menu better then buffer-list, but ibuffer much better.
5db897a3f1cd buffer-menu better then buffer-list, but ibuffer much better.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 243
diff changeset
   487
(global-set-key "\C-x\C-b" 'ibuffer)
35
691635158df5 More pretty buffer switch and naming.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 34
diff changeset
   488
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   489
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
   490
(message "scrolling")
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   491
339
4e131c57a0ef With scroll-step 3 when go down it scroll one line but if up - 3 so set
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   492
(defvar my-scroll-margin 4)
4e131c57a0ef With scroll-step 3 when go down it scroll one line but if up - 3 so set
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   493
127
0e82eedbaa82 Setup scrolling.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 126
diff changeset
   494
(setq-default
802
6168f8ab6479 Fix scrolling speed as I am use settings that documentation recommend avoid.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 801
diff changeset
   495
 ;; Set to zero as this recomment documentation.
6168f8ab6479 Fix scrolling speed as I am use settings that documentation recommend avoid.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 801
diff changeset
   496
 scroll-step 0
6168f8ab6479 Fix scrolling speed as I am use settings that documentation recommend avoid.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 801
diff changeset
   497
 ;; If the value is greater than 100, redisplay will never recenter point, but
6168f8ab6479 Fix scrolling speed as I am use settings that documentation recommend avoid.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 801
diff changeset
   498
 ;; will always scroll just enough text to bring point into view
6168f8ab6479 Fix scrolling speed as I am use settings that documentation recommend avoid.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 801
diff changeset
   499
 scroll-conservatively 1000
127
0e82eedbaa82 Setup scrolling.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 126
diff changeset
   500
 scroll-preserve-screen-position t
0e82eedbaa82 Setup scrolling.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 126
diff changeset
   501
 )
0e82eedbaa82 Setup scrolling.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 126
diff changeset
   502
333
14b07ca8335a Set margin only for desired modes! Do not frustrate calendar any more.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 332
diff changeset
   503
;; Set margin only for desired modes! Do not frustrate calendar any more.
14b07ca8335a Set margin only for desired modes! Do not frustrate calendar any more.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 332
diff changeset
   504
(make-variable-buffer-local 'scroll-margin)
339
4e131c57a0ef With scroll-step 3 when go down it scroll one line but if up - 3 so set
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   505
(mapc (lambda (hook) (add-hook hook (lambda nil (setq scroll-margin my-scroll-margin))))
372
32b54537dd10 Code ported to work with Emac 21.4. Mainly problems in undefi8ned functions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 371
diff changeset
   506
      ;; TODO its good invoke delete-dups for list, but delete-dups not exist in Emacs 21.4
391
09cfea42153e Added list of mode hooks for enabling scroll margin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 389
diff changeset
   507
      (append my-text-mode-hook-list my-devel-mode-hook-list my-scroll-margin-mode-hook-list) )
333
14b07ca8335a Set margin only for desired modes! Do not frustrate calendar any more.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 332
diff changeset
   508
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   509
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
738
2a81232aa82f Add 'my-print-unicode' which print UNICODE table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 737
diff changeset
   510
(message "chars, unicode")
2a81232aa82f Add 'my-print-unicode' which print UNICODE table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 737
diff changeset
   511
2a81232aa82f Add 'my-print-unicode' which print UNICODE table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 737
diff changeset
   512
(defun my-print-unicode (&optional start end)
2a81232aa82f Add 'my-print-unicode' which print UNICODE table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 737
diff changeset
   513
  "Print UNICODE table."
2a81232aa82f Add 'my-print-unicode' which print UNICODE table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 737
diff changeset
   514
  (interactive "nstart: \nnend: ")
2a81232aa82f Add 'my-print-unicode' which print UNICODE table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 737
diff changeset
   515
  (switch-to-buffer (get-buffer-create "*UNICODE*"))
2a81232aa82f Add 'my-print-unicode' which print UNICODE table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 737
diff changeset
   516
  (erase-buffer)
2a81232aa82f Add 'my-print-unicode' which print UNICODE table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 737
diff changeset
   517
  (let ( (i start) )
2a81232aa82f Add 'my-print-unicode' which print UNICODE table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 737
diff changeset
   518
    (while (<= i end)
2a81232aa82f Add 'my-print-unicode' which print UNICODE table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 737
diff changeset
   519
      (insert (format "%s: U+%04x, %s\n" (char-to-string i) i (get-char-code-property i 'name)))
2a81232aa82f Add 'my-print-unicode' which print UNICODE table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 737
diff changeset
   520
      (setq i (1+ i))
2a81232aa82f Add 'my-print-unicode' which print UNICODE table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 737
diff changeset
   521
      )))
2a81232aa82f Add 'my-print-unicode' which print UNICODE table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 737
diff changeset
   522
2a81232aa82f Add 'my-print-unicode' which print UNICODE table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 737
diff changeset
   523
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
   524
(message "search, isearch, occur")
254
51b47da56551 Highlight on search and repalce.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 253
diff changeset
   525
217
1c42ba3ac4ba Case insensitive search. Group search customization together.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 216
diff changeset
   526
(setq case-fold-search t)
1c42ba3ac4ba Case insensitive search. Group search customization together.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 216
diff changeset
   527
254
51b47da56551 Highlight on search and repalce.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 253
diff changeset
   528
(setq query-replace-highlight t)        ; highlight during query
51b47da56551 Highlight on search and repalce.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 253
diff changeset
   529
(setq search-highlight t)               ; highlight incremental search
51b47da56551 Highlight on search and repalce.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 253
diff changeset
   530
563
6d5387a4e95d Move code to proper place. Add 'f7' key binding for 'occur'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 562
diff changeset
   531
;; Make old Emacs key binding like in Emacs 23.x.
6d5387a4e95d Move code to proper place. Add 'f7' key binding for 'occur'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 562
diff changeset
   532
(when (< emacs-major-version 23)
6d5387a4e95d Move code to proper place. Add 'f7' key binding for 'occur'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 562
diff changeset
   533
  (global-set-key (kbd "M-s o") 'occur)
6d5387a4e95d Move code to proper place. Add 'f7' key binding for 'occur'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 562
diff changeset
   534
  )
6d5387a4e95d Move code to proper place. Add 'f7' key binding for 'occur'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 562
diff changeset
   535
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   536
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
   537
(message "grep, find")
526
9e613d7de6e1 Added exclude pattern to 'grep-find-ignored-directories'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 525
diff changeset
   538
542
22eb7a31b689 Speedup find-dired.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 541
diff changeset
   539
;; -ls produce very noisy output:
22eb7a31b689 Speedup find-dired.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 541
diff changeset
   540
;; (setq find-ls-option '("-ls" . ""))
22eb7a31b689 Speedup find-dired.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 541
diff changeset
   541
;; So I use next expression, which work with GNU find, I replace %s with '0'
22eb7a31b689 Speedup find-dired.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 541
diff changeset
   542
;; to avoid unnecessary sys calls and this make output aligned by column:
22eb7a31b689 Speedup find-dired.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 541
diff changeset
   543
(setq find-ls-option '("-printf ' -rw-rw-rw- 0 %AY-%Am-%Ad %AH:%AM %p\n'" . ""))
22eb7a31b689 Speedup find-dired.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 541
diff changeset
   544
357
84c8c5f03fd4 Correct grep command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 356
diff changeset
   545
;; Do not set t because some grep do not has --color options.
84c8c5f03fd4 Correct grep command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 356
diff changeset
   546
(setq grep-highlight-matches nil)
84c8c5f03fd4 Correct grep command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 356
diff changeset
   547
(setq grep-use-null-device nil)
84c8c5f03fd4 Correct grep command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 356
diff changeset
   548
544
4095ef5f1346 Fix "grep-find-ignored-directories unknow variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 543
diff changeset
   549
(eval-after-load 'grep
556
782325bafc4a Fix 'eval-after-load' usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 555
diff changeset
   550
  '(progn
782325bafc4a Fix 'eval-after-load' usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 555
diff changeset
   551
     (add-to-list 'grep-find-ignored-directories "build" t)
782325bafc4a Fix 'eval-after-load' usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 555
diff changeset
   552
     (add-to-list 'grep-find-ignored-directories "dist" t)
782325bafc4a Fix 'eval-after-load' usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 555
diff changeset
   553
     (add-to-list 'grep-find-ignored-directories "lib" t)
760
5d452486f388 Add _build, _dist, _lib to 'grep-find-ignored-directories'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 759
diff changeset
   554
     (add-to-list 'grep-find-ignored-directories "_build" t)
5d452486f388 Add _build, _dist, _lib to 'grep-find-ignored-directories'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 759
diff changeset
   555
     (add-to-list 'grep-find-ignored-directories "_dist" t)
5d452486f388 Add _build, _dist, _lib to 'grep-find-ignored-directories'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 759
diff changeset
   556
     (add-to-list 'grep-find-ignored-directories "_lib" t)
526
9e613d7de6e1 Added exclude pattern to 'grep-find-ignored-directories'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 525
diff changeset
   557
560
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 557 559
diff changeset
   558
     (when (boundp 'grep-find-ignored-files)
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 557 559
diff changeset
   559
       (add-to-list 'grep-find-ignored-files "*TAGS")
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 557 559
diff changeset
   560
       (add-to-list 'grep-find-ignored-files "GPATH")
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 557 559
diff changeset
   561
       )
556
782325bafc4a Fix 'eval-after-load' usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 555
diff changeset
   562
     ))
768
4af9b5e3ac15 Bind 'F7' to 'rgrep' as 'M-F7' does not possible in terminal.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 767
diff changeset
   563
(global-set-key [f7] 'rgrep)
356
fd1af7a494de Added key binding for rgrep.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 355
diff changeset
   564
(global-set-key [M-f7] 'rgrep)
fd1af7a494de Added key binding for rgrep.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 355
diff changeset
   565
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   566
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
861
f8f14aacfc9b Enable 'global-hi-lock-mode'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 860
diff changeset
   567
(message "highlighting")
296
e502c69ab80a Make header name like tags, separated by comma and ended on period.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 295
diff changeset
   568
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   569
(setq font-lock-maximum-decoration t)
395
c7f6eb04626d Port to Emacs 32.2 (in 'global-font-lock-mode' error - Wrong number of arguments).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 391
diff changeset
   570
(global-font-lock-mode 1)
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   571
861
f8f14aacfc9b Enable 'global-hi-lock-mode'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 860
diff changeset
   572
(global-hi-lock-mode 1)
f8f14aacfc9b Enable 'global-hi-lock-mode'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 860
diff changeset
   573
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   574
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
   575
(message "highlight selected text")
64
54ef0d72488f More pretty with selecting.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   576
776
1e680ded54d1 'transient-mark-mode' and 'pc-selection-mode' are deprecated. Emacs 24 default
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 775
diff changeset
   577
(delete-selection-mode 1)
1e680ded54d1 'transient-mark-mode' and 'pc-selection-mode' are deprecated. Emacs 24 default
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 775
diff changeset
   578
1e680ded54d1 'transient-mark-mode' and 'pc-selection-mode' are deprecated. Emacs 24 default
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 775
diff changeset
   579
(when (<= emacs-major-version 23)
1e680ded54d1 'transient-mark-mode' and 'pc-selection-mode' are deprecated. Emacs 24 default
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 775
diff changeset
   580
  ;; 1/-1, when the mark is active, the region is highlighted.
1e680ded54d1 'transient-mark-mode' and 'pc-selection-mode' are deprecated. Emacs 24 default
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 775
diff changeset
   581
  (transient-mark-mode 1)
80
bfc8c3d03527 Correct code to remove warning in *Messages* when loading .emacs-my.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 79
diff changeset
   582
776
1e680ded54d1 'transient-mark-mode' and 'pc-selection-mode' are deprecated. Emacs 24 default
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 775
diff changeset
   583
  ;; Order of next items is important, (assignment must done before pc-selection-mode enabled).
1e680ded54d1 'transient-mark-mode' and 'pc-selection-mode' are deprecated. Emacs 24 default
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 775
diff changeset
   584
  (require 'pc-select)
1e680ded54d1 'transient-mark-mode' and 'pc-selection-mode' are deprecated. Emacs 24 default
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 775
diff changeset
   585
  (setq pc-select-selection-keys-only t)  ; To avoid some key bindings as F6, etc.
1e680ded54d1 'transient-mark-mode' and 'pc-selection-mode' are deprecated. Emacs 24 default
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 775
diff changeset
   586
  (setq pc-select-meta-moves-sexps t)
1e680ded54d1 'transient-mark-mode' and 'pc-selection-mode' are deprecated. Emacs 24 default
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 775
diff changeset
   587
  (cond
1e680ded54d1 'transient-mark-mode' and 'pc-selection-mode' are deprecated. Emacs 24 default
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 775
diff changeset
   588
   ((= emacs-major-version 21) (pc-selection-mode))
1e680ded54d1 'transient-mark-mode' and 'pc-selection-mode' are deprecated. Emacs 24 default
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 775
diff changeset
   589
   ((>= emacs-major-version 22) (pc-selection-mode 1))
1e680ded54d1 'transient-mark-mode' and 'pc-selection-mode' are deprecated. Emacs 24 default
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 775
diff changeset
   590
   )
1e680ded54d1 'transient-mark-mode' and 'pc-selection-mode' are deprecated. Emacs 24 default
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 775
diff changeset
   591
  )
64
54ef0d72488f More pretty with selecting.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   592
146
506d2883199f kill/yank func also use/update CLIPBOARD selsction on X window.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 145
diff changeset
   593
(when (eq window-system 'x)
296
e502c69ab80a Make header name like tags, separated by comma and ended on period.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 295
diff changeset
   594
  (setq x-select-enable-clipboard t)    ; for Emacs 21.2.1 and newer
146
506d2883199f kill/yank func also use/update CLIPBOARD selsction on X window.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 145
diff changeset
   595
  )
64
54ef0d72488f More pretty with selecting.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   596
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   597
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
   598
(message "highlighting current line")
296
e502c69ab80a Make header name like tags, separated by comma and ended on period.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 295
diff changeset
   599
e502c69ab80a Make header name like tags, separated by comma and ended on period.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 295
diff changeset
   600
(when window-system
e502c69ab80a Make header name like tags, separated by comma and ended on period.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 295
diff changeset
   601
  (custom-set-faces '(hl-line ((t (:inherit highlight :background "light yellow")))))
e502c69ab80a Make header name like tags, separated by comma and ended on period.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 295
diff changeset
   602
  (global-hl-line-mode 1)
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   603
  )
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   604
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   605
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
   606
(message "paren, braces")
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   607
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   608
(show-paren-mode 1) ; Parenthesis matching via highlighting.
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   609
(setq show-paren-style (quote parenthesis))
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   610
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   611
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
   612
(message "keyboard, mouse")
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   613
402
b1a9c8e0c22e As cyrillic-jcuken input metod fixed
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 398
diff changeset
   614
;; cyrillic-jis-russian  for 567 is :,.
b1a9c8e0c22e As cyrillic-jcuken input metod fixed
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 398
diff changeset
   615
;; cyrillic-jcuken  for SHIFT 567 is :,.
b1a9c8e0c22e As cyrillic-jcuken input metod fixed
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 398
diff changeset
   616
;; russian-computer for SHIFT 567 is %^&
404
c8e90a10c941 Set input method to russian-computer by default as in cyrillic-jcuken instead
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 403
diff changeset
   617
(if (>= emacs-major-version 22)
c8e90a10c941 Set input method to russian-computer by default as in cyrillic-jcuken instead
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 403
diff changeset
   618
    (setq default-input-method 'russian-computer)
c8e90a10c941 Set input method to russian-computer by default as in cyrillic-jcuken instead
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 403
diff changeset
   619
  (setq default-input-method 'cyrillic-jcuken))
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   620
;; (pc-bindings-mode) ; Myself define keybinding, see
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   621
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   622
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
   623
(message "completion")
226
14a0e2402d66 partial-completion-mode cause bug in read-file-name with Emacs v22.3.1 (but not with v23.1).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 225
diff changeset
   624
418
dd77820b51c4 I remove partial-completion-mode because it depricated in Emacs 24.0.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 417
diff changeset
   625
;; I remove partial-completion-mode because it depricated in Emacs 24.0.
dd77820b51c4 I remove partial-completion-mode because it depricated in Emacs 24.0.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 417
diff changeset
   626
;; Completion controled by 'completion-styles' variable.
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   627
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   628
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
   629
(message "mouse")
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   630
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   631
;; Scroll Bar gets dragged by mouse butn 1
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   632
(global-set-key [vertical-scroll-bar down-mouse-1] 'scroll-bar-drag)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   633
;; Paste at point NOT at cursor
151
0b6f4adf5096 Minor changes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 150
diff changeset
   634
(setq mouse-yank-at-point t)
439
a1910375f39e mouse-wheel-mode don't defined for Cygwin console Emacs 23.2.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 438
diff changeset
   635
(when window-system
a1910375f39e mouse-wheel-mode don't defined for Cygwin console Emacs 23.2.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 438
diff changeset
   636
  (mouse-wheel-mode 1)
a1910375f39e mouse-wheel-mode don't defined for Cygwin console Emacs 23.2.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 438
diff changeset
   637
  )
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   638
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   639
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
   640
(message "key binding, short-keys")
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   641
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   642
(global-set-key [home]    'beginning-of-line)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   643
(global-set-key [end]     'end-of-line)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   644
(global-set-key [C-home] 'beginning-of-buffer)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   645
(global-set-key [C-end]  'end-of-buffer)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   646
(global-set-key [C-delete]  'kill-word)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   647
(global-set-key [delete]     'delete-char)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   648
;; (global-set-key [backspace]  'backward-delete-char-untabify) ; not work properly in *info* mode
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   649
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   650
;; setting some f[1-12] keys
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   651
(global-set-key [f1]    'help)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   652
(global-set-key [f2]    'save-buffer)
2
98c662ae8707 Incremental search by F3, decr by S-F3 now. Impruved grep-find search.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 1
diff changeset
   653
;; (global-set-key [xxx]    'ediff-buffers)
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   654
(global-set-key [f4]    'ispell-buffer)
134
a071b60e4339 Set key binding to rename buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 125
diff changeset
   655
(global-set-key [S-f6]  'rename-buffer)
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   656
(global-set-key [f8]    'kill-this-buffer)
601
7be9c0c0ffb7 (global-set-key (kbd C-x C-k) 'kill-this-buffer)
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 600
diff changeset
   657
(global-set-key (kbd "C-x C-k") 'kill-this-buffer)
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   658
(global-set-key [M-f4]  'save-buffers-kill-emacs)
18
91626ebef652 Added hotkey for wrap long line.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 17
diff changeset
   659
(global-set-key [f6]    'toggle-truncate-lines)
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   660
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   661
;; frames, windows manipulation, switch buffers
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   662
(global-set-key [?\C-x right] 'next-buffer)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   663
(global-set-key [?\C-x left]  'previous-buffer)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   664
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   665
(global-set-key (kbd "\e\eg") 'goto-line)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   666
(global-set-key (kbd "\e\er") 'query-replace-regexp)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   667
435
a34e8ddc9e12 Disable suspend by C-x C-z. It ugly.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 434
diff changeset
   668
;; Disable suspend. It ugly.
615
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   669
(when window-system
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   670
  (global-set-key (kbd "C-z") nil))
435
a34e8ddc9e12 Disable suspend by C-x C-z. It ugly.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 434
diff changeset
   671
(global-set-key (kbd "C-x C-z") nil)
81
0ce6eaf6f26c Disable C-z, it ugly.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 80
diff changeset
   672
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   673
;; (global-set-key [language-change] 'ignore)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   674
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   675
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
   676
(message "coding system, charset, locale, lang")
80
bfc8c3d03527 Correct code to remove warning in *Messages* when loading .emacs-my.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 79
diff changeset
   677
162
0ac8d1f4304d Emacs 23.1 no longer need codepage-setup.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 157
diff changeset
   678
;; Emacs 23.1 no longer need codepage-setup.
0ac8d1f4304d Emacs 23.1 no longer need codepage-setup.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 157
diff changeset
   679
(when (<= emacs-major-version 22)
0ac8d1f4304d Emacs 23.1 no longer need codepage-setup.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 157
diff changeset
   680
  (codepage-setup 866)
0ac8d1f4304d Emacs 23.1 no longer need codepage-setup.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 157
diff changeset
   681
  (codepage-setup 1251)
0ac8d1f4304d Emacs 23.1 no longer need codepage-setup.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 157
diff changeset
   682
  )
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   683
53
0d8616eedf8b Reformat.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 52
diff changeset
   684
;; Comment because prefer-coding-system will be ignored.
0d8616eedf8b Reformat.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 52
diff changeset
   685
;; (setq-default coding-system-for-read  'cp1251-dos)
0d8616eedf8b Reformat.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 52
diff changeset
   686
;; (setq-default coding-system-for-write 'cp1251-dos)
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   687
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   688
;; (setq locale-coding-system  'cp1251-dos)
583
a9e5bfad6dd5 Add note.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 582
diff changeset
   689
;; (set-language-environment 'UTF-8)
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   690
;; (set-terminal-coding-system 'cp1251)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   691
;; (set-keyboard-coding-system 'cp1251)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   692
4
46543c097be0 Transfer changer from .eamcs_unix, add case for w32 or other system.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 3
diff changeset
   693
(modify-coding-system-alist 'file "\\.el" 'iso-2022-7bit)
192
8b4811c64ec4 Correct copy/paste coding in windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 191
diff changeset
   694
(cond
106
0591d06cf752 Решил проблему copy/paste в X. Решил проблему поиска в UTF-8 буфере.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 102
diff changeset
   695
 ((equal window-system 'w32)          ; also (string-equal system-type "windows-nt")
839
27fac2557f13 Don't set 'selection-coding-system' for Windows. This is no longer needed.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 835
diff changeset
   696
  ;; (set-selection-coding-system 'utf-16-le-dos)
615
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   697
  (setq-default buffer-file-coding-system 'cp1251)
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   698
  (setq default-file-name-coding-system 'cp1251)
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   699
  (setq default-process-coding-system '(cp1251 . cp1251))
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   700
  )
106
0591d06cf752 Решил проблему copy/paste в X. Решил проблему поиска в UTF-8 буфере.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 102
diff changeset
   701
 ((equal window-system 'x)
615
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   702
  (prefer-coding-system 'utf-8-unix)
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   703
  (setq selection-coding-system 'compound-text-with-extensions)
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   704
  (setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   705
  (modify-coding-system-alist 'process ".*" 'utf-8-unix)
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   706
  )
769
5ed69391dc95 Fix coding for Cygwin Emacs when LANG=ru_RU.cp1251.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 768
diff changeset
   707
 ((eq system-type 'cygwin)
5ed69391dc95 Fix coding for Cygwin Emacs when LANG=ru_RU.cp1251.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 768
diff changeset
   708
  (when (string-match "1251\\'" (getenv "LANG"))
5ed69391dc95 Fix coding for Cygwin Emacs when LANG=ru_RU.cp1251.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 768
diff changeset
   709
    (prefer-coding-system 'cp1251-unix)
5ed69391dc95 Fix coding for Cygwin Emacs when LANG=ru_RU.cp1251.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 768
diff changeset
   710
    (prefer-coding-system 'utf-8-unix)
5ed69391dc95 Fix coding for Cygwin Emacs when LANG=ru_RU.cp1251.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 768
diff changeset
   711
    (modify-coding-system-alist 'process ".*" 'cp1251-unix)
5ed69391dc95 Fix coding for Cygwin Emacs when LANG=ru_RU.cp1251.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 768
diff changeset
   712
    )
5ed69391dc95 Fix coding for Cygwin Emacs when LANG=ru_RU.cp1251.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 768
diff changeset
   713
  )
622
596406094fd1 Port to Mac OS X console Emacs 22.1.1.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   714
 ((eq system-type 'darwin)
623
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 621 622
diff changeset
   715
  nil
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 621 622
diff changeset
   716
  )
615
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   717
 )
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   718
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   719
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
598
9399292dae57 Enable 'ffap' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 597
diff changeset
   720
(message "open file, ffap, dired")
9399292dae57 Enable 'ffap' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 597
diff changeset
   721
460
9bd638f8f74c Use saveplace mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 459
diff changeset
   722
(setq-default save-place t)
9bd638f8f74c Use saveplace mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 459
diff changeset
   723
(require 'saveplace)
9bd638f8f74c Use saveplace mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 459
diff changeset
   724
598
9399292dae57 Enable 'ffap' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 597
diff changeset
   725
(require 'dired)
241
78cbd4c692ee Added dired settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 240
diff changeset
   726
598
9399292dae57 Enable 'ffap' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 597
diff changeset
   727
(require 'ffap)
9399292dae57 Enable 'ffap' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 597
diff changeset
   728
(ffap-bindings)
455
434f14adcd26 Added key binding for reuse existent dired buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 454
diff changeset
   729
457
188efe1c6f59 Move setting to proper place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 456
diff changeset
   730
;; I usually mistype "C-x C-f" to "C-x d" or "C-x C-d", so always use find-file,
188efe1c6f59 Move setting to proper place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 456
diff changeset
   731
;; because when file if directory find-file load dired, if regular file open it.
598
9399292dae57 Enable 'ffap' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 597
diff changeset
   732
(global-set-key (kbd "C-x C-f") 'find-file-at-point)
9399292dae57 Enable 'ffap' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 597
diff changeset
   733
(global-set-key (kbd "C-x C-d") 'find-file-at-point)
9399292dae57 Enable 'ffap' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 597
diff changeset
   734
(global-set-key (kbd "C-x d") 'find-file-at-point)
457
188efe1c6f59 Move setting to proper place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 456
diff changeset
   735
607
deef9ab0fb58 Stop 'ffap' in Dired as its suggestion is inconvenient.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 606
diff changeset
   736
;; Stop 'ffap' in Dired as its suggestion is inconvenient.
deef9ab0fb58 Stop 'ffap' in Dired as its suggestion is inconvenient.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 606
diff changeset
   737
(define-key dired-mode-map (kbd "C-x C-f") 'find-file)
deef9ab0fb58 Stop 'ffap' in Dired as its suggestion is inconvenient.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 606
diff changeset
   738
(define-key dired-mode-map (kbd "C-x C-d") 'find-file)
deef9ab0fb58 Stop 'ffap' in Dired as its suggestion is inconvenient.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 606
diff changeset
   739
(define-key dired-mode-map (kbd "C-x d") 'find-file)
deef9ab0fb58 Stop 'ffap' in Dired as its suggestion is inconvenient.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 606
diff changeset
   740
241
78cbd4c692ee Added dired settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 240
diff changeset
   741
(setq dired-dwim-target t)
78cbd4c692ee Added dired settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 240
diff changeset
   742
;; dangerous
78cbd4c692ee Added dired settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 240
diff changeset
   743
;; (setq
78cbd4c692ee Added dired settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 240
diff changeset
   744
;;  dired-recursive-copies 'top
78cbd4c692ee Added dired settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 240
diff changeset
   745
;;  dired-recursive-deletes 'top)
78cbd4c692ee Added dired settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 240
diff changeset
   746
463
adc3abb3c1fc Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 462
diff changeset
   747
(defun my-dired-up-dir ()
adc3abb3c1fc Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 462
diff changeset
   748
  "'Reuse' buffer if enter to dir or open new buffer if enter to file."
adc3abb3c1fc Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 462
diff changeset
   749
  (interactive)
471
1d59b8a9d8a0 Fix bug: under Linux you can not go upper for '/dir' like dir (that lie
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 470
diff changeset
   750
  ;; (dired-current-directory) always end with trailing '/' char.
1d59b8a9d8a0 Fix bug: under Linux you can not go upper for '/dir' like dir (that lie
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 470
diff changeset
   751
  (let* ( (dir (dired-current-directory)) (i (- (length dir) 2)) upperdir )
463
adc3abb3c1fc Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 462
diff changeset
   752
    (while (and
adc3abb3c1fc Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 462
diff changeset
   753
            (>= i 0)
adc3abb3c1fc Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 462
diff changeset
   754
            (not (equal (aref dir i) ?/)) )
adc3abb3c1fc Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 462
diff changeset
   755
      (setq i (- i 1))
adc3abb3c1fc Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 462
diff changeset
   756
      )
471
1d59b8a9d8a0 Fix bug: under Linux you can not go upper for '/dir' like dir (that lie
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 470
diff changeset
   757
    (setq upperdir (substring dir 0 (+ i 1)))
1d59b8a9d8a0 Fix bug: under Linux you can not go upper for '/dir' like dir (that lie
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 470
diff changeset
   758
    (when (file-directory-p upperdir)
1d59b8a9d8a0 Fix bug: under Linux you can not go upper for '/dir' like dir (that lie
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 470
diff changeset
   759
      (find-alternate-file upperdir)
463
adc3abb3c1fc Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 462
diff changeset
   760
      (dired-goto-file dir)
adc3abb3c1fc Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 462
diff changeset
   761
      )
adc3abb3c1fc Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 462
diff changeset
   762
    ))
adc3abb3c1fc Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 462
diff changeset
   763
(define-key dired-mode-map (kbd "<backspace>") 'my-dired-up-dir)
adc3abb3c1fc Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 462
diff changeset
   764
adc3abb3c1fc Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 462
diff changeset
   765
(defun my-dired-enter-to-dir ()
adc3abb3c1fc Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 462
diff changeset
   766
  "'Reuse' buffer if enter to dir or open new buffer if enter to file."
adc3abb3c1fc Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 462
diff changeset
   767
  (interactive)
adc3abb3c1fc Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 462
diff changeset
   768
  (let ( (file (dired-get-file-for-visit)) )
adc3abb3c1fc Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 462
diff changeset
   769
    (if (file-directory-p file)
adc3abb3c1fc Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 462
diff changeset
   770
        (find-alternate-file file)
adc3abb3c1fc Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 462
diff changeset
   771
      (find-file file)
adc3abb3c1fc Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 462
diff changeset
   772
      )))
adc3abb3c1fc Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 462
diff changeset
   773
(define-key dired-mode-map (kbd "<return>")
adc3abb3c1fc Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 462
diff changeset
   774
  'my-dired-enter-to-dir)
adc3abb3c1fc Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 462
diff changeset
   775
697
d19881accc91 Make behaviour same as in GUI for dired.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 695
diff changeset
   776
;; Make behaviour same as in GUI.
d19881accc91 Make behaviour same as in GUI for dired.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 695
diff changeset
   777
(unless window-system
d19881accc91 Make behaviour same as in GUI for dired.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 695
diff changeset
   778
  (define-key dired-mode-map (kbd "DEL") 'my-dired-up-dir)
d19881accc91 Make behaviour same as in GUI for dired.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 695
diff changeset
   779
  (define-key dired-mode-map (kbd "RET") 'my-dired-enter-to-dir)
d19881accc91 Make behaviour same as in GUI for dired.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 695
diff changeset
   780
  )
d19881accc91 Make behaviour same as in GUI for dired.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 695
diff changeset
   781
455
434f14adcd26 Added key binding for reuse existent dired buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 454
diff changeset
   782
(when (>= emacs-major-version 22)
434f14adcd26 Added key binding for reuse existent dired buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 454
diff changeset
   783
  ;; Enable 'a' command.
434f14adcd26 Added key binding for reuse existent dired buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 454
diff changeset
   784
  (put 'dired-find-alternate-file 'disabled nil)
434f14adcd26 Added key binding for reuse existent dired buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 454
diff changeset
   785
  )
326
ded53e19d23a Enable 'a' command in dired.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 303
diff changeset
   786
469
a9adec4fbcbf Mark temporary files in dired by '`'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 468
diff changeset
   787
(defun my-file-name-tmp-p (file)
667
32cbaa8f4368 Add .base .local .other to list of tmp files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 666
diff changeset
   788
  (string-match
32cbaa8f4368 Add .base .local .other to list of tmp files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 666
diff changeset
   789
   `,(concat
32cbaa8f4368 Add .base .local .other to list of tmp files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 666
diff changeset
   790
    "\\(?:^#.*#\\|~\\|^.?\\.diff\\|"
32cbaa8f4368 Add .base .local .other to list of tmp files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 666
diff changeset
   791
    "\\." (regexp-opt '("base" "local" "orig" "other" "log" "stackdump" "rej"))
32cbaa8f4368 Add .base .local .other to list of tmp files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 666
diff changeset
   792
    "\\)\\'")
32cbaa8f4368 Add .base .local .other to list of tmp files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 666
diff changeset
   793
   (file-name-nondirectory file)))
469
a9adec4fbcbf Mark temporary files in dired by '`'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 468
diff changeset
   794
a9adec4fbcbf Mark temporary files in dired by '`'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 468
diff changeset
   795
(defun my-dired-flag-tmp-files ()
a9adec4fbcbf Mark temporary files in dired by '`'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 468
diff changeset
   796
  "Flag all temporary files for deletion."
a9adec4fbcbf Mark temporary files in dired by '`'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 468
diff changeset
   797
  (interactive)
a9adec4fbcbf Mark temporary files in dired by '`'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 468
diff changeset
   798
  (dired-mark-if
a9adec4fbcbf Mark temporary files in dired by '`'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 468
diff changeset
   799
   (let ( (fn (dired-get-filename 'verbatim t)) )
a9adec4fbcbf Mark temporary files in dired by '`'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 468
diff changeset
   800
     (and fn (my-file-name-tmp-p fn)) )
a9adec4fbcbf Mark temporary files in dired by '`'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 468
diff changeset
   801
   "backup file"
a9adec4fbcbf Mark temporary files in dired by '`'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 468
diff changeset
   802
   )
a9adec4fbcbf Mark temporary files in dired by '`'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 468
diff changeset
   803
  )
a9adec4fbcbf Mark temporary files in dired by '`'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 468
diff changeset
   804
a9adec4fbcbf Mark temporary files in dired by '`'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 468
diff changeset
   805
(define-key dired-mode-map (kbd "`") 'my-dired-flag-tmp-files)
a9adec4fbcbf Mark temporary files in dired by '`'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 468
diff changeset
   806
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   807
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
   808
(message "ls-lisp, dired ls")
464
ae073d35f674 Always use 'ls-lisp' to emulate 'ls'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 463
diff changeset
   809
ae073d35f674 Always use 'ls-lisp' to emulate 'ls'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 463
diff changeset
   810
;; If non-nil - use 'insert-directory-program', which I dislike.
ae073d35f674 Always use 'ls-lisp' to emulate 'ls'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 463
diff changeset
   811
(setq ls-lisp-use-insert-directory-program nil)
ae073d35f674 Always use 'ls-lisp' to emulate 'ls'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 463
diff changeset
   812
(setq ls-lisp-ignore-case t)
ae073d35f674 Always use 'ls-lisp' to emulate 'ls'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 463
diff changeset
   813
(setq ls-lisp-dirs-first t)
519
bdc19bd3820f Ignore owners and groups under Cygwin (mostly because
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 517
diff changeset
   814
(if (memq system-type '(windows-nt cygwin))
464
ae073d35f674 Always use 'ls-lisp' to emulate 'ls'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 463
diff changeset
   815
    (setq ls-lisp-verbosity nil)
ae073d35f674 Always use 'ls-lisp' to emulate 'ls'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 463
diff changeset
   816
  (setq  ls-lisp-verbosity '(links uid gid)))
ae073d35f674 Always use 'ls-lisp' to emulate 'ls'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 463
diff changeset
   817
;; Force use 'ls-lisp-format-time-list'.
ae073d35f674 Always use 'ls-lisp' to emulate 'ls'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 463
diff changeset
   818
(setq ls-lisp-use-localized-time-format t)
ae073d35f674 Always use 'ls-lisp' to emulate 'ls'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 463
diff changeset
   819
(setq ls-lisp-format-time-list
474
d1a3f9322927 Show seconds for file modification time in dired.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 473
diff changeset
   820
      '("%Y-%m-%d %H:%M:%S"
d1a3f9322927 Show seconds for file modification time in dired.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 473
diff changeset
   821
        "%Y-%m-%d %H:%M   "))
475
bb2bc4c0192a Emacs must load ls-lisp to enable it under Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 474
diff changeset
   822
(require 'ls-lisp)
464
ae073d35f674 Always use 'ls-lisp' to emulate 'ls'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 463
diff changeset
   823
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   824
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
   825
(message "compression, archive")
240
77b01720a256 Enable image if supported.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 239
diff changeset
   826
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   827
(require 'jka-compr) ; Automatic decompression, hooks for tar-mode.
615
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   828
(when (fboundp 'auto-compression-mode)
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   829
  (auto-compression-mode 1))
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   830
296
e502c69ab80a Make header name like tags, separated by comma and ended on period.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 295
diff changeset
   831
(modify-coding-system-alist 'file "\\.\\(war\\|ear\\|sar\\|egg\\)\\'" 'no-conversion)
e502c69ab80a Make header name like tags, separated by comma and ended on period.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 295
diff changeset
   832
e502c69ab80a Make header name like tags, separated by comma and ended on period.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 295
diff changeset
   833
(add-to-list 'auto-mode-alist '("\\.\\(war\\|ear\\|sar\\|egg\\)\\'" . archive-mode))
e502c69ab80a Make header name like tags, separated by comma and ended on period.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 295
diff changeset
   834
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   835
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
619
d5b22e5edae1 Exclude .svg image from supported image list, as Emacs doesn't come with SVG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 618
diff changeset
   836
(message "image, png, svg")
240
77b01720a256 Enable image if supported.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 239
diff changeset
   837
77b01720a256 Enable image if supported.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 239
diff changeset
   838
(when (fboundp 'auto-image-file-mode)
77b01720a256 Enable image if supported.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 239
diff changeset
   839
  (auto-image-file-mode 1))
619
d5b22e5edae1 Exclude .svg image from supported image list, as Emacs doesn't come with SVG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 618
diff changeset
   840
(eval-after-load 'image-file
d5b22e5edae1 Exclude .svg image from supported image list, as Emacs doesn't come with SVG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 618
diff changeset
   841
  '(progn
d5b22e5edae1 Exclude .svg image from supported image list, as Emacs doesn't come with SVG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 618
diff changeset
   842
     ;; Exclude .svg image from supported image list, as Emacs doesn't come
d5b22e5edae1 Exclude .svg image from supported image list, as Emacs doesn't come with SVG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 618
diff changeset
   843
     ;; with SVG shared library.
d5b22e5edae1 Exclude .svg image from supported image list, as Emacs doesn't come with SVG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 618
diff changeset
   844
     (setq image-file-name-extensions (remove "svg" image-file-name-extensions))
655
9639cfe1e0b2 simplify
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 652
diff changeset
   845
     ;; Re-initialize the image-file handler.
9639cfe1e0b2 simplify
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 652
diff changeset
   846
     (auto-image-file-mode t)
619
d5b22e5edae1 Exclude .svg image from supported image list, as Emacs doesn't come with SVG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 618
diff changeset
   847
     ))
240
77b01720a256 Enable image if supported.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 239
diff changeset
   848
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   849
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
   850
(message "minibuffer")
153
a03216c9fa8c Delete dust. Correct 'completion-ignored-extensions' list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   851
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   852
(require 'icomplete) ; Interactive completion in minibuffer.
153
a03216c9fa8c Delete dust. Correct 'completion-ignored-extensions' list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   853
(icomplete-mode 1)
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   854
228
f55559c1ce8e Do not redefine completion-ignored-extensions, instead append new values.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 227
diff changeset
   855
(mapc (lambda (ext) (add-to-list 'completion-ignored-extensions ext))
f55559c1ce8e Do not redefine completion-ignored-extensions, instead append new values.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 227
diff changeset
   856
      '(
f55559c1ce8e Do not redefine completion-ignored-extensions, instead append new values.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 227
diff changeset
   857
        ".class" "~" ".aux"
f55559c1ce8e Do not redefine completion-ignored-extensions, instead append new values.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 227
diff changeset
   858
        ".o" ".obj" ".map" ".lib" ".lo" ".la" ".a" ".bin" ".exe"
f55559c1ce8e Do not redefine completion-ignored-extensions, instead append new values.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 227
diff changeset
   859
        ;; Place dir at end to appear at the start of completion-ignored-extensions.
f55559c1ce8e Do not redefine completion-ignored-extensions, instead append new values.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 227
diff changeset
   860
        "CVS/" ".hg/" ".svn/" ".git/" ".bzr/"
f55559c1ce8e Do not redefine completion-ignored-extensions, instead append new values.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 227
diff changeset
   861
        ) )
609
f397a4d2a697 (setq read-file-name-completion-ignore-case t)
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 608
diff changeset
   862
(setq read-file-name-completion-ignore-case t)
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   863
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   864
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
716
a3f42d9dd281 my-percent-decode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 715
diff changeset
   865
(message "url")
a3f42d9dd281 my-percent-decode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 715
diff changeset
   866
a3f42d9dd281 my-percent-decode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 715
diff changeset
   867
;; http://tools.ietf.org/html/rfc3986
a3f42d9dd281 my-percent-decode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 715
diff changeset
   868
;; http://en.wikipedia.org/wiki/Percent-encoding
a3f42d9dd281 my-percent-decode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 715
diff changeset
   869
(defun my-percent-decode (str)
a3f42d9dd281 my-percent-decode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 715
diff changeset
   870
  (decode-coding-string
a3f42d9dd281 my-percent-decode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 715
diff changeset
   871
   (let* ( (s (split-string str "%")) )
a3f42d9dd281 my-percent-decode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 715
diff changeset
   872
     (my-fold
a3f42d9dd281 my-percent-decode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 715
diff changeset
   873
      'concat
a3f42d9dd281 my-percent-decode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 715
diff changeset
   874
      (car s)
a3f42d9dd281 my-percent-decode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 715
diff changeset
   875
      (mapcar
a3f42d9dd281 my-percent-decode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 715
diff changeset
   876
       (lambda (x)
a3f42d9dd281 my-percent-decode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 715
diff changeset
   877
         (concat (unibyte-string (string-to-number (substring x 0 2) 16)) (substring x 2)))
a3f42d9dd281 my-percent-decode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 715
diff changeset
   878
       (cdr s))
a3f42d9dd281 my-percent-decode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 715
diff changeset
   879
      )) 'utf-8))
a3f42d9dd281 my-percent-decode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 715
diff changeset
   880
717
b958f182d0d4 Convert percent encoded string to native.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 716
diff changeset
   881
(defun my-percent-decode-region (arg beg end)
b958f182d0d4 Convert percent encoded string to native.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 716
diff changeset
   882
  "Convert percent encoded string to native."
b958f182d0d4 Convert percent encoded string to native.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 716
diff changeset
   883
  (interactive "P\nr")
b958f182d0d4 Convert percent encoded string to native.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 716
diff changeset
   884
  (let ( (result (my-percent-decode (buffer-substring-no-properties beg end))) )
b958f182d0d4 Convert percent encoded string to native.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 716
diff changeset
   885
    (if (not arg)
b958f182d0d4 Convert percent encoded string to native.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 716
diff changeset
   886
        (message result)
b958f182d0d4 Convert percent encoded string to native.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 716
diff changeset
   887
      (delete-region beg end)
b958f182d0d4 Convert percent encoded string to native.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 716
diff changeset
   888
      (insert result))
b958f182d0d4 Convert percent encoded string to native.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 716
diff changeset
   889
    ) )
b958f182d0d4 Convert percent encoded string to native.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 716
diff changeset
   890
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   891
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
   892
(message "browser")
98
5223817dad90 Use mozilla browser. Not tested for Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 97
diff changeset
   893
138
90fda97adcb1 Setup browse-url func for linux and windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 120
diff changeset
   894
(cond
90fda97adcb1 Setup browse-url func for linux and windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 120
diff changeset
   895
 ((equal window-system 'w32)
90fda97adcb1 Setup browse-url func for linux and windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 120
diff changeset
   896
  (setq browse-url-browser-function 'browse-url-default-windows-browser))
476
4d3b20be2562 Use Firefox to open URLs under Debian Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 475
diff changeset
   897
 ((boundp 'debian-emacs-flavor)
4d3b20be2562 Use Firefox to open URLs under Debian Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 475
diff changeset
   898
  (setq browse-url-browser-function 'browse-url-firefox))
138
90fda97adcb1 Setup browse-url func for linux and windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 120
diff changeset
   899
 (t
90fda97adcb1 Setup browse-url func for linux and windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 120
diff changeset
   900
  (setq browse-url-browser-function 'browse-url-mozilla)))
98
5223817dad90 Use mozilla browser. Not tested for Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 97
diff changeset
   901
677
154f402aa2dc my-cygwin-search
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 676
diff changeset
   902
(defun my-cygwin-search (str)
154f402aa2dc my-cygwin-search
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 676
diff changeset
   903
  "Search for Cygwin package on-line."
154f402aa2dc my-cygwin-search
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 676
diff changeset
   904
  (interactive (list (read-input "Search for Cygwin package on-line: ")))
154f402aa2dc my-cygwin-search
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 676
diff changeset
   905
  (browse-url (format "http://cygwin.com/cgi-bin2/package-grep.cgi?grep=%s" str))
154f402aa2dc my-cygwin-search
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 676
diff changeset
   906
  )
154f402aa2dc my-cygwin-search
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 676
diff changeset
   907
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   908
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
   909
(message "calendar")
296
e502c69ab80a Make header name like tags, separated by comma and ended on period.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 295
diff changeset
   910
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   911
;; (setq mark-holidays-in-calendar t)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   912
;; (setq all-christian-calendar-holidays t)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   913
;; (setq calendar-date-display-form (quote ((format "%04s-%02d-%02d" year (string-to-int month) (string-to-int day)))))
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   914
;; (setq calendar-time-display-form (quote (24-hours ":" minutes (if time-zone " (") time-zone (if time-zone ")"))))
49
71cec5d9c60f Set week start with Monday.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 48
diff changeset
   915
(setq calendar-week-start-day 1)
71cec5d9c60f Set week start with Monday.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 48
diff changeset
   916
(setq european-calendar-style t)
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   917
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   918
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
   919
(message "standard hooks")
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   920
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   921
(add-hook 'write-file-hooks 'time-stamp)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   922
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   923
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
735
337d64d4f27b Enable auto-revert-tail-mode for log files from /var/log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 734
diff changeset
   924
(message "logging, logs")
337d64d4f27b Enable auto-revert-tail-mode for log files from /var/log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 734
diff changeset
   925
337d64d4f27b Enable auto-revert-tail-mode for log files from /var/log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 734
diff changeset
   926
(defun my-auto-revert-tail-mode-hook ()
759
41ed90c3b3a3 Enable 'auto-revert-tail-mode' on '.log' files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 758
diff changeset
   927
  (when (string-match "/var/log/\\|\\.log\\'"
735
337d64d4f27b Enable auto-revert-tail-mode for log files from /var/log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 734
diff changeset
   928
                      (buffer-file-name (current-buffer)))
337d64d4f27b Enable auto-revert-tail-mode for log files from /var/log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 734
diff changeset
   929
    (auto-revert-tail-mode 1)
337d64d4f27b Enable auto-revert-tail-mode for log files from /var/log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 734
diff changeset
   930
    ))
337d64d4f27b Enable auto-revert-tail-mode for log files from /var/log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 734
diff changeset
   931
(add-hook 'find-file-hook 'my-auto-revert-tail-mode-hook)
337d64d4f27b Enable auto-revert-tail-mode for log files from /var/log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 734
diff changeset
   932
337d64d4f27b Enable auto-revert-tail-mode for log files from /var/log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 734
diff changeset
   933
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
   934
(message "auto-fill")
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   935
102
25585e240b4a Move customization from .emacs (custom-set-variables) to .emacs-my. Remove duplication.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 101
diff changeset
   936
(setq-default fill-column 78)
25585e240b4a Move customization from .emacs (custom-set-variables) to .emacs-my. Remove duplication.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 101
diff changeset
   937
335
748c6e05fe87 Use common value for fill-column.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 334
diff changeset
   938
(defvar my-fill-column 100
748c6e05fe87 Use common value for fill-column.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 334
diff changeset
   939
  "I use greater value then 78 for comment in prog source.")
748c6e05fe87 Use common value for fill-column.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 334
diff changeset
   940
148
7df64d2c9f3d Remove unused key binding. Added more docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 147
diff changeset
   941
;; By default used American convention - sentence and with two spaces. Change
7df64d2c9f3d Remove unused key binding. Added more docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 147
diff changeset
   942
;; it to one space. Has affect on filling and M-a, M-e commands.
102
25585e240b4a Move customization from .emacs (custom-set-variables) to .emacs-my. Remove duplication.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 101
diff changeset
   943
(setq sentence-end-double-space nil)
25585e240b4a Move customization from .emacs (custom-set-variables) to .emacs-my. Remove duplication.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 101
diff changeset
   944
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   945
;; Turn on auto-fill mode
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   946
(add-hook 'html-mode-hook 'turn-on-auto-fill)
102
25585e240b4a Move customization from .emacs (custom-set-variables) to .emacs-my. Remove duplication.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 101
diff changeset
   947
(add-hook 'text-mode-hook 'turn-on-auto-fill)
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   948
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   949
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
   950
(message "cacl, calculator")
367
58e70956523a Set cacl digit grouping.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 366
diff changeset
   951
58e70956523a Set cacl digit grouping.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 366
diff changeset
   952
(setq-default calc-group-digits t)
58e70956523a Set cacl digit grouping.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 366
diff changeset
   953
(setq-default calc-group-char "'")
58e70956523a Set cacl digit grouping.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 366
diff changeset
   954
517
6889ad2dbd35 Add 'my-calc-eval-region' func.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 516
diff changeset
   955
(defun my-calc-eval-region (arg beg end)
6889ad2dbd35 Add 'my-calc-eval-region' func.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 516
diff changeset
   956
  "Calculate the region and display the result in the echo area.
6889ad2dbd35 Add 'my-calc-eval-region' func.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 516
diff changeset
   957
With prefix ARG non-nil, insert the result at the end of region."
6889ad2dbd35 Add 'my-calc-eval-region' func.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 516
diff changeset
   958
  (interactive "P\nr")
6889ad2dbd35 Add 'my-calc-eval-region' func.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 516
diff changeset
   959
  (require 'calc)
6889ad2dbd35 Add 'my-calc-eval-region' func.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 516
diff changeset
   960
  (let* ((expr (buffer-substring-no-properties beg end))
6889ad2dbd35 Add 'my-calc-eval-region' func.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 516
diff changeset
   961
         (result (calc-eval expr)))
6889ad2dbd35 Add 'my-calc-eval-region' func.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 516
diff changeset
   962
    (if (null arg)
6889ad2dbd35 Add 'my-calc-eval-region' func.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 516
diff changeset
   963
        (message "%s = %s" expr result)
6889ad2dbd35 Add 'my-calc-eval-region' func.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 516
diff changeset
   964
      (goto-char end)
6889ad2dbd35 Add 'my-calc-eval-region' func.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 516
diff changeset
   965
      (save-excursion
6889ad2dbd35 Add 'my-calc-eval-region' func.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 516
diff changeset
   966
        (insert result)))))
6889ad2dbd35 Add 'my-calc-eval-region' func.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 516
diff changeset
   967
665
9761254a1260 Maintaining the table of contents up-to-date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 664
diff changeset
   968
;; ----------------------------------------------------------------
666
994de1974616 fix misspelling
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 665
diff changeset
   969
(message "rst, reStructuredText")
665
9761254a1260 Maintaining the table of contents up-to-date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 664
diff changeset
   970
9761254a1260 Maintaining the table of contents up-to-date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 664
diff changeset
   971
;; Maintaining the table of contents up-to-date.
9761254a1260 Maintaining the table of contents up-to-date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 664
diff changeset
   972
(add-hook 'rst-adjust-hook 'rst-toc-update)
9761254a1260 Maintaining the table of contents up-to-date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 664
diff changeset
   973
689
1b632e2151cc Fix rst-level-*-face for terminal.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 688
diff changeset
   974
(unless window-system
1b632e2151cc Fix rst-level-*-face for terminal.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 688
diff changeset
   975
  (eval-after-load 'rst
1b632e2151cc Fix rst-level-*-face for terminal.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 688
diff changeset
   976
    '(progn
1b632e2151cc Fix rst-level-*-face for terminal.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 688
diff changeset
   977
       (custom-set-faces
1b632e2151cc Fix rst-level-*-face for terminal.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 688
diff changeset
   978
        '(rst-level-1-face ((t (:background "yellow"))) t)
1b632e2151cc Fix rst-level-*-face for terminal.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 688
diff changeset
   979
        '(rst-level-2-face ((t (:background "yellow"))) t)
1b632e2151cc Fix rst-level-*-face for terminal.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 688
diff changeset
   980
        '(rst-level-3-face ((t (:background "yellow"))) t)
1b632e2151cc Fix rst-level-*-face for terminal.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 688
diff changeset
   981
        '(rst-level-4-face ((t (:background "yellow"))) t)
1b632e2151cc Fix rst-level-*-face for terminal.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 688
diff changeset
   982
        '(rst-level-5-face ((t (:background "yellow"))) t)
1b632e2151cc Fix rst-level-*-face for terminal.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 688
diff changeset
   983
        '(rst-level-6face ((t (:background "yellow"))) t)
1b632e2151cc Fix rst-level-*-face for terminal.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 688
diff changeset
   984
        ) ) ) )
1b632e2151cc Fix rst-level-*-face for terminal.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 688
diff changeset
   985
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   986
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
   987
(message "TeX, LaTeX")
296
e502c69ab80a Make header name like tags, separated by comma and ended on period.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 295
diff changeset
   988
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   989
(setq tex-run-command "initex")
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   990
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
   991
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
   992
(message "AUC TeX")
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   993
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   994
;(add-hook 'LaTeX-mode-hook 'LaTeX-install-toolbar)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   995
;; (setq TeX-parse-self t)             ; Enable parse on load.
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
   996
;; (setq TeX-auto-save t)              ; Enable parse on save.
347
ae8ed6d33e90 Dont prompt for master file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 346
diff changeset
   997
;; Query for master file. If you often use \include or \input, you should make AUCTEX aware of the
ae8ed6d33e90 Dont prompt for master file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 346
diff changeset
   998
;; multi-file document structure.
ae8ed6d33e90 Dont prompt for master file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 346
diff changeset
   999
(setq-default TeX-master nil)
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1000
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1001
;(setq TeX-PDF-mode t)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1002
;(setq TeX-interactive-mode t)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1003
;(setq TeX-source-specials-mode 1)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1004
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1005
;;; some more menu entries in the command list:
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1006
;;; see tex-mik.el from package auctex: %v is defined in tex-mik.el
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1007
;;; other variables are defined in tex.el from auctex
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1008
;;; the meaning of some auctex-varibles:
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1009
        ;symbols defined in tex.el and tex-mik.el:
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1010
        ;%b name slave tex-file  %t name master tex-file
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1011
        ;%d dvi-file  %f ps-file
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1012
        ;%l "latex --src-specials"
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1013
        ;%n line number  %p printcommand  %q "lpq"
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1014
        ;%r (TeX-style-check TeX-print-style)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1015
        ;%s master-file-name without extention
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1016
        ;%v yap command view line
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1017
;(eval-after-load "tex"
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1018
;  '(progn
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1019
;     (add-to-list 'TeX-command-list
9
96e0cbcd92ab Untabify.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 8
diff changeset
  1020
;         (list "->PS landscape for pdf"
96e0cbcd92ab Untabify.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 8
diff changeset
  1021
;           "dvips %d -N0 -Ppdf -G0 -T 297mm,210mm -o %f "
96e0cbcd92ab Untabify.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 8
diff changeset
  1022
;           'TeX-run-command nil t))
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1023
;     (add-to-list 'TeX-command-list
9
96e0cbcd92ab Untabify.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 8
diff changeset
  1024
;         (list "All Texify run-viewer"
96e0cbcd92ab Untabify.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 8
diff changeset
  1025
;           "texify --tex-opt=--src --run-viewer --clean %s.tex"
96e0cbcd92ab Untabify.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 8
diff changeset
  1026
;           'TeX-run-command nil t))))
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1027
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1028
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  1029
(message "reftex")
461
1639d2540bbd Set outline-minor for file. Fix section to feet header outline pattern.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 460
diff changeset
  1030
1639d2540bbd Set outline-minor for file. Fix section to feet header outline pattern.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 460
diff changeset
  1031
;; Reftex is included with Emacs 21.1.
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1032
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1033
;; (autoload 'reftex-mode     "reftex" "RefTeX Minor Mode" t)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1034
;; (autoload 'turn-on-reftex  "reftex" "RefTeX Minor Mode" nil)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1035
;; (autoload 'reftex-citation "reftex-cite" "Make citation" nil)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1036
;; (autoload 'reftex-index-phrase-mode "reftex-index" "Phrase mode" t)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1037
;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex)   ; with AUCTeX LaTeX mode
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1038
;; (add-hook 'latex-mode-hook 'turn-on-reftex)   ; with Emacs latex mode
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1039
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1040
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  1041
(message "PreviewLatex")
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1042
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1043
;(load "preview-latex.el" nil t t)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1044
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1045
;(add-hook 'LaTeX-mode-hook #'LaTeX-preview-setup)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1046
;(autoload 'LaTeX-preview-setup "preview")
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1047
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1048
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  1049
(message "Info")
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1050
323
7a7dc2befa99 Because of Debian policy documentation covered by FDL license with invariant sections not allowed in packet
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 322
diff changeset
  1051
(unless (getenv "INFOPATH")
7a7dc2befa99 Because of Debian policy documentation covered by FDL license with invariant sections not allowed in packet
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 322
diff changeset
  1052
  (setenv "INFOPATH" "~/usr/share/info:"))
7a7dc2befa99 Because of Debian policy documentation covered by FDL license with invariant sections not allowed in packet
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 322
diff changeset
  1053
799
c39f6e6fd191 Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 798
diff changeset
  1054
;; Assume that cygwin-mount already activated.
c39f6e6fd191 Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 798
diff changeset
  1055
(when (featurep 'cygwin-mount)
c39f6e6fd191 Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 798
diff changeset
  1056
  (setenv "INFOPATH" "/usr/share/info/:~/usr/share/info/:")
c39f6e6fd191 Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 798
diff changeset
  1057
  ;; Redefine path-separator to UNIX to update Info-directory-list.
c39f6e6fd191 Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 798
diff changeset
  1058
  (let ( (path-separator ":") )
c39f6e6fd191 Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 798
diff changeset
  1059
    (require 'info)
c39f6e6fd191 Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 798
diff changeset
  1060
    (info-initialize)
c39f6e6fd191 Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 798
diff changeset
  1061
    ))
c39f6e6fd191 Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 798
diff changeset
  1062
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1063
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  1064
(message "man, woman")
296
e502c69ab80a Make header name like tags, separated by comma and ended on period.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 295
diff changeset
  1065
799
c39f6e6fd191 Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 798
diff changeset
  1066
;; Assume that cygwin-mount already activated.
c39f6e6fd191 Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 798
diff changeset
  1067
(when (featurep 'cygwin-mount)
c39f6e6fd191 Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 798
diff changeset
  1068
  (let ( (path (expand-file-name "~")) )
c39f6e6fd191 Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 798
diff changeset
  1069
    (when (string-match "\\([c-z]\\):/" path)
c39f6e6fd191 Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 798
diff changeset
  1070
      (setenv "MANPATH" (concat "/cygdrive/" (substring path 0 1) "/" (substring path 3) "/usr/share/man/:"))
c39f6e6fd191 Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 798
diff changeset
  1071
      ) ))
c39f6e6fd191 Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 798
diff changeset
  1072
156
55aed5f25591 Added customisation for woman.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 143
diff changeset
  1073
(setq woman-use-own-frame nil)
55aed5f25591 Added customisation for woman.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 143
diff changeset
  1074
(setq woman-fill-frame t)
736
33d4749081b9 I prefer EN man pages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 735
diff changeset
  1075
;; I prefer EN man pages.
842
9da301f47799 Don't change ``manual-program`` for Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 841
diff changeset
  1076
(when (memq system-type '(windows-nt cygwin))
9da301f47799 Don't change ``manual-program`` for Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 841
diff changeset
  1077
  (setq manual-program "LANG=C man")
9da301f47799 Don't change ``manual-program`` for Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 841
diff changeset
  1078
  )
156
55aed5f25591 Added customisation for woman.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 143
diff changeset
  1079
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1080
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  1081
(message "comint")
434
12acc6727bd9 Set comint-eol-on-send.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 433
diff changeset
  1082
12acc6727bd9 Set comint-eol-on-send.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 433
diff changeset
  1083
;; If non-nil, add a `/' to completed directories, ` ' to file names.
12acc6727bd9 Set comint-eol-on-send.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 433
diff changeset
  1084
(setq comint-completion-addsuffix t)
12acc6727bd9 Set comint-eol-on-send.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 433
diff changeset
  1085
;; Non-nil means go to the end of the line before sending input.
12acc6727bd9 Set comint-eol-on-send.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 433
diff changeset
  1086
(setq comint-eol-on-send t)
12acc6727bd9 Set comint-eol-on-send.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 433
diff changeset
  1087
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1088
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
775
a7253eb62dee Enable flyspell for Log-Edit buffer to decrease spell errors.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 774
diff changeset
  1089
(message "spell, ispell, aspell, flyspell")
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1090
387
7340a863ae23 Fix spelling settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 385
diff changeset
  1091
;; Settings for spelling done in '.emacs-autogen'.
775
a7253eb62dee Enable flyspell for Log-Edit buffer to decrease spell errors.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 774
diff changeset
  1092
a7253eb62dee Enable flyspell for Log-Edit buffer to decrease spell errors.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 774
diff changeset
  1093
(add-hook 'log-edit-mode-hook 'flyspell-mode)
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1094
740
5dd70683a699 ispell-extra-args
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 739
diff changeset
  1095
;; (setq-default ispell-extra-args  '("--sug-mode=ultra"))
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1096
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1097
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
691
0722f3949eda Enable dict-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 689
diff changeset
  1098
(message "dict, dictd, dictionary")
0722f3949eda Enable dict-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 689
diff changeset
  1099
0722f3949eda Enable dict-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 689
diff changeset
  1100
(when (fboundp 'dict-c5-mode)
0722f3949eda Enable dict-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 689
diff changeset
  1101
  (add-to-list 'auto-mode-alist '("\\.dict-c5$" . dict-c5-mode))
0722f3949eda Enable dict-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 689
diff changeset
  1102
  )
0722f3949eda Enable dict-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 689
diff changeset
  1103
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1104
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
826
869bc1369aca Add basic figlet function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 825
diff changeset
  1105
(message "figlet")
869bc1369aca Add basic figlet function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 825
diff changeset
  1106
869bc1369aca Add basic figlet function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 825
diff changeset
  1107
(defun my-figlet-region (&optional b e)
869bc1369aca Add basic figlet function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 825
diff changeset
  1108
  (interactive "r")
869bc1369aca Add basic figlet function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 825
diff changeset
  1109
  (shell-command-on-region b e "figlet" (current-buffer) t)
869bc1369aca Add basic figlet function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 825
diff changeset
  1110
  (comment-region (mark) (point)))
869bc1369aca Add basic figlet function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 825
diff changeset
  1111
869bc1369aca Add basic figlet function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 825
diff changeset
  1112
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
830
52df3d263c55 Enable jdone if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 829
diff changeset
  1113
(message "jdone")
52df3d263c55 Enable jdone if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 829
diff changeset
  1114
52df3d263c55 Enable jdone if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 829
diff changeset
  1115
(ignore-errors
52df3d263c55 Enable jdone if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 829
diff changeset
  1116
  (require 'jdone)
52df3d263c55 Enable jdone if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 829
diff changeset
  1117
  (jdone-setup-key-binding)
52df3d263c55 Enable jdone if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 829
diff changeset
  1118
  (jdone-integrate-hook)
52df3d263c55 Enable jdone if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 829
diff changeset
  1119
  )
52df3d263c55 Enable jdone if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 829
diff changeset
  1120
52df3d263c55 Enable jdone if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 829
diff changeset
  1121
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
588
aa917b11ffef Initialize remember mode before org-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 587
diff changeset
  1122
(message "remember-mode")
aa917b11ffef Initialize remember mode before org-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 587
diff changeset
  1123
aa917b11ffef Initialize remember mode before org-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 587
diff changeset
  1124
(when (>= emacs-major-version 23)
aa917b11ffef Initialize remember mode before org-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 587
diff changeset
  1125
  (require 'remember))
48
5aa6729514f6 Add customize for org mode. Place todo higlight вместе с org mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 47
diff changeset
  1126
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1127
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
588
aa917b11ffef Initialize remember mode before org-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 587
diff changeset
  1128
(message "org-mode, GTD, PIM, organize, todo")
79
f80cd58e09cb Use buildin and installed version of org-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 78
diff changeset
  1129
561
18c74742b032 Simplify expr.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 560
diff changeset
  1130
(when (>= emacs-major-version 22)
589
d82530e4f0a6 Move common part.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 588
diff changeset
  1131
  (require 'org))
108
1559bb79bdd1 Enable org mode for >= emacs22.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 107
diff changeset
  1132
295
5be44cff4683 Use utf-8 encoding.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 289
diff changeset
  1133
;; XXX org-todo-keywords '((sequence "TODO" "START" "|" "DONE")) for org-version 4.67c
5be44cff4683 Use utf-8 encoding.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 289
diff changeset
  1134
;; XXX (setq org-todo-keywords '("TODO" "START" "DONE")) for org-version 6.05b
615
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1135
(when (or (featurep 'org) (featurep 'org-install))
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1136
  (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
663
1fdbc6490e16 Use ~/devel/my-devel/gtd for 'org-directory' to allow fetch changes with
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 662
diff changeset
  1137
  (setq org-directory "~/devel/my-devel/gtd")
615
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1138
  (setq
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1139
   org-default-notes-file nil
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1140
   org-agenda-ndays 31
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1141
   org-deadline-warning-days 7
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1142
   org-agenda-show-all-dates t
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1143
   org-agenda-format-date "%Y-%m-%d, %A %e %B"
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1144
   org-agenda-skip-deadline-if-done t
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1145
   org-agenda-skip-scheduled-if-done t
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1146
   org-agenda-start-on-weekday nil
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1147
   org-reverse-note-order t
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1148
   org-hide-leading-stars t
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1149
   org-tags-column 64
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1150
   )
663
1fdbc6490e16 Use ~/devel/my-devel/gtd for 'org-directory' to allow fetch changes with
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 662
diff changeset
  1151
  (setq my-org-agenda-todo-file (concat org-directory "/TODO.org"))
1fdbc6490e16 Use ~/devel/my-devel/gtd for 'org-directory' to allow fetch changes with
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 662
diff changeset
  1152
  (setq my-org-agenda-note-file (concat org-directory "/NOTE.org"))
615
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1153
  (setq org-agenda-files `(,my-org-agenda-todo-file ,my-org-agenda-note-file))
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1154
  (define-key global-map "\C-ca" 'org-agenda)
722
7d43d5ae86fe Use "*scratch*" as temp buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 721
diff changeset
  1155
  (define-key global-map "\C-ce" (lambda nil (interactive) (find-file my-org-agenda-note-file)))
589
d82530e4f0a6 Move common part.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 588
diff changeset
  1156
671
c8f7a49f06a9 My tags for remember buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 670
diff changeset
  1157
  ;; My tags for remember buffer.
c8f7a49f06a9 My tags for remember buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 670
diff changeset
  1158
  (setq org-tag-persistent-alist
c8f7a49f06a9 My tags for remember buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 670
diff changeset
  1159
        '(
c8f7a49f06a9 My tags for remember buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 670
diff changeset
  1160
          ("ADMIN" . ?a)
c8f7a49f06a9 My tags for remember buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 670
diff changeset
  1161
          ("BLOG" . ?b)
c8f7a49f06a9 My tags for remember buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 670
diff changeset
  1162
          ("DEVEL" . ?d)
c8f7a49f06a9 My tags for remember buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 670
diff changeset
  1163
          ("LIFE" . ?l)
c8f7a49f06a9 My tags for remember buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 670
diff changeset
  1164
          ("MISC" . ?m)
c8f7a49f06a9 My tags for remember buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 670
diff changeset
  1165
          ("JOB" . ?j)
c8f7a49f06a9 My tags for remember buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 670
diff changeset
  1166
          ("PROJECT" . ?p)
c8f7a49f06a9 My tags for remember buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 670
diff changeset
  1167
          ("READ" . ?r)
687
54a77c8a091a Add item to org-tag-persistent-alist.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 682
diff changeset
  1168
          ("SEE" . ?s)
671
c8f7a49f06a9 My tags for remember buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 670
diff changeset
  1169
          ))
c8f7a49f06a9 My tags for remember buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 670
diff changeset
  1170
615
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1171
  (when (or (featurep 'remember) (fboundp 'remember))
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1172
    (setq remember-annotation-functions '(org-remember-annotation))
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1173
    (setq remember-handler-functions '(org-remember-handler))
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1174
    (add-hook 'remember-mode-hook 'org-remember-apply-template)
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1175
    (define-key global-map "\C-cr" 'org-remember)
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1176
    (setq org-remember-templates
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1177
          ;; With one item org-mode do not prompt choose template.
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1178
          `(
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1179
            ("todo" ?t "* TODO %?" ,my-org-agenda-todo-file)
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1180
            ;; ("note" ?n "* %?\n" ,my-org-agenda-note-file)
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1181
            ))
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1182
    (setq org-remember-store-without-prompt t)
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1183
    (org-remember-insinuate)
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1184
    )
589
d82530e4f0a6 Move common part.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 588
diff changeset
  1185
615
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1186
  ;; (setq org-todo-keyword-faces
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1187
  ;;       '(("TODO" . (:foreground "red" :weight bold))
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1188
  ;;         ("WAIT" . (:foreground "orange" :weight bold))
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1189
  ;;         ("DONE" . (:foreground "green" :weight bold))) )
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1190
  )
48
5aa6729514f6 Add customize for org mode. Place todo higlight вместе с org mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 47
diff changeset
  1191
834
07219d4d737e (setq org-agenda-include-diary t)
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 830
diff changeset
  1192
(setq org-agenda-include-diary t)
07219d4d737e (setq org-agenda-include-diary t)
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 830
diff changeset
  1193
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1194
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  1195
(message "TODO, XXX, FIXME highlight")
48
5aa6729514f6 Add customize for org mode. Place todo higlight вместе с org mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 47
diff changeset
  1196
;; Show blanks and FIXME
5aa6729514f6 Add customize for org mode. Place todo higlight вместе с org mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 47
diff changeset
  1197
;; http://www.emacswiki.org/cgi-bin/wiki/EightyColumnRule
5aa6729514f6 Add customize for org mode. Place todo higlight вместе с org mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 47
diff changeset
  1198
5aa6729514f6 Add customize for org mode. Place todo higlight вместе с org mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 47
diff changeset
  1199
(defface my-tab-face
5aa6729514f6 Add customize for org mode. Place todo higlight вместе с org mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 47
diff changeset
  1200
  '((t :background "gray"))
5aa6729514f6 Add customize for org mode. Place todo higlight вместе с org mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 47
diff changeset
  1201
  "Face for showing TABs."
5aa6729514f6 Add customize for org mode. Place todo higlight вместе с org mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 47
diff changeset
  1202
  :group 'basic-faces)
5aa6729514f6 Add customize for org mode. Place todo higlight вместе с org mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 47
diff changeset
  1203
465
0a9cbfab10f4 Moved highlight pattern from hook to mode highlighting list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 463
diff changeset
  1204
(defface my-contrasty-face
48
5aa6729514f6 Add customize for org mode. Place todo higlight вместе с org mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 47
diff changeset
  1205
  '((t :background "pink" :foreground "red" :weight bold))
5aa6729514f6 Add customize for org mode. Place todo higlight вместе с org mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 47
diff changeset
  1206
  "Font for showing conflicts."
5aa6729514f6 Add customize for org mode. Place todo higlight вместе с org mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 47
diff changeset
  1207
  :group 'basic-faces)
5aa6729514f6 Add customize for org mode. Place todo higlight вместе с org mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 47
diff changeset
  1208
682
c80875ec8ad3 Remove text modes from devel mode list as it can not supprt imenu.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 681
diff changeset
  1209
(dolist (mode (append my-devel-mode-list my-text-mode-list))
465
0a9cbfab10f4 Moved highlight pattern from hook to mode highlighting list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 463
diff changeset
  1210
  (font-lock-add-keywords
0a9cbfab10f4 Moved highlight pattern from hook to mode highlighting list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 463
diff changeset
  1211
   mode
600
5a67b40de30d Add some TODO keywords.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
  1212
   `(
465
0a9cbfab10f4 Moved highlight pattern from hook to mode highlighting list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 463
diff changeset
  1213
     ("\t+" 0 'my-tab-face t)
600
5a67b40de30d Add some TODO keywords.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
  1214
     ( ,(concat "\\<\\(" (regexp-opt '("TODO" "FIX" "FIXME" "HACK" "XXX")) ":?\\)\\>") 1 'font-lock-warning-face t)
478
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 473 477
diff changeset
  1215
     ("\\(=\\|<\\|>\\)\\{7,\\}" 0 'my-contrasty-face t)
465
0a9cbfab10f4 Moved highlight pattern from hook to mode highlighting list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 463
diff changeset
  1216
     ;; 64 times, for highlight C-u C-u C-u <key>
467
e08ed1434053 Simplify regex.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 466
diff changeset
  1217
     ("\\([^[:space:]]\\)\\1\\{63\\}" 0 'my-contrasty-face t)
465
0a9cbfab10f4 Moved highlight pattern from hook to mode highlighting list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 463
diff changeset
  1218
     ))
0a9cbfab10f4 Moved highlight pattern from hook to mode highlighting list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 463
diff changeset
  1219
  )
284
bf5829d9bbf7 Another way to register TODO highlighting.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 280
diff changeset
  1220
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1221
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
660
7abcc3f39fe9 Set basic mail settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 658
diff changeset
  1222
(message "fortune")
7abcc3f39fe9 Set basic mail settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 658
diff changeset
  1223
(setq fortune-file "~/XXX")
7abcc3f39fe9 Set basic mail settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 658
diff changeset
  1224
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1225
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
779
df488c333452 Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 778
diff changeset
  1226
(message "mail, message")
df488c333452 Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 778
diff changeset
  1227
780
afc4ee8b5dea Use message-user-agent as mail-user-agent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 779
diff changeset
  1228
(setq mail-user-agent 'message-user-agent)
afc4ee8b5dea Use message-user-agent as mail-user-agent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 779
diff changeset
  1229
781
c0b65744479e Define own citation format. Also this fix of inclusion mail address of cited
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 780
diff changeset
  1230
(setq message-citation-line-format "On %Y-%m-%d, %N wrote:
c0b65744479e Define own citation format. Also this fix of inclusion mail address of cited
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 780
diff changeset
  1231
")
c0b65744479e Define own citation format. Also this fix of inclusion mail address of cited
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 780
diff changeset
  1232
(setq message-citation-line-function 'message-insert-formatted-citation-line)
660
7abcc3f39fe9 Set basic mail settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 658
diff changeset
  1233
7abcc3f39fe9 Set basic mail settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 658
diff changeset
  1234
(setq mail-signature t)
7abcc3f39fe9 Set basic mail settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 658
diff changeset
  1235
(setq mail-signature-file "~/.signature")
7abcc3f39fe9 Set basic mail settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 658
diff changeset
  1236
;; (add-hook 'mail-setup-hook 'fortune-to-signature)
7abcc3f39fe9 Set basic mail settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 658
diff changeset
  1237
779
df488c333452 Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 778
diff changeset
  1238
;; (setq mail-from-style 'angles)
df488c333452 Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 778
diff changeset
  1239
df488c333452 Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 778
diff changeset
  1240
(setq mail-personal-alias-file "~/.mailrc")
df488c333452 Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 778
diff changeset
  1241
;; Initialize from your mail aliases file...
df488c333452 Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 778
diff changeset
  1242
(setq mail-aliases t)
783
f2d86933e2b5 Enable ecomplete in addition to abbrev for mail completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 782
diff changeset
  1243
(require 'ecomplete)
f2d86933e2b5 Enable ecomplete in addition to abbrev for mail completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 782
diff changeset
  1244
(setq message-mail-alias-type '(abbrev ecomplete))
779
df488c333452 Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 778
diff changeset
  1245
df488c333452 Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 778
diff changeset
  1246
(eval-after-load 'message
df488c333452 Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 778
diff changeset
  1247
  '(progn
df488c333452 Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 778
diff changeset
  1248
     (require 'mailabbrev)
df488c333452 Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 778
diff changeset
  1249
     (define-key message-mode-map "\e\t" 'mail-abbrev-complete-alias)
df488c333452 Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 778
diff changeset
  1250
     ))
df488c333452 Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 778
diff changeset
  1251
784
982eee9d0366 Enable flyspell for message composing buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 783
diff changeset
  1252
(defun my-message-setup-routine ()
982eee9d0366 Enable flyspell for message composing buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 783
diff changeset
  1253
  (flyspell-mode 1)
982eee9d0366 Enable flyspell for message composing buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 783
diff changeset
  1254
  )
982eee9d0366 Enable flyspell for message composing buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 783
diff changeset
  1255
(add-hook 'message-setup-hook 'my-message-setup-routine)
982eee9d0366 Enable flyspell for message composing buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 783
diff changeset
  1256
779
df488c333452 Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 778
diff changeset
  1257
;; Kill message buffer after mail send. You always can use C-c C-s to preserve it.
df488c333452 Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 778
diff changeset
  1258
(setq message-kill-buffer-on-exit t)
df488c333452 Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 778
diff changeset
  1259
df488c333452 Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 778
diff changeset
  1260
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
747
dd1d88804512 Use smtpmail mode for sending mail.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 746
diff changeset
  1261
(message "smtp, smtpmail")
dd1d88804512 Use smtpmail mode for sending mail.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 746
diff changeset
  1262
843
2adc2d3542a4 Use 'sendmail-send-it' for 'send-mail-function' under Debian as
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 842
diff changeset
  1263
(when (and (not (eq system-type 'gnu/linux)) (boundp 'smtpmail-smtp-server))
773
9308a0c91624 Load auth info if possible. Load smtpmail if user provide server to use.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 772
diff changeset
  1264
  (require 'smtpmail)
9308a0c91624 Load auth info if possible. Load smtpmail if user provide server to use.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 772
diff changeset
  1265
  (setq
9308a0c91624 Load auth info if possible. Load smtpmail if user provide server to use.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 772
diff changeset
  1266
   ;; If you use the default mail user agent.
9308a0c91624 Load auth info if possible. Load smtpmail if user provide server to use.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 772
diff changeset
  1267
   send-mail-function 'smtpmail-send-it
9308a0c91624 Load auth info if possible. Load smtpmail if user provide server to use.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 772
diff changeset
  1268
   ;; If you use Message or Gnus.
9308a0c91624 Load auth info if possible. Load smtpmail if user provide server to use.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 772
diff changeset
  1269
   message-send-mail-function 'smtpmail-send-it
9308a0c91624 Load auth info if possible. Load smtpmail if user provide server to use.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 772
diff changeset
  1270
   )
9308a0c91624 Load auth info if possible. Load smtpmail if user provide server to use.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 772
diff changeset
  1271
  )
747
dd1d88804512 Use smtpmail mode for sending mail.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 746
diff changeset
  1272
;; (setq smtpmail-debug-verb t)
dd1d88804512 Use smtpmail mode for sending mail.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 746
diff changeset
  1273
;; (setq smtpmail-debug-info t)
dd1d88804512 Use smtpmail mode for sending mail.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 746
diff changeset
  1274
761
9fbed6e9f28e Set 'fill-column' to 78 for mail compose 'message' buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 760
diff changeset
  1275
(defun my-message-mode-hook ()
9fbed6e9f28e Set 'fill-column' to 78 for mail compose 'message' buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 760
diff changeset
  1276
  (setq fill-column 78)
792
969517e877ea When composing a mail, start the auto-fill-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 791
diff changeset
  1277
  (turn-on-auto-fill)
761
9fbed6e9f28e Set 'fill-column' to 78 for mail compose 'message' buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 760
diff changeset
  1278
  )
9fbed6e9f28e Set 'fill-column' to 78 for mail compose 'message' buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 760
diff changeset
  1279
(add-hook 'message-mode-hook 'my-message-mode-hook)
9fbed6e9f28e Set 'fill-column' to 78 for mail compose 'message' buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 760
diff changeset
  1280
747
dd1d88804512 Use smtpmail mode for sending mail.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 746
diff changeset
  1281
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
779
df488c333452 Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 778
diff changeset
  1282
(message "gnus, mh-e")
772
f0a62f45a356 Kill message buffer after mail send. You always can use C-c C-s to preserve it.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 771
diff changeset
  1283
757
789d7ac3d34f gnus-site-init-file
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 756
diff changeset
  1284
(setq gnus-site-init-file "~/.gnus.el")
789d7ac3d34f gnus-site-init-file
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 756
diff changeset
  1285
841
68e40729a4f4 Kill Gnus when exiting Emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 840
diff changeset
  1286
(defun my-kill-gnus ()
68e40729a4f4 Kill Gnus when exiting Emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 840
diff changeset
  1287
  "Kill Gnus when exiting Emacs."
68e40729a4f4 Kill Gnus when exiting Emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 840
diff changeset
  1288
  (let ( (gnus-interactive-exit nil) )
68e40729a4f4 Kill Gnus when exiting Emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 840
diff changeset
  1289
    (gnus-group-exit)
68e40729a4f4 Kill Gnus when exiting Emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 840
diff changeset
  1290
    ))
68e40729a4f4 Kill Gnus when exiting Emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 840
diff changeset
  1291
68e40729a4f4 Kill Gnus when exiting Emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 840
diff changeset
  1292
(eval-after-load 'gnus
68e40729a4f4 Kill Gnus when exiting Emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 840
diff changeset
  1293
  '(progn
68e40729a4f4 Kill Gnus when exiting Emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 840
diff changeset
  1294
     (add-hook 'kill-emacs-hook 'my-kill-gnus)
68e40729a4f4 Kill Gnus when exiting Emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 840
diff changeset
  1295
     ))
68e40729a4f4 Kill Gnus when exiting Emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 840
diff changeset
  1296
794
7f81d5acc2bc Store gnus specific files to '~/.gnus'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 793
diff changeset
  1297
;; Store gnus specific files to '~/.gnus'.
804
c347ec94c201 Set "~/.gnus" prefix to all mail directories.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 803
diff changeset
  1298
(setq
c347ec94c201 Set "~/.gnus" prefix to all mail directories.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 803
diff changeset
  1299
 gnus-directory "~/.gnus"
c347ec94c201 Set "~/.gnus" prefix to all mail directories.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 803
diff changeset
  1300
 gnus-agent-directory "~/.gnus/agent/"
c347ec94c201 Set "~/.gnus" prefix to all mail directories.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 803
diff changeset
  1301
 gnus-article-save-directory "~/.gnus/saved"
c347ec94c201 Set "~/.gnus" prefix to all mail directories.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 803
diff changeset
  1302
 gnus-kill-files-directory "~/.gnus/scores"
c347ec94c201 Set "~/.gnus" prefix to all mail directories.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 803
diff changeset
  1303
 gnus-cache-directory "~/.gnus/cache"
c347ec94c201 Set "~/.gnus" prefix to all mail directories.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 803
diff changeset
  1304
 mail-source-directory "~/.gnus/mail"
c347ec94c201 Set "~/.gnus" prefix to all mail directories.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 803
diff changeset
  1305
 message-directory "~/.gnus/mail"
c347ec94c201 Set "~/.gnus" prefix to all mail directories.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 803
diff changeset
  1306
 message-auto-save-directory "~/.gnus/autosave"
c347ec94c201 Set "~/.gnus" prefix to all mail directories.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 803
diff changeset
  1307
 ;; message-signature-directory
c347ec94c201 Set "~/.gnus" prefix to all mail directories.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 803
diff changeset
  1308
 mailcap-download-directory  "~/.gnus/mailcap"
c347ec94c201 Set "~/.gnus" prefix to all mail directories.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 803
diff changeset
  1309
 nnml-directory "~/.gnus/nnml-mail"
c347ec94c201 Set "~/.gnus" prefix to all mail directories.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 803
diff changeset
  1310
 spam-directory "~/.gnus/spam/"
c347ec94c201 Set "~/.gnus" prefix to all mail directories.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 803
diff changeset
  1311
 smime-certificate-directory "~/.gnus/certs/"
805
d7cbd3a099e5 Set nnfolder-active-file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 804
diff changeset
  1312
 nnfolder-directory "~/.gnus/archive"
d7cbd3a099e5 Set nnfolder-active-file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 804
diff changeset
  1313
 nnfolder-active-file "~/.gnus/archive/active"
804
c347ec94c201 Set "~/.gnus" prefix to all mail directories.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 803
diff changeset
  1314
)
798
c1f795e32b09 Spam settings (commented).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 797
diff changeset
  1315
806
eaabe3db15a5 Remove gnus-ignored-newsgroups to show all GMail folders.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 805
diff changeset
  1316
;; Remove gnus-ignored-newsgroups to show all GMail folders.
862
6b956999856b Fix "isearch-no-upper-case-p: Wrong type argument: stringp, nil" from gnus.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 861
diff changeset
  1317
(setq gnus-ignored-newsgroups "some-non-existing")
798
c1f795e32b09 Spam settings (commented).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 797
diff changeset
  1318
c1f795e32b09 Spam settings (commented).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 797
diff changeset
  1319
;; (require 'spam)
c1f795e32b09 Spam settings (commented).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 797
diff changeset
  1320
;; (setq gnus-spam-process-newsgroups
c1f795e32b09 Spam settings (commented).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 797
diff changeset
  1321
;;       '(("^gmane\\."
c1f795e32b09 Spam settings (commented).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 797
diff changeset
  1322
;;          ((spam spam-use-gmane)))))
794
7f81d5acc2bc Store gnus specific files to '~/.gnus'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 793
diff changeset
  1323
739
65e6b1b497fb Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 738
diff changeset
  1324
(setq
819
38b7c81853e8 Mark that I am not 'gnus-novice-user' to avoid conformation when delete mails.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 818
diff changeset
  1325
 gnus-novice-user nil
739
65e6b1b497fb Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 738
diff changeset
  1326
 gnus-expert-user nil
65e6b1b497fb Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 738
diff changeset
  1327
 gnus-interactive-catchup t
65e6b1b497fb Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 738
diff changeset
  1328
 gnus-interactive-exit t
65e6b1b497fb Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 738
diff changeset
  1329
 )
65e6b1b497fb Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 738
diff changeset
  1330
65e6b1b497fb Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 738
diff changeset
  1331
(setq
65e6b1b497fb Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 738
diff changeset
  1332
 gnus-read-active-file nil
65e6b1b497fb Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 738
diff changeset
  1333
 gnus-check-new-newsgroups nil
65e6b1b497fb Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 738
diff changeset
  1334
 gnus-check-bogus-newsgroups nil
65e6b1b497fb Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 738
diff changeset
  1335
 )
65e6b1b497fb Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 738
diff changeset
  1336
829
093b6699e903 Some settings for Gnus caching (same as default values).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 826
diff changeset
  1337
;; (setq 'gnus-use-cache t)
093b6699e903 Some settings for Gnus caching (same as default values).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 826
diff changeset
  1338
(setq gnus-use-long-file-name t)
093b6699e903 Some settings for Gnus caching (same as default values).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 826
diff changeset
  1339
(setq gnus-use-long-file-name t)
093b6699e903 Some settings for Gnus caching (same as default values).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 826
diff changeset
  1340
(setq gnus-cache-remove-articles '(read))
093b6699e903 Some settings for Gnus caching (same as default values).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 826
diff changeset
  1341
786
496791c4fe36 If you're spooling in overlapping mbox folders, you probably want
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 785
diff changeset
  1342
;; If you're spooling in overlapping mbox folders, you probably want to delete
496791c4fe36 If you're spooling in overlapping mbox folders, you probably want
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 785
diff changeset
  1343
;; all messages with duplicate message IDs.
496791c4fe36 If you're spooling in overlapping mbox folders, you probably want
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 785
diff changeset
  1344
(setq nnmail-treat-duplicates 'delete)
496791c4fe36 If you're spooling in overlapping mbox folders, you probably want
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 785
diff changeset
  1345
787
fc00f202c3e3 Do not use the html part of a message, use the text part if possible!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 786
diff changeset
  1346
;; Do not use the html part of a message, use the text part if possible!
fc00f202c3e3 Do not use the html part of a message, use the text part if possible!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 786
diff changeset
  1347
(setq mm-discouraged-alternatives '("text/html" "text/richtext"))
fc00f202c3e3 Do not use the html part of a message, use the text part if possible!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 786
diff changeset
  1348
797
886b872e46cc gnus-topic-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 796
diff changeset
  1349
(add-hook 'gnus-group-mode-hook 'gnus-topic-mode)
886b872e46cc gnus-topic-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 796
diff changeset
  1350
745
81e7f065031c Fix error: 'gnus-posting-styles' does not defined.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 744
diff changeset
  1351
(setq
81e7f065031c Fix error: 'gnus-posting-styles' does not defined.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 744
diff changeset
  1352
 gnus-posting-styles
81e7f065031c Fix error: 'gnus-posting-styles' does not defined.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 744
diff changeset
  1353
 '(
81e7f065031c Fix error: 'gnus-posting-styles' does not defined.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 744
diff changeset
  1354
   (".*"
742
f59b924b1b7d Add signature to mails.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 741
diff changeset
  1355
    (organization "At home.")
f59b924b1b7d Add signature to mails.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 741
diff changeset
  1356
    (signature-file "~/.signature")
f59b924b1b7d Add signature to mails.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 741
diff changeset
  1357
    )
745
81e7f065031c Fix error: 'gnus-posting-styles' does not defined.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 744
diff changeset
  1358
   ))
742
f59b924b1b7d Add signature to mails.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 741
diff changeset
  1359
789
6daf35744ad3 Modify 'gnus-summary-line-format'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 788
diff changeset
  1360
;; `gnus-group-line-format', `gnus-summary-line-format',
6daf35744ad3 Modify 'gnus-summary-line-format'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 788
diff changeset
  1361
;; `gnus-server-line-format', `gnus-topic-line-format',
6daf35744ad3 Modify 'gnus-summary-line-format'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 788
diff changeset
  1362
;; `gnus-group-mode-line-format', `gnus-summary-mode-line-format',
6daf35744ad3 Modify 'gnus-summary-line-format'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 788
diff changeset
  1363
;; `gnus-article-mode-line-format', `gnus-server-mode-line-format',
6daf35744ad3 Modify 'gnus-summary-line-format'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 788
diff changeset
  1364
;; `gnus-summary-pick-line-format'.
6daf35744ad3 Modify 'gnus-summary-line-format'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 788
diff changeset
  1365
790
356d5ed1649c Customize gnus-sum-thread-tree.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
  1366
(when window-system
356d5ed1649c Customize gnus-sum-thread-tree.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
  1367
  (setq
356d5ed1649c Customize gnus-sum-thread-tree.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
  1368
   gnus-sum-thread-tree-false-root ""
356d5ed1649c Customize gnus-sum-thread-tree.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
  1369
   gnus-sum-thread-tree-indent " "
356d5ed1649c Customize gnus-sum-thread-tree.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
  1370
   gnus-sum-thread-tree-leaf-with-other "├► "
356d5ed1649c Customize gnus-sum-thread-tree.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
  1371
   gnus-sum-thread-tree-root ""
803
05cd01bc7813 Use another symbol graphic symbol as old does not present in Windows 7.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 802
diff changeset
  1372
   gnus-sum-thread-tree-single-leaf "└► "
790
356d5ed1649c Customize gnus-sum-thread-tree.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
  1373
   gnus-sum-thread-tree-vertical "│"
356d5ed1649c Customize gnus-sum-thread-tree.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
  1374
   ))
356d5ed1649c Customize gnus-sum-thread-tree.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
  1375
789
6daf35744ad3 Modify 'gnus-summary-line-format'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 788
diff changeset
  1376
(setq gnus-user-date-format-alist '((t . "%Y-%m-%d %H:%M")))
791
134ec9507faf Show standard status in Gnus summary.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 790
diff changeset
  1377
(setq gnus-summary-line-format "%U%R%z %&user-date; %B %[%-22,22f%] %s\n")
789
6daf35744ad3 Modify 'gnus-summary-line-format'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 788
diff changeset
  1378
(setq gnus-summary-mode-line-format "Gnus: %p %Z")
6daf35744ad3 Modify 'gnus-summary-line-format'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 788
diff changeset
  1379
744
d3fc2caa5498 Setup own time format (ISO 8601 + day of week) for GNUS article.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 743
diff changeset
  1380
(setq gnus-article-time-format "%Y-%m-%d %T%z %a")
782
03aa367920e6 Make date header setting in portable way as recommended in manual.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 781
diff changeset
  1381
(setq gnus-article-date-headers '(combined-lapsed user-defined))
744
d3fc2caa5498 Setup own time format (ISO 8601 + day of week) for GNUS article.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 743
diff changeset
  1382
795
627ed33d9488 gnus-visible-headers
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 794
diff changeset
  1383
;; gnus-visible-headers
796
23e9f51428a9 gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 795
diff changeset
  1384
(setq
23e9f51428a9 gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 795
diff changeset
  1385
 gnus-sorted-header-list
23e9f51428a9 gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 795
diff changeset
  1386
 '(
23e9f51428a9 gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 795
diff changeset
  1387
   "^From:"
23e9f51428a9 gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 795
diff changeset
  1388
   "^Subject:"
23e9f51428a9 gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 795
diff changeset
  1389
   "^Summary:"
23e9f51428a9 gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 795
diff changeset
  1390
   "^Keywords:"
23e9f51428a9 gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 795
diff changeset
  1391
   "^Newsgroups:"
23e9f51428a9 gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 795
diff changeset
  1392
   "^Followup-To:"
23e9f51428a9 gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 795
diff changeset
  1393
   "^To:"
23e9f51428a9 gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 795
diff changeset
  1394
   "^Cc:"
23e9f51428a9 gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 795
diff changeset
  1395
   "^Organization:"
23e9f51428a9 gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 795
diff changeset
  1396
   "^Date:"
23e9f51428a9 gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 795
diff changeset
  1397
   "^User-Agent:"
23e9f51428a9 gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 795
diff changeset
  1398
   "^X-Mailer:"
23e9f51428a9 gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 795
diff changeset
  1399
   "^X-Newsreader:"
23e9f51428a9 gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 795
diff changeset
  1400
   ))
795
627ed33d9488 gnus-visible-headers
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 794
diff changeset
  1401
755
6f903d3b2ec7 Adaptive score for GNUS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 754
diff changeset
  1402
(setq
6f903d3b2ec7 Adaptive score for GNUS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 754
diff changeset
  1403
 gnus-show-threads t
785
7956c2497dda gnus-thread-sort-by-date
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 784
diff changeset
  1404
 gnus-thread-sort-functions '(gnus-thread-sort-by-date gnus-thread-sort-by-total-score)
755
6f903d3b2ec7 Adaptive score for GNUS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 754
diff changeset
  1405
 )
788
b7b60066599e Split scoring setting from other.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 787
diff changeset
  1406
b7b60066599e Split scoring setting from other.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 787
diff changeset
  1407
;; Scoring, adaptive score.
b7b60066599e Split scoring setting from other.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 787
diff changeset
  1408
(setq
820
dc1331cd9729 Set gnus-use-scoring to t.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 819
diff changeset
  1409
 gnus-use-scoring t
dc1331cd9729 Set gnus-use-scoring to t.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 819
diff changeset
  1410
 gnus-save-score t
788
b7b60066599e Split scoring setting from other.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 787
diff changeset
  1411
 gnus-use-adaptive-scoring t
b7b60066599e Split scoring setting from other.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 787
diff changeset
  1412
 gnus-score-expiry-days 60
b7b60066599e Split scoring setting from other.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 787
diff changeset
  1413
 gnus-decay-scores t
b7b60066599e Split scoring setting from other.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 787
diff changeset
  1414
 gnus-default-adaptive-score-alist
b7b60066599e Split scoring setting from other.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 787
diff changeset
  1415
 '(
b7b60066599e Split scoring setting from other.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 787
diff changeset
  1416
   (gnus-unread-mark)
b7b60066599e Split scoring setting from other.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 787
diff changeset
  1417
   (gnus-ticked-mark (subject 5))
b7b60066599e Split scoring setting from other.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 787
diff changeset
  1418
   (gnus-dormant-mark (subject 5))
b7b60066599e Split scoring setting from other.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 787
diff changeset
  1419
   (gnus-del-mark (from -2) (subject -5))
b7b60066599e Split scoring setting from other.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 787
diff changeset
  1420
   (gnus-read-mark (from 2) (subject 1))
b7b60066599e Split scoring setting from other.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 787
diff changeset
  1421
   (gnus-killed-mark (subject -5))
b7b60066599e Split scoring setting from other.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 787
diff changeset
  1422
   (gnus-catchup-mark (subject -1))
b7b60066599e Split scoring setting from other.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 787
diff changeset
  1423
   (gnus-kill-file-mark (from -9999))
b7b60066599e Split scoring setting from other.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 787
diff changeset
  1424
   )
b7b60066599e Split scoring setting from other.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 787
diff changeset
  1425
 )
793
dee9b2482842 Increase the score for followups to a sent article.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 792
diff changeset
  1426
;; Increase the score for followups to a sent article.
821
e385d1d48a8d Increase the score for followups to a sent article.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 820
diff changeset
  1427
(eval-after-load 'gnus-score
e385d1d48a8d Increase the score for followups to a sent article.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 820
diff changeset
  1428
  '(progn
e385d1d48a8d Increase the score for followups to a sent article.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 820
diff changeset
  1429
     (add-hook 'message-sent-hook 'gnus-score-followup-article)
e385d1d48a8d Increase the score for followups to a sent article.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 820
diff changeset
  1430
     (add-hook 'message-sent-hook 'gnus-score-followup-thread)
e385d1d48a8d Increase the score for followups to a sent article.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 820
diff changeset
  1431
     ))
755
6f903d3b2ec7 Adaptive score for GNUS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 754
diff changeset
  1432
807
63c56a8cf9f1 Remove duplication, move code above.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 806
diff changeset
  1433
;; (setq gnus-home-score-file
63c56a8cf9f1 Remove duplication, move code above.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 806
diff changeset
  1434
;;       ;; All groups that match the regexp `"\\.emacs"'
63c56a8cf9f1 Remove duplication, move code above.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 806
diff changeset
  1435
;;       '(("\\.emacs" "emacs.SCORE")
63c56a8cf9f1 Remove duplication, move code above.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 806
diff changeset
  1436
;;         ;; All the comp groups in one score file
63c56a8cf9f1 Remove duplication, move code above.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 806
diff changeset
  1437
;;         ("^comp" "comp.SCORE")))
63c56a8cf9f1 Remove duplication, move code above.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 806
diff changeset
  1438
785
7956c2497dda gnus-thread-sort-by-date
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 784
diff changeset
  1439
;; (setq imap-log t)
7956c2497dda gnus-thread-sort-by-date
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 784
diff changeset
  1440
660
7abcc3f39fe9 Set basic mail settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 658
diff changeset
  1441
;; (setq mail-user-agent 'mh-e-user-agent)
83
d2eaf2ed6d1c Added basic jabber customization.
gavenkoa@gavenko.bifit.int
parents: 82
diff changeset
  1442
808
54d6db4ec612 Fix 'gnus-summary-cancelled' face (default have black background which
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 807
diff changeset
  1443
(custom-set-faces '(gnus-summary-cancelled ((t (:foreground "plum" :background nil)))) )
739
65e6b1b497fb Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 738
diff changeset
  1444
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1445
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
801
feb479e720e1 Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 800
diff changeset
  1446
(message "bbdb")
739
65e6b1b497fb Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 738
diff changeset
  1447
801
feb479e720e1 Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 800
diff changeset
  1448
(setq
feb479e720e1 Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 800
diff changeset
  1449
 bbdb-offer-save 1
feb479e720e1 Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 800
diff changeset
  1450
 bbdb-use-pop-up t
feb479e720e1 Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 800
diff changeset
  1451
 bbdb-electric-p t
feb479e720e1 Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 800
diff changeset
  1452
 bbdb-popup-target-lines  1
feb479e720e1 Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 800
diff changeset
  1453
 )
feb479e720e1 Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 800
diff changeset
  1454
feb479e720e1 Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 800
diff changeset
  1455
(setq bbdb-complete-name-full-completion t)
feb479e720e1 Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 800
diff changeset
  1456
(setq bbdb-completion-type 'primary-or-name)
feb479e720e1 Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 800
diff changeset
  1457
(setq bbdb-complete-name-allow-cycling t)
feb479e720e1 Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 800
diff changeset
  1458
feb479e720e1 Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 800
diff changeset
  1459
(setq bbdb-file "~/.gnus/bbdb")
feb479e720e1 Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 800
diff changeset
  1460
feb479e720e1 Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 800
diff changeset
  1461
;; (bbdb-initialize 'gnus 'message)
feb479e720e1 Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 800
diff changeset
  1462
;; (bbdb-insinuate-message)
feb479e720e1 Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 800
diff changeset
  1463
;; (add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus)
feb479e720e1 Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 800
diff changeset
  1464
739
65e6b1b497fb Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 738
diff changeset
  1465
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1466
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  1467
(message "jabber")
83
d2eaf2ed6d1c Added basic jabber customization.
gavenkoa@gavenko.bifit.int
parents: 82
diff changeset
  1468
675
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1469
(autoload 'jabber-connect-all "jabber")
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1470
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1471
(setq
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1472
 jabber-history-enabled t
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1473
 jabber-use-global-history nil
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1474
 jabber-backlog-number 40
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1475
 jabber-backlog-days 30
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1476
 jabber-alert-presence-message-function (lambda (who oldstatus newstatus statustext) nil)
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1477
 )
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1478
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1479
(eval-after-load 'jabber
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1480
  '(progn
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1481
    ;; Redefine standard binding for sending message form RET to C-RET.
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1482
    (define-key jabber-chat-mode-map (kbd "RET") 'newline)
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1483
    (define-key jabber-chat-mode-map [C-return] 'jabber-chat-buffer-send)
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1484
    ;; fsm used in emacs jabber
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1485
    (when (featurep 'fsm)
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1486
      (setq fsm-debug nil)                  ; Disable *fsm-debug* buffer.
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1487
      )
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1488
    ;; Handle Emacs exit.
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1489
    (add-hook 'kill-emacs-hook 'jabber-disconnect)
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1490
    ))
83
d2eaf2ed6d1c Added basic jabber customization.
gavenkoa@gavenko.bifit.int
parents: 82
diff changeset
  1491
214
f4234e15d891 Fix prompt format (prompt and text stay on two line, not one).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 211
diff changeset
  1492
(setq my-chat-prompt "[%t] %n>\n")
675
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1493
(setq
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1494
 jabber-chat-foreign-prompt-format my-chat-prompt
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1495
 jabber-chat-local-prompt-format my-chat-prompt
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1496
 jabber-groupchat-prompt-format my-chat-prompt
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1497
 jabber-muc-private-foreign-prompt-format "[%t] %g/%n>\n"
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1498
 )
214
f4234e15d891 Fix prompt format (prompt and text stay on two line, not one).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 211
diff changeset
  1499
675
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1500
(let ( (mgs-list '("Я тутачки, а где Вы меня ожидали?"
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1501
                   "Software Development == Church Development. Step 1. Build it. Step 2. Pray."
680
285d2ffb35ff Update jabber motd.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 677
diff changeset
  1502
                   "Great books aren't written – they're rewritten."
675
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1503
                   "А любит Б, Б любит С, что делать A? Найти другую Б!")) )
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1504
  (random t)
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1505
  (setq jabber-default-show (nth (random (length mgs-list)) mgs-list))
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1506
  (setq jabber-default-status (nth (random (length mgs-list)) mgs-list))
182
8a8bf4f3e7c2 Correctly set fsm var.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 181
diff changeset
  1507
  )
83
d2eaf2ed6d1c Added basic jabber customization.
gavenkoa@gavenko.bifit.int
parents: 82
diff changeset
  1508
516
efa00a6ef34e Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 515
diff changeset
  1509
(defvar my-jabber-users nil
533
15b63e0cc424 Document some settings from .emacs-pre/-post.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 532
diff changeset
  1510
  "Assoc list of jabber user group. Keys are strings, values are lists of JIDs.")
516
efa00a6ef34e Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 515
diff changeset
  1511
efa00a6ef34e Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 515
diff changeset
  1512
(defun my-jabber-send (group)
efa00a6ef34e Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 515
diff changeset
  1513
  "GROUP is keys from `my-jabber-users'"
efa00a6ef34e Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 515
diff changeset
  1514
  (interactive
efa00a6ef34e Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 515
diff changeset
  1515
   (list (completing-read "Select group: " my-jabber-users))
efa00a6ef34e Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 515
diff changeset
  1516
   )
efa00a6ef34e Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 515
diff changeset
  1517
  (let (
efa00a6ef34e Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 515
diff changeset
  1518
        (msg (if (use-region-p)
efa00a6ef34e Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 515
diff changeset
  1519
                 (buffer-substring (region-beginning) (region-end))
efa00a6ef34e Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 515
diff changeset
  1520
               (buffer-string)))
efa00a6ef34e Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 515
diff changeset
  1521
        (jc (jabber-read-account))
efa00a6ef34e Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 515
diff changeset
  1522
        )
efa00a6ef34e Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 515
diff changeset
  1523
    (deactivate-mark)
efa00a6ef34e Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 515
diff changeset
  1524
    (mapc
efa00a6ef34e Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 515
diff changeset
  1525
     (lambda (user)
efa00a6ef34e Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 515
diff changeset
  1526
       (jabber-send-message jc user "" msg "normal")
efa00a6ef34e Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 515
diff changeset
  1527
       )
efa00a6ef34e Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 515
diff changeset
  1528
     (cdr (assoc group my-jabber-users))
efa00a6ef34e Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 515
diff changeset
  1529
     )
efa00a6ef34e Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 515
diff changeset
  1530
    )
efa00a6ef34e Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 515
diff changeset
  1531
  )
efa00a6ef34e Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 515
diff changeset
  1532
efa00a6ef34e Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 515
diff changeset
  1533
(global-set-key (kbd "C-x C-j C-s") 'my-jabber-send)
efa00a6ef34e Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 515
diff changeset
  1534
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1535
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  1536
(message "rcirc")
142
adfc0c678483 Basic customisation for rcirc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 141
diff changeset
  1537
adfc0c678483 Basic customisation for rcirc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 141
diff changeset
  1538
;; Turn on logging everything to a special buffer, for debugging.
adfc0c678483 Basic customisation for rcirc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 141
diff changeset
  1539
;; (setq rcirc-debug-flag t)
adfc0c678483 Basic customisation for rcirc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 141
diff changeset
  1540
adfc0c678483 Basic customisation for rcirc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 141
diff changeset
  1541
(add-hook 'rcirc-mode-hook (lambda () (rcirc-track-minor-mode 1)))
adfc0c678483 Basic customisation for rcirc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 141
diff changeset
  1542
(setq rcirc-time-format "%H:%M ")
adfc0c678483 Basic customisation for rcirc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 141
diff changeset
  1543
(defun rcirc-handler-301 (process cmd sender args)
adfc0c678483 Basic customisation for rcirc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 141
diff changeset
  1544
  "/away message handler.")
adfc0c678483 Basic customisation for rcirc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 141
diff changeset
  1545
532
a77d1bbd676c Set conection/login info for rcirc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 531
diff changeset
  1546
(setq rcirc-default-server "irc.freenode.net")
a77d1bbd676c Set conection/login info for rcirc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 531
diff changeset
  1547
(setq rcirc-default-port 6667)
a77d1bbd676c Set conection/login info for rcirc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 531
diff changeset
  1548
(setq rcirc-default-nick user-nick)
a77d1bbd676c Set conection/login info for rcirc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 531
diff changeset
  1549
(setq rcirc-default-user-full-name user-full-name)
a77d1bbd676c Set conection/login info for rcirc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 531
diff changeset
  1550
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1551
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  1552
(message "erc")
239
408ebfd38be3 Set default erc encoding to utf-8 because on Windows I have default coding - cp1251.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 238
diff changeset
  1553
639
3e66a9605c4f erc-notify-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 638
diff changeset
  1554
;; (add-to-list 'erc-modules 'notify)
3e66a9605c4f erc-notify-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 638
diff changeset
  1555
;; (setq erc-notify-list '(""))
3e66a9605c4f erc-notify-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 638
diff changeset
  1556
377
3e8792ee03cc Take off noise message from erc in notify.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 376
diff changeset
  1557
;; Take off noise message.
3e8792ee03cc Take off noise message from erc in notify.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 376
diff changeset
  1558
(setq erc-track-exclude-types '("JOIN" "PART" "QUIT" "NICK" "MODE"))
3e8792ee03cc Take off noise message from erc in notify.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 376
diff changeset
  1559
3e8792ee03cc Take off noise message from erc in notify.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 376
diff changeset
  1560
(setq erc-current-nick-highlight-type 'nick-or-keyword)
3e8792ee03cc Take off noise message from erc in notify.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 376
diff changeset
  1561
(setq erc-track-use-faces t)
3e8792ee03cc Take off noise message from erc in notify.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 376
diff changeset
  1562
239
408ebfd38be3 Set default erc encoding to utf-8 because on Windows I have default coding - cp1251.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 238
diff changeset
  1563
(setq erc-server-coding-system 'utf-8)
860
934358ccdc16 Disable coding for ICQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 858
diff changeset
  1564
;; (setq erc-encoding-coding-alist
934358ccdc16 Disable coding for ICQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 858
diff changeset
  1565
;;       '(
934358ccdc16 Disable coding for ICQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 858
diff changeset
  1566
;;         ("^icq-" . cp1251)
934358ccdc16 Disable coding for ICQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 858
diff changeset
  1567
;;         ))
634
97785d982806 erc-encoding-coding-alist, erc-autojoin-channels-alist
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 632
diff changeset
  1568
97785d982806 erc-encoding-coding-alist, erc-autojoin-channels-alist
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 632
diff changeset
  1569
(setq erc-autojoin-channels-alist '(("freenode.net" "#emacs")))
239
408ebfd38be3 Set default erc encoding to utf-8 because on Windows I have default coding - cp1251.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 238
diff changeset
  1570
637
f4806bc22860 Enable reconnect facility for ERC.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 636
diff changeset
  1571
(setq
f4806bc22860 Enable reconnect facility for ERC.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 636
diff changeset
  1572
 erc-server-auto-reconnect t
f4806bc22860 Enable reconnect facility for ERC.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 636
diff changeset
  1573
 erc-server-reconnect-timeout 60
f4806bc22860 Enable reconnect facility for ERC.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 636
diff changeset
  1574
 erc-server-reconnect-attempts 2
f4806bc22860 Enable reconnect facility for ERC.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 636
diff changeset
  1575
 )
f4806bc22860 Enable reconnect facility for ERC.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 636
diff changeset
  1576
636
1c47e3a86feb Add commented settings for remember.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 635
diff changeset
  1577
;; Kill buffers for channels after /part
1c47e3a86feb Add commented settings for remember.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 635
diff changeset
  1578
;; (setq erc-kill-buffer-on-part t)
1c47e3a86feb Add commented settings for remember.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 635
diff changeset
  1579
;; Kill buffers for private queries after quitting the server
1c47e3a86feb Add commented settings for remember.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 635
diff changeset
  1580
;; (setq erc-kill-queries-on-quit t)
1c47e3a86feb Add commented settings for remember.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 635
diff changeset
  1581
;; Kill buffers for server messages after quitting the server
1c47e3a86feb Add commented settings for remember.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 635
diff changeset
  1582
;; (setq erc-kill-server-buffer-on-quit t)
1c47e3a86feb Add commented settings for remember.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 635
diff changeset
  1583
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1584
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
648
6486ccef8fd1 `-b' switch to ignore changes in whitespaces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 647
diff changeset
  1585
(message "vc-mode, VCS, version control, cvs, svn, mercurial, hg, bazaar, bzr, git, fossil")
6486ccef8fd1 `-b' switch to ignore changes in whitespaces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 647
diff changeset
  1586
6486ccef8fd1 `-b' switch to ignore changes in whitespaces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 647
diff changeset
  1587
;; `-b' switch to ignore changes in whitespaces.
6486ccef8fd1 `-b' switch to ignore changes in whitespaces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 647
diff changeset
  1588
;; (setq vc-git-diff-switches "-b")
6486ccef8fd1 `-b' switch to ignore changes in whitespaces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 647
diff changeset
  1589
;; (setq vc-diff-switches "-b")
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1590
615
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1591
(when (equal window-system 'w32)
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1592
  (modify-coding-system-alist 'process "cvs" '(cp1251-dos . cp1251-dos))
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1593
  (modify-coding-system-alist 'process "svn" '(cp1251 . cp1251))
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1594
  (setq vc-svn-checkin-switches '("--encoding" "UTF-8"))
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1595
  )
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1596
615
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1597
(when window-system
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1598
  (setq
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1599
   vc-annotate-very-old-color "#0b5b20"
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1600
   vc-annotate-background "white"
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1601
   vc-annotate-color-map
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1602
   '(
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1603
     (20 .  "#EE0000")
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1604
     (40 .  "#E0800D")
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1605
     (60 .  "#D3001A")
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1606
     (80 .  "#C68027")
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1607
     (100 . "#B90034")
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1608
     (120 . "#AB8042")
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1609
     (140 . "#9E004F")
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1610
     (160 . "#91805C")
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1611
     (180 . "#840069")
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1612
     (200 . "#778077")
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1613
     (220 . "#690084")
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1614
     (240 . "#5C8091")
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1615
     (260 . "#4F009E")
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1616
     (280 . "#4280AB")
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1617
     (300 . "#3400B9")
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1618
     (320 . "#2780C6")
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1619
     (340 . "#1A00D3")
22cf0c9014d9 Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
  1620
     (360 . "#0D80E0")))
19
a8e7a6e94341 Теперь белый фон для annotated.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 18
diff changeset
  1621
  )
a8e7a6e94341 Теперь белый фон для annotated.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 18
diff changeset
  1622
767
47c2dbdb69dd Set fill-column for "Log-Edit" buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 766
diff changeset
  1623
(defun my-log-edit-mode-hook ()
47c2dbdb69dd Set fill-column for "Log-Edit" buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 766
diff changeset
  1624
  (setq fill-column 78)
47c2dbdb69dd Set fill-column for "Log-Edit" buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 766
diff changeset
  1625
  )
47c2dbdb69dd Set fill-column for "Log-Edit" buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 766
diff changeset
  1626
(add-hook 'log-edit-mode-hook 'my-log-edit-mode-hook t)
47c2dbdb69dd Set fill-column for "Log-Edit" buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 766
diff changeset
  1627
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1628
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  1629
(message "psvn")
296
e502c69ab80a Make header name like tags, separated by comma and ended on period.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 295
diff changeset
  1630
197
2abcea5b91db Added settings for psvn.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 192
diff changeset
  1631
(setq svn-status-verbose t)
2abcea5b91db Added settings for psvn.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 192
diff changeset
  1632
(setq svn-status-hide-unmodified t)
2abcea5b91db Added settings for psvn.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 192
diff changeset
  1633
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1634
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  1635
(message "DVC")
91
0eb9d7ee4bec Don't show dvc tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 90
diff changeset
  1636
0eb9d7ee4bec Don't show dvc tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 90
diff changeset
  1637
(when (featurep 'dvc-emacs)
0eb9d7ee4bec Don't show dvc tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 90
diff changeset
  1638
  (setq dvc-tips-enabled nil)
0eb9d7ee4bec Don't show dvc tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 90
diff changeset
  1639
  )
0eb9d7ee4bec Don't show dvc tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 90
diff changeset
  1640
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1641
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  1642
(message "devel, prog, programming")
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1643
643
bfb236f0ef44 Show current function name in the mode line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 642
diff changeset
  1644
(which-func-mode 1)
bfb236f0ef44 Show current function name in the mode line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 642
diff changeset
  1645
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1646
(add-to-list 'auto-mode-alist '("\\.cu$" . c-mode))
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1647
499
c3390bcde246 C and C++ both use .h extension for headers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 497
diff changeset
  1648
(defun my-c++-header-file-p ()
c3390bcde246 C and C++ both use .h extension for headers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 497
diff changeset
  1649
  "Return non-nil, if in a C++ header."
c3390bcde246 C and C++ both use .h extension for headers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 497
diff changeset
  1650
  (and (string-match "\\.h$"
c3390bcde246 C and C++ both use .h extension for headers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 497
diff changeset
  1651
                     (or (buffer-file-name)
c3390bcde246 C and C++ both use .h extension for headers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 497
diff changeset
  1652
                         (buffer-name)))
c3390bcde246 C and C++ both use .h extension for headers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 497
diff changeset
  1653
       (save-excursion
c3390bcde246 C and C++ both use .h extension for headers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 497
diff changeset
  1654
         (re-search-forward "\\_<class\\_>" nil t))))
c3390bcde246 C and C++ both use .h extension for headers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 497
diff changeset
  1655
613
1e7314bb84bc Fix loading error for Emacs 21.3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 612
diff changeset
  1656
(when (>= emacs-major-version 22)
1e7314bb84bc Fix loading error for Emacs 21.3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 612
diff changeset
  1657
  (add-to-list 'magic-mode-alist '(my-c++-header-file-p . c++-mode))
1e7314bb84bc Fix loading error for Emacs 21.3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 612
diff changeset
  1658
  )
499
c3390bcde246 C and C++ both use .h extension for headers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 497
diff changeset
  1659
172
fcea80b465b9 Comment customisation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 167
diff changeset
  1660
(setq-default comment-style (quote indent))
fcea80b465b9 Comment customisation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 167
diff changeset
  1661
(setq-default comment-column 44)
335
748c6e05fe87 Use common value for fill-column.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 334
diff changeset
  1662
(setq-default comment-fill-column my-fill-column)
54
d8b07256d33c Clean TAB manage code.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 53
diff changeset
  1663
337
17e3c74b7c22 Use variable my-devel-mode-hook-list so easy adds new devel modes in one
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 336
diff changeset
  1664
(mapc (lambda (hook) (add-hook hook (lambda () (setq fill-column my-fill-column)) ))
682
c80875ec8ad3 Remove text modes from devel mode list as it can not supprt imenu.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 681
diff changeset
  1665
      (append my-devel-mode-hook-list my-text-mode-hook-list))
201
8531f8af6528 Allow long line coment in c/lisp code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 200
diff changeset
  1666
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1667
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  1668
(message "diff, patch, ediff, emerge")
296
e502c69ab80a Make header name like tags, separated by comma and ended on period.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 295
diff changeset
  1669
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1670
(setq diff-switches "-u")
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1671
420
71e5a962381e Group related settings in one place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 418
diff changeset
  1672
(setq ediff-diff-options "")
497
1848e3b1fc00 Set 'ediff-custom-diff-options'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 496
diff changeset
  1673
(setq ediff-custom-diff-options "-u")
420
71e5a962381e Group related settings in one place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 418
diff changeset
  1674
714
29d5bc4953c6 Use different colors for added and removed lines in diff mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 713
diff changeset
  1675
(when window-system
29d5bc4953c6 Use different colors for added and removed lines in diff mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 713
diff changeset
  1676
  (eval-after-load 'diff-mode
29d5bc4953c6 Use different colors for added and removed lines in diff mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 713
diff changeset
  1677
    '(progn
29d5bc4953c6 Use different colors for added and removed lines in diff mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 713
diff changeset
  1678
       (set-face-foreground 'diff-added-face "DarkGreen")
29d5bc4953c6 Use different colors for added and removed lines in diff mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 713
diff changeset
  1679
       (set-face-foreground 'diff-removed-face "DarkRed")
29d5bc4953c6 Use different colors for added and removed lines in diff mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 713
diff changeset
  1680
  )))
29d5bc4953c6 Use different colors for added and removed lines in diff mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 713
diff changeset
  1681
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1682
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  1683
(message "indenting")
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1684
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1685
(setq standard-indent 4)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1686
(setq c-basic-offset 4)
22
8ca8997d9f1d Определил размер отступа для sh-mode.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 21
diff changeset
  1687
(setq sh-basic-offset 2)
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1688
(setq sgml-basic-offset 4)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1689
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1690
;; TAB (tab settings)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1691
(setq-default tab-width 4)
253
7cb6ff8a9a75 Translate comment to English.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 252
diff changeset
  1692
(setq-default indent-tabs-mode nil)     ; spaces instead of tabs by default
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1693
(setq tab-always-indent t)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1694
(setq c-tab-always-indent t)
188
e36736f245fd Start tab-stop-list with zero.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 162
diff changeset
  1695
(let ( (line-width 400) i )
e36736f245fd Start tab-stop-list with zero.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 162
diff changeset
  1696
  (setq i (* (ceiling line-width 4) 4))
73
73e42aa11b3c Correct initial asigned with nil.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 72
diff changeset
  1697
  (setq tab-stop-list nil)
188
e36736f245fd Start tab-stop-list with zero.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 162
diff changeset
  1698
  (while (>= i 0)
e36736f245fd Start tab-stop-list with zero.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 162
diff changeset
  1699
    (setq tab-stop-list (cons i tab-stop-list))
e36736f245fd Start tab-stop-list with zero.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 162
diff changeset
  1700
    (setq i (- i 4))))
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1701
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1702
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  1703
(message "compile")
296
e502c69ab80a Make header name like tags, separated by comma and ended on period.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 295
diff changeset
  1704
647
993160feda92 Add docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 646
diff changeset
  1705
;; Prompt for compilation command.
993160feda92 Add docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 646
diff changeset
  1706
(setq compilation-read-command 1)
638
5bfd6f2d1ae7 Use gmake on FreeBSD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 637
diff changeset
  1707
(setq compile-auto-highlight t)
5bfd6f2d1ae7 Use gmake on FreeBSD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 637
diff changeset
  1708
(setq compile-command "make ")
5bfd6f2d1ae7 Use gmake on FreeBSD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 637
diff changeset
  1709
(when (eq system-type 'berkeley-unix)
5bfd6f2d1ae7 Use gmake on FreeBSD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 637
diff changeset
  1710
  (setq compile-command "gmake "))
646
6c2682a5d81e Add comment.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 645
diff changeset
  1711
;; With '1' compilation window shall scroll down, with `first-error' stops scrolling at the first error.
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1712
(setq compilation-scroll-output 1)
684
f0604e71f261 compilation-ask-about-save
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 683
diff changeset
  1713
(setq compilation-ask-about-save t)
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1714
577
d24848aec7d1 Show error in EN locale to easy search how fix problem in docs and Internet.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 564
diff changeset
  1715
;; Show error in EN locale to easy search how fix problem in docs and Internet.
d24848aec7d1 Show error in EN locale to easy search how fix problem in docs and Internet.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 564
diff changeset
  1716
(setq compilation-environment '("LANG=C"))
d24848aec7d1 Show error in EN locale to easy search how fix problem in docs and Internet.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 564
diff changeset
  1717
552
1cdd21e5f0b9 Set compilation-error-regexp-alist after loading 'compile.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 551
diff changeset
  1718
(eval-after-load 'compile
556
782325bafc4a Fix 'eval-after-load' usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 555
diff changeset
  1719
  '(progn
782325bafc4a Fix 'eval-after-load' usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 555
diff changeset
  1720
     ;; My funny error messages.
782325bafc4a Fix 'eval-after-load' usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 555
diff changeset
  1721
     (add-to-list 'compilation-error-regexp-alist '("^\\( +\\[csc\\] \\|\\)\\(.*\\)(\\([0-9]*\\),\\([0-9]*\\)):" 2 3 4))
782325bafc4a Fix 'eval-after-load' usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 555
diff changeset
  1722
     (add-to-list 'compilation-error-regexp-alist '("^ *\\(.*\\)(\\([0-9]*\\)) +:" 1 2))
782325bafc4a Fix 'eval-after-load' usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 555
diff changeset
  1723
     (add-to-list 'compilation-error-regexp-alist '("^\"?\\([^\"]*\\)\"?,\\([0-9]*\\) .*\\[.*\\]: " 1 2)) ; KEIL compiler
782325bafc4a Fix 'eval-after-load' usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 555
diff changeset
  1724
     (when (boundp 'compilation-mode-font-lock-keywords)
782325bafc4a Fix 'eval-after-load' usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 555
diff changeset
  1725
       (add-to-list 'compilation-mode-font-lock-keywords '("\\(/[Oo][Uu][Tt]:[^[:blank:]]+\\)" . 1))
782325bafc4a Fix 'eval-after-load' usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 555
diff changeset
  1726
       (add-to-list 'compilation-mode-font-lock-keywords '("[[:blank:]]\\(/F[oe][^[:blank:]]+\\)" . 1))
782325bafc4a Fix 'eval-after-load' usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 555
diff changeset
  1727
       )
782325bafc4a Fix 'eval-after-load' usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 555
diff changeset
  1728
     ))
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1729
672
ec015b06e121 my-comint-send-string
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 670
diff changeset
  1730
(defvar my-comint-send-hist-list nil
ec015b06e121 my-comint-send-string
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 670
diff changeset
  1731
  "History list for `my-comint-send-string'."
ec015b06e121 my-comint-send-string
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 670
diff changeset
  1732
  )
ec015b06e121 my-comint-send-string
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 670
diff changeset
  1733
(defun my-comint-send-string (string)
704
474a9291a602 Automaticaly append final newline.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 703
diff changeset
  1734
  "Send string to comint buffers. Useful for *compilation* read-only buffer.
474a9291a602 Automaticaly append final newline.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 703
diff changeset
  1735
Automaticaly append final newline."
672
ec015b06e121 my-comint-send-string
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 670
diff changeset
  1736
  (interactive
ec015b06e121 my-comint-send-string
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 670
diff changeset
  1737
   (list (read-input "Type string: " nil 'my-comint-send-hist-list))
ec015b06e121 my-comint-send-string
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 670
diff changeset
  1738
   )
704
474a9291a602 Automaticaly append final newline.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 703
diff changeset
  1739
  (comint-send-string (get-buffer-process (current-buffer)) (concat string "\n"))
672
ec015b06e121 my-comint-send-string
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 670
diff changeset
  1740
  )
674
f3ac6416ef21 Fix: "Symbol's value as variable is void: compilation-mode-map".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 673
diff changeset
  1741
(eval-after-load 'compile
f3ac6416ef21 Fix: "Symbol's value as variable is void: compilation-mode-map".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 673
diff changeset
  1742
  '(progn
f3ac6416ef21 Fix: "Symbol's value as variable is void: compilation-mode-map".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 673
diff changeset
  1743
     (define-key compilation-mode-map [C-return] 'my-comint-send-string)
f3ac6416ef21 Fix: "Symbol's value as variable is void: compilation-mode-map".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 673
diff changeset
  1744
     ))
672
ec015b06e121 my-comint-send-string
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 670
diff changeset
  1745
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1746
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  1747
(message "TAGS, etags, ctags, GNU GLOBAL")
421
44d516f2badd Enable automatic depth up search for TAGS file when 'etags-table' available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 420
diff changeset
  1748
529
1d38dfff2664 Add 'etags-select' and 'etags-table' customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 528
diff changeset
  1749
;; One of 'tags-table-list' or 'tags-file-name' control which TAGS files to
1d38dfff2664 Add 'etags-select' and 'etags-table' customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 528
diff changeset
  1750
;; use.
1d38dfff2664 Add 'etags-select' and 'etags-table' customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 528
diff changeset
  1751
675
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1752
(ignore-errors
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1753
  (require 'etags-table)
529
1d38dfff2664 Add 'etags-select' and 'etags-table' customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 528
diff changeset
  1754
  (setq etags-table-search-up-depth 8)
675
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1755
  (require 'etags-select)
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1756
  (global-set-key "\M-." 'etags-select-find-tag)
421
44d516f2badd Enable automatic depth up search for TAGS file when 'etags-table' available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 420
diff changeset
  1757
  )
44d516f2badd Enable automatic depth up search for TAGS file when 'etags-table' available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 420
diff changeset
  1758
675
7bef62461084 Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
  1759
(setq tags-add-tables t)
541
3d913b8531f4 Bound 'complete-tag' to M-RET.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 539
diff changeset
  1760
(global-set-key "\M-\r" 'complete-tag)
3d913b8531f4 Bound 'complete-tag' to M-RET.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 539
diff changeset
  1761
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1762
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  1763
(message "CEDET, semantic")
422
021017e52754 Enable 'semantic' for Emacs 23.2.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 421
diff changeset
  1764
425
b835c68d20a8 Added more semantic customisation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 424
diff changeset
  1765
;; For debug use 'semantic-debug-idle-function' and 'semantic-debug-idle-work-function'.
454
18ce601cb4fb Enable CEDET which custom installed.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 453
diff changeset
  1766
18ce601cb4fb Enable CEDET which custom installed.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 453
diff changeset
  1767
(unless (featurep 'cedet)
626
a759aa107534 Enable 'semantc'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 625
diff changeset
  1768
  (when (or
a759aa107534 Enable 'semantc'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 625
diff changeset
  1769
         (and (= emacs-major-version 23) (>= emacs-minor-version 2))
a759aa107534 Enable 'semantc'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 625
diff changeset
  1770
         (>= emacs-minor-version 24)
a759aa107534 Enable 'semantc'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 625
diff changeset
  1771
         )
a759aa107534 Enable 'semantc'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 625
diff changeset
  1772
    (semantic-mode 1)
a759aa107534 Enable 'semantc'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 625
diff changeset
  1773
    ) )
454
18ce601cb4fb Enable CEDET which custom installed.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 453
diff changeset
  1774
18ce601cb4fb Enable CEDET which custom installed.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 453
diff changeset
  1775
(when (featurep 'cedet)
458
48aa731d00d8 Always anable ede-mode if semantic present.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 457
diff changeset
  1776
  (global-ede-mode t)
422
021017e52754 Enable 'semantic' for Emacs 23.2.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 421
diff changeset
  1777
  (global-semantic-idle-summary-mode 1)
425
b835c68d20a8 Added more semantic customisation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 424
diff changeset
  1778
  (global-semantic-idle-scheduler-mode 1)
426
56e15e68d925 Set low idle time to less wait for type info in minibuffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 425
diff changeset
  1779
  (setq semantic-idle-scheduler-idle-time 1) ; 1 sec.
425
b835c68d20a8 Added more semantic customisation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 424
diff changeset
  1780
  (global-semantic-decoration-mode 1)
b835c68d20a8 Added more semantic customisation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 424
diff changeset
  1781
  (global-semantic-mru-bookmark-mode 1)
b835c68d20a8 Added more semantic customisation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 424
diff changeset
  1782
  ;; (setq semantic-stickyfunc-sticky-classes '(function type variable include package))
456
7b13bdbb2d0e Explicitly disable 'global-semantic-stickyfunc-mode' for manually installed CEDET.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 455
diff changeset
  1783
  (global-semantic-stickyfunc-mode -1)
7b13bdbb2d0e Explicitly disable 'global-semantic-stickyfunc-mode' for manually installed CEDET.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 455
diff changeset
  1784
  (global-semantic-idle-completions-mode -1)
425
b835c68d20a8 Added more semantic customisation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 424
diff changeset
  1785
466
71d60f805984 Make larger time for heavy idle-scheduler-work.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 465
diff changeset
  1786
  (setq semantic-idle-scheduler-work-idle-time 60)
71d60f805984 Make larger time for heavy idle-scheduler-work.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 465
diff changeset
  1787
  ;; (setq semantic-idle-work-parse-neighboring-files-flag nil)
71d60f805984 Make larger time for heavy idle-scheduler-work.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 465
diff changeset
  1788
450
53773da85b43 Magic for semantic-add-system-include. Previous not worked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 443
diff changeset
  1789
  ;; semantic-dependency-system-include-path, semantic-customize-system-include-path
626
a759aa107534 Enable 'semantc'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 625
diff changeset
  1790
a759aa107534 Enable 'semantc'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 625
diff changeset
  1791
  ;; file local project unloaded system recursive
a759aa107534 Enable 'semantc'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 625
diff changeset
  1792
  (setq-mode-local c-mode semanticdb-find-default-throttle '(file))
447
fde6ee13fce1 Use '~/.emacs.d/include' as place for headers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 446
diff changeset
  1793
  (add-hook 'c-mode-hook (lambda nil (semantic-add-system-include "~/.emacs.d/include" 'c-mode)))
fde6ee13fce1 Use '~/.emacs.d/include' as place for headers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 446
diff changeset
  1794
  (add-hook 'c-mode-hook (lambda nil (semantic-add-system-include "~/.emacs.d/include" 'c++-mode)))
443
8c5d0e026821 Set my path for headers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 442
diff changeset
  1795
  (global-semanticdb-minor-mode 1)
8c5d0e026821 Set my path for headers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 442
diff changeset
  1796
626
a759aa107534 Enable 'semantc'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 625
diff changeset
  1797
  ;; (add-to-list 'ede-locate-setup-options 'ede-locate-idutils)
a759aa107534 Enable 'semantc'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 625
diff changeset
  1798
  ;; (add-to-list 'ede-locate-setup-options 'ede-locate-global)
a759aa107534 Enable 'semantc'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 625
diff changeset
  1799
630
2dc36a3fdde6 Temporary disable cedet-global and cedet-idutils as GNU Global and IdUtils may
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 629
diff changeset
  1800
  ;; (ignore-errors (require 'cedet-idutils))
2dc36a3fdde6 Temporary disable cedet-global and cedet-idutils as GNU Global and IdUtils may
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 629
diff changeset
  1801
  ;; (when (ignore-errors (require 'cedet-global))
2dc36a3fdde6 Temporary disable cedet-global and cedet-idutils as GNU Global and IdUtils may
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 629
diff changeset
  1802
  ;;   (semanticdb-enable-gnu-global-databases 'c-mode)
2dc36a3fdde6 Temporary disable cedet-global and cedet-idutils as GNU Global and IdUtils may
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 629
diff changeset
  1803
  ;;   (semanticdb-enable-gnu-global-databases 'c++-mode)
2dc36a3fdde6 Temporary disable cedet-global and cedet-idutils as GNU Global and IdUtils may
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 629
diff changeset
  1804
  ;;   )
470
f859726fcca9 Enable GNU Global and GNU ID utils for EDE.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 469
diff changeset
  1805
442
bf31b8f54b4a Set funny key binding for analyzer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 439
diff changeset
  1806
  (global-set-key (kbd "C-c , .") 'semantic-ia-fast-jump)
bf31b8f54b4a Set funny key binding for analyzer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 439
diff changeset
  1807
  (global-set-key (kbd "C-c , d") 'semantic-ia-show-doc)
bf31b8f54b4a Set funny key binding for analyzer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 439
diff changeset
  1808
  (global-set-key (kbd "C-c , D") 'semantic-ia-describe-class)
459
71e9734f6569 Bind key sequence for semantic-ia-complete-symbol-menu.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 458
diff changeset
  1809
  (global-set-key (kbd "C-c , c") 'semantic-ia-complete-symbol-menu)
422
021017e52754 Enable 'semantic' for Emacs 23.2.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 421
diff changeset
  1810
  )
021017e52754 Enable 'semantic' for Emacs 23.2.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 421
diff changeset
  1811
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1812
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  1813
(message "imenu")
428
6e8b3a312262 Allow imenu function if manu-bar-mode disabled (becase in that case
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 427
diff changeset
  1814
652
243f52487da7 Always enable 'imenu'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 650
diff changeset
  1815
(defun my-imenu-to-menubar ()
243f52487da7 Always enable 'imenu'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 650
diff changeset
  1816
  (imenu-add-menubar-index)
243f52487da7 Always enable 'imenu'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 650
diff changeset
  1817
  (run-hooks 'menu-bar-update-hook)
428
6e8b3a312262 Allow imenu function if manu-bar-mode disabled (becase in that case
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 427
diff changeset
  1818
  )
6e8b3a312262 Allow imenu function if manu-bar-mode disabled (becase in that case
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 427
diff changeset
  1819
652
243f52487da7 Always enable 'imenu'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 650
diff changeset
  1820
(require 'imenu)
243f52487da7 Always enable 'imenu'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 650
diff changeset
  1821
(mapc (lambda (hook) (add-hook hook 'my-imenu-to-menubar))
243f52487da7 Always enable 'imenu'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 650
diff changeset
  1822
      my-devel-mode-hook-list)
243f52487da7 Always enable 'imenu'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 650
diff changeset
  1823
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1824
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  1825
(message "windows inf files for driver installin")
303
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 288 302
diff changeset
  1826
288
5009c3f4afef Windows inf files for installing drivers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 285
diff changeset
  1827
(add-to-list 'auto-mode-alist '("\\.inf\\'" . conf-mode))
5009c3f4afef Windows inf files for installing drivers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 285
diff changeset
  1828
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1829
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  1830
(message "makefile, make")
196
154d8ebf534b Added matches for makefile-gmake-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 192
diff changeset
  1831
762
a4787876e986 Down priority for Makefile pattern to allow match .diff/.rej first.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 761
diff changeset
  1832
(add-to-list 'auto-mode-alist '("\\(Makefile\\|Makefile\\..+\\)\\'" . makefile-gmake-mode) t)
196
154d8ebf534b Added matches for makefile-gmake-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 192
diff changeset
  1833
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1834
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  1835
(message "asm, assembler")
296
e502c69ab80a Make header name like tags, separated by comma and ended on period.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 295
diff changeset
  1836
36
4261883ccdb6 Use C-style comment in asm files.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 35
diff changeset
  1837
;; (setq-default asm-comment-char 59)
4261883ccdb6 Use C-style comment in asm files.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 35
diff changeset
  1838
(add-hook 'asm-mode-hook '(lambda () (setq comment-start "/*") (setq comment-end "*/")) t)
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1839
186
8c74e1ac4da1 Added association for IAR asm file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 185
diff changeset
  1840
(add-to-list 'auto-mode-alist '("\\.\\([sS]79\\|[sS]\\)\\'" . asm-mode))
8c74e1ac4da1 Added association for IAR asm file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 185
diff changeset
  1841
176
69d65b8a0a25 Added example for unset-key.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 175
diff changeset
  1842
;; (add-hook 'asm-mode-hook '(lambda () (local-unset-key ":")))
69d65b8a0a25 Added example for unset-key.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 175
diff changeset
  1843
;; (add-hook 'asm-mode-hook '(lambda () (local-set-key ":" ":")))
69d65b8a0a25 Added example for unset-key.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 175
diff changeset
  1844
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1845
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  1846
(message "linker")
272
f7fba93f4028 Enable file association for myself defined modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 266
diff changeset
  1847
f7fba93f4028 Enable file association for myself defined modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 266
diff changeset
  1848
(when (fboundp 'iar-linker-config-mode)
f7fba93f4028 Enable file association for myself defined modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 266
diff changeset
  1849
  (add-to-list 'auto-mode-alist '("\\.icf\\'" . iar-linker-config-mode))
f7fba93f4028 Enable file association for myself defined modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 266
diff changeset
  1850
  )
f7fba93f4028 Enable file association for myself defined modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 266
diff changeset
  1851
(when (fboundp 'iar4-linker-config-mode)
f7fba93f4028 Enable file association for myself defined modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 266
diff changeset
  1852
  (add-to-list 'auto-mode-alist '("\\.xcl\\'" . iar4-linker-config-mode))
f7fba93f4028 Enable file association for myself defined modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 266
diff changeset
  1853
  )
f7fba93f4028 Enable file association for myself defined modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 266
diff changeset
  1854
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1855
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
602
e8242148f3dd Enable 'turn-on-eldoc-mode'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 601
diff changeset
  1856
(message "lisp, elisp")
296
e502c69ab80a Make header name like tags, separated by comma and ended on period.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 295
diff changeset
  1857
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1858
(setq list-command-history-max 256)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1859
602
e8242148f3dd Enable 'turn-on-eldoc-mode'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 601
diff changeset
  1860
(add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode)
610
9af87adeed3c Try find variable at point, if fail find function in 'emacs-lisp-mode'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 609
diff changeset
  1861
9af87adeed3c Try find variable at point, if fail find function in 'emacs-lisp-mode'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 609
diff changeset
  1862
(defun my-elisp-find-tag ()
9af87adeed3c Try find variable at point, if fail find function in 'emacs-lisp-mode'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 609
diff changeset
  1863
  (interactive)
629
f441ee5e03d4 Fix error: my-elisp-find-tag: Symbol's value as variable is void: find-tag-marker-ring
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 628
diff changeset
  1864
  (require 'etags)
614
41c826f2b24f Save place from which we jump.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 613
diff changeset
  1865
  (ring-insert find-tag-marker-ring (point-marker))
610
9af87adeed3c Try find variable at point, if fail find function in 'emacs-lisp-mode'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 609
diff changeset
  1866
  (unless (find-variable-at-point)
9af87adeed3c Try find variable at point, if fail find function in 'emacs-lisp-mode'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 609
diff changeset
  1867
    (find-function-at-point)
9af87adeed3c Try find variable at point, if fail find function in 'emacs-lisp-mode'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 609
diff changeset
  1868
    ))
603
291a8df0cf97 Goto elisp definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 602
diff changeset
  1869
;; Goto elisp definition.
610
9af87adeed3c Try find variable at point, if fail find function in 'emacs-lisp-mode'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 609
diff changeset
  1870
(define-key emacs-lisp-mode-map (kbd "M-.") 'my-elisp-find-tag)
602
e8242148f3dd Enable 'turn-on-eldoc-mode'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 601
diff changeset
  1871
608
9bbdc481172e http://www.emacswiki.org/emacs/PrettyLambda
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 607
diff changeset
  1872
;; http://www.emacswiki.org/emacs/PrettyLambda
9bbdc481172e http://www.emacswiki.org/emacs/PrettyLambda
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 607
diff changeset
  1873
(font-lock-add-keywords
9bbdc481172e http://www.emacswiki.org/emacs/PrettyLambda
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 607
diff changeset
  1874
 'emacs-lisp-mode
9bbdc481172e http://www.emacswiki.org/emacs/PrettyLambda
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 607
diff changeset
  1875
 `(
9bbdc481172e http://www.emacswiki.org/emacs/PrettyLambda
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 607
diff changeset
  1876
   ("(\\<\\(lambda\\)\\>"
9bbdc481172e http://www.emacswiki.org/emacs/PrettyLambda
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 607
diff changeset
  1877
    (1 (progn (compose-region (match-beginning 1) (match-end 1) ,(make-char 'greek-iso8859-7 107)) font-lock-keyword-face))
9bbdc481172e http://www.emacswiki.org/emacs/PrettyLambda
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 607
diff changeset
  1878
    )
9bbdc481172e http://www.emacswiki.org/emacs/PrettyLambda
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 607
diff changeset
  1879
   ))
9bbdc481172e http://www.emacswiki.org/emacs/PrettyLambda
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 607
diff changeset
  1880
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1881
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  1882
(message "C, c-mode, C++, c++-mode")
173
04b974b118c2 cc-mode customisations.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 172
diff changeset
  1883
645
f5a8fa2c4534 Minor mode that highlights suspicious C and C++ constructions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 644
diff changeset
  1884
;; Minor mode that highlights suspicious C and C++ constructions.
f5a8fa2c4534 Minor mode that highlights suspicious C and C++ constructions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 644
diff changeset
  1885
(cwarn-mode 1)
f5a8fa2c4534 Minor mode that highlights suspicious C and C++ constructions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 644
diff changeset
  1886
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1887
(setq c-echo-syntactic-information-p t)
710
49635ebf70f1 Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
  1888
49635ebf70f1 Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
  1889
(defun my-c-mode-common-hook ()
49635ebf70f1 Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
  1890
  ;; Automatically inserte newlines after special characters such as brace, comma, semi-colon, and colon.
823
c1c5a6b3255a Enable 'electric' and disable 'auto-newline' in C-like modes. Previously I
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 818
diff changeset
  1891
  (c-toggle-auto-newline -1)
710
49635ebf70f1 Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
  1892
  ;; Delete all preceding whitespace by DEL.
49635ebf70f1 Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
  1893
  (c-toggle-hungry-state -1)
711
c124c5e589af Enable electric new-line. Document auto indent after typing colon.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 710
diff changeset
  1894
  ;; Auto indent after typing colon according to `c-hanging-colons-alist'.
c124c5e589af Enable electric new-line. Document auto indent after typing colon.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 710
diff changeset
  1895
  (c-toggle-electric-state 1)
710
49635ebf70f1 Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
  1896
  )
49635ebf70f1 Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
  1897
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1898
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1899
(defconst my-c-style
129
23d028bad418 More regular indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 128
diff changeset
  1900
  '((c-tab-always-indent . t)
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1901
    (c-comment-only-line-offset . 4)
129
23d028bad418 More regular indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 128
diff changeset
  1902
    (c-hanging-braces-alist
131
bd2400a18295 Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 130
diff changeset
  1903
     . (
bd2400a18295 Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 130
diff changeset
  1904
        (brace-list-open)
bd2400a18295 Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 130
diff changeset
  1905
        (substatement-open after)
bd2400a18295 Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 130
diff changeset
  1906
        ))
129
23d028bad418 More regular indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 128
diff changeset
  1907
    (c-hanging-colons-alist
131
bd2400a18295 Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 130
diff changeset
  1908
     . (
bd2400a18295 Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 130
diff changeset
  1909
        (access-label after)
bd2400a18295 Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 130
diff changeset
  1910
        (case-label after)
129
23d028bad418 More regular indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 128
diff changeset
  1911
        (inher-intro)
23d028bad418 More regular indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 128
diff changeset
  1912
        (label after)
131
bd2400a18295 Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 130
diff changeset
  1913
        (member-init-intro before)
bd2400a18295 Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 130
diff changeset
  1914
        ))
129
23d028bad418 More regular indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 128
diff changeset
  1915
    (c-cleanup-list
131
bd2400a18295 Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 130
diff changeset
  1916
     . (
bd2400a18295 Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 130
diff changeset
  1917
        defun-close-semi
129
23d028bad418 More regular indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 128
diff changeset
  1918
        empty-defun-braces
131
bd2400a18295 Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 130
diff changeset
  1919
        scope-operator
bd2400a18295 Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 130
diff changeset
  1920
        ))
129
23d028bad418 More regular indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 128
diff changeset
  1921
    (c-offsets-alist
131
bd2400a18295 Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 130
diff changeset
  1922
     . (
712
b54c2306b184 Set indent level for privdate/public keywords.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 711
diff changeset
  1923
        (access-label . -)
485
28f82b8f4f46 Set 'arglist-close' to same indent level as 'arglist-intro' and 'arglist-cont-nonempty'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 484
diff changeset
  1924
        (arglist-intro . ++)
129
23d028bad418 More regular indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 128
diff changeset
  1925
        (arglist-cont-nonempty . ++)
485
28f82b8f4f46 Set 'arglist-close' to same indent level as 'arglist-intro' and 'arglist-cont-nonempty'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 484
diff changeset
  1926
        (arglist-close . ++)
131
bd2400a18295 Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 130
diff changeset
  1927
        (block-open . 0)
bd2400a18295 Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 130
diff changeset
  1928
        (case-label . 0)
562
f277076ade00 Don't indent first LEFT CURLY BRACKET on new line of macros.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 561
diff changeset
  1929
        (cpp-define-intro . 0)
131
bd2400a18295 Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 130
diff changeset
  1930
        (comment-intro . 0)
bd2400a18295 Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 130
diff changeset
  1931
        (func-decl-cont . ++)
129
23d028bad418 More regular indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 128
diff changeset
  1932
        (inexpr-class . 0)
131
bd2400a18295 Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 130
diff changeset
  1933
        (inline-open . 0)
bd2400a18295 Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 130
diff changeset
  1934
        (knr-argdecl-intro . -)
129
23d028bad418 More regular indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 128
diff changeset
  1935
        (label . 0)
131
bd2400a18295 Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 130
diff changeset
  1936
        (statement-block-intro . +)
bd2400a18295 Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 130
diff changeset
  1937
        (statement-cont . ++)
129
23d028bad418 More regular indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 128
diff changeset
  1938
        (substatement-open . 0)
445
17ffd2e22d12 Disable indent on extern C.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 444
diff changeset
  1939
        (inextern-lang . 0)
131
bd2400a18295 Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 130
diff changeset
  1940
        ))
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1941
    (c-echo-syntactic-information-p . t))
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1942
  "My C Programming Style")
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  1943
710
49635ebf70f1 Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
  1944
(defun my-c-mode-style-hook ()
49635ebf70f1 Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
  1945
  (c-add-style "my" my-c-style t)
49635ebf70f1 Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
  1946
  ;; If set 'c-default-style' before 'c-add-style'
49635ebf70f1 Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
  1947
  ;; "Undefined style: my" error occured from 'c-get-style-variables'.
49635ebf70f1 Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
  1948
  (setq c-default-style
49635ebf70f1 Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
  1949
        '(
49635ebf70f1 Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
  1950
          (java-mode . "my") (c-mode . "my") (csharp-mode . "my") (c++-mode . "my") (objc-mode . "my")
49635ebf70f1 Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
  1951
          (idl-mode . "my")
49635ebf70f1 Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
  1952
          (awk-mode . "awk")
49635ebf70f1 Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
  1953
          (other . "my")
49635ebf70f1 Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
  1954
          ))
49635ebf70f1 Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
  1955
  )
49635ebf70f1 Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 704
diff changeset
  1956
(add-hook 'c-mode-common-hook 'my-c-mode-style-hook)
424
188eba7735eb If set 'c-default-style' before 'c-add-style'
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 423
diff changeset
  1957
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  1958
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
703
970915b27f69 Don't send ^M to Python process under Windows as you get error
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 699
diff changeset
  1959
(message "python")
970915b27f69 Don't send ^M to Python process under Windows as you get error
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 699
diff changeset
  1960
727
4d38b9e96670 Set 'python-indent' and 'python-continuation-offset'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 724
diff changeset
  1961
(setq python-indent 4)
4d38b9e96670 Set 'python-indent' and 'python-continuation-offset'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 724
diff changeset
  1962
856
7757d0840a78 Fix bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=654398
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 843
diff changeset
  1963
(eval-after-load 'python-mode
857
05db92f1e97d Fix "Symbol's value as variable is void: py-version".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 856
diff changeset
  1964
  (when (and (boundp 'py-version) (equal py-version "5.1.0"))
856
7757d0840a78 Fix bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=654398
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 843
diff changeset
  1965
    (setq-default py-which-shell py-python-command)
7757d0840a78 Fix bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=654398
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 843
diff changeset
  1966
    ;; (py-toggle-shells 'cpython)
7757d0840a78 Fix bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=654398
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 843
diff changeset
  1967
    ))
7757d0840a78 Fix bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=654398
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 843
diff changeset
  1968
864
adacfc97125b Load 'pymacs' and 'ropemacs' automatically.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 863
diff changeset
  1969
(ignore-errors
adacfc97125b Load 'pymacs' and 'ropemacs' automatically.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 863
diff changeset
  1970
  (require 'pymacs)
adacfc97125b Load 'pymacs' and 'ropemacs' automatically.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 863
diff changeset
  1971
  (pymacs-load "ropemacs" "rope-")
adacfc97125b Load 'pymacs' and 'ropemacs' automatically.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 863
diff changeset
  1972
  )
adacfc97125b Load 'pymacs' and 'ropemacs' automatically.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 863
diff changeset
  1973
;; Automatically save project python buffers before refactorings
adacfc97125b Load 'pymacs' and 'ropemacs' automatically.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 863
diff changeset
  1974
(setq ropemacs-confirm-saving 'nil)
adacfc97125b Load 'pymacs' and 'ropemacs' automatically.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 863
diff changeset
  1975
732
139665dd6ada my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 731
diff changeset
  1976
(defun my-python-add-to-path (path)
139665dd6ada my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 731
diff changeset
  1977
  (interactive (list (read-directory-name "Enter new path for PYTHONPATH: ")))
139665dd6ada my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 731
diff changeset
  1978
  (when (featurep 'cygwin-mount)
139665dd6ada my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 731
diff changeset
  1979
    (setq path (my-dos2cygwin-path path))
139665dd6ada my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 731
diff changeset
  1980
    )
139665dd6ada my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 731
diff changeset
  1981
  (python-send-string (format "import sys; sys.path.append(\"%s\")" path))
139665dd6ada my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 731
diff changeset
  1982
  )
139665dd6ada my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 731
diff changeset
  1983
139665dd6ada my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 731
diff changeset
  1984
(defun my-python-django-fix (path)
139665dd6ada my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 731
diff changeset
  1985
  "XXX not work on Cygwin + naive Emacs."
139665dd6ada my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 731
diff changeset
  1986
  (interactive (list (read-directory-name "Enter new path for PYTHONPATH: ")))
139665dd6ada my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 731
diff changeset
  1987
  (when (featurep 'cygwin-mount)
139665dd6ada my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 731
diff changeset
  1988
    (setq path (my-dos2cygwin-path path))
139665dd6ada my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 731
diff changeset
  1989
    )
139665dd6ada my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 731
diff changeset
  1990
  (let ((file (concat path "manage.py")))
139665dd6ada my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 731
diff changeset
  1991
    (if (file-exists-p file)
139665dd6ada my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 731
diff changeset
  1992
        (python-send-string (format "import os; os.chdir(\"%s\"); execfile(\"%s\")" path file))
139665dd6ada my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 731
diff changeset
  1993
      (error (format "file '%s' does not exist" file))
139665dd6ada my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 731
diff changeset
  1994
      )))
139665dd6ada my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 731
diff changeset
  1995
730
995821d2a5cf 'eldoc-mode' for Python work starting from version 22.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 729
diff changeset
  1996
(when (>= emacs-major-version 22)
995821d2a5cf 'eldoc-mode' for Python work starting from version 22.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 729
diff changeset
  1997
  (add-hook 'python-mode-hook 'turn-on-eldoc-mode)
995821d2a5cf 'eldoc-mode' for Python work starting from version 22.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 729
diff changeset
  1998
  )
729
9c5cb48451ad Enable 'eldoc-mode' for 'python-mode'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 728
diff changeset
  1999
703
970915b27f69 Don't send ^M to Python process under Windows as you get error
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 699
diff changeset
  2000
(when (equal window-system 'w32)
970915b27f69 Don't send ^M to Python process under Windows as you get error
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 699
diff changeset
  2001
  (add-to-list 'process-coding-system-alist '("python" cp1251-unix . cp1251-unix))
970915b27f69 Don't send ^M to Python process under Windows as you get error
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 699
diff changeset
  2002
  )
970915b27f69 Don't send ^M to Python process under Windows as you get error
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 699
diff changeset
  2003
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  2004
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  2005
(message "javascript, js")
508
79bcafd3d45f As old Emacs have on 'js-mode', use 'javascript-generic-mode'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 507
diff changeset
  2006
657
e8416d2b2f6a Use c++-mode for JS files because of single char comment highlight but when
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 656
diff changeset
  2007
;; (if (>= emacs-major-version 23)
e8416d2b2f6a Use c++-mode for JS files because of single char comment highlight but when
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 656
diff changeset
  2008
;;     (add-to-list 'auto-mode-alist '("\\.js$" . js-mode))
e8416d2b2f6a Use c++-mode for JS files because of single char comment highlight but when
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 656
diff changeset
  2009
;;   (add-to-list 'auto-mode-alist '("\\.js$" . javascript-generic-mode))
e8416d2b2f6a Use c++-mode for JS files because of single char comment highlight but when
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 656
diff changeset
  2010
;;   )
e8416d2b2f6a Use c++-mode for JS files because of single char comment highlight but when
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 656
diff changeset
  2011
e8416d2b2f6a Use c++-mode for JS files because of single char comment highlight but when
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 656
diff changeset
  2012
(setq auto-mode-alist (rassq-delete-all 'js-mode auto-mode-alist))
e8416d2b2f6a Use c++-mode for JS files because of single char comment highlight but when
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 656
diff changeset
  2013
(add-to-list 'auto-mode-alist '("\\.js$" . c++-mode))
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  2014
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  2015
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  2016
(message "bat file, batch")
272
f7fba93f4028 Enable file association for myself defined modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 266
diff changeset
  2017
461
1639d2540bbd Set outline-minor for file. Fix section to feet header outline pattern.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 460
diff changeset
  2018
;; loaded from 'generic-x.el'
1639d2540bbd Set outline-minor for file. Fix section to feet header outline pattern.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 460
diff changeset
  2019
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  2020
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  2021
(message "nsis-mode")
272
f7fba93f4028 Enable file association for myself defined modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 266
diff changeset
  2022
f7fba93f4028 Enable file association for myself defined modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 266
diff changeset
  2023
(when (fboundp 'nsis-mode)
f7fba93f4028 Enable file association for myself defined modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 266
diff changeset
  2024
  (add-to-list 'auto-mode-alist '("\\.\\(nsi\\|nsh\\)\\'" . nsis-mode))
f7fba93f4028 Enable file association for myself defined modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 266
diff changeset
  2025
  )
204
4545865a64c3 Move bat file mode code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 203
diff changeset
  2026
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  2027
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  2028
(message "csharp, c-sharp")
204
4545865a64c3 Move bat file mode code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 203
diff changeset
  2029
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  2030
(autoload 'csharp-mode "csharp-mode" "Major mode for editing C# code." t)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  2031
(add-to-list 'auto-mode-alist '("\\.cs$" . csharp-mode))
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  2032
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  2033
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  2034
(message "java")
296
e502c69ab80a Make header name like tags, separated by comma and ended on period.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 295
diff changeset
  2035
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  2036
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  2037
(message "ECB")
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  2038
102
25585e240b4a Move customization from .emacs (custom-set-variables) to .emacs-my. Remove duplication.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 101
diff changeset
  2039
(setq ecb-tip-of-the-day nil)
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  2040
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  2041
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  2042
(message "html")
104
e921a5d906ca Use highlighting on sgml modes!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 102
diff changeset
  2043
654
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2044
(defun html-charref-escape-region (start end)
628
c00e41cc019e text2html
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 627
diff changeset
  2045
  (interactive "r")
c00e41cc019e text2html
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 627
diff changeset
  2046
  (save-excursion
c00e41cc019e text2html
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 627
diff changeset
  2047
    (save-restriction
c00e41cc019e text2html
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 627
diff changeset
  2048
      (narrow-to-region start end)
c00e41cc019e text2html
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 627
diff changeset
  2049
      (goto-char (point-min))
c00e41cc019e text2html
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 627
diff changeset
  2050
      (replace-string "&" "&amp;")
c00e41cc019e text2html
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 627
diff changeset
  2051
      (goto-char (point-min))
c00e41cc019e text2html
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 627
diff changeset
  2052
      (replace-string "<" "&lt;")
c00e41cc019e text2html
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 627
diff changeset
  2053
      (goto-char (point-min))
c00e41cc019e text2html
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 627
diff changeset
  2054
      (replace-string ">" "&gt;")
c00e41cc019e text2html
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 627
diff changeset
  2055
      )))
c00e41cc019e text2html
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 627
diff changeset
  2056
654
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2057
(defun html-charref-from-char (char)
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2058
  (format "&#%d;" char)
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2059
  )
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2060
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2061
(defun html-charref-from-string (string)
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2062
  (let ((res ""))
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2063
    (mapc
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2064
     (lambda (char) (setq res (concat res (html-charref-from-char char))))
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2065
     string)
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2066
    res
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2067
    ) )
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2068
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2069
(defun html-charref-escape-region2 (begin end &optional prefix)
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2070
  (interactive "r\nP")
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2071
  (if prefix
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2072
      (save-excursion
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2073
        (goto-char begin)
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2074
        (insert (html-charref-from-string (delete-and-extract-region begin end))))
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2075
    (html-charref-from-string (buffer-substring begin end))
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2076
    ))
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2077
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2078
(defun html-charref-to-string (html)
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2079
  (let ((res "") (pos 0))
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2080
    (while (string-match "&#\\([[:digit:]]+\\);" html pos)
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2081
      (setq res (concat res (string (string-to-int (substring html (match-beginning 1) (match-end 1)) 10))))
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2082
      (setq pos (match-end 0))
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2083
     )
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2084
    res
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2085
    ) )
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2086
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2087
(defun html-charref-unescape-region (begin end &optional prefix)
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2088
  (interactive "r\nP")
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2089
  (if prefix
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2090
      (save-excursion
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2091
        (goto-char begin)
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2092
        (insert (html-charref-to-string (delete-and-extract-region begin end))))
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2093
    (html-charref-to-string (buffer-substring begin end))
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2094
    ))
f08ea38190d6 html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 653
diff changeset
  2095
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  2096
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  2097
(message "nxml")
520
7e8d77531ecf Make the complete element be treated as a single markup item.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 514
diff changeset
  2098
7e8d77531ecf Make the complete element be treated as a single markup item.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 514
diff changeset
  2099
(setq nxml-sexp-element-flag t)
522
14a5ff978db7 Set indent for NXML.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 521
diff changeset
  2100
(setq nxml-child-indent 2)
14a5ff978db7 Set indent for NXML.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 521
diff changeset
  2101
(setq nxml-attribute-indent 4)
104
e921a5d906ca Use highlighting on sgml modes!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 102
diff changeset
  2102
618
568cb811ee5b Fix feature name.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 617
diff changeset
  2103
(eval-after-load 'rng-loc
621
0fdb4051446c Fix 'eval-after-load' usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 620
diff changeset
  2104
  '(add-to-list 'rng-schema-locating-files "~/.emacs.d/rnc/schemas.xml")
617
5e34660f1a23 Add path to local rnc schemas.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 616
diff changeset
  2105
  )
5e34660f1a23 Add path to local rnc schemas.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 616
diff changeset
  2106
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  2107
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  2108
(message "psgml")
296
e502c69ab80a Make header name like tags, separated by comma and ended on period.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 295
diff changeset
  2109
698
2a081d4e2e7c FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 691
diff changeset
  2110
(setq my-html-template
2a081d4e2e7c FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 691
diff changeset
  2111
      '("html"
2a081d4e2e7c FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 691
diff changeset
  2112
        (nil
2a081d4e2e7c FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 691
diff changeset
  2113
         "\n<head>" \n
2a081d4e2e7c FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 691
diff changeset
  2114
         "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=" (read-input "Charset: ") "\">" \n
2a081d4e2e7c FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 691
diff changeset
  2115
         "<title>" (setq str (read-input "Title: ")) "</title>\n"
2a081d4e2e7c FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 691
diff changeset
  2116
         "</head>\n"
2a081d4e2e7c FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 691
diff changeset
  2117
         "<body>\n<h1>" str "</h1>"
2a081d4e2e7c FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 691
diff changeset
  2118
         "\n<address>" \n
2a081d4e2e7c FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 691
diff changeset
  2119
         "<a href=\"mailto:" user-mail-address "\">" (user-full-name) "</a>" \n
2a081d4e2e7c FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 691
diff changeset
  2120
         "</address>" \n
2a081d4e2e7c FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 691
diff changeset
  2121
         "</body>\n"
2a081d4e2e7c FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 691
diff changeset
  2122
         ))
2a081d4e2e7c FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 691
diff changeset
  2123
      )
2a081d4e2e7c FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 691
diff changeset
  2124
245
77389965f6bb TABs removed.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 244
diff changeset
  2125
(setq sgml-set-face t)                  ; for highlighting in sgml
670
d10f2e70ff5e Redefine action to put 'html' tag in sgml-mode (more pretty look).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 669
diff changeset
  2126
(eval-after-load 'sgml-mode
d10f2e70ff5e Redefine action to put 'html' tag in sgml-mode (more pretty look).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 669
diff changeset
  2127
  '(progn
698
2a081d4e2e7c FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 691
diff changeset
  2128
     (unless (featurep 'psgml)
2a081d4e2e7c FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 691
diff changeset
  2129
       (setq html-tag-alist
2a081d4e2e7c FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 691
diff changeset
  2130
             (cons
2a081d4e2e7c FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 691
diff changeset
  2131
              my-html-template
2a081d4e2e7c FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 691
diff changeset
  2132
              (my-filter
2a081d4e2e7c FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 691
diff changeset
  2133
               (lambda (item) (not (equal (car item) "html")))
2a081d4e2e7c FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 691
diff changeset
  2134
               html-tag-alist)))
753
732e4cefb33b Add completion for 'script' and 'style' tags in html from sgml mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 748
diff changeset
  2135
       (add-to-list 'html-tag-alist '("script" (\n) ("type" "text/javascript") ))
732e4cefb33b Add completion for 'script' and 'style' tags in html from sgml mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 748
diff changeset
  2136
       (add-to-list 'html-tag-alist '("style" (\n) ("type" "text/css") ))
698
2a081d4e2e7c FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 691
diff changeset
  2137
     )))
104
e921a5d906ca Use highlighting on sgml modes!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 102
diff changeset
  2138
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  2139
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  2140
(message "sh, bash")
438
740efbdc5777 Associate shell-script-mode for .cygport files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 437
diff changeset
  2141
740efbdc5777 Associate shell-script-mode for .cygport files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 437
diff changeset
  2142
(add-to-list 'auto-mode-alist '("\\.cygport\\'" . shell-script-mode))
740efbdc5777 Associate shell-script-mode for .cygport files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 437
diff changeset
  2143
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  2144
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  2145
(message "printing")
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  2146
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  2147
;; Use Notepad to print plain text files to the default Windows printer
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  2148
;(setq lpr-command "notepad")
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  2149
;(setq lpr-headers-switches '("/p"))    ; \ mis-use these
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  2150
;(setq lpr-switches nil)                ; / two variables
9
96e0cbcd92ab Untabify.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 8
diff changeset
  2151
;(setq printer-name nil)        ; notepad takes the default
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  2152
;(setq lpr-printer-switch "/P") ;; run notepad as batch printer
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  2153
;;
295
5be44cff4683 Use utf-8 encoding.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 289
diff changeset
  2154
461
1639d2540bbd Set outline-minor for file. Fix section to feet header outline pattern.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 460
diff changeset
  2155
;; Printing to file.
295
5be44cff4683 Use utf-8 encoding.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 289
diff changeset
  2156
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  2157
;(setq printer-name "~/myprint.txt")
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  2158
;(setq ps-printer-name nil)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  2159
;(setq ps-print-header nil)
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  2160
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  2161
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  2162
(message "SQL")
102
25585e240b4a Move customization from .emacs (custom-set-variables) to .emacs-my. Remove duplication.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 101
diff changeset
  2163
25585e240b4a Move customization from .emacs (custom-set-variables) to .emacs-my. Remove duplication.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 101
diff changeset
  2164
(setq sql-password "")
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  2165
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  2166
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  2167
(message "backuping")
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  2168
75
cd964a1d58b9 Use backup for files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 74
diff changeset
  2169
(setq
328
c770f75a351f Set make-backup-files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 327
diff changeset
  2170
 make-backup-files t
374
e64e256d2772 Update comment.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 373
diff changeset
  2171
 ;; In other case (by renaming) you loose original file creation date.
e64e256d2772 Update comment.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 373
diff changeset
  2172
 backup-by-copying t
75
cd964a1d58b9 Use backup for files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 74
diff changeset
  2173
 backup-directory-alist '(("." . "~/.backup")) ; don't litter my fs tree
82
1a705650ca56 Delete excess backup versions silently, else it prompt to delete ~/.recentf.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 81
diff changeset
  2174
 delete-old-versions t                         ; delete excess backup versions silently
75
cd964a1d58b9 Use backup for files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 74
diff changeset
  2175
 kept-old-versions 1                           ; store first original version
cd964a1d58b9 Use backup for files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 74
diff changeset
  2176
 kept-new-versions 3                           ; store last 3 version
cd964a1d58b9 Use backup for files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 74
diff changeset
  2177
 version-control t)                            ; use versioned backups
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  2178
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  2179
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  2180
(message "auto save")
150
8716dde9dd03 Enable autosave.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 149
diff changeset
  2181
8716dde9dd03 Enable autosave.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 149
diff changeset
  2182
(setq auto-save-default t)
8716dde9dd03 Enable autosave.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 149
diff changeset
  2183
;; If nil autosave to different than original to buffer file.
8716dde9dd03 Enable autosave.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 149
diff changeset
  2184
(setq auto-save-visited-file-name nil)
653
76d35d1516dc Make auto-save-interval lager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 652
diff changeset
  2185
(setq auto-save-interval 300)
150
8716dde9dd03 Enable autosave.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 149
diff changeset
  2186
;; Note: if you kill unsaved file auto save file not deleted.
8716dde9dd03 Enable autosave.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 149
diff changeset
  2187
(setq delete-auto-save-files t)
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  2188
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  2189
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
657
e8416d2b2f6a Use c++-mode for JS files because of single char comment highlight but when
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 656
diff changeset
  2190
;; Save and restore my buffers every time.
766
31b6b63917df Use different 'recentf' and 'desktop' files and do not enable
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 764
diff changeset
  2191
31b6b63917df Use different 'recentf' and 'desktop' files and do not enable
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 764
diff changeset
  2192
(setq desktop-base-file-name ".emacs.desktop")
31b6b63917df Use different 'recentf' and 'desktop' files and do not enable
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 764
diff changeset
  2193
(setq desktop-base-lock-name ".emacs.desktop.lock")
31b6b63917df Use different 'recentf' and 'desktop' files and do not enable
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 764
diff changeset
  2194
(when (eq system-type 'cygwin)
31b6b63917df Use different 'recentf' and 'desktop' files and do not enable
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 764
diff changeset
  2195
  (setq desktop-base-file-name ".emacs.desktop-cygwin")
31b6b63917df Use different 'recentf' and 'desktop' files and do not enable
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 764
diff changeset
  2196
  (setq desktop-base-lock-name ".emacs.desktop-cygwin.lock")
31b6b63917df Use different 'recentf' and 'desktop' files and do not enable
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 764
diff changeset
  2197
  )
31b6b63917df Use different 'recentf' and 'desktop' files and do not enable
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 764
diff changeset
  2198
657
e8416d2b2f6a Use c++-mode for JS files because of single char comment highlight but when
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 656
diff changeset
  2199
(when (>= emacs-major-version 22)
e8416d2b2f6a Use c++-mode for JS files because of single char comment highlight but when
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 656
diff changeset
  2200
  (desktop-save-mode 1)
e8416d2b2f6a Use c++-mode for JS files because of single char comment highlight but when
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 656
diff changeset
  2201
  )
e8416d2b2f6a Use c++-mode for JS files because of single char comment highlight but when
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 656
diff changeset
  2202
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  2203
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
545
24992bae7599 Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 544
diff changeset
  2204
(message "User welcome msg")
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  2205
250
ef1c7269280f Show different messages on statup.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 249
diff changeset
  2206
(add-hook 'emacs-startup-hook
ef1c7269280f Show different messages on statup.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 249
diff changeset
  2207
          (lambda ()
ef1c7269280f Show different messages on statup.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 249
diff changeset
  2208
            (let ( (mgs-list '("Welcome to emacs, the thermonuclear editor."
ef1c7269280f Show different messages on statup.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 249
diff changeset
  2209
                               "You enter to Out Space. Emacs on."
ef1c7269280f Show different messages on statup.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 249
diff changeset
  2210
                               "Nice day for Emacsing!")) )
ef1c7269280f Show different messages on statup.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 249
diff changeset
  2211
              (message (nth (random (length mgs-list)) mgs-list)))))
0
aef1d0017234 Initial commit.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
diff changeset
  2212
548
1bfa0cf51c9c Set *Messages* buffer 'default-directory' to $HOME.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 547
diff changeset
  2213
(switch-to-buffer "*Messages*")
1bfa0cf51c9c Set *Messages* buffer 'default-directory' to $HOME.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 547
diff changeset
  2214
(setq default-directory "~/")
546
083974006b4a 'default-directory' for '*scratch*' buffer. This allow 'eval-buffer' on '.emacs-my'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 545
diff changeset
  2215
(switch-to-buffer "*scratch*")
083974006b4a 'default-directory' for '*scratch*' buffer. This allow 'eval-buffer' on '.emacs-my'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 545
diff changeset
  2216
(setq default-directory "~/")
083974006b4a 'default-directory' for '*scratch*' buffer. This allow 'eval-buffer' on '.emacs-my'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 545
diff changeset
  2217
461
1639d2540bbd Set outline-minor for file. Fix section to feet header outline pattern.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 460
diff changeset
  2218
;;; End loading...
718
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  2219
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  2220
;; Local variables:
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  2221
;; mode: outline-minor
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  2222
;; outline-regexp: "(message \""
19ab21ec7640 Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 717
diff changeset
  2223
;; End: