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