author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Tue, 01 Mar 2011 17:05:20 +0200 | |
changeset 834 | 5bed6172a7c4 |
parent 826 | a89ae1fd97f5 |
child 838 | fadd85984a28 |
permissions | -rw-r--r-- |
179 | 1 |
-*- mode: outline; coding: utf-8 -*- |
18 | 2 |
|
688 | 3 |
* About. |
4 |
||
812 | 5 |
http://elpa.gnu.org/ |
6 |
Packages for Emacs. This requires Emacs version 24.1 or |
|
7 |
higher. |
|
8 |
||
9 |
* Getting help. |
|
10 |
||
688 | 11 |
http://news.gmane.org/gmane.emacs.help |
12 |
http://news.gmane.org/gmane.emacs.announce |
|
13 |
http://news.gmane.org/gmane.emacs.auctex.announce |
|
14 |
||
219
a6a5839b7423
Set variables in emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
182
diff
changeset
|
15 |
* Variables. |
a6a5839b7423
Set variables in emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
182
diff
changeset
|
16 |
|
a6a5839b7423
Set variables in emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
182
diff
changeset
|
17 |
Select one of: |
a6a5839b7423
Set variables in emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
182
diff
changeset
|
18 |
|
a6a5839b7423
Set variables in emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
182
diff
changeset
|
19 |
(set 'variable value) |
a6a5839b7423
Set variables in emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
182
diff
changeset
|
20 |
(setq variable value) |
a6a5839b7423
Set variables in emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
182
diff
changeset
|
21 |
(defvar variable value "documentation") |
a6a5839b7423
Set variables in emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
182
diff
changeset
|
22 |
|
268
b99a51c4e605
Emacs treat text as local variable definition, escape text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
225
diff
changeset
|
23 |
or (replace <colon> with :) |
219
a6a5839b7423
Set variables in emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
182
diff
changeset
|
24 |
|
268
b99a51c4e605
Emacs treat text as local variable definition, escape text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
225
diff
changeset
|
25 |
# Local variables<colon> |
b99a51c4e605
Emacs treat text as local variable definition, escape text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
225
diff
changeset
|
26 |
# variable<colon> value |
b99a51c4e605
Emacs treat text as local variable definition, escape text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
225
diff
changeset
|
27 |
# End<colon> |
219
a6a5839b7423
Set variables in emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
182
diff
changeset
|
28 |
|
171
8e806cddee36
Debugging emacs (about edebug).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
86
diff
changeset
|
29 |
* Debugging. |
8e806cddee36
Debugging emacs (about edebug).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
86
diff
changeset
|
30 |
|
799
4052d3b154d8
Evaluating elisp expression on the fly.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
798
diff
changeset
|
31 |
** Evaluating elisp expression on the fly. |
4052d3b154d8
Evaluating elisp expression on the fly.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
798
diff
changeset
|
32 |
|
4052d3b154d8
Evaluating elisp expression on the fly.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
798
diff
changeset
|
33 |
Type M-: than lisp expression than type RET. |
4052d3b154d8
Evaluating elisp expression on the fly.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
798
diff
changeset
|
34 |
|
4052d3b154d8
Evaluating elisp expression on the fly.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
798
diff
changeset
|
35 |
Or in any buffer place point at the end of lisp expression and type C-x C-e. |
4052d3b154d8
Evaluating elisp expression on the fly.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
798
diff
changeset
|
36 |
|
4052d3b154d8
Evaluating elisp expression on the fly.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
798
diff
changeset
|
37 |
Or invoke elisp "shell" by M-x ielm. |
4052d3b154d8
Evaluating elisp expression on the fly.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
798
diff
changeset
|
38 |
|
382
1f499471d603
What functions and variables Emacs load and from which files?
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
296
diff
changeset
|
39 |
** What functions and variables Emacs load and from which files? |
1f499471d603
What functions and variables Emacs load and from which files?
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
296
diff
changeset
|
40 |
|
1f499471d603
What functions and variables Emacs load and from which files?
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
296
diff
changeset
|
41 |
See value of variable 'load-history' (by C-h v load-history RET). |
1f499471d603
What functions and variables Emacs load and from which files?
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
296
diff
changeset
|
42 |
|
171
8e806cddee36
Debugging emacs (about edebug).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
86
diff
changeset
|
43 |
** Using edebug. |
8e806cddee36
Debugging emacs (about edebug).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
86
diff
changeset
|
44 |
|
177
02b79b857ee1
Use plain ascii chars instead of UTF-8.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
171
diff
changeset
|
45 |
Execute 'M-x edebug-defun' (also on 'C-u C-M-x') on defun in source code to |
171
8e806cddee36
Debugging emacs (about edebug).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
86
diff
changeset
|
46 |
enable debugging for desired function. When next time this function invoked |
213 | 47 |
you entered to its debugging (jumped to its source code). |
171
8e806cddee36
Debugging emacs (about edebug).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
86
diff
changeset
|
48 |
|
8e806cddee36
Debugging emacs (about edebug).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
86
diff
changeset
|
49 |
To start debug execute code which used debugged function. |
18 | 50 |
|
171
8e806cddee36
Debugging emacs (about edebug).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
86
diff
changeset
|
51 |
You can disable edebug on a function by evaluating the function again using |
177
02b79b857ee1
Use plain ascii chars instead of UTF-8.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
171
diff
changeset
|
52 |
'C-M-x'. |
171
8e806cddee36
Debugging emacs (about edebug).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
86
diff
changeset
|
53 |
|
8e806cddee36
Debugging emacs (about edebug).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
86
diff
changeset
|
54 |
** How debug func? |
8e806cddee36
Debugging emacs (about edebug).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
86
diff
changeset
|
55 |
|
8e806cddee36
Debugging emacs (about edebug).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
86
diff
changeset
|
56 |
Use M-x debug-on-entry and M-x cancel-debug-on-entry to control |
8e806cddee36
Debugging emacs (about edebug).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
86
diff
changeset
|
57 |
which functions will enter the debugger when called. |
8e806cddee36
Debugging emacs (about edebug).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
86
diff
changeset
|
58 |
|
8e806cddee36
Debugging emacs (about edebug).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
86
diff
changeset
|
59 |
When next time that function called automatically loaded debug-mode. |
8e806cddee36
Debugging emacs (about edebug).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
86
diff
changeset
|
60 |
|
8e806cddee36
Debugging emacs (about edebug).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
86
diff
changeset
|
61 |
** How debug ini file? |
18 | 62 |
|
213 | 63 |
When your ini has a bug, or when you load external files that cause |
18 | 64 |
errors, the bug is often hard to find, because the Emacs Lisp reader does not |
179 | 65 |
know about line numbers and files - it just knows an error happened, and |
66 |
that's it. |
|
18 | 67 |
|
585
c7b268051d29
Run Emacs with '--debug-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
528
diff
changeset
|
68 |
Try run Emacs with '--debug-init' to see backtrace. |
c7b268051d29
Run Emacs with '--debug-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
528
diff
changeset
|
69 |
|
528
8d0e582bca90
How debug long running command?
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
516
diff
changeset
|
70 |
** How debug long running command? |
8d0e582bca90
How debug long running command?
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
516
diff
changeset
|
71 |
|
8d0e582bca90
How debug long running command?
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
516
diff
changeset
|
72 |
M-x debug-on-quit RET' and then just hit `C-g' next time it gets 'stuck' somewhere. |
8d0e582bca90
How debug long running command?
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
516
diff
changeset
|
73 |
|
797
11928bb0b66d
Fix section level. Write about '-Q' and '--debug-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
782
diff
changeset
|
74 |
** Check if bug in ini file not in Emacs itself. |
415
3ae537fcc132
Check if bug in ini file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
382
diff
changeset
|
75 |
|
3ae537fcc132
Check if bug in ini file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
382
diff
changeset
|
76 |
First run Emacs without loading anything: |
3ae537fcc132
Check if bug in ini file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
382
diff
changeset
|
77 |
|
3ae537fcc132
Check if bug in ini file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
382
diff
changeset
|
78 |
$ emacs --no-init-file --no-site-file |
3ae537fcc132
Check if bug in ini file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
382
diff
changeset
|
79 |
|
797
11928bb0b66d
Fix section level. Write about '-Q' and '--debug-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
782
diff
changeset
|
80 |
or more shortly (as '-Q' imply '-q', '--no-site-file', and '--no-splash' |
11928bb0b66d
Fix section level. Write about '-Q' and '--debug-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
782
diff
changeset
|
81 |
together): |
11928bb0b66d
Fix section level. Write about '-Q' and '--debug-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
782
diff
changeset
|
82 |
|
11928bb0b66d
Fix section level. Write about '-Q' and '--debug-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
782
diff
changeset
|
83 |
$ emacs -Q |
11928bb0b66d
Fix section level. Write about '-Q' and '--debug-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
782
diff
changeset
|
84 |
|
415
3ae537fcc132
Check if bug in ini file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
382
diff
changeset
|
85 |
If bug not reproduced bug lies in ini files! |
3ae537fcc132
Check if bug in ini file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
382
diff
changeset
|
86 |
|
797
11928bb0b66d
Fix section level. Write about '-Q' and '--debug-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
782
diff
changeset
|
87 |
** Debug by binary search. |
18 | 88 |
|
86
72175e4fc069
Reformat and add CLI switches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
44
diff
changeset
|
89 |
Select half of the file in a region, and M-x eval-region. Depending on whether |
72175e4fc069
Reformat and add CLI switches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
44
diff
changeset
|
90 |
that causes the error or not, split this half or the other half again, and |
72175e4fc069
Reformat and add CLI switches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
44
diff
changeset
|
91 |
repeat. |
72175e4fc069
Reformat and add CLI switches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
44
diff
changeset
|
92 |
|
798
c5cff695aec7
Move section to proper place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
797
diff
changeset
|
93 |
*** Simplified Binary Search. |
c5cff695aec7
Move section to proper place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
797
diff
changeset
|
94 |
|
c5cff695aec7
Move section to proper place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
797
diff
changeset
|
95 |
Add (error 'No error until here') in the middle of your file. If you get the |
c5cff695aec7
Move section to proper place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
797
diff
changeset
|
96 |
error 'No error until here' when reloading the file, move the expression |
c5cff695aec7
Move section to proper place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
797
diff
changeset
|
97 |
towards the back of the file, otherwise towards the front of the file. |
c5cff695aec7
Move section to proper place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
797
diff
changeset
|
98 |
|
797
11928bb0b66d
Fix section level. Write about '-Q' and '--debug-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
782
diff
changeset
|
99 |
** Elisp debug tips. |
18 | 100 |
|
86
72175e4fc069
Reformat and add CLI switches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
44
diff
changeset
|
101 |
- Use a keyboard macro that moves forward one expression (sexp) and evaluates |
72175e4fc069
Reformat and add CLI switches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
44
diff
changeset
|
102 |
it. |
72175e4fc069
Reformat and add CLI switches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
44
diff
changeset
|
103 |
- Try C-x check-parens. |
797
11928bb0b66d
Fix section level. Write about '-Q' and '--debug-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
782
diff
changeset
|
104 |
|
11928bb0b66d
Fix section level. Write about '-Q' and '--debug-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
782
diff
changeset
|
105 |
** Enable debug mode (also on loading). |
11928bb0b66d
Fix section level. Write about '-Q' and '--debug-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
782
diff
changeset
|
106 |
|
11928bb0b66d
Fix section level. Write about '-Q' and '--debug-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
782
diff
changeset
|
107 |
Set in source |
11928bb0b66d
Fix section level. Write about '-Q' and '--debug-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
782
diff
changeset
|
108 |
|
11928bb0b66d
Fix section level. Write about '-Q' and '--debug-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
782
diff
changeset
|
109 |
(setq debug-on-error t) |
86
72175e4fc069
Reformat and add CLI switches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
44
diff
changeset
|
110 |
|
797
11928bb0b66d
Fix section level. Write about '-Q' and '--debug-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
782
diff
changeset
|
111 |
or invoke Emacs like: |
11928bb0b66d
Fix section level. Write about '-Q' and '--debug-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
782
diff
changeset
|
112 |
|
11928bb0b66d
Fix section level. Write about '-Q' and '--debug-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
782
diff
changeset
|
113 |
$ emacs --debug-init |
18 | 114 |
|
797
11928bb0b66d
Fix section level. Write about '-Q' and '--debug-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
782
diff
changeset
|
115 |
'--debug-init' which binds 'debug-on-error' to 't' while loading the init |
11928bb0b66d
Fix section level. Write about '-Q' and '--debug-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
782
diff
changeset
|
116 |
file, and bypasses the `condition-case' which normally catches errors in the |
11928bb0b66d
Fix section level. Write about '-Q' and '--debug-init'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
782
diff
changeset
|
117 |
init file. |
86
72175e4fc069
Reformat and add CLI switches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
44
diff
changeset
|
118 |
|
223 | 119 |
** Call tree. |
120 |
||
121 |
Before byte compiling file execute |
|
122 |
||
123 |
(setq byte-compile-generate-call-tree t) |
|
124 |
||
782
bfd7453296ca
Veiw buffer local variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
777
diff
changeset
|
125 |
** Veiw buffer local variables. |
bfd7453296ca
Veiw buffer local variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
777
diff
changeset
|
126 |
|
bfd7453296ca
Veiw buffer local variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
777
diff
changeset
|
127 |
(pp (buffer-local-variables)) |
bfd7453296ca
Veiw buffer local variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
777
diff
changeset
|
128 |
|
776 | 129 |
* Emacs profiling. |
130 |
||
131 |
** benchmark.el. |
|
132 |
||
133 |
(benchmark-run 1 (revert-buffer)) |
|
134 |
||
135 |
** elp.el. |
|
136 |
||
137 |
Enter a prefix for 'M-x elp-instrument-package', perform action and see result |
|
804
8abdb87eede7
To perform new measurement.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
799
diff
changeset
|
138 |
by 'M-x elp-results'. To perform new measurement don't forget to run 'M-x |
8abdb87eede7
To perform new measurement.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
799
diff
changeset
|
139 |
elp-reset-all'. |
776 | 140 |
|
181
4202927c15ac
Text based WWW browser for emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
86
diff
changeset
|
141 |
* WWW. |
4202927c15ac
Text based WWW browser for emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
86
diff
changeset
|
142 |
|
4202927c15ac
Text based WWW browser for emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
86
diff
changeset
|
143 |
** Text based WWW browser. |
4202927c15ac
Text based WWW browser for emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
86
diff
changeset
|
144 |
|
4202927c15ac
Text based WWW browser for emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
86
diff
changeset
|
145 |
http://en.wikipedia.org/wiki/W3m |
4202927c15ac
Text based WWW browser for emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
86
diff
changeset
|
146 |
http://emacs-w3m.namazu.org/ |
4202927c15ac
Text based WWW browser for emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
86
diff
changeset
|
147 |
http://www.gnu.org/software/w3/ |
212
5715a5193fd4
Sort and uniquify lines.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
182
diff
changeset
|
148 |
|
5715a5193fd4
Sort and uniquify lines.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
182
diff
changeset
|
149 |
* Tricks. |
5715a5193fd4
Sort and uniquify lines.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
182
diff
changeset
|
150 |
|
5715a5193fd4
Sort and uniquify lines.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
182
diff
changeset
|
151 |
** Sort and uniquify lines. |
5715a5193fd4
Sort and uniquify lines.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
182
diff
changeset
|
152 |
|
5715a5193fd4
Sort and uniquify lines.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
182
diff
changeset
|
153 |
Select region, type C-u M-| sort -u RET. |
5715a5193fd4
Sort and uniquify lines.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
182
diff
changeset
|
154 |
|
5715a5193fd4
Sort and uniquify lines.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
182
diff
changeset
|
155 |
With transient-mark-mode and delete-selection-mode enabled: select region, |
5715a5193fd4
Sort and uniquify lines.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
182
diff
changeset
|
156 |
type M-| sort -u RET to replace selection with sorted and uniquified lines. |
5715a5193fd4
Sort and uniquify lines.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
182
diff
changeset
|
157 |
|
499
ab94e51efbc6
Determining running environment/platform.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
478
diff
changeset
|
158 |
** Determining running environment/platform. |
472 | 159 |
|
499
ab94e51efbc6
Determining running environment/platform.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
478
diff
changeset
|
160 |
Check variables: |
472 | 161 |
|
477
88bb97fd33c5
Determining running environment.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
472
diff
changeset
|
162 |
emacs-major-version |
88bb97fd33c5
Determining running environment.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
472
diff
changeset
|
163 |
emacs-minor-version |
500
0126175e6252
Reindent and make more doc for some variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
499
diff
changeset
|
164 |
window-system - 'nil' if in terminal, 'w32' if native Windows build, 'x' if under X Window |
0126175e6252
Reindent and make more doc for some variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
499
diff
changeset
|
165 |
window-system-version - for windows only |
807 | 166 |
window-size-fixed |
500
0126175e6252
Reindent and make more doc for some variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
499
diff
changeset
|
167 |
operating-system-release - release of the operating system Emacs is running on |
0126175e6252
Reindent and make more doc for some variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
499
diff
changeset
|
168 |
system-configuration - like configuration triplet: cpu-manufacturer-os |
806
3ebfc31f15d5
system-configuration-options
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
799
diff
changeset
|
169 |
system-configuration-options |
500
0126175e6252
Reindent and make more doc for some variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
499
diff
changeset
|
170 |
system-name - host name of the machine you are running on |
477
88bb97fd33c5
Determining running environment.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
472
diff
changeset
|
171 |
system-time-locale |
500
0126175e6252
Reindent and make more doc for some variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
499
diff
changeset
|
172 |
system-type - indicating the type of operating system you are using: |
0126175e6252
Reindent and make more doc for some variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
499
diff
changeset
|
173 |
'gnu' (GNU Hurd), 'gnu/linux', 'gnu/kfreebsd' (FreeBSD), |
0126175e6252
Reindent and make more doc for some variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
499
diff
changeset
|
174 |
'darwin' (GNU-Darwin, Mac OS X), 'ms-dos', 'windows-nt', 'cygwin' |
477
88bb97fd33c5
Determining running environment.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
472
diff
changeset
|
175 |
system-uses-terminfo |
807 | 176 |
dynamic-library-alist or deprecated image-library-alist |
177 |
- alist of image types vs external libraries needed to display them |
|
472 | 178 |
|
502 | 179 |
and check functions: |
499
ab94e51efbc6
Determining running environment/platform.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
478
diff
changeset
|
180 |
|
ab94e51efbc6
Determining running environment/platform.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
478
diff
changeset
|
181 |
(fboundp ...) - return t if SYMBOL's function definition is not void |
ab94e51efbc6
Determining running environment/platform.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
478
diff
changeset
|
182 |
(featurep ...) - returns t if FEATURE is present in this Emacs |
ab94e51efbc6
Determining running environment/platform.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
478
diff
changeset
|
183 |
(display-graphic-p) - return non-nil if DISPLAY is a graphic display; graphical |
ab94e51efbc6
Determining running environment/platform.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
478
diff
changeset
|
184 |
displays are those which are capable of displaying several |
ab94e51efbc6
Determining running environment/platform.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
478
diff
changeset
|
185 |
frames and several different fonts at once |
ab94e51efbc6
Determining running environment/platform.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
478
diff
changeset
|
186 |
(display-multi-font-p) - same as 'display-graphic-p' |
ab94e51efbc6
Determining running environment/platform.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
478
diff
changeset
|
187 |
(display-multi-frame-p) - same as 'display-graphic-p' |
ab94e51efbc6
Determining running environment/platform.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
478
diff
changeset
|
188 |
(display-color-p) - return t if DISPLAY supports color |
ab94e51efbc6
Determining running environment/platform.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
478
diff
changeset
|
189 |
(display-images-p) - return non-nil if DISPLAY can display images |
ab94e51efbc6
Determining running environment/platform.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
478
diff
changeset
|
190 |
(display-grayscale-p) - return non-nil if frames on DISPLAY can display shades of gray |
ab94e51efbc6
Determining running environment/platform.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
478
diff
changeset
|
191 |
(display-mouse-p) - return non-nil if DISPLAY has a mouse available |
ab94e51efbc6
Determining running environment/platform.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
478
diff
changeset
|
192 |
(display-popup-menus-p) - return non-nil if popup menus are supported on DISPLAY |
ab94e51efbc6
Determining running environment/platform.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
478
diff
changeset
|
193 |
(display-selections-p) - return non-nil if DISPLAY supports selections |
ab94e51efbc6
Determining running environment/platform.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
478
diff
changeset
|
194 |
|
ab94e51efbc6
Determining running environment/platform.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
478
diff
changeset
|
195 |
Run those checks as below: |
472 | 196 |
|
197 |
(when window-system ...) |
|
198 |
(when (eq window-system 'x) ...) |
|
199 |
(when (>= emacs-major-version 22) ...) |
|
200 |
(when (fboundp '...) ...) |
|
201 |
(when (featurep '...) ...) |
|
202 |
||
269
77c8799aa8de
Finding emacs packages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
268
diff
changeset
|
203 |
* Finding emacs packages. |
77c8799aa8de
Finding emacs packages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
268
diff
changeset
|
204 |
|
77c8799aa8de
Finding emacs packages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
268
diff
changeset
|
205 |
See |
77c8799aa8de
Finding emacs packages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
268
diff
changeset
|
206 |
|
77c8799aa8de
Finding emacs packages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
268
diff
changeset
|
207 |
http://anc.ed.ac.uk/~stephen/emacs/ell.html |
77c8799aa8de
Finding emacs packages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
268
diff
changeset
|
208 |
http://www.emacswiki.org/emacs/WikifiedEmacsLispList |
296 | 209 |
http://tromey.com/elpa/index.html |
210 |
Emacs Lisp Package Archive |
|
211 |
||
212 |
** ELPA. |
|
213 |
||
214 |
ELPA goal is to make it simple to install, use, and upgrade Emacs Lisp |
|
215 |
packages. |
|
216 |
||
217 |
http://tromey.com/elpa/upload.html |
|
218 |
how to contribute |
|
270 | 219 |
|
220 |
* Compiling emacs. |
|
221 |
||
222 |
** Windows. |
|
223 |
||
224 |
Get MSYS for POSIX shell and utilities . Get MinGW for GCC. Get Gnuwin32 for |
|
225 |
jpeg, ungif, tiff, xpm, png, zlib libraries. |
|
226 |
||
227 |
Read emacs/nt/INSTALL. |
|
228 |
||
229 |
$ cmd |
|
230 |
$ cd emacs\nt |
|
275
3b1d21da03e3
Correct configure.bat options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
270
diff
changeset
|
231 |
$ configure.bat --prefix %INST_ROOT% --with-gcc --cflags -I%GNUWIN32_ROOT%/include --ldflags -L%GNUWIN32_ROOT%/lib --ldflags -lregex |
270 | 232 |
$ make bootstrap |
233 |
$ make info |
|
234 |
$ make install |
|
280 | 235 |
|
236 |
* Documentation. |
|
237 |
||
238 |
** Elisp documentation. |
|
239 |
||
283
74036be9b6f9
Elisp documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
280
diff
changeset
|
240 |
;;; <file-name>.el --- <one-line-description> |
74036be9b6f9
Elisp documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
280
diff
changeset
|
241 |
|
74036be9b6f9
Elisp documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
280
diff
changeset
|
242 |
;; Copyright (C) <years> <person> |
74036be9b6f9
Elisp documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
280
diff
changeset
|
243 |
|
74036be9b6f9
Elisp documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
280
diff
changeset
|
244 |
;; Author: <person> <mail> |
74036be9b6f9
Elisp documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
280
diff
changeset
|
245 |
;; Maintainer: <person> <mail> |
74036be9b6f9
Elisp documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
280
diff
changeset
|
246 |
;; Created: <date> |
74036be9b6f9
Elisp documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
280
diff
changeset
|
247 |
;; Version: <version> |
74036be9b6f9
Elisp documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
280
diff
changeset
|
248 |
;; Keywords: <look for 'finder-by-keyword' output, separate by comma> |
74036be9b6f9
Elisp documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
280
diff
changeset
|
249 |
;; URL: <file-location> |
74036be9b6f9
Elisp documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
280
diff
changeset
|
250 |
|
74036be9b6f9
Elisp documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
280
diff
changeset
|
251 |
;;; Commentary: |
74036be9b6f9
Elisp documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
280
diff
changeset
|
252 |
<bla-bla-bla> |
74036be9b6f9
Elisp documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
280
diff
changeset
|
253 |
;;; Code: |
74036be9b6f9
Elisp documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
280
diff
changeset
|
254 |
<lisp-code> |
74036be9b6f9
Elisp documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
280
diff
changeset
|
255 |
;;; <file-name> ends here |
74036be9b6f9
Elisp documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
280
diff
changeset
|
256 |
|
74036be9b6f9
Elisp documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
280
diff
changeset
|
257 |
See |
74036be9b6f9
Elisp documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
280
diff
changeset
|
258 |
|
74036be9b6f9
Elisp documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
280
diff
changeset
|
259 |
http://www.gnu.org/software/emacs/elisp-manual/html_node/Library-Headers.html |
280 | 260 |
http://www.emacswiki.org/cgi-bin/wiki/ElispAreaConventions |
261 |
||
262 |
*** CheckDoc. |
|
263 |
||
264 |
CheckDoc checks your EmacsLisp code for errors in documentation and style. |
|
265 |
||
266 |
http://cedet.sourceforge.net/checkdoc.shtml |
|
267 |
home page before including it into GNU Emacs |
|
268 |
http://www.emacswiki.org/emacs/CheckDoc |
|
454 | 269 |
|
270 |
* Installing Emacs. |
|
271 |
||
272 |
** From sources. |
|
273 |
||
274 |
http://ftp.gnu.org/pub/gnu/emacs |
|
275 |
||
276 |
** Windows. |
|
277 |
||
278 |
http://ftp.gnu.org/pub/gnu/emacs/windows |
|
279 |
http://alpha.gnu.org/gnu/emacs/windows |
|
280 |
beta releases for windows |
|
281 |
||
282 |
** Debian. |
|
283 |
||
284 |
$ apt-get install emacs |
|
472 | 285 |
|
286 |
* Emacs paths. |
|
287 |
||
288 |
source-directory data-directory doc-directory exec-directory invocation-directory trash-directory |
|
289 |
tutorial-directory user-emacs-directory widget-image-directory |
|
478 | 290 |
|
291 |
* Emacs games. |
|
292 |
||
293 |
hanoi hanoi-unix life pong tetris gomoku |
|
294 |
||
501 | 295 |
* Long lines. |
296 |
||
297 |
(setq longlines-show-hard-newlines t) |
|
298 |
(setq longlines-wrap-follows-window-size t) |
|
299 |
(longlines-mode 1) |
|
511
79d2735bd210
Printing Emacs structures.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
502
diff
changeset
|
300 |
|
79d2735bd210
Printing Emacs structures.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
502
diff
changeset
|
301 |
* Printing Emacs structures. |
79d2735bd210
Printing Emacs structures.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
502
diff
changeset
|
302 |
|
79d2735bd210
Printing Emacs structures.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
502
diff
changeset
|
303 |
(message "%S" '(a b 123 "hello" 'set)) |
79d2735bd210
Printing Emacs structures.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
502
diff
changeset
|
304 |
(pp '(a b 123 "hello" 'set)) |
512 | 305 |
|
306 |
* File manager. |
|
307 |
||
308 |
http://www.emacswiki.org/emacs/Sunrise_Commander |
|
513 | 309 |
|
310 |
* Semantic. |
|
311 |
||
312 |
semantic-lex-spp-describe |
|
313 |
Describe the current list of spp macros. |
|
314 |
semantic-lex-c-preprocessor-symbol-file |
|
315 |
List of C/C++ files that contain preprocessor macros for the C lexer. |
|
316 |
||
516 | 317 |
* Debugging C code. |
318 |
||
319 |
-*- mode: grep; mode: auto-revert-tail; default-directory: "~/devel/proj" -*- |
|
637 | 320 |
|
321 |
* XML modes. |
|
322 |
||
323 |
** XSLT-process. |
|
324 |
||
325 |
XSLT-process is a minor mode for GNU Emacs/XEmacs which transforms it into a powerful editor with |
|
326 |
XSLT processing and debugging capabilities. |
|
327 |
||
328 |
The mode currently supports two Java XSLT processors: |
|
329 |
||
330 |
* Saxon - fully supported, including debugging capabilities. |
|
331 |
* Xalan - fully supported, including debugging capabilities. |
|
332 |
||
333 |
http://xslt-process.sourceforge.net/ |
|
334 |
home page |
|
653
82f1a982109d
Useful program logging.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
637
diff
changeset
|
335 |
|
82f1a982109d
Useful program logging.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
637
diff
changeset
|
336 |
* Useful program logging. |
82f1a982109d
Useful program logging.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
637
diff
changeset
|
337 |
|
777
e759f98ea3a8
Useful program logging. Add info about grep-mode and logging format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
776
diff
changeset
|
338 |
Put first line to your log file, you must replace 'default-directory' to dir where you build |
e759f98ea3a8
Useful program logging. Add info about grep-mode and logging format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
776
diff
changeset
|
339 |
program: |
653
82f1a982109d
Useful program logging.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
637
diff
changeset
|
340 |
|
82f1a982109d
Useful program logging.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
637
diff
changeset
|
341 |
-*- mode: compilation-minor; mode: auto-revert-tail; default-directory: "~/devel/proj" -*- |
82f1a982109d
Useful program logging.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
637
diff
changeset
|
342 |
|
82f1a982109d
Useful program logging.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
637
diff
changeset
|
343 |
Program must use one of supported by 'compilation-minor-mode' (see |
82f1a982109d
Useful program logging.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
637
diff
changeset
|
344 |
'compilation-error-regexp-alist'), like: |
82f1a982109d
Useful program logging.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
637
diff
changeset
|
345 |
|
82f1a982109d
Useful program logging.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
637
diff
changeset
|
346 |
printf(__FILE__ ":%d: %s\n", __LINE__, msg); /* msg - user defined string */ |
82f1a982109d
Useful program logging.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
637
diff
changeset
|
347 |
|
777
e759f98ea3a8
Useful program logging. Add info about grep-mode and logging format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
776
diff
changeset
|
348 |
or in second form (in this case line number included in format string, so easy searchable in |
e759f98ea3a8
Useful program logging. Add info about grep-mode and logging format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
776
diff
changeset
|
349 |
debugger): |
e759f98ea3a8
Useful program logging. Add info about grep-mode and logging format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
776
diff
changeset
|
350 |
|
e759f98ea3a8
Useful program logging. Add info about grep-mode and logging format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
776
diff
changeset
|
351 |
#define NUM2STR(x) STR(x) |
e759f98ea3a8
Useful program logging. Add info about grep-mode and logging format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
776
diff
changeset
|
352 |
#define STR(x) #x |
e759f98ea3a8
Useful program logging. Add info about grep-mode and logging format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
776
diff
changeset
|
353 |
|
e759f98ea3a8
Useful program logging. Add info about grep-mode and logging format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
776
diff
changeset
|
354 |
printf(__FILE__ ":" NUM2STR(__LINE__) ": %s\n", msg); |
e759f98ea3a8
Useful program logging. Add info about grep-mode and logging format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
776
diff
changeset
|
355 |
|
e759f98ea3a8
Useful program logging. Add info about grep-mode and logging format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
776
diff
changeset
|
356 |
Or some faster use 'grep-mode', but you restricted with GNU like error format: |
e759f98ea3a8
Useful program logging. Add info about grep-mode and logging format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
776
diff
changeset
|
357 |
|
e759f98ea3a8
Useful program logging. Add info about grep-mode and logging format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
776
diff
changeset
|
358 |
-*- mode: grep; mode: auto-revert-tail; default-directory: "~/devel/proj" -*- |
e759f98ea3a8
Useful program logging. Add info about grep-mode and logging format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
776
diff
changeset
|
359 |
|
825 | 360 |
* Edit HTML. |
361 |
||
362 |
psgml-mode |
|
363 |
nxml-mode |
|
364 |
sgml-mode |
|
826 | 365 |
|
366 |
** html-helper-mode. |
|
367 |
||
368 |
Highlighting, autocompletion, and auto-insertion of closing tags. |
|
369 |
||
370 |
http://www.emacswiki.org/emacs/HtmlHelperMode |
|
371 |
http://savannah.nongnu.org/projects/baol-hth/ |
|
372 |
http://www.nongnu.org/baol-hth/ |
|
373 |