author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Wed, 23 Mar 2016 15:14:22 +0200 | |
changeset 1367 | 4b9e39b257f0 |
parent 1366 | f9989b9060aa |
child 1368 | ec4a06cc1a8b |
permissions | -rw-r--r-- |
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
1 |
;; -*- mode: emacs-lisp; coding: utf-8; fill-column: 78 -*- |
6 | 2 |
;; |
1265
964397fd5d99
Update copying year.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1227
diff
changeset
|
3 |
;; Written by Oleksandr Gavenko <gavenkoa@gmail.com>, 2008-2015. |
6 | 4 |
;; |
121 | 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 | 11 |
|
1282
c4bc43d16082
Disable byte-compilation warnings:
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1281
diff
changeset
|
12 |
(with-no-warnings (require 'cl)) |
c4bc43d16082
Disable byte-compilation warnings:
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1281
diff
changeset
|
13 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
14 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
611
49c993d41d3f
Firstly enable 'recentf' to easy access to recently edited file when Emacs
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
610
diff
changeset
|
15 |
(message "recentf") |
49c993d41d3f
Firstly enable 'recentf' to easy access to recently edited file when Emacs
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
610
diff
changeset
|
16 |
|
1254
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
17 |
(eval-and-compile |
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
18 |
(require 'recentf)) |
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
19 |
|
1253
504c216e8d21
Move '.recentf' and '~/.irc' to '~/.emacs.d'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1240
diff
changeset
|
20 |
(setq recentf-save-file (concat user-emacs-directory ".recentf")) |
766
31b6b63917df
Use different 'recentf' and 'desktop' files and do not enable
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
764
diff
changeset
|
21 |
(when (eq system-type 'cygwin) |
1253
504c216e8d21
Move '.recentf' and '~/.irc' to '~/.emacs.d'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1240
diff
changeset
|
22 |
(setq recentf-save-file (concat user-emacs-directory ".recentf-cygwin"))) |
1148
9659883a1bec
Add ``recentf-exclude`` to prevent opening unwanted files from temporary copy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1147
diff
changeset
|
23 |
|
1197
998763deda98
Cleanup recentf on idle to decrease boot time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1196
diff
changeset
|
24 |
(setq recentf-auto-cleanup 600) |
1148
9659883a1bec
Add ``recentf-exclude`` to prevent opening unwanted files from temporary copy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1147
diff
changeset
|
25 |
;; Prevent TRAMP to login on remote host when loading. Its take time and ask passwords! |
9659883a1bec
Add ``recentf-exclude`` to prevent opening unwanted files from temporary copy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1147
diff
changeset
|
26 |
(setq recentf-keep '(file-remote-p file-readable-p)) |
9659883a1bec
Add ``recentf-exclude`` to prevent opening unwanted files from temporary copy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1147
diff
changeset
|
27 |
(setq recentf-exclude ; Use ``M-x recentf-cleanup`` to update recentf-list. |
9659883a1bec
Add ``recentf-exclude`` to prevent opening unwanted files from temporary copy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1147
diff
changeset
|
28 |
'("/devel/[^/]*-\\(orig\\|tmp\\|xxx\\)" |
1202
17ed3f571ca4
Add shortcut for recentf.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1201
diff
changeset
|
29 |
"/devel/my-\\(merge\\|pull\\)/" |
1334
6e334301afb1
Update paths because I move my base development directory up one level.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1333
diff
changeset
|
30 |
"/.cache/" |
1202
17ed3f571ca4
Add shortcut for recentf.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1201
diff
changeset
|
31 |
"\\.png\\'")) |
1329
a2f8f3f1f0ef
Place related recentf settings together.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1328
diff
changeset
|
32 |
|
1148
9659883a1bec
Add ``recentf-exclude`` to prevent opening unwanted files from temporary copy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1147
diff
changeset
|
33 |
(setq recentf-max-saved-items 10000) |
1329
a2f8f3f1f0ef
Place related recentf settings together.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1328
diff
changeset
|
34 |
(setq recentf-max-menu-items 40) |
a2f8f3f1f0ef
Place related recentf settings together.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1328
diff
changeset
|
35 |
(setq recentf-show-file-shortcuts-flag nil) |
1148
9659883a1bec
Add ``recentf-exclude`` to prevent opening unwanted files from temporary copy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1147
diff
changeset
|
36 |
|
611
49c993d41d3f
Firstly enable 'recentf' to easy access to recently edited file when Emacs
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
610
diff
changeset
|
37 |
(recentf-mode t) |
1148
9659883a1bec
Add ``recentf-exclude`` to prevent opening unwanted files from temporary copy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1147
diff
changeset
|
38 |
|
1202
17ed3f571ca4
Add shortcut for recentf.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1201
diff
changeset
|
39 |
(global-set-key (kbd "\e\eq") 'recentf-open-files) |
17ed3f571ca4
Add shortcut for recentf.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1201
diff
changeset
|
40 |
(global-set-key [?\s-q] 'recentf-open-files) |
611
49c993d41d3f
Firstly enable 'recentf' to easy access to recently edited file when Emacs
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
610
diff
changeset
|
41 |
|
1148
9659883a1bec
Add ``recentf-exclude`` to prevent opening unwanted files from temporary copy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1147
diff
changeset
|
42 |
;; (setq recentf-menu-filter 'recentf-arrange-by-dir) ; Too slow with dir widgets. |
1153
516ab8f13ece
Don't sort ``recentf-list`` so ``recentf-open-files`` show files in historical order!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1150
diff
changeset
|
43 |
;; Don't sort ``recentf-list`` so ``recentf-open-files`` show files in historical order! |
516ab8f13ece
Don't sort ``recentf-list`` so ``recentf-open-files`` show files in historical order!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1150
diff
changeset
|
44 |
(setq recentf-menu-filter nil) |
1141
294e4bafc4a5
Set recentf-menu-filter as recentf-arrange-by-dir to avoid shown duplicate
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1140
diff
changeset
|
45 |
|
1208
e2ce4a60af3e
my-recentf.clean-project
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1207
diff
changeset
|
46 |
(defun my-recentf.clean-project (dir) |
e2ce4a60af3e
my-recentf.clean-project
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1207
diff
changeset
|
47 |
"Remove from recentf all files that belong to DIR directory." |
e2ce4a60af3e
my-recentf.clean-project
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1207
diff
changeset
|
48 |
(interactive (list (read-directory-name "Exclude all paths"))) |
e2ce4a60af3e
my-recentf.clean-project
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1207
diff
changeset
|
49 |
(let ( recentf-exclude ) |
e2ce4a60af3e
my-recentf.clean-project
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1207
diff
changeset
|
50 |
(setq recentf-exclude (list (concat "^" (regexp-quote (expand-file-name dir))))) |
e2ce4a60af3e
my-recentf.clean-project
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1207
diff
changeset
|
51 |
(recentf-cleanup) )) |
e2ce4a60af3e
my-recentf.clean-project
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1207
diff
changeset
|
52 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
53 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
658
b8a1ffa6408f
Make revert buffer available more early.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
657
diff
changeset
|
54 |
(message "revert buffer") |
b8a1ffa6408f
Make revert buffer available more early.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
657
diff
changeset
|
55 |
|
b8a1ffa6408f
Make revert buffer available more early.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
657
diff
changeset
|
56 |
(global-set-key [f5] 'revert-buffer) |
b8a1ffa6408f
Make revert buffer available more early.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
657
diff
changeset
|
57 |
(setq revert-without-query (quote (".*"))) |
b8a1ffa6408f
Make revert buffer available more early.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
657
diff
changeset
|
58 |
(setq auto-revert-interval 2) |
b8a1ffa6408f
Make revert buffer available more early.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
657
diff
changeset
|
59 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
60 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
61 |
(message "debugging") |
0 | 62 |
|
175
a505ab71060a
Make comment shorter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
174
diff
changeset
|
63 |
;; Shut off message buffer by setting nil. |
252
330b4cdfaddf
Increase log message count.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
251
diff
changeset
|
64 |
(setq message-log-max 512) |
0 | 65 |
|
539
4e0728ed912a
Document 'inhibit-default-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
538
diff
changeset
|
66 |
;; Prevent Emacs from loading 'default.el', which loaded after '.emacs'. |
4e0728ed912a
Document 'inhibit-default-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
538
diff
changeset
|
67 |
;; Also '-q' prevent loading your init file. |
4e0728ed912a
Document 'inhibit-default-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
538
diff
changeset
|
68 |
(setq inhibit-default-init nil) ; t/nil |
4e0728ed912a
Document 'inhibit-default-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
538
diff
changeset
|
69 |
|
743
234a9934b957
With prefix enable debug backtrace when problems occur else disable.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
742
diff
changeset
|
70 |
(defun my-debug (mode) |
1279
4738798c1eda
With double prefix enable debugging on event and signal.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1278
diff
changeset
|
71 |
"With prefix enable enter to debuger and show backtrace when |
4738798c1eda
With double prefix enable debugging on event and signal.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1278
diff
changeset
|
72 |
problems occur, with double prefix enable debugging on event and |
4738798c1eda
With double prefix enable debugging on event and signal.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1278
diff
changeset
|
73 |
signal, else disable breaking to debugger." |
743
234a9934b957
With prefix enable debug backtrace when problems occur else disable.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
742
diff
changeset
|
74 |
(interactive "P") |
1279
4738798c1eda
With double prefix enable debugging on event and signal.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1278
diff
changeset
|
75 |
(let ( (lvl1 (not (not mode))) (lvl2 (equal mode '(16))) ) |
4738798c1eda
With double prefix enable debugging on event and signal.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1278
diff
changeset
|
76 |
(setq debug-on-error lvl1) |
4738798c1eda
With double prefix enable debugging on event and signal.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1278
diff
changeset
|
77 |
;; Get trace when press C-g. |
4738798c1eda
With double prefix enable debugging on event and signal.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1278
diff
changeset
|
78 |
(setq debug-on-quit lvl1) |
4738798c1eda
With double prefix enable debugging on event and signal.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1278
diff
changeset
|
79 |
(setq debug-on-event lvl2) |
4738798c1eda
With double prefix enable debugging on event and signal.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1278
diff
changeset
|
80 |
(setq debug-on-signal lvl2))) |
743
234a9934b957
With prefix enable debug backtrace when problems occur else disable.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
742
diff
changeset
|
81 |
|
234a9934b957
With prefix enable debug backtrace when problems occur else disable.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
742
diff
changeset
|
82 |
(my-debug nil) |
234a9934b957
With prefix enable debug backtrace when problems occur else disable.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
742
diff
changeset
|
83 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
84 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
85 |
(message "user info") |
531
a6466b47121e
Move user info to top.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
530
diff
changeset
|
86 |
|
1253
504c216e8d21
Move '.recentf' and '~/.irc' to '~/.emacs.d'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1240
diff
changeset
|
87 |
;; Set in ~/.emacs.d/.emacs-auth: |
774
ebfb1eb5cf56
Set following in ~/.emacs-auth.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
773
diff
changeset
|
88 |
;; (setq user-full-name "Oleksandr Gavenko") |
ebfb1eb5cf56
Set following in ~/.emacs-auth.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
773
diff
changeset
|
89 |
;; (setq user-mail-address "gavenkoa@gmail.com") |
ebfb1eb5cf56
Set following in ~/.emacs-auth.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
773
diff
changeset
|
90 |
;; (setq user-nick "gavenkoa") |
930
ab0ce5cb09bf
Add link to my home page in Organization mail header.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
929
diff
changeset
|
91 |
;; (setq user-home-page "http://gavenkoa.users.sf.net") |
1321
55fcbcca8049
Point to new home page.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1317
diff
changeset
|
92 |
;; (setq user-home-page "http://defun.work/") |
774
ebfb1eb5cf56
Set following in ~/.emacs-auth.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
773
diff
changeset
|
93 |
|
1282
c4bc43d16082
Disable byte-compilation warnings:
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1281
diff
changeset
|
94 |
(defvar user-nick (user-login-name) |
c4bc43d16082
Disable byte-compilation warnings:
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1281
diff
changeset
|
95 |
"My nick name.") |
930
ab0ce5cb09bf
Add link to my home page in Organization mail header.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
929
diff
changeset
|
96 |
;; auto-insert and copyright package use this to insert copyright owner. Gnus |
ab0ce5cb09bf
Add link to my home page in Organization mail header.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
929
diff
changeset
|
97 |
;; uses this for Organization header. |
ab0ce5cb09bf
Add link to my home page in Organization mail header.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
929
diff
changeset
|
98 |
(setenv "ORGANIZATION" |
ab0ce5cb09bf
Add link to my home page in Organization mail header.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
929
diff
changeset
|
99 |
(concat |
ab0ce5cb09bf
Add link to my home page in Organization mail header.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
929
diff
changeset
|
100 |
user-full-name |
ab0ce5cb09bf
Add link to my home page in Organization mail header.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
929
diff
changeset
|
101 |
" <" user-mail-address ">" |
ab0ce5cb09bf
Add link to my home page in Organization mail header.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
929
diff
changeset
|
102 |
(when (boundp 'user-home-page) (concat ", " user-home-page)))) |
531
a6466b47121e
Move user info to top.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
530
diff
changeset
|
103 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
104 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
670
d10f2e70ff5e
Redefine action to put 'html' tag in sgml-mode (more pretty look).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
669
diff
changeset
|
105 |
(message "my defun, defmacro, defvar") |
d10f2e70ff5e
Redefine action to put 'html' tag in sgml-mode (more pretty look).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
669
diff
changeset
|
106 |
|
1017
7b1ae3e0c9e3
Omit condition from loop.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1016
diff
changeset
|
107 |
(defmacro my-filter (pred list) |
7b1ae3e0c9e3
Omit condition from loop.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1016
diff
changeset
|
108 |
"Construct list with elements from LIST which satisfy PRED." |
1018
94b0ca71a583
Fix (info "(elisp) Surprising Local Vars").
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1017
diff
changeset
|
109 |
(let ( (r (make-symbol "r_")) ) |
94b0ca71a583
Fix (info "(elisp) Surprising Local Vars").
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1017
diff
changeset
|
110 |
`(let ( (,r (list nil)) ) |
94b0ca71a583
Fix (info "(elisp) Surprising Local Vars").
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1017
diff
changeset
|
111 |
(mapc (lambda (item) |
94b0ca71a583
Fix (info "(elisp) Surprising Local Vars").
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1017
diff
changeset
|
112 |
(when (,pred item) |
94b0ca71a583
Fix (info "(elisp) Surprising Local Vars").
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1017
diff
changeset
|
113 |
(nconc ,r (cons item nil)))) |
94b0ca71a583
Fix (info "(elisp) Surprising Local Vars").
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1017
diff
changeset
|
114 |
,list) |
94b0ca71a583
Fix (info "(elisp) Surprising Local Vars").
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1017
diff
changeset
|
115 |
(cdr ,r)))) |
670
d10f2e70ff5e
Redefine action to put 'html' tag in sgml-mode (more pretty look).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
669
diff
changeset
|
116 |
|
716 | 117 |
(defun my-fold (f x list) |
118 |
"Recursively applies (F i j) to LIST starting with X. |
|
119 |
For example, (fold F X '(1 2 3)) computes (F (F (F X 1) 2) 3)." |
|
120 |
(let ((li list) (x2 x)) |
|
121 |
(while li |
|
122 |
(setq x2 (funcall f x2 (pop li))) |
|
123 |
) |
|
124 |
x2 |
|
125 |
) ) |
|
126 |
||
720
e50b78c6a53d
Fix: ignore-errors does not defined under Emacs 22.2.1 (on Debian).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
699
diff
changeset
|
127 |
(unless (fboundp 'ignore-errors) |
e50b78c6a53d
Fix: ignore-errors does not defined under Emacs 22.2.1 (on Debian).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
699
diff
changeset
|
128 |
(defmacro ignore-errors (&rest body) |
e50b78c6a53d
Fix: ignore-errors does not defined under Emacs 22.2.1 (on Debian).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
699
diff
changeset
|
129 |
"Execute BODY; if an error occurs, return nil. |
e50b78c6a53d
Fix: ignore-errors does not defined under Emacs 22.2.1 (on Debian).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
699
diff
changeset
|
130 |
Otherwise, return result of last form in BODY." |
e50b78c6a53d
Fix: ignore-errors does not defined under Emacs 22.2.1 (on Debian).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
699
diff
changeset
|
131 |
(declare (debug t) (indent 0)) |
e50b78c6a53d
Fix: ignore-errors does not defined under Emacs 22.2.1 (on Debian).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
699
diff
changeset
|
132 |
`(condition-case nil (progn ,@body) (error nil))) |
e50b78c6a53d
Fix: ignore-errors does not defined under Emacs 22.2.1 (on Debian).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
699
diff
changeset
|
133 |
) |
e50b78c6a53d
Fix: ignore-errors does not defined under Emacs 22.2.1 (on Debian).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
699
diff
changeset
|
134 |
|
1016
6c3765dd9ed2
Search for KEY in all known keymaps.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1015
diff
changeset
|
135 |
(defun my-lookup-key (key) |
6c3765dd9ed2
Search for KEY in all known keymaps.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1015
diff
changeset
|
136 |
"Search for KEY in all known keymaps." |
6c3765dd9ed2
Search for KEY in all known keymaps.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1015
diff
changeset
|
137 |
(mapatoms (lambda (ob) (when (and (boundp ob) (keymapp (symbol-value ob))) |
1292
b515e071a52c
Fix test for finding key by lookup-key.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1291
diff
changeset
|
138 |
(when (functionp (lookup-key (symbol-value ob) key)) |
1016
6c3765dd9ed2
Search for KEY in all known keymaps.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1015
diff
changeset
|
139 |
(message "%S" ob)))) |
6c3765dd9ed2
Search for KEY in all known keymaps.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1015
diff
changeset
|
140 |
obarray)) |
6c3765dd9ed2
Search for KEY in all known keymaps.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1015
diff
changeset
|
141 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
142 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1255
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
143 |
(message "lisp, elisp") |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
144 |
|
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
145 |
(setq list-command-history-max 256) |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
146 |
|
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
147 |
(add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode) |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
148 |
(add-hook 'lisp-interaction-mode-hook 'turn-on-eldoc-mode) |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
149 |
(add-hook 'ielm-mode-hook 'turn-on-eldoc-mode) |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
150 |
|
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
151 |
(defun my-emacs-lisp-mode-hook () |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
152 |
(setq tab-width 8)) |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
153 |
(add-hook 'emacs-lisp-mode-hook 'my-emacs-lisp-mode-hook) |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
154 |
|
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
155 |
(defun my-elisp-find-tag () |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
156 |
(interactive) |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
157 |
(require 'etags) |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
158 |
(ring-insert find-tag-marker-ring (point-marker)) |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
159 |
(unless (find-variable-at-point) |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
160 |
(find-function-at-point) |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
161 |
)) |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
162 |
;; Goto elisp definition. |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
163 |
(define-key emacs-lisp-mode-map (kbd "M-.") 'my-elisp-find-tag) |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
164 |
|
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
165 |
(if (not (fboundp 'global-prettify-symbols-mode)) |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
166 |
;; http://www.emacswiki.org/emacs/PrettyLambda |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
167 |
(font-lock-add-keywords |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
168 |
'emacs-lisp-mode |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
169 |
`(("(\\<\\(lambda\\)\\>" |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
170 |
(1 (progn (compose-region (match-beginning 1) (match-end 1) ,(make-char 'greek-iso8859-7 107)) font-lock-keyword-face)) ))) |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
171 |
(global-prettify-symbols-mode 1)) |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
172 |
|
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
173 |
(defun my-dump-funcs () |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
174 |
"Dump all function calls in current buffer. Useful to explore |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
175 |
elisp API from somebody else files." |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
176 |
(interactive) |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
177 |
(let* ( (cur-buffer (current-buffer)) (new-buffer (get-buffer-create (concat (buffer-name cur-buffer) "-funcs.el"))) symb ) |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
178 |
(while (search-forward-regexp "([[:alnum:]*]" nil t) |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
179 |
(setq symb (thing-at-point 'symbol)) |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
180 |
(with-current-buffer new-buffer |
1282
c4bc43d16082
Disable byte-compilation warnings:
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1281
diff
changeset
|
181 |
(insert symb) |
1255
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
182 |
(insert-char ?\n 1))) |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
183 |
(switch-to-buffer new-buffer) |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
184 |
(shell-command-on-region (point-min) (point-max) "sort -u" nil t) |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
185 |
)) |
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
186 |
|
abba187b8cab
Move elisp tuning upper to get better support for debugging when init
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1254
diff
changeset
|
187 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
188 |
(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
|
189 |
|
606 | 190 |
(defmacro my-defun-rename-symb-tree (name doc func) |
191 |
"Travel by TREE and applies FUNC to each symbol." |
|
192 |
`(defun ,name (tree) |
|
193 |
,doc |
|
194 |
(cond |
|
195 |
((symbolp tree) |
|
196 |
(,func tree) |
|
197 |
) |
|
198 |
((listp tree) |
|
199 |
(mapcar ',name tree) |
|
200 |
) |
|
1257
a17e5b709fa7
Fix warning from checkdoc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1256
diff
changeset
|
201 |
(t (error "Only tree of symbols allowed")) |
606 | 202 |
))) |
605
c228c0414e0b
Generalize logic to rename symbols.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
604
diff
changeset
|
203 |
|
606 | 204 |
(my-defun-rename-symb-tree |
205 |
my-feature2mode |
|
206 |
"Convert TREE of features to TREE of modes for these features. Single symbol allowed." |
|
207 |
(lambda (symb) (intern (concat (symbol-name symb) "-mode")))) |
|
605
c228c0414e0b
Generalize logic to rename symbols.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
604
diff
changeset
|
208 |
|
606 | 209 |
(my-defun-rename-symb-tree |
210 |
my-mode2hook |
|
211 |
"Convert TREE of modes to TREE of hooks for these modes. Single symbol allowed." |
|
212 |
(lambda (symb) (intern (concat (symbol-name symb) "-hook"))) |
|
213 |
) |
|
605
c228c0414e0b
Generalize logic to rename symbols.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
604
diff
changeset
|
214 |
|
606 | 215 |
(my-defun-rename-symb-tree |
216 |
my-mode2modemap |
|
217 |
"Convert TREE of modes to TREE of keymaps for these modes. Single symbol allowed." |
|
218 |
(lambda (symb) (intern (concat (symbol-name symb) "-map"))) |
|
219 |
) |
|
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
|
220 |
|
333
14b07ca8335a
Set margin only for desired modes! Do not frustrate calendar any more.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
332
diff
changeset
|
221 |
(defvar my-devel-mode-list |
401
4e91288dbd84
Highlight TODO FIXME in outline-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
400
diff
changeset
|
222 |
'( |
695
273e9d5c4f86
Add 'tcl-mode' to 'my-devel-mode-list'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
692
diff
changeset
|
223 |
sh-mode script-mode tcl-mode |
488
a3e4b656e4e6
Added js-mode to my list of development modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
487
diff
changeset
|
224 |
c-mode c++-mode java-mode js-mode |
887
bbd5b721e5c1
Add perl-mode cperl-mode to my-devel-mode-list for Imenu.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
225 |
python-mode perl-mode cperl-mode |
401
4e91288dbd84
Highlight TODO FIXME in outline-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
400
diff
changeset
|
226 |
lisp-mode |
1053
a6a203a2b64c
Add sql mode to devel mode list for imenu support.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1052
diff
changeset
|
227 |
sql-mode |
401
4e91288dbd84
Highlight TODO FIXME in outline-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
400
diff
changeset
|
228 |
emacs-lisp-mode |
4e91288dbd84
Highlight TODO FIXME in outline-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
400
diff
changeset
|
229 |
makefile-mode makefile-gmake-mode |
494
e388310789d1
Added 'nsis-mode' to 'my-devel-mode-list'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
493
diff
changeset
|
230 |
nsis-mode |
692
6e566f6c7386
Add 'bat-generic-mode' to 'my-devel-mode-list'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
691
diff
changeset
|
231 |
bat-generic-mode |
1189
dd8bad2fe8ae
show whitespaces in wesnoth-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1188
diff
changeset
|
232 |
html-mode nxml-mode wesnoth-mode |
737
fb4d18368c1f
Add 'LilyPond-mode' to 'my-devel-mode-list' for enabling scroll-margin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
736
diff
changeset
|
233 |
LilyPond-mode |
866
b6b520b4e11e
Add 'texinfo-mode' to 'my-devel-mode-list' for TODO highlighting.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
865
diff
changeset
|
234 |
texinfo-mode |
401
4e91288dbd84
Highlight TODO FIXME in outline-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
400
diff
changeset
|
235 |
) |
333
14b07ca8335a
Set margin only for desired modes! Do not frustrate calendar any more.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
332
diff
changeset
|
236 |
"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
|
237 |
|
14b07ca8335a
Set margin only for desired modes! Do not frustrate calendar any more.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
332
diff
changeset
|
238 |
(defvar my-devel-mode-hook-list |
605
c228c0414e0b
Generalize logic to rename symbols.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
604
diff
changeset
|
239 |
(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
|
240 |
"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
|
241 |
|
4f91b5ccab17
'my-modelist-to-hooklist' convert list of MODES to list of hooks for these
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
492
diff
changeset
|
242 |
(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
|
243 |
'( |
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
|
244 |
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
|
245 |
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
|
246 |
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
|
247 |
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
|
248 |
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
|
249 |
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
|
250 |
) |
4f91b5ccab17
'my-modelist-to-hooklist' convert list of MODES to list of hooks for these
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
492
diff
changeset
|
251 |
"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
|
252 |
|
391
09cfea42153e
Added list of mode hooks for enabling scroll margin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
389
diff
changeset
|
253 |
(defvar my-scroll-margin-mode-hook-list |
605
c228c0414e0b
Generalize logic to rename symbols.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
604
diff
changeset
|
254 |
(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
|
255 |
"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
|
256 |
|
333
14b07ca8335a
Set margin only for desired modes! Do not frustrate calendar any more.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
332
diff
changeset
|
257 |
(defvar my-text-mode-list |
631
eb5ce5b0b208
Add 'html-mode' to devel mode list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
629
diff
changeset
|
258 |
'( |
eb5ce5b0b208
Add 'html-mode' to devel mode list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
629
diff
changeset
|
259 |
text-mode |
eb5ce5b0b208
Add 'html-mode' to devel mode list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
629
diff
changeset
|
260 |
outline-mode |
665
9761254a1260
Maintaining the table of contents up-to-date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
664
diff
changeset
|
261 |
rst-mode |
723
ff912b026ad2
Move 'diff-mode' to 'my-text-mode-list' for trailing spaces highlighting.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
721
diff
changeset
|
262 |
diff-mode |
691 | 263 |
dict-c5-mode |
631
eb5ce5b0b208
Add 'html-mode' to devel mode list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
629
diff
changeset
|
264 |
) |
333
14b07ca8335a
Set margin only for desired modes! Do not frustrate calendar any more.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
332
diff
changeset
|
265 |
"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
|
266 |
|
14b07ca8335a
Set margin only for desired modes! Do not frustrate calendar any more.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
332
diff
changeset
|
267 |
(defvar my-text-mode-hook-list |
605
c228c0414e0b
Generalize logic to rename symbols.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
604
diff
changeset
|
268 |
(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
|
269 |
"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
|
270 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
271 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1070
ade365833a09
Move package initialisation to top of file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1069
diff
changeset
|
272 |
(message "package, elpa") |
ade365833a09
Move package initialisation to top of file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1069
diff
changeset
|
273 |
|
ade365833a09
Move package initialisation to top of file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1069
diff
changeset
|
274 |
;; (setq package-enable-at-startup t) |
1085
e5be6d749d06
Check if 'package-initialize' present.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1081
diff
changeset
|
275 |
(when (fboundp 'package-initialize) |
e5be6d749d06
Check if 'package-initialize' present.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1081
diff
changeset
|
276 |
(package-initialize)) |
1070
ade365833a09
Move package initialisation to top of file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1069
diff
changeset
|
277 |
|
ade365833a09
Move package initialisation to top of file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1069
diff
changeset
|
278 |
(setq package-archives |
ade365833a09
Move package initialisation to top of file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1069
diff
changeset
|
279 |
'( |
ade365833a09
Move package initialisation to top of file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1069
diff
changeset
|
280 |
("elpa" . "http://tromey.com/elpa/") |
ade365833a09
Move package initialisation to top of file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1069
diff
changeset
|
281 |
("gnu" . "http://elpa.gnu.org/packages/") |
1322
2806c88dc25a
Disable Marmelade because of error: gnutls.c: [0] (Emacs) fatal error: The TLS connection was non-properly terminated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1321
diff
changeset
|
282 |
;; ("marmalade" . "http://marmalade-repo.org/packages/") |
1070
ade365833a09
Move package initialisation to top of file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1069
diff
changeset
|
283 |
("melpa" . "http://melpa.milkbox.net/packages/") |
ade365833a09
Move package initialisation to top of file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1069
diff
changeset
|
284 |
)) |
ade365833a09
Move package initialisation to top of file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1069
diff
changeset
|
285 |
|
ade365833a09
Move package initialisation to top of file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1069
diff
changeset
|
286 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
287 |
(message "appearance") |
362
f4bd431ad549
By default start from user home directory (HOME point to it).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
361
diff
changeset
|
288 |
|
370
378a4dc8ea1c
Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
369
diff
changeset
|
289 |
;; 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
|
290 |
;; 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
|
291 |
;; (setq initial-frame-alist '((fullscreen . fullboth))) |
378a4dc8ea1c
Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
369
diff
changeset
|
292 |
|
550
d8092299457a
(setq display-buffer-reuse-frames t)
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
549
diff
changeset
|
293 |
(setq display-buffer-reuse-frames t) |
d8092299457a
(setq display-buffer-reuse-frames t)
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
549
diff
changeset
|
294 |
|
1183
6fdc4a4f4155
Use modern way to maximize frame.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1182
diff
changeset
|
295 |
(defun my-maximize () |
6fdc4a4f4155
Use modern way to maximize frame.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1182
diff
changeset
|
296 |
;; Next code work with Emacs 21.4, 22.3, 23.1. |
370
378a4dc8ea1c
Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
369
diff
changeset
|
297 |
(let ( |
378a4dc8ea1c
Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
369
diff
changeset
|
298 |
(px (display-pixel-width)) |
378a4dc8ea1c
Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
369
diff
changeset
|
299 |
(py (display-pixel-height)) |
378a4dc8ea1c
Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
369
diff
changeset
|
300 |
(fx (frame-char-width)) |
378a4dc8ea1c
Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
369
diff
changeset
|
301 |
(fy (frame-char-height)) |
378a4dc8ea1c
Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
369
diff
changeset
|
302 |
tx ty |
378a4dc8ea1c
Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
369
diff
changeset
|
303 |
) |
378a4dc8ea1c
Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
369
diff
changeset
|
304 |
;; 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
|
305 |
(setq tx (- (/ px fx) 7)) |
370
378a4dc8ea1c
Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
369
diff
changeset
|
306 |
(setq ty (- (/ py fy) 4)) |
625
78017f6d5b43
Indent initial frame to 2 pixel.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
624
diff
changeset
|
307 |
(setq initial-frame-alist '((top . 2) (left . 2))) |
370
378a4dc8ea1c
Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
369
diff
changeset
|
308 |
(add-to-list 'initial-frame-alist (cons 'width tx)) |
1183
6fdc4a4f4155
Use modern way to maximize frame.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1182
diff
changeset
|
309 |
(add-to-list 'initial-frame-alist (cons 'height ty)) )) |
6fdc4a4f4155
Use modern way to maximize frame.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1182
diff
changeset
|
310 |
|
6fdc4a4f4155
Use modern way to maximize frame.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1182
diff
changeset
|
311 |
(when window-system |
6fdc4a4f4155
Use modern way to maximize frame.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1182
diff
changeset
|
312 |
(if (fboundp 'toggle-frame-maximized) |
6fdc4a4f4155
Use modern way to maximize frame.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1182
diff
changeset
|
313 |
(toggle-frame-maximized) |
6fdc4a4f4155
Use modern way to maximize frame.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1182
diff
changeset
|
314 |
(my-maximize) )) |
370
378a4dc8ea1c
Maximize frame on full screen.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
369
diff
changeset
|
315 |
|
151 | 316 |
(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
|
317 |
(when window-system |
585
2431be336034
mouse-avoidance-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
584
diff
changeset
|
318 |
(mouse-avoidance-mode 'animate) |
502
64a475fa36e2
tool-bar-mode not available under Cygwin console Emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
501
diff
changeset
|
319 |
(scroll-bar-mode 1) |
64a475fa36e2
tool-bar-mode not available under Cygwin console Emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
501
diff
changeset
|
320 |
(tool-bar-mode -1) |
952
6ec8b1014d11
line-spacing and ediff-split-window-function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
951
diff
changeset
|
321 |
(setq-default line-spacing nil) |
429
998f33a8ec6e
Open menu by f10 like by C-Mouse-3 without mouse!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
428
diff
changeset
|
322 |
(defun my-popup-menu () |
1003 | 323 |
"Menu from keyboard by emulating mouse event." |
429
998f33a8ec6e
Open menu by f10 like by C-Mouse-3 without mouse!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
428
diff
changeset
|
324 |
(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
|
325 |
(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
|
326 |
(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
|
327 |
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
|
328 |
) |
429
998f33a8ec6e
Open menu by f10 like by C-Mouse-3 without mouse!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
428
diff
changeset
|
329 |
(global-set-key [f10] 'my-popup-menu) |
436
95dfd88eee58
Open *Global menu* by <apps> key.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
435
diff
changeset
|
330 |
(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
|
331 |
(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
|
332 |
(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
|
333 |
) |
0 | 334 |
|
595
be6c27e4c776
Fix "Prefer horizontal windows splitting" for terminals.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
594
diff
changeset
|
335 |
;; 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
|
336 |
(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
|
337 |
(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
|
338 |
(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
|
339 |
) |
573
c28b88b60ed0
Prefer horizontal windows splitting.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
524
diff
changeset
|
340 |
|
1147 | 341 |
(setq frame-title-format '("EMACS " system-name ": %b")) |
1220
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
342 |
(setq icon-title-format '("EMACS " system-name ": %b")) |
338
ebf88f988c37
Move some appearance related switch together.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
337
diff
changeset
|
343 |
|
933 | 344 |
;; Deprecated: `default-header-line-format', `default-mode-line-format'. |
345 |
;; For `mode-line-format' default value was used. |
|
346 |
(setq-default header-line-format nil) |
|
363
17df92226b5a
Set default-header-line-format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
362
diff
changeset
|
347 |
|
364
3d18cfe179cc
Set default fringe and margin width.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
363
diff
changeset
|
348 |
(setq default-left-fringe-width nil) |
3d18cfe179cc
Set default fringe and margin width.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
363
diff
changeset
|
349 |
(setq default-right-fringe-width nil) |
3d18cfe179cc
Set default fringe and margin width.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
363
diff
changeset
|
350 |
(setq default-left-margin-width nil) |
3d18cfe179cc
Set default fringe and margin width.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
363
diff
changeset
|
351 |
(setq default-right-margin-width nil) |
3d18cfe179cc
Set default fringe and margin width.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
363
diff
changeset
|
352 |
|
882
58b84ad67327
default-truncate-lines is depricated since 23.2. Set
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
881
diff
changeset
|
353 |
(if (< emacs-major-version 24) |
58b84ad67327
default-truncate-lines is depricated since 23.2. Set
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
881
diff
changeset
|
354 |
(setq default-truncate-lines nil) |
58b84ad67327
default-truncate-lines is depricated since 23.2. Set
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
881
diff
changeset
|
355 |
(setq truncate-lines nil) |
58b84ad67327
default-truncate-lines is depricated since 23.2. Set
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
881
diff
changeset
|
356 |
) |
58b84ad67327
default-truncate-lines is depricated since 23.2. Set
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
881
diff
changeset
|
357 |
(setq truncate-partial-width-windows nil) |
366
223c01e1a084
Don't truncate long lines.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
365
diff
changeset
|
358 |
|
338
ebf88f988c37
Move some appearance related switch together.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
337
diff
changeset
|
359 |
;; show column & line numbers in status bar |
ebf88f988c37
Move some appearance related switch together.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
337
diff
changeset
|
360 |
(setq column-number-mode t) |
ebf88f988c37
Move some appearance related switch together.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
337
diff
changeset
|
361 |
(setq line-number-mode t) |
413
5b28a08bf61b
Set size-indication-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
412
diff
changeset
|
362 |
(setq size-indication-mode t) |
1207
c658f0d30525
Fixes performance issues in Emacs for large files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1206
diff
changeset
|
363 |
(setq line-number-display-limit large-file-warning-threshold) |
c658f0d30525
Fixes performance issues in Emacs for large files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1206
diff
changeset
|
364 |
(setq line-number-display-limit-width 200) |
934
e8af987ef004
document linum-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
933
diff
changeset
|
365 |
;; (linum-mode 1) |
1352
5d8228d51506
Document global-linum-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1351
diff
changeset
|
366 |
;; (global-linum-mode 1) |
338
ebf88f988c37
Move some appearance related switch together.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
337
diff
changeset
|
367 |
|
615
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
368 |
(when window-system |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
369 |
(set-background-color "white") |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
370 |
(set-foreground-color "black") |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
371 |
(set-cursor-color "brown") |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
372 |
;; (set-mouse-color "white") |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
373 |
(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
|
374 |
;;(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
|
375 |
(blink-cursor-mode 1) |
686
563751ecd385
Bind 'yes-or-no-p' to 'y-or-n-p'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
685
diff
changeset
|
376 |
(setq use-file-dialog t) |
563751ecd385
Bind 'yes-or-no-p' to 'y-or-n-p'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
685
diff
changeset
|
377 |
(setq use-dialog-box t) |
615
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
378 |
;; (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
|
379 |
) |
0 | 380 |
|
218
1a48dde2dfa3
See what I am typing immediately (for keystroke in minibuffer).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
217
diff
changeset
|
381 |
;; 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
|
382 |
(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
|
383 |
|
1089
7d9bd1fe3cb0
Set font for IPA and other fontset under Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1085
diff
changeset
|
384 |
(when (eq window-system 'x) |
7d9bd1fe3cb0
Set font for IPA and other fontset under Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1085
diff
changeset
|
385 |
(set-frame-font "-misc-fixed-medium-r-normal--14-*-*-*-c-*-iso10646-1") |
7d9bd1fe3cb0
Set font for IPA and other fontset under Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1085
diff
changeset
|
386 |
(set-fontset-font "fontset-default" 'latin |
7d9bd1fe3cb0
Set font for IPA and other fontset under Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1085
diff
changeset
|
387 |
"-misc-fixed-medium-r-normal--14-*-*-*-c-*-iso10646-1") |
7d9bd1fe3cb0
Set font for IPA and other fontset under Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1085
diff
changeset
|
388 |
(set-fontset-font "fontset-default" 'phonetic |
7d9bd1fe3cb0
Set font for IPA and other fontset under Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1085
diff
changeset
|
389 |
"-misc-fixed-medium-r-normal--14-*-*-*-c-*-iso10646-1") |
7d9bd1fe3cb0
Set font for IPA and other fontset under Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1085
diff
changeset
|
390 |
(set-fontset-font "fontset-default" 'cyrillic |
7d9bd1fe3cb0
Set font for IPA and other fontset under Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1085
diff
changeset
|
391 |
"-misc-fixed-medium-r-normal--14-*-*-*-c-*-iso10646-1") |
7d9bd1fe3cb0
Set font for IPA and other fontset under Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1085
diff
changeset
|
392 |
(set-fontset-font "fontset-default" 'greek |
7d9bd1fe3cb0
Set font for IPA and other fontset under Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1085
diff
changeset
|
393 |
"-misc-fixed-medium-r-normal--14-*-*-*-c-*-iso10646-1")) |
7d9bd1fe3cb0
Set font for IPA and other fontset under Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1085
diff
changeset
|
394 |
|
686
563751ecd385
Bind 'yes-or-no-p' to 'y-or-n-p'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
685
diff
changeset
|
395 |
(fset 'yes-or-no-p 'y-or-n-p) |
563751ecd385
Bind 'yes-or-no-p' to 'y-or-n-p'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
685
diff
changeset
|
396 |
|
563751ecd385
Bind 'yes-or-no-p' to 'y-or-n-p'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
685
diff
changeset
|
397 |
(when (boundp 'confirm-kill-emacs) |
563751ecd385
Bind 'yes-or-no-p' to 'y-or-n-p'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
685
diff
changeset
|
398 |
(setq confirm-kill-emacs 'y-or-n-p)) |
563751ecd385
Bind 'yes-or-no-p' to 'y-or-n-p'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
685
diff
changeset
|
399 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
400 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
401 |
(message "silent runing") |
85 | 402 |
|
403 |
;; (setq inhibit-splash-screen t) ; nonexist on 21.4.1 |
|
404 |
(setq inhibit-startup-message t) |
|
405 |
||
1114
10adeb987567
Make *scratch* buffer empty.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1113
diff
changeset
|
406 |
(setq initial-scratch-message nil) |
10adeb987567
Make *scratch* buffer empty.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1113
diff
changeset
|
407 |
|
734 | 408 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1360 | 409 |
(message "date, time") |
1354
57d416cf71fa
display-time-world settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1352
diff
changeset
|
410 |
|
57d416cf71fa
display-time-world settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1352
diff
changeset
|
411 |
(require 'time) |
57d416cf71fa
display-time-world settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1352
diff
changeset
|
412 |
|
57d416cf71fa
display-time-world settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1352
diff
changeset
|
413 |
;; Also useful such format: (setq display-time-format " %H:%M %d-%m-%y ") |
57d416cf71fa
display-time-world settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1352
diff
changeset
|
414 |
(setq display-time-24hr-format t) |
57d416cf71fa
display-time-world settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1352
diff
changeset
|
415 |
(setq display-time-day-and-date nil) |
57d416cf71fa
display-time-world settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1352
diff
changeset
|
416 |
(setq display-time-default-load-average nil) |
57d416cf71fa
display-time-world settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1352
diff
changeset
|
417 |
(display-time) ; display-time-mode |
57d416cf71fa
display-time-world settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1352
diff
changeset
|
418 |
|
57d416cf71fa
display-time-world settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1352
diff
changeset
|
419 |
;; For (display-time-world). |
57d416cf71fa
display-time-world settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1352
diff
changeset
|
420 |
(setq display-time-world-time-format "%A %d %B %R %z %Z") |
57d416cf71fa
display-time-world settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1352
diff
changeset
|
421 |
(mapc (lambda (el) (add-to-list 'display-time-world-list el)) |
1363
084f0941ff30
Add description for time zones.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1361
diff
changeset
|
422 |
'(("EET" "UTC+2, Eastern European Time") |
084f0941ff30
Add description for time zones.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1361
diff
changeset
|
423 |
("EST" "UTC-5, Eastern Standard Time, New York") |
084f0941ff30
Add description for time zones.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1361
diff
changeset
|
424 |
("EDT" "UTC-4, Eastern Daylight Time, New York"))) |
1354
57d416cf71fa
display-time-world settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1352
diff
changeset
|
425 |
|
57d416cf71fa
display-time-world settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1352
diff
changeset
|
426 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
676
0accf646e451
Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
675
diff
changeset
|
427 |
(message "shell, bash, Cygwin, MSYS") |
675
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
428 |
|
676
0accf646e451
Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
675
diff
changeset
|
429 |
(defvar my-use-windows-shell nil |
1257
a17e5b709fa7
Fix warning from checkdoc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1256
diff
changeset
|
430 |
"If t 'cmdproxy.exe' will be used as shell. |
a17e5b709fa7
Fix warning from checkdoc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1256
diff
changeset
|
431 |
Affect on \\[shell] like commands. If nil, 'sh' will be used." ) |
676
0accf646e451
Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
675
diff
changeset
|
432 |
|
709
2cb49be54b21
Follow new-style (and also UCS-16) Cygwin symlinks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
433 |
(defun follow-cygwin-symlink () |
2cb49be54b21
Follow new-style (and also UCS-16) Cygwin symlinks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
434 |
"Follow new-style (and also UCS-16) Cygwin symlinks." |
2cb49be54b21
Follow new-style (and also UCS-16) Cygwin symlinks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
435 |
(save-excursion |
2cb49be54b21
Follow new-style (and also UCS-16) Cygwin symlinks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
436 |
(goto-char 0) |
2cb49be54b21
Follow new-style (and also UCS-16) Cygwin symlinks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
437 |
(when (looking-at "!<symlink>\xff\xfe") |
2cb49be54b21
Follow new-style (and also UCS-16) Cygwin symlinks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
438 |
(find-alternate-file |
2cb49be54b21
Follow new-style (and also UCS-16) Cygwin symlinks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
439 |
(substring |
2cb49be54b21
Follow new-style (and also UCS-16) Cygwin symlinks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
440 |
(decode-coding-string |
2cb49be54b21
Follow new-style (and also UCS-16) Cygwin symlinks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
441 |
(buffer-substring (match-end 0) (point-max)) |
2cb49be54b21
Follow new-style (and also UCS-16) Cygwin symlinks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
442 |
'utf-16-le) |
2cb49be54b21
Follow new-style (and also UCS-16) Cygwin symlinks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
443 |
0 -1) ; -1 for stripping final \0. |
2cb49be54b21
Follow new-style (and also UCS-16) Cygwin symlinks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
444 |
)))) |
2cb49be54b21
Follow new-style (and also UCS-16) Cygwin symlinks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
445 |
|
731 | 446 |
(defun my-dos2cygwin-path (path) |
447 |
"Convert DOS path to Cygwin according to current mount table." |
|
732
139665dd6ada
my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
448 |
(interactive (list (read-directory-name "Enter DOS path: "))) |
731 | 449 |
(setq path (replace-regexp-in-string "\\\\" "/" (expand-file-name path))) |
450 |
(let ( (table cygwin-mount-table--internal) item prefix ) |
|
451 |
(while table |
|
452 |
(setq item (car table)) |
|
453 |
(setq prefix (concat "\\`" (regexp-quote (car item)))) |
|
454 |
(setq table (cdr table)) |
|
455 |
(when (string-match prefix path) |
|
456 |
(setq path (replace-regexp-in-string prefix (cdr item) path)) |
|
457 |
(setq table nil) |
|
458 |
) ) |
|
459 |
path |
|
460 |
)) |
|
461 |
||
676
0accf646e451
Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
675
diff
changeset
|
462 |
(when (eq system-type 'windows-nt) |
675
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
463 |
(ignore-errors |
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
464 |
(require 'cygwin-mount) |
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
465 |
(cygwin-mount-activate) |
676
0accf646e451
Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
675
diff
changeset
|
466 |
) |
733
67e6d0381996
Use 'find-file-hook' as 'find-file-hooks' marked as deprecated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
724
diff
changeset
|
467 |
(add-hook 'find-file-hook 'follow-cygwin-symlink) |
676
0accf646e451
Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
675
diff
changeset
|
468 |
;; Workaround for Cygwin shell, when set 'CYGWIN=noglob'. By default 'shell-quote-argument' |
0accf646e451
Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
675
diff
changeset
|
469 |
;; quoted by double '\' chars this cause failure. |
0accf646e451
Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
675
diff
changeset
|
470 |
(defun shell-quote-argument (argument) |
0accf646e451
Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
675
diff
changeset
|
471 |
(concat "'" argument "'") |
0accf646e451
Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
675
diff
changeset
|
472 |
) |
0accf646e451
Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
675
diff
changeset
|
473 |
;; Workaround for Cygwin when 'shell-file-name' is 'bash'. |
0accf646e451
Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
675
diff
changeset
|
474 |
(setq null-device "/dev/null") |
0accf646e451
Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
675
diff
changeset
|
475 |
;; Use shell from Cygwin/MinGW. |
0accf646e451
Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
675
diff
changeset
|
476 |
(setq shell-file-name "bash") |
0accf646e451
Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
675
diff
changeset
|
477 |
(setenv "SHELL" "/bin/bash") |
0accf646e451
Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
675
diff
changeset
|
478 |
(modify-coding-system-alist 'process "bash" '(cp1251-unix . cp1251-unix)) |
0accf646e451
Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
675
diff
changeset
|
479 |
) |
0accf646e451
Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
675
diff
changeset
|
480 |
|
746
f7ce19afa666
Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
745
diff
changeset
|
481 |
(when (eq window-system 'w32) |
f7ce19afa666
Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
745
diff
changeset
|
482 |
;; Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin. |
f7ce19afa666
Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
745
diff
changeset
|
483 |
;; 'gnutls-cli' run with '-s' opt and process wait for SIGALRM. |
f7ce19afa666
Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
745
diff
changeset
|
484 |
;; But build-in native Emacs 'kill' command can not send such Cygwin |
f7ce19afa666
Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
745
diff
changeset
|
485 |
;; specific sygnal. So 'starttls-negotiate-gnutls' function infinitely |
f7ce19afa666
Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
745
diff
changeset
|
486 |
;; wait for 'gnutls-cli' output. |
f7ce19afa666
Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
745
diff
changeset
|
487 |
(defadvice signal-process (around cygwin (process sigcode)) |
f7ce19afa666
Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
745
diff
changeset
|
488 |
"Use 'kill.exe' instead build-in Emacs 'kill'." |
f7ce19afa666
Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
745
diff
changeset
|
489 |
(if (eq sigcode 'SIGALRM) |
f7ce19afa666
Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
745
diff
changeset
|
490 |
(shell-command |
f7ce19afa666
Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
745
diff
changeset
|
491 |
(format "kill.exe -s SIGALRM %d" |
f7ce19afa666
Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
745
diff
changeset
|
492 |
(if (processp process) (process-id process) process))) |
f7ce19afa666
Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
745
diff
changeset
|
493 |
ad-do-it |
f7ce19afa666
Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
745
diff
changeset
|
494 |
)) |
f7ce19afa666
Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
745
diff
changeset
|
495 |
(ad-activate 'signal-process) |
748
a42f5a803c98
Do not convert output of 'gnutls-cli'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
747
diff
changeset
|
496 |
(modify-coding-system-alist 'process "gnutls-cli" '(binary . binary)) |
746
f7ce19afa666
Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
745
diff
changeset
|
497 |
) |
f7ce19afa666
Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
745
diff
changeset
|
498 |
|
858
81c925713d9c
Add '.py' and '.sh' as allowed executable extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
857
diff
changeset
|
499 |
(when (eq window-system 'w32) |
81c925713d9c
Add '.py' and '.sh' as allowed executable extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
857
diff
changeset
|
500 |
(add-to-list 'exec-suffixes ".py") |
81c925713d9c
Add '.py' and '.sh' as allowed executable extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
857
diff
changeset
|
501 |
(add-to-list 'exec-suffixes ".sh") |
81c925713d9c
Add '.py' and '.sh' as allowed executable extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
857
diff
changeset
|
502 |
(defun executable-find (command) (locate-file command exec-path exec-suffixes)) |
81c925713d9c
Add '.py' and '.sh' as allowed executable extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
857
diff
changeset
|
503 |
) |
81c925713d9c
Add '.py' and '.sh' as allowed executable extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
857
diff
changeset
|
504 |
|
676
0accf646e451
Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
675
diff
changeset
|
505 |
(ansi-color-for-comint-mode-on) |
0accf646e451
Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
675
diff
changeset
|
506 |
|
1311
5fd2e01bf582
Interpret ANSI color esacape sequence by colorifying cotent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1310
diff
changeset
|
507 |
(defun my-ansi-color (&optional beg end) |
1314
54572ca2b27d
term-scroll-show-maximum-output
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1312
diff
changeset
|
508 |
"Interpret ANSI color esacape sequence by colorifying cotent. |
54572ca2b27d
term-scroll-show-maximum-output
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1312
diff
changeset
|
509 |
Operate on selected region on whole buffer." |
1311
5fd2e01bf582
Interpret ANSI color esacape sequence by colorifying cotent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1310
diff
changeset
|
510 |
(interactive |
5fd2e01bf582
Interpret ANSI color esacape sequence by colorifying cotent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1310
diff
changeset
|
511 |
(if (use-region-p) |
5fd2e01bf582
Interpret ANSI color esacape sequence by colorifying cotent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1310
diff
changeset
|
512 |
(list (region-beginning) (region-end)) |
5fd2e01bf582
Interpret ANSI color esacape sequence by colorifying cotent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1310
diff
changeset
|
513 |
(list (point-min) (point-max)))) |
5fd2e01bf582
Interpret ANSI color esacape sequence by colorifying cotent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1310
diff
changeset
|
514 |
(ansi-color-apply-on-region beg end)) |
5fd2e01bf582
Interpret ANSI color esacape sequence by colorifying cotent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1310
diff
changeset
|
515 |
|
676
0accf646e451
Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
675
diff
changeset
|
516 |
(setq explicit-bash-args '("-i")) |
0accf646e451
Move code for shell setup to proper place. Remove unused code as I do not use
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
675
diff
changeset
|
517 |
(setq explicit-sh-args '("-i")) |
675
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
518 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
519 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
923
e2c69e1c4642
Define C-left/-right navigation in term raw mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
922
diff
changeset
|
520 |
(message "term") |
e2c69e1c4642
Define C-left/-right navigation in term raw mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
922
diff
changeset
|
521 |
|
926
1ad4d40e5b5e
Set term-buffer-maximum-size.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
925
diff
changeset
|
522 |
(setq term-buffer-maximum-size (lsh 1 14)) |
1ad4d40e5b5e
Set term-buffer-maximum-size.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
925
diff
changeset
|
523 |
|
1314
54572ca2b27d
term-scroll-show-maximum-output
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1312
diff
changeset
|
524 |
(setq term-scroll-show-maximum-output t) |
54572ca2b27d
term-scroll-show-maximum-output
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1312
diff
changeset
|
525 |
|
1254
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
526 |
(my--eval-after-load term |
1307
8d652d88c013
Enable file name completion in line-mode of term-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1306
diff
changeset
|
527 |
(define-key term-mode-map [?\t] #'term-dynamic-complete) |
8d652d88c013
Enable file name completion in line-mode of term-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1306
diff
changeset
|
528 |
|
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
529 |
(defun my-term-send-delete-word-forward () (interactive) (term-send-raw-string "\ed")) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
530 |
(defun my-term-send-delete-word-backward () (interactive) (term-send-raw-string "\e\C-h")) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
531 |
(define-key term-raw-map [C-delete] 'my-term-send-delete-word-forward) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
532 |
(define-key term-raw-map [C-backspace] 'my-term-send-delete-word-backward) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
533 |
(defun my-term-send-forward-word () (interactive) (term-send-raw-string "\ef")) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
534 |
(defun my-term-send-backward-word () (interactive) (term-send-raw-string "\eb")) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
535 |
(define-key term-raw-map [C-left] 'my-term-send-backward-word) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
536 |
(define-key term-raw-map [C-right] 'my-term-send-forward-word) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
537 |
(defun my-term-send-m-right () (interactive) (term-send-raw-string "\e[1;3C")) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
538 |
(defun my-term-send-m-left () (interactive) (term-send-raw-string "\e[1;3D")) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
539 |
(define-key term-raw-map [M-right] 'my-term-send-m-right) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
540 |
(define-key term-raw-map [M-left] 'my-term-send-m-left) ) |
923
e2c69e1c4642
Define C-left/-right navigation in term raw mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
922
diff
changeset
|
541 |
|
1062
c1cac6e85f9b
Enable 'goto-address-mode' in 'term-mode'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1061
diff
changeset
|
542 |
(defun my-term-mode-hook () |
c1cac6e85f9b
Enable 'goto-address-mode' in 'term-mode'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1061
diff
changeset
|
543 |
(goto-address-mode 1)) |
c1cac6e85f9b
Enable 'goto-address-mode' in 'term-mode'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1061
diff
changeset
|
544 |
(add-hook 'term-mode-hook #'my-term-mode-hook) |
c1cac6e85f9b
Enable 'goto-address-mode' in 'term-mode'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1061
diff
changeset
|
545 |
|
1307
8d652d88c013
Enable file name completion in line-mode of term-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1306
diff
changeset
|
546 |
(setq term-prompt-regexp "^[^#$%>\n]*[#$%>] *") |
8d652d88c013
Enable file name completion in line-mode of term-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1306
diff
changeset
|
547 |
|
923
e2c69e1c4642
Define C-left/-right navigation in term raw mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
922
diff
changeset
|
548 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1104
0e876ae7ffe7
Show memory usage in proced.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1103
diff
changeset
|
549 |
(message "proced") |
0e876ae7ffe7
Show memory usage in proced.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1103
diff
changeset
|
550 |
|
0e876ae7ffe7
Show memory usage in proced.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1103
diff
changeset
|
551 |
(setq-default proced-format 'medium) |
0e876ae7ffe7
Show memory usage in proced.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1103
diff
changeset
|
552 |
|
0e876ae7ffe7
Show memory usage in proced.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1103
diff
changeset
|
553 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
554 |
(message "whitespaces") |
361
9dbe92b8b329
Added indicate-buffer-boundaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
360
diff
changeset
|
555 |
|
9dbe92b8b329
Added indicate-buffer-boundaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
360
diff
changeset
|
556 |
(setq default-indicate-empty-lines t) |
368
a9c688c1b85f
More verbose buffer-boundaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
366
diff
changeset
|
557 |
(setq default-indicate-buffer-boundaries 'left) |
361
9dbe92b8b329
Added indicate-buffer-boundaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
360
diff
changeset
|
558 |
|
624
9db0b51b229c
Enable showing of trailing whitespace only in developer modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
623
diff
changeset
|
559 |
;; (setq-default show-trailing-whitespace t) |
1063
a804ee9bb8e2
Use global-whitespace-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1061
diff
changeset
|
560 |
|
a804ee9bb8e2
Use global-whitespace-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1061
diff
changeset
|
561 |
(setq whitespace-style '(face trailing tabs)) |
a804ee9bb8e2
Use global-whitespace-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1061
diff
changeset
|
562 |
(setq whitespace-global-modes (append my-devel-mode-list my-text-mode-list)) |
a804ee9bb8e2
Use global-whitespace-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1061
diff
changeset
|
563 |
(ignore-errors |
a804ee9bb8e2
Use global-whitespace-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1061
diff
changeset
|
564 |
(require 'whitespace) |
a804ee9bb8e2
Use global-whitespace-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1061
diff
changeset
|
565 |
(global-whitespace-mode 1)) |
361
9dbe92b8b329
Added indicate-buffer-boundaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
360
diff
changeset
|
566 |
|
9dbe92b8b329
Added indicate-buffer-boundaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
360
diff
changeset
|
567 |
(setq next-line-add-newlines nil) |
9dbe92b8b329
Added indicate-buffer-boundaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
360
diff
changeset
|
568 |
|
9dbe92b8b329
Added indicate-buffer-boundaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
360
diff
changeset
|
569 |
;; See also 'mode-require-final-newline'. |
9dbe92b8b329
Added indicate-buffer-boundaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
360
diff
changeset
|
570 |
(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
|
571 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
572 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
741 | 573 |
(message "server") |
85 | 574 |
|
766
31b6b63917df
Use different 'recentf' and 'desktop' files and do not enable
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
764
diff
changeset
|
575 |
(when (and (>= emacs-major-version 22) (not (eq system-type 'cygwin))) |
394
03d8b85ff815
Do not load server.el for Emacs 21.x.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
393
diff
changeset
|
576 |
(require 'server) |
1203
2d151ab6761d
Fix condition for applying server-ensure-safe-dir fix.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1196
diff
changeset
|
577 |
(when (and (>= emacs-major-version 23) (equal window-system 'w32)) |
394
03d8b85ff815
Do not load server.el for Emacs 21.x.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
393
diff
changeset
|
578 |
(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
|
579 |
(when (or (= emacs-major-version 22) (not (eq (server-running-p server-name) t))) |
1203
2d151ab6761d
Fix condition for applying server-ensure-safe-dir fix.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1196
diff
changeset
|
580 |
(server-start)) ) |
85 | 581 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
582 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
583 |
(message "standart/general settings") |
0 | 584 |
|
336
a252995f7d6b
Move general getting into one place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
335
diff
changeset
|
585 |
;; Try to speed things up, especially in VM. |
a252995f7d6b
Move general getting into one place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
335
diff
changeset
|
586 |
(setq gc-cons-threshold 2000000) |
a252995f7d6b
Move general getting into one place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
335
diff
changeset
|
587 |
|
408
78cf8a4feb66
Fix: default 'command-history' length too short (in Emacs 23.2 is 30).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
404
diff
changeset
|
588 |
;; 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
|
589 |
(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
|
590 |
|
336
a252995f7d6b
Move general getting into one place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
335
diff
changeset
|
591 |
;; Don't beep in my headphones! |
a252995f7d6b
Move general getting into one place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
335
diff
changeset
|
592 |
(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
|
593 |
(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
|
594 |
; revert screen if press [end] or [home] |
880 | 595 |
(setq track-eol nil) |
336
a252995f7d6b
Move general getting into one place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
335
diff
changeset
|
596 |
|
868
dde03832c69f
Comment customising of 'enable-recursive-minibuffers' (use for example purpose).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
867
diff
changeset
|
597 |
;; (setq enable-recursive-minibuffers t) |
867
2a689826c166
Set enable-recursive-minibuffers to t.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
866
diff
changeset
|
598 |
|
336
a252995f7d6b
Move general getting into one place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
335
diff
changeset
|
599 |
;; 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
|
600 |
;; putting things at the end of files which delete all your files! |
1364
f0db8d58205a
Accept safe variables without prompting.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1363
diff
changeset
|
601 |
(setq enable-local-variables :safe |
336
a252995f7d6b
Move general getting into one place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
335
diff
changeset
|
602 |
enable-local-eval 1) |
a252995f7d6b
Move general getting into one place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
335
diff
changeset
|
603 |
|
0 | 604 |
(setq kill-whole-line t) |
605 |
||
879
a14d684e34f7
Don't set view-read-only to 't' because of bug with gettext.el.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
878
diff
changeset
|
606 |
;; Disable because of bug with gettext.el. See |
a14d684e34f7
Don't set view-read-only to 't' because of bug with gettext.el.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
878
diff
changeset
|
607 |
;; http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=287261 |
a14d684e34f7
Don't set view-read-only to 't' because of bug with gettext.el.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
878
diff
changeset
|
608 |
;; (setq view-read-only t) |
102
25585e240b4a
Move customization from .emacs (custom-set-variables) to .emacs-my. Remove duplication.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
101
diff
changeset
|
609 |
|
171
2f2aae1d394c
Set read-quoted-char-radix.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
169
diff
changeset
|
610 |
(setq read-quoted-char-radix 16) |
2f2aae1d394c
Set read-quoted-char-radix.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
169
diff
changeset
|
611 |
|
622
596406094fd1
Port to Mac OS X console Emacs 22.1.1.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
612 |
(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
|
613 |
(setq standard-display-table (make-display-table)) |
1e7314bb84bc
Fix loading error for Emacs 21.3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
612
diff
changeset
|
614 |
(let ( (i ?\x80) hex hi low ) |
1e7314bb84bc
Fix loading error for Emacs 21.3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
612
diff
changeset
|
615 |
(while (<= i ?\xff) |
1e7314bb84bc
Fix loading error for Emacs 21.3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
612
diff
changeset
|
616 |
(setq hex (format "%x" i)) |
1e7314bb84bc
Fix loading error for Emacs 21.3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
612
diff
changeset
|
617 |
(setq hi (elt hex 0)) |
1e7314bb84bc
Fix loading error for Emacs 21.3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
612
diff
changeset
|
618 |
(setq low (elt hex 1)) |
1e7314bb84bc
Fix loading error for Emacs 21.3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
612
diff
changeset
|
619 |
(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
|
620 |
(vector (make-glyph-code ?\\ 'escape-glyph) |
1e7314bb84bc
Fix loading error for Emacs 21.3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
612
diff
changeset
|
621 |
(make-glyph-code ?x 'escape-glyph) |
1e7314bb84bc
Fix loading error for Emacs 21.3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
612
diff
changeset
|
622 |
(make-glyph-code hi 'escape-glyph) |
1e7314bb84bc
Fix loading error for Emacs 21.3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
612
diff
changeset
|
623 |
(make-glyph-code low 'escape-glyph))) |
1e7314bb84bc
Fix loading error for Emacs 21.3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
612
diff
changeset
|
624 |
(setq i (+ i 1)))) |
1e7314bb84bc
Fix loading error for Emacs 21.3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
612
diff
changeset
|
625 |
) |
525
c8d4f5368b04
Show non printable characters in hex, not in octal.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
524
diff
changeset
|
626 |
|
863
d48ba6196046
Add sign for euro and hryvnia.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
862
diff
changeset
|
627 |
(when (>= emacs-major-version 23) |
d48ba6196046
Add sign for euro and hryvnia.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
862
diff
changeset
|
628 |
(define-key global-map "\C-x8g" (lambda nil (interactive) (ucs-insert `,(cdr (assoc-string "HRYVNIA SIGN" (ucs-names) t))))) |
d48ba6196046
Add sign for euro and hryvnia.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
862
diff
changeset
|
629 |
(define-key global-map "\C-x8e" (lambda nil (interactive) (ucs-insert `,(cdr (assoc-string "EURO SIGN" (ucs-names) t))))) |
d48ba6196046
Add sign for euro and hryvnia.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
862
diff
changeset
|
630 |
) |
d48ba6196046
Add sign for euro and hryvnia.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
862
diff
changeset
|
631 |
|
344
b7d0989d9472
generic-define-* before (require 'generic-x) allow load all useful extra modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
342
diff
changeset
|
632 |
;; 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
|
633 |
(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
|
634 |
(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
|
635 |
(require 'generic-x) |
84db44766351
Remove bat-file-mode as it present in generic-x.el.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
339
diff
changeset
|
636 |
|
345
90b5ae643a6d
Move code to proper place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
344
diff
changeset
|
637 |
;; 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
|
638 |
(put 'eval-expression 'disabled nil) |
90b5ae643a6d
Move code to proper place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
344
diff
changeset
|
639 |
(put 'downcase-region 'disabled nil) |
90b5ae643a6d
Move code to proper place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
344
diff
changeset
|
640 |
(put 'upcase-region 'disabled nil) |
90b5ae643a6d
Move code to proper place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
344
diff
changeset
|
641 |
(put 'narrow-to-page 'disabled nil) |
90b5ae643a6d
Move code to proper place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
344
diff
changeset
|
642 |
(put 'narrow-to-region 'disabled nil) |
90b5ae643a6d
Move code to proper place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
344
diff
changeset
|
643 |
(put 'scroll-left 'disabled nil) |
90b5ae643a6d
Move code to proper place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
344
diff
changeset
|
644 |
|
432
650ccece6b01
use-dialog-box set to t.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
431
diff
changeset
|
645 |
(setq |
650ccece6b01
use-dialog-box set to t.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
431
diff
changeset
|
646 |
use-dialog-box t |
650ccece6b01
use-dialog-box set to t.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
431
diff
changeset
|
647 |
x-gtk-show-hidden-files t |
650ccece6b01
use-dialog-box set to t.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
431
diff
changeset
|
648 |
) |
650ccece6b01
use-dialog-box set to t.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
431
diff
changeset
|
649 |
|
719
694f7e388f2b
Add func 'my-prevent-kill-buffer' and prevent kill '*scratch*' buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
718
diff
changeset
|
650 |
(defun my-prevent-kill-buffer () |
865
2a99ede322cd
Prevent from closing 'NOTE.org' buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
864
diff
changeset
|
651 |
(if (member (buffer-name) '("*scratch*" "NOTE.org")) nil t)) |
719
694f7e388f2b
Add func 'my-prevent-kill-buffer' and prevent kill '*scratch*' buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
718
diff
changeset
|
652 |
(add-to-list 'kill-buffer-query-functions 'my-prevent-kill-buffer) |
694f7e388f2b
Add func 'my-prevent-kill-buffer' and prevent kill '*scratch*' buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
718
diff
changeset
|
653 |
|
966
e1eb89d99570
Switch to C-v prefix for my key bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
965
diff
changeset
|
654 |
(define-key global-map "\C-v" nil) |
e1eb89d99570
Switch to C-v prefix for my key bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
965
diff
changeset
|
655 |
(define-key global-map "\C-vt" (lambda nil (interactive) (switch-to-buffer "*scratch*"))) |
722
7d43d5ae86fe
Use "*scratch*" as temp buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
721
diff
changeset
|
656 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
657 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
658 |
(message "scrolling") |
0 | 659 |
|
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
|
660 |
(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
|
661 |
|
127 | 662 |
(setq-default |
1312 | 663 |
;; Set to zero as this recommend documentation. |
802
6168f8ab6479
Fix scrolling speed as I am use settings that documentation recommend avoid.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
801
diff
changeset
|
664 |
scroll-step 0 |
6168f8ab6479
Fix scrolling speed as I am use settings that documentation recommend avoid.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
801
diff
changeset
|
665 |
;; If the value is greater than 100, redisplay will never recenter point, but |
6168f8ab6479
Fix scrolling speed as I am use settings that documentation recommend avoid.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
801
diff
changeset
|
666 |
;; will always scroll just enough text to bring point into view |
6168f8ab6479
Fix scrolling speed as I am use settings that documentation recommend avoid.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
801
diff
changeset
|
667 |
scroll-conservatively 1000 |
127 | 668 |
scroll-preserve-screen-position t |
669 |
) |
|
670 |
||
333
14b07ca8335a
Set margin only for desired modes! Do not frustrate calendar any more.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
332
diff
changeset
|
671 |
;; 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
|
672 |
(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
|
673 |
(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
|
674 |
;; 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
|
675 |
(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
|
676 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
677 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
738
2a81232aa82f
Add 'my-print-unicode' which print UNICODE table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
737
diff
changeset
|
678 |
(message "chars, unicode") |
2a81232aa82f
Add 'my-print-unicode' which print UNICODE table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
737
diff
changeset
|
679 |
|
2a81232aa82f
Add 'my-print-unicode' which print UNICODE table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
737
diff
changeset
|
680 |
(defun my-print-unicode (&optional start end) |
2a81232aa82f
Add 'my-print-unicode' which print UNICODE table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
737
diff
changeset
|
681 |
"Print UNICODE table." |
2a81232aa82f
Add 'my-print-unicode' which print UNICODE table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
737
diff
changeset
|
682 |
(interactive "nstart: \nnend: ") |
2a81232aa82f
Add 'my-print-unicode' which print UNICODE table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
737
diff
changeset
|
683 |
(switch-to-buffer (get-buffer-create "*UNICODE*")) |
2a81232aa82f
Add 'my-print-unicode' which print UNICODE table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
737
diff
changeset
|
684 |
(erase-buffer) |
2a81232aa82f
Add 'my-print-unicode' which print UNICODE table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
737
diff
changeset
|
685 |
(let ( (i start) ) |
2a81232aa82f
Add 'my-print-unicode' which print UNICODE table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
737
diff
changeset
|
686 |
(while (<= i end) |
2a81232aa82f
Add 'my-print-unicode' which print UNICODE table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
737
diff
changeset
|
687 |
(insert (format "%s: U+%04x, %s\n" (char-to-string i) i (get-char-code-property i 'name))) |
2a81232aa82f
Add 'my-print-unicode' which print UNICODE table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
737
diff
changeset
|
688 |
(setq i (1+ i)) |
2a81232aa82f
Add 'my-print-unicode' which print UNICODE table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
737
diff
changeset
|
689 |
))) |
2a81232aa82f
Add 'my-print-unicode' which print UNICODE table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
737
diff
changeset
|
690 |
|
2a81232aa82f
Add 'my-print-unicode' which print UNICODE table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
737
diff
changeset
|
691 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
692 |
(message "search, isearch, occur") |
254
51b47da56551
Highlight on search and repalce.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
253
diff
changeset
|
693 |
|
989
2967a171f889
Fix: case-fold-search become buffer local so set default value...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
988
diff
changeset
|
694 |
(setq-default case-fold-search t) |
217
1c42ba3ac4ba
Case insensitive search. Group search customization together.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
216
diff
changeset
|
695 |
|
254
51b47da56551
Highlight on search and repalce.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
253
diff
changeset
|
696 |
(setq query-replace-highlight t) ; highlight during query |
51b47da56551
Highlight on search and repalce.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
253
diff
changeset
|
697 |
(setq search-highlight t) ; highlight incremental search |
51b47da56551
Highlight on search and repalce.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
253
diff
changeset
|
698 |
|
563
6d5387a4e95d
Move code to proper place. Add 'f7' key binding for 'occur'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
562
diff
changeset
|
699 |
;; 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
|
700 |
(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
|
701 |
(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
|
702 |
) |
6d5387a4e95d
Move code to proper place. Add 'f7' key binding for 'occur'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
562
diff
changeset
|
703 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
704 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
705 |
(message "grep, find") |
526
9e613d7de6e1
Added exclude pattern to 'grep-find-ignored-directories'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
525
diff
changeset
|
706 |
|
542 | 707 |
;; -ls produce very noisy output: |
708 |
;; (setq find-ls-option '("-ls" . "")) |
|
709 |
;; So I use next expression, which work with GNU find, I replace %s with '0' |
|
710 |
;; to avoid unnecessary sys calls and this make output aligned by column: |
|
1298
f25b62528baa
Show size in bytes by find-dired command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1296
diff
changeset
|
711 |
(setq find-ls-option '("-printf ' -rw-rw-rw- %9s %AY-%Am-%Ad %AH:%AM %p\n'" . "")) |
542 | 712 |
|
357
84c8c5f03fd4
Correct grep command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
356
diff
changeset
|
713 |
;; 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
|
714 |
(setq grep-highlight-matches nil) |
84c8c5f03fd4
Correct grep command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
356
diff
changeset
|
715 |
(setq grep-use-null-device nil) |
84c8c5f03fd4
Correct grep command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
356
diff
changeset
|
716 |
|
1254
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
717 |
(my--eval-after-load grep |
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
718 |
(add-to-list 'grep-find-ignored-directories "build" t) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
719 |
(add-to-list 'grep-find-ignored-directories "dist" t) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
720 |
(add-to-list 'grep-find-ignored-directories "lib" t) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
721 |
(add-to-list 'grep-find-ignored-directories "_build" t) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
722 |
(add-to-list 'grep-find-ignored-directories "_dist" t) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
723 |
(add-to-list 'grep-find-ignored-directories "_lib" t) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
724 |
(when (boundp 'grep-find-ignored-files) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
725 |
(add-to-list 'grep-find-ignored-files "*TAGS") |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
726 |
(add-to-list 'grep-find-ignored-files "GPATH")) ) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
727 |
|
768
4af9b5e3ac15
Bind 'F7' to 'rgrep' as 'M-F7' does not possible in terminal.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
767
diff
changeset
|
728 |
(global-set-key [f7] 'rgrep) |
356
fd1af7a494de
Added key binding for rgrep.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
355
diff
changeset
|
729 |
(global-set-key [M-f7] 'rgrep) |
fd1af7a494de
Added key binding for rgrep.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
355
diff
changeset
|
730 |
|
1068
93381cc4a63d
Implement lzgrep and rzgrep commands.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1067
diff
changeset
|
731 |
(defun lzgrep () |
93381cc4a63d
Implement lzgrep and rzgrep commands.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1067
diff
changeset
|
732 |
(interactive) |
93381cc4a63d
Implement lzgrep and rzgrep commands.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1067
diff
changeset
|
733 |
(let ( (grep-template "zgrep <C> -nH -e <R> <F>") (grep-find-ignored-files nil) ) |
1365
9109292f5a13
Fix: Warning: `flet' is an obsolete macro (as of 24.3); use either `cl-flet' or `cl-letf'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1364
diff
changeset
|
734 |
(cl-flet ( (grep-compute-defaults () nil) ) |
1068
93381cc4a63d
Implement lzgrep and rzgrep commands.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1067
diff
changeset
|
735 |
(call-interactively #'lgrep)))) |
93381cc4a63d
Implement lzgrep and rzgrep commands.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1067
diff
changeset
|
736 |
|
93381cc4a63d
Implement lzgrep and rzgrep commands.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1067
diff
changeset
|
737 |
(defun rzgrep () |
93381cc4a63d
Implement lzgrep and rzgrep commands.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1067
diff
changeset
|
738 |
(interactive) |
93381cc4a63d
Implement lzgrep and rzgrep commands.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1067
diff
changeset
|
739 |
(let ( (grep-find-template "find . -type f <F> -exec zgrep <C> -nH -e <R> {} +") (grep-find-ignored-files nil) ) |
1365
9109292f5a13
Fix: Warning: `flet' is an obsolete macro (as of 24.3); use either `cl-flet' or `cl-letf'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1364
diff
changeset
|
740 |
(cl-flet ( (grep-compute-defaults () nil) ) |
1068
93381cc4a63d
Implement lzgrep and rzgrep commands.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1067
diff
changeset
|
741 |
(call-interactively #'rgrep)))) |
93381cc4a63d
Implement lzgrep and rzgrep commands.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1067
diff
changeset
|
742 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
743 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
861
f8f14aacfc9b
Enable 'global-hi-lock-mode'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
860
diff
changeset
|
744 |
(message "highlighting") |
296
e502c69ab80a
Make header name like tags, separated by comma and ended on period.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
745 |
|
996
0eb9113dddaa
Increase scrolling speed by defer consuming operation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
995
diff
changeset
|
746 |
;; Increase scrolling speed by defer consuming operation. |
1000
289782aa4afa
I disable this due to bugs in Emacs (it doesn't highlight at all until you
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
999
diff
changeset
|
747 |
;; I disable this due to bugs in Emacs (it doesn't highlight at all until you |
289782aa4afa
I disable this due to bugs in Emacs (it doesn't highlight at all until you
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
999
diff
changeset
|
748 |
;; press any key). |
289782aa4afa
I disable this due to bugs in Emacs (it doesn't highlight at all until you
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
999
diff
changeset
|
749 |
;; (setq jit-lock-defer-time 0.01) |
996
0eb9113dddaa
Increase scrolling speed by defer consuming operation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
995
diff
changeset
|
750 |
|
0 | 751 |
(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
|
752 |
(global-font-lock-mode 1) |
0 | 753 |
|
1333
9927012ea835
Disable global-hi-lock-mode due to bug: 24.5; "(global-hi-lock-mode 1)" broke "C-x" key bindings inside "M-x term", especially for "emacs -nw" (Emacs inside Emacs).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1332
diff
changeset
|
754 |
;; http://debbugs.gnu.org/cgi/bugreport.cgi?archive=yes&bug=22620 |
9927012ea835
Disable global-hi-lock-mode due to bug: 24.5; "(global-hi-lock-mode 1)" broke "C-x" key bindings inside "M-x term", especially for "emacs -nw" (Emacs inside Emacs).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1332
diff
changeset
|
755 |
;; 24.5; "(global-hi-lock-mode 1)" broke "C-x" key bindings inside "M-x term", especially for "emacs -nw" (Emacs inside Emacs). |
9927012ea835
Disable global-hi-lock-mode due to bug: 24.5; "(global-hi-lock-mode 1)" broke "C-x" key bindings inside "M-x term", especially for "emacs -nw" (Emacs inside Emacs).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1332
diff
changeset
|
756 |
; (global-hi-lock-mode -1) |
861
f8f14aacfc9b
Enable 'global-hi-lock-mode'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
860
diff
changeset
|
757 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
758 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
759 |
(message "highlight selected text") |
64
54ef0d72488f
More pretty with selecting.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
63
diff
changeset
|
760 |
|
776
1e680ded54d1
'transient-mark-mode' and 'pc-selection-mode' are deprecated. Emacs 24 default
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
775
diff
changeset
|
761 |
(delete-selection-mode 1) |
1e680ded54d1
'transient-mark-mode' and 'pc-selection-mode' are deprecated. Emacs 24 default
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
775
diff
changeset
|
762 |
|
1e680ded54d1
'transient-mark-mode' and 'pc-selection-mode' are deprecated. Emacs 24 default
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
775
diff
changeset
|
763 |
(when (<= emacs-major-version 23) |
1e680ded54d1
'transient-mark-mode' and 'pc-selection-mode' are deprecated. Emacs 24 default
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
775
diff
changeset
|
764 |
;; 1/-1, when the mark is active, the region is highlighted. |
1e680ded54d1
'transient-mark-mode' and 'pc-selection-mode' are deprecated. Emacs 24 default
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
775
diff
changeset
|
765 |
(transient-mark-mode 1) |
80
bfc8c3d03527
Correct code to remove warning in *Messages* when loading .emacs-my.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
79
diff
changeset
|
766 |
|
776
1e680ded54d1
'transient-mark-mode' and 'pc-selection-mode' are deprecated. Emacs 24 default
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
775
diff
changeset
|
767 |
;; Order of next items is important, (assignment must done before pc-selection-mode enabled). |
1e680ded54d1
'transient-mark-mode' and 'pc-selection-mode' are deprecated. Emacs 24 default
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
775
diff
changeset
|
768 |
(require 'pc-select) |
1e680ded54d1
'transient-mark-mode' and 'pc-selection-mode' are deprecated. Emacs 24 default
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
775
diff
changeset
|
769 |
(setq pc-select-selection-keys-only t) ; To avoid some key bindings as F6, etc. |
1e680ded54d1
'transient-mark-mode' and 'pc-selection-mode' are deprecated. Emacs 24 default
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
775
diff
changeset
|
770 |
(setq pc-select-meta-moves-sexps t) |
1e680ded54d1
'transient-mark-mode' and 'pc-selection-mode' are deprecated. Emacs 24 default
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
775
diff
changeset
|
771 |
(cond |
1e680ded54d1
'transient-mark-mode' and 'pc-selection-mode' are deprecated. Emacs 24 default
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
775
diff
changeset
|
772 |
((= emacs-major-version 21) (pc-selection-mode)) |
1e680ded54d1
'transient-mark-mode' and 'pc-selection-mode' are deprecated. Emacs 24 default
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
775
diff
changeset
|
773 |
((>= emacs-major-version 22) (pc-selection-mode 1)) |
1e680ded54d1
'transient-mark-mode' and 'pc-selection-mode' are deprecated. Emacs 24 default
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
775
diff
changeset
|
774 |
) |
1e680ded54d1
'transient-mark-mode' and 'pc-selection-mode' are deprecated. Emacs 24 default
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
775
diff
changeset
|
775 |
) |
64
54ef0d72488f
More pretty with selecting.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
63
diff
changeset
|
776 |
|
1122
0e255897262a
Set selection background color.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1121
diff
changeset
|
777 |
(when window-system |
0e255897262a
Set selection background color.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1121
diff
changeset
|
778 |
(set-face-attribute 'region nil :background "light blue")) |
0e255897262a
Set selection background color.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1121
diff
changeset
|
779 |
|
146
506d2883199f
kill/yank func also use/update CLIPBOARD selsction on X window.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
145
diff
changeset
|
780 |
(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
|
781 |
(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
|
782 |
) |
64
54ef0d72488f
More pretty with selecting.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
63
diff
changeset
|
783 |
|
1268
9fecb7abda89
Use er/expand-region if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1265
diff
changeset
|
784 |
(when (fboundp 'er/expand-region) |
9fecb7abda89
Use er/expand-region if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1265
diff
changeset
|
785 |
(global-set-key (kbd "C-=") 'er/expand-region)) |
9fecb7abda89
Use er/expand-region if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1265
diff
changeset
|
786 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
787 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
788 |
(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
|
789 |
|
1277
ae5c2b9ab4bd
Avoid overriding text background - highlight only after line end.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1276
diff
changeset
|
790 |
(defun my-hl-line-range-function () |
ae5c2b9ab4bd
Avoid overriding text background - highlight only after line end.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1276
diff
changeset
|
791 |
(cons (line-end-position) (line-beginning-position 2))) |
ae5c2b9ab4bd
Avoid overriding text background - highlight only after line end.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1276
diff
changeset
|
792 |
(setq hl-line-range-function #'my-hl-line-range-function) |
ae5c2b9ab4bd
Avoid overriding text background - highlight only after line end.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1276
diff
changeset
|
793 |
|
296
e502c69ab80a
Make header name like tags, separated by comma and ended on period.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
794 |
(when window-system |
1277
ae5c2b9ab4bd
Avoid overriding text background - highlight only after line end.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1276
diff
changeset
|
795 |
(require 'hl-line) |
ae5c2b9ab4bd
Avoid overriding text background - highlight only after line end.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1276
diff
changeset
|
796 |
(set-face-attribute 'hl-line nil :inherit nil :background "light yellow") |
ae5c2b9ab4bd
Avoid overriding text background - highlight only after line end.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1276
diff
changeset
|
797 |
(setq global-hl-line-sticky-flag t) |
ae5c2b9ab4bd
Avoid overriding text background - highlight only after line end.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1276
diff
changeset
|
798 |
(global-hl-line-mode 1)) |
0 | 799 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
800 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
801 |
(message "paren, braces") |
0 | 802 |
|
803 |
(show-paren-mode 1) ; Parenthesis matching via highlighting. |
|
804 |
(setq show-paren-style (quote parenthesis)) |
|
805 |
||
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
806 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
807 |
(message "keyboard, mouse") |
0 | 808 |
|
1115
f67ef4132301
mouse-yank-at-point
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1114
diff
changeset
|
809 |
(setq mouse-yank-at-point t) |
f67ef4132301
mouse-yank-at-point
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1114
diff
changeset
|
810 |
|
1080
8fad37c1d42f
Refactoring input method selection.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1076
diff
changeset
|
811 |
;; (pc-bindings-mode) ; I define own keybinding... |
8fad37c1d42f
Refactoring input method selection.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1076
diff
changeset
|
812 |
|
402
b1a9c8e0c22e
As cyrillic-jcuken input metod fixed
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
398
diff
changeset
|
813 |
;; cyrillic-jis-russian for 567 is :,. |
b1a9c8e0c22e
As cyrillic-jcuken input metod fixed
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
398
diff
changeset
|
814 |
;; cyrillic-jcuken for SHIFT 567 is :,. |
b1a9c8e0c22e
As cyrillic-jcuken input metod fixed
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
398
diff
changeset
|
815 |
;; russian-computer for SHIFT 567 is %^& |
1080
8fad37c1d42f
Refactoring input method selection.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1076
diff
changeset
|
816 |
(setq my-russian-input-method 'russian-computer) |
1081
37ddc669849c
Enhance selection of input methods by using numeric prefix for modeless
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1080
diff
changeset
|
817 |
(setq my-ukranian-input-method 'ukrainian-computer) |
37ddc669849c
Enhance selection of input methods by using numeric prefix for modeless
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1080
diff
changeset
|
818 |
(setq my-ipa-input-method 'ipa-x-sampa) |
1080
8fad37c1d42f
Refactoring input method selection.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1076
diff
changeset
|
819 |
(when (<= emacs-major-version 21) |
8fad37c1d42f
Refactoring input method selection.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1076
diff
changeset
|
820 |
(setq my-russian-input-method 'cyrillic-jcuken) |
8fad37c1d42f
Refactoring input method selection.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1076
diff
changeset
|
821 |
(setq my-ukranian-input-method 'cyrillic-jcuken)) |
8fad37c1d42f
Refactoring input method selection.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1076
diff
changeset
|
822 |
(setq default-input-method my-russian-input-method) |
0 | 823 |
|
1081
37ddc669849c
Enhance selection of input methods by using numeric prefix for modeless
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1080
diff
changeset
|
824 |
(defun my-toggle-input-method (&optional arg) |
37ddc669849c
Enhance selection of input methods by using numeric prefix for modeless
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1080
diff
changeset
|
825 |
(interactive "P") |
37ddc669849c
Enhance selection of input methods by using numeric prefix for modeless
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1080
diff
changeset
|
826 |
(if (numberp arg) |
37ddc669849c
Enhance selection of input methods by using numeric prefix for modeless
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1080
diff
changeset
|
827 |
(cond |
37ddc669849c
Enhance selection of input methods by using numeric prefix for modeless
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1080
diff
changeset
|
828 |
((eq arg 1) |
37ddc669849c
Enhance selection of input methods by using numeric prefix for modeless
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1080
diff
changeset
|
829 |
(activate-input-method nil)) |
37ddc669849c
Enhance selection of input methods by using numeric prefix for modeless
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1080
diff
changeset
|
830 |
((eq arg 2) |
37ddc669849c
Enhance selection of input methods by using numeric prefix for modeless
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1080
diff
changeset
|
831 |
(activate-input-method my-russian-input-method)) |
37ddc669849c
Enhance selection of input methods by using numeric prefix for modeless
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1080
diff
changeset
|
832 |
((eq arg 3) |
37ddc669849c
Enhance selection of input methods by using numeric prefix for modeless
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1080
diff
changeset
|
833 |
(activate-input-method my-ukranian-input-method)) |
37ddc669849c
Enhance selection of input methods by using numeric prefix for modeless
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1080
diff
changeset
|
834 |
((eq arg 4) |
1349
bb5f3306e2a8
Swap ipa and greek index.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1348
diff
changeset
|
835 |
(activate-input-method 'greek)) |
1317
0097c1ddafef
Add quick access to TeX input method.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1316
diff
changeset
|
836 |
((eq arg 5) |
1349
bb5f3306e2a8
Swap ipa and greek index.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1348
diff
changeset
|
837 |
(activate-input-method my-ipa-input-method)) |
1348
93bcfa82cb34
Add Greek input method.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1347
diff
changeset
|
838 |
((eq arg 6) |
1317
0097c1ddafef
Add quick access to TeX input method.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1316
diff
changeset
|
839 |
(activate-input-method 'TeX)) ) |
1081
37ddc669849c
Enhance selection of input methods by using numeric prefix for modeless
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1080
diff
changeset
|
840 |
(toggle-input-method arg)) ) |
37ddc669849c
Enhance selection of input methods by using numeric prefix for modeless
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1080
diff
changeset
|
841 |
|
37ddc669849c
Enhance selection of input methods by using numeric prefix for modeless
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1080
diff
changeset
|
842 |
(global-set-key (kbd "C-\\") 'my-toggle-input-method) |
37ddc669849c
Enhance selection of input methods by using numeric prefix for modeless
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1080
diff
changeset
|
843 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
844 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
845 |
(message "mouse") |
0 | 846 |
|
847 |
;; Scroll Bar gets dragged by mouse butn 1 |
|
848 |
(global-set-key [vertical-scroll-bar down-mouse-1] 'scroll-bar-drag) |
|
849 |
;; Paste at point NOT at cursor |
|
151 | 850 |
(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
|
851 |
(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
|
852 |
(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
|
853 |
) |
0 | 854 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
855 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
856 |
(message "key binding, short-keys") |
0 | 857 |
|
1291
9cef82dd4c45
my--smart-end-of-line like my--smart-beginning-of-line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1290
diff
changeset
|
858 |
(defun my--smart-beginning-of-line () |
9cef82dd4c45
my--smart-end-of-line like my--smart-beginning-of-line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1290
diff
changeset
|
859 |
"Move point to `beginning-of-line'. If repeat command it cycle |
1157
2036f6052212
my-smart-beginning-of-line
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1156
diff
changeset
|
860 |
position between `back-to-indentation' and `beginning-of-line'." |
1158
89f674f09ca3
If the string begins with ^' andshift-select-mode' is non-nil, Emacs first
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1157
diff
changeset
|
861 |
(interactive "^") |
1291
9cef82dd4c45
my--smart-end-of-line like my--smart-beginning-of-line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1290
diff
changeset
|
862 |
(if (and (eq last-command 'my--smart-beginning-of-line) |
1157
2036f6052212
my-smart-beginning-of-line
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1156
diff
changeset
|
863 |
(= (line-beginning-position) (point))) |
2036f6052212
my-smart-beginning-of-line
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1156
diff
changeset
|
864 |
(back-to-indentation) |
2036f6052212
my-smart-beginning-of-line
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1156
diff
changeset
|
865 |
(beginning-of-line))) |
2036f6052212
my-smart-beginning-of-line
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1156
diff
changeset
|
866 |
|
1291
9cef82dd4c45
my--smart-end-of-line like my--smart-beginning-of-line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1290
diff
changeset
|
867 |
(defun my--smart-end-of-line () |
9cef82dd4c45
my--smart-end-of-line like my--smart-beginning-of-line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1290
diff
changeset
|
868 |
"Move point to `end-of-line'. If repeat command it cycle |
9cef82dd4c45
my--smart-end-of-line like my--smart-beginning-of-line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1290
diff
changeset
|
869 |
position between last non-whitespace and `end-of-line'." |
9cef82dd4c45
my--smart-end-of-line like my--smart-beginning-of-line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1290
diff
changeset
|
870 |
(interactive "^") |
9cef82dd4c45
my--smart-end-of-line like my--smart-beginning-of-line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1290
diff
changeset
|
871 |
(if (and (eq last-command 'my--smart-end-of-line) |
9cef82dd4c45
my--smart-end-of-line like my--smart-beginning-of-line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1290
diff
changeset
|
872 |
(= (line-end-position) (point))) |
9cef82dd4c45
my--smart-end-of-line like my--smart-beginning-of-line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1290
diff
changeset
|
873 |
(skip-syntax-backward " " (line-beginning-position)) |
9cef82dd4c45
my--smart-end-of-line like my--smart-beginning-of-line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1290
diff
changeset
|
874 |
(end-of-line))) |
9cef82dd4c45
my--smart-end-of-line like my--smart-beginning-of-line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1290
diff
changeset
|
875 |
|
9cef82dd4c45
my--smart-end-of-line like my--smart-beginning-of-line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1290
diff
changeset
|
876 |
(global-set-key [home] 'my--smart-beginning-of-line) |
9cef82dd4c45
my--smart-end-of-line like my--smart-beginning-of-line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1290
diff
changeset
|
877 |
(global-set-key [end] 'my--smart-end-of-line) |
1157
2036f6052212
my-smart-beginning-of-line
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1156
diff
changeset
|
878 |
(global-set-key [C-home] 'beginning-of-buffer) |
2036f6052212
my-smart-beginning-of-line
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1156
diff
changeset
|
879 |
(global-set-key [C-end] 'end-of-buffer) |
2036f6052212
my-smart-beginning-of-line
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1156
diff
changeset
|
880 |
(global-set-key [C-delete] 'kill-word) |
2036f6052212
my-smart-beginning-of-line
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1156
diff
changeset
|
881 |
(global-set-key [delete] 'delete-char) |
0 | 882 |
;; (global-set-key [backspace] 'backward-delete-char-untabify) ; not work properly in *info* mode |
883 |
||
884 |
(global-set-key [f2] 'save-buffer) |
|
134
a071b60e4339
Set key binding to rename buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
125
diff
changeset
|
885 |
(global-set-key [S-f6] 'rename-buffer) |
0 | 886 |
(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
|
887 |
(global-set-key [f6] 'toggle-truncate-lines) |
1019
cbc477acb47e
Switch to other window by Super-TAB.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1018
diff
changeset
|
888 |
(global-set-key [s-tab] 'other-window) |
cbc477acb47e
Switch to other window by Super-TAB.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1018
diff
changeset
|
889 |
|
cbc477acb47e
Switch to other window by Super-TAB.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1018
diff
changeset
|
890 |
;; Disable suspend. It is ugly. |
615
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
891 |
(when window-system |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
892 |
(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
|
893 |
(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
|
894 |
|
0 | 895 |
;; (global-set-key [language-change] 'ignore) |
896 |
||
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
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 "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
|
899 |
|
162
0ac8d1f4304d
Emacs 23.1 no longer need codepage-setup.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
157
diff
changeset
|
900 |
;; 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
|
901 |
(when (<= emacs-major-version 22) |
0ac8d1f4304d
Emacs 23.1 no longer need codepage-setup.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
157
diff
changeset
|
902 |
(codepage-setup 866) |
0ac8d1f4304d
Emacs 23.1 no longer need codepage-setup.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
157
diff
changeset
|
903 |
(codepage-setup 1251) |
0ac8d1f4304d
Emacs 23.1 no longer need codepage-setup.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
157
diff
changeset
|
904 |
) |
0 | 905 |
|
53 | 906 |
;; Comment because prefer-coding-system will be ignored. |
907 |
;; (setq-default coding-system-for-read 'cp1251-dos) |
|
908 |
;; (setq-default coding-system-for-write 'cp1251-dos) |
|
0 | 909 |
|
910 |
;; (setq locale-coding-system 'cp1251-dos) |
|
583 | 911 |
;; (set-language-environment 'UTF-8) |
0 | 912 |
;; (set-terminal-coding-system 'cp1251) |
913 |
;; (set-keyboard-coding-system 'cp1251) |
|
914 |
||
4
46543c097be0
Transfer changer from .eamcs_unix, add case for w32 or other system.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
3
diff
changeset
|
915 |
(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
|
916 |
(cond |
106
0591d06cf752
Решил проблему copy/paste в X. Решил проблему поиска в UTF-8 буфере.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
102
diff
changeset
|
917 |
((equal window-system 'w32) ; also (string-equal system-type "windows-nt") |
839
27fac2557f13
Don't set 'selection-coding-system' for Windows. This is no longer needed.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
835
diff
changeset
|
918 |
;; (set-selection-coding-system 'utf-16-le-dos) |
615
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
919 |
(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
|
920 |
(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
|
921 |
(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
|
922 |
) |
106
0591d06cf752
Решил проблему copy/paste в X. Решил проблему поиска в UTF-8 буфере.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
102
diff
changeset
|
923 |
((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
|
924 |
(prefer-coding-system 'utf-8-unix) |
991
e8c74f4c5d9e
Set 'selection-coding-system' to 'nil' to automatically select proper coding
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
990
diff
changeset
|
925 |
(setq selection-coding-system nil) |
615
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
926 |
(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
|
927 |
(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
|
928 |
) |
769
5ed69391dc95
Fix coding for Cygwin Emacs when LANG=ru_RU.cp1251.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
768
diff
changeset
|
929 |
((eq system-type 'cygwin) |
1196
fd26eef91bf6
Fix: if: Wrong type argument: stringp, nil.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1195
diff
changeset
|
930 |
(when (and (getenv "LANG") (string-match "1251\\'" (getenv "LANG"))) |
769
5ed69391dc95
Fix coding for Cygwin Emacs when LANG=ru_RU.cp1251.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
768
diff
changeset
|
931 |
(prefer-coding-system 'cp1251-unix) |
5ed69391dc95
Fix coding for Cygwin Emacs when LANG=ru_RU.cp1251.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
768
diff
changeset
|
932 |
(prefer-coding-system 'utf-8-unix) |
5ed69391dc95
Fix coding for Cygwin Emacs when LANG=ru_RU.cp1251.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
768
diff
changeset
|
933 |
(modify-coding-system-alist 'process ".*" 'cp1251-unix) |
5ed69391dc95
Fix coding for Cygwin Emacs when LANG=ru_RU.cp1251.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
768
diff
changeset
|
934 |
) |
5ed69391dc95
Fix coding for Cygwin Emacs when LANG=ru_RU.cp1251.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
768
diff
changeset
|
935 |
) |
622
596406094fd1
Port to Mac OS X console Emacs 22.1.1.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
936 |
((eq system-type 'darwin) |
623 | 937 |
nil |
938 |
) |
|
615
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
939 |
) |
0 | 940 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
941 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1142
7906db469af0
Switch to ido from iswitchb. Use ido key binding instead of ffap-bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1141
diff
changeset
|
942 |
(message "selecting/switching, creating/killing buffers, open file") |
7906db469af0
Switch to ido from iswitchb. Use ido key binding instead of ffap-bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1141
diff
changeset
|
943 |
(message "ido, ffap") |
7906db469af0
Switch to ido from iswitchb. Use ido key binding instead of ffap-bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1141
diff
changeset
|
944 |
|
1220
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
945 |
;; (add-hook 'find-file-hook #'make-frame-visible) |
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
946 |
|
1200
a8fcda9c0aab
Check if ido available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1199
diff
changeset
|
947 |
(require 'ffap) |
1330
c0ac8ff63268
Add examples of ffap settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1329
diff
changeset
|
948 |
;; Ido makes appropriate binding. |
c0ac8ff63268
Add examples of ffap settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1329
diff
changeset
|
949 |
;(ffap-bindings) |
c0ac8ff63268
Add examples of ffap settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1329
diff
changeset
|
950 |
;; C-u C-x C-f finds the file at point |
c0ac8ff63268
Add examples of ffap settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1329
diff
changeset
|
951 |
;(setq ffap-require-prefix t) |
c0ac8ff63268
Add examples of ffap settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1329
diff
changeset
|
952 |
;; browse urls at point via w3m |
c0ac8ff63268
Add examples of ffap settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1329
diff
changeset
|
953 |
;(setq ffap-url-fetcher 'w3m-browse-url) |
1142
7906db469af0
Switch to ido from iswitchb. Use ido key binding instead of ffap-bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1141
diff
changeset
|
954 |
|
1220
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
955 |
(setq find-file-existing-other-name t) |
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
956 |
|
1142
7906db469af0
Switch to ido from iswitchb. Use ido key binding instead of ffap-bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1141
diff
changeset
|
957 |
(setq ido-enable-flex-matching t) |
7906db469af0
Switch to ido from iswitchb. Use ido key binding instead of ffap-bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1141
diff
changeset
|
958 |
|
7906db469af0
Switch to ido from iswitchb. Use ido key binding instead of ffap-bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1141
diff
changeset
|
959 |
(setq ido-use-filename-at-point 'guess) |
7906db469af0
Switch to ido from iswitchb. Use ido key binding instead of ffap-bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1141
diff
changeset
|
960 |
(setq ido-use-url-at-point t) |
1310
ca9bfec974ac
Don't jump to unknown directory if file not found in current!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1309
diff
changeset
|
961 |
(setq ido-auto-merge-work-directories-length -1) |
1142
7906db469af0
Switch to ido from iswitchb. Use ido key binding instead of ffap-bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1141
diff
changeset
|
962 |
(setq ido-enable-tramp-completion t) |
7906db469af0
Switch to ido from iswitchb. Use ido key binding instead of ffap-bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1141
diff
changeset
|
963 |
(setq ido-use-virtual-buffers t) |
1218
53eaec665fcf
Increase ido limits.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1215
diff
changeset
|
964 |
(setq ido-max-prospects 16) |
53eaec665fcf
Increase ido limits.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1215
diff
changeset
|
965 |
(setq ido-max-work-directory-list 100) |
1142
7906db469af0
Switch to ido from iswitchb. Use ido key binding instead of ffap-bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1141
diff
changeset
|
966 |
|
7906db469af0
Switch to ido from iswitchb. Use ido key binding instead of ffap-bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1141
diff
changeset
|
967 |
(setq ido-create-new-buffer 'always) |
7906db469af0
Switch to ido from iswitchb. Use ido key binding instead of ffap-bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1141
diff
changeset
|
968 |
|
7906db469af0
Switch to ido from iswitchb. Use ido key binding instead of ffap-bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1141
diff
changeset
|
969 |
(setq ido-file-extensions-order '(".java" ".c" ".py" ".xml" ".txt" ".el" ".ini" ".cfg" ".cnf" ".log")) |
7906db469af0
Switch to ido from iswitchb. Use ido key binding instead of ffap-bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1141
diff
changeset
|
970 |
|
1229 | 971 |
(setq ido-ignore-buffers '("\\` ")) |
972 |
(setq ido-ignore-extensions nil) ; From completion-ignored-extensions. |
|
1191 | 973 |
(setq ido-case-fold t) |
1142
7906db469af0
Switch to ido from iswitchb. Use ido key binding instead of ffap-bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1141
diff
changeset
|
974 |
;; ido-ignore-directories |
7906db469af0
Switch to ido from iswitchb. Use ido key binding instead of ffap-bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1141
diff
changeset
|
975 |
;; ido-ignore-files |
7906db469af0
Switch to ido from iswitchb. Use ido key binding instead of ffap-bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1141
diff
changeset
|
976 |
|
1201
c300c3c9e973
Add key bindings for finding file that work in M-x term.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1200
diff
changeset
|
977 |
(unless |
c300c3c9e973
Add key bindings for finding file that work in M-x term.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1200
diff
changeset
|
978 |
(ignore-errors |
c300c3c9e973
Add key bindings for finding file that work in M-x term.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1200
diff
changeset
|
979 |
(require 'ido) |
c300c3c9e973
Add key bindings for finding file that work in M-x term.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1200
diff
changeset
|
980 |
(ido-mode 1) |
c300c3c9e973
Add key bindings for finding file that work in M-x term.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1200
diff
changeset
|
981 |
(global-set-key [?\s-d] #'ido-dired) |
c300c3c9e973
Add key bindings for finding file that work in M-x term.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1200
diff
changeset
|
982 |
(global-set-key [?\s-f] #'ido-find-file) |
c300c3c9e973
Add key bindings for finding file that work in M-x term.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1200
diff
changeset
|
983 |
t) |
c300c3c9e973
Add key bindings for finding file that work in M-x term.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1200
diff
changeset
|
984 |
(global-set-key [?\s-d] #'dired) |
c300c3c9e973
Add key bindings for finding file that work in M-x term.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1200
diff
changeset
|
985 |
(global-set-key [?\s-f] #'find-file)) |
953
3ad3abeec5f9
Move related code to common place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
952
diff
changeset
|
986 |
|
956
661dc3bfc076
Remove key bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
955
diff
changeset
|
987 |
(global-set-key [?\C-x right] 'next-buffer) |
661dc3bfc076
Remove key bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
955
diff
changeset
|
988 |
(global-set-key [?\C-x left] 'previous-buffer) |
1186
ff1145717171
Use Win key to make buffer switching faster and avoid key binding intersection with term-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1184
diff
changeset
|
989 |
(global-set-key [s-right] 'next-buffer) |
ff1145717171
Use Win key to make buffer switching faster and avoid key binding intersection with term-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1184
diff
changeset
|
990 |
(global-set-key [s-left] 'previous-buffer) |
1187
81ffdea5bfb1
Use Win key to make buffer deleting and switching faster and avoid key binding intersection with term-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1186
diff
changeset
|
991 |
(defun my--kill-this-buffer-maybe-switch-to-next () |
1135
b6dcbd747884
Kill current buffer. Switch to next buffer if previous command was switching
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1133
diff
changeset
|
992 |
"Kill current buffer. Switch to next buffer if previous command |
b6dcbd747884
Kill current buffer. Switch to next buffer if previous command was switching
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1133
diff
changeset
|
993 |
was switching to next buffer or this command itself allowing |
b6dcbd747884
Kill current buffer. Switch to next buffer if previous command was switching
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1133
diff
changeset
|
994 |
sequential closing of uninteresting buffers." |
b6dcbd747884
Kill current buffer. Switch to next buffer if previous command was switching
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1133
diff
changeset
|
995 |
(interactive) |
b6dcbd747884
Kill current buffer. Switch to next buffer if previous command was switching
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1133
diff
changeset
|
996 |
(let ( (cmd last-command) ) |
1182
616154dadd38
Replace kill-this-buffer with core functions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1181
diff
changeset
|
997 |
(kill-buffer (current-buffer)) |
1135
b6dcbd747884
Kill current buffer. Switch to next buffer if previous command was switching
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1133
diff
changeset
|
998 |
(when (memq cmd (list 'next-buffer this-command)) |
b6dcbd747884
Kill current buffer. Switch to next buffer if previous command was switching
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1133
diff
changeset
|
999 |
(next-buffer)))) |
1187
81ffdea5bfb1
Use Win key to make buffer deleting and switching faster and avoid key binding intersection with term-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1186
diff
changeset
|
1000 |
(global-set-key [?\C-x deletechar] 'my--kill-this-buffer-maybe-switch-to-next) |
81ffdea5bfb1
Use Win key to make buffer deleting and switching faster and avoid key binding intersection with term-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1186
diff
changeset
|
1001 |
(global-set-key [s-delete] 'my--kill-this-buffer-maybe-switch-to-next) |
1186
ff1145717171
Use Win key to make buffer switching faster and avoid key binding intersection with term-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1184
diff
changeset
|
1002 |
(defun my--backward-other-window () |
ff1145717171
Use Win key to make buffer switching faster and avoid key binding intersection with term-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1184
diff
changeset
|
1003 |
(interactive) |
ff1145717171
Use Win key to make buffer switching faster and avoid key binding intersection with term-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1184
diff
changeset
|
1004 |
(other-window -1)) |
ff1145717171
Use Win key to make buffer switching faster and avoid key binding intersection with term-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1184
diff
changeset
|
1005 |
(global-set-key [?\C-x up] #'my--backward-other-window) |
ff1145717171
Use Win key to make buffer switching faster and avoid key binding intersection with term-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1184
diff
changeset
|
1006 |
(global-set-key [?\C-x down] #'other-window) |
ff1145717171
Use Win key to make buffer switching faster and avoid key binding intersection with term-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1184
diff
changeset
|
1007 |
(global-set-key [s-up] #'my--backward-other-window) |
ff1145717171
Use Win key to make buffer switching faster and avoid key binding intersection with term-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1184
diff
changeset
|
1008 |
(global-set-key [s-down] #'other-window) |
956
661dc3bfc076
Remove key bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
955
diff
changeset
|
1009 |
|
953
3ad3abeec5f9
Move related code to common place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
952
diff
changeset
|
1010 |
(require 'uniquify) |
3ad3abeec5f9
Move related code to common place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
952
diff
changeset
|
1011 |
(setq uniquify-buffer-name-style 'post-forward) |
3ad3abeec5f9
Move related code to common place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
952
diff
changeset
|
1012 |
(setq uniquify-separator "|") |
3ad3abeec5f9
Move related code to common place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
952
diff
changeset
|
1013 |
(setq uniquify-after-kill-buffer-p t) |
1310
ca9bfec974ac
Don't jump to unknown directory if file not found in current!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1309
diff
changeset
|
1014 |
(setq uniquify-strip-common-suffix t) |
953
3ad3abeec5f9
Move related code to common place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
952
diff
changeset
|
1015 |
|
3ad3abeec5f9
Move related code to common place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
952
diff
changeset
|
1016 |
(setq read-buffer-completion-ignore-case t) |
1127
dec4b1d47f61
Remove useless comment.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1126
diff
changeset
|
1017 |
(setq read-file-name-completion-ignore-case t) |
953
3ad3abeec5f9
Move related code to common place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
952
diff
changeset
|
1018 |
|
3ad3abeec5f9
Move related code to common place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
952
diff
changeset
|
1019 |
;; buffer-menu better then buffer-list, but ibuffer much better. |
3ad3abeec5f9
Move related code to common place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
952
diff
changeset
|
1020 |
(global-set-key "\C-x\C-b" 'ibuffer) |
1187
81ffdea5bfb1
Use Win key to make buffer deleting and switching faster and avoid key binding intersection with term-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1186
diff
changeset
|
1021 |
(global-set-key [s-insert] 'ibuffer) |
953
3ad3abeec5f9
Move related code to common place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
952
diff
changeset
|
1022 |
|
3ad3abeec5f9
Move related code to common place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
952
diff
changeset
|
1023 |
(icomplete-mode 1) |
1025
3d524b2cbbc1
Use icomplete for all completion-tables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1024
diff
changeset
|
1024 |
(setq icomplete-with-completion-tables t) |
953
3ad3abeec5f9
Move related code to common place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
952
diff
changeset
|
1025 |
|
1306
b78bf2c141ab
Use consistent style for internal names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1305
diff
changeset
|
1026 |
(defun my--large-file-p () |
1207
c658f0d30525
Fixes performance issues in Emacs for large files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1206
diff
changeset
|
1027 |
"If buffer too large and my cause performance issue." |
c658f0d30525
Fixes performance issues in Emacs for large files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1206
diff
changeset
|
1028 |
(< large-file-warning-threshold (buffer-size))) |
c658f0d30525
Fixes performance issues in Emacs for large files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1206
diff
changeset
|
1029 |
|
c658f0d30525
Fixes performance issues in Emacs for large files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1206
diff
changeset
|
1030 |
(define-derived-mode my-large-file-mode fundamental-mode "LargeFile" |
c658f0d30525
Fixes performance issues in Emacs for large files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1206
diff
changeset
|
1031 |
"Fixes performance issues in Emacs for large files." |
c658f0d30525
Fixes performance issues in Emacs for large files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1206
diff
changeset
|
1032 |
;; (setq buffer-read-only t) |
c658f0d30525
Fixes performance issues in Emacs for large files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1206
diff
changeset
|
1033 |
(setq bidi-display-reordering nil) |
c658f0d30525
Fixes performance issues in Emacs for large files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1206
diff
changeset
|
1034 |
(jit-lock-mode nil) |
c658f0d30525
Fixes performance issues in Emacs for large files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1206
diff
changeset
|
1035 |
(buffer-disable-undo) |
c658f0d30525
Fixes performance issues in Emacs for large files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1206
diff
changeset
|
1036 |
;; (make-variable-buffer-local 'mode-line-format) |
c658f0d30525
Fixes performance issues in Emacs for large files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1206
diff
changeset
|
1037 |
;; (setq mode-line-format (delq 'mode-line-position 'mode-line-format)) |
c658f0d30525
Fixes performance issues in Emacs for large files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1206
diff
changeset
|
1038 |
(set (make-variable-buffer-local 'global-hl-line-mode) nil) |
c658f0d30525
Fixes performance issues in Emacs for large files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1206
diff
changeset
|
1039 |
(set (make-variable-buffer-local 'line-number-mode) nil) |
c658f0d30525
Fixes performance issues in Emacs for large files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1206
diff
changeset
|
1040 |
(set (make-variable-buffer-local 'column-number-mode) nil) ) |
c658f0d30525
Fixes performance issues in Emacs for large files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1206
diff
changeset
|
1041 |
|
1306
b78bf2c141ab
Use consistent style for internal names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1305
diff
changeset
|
1042 |
(add-to-list 'magic-mode-alist (cons #'my--large-file-p #'my-large-file-mode)) |
1207
c658f0d30525
Fixes performance issues in Emacs for large files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1206
diff
changeset
|
1043 |
|
953
3ad3abeec5f9
Move related code to common place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
952
diff
changeset
|
1044 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1288
6333a733046f
Use new autobm mode!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1282
diff
changeset
|
1045 |
(message "bookmark") |
6333a733046f
Use new autobm mode!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1282
diff
changeset
|
1046 |
|
6333a733046f
Use new autobm mode!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1282
diff
changeset
|
1047 |
;; (require 'autobm) |
6333a733046f
Use new autobm mode!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1282
diff
changeset
|
1048 |
(global-set-key (kbd "C-x r m") 'autobm) |
6333a733046f
Use new autobm mode!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1282
diff
changeset
|
1049 |
|
1290
a3ec0437c4f1
set-mark-command-repeat-pop
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1289
diff
changeset
|
1050 |
(setq set-mark-command-repeat-pop 't) |
a3ec0437c4f1
set-mark-command-repeat-pop
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1289
diff
changeset
|
1051 |
|
1288
6333a733046f
Use new autobm mode!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1282
diff
changeset
|
1052 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
953
3ad3abeec5f9
Move related code to common place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
952
diff
changeset
|
1053 |
(message "completion") |
3ad3abeec5f9
Move related code to common place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
952
diff
changeset
|
1054 |
|
3ad3abeec5f9
Move related code to common place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
952
diff
changeset
|
1055 |
;; I remove partial-completion-mode because it depricated in Emacs 24.0. |
3ad3abeec5f9
Move related code to common place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
952
diff
changeset
|
1056 |
;; Completion controled by 'completion-styles' variable. |
3ad3abeec5f9
Move related code to common place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
952
diff
changeset
|
1057 |
|
3ad3abeec5f9
Move related code to common place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
952
diff
changeset
|
1058 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
970
5b2a8a8a036c
Add basic Yasnippet settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
968
diff
changeset
|
1059 |
(message "yasnippet") |
5b2a8a8a036c
Add basic Yasnippet settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
968
diff
changeset
|
1060 |
|
5b2a8a8a036c
Add basic Yasnippet settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
968
diff
changeset
|
1061 |
(setq my-yas-root-directory "~/.emacs.d/my-yas") |
5b2a8a8a036c
Add basic Yasnippet settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
968
diff
changeset
|
1062 |
(setq yas/ignore-filenames-as-triggers t) |
5b2a8a8a036c
Add basic Yasnippet settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
968
diff
changeset
|
1063 |
|
1254
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
1064 |
;; (my--eval-after-load yasnippet |
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1065 |
;; (cond |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1066 |
;; ((listp yas/root-directory) (add-to-list 'yas/root-directory my-yas-root-directory)) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1067 |
;; ((stringp yas/root-directory) (setq yas/root-directory (list my-yas-root-directory yas/root-directory))) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1068 |
;; (t (error "I expect that yas/root-directory is a list of string")) ) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1069 |
;; (mapc 'yas/load-directory yas/root-directory)) |
970
5b2a8a8a036c
Add basic Yasnippet settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
968
diff
changeset
|
1070 |
|
5b2a8a8a036c
Add basic Yasnippet settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
968
diff
changeset
|
1071 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1142
7906db469af0
Switch to ido from iswitchb. Use ido key binding instead of ffap-bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1141
diff
changeset
|
1072 |
(message "dired") |
598 | 1073 |
|
460 | 1074 |
(setq-default save-place t) |
1215
c7e52e93465a
Move .emacs files to user-emacs-directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1210
diff
changeset
|
1075 |
;; `save-place-file' in ".emacs". |
460 | 1076 |
(require 'saveplace) |
1077 |
||
598 | 1078 |
(require 'dired) |
241
78cbd4c692ee
Added dired settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
240
diff
changeset
|
1079 |
|
78cbd4c692ee
Added dired settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
240
diff
changeset
|
1080 |
(setq dired-dwim-target t) |
78cbd4c692ee
Added dired settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
240
diff
changeset
|
1081 |
;; dangerous |
78cbd4c692ee
Added dired settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
240
diff
changeset
|
1082 |
;; (setq |
78cbd4c692ee
Added dired settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
240
diff
changeset
|
1083 |
;; dired-recursive-copies 'top |
78cbd4c692ee
Added dired settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
240
diff
changeset
|
1084 |
;; dired-recursive-deletes 'top) |
78cbd4c692ee
Added dired settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
240
diff
changeset
|
1085 |
|
463
adc3abb3c1fc
Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
462
diff
changeset
|
1086 |
(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
|
1087 |
"'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
|
1088 |
(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
|
1089 |
;; (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
|
1090 |
(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
|
1091 |
(while (and |
adc3abb3c1fc
Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
462
diff
changeset
|
1092 |
(>= i 0) |
adc3abb3c1fc
Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
462
diff
changeset
|
1093 |
(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
|
1094 |
(setq i (- i 1)) |
adc3abb3c1fc
Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
462
diff
changeset
|
1095 |
) |
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
|
1096 |
(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
|
1097 |
(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
|
1098 |
(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
|
1099 |
(dired-goto-file dir) |
adc3abb3c1fc
Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
462
diff
changeset
|
1100 |
) |
adc3abb3c1fc
Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
462
diff
changeset
|
1101 |
)) |
adc3abb3c1fc
Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
462
diff
changeset
|
1102 |
(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
|
1103 |
|
adc3abb3c1fc
Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
462
diff
changeset
|
1104 |
(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
|
1105 |
"'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
|
1106 |
(interactive) |
adc3abb3c1fc
Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
462
diff
changeset
|
1107 |
(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
|
1108 |
(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
|
1109 |
(find-alternate-file file) |
adc3abb3c1fc
Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
462
diff
changeset
|
1110 |
(find-file file) |
adc3abb3c1fc
Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
462
diff
changeset
|
1111 |
))) |
adc3abb3c1fc
Make Total Commmander like key binding for Enter and Backspace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
462
diff
changeset
|
1112 |
(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
|
1113 |
'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
|
1114 |
|
697
d19881accc91
Make behaviour same as in GUI for dired.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
695
diff
changeset
|
1115 |
;; Make behaviour same as in GUI. |
d19881accc91
Make behaviour same as in GUI for dired.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
695
diff
changeset
|
1116 |
(unless window-system |
d19881accc91
Make behaviour same as in GUI for dired.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
695
diff
changeset
|
1117 |
(define-key dired-mode-map (kbd "DEL") 'my-dired-up-dir) |
d19881accc91
Make behaviour same as in GUI for dired.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
695
diff
changeset
|
1118 |
(define-key dired-mode-map (kbd "RET") 'my-dired-enter-to-dir) |
d19881accc91
Make behaviour same as in GUI for dired.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
695
diff
changeset
|
1119 |
) |
d19881accc91
Make behaviour same as in GUI for dired.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
695
diff
changeset
|
1120 |
|
455
434f14adcd26
Added key binding for reuse existent dired buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
454
diff
changeset
|
1121 |
(when (>= emacs-major-version 22) |
434f14adcd26
Added key binding for reuse existent dired buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
454
diff
changeset
|
1122 |
;; Enable 'a' command. |
434f14adcd26
Added key binding for reuse existent dired buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
454
diff
changeset
|
1123 |
(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
|
1124 |
) |
326
ded53e19d23a
Enable 'a' command in dired.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
303
diff
changeset
|
1125 |
|
1308
9076a617eaae
Mark .log.[0-9]+ files also as temporary.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1307
diff
changeset
|
1126 |
(defvar my--file-name-tmp-refex |
9076a617eaae
Mark .log.[0-9]+ files also as temporary.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1307
diff
changeset
|
1127 |
(concat |
9076a617eaae
Mark .log.[0-9]+ files also as temporary.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1307
diff
changeset
|
1128 |
"\\(?:^#.*#" |
9076a617eaae
Mark .log.[0-9]+ files also as temporary.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1307
diff
changeset
|
1129 |
"\\|~" |
9076a617eaae
Mark .log.[0-9]+ files also as temporary.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1307
diff
changeset
|
1130 |
"\\|\\." (regexp-opt '("base" "local" "orig" "other" "rej" "diff" "log" "stackdump" "pyc" "pyo")) |
9076a617eaae
Mark .log.[0-9]+ files also as temporary.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1307
diff
changeset
|
1131 |
"\\|\\.log\\.[0-9]+" |
9076a617eaae
Mark .log.[0-9]+ files also as temporary.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1307
diff
changeset
|
1132 |
"\\)\\'") |
9076a617eaae
Mark .log.[0-9]+ files also as temporary.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1307
diff
changeset
|
1133 |
"Rule to detect temp/backup files.") |
9076a617eaae
Mark .log.[0-9]+ files also as temporary.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1307
diff
changeset
|
1134 |
|
9076a617eaae
Mark .log.[0-9]+ files also as temporary.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1307
diff
changeset
|
1135 |
(defun my--file-name-tmp-p (file) |
9076a617eaae
Mark .log.[0-9]+ files also as temporary.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1307
diff
changeset
|
1136 |
(string-match my--file-name-tmp-refex |
9076a617eaae
Mark .log.[0-9]+ files also as temporary.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1307
diff
changeset
|
1137 |
(or (and (file-directory-p file) "") (file-name-nondirectory file)))) |
9076a617eaae
Mark .log.[0-9]+ files also as temporary.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1307
diff
changeset
|
1138 |
|
9076a617eaae
Mark .log.[0-9]+ files also as temporary.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1307
diff
changeset
|
1139 |
(defun my--dired-flag-tmp-files () |
469
a9adec4fbcbf
Mark temporary files in dired by '`'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
468
diff
changeset
|
1140 |
"Flag all temporary files for deletion." |
a9adec4fbcbf
Mark temporary files in dired by '`'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
468
diff
changeset
|
1141 |
(interactive) |
a9adec4fbcbf
Mark temporary files in dired by '`'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
468
diff
changeset
|
1142 |
(dired-mark-if |
a9adec4fbcbf
Mark temporary files in dired by '`'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
468
diff
changeset
|
1143 |
(let ( (fn (dired-get-filename 'verbatim t)) ) |
1308
9076a617eaae
Mark .log.[0-9]+ files also as temporary.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1307
diff
changeset
|
1144 |
(and fn (my--file-name-tmp-p fn)) ) |
9076a617eaae
Mark .log.[0-9]+ files also as temporary.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1307
diff
changeset
|
1145 |
"backup file")) |
9076a617eaae
Mark .log.[0-9]+ files also as temporary.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1307
diff
changeset
|
1146 |
|
9076a617eaae
Mark .log.[0-9]+ files also as temporary.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1307
diff
changeset
|
1147 |
(define-key dired-mode-map (kbd "`") 'my--dired-flag-tmp-files) |
469
a9adec4fbcbf
Mark temporary files in dired by '`'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
468
diff
changeset
|
1148 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
1149 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
1150 |
(message "ls-lisp, dired ls") |
464
ae073d35f674
Always use 'ls-lisp' to emulate 'ls'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
463
diff
changeset
|
1151 |
|
ae073d35f674
Always use 'ls-lisp' to emulate 'ls'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
463
diff
changeset
|
1152 |
;; 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
|
1153 |
(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
|
1154 |
(setq ls-lisp-ignore-case t) |
ae073d35f674
Always use 'ls-lisp' to emulate 'ls'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
463
diff
changeset
|
1155 |
(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
|
1156 |
(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
|
1157 |
(setq ls-lisp-verbosity nil) |
ae073d35f674
Always use 'ls-lisp' to emulate 'ls'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
463
diff
changeset
|
1158 |
(setq ls-lisp-verbosity '(links uid gid))) |
ae073d35f674
Always use 'ls-lisp' to emulate 'ls'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
463
diff
changeset
|
1159 |
;; Force use 'ls-lisp-format-time-list'. |
ae073d35f674
Always use 'ls-lisp' to emulate 'ls'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
463
diff
changeset
|
1160 |
(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
|
1161 |
(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
|
1162 |
'("%Y-%m-%d %H:%M:%S" |
d1a3f9322927
Show seconds for file modification time in dired.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
473
diff
changeset
|
1163 |
"%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
|
1164 |
(require 'ls-lisp) |
464
ae073d35f674
Always use 'ls-lisp' to emulate 'ls'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
463
diff
changeset
|
1165 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
1166 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
1167 |
(message "compression, archive") |
240
77b01720a256
Enable image if supported.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
239
diff
changeset
|
1168 |
|
0 | 1169 |
(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
|
1170 |
(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
|
1171 |
(auto-compression-mode 1)) |
0 | 1172 |
|
296
e502c69ab80a
Make header name like tags, separated by comma and ended on period.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
1173 |
(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
|
1174 |
|
e502c69ab80a
Make header name like tags, separated by comma and ended on period.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
1175 |
(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
|
1176 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
1177 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
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
|
1178 |
(message "image, png, svg") |
240
77b01720a256
Enable image if supported.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
239
diff
changeset
|
1179 |
|
77b01720a256
Enable image if supported.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
239
diff
changeset
|
1180 |
(when (fboundp 'auto-image-file-mode) |
77b01720a256
Enable image if supported.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
239
diff
changeset
|
1181 |
(auto-image-file-mode 1)) |
1254
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
1182 |
(my--eval-after-load image-file |
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1183 |
;; Exclude .svg image from supported image list, as Emacs doesn't come |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1184 |
;; with SVG shared library. |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1185 |
(setq image-file-name-extensions (remove "svg" image-file-name-extensions)) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1186 |
;; Re-initialize the image-file handler. |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1187 |
(auto-image-file-mode t) ) |
240
77b01720a256
Enable image if supported.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
239
diff
changeset
|
1188 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
1189 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
716 | 1190 |
(message "url") |
1191 |
||
1192 |
;; http://tools.ietf.org/html/rfc3986 |
|
1193 |
;; http://en.wikipedia.org/wiki/Percent-encoding |
|
1194 |
(defun my-percent-decode (str) |
|
1195 |
(decode-coding-string |
|
1196 |
(let* ( (s (split-string str "%")) ) |
|
1197 |
(my-fold |
|
1198 |
'concat |
|
1199 |
(car s) |
|
1200 |
(mapcar |
|
1201 |
(lambda (x) |
|
1202 |
(concat (unibyte-string (string-to-number (substring x 0 2) 16)) (substring x 2))) |
|
1203 |
(cdr s)) |
|
1204 |
)) 'utf-8)) |
|
1205 |
||
1014
82ae06b5d7c4
Add function: "Encode string to percent encoding."
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1013
diff
changeset
|
1206 |
(defun my-percent-decode-region (beg end &optional arg) |
717
b958f182d0d4
Convert percent encoded string to native.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
716
diff
changeset
|
1207 |
"Convert percent encoded string to native." |
1014
82ae06b5d7c4
Add function: "Encode string to percent encoding."
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1013
diff
changeset
|
1208 |
(interactive "r\nP") |
717
b958f182d0d4
Convert percent encoded string to native.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
716
diff
changeset
|
1209 |
(let ( (result (my-percent-decode (buffer-substring-no-properties beg end))) ) |
b958f182d0d4
Convert percent encoded string to native.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
716
diff
changeset
|
1210 |
(if (not arg) |
1014
82ae06b5d7c4
Add function: "Encode string to percent encoding."
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1013
diff
changeset
|
1211 |
result |
82ae06b5d7c4
Add function: "Encode string to percent encoding."
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1013
diff
changeset
|
1212 |
(delete-region beg end) |
82ae06b5d7c4
Add function: "Encode string to percent encoding."
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1013
diff
changeset
|
1213 |
(insert result)) |
82ae06b5d7c4
Add function: "Encode string to percent encoding."
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1013
diff
changeset
|
1214 |
) ) |
82ae06b5d7c4
Add function: "Encode string to percent encoding."
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1013
diff
changeset
|
1215 |
|
82ae06b5d7c4
Add function: "Encode string to percent encoding."
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1013
diff
changeset
|
1216 |
(defun my-percent-encode (str) |
82ae06b5d7c4
Add function: "Encode string to percent encoding."
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1013
diff
changeset
|
1217 |
(apply 'concat |
82ae06b5d7c4
Add function: "Encode string to percent encoding."
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1013
diff
changeset
|
1218 |
(mapcar |
82ae06b5d7c4
Add function: "Encode string to percent encoding."
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1013
diff
changeset
|
1219 |
(lambda (ch) (if (or (and (<= ?a ch) (>= ?z ch)) |
82ae06b5d7c4
Add function: "Encode string to percent encoding."
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1013
diff
changeset
|
1220 |
(and (<= ?A ch) (>= ?Z ch)) |
82ae06b5d7c4
Add function: "Encode string to percent encoding."
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1013
diff
changeset
|
1221 |
(memq ch '(?- ?_ ?. ?~))) |
82ae06b5d7c4
Add function: "Encode string to percent encoding."
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1013
diff
changeset
|
1222 |
(char-to-string ch) |
82ae06b5d7c4
Add function: "Encode string to percent encoding."
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1013
diff
changeset
|
1223 |
(format "%%%02X" ch))) |
82ae06b5d7c4
Add function: "Encode string to percent encoding."
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1013
diff
changeset
|
1224 |
(encode-coding-string str 'utf-8) ))) |
82ae06b5d7c4
Add function: "Encode string to percent encoding."
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1013
diff
changeset
|
1225 |
|
82ae06b5d7c4
Add function: "Encode string to percent encoding."
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1013
diff
changeset
|
1226 |
(defun my-percent-encode-region (beg end &optional arg) |
82ae06b5d7c4
Add function: "Encode string to percent encoding."
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1013
diff
changeset
|
1227 |
"Encode string to percent encoding." |
82ae06b5d7c4
Add function: "Encode string to percent encoding."
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1013
diff
changeset
|
1228 |
(interactive "r\nP") |
82ae06b5d7c4
Add function: "Encode string to percent encoding."
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1013
diff
changeset
|
1229 |
(let ( (result (my-percent-encode (buffer-substring-no-properties beg end))) ) |
82ae06b5d7c4
Add function: "Encode string to percent encoding."
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1013
diff
changeset
|
1230 |
(if (not arg) |
82ae06b5d7c4
Add function: "Encode string to percent encoding."
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1013
diff
changeset
|
1231 |
result |
717
b958f182d0d4
Convert percent encoded string to native.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
716
diff
changeset
|
1232 |
(delete-region beg end) |
b958f182d0d4
Convert percent encoded string to native.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
716
diff
changeset
|
1233 |
(insert result)) |
b958f182d0d4
Convert percent encoded string to native.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
716
diff
changeset
|
1234 |
) ) |
b958f182d0d4
Convert percent encoded string to native.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
716
diff
changeset
|
1235 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
1236 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
1237 |
(message "browser") |
98
5223817dad90
Use mozilla browser. Not tested for Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
97
diff
changeset
|
1238 |
|
138
90fda97adcb1
Setup browse-url func for linux and windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
120
diff
changeset
|
1239 |
(cond |
90fda97adcb1
Setup browse-url func for linux and windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
120
diff
changeset
|
1240 |
((equal window-system 'w32) |
90fda97adcb1
Setup browse-url func for linux and windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
120
diff
changeset
|
1241 |
(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
|
1242 |
((boundp 'debian-emacs-flavor) |
4d3b20be2562
Use Firefox to open URLs under Debian Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
475
diff
changeset
|
1243 |
(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
|
1244 |
(t |
90fda97adcb1
Setup browse-url func for linux and windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
120
diff
changeset
|
1245 |
(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
|
1246 |
|
677 | 1247 |
(defun my-cygwin-search (str) |
1248 |
"Search for Cygwin package on-line." |
|
1366
f9989b9060aa
Fix: Warning: `read-input' is an obsolete function (as of 22.1); use `read-string' instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1365
diff
changeset
|
1249 |
(interactive (list (read-string "Search for Cygwin package on-line: "))) |
677 | 1250 |
(browse-url (format "http://cygwin.com/cgi-bin2/package-grep.cgi?grep=%s" str)) |
1251 |
) |
|
1252 |
||
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
1253 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
960
272a40dfdbcd
Add integration with NetBeans (netbeans-open-this-buffer).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
959
diff
changeset
|
1254 |
(message "netbeans") |
272a40dfdbcd
Add integration with NetBeans (netbeans-open-this-buffer).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
959
diff
changeset
|
1255 |
|
272a40dfdbcd
Add integration with NetBeans (netbeans-open-this-buffer).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
959
diff
changeset
|
1256 |
(defun netbeans-find-command () |
962
5d94d3736bbe
Search for NetBeans executable in PATH, later in '/opt/netbeans*/bin/'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
961
diff
changeset
|
1257 |
"Search for NetBeans executable in PATH, later in '/opt/netbeans*/bin/'." |
961
d8f1ed2f2f9c
Fix typo: command name. Add error checking code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
960
diff
changeset
|
1258 |
(or |
d8f1ed2f2f9c
Fix typo: command name. Add error checking code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
960
diff
changeset
|
1259 |
(executable-find "netbeans") |
963
102845496d41
Fix: balance parents. Fix typo in func name.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
962
diff
changeset
|
1260 |
(car (last (sort (file-expand-wildcards "/opt/[Nn]etbeans*/bin/netbeans" t) 'equal))) )) |
961
d8f1ed2f2f9c
Fix typo: command name. Add error checking code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
960
diff
changeset
|
1261 |
(defvar netbeans-command (netbeans-find-command) |
960
272a40dfdbcd
Add integration with NetBeans (netbeans-open-this-buffer).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
959
diff
changeset
|
1262 |
"Command to run NetBeans.") |
272a40dfdbcd
Add integration with NetBeans (netbeans-open-this-buffer).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
959
diff
changeset
|
1263 |
(defun netbeans-open-file (file &optional line) |
272a40dfdbcd
Add integration with NetBeans (netbeans-open-this-buffer).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
959
diff
changeset
|
1264 |
"Open FILE on LINE in NetBeans." |
272a40dfdbcd
Add integration with NetBeans (netbeans-open-this-buffer).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
959
diff
changeset
|
1265 |
(if (integerp line) |
272a40dfdbcd
Add integration with NetBeans (netbeans-open-this-buffer).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
959
diff
changeset
|
1266 |
(start-process "netbeans" nil netbeans-command "--open" (format "%s:%d" file line)) |
272a40dfdbcd
Add integration with NetBeans (netbeans-open-this-buffer).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
959
diff
changeset
|
1267 |
(start-process "netbeans" nil netbeans-command "--open" file))) |
272a40dfdbcd
Add integration with NetBeans (netbeans-open-this-buffer).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
959
diff
changeset
|
1268 |
(defun netbeans-open-this-buffer () |
272a40dfdbcd
Add integration with NetBeans (netbeans-open-this-buffer).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
959
diff
changeset
|
1269 |
"Open file for burrent buffer in NetBeans." |
272a40dfdbcd
Add integration with NetBeans (netbeans-open-this-buffer).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
959
diff
changeset
|
1270 |
(interactive) |
986
6e74bf91f1df
Add checks for: Buffer have no association with a file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
985
diff
changeset
|
1271 |
(unless (stringp (buffer-file-name)) |
6e74bf91f1df
Add checks for: Buffer have no association with a file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
985
diff
changeset
|
1272 |
(error "Buffer have no association with a file")) |
961
d8f1ed2f2f9c
Fix typo: command name. Add error checking code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
960
diff
changeset
|
1273 |
(if (file-regular-p (buffer-file-name)) |
d8f1ed2f2f9c
Fix typo: command name. Add error checking code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
960
diff
changeset
|
1274 |
(netbeans-open-file (buffer-file-name) (line-number-at-pos)) |
963
102845496d41
Fix: balance parents. Fix typo in func name.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
962
diff
changeset
|
1275 |
(message "Current buffer wasnt' associated with a real file"))) |
960
272a40dfdbcd
Add integration with NetBeans (netbeans-open-this-buffer).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
959
diff
changeset
|
1276 |
|
272a40dfdbcd
Add integration with NetBeans (netbeans-open-this-buffer).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
959
diff
changeset
|
1277 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
1278 |
(message "calendar") |
296
e502c69ab80a
Make header name like tags, separated by comma and ended on period.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
1279 |
|
0 | 1280 |
;; (setq mark-holidays-in-calendar t) |
1281 |
;; (setq all-christian-calendar-holidays t) |
|
1282 |
;; (setq calendar-date-display-form (quote ((format "%04s-%02d-%02d" year (string-to-int month) (string-to-int day))))) |
|
1283 |
;; (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
|
1284 |
(setq calendar-week-start-day 1) |
71cec5d9c60f
Set week start with Monday.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
48
diff
changeset
|
1285 |
(setq european-calendar-style t) |
0 | 1286 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
1287 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
1288 |
(message "standard hooks") |
0 | 1289 |
|
1290 |
(add-hook 'write-file-hooks 'time-stamp) |
|
1291 |
||
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
1292 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
735
337d64d4f27b
Enable auto-revert-tail-mode for log files from /var/log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
734
diff
changeset
|
1293 |
(message "logging, logs") |
337d64d4f27b
Enable auto-revert-tail-mode for log files from /var/log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
734
diff
changeset
|
1294 |
|
337d64d4f27b
Enable auto-revert-tail-mode for log files from /var/log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
734
diff
changeset
|
1295 |
(defun my-auto-revert-tail-mode-hook () |
1164
ca644074aac4
Enable log4-hi-mode and auto-revert-tail-mode for ~/.xsession-errors.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1158
diff
changeset
|
1296 |
(when (string-match "/logs?/\\|\\.\\(?:log\\|out\\)\\'\\|/.xsession-errors\\'" |
735
337d64d4f27b
Enable auto-revert-tail-mode for log files from /var/log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
734
diff
changeset
|
1297 |
(buffer-file-name (current-buffer))) |
337d64d4f27b
Enable auto-revert-tail-mode for log files from /var/log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
734
diff
changeset
|
1298 |
(auto-revert-tail-mode 1) |
1076
eed45b8a9e3a
Highlight standard elements in log4* like log-files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1074
diff
changeset
|
1299 |
(log4-hi-mode 1) |
1084
a1af1d3582b6
Add margin to log buffers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1081
diff
changeset
|
1300 |
(setq scroll-margin my-scroll-margin) |
735
337d64d4f27b
Enable auto-revert-tail-mode for log files from /var/log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
734
diff
changeset
|
1301 |
)) |
337d64d4f27b
Enable auto-revert-tail-mode for log files from /var/log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
734
diff
changeset
|
1302 |
(add-hook 'find-file-hook 'my-auto-revert-tail-mode-hook) |
337d64d4f27b
Enable auto-revert-tail-mode for log files from /var/log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
734
diff
changeset
|
1303 |
|
337d64d4f27b
Enable auto-revert-tail-mode for log files from /var/log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
734
diff
changeset
|
1304 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
1305 |
(message "auto-fill") |
0 | 1306 |
|
102
25585e240b4a
Move customization from .emacs (custom-set-variables) to .emacs-my. Remove duplication.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
101
diff
changeset
|
1307 |
(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
|
1308 |
|
335
748c6e05fe87
Use common value for fill-column.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
334
diff
changeset
|
1309 |
(defvar my-fill-column 100 |
748c6e05fe87
Use common value for fill-column.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
334
diff
changeset
|
1310 |
"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
|
1311 |
|
148
7df64d2c9f3d
Remove unused key binding. Added more docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
147
diff
changeset
|
1312 |
;; 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
|
1313 |
;; 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
|
1314 |
(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
|
1315 |
|
0 | 1316 |
;; Turn on auto-fill mode |
1317 |
(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
|
1318 |
(add-hook 'text-mode-hook 'turn-on-auto-fill) |
0 | 1319 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
1320 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
1321 |
(message "cacl, calculator") |
367
58e70956523a
Set cacl digit grouping.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
366
diff
changeset
|
1322 |
|
58e70956523a
Set cacl digit grouping.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
366
diff
changeset
|
1323 |
(setq-default calc-group-digits t) |
58e70956523a
Set cacl digit grouping.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
366
diff
changeset
|
1324 |
(setq-default calc-group-char "'") |
58e70956523a
Set cacl digit grouping.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
366
diff
changeset
|
1325 |
|
1289 | 1326 |
(defun my-calc-region (arg beg end) |
517
6889ad2dbd35
Add 'my-calc-eval-region' func.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
516
diff
changeset
|
1327 |
"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
|
1328 |
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
|
1329 |
(interactive "P\nr") |
6889ad2dbd35
Add 'my-calc-eval-region' func.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
516
diff
changeset
|
1330 |
(require 'calc) |
6889ad2dbd35
Add 'my-calc-eval-region' func.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
516
diff
changeset
|
1331 |
(let* ((expr (buffer-substring-no-properties beg end)) |
6889ad2dbd35
Add 'my-calc-eval-region' func.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
516
diff
changeset
|
1332 |
(result (calc-eval expr))) |
6889ad2dbd35
Add 'my-calc-eval-region' func.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
516
diff
changeset
|
1333 |
(if (null arg) |
6889ad2dbd35
Add 'my-calc-eval-region' func.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
516
diff
changeset
|
1334 |
(message "%s = %s" expr result) |
6889ad2dbd35
Add 'my-calc-eval-region' func.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
516
diff
changeset
|
1335 |
(goto-char end) |
6889ad2dbd35
Add 'my-calc-eval-region' func.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
516
diff
changeset
|
1336 |
(save-excursion |
6889ad2dbd35
Add 'my-calc-eval-region' func.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
516
diff
changeset
|
1337 |
(insert result))))) |
6889ad2dbd35
Add 'my-calc-eval-region' func.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
516
diff
changeset
|
1338 |
|
1289 | 1339 |
(defun my-calc-line (arg) |
1340 |
"Evaluate expression in current line and display the result in |
|
1341 |
the echo area by skipping final '=' sign. With prefix ARG |
|
1342 |
non-nil, insert the result at the end of line and space if |
|
1343 |
necessary for delimiting." |
|
1344 |
(interactive "P") |
|
1345 |
(require 'calc) |
|
1346 |
(save-excursion |
|
1347 |
(let (beg end expr result) |
|
1348 |
(beginning-of-line) |
|
1349 |
(setq beg (point)) |
|
1350 |
(end-of-line) |
|
1351 |
(search-backward "=" beg t) |
|
1352 |
(setq end (point)) |
|
1353 |
(setq expr (buffer-substring-no-properties beg end)) |
|
1354 |
(setq result (calc-eval expr)) |
|
1355 |
(if (null arg) |
|
1356 |
(message "%s = %s" expr result) |
|
1357 |
(end-of-line) |
|
1358 |
(unless (eq (char-before) ?\ ) |
|
1359 |
(insert ?\ )) |
|
1360 |
(insert result))))) |
|
1361 |
||
1303
60e6b8174aee
Fix sectioning comment style.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1300
diff
changeset
|
1362 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
666 | 1363 |
(message "rst, reStructuredText") |
665
9761254a1260
Maintaining the table of contents up-to-date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
664
diff
changeset
|
1364 |
|
9761254a1260
Maintaining the table of contents up-to-date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
664
diff
changeset
|
1365 |
;; Maintaining the table of contents up-to-date. |
9761254a1260
Maintaining the table of contents up-to-date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
664
diff
changeset
|
1366 |
(add-hook 'rst-adjust-hook 'rst-toc-update) |
9761254a1260
Maintaining the table of contents up-to-date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
664
diff
changeset
|
1367 |
|
689
1b632e2151cc
Fix rst-level-*-face for terminal.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
688
diff
changeset
|
1368 |
(unless window-system |
1254
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
1369 |
(my--eval-after-load rst |
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1370 |
(custom-set-faces |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1371 |
'(rst-level-1-face ((t (:background "yellow"))) t) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1372 |
'(rst-level-2-face ((t (:background "yellow"))) t) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1373 |
'(rst-level-3-face ((t (:background "yellow"))) t) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1374 |
'(rst-level-4-face ((t (:background "yellow"))) t) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1375 |
'(rst-level-5-face ((t (:background "yellow"))) t) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1376 |
'(rst-level-6face ((t (:background "yellow"))) t) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1377 |
) ) ) |
689
1b632e2151cc
Fix rst-level-*-face for terminal.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
688
diff
changeset
|
1378 |
|
1220
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
1379 |
;; (add-hook 'rst-mode-hook #'abbrev-mode) |
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
1380 |
;; (remove-hook 'rst-mode-hook #'abbrev-mode) |
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
1381 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
1382 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
1383 |
(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
|
1384 |
|
0 | 1385 |
(setq tex-run-command "initex") |
1386 |
||
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
1387 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
1388 |
(message "AUC TeX") |
0 | 1389 |
|
1390 |
;(add-hook 'LaTeX-mode-hook 'LaTeX-install-toolbar) |
|
1391 |
;; (setq TeX-parse-self t) ; Enable parse on load. |
|
1392 |
;; (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
|
1393 |
;; 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
|
1394 |
;; multi-file document structure. |
ae8ed6d33e90
Dont prompt for master file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
346
diff
changeset
|
1395 |
(setq-default TeX-master nil) |
0 | 1396 |
|
1397 |
;(setq TeX-PDF-mode t) |
|
1398 |
;(setq TeX-interactive-mode t) |
|
1399 |
;(setq TeX-source-specials-mode 1) |
|
1400 |
||
1401 |
;;; some more menu entries in the command list: |
|
1402 |
;;; see tex-mik.el from package auctex: %v is defined in tex-mik.el |
|
1403 |
;;; other variables are defined in tex.el from auctex |
|
1404 |
;;; the meaning of some auctex-varibles: |
|
1405 |
;symbols defined in tex.el and tex-mik.el: |
|
1406 |
;%b name slave tex-file %t name master tex-file |
|
1407 |
;%d dvi-file %f ps-file |
|
1408 |
;%l "latex --src-specials" |
|
1409 |
;%n line number %p printcommand %q "lpq" |
|
1410 |
;%r (TeX-style-check TeX-print-style) |
|
1411 |
;%s master-file-name without extention |
|
1412 |
;%v yap command view line |
|
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1413 |
;; (my--eval-after-load tex |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1414 |
;; (add-to-list 'TeX-command-list |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1415 |
;; (list "->PS landscape for pdf" |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1416 |
;; "dvips %d -N0 -Ppdf -G0 -T 297mm,210mm -o %f " |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1417 |
;; 'TeX-run-command nil t)) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1418 |
;; (add-to-list 'TeX-command-list |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1419 |
;; (list "All Texify run-viewer" |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1420 |
;; "texify --tex-opt=--src --run-viewer --clean %s.tex" |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1421 |
;; 'TeX-run-command nil t))) |
0 | 1422 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
1423 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
1424 |
(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
|
1425 |
|
1639d2540bbd
Set outline-minor for file. Fix section to feet header outline pattern.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
460
diff
changeset
|
1426 |
;; Reftex is included with Emacs 21.1. |
0 | 1427 |
|
1428 |
;; (autoload 'reftex-mode "reftex" "RefTeX Minor Mode" t) |
|
1429 |
;; (autoload 'turn-on-reftex "reftex" "RefTeX Minor Mode" nil) |
|
1430 |
;; (autoload 'reftex-citation "reftex-cite" "Make citation" nil) |
|
1431 |
;; (autoload 'reftex-index-phrase-mode "reftex-index" "Phrase mode" t) |
|
1432 |
;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode |
|
1433 |
;; (add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode |
|
1434 |
||
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
1435 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
1436 |
(message "PreviewLatex") |
0 | 1437 |
|
1438 |
;(load "preview-latex.el" nil t t) |
|
1439 |
||
1440 |
;(add-hook 'LaTeX-mode-hook #'LaTeX-preview-setup) |
|
1441 |
;(autoload 'LaTeX-preview-setup "preview") |
|
1442 |
||
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
1443 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
1444 |
(message "Info") |
0 | 1445 |
|
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
|
1446 |
(unless (getenv "INFOPATH") |
1166 | 1447 |
(setenv "INFOPATH" (expand-file-name "~/usr/share/info:"))) |
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
|
1448 |
|
799
c39f6e6fd191
Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
798
diff
changeset
|
1449 |
;; Assume that cygwin-mount already activated. |
c39f6e6fd191
Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
798
diff
changeset
|
1450 |
(when (featurep 'cygwin-mount) |
c39f6e6fd191
Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
798
diff
changeset
|
1451 |
(setenv "INFOPATH" "/usr/share/info/:~/usr/share/info/:") |
c39f6e6fd191
Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
798
diff
changeset
|
1452 |
;; Redefine path-separator to UNIX to update Info-directory-list. |
c39f6e6fd191
Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
798
diff
changeset
|
1453 |
(let ( (path-separator ":") ) |
c39f6e6fd191
Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
798
diff
changeset
|
1454 |
(require 'info) |
c39f6e6fd191
Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
798
diff
changeset
|
1455 |
(info-initialize) |
c39f6e6fd191
Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
798
diff
changeset
|
1456 |
)) |
c39f6e6fd191
Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
798
diff
changeset
|
1457 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
1458 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
972
eb7992880db9
Disable yas. Add info-lookup fix for automake manual.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
970
diff
changeset
|
1459 |
(message "info-lookup") |
eb7992880db9
Disable yas. Add info-lookup fix for automake manual.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
970
diff
changeset
|
1460 |
|
eb7992880db9
Disable yas. Add info-lookup fix for automake manual.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
970
diff
changeset
|
1461 |
;; Info index nodes for automake under Debian. |
eb7992880db9
Disable yas. Add info-lookup fix for automake manual.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
970
diff
changeset
|
1462 |
(setq my-fix-for-automake-info-lookup |
eb7992880db9
Disable yas. Add info-lookup fix for automake manual.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
970
diff
changeset
|
1463 |
'(("(automake-1.11)Macro Index" nil |
eb7992880db9
Disable yas. Add info-lookup fix for automake manual.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
970
diff
changeset
|
1464 |
"^`" "['(]") |
eb7992880db9
Disable yas. Add info-lookup fix for automake manual.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
970
diff
changeset
|
1465 |
("(automake-1.11)Variable Index" nil |
eb7992880db9
Disable yas. Add info-lookup fix for automake manual.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
970
diff
changeset
|
1466 |
"^`" "['(]") |
eb7992880db9
Disable yas. Add info-lookup fix for automake manual.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
970
diff
changeset
|
1467 |
("(automake-1.11)General Index" nil |
eb7992880db9
Disable yas. Add info-lookup fix for automake manual.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
970
diff
changeset
|
1468 |
"^`" "['(]"))) |
eb7992880db9
Disable yas. Add info-lookup fix for automake manual.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
970
diff
changeset
|
1469 |
|
eb7992880db9
Disable yas. Add info-lookup fix for automake manual.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
970
diff
changeset
|
1470 |
;; Add `my-fix-for-automake-info-lookup' entries to the end of doc-spec for |
eb7992880db9
Disable yas. Add info-lookup fix for automake manual.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
970
diff
changeset
|
1471 |
;; some modes. |
1254
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
1472 |
(my--eval-after-load info-look |
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1473 |
(mapc |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1474 |
(lambda (mode) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1475 |
(let ( (doc-spec (info-lookup->doc-spec 'symbol mode)) ) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1476 |
(mapc |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1477 |
(lambda (doc-spec-item) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1478 |
(setcdr (last doc-spec) (list doc-spec-item))) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1479 |
my-fix-for-automake-info-lookup))) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1480 |
'(makefile-mode autoconf-mode)) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1481 |
(info-lookup-maybe-add-help |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1482 |
:mode 'makefile-gmake-mode |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1483 |
:other-modes '(makefile-mode))) |
972
eb7992880db9
Disable yas. Add info-lookup fix for automake manual.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
970
diff
changeset
|
1484 |
|
eb7992880db9
Disable yas. Add info-lookup fix for automake manual.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
970
diff
changeset
|
1485 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
1486 |
(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
|
1487 |
|
799
c39f6e6fd191
Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
798
diff
changeset
|
1488 |
;; Assume that cygwin-mount already activated. |
c39f6e6fd191
Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
798
diff
changeset
|
1489 |
(when (featurep 'cygwin-mount) |
c39f6e6fd191
Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
798
diff
changeset
|
1490 |
(let ( (path (expand-file-name "~")) ) |
c39f6e6fd191
Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
798
diff
changeset
|
1491 |
(when (string-match "\\([c-z]\\):/" path) |
c39f6e6fd191
Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
798
diff
changeset
|
1492 |
(setenv "MANPATH" (concat "/cygdrive/" (substring path 0 1) "/" (substring path 3) "/usr/share/man/:")) |
c39f6e6fd191
Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
798
diff
changeset
|
1493 |
) )) |
c39f6e6fd191
Enable man and info page from Cygwin and from '~/usr/share'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
798
diff
changeset
|
1494 |
|
156
55aed5f25591
Added customisation for woman.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
143
diff
changeset
|
1495 |
(setq woman-use-own-frame nil) |
55aed5f25591
Added customisation for woman.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
143
diff
changeset
|
1496 |
(setq woman-fill-frame t) |
736
33d4749081b9
I prefer EN man pages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
735
diff
changeset
|
1497 |
;; I prefer EN man pages. |
842
9da301f47799
Don't change ``manual-program`` for Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
841
diff
changeset
|
1498 |
(when (memq system-type '(windows-nt cygwin)) |
9da301f47799
Don't change ``manual-program`` for Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
841
diff
changeset
|
1499 |
(setq manual-program "LANG=C man") |
9da301f47799
Don't change ``manual-program`` for Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
841
diff
changeset
|
1500 |
) |
156
55aed5f25591
Added customisation for woman.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
143
diff
changeset
|
1501 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
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 "comint") |
434
12acc6727bd9
Set comint-eol-on-send.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
433
diff
changeset
|
1504 |
|
12acc6727bd9
Set comint-eol-on-send.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
433
diff
changeset
|
1505 |
;; 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
|
1506 |
(setq comint-completion-addsuffix t) |
12acc6727bd9
Set comint-eol-on-send.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
433
diff
changeset
|
1507 |
;; 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
|
1508 |
(setq comint-eol-on-send t) |
12acc6727bd9
Set comint-eol-on-send.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
433
diff
changeset
|
1509 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
1510 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
775
a7253eb62dee
Enable flyspell for Log-Edit buffer to decrease spell errors.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
774
diff
changeset
|
1511 |
(message "spell, ispell, aspell, flyspell") |
0 | 1512 |
|
387
7340a863ae23
Fix spelling settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
385
diff
changeset
|
1513 |
;; Settings for spelling done in '.emacs-autogen'. |
775
a7253eb62dee
Enable flyspell for Log-Edit buffer to decrease spell errors.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
774
diff
changeset
|
1514 |
|
a7253eb62dee
Enable flyspell for Log-Edit buffer to decrease spell errors.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
774
diff
changeset
|
1515 |
(add-hook 'log-edit-mode-hook 'flyspell-mode) |
0 | 1516 |
|
740 | 1517 |
;; (setq-default ispell-extra-args '("--sug-mode=ultra")) |
0 | 1518 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
1519 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1361
f7fcbc47f739
Load gadict mode if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1360
diff
changeset
|
1520 |
(message "dict, dictd, dictionary, gadict") |
f7fcbc47f739
Load gadict mode if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1360
diff
changeset
|
1521 |
|
f7fcbc47f739
Load gadict mode if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1360
diff
changeset
|
1522 |
(when (fboundp 'gadict-mode) |
f7fcbc47f739
Load gadict mode if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1360
diff
changeset
|
1523 |
(add-to-list 'auto-mode-alist '("\\.gadict$" . gadict-mode)) ) |
691 | 1524 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
1525 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
826
869bc1369aca
Add basic figlet function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
825
diff
changeset
|
1526 |
(message "figlet") |
869bc1369aca
Add basic figlet function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
825
diff
changeset
|
1527 |
|
869bc1369aca
Add basic figlet function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
825
diff
changeset
|
1528 |
(defun my-figlet-region (&optional b e) |
869bc1369aca
Add basic figlet function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
825
diff
changeset
|
1529 |
(interactive "r") |
869bc1369aca
Add basic figlet function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
825
diff
changeset
|
1530 |
(shell-command-on-region b e "figlet" (current-buffer) t) |
869bc1369aca
Add basic figlet function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
825
diff
changeset
|
1531 |
(comment-region (mark) (point))) |
869bc1369aca
Add basic figlet function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
825
diff
changeset
|
1532 |
|
869bc1369aca
Add basic figlet function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
825
diff
changeset
|
1533 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
830
52df3d263c55
Enable jdone if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
829
diff
changeset
|
1534 |
(message "jdone") |
52df3d263c55
Enable jdone if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
829
diff
changeset
|
1535 |
|
52df3d263c55
Enable jdone if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
829
diff
changeset
|
1536 |
(ignore-errors |
52df3d263c55
Enable jdone if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
829
diff
changeset
|
1537 |
(require 'jdone) |
52df3d263c55
Enable jdone if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
829
diff
changeset
|
1538 |
(jdone-setup-key-binding) |
52df3d263c55
Enable jdone if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
829
diff
changeset
|
1539 |
(jdone-integrate-hook) |
52df3d263c55
Enable jdone if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
829
diff
changeset
|
1540 |
) |
52df3d263c55
Enable jdone if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
829
diff
changeset
|
1541 |
|
52df3d263c55
Enable jdone if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
829
diff
changeset
|
1542 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
588
aa917b11ffef
Initialize remember mode before org-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
587
diff
changeset
|
1543 |
(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
|
1544 |
|
561 | 1545 |
(when (>= emacs-major-version 22) |
589 | 1546 |
(require 'org)) |
108
1559bb79bdd1
Enable org mode for >= emacs22.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
107
diff
changeset
|
1547 |
|
295 | 1548 |
;; XXX org-todo-keywords '((sequence "TODO" "START" "|" "DONE")) for org-version 4.67c |
615
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
1549 |
(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
|
1550 |
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) |
1334
6e334301afb1
Update paths because I move my base development directory up one level.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1333
diff
changeset
|
1551 |
(setq org-directory "~/my/gtd") |
615
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
1552 |
(setq |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
1553 |
org-agenda-ndays 31 |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
1554 |
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
|
1555 |
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
|
1556 |
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
|
1557 |
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
|
1558 |
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
|
1559 |
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
|
1560 |
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
|
1561 |
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
|
1562 |
org-tags-column 64 |
1006
2267dc920fe9
Set org-mode archiving info types.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1005
diff
changeset
|
1563 |
org-archive-save-context-info '(time file olpath todo itags) |
615
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
1564 |
) |
663
1fdbc6490e16
Use ~/devel/my-devel/gtd for 'org-directory' to allow fetch changes with
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
662
diff
changeset
|
1565 |
(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
|
1566 |
(setq my-org-agenda-note-file (concat org-directory "/NOTE.org")) |
1335
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1567 |
(setq org-agenda-file-regexp "\\`[^.#].*[^_]\\.org\\'" |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1568 |
org-agenda-files (list org-directory)) |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1569 |
;; (setq my-org-agenda-learning-file (concat org-directory "/LEARNING.org")) |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1570 |
;; (setq org-agenda-files `(,my-org-agenda-todo-file ,my-org-agenda-note-file ,my-org-agenda-learning-file)) |
966
e1eb89d99570
Switch to C-v prefix for my key bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
965
diff
changeset
|
1571 |
(define-key global-map "\C-va" 'org-agenda) |
e1eb89d99570
Switch to C-v prefix for my key bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
965
diff
changeset
|
1572 |
(define-key global-map "\C-ve" (lambda nil (interactive) (find-file my-org-agenda-note-file))) |
589 | 1573 |
|
1346
b9df4ce57aed
I don't need mark of "TODO". If schedule date present - I should make this task.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1345
diff
changeset
|
1574 |
(setq org-todo-keywords '("|" "DONE")) |
1112
1fc59cf19c28
Move marked by `org-done-keywords' entries to archive file defined by `my-org-archive-location'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1111
diff
changeset
|
1575 |
|
671
c8f7a49f06a9
My tags for remember buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
670
diff
changeset
|
1576 |
;; My tags for remember buffer. |
1005
39447be44b13
With `org-tag-persistent-alist' variable tags duplicated in *Org Tags* menu. I
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1004
diff
changeset
|
1577 |
(setq org-tag-alist |
671
c8f7a49f06a9
My tags for remember buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
670
diff
changeset
|
1578 |
'( |
c8f7a49f06a9
My tags for remember buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
670
diff
changeset
|
1579 |
("ADMIN" . ?a) |
c8f7a49f06a9
My tags for remember buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
670
diff
changeset
|
1580 |
("BLOG" . ?b) |
c8f7a49f06a9
My tags for remember buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
670
diff
changeset
|
1581 |
("DEVEL" . ?d) |
1012
3432d1144a70
Add HOME tag to org-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1011
diff
changeset
|
1582 |
("HOME" . ?h) |
1004
494cbbd890f0
Add "GET" tag for org-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1003
diff
changeset
|
1583 |
("GET" . ?g) |
671
c8f7a49f06a9
My tags for remember buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
670
diff
changeset
|
1584 |
("LIFE" . ?l) |
950 | 1585 |
("MAIL" . ?m) |
671
c8f7a49f06a9
My tags for remember buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
670
diff
changeset
|
1586 |
("JOB" . ?j) |
947 | 1587 |
("QUESTION" . ?q) |
671
c8f7a49f06a9
My tags for remember buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
670
diff
changeset
|
1588 |
("PROJECT" . ?p) |
c8f7a49f06a9
My tags for remember buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
670
diff
changeset
|
1589 |
("READ" . ?r) |
687
54a77c8a091a
Add item to org-tag-persistent-alist.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
682
diff
changeset
|
1590 |
("SEE" . ?s) |
671
c8f7a49f06a9
My tags for remember buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
670
diff
changeset
|
1591 |
)) |
1005
39447be44b13
With `org-tag-persistent-alist' variable tags duplicated in *Org Tags* menu. I
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1004
diff
changeset
|
1592 |
;; With this variable tags duplicated in *Org Tags* menu. I use |
39447be44b13
With `org-tag-persistent-alist' variable tags duplicated in *Org Tags* menu. I
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1004
diff
changeset
|
1593 |
;; `org-tag-alist' instead until bug fixed. |
39447be44b13
With `org-tag-persistent-alist' variable tags duplicated in *Org Tags* menu. I
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1004
diff
changeset
|
1594 |
(setq org-tag-persistent-alist nil) |
671
c8f7a49f06a9
My tags for remember buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
670
diff
changeset
|
1595 |
|
1177
4a7ffe52d06c
org-support-shift-select
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1176
diff
changeset
|
1596 |
(setq org-support-shift-select t) |
4a7ffe52d06c
org-support-shift-select
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1176
diff
changeset
|
1597 |
|
1176
4998abbdd5f9
org-remember.el has been removed so I get error
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1175
diff
changeset
|
1598 |
(when (>= emacs-major-version 24) |
4998abbdd5f9
org-remember.el has been removed so I get error
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1175
diff
changeset
|
1599 |
(require 'org-capture)) |
4998abbdd5f9
org-remember.el has been removed so I get error
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1175
diff
changeset
|
1600 |
|
1111
494d4d574a26
Use org-capture if available instead of org-remember.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1107
diff
changeset
|
1601 |
(cond |
494d4d574a26
Use org-capture if available instead of org-remember.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1107
diff
changeset
|
1602 |
((featurep 'org-capture) |
494d4d574a26
Use org-capture if available instead of org-remember.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1107
diff
changeset
|
1603 |
(setq org-default-notes-file my-org-agenda-todo-file) |
494d4d574a26
Use org-capture if available instead of org-remember.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1107
diff
changeset
|
1604 |
(setq org-capture-templates |
1347
dba4aaf9de9f
Do not place TODO keyword before task. Without it agenda show file
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1346
diff
changeset
|
1605 |
'(("t" "Todo" entry (file my-org-agenda-todo-file) "* %?\n SCHEDULED: %T"))) |
1111
494d4d574a26
Use org-capture if available instead of org-remember.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1107
diff
changeset
|
1606 |
(define-key global-map "\C-vr" |
494d4d574a26
Use org-capture if available instead of org-remember.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1107
diff
changeset
|
1607 |
(lambda () (interactive) (org-capture nil "t"))) |
494d4d574a26
Use org-capture if available instead of org-remember.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1107
diff
changeset
|
1608 |
) |
494d4d574a26
Use org-capture if available instead of org-remember.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1107
diff
changeset
|
1609 |
((or (featurep 'remember) (fboundp 'remember)) |
615
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
1610 |
(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
|
1611 |
(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
|
1612 |
(add-hook 'remember-mode-hook 'org-remember-apply-template) |
966
e1eb89d99570
Switch to C-v prefix for my key bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
965
diff
changeset
|
1613 |
(define-key global-map "\C-vr" 'org-remember) |
615
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
1614 |
(setq org-remember-templates |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
1615 |
;; 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
|
1616 |
`( |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
1617 |
("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
|
1618 |
;; ("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
|
1619 |
)) |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
1620 |
(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
|
1621 |
(org-remember-insinuate) |
1111
494d4d574a26
Use org-capture if available instead of org-remember.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1107
diff
changeset
|
1622 |
)) |
589 | 1623 |
|
615
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
1624 |
) |
48
5aa6729514f6
Add customize for org mode. Place todo higlight вместе с org mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
47
diff
changeset
|
1625 |
|
1335
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1626 |
(defun my/org-archive-location (path) |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1627 |
"For given PATH make path to archive. Currently add undescore |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1628 |
before file extention. If file name doesn't match |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1629 |
`org-agenda-file-regexp' or have no extention return `nil'." |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1630 |
(if (and (file-name-extension path) |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1631 |
(string-match org-agenda-file-regexp (file-name-nondirectory path))) |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1632 |
(concat (file-name-sans-extension path) "_." (file-name-extension path)) |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1633 |
nil)) |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1634 |
|
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1635 |
(defun my/org-archive-file (path) |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1636 |
"Move marked by `org-done-keywords' entries to archive file. |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1637 |
|
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1638 |
Archive file name constructed by `my/org-archive-location'." |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1639 |
(let ( (archive (my/org-archive-location path)) |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1640 |
entry-re entry-done-re |
1112
1fc59cf19c28
Move marked by `org-done-keywords' entries to archive file defined by `my-org-archive-location'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1111
diff
changeset
|
1641 |
entry-beg entry-end ) |
1335
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1642 |
(unless archive |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1643 |
(error "'%s' looks like a non-org file..." path)) |
1112
1fc59cf19c28
Move marked by `org-done-keywords' entries to archive file defined by `my-org-archive-location'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1111
diff
changeset
|
1644 |
(save-excursion |
1335
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1645 |
(with-current-buffer (find-file-noselect path) |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1646 |
(org-set-regexps-and-options) |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1647 |
(setq entry-re "^\\* " |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1648 |
entry-done-re (concat "^\\* *" (mapconcat 'regexp-quote org-done-keywords "\\|") " ")) |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1649 |
(kill-new "") |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1650 |
(goto-char (point-min)) |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1651 |
(while (re-search-forward entry-done-re nil t) |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1652 |
(setq entry-beg (line-beginning-position)) |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1653 |
(if (re-search-forward entry-re nil t) |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1654 |
(beginning-of-line) |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1655 |
(goto-char (point-max))) |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1656 |
(setq entry-end (point)) |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1657 |
(let ( (last-command 'kill-region) ) |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1658 |
(kill-region entry-beg entry-end)) |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1659 |
) |
1336
7c93663d44f3
Modify archive file only if archive entries found.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1335
diff
changeset
|
1660 |
(when (> (length (car kill-ring)) 0) |
7c93663d44f3
Modify archive file only if archive entries found.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1335
diff
changeset
|
1661 |
(with-current-buffer (find-file-noselect archive) |
7c93663d44f3
Modify archive file only if archive entries found.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1335
diff
changeset
|
1662 |
(goto-char (point-max)) |
7c93663d44f3
Modify archive file only if archive entries found.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1335
diff
changeset
|
1663 |
(insert ?\n) |
7c93663d44f3
Modify archive file only if archive entries found.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1335
diff
changeset
|
1664 |
(yank) |
7c93663d44f3
Modify archive file only if archive entries found.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1335
diff
changeset
|
1665 |
(save-buffer)) |
7c93663d44f3
Modify archive file only if archive entries found.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1335
diff
changeset
|
1666 |
(save-buffer) ))))) |
1335
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1667 |
|
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1668 |
(defun my/org-archive (&optional prefix) |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1669 |
"Move all entries marked by `org-done-keywords' to archive |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1670 |
files with name mangled by `my/org-archive-location'. |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1671 |
|
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1672 |
Without prefix work on current file. With prefix work on " |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1673 |
(interactive "P") |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1674 |
(loop for file in (if prefix (org-agenda-files) (list (buffer-file-name))) do |
c8606339804e
Use entire directory for org-mode file list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
1675 |
(my/org-archive-file file))) |
1112
1fc59cf19c28
Move marked by `org-done-keywords' entries to archive file defined by `my-org-archive-location'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1111
diff
changeset
|
1676 |
|
1351
52f76a250c23
Disable diary integration into org mode because I don't use diary and
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1350
diff
changeset
|
1677 |
(setq org-agenda-include-diary nil) |
834
07219d4d737e
(setq org-agenda-include-diary t)
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
830
diff
changeset
|
1678 |
|
1032
2177746c28a0
Implement 'my-org-kill-by-tag'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1031
diff
changeset
|
1679 |
(defun my-org-kill-by-tag (tag) |
2177746c28a0
Implement 'my-org-kill-by-tag'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1031
diff
changeset
|
1680 |
"Put all entries that matches TAG from current org-file to `kill-ring'." |
2177746c28a0
Implement 'my-org-kill-by-tag'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1031
diff
changeset
|
1681 |
(interactive (list (completing-read "Enter tag: " (org-get-buffer-tags)))) |
1188
bdb5c65b3213
Fix: my-org-kill-by-tag miss some subtree as org-scan-tags assume that buffer unchanged during processing.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1187
diff
changeset
|
1682 |
(let ( rs (last-command 'kill-region) ) |
bdb5c65b3213
Fix: my-org-kill-by-tag miss some subtree as org-scan-tags assume that buffer unchanged during processing.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1187
diff
changeset
|
1683 |
(setq rs (org-scan-tags |
bdb5c65b3213
Fix: my-org-kill-by-tag miss some subtree as org-scan-tags assume that buffer unchanged during processing.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1187
diff
changeset
|
1684 |
(lambda () |
bdb5c65b3213
Fix: my-org-kill-by-tag miss some subtree as org-scan-tags assume that buffer unchanged during processing.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1187
diff
changeset
|
1685 |
(org-mark-subtree) |
bdb5c65b3213
Fix: my-org-kill-by-tag miss some subtree as org-scan-tags assume that buffer unchanged during processing.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1187
diff
changeset
|
1686 |
(list (point) (mark))) |
bdb5c65b3213
Fix: my-org-kill-by-tag miss some subtree as org-scan-tags assume that buffer unchanged during processing.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1187
diff
changeset
|
1687 |
'(member tag tags-list) nil)) |
bdb5c65b3213
Fix: my-org-kill-by-tag miss some subtree as org-scan-tags assume that buffer unchanged during processing.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1187
diff
changeset
|
1688 |
(kill-new "") |
bdb5c65b3213
Fix: my-org-kill-by-tag miss some subtree as org-scan-tags assume that buffer unchanged during processing.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1187
diff
changeset
|
1689 |
(dolist (r (reverse rs)) ; Kill from the end so upcoming regions still valid. |
bdb5c65b3213
Fix: my-org-kill-by-tag miss some subtree as org-scan-tags assume that buffer unchanged during processing.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1187
diff
changeset
|
1690 |
(apply #'kill-region r)))) |
1032
2177746c28a0
Implement 'my-org-kill-by-tag'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1031
diff
changeset
|
1691 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
1692 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
1693 |
(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
|
1694 |
|
682
c80875ec8ad3
Remove text modes from devel mode list as it can not supprt imenu.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
681
diff
changeset
|
1695 |
(dolist (mode (append my-devel-mode-list my-text-mode-list)) |
465
0a9cbfab10f4
Moved highlight pattern from hook to mode highlighting list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
463
diff
changeset
|
1696 |
(font-lock-add-keywords |
0a9cbfab10f4
Moved highlight pattern from hook to mode highlighting list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
463
diff
changeset
|
1697 |
mode |
600
5a67b40de30d
Add some TODO keywords.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
599
diff
changeset
|
1698 |
`( |
5a67b40de30d
Add some TODO keywords.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
599
diff
changeset
|
1699 |
( ,(concat "\\<\\(" (regexp-opt '("TODO" "FIX" "FIXME" "HACK" "XXX")) ":?\\)\\>") 1 'font-lock-warning-face t) |
465
0a9cbfab10f4
Moved highlight pattern from hook to mode highlighting list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
463
diff
changeset
|
1700 |
;; 64 times, for highlight C-u C-u C-u <key> |
1293
064ea72c81c9
Don't highlight 64 subsequent chars as this break major mode highlighting.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1292
diff
changeset
|
1701 |
;; ("\\([^[: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
|
1702 |
)) |
0a9cbfab10f4
Moved highlight pattern from hook to mode highlighting list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
463
diff
changeset
|
1703 |
) |
284
bf5829d9bbf7
Another way to register TODO highlighting.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
280
diff
changeset
|
1704 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
1705 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
660
7abcc3f39fe9
Set basic mail settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
658
diff
changeset
|
1706 |
(message "fortune") |
7abcc3f39fe9
Set basic mail settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
658
diff
changeset
|
1707 |
(setq fortune-file "~/XXX") |
7abcc3f39fe9
Set basic mail settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
658
diff
changeset
|
1708 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
1709 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
779
df488c333452
Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
778
diff
changeset
|
1710 |
(message "mail, message") |
df488c333452
Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
778
diff
changeset
|
1711 |
|
780
afc4ee8b5dea
Use message-user-agent as mail-user-agent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
779
diff
changeset
|
1712 |
(setq mail-user-agent 'message-user-agent) |
afc4ee8b5dea
Use message-user-agent as mail-user-agent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
779
diff
changeset
|
1713 |
|
938
d063544b9199
Add Organization header for 'C-x m'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
937
diff
changeset
|
1714 |
(defun my-compose-mail () |
d063544b9199
Add Organization header for 'C-x m'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
937
diff
changeset
|
1715 |
(interactive) |
d063544b9199
Add Organization header for 'C-x m'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
937
diff
changeset
|
1716 |
(compose-mail nil nil `(("Organization" . ,(getenv "ORGANIZATION"))))) |
d063544b9199
Add Organization header for 'C-x m'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
937
diff
changeset
|
1717 |
(global-set-key (kbd "C-x m") #'my-compose-mail) |
d063544b9199
Add Organization header for 'C-x m'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
937
diff
changeset
|
1718 |
|
781
c0b65744479e
Define own citation format. Also this fix of inclusion mail address of cited
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
780
diff
changeset
|
1719 |
(setq message-citation-line-format "On %Y-%m-%d, %N wrote: |
c0b65744479e
Define own citation format. Also this fix of inclusion mail address of cited
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
780
diff
changeset
|
1720 |
") |
c0b65744479e
Define own citation format. Also this fix of inclusion mail address of cited
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
780
diff
changeset
|
1721 |
(setq message-citation-line-function 'message-insert-formatted-citation-line) |
660
7abcc3f39fe9
Set basic mail settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
658
diff
changeset
|
1722 |
|
7abcc3f39fe9
Set basic mail settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
658
diff
changeset
|
1723 |
(setq mail-signature t) |
7abcc3f39fe9
Set basic mail settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
658
diff
changeset
|
1724 |
(setq mail-signature-file "~/.signature") |
7abcc3f39fe9
Set basic mail settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
658
diff
changeset
|
1725 |
;; (add-hook 'mail-setup-hook 'fortune-to-signature) |
7abcc3f39fe9
Set basic mail settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
658
diff
changeset
|
1726 |
|
779
df488c333452
Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
778
diff
changeset
|
1727 |
;; (setq mail-from-style 'angles) |
df488c333452
Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
778
diff
changeset
|
1728 |
|
df488c333452
Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
778
diff
changeset
|
1729 |
(setq mail-personal-alias-file "~/.mailrc") |
df488c333452
Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
778
diff
changeset
|
1730 |
;; Initialize from your mail aliases file... |
df488c333452
Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
778
diff
changeset
|
1731 |
(setq mail-aliases t) |
783
f2d86933e2b5
Enable ecomplete in addition to abbrev for mail completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
782
diff
changeset
|
1732 |
(require 'ecomplete) |
f2d86933e2b5
Enable ecomplete in addition to abbrev for mail completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
782
diff
changeset
|
1733 |
(setq message-mail-alias-type '(abbrev ecomplete)) |
779
df488c333452
Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
778
diff
changeset
|
1734 |
|
1254
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
1735 |
(my--eval-after-load message |
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1736 |
(require 'mailabbrev) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1737 |
(define-key message-mode-map "\e\t" 'mail-abbrev-complete-alias)) |
779
df488c333452
Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
778
diff
changeset
|
1738 |
|
937
8f8987262795
Move code to proper place. Merge duplicate code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
936
diff
changeset
|
1739 |
(defun my-message-mode-hook () |
8f8987262795
Move code to proper place. Merge duplicate code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
936
diff
changeset
|
1740 |
(setq fill-column 78) |
8f8987262795
Move code to proper place. Merge duplicate code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
936
diff
changeset
|
1741 |
(turn-on-auto-fill) |
8f8987262795
Move code to proper place. Merge duplicate code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
936
diff
changeset
|
1742 |
(flyspell-mode 1)) |
8f8987262795
Move code to proper place. Merge duplicate code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
936
diff
changeset
|
1743 |
(add-hook 'message-mode-hook 'my-message-mode-hook) |
8f8987262795
Move code to proper place. Merge duplicate code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
936
diff
changeset
|
1744 |
|
1044
84d453ec622e
Fix docs. Simplify code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1043
diff
changeset
|
1745 |
;; Mark all my messages by "common" string in "Message-Id" field to simplify |
84d453ec622e
Fix docs. Simplify code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1043
diff
changeset
|
1746 |
;; lookup for followups to me. |
937
8f8987262795
Move code to proper place. Merge duplicate code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
936
diff
changeset
|
1747 |
(setq message-user-fqdn "gavenkoa.example.com") |
784
982eee9d0366
Enable flyspell for message composing buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
783
diff
changeset
|
1748 |
|
779
df488c333452
Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
778
diff
changeset
|
1749 |
;; Kill message buffer after mail send. You always can use C-c C-s to preserve it. |
df488c333452
Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
778
diff
changeset
|
1750 |
(setq message-kill-buffer-on-exit t) |
df488c333452
Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
778
diff
changeset
|
1751 |
|
893
0e1febcbddb6
Escape file name with safe chars.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
892
diff
changeset
|
1752 |
(defconst my-safe-filename-char-regex "[[:alnum:]-_!.@]" |
0e1febcbddb6
Escape file name with safe chars.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
892
diff
changeset
|
1753 |
"Safe file names.") |
0e1febcbddb6
Escape file name with safe chars.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
892
diff
changeset
|
1754 |
|
0e1febcbddb6
Escape file name with safe chars.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
892
diff
changeset
|
1755 |
(defun my-clean-filename (filename) |
0e1febcbddb6
Escape file name with safe chars.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
892
diff
changeset
|
1756 |
(mapconcat |
0e1febcbddb6
Escape file name with safe chars.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
892
diff
changeset
|
1757 |
(lambda (ch) (or (when (string-match my-safe-filename-char-regex (char-to-string ch)) (char-to-string ch)) "-")) |
0e1febcbddb6
Escape file name with safe chars.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
892
diff
changeset
|
1758 |
filename "") ) |
0e1febcbddb6
Escape file name with safe chars.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
892
diff
changeset
|
1759 |
|
890
7558a3f8a3d9
Store message in `gnus-article-save-directory' after successful sending. It is
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
889
diff
changeset
|
1760 |
(defun my-message-save () |
7558a3f8a3d9
Store message in `gnus-article-save-directory' after successful sending. It is
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
889
diff
changeset
|
1761 |
"Store message in `gnus-article-save-directory' after |
7558a3f8a3d9
Store message in `gnus-article-save-directory' after successful sending. It is
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
889
diff
changeset
|
1762 |
successful sending. It is possible that mail rejected and I lost |
7558a3f8a3d9
Store message in `gnus-article-save-directory' after successful sending. It is
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
889
diff
changeset
|
1763 |
it completely, this func save it for me." |
7558a3f8a3d9
Store message in `gnus-article-save-directory' after successful sending. It is
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
889
diff
changeset
|
1764 |
(unless (eq major-mode 'message-mode) |
7558a3f8a3d9
Store message in `gnus-article-save-directory' after successful sending. It is
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
889
diff
changeset
|
1765 |
(error "Attempt to call my-message-save in non message-mode buffer")) |
7558a3f8a3d9
Store message in `gnus-article-save-directory' after successful sending. It is
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
889
diff
changeset
|
1766 |
(make-directory gnus-article-save-directory t) |
7558a3f8a3d9
Store message in `gnus-article-save-directory' after successful sending. It is
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
889
diff
changeset
|
1767 |
(let ( (buf (current-buffer)) |
893
0e1febcbddb6
Escape file name with safe chars.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
892
diff
changeset
|
1768 |
(field-to (my-clean-filename (or (message-fetch-field "Newsgroups") (message-fetch-field "To")))) |
0e1febcbddb6
Escape file name with safe chars.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
892
diff
changeset
|
1769 |
(field-subject (my-clean-filename (message-fetch-field "Subject"))) |
890
7558a3f8a3d9
Store message in `gnus-article-save-directory' after successful sending. It is
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
889
diff
changeset
|
1770 |
file ) |
1107
cc1303629cde
Fix: save-current-buffer: Opening output file: file name too long.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1106
diff
changeset
|
1771 |
(when (> (length field-to) 32) |
cc1303629cde
Fix: save-current-buffer: Opening output file: file name too long.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1106
diff
changeset
|
1772 |
(setq field-to (substring field-to 0 32))) |
cc1303629cde
Fix: save-current-buffer: Opening output file: file name too long.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1106
diff
changeset
|
1773 |
(when (> (length field-subject) 64) |
cc1303629cde
Fix: save-current-buffer: Opening output file: file name too long.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1106
diff
changeset
|
1774 |
(setq field-subject (substring field-subject 0 64))) |
1309
00f80b2988a2
Use "-" as hour/minute/second separator instead of ":" to avoid
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1308
diff
changeset
|
1775 |
(setq file (concat gnus-article-save-directory "/" (format-time-string "%F_%H-%M-%S") "_" field-to "_" field-subject)) |
890
7558a3f8a3d9
Store message in `gnus-article-save-directory' after successful sending. It is
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
889
diff
changeset
|
1776 |
(with-temp-file file |
7558a3f8a3d9
Store message in `gnus-article-save-directory' after successful sending. It is
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
889
diff
changeset
|
1777 |
(insert-buffer buf) |
7558a3f8a3d9
Store message in `gnus-article-save-directory' after successful sending. It is
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
889
diff
changeset
|
1778 |
)) ) |
7558a3f8a3d9
Store message in `gnus-article-save-directory' after successful sending. It is
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
889
diff
changeset
|
1779 |
(add-hook 'message-sent-hook 'my-message-save) |
7558a3f8a3d9
Store message in `gnus-article-save-directory' after successful sending. It is
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
889
diff
changeset
|
1780 |
|
779
df488c333452
Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
778
diff
changeset
|
1781 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
747
dd1d88804512
Use smtpmail mode for sending mail.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
746
diff
changeset
|
1782 |
(message "smtp, smtpmail") |
dd1d88804512
Use smtpmail mode for sending mail.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
746
diff
changeset
|
1783 |
|
843
2adc2d3542a4
Use 'sendmail-send-it' for 'send-mail-function' under Debian as
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
842
diff
changeset
|
1784 |
(when (and (not (eq system-type 'gnu/linux)) (boundp 'smtpmail-smtp-server)) |
773
9308a0c91624
Load auth info if possible. Load smtpmail if user provide server to use.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
772
diff
changeset
|
1785 |
(require 'smtpmail) |
9308a0c91624
Load auth info if possible. Load smtpmail if user provide server to use.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
772
diff
changeset
|
1786 |
(setq |
9308a0c91624
Load auth info if possible. Load smtpmail if user provide server to use.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
772
diff
changeset
|
1787 |
;; If you use the default mail user agent. |
9308a0c91624
Load auth info if possible. Load smtpmail if user provide server to use.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
772
diff
changeset
|
1788 |
send-mail-function 'smtpmail-send-it |
9308a0c91624
Load auth info if possible. Load smtpmail if user provide server to use.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
772
diff
changeset
|
1789 |
;; If you use Message or Gnus. |
9308a0c91624
Load auth info if possible. Load smtpmail if user provide server to use.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
772
diff
changeset
|
1790 |
message-send-mail-function 'smtpmail-send-it |
9308a0c91624
Load auth info if possible. Load smtpmail if user provide server to use.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
772
diff
changeset
|
1791 |
) |
9308a0c91624
Load auth info if possible. Load smtpmail if user provide server to use.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
772
diff
changeset
|
1792 |
) |
747
dd1d88804512
Use smtpmail mode for sending mail.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
746
diff
changeset
|
1793 |
;; (setq smtpmail-debug-verb t) |
dd1d88804512
Use smtpmail mode for sending mail.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
746
diff
changeset
|
1794 |
;; (setq smtpmail-debug-info t) |
dd1d88804512
Use smtpmail mode for sending mail.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
746
diff
changeset
|
1795 |
|
dd1d88804512
Use smtpmail mode for sending mail.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
746
diff
changeset
|
1796 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
779
df488c333452
Move message-mode settings to own section.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
778
diff
changeset
|
1797 |
(message "gnus, mh-e") |
772
f0a62f45a356
Kill message buffer after mail send. You always can use C-c C-s to preserve it.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
771
diff
changeset
|
1798 |
|
1327
dd9d74485fb6
Show List-URL: mail header. Enable spam reporting for Gnus.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1326
diff
changeset
|
1799 |
;; (setq gnus-verbose 10) |
dd9d74485fb6
Show List-URL: mail header. Enable spam reporting for Gnus.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1326
diff
changeset
|
1800 |
|
757 | 1801 |
(setq gnus-site-init-file "~/.gnus.el") |
1802 |
||
1054
144dcc473957
Set GNUS file reading settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1050
diff
changeset
|
1803 |
(setq |
144dcc473957
Set GNUS file reading settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1050
diff
changeset
|
1804 |
gnus-read-newsrc-file nil |
144dcc473957
Set GNUS file reading settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1050
diff
changeset
|
1805 |
gnus-save-newsrc-file nil |
144dcc473957
Set GNUS file reading settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1050
diff
changeset
|
1806 |
gnus-backup-startup-file t |
144dcc473957
Set GNUS file reading settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1050
diff
changeset
|
1807 |
gnus-use-dribble-file t |
144dcc473957
Set GNUS file reading settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1050
diff
changeset
|
1808 |
gnus-save-killed-list t |
144dcc473957
Set GNUS file reading settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1050
diff
changeset
|
1809 |
) |
144dcc473957
Set GNUS file reading settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1050
diff
changeset
|
1810 |
|
841
68e40729a4f4
Kill Gnus when exiting Emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
840
diff
changeset
|
1811 |
(defun my-kill-gnus () |
68e40729a4f4
Kill Gnus when exiting Emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
840
diff
changeset
|
1812 |
"Kill Gnus when exiting Emacs." |
68e40729a4f4
Kill Gnus when exiting Emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
840
diff
changeset
|
1813 |
(let ( (gnus-interactive-exit nil) ) |
68e40729a4f4
Kill Gnus when exiting Emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
840
diff
changeset
|
1814 |
(gnus-group-exit) |
68e40729a4f4
Kill Gnus when exiting Emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
840
diff
changeset
|
1815 |
)) |
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1816 |
(my--eval-after-load gnus |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1817 |
(add-hook 'kill-emacs-hook 'my-kill-gnus)) |
1254
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
1818 |
|
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
1819 |
(my--eval-after-load gnus-art |
1327
dd9d74485fb6
Show List-URL: mail header. Enable spam reporting for Gnus.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1326
diff
changeset
|
1820 |
(setq gnus-visible-headers (concat gnus-visible-headers "\\|^Archived-At:\\|^List-URL:"))) |
841
68e40729a4f4
Kill Gnus when exiting Emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
840
diff
changeset
|
1821 |
|
794
7f81d5acc2bc
Store gnus specific files to '~/.gnus'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
793
diff
changeset
|
1822 |
;; Store gnus specific files to '~/.gnus'. |
804
c347ec94c201
Set "~/.gnus" prefix to all mail directories.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
803
diff
changeset
|
1823 |
(setq |
c347ec94c201
Set "~/.gnus" prefix to all mail directories.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
803
diff
changeset
|
1824 |
gnus-directory "~/.gnus" |
c347ec94c201
Set "~/.gnus" prefix to all mail directories.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
803
diff
changeset
|
1825 |
gnus-agent-directory "~/.gnus/agent/" |
c347ec94c201
Set "~/.gnus" prefix to all mail directories.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
803
diff
changeset
|
1826 |
gnus-article-save-directory "~/.gnus/saved" |
c347ec94c201
Set "~/.gnus" prefix to all mail directories.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
803
diff
changeset
|
1827 |
gnus-kill-files-directory "~/.gnus/scores" |
c347ec94c201
Set "~/.gnus" prefix to all mail directories.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
803
diff
changeset
|
1828 |
gnus-cache-directory "~/.gnus/cache" |
c347ec94c201
Set "~/.gnus" prefix to all mail directories.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
803
diff
changeset
|
1829 |
mail-source-directory "~/.gnus/mail" |
c347ec94c201
Set "~/.gnus" prefix to all mail directories.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
803
diff
changeset
|
1830 |
message-directory "~/.gnus/mail" |
c347ec94c201
Set "~/.gnus" prefix to all mail directories.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
803
diff
changeset
|
1831 |
message-auto-save-directory "~/.gnus/autosave" |
c347ec94c201
Set "~/.gnus" prefix to all mail directories.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
803
diff
changeset
|
1832 |
;; message-signature-directory |
c347ec94c201
Set "~/.gnus" prefix to all mail directories.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
803
diff
changeset
|
1833 |
mailcap-download-directory "~/.gnus/mailcap" |
c347ec94c201
Set "~/.gnus" prefix to all mail directories.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
803
diff
changeset
|
1834 |
nnml-directory "~/.gnus/nnml-mail" |
c347ec94c201
Set "~/.gnus" prefix to all mail directories.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
803
diff
changeset
|
1835 |
spam-directory "~/.gnus/spam/" |
c347ec94c201
Set "~/.gnus" prefix to all mail directories.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
803
diff
changeset
|
1836 |
smime-certificate-directory "~/.gnus/certs/" |
805
d7cbd3a099e5
Set nnfolder-active-file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
804
diff
changeset
|
1837 |
nnfolder-directory "~/.gnus/archive" |
d7cbd3a099e5
Set nnfolder-active-file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
804
diff
changeset
|
1838 |
nnfolder-active-file "~/.gnus/archive/active" |
975 | 1839 |
) |
798
c1f795e32b09
Spam settings (commented).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
797
diff
changeset
|
1840 |
|
806
eaabe3db15a5
Remove gnus-ignored-newsgroups to show all GMail folders.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
805
diff
changeset
|
1841 |
;; Remove gnus-ignored-newsgroups to show all GMail folders. |
862
6b956999856b
Fix "isearch-no-upper-case-p: Wrong type argument: stringp, nil" from gnus.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
861
diff
changeset
|
1842 |
(setq gnus-ignored-newsgroups "some-non-existing") |
798
c1f795e32b09
Spam settings (commented).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
797
diff
changeset
|
1843 |
|
1327
dd9d74485fb6
Show List-URL: mail header. Enable spam reporting for Gnus.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1326
diff
changeset
|
1844 |
(my--eval-after-load gnus |
dd9d74485fb6
Show List-URL: mail header. Enable spam reporting for Gnus.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1326
diff
changeset
|
1845 |
(require 'spam) |
1331
69f9d5bdbddd
Initialise stam module after loading.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1330
diff
changeset
|
1846 |
(spam-initialize) |
1327
dd9d74485fb6
Show List-URL: mail header. Enable spam reporting for Gnus.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1326
diff
changeset
|
1847 |
(setq gnus-spam-process-newsgroups |
dd9d74485fb6
Show List-URL: mail header. Enable spam reporting for Gnus.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1326
diff
changeset
|
1848 |
'(("^gmane\\." ((spam spam-use-gmane)))))) |
794
7f81d5acc2bc
Store gnus specific files to '~/.gnus'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
793
diff
changeset
|
1849 |
|
739
65e6b1b497fb
Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
738
diff
changeset
|
1850 |
(setq |
819
38b7c81853e8
Mark that I am not 'gnus-novice-user' to avoid conformation when delete mails.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
818
diff
changeset
|
1851 |
gnus-novice-user nil |
739
65e6b1b497fb
Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
738
diff
changeset
|
1852 |
gnus-expert-user nil |
65e6b1b497fb
Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
738
diff
changeset
|
1853 |
gnus-interactive-catchup t |
65e6b1b497fb
Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
738
diff
changeset
|
1854 |
gnus-interactive-exit t |
65e6b1b497fb
Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
738
diff
changeset
|
1855 |
) |
65e6b1b497fb
Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
738
diff
changeset
|
1856 |
|
65e6b1b497fb
Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
738
diff
changeset
|
1857 |
(setq |
65e6b1b497fb
Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
738
diff
changeset
|
1858 |
gnus-read-active-file nil |
65e6b1b497fb
Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
738
diff
changeset
|
1859 |
gnus-check-new-newsgroups nil |
65e6b1b497fb
Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
738
diff
changeset
|
1860 |
gnus-check-bogus-newsgroups nil |
65e6b1b497fb
Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
738
diff
changeset
|
1861 |
) |
65e6b1b497fb
Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
738
diff
changeset
|
1862 |
|
1058
fac5c0d3af6a
Check for timeout in gnus article fetching.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1055
diff
changeset
|
1863 |
(setq nntp-connection-timeout 10) |
fac5c0d3af6a
Check for timeout in gnus article fetching.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1055
diff
changeset
|
1864 |
|
902
09f76020fc46
Increase gnus-large-newsgroup.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
901
diff
changeset
|
1865 |
(setq gnus-large-newsgroup 800) |
941
ea395da0c817
Increase gnus-large-ephemeral-newsgroup.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
940
diff
changeset
|
1866 |
(setq gnus-large-ephemeral-newsgroup 600) |
ea395da0c817
Increase gnus-large-ephemeral-newsgroup.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
940
diff
changeset
|
1867 |
(setq gnus-group-listing-limit 1000) |
902
09f76020fc46
Increase gnus-large-newsgroup.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
901
diff
changeset
|
1868 |
|
912
a3b18cbc7293
Set gnus-summary-next-group-on-exit to nil as I like stay an group from which
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
911
diff
changeset
|
1869 |
(setq |
a3b18cbc7293
Set gnus-summary-next-group-on-exit to nil as I like stay an group from which
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
911
diff
changeset
|
1870 |
gnus-group-goto-unread t |
a3b18cbc7293
Set gnus-summary-next-group-on-exit to nil as I like stay an group from which
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
911
diff
changeset
|
1871 |
gnus-summary-next-group-on-exit nil |
a3b18cbc7293
Set gnus-summary-next-group-on-exit to nil as I like stay an group from which
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
911
diff
changeset
|
1872 |
) |
a3b18cbc7293
Set gnus-summary-next-group-on-exit to nil as I like stay an group from which
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
911
diff
changeset
|
1873 |
|
922
b0636498a974
Shown read groups anyway.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
921
diff
changeset
|
1874 |
(setq |
b0636498a974
Shown read groups anyway.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
921
diff
changeset
|
1875 |
gnus-permanently-visible-groups ".*" |
b0636498a974
Shown read groups anyway.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
921
diff
changeset
|
1876 |
gnus-topic-display-empty-topics t) |
913
cb42c2651d3f
Add command to show all subscribed groups (ever read).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
912
diff
changeset
|
1877 |
|
829
093b6699e903
Some settings for Gnus caching (same as default values).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
826
diff
changeset
|
1878 |
;; (setq 'gnus-use-cache t) |
093b6699e903
Some settings for Gnus caching (same as default values).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
826
diff
changeset
|
1879 |
(setq gnus-use-long-file-name t) |
093b6699e903
Some settings for Gnus caching (same as default values).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
826
diff
changeset
|
1880 |
(setq gnus-cache-remove-articles '(read)) |
093b6699e903
Some settings for Gnus caching (same as default values).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
826
diff
changeset
|
1881 |
|
786
496791c4fe36
If you're spooling in overlapping mbox folders, you probably want
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
785
diff
changeset
|
1882 |
;; If you're spooling in overlapping mbox folders, you probably want to delete |
496791c4fe36
If you're spooling in overlapping mbox folders, you probably want
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
785
diff
changeset
|
1883 |
;; all messages with duplicate message IDs. |
496791c4fe36
If you're spooling in overlapping mbox folders, you probably want
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
785
diff
changeset
|
1884 |
(setq nnmail-treat-duplicates 'delete) |
496791c4fe36
If you're spooling in overlapping mbox folders, you probably want
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
785
diff
changeset
|
1885 |
|
1316
da311a1522a0
Disable Warning: FAIL: (file-error "Cannot open load file" "w3m-util")
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1315
diff
changeset
|
1886 |
;; To disable html part of a message: |
da311a1522a0
Disable Warning: FAIL: (file-error "Cannot open load file" "w3m-util")
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1315
diff
changeset
|
1887 |
;; (setq mm-discouraged-alternatives '("text/html" "text/richtext")) |
da311a1522a0
Disable Warning: FAIL: (file-error "Cannot open load file" "w3m-util")
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1315
diff
changeset
|
1888 |
;; I manage to open link in external browser and fix navigation command so pretty ok with HTML parts. |
da311a1522a0
Disable Warning: FAIL: (file-error "Cannot open load file" "w3m-util")
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1315
diff
changeset
|
1889 |
(setq mm-discouraged-alternatives '("text/richtext")) |
939
efac9eeab57c
I need use w3m because nntp://sql.ru provide only articles in HTML with highly
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
938
diff
changeset
|
1890 |
(setq mm-text-html-renderer 'w3m) |
787
fc00f202c3e3
Do not use the html part of a message, use the text part if possible!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
786
diff
changeset
|
1891 |
|
1315
c2278c83f00a
cl-eval-when doesn't exist on Emacs v24.2.1.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1314
diff
changeset
|
1892 |
(eval-when-compile |
1316
da311a1522a0
Disable Warning: FAIL: (file-error "Cannot open load file" "w3m-util")
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1315
diff
changeset
|
1893 |
(ignore-errors |
da311a1522a0
Disable Warning: FAIL: (file-error "Cannot open load file" "w3m-util")
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1315
diff
changeset
|
1894 |
;; w3m-anchor is macros in newer Emacs, need definition during byte-compilation. |
da311a1522a0
Disable Warning: FAIL: (file-error "Cannot open load file" "w3m-util")
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1315
diff
changeset
|
1895 |
(require 'w3m-util))) |
1294
03ff957a2614
Fix: my-w3m-view-url: Invalid function: w3m-anchor
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1292
diff
changeset
|
1896 |
|
1071
60f93286b9a1
Browse URLs in external browser in w3m.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1068
diff
changeset
|
1897 |
(defun my-w3m-view-url () |
60f93286b9a1
Browse URLs in external browser in w3m.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1068
diff
changeset
|
1898 |
(interactive) |
60f93286b9a1
Browse URLs in external browser in w3m.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1068
diff
changeset
|
1899 |
(browse-url (w3m-anchor))) |
60f93286b9a1
Browse URLs in external browser in w3m.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1068
diff
changeset
|
1900 |
|
1254
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
1901 |
(my--eval-after-load w3m |
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1902 |
(define-key w3m-minor-mode-map (kbd "RET") #'my-w3m-view-url) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1903 |
(define-key w3m-minor-mode-map (kbd "S-RET") #'w3m-safe-view-this-url) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1904 |
(define-key w3m-minor-mode-map (kbd "<left>") #'backward-char) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1905 |
(define-key w3m-minor-mode-map (kbd "<right>") #'forward-char) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1906 |
(define-key w3m-minor-mode-map (kbd "<up>") #'previous-line) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1907 |
(define-key w3m-minor-mode-map (kbd "<down>") #'next-line)) |
940
90485e256108
Add key bindings for natural movement by arrow keys and opening url in
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
939
diff
changeset
|
1908 |
|
797 | 1909 |
(add-hook 'gnus-group-mode-hook 'gnus-topic-mode) |
1910 |
||
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1911 |
(my--eval-after-load gnus |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
1912 |
(gnus-demon-add-handler 'gnus-demon-scan-news 10 t)) |
898 | 1913 |
|
929
dc590d8c6f7b
Show prefix and 'To' field instead 'From' for my mails.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
928
diff
changeset
|
1914 |
;; Show prefix and 'To' field instead 'From' for my mails. |
1328
a2ce26837465
Mark my article more visually.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1327
diff
changeset
|
1915 |
(setq gnus-summary-to-prefix (if window-system "▒ " "==> ")) |
a2ce26837465
Mark my article more visually.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1327
diff
changeset
|
1916 |
(setq gnus-summary-newsgroup-prefix (if window-system "▒ " "==> ")) |
929
dc590d8c6f7b
Show prefix and 'To' field instead 'From' for my mails.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
928
diff
changeset
|
1917 |
(setq gnus-ignored-from-addresses (list (regexp-quote user-mail-address) (regexp-quote user-full-name))) |
dc590d8c6f7b
Show prefix and 'To' field instead 'From' for my mails.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
928
diff
changeset
|
1918 |
|
936
c5f9c7bc1661
Use ORGANIZATION env var in gnus-posting-styles.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
935
diff
changeset
|
1919 |
(setq gnus-posting-styles |
c5f9c7bc1661
Use ORGANIZATION env var in gnus-posting-styles.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
935
diff
changeset
|
1920 |
'((".*" |
c5f9c7bc1661
Use ORGANIZATION env var in gnus-posting-styles.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
935
diff
changeset
|
1921 |
(organization (getenv "ORGANIZATION")) |
c5f9c7bc1661
Use ORGANIZATION env var in gnus-posting-styles.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
935
diff
changeset
|
1922 |
(signature-file "~/.signature")))) |
742
f59b924b1b7d
Add signature to mails.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
741
diff
changeset
|
1923 |
|
928
067307a8ab45
Change layout of summary buffer: add group window.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
927
diff
changeset
|
1924 |
(gnus-add-configuration |
1038
2c905ed01467
Don't show group buffer to speed up buffer switching.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1030
diff
changeset
|
1925 |
'(article (vertical 1.0 (summary .30 point) (article 1.0)))) |
928
067307a8ab45
Change layout of summary buffer: add group window.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
927
diff
changeset
|
1926 |
|
932
5648b7498bc5
gnus-summary-display-arrow
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
931
diff
changeset
|
1927 |
(setq gnus-summary-display-arrow t) |
5648b7498bc5
gnus-summary-display-arrow
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
931
diff
changeset
|
1928 |
|
897
1979b76d6f6b
Remember when I visit group last time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
896
diff
changeset
|
1929 |
;; `gnus-summary-line-format', |
789
6daf35744ad3
Modify 'gnus-summary-line-format'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
788
diff
changeset
|
1930 |
;; `gnus-server-line-format', `gnus-topic-line-format', |
6daf35744ad3
Modify 'gnus-summary-line-format'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
788
diff
changeset
|
1931 |
;; `gnus-group-mode-line-format', `gnus-summary-mode-line-format', |
6daf35744ad3
Modify 'gnus-summary-line-format'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
788
diff
changeset
|
1932 |
;; `gnus-article-mode-line-format', `gnus-server-mode-line-format', |
6daf35744ad3
Modify 'gnus-summary-line-format'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
788
diff
changeset
|
1933 |
;; `gnus-summary-pick-line-format'. |
6daf35744ad3
Modify 'gnus-summary-line-format'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
788
diff
changeset
|
1934 |
|
790
356d5ed1649c
Customize gnus-sum-thread-tree.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
789
diff
changeset
|
1935 |
(when window-system |
356d5ed1649c
Customize gnus-sum-thread-tree.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
789
diff
changeset
|
1936 |
(setq |
931
de20db59231c
Highlight root articles in Gnus summary buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
930
diff
changeset
|
1937 |
gnus-sum-thread-tree-root "● " |
de20db59231c
Highlight root articles in Gnus summary buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
930
diff
changeset
|
1938 |
gnus-sum-thread-tree-false-root " ○ " |
790
356d5ed1649c
Customize gnus-sum-thread-tree.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
789
diff
changeset
|
1939 |
gnus-sum-thread-tree-indent " " |
931
de20db59231c
Highlight root articles in Gnus summary buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
930
diff
changeset
|
1940 |
gnus-sum-thread-tree-single-indent "⚇ " |
790
356d5ed1649c
Customize gnus-sum-thread-tree.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
789
diff
changeset
|
1941 |
gnus-sum-thread-tree-leaf-with-other "├► " |
803
05cd01bc7813
Use another symbol graphic symbol as old does not present in Windows 7.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
802
diff
changeset
|
1942 |
gnus-sum-thread-tree-single-leaf "└► " |
790
356d5ed1649c
Customize gnus-sum-thread-tree.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
789
diff
changeset
|
1943 |
gnus-sum-thread-tree-vertical "│" |
356d5ed1649c
Customize gnus-sum-thread-tree.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
789
diff
changeset
|
1944 |
)) |
356d5ed1649c
Customize gnus-sum-thread-tree.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
789
diff
changeset
|
1945 |
|
789
6daf35744ad3
Modify 'gnus-summary-line-format'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
788
diff
changeset
|
1946 |
(setq gnus-user-date-format-alist '((t . "%Y-%m-%d %H:%M"))) |
791
134ec9507faf
Show standard status in Gnus summary.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
790
diff
changeset
|
1947 |
(setq gnus-summary-line-format "%U%R%z %&user-date; %B %[%-22,22f%] %s\n") |
789
6daf35744ad3
Modify 'gnus-summary-line-format'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
788
diff
changeset
|
1948 |
(setq gnus-summary-mode-line-format "Gnus: %p %Z") |
6daf35744ad3
Modify 'gnus-summary-line-format'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
788
diff
changeset
|
1949 |
|
927
33cee658675d
Enable user defined dates in article buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
926
diff
changeset
|
1950 |
(setq gnus-treat-date-user-defined 'head) |
744
d3fc2caa5498
Setup own time format (ISO 8601 + day of week) for GNUS article.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
743
diff
changeset
|
1951 |
(setq gnus-article-time-format "%Y-%m-%d %T%z %a") |
782
03aa367920e6
Make date header setting in portable way as recommended in manual.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
781
diff
changeset
|
1952 |
(setq gnus-article-date-headers '(combined-lapsed user-defined)) |
744
d3fc2caa5498
Setup own time format (ISO 8601 + day of week) for GNUS article.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
743
diff
changeset
|
1953 |
|
897
1979b76d6f6b
Remember when I visit group last time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
896
diff
changeset
|
1954 |
;; Remember when I visit group last time. |
1979b76d6f6b
Remember when I visit group last time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
896
diff
changeset
|
1955 |
(add-hook 'gnus-select-group-hook 'gnus-group-set-timestamp) |
1979b76d6f6b
Remember when I visit group last time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
896
diff
changeset
|
1956 |
|
1979b76d6f6b
Remember when I visit group last time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
896
diff
changeset
|
1957 |
(defun gnus-user-format-function-d (header) |
1979b76d6f6b
Remember when I visit group last time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
896
diff
changeset
|
1958 |
(let ((time (gnus-group-timestamp gnus-tmp-group))) |
899
e723c4b0d48c
Do not show very old timestamps.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
898
diff
changeset
|
1959 |
(if (and time (time-less-p (time-subtract (current-time) time) (seconds-to-time (* 3600 24 7 30 2)))) |
897
1979b76d6f6b
Remember when I visit group last time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
896
diff
changeset
|
1960 |
(format-time-string "%Y-%m-%d %H:%M" time) |
1979b76d6f6b
Remember when I visit group last time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
896
diff
changeset
|
1961 |
""))) |
1979b76d6f6b
Remember when I visit group last time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
896
diff
changeset
|
1962 |
|
1979b76d6f6b
Remember when I visit group last time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
896
diff
changeset
|
1963 |
;; %d (or with user defined format %ud) shown when I visit group last time in |
1979b76d6f6b
Remember when I visit group last time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
896
diff
changeset
|
1964 |
;; %*Group* buffer. |
1979b76d6f6b
Remember when I visit group last time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
896
diff
changeset
|
1965 |
(setq gnus-group-line-format "%M%S%p%P%6y:%B%(%-50,50G%)%3O %ud\n") |
1979b76d6f6b
Remember when I visit group last time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
896
diff
changeset
|
1966 |
|
944
664e6f4c3dc8
Document gnus-extra-headers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
942
diff
changeset
|
1967 |
;; gnus-visible-headers gnus-extra-headers |
796
23e9f51428a9
gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
795
diff
changeset
|
1968 |
(setq |
23e9f51428a9
gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
795
diff
changeset
|
1969 |
gnus-sorted-header-list |
23e9f51428a9
gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
795
diff
changeset
|
1970 |
'( |
23e9f51428a9
gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
795
diff
changeset
|
1971 |
"^From:" |
23e9f51428a9
gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
795
diff
changeset
|
1972 |
"^Subject:" |
23e9f51428a9
gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
795
diff
changeset
|
1973 |
"^Summary:" |
23e9f51428a9
gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
795
diff
changeset
|
1974 |
"^Keywords:" |
23e9f51428a9
gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
795
diff
changeset
|
1975 |
"^Newsgroups:" |
23e9f51428a9
gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
795
diff
changeset
|
1976 |
"^Followup-To:" |
23e9f51428a9
gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
795
diff
changeset
|
1977 |
"^To:" |
23e9f51428a9
gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
795
diff
changeset
|
1978 |
"^Cc:" |
23e9f51428a9
gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
795
diff
changeset
|
1979 |
"^Organization:" |
23e9f51428a9
gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
795
diff
changeset
|
1980 |
"^Date:" |
23e9f51428a9
gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
795
diff
changeset
|
1981 |
"^User-Agent:" |
23e9f51428a9
gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
795
diff
changeset
|
1982 |
"^X-Mailer:" |
23e9f51428a9
gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
795
diff
changeset
|
1983 |
"^X-Newsreader:" |
23e9f51428a9
gnus-sorted-header-list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
795
diff
changeset
|
1984 |
)) |
795
627ed33d9488
gnus-visible-headers
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
794
diff
changeset
|
1985 |
|
755
6f903d3b2ec7
Adaptive score for GNUS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
754
diff
changeset
|
1986 |
(setq |
6f903d3b2ec7
Adaptive score for GNUS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
754
diff
changeset
|
1987 |
gnus-show-threads t |
785
7956c2497dda
gnus-thread-sort-by-date
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
784
diff
changeset
|
1988 |
gnus-thread-sort-functions '(gnus-thread-sort-by-date gnus-thread-sort-by-total-score) |
1048
9d671852b5c1
Some GNUS default settings...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1047
diff
changeset
|
1989 |
gnus-summary-thread-gathering-function 'gnus-gather-threads-by-subject |
9d671852b5c1
Some GNUS default settings...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1047
diff
changeset
|
1990 |
gnus-summary-gather-subject-limit 'fuzzy |
9d671852b5c1
Some GNUS default settings...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1047
diff
changeset
|
1991 |
gnus-thread-hide-killed t |
9d671852b5c1
Some GNUS default settings...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1047
diff
changeset
|
1992 |
gnus-thread-ignore-subject t |
755
6f903d3b2ec7
Adaptive score for GNUS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
754
diff
changeset
|
1993 |
) |
788
b7b60066599e
Split scoring setting from other.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
787
diff
changeset
|
1994 |
|
906
da962aa69458
Especially highlight my message and replays to me.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
905
diff
changeset
|
1995 |
;; gnus-summary-mark-below gnus-summary-default-score gnus-summary-default-high-score gnus-summary-default-low-score |
da962aa69458
Especially highlight my message and replays to me.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
905
diff
changeset
|
1996 |
|
908 | 1997 |
;; Scoring. |
1998 |
(setq |
|
820
dc1331cd9729
Set gnus-use-scoring to t.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
819
diff
changeset
|
1999 |
gnus-use-scoring t |
dc1331cd9729
Set gnus-use-scoring to t.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
819
diff
changeset
|
2000 |
gnus-save-score t |
788
b7b60066599e
Split scoring setting from other.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
787
diff
changeset
|
2001 |
gnus-score-expiry-days 60 |
1039
b87d918d2523
I don't need lowering scores.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1038
diff
changeset
|
2002 |
;; gnus-decay-scores t |
903
6b24df8816ff
Set gnus-score-decay-constant.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
902
diff
changeset
|
2003 |
gnus-score-decay-constant 3 |
788
b7b60066599e
Split scoring setting from other.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
787
diff
changeset
|
2004 |
) |
908 | 2005 |
|
1041
0b70ed39332f
These variables are local to each summary buffer and usually set by the score
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1040
diff
changeset
|
2006 |
(setq gnus-score-interactive-default-score 100) |
0b70ed39332f
These variables are local to each summary buffer and usually set by the score
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1040
diff
changeset
|
2007 |
|
0b70ed39332f
These variables are local to each summary buffer and usually set by the score
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1040
diff
changeset
|
2008 |
;; These variables are local to each summary buffer and usually set by the |
0b70ed39332f
These variables are local to each summary buffer and usually set by the score
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1040
diff
changeset
|
2009 |
;; score file: gnus-summary-mark-below, gnus-summary-expunge-below, gnus-thread-expunge-below |
909
14efc19ada1c
Do not use gnus-score-followup-article if we use gnus-score-followup-thread.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
908
diff
changeset
|
2010 |
|
908 | 2011 |
(setq gnus-use-adaptive-scoring t) |
945
79c13b7327fa
I use 100 for replay to me and 200 for essential mails, and -50 for bad mails.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
944
diff
changeset
|
2012 |
;; I use 100 for replay to me and 200 for essential mails, and -50 for bad mails. |
908 | 2013 |
(setq gnus-default-adaptive-score-alist |
2014 |
'( |
|
2015 |
(gnus-unread-mark) |
|
945
79c13b7327fa
I use 100 for replay to me and 200 for essential mails, and -50 for bad mails.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
944
diff
changeset
|
2016 |
(gnus-ticked-mark (followup 100)) |
79c13b7327fa
I use 100 for replay to me and 200 for essential mails, and -50 for bad mails.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
944
diff
changeset
|
2017 |
(gnus-dormant-mark (followup 100)) |
918
f7a88390ec90
Decrease score only if I delete articles, not when read.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
916
diff
changeset
|
2018 |
;; (gnus-read-mark (followup -50)) |
f7a88390ec90
Decrease score only if I delete articles, not when read.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
916
diff
changeset
|
2019 |
;; (gnus-catchup-mark (subject -50)) |
f7a88390ec90
Decrease score only if I delete articles, not when read.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
916
diff
changeset
|
2020 |
(gnus-del-mark (followup -50)) |
908 | 2021 |
(gnus-killed-mark (followup -50)) |
2022 |
(gnus-kill-file-mark (from -9999)) |
|
945
79c13b7327fa
I use 100 for replay to me and 200 for essential mails, and -50 for bad mails.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
944
diff
changeset
|
2023 |
)) |
908 | 2024 |
|
793
dee9b2482842
Increase the score for followups to a sent article.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
792
diff
changeset
|
2025 |
;; Increase the score for followups to a sent article. |
1254
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
2026 |
(my--eval-after-load gnus-score |
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2027 |
;; (add-hook 'message-sent-hook 'gnus-score-followup-article) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2028 |
(add-hook 'message-sent-hook 'gnus-score-followup-thread)) |
755
6f903d3b2ec7
Adaptive score for GNUS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
754
diff
changeset
|
2029 |
|
1047
a9fcc9b86225
Fix feature name. Limit minimal subject length for exclude...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1046
diff
changeset
|
2030 |
(defvar my-gnus-summary-kill-same-subject-min-len 8 |
a9fcc9b86225
Fix feature name. Limit minimal subject length for exclude...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1046
diff
changeset
|
2031 |
"Minimal length of subject string to ignore this subject.") |
1046
2ca7e7cfa6d9
Add negative scores for all articles with same subject.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1044
diff
changeset
|
2032 |
(defun my-gnus-summary-kill-same-subject (&optional unmark) |
2ca7e7cfa6d9
Add negative scores for all articles with same subject.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1044
diff
changeset
|
2033 |
"Add negative scores for all articles with same subject." |
2ca7e7cfa6d9
Add negative scores for all articles with same subject.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1044
diff
changeset
|
2034 |
(interactive "P") |
2ca7e7cfa6d9
Add negative scores for all articles with same subject.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1044
diff
changeset
|
2035 |
(when (or (not (integerp unmark)) (< 0 unmark)) |
1047
a9fcc9b86225
Fix feature name. Limit minimal subject length for exclude...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1046
diff
changeset
|
2036 |
(let ( (subj (gnus-simplify-subject-fuzzy (gnus-summary-article-subject))) ) |
a9fcc9b86225
Fix feature name. Limit minimal subject length for exclude...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1046
diff
changeset
|
2037 |
(when (<= (length subj) my-gnus-summary-kill-same-subject-min-len) |
a9fcc9b86225
Fix feature name. Limit minimal subject length for exclude...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1046
diff
changeset
|
2038 |
(gnus-summary-score-entry |
a9fcc9b86225
Fix feature name. Limit minimal subject length for exclude...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1046
diff
changeset
|
2039 |
"subject" subj |
a9fcc9b86225
Fix feature name. Limit minimal subject length for exclude...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1046
diff
changeset
|
2040 |
's (- gnus-score-interactive-default-score) (current-time-string))))) |
1046
2ca7e7cfa6d9
Add negative scores for all articles with same subject.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1044
diff
changeset
|
2041 |
(gnus-summary-kill-same-subject unmark)) |
1254
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
2042 |
(my--eval-after-load gnus-sum |
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2043 |
(define-key gnus-summary-mode-map (kbd "C-k") #'my-gnus-summary-kill-same-subject)) |
1046
2ca7e7cfa6d9
Add negative scores for all articles with same subject.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1044
diff
changeset
|
2044 |
|
1118
ece4746ba12e
Mark unmarked articles in current thread as read and move to
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1117
diff
changeset
|
2045 |
(defun my-gnus.mark-thread-as-read () |
ece4746ba12e
Mark unmarked articles in current thread as read and move to
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1117
diff
changeset
|
2046 |
"Mark unmarked articles in current thread as read and move to |
ece4746ba12e
Mark unmarked articles in current thread as read and move to
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1117
diff
changeset
|
2047 |
next thread without selecting article." |
ece4746ba12e
Mark unmarked articles in current thread as read and move to
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1117
diff
changeset
|
2048 |
(interactive) |
ece4746ba12e
Mark unmarked articles in current thread as read and move to
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1117
diff
changeset
|
2049 |
(gnus-summary-top-thread) |
ece4746ba12e
Mark unmarked articles in current thread as read and move to
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1117
diff
changeset
|
2050 |
(catch 'exit |
ece4746ba12e
Mark unmarked articles in current thread as read and move to
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1117
diff
changeset
|
2051 |
(while t |
ece4746ba12e
Mark unmarked articles in current thread as read and move to
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1117
diff
changeset
|
2052 |
(when (eq (gnus-summary-article-mark (gnus-summary-article-number)) gnus-unread-mark) |
ece4746ba12e
Mark unmarked articles in current thread as read and move to
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1117
diff
changeset
|
2053 |
(gnus-summary-mark-article (gnus-summary-article-number) gnus-del-mark)) |
ece4746ba12e
Mark unmarked articles in current thread as read and move to
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1117
diff
changeset
|
2054 |
(when (or (not (gnus-summary-search-forward)) (eq (gnus-summary-thread-level) 0)) |
ece4746ba12e
Mark unmarked articles in current thread as read and move to
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1117
diff
changeset
|
2055 |
(throw 'exit nil)) ))) |
1254
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
2056 |
(my--eval-after-load gnus-sum |
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2057 |
(define-key gnus-summary-mode-map (kbd "H-k") #'my-gnus.mark-thread-as-read)) |
1118
ece4746ba12e
Mark unmarked articles in current thread as read and move to
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1117
diff
changeset
|
2058 |
|
919
fcd73bc6b91c
Own gnus-thread-score-function: If any followup have positive score assign
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
918
diff
changeset
|
2059 |
(defun my-gnus-thread-score-function (&rest scores) |
fcd73bc6b91c
Own gnus-thread-score-function: If any followup have positive score assign
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
918
diff
changeset
|
2060 |
"If any followup have positive score assign greater available |
fcd73bc6b91c
Own gnus-thread-score-function: If any followup have positive score assign
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
918
diff
changeset
|
2061 |
score to thread, else assign lesser available score." |
fcd73bc6b91c
Own gnus-thread-score-function: If any followup have positive score assign
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
918
diff
changeset
|
2062 |
(let ( (max (apply 'max scores)) (min (apply 'min scores)) ) |
fcd73bc6b91c
Own gnus-thread-score-function: If any followup have positive score assign
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
918
diff
changeset
|
2063 |
(if (< 0 max) max min))) |
fcd73bc6b91c
Own gnus-thread-score-function: If any followup have positive score assign
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
918
diff
changeset
|
2064 |
(setq gnus-thread-score-function #'my-gnus-thread-score-function) |
fcd73bc6b91c
Own gnus-thread-score-function: If any followup have positive score assign
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
918
diff
changeset
|
2065 |
(defun my-gnus-thread-total-score () |
fcd73bc6b91c
Own gnus-thread-score-function: If any followup have positive score assign
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
918
diff
changeset
|
2066 |
"Helper to debug `gnus-thread-score-function' function." |
fcd73bc6b91c
Own gnus-thread-score-function: If any followup have positive score assign
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
918
diff
changeset
|
2067 |
(interactive) |
fcd73bc6b91c
Own gnus-thread-score-function: If any followup have positive score assign
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
918
diff
changeset
|
2068 |
(message |
fcd73bc6b91c
Own gnus-thread-score-function: If any followup have positive score assign
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
918
diff
changeset
|
2069 |
(int-to-string |
fcd73bc6b91c
Own gnus-thread-score-function: If any followup have positive score assign
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
918
diff
changeset
|
2070 |
(gnus-thread-total-score |
fcd73bc6b91c
Own gnus-thread-score-function: If any followup have positive score assign
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
918
diff
changeset
|
2071 |
(gnus-id-to-thread (mail-header-id (gnus-summary-article-header))))))) |
fcd73bc6b91c
Own gnus-thread-score-function: If any followup have positive score assign
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
918
diff
changeset
|
2072 |
|
906
da962aa69458
Especially highlight my message and replays to me.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
905
diff
changeset
|
2073 |
;; Especially highlight my message and replays to me. |
1254
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
2074 |
(my--eval-after-load gnus-sum |
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2075 |
(defface my-gnus-own-unread-face nil |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2076 |
"Use this face to display own postings in Summary Buffer") |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2077 |
(copy-face 'gnus-summary-high-unread-face 'my-gnus-own-unread-face) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2078 |
(set-face-background 'my-gnus-own-unread-face "linen") |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2079 |
(add-to-list 'gnus-summary-highlight |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2080 |
'((and (> score 190) (eq mark gnus-unread-mark)) . my-gnus-own-unread-face)) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2081 |
(defface my-gnus-own-ancient-face nil |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2082 |
"Use this face to display own postings in Summary Buffer") |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2083 |
(copy-face 'gnus-summary-high-ancient-face 'my-gnus-own-ancient-face) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2084 |
(set-face-background 'my-gnus-own-ancient-face "linen") |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2085 |
(add-to-list 'gnus-summary-highlight |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2086 |
'((and (> score 190) (eq mark gnus-ancient-mark)) . my-gnus-own-ancient-face)) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2087 |
(defface my-gnus-own-ticked-face nil |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2088 |
"Use this face to display own postings in Summary Buffer") |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2089 |
(copy-face 'gnus-summary-high-ticked-face 'my-gnus-own-ticked-face) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2090 |
(set-face-background 'my-gnus-own-ticked-face "linen") |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2091 |
(add-to-list 'gnus-summary-highlight |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2092 |
'((and (> score 190) (or (eq mark gnus-dormant-mark) (eq mark gnus-ticked-mark))) . my-gnus-own-ticked-face)) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2093 |
(defface my-gnus-fup-face nil |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2094 |
"Use this face to display direct fups to my postings.") |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2095 |
(copy-face 'gnus-summary-high-unread-face 'my-gnus-fup-face) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2096 |
(set-face-background 'my-gnus-fup-face "honeydew") |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2097 |
(add-to-list 'gnus-summary-highlight |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2098 |
'((and (<= 90 score) (<= score 110) (eq mark gnus-unread-mark)) . my-gnus-fup-face)) ) |
906
da962aa69458
Especially highlight my message and replays to me.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
905
diff
changeset
|
2099 |
|
807
63c56a8cf9f1
Remove duplication, move code above.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
806
diff
changeset
|
2100 |
;; (setq gnus-home-score-file |
63c56a8cf9f1
Remove duplication, move code above.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
806
diff
changeset
|
2101 |
;; ;; All groups that match the regexp `"\\.emacs"' |
63c56a8cf9f1
Remove duplication, move code above.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
806
diff
changeset
|
2102 |
;; '(("\\.emacs" "emacs.SCORE") |
63c56a8cf9f1
Remove duplication, move code above.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
806
diff
changeset
|
2103 |
;; ;; All the comp groups in one score file |
63c56a8cf9f1
Remove duplication, move code above.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
806
diff
changeset
|
2104 |
;; ("^comp" "comp.SCORE"))) |
63c56a8cf9f1
Remove duplication, move code above.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
806
diff
changeset
|
2105 |
|
911
ce5cb0a281ee
Make C-Up, C-Down more like across paragraph moving.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
910
diff
changeset
|
2106 |
;; Make C-Up, C-Down more like across paragraph moving. |
1254
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
2107 |
(my--eval-after-load gnus |
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2108 |
(define-key gnus-summary-mode-map [(meta up)] '(lambda() (interactive) (scroll-other-window -1))) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2109 |
(define-key gnus-summary-mode-map [(meta down)] '(lambda() (interactive) (scroll-other-window 1))) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2110 |
(define-key gnus-summary-mode-map [(control down)] 'gnus-summary-next-thread) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2111 |
(define-key gnus-summary-mode-map [(control up)] 'gnus-summary-prev-thread)) |
911
ce5cb0a281ee
Make C-Up, C-Down more like across paragraph moving.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
910
diff
changeset
|
2112 |
|
785
7956c2497dda
gnus-thread-sort-by-date
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
784
diff
changeset
|
2113 |
;; (setq imap-log t) |
7956c2497dda
gnus-thread-sort-by-date
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
784
diff
changeset
|
2114 |
|
660
7abcc3f39fe9
Set basic mail settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
658
diff
changeset
|
2115 |
;; (setq mail-user-agent 'mh-e-user-agent) |
83
d2eaf2ed6d1c
Added basic jabber customization.
gavenkoa@gavenko.bifit.int
parents:
82
diff
changeset
|
2116 |
|
900
85a05f7d8bed
Set gnus-signature-face to grey.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
899
diff
changeset
|
2117 |
(custom-set-faces |
85a05f7d8bed
Set gnus-signature-face to grey.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
899
diff
changeset
|
2118 |
'(gnus-summary-cancelled ((t (:foreground "plum" :background nil)))) |
85a05f7d8bed
Set gnus-signature-face to grey.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
899
diff
changeset
|
2119 |
'(gnus-signature-face ((t (:foreground "grey")))) |
85a05f7d8bed
Set gnus-signature-face to grey.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
899
diff
changeset
|
2120 |
) |
739
65e6b1b497fb
Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
738
diff
changeset
|
2121 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
2122 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
801
feb479e720e1
Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
800
diff
changeset
|
2123 |
(message "bbdb") |
739
65e6b1b497fb
Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
738
diff
changeset
|
2124 |
|
801
feb479e720e1
Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
800
diff
changeset
|
2125 |
(setq |
feb479e720e1
Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
800
diff
changeset
|
2126 |
bbdb-offer-save 1 |
feb479e720e1
Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
800
diff
changeset
|
2127 |
bbdb-use-pop-up t |
feb479e720e1
Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
800
diff
changeset
|
2128 |
bbdb-electric-p t |
feb479e720e1
Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
800
diff
changeset
|
2129 |
bbdb-popup-target-lines 1 |
feb479e720e1
Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
800
diff
changeset
|
2130 |
) |
feb479e720e1
Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
800
diff
changeset
|
2131 |
|
feb479e720e1
Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
800
diff
changeset
|
2132 |
(setq bbdb-complete-name-full-completion t) |
feb479e720e1
Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
800
diff
changeset
|
2133 |
(setq bbdb-completion-type 'primary-or-name) |
feb479e720e1
Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
800
diff
changeset
|
2134 |
(setq bbdb-complete-name-allow-cycling t) |
feb479e720e1
Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
800
diff
changeset
|
2135 |
|
feb479e720e1
Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
800
diff
changeset
|
2136 |
(setq bbdb-file "~/.gnus/bbdb") |
feb479e720e1
Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
800
diff
changeset
|
2137 |
|
feb479e720e1
Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
800
diff
changeset
|
2138 |
;; (bbdb-initialize 'gnus 'message) |
feb479e720e1
Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
800
diff
changeset
|
2139 |
;; (bbdb-insinuate-message) |
feb479e720e1
Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
800
diff
changeset
|
2140 |
;; (add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus) |
feb479e720e1
Basic 'bbdb' settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
800
diff
changeset
|
2141 |
|
739
65e6b1b497fb
Add some GNUS settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
738
diff
changeset
|
2142 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
2143 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
2144 |
(message "jabber") |
83
d2eaf2ed6d1c
Added basic jabber customization.
gavenkoa@gavenko.bifit.int
parents:
82
diff
changeset
|
2145 |
|
1273
738244fdc669
Keep jabber conversation history in 'user-emacs-directory'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1269
diff
changeset
|
2146 |
(setq jabber-history-dir (concat user-emacs-directory ".jabber")) |
738244fdc669
Keep jabber conversation history in 'user-emacs-directory'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1269
diff
changeset
|
2147 |
|
675
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
2148 |
(autoload 'jabber-connect-all "jabber") |
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
2149 |
|
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
2150 |
(setq |
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
2151 |
jabber-history-enabled t |
1116
a34c8bbd5c3a
jabber-history-muc-enabled
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1115
diff
changeset
|
2152 |
jabber-history-muc-enabled t |
675
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
2153 |
jabber-use-global-history nil |
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
2154 |
jabber-backlog-number 40 |
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
2155 |
jabber-backlog-days 30 |
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
2156 |
jabber-alert-presence-message-function (lambda (who oldstatus newstatus statustext) nil) |
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
2157 |
) |
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
2158 |
|
1254
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
2159 |
(my--eval-after-load jabber |
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2160 |
;; Redefine standard binding for sending message form RET to C-RET. |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2161 |
(define-key jabber-chat-mode-map (kbd "RET") 'newline) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2162 |
(define-key jabber-chat-mode-map [C-return] 'jabber-chat-buffer-send) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2163 |
;; fsm used in emacs jabber |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2164 |
(when (featurep 'fsm) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2165 |
(setq fsm-debug nil)) ; Disable *fsm-debug* buffer. |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2166 |
;; Handle Emacs exit. |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2167 |
(add-hook 'kill-emacs-hook 'jabber-disconnect)) |
83
d2eaf2ed6d1c
Added basic jabber customization.
gavenkoa@gavenko.bifit.int
parents:
82
diff
changeset
|
2168 |
|
214
f4234e15d891
Fix prompt format (prompt and text stay on two line, not one).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
211
diff
changeset
|
2169 |
(setq my-chat-prompt "[%t] %n>\n") |
675
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
2170 |
(setq |
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
2171 |
jabber-chat-foreign-prompt-format my-chat-prompt |
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
2172 |
jabber-chat-local-prompt-format my-chat-prompt |
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
2173 |
jabber-groupchat-prompt-format my-chat-prompt |
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2174 |
jabber-muc-private-foreign-prompt-format "[%t] %g/%n>\n") |
214
f4234e15d891
Fix prompt format (prompt and text stay on two line, not one).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
211
diff
changeset
|
2175 |
|
675
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
2176 |
(let ( (mgs-list '("Я тутачки, а где Вы меня ожидали?" |
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
2177 |
"Software Development == Church Development. Step 1. Build it. Step 2. Pray." |
680 | 2178 |
"Great books aren't written – they're rewritten." |
675
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
2179 |
"А любит Б, Б любит С, что делать A? Найти другую Б!")) ) |
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
2180 |
(random t) |
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
2181 |
(setq jabber-default-show (nth (random (length mgs-list)) mgs-list)) |
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
2182 |
(setq jabber-default-status (nth (random (length mgs-list)) mgs-list)) |
182
8a8bf4f3e7c2
Correctly set fsm var.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
181
diff
changeset
|
2183 |
) |
83
d2eaf2ed6d1c
Added basic jabber customization.
gavenkoa@gavenko.bifit.int
parents:
82
diff
changeset
|
2184 |
|
516
efa00a6ef34e
Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
515
diff
changeset
|
2185 |
(defvar my-jabber-users nil |
533
15b63e0cc424
Document some settings from .emacs-pre/-post.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
532
diff
changeset
|
2186 |
"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
|
2187 |
|
efa00a6ef34e
Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
515
diff
changeset
|
2188 |
(defun my-jabber-send (group) |
efa00a6ef34e
Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
515
diff
changeset
|
2189 |
"GROUP is keys from `my-jabber-users'" |
efa00a6ef34e
Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
515
diff
changeset
|
2190 |
(interactive |
efa00a6ef34e
Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
515
diff
changeset
|
2191 |
(list (completing-read "Select group: " my-jabber-users)) |
efa00a6ef34e
Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
515
diff
changeset
|
2192 |
) |
efa00a6ef34e
Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
515
diff
changeset
|
2193 |
(let ( |
efa00a6ef34e
Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
515
diff
changeset
|
2194 |
(msg (if (use-region-p) |
efa00a6ef34e
Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
515
diff
changeset
|
2195 |
(buffer-substring (region-beginning) (region-end)) |
efa00a6ef34e
Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
515
diff
changeset
|
2196 |
(buffer-string))) |
efa00a6ef34e
Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
515
diff
changeset
|
2197 |
(jc (jabber-read-account)) |
efa00a6ef34e
Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
515
diff
changeset
|
2198 |
) |
efa00a6ef34e
Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
515
diff
changeset
|
2199 |
(deactivate-mark) |
efa00a6ef34e
Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
515
diff
changeset
|
2200 |
(mapc |
efa00a6ef34e
Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
515
diff
changeset
|
2201 |
(lambda (user) |
efa00a6ef34e
Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
515
diff
changeset
|
2202 |
(jabber-send-message jc user "" msg "normal") |
efa00a6ef34e
Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
515
diff
changeset
|
2203 |
) |
efa00a6ef34e
Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
515
diff
changeset
|
2204 |
(cdr (assoc group my-jabber-users)) |
efa00a6ef34e
Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
515
diff
changeset
|
2205 |
) |
efa00a6ef34e
Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
515
diff
changeset
|
2206 |
) |
efa00a6ef34e
Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
515
diff
changeset
|
2207 |
) |
efa00a6ef34e
Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
515
diff
changeset
|
2208 |
|
efa00a6ef34e
Allow send message to multiply users.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
515
diff
changeset
|
2209 |
(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
|
2210 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
2211 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
2212 |
(message "rcirc") |
142
adfc0c678483
Basic customisation for rcirc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
141
diff
changeset
|
2213 |
|
adfc0c678483
Basic customisation for rcirc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
141
diff
changeset
|
2214 |
;; Turn on logging everything to a special buffer, for debugging. |
adfc0c678483
Basic customisation for rcirc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
141
diff
changeset
|
2215 |
;; (setq rcirc-debug-flag t) |
adfc0c678483
Basic customisation for rcirc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
141
diff
changeset
|
2216 |
|
adfc0c678483
Basic customisation for rcirc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
141
diff
changeset
|
2217 |
(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
|
2218 |
(setq rcirc-time-format "%H:%M ") |
adfc0c678483
Basic customisation for rcirc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
141
diff
changeset
|
2219 |
(defun rcirc-handler-301 (process cmd sender args) |
adfc0c678483
Basic customisation for rcirc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
141
diff
changeset
|
2220 |
"/away message handler.") |
adfc0c678483
Basic customisation for rcirc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
141
diff
changeset
|
2221 |
|
532
a77d1bbd676c
Set conection/login info for rcirc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
531
diff
changeset
|
2222 |
(setq rcirc-default-server "irc.freenode.net") |
a77d1bbd676c
Set conection/login info for rcirc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
531
diff
changeset
|
2223 |
(setq rcirc-default-port 6667) |
a77d1bbd676c
Set conection/login info for rcirc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
531
diff
changeset
|
2224 |
(setq rcirc-default-nick user-nick) |
a77d1bbd676c
Set conection/login info for rcirc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
531
diff
changeset
|
2225 |
(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
|
2226 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
2227 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
2228 |
(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
|
2229 |
|
639 | 2230 |
;; (add-to-list 'erc-modules 'notify) |
2231 |
;; (setq erc-notify-list '("")) |
|
2232 |
||
377
3e8792ee03cc
Take off noise message from erc in notify.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
376
diff
changeset
|
2233 |
;; Take off noise message. |
3e8792ee03cc
Take off noise message from erc in notify.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
376
diff
changeset
|
2234 |
(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
|
2235 |
|
3e8792ee03cc
Take off noise message from erc in notify.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
376
diff
changeset
|
2236 |
(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
|
2237 |
(setq erc-track-use-faces t) |
3e8792ee03cc
Take off noise message from erc in notify.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
376
diff
changeset
|
2238 |
|
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
|
2239 |
(setq erc-server-coding-system 'utf-8) |
877
b4412d7ff8a1
Set encoding for '#debian-russian'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
876
diff
changeset
|
2240 |
(setq erc-encoding-coding-alist |
b4412d7ff8a1
Set encoding for '#debian-russian'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
876
diff
changeset
|
2241 |
'( |
b4412d7ff8a1
Set encoding for '#debian-russian'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
876
diff
changeset
|
2242 |
("^icq-" . cp1251) |
b4412d7ff8a1
Set encoding for '#debian-russian'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
876
diff
changeset
|
2243 |
("#debian-russian" . koi8-r) |
b4412d7ff8a1
Set encoding for '#debian-russian'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
876
diff
changeset
|
2244 |
)) |
634
97785d982806
erc-encoding-coding-alist, erc-autojoin-channels-alist
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
632
diff
changeset
|
2245 |
|
942
b08e5d2da63f
Disable erc-autojoin-channels.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
941
diff
changeset
|
2246 |
;; (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
|
2247 |
|
637
f4806bc22860
Enable reconnect facility for ERC.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
636
diff
changeset
|
2248 |
(setq |
f4806bc22860
Enable reconnect facility for ERC.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
636
diff
changeset
|
2249 |
erc-server-auto-reconnect t |
f4806bc22860
Enable reconnect facility for ERC.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
636
diff
changeset
|
2250 |
erc-server-reconnect-timeout 60 |
1193 | 2251 |
erc-server-reconnect-attempts 2) |
2252 |
||
2253 |
(setq |
|
1253
504c216e8d21
Move '.recentf' and '~/.irc' to '~/.emacs.d'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1240
diff
changeset
|
2254 |
erc-log-channels-directory "~/.emacs.d/.irc" |
1193 | 2255 |
erc-log-file-coding-system 'utf-8-unix) |
1254
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
2256 |
(my--eval-after-load erc |
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2257 |
(require 'erc-log) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2258 |
(mkdir erc-log-channels-directory t)) |
637
f4806bc22860
Enable reconnect facility for ERC.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
636
diff
changeset
|
2259 |
|
636
1c47e3a86feb
Add commented settings for remember.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
635
diff
changeset
|
2260 |
;; Kill buffers for channels after /part |
1c47e3a86feb
Add commented settings for remember.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
635
diff
changeset
|
2261 |
;; (setq erc-kill-buffer-on-part t) |
1c47e3a86feb
Add commented settings for remember.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
635
diff
changeset
|
2262 |
;; Kill buffers for private queries after quitting the server |
1c47e3a86feb
Add commented settings for remember.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
635
diff
changeset
|
2263 |
;; (setq erc-kill-queries-on-quit t) |
1c47e3a86feb
Add commented settings for remember.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
635
diff
changeset
|
2264 |
;; Kill buffers for server messages after quitting the server |
1c47e3a86feb
Add commented settings for remember.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
635
diff
changeset
|
2265 |
;; (setq erc-kill-server-buffer-on-quit t) |
1c47e3a86feb
Add commented settings for remember.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
635
diff
changeset
|
2266 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
2267 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
974 | 2268 |
(message "devel, programming") |
2269 |
||
2270 |
(which-func-mode 1) |
|
2271 |
||
2272 |
(add-to-list 'auto-mode-alist '("\\.cu$" . c-mode)) |
|
2273 |
||
1306
b78bf2c141ab
Use consistent style for internal names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1305
diff
changeset
|
2274 |
(defun my--c++-header-file-p () |
974 | 2275 |
"Return non-nil, if in a C++ header." |
2276 |
(and (string-match "\\.h$" |
|
2277 |
(or (buffer-file-name) |
|
2278 |
(buffer-name))) |
|
2279 |
(save-excursion |
|
2280 |
(re-search-forward "\\_<class\\_>" nil t)))) |
|
2281 |
||
2282 |
(when (>= emacs-major-version 22) |
|
1306
b78bf2c141ab
Use consistent style for internal names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1305
diff
changeset
|
2283 |
(add-to-list 'magic-mode-alist '(my--c++-header-file-p . c++-mode)) |
974 | 2284 |
) |
2285 |
||
2286 |
(setq-default comment-style (quote indent)) |
|
2287 |
(setq-default comment-column 44) |
|
2288 |
(setq-default comment-fill-column my-fill-column) |
|
2289 |
||
2290 |
(mapc (lambda (hook) (add-hook hook (lambda () (setq fill-column my-fill-column)) )) |
|
2291 |
(append my-devel-mode-hook-list my-text-mode-hook-list)) |
|
2292 |
||
1240
b086f9c8a4db
Fix: hs-minor-mode doesn't support fundamental-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1234
diff
changeset
|
2293 |
(mapc (lambda (mode) (add-hook (my-mode2hook mode) #'hs-minor-mode)) |
b086f9c8a4db
Fix: hs-minor-mode doesn't support fundamental-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1234
diff
changeset
|
2294 |
'(c-mode c++-mode java-mode js-mode lisp-mode emacs-lisp-mode)) |
1234 | 2295 |
|
974 | 2296 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2297 |
(message "diff, patch, ediff, emerge") |
|
2298 |
||
2299 |
(setq diff-switches "-u") |
|
2300 |
||
2301 |
(setq ediff-diff-options "") |
|
2302 |
(setq ediff-custom-diff-options "-u") |
|
2303 |
(setq ediff-window-setup-function 'ediff-setup-windows-plain) |
|
2304 |
(setq ediff-split-window-function 'split-window-vertically) |
|
2305 |
||
992
8523f94a9aa9
Disable: sometimes it take a long time to process large hunks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
991
diff
changeset
|
2306 |
;; Disable: sometimes it take a long time to process large hunks. |
8523f94a9aa9
Disable: sometimes it take a long time to process large hunks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
991
diff
changeset
|
2307 |
;; Use C-c C-b on hunk by own. |
8523f94a9aa9
Disable: sometimes it take a long time to process large hunks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
991
diff
changeset
|
2308 |
;; (defun my-diff-auto-refine-mode-on () (diff-auto-refine-mode 1)) |
8523f94a9aa9
Disable: sometimes it take a long time to process large hunks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
991
diff
changeset
|
2309 |
;; (add-hook 'diff-mode-hook 'my-diff-auto-refine-mode-on) |
976
9378739883bb
Enable diff-auto-refine-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
975
diff
changeset
|
2310 |
|
974 | 2311 |
(when window-system |
1254
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
2312 |
(my--eval-after-load diff-mode |
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2313 |
(set-face-foreground 'diff-added-face "DarkGreen") |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2314 |
(set-face-foreground 'diff-removed-face "DarkRed") |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2315 |
(set-face-background 'diff-refine-change "LightBlue1"))) |
974 | 2316 |
|
2317 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
648
6486ccef8fd1
`-b' switch to ignore changes in whitespaces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
647
diff
changeset
|
2318 |
(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
|
2319 |
|
6486ccef8fd1
`-b' switch to ignore changes in whitespaces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
647
diff
changeset
|
2320 |
;; `-b' switch to ignore changes in whitespaces. |
6486ccef8fd1
`-b' switch to ignore changes in whitespaces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
647
diff
changeset
|
2321 |
;; (setq vc-git-diff-switches "-b") |
6486ccef8fd1
`-b' switch to ignore changes in whitespaces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
647
diff
changeset
|
2322 |
;; (setq vc-diff-switches "-b") |
0 | 2323 |
|
1162
aadda3d1653c
For Hg with C-u show latest MQ patch and with C-u C-u show MQ patch and local
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1158
diff
changeset
|
2324 |
(defun my-vc-root-diff (prefix) |
aadda3d1653c
For Hg with C-u show latest MQ patch and with C-u C-u show MQ patch and local
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1158
diff
changeset
|
2325 |
"Same as `vc-root-diff' but for Hg with C-u show latest MQ patch and |
aadda3d1653c
For Hg with C-u show latest MQ patch and with C-u C-u show MQ patch and local
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1158
diff
changeset
|
2326 |
with C-u C-u show MQ patch and local changes." |
aadda3d1653c
For Hg with C-u show latest MQ patch and with C-u C-u show MQ patch and local
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1158
diff
changeset
|
2327 |
(interactive "P") |
1163
e7728b2522b2
Handle HG MQ from non-root directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1162
diff
changeset
|
2328 |
(when (eq 'non-hg-mq |
e7728b2522b2
Handle HG MQ from non-root directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1162
diff
changeset
|
2329 |
(catch 'break |
e7728b2522b2
Handle HG MQ from non-root directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1162
diff
changeset
|
2330 |
(unless (and prefix (eq (vc-deduce-backend) 'Hg)) |
e7728b2522b2
Handle HG MQ from non-root directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1162
diff
changeset
|
2331 |
(throw 'break 'non-hg-mq)) |
e7728b2522b2
Handle HG MQ from non-root directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1162
diff
changeset
|
2332 |
(let* ( (rootdir (vc-call-backend 'Hg 'root default-directory)) (default-directory rootdir) ) |
e7728b2522b2
Handle HG MQ from non-root directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1162
diff
changeset
|
2333 |
(unless (eq (vc-hg-command nil t rootdir "log" "-r" "qtip") 0) |
e7728b2522b2
Handle HG MQ from non-root directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1162
diff
changeset
|
2334 |
(throw 'break 'non-hg-mq)) |
e7728b2522b2
Handle HG MQ from non-root directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1162
diff
changeset
|
2335 |
(cond |
e7728b2522b2
Handle HG MQ from non-root directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1162
diff
changeset
|
2336 |
((equal prefix '(4)) |
e7728b2522b2
Handle HG MQ from non-root directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1162
diff
changeset
|
2337 |
(vc-diff-internal t (list 'Hg (list rootdir)) "qparent" "qtip")) |
e7728b2522b2
Handle HG MQ from non-root directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1162
diff
changeset
|
2338 |
((equal prefix '(16)) |
e7728b2522b2
Handle HG MQ from non-root directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1162
diff
changeset
|
2339 |
(vc-diff-internal t (list 'Hg (list rootdir)) "qparent" nil)) )))) |
e7728b2522b2
Handle HG MQ from non-root directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1162
diff
changeset
|
2340 |
(call-interactively 'vc-root-diff nil) )) |
1162
aadda3d1653c
For Hg with C-u show latest MQ patch and with C-u C-u show MQ patch and local
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1158
diff
changeset
|
2341 |
|
aadda3d1653c
For Hg with C-u show latest MQ patch and with C-u C-u show MQ patch and local
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1158
diff
changeset
|
2342 |
(global-set-key (kbd "C-x v D") 'my-vc-root-diff) |
aadda3d1653c
For Hg with C-u show latest MQ patch and with C-u C-u show MQ patch and local
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1158
diff
changeset
|
2343 |
|
615
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
2344 |
(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
|
2345 |
(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
|
2346 |
(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
|
2347 |
(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
|
2348 |
) |
0 | 2349 |
|
615
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
2350 |
(when window-system |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
2351 |
(setq |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
2352 |
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
|
2353 |
vc-annotate-background "white" |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
2354 |
vc-annotate-color-map |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
2355 |
'( |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
2356 |
(20 . "#EE0000") |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
2357 |
(40 . "#E0800D") |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
2358 |
(60 . "#D3001A") |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
2359 |
(80 . "#C68027") |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
2360 |
(100 . "#B90034") |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
2361 |
(120 . "#AB8042") |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
2362 |
(140 . "#9E004F") |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
2363 |
(160 . "#91805C") |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
2364 |
(180 . "#840069") |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
2365 |
(200 . "#778077") |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
2366 |
(220 . "#690084") |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
2367 |
(240 . "#5C8091") |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
2368 |
(260 . "#4F009E") |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
2369 |
(280 . "#4280AB") |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
2370 |
(300 . "#3400B9") |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
2371 |
(320 . "#2780C6") |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
2372 |
(340 . "#1A00D3") |
22cf0c9014d9
Replace '(if COND (progn BODY...))' by '(when COND BODY...)'. Remove
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
614
diff
changeset
|
2373 |
(360 . "#0D80E0"))) |
19
a8e7a6e94341
Теперь белый фон для annotated.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
18
diff
changeset
|
2374 |
) |
a8e7a6e94341
Теперь белый фон для annotated.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
18
diff
changeset
|
2375 |
|
767
47c2dbdb69dd
Set fill-column for "Log-Edit" buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
766
diff
changeset
|
2376 |
(defun my-log-edit-mode-hook () |
47c2dbdb69dd
Set fill-column for "Log-Edit" buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
766
diff
changeset
|
2377 |
(setq fill-column 78) |
47c2dbdb69dd
Set fill-column for "Log-Edit" buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
766
diff
changeset
|
2378 |
) |
47c2dbdb69dd
Set fill-column for "Log-Edit" buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
766
diff
changeset
|
2379 |
(add-hook 'log-edit-mode-hook 'my-log-edit-mode-hook t) |
47c2dbdb69dd
Set fill-column for "Log-Edit" buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
766
diff
changeset
|
2380 |
|
1356
850b597650f6
Remove those nasty "Summary: " from commit messages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1355
diff
changeset
|
2381 |
(eval-after-load 'log-edit |
850b597650f6
Remove those nasty "Summary: " from commit messages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1355
diff
changeset
|
2382 |
'(remove-hook 'log-edit-hook 'log-edit-insert-message-template)) |
850b597650f6
Remove those nasty "Summary: " from commit messages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1355
diff
changeset
|
2383 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
2384 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
2385 |
(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
|
2386 |
|
197
2abcea5b91db
Added settings for psvn.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
192
diff
changeset
|
2387 |
(setq svn-status-verbose t) |
2abcea5b91db
Added settings for psvn.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
192
diff
changeset
|
2388 |
(setq svn-status-hide-unmodified t) |
2abcea5b91db
Added settings for psvn.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
192
diff
changeset
|
2389 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
2390 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
2391 |
(message "DVC") |
91 | 2392 |
|
2393 |
(when (featurep 'dvc-emacs) |
|
2394 |
(setq dvc-tips-enabled nil) |
|
2395 |
) |
|
2396 |
||
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
2397 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
2398 |
(message "indenting") |
0 | 2399 |
|
2400 |
(setq standard-indent 4) |
|
2401 |
(setq c-basic-offset 4) |
|
22
8ca8997d9f1d
Определил размер отступа для sh-mode.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
21
diff
changeset
|
2402 |
(setq sh-basic-offset 2) |
0 | 2403 |
(setq sgml-basic-offset 4) |
2404 |
||
1181
64523c0fddb0
Disable electric-indent-mode new in v24.4.1.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1180
diff
changeset
|
2405 |
(when (fboundp 'electric-indent-mode) |
64523c0fddb0
Disable electric-indent-mode new in v24.4.1.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1180
diff
changeset
|
2406 |
(electric-indent-mode -1)) |
64523c0fddb0
Disable electric-indent-mode new in v24.4.1.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1180
diff
changeset
|
2407 |
|
0 | 2408 |
;; TAB (tab settings) |
2409 |
(setq-default tab-width 4) |
|
253
7cb6ff8a9a75
Translate comment to English.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
252
diff
changeset
|
2410 |
(setq-default indent-tabs-mode nil) ; spaces instead of tabs by default |
0 | 2411 |
(setq tab-always-indent t) |
2412 |
(setq c-tab-always-indent t) |
|
188
e36736f245fd
Start tab-stop-list with zero.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
162
diff
changeset
|
2413 |
(let ( (line-width 400) i ) |
e36736f245fd
Start tab-stop-list with zero.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
162
diff
changeset
|
2414 |
(setq i (* (ceiling line-width 4) 4)) |
73
73e42aa11b3c
Correct initial asigned with nil.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
72
diff
changeset
|
2415 |
(setq tab-stop-list nil) |
188
e36736f245fd
Start tab-stop-list with zero.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
162
diff
changeset
|
2416 |
(while (>= i 0) |
e36736f245fd
Start tab-stop-list with zero.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
162
diff
changeset
|
2417 |
(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
|
2418 |
(setq i (- i 4)))) |
0 | 2419 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
2420 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
2421 |
(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
|
2422 |
|
647 | 2423 |
;; Prompt for compilation command. |
2424 |
(setq compilation-read-command 1) |
|
638
5bfd6f2d1ae7
Use gmake on FreeBSD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
637
diff
changeset
|
2425 |
(setq compile-auto-highlight t) |
894
d993e3e910ef
Make 'mymake' as default compile command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
893
diff
changeset
|
2426 |
(setq compile-command "mymake ") |
638
5bfd6f2d1ae7
Use gmake on FreeBSD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
637
diff
changeset
|
2427 |
(when (eq system-type 'berkeley-unix) |
5bfd6f2d1ae7
Use gmake on FreeBSD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
637
diff
changeset
|
2428 |
(setq compile-command "gmake ")) |
646 | 2429 |
;; With '1' compilation window shall scroll down, with `first-error' stops scrolling at the first error. |
0 | 2430 |
(setq compilation-scroll-output 1) |
684
f0604e71f261
compilation-ask-about-save
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
683
diff
changeset
|
2431 |
(setq compilation-ask-about-save t) |
0 | 2432 |
|
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
|
2433 |
;; Show error in EN locale to easy search how fix problem in docs and Internet. |
1276
04e9ed4d22a1
LANG=C damage localised output.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1273
diff
changeset
|
2434 |
;; (setq compilation-environment '("LANG=C")) |
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
|
2435 |
|
1254
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
2436 |
(my--eval-after-load compile |
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2437 |
;; My funny error messages. |
1367
4b9e39b257f0
Use named compilation-error-regexp.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1366
diff
changeset
|
2438 |
(add-to-list 'compilation-error-regexp-alist-alist '(nant "^\\( +\\[csc\\] \\|\\)\\(.*\\)(\\([0-9]*\\),\\([0-9]*\\)):" 2 3 4)) |
4b9e39b257f0
Use named compilation-error-regexp.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1366
diff
changeset
|
2439 |
(add-to-list 'compilation-error-regexp-alist 'nant) |
4b9e39b257f0
Use named compilation-error-regexp.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1366
diff
changeset
|
2440 |
(add-to-list 'compilation-error-regexp-alist-alist '(msvc "^ *\\(.*\\)(\\([0-9]*\\)) +:" 1 2)) |
4b9e39b257f0
Use named compilation-error-regexp.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1366
diff
changeset
|
2441 |
(add-to-list 'compilation-error-regexp-alist 'msvc) |
4b9e39b257f0
Use named compilation-error-regexp.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1366
diff
changeset
|
2442 |
(add-to-list 'compilation-error-regexp-alist-alist '(keil "^\"?\\([^\"]*\\)\"?,\\([0-9]*\\) .*\\[.*\\]: " 1 2)) |
4b9e39b257f0
Use named compilation-error-regexp.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1366
diff
changeset
|
2443 |
(add-to-list 'compilation-error-regexp-alist 'keil) |
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2444 |
(add-to-list 'compilation-error-regexp-alist-alist '(maven "\\[ERROR\\] \\(.*\\.java\\):\\[\\([0-9]+\\),\\([0-9]+\\)\\]" 1 2 3)) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2445 |
(add-to-list 'compilation-error-regexp-alist 'maven) |
1343
059cd8b7e3b3
Regex to parse asciidoc errors.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1342
diff
changeset
|
2446 |
(add-to-list 'compilation-error-regexp-alist-alist '(asciidoc "^asciidoc: \\(?:ERROR\\|WARNING\\): \\([^\n:]+\\): line \\([0-9]+\\):" 1 2)) |
059cd8b7e3b3
Regex to parse asciidoc errors.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1342
diff
changeset
|
2447 |
(add-to-list 'compilation-error-regexp-alist 'asciidoc) |
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2448 |
(when (boundp 'compilation-mode-font-lock-keywords) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2449 |
(add-to-list 'compilation-mode-font-lock-keywords '("\\(/[Oo][Uu][Tt]:[^[:blank:]]+\\)" . 1)) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2450 |
(add-to-list 'compilation-mode-font-lock-keywords '("[[:blank:]]\\(/F[oe][^[:blank:]]+\\)" . 1)))) |
0 | 2451 |
|
1098
ac3d34a14b99
Colorize ANSI colour sequences in compilation buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1097
diff
changeset
|
2452 |
(ignore-errors |
ac3d34a14b99
Colorize ANSI colour sequences in compilation buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1097
diff
changeset
|
2453 |
(require 'ansi-color) |
ac3d34a14b99
Colorize ANSI colour sequences in compilation buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1097
diff
changeset
|
2454 |
(defun my-colorize-compilation-buffer () |
ac3d34a14b99
Colorize ANSI colour sequences in compilation buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1097
diff
changeset
|
2455 |
(when (eq major-mode 'compilation-mode) |
ac3d34a14b99
Colorize ANSI colour sequences in compilation buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1097
diff
changeset
|
2456 |
(ansi-color-apply-on-region compilation-filter-start (point-max)))) |
ac3d34a14b99
Colorize ANSI colour sequences in compilation buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1097
diff
changeset
|
2457 |
(add-hook 'compilation-filter-hook 'my-colorize-compilation-buffer)) |
ac3d34a14b99
Colorize ANSI colour sequences in compilation buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1097
diff
changeset
|
2458 |
|
672
ec015b06e121
my-comint-send-string
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
670
diff
changeset
|
2459 |
(defvar my-comint-send-hist-list nil |
ec015b06e121
my-comint-send-string
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
670
diff
changeset
|
2460 |
"History list for `my-comint-send-string'." |
ec015b06e121
my-comint-send-string
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
670
diff
changeset
|
2461 |
) |
ec015b06e121
my-comint-send-string
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
670
diff
changeset
|
2462 |
(defun my-comint-send-string (string) |
704
474a9291a602
Automaticaly append final newline.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
703
diff
changeset
|
2463 |
"Send string to comint buffers. Useful for *compilation* read-only buffer. |
474a9291a602
Automaticaly append final newline.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
703
diff
changeset
|
2464 |
Automaticaly append final newline." |
672
ec015b06e121
my-comint-send-string
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
670
diff
changeset
|
2465 |
(interactive |
1366
f9989b9060aa
Fix: Warning: `read-input' is an obsolete function (as of 22.1); use `read-string' instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1365
diff
changeset
|
2466 |
(list (read-string "Type string: " nil 'my-comint-send-hist-list)) |
672
ec015b06e121
my-comint-send-string
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
670
diff
changeset
|
2467 |
) |
704
474a9291a602
Automaticaly append final newline.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
703
diff
changeset
|
2468 |
(comint-send-string (get-buffer-process (current-buffer)) (concat string "\n")) |
672
ec015b06e121
my-comint-send-string
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
670
diff
changeset
|
2469 |
) |
1254
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
2470 |
(my--eval-after-load compile |
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2471 |
(define-key compilation-mode-map [C-return] 'my-comint-send-string)) |
672
ec015b06e121
my-comint-send-string
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
670
diff
changeset
|
2472 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
2473 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
951 | 2474 |
(message "scons") |
2475 |
||
2476 |
(add-to-list 'auto-mode-alist '("SConstruct\\'" . python-mode)) |
|
2477 |
(add-to-list 'auto-mode-alist '("SConscript\\'" . python-mode)) |
|
2478 |
||
2479 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
1100
df3489a212a9
Show sources along with debugger.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1099
diff
changeset
|
2480 |
(message "gdb, gud") |
df3489a212a9
Show sources along with debugger.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1099
diff
changeset
|
2481 |
;; Use C-x SPACE to set breakpoint in source file. |
df3489a212a9
Show sources along with debugger.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1099
diff
changeset
|
2482 |
|
df3489a212a9
Show sources along with debugger.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1099
diff
changeset
|
2483 |
(setq gdb-show-main t) ; See also (gdb-many-windows) |
df3489a212a9
Show sources along with debugger.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1099
diff
changeset
|
2484 |
|
df3489a212a9
Show sources along with debugger.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1099
diff
changeset
|
2485 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1220
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
2486 |
(message "completion, abbrev") |
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
2487 |
|
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
2488 |
(setq completion-ignore-case t) |
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
2489 |
|
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
2490 |
(setq abbrev-file-name (concat user-emacs-directory ".abbrev")) |
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
2491 |
;; (quietly-read-abbrev-file) |
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
2492 |
;; (setq default-abbrev-mode t) |
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
2493 |
;; (setq save-abbrevs t) |
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
2494 |
|
1229 | 2495 |
(global-set-key (kbd "M-/") 'hippie-expand) |
1220
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
2496 |
|
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
2497 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
2498 |
(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
|
2499 |
|
529
1d38dfff2664
Add 'etags-select' and 'etags-table' customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
528
diff
changeset
|
2500 |
;; 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
|
2501 |
;; use. |
1d38dfff2664
Add 'etags-select' and 'etags-table' customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
528
diff
changeset
|
2502 |
|
675
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
2503 |
(ignore-errors |
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
2504 |
(require 'etags-table) |
529
1d38dfff2664
Add 'etags-select' and 'etags-table' customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
528
diff
changeset
|
2505 |
(setq etags-table-search-up-depth 8) |
675
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
2506 |
(require 'etags-select) |
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
2507 |
(global-set-key "\M-." 'etags-select-find-tag) |
421
44d516f2badd
Enable automatic depth up search for TAGS file when 'etags-table' available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
420
diff
changeset
|
2508 |
) |
44d516f2badd
Enable automatic depth up search for TAGS file when 'etags-table' available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
420
diff
changeset
|
2509 |
|
675
7bef62461084
Try enable modes to avoid do this explicitly in '.emacs-pre'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
674
diff
changeset
|
2510 |
(setq tags-add-tables t) |
1194
14d42e7c9224
my-complete-tag with my-ido-complete-tag.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1193
diff
changeset
|
2511 |
|
14d42e7c9224
my-complete-tag with my-ido-complete-tag.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1193
diff
changeset
|
2512 |
(defvar my-ido-tag-history nil |
14d42e7c9224
my-complete-tag with my-ido-complete-tag.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1193
diff
changeset
|
2513 |
"History of tags selected using `my-ido-complete-tag'.") |
14d42e7c9224
my-complete-tag with my-ido-complete-tag.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1193
diff
changeset
|
2514 |
(defun my-ido-complete-tag (&optional substr) |
14d42e7c9224
my-complete-tag with my-ido-complete-tag.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1193
diff
changeset
|
2515 |
"Find a tag using ido." |
14d42e7c9224
my-complete-tag with my-ido-complete-tag.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1193
diff
changeset
|
2516 |
(tags-completion-table) |
14d42e7c9224
my-complete-tag with my-ido-complete-tag.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1193
diff
changeset
|
2517 |
(let ( tag-names ) |
14d42e7c9224
my-complete-tag with my-ido-complete-tag.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1193
diff
changeset
|
2518 |
(mapatoms (lambda (x) (push (symbol-name x) tag-names)) tags-completion-table) |
14d42e7c9224
my-complete-tag with my-ido-complete-tag.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1193
diff
changeset
|
2519 |
(ido-completing-read "Tag: " tag-names nil t substr 'my-ido-tag-history))) |
14d42e7c9224
my-complete-tag with my-ido-complete-tag.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1193
diff
changeset
|
2520 |
(defun my-complete-tag (prefix point) |
14d42e7c9224
my-complete-tag with my-ido-complete-tag.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1193
diff
changeset
|
2521 |
(interactive "P\nd") |
14d42e7c9224
my-complete-tag with my-ido-complete-tag.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1193
diff
changeset
|
2522 |
(if prefix |
14d42e7c9224
my-complete-tag with my-ido-complete-tag.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1193
diff
changeset
|
2523 |
(funcall #'complete-tag) |
14d42e7c9224
my-complete-tag with my-ido-complete-tag.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1193
diff
changeset
|
2524 |
(let ( (bounds (find-tag-default-bounds)) tag ) |
14d42e7c9224
my-complete-tag with my-ido-complete-tag.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1193
diff
changeset
|
2525 |
(if (or (not bounds) (< point (car bounds)) (< (cdr bounds) point)) |
14d42e7c9224
my-complete-tag with my-ido-complete-tag.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1193
diff
changeset
|
2526 |
(setq tag (my-ido-complete-tag)) |
14d42e7c9224
my-complete-tag with my-ido-complete-tag.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1193
diff
changeset
|
2527 |
(setq tag (my-ido-complete-tag (buffer-substring (car bounds) (cdr bounds)))) |
14d42e7c9224
my-complete-tag with my-ido-complete-tag.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1193
diff
changeset
|
2528 |
(delete-region (car bounds) (cdr bounds))) |
14d42e7c9224
my-complete-tag with my-ido-complete-tag.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1193
diff
changeset
|
2529 |
(insert tag)))) |
14d42e7c9224
my-complete-tag with my-ido-complete-tag.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1193
diff
changeset
|
2530 |
|
14d42e7c9224
my-complete-tag with my-ido-complete-tag.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1193
diff
changeset
|
2531 |
(global-set-key [M-return] #'my-complete-tag) |
541
3d913b8531f4
Bound 'complete-tag' to M-RET.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
539
diff
changeset
|
2532 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
2533 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1021 | 2534 |
(message "CEDET, semantic, SRecord") |
422
021017e52754
Enable 'semantic' for Emacs 23.2.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
421
diff
changeset
|
2535 |
|
425
b835c68d20a8
Added more semantic customisation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
424
diff
changeset
|
2536 |
;; 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
|
2537 |
|
1256
39879e285b7a
Fix: "load: Symbol's value as variable is void: c-mode" for 'setq-mode-local'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1255
diff
changeset
|
2538 |
(eval-and-compile |
39879e285b7a
Fix: "load: Symbol's value as variable is void: c-mode" for 'setq-mode-local'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1255
diff
changeset
|
2539 |
(when (or |
39879e285b7a
Fix: "load: Symbol's value as variable is void: c-mode" for 'setq-mode-local'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1255
diff
changeset
|
2540 |
(and (= emacs-major-version 23) (>= emacs-minor-version 2)) |
39879e285b7a
Fix: "load: Symbol's value as variable is void: c-mode" for 'setq-mode-local'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1255
diff
changeset
|
2541 |
(>= emacs-major-version 24) ) |
39879e285b7a
Fix: "load: Symbol's value as variable is void: c-mode" for 'setq-mode-local'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1255
diff
changeset
|
2542 |
(require 'cedet) |
39879e285b7a
Fix: "load: Symbol's value as variable is void: c-mode" for 'setq-mode-local'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1255
diff
changeset
|
2543 |
(require 'mode-local))) |
454
18ce601cb4fb
Enable CEDET which custom installed.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
453
diff
changeset
|
2544 |
|
18ce601cb4fb
Enable CEDET which custom installed.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
453
diff
changeset
|
2545 |
(when (featurep 'cedet) |
1125
2fab89e9858e
Fix: Symbol's function definition is void: global-semantic-idle-scheduler-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1124
diff
changeset
|
2546 |
(require 'semantic) |
2fab89e9858e
Fix: Symbol's function definition is void: global-semantic-idle-scheduler-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1124
diff
changeset
|
2547 |
|
1035
daf872211946
Enable many CEDET features.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1034
diff
changeset
|
2548 |
(global-semantic-idle-scheduler-mode 1) |
422
021017e52754
Enable 'semantic' for Emacs 23.2.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
421
diff
changeset
|
2549 |
(global-semantic-idle-summary-mode 1) |
1035
daf872211946
Enable many CEDET features.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1034
diff
changeset
|
2550 |
(global-semantic-idle-completions-mode 1) |
425
b835c68d20a8
Added more semantic customisation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
424
diff
changeset
|
2551 |
(global-semantic-mru-bookmark-mode 1) |
b835c68d20a8
Added more semantic customisation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
424
diff
changeset
|
2552 |
;; (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
|
2553 |
(global-semantic-stickyfunc-mode -1) |
1035
daf872211946
Enable many CEDET features.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1034
diff
changeset
|
2554 |
(global-semantic-highlight-func-mode 1) |
daf872211946
Enable many CEDET features.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1034
diff
changeset
|
2555 |
(global-semantic-decoration-mode 1) |
daf872211946
Enable many CEDET features.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1034
diff
changeset
|
2556 |
(global-semantic-idle-local-symbol-highlight-mode 1) |
daf872211946
Enable many CEDET features.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1034
diff
changeset
|
2557 |
|
1171
489a962e1bd3
Increase timeout for CEDET parsing to prevent freezing when open files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1170
diff
changeset
|
2558 |
(setq semantic-idle-scheduler-idle-time 10) |
466
71d60f805984
Make larger time for heavy idle-scheduler-work.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
465
diff
changeset
|
2559 |
(setq semantic-idle-scheduler-work-idle-time 60) |
1167
0e8b45e9b09f
semantic-idle-scheduler-max-buffer-size
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1166
diff
changeset
|
2560 |
(setq semantic-idle-scheduler-max-buffer-size 100000) |
466
71d60f805984
Make larger time for heavy idle-scheduler-work.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
465
diff
changeset
|
2561 |
;; (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
|
2562 |
|
450
53773da85b43
Magic for semantic-add-system-include. Previous not worked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
443
diff
changeset
|
2563 |
;; semantic-dependency-system-include-path, semantic-customize-system-include-path |
626 | 2564 |
|
2565 |
;; file local project unloaded system recursive |
|
1124
77aed3ad8164
Enable Semantic local file parsing.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1123
diff
changeset
|
2566 |
(setq-mode-local c-mode semanticdb-find-default-throttle '(file local)) |
447
fde6ee13fce1
Use '~/.emacs.d/include' as place for headers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
446
diff
changeset
|
2567 |
(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
|
2568 |
(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
|
2569 |
(global-semanticdb-minor-mode 1) |
8c5d0e026821
Set my path for headers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
442
diff
changeset
|
2570 |
|
1195
33fd66648b2a
Fix: Symbol's function definition is void: global-cedet-m3-minor-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1194
diff
changeset
|
2571 |
(ignore-errors |
33fd66648b2a
Fix: Symbol's function definition is void: global-cedet-m3-minor-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1194
diff
changeset
|
2572 |
(global-cedet-m3-minor-mode 1)) |
1170
c7babd912af4
global-cedet-m3-minor-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1169
diff
changeset
|
2573 |
|
1169
00ed27b56ff4
Group related configs together.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1168
diff
changeset
|
2574 |
(semantic-mode 1) |
1168
1dbeeeb5b05b
Fix argument to satisfy usual convention for enabling mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1167
diff
changeset
|
2575 |
(global-ede-mode 1) |
1036 | 2576 |
|
1121
88df66cabc20
Enable semantic mode not only for build-in CEDET but for external Bzr/Git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1120
diff
changeset
|
2577 |
(require 'srecode) |
1206
4de7a444cf35
my-srecode-reload-templates
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1204
diff
changeset
|
2578 |
(defvar srecode-map-load-path nil) |
1150
dad3fb58f710
Add srecode templates.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1148
diff
changeset
|
2579 |
(add-to-list 'srecode-map-load-path (locate-user-emacs-file "srecode/")) |
1105
74211b52b859
Enable SRecode key binding for prog modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1104
diff
changeset
|
2580 |
(global-srecode-minor-mode 1) |
74211b52b859
Enable SRecode key binding for prog modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1104
diff
changeset
|
2581 |
(add-hook 'prog-mode-hook 'srecode-minor-mode) |
74211b52b859
Enable SRecode key binding for prog modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1104
diff
changeset
|
2582 |
|
1206
4de7a444cf35
my-srecode-reload-templates
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1204
diff
changeset
|
2583 |
(defun my-srecode-reload-templates () |
4de7a444cf35
my-srecode-reload-templates
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1204
diff
changeset
|
2584 |
"Reload all templates under `srecode-map-load-path'. Useful |
4de7a444cf35
my-srecode-reload-templates
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1204
diff
changeset
|
2585 |
during template developing." |
4de7a444cf35
my-srecode-reload-templates
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1204
diff
changeset
|
2586 |
(interactive) |
4de7a444cf35
my-srecode-reload-templates
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1204
diff
changeset
|
2587 |
(setq srecode-mode-table-list nil |
4de7a444cf35
my-srecode-reload-templates
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1204
diff
changeset
|
2588 |
srecode-current-map nil) |
4de7a444cf35
my-srecode-reload-templates
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1204
diff
changeset
|
2589 |
(srecode-map-update-map) ) |
4de7a444cf35
my-srecode-reload-templates
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1204
diff
changeset
|
2590 |
|
1119
a1a33efa7ad0
Enable ectag and global if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1118
diff
changeset
|
2591 |
(ignore-errors |
a1a33efa7ad0
Enable ectag and global if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1118
diff
changeset
|
2592 |
(cedet-ectag-version-check) |
a1a33efa7ad0
Enable ectag and global if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1118
diff
changeset
|
2593 |
(semantic-load-enable-primary-ectags-support)) |
a1a33efa7ad0
Enable ectag and global if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1118
diff
changeset
|
2594 |
(ignore-errors |
1123
130a4e1944d5
Add GNU Global check.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1122
diff
changeset
|
2595 |
(cedet-gnu-global-version-check) |
1119
a1a33efa7ad0
Enable ectag and global if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1118
diff
changeset
|
2596 |
(require 'cedet-global) |
a1a33efa7ad0
Enable ectag and global if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1118
diff
changeset
|
2597 |
(semanticdb-enable-gnu-global-databases 'c-mode) |
a1a33efa7ad0
Enable ectag and global if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1118
diff
changeset
|
2598 |
(semanticdb-enable-gnu-global-databases 'c++-mode)) |
a1a33efa7ad0
Enable ectag and global if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1118
diff
changeset
|
2599 |
|
1120 | 2600 |
(ignore-errors |
2601 |
(require 'cedet-java)) |
|
2602 |
||
1281
0e2a8e5f75b1
Disable noisy prompts when Emacs loads with desktop-save-mode opening
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1280
diff
changeset
|
2603 |
(setq project-linux-build-directory-default 'same |
0e2a8e5f75b1
Disable noisy prompts when Emacs loads with desktop-save-mode opening
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1280
diff
changeset
|
2604 |
project-linux-architecture-default "x86") |
0e2a8e5f75b1
Disable noisy prompts when Emacs loads with desktop-save-mode opening
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1280
diff
changeset
|
2605 |
|
1036 | 2606 |
;; (require 'semantic/db-javap) |
2607 |
||
626 | 2608 |
;; (add-to-list 'ede-locate-setup-options 'ede-locate-idutils) |
2609 |
;; (add-to-list 'ede-locate-setup-options 'ede-locate-global) |
|
2610 |
||
630
2dc36a3fdde6
Temporary disable cedet-global and cedet-idutils as GNU Global and IdUtils may
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
629
diff
changeset
|
2611 |
;; (ignore-errors (require 'cedet-idutils)) |
470
f859726fcca9
Enable GNU Global and GNU ID utils for EDE.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
469
diff
changeset
|
2612 |
|
1037
63dd116e3153
Properly set come keys for completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1036
diff
changeset
|
2613 |
(defun my-c-mode-cedet-hook () |
1119
a1a33efa7ad0
Enable ectag and global if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1118
diff
changeset
|
2614 |
;; (local-set-key [C-return] 'semantic-complete-symbol) |
1037
63dd116e3153
Properly set come keys for completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1036
diff
changeset
|
2615 |
;; (local-set-key [C-return] 'semantic-complete-analyze-inline) |
63dd116e3153
Properly set come keys for completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1036
diff
changeset
|
2616 |
(local-set-key "." 'semantic-complete-self-insert) |
63dd116e3153
Properly set come keys for completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1036
diff
changeset
|
2617 |
(local-set-key ">" 'semantic-complete-self-insert)) |
63dd116e3153
Properly set come keys for completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1036
diff
changeset
|
2618 |
(add-hook 'c-mode-common-hook 'my-c-mode-cedet-hook) |
1119
a1a33efa7ad0
Enable ectag and global if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1118
diff
changeset
|
2619 |
|
a1a33efa7ad0
Enable ectag and global if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1118
diff
changeset
|
2620 |
(ignore-errors |
a1a33efa7ad0
Enable ectag and global if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1118
diff
changeset
|
2621 |
(require 'semantic/ia) |
a1a33efa7ad0
Enable ectag and global if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1118
diff
changeset
|
2622 |
(define-key semantic-mode-map (kbd "C-c , .") 'semantic-ia-fast-jump) |
a1a33efa7ad0
Enable ectag and global if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1118
diff
changeset
|
2623 |
(define-key semantic-mode-map (kbd "C-c , d") 'semantic-ia-show-doc) |
a1a33efa7ad0
Enable ectag and global if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1118
diff
changeset
|
2624 |
(define-key semantic-mode-map (kbd "C-c , D") 'semantic-ia-show-summary) |
a1a33efa7ad0
Enable ectag and global if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1118
diff
changeset
|
2625 |
(define-key semantic-mode-map (kbd "C-c , ?") 'semantic-ia-complete-symbol-menu) |
1133
ca0a819ff8c5
semantic-mode-map override major mode binding, so disable conflicting key bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1132
diff
changeset
|
2626 |
;; (define-key semantic-mode-map [(control return)] 'semantic-ia-complete-symbol) |
1119
a1a33efa7ad0
Enable ectag and global if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1118
diff
changeset
|
2627 |
;; (define-key semantic-mode-map (kbd "C-c , C") 'semantic-ia-describe-class) |
a1a33efa7ad0
Enable ectag and global if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1118
diff
changeset
|
2628 |
;; semantic-decoration-include-visit |
a1a33efa7ad0
Enable ectag and global if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1118
diff
changeset
|
2629 |
;; semantic-analyze-proto-impl-toggle |
a1a33efa7ad0
Enable ectag and global if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1118
diff
changeset
|
2630 |
) |
a1a33efa7ad0
Enable ectag and global if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1118
diff
changeset
|
2631 |
|
a1a33efa7ad0
Enable ectag and global if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1118
diff
changeset
|
2632 |
;; END OF: (when (featurep 'cedet) ...) |
422
021017e52754
Enable 'semantic' for Emacs 23.2.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
421
diff
changeset
|
2633 |
) |
021017e52754
Enable 'semantic' for Emacs 23.2.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
421
diff
changeset
|
2634 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
2635 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
2636 |
(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
|
2637 |
|
1003 | 2638 |
(require 'imenu) |
2639 |
||
652
243f52487da7
Always enable 'imenu'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
650
diff
changeset
|
2640 |
(defun my-imenu-to-menubar () |
1003 | 2641 |
"Force imenu building when (menu-bar-mode -1)." |
995
9d2f14f723c4
Fix condition to check support for imenu.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
994
diff
changeset
|
2642 |
(when imenu-generic-expression |
994
4bc77d7283ea
Fix: File mode specification error: (error "The mode `nXML' does not support Imenu").
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
993
diff
changeset
|
2643 |
(imenu-add-menubar-index) |
4bc77d7283ea
Fix: File mode specification error: (error "The mode `nXML' does not support Imenu").
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
993
diff
changeset
|
2644 |
(run-hooks 'menu-bar-update-hook) )) |
652
243f52487da7
Always enable 'imenu'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
650
diff
changeset
|
2645 |
(mapc (lambda (hook) (add-hook hook 'my-imenu-to-menubar)) |
243f52487da7
Always enable 'imenu'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
650
diff
changeset
|
2646 |
my-devel-mode-hook-list) |
243f52487da7
Always enable 'imenu'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
650
diff
changeset
|
2647 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
2648 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
2649 |
(message "windows inf files for driver installin") |
303 | 2650 |
|
288
5009c3f4afef
Windows inf files for installing drivers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
285
diff
changeset
|
2651 |
(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
|
2652 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
2653 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1101
500c2af9b6fb
Set fvwm-fvwmcommand-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1100
diff
changeset
|
2654 |
(message "fvwm-mode") |
500c2af9b6fb
Set fvwm-fvwmcommand-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1100
diff
changeset
|
2655 |
|
1254
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
2656 |
(my--eval-after-load fvwm-mode |
1101
500c2af9b6fb
Set fvwm-fvwmcommand-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1100
diff
changeset
|
2657 |
(setq fvwm-fvwmcommand-path (executable-find "FvwmCommand"))) |
500c2af9b6fb
Set fvwm-fvwmcommand-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1100
diff
changeset
|
2658 |
|
500c2af9b6fb
Set fvwm-fvwmcommand-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1100
diff
changeset
|
2659 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
2660 |
(message "makefile, make") |
196
154d8ebf534b
Added matches for makefile-gmake-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
192
diff
changeset
|
2661 |
|
762
a4787876e986
Down priority for Makefile pattern to allow match .diff/.rej first.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
761
diff
changeset
|
2662 |
(add-to-list 'auto-mode-alist '("\\(Makefile\\|Makefile\\..+\\)\\'" . makefile-gmake-mode) t) |
196
154d8ebf534b
Added matches for makefile-gmake-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
192
diff
changeset
|
2663 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
2664 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
2665 |
(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
|
2666 |
|
36
4261883ccdb6
Use C-style comment in asm files.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
35
diff
changeset
|
2667 |
;; (setq-default asm-comment-char 59) |
4261883ccdb6
Use C-style comment in asm files.
Oleksander Gavenko <gavenko_a@3g.ua>
parents:
35
diff
changeset
|
2668 |
(add-hook 'asm-mode-hook '(lambda () (setq comment-start "/*") (setq comment-end "*/")) t) |
0 | 2669 |
|
186
8c74e1ac4da1
Added association for IAR asm file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
185
diff
changeset
|
2670 |
(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
|
2671 |
|
176
69d65b8a0a25
Added example for unset-key.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
175
diff
changeset
|
2672 |
;; (add-hook 'asm-mode-hook '(lambda () (local-unset-key ":"))) |
69d65b8a0a25
Added example for unset-key.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
175
diff
changeset
|
2673 |
;; (add-hook 'asm-mode-hook '(lambda () (local-set-key ":" ":"))) |
69d65b8a0a25
Added example for unset-key.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
175
diff
changeset
|
2674 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
2675 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
2676 |
(message "linker") |
272
f7fba93f4028
Enable file association for myself defined modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
266
diff
changeset
|
2677 |
|
f7fba93f4028
Enable file association for myself defined modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
266
diff
changeset
|
2678 |
(when (fboundp 'iar-linker-config-mode) |
f7fba93f4028
Enable file association for myself defined modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
266
diff
changeset
|
2679 |
(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
|
2680 |
) |
f7fba93f4028
Enable file association for myself defined modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
266
diff
changeset
|
2681 |
(when (fboundp 'iar4-linker-config-mode) |
f7fba93f4028
Enable file association for myself defined modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
266
diff
changeset
|
2682 |
(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
|
2683 |
) |
f7fba93f4028
Enable file association for myself defined modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
266
diff
changeset
|
2684 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
2685 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1172
e13ab3bb9331
Minor mode that highlights suspicious C and C++ constructions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1167
diff
changeset
|
2686 |
(message "c-mode, cc-mode, c++-mode") |
173
04b974b118c2
cc-mode customisations.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
172
diff
changeset
|
2687 |
|
645
f5a8fa2c4534
Minor mode that highlights suspicious C and C++ constructions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
644
diff
changeset
|
2688 |
;; Minor mode that highlights suspicious C and C++ constructions. |
1172
e13ab3bb9331
Minor mode that highlights suspicious C and C++ constructions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1167
diff
changeset
|
2689 |
(global-cwarn-mode 1) |
645
f5a8fa2c4534
Minor mode that highlights suspicious C and C++ constructions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
644
diff
changeset
|
2690 |
|
0 | 2691 |
(setq c-echo-syntactic-information-p t) |
710
49635ebf70f1
Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
2692 |
|
49635ebf70f1
Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
2693 |
(defun my-c-mode-common-hook () |
49635ebf70f1
Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
2694 |
;; Automatically inserte newlines after special characters such as brace, comma, semi-colon, and colon. |
823
c1c5a6b3255a
Enable 'electric' and disable 'auto-newline' in C-like modes. Previously I
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
818
diff
changeset
|
2695 |
(c-toggle-auto-newline -1) |
710
49635ebf70f1
Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
2696 |
;; Delete all preceding whitespace by DEL. |
49635ebf70f1
Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
2697 |
(c-toggle-hungry-state -1) |
711
c124c5e589af
Enable electric new-line. Document auto indent after typing colon.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
710
diff
changeset
|
2698 |
;; Auto indent after typing colon according to `c-hanging-colons-alist'. |
c124c5e589af
Enable electric new-line. Document auto indent after typing colon.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
710
diff
changeset
|
2699 |
(c-toggle-electric-state 1) |
710
49635ebf70f1
Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
2700 |
) |
49635ebf70f1
Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
2701 |
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook) |
0 | 2702 |
|
2703 |
(defconst my-c-style |
|
129
23d028bad418
More regular indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
128
diff
changeset
|
2704 |
'((c-tab-always-indent . t) |
0 | 2705 |
(c-comment-only-line-offset . 4) |
129
23d028bad418
More regular indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
128
diff
changeset
|
2706 |
(c-hanging-braces-alist |
131
bd2400a18295
Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
130
diff
changeset
|
2707 |
. ( |
bd2400a18295
Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
130
diff
changeset
|
2708 |
(brace-list-open) |
bd2400a18295
Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
130
diff
changeset
|
2709 |
(substatement-open after) |
bd2400a18295
Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
130
diff
changeset
|
2710 |
)) |
129
23d028bad418
More regular indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
128
diff
changeset
|
2711 |
(c-hanging-colons-alist |
131
bd2400a18295
Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
130
diff
changeset
|
2712 |
. ( |
bd2400a18295
Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
130
diff
changeset
|
2713 |
(access-label after) |
bd2400a18295
Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
130
diff
changeset
|
2714 |
(case-label after) |
129
23d028bad418
More regular indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
128
diff
changeset
|
2715 |
(inher-intro) |
23d028bad418
More regular indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
128
diff
changeset
|
2716 |
(label after) |
131
bd2400a18295
Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
130
diff
changeset
|
2717 |
(member-init-intro before) |
bd2400a18295
Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
130
diff
changeset
|
2718 |
)) |
129
23d028bad418
More regular indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
128
diff
changeset
|
2719 |
(c-cleanup-list |
131
bd2400a18295
Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
130
diff
changeset
|
2720 |
. ( |
bd2400a18295
Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
130
diff
changeset
|
2721 |
defun-close-semi |
129
23d028bad418
More regular indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
128
diff
changeset
|
2722 |
empty-defun-braces |
131
bd2400a18295
Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
130
diff
changeset
|
2723 |
scope-operator |
bd2400a18295
Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
130
diff
changeset
|
2724 |
)) |
129
23d028bad418
More regular indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
128
diff
changeset
|
2725 |
(c-offsets-alist |
131
bd2400a18295
Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
130
diff
changeset
|
2726 |
. ( |
712
b54c2306b184
Set indent level for privdate/public keywords.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
711
diff
changeset
|
2727 |
(access-label . -) |
485
28f82b8f4f46
Set 'arglist-close' to same indent level as 'arglist-intro' and 'arglist-cont-nonempty'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
484
diff
changeset
|
2728 |
(arglist-intro . ++) |
129
23d028bad418
More regular indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
128
diff
changeset
|
2729 |
(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
|
2730 |
(arglist-close . ++) |
131
bd2400a18295
Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
130
diff
changeset
|
2731 |
(block-open . 0) |
bd2400a18295
Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
130
diff
changeset
|
2732 |
(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
|
2733 |
(cpp-define-intro . 0) |
131
bd2400a18295
Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
130
diff
changeset
|
2734 |
(comment-intro . 0) |
bd2400a18295
Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
130
diff
changeset
|
2735 |
(func-decl-cont . ++) |
129
23d028bad418
More regular indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
128
diff
changeset
|
2736 |
(inexpr-class . 0) |
131
bd2400a18295
Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
130
diff
changeset
|
2737 |
(inline-open . 0) |
bd2400a18295
Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
130
diff
changeset
|
2738 |
(knr-argdecl-intro . -) |
129
23d028bad418
More regular indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
128
diff
changeset
|
2739 |
(label . 0) |
131
bd2400a18295
Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
130
diff
changeset
|
2740 |
(statement-block-intro . +) |
bd2400a18295
Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
130
diff
changeset
|
2741 |
(statement-cont . ++) |
129
23d028bad418
More regular indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
128
diff
changeset
|
2742 |
(substatement-open . 0) |
445
17ffd2e22d12
Disable indent on extern C.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
444
diff
changeset
|
2743 |
(inextern-lang . 0) |
131
bd2400a18295
Practice alphabetical order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
130
diff
changeset
|
2744 |
)) |
1174
1f2b829bd3e6
Certain syntactic errors are reported (like wrong indent).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1173
diff
changeset
|
2745 |
;; Certain syntactic errors are reported (like wrong indent). |
1f2b829bd3e6
Certain syntactic errors are reported (like wrong indent).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1173
diff
changeset
|
2746 |
(c-report-syntactic-errors . t) |
1173
bf65579bd653
Echo syntactic information on TAB in message buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1172
diff
changeset
|
2747 |
;; Echo syntactic information on TAB in message buffer. |
0 | 2748 |
(c-echo-syntactic-information-p . t)) |
2749 |
"My C Programming Style") |
|
2750 |
||
710
49635ebf70f1
Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
2751 |
(defun my-c-mode-style-hook () |
49635ebf70f1
Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
2752 |
(c-add-style "my" my-c-style t) |
49635ebf70f1
Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
2753 |
;; If set 'c-default-style' before 'c-add-style' |
49635ebf70f1
Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
2754 |
;; "Undefined style: my" error occured from 'c-get-style-variables'. |
49635ebf70f1
Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
2755 |
(setq c-default-style |
49635ebf70f1
Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
2756 |
'( |
49635ebf70f1
Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
2757 |
(java-mode . "my") (c-mode . "my") (csharp-mode . "my") (c++-mode . "my") (objc-mode . "my") |
49635ebf70f1
Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
2758 |
(idl-mode . "my") |
49635ebf70f1
Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
2759 |
(awk-mode . "awk") |
49635ebf70f1
Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
2760 |
(other . "my") |
49635ebf70f1
Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
2761 |
)) |
49635ebf70f1
Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
2762 |
) |
49635ebf70f1
Move some anonymous hooks to func definition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
2763 |
(add-hook 'c-mode-common-hook 'my-c-mode-style-hook) |
424
188eba7735eb
If set 'c-default-style' before 'c-add-style'
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
423
diff
changeset
|
2764 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
2765 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1350
82ce5b4ae16e
home key move after prompt in inferior-ess-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1349
diff
changeset
|
2766 |
(message "python, python-mode") |
703
970915b27f69
Don't send ^M to Python process under Windows as you get error
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
699
diff
changeset
|
2767 |
|
727
4d38b9e96670
Set 'python-indent' and 'python-continuation-offset'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
724
diff
changeset
|
2768 |
(setq python-indent 4) |
4d38b9e96670
Set 'python-indent' and 'python-continuation-offset'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
724
diff
changeset
|
2769 |
|
1340
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2770 |
(defvar my/python-eldoc-setup-code |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2771 |
"def __PYDOC_get_full_help(obj): |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2772 |
try: |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2773 |
import inspect |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2774 |
try: |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2775 |
str_type = basestring |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2776 |
except NameError: |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2777 |
str_type = str |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2778 |
if isinstance(obj, str_type): |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2779 |
obj = eval(obj, globals()) |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2780 |
doc = inspect.getdoc(obj) |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2781 |
if not doc and callable(obj): |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2782 |
target = None |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2783 |
if inspect.isclass(obj) and hasattr(obj, '__init__'): |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2784 |
target = obj.__init__ |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2785 |
objtype = 'class' |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2786 |
else: |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2787 |
target = obj |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2788 |
objtype = 'def' |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2789 |
if target: |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2790 |
args = inspect.formatargspec( |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2791 |
*inspect.getargspec(target) |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2792 |
) |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2793 |
name = obj.__name__ |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2794 |
doc = '{objtype} {name}{args}'.format( |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2795 |
objtype=objtype, name=name, args=args |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2796 |
) |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2797 |
except: |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2798 |
doc = '' |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2799 |
return doc" |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2800 |
"Python code to setup documentation retrieval.") |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2801 |
|
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2802 |
(defvar my/python-eldoc-string-code "__PYDOC_get_full_help('''%s''')" |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2803 |
"Python code used to get a string with the documentation of an object.") |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2804 |
|
1345
6fe0ba3b4dc4
Fix usage of built-in Python help() helper.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1344
diff
changeset
|
2805 |
(defvar my/python-eldoc-string-code2 "help(%s); pass" |
1342
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2806 |
"Python code used to get a string with the documentation of an object.") |
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2807 |
|
1338
a49cca7037ba
Add key binding for sending paragraph to python process.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1337
diff
changeset
|
2808 |
;; For built-in python.el |
a49cca7037ba
Add key binding for sending paragraph to python process.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1337
diff
changeset
|
2809 |
(my--eval-after-load python |
1340
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2810 |
(add-to-list 'python-shell-setup-codes 'my/python-eldoc-setup-code) ; Used inside (python-shell-send-setup-code) |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2811 |
(defun my/python-eldoc-at-point (&optional symbol) |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2812 |
"Show full docs for symbol at point." |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2813 |
(interactive |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2814 |
(let ((symbol (python-info-current-symbol t)) |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2815 |
(enable-recursive-minibuffers t)) |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2816 |
(list (read-string (if symbol |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2817 |
(format "Describe symbol (default %s): " symbol) |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2818 |
"Describe symbol: ") |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2819 |
nil nil symbol)))) |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2820 |
(let ( (python-eldoc-string-code my/python-eldoc-string-code) |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2821 |
(python-eldoc-setup-code my/python-eldoc-setup-code) ) |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2822 |
(switch-to-buffer (get-buffer-create "*Python-doc*")) |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2823 |
(read-only-mode -1) |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2824 |
(buffer-disable-undo) |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2825 |
(erase-buffer) |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2826 |
(insert (python-eldoc--get-doc-at-point symbol)) |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2827 |
(goto-char (point-min)) |
1342
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2828 |
(when (re-search-forward "^u?['\"]" (line-end-position) t) |
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2829 |
(replace-match "")) |
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2830 |
(while (re-search-forward "\\\\n" nil t) |
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2831 |
(replace-match "\n")) |
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2832 |
(goto-char (point-min)) |
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2833 |
(while (re-search-forward "\\\\'" nil t) |
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2834 |
(replace-match "['\"]")) |
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2835 |
(goto-char (point-max)) |
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2836 |
(when (eq ?' (char-before)) |
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2837 |
(delete-char -1)) |
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2838 |
(read-only-mode 1) |
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2839 |
(goto-char (point-min)))) |
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2840 |
(define-key python-mode-map "\C-c\C-d" 'my/python-eldoc-at-point) |
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2841 |
(defun my/python-eldoc-at-point2 (&optional symbol) |
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2842 |
"Show full docs for symbol at point." |
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2843 |
(interactive |
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2844 |
(let ((symbol (python-info-current-symbol t)) |
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2845 |
(enable-recursive-minibuffers t)) |
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2846 |
(list (read-string (if symbol |
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2847 |
(format "Describe symbol (default %s): " symbol) |
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2848 |
"Describe symbol: ") |
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2849 |
nil nil symbol)))) |
1345
6fe0ba3b4dc4
Fix usage of built-in Python help() helper.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1344
diff
changeset
|
2850 |
(let ( ) |
1342
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2851 |
(switch-to-buffer (get-buffer-create "*Python-doc*")) |
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2852 |
(read-only-mode -1) |
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2853 |
(buffer-disable-undo) |
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2854 |
(erase-buffer) |
1345
6fe0ba3b4dc4
Fix usage of built-in Python help() helper.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1344
diff
changeset
|
2855 |
(insert (python-shell-send-string-no-output (format my/python-eldoc-string-code2 symbol) (python-shell-get-process))) |
1342
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2856 |
(goto-char (point-min)) |
1340
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2857 |
(when (re-search-forward "^u?'" (line-end-position) t) |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2858 |
(replace-match "")) |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2859 |
(while (re-search-forward "\\\\n" nil t) |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2860 |
(replace-match "\n")) |
1341
227f15d381aa
Remove escapes from "'" from Python docs output.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1340
diff
changeset
|
2861 |
(goto-char (point-min)) |
227f15d381aa
Remove escapes from "'" from Python docs output.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1340
diff
changeset
|
2862 |
(while (re-search-forward "\\\\'" nil t) |
227f15d381aa
Remove escapes from "'" from Python docs output.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1340
diff
changeset
|
2863 |
(replace-match "'")) |
1340
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2864 |
(goto-char (point-max)) |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2865 |
(when (eq ?' (char-before)) |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2866 |
(delete-char -1)) |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2867 |
(read-only-mode 1) |
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2868 |
(goto-char (point-min)))) |
1342
ca70c69cabe5
Added function and key binding to show docs through built-in "help" Python function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1341
diff
changeset
|
2869 |
(define-key python-mode-map "\C-c\C-g" 'my/python-eldoc-at-point2) |
1340
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2870 |
|
1338
a49cca7037ba
Add key binding for sending paragraph to python process.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1337
diff
changeset
|
2871 |
(defun my-python/send-paragraph () |
a49cca7037ba
Add key binding for sending paragraph to python process.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1337
diff
changeset
|
2872 |
(interactive) |
a49cca7037ba
Add key binding for sending paragraph to python process.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1337
diff
changeset
|
2873 |
(save-excursion |
a49cca7037ba
Add key binding for sending paragraph to python process.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1337
diff
changeset
|
2874 |
(mark-paragraph) |
a49cca7037ba
Add key binding for sending paragraph to python process.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1337
diff
changeset
|
2875 |
(python-shell-send-region (point) (mark)))) |
a49cca7037ba
Add key binding for sending paragraph to python process.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1337
diff
changeset
|
2876 |
(define-key python-mode-map [?\C-c ?\C-h] 'my-python/send-paragraph)) |
a49cca7037ba
Add key binding for sending paragraph to python process.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1337
diff
changeset
|
2877 |
|
1344
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2878 |
(defgroup my/python nil |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2879 |
"My Python extentions in Emacs." |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2880 |
:group 'python) |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2881 |
|
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2882 |
(defvar my/python-pylint-command "pylint" |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2883 |
"Command to run pylint executable.") |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2884 |
(defvar my/python-pylint-args "-f parseable" |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2885 |
"Arguments to pass to pylint executable.") |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2886 |
|
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2887 |
(defvar my/python-pep8-command "pep8" |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2888 |
"Command to run pep8 executable.") |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2889 |
(defvar my/python-pep8-args "" |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2890 |
"Arguments to pass to pep8 executable.") |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2891 |
|
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2892 |
(defvar my/python-pyflakes-command "pyflakes" |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2893 |
"Command to run pyflakes executable.") |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2894 |
(defvar my/python-pyflakes-args "" |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2895 |
"Arguments to pass to pyflakes executable.") |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2896 |
|
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2897 |
(defvar my/python-checker-alist |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2898 |
'((pylint . (my/python-pylint-command my/python-pylint-args)) |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2899 |
(pep8 . (my/python-pep8-command my/python-pep8-args)) |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2900 |
(pyflakes . (my/python-pyflakes-command my/python-pyflakes-args))) |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2901 |
"Known Python source code checkers.") |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2902 |
|
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2903 |
(defcustom my/python-default-checker 'pyflakes |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2904 |
"Default Python source code checker. See `my/python-checker-alist' for full alist." |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2905 |
:group 'my/python |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2906 |
:type (cons 'choice (mapcar (lambda (e) (cons 'const e)) my/python-checker-alist))) |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2907 |
|
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2908 |
(defvar my/python-check-history nil) |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2909 |
|
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2910 |
(defun my/python-check (&optional checker) |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2911 |
(interactive |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2912 |
(list |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2913 |
(completing-read "Select cheker: " (mapcar (lambda (e) (car e)) my/python-checker-alist) nil t (symbol-name my/python-default-checker) 'my/python-check-history))) |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2914 |
(let ( entry ) |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2915 |
(unless (setq entry (cdr (assoc (intern-soft checker) my/python-checker-alist))) |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2916 |
(error "Unknown checker...")) |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2917 |
(compilation-start (format "%s %s %s" (symbol-value (car entry)) (symbol-value (cadr entry)) (shell-quote-argument (buffer-file-name)))))) |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2918 |
|
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2919 |
(my--eval-after-load python |
131e20ea7dad
My Python checkers mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1343
diff
changeset
|
2920 |
(define-key python-mode-map [?\C-c ?\C-v] #'my/python-check)) |
1340
daa03efc12b9
Show full docs for symbol at point for Python mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1339
diff
changeset
|
2921 |
|
1338
a49cca7037ba
Add key binding for sending paragraph to python process.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1337
diff
changeset
|
2922 |
;; For 3rd party python-mode.el. |
1254
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
2923 |
(my--eval-after-load python-mode |
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
2924 |
(when (and (boundp 'py-version) (equal py-version "5.1.0")) |
856
7757d0840a78
Fix bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=654398
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
843
diff
changeset
|
2925 |
;; (py-toggle-shells 'cpython) |
1337
a0eadfd4cff0
Redefine and add some key binding for python-mode.el.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1336
diff
changeset
|
2926 |
(setq-default py-which-shell py-python-command)) |
a0eadfd4cff0
Redefine and add some key binding for python-mode.el.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1336
diff
changeset
|
2927 |
(when (boundp 'py-version) |
a0eadfd4cff0
Redefine and add some key binding for python-mode.el.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1336
diff
changeset
|
2928 |
(define-key python-mode-map [C-backspace] 'backward-kill-word) |
a0eadfd4cff0
Redefine and add some key binding for python-mode.el.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1336
diff
changeset
|
2929 |
(define-key python-mode-map [?\C-c ?p] 'py-execute-paragraph) |
1339
d276e7a0d704
Seems that python-describe-symbol in python-mode.el and not in
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1338
diff
changeset
|
2930 |
(define-key python-mode-map [?\C-c ?r] 'py-execute-region) |
d276e7a0d704
Seems that python-describe-symbol in python-mode.el and not in
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1338
diff
changeset
|
2931 |
(define-key inferior-python-mode-map "\C-c\C-f" 'python-describe-symbol))) |
1023
3a49cbe13ae3
Fix 'eval-after-load' usage. Fix mode name.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1022
diff
changeset
|
2932 |
|
957
15fc17674517
Enable "M-/", "C-c g", "C-c d", "C-c f" shortcuts.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
956
diff
changeset
|
2933 |
;; Enable "M-/", "C-c g", "C-c d", "C-c f" shortcuts. |
15fc17674517
Enable "M-/", "C-c g", "C-c d", "C-c f" shortcuts.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
956
diff
changeset
|
2934 |
(setq ropemacs-enable-shortcuts t) |
864
adacfc97125b
Load 'pymacs' and 'ropemacs' automatically.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
863
diff
changeset
|
2935 |
(ignore-errors |
1022 | 2936 |
;; (require 'pymacs) |
2937 |
;; (pymacs-load "ropemacs" "rope-") |
|
864
adacfc97125b
Load 'pymacs' and 'ropemacs' automatically.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
863
diff
changeset
|
2938 |
) |
adacfc97125b
Load 'pymacs' and 'ropemacs' automatically.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
863
diff
changeset
|
2939 |
;; Automatically save project python buffers before refactorings |
adacfc97125b
Load 'pymacs' and 'ropemacs' automatically.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
863
diff
changeset
|
2940 |
(setq ropemacs-confirm-saving 'nil) |
adacfc97125b
Load 'pymacs' and 'ropemacs' automatically.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
863
diff
changeset
|
2941 |
|
732
139665dd6ada
my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
2942 |
(defun my-python-add-to-path (path) |
139665dd6ada
my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
2943 |
(interactive (list (read-directory-name "Enter new path for PYTHONPATH: "))) |
139665dd6ada
my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
2944 |
(when (featurep 'cygwin-mount) |
1024
4bb32327e98b
Fix my-python-add-to-path to allow ~ in path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1023
diff
changeset
|
2945 |
(setq path (my-dos2cygwin-path path))) |
4bb32327e98b
Fix my-python-add-to-path to allow ~ in path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1023
diff
changeset
|
2946 |
(python-send-string (format "import sys; sys.path.append(\"%s\")" (expand-file-name path))) ) |
732
139665dd6ada
my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
2947 |
|
139665dd6ada
my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
2948 |
(defun my-python-django-fix (path) |
139665dd6ada
my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
2949 |
"XXX not work on Cygwin + naive Emacs." |
139665dd6ada
my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
2950 |
(interactive (list (read-directory-name "Enter new path for PYTHONPATH: "))) |
139665dd6ada
my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
2951 |
(when (featurep 'cygwin-mount) |
139665dd6ada
my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
2952 |
(setq path (my-dos2cygwin-path path)) |
139665dd6ada
my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
2953 |
) |
139665dd6ada
my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
2954 |
(let ((file (concat path "manage.py"))) |
139665dd6ada
my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
2955 |
(if (file-exists-p file) |
139665dd6ada
my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
2956 |
(python-send-string (format "import os; os.chdir(\"%s\"); execfile(\"%s\")" path file)) |
139665dd6ada
my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
2957 |
(error (format "file '%s' does not exist" file)) |
139665dd6ada
my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
2958 |
))) |
139665dd6ada
my-python-django-fix + my-python-add-to-path.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
2959 |
|
1129
3458d2911643
Disable eldoc for Python in flavor of Semantic and perfomance reason.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1128
diff
changeset
|
2960 |
;; Disable in flavor of Semantic and perfomance reason. |
3458d2911643
Disable eldoc for Python in flavor of Semantic and perfomance reason.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1128
diff
changeset
|
2961 |
;; (when (>= emacs-major-version 22) |
3458d2911643
Disable eldoc for Python in flavor of Semantic and perfomance reason.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1128
diff
changeset
|
2962 |
;; (add-hook 'python-mode-hook 'turn-on-eldoc-mode)) |
729
9c5cb48451ad
Enable 'eldoc-mode' for 'python-mode'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
728
diff
changeset
|
2963 |
|
703
970915b27f69
Don't send ^M to Python process under Windows as you get error
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
699
diff
changeset
|
2964 |
(when (equal window-system 'w32) |
1129
3458d2911643
Disable eldoc for Python in flavor of Semantic and perfomance reason.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1128
diff
changeset
|
2965 |
(add-to-list 'process-coding-system-alist '("python" cp1251-unix . cp1251-unix))) |
703
970915b27f69
Don't send ^M to Python process under Windows as you get error
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
699
diff
changeset
|
2966 |
|
1210
b149f50121ac
requirements.txt is Python dependency description file probably.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1208
diff
changeset
|
2967 |
(add-to-list 'auto-mode-alist '("/requirements.txt\\'" . conf-mode)) |
b149f50121ac
requirements.txt is Python dependency description file probably.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1208
diff
changeset
|
2968 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
2969 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
884
8c6ff01debc1
Use cperl instead perl mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
883
diff
changeset
|
2970 |
(message "perl, cperl") |
8c6ff01debc1
Use cperl instead perl mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
883
diff
changeset
|
2971 |
|
8c6ff01debc1
Use cperl instead perl mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
883
diff
changeset
|
2972 |
;; Use cperl instead perl mode. |
8c6ff01debc1
Use cperl instead perl mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
883
diff
changeset
|
2973 |
(mapc |
8c6ff01debc1
Use cperl instead perl mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
883
diff
changeset
|
2974 |
(lambda (pair) |
8c6ff01debc1
Use cperl instead perl mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
883
diff
changeset
|
2975 |
(if (eq (cdr pair) 'perl-mode) |
8c6ff01debc1
Use cperl instead perl mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
883
diff
changeset
|
2976 |
(setcdr pair 'cperl-mode))) |
8c6ff01debc1
Use cperl instead perl mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
883
diff
changeset
|
2977 |
(append auto-mode-alist interpreter-mode-alist)) |
885
fd8ec78ece0a
Don't show all man page. I set man switches to "-a"...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
884
diff
changeset
|
2978 |
;; Don't show all man page. I set man switches to "-a"... |
fd8ec78ece0a
Don't show all man page. I set man switches to "-a"...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
884
diff
changeset
|
2979 |
(add-hook |
fd8ec78ece0a
Don't show all man page. I set man switches to "-a"...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
884
diff
changeset
|
2980 |
'cperl-mode-hook |
fd8ec78ece0a
Don't show all man page. I set man switches to "-a"...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
884
diff
changeset
|
2981 |
'(lambda () |
fd8ec78ece0a
Don't show all man page. I set man switches to "-a"...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
884
diff
changeset
|
2982 |
(make-local-variable 'Man-switches) |
fd8ec78ece0a
Don't show all man page. I set man switches to "-a"...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
884
diff
changeset
|
2983 |
(setq Man-switches nil))) |
884
8c6ff01debc1
Use cperl instead perl mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
883
diff
changeset
|
2984 |
|
886
0867fc471c12
Expands for keywords such as foreach, while, etc...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
885
diff
changeset
|
2985 |
;; Expands for keywords such as foreach, while, etc... |
0867fc471c12
Expands for keywords such as foreach, while, etc...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
885
diff
changeset
|
2986 |
(setq cperl-electric-keywords t) |
0867fc471c12
Expands for keywords such as foreach, while, etc...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
885
diff
changeset
|
2987 |
|
888
37348d961bfb
Set indentation rules for cperl.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
887
diff
changeset
|
2988 |
(setq |
37348d961bfb
Set indentation rules for cperl.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
887
diff
changeset
|
2989 |
cperl-indent-level 2 |
889
7f24172c2c4b
Fix indent level for closed parenthesis.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
888
diff
changeset
|
2990 |
cperl-close-paren-offset -2 |
888
37348d961bfb
Set indentation rules for cperl.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
887
diff
changeset
|
2991 |
cperl-continued-statement-offset 2 |
37348d961bfb
Set indentation rules for cperl.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
887
diff
changeset
|
2992 |
cperl-indent-parens-as-block t |
37348d961bfb
Set indentation rules for cperl.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
887
diff
changeset
|
2993 |
cperl-tab-always-indent t) |
37348d961bfb
Set indentation rules for cperl.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
887
diff
changeset
|
2994 |
|
884
8c6ff01debc1
Use cperl instead perl mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
883
diff
changeset
|
2995 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1350
82ce5b4ae16e
home key move after prompt in inferior-ess-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1349
diff
changeset
|
2996 |
(message "r, ess-mode") |
82ce5b4ae16e
home key move after prompt in inferior-ess-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1349
diff
changeset
|
2997 |
|
82ce5b4ae16e
home key move after prompt in inferior-ess-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1349
diff
changeset
|
2998 |
(setq ess-indent-offset 2) |
82ce5b4ae16e
home key move after prompt in inferior-ess-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1349
diff
changeset
|
2999 |
|
82ce5b4ae16e
home key move after prompt in inferior-ess-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1349
diff
changeset
|
3000 |
(my--eval-after-load ess-inf |
82ce5b4ae16e
home key move after prompt in inferior-ess-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1349
diff
changeset
|
3001 |
(define-key inferior-ess-mode-map [home] 'comint-bol)) |
82ce5b4ae16e
home key move after prompt in inferior-ess-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1349
diff
changeset
|
3002 |
|
82ce5b4ae16e
home key move after prompt in inferior-ess-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1349
diff
changeset
|
3003 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
873
900edc8d663e
Define key binding to send paragraph to SML process.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
872
diff
changeset
|
3004 |
(message "SML, Standard ML") |
900edc8d663e
Define key binding to send paragraph to SML process.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
872
diff
changeset
|
3005 |
|
1254
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
3006 |
(my--eval-after-load sml |
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
3007 |
(define-key sml-mode-map (kbd "C-c C-p") 'sml-send-function)) |
873
900edc8d663e
Define key binding to send paragraph to SML process.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
872
diff
changeset
|
3008 |
|
900edc8d663e
Define key binding to send paragraph to SML process.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
872
diff
changeset
|
3009 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
3010 |
(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
|
3011 |
|
965
72d443fe2b1d
Disable workaround for:
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
964
diff
changeset
|
3012 |
(if (>= emacs-major-version 23) |
72d443fe2b1d
Disable workaround for:
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
964
diff
changeset
|
3013 |
(add-to-list 'auto-mode-alist '("\\.js$" . js-mode)) |
72d443fe2b1d
Disable workaround for:
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
964
diff
changeset
|
3014 |
(add-to-list 'auto-mode-alist '("\\.js$" . javascript-generic-mode)) |
72d443fe2b1d
Disable workaround for:
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
964
diff
changeset
|
3015 |
) |
72d443fe2b1d
Disable workaround for:
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
964
diff
changeset
|
3016 |
|
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
3017 |
(my--eval-after-load js |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
3018 |
(modify-syntax-entry ?$ "w" js-mode-syntax-table)) |
1009
c6e2c636296f
Treat '$' as word syntax for JS mode to simplify C-Left/Right movement for jQuery.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1001
diff
changeset
|
3019 |
|
1231
a909406cc06c
js-indent-level, css-indent-offset
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1230
diff
changeset
|
3020 |
(setq js-indent-level 4) |
a909406cc06c
js-indent-level, css-indent-offset
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1230
diff
changeset
|
3021 |
;; js-curly-indent-offset, js-expr-indent-offset, js-paren-indent-offset, js-square-indent-offset, js-switch-indent-offset |
1009
c6e2c636296f
Treat '$' as word syntax for JS mode to simplify C-Left/Right movement for jQuery.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1001
diff
changeset
|
3022 |
|
965
72d443fe2b1d
Disable workaround for:
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
964
diff
changeset
|
3023 |
;; BUG: all single char comments do not stop highlighting on end of line but |
72d443fe2b1d
Disable workaround for:
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
964
diff
changeset
|
3024 |
;; go to end of buffer. To fix use code: |
72d443fe2b1d
Disable workaround for:
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
964
diff
changeset
|
3025 |
;; (setq auto-mode-alist (rassq-delete-all 'js-mode auto-mode-alist)) |
72d443fe2b1d
Disable workaround for:
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
964
diff
changeset
|
3026 |
;; (add-to-list 'auto-mode-alist '("\\.js$" . c++-mode)) |
0 | 3027 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
3028 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
3029 |
(message "bat file, batch") |
272
f7fba93f4028
Enable file association for myself defined modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
266
diff
changeset
|
3030 |
|
461
1639d2540bbd
Set outline-minor for file. Fix section to feet header outline pattern.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
460
diff
changeset
|
3031 |
;; 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
|
3032 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
3033 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
3034 |
(message "csharp, c-sharp") |
204
4545865a64c3
Move bat file mode code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
203
diff
changeset
|
3035 |
|
0 | 3036 |
(autoload 'csharp-mode "csharp-mode" "Major mode for editing C# code." t) |
3037 |
(add-to-list 'auto-mode-alist '("\\.cs$" . csharp-mode)) |
|
3038 |
||
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
3039 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
3040 |
(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
|
3041 |
|
1179
b2e1cb526649
Fix if subword-mode isn't defined.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1178
diff
changeset
|
3042 |
(when (fboundp 'subword-mode) |
b2e1cb526649
Fix if subword-mode isn't defined.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1178
diff
changeset
|
3043 |
(add-hook 'java-mode-hook #'subword-mode)) |
1178
2eeb9a3996b4
subword-mode for java-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1177
diff
changeset
|
3044 |
|
1220
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
3045 |
(add-hook 'java-mode-hook #'auto-revert-mode) |
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
3046 |
|
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
3047 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
3048 |
(message "Pascal") |
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
3049 |
|
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
3050 |
(setq |
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
3051 |
pascal-indent-level 4 |
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
3052 |
pascal-case-indent 2 |
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
3053 |
pascal-auto-newline t |
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
3054 |
pascal-tab-always-indent t |
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
3055 |
;; pascal-toggle-completions t |
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
3056 |
;; pascal-auto-lineup nil |
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
3057 |
pascal-auto-endcomments t) |
90e3a3721051
abbrev-file-name, pascal-mode
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1218
diff
changeset
|
3058 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
3059 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
3060 |
(message "ECB") |
0 | 3061 |
|
102
25585e240b4a
Move customization from .emacs (custom-set-variables) to .emacs-my. Remove duplication.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
101
diff
changeset
|
3062 |
(setq ecb-tip-of-the-day nil) |
0 | 3063 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
3064 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1227
e2355b44d39d
Enable wesnoth-mode if possible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1221
diff
changeset
|
3065 |
(message "nsis-mode") |
e2355b44d39d
Enable wesnoth-mode if possible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1221
diff
changeset
|
3066 |
|
e2355b44d39d
Enable wesnoth-mode if possible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1221
diff
changeset
|
3067 |
(when (fboundp 'nsis-mode) |
e2355b44d39d
Enable wesnoth-mode if possible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1221
diff
changeset
|
3068 |
(add-to-list 'auto-mode-alist '("\\.\\(nsi\\|nsh\\)\\'" . nsis-mode)) |
e2355b44d39d
Enable wesnoth-mode if possible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1221
diff
changeset
|
3069 |
) |
e2355b44d39d
Enable wesnoth-mode if possible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1221
diff
changeset
|
3070 |
|
e2355b44d39d
Enable wesnoth-mode if possible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1221
diff
changeset
|
3071 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
e2355b44d39d
Enable wesnoth-mode if possible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1221
diff
changeset
|
3072 |
(message "wesnoth-mode") |
e2355b44d39d
Enable wesnoth-mode if possible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1221
diff
changeset
|
3073 |
|
e2355b44d39d
Enable wesnoth-mode if possible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1221
diff
changeset
|
3074 |
(ignore-errors |
e2355b44d39d
Enable wesnoth-mode if possible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1221
diff
changeset
|
3075 |
(require 'wesnoth-mode) |
e2355b44d39d
Enable wesnoth-mode if possible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1221
diff
changeset
|
3076 |
(add-to-list 'auto-mode-alist '("wesnoth.*\\.cfg\\'" . wesnoth-mode)) ) |
e2355b44d39d
Enable wesnoth-mode if possible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1221
diff
changeset
|
3077 |
|
e2355b44d39d
Enable wesnoth-mode if possible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1221
diff
changeset
|
3078 |
(setq wesnoth-base-indent 2) |
e2355b44d39d
Enable wesnoth-mode if possible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1221
diff
changeset
|
3079 |
|
e2355b44d39d
Enable wesnoth-mode if possible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1221
diff
changeset
|
3080 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1231
a909406cc06c
js-indent-level, css-indent-offset
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1230
diff
changeset
|
3081 |
(message "css") |
a909406cc06c
js-indent-level, css-indent-offset
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1230
diff
changeset
|
3082 |
|
a909406cc06c
js-indent-level, css-indent-offset
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1230
diff
changeset
|
3083 |
(setq css-indent-offset 4) |
a909406cc06c
js-indent-level, css-indent-offset
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1230
diff
changeset
|
3084 |
|
1232 | 3085 |
;; (package-install 'css-eldoc) |
3086 |
||
1254
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
3087 |
(my--eval-after-load css-mode |
1233 | 3088 |
(when (fboundp 'css-eldoc-enable) |
3089 |
(css-eldoc-enable))) |
|
1232 | 3090 |
|
1231
a909406cc06c
js-indent-level, css-indent-offset
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1230
diff
changeset
|
3091 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
958
f93fa1c0f480
Add customisation for 'htmlize'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
957
diff
changeset
|
3092 |
(message "htmlize") |
f93fa1c0f480
Add customisation for 'htmlize'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
957
diff
changeset
|
3093 |
|
f93fa1c0f480
Add customisation for 'htmlize'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
957
diff
changeset
|
3094 |
(setq |
f93fa1c0f480
Add customisation for 'htmlize'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
957
diff
changeset
|
3095 |
htmlize-html-charset "utf-8" |
f93fa1c0f480
Add customisation for 'htmlize'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
957
diff
changeset
|
3096 |
htmlize-output-type 'inline-css |
f93fa1c0f480
Add customisation for 'htmlize'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
957
diff
changeset
|
3097 |
htmlize-html-major-mode 'html-mode |
f93fa1c0f480
Add customisation for 'htmlize'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
957
diff
changeset
|
3098 |
htmlize-convert-nonascii-to-entities nil) |
f93fa1c0f480
Add customisation for 'htmlize'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
957
diff
changeset
|
3099 |
|
f93fa1c0f480
Add customisation for 'htmlize'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
957
diff
changeset
|
3100 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
3101 |
(message "html") |
104
e921a5d906ca
Use highlighting on sgml modes!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
102
diff
changeset
|
3102 |
|
1324
f6fc0d332bbc
Add my-* prefix to html-charref-* functions. Add support for < /
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1323
diff
changeset
|
3103 |
(defun my-html-charref-escape-region (start end) |
628 | 3104 |
(interactive "r") |
3105 |
(save-excursion |
|
3106 |
(save-restriction |
|
3107 |
(narrow-to-region start end) |
|
3108 |
(goto-char (point-min)) |
|
3109 |
(replace-string "&" "&") |
|
3110 |
(goto-char (point-min)) |
|
3111 |
(replace-string "<" "<") |
|
3112 |
(goto-char (point-min)) |
|
3113 |
(replace-string ">" ">") |
|
3114 |
))) |
|
3115 |
||
1324
f6fc0d332bbc
Add my-* prefix to html-charref-* functions. Add support for < /
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1323
diff
changeset
|
3116 |
(defun my-html-charref-from-char (char) |
654
f08ea38190d6
html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
653
diff
changeset
|
3117 |
(format "&#%d;" char) |
f08ea38190d6
html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
653
diff
changeset
|
3118 |
) |
f08ea38190d6
html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
653
diff
changeset
|
3119 |
|
1324
f6fc0d332bbc
Add my-* prefix to html-charref-* functions. Add support for < /
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1323
diff
changeset
|
3120 |
(defun my-html-charref-from-string (string) |
654
f08ea38190d6
html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
653
diff
changeset
|
3121 |
(let ((res "")) |
f08ea38190d6
html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
653
diff
changeset
|
3122 |
(mapc |
1324
f6fc0d332bbc
Add my-* prefix to html-charref-* functions. Add support for < /
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1323
diff
changeset
|
3123 |
(lambda (char) (setq res (concat res (my-html-charref-from-char char)))) |
654
f08ea38190d6
html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
653
diff
changeset
|
3124 |
string) |
f08ea38190d6
html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
653
diff
changeset
|
3125 |
res |
f08ea38190d6
html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
653
diff
changeset
|
3126 |
) ) |
f08ea38190d6
html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
653
diff
changeset
|
3127 |
|
1324
f6fc0d332bbc
Add my-* prefix to html-charref-* functions. Add support for < /
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1323
diff
changeset
|
3128 |
(defun my-html-charref-escape-region2 (begin end &optional prefix) |
654
f08ea38190d6
html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
653
diff
changeset
|
3129 |
(interactive "r\nP") |
f08ea38190d6
html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
653
diff
changeset
|
3130 |
(if prefix |
f08ea38190d6
html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
653
diff
changeset
|
3131 |
(save-excursion |
f08ea38190d6
html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
653
diff
changeset
|
3132 |
(goto-char begin) |
1324
f6fc0d332bbc
Add my-* prefix to html-charref-* functions. Add support for < /
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1323
diff
changeset
|
3133 |
(insert (my-html-charref-from-string (delete-and-extract-region begin end)))) |
f6fc0d332bbc
Add my-* prefix to html-charref-* functions. Add support for < /
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1323
diff
changeset
|
3134 |
(my-html-charref-from-string (buffer-substring begin end)) |
654
f08ea38190d6
html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
653
diff
changeset
|
3135 |
)) |
f08ea38190d6
html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
653
diff
changeset
|
3136 |
|
1324
f6fc0d332bbc
Add my-* prefix to html-charref-* functions. Add support for < /
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1323
diff
changeset
|
3137 |
(defun my-html-charref-to-string (html) |
f6fc0d332bbc
Add my-* prefix to html-charref-* functions. Add support for < /
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1323
diff
changeset
|
3138 |
(let (str) |
f6fc0d332bbc
Add my-* prefix to html-charref-* functions. Add support for < /
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1323
diff
changeset
|
3139 |
(with-temp-buffer |
f6fc0d332bbc
Add my-* prefix to html-charref-* functions. Add support for < /
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1323
diff
changeset
|
3140 |
(insert html) |
f6fc0d332bbc
Add my-* prefix to html-charref-* functions. Add support for < /
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1323
diff
changeset
|
3141 |
(goto-char (point-min)) |
f6fc0d332bbc
Add my-* prefix to html-charref-* functions. Add support for < /
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1323
diff
changeset
|
3142 |
(while (search-forward-regexp "&\\(?:#\\([[:digit:]]+\\)\\|\\(lt\\|gt\\|amp\\)\\);" nil t) |
f6fc0d332bbc
Add my-* prefix to html-charref-* functions. Add support for < /
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1323
diff
changeset
|
3143 |
(setq str (or (match-string 1) (match-string 2))) |
f6fc0d332bbc
Add my-* prefix to html-charref-* functions. Add support for < /
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1323
diff
changeset
|
3144 |
(cond |
f6fc0d332bbc
Add my-* prefix to html-charref-* functions. Add support for < /
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1323
diff
changeset
|
3145 |
((equal str "lt") |
f6fc0d332bbc
Add my-* prefix to html-charref-* functions. Add support for < /
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1323
diff
changeset
|
3146 |
(replace-match "<" t t)) |
f6fc0d332bbc
Add my-* prefix to html-charref-* functions. Add support for < /
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1323
diff
changeset
|
3147 |
((equal str "gt") |
f6fc0d332bbc
Add my-* prefix to html-charref-* functions. Add support for < /
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1323
diff
changeset
|
3148 |
(replace-match ">" t t)) |
f6fc0d332bbc
Add my-* prefix to html-charref-* functions. Add support for < /
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1323
diff
changeset
|
3149 |
((equal str "amp") |
f6fc0d332bbc
Add my-* prefix to html-charref-* functions. Add support for < /
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1323
diff
changeset
|
3150 |
(replace-match "&" t t)) |
f6fc0d332bbc
Add my-* prefix to html-charref-* functions. Add support for < /
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1323
diff
changeset
|
3151 |
((> (string-to-number str) 0) |
f6fc0d332bbc
Add my-* prefix to html-charref-* functions. Add support for < /
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1323
diff
changeset
|
3152 |
(replace-match (string (string-to-number str 10)) t t)))) |
f6fc0d332bbc
Add my-* prefix to html-charref-* functions. Add support for < /
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1323
diff
changeset
|
3153 |
(buffer-string)))) |
f6fc0d332bbc
Add my-* prefix to html-charref-* functions. Add support for < /
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1323
diff
changeset
|
3154 |
|
f6fc0d332bbc
Add my-* prefix to html-charref-* functions. Add support for < /
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1323
diff
changeset
|
3155 |
(defun my-html-charref-unescape-region (begin end &optional prefix) |
654
f08ea38190d6
html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
653
diff
changeset
|
3156 |
(interactive "r\nP") |
f08ea38190d6
html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
653
diff
changeset
|
3157 |
(if prefix |
f08ea38190d6
html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
653
diff
changeset
|
3158 |
(save-excursion |
f08ea38190d6
html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
653
diff
changeset
|
3159 |
(goto-char begin) |
1324
f6fc0d332bbc
Add my-* prefix to html-charref-* functions. Add support for < /
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1323
diff
changeset
|
3160 |
(insert (my-html-charref-to-string (delete-and-extract-region begin end)))) |
f6fc0d332bbc
Add my-* prefix to html-charref-* functions. Add support for < /
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1323
diff
changeset
|
3161 |
(my-html-charref-to-string (buffer-substring begin end)) |
654
f08ea38190d6
html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
653
diff
changeset
|
3162 |
)) |
f08ea38190d6
html-charref package for converting string from/to HTML charref.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
653
diff
changeset
|
3163 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
3164 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
3165 |
(message "nxml") |
520
7e8d77531ecf
Make the complete element be treated as a single markup item.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
514
diff
changeset
|
3166 |
|
7e8d77531ecf
Make the complete element be treated as a single markup item.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
514
diff
changeset
|
3167 |
(setq nxml-sexp-element-flag t) |
522
14a5ff978db7
Set indent for NXML.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
521
diff
changeset
|
3168 |
(setq nxml-child-indent 2) |
14a5ff978db7
Set indent for NXML.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
521
diff
changeset
|
3169 |
(setq nxml-attribute-indent 4) |
104
e921a5d906ca
Use highlighting on sgml modes!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
102
diff
changeset
|
3170 |
|
997
28255ceefe52
Use .pom files as XML files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
993
diff
changeset
|
3171 |
(add-to-list 'auto-mode-alist '("\.pom\\'" . nxml-mode)) |
1033
970347ad41f8
Associate .xsd/.rng files with nxml-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1032
diff
changeset
|
3172 |
(add-to-list 'auto-mode-alist '("\.xsd\\'" . nxml-mode)) |
970347ad41f8
Associate .xsd/.rng files with nxml-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1032
diff
changeset
|
3173 |
(add-to-list 'auto-mode-alist '("\.rng\\'" . nxml-mode)) |
1156
736410a49d60
Use NXML for .xul files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1155
diff
changeset
|
3174 |
(add-to-list 'auto-mode-alist '("\.xul\\'" . nxml-mode)) |
1305
57b16a684500
Additional file extension for nxml-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1304
diff
changeset
|
3175 |
(add-to-list 'auto-mode-alist '("\.xslt\\'" . nxml-mode)) |
57b16a684500
Additional file extension for nxml-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1304
diff
changeset
|
3176 |
(add-to-list 'auto-mode-alist '("\.svg\\'" . nxml-mode)) |
57b16a684500
Additional file extension for nxml-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1304
diff
changeset
|
3177 |
(add-to-list 'auto-mode-alist '("\.rss\\'" . nxml-mode)) |
57b16a684500
Additional file extension for nxml-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1304
diff
changeset
|
3178 |
(add-to-list 'auto-mode-alist '("\.atom\\'" . nxml-mode)) |
997
28255ceefe52
Use .pom files as XML files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
993
diff
changeset
|
3179 |
|
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
3180 |
(my--eval-after-load nxml-mode |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
3181 |
(define-key nxml-mode-map [C-return] 'nxml-complete)) |
994
4bc77d7283ea
Fix: File mode specification error: (error "The mode `nXML' does not support Imenu").
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
993
diff
changeset
|
3182 |
|
998 | 3183 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
3184 |
(message "relax ng, rng") |
|
3185 |
||
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
3186 |
(my--eval-after-load rng-loc |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
3187 |
(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
|
3188 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
3189 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1026
ce279dbcf880
Use 'web-mode' if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1025
diff
changeset
|
3190 |
(message "web-mode") |
ce279dbcf880
Use 'web-mode' if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1025
diff
changeset
|
3191 |
|
1067
493ae377ca5d
Set web-mode offsets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1064
diff
changeset
|
3192 |
(setq web-mode-markup-indent-offset 2 |
493ae377ca5d
Set web-mode offsets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1064
diff
changeset
|
3193 |
web-mode-css-indent-offset 2 |
1074
fffe729d20a0
Update web-mode setting to new version.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1073
diff
changeset
|
3194 |
web-mode-code-indent-offset 2 |
fffe729d20a0
Update web-mode setting to new version.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1073
diff
changeset
|
3195 |
web-mode-script-padding 2 |
fffe729d20a0
Update web-mode setting to new version.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1073
diff
changeset
|
3196 |
web-mode-style-padding 2) |
fffe729d20a0
Update web-mode setting to new version.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1073
diff
changeset
|
3197 |
|
fffe729d20a0
Update web-mode setting to new version.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1073
diff
changeset
|
3198 |
(setq web-mode-enable-comment-keywords t) |
1067
493ae377ca5d
Set web-mode offsets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1064
diff
changeset
|
3199 |
|
1026
ce279dbcf880
Use 'web-mode' if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1025
diff
changeset
|
3200 |
(ignore-errors (require 'web-mode)) |
ce279dbcf880
Use 'web-mode' if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1025
diff
changeset
|
3201 |
(when (featurep 'web-mode) |
1128
33ab3ce7f973
Use original values of web-mode-engine-file-regexps. Enable PHP mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1127
diff
changeset
|
3202 |
(setq web-mode-engine-file-regexps (delq (assoc "jsp" web-mode-engine-file-regexps) web-mode-engine-file-regexps)) |
33ab3ce7f973
Use original values of web-mode-engine-file-regexps. Enable PHP mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1127
diff
changeset
|
3203 |
(mapc (lambda (i) (add-to-list 'web-mode-engine-file-regexps i)) |
33ab3ce7f973
Use original values of web-mode-engine-file-regexps. Enable PHP mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1127
diff
changeset
|
3204 |
'(("jsp" . "\\.tagf?\\'") |
33ab3ce7f973
Use original values of web-mode-engine-file-regexps. Enable PHP mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1127
diff
changeset
|
3205 |
("jsp" . "\\.jspf?\\'"))) |
1026
ce279dbcf880
Use 'web-mode' if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1025
diff
changeset
|
3206 |
(add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode)) |
1130
4aea0ddc3607
Use web-mode for PHP.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1125
diff
changeset
|
3207 |
(add-to-list 'auto-mode-alist '("\\.php\\'" . web-mode)) |
1027
53633ac1c134
Fix pattern for '.jspf' files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1026
diff
changeset
|
3208 |
(add-to-list 'auto-mode-alist '("\\.jspf?\\'" . web-mode)) |
1028
939bec5b98f8
Add JSP tag file to web-modes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1027
diff
changeset
|
3209 |
(add-to-list 'auto-mode-alist '("/WEB-INF/tags/.*\\.tagf?\\'" . web-mode)) |
1026
ce279dbcf880
Use 'web-mode' if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1025
diff
changeset
|
3210 |
(add-to-list 'auto-mode-alist '("\\.as[cp]x\\'" . web-mode)) |
ce279dbcf880
Use 'web-mode' if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1025
diff
changeset
|
3211 |
(add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode)) |
ce279dbcf880
Use 'web-mode' if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1025
diff
changeset
|
3212 |
(add-to-list 'auto-mode-alist '("\\.mustache\\'" . web-mode)) |
ce279dbcf880
Use 'web-mode' if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1025
diff
changeset
|
3213 |
(add-to-list 'auto-mode-alist '("\\.djhtml\\'" . web-mode)) |
ce279dbcf880
Use 'web-mode' if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1025
diff
changeset
|
3214 |
(add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode)) ) |
ce279dbcf880
Use 'web-mode' if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1025
diff
changeset
|
3215 |
|
ce279dbcf880
Use 'web-mode' if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1025
diff
changeset
|
3216 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
3217 |
(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
|
3218 |
|
698
2a081d4e2e7c
FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
691
diff
changeset
|
3219 |
(setq my-html-template |
2a081d4e2e7c
FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
691
diff
changeset
|
3220 |
'("html" |
2a081d4e2e7c
FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
691
diff
changeset
|
3221 |
(nil |
2a081d4e2e7c
FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
691
diff
changeset
|
3222 |
"\n<head>" \n |
1366
f9989b9060aa
Fix: Warning: `read-input' is an obsolete function (as of 22.1); use `read-string' instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1365
diff
changeset
|
3223 |
"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=" (read-string "Charset: ") "\">" \n |
f9989b9060aa
Fix: Warning: `read-input' is an obsolete function (as of 22.1); use `read-string' instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1365
diff
changeset
|
3224 |
"<title>" (setq str (read-string "Title: ")) "</title>\n" |
698
2a081d4e2e7c
FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
691
diff
changeset
|
3225 |
"</head>\n" |
2a081d4e2e7c
FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
691
diff
changeset
|
3226 |
"<body>\n<h1>" str "</h1>" |
2a081d4e2e7c
FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
691
diff
changeset
|
3227 |
"\n<address>" \n |
2a081d4e2e7c
FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
691
diff
changeset
|
3228 |
"<a href=\"mailto:" user-mail-address "\">" (user-full-name) "</a>" \n |
2a081d4e2e7c
FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
691
diff
changeset
|
3229 |
"</address>" \n |
2a081d4e2e7c
FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
691
diff
changeset
|
3230 |
"</body>\n" |
2a081d4e2e7c
FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
691
diff
changeset
|
3231 |
)) |
2a081d4e2e7c
FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
691
diff
changeset
|
3232 |
) |
2a081d4e2e7c
FIX: 'html-tag-alist' is not defined in 'psgml' mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
691
diff
changeset
|
3233 |
|
245 | 3234 |
(setq sgml-set-face t) ; for highlighting in sgml |
1254
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
3235 |
(my--eval-after-load sgml-mode |
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
3236 |
(unless (featurep 'psgml) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
3237 |
(setq html-tag-alist |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
3238 |
(cons |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
3239 |
my-html-template |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
3240 |
(my-filter |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
3241 |
(lambda (item) (not (equal (car item) "html"))) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
3242 |
html-tag-alist))) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
3243 |
(add-to-list 'html-tag-alist '("script" (\n) ("type" "text/javascript") )) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
3244 |
(add-to-list 'html-tag-alist '("style" (\n) ("type" "text/css") )) )) |
985
ad3c49e55848
Define own jsp-mode based on html-mode with JSP comment style.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
984
diff
changeset
|
3245 |
|
ad3c49e55848
Define own jsp-mode based on html-mode with JSP comment style.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
984
diff
changeset
|
3246 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
ad3c49e55848
Define own jsp-mode based on html-mode with JSP comment style.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
984
diff
changeset
|
3247 |
(message "jsp") |
ad3c49e55848
Define own jsp-mode based on html-mode with JSP comment style.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
984
diff
changeset
|
3248 |
|
ad3c49e55848
Define own jsp-mode based on html-mode with JSP comment style.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
984
diff
changeset
|
3249 |
(define-derived-mode jsp-mode html-mode "JSP" |
ad3c49e55848
Define own jsp-mode based on html-mode with JSP comment style.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
984
diff
changeset
|
3250 |
"JSP editing mode. Redefine HTML comment syntax to JSP." |
ad3c49e55848
Define own jsp-mode based on html-mode with JSP comment style.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
984
diff
changeset
|
3251 |
(setq comment-start "<%--") |
ad3c49e55848
Define own jsp-mode based on html-mode with JSP comment style.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
984
diff
changeset
|
3252 |
(setq comment-end "--%>") |
ad3c49e55848
Define own jsp-mode based on html-mode with JSP comment style.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
984
diff
changeset
|
3253 |
(setq comment-start-skip "<[!%]--[ \t]*") |
ad3c49e55848
Define own jsp-mode based on html-mode with JSP comment style.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
984
diff
changeset
|
3254 |
(setq comment-end-skip "[ \t]*--[% \t\n]*>") |
ad3c49e55848
Define own jsp-mode based on html-mode with JSP comment style.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
984
diff
changeset
|
3255 |
(setq jsp-font-lock-syntactic-keywords |
ad3c49e55848
Define own jsp-mode based on html-mode with JSP comment style.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
984
diff
changeset
|
3256 |
'(("\\(<\\)%--" (1 "< b")) |
ad3c49e55848
Define own jsp-mode based on html-mode with JSP comment style.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
984
diff
changeset
|
3257 |
("--%\\(>\\)" (1 "> b")))) |
ad3c49e55848
Define own jsp-mode based on html-mode with JSP comment style.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
984
diff
changeset
|
3258 |
(setcdr (assoc 'font-lock-syntactic-keywords font-lock-defaults) 'jsp-font-lock-syntactic-keywords) ) |
ad3c49e55848
Define own jsp-mode based on html-mode with JSP comment style.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
984
diff
changeset
|
3259 |
|
1026
ce279dbcf880
Use 'web-mode' if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1025
diff
changeset
|
3260 |
(unless (featurep 'web-mode) |
ce279dbcf880
Use 'web-mode' if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1025
diff
changeset
|
3261 |
(add-to-list 'auto-mode-alist '("\\.jspf?\\'" . jsp-mode))) |
985
ad3c49e55848
Define own jsp-mode based on html-mode with JSP comment style.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
984
diff
changeset
|
3262 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
3263 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
3264 |
(message "sh, bash") |
438
740efbdc5777
Associate shell-script-mode for .cygport files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
437
diff
changeset
|
3265 |
|
740efbdc5777
Associate shell-script-mode for .cygport files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
437
diff
changeset
|
3266 |
(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
|
3267 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
3268 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
870
faf5e15495dc
Add Proof General settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
869
diff
changeset
|
3269 |
(message "pg, Proof General") |
faf5e15495dc
Add Proof General settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
869
diff
changeset
|
3270 |
|
875
ad6675a2cc8e
Disable shown consts in *goal* buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
874
diff
changeset
|
3271 |
(setq proof-splash-enable nil) |
870
faf5e15495dc
Add Proof General settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
869
diff
changeset
|
3272 |
;; (setq proof-toolbar-enable nil) |
faf5e15495dc
Add Proof General settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
869
diff
changeset
|
3273 |
|
875
ad6675a2cc8e
Disable shown consts in *goal* buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
874
diff
changeset
|
3274 |
(setq |
ad6675a2cc8e
Disable shown consts in *goal* buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
874
diff
changeset
|
3275 |
isar-display:show-types t |
ad6675a2cc8e
Disable shown consts in *goal* buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
874
diff
changeset
|
3276 |
isar-display:show-sorts t |
ad6675a2cc8e
Disable shown consts in *goal* buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
874
diff
changeset
|
3277 |
isar-display:show-main-goal t |
ad6675a2cc8e
Disable shown consts in *goal* buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
874
diff
changeset
|
3278 |
isar-display:show-brackets t |
ad6675a2cc8e
Disable shown consts in *goal* buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
874
diff
changeset
|
3279 |
;; Too many output, so commented: |
ad6675a2cc8e
Disable shown consts in *goal* buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
874
diff
changeset
|
3280 |
;; isar-display:show-consts t |
ad6675a2cc8e
Disable shown consts in *goal* buffer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
874
diff
changeset
|
3281 |
) |
871
209250a782ff
Set isar-display:show-types and isar-display:show-brackets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
870
diff
changeset
|
3282 |
|
1254
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
3283 |
(my--eval-after-load proof |
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
3284 |
;; (proof-maths-menu-toggle 1) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
3285 |
;; (unicode-tokens-mode 1) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
3286 |
;; (proof-imenu-toggle 1) |
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
3287 |
) |
1254
19c7b3be9b3a
Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1253
diff
changeset
|
3288 |
(my--eval-after-load isar |
1278
8e47e801be9d
Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1277
diff
changeset
|
3289 |
(define-key isar-mode-map (kbd "C-c C-m") 'proof-goto-point)) |
870
faf5e15495dc
Add Proof General settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
869
diff
changeset
|
3290 |
|
faf5e15495dc
Add Proof General settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
869
diff
changeset
|
3291 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
3292 |
(message "printing") |
0 | 3293 |
|
881 | 3294 |
(setq ps-paper-type 'a4) |
3295 |
||
0 | 3296 |
;; Use Notepad to print plain text files to the default Windows printer |
3297 |
;(setq lpr-command "notepad") |
|
3298 |
;(setq lpr-headers-switches '("/p")) ; \ mis-use these |
|
3299 |
;(setq lpr-switches nil) ; / two variables |
|
9 | 3300 |
;(setq printer-name nil) ; notepad takes the default |
0 | 3301 |
;(setq lpr-printer-switch "/P") ;; run notepad as batch printer |
3302 |
;; |
|
295 | 3303 |
|
461
1639d2540bbd
Set outline-minor for file. Fix section to feet header outline pattern.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
460
diff
changeset
|
3304 |
;; Printing to file. |
295 | 3305 |
|
0 | 3306 |
;(setq printer-name "~/myprint.txt") |
3307 |
;(setq ps-printer-name nil) |
|
3308 |
;(setq ps-print-header nil) |
|
3309 |
||
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
3310 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
3311 |
(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
|
3312 |
|
25585e240b4a
Move customization from .emacs (custom-set-variables) to .emacs-my. Remove duplication.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
101
diff
changeset
|
3313 |
(setq sql-password "") |
1051
1248821d9d0b
Add plsql file extension to auto-mode-alist.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1050
diff
changeset
|
3314 |
(add-to-list 'auto-mode-alist '("\\.plsql\\'" . sql-mode)) |
0 | 3315 |
|
1110
6b18658edec8
Disable placeholders substitution in Oracle SQLi by Emacs itself.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1107
diff
changeset
|
3316 |
;; Disable placeholders substitution in Oracle SQLi by Emacs itself. |
6b18658edec8
Disable placeholders substitution in Oracle SQLi by Emacs itself.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1107
diff
changeset
|
3317 |
;; This enable "define" and "&var" syntax. |
6b18658edec8
Disable placeholders substitution in Oracle SQLi by Emacs itself.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1107
diff
changeset
|
3318 |
(setq sql-oracle-scan-on nil) |
6b18658edec8
Disable placeholders substitution in Oracle SQLi by Emacs itself.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1107
diff
changeset
|
3319 |
|
1280
300a2718b555
Disable line wrapping for SQLi buffers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1279
diff
changeset
|
3320 |
(add-hook 'sql-interactive-mode-hook (lambda () (toggle-truncate-lines 1))) |
300a2718b555
Disable line wrapping for SQLi buffers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1279
diff
changeset
|
3321 |
|
1323
08ca6cc08d2c
Send the current paragraph to the SQL process with \"explain \" keyword.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1322
diff
changeset
|
3322 |
(defun my-sql-explain-paragraph () |
08ca6cc08d2c
Send the current paragraph to the SQL process with \"explain \" keyword.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1322
diff
changeset
|
3323 |
"Send the current paragraph to the SQL process with \"explain \" keyword. |
08ca6cc08d2c
Send the current paragraph to the SQL process with \"explain \" keyword.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1322
diff
changeset
|
3324 |
Works at least for MySql/MariaDB." |
08ca6cc08d2c
Send the current paragraph to the SQL process with \"explain \" keyword.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1322
diff
changeset
|
3325 |
(interactive) |
08ca6cc08d2c
Send the current paragraph to the SQL process with \"explain \" keyword.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1322
diff
changeset
|
3326 |
(let ((start (save-excursion |
08ca6cc08d2c
Send the current paragraph to the SQL process with \"explain \" keyword.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1322
diff
changeset
|
3327 |
(backward-paragraph) |
08ca6cc08d2c
Send the current paragraph to the SQL process with \"explain \" keyword.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1322
diff
changeset
|
3328 |
(point))) |
08ca6cc08d2c
Send the current paragraph to the SQL process with \"explain \" keyword.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1322
diff
changeset
|
3329 |
(end (save-excursion |
08ca6cc08d2c
Send the current paragraph to the SQL process with \"explain \" keyword.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1322
diff
changeset
|
3330 |
(forward-paragraph) |
08ca6cc08d2c
Send the current paragraph to the SQL process with \"explain \" keyword.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1322
diff
changeset
|
3331 |
(point)))) |
08ca6cc08d2c
Send the current paragraph to the SQL process with \"explain \" keyword.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1322
diff
changeset
|
3332 |
(sql-send-string (concat "explain " (buffer-substring-no-properties start end))))) |
1326
7fc5b4f72144
Fix: Symbol's value as variable is void: sql-mode-map
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1325
diff
changeset
|
3333 |
|
7fc5b4f72144
Fix: Symbol's value as variable is void: sql-mode-map
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1325
diff
changeset
|
3334 |
(my--eval-after-load sql |
1323
08ca6cc08d2c
Send the current paragraph to the SQL process with \"explain \" keyword.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1322
diff
changeset
|
3335 |
(define-key sql-mode-map (kbd "C-c C-e") 'my-sql-explain-paragraph)) |
08ca6cc08d2c
Send the current paragraph to the SQL process with \"explain \" keyword.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1322
diff
changeset
|
3336 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
3337 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
3338 |
(message "backuping") |
0 | 3339 |
|
75
cd964a1d58b9
Use backup for files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
3340 |
(setq |
328
c770f75a351f
Set make-backup-files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
327
diff
changeset
|
3341 |
make-backup-files t |
374 | 3342 |
;; In other case (by renaming) you loose original file creation date. |
3343 |
backup-by-copying t |
|
1253
504c216e8d21
Move '.recentf' and '~/.irc' to '~/.emacs.d'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1240
diff
changeset
|
3344 |
backup-directory-alist '(("." . "~/.emacs.d/.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
|
3345 |
delete-old-versions t ; delete excess backup versions silently |
75
cd964a1d58b9
Use backup for files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
3346 |
kept-old-versions 1 ; store first original version |
cd964a1d58b9
Use backup for files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
3347 |
kept-new-versions 3 ; store last 3 version |
cd964a1d58b9
Use backup for files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
3348 |
version-control t) ; use versioned backups |
0 | 3349 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
3350 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
3351 |
(message "auto save") |
150 | 3352 |
|
3353 |
(setq auto-save-default t) |
|
3354 |
;; If nil autosave to different than original to buffer file. |
|
3355 |
(setq auto-save-visited-file-name nil) |
|
653
76d35d1516dc
Make auto-save-interval lager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
652
diff
changeset
|
3356 |
(setq auto-save-interval 300) |
150 | 3357 |
;; Note: if you kill unsaved file auto save file not deleted. |
3358 |
(setq delete-auto-save-files t) |
|
0 | 3359 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
3360 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
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
|
3361 |
;; Save and restore my buffers every time. |
766
31b6b63917df
Use different 'recentf' and 'desktop' files and do not enable
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
764
diff
changeset
|
3362 |
|
31b6b63917df
Use different 'recentf' and 'desktop' files and do not enable
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
764
diff
changeset
|
3363 |
(setq desktop-base-file-name ".emacs.desktop") |
31b6b63917df
Use different 'recentf' and 'desktop' files and do not enable
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
764
diff
changeset
|
3364 |
(setq desktop-base-lock-name ".emacs.desktop.lock") |
31b6b63917df
Use different 'recentf' and 'desktop' files and do not enable
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
764
diff
changeset
|
3365 |
(when (eq system-type 'cygwin) |
31b6b63917df
Use different 'recentf' and 'desktop' files and do not enable
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
764
diff
changeset
|
3366 |
(setq desktop-base-file-name ".emacs.desktop-cygwin") |
31b6b63917df
Use different 'recentf' and 'desktop' files and do not enable
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
764
diff
changeset
|
3367 |
(setq desktop-base-lock-name ".emacs.desktop-cygwin.lock") |
31b6b63917df
Use different 'recentf' and 'desktop' files and do not enable
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
764
diff
changeset
|
3368 |
) |
1215
c7e52e93465a
Move .emacs files to user-emacs-directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1210
diff
changeset
|
3369 |
(setq desktop-dirname user-emacs-directory) |
766
31b6b63917df
Use different 'recentf' and 'desktop' files and do not enable
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
764
diff
changeset
|
3370 |
|
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
|
3371 |
(when (>= emacs-major-version 22) |
1199
dff272add01e
Move all configs to "~/.emacs.d/my".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1197
diff
changeset
|
3372 |
(require 'desktop) |
dff272add01e
Move all configs to "~/.emacs.d/my".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1197
diff
changeset
|
3373 |
(add-to-list 'desktop-path desktop-dirname) |
1184
43925b28ed73
desktop-restore-frames == t set sticky on page/desktop attribute
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1183
diff
changeset
|
3374 |
(setq desktop-restore-frames nil) |
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
|
3375 |
(desktop-save-mode 1) |
914
0eccf022ee90
Fix: Symbol's value as variable is void: desktop-globals-to-save
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
913
diff
changeset
|
3376 |
(setq |
0eccf022ee90
Fix: Symbol's value as variable is void: desktop-globals-to-save
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
913
diff
changeset
|
3377 |
desktop-globals-to-save |
0eccf022ee90
Fix: Symbol's value as variable is void: desktop-globals-to-save
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
913
diff
changeset
|
3378 |
(append |
0eccf022ee90
Fix: Symbol's value as variable is void: desktop-globals-to-save
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
913
diff
changeset
|
3379 |
'((file-name-history . 100) |
0eccf022ee90
Fix: Symbol's value as variable is void: desktop-globals-to-save
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
913
diff
changeset
|
3380 |
(compile-history . 100) |
0eccf022ee90
Fix: Symbol's value as variable is void: desktop-globals-to-save
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
913
diff
changeset
|
3381 |
(command-history . 100) |
0eccf022ee90
Fix: Symbol's value as variable is void: desktop-globals-to-save
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
913
diff
changeset
|
3382 |
(extended-command-history . 100) |
0eccf022ee90
Fix: Symbol's value as variable is void: desktop-globals-to-save
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
913
diff
changeset
|
3383 |
(shell-command-history . 100) |
1332
860d51c43859
Save more desktop-globals-to-save options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1331
diff
changeset
|
3384 |
(search-ring . 20) |
914
0eccf022ee90
Fix: Symbol's value as variable is void: desktop-globals-to-save
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
913
diff
changeset
|
3385 |
(query-replace-history . 100) |
0eccf022ee90
Fix: Symbol's value as variable is void: desktop-globals-to-save
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
913
diff
changeset
|
3386 |
(regexp-history . 100) |
0eccf022ee90
Fix: Symbol's value as variable is void: desktop-globals-to-save
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
913
diff
changeset
|
3387 |
(grep-history . 100) |
1332
860d51c43859
Save more desktop-globals-to-save options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1331
diff
changeset
|
3388 |
(minibuffer-history . 100) |
860d51c43859
Save more desktop-globals-to-save options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1331
diff
changeset
|
3389 |
tags-file-name |
860d51c43859
Save more desktop-globals-to-save options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1331
diff
changeset
|
3390 |
register-alist) |
914
0eccf022ee90
Fix: Symbol's value as variable is void: desktop-globals-to-save
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
913
diff
changeset
|
3391 |
desktop-globals-to-save)) |
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
|
3392 |
) |
e8416d2b2f6a
Use c++-mode for JS files because of single char comment highlight but when
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
656
diff
changeset
|
3393 |
|
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
3394 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
545
24992bae7599
Use 'message' instead of comment to easy debug where error occurred.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
544
diff
changeset
|
3395 |
(message "User welcome msg") |
0 | 3396 |
|
250
ef1c7269280f
Show different messages on statup.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
249
diff
changeset
|
3397 |
(add-hook 'emacs-startup-hook |
ef1c7269280f
Show different messages on statup.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
249
diff
changeset
|
3398 |
(lambda () |
ef1c7269280f
Show different messages on statup.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
249
diff
changeset
|
3399 |
(let ( (mgs-list '("Welcome to emacs, the thermonuclear editor." |
ef1c7269280f
Show different messages on statup.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
249
diff
changeset
|
3400 |
"You enter to Out Space. Emacs on." |
ef1c7269280f
Show different messages on statup.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
249
diff
changeset
|
3401 |
"Nice day for Emacsing!")) ) |
ef1c7269280f
Show different messages on statup.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
249
diff
changeset
|
3402 |
(message (nth (random (length mgs-list)) mgs-list))))) |
0 | 3403 |
|
548
1bfa0cf51c9c
Set *Messages* buffer 'default-directory' to $HOME.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
547
diff
changeset
|
3404 |
(switch-to-buffer "*Messages*") |
1bfa0cf51c9c
Set *Messages* buffer 'default-directory' to $HOME.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
547
diff
changeset
|
3405 |
(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
|
3406 |
(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
|
3407 |
(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
|
3408 |
|
461
1639d2540bbd
Set outline-minor for file. Fix section to feet header outline pattern.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
460
diff
changeset
|
3409 |
;;; End loading... |
718
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
3410 |
|
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
3411 |
;; Local variables: |
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
3412 |
;; mode: outline-minor |
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
3413 |
;; outline-regexp: "(message \"" |
19ab21ec7640
Define own outline-regex to easy view file structure.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
717
diff
changeset
|
3414 |
;; End: |