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