author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Sat, 10 Feb 2018 01:49:07 +0200 | |
changeset 2230 | 9e6ad6607a9e |
parent 2228 | 837f1337c59b |
permissions | -rw-r--r-- |
1142 | 1 |
.. -*- coding: utf-8; -*- |
2 |
||
3 |
======== |
|
4 |
Emacs. |
|
5 |
======== |
|
6 |
.. contents:: |
|
1905
fba288d59662
Include only local subsections into TOC. This prevent duplication of
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1654
diff
changeset
|
7 |
:local: |
1142 | 8 |
|
9 |
About. |
|
10 |
====== |
|
11 |
||
2228
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
12 |
http://elpa.gnu.org/ |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
13 |
Packages for Emacs. |
1142 | 14 |
|
15 |
Getting help. |
|
16 |
============= |
|
17 |
||
2228
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
18 |
* http://news.gmane.org/gmane.emacs.help |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
19 |
* http://news.gmane.org/gmane.emacs.announce |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
20 |
* http://news.gmane.org/gmane.emacs.auctex.announce |
1142 | 21 |
|
22 |
Installing Emacs. |
|
23 |
================= |
|
24 |
||
2228
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
25 |
http://ftp.gnu.org/gnu/emacs/windows/ |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
26 |
Official build of GNU Emacs for Windows. |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
27 |
http://alpha.gnu.org/gnu/emacs/windows/ |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
28 |
Official alpha build of GNU Emacs. |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
29 |
http://emacsformacosx.com/ |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
30 |
Clean GNU Emacs for Mac OS X. |
1142 | 31 |
|
1652
a653ec78b1b8
Find variable/function/feature by name or value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1477
diff
changeset
|
32 |
Development. |
a653ec78b1b8
Find variable/function/feature by name or value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1477
diff
changeset
|
33 |
============ |
a653ec78b1b8
Find variable/function/feature by name or value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1477
diff
changeset
|
34 |
|
1142 | 35 |
Variables. |
1652
a653ec78b1b8
Find variable/function/feature by name or value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1477
diff
changeset
|
36 |
---------- |
1142 | 37 |
|
38 |
Select one of:: |
|
39 |
||
40 |
(set 'variable value) |
|
41 |
(setq variable value) |
|
42 |
(defvar variable value "documentation") |
|
43 |
||
1652
a653ec78b1b8
Find variable/function/feature by name or value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1477
diff
changeset
|
44 |
or file local:: |
a653ec78b1b8
Find variable/function/feature by name or value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1477
diff
changeset
|
45 |
|
a653ec78b1b8
Find variable/function/feature by name or value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1477
diff
changeset
|
46 |
# Local variables: |
a653ec78b1b8
Find variable/function/feature by name or value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1477
diff
changeset
|
47 |
# variable: value |
a653ec78b1b8
Find variable/function/feature by name or value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1477
diff
changeset
|
48 |
# End: |
1142 | 49 |
|
1652
a653ec78b1b8
Find variable/function/feature by name or value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1477
diff
changeset
|
50 |
Find variable/function/feature by name or value. |
a653ec78b1b8
Find variable/function/feature by name or value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1477
diff
changeset
|
51 |
------------------------------------------------ |
a653ec78b1b8
Find variable/function/feature by name or value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1477
diff
changeset
|
52 |
:: |
a653ec78b1b8
Find variable/function/feature by name or value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1477
diff
changeset
|
53 |
|
a653ec78b1b8
Find variable/function/feature by name or value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1477
diff
changeset
|
54 |
(apropos-value "PATT") |
a653ec78b1b8
Find variable/function/feature by name or value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1477
diff
changeset
|
55 |
(apropos-variable "PATT") |
a653ec78b1b8
Find variable/function/feature by name or value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1477
diff
changeset
|
56 |
(apropos-function "PATT") |
a653ec78b1b8
Find variable/function/feature by name or value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1477
diff
changeset
|
57 |
(apropos-library "PATT") |
a653ec78b1b8
Find variable/function/feature by name or value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1477
diff
changeset
|
58 |
(apropos-documentation "PATT") |
1142 | 59 |
|
60 |
Debugging. |
|
61 |
========== |
|
62 |
||
63 |
Evaluating elisp expression on the fly. |
|
64 |
--------------------------------------- |
|
65 |
||
1477 | 66 |
Type ``M-:`` than lisp expression than type ``RET``. |
1142 | 67 |
|
1477 | 68 |
Or in any buffer place point at the end of lisp expression and type ``C-x C-e``. |
1142 | 69 |
|
1477 | 70 |
Or invoke elisp "shell" by ``M-x ielm``. |
1142 | 71 |
|
72 |
What functions and variables Emacs load and from which files? |
|
73 |
------------------------------------------------------------- |
|
74 |
||
1189 | 75 |
See value of variable ``load-history`` (by C-h v load-history RET):: |
76 |
||
1653
f9aae584ecb4
symbol-file, http://stackoverflow.com/a/27755252/173149
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1652
diff
changeset
|
77 |
(symbol-file 'scheme 'provide) ; Who provide feature. |
f9aae584ecb4
symbol-file, http://stackoverflow.com/a/27755252/173149
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1652
diff
changeset
|
78 |
(symbol-file 'nxml-mode-hook 'defvar) ; Where variable defined. |
f9aae584ecb4
symbol-file, http://stackoverflow.com/a/27755252/173149
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1652
diff
changeset
|
79 |
(symbol-file 'message-send 'defun) ; Where function defined. |
1654
f361c89e693f
Look for symbol despite its type.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1653
diff
changeset
|
80 |
(symbol-file 'scheme) ; Look for symbol despite its type. |
1476 | 81 |
load-history |
82 |
(locate-library "gnus.el") |
|
1653
f9aae584ecb4
symbol-file, http://stackoverflow.com/a/27755252/173149
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1652
diff
changeset
|
83 |
(find-lisp-object-file-name 'c-mode (symbol-function 'c-mode)) |
1142 | 84 |
|
85 |
Using edebug. |
|
86 |
------------- |
|
87 |
||
88 |
Execute ``M-x edebug-defun`` (also on ``C-u C-M-x``) on defun in source code to |
|
89 |
enable debugging for desired function. When next time this function invoked |
|
90 |
you entered to its debugging (jumped to its source code). |
|
91 |
||
92 |
To start debug execute code which used debugged function. |
|
93 |
||
94 |
You can disable edebug on a function by evaluating the function again using |
|
95 |
``C-M-x``. |
|
96 |
||
97 |
How debug func? |
|
98 |
--------------- |
|
99 |
||
2125 | 100 |
Use ``M-x debug-on-entry`` and ``M-x cancel-debug-on-entry`` to control which |
101 |
functions will enter the debugger when called. Next time that function loaded in |
|
102 |
debug-mode. |
|
1142 | 103 |
|
1274
3860a2e28d4d
How to print a trace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1266
diff
changeset
|
104 |
You can use ``(debug)`` in your function to automatically enter to debugger. |
3860a2e28d4d
How to print a trace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1266
diff
changeset
|
105 |
|
3860a2e28d4d
How to print a trace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1266
diff
changeset
|
106 |
You can use ``(backtrace)`` to print a trace of Lisp function. |
3860a2e28d4d
How to print a trace.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1266
diff
changeset
|
107 |
|
1142 | 108 |
How debug ini file? |
109 |
------------------- |
|
110 |
||
1477 | 111 |
When your ini has a bug, or when you load external files that cause errors, the |
112 |
bug is often hard to find, because the Emacs Lisp reader does not know about |
|
113 |
line numbers and files - it just knows an error happened, and that's it. |
|
1142 | 114 |
|
115 |
Try run Emacs with ``--debug-init`` to see backtrace. |
|
116 |
||
117 |
How debug long running command? |
|
118 |
------------------------------- |
|
119 |
||
2125 | 120 |
Remember Emacs elisp interpreter single threaded. To interrupt long running |
121 |
command press ``C-g``. Sometime it should be typed several times. |
|
122 |
||
123 |
On ``toggle-debug-on-quit`` or ``M-x debug-on-quit RET`` on ``C-g`` Emacs enter |
|
124 |
to debug mode. |
|
1142 | 125 |
|
126 |
Check if bug in ini file not in Emacs itself. |
|
127 |
--------------------------------------------- |
|
128 |
||
129 |
First run Emacs without loading anything:: |
|
130 |
||
131 |
$ emacs --no-init-file --no-site-file |
|
132 |
||
133 |
or more shortly (as ``-Q`` imply ``-q``, ``--no-site-file``, and ``--no-splash`` |
|
134 |
together):: |
|
135 |
||
136 |
$ emacs -Q |
|
137 |
||
138 |
If bug not reproduced bug lies in ini files! |
|
139 |
||
140 |
Debug by binary search. |
|
141 |
----------------------- |
|
142 |
||
143 |
Select half of the file in a region, and M-x eval-region. Depending on whether |
|
144 |
that causes the error or not, split this half or the other half again, and |
|
145 |
repeat. |
|
146 |
||
147 |
Simplified Binary Search. |
|
148 |
~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
149 |
||
150 |
Add (error ``No error until here``) in the middle of your file. If you get the |
|
151 |
error ``No error until here`` when reloading the file, move the expression |
|
152 |
towards the back of the file, otherwise towards the front of the file. |
|
153 |
||
154 |
Elisp debug tips. |
|
155 |
----------------- |
|
156 |
||
2228
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
157 |
* Use a keyboard macro that moves forward one expression (sexp) and evaluates it. |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
158 |
* Try C-x check-parens. |
1142 | 159 |
|
160 |
Enable debug mode (also on loading). |
|
161 |
------------------------------------ |
|
162 |
||
163 |
Set in source:: |
|
164 |
||
165 |
(setq debug-on-error t) |
|
166 |
||
167 |
or invoke Emacs like:: |
|
168 |
||
169 |
$ emacs --debug-init |
|
170 |
||
171 |
where ``--debug-init`` binds ``debug-on-error`` to ``t`` while loading the init |
|
172 |
file, and bypasses the ``condition-case`` which normally catches errors in the |
|
173 |
init file. |
|
174 |
||
175 |
Call tree. |
|
176 |
---------- |
|
177 |
||
178 |
Before byte compiling file execute:: |
|
179 |
||
180 |
(setq byte-compile-generate-call-tree t) |
|
181 |
||
182 |
Veiw buffer local variables. |
|
183 |
---------------------------- |
|
184 |
:: |
|
185 |
||
186 |
(pp (buffer-local-variables)) |
|
187 |
||
188 |
Emacs profiling. |
|
189 |
================ |
|
190 |
||
1952
b01bfc6caae7
Emacs profiling with edebug.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1945
diff
changeset
|
191 |
edebug |
b01bfc6caae7
Emacs profiling with edebug.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1945
diff
changeset
|
192 |
------ |
b01bfc6caae7
Emacs profiling with edebug.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1945
diff
changeset
|
193 |
|
b01bfc6caae7
Emacs profiling with edebug.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1945
diff
changeset
|
194 |
``edebug`` allow save execution statistic on per line basis. As usual evaluate |
b01bfc6caae7
Emacs profiling with edebug.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1945
diff
changeset
|
195 |
``C-u M-S-x`` (or ``M-x edebug-defun``) on top lovel functional form. Call code |
b01bfc6caae7
Emacs profiling with edebug.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1945
diff
changeset
|
196 |
that uses examined function. On entry to ``edebug`` type ``c`` |
b01bfc6caae7
Emacs profiling with edebug.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1945
diff
changeset
|
197 |
(``edebug-continue-mode``). After finishing evaluation place cursor to examined |
b01bfc6caae7
Emacs profiling with edebug.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1945
diff
changeset
|
198 |
function form and evaluate ``M-x edebug-display-freq-count``. Function be |
b01bfc6caae7
Emacs profiling with edebug.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1945
diff
changeset
|
199 |
annotated with evaluation counts per line. |
b01bfc6caae7
Emacs profiling with edebug.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1945
diff
changeset
|
200 |
|
b01bfc6caae7
Emacs profiling with edebug.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1945
diff
changeset
|
201 |
benchmark.el |
b01bfc6caae7
Emacs profiling with edebug.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1945
diff
changeset
|
202 |
------------ |
1142 | 203 |
:: |
204 |
||
205 |
(benchmark-run 1 (revert-buffer)) |
|
1207 | 206 |
(benchmark-run-compiled 1 (hi-lock-face-phrase-buffer "hello" 'hi-yellow)) |
1142 | 207 |
|
1952
b01bfc6caae7
Emacs profiling with edebug.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1945
diff
changeset
|
208 |
elp.el |
b01bfc6caae7
Emacs profiling with edebug.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1945
diff
changeset
|
209 |
------ |
1142 | 210 |
|
211 |
Enter a prefix for ``M-x elp-instrument-package``, perform action and see result |
|
212 |
by ``M-x elp-results``. To perform new measurement don't forget to run |
|
213 |
``M-x elp-reset-all``. |
|
214 |
||
1945
dbcf75d07a68
Validating Elisp code
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
215 |
Validating Elisp code |
dbcf75d07a68
Validating Elisp code
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
216 |
===================== |
dbcf75d07a68
Validating Elisp code
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
217 |
:: |
dbcf75d07a68
Validating Elisp code
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
218 |
|
dbcf75d07a68
Validating Elisp code
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
219 |
(checkdoc) |
dbcf75d07a68
Validating Elisp code
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
220 |
(byte-compile-file (buffer-file-name)) |
dbcf75d07a68
Validating Elisp code
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
221 |
(package-buffer-info) |
dbcf75d07a68
Validating Elisp code
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
222 |
|
1142 | 223 |
WWW. |
224 |
==== |
|
225 |
||
226 |
Text based WWW browser. |
|
227 |
----------------------- |
|
228 |
||
2228
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
229 |
* http://en.wikipedia.org/wiki/W3m |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
230 |
* http://emacs-w3m.namazu.org/ |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
231 |
* http://www.gnu.org/software/w3/ |
1142 | 232 |
|
233 |
Tricks. |
|
234 |
======= |
|
235 |
||
236 |
Sort and uniquify lines. |
|
237 |
------------------------ |
|
238 |
||
239 |
Select region, type ``C-u M-| sort -u RET``. |
|
240 |
||
241 |
With transient-mark-mode and delete-selection-mode enabled: select region, |
|
242 |
type M-| sort -u RET to replace selection with sorted and uniquified lines. |
|
243 |
||
244 |
Determining running environment/platform. |
|
245 |
========================================= |
|
246 |
||
247 |
Check variables:: |
|
248 |
||
249 |
emacs-major-version |
|
250 |
emacs-minor-version |
|
251 |
window-system - ``nil`` if in terminal, ``w32`` if native Windows build, ``x`` if under X Window |
|
252 |
window-system-version - for windows only |
|
253 |
window-size-fixed |
|
254 |
operating-system-release - release of the operating system Emacs is running on |
|
255 |
system-configuration - like configuration triplet: cpu-manufacturer-os |
|
256 |
system-configuration-options |
|
257 |
system-name - host name of the machine you are running on |
|
258 |
system-time-locale |
|
259 |
system-type - indicating the type of operating system you are using: |
|
260 |
``gnu`` (GNU Hurd), |
|
261 |
``gnu/linux``, |
|
262 |
``gnu/kfreebsd``, ``berkeley-unix`` for (FreeBSD), |
|
263 |
``darwin`` (GNU-Darwin, Mac OS X), |
|
264 |
``ms-dos``, |
|
265 |
``windows-nt``, |
|
266 |
``cygwin`` |
|
267 |
system-uses-terminfo |
|
268 |
dynamic-library-alist or deprecated image-library-alist |
|
269 |
- alist of image types vs external libraries needed to display them |
|
270 |
||
271 |
and check functions:: |
|
272 |
||
273 |
(fboundp ...) - return t if SYMBOL's function definition is not void |
|
274 |
(featurep ...) - returns t if FEATURE is present in this Emacs |
|
275 |
(display-graphic-p) - return non-nil if DISPLAY is a graphic display; graphical |
|
276 |
displays are those which are capable of displaying several |
|
277 |
frames and several different fonts at once |
|
278 |
(display-multi-font-p) - same as ``display-graphic-p`` |
|
279 |
(display-multi-frame-p) - same as ``display-graphic-p`` |
|
280 |
(display-color-p) - return t if DISPLAY supports color |
|
281 |
(display-images-p) - return non-nil if DISPLAY can display images |
|
282 |
(display-grayscale-p) - return non-nil if frames on DISPLAY can display shades of gray |
|
283 |
(display-mouse-p) - return non-nil if DISPLAY has a mouse available |
|
284 |
(display-popup-menus-p) - return non-nil if popup menus are supported on DISPLAY |
|
285 |
(display-selections-p) - return non-nil if DISPLAY supports selections |
|
286 |
||
287 |
Run those checks as below:: |
|
288 |
||
289 |
(when window-system ...) |
|
290 |
(when (eq window-system 'x) ...) |
|
291 |
(when (>= emacs-major-version 22) ...) |
|
292 |
(when (fboundp '...) ...) |
|
293 |
(when (featurep '...) ...) |
|
294 |
||
295 |
Compiling emacs. |
|
296 |
================ |
|
297 |
||
298 |
Windows. |
|
299 |
-------- |
|
300 |
||
301 |
Get MSYS for POSIX shell and utilities . Get MinGW for GCC. Get Gnuwin32 for |
|
302 |
jpeg, ungif, tiff, xpm, png, zlib libraries. |
|
303 |
||
304 |
Read emacs/nt/INSTALL:: |
|
305 |
||
306 |
$ cmd |
|
307 |
$ cd emacs\nt |
|
308 |
$ configure.bat --prefix %INST_ROOT% --with-gcc --cflags -I%GNUWIN32_ROOT%/include --ldflags -L%GNUWIN32_ROOT%/lib --ldflags -lregex |
|
309 |
$ make bootstrap |
|
310 |
$ make info |
|
311 |
$ make install |
|
312 |
||
313 |
Documentation. |
|
314 |
============== |
|
315 |
||
316 |
Elisp documentation. |
|
317 |
-------------------- |
|
318 |
:: |
|
319 |
||
320 |
;;; <file-name>.el --- <one-line-description> |
|
321 |
||
322 |
;; Copyright (C) <years> <person> |
|
323 |
||
324 |
;; Author: <person> <mail> |
|
325 |
;; Maintainer: <person> <mail> |
|
326 |
;; Created: <date> |
|
327 |
;; Version: <version> |
|
328 |
;; Keywords: <look for ``finder-by-keyword`` output, separate by comma> |
|
329 |
;; URL: <file-location> |
|
330 |
||
331 |
;;; Commentary: |
|
332 |
<bla-bla-bla> |
|
333 |
;;; Code: |
|
334 |
<lisp-code> |
|
335 |
;;; <file-name> ends here |
|
336 |
||
337 |
See |
|
338 |
||
2228
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
339 |
* http://www.gnu.org/software/emacs/elisp-manual/html_node/Library-Headers.html |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
340 |
* http://www.emacswiki.org/cgi-bin/wiki/ElispAreaConventions |
1142 | 341 |
|
342 |
CheckDoc. |
|
343 |
--------- |
|
344 |
||
345 |
CheckDoc checks your EmacsLisp code for errors in documentation and style. |
|
346 |
||
2228
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
347 |
http://cedet.sourceforge.net/checkdoc.shtml |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
348 |
home page before including it into GNU Emacs |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
349 |
http://www.emacswiki.org/emacs/CheckDoc |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
350 |
CheckDoc |
1142 | 351 |
|
352 |
Installing Emacs. |
|
353 |
================= |
|
354 |
||
355 |
From sources. |
|
356 |
------------- |
|
357 |
||
2228
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
358 |
* http://ftp.gnu.org/pub/gnu/emacs |
1142 | 359 |
|
360 |
Windows. |
|
361 |
-------- |
|
362 |
||
2228
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
363 |
http://ftp.gnu.org/pub/gnu/emacs/windows |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
364 |
Releases for Windows. |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
365 |
http://alpha.gnu.org/gnu/emacs/windows |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
366 |
Beta releases for Windows. |
1142 | 367 |
|
368 |
Debian. |
|
369 |
------- |
|
370 |
:: |
|
371 |
||
372 |
$ apt-get install emacs |
|
373 |
||
374 |
Emacs paths. |
|
375 |
============ |
|
376 |
:: |
|
377 |
||
378 |
source-directory data-directory doc-directory exec-directory |
|
379 |
invocation-directory trash-directory tutorial-directory user-emacs-directory |
|
380 |
widget-image-directory |
|
381 |
||
382 |
Emacs games. |
|
383 |
============ |
|
384 |
:: |
|
385 |
||
386 |
hanoi hanoi-unix life pong tetris gomoku |
|
387 |
||
388 |
Long lines. |
|
389 |
=========== |
|
1477 | 390 |
:: |
1142 | 391 |
|
392 |
(setq longlines-show-hard-newlines t) |
|
393 |
(setq longlines-wrap-follows-window-size t) |
|
394 |
(longlines-mode 1) |
|
395 |
||
396 |
Printing Emacs structures. |
|
397 |
========================== |
|
1477 | 398 |
:: |
1142 | 399 |
|
400 |
(message "%S" '(a b 123 "hello" 'set)) |
|
401 |
(pp '(a b 123 "hello" 'set)) |
|
402 |
(prin1-to-string '(1 2)) |
|
403 |
||
404 |
(symbol-name 'f) |
|
405 |
(symbol-value 'f) |
|
406 |
(symbol-function 'f) |
|
407 |
(symbol-plist 'f) |
|
408 |
||
1143
3a3389b22964
(local-variable-p var buffer)
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1142
diff
changeset
|
409 |
(local-variable-p var buffer) |
3a3389b22964
(local-variable-p var buffer)
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1142
diff
changeset
|
410 |
|
1142 | 411 |
File manager. |
412 |
============= |
|
413 |
||
2228
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
414 |
* http://www.emacswiki.org/emacs/Sunrise_Commander |
1142 | 415 |
|
416 |
Semantic. |
|
417 |
========= |
|
418 |
||
2228
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
419 |
semantic-lex-spp-describe |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
420 |
Describe the current list of spp macros. |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
421 |
semantic-lex-c-preprocessor-symbol-file |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
422 |
List of C/C++ files that contain preprocessor macros for the C lexer. |
1142 | 423 |
|
424 |
Debugging C code. |
|
425 |
================= |
|
1477 | 426 |
:: |
1142 | 427 |
|
428 |
-*- mode: grep; mode: auto-revert-tail; default-directory: "~/devel/proj" -*- |
|
429 |
||
430 |
XML modes. |
|
431 |
========== |
|
432 |
||
433 |
XSLT-process. |
|
434 |
------------- |
|
435 |
||
436 |
XSLT-process is a minor mode for GNU Emacs/XEmacs which transforms it into a powerful editor with |
|
437 |
XSLT processing and debugging capabilities. |
|
438 |
||
439 |
The mode currently supports two Java XSLT processors: |
|
440 |
||
2228
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
441 |
* Saxon - fully supported, including debugging capabilities. |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
442 |
* Xalan - fully supported, including debugging capabilities. |
1142 | 443 |
|
2228
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
444 |
http://xslt-process.sourceforge.net/ |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
445 |
home page |
1142 | 446 |
|
447 |
Useful program logging. |
|
448 |
======================= |
|
449 |
||
450 |
Put first line to your log file, you must replace ``default-directory`` to dir where you build |
|
451 |
program:: |
|
452 |
||
453 |
-*- mode: compilation-minor; mode: auto-revert-tail; default-directory: "~/devel/proj" -*- |
|
454 |
||
455 |
Program must use one of supported by ``compilation-minor-mode`` (see |
|
456 |
``compilation-error-regexp-alist``), like:: |
|
457 |
||
458 |
printf(__FILE__ ":%d: %s\n", __LINE__, msg); /* msg - user defined string */ |
|
459 |
||
460 |
or in second form (in this case line number included in format string, so easy searchable in |
|
461 |
debugger):: |
|
462 |
||
463 |
#define NUM2STR(x) STR(x) |
|
464 |
#define STR(x) #x |
|
465 |
||
466 |
printf(__FILE__ ":" NUM2STR(__LINE__) ": %s\n", msg); |
|
467 |
||
468 |
Or some faster use ``grep-mode``, but you restricted with GNU like error format:: |
|
469 |
||
470 |
-*- mode: grep; mode: auto-revert-tail; default-directory: "~/devel/proj" -*- |
|
471 |
||
472 |
Edit HTML. |
|
473 |
========== |
|
474 |
||
2228
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
475 |
* psgml-mode |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
476 |
* nxml-mode |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
477 |
* sgml-mode |
1142 | 478 |
|
479 |
html-helper-mode. |
|
480 |
----------------- |
|
481 |
||
482 |
Highlighting, autocompletion, and auto-insertion of closing tags. |
|
483 |
||
2228
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
484 |
* http://www.emacswiki.org/emacs/HtmlHelperMode |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
485 |
* http://savannah.nongnu.org/projects/baol-hth/ |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
486 |
* http://www.nongnu.org/baol-hth/ |
1142 | 487 |
|
488 |
Source. |
|
489 |
======= |
|
490 |
||
491 |
Get main development sources:: |
|
492 |
||
493 |
$ bzr init-repo --2a emacs |
|
494 |
$ cd emacs |
|
495 |
$ bzr branch http://bzr.savannah.gnu.org/r/emacs/trunk trunk |
|
496 |
$ cd trunk |
|
497 |
$ bzr bind http://bzr.savannah.gnu.org/r/emacs/trunk |
|
498 |
||
499 |
To update with latest changes:: |
|
500 |
||
501 |
$ cd emacs/trunk |
|
502 |
$ bzr update |
|
503 |
||
504 |
See: |
|
505 |
||
2228
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
506 |
* http://www.emacswiki.org/emacs/BzrForEmacsDevs |
1142 | 507 |
|
508 |
Emacs Git mirror. |
|
509 |
----------------- |
|
510 |
||
2228
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
511 |
* http://www.emacswiki.org/emacs/EmacsFromGit |
1142 | 512 |
|
513 |
Patch. |
|
514 |
====== |
|
515 |
||
2228
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
516 |
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=5719 |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
517 |
[patch] fix bat-generic-mode highlighting pattern for CLI switch. |
1142 | 518 |
|
519 |
How report bug. |
|
520 |
=============== |
|
521 |
||
1477 | 522 |
Visit http://debbugs.gnu.org or ``M-x report-emacs-bug``. |
1142 | 523 |
|
524 |
Finding emacs packages. |
|
525 |
======================= |
|
526 |
||
2228
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
527 |
* http://anc.ed.ac.uk/~stephen/emacs/ell.html |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
528 |
* http://www.emacswiki.org/emacs/WikifiedEmacsLispList |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
529 |
* http://www.emacswiki.org/emacs/RationalElispPackaging |
1142 | 530 |
|
2228
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
531 |
http://tromey.com/elpa/index.html |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
532 |
Emacs Lisp Package Archive |
1142 | 533 |
|
534 |
EPLA. |
|
535 |
----- |
|
536 |
||
537 |
ELPA goal is to make it simple to install, use, and upgrade Emacs Lisp packages. |
|
538 |
||
539 |
Currently (2011-02-15) available such sources:: |
|
540 |
||
541 |
(setq package-archives '(("ELPA" . "http://tromey.com/elpa/") |
|
542 |
("gnu" . "http://elpa.gnu.org/packages/") |
|
543 |
("marmalade" . "http://marmalade-repo.org/packages/") |
|
544 |
)) |
|
545 |
||
2228
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
546 |
* http://www.emacswiki.org/emacs/ELPA |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
547 |
* http://marmalade-repo.org/ |
1142 | 548 |
|
2228
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
549 |
http://elpa.gnu.org/ |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
550 |
official GNU Emacs Lisp Package Archive |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
551 |
http://tromey.com/elpa/ |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
552 |
old Emacs Lisp Package Archive home page |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
553 |
http://tromey.com/elpa/upload.html |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
554 |
how to contribute |
1142 | 555 |
|
556 |
Emacswiki. |
|
557 |
---------- |
|
558 |
||
2228
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
559 |
* http://www.emacswiki.org/emacs/ElispArea |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
560 |
* http://www.emacswiki.org/emacs/WikifiedEmacsLispList |
1142 | 561 |
|
562 |
emacsmirror. |
|
563 |
------------ |
|
564 |
||
2228
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
565 |
* https://github.com/emacsmirror/p/wiki |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
566 |
* http://www.emacsmirror.org/ |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
567 |
* http://www.emacswiki.org/emacs/Emacsmirror |
1142 | 568 |
|
569 |
Funny Emacs modes. |
|
570 |
================== |
|
571 |
||
2228
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
572 |
glasses |
837f1337c59b
Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2125
diff
changeset
|
573 |
Minor mode for making identifiers likeThis readable. |
1142 | 574 |
|
575 |
Useful commands. |
|
576 |
================ |
|
577 |
:: |
|
578 |
||
579 |
flush-lines keep-lines |
|
580 |
align-regexp |
|
581 |
C-x C-o |
|
582 |
M-PageUp/M-PageDown |
|
583 |
command-history |
|
584 |
M-= |
|
585 |
C-x l |
|
586 |
locate-library find-library |
|
587 |
features load-history |
|
588 |