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