aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2005-05-05 00:04:55 +0000
committerMiles Bader2005-05-05 00:04:55 +0000
commitcca4e3b099ec4c3f4a36fd0cb865c618a5589069 (patch)
tree711e73e53dbe1ab3a59b53fb56a10836e777b43e
parentd469f5c370dbb6fac0e8d6687b47ccfcf96a13a5 (diff)
parentd68a5392cafedbe0ee6c3eca0444fce4a58b6cdf (diff)
downloademacs-cca4e3b099ec4c3f4a36fd0cb865c618a5589069.tar.gz
emacs-cca4e3b099ec4c3f4a36fd0cb865c618a5589069.zip
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-44
Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 272-288) - src/xdisp.c (dump_glyph_row): Don't display overlay_arrow_p field. - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 67) - Update from CVS
-rw-r--r--ChangeLog5
-rw-r--r--admin/FOR-RELEASE11
-rwxr-xr-xconfigure5
-rw-r--r--configure.in5
-rw-r--r--etc/ChangeLog25
-rw-r--r--etc/NEWS5759
-rw-r--r--etc/TUTORIAL.ru1191
-rw-r--r--etc/e/etermbin1089 -> 1149 bytes
-rw-r--r--etc/e/eterm.ti2
-rw-r--r--lisp/ChangeLog587
-rw-r--r--lisp/abbrev.el58
-rw-r--r--lisp/allout.el19
-rw-r--r--lisp/calc/calc-aent.el6
-rw-r--r--lisp/calc/calc-bin.el4
-rw-r--r--lisp/calc/calc-ext.el12
-rw-r--r--lisp/calc/calc-forms.el26
-rw-r--r--lisp/calc/calc-frac.el4
-rw-r--r--lisp/calc/calc-graph.el14
-rw-r--r--lisp/calc/calc-help.el14
-rw-r--r--lisp/calc/calc-prog.el6
-rw-r--r--lisp/calc/calc-yank.el6
-rw-r--r--lisp/calc/calc.el12
-rw-r--r--lisp/calendar/icalendar.el1406
-rw-r--r--lisp/comint.el74
-rw-r--r--lisp/emacs-lisp/byte-run.el24
-rw-r--r--lisp/emacs-lisp/bytecomp.el3
-rw-r--r--lisp/emacs-lisp/easy-mmode.el4
-rw-r--r--lisp/emacs-lisp/easymenu.el24
-rw-r--r--lisp/emacs-lisp/eldoc.el24
-rw-r--r--lisp/emacs-lisp/generic.el70
-rw-r--r--lisp/emulation/cua-base.el7
-rw-r--r--lisp/files.el316
-rw-r--r--lisp/follow.el3
-rw-r--r--lisp/font-core.el11
-rw-r--r--lisp/font-lock.el56
-rw-r--r--lisp/generic-x.el283
-rw-r--r--lisp/gnus/ChangeLog21
-rw-r--r--lisp/gnus/spam-report.el132
-rw-r--r--lisp/help.el4
-rw-r--r--lisp/hexl.el2
-rw-r--r--lisp/hippie-exp.el6
-rw-r--r--lisp/ido.el23
-rw-r--r--lisp/ielm.el3
-rw-r--r--lisp/imenu.el23
-rw-r--r--lisp/info.el2
-rw-r--r--lisp/international/latexenc.el171
-rw-r--r--lisp/international/mule-cmds.el8
-rw-r--r--lisp/international/mule-conf.el3
-rw-r--r--lisp/international/mule-util.el6
-rw-r--r--lisp/international/mule.el3
-rw-r--r--lisp/isearch.el4
-rw-r--r--lisp/jit-lock.el4
-rw-r--r--lisp/jka-comp-hook.el293
-rw-r--r--lisp/jka-compr.el236
-rw-r--r--lisp/kmacro.el42
-rw-r--r--lisp/loadhist.el40
-rw-r--r--lisp/loadup.el1
-rw-r--r--lisp/mail/rmail.el7
-rw-r--r--lisp/mail/sendmail.el7
-rw-r--r--lisp/man.el1
-rw-r--r--lisp/menu-bar.el11
-rw-r--r--lisp/midnight.el10
-rw-r--r--lisp/mouse.el1
-rw-r--r--lisp/net/net-utils.el6
-rw-r--r--lisp/net/rlogin.el24
-rw-r--r--lisp/novice.el9
-rw-r--r--lisp/pcvs-info.el24
-rw-r--r--lisp/pcvs.el40
-rw-r--r--lisp/progmodes/cmacexp.el1
-rw-r--r--lisp/progmodes/compile.el15
-rw-r--r--lisp/progmodes/cperl-mode.el10
-rw-r--r--lisp/progmodes/f90.el10
-rw-r--r--lisp/progmodes/flymake.el278
-rw-r--r--lisp/progmodes/gdb-ui.el147
-rw-r--r--lisp/progmodes/grep.el7
-rw-r--r--lisp/progmodes/gud.el35
-rw-r--r--lisp/progmodes/inf-lisp.el2
-rw-r--r--lisp/progmodes/python.el4
-rw-r--r--lisp/recentf.el12
-rw-r--r--lisp/saveplace.el3
-rw-r--r--lisp/shell.el6
-rw-r--r--lisp/simple.el52
-rw-r--r--lisp/startup.el3
-rw-r--r--lisp/subr.el82
-rw-r--r--lisp/term.el10
-rw-r--r--lisp/term/mac-win.el258
-rw-r--r--lisp/term/xterm.el97
-rw-r--r--lisp/textmodes/org.el789
-rw-r--r--lisp/textmodes/tex-mode.el8
-rw-r--r--lisp/tooltip.el48
-rw-r--r--lisp/window.el9
-rw-r--r--lispref/ChangeLog119
-rw-r--r--lispref/commands.texi17
-rw-r--r--lispref/display.texi53
-rw-r--r--lispref/edebug.texi5
-rw-r--r--lispref/files.texi54
-rw-r--r--lispref/frames.texi35
-rw-r--r--lispref/hooks.texi24
-rw-r--r--lispref/lists.texi9
-rw-r--r--lispref/modes.texi377
-rw-r--r--lispref/symbols.texi20
-rw-r--r--lispref/syntax.texi28
-rw-r--r--lispref/variables.texi32
-rw-r--r--lispref/windows.texi24
-rw-r--r--mac/ChangeLog10
-rw-r--r--mac/Emacs.app/Contents/Info.plist41
-rw-r--r--mac/inc/s-mac.h2
-rw-r--r--mac/makefile.MPW18
-rw-r--r--man/ChangeLog58
-rw-r--r--man/ack.texi23
-rw-r--r--man/building.texi8
-rw-r--r--man/dired.texi26
-rw-r--r--man/emacs.texi10
-rw-r--r--man/faq.texi11
-rw-r--r--man/files.texi68
-rw-r--r--man/frames.texi7
-rw-r--r--man/misc.texi77
-rw-r--r--man/org.texi492
-rw-r--r--man/text.texi12
-rw-r--r--nt/ChangeLog4
-rw-r--r--nt/config.nt1
-rw-r--r--src/ChangeLog244
-rw-r--r--src/ChangeLog.unicode5
-rw-r--r--src/Makefile.in7
-rw-r--r--src/buffer.c6
-rw-r--r--src/buffer.h5
-rw-r--r--src/character.c20
-rw-r--r--src/commands.h4
-rw-r--r--src/data.c1
-rw-r--r--src/dispnew.c2
-rw-r--r--src/emacs.c15
-rw-r--r--src/eval.c9
-rw-r--r--src/fileio.c52
-rw-r--r--src/fns.c28
-rw-r--r--src/frame.c4
-rw-r--r--src/keyboard.c48
-rw-r--r--src/lisp.h2
-rw-r--r--src/m/macppc.h13
-rw-r--r--src/mac.c412
-rw-r--r--src/macfns.c7
-rw-r--r--src/macgui.h4
-rw-r--r--src/macros.c52
-rw-r--r--src/macros.h8
-rw-r--r--src/macselect.c1121
-rw-r--r--src/macterm.c345
-rw-r--r--src/macterm.h4
-rw-r--r--src/sysdep.c10
-rw-r--r--src/sysselect.h2
-rw-r--r--src/window.c35
-rw-r--r--src/xdisp.c67
-rw-r--r--src/xfaces.c48
-rw-r--r--src/xmenu.c16
152 files changed, 10861 insertions, 6529 deletions
diff --git a/ChangeLog b/ChangeLog
index ad2cf9c978b..707b8a718d3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
12005-04-23 Andreas Schwab <schwab@suse.de>
2
3 * configure.in: Remove duplicate match for powerpc configuration.
4 * configure: Regenerate.
5
12005-04-20 Thien-Thi Nguyen <ttn@gnu.org> 62005-04-20 Thien-Thi Nguyen <ttn@gnu.org>
2 7
3 * configure.in: Check for <pwd.h>. 8 * configure.in: Check for <pwd.h>.
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
index 4fd9caa721a..be0f05f86ce 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -7,8 +7,6 @@ has to be set to nil: when t, it can leak memory and cause other problems.
7 7
8* NEW FEATURES 8* NEW FEATURES
9 9
10** Face remapping.
11
12** Make VC-over-Tramp work where possible, or at least fail 10** Make VC-over-Tramp work where possible, or at least fail
13gracefully if something isn't supported over Tramp. 11gracefully if something isn't supported over Tramp.
14To be done by Andre Spiegel <spiegel@gnu.org>. 12To be done by Andre Spiegel <spiegel@gnu.org>.
@@ -33,10 +31,6 @@ See msg from rms to emacs-devel on 21 Dec.
33invalid pointer from string_free_list. 31invalid pointer from string_free_list.
34 32
35 33
36* LOSSAGE
37
38** Clean up flymake.el to follow Emacs Lisp conventions.
39
40* BUGS 34* BUGS
41 35
42** Ange-ftp should ignore irrelevant IPv6 errors: 36** Ange-ftp should ignore irrelevant IPv6 errors:
@@ -92,10 +86,11 @@ is encountered.
92 86
93*** Update man/info.texi. 87*** Update man/info.texi.
94 88
95*** Update man/ack.texi.
96
97** Add missing years in copyright notices of all files. 89** Add missing years in copyright notices of all files.
98 90
91Please record your name here and say which part of the distribution
92you're going to handle.
93
99** Update AUTHORS. 94** Update AUTHORS.
100 95
101** Reorder NEWS entries. 96** Reorder NEWS entries.
diff --git a/configure b/configure
index 7d87bb44a38..228bb144ac0 100755
--- a/configure
+++ b/configure
@@ -1816,11 +1816,6 @@ _ACEOF
1816 machine=arm opsys=gnu-linux 1816 machine=arm opsys=gnu-linux
1817 ;; 1817 ;;
1818 1818
1819 ppc-*-linux | \
1820 powerpc-*-linux* )
1821 machine=macppc opsys=gnu-linux
1822 ;;
1823
1824 ## Altos 3068 1819 ## Altos 3068
1825 m68*-altos-sysv* ) 1820 m68*-altos-sysv* )
1826 machine=altos opsys=usg5-2 1821 machine=altos opsys=usg5-2
diff --git a/configure.in b/configure.in
index cd43275360b..e384ed68b5d 100644
--- a/configure.in
+++ b/configure.in
@@ -337,11 +337,6 @@ dnl see the `changequote' comment above.
337 machine=arm opsys=gnu-linux 337 machine=arm opsys=gnu-linux
338 ;; 338 ;;
339 339
340 ppc-*-linux | \
341 powerpc-*-linux* )
342 machine=macppc opsys=gnu-linux
343 ;;
344
345 ## Altos 3068 340 ## Altos 3068
346 m68*-altos-sysv* ) 341 m68*-altos-sysv* )
347 machine=altos opsys=usg5-2 342 machine=altos opsys=usg5-2
diff --git a/etc/ChangeLog b/etc/ChangeLog
index ce3785eba8e..fc34fe993bd 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,26 @@
12005-05-02 Richard M. Stallman <rms@gnu.org>
2
3 * NEWS: More rearrangements.
4
52005-05-02 Chong Yidong <cyd@stupidchicken.com>
6
7 * NEWS: Items rearranged in logical order.
8
92005-05-01 Lars Hansen <larsh@math.ku.dk>
10
11 * NEWS: Correct key binding for dired-mark-omitted.
12
132005-04-25 Dan Nicolaescu <dann@ics.uci.edu>
14
15 * NEWS: Mention xterm key bindings.
16
17 * e/eterm.ti: Add a comment.
18 * e/eterm: Regenerate.
19
202005-04-25 Alex Ott <ott@jet.msk.su>
21
22 * TUTORIAL.ru: Update.
23
12005-04-13 Pavel Jan,Am(Bk <Pavel@Janik.cz> 242005-04-13 Pavel Jan,Am(Bk <Pavel@Janik.cz>
2 25
3 * TUTORIAL.sk: Updated header. 26 * TUTORIAL.sk: Updated header.
@@ -16,7 +39,7 @@
16 39
172005-04-10 Masatake YAMATO <jet@gyve.org> 402005-04-10 Masatake YAMATO <jet@gyve.org>
18 41
19 * compilation.txt (symbol): Added gcov-file 42 * compilation.txt (symbol): Added gcov-file
20 gcov-bb-file gcov-never-called-line gcov-called-line . 43 gcov-bb-file gcov-never-called-line gcov-called-line .
21 44
222005-04-08 Kenichi Handa <handa@m17n.org> 452005-04-08 Kenichi Handa <handa@m17n.org>
diff --git a/etc/NEWS b/etc/NEWS
index 42afd7c7f61..452fc12f5b4 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -92,17 +92,13 @@ eight-bit-control/eight-bit-graphic charsets aren't now in the range
92 92
93* Installation Changes in Emacs 22.1 93* Installation Changes in Emacs 22.1
94 94
95** Emacs includes now support for loading image libraries on demand. 95---
96(Currently this feature is only used on MS Windows.) You can configure 96** Emacs now supports new configure options `--program-prefix',
97the supported image types and their associated dynamic libraries by 97`--program-suffix' and `--program-transform-name' that affect the names of
98setting the variable `image-library-alist'. 98installed programs.
99 99
100--- 100---
101** New translations of the Emacs Tutorial are available in the following 101** Emacs can now be built without sound support.
102 languages: Brasilian, Bulgarian, Chinese (both with simplified and
103 traditional characters), French, and Italian. Type `C-u C-h t' to
104 choose one of them in case your language setup doesn't automatically
105 select the right one.
106 102
107--- 103---
108** You can build Emacs with Gtk+ widgets by specifying `--with-x-toolkit=gtk' 104** You can build Emacs with Gtk+ widgets by specifying `--with-x-toolkit=gtk'
@@ -110,17 +106,9 @@ when you run configure. This requires Gtk+ 2.0 or newer. This port
110provides a way to display multilingual text in menus (with some caveats). 106provides a way to display multilingual text in menus (with some caveats).
111 107
112--- 108---
113** Emacs can now be built without sound support.
114
115---
116** The `emacsserver' program has been removed, replaced with elisp code. 109** The `emacsserver' program has been removed, replaced with elisp code.
117 110
118--- 111---
119** Emacs now supports new configure options `--program-prefix',
120`--program-suffix' and `--program-transform-name' that affect the names of
121installed programs.
122
123---
124** By default, Emacs now uses a setgid helper program to update game 112** By default, Emacs now uses a setgid helper program to update game
125scores. The directory ${localstatedir}/games/emacs is the normal 113scores. The directory ${localstatedir}/games/emacs is the normal
126place for game scores to be stored. This may be controlled by the 114place for game scores to be stored. This may be controlled by the
@@ -137,7 +125,7 @@ Emacs with Leim.
137+++ 125+++
138** The Emacs Lisp Reference Manual is now part of the distribution. 126** The Emacs Lisp Reference Manual is now part of the distribution.
139 127
140The ELisp reference manual in Info format is built as part of the 128The Emacs Lisp Reference Manual in Info format is built as part of the
141Emacs build procedure and installed together with the Emacs User 129Emacs build procedure and installed together with the Emacs User
142Manual. A menu item was added to the menu bar that makes it easy 130Manual. A menu item was added to the menu bar that makes it easy
143accessible (Help->More Manuals->Emacs Lisp Reference). 131accessible (Help->More Manuals->Emacs Lisp Reference).
@@ -152,6 +140,22 @@ item was added to the menu bar that makes it easy accessible
152(Help->More Manuals->Introduction to Emacs Lisp). 140(Help->More Manuals->Introduction to Emacs Lisp).
153 141
154--- 142---
143** New translations of the Emacs Tutorial are available in the
144following languages: Brasilian Portuguese, Bulgarian, Chinese (both
145with simplified and traditional characters), French, and Italian.
146Type `C-u C-h t' to choose one of them in case your language setup
147doesn't automatically select the right one.
148
149---
150** A French translation of the `Emacs Survival Guide' is available.
151
152---
153** Emacs now includes support for loading image libraries on demand.
154(Currently this feature is only used on MS Windows.) You can configure
155the supported image types and their associated dynamic libraries by
156setting the variable `image-library-alist'.
157
158---
155** Support for Cygwin was added. 159** Support for Cygwin was added.
156 160
157--- 161---
@@ -173,60 +177,81 @@ create non-Carbon build by specifying `NonCarbon' as a target. See
173the files mac/README and mac/INSTALL for build instructions. 177the files mac/README and mac/INSTALL for build instructions.
174 178
175--- 179---
176** A French translation of the `Emacs Survival Guide' is available.
177
178---
179** Building with -DENABLE_CHECKING does not automatically build with union 180** Building with -DENABLE_CHECKING does not automatically build with union
180types any more. Add -DUSE_LISP_UNION_TYPE if you want union types. 181types any more. Add -DUSE_LISP_UNION_TYPE if you want union types.
181
182 182
183* Changes in Emacs 22.1 183* Startup Changes in Emacs 22.1
184 184
185** Improved Thai support. A new minor mode `thai-word-mode' (which is 185** New command line option -Q or --quick.
186automatically activated if you select Thai as a language 186This is like using -q --no-site-file, but in addition it also disables
187environment) changes key bindings of most word-oriented commands to 187the fancy startup screen.
188versions which recognize Thai words. Affected commands are
189 M-f (forward-word)
190 M-b (backward-word)
191 M-d (kill-word)
192 M-DEL (backward-kill-word)
193 M-t (transpose-words)
194 M-q (fill-paragraph)
195 188
196** fast-lock.el and lazy-lock.el are obsolete. Use jit-lock.el instead. 189+++
190** New command line option -D or --basic-display.
191Disables the menu-bar, the tool-bar, the scroll-bars, tool tips, and
192the blinking cursor.
197 193
198** iso-acc.el is now obsolete. Use one of the latin input methods instead. 194+++
195** New command line option -nbc or --no-blinking-cursor disables
196the blinking cursor on graphical terminals.
199 197
200--- 198+++
201** Language environment and various default coding systems are setup 199** The command line option --no-windows has been changed to
202more correctly according to the current locale name. If the locale 200--no-window-system. The old one still works, but is deprecated.
203name doesn't specify a charset, the default is what glibc defines.
204This change may result in using the different coding systems as
205default in some locale (e.g. vi_VN).
206 201
207+++ 202+++
208** The commands copy-file, rename-file, make-symbolic-link and 203** The -f option, used from the command line to call a function,
209add-name-to-file, when given a directory as the "new name" argument, 204now reads arguments for the function interactively if it is
210convert it to a file name by merging in the within-directory part of 205an interactively callable function.
211the existing file's name. (This is the same convention that shell
212commands cp, mv, and ln follow.) Thus, M-x copy-file RET ~/foo RET
213/tmp RET copies ~/foo to /tmp/foo.
214 206
215+++ 207+++
216** M-o now is the prefix key for setting text properties; 208** Emacs can now be invoked in full-screen mode on a windowed display.
217M-o M-o requests refontification. 209When Emacs is invoked on a window system, the new command-line options
210`--fullwidth', `--fullheight', and `--fullscreen' produce a frame
211whose width, height, or both width and height take up the entire
212screen size. (For now, this does not work with some window managers.)
218 213
219+++ 214+++
220** M-g is now a prefix key. 215** Emacs now displays a splash screen by default even if command-line
216arguments were given. The new command-line option --no-splash
217disables the splash screen; see also the variable
218`inhibit-startup-message' (which is also aliased as
219`inhibit-splash-screen').
221 220
221+++
222** New user option `inhibit-startup-buffer-menu'.
223When loading many files, for instance with `emacs *', Emacs normally
224displays a buffer menu. This option turns the buffer menu off.
225
226+++
227** Init file changes
228You can now put the init files .emacs and .emacs_SHELL under
229~/.emacs.d or directly under ~. Emacs will find them in either place.
230
231+++
232** Emacs now reads the standard abbrevs file ~/.abbrev_defs
233automatically at startup, if it exists. When Emacs offers to save
234modified buffers, it saves the abbrevs too if they have changed. It
235can do this either silently or asking for confirmation first,
236according to the value of `save-abbrevs'.
237
238
239* Editing Changes in Emacs 22.1
240
241+++
242** The mode line position information now comes before the major mode.
243When the file is maintained under version control, that information
244appears between the position information and the major mode.
245
246+++
247** M-g is now a prefix key.
222M-g g and M-g M-g run goto-line. 248M-g g and M-g M-g run goto-line.
223M-g n and M-g M-n run next-error (like C-x `). 249M-g n and M-g M-n run next-error (like C-x `).
224M-g p and M-g M-p run previous-error. 250M-g p and M-g M-p run previous-error.
225 251
226+++ 252+++
227** font-lock-lines-before specifies a number of lines before the 253** M-o now is the prefix key for setting text properties;
228current line that should be refontified when you change the buffer. 254M-o M-o requests refontification.
229The default value is 1.
230 255
231+++ 256+++
232** C-u M-x goto-line now switches to the most recent previous buffer, 257** C-u M-x goto-line now switches to the most recent previous buffer,
@@ -235,448 +260,372 @@ and goes to the specified line in that buffer.
235When goto-line starts to execute, if there's a number in the buffer at 260When goto-line starts to execute, if there's a number in the buffer at
236point then it acts as the default argument for the minibuffer. 261point then it acts as the default argument for the minibuffer.
237 262
238--- 263+++
239** Emacs now responds to mouse-clicks on the mode-line, header-line and 264** You can now switch buffers in a cyclic order with C-x C-left and
240display margin, when run in an xterm. 265(prev-buffer) and C-x C-right (next-buffer). C-x left and C-x right
266can be used as well.
241 267
242+++ 268+++
243** M-SPC (just-one-space) when given a numeric argument N 269** The old bindings C-M-delete and C-M-backspace have been deleted,
244converts whitespace around point to N spaces. 270since there are situations where one or the other will shut down
271the operating system or your X server.
245 272
246+++ 273+++
247** Control characters and escape glyphs are now shown in the new 274** `undo-only' does an undo which does not redo any previous undo.
248escape-glyph face.
249 275
250+++ 276+++
251** Non-breaking space and hyphens are now prefixed with an escape 277** When the undo information of the current command gets really large
252character, unless the new user variable `show-nonbreak-escape' is set 278(beyond the value of `undo-outer-limit'), Emacs discards it and warns
253to nil. 279you about it.
254 280
255--- 281+++
256** The type-break package now allows `type-break-file-name' to be nil 282** M-SPC (just-one-space) when given a numeric argument N
257and if so, doesn't store any data across sessions. This is handy if 283converts whitespace around point to N spaces.
258you don't want the .type-break file in your home directory or are 284
259annoyed by the need for interaction when you kill Emacs. 285+++
286** line-move-ignore-invisible now defaults to t.
260 287
261--- 288---
262** display-battery has been replaced by display-battery-mode. 289** New commands to operate on pairs of open and close characters:
290`insert-pair', `delete-pair', `raise-sexp'.
263 291
264--- 292---
265** calculator.el now has radix grouping mode, which is available when 293** New command `kill-whole-line' kills an entire line at once.
266`calculator-output-radix' is non-nil. In this mode a separator 294By default, it is bound to C-S-<backspace>.
267character is used every few digits, making it easier to see byte
268boundries etc. For more info, see the documentation of the variable
269`calculator-radix-grouping-mode'.
270 295
271+++ 296+++
272** You can now follow links by clicking Mouse-1 on the link. 297** Yanking text now discards certain text properties that can
273 298be inconvenient when you did not expect them. The variable
274Traditionally, Emacs uses a Mouse-1 click to set point and a Mouse-2 299`yank-excluded-properties' specifies which ones. Insertion
275click to follow a link, whereas most other applications use a Mouse-1 300of register contents and rectangles also discards these properties.
276click for both purposes, depending on whether you click outside or
277inside a link. Now the behavior of a Mouse-1 click has been changed
278to match this context-sentitive dual behavior.
279
280Depending on the current mode, a Mouse-2 click in Emacs may do much
281more than just follow a link, so the new Mouse-1 behavior is only
282activated for modes which explicitly mark a clickable text as a "link"
283(see the new function `mouse-on-link-p' for details). The Lisp
284packages that are included in release 22.1 have been adapted to do
285this, but external packages may not yet support this. However, there
286is no risk in using such packages, as the worst thing that could
287happen is that you get the original Mouse-1 behavior when you click
288on a link, which typically means that you set point where you click.
289
290If you want to get the original Mouse-1 action also inside a link, you
291just need to press the Mouse-1 button a little longer than a normal
292click (i.e. press and hold the Mouse-1 button for half a second before
293you release it).
294
295Dragging the Mouse-1 inside a link still performs the original
296drag-mouse-1 action, typically copy the text.
297
298You can customize the new Mouse-1 behavior via the new user options
299`mouse-1-click-follows-link' and `mouse-1-click-in-non-selected-windows'.
300 301
301+++ 302+++
302** require-final-newline now has two new possible values: 303** The default values of paragraph-start and indent-line-function have
303 304been changed to reflect those used in Text mode rather than those used
304`visit' means add a newline (as an undoable change) if it's needed 305in Indented-Text mode.
305when visiting the file.
306
307`visit-save' means add a newline (as an undoable change) if it's
308needed when visiting the file, and also add a newline if it's needed
309when saving the file.
310 306
311+++ 307+++
312** The new option mode-require-final-newline controls how certain 308** Movement commands `beginning-of-buffer', `end-of-buffer',
313major modes enable require-final-newline. Any major mode that's 309`beginning-of-defun', `end-of-defun' do not set the mark if the mark
314designed for a kind of file that should normally end in a newline 310is already active in Transient Mark mode.
315sets require-final-newline based on mode-require-final-newline.
316So you can customize mode-require-final-newline to control what these
317modes do.
318 311
319+++ 312** Mark Changes:
320** When the undo information of the current command gets really large
321(beyond the value of `undo-outer-limit'), Emacs discards it and warns
322you about it.
323 313
324+++ 314+++
325** line-move-ignore-invisible now defaults to t. 315*** A prefix argument is no longer required to repeat a jump to a
316previous mark, i.e. C-u C-SPC C-SPC C-SPC ... cycles through the
317mark ring. Use C-u C-u C-SPC to set the mark immediately after a jump.
326 318
327+++ 319+++
328** In Outline mode, hide-body no longer hides lines at the top 320*** Marking commands extend the region when invoked multiple times. If
329of the file that precede the first header line. 321you hit M-C-SPC (mark-sexp), M-@ (mark-word), M-h (mark-paragraph), or
322C-M-h (mark-defun) repeatedly, the marked region extends each time, so
323you can mark the next two sexps with M-C-SPC M-C-SPC, for example.
324This feature also works for mark-end-of-sentence, if you bind that to
325a key. It also extends the region when the mark is active in Transient
326Mark mode, regardless of the last command. To start a new region with
327one of marking commands in Transient Mark mode, you can deactivate the
328active region with C-g, or set the new mark with C-SPC.
330 329
331+++ 330+++
332** In Enriched mode, `set-left-margin' and `set-right-margin' are now 331*** M-h (mark-paragraph) now accepts a prefix arg.
333by default bound to `C-c [' and `C-c ]' instead of the former `C-c C-l' 332With positive arg, M-h marks the current and the following paragraphs;
334and `C-c C-r'. 333if the arg is negative, it marks the current and the preceding
334paragraphs.
335 335
336+++ 336+++
337** In processing a local variables list, Emacs strips the prefix and 337*** Some commands do something special in Transient Mark mode when the
338suffix are from every line before processing all the lines. 338mark is active--for instance, they limit their operation to the
339region. Even if you don't normally use Transient Mark mode, you might
340want to get this behavior from a particular command. There are two
341ways you can enable Transient Mark mode and activate the mark, for one
342command only.
339 343
340+++ 344One method is to type C-SPC C-SPC; this enables Transient Mark mode
341** `apply-macro-to-region-lines' now operates on all lines that begin 345and sets the mark at point. The other method is to type C-u C-x C-x.
342in the region, rather than on all complete lines in the region. 346This enables Transient Mark mode temporarily but does not alter the
347mark or the region.
343 348
344--- 349After these commands, Transient Mark mode remains enabled until you
345** global-whitespace-mode is a new alias for whitespace-global-mode. 350deactivate the mark. That typically happens when you type a command
351that alters the buffer, but you can also deactivate the mark by typing
352C-g.
346 353
347+++ 354** Help command changes:
348** There are now two new regular expression operators, \_< and \_>,
349for matching the beginning and end of a symbol. A symbol is a
350non-empty sequence of either word or symbol constituent characters, as
351specified by the syntax table.
352---
353*** rx.el has new corresponding `symbol-end' and `symbol-start' elements.
354 355
355+++ 356+++
356** Passing resources on the command line now works on MS Windows. 357*** Changes in C-h bindings:
357You can use --xrm to pass resource settings to Emacs, overriding any
358existing values. For example:
359 358
360 emacs --xrm "Emacs.Background:red" --xrm "Emacs.Geometry:100x20" 359C-h e displays the *Messages* buffer.
361 360
362will start up Emacs on an initial frame of 100x20 with red background, 361C-h followed by a control character is used for displaying files
363irrespective of geometry or background setting on the Windows registry. 362 that do not change:
364 363
365--- 364C-h C-f displays the FAQ.
366** The terminal emulation code in term.el has been improved, it can 365C-h C-e displays the PROBLEMS file.
367run most curses applications now.
368 366
369** New features in evaluation commands 367The info-search bindings on C-h C-f, C-h C-k and C-h C-i
368have been moved to C-h F, C-h K and C-h S.
370 369
371+++ 370C-h c, C-h k, C-h w, and C-h f now handle remapped interactive commands.
372*** The function `eval-defun' (C-M-x) called on defface reinitializes
373the face to the value specified in the defface expression.
374 371
375+++ 372- C-h c and C-h k report the actual command (after possible remapping)
376*** Typing C-x C-e twice prints the value of the integer result 373 run by the key sequence.
377in additional formats (octal, hexadecimal, character) specified
378by the new function `eval-expression-print-format'. The same
379function also defines the result format for `eval-expression' (M-:),
380`eval-print-last-sexp' (C-j) and some edebug evaluation functions.
381 374
382--- 375- C-h w and C-h f on a command which has been remapped now report the
383** New input method chinese-sisheng for inputting Chinese Pinyin 376 command it is remapped to, and the keys which can be used to run
384characters. 377 that command.
385 378
386+++ 379For example, if C-k is bound to kill-line, and kill-line is remapped
387** New command quail-show-key shows what key (or key sequence) to type 380to new-kill-line, these commands now report:
388in the current input method to input a character at point.
389 381
390+++ 382- C-h c and C-h k C-k reports:
391** You can now switch buffers in a cyclic order with C-x C-left and 383 C-k runs the command new-kill-line
392(prev-buffer) and C-x C-right (next-buffer). C-x left and C-x right
393can be used as well.
394 384
395--- 385- C-h w and C-h f kill-line reports:
396** Commands winner-redo and winner-undo, from winner.el, are now bound to 386 kill-line is remapped to new-kill-line which is on C-k, <deleteline>
397C-c <left> and C-c <right>, respectively. This is an incompatible change. 387
388- C-h w and C-h f new-kill-line reports:
389 new-kill-line is on C-k
398 390
399--- 391---
400** Help commands `describe-function' and `describe-key' now show function 392*** Help commands `describe-function' and `describe-key' now show function
401arguments in lowercase italics on displays that support it. To change the 393arguments in lowercase italics on displays that support it. To change the
402default, customize face `help-argument-name' or redefine the function 394default, customize face `help-argument-name' or redefine the function
403`help-default-arg-highlight'. 395`help-default-arg-highlight'.
404 396
405---
406** The comint prompt can now be made read-only, using the new user
407option `comint-prompt-read-only'. This is not enabled by default,
408except in IELM buffers. The read-only status of IELM prompts can be
409controlled with the new user option `ielm-prompt-read-only', which
410overrides `comint-prompt-read-only'.
411
412The new commands `comint-kill-whole-line' and `comint-kill-region'
413support editing comint buffers with read-only prompts.
414
415`comint-kill-whole-line' is like `kill-whole-line', but ignores both
416read-only and field properties. Hence, it always kill entire
417lines, including any prompts.
418
419`comint-kill-region' is like `kill-region', except that it ignores
420read-only properties, if it is safe to do so. This means that if any
421part of a prompt is deleted, then the entire prompt must be deleted
422and that all prompts must stay at the beginning of a line. If this is
423not the case, then `comint-kill-region' behaves just like
424`kill-region' if read-only are involved: it copies the text to the
425kill-ring, but does not delete it.
426
427+++ 397+++
428** You can now use next-error (C-x `) and previous-error to advance to 398*** C-h v and C-h f commands now include a hyperlink to the C source for
429the next/previous matching line found by M-x occur. 399variables and functions defined in C (if the C source is available).
430 400
431+++ 401+++
432** Telnet now prompts you for a port number with C-u M-x telnet. 402*** Help mode now only makes hyperlinks for faces when the face name is
403preceded or followed by the word `face'. It no longer makes
404hyperlinks for variables without variable documentation, unless
405preceded by one of the words `variable' or `option'. It now makes
406hyperlinks to Info anchors (or nodes) if the anchor (or node) name is
407enclosed in single quotes and preceded by `info anchor' or `Info
408anchor' (in addition to earlier `info node' and `Info node').
433 409
434+++ 410+++
435** New command line option -Q or --quick. 411*** The new command `describe-char' (C-u C-x =) pops up a buffer with
412description various information about a character, including its
413encodings and syntax, its text properties, how to input, overlays, and
414widgets at point. You can get more information about some of them, by
415clicking on mouse-sensitive areas or moving there and pressing RET.
436 416
437This is like using -q --no-site-file, but in addition it also disables 417+++
438the fancy startup screen. 418*** New command `display-local-help' displays any local help at point
419in the echo area. It is bound to `C-h .'. It normally displays the
420same string that would be displayed on mouse-over using the
421`help-echo' property, but, in certain cases, it can display a more
422keyboard oriented alternative.
439 423
440+++ 424+++
441** New command line option -D or --basic-display. 425*** New user option `help-at-pt-display-when-idle' allows to
426automatically show the help provided by `display-local-help' on
427point-over, after suitable idle time. The amount of idle time is
428determined by the user option `help-at-pt-timer-delay' and defaults
429to one second. This feature is turned off by default.
442 430
443Disables the menu-bar, the tool-bar, the scroll-bars, tool tips, and 431** Buffer Menu changes
444the blinking cursor.
445 432
446+++ 433+++
447** New command line option -nbc or --no-blinking-cursor disables 434*** New command `Buffer-menu-toggle-files-only' toggles display of file
448the blinking cursor on graphical terminals. 435buffers only in the Buffer Menu. It is bound to `T' in Buffer Menu
436mode.
449 437
450+++ 438+++
451** C-h v and C-h f commands now include a hyperlink to the C source for 439*** `buffer-menu' and `list-buffers' now list buffers whose names begin
452variables and functions defined in C (if the C source is available). 440with a space, when those buffers are visiting files. Normally buffers
441whose names begin with space are omitted.
453 442
454--- 443---
455** When used interactively, `format-write-file' now asks for confirmation 444*** The new options `buffers-menu-show-directories' and
456before overwriting an existing file, unless a prefix argument is 445`buffers-menu-show-status' let you control how buffers are displayed
457supplied. This behavior is analogous to `write-file'. 446in the menu dropped down when you click "Buffers" from the menu bar.
458 447
459+++ 448`buffers-menu-show-directories' controls whether the menu displays
460** You can now use Auto Revert mode to `tail' a file. 449leading directories as part of the file name visited by the buffer.
461If point is at the end of a file buffer before reverting, Auto Revert 450If its value is `unless-uniquify', the default, directories are
462mode keeps it at the end after reverting. Similarly if point is 451shown unless uniquify-buffer-name-style' is non-nil. The value of nil
463displayed at the end of a file buffer in any window, it stays at 452and t turn the display of directories off and on, respectively.
464the end of the buffer in that window. This allows to tail a file:
465just put point at the end of the buffer and it stays there. This
466rule applies to file buffers. For non-file buffers, the behavior may
467be mode dependent.
468 453
469If you are sure that the file will only change by growing at the end, 454`buffers-menu-show-status' controls whether the Buffers menu includes
470then you can tail the file more efficiently by using the new minor 455the modified and read-only status of the buffers. By default it is
471mode Auto Revert Tail mode. The function `auto-revert-tail-mode' 456t, and the status is shown.
472toggles this mode. 457
458Setting these variables directly does not take effect until next time
459the Buffers menu is regenerated.
460
461** File Operation Changes:
473 462
474+++ 463+++
475** Auto Revert mode is now more careful to avoid excessive reverts and 464*** find-file-read-only visits multiple files in read-only mode,
476other potential problems when deciding which non-file buffers to 465when the file name contains wildcard characters.
477revert. This matters especially if Global Auto Revert mode is enabled
478and `global-auto-revert-non-file-buffers' is non-nil. Auto Revert
479mode only reverts a non-file buffer if the buffer has a non-nil
480`revert-buffer-function' and a non-nil `buffer-stale-function', which
481decides whether the buffer should be reverted. Currently, this means
482that auto reverting works for Dired buffers (although this may not
483work properly on all operating systems) and for the Buffer Menu.
484 466
485+++ 467+++
486** If the new user option `auto-revert-check-vc-info' is non-nil, Auto 468*** find-alternate-file replaces the current file with multiple files,
487Revert mode reliably updates version control info (such as the version 469when the file name contains wildcard characters.
488control number in the mode line), in all version controlled buffers in
489which it is active. If the option is nil, the default, then this info
490only gets updated whenever the buffer gets reverted.
491 470
492+++ 471+++
493** New command `Buffer-menu-toggle-files-only' toggles display of file 472*** Auto Compression mode is now enabled by default.
494buffers only in the Buffer Menu. It is bound to `T' in Buffer Menu
495mode.
496 473
497--- 474---
498** M-x compile has become more robust and reliable 475*** C-x C-f RET, typing nothing in the minibuffer, is no longer a special case.
499 476
500Quite a few more kinds of messages are recognized. Messages that are 477Since the default input is the current directory, this has the effect
501recognized as warnings or informational come in orange or green, instead of 478of specifying the current directory. Normally that means to visit the
502red. Informational messages are by default skipped with `next-error' 479directory with Dired.
503(controlled by `compilation-skip-threshold').
504
505Location data is collected on the fly as the *compilation* buffer changes.
506This means you could modify messages to make them point to different files.
507This also means you can not go to locations of messages you may have deleted.
508
509The variable `compilation-error-regexp-alist' has now become customizable. If
510you had added your own regexps to this, you'll probably need to include a
511leading `^', otherwise they'll match anywhere on a line. There is now also a
512`compilation-mode-font-lock-keywords' and it nicely handles all the checks
513that configure outputs and -o options so you see at a glance where you are.
514
515The new file etc/compilation.txt gives examples of each type of message.
516
517** Compilation mode enhancements:
518 480
519+++ 481+++
520*** New user option `compilation-environment'. 482*** When you are root, and you visit a file whose modes specify
521This option allows you to specify environment variables for inferior 483read-only, the Emacs buffer is now read-only too. Type C-x C-q if you
522compilation processes without affecting the environment that all 484want to make the buffer writable. (As root, you can in fact alter the
523subprocesses inherit. 485file.)
524 486
525+++ 487+++
526** Grep has been decoupled from compilation mode setup. 488*** C-x s (save-some-buffers) now offers an option `d' to diff a buffer
489against its file, so you can see what changes you would be saving.
527 490
528--- 491+++
529*** There's a new separate package grep.el. 492*** The commands copy-file, rename-file, make-symbolic-link and
493add-name-to-file, when given a directory as the "new name" argument,
494convert it to a file name by merging in the within-directory part of
495the existing file's name. (This is the same convention that shell
496commands cp, mv, and ln follow.) Thus, M-x copy-file RET ~/foo RET
497/tmp RET copies ~/foo to /tmp/foo.
530 498
531--- 499---
532*** M-x grep has been adapted to new compile 500*** When used interactively, `format-write-file' now asks for confirmation
533 501before overwriting an existing file, unless a prefix argument is
534Hits are fontified in green, and hits in binary files in orange. Grep buffers 502supplied. This behavior is analogous to `write-file'.
535can be saved and automatically revisited with the new Grep mode.
536 503
537--- 504---
538*** Grep commands now have their own submenu and customization group. 505*** The variable `auto-save-file-name-transforms' now has a third element that
506controls whether or not the function `make-auto-save-file-name' will
507attempt to construct a unique auto-save name (e.g. for remote files).
539 508
540+++ 509+++
541*** `grep-find' is now also available under the name `find-grep' where 510*** If the user visits a file larger than `large-file-warning-threshold',
542people knowing `find-grep-dired' would probably expect it. 511Emacs prompts her for confirmation.
543
544---
545*** The new variables `grep-window-height', `grep-auto-highlight', and
546`grep-scroll-output' can be used to override the corresponding
547compilation mode settings for grep commands.
548 512
549+++ 513+++
550*** New option `grep-highlight-matches' highlightes matches in *grep* 514*** require-final-newline now has two new possible values:
551buffer. It uses a special feature of some grep programs which accept
552--color option to output markers around matches. When going to the next
553match with `next-error' the exact match is highlighted in the source
554buffer. Otherwise, if `grep-highlight-matches' is nil, the whole
555source line is highlighted.
556 515
557+++ 516`visit' means add a newline (as an undoable change) if it's needed
558*** New key bindings in grep output window: 517when visiting the file.
559SPC and DEL scrolls window up and down. C-n and C-p moves to next and
560previous match in the grep window. RET jumps to the source line of
561the current match. `n' and `p' shows next and previous match in
562other window, but does not switch buffer. `{' and `}' jumps to the
563previous or next file in the grep output. TAB also jumps to the next
564file.
565 518
566+++ 519`visit-save' means add a newline (as an undoable change) if it's
567** New options `next-error-highlight' and `next-error-highlight-no-select' 520needed when visiting the file, and also add a newline if it's needed
568specify the method of highlighting of the corresponding source line 521when saving the file.
569in new face `next-error'.
570 522
571+++ 523+++
572** A new minor mode `next-error-follow-minor-mode' can be used in 524*** The new option mode-require-final-newline controls how certain
573compilation-mode, grep-mode, occur-mode, and diff-mode (i.e. all the 525major modes enable require-final-newline. Any major mode that's
574modes that can use `next-error'). In this mode, cursor motion in the 526designed for a kind of file that should normally end in a newline
575buffer causes automatic display in another window of the corresponding 527sets require-final-newline based on mode-require-final-newline.
576matches, compilation errors, etc. This minor mode can be toggled with 528So you can customize mode-require-final-newline to control what these
577C-c C-f. 529modes do.
578 530
579+++ 531+++
580** M-x diff uses diff-mode instead of compilation-mode. 532** The max size of buffers and integers has been doubled.
533On 32bit machines, it is now 256M (i.e. 268435455).
534
535** Minibuffer changes:
581 536
582+++ 537+++
583** M-x compare-windows now can automatically skip non-matching text to 538*** There's a new face `minibuffer-prompt'.
584resync points in both windows. 539Emacs adds this face to the list of text properties stored in the
540variable `minibuffer-prompt-properties', which is used to display the
541prompt string.
585 542
586--- 543---
587** New command `strokes-global-set-stroke-string'. 544*** Enhanced visual feedback in *Completions* buffer.
588This is like `strokes-global-set-stroke', but it allows you to bind
589the stroke directly to a string to insert. This is convenient for
590using strokes as an input method.
591 545
592** Gnus package 546Completions lists use faces to highlight what all completions
547have in common and where they begin to differ.
593 548
594--- 549The common prefix shared by all possible completions uses the face
595*** Gnus now includes Sieve and PGG 550`completions-common-part', while the first character that isn't the
596Sieve is a library for managing Sieve scripts. PGG is a library to handle 551same uses the face `completions-first-difference'. By default,
597PGP/MIME. 552`completions-common-part' inherits from `default', and
553`completions-first-difference' inherits from `bold'. The idea of
554`completions-common-part' is that you can use it to make the common
555parts less visible than normal, so that the rest of the differing
556parts is, by contrast, slightly highlighted.
598 557
599--- 558+++
600*** There are many news features, bug fixes and improvements. 559*** File-name completion can now ignore directories.
601See the file GNUS-NEWS or the node "Oort Gnus" in the Gnus manual for details. 560If an element of the list in `completion-ignored-extensions' ends in a
561slash `/', it indicates a subdirectory that should be ignored when
562completing file names. Elements of `completion-ignored-extensions'
563which do not end in a slash are never considered when a completion
564candidate is a directory.
602 565
603+++ 566+++
604** Desktop package 567*** The completion commands TAB, SPC and ? in the minibuffer apply only
568to the text before point. If there is text in the buffer after point,
569it remains unchanged.
605 570
606+++ 571+++
607*** Desktop saving is now a minor mode, desktop-save-mode. Variable 572*** New user option `history-delete-duplicates'.
608desktop-enable is obsolete. Customize desktop-save-mode to enable desktop 573If set to t when adding a new history element, all previous identical
609saving. 574elements are deleted.
610 575
611--- 576** Redisplay Changes
612*** Buffers are saved in the desktop file in the same order as that in the
613buffer list.
614 577
615+++ 578+++
616*** The desktop package can be customized to restore only some buffers immediately, 579*** Control characters and escape glyphs are now shown in the new
617remaining buffers are restored lazily (when Emacs is idle). 580escape-glyph face.
618 581
619+++ 582+++
620*** New commands: 583*** Non-breaking space and hyphens are now prefixed with an escape
621 - desktop-revert reverts to the last loaded desktop. 584character, unless the new user variable `show-nonbreak-escape' is set
622 - desktop-change-dir kills current desktop and loads a new. 585to nil.
623 - desktop-save-in-desktop-dir saves desktop in the directory from which
624 it was loaded.
625 - desktop-lazy-complete runs the desktop load to completion.
626 - desktop-lazy-abort aborts lazy loading of the desktop.
627
628---
629*** New customizable variables:
630 - desktop-save. Determins whether the desktop should be saved when it is
631 killed.
632 - desktop-file-name-format. Format in which desktop file names should be saved.
633 - desktop-path. List of directories in which to lookup the desktop file.
634 - desktop-locals-to-save. List of local variables to save.
635 - desktop-globals-to-clear. List of global variables that `desktop-clear' will clear.
636 - desktop-clear-preserve-buffers-regexp. Regexp identifying buffers that `desktop-clear'
637 should not delete.
638 - desktop-restore-eager. Number of buffers to restore immediately. Remaining buffers are
639 restored lazily (when Emacs is idle).
640 - desktop-lazy-verbose. Verbose reporting of lazily created buffers.
641 - desktop-lazy-idle-delay. Idle delay before starting to create buffers.
642 586
643+++ 587+++
644*** New command line option --no-desktop 588*** The parameters of automatic hscrolling can now be customized.
589The variable `hscroll-margin' determines how many columns away from
590the window edge point is allowed to get before automatic hscrolling
591will horizontally scroll the window. The default value is 5.
645 592
646--- 593The variable `hscroll-step' determines how many columns automatic
647*** New hooks: 594hscrolling scrolls the window when point gets too close to the
648 - desktop-after-read-hook run after a desktop is loaded. 595window edge. If its value is zero, the default, Emacs scrolls the
649 - desktop-no-desktop-file-hook run when no desktop file is found. 596window so as to center point. If its value is an integer, it says how
597many columns to scroll. If the value is a floating-point number, it
598gives the fraction of the window's width to scroll the window.
650 599
651--- 600The variable `automatic-hscrolling' was renamed to
652** The saveplace.el package now filters out unreadable files. 601`auto-hscroll-mode'. The old name is still available as an alias.
653When you exit Emacs, the saved positions in visited files no longer
654include files that aren't readable, e.g. files that don't exist.
655Customize the new option `save-place-forget-unreadable-files' to nil
656to get the old behavior. The new options `save-place-save-skipped'
657and `save-place-skip-check-regexp' allow further fine-tuning of this
658feature.
659 602
660+++ 603*** Moving or scrolling through images (and other lines) taller that
661** You can have several Emacs servers on the same machine. 604the window now works sensible, by automatically adjusting the window's
605vscroll property.
662 606
663 % emacs --eval '(setq server-name "foo")' -f server-start & 607+++
664 % emacs --eval '(setq server-name "bar")' -f server-start & 608*** In graphical mode, with a C program, GUD Tooltips have been extended to
665 % emacsclient -s foo file1 609display the #define directive associated with an identifier when program is
666 % emacsclient -s bar file2 610not executing.
667 611
668+++ 612+++
669** On window systems, lines which are exactly as wide as the window 613*** The new face `mode-line-inactive' is used to display the mode line
670(not counting the final newline character) are no longer broken into 614of non-selected windows. The `mode-line' face is now used to display
671two lines on the display (with just the newline on the second line). 615the mode line of the currently selected window.
672Instead, the newline now "overflows" into the right fringe, and the
673cursor will be displayed in the fringe when positioned on that newline.
674 616
675The new user option 'overflow-newline-into-fringe' may be set to nil to 617The new variable `mode-line-in-non-selected-windows' controls whether
676revert to the old behavior of continuing such lines. 618the `mode-line-inactive' face is used.
619
620+++
621*** You can now customize the use of window fringes. To control this
622for all frames, use M-x fringe-mode or the Show/Hide submenu of the
623top-level Options menu, or customize the `fringe-mode' variable. To
624control this for a specific frame, use the command M-x
625set-fringe-style.
677 626
678+++ 627+++
679** The buffer boundaries (i.e. first and last line in the buffer) may 628*** The buffer boundaries (i.e. first and last line in the buffer) may
680now be marked with angle bitmaps in the fringes. In addition, up and 629now be marked with angle bitmaps in the fringes. In addition, up and
681down arrow bitmaps may be shown at the top and bottom of the left or 630down arrow bitmaps may be shown at the top and bottom of the left or
682right fringe if the window can be scrolled in either direction. 631right fringe if the window can be scrolled in either direction.
@@ -697,498 +646,280 @@ arrow bitmaps in right fringe. To show just the angle bitmaps in the
697left fringe, but no arrow bitmaps, use ((top . left) (bottom . left)). 646left fringe, but no arrow bitmaps, use ((top . left) (bottom . left)).
698 647
699+++ 648+++
700** New command `display-local-help' displays any local help at point 649*** On window systems, lines which are exactly as wide as the window
701in the echo area. It is bound to `C-h .'. It normally displays the 650(not counting the final newline character) are no longer broken into
702same string that would be displayed on mouse-over using the 651two lines on the display (with just the newline on the second line).
703`help-echo' property, but, in certain cases, it can display a more 652Instead, the newline now "overflows" into the right fringe, and the
704keyboard oriented alternative. 653cursor will be displayed in the fringe when positioned on that newline.
705
706+++
707** New user option `help-at-pt-display-when-idle' allows to
708automatically show the help provided by `display-local-help' on
709point-over, after suitable idle time. The amount of idle time is
710determined by the user option `help-at-pt-timer-delay' and defaults
711to one second. This feature is turned off by default.
712
713---
714** New commands `scan-buf-next-region' and `scan-buf-previous-region'
715move to the start of the next (previous, respectively) region with
716non-nil help-echo property and display any help found there in the
717echo area, using `display-local-help'.
718
719+++
720** Help mode now only makes hyperlinks for faces when the face name is
721preceded or followed by the word `face'. It no longer makes
722hyperlinks for variables without variable documentation, unless
723preceded by one of the words `variable' or `option'. It now makes
724hyperlinks to Info anchors (or nodes) if the anchor (or node) name is
725enclosed in single quotes and preceded by `info anchor' or `Info
726anchor' (in addition to earlier `info node' and `Info node').
727
728+++
729** The max size of buffers and integers has been doubled.
730On 32bit machines, it is now 256M (i.e. 268435455).
731
732+++
733** The -f option, used from the command line to call a function,
734now reads arguments for the function interactively if it is
735an interactively callable function.
736
737---
738** sql changes.
739
740*** The variable `sql-product' controls the highlightng of different
741SQL dialects. This variable can be set globally via Customize, on a
742buffer-specific basis via local variable settings, or for the current
743session using the new SQL->Product submenu. (This menu replaces the
744SQL->Highlighting submenu.)
745
746The following values are supported:
747
748 ansi ANSI Standard (default)
749 db2 DB2
750 informix Informix
751 ingres Ingres
752 interbase Interbase
753 linter Linter
754 ms Microsoft
755 mysql MySQL
756 oracle Oracle
757 postgres Postgres
758 solid Solid
759 sqlite SQLite
760 sybase Sybase
761
762The current product name will be shown on the mode line following the
763SQL mode indicator.
764
765The technique of setting `sql-mode-font-lock-defaults' directly in
766your .emacs will no longer establish the default highlighting -- Use
767`sql-product' to accomplish this.
768
769ANSI keywords are always highlighted.
770
771*** The function `sql-add-product-keywords' can be used to add
772font-lock rules to the product specific rules. For example, to have
773all identifiers ending in "_t" under MS SQLServer treated as a type,
774you would use the following line in your .emacs file:
775
776 (sql-add-product-keywords 'ms
777 '(("\\<\\w+_t\\>" . font-lock-type-face)))
778
779*** Oracle support includes keyword highlighting for Oracle 9i. Most
780SQL and PL/SQL keywords are implemented. SQL*Plus commands are
781highlighted in `font-lock-doc-face'.
782
783*** Microsoft SQLServer support has been significantly improved.
784Keyword highlighting for SqlServer 2000 is implemented.
785sql-interactive-mode defaults to use osql, rather than isql, because
786osql flushes its error stream more frequently. Thus error messages
787are displayed when they occur rather than when the session is
788terminated.
789
790If the username and password are not provided to `sql-ms', osql is
791called with the -E command line argument to use the operating system
792credentials to authenticate the user.
793
794*** Postgres support is enhanced.
795Keyword highlighting of Postgres 7.3 is implemented. Prompting for
796the username and the pgsql `-U' option is added.
797
798*** MySQL support is enhanced.
799Keyword higlighting of MySql 4.0 is implemented.
800
801*** Imenu support has been enhanced to locate tables, views, indexes,
802packages, procedures, functions, triggers, sequences, rules, and
803defaults.
804
805*** Added SQL->Start SQLi Session menu entry which calls the
806appropriate sql-interactive-mode wrapper for the current setting of
807`sql-product'.
808
809---
810** M-x view-file and commands that use it now avoid interfering
811with special modes such as Tar mode.
812
813** Enhancements to apropos commands:
814
815+++
816*** The apropos commands now accept a list of words to match.
817When more than one word is specified, at least two of those words must
818be present for an item to match. Regular expression matching is still
819available.
820
821+++
822*** The new option `apropos-sort-by-scores' causes the matching items
823to be sorted according to their score. The score for an item is a
824number calculated to indicate how well the item matches the words or
825regular expression that you entered to the apropos command. The best
826match is listed first, and the calculated score is shown for each
827matching item.
828
829+++
830** The old bindings C-M-delete and C-M-backspace have been deleted,
831since there are situations where one or the other will shut down
832the operating system or your X server.
833
834---
835** New minor mode, Visible mode, toggles invisibility in the current buffer.
836When enabled, it makes all invisible text visible. When disabled, it
837restores the previous value of `buffer-invisibility-spec'.
838
839---
840** New command `kill-whole-line' kills an entire line at once.
841By default, it is bound to C-S-<backspace>.
842 654
843--- 655The new user option 'overflow-newline-into-fringe' may be set to nil to
844** New commands to operate on pairs of open and close characters: 656revert to the old behavior of continuing such lines.
845`insert-pair', `delete-pair', `raise-sexp'.
846 657
847+++ 658+++
848** A prefix argument of C-M-q in Emacs Lisp mode pretty-printifies the 659*** When display margins are present in a window, the fringes are now
849list starting after point. 660displayed between the margins and the buffer's text area, rather than
850 661at the edges of the window.
851** Dired mode:
852
853---
854*** New faces dired-header, dired-mark, dired-marked, dired-flagged,
855dired-ignored, dired-directory, dired-symlink, dired-warning
856introduced for Dired mode instead of font-lock faces.
857
858*** New Dired command `dired-compare-directories' marks files
859with different file attributes in two dired buffers.
860 662
861+++ 663+++
862*** New Dired command `dired-do-touch' (bound to T) changes timestamps 664*** A window may now have individual fringe and scroll-bar settings,
863of marked files with the value entered in the minibuffer. 665in addition to the individual display margin settings.
864 666
865+++ 667Such individual settings are now preserved when windows are split
866*** In Dired's ! command (dired-do-shell-command), `*' and `?' now 668horizontally or vertically, a saved window configuration is restored,
867control substitution of the file names only when they are surrounded 669or when the frame is resized.
868by whitespace. This means you can now use them as shell wildcards
869too. If you want to use just plain `*' as a wildcard, type `*""'; the
870doublequotes make no difference in the shell, but they prevent
871special treatment in `dired-do-shell-command'.
872 670
873+++ 671** Cursor Display Changes
874*** In Dired, the w command now copies the current line's file name
875into the kill ring. With a zero prefix arg, copies absolute file names.
876 672
877+++ 673+++
878** Dired-x: 674*** On X, MS Windows, and Mac OS, the blinking cursor's "off" state is
675now controlled by the variable `blink-cursor-alist'.
879 676
880+++ 677+++
881*** Omitting files is now a minor mode, dired-omit-mode. The mode toggling 678*** The X resource cursorBlink can be used to turn off cursor blinking.
882command is bound to M-o. A new command dired-mark-omitted, bound to M-O,
883marks omitted files. The variable dired-omit-files-p is obsoleted, use the
884mode toggling function instead.
885 679
886+++ 680+++
887** find-file-read-only visits multiple files in read-only mode, 681*** Emacs can produce an underscore-like (horizontal bar) cursor.
888when the file name contains wildcard characters. 682The underscore cursor is set by putting `(cursor-type . hbar)' in
683default-frame-alist. It supports variable heights, like the `bar'
684cursor does.
889 685
890+++ 686+++
891** find-alternate-file replaces the current file with multiple files, 687*** Display of hollow cursors now obeys the buffer-local value (if any)
892when the file name contains wildcard characters. 688of `cursor-in-non-selected-windows' in the buffer that the cursor
893 689appears in.
894** FFAP
895 690
896+++ 691+++
897*** New ffap commands and keybindings: C-x C-r (`ffap-read-only'), 692*** The variable `cursor-in-non-selected-windows' can now be set to any
898C-x C-v (`ffap-alternate-file'), C-x C-d (`ffap-list-directory'), 693of the recognized cursor types.
899C-x 4 r (`ffap-read-only-other-window'), C-x 4 d (`ffap-dired-other-window'),
900C-x 5 r (`ffap-read-only-other-frame'), C-x 5 d (`ffap-dired-other-frame').
901
902---
903*** FFAP accepts wildcards in a file name by default. C-x C-f passes
904it to `find-file' with non-nil WILDCARDS argument, which visits
905multiple files, and C-x d passes it to `dired'.
906
907** Info mode:
908 694
909+++ 695+++
910*** A numeric prefix argument of `info' selects an Info buffer 696** font-lock-lines-before specifies a number of lines before the
911with the number appended to the *info* buffer name (e.g. "*info*<2>"). 697current line that should be refontified when you change the buffer.
698The default value is 1.
912 699
913--- 700---
914*** isearch in Info uses Info-search and searches through multiple nodes. 701** JIT-lock changes
915Before leaving the initial Info node isearch fails once with the error
916message [initial node], and with subsequent C-s/C-r continues through
917other nodes. When isearch fails for the rest of the manual, it wraps
918aroung the whole manual to the top/final node. The user option
919`Info-isearch-search' controls whether to use Info-search for isearch,
920or the default isearch search function that wraps around the current
921Info node.
922
923*** New search commands: `Info-search-case-sensitively' (bound to S),
924`Info-search-backward', and `Info-search-next' which repeats the last
925search without prompting for a new search string.
926
927*** New command `Info-history-forward' (bound to r and new toolbar icon)
928moves forward in history to the node you returned from after using
929`Info-history-back' (renamed from `Info-last').
930 702
931*** New command `Info-history' (bound to L) displays a menu of visited nodes. 703*** The default settings for JIT stealth lock parameters are changed.
704The default value for the user option jit-lock-stealth-time is now 16
705instead of 3, and the default value of jit-lock-stealth-nice is now
7060.5 instead of 0.125. The new defaults should lower the CPU usage
707when Emacs is fontifying in the background.
932 708
933*** New command `Info-toc' (bound to T) creates a node with table of contents
934from the tree structure of menus of the current Info file.
935 709
936*** New command `info-apropos' searches the indices of the known 710*** jit-lock can now be delayed with `jit-lock-defer-time'.
937Info files on your system for a string, and builds a menu of the
938possible matches.
939
940*** New command `Info-copy-current-node-name' (bound to w) copies
941the current Info node name into the kill ring. With a zero prefix
942arg, puts the node name inside the `info' function call.
943
944---
945*** New face `info-xref-visited' distinguishes visited nodes from unvisited
946and a new option `Info-fontify-visited-nodes' to control this.
947 711
948*** http and ftp links in Info are now operational: they look like cross 712If this variable is non-nil, its value should be the amount of Emacs
949references and following them calls `browse-url'. 713idle time in seconds to wait before starting fontification. For
714example, if you set `jit-lock-defer-time' to 0.25, fontification will
715only happen after 0.25s of idle time.
950 716
951+++ 717*** contextual refontification is now separate from stealth fontification.
952*** Info now hides node names in menus and cross references by default.
953If you prefer the old behavior, you can set the new user option
954`Info-hide-note-references' to nil.
955 718
956--- 719jit-lock-defer-contextually is renamed jit-lock-contextually and
957*** Images in Info pages are supported. 720jit-lock-context-time determines the delay after which contextual
958Info pages show embedded images, in Emacs frames with image support. 721refontification takes place.
959Info documentation that includes images, processed with makeinfo
960version 4.7 or newer, compiles to Info pages with embedded images.
961 722
962+++ 723** Menu Bar changes
963*** The default value for `Info-scroll-prefer-subnodes' is now nil.
964 724
965--- 725---
966*** Info-index offers completion. 726*** A menu item "Show/Hide" was added to the top-level menu "Options".
727This menu allows you to turn various display features on and off (such
728as the fringes, the tool bar, the speedbar, and the menu bar itself).
729You can also move the vertical scroll bar to either side here or turn
730it off completely. There is also a menu-item to toggle displaying of
731current date and time, current line and column number in the
732mode-line.
967 733
968--- 734---
969** Support for the SQLite interpreter has been added to sql.el by calling 735*** Speedbar has moved from the "Tools" top level menu to "Show/Hide".
970'sql-sqlite'.
971
972** BibTeX mode:
973*** The new command bibtex-url browses a URL for the BibTeX entry at
974point (bound to C-c C-l and mouse-2, RET on clickable fields).
975
976*** The new command bibtex-entry-update (bound to C-c C-u) updates
977an existing BibTeX entry.
978
979*** New `bibtex-entry-format' option `required-fields', enabled by default.
980
981*** bibtex-maintain-sorted-entries can take values `plain',
982`crossref', and `entry-class' which control the sorting scheme used
983for BibTeX entries. `bibtex-sort-entry-class' controls the sorting
984scheme `entry-class'. TAB completion for reference keys and
985automatic detection of duplicates does not require anymore that
986bibtex-maintain-sorted-entries is non-nil.
987
988*** If the new variable bibtex-parse-keys-fast is non-nil,
989use fast but simplified algorithm for parsing BibTeX keys.
990
991*** If the new variable bibtex-autoadd-commas is non-nil,
992automatically add missing commas at end of BibTeX fields.
993
994*** The new variable bibtex-autofill-types contains a list of entry
995types for which fields are filled automatically (if possible).
996
997*** The new command bibtex-complete completes word fragment before
998point according to context (bound to M-tab).
999
1000*** The new commands bibtex-find-entry and bibtex-find-crossref
1001locate entries and crossref'd entries (bound to C-c C-s and C-c C-x).
1002Crossref fields are clickable (bound to mouse-2, RET).
1003
1004*** In BibTeX mode the command fill-paragraph (bound to M-q) fills
1005individual fields of a BibTeX entry.
1006
1007*** The new variables bibtex-files and bibtex-file-path define a set
1008of BibTeX files that are searched for entry keys.
1009
1010*** The new command bibtex-validate-globally checks for duplicate keys
1011in multiple BibTeX files.
1012
1013*** The new command bibtex-copy-summary-as-kill pushes summary
1014of BibTeX entry to kill ring (bound to C-c C-t).
1015 736
1016+++ 737+++
1017** When display margins are present in a window, the fringes are now 738** You can now customize fill-nobreak-predicate to control where
1018displayed between the margins and the buffer's text area, rather than 739filling can break lines. The value is now normally a list of
1019at the edges of the window. 740functions, but it can also be a single function, for compatibility.
1020
1021+++
1022** A window may now have individual fringe and scroll-bar settings,
1023in addition to the individual display margin settings.
1024 741
1025Such individual settings are now preserved when windows are split 742We provide two sample predicates, fill-single-word-nobreak-p and
1026horizontally or vertically, a saved window configuration is restored, 743fill-french-nobreak-p, for use in the value of fill-nobreak-predicate.
1027or when the frame is resized.
1028 744
1029+++ 745+++
1030** New functions frame-current-scroll-bars and window-current-scroll-bars. 746** New display feature: focus follows the mouse from one Emacs window
1031 747to another, even within a frame. If you set the variable
1032These functions return the current locations of the vertical and 748mouse-autoselect-window to non-nil value, moving the mouse to a
1033horizontal scroll bars in a frame or window. 749different Emacs window will select that window (minibuffer window can
750be selected only when it is active). The default is nil, so that this
751feature is not enabled.
1034 752
1035+++ 753+++
1036** Emacs now supports drag and drop for X. Dropping a file on a window 754** On X, when the window manager requires that you click on a frame to
1037 opens it, dropping text inserts the text. Dropping a file on a dired 755select it (give it focus), the selected window and cursor position
1038 buffer copies or moves the file to that directory. 756normally changes according to the mouse click position. If you set
757the variable x-mouse-click-focus-ignore-position to t, the selected
758window and cursor position do not change when you click on a frame
759to give it focus.
1039 760
1040+++ 761+++
1041** Under X, mouse-wheel-mode is turned on by default. 762** When you specify a frame size with --geometry, the size applies to
763all frames you create. A position specified with --geometry only
764affects the initial frame.
1042 765
1043+++ 766+++
1044** The X resource useXIM can be used to turn off use of XIM, which may 767** `special-display-buffer-names' and `special-display-regexps' now
1045speed up Emacs with slow networking to the X server. 768understand two new boolean pseudo-frame-parameters `same-frame' and
769`same-window'.
1046 770
1047If the configure option `--without-xim' was used to turn off use of 771---
1048XIM by default, the X resource useXIM can be used to turn it on. 772** New commands `scan-buf-next-region' and `scan-buf-previous-region'
773move to the start of the next (previous, respectively) region with
774non-nil help-echo property and display any help found there in the
775echo area, using `display-local-help'.
1049 776
1050+++ 777+++
1051** The X resource cursorBlink can be used to turn off cursor blinking. 778** In processing a local variables list, Emacs strips the prefix and
779suffix are from every line before processing all the lines.
1052 780
1053+++ 781+++
1054** `undo-only' does an undo which does not redo any previous undo. 782** `apply-macro-to-region-lines' now operates on all lines that begin
1055 783in the region, rather than on all complete lines in the region.
1056---
1057** `uniquify-strip-common-suffix' tells uniquify to prefer
1058`file|dir1' and `file|dir2' to `file|dir1/subdir' and `file|dir2/subdir'.
1059 784
1060+++ 785+++
1061** If the user visits a file larger than `large-file-warning-threshold', 786** You can now follow links by clicking Mouse-1 on the link.
1062Emacs prompts her for confirmation.
1063
1064---
1065** A UTF-7 coding system is available in the library `utf-7'.
1066
1067---
1068** GUD mode has its own tool bar for controlling execution of the inferior
1069and other common debugger commands.
1070 787
1071--- 788Traditionally, Emacs uses a Mouse-1 click to set point and a Mouse-2
1072** recentf changes. 789click to follow a link, whereas most other applications use a Mouse-1
790click for both purposes, depending on whether you click outside or
791inside a link. Now the behavior of a Mouse-1 click has been changed
792to match this context-sentitive dual behavior.
1073 793
1074The recent file list is now automatically cleanup when recentf mode is 794Depending on the current mode, a Mouse-2 click in Emacs may do much
1075enabled. The new option `recentf-auto-cleanup' controls when to do 795more than just follow a link, so the new Mouse-1 behavior is only
1076automatic cleanup. 796activated for modes which explicitly mark a clickable text as a "link"
797(see the new function `mouse-on-link-p' for details). The Lisp
798packages that are included in release 22.1 have been adapted to do
799this, but external packages may not yet support this. However, there
800is no risk in using such packages, as the worst thing that could
801happen is that you get the original Mouse-1 behavior when you click
802on a link, which typically means that you set point where you click.
1077 803
1078The `recentf-keep' option replaces `recentf-keep-non-readable-files-p' 804If you want to get the original Mouse-1 action also inside a link, you
1079and provides a more general mechanism to customize which file names to 805just need to press the Mouse-1 button a little longer than a normal
1080keep in the recent list. 806click (i.e. press and hold the Mouse-1 button for half a second before
807you release it).
1081 808
1082With the more advanced option: `recentf-filename-handler', you can 809Dragging the Mouse-1 inside a link still performs the original
1083specify a function that transforms filenames handled by recentf. For 810drag-mouse-1 action, typically copy the text.
1084example, if set to `file-truename', the same file will not be in the
1085recent list with different symbolic links.
1086 811
1087To follow naming convention, `recentf-menu-append-commands-flag' 812You can customize the new Mouse-1 behavior via the new user options
1088replaces the misnamed option `recentf-menu-append-commands-p'. The 813`mouse-1-click-follows-link' and `mouse-1-click-in-non-selected-windows'.
1089old name remains available as alias, but has been marked obsolete.
1090 814
1091+++ 815+++
1092** The default for the paper size (variable ps-paper-type) is taken 816** Emacs normally highlights mouse sensitive text whenever the mouse
1093from the locale. 817is over the text. By setting the new variable `mouse-highlight', you
818can optionally enable mouse highlighting only after you move the
819mouse, so that highlighting disappears when you press a key. You can
820also disable mouse highlighting.
1094 821
1095+++ 822+++
1096** Init file changes 823** You can now customize if selecting a region by dragging the mouse
1097 824shall not copy the selected text to the kill-ring by setting the new
1098You can now put the init files .emacs and .emacs_SHELL under 825variable mouse-drag-copy-region to nil.
1099~/.emacs.d or directly under ~. Emacs will find them in either place.
1100
1101---
1102** partial-completion-mode now does partial completion on directory names.
1103 826
1104--- 827---
1105** skeleton.el now supports using - to mark the skeleton-point without 828** mouse-wheels can now scroll a specific fraction of the window
1106 interregion interaction. @ has reverted to only setting 829(rather than a fixed number of lines) and the scrolling is `progressive'.
1107 skeleton-positions and no longer sets skeleton-point. Skeletons
1108 which used @ to mark skeleton-point independent of _ should now use -
1109 instead. The updated skeleton-insert docstring explains these new
1110 features along with other details of skeleton construction.
1111 830
1112--- 831---
1113** MH-E changes. 832** Unexpected yanking of text due to accidental clicking on the mouse
1114 833wheel button (typically mouse-2) during wheel scrolling is now avoided.
1115Upgraded to MH-E version 7.82. There have been major changes since 834This behavior can be customized via the mouse-wheel-click-event and
1116version 5.0.2; see MH-E-NEWS for details. 835mouse-wheel-inhibit-click-time variables.
1117
1118+++
1119** The `emacsclient' command understands the options `--eval' and
1120`--display' which tell Emacs respectively to evaluate the given elisp
1121expression and to use the given display when visiting files.
1122 836
1123+++ 837+++
1124** User option `server-mode' can be used to start a server process. 838** Under X, mouse-wheel-mode is turned on by default.
1125 839
1126+++ 840+++
1127** The mode line position information now comes before the major mode. 841** M-x setenv now expands environment variables of the form `$foo' and
1128When the file is maintained under version control, that information 842`${foo}' in the specified new value of the environment variable. To
1129appears between the position information and the major mode. 843include a `$' in the value, use `$$'.
1130 844
1131+++ 845+++
1132** C-x s (save-some-buffers) now offers an option `d' to diff a buffer 846** Unquoted `$' in file names do not signal an error any more when
1133against its file, so you can see what changes you would be saving. 847the corresponding environment variable does not exist.
848Instead, the `$ENVVAR' text is left as is, so that `$$' quoting
849is only rarely needed.
1134 850
1135+++ 851---
1136** You can now customize the use of window fringes. To control this 852** Language environment and various default coding systems are setup
1137for all frames, use M-x fringe-mode or the Show/Hide submenu of the 853more correctly according to the current locale name. If the locale
1138top-level Options menu, or customize the `fringe-mode' variable. To 854name doesn't specify a charset, the default is what glibc defines.
1139control this for a specific frame, use the command M-x 855This change may result in using the different coding systems as
1140set-fringe-style. 856default in some locale (e.g. vi_VN).
1141 857
1142+++ 858+++
1143** There is a new user option `mail-default-directory' that allows you 859** The default for the paper size (variable ps-paper-type) is taken
1144to specify the value of `default-directory' for mail buffers. This 860from the locale.
1145directory is used for auto-save files of mail buffers. It defaults to
1146"~/".
1147 861
1148+++ 862+++
1149** When you are root, and you visit a file whose modes specify 863** The keyboard-coding-system is now automatically set based on your
1150read-only, the Emacs buffer is now read-only too. Type C-x C-q if you 864current locale settings if you are not using a window system. This
1151want to make the buffer writable. (As root, you can in fact alter the 865may mean that the META key doesn't work but generates non-ASCII
1152file.) 866characters instead, depending on how the terminal (or terminal
867emulator) works. Use `set-keyboard-coding-system' (or customize
868keyboard-coding-system) if you prefer META to work (the old default)
869or if the locale doesn't describe the character set actually generated
870by the keyboard. See Info node `Single-Byte Character Support'.
1153 871
1154+++ 872+++
1155** The new command `revert-buffer-with-coding-system' (C-x RET r) 873** The new command `revert-buffer-with-coding-system' (C-x RET r)
1156revisits the current file using a coding system that you specify. 874revisits the current file using a coding system that you specify.
1157 875
1158+++ 876+++
877** New command `recode-region' decodes the region again by a specified
878coding system.
879
880+++
1159** The new command `recode-file-name' changes the encoding of the name 881** The new command `recode-file-name' changes the encoding of the name
1160of a file. 882of a file.
1161 883
1162--- 884---
1163** `ps-print' can now print characters from the mule-unicode charsets. 885** New command `ucs-insert' inserts a character specified by its
886unicode.
1164 887
1165Printing text with characters from the mule-unicode-* sets works with 888+++
1166ps-print, provided that you have installed the appropriate BDF fonts. 889** The new command `set-file-name-coding-system' (C-x RET F) sets
1167See the file INSTALL for URLs where you can find these fonts. 890coding system for encoding and decoding file names. A new menu item
891(Options->Mule->Set Coding Systems->For File Name) invokes this
892command.
1168 893
1169--- 894+++
1170** The new options `buffers-menu-show-directories' and 895** New command quail-show-key shows what key (or key sequence) to type
1171`buffers-menu-show-status' let you control how buffers are displayed 896in the current input method to input a character at point.
1172in the menu dropped down when you click "Buffers" from the menu bar.
1173 897
1174`buffers-menu-show-directories' controls whether the menu displays 898+++
1175leading directories as part of the file name visited by the buffer. 899** Limited support for character `unification' has been added.
1176If its value is `unless-uniquify', the default, directories are 900Emacs now knows how to translate between different representations of
1177shown unless uniquify-buffer-name-style' is non-nil. The value of nil 901the same characters in various Emacs charsets according to standard
1178and t turn the display of directories off and on, respectively. 902Unicode mappings. This applies mainly to characters in the ISO 8859
903sets plus some other 8-bit sets, but can be extended. For instance,
904translation works amongst the Emacs ...-iso8859-... charsets and the
905mule-unicode-... ones.
1179 906
1180`buffers-menu-show-status' controls whether the Buffers menu includes 907By default this translation happens automatically on encoding.
1181the modified and read-only status of the buffers. By default it is 908Self-inserting characters are translated to make the input conformant
1182t, and the status is shown. 909with the encoding of the buffer in which it's being used, where
910possible.
1183 911
1184Setting these variables directly does not take effect until next time 912You can force a more complete unification with the user option
1185the Buffers menu is regenerated. 913unify-8859-on-decoding-mode. That maps all the Latin-N character sets
914into Unicode characters (from the latin-iso8859-1 and
915mule-unicode-0100-24ff charsets) on decoding. Note that this mode
916will often effectively clobber data with an iso-2022 encoding.
1186 917
1187+++ 918---
1188** The commands M-x customize-face and M-x customize-face-other-window 919** There is support for decoding Greek and Cyrillic characters into
1189now look at the character after point. If a face or faces are 920either Unicode (the mule-unicode charsets) or the iso-8859 charsets,
1190specified for that character, the commands by default customize those 921when possible. The latter are more space-efficient. This is
1191faces. 922controlled by user option utf-fragment-on-decoding.
1192 923
1193--- 924---
1194** New language environments: French, Ukrainian, Tajik, 925** New language environments: French, Ukrainian, Tajik,
@@ -1198,13 +929,6 @@ Italian, Russian, Malayalam, Tamil, Russian, Chinese-EUC-TW. (Set up
1198automatically according to the locale.) 929automatically according to the locale.)
1199 930
1200--- 931---
1201** Indian support has been updated.
1202The in-is13194 coding system is now Unicode-based. CDAC fonts are
1203assumed. There is a framework for supporting various
1204Indian scripts, but currently only Devanagari, Malayalam and Tamil are
1205supported.
1206
1207---
1208** New input methods: latin-alt-postfix, latin-postfix, latin-prefix, 932** New input methods: latin-alt-postfix, latin-postfix, latin-prefix,
1209ukrainian-computer, belarusian, bulgarian-bds, russian-computer, 933ukrainian-computer, belarusian, bulgarian-bds, russian-computer,
1210vietnamese-telex, lithuanian-numeric, lithuanian-keyboard, 934vietnamese-telex, lithuanian-numeric, lithuanian-keyboard,
@@ -1213,17 +937,30 @@ bulgarian-phonetic, dutch, slovenian, croatian, malayalam-inscript,
1213tamil-inscript. 937tamil-inscript.
1214 938
1215--- 939---
1216** A new coding system `euc-tw' has been added for traditional Chinese 940** New input method chinese-sisheng for inputting Chinese Pinyin
1217in CNS encoding; it accepts both Big 5 and CNS as input; on saving, 941characters.
1218Big 5 is then converted to CNS.
1219 942
1220--- 943---
1221** Many new coding systems are available by loading the `code-pages' 944** Improved Thai support. A new minor mode `thai-word-mode' (which is
1222library. These include complete versions of most of those in 945automatically activated if you select Thai as a language
1223codepage.el, based on Unicode mappings. `codepage-setup' is now 946environment) changes key bindings of most word-oriented commands to
1224obsolete and is used only in the MS-DOS port of Emacs. windows-1252 947versions which recognize Thai words. Affected commands are
1225and windows-1251 are preloaded since the former is so common and the 948 M-f (forward-word)
1226latter is used by GNU locales. 949 M-b (backward-word)
950 M-d (kill-word)
951 M-DEL (backward-kill-word)
952 M-t (transpose-words)
953 M-q (fill-paragraph)
954
955---
956** Indian support has been updated.
957The in-is13194 coding system is now Unicode-based. CDAC fonts are
958assumed. There is a framework for supporting various
959Indian scripts, but currently only Devanagari, Malayalam and Tamil are
960supported.
961
962---
963** A UTF-7 coding system is available in the library `utf-7'.
1227 964
1228--- 965---
1229** The utf-8/16 coding systems have been enhanced. 966** The utf-8/16 coding systems have been enhanced.
@@ -1240,6 +977,19 @@ one-dimensional internal charsets, specifically the ISO-8859 ones.
1240The utf-16 coding system is affected similarly. 977The utf-16 coding system is affected similarly.
1241 978
1242--- 979---
980** A new coding system `euc-tw' has been added for traditional Chinese
981in CNS encoding; it accepts both Big 5 and CNS as input; on saving,
982Big 5 is then converted to CNS.
983
984---
985** Many new coding systems are available by loading the `code-pages'
986library. These include complete versions of most of those in
987codepage.el, based on Unicode mappings. `codepage-setup' is now
988obsolete and is used only in the MS-DOS port of Emacs. windows-1252
989and windows-1251 are preloaded since the former is so common and the
990latter is used by GNU locales.
991
992---
1243** New variable `utf-translate-cjk-unicode-range' controls which 993** New variable `utf-translate-cjk-unicode-range' controls which
1244Unicode characters to translate in `utf-translate-cjk-mode'. 994Unicode characters to translate in `utf-translate-cjk-mode'.
1245 995
@@ -1248,167 +998,279 @@ Unicode characters to translate in `utf-translate-cjk-mode'.
1248characters encodable by the utf-8 coding system. Just specify the 998characters encodable by the utf-8 coding system. Just specify the
1249fontset appropriately. 999fontset appropriately.
1250 1000
1251--- 1001+++
1252** New command `ucs-insert' inserts a character specified by its 1002** Vertical scrolling is now possible within incremental search.
1253unicode. 1003To enable this feature, customize the new user option
1004`isearch-allow-scroll'. User written commands which satisfy stringent
1005constraints can be marked as "scrolling commands". See the Emacs manual
1006for details.
1254 1007
1255+++ 1008+++
1256** Limited support for character `unification' has been added. 1009** C-w in incremental search now grabs either a character or a word,
1257Emacs now knows how to translate between different representations of 1010making the decision in a heuristic way. This new job is done by the
1258the same characters in various Emacs charsets according to standard 1011command `isearch-yank-word-or-char'. To restore the old behavior,
1259Unicode mappings. This applies mainly to characters in the ISO 8859 1012bind C-w to `isearch-yank-word' in `isearch-mode-map'.
1260sets plus some other 8-bit sets, but can be extended. For instance,
1261translation works amongst the Emacs ...-iso8859-... charsets and the
1262mule-unicode-... ones.
1263 1013
1264By default this translation happens automatically on encoding. 1014+++
1265Self-inserting characters are translated to make the input conformant 1015** C-y in incremental search now grabs the next line if point is already
1266with the encoding of the buffer in which it's being used, where 1016at the end of a line.
1267possible.
1268 1017
1269You can force a more complete unification with the user option 1018+++
1270unify-8859-on-decoding-mode. That maps all the Latin-N character sets 1019** C-M-w deletes and C-M-y grabs a character in isearch mode.
1271into Unicode characters (from the latin-iso8859-1 and 1020Another method to grab a character is to enter the minibuffer by `M-e'
1272mule-unicode-0100-24ff charsets) on decoding. Note that this mode 1021and to type `C-f' at the end of the search string in the minibuffer.
1273will often effectively clobber data with an iso-2022 encoding.
1274 1022
1275--- 1023+++
1276** There is support for decoding Greek and Cyrillic characters into 1024** M-% typed in isearch mode invokes `query-replace' or
1277either Unicode (the mule-unicode charsets) or the iso-8859 charsets, 1025`query-replace-regexp' (depending on search mode) with the current
1278when possible. The latter are more space-efficient. This is 1026search string used as the string to replace.
1279controlled by user option utf-fragment-on-decoding.
1280 1027
1281+++ 1028+++
1282** The new command `set-file-name-coding-system' (C-x RET F) sets 1029** Isearch no longer adds `isearch-resume' commands to the command
1283coding system for encoding and decoding file names. A new menu item 1030history by default. To enable this feature, customize the new
1284(Options->Mule->Set Coding Systems->For File Name) invokes this 1031user option `isearch-resume-in-command-history'.
1285command.
1286 1032
1287--- 1033---
1288** The scrollbar under LessTif or Motif has a smoother drag-scrolling. 1034** New user option `query-replace-skip-read-only': when non-nil,
1289On the other hand, the size of the thumb does not represent the actual 1035`query-replace' and related functions simply ignore
1290amount of text shown any more (only a crude approximation of it). 1036a match if part of it has a read-only property.
1291 1037
1292--- 1038+++
1293** The pop up menus for Lucid now stay up if you do a fast click and can 1039** When used interactively, the commands `query-replace-regexp' and
1294be navigated with the arrow keys (like Gtk+, Mac and W32). 1040`replace-regexp' allow \,expr to be used in a replacement string,
1041where expr is an arbitrary Lisp expression evaluated at replacement
1042time. In many cases, this will be more convenient than using
1043`query-replace-regexp-eval'. `\#' in a replacement string now refers
1044to the count of replacements already made by the replacement command.
1045All regular expression replacement commands now allow `\?' in the
1046replacement string to specify a position where the replacement string
1047can be edited for each replacement.
1295 1048
1296+++ 1049+++
1297** The Lucid menus can display multilingual text in your locale. You have 1050** query-replace uses isearch lazy highlighting when the new user option
1298to explicitly specify a fontSet resource for this to work, for example 1051`query-replace-lazy-highlight' is non-nil.
1299`-xrm "Emacs*fontSet: -*-helvetica-medium-r-*--*-120-*-*-*-*-*-*,*"'.
1300 1052
1301--- 1053---
1302** Dialogs for Lucid/Athena and Lesstif/Motif now pops down when pressing 1054** The current match in query-replace is highlighted in new face
1303ESC, like they do for Gtk+, Mac and W32. 1055`query-replace' which by default inherits from isearch face.
1056
1057+++
1058** M-x compare-windows now can automatically skip non-matching text to
1059resync points in both windows.
1060
1061+++
1062** The commands M-x customize-face and M-x customize-face-other-window
1063now look at the character after point. If a face or faces are
1064specified for that character, the commands by default customize those
1065faces.
1304 1066
1305--- 1067---
1306** Dialogs and menus pop down when pressing C-g. 1068** The face-customization widget has been reworked to be less confusing.
1069In particular, when you enable a face attribute using the corresponding
1070check-box, there's no longer a redundant `*' option in value selection
1071for that attribute; the values you can choose are only those which make
1072sense for the attribute. When an attribute is de-selected by unchecking
1073its check-box, then the (now ignored, but still present temporarily in
1074case you re-select the attribute) value is hidden.
1075
1076+++
1077** When you set or reset a variable's value in a Customize buffer,
1078the previous value becomes the "backup value" of the variable.
1079You can go back to that backup value by selecting "Use Backup Value"
1080under the "[State]" button.
1081
1082** Dired mode:
1307 1083
1308--- 1084---
1309** The menu item "Open File..." has been split into two items, "New File..." 1085*** New faces dired-header, dired-mark, dired-marked, dired-flagged,
1310and "Open File...". "Open File..." now opens only existing files. This is 1086dired-ignored, dired-directory, dired-symlink, dired-warning
1311to support existing GUI file selection dialogs better. 1087introduced for Dired mode instead of font-lock faces.
1312 1088
1313+++ 1089+++
1314** The file selection dialog for Gtk+, Mac, W32 and Motif/Lesstif can be 1090*** New Dired command `dired-compare-directories' marks files
1315disabled by customizing the variable `use-file-dialog'. 1091with different file attributes in two dired buffers.
1316 1092
1317+++ 1093+++
1318** For Gtk+ version 2.4, you can make Emacs use the old file dialog 1094*** New Dired command `dired-do-touch' (bound to T) changes timestamps
1319by setting the variable `x-use-old-gtk-file-dialog' to t. Default is to use 1095of marked files with the value entered in the minibuffer.
1320the new dialog.
1321 1096
1322+++ 1097+++
1323** Emacs can produce an underscore-like (horizontal bar) cursor. 1098*** In Dired's ! command (dired-do-shell-command), `*' and `?' now
1324The underscore cursor is set by putting `(cursor-type . hbar)' in 1099control substitution of the file names only when they are surrounded
1325default-frame-alist. It supports variable heights, like the `bar' 1100by whitespace. This means you can now use them as shell wildcards
1326cursor does. 1101too. If you want to use just plain `*' as a wildcard, type `*""'; the
1102doublequotes make no difference in the shell, but they prevent
1103special treatment in `dired-do-shell-command'.
1327 1104
1328+++ 1105+++
1329** On X, MS Windows, and Mac OS, the blinking cursor's "off" state is 1106*** In Dired, the w command now copies the current line's file name
1330now controlled by the variable `blink-cursor-alist'. 1107into the kill ring. With a zero prefix arg, copies absolute file names.
1331 1108
1332** Filesets are collections of files. You can define a fileset in 1109+++
1333various ways, such as based on a directory tree or based on 1110** The variables dired-free-space-program and dired-free-space-args
1334program files that include other program files. 1111have been renamed to directory-free-space-program and
1112directory-free-space-args, and they now apply whenever Emacs puts a
1113directory listing into a buffer.
1335 1114
1336Once you have defined a fileset, you can perform various operations on 1115+++
1337all the files in it, such as visiting them or searching and replacing 1116** Dired-x:
1338in them. 1117
1118+++
1119*** Omitting files is now a minor mode, dired-omit-mode. The mode toggling
1120command is bound to M-o. A new command dired-mark-omitted, bound to * O,
1121marks omitted files. The variable dired-omit-files-p is obsoleted, use the
1122mode toggling function instead.
1123
1124+++
1125** In Outline mode, hide-body no longer hides lines at the top
1126of the file that precede the first header line.
1127
1128+++
1129** Occur, Info, and comint-derived modes now support using
1130M-x font-lock-mode to toggle fontification. The variable
1131`Info-fontify' is no longer applicable; to disable fontification,
1132remove `turn-on-font-lock' from `Info-mode-hook'.
1339 1133
1340--- 1134---
1341** PO translation files are decoded according to their MIME headers 1135** The terminal emulation code in term.el has been improved, it can
1342when Emacs visits them. 1136run most curses applications now.
1343 1137
1344--- 1138---
1345** The game `mpuz' is enhanced. 1139** The comint prompt can now be made read-only, using the new user
1140option `comint-prompt-read-only'. This is not enabled by default,
1141except in IELM buffers. The read-only status of IELM prompts can be
1142controlled with the new user option `ielm-prompt-read-only', which
1143overrides `comint-prompt-read-only'.
1346 1144
1347`mpuz' now allows the 2nd factor not to have two identical digits. By 1145The new commands `comint-kill-whole-line' and `comint-kill-region'
1348default, all trivial operations involving whole lines are performed 1146support editing comint buffers with read-only prompts.
1349automatically. The game uses faces for better visual feedback. 1147
1148`comint-kill-whole-line' is like `kill-whole-line', but ignores both
1149read-only and field properties. Hence, it always kill entire
1150lines, including any prompts.
1151
1152`comint-kill-region' is like `kill-region', except that it ignores
1153read-only properties, if it is safe to do so. This means that if any
1154part of a prompt is deleted, then the entire prompt must be deleted
1155and that all prompts must stay at the beginning of a line. If this is
1156not the case, then `comint-kill-region' behaves just like
1157`kill-region' if read-only are involved: it copies the text to the
1158kill-ring, but does not delete it.
1159
1160+++
1161** The new command `comint-insert-previous-argument' in comint-derived
1162modes (shell-mode etc) inserts arguments from previous command lines,
1163like bash's `ESC .' binding. It is bound by default to `C-c .', but
1164otherwise behaves quite similarly to the bash version.
1165
1166** `comint-use-prompt-regexp-instead-of-fields' has been renamed
1167`comint-use-prompt-regexp'. The old name has been kept as an alias,
1168but declared obsolete.
1169
1170+++
1171** Telnet now prompts you for a port number with C-u M-x telnet.
1350 1172
1351--- 1173---
1352** The new variable `x-select-request-type' controls how Emacs 1174** M-x compile has become more robust and reliable
1353requests X selection. The default value is nil, which means that 1175
1354Emacs requests X selection with types COMPOUND_TEXT and UTF8_STRING, 1176Quite a few more kinds of messages are recognized. Messages that are
1355and use the more appropriately result. 1177recognized as warnings or informational come in orange or green, instead of
1178red. Informational messages are by default skipped with `next-error'
1179(controlled by `compilation-skip-threshold').
1180
1181Location data is collected on the fly as the *compilation* buffer changes.
1182This means you could modify messages to make them point to different files.
1183This also means you can not go to locations of messages you may have deleted.
1184
1185The variable `compilation-error-regexp-alist' has now become customizable. If
1186you had added your own regexps to this, you'll probably need to include a
1187leading `^', otherwise they'll match anywhere on a line. There is now also a
1188`compilation-mode-font-lock-keywords' and it nicely handles all the checks
1189that configure outputs and -o options so you see at a glance where you are.
1190
1191The new file etc/compilation.txt gives examples of each type of message.
1192
1193** Compilation mode enhancements:
1356 1194
1357+++ 1195+++
1358** The parameters of automatic hscrolling can now be customized. 1196*** New user option `compilation-environment'.
1359The variable `hscroll-margin' determines how many columns away from 1197This option allows you to specify environment variables for inferior
1360the window edge point is allowed to get before automatic hscrolling 1198compilation processes without affecting the environment that all
1361will horizontally scroll the window. The default value is 5. 1199subprocesses inherit.
1362 1200
1363The variable `hscroll-step' determines how many columns automatic 1201+++
1364hscrolling scrolls the window when point gets too close to the 1202** Grep has been decoupled from compilation mode setup.
1365window edge. If its value is zero, the default, Emacs scrolls the
1366window so as to center point. If its value is an integer, it says how
1367many columns to scroll. If the value is a floating-point number, it
1368gives the fraction of the window's width to scroll the window.
1369 1203
1370The variable `automatic-hscrolling' was renamed to 1204---
1371`auto-hscroll-mode'. The old name is still available as an alias. 1205*** There's a new separate package grep.el.
1372 1206
1373** TeX modes: 1207---
1208*** M-x grep has been adapted to new compile
1374 1209
1375*** C-c C-c prompts for a command to run, and tries to offer a good default. 1210Hits are fontified in green, and hits in binary files in orange. Grep buffers
1211can be saved and automatically revisited with the new Grep mode.
1212
1213---
1214*** Grep commands now have their own submenu and customization group.
1376 1215
1377+++ 1216+++
1378*** The user option `tex-start-options-string' has been replaced 1217*** `grep-find' is now also available under the name `find-grep' where
1379by two new user options: `tex-start-options', which should hold 1218people knowing `find-grep-dired' would probably expect it.
1380command-line options to feed to TeX, and `tex-start-commands' which should hold
1381TeX commands to use at startup.
1382 1219
1383--- 1220---
1384*** verbatim environments are now highlighted in courier by font-lock 1221*** The new variables `grep-window-height', `grep-auto-highlight', and
1385and super/sub-scripts are made into super/sub-scripts. 1222`grep-scroll-output' can be used to override the corresponding
1223compilation mode settings for grep commands.
1386 1224
1387+++ 1225+++
1388*** New major mode doctex-mode for *.dtx files. 1226*** New option `grep-highlight-matches' highlightes matches in *grep*
1227buffer. It uses a special feature of some grep programs which accept
1228--color option to output markers around matches. When going to the next
1229match with `next-error' the exact match is highlighted in the source
1230buffer. Otherwise, if `grep-highlight-matches' is nil, the whole
1231source line is highlighted.
1389 1232
1390+++ 1233+++
1391** New display feature: focus follows the mouse from one Emacs window 1234*** New key bindings in grep output window:
1392to another, even within a frame. If you set the variable 1235SPC and DEL scrolls window up and down. C-n and C-p moves to next and
1393mouse-autoselect-window to non-nil value, moving the mouse to a 1236previous match in the grep window. RET jumps to the source line of
1394different Emacs window will select that window (minibuffer window can 1237the current match. `n' and `p' shows next and previous match in
1395be selected only when it is active). The default is nil, so that this 1238other window, but does not switch buffer. `{' and `}' jumps to the
1396feature is not enabled. 1239previous or next file in the grep output. TAB also jumps to the next
1240file.
1397 1241
1398+++ 1242+++
1399** On X, when the window manager requires that you click on a frame to 1243** M-x grep now tries to avoid appending `/dev/null' to the command line
1400select it (give it focus), the selected window and cursor position 1244by using GNU grep `-H' option instead. M-x grep automatically
1401normally changes according to the mouse click position. If you set 1245detects whether this is possible or not the first time it is invoked.
1402the variable x-mouse-click-focus-ignore-position to t, the selected 1246When `-H' is used, the grep command line supplied by the user is passed
1403window and cursor position do not change when you click on a frame 1247unchanged to the system to execute, which allows more complicated
1404to give it focus. 1248command lines to be used than was possible before.
1405 1249
1406+++ 1250+++
1407** The new command `describe-char' (C-u C-x =) pops up a buffer with 1251** New options `next-error-highlight' and `next-error-highlight-no-select'
1408description various information about a character, including its 1252specify the method of highlighting of the corresponding source line
1409encodings and syntax, its text properties, how to input, overlays, and 1253in new face `next-error'.
1410widgets at point. You can get more information about some of them, by 1254
1411clicking on mouse-sensitive areas or moving there and pressing RET. 1255+++
1256** A new minor mode `next-error-follow-minor-mode' can be used in
1257compilation-mode, grep-mode, occur-mode, and diff-mode (i.e. all the
1258modes that can use `next-error'). In this mode, cursor motion in the
1259buffer causes automatic display in another window of the corresponding
1260matches, compilation errors, etc. This minor mode can be toggled with
1261C-c C-f.
1262
1263+++
1264** M-x diff uses diff-mode instead of compilation-mode.
1265
1266+++
1267** In the *Occur* buffer, `o' switches to it in another window, and
1268C-o displays the current line's occurrence in another window without
1269switching to it.
1270
1271+++
1272** You can now use next-error (C-x `) and previous-error to advance to
1273the next/previous matching line found by M-x occur.
1412 1274
1413+++ 1275+++
1414** The new command `multi-occur' is just like `occur', except it can 1276** The new command `multi-occur' is just like `occur', except it can
@@ -1418,101 +1280,128 @@ buffers to search by their filename. Internally, Occur mode has been
1418rewritten, and now uses font-lock, among other changes. 1280rewritten, and now uses font-lock, among other changes.
1419 1281
1420+++ 1282+++
1421** The default values of paragraph-start and indent-line-function have 1283** font-lock: in modes like C and Lisp where the fontification assumes that
1422been changed to reflect those used in Text mode rather than those used 1284an open-paren in column 0 is always outside of any string or comment,
1423in Indented-Text mode. 1285font-lock now highlights any such open-paren-in-column-zero in bold-red
1286if it is inside a string or a comment, to indicate that it can cause
1287trouble with fontification and/or indentation.
1424 1288
1425--- 1289** Enhancements to apropos commands:
1426** New user option `query-replace-skip-read-only': when non-nil,
1427`query-replace' and related functions simply ignore
1428a match if part of it has a read-only property.
1429 1290
1430+++ 1291+++
1431** When used interactively, the commands `query-replace-regexp' and 1292*** The apropos commands now accept a list of words to match.
1432`replace-regexp' allow \,expr to be used in a replacement string, 1293When more than one word is specified, at least two of those words must
1433where expr is an arbitrary Lisp expression evaluated at replacement 1294be present for an item to match. Regular expression matching is still
1434time. In many cases, this will be more convenient than using 1295available.
1435`query-replace-regexp-eval'. `\#' in a replacement string now refers
1436to the count of replacements already made by the replacement command.
1437All regular expression replacement commands now allow `\?' in the
1438replacement string to specify a position where the replacement string
1439can be edited for each replacement.
1440 1296
1441+++ 1297+++
1442** query-replace uses isearch lazy highlighting when the new user option 1298*** The new option `apropos-sort-by-scores' causes the matching items
1443`query-replace-lazy-highlight' is non-nil. 1299to be sorted according to their score. The score for an item is a
1300number calculated to indicate how well the item matches the words or
1301regular expression that you entered to the apropos command. The best
1302match is listed first, and the calculated score is shown for each
1303matching item.
1444 1304
1445--- 1305+++
1446** The current match in query-replace is highlighted in new face 1306** You can have several Emacs servers on the same machine.
1447`query-replace' which by default inherits from isearch face. 1307
1308 % emacs --eval '(setq server-name "foo")' -f server-start &
1309 % emacs --eval '(setq server-name "bar")' -f server-start &
1310 % emacsclient -s foo file1
1311 % emacsclient -s bar file2
1448 1312
1449+++ 1313+++
1450** Emacs normally highlights mouse sensitive text whenever the mouse 1314** The `emacsclient' command understands the options `--eval' and
1451is over the text. By setting the new variable `mouse-highlight', you 1315`--display' which tell Emacs respectively to evaluate the given elisp
1452can optionally enable mouse highlighting only after you move the 1316expression and to use the given display when visiting files.
1453mouse, so that highlighting disappears when you press a key. You can
1454also disable mouse highlighting.
1455 1317
1456+++ 1318+++
1457** You can now customize if selecting a region by dragging the mouse 1319** User option `server-mode' can be used to start a server process.
1458shall not copy the selected text to the kill-ring by setting the new
1459variable mouse-drag-copy-region to nil.
1460 1320
1461+++ 1321+++
1462** font-lock: in modes like C and Lisp where the fontification assumes that 1322** New user option `add-log-always-start-new-record'.
1463an open-paren in column 0 is always outside of any string or comment, 1323When this option is enabled, M-x add-change-log-entry always
1464font-lock now highlights any such open-paren-in-column-zero in bold-red 1324starts a new record regardless of when the last record is.
1465if it is inside a string or a comment, to indicate that it can cause 1325
1466trouble with fontification and/or indentation. 1326** Menu support:
1327
1328---
1329*** Dialogs and menus pop down if you type C-g.
1330
1331---
1332*** The menu item "Open File..." has been split into two items, "New File..."
1333and "Open File...". "Open File..." now opens only existing files. This is
1334to support existing GUI file selection dialogs better.
1467 1335
1468+++ 1336+++
1469** There's a new face `minibuffer-prompt'. 1337*** The file selection dialog for Gtk+, Mac, W32 and Motif/Lesstif can be
1470Emacs adds this face to the list of text properties stored in the 1338disabled by customizing the variable `use-file-dialog'.
1471variable `minibuffer-prompt-properties', which is used to display the 1339
1472prompt string. 1340** X Windows Support:
1473 1341
1474+++ 1342+++
1475** The new face `mode-line-inactive' is used to display the mode line 1343*** Emacs now supports drag and drop for X. Dropping a file on a window
1476of non-selected windows. The `mode-line' face is now used to display 1344 opens it, dropping text inserts the text. Dropping a file on a dired
1477the mode line of the currently selected window. 1345 buffer copies or moves the file to that directory.
1478 1346
1479The new variable `mode-line-in-non-selected-windows' controls whether 1347+++
1480the `mode-line-inactive' face is used. 1348*** Under X11, it is possible to swap Alt and Meta (and Super and Hyper).
1349The new variables `x-alt-keysym', `x-hyper-keysym', `x-meta-keysym',
1350and `x-super-keysym' can be used to choose which keysyms Emacs should
1351use for the modifiers. For example, the following two lines swap
1352Meta and Alt:
1353 (setq x-alt-keysym 'meta)
1354 (setq x-meta-keysym 'alt)
1355
1356+++
1357*** The X resource useXIM can be used to turn off use of XIM, which may
1358speed up Emacs with slow networking to the X server.
1359
1360If the configure option `--without-xim' was used to turn off use of
1361XIM by default, the X resource useXIM can be used to turn it on.
1481 1362
1482--- 1363---
1483** A menu item "Show/Hide" was added to the top-level menu "Options". 1364*** The new variable `x-select-request-type' controls how Emacs
1484This menu allows you to turn various display features on and off (such 1365requests X selection. The default value is nil, which means that
1485as the fringes, the tool bar, the speedbar, and the menu bar itself). 1366Emacs requests X selection with types COMPOUND_TEXT and UTF8_STRING,
1486You can also move the vertical scroll bar to either side here or turn 1367and use the more appropriately result.
1487it off completely. There is also a menu-item to toggle displaying of 1368
1488current date and time, current line and column number in the 1369---
1489mode-line. 1370*** The scrollbar under LessTif or Motif has a smoother drag-scrolling.
1371On the other hand, the size of the thumb does not represent the actual
1372amount of text shown any more (only a crude approximation of it).
1490 1373
1491--- 1374---
1492** Speedbar has moved from the "Tools" top level menu to "Show/Hide". 1375*** The pop up menus for Lucid now stay up if you do a fast click and can
1376be navigated with the arrow keys (like Gtk+, Mac and W32).
1493 1377
1494+++ 1378+++
1495** Emacs can now indicate in the mode-line the presence of new e-mail 1379*** The Lucid menus can display multilingual text in your locale. You have
1496in a directory or in a file. See the documentation of the user option 1380to explicitly specify a fontSet resource for this to work, for example
1497`display-time-mail-directory'. 1381`-xrm "Emacs*fontSet: -*-helvetica-medium-r-*--*-120-*-*-*-*-*-*,*"'.
1498 1382
1499--- 1383---
1500** LDAP support now defaults to ldapsearch from OpenLDAP version 2. 1384*** Dialogs for Lucid/Athena and Lesstif/Motif now pops down when pressing
1385ESC, like they do for Gtk+, Mac and W32.
1501 1386
1502+++ 1387+++
1503** You can now disable pc-selection-mode after enabling it. 1388** For Gtk+ version 2.4, you can make Emacs use the old file dialog
1504M-x pc-selection-mode behaves like a proper minor mode, and with no 1389by setting the variable `x-use-old-gtk-file-dialog' to t. Default is to use
1505argument it toggles the mode. 1390the new dialog.
1506 1391
1507Turning off PC-Selection mode restores the global key bindings 1392** Xterm support:
1508that were replaced by turning on the mode.
1509 1393
1510+++ 1394---
1511** Emacs now displays a splash screen by default even if command-line 1395*** Emacs now responds to mouse-clicks on the mode-line, header-line and
1512arguments were given. The new command-line option --no-splash 1396display margin, when run in an xterm.
1513disables the splash screen; see also the variable 1397
1514`inhibit-startup-message' (which is also aliased as 1398---
1515`inhibit-splash-screen'). 1399*** Improved key bindings support when running in an xterm.
1400When emacs is running in an xterm more key bindings are available. The
1401following should work:
1402{C,S,C-S,A}-{right,left,up,down,prior,next,delete,insert,F1-12}.
1403These key bindings work on xterm from X.org 6.8, they might not work on
1404some older versions of xterm, or on some proprietary versions.
1516 1405
1517** Changes in support of colors on character terminals 1406** Changes in support of colors on character terminals
1518 1407
@@ -1544,483 +1433,410 @@ colors as on X.
1544--- 1433---
1545*** There's a new support for colors on `rxvt' terminal emulator. 1434*** There's a new support for colors on `rxvt' terminal emulator.
1546 1435
1436---
1437** M-x view-file and commands that use it now avoid interfering
1438with special modes such as Tar mode.
1439
1547+++ 1440+++
1548** Emacs can now be invoked in full-screen mode on a windowed display. 1441** Filesets are collections of files. You can define a fileset in
1442various ways, such as based on a directory tree or based on
1443program files that include other program files.
1549 1444
1550When Emacs is invoked on a window system, the new command-line options 1445Once you have defined a fileset, you can perform various operations on
1551`--fullwidth', `--fullheight', and `--fullscreen' produce a frame 1446all the files in it, such as visiting them or searching and replacing
1552whose width, height, or both width and height take up the entire 1447in them.
1553screen size. (For now, this does not work with some window managers.)
1554 1448
1555--- 1449---
1556** Emacs now tries to set up buffer coding systems for HTML/XML files 1450** Commands winner-redo and winner-undo, from winner.el, are now bound to
1557automatically. 1451C-c <left> and C-c <right>, respectively. This is an incompatible change.
1558 1452
1559+++ 1453---
1560** The new command `comint-insert-previous-argument' in comint-derived 1454** global-whitespace-mode is a new alias for whitespace-global-mode.
1561modes (shell-mode etc) inserts arguments from previous command lines,
1562like bash's `ESC .' binding. It is bound by default to `C-c .', but
1563otherwise behaves quite similarly to the bash version.
1564 1455
1565+++ 1456+++
1566** Changes in C-h bindings: 1457** The command `list-text-properties-at' has been deleted because
1458C-u C-x = gives the same information and more.
1459
1460* New modes and packages in Emacs 22.1
1567 1461
1568C-h e displays the *Messages* buffer. 1462+++
1463** New package benchmark.el contains simple support for convenient
1464timing measurements of code (including the garbage collection component).
1569 1465
1570C-h followed by a control character is used for displaying files 1466+++
1571 that do not change: 1467** Calc is now part of the Emacs distribution.
1572 1468
1573C-h C-f displays the FAQ. 1469Calc is an advanced desk calculator and mathematical tool written in
1574C-h C-e displays the PROBLEMS file. 1470Emacs Lisp. Its documentation is in a separate manual; within Emacs,
1471type "C-h i m calc RET" to read that manual. A reference card is
1472available in `etc/calccard.tex' and `etc/calccard.ps'.
1575 1473
1576The info-search bindings on C-h C-f, C-h C-k and C-h C-i 1474---
1577have been moved to C-h F, C-h K and C-h S. 1475** `cfengine-mode' is a major mode for editing GNU Cfengine
1476configuration files.
1578 1477
1579C-h c, C-h k, C-h w, and C-h f now handle remapped interactive commands. 1478+++
1479** The new package conf-mode.el handles thousands of configuration files, with
1480varying syntaxes for comments (;, #, //, /* */ or !), assignment (var = value,
1481var : value, var value or keyword var value) and sections ([section] or
1482section { }). Many files under /etc/, or with suffixes like .cf through
1483.config, .properties (Java), .desktop (KDE/Gnome), .ini and many others are
1484recognized.
1580 1485
1581- C-h c and C-h k report the actual command (after possible remapping) 1486---
1582 run by the key sequence. 1487** CUA mode is now part of the Emacs distribution.
1583 1488
1584- C-h w and C-h f on a command which has been remapped now report the 1489The new cua package provides CUA-like keybindings using C-x for
1585 command it is remapped to, and the keys which can be used to run 1490cut (kill), C-c for copy, C-v for paste (yank), and C-z for undo.
1586 that command. 1491With cua, the region can be set and extended using shifted movement
1492keys (like pc-selection-mode) and typed text replaces the active
1493region (like delete-selection-mode). Do not enable these modes with
1494cua-mode. Customize the variable `cua-mode' to enable cua.
1587 1495
1588For example, if C-k is bound to kill-line, and kill-line is remapped 1496In addition, cua provides unified rectangle support with visible
1589to new-kill-line, these commands now report: 1497rectangle highlighting: Use S-return to start a rectangle, extend it
1498using the movement commands (or mouse-3), and cut or copy it using C-x
1499or C-c (using C-w and M-w also works).
1590 1500
1591- C-h c and C-h k C-k reports: 1501Use M-o and M-c to `open' or `close' the rectangle, use M-b or M-f, to
1592 C-k runs the command new-kill-line 1502fill it with blanks or another character, use M-u or M-l to upcase or
1503downcase the rectangle, use M-i to increment the numbers in the
1504rectangle, use M-n to fill the rectangle with a numeric sequence (such
1505as 10 20 30...), use M-r to replace a regexp in the rectangle, and use
1506M-' or M-/ to restrict command on the rectangle to a subset of the
1507rows. See the commentary in cua-base.el for more rectangle commands.
1593 1508
1594- C-h w and C-h f kill-line reports: 1509Cua also provides unified support for registers: Use a numeric
1595 kill-line is remapped to new-kill-line which is on C-k, <deleteline> 1510prefix argument between 0 and 9, i.e. M-0 .. M-9, for C-x, C-c, and
1511C-v to cut or copy into register 0-9, or paste from register 0-9.
1596 1512
1597- C-h w and C-h f new-kill-line reports: 1513The last text deleted (not killed) is automatically stored in
1598 new-kill-line is on C-k 1514register 0. This includes text deleted by typing text.
1599 1515
1600+++ 1516Finally, cua provides a global mark which is set using S-C-space.
1601** Vertical scrolling is now possible within incremental search. 1517When the global mark is active, any text which is cut or copied is
1602To enable this feature, customize the new user option 1518automatically inserted at the global mark position. See the
1603`isearch-allow-scroll'. User written commands which satisfy stringent 1519commentary in cua-base.el for more global mark related commands.
1604constraints can be marked as "scrolling commands". See the Emacs manual
1605for details.
1606 1520
1607+++ 1521The features of cua also works with the standard emacs bindings for
1608** C-w in incremental search now grabs either a character or a word, 1522kill, copy, yank, and undo. If you want to use cua mode, but don't
1609making the decision in a heuristic way. This new job is done by the 1523want the C-x, C-c, C-v, and C-z bindings, you may customize the
1610command `isearch-yank-word-or-char'. To restore the old behavior, 1524`cua-enable-cua-keys' variable.
1611bind C-w to `isearch-yank-word' in `isearch-mode-map'.
1612 1525
1613+++ 1526Note: This version of cua mode is not backwards compatible with older
1614** C-y in incremental search now grabs the next line if point is already 1527versions of cua.el and cua-mode.el. To ensure proper operation, you
1615at the end of a line. 1528must remove older versions of cua.el or cua-mode.el as well as the
1529loading and customization of those packages from the .emacs file.
1616 1530
1617+++ 1531+++
1618** C-M-w deletes and C-M-y grabs a character in isearch mode. 1532** The new package dns-mode.el add syntax highlight of DNS master files.
1619Another method to grab a character is to enter the minibuffer by `M-e' 1533The key binding C-c C-s (`dns-mode-soa-increment-serial') can be used
1620and to type `C-f' at the end of the search string in the minibuffer. 1534to increment the SOA serial.
1621 1535
1622+++ 1536---
1623** M-% typed in isearch mode invokes `query-replace' or 1537** The new global minor mode `file-name-shadow-mode' modifies the way
1624`query-replace-regexp' (depending on search mode) with the current 1538filenames being entered by the user in the minibuffer are displayed, so
1625search string used as the string to replace. 1539that it's clear when part of the entered filename will be ignored due to
1540emacs' filename parsing rules. The ignored portion can be made dim,
1541invisible, or otherwise less visually noticable. The display method may
1542be displayed by customizing the variable `file-name-shadow-properties'.
1626 1543
1627+++ 1544+++
1628** Isearch no longer adds `isearch-resume' commands to the command 1545** The new package flymake.el does on-the-fly syntax checking of program
1629history by default. To enable this feature, customize the new 1546source files. See the Flymake's Info manual for more details.
1630user option `isearch-resume-in-command-history'.
1631 1547
1632+++ 1548---
1633** New user option `history-delete-duplicates'. 1549** The new Lisp library fringe.el controls the appearance of fringes.
1634If set to t when adding a new history element, all previous identical
1635elements are deleted.
1636 1550
1637+++ 1551---
1638** Yanking text now discards certain text properties that can 1552** GDB-Script-mode is used for files like .gdbinit.
1639be inconvenient when you did not expect them. The variable
1640`yank-excluded-properties' specifies which ones. Insertion
1641of register contents and rectangles also discards these properties.
1642 1553
1643+++ 1554+++
1644** Occur, Info, and comint-derived modes now support using 1555** The new package gdb-ui.el provides an enhanced graphical interface to
1645M-x font-lock-mode to toggle fontification. The variable 1556GDB. You can interact with GDB through the GUD buffer in the usual way, but
1646`Info-fontify' is no longer applicable; to disable fontification, 1557there are also further buffers which control the execution and describe the
1647remove `turn-on-font-lock' from `Info-mode-hook'. 1558state of your program. It separates the input/output of your program from
1559that of GDB and watches expressions in the speedbar. It also uses features of
1560Emacs 21 such as the display margin for breakpoints, and the toolbar.
1648 1561
1649+++ 1562Use M-x gdba to start GDB-UI.
1650** M-x grep now tries to avoid appending `/dev/null' to the command line
1651by using GNU grep `-H' option instead. M-x grep automatically
1652detects whether this is possible or not the first time it is invoked.
1653When `-H' is used, the grep command line supplied by the user is passed
1654unchanged to the system to execute, which allows more complicated
1655command lines to be used than was possible before.
1656 1563
1657--- 1564---
1658** The face-customization widget has been reworked to be less confusing. 1565** The new package ibuffer provides a powerful, completely
1659In particular, when you enable a face attribute using the corresponding 1566customizable replacement for buff-menu.el.
1660check-box, there's no longer a redundant `*' option in value selection
1661for that attribute; the values you can choose are only those which make
1662sense for the attribute. When an attribute is de-selected by unchecking
1663its check-box, then the (now ignored, but still present temporarily in
1664case you re-select the attribute) value is hidden.
1665
1666+++
1667** When you set or reset a variable's value in a Customize buffer,
1668the previous value becomes the "backup value" of the variable.
1669You can go back to that backup value by selecting "Use Backup Value"
1670under the "[State]" button.
1671 1567
1672--- 1568---
1673** The new customization type `float' specifies numbers with floating 1569** Ido mode is now part of the Emacs distribution.
1674point (no integers are allowed).
1675
1676+++
1677** In GUD mode, when talking to GDB, C-x C-a C-j "jumps" the program
1678counter to the specified source line (the one where point is).
1679 1570
1680--- 1571The ido (interactively do) package is an extension of the iswitchb
1681** GUD mode improvements for jdb: 1572package to do interactive opening of files and directories in addition
1573to interactive buffer switching. Ido is a superset of iswitchb (with
1574a few exceptions), so don't enable both packages.
1682 1575
1683*** Search for source files using jdb classpath and class 1576+++
1684 information. Fast startup since there is no need to scan all 1577** Image files are normally visited in Image mode, which lets you toggle
1685 source files up front. There is also no need to create and maintain 1578between viewing the image and viewing the text using C-c C-c.
1686 lists of source directories to scan. Look at `gud-jdb-use-classpath'
1687 and `gud-jdb-classpath' customization variables documentation.
1688 1579
1689*** Supports the standard breakpoint (gud-break, gud-clear) 1580+++
1690 set/clear operations from java source files under the classpath, stack 1581** The new keypad setup package provides several common bindings for
1691 traversal (gud-up, gud-down), and run until current stack finish 1582the numeric keypad which is available on most keyboards. The numeric
1692 (gud-finish). 1583keypad typically has the digits 0 to 9, a decimal point, keys marked
1584+, -, /, and *, an Enter key, and a NumLock toggle key. The keypad
1585package only controls the use of the digit and decimal keys.
1693 1586
1694*** Supports new jdb (Java 1.2 and later) in addition to oldjdb 1587By customizing the variables `keypad-setup', `keypad-shifted-setup',
1695 (Java 1.1 jdb). 1588`keypad-numlock-setup', and `keypad-numlock-shifted-setup', or by
1589using the function `keypad-setup', you can rebind all digit keys and
1590the decimal key of the keypad in one step for each of the four
1591possible combinations of the Shift key state (not pressed/pressed) and
1592the NumLock toggle state (off/on).
1696 1593
1697*** The previous method of searching for source files has been 1594The choices for the keypad keys in each of the above states are:
1698 preserved in case someone still wants/needs to use it. 1595`Plain numeric keypad' where the keys generates plain digits,
1699 Set gud-jdb-use-classpath to nil. 1596`Numeric keypad with decimal key' where the character produced by the
1597decimal key can be customized individually (for internationalization),
1598`Numeric Prefix Arg' where the keypad keys produce numeric prefix args
1599for emacs editing commands, `Cursor keys' and `Shifted Cursor keys'
1600where the keys work like (shifted) arrow keys, home/end, etc., and
1601`Unspecified/User-defined' where the keypad keys (kp-0, kp-1, etc.)
1602are left unspecified and can be bound individually through the global
1603or local keymaps.
1700 1604
1701 Added Customization Variables 1605+++
1606** The new kmacro package provides a simpler user interface to
1607emacs' keyboard macro facilities.
1702 1608
1703*** gud-jdb-command-name. What command line to use to invoke jdb. 1609Basically, it uses two function keys (default F3 and F4) like this:
1610F3 starts a macro, F4 ends the macro, and pressing F4 again executes
1611the last macro. While defining the macro, F3 inserts a counter value
1612which automatically increments every time the macro is executed.
1704 1613
1705*** gud-jdb-use-classpath. Allows selection of java source file searching 1614There is now a keyboard macro ring which stores the most recently
1706 method: set to t for new method, nil to scan gud-jdb-directories for 1615defined macros.
1707 java sources (previous method).
1708 1616
1709*** gud-jdb-directories. List of directories to scan and search for java 1617The C-x C-k sequence is now a prefix for the kmacro keymap which
1710 classes using the original gud-jdb method (if gud-jdb-use-classpath 1618defines bindings for moving through the keyboard macro ring,
1711 is nil). 1619C-x C-k C-p and C-x C-k C-n, editing the last macro C-x C-k C-e,
1620manipulating the macro counter and format via C-x C-k C-c,
1621C-x C-k C-a, and C-x C-k C-f. See the commentary in kmacro.el
1622for more commands.
1712 1623
1713 Minor Improvements 1624The normal macro bindings C-x (, C-x ), and C-x e now interfaces to
1625the keyboard macro ring.
1714 1626
1715*** The STARTTLS elisp wrapper (starttls.el) can now use GNUTLS 1627The C-x e command now automatically terminates the current macro
1716instead of the OpenSSL based "starttls" tool. For backwards 1628before calling it, if used while defining a macro.
1717compatibility, it prefers "starttls", but you can toggle
1718`starttls-use-gnutls' to switch to GNUTLS (or simply remove the
1719"starttls" tool).
1720 1629
1721*** Do not allow debugger output history variable to grow without bounds. 1630In addition, when ending or calling a macro with C-x e, the macro can
1631be repeated immediately by typing just the `e'. You can customize
1632this behavior via the variable kmacro-call-repeat-key and
1633kmacro-call-repeat-with-arg.
1722 1634
1723+++ 1635Keyboard macros can now be debugged and edited interactively.
1724** hide-ifdef-mode now uses overlays rather than selective-display 1636C-x C-k SPC steps through the last keyboard macro one key sequence
1725to hide its text. This should be mostly transparent but slightly 1637at a time, prompting for the actions to take.
1726changes the behavior of motion commands like C-e and C-p.
1727 1638
1728+++ 1639+++
1729** Unquoted `$' in file names do not signal an error any more when 1640** The new package longlines.el provides a minor mode for editing text
1730the corresponding environment variable does not exist. 1641files composed of long lines, based on the `use-hard-newlines'
1731Instead, the `$ENVVAR' text is left as is, so that `$$' quoting 1642mechanism. The long lines are broken up by inserting soft newlines,
1732is only rarely needed. 1643which are automatically removed when saving the file to disk or
1644copying into the kill ring, clipboard, etc. By default, Longlines
1645mode inserts soft newlines automatically during editing, a behavior
1646referred to as "soft word wrap" in other text editors. This is
1647similar to Refill mode, but more reliable. To turn the word wrap
1648feature off, set `longlines-auto-wrap' to nil.
1733 1649
1734--- 1650---
1735** JIT-lock changes 1651** The old Octave mode bindings C-c f and C-c i have been changed
1736*** jit-lock can now be delayed with `jit-lock-defer-time'. 1652to C-c C-f and C-c C-i. The C-c C-i subcommands now have duplicate
1737 1653bindings on control characters--thus, C-c C-i C-b is the same as
1738If this variable is non-nil, its value should be the amount of Emacs 1654C-c C-i b, and so on.
1739idle time in seconds to wait before starting fontification. For
1740example, if you set `jit-lock-defer-time' to 0.25, fontification will
1741only happen after 0.25s of idle time.
1742
1743*** contextual refontification is now separate from stealth fontification.
1744 1655
1745jit-lock-defer-contextually is renamed jit-lock-contextually and 1656** The printing package is now part of the Emacs distribution.
1746jit-lock-context-time determines the delay after which contextual
1747refontification takes place.
1748 1657
1749+++ 1658If you enable the printing package by including (require 'printing) in
1750** Marking commands extend the region when invoked multiple times. If 1659the .emacs file, the normal Print item on the File menu is replaced
1751you hit M-C-SPC (mark-sexp), M-@ (mark-word), M-h (mark-paragraph), or 1660with a Print sub-menu which allows you to preview output through
1752C-M-h (mark-defun) repeatedly, the marked region extends each time, so 1661ghostview, use ghostscript to print (if you don't have a PostScript
1753you can mark the next two sexps with M-C-SPC M-C-SPC, for example. 1662printer) or send directly to printer a PostScript code generated by
1754This feature also works for mark-end-of-sentence, if you bind that to 1663`ps-print' package. Use M-x pr-help for more information.
1755a key. It also extends the region when the mark is active in Transient
1756Mark mode, regardless of the last command. To start a new region with
1757one of marking commands in Transient Mark mode, you can deactivate the
1758active region with C-g, or set the new mark with C-SPC.
1759 1664
1760+++ 1665+++
1761** Some commands do something special in Transient Mark mode when the 1666** The new python.el package is used to edit Python and Jython programs.
1762mark is active--for instance, they limit their operation to the
1763region. Even if you don't normally use Transient Mark mode, you might
1764want to get this behavior from a particular command. There are two
1765ways you can enable Transient Mark mode and activate the mark, for one
1766command only.
1767 1667
1768One method is to type C-SPC C-SPC; this enables Transient Mark mode 1668---
1769and sets the mark at point. The other method is to type C-u C-x C-x. 1669** The minor mode Reveal mode makes text visible on the fly as you
1770This enables Transient Mark mode temporarily but does not alter the 1670move your cursor into hidden regions of the buffer.
1771mark or the region. 1671It should work with any package that uses overlays to hide parts
1672of a buffer, such as outline-minor-mode, hs-minor-mode, hide-ifdef-mode, ...
1772 1673
1773After these commands, Transient Mark mode remains enabled until you 1674There is also Global Reveal mode which affects all buffers.
1774deactivate the mark. That typically happens when you type a command
1775that alters the buffer, but you can also deactivate the mark by typing
1776C-g.
1777 1675
1778+++ 1676---
1779** A prefix argument is no longer required to repeat a jump to a 1677** The ruler-mode.el library provides a minor mode for displaying an
1780previous mark, i.e. C-u C-SPC C-SPC C-SPC ... cycles through the 1678"active" ruler in the header line. You can use the mouse to visually
1781mark ring. Use C-u C-u C-SPC to set the mark immediately after a jump. 1679change the `fill-column', `window-margins' and `tab-stop-list'
1680settings.
1782 1681
1783+++ 1682+++
1784** Movement commands `beginning-of-buffer', `end-of-buffer', 1683** SES mode (ses-mode) is a new major mode for creating and editing
1785`beginning-of-defun', `end-of-defun' do not set the mark if the mark 1684spreadsheet files. Besides the usual Emacs features (intuitive command
1786is already active in Transient Mark mode. 1685letters, undo, cell formulas in Lisp, plaintext files, etc.) it also offers
1686viral immunity and import/export of tab-separated values.
1787 1687
1788+++ 1688+++
1789** In the *Occur* buffer, `o' switches to it in another window, and 1689** The new global minor mode `size-indication-mode' (off by default)
1790C-o displays the current line's occurrence in another window without 1690shows the size of accessible part of the buffer on the mode line.
1791switching to it.
1792 1691
1793+++ 1692+++
1794** When you specify a frame size with --geometry, the size applies to 1693** The new package table.el implements editable, WYSIWYG, embedded
1795all frames you create. A position specified with --geometry only 1694`text tables' in Emacs buffers. It simulates the effect of putting
1796affects the initial frame. 1695these tables in a special major mode. The package emulates WYSIWYG
1696table editing available in modern word processors. The package also
1697can generate a table source in typesetting and markup languages such
1698as latex and html from the visually laid out text table.
1797 1699
1798+++ 1700+++
1799** M-h (mark-paragraph) now accepts a prefix arg. 1701** The thumbs.el package allows you to preview image files as thumbnails
1800With positive arg, M-h marks the current and the following paragraphs; 1702and can be invoked from a Dired buffer.
1801if the arg is negative, it marks the current and the preceding
1802paragraphs.
1803 1703
1804+++ 1704+++
1805** The variables dired-free-space-program and dired-free-space-args 1705** Tramp is now part of the distribution.
1806have been renamed to directory-free-space-program and
1807directory-free-space-args, and they now apply whenever Emacs puts a
1808directory listing into a buffer.
1809
1810---
1811** mouse-wheels can now scroll a specific fraction of the window
1812(rather than a fixed number of lines) and the scrolling is `progressive'.
1813 1706
1814--- 1707This package is similar to Ange-FTP: it allows you to edit remote
1815** Unexpected yanking of text due to accidental clicking on the mouse 1708files. But whereas Ange-FTP uses FTP to access the remote host,
1816wheel button (typically mouse-2) during wheel scrolling is now avoided. 1709Tramp uses a shell connection. The shell connection is always used
1817This behavior can be customized via the mouse-wheel-click-event and 1710for filename completion and directory listings and suchlike, but for
1818mouse-wheel-inhibit-click-time variables. 1711the actual file transfer, you can choose between the so-called
1712`inline' methods (which transfer the files through the shell
1713connection using base64 or uu encoding) and the `out-of-band' methods
1714(which invoke an external copying program such as `rcp' or `scp' or
1715`rsync' to do the copying).
1819 1716
1820+++ 1717Shell connections can be acquired via `rsh', `ssh', `telnet' and also
1821** The keyboard-coding-system is now automatically set based on your 1718`su' and `sudo'. Ange-FTP is still supported via the `ftp' method.
1822current locale settings if you are not using a window system. This
1823may mean that the META key doesn't work but generates non-ASCII
1824characters instead, depending on how the terminal (or terminal
1825emulator) works. Use `set-keyboard-coding-system' (or customize
1826keyboard-coding-system) if you prefer META to work (the old default)
1827or if the locale doesn't describe the character set actually generated
1828by the keyboard. See Info node `Single-Byte Character Support'.
1829 1719
1830+++ 1720If you want to disable Tramp you should set
1831** Emacs now reads the standard abbrevs file ~/.abbrev_defs
1832automatically at startup, if it exists. When Emacs offers to save
1833modified buffers, it saves the abbrevs too if they have changed. It
1834can do this either silently or asking for confirmation first,
1835according to the value of `save-abbrevs'.
1836 1721
1837+++ 1722 (setq tramp-default-method "ftp")
1838** Display of hollow cursors now obeys the buffer-local value (if any)
1839of `cursor-in-non-selected-windows' in the buffer that the cursor
1840appears in.
1841 1723
1842+++ 1724---
1843** The variable `cursor-in-non-selected-windows' can now be set to any 1725** The library tree-widget.el provides a new widget to display a set
1844of the recognized cursor types. 1726of hierarchical data as an outline. For example, the tree-widget is
1727well suited to display a hierarchy of directories and files.
1845 1728
1846--- 1729---
1847** The variable `auto-save-file-name-transforms' now has a third element that 1730** The URL package (which had been part of W3) is now part of Emacs.
1848controls whether or not the function `make-auto-save-file-name' will
1849attempt to construct a unique auto-save name (e.g. for remote files).
1850 1731
1851+++ 1732---
1852** There is a new calendar package, icalendar.el, that can be used to 1733** New minor mode, Visible mode, toggles invisibility in the current buffer.
1853convert Emacs diary entries to/from the iCalendar format. 1734When enabled, it makes all invisible text visible. When disabled, it
1735restores the previous value of `buffer-invisibility-spec'.
1854 1736
1855+++ 1737+++
1856** Diary sexp entries can have custom marking in the calendar. 1738** The wdired.el package allows you to use normal editing commands on Dired
1857Diary sexp functions which only apply to certain days (such as 1739buffers to change filenames, permissions, etc...
1858`diary-block' or `diary-cyclic') now take an optional parameter MARK, 1740
1859which is the name of a face or a single-character string indicating 1741* Changes in specialized modes and packages:
1860how to highlight the day in the calendar display. Specifying a
1861single-character string as @var{mark} places the character next to the
1862day in the calendar. Specifying a face highlights the day with that
1863face. This lets you have different colors or markings for vacations,
1864appointments, paydays or anything else using a sexp.
1865 1742
1866+++ 1743+++
1867** The new function `calendar-goto-day-of-year' (g D) prompts for a 1744** There is a new user option `mail-default-directory' that allows you
1868year and day number, and moves to that date. Negative day numbers 1745to specify the value of `default-directory' for mail buffers. This
1869count backward from the end of the year. 1746directory is used for auto-save files of mail buffers. It defaults to
1747"~/".
1870 1748
1871+++ 1749+++
1872** The new Calendar function `calendar-goto-iso-week' (g w) 1750** Emacs can now indicate in the mode-line the presence of new e-mail
1873prompts for a year and a week number, and moves to the first 1751in a directory or in a file. See the documentation of the user option
1874day of that ISO week. 1752`display-time-mail-directory'.
1875
1876---
1877** The new variable `calendar-minimum-window-height' affects the
1878window generated by the function `generate-calendar-window'.
1879
1880---
1881** The functions `holiday-easter-etc' and `holiday-advent' now take
1882optional arguments, in order to only report on the specified holiday
1883rather than all. This makes customization of variables such as
1884`christian-holidays' simpler.
1885 1753
1886--- 1754---
1887** The function `simple-diary-display' now by default sets a header line. 1755** PO translation files are decoded according to their MIME headers
1888This can be controlled through the variables `diary-header-line-flag' 1756when Emacs visits them.
1889and `diary-header-line-format'.
1890 1757
1891+++ 1758** Info mode:
1892** The procedure for activating appointment reminders has changed: use
1893the new function `appt-activate'. The new variable
1894`appt-display-format' controls how reminders are displayed, replacing
1895appt-issue-message, appt-visible, and appt-msg-window.
1896 1759
1897+++ 1760+++
1898** The new functions `diary-from-outlook', `diary-from-outlook-gnus', 1761*** A numeric prefix argument of `info' selects an Info buffer
1899and `diary-from-outlook-rmail' can be used to import diary entries 1762with the number appended to the *info* buffer name (e.g. "*info*<2>").
1900from Outlook-format appointments in mail messages. The variable
1901`diary-outlook-formats' can be customized to recognize additional
1902formats.
1903 1763
1764---
1765*** isearch in Info uses Info-search and searches through multiple nodes.
1766Before leaving the initial Info node isearch fails once with the error
1767message [initial node], and with subsequent C-s/C-r continues through
1768other nodes. When isearch fails for the rest of the manual, it wraps
1769aroung the whole manual to the top/final node. The user option
1770`Info-isearch-search' controls whether to use Info-search for isearch,
1771or the default isearch search function that wraps around the current
1772Info node.
1904 1773
1905** VC Changes 1774*** New search commands: `Info-search-case-sensitively' (bound to S),
1775`Info-search-backward', and `Info-search-next' which repeats the last
1776search without prompting for a new search string.
1906 1777
1907+++ 1778*** New command `Info-history-forward' (bound to r and new toolbar icon)
1908*** The key C-x C-q no longer checks files in or out, it only changes 1779moves forward in history to the node you returned from after using
1909the read-only state of the buffer (toggle-read-only). We made this 1780`Info-history-back' (renamed from `Info-last').
1910change because we held a poll and found that many users were unhappy
1911with the previous behavior. If you do prefer this behavior, you
1912can bind `vc-toggle-read-only' to C-x C-q in your .emacs:
1913 1781
1914 (global-set-key "\C-x\C-q" 'vc-toggle-read-only) 1782*** New command `Info-history' (bound to L) displays a menu of visited nodes.
1915 1783
1916The function `vc-toggle-read-only' will continue to exist. 1784*** New command `Info-toc' (bound to T) creates a node with table of contents
1785from the tree structure of menus of the current Info file.
1917 1786
1918+++ 1787*** New command `info-apropos' searches the indices of the known
1919*** There is a new user option `vc-cvs-global-switches' that allows 1788Info files on your system for a string, and builds a menu of the
1920you to specify switches that are passed to any CVS command invoked 1789possible matches.
1921by VC. These switches are used as "global options" for CVS, which
1922means they are inserted before the command name. For example, this
1923allows you to specify a compression level using the "-z#" option for
1924CVS.
1925 1790
1926+++ 1791*** New command `Info-copy-current-node-name' (bound to w) copies
1927*** New backends for Subversion and Meta-CVS. 1792the current Info node name into the kill ring. With a zero prefix
1793arg, puts the node name inside the `info' function call.
1928 1794
1929** EDiff changes. 1795---
1796*** New face `info-xref-visited' distinguishes visited nodes from unvisited
1797and a new option `Info-fontify-visited-nodes' to control this.
1930 1798
1931+++ 1799*** http and ftp links in Info are now operational: they look like cross
1932*** When comparing directories. 1800references and following them calls `browse-url'.
1933Typing D brings up a buffer that lists the differences between the contents of
1934directories. Now it is possible to use this buffer to copy the missing files
1935from one directory to another.
1936 1801
1937+++ 1802+++
1938*** When comparing files or buffers. 1803*** Info now hides node names in menus and cross references by default.
1939Typing the = key now offers to perform the word-by-word comparison of the 1804If you prefer the old behavior, you can set the new user option
1940currently highlighted regions in an inferior Ediff session. If you answer 'n' 1805`Info-hide-note-references' to nil.
1941then it reverts to the old behavior and asks the user to select regions for
1942comparison.
1943 1806
1944*** The new command `ediff-backup' compares a file with its most recent 1807---
1945backup using `ediff'. If you specify the name of a backup file, 1808*** Images in Info pages are supported.
1946`ediff-backup' compares it with the file of which it is a backup. 1809Info pages show embedded images, in Emacs frames with image support.
1810Info documentation that includes images, processed with makeinfo
1811version 4.7 or newer, compiles to Info pages with embedded images.
1947 1812
1948+++ 1813+++
1949** Etags changes. 1814*** The default value for `Info-scroll-prefer-subnodes' is now nil.
1950
1951*** New regular expressions features
1952
1953**** New syntax for regular expressions, multi-line regular expressions.
1954The syntax --ignore-case-regexp=/regex/ is now undocumented and retained
1955only for backward compatibility. The new equivalent syntax is
1956--regex=/regex/i. More generally, it is --regex=/TAGREGEX/TAGNAME/MODS,
1957where `/TAGNAME' is optional, as usual, and MODS is a string of 0 or
1958more characters among `i' (ignore case), `m' (multi-line) and `s'
1959(single-line). The `m' and `s' modifiers behave as in Perl regular
1960expressions: `m' allows regexps to match more than one line, while `s'
1961(which implies `m') means that `.' matches newlines. The ability to
1962span newlines allows writing of much more powerful regular expressions
1963and rapid prototyping for tagging new languages.
1964
1965**** Regular expressions can use char escape sequences as in Gcc.
1966The escaped character sequence \a, \b, \d, \e, \f, \n, \r, \t, \v,
1967respectively, stand for the ASCII characters BEL, BS, DEL, ESC, FF, NL,
1968CR, TAB, VT,
1969
1970**** Regular expressions can be bound to a given language.
1971The syntax --regex={LANGUAGE}REGEX means that REGEX is used to make tags
1972only for files of language LANGUAGE, and ignored otherwise. This is
1973particularly useful when storing regexps in a file.
1974
1975**** Regular expressions can be read from a file.
1976The --regex=@regexfile option means read the regexps from a file, one
1977per line. Lines beginning with space or tab are ignored.
1978
1979*** New language parsing features
1980
1981**** The `::' qualifier triggers C++ parsing in C file.
1982Previously, only the `template' and `class' keywords had this effect.
1983
1984**** The gnucc __attribute__ keyword is now recognised and ignored.
1985
1986**** New language HTML.
1987Title and h1, h2, h3 are tagged. Also, tags are generated when name= is
1988used inside an anchor and whenever id= is used.
1989
1990**** In Makefiles, constants are tagged.
1991If you want the old behavior instead, thus avoiding to increase the
1992size of the tags file, use the --no-globals option.
1993 1815
1994**** New language Lua. 1816---
1995All functions are tagged. 1817*** Info-index offers completion.
1996 1818
1997**** In Perl, packages are tags. 1819** Lisp mode changes:
1998Subroutine tags are named from their package. You can jump to sub tags
1999as you did before, by the sub name, or additionally by looking for
2000package::sub.
2001 1820
2002**** In Prolog, etags creates tags for rules in addition to predicates. 1821---
1822*** Lisp mode now uses font-lock-doc-face for the docstrings.
2003 1823
2004**** New language PHP. 1824+++
2005Tags are functions, classes and defines. 1825*** A prefix argument of C-M-q in Emacs Lisp mode pretty-printifies the
2006If the --members option is specified to etags, tags are variables also. 1826list starting after point.
2007 1827
2008**** New default keywords for TeX. 1828*** New features in evaluation commands
2009The new keywords are def, newcommand, renewcommand, newenvironment and
2010renewenvironment.
2011 1829
2012*** Honour #line directives. 1830+++
2013When Etags parses an input file that contains C preprocessor's #line 1831*** The function `eval-defun' (C-M-x) called on defface reinitializes
2014directives, it creates tags using the file name and line number 1832the face to the value specified in the defface expression.
2015specified in those directives. This is useful when dealing with code
2016created from Cweb source files. When Etags tags the generated file, it
2017writes tags pointing to the source file.
2018 1833
2019*** New option --parse-stdin=FILE. 1834+++
2020This option is mostly useful when calling etags from programs. It can 1835*** Typing C-x C-e twice prints the value of the integer result
2021be used (only once) in place of a file name on the command line. Etags 1836in additional formats (octal, hexadecimal, character) specified
2022reads from standard input and marks the produced tags as belonging to 1837by the new function `eval-expression-print-format'. The same
2023the file FILE. 1838function also defines the result format for `eval-expression' (M-:),
1839`eval-print-last-sexp' (C-j) and some edebug evaluation functions.
2024 1840
2025+++ 1841+++
2026** CC Mode changes. 1842** CC Mode changes.
@@ -2311,1350 +2127,787 @@ line is left untouched.
2311The function c-toggle-syntactic-indentation can be used to toggle 2127The function c-toggle-syntactic-indentation can be used to toggle
2312syntactic indentation. 2128syntactic indentation.
2313 2129
2314+++
2315** The command line option --no-windows has been changed to
2316--no-window-system. The old one still works, but is deprecated.
2317
2318+++
2319** The command `list-text-properties-at' has been deleted because
2320C-u C-x = gives the same information and more.
2321
2322+++
2323** `buffer-menu' and `list-buffers' now list buffers whose names begin
2324with a space, when those buffers are visiting files. Normally buffers
2325whose names begin with space are omitted.
2326
2327+++
2328** You can now customize fill-nobreak-predicate to control where
2329filling can break lines. The value is now normally a list of
2330functions, but it can also be a single function, for compatibility.
2331
2332We provide two sample predicates, fill-single-word-nobreak-p and
2333fill-french-nobreak-p, for use in the value of fill-nobreak-predicate.
2334
2335+++
2336** New user option `add-log-always-start-new-record'.
2337When this option is enabled, M-x add-change-log-entry always
2338starts a new record regardless of when the last record is.
2339
2340+++
2341** SGML mode has indentation and supports XML syntax.
2342The new variable `sgml-xml-mode' tells SGML mode to use XML syntax.
2343When this option is enabled, SGML tags are inserted in XML style,
2344i.e., there is always a closing tag.
2345By default, its setting is inferred on a buffer-by-buffer basis
2346from the file name or buffer contents.
2347
2348+++
2349** `xml-mode' is now an alias for `sgml-mode', which has XML support.
2350
2351---
2352** Lisp mode now uses font-lock-doc-face for the docstrings.
2353
2354--- 2130---
2355** Perl mode has a new variable `perl-indent-continued-arguments'. 2131** Perl mode has a new variable `perl-indent-continued-arguments'.
2356 2132
2133** Fortran mode changes:
2134
2357--- 2135---
2358** Fortran mode does more font-locking by default. Use level 3 2136*** Fortran mode does more font-locking by default. Use level 3
2359highlighting for the old default. 2137highlighting for the old default.
2360 2138
2361+++ 2139+++
2362** Fortran mode has a new variable `fortran-directive-re'. 2140*** Fortran mode has a new variable `fortran-directive-re'.
2363Adapt this to match the format of any compiler directives you use. 2141Adapt this to match the format of any compiler directives you use.
2364Lines that match are never indented, and are given distinctive font-locking. 2142Lines that match are never indented, and are given distinctive font-locking.
2365 2143
2366+++ 2144+++
2367** F90 mode and Fortran mode have new navigation commands 2145*** F90 mode and Fortran mode have new navigation commands
2368`f90-end-of-block', `f90-beginning-of-block', `f90-next-block', 2146`f90-end-of-block', `f90-beginning-of-block', `f90-next-block',
2369`f90-previous-block', `fortran-end-of-block', 2147`f90-previous-block', `fortran-end-of-block',
2370`fortran-beginning-of-block'. 2148`fortran-beginning-of-block'.
2371 2149
2372--- 2150---
2373** F90 mode and Fortran mode have support for hs-minor-mode (hideshow). 2151*** F90 mode and Fortran mode have support for hs-minor-mode (hideshow).
2374It cannot deal with every code format, but ought to handle a sizeable 2152It cannot deal with every code format, but ought to handle a sizeable
2375majority. 2153majority.
2376 2154
2377--- 2155---
2378** The new function `f90-backslash-not-special' can be used to change 2156*** The new function `f90-backslash-not-special' can be used to change
2379the syntax of backslashes in F90 buffers. 2157the syntax of backslashes in F90 buffers.
2380 2158
2381--- 2159---
2382** Prolog mode has a new variable `prolog-font-lock-keywords' 2160** Prolog mode has a new variable `prolog-font-lock-keywords'
2383to support use of font-lock. 2161to support use of font-lock.
2384 2162
2385+++ 2163** HTML/SGML changes:
2386** `special-display-buffer-names' and `special-display-regexps' now
2387understand two new boolean pseudo-frame-parameters `same-frame' and
2388`same-window'.
2389
2390+++
2391** M-x setenv now expands environment variables of the form `$foo' and
2392`${foo}' in the specified new value of the environment variable. To
2393include a `$' in the value, use `$$'.
2394
2395+++
2396** File-name completion can now ignore directories.
2397If an element of the list in `completion-ignored-extensions' ends in a
2398slash `/', it indicates a subdirectory that should be ignored when
2399completing file names. Elements of `completion-ignored-extensions'
2400which do not end in a slash are never considered when a completion
2401candidate is a directory.
2402
2403+++
2404** The completion commands TAB, SPC and ? in the minibuffer apply only
2405to the text before point. If there is text in the buffer after point,
2406it remains unchanged.
2407 2164
2408--- 2165---
2409** Enhanced visual feedback in *Completions* buffer. 2166*** Emacs now tries to set up buffer coding systems for HTML/XML files
2410 2167automatically.
2411Completions lists use faces to highlight what all completions
2412have in common and where they begin to differ.
2413
2414The common prefix shared by all possible completions uses the face
2415`completions-common-part', while the first character that isn't the
2416same uses the face `completions-first-difference'. By default,
2417`completions-common-part' inherits from `default', and
2418`completions-first-difference' inherits from `bold'. The idea of
2419`completions-common-part' is that you can use it to make the common
2420parts less visible than normal, so that the rest of the differing
2421parts is, by contrast, slightly highlighted.
2422
2423+++
2424** New user option `inhibit-startup-buffer-menu'.
2425When loading many files, for instance with `emacs *', Emacs normally
2426displays a buffer menu. This option turns the buffer menu off.
2427
2428---
2429** Rmail now displays 5-digit message ids in its summary buffer.
2430
2431+++
2432** Support for `movemail' from GNU mailutils was added to Rmail.
2433This version of `movemail' allows to read mail from a wide range of
2434mailbox formats, including remote POP3 and IMAP4 mailboxes with or
2435without TLS encryption. If GNU mailutils is installed on the system
2436and its version of `movemail' can be found in exec-path, it will be
2437used instead of the native one.
2438
2439---
2440** On MS Windows, the "system caret" now follows the cursor.
2441This enables Emacs to work better with programs that need to track
2442the cursor, for example screen magnifiers and text to speech programs.
2443
2444---
2445** Tooltips now work on MS Windows.
2446See the Emacs 21.1 NEWS entry for tooltips for details.
2447
2448---
2449** Images are now supported on MS Windows.
2450PBM and XBM images are supported out of the box. Other image formats
2451depend on external libraries. All of these libraries have been ported
2452to Windows, and can be found in both source and binary form at
2453http://gnuwin32.sourceforge.net/. Note that libpng also depends on
2454zlib, and tiff depends on the version of jpeg that it was compiled
2455against. For additional information, see nt/INSTALL.
2456
2457---
2458** Sound is now supported on MS Windows.
2459WAV format is supported on all versions of Windows, other formats such
2460as AU, AIFF and MP3 may be supported in the more recent versions of
2461Windows, or when other software provides hooks into the system level
2462sound support for those formats.
2463
2464---
2465** Different shaped mouse pointers are supported on MS Windows.
2466The mouse pointer changes shape depending on what is under the pointer.
2467
2468---
2469** Pointing devices with more than 3 buttons are now supported on MS Windows.
2470The new variable `w32-pass-extra-mouse-buttons-to-system' controls
2471whether Emacs should handle the extra buttons itself (the default), or
2472pass them to Windows to be handled with system-wide functions.
2473
2474---
2475** Emacs takes note of colors defined in Control Panel on MS-Windows.
2476The Control Panel defines some default colors for applications in much
2477the same way as wildcard X Resources do on X. Emacs now adds these
2478colors to the colormap prefixed by System (eg SystemMenu for the
2479default Menu background, SystemMenuText for the foreground), and uses
2480some of them to initialize some of the default faces.
2481`list-colors-display' shows the list of System color names, in case
2482you wish to use them in other faces.
2483
2484---
2485** On MS Windows NT/W2K/XP, Emacs uses Unicode for clipboard operations.
2486Those systems use Unicode internally, so this allows Emacs to share
2487multilingual text with other applications. On other versions of
2488MS Windows, Emacs now uses the appropriate locale coding-system, so
2489the clipboard should work correctly for your local language without
2490any customizations.
2491
2492+++
2493** Under X11, it is possible to swap Alt and Meta (and Super and Hyper).
2494The new variables `x-alt-keysym', `x-hyper-keysym', `x-meta-keysym',
2495and `x-super-keysym' can be used to choose which keysyms Emacs should
2496use for the modifiers. For example, the following two lines swap
2497Meta and Alt:
2498 (setq x-alt-keysym 'meta)
2499 (setq x-meta-keysym 'alt)
2500
2501+++
2502** vc-annotate-mode enhancements
2503
2504In vc-annotate mode, you can now use the following key bindings for
2505enhanced functionality to browse the annotations of past revisions, or
2506to view diffs or log entries directly from vc-annotate-mode:
2507
2508 P: annotates the previous revision
2509 N: annotates the next revision
2510 J: annotates the revision at line
2511 A: annotates the revision previous to line
2512 D: shows the diff of the revision at line with its previous revision
2513 L: shows the log of the revision at line
2514 W: annotates the workfile (most up to date) version
2515
2516+++
2517** In pcl-cvs mode, there is a new `d y' command to view the diffs
2518between the local version of the file and yesterday's head revision
2519in the repository.
2520
2521+++
2522** In pcl-cvs mode, there is a new `d r' command to view the changes
2523anyone has committed to the repository since you last executed
2524"checkout", "update" or "commit". That means using cvs diff options
2525-rBASE -rHEAD.
2526
2527---
2528** New variable `hs-set-up-overlay' allows customization of the overlay
2529used to effect hiding for hideshow minor mode. Integration with isearch
2530handles the overlay property `display' specially, preserving it during
2531temporary overlay showing in the course of an isearch operation.
2532
2533+++
2534** New command `recode-region' decodes the region again by a specified
2535coding system.
2536
2537** On Mac OS, the value of the variable `keyboard-coding-system' is
2538now dynamically changed according to the current keyboard script. The
2539variable `mac-keyboard-text-encoding' and the constants
2540`kTextEncodingMacRoman', `kTextEncodingISOLatin1', and
2541`kTextEncodingISOLatin2' are obsolete.
2542
2543* New modes and packages in Emacs 22.1
2544
2545+++
2546** The new package longlines.el provides a minor mode for editing text
2547files composed of long lines, based on the `use-hard-newlines'
2548mechanism. The long lines are broken up by inserting soft newlines,
2549which are automatically removed when saving the file to disk or
2550copying into the kill ring, clipboard, etc. By default, Longlines
2551mode inserts soft newlines automatically during editing, a behavior
2552referred to as "soft word wrap" in other text editors. This is
2553similar to Refill mode, but more reliable. To turn the word wrap
2554feature off, set `longlines-auto-wrap' to nil.
2555
2556+++
2557** The new package conf-mode.el handles thousands of configuration files, with
2558varying syntaxes for comments (;, #, //, /* */ or !), assignment (var = value,
2559var : value, var value or keyword var value) and sections ([section] or
2560section { }). Many files under /etc/, or with suffixes like .cf through
2561.config, .properties (Java), .desktop (KDE/Gnome), .ini and many others are
2562recognized.
2563
2564+++
2565** The new package dns-mode.el add syntax highlight of DNS master files.
2566The key binding C-c C-s (`dns-mode-soa-increment-serial') can be used
2567to increment the SOA serial.
2568 2168
2569+++ 2169+++
2570** The new package flymake.el does on-the-fly syntax checking of program 2170*** SGML mode has indentation and supports XML syntax.
2571source files. See the Flymake's Info manual for more details. 2171The new variable `sgml-xml-mode' tells SGML mode to use XML syntax.
2572 2172When this option is enabled, SGML tags are inserted in XML style,
2573** The library tree-widget.el provides a new widget to display a set 2173i.e., there is always a closing tag.
2574of hierarchical data as an outline. For example, the tree-widget is 2174By default, its setting is inferred on a buffer-by-buffer basis
2575well suited to display a hierarchy of directories and files. 2175from the file name or buffer contents.
2576 2176
2577+++ 2177+++
2578** The wdired.el package allows you to use normal editing commands on Dired 2178*** `xml-mode' is now an alias for `sgml-mode', which has XML support.
2579buffers to change filenames, permissions, etc...
2580 2179
2581+++ 2180** TeX modes:
2582** The thumbs.el package allows you to preview image files as thumbnails
2583and can be invoked from a Dired buffer.
2584 2181
2585+++ 2182+++
2586** The new python.el package is used to edit Python and Jython programs. 2183*** C-c C-c prompts for a command to run, and tries to offer a good default.
2587
2588** The URL package (which had been part of W3) is now part of Emacs.
2589 2184
2590+++ 2185+++
2591** The new global minor mode `size-indication-mode' (off by default) 2186*** The user option `tex-start-options-string' has been replaced
2592shows the size of accessible part of the buffer on the mode line. 2187by two new user options: `tex-start-options', which should hold
2593 2188command-line options to feed to TeX, and `tex-start-commands' which should hold
2594--- 2189TeX commands to use at startup.
2595** GDB-Script-mode is used for files like .gdbinit.
2596
2597---
2598** Ido mode is now part of the Emacs distribution.
2599
2600The ido (interactively do) package is an extension of the iswitchb
2601package to do interactive opening of files and directories in addition
2602to interactive buffer switching. Ido is a superset of iswitchb (with
2603a few exceptions), so don't enable both packages.
2604 2190
2605--- 2191---
2606** CUA mode is now part of the Emacs distribution. 2192*** verbatim environments are now highlighted in courier by font-lock
2607 2193and super/sub-scripts are made into super/sub-scripts.
2608The new cua package provides CUA-like keybindings using C-x for
2609cut (kill), C-c for copy, C-v for paste (yank), and C-z for undo.
2610With cua, the region can be set and extended using shifted movement
2611keys (like pc-selection-mode) and typed text replaces the active
2612region (like delete-selection-mode). Do not enable these modes with
2613cua-mode. Customize the variable `cua-mode' to enable cua.
2614
2615In addition, cua provides unified rectangle support with visible
2616rectangle highlighting: Use S-return to start a rectangle, extend it
2617using the movement commands (or mouse-3), and cut or copy it using C-x
2618or C-c (using C-w and M-w also works).
2619
2620Use M-o and M-c to `open' or `close' the rectangle, use M-b or M-f, to
2621fill it with blanks or another character, use M-u or M-l to upcase or
2622downcase the rectangle, use M-i to increment the numbers in the
2623rectangle, use M-n to fill the rectangle with a numeric sequence (such
2624as 10 20 30...), use M-r to replace a regexp in the rectangle, and use
2625M-' or M-/ to restrict command on the rectangle to a subset of the
2626rows. See the commentary in cua-base.el for more rectangle commands.
2627
2628Cua also provides unified support for registers: Use a numeric
2629prefix argument between 0 and 9, i.e. M-0 .. M-9, for C-x, C-c, and
2630C-v to cut or copy into register 0-9, or paste from register 0-9.
2631
2632The last text deleted (not killed) is automatically stored in
2633register 0. This includes text deleted by typing text.
2634
2635Finally, cua provides a global mark which is set using S-C-space.
2636When the global mark is active, any text which is cut or copied is
2637automatically inserted at the global mark position. See the
2638commentary in cua-base.el for more global mark related commands.
2639
2640The features of cua also works with the standard emacs bindings for
2641kill, copy, yank, and undo. If you want to use cua mode, but don't
2642want the C-x, C-c, C-v, and C-z bindings, you may customize the
2643`cua-enable-cua-keys' variable.
2644
2645Note: This version of cua mode is not backwards compatible with older
2646versions of cua.el and cua-mode.el. To ensure proper operation, you
2647must remove older versions of cua.el or cua-mode.el as well as the
2648loading and customization of those packages from the .emacs file.
2649 2194
2650+++ 2195+++
2651** The new keypad setup package provides several common bindings for 2196*** New major mode doctex-mode for *.dtx files.
2652the numeric keypad which is available on most keyboards. The numeric
2653keypad typically has the digits 0 to 9, a decimal point, keys marked
2654+, -, /, and *, an Enter key, and a NumLock toggle key. The keypad
2655package only controls the use of the digit and decimal keys.
2656 2197
2657By customizing the variables `keypad-setup', `keypad-shifted-setup', 2198** BibTeX mode:
2658`keypad-numlock-setup', and `keypad-numlock-shifted-setup', or by 2199*** The new command bibtex-url browses a URL for the BibTeX entry at
2659using the function `keypad-setup', you can rebind all digit keys and 2200point (bound to C-c C-l and mouse-2, RET on clickable fields).
2660the decimal key of the keypad in one step for each of the four
2661possible combinations of the Shift key state (not pressed/pressed) and
2662the NumLock toggle state (off/on).
2663 2201
2664The choices for the keypad keys in each of the above states are: 2202*** The new command bibtex-entry-update (bound to C-c C-u) updates
2665`Plain numeric keypad' where the keys generates plain digits, 2203an existing BibTeX entry.
2666`Numeric keypad with decimal key' where the character produced by the
2667decimal key can be customized individually (for internationalization),
2668`Numeric Prefix Arg' where the keypad keys produce numeric prefix args
2669for emacs editing commands, `Cursor keys' and `Shifted Cursor keys'
2670where the keys work like (shifted) arrow keys, home/end, etc., and
2671`Unspecified/User-defined' where the keypad keys (kp-0, kp-1, etc.)
2672are left unspecified and can be bound individually through the global
2673or local keymaps.
2674 2204
2675+++ 2205*** New `bibtex-entry-format' option `required-fields', enabled by default.
2676** The new kmacro package provides a simpler user interface to
2677emacs' keyboard macro facilities.
2678 2206
2679Basically, it uses two function keys (default F3 and F4) like this: 2207*** bibtex-maintain-sorted-entries can take values `plain',
2680F3 starts a macro, F4 ends the macro, and pressing F4 again executes 2208`crossref', and `entry-class' which control the sorting scheme used
2681the last macro. While defining the macro, F3 inserts a counter value 2209for BibTeX entries. `bibtex-sort-entry-class' controls the sorting
2682which automatically increments every time the macro is executed. 2210scheme `entry-class'. TAB completion for reference keys and
2211automatic detection of duplicates does not require anymore that
2212bibtex-maintain-sorted-entries is non-nil.
2683 2213
2684There is now a keyboard macro ring which stores the most recently 2214*** If the new variable bibtex-parse-keys-fast is non-nil,
2685defined macros. 2215use fast but simplified algorithm for parsing BibTeX keys.
2686 2216
2687The C-x C-k sequence is now a prefix for the kmacro keymap which 2217*** If the new variable bibtex-autoadd-commas is non-nil,
2688defines bindings for moving through the keyboard macro ring, 2218automatically add missing commas at end of BibTeX fields.
2689C-x C-k C-p and C-x C-k C-n, editing the last macro C-x C-k C-e,
2690manipulating the macro counter and format via C-x C-k C-c,
2691C-x C-k C-a, and C-x C-k C-f. See the commentary in kmacro.el
2692for more commands.
2693 2219
2694The normal macro bindings C-x (, C-x ), and C-x e now interfaces to 2220*** The new variable bibtex-autofill-types contains a list of entry
2695the keyboard macro ring. 2221types for which fields are filled automatically (if possible).
2696 2222
2697The C-x e command now automatically terminates the current macro 2223*** The new command bibtex-complete completes word fragment before
2698before calling it, if used while defining a macro. 2224point according to context (bound to M-tab).
2699 2225
2700In addition, when ending or calling a macro with C-x e, the macro can 2226*** The new commands bibtex-find-entry and bibtex-find-crossref
2701be repeated immediately by typing just the `e'. You can customize 2227locate entries and crossref'd entries (bound to C-c C-s and C-c C-x).
2702this behavior via the variable kmacro-call-repeat-key and 2228Crossref fields are clickable (bound to mouse-2, RET).
2703kmacro-call-repeat-with-arg.
2704 2229
2705Keyboard macros can now be debugged and edited interactively. 2230*** In BibTeX mode the command fill-paragraph (bound to M-q) fills
2706C-x C-k SPC steps through the last keyboard macro one key sequence 2231individual fields of a BibTeX entry.
2707at a time, prompting for the actions to take.
2708 2232
2709--- 2233*** The new variables bibtex-files and bibtex-file-path define a set
2710** The old Octave mode bindings C-c f and C-c i have been changed 2234of BibTeX files that are searched for entry keys.
2711to C-c C-f and C-c C-i. The C-c C-i subcommands now have duplicate
2712bindings on control characters--thus, C-c C-i C-b is the same as
2713C-c C-i b, and so on.
2714 2235
2715** The printing package is now part of the Emacs distribution. 2236*** The new command bibtex-validate-globally checks for duplicate keys
2237in multiple BibTeX files.
2716 2238
2717If you enable the printing package by including (require 'printing) in 2239*** The new command bibtex-copy-summary-as-kill pushes summary
2718the .emacs file, the normal Print item on the File menu is replaced 2240of BibTeX entry to kill ring (bound to C-c C-t).
2719with a Print sub-menu which allows you to preview output through
2720ghostview, use ghostscript to print (if you don't have a PostScript
2721printer) or send directly to printer a PostScript code generated by
2722`ps-print' package. Use M-x pr-help for more information.
2723 2241
2724+++ 2242+++
2725** Calc is now part of the Emacs distribution. 2243** In Enriched mode, `set-left-margin' and `set-right-margin' are now
2244by default bound to `C-c [' and `C-c ]' instead of the former `C-c C-l'
2245and `C-c C-r'.
2726 2246
2727Calc is an advanced desk calculator and mathematical tool written in 2247** GUD changes:
2728Emacs Lisp. Its documentation is in a separate manual; within Emacs,
2729type "C-h i m calc RET" to read that manual. A reference card is
2730available in `etc/calccard.tex' and `etc/calccard.ps'.
2731 2248
2732+++ 2249+++
2733** Tramp is now part of the distribution. 2250*** In GUD mode, when talking to GDB, C-x C-a C-j "jumps" the program
2734 2251counter to the specified source line (the one where point is).
2735This package is similar to Ange-FTP: it allows you to edit remote
2736files. But whereas Ange-FTP uses FTP to access the remote host,
2737Tramp uses a shell connection. The shell connection is always used
2738for filename completion and directory listings and suchlike, but for
2739the actual file transfer, you can choose between the so-called
2740`inline' methods (which transfer the files through the shell
2741connection using base64 or uu encoding) and the `out-of-band' methods
2742(which invoke an external copying program such as `rcp' or `scp' or
2743`rsync' to do the copying).
2744
2745Shell connections can be acquired via `rsh', `ssh', `telnet' and also
2746`su' and `sudo'. Ange-FTP is still supported via the `ftp' method.
2747
2748If you want to disable Tramp you should set
2749
2750 (setq tramp-default-method "ftp")
2751
2752---
2753** The new global minor mode `file-name-shadow-mode' modifies the way
2754filenames being entered by the user in the minibuffer are displayed, so
2755that it's clear when part of the entered filename will be ignored due to
2756emacs' filename parsing rules. The ignored portion can be made dim,
2757invisible, or otherwise less visually noticable. The display method may
2758be displayed by customizing the variable `file-name-shadow-properties'.
2759
2760---
2761** The ruler-mode.el library provides a minor mode for displaying an
2762"active" ruler in the header line. You can use the mouse to visually
2763change the `fill-column', `window-margins' and `tab-stop-list'
2764settings.
2765 2252
2766--- 2253---
2767** The minor mode Reveal mode makes text visible on the fly as you 2254*** GUD mode has its own tool bar for controlling execution of the inferior
2768move your cursor into hidden regions of the buffer. 2255and other common debugger commands.
2769It should work with any package that uses overlays to hide parts
2770of a buffer, such as outline-minor-mode, hs-minor-mode, hide-ifdef-mode, ...
2771
2772There is also Global Reveal mode which affects all buffers.
2773 2256
2774--- 2257---
2775** The new package ibuffer provides a powerful, completely 2258** GUD mode improvements for jdb:
2776customizable replacement for buff-menu.el.
2777
2778+++
2779** The new package table.el implements editable, WYSIWYG, embedded
2780`text tables' in Emacs buffers. It simulates the effect of putting
2781these tables in a special major mode. The package emulates WYSIWYG
2782table editing available in modern word processors. The package also
2783can generate a table source in typesetting and markup languages such
2784as latex and html from the visually laid out text table.
2785
2786+++
2787** SES mode (ses-mode) is a new major mode for creating and editing
2788spreadsheet files. Besides the usual Emacs features (intuitive command
2789letters, undo, cell formulas in Lisp, plaintext files, etc.) it also offers
2790viral immunity and import/export of tab-separated values.
2791 2259
2792--- 2260*** Search for source files using jdb classpath and class
2793** Support for `magic cookie' standout modes has been removed. 2261 information. Fast startup since there is no need to scan all
2794Emacs will still work on terminals that require magic cookies in order 2262 source files up front. There is also no need to create and maintain
2795to use standout mode, however they will not be able to display 2263 lists of source directories to scan. Look at `gud-jdb-use-classpath'
2796mode-lines in inverse-video. 2264 and `gud-jdb-classpath' customization variables documentation.
2797 2265
2798--- 2266*** Supports the standard breakpoint (gud-break, gud-clear)
2799** cplus-md.el has been removed to avoid problems with Custom. 2267 set/clear operations from java source files under the classpath, stack
2268 traversal (gud-up, gud-down), and run until current stack finish
2269 (gud-finish).
2800 2270
2801+++ 2271*** Supports new jdb (Java 1.2 and later) in addition to oldjdb
2802** New package benchmark.el contains simple support for convenient 2272 (Java 1.1 jdb).
2803timing measurements of code (including the garbage collection component).
2804 2273
2805--- 2274*** The previous method of searching for source files has been
2806** The new Lisp library fringe.el controls the appearance of fringes. 2275 preserved in case someone still wants/needs to use it.
2276 Set gud-jdb-use-classpath to nil.
2807 2277
2808--- 2278 Added Customization Variables
2809** `cfengine-mode' is a major mode for editing GNU Cfengine
2810configuration files.
2811
2812* Incompatible Lisp Changes in Emacs 22.1
2813 2279
2814+++ 2280*** gud-jdb-command-name. What command line to use to invoke jdb.
2815** The new interactive-specification `G' reads a file name
2816much like `F', but if the input is a directory name (even defaulted),
2817it returns just the directory name.
2818 2281
2819+++ 2282*** gud-jdb-use-classpath. Allows selection of java source file searching
2820** `suppress-keymap' now works by remapping `self-insert-command' to 2283 method: set to t for new method, nil to scan gud-jdb-directories for
2821the command `undefined'. (In earlier Emacs versions, it used 2284 java sources (previous method).
2822`substitute-key-definition' to rebind self inserting characters to
2823`undefined'.)
2824 2285
2825+++ 2286*** gud-jdb-directories. List of directories to scan and search for java
2826** Mode line display ignores text properties as well as the 2287 classes using the original gud-jdb method (if gud-jdb-use-classpath
2827:propertize and :eval forms in the value of a variable whose 2288 is nil).
2828`risky-local-variable' property is nil.
2829
2830* Lisp Changes in Emacs 22.1
2831 2289
2832** New functions, macros, and commands 2290 Minor Improvements
2833 2291
2834+++ 2292*** The STARTTLS elisp wrapper (starttls.el) can now use GNUTLS
2835*** The new function `filter-buffer-substring' extracts a buffer 2293instead of the OpenSSL based "starttls" tool. For backwards
2836substring, passes it through a set of filter functions, and returns 2294compatibility, it prefers "starttls", but you can toggle
2837the filtered substring. It is used instead of `buffer-substring' or 2295`starttls-use-gnutls' to switch to GNUTLS (or simply remove the
2838`delete-and-extract-region' when copying text into a user-accessible 2296"starttls" tool).
2839data structure, like the kill-ring, X clipboard, or a register. The
2840list of filter function is specified by the new variable
2841`buffer-substring-filters'. For example, Longlines mode uses
2842`buffer-substring-filters' to remove soft newlines from the copied
2843text.
2844 2297
2845+++ 2298*** Do not allow debugger output history variable to grow without bounds.
2846*** (while-no-input BODY...) runs BODY, but only so long as no input
2847arrives. If the user types or clicks anything, BODY stops as if a
2848quit had occurred. while-no-input returns the value of BODY, if BODY
2849finishes. It returns nil if BODY was aborted.
2850 2299
2851+++ 2300** Auto-Revert changes:
2852*** New function `looking-back' checks whether a regular expression matches
2853the text before point. Specifying the LIMIT argument bounds how far
2854back the match can start; this is a way to keep it from taking too long.
2855 2301
2856+++ 2302+++
2857*** New functions `make-progress-reporter', `progress-reporter-update', 2303*** You can now use Auto Revert mode to `tail' a file.
2858`progress-reporter-force-update', `progress-reporter-done', and 2304If point is at the end of a file buffer before reverting, Auto Revert
2859`dotimes-with-progress-reporter' provide a simple and efficient way for 2305mode keeps it at the end after reverting. Similarly if point is
2860a command to present progress messages for the user. 2306displayed at the end of a file buffer in any window, it stays at
2307the end of the buffer in that window. This allows to tail a file:
2308just put point at the end of the buffer and it stays there. This
2309rule applies to file buffers. For non-file buffers, the behavior may
2310be mode dependent.
2861 2311
2862+++ 2312If you are sure that the file will only change by growing at the end,
2863*** The new primitive `get-internal-run-time' returns the processor 2313then you can tail the file more efficiently by using the new minor
2864run time used by Emacs since start-up. 2314mode Auto Revert Tail mode. The function `auto-revert-tail-mode'
2315toggles this mode.
2865 2316
2866+++ 2317+++
2867*** The new function `called-interactively-p' does what many people 2318*** Auto Revert mode is now more careful to avoid excessive reverts and
2868have mistakenly believed `interactive-p' did: it returns t if the 2319other potential problems when deciding which non-file buffers to
2869calling function was called through `call-interactively'. This should 2320revert. This matters especially if Global Auto Revert mode is enabled
2870only be used when you cannot add a new "interactive" argument to the 2321and `global-auto-revert-non-file-buffers' is non-nil. Auto Revert
2871command. 2322mode only reverts a non-file buffer if the buffer has a non-nil
2323`revert-buffer-function' and a non-nil `buffer-stale-function', which
2324decides whether the buffer should be reverted. Currently, this means
2325that auto reverting works for Dired buffers (although this may not
2326work properly on all operating systems) and for the Buffer Menu.
2872 2327
2873+++ 2328+++
2874*** The new function `assoc-string' replaces `assoc-ignore-case' and 2329*** If the new user option `auto-revert-check-vc-info' is non-nil, Auto
2875`assoc-ignore-representation', which are still available, but have 2330Revert mode reliably updates version control info (such as the version
2876been declared obsolete. 2331control number in the mode line), in all version controlled buffers in
2332which it is active. If the option is nil, the default, then this info
2333only gets updated whenever the buffer gets reverted.
2877 2334
2878--- 2335---
2879*** New function quail-find-key returns a list of keys to type in the 2336** recentf changes.
2880current input method to input a character.
2881
2882+++
2883*** New functions posn-at-point and posn-at-x-y return
2884click-event-style position information for a given visible buffer
2885position or for a given window pixel coordinate.
2886 2337
2887+++ 2338The recent file list is now automatically cleanup when recentf mode is
2888*** The new primitive `set-file-times' sets a file's access and 2339enabled. The new option `recentf-auto-cleanup' controls when to do
2889modification times. Magic file name handlers can handle this 2340automatic cleanup.
2890operation.
2891 2341
2892+++ 2342The `recentf-keep' option replaces `recentf-keep-non-readable-files-p'
2893*** The new function syntax-after returns the syntax code 2343and provides a more general mechanism to customize which file names to
2894of the character after a specified buffer position, taking account 2344keep in the recent list.
2895of text properties as well as the character code.
2896 2345
2897*** `syntax-class' extracts the class of a syntax code (as returned 2346With the more advanced option: `recentf-filename-handler', you can
2898by syntax-after). 2347specify a function that transforms filenames handled by recentf. For
2348example, if set to `file-truename', the same file will not be in the
2349recent list with different symbolic links.
2899 2350
2900+++ 2351To follow naming convention, `recentf-menu-append-commands-flag'
2901*** New function `line-number-at-pos' returns line number of current 2352replaces the misnamed option `recentf-menu-append-commands-p'. The
2902line in current buffer, or if optional buffer position is given, line 2353old name remains available as alias, but has been marked obsolete.
2903number of corresponding line in current buffer.
2904 2354
2905+++ 2355+++
2906*** New function `macroexpand-all' expands all macros in a form. 2356** Desktop package
2907It is similar to the Common-Lisp function of the same name.
2908One difference is that it guarantees to return the original argument
2909if no expansion is done, which may be tested using `eq'.
2910 2357
2911+++ 2358+++
2912*** New macro with-local-quit temporarily sets inhibit-quit to nil for use 2359*** Desktop saving is now a minor mode, desktop-save-mode. Variable
2913around potentially blocking or long-running code in timers 2360desktop-enable is obsolete. Customize desktop-save-mode to enable desktop
2914and post-command-hooks. 2361saving.
2915 2362
2916--- 2363---
2917** easy-mmode-define-global-mode has been renamed to 2364*** Buffers are saved in the desktop file in the same order as that in the
2918define-global-minor-mode. The old name remains as an alias. 2365buffer list.
2919
2920+++
2921** An element of buffer-undo-list can now have the form (apply FUNNAME
2922. ARGS), where FUNNAME is a symbol other than t or nil. That stands
2923for a high-level change that should be undone by evaluating (apply
2924FUNNAME ARGS).
2925
2926These entries can also have the form (apply DELTA BEG END FUNNAME . ARGS)
2927which indicates that the change which took place was limited to the
2928range BEG...END and increased the buffer size by DELTA.
2929
2930+++
2931** The line-move, scroll-up, and scroll-down functions will now
2932modify the window vscroll to scroll through display rows that are
2933taller that the height of the window, for example in the presense of
2934large images. To disable this feature, Lisp code may bind the new
2935variable `auto-window-vscroll' to nil.
2936
2937+++
2938** If a buffer sets buffer-save-without-query to non-nil,
2939save-some-buffers will always save that buffer without asking
2940(if it's modified).
2941
2942+++
2943** The function symbol-file tells you which file defined
2944a certain function or variable.
2945 2366
2946+++ 2367+++
2947** Lisp code can now test if a given buffer position is inside a 2368*** The desktop package can be customized to restore only some buffers immediately,
2948clickable link with the new function `mouse-on-link-p'. This is the 2369remaining buffers are restored lazily (when Emacs is idle).
2949function used by the new `mouse-1-click-follows-link' functionality.
2950 2370
2951+++ 2371+++
2952** `set-auto-mode' now gives the interpreter magic line (if present) 2372*** New commands:
2953precedence over the file name. Likewise an <?xml or <!DOCTYPE declaration 2373 - desktop-revert reverts to the last loaded desktop.
2954will give the buffer XML or SGML mode, based on the new var 2374 - desktop-change-dir kills current desktop and loads a new.
2955`magic-mode-alist'. 2375 - desktop-save-in-desktop-dir saves desktop in the directory from which
2376 it was loaded.
2377 - desktop-lazy-complete runs the desktop load to completion.
2378 - desktop-lazy-abort aborts lazy loading of the desktop.
2956 2379
2957--- 2380---
2958** To manipulate the File menu using easy-menu, you must specify the 2381*** New customizable variables:
2959proper name "file". In previous Emacs versions, you had to specify 2382 - desktop-save. Determins whether the desktop should be saved when it is
2960"files", even though the menu item itself was changed to say "File" 2383 killed.
2961several versions ago. 2384 - desktop-file-name-format. Format in which desktop file names should be saved.
2962 2385 - desktop-path. List of directories in which to lookup the desktop file.
2963+++ 2386 - desktop-locals-to-save. List of local variables to save.
2964** read-from-minibuffer now accepts an additional argument KEEP-ALL 2387 - desktop-globals-to-clear. List of global variables that `desktop-clear' will clear.
2965saying to put all inputs in the history list, even empty ones. 2388 - desktop-clear-preserve-buffers-regexp. Regexp identifying buffers that `desktop-clear'
2389 should not delete.
2390 - desktop-restore-eager. Number of buffers to restore immediately. Remaining buffers are
2391 restored lazily (when Emacs is idle).
2392 - desktop-lazy-verbose. Verbose reporting of lazily created buffers.
2393 - desktop-lazy-idle-delay. Idle delay before starting to create buffers.
2966 2394
2967+++ 2395+++
2968** The new variable search-spaces-regexp controls how to search 2396*** New command line option --no-desktop
2969for spaces in a regular expression. If it is non-nil, it should be a
2970regular expression, and any series of spaces stands for that regular
2971expression. If it is nil, spaces stand for themselves.
2972
2973Spaces inside of constructs such as [..] and *, +, ? are never
2974replaced with search-spaces-regexp.
2975 2397
2976--- 2398---
2977** list-buffers-noselect now takes an additional argument, BUFFER-LIST. 2399*** New hooks:
2978If it is non-nil, it specifies which buffers to list. 2400 - desktop-after-read-hook run after a desktop is loaded.
2401 - desktop-no-desktop-file-hook run when no desktop file is found.
2979 2402
2980--- 2403---
2981** set-buffer-file-coding-system now takes an additional argument, 2404** The saveplace.el package now filters out unreadable files.
2982NOMODIFY. If it is non-nil, it means don't mark the buffer modified. 2405When you exit Emacs, the saved positions in visited files no longer
2983 2406include files that aren't readable, e.g. files that don't exist.
2984+++ 2407Customize the new option `save-place-forget-unreadable-files' to nil
2985** An interactive specification may now use the code letter 'U' to get 2408to get the old behavior. The new options `save-place-save-skipped'
2986the up-event that was discarded in case the last key sequence read for a 2409and `save-place-skip-check-regexp' allow further fine-tuning of this
2987previous 'k' or 'K' argument was a down-event; otherwise nil is used. 2410feature.
2988
2989+++
2990** Function `translate-region' accepts also a char-table as TABLE
2991argument.
2992
2993+++
2994** Major mode functions now run the new normal hook
2995`after-change-major-mode-hook', at their very end, after the mode hooks.
2996
2997+++
2998** `auto-save-file-format' has been renamed to
2999`buffer-auto-save-file-format' and made into a permanent local.
3000
3001+++
3002** Both the variable and the function `disabled-command-hook' have
3003been renamed to `disabled-command-function'. The variable
3004`disabled-command-hook' has been kept as an obsolete alias.
3005
3006+++
3007** Function `compute-motion' now calculates the usable window
3008width if the WIDTH argument is nil. If the TOPOS argument is nil,
3009the usable window height and width is used.
3010
3011+++
3012** `visited-file-modtime' and `calendar-time-from-absolute' now return
3013a list of two integers, instead of a cons.
3014
3015+++
3016** If a command sets transient-mark-mode to `only', that
3017enables Transient Mark mode for the following command only.
3018During that following command, the value of transient-mark-mode
3019is `identity'. If it is still `identity' at the end of the command,
3020it changes to nil.
3021
3022+++
3023** Cleaner way to enter key sequences.
3024
3025You can enter a constant key sequence in a more natural format, the
3026same one used for saving keyboard macros, using the macro `kbd'. For
3027example,
3028
3029(kbd "C-x C-f") => "\^x\^f"
3030
3031+++
3032** The sentinel is now called when a network process is deleted with
3033delete-process. The status message passed to the sentinel for a
3034deleted network process is "deleted". The message passed to the
3035sentinel when the connection is closed by the remote peer has been
3036changed to "connection broken by remote peer".
3037
3038+++
3039** If the buffer's undo list for the current command gets longer than
3040undo-outer-limit, garbage collection empties it. This is to prevent
3041it from using up the available memory and choking Emacs.
3042
3043+++
3044** skip-chars-forward and skip-chars-backward now handle
3045character classes such as [:alpha:], along with individual characters
3046and ranges.
3047
3048+++
3049** Function pos-visible-in-window-p now returns the pixel coordinates
3050and partial visiblity state of the corresponding row, if the PARTIALLY
3051arg is non-nil.
3052
3053+++
3054** The function `eql' is now available without requiring the CL package.
3055 2411
3056+++ 2412** EDiff changes.
3057** The display space :width and :align-to text properties are now
3058supported on text terminals.
3059 2413
3060+++ 2414+++
3061** Support for displaying image slices 2415*** When comparing directories.
3062 2416Typing D brings up a buffer that lists the differences between the contents of
3063*** New display property (slice X Y WIDTH HEIGHT) may be used with 2417directories. Now it is possible to use this buffer to copy the missing files
3064an image property to display only a specific slice of the image. 2418from one directory to another.
3065
3066*** Function insert-image has new optional fourth arg to
3067specify image slice (X Y WIDTH HEIGHT).
3068
3069*** New function insert-sliced-image inserts a given image as a
3070specified number of evenly sized slices (rows x columns).
3071 2419
3072+++ 2420+++
3073** New line-height and line-spacing properties for newline characters 2421*** When comparing files or buffers.
3074 2422Typing the = key now offers to perform the word-by-word comparison of the
3075A newline may now have line-height and line-spacing text or overlay 2423currently highlighted regions in an inferior Ediff session. If you answer 'n'
3076properties that control the height of the corresponding display row. 2424then it reverts to the old behavior and asks the user to select regions for
3077 2425comparison.
3078If the line-height property value is t, the newline does not
3079contribute to the height of the display row; instead the height of the
3080newline glyph is reduced. Also, a line-spacing property on this
3081newline is ignored. This can be used to tile small images or image
3082slices without adding blank areas between the images.
3083
3084If the line-height property value is a positive integer, the value
3085specifies the minimum line height in pixels. If necessary, the line
3086height it increased by increasing the line's ascent.
3087
3088If the line-height property value is a float, the minimum line height
3089is calculated by multiplying the default frame line height by the
3090given value.
3091
3092If the line-height property value is a cons (FACE . RATIO), the
3093minimum line height is calculated as RATIO * height of named FACE.
3094RATIO is int or float. If FACE is t, it specifies the current face.
3095
3096If the line-height property value is a cons (nil . RATIO), the line
3097height is calculated as RATIO * actual height of the line's contents.
3098
3099If the line-height value is a cons (HEIGHT . TOTAL), HEIGHT specifies
3100the line height as described above, while TOTAL is any of the forms
3101described above and specifies the total height of the line, causing a
3102varying number of pixels to be inserted after the line to make it line
3103exactly that many pixels high.
3104
3105If the line-spacing property value is an positive integer, the value
3106is used as additional pixels to insert after the display line; this
3107overrides the default frame line-spacing and any buffer local value of
3108the line-spacing variable.
3109
3110If the line-spacing property may be a float or cons, the line spacing
3111is calculated as specified above for the line-height property.
3112 2426
3113+++ 2427*** The new command `ediff-backup' compares a file with its most recent
3114** The buffer local line-spacing variable may now have a float value, 2428backup using `ediff'. If you specify the name of a backup file,
3115which is used as a height relative to the default frame line height. 2429`ediff-backup' compares it with the file of which it is a backup.
3116 2430
3117+++ 2431+++
3118** Enhancements to stretch display properties 2432** Etags changes.
3119
3120The display property stretch specification form `(space PROPS)', where
3121PROPS is a property list now allows pixel based width and height
3122specifications, as well as enhanced horizontal text alignment.
3123
3124The value of these properties can now be a (primitive) expression
3125which is evaluated during redisplay. The following expressions
3126are supported:
3127
3128EXPR ::= NUM | (NUM) | UNIT | ELEM | POS | IMAGE | FORM
3129NUM ::= INTEGER | FLOAT | SYMBOL
3130UNIT ::= in | mm | cm | width | height
3131ELEM ::= left-fringe | right-fringe | left-margin | right-margin
3132 | scroll-bar | text
3133POS ::= left | center | right
3134FORM ::= (NUM . EXPR) | (OP EXPR ...)
3135OP ::= + | -
3136
3137The form `NUM' specifies a fractional width or height of the default
3138frame font size. The form `(NUM)' specifies an absolute number of
3139pixels. If a symbol is specified, its buffer-local variable binding
3140is used. The `in', `mm', and `cm' units specifies the number of
3141pixels per inch, milli-meter, and centi-meter, resp. The `width' and
3142`height' units correspond to the width and height of the current face
3143font. An image specification corresponds to the width or height of
3144the image.
3145
3146The `left-fringe', `right-fringe', `left-margin', `right-margin',
3147`scroll-bar', and `text' elements specify to the width of the
3148corresponding area of the window.
3149
3150The `left', `center', and `right' positions can be used with :align-to
3151to specify a position relative to the left edge, center, or right edge
3152of the text area. One of the above window elements (except `text')
3153can also be used with :align-to to specify that the position is
3154relative to the left edge of the given area. Once the base offset for
3155a relative position has been set (by the first occurrence of one of
3156these symbols), further occurences of these symbols are interpreted as
3157the width of the area.
3158 2433
3159For example, to align to the center of the left-margin, use 2434*** New regular expressions features
3160 :align-to (+ left-margin (0.5 . left-margin))
3161 2435
3162If no specific base offset is set for alignment, it is always relative 2436**** New syntax for regular expressions, multi-line regular expressions.
3163to the left edge of the text area. For example, :align-to 0 in a 2437The syntax --ignore-case-regexp=/regex/ is now undocumented and retained
3164header-line aligns with the first text column in the text area. 2438only for backward compatibility. The new equivalent syntax is
2439--regex=/regex/i. More generally, it is --regex=/TAGREGEX/TAGNAME/MODS,
2440where `/TAGNAME' is optional, as usual, and MODS is a string of 0 or
2441more characters among `i' (ignore case), `m' (multi-line) and `s'
2442(single-line). The `m' and `s' modifiers behave as in Perl regular
2443expressions: `m' allows regexps to match more than one line, while `s'
2444(which implies `m') means that `.' matches newlines. The ability to
2445span newlines allows writing of much more powerful regular expressions
2446and rapid prototyping for tagging new languages.
3165 2447
3166The value of the form `(NUM . EXPR)' is the value of NUM multiplied by 2448**** Regular expressions can use char escape sequences as in Gcc.
3167the value of the expression EXPR. For example, (2 . in) specifies a 2449The escaped character sequence \a, \b, \d, \e, \f, \n, \r, \t, \v,
3168width of 2 inches, while (0.5 . IMAGE) specifies half the width (or 2450respectively, stand for the ASCII characters BEL, BS, DEL, ESC, FF, NL,
3169height) of the specified image. 2451CR, TAB, VT,
3170 2452
3171The form `(+ EXPR ...)' adds up the value of the expressions. 2453**** Regular expressions can be bound to a given language.
3172The form `(- EXPR ...)' negates or subtracts the value of the expressions. 2454The syntax --regex={LANGUAGE}REGEX means that REGEX is used to make tags
2455only for files of language LANGUAGE, and ignored otherwise. This is
2456particularly useful when storing regexps in a file.
3173 2457
3174+++ 2458**** Regular expressions can be read from a file.
3175** Normally, the cursor is displayed at the end of any overlay and 2459The --regex=@regexfile option means read the regexps from a file, one
3176text property string that may be present at the current window 2460per line. Lines beginning with space or tab are ignored.
3177position. The cursor may now be placed on any character of such
3178strings by giving that character a non-nil `cursor' text property.
3179 2461
3180** The first face specification element in a defface can specify 2462*** New language parsing features
3181`default' instead of frame classification. Then its attributes act as
3182defaults that apply to all the subsequent cases (and may be overridden
3183by them).
3184 2463
3185+++ 2464**** The `::' qualifier triggers C++ parsing in C file.
3186** New face attribute `min-colors' can be used to tailor the face color 2465Previously, only the `template' and `class' keywords had this effect.
3187to the number of colors supported by a display, and define the
3188foreground and background colors accordingly so that they look best on
3189a terminal that supports at least this many colors. This is now the
3190preferred method for defining default faces in a way that makes a good
3191use of the capabilities of the display.
3192 2466
3193+++ 2467**** The gnucc __attribute__ keyword is now recognised and ignored.
3194** Customizable fringe bitmaps
3195 2468
3196*** New function 'define-fringe-bitmap' can now be used to create new 2469**** New language HTML.
3197fringe bitmaps, as well as change the built-in fringe bitmaps. 2470Title and h1, h2, h3 are tagged. Also, tags are generated when name= is
2471used inside an anchor and whenever id= is used.
3198 2472
3199To change a built-in bitmap, do (require 'fringe) and use the symbol 2473**** In Makefiles, constants are tagged.
3200identifing the bitmap such as `left-truncation or `continued-line'. 2474If you want the old behavior instead, thus avoiding to increase the
2475size of the tags file, use the --no-globals option.
3201 2476
3202*** New function 'destroy-fringe-bitmap' may be used to destroy a 2477**** New language Lua.
3203previously created bitmap, or restore a built-in bitmap. 2478All functions are tagged.
3204 2479
3205*** New function 'set-fringe-bitmap-face' can now be used to set a 2480**** In Perl, packages are tags.
3206specific face to be used for a specific fringe bitmap. The face is 2481Subroutine tags are named from their package. You can jump to sub tags
3207automatically merged with the `fringe' face, so normally, the face 2482as you did before, by the sub name, or additionally by looking for
3208should only specify the foreground color of the bitmap. 2483package::sub.
3209 2484
3210*** There are new display properties, left-fringe and right-fringe, 2485**** In Prolog, etags creates tags for rules in addition to predicates.
3211that can be used to show a specific bitmap in the left or right fringe
3212bitmap of the display line.
3213 2486
3214Format is 'display '(left-fringe BITMAP [FACE]), where BITMAP is a 2487**** New language PHP.
3215symbol identifying a fringe bitmap, either built-in or defined with 2488Tags are functions, classes and defines.
3216`define-fringe-bitmap', and FACE is an optional face name to be used 2489If the --members option is specified to etags, tags are variables also.
3217for displaying the bitmap instead of the default `fringe' face.
3218When specified, FACE is automatically merged with the `fringe' face.
3219 2490
3220*** New function `fringe-bitmaps-at-pos' returns the current fringe 2491**** New default keywords for TeX.
3221bitmaps in the display line at a given buffer position. 2492The new keywords are def, newcommand, renewcommand, newenvironment and
2493renewenvironment.
3222 2494
3223+++ 2495*** Honour #line directives.
3224** Multiple overlay arrows can now be defined and managed via the new 2496When Etags parses an input file that contains C preprocessor's #line
3225variable `overlay-arrow-variable-list'. It contains a list of 2497directives, it creates tags using the file name and line number
3226varibles which contain overlay arrow position markers, including 2498specified in those directives. This is useful when dealing with code
3227the original `overlay-arrow-position' variable. 2499created from Cweb source files. When Etags tags the generated file, it
2500writes tags pointing to the source file.
3228 2501
3229Each variable on this list may have individual `overlay-arrow-string' 2502*** New option --parse-stdin=FILE.
3230and `overlay-arrow-bitmap' properties that specify an overlay arrow 2503This option is mostly useful when calling etags from programs. It can
3231string (for non-window terminals) or fringe bitmap (for window 2504be used (only once) in place of a file name on the command line. Etags
3232systems) to display at the corresponding overlay arrow position. 2505reads from standard input and marks the produced tags as belonging to
3233If either property is not set, the default `overlay-arrow-string' or 2506the file FILE.
3234'overlay-arrow-fringe-bitmap' will be used.
3235 2507
3236+++ 2508** VC Changes
3237** The default value of `sentence-end' is now defined using the new
3238variable `sentence-end-without-space' which contains such characters
3239that end a sentence without following spaces.
3240 2509
3241+++ 2510+++
3242** The function `sentence-end' should be used to obtain the value of 2511*** The key C-x C-q no longer checks files in or out, it only changes
3243the variable `sentence-end'. If the variable `sentence-end' is nil, 2512the read-only state of the buffer (toggle-read-only). We made this
3244then this function returns the regexp constructed from the variables 2513change because we held a poll and found that many users were unhappy
3245`sentence-end-without-period', `sentence-end-double-space' and 2514with the previous behavior. If you do prefer this behavior, you
3246`sentence-end-without-space'. 2515can bind `vc-toggle-read-only' to C-x C-q in your .emacs:
3247 2516
3248+++ 2517 (global-set-key "\C-x\C-q" 'vc-toggle-read-only)
3249** The flags, width, and precision options for %-specifications in function
3250`format' are now documented. Some flags that were accepted but not
3251implemented (such as "*") are no longer accepted.
3252 2518
3253+++ 2519The function `vc-toggle-read-only' will continue to exist.
3254** New function `delete-dups' destructively removes `equal' duplicates
3255from a list. Of several `equal' occurrences of an element in the list,
3256the first one is kept.
3257 2520
3258+++ 2521+++
3259** `declare' is now a macro. This change was made mostly for 2522*** There is a new user option `vc-cvs-global-switches' that allows
3260documentation purposes and should have no real effect on Lisp code. 2523you to specify switches that are passed to any CVS command invoked
2524by VC. These switches are used as "global options" for CVS, which
2525means they are inserted before the command name. For example, this
2526allows you to specify a compression level using the "-z#" option for
2527CVS.
3261 2528
3262+++ 2529+++
3263** The new hook `before-save-hook' is invoked by `basic-save-buffer' 2530*** New backends for Subversion and Meta-CVS.
3264before saving buffers. This allows packages to perform various final
3265tasks, for example; it can be used by the copyright package to make
3266sure saved files have the current year in any copyright headers.
3267 2531
3268+++ 2532+++
3269** The function `insert-for-yank' now supports strings where the 2533*** vc-annotate-mode enhancements
3270`yank-handler' property does not span the first character of the
3271string. The old behavior is available if you call
3272`insert-for-yank-1' instead.
3273 2534
3274+++ 2535In vc-annotate mode, you can now use the following key bindings for
3275** New function `get-char-property-and-overlay' accepts the same 2536enhanced functionality to browse the annotations of past revisions, or
3276arguments as `get-char-property' and returns a cons whose car is the 2537to view diffs or log entries directly from vc-annotate-mode:
3277return value of `get-char-property' called with those arguments and
3278whose cdr is the overlay in which the property was found, or nil if
3279it was found as a text property or not found at all.
3280 2538
3281+++ (lispref) 2539 P: annotates the previous revision
3282??? (man) 2540 N: annotates the next revision
3283** The mouse pointer shape in void text areas (i.e. after the end of a 2541 J: annotates the revision at line
3284line or below the last line in the buffer) of the text window is now 2542 A: annotates the revision previous to line
3285controlled by the new variable `void-text-area-pointer'. The default 2543 D: shows the diff of the revision at line with its previous revision
3286is to use the `arrow' (non-text) pointer. Other choices are `text' 2544 L: shows the log of the revision at line
3287(or nil), `hand', `vdrag', `hdrag', `modeline', and `hourglass'. 2545 W: annotates the workfile (most up to date) version
3288 2546
3289+++ 2547** pcl-cvs changes:
3290** The mouse pointer shape over an image can now be controlled by the
3291:pointer image property.
3292 2548
3293+++ 2549+++
3294** The mouse pointer shape over ordinary text or images may now be 2550*** In pcl-cvs mode, there is a new `d y' command to view the diffs
3295controlled/overriden via the `pointer' text property. 2551between the local version of the file and yesterday's head revision
2552in the repository.
3296 2553
3297+++ 2554+++
3298** Images may now have an associated image map via the :map property. 2555*** In pcl-cvs mode, there is a new `d r' command to view the changes
2556anyone has committed to the repository since you last executed
2557"checkout", "update" or "commit". That means using cvs diff options
2558-rBASE -rHEAD.
3299 2559
3300An image map is an alist where each element has the format (AREA ID PLIST). 2560** Gnus package
3301An AREA is specified as either a rectangle, a circle, or a polygon:
3302A rectangle is a cons (rect . ((x0 . y0) . (x1 . y1))) specifying the
3303pixel coordinates of the upper left and bottom right corners.
3304A circle is a cons (circle . ((x0 . y0) . r)) specifying the center
3305and the radius of the circle; r may be a float or integer.
3306A polygon is a cons (poly . [x0 y0 x1 y1 ...]) where each pair in the
3307vector describes one corner in the polygon.
3308 2561
3309When the mouse pointer is above a hot-spot area of an image, the 2562---
3310PLIST of that hot-spot is consulted; if it contains a `help-echo' 2563*** Gnus now includes Sieve and PGG
3311property it defines a tool-tip for the hot-spot, and if it contains 2564Sieve is a library for managing Sieve scripts. PGG is a library to handle
3312a `pointer' property, it defines the shape of the mouse cursor when 2565PGP/MIME.
3313it is over the hot-spot. See the variable 'void-area-text-pointer'
3314for possible pointer shapes.
3315 2566
3316When you click the mouse when the mouse pointer is over a hot-spot, 2567---
3317an event is composed by combining the ID of the hot-spot with the 2568*** There are many news features, bug fixes and improvements.
3318mouse event, e.g. [area4 mouse-1] if the hot-spot's ID is `area4'. 2569See the file GNUS-NEWS or the node "Oort Gnus" in the Gnus manual for details.
3319 2570
3320** Mouse event enhancements: 2571---
2572** Rmail now displays 5-digit message ids in its summary buffer.
3321 2573
3322+++ 2574+++
3323*** Mouse clicks on fringes now generates left-fringe or right-fringes 2575** Support for `movemail' from GNU mailutils was added to Rmail.
3324events, rather than a text area click event. 2576This version of `movemail' allows to read mail from a wide range of
2577mailbox formats, including remote POP3 and IMAP4 mailboxes with or
2578without TLS encryption. If GNU mailutils is installed on the system
2579and its version of `movemail' can be found in exec-path, it will be
2580used instead of the native one.
3325 2581
3326+++ 2582---
3327*** Mouse clicks in the left and right marginal areas now includes a 2583** MH-E changes.
3328sensible buffer position corresponding to the first character in the
3329corresponding text row.
3330 2584
3331+++ 2585Upgraded to MH-E version 7.82. There have been major changes since
3332*** Function `mouse-set-point' now works for events outside text area. 2586version 5.0.2; see MH-E-NEWS for details.
3333 2587
3334+++ 2588** Calendar changes:
3335*** Mouse events now includes buffer position for all event types.
3336 2589
3337+++ 2590+++
3338*** `posn-point' now returns buffer position for non-text area events. 2591*** There is a new calendar package, icalendar.el, that can be used to
2592convert Emacs diary entries to/from the iCalendar format.
3339 2593
3340+++ 2594+++
3341*** New function `posn-area' returns window area clicked on (nil means 2595*** Diary sexp entries can have custom marking in the calendar.
3342text area). 2596Diary sexp functions which only apply to certain days (such as
2597`diary-block' or `diary-cyclic') now take an optional parameter MARK,
2598which is the name of a face or a single-character string indicating
2599how to highlight the day in the calendar display. Specifying a
2600single-character string as @var{mark} places the character next to the
2601day in the calendar. Specifying a face highlights the day with that
2602face. This lets you have different colors or markings for vacations,
2603appointments, paydays or anything else using a sexp.
3343 2604
3344+++ 2605+++
3345*** Mouse events include actual glyph column and row for all event types. 2606*** The new function `calendar-goto-day-of-year' (g D) prompts for a
2607year and day number, and moves to that date. Negative day numbers
2608count backward from the end of the year.
3346 2609
3347+++ 2610+++
3348*** New function `posn-actual-col-row' returns actual glyph coordinates. 2611*** The new Calendar function `calendar-goto-iso-week' (g w)
2612prompts for a year and a week number, and moves to the first
2613day of that ISO week.
3349 2614
3350+++ 2615---
3351*** Mouse events may now include image object in addition to string object. 2616*** The new variable `calendar-minimum-window-height' affects the
2617window generated by the function `generate-calendar-window'.
3352 2618
3353+++ 2619---
3354*** Mouse events include relative x and y pixel coordinates relative to 2620*** The functions `holiday-easter-etc' and `holiday-advent' now take
3355the top left corner of the object (image or character) clicked on. 2621optional arguments, in order to only report on the specified holiday
2622rather than all. This makes customization of variables such as
2623`christian-holidays' simpler.
3356 2624
3357+++ 2625---
3358*** Mouse events include the pixel width and height of the object 2626*** The function `simple-diary-display' now by default sets a header line.
3359(image or character) clicked on. 2627This can be controlled through the variables `diary-header-line-flag'
2628and `diary-header-line-format'.
3360 2629
3361+++ 2630+++
3362*** New functions 'posn-object', 'posn-object-x-y', and 2631*** The procedure for activating appointment reminders has changed: use
3363'posn-object-width-height' return the image or string object of a mouse 2632the new function `appt-activate'. The new variable
3364click, the x and y pixel coordinates relative to the top left corner 2633`appt-display-format' controls how reminders are displayed, replacing
3365of that object, and the total width and height of that object. 2634appt-issue-message, appt-visible, and appt-msg-window.
3366 2635
3367+++ 2636+++
3368** New function `force-window-update' can initiate a full redisplay of 2637*** The new functions `diary-from-outlook', `diary-from-outlook-gnus',
3369one or all windows. Normally, this is not needed as changes in window 2638and `diary-from-outlook-rmail' can be used to import diary entries
3370contents are detected automatically. However, certain implicit 2639from Outlook-format appointments in mail messages. The variable
3371changes to mode lines, header lines, or display properties may require 2640`diary-outlook-formats' can be customized to recognize additional
3372forcing an explicit window update. 2641formats.
3373 2642
3374--- 2643---
3375** New function `redirect-debugging-output' can be used to redirect 2644** sql changes.
3376debugging output on the stderr file handle to a file.
3377 2645
3378+++ 2646*** The variable `sql-product' controls the highlightng of different
3379** `split-string' now includes null substrings in the returned list if 2647SQL dialects. This variable can be set globally via Customize, on a
3380the optional argument SEPARATORS is non-nil and there are matches for 2648buffer-specific basis via local variable settings, or for the current
3381SEPARATORS at the beginning or end of the string. If SEPARATORS is 2649session using the new SQL->Product submenu. (This menu replaces the
3382nil, or if the new optional third argument OMIT-NULLS is non-nil, all 2650SQL->Highlighting submenu.)
3383empty matches are omitted from the returned list.
3384 2651
3385+++ 2652The following values are supported:
3386** `makehash' is now obsolete. Use `make-hash-table' instead.
3387 2653
3388+++ 2654 ansi ANSI Standard (default)
3389** If optional third argument APPEND to `add-to-list' is non-nil, a 2655 db2 DB2
3390new element gets added at the end of the list instead of at the 2656 informix Informix
3391beginning. This change actually occurred in Emacs-21.1, but was not 2657 ingres Ingres
3392documented. 2658 interbase Interbase
2659 linter Linter
2660 ms Microsoft
2661 mysql MySQL
2662 oracle Oracle
2663 postgres Postgres
2664 solid Solid
2665 sqlite SQLite
2666 sybase Sybase
3393 2667
3394** Major modes can define `eldoc-print-current-symbol-info-function' 2668The current product name will be shown on the mode line following the
3395locally to provide Eldoc functionality by some method appropriate to 2669SQL mode indicator.
3396the language.
3397 2670
3398--- 2671The technique of setting `sql-mode-font-lock-defaults' directly in
3399** New coding system property `mime-text-unsuitable' indicates that 2672your .emacs will no longer establish the default highlighting -- Use
3400the coding system's `mime-charset' is not suitable for MIME text 2673`sql-product' to accomplish this.
3401parts, e.g. utf-16.
3402 2674
3403+++ 2675ANSI keywords are always highlighted.
3404** The argument to forward-word, backward-word, forward-to-indentation
3405and backward-to-indentation is now optional, and defaults to 1.
3406 2676
3407+++ 2677*** The function `sql-add-product-keywords' can be used to add
3408** (char-displayable-p CHAR) returns non-nil if Emacs ought to be able 2678font-lock rules to the product specific rules. For example, to have
3409to display CHAR. More precisely, if the selected frame's fontset has 2679all identifiers ending in "_t" under MS SQLServer treated as a type,
3410a font to display the character set that CHAR belongs to. 2680you would use the following line in your .emacs file:
3411 2681
3412Fontsets can specify a font on a per-character basis; when the fontset 2682 (sql-add-product-keywords 'ms
3413does that, this value may not be accurate. 2683 '(("\\<\\w+_t\\>" . font-lock-type-face)))
3414 2684
3415+++ 2685*** Oracle support includes keyword highlighting for Oracle 9i. Most
3416** The new function `window-inside-edges' returns the edges of the 2686SQL and PL/SQL keywords are implemented. SQL*Plus commands are
3417actual text portion of the window, not including the scroll bar or 2687highlighted in `font-lock-doc-face'.
3418divider line, the fringes, the display margins, the header line and
3419the mode line.
3420 2688
3421+++ 2689*** Microsoft SQLServer support has been significantly improved.
3422** The new functions `window-pixel-edges' and `window-inside-pixel-edges' 2690Keyword highlighting for SqlServer 2000 is implemented.
3423return window edges in units of pixels, rather than columns and lines. 2691sql-interactive-mode defaults to use osql, rather than isql, because
2692osql flushes its error stream more frequently. Thus error messages
2693are displayed when they occur rather than when the session is
2694terminated.
3424 2695
3425+++ 2696If the username and password are not provided to `sql-ms', osql is
3426** The kill-buffer-hook is now permanent-local. 2697called with the -E command line argument to use the operating system
2698credentials to authenticate the user.
3427 2699
3428+++ 2700*** Postgres support is enhanced.
3429** `select-window' takes an optional second argument `norecord', like 2701Keyword highlighting of Postgres 7.3 is implemented. Prompting for
3430`switch-to-buffer'. 2702the username and the pgsql `-U' option is added.
3431 2703
3432+++ 2704*** MySQL support is enhanced.
3433** The new macro `with-selected-window' temporarily switches the 2705Keyword higlighting of MySql 4.0 is implemented.
3434selected window without impacting the order of buffer-list.
3435 2706
3436+++ 2707*** Imenu support has been enhanced to locate tables, views, indexes,
3437** The `keymap' property now also works at the ends of overlays and 2708packages, procedures, functions, triggers, sequences, rules, and
3438text-properties, according to their stickiness. This also means that it 2709defaults.
3439works with empty overlays. The same hold for the `local-map' property.
3440 2710
3441+++ 2711*** Added SQL->Start SQLi Session menu entry which calls the
3442** (map-keymap FUNCTION KEYMAP) applies the function to each binding 2712appropriate sql-interactive-mode wrapper for the current setting of
3443in the keymap. 2713`sql-product'.
3444 2714
3445--- 2715---
3446** VC changes for backends: 2716*** Support for the SQLite interpreter has been added to sql.el by calling
3447*** (vc-switches BACKEND OPERATION) is a new function for use by backends. 2717'sql-sqlite'.
3448*** The new `find-version' backend function replaces the `destfile'
3449parameter of the `checkout' backend function.
3450Old code still works thanks to a default `find-version' behavior that
3451uses the old `destfile' parameter.
3452
3453+++
3454** The new macro dynamic-completion-table supports using functions
3455as a dynamic completion table.
3456
3457 (dynamic-completion-table FUN)
3458 2718
3459FUN is called with one argument, the string for which completion is required, 2719** FFAP changes:
3460and it should return an alist containing all the intended possible
3461completions. This alist may be a full list of possible completions so that FUN
3462can ignore the value of its argument. If completion is performed in the
3463minibuffer, FUN will be called in the buffer from which the minibuffer was
3464entered. dynamic-completion-table then computes the completion.
3465 2720
3466+++ 2721+++
3467** The new macro lazy-completion-table initializes a variable 2722*** New ffap commands and keybindings: C-x C-r (`ffap-read-only'),
3468as a lazy completion table. 2723C-x C-v (`ffap-alternate-file'), C-x C-d (`ffap-list-directory'),
3469 2724C-x 4 r (`ffap-read-only-other-window'), C-x 4 d (`ffap-dired-other-window'),
3470 (lazy-completion-table VAR FUN &rest ARGS) 2725C-x 5 r (`ffap-read-only-other-frame'), C-x 5 d (`ffap-dired-other-frame').
3471
3472If the completion table VAR is used for the first time (e.g., by passing VAR
3473as an argument to `try-completion'), the function FUN is called with arguments
3474ARGS. FUN must return the completion table that will be stored in VAR. If
3475completion is requested in the minibuffer, FUN will be called in the buffer
3476from which the minibuffer was entered. The return value of
3477`lazy-completion-table' must be used to initialize the value of VAR.
3478 2726
3479+++ 2727---
3480** `minor-mode-list' now holds a list of minor mode commands. 2728*** FFAP accepts wildcards in a file name by default. C-x C-f passes
2729it to `find-file' with non-nil WILDCARDS argument, which visits
2730multiple files, and C-x d passes it to `dired'.
3481 2731
3482+++ 2732---
3483** The new function `modify-all-frames-parameters' modifies parameters 2733** skeleton.el now supports using - to mark the skeleton-point without
3484for all (existing and future) frames. 2734 interregion interaction. @ has reverted to only setting
2735 skeleton-positions and no longer sets skeleton-point. Skeletons
2736 which used @ to mark skeleton-point independent of _ should now use -
2737 instead. The updated skeleton-insert docstring explains these new
2738 features along with other details of skeleton construction.
3485 2739
3486+++ 2740---
3487** `sit-for' can now be called with args (SECONDS &optional NODISP). 2741** New variable `hs-set-up-overlay' allows customization of the overlay
2742used to effect hiding for hideshow minor mode. Integration with isearch
2743handles the overlay property `display' specially, preserving it during
2744temporary overlay showing in the course of an isearch operation.
3488 2745
3489+++ 2746+++
3490** New standard font-lock face `font-lock-preprocessor-face'. 2747** hide-ifdef-mode now uses overlays rather than selective-display
2748to hide its text. This should be mostly transparent but slightly
2749changes the behavior of motion commands like C-e and C-p.
3491 2750
3492+++ 2751---
3493** The macro `with-syntax-table' does not copy the table any more. 2752** partial-completion-mode now does partial completion on directory names.
3494 2753
3495+++ 2754---
3496** The variable `face-font-rescale-alist' specifies how much larger 2755** The type-break package now allows `type-break-file-name' to be nil
3497(or smaller) font we should use. For instance, if the value is 2756and if so, doesn't store any data across sessions. This is handy if
3498'((SOME-FONTNAME-PATTERN . 1.3)) and a face requests a font of 10 2757you don't want the .type-break file in your home directory or are
3499point, we actually use a font of 13 point if the font matches 2758annoyed by the need for interaction when you kill Emacs.
3500SOME-FONTNAME-PATTERN.
3501 2759
3502+++ 2760---
3503** The function `number-sequence' returns a list of equally-separated 2761** `ps-print' can now print characters from the mule-unicode charsets.
3504numbers. For instance, (number-sequence 4 9) returns (4 5 6 7 8 9).
3505By default, the separation is 1, but you can specify a different separation
3506as the third argument. (number-sequence 1.5 6 2) returns (1.5 3.5 5.5).
3507 2762
3508+++ 2763Printing text with characters from the mule-unicode-* sets works with
3509** `file-chase-links' now takes an optional second argument LIMIT which 2764ps-print, provided that you have installed the appropriate BDF fonts.
3510specifies the maximum number of links to chase through. If after that 2765See the file INSTALL for URLs where you can find these fonts.
3511many iterations the file name obtained is still a symbolic link,
3512`file-chase-links' returns it anyway.
3513 2766
3514--- 2767---
3515** `set-fontset-font', `fontset-info', `fontset-font' now operate on 2768** New command `strokes-global-set-stroke-string'.
3516the default fontset if the argument NAME is nil.. 2769This is like `strokes-global-set-stroke', but it allows you to bind
3517 2770the stroke directly to a string to insert. This is convenient for
3518+++ 2771using strokes as an input method.
3519** The escape sequence \s is now interpreted as a SPACE character,
3520unless it is followed by a `-' in a character constant (e.g. ?\s-A),
3521in which case it is still interpreted as the super modifier.
3522In strings, \s is always interpreted as a space.
3523 2772
3524+++ 2773---
3525** New function `set-process-filter-multibyte' sets the multibyteness 2774** LDAP support now defaults to ldapsearch from OpenLDAP version 2.
3526of a string given to a process's filter.
3527 2775
3528+++ 2776+++
3529** New function `process-filter-multibyte-p' returns t if 2777** You can now disable pc-selection-mode after enabling it.
3530a string given to a process's filter is multibyte. 2778M-x pc-selection-mode behaves like a proper minor mode, and with no
2779argument it toggles the mode.
3531 2780
3532+++ 2781Turning off PC-Selection mode restores the global key bindings
3533** A filter function of a process is called with a multibyte string if 2782that were replaced by turning on the mode.
3534the filter's multibyteness is t. That multibyteness is decided by the
3535value of `default-enable-multibyte-characters' when the process is
3536created and can be changed later by `set-process-filter-multibyte'.
3537 2783
3538+++ 2784---
3539** If a process's coding system is raw-text or no-conversion and its 2785** `uniquify-strip-common-suffix' tells uniquify to prefer
3540buffer is multibyte, the output of the process is at first converted 2786`file|dir1' and `file|dir2' to `file|dir1/subdir' and `file|dir2/subdir'.
3541to multibyte by `string-to-multibyte' then inserted in the buffer.
3542Previously, it was converted to multibyte by `string-as-multibyte',
3543which was not compatible with the behavior of file reading.
3544 2787
3545+++ 2788---
3546** New function `string-to-multibyte' converts a unibyte string to a 2789** Support for `magic cookie' standout modes has been removed.
3547multibyte string with the same individual character codes. 2790Emacs will still work on terminals that require magic cookies in order
2791to use standout mode, however they will not be able to display
2792mode-lines in inverse-video.
3548 2793
3549+++ 2794---
3550** New variables `gc-elapsed' and `gcs-done' provide extra information 2795** The game `mpuz' is enhanced.
3551on garbage collection.
3552 2796
3553+++ 2797`mpuz' now allows the 2nd factor not to have two identical digits. By
3554** New function `decode-coding-inserted-region' decodes a region as if 2798default, all trivial operations involving whole lines are performed
3555it is read from a file without decoding. 2799automatically. The game uses faces for better visual feedback.
3556 2800
3557+++ 2801---
3558** New function `locale-info' accesses locale information. 2802** display-battery has been replaced by display-battery-mode.
3559 2803
3560+++ 2804---
3561** `save-selected-window' now saves and restores the selected window 2805** calculator.el now has radix grouping mode, which is available when
3562of every frame. This way, it restores everything that can be changed 2806`calculator-output-radix' is non-nil. In this mode a separator
3563by calling `select-window'. 2807character is used every few digits, making it easier to see byte
2808boundries etc. For more info, see the documentation of the variable
2809`calculator-radix-grouping-mode'.
3564 2810
3565--- 2811---
3566** `easy-menu-define' now allows you to use nil for the symbol name 2812** fast-lock.el and lazy-lock.el are obsolete. Use jit-lock.el instead.
3567if you don't need to give the menu a name. If you install the menu
3568into other keymaps right away (MAPS is non-nil), it usually doesn't
3569need to have a name.
3570 2813
3571** Byte compiler changes: 2814---
2815** iso-acc.el is now obsolete. Use one of the latin input methods instead.
3572 2816
3573--- 2817---
3574*** `(featurep 'xemacs)' is treated by the compiler as nil. This 2818** cplus-md.el has been removed to avoid problems with Custom.
3575helps to avoid noisy compiler warnings in code meant to run under both 2819
3576Emacs and XEmacs and may sometimes make the result significantly more 2820* Changes for non-free operating systems
3577efficient. Since byte code from recent versions of XEmacs won't
3578generally run in Emacs and vice versa, this optimization doesn't lose
3579you anything.
3580 2821
3581+++ 2822+++
3582*** You can avoid warnings for possibly-undefined symbols with a 2823** Passing resources on the command line now works on MS Windows.
3583simple convention that the compiler understands. (This is mostly 2824You can use --xrm to pass resource settings to Emacs, overriding any
3584useful in code meant to be portable to different Emacs versions.) 2825existing values. For example:
3585Write forms like the following, or code that macroexpands into such
3586forms:
3587 2826
3588 (if (fboundp 'foo) <then> <else>) 2827 emacs --xrm "Emacs.Background:red" --xrm "Emacs.Geometry:100x20"
3589 (if (boundp 'foo) <then> <else)
3590 2828
3591In the first case, using `foo' as a function inside the <then> form 2829will start up Emacs on an initial frame of 100x20 with red background,
3592won't produce a warning if it's not defined as a function, and in the 2830irrespective of geometry or background setting on the Windows registry.
3593second case, using `foo' as a variable won't produce a warning if it's
3594unbound. The test must be in exactly one of the above forms (after
3595macro expansion), but such tests may be nested. Note that `when' and
3596`unless' expand to `if', but `cond' doesn't.
3597 2831
3598+++ 2832---
3599*** The new macro `with-no-warnings' suppresses all compiler warnings 2833** On MS Windows, the "system caret" now follows the cursor.
3600inside its body. In terms of execution, it is equivalent to `progn'. 2834This enables Emacs to work better with programs that need to track
2835the cursor, for example screen magnifiers and text to speech programs.
3601 2836
3602+++ 2837---
3603** The new translation table `translation-table-for-input' 2838** Tooltips now work on MS Windows.
3604is used for customizing self-insertion. The character to 2839See the Emacs 21.1 NEWS entry for tooltips for details.
3605be inserted is translated through it.
3606 2840
3607+++ 2841---
3608** `load-history' can now have elements of the form (t . FUNNAME), 2842** Images are now supported on MS Windows.
3609which means FUNNAME was previously defined as an autoload (before the 2843PBM and XBM images are supported out of the box. Other image formats
3610current file redefined it). 2844depend on external libraries. All of these libraries have been ported
2845to Windows, and can be found in both source and binary form at
2846http://gnuwin32.sourceforge.net/. Note that libpng also depends on
2847zlib, and tiff depends on the version of jpeg that it was compiled
2848against. For additional information, see nt/INSTALL.
3611 2849
3612+++ 2850---
3613** `load-history' now records (defun . FUNNAME) when a function is 2851** Sound is now supported on MS Windows.
3614defined. For a variable, it records just the variable name. 2852WAV format is supported on all versions of Windows, other formats such
2853as AU, AIFF and MP3 may be supported in the more recent versions of
2854Windows, or when other software provides hooks into the system level
2855sound support for those formats.
3615 2856
3616+++ 2857---
3617** New Lisp library testcover.el works with edebug to help you determine 2858** Different shaped mouse pointers are supported on MS Windows.
3618whether you've tested all your Lisp code. Function testcover-start 2859The mouse pointer changes shape depending on what is under the pointer.
3619instruments all functions in a given file. Then test your code. Function
3620testcover-mark-all adds overlay "splotches" to the Lisp file's buffer to
3621show where coverage is lacking. Command testcover-next-mark (bind it to
3622a key!) will move point forward to the next spot that has a splotch.
3623 2860
3624*** Normally, a red splotch indicates the form was never completely evaluated; 2861---
3625a brown splotch means it always evaluated to the same value. The red 2862** Pointing devices with more than 3 buttons are now supported on MS Windows.
3626splotches are skipped for forms that can't possibly complete their evaluation, 2863The new variable `w32-pass-extra-mouse-buttons-to-system' controls
3627such as `error'. The brown splotches are skipped for forms that are expected 2864whether Emacs should handle the extra buttons itself (the default), or
3628to always evaluate to the same value, such as (setq x 14). 2865pass them to Windows to be handled with system-wide functions.
3629 2866
3630*** For difficult cases, you can add do-nothing macros to your code to help 2867---
3631out the test coverage tool. The macro `noreturn' suppresses a red splotch. 2868** Emacs takes note of colors defined in Control Panel on MS-Windows.
3632It is an error if the argument to `noreturn' does return. The macro 1value 2869The Control Panel defines some default colors for applications in much
3633suppresses a brown splotch for its argument. This macro is a no-op except 2870the same way as wildcard X Resources do on X. Emacs now adds these
3634during test-coverage -- then it signals an error if the argument actually 2871colors to the colormap prefixed by System (eg SystemMenu for the
3635returns differing values. 2872default Menu background, SystemMenuText for the foreground), and uses
2873some of them to initialize some of the default faces.
2874`list-colors-display' shows the list of System color names, in case
2875you wish to use them in other faces.
3636 2876
3637+++ 2877---
3638** New function unsafep returns nil if the given Lisp form can't possibly 2878** On MS Windows NT/W2K/XP, Emacs uses Unicode for clipboard operations.
3639do anything dangerous; otherwise it returns a reason why the form might be 2879Those systems use Unicode internally, so this allows Emacs to share
3640unsafe (calls dangerous function, alters global variable, etc). 2880multilingual text with other applications. On other versions of
2881MS Windows, Emacs now uses the appropriate locale coding-system, so
2882the clipboard should work correctly for your local language without
2883any customizations.
3641 2884
3642+++ 2885---
3643** The new variable `print-continuous-numbering', when non-nil, says 2886** On Mac OS, the value of the variable `keyboard-coding-system' is
3644that successive calls to print functions should use the same 2887now dynamically changed according to the current keyboard script. The
3645numberings for circular structure references. This is only relevant 2888variable `mac-keyboard-text-encoding' and the constants
3646when `print-circle' is non-nil. 2889`kTextEncodingMacRoman', `kTextEncodingISOLatin1', and
2890`kTextEncodingISOLatin2' are obsolete.
2891
2892* Incompatible Lisp Changes in Emacs 22.1
3647 2893
3648When you bind `print-continuous-numbering' to t, you should 2894+++
3649also bind `print-number-table' to nil. 2895** The new interactive-specification `G' reads a file name
2896much like `F', but if the input is a directory name (even defaulted),
2897it returns just the directory name.
3650 2898
3651+++ 2899+++
3652** When using non-toolkit scroll bars with the default width, 2900** `suppress-keymap' now works by remapping `self-insert-command' to
3653the scroll-bar-width frame parameter value is nil. 2901the command `undefined'. (In earlier Emacs versions, it used
2902`substitute-key-definition' to rebind self inserting characters to
2903`undefined'.)
3654 2904
3655+++ 2905+++
3656** The new function copy-abbrev-table returns a new abbrev table that 2906** Mode line display ignores text properties as well as the
3657is a copy of a given abbrev table. 2907:propertize and :eval forms in the value of a variable whose
2908`risky-local-variable' property is nil.
2909
2910* Lisp Changes in Emacs 22.1
3658 2911
3659+++ 2912+++
3660** The option --script FILE runs Emacs in batch mode and loads FILE. 2913** The option --script FILE runs Emacs in batch mode and loads FILE.
@@ -3674,135 +2927,92 @@ Emacs looks for library `foo' in the parent directory, then in /tmp, then
3674in the other directories in `load-path'. (-L is short for --directory.) 2927in the other directories in `load-path'. (-L is short for --directory.)
3675 2928
3676+++ 2929+++
3677** A function's docstring can now hold the function's usage info on 2930** The default value of `sentence-end' is now defined using the new
3678its last line. It should match the regexp "\n\n(fn.*)\\'". 2931variable `sentence-end-without-space', which contains such characters
2932that end a sentence without following spaces.
3679 2933
3680--- 2934The function `sentence-end' should be used to obtain the value of the
3681** New CCL functions `lookup-character' and `lookup-integer' access 2935variable `sentence-end'. If the variable `sentence-end' is nil, then
3682hash tables defined by the Lisp function `define-translation-hash-table'. 2936this function returns the regexp constructed from the variables
2937`sentence-end-without-period', `sentence-end-double-space' and
2938`sentence-end-without-space'.
3683 2939
3684+++ 2940+++
3685** The new function `minibufferp' returns non-nil if its optional buffer 2941** The argument to forward-word, backward-word, forward-to-indentation
3686argument is a minibuffer. If the argument is omitted it defaults to 2942and backward-to-indentation is now optional, and defaults to 1.
3687the current buffer.
3688 2943
3689+++ 2944+++
3690** There is a new Warnings facility; see the functions `warn' 2945** If a command sets transient-mark-mode to `only', that
3691and `display-warning'. 2946enables Transient Mark mode for the following command only.
2947During that following command, the value of transient-mark-mode
2948is `identity'. If it is still `identity' at the end of the command,
2949it changes to nil.
3692 2950
3693+++ 2951+++
3694** The functions all-completions and try-completion now accept lists 2952** The new hook `before-save-hook' is invoked by `basic-save-buffer'
3695of strings as well as hash-tables additionally to alists, obarrays 2953before saving buffers. This allows packages to perform various final
3696and functions. Furthermore, the function `test-completion' is now 2954tasks, for example; it can be used by the copyright package to make
3697exported to Lisp. The keys in alists and hash tables may be either 2955sure saved files have the current year in any copyright headers.
3698strings or symbols, which are automatically converted with to strings.
3699
3700---
3701** When pure storage overflows while dumping, Emacs now prints how
3702much pure storage it will approximately need.
3703 2956
3704+++ 2957+++
3705** The new variable `auto-coding-functions' lets you specify functions 2958** If a buffer sets buffer-save-without-query to non-nil,
3706to examine a file being visited and deduce the proper coding system 2959save-some-buffers will always save that buffer without asking
3707for it. (If the coding system is detected incorrectly for a specific 2960(if it's modified).
3708file, you can put a `coding:' tags to override it.)
3709 2961
3710--- 2962---
3711** The new function `merge-coding-systems' fills in unspecified aspects 2963** list-buffers-noselect now takes an additional argument, BUFFER-LIST.
3712of one coding system from another coding system. 2964If it is non-nil, it specifies which buffers to list.
3713 2965
3714+++ 2966+++
3715** The variable `safe-local-eval-forms' specifies a list of forms that 2967** The kill-buffer-hook is now permanent-local.
3716are ok to evaluate when they appear in an `eval' local variables
3717specification. Normally Emacs asks for confirmation before evaluating
3718such a form, but if the form appears in this list, no confirmation is
3719needed.
3720
3721---
3722** If a function has a non-nil `safe-local-eval-function' property,
3723that means it is ok to evaluate some calls to that function when it
3724appears in an `eval' local variables specification. If the property
3725is t, then any form calling that function with constant arguments is
3726ok. If the property is a function or list of functions, they are called
3727with the form as argument, and if any returns t, the form is ok to call.
3728
3729If the form is not "ok to call", that means Emacs asks for
3730confirmation as before.
3731 2968
3732+++ 2969+++
3733** Controlling the default left and right fringe widths. 2970** `auto-save-file-format' has been renamed to
3734 2971`buffer-auto-save-file-format' and made into a permanent local.
3735The default left and right fringe widths for all windows of a frame
3736can now be controlled by setting the `left-fringe' and `right-fringe'
3737frame parameters to an integer value specifying the width in pixels.
3738Setting the width to 0 effectively removes the corresponding fringe.
3739
3740The actual default fringe widths for the frame may deviate from the
3741specified widths, since the combined fringe widths must match an
3742integral number of columns. The extra width is distributed evenly
3743between the left and right fringe. For force a specific fringe width,
3744specify the width as a negative integer (if both widths are negative,
3745only the left fringe gets the specified width).
3746
3747Setting the width to nil (the default), restores the default fringe
3748width which is the minimum number of pixels necessary to display any
3749of the currently defined fringe bitmaps. The width of the built-in
3750fringe bitmaps is 8 pixels.
3751 2972
3752+++ 2973+++
3753** Per-window fringes settings 2974** Functions `file-name-sans-extension' and `file-name-extension' now
3754 2975ignore the leading dots in file names, so that file names such as
3755Windows can now have their own individual fringe widths and position 2976`.emacs' are treated as extensionless.
3756settings.
3757
3758To control the fringe widths of a window, either set the buffer-local
3759variables `left-fringe-width', `right-fringe-width', or call
3760`set-window-fringes'.
3761 2977
3762To control the fringe position in a window, that is, whether fringes 2978+++
3763are positioned between the display margins and the window's text area, 2979** copy-file now takes an additional option arg MUSTBENEW.
3764or at the edges of the window, either set the buffer-local variable
3765`fringes-outside-margins' or call `set-window-fringes'.
3766 2980
3767The function `window-fringes' can be used to obtain the current 2981This argument works like the MUSTBENEW argument of write-file.
3768settings. To make `left-fringe-width', `right-fringe-width', and
3769`fringes-outside-margins' take effect, you must set them before
3770displaying the buffer in a window, or use `set-window-buffer' to force
3771an update of the display margins.
3772 2982
3773+++ 2983+++
3774** Per-window vertical scroll-bar settings 2984** If the second argument to `copy-file' is the name of a directory,
2985the file is copied to that directory instead of signaling an error.
3775 2986
3776Windows can now have their own individual scroll-bar settings 2987+++
3777controlling the width and position of scroll-bars. 2988** `visited-file-modtime' and `calendar-time-from-absolute' now return
2989a list of two integers, instead of a cons.
3778 2990
3779To control the scroll-bar of a window, either set the buffer-local 2991+++
3780variables `scroll-bar-mode' and `scroll-bar-width', or call 2992** `file-chase-links' now takes an optional second argument LIMIT which
3781`set-window-scroll-bars'. The function `window-scroll-bars' can be 2993specifies the maximum number of links to chase through. If after that
3782used to obtain the current settings. To make `scroll-bar-mode' and 2994many iterations the file name obtained is still a symbolic link,
3783`scroll-bar-width' take effect, you must set them before displaying 2995`file-chase-links' returns it anyway.
3784the buffer in a window, or use `set-window-buffer' to force an update
3785of the display margins.
3786 2996
3787+++ 2997+++
3788** The function `set-window-buffer' now has an optional third argument 2998** The function `commandp' takes an additional optional
3789KEEP-MARGINS which will preserve the window's current margin, fringe, 2999argument. If it is non-nil, then `commandp' checks
3790and scroll-bar settings if non-nil. 3000for a function that could be called with `call-interactively',
3001and does not return t for keyboard macros.
3791 3002
3792+++ 3003+++
3793** Renamed hooks to better follow the naming convention: 3004** An interactive specification may now use the code letter 'U' to get
3794find-file-hooks to find-file-hook, 3005the up-event that was discarded in case the last key sequence read for a
3795find-file-not-found-hooks to find-file-not-found-functions, 3006previous 'k' or 'K' argument was a down-event; otherwise nil is used.
3796write-file-hooks to write-file-functions, 3007
3797write-contents-hooks to write-contents-functions, 3008---
3798x-lost-selection-hooks to x-lost-selection-functions, 3009** Functions y-or-n-p, read-char, read-key-sequence and the like, that
3799x-sent-selection-hooks to x-sent-selection-functions. 3010display a prompt but don't use the minibuffer, now display the prompt
3800Marked local-write-file-hooks as obsolete (use the LOCAL arg of `add-hook'). 3011using the text properties (esp. the face) of the prompt string.
3801 3012
3802+++ 3013+++
3803** The new variable `delete-frame-functions' replaces `delete-frame-hook'. 3014** read-from-minibuffer now accepts an additional argument KEEP-ALL
3804It was renamed to follow the naming conventions for abnormal hooks. The old 3015saying to put all inputs in the history list, even empty ones.
3805name remains available as an alias, but has been marked obsolete.
3806 3016
3807+++ 3017+++
3808** The `read-file-name' function now takes an additional argument which 3018** The `read-file-name' function now takes an additional argument which
@@ -3826,35 +3036,73 @@ whether completion ignores case when reading a file name with the
3826will only show directories. 3036will only show directories.
3827 3037
3828+++ 3038+++
3829** The new function `file-remote-p' tests a file name and returns 3039** The new variable search-spaces-regexp controls how to search
3830non-nil if it specifies a remote file (one that Emacs accesses using 3040for spaces in a regular expression. If it is non-nil, it should be a
3831its own special methods and not directly through the file system). 3041regular expression, and any series of spaces stands for that regular
3832The value in that case is an identifier for the remote file system. 3042expression. If it is nil, spaces stand for themselves.
3043
3044Spaces inside of constructs such as [..] and *, +, ? are never
3045replaced with search-spaces-regexp.
3046
3047+++
3048** There are now two new regular expression operators, \_< and \_>,
3049for matching the beginning and end of a symbol. A symbol is a
3050non-empty sequence of either word or symbol constituent characters, as
3051specified by the syntax table.
3052
3053+++
3054** skip-chars-forward and skip-chars-backward now handle
3055character classes such as [:alpha:], along with individual characters
3056and ranges.
3833 3057
3834--- 3058---
3835** When a Lisp file uses CL functions at run-time, compiling the file 3059** In `replace-match', the replacement text no longer inherits
3836now issues warnings about these calls, unless the file performs 3060properties from surrounding text.
3837(require 'cl) when loaded.
3838 3061
3839+++ 3062+++
3840** The `defmacro' form may contain declarations specifying how to 3063** The list returned by `(match-data t)' now has the buffer as a final
3841indent the macro in Lisp mode and how to debug it with Edebug. The 3064element, if the last match was on a buffer. `set-match-data'
3842syntax of defmacro has been extended to 3065accepts such a list for restoring the match state.
3843 3066
3844 (defmacro NAME LAMBDA-LIST [DOC-STRING] [DECLARATION ...] ...) 3067+++
3068** Variable aliases have been implemented:
3845 3069
3846DECLARATION is a list `(declare DECLARATION-SPECIFIER ...)'. The 3070*** defvaralias ALIAS-VAR BASE-VAR [DOCSTRING]
3847declaration specifiers supported are:
3848 3071
3849(indent INDENT) 3072This function defines the symbol ALIAS-VAR as a variable alias for
3850 Set NAME's `lisp-indent-function' property to INDENT. 3073symbol BASE-VAR. This means that retrieving the value of ALIAS-VAR
3074returns the value of BASE-VAR, and changing the value of ALIAS-VAR
3075changes the value of BASE-VAR.
3851 3076
3852(edebug DEBUG) 3077DOCSTRING, if present, is the documentation for ALIAS-VAR; else it has
3853 Set NAME's `edebug-form-spec' property to DEBUG. (This is 3078the same documentation as BASE-VAR.
3854 equivalent to writing a `def-edebug-spec' for the macro. 3079
3080*** indirect-variable VARIABLE
3081
3082This function returns the variable at the end of the chain of aliases
3083of VARIABLE. If VARIABLE is not a symbol, or if VARIABLE is not
3084defined as an alias, the function returns VARIABLE.
3085
3086It might be noteworthy that variables aliases work for all kinds of
3087variables, including buffer-local and frame-local variables.
3855 3088
3856+++ 3089+++
3857** Interactive commands can be remapped through keymaps. 3090*** The macro define-obsolete-variable-alias combines defvaralias and
3091make-obsolete-variable. The macro define-obsolete-function-alias
3092combines defalias and make-obsolete.
3093
3094+++
3095** Enhancements to keymaps.
3096
3097*** Cleaner way to enter key sequences.
3098
3099You can enter a constant key sequence in a more natural format, the
3100same one used for saving keyboard macros, using the macro `kbd'. For
3101example,
3102
3103(kbd "C-x C-f") => "\^x\^f"
3104
3105*** Interactive commands can be remapped through keymaps.
3858 3106
3859This is an alternative to using defadvice or substitute-key-definition 3107This is an alternative to using defadvice or substitute-key-definition
3860to modify the behavior of a key binding using the normal keymap 3108to modify the behavior of a key binding using the normal keymap
@@ -3910,8 +3158,31 @@ The following changes have been made to provide command remapping:
3910 command before remapping. It is equal to `this-command' when the 3158 command before remapping. It is equal to `this-command' when the
3911 command was not remapped. 3159 command was not remapped.
3912 3160
3913+++ 3161*** If text has a `keymap' property, that keymap takes precedence
3914** New variable emulation-mode-map-alists. 3162over minor mode keymaps.
3163
3164*** The `keymap' property now also works at the ends of overlays and
3165text-properties, according to their stickiness. This also means that it
3166works with empty overlays. The same hold for the `local-map' property.
3167
3168*** Dense keymaps now handle inheritance correctly.
3169Previously a dense keymap would hide all of the simple-char key
3170bindings of the parent keymap.
3171
3172*** `define-key-after' now accepts keys longer than 1.
3173
3174*** New function `current-active-maps' returns a list of currently
3175active keymaps.
3176
3177*** New function `describe-buffer-bindings' inserts the list of all
3178defined keys and their definitions.
3179
3180*** New function `keymap-prompt' returns the prompt-string of a keymap
3181
3182*** (map-keymap FUNCTION KEYMAP) applies the function to each binding
3183in the keymap.
3184
3185*** New variable emulation-mode-map-alists.
3915 3186
3916Lisp packages using many minor mode keymaps can now maintain their own 3187Lisp packages using many minor mode keymaps can now maintain their own
3917keymap alist separate from minor-mode-map-alist by adding their keymap 3188keymap alist separate from minor-mode-map-alist by adding their keymap
@@ -3976,48 +3247,11 @@ change group you start for any given buffer should be the last one
3976finished. 3247finished.
3977 3248
3978+++ 3249+++
3979** New variable char-property-alias-alist. 3250** Progress reporters.
3980 3251The new functions `make-progress-reporter', `progress-reporter-update',
3981This variable allows you to create alternative names for text 3252`progress-reporter-force-update', `progress-reporter-done', and
3982properties. It works at the same level as `default-text-properties', 3253`dotimes-with-progress-reporter' provide a simple and efficient way for
3983although it applies to overlays as well. This variable was introduced 3254a command to present progress messages for the user.
3984to implement the `font-lock-face' property.
3985
3986+++
3987** New special text property `font-lock-face'.
3988
3989This property acts like the `face' property, but it is controlled by
3990M-x font-lock-mode. It is not, strictly speaking, a builtin text
3991property. Instead, it is implemented inside font-core.el, using the
3992new variable `char-property-alias-alist'.
3993
3994+++
3995** New function remove-list-of-text-properties.
3996
3997The new function `remove-list-of-text-properties' is almost the same
3998as `remove-text-properties'. The only difference is that it takes
3999a list of property names as argument rather than a property list.
4000
4001+++
4002** New function insert-for-yank.
4003
4004This function normally works like `insert' but removes the text
4005properties in the `yank-excluded-properties' list. However, if the
4006inserted text has a `yank-handler' text property on the first
4007character of the string, the insertion of the text may be modified in
4008a number of ways. See the description of `yank-handler' below.
4009
4010+++
4011** New function insert-buffer-substring-as-yank.
4012
4013This function works like `insert-buffer-substring', but removes the
4014text properties in the `yank-excluded-properties' list.
4015
4016+++
4017** New function insert-buffer-substring-no-properties.
4018
4019This function is like insert-buffer-substring, but removes all
4020text properties from the inserted substring.
4021 3255
4022+++ 3256+++
4023** New `yank-handler' text property may be used to control how 3257** New `yank-handler' text property may be used to control how
@@ -4047,47 +3281,40 @@ by `yank-pop' to undo the insertion of the current object. It is
4047called with two arguments, the start and end of the current region. 3281called with two arguments, the start and end of the current region.
4048FUNCTION may set `yank-undo-function' to override the UNDO value. 3282FUNCTION may set `yank-undo-function' to override the UNDO value.
4049 3283
4050+++
4051*** The functions kill-new, kill-append, and kill-region now have an 3284*** The functions kill-new, kill-append, and kill-region now have an
4052optional argument to specify the yank-handler text property to put on 3285optional argument to specify the yank-handler text property to put on
4053the killed text. 3286the killed text.
4054 3287
4055+++
4056*** The function yank-pop will now use a non-nil value of the variable 3288*** The function yank-pop will now use a non-nil value of the variable
4057`yank-undo-function' (instead of delete-region) to undo the previous 3289`yank-undo-function' (instead of delete-region) to undo the previous
4058yank or yank-pop command (or a call to insert-for-yank). The function 3290yank or yank-pop command (or a call to insert-for-yank). The function
4059insert-for-yank automatically sets that variable according to the UNDO 3291insert-for-yank automatically sets that variable according to the UNDO
4060element of the string argument's yank-handler text property if present. 3292element of the string argument's yank-handler text property if present.
4061 3293
4062+++ 3294*** The function `insert-for-yank' now supports strings where the
4063** New function display-supports-face-attributes-p may be used to test 3295`yank-handler' property does not span the first character of the
4064whether a given set of face attributes is actually displayable. 3296string. The old behavior is available if you call
4065 3297`insert-for-yank-1' instead.
4066A new predicate `supports' has also been added to the `defface' face
4067specification language, which can be used to do this test for faces
4068defined with defface.
4069 3298
4070--- 3299*** The new function insert-for-yank normally works like `insert', but
4071** The function face-differs-from-default-p now truly checks whether the 3300removes the text properties in the `yank-excluded-properties' list.
4072given face displays differently from the default face or not (previously 3301However, the insertion of the text may be modified by a `yank-handler'
4073it did only a very cursory check). 3302text property.
4074 3303
4075+++ 3304+++
4076** face-attribute, face-foreground, face-background, and face-stipple now 3305** An element of buffer-undo-list can now have the form (apply FUNNAME
4077accept a new optional argument, INHERIT, which controls how face 3306. ARGS), where FUNNAME is a symbol other than t or nil. That stands
4078inheritance is used when determining the value of a face attribute. 3307for a high-level change that should be undone by evaluating (apply
3308FUNNAME ARGS).
4079 3309
4080+++ 3310These entries can also have the form (apply DELTA BEG END FUNNAME . ARGS)
4081** New functions face-attribute-relative-p and merge-face-attribute 3311which indicates that the change which took place was limited to the
4082help with handling relative face attributes. 3312range BEG...END and increased the buffer size by DELTA.
4083 3313
4084+++ 3314+++
4085** The priority of faces in an :inherit attribute face-list is reversed. 3315** If the buffer's undo list for the current command gets longer than
4086If a face contains an :inherit attribute with a list of faces, earlier 3316undo-outer-limit, garbage collection empties it. This is to prevent
4087faces in the list override later faces in the list; in previous releases 3317it from using up the available memory and choking Emacs.
4088of Emacs, the order was the opposite. This change was made so that
4089:inherit face-lists operate identically to face-lists in text `face'
4090properties.
4091 3318
4092+++ 3319+++
4093** Enhancements to process support 3320** Enhancements to process support
@@ -4118,7 +3345,6 @@ integer, also inhibit running timers. This feature is generally not
4118recommended, but may be necessary for specific applications, such as 3345recommended, but may be necessary for specific applications, such as
4119speech synthesis. 3346speech synthesis.
4120 3347
4121---
4122*** Adaptive read buffering of subprocess output. 3348*** Adaptive read buffering of subprocess output.
4123 3349
4124On some systems, when emacs reads the output from a subprocess, the 3350On some systems, when emacs reads the output from a subprocess, the
@@ -4129,6 +3355,30 @@ non-nil value (the default), as it will automatically delay reading
4129from such processes, to allowing them to produce more output before 3355from such processes, to allowing them to produce more output before
4130emacs tries to read it. 3356emacs tries to read it.
4131 3357
3358*** The new function `call-process-shell-command' executes a shell
3359command command synchronously in a separate process.
3360
3361*** The new function `process-file' is similar to `call-process', but
3362obeys file handlers. The file handler is chosen based on
3363default-directory.
3364
3365*** The new function `set-process-filter-multibyte' sets the
3366multibyteness of a string given to a process's filter.
3367
3368*** The new function `process-filter-multibyte-p' returns t if a
3369string given to a process's filter is multibyte.
3370
3371*** A filter function of a process is called with a multibyte string
3372if the filter's multibyteness is t. That multibyteness is decided by
3373the value of `default-enable-multibyte-characters' when the process is
3374created and can be changed later by `set-process-filter-multibyte'.
3375
3376*** If a process's coding system is raw-text or no-conversion and its
3377buffer is multibyte, the output of the process is at first converted
3378to multibyte by `string-to-multibyte' then inserted in the buffer.
3379Previously, it was converted to multibyte by `string-as-multibyte',
3380which was not compatible with the behavior of file reading.
3381
4132+++ 3382+++
4133** Enhanced networking support. 3383** Enhanced networking support.
4134 3384
@@ -4202,169 +3452,378 @@ current network addresses.
4202This function returns the network address, hardware address, current 3452This function returns the network address, hardware address, current
4203status, and other information about a specific network interface. 3453status, and other information about a specific network interface.
4204 3454
3455*** The sentinel is now called when a network process is deleted with
3456delete-process. The status message passed to the sentinel for a
3457deleted network process is "deleted". The message passed to the
3458sentinel when the connection is closed by the remote peer has been
3459changed to "connection broken by remote peer".
3460
4205+++ 3461+++
4206** New function copy-tree. 3462** New function `force-window-update' can initiate a full redisplay of
3463one or all windows. Normally, this is not needed as changes in window
3464contents are detected automatically. However, certain implicit
3465changes to mode lines, header lines, or display properties may require
3466forcing an explicit window update.
4207 3467
4208+++ 3468+++
4209** New function substring-no-properties. 3469** The line-move, scroll-up, and scroll-down functions will now
3470modify the window vscroll to scroll through display rows that are
3471taller that the height of the window, for example in the presense of
3472large images. To disable this feature, Lisp code may bind the new
3473variable `auto-window-vscroll' to nil.
4210 3474
4211+++ 3475+++
4212** New function minibuffer-selected-window. 3476** Function `compute-motion' now calculates the usable window
3477width if the WIDTH argument is nil. If the TOPOS argument is nil,
3478the usable window height and width is used.
4213 3479
4214+++ 3480+++
4215** New function `call-process-shell-command'. 3481** Function pos-visible-in-window-p now returns the pixel coordinates
3482and partial visiblity state of the corresponding row, if the PARTIALLY
3483arg is non-nil.
3484
3485** Changes in using window objects:
4216 3486
4217+++ 3487+++
4218** New function `process-file'. 3488*** You can now make a window as short as one line.
4219 3489
4220This is similar to `call-process', but obeys file handlers. The file 3490A window that is just one line tall does not display either a mode
4221handler is chosen based on default-directory. 3491line or a header line, even if the variables `mode-line-format' and
3492`header-line-format' call for them. A window that is two lines tall
3493cannot display both a mode line and a header line at once; if the
3494variables call for both, only the mode line actually appears.
4222 3495
4223--- 3496+++
4224** The dummy function keys made by easymenu 3497*** The new function `window-inside-edges' returns the edges of the
4225are now always lower case. If you specify the 3498actual text portion of the window, not including the scroll bar or
4226menu item name "Ada", for instance, it uses `ada' 3499divider line, the fringes, the display margins, the header line and
4227as the "key" bound by that key binding. 3500the mode line.
4228 3501
4229This is relevant only if Lisp code looks for 3502+++
4230the bindings that were made with easymenu. 3503*** The new functions `window-pixel-edges' and `window-inside-pixel-edges'
3504return window edges in units of pixels, rather than columns and lines.
4231 3505
4232+++ 3506+++
4233** The function `commandp' takes an additional optional 3507*** The new macro `with-selected-window' temporarily switches the
4234argument. If it is non-nil, then `commandp' checks 3508selected window without impacting the order of buffer-list.
4235for a function that could be called with `call-interactively',
4236and does not return t for keyboard macros.
4237 3509
4238--- 3510+++
4239** master-mode.el implements a minor mode for scrolling a slave 3511*** `select-window' takes an optional second argument `norecord', like
4240buffer without leaving your current buffer, the master buffer. 3512`switch-to-buffer'.
4241 3513
4242It can be used by sql.el, for example: the SQL buffer is the master 3514+++
4243and its SQLi buffer is the slave. This allows you to scroll the SQLi 3515*** `save-selected-window' now saves and restores the selected window
4244buffer containing the output from the SQL buffer containing the 3516of every frame. This way, it restores everything that can be changed
4245commands. 3517by calling `select-window'.
4246 3518
4247This is how to use sql.el and master.el together: the variable 3519+++
4248sql-buffer contains the slave buffer. It is a local variable in the 3520*** The function `set-window-buffer' now has an optional third argument
4249SQL buffer. 3521KEEP-MARGINS which will preserve the window's current margin, fringe,
3522and scroll-bar settings if non-nil.
4250 3523
4251(add-hook 'sql-mode-hook 3524+++
4252 (function (lambda () 3525** Customizable fringe bitmaps
4253 (master-mode t) 3526
4254 (master-set-slave sql-buffer)))) 3527*** New function 'define-fringe-bitmap' can now be used to create new
4255(add-hook 'sql-set-sqli-hook 3528fringe bitmaps, as well as change the built-in fringe bitmaps.
4256 (function (lambda () 3529
4257 (master-set-slave sql-buffer)))) 3530To change a built-in bitmap, do (require 'fringe) and use the symbol
3531identifing the bitmap such as `left-truncation or `continued-line'.
3532
3533*** New function 'destroy-fringe-bitmap' may be used to destroy a
3534previously created bitmap, or restore a built-in bitmap.
3535
3536*** New function 'set-fringe-bitmap-face' can now be used to set a
3537specific face to be used for a specific fringe bitmap. The face is
3538automatically merged with the `fringe' face, so normally, the face
3539should only specify the foreground color of the bitmap.
3540
3541*** There are new display properties, left-fringe and right-fringe,
3542that can be used to show a specific bitmap in the left or right fringe
3543bitmap of the display line.
3544
3545Format is 'display '(left-fringe BITMAP [FACE]), where BITMAP is a
3546symbol identifying a fringe bitmap, either built-in or defined with
3547`define-fringe-bitmap', and FACE is an optional face name to be used
3548for displaying the bitmap instead of the default `fringe' face.
3549When specified, FACE is automatically merged with the `fringe' face.
3550
3551*** New function `fringe-bitmaps-at-pos' returns the current fringe
3552bitmaps in the display line at a given buffer position.
4258 3553
4259+++ 3554+++
4260** File local variables. 3555** Controlling the default left and right fringe widths.
4261 3556
4262A file local variables list cannot specify a string with text 3557The default left and right fringe widths for all windows of a frame
4263properties--any specified text properties are discarded. 3558can now be controlled by setting the `left-fringe' and `right-fringe'
3559frame parameters to an integer value specifying the width in pixels.
3560Setting the width to 0 effectively removes the corresponding fringe.
3561
3562The actual default fringe widths for the frame may deviate from the
3563specified widths, since the combined fringe widths must match an
3564integral number of columns. The extra width is distributed evenly
3565between the left and right fringe. For force a specific fringe width,
3566specify the width as a negative integer (if both widths are negative,
3567only the left fringe gets the specified width).
3568
3569Setting the width to nil (the default), restores the default fringe
3570width which is the minimum number of pixels necessary to display any
3571of the currently defined fringe bitmaps. The width of the built-in
3572fringe bitmaps is 8 pixels.
4264 3573
4265+++ 3574+++
4266** New function window-body-height. 3575** Per-window fringe and scrollbar settings
4267 3576
4268This is like window-height but does not count the mode line 3577*** Windows can now have their own individual fringe widths and
4269or the header line. 3578position settings.
3579
3580To control the fringe widths of a window, either set the buffer-local
3581variables `left-fringe-width', `right-fringe-width', or call
3582`set-window-fringes'.
3583
3584To control the fringe position in a window, that is, whether fringes
3585are positioned between the display margins and the window's text area,
3586or at the edges of the window, either set the buffer-local variable
3587`fringes-outside-margins' or call `set-window-fringes'.
3588
3589The function `window-fringes' can be used to obtain the current
3590settings. To make `left-fringe-width', `right-fringe-width', and
3591`fringes-outside-margins' take effect, you must set them before
3592displaying the buffer in a window, or use `set-window-buffer' to force
3593an update of the display margins.
3594
3595*** Windows can now have their own individual scroll-bar settings
3596controlling the width and position of scroll-bars.
3597
3598To control the scroll-bar of a window, either set the buffer-local
3599variables `scroll-bar-mode' and `scroll-bar-width', or call
3600`set-window-scroll-bars'. The function `window-scroll-bars' can be
3601used to obtain the current settings. To make `scroll-bar-mode' and
3602`scroll-bar-width' take effect, you must set them before displaying
3603the buffer in a window, or use `set-window-buffer' to force an update
3604of the display margins.
4270 3605
4271+++ 3606+++
4272** New function format-mode-line. 3607** When using non-toolkit scroll bars with the default width,
3608the scroll-bar-width frame parameter value is nil.
4273 3609
4274This returns the mode-line or header-line of the selected (or a 3610+++
4275specified) window as a string with or without text properties. 3611** Multiple overlay arrows can now be defined and managed via the new
3612variable `overlay-arrow-variable-list'. It contains a list of
3613varibles which contain overlay arrow position markers, including
3614the original `overlay-arrow-position' variable.
3615
3616Each variable on this list may have individual `overlay-arrow-string'
3617and `overlay-arrow-bitmap' properties that specify an overlay arrow
3618string (for non-window terminals) or fringe bitmap (for window
3619systems) to display at the corresponding overlay arrow position.
3620If either property is not set, the default `overlay-arrow-string' or
3621'overlay-arrow-fringe-bitmap' will be used.
4276 3622
4277+++ 3623+++
4278** New function `safe-get'. 3624** New line-height and line-spacing properties for newline characters
4279 3625
4280This function is like `get', but never signals an error for 3626A newline may now have line-height and line-spacing text or overlay
4281a malformed symbol property list. 3627properties that control the height of the corresponding display row.
3628
3629If the line-height property value is t, the newline does not
3630contribute to the height of the display row; instead the height of the
3631newline glyph is reduced. Also, a line-spacing property on this
3632newline is ignored. This can be used to tile small images or image
3633slices without adding blank areas between the images.
3634
3635If the line-height property value is a positive integer, the value
3636specifies the minimum line height in pixels. If necessary, the line
3637height it increased by increasing the line's ascent.
3638
3639If the line-height property value is a float, the minimum line height
3640is calculated by multiplying the default frame line height by the
3641given value.
3642
3643If the line-height property value is a cons (FACE . RATIO), the
3644minimum line height is calculated as RATIO * height of named FACE.
3645RATIO is int or float. If FACE is t, it specifies the current face.
3646
3647If the line-height property value is a cons (nil . RATIO), the line
3648height is calculated as RATIO * actual height of the line's contents.
3649
3650If the line-height value is a cons (HEIGHT . TOTAL), HEIGHT specifies
3651the line height as described above, while TOTAL is any of the forms
3652described above and specifies the total height of the line, causing a
3653varying number of pixels to be inserted after the line to make it line
3654exactly that many pixels high.
3655
3656If the line-spacing property value is an positive integer, the value
3657is used as additional pixels to insert after the display line; this
3658overrides the default frame line-spacing and any buffer local value of
3659the line-spacing variable.
3660
3661If the line-spacing property may be a float or cons, the line spacing
3662is calculated as specified above for the line-height property.
3663
3664+++
3665** The buffer local line-spacing variable may now have a float value,
3666which is used as a height relative to the default frame line height.
4282 3667
4283+++ 3668+++
4284** New function `safe-plist-get'. 3669** Enhancements to stretch display properties
3670
3671The display property stretch specification form `(space PROPS)', where
3672PROPS is a property list now allows pixel based width and height
3673specifications, as well as enhanced horizontal text alignment.
4285 3674
4286This function is like `plist-get', but never signals an error for 3675The value of these properties can now be a (primitive) expression
4287a malformed property list. 3676which is evaluated during redisplay. The following expressions
3677are supported:
3678
3679EXPR ::= NUM | (NUM) | UNIT | ELEM | POS | IMAGE | FORM
3680NUM ::= INTEGER | FLOAT | SYMBOL
3681UNIT ::= in | mm | cm | width | height
3682ELEM ::= left-fringe | right-fringe | left-margin | right-margin
3683 | scroll-bar | text
3684POS ::= left | center | right
3685FORM ::= (NUM . EXPR) | (OP EXPR ...)
3686OP ::= + | -
3687
3688The form `NUM' specifies a fractional width or height of the default
3689frame font size. The form `(NUM)' specifies an absolute number of
3690pixels. If a symbol is specified, its buffer-local variable binding
3691is used. The `in', `mm', and `cm' units specifies the number of
3692pixels per inch, milli-meter, and centi-meter, resp. The `width' and
3693`height' units correspond to the width and height of the current face
3694font. An image specification corresponds to the width or height of
3695the image.
3696
3697The `left-fringe', `right-fringe', `left-margin', `right-margin',
3698`scroll-bar', and `text' elements specify to the width of the
3699corresponding area of the window.
3700
3701The `left', `center', and `right' positions can be used with :align-to
3702to specify a position relative to the left edge, center, or right edge
3703of the text area. One of the above window elements (except `text')
3704can also be used with :align-to to specify that the position is
3705relative to the left edge of the given area. Once the base offset for
3706a relative position has been set (by the first occurrence of one of
3707these symbols), further occurences of these symbols are interpreted as
3708the width of the area.
3709
3710For example, to align to the center of the left-margin, use
3711 :align-to (+ left-margin (0.5 . left-margin))
3712
3713If no specific base offset is set for alignment, it is always relative
3714to the left edge of the text area. For example, :align-to 0 in a
3715header-line aligns with the first text column in the text area.
3716
3717The value of the form `(NUM . EXPR)' is the value of NUM multiplied by
3718the value of the expression EXPR. For example, (2 . in) specifies a
3719width of 2 inches, while (0.5 . IMAGE) specifies half the width (or
3720height) of the specified image.
3721
3722The form `(+ EXPR ...)' adds up the value of the expressions.
3723The form `(- EXPR ...)' negates or subtracts the value of the expressions.
4288 3724
4289+++ 3725+++
4290** New functions `lax-plist-get' and `lax-plist-put'. 3726** Support for displaying image slices
4291 3727
4292These functions are like `plist-get' and `plist-put' except that they 3728*** New display property (slice X Y WIDTH HEIGHT) may be used with
4293compare the property name using `equal' rather than `eq'. 3729an image property to display only a specific slice of the image.
3730
3731*** Function insert-image has new optional fourth arg to
3732specify image slice (X Y WIDTH HEIGHT).
3733
3734*** New function insert-sliced-image inserts a given image as a
3735specified number of evenly sized slices (rows x columns).
4294 3736
4295+++ 3737+++
4296** New function `tool-bar-local-item-from-menu' 3738** Images may now have an associated image map via the :map property.
4297 3739
4298The `tool-bar-add-item-from-menu' must not be used (as previously 3740An image map is an alist where each element has the format (AREA ID PLIST).
4299recommended) for making entries in the tool bar for local keymaps. 3741An AREA is specified as either a rectangle, a circle, or a polygon:
4300Instead, use the function `tool-bar-local-item-from-menu', which lets 3742A rectangle is a cons (rect . ((x0 . y0) . (x1 . y1))) specifying the
4301you specify the map to use as an argument. 3743pixel coordinates of the upper left and bottom right corners.
3744A circle is a cons (circle . ((x0 . y0) . r)) specifying the center
3745and the radius of the circle; r may be a float or integer.
3746A polygon is a cons (poly . [x0 y0 x1 y1 ...]) where each pair in the
3747vector describes one corner in the polygon.
3748
3749When the mouse pointer is above a hot-spot area of an image, the
3750PLIST of that hot-spot is consulted; if it contains a `help-echo'
3751property it defines a tool-tip for the hot-spot, and if it contains
3752a `pointer' property, it defines the shape of the mouse cursor when
3753it is over the hot-spot. See the variable 'void-area-text-pointer'
3754for possible pointer shapes.
3755
3756When you click the mouse when the mouse pointer is over a hot-spot,
3757an event is composed by combining the ID of the hot-spot with the
3758mouse event, e.g. [area4 mouse-1] if the hot-spot's ID is `area4'.
3759
3760+++ (lispref)
3761??? (man)
3762** The mouse pointer shape in void text areas (i.e. after the end of a
3763line or below the last line in the buffer) of the text window is now
3764controlled by the new variable `void-text-area-pointer'. The default
3765is to use the `arrow' (non-text) pointer. Other choices are `text'
3766(or nil), `hand', `vdrag', `hdrag', `modeline', and `hourglass'.
4302 3767
4303+++ 3768+++
4304** The function `atan' now accepts an optional second argument. 3769** The mouse pointer shape over an image can now be controlled by the
3770:pointer image property.
4305 3771
4306When called with 2 arguments, as in `(atan Y X)', `atan' returns the 3772+++
4307angle in radians between the vector [X, Y] and the X axis. (This is 3773** Lisp code can now test if a given buffer position is inside a
4308equivalent to the standard C library function `atan2'.) 3774clickable link with the new function `mouse-on-link-p'. This is the
3775function used by the new `mouse-1-click-follows-link' functionality.
4309 3776
4310+++ 3777+++
4311** You can now make a window as short as one line. 3778** The mouse pointer shape over ordinary text or images may now be
3779controlled/overriden via the `pointer' text property.
4312 3780
4313A window that is just one line tall does not display either a mode 3781** Mouse event enhancements:
4314line or a header line, even if the variables `mode-line-format' and
4315`header-line-format' call for them. A window that is two lines tall
4316cannot display both a mode line and a header line at once; if the
4317variables call for both, only the mode line actually appears.
4318 3782
4319+++ 3783+++
4320** The new frame parameter `tty-color-mode' specifies the mode to use 3784*** Mouse clicks on fringes now generates left-fringe or right-fringes
4321for color support on character terminal frames. Its value can be a 3785events, rather than a text area click event.
4322number of colors to support, or a symbol. See the Emacs Lisp
4323Reference manual for more detailed documentation.
4324 3786
4325+++ 3787+++
4326** The new mode-line construct `(:propertize ELT PROPS...)' can be 3788*** Mouse clicks in the left and right marginal areas now includes a
4327used to add text properties to mode-line elements. 3789sensible buffer position corresponding to the first character in the
3790corresponding text row.
4328 3791
4329+++ 3792+++
4330** The new `%i' and `%I' constructs for `mode-line-format' can be used 3793*** Function `mouse-set-point' now works for events outside text area.
4331to display the size of the accessible part of the buffer on the mode
4332line.
4333 3794
4334--- 3795+++
4335** Indentation of simple and extended loop forms has been added to the 3796*** Mouse events now includes buffer position for all event types.
4336cl-indent package. The new user options
4337`lisp-loop-keyword-indentation', `lisp-loop-forms-indentation', and
4338`lisp-simple-loop-indentation' can be used to customize the
4339indentation of keywords and forms in loop forms.
4340 3797
4341--- 3798+++
4342** Indentation of backquoted forms has been made customizable in the 3799*** `posn-point' now returns buffer position for non-text area events.
4343cl-indent package. See the new user option `lisp-backquote-indentation'.
4344 3800
4345+++ 3801+++
4346** Already true in Emacs 21.1, but not emphasized clearly enough: 3802*** New function `posn-area' returns window area clicked on (nil means
3803text area).
4347 3804
4348Multibyte buffers can now faithfully record all 256 character codes 3805+++
4349from 0 to 255. As a result, most of the past reasons to use unibyte 3806*** Mouse events include actual glyph column and row for all event types.
4350buffers no longer exist. We only know of three reasons to use them
4351now:
4352 3807
43531. If you prefer to use unibyte text all of the time. 3808+++
3809*** New function `posn-actual-col-row' returns actual glyph coordinates.
4354 3810
43552. For reading files into temporary buffers, when you want to avoid 3811+++
4356the time it takes to convert the format. 3812*** Mouse events may now include image object in addition to string object.
4357 3813
43583. For binary files where format conversion would be pointless and 3814+++
4359wasteful. 3815*** Mouse events include relative x and y pixel coordinates relative to
3816the top left corner of the object (image or character) clicked on.
4360 3817
4361+++ 3818+++
4362** If text has a `keymap' property, that keymap takes precedence 3819*** Mouse events include the pixel width and height of the object
4363over minor mode keymaps. 3820(image or character) clicked on.
4364 3821
4365+++ 3822+++
4366** A hex escape in a string forces the string to be multibyte. 3823*** New functions 'posn-object', 'posn-object-x-y', and
4367An octal escape makes it unibyte. 3824'posn-object-width-height' return the image or string object of a mouse
3825click, the x and y pixel coordinates relative to the top left corner
3826of that object, and the total width and height of that object.
4368 3827
4369+++ 3828+++
4370** At the end of a command, point moves out from within invisible 3829** At the end of a command, point moves out from within invisible
@@ -4378,34 +3837,120 @@ unexpected side-effects since the property applies to everything
4378post-command-hook and thus does not care about intermediate states. 3837post-command-hook and thus does not care about intermediate states.
4379 3838
4380+++ 3839+++
4381** field-beginning and field-end now accept an additional optional 3840** Normally, the cursor is displayed at the end of any overlay and
4382argument, LIMIT. 3841text property string that may be present at the current window
3842position. The cursor may now be placed on any character of such
3843strings by giving that character a non-nil `cursor' text property.
4383 3844
4384+++ 3845+++
4385** define-abbrev now accepts an optional argument SYSTEM-FLAG. If 3846** The display space :width and :align-to text properties are now
4386non-nil, this marks the abbrev as a "system" abbrev, which means that 3847supported on text terminals.
4387it won't be stored in the user's abbrevs file if he saves the abbrevs.
4388Major modes that predefine some abbrevs should always specify this
4389flag.
4390 3848
4391--- 3849+++
4392** Support for Mocklisp has been removed. 3850** Arguments for remove-overlays are now optional, so that you can
3851remove all overlays in the buffer by just calling (remove-overlay).
3852
3853+++
3854** New variable char-property-alias-alist.
3855
3856This variable allows you to create alternative names for text
3857properties. It works at the same level as `default-text-properties',
3858although it applies to overlays as well. This variable was introduced
3859to implement the `font-lock-face' property.
3860
3861+++
3862** New function `get-char-property-and-overlay' accepts the same
3863arguments as `get-char-property' and returns a cons whose car is the
3864return value of `get-char-property' called with those arguments and
3865whose cdr is the overlay in which the property was found, or nil if
3866it was found as a text property or not found at all.
3867
3868+++
3869** The new frame parameter `tty-color-mode' specifies the mode to use
3870for color support on character terminal frames. Its value can be a
3871number of colors to support, or a symbol. See the Emacs Lisp
3872Reference manual for more detailed documentation.
3873
3874+++
3875** The new face attribute `min-colors' can be used to tailor the face
3876color to the number of colors supported by a display, and define the
3877foreground and background colors accordingly so that they look best on
3878a terminal that supports at least this many colors. This is now the
3879preferred method for defining default faces in a way that makes a good
3880use of the capabilities of the display.
3881
3882+++
3883** (char-displayable-p CHAR) returns non-nil if Emacs ought to be able
3884to display CHAR. More precisely, if the selected frame's fontset has
3885a font to display the character set that CHAR belongs to.
3886
3887Fontsets can specify a font on a per-character basis; when the fontset
3888does that, this value may not be accurate.
3889
3890+++
3891** New function display-supports-face-attributes-p may be used to test
3892whether a given set of face attributes is actually displayable.
3893
3894A new predicate `supports' has also been added to the `defface' face
3895specification language, which can be used to do this test for faces
3896defined with defface.
4393 3897
4394--- 3898---
4395** The function insert-string is now obsolete. 3899** The special treatment of faces whose names are of the form `fg:COLOR'
3900or `bg:COLOR' has been removed. Lisp programs should use the
3901`defface' facility for defining faces with specific colors, or use
3902the feature of specifying the face attributes :foreground and :background
3903directly in the `face' property instead of using a named face.
3904
3905+++
3906** The first face specification element in a defface can specify
3907`default' instead of frame classification. Then its attributes act as
3908defaults that apply to all the subsequent cases (and may be overridden
3909by them).
3910
3911+++
3912** The variable `face-font-rescale-alist' specifies how much larger
3913(or smaller) font we should use. For instance, if the value is
3914'((SOME-FONTNAME-PATTERN . 1.3)) and a face requests a font of 10
3915point, we actually use a font of 13 point if the font matches
3916SOME-FONTNAME-PATTERN.
4396 3917
4397--- 3918---
4398** The precedence of file-name-handlers has been changed. 3919** `set-fontset-font', `fontset-info', `fontset-font' now operate on
4399Instead of blindly choosing the first handler that matches, 3920the default fontset if the argument NAME is nil..
4400find-file-name-handler now gives precedence to a file-name handler
4401that matches near the end of the file name. More specifically, the
4402handler whose (match-beginning 0) is the largest is chosen.
4403In case of ties, the old "first matched" rule applies.
4404 3921
4405--- 3922---
4406** Dense keymaps now handle inheritance correctly. 3923** The function face-differs-from-default-p now truly checks whether the
4407Previously a dense keymap would hide all of the simple-char key 3924given face displays differently from the default face or not (previously
4408bindings of the parent keymap. 3925it did only a very cursory check).
3926
3927+++
3928** face-attribute, face-foreground, face-background, and face-stipple now
3929accept a new optional argument, INHERIT, which controls how face
3930inheritance is used when determining the value of a face attribute.
3931
3932+++
3933** New functions face-attribute-relative-p and merge-face-attribute
3934help with handling relative face attributes.
3935
3936+++
3937** The priority of faces in an :inherit attribute face-list is reversed.
3938If a face contains an :inherit attribute with a list of faces, earlier
3939faces in the list override later faces in the list; in previous releases
3940of Emacs, the order was the opposite. This change was made so that
3941:inherit face-lists operate identically to face-lists in text `face'
3942properties.
3943
3944+++
3945** New standard font-lock face `font-lock-preprocessor-face'.
3946
3947+++
3948** New special text property `font-lock-face'.
3949
3950This property acts like the `face' property, but it is controlled by
3951M-x font-lock-mode. It is not, strictly speaking, a builtin text
3952property. Instead, it is implemented inside font-core.el, using the
3953new variable `char-property-alias-alist'.
4409 3954
4410--- 3955---
4411** jit-lock obeys a new text-property `jit-lock-defer-multiline'. 3956** jit-lock obeys a new text-property `jit-lock-defer-multiline'.
@@ -4426,143 +3971,465 @@ text to being a piece of code, so you'd put a jit-lock-defer-multiline
4426property over the second half of the command to force (deferred) 3971property over the second half of the command to force (deferred)
4427refontification of `bar' whenever the `e' is added/removed. 3972refontification of `bar' whenever the `e' is added/removed.
4428 3973
3974+++
3975** font-lock can manage arbitrary text-properties beside `face'.
3976*** the FACENAME returned in font-lock-keywords can be a list
3977of the form (face FACE PROP1 VAL1 PROP2 VAL2 ...) so you can set
3978other properties than `face'.
3979*** font-lock-extra-managed-props can be set to make sure those extra
3980properties are automatically cleaned up by font-lock.
3981
4429--- 3982---
4430** describe-vector now takes a second argument `describer' which is 3983** The precedence of file-name-handlers has been changed.
4431called to print the entries' values. It defaults to `princ'. 3984Instead of blindly choosing the first handler that matches,
3985find-file-name-handler now gives precedence to a file-name handler
3986that matches near the end of the file name. More specifically, the
3987handler whose (match-beginning 0) is the largest is chosen.
3988In case of ties, the old "first matched" rule applies.
4432 3989
4433+++ 3990+++
4434** defcustom and other custom declarations now use a default group 3991** A file name handler can declare which operations it handles.
4435(the last prior group defined in the same file) when no :group was given. 3992
3993You do this by putting an `operation' property on the handler name
3994symbol. The property value should be a list of the operations that
3995the handler really handles. It won't be called for any other
3996operations.
3997
3998This is useful for autoloaded handlers, to prevent them from being
3999autoloaded when not really necessary.
4436 4000
4437+++ 4001+++
4438** emacsserver now runs pre-command-hook and post-command-hook when 4002** `set-auto-mode' now gives the interpreter magic line (if present)
4439it receives a request from emacsclient. 4003precedence over the file name. Likewise an <?xml or <!DOCTYPE declaration
4004will give the buffer XML or SGML mode, based on the new var
4005`magic-mode-alist'.
4006
4007+++
4008** Major mode functions now run the new normal hook
4009`after-change-major-mode-hook', at their very end, after the mode hooks.
4010
4011---
4012** If a major mode function has a non-nil `no-clone-indirect'
4013property, `clone-indirect-buffer' signals an error if you use
4014it in that buffer.
4015
4016+++
4017** Major modes can define `eldoc-documentation-function'
4018locally to provide Eldoc functionality by some method appropriate to
4019the language.
4020
4021+++
4022** define-derived-mode by default creates a new empty abbrev table.
4023It does not copy abbrevs from the parent mode's abbrev table.
4024
4025+++
4026** define-minor-mode now accepts arbitrary additional keyword arguments
4027and simply passes them to defcustom, if applicable.
4028
4029+++
4030** The new function `run-mode-hooks' and the new macro `delay-mode-hooks'
4031are used by define-derived-mode to make sure the mode hook for the
4032parent mode is run at the end of the child mode.
4033
4034+++
4035** `minor-mode-list' now holds a list of minor mode commands.
4036
4037+++
4038** Both the variable and the function `disabled-command-hook' have
4039been renamed to `disabled-command-function'. The variable
4040`disabled-command-hook' has been kept as an obsolete alias.
4041
4042+++
4043** The function `eql' is now available without requiring the CL package.
4044
4045+++
4046** If optional third argument APPEND to `add-to-list' is non-nil, a
4047new element gets added at the end of the list instead of at the
4048beginning. This change actually occurred in Emacs-21.1, but was not
4049documented.
4050
4051+++
4052** The escape sequence \s is now interpreted as a SPACE character,
4053unless it is followed by a `-' in a character constant (e.g. ?\s-A),
4054in which case it is still interpreted as the super modifier.
4055In strings, \s is always interpreted as a space.
4056
4057+++
4058** A hex escape in a string forces the string to be multibyte.
4059An octal escape makes it unibyte.
4060
4061+++
4062** `split-string' now includes null substrings in the returned list if
4063the optional argument SEPARATORS is non-nil and there are matches for
4064SEPARATORS at the beginning or end of the string. If SEPARATORS is
4065nil, or if the new optional third argument OMIT-NULLS is non-nil, all
4066empty matches are omitted from the returned list.
4067
4068+++
4069** New function `string-to-multibyte' converts a unibyte string to a
4070multibyte string with the same individual character codes.
4071
4072+++
4073** The function `number-sequence' returns a list of equally-separated
4074numbers. For instance, (number-sequence 4 9) returns (4 5 6 7 8 9).
4075By default, the separation is 1, but you can specify a different separation
4076as the third argument. (number-sequence 1.5 6 2) returns (1.5 3.5 5.5).
4077
4078+++
4079** `sit-for' can now be called with args (SECONDS &optional NODISP).
4080
4081+++
4082** A function's docstring can now hold the function's usage info on
4083its last line. It should match the regexp "\n\n(fn.*)\\'".
4084
4085+++
4086** The `defmacro' form may contain declarations specifying how to
4087indent the macro in Lisp mode and how to debug it with Edebug. The
4088syntax of defmacro has been extended to
4089
4090 (defmacro NAME LAMBDA-LIST [DOC-STRING] [DECLARATION ...] ...)
4091
4092DECLARATION is a list `(declare DECLARATION-SPECIFIER ...)'. The
4093declaration specifiers supported are:
4094
4095(indent INDENT)
4096 Set NAME's `lisp-indent-function' property to INDENT.
4097
4098(edebug DEBUG)
4099 Set NAME's `edebug-form-spec' property to DEBUG. (This is
4100 equivalent to writing a `def-edebug-spec' for the macro.
4101
4102+++
4103** The functions all-completions and try-completion now accept lists
4104of strings as well as hash-tables additionally to alists, obarrays
4105and functions. Furthermore, the function `test-completion' is now
4106exported to Lisp. The keys in alists and hash tables may be either
4107strings or symbols, which are automatically converted with to strings.
4108
4109+++
4110** The new macro dynamic-completion-table supports using functions
4111as a dynamic completion table.
4112
4113 (dynamic-completion-table FUN)
4114
4115FUN is called with one argument, the string for which completion is required,
4116and it should return an alist containing all the intended possible
4117completions. This alist may be a full list of possible completions so that FUN
4118can ignore the value of its argument. If completion is performed in the
4119minibuffer, FUN will be called in the buffer from which the minibuffer was
4120entered. dynamic-completion-table then computes the completion.
4121
4122+++
4123** The new macro lazy-completion-table initializes a variable
4124as a lazy completion table.
4125
4126 (lazy-completion-table VAR FUN &rest ARGS)
4127
4128If the completion table VAR is used for the first time (e.g., by passing VAR
4129as an argument to `try-completion'), the function FUN is called with arguments
4130ARGS. FUN must return the completion table that will be stored in VAR. If
4131completion is requested in the minibuffer, FUN will be called in the buffer
4132from which the minibuffer was entered. The return value of
4133`lazy-completion-table' must be used to initialize the value of VAR.
4134
4135+++
4136** `load-history' can now have elements of the form (t . FUNNAME),
4137which means FUNNAME was previously defined as an autoload (before the
4138current file redefined it).
4139
4140+++
4141** `load-history' now records (defun . FUNNAME) when a function is
4142defined. For a variable, it records just the variable name.
4440 4143
4441--- 4144---
4442** The variable `recursive-load-depth-limit' has been deleted. 4145** The variable `recursive-load-depth-limit' has been deleted.
4443Emacs now signals an error if the same file is loaded with more 4146Emacs now signals an error if the same file is loaded with more
4444than 3 levels of nesting. 4147than 3 levels of nesting.
4445 4148
4149+++
4150** The function symbol-file can now search specifically for function or
4151variable definitions.
4152
4153+++
4154** `provide' and `featurep' now accept an optional second argument
4155to test/provide subfeatures. Also `provide' now checks `after-load-alist'
4156and runs any code associated with the provided feature.
4157
4158+++
4159** `declare' is now a macro. This change was made mostly for
4160documentation purposes and should have no real effect on Lisp code.
4161
4162+++
4163** Byte compiler changes:
4164
4165*** The byte-compiler now displays the actual line and character
4166position of errors, where possible. Additionally, the form of its
4167warning and error messages have been brought more in line with the
4168output of other GNU tools.
4169
4170*** The new macro `with-no-warnings' suppresses all compiler warnings
4171inside its body. In terms of execution, it is equivalent to `progn'.
4172
4173*** You can avoid warnings for possibly-undefined symbols with a
4174simple convention that the compiler understands. (This is mostly
4175useful in code meant to be portable to different Emacs versions.)
4176Write forms like the following, or code that macroexpands into such
4177forms:
4178
4179 (if (fboundp 'foo) <then> <else>)
4180 (if (boundp 'foo) <then> <else)
4181
4182In the first case, using `foo' as a function inside the <then> form
4183won't produce a warning if it's not defined as a function, and in the
4184second case, using `foo' as a variable won't produce a warning if it's
4185unbound. The test must be in exactly one of the above forms (after
4186macro expansion), but such tests may be nested. Note that `when' and
4187`unless' expand to `if', but `cond' doesn't.
4188
4189*** `(featurep 'xemacs)' is treated by the compiler as nil. This
4190helps to avoid noisy compiler warnings in code meant to run under both
4191Emacs and XEmacs and may sometimes make the result significantly more
4192efficient. Since byte code from recent versions of XEmacs won't
4193generally run in Emacs and vice versa, this optimization doesn't lose
4194you anything.
4195
4196*** The local variable `no-byte-compile' in elisp files is now obeyed.
4197
4446--- 4198---
4447** If a major mode function has a non-nil `no-clone-indirect' 4199** When a Lisp file uses CL functions at run-time, compiling the file
4448property, `clone-indirect-buffer' signals an error if you use 4200now issues warnings about these calls, unless the file performs
4449it in that buffer. 4201(require 'cl) when loaded.
4202
4203+++
4204** New function unsafep returns nil if the given Lisp form can't possibly
4205do anything dangerous; otherwise it returns a reason why the form might be
4206unsafe (calls dangerous function, alters global variable, etc).
4207
4208+++
4209** There is a new Warnings facility; see the functions `warn'
4210and `display-warning'.
4450 4211
4451--- 4212---
4452** In `replace-match', the replacement text no longer inherits 4213** VC changes for backends:
4453properties from surrounding text. 4214*** (vc-switches BACKEND OPERATION) is a new function for use by backends.
4215*** The new `find-version' backend function replaces the `destfile'
4216parameter of the `checkout' backend function.
4217Old code still works thanks to a default `find-version' behavior that
4218uses the old `destfile' parameter.
4454 4219
4455+++ 4220+++
4456** The list returned by `(match-data t)' now has the buffer as a final 4221** Already true in Emacs 21.1, but not emphasized clearly enough:
4457element, if the last match was on a buffer. `set-match-data' 4222
4458accepts such a list for restoring the match state. 4223Multibyte buffers can now faithfully record all 256 character codes
4224from 0 to 255. As a result, most of the past reasons to use unibyte
4225buffers no longer exist. We only know of three reasons to use them
4226now:
4227
42281. If you prefer to use unibyte text all of the time.
4229
42302. For reading files into temporary buffers, when you want to avoid
4231the time it takes to convert the format.
4232
42333. For binary files where format conversion would be pointless and
4234wasteful.
4235
4236---
4237** set-buffer-file-coding-system now takes an additional argument,
4238NOMODIFY. If it is non-nil, it means don't mark the buffer modified.
4459 4239
4460+++ 4240+++
4461** New function `buffer-local-value'. 4241** The new variable `auto-coding-functions' lets you specify functions
4242to examine a file being visited and deduce the proper coding system
4243for it. (If the coding system is detected incorrectly for a specific
4244file, you can put a `coding:' tags to override it.)
4462 4245
4463This function returns the buffer-local binding of VARIABLE (a symbol) 4246---
4464in buffer BUFFER. If VARIABLE does not have a buffer-local binding in 4247** The new function `merge-coding-systems' fills in unspecified aspects
4465buffer BUFFER, it returns the default value of VARIABLE instead. 4248of one coding system from another coding system.
4466 4249
4467--- 4250---
4468** New function `text-clone-create'. Text clones are chunks of text 4251** New coding system property `mime-text-unsuitable' indicates that
4469that are kept identical by transparently propagating changes from one 4252the coding system's `mime-charset' is not suitable for MIME text
4470clone to the other. 4253parts, e.g. utf-16.
4471 4254
4472+++ 4255+++
4473** font-lock can manage arbitrary text-properties beside `face'. 4256** New function `decode-coding-inserted-region' decodes a region as if
4474*** the FACENAME returned in font-lock-keywords can be a list 4257it is read from a file without decoding.
4475of the form (face FACE PROP1 VAL1 PROP2 VAL2 ...) so you can set 4258
4476other properties than `face'. 4259+++
4477*** font-lock-extra-managed-props can be set to make sure those extra 4260** Function `translate-region' accepts also a char-table as TABLE
4478properties are automatically cleaned up by font-lock. 4261argument.
4262
4263+++
4264** The new translation table `translation-table-for-input'
4265is used for customizing self-insertion. The character to
4266be inserted is translated through it.
4479 4267
4480--- 4268---
4481** The special treatment of faces whose names are of the form `fg:COLOR' 4269** New CCL functions `lookup-character' and `lookup-integer' access
4482or `bg:COLOR' has been removed. Lisp programs should use the 4270hash tables defined by the Lisp function `define-translation-hash-table'.
4483`defface' facility for defining faces with specific colors, or use
4484the feature of specifying the face attributes :foreground and :background
4485directly in the `face' property instead of using a named face.
4486 4271
4487+++ 4272+++
4488** The new function `run-mode-hooks' and the new macro `delay-mode-hooks' 4273** The flags, width, and precision options for %-specifications in function
4489are used by define-derived-mode to make sure the mode hook for the 4274`format' are now documented. Some flags that were accepted but not
4490parent mode is run at the end of the child mode. 4275implemented (such as "*") are no longer accepted.
4276
4277---
4278** New function `redirect-debugging-output' can be used to redirect
4279debugging output on the stderr file handle to a file.
4491 4280
4492+++ 4281+++
4493** define-minor-mode now accepts arbitrary additional keyword arguments 4282** `makehash' is now obsolete. Use `make-hash-table' instead.
4494and simply passes them to defcustom, if applicable.
4495 4283
4496+++ 4284+++
4497** define-derived-mode by default creates a new empty abbrev table. 4285** The macro `with-syntax-table' does not copy the table any more.
4498It does not copy abbrevs from the parent mode's abbrev table.
4499 4286
4500+++ 4287+++
4501** `provide' and `featurep' now accept an optional second argument 4288** New variables `gc-elapsed' and `gcs-done' provide extra information
4502to test/provide subfeatures. Also `provide' now checks `after-load-alist' 4289on garbage collection.
4503and runs any code associated with the provided feature.
4504 4290
4505+++ 4291+++
4506** Functions `file-name-sans-extension' and `file-name-extension' now 4292** New function `locale-info' accesses locale information.
4507ignore the leading dots in file names, so that file names such as
4508`.emacs' are treated as extensionless.
4509 4293
4510+++ 4294+++
4511** Functions `user-uid' and `user-real-uid' now return floats if the 4295** The new variable `print-continuous-numbering', when non-nil, says
4512user UID doesn't fit in a Lisp integer. Function `user-full-name' 4296that successive calls to print functions should use the same
4513accepts a float as UID parameter. 4297numberings for circular structure references. This is only relevant
4298when `print-circle' is non-nil.
4299
4300When you bind `print-continuous-numbering' to t, you should
4301also bind `print-number-table' to nil.
4302
4303---
4304** When pure storage overflows while dumping, Emacs now prints how
4305much pure storage it will approximately need.
4306
4307+++
4308** File local variables.
4309
4310A file local variables list cannot specify a string with text
4311properties--any specified text properties are discarded.
4312
4313+++
4314** The variable `safe-local-eval-forms' specifies a list of forms that
4315are ok to evaluate when they appear in an `eval' local variables
4316specification. Normally Emacs asks for confirmation before evaluating
4317such a form, but if the form appears in this list, no confirmation is
4318needed.
4514 4319
4515--- 4320---
4516** `define-key-after' now accepts keys longer than 1. 4321** If a function has a non-nil `safe-local-eval-function' property,
4322that means it is ok to evaluate some calls to that function when it
4323appears in an `eval' local variables specification. If the property
4324is t, then any form calling that function with constant arguments is
4325ok. If the property is a function or list of functions, they are called
4326with the form as argument, and if any returns t, the form is ok to call.
4327
4328If the form is not "ok to call", that means Emacs asks for
4329confirmation as before.
4517 4330
4518+++ 4331+++
4519** The local variable `no-byte-compile' in elisp files is now obeyed. 4332** Renamed hooks to better follow the naming convention:
4333find-file-hooks to find-file-hook,
4334find-file-not-found-hooks to find-file-not-found-functions,
4335write-file-hooks to write-file-functions,
4336write-contents-hooks to write-contents-functions,
4337x-lost-selection-hooks to x-lost-selection-functions,
4338x-sent-selection-hooks to x-sent-selection-functions.
4339Marked local-write-file-hooks as obsolete (use the LOCAL arg of `add-hook').
4340
4341+++
4342** The new variable `delete-frame-functions' replaces `delete-frame-hook'.
4343It was renamed to follow the naming conventions for abnormal hooks. The old
4344name remains available as an alias, but has been marked obsolete.
4345
4346+++
4347** The new function `file-remote-p' tests a file name and returns
4348non-nil if it specifies a remote file (one that Emacs accesses using
4349its own special methods and not directly through the file system).
4350The value in that case is an identifier for the remote file system.
4351
4352+++
4353** Functions `get' and `plist-get' no longer signals an error for
4354a malformed property list. They also detect cyclic lists.
4355
4356+++
4357** The function `atan' now accepts an optional second argument.
4358
4359When called with 2 arguments, as in `(atan Y X)', `atan' returns the
4360angle in radians between the vector [X, Y] and the X axis. (This is
4361equivalent to the standard C library function `atan2'.)
4362
4363+++
4364** New function format-mode-line.
4365
4366This returns the mode-line or header-line of the selected (or a
4367specified) window as a string with or without text properties.
4520 4368
4521+++ 4369+++
4522** The Emacs Lisp byte-compiler now displays the actual line and 4370** The new mode-line construct `(:propertize ELT PROPS...)' can be
4523character position of errors, where possible. Additionally, the form 4371used to add text properties to mode-line elements.
4524of its warning and error messages have been brought more in line with
4525the output of other GNU tools.
4526 4372
4527+++ 4373+++
4528** New functions `keymap-prompt' and `current-active-maps'. 4374** The new `%i' and `%I' constructs for `mode-line-format' can be used
4375to display the size of the accessible part of the buffer on the mode
4376line.
4529 4377
4530--- 4378---
4531** New function `describe-buffer-bindings'. 4379** Indentation of simple and extended loop forms has been added to the
4380cl-indent package. The new user options
4381`lisp-loop-keyword-indentation', `lisp-loop-forms-indentation', and
4382`lisp-simple-loop-indentation' can be used to customize the
4383indentation of keywords and forms in loop forms.
4384
4385---
4386** Indentation of backquoted forms has been made customizable in the
4387cl-indent package. See the new user option `lisp-backquote-indentation'.
4532 4388
4533+++ 4389+++
4534** New vars `exec-suffixes' and `load-suffixes' used when 4390** field-beginning and field-end now accept an additional optional
4535searching for an executable resp. an elisp file. 4391argument, LIMIT.
4536 4392
4537+++ 4393+++
4538** Variable aliases have been implemented: 4394** define-abbrev now accepts an optional argument SYSTEM-FLAG. If
4395non-nil, this marks the abbrev as a "system" abbrev, which means that
4396it won't be stored in the user's abbrevs file if he saves the abbrevs.
4397Major modes that predefine some abbrevs should always specify this
4398flag.
4539 4399
4540*** defvaralias ALIAS-VAR BASE-VAR [DOCSTRING] 4400---
4401** describe-vector now takes a second argument `describer' which is
4402called to print the entries' values. It defaults to `princ'.
4541 4403
4542This function defines the symbol ALIAS-VAR as a variable alias for 4404+++
4543symbol BASE-VAR. This means that retrieving the value of ALIAS-VAR 4405** defcustom and other custom declarations now use a default group
4544returns the value of BASE-VAR, and changing the value of ALIAS-VAR 4406(the last prior group defined in the same file) when no :group was given.
4545changes the value of BASE-VAR.
4546 4407
4547DOCSTRING, if present, is the documentation for ALIAS-VAR; else it has 4408---
4548the same documentation as BASE-VAR. 4409** The new customization type `float' specifies numbers with floating
4410point (no integers are allowed).
4549 4411
4550*** indirect-variable VARIABLE 4412+++
4413** emacsserver now runs pre-command-hook and post-command-hook when
4414it receives a request from emacsclient.
4551 4415
4552This function returns the variable at the end of the chain of aliases 4416---
4553of VARIABLE. If VARIABLE is not a symbol, or if VARIABLE is not 4417** New function `text-clone-create'. Text clones are chunks of text
4554defined as an alias, the function returns VARIABLE. 4418that are kept identical by transparently propagating changes from one
4419clone to the other.
4555 4420
4556It might be noteworthy that variables aliases work for all kinds of 4421+++
4557variables, including buffer-local and frame-local variables. 4422** Functions `user-uid' and `user-real-uid' now return floats if the
4423user UID doesn't fit in a Lisp integer. Function `user-full-name'
4424accepts a float as UID parameter.
4558 4425
4559+++ 4426+++
4560** Functions from `post-gc-hook' are run at the end of garbage 4427** New vars `exec-suffixes' and `load-suffixes' used when
4561collection. The hook is run with GC inhibited, so use it with care. 4428searching for an executable resp. an elisp file.
4562 4429
4563+++ 4430+++
4564** If the second argument to `copy-file' is the name of a directory, 4431** Functions from `post-gc-hook' are run at the end of garbage
4565the file is copied to that directory instead of signaling an error. 4432collection. The hook is run with GC inhibited, so use it with care.
4566 4433
4567+++ 4434+++
4568** The variables most-positive-fixnum and most-negative-fixnum 4435** The variables most-positive-fixnum and most-negative-fixnum
@@ -4574,29 +4441,193 @@ The Windows specific variable w32-system-coding-system, which was
4574formerly used for that purpose is now an alias for locale-coding-system. 4441formerly used for that purpose is now an alias for locale-coding-system.
4575 4442
4576--- 4443---
4577** Functions y-or-n-p, read-char, read-key-sequence and the like, that
4578display a prompt but don't use the minibuffer, now display the prompt
4579using the text properties (esp. the face) of the prompt string.
4580
4581---
4582** New function x-send-client-message sends a client message when 4444** New function x-send-client-message sends a client message when
4583running under X. 4445running under X.
4584 4446
4447---
4448** easy-mmode-define-global-mode has been renamed to
4449define-global-minor-mode. The old name remains as an alias.
4450
4451---
4452** To manipulate the File menu using easy-menu, you must specify the
4453proper name "file". In previous Emacs versions, you had to specify
4454"files", even though the menu item itself was changed to say "File"
4455several versions ago.
4456
4457---
4458** The dummy function keys made by easymenu are now always lower case.
4459If you specify the menu item name "Ada", for instance, it uses `ada'
4460as the "key" bound by that key binding.
4461
4462This is relevant only if Lisp code looks for the bindings that were
4463made with easymenu.
4464
4465---
4466** `easy-menu-define' now allows you to use nil for the symbol name
4467if you don't need to give the menu a name. If you install the menu
4468into other keymaps right away (MAPS is non-nil), it usually doesn't
4469need to have a name.
4470
4471---
4472** rx.el has new corresponding `symbol-end' and `symbol-start' elements.
4473
4474** New functions, macros, and commands:
4475
4585+++ 4476+++
4586** Arguments for remove-overlays are now optional, so that you can remove 4477*** The new function `assoc-string' replaces `assoc-ignore-case' and
4587all overlays in the buffer by just calling (remove-overlay). 4478`assoc-ignore-representation', which are still available, but have
4479been declared obsolete.
4588 4480
4589** New packages: 4481+++
4482*** The new function `buffer-local-value' returns the buffer-local
4483binding of VARIABLE (a symbol) in buffer BUFFER. If VARIABLE does not
4484have a buffer-local binding in buffer BUFFER, it returns the default
4485value of VARIABLE instead.
4590 4486
4591+++ 4487+++
4592*** The new package gdb-ui.el provides an enhanced graphical interface to 4488*** The new function `called-interactively-p' does what many people
4593GDB. You can interact with GDB through the GUD buffer in the usual way, but 4489have mistakenly believed `interactive-p' did: it returns t if the
4594there are also further buffers which control the execution and describe the 4490calling function was called through `call-interactively'. This should
4595state of your program. It separates the input/output of your program from 4491only be used when you cannot add a new "interactive" argument to the
4596that of GDB and watches expressions in the speedbar. It also uses features of 4492command.
4597Emacs 21 such as the display margin for breakpoints, and the toolbar.
4598 4493
4599Use M-x gdba to start GDB-UI. 4494*** The new function copy-abbrev-table returns a new abbrev table that
4495is a copy of a given abbrev table.
4496
4497+++
4498*** New function copy-tree makes a copy of a tree, recursively copying
4499both cars and cdrs.
4500
4501+++
4502*** New function `delete-dups' destructively removes `equal'
4503duplicates from a list. Of several `equal' occurrences of an element
4504in the list, the first one is kept.
4505
4506+++
4507*** The new function `filter-buffer-substring' extracts a buffer
4508substring, passes it through a set of filter functions, and returns
4509the filtered substring. It is used instead of `buffer-substring' or
4510`delete-and-extract-region' when copying text into a user-accessible
4511data structure, like the kill-ring, X clipboard, or a register. The
4512list of filter function is specified by the new variable
4513`buffer-substring-filters'. For example, Longlines mode uses
4514`buffer-substring-filters' to remove soft newlines from the copied
4515text.
4516
4517+++
4518*** New functions frame-current-scroll-bars and window-current-scroll-bars.
4519
4520These functions return the current locations of the vertical and
4521horizontal scroll bars in a frame or window.
4522
4523+++
4524*** The new primitive `get-internal-run-time' returns the processor
4525run time used by Emacs since start-up.
4526
4527+++
4528*** The new function insert-buffer-substring-as-yank works like
4529`insert-buffer-substring', but removes the text properties in the
4530`yank-excluded-properties' list.
4531
4532+++
4533*** The new function insert-buffer-substring-no-properties is like
4534insert-buffer-substring, but removes all text properties from the
4535inserted substring.
4536
4537+++
4538*** The new functions `lax-plist-get' and `lax-plist-put' are like
4539`plist-get' and `plist-put', except that they compare the property
4540name using `equal' rather than `eq'.
4541
4542+++
4543*** New function `line-number-at-pos' returns the line number of the
4544current line in the current buffer, or if optional buffer position is
4545given, line number of corresponding line in current buffer.
4546
4547+++
4548*** New function `looking-back' checks whether a regular expression matches
4549the text before point. Specifying the LIMIT argument bounds how far
4550back the match can start; this is a way to keep it from taking too long.
4551
4552+++
4553*** New function `macroexpand-all' expands all macros in a form.
4554It is similar to the Common-Lisp function of the same name.
4555One difference is that it guarantees to return the original argument
4556if no expansion is done, which may be tested using `eq'.
4557
4558*** The new function `minibufferp' returns non-nil if its optional
4559buffer argument is a minibuffer. If the argument is omitted, it
4560defaults to the current buffer.
4561
4562+++
4563*** New function minibuffer-selected-window returns the window which
4564was selected when entering the minibuffer.
4565
4566+++
4567*** The new function `modify-all-frames-parameters' modifies parameters
4568for all (existing and future) frames.
4569
4570+++
4571*** New functions posn-at-point and posn-at-x-y return
4572click-event-style position information for a given visible buffer
4573position or for a given window pixel coordinate.
4574
4575---
4576*** New function quail-find-key returns a list of keys to type in the
4577current input method to input a character.
4578
4579+++
4580*** The new function `rassq-delete-all' deletes all elements from an
4581alist whose cdr is `eq' to a specified value.
4582
4583+++
4584*** The new function remove-list-of-text-properties is almost the same
4585as `remove-text-properties'. The only difference is that it takes a
4586list of property names as argument rather than a property list.
4587
4588+++
4589*** The new primitive `set-file-times' sets a file's access and
4590modification times. Magic file name handlers can handle this
4591operation.
4592
4593+++
4594*** New function substring-no-properties returns a substring without
4595text properties.
4596
4597+++
4598*** The new function syntax-after returns the syntax code
4599of the character after a specified buffer position, taking account
4600of text properties as well as the character code.
4601
4602+++
4603*** `syntax-class' extracts the class of a syntax code (as returned
4604by syntax-after).
4605
4606+++
4607*** New function `tool-bar-local-item-from-menu'
4608
4609The `tool-bar-add-item-from-menu' must not be used (as previously
4610recommended) for making entries in the tool bar for local keymaps.
4611Instead, use the function `tool-bar-local-item-from-menu', which lets
4612you specify the map to use as an argument.
4613
4614+++
4615*** New function window-body-height.
4616This is like window-height but does not count the mode line
4617or the header line.
4618
4619+++
4620*** (while-no-input BODY...) runs BODY, but only so long as no input
4621arrives. If the user types or clicks anything, BODY stops as if a
4622quit had occurred. while-no-input returns the value of BODY, if BODY
4623finishes. It returns nil if BODY was aborted.
4624
4625+++
4626*** New macro with-local-quit temporarily sets inhibit-quit to nil for use
4627around potentially blocking or long-running code in timers
4628and post-command-hooks.
4629
4630** New packages:
4600 4631
4601*** The new package syntax.el provides an efficient way to find the 4632*** The new package syntax.el provides an efficient way to find the
4602current syntactic context (as returned by parse-partial-sexp). 4633current syntactic context (as returned by parse-partial-sexp).
@@ -4616,6 +4647,54 @@ implemented by widget.el, and can be used by lisp code that doesn't
4616require the full power of widgets. Emacs uses buttons for such things 4647require the full power of widgets. Emacs uses buttons for such things
4617as help and apropos buffers. 4648as help and apropos buffers.
4618 4649
4650---
4651*** master-mode.el implements a minor mode for scrolling a slave
4652buffer without leaving your current buffer, the master buffer.
4653
4654It can be used by sql.el, for example: the SQL buffer is the master
4655and its SQLi buffer is the slave. This allows you to scroll the SQLi
4656buffer containing the output from the SQL buffer containing the
4657commands.
4658
4659This is how to use sql.el and master.el together: the variable
4660sql-buffer contains the slave buffer. It is a local variable in the
4661SQL buffer.
4662
4663(add-hook 'sql-mode-hook
4664 (function (lambda ()
4665 (master-mode t)
4666 (master-set-slave sql-buffer))))
4667(add-hook 'sql-set-sqli-hook
4668 (function (lambda ()
4669 (master-set-slave sql-buffer))))
4670
4671+++
4672*** New Lisp library testcover.el works with edebug to help you determine
4673whether you've tested all your Lisp code. Function testcover-start
4674instruments all functions in a given file. Then test your code. Function
4675testcover-mark-all adds overlay "splotches" to the Lisp file's buffer to
4676show where coverage is lacking. Command testcover-next-mark (bind it to
4677a key!) will move point forward to the next spot that has a splotch.
4678
4679Normally, a red splotch indicates the form was never completely
4680evaluated; a brown splotch means it always evaluated to the same
4681value. The red splotches are skipped for forms that can't possibly
4682complete their evaluation, such as `error'. The brown splotches are
4683skipped for forms that are expected to always evaluate to the same
4684value, such as (setq x 14).
4685
4686For difficult cases, you can add do-nothing macros to your code to
4687help out the test coverage tool. The macro `noreturn' suppresses a
4688red splotch. It is an error if the argument to `noreturn' does
4689return. The macro 1value suppresses a brown splotch for its argument.
4690This macro is a no-op except during test-coverage -- then it signals
4691an error if the argument actually returns differing values.
4692
4693---
4694** Support for Mocklisp has been removed.
4695
4696---
4697** The function insert-string is now obsolete.
4619 4698
4620* Installation changes in Emacs 21.3 4699* Installation changes in Emacs 21.3
4621 4700
diff --git a/etc/TUTORIAL.ru b/etc/TUTORIAL.ru
index 3dad1b3daec..1be3a1e28a8 100644
--- a/etc/TUTORIAL.ru
+++ b/etc/TUTORIAL.ru
@@ -1,64 +1,69 @@
1õÞÅÂÎÉË Emacs. õÓÌÏ×ÉÑ ÒÁÓÐÒÏÓÔÒÁÎÅÎÉÑ ÓÍÏÔÒÉÔÅ × ËÏÎÃÅ ÆÁÊÌÁ 1õÞÅÂÎÉË Emacs. õÓÌÏ×ÉÑ ÒÁÓÐÒÏÓÔÒÁÎÅÎÉÑ ÐÒÉ×ÅÄÅÎÙ × ËÏÎÃÅ ÆÁÊÌÁ
2Copyright (c) 1985, 1996, 2004 Free Software Foundation, Inc. 2Copyright (c) 1985, 1996, 1998, 2001, 2002, 2005 Free Software Foundation, Inc.
3 3
4äÌÑ ÕÐÒÁ×ÌÅÎÉÑ Emacs ÏÂÙÞÎÏ ÉÓÐÏÌØÚÕÅÔÓÑ ËÌÀÞ (ÓÏÞÅÔÁÎÉÅ ËÌÁ×ÉÛ ËÌÁ×ÉÁÔÕÒÙ 4äÌÑ ÕÐÒÁ×ÌÅÎÉÑ Emacs ÏÂÙÞÎÏ ÉÓÐÏÌØÚÕÅÔÓÑ ËÌÀÞ (key -- ÓÏÞÅÔÁÎÉÅ ËÌÁ×ÉÛ
5É/ÉÌÉ ËÎÏÐÏË ÍÙÛÉ), ×ËÌÀÞÁÀÝÉÊ × ÓÅÂÑ ËÌÁ×ÉÛÕ CONTROL (ÉÎÏÇÄÁ ÏÔÍÅÞÁÅÍÁÑ 5ËÌÁ×ÉÁÔÕÒÙ É/ÉÌÉ ËÎÏÐÏË ÍÙÛÉ), ×ËÌÀÞÁÀÝÉÊ × ÓÅÂÑ ËÌÁ×ÉÛÕ CONTROL (ÉÎÏÇÄÁ
6ËÁË CTRL ÉÌÉ CTL) ÉÌÉ ËÌÁ×ÉÛÕ META (ÉÎÏÇÄÁ ÐÏÍÅÞÅÎÎÕÀ ËÁË ALT ÉÌÉ EDIT). ÷ 6ÏÔÍÅÞÁÅÍÁÑ ËÁË CTRL ÉÌÉ CTL) ÉÌÉ ËÌÁ×ÉÛÕ META (ÉÎÏÇÄÁ ÐÏÍÅÞÅÎÎÕÀ ËÁË ALT ÉÌÉ
7ÄÁÌØÎÅÊÛÅÍ ×ÍÅÓÔÏ ÔÏÇÏ, ÞÔÏÂÙ ËÁÖÄÙÊ ÒÁÚ ÐÉÓÁÔØ META ÉÌÉ CONTROL, ÍÙ ÂÕÄÅÍ 7EDIT). ÷ ÄÁÌØÎÅÊÛÅÍ, ×ÍÅÓÔÏ ÔÏÇÏ, ÞÔÏÂÙ ËÁÖÄÙÊ ÒÁÚ ÐÉÓÁÔØ META ÉÌÉ CONTROL,
8ÉÓÐÏÌØÚÏ×ÁÔØ ÓÌÅÄÕÀÝÅÅ ÓÏËÒÁÝÅÎÉÅ: 8ÍÙ ÂÕÄÅÍ ÉÓÐÏÌØÚÏ×ÁÔØ ÓÌÅÄÕÀÝÉÅ ÓÏËÒÁÝÅÎÉÑ:
9 9
10 C-<chr> ÓÌÅÄÕÅÔ ÕÄÅÒÖÉ×ÁÔØ ËÌÁ×ÉÛÕ CONTROL, ÐÏËÁ ÎÁÂÉÒÁÅÔÓÑ ÓÉÍ×ÏÌ <chr>. 10 C-<chr> -- ÓÌÅÄÕÅÔ ÕÄÅÒÖÉ×ÁÔØ ËÌÁ×ÉÛÕ CONTROL, ÐÏËÁ ÎÁÂÉÒÁÅÔÓÑ ÓÉÍ×ÏÌ
11 ôÁË, C-f ÄÏÌÖÎÏ ÏÚÎÁÞÁÔØ: ÎÁÖÁÔØ ËÌÁ×ÉÛÕ CONTROL É f. 11 <chr>. ôÁË, C-f ÄÏÌÖÎÏ ÏÚÎÁÞÁÔØ: ÎÁÖÁÔØ ËÌÁ×ÉÛÕ CONTROL É f.
12 M-<chr> ÓÌÅÄÕÅÔ ÕÄÅÒÖÉ×ÁÔØ ËÌÁ×ÉÛÕ META, ÐÏËÁ ÎÁÂÉÒÁÅÔÓÑ ÓÉÍ×ÏÌ <chr>. åÓÌÉ 12 M-<chr> -- ÓÌÅÄÕÅÔ ÕÄÅÒÖÉ×ÁÔØ ËÌÁ×ÉÛÕ META, ÐÏËÁ ÎÁÂÉÒÁÅÔÓÑ ÓÉÍ×ÏÌ
13 ÎÅÔ ËÌÁ×ÉÛÉ META, ALT ÉÌÉ EDIT, ÔÏ ÎÁÖÍÉÔÅ <ESC>, ÏÔÐÕÓÔÉÔÅ ÅÅ, 13 <chr>. åÓÌÉ ÎÅÔ ËÌÁ×ÉÛÉ META, ALT ÉÌÉ EDIT, ÔÏ ÎÁÖÍÉÔÅ <ESC>,
14 Á ÐÏÔÏÍ ÎÁÂÅÒÉÔÅ ÓÉÍ×ÏÌ <chr>. 14 ÏÔÐÕÓÔÉÔÅ ÅÅ, Á ÐÏÔÏÍ ÎÁÂÅÒÉÔÅ ÓÉÍ×ÏÌ <chr>.
15 15
16÷ÁÖÎÏÅ ÚÁÍÅÞÁÎÉÅ: ÄÌÑ ÚÁ×ÅÒÛÅÎÉÑ ÓÅÁÎÓÁ Emacs, ÎÁÂÅÒÉÔÅ C-x C-c. (ä×Á 16÷ÁÖÎÏÅ ÚÁÍÅÞÁÎÉÅ: ÄÌÑ ÚÁ×ÅÒÛÅÎÉÑ ÓÅÁÎÓÁ Emacs, ÎÁÂÅÒÉÔÅ C-x C-c (Ä×Á
17ÓÉÍ×ÏÌÁ). óÉÍ×ÏÌÙ ">>" Ó ÌÅ×ÏÊ ÓÔÏÒÏÎÙ ÕËÁÚÙ×ÁÀÔ, ÞÔÏ ×ÁÍ ÎÕÖÎÏ ÄÅÌÁÔØ, 17ÓÉÍ×ÏÌÁ). óÉÍ×ÏÌÙ ">>" Ó ÌÅ×ÏÊ ÓÔÏÒÏÎÙ ÕËÁÚÙ×ÁÀÔ, ÞÔÏ ×ÁÍ ÎÕÖÎÏ ÄÅÌÁÔØ,
18ÞÔÏÂÙ ÐÒÉÍÅÎÉÔØ ËÏÍÁÎÄÕ. îÁÐÒÉÍÅÒ: 18ÞÔÏÂÙ ÐÒÉÍÅÎÉÔØ ËÏÍÁÎÄÕ. îÁÐÒÉÍÅÒ:
19<<óÅÒÅÄÉÎÁ ÓÔÒÁÎÉÃÙ ÏÓÔÁ×ÌÅÎÁ ÐÕÓÔÏÊ ÄÌÑ ÕÞÅÂÎÙÈ ÃÅÌÅÊ. ôÅËÓÔ ÐÒÏÄÏÌÖÁÅÔÓÑ ÎÉÖÅ>> 19<<ðÕÓÔÙÅ ÓÔÒÏËÉ ×ÏËÒÕÇ ×ÓÔÁ×ÌÅÎÙ ËÏÍÁÎÄÏÊ help-with-tutorial>>
20>> ôÅÐÅÒØ ÎÁÖÍÉÔÅ C-v (ðÒÏÓÍÏÔÒ ÓÌÅÄÕÀÝÅÇÏ ÜËÒÁÎÁ) ÄÌÑ ÐÅÒÅÍÅÝÅÎÉÑ ÎÁ 20[óÅÒÅÄÉÎÁ ÓÔÒÁÎÉÃÙ ÏÓÔÁ×ÌÅÎÁ ÐÕÓÔÏÊ × ÕÞÅÂÎÙÈ ÃÅÌÑÈ. ôÅËÓÔ ÐÒÏÄÏÌÖÁÅÔÓÑ ÎÉÖÅ]
21 ÓÌÅÄÕÀÝÉÊ ÜËÒÁÎ. (÷ÙÐÏÌÎÉÔÅ ÜÔÏ, ÕÄÅÒÖÉ×ÁÑ ËÌÁ×ÉÛÕ CONTROL ÎÁÖÉÍÁÑ v). 21>> ôÅÐÅÒØ ÎÁÖÍÉÔÅ C-v (ÐÒÏÓÍÏÔÒ ÓÌÅÄÕÀÝÅÇÏ ÜËÒÁÎÁ) ÄÌÑ ÐÅÒÅÍÅÝÅÎÉÑ ÎÁ
22 ôÅÐÅÒØ ×Ù ÄÏÌÖÎÙ ÜÔÏ ÓÄÅÌÁÔØ ÅÝÅ ÒÁÚ, ËÏÇÄÁ ÚÁËÏÎÞÉÔÅ ÞÉÔÁÔØ ÜËÒÁÎ. 22 ÓÌÅÄÕÀÝÉÊ ÜËÒÁÎ. (×ÙÐÏÌÎÉÔÅ ÜÔÕ ËÏÍÁÎÄÕ ÕÄÅÒÖÉ×ÁÑ ËÌÁ×ÉÛÕ CONTROL É
23 23 ÎÁÖÉÍÁÑ v). ôÅÐÅÒØ ×Ù ÄÏÌÖÎÙ ÜÔÏ ÓÄÅÌÁÔØ ÅÝÅ ÒÁÚ, ËÏÇÄÁ ÚÁËÏÎÞÉÔÅ ÞÉÔÁÔØ
24ïÂÒÁÔÉÔÅ ×ÎÉÍÁÎÉÅ ÎÁ ÔÏ, ÞÔÏ, ÐÏËÁ ×Ù Ä×ÉÖÅÔÅÓØ Ó ÜËÒÁÎÁ ÎÁ ÜËÒÁÎ, 24 ÜËÒÁÎ.
25ÐÅÒÅËÒÙ×ÁÀÔÓÑ Ä×Å ÓÔÒÏÞËÉ; ÜÔÏ ÏÂÅÓÐÅÞÉ×ÁÅÔ ÎÅËÏÔÏÒÕÀ ÎÅÐÒÅÒÙ×ÎÏÓÔØ, ÔÁË 25
26ÞÔÏ ×Ù ÍÏÖÅÔÅ ÐÒÏÄÏÌÖÉÔØ ÞÉÔÁÔØ ÔÅËÓÔ. 26ïÂÒÁÔÉÔÅ ×ÎÉÍÁÎÉÅ ÎÁ ÔÏ, ÞÔÏ, ÐÒÉ ÐÅÒÅÈÏÄÅ Ó ÜËÒÁÎÁ ÎÁ ÜËÒÁÎ ÐÅÒÅËÒÙ×ÁÀÔÓÑ
27 27Ä×Å ÓÔÒÏÞËÉ -- ÜÔÏ ÏÂÅÓÐÅÞÉ×ÁÅÔ ÎÅËÏÔÏÒÕÀ ÎÅÐÒÅÒÙ×ÎÏÓÔØ ×ÏÓÐÒÉÑÔÉÑ, ÔÁË ÞÔÏ
28ðÅÒ×ÏÅ, ÞÔÏ ×ÁÍ ÎÅÏÂÈÏÄÉÍÏ ÚÎÁÔØ -- ËÁË ÐÅÒÅÄ×ÉÇÁÔØÓÑ ÐÏ ÔÅËÓÔÕ ÉÚ ÏÄÎÏÇÏ 28×Ù ÍÏÖÅÔÅ ÐÒÏÄÏÌÖÁÔØ ÞÉÔÁÔØ ÔÅËÓÔ ÎÅ ÔÅÒÑÑ ÎÉÔÉ ÐÏ×ÅÓÔ×Ï×ÁÎÉÑ.
29ÍÅÓÔÁ × ÄÒÕÇÏÅ. ÷Ù ÕÖÅ ÚÎÁÅÔÅ, ËÁË ÐÅÒÅÍÅÓÔÉÔØÓÑ ×ÐÅÒÅÄ ÏÄÉÎ ÜËÒÁÎ, 29
30ÉÓÐÏÌØÚÕÑ ËÌÀÞ C-v. äÌÑ ÐÅÒÅÍÅÝÅÎÉÑ ÎÁÚÁÄ ÎÁ ÏÄÉÎ ÜËÒÁÎ, ÎÁÖÍÉÔÅ M-v 30ðÅÒ×ÏÅ, ÞÔÏ ×ÁÍ ÎÅÏÂÈÏÄÉÍÏ ÚÎÁÔØ -- ÜÔÏ ÔÏ, ËÁË ÐÅÒÅÄ×ÉÇÁÔØÓÑ ÐÏ ÔÅËÓÔÕ ÉÚ
31(ÕÄÅÒÖÉ×ÁÊÔÅ ËÌÁ×ÉÛÕ META É ÎÁÂÅÒÉÔÅ v, ÉÌÉ ÎÁÖÍÉÔÅ <ESC>v, ÅÓÌÉ Õ ×ÁÓ ÎÅÔ 31ÏÄÎÏÇÏ ÍÅÓÔÁ × ÄÒÕÇÏÅ. ÷Ù ÕÖÅ ÚÎÁÅÔÅ, ËÁË ÐÅÒÅÍÅÓÔÉÔØÓÑ ×ÐÅÒÅÄ ÎÁ ÏÄÉÎ
32ËÌÁ×ÉÛÙ META, EDIT, ÉÌÉ ALT). 32ÜËÒÁÎ, ÉÓÐÏÌØÚÕÑ ÓÏÞÅÔÁÎÉÅ ËÌÁ×ÉÛ C-v. äÌÑ ÐÅÒÅÍÅÝÅÎÉÑ ÎÁÚÁÄ ÎÁ ÏÄÉÎ ÜËÒÁÎ,
33 33ÎÁÖÍÉÔÅ M-v (ÕÄÅÒÖÉ×ÁÊÔÅ ËÌÁ×ÉÛÕ META É ÎÁÂÅÒÉÔÅ v, ÉÌÉ ÎÁÖÍÉÔÅ <ESC> É
34>> ÐÏÐÒÏÂÕÊÔÅ ÎÁÂÒÁÔØ M-v É ÐÏÔÏÍ C-v, ÎÅÓËÏÌØËÏ ÒÁÚ. 34ÚÁÔÅÍ v, Á ÅÓÌÉ Õ ×ÁÓ ÎÅÔ ËÌÁ×ÉÛÉ META, EDIT ÉÌÉ ALT).
35 35
36 36>> ÐÏÐÒÏÂÕÊÔÅ ÎÁÂÒÁÔØ M-v, Á ÚÁÔÅÍ C-v, ÎÅÓËÏÌØËÏ ÒÁÚ.
37* ëòáôëáñ ó÷ïäëá 37
38---------------- 38* ëòáôëéê ðåòåþåîø ëïíáîä
39-------------------------
39 40
40äÌÑ ÐÒÏÓÍÏÔÒÁ ÉÓÐÏÌØÚÕÀÔÓÑ ÓÌÅÄÕÀÝÉÅ ËÏÍÁÎÄÙ: 41äÌÑ ÐÒÏÓÍÏÔÒÁ ÉÓÐÏÌØÚÕÀÔÓÑ ÓÌÅÄÕÀÝÉÅ ËÏÍÁÎÄÙ:
41 42
42 C-v ðÅÒÅÊÔÉ ÎÁ ÏÄÉÎ ÜËÒÁÎ ×ÐÅÒÅÄ 43 C-v ðÅÒÅÊÔÉ ÎÁ ÏÄÉÎ ÜËÒÁÎ ×ÐÅÒÅÄ
43 M-v ðÅÒÅÊÔÉ ÎÁ ÏÄÉÎ ÜËÒÁÎ ÎÁÚÁÄ 44 M-v ðÅÒÅÊÔÉ ÎÁ ÏÄÉÎ ÜËÒÁÎ ÎÁÚÁÄ
44 C-l ïÞÉÓÔÉÔØ ÜËÒÁÎ É ÏÔÏÂÒÁÚÉÔØ ×ÓÅ ÚÁÎÏ×Ï, ÒÁÚÍÅÓÔÉ× 45 C-l ïÞÉÓÔÉÔØ ÜËÒÁÎ É ÏÔÏÂÒÁÚÉÔØ ×ÓÅ ÚÁÎÏ×Ï, ÒÁÚÍÅÓÔÉ× ÔÅËÓÔ, ÎÁÈÏÄÑÝÉÊÓÑ
45 ÔÅËÓÔ, ÎÁÈÏÄÑÝÉÊÓÑ ×ÏÚÌÅ ËÕÒÓÏÒÁ, × ÃÅÎÔÒÅ ÜËÒÁÎÁ. 46 ×ÏÚÌÅ ËÕÒÓÏÒÁ, × ÃÅÎÔÒÅ ÜËÒÁÎÁ. (ÜÔÏ CONTROL-L, Á ÎÅ CONTROL-1.)
46 (üÔÏ CONTROL-L, Á ÎÅ CONTROL-1.)
47 47
48>> îÁÊÄÉÔÅ ËÕÒÓÏÒ, É ÚÁÐÏÍÎÉÔÅ ÔÅËÓÔ ×ÏÚÌÅ ÎÅÇÏ. ðÏÔÏÍ ÎÁÖÍÉÔÅ C-l. 48>> îÁÊÄÉÔÅ ËÕÒÓÏÒ, É ÚÁÐÏÍÎÉÔÅ ÔÅËÓÔ ×ÏÚÌÅ ÎÅÇÏ. ðÏÔÏÍ ÎÁÖÍÉÔÅ C-l.
49 îÁÊÄÉÔÅ ËÕÒÓÏÒ ÓÎÏ×Á É ÕÂÅÄÉÔÅÓØ, ÞÔÏ ×ÏÚÌÅ ÎÅÇÏ ×ÓÅ ÔÏÔ ÖÅ ÔÅËÓÔ. 49 îÁÊÄÉÔÅ ËÕÒÓÏÒ ÓÎÏ×Á É ÕÂÅÄÉÔÅÓØ, ÞÔÏ ×ÏÚÌÅ ÎÅÇÏ ×ÓÅ ÔÏÔ ÖÅ ÔÅËÓÔ.
50 50
51÷Ù ÔÁËÖÅ ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ ËÌÁ×ÉÛÉ PageUp É PageDn ÄÌÑ ÐÅÒÅÍÅÝÅÎÉÑ ÍÅÖÄÕ
52ÜËÒÁÎÁÍÉ (ÅÓÌÉ ÏÎÉ ÅÓÔØ ÎÁ ×ÁÛÅÍ ÔÅÒÍÉÎÁÌÅ), ÎÏ ×Ù ÓÍÏÖÅÔÅ ÒÁÂÏÔÁÔØ ÂÏÌÅÅ
53ÜÆÆÅËÔÉ×ÎÏ, ÅÓÌÉ ÂÕÄÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ ÓÏÞÅÔÁÎÉÑ C-v É M-v.
54
51 55
52* âáúï÷ùå ëïíáîäù õðòá÷ìåîéñ ëõòóïòïí 56* âáúï÷ùå ëïíáîäù õðòá÷ìåîéñ ëõòóïòïí
53------------------------------------- 57-------------------------------------
54 58
55ä×ÉÖÅÎÉÅ ÏÔ ÜËÒÁÎÁ Ë ÜËÒÁÎÕ ÕÄÏÂÎÏ, ÎÏ ËÁË ÐÅÒÅÍÅÓÔÉÔØÓÑ × ÏÐÒÅÄÅÌÅÎÎÏÅ 59ä×ÉÖÅÎÉÅ ÏÔ ÜËÒÁÎÁ Ë ÜËÒÁÎÕ ÕÄÏÂÎÏ, ÎÏ ËÁË ÐÅÒÅÍÅÓÔÉÔØÓÑ × ÏÐÒÅÄÅÌÅÎÎÏÅ
56ÍÅÓÔÏ ÔÅËÓÔÁ ÎÁ ÜËÒÁÎÅ? 60ÍÅÓÔÏ × ÔÅËÓÔÅ ÎÁ ÜËÒÁÎÅ?
57 61
58åÓÔØ ÎÅÓËÏÌØËÏ ÓÐÏÓÏÂÏ× ÓÄÅÌÁÔØ ÜÔÏ. ïÓÎÏ×ÎÏÊ ÓÐÏÓÏ -- ÉÓÐÏÌØÚÏ×ÁÔØ ËÏÍÁÎÄÙ 62åÓÔØ ÎÅÓËÏÌØËÏ ÓÐÏÓÏÂÏ× ×ÙÐÏÌÎÅÎÉÑ ÜÔÏÊ ÏÐÅÒÁÃÉÉ. ÷Ù ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ
59C-p, C-b, C-f É C-n. ëÁÖÄÁÑ ÉÚ ÜÔÉÈ ËÏÍÁÎÄ ÐÅÒÅÄ×ÉÇÁÅÔ ËÕÒÓÏÒ ÎÁ ÏÄÎÕ 63ËÌÁ×ÉÛÉ ÕÐÒÁ×ÌÅÎÉÑ ËÕÒÓÏÒÏÍ (ÓÔÒÅÌËÉ), ÎÏ ÂÏÌÅÅ ÜÆÆÅËÔÉ×ÎÙÍ ÂÕÄÅÔ ÓÏÈÒÁÎÅÎÉÅ
60ÓÔÒÏËÕ ÉÌÉ ËÏÌÏÎËÕ ÎÁ ÜËÒÁÎÅ × ÏÐÒÅÄÅÌÅÎÎÏÍ ÎÁÐÒÁ×ÌÅÎÉÉ. üÔÁ ÔÁÂÌÉÃÁ 64ÒÕË × ÉÈ ÓÔÁÎÄÁÒÔÎÏÊ ÐÏÚÉÃÉÉ É ÉÓÐÏÌØÚÏ×ÁÔØ ËÏÍÁÎÄÙ C-p, C-b, C-f É C-n. üÔÉ
61ÐÏËÁÚÙ×ÁÅÔ ÞÅÔÙÒÅ ËÏÍÁÎÄÙ É ÞÅÔÙÒÅ ÎÁÐÒÁ×ÌÅÎÉÑ ÉÈ Ä×ÉÖÅÎÉÑ: 65ËÏÍÁÎÄÙ ÜË×É×ÁÌÅÎÔÎÙ ÞÅÔÙÒÅÍ ËÌÁ×ÉÛÁÍ ÐÅÒÅÍÅÝÅÎÉÑ ËÕÒÓÏÒÁ, ËÁË ÜÔÏ ÐÏËÁÚÁÎÏ
66ÎÁ ÓÈÅÍÅ:
62 67
63 ðÒÅÄÙÄÕÝÁÑ ÓÔÒÏËÁ, C-p 68 ðÒÅÄÙÄÕÝÁÑ ÓÔÒÏËÁ, C-p
64 : 69 :
@@ -68,13 +73,14 @@ C-p, C-b, C-f É C-n. ëÁÖÄÁÑ ÉÚ ÜÔÉÈ ËÏÍÁÎÄ ÐÅÒÅÄ×ÉÇÁÅÔ ËÕÒÓÏÒ ÎÁ ÏÄÎÕ
68 : 73 :
69 óÌÅÄÕÀÝÁÑ ÓÔÒÏËÁ, C-n 74 óÌÅÄÕÀÝÁÑ ÓÔÒÏËÁ, C-n
70 75
71>> ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ÎÁ ÓÔÒÏËÕ ÒÑÄÏÍ Ó ÄÉÁÇÒÁÍÍÏÊ, ÉÓÐÏÌØÚÕÑ C-n ÉÌÉ C-p. 76>> ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ÎÁ ÓÔÒÏËÕ ÒÑÄÏÍ Ó ÄÉÁÇÒÁÍÍÏÊ, ÉÓÐÏÌØÚÕÑ ÓÏÞÅÔÁÎÉÑ
72 ðÏÔÏÍ, ÎÁÖÍÉÔÅ C-l É ÐÏÓÍÏÔÒÉÔÅ ËÁË ÄÉÁÇÒÁÍÍÁ ÒÁÚÍÅÓÔÉÔÓÑ × ÃÅÎÔÒÅ 77 ËÌÁ×ÉÛ C-n ÉÌÉ C-p. ðÏÔÏÍ, ÎÁÖÍÉÔÅ C-l É ÐÏÓÍÏÔÒÉÔÅ ËÁË ÄÉÁÇÒÁÍÍÁ
73 ÜËÒÁÎÁ. 78 ÐÅÒÅÍÅÓÔÉÔÓÑ × ÃÅÎÔÒ ÜËÒÁÎÁ.
74 79
75÷ÁÍ ÂÕÄÅÔ ÎÅÓÌÏÖÎÏ ÚÁÐÏÍÎÉÔØ ÜÔÉ ËÏÍÁÎÄÙ ÐÏ ÂÕË×ÁÍ -- B-ÎÁÚÁÄ (backward) É 80÷ÁÍ ÂÕÄÅÔ ÎÅÓÌÏÖÎÏ ÚÁÐÏÍÎÉÔØ ÜÔÉ ËÏÍÁÎÄÙ ÐÏ ÐÅÒ×ÙÍ ÂÕË×ÁÍ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÉÈ
76F-×ÐÅÒÅÄ (forward). üÔÏ ÏÓÎÏ×ÎÙÅ ËÏÍÁÎÄÙ ÐÏÚÉÃÉÏÎÉÒÏ×ÁÎÉÑ ËÕÒÓÏÒÁ, ËÏÔÏÒÙÍÉ 81ÓÌÏ× -- B-ÎÁÚÁÄ (backward) É F-×ÐÅÒÅÄ (forward). üÔÏ ÏÓÎÏ×ÎÙÅ ËÏÍÁÎÄÙ
77÷Ù ÂÕÄÅÔÅ ÐÏÌØÚÏ×ÁÔØÓÑ ÷óåçäá, ÔÁË ÞÔÏ ÂÕÄÅÔ ÎÅÐÌÏÈÏ ÉÈ ×ÙÕÞÉÔØ. 82ÐÏÚÉÃÉÏÎÉÒÏ×ÁÎÉÑ ËÕÒÓÏÒÁ, ËÏÔÏÒÙÍÉ ÷Ù ÂÕÄÅÔÅ ÐÏÌØÚÏ×ÁÔØÓÑ ÷óåçäá, ÔÁË ÞÔÏ
83ÂÕÄÅÔ ÎÅÐÌÏÈÏ ÉÈ ×ÙÕÞÉÔØ.
78 84
79>> îÁÖÍÉÔÅ ÎÅÓËÏÌØËÏ ÒÁÚ C-n, ÞÔÏÂÙ ÏÐÕÓÔÉÔØ ËÕÒÓÏÒ ×ÎÉÚ ÎÁ ÜÔÕ ÓÔÒÏËÕ. 85>> îÁÖÍÉÔÅ ÎÅÓËÏÌØËÏ ÒÁÚ C-n, ÞÔÏÂÙ ÏÐÕÓÔÉÔØ ËÕÒÓÏÒ ×ÎÉÚ ÎÁ ÜÔÕ ÓÔÒÏËÕ.
80 86
@@ -94,8 +100,9 @@ character), ËÏÔÏÒÙÊ ÏÔÄÅÌÑÅÔ ÅÅ ÏÔ ÓÌÅÄÕÀÝÅÊ ÓÔÒÏËÉ. ðÏÓÌÅÄÎÑÑ ÓÔÒÏËÁ ×
94C-f ÍÏÖÅÔ ÐÅÒÅÍÅÝÁÔØ ËÕÒÓÏÒ ÞÅÒÅÚ ÓÉÍ×ÏÌ ÐÅÒÅ×ÏÄÁ ÓÔÒÏËÉ ÔÁË ÖÅ, ËÁË É C-b. 100C-f ÍÏÖÅÔ ÐÅÒÅÍÅÝÁÔØ ËÕÒÓÏÒ ÞÅÒÅÚ ÓÉÍ×ÏÌ ÐÅÒÅ×ÏÄÁ ÓÔÒÏËÉ ÔÁË ÖÅ, ËÁË É C-b.
95 101
96>> ðÏÐÒÏÂÕÊÔÅ ÎÅÓËÏÌØËÏ ÒÁÚ ÐÒÉÍÅÎÉÔØ C-b ÔÁË, ÞÔÏÂÙ ÷Ù Õ×ÉÄÅÌÉ, ËÁË 102>> ðÏÐÒÏÂÕÊÔÅ ÎÅÓËÏÌØËÏ ÒÁÚ ÐÒÉÍÅÎÉÔØ C-b ÔÁË, ÞÔÏÂÙ ÷Ù Õ×ÉÄÅÌÉ, ËÁË
97 Ä×ÉÖÅÔÓÑ ËÕÒÓÏÒ. äÁÌÅÅ ÉÓÐÏÌØÚÕÊÔÅ C-f ÞÔÏÂÙ ×ÅÒÎÕÔØÓÑ ÎÁ ËÏÎÅà 103 Ä×ÉÖÅÔÓÑ ËÕÒÓÏÒ. äÁÌÅÅ ÉÓÐÏÌØÚÕÊÔÅ ÓÏÞÅÔÁÎÉÅ ËÌÁ×ÉÛ C-f ÞÔÏÂÙ ×ÅÒÎÕÔØÓÑ
98 ÓÔÒÏËÉ. îÁÖÍÉÔÅ C-f ÅÝÅ ÒÁÚ, ÞÔÏÂÙ ÐÅÒÅÊÔÉ Ë ÎÁÞÁÌÕ ÓÌÅÄÕÀÝÅÊ ÓÔÒÏËÉ. 104 ÎÁ ËÏÎÅà ÓÔÒÏËÉ. îÁÖÍÉÔÅ C-f ÅÝÅ ÒÁÚ, ÞÔÏÂÙ ÐÅÒÅÊÔÉ Ë ÎÁÞÁÌÕ ÓÌÅÄÕÀÝÅÊ
105 ÓÔÒÏËÉ.
99 106
100ëÏÇÄÁ ×Ù ÐÅÒÅÍÅÝÁÅÔÅÓØ ÚÁ ×ÅÒÈÎÉÊ ÉÌÉ ÎÉÖÎÉÊ ËÒÁÊ ÜËÒÁÎÁ, ÔÅËÓÔ, ÎÁÈÏÄÑÝÉÊÓÑ 107ëÏÇÄÁ ×Ù ÐÅÒÅÍÅÝÁÅÔÅÓØ ÚÁ ×ÅÒÈÎÉÊ ÉÌÉ ÎÉÖÎÉÊ ËÒÁÊ ÜËÒÁÎÁ, ÔÅËÓÔ, ÎÁÈÏÄÑÝÉÊÓÑ
101ÚÁ ÜËÒÁÎÏÍ, ÓÄ×ÉÇÁÅÔÓÑ ×ÎÕÔÒØ ÜËÒÁÎÁ. üÔÏ ÎÁÚÙ×ÁÅÔÓÑ "ÐÒÏËÒÕÔËÁ 108ÚÁ ÜËÒÁÎÏÍ, ÓÄ×ÉÇÁÅÔÓÑ ×ÎÕÔÒØ ÜËÒÁÎÁ. üÔÏ ÎÁÚÙ×ÁÅÔÓÑ "ÐÒÏËÒÕÔËÁ
@@ -103,7 +110,7 @@ C-f ÍÏÖÅÔ ÐÅÒÅÍÅÝÁÔØ ËÕÒÓÏÒ ÞÅÒÅÚ ÓÉÍ×ÏÌ ÐÅÒÅ×ÏÄÁ ÓÔÒÏËÉ ÔÁË ÖÅ, ËÁË É C-b.
103ÔÅËÓÔÁ ÂÅÚ ÐÅÒÅÍÅÝÅÎÉÑ ÅÇÏ ÚÁ ÐÒÅÄÅÌÙ ÜËÒÁÎÁ. 110ÔÅËÓÔÁ ÂÅÚ ÐÅÒÅÍÅÝÅÎÉÑ ÅÇÏ ÚÁ ÐÒÅÄÅÌÙ ÜËÒÁÎÁ.
104 111
105>> ðÏÐÒÏÂÕÊÔÅ ÐÅÒÅÍÅÓÔÉÔØ ËÕÒÓÏÒ ÚÁ ÎÉÖÎÀÀ ÇÒÁÎÉÃÕ ÜËÒÁÎÁ, ÉÓÐÏÌØÚÕÑ C-n, É 112>> ðÏÐÒÏÂÕÊÔÅ ÐÅÒÅÍÅÓÔÉÔØ ËÕÒÓÏÒ ÚÁ ÎÉÖÎÀÀ ÇÒÁÎÉÃÕ ÜËÒÁÎÁ, ÉÓÐÏÌØÚÕÑ C-n, É
106 ÐÏÓÍÏÔÒÉÔÅ, ÞÔÏ ÉÚÍÅÎÉÔÓÑ. 113 ÐÏÓÍÏÔÒÉÔÅ, ÞÔÏ ÐÒÏÉÚÏÊÄÅÔ.
107 114
108åÓÌÉ ÐÏÓÉÍ×ÏÌØÎÏÅ ÐÅÒÅÍÅÝÅÎÉÅ ÓÌÉÛËÏÍ ÍÅÄÌÅÎÎÏ, ÷Ù ÍÏÖÅÔÅ Ä×ÉÇÁÔØÓÑ ÐÏ 115åÓÌÉ ÐÏÓÉÍ×ÏÌØÎÏÅ ÐÅÒÅÍÅÝÅÎÉÅ ÓÌÉÛËÏÍ ÍÅÄÌÅÎÎÏ, ÷Ù ÍÏÖÅÔÅ Ä×ÉÇÁÔØÓÑ ÐÏ
109ÓÌÏ×ÁÍ. M-f (META-f) ÐÅÒÅÍÅÝÁÅÔ ×ÐÅÒÅÄ ÎÁ ÓÌÏ×Ï, Á M-b ÎÁÚÁÄ ÎÁ ÓÌÏ×Ï. 116ÓÌÏ×ÁÍ. M-f (META-f) ÐÅÒÅÍÅÝÁÅÔ ×ÐÅÒÅÄ ÎÁ ÓÌÏ×Ï, Á M-b ÎÁÚÁÄ ÎÁ ÓÌÏ×Ï.
@@ -128,8 +135,8 @@ Control-ÓÉÍ×ÏÌÙ ÒÁÂÏÔÁÀÔ Ó ÏÓÎÏ×ÎÙÍÉ ÅÄÉÎÉÃÁÍÉ, ÎÅÚÁ×ÉÓÉÍÏ ÏÔ ÔÏÇÏ, ÞÔÏ ÷Ù
128ÐÅÒÅÍÅÝÁÅÔ ËÕÒÓÏÒ × ÎÁÞÁÌÏ É ËÏÎÅÃ ÓÔÒÏËÉ, Á M-a É M-e ÐÅÒÅÍÅÝÁÅÔ ËÕÒÓÏÒ × 135ÐÅÒÅÍÅÝÁÅÔ ËÕÒÓÏÒ × ÎÁÞÁÌÏ É ËÏÎÅÃ ÓÔÒÏËÉ, Á M-a É M-e ÐÅÒÅÍÅÝÁÅÔ ËÕÒÓÏÒ ×
129ÎÁÞÁÌÏ É ËÏÎÅÃ ÐÒÅÄÌÏÖÅÎÉÑ. 136ÎÁÞÁÌÏ É ËÏÎÅÃ ÐÒÅÄÌÏÖÅÎÉÑ.
130 137
131>> ðÏÐÒÏÂÕÊÔÅ ÎÁÖÁÔØ ÐÁÒÕ ÒÁÚ C-a, É ÐÏÔÏÍ ÐÁÒÕ ÒÁÚ C-e. ðÏÐÒÏÂÕÊÔÅ ÐÁÒÕ 138>> ðÏÐÒÏÂÕÊÔÅ ÎÁÖÁÔØ ÐÁÒÕ ÒÁÚ C-a, Á ÐÏÔÏÍ ÐÁÒÕ ÒÁÚ C-e. ðÏÐÒÏÂÕÊÔÅ ÐÁÒÕ ÒÁÚ
132 ÒÁÚ ÎÁÖÁÔØ M-a, ÐÏÓÌÅ ÜÔÏÇÏ ÐÁÒÕ ÒÁÚ ÎÁÖÁÔØ M-e. 139 ÎÁÖÁÔØ M-a, ÐÏÓÌÅ ÜÔÏÇÏ ÐÁÒÕ ÒÁÚ ÎÁÖÁÔØ M-e.
133 140
134ðÏÓÍÏÔÒÉÔÅ, ÞÔÏ ÐÏ×ÔÏÒ C-a ÎÉÞÅÇÏ ÎÅ ÉÚÍÅÎÑÅÔ, Á ÐÏ×ÔÏÒ M-a ÐÒÏÄÏÌÖÁÅÔ 141ðÏÓÍÏÔÒÉÔÅ, ÞÔÏ ÐÏ×ÔÏÒ C-a ÎÉÞÅÇÏ ÎÅ ÉÚÍÅÎÑÅÔ, Á ÐÏ×ÔÏÒ M-a ÐÒÏÄÏÌÖÁÅÔ
135Ä×ÉÖÅÎÉÅ ËÕÒÓÏÒÁ Ë ÓÌÅÄÕÀÝÅÍÕ ÐÒÅÄÌÏÖÅÎÉÀ. üÔÏ ÎÅ ÓÏÈÒÁÎÑÅÔ ÁÎÁÌÏÇÉÀ, ÎÏ 142Ä×ÉÖÅÎÉÅ ËÕÒÓÏÒÁ Ë ÓÌÅÄÕÀÝÅÍÕ ÐÒÅÄÌÏÖÅÎÉÀ. üÔÏ ÎÅ ÓÏÈÒÁÎÑÅÔ ÁÎÁÌÏÇÉÀ, ÎÏ
@@ -139,7 +146,7 @@ Control-ÓÉÍ×ÏÌÙ ÒÁÂÏÔÁÀÔ Ó ÏÓÎÏ×ÎÙÍÉ ÅÄÉÎÉÃÁÍÉ, ÎÅÚÁ×ÉÓÉÍÏ ÏÔ ÔÏÇÏ, ÞÔÏ ÷Ù
139ËÕÒÓÏÒ ÐÏËÁÚÙ×ÁÅÔ ÍÅÓÔÏ ÎÁ ÜËÒÁÎÅ × ËÁËÏÊ ÔÏÞËÅ ÂÕÄÅÔ ÒÁÓÐÏÌÏÖÅÎ ××ÏÄÉÍÙÊ 146ËÕÒÓÏÒ ÐÏËÁÚÙ×ÁÅÔ ÍÅÓÔÏ ÎÁ ÜËÒÁÎÅ × ËÁËÏÊ ÔÏÞËÅ ÂÕÄÅÔ ÒÁÓÐÏÌÏÖÅÎ ××ÏÄÉÍÙÊ
140ÔÅËÓÔ. 147ÔÅËÓÔ.
141 148
142úÄÅÓØ ÓÏÂÒÁÎÙ ÐÒÏÓÔÙÅ ËÏÍÁÎÄÙ ÐÅÒÅÍÅÝÅÎÉÑ ËÕÒÓÏÒÁ, ×ËÌÀÞÁÑ Ä×ÉÖÅÎÉÅ ÐÏ 149úÄÅÓØ ÓÏÂÒÁÎÙ ÏÓÎÏ×ÎÙÅ ËÏÍÁÎÄÙ ÐÅÒÅÍÅÝÅÎÉÑ ËÕÒÓÏÒÁ, ×ËÌÀÞÁÑ Ä×ÉÖÅÎÉÅ ÐÏ
143ÓÌÏ×ÁÍ É ÐÒÅÄÌÏÖÅÎÉÑÍ: 150ÓÌÏ×ÁÍ É ÐÒÅÄÌÏÖÅÎÉÑÍ:
144 151
145 C-f îÁ ÓÉÍ×ÏÌ ×ÐÅÒÅÄ 152 C-f îÁ ÓÉÍ×ÏÌ ×ÐÅÒÅÄ
@@ -189,10 +196,10 @@ CTRL-ÓÉÍ×ÏÌÙ ÕÄÏÂÎÅÅ É ÂÙÓÔÒÅÅ, ÞÅÍ ËÎÏÐËÉ ÓÏ ÓÔÒÅÌÏÞËÁÍÉ (ÐÏÔÏÍÕ ÞÔÏ ×Ù ÎÅ
189ÐÏ×ÔÏÒÅÎÉÊ ÄÌÑ ËÏÍÁÎÄÙ, ÎÁÖÍÉÔÅ C-u, ÐÏÔÏÍ ÞÉÓÌÏ ÐÏ×ÔÏÒÅÎÉÊ, É ÕËÁÖÉÔÅ 196ÐÏ×ÔÏÒÅÎÉÊ ÄÌÑ ËÏÍÁÎÄÙ, ÎÁÖÍÉÔÅ C-u, ÐÏÔÏÍ ÞÉÓÌÏ ÐÏ×ÔÏÒÅÎÉÊ, É ÕËÁÖÉÔÅ
190ËÏÍÁÎÄÕ. åÓÌÉ Õ ×ÁÓ ÅÓÔØ ËÌÁ×ÉÛÁ META (ÉÌÉ EDIT ÉÌÉ ALT), ÔÏ ÃÉÆÒÏ×ÏÊ 197ËÏÍÁÎÄÕ. åÓÌÉ Õ ×ÁÓ ÅÓÔØ ËÌÁ×ÉÛÁ META (ÉÌÉ EDIT ÉÌÉ ALT), ÔÏ ÃÉÆÒÏ×ÏÊ
191ÁÒÇÕÍÅÎÔ ÍÏÖÎÏ ÚÁÄÁÔØ ÄÒÕÇÉÍ ÓÐÏÓÏÂÏÍ: ÎÁÂÅÒÉÔÅ ÃÉÆÒÙ, ÕÄÅÒÖÉ×ÁÑ ËÌÁ×ÉÛÕ 198ÁÒÇÕÍÅÎÔ ÍÏÖÎÏ ÚÁÄÁÔØ ÄÒÕÇÉÍ ÓÐÏÓÏÂÏÍ: ÎÁÂÅÒÉÔÅ ÃÉÆÒÙ, ÕÄÅÒÖÉ×ÁÑ ËÌÁ×ÉÛÕ
192META. íÙ ÒÅËÏÍÅÎÄÕÅÍ ÏÓ×ÏÉÔØ ÉÓÐÏÌØÚÏ×ÁÎÉÅ C-u, ÐÏÓËÏÌØËÕ ÜÔÁ 199META. íÙ ÒÅËÏÍÅÎÄÕÅÍ ÐÒÉ×ÙËÎÕÔØ Ë ÉÓÐÏÌØÚÏ×ÁÎÉÀ C-u, ÐÏÓËÏÌØËÕ ÜÔÏ ÓÏÞÅÔÁÎÉÅ
193ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔØ ËÌÁ×ÉÛ ÒÁÂÏÔÁÅÔ ÎÁ ÌÀÂÏÍ ÔÅÒÍÉÎÁÌÅ. þÉÓÌÏ×ÏÊ ÁÒÇÕÍÅÎÔ 200ËÌÁ×ÉÛ ÒÁÂÏÔÁÅÔ ÎÁ ÌÀÂÏÍ ÔÅÒÍÉÎÁÌÅ. þÉÓÌÏ×ÏÊ ÁÒÇÕÍÅÎÔ ÔÁËÖÅ ÎÁÚÙ×ÁÅÔÓÑ
194ÔÁËÖÅ ÎÁÚÙ×ÁÅÔÓÑ "ÐÒÅÆÉËÓÎÙÍ ÁÒÇÕÍÅÎÔÏÍ", ÐÏÓËÏÌØËÕ ×Ù ÎÁÂÉÒÁÅÔÅ ÁÒÇÕÍÅÎÔ ÄÏ 201"ÐÒÅÆÉËÓÎÙÍ ÁÒÇÕÍÅÎÔÏÍ", ÐÏÓËÏÌØËÕ ×Ù ÚÁÄÁÅÔÅ ÁÒÇÕÍÅÎÔ ÄÏ ×ÙÐÏÌÎÅÎÉÑ
195×ÙÐÏÌÎÅÎÉÑ ËÏÍÁÎÄÙ. 202ËÏÍÁÎÄÙ.
196 203
197îÁÐÒÉÍÅÒ, C-u 8 C-f ÐÅÒÅÍÅÓÔÉÔ ËÕÒÓÏÒ ÎÁ ×ÏÓÅÍØ ÓÉÍ×ÏÌÏ× ×ÐÅÒÅÄ. 204îÁÐÒÉÍÅÒ, C-u 8 C-f ÐÅÒÅÍÅÓÔÉÔ ËÕÒÓÏÒ ÎÁ ×ÏÓÅÍØ ÓÉÍ×ÏÌÏ× ×ÐÅÒÅÄ.
198 205
@@ -201,9 +208,9 @@ META. íÙ ÒÅËÏÍÅÎÄÕÅÍ ÏÓ×ÏÉÔØ ÉÓÐÏÌØÚÏ×ÁÎÉÅ C-u, ÐÏÓËÏÌØËÕ ÜÔÁ
201 208
202íÎÏÇÉÅ ËÏÍÁÎÄÙ ÉÓÐÏÌØÚÕÀÔ ÞÉÓÌÏ×ÏÊ ÁÒÇÕÍÅÎÔ ËÁË ÓÞÅÔÞÉË ÐÏ×ÔÏÒÅÎÉÊ, ÎÏ 209íÎÏÇÉÅ ËÏÍÁÎÄÙ ÉÓÐÏÌØÚÕÀÔ ÞÉÓÌÏ×ÏÊ ÁÒÇÕÍÅÎÔ ËÁË ÓÞÅÔÞÉË ÐÏ×ÔÏÒÅÎÉÊ, ÎÏ
203ÎÅËÏÔÏÒÙÅ ËÏÍÁÎÄÙ ÉÓÐÏÌØÚÕÀÔ ÅÇÏ ÄÒÕÇÉÍ ÓÐÏÓÏÂÏÍ. îÅËÏÔÏÒÙÅ ËÏÍÁÎÄÙ (ÎÏ ÎÉ 210ÎÅËÏÔÏÒÙÅ ËÏÍÁÎÄÙ ÉÓÐÏÌØÚÕÀÔ ÅÇÏ ÄÒÕÇÉÍ ÓÐÏÓÏÂÏÍ. îÅËÏÔÏÒÙÅ ËÏÍÁÎÄÙ (ÎÏ ÎÉ
204ÏÄÎÁ ÉÚ ÎÉÈ ÎÅ ÂÙÌÁ ÅÝÅ ÉÚÕÞÅÎÁ ÚÄÅÓØ) ÉÓÐÏÌØÚÕÀÔ ÅÇÏ ËÁË ÆÌÁÇ -- ÎÁÌÉÞÉÅ 211ÏÄÎÁ ÉÚ ÎÉÈ ÎÅ ÂÙÌÁ ÅÝÅ ÏÐÉÓÁÎÁ × ÄÁÎÎÏÍ ÔÅËÓÔÅ) ÉÓÐÏÌØÚÕÀÔ ÅÇÏ ËÁË ÆÌÁÇ --
205ÐÒÅÆÉËÓÎÏÇÏ ÁÒÇÕÍÅÎÔÁ ×ÎÅ ÚÁ×ÉÓÉÍÏÓÔÉ ÏÔ ÅÇÏ ÚÎÁÞÅÎÉÑ, ÉÚÍÅÎÑÅÔ ÐÏ×ÅÄÅÎÉÅ 212ÎÁÌÉÞÉÅ ÐÒÅÆÉËÓÎÏÇÏ ÁÒÇÕÍÅÎÔÁ ×ÎÅ ÚÁ×ÉÓÉÍÏÓÔÉ ÏÔ ÅÇÏ ÚÎÁÞÅÎÉÑ, ÉÚÍÅÎÑÅÔ
206ËÏÍÁÎÄÙ. 213ÐÏ×ÅÄÅÎÉÅ ËÏÍÁÎÄÙ.
207 214
208äÒÕÇÉÍ ×ÉÄÏÍ ÉÓËÌÀÞÅÎÉÊ Ñ×ÌÑÀÔÓÑ ËÌÀÞÉ C-v É M-v. ðÒÉ ÐÏÌÕÞÅÎÉÉ ÞÉÓÌÏ×ÏÇÏ 215äÒÕÇÉÍ ×ÉÄÏÍ ÉÓËÌÀÞÅÎÉÊ Ñ×ÌÑÀÔÓÑ ËÌÀÞÉ C-v É M-v. ðÒÉ ÐÏÌÕÞÅÎÉÉ ÞÉÓÌÏ×ÏÇÏ
209ÁÒÇÕÍÅÎÔÁ, ÏÎÉ ÐÒÏËÒÕÞÉ×ÁÀÔ ÜËÒÁÎ ××ÅÒÈ ÉÌÉ ×ÎÉÚ ÎÁ ÕËÁÚÁÎÎÏÅ ÞÉÓÌÏ ÓÔÒÏË, 216ÁÒÇÕÍÅÎÔÁ, ÏÎÉ ÐÒÏËÒÕÞÉ×ÁÀÔ ÜËÒÁÎ ××ÅÒÈ ÉÌÉ ×ÎÉÚ ÎÁ ÕËÁÚÁÎÎÏÅ ÞÉÓÌÏ ÓÔÒÏË,
@@ -215,9 +222,10 @@ META. íÙ ÒÅËÏÍÅÎÄÕÅÍ ÏÓ×ÏÉÔØ ÉÓÐÏÌØÚÏ×ÁÎÉÅ C-u, ÐÏÓËÏÌØËÕ ÜÔÁ
215üÔÁ ËÏÍÁÎÄÁ ÄÏÌÖÎÁ ÐÒÏËÒÕÔÉÔØ ÜËÒÁÎ ÎÁ 8 ÓÔÒÏË ××ÅÒÈ. åÓÌÉ ×Ù ÈÏÔÉÔÅ 222üÔÁ ËÏÍÁÎÄÁ ÄÏÌÖÎÁ ÐÒÏËÒÕÔÉÔØ ÜËÒÁÎ ÎÁ 8 ÓÔÒÏË ××ÅÒÈ. åÓÌÉ ×Ù ÈÏÔÉÔÅ
216ÐÒÏËÒÕÔÉÔØ ÅÇÏ ×ÎÉÚ, ÍÏÖÅÔÅ ÚÁÄÁÔØ ÁÒÇÕÍÅÎÔ ÄÌÑ M-v. 223ÐÒÏËÒÕÔÉÔØ ÅÇÏ ×ÎÉÚ, ÍÏÖÅÔÅ ÚÁÄÁÔØ ÁÒÇÕÍÅÎÔ ÄÌÑ M-v.
217 224
218åÓÌÉ ×Ù ÉÓÐÏÌØÚÕÅÔÅ ÏËÏÎÎÕÀ ÓÉÓÔÅÍÕ, ÔÁËÕÀ ËÁË X11 ÉÌÉ MS-Windows, ÄÏÌÖÎÁ 225åÓÌÉ ×Ù ÉÓÐÏÌØÚÕÅÔÅ ÏËÏÎÎÕÀ ÓÉÓÔÅÍÕ, ÔÁËÕÀ ËÁË X11 ÉÌÉ MS-Windows, ÔÏ ÄÏÌÖÎÁ
219ÂÙÔØ ÐÒÑÍÏÕÇÏÌØÎÁÑ ÏÂÌÁÓÔØ, ÉÍÅÎÕÅÍÁÑ ÐÏÌÏÓÏÊ ÐÒÏËÒÕÔËÉ Ó ÌÅ×ÏÊ ÓÔÏÒÏÎÙ ÏËÎÁ 226ÂÙÔØ ×ÉÄÎÁ ÐÒÑÍÏÕÇÏÌØÎÁÑ ÏÂÌÁÓÔØ, ÉÍÅÎÕÅÍÁÑ ÐÏÌÏÓÏÊ ÐÒÏËÒÕÔËÉ, ËÏÔÏÒÁÑ ×ÉÄÎÁ
220Emacs. ÷Ù ÍÏÖÅÔÅ ÐÒÏËÒÕÞÉ×ÁÔØ ÔÅËÓÔ, ÉÓÐÏÌØÚÕÑ ÍÁÎÉÐÕÌÑÔÏÒ ÍÙÛØ. 227Ó ÌÅ×ÏÊ ÓÔÏÒÏÎÙ ÏËÎÁ Emacs. ÷Ù ÍÏÖÅÔÅ ÐÒÏËÒÕÞÉ×ÁÔØ ÔÅËÓÔ, ÉÓÐÏÌØÚÕÑ
228ÍÁÎÉÐÕÌÑÔÏÒ ÍÙÛØ.
221 229
222>> ðÏÐÒÏÂÕÊÔÅ ÐÅÒÅÍÅÝÁÔØ ÍÙÛØ ÐÒÉ ÎÁÖÁÔÏÊ ÓÒÅÄÎÅÊ ËÎÏÐËÅ ÍÙÛÉ. ÷Ù Õ×ÉÄÉÔÅ 230>> ðÏÐÒÏÂÕÊÔÅ ÐÅÒÅÍÅÝÁÔØ ÍÙÛØ ÐÒÉ ÎÁÖÁÔÏÊ ÓÒÅÄÎÅÊ ËÎÏÐËÅ ÍÙÛÉ. ÷Ù Õ×ÉÄÉÔÅ
223 ËÁË ÔÅËÓÔ ÐÒÏËÒÕÞÉ×ÁÅÔÓÑ ××ÅÒÈ É ×ÎÉÚ. 231 ËÁË ÔÅËÓÔ ÐÒÏËÒÕÞÉ×ÁÅÔÓÑ ××ÅÒÈ É ×ÎÉÚ.
@@ -226,163 +234,174 @@ Emacs. ÷Ù ÍÏÖÅÔÅ ÐÒÏËÒÕÞÉ×ÁÔØ ÔÅËÓÔ, ÉÓÐÏÌØÚÕÑ ÍÁÎÉÐÕÌÑÔÏÒ ÍÙÛØ.
226* õðòá÷ìåîéå ëõòóïòïí îá X-ôåòíéîáìå 234* õðòá÷ìåîéå ëõòóïòïí îá X-ôåòíéîáìå
227------------------------------------ 235------------------------------------
228 236
229åÓÌÉ Õ ×ÁÓ X-ÔÅÒÍÉÎÁÌ, ÔÏ ×ÁÍ, ×ÅÒÏÑÔÎÏ, ÄÌÑ ÕÐÒÁ×ÌÅÎÉÑ ËÕÒÓÏÒÏÍ ÐÏËÁÖÅÔÓÑ 237åÓÌÉ Õ ×ÁÓ X-ÔÅÒÍÉÎÁÌ, ÔÏ ÄÌÑ ÕÐÒÁ×ÌÅÎÉÑ ËÕÒÓÏÒÏÍ, ×ÁÍ ×ÅÒÏÑÔÎÏ ÐÏËÁÖÅÔÓÑ
230ÂÏÌÅÅ ÌÅÇËÉÍ ÉÓÐÏÌØÚÏ×ÁÔØ ËÌÁ×ÉÛÉ ÎÁ ÃÉÆÒÏ×ÏÊ ËÌÁ×ÉÁÔÕÒÅ (ÓÐÒÁ×Á). óÔÒÅÌËÉ 238ÂÏÌÅÅ ÌÅÇËÉÍ ÉÓÐÏÌØÚÏ×ÁÎÉÅ ËÌÁ×ÉÛ ËÕÒÓÏÒÁ ÎÁ ÃÉÆÒÏ×ÏÊ ËÌÁ×ÉÁÔÕÒÅ
231×ÌÅ×Ï, ×ÐÒÁ×Ï, ××ÅÒÈ É ×ÎÉÚ ÐÅÒÅÄ×ÉÇÁÀÔ ËÕÒÓÏÒ × ÏÖÉÄÁÅÍÏÍ ÎÁÐÒÁ×ÌÅÎÉÉ; ÏÎÉ 239(ÓÐÒÁ×Á). óÔÒÅÌËÉ ×ÌÅ×Ï, ×ÐÒÁ×Ï, ××ÅÒÈ É ×ÎÉÚ ÐÅÒÅÄ×ÉÇÁÀÔ ËÕÒÓÏÒ ×
232ÒÁÂÏÔÁÀÔ ÔÏÞÎÏ ÔÁËÖÅ ËÁË C-b, C-f, C-p É C-n, ÎÏ ÌÅÇÞÅ × ÎÁÂÏÒÅ É 240ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÍ ÎÁÐÒÁ×ÌÅÎÉÉ -- ÏÎÉ ÒÁÂÏÔÁÀÔ ÔÏÞÎÏ ÔÁËÖÅ ËÁË C-b, C-f, C-p É
233ÚÁÐÏÍÉÎÁÎÉÉ. ÷Ù ÔÁË ÖÅ ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ ÓÏÞÅÔÁÎÉÑ C-left É C-right ÄÌÑ 241C-n, ÎÏ ÌÅÇÞÅ × ÎÁÂÏÒÅ É ÚÁÐÏÍÉÎÁÎÉÉ. ÷Ù ÔÁË ÖÅ ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ
234ÐÅÒÅÄ×ÉÖÅÎÉÑ ÐÏ ÓÌÏ×ÁÍ, É C-up É C-down ÄÌÑ ÐÅÒÅÄ×ÉÖÅÎÉÑ ÐÏ ÂÌÏËÁÍ (Ô.Å. 242ÓÏÞÅÔÁÎÉÑ C-left É C-right ÄÌÑ ÐÅÒÅÄ×ÉÖÅÎÉÑ ÐÏ ÓÌÏ×ÁÍ, É C-up É C-down ÄÌÑ
235ÐÁÒÁÇÒÁÆÁÍ, ÅÓÌÉ ×Ù ÒÅÄÁËÔÉÒÕÅÔÅ ÔÅËÓÔ). åÓÌÉ Õ ×ÁÓ ÅÓÔØ ËÎÏÐËÉ ÐÏÍÅÞÅÎÎÙÅ 243ÐÅÒÅÄ×ÉÖÅÎÉÑ ÐÏ ÂÌÏËÁÍ (Ô.Å. ÐÁÒÁÇÒÁÆÁÍ, ÅÓÌÉ ×Ù ÒÅÄÁËÔÉÒÕÅÔÅ ÔÅËÓÔ). åÓÌÉ
236HOME (ÉÌÉ BEGIN) ÉÌÉ END, ÔÏ ÏÎÉ ÂÕÄÕÔ ÐÅÒÅÍÅÝÁÔØ ËÕÒÓÏÒ × ÎÁÞÁÌÏ É ËÏÎÅà 244Õ ×ÁÓ ÅÓÔØ ËÎÏÐËÉ ÐÏÍÅÞÅÎÎÙÅ HOME (ÉÌÉ BEGIN) É/ÉÌÉ END, ÔÏ ÏÎÉ ÂÕÄÕÔ
237ÓÔÒÏËÉ, ÓÏÏÔ×ÅÔÓÔ×ÅÎÎÏ, É C-home É C-end ÂÕÄÕÔ ÐÅÒÅÍÅÝÁÔØ × ÎÁÞÁÌÏ É ËÏÎÅà 245ÐÅÒÅÍÅÝÁÔØ ËÕÒÓÏÒ × ÎÁÞÁÌÏ É ËÏÎÅà ÓÔÒÏËÉ, Á C-home É C-end ÂÕÄÕÔ ÐÅÒÅÍÅÝÁÔØ
238ÆÁÊÌÁ. åÓÌÉ ÎÁ ×ÁÛÅÊ ËÌÁ×ÉÁÔÕÒÅ ÅÓÔØ ËÎÏÐËÉ PgUp É PgDn, ÔÏ ×Ù ÍÏÖÅÔÅ ÉÈ 246× ÎÁÞÁÌÏ É ËÏÎÅà ÆÁÊÌÁ. åÓÌÉ ÎÁ ×ÁÛÅÊ ËÌÁ×ÉÁÔÕÒÅ ÅÓÔØ ËÎÏÐËÉ PgUp É PgDn,
239ÉÓÐÏÌØÚÏ×ÁÔØ ÄÌÑ ÐÅÒÅÍÅÝÅÎÉÑ ××ÅÒÈ É ×ÎÉÚ ÐÏÜËÒÁÎÎÏ, ÔÁËÖÅ ËÁË É M-v É C-v. 247ÔÏ ×Ù ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ ÉÈ ÄÌÑ ÐÅÒÅÍÅÝÅÎÉÑ ××ÅÒÈ É ×ÎÉÚ ÐÏÓÔÒÁÎÉÞÎÏ,
240 248ÁÎÁÌÏÇÉÞÎÏ ÉÓÐÏÌØÚÏ×ÁÎÉÀ M-v É C-v.
241÷ÓÅ ÜÔÉ ËÏÍÁÎÄÙ ÍÏÇÕÔ ÐÏÌÕÞÁÔØ ÃÉÆÒÏ×ÏÊ ÁÒÇÕÍÅÎÔ, ËÁË ÒÁÓÓËÁÚÁÎÏ ×ÙÛÅ. ÷Ù 249
242ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ ÕÓËÏÒÅÎÎÙÊ ÓÐÏÓÏ ××ÏÄÁ ÜÔÏÇÏ ÁÒÇÕÍÅÎÔÁ: ÐÒÏÓÔÏ ÎÁÖÍÉÔÅ 250÷ÓÅ ÜÔÉ ËÏÍÁÎÄÙ ÍÏÇÕÔ ÉÓÐÏÌØÚÏ×ÁÔØ ÃÉÆÒÏ×ÏÊ ÁÒÇÕÍÅÎÔ, ÔÁË, ËÁË Ï ÜÔÏÍ
243CONTROL ÉÌÉ META É ÎÁÂÅÒÉÔÅ ÞÉÓÌÏ. îÁÐÒÉÍÅÒ, ÄÌÑ ÐÅÒÅÍÅÝÅÎÉÑ ÎÁ 12 ÓÌÏ× 251ÒÁÓÓËÁÚÁÎÏ ×ÙÛÅ. ÷Ù ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ ÕÓËÏÒÅÎÎÙÊ ÓÐÏÓÏ ××ÏÄÁ ÜÔÏÇÏ
244×ÐÒÁ×Ï, ÎÁÂÅÒÉÔÅ C-1 C-2 C-right. úÁÐÏÍÎÉÔÅ ÞÔÏ ÔÁË ÏÞÅÎØ ÌÅÇËÏ ÎÁÂÉÒÁÔØ, 252ÁÒÇÕÍÅÎÔÁ: ÐÒÏÓÔÏ ÎÁÖÍÉÔÅ CONTROL ÉÌÉ META É ÎÁÂÅÒÉÔÅ ÞÉÓÌÏ. îÁÐÒÉÍÅÒ, ÄÌÑ
245ÐÏÔÏÍÕ ÞÔÏ ×Ù ÎÅ ÏÔÐÕÓËÁÅÔÅ ËÎÏÐËÕ CONTROL ÍÅÖÄÕ ÎÁÖÁÔÉÑÍÉ. 253ÐÅÒÅÍÅÝÅÎÉÑ ÎÁ 12 ÓÌÏ× ×ÐÒÁ×Ï, ÎÁÂÅÒÉÔÅ C-1 C-2 C-right. úÁÐÏÍÎÉÔÅ ÞÔÏ ÔÁË
254ÏÞÅÎØ ÌÅÇËÏ ÎÁÂÉÒÁÔØ, ÐÏÔÏÍÕ ÞÔÏ ×Ù ÎÅ ÏÔÐÕÓËÁÅÔÅ ËÎÏÐËÕ CONTROL ÍÅÖÄÕ
255ÎÁÖÁÔÉÑÍÉ.
246 256
247 257
248* åóìé EMACS úá÷éó 258* åóìé EMACS úá÷éó
249------------------ 259------------------
250 260
251åÓÌÉ Emacs ÐÅÒÅÓÔÁÌ ÒÅÁÇÉÒÏ×ÁÔØ ÎÁ ×ÁÛÉ ËÏÍÁÎÄÙ, ×Ù ÍÏÖÅÔÅ ÏÓÔÁÎÏ×ÉÔØ ÜÔÏ, 261åÓÌÉ Emacs ÐÅÒÅÓÔÁÌ ÒÅÁÇÉÒÏ×ÁÔØ ÎÁ ×ÁÛÉ ËÏÍÁÎÄÙ, ÔÏ ×Ù ÍÏÖÅÔÅ ÉÚÂÅÖÁÔØ ÜÔÏÇÏ
252ÐÒÏÓÔÏ ÎÁÖÁ× C-g. ÷Ù ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ C-g, ÞÔÏÂÙ ÏÓÔÁÎÏ×ÉÔØ ×ÙÐÏÌÎÅÎÉÅ 262ÐÒÏÓÔÏ ÎÁÖÁ× C-g. ÷Ù ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ C-g, ÞÔÏÂÙ ÏÓÔÁÎÏ×ÉÔØ ×ÙÐÏÌÎÅÎÉÅ
253ËÏÍÁÎÄÙ, ËÏÔÏÒÁÑ ÓÌÉÛËÏÍ ÄÏÌÇÏ ×ÙÐÏÌÎÑÅÔÓÑ. 263ËÏÍÁÎÄ, ËÏÔÏÒÙÅ ÓÌÉÛËÏÍ ÄÏÌÇÏ ×ÙÐÏÌÎÑÀÔÓÑ.
254 264
255÷Ù ÔÁËÖÅ ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ C-g ÄÌÑ ÏÔÍÅÎÙ ÃÉÆÒÏ×ÏÇÏ ÁÒÇÕÍÅÎÔÁ ÉÌÉ ÎÁÞÁÔÏÊ 265÷Ù ÔÁËÖÅ ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ C-g ÄÌÑ ÏÔÍÅÎÙ ÎÁÂÒÁÎÎÏÇÏ ÃÉÆÒÏ×ÏÇÏ ÁÒÇÕÍÅÎÔÁ
256ËÏÍÁÎÄÙ, ËÏÔÏÒÕÀ ×Ù ÎÅ ÈÏÔÉÔÅ ÚÁ×ÅÒÛÁÔØ. 266ÉÌÉ ËÏÍÁÎÄÙ, ËÏÔÏÒÁÑ ÎÁÞÁÌÁ ×ÙÐÏÌÎÑÔØÓÑ, ÎÏ ËÏÔÏÒÕÀ ×Ù ÎÅ ÈÏÔÉÔÅ ÚÁ×ÅÒÛÁÔØ.
257 267
258>> îÁÂÅÒÉÔÅ C-u 100 ÄÌÑ ÚÁÄÁÎÉÑ ÁÒÇÕÍÅÎÔÁ 100, ÐÏÔÏÍ ÎÁÖÍÉÔÅ C-g. ôÅÐÅÒØ 268>> îÁÂÅÒÉÔÅ C-u 100 ÄÌÑ ÚÁÄÁÎÉÑ ÁÒÇÕÍÅÎÔÁ 100, ÐÏÔÏÍ ÎÁÖÍÉÔÅ C-g. ôÅÐÅÒØ
259 ÎÁÖÍÉÔÅ C-f. ëÕÒÓÏÒ ÄÏÌÖÅÎ ÐÅÒÅÍÅÓÔÉÔØÓÑ ×ÓÅÇÏ ÎÁ ÏÄÉÎ ÓÉÍ×ÏÌ, ÐÏÔÏÍÕ ÞÔÏ 269 ÎÁÖÍÉÔÅ C-f. ëÕÒÓÏÒ ÄÏÌÖÅÎ ÐÅÒÅÍÅÓÔÉÔØÓÑ ×ÓÅÇÏ ÎÁ ÏÄÉÎ ÓÉÍ×ÏÌ, ÐÏÔÏÍÕ ÞÔÏ
260 ×Ù ÏÔÍÅÎÉÌÉ ÁÒÇÕÍÅÎÔ ÎÁÖÁÔÉÅÍ C-g. 270 ×Ù ÏÔÍÅÎÉÌÉ ÁÒÇÕÍÅÎÔ ÎÁÖÁÔÉÅÍ C-g.
261 271
262åÓÌÉ ×Ù ÎÁÖÁÌÉ <ESC> ÐÏ ÏÛÉÂËÅ, ×Ù ÔÁË ÖÅ ÍÏÖÅÔÅ ÉÚÂÁ×ÉÔØÓÑ ÏÔ ÜÔÏÇÏ 272åÓÌÉ ×Ù ÎÁÖÁÌÉ <ESC> ÐÏ ÏÛÉÂËÅ, ÔÏ ×Ù ÔÁË ÖÅ ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ C-g ÞÔÏÂÙ
263ÎÁÖÁÔÉÅÍ C-g. 273ÉÚÂÅÖÁÔØ ×ÏÚÄÅÊÓÔ×ÉÑ ÄÁÎÎÏÊ ËÏÍÁÎÄÙ.
264 274
265 275
266* úáðòåýåîîùå ëïíáîäù (DISABLED COMMANDS) 276* úáðòåýåîîùå ëïíáîäù (DISABLED COMMANDS)
267----------------------------------------- 277-----------------------------------------
268 278
269îÅËÏÔÏÒÙÅ ËÏÍÁÎÄÙ Emacs "ÚÁÐÒÅÝÅÎÙ", ÐÏÓËÏÌØËÕ ÎÁÞÉÎÁÀÝÉÅ ÐÏÌØÚÏ×ÁÔÅÌÉ ÍÏÇÕÔ 279îÅËÏÔÏÒÙÅ ËÏÍÁÎÄÙ Emacs "ÚÁÐÒÅÝÅÎÙ", ÐÏÓËÏÌØËÕ ÎÁÞÉÎÁÀÝÉÅ ÐÏÌØÚÏ×ÁÔÅÌÉ ÍÏÇÕÔ
270ÉÈ ÓÌÕÞÁÊÎÏ ÉÓÐÏÌØÚÏ×ÁÔØ. 280ÓÌÕÞÁÊÎÏ ÉÓÐÏÌØÚÏ×ÁÔØ ÉÈ ÄÌÑ ÓÏ×ÅÒÛÅÎÉÑ ÏÐÁÓÎÙÈ ÄÅÊÓÔ×ÉÊ.
271 281
272åÓÌÉ ×Ù ÎÁÂÒÁÌÉ ÏÄÎÕ ÉÚ ÚÁÐÒÅÝÅÎÎÙÈ ËÏÍÁÎÄ, ÔÏ Emacs ÐÏËÁÖÅÔ ÓÏÏÂÝÅÎÉÅ 282åÓÌÉ ×Ù ÎÁÂÒÁÌÉ ÏÄÎÕ ÉÚ ÚÁÐÒÅÝÅÎÎÙÈ ËÏÍÁÎÄ, ÔÏ Emacs ÐÏËÁÖÅÔ ÓÏÏÂÝÅÎÉÅ
273ÇÏ×ÏÒÑÝÅÅ Ï ÔÏÍ, ËÁËÁÑ ËÏÍÁÎÄÁ ×ÙÚÙ×ÁÅÔÓÑ, É ÓÐÒÏÓÉÔ, ÈÏÔÉÔÅ ÌÉ ×Ù 283ÇÏ×ÏÒÑÝÅÅ Ï ÔÏÍ, ËÁËÁÑ ËÏÍÁÎÄÁ ×ÙÚÙ×ÁÅÔÓÑ, É ÚÁÐÒÏÓÉÔ Õ ×ÁÓ, ÈÏÔÉÔÅ ÌÉ ×Ù
274ÐÒÏÄÏÌÖÉÔØ É ×ÙÐÏÌÎÉÔØ ÜÔÕ ËÏÍÁÎÄÕ. 284ÐÒÏÄÏÌÖÁÔØ ÒÁÂÏÔÕ É ×ÙÐÏÌÎÑÔØ ÄÁÎÎÕÀ ËÏÍÁÎÄÕ.
275 285
276åÓÌÉ ×Ù ÄÅÊÓÔ×ÉÔÅÌØÎÏ ÈÏÔÉÔÅ ÐÏÐÒÏÂÏ×ÁÔØ ×ÙÐÏÌÎÉÔØ ËÏÍÁÎÄÕ, ÔÏ ÎÁÖÍÉÔÅ 286åÓÌÉ ×Ù ÄÅÊÓÔ×ÉÔÅÌØÎÏ ÐÏÐÒÏÂÏ×ÁÔØ ×ÙÐÏÌÎÉÔØ ËÏÍÁÎÄÕ, ÔÏ ÎÁÖÍÉÔÅ ËÌÁ×ÉÛÕ
277ËÌÁ×ÉÛÕ ðÒÏÂÅÌ (Space) × ÏÔ×ÅÔ ÎÁ ÜÔÏÔ ×ÏÐÒÏÓ. ïÂÙÞÎÏ, ÅÓÌÉ ×Ù ÎÅ ÈÏÔÉÔÅ 287<SPC> ÒÏÂÅÌ) × ÏÔ×ÅÔ ÎÁ ÚÁÄÁÎÎÙÊ ×ÏÐÒÏÓ. ïÂÙÞÎÏ, ÅÓÌÉ ×Ù ÎÅ ÈÏÔÉÔÅ
278×ÙÐÏÌÎÑÔØ ÚÁÐÒÅÝÅÎÎÕÀ ËÏÍÁÎÄÕ, ÔÏ ÏÔ×ÅÞÁÊÔÅ ÎÁ ×ÏÐÒÏÓ ÎÁÖÁÔÉÅÍ ËÌÁ×ÉÛÉ "n". 288×ÙÐÏÌÎÑÔØ ÚÁÐÒÅÝÅÎÎÕÀ ËÏÍÁÎÄÕ, ÔÏ ÏÔ×ÅÔØÔÅ ÎÁ ×ÏÐÒÏÓ ÎÁÖÁÔÉÅÍ ËÌÁ×ÉÛÉ "n".
279 289
280>> îÁÖÍÉÔÅ `C-x C-l' (×ÙËÌÀÞÅÎÎÁÑ ËÏÍÁÎÄÁ), ÐÏÔÏÍ ÏÔ×ÅÔØÔÅ "n" ÎÁ ×ÏÐÒÏÓ. 290>> îÁÖÍÉÔÅ `C-x C-l' (×ÙËÌÀÞÅÎÎÁÑ ËÏÍÁÎÄÁ), Á ÐÏÔÏÍ ÏÔ×ÅÔØÔÅ "n" ÎÁ ÚÁÄÁÎÎÙÊ
291 ×ÏÐÒÏÓ.
281 292
282 293
283* ïëîá 294* ïëîá
284------ 295------
285 296
286Emacs ÍÏÖÅÔ ÉÍÅÔØ ÎÅÓËÏÌØËÏ ÏËÏÎ, ËÁÖÄÏÅ ÉÚ ËÏÔÏÒÙÈ ÏÔÏÂÒÁÖÁÅÔ Ó×ÏÊ ÔÅËÓÔ. 297Emacs ÍÏÖÅÔ ÏÔÏÂÒÁÖÁÔØ ÉÎÆÏÒÍÁÃÉÀ × ÎÅÓËÏÌØËÉÈ ÏËÎÁÈ, ËÁÖÄÏÅ ÉÚ ËÏÔÏÒÙÈ
287íÙ ÏÂßÑÓÎÉÍ ÐÏÚÖÅ ËÁË ÉÓÐÏÌØÚÏ×ÁÔØ ÍÎÏÖÅÓÔ×Ï ÏËÏÎ. ðÒÑÍÏ ÓÅÊÞÁÓ ÍÙ ÈÏÔÉÍ 298ÏÔÏÂÒÁÖÁÅÔ Ó×ÏÊ ÔÅËÓÔ. ðÏÚÖÅ ÍÙ ÏÂßÑÓÎÉÍ ËÁË ÒÁÂÏÔÁÔØ Ó ÎÅÓËÏÌØËÉÍÉ ÏËÎÁÍÉ.
288ÏÂßÑÓÎÉÔØ ËÁË ÉÚÂÁ×ÌÑÔØÓÑ ÏÔ ÌÉÛÎÉÈ ÏËÏÎ É ×ÅÒÎÕÔØÓÑ Ë ÒÅÄÁËÔÉÒÏ×ÁÎÉÀ × 299ðÒÑÍÏ ÓÅÊÞÁÓ ÍÙ ÈÏÔÉÍ ÏÂßÑÓÎÉÔØ ×ÁÍ ËÁË ÉÚÂÁ×ÌÑÔØÓÑ ÏÔ ÌÉÛÎÉÈ ÏËÏÎ É
289ÏÄÎÏÍ ÏËÎÅ. ÷ÙÐÏÌÎÉÔØ ÜÔÏ ÏÞÅÎØ ÐÒÏÓÔÏ: 300×ÅÒÎÕÔØÓÑ Ë ÒÅÄÁËÔÉÒÏ×ÁÎÉÀ × ÏÄÎÏÍ ÏËÎÅ. üÔÏ ÏÞÅÎØ ÐÒÏÓÔÏ ÓÄÅÌÁÔØ:
290 301
291 C-x 1 ïÄÎÏ ÏËÎÏ. (ÚÁËÒÙÔØ ×ÓÅ ÄÒÕÇÉÅ ÏËÎÁ). 302 C-x 1 ïÄÎÏ ÏËÎÏ. (ÚÁËÒÙÔØ ×ÓÅ ÄÒÕÇÉÅ ÏËÎÁ).
292 303
293üÔÏ CONTROL-x ÓÏ ÓÌÅÄÕÀÝÅÊ ÃÉÆÒÏÊ 1. C-x 1 ÒÁÚ×ÅÒÎÅÔ ÏËÎÏ, ËÏÔÏÒÏÅ ÓÏÄÅÒÖÉÔ 304üÔÏ CONTROL-x ÓÏ ÓÌÅÄÕÀÝÅÊ ÃÉÆÒÏÊ 1. C-x 1 ÒÁÚ×ÅÒÎÅÔ ÏËÎÏ, ËÏÔÏÒÏÅ ÓÏÄÅÒÖÉÔ
294ËÕÒÓÏÒ, ÔÁË, ÞÔÏÂÙ ÏÎÏ ÚÁÎÑÌÏ ×ÅÓØ ÜËÒÁÎ. ðÒÉ ÜÔÏÍ ÂÕÄÕÔ ÕÄÁÌÅÎÙ ×ÓÅ 305ËÕÒÓÏÒ, ÔÁË, ÞÔÏÂÙ ÏÎÏ ÚÁÎÑÌÏ ×ÅÓØ ÜËÒÁÎ. ðÒÉ ÜÔÏÍ ÂÕÄÕÔ ÕÄÁÌÅÎÙ ×ÓÅ
295ÏÓÔÁÌØÎÙÅ ÏËÎÁ. 306ÏÓÔÁÌØÎÙÅ ÏËÎÁ.
296 307
297>> ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ÎÁ ÜÔÕ ÓÔÒÏËÕ É ÎÁÖÍÉÔÅ C-u 0 C-l. 308>> ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ÎÁ ÜÔÕ ÓÔÒÏËÕ É ÎÁÖÍÉÔÅ C-u 0 C-l.
298 309
299>> îÁÂÅÒÉÔÅ CONTROL-h k CONTROL-f. 310>> îÁÂÅÒÉÔÅ CONTROL-h k CONTROL-f.
300 ðÏÓÍÏÔÒÉÔÅ, ËÁË ÔÅËÕÝÅÅ ÏËÎÏ ÓÏÖÍÅÔÓÑ, ËÏÇÄÁ ÎÏ×ÏÅ 311 ðÏÓÍÏÔÒÉÔÅ, ËÁË ÔÅËÕÝÅÅ ÏËÎÏ ÓÏÖÍÅÔÓÑ, ËÏÇÄÁ ÎÏ×ÏÅ ÐÏÑ×ÉÔÓÑ É ÏÔÏÂÒÁÚÉÔ
301 ÐÏÑ×ÉÔÓÑ É ÏÔÏÂÒÁÚÉÔ ÄÏËÕÍÅÎÔÁÃÉÀ ÎÁ ËÏÍÁÎÄÕ CONTROL-f. 312 ÄÏËÕÍÅÎÔÁÃÉÀ ÎÁ ÓÏÞÅÔÁÎÉÅ ËÌÁ×ÉÛ CONTROL-f.
302 313
303>> îÁÂÅÒÉÔÅ C-x 1 É ÐÏÓÍÏÔÒÉÔÅ, ËÁË ÏËÎÏ Ó ÄÏËÕÍÅÎÔÁÃÉÅÊ ÉÓÞÅÚÎÅÔ. 314>> îÁÂÅÒÉÔÅ C-x 1 É ÐÏÓÍÏÔÒÉÔÅ, ËÁË ÏËÎÏ Ó ÄÏËÕÍÅÎÔÁÃÉÅÊ ÉÓÞÅÚÎÅÔ.
304 315
305üÔÁ ËÏÍÁÎÄÁ ÏÔÌÉÞÁÅÔÓÑ ÏÔ ÄÒÕÇÉÈ ËÏÍÁÎÄ, ËÏÔÏÒÙÅ ×Ù ÉÚÕÞÉÌÉ, ÔÅÍ, ÞÔÏ ÏÎÁ 316üÔÁ ËÏÍÁÎÄÁ ÏÔÌÉÞÁÅÔÓÑ ÏÔ ÄÒÕÇÉÈ ËÏÍÁÎÄ, ËÏÔÏÒÙÅ ×Ù ÉÚÕÞÉÌÉ, ÔÅÍ, ÞÔÏ ÏÎÁ
306ÓÏÓÔÏÉÔ ÉÚ Ä×ÕÈ ÓÉÍ×ÏÌÏ×. ïÎÁ ÎÁÞÉÎÁÅÔÓÑ ÓÏ ÚÎÁËÁ CONTROL-x. åÓÔØ ÃÅÌÙÊ 317ÓÏÓÔÏÉÔ ÉÚ Ä×ÕÈ ÓÉÍ×ÏÌÏ×. ïÎÁ ÎÁÞÉÎÁÅÔÓÑ ÓÏ ÚÎÁËÁ CONTROL-x. åÓÔØ ÃÅÌÙÊ
307ÎÁÂÏÒ ËÏÍÁÎÄ, ËÏÔÏÒÙÅ ÎÁÞÉÎÁÀÔÓÑ Ó CONTROL-x; ÍÎÏÇÉÅ ÉÚ ÎÉÈ ÒÁÂÏÔÁÀÔ Ó 318ÎÁÂÏÒ ËÏÍÁÎÄ, ËÏÔÏÒÙÅ ÎÁÞÉÎÁÀÔÓÑ Ó CONTROL-x; ÍÎÏÇÉÅ ÉÚ ÎÉÈ ÒÁÂÏÔÁÀÔ Ó
308ÏËÎÁÍÉ, ÂÕÆÅÒÁÍÉ, ÆÁÊÌÁÍÉ É ÁÎÁÌÏÇÉÞÎÙÍÉ ×ÅÝÁÍÉ. üÔÉ ËÏÍÁÎÄÙ ÉÍÅÀÔ ÄÌÉÎÕ 2, 319ÏËÎÁÍÉ, ÂÕÆÅÒÁÍÉ, ÆÁÊÌÁÍÉ É ÁÎÁÌÏÇÉÞÎÙÍÉ ×ÅÝÁÍÉ. üÔÉ ËÏÍÁÎÄÙ ÓÏÓÔÏÑÔ ÉÚ
3093 ÉÌÉ 4 ÚÎÁËÁ. 320Ä×ÕÈ, ÔÒÅÈ ÉÌÉ ÞÅÔÙÒÅÈ ÚÎÁËÏ×.
310 321
311 322
312* ÷óôá÷ëá é õäáìåîéå 323* ÷óôá÷ëá é õäáìåîéå
313-------------------- 324--------------------
314 325
315åÓÌÉ ×Ù ÈÏÔÉÔÅ ×ÓÔÁ×ÉÔØ ÔÅËÓÔ, ÐÒÏÓÔÏ ÎÁÂÅÒÉÔÅ ÔÅËÓÔ. óÉÍ×ÏÌÙ, ËÏÔÏÒÙÅ ×Ù 326åÓÌÉ ×Ù ÈÏÔÉÔÅ ×ÓÔÁ×ÉÔØ ÔÅËÓÔ, ÔÏ ÐÒÏÓÔÏ ÎÁÂÉÒÁÊÔÅ ÅÇÏ. óÉÍ×ÏÌÙ, ËÏÔÏÒÙÅ ×Ù
316ÍÏÖÅÔÅ ×ÉÄÅÔØ, ÔÁËÉÅ ËÁË A, 7, *, É ÐÒ. ÐÏÎÉÍÁÀÔÓÑ Emacs'ÏÍ ËÁË ÔÅËÓÔ É 327ÍÏÖÅÔÅ ×ÉÄÅÔØ, ÔÁËÉÅ ËÁË A, 7, *, É ÐÒ. ÐÏÎÉÍÁÀÔÓÑ Emacs'ÏÍ ËÁË ÔÅËÓÔ É
317×ÓÔÁ×ÌÑÀÔÓÑ ÎÅÍÅÄÌÅÎÎÏ. îÁÖÍÉÔÅ <Return> (ËÎÏÐËÁ ÐÅÒÅ×ÏÄÁ ËÁÒÅÔËÉ) ÄÌÑ 328×ÓÔÁ×ÌÑÀÔÓÑ ÎÅÍÅÄÌÅÎÎÏ. îÁÖÍÉÔÅ <Return> (ËÎÏÐËÁ ÐÅÒÅ×ÏÄÁ ËÁÒÅÔËÉ) ÞÔÏÂÙ
318×ÓÔÁ×ËÉ ÓÉÍ×ÏÌÁ ÎÏ×ÏÊ ÓÔÒÏËÉ. 329×ÓÔÁ×ÉÔØ ÓÉÍ×ÏÌ ÎÏ×ÏÊ ÓÔÒÏËÉ.
330
331÷Ù ÍÏÖÅÔÅ ÕÄÁÌÉÔØ ÎÁÂÒÁÎÎÙÊ ÓÉÍ×ÏÌ ÎÁÖÉÍÁÑ ËÌÁ×ÉÛÕ <Delback>. <Delback> --
332ÜÔÏ ËÌÁ×ÉÛÁ ÎÁ ËÌÁ×ÉÁÔÕÒÅ, ËÏÔÏÒÕÀ ×Ù ÉÓÐÏÌØÚÕÅÔÅ É ×ÎÅ Emacs ÄÌÑ ÕÄÁÌÅÎÉÑ
333ÐÏÓÌÅÄÎÅÇÏ ÎÁÂÒÁÎÎÏÇÏ ÓÉÍ×ÏÌÁ. ïÂÙÞÎÏ, ÜÔÏ ÂÏÌØÛÁÑ ËÌÁ×ÉÛÁ, ÒÁÓÐÏÌÏÖÅÎÎÁÑ
334ÎÁ ÎÅÓËÏÌØËÏ ÓÔÒÏË ×ÙÛÅ ËÌÁ×ÉÛÉ <Return>; ÏÂÙÞÎÏ ÏÎÁ ÐÏÍÅÞÅÎÁ ËÁË "Delete",
335"Del" ÉÌÉ "Backspace".
319 336
320÷Ù ÍÏÖÅÔÅ ÕÄÁÌÉÔØ ÐÏÓÌÅÄÎÉÊ ÎÁÂÒÁÎÎÙÊ ÓÉÍ×ÏÌ ÎÁÖÉÍÁÑ ËÌÁ×ÉÛÕ 337åÓÌÉ ÂÏÌØÛÁÑ ËÌÁ×ÉÛÁ ÐÏÍÅÞÅÎÁ ËÁË "Backspace", ÔÏ ÜÔÏ ÔÏ, ÞÔÏ ×ÁÍ ÎÕÖÎÏ
321<Delete>. ëÌÁ×ÉÛÁ <Delete> ÎÁ ËÌÁ×ÉÁÔÕÒÅ ÍÏÖÅÔ ÂÙÔØ ÏÂÏÚÎÁÞÅÎÁ ËÁË "Del". ÷ 338ÉÓÐÏÌØÚÏ×ÁÔØ ÔÏÇÄÁ, ËÏÇÄÁ ×Ù ÂÕÄÅÔÅ ÞÉÔÁÔØ ÐÒÏ <Delback>. õ ×ÁÓ ÔÁËÖÅ ÍÏÖÅÔ
322ÎÅËÏÔÏÒÙÈ ÓÌÕÞÁÑÈ, ËÌÁ×ÉÛÁ "Backspace" ÒÁÂÏÔÁÅÔ ËÁË <Delete>, ÎÏ ÎÅ ×ÓÅÇÄÁ! 339ÂÙÔØ ËÌÁ×ÉÛÁ, ÐÏÍÅÞÅÎÎÁÑ ËÁË "Delete", ÎÏ ÏÎÁ ÉÍÅÅÔ ÄÒÕÇÕÀ ÆÕÎËÃÉÀ, ÏÔÌÉÞÎÕÀ
340ÏÔ <Delback>.
323 341
324÷ ÏÓÎÏ×ÎÏÍ, <Delete> ÕÄÁÌÑÅÔ ÓÉÍ×ÏÌ ÎÅÐÏÓÒÅÄÓÔ×ÅÎÎÏ ÐÅÒÅÄ ÔÅËÕÝÅÊ ÐÏÚÉÃÉÅÊ 342÷ ÏÓÎÏ×ÎÏÍ, <Delback> ÕÄÁÌÑÅÔ ÓÉÍ×ÏÌ ÎÅÐÏÓÒÅÄÓÔ×ÅÎÎÏ ÐÅÒÅÄ ÔÅËÕÝÅÊ ÐÏÚÉÃÉÅÊ
325ËÕÒÓÏÒÁ. 343ËÕÒÓÏÒÁ.
326 344
327>> ðÏÐÒÏÂÕÊÔÅ ×ÙÐÏÌÎÉÔØ ÜÔÏ ÓÅÊÞÁÓ -- ÎÁÂÅÒÉÔÅ ÎÅÓËÏÌØËÏ ÓÉÍ×ÏÌÏ×, ÐÏÔÏÍ 345>> ðÏÐÒÏÂÕÊÔÅ ×ÙÐÏÌÎÉÔØ ÜÔÏ ÓÅÊÞÁÓ -- ÎÁÂÅÒÉÔÅ ÎÅÓËÏÌØËÏ ÓÉÍ×ÏÌÏ×, Á ÚÁÔÅÍ
328 ÕÄÁÌÉÔÅ ÉÈ ÎÁÖÉÍÁÑ <Delete> ÎÅÓËÏÌØËÏ ÒÁÚ. îÅ ×ÏÌÎÕÊÔÅÓØ Ï ÉÚÍÅÎÅÎÉÑÈ 346 ÕÄÁÌÉÔÅ ÉÈ ÎÁÖÉÍÁÑ <Delback>. îÅ ×ÏÌÎÕÊÔÅÓØ Ï ÉÚÍÅÎÅÎÉÑÈ ÜÔÏÇÏ ÆÁÊÌÁ --
329 ÜÔÏÇÏ ÆÁÊÌÁ; ×Ù ÎÅ ÉÚÍÅÎÑÅÔÅ ÇÌÁ×ÎÙÊ ÕÞÅÂÎÉË. üÔÏ ×ÁÛÁ ÌÉÞÎÁÑ ËÏÐÉÑ 347 ×Ù ÎÅ ÉÚÍÅÎÑÅÔÅ ÇÌÁ×ÎÙÊ ÕÞÅÂÎÉË; ÜÔÏ ×ÁÛÁ ÌÉÞÎÁÑ ËÏÐÉÑ ÕÞÅÂÎÉËÁ.
330 ÕÞÅÂÎÉËÁ.
331 348
332ëÏÇÄÁ ÓÔÒÏËÁ ÔÅËÓÔÁ ÓÔÁÎÏ×ÉÔÓÑ ÓÌÉÛËÏÍ ÂÏÌØÛÏÊ ÄÌÑ ÓÔÒÏËÉ ÜËÒÁÎÁ, ÓÔÒÏËÁ 349ëÏÇÄÁ ÓÔÒÏËÁ ÔÅËÓÔÁ ÓÔÁÎÏ×ÉÔÓÑ ÓÌÉÛËÏÍ ÂÏÌØÛÏÊ ÄÌÑ ÓÔÒÏËÉ ÜËÒÁÎÁ, ÔÏ ÏÎÁ
333ÔÅËÓÔÁ "ÐÒÏÄÏÌÖÁÅÔÓÑ" ÎÁ ÓÌÅÄÕÀÝÅÊ ÓÔÒÏËÅ ÜËÒÁÎÁ. óÉÍ×ÏÌ "ÏÂÒÁÔÎÏÅ ÄÅÌÅÎÉÅ" 350"ÐÒÏÄÏÌÖÁÅÔÓÑ" ÎÁ ÓÌÅÄÕÀÝÅÊ ÓÔÒÏËÅ ÜËÒÁÎÁ. óÉÍ×ÏÌ "ÏÂÒÁÔÎÙÊ ÓÌÜÛ" ("\") (ÉÌÉ
334("\") (ÉÌÉ ÅÓÌÉ ×Ù ÉÓÐÏÌØÚÕÅÔÅ ÏËÏÎÎÕÀ ÓÉÓÔÅÍÕ, ÔÏ ÍÁÌÅÎØËÁÑ ÉÚÏÇÎÕÔÁÑ 351ÅÓÌÉ ×Ù ÉÓÐÏÌØÚÕÅÔÅ ÏËÏÎÎÕÀ ÓÉÓÔÅÍÕ, ÔÏ ÜÔÏ ÂÕÄÅÔ ÚÎÁÞÏË × ×ÉÄÅ ÍÁÌÅÎØËÏÊ
335ÓÔÒÅÌËÁ) Ó ÐÒÁ×ÏÊ ÇÒÁÎÉÃÙ ÐÏËÁÚÙ×ÁÅÔ, ÞÔÏ ÓÔÒÏËÁ ÂÕÄÅÔ ÐÒÏÄÏÌÖÅÎÁ. 352ÉÚÏÇÎÕÔÏÊ ÓÔÒÅÌËÉ) Ó ÐÒÁ×ÏÊ ÇÒÁÎÉÃÙ ÐÏËÁÚÙ×ÁÅÔ, ÞÔÏ ÓÔÒÏËÁ ÂÕÄÅÔ
353ÐÒÏÄÏÌÖÁÅÔÓÑ Ó ÐÒÅÄÙÄÕÝÅÊ ÓÔÒÏËÉ.
336 354
337>> ÷×ÏÄÉÔÅ ÔÅËÓÔ, ÐÏËÁ ÎÅ ÄÏÓÔÉÇÎÉÔÅ ÐÒÁ×ÏÊ ÇÒÁÎÉÃÙ, É ÐÒÏÄÏÌÖÁÊÔÅ 355>> ÷×ÏÄÉÔÅ ÔÅËÓÔ, ÐÏËÁ ÏÎ ÎÅ ÄÏÓÔÉÇÎÅÔ ÐÒÁ×ÏÊ ÇÒÁÎÉÃÙ, É ÐÒÏÄÏÌÖÁÊÔÅ ×ÓÔÁ×ËÕ
338 ×ÓÔÁ×ËÕ. ÷Ù Õ×ÉÄÉÔÅ, ËÁË ÐÏÑ×ÉÔÓÑ ÓÉÍ×ÏÌ ÐÒÏÄÏÌÖÅÎÉÑ ÓÔÒÏËÉ. 356 ÓÉÍ×ÏÌÏ×. ÷Ù Õ×ÉÄÉÔÅ, ËÁË ÐÏÑ×ÉÔÓÑ ÓÉÍ×ÏÌ ÐÒÏÄÏÌÖÅÎÉÑ ÓÔÒÏËÉ.
339 357
340>> éÓÐÏÌØÚÕÊÔÅ <Delete> ÄÌÑ ÕÄÁÌÅÎÉÑ ÔÅËÓÔÁ, ÐÏËÁ ÓÔÒÏËÁ ÎÅ ÐÏÍÅÓÔÉÔÓÑ × 358>> éÓÐÏÌØÚÕÊÔÅ <Delback> ÄÌÑ ÕÄÁÌÅÎÉÑ ÔÅËÓÔÁ, ÄÏ ÔÅÈ ÐÏÒ, ÐÏËÁ ÓÔÒÏËÁ ÎÅ
341 ÜËÒÁÎ ÓÎÏ×Á. óÉÍ×ÏÌ ÐÒÏÄÏÌÖÅÎÉÑ ÓÔÒÏËÉ ÉÓÞÅÚÎÅÔ. 359 ÐÏÍÅÓÔÉÔÓÑ × ÜËÒÁÎ ÓÎÏ×Á. óÉÍ×ÏÌ ÐÒÏÄÏÌÖÅÎÉÑ ÓÔÒÏËÉ ÉÓÞÅÚÎÅÔ Ó ÜËÒÁÎÁ.
342 360
343íÏÖÎÏ ÕÄÁÌÑÔØ ÓÉÍ×ÏÌ ÎÏ×ÏÊ ÓÔÒÏËÉ ÔÏÞÎÏ ÔÁË ÖÅ, ËÁË É ÌÀÂÏÊ ÄÒÕÇÏÊ. õÄÁÌÅÎÉÅ 361óÉÍ×ÏÌ ÎÏ×ÏÊ ÓÔÒÏËÉ ÍÏÖÎÏ ÕÄÁÌÑÔØ ÔÏÞÎÏ ÔÁË ÖÅ, ËÁË É ÌÀÂÏÊ ÄÒÕÇÏÊ ÓÉÍ×ÏÌ.
344ÓÉÍ×ÏÌÁ ÎÏ×ÏÊ ÓÔÒÏËÉ ÍÅÖÄÕ Ä×ÕÍÑ ÓÔÒÏËÁÍÉ ÐÒÉ×ÅÄÅÔ Ë ÓËÌÅÊËÅ ÉÈ × ÏÄÎÕ. åÓÌÉ 362õÄÁÌÅÎÉÅ ÓÉÍ×ÏÌÁ ÎÏ×ÏÊ ÓÔÒÏËÉ ÍÅÖÄÕ Ä×ÕÍÑ ÓÔÒÏËÁÍÉ ÐÒÉ×ÅÄÅÔ Ë ÉÈ ÓËÌÅÊËÅ ×
345ÐÏÌÕÞÅÎÎÁÑ ÓÔÒÏËÁ ÓÌÉÛËÏÍ ÄÌÉÎÎÁÑ, ÞÔÏÂÙ ×ÍÅÓÔÉÔØÓÑ × ÜËÒÁÎ, ÏÎÁ ÂÕÄÅÔ 363ÏÄÎÕ. åÓÌÉ ÐÏÌÕÞÅÎÎÁÑ ÓÔÒÏËÁ ÂÕÄÅÔ ÓÌÉÛËÏÍ ÄÌÉÎÎÏÊ, ÞÔÏÂÙ ×ÍÅÓÔÉÔØÓÑ ×
346ÏÔÏÂÒÁÖÅÎÁ ËÁË ÐÒÏÄÏÌÖÅÎÎÁÑ ÓÔÒÏËÁ. 364ÜËÒÁÎ, ÔÏ ÏÎÁ ÂÕÄÅÔ ÏÔÏÂÒÁÖÅÎÁ ËÁË ÓÔÒÏËÁ Ó ÐÒÏÄÏÌÖÅÎÉÅÍ, ËÁË ÜÔÏ ÂÙÌÏ
365ÏÐÉÓÁÎÏ ×ÙÛÅ.
347 366
348>> ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ × ÎÁÞÁÌÏ ÓÔÒÏËÉ É ÎÁÖÍÉÔÅ <Delete>. üÔÏ ÓÏÅÄÉÎÉÔ 367>> ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ × ÎÁÞÁÌÏ ÓÔÒÏËÉ É ÎÁÖÍÉÔÅ <Delback>. üÔÏ ÓÏÅÄÉÎÉÔ
349 ÔÅËÕÝÕÀ ÓÔÒÏËÕ Ó ÐÒÅÄÙÄÕÝÅÊ. 368 ÔÅËÕÝÕÀ ÓÔÒÏËÕ Ó ÐÒÅÄÙÄÕÝÅÊ.
350 369
351>> îÁÖÍÉÔÅ <Return> ÄÌÑ ×ÓÔÁ×ËÉ ÓÉÍ×ÏÌÁ ÎÏ×ÏÊ ÓÔÒÏËÉ ÓÎÏ×Á, ×ÍÅÓÔÏ 370>> îÁÖÍÉÔÅ <Return> ÄÌÑ ×ÓÔÁ×ËÉ ÎÏ×ÏÇÏ ÓÉÍ×ÏÌÁ ÓÔÒÏËÉ, ×ÍÅÓÔÏ ÕÄÁÌÅÎÎÏÇÏ
352 ÕÄÁÌÅÎÎÏÇÏ ×ÁÍÉ. 371 ×ÁÍÉ.
353 372
354ðÏÍÎÉÔÅ, ÞÔÏ ÍÎÏÇÉÅ ËÏÍÁÎÄÙ Emacs ÍÏÇÕÔ ÐÏÌÕÞÁÔØ ÓÞÅÔÞÉË ÐÏ×ÔÏÒÅÎÉÑ; ÐÒÏÓÔÙÅ 373ðÏÍÎÉÔÅ, ÞÔÏ ÍÎÏÇÉÅ ËÏÍÁÎÄÙ Emacs ÍÏÇÕÔ ÐÏÌÕÞÁÔØ ÓÞÅÔÞÉË ÐÏ×ÔÏÒÅÎÉÑ; ÐÒÏÓÔÙÅ
355ÓÉÍ×ÏÌÙ ÎÅ Ñ×ÌÑÀÔÓÑ ÉÓËÌÀÞÅÎÉÅÍ. îÁÂÉÒÁÊÔÅ ÐÒÏÓÔÙÅ ÓÉÍ×ÏÌÙ, ×ÓÔÁ×ÌÑÑ ÉÈ ÐÏ 374ÓÉÍ×ÏÌÙ ÎÅ Ñ×ÌÑÀÔÓÑ ÉÓËÌÀÞÅÎÉÅÍ. ÷Ù ÍÏÖÅÔÅ ×ÓÔÁ×ÌÑÔØ ÐÏ ÎÅÓËÏÌØËÏ ÓÉÍ×ÏÌÏ×,
356ÎÅÓËÏÌØËÏ ÚÁ ÏÄÉÎ ÒÁÚ. 375ÉÓÐÏÌØÚÕÑ ÓÞÅÔÞÉËÉ ÐÏ×ÔÏÒÅÎÉÊ.
357 376
358>> ðÏÐÒÏÂÕÊÔÅ ×ÙÐÏÌÎÉÔØ ÜÔÏ -- ÎÁÂÅÒÉÔÅ C-u 8 * ÄÌÑ ×ÓÔÁ×ËÉ ********. 377>> ðÏÐÒÏÂÕÊÔÅ ÐÒÏ×ÅÒÉÔØ ÜÔÏ -- ÎÁÂÅÒÉÔÅ C-u 8 * ÄÌÑ ×ÓÔÁ×ËÉ ********.
359 378
360ôÅÐÅÒØ ×Ù ÎÁÕÞÉÌÉÓØ ÏÓÎÏ×ÎÏÍÕ ÓÐÏÓÏÂÕ ÎÁÂÒÁÔØ ÞÔÏ-ÎÉÂÕÄØ × Emacs É 379ôÅÐÅÒØ ×Ù ÎÁÕÞÉÌÉÓØ ÏÓÎÏ×ÁÍ ÎÁÂÏÒÁ ÔÅËÓÔÁ × Emacs É ÉÓÐÒÁ×ÌÅÎÉÑ ÏÛÉÂÏË. ÷Ù
361ÉÓÐÒÁ×ÌÑÔØ ÏÛÉÂËÉ. ôÁËÖÅ ×Ù ÍÏÖÅÔÅ ÕÄÁÌÑÔØ ÓÌÏ×Á É ÓÔÒÏËÉ. úÄÅÓØ ÓÏÂÒÁÎÙ 380ÔÁËÖÅ ÍÏÖÅÔÅ ÕÄÁÌÑÔØ ÓÌÏ×Á É ÓÔÒÏËÉ. úÄÅÓØ ÐÒÉ×ÅÄÅÎ ÓÐÉÓÏË ÏÐÅÒÁÃÉÊ
362ÏÐÅÒÁÃÉÉ ÕÄÁÌÅÎÉÑ: 381ÕÄÁÌÅÎÉÑ:
363 382
364 <Delete> ÕÄÁÌÉÔØ ÓÉÍ×ÏÌ ÐÅÒÅÄ ËÕÒÓÏÒÏÍ 383 <Delback> ÕÄÁÌÉÔØ ÓÉÍ×ÏÌ ÐÅÒÅÄ ËÕÒÓÏÒÏÍ
365 C-d ÕÄÁÌÉÔØ ÓÉÍ×ÏÌ ÓÌÅÄÕÀÝÉÊ ÚÁ (ÎÁÄ) ËÕÒÓÏÒÏÍ 384 C-d ÕÄÁÌÉÔØ ÓÉÍ×ÏÌ ÓÌÅÄÕÀÝÉÊ ÚÁ (ÎÁÄ) ËÕÒÓÏÒÏÍ
366 385
367 M-<Delete> õÂÉÔØ ÓÔÒÏËÕ ÎÅÐÏÓÒÅÄÓÔ×ÅÎÎÏ ÐÅÒÅÄ ËÕÒÓÏÒÏÍ 386 M-<Delback> õÂÉÔØ ÓÔÒÏËÕ ÎÅÐÏÓÒÅÄÓÔ×ÅÎÎÏ ÐÅÒÅÄ ËÕÒÓÏÒÏÍ
368 M-d õÂÉÔØ ÓÌÏ×Ï ÓÌÅÄÕÀÝÅÅ ÚÁ ËÕÒÓÏÒÏÍ 387 M-d õÂÉÔØ ÓÌÏ×Ï ÓÌÅÄÕÀÝÅÅ ÚÁ ËÕÒÓÏÒÏÍ
369 388
370 C-k õÂÉÔØ ×ÓÅ ÏÔ ËÕÒÓÏÒÁ ÄÏ ËÏÎÃÁ ÓÔÒÏËÉ 389 C-k õÂÉÔØ ×ÓÅ ÏÔ ËÕÒÓÏÒÁ ÄÏ ËÏÎÃÁ ÓÔÒÏËÉ
371 M-k õÂÉÔØ ×ÓÅ ÄÏ ËÏÎÃÁ ÐÒÅÄÌÏÖÅÎÉÑ 390 M-k õÂÉÔØ ×ÓÅ ÄÏ ËÏÎÃÁ ÐÒÅÄÌÏÖÅÎÉÑ
372 391
373úÁÍÅÔØÔÅ, ÞÔÏ <Delete> É C-d ÐÒÏÔÉ× M-<Delete> É M-d ÒÁÓÛÉÒÑÀÔ ÐÁÒÁÌÌÅÌØ, 392úÁÍÅÔØÔÅ, ÞÔÏ <Delback> É C-d, ×ÍÅÓÔÅ Ó M-<Delback> É M-d ÒÁÓÛÉÒÑÀÔ
374ÎÁÞÁÔÕÀ C-f É M-f (ÄÁ, <Delete> ÜÔÏ ÎÅ ÒÅÁÌØÎÙÊ ÕÐÒÁ×ÌÑÀÝÉÊ ÓÉÍ×ÏÌ, ÎÏ ÎÅ 393ÐÁÒÁÌÌÅÌØ, ÎÁÞÁÔÕÀ C-f É M-f (ÄÁ, <Delback> -- ÜÔÏ ÎÅ ÎÁÓÔÏÑÝÉÊ ÕÐÒÁ×ÌÑÀÝÉÊ
375ÎÕÖÎÏ ×ÏÌÎÏ×ÁÔØÓÑ Ï ÜÔÏÍ). C-k É M-k, ËÁË É C-e É M-e, ÐÒÏ×ÏÄÑÔ ÐÁÒÁÌÌÅÌØ 394ÓÉÍ×ÏÌ, ÎÏ ÎÅ ÎÕÖÎÏ Ï ÜÔÏÍ ×ÏÌÎÏ×ÁÔØÓÑ). C-k É M-k, ËÁË É C-e É M-e,
376ÍÅÖÄÕ ÓÔÒÏËÁÍÉ É ÐÒÅÄÌÏÖÅÎÉÑÍÉ. 395ÐÒÏ×ÏÄÑÔ ÐÁÒÁÌÌÅÌØ ÍÅÖÄÕ ÓÔÒÏËÁÍÉ É ÐÒÅÄÌÏÖÅÎÉÑÍÉ.
377 396
378÷Ù ÍÏÖÅÔÅ ÕÄÁÌÉÔØ ÌÀÂÕÀ ÞÁÓÔØ ÂÕÆÅÒÁ ÏÄÎÉÍ ÅÄÉÎÏÏÂÒÁÚÎÙÍ 397÷Ù ÍÏÖÅÔÅ ÕÄÁÌÉÔØ ÌÀÂÕÀ ÞÁÓÔØ ÂÕÆÅÒÁ ÏÄÎÉÍ ÍÅÔÏÄÏÍ. ðÅÒÅÍÅÓÔÉÔÅÓØ ÎÁ ÏÄÉÎ
379ÍÅÔÏÄÏÍ. ðÅÒÅÍÅÓÔÉÔÅÓØ ÎÁ ÏÄÉÎ ÉÚ ËÏÎÃÏ× ÒÅÇÉÏÎÁ É ÎÁÂÅÒÉÔÅ type C-@ ÉÌÉ 398ÉÚ ËÏÎÃÏ× ×ÙÂÒÁÎÎÏÊ ÏÂÌÁÓÔÉ É ÎÁÖÍÉÔÅ C-@ ÉÌÉ C-<SPC> (ÏÄÎÏ ÉÚ ÜÔÉÈ
380C-SPC (ÏÄÎÕ ÉÚ ÎÉÈ). (SPC ÏÂÏÚÎÁÞÁÅÔ ËÌÁ×ÉÛÕ ÐÒÏÂÅÌÁ). ðÅÒÅÍÅÓÔÉÔÅÓØ ÎÁ 399ÓÏÞÅÔÁÎÉÊ). úÄÅÓØ <SPC> ÏÂÏÚÎÁÞÁÅÔ ËÌÁ×ÉÛÕ ÐÒÏÂÅÌÁ. ðÅÒÅÍÅÓÔÉÔÅÓØ ÎÁ ÄÒÕÇÏÊ
381ÄÒÕÇÏÊ ËÏÎÅà ÒÅÇÉÏÎÁ É ÎÁÂÅÒÉÔÅ C-w. üÔÁ ÏÐÅÒÁÃÉÑ ÕÄÁÌÉÔ ×ÅÓØ ÔÅËÓÔ ÍÅÖÄÕ 400ËÏÎÅà ÏÂÌÁÓÔÉ É ÎÁÖÍÉÔÅ C-w. üÔÁ ÏÐÅÒÁÃÉÑ ÕÄÁÌÉÔ ×ÅÓØ ÔÅËÓÔ ÍÅÖÄÕ Ä×ÕÍÑ
382Ä×ÕÍÑ ÕËÁÚÁÎÎÙÍÉ ÐÏÚÉÃÉÑÍÉ. 401ÕËÁÚÁÎÎÙÍÉ ÐÏÚÉÃÉÑÍÉ.
383 402
384>> ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ Ë ÂÕË×Å ÷ × ÎÁÞÁÌÏ ÐÒÅÄÙÄÕÝÅÇÏ ÐÁÒÁÇÒÁÆÁ. 403>> ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ Ë ÂÕË×Å ÷ × ÎÁÞÁÌÅ ÐÒÅÄÙÄÕÝÅÇÏ ÐÁÒÁÇÒÁÆÁ.
385>> îÁÂÅÒÉÔÅ C-SPC. Emacs ÄÏÌÖÅÎ ÏÔÏÂÒÁÚÉÔØ × ÎÉÖÎÅÊ ÞÁÓÔÉ ÜËÒÁÎÁ ÓÏÏÂÝÅÎÉÅ 404>> îÁÂÅÒÉÔÅ C-<SPC>. Emacs ÄÏÌÖÅÎ ÏÔÏÂÒÁÚÉÔØ × ÎÉÖÎÅÊ ÞÁÓÔÉ ÜËÒÁÎÁ ÓÏÏÂÝÅÎÉÅ
386 "Mark set". 405 "Mark set".
387>> ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ Ë ÂÕË×Å Ï × ÓÌÏ×Å "ËÏÎÃÏ×", ÎÁ ×ÔÏÒÏÊ ÓÔÒÏËÅ 406>> ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ Ë ÂÕË×Å Ï × ÓÌÏ×Å "ËÏÎÃÏ×", ÎÁ ×ÔÏÒÏÊ ÓÔÒÏËÅ
388 ÐÁÒÁÇÒÁÆÁ. 407 ÐÁÒÁÇÒÁÆÁ.
@@ -393,411 +412,450 @@ C-SPC (ÏÄÎÕ ÉÚ ÎÉÈ). (SPC ÏÂÏÚÎÁÞÁÅÔ ËÌÁ×ÉÛÕ ÐÒÏÂÅÌÁ). ðÅÒÅÍÅÓÔÉÔÅÓØ ÎÁ
393ÞÔÏ "ÕÂÉÔÙÊ" ÔÅËÓÔ ÍÏÖÅÔ ÂÙÔØ ÚÁÎÏ×Ï ×ÓÔÁ×ÌÅÎ, × ÔÏ ×ÒÅÍÑ ËÁË "ÕÄÁÌÅÎÎÙÅ" 412ÞÔÏ "ÕÂÉÔÙÊ" ÔÅËÓÔ ÍÏÖÅÔ ÂÙÔØ ÚÁÎÏ×Ï ×ÓÔÁ×ÌÅÎ, × ÔÏ ×ÒÅÍÑ ËÁË "ÕÄÁÌÅÎÎÙÅ"
394ÞÁÓÔÉ ÎÅ ÍÏÇÕÔ ÂÙÔØ ×ÓÔÁ×ÌÅÎÙ. ÷ÓÔÁ×ËÁ "ÕÂÉÔÏÇÏ" ÔÅËÓÔÁ ÎÁÚÙ×ÁÅÔÓÑ 413ÞÁÓÔÉ ÎÅ ÍÏÇÕÔ ÂÙÔØ ×ÓÔÁ×ÌÅÎÙ. ÷ÓÔÁ×ËÁ "ÕÂÉÔÏÇÏ" ÔÅËÓÔÁ ÎÁÚÙ×ÁÅÔÓÑ
395"×ÏÓÓÔÁÎÏ×ÌÅÎÉÅ (yanking)". ÷ ÏÂÝÅÍ, ËÏÍÁÎÄÙ, ËÏÔÏÒÙÅ ÍÏÇÕÔ ÕÂÉÒÁÔØ ÂÏÌØÛÉÅ 414"×ÏÓÓÔÁÎÏ×ÌÅÎÉÅ (yanking)". ÷ ÏÂÝÅÍ, ËÏÍÁÎÄÙ, ËÏÔÏÒÙÅ ÍÏÇÕÔ ÕÂÉÒÁÔØ ÂÏÌØÛÉÅ
396ÞÁÓÔÉ ÔÅËÓÔÁ, ÕÂÉ×ÁÀÔ ÜÔÏÔ ÔÅËÓÔ (ÏÎÉ ÔÁË ÎÁÓÔÒÁÉ×ÁÀÔÓÑ ÔÁË, ÞÔÏ ×Ù ÍÏÖÅÔÅ 415ÞÁÓÔÉ ÔÅËÓÔÁ, ÕÂÉ×ÁÀÔ ÜÔÏÔ ÔÅËÓÔ (ÏÎÉ ÎÁÓÔÒÁÉ×ÁÀÔÓÑ ÔÁË, ÞÔÏ ×Ù ÍÏÖÅÔÅ
397×ÏÓÓÔÁÎÏ×ÉÔØ ÔÅËÓÔ), × ÔÏ ×ÒÅÍÑ ËÁË ËÏÍÁÎÄÙ, ËÏÔÏÒÙÅ ÕÂÉÒÁÀÔ ÔÏÌØËÏ ÏÄÉÎ 416×ÏÓÓÔÁÎÏ×ÉÔØ ÔÅËÓÔ), × ÔÏ ×ÒÅÍÑ ËÁË ËÏÍÁÎÄÙ, ËÏÔÏÒÙÅ ÕÂÉÒÁÀÔ ÔÏÌØËÏ ÏÄÉÎ
398ÓÉÍ×ÏÌ, ÉÌÉ ÔÏÌØËÏ ÐÕÓÔÙÅ ÓÔÒÏËÉ É ÐÒÏÂÅÌØÎÙÅ ÓÉÍ×ÏÌÙ, ×ÙÐÏÌÎÑÀÔ ÕÄÁÌÅÎÉÅ 417ÓÉÍ×ÏÌ, ÉÌÉ ÕÄÁÌÑÀÔ ÔÏÌØËÏ ÐÕÓÔÙÅ ÓÔÒÏËÉ É ÐÒÏÂÅÌØÎÙÅ ÓÉÍ×ÏÌÙ, ×ÙÐÏÌÎÑÀÔ
399(ÔÁË ÞÔÏ ×Ù ÎÅ ÍÏÖÅÔÅ ×ÏÓÓÔÁÎÏ×ÉÔØ ÔÅËÓÔ). 418ÏÐÅÒÁÃÉÀ ÕÄÁÌÅÎÉÑ (ÔÁË ÞÔÏ ×Ù ÎÅ ÍÏÖÅÔÅ ×ÏÓÓÔÁÎÏ×ÉÔØ ÔÅËÓÔ).
400 419
401>> ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ÎÁ ÎÁÞÁÌÏ ÎÅÐÕÓÔÏÊ ÓÔÒÏËÉ. ôÅÐÅÒØ ÎÁÖÍÉÔÅ C-k, ÞÔÏÂÙ 420>> ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ÎÁ ÎÁÞÁÌÏ ÎÅ ÐÕÓÔÏÊ ÓÔÒÏËÉ. ôÅÐÅÒØ ÎÁÖÍÉÔÅ C-k, ÞÔÏÂÙ
402 ÕÂÉÔØ ÔÅËÓÔ × ÜÔÏÊ ÓÔÒÏËÅ. 421 ÕÂÉÔØ ÔÅËÓÔ × ÜÔÏÊ ÓÔÒÏËÅ.
403 422
404>> îÁÖÍÉÔÅ C-k ÅÝÅ ÒÁÚ. ÷Ù ×ÉÄÉÔÅ, ÞÔÏ ÜÔÏ ÕÂØÅÔ ÓÉÍ×ÏÌ ÎÏ×ÏÊ ÓÔÒÏËÉ 423>> îÁÖÍÉÔÅ C-k ÅÝÅ ÒÁÚ. ÷Ù ×ÉÄÉÔÅ, ÞÔÏ ÜÔÏ ÄÅÊÓÔ×ÉÅ ÕÂØÅÔ ÓÉÍ×ÏÌ ÎÏ×ÏÊ
405 ÓÌÅÄÕÀÝÉÊ ÚÁ ÜÔÏÊ ÓÔÒÏËÏÊ. 424 ÓÔÒÏËÉ, ËÏÔÏÒÙÊ ÓÌÅÄÕÅÔ ÚÁ ÜÔÏÊ ÓÔÒÏËÏÊ.
406 425
407úÁÍÅÔØÔÅ, ÞÔÏ ÐÅÒ×ÏÅ C-k ÕÂÉ×ÁÅÔ ÓÏÄÅÒÖÉÍÏÅ ÓÔÒÏËÉ, Á ×ÔÏÒÏÅ C-k ÕÂÉ×ÁÅÔ 426úÁÍÅÔØÔÅ, ÞÔÏ ÐÅÒ×ÏÅ ×ÙÐÏÌÎÅÎÉÅ C-k ÕÂÉ×ÁÅÔ ÓÏÄÅÒÖÉÍÏÅ ÓÔÒÏËÉ, Á ×ÔÏÒÏÊ
408ÓÁÍÕ ÓÔÒÏËÕ É ÐÏÄÎÉÍÁÅÔ ÄÒÕÇÉÅ ÓÔÒÏËÉ ××ÅÒÈ. C-k ÏÂÒÁÂÁÔÙ×ÁÅÔ ÞÉÓÌÏ×ÏÊ 427×ÙÚÏ× C-k ÕÂÉ×ÁÅÔ ÓÁÍÕ ÓÔÒÏËÕ É ÐÏÄÎÉÍÁÅÔ ÄÒÕÇÉÅ ÓÔÒÏËÉ ××ÅÒÈ. C-k
409ÁÒÇÕÍÅÎÔ ÓÐÅÃÉÁÌØÎÙÍ ÏÂÒÁÚÏÍ: ÕÂÉ×ÁÅÔ ÓÔÏÌØËÏ ÓÔÒÏË _é_ ÉÈ ÓÏÄÅÒÖÉÍÏÅ. üÔÏ ÎÅ 428ÏÂÒÁÂÁÔÙ×ÁÅÔ ÞÉÓÌÏ×ÏÊ ÁÒÇÕÍÅÎÔ ÓÐÅÃÉÁÌØÎÙÍ ÏÂÒÁÚÏÍ -- ÕÂÉ×ÁÅÔ ÚÁÄÁÎÎÏÅ
410ÐÒÏÓÔÏ ÐÏ×ÔÏÒÅÎÉÅ. C-u 2 C-k ÕÄÁÌÉÔ Ä×Å ÓÔÒÏÉ É ÚÁ×ÅÒÛÁÀÝÉÅ ÉÈ ÓÉÍ×ÏÌÙ ÎÏ×ÏÊ 429ËÏÌÉÞÅÓÔ×Ï ÓÔÒÏË _é_ ÉÈ ÓÏÄÅÒÖÉÍÏÅ. üÔÏ ÎÅ ÐÒÏÓÔÏ ÐÏ×ÔÏÒÅÎÉÅ ËÏÍÁÎÄÙ. C-u 2
411ÓÔÒÏËÉ; ××ÏÄ C-k Ä×Á ÒÁÚÁ ÎÅ ÓÄÅÌÁÅÔ ÜÔÏÇÏ. 430C-k ÕÄÁÌÉÔ Ä×Å ÓÔÒÏËÉ, Á ÔÁËÖÅ ÚÁ×ÅÒÛÁÀÝÉÅ ÉÈ ÓÉÍ×ÏÌÙ ÎÏ×ÏÊ ÓÔÒÏËÉ;
431Ä×ÕÈÒÁÚÏ×ÏÅ ×ÙÐÏÌÎÅÎÉÅ C-k ÎÅ ÓÄÅÌÁÅÔ ÜÔÏÇÏ.
412 432
413÷ÏÚ×ÒÁÔ ÎÁÚÁÄ ÕÂÉÔÏÇÏ ÔÅËÓÔÁ ÎÁÚÙ×ÁÅÔÓÑ "×ÏÓÓÔÁÎÏ×ÌÅÎÉÅ (yanking)". (äÕÍÁÊÔÅ 433÷ÏÚ×ÒÁÔ ÕÂÉÔÏÇÏ ÒÁÎÅÅ ÔÅËÓÔÁ ÎÁÚÙ×ÁÅÔÓÑ "×ÏÓÓÔÁÎÏ×ÌÅÎÉÅ (yanking)". (äÕÍÁÊÔÅ
414Ï ÜÔÏÍ, ËÁË Ï ×ÏÓÓÔÁÎÏ×ÌÅÎÉÉ ÉÌÉ ÐÏÍÅÝÅÎÉÉ ÎÁÚÁÄ, ÎÅËÏÔÏÒÏÇÏ ×ÚÑÔÏÇÏ 434Ï ÜÔÏÍ, ËÁË Ï ×ÏÓÓÔÁÎÏ×ÌÅÎÉÉ ÉÌÉ ÐÏÍÅÝÅÎÉÉ ÎÁÚÁÄ, ÎÅËÏÔÏÒÏÇÏ ×ÚÑÔÏÇÏ
415ÔÅËÓÔÁ). ÷Ù ÍÏÖÅÔÅ ×ÏÓÓÔÁÎÏ×ÉÔØ ÕÄÁÌÅÎÎÙÊ ÔÅËÓÔ × ÔÏÍ ÖÅ ÍÅÓÔÅ, ÉÌÉ × ÌÀÂÏÊ 435ÔÅËÓÔÁ). ÷Ù ÍÏÖÅÔÅ ×ÏÓÓÔÁÎÏ×ÉÔØ ÕÄÁÌÅÎÎÙÊ ÔÅËÓÔ × ÍÅÓÔÅ ÕÄÁÌÅÎÉÑ, ÉÌÉ ×
416ÄÒÕÇÏÊ ÔÏÞËÅ ÂÕÆÅÒÁ, ÉÌÉ ÄÁÖÅ × ÄÒÕÇÏÍ ÆÁÊÌÅ. ÷Ù ÍÏÖÅÔÅ ×ÏÓÓÔÁÎÏ×ÉÔØ ÔÅËÓÔ 436ÌÀÂÏÊ ÄÒÕÇÏÊ ÔÏÞËÅ ÒÅÄÁËÔÉÒÕÅÍÏÇÏ ÔÅËÓÔÁ, ÉÌÉ ÄÁÖÅ × ÄÒÕÇÏÍ ÆÁÊÌÅ. ÷Ù
417ÎÅÓËÏÌØËÏ ÒÁÚ É ÐÏÌÕÞÉÔØ ÍÎÏÇÏ ËÏÐÉÊ. 437ÍÏÖÅÔÅ ×ÏÓÓÔÁÎÏ×ÉÔØ ÔÅËÓÔ ÎÅÓËÏÌØËÏ ÒÁÚ É ÐÏÌÕÞÉÔØ ÎÅÓËÏÌØËÏ ËÏÐÉÊ ÄÁÎÎÏÇÏ
438ÔÅËÓÔÁ.
418 439
419ëÏÍÁÎÄÏÊ ÄÌÑ ×ÏÓÓÔÁÎÏ×ÌÅÎÉÑ ÔÅËÓÔÁ Ñ×ÌÑÅÔÓÑ C-y. ïÎÁ ×ÏÓÓÔÁÎÁ×ÌÉ×ÁÅÔ 440äÌÑ ×ÏÓÓÔÁÎÏ×ÌÅÎÉÑ ÕÂÉÔÏÇÏ ÔÅËÓÔÁ ÉÓÐÏÌØÚÕÅÔÓÑ ÓÏÞÅÔÁÎÉÅ ËÌÁ×ÉÛ C-y. äÁÎÎÁÑ
420ÐÏÓÌÅÄÎÉÊ ÕÂÉÔÙÊ ÔÅËÓÔ × ÍÅÓÔÏ ÒÁÓÐÏÌÏÖÅÎÉÅ ËÕÒÓÏÒÁ. 441ËÏÍÁÎÄÁ ×ÏÓÓÔÁÎÁ×ÌÉ×ÁÅÔ ÐÏÓÌÅÄÎÉÊ ÕÂÉÔÙÊ ÔÅËÓÔ × ÔÏÞËÅ ÒÁÓÐÏÌÏÖÅÎÉÑ ËÕÒÓÏÒÁ.
421 442
422>> ðÏÐÒÏÂÕÊÔÅ ×ÙÐÏÌÎÉÔØ ÜÔÏ; ÎÁÂÅÒÉÔÅ C-y, ÞÔÏÂÙ ×ÅÒÎÕÔØ ÔÅËÓÔ ÎÁÚÁÄ. 443>> ðÏÐÒÏÂÕÊÔÅ ×ÙÐÏÌÎÉÔØ ÜÔÕ ËÏÍÁÎÄÕ -- ÎÁÂÅÒÉÔÅ C-y, ÞÔÏÂÙ ×ÅÒÎÕÔØ ÔÅËÓÔ
444 ÎÁÚÁÄ.
423 445
424ðÏÍÎÉÔÅ, ÅÓÌÉ ×Ù ÉÓÐÏÌØÚÏ×ÁÌÉ ÎÅÓËÏÌØËÏ ËÏÍÁÎÄ C-k × ÓÔÒÏËÅ, ×ÓÅ ÕÂÉÔÙÅ 446ðÏÍÎÉÔÅ, ÞÔÏ ÅÓÌÉ ×Ù ÉÓÐÏÌØÚÏ×ÁÌÉ ÎÅÓËÏÌØËÏ ËÏÍÁÎÄ C-k × ÏÄÎÏÊ ÓÔÒÏËÅ, ÔÏ
425ÓÔÒÏËÉ ÂÕÄÕÔ ÓÏÈÒÁÎÅÎÙ ×ÍÅÓÔÅ ÔÁË, ÞÔÏ C-y ×ÏÓÓÔÁÎÏ×ÉÔ ÉÈ ×ÍÅÓÔÅ. 447×ÓÅ ÕÂÉÔÙÅ ÓÔÒÏËÉ ÂÕÄÕÔ ÓÏÈÒÁÎÅÎÙ ×ÍÅÓÔÅ, ÔÁË, ÞÔÏ C-y ÔÁËÖÅ ×ÏÓÓÔÁÎÏ×ÉÔ ÉÈ
448×ÍÅÓÔÅ.
426 449
427>> ðÏÐÒÏÂÕÊÔÅ ×ÙÐÏÌÎÉÔØ ÜÔÏ ÓÅÊÞÁÓ, ÎÁÖÍÉÔÅ C-k ÎÅÓËÏÌØËÏ ÒÁÚ. 450>> ðÏÐÒÏÂÕÊÔÅ ×ÙÐÏÌÎÉÔØ ÜÔÏ ÓÅÊÞÁÓ -- ÎÁÖÍÉÔÅ C-k ÎÅÓËÏÌØËÏ ÒÁÚ.
428 451
429ôÅÐÅÒØ ×ÅÒÎÅÍ ÜÔÏÔ ÕÂÉÔÙÊ ÔÅËÓÔ: 452ôÅÐÅÒØ ×ÅÒÎÅÍ ÕÂÉÔÙÊ ÔÅËÓÔ:
430 453
431>> îÁÖÍÉÔÅ C-y. ôÅÐÅÒØ ÐÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ÎÁ ÎÅÓËÏÌØËÏ ÓÔÒÏË ×ÎÉÚ, É ÓÎÏ×Á 454>> îÁÖÍÉÔÅ C-y. ôÅÐÅÒØ ÐÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ÎÁ ÎÅÓËÏÌØËÏ ÓÔÒÏË ×ÎÉÚ, É ÓÎÏ×Á
432 ÎÁÖÍÉÔÅ C-y. óÅÊÞÁÓ ×Ù ×ÉÄÉÔÅ ËÁË ÍÏÖÎÏ ÓËÏÐÉÒÏ×ÁÔØ ÎÅËÏÔÏÒÙÊ ÔÅËÓÔ. 455 ÎÁÖÍÉÔÅ C-y. óÅÊÞÁÓ ×Ù ×ÉÄÉÔÅ ËÁË ÍÏÖÎÏ ÓËÏÐÉÒÏ×ÁÔØ ÎÅËÏÔÏÒÙÊ ÔÅËÓÔ.
433 456
434þÔÏ ÄÅÌÁÔØ, ÅÓÌÉ ÅÓÔØ ÎÅËÏÔÏÒÙÊ ÔÅËÓÔ, ËÏÔÏÒÙÊ ×Ù ÈÏÔÉÔÅ ×ÅÒÎÕÔØ ÎÁÚÁÄ É 457þÔÏ ÄÅÌÁÔØ, ÅÓÌÉ ÅÓÔØ ÎÅËÏÔÏÒÙÊ ÔÅËÓÔ, ËÏÔÏÒÙÊ ×Ù ÈÏÔÉÔÅ ×ÅÒÎÕÔØ ÎÁÚÁÄ, Á
435ÐÏÔÏÍ ÕÂÉÔØ ÞÔÏ-ÔÏ ÅÝÅ? C-y ×ÅÒÎÅÔ ÎÅ ÂÏÌÅÅ ÞÅÍ ÐÏÓÌÅÄÎÉÊ ÕÄÁÌÅÎÎÙÊ ÔÅËÓÔ. 458ÐÏÔÏÍ ÕÂÉÔØ ÞÔÏ-ÔÏ ÅÝÅ? ïÄÎÏ ÎÁÖÁÔÉÅ C-y ×ÅÒÎÅÔ ÔÏÌØËÏ ÐÏÓÌÅÄÎÉÊ ÕÄÁÌÅÎÎÙÊ
436îÏ ÐÒÅÄÙÄÕÝÉÊ ÔÅËÓÔ ÎÅ ÂÕÄÅÔ ÐÏÔÅÒÑÎ. ÷Ù ÓÍÏÖÅÔÅ ÅÇÏ ×ÅÒÎÕÔØ ÎÁÚÁÄ, ÉÓÐÏÌØÚÕÑ 459ÔÅËÓÔ. îÏ ÐÒÅÄÙÄÕÝÉÊ ÔÅËÓÔ ÎÅ ÂÕÄÅÔ ÐÏÔÅÒÑÎ -- ×Ù ÓÍÏÖÅÔÅ ÅÇÏ ×ÅÒÎÕÔØ
437ËÏÍÁÎÄÕ M-y. ðÏÓÌÅ ÔÏÇÏ, ËÁË ×Ù ×ÅÒÎÕÌÉ ÐÏÓÌÅÄÎÉÊ ÕÄÁÌÅÎÎÙÊ ÔÅËÓÔ, ÎÁÖÍÉÔÅ 460ÎÁÚÁÄ, ÉÓÐÏÌØÚÕÑ ËÏÍÁÎÄÕ M-y. ðÏÓÌÅ ÔÏÇÏ, ËÁË ×Ù ×ÅÒÎÕÌÉ ÐÏÓÌÅÄÎÉÊ
438M-y, É ÚÁÍÅÎÉÔÅ ÜÔÏÔ ×ÏÓÓÔÁÎÏ×ÌÅÎÎÙÊ ÔÅËÓÔ ÔÅÍ, ËÏÔÏÒÙÊ ÂÙÌ ÕÂÉÔ ÒÁÎÅÅ. 461ÕÄÁÌÅÎÎÙÊ ÔÅËÓÔ, ÎÁÖÍÉÔÅ M-y, É ÚÁÍÅÎÉÔÅ ÜÔÏÔ ×ÏÓÓÔÁÎÏ×ÌÅÎÎÙÊ ÔÅËÓÔ ÔÅÍ,
439îÁÖÁÔÉÅ M-y ÓÎÏ×Á É ÓÎÏ×Á ÂÕÄÅÔ ×ÏÚ×ÒÁÝÁÔØ ÒÁÎÅÅ ÕÂÉÔÙÊ ÔÅËÓÔ. ëÏÇÄÁ ×Ù 462ËÏÔÏÒÙÊ ÂÙÌ ÕÂÉÔ ÒÁÎÅÅ. îÁÖÉÍÁÑ M-y ÓÎÏ×Á É ÓÎÏ×Á, ×Ù ÂÕÄÅÔÅ ×ÏÚ×ÒÁÝÁÔØ
440ÄÏÓÔÉÇÎÉÔÅ ÉÓËÏÍÏÇÏ ÔÅËÓÔÁ, ×ÁÍ ÎÅ ÎÕÖÎÏ ÄÅÌÁÔØ ÎÉÞÅÇÏ ÂÏÌÅÅ ÞÔÏÂÙ ÓÏÈÒÁÎÉÔØ 463ÒÁÎÅÅ ÕÂÉÔÙÅ ÞÁÓÔÉ ÔÅËÓÔÁ. ëÏÇÄÁ ×Ù ÄÏÓÔÉÇÎÉÔÅ ÉÓËÏÍÏÇÏ ÔÅËÓÔÁ, ÔÏ ×ÁÍ ÎÅ
441ÅÇÏ. ðÒÏÓÔÏ ÐÒÏÄÏÌÖÁÊÔÅ ÒÅÄÁËÔÉÒÏ×ÁÎÉÅ, ÏÓÔÁ×É× ×ÏÓÓÔÁÎÏ×ÌÅÎÎÙÊ ÔÅËÓÔ ÔÁÍ, 464ÎÕÖÎÏ ÄÅÌÁÔØ ÎÉÞÅÇÏ ÞÔÏÂÙ ÓÏÈÒÁÎÉÔØ ÅÇÏ. ðÒÏÓÔÏ ÐÒÏÄÏÌÖÁÊÔÅ ÒÁÂÏÔÁÔØ,
442ÇÄÅ ÏÎ ÅÓÔØ. 465ÏÓÔÁ×É× ×ÏÓÓÔÁÎÏ×ÌÅÎÎÙÊ ÔÅËÓÔ ÔÁÍ, ÇÄÅ ÏÎ ÅÓÔØ.
443 466
444îÁÖÉÍÁÑ M-y ÄÏÓÔÁÔÏÞÎÏÅ ÞÉÓÌÏ ÒÁÚ, ×Ù ÍÏÖÅÔÅ ×ÅÒÎÕÔØÓÑ × ÎÁÞÁÌØÎÕÀ ÔÏÞËÕ 467îÁÖÉÍÁÑ M-y ÄÏÓÔÁÔÏÞÎÏÅ ÞÉÓÌÏ ÒÁÚ, ×Ù ÍÏÖÅÔÅ ×ÅÒÎÕÔØÓÑ × ÎÁÞÁÌØÎÕÀ ÔÏÞËÕ
445(ÎÁÉÂÏÌÅÅ ÒÁÎÎÅÅ ÕÄÁÌÅÎÉÅ). 468(ÎÁÉÂÏÌÅÅ ÒÁÎÎÅÅ ÕÄÁÌÅÎÉÅ).
446 469
447>> õÂÅÊÔÅ ÓÔÒÏËÕ, ÐÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ×ÏËÒÕÇ ÜÔÏÊ ÔÏÞËÉ, ÐÏÔÏÍ ÕÄÁÌÉÔÅ ÅÝÅ 470>> õÂÅÊÔÅ ÓÔÒÏËÕ, ÐÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ, É ÕÄÁÌÉÔÅ ÅÝÅ ÏÄÎÕ ÓÔÒÏËÕ. úÁÔÅÍ
448 ÏÄÎÕ ÓÔÒÏËÕ. úÁÔÅÍ ÉÓÐÏÌØÚÕÊÔÅ C-y ÄÌÑ ×ÏÓÓÔÁÎÏ×ÌÅÎÉÑ ×ÔÏÒÏÊ ÕÂÉÔÏÊ 471 ÉÓÐÏÌØÚÕÊÔÅ C-y ÄÌÑ ×ÏÓÓÔÁÎÏ×ÌÅÎÉÑ ×ÔÏÒÏÊ ÕÂÉÔÏÊ ÓÔÒÏËÉ, Á ÚÁÔÅÍ ÎÁÖÍÉÔÅ
449 ÓÔÒÏËÉ. úÁÔÅÍ ÉÓÐÏÌØÚÕÊÔÅ M-y, É ÏÎÁ ÂÕÄÅÔ ÚÁÍÅÎÅÎÁ ÐÅÒ×ÏÊ ÕÂÉÔÏÊ 472 M-y, É ÏÎÁ ÂÕÄÅÔ ÚÁÍÅÎÅÎÁ ÐÅÒ×ÏÊ ÕÂÉÔÏÊ ÓÔÒÏËÏÊ. îÁÖÍÉÔÅ M-y ÅÝÅ
450 ÓÔÒÏËÏÊ. îÁÖÍÉÔÅ M-y ÅÝÅ ÎÅÓËÏÌØËÏ ÒÁÚ, ÞÔÏÂÙ Õ×ÉÄÅÔØ ÐÏÌÕÞÅÎÎÙÊ 473 ÎÅÓËÏÌØËÏ ÒÁÚ, ÞÔÏÂÙ Õ×ÉÄÅÔØ ÐÏÌÕÞÅÎÎÙÊ ÒÅÚÕÌØÔÁÔ. ðÒÏÄÏÌÖÁÊÔÅ ×ÙÐÏÌÎÑÔØ
451 ÒÅÚÕÌØÔÁÔ. ðÒÏÄÏÌÖÁÊÔÅ ÄÅÌÁÔØ ÜÔÏ, ÐÏËÁ ×ÔÏÒÁÑ ÕÂÉÔÁÑ ÓÔÒÏËÁ ÎÅ ×ÅÒÎÅÔÓÑ, 474 ÜÔÕ ËÏÍÁÎÄÕ ÄÏ ÔÅÈ ÐÏÒ, ÐÏËÁ ×ÔÏÒÁÑ ÕÂÉÔÁÑ ÓÔÒÏËÁ ÎÅ ÂÕÄÅÔ ×ÏÓÓÔÁÎÏ×ÌÅÎÁ
452 É ÅÝÅ ÞÕÔØ-ÞÕÔØ. åÓÌÉ ×ÁÍ ÈÏÞÅÔÓÑ, ÔÏ ×Ù ÍÏÖÅÔÅ ÚÁÄÁ×ÁÔØ ÄÌÑ M-y 475 ÓÎÏ×Á. åÓÌÉ ×ÁÍ ÈÏÞÅÔÓÑ, ÔÏ ×Ù ÍÏÖÅÔÅ ÚÁÄÁ×ÁÔØ ÐÏÌÏÖÉÔÅÌØÎÙÅ É
453 ÐÏÌÏÖÉÔÅÌØÎÙÅ É ÏÔÒÉÃÁÔÅÌØÎÙÅ ÁÒÇÕÍÅÎÔÙ. 476 ÏÔÒÉÃÁÔÅÌØÎÙÅ ÁÒÇÕÍÅÎÔÙ ÄÌÑ ËÏÍÁÎÄÙ M-y.
454 477
455 478
456* ïôíåîá (UNDO) 479* ïôíåîá (UNDO)
457--------------- 480---------------
458 481
459åÓÌÉ ×Ù ÓÄÅÌÁÌÉ ÉÚÍÅÎÅÎÉÑ × ÔÅËÓÔÅ, É ÒÅÛÉÌÉ, ÞÔÏ ÏÛÉÂÌÉÓØ, ÍÏÖÅÔÅ 482åÓÌÉ ×Ù ÓÄÅÌÁÌÉ ÉÚÍÅÎÅÎÉÑ × ÔÅËÓÔÅ, É ÒÅÛÉÌÉ, ÞÔÏ ÏÛÉÂÌÉÓØ, ÔÏ ×Ù ÍÏÖÅÔÅ
460ÏÔÍÅÎÉÔØ ÉÚÍÅÎÅÎÉÑ ËÏÍÁÎÄÏÊ "ÏÔÍÅÎÁ", C-x u. 483ÏÔÍÅÎÉÔØ ÉÚÍÅÎÅÎÉÑ Ó ÐÏÍÏÝØÀ ËÏÍÁÎÄÙ "ÏÔÍÅÎÁ", ËÏÔÏÒÁÑ ÐÒÉ×ÑÚÁÎÁ Ë ÓÏÞÅÔÁÎÉÀ
484ËÌÁ×ÉÛ C-x u.
461 485
462ïÂÙÞÎÏ, C-x u ÏÔÍÅÎÑÅÔ ÉÚÍÅÎÅÎÉÑ, ÓÄÅÌÁÎÎÙÅ ÏÄÎÏÊ ËÏÍÁÎÄÏÊ; ÅÓÌÉ ÐÏ×ÔÏÒÉÔØ 486ïÂÙÞÎÏ, C-x u ÏÔÍÅÎÑÅÔ ÉÚÍÅÎÅÎÉÑ, ÓÄÅÌÁÎÎÙÅ ÏÄÎÏÊ ËÏÍÁÎÄÏÊ; ÅÓÌÉ ÐÏ×ÔÏÒÉÔØ
463C-x u ÎÅÓËÏÌØËÏ ÒÁÚ ÐÏÄÒÑÄ, ËÁÖÄÙÊ ÒÁÚ ÂÕÄÅÔ ÏÔÍÅÎÑÔØÓÑ ÅÝÅ ÏÄÎÁ ËÏÍÁÎÄÁ. 487C-x u ÎÅÓËÏÌØËÏ ÒÁÚ ÐÏÄÒÑÄ, ÔÏ ËÁÖÄÙÊ ÒÁÚ ÂÕÄÅÔ ÏÔÍÅÎÑÔØÓÑ ÅÝÅ ÏÄÎÁ ËÏÍÁÎÄÁ.
464 488
465îÏ ÅÓÔØ Ä×Á ÉÓËÌÀÞÅÎÉÑ: ËÏÍÁÎÄÙ, ËÏÔÏÒÙÅ ÎÅ ÉÚÍÅÎÑÀÔ ÔÅËÓÔ, ÎÅ ÕÞÉÔÙ×ÁÀÔÓÑ 489îÏ ÅÓÔØ Ä×Á ÉÓËÌÀÞÅÎÉÑ -- ËÏÍÁÎÄÙ ÎÅ ÉÚÍÅÎÑÀÝÉÅ ÔÅËÓÔ, ÎÅ ÕÞÉÔÙ×ÁÀÔÓÑ (ÓÀÄÁ
466(ÜÔÏ ×ËÌÀÞÁÅÔ ËÏÍÁÎÄÙ ÐÅÒÅÍÅÝÅÎÉÑ ËÕÒÓÏÒÁ É ÐÒÏËÒÕÔËÉ), É ÓÁÍÏ×ÓÔÁ×ÌÑÀÝÉÅÓÑ 490×ËÌÀÞÁÅÔÓÑ ËÏÍÁÎÄÙ ÐÅÒÅÍÅÝÅÎÉÑ ËÕÒÓÏÒÁ É ÐÒÏËÒÕÔËÉ), É ËÏÍÁÎÄÙ ×ÓÔÁ×ËÉ
467(self-inserting) ÓÉÍ×ÏÌÙ ÏÂÒÁÂÁÔÙ×ÁÀÔÓÑ ÇÒÕÐÐÁÍÉ ÄÏ 20. (üÔÏ ÕÍÅÎØÛÁÅÔ 491ÓÉÍ×ÏÌÏ× ÏÂÒÁÂÁÔÙ×ÁÀÔÓÑ ÇÒÕÐÐÁÍÉ ÄÏ 20 ÓÉÍ×ÏÌÏ×. (üÔÏ ÕÍÅÎØÛÁÅÔ ÞÉÓÌÏ
468ÞÉÓÌÏ C-x u ËÏÔÏÒÙÅ ×Ù ÍÏÖÅÔÅ ÎÁÂÒÁÔØ ÄÌÑ ÏÔÍÅÎÙ ××ÏÄÁ ÔÅËÓÔÁ). 492ÎÁÖÁÔÉÊ C-x u ËÏÔÏÒÙÅ ×ÁÍ ÎÕÖÎÏ ÂÕÄÅÔ ÎÁÂÒÁÔØ ÄÌÑ ÏÔÍÅÎÙ ××ÏÄÁ ÔÅËÓÔÁ).
469 493
470>> õÂÅÊÔÅ ÜÔÕ ÓÔÒÏËÕ ÉÓÐÏÌØÚÕÑ C-k, ÚÁÔÅÍ ÎÁÂÅÒÉÔÅ C-x u É ÏÎÁ ÄÏÌÖÎÁ 494>> õÂÅÊÔÅ ÜÔÕ ÓÔÒÏËÕ Ó ÐÏÍÏÝØÀ C-k, Á ÚÁÔÅÍ ÎÁÂÅÒÉÔÅ C-x u É ÓÔÒÏËÁ ÄÏÌÖÎÁ
471 ×ÅÒÎÕÔØÓÑ ÎÁÚÁÄ. 495 ×ÅÒÎÕÔØÓÑ ÎÁÚÁÄ.
472 496
473C-_ ÁÌØÔÅÒÎÁÔÉ×ÎÁÑ ËÏÍÁÎÄÁ ÏÔÍÅÎÙ; ÏÎÁ ÒÁÂÏÔÁÅÔ ÔÁËÖÅ ËÁË É C-x u, ÎÏ ÌÅÇÞÅ 497C-_ -- ÜÔÏ ÅÝÅ ËÏÍÁÎÄÁ ÏÔÍÅÎÙ; ÏÎÁ ÒÁÂÏÔÁÅÔ ÔÏÞÎÏ ÔÁËÖÅ ËÁË É C-x u, ÎÏ
474× ÉÓÐÏÌØÚÏ×ÁÎÉÉ ÎÅÓËÏÌØËÏ ÒÁÚ ÐÏÄÒÑÄ. îÅÕÄÏÂÎÏÅ ÐÏÌÏÖÅÎÉÅ C-_ ÎÁ ÎÅËÏÔÏÒÙÈ 498ÌÅÇÞÅ × ÉÓÐÏÌØÚÏ×ÁÎÉÉ, ÅÓÌÉ ×ÁÍ ÎÕÖÎÏ ×ÙÐÏÌÎÉÔØ ÅÅ ÎÅÓËÏÌØËÏ ÒÁÚ
475ËÌÁ×ÉÁÔÕÒÁÈ ÄÅÌÁÅÔ ÎÅÏÞÅ×ÉÄÎÙÍ ÓÐÏÓÏ ÅÅ ÎÁÂÏÒÁ. ðÏÜÔÏÍÕ ÍÙ ÐÒÅÄÌÁÇÁÅÍ 499ÐÏÄÒÑÄ. îÅÕÄÏÂÎÏÅ ÐÏÌÏÖÅÎÉÅ C-_ ÎÁ ÎÅËÏÔÏÒÙÈ ËÌÁ×ÉÁÔÕÒÁÈ ÄÅÌÁÅÔ ÎÅ ÏÞÅ×ÉÄÎÙÍ
476ÉÓÐÏÌØÚÏ×ÁÔØ C-x u. îÁ ÎÅËÏÔÏÒÙÈ ÔÅÒÍÉÎÁÌÁÈ, ×Ù ÍÏÖÅÔÅ ÎÁÂÉÒÁÔØ C-_, ÎÁÖÉÍÁÑ 500ÓÐÏÓÏ ÅÅ ÎÁÂÏÒÁ. ðÏÜÔÏÍÕ ÍÙ ÐÒÅÄÌÁÇÁÅÍ ÉÓÐÏÌØÚÏ×ÁÔØ C-x u. îÁ ÎÅËÏÔÏÒÙÈ
477/ É ÕÄÅÒÖÉ×ÁÑ ËÌÁ×ÉÛÕ CONTROL. 501ÔÅÒÍÉÎÁÌÁÈ, ×Ù ÍÏÖÅÔÅ ÎÁÂÉÒÁÔØ C-_, ÎÁÖÉÍÁÑ / É ÕÄÅÒÖÉ×ÁÑ ËÌÁ×ÉÛÕ CONTROL.
478 502
479þÉÓÌÏ×ÏÊ ÁÒÇÕÍÅÎÔ ÄÌÑ C-_ ÉÌÉ C-x u ÒÁÂÏÔÁÅÔ ËÁË ÓÞÅÔÞÉË ÐÏ×ÔÏÒÅÎÉÑ. 503þÉÓÌÏ×ÏÊ ÁÒÇÕÍÅÎÔ ÄÌÑ C-_ ÉÌÉ C-x u ÉÓÐÏÌØÚÕÅÔÓÑ ËÁË ÓÞÅÔÞÉË ÐÏ×ÔÏÒÅÎÉÊ.
480 504
481÷Ù ÍÏÖÅÔÅ ÏÔÍÅÎÉÔØ ÕÄÁÌÅÎÉÅ ÔÅËÓÔÁ ÔÏÞÎÏ ÔÁË ÖÅ, ËÁË ÏÔÍÅÎÕ ÕÂÉÔÉÑ 505÷Ù ÍÏÖÅÔÅ ÏÔÍÅÎÉÔØ ÕÄÁÌÅÎÉÅ ÔÅËÓÔÁ ÔÏÞÎÏ ÔÁË ÖÅ, ËÁË É ÏÔÍÅÎÕ ÕÂÉÔÉÑ ÔÅËÓÔÁ.
482ÔÅËÓÔÁ. ïÔÌÉÞÉÅ ÍÅÖÄÕ ÕÂÉÊÓÔ×ÏÍ É ÕÄÁÌÅÎÉÅÍ ÞÅÇÏ-ÌÉÂÏ ÚÁËÌÀÞÁÅÔÓÑ × ÔÏÍ, ÞÔÏ 506ïÔÌÉÞÉÅ ÍÅÖÄÕ ÕÂÉÊÓÔ×ÏÍ É ÕÄÁÌÅÎÉÅÍ ÞÅÇÏ-ÌÉÂÏ ÚÁËÌÀÞÁÅÔÓÑ × ÔÏÍ, ÞÔÏ ×Ù
483×Ù ÍÏÖÅÔÅ ×ÏÓÓÔÁÎÏ×ÉÔØ ÕÂÉÔÙÊ ÔÅËÓÔ Ó ÐÏÍÏÝØÀ C-y; ÎÏ ÜÔÏ ÎÅ ÄÅÌÁÅÔ ÒÁÚÌÉÞÉÊ 507ÍÏÖÅÔÅ ×ÏÓÓÔÁÎÏ×ÉÔØ ÕÂÉÔÙÊ ÔÅËÓÔ Ó ÐÏÍÏÝØÀ ËÏÍÁÎÄÙ C-y; ÎÏ ÄÌÑ ËÏÍÁÎÄÙ
484ÄÌÑ ÏÔÍÅÎÙ. 508ÏÔÍÅÎÙ ÎÅÔ ÎÉËÁËÏÊ ÒÁÚÎÉÃÙ ÍÅÖÄÕ ÜÔÉÍÉ ÏÐÅÒÁÃÉÑÍÉ.
485 509
486* æáêìù 510* æáêìù
487------- 511-------
488 512
489þÔÏÂÙ ÓÏÚÄÁÎÎÙÊ ÔÅËÓÔ ÍÏÖÎÏ ÂÙÌÏ ÒÅÄÁËÔÉÒÏ×ÁÔØ ÐÏÚÖÅ, ×Ù ÄÏÌÖÎÙ ÅÇÏ 513þÔÏÂÙ ÓÏÚÄÁÎÎÙÊ ÔÅËÓÔ ÍÏÖÎÏ ÂÙÌÏ ÒÅÄÁËÔÉÒÏ×ÁÔØ ÐÏÚÖÅ, ×Ù ÄÏÌÖÎÙ ÐÏÍÅÓÔÉÔØ
490ÐÏÍÅÓÔÉÔØ × ÆÁÊÌ. éÎÁÞÅ, ÏÎ ÉÓÞÅÚÎÅÔ, ËÏÇÄÁ ×Ù ×ÙÊÄÉÔÅ ÉÚ Emacs. ÷Ù ÐÏÍÅÝÁÅÔÅ 514ÅÇÏ × ÆÁÊÌ. éÎÁÞÅ, ÏÎ ÉÓÞÅÚÎÅÔ, ËÏÇÄÁ ×Ù ÐÏËÉÎÅÔÅ Emacs. ÷Ù ÐÏÍÅÝÁÅÔÅ ×ÁÛ
491×ÁÛ ÔÅËÓÔ × ÆÁÊÌ, "ÏÔËÒÙ×ÁÑ" ÆÁÊÌ. (åÝÅ ÜÔÏ ÎÁÚÙ×ÁÀÔ "ÐÏÓÅÔÉÔØ" ÆÁÊÌ.) 515ÔÅËÓÔ × ÆÁÊÌ, "ÏÔËÒÙ×ÁÑ" ÆÁÊÌ (üÔÕ ÏÐÅÒÁÃÉÀ ÔÁËÖÅ ÎÁÚÙ×ÁÀÔ "ÐÏÓÅÔÉÔØ" ÆÁÊÌ).
492 516
493ïÔËÒÙÔØ ÆÁÊÌ ÏÚÎÁÞÁÅÔ ÐÏÓÍÏÔÒÅÔØ ÅÇÏ ÓÏÄÅÒÖÉÍÏÅ, ÉÓÐÏÌØÚÕÑ Emacs. ÷Ï ÍÎÏÇÉÈ 517ïÔËÒÙÔØ ÆÁÊÌ ÏÚÎÁÞÁÅÔ ÐÏÓÍÏÔÒÅÔØ ÅÇÏ ÓÏÄÅÒÖÉÍÏÅ, Ó ÐÏÍÏÝØÀ Emacs. ÷Ï ÍÎÏÇÉÈ
494ÓÌÕÞÁÑÈ, ÜÔÏ ÐÒÏÉÓÈÏÄÉÔ, ËÏÇÄÁ ×Ù ÒÅÄÁËÔÉÒÕÅÔÅ ÆÁÊÌ ÓÁÍÉ. ïÄÎÁËÏ ×ÁÛÉ 518ÓÌÕÞÁÑÈ, ÜÔÏ ÐÒÏÉÓÈÏÄÉÔ ÔÏÇÄÁ, ËÏÇÄÁ ×Ù ÒÅÄÁËÔÉÒÕÅÔÅ ÆÁÊÌ ÓÁÍÉ. ïÄÎÁËÏ ×ÁÛÉ
495ÉÚÍÅÎÅÎÉÑ, ÓÄÅÌÁÎÎÙÅ Ó ÉÓÐÏÌØÚÏ×ÁÎÉÅÍ Emacs ÎÅ ÂÕÄÕÔ ÚÁÆÉËÓÉÒÏ×ÁÎÙ, ÐÏËÁ ×Ù 519ÉÚÍÅÎÅÎÉÑ, ÓÄÅÌÁÎÎÙÅ Ó ÉÓÐÏÌØÚÏ×ÁÎÉÅÍ Emacs ÎÅ ÂÕÄÕÔ ÚÁÆÉËÓÉÒÏ×ÁÎÙ, ÐÏËÁ ×Ù
496ÎÅ ÓÏÈÒÁÎÉÔÅ ÆÁÊÌ. ôÁË ×Ù ÍÏÖÅÔÅ ÎÅ ÏÓÔÁ×ÌÑÔØ ÐÏÌÕÉÚÍÅÎÅÎÎÙÊ ÆÁÊÌ × ÓÉÓÔÅÍÅ, 520ÎÅ ÓÏÈÒÁÎÉÔÅ ÆÁÊÌ. ÷Ù ÍÏÖÅÔÅ ÎÅ ÏÓÔÁ×ÌÑÔØ ÞÁÓÔÉÞÎÏ ÉÚÍÅÎÅÎÎÙÊ ÆÁÊÌ ×
497ÅÓÌÉ ×Ù ÎÅ ÈÏÔÉÔÅ ÜÔÏÇÏ. äÁÖÅ ËÏÇÄÁ ×Ù ÓÏÈÒÁÎÑÅÔÅ ÆÁÊÌ, Emacs ÏÓÔÁ×ÌÑÅÔ 521ÓÉÓÔÅÍÅ, ÅÓÌÉ ×Ù ÎÅ ÈÏÔÉÔÅ ÅÇÏ ÓÏÈÒÁÎÑÔØ. äÁÖÅ ËÏÇÄÁ ×Ù ÓÏÈÒÁÎÑÅÔÅ ÆÁÊÌ, ÔÏ
498ÏÒÉÇÉÎÁÌØÎÙÊ ÆÁÊÌ Ó ÉÚÍÅÎÅÎÎÙÍ ÉÍÅÎÅÍ, ÞÔÏÂÙ ×Ù ÍÏÇÌÉ ÐÏÚÖÅ ÒÅÛÉÔØ, ÞÔÏ ×ÁÛÉ 522Emacs ÏÓÔÁ×ÌÑÅÔ ÏÒÉÇÉÎÁÌØÎÙÊ ÆÁÊÌ, ÎÏ Ó ÄÒÕÇÉÍ ÉÍÅÎÅÍ, ÔÁË ÞÔÏ ×Ù ÐÏÚÖÅ
499ÉÚÍÅÎÅÎÉÑ ÂÙÌÉ ÏÛÉÂÏÞÎÙ. 523ÍÏÖÅÔÅ ÏÔÍÅÎÉÔØ ×ÁÛÉ ÉÚÍÅÎÅÎÉÑ, ×ÅÒÎÕ×ÛÉÓØ Ë ÐÒÅÄÙÄÕÝÅÊ ×ÅÒÓÉÉ ÆÁÊÌÁ.
500 524
501åÓÌÉ ×Ù ÐÏÓÍÏÔÒÉÔÅ × ÎÉÖÎÀÀ ÞÁÓÔØ ÜËÒÁÎÁ, ÔÏ ×Ù Õ×ÉÄÉÔÅ ÓÔÒÏËÕ, ËÏÔÏÒÁÑ 525åÓÌÉ ×Ù ÐÏÓÍÏÔÒÉÔÅ × ÎÉÖÎÀÀ ÞÁÓÔØ ÜËÒÁÎÁ, ÔÏ ×Ù Õ×ÉÄÉÔÅ ÓÔÒÏËÕ, ËÏÔÏÒÁÑ
502ÎÁÞÉÎÁÅÔÓÑ Ó ÔÉÒÅ É ÎÁÞÉÎÁÅÔÓÑ Ó "--:-- TUTORIAL.ru" ÉÌÉ ÞÅÇÏ-ÔÏ 526ÎÁÞÉÎÁÅÔÓÑ Ó ÔÉÒÅ É ÅÅ ÎÁÞÁÌÏ ×ÙÇÌÑÄÉÔ ÐÒÉÍÅÒÎÏ ÔÁË "--:-- TUTORIAL.ru". üÔÁ
503ÐÏÄÏÂÎÏÇÏ. üÔÁ ÞÁÓÔØ ÜËÒÁÎÁ ×ÓÅÇÄÁ ÐÏËÁÚÙ×ÁÅÔ ÉÍÑ ÆÁÊÌÁ, ËÏÔÏÒÙÊ ×Ù 527ÞÁÓÔØ ÜËÒÁÎÁ ×ÓÅÇÄÁ ÐÏËÁÚÙ×ÁÅÔ ÉÍÑ ÏÔËÒÙÔÏÇÏ ×ÁÍÉ ÆÁÊÌÁ. éÔÁË, ÓÅÊÞÁÓ ×Ù
504ÏÔËÒÙÌÉ. éÔÁË, ÓÅÊÞÁÓ ×Ù ÏÔËÒÙÌÉ ÆÁÊÌ Ó ÉÍÅÎÅÍ "TUTORIAL.ru", ËÏÔÏÒÙÊ 528ÏÔËÒÙÌÉ ÆÁÊÌ Ó ÉÍÅÎÅÍ "TUTORIAL.ru", ËÏÔÏÒÙÊ Ñ×ÌÑÅÔÓÑ ×ÁÛÅÊ ÐÅÒÓÏÎÁÌØÎÏÊ
505Ñ×ÌÑÅÔÓÑ ×ÁÛÅÊ ÐÅÒÓÏÎÁÌØÎÏÊ ËÏÐÉÅÊ ÕÞÅÂÎÉËÁ Emacs. äÌÑ ÌÀÂÏÇÏ ÆÁÊÌÁ, ËÏÔÏÒÙÊ 529ËÏÐÉÅÊ ÕÞÅÂÎÉËÁ Emacs. äÌÑ ÌÀÂÏÇÏ ÆÁÊÌÁ, ËÏÔÏÒÙÊ ×Ù ÏÔËÒÏÅÔÅ, ÅÇÏ ÉÍÑ ÂÕÄÅÔ
506×Ù ÏÔËÒÏÅÔÅ, ÉÍÑ ÜÔÏÇÏ ÆÁÊÌÁ ÐÏÑ×ÉÔÓÑ × ÜÔÏÍ ÍÅÓÔÅ. 530ÐÏËÁÚÁÎÏ × ÜÔÏÊ ÓÔÒÏËÅ.
507 531
508ïÄÎÏÊ ÉÚ ÓÐÅÃÉÁÌØÎÙÈ ×ÅÝÅÊ, ËÏÔÏÒÕÀ ×ÁÍ ÎÕÖÎÏ ÚÎÁÔØ Ï ËÏÍÁÎÄÅ ÏÔËÒÙÔÉÑ ÆÁÊÌÁ, 532ïÄÎÏÊ ÉÚ ×ÅÝÅÊ, ËÏÔÏÒÙÅ ×ÁÍ ÎÕÖÎÏ ÚÎÁÔØ Ï ËÏÍÁÎÄÅ ÏÔËÒÙÔÉÑ ÆÁÊÌÁ -- ÜÔÏ ÔÏ,
509ÜÔÏ ÔÏ, ÞÔÏ ×Ù ÄÏÌÖÎÙ ××ÅÓÔÉ ÉÍÑ ÆÁÊÌÁ, ËÏÔÏÒÙÊ ÎÕÖÎÏ ÞÉÔÁÔØ. íÙ ÜÔÏ 533ÞÔÏ ×Ù ÄÏÌÖÎÙ ××ÅÓÔÉ ÉÍÑ ÆÁÊÌÁ, ËÏÔÏÒÙÊ ÎÕÖÎÏ ÏÔËÒÙÔØ. ôÁËÉÅ ËÏÍÁÎÄÙ ÍÙ
510ÎÁÚÙ×ÁÅÍ ËÏÍÁÎÄÏÊ, "ÞÉÔÁÀÝÅÊ ÁÒÇÕÍÅÎÔ Ó ÔÅÒÍÉÎÁÌÁ" (× ÜÔÏÍ ÓÌÕÞÁÅ, ÁÒÇÕÍÅÎÔÏÍ 534ÎÁÚÙ×ÁÅÍ ËÏÍÁÎÄÁÍÉ "ÞÉÔÁÀÝÉÍÉ ÁÒÇÕÍÅÎÔ Ó ÔÅÒÍÉÎÁÌÁ" (× ÎÁÛÅÍ ÓÌÕÞÁÅ,
511Ñ×ÌÑÅÔÓÑ ÉÍÑ ÆÁÊÌÁ). ðÏÓÌÅ ××ÏÄÁ ËÏÍÁÎÄÙ 535ÁÒÇÕÍÅÎÔÏÍ Ñ×ÌÑÅÔÓÑ ÉÍÑ ÆÁÊÌÁ). ðÏÓÌÅ ××ÏÄÁ ËÏÍÁÎÄÙ
512 536
513 C-x C-f ïÔËÒÙÔØ (ÎÁÊÔÉ) ÆÁÊÌ 537 C-x C-f ïÔËÒÙÔØ (ÎÁÊÔÉ) ÆÁÊÌ
514 538
515Emacs ÐÏÐÒÏÓÉÔ ×ÁÓ ××ÅÓÔÉ ÉÍÑ ÆÁÊÌÁ. éÍÑ ÆÁÊÌÁ ×Ù ÎÁÂÅÒÅÔÅ × ÎÉÖÎÅÊ ÓÔÒÏËÅ 539Emacs ÐÏÐÒÏÓÉÔ ×ÁÓ ××ÅÓÔÉ ÉÍÑ ÆÁÊÌÁ. éÍÑ ÆÁÊÌÁ ÎÁÂÉÒÁÅÔÓÑ × ÎÉÖÎÅÊ ÓÔÒÏËÅ
516ÜËÒÁÎÁ. îÉÖÎÑÑ ÓÔÒÏËÁ ÎÁÚÙ×ÁÅÔÓÑ ÍÉÎÉ-ÂÕÆÅÒ, ÏÎ ÉÓÐÏÌØÚÕÅÔÓÑ ÄÌÑ ËÏÒÏÔËÏÇÏ 540ÜËÒÁÎÁ. îÉÖÎÑÑ ÓÔÒÏËÁ ÎÁÚÙ×ÁÅÔÓÑ ÍÉÎÉ-ÂÕÆÅÒÏÍ -- ÏÎ ÓÐÅÃÉÁÌØÎÏ ÉÓÐÏÌØÚÕÅÔÓÑ
517××ÏÄÁ. ÷Ù ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ ÏÂÙÞÎÙÅ ËÏÍÁÎÄÙ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ Emacs ÄÌÑ 541ÄÌÑ ××ÏÄÁ ÎÅÂÏÌØÛÏÇÏ ËÏÌÉÞÅÓÔ×Á ÄÁÎÎÙÈ. äÌÑ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ ÉÍÅÎÉ ÆÁÊÌÁ ×Ù
518ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ ÉÍÅÎÉ. 542ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ ÏÂÙÞÎÙÅ ËÏÍÁÎÄÙ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ Emacs.
519 543
520ëÏÇÄÁ ×Ù ××ÏÄÉÔÅ ÉÍÑ ÆÁÊÌÁ (ÉÌÉ ÌÀÂÕÀ ÉÎÆÏÒÍÁÃÉÀ × ÍÉÎÉ-ÂÕÆÅÒ), ×Ù ÍÏÖÅÔÅ 544ëÏÇÄÁ ×Ù ××ÏÄÉÔÅ ÉÍÑ ÆÁÊÌÁ (ÉÌÉ ÌÀÂÕÀ ÄÒÕÇÕÀ ÉÎÆÏÒÍÁÃÉÀ × ÍÉÎÉ-ÂÕÆÅÒÅ), ×Ù
521ÏÔÍÅÎÉÔØ ËÏÍÁÎÄÕ ÎÁÖÁ× C-g. 545ÍÏÖÅÔÅ ÏÔÍÅÎÉÔØ ÔÅËÕÝÕÀ ËÏÍÁÎÄÕ ÎÁÖÁ× C-g.
522 546
523>> îÁÖÍÉÔÅ C-x C-f, ÚÁÔÅÍ ÎÁÖÍÉÔÅ C-g. üÔÏ ÏÔÍÅÎÉÔ ÍÉÎÉ-ÂÕÆÅÒ, É ËÏÍÁÎÄÕ 547>> îÁÖÍÉÔÅ C-x C-f, Á ÚÁÔÅÍ ÎÁÖÍÉÔÅ C-g. üÔÏ ÄÅÊÓÔ×ÉÅ ÏÔÍÅÎÉÔ ××ÏÄ ÄÁÎÎÙÈ ×
524 C-x C-f, ËÏÔÏÒÁÑ ÉÓÐÏÌØÚÏ×ÁÌÁ ÍÉÎÉ-ÂÕÆÅÒ. ÷ ÉÔÏÇÅ, ×Ù ÎÅ ÏÔËÒÙÌÉ ÎÉ ÏÄÎÏÇÏ 548 ÍÉÎÉ-ÂÕÆÅÒÅ, É ÚÁÏÄÎÏ É ËÏÍÁÎÄÕ C-x C-f, ËÏÔÏÒÁÑ ÉÓÐÏÌØÚÏ×ÁÌÁ ÍÉÎÉ-ÂÕÆÅÒ
525 ÆÁÊÌÁ. 549 ÄÌÑ ÐÏÌÕÞÅÎÉÑ ÁÒÇÕÍÅÎÔÁ. ÷ ÉÔÏÇÅ, ×Ù ÎÅ ÏÔËÒÙÌÉ ÎÉ ÏÄÎÏÇÏ ÆÁÊÌÁ.
526 550
527ëÏÇÄÁ ×Ù ÚÁ×ÅÒÛÉÔÅ ××ÏÄ ÉÍÅÎÉ ÆÁÊÌÁ, ÎÁÖÍÉÔÅ <Return>. äÁÌÅÅ ÓÒÁÂÏÔÁÅÔ 551ëÏÇÄÁ ×Ù ÚÁ×ÅÒÛÉÔÅ ××ÏÄ ÉÍÅÎÉ ÆÁÊÌÁ, ÎÁÖÍÉÔÅ <Return>. äÁÌÅÅ ÓÒÁÂÏÔÁÅÔ
528ËÏÍÁÎÄÁ C-x C-f, ËÏÔÏÒÁÑ ÏÔËÒÏÅÔ ÕËÁÚÁÎÎÙÊ ×ÁÍÉ ÆÁÊÌ. íÉÎÉ-ÂÕÆÅÒ ÉÓÞÅÚÎÅÔ, 552ËÏÍÁÎÄÁ C-x C-f, ËÏÔÏÒÁÑ ÏÔËÒÏÅÔ ÕËÁÚÁÎÎÙÊ ×ÁÍÉ ÆÁÊÌ. íÉÎÉ-ÂÕÆÅÒ ÉÓÞÅÚÎÅÔ,
529ËÏÇÄÁ ËÏÍÁÎÄÁ C-x C-f ÚÁ×ÅÒÛÉÔÓÑ. 553ËÏÇÄÁ ËÏÍÁÎÄÁ C-x C-f ÚÁ×ÅÒÛÉÔÓÑ.
530 554
531é ÍÇÎÏ×ÅÎÉÅÍ ÐÏÚÖÅ ÓÏÄÅÒÖÉÍÏÅ ÆÁÊÌÁ ÐÏÑ×ÉÔÓÑ ÎÁ ÜËÒÁÎÅ, É ×Ù ÓÍÏÖÅÔÅ ÅÇÏ 555á ÍÇÎÏ×ÅÎÉÅÍ ÐÏÚÖÅ ÓÏÄÅÒÖÉÍÏÅ ÆÁÊÌÁ ÐÏÑ×ÉÔÓÑ ÎÁ ÜËÒÁÎÅ, É ×Ù ÓÍÏÖÅÔÅ ÅÇÏ
532ÒÅÄÁËÔÉÒÏ×ÁÔØ. ëÏÇÄÁ ×Ù ÚÁËÏÎÞÉÔÅ ÒÅÄÁËÔÉÒÏ×ÁÎÉÅ, ÞÔÏÂÙ ÓÏÈÒÁÎÉÔØ ÉÚÍÅÎÅÎÉÑ, 556ÒÅÄÁËÔÉÒÏ×ÁÔØ. ëÏÇÄÁ ×Ù ÚÁËÏÎÞÉÔÅ ÒÅÄÁËÔÉÒÏ×ÁÎÉÅ, ÔÏ ÄÌÑ ÔÏÇÏ, ÞÔÏÂÙ
533ÎÁÂÅÒÉÔÅ ËÏÍÁÎÄÕ 557ÓÏÈÒÁÎÉÔØ ÉÚÍÅÎÅÎÉÑ, ÎÁÂÅÒÉÔÅ ËÏÍÁÎÄÕ
534 558
535 C-x C-s óÏÈÒÁÎÉÔØ ÆÁÊÌ 559 C-x C-s óÏÈÒÁÎÉÔØ ÆÁÊÌ
536 560
537üÔÏ ÓËÏÐÉÒÕÅÔ ÔÅËÓÔ ÉÚ Emacs × ÆÁÊÌ. ÷ ÐÅÒ×ÙÊ ÒÁÚ, ËÏÇÄÁ ×Ù ÜÔÏ ÓÄÅÌÁÅÔÅ, 561üÔÁ ËÏÍÁÎÄÁ ÓËÏÐÉÒÕÅÔ ÔÅËÓÔ ÉÚ Emacs × ÆÁÊÌ. ÷ ÐÅÒ×ÙÊ ÒÁÚ, ËÏÇÄÁ ×Ù ÜÔÏ
538Emacs ÐÅÒÅÉÍÅÎÕÅÔ ÏÒÉÇÉÎÁÌØÎÙÊ ÆÁÊÌ × ÆÁÊÌ Ó ÎÏ×ÙÍ ÉÍÅÎÅÍ, ÞÔÏÂÙ ÏÎ ÎÅ 562ÓÄÅÌÁÅÔÅ, Emacs ÐÅÒÅÉÍÅÎÕÅÔ ÏÒÉÇÉÎÁÌØÎÙÊ ÆÁÊÌ × ÆÁÊÌ Ó ÎÏ×ÙÍ ÉÍÅÎÅÍ, ÞÔÏÂÙ
539ÐÏÔÅÒÑÌÓÑ. îÏ×ÏÅ ÉÍÑ ÐÏÌÕÞÁÅÔÓÑ ÄÏÂÁ×ÌÅÎÉÅÍ ÓÉÍ×ÏÌÁ "~" Ë ÏÒÉÇÉÎÁÌØÎÏÍÕ 563ÎÅ ÐÏÔÅÒÑÌÏÓØ ÐÒÅÄÙÄÕÝÅÅ ÓÏÄÅÒÖÉÍÏÅ ÆÁÊÌÁ. îÏ×ÏÅ ÉÍÑ ÐÏÌÕÞÁÅÔÓÑ ÄÏÂÁ×ÌÅÎÉÅÍ
540ÉÍÅÎÉ ÆÁÊÌÁ. 564ÓÉÍ×ÏÌÁ "~" Ë ÏÒÉÇÉÎÁÌØÎÏÍÕ ÉÍÅÎÉ ÆÁÊÌÁ.
541 565
542ëÏÇÄÁ ÓÏÈÒÁÎÅÎÉÅ ÚÁ×ÅÒÛÉÔÓÑ, Emacs ÎÁÐÅÞÁÔÁÅÔ ÉÍÑ ÚÁÐÉÓÁÎÎÏÇÏ ÆÁÊÌÁ. ÷Ù 566ëÏÇÄÁ ÓÏÈÒÁÎÅÎÉÅ ÚÁ×ÅÒÛÉÔÓÑ, Emacs ÏÔÏÂÒÁÚÉÔ ÉÍÑ ÚÁÐÉÓÁÎÎÏÇÏ ÆÁÊÌÁ. ÷Ù
543ÄÏÌÖÎÙ ÓÏÈÒÁÎÑÔØ ÉÚÍÅÎÅÎÉÑ ÄÏÓÔÁÔÏÞÎÏ ÞÁÓÔÏ, ÞÔÏÂÙ ÎÅ ÐÏÔÅÒÑÔØ ÍÎÏÇÏ 567ÄÏÌÖÎÙ ÓÏÈÒÁÎÑÔØ ÉÚÍÅÎÅÎÉÑ ÄÏÓÔÁÔÏÞÎÏ ÞÁÓÔÏ, ÞÔÏÂÙ ÎÅ ÐÏÔÅÒÑÔØ ×ÎÅÓÅÎÎÙÅ
544ÒÁÂÏÔÙ, ÅÓÌÉ ×ÄÒÕÇ ÓÉÓÔÅÍÁ ÚÁ×ÉÓÎÅÔ. 568ÉÚÍÅÎÅÎÉÑ, ÅÓÌÉ ÓÉÓÔÅÍÁ ×ÄÒÕÇ ÚÁ×ÉÓÎÅÔ.
545 569
546>> îÁÂÅÒÉÔÅ C-x C-s, ÓÏÈÒÁÎÉÔÅ ×ÁÛÕ ËÏÐÉÀ ÕÞÅÂÎÉËÁ. ÷ ÎÉÖÎÅÊ ÓÔÒÏËÅ ÜËÒÁÎÁ 570>> îÁÂÅÒÉÔÅ C-x C-s, ÓÏÈÒÁÎÉÔÅ ×ÁÛÕ ËÏÐÉÀ ÕÞÅÂÎÉËÁ. ÷ ÎÉÖÎÅÊ ÓÔÒÏËÅ ÜËÒÁÎÁ
547 ÄÏÌÖÎÁ ÐÏÑ×ÉÔØÓÑ ÎÁÄÐÉÓØ "Wrote ...TUTORIAL.ru". 571 ÄÏÌÖÎÁ ÐÏÑ×ÉÔØÓÑ ÎÁÄÐÉÓØ "Wrote ...TUTORIAL.ru".
548 572
549úáíåþáîéå: îÁ ÎÅËÏÔÏÒÙÈ ÓÉÓÔÅÍÁÈ, ××ÏÄ C-x C-s ÚÁÂÌÏËÉÒÕÅÔ ÜËÒÁÎ É ×Ù ÎÅ 573úáíåþáîéå: îÁ ÎÅËÏÔÏÒÙÈ ÓÉÓÔÅÍÁÈ, ××ÏÄ C-x C-s ÚÁÂÌÏËÉÒÕÅÔ ÜËÒÁÎ, ÔÁË ÞÔÏ ×Ù
550Õ×ÉÄÉÔÅ ÐÏÓÌÅÄÕÀÝÅÇÏ ×Ù×ÏÄÁ Emacs`Á. üÔÏ ÏÚÎÁÞÁÅÔ, ÞÔÏ ÏÐÅÒÁÃÉÏÎÎÁÑ ÓÉÓÔÅÍÁ 574ÎÅ Õ×ÉÄÉÔÅ ÐÏÓÌÅÄÕÀÝÅÇÏ ×Ù×ÏÄÁ Emacs`Á. ôÁËÏÅ ÐÏ×ÅÄÅÎÉÅ ÏÚÎÁÞÁÅÔ, ÞÔÏ
551ÉÍÅÅÔ "ÏÓÏÂÅÎÎÏÓÔØ", ÉÍÅÎÕÅÍÕÀ "flow control", ÐÅÒÅÈ×ÁÔÙ×ÁÀÝÕÀ C-s É ÎÅ 575ÏÐÅÒÁÃÉÏÎÎÁÑ ÓÉÓÔÅÍÁ ÉÍÅÅÔ "ÏÓÏÂÅÎÎÏÓÔØ", ÉÍÅÎÕÅÍÕÀ "flow control",
552ÐÒÏÐÕÓËÁÀÝÕÀ ÜÔÏÔ ÓÉÍ×ÏÌ Ë Emacs`Õ. äÌÑ ÒÁÚÂÌÏËÉÒÏ×ËÉ ÜËÒÁÎÁ, ÎÁÖÍÉÔÅ C-q. 576ÐÅÒÅÈ×ÁÔÙ×ÁÀÝÕÀ ÓÏÞÅÔÁÎÉÅ C-s É ÎÅ ÐÒÏÐÕÓËÁÀÝÕÀ ÜÔÏÔ ÓÉÍ×ÏÌ Ë Emacs`Õ. äÌÑ
553óÍÏÔÒÉÔÅ ÒÁÚÄÅÌ "Spontaneous Entry to Incremental Search" ÒÕËÏ×ÏÄÓÔ×Á Emacs, 577ÓÎÑÔÉÑ ÂÌÏËÉÒÏ×ËÉ ÜËÒÁÎÁ, ÎÁÖÍÉÔÅ C-q. ïÂÒÁÔÉÔÅÓØ Ë ÒÁÚÄÅÌÕ "Spontaneous
554ÞÔÏÂÙ ÕÚÎÁÔØ, ËÁË ÂÏÒÏÔØÓÑ Ó ÜÔÏÊ "ÏÓÏÂÅÎÎÏÓÔØÀ". 578Entry to Incremental Search" ÒÕËÏ×ÏÄÓÔ×Á Emacs, ÞÔÏÂÙ ÕÚÎÁÔØ Ï ÔÏÍ, ËÁË
579ÂÏÒÏÔØÓÑ Ó ÜÔÏÊ "ÏÓÏÂÅÎÎÏÓÔØÀ".
555 580
556÷Ù ÍÏÖÅÔÅ ÏÔËÒÙÔØ ÓÕÝÅÓÔ×ÕÀÝÉÊ ÆÁÊÌ ÄÌÑ ÐÒÏÓÍÏÔÒÁ ÉÌÉ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ. ÷Ù 581÷Ù ÍÏÖÅÔÅ ÏÔËÒÙÔØ ÓÕÝÅÓÔ×ÕÀÝÉÊ ÆÁÊÌ ÄÌÑ ÐÒÏÓÍÏÔÒÁ ÉÌÉ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ. ÷Ù
557ÔÁËÖÅ ÍÏÖÅÔÅ ÎÁÊÔÉ ÆÁÊÌ, ËÏÔÏÒÏÇÏ ÅÝÅ ÎÅ ÓÕÝÅÓÔ×ÕÅÔ. äÒÕÇÉÍÉ ÓÌÏ×ÁÍÉ -- 582ÔÁËÖÅ ÍÏÖÅÔÅ ÏÔËÒÙÔØ ÆÁÊÌ, ËÏÔÏÒÏÇÏ ÅÝÅ ÎÅ ÓÕÝÅÓÔ×ÕÅÔ. äÒÕÇÉÍÉ ÓÌÏ×ÁÍÉ --
558ÓÏÚÄÁÔØ ÆÁÊÌ Ó ÐÏÍÏÝØÀ Emacs: ÎÁÊÔÉ ÆÁÊÌ, ÓÏÚÄÁÔØ ÎÏ×ÙÊ, É ÎÁÞÁÔØ ××ÏÄÉÔØ 583ÓÏÚÄÁÔØ ÆÁÊÌ Ó ÐÏÍÏÝØÀ Emacs ÍÏÖÎÏ ÔÁË: ÎÁÊÔÉ ÆÁÊÌ, ÓÏÚÄÁÔØ ÎÏ×ÙÊ, É ÎÁÞÁÔØ
559ÔÅËÓÔ. ëÏÇÄÁ ×Ù ÓËÁÖÉÔÅ "ÓÏÈÒÁÎÉ" ÆÁÊÌ, Emacs ÓÏÚÄÁÓÔ ÒÅÁÌØÎÙÊ ÆÁÊÌ Ó 584××ÏÄÉÔØ ÔÅËÓÔ. ëÏÇÄÁ ×Ù ×ÙÐÏÌÎÉÔÅ ËÏÍÁÎÄÕ ÓÏÈÒÁÎÅÎÉÑ ÆÁÊÌÁ, ÔÏ Emacs ÓÏÚÄÁÓÔ
560ÎÁÂÒÁÎÎÙÍ ×ÁÍÉ ÔÅËÓÔÏÍ. äÁÌÅÅ, ËÁË ×Ù ÐÏÎÑÌÉ, ×Ù ÂÕÄÅÔÅ ÒÅÄÁËÔÉÒÏ×ÁÔØ ÕÖÅ 585ÎÁÓÔÏÑÝÉÊ ÆÁÊÌ Ó ÎÁÂÒÁÎÎÙÍ ×ÁÍÉ ÔÅËÓÔÏÍ. äÁÌÅÅ, ËÁË ×Ù ÐÏÎÑÌÉ, ×Ù ÂÕÄÅÔÅ
561ÓÕÝÅÓÔ×ÕÀÝÉÊ ÆÁÊÌ. 586ÒÅÄÁËÔÉÒÏ×ÁÔØ ÕÖÅ ÓÕÝÅÓÔ×ÕÀÝÉÊ ÆÁÊÌ.
562 587
563 588
564* âõæåòá 589* âõæåòá
565-------- 590--------
566 591
567åÓÌÉ ×Ù ÎÁÈÏÄÉÔÅ ×ÔÏÒÏÊ ÆÁÊÌ Ó ÉÓÐÏÌØÚÏ×ÁÎÉÅÍ C-x C-f, ÔÏ ÐÅÒ×ÙÊ ÏÓÔÁÅÔÓÑ 592åÓÌÉ ×Ù ÏÔËÒÙ×ÁÅÔÅ ×ÔÏÒÏÊ ÆÁÊÌ ÉÓÐÏÌØÚÕÑ ËÏÍÁÎÄÕ C-x C-f, ÔÏ ÐÅÒ×ÙÊ ÆÁÊÌ
568×ÎÕÔÒÉ Emacs. ÷Ù ÍÏÖÅÔÅ ÐÅÒÅËÌÀÞÉÔØÓÑ ÎÁÚÁÄ, ÎÁÊÄÑ ÅÇÏ ÓÎÏ×Á C-x C-f. üÔÏ 593ÏÓÔÁÅÔÓÑ ×ÎÕÔÒÉ Emacs. ÷Ù ÍÏÖÅÔÅ ÐÅÒÅËÌÀÞÉÔØÓÑ ÎÁÚÁÄ, ÏÔËÒÙ× ÅÇÏ ÓÎÏ×Á Ó
569ÓÐÏÓÏ ÚÁÇÒÕÚÉÔØ ÎÅÓËÏÌØËÏ ÆÁÊÌÏ× × Emacs. 594ÐÏÍÏÝØÀ C-x C-f. ôÁËÉÍ ÏÂÒÁÚÏÍ ×Ù ÍÏÖÅÔÅ ÚÁÇÒÕÚÉÔØ ÎÅÓËÏÌØËÏ ÆÁÊÌÏ× × Emacs.
570 595
571>> óÏÚÄÁÊÔÅ ÆÁÊÌ Ó ÉÍÅÎÅÍ "foo", ÎÁÂÉÒÁÑ C-x C-f foo <Return>. 596>> óÏÚÄÁÊÔÅ ÆÁÊÌ Ó ÉÍÅÎÅÍ "foo", ÎÁÂÒÁ× C-x C-f foo <Return>.
572 ÷ÓÔÁרÔÅ ËÁËÏÊ-ÎÉÂÕÄØ ÔÅËÓÔ, ÏÔÒÅÄÁËÔÉÒÕÊÔÅ ÅÇÏ, É ÓÏÈÒÁÎÉÔÅ "foo", 597 ÷ÓÔÁרÔÅ ËÁËÏÊ-ÎÉÂÕÄØ ÔÅËÓÔ, ÉÚÍÅÎÉÔÅ ÅÇÏ, É ÓÏÈÒÁÎÉÔÅ ÆÁÊÌ "foo",
573 ÎÁÂÒÁ× C-x C-s. 598 ÎÁÂÒÁ× C-x C-s.
574 îÁËÏÎÅÃ, ÎÁÂÅÒÉÔÅ C-x C-f TUTORIAL.ru <Return>, 599 îÁËÏÎÅÃ, ÎÁÂÅÒÉÔÅ C-x C-f TUTORIAL.ru <Return>, ÄÌÑ ÔÏÇÏ, ÞÔÏÂÙ ×ÅÒÎÕÔØÓÑ
575 ÞÔÏÂÙ ×ÅÒÎÕÔØÓÑ ÎÁÚÁÄ Ë ÕÞÅÂÎÉËÕ. 600 ÎÁÚÁÄ Ë ÕÞÅÂÎÉËÕ.
576 601
577Emacs ÓÏÈÒÁÎÑÅÔ ÔÅËÓÔ ËÁÖÄÏÇÏ ÆÁÊÌÁ ×ÎÕÔÒÉ × ÏÂßÅËÔÅ, ÎÁÚÙ×ÁÅÍÏÍ "ÂÕÆÅÒ" 602Emacs ÈÒÁÎÉÔ ÔÅËÓÔ ËÁÖÄÏÇÏ ÆÁÊÌÁ ×ÎÕÔÒÉ × ÏÂßÅËÔÅ, ÎÁÚÙ×ÁÅÍÏÍ "ÂÕÆÅÒ"
578("buffer"). ïÔËÒÙÔÉÅ ÆÁÊÌÁ ÓÏÚÄÁÅÔ ÎÏ×ÙÊ ÂÕÆÅÒ ×ÎÕÔÒÉ Emacs. þÔÏÂÙ Õ×ÉÄÅÔØ 603("buffer"). ïÔËÒÙÔÉÅ ÆÁÊÌÁ ÓÏÚÄÁÅÔ ÎÏ×ÙÊ ÂÕÆÅÒ ×ÎÕÔÒÉ Emacs. þÔÏÂÙ Õ×ÉÄÅÔØ
579ÓÐÉÓÏË ÂÕÆÅÒÏ×, ÓÏÚÄÁÎÎÙÈ × ÔÅËÕÝÅÍ Emacs, ÎÁÂÅÒÉÔÅ 604ÓÐÉÓÏË ÂÕÆÅÒÏ×, ÓÏÚÄÁÎÎÙÈ × ÔÅËÕÝÅÍ ÓÅÁÎÓÅ Emacs, ÎÁÂÅÒÉÔÅ
580 605
581 C-x C-b óÐÉÓÏË ÂÕÆÅÒÏ× 606 C-x C-b óÐÉÓÏË ÂÕÆÅÒÏ×
582 607
583>> ðÏÐÒÏÂÕÊÔÅ C-x C-b ÓÅÊÞÁÓ. 608>> ðÏÐÒÏÂÕÊÔÅ ×ÙÐÏÌÎÉÔØ C-x C-b ÐÒÑÍÏ ÓÅÊÞÁÓ.
584 609
585íÙ ×ÉÄÉÍ, ÞÔÏ ËÁÖÄÙÊ ÂÕÆÅÒ ÉÍÅÅÔ ÉÍÑ, É ÍÏÖÅÔ ÉÍÅÔØ ÉÍÑ ÆÁÊÌÁ, ÓÏÄÅÒÖÉÍÏÅ 610íÙ ×ÉÄÉÍ, ÞÔÏ ËÁÖÄÙÊ ÂÕÆÅÒ ÉÍÅÅÔ ÉÍÑ, É ÍÏÖÅÔ ÉÍÅÔØ Ó×ÑÚÁÎÎÏÅ Ó ÎÉÍ ÉÍÑ
586ËÏÔÏÒÏÇÏ × ÎÅÍ ÈÒÁÎÉÔÓÑ. îÅËÏÔÏÒÙÅ ÂÕÆÅÒÁ ÎÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÔ ÆÁÊÌÁÍ. îÁÐÒÉÍÅÒ, 611ÆÁÊÌÁ, ÓÏÄÅÒÖÉÍÏÅ ËÏÔÏÒÏÇÏ × ÈÒÁÎÉÔÓÑ × ÄÁÎÎÏÍ ÂÕÆÅÒÅ. ìàâïê ÔÅËÓÔ, ËÏÔÏÒÙÊ
587ÂÕÆÅÒ, ÎÁÚ×ÁÎÎÙÊ "*Buffer List*", ÎÅ ÓÏÄÅÒÖÉÔ ÎÉËÁËÏÇÏ ÆÁÊÌÁ. ÷ ÜÔÏÍ ÂÕÆÅÒÅ 612×Ù ×ÉÄÉÔÅ × ÏËÎÅ Emacs, ×ÓÅÇÄÁ Ñ×ÌÑÅÔÓÑ ÞÁÓÔØÀ ËÁËÏÇÏ-ÌÉÂÏ ÂÕÆÅÒÁ.
588ÓÏÄÅÒÖÉÔÓÑ ÓÐÉÓÏË ÂÕÆÅÒÏ×, ËÏÔÏÒÙÊ ÂÙÌ ÓÏÚÄÁÎ ËÏÍÁÎÄÏÊ C-x C-b. ìàâïê ÔÅËÓÔ,
589ËÏÔÏÒÙÊ ×Ù ×ÉÄÉÔÅ × ÏËÎÅ Emacs, ×ÓÅÇÄÁ Ñ×ÌÑÅÔÓÑ ÞÁÓÔØÀ ËÁËÏÇÏ-ÌÉÂÏ ÂÕÆÅÒÁ.
590 613
591>> îÁÂÅÒÉÔÅ C-x 1, ÞÔÏÂÙ ÉÚÂÁ×ÉÔØÓÑ ÏÔ ÓÐÉÓËÁ ÂÕÆÅÒÏ×. 614>> îÁÂÅÒÉÔÅ C-x 1, ÞÔÏÂÙ ÉÚÂÁ×ÉÔØÓÑ ÏÔ ÓÐÉÓËÁ ÂÕÆÅÒÏ×.
592 615
593åÓÌÉ ×Ù ÉÚÍÅÎÑÅÔÅ ÔÅËÓÔ ÏÄÎÏÇÏ ÆÁÊÌÁ, ÐÏÔÏÍ ÏÔËÒÙ×ÁÅÔÅ ÄÒÕÇÏÊ, ÔÏ ÐÅÒ×ÙÊ 616ëÏÇÄÁ Õ ×ÁÓ ÅÓÔØ ÎÅÓËÏÌØËÏ ÂÕÆÅÒÏ×, ÔÏÌØËÏ ÏÄÉÎ ÉÚ ÎÉÈ Ñ×ÌÑÅÔÓÑ "ÔÅËÕÝÉÍ" ×
594ÏÓÔÁÅÔÓÑ ÎÅÓÏÈÒÁÎÅÎÎÙÍ. éÚÍÅÎÅÎÉÑ ÏÓÔÁÎÕÔÓÑ ×ÎÕÔÒÉ Emacs, × ÆÁÊÌÏ×ÏÍ 617ËÏÎËÒÅÔÎÙÊ ÍÏÍÅÎÔ ×ÒÅÍÅÎÉ. üÔÏ ÔÏÔ ÂÕÆÅÒ, ËÏÔÏÒÙÊ ×Ù ÉÚÍÅÎÑÅÔÅ. åÓÌÉ ×Ù
595ÂÕÆÅÒÅ. óÏÚÄÁÎÉÅ ÉÌÉ ÒÅÄÁËÔÉÒÏ×ÁÎÉÅ ÓÌÅÄÕÀÝÅÇÏ ÆÁÊÌÏ×ÏÇÏ ÂÕÆÅÒÁ ÎÅ 618ÈÏÔÉÔÅ ÉÚÍÅÎÉÔØ ÄÁÎÎÙÅ × ÄÒÕÇÏÍ ÂÕÆÅÒÅ, ÔÏ ×Ù ÄÏÌÖÎÙ "ÐÅÒÅËÌÀÞÉÔØÓÑ" × ÎÅÇÏ.
619åÓÌÉ ×Ù ÈÏÔÉÔÅ ÐÅÒÅËÌÀÞÉÔØÓÑ × ÂÕÆÅÒ, Ó×ÑÚÁÎÎÙÊ Ó ÆÁÊÌÏÍ, ÔÏ ×Ù ÍÏÖÅÔÅ
620ÏÔËÒÙÔØ ÜÔÏÔ ÆÁÊÌ ÓÎÏ×Á Ó ÐÏÍÏÝØÀ C-x C-f. îÏ ÅÓÔØ ÂÏÌÅÅ ÐÒÏÓÔÏÊ ÓÐÏÓÏ --
621ÉÓÐÏÌØÚÏ×ÁÔØ ËÏÍÁÎÄÕ C-x b. ÷ ËÁÞÅÓÔ×Å ÁÒÇÕÍÅÎÔÁ ÄÌÑ ÄÁÎÎÏÊ ËÏÍÁÎÄÙ ×Ù
622ÄÏÌÖÎÙ ÕËÁÚÁÔØ ÉÍÑ ÂÕÆÅÒÁ.
623
624>> îÁÂÅÒÉÔÅ C-x b foo <Return> ÄÌÑ ÐÅÒÅËÌÀÞÅÎÉÑ × ÂÕÆÅÒ "foo", ËÏÔÏÒÙÊ
625 ÈÒÁÎÉÔ ÔÅËÓÔ ÆÁÊÌÁ "foo". úÁÔÅÍ ÎÁÂÅÒÉÔÅ C-x b TUTORIAL <Return> ÄÌÑ
626 ×ÏÚ×ÒÁÝÅÎÉÑ × ÂÕÆÅÒ Ó ÄÁÎÎÙÍ ÕÞÅÂÎÉËÏÍ.
627
628þÁÝÅ ×ÓÅÇÏ ÉÍÑ ÂÕÆÅÒÁ ÓÏ×ÐÁÄÁÅÔ Ó ÉÍÅÎÅÍ ÆÁÊÌÁ (ÔÏÌØËÏ ÂÅÚ ÉÍÅÎÉ ËÁÔÁÌÏÇÏ×).
629ïÄÎÁËÏ ÜÔÏ ÎÅ ×ÓÅÇÄÁ Ñ×ÌÑÅÔÓÑ ÐÒÁ×ÄÏÊ. óÐÉÓÏË ÂÕÆÅÒÏ×, ËÏÔÏÒÙÊ ×Ù ÓÏÚÄÁÅÔÅ
630Ó ÐÏÍÏÝØÀ ËÏÍÁÎÄÙ C-x C-b ×ÓÅÇÄÁ ÐÏËÁÚÙ×ÁÅÔ ×ÁÍ ÉÍÅÎÁ ×ÓÅÈ ÂÕÆÅÒÏ×.
631
632ìàâïê ÔÅËÓÔ, ËÏÔÏÒÙÊ ×Ù ×ÉÄÉÔÅ × ÏËÎÅ Emacs, ×ÓÅÇÄÁ Ñ×ÌÑÅÔÓÑ ÞÁÓÔØÀ
633ËÁËÏÇÏ-ÌÉÂÏ ÂÕÆÅÒÁ. îÅËÏÔÏÒÙÅ ÂÕÆÅÒÁ ÎÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÔ ÆÁÊÌÁÍ. îÁÐÒÉÍÅÒ,
634ÂÕÆÅÒ Ó ÉÍÅÎÅÍ "*Buffer List*" ÎÅ Ó×ÑÚÁÎ ÎÉ Ó ËÁËÉÍ ÆÁÊÌÏÍ. üÔÏ ÂÕÆÅÒ,
635ËÏÔÏÒÙÊ ÓÏÄÅÒÖÉÔ ÓÐÉÓÏË ÂÕÆÅÒÏ×, ËÏÔÏÒÙÊ ×Ù ÓÏÚÄÁÌÉ ÉÓÐÏÌØÚÕÑ C-x C-b.
636âÕÆÅÒ Ó ÉÍÅÎÅÍ "*Messages*" ÔÁËÖÅ ÎÅ Ó×ÑÚÁÎ ÎÉ Ó ËÁËÉÍ ÆÁÊÌÏÍ; ÏÎ ÓÏÄÅÒÖÉÔ
637ÓÏÏÂÝÅÎÉÑ, ËÏÔÏÒÙÅ ÏÔÏÂÒÁÖÁÀÔÓÑ × ÓÁÍÏÊ ÎÉÖÎÅÊ ÓÔÒÏËÅ ÏËÎÁ Emacs × ÔÅÞÅÎÉÉ
638ÔÅËÕÝÅÊ ÓÅÓÓÉÉ ÒÁÂÏÔÙ Ó ÒÅÄÁËÔÏÒÏÍ.
639
640>> îÁÂÅÒÉÔÅ C-x b *Messages* <Return> ÄÌÑ ÐÒÏÓÍÏÔÒÁ ÓÏÄÅÒÖÉÍÏÇÏ ÂÕÆÅÒÁ
641 ÓÏÏÂÝÅÎÉÊ. úÁÔÅÍ ÎÁÂÅÒÉÔÅ C-x b TUTORIAL <Return> ÄÌÑ ×ÏÚ×ÒÁÔÁ × ÄÁÎÎÙÊ
642 ÕÞÅÂÎÉË.
643
644åÓÌÉ ×Ù ÉÚÍÅÎÑÅÔÅ ÔÅËÓÔ ÏÄÎÏÇÏ ÆÁÊÌÁ, Á ÚÁÔÅÍ ÏÔËÒÙ×ÁÅÔÅ ÄÒÕÇÏÊ, ÔÏ ÔÅËÓÔ ×
645ÐÅÒ×ÏÍ ÂÕÆÅÒÅ ÏÓÔÁÅÔÓÑ ÎÅ ÓÏÈÒÁÎÅÎÎÙÍ. éÚÍÅÎÅÎÉÑ ÏÓÔÁÎÕÔÓÑ ×ÎÕÔÒÉ Emacs, ×
646ÂÕÆÅÒÅ, Ó×ÑÚÁÎÎÏÍ Ó ÆÁÊÌÏÍ. óÏÚÄÁÎÉÅ ÉÌÉ ÒÅÄÁËÔÉÒÏ×ÁÎÉÅ ÓÌÅÄÕÀÝÅÇÏ ÂÕÆÅÒÁ ÎÅ
596ÓËÁÚÙ×ÁÅÔÓÑ ÎÁ ÐÅÒ×ÏÍ ÂÕÆÅÒÅ. üÔÏ ÏÞÅÎØ ÕÄÏÂÎÏ, ÎÏ ÉÍÅÊÔÅ × ×ÉÄÕ, ÞÔÏ ×ÁÍ 647ÓËÁÚÙ×ÁÅÔÓÑ ÎÁ ÐÅÒ×ÏÍ ÂÕÆÅÒÅ. üÔÏ ÏÞÅÎØ ÕÄÏÂÎÏ, ÎÏ ÉÍÅÊÔÅ × ×ÉÄÕ, ÞÔÏ ×ÁÍ
597ÎÕÖÎÏ ÉÍÅÔØ ÕÄÏÂÎÙÊ ÓÐÏÓÏ ÓÏÈÒÁÎÉÔØ ÐÅÒ×ÙÊ ÆÁÊÌÏ×ÙÊ ÂÕÆÅÒ. âÙÌÏ ÂÙ 648ÎÕÖÎÏ ÉÍÅÔØ ÓÐÏÓÏ ÓÏÈÒÁÎÉÔØ ÐÅÒ×ÙÊ ÆÁÊÌÏ×ÙÊ ÂÕÆÅÒ. âÙÌÏ ÂÙ ÎÅÐÒÉÑÔÎÏ
598ÎÅÐÒÉÑÔÎÏ ËÁÖÄÙÊ ÒÁÚ ×ÏÚ×ÒÁÝÁÔØÓÑ ÎÁÚÁÄ Ó ÐÏÍÏÝØÀ C-x C-f É ÐÏÔÏÍ 649ËÁÖÄÙÊ ÒÁÚ ×ÏÚ×ÒÁÝÁÔØÓÑ ÎÁÚÁÄ ÉÓÐÏÌØÚÕÑ C-x C-f É ÐÏÔÏÍ ÉÓÐÏÌØÚÏ×ÁÔØ C-x C-s
599ÉÓÐÏÌØÚÏ×ÁÔØ C-x C-s. ðÏÜÔÏÍÕ ÓÕÝÅÓÔ×ÕÅÔ ËÏÍÁÎÄÁ 650ÄÌÑ ÓÏÈÒÁÎÅÎÉÑ ÄÁÎÎÙÈ. ðÏÜÔÏÍÕ ÓÕÝÅÓÔ×ÕÅÔ ËÏÍÁÎÄÁ
600 651
601 C-x s óÏÈÒÁÎÉÔØ ÎÅËÏÔÏÒÙÅ ÂÕÆÅÒÁ. (Save some buffers) 652 C-x s óÏÈÒÁÎÉÔØ ÎÅËÏÔÏÒÙÅ ÂÕÆÅÒÁ. (Save some buffers)
602 653
603C-x s ÓÐÒÁÛÉ×ÁÅÔ ×ÁÓ Ï ËÁÖÄÏÍ ÂÕÆÅÒÅ, ËÏÔÏÒÙÊ ÓÏÄÅÒÖÉÔ ÎÅÓÏÈÒÁÎÅÎÎÙÅ 654C-x s ÚÁÐÒÁÛÉ×ÁÅÔ Õ ×ÁÓ ÐÏÄÔ×ÅÒÖÄÅÎÉÅ Ï ÓÏÈÒÁÎÅÎÉÉ ÄÌÑ ËÁÖÄÏÇÏ ÂÕÆÅÒÁ,
604ÉÚÍÅÎÅÎÉÑ. äÌÑ ËÁÖÄÏÇÏ ÔÁËÏÇÏ ÂÕÆÅÒÁ Õ ×ÁÓ ÓÐÒÁÛÉ×ÁÀÔ: ÓÏÈÒÁÎÑÔØ ÉÌÉ ÎÅ 655ËÏÔÏÒÙÊ ÓÏÄÅÒÖÉÔ ÎÅ ÓÏÈÒÁÎÅÎÎÙÅ ÉÚÍÅÎÅÎÉÑ. äÌÑ ËÁÖÄÏÇÏ ÔÁËÏÇÏ ÂÕÆÅÒÁ Õ ×ÁÓ
605ÓÏÈÒÁÎÑÔØ ÉÚÍÅÎÅÎÉÑ. 656ÚÁÐÒÏÓÑÔ: ÓÏÈÒÁÎÑÔØ ÉÌÉ ÎÅ ÓÏÈÒÁÎÑÔØ ÉÚÍÅÎÅÎÉÑ.
606 657
607>> ÷ÓÔÁרÔÅ ÓÔÒÏËÕ ÔÅËÓÔÁ, ÐÏÔÏÍ ÎÁÂÅÒÉÔÅ C-x s. 658>> ÷ÓÔÁרÔÅ ÓÔÒÏËÕ ÔÅËÓÔÁ, ÐÏÔÏÍ ÎÁÂÅÒÉÔÅ C-x s.
608 õ ×ÁÓ ÄÏÌÖÎÙ ÓÐÒÏÓÉÔØ, ÓÏÈÒÁÎÑÔØ ÌÉ ÂÕÆÅÒ Ó ÉÍÅÎÅÍ TUTORIAL.ru. 659 õ ×ÁÓ ÄÏÌÖÎÙ ÓÐÒÏÓÉÔØ, ÓÏÈÒÁÎÑÔØ ÌÉ ÂÕÆÅÒ Ó ÉÍÅÎÅÍ TUTORIAL.ru. ïÔ×ÅÔØÔÅ
609 ïÔ×ÅÔØÔÅ ÎÁ ×ÏÐÒÏÓ ÄÁ, ÎÁÂÒÁ× "y". 660 ÎÁ ×ÏÐÒÏÓ ÕÔ×ÅÒÄÉÔÅÌØÎÏ, ÎÁÂÒÁ× "y".
610 661
611 662
612* òáóûéòåîîùê îáâïò ëïíáîä 663* òáóûéòåîéå îáâïòá ëïíáîä
613-------------------------- 664--------------------------
614 665
615õ Emacs ÏÞÅÎØ ÍÎÏÇÏ ËÏÍÁÎÄ, ÏÎÉ ÍÏÇÕÔ ÂÙÔØ ÎÁÚÎÁÞÅÎÙ ÎÁ ×ÓÅ control- É meta- 666õ Emacs ÏÞÅÎØ ÍÎÏÇÏ ËÏÍÁÎÄ, É ÏÎÉ ÎÅ ÍÏÇÕÔ ÂÙÔØ ÎÁÚÎÁÞÅÎÙ ÎÁ ×ÓÅ control- É
616ÓÉÍ×ÏÌÙ. Emacs ÏÂÈÏÄÉÔ ÜÔÏ, ÉÓÐÏÌØÚÕÑ X-ËÏÍÁÎÄÕ (eXtend). åÓÔØ Ä×Å 667meta- ÓÉÍ×ÏÌÙ. Emacs ÏÂÈÏÄÉÔ ÜÔÏ, ÉÓÐÏÌØÚÕÑ X-ËÏÍÁÎÄÕ (eXtend). åÓÔØ Ä×Å
617×ÏÚÍÏÖÎÏÓÔÉ: 668×ÏÚÍÏÖÎÏÓÔÉ:
618 669
619 C-x óÉÍ×ÏÌ ÒÁÓÛÉÒÅÎÉÑ (Character eXtend). 670 C-x òÁÓÛÉÒÅÎÉÅ Ó ÐÏÍÏÝØÀ ××ÏÄÁ ÐÒÅÆÉËÓÁ. úÁ ÎÉÍ ÓÌÅÄÕÅÍ ÏÄÉÎ ÓÉÍ×ÏÌ.
620 úÁ ÎÉÍ ÓÌÅÄÕÅÍ ÏÄÉÎ ÓÉÍ×ÏÌ. 671 M-x òÁÓÛÉÒÅÎÉÅ ÎÁÂÏÒÁ ËÏÍÁÎÄ Ó ÐÏÍÏÝØÀ ÉÈ ÎÁÉÍÅÎÏ×ÁÎÉÑ. úÁ ÎÉÍ ÓÌÅÄÕÅÔ ÉÍÑ
621 M-x éÍÅÎÏ×ÁÎÎÙÅ ÒÁÓÛÉÒÅÎÎÙÅ ËÏÍÁÎÄÙ (Named command eXtend). 672 ËÏÍÁÎÄÙ.
622 úÁ ÎÉÍ ÓÌÅÄÕÅÔ ÉÍÑ ËÏÍÁÎÄÙ.
623 673
624üÔÏ ËÏÍÁÎÄÙ, ËÏÔÏÒÙÅ ÏÂÙÞÎÏ ÉÓÐÏÌØÚÕÀÔÓÑ, ÎÏ ×Ù ÕÖÅ ×ÙÕÞÉÌÉ ÎÅËÏÔÏÒÙÅ ÉÚ 674üÔÏ ÐÏÌÅÚÎÙÅ ËÏÍÁÎÄÙ, ÎÏ ÏÎÉ ÉÓÐÏÌØÚÕÀÔÓÑ ÍÅÎÅÅ ÞÁÓÔÏ, ÞÅÍ ÔÅ ËÏÍÁÎÄÙ,
625ÎÉÈ. ÷Ù ÕÖÅ ×ÉÄÅÌÉ: ËÏÍÁÎÄÙ ÒÁÂÏÔÙ Ó ÆÁÊÌÁÍÉ C-x C-f -- ÏÔËÒÙÔØ, É C-x C-s 675ËÏÔÏÒÙÅ ÍÙ ÉÚÕÞÉÌÉ. ÷Ù ÕÖÅ ×ÉÄÅÌÉ ÎÅËÏÔÏÒÙÅ ÉÚ ÎÉÈ: ËÏÍÁÎÄÙ ÒÁÂÏÔÙ Ó ÆÁÊÌÁÍÉ
626-- ÓÏÈÒÁÎÉÔØ. äÒÕÇÏÊ ÐÒÉÍÅÒ - ÚÁ×ÅÒÛÅÎÉÑ ÒÁÂÏÔÙ Ó Emacs -- ÜÔÏ ËÏÍÁÎÄÁ C-x 676C-x C-f -- ÏÔËÒÙÔØ ÆÁÊÌ, É C-x C-s -- ÓÏÈÒÁÎÉÔØ ÆÁÊÌ. äÒÕÇÏÊ ÐÒÉÍÅÒ --
627C-c. (îÅ ×ÏÌÎÕÊÔÅÓØ Ï ÔÏÍ, ÞÔÏ ×Ù ÐÏÔÅÒÑÅÔÅ ÓÄÅÌÁÎÎÙÅ ÉÚÍÅÎÅÎÉÑ, C-x C-c 677ËÏÍÁÎÄÁ ÚÁ×ÅÒÛÅÎÉÑ ÒÁÂÏÔÙ Ó Emacs -- C-x C-c. (îÅ ×ÏÌÎÕÊÔÅÓØ Ï ÔÏÍ, ÞÔÏ ×Ù
628ÐÒÅÄÌÁÇÁÅÔ ÓÏÈÒÁÎÉÔØ ÉÚÍÅÎÅÎÉÑ ÐÅÒÅÄ ÔÅÍ, ËÁË ÕÄÁÌÉÔ ÂÕÆÅÒ Emacs.) 678ÐÏÔÅÒÑÅÔÅ ÓÄÅÌÁÎÎÙÅ ÉÚÍÅÎÅÎÉÑ, C-x C-c ÐÒÅÄÌÁÇÁÅÔ ÓÏÈÒÁÎÉÔØ ÉÚÍÅÎÅÎÉÑ ÐÅÒÅÄ
679ÕÄÁÌÅÎÉÅÍ ÂÕÆÅÒÁ Emacs).
629 680
630C-z ÜÔÏ ËÏÍÁÎÄÁ *×ÒÅÍÅÎÎÏÇÏ* ×ÙÈÏÄÁ ÉÚ Emacs -- ×Ù ÍÏÖÅÔÅ ×ÅÒÎÕÔØÓÑ × ÔÕ ÖÅ 681C-z -- ÜÔÏ ËÏÍÁÎÄÁ *×ÒÅÍÅÎÎÏÇÏ* ×ÙÈÏÄÁ ÉÚ Emacs. ÷Ù ÍÏÖÅÔÅ ×ÅÒÎÕÔØÓÑ × ÔÕ ÖÅ
631ÓÅÓÓÉÀ Emacs ÐÏÚÖÅ. 682ÓÅÓÓÉÀ Emacs ÐÏÚÖÅ.
632 683
633îÁ ÓÉÓÔÅÍÁÈ, ËÏÔÏÒÙÅ ÄÏÐÕÓËÁÀÔ ÜÔÏ, C-z "ÐÒÉÏÓÔÁÎÁ×ÌÉ×ÁÀÔ" ("suspends") 684îÁ ÓÉÓÔÅÍÁÈ, ËÏÔÏÒÙÅ ÒÅÁÌÉÚÕÀÔ ÜÔÕ ×ÏÚÍÏÖÎÏÓÔØ, ËÏÍÁÎÄÁ C-z
634Emacs; ×ÏÚ×ÒÁÝÁÀÔ × ÏÂÏÌÏÞËÕ (shell), ÎÏ ÎÅ ÚÁËÒÙ×ÁÀÔ Emacs. ÷ ÂÏÌØÛÉÎÓÔ×Å 685"ÐÒÉÏÓÔÁÎÁ×ÌÉ×ÁÅÔ" ("suspends") Emacs; ×ÏÚ×ÒÁÝÁÅÔ × ËÏÍÁÎÄÎÙÊ ÐÒÏÃÅÓÓÏÒ
635ÏÂÏÌÏÞÅË ×Ù ÍÏÖÅÔÅ ÐÒÏÄÏÌÖÉÔØ ÒÁÂÏÔÕ × Emacs, ÉÓÐÏÌØÚÕÑ ËÏÍÁÎÄÕ `fg' ÉÌÉ 686(shell), ÎÏ ÎÅ ÚÁËÒÙ×ÁÀÔ Emacs. ÷ ÂÏÌØÛÉÎÓÔ×Å ËÏÍÁÎÄÎÙÈ ÐÒÏÃÅÓÓÏÒÏ× ×Ù
636`%emacs'. 687ÍÏÖÅÔÅ ×ÅÒÎÕÔØÓÑ × Emacs, ÉÓÐÏÌØÚÕÑ ËÏÍÁÎÄÕ `fg' ÉÌÉ `%emacs'.
637 688
638÷ ÓÉÓÔÅÍÁÈ, ÎÅ ÐÏÄÄÅÒÖÉ×ÁÀÝÉÈ ÐÒÉÏÓÔÁÎÏ×ËÕ ÐÒÏÃÅÓÓÏ×, C-z ÓÏÚÄÁÅÔ ÎÏ×ÕÀ 689÷ ÓÉÓÔÅÍÁÈ, ÎÅ ÐÏÄÄÅÒÖÉ×ÁÀÝÉÈ ÐÒÉÏÓÔÁÎÏ×ËÕ ÐÒÏÃÅÓÓÏ×, C-z ÓÏÚÄÁÅÔ ÎÏ×ÙÊ
639ÏÂÏÌÏÞËÕ (subshell), ÚÁÐÕÝÅÎÎÕÀ ÉÚ-ÐÏÄ Emacs, ÞÔÏÂÙ ÄÁÔØ ×ÁÍ ×ÏÚÍÏÖÎÏÓÔØ 690ËÏÍÁÎÄÎÙÊ ÐÒÏÃÅÓÓÏÒ (subshell), ÚÁÐÕÝÅÎÎÙÊ ÉÚ-ÐÏÄ Emacs, ÞÔÏÂÙ ÄÁÔØ ×ÁÍ
640×ÙÐÏÌÎÉÔØ ÄÒÕÇÕÀ ÐÒÏÇÒÁÍÍÕ, É ÐÏÔÏÍ ×ÅÒÎÕÔØÓÑ × Emacs; ÜÔÏ ÎÅ ÎÁÓÔÏÑÝÉÊ 691×ÏÚÍÏÖÎÏÓÔØ ×ÙÐÏÌÎÉÔØ ÄÒÕÇÕÀ ÐÒÏÇÒÁÍÍÕ, É ÚÁÔÅÍ ×ÅÒÎÕÔØÓÑ × Emacs (ÜÔÏ ÎÅ
641×ÙÈÏÄ ÉÚ Emacs. ÷ ÜÔÏÍ ÓÌÕÞÁÅ, ËÏÍÁÎÄÁ `exit' ×ÅÒÎÅÔ ×ÁÓ × Emacs ÉÚ 692ÎÁÓÔÏÑÝÉÊ ×ÙÈÏÄ ÉÚ Emacs). ÷ ÔÁËÉÈ ÓÉÓÔÅÍÁ ÄÌÑ ×ÏÚ×ÒÁÔÁ × Emacs ×ÁÍ ÎÕÖÎÏ
642ÏÂÏÌÏÞËÉ. 693ÉÓÐÏÌØÚÏ×ÁÔØ ËÏÍÁÎÄÕ `exit'.
643 694
644éÓÐÏÌØÚÕÊÔÅ C-x C-c, ÅÓÌÉ ×Ù ÈÏÔÉÔÅ ×ÙÊÔÉ (log out) ÉÚ ÓÉÓÔÅÍÙ. üÔÏ ÔÁËÖÅ 695þÔÏÂÙ ÐÏËÉÎÕÔØ Emacs ÉÓÐÏÌØÚÕÊÔÅ ËÏÍÁÎÄÕ C-x C-c. ïÂÙÞÎÏ ÜÔÏ ÎÕÖÎÏ ÔÏÇÄÁ,
645ÉÓÐÏÌØÚÕÅÔÓÑ, ÞÔÏÂÙ ×ÙÊÔÉ ÉÚ Emacs, ×ÙÚ×ÁÎÎÏÇÏ ÉÚ ÐÏÞÔÏ×ÏÊ ÐÒÏÇÒÁÍÍÙ, ÉÌÉ ÄÒÕÇÏÊ 696ËÏÇÄÁ ×Ù ÈÏÔÉÔÅ ÚÁËÏÎÞÉÔØ ÓÅÁÎÓ ÒÁÂÏÔÙ Ó ËÏÍÐØÀÔÅÒÏÍ. üÔÏ ÓÏÞÅÔÁÎÉÅ ÔÁËÖÅ
646ÕÔÉÌÉÔÙ, ËÏÔÏÒÁÑ ÍÏÖÅÔ ÎÅ ÚÎÁÔØ, ËÁË ÓÐÒÁ×ÉÔØÓÑ Ó ÐÒÉÏÓÔÁÎÏ×ÌÅÎÎÙÍ Emacs. 697ÉÓÐÏÌØÚÕÅÔÓÑ, ÞÔÏÂÙ ×ÙÊÔÉ ÉÚ Emacs, ×ÙÚ×ÁÎÎÏÇÏ ÉÚ ÐÏÞÔÏ×ÏÊ ÐÒÏÇÒÁÍÍÙ, ÉÌÉ
647ïÂÙÞÎÏ, ÅÓÌÉ ×Ù ÎÅ ×ÙÈÏÄÉÔÅ ÉÚ ÓÉÓÔÅÍÙ, ÌÕÞÛÅ ÐÒÉÏÓÔÁÎÏ×ÉÔØ Emacs, 698ÄÒÕÇÏÊ ÕÔÉÌÉÔÙ, ËÏÔÏÒÁÑ ÍÏÖÅÔ ÎÅ ÚÎÁÔØ, ËÁË ÓÐÒÁ×ÉÔØÓÑ Ó ÐÒÉÏÓÔÁÎÏ×ÌÅÎÎÙÍ
648ÉÓÐÏÌØÚÕÑ C-z ×ÍÅÓÔÏ ×ÙÈÏÄÁ ÉÈ ÎÅÇÏ. 699Emacs. ïÂÙÞÎÏ, ÅÓÌÉ ×Ù ÎÅ ÓÏÂÉÒÁÅÔÅÓØ ×ÙÈÏÄÉÔØ ÉÚ ÓÉÓÔÅÍÙ, ÔÏ ÌÕÞÛÅ
649 700ÐÒÉÏÓÔÁÎÏ×ÉÔØ Emacs, ÉÓÐÏÌØÚÕÑ C-z ×ÍÅÓÔÏ ÔÏÇÏ, ÞÔÏÂÙ ÐÏËÉÄÁÔØ ÅÇÏ ÓÏ×ÓÅÍ.
650óÕÝÅÓÔ×ÕÅÔ ÏÞÅÎØ ÍÎÏÇÏ C-x ËÏÍÁÎÄ. üÔÉ ×Ù ÕÖÅ ×ÙÕÞÉÌÉ: 701
651 702óÕÝÅÓÔ×ÕÅÔ ÏÞÅÎØ ÍÎÏÇÏ ËÏÍÁÎÄ, ÉÓÐÏÌØÚÕÀÝÉÈ ÐÒÅÆÉËÓ C-x. ÷Ù ÕÖÅ ÉÚÕÞÉÌÉ
652 C-x C-f ïÔËÒÙÔØ ÆÁÊÌ. 703ÓÌÅÄÕÀÝÉÅ ËÏÍÁÎÄÙ:
653 C-x C-s óÏÈÒÁÎÉÔØ ÆÁÊÌ. 704
654 C-x C-b óÐÉÓÏË ÂÕÆÅÒÏ×. 705 C-x C-f ïÔËÒÙÔØ ÆÁÊÌ
655 C-x C-c ÷ÙÈÏÄ ÉÚ Emacs. 706 C-x C-s óÏÈÒÁÎÉÔØ ÆÁÊÌ
656 C-x 1 õÄÁÌÑÅÔ ×ÓÅ ÏËÎÁ ËÒÏÍÅ ÏÄÎÏÇÏ. 707 C-x s óÏÈÒÁÎÉÔØ ÎÅËÏÔÏÒÙÅ ÆÁÊÌÙ
657 C-x u ïÔÍÅÎÁ. 708 C-x C-b óÐÉÓÏË ÂÕÆÅÒÏ×
658 709 C-x b ðÅÒÅËÌÀÞÉÔØÓÑ × ÂÕÆÅÒ
659éÍÅÎÏ×ÁÎÎÙÅ ÒÁÓÛÉÒÅÎÎÙÅ ËÏÍÁÎÄÙ ÉÓÐÏÌØÚÕÀÔÓÑ ÇÏÒÁÚÄÏ ÒÅÖÅ, ÉÌÉ ÉÓÐÏÌØÚÕÀÔÓÑ 710 C-x C-c ÷ÙÈÏÄ ÉÚ Emacs
660ÔÏÌØËÏ × ÏÐÒÅÄÅÌÅÎÎÙÈ ÒÅÖÉÍÁÈ. ÷ ËÁÞÅÓÔ×Å ÐÒÉÍÅÒÁ ËÏÍÁÎÄÁ ÚÁÍÅÎÁ ÓÔÒÏËÉ, 711 C-x 1 õÄÁÌÑÅÔ ×ÓÅ ÏËÎÁ ËÒÏÍÅ ÏÄÎÏÇÏ
661ËÏÔÏÒÁÑ ÚÁÍÅÎÑÅÔ ÏÄÎÕ ÓÔÒÏËÕ ÎÁ ÄÒÕÇÕÀ ×Ï ×ÓÅÍ ÔÅËÓÔÅ. ëÏÇÄÁ ×Ù ÎÁÂÅÒÅÔÅ 712 C-x u ïÔÍÅÎÁ
662M-x, Emacs ÐÒÅÄÌÏÖÉÔ ×ÁÍ ××ÅÓÔÉ ÉÍÑ ËÏÍÁÎÄÙ × ÎÉÖÎÅÊ ÓÔÒÏËÅ ÜËÒÁÎÁ; × ÎÁÛÅÍ 713
663ÓÌÕÞÁÅ, "replace-string". ôÏÌØËÏ ÎÁÂÅÒÉÔÅ "repl s<TAB>", É Emacs ÄÏÐÏÌÎÉÔ 714éÍÅÎÏ×ÁÎÎÙÅ ËÏÍÁÎÄÙ -- ÜÔÏ ËÏÍÁÎÄÙ, ËÏÔÏÒÙÅ ÉÓÐÏÌØÚÕÀÔÓÑ ÇÏÒÁÚÄÏ ÒÅÖÅ, ÉÌÉ
664ÉÍÑ. (<TAB> -- ÜÔÏ ËÌÁ×ÉÛÁ ÔÁÂÕÌÑÃÉÉ, ÏÂÙÞÎÏ ÎÁÈÏÄÑÝÁÑÓÑ ×ÙÛÅ ËÌÁ×ÉÛ 715ÉÓÐÏÌØÚÕÀÔÓÑ ÔÏÌØËÏ × ÏÐÒÅÄÅÌÅÎÎÙÈ ÒÅÖÉÍÁÈ. ÷ ËÁÞÅÓÔ×Å ÐÒÉÍÅÒÁ ÍÏÖÎÏ
665CapsLock ÉÌÉ Shift ÓÌÅ×Á ÎÁ ËÌÁ×ÉÁÔÕÒÅ). úÁ×ÅÒÛÉÔÅ ÉÍÑ ××ÏÄÏÍ <Return>. 716ÐÒÉ×ÅÓÔÉ ËÏÍÁÎÄÕ ÚÁÍÅÎÙ ÓÔÒÏËÉ, ËÏÔÏÒÁÑ ÚÁÍÅÎÑÅÔ ÏÄÎÕ ÓÔÒÏËÕ ÎÁ ÄÒÕÇÕÀ ×Ï
717×ÓÅÍ ÔÅËÓÔÅ. ëÏÇÄÁ ×Ù ÎÁÂÅÒÅÔÅ M-x, Emacs ÐÒÅÄÌÏÖÉÔ ×ÁÍ ××ÅÓÔÉ ÉÍÑ ËÏÍÁÎÄÙ;
718× ÎÁÛÅÍ ÓÌÕÞÁÅ, ÜÔÏ ËÏÍÁÎÄÁ "replace-string". îÁÂÅÒÉÔÅ ÌÉÛØ "repl s<TAB>",
719É Emacs ÄÏÐÏÌÎÉÔ ÉÍÑ. (<TAB> -- ÜÔÏ ËÌÁ×ÉÛÁ ÔÁÂÕÌÑÃÉÉ, ÏÂÙÞÎÏ ÎÁÈÏÄÑÝÁÑÓÑ
720×ÙÛÅ ËÌÁ×ÉÛ CapsLock ÉÌÉ Shift × ÌÅ×ÏÊ ÞÁÓÔÉ ËÌÁ×ÉÁÔÕÒÙ). úÁ×ÅÒÛÉÔÅ ÉÍÑ
721ÎÁÖÁÔÉÅÍ <Return>.
666 722
667ëÏÍÁÎÄÁ ÚÁÍÅÎÙ ÓÔÒÏËÉ (replace-string) ÔÒÅÂÕÅÔ Ä×Á ÁÒÇÕÍÅÎÔÁ -- ÓÔÒÏËÕ, 723ëÏÍÁÎÄÁ ÚÁÍÅÎÙ ÓÔÒÏËÉ (replace-string) ÔÒÅÂÕÅÔ Ä×Á ÁÒÇÕÍÅÎÔÁ -- ÓÔÒÏËÕ,
668ËÏÔÏÒÁÑ ÂÕÄÅÔ ÚÁÍÅÎÅÎÁ, É ÓÔÒÏËÕ, ÎÁ ËÏÔÏÒÕÀ ÎÕÖÎÏ ÚÁÍÅÎÉÔØ. ÷Ù ÄÏÌÖÎÙ 724ËÏÔÏÒÁÑ ÂÕÄÅÔ ÚÁÍÅÎÅÎÁ, É ÓÔÒÏËÕ, ÎÁ ËÏÔÏÒÕÀ ÎÕÖÎÏ ÚÁÍÅÎÉÔØ. ÷Ù ÄÏÌÖÎÙ
669ÚÁ×ÅÒÛÁÔØ ËÁÖÄÙÊ ÁÒÇÕÍÅÎÔ ××ÏÄÏÍ <Return>. 725ÚÁ×ÅÒÛÁÔØ ËÁÖÄÙÊ ÁÒÇÕÍÅÎÔ ××ÏÄÏÍ <Return>.
670 726
671>> ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ÎÁ Ä×Å ÐÕÓÔÙÅ ÓÔÒÏËÉ ÎÉÖÅ ÜÔÏÊ. 727>> ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ÎÁ Ä×Å ÐÕÓÔÙÅ ÓÔÒÏËÉ ÎÉÖÅ ÜÔÏÊ.
672 îÁÂÅÒÉÔÅ M-x repl s<Return>changed<Return>altered<Return>. 728 îÁÂÅÒÉÔÅ M-x repl s<Return>ÆÁÊÌ<Return>ÆÁÊÌÙ<Return>.
673 729
674 úÁÍÅÔØÔÅ, ËÁË ÜÔÁ ÓÔÒÏËÁ ÉÚÍÅÎÉÔÓÑ: ×Ù ÚÁÍÅÎÉÔÅ ÓÌÏ×Ï c-h-a-n-g-e-d 730 úÁÍÅÔØÔÅ, ËÁË ÜÔÁ ÓÔÒÏËÁ ÉÚÍÅÎÉÔÓÑ: ×Ù ÚÁÍÅÎÉÔÅ ÓÌÏ×Ï Æ-Á-Ê-Ì
675 ÓÌÏ×ÏÍ "altered" ×ÅÚÄÅ, ÇÄÅ ÏÎÏ ×ÓÔÒÅÔÉÔÓÑ, ÎÉÖÅ ÐÏÚÉÃÉÉ ËÕÒÓÏÒÁ. 731 ÓÌÏ×ÏÍ "ÆÁÊÌÙ" ×ÅÚÄÅ, ÇÄÅ ÏÎÏ ×ÓÔÒÅÔÉÔÓÑ, ÎÉÖÅ ÐÏÚÉÃÉÉ ËÕÒÓÏÒÁ.
676 732
677 733
678* á÷ôïóïèòáîåîéå 734* á÷ôïíáôéþåóëïå óïèòáîåîéå
679---------------- 735---------------------------
680 736
681ëÏÇÄÁ ×Ù ÉÚÍÅÎÑÅÔÅ ÆÁÊÌ, ÎÏ ÎÅ ÓÏÈÒÁÎÑÅÔÅ ÅÇÏ, ÔÏ × ÓÌÕÞÁÅ ËÒÁÈÁ ÓÉÓÔÅÍÙ 737ëÏÇÄÁ ×Ù ÉÚÍÅÎÑÅÔÅ ÆÁÊÌ, ÎÏ ÎÅ ÓÏÈÒÁÎÑÅÔÅ ÅÇÏ, ÔÏ × ÓÌÕÞÁÅ ËÒÁÈÁ ÓÉÓÔÅÍÙ ×Ù
682×Ù ÍÏÖÅÔÅ ÐÏÔÅÒÑÔØ ÉÎÆÏÒÍÁÃÉÀ. þÔÏÂÙ ÚÁÝÉÔÉÔØ ×ÁÓ ÏÔ ÜÔÏÇÏ, Emacs 738ÍÏÖÅÔÅ ÐÏÔÅÒÑÔØ ÉÎÆÏÒÍÁÃÉÀ. þÔÏÂÙ ÚÁÝÉÔÉÔØ ×ÁÓ ÏÔ ÜÔÏÇÏ, Emacs ÐÅÒÉÏÄÉÞÅÓËÉ
683ÐÅÒÉÏÄÉÞÅÓËÉ ÓÏÈÒÁÎÑÅÔ ËÁÖÄÙÊ ÆÁÊÌ, ËÏÔÏÒÙÊ ×Ù ÒÅÄÁËÔÉÒÕÅÔÅ. á×ÔÏÓÏÈÒÁÎÅÎÉÅ 739ÓÏÈÒÁÎÑÅÔ ËÁÖÄÙÊ ÆÁÊÌ, ËÏÔÏÒÙÊ ×Ù ÒÅÄÁËÔÉÒÕÅÔÅ. á×ÔÏÍÁÔÉÞÅÓËÏÅ ÓÏÈÒÁÎÅÎÉÅ
684ÐÒÏÉÓÈÏÄÉÔ × ÆÁÊÌ, ÉÍÑ ËÏÔÏÒÏÇÏ ÔÁËÏÅ ÖÅ, ÎÏ ÎÁÞÉÎÁÅÔÓÑ É ÚÁËÁÎÞÉ×ÁÅÔÓÑ 740ÐÒÏÉÓÈÏÄÉÔ × ÆÁÊÌ, ÉÍÑ ËÏÔÏÒÏÇÏ ÔÁËÏÅ ÖÅ, ÎÏ ÎÁÞÉÎÁÅÔÓÑ É ÚÁËÁÎÞÉ×ÁÅÔÓÑ
685ÓÉÍ×ÏÌÏÍ "#"; ÎÁÐÒÉÍÅÒ, ÅÓÌÉ ×ÁÛ ÆÁÊÌ ÎÁÚÙ×ÁÅÔÓÑ "hello.c", ÔÏ 741ÓÉÍ×ÏÌÏÍ "#"; ÎÁÐÒÉÍÅÒ, ÅÓÌÉ ×ÁÛ ÆÁÊÌ ÎÁÚÙ×ÁÅÔÓÑ "hello.c", ÔÏ Á×ÔÏÍÁÔÉÞÅÓËÉ
686Á×ÔÏÓÏÈÒÁÎÅÎÎÙÊ ÆÁÊÌ ÂÕÄÅÔ ÎÁÚÙ×ÁÔØÓÑ "#hello.c#". ëÏÇÄÁ ×Ù ÓÏÈÒÁÎÉÔÅ ÆÁÊÌ 742ÓÏÈÒÁÎÅÎÎÙÊ ÆÁÊÌ ÂÕÄÅÔ ÎÁÚÙ×ÁÔØÓÑ "#hello.c#". ëÏÇÄÁ ×Ù ÓÏÈÒÁÎÉÔÅ ÆÁÊÌ
687ÏÂÙÞÎÙÍ ÓÐÏÓÏÂÏÍ, Emacs ÕÄÁÌÉÔ Á×ÔÏÓÏÈÒÁÎÅÎÎÙÊ ÆÁÊÌ. 743ÏÂÙÞÎÙÍ ÓÐÏÓÏÂÏÍ, Emacs ÕÄÁÌÉÔ Á×ÔÏÍÁÔÉÞÅÓËÉ ÓÏÈÒÁÎÅÎÎÙÊ ÆÁÊÌ.
688 744
689åÓÌÉ ÓÉÓÔÅÍÁ ÚÁ×ÉÓÌÁ, ×Ù ÍÏÖÅÔÅ ×ÏÓÓÔÁÎÏ×ÉÔØ ×ÁÛÉ ÉÚÍÅÎÅÎÉÑ, ËÏÔÏÒÙÊ ÂÙÌÉ 745åÓÌÉ ÓÉÓÔÅÍÁ ÚÁ×ÉÓÌÁ, ÔÏ ×Ù ÍÏÖÅÔÅ ×ÏÓÓÔÁÎÏ×ÉÔØ ×ÁÛÉ ÉÚÍÅÎÅÎÉÑ, ËÏÔÏÒÙÊ ÂÙÌÉ
690ÓÏÈÒÁÎÅÎÙ Á×ÔÏÍÁÔÉÞÅÓËÉ, ÐÕÔÅÍ ÏÔËÒÙÔÉÑ ÎÏÒÍÁÌØÎÏÇÏ ÆÁÊÌÁ (ÆÁÊÌÁ, ËÏÔÏÒÙÊ ×Ù 746ÓÏÈÒÁÎÅÎÙ Á×ÔÏÍÁÔÉÞÅÓËÉ, ÐÕÔÅÍ ÏÔËÒÙÔÉÑ ÎÕÖÎÏÇÏ ÆÁÊÌÁ (ÆÁÊÌÁ, ËÏÔÏÒÙÊ ×Ù
691ÒÅÄÁËÔÉÒÏ×ÁÌÉ, ÎÅ Á×ÔÏÓÏÈÒÁÎÅÎÎÏÇÏ), É ÚÁÔÅÍ ÎÁÂÒÁ× M-x recover-file<return>. 747ÒÅÄÁËÔÉÒÏ×ÁÌÉ, ÎÅ ÓÏÈÒÁÎÅÎÎÏÇÏ), É ÚÁÔÅÍ ÎÁÂÒÁ× M-x recover-file<return>.
692ëÏÇÄÁ Õ ×ÁÓ ÓÐÒÏÓÑÔ ÐÏÄÔ×ÅÒÖÄÅÎÉÅ, ÎÁÂÅÒÉÔÅ yes<return>, ÞÔÏÂÙ ×ÏÓÓÔÁÎÏ×ÉÔØ 748ëÏÇÄÁ Õ ×ÁÓ ÚÁÐÒÏÓÑÔ ÐÏÄÔ×ÅÒÖÄÅÎÉÅ, ÎÁÂÅÒÉÔÅ yes<return>, ÞÔÏÂÙ
693Á×ÔÏÓÏÈÒÁÎÅÎÎÙÅ ÄÁÎÎÙÅ. 749×ÏÓÓÔÁÎÏ×ÉÔØ Á×ÔÏÍÁÔÉÞÅÓËÉ ÓÏÈÒÁÎÅÎÎÙÅ ÄÁÎÎÙÅ.
694 750
695 751
696* ïâìáóôø üèï (ECHO AREA) 752* ïâìáóôø üèï (ECHO AREA)
697------------------------- 753-------------------------
698 754
699åÓÌÉ Emacs ×ÉÄÉÔ, ÞÔÏ ×Ù ÍÅÄÌÅÎÎÏ ÎÁÂÉÒÁÅÔÅ ËÏÍÁÎÄÙ, ÏÎ ÐÏËÁÚÙ×ÁÅÔ ÉÈ ×ÁÍ 755åÓÌÉ Emacs ×ÉÄÉÔ, ÞÔÏ ×Ù ÍÅÄÌÅÎÎÏ ÎÁÂÉÒÁÅÔÅ ËÏÍÁÎÄÙ ÉÚ ÎÅÓËÏÌØËÉÈ ÓÉÍ×ÏÌÏ×,
700×ÎÉÚÕ ÜËÒÁÎÁ, × ÏÂÌÁÓÔÉ ÎÁÚÙ×ÁÅÍÏÊ "ÏÂÌÁÓÔØ ÜÈÏ". ïÂÌÁÓÔØ ÜÈÏ -- ÜÔÏ ÓÁÍÁÑ 756ÔÏ ÏÎ ÐÏËÁÚÙ×ÁÅÔ ÉÈ ×ÁÍ ×ÎÉÚÕ ÜËÒÁÎÁ, × ÏÂÌÁÓÔÉ ÎÁÚÙ×ÁÅÍÏÊ "ÏÂÌÁÓÔØ ÜÈÏ".
701ÎÉÖÎÑÑ ÓÔÒÏËÁ ÜËÒÁÎÁ. 757ïÂÌÁÓÔØ ÜÈÏ -- ÜÔÏ ÓÁÍÁÑ ÎÉÖÎÑÑ ÓÔÒÏËÁ ÜËÒÁÎÁ.
702 758
703 759
704* óôòïëá òåöéíá 760* óôòïëá óïóôïñîéñ
705--------------- 761------------------
706 762
707óÔÒÏËÁ ÓÒÁÚÕ ÎÁÄ ÏÂÌÁÓÔØÀ ÜÈÏ ÎÁÚÙ×ÁÅÔÓÑ "ÓÔÒÏËÁ ÓÏÓÔÏÑÎÉÑ". 763óÔÒÏËÁ ÓÒÁÚÕ ÎÁÄ ÏÂÌÁÓÔØÀ ÜÈÏ ÎÁÚÙ×ÁÅÔÓÑ "ÓÔÒÏËÏÊ ÓÏÓÔÏÑÎÉÑ". ÷ÙÇÌÑÄÉÔ ÜÔÁ
708÷ÙÇÌÑÄÉÔ ÜÔÁ ÓÔÒÏËÁ ÐÒÉÍÅÒÎÏ ÔÁË: 764ÓÔÒÏËÁ ÐÒÉÍÅÒÎÏ ÔÁË:
709 765
710--:** TUTORIAL.ru (Fundamental)--L670--58%---------------- 766--:** TUTORIAL.ru 63% L749 (Fundamental)-----------------------
711 767
712üÔÁ ÓÔÒÏËÁ ÓÏÏÂÝÁÅÔ ÐÏÌÅÚÎÕÀ ÉÎÆÏÒÍÁÃÉÀ Ï ÓÏÓÔÏÑÎÉÉ Emacs É ÔÅËÓÔÁ, ËÏÔÏÒÙÊ 768üÔÁ ÓÔÒÏËÁ ÓÏÏÂÝÁÅÔ ÐÏÌÅÚÎÕÀ ÉÎÆÏÒÍÁÃÉÀ Ï ÓÏÓÔÏÑÎÉÉ Emacs É ÔÅËÓÔÁ, ËÏÔÏÒÙÊ
713×Ù ÒÅÄÁËÔÉÒÕÅÔÅ. 769×Ù ÒÅÄÁËÔÉÒÕÅÔÅ.
714 770
715÷Ù ÕÖÅ ÚÎÁÅÔÅ, ÞÔÏ ÏÚÎÁÞÁÅÔ ÉÍÑ ÆÁÊÌÁ -- ÜÔÏ ÆÁÊÌ, ËÏÔÏÒÙÊ ×Ù ÏÔËÒÙÌÉ. -NN%-- 771÷Ù ÕÖÅ ÚÎÁÅÔÅ, ÞÔÏ ÏÚÎÁÞÁÅÔ ÉÍÑ ÆÁÊÌÁ -- ÜÔÏ ÆÁÊÌ, ËÏÔÏÒÙÊ ×Ù ÏÔËÒÙÌÉ. NN%
716ÐÏËÁÚÙ×ÁÅÔ ÔÅËÕÝÕÀ ÐÏÚÉÃÉÀ ËÕÒÓÏÒÁ × ÔÅËÓÔÅ; ÜÔÏ ÏÚÎÁÞÁÅÔ ÞÔÏ NN ÐÒÏÃÅÎÔÏ× 772ÐÏËÁÚÙ×ÁÅÔ ÔÅËÕÝÕÀ ÐÏÚÉÃÉÀ ËÕÒÓÏÒÁ × ÔÅËÓÔÅ; ÜÔÏ ÏÚÎÁÞÁÅÔ ÞÔÏ NN ÐÒÏÃÅÎÔÏ×
717ÔÅËÓÔÁ ×ÙÛÅ, ÞÅÍ ÎÁÞÁÌÏ ÜËÒÁÎÁ. åÓÌÉ ÐÅÒ×ÁÑ ÓÔÒÏËÁ ÎÁÈÏÄÉÔÓÑ × ÐÅÒ×ÏÊ ÓÔÒÏËÅ 773ÔÅËÓÔÁ ÎÁÈÏÄÑÔÓÑ ×ÙÛÅ, ÞÅÍ ÎÁÞÁÌÏ ÜËÒÁÎÁ. åÓÌÉ ÐÅÒ×ÁÑ ÓÔÒÏËÁ ×ÓÅÇÏ ÔÅËÓÔÁ
718ÜËÒÁÎÁ, ×Ù ÔÁÍ Õ×ÉÄÉÔÅ --Top-- ×ÍÅÓÔÏ --00%--. åÓÌÉ ÎÁ ÜËÒÁÎÅ ÏÔÏÂÒÁÖÁÅÔÓÑ 774ÎÁÈÏÄÉÔÓÑ × ÐÅÒ×ÏÊ ÓÔÒÏËÅ ÜËÒÁÎÁ, ×Ù ÔÁÍ Õ×ÉÄÉÔÅ "Top" ×ÍÅÓÔÏ "0%". åÓÌÉ ÎÁ
719ÐÏÓÌÅÄÎÑÑ ÓÔÒÏËÁ, ÔÏ ÂÕÄÅÔ ÏÔÏÂÒÁÖÅÎÏ --Bot--. åÓÌÉ ÔÅËÓÔ ÎÁÓÔÏÌØËÏ ÍÁÌ, ÞÔÏ 775ÜËÒÁÎÅ ÏÔÏÂÒÁÖÁÅÔÓÑ ÐÏÓÌÅÄÎÑÑ ÓÔÒÏËÁ, ÔÏ ÂÕÄÅÔ ÏÔÏÂÒÁÖÅÎÏ "Bot". åÓÌÉ ÔÅËÓÔ
720×ÅÓØ ×ÍÅÝÁÅÔÓÑ × ÜËÒÁÎ, ÓÔÒÏËÁ ÓÏÓÔÏÑÎÉÑ ÓÏÏÂÝÉÔ --All--. 776ÎÁÓÔÏÌØËÏ ÍÁÌ, ÞÔÏ ×ÅÓØ ×ÍÅÝÁÅÔÓÑ × ÜËÒÁÎ, ÔÏ ÓÔÒÏËÁ ÓÏÓÔÏÑÎÉÑ ÓÏÏÂÝÉÔ
721 777"All".
722âÕË×Á L É ÃÉÆÒÙ ÐÏËÁÚÙ×ÁÀÔ ÐÏÚÉÃÉÀ ÄÒÕÇÉÍ ÓÐÏÓÏÂÏÍ: ÏÎÉ ÐÏËÁÚÙ×ÁÀÔ ÎÏÍÅÒ 778
723ÔÅËÕÝÅÊ ÓÔÒÏËÉ Ó ËÕÒÓÏÒÏÍ. 779âÕË×Á L É ÃÉÆÒÙ ÐÏËÁÚÙ×ÁÀÔ ÐÏÚÉÃÉÀ ÄÒÕÇÉÍ ÓÐÏÓÏÂÏÍ -- ÏÎÉ ÐÏËÁÚÙ×ÁÀÔ ÎÏÍÅÒ
724 780ÓÔÒÏËÉ × ËÏÔÏÒÏÊ ÎÁÈÏÄÉÔÓÑ ËÕÒÓÏÒ.
725ú×ÅÚÄÏÞËÉ × ÎÁÞÁÌÅ ÓÔÒÏËÉ ÏÚÎÁÞÁÀÔ, ÞÔÏ ×Ù ÉÚÍÅÎÑÌÉ ÔÅËÓÔ. ëÁË ÔÏÌØËÏ ×Ù 781
726ÏÔËÒÙÌÉ ÉÌÉ ÓÏÈÒÁÎÉÌÉ ÆÁÊÌ, ÜÔÁ ÞÁÓÔØ ÓÔÒÏËÉ ÂÕÄÅÔ ÓÏÄÅÒÖÁÔØ ÎÅ Ú×ÅÚÄÏÞËÉ, Á 782ú×ÅÚÄÏÞËÉ × ÎÁÞÁÌÅ ÓÔÒÏËÉ ÏÚÎÁÞÁÀÔ, ÞÔÏ ×Ù ÉÚÍÅÎÑÌÉ ÔÅËÓÔ. ðÒÉ ÏÔËÒÙÔÉÉ ÉÌÉ
727ÔÉÒÅ. 783ÓÏÈÒÁÎÅÎÉÉ ÆÁÊÌÁ, ÜÔÁ ÞÁÓÔØ ÓÔÒÏËÉ ÂÕÄÅÔ ÓÏÄÅÒÖÁÔØ ÎÅ Ú×ÅÚÄÏÞËÉ, Á ÔÉÒÅ.
728 784
729þÁÓÔØ ÓÔÒÏËÉ ÓÔÁÔÕÓÁ ×ÎÕÔÒÉ ÓËÏÂÏË ÓÏÏÂÝÁÅÔ ×ÁÍ ÒÅÖÉÍ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ, 785þÁÓÔØ ÓÔÒÏËÉ ÓÔÁÔÕÓÁ ×ÎÕÔÒÉ ÓËÏÂÏË ÓÏÏÂÝÁÅÔ ×ÁÍ Ï ÒÅÖÉÍÅ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ,
730ËÏÔÏÒÙÍ ×Ù ÐÏÌØÚÕÅÔÅÓØ. óÔÁÎÄÁÒÔÎÙÊ ÒÅÖÉÍ -- Fundamental, ÅÇÏ ×Ù ÉÓÐÏÌØÚÕÅÔÅ 786ËÏÔÏÒÙÍ ×Ù ÓÅÊÞÁÓ ÉÓÐÏÌØÚÕÅÔÅ. óÔÁÎÄÁÒÔÎÙÊ ÒÅÖÉÍ -- Fundamental, ÏÎ
731É ÓÅÊÞÁÓ. üÔÏ ÐÒÉÍÅÒ "ÏÓÎÏ×ÎÏÇÏ ÒÅÖÉÍÁ" ("major mode"). 787ÉÓÐÏÌØÚÕÅÔÓÑ É ÄÁÎÎÏÍ ÄÏËÕÍÅÎÔÅ. üÔÏ ÐÒÉÍÅÒ "ÏÓÎÏ×ÎÏÇÏ ÒÅÖÉÍÁ" ("major
732 788mode").
733Emacs ÉÍÅÅÔ ÍÎÏÇÏ ÒÁÚÌÉÞÎÙÈ ÏÓÎÏ×ÎÙÈ ÒÅÖÉÍÏ×. îÅËÏÔÏÒÙÅ ÉÚ ÒÅÖÉÍÏ× ÏÚÎÁÞÁÀÔ, 789
734ÞÔÏ ×Ù ÒÅÄÁËÔÉÒÕÅÔÅ ÔÅËÓÔ ÎÁ ÒÁÚÌÉÞÎÏÍ ÑÚÙËÅ É/ÉÌÉ ÒÁÚÌÉÞÎÙÅ ×ÉÄÙ ÔÅËÓÔÁ, 790Emacs ÉÍÅÅÔ ÍÎÏÇÏ ÒÁÚÌÉÞÎÙÈ ÏÓÎÏ×ÎÙÈ ÒÅÖÉÍÏ×. îÅËÏÔÏÒÙÅ ÉÚ ÒÅÖÉÍÏ×
735ÔÁËÉÅ ËÁË Lisp-ÒÅÖÉÍ, Text-ÒÅÖÉÍ É ÐÒ. ÷ ÌÀÂÏÅ ×ÒÅÍÑ ÄÅÊÓÔ×ÕÅÔ ÔÏÌØËÏ ÏÄÉÎ 791ÉÓÐÏÌØÚÕÀÔÓÑ ÄÌÑ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ ÔÅËÓÔÁ ÎÁ ÒÁÚÌÉÞÎÙÈ ÑÚÙËÁÈ É/ÉÌÉ ÒÁÚÌÉÞÎÙÈ
736ÏÓÎÏ×ÎÏÊ ÒÅÖÉÍ, É ÅÇÏ ÎÁÚ×ÁÎÉÅ ×Ù ÍÏÖÅÔÅ ÎÁÊÔÉ × ÓËÏÂËÁÈ, ÇÄÅ ÓÅÊÞÁÓ 792×ÉÄÏ× ÔÅËÓÔÁ, ÔÁËÉÅ ËÁË Lisp-ÒÅÖÉÍ, Text-ÒÅÖÉÍ É ÐÒ. ÷ ËÁÖÄÙÊ ÍÏÍÅÎÔ
737ÎÁÈÏÄÉÔÓÑ ÓÌÏ×Ï "Fundamental" (ÂÁÚÏ×ÙÊ). 793×ÒÅÍÅÎÉ ÄÅÊÓÔ×ÕÅÔ ÔÏÌØËÏ ÏÄÉÎ ÏÓÎÏ×ÎÏÊ ÒÅÖÉÍ, É ÅÇÏ ÎÁÚ×ÁÎÉÅ ×Ù ÍÏÖÅÔÅ ÎÁÊÔÉ
738 794× ÓËÏÂËÁÈ -- ÔÁÍ, ÇÄÅ ÓÅÊÞÁÓ ÎÁÈÏÄÉÔÓÑ ÓÌÏ×Ï "Fundamental" (ÂÁÚÏ×ÙÊ).
739ëÁÖÄÙÊ ÏÓÎÏ×ÎÏÊ ÒÅÖÉÍ ÉÍÅÅÔ ÎÅÓËÏÌØËÏ ÏÔÌÉÞÉÔÅÌØÎÙÈ ËÏÍÁÎÄ. îÁÐÒÉÍÅÒ, ËÏÍÁÎÄÙ 795
740ÓÏÚÄÁÎÉÑ ËÏÍÍÅÎÔÁÒÉÑ × ÐÒÏÇÒÁÍÍÅ, É ÐÏÓËÏÌØËÕ × ËÁÖÄÏÍ ÑÚÙËÅ ÐÒÏÇÒÁÍÍÉÒÏ×ÁÎÉÑ 796ëÁÖÄÙÊ ÏÓÎÏ×ÎÏÊ ÒÅÖÉÍ ÚÁÓÔÁ×ÌÑÅÔ ÎÅËÏÔÏÒÙÅ ËÏÍÁÎÄÙ ×ÅÓÔÉ ÓÅÂÑ ÎÅÍÎÏÇÏ ÐÏ
741ËÏÍÍÅÎÔÁÒÉÉ ÚÁÐÉÓÙ×ÁÀÔÓÑ ÐÏ-Ó×ÏÅÍÕ, ËÁÖÄÙÊ ÏÓÎÏ×ÎÏÊ ÒÅÖÉÍ ×ÓÔÁ×ÌÑÅÔ ÉÈ 797ÄÒÕÇÏÍÕ. îÁÐÒÉÍÅÒ, ÜÔÏ ËÏÍÁÎÄÙ ÓÏÚÄÁÎÉÑ ËÏÍÍÅÎÔÁÒÉÅ× × ÐÒÏÇÒÁÍÍÅ, É
742ÐÏ-ÒÁÚÎÏÍÕ. ëÁÖÄÙÊ ÏÓÎÏ×ÎÏÊ ÒÅÖÉÍ ÉÍÅÅÔ ÉÍÅÎÏ×ÁÎÎÕÀ ËÏÍÁÎÄÕ, ËÏÔÏÒÁÑ ×ËÌÀÞÁÅÔ 798ÐÏÓËÏÌØËÕ × ËÁÖÄÏÍ ÑÚÙËÅ ÐÒÏÇÒÁÍÍÉÒÏ×ÁÎÉÑ ËÏÍÍÅÎÔÁÒÉÉ ÚÁÐÉÓÙ×ÁÀÔÓÑ
743ÅÇÏ. îÁÐÒÉÍÅÒ, M-x fundamental-mode - ËÏÍÁÎÄÁ, ËÏÔÏÒÁÑ ÐÅÒÅËÌÀÞÁÅÔ × ÂÁÚÏ×ÙÊ 799ÐÏ-Ó×ÏÅÍÕ, ÔÏ É ËÁÖÄÙÊ ÏÓÎÏ×ÎÏÊ ÒÅÖÉÍ ×ÓÔÁ×ÌÑÅÔ ÉÈ ÐÏ-ÒÁÚÎÏÍÕ. ëÁÖÄÙÊ
744(Fundamental) ÒÅÖÉÍ. 800ÏÓÎÏ×ÎÏÊ ÒÅÖÉÍ ÉÍÅÅÔ ÉÍÅÎÏ×ÁÎÎÕÀ ËÏÍÁÎÄÕ, ËÏÔÏÒÁÑ ×ËÌÀÞÁÅÔ ÅÇÏ. îÁÐÒÉÍÅÒ,
745 801M-x fundamental-mode -- ÜÔÏ ËÏÍÁÎÄÁ, ËÏÔÏÒÁÑ ×ËÌÀÞÁÅÔ ÂÁÚÏ×ÙÊ (Fundamental)
746åÓÌÉ ×Ù ÒÅÄÁËÔÉÒÕÅÔÅ ÒÕÓÓËÉÊ ÔÅËÓÔ, ÎÁÐÒÉÍÅÒ ËÁË ÜÔÏÔ (ËÏÎÅÞÎÏ, ÎÅ ÉÍÅÎÎÏ 802ÒÅÖÉÍ.
747ÜÔÏÔ, Á TUTORIAL) ÆÁÊÌ, ×Ù ×ÅÒÏÑÔÎÏ ÄÏÌÖÎÙ ÐÅÒÅËÌÀÞÉÔØÓÑ × Text-ÒÅÖÉÍ. 803
804åÓÌÉ ×Ù ÒÅÄÁËÔÉÒÕÅÔÅ ÔÅËÓÔ ÎÁ ÅÓÔÅÓÔ×ÅÎÎÏÍ ÑÚÙËÅ, ÎÁÐÒÉÍÅÒ, ËÁË ÜÔÏÔ ÆÁÊÌ,
805ÔÏ ×Ù ×ÅÒÏÑÔÎÏ ÄÏÌÖÎÙ ÐÅÒÅËÌÀÞÉÔØÓÑ × Text-ÒÅÖÉÍ.
748 806
749>> îÁÂÅÒÉÔÅ M-x text mode<Return>. 807>> îÁÂÅÒÉÔÅ M-x text mode<Return>.
750 808
751îÅ ×ÏÌÎÕÊÔÅÓØ, ÎÉ ÏÄÎÁ ÉÚ ×ÙÕÞÅÎÎÙÈ ×ÁÍÉ ËÏÍÁÎÄ Emacs ÎÅ ÉÚÍÅÎÉÌÁÓØ. îÏ ×Ù 809îÅ ×ÏÌÎÕÊÔÅÓØ, ÎÉ ÏÄÎÁ ÉÚ ×ÙÕÞÅÎÎÙÈ ×ÁÍÉ ËÏÍÁÎÄ Emacs ÎÅ ÉÚÍÅÎÉÌÁÓØ. îÏ ×Ù
752ÍÏÖÅÔÅ ÚÁÍÅÔÉÔØ, ÞÔÏ M-f É M-b ÔÅÐÅÒØ ÒÁÚÌÉÞÁÀÔ ÁÐÏÓÔÒÏÆÙ ËÁË ÞÁÓÔÉ ÓÌÏ×Á. 810ÍÏÖÅÔÅ ÚÁÍÅÔÉÔØ, ÞÔÏ M-f É M-b ÔÅÐÅÒØ ÒÁÓÓÍÁÔÒÉ×ÁÀÔ ÁÐÏÓÔÒÏÆÙ ËÁË ÞÁÓÔØ
753òÁÎÅÅ, × ÂÁÚÏ×ÏÍ ÒÅÖÉÍÅ (Fundamental mode), M-f É M-b ÐÏÎÉÍÁÌÉ ÁÐÏÓÔÒÏÆÙ 811ÓÌÏ×Á. òÁÎÅÅ, × ÂÁÚÏ×ÏÍ ÒÅÖÉÍÅ (Fundamental mode), M-f É M-b ÐÏÎÉÍÁÌÉ
754ËÁË ÒÁÚÄÅÌÉÔÅÌÉ ÓÌÏ×. 812ÁÐÏÓÔÒÏÆÙ ËÁË ÒÁÚÄÅÌÉÔÅÌÉ ÓÌÏ×.
755 813
756ïÓÎÏ×ÎÏÊ ÒÅÖÉÍ ÏÂÙÞÎÏ ÄÅÌÁÅÔ ÎÅÂÏÌØÛÉÅ ÉÚÍÅÎÅÎÉÑ, ÔÁËÉÅ ËÁË: ÂÏÌØÛÉÎÓÔ×Ï 814ïÓÎÏ×ÎÏÊ ÒÅÖÉÍ ÏÂÙÞÎÏ ÄÅÌÁÅÔ ÎÅÂÏÌØÛÉÅ ÉÚÍÅÎÅÎÉÑ, ÔÁËÉÅ ËÁË: ÂÏÌØÛÉÎÓÔ×Ï
757ËÏÍÁÎÄ ÄÅÌÁÀÔ "ÔÕ ÖÅ ÒÁÂÏÔÕ" × ËÁÖÄÏÍ ÉÚ ÒÅÖÉÍÏ×, ÎÏ ÉÈ ÒÁÂÏÔÁ ÏÔÌÉÞÁÅÔÓÑ 815ËÏÍÁÎÄ ÄÅÌÁÀÔ "ÏÄÎÕ É ÔÕ ÖÅ ÒÁÂÏÔÕ" × ËÁÖÄÏÍ ÉÚ ÒÅÖÉÍÏ×, ÎÏ ÉÈ ÄÅÊÓÔ×ÉÅ
758ËÁËÏÊ-ÎÉÂÕÄØ ÍÅÌÏÞØÀ. 816ÏÔÌÉÞÁÅÔÓÑ ËÁËÏÊ-ÎÉÂÕÄØ ÍÅÌÏÞØÀ.
759 817
760äÌÑ ÐÒÏÓÍÏÔÒÁ ÄÏËÕÍÅÎÔÁÃÉÉ Ï ×ÁÛÅÍ ÔÅËÕÝÅÍ ÏÓÎÏ×ÎÏÍ ÒÅÖÉÍÅ, ÎÁÖÍÉÔÅ C-h m. 818äÌÑ ÐÒÏÓÍÏÔÒÁ ÄÏËÕÍÅÎÔÁÃÉÉ Ï ÔÅËÕÝÅÍ ÏÓÎÏ×ÎÏÍ ÒÅÖÉÍÅ, ÎÁÖÍÉÔÅ C-h m.
761 819
762>> éÓÐÏÌØÚÕÊÔÅ C-u C-v ÏÄÉÎ ÒÁÚ ÉÌÉ ÂÏÌÅÅ, ÞÔÏÂÙ ÒÁÓÐÏÌÏÖÉÔØ ÜÔÕ ÓÔÒÏËÕ ÂÌÉÖÅ 820>> éÓÐÏÌØÚÕÊÔÅ C-u C-v ÏÄÉÎ ÒÁÚ ÉÌÉ ÂÏÌÅÅ, ÞÔÏÂÙ ÒÁÓÐÏÌÏÖÉÔØ ÜÔÕ ÓÔÒÏËÕ
763 Ë ×ÅÒÈÕ ÜËÒÁÎÁ. 821 ÂÌÉÖÅ Ë ×ÅÒÈÕ ÜËÒÁÎÁ.
764>> îÁÂÅÒÉÔÅ C-h m, ÞÔÏÂÙ ÐÏÓÍÏÔÒÅÔØ ÏÔÌÉÞÉÑ Text-ÒÅÖÉÍÁ ÏÔ ÂÁÚÏ×ÏÇÏ. 822>> îÁÂÅÒÉÔÅ C-h m, ÞÔÏÂÙ ÐÏÓÍÏÔÒÅÔØ ÏÔÌÉÞÉÑ Text-ÒÅÖÉÍÁ ÏÔ ÂÁÚÏ×ÏÇÏ.
765>> îÁÂÅÒÉÔÅ C-x 1, ÞÔÏÂÙ ÕÂÒÁÔØ ÄÏËÕÍÅÎÔÁÃÉÀ Ó ÇÌÁÚ ÄÏÌÏÊ :) 823>> îÁÂÅÒÉÔÅ C-x 1, ÞÔÏÂÙ ÕÂÒÁÔØ ÄÏËÕÍÅÎÔÁÃÉÀ Ó ÇÌÁÚ ÄÏÌÏÊ :)
766 824
767ïÓÎÏ×ÎÏÊ ÒÅÖÉÍ ÎÁÚÙ×ÁÅÔÓÑ ÏÓÎÏ×ÎÙÍ ÐÏÔÏÍÕ, ÞÔÏ ÅÓÔØ ÎÅÓËÏÌØËÏ ÄÏÐÏÌÎÉÔÅÌØÎÙÈ 825ïÓÎÏ×ÎÏÊ ÒÅÖÉÍ ÎÁÚÙ×ÁÅÔÓÑ ÏÓÎÏ×ÎÙÍ ÐÏÔÏÍÕ, ÞÔÏ ÔÁËÖÅ ÓÕÝÅÓÔ×ÕÀÔ
768(minor) ÒÅÖÉÍÏ×. äÏÐÏÌÎÉÔÅÌØÎÙÅ ÒÅÖÉÍÙ ÎÅ Ñ×ÌÑÀÔÓÑ ÁÌØÔÅÒÎÁÔÉ×ÁÍÉ ÏÓÎÏ×ÎÙÍ, 826ÄÏÐÏÌÎÉÔÅÌØÎÙÅ (minor) ÒÅÖÉÍÙ. äÏÐÏÌÎÉÔÅÌØÎÙÅ ÒÅÖÉÍÙ ÎÅ Ñ×ÌÑÀÔÓÑ
769ÏÎÉ ÔÏÌØËÏ ÎÅÍÎÏÇÏ ÉÚÍÅÎÑÀÔ ÉÈ ÐÏ×ÅÄÅÎÉÅ. ëÁÖÄÙÊ ÄÏÐÏÌÎÉÔÅÌØÎÙÊ ÒÅÖÉÍ 827ÁÌØÔÅÒÎÁÔÉ×ÁÍÉ ÏÓÎÏ×ÎÙÍ, ÏÎÉ ÔÏÌØËÏ ÎÅÍÎÏÇÏ ÉÚÍÅÎÑÀÔ ÉÈ ÐÏ×ÅÄÅÎÉÅ. ëÁÖÄÙÊ
770×ËÌÀÞÁÅÔÓÑ/×ÙËÌÀÞÁÅÔÓÑ ÎÅÚÁ×ÉÓÉÍÏ ÏÔ ÄÒÕÇÉÈ ÄÏÐÏÌÎÉÔÅÌØÎÙÈ ÒÅÖÉÍÏ×, É 828ÄÏÐÏÌÎÉÔÅÌØÎÙÊ ÒÅÖÉÍ ×ËÌÀÞÁÅÔÓÑ/×ÙËÌÀÞÁÅÔÓÑ ÎÅÚÁ×ÉÓÉÍÏ ÏÔ ÄÒÕÇÉÈ
771ÎÅÚÁ×ÉÓÉÍÏ ÏÔ ×ÁÛÅÇÏ ÏÓÎÏ×ÎÏÇÏ ÒÅÖÉÍÁ. ÷Ù ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ ÏÓÎÏ×ÎÏÊ ÒÅÖÉÍ 829ÄÏÐÏÌÎÉÔÅÌØÎÙÈ ÒÅÖÉÍÏ×, É ÎÅÚÁ×ÉÓÉÍÏ ÏÔ ×ÁÛÅÇÏ ÏÓÎÏ×ÎÏÇÏ ÒÅÖÉÍÁ. ÷Ù ÍÏÖÅÔÅ
772ÂÅÚ ÄÏÐÏÌÎÉÔÅÌØÎÙÈ, ÉÌÉ Ó ÌÀÂÏÊ ÉÈ ËÏÍÂÉÎÁÃÉÅÊ. 830ÉÓÐÏÌØÚÏ×ÁÔØ ÏÓÎÏ×ÎÏÊ ÒÅÖÉÍ ÂÅÚ ÄÏÐÏÌÎÉÔÅÌØÎÙÈ, ÉÌÉ Ó ÌÀÂÏÊ ÉÈ ËÏÍÂÉÎÁÃÉÅÊ.
773 831
774ïÄÉÎ ÉÚ ÄÏÐÏÌÎÉÔÅÌØÎÙÈ ÒÅÖÉÍÏ× ÏÞÅÎØ ÐÏÌÅÚÅÎ, ÏÓÏÂÅÎÎÏ ÄÌÑ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ 832ïÄÉÎ ÉÚ ÄÏÐÏÌÎÉÔÅÌØÎÙÈ ÒÅÖÉÍÏ× ÏÞÅÎØ ÐÏÌÅÚÅÎ, ÏÓÏÂÅÎÎÏ ÄÌÑ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ
775ÔÅËÓÔÁ - ÜÔÏ ÒÅÖÉÍ Á×ÔÏÚÁÐÏÌÎÅÎÉÑ (Auto Fill mode). ëÏÇÄÁ ÜÔÏÔ ÒÅÖÉÍ 833ÔÅËÓÔÁ -- ÜÔÏ ÒÅÖÉÍ Á×ÔÏÚÁÐÏÌÎÅÎÉÑ (Auto Fill mode). ëÏÇÄÁ ÜÔÏÔ ÒÅÖÉÍ
776×ËÌÀÞÅÎ, Emacs ÒÁÚÒÙ×ÁÅÔ ÓÔÒÏËÉ ÍÅÖÄÕ ÓÌÏ×ÁÍÉ Á×ÔÏÍÁÔÉÞÅÓËÉ, ËÏÇÄÁ ×Ù 834×ËÌÀÞÅÎ, ÔÏ Emacs ÒÁÚÒÙ×ÁÅÔ ÓÔÒÏËÉ ÍÅÖÄÕ ÓÌÏ×ÁÍÉ Á×ÔÏÍÁÔÉÞÅÓËÉ, × ÔÅÈ
777×ÓÔÁ×ÌÑÅÔÅ ÔÅËÓÔ É ÄÅÌÁÅÔÅ ÓÔÒÏËÉ ÓÌÉÛËÏÍ ÄÌÉÎÎÙÍÉ. 835ÓÌÕÞÁÑÈ ËÏÇÄÁ ×Ù ×ÓÔÁ×ÌÑÅÔÅ ÔÅËÓÔ É ÄÅÌÁÅÔÅ ÓÔÒÏËÉ ÓÌÉÛËÏÍ ÄÌÉÎÎÙÍÉ.
778 836
779÷Ù ÍÏÖÅÔÅ ×ËÌÀÞÉÔØ ÒÅÖÉÍ Á×ÔÏÚÁÐÏÌÎÅÎÉÑ, ÎÁÂÒÁ× M-x auto fill mode<Return>. 837÷Ù ÍÏÖÅÔÅ ×ËÌÀÞÉÔØ ÒÅÖÉÍ Á×ÔÏÚÁÐÏÌÎÅÎÉÑ, ÎÁÂÒÁ× M-x auto fill mode<Return>.
780ëÏÇÄÁ ÜÔÏÔ ÒÅÖÉÍ ×ËÌÀÞÅÎ, ÅÇÏ ÍÏÖÎÏ ×ÙËÌÀÞÉÔØ - M-x auto fill mode<Return>. 838ëÏÇÄÁ ÜÔÏÔ ÒÅÖÉÍ ×ËÌÀÞÅÎ, ÅÇÏ ÍÏÖÎÏ ×ÙËÌÀÞÉÔØ Ó ÐÏÍÏÝØÀ ÔÏÊ ÖÅ ËÏÍÁÎÄÙ --
781åÓÌÉ ÒÅÖÉÍ ×ËÌÀÞÅÎ -- ËÏÍÁÎÄÁ ÅÇÏ ×ÙËÌÀÞÉÔ, ÅÓÌÉ ×ÙËÌÀÞÅÎ -- ×ËÌÀÞÉÔ. íÙ 839M-x auto fill mode<Return>. åÓÌÉ ÒÅÖÉÍ ×ËÌÀÞÅÎ, ÔÏ ÔÁËÁÑ ËÏÍÁÎÄÁ ÅÇÏ
782ÎÁÚÙ×ÁÅÍ ÜÔÏ ËÏÍÁÎÄÏÊ "ÐÅÒÅËÌÀÞÅÎÉÑ ÒÅÖÉÍÁ". 840×ÙËÌÀÞÉÔ, ÅÓÌÉ ×ÙËÌÀÞÅÎ, ÔÏ ×ËÌÀÞÉÔ. íÙ ÎÁÚÙ×ÁÅÍ ÜÔÏ ËÏÍÁÎÄÏÊ "ÐÅÒÅËÌÀÞÅÎÉÑ
841ÒÅÖÉÍÁ".
783 842
784>> îÁÂÅÒÉÔÅ M-x auto fill mode<Return>. úÁÔÅÍ ××ÏÄÉÔÅ ÓÔÒÏËÕ ÉÚ ÓÌÏ× 843>> îÁÂÅÒÉÔÅ M-x auto fill mode<Return>. úÁÔÅÍ ××ÏÄÉÔÅ ÓÔÒÏËÕ ÉÚ ÓÌÏ× "ÆÙ×Á "
785 "ÆÙ×Á " ÐÏËÁ ÎÅ Õ×ÉÄÉÔÅ, ËÁË ÏÎÁ ÒÁÚÄÅÌÉÔÓÑ ÎÁ Ä×Å ÓÔÒÏËÉ. ÷Ù ÄÏÌÖÎÙ 844 ÐÏËÁ ÎÅ Õ×ÉÄÉÔÅ, ËÁË ÏÎÁ ÒÁÚÄÅÌÉÔÓÑ ÎÁ Ä×Å ÓÔÒÏËÉ. ÷Ù ÄÏÌÖÎÙ ÐÏÍÅÝÁÔØ
786 ÐÏÍÅÝÁÔØ ÐÒÏÂÅÌÙ ÍÅÖÄÕ ÓÌÏ×ÁÍÉ, ÐÏÔÏÍÕ ÞÔÏ ÒÅÖÉÍ Á×ÔÏÚÁÐÏÌÎÅÎÉÑ ÒÁÚÄÅÌÑÅÔ 845 ÐÒÏÂÅÌÙ ÍÅÖÄÕ ÓÌÏ×ÁÍÉ, ÐÏÔÏÍÕ ÞÔÏ ÒÅÖÉÍ Á×ÔÏÚÁÐÏÌÎÅÎÉÑ ÒÁÚÂÉ×ÁÅÔ ÓÔÒÏËÉ
787 ÓÔÒÏËÉ ÔÏÌØËÏ ÐÏ ÐÒÏÂÅÌÁÍ. 846 ÔÏÌØËÏ ÐÏ ÐÒÏÂÅÌÁÍ.
788 847
789çÒÁÎÉÃÁ ÏÂÙÞÎÏ ×ÙÓÔÁ×ÌÅÎÁ ÎÁ 70-ÔÉ ÓÉÍ×ÏÌÁÈ, ÎÏ ×Ù ÍÏÖÅÔÅ ÉÚÍÅÎÉÔØ ÅÅ 848çÒÁÎÉÃÁ ÒÁÚÂÉÅÎÉÑ ÏÂÙÞÎÏ ÒÁ×ÎÁ 70-ÔÉ ÓÉÍ×ÏÌÁÍ, ÎÏ ×Ù ÍÏÖÅÔÅ ÉÚÍÅÎÉÔØ ÅÅ
790ÉÓÐÏÌØÚÕÑ ËÏÍÁÎÄÕ C-x f. ÷Ù ÄÏÌÖÎÙ ÚÁÄÁÔØ ÇÒÁÎÉÃÕ × ×ÉÄÅ ÞÉÓÌÏ×ÏÇÏ ÁÒÇÕÍÅÎÔÁ 849ÉÓÐÏÌØÚÕÑ ËÏÍÁÎÄÕ C-x f. ÷Ù ÄÏÌÖÎÙ ÚÁÄÁÔØ ÇÒÁÎÉÃÕ × ×ÉÄÅ ÞÉÓÌÏ×ÏÇÏ
791ÄÌÑ ÜÔÏÊ ËÏÍÁÎÄÙ. 850ÁÒÇÕÍÅÎÔÁ ÄÌÑ ÜÔÏÊ ËÏÍÁÎÄÙ.
792 851
793>> ÷×ÅÄÉÔÅ C-x f Ó ÁÒÇÕÍÅÎÔÏÍ 20. (C-u 2 0 C-x f). úÁÔÅÍ ××ÅÄÉÔÅ 852>> ÷×ÅÄÉÔÅ C-x f Ó ÁÒÇÕÍÅÎÔÏÍ 20 (C-u 2 0 C-x f). úÁÔÅÍ ××ÅÄÉÔÅ ËÁËÏÊ-ÎÉÂÕÄØ
794 ËÁËÏÊ-ÎÉÂÕÄØ ÔÅËÓÔ, É ÐÏÓÍÏÔÒÉÔÅ ËÁË Emacs ÚÁÐÏÌÎÑÅÔ ÓÔÒÏËÉ ÐÏ 20 853 ÔÅËÓÔ, É ÐÏÓÍÏÔÒÉÔÅ ËÁË Emacs ÚÁÐÏÌÎÑÅÔ ÓÔÒÏËÉ ÐÏ 20 ÓÉÍ×ÏÌÏ× × ËÁÖÄÏÊ.
795 ÓÉÍ×ÏÌÏ× × ËÁÖÄÏÊ. ÷ÅÒÎÉÔÅ ÚÎÁÞÅÎÉÅ ÇÒÁÎÉÃÙ 70 ÎÁÚÁÄ, 854 ÷ÅÒÎÉÔÅ ÚÎÁÞÅÎÉÅ ÇÒÁÎÉÃÙ ÒÁ×ÎÏÅ 70 ÎÁÚÁÄ, ÉÓÐÏÌØÚÕÑ ËÏÍÁÎÄÕ C-x f.
796 ÓÎÏ×Á ÉÓÐÏÌØÚÕÑ C-x f.
797 855
798åÓÌÉ ×Ù ÓÄÅÌÁÌÉ ÉÚÍÅÎÅÎÉÑ × ÓÅÒÅÄÉÎÅ ÐÁÒÁÇÒÁÆÁ, Á×ÔÏÚÁÐÏÌÎÅÎÉÅ ÎÅ ÐÅÒÅÓÔÒÏÉÔ 856åÓÌÉ ×Ù ÓÄÅÌÁÌÉ ÉÚÍÅÎÅÎÉÑ × ÓÅÒÅÄÉÎÅ ÐÁÒÁÇÒÁÆÁ, ÔÏ Á×ÔÏÚÁÐÏÌÎÅÎÉÅ ÎÅ
799ÔÅËÓÔ ÄÌÑ ×ÁÓ. þÔÏÂÙ ÐÅÒÅÓÔÒÏÉÔØ ÐÁÒÁÇÒÁÆ, ÎÁÂÅÒÉÔÅ M-q (META-q) × ÔÏ ×ÒÅÍÑ, 857ÐÅÒÅÆÏÒÍÁÔÉÒÕÅÔ ÔÅËÓÔ Á×ÔÏÍÁÔÉÞÅÓËÉ. þÔÏÂÙ ÐÅÒÅÆÏÒÍÁÔÉÒÏ×ÁÔØ ÐÁÒÁÇÒÁÆ,
800ËÏÇÄÁ ËÕÒÓÏÒ ÎÁÈÏÄÉÔÓÑ ×ÎÕÔÒÉ ÐÁÒÁÇÒÁÆÁ. 858ÎÁÂÅÒÉÔÅ M-q (META-q) ËÏÇÄÁ ËÕÒÓÏÒ ÎÁÈÏÄÉÔÓÑ ×ÎÕÔÒÉ ÐÁÒÁÇÒÁÆÁ.
801 859
802>> ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ × ÐÒÅÄÙÄÕÝÉÊ ÐÁÒÁÇÒÁÆ, É ÎÁÖÍÉÔÅ M-q. 860>> ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ × ÐÒÅÄÙÄÕÝÉÊ ÐÁÒÁÇÒÁÆ, É ÎÁÖÍÉÔÅ M-q.
803 861
@@ -805,12 +863,12 @@ Emacs ÉÍÅÅÔ ÍÎÏÇÏ ÒÁÚÌÉÞÎÙÈ ÏÓÎÏ×ÎÙÈ ÒÅÖÉÍÏ×. îÅËÏÔÏÒÙÅ ÉÚ ÒÅÖÉÍÏ× ÏÚÎÁÞÁÀÔ,
805* ðïéóë 863* ðïéóë
806------- 864-------
807 865
808Emacs ÕÍÅÅÔ ÉÓËÁÔØ ÓÔÒÏËÉ (ÎÅÐÒÅÒÙ×ÎÙÅ ÇÒÕÐÐÙ ÓÉÍ×ÏÌÏ× ÉÌÉ ÓÌÏ×Á) ×ÐÅÒÅÄ 866Emacs ÕÍÅÅÔ ÉÓËÁÔØ ÓÔÒÏËÉ (ÎÅÐÒÅÒÙ×ÎÙÅ ÇÒÕÐÐÙ ÓÉÍ×ÏÌÏ× ÉÌÉ ÓÌÏ×Á) ×ÐÅÒÅÄ ÉÌÉ
809ÐÏ ÔÅËÓÔÕ, ÉÌÉ ÎÁÚÁÄ. ðÏÉÓË ÓÔÒÏËÉ - ÜÔÏ ËÏÍÁÎÄÁ ÐÅÒÅÍÅÝÅÎÉÑ ËÕÒÓÏÒÁ; ÏÎÁ 867ÎÁÚÁÄ ÐÏ ÔÅËÓÔÕ. ðÏÉÓË ÓÔÒÏËÉ -- ÜÔÏ ËÏÍÁÎÄÁ ÐÅÒÅÍÅÝÅÎÉÑ ËÕÒÓÏÒÁ; ÏÎÁ
810ÐÅÒÅÍÅÝÁÅÔ ËÕÒÓÏÒ × ÓÌÅÄÕÀÝÕÀ ÔÏÞËÕ, ÇÄÅ ÎÁÊÄÅÎÁ ÉÓËÏÍÁÑ ÓÔÒÏËÁ. 868ÐÅÒÅÍÅÝÁÅÔ ËÕÒÓÏÒ × ÓÌÅÄÕÀÝÕÀ ÔÏÞËÕ, ÇÄÅ ÎÁÊÄÅÎÁ ÉÓËÏÍÁÑ ÓÔÒÏËÁ.
811 869
812ëÏÍÁÎÄÁ ÐÏÉÓËÁ Emacs ÏÔÌÉÞÁÀÔÓÑ ÏÔ ÁÎÁÌÏÇÉÞÎÙÈ ËÏÍÁÎÄ ÂÏÌØÛÉÎÓÔ×Á ÄÒÕÇÉÈ 870ëÏÍÁÎÄÁ ÐÏÉÓËÁ Emacs ÏÔÌÉÞÁÅÔÓÑ ÏÔ ÁÎÁÌÏÇÉÞÎÙÈ ËÏÍÁÎÄ ÂÏÌØÛÉÎÓÔ×Á ÄÒÕÇÉÈ
813ÒÅÄÁËÔÏÒÏ× ÔÅÍ, ÞÔÏ ÏÎÁ ÉÎËÒÅÍÅÎÔÁÌØÎÁÑ. üÔÏ ÏÚÎÁÞÁÅÔ, ÞÔÏ ÐÏÉÓË ÐÒÏÉÓÈÏÄÉÔ 871ÒÅÄÁËÔÏÒÏ× ÔÅÍ, ÞÔÏ ÏÎÁ ÉÎËÒÅÍÅÎÔÁÌØÎÁÑ. üÔÏ ÏÚÎÁÞÁÅÔ, ÞÔÏ ÐÏÉÓË ÐÒÏÉÓÈÏÄÉÔ
814ÐÏ ÍÅÒÅ, ÔÏÇÏ ËÁË ×Ù ÎÁÂÉÒÁÅÔÅ ÉÓËÏÍÕÀ ÓÔÒÏËÕ. 872ÐÏ ÍÅÒÅ, ÔÏÇÏ ËÁË ×Ù ÎÁÂÉÒÁÅÔÅ ÉÓËÏÍÕÀ ÓÔÒÏËÕ.
815 873
816ëÏÍÁÎÄÁ, ÎÁÞÉÎÁÀÝÁÑ ÐÏÉÓË ×ÐÅÒÅÄ -- C-s, Á C-r ÉÝÅÔ ÎÁÚÁÄ. ðïäïöäéôå! îÅ 874ëÏÍÁÎÄÁ, ÎÁÞÉÎÁÀÝÁÑ ÐÏÉÓË ×ÐÅÒÅÄ -- C-s, Á C-r ÉÝÅÔ ÎÁÚÁÄ. ðïäïöäéôå! îÅ
@@ -820,240 +878,261 @@ Emacs ÕÍÅÅÔ ÉÓËÁÔØ ÓÔÒÏËÉ (ÎÅÐÒÅÒÙ×ÎÙÅ ÇÒÕÐÐÙ ÓÉÍ×ÏÌÏ× ÉÌÉ ÓÌÏ×Á) ×ÐÅÒÅÄ
820÷ÁÍ ÓÏÏÂÝÁÅÔÓÑ, ÞÔÏ Emacs ÖÄÅÔ ××ÏÄÁ ÓÌÏ×Á, ËÏÔÏÒÏÅ ×Ù ÈÏÔÉÔÅ ÎÁÊÔÉ. 878÷ÁÍ ÓÏÏÂÝÁÅÔÓÑ, ÞÔÏ Emacs ÖÄÅÔ ××ÏÄÁ ÓÌÏ×Á, ËÏÔÏÒÏÅ ×Ù ÈÏÔÉÔÅ ÎÁÊÔÉ.
821<Return> ÚÁ×ÅÒÛÁÅÔ ÐÏÉÓË. 879<Return> ÚÁ×ÅÒÛÁÅÔ ÐÏÉÓË.
822 880
823>> ôÅÐÅÒØ ÎÁÖÍÉÔÅ C-s ÄÌÑ ÎÁÞÁÌÁ ÐÏÉÓËÁ. íÅÄÌÅÎÎÏ, ÏÄÎÕ ÂÕË×Õ ÚÁ ÏÄÉÎ ÒÁÚ, 881>> ôÅÐÅÒØ ÎÁÖÍÉÔÅ C-s ÄÌÑ ÎÁÞÁÌÁ ÐÏÉÓËÁ. íÅÄÌÅÎÎÏ, ÐÏ ÏÄÎÏÊ ÂÕË×Å, ÎÁÂÉÒÁÊÔÅ
824 ÎÁÂÉÒÁÊÔÅ ÓÌÏ×Ï 'ËÕÒÓÏÒ', ÏÓÔÁÎÁ×ÌÉ×ÁÑÓØ ÐÏÓÌÅ ËÁÖÄÏÊ ××ÅÄÅÎÎÏÊ ÂÕË×Ù É 882 ÓÌÏ×Ï 'ËÕÒÓÏÒ', ÏÓÔÁÎÁ×ÌÉ×ÁÑÓØ ÐÏÓÌÅ ËÁÖÄÏÊ ××ÅÄÅÎÎÏÊ ÂÕË×Ù É ÚÁÍÅÞÁÑ ÞÔÏ
825 ÚÁÍÅÞÁÑ ÞÔÏ ÐÒÏÉÓÈÏÄÉÔ Ó ËÕÒÓÏÒÏÍ. 883 ÐÒÏÉÓÈÏÄÉÔ Ó ËÕÒÓÏÒÏÍ.
826 óÅÊÞÁÓ ×Ù ÎÁÛÌÉ ÐÅÒ×ÏÅ ×ÈÏÖÄÅÎÉÅ ÓÌÏ×Á "ËÕÒÓÏÒ". 884 óÅÊÞÁÓ ×Ù ÎÁÛÌÉ ÐÅÒ×ÏÅ ×ÈÏÖÄÅÎÉÅ ÓÌÏ×Á "ËÕÒÓÏÒ".
827>> îÁÖÍÉÔÅ C-s ÓÎÏ×Á, ÞÔÏÂÙ ÎÁÊÔÉ ÓÌÅÄÕÀÝÅÅ ×ÈÏÖÄÅÎÉÅ ÓÌÏ×Á "ËÕÒÓÏÒ". 885>> îÁÖÍÉÔÅ C-s ÓÎÏ×Á, ÞÔÏÂÙ ÎÁÊÔÉ ÓÌÅÄÕÀÝÅÅ ×ÈÏÖÄÅÎÉÅ ÓÌÏ×Á "ËÕÒÓÏÒ".
828>> ôÅÐÅÒØ ÎÁÖÍÉÔÅ <Delete> ÞÅÔÙÒÅ ÒÁÚÁ É ÐÒÏÓÌÅÄÉÔÅ ÚÁ ÐÅÒÅÍÅÝÅÎÉÑÍÉ ËÕÒÓÏÒÁ. 886>> ôÅÐÅÒØ ÎÁÖÍÉÔÅ <Delback> ÞÅÔÙÒÅ ÒÁÚÁ É ÐÒÏÓÌÅÄÉÔÅ ÚÁ ÐÅÒÅÍÅÝÅÎÉÑÍÉ ËÕÒÓÏÒÁ.
829>> îÁÖÍÉÔÅ <Return> ÄÌÑ ÚÁ×ÅÒÛÅÎÉÑ ÐÏÉÓËÁ. 887>> îÁÖÍÉÔÅ <Return> ÄÌÑ ÚÁ×ÅÒÛÅÎÉÑ ÐÏÉÓËÁ.
830 888
831÷Ù ×ÉÄÅÌÉ, ÞÔÏ ÐÒÏÉÓÈÏÄÉÌÏ? Emacs × ÒÅÖÉÍÅ ÉÎËÒÅÍÅÎÔÁÌØÎÏÇÏ ÐÏÉÓËÁ ÐÙÔÁÌÓÑ 889÷Ù ÚÁÍÅÔÉÌÉ, ÞÔÏ ÐÒÏÉÓÈÏÄÉÌÏ? Emacs × ÒÅÖÉÍÅ ÉÎËÒÅÍÅÎÔÁÌØÎÏÇÏ ÐÏÉÓËÁ ÐÙÔÁÌÓÑ
832ÐÅÒÅÈÏÄÉÔØ Ë ÓÔÒÏËÁÍ, ÓÏ×ÐÁÄÁÀÝÉÍ Ó ÎÁÂÉÒÁÅÍÏÊ ×ÁÍÉ, ÐÏÄÓ×ÅÞÉ×ÁÑ ÉÈ ÄÌÑ ×ÁÓ. 890ÐÅÒÅÈÏÄÉÔØ Ë ÓÔÒÏËÁÍ, ÓÏ×ÐÁÄÁÀÝÉÍ Ó ÎÁÂÉÒÁÅÍÏÊ ×ÁÍÉ ÓÔÒÏËÏÊ, ÐÏÄÓ×ÅÞÉ×ÁÑ ÉÈ.
833þÔÏÂÙ ÐÅÒÅÊÔÉ Ë ÓÌÅÄÕÀÝÅÍÕ ×ÈÏÖÄÅÎÉÑ ÓÌÏ×Á 'ËÕÒÓÏÒ' ÐÒÏÓÔÏ ÎÁÖÍÉÔÅ C-s 891þÔÏÂÙ ÐÅÒÅÊÔÉ Ë ÓÌÅÄÕÀÝÅÍÕ ×ÈÏÖÄÅÎÉÑ ÓÌÏ×Á 'ËÕÒÓÏÒ' ÐÒÏÓÔÏ ÎÁÖÍÉÔÅ C-s
834ÓÎÏ×Á. åÓÌÉ ÂÏÌØÛÅ ÎÅÔ ×ÈÏÖÄÅÎÉÊ, Emacs ÉÚÄÁÓÔ Ú×ÕËÏ×ÏÊ ÓÉÇÎÁÌ, É ÓÏÏÂÝÉÔ, 892ÓÎÏ×Á. åÓÌÉ ÂÏÌØÛÅ ÎÅÔ ×ÈÏÖÄÅÎÉÊ, ÔÏ Emacs ÉÚÄÁÓÔ Ú×ÕËÏ×ÏÊ ÓÉÇÎÁÌ, É
835ÞÔÏ ×ÁÛ ÐÏÉÓË ÎÅ ÕÄÁÌÓÑ ("failing"), C-g ÔÁËÖÅ ÍÏÖÅÔ ÏÔÍÅÎÉÔØ ÐÏÉÓË. 893ÓÏÏÂÝÉÔ, ÞÔÏ ×ÁÛ ÐÏÉÓË ÎÅ ÕÄÁÌÓÑ ("failing"), C-g ÔÁËÖÅ ÍÏÖÅÔ ÏÔÍÅÎÉÔØ
836 894ÐÏÉÓË.
837úáíåþáîéå: îÁ ÎÅËÏÔÏÒÙÈ ÓÉÓÔÅÍÁÈ ××ÏÄ C-s ÚÁÍÏÒÏÚÉÔ ÜËÒÁÎ, É ×Ù ÎÅ Õ×ÉÄÉÔÅ 895
838ÐÏÓÌÅÄÕÀÝÅÇÏ ×Ù×ÏÄÁ Emacs`Á. üÔÏ ÏÚÎÁÞÁÅÔ, ÞÔÏ ÏÐÅÒÁÃÉÏÎÎÁÑ ÓÉÓÔÅÍÁ ÉÍÅÅÔ 896úáíåþáîéå: îÁ ÎÅËÏÔÏÒÙÈ ÓÉÓÔÅÍÁÈ, ××ÏÄ C-x C-s ÚÁÂÌÏËÉÒÕÅÔ ÜËÒÁÎ, ÔÁË ÞÔÏ ×Ù
839"ÏÓÏÂÅÎÎÏÓÔØ", ÉÍÅÎÕÅÍÕÀ "flow control", ÐÅÒÅÈ×ÁÔÙ×ÁÀÝÕÀ C-s É ÎÅ ÐÒÏÐÕÓËÁÀÝÕÀ 897ÎÅ Õ×ÉÄÉÔÅ ÐÏÓÌÅÄÕÀÝÅÇÏ ×Ù×ÏÄÁ Emacs`Á. ôÁËÏÅ ÐÏ×ÅÄÅÎÉÅ ÏÚÎÁÞÁÅÔ, ÞÔÏ
840ÜÔÏÔ ÓÉÍ×ÏÌ Ë Emacs`Õ. äÌÑ ÒÁÚÍÏÒÏÚËÉ ÜËÒÁÎÁ, ÎÁÖÍÉÔÅ C-q. óÍÏÔÒÉÔÅ ÒÁÚÄÅÌ 898ÏÐÅÒÁÃÉÏÎÎÁÑ ÓÉÓÔÅÍÁ ÉÍÅÅÔ "ÏÓÏÂÅÎÎÏÓÔØ", ÉÍÅÎÕÅÍÕÀ "flow control",
841"Spontaneous Entry to Incremental Search" ÒÕËÏ×ÏÄÓÔ×Á Emacs, ÞÔÏÂÙ ÕÚÎÁÔØ, 899ÐÅÒÅÈ×ÁÔÙ×ÁÀÝÕÀ ÓÏÞÅÔÁÎÉÅ C-s É ÎÅ ÐÒÏÐÕÓËÁÀÝÕÀ ÜÔÏÔ ÓÉÍ×ÏÌ Ë Emacs`Õ. äÌÑ
842ËÁË ÂÏÒÏÔØÓÑ Ó ÜÔÏÊ "ÏÓÏÂÅÎÎÏÓÔØÀ". 900ÓÎÑÔÉÑ ÂÌÏËÉÒÏ×ËÉ ÜËÒÁÎÁ, ÎÁÖÍÉÔÅ C-q. ïÂÒÁÔÉÔÅÓØ Ë ÒÁÚÄÅÌÕ "Spontaneous
843 901Entry to Incremental Search" ÒÕËÏ×ÏÄÓÔ×Á Emacs, ÞÔÏÂÙ ÕÚÎÁÔØ Ï ÔÏÍ, ËÁË
844åÓÌÉ ×Ù ×Ï ×ÒÅÍÑ ÉÎËÒÅÍÅÎÔÁÌØÎÏÇÏ ÐÏÉÓËÁ ÎÁÖÍÅÔÅ <Delete>, ×Ù ÍÏÖÅÔÅ ÚÁÍÅÔÉÔØ, 902ÂÏÒÏÔØÓÑ Ó ÜÔÏÊ "ÏÓÏÂÅÎÎÏÓÔØÀ".
845ÞÔÏ ÐÏÓÌÅÄÎÉÊ ÓÉÍ×ÏÌ × ÉÓËÏÍÏÊ ÓÔÒÏËÅ ÕÄÁÌÉÌÓÑ, É ÐÏÉÓË ×ÅÒÎÕÌÓÑ Ë ÐÒÅÄÙÄÕÝÅÍÕ 903
846ÎÁÊÄÅÎÎÏÍÕ ÍÅÓÔÕ. îÁÐÒÉÍÅÒ, ÐÒÅÄÐÏÌÏÖÉÍ, ÞÔÏ ×Ù ÎÁÂÒÁÌÉ "Ë", ÐÏÉÓË ÐÅÒÅÊÄÅÔ Ë 904åÓÌÉ ×Ù ×Ï ×ÒÅÍÑ ÉÎËÒÅÍÅÎÔÁÌØÎÏÇÏ ÐÏÉÓËÁ ÎÁÖÍÅÔÅ <Delback>, ÔÏ ×Ù ÚÁÍÅÔÉÔÅ,
847ÐÅÒ×ÏÍÕ ×ÈÏÖÄÅÎÉÀ ÓÉÍ×ÏÌÁ "Ë". ôÅÐÅÒØ, ÅÓÌÉ ×Ù ÎÁÂÅÒÅÔÅ "Õ", ËÕÒÓÏÒ ÐÅÒÅÊÄÅÔ Ë 905ÞÔÏ ÐÏÓÌÅÄÎÉÊ ÓÉÍ×ÏÌ × ÉÓËÏÍÏÊ ÓÔÒÏËÅ ÕÄÁÌÉÌÓÑ, É ÐÏÉÓË ×ÅÒÎÕÌÓÑ Ë
848ÐÅÒ×ÏÍÕ ×ÈÏÖÄÅÎÉÀ "ËÕ". îÁÖÁÔÉÅ <Delete> ÕÄÁÌÉÔ ÓÉÍ×ÏÌ "Õ" ÉÚ ÓÔÒÏËÉ ÐÏÉÓËÁ, É 906ÐÒÅÄÙÄÕÝÅÍÕ ÎÁÊÄÅÎÎÏÍÕ ÍÅÓÔÕ. îÁÐÒÉÍÅÒ, ÐÒÅÄÐÏÌÏÖÉÍ, ÞÔÏ ×Ù ÎÁÂÒÁÌÉ "Ë",
849ËÕÒÓÏÒ ×ÅÒÎÅÔÓÑ Ë ÐÅÒ×ÏÍÕ ×ÈÏÖÄÅÎÉÀ "Ë". 907ÐÏÉÓË ÐÅÒÅÊÄÅÔ Ë ÐÅÒ×ÏÍÕ ×ÈÏÖÄÅÎÉÀ ÓÉÍ×ÏÌÁ "Ë". ôÅÐÅÒØ, ÅÓÌÉ ×Ù ÎÁÂÅÒÅÔÅ
908"Õ", ËÕÒÓÏÒ ÐÅÒÅÊÄÅÔ Ë ÐÅÒ×ÏÍÕ ×ÈÏÖÄÅÎÉÀ "ËÕ". îÁÖÁÔÉÅ <Delback> ÕÄÁÌÉÔ
909ÓÉÍ×ÏÌ "Õ" ÉÚ ÓÔÒÏËÉ ÐÏÉÓËÁ, É ËÕÒÓÏÒ ×ÅÒÎÅÔÓÑ Ë ÐÅÒ×ÏÍÕ ×ÈÏÖÄÅÎÉÀ "Ë".
850 910
851åÓÌÉ ×Ù ×Ï ×ÒÅÍÑ ÐÏÉÓËÁ ××ÅÄÅÔÅ control- ÉÌÉ meta- ÓÉÍ×ÏÌ (ÚÁ ÎÅËÏÔÏÒÙÍÉ 911åÓÌÉ ×Ù ×Ï ×ÒÅÍÑ ÐÏÉÓËÁ ××ÅÄÅÔÅ control- ÉÌÉ meta- ÓÉÍ×ÏÌ (ÚÁ ÎÅËÏÔÏÒÙÍÉ
852ÉÓËÌÀÞÅÎÉÑÍÉ -- ÓÉÍ×ÏÌÙ ×ÙÚÙ×ÁÀÝÉÅ ÐÏÉÓË, Á ÉÍÅÎÎÏ C-s É C-r), ÐÏÉÓË 912ÉÓËÌÀÞÅÎÉÑÍÉ, ÔÁËÉÍÉ, ËÁË ÓÉÍ×ÏÌÙ ÎÁÞÉÎÁÀÝÉÅ ÐÏÉÓË, Á ÉÍÅÎÎÏ C-s É C-r),
853ÐÒÅËÒÁÔÉÔÓÑ. 913ÐÏÉÓË ÐÒÅËÒÁÔÉÔÓÑ.
854 914
855C-s ÎÁÞÉÎÁÅÔ ÐÏÉÓË É ÓÍÏÔÒÉÔ ÎÁ ÌÀÂÙÅ ×ÈÏÖÄÅÎÉÑ ÉÓËÏÍÏÊ ÓÔÒÏËÉ ðïóìå ÔÅËÕÝÅÊ 915C-s ÎÁÞÉÎÁÅÔ ÐÏÉÓË É ÉÝÅÔ ÌÀÂÙÅ ×ÈÏÖÄÅÎÉÑ ÉÓËÏÍÏÊ ÓÔÒÏËÉ ðïóìå ÔÅËÕÝÅÊ
856ÐÏÚÉÃÉÉ ËÕÒÓÏÒÁ. åÓÌÉ ×Ù ÈÏÔÉÔÅ ÎÁÊÔÉ ÞÔÏ-ÔÏ ÒÁÎÅÅ × ÔÅËÓÔÅ, ÎÁÖÍÉÔÅ C-r. 916ÐÏÚÉÃÉÉ ËÕÒÓÏÒÁ. åÓÌÉ ×Ù ÈÏÔÉÔÅ ÎÁÊÔÉ ÞÔÏ-ÔÏ ÒÁÎÅÅ × ÔÅËÓÔÅ, ÔÏ ÎÁÖÍÉÔÅ
857÷ÓÅ, ÞÔÏ ÍÙ ÇÏ×ÏÒÉÌÉ Ï C-s, ÐÒÉÍÅÎÉÍÏ É Ë C-r, ÚÁ ÉÓËÌÀÞÅÎÉÅÍ ÐÒÏÔÉ×ÏÐÏÌÏÖÎÏÇÏ 917C-r. ÷ÓÅ, ÞÔÏ ÍÙ ÇÏ×ÏÒÉÌÉ Ï C-s, ÐÒÉÍÅÎÉÍÏ É Ë C-r, ÚÁ ÉÓËÌÀÞÅÎÉÅÍ
858ÎÁÐÒÁ×ÌÅÎÉÑ ÐÏÉÓËÁ. 918ÐÒÏÔÉ×ÏÐÏÌÏÖÎÏÇÏ ÎÁÐÒÁ×ÌÅÎÉÑ ÐÏÉÓËÁ.
859 919
860 920
861* íîïöåóô÷ï ïëïî (MULTIPLE WINDOWS) 921* íîïöåóô÷ï ïëïî (MULTIPLE WINDOWS)
862----------------------------------- 922-----------------------------------
863 923
864ïÄÎÁ ÉÚ ÐÒÉÑÔÎÙÈ ÏÓÏÂÅÎÎÏÓÔÅÊ Emacs ÜÔÏ ÔÏ, ÞÔÏ ×Ù ÍÏÖÅÔÅ ÏÄÎÏ×ÒÅÍÅÎÎÏ 924ïÄÎÁ ÉÚ ÐÒÉÑÔÎÙÈ ÏÓÏÂÅÎÎÏÓÔÅÊ Emacs Ñ×ÌÑÅÔÓÑ ÔÏ, ÞÔÏ ×Ù ÍÏÖÅÔÅ ÏÄÎÏ×ÒÅÍÅÎÎÏ
865ÏÔÏÂÒÁÖÁÔØ ÎÁ ÜËÒÁÎÅ ÂÏÌÅÅ ÞÅÍ ÏÄÎÏ ÏËÎÏ. 925ÏÔÏÂÒÁÖÁÔØ ÎÁ ÜËÒÁÎÅ ÎÅÓËÏÌØËÏ ÏËÏÎ.
866 926
867>> ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ÎÁ ÜÔÕ ÌÉÎÉÀ, É ÎÁÂÅÒÉÔÅ C-u 0 C-l (ÜÔÏ CONTROL-L, Á 927>> ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ÎÁ ÜÔÕ ÓÔÒÏËÕ, É ÎÁÂÅÒÉÔÅ C-u 0 C-l (ÜÔÏ CONTROL-L, Á
868 ÎÅ CONTROL-1). 928 ÎÅ CONTROL-1).
869 929
870>> ôÅÐÅÒØ ÎÁÂÅÒÉÔÅ C-x 2, ÞÔÏ ÒÁÚÄÅÌÉÔ ÜËÒÁÎ ÎÁ Ä×Á ÏËÎÁ. 930>> ôÅÐÅÒØ ÎÁÂÅÒÉÔÅ C-x 2, ÞÔÏ ÒÁÚÄÅÌÉÔ ÜËÒÁÎ ÎÁ Ä×Á ÏËÎÁ.
871 ïÂÁ ÏËÎÁ ÏÔÏÂÒÁÖÁÀÔ ÕÞÅÂÎÉË. ëÕÒÓÏÒ ÏÓÔÁÌÓÑ × ×ÅÒÈÎÅÍ ÏËÎÅ. 931 ïÂÁ ÏËÎÁ ÏÔÏÂÒÁÖÁÀÔ ÕÞÅÂÎÉË. ëÕÒÓÏÒ ÏÓÔÁÌÓÑ × ×ÅÒÈÎÅÍ ÏËÎÅ.
872 932
873>> îÁÖÍÉÔÅ C-M-v ÄÌÑ ÐÒÏËÒÕÔËÉ ÎÉÖÎÅÇÏ ÏËÎÁ. 933>> îÁÖÍÉÔÅ C-M-v ÄÌÑ ÐÒÏËÒÕÔËÉ ÎÉÖÎÅÇÏ ÏËÎÁ.
874 (ÅÓÌÉ Õ ×ÁÓ ÎÅÔ ÎÁÓÔÏÑÝÅÊ ËÎÏÐËÉ META (Alt), ÎÁÖÍÉÔÅ ESC C-v.) 934 (ÅÓÌÉ Õ ×ÁÓ ÎÅÔ ÎÁÓÔÏÑÝÅÊ ËÎÏÐËÉ META (Alt), ÔÏ ÎÁÖÍÉÔÅ <ESC> C-v.)
875 935
876>> îÁÖÍÉÔÅ C-x o ("o" ÏÔ ÓÌÏ×Á "other" - ÄÒÕÇÏÅ) ÄÌÑ ÐÅÒÅÍÅÝÅÎÉÑ ËÕÒÓÏÒÁ × 936>> îÁÖÍÉÔÅ C-x o ("o" ÏÔ ÓÌÏ×Á "other" -- ÄÒÕÇÏÅ) ÄÌÑ ÐÅÒÅÍÅÝÅÎÉÑ ËÕÒÓÏÒÁ ×
877 ÎÉÖÎÅÅ ÏËÎÏ. 937 ÎÉÖÎÅÅ ÏËÎÏ.
878>> éÓÐÏÌØÚÕÊÔÅ C-v É M-v × ÎÉÖÎÅÍ ÏËÎÅ, ÞÔÏÂÙ ÐÒÏËÒÕÞÉ×ÁÔØ ÅÇÏ. 938>> éÓÐÏÌØÚÕÊÔÅ C-v É M-v × ÎÉÖÎÅÍ ÏËÎÅ, ÄÌÑ ÐÒÏËÒÕÔËÉ ÔÅËÓÔÁ.
879 ðÒÏÄÏÌÖÉÔÅ ÞÔÅÎÉÅ ÜÔÉÈ ÉÎÓÔÒÕËÃÉÊ × ×ÅÒÈÎÅÍ ÏËÎÅ. 939 ðÒÏÄÏÌÖÉÔÅ ÞÔÅÎÉÅ ÜÔÉÈ ÉÎÓÔÒÕËÃÉÊ × ×ÅÒÈÎÅÍ ÏËÎÅ.
880 940
881>> îÁÖÍÉÔÅ C-x o ÓÎÏ×Á, ÞÔÏÂÙ ÐÅÒÅÍÅÓÔÉÔØ ËÕÒÓÏÒ ÎÁÚÁÄ × ×ÅÒÈÎÅÅ ÏËÎÏ. 941>> îÁÖÍÉÔÅ C-x o ÓÎÏ×Á, ÞÔÏÂÙ ÐÅÒÅÍÅÓÔÉÔØ ËÕÒÓÏÒ ÎÁÚÁÄ × ×ÅÒÈÎÅÅ ÏËÎÏ.
882 ëÕÒÓÏÒ × ×ÅÒÈÎÅÍ ÏËÎÅ ÔÁÍ ÖÅ, ÇÄÅ É ÂÙÌ ÄÏ ÔÏÇÏ. 942 ëÕÒÓÏÒ × ×ÅÒÈÎÅÍ ÏËÎÅ ÔÁÍ ÖÅ, ÇÄÅ É ÂÙÌ ÄÏ ÔÏÇÏ.
883 943
884÷Ù ÍÏÖÅÔÅ ÐÒÏÄÏÌÖÁÔØ ÐÅÒÅËÌÀÞÁÔØÓÑ ÍÅÖÄÕ ÏËÎÁÍÉ, ÉÓÐÏÌØÚÕÑ C-x o. ëÁÖÄÏÅ 944÷Ù ÍÏÖÅÔÅ ÐÒÏÄÏÌÖÁÔØ ÐÅÒÅËÌÀÞÁÔØÓÑ ÍÅÖÄÕ ÏËÎÁÍÉ, ÉÓÐÏÌØÚÕÑ C-x o. ëÁÖÄÏÅ
885ÏËÎÏ ÈÒÁÎÉÔ Ó×ÏÀ ÐÏÚÉÃÉÀ ËÕÒÓÏÒÁ, ÎÏ ÔÏÌØËÏ ÏÄÎÏ ÐÏËÁÚÙ×ÁÅÔ ËÕÒÓÏÒ. ÷ÓÅ 945ÏËÎÏ ÈÒÁÎÉÔ Ó×ÏÀ ÐÏÚÉÃÉÀ ËÕÒÓÏÒÁ, ÎÏ ÔÏÌØËÏ ÏÄÎÏ ÐÏËÁÚÙ×ÁÅÔ ËÕÒÓÏÒ. ÷ÓÅ
886ÏÂÙÞÎÙÅ ËÏÍÁÎÄÙ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ ÐÒÉÍÅÎÑÀÔÓÑ Ë ÏËÎÕ, × ËÏÔÏÒÏÍ ÏÔÏÂÒÁÖÁÅÔÓÑ 946ÏÂÙÞÎÙÅ ËÏÍÁÎÄÙ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ ÐÒÉÍÅÎÑÀÔÓÑ Ë ÏËÎÕ, × ËÏÔÏÒÏÍ ÏÔÏÂÒÁÖÁÅÔÓÑ
887ËÕÒÓÏÒ. íÙ ÎÁÚÙ×ÁÅÍ ÜÔÏ ÏËÎÏ "×ÙÂÒÁÎÎÙÍ" ("selected window"). 947ËÕÒÓÏÒ. íÙ ÎÁÚÙ×ÁÅÍ ÜÔÏ ÏËÎÏ "×ÙÂÒÁÎÎÙÍ" ("selected window").
888 948
889ëÏÍÁÎÄÁ C-M-v ÏÞÅÎØ ÕÄÏÂÎÁ, ËÏÇÄÁ ×Ù ÒÅÄÁËÔÉÒÕÅÔÅ ÔÅËÓÔ × ÏÄÎÏÍ ÏËÎÅ, É 949ëÏÍÁÎÄÁ C-M-v ÏÞÅÎØ ÕÄÏÂÎÁ, ËÏÇÄÁ ×Ù ÒÅÄÁËÔÉÒÕÅÔÅ ÔÅËÓÔ × ÏÄÎÏÍ ÏËÎÅ, Á
890ÉÓÐÏÌØÚÕÅÔÅ ×ÔÏÒÏÅ × ËÁÞÅÓÔ×Å ÓÐÒÁ×ÏÞÎÉËÁ. ÷Ù ÍÏÖÅÔÅ ×ÓÅÇÄÁ ÓÏÈÒÁÎÑÔØ ËÕÒÓÏÒ 950×ÔÏÒÏÅ ÉÓÐÏÌØÚÕÅÔÅ × ËÁÞÅÓÔ×Å ÓÐÒÁ×ÏÞÎÉËÁ. ÷Ù ÍÏÖÅÔÅ ×ÓÅÇÄÁ ÓÏÈÒÁÎÑÔØ
891× ÏËÎÅ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ É ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏ ÐÒÏÄ×ÉÇÁÔØÓÑ ×Ï ×ÔÏÒÏÍ, ÉÓÐÏÌØÚÕÑ 951ËÕÒÓÏÒ × ÏËÎÅ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ É ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏ ÐÒÏÄ×ÉÇÁÔØÓÑ ×Ï ×ÔÏÒÏÍ,
892C-M-v. 952ÉÓÐÏÌØÚÕÑ C-M-v.
893 953
894C-M-v - ÐÒÉÍÅÒ CONTROL-META ÓÉÍ×ÏÌÁ. åÓÌÉ Õ ×ÁÓ ÅÓÔØ ÎÁÓÔÏÑÝÁÑ ËÎÏÐËÁ META 954C-M-v -- ÐÒÉÍÅÒ CONTROL-META ÓÉÍ×ÏÌÁ. åÓÌÉ Õ ×ÁÓ ÅÓÔØ ÎÁÓÔÏÑÝÁÑ ËÎÏÐËÁ META
895(Alt), ÔÏ ×Ù ÍÏÖÅÔÅ ÎÁÂÒÁÔØ C-M-v, ÎÁÖÁ× ÏÄÎÏ×ÒÅÍÅÎÎÏ CONTROL É META É, 955(Alt), ÔÏ ×Ù ÍÏÖÅÔÅ ÎÁÂÒÁÔØ C-M-v, ÎÁÖÁ× ÏÄÎÏ×ÒÅÍÅÎÎÏ CONTROL É META É, ÎÅ
896ÎÅ ÏÔÐÕÓËÁÑ ÉÈ, ÎÁÖÁÔØ v. é ÎÅ ×ÁÖÎÏ, ËÁËÁÑ ÉÚ ËÌÁ×ÉÛ ÂÕÄÅÔ ÎÁÖÁÔÁ ÐÅÒ×ÏÊ, 956ÏÔÐÕÓËÁÑ ÉÈ, ÎÁÖÁÔØ v. é ÎÅ ×ÁÖÎÏ, ËÁËÁÑ ÉÚ ËÌÁ×ÉÛ ÂÕÄÅÔ ÎÁÖÁÔÁ ÐÅÒ×ÏÊ,
897CONTROL ÉÌÉ META, ÐÏÓËÏÌØËÕ ÜÔÉ ËÎÏÐËÉ ÍÏÄÉÆÉÃÉÒÕÀÔ ÔÉÐ ÓÉÍ×ÏÌÁ. 957CONTROL ÉÌÉ META, ÐÏÓËÏÌØËÕ ÜÔÉ ËÎÏÐËÉ ÍÏÄÉÆÉÃÉÒÕÀÔ ÔÉÐ ÓÉÍ×ÏÌÁ.
898 958
899åÓÌÉ Õ ×ÁÓ ÎÅÔ ÎÁÓÔÏÑÝÅÊ ËÎÏÐËÉ META, É ×Ù ÉÓÐÏÌØÚÕÅÔÅ ESC ×ÍÅÓÔÏ ÎÅÅ, 959åÓÌÉ Õ ×ÁÓ ÎÅÔ ÎÁÓÔÏÑÝÅÊ ËÎÏÐËÉ META, É ×ÍÅÓÔÏ ÎÅÅ ×Ù ÉÓÐÏÌØÚÕÅÔÅ <ESC>, ÔÏ
900ÐÏÒÑÄÏË ÄÏÌÖÅÎ ÂÙÔØ ÓÌÅÄÕÀÝÉÍ: ×Ù ÄÏÌÖÎÙ ÎÁÖÁÔØ ESC, Á ÚÁÔÅÍ CTRL-v; 960ÐÏÒÑÄÏË ÄÏÌÖÅÎ ÂÙÔØ ÓÌÅÄÕÀÝÉÍ: ×Ù ÄÏÌÖÎÙ ÎÁÖÁÔØ <ESC>, Á ÚÁÔÅÍ CTRL-v;
901CONTROL-ESC v ÎÅ ÂÕÄÅÔ ÒÁÂÏÔÁÔØ. ðÏÔÏÍÕ, ÞÔÏ ESC ÉÍÅÅÔ Ó×ÏÊ ÓÏÂÓÔ×ÅÎÎÙÊ 961CONTROL-<ESC> v ÎÅ ÂÕÄÅÔ ÒÁÂÏÔÁÔØ. üÔÏ ÐÒÏÉÓÈÏÄÉÔ ÐÏÔÏÍÕ, ÞÔÏ <ESC> ÉÍÅÅÔ
902ÓÉÍ×ÏÌ -- ÜÔÏ ÎÅ ÍÏÄÉÆÉÃÉÒÕÀÝÁÑ ËÎÏÐËÁ. 962Ó×ÏÊ ÓÏÂÓÔ×ÅÎÎÙÊ ÓÉÍ×ÏÌ -- ÜÔÏ ÎÅ ÍÏÄÉÆÉÃÉÒÕÀÝÁÑ ËÎÏÐËÁ.
903 963
904>> îÁÖÍÉÔÅ C-x 1 (× ×ÅÒÈÎÅÍ ÏËÎÅ), ÞÔÏÂÙ ÉÚÂÁ×ÉÔØÓÑ ÏÔ ÎÉÖÎÅÇÏ. 964>> îÁÖÍÉÔÅ C-x 1 (× ×ÅÒÈÎÅÍ ÏËÎÅ), ÞÔÏÂÙ ÉÚÂÁ×ÉÔØÓÑ ÏÔ ÎÉÖÎÅÇÏ ÏËÎÁ.
905 965
906(åÓÌÉ ×Ù ÎÁÖÁÌÉ C-x 1 × ÎÉÖÎÅÍ ÏËÎÅ, ÔÏ ×Ù ÉÚÂÁ×ÉÌÉÓØ ÏÔ ×ÅÒÈÎÅÇÏ. ðÏÎÉÍÁÊÔÅ 966(åÓÌÉ ÂÙ ×Ù ÎÁÖÁÌÉ C-x 1 × ÎÉÖÎÅÍ ÏËÎÅ, ÔÏ ×Ù ÂÙ ÉÚÂÁ×ÉÌÉÓØ ÏÔ ×ÅÒÈÎÅÇÏ.
907ÜÔÕ ËÏÍÁÎÄÕ ËÁË "ïÓÔÁ×ÉÔØ ÔÏÌØËÏ ÏÄÎÏ ÏËÎÏ, ÔÏ, × ËÏÔÏÒÏÍ Ñ ÓÅÊÞÁÓ ÎÁÈÏÖÕÓØ"). 967ðÏÎÉÍÁÊÔÅ ÜÔÕ ËÏÍÁÎÄÕ ËÁË "ïÓÔÁ×ÉÔØ ÔÏÌØËÏ ÏÄÎÏ ÏËÎÏ -- ÔÏ, × ËÏÔÏÒÏÍ Ñ
968ÓÅÊÞÁÓ ÎÁÈÏÖÕÓØ").
908 969
909÷ÁÍ ÎÅ ÎÕÖÎÏ ÏÔÏÂÒÁÖÁÔØ ÏÄÉÎ É ÔÏÔ ÖÅ ÂÕÆÅÒ × ÏÂÏÉÈ ÏËÎÁÈ. åÓÌÉ ×Ù 970÷ÁÍ ÎÅ ÎÕÖÎÏ ÏÔÏÂÒÁÖÁÔØ ÏÄÉÎ É ÔÏÔ ÖÅ ÂÕÆÅÒ × ÏÂÏÉÈ ÏËÎÁÈ. åÓÌÉ ×Ù
910ÉÓÐÏÌØÚÕÅÔÅ C-x C-f, ÞÔÏÂÙ ÏÔËÒÙÔØ ÆÁÊÌ × ÏÄÎÏÍ ÏËÎÅ, ÄÒÕÇÏÅ ÏÓÔÁÎÅÔÓÑ ÂÅÚ 971ÉÓÐÏÌØÚÕÅÔÅ C-x C-f, ÞÔÏÂÙ ÏÔËÒÙÔØ ÆÁÊÌ × ÏÄÎÏÍ ÏËÎÅ, ÄÒÕÇÏÅ ÏÓÔÁÎÅÔÓÑ ÂÅÚ
911ÉÚÍÅÎÅÎÉÑ. ÷Ù ÍÏÖÅÔÅ ÏÔËÒÙ×ÁÔØ ÆÁÊÌÙ × ËÁÖÄÏÍ ÏËÎÅ ÎÅÚÁ×ÉÓÉÍÏ. 972ÉÚÍÅÎÅÎÉÑ. ÷Ù ÍÏÖÅÔÅ ÏÔËÒÙ×ÁÔØ ÆÁÊÌÙ × ËÁÖÄÏÍ ÏËÎÅ ÎÅÚÁ×ÉÓÉÍÏ.
912 973
913åÓÔØ ÄÒÕÇÏÊ ÐÕÔØ ÉÓÐÏÌØÚÏ×ÁÔØ Ä×Á ÏËÎÁ, ÏÔÏÂÒÁÖÁÀÝÉÈ ÒÁÚÎÙÅ ÆÁÊÌÙ: 974åÓÔØ ÄÒÕÇÏÊ ÐÕÔØ ÉÓÐÏÌØÚÏ×ÁÔØ Ä×Á ÏËÎÁ, ÏÔÏÂÒÁÖÁÀÝÉÈ ÒÁÚÎÙÅ ÆÁÊÌÙ:
914 975
915>> îÁÂÅÒÉÔÅ C-x 4 C-f, ÚÁÔÅÍ ÉÍÑ ÏÄÎÏÇÏ É ×ÁÛÉÈ ÆÁÊÌÏ×. úÁ×ÅÒÛÉÔÅ <Return>. 976>> îÁÂÅÒÉÔÅ C-x 4 C-f, É ××ÅÄÉÔÅ ÉÍÑ ÏÄÎÏÇÏ É ×ÁÛÉÈ ÆÁÊÌÏ×. úÁ×ÅÒÛÉÔÅ ××ÏÄ
916 ðÏÓÍÏÔÒÉÔÅ, ÞÔÏ ×ÙÂÒÁÎÎÙÊ ÆÁÊÌ ÐÏÑ×ÉÌÓÑ × ÎÉÖÎÅÍ ÏËÎÅ. ëÕÒÓÏÒ ÐÅÒÅÛÅÌ 977 ÎÁÖÁÔÉÅÍ <Return>. úÁÍÅÔØÔÅ, ÞÔÏ ×ÙÂÒÁÎÎÙÊ ÆÁÊÌ ÐÏÑ×ÉÌÓÑ × ÎÉÖÎÅÍ ÏËÎÅ.
917 ÔÕÄÁ ÖÅ. 978 ëÕÒÓÏÒ ÐÅÒÅÛÅÌ ÔÕÄÁ ÖÅ.
918 979
919>> îÁÂÅÒÉÔÅ C-x o, ÞÔÏÂÙ ×ÅÒÎÕÔØÓÑ × ×ÅÒÈÎÅÅ ÏËÎÏ, É C-x 1, ÞÔÏÂÙ ÕÄÁÌÉÔØ 980>> îÁÂÅÒÉÔÅ C-x o, ÞÔÏÂÙ ×ÅÒÎÕÔØÓÑ × ×ÅÒÈÎÅÅ ÏËÎÏ, É ÚÁÔÅÍ C-x 1, ÞÔÏÂÙ
920 ÎÉÖÎÅÅ ÏËÎÏ. 981 ÕÄÁÌÉÔØ ÎÉÖÎÅÅ ÏËÎÏ.
921 982
922 983
923* òåëõòóé÷îùå õòï÷îé òåäáëôéòï÷áîéñ (RECURSIVE EDITING LEVELS) 984* òåëõòóé÷îùå õòï÷îé òåäáëôéòï÷áîéñ (RECURSIVE EDITING LEVELS)
924-------------------------------------------------------------- 985--------------------------------------------------------------
925 986
926éÎÏÇÄÁ ×Ù ÂÕÄÅÔÅ ×ËÌÀÞÁÔØ ÔÁË ÎÁÚÙ×ÁÅÍÙÅ "ÒÅËÕÒÓÉ×ÎÙÅ ÕÒÏ×ÎÉ 987éÎÏÇÄÁ ×Ù ÂÕÄÅÔÅ ÐÏÐÁÄÁÔØ × ÔÁË ÎÁÚÙ×ÁÅÍÙÅ "ÒÅËÕÒÓÉ×ÎÙÅ ÕÒÏ×ÎÉ
927ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ". îÁ ÜÔÏ ÕËÁÚÙ×ÁÀÔ ÐÒÑÍÏÕÇÏÌØÎÙÅ ÓËÏÂËÉ × ÓÔÒÏËÅ ÓÏÓÔÏÑÎÉÑ, 988ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ". îÁ ÜÔÏ ÕËÁÚÙ×ÁÀÔ ÐÒÑÍÏÕÇÏÌØÎÙÅ ÓËÏÂËÉ × ÓÔÒÏËÅ ÓÔÁÔÕÓÁ,
928ÏËÒÕÖÁÀÝÉÅ ÏÂÙÞÎÙÅ ÓËÏÂËÉ ×ÏËÒÕÇ ÉÍÅÎÉ ÏÓÎÏ×ÎÏÇÏ ÒÅÖÉÍÁ. îÁÐÒÉÍÅÒ, ×Ù ÍÏÖÅÔÅ 989ÏËÒÕÖÁÀÝÉÅ ÏÂÙÞÎÙÅ ÓËÏÂËÉ ×ÏËÒÕÇ ÉÍÅÎÉ ÏÓÎÏ×ÎÏÇÏ ÒÅÖÉÍÁ. îÁÐÒÉÍÅÒ, ×Ù
929Õ×ÉÄÅÔØ [(Fundamental)] ×ÍÅÓÔÏ (Fundamental). 990Õ×ÉÄÉÔÅ [(Fundamental)] ×ÍÅÓÔÏ (Fundamental).
930 991
931þÔÏÂÙ ×ÙÊÔÉ ÉÚ ÒÅËÕÒÓÉ×ÎÙÈ ÕÒÏ×ÎÅÊ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ, ÎÁÖÍÉÔÅ ESC ESC ESC. üÔÏ 992þÔÏÂÙ ×ÙÊÔÉ ÉÚ ÒÅËÕÒÓÉ×ÎÙÈ ÕÒÏ×ÎÅÊ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ, ÎÁÖÍÉÔÅ <ESC> <ESC>
932ÍÎÏÇÏÃÅÌÅ×ÁÑ ËÏÍÁÎÄÁ "×ÙÈÏÄ". ÷Ù ÔÁËÖÅ ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ ÅÅ ËÁË ÄÌÑ 993<ESC>. üÔÏ ÍÎÏÇÏÃÅÌÅ×ÁÑ ËÏÍÁÎÄÁ "×ÙÈÏÄ". ÷Ù ÔÁËÖÅ ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ ÅÅ,
933ÕÎÉÞÔÏÖÅÎÉÑ ÌÉÛÎÉÈ ÏËÏÎ, ÔÁË É ÄÌÑ ×ÙÈÏÄÁ ÉÚ ÍÉÎÉ-ÂÕÆÅÒÁ. 994ËÁË ÄÌÑ ÕÎÉÞÔÏÖÅÎÉÑ ÌÉÛÎÉÈ ÏËÏÎ, ÔÁË É ÄÌÑ ×ÙÈÏÄÁ ÉÚ ÍÉÎÉ-ÂÕÆÅÒÁ.
934 995
935>> îÁÖÍÉÔÅ M-x, ÞÔÏÂÙ ÐÏÐÁÓÔØ × ÍÉÎÉ-ÂÕÆÅÒ; ÚÁÔÅÍ ÎÁÖÍÉÔÅ ESC ESC ESC, 996>> îÁÖÍÉÔÅ M-x, ÞÔÏÂÙ ÐÏÐÁÓÔØ × ÍÉÎÉ-ÂÕÆÅÒ, Á ÚÁÔÅÍ ÎÁÖÍÉÔÅ <ESC> <ESC>
936 ÞÔÏÂÙ ÐÏËÉÎÕÔØ ÅÇÏ. 997 <ESC>, ÞÔÏÂÙ ÐÏËÉÎÕÔØ ÅÇÏ.
937 998
938÷Ù ÎÅ ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ C-g, ÞÔÏÂÙ ×ÙÊÔÉ ÉÚ ÒÅËÕÒÓÉ×ÎÙÈ ÕÒÏ×ÎÅÊ 999÷Ù ÎÅ ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ C-g, ÄÌÑ ×ÙÈÏÄÁ ÉÚ ÒÅËÕÒÓÉ×ÎÙÈ ÕÒÏ×ÎÅÊ
939ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ. ðÏÔÏÍÕ, ÞÔÏ C-g ÉÓÐÏÌØÚÕÅÔÓÑ ÄÌÑ ÏÔÍÅÎÙ ËÏÍÁÎÄÙ É 1000ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ. üÔÏ ÐÏÔÏÍÕ, ÞÔÏ C-g ÉÓÐÏÌØÚÕÅÔÓÑ ÄÌÑ ÏÔÍÅÎÙ ËÏÍÁÎÄÙ É
940ÁÒÇÕÍÅÎÔÏ× âåú ÒÅËÕÒÓÉ×ÎÙÈ ÕÒÏ×ÎÅÊ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ. 1001ÁÒÇÕÍÅÎÔÏ× âåú ÒÅËÕÒÓÉ×ÎÙÈ ÕÒÏ×ÎÅÊ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ.
941 1002
942 1003
943* ëáë ðïìõþéôø ðïíïýø (GETTING MORE HELP) 1004* ëáë ðïìõþéôø äïðïìîéôåìøîõà ðïíïýø
944----------------------------------------- 1005------------------------------------
945 1006
946÷ ÜÔÏÍ ÕÞÅÂÎÉËÅ ÍÙ ÐÏÐÙÔÁÌÉÓØ ÓÎÁÂÄÉÔØ ×ÁÓ ÔÏÌØËÏ ÔÏÊ ÉÎÆÏÒÍÁÃÉÅÊ, ËÏÔÏÒÁÑ 1007÷ ÜÔÏÍ ÕÞÅÂÎÉËÅ ÍÙ ÐÏÐÙÔÁÌÉÓØ ÓÎÁÂÄÉÔØ ×ÁÓ ÔÏÌØËÏ ÔÏÊ ÉÎÆÏÒÍÁÃÉÅÊ, ËÏÔÏÒÁÑ
947ÐÏÍÏÖÅÔ ÎÁÞÁÔØ ÉÓÐÏÌØÚÏ×ÁÔØ Emacs. ïÞÅÎØ ÍÎÏÇÏ ÉÎÆÏÒÍÁÃÉÉ ÄÏÓÔÕÐÎÏ × Emacs, 1008ÐÏÍÏÖÅÔ ×ÁÍ ÎÁÞÁÔØ ÐÏÌØÚÏ×ÁÔØÓÑ Emacs. ïÞÅÎØ ÍÎÏÇÏ ÉÎÆÏÒÍÁÃÉÉ ÄÏÓÔÕÐÎÏ ×
948É ÎÅ×ÏÚÍÏÖÎÏ ×ÓÀ ÅÅ ÐÒÅÄÓÔÁ×ÉÔØ ÚÄÅÓØ. ïÄÎÁËÏ, ×Ù ÍÏÖÅÔÅ ×ÙÕÞÉÔØ ÂÏÌØÛÅ 1009Emacs, É ÎÅ×ÏÚÍÏÖÎÏ ×ÓÀ ÅÅ ÐÒÅÄÓÔÁ×ÉÔØ ÚÄÅÓØ. ïÄÎÁËÏ, ×Ù ÍÏÖÅÔÅ ×ÙÕÞÉÔØ
949×ÏÚÍÏÖÎÏÓÔÅÊ Emacs É ÕÚÎÁÔØ ÄÒÕÇÉÅ ÐÏÌÅÚÎÙÅ ÏÓÏÂÅÎÎÏÓÔÉ. Emacs ÐÒÅÄÏÓÔÁ×ÌÑÅÔ 1010ÂÏÌØÛÅ ×ÏÚÍÏÖÎÏÓÔÅÊ Emacs É ÕÚÎÁÔØ ÄÒÕÇÉÅ ÐÏÌÅÚÎÙÅ ÏÓÏÂÅÎÎÏÓÔÉ. Emacs
950ËÏÍÁÎÄÙ ÄÌÑ ÞÔÅÎÉÑ ÄÏËÕÍÅÎÔÁÃÉÉ Ï ËÏÍÁÎÄÁÈ Emacs. üÔÉ ËÏÍÁÎÄÙ "ÐÏÍÏÝÉ" 1011ÐÒÅÄÏÓÔÁ×ÌÑÅÔ ËÏÍÁÎÄÙ ÄÌÑ ÞÔÅÎÉÑ ÄÏËÕÍÅÎÔÁÃÉÉ Ï ËÏÍÁÎÄÁÈ Emacs. üÔÉ ËÏÍÁÎÄÙ
951("help") ×ÓÅ ÎÁÞÉÎÁÀÔÓÑ Ó ÓÉÍ×ÏÌÁ CONTROL-h, ËÏÔÏÒÙÊ Ñ×ÌÑÅÔÓÑ "ÓÉÍ×ÏÌÏÍ 1012"ÓÐÒÁ×ËÉ" ("help") ×ÓÅ ÎÁÞÉÎÁÀÔÓÑ Ó ÓÉÍ×ÏÌÁ CONTROL-h, ËÏÔÏÒÙÊ Ñ×ÌÑÅÔÓÑ
952ÐÏÍÏÝÉ". 1013"ÓÉÍ×ÏÌÏÍ ÐÏÍÏÝÉ".
953 1014
954þÔÏÂÙ ÉÓÐÏÌØÚÏ×ÁÔØ ÏÓÏÂÅÎÎÏÓÔÉ ðÏÍÏÝÉ, ÎÁÖÍÉÔÅ C-h, É ÚÁÔÅÍ ÓÉÍ×ÏÌ, ËÏÔÏÒÙÊ 1015þÔÏÂÙ ÉÓÐÏÌØÚÏ×ÁÔØ ×ÏÚÍÏÖÎÏÓÔÉ ÓÐÒÁ×ËÉ, ÎÁÖÍÉÔÅ C-h, É ÚÁÔÅÍ ÓÉÍ×ÏÌ, ËÏÔÏÒÙÊ
955ÒÁÓÓËÁÖÅÔ, ËÁËÏÊ ÉÍÅÎÎÏ ×ÉÄ ÐÏÍÏÝÉ ×Ù ÈÏÔÉÔÅ ÐÏÌÕÞÉÔØ. åÓÌÉ ×Ù äåêóô÷éôåìøîï 1016ÒÁÓÓËÁÖÅÔ, ËÁËÏÊ ÉÍÅÎÎÏ ×ÉÄ ÓÐÒÁ×ËÉ ×Ù ÈÏÔÉÔÅ ÐÏÌÕÞÉÔØ. åÓÌÉ ×Ù
956ÒÁÓÔÅÒÑÌÉÓØ, ÎÁÂÅÒÉÔÅ C-h ?, É Emacs ÒÁÓÓËÁÖÅÔ ×ÁÍ ËÁËÕÀ ÐÏÍÏÝØ ÏÎ ÍÏÖÅÔ ×ÁÍ 1017äåêóô÷éôåìøîï ÒÁÓÔÅÒÑÌÉÓØ, ÎÁÂÅÒÉÔÅ C-h ?, É Emacs ÒÁÓÓËÁÖÅÔ ×ÁÍ Ï ÔÏÍ,
957ÐÒÅÄÏÓÔÁ×ÉÔØ. åÓÌÉ ×Ù ÎÁÖÁÌÉ C-h É ÐÅÒÅÄÕÍÁÌÉ ÏÂÒÁÝÁÔØÓÑ Ë ÐÏÍÏÝÉ, ÐÒÏÓÔÏ 1018ËÁËÕÀ ÓÐÒÁ×ËÕ ÏÎ ÍÏÖÅÔ ×ÁÍ ÐÒÅÄÏÓÔÁ×ÉÔØ. åÓÌÉ ×Ù ÎÁÖÁÌÉ C-h É ÐÅÒÅÄÕÍÁÌÉ
958ÎÁÖÍÉÔÅ C-g, ÞÔÏÂÙ ÏÔÍÅÎÉÔØ ÜÔÕ ËÏÍÁÎÄÕ. 1019ÏÂÒÁÝÁÔØÓÑ Ë ÓÐÒÁ×ËÅ, ÔÏ ÐÒÏÓÔÏ ÎÁÖÍÉÔÅ C-g, ÞÔÏÂÙ ÏÔÍÅÎÉÔØ ÜÔÕ ËÏÍÁÎÄÕ.
959 1020
960(ëÏÅ-ÇÄÅ ÐÅÒÅÎÁÚÎÁÞÁÀÔ ÓÉÍ×ÏÌ C-h. òÅÁÌØÎÏÊ ÎÅÏÂÈÏÄÉÍÏÓÔÉ × ÜÔÏÍ ÎÅÔ, 1021(ëÏÅ-ÇÄÅ ÐÅÒÅÎÁÚÎÁÞÁÀÔ ÓÉÍ×ÏÌ C-h. òÅÁÌØÎÏÊ ÎÅÏÂÈÏÄÉÍÏÓÔÉ × ÜÔÏÍ ÎÅÔ, É
961ÓÏÏÂÝÉÔÅ Ï ÎÅÊ ÓÉÓÔÅÍÎÏÍÕ ÁÄÍÉÎÉÓÔÒÁÔÏÒÕ. ôÅÍ ×ÒÅÍÅÎÅÍ, ÅÓÌÉ C-h ÎÅ ×ÙÚÙ×ÁÅÔ 1022ÅÓÌÉ ÜÔÏ ÔÁË, ÔÏ ÓÏÏÂÝÉÔÅ Ï ÜÔÏÍ ÓÉÓÔÅÍÎÏÍÕ ÁÄÍÉÎÉÓÔÒÁÔÏÒÕ. ôÅÍ ×ÒÅÍÅÎÅÍ,
962ÓÏÏÂÝÅÎÉÅ ÐÏÍÏÝÉ ×ÎÉÚÕ ÜËÒÁÎÁ, ÐÏÐÒÏÂÕÊÔÅ ×ÍÅÓÔÏ ÜÔÏÇÏ ÎÁÖÁÔØ ËÌÁ×ÉÛÕ F1 ÉÌÉ 1023ÅÓÌÉ C-h ÎÅ ×ÙÚÙ×ÁÅÔ ÓÏÏÂÝÅÎÉÅ ÐÏÍÏÝÉ ×ÎÉÚÕ ÜËÒÁÎÁ, ÔÏ ÐÏÐÒÏÂÕÊÔÅ ×ÍÅÓÔÏ
963ÎÁÂÒÁÔØ M-x help RET). 1024ÜÔÏÇÏ ÎÁÖÁÔØ ËÌÁ×ÉÛÕ F1 ÉÌÉ ÎÁÂÒÁÔØ M-x help RET).
964 1025
965óÁÍÁÑ ÏÓÎÏ×ÎÁÑ ×ÏÚÍÏÖÎÏÓÔØ ðïíïýé - C-h c. îÁÖÍÉÔÅ C-h, ÚÁÔÅÍ c, É ÓÉÍ×ÏÌ 1026ïÄÎÁ ÉÚ ÓÁÍÙÈ ÇÌÁ×ÎÙÈ ÆÕÎËÃÉÊ ÓÐÒÁ×ËÉ -- C-h c. îÁÖÍÉÔÅ C-h, ÚÁÔÅÍ c, É
966ËÏÍÁÎÄÙ ÉÌÉ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔØ, É Emacs ÏÔÏÂÒÁÚÉÔ ÏÞÅÎØ ËÒÁÔËÏÅ ÏÐÉÓÁÎÉÅ 1027ÓÉÍ×ÏÌ ËÏÍÁÎÄÙ ÉÌÉ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔØ, É Emacs ÏÔÏÂÒÁÚÉÔ ËÒÁÔËÏÅ ÎÁÂÒÁÎÎÏÊ
967ËÏÍÁÎÄÙ. 1028ÏÐÉÓÁÎÉÅ ËÏÍÁÎÄÙ.
968 1029
969>> îÁÖÍÉÔÅ C-h c C-p. 1030>> îÁÖÍÉÔÅ C-h c C-p.
970 óÏÏÂÝÅÎÉÅ ÄÏÌÖÎÏ ×ÙÇÌÑÄÅÔØ ÐÒÉÍÅÒÎÏ ÔÁË 1031
1032óÏÏÂÝÅÎÉÅ ÄÏÌÖÎÏ ×ÙÇÌÑÄÅÔØ ÐÒÉÍÅÒÎÏ ÔÁË:
971 1033
972 C-p runs the command previous-line 1034 C-p runs the command previous-line
973 (C-p ×ÙÐÏÌÎÑÅÔ ËÏÍÁÎÄÕ previous-line {ÐÒÅÄÙÄÕÝÁÑ-ÓÔÒÏËÁ}) 1035 (C-p ×ÙÐÏÌÎÑÅÔ ËÏÍÁÎÄÕ previous-line {ÐÒÅÄÙÄÕÝÁÑ-ÓÔÒÏËÁ})
974 1036
975÷ÁÍ ÓÏÏÂÝÁÀÔ "ÉÍÑ ÆÕÎËÃÉÉ". éÍÅÎÁ ÆÕÎËÃÉÊ ÉÓÐÏÌØÚÕÀÔÓÑ × ÏÓÎÏ×ÎÏÍ ÄÌÑ 1037÷ÁÍ ÓÏÏÂÝÁÀÔ "ÉÍÑ ÆÕÎËÃÉÉ". éÍÅÎÁ ÆÕÎËÃÉÊ ÉÓÐÏÌØÚÕÀÔÓÑ × ÏÓÎÏ×ÎÏÍ ÄÌÑ
976ÎÁÓÔÒÏÊËÉ É ÒÁÓÛÉÒÅÎÉÑ Emacs. éÍÅÎÁ ÆÕÎËÃÉÊ ×ÙÂÒÁÎÙ ÔÁË, ÞÔÏÂÙ ÐÏËÁÚÁÔØ, 1038ÎÁÓÔÒÏÊËÉ É ÒÁÓÛÉÒÅÎÉÑ Emacs. éÍÅÎÁ ÆÕÎËÃÉÊ ×ÙÂÒÁÎÙ ÔÁË, ÞÔÏÂÙ ÐÏËÁÚÁÔØ, ÞÔÏ
977ÞÔÏ ÉÍÅÎÎÏ ËÏÍÁÎÄÁ ÄÅÌÁÅÔ, ÔÁËÖÅ ÏÎÉ ÐÏÚ×ÏÌÑÀÔ Ó ÐÏÍÏÝØÀ ÜÔÏÊ ËÒÁÔËÏÊ 1039ÉÍÅÎÎÏ ËÏÍÁÎÄÁ ÄÅÌÁÅÔ, Á ÔÁËÖÅ ÏÎÉ ÐÏÚ×ÏÌÑÀÔ Ó ÐÏÍÏÝØÀ ÜÔÏÊ ËÒÁÔËÏÊ
978ÉÎÆÏÒÍÁÃÉÉ ÌÅÇÞÅ ÚÁÐÏÍÎÉÔØ ÕÖÅ ×ÙÕÞÅÎÎÙÅ ËÏÍÁÎÄÙ. 1040ÉÎÆÏÒÍÁÃÉÉ ÌÅÇÞÅ ÚÁÐÏÍÎÉÔØ ÕÖÅ ×ÙÕÞÅÎÎÙÅ ËÏÍÁÎÄÙ.
979 1041
980íÎÏÇÏÓÉÍ×ÏÌØÎÙÅ ËÏÍÁÎÄÙ, ÔÁËÉÅ ËÁË C-x C-s É (ÅÓÌÉ Õ ×ÁÓ ÎÅÔ ËÎÏÐËÉ META ÉÌÉ 1042íÎÏÇÏÓÉÍ×ÏÌØÎÙÅ ÓÏÞÅÔÁÎÉÑ ËÌÁ×ÉÛ, ÔÁËÉÅ ËÁË C-x C-s É (ÅÓÌÉ Õ ×ÁÓ ÎÅÔ ËÎÏÐËÉ
981EDIT ÉÌÉ ALT) <ESC>v ÔÁËÖÅ ÂÕÄÕÔ ÄÏÓÔÕÐÎÙ ÐÏÓÌÅ C-h c. 1043META ÉÌÉ EDIT ÉÌÉ ALT) <ESC>v ÔÁËÖÅ ÂÕÄÕÔ ÄÏÓÔÕÐÎÙ ÄÌÑ ÐÏÌÕÞÅÎÉÑ ÓÐÒÁ×ËÉ Ó
1044ÐÏÍÏÝØÀ C-h c.
982 1045
983ðÏÌÕÞÉÔÅ ÂÏÌØÛÅ ÉÎÆÏÒÍÁÃÉÉ Ï ËÏÍÁÎÄÅ ÉÓÐÏÌØÚÕÑ C-h k ×ÍÅÓÔÏ C-h c. 1046÷Ù ÍÏÖÅÔÅ ÐÏÌÕÞÉÔØ ÂÏÌØÛÅ ÉÎÆÏÒÍÁÃÉÉ Ï ËÏÍÁÎÄÅ ÉÓÐÏÌØÚÕÑ C-h k ×ÍÅÓÔÏ C-h c.
984 1047
985>> îÁÂÅÒÉÔÅ C-h k C-p. 1048>> îÁÂÅÒÉÔÅ C-h k C-p.
986 1049
987÷Ù Õ×ÉÄÉÔÅ ÏÐÉÓÁÎÉÅ ÆÕÎËÃÉÉ, Á ÔÁËÖÅ ÅÅ ÉÍÑ × ÏÔÄÅÌØÎÏÍ ÏËÎÅ Emacs. ëÏÇÄÁ ×Ù 1050÷Ù Õ×ÉÄÉÔÅ ÏÐÉÓÁÎÉÅ ÆÕÎËÃÉÉ, Á ÔÁËÖÅ ÅÅ ÉÍÑ × ÏÔÄÅÌØÎÏÍ ÏËÎÅ Emacs. ëÏÇÄÁ ×Ù
988ÚÁ×ÅÒÛÉÔÅ ÞÔÅÎÉÅ, ÎÁÖÍÉÔÅ C-x 1, ÞÔÏÂÙ ÉÚÂÁ×ÉÔØÓÑ ÏÔ ÔÅËÓÔÁ ÐÏÍÏÝÉ. ÷Ù 1051ÚÁ×ÅÒÛÉÔÅ ÞÔÅÎÉÅ, ÎÁÖÍÉÔÅ C-x 1, ÞÔÏÂÙ ÉÚÂÁ×ÉÔØÓÑ ÏÔ ÔÅËÓÔÁ ÓÐÒÁ×ËÉ. ÷Ù
989ÍÏÖÅÔÅ ×ÙÐÏÌÎÉÔØ ËÁËÏÅ-ÔÏ ÒÅÄÁËÔÉÒÏ×ÁÎÉÅ ×Ï ×ÒÅÍÑ ÐÒÏÓÍÏÔÒÁ ÔÅËÓÔÁ ÓÐÒÁ×ËÉ, 1052ÍÏÖÅÔÅ ×ÙÐÏÌÎÉÔØ ÉÚÍÅÎÅÎÉÅ ÔÅËÓÔÁ ×Ï ×ÒÅÍÑ ÐÒÏÓÍÏÔÒÁ ÔÅËÓÔÁ ÓÐÒÁ×ËÉ, Á
990Á ÔÏÌØËÏ ÚÁÔÅÍ ÎÁÖÁÔØ C-x 1. 1053ÔÏÌØËÏ ÚÁÔÅÍ ÎÁÖÁÔØ C-x 1.
991 1054
992åÓÔØ ÅÝÅ ÎÅÓËÏÌØËÏ ÐÏÌÅÚÎÙÈ ÏÐÃÉÊ C-h: 1055åÓÔØ ÅÝÅ ÎÅÓËÏÌØËÏ ÐÏÌÅÚÎÙÈ ÆÕÎËÃÉÊ, ÄÏÓÔÕÐÎÙÈ ÞÅÒÅÚ C-h:
993 1056
994 C-h f ïÐÉÓÙ×ÁÅÔ ÆÕÎËÃÉÀ. ÷ÁÍ ÎÅÏÂÈÏÄÉÍÏ ÎÁÂÒÁÔØ ÉÍÑ ÆÕÎËÃÉÉ. 1057 C-h f ïÐÉÓÙ×ÁÅÔ ÆÕÎËÃÉÀ. ÷ÁÍ ÎÅÏÂÈÏÄÉÍÏ ÎÁÂÒÁÔØ ÉÍÑ ÆÕÎËÃÉÉ.
995 1058
996>> ðÏÐÒÏÂÕÊÔÅ ÎÁÂÒÁÔØ C-h f previous-line<Return>. 1059>> ðÏÐÒÏÂÕÊÔÅ ÎÁÂÒÁÔØ C-h f previous-line<Return>.
997 üÔÏ ÒÁÓÐÅÞÁÔÁÅÔ ÉÎÆÏÒÍÁÃÉÀ Emacs Ï ÜÔÏÊ ÆÕÎËÃÉÉ, ËÏÔÏÒÁÑ ×ÙÐÏÌÎÑÅÔÓÑ 1060 üÔÏ ÒÁÓÐÅÞÁÔÁÅÔ ÉÎÆÏÒÍÁÃÉÀ Emacs Ï ÆÕÎËÃÉÉ, ËÏÔÏÒÁÑ ×ÙÐÏÌÎÑÅÔÓÑ ËÏÍÁÎÄÏÊ
998 ËÏÍÁÎÄÏÊ C-p. 1061 C-p.
999 1062
1000áÎÁÌÏÇÉÞÎÁÑ ËÏÍÁÎÄÁ C-h v ÏÔÏÂÒÁÖÁÅÔ ÄÏËÕÍÅÎÔÁÃÉÀ Ï ÐÅÒÅÍÅÎÎÙÈ, ÚÎÁÞÅÎÉÅ 1063áÎÁÌÏÇÉÞÎÁÑ ËÏÍÁÎÄÁ C-h v ÏÔÏÂÒÁÖÁÅÔ ÄÏËÕÍÅÎÔÁÃÉÀ Ï ÐÅÒÅÍÅÎÎÙÈ, ÚÎÁÞÅÎÉÅ
1001ËÏÔÏÒÙÈ ×Ù ÍÏÖÅÔÅ ÉÚÍÅÎÉÔØ ÄÌÑ ÎÁÓÔÒÏÊËÉ ÐÏ×ÅÄÅÎÉÑ Emacs. ÷ÁÍ ÎÕÖÎÏ ÎÁÂÒÁÔØ 1064ËÏÔÏÒÙÈ ×Ù ÍÏÖÅÔÅ ÉÚÍÅÎÉÔØ ÄÌÑ ÎÁÓÔÒÏÊËÉ ÐÏ×ÅÄÅÎÉÑ Emacs. ÷ÁÍ ÎÕÖÎÏ ÎÁÂÒÁÔØ
1002ÉÍÑ ÐÅÒÅÍÅÎÎÏÊ, ËÏÇÄÁ Emacs ÚÁÐÒÏÓÉÔ ÅÇÏ. 1065ÉÍÑ ÐÅÒÅÍÅÎÎÏÊ, ËÏÇÄÁ Emacs ÚÁÐÒÏÓÉÔ ÅÇÏ.
1003 1066
1004 C-h a Hyper Apropos. ÷×ÅÄÉÔÅ ËÌÀÞÅ×ÏÅ ÓÌÏ×Ï É Emacs ÐÏËÁÖÅÔ ×ÁÍ 1067 C-h a (Hyper Apropos). ÷×ÅÄÉÔÅ ËÌÀÞÅ×ÏÅ ÓÌÏ×Ï É Emacs ÐÏËÁÖÅÔ ×ÁÍ ÓÐÉÓÏË
1005 ÓÐÉÓÏË ×ÓÅÈ ÆÕÎËÃÉÊ É ÐÅÒÅÍÅÎÎÙÈ, ÉÍÅÎÁ ËÏÔÏÒÙÈ ÓÏÄÅÒÖÁÔ ÜÔÏ 1068 ×ÓÅÈ ÆÕÎËÃÉÊ É ÐÅÒÅÍÅÎÎÙÈ, ÉÍÅÎÁ ËÏÔÏÒÙÈ ÓÏÄÅÒÖÁÔ ÜÔÏ
1006 ÓÌÏ×Ï. ëÏÍÁÎÄÙ, ËÏÔÏÒÙÅ ÍÏÇÕÔ ÂÙÔØ ×ÙÚ×ÁÎÙ ÞÅÒÅÚ Meta-x, 1069 ÓÌÏ×Ï. ëÏÍÁÎÄÙ, ËÏÔÏÒÙÅ ÍÏÇÕÔ ÂÙÔØ ×ÙÚ×ÁÎÙ ÞÅÒÅÚ Meta-x, ÂÕÄÕÔ
1007 ÂÕÄÕÔ ÏÔÍÅÞÅÎÙ Ú×ÅÚÄÏÞËÏÊ ÓÌÅ×Á. 1070 ÏÔÍÅÞÅÎÙ Ú×ÅÚÄÏÞËÏÊ ÓÌÅ×Á.
1008 1071
1009>> îÁÂÅÒÉÔÅ C-h a file<Return>. 1072>> îÁÂÅÒÉÔÅ C-h a file<Return>.
1010 1073
1011ÜÔÏ ÏÔÏÂÒÁÚÉÔ ÐÏÌÎÙÊ ÓÐÉÓÏË ÆÕÎËÃÉÊ É ÐÅÒÅÍÅÎÎÙÈ, ÉÍÅÎÁ ËÏÔÏÒÙÈ ÎÁÞÉÎÁÀÔÓÑ 1074üÔÏ ÏÔÏÂÒÁÚÉÔ × ÄÒÕÇÏÍ ÏËÎÅ ÓÐÉÓÏË ×ÓÅÈ ËÏÍÁÎÄ M-x Õ ËÏÔÏÒÙÈ × ÉÍÅÎÁÈ
1012Ó "newline". îÁÖÍÉÔÅ <Return> ÉÌÉ ËÌÉËÎÉÔÅ ÓÒÅÄÎÅÊ ËÎÏÐËÏÊ ÍÙÛËÉ, ÞÔÏÂÙ 1075ÓÏÄÅÒÖÉÔÓÑ ÓÌÏ×Ï "file". ôÁËÖÅ × ÓÐÉÓËÅ ËÒÏÍÅ ËÏÍÁÎÄ ÔÁËÉÈ, ËÁË find-file,
1013ÐÏÌÕÞÉÔØ ÂÏÌØÛÅ ÉÎÆÏÒÍÁÃÉÉ Ï ÆÕÎËÃÉÉ ÉÌÉ ÐÅÒÅÍÅÎÎÏÊ. îÁÖÍÉÔÅ `q', ÞÔÏÂÙ 1076×Ù Õ×ÉÄÉÔÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÉÅ ÓÉÍ×ÏÌØÎÙÅ ËÏÍÁÎÄÙ ÔÁËÉÅ, ËÁË C-x C-f.
1014×ÙÊÔÉ ÉÚ hyper-apropos.
1015
1016üÔÏ ÏÔÏÂÒÁÚÉÔ × ÄÒÕÇÏÍ ÏËÎÅ ÓÐÉÓÏË ×ÓÅÈ ËÏÍÁÎÄ M-x ÓÏ ÓÌÏ×ÏÍ "file" × ÉÈ
1017ÉÍÅÎÁÈ. ôÁËÖÅ × ÓÐÉÓËÅ ËÒÏÍÅ ËÏÍÁÎÄ ÔÁËÉÈ, ËÁË find-file, ×Ù Õ×ÉÄÉÔÅ
1018ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÉÅ ÓÉÍ×ÏÌØÎÙÅ ËÏÍÁÎÄÙ ÔÁËÉÅ, ËÁË C-x C-f.
1019 1077
1020>> îÁÂÅÒÉÔÅ C-M-v ÄÌÑ ÐÒÏËÒÕÔËÉ ÏËÎÁ ÓÐÒÁ×ËÉ. ÷ÙÐÏÌÎÉÔÅ ÜÔÏ ÎÅÓËÏÌØËÏ ÒÁÚ. 1078>> îÁÂÅÒÉÔÅ C-M-v ÄÌÑ ÐÒÏËÒÕÔËÉ ÏËÎÁ ÓÐÒÁ×ËÉ. ÷ÙÐÏÌÎÉÔÅ ÜÔÏ ÎÅÓËÏÌØËÏ ÒÁÚ.
1021 1079
1022>> îÁÂÅÒÉÔÅ C-x 1 ÄÌÑ ÕÄÁÌÅÎÉÑ ÏËÎÁ ÓÐÒÁ×ËÉ. 1080>> îÁÂÅÒÉÔÅ C-x 1 ÄÌÑ ÕÄÁÌÅÎÉÑ ÏËÎÁ ÓÐÒÁ×ËÉ.
1023 1081
1024 C-h i þÉÔÁÔØ ÉÎÔÅÒÁËÔÉ×ÎÙÅ ÒÕËÏ×ÏÄÓÔ×Á (a.k.a. Info). üÔÁ ËÏÍÁÎÄÁ 1082 C-h i þÉÔÁÔØ ÉÎÔÅÒÁËÔÉ×ÎÙÅ ÒÕËÏ×ÏÄÓÔ×Á (ÔÁË ÎÁÚÙ×ÁÅÍÙÅ Info). üÔÁ ËÏÍÁÎÄÁ
1025 ÐÅÒÅÈÏÄÉÔ × ÓÐÅÃÉÁÌØÎÙÊ ÂÕÆÅÒ Ó ÉÍÅÎÅÍ `*info*', ÇÄÅ ×Ù 1083 ÐÅÒÅÈÏÄÉÔ × ÓÐÅÃÉÁÌØÎÙÊ ÂÕÆÅÒ Ó ÉÍÅÎÅÍ `*info*', ÇÄÅ ×Ù ÍÏÖÅÔÅ
1026 ÍÏÖÅÔÅ ÞÉÔÁÔØ ÉÎÔÅÒÁËÔÉ×ÎÙÅ ÒÕËÏ×ÏÄÓÔ×Á ÄÌÑ ÐÁËÅÔÏ×, 1084 ÞÉÔÁÔØ ÉÎÔÅÒÁËÔÉ×ÎÙÅ ÒÕËÏ×ÏÄÓÔ×Á ÄÌÑ ÐÁËÅÔÏ×, ÕÓÔÁÎÏ×ÌÅÎÎÙÈ × ×ÁÛÅÊ
1027 ÕÓÔÁÎÏ×ÌÅÎÎÙÈ × ×ÁÛÅÊ ÓÉÓÔÅÍÅ. îÁÂÅÒÉÔÅ m emacs <Return> ÄÌÑ 1085 ÓÉÓÔÅÍÅ. îÁÂÅÒÉÔÅ m emacs <Return> ÄÌÑ ÞÔÅÎÉÑ ÒÕËÏ×ÏÄÓÔ×Á ÐÏ
1028 ÞÔÅÎÉÑ ÒÕËÏ×ÏÄÓÔ×Á ÐÏ Emacs. åÓÌÉ ×Ù ÎÉËÏÇÄÁ ÒÁÎÅÅ ÎÅ 1086 Emacs. åÓÌÉ ×Ù ÎÉËÏÇÄÁ ÒÁÎÅÅ ÎÅ ÉÓÐÏÌØÚÏ×ÁÌÉ Info, ÔÏ ÎÁÂÅÒÉÔÅ ? É
1029 ÉÓÐÏÌØÚÏ×ÁÌÉ Info, ÔÏ ÎÁÂÅÒÉÔÅ ? É Emacs ÏÔËÒÏÅÔ ÕÞÅÂÎÉË ÐÏ 1087 Emacs ÏÔËÒÏÅÔ ÕÞÅÂÎÉË ÐÏ ×ÏÚÍÏÖÎÏÓÔÑÍ ÒÅÖÉÍÁ Info. ïÄÎÁÖÄÙ
1030 ×ÏÚÍÏÖÎÏÓÔÑÍ ÒÅÖÉÍÁ Info. ïÄÎÁÖÄÙ ÏÚÎÁËÏÍÉ×ÛÉÓØ Ó ÜÔÉÍ 1088 ÏÚÎÁËÏÍÉ×ÛÉÓØ Ó ÜÔÉÍ ÕÞÅÂÎÉËÏÍ, ×Ù ÄÏÌÖÎÙ ÉÓÐÏÌØÚÏ×ÁÔØ ÒÕËÏ×ÏÄÓÔ×Ï
1031 ÕÞÅÂÎÉËÏÍ, ×Ù ÄÏÌÖÎÙ ÉÓÐÏÌØÚÏ×ÁÔØ ÒÕËÏ×ÏÄÓÔ×Ï Emacs Info × 1089 Emacs Info × ËÁÞÅÓÔ×Å ÏÓÎÏ×ÎÏÊ ÄÏËÕÍÅÎÔÁÃÉÉ.
1032 ËÁÞÅÓÔ×Å ÏÓÎÏ×ÎÏÊ ÄÏËÕÍÅÎÔÁÃÉÉ. 1090
1091
1092* äïðïìîéôåìøîùå ÷ïúíïöîïóôé
1093----------------------------
1094
1095÷Ù ÍÏÖÅÔÅ ÕÚÎÁÔØ ÂÏÌØÛÅ Ï Emacs ÞÉÔÁÑ ÅÇÏ ÒÕËÏ×ÏÄÓÔ×Ï, ËÎÉÇÉ ÉÌÉ
1096ÉÎÔÅÒÁËÔÉ×ÎÙÊ ÓÐÒÁ×ÏÞÎÉË (ÉÓÐÏÌØÚÕÊÔÅ ÍÅÎÀ Help ÉÌÉ ÎÁÂÅÒÉÔÅ F10 h r). ÷ÁÍ
1097ÏÓÏÂÅÎÎÏ ÐÏÎÒÁ×ÑÔÓÑ Ä×Å ÆÕÎËÃÉÉ -- ÄÏÐÏÌÎÅÎÉÅ, ËÏÔÏÒÏÅ ÓÏËÒÁÝÁÅÔ ËÏÌÉÞÅÓÔ×Ï
1098ÎÁÖÉÍÁÅÍÙÈ ËÌÁ×ÉÛ, É dired, ËÏÔÏÒÙÊ ÏÂÌÅÇÞÁÅÔ ÒÁÂÏÔÕ Ó ÆÁÊÌÁÍÉ.
1099
1100äÏÐÏÌÎÅÎÉÅ ÉÓÐÏÌØÚÕÅÔÓÑ ÄÌÑ ÔÏÇÏ, ÞÔÏÂÙ ÉÚÂÅÖÁÔØ ÎÁÂÏÒÁ ÌÉÛÎÉÈ ÓÉÍ×ÏÌÏ×.
1101îÁÐÒÉÍÅÒ, ÅÓÌÉ ×Ù ÈÏÔÉÔÅ ÐÅÒÅËÌÀÞÉÔØÓÑ × ÂÕÆÅÒ *Messages*, ÔÏ ×Ù ÍÏÖÅÔÅ
1102ÎÁÂÒÁÔØ C-x b *M<Tab> É Emacs ÚÁÐÏÌÎÉÔ ÏÓÔÁÔÏË ÉÍÅÎÉ ÂÕÆÅÒÁ, ÐÏÓËÏÌØËÕ ÏÎ
1103ÍÏÖÅÔ ÏÐÒÅÄÅÌÉÔØ ÅÇÏ ÉÚ ÔÏÇÏ, ÞÔÏ ×Ù ÕÖÅ ÎÁÂÒÁÌÉ. äÏÐÏÌÎÅÎÉÑ ÏÐÉÓÁÎÙ ×
1104Info-×ÅÒÓÉÉ ÒÕËÏ×ÏÄÓÔ×Á ÐÏ Emacs × ÒÁÚÄÅÌÅ "Completion".
1105
1106Dired ÐÏÚ×ÏÌÑÅÔ ×ÁÍ ÏÔÏÂÒÁÖÁÔØ ÓÐÉÓÏË ÆÁÊÌÏ× × ËÁÔÁÌÏÇÅ (Á ÔÁËÖÅ
1107ÐÏÄËÁÔÁÌÏÇÁÈ, × ÚÁ×ÉÓÉÍÏÓÔÉ ÏÔ ÎÁÓÔÒÏÊËÉ), ÐÅÒÅÍÅÝÁÔØÓÑ ÐÏ ÓÐÉÓËÕ ÆÁÊÌÏ×,
1108ÏÔËÒÙ×ÁÔØ ÉÈ, ÐÅÒÅÉÍÅÎÏ×Ù×ÁÔØ, ÕÄÁÌÑÔØ É ×ÙÐÏÌÎÑÔØ ÐÒÏÞÉÅ ÄÅÊÓÔ×ÉÑ ÎÁÄ
1109ÆÁÊÌÁÍÉ. Dired ÏÐÉÓÁÎ × Info-×ÅÒÓÉÉ ÒÕËÏ×ÏÄÓÔ×Á ÐÏ Emacs × ÒÁÚÄÅÌÅ "Dired".
1110
1111÷ ÒÕËÏ×ÏÄÓÔ×Å ÔÁËÖÅ ÏÐÉÓÁÎÙ ÐÒÏÞÉÅ ×ÏÚÍÏÖÎÏÓÔÉ Emacs.
1033 1112
1034 1113
1035* úáëìàþåîéå 1114* úáëìàþåîéå
1036------------ 1115------------
1037 1116
1038úÁÐÏÍÎÉÔÅ, ÞÔÏÂÙ ÓÏ×ÓÅÍ ×ÙÊÔÉ ÉÚ Emacs, ÉÓÐÏÌØÚÕÅÔÓÑ ÓÏÞÅÔÁÎÉÅ ËÌÁ×ÉÛ 1117úÁÐÏÍÎÉÔÅ, ÞÔÏ ÄÌÑ ÔÏÇÏ ÞÔÏÂÙ ÓÏ×ÓÅÍ ×ÙÊÔÉ ÉÚ Emacs, ÉÓÐÏÌØÚÕÅÔÓÑ ÓÏÞÅÔÁÎÉÅ
1039C-x C-c. á ÞÔÏÂÙ ×ÒÅÍÅÎÎÏ ×ÙÊÔÉ × ÏÂÏÌÏÞËÕ (shell) É ÐÏÔÏÍ ×ÅÒÎÕÔØÓÑ 1118ËÌÁ×ÉÛ C-x C-c. á ÞÔÏÂÙ ×ÒÅÍÅÎÎÏ ×ÙÊÔÉ × ÏÂÏÌÏÞËÕ (shell) É ÐÏÔÏÍ ×ÅÒÎÕÔØÓÑ
1040ÏÂÒÁÔÎÏ, ÉÓÐÏÌØÚÕÊÔÅ C-z. 1119ÏÂÒÁÔÎÏ, ÉÓÐÏÌØÚÕÊÔÅ C-z.
1041 1120
1042üÔÏÔ ÕÞÅÂÎÉË ÄÏÌÖÅÎ ÂÙÔØ ÐÏÎÑÔÅÎ ×ÓÅÍ ÎÏ×ÙÍ ÐÏÌØÚÏ×ÁÔÅÌÑÍ, ÎÏ ÅÓÌÉ ×Ù 1121üÔÏÔ ÕÞÅÂÎÉË ÄÏÌÖÅÎ ÂÙÔØ ÐÏÎÑÔÅÎ ×ÓÅÍ ÎÏ×ÙÍ ÐÏÌØÚÏ×ÁÔÅÌÑÍ, ÎÏ ÅÓÌÉ ×Ù
1043ÎÁÊÄÅÔÅ ÞÔÏ-ÎÉÂÕÄØ ÎÅÑÓÎÏÅ, ÎÅ ÎÕÖÎÏ ÓÉÄÅÔØ É ÐÏÒÉÃÁÔØ ÓÅÂÑ -- ÖÁÌÕÊÔÅÓØ! 1122ÎÁÊÄÅÔÅ ÞÔÏ-ÎÉÂÕÄØ ÎÅÑÓÎÏÅ, ÎÅ ÎÕÖÎÏ ÓÉÄÅÔØ É ÐÏÒÉÃÁÔØ ÓÅÂÑ -- ÖÁÌÕÊÔÅÓØ!
1044 1123
1045 1124
1046* COPYING 1125* õóìï÷éñ òáóðòïóôòáîåîéñ
1047--------- 1126-------------------------
1048 1127
1049üÔÏÔ ÕÞÅÂÎÉË ÐÒÏÉÚÏÛÅÌ ÉÚ ÄÌÉÎÎÏÊ ÓÅÒÉÉ ÕÞÅÂÎÉËÏ× Emacs, ÎÁÞÁÔÏÊ Ó ÏÄÎÁÖÄÙ 1128üÔÏÔ ÕÞÅÂÎÉË ÐÒÏÉÚÏÛÅÌ ÉÚ ÄÌÉÎÎÏÊ ÓÅÒÉÉ ÕÞÅÂÎÉËÏ× Emacs, ÎÁÞÁÔÏÊ Ó ÏÄÎÁÖÄÙ
1050ÎÁÐÉÓÁÎÎÏÇÏ by Stuart Cracraft ÄÌÑ ÏÒÉÇÉÎÁÌØÎÏÇÏ Emacs. 1129ÎÁÐÉÓÁÎÎÏÇÏ Stuart Cracraft ÄÌÑ ÏÒÉÇÉÎÁÌØÎÏÇÏ Emacs.
1051 1130
1052üÔÁ ×ÅÒÓÉÑ ÕÞÅÂÎÉËÁ, ËÁË É GNU Emacs, ÚÁÝÉÝÅÎÁ ÐÒÁ×ÁÍÉ ËÏÐÉÒÏ×ÁÎÉÑ 1131üÔÁ ×ÅÒÓÉÑ ÕÞÅÂÎÉËÁ, ËÁË É GNU Emacs, ÚÁÝÉÝÅÎÁ ÐÒÁ×ÁÍÉ ËÏÐÉÒÏ×ÁÎÉÑ
1053(copyrighted), É ÐÒÉÈÏÄÉÔ Ó ÏÇÒÁÎÉÞÅÎÉÑÍÉ ÒÁÓÐÒÏÓÔÒÁÎÅÎÉÑ ËÏÐÉÊ ÓÏ 1132(copyrighted), É ÐÒÉÈÏÄÉÔ Ó ÏÇÒÁÎÉÞÅÎÉÑÍÉ ÒÁÓÐÒÏÓÔÒÁÎÅÎÉÑ ËÏÐÉÊ ÓÏ
1054ÓÌÅÄÕÀÝÉÍÉ ÓÏÇÌÁÛÅÎÉÑÍÉ: 1133ÓÌÅÄÕÀÝÉÍÉ ÓÏÇÌÁÛÅÎÉÑÍÉ:
1055 1134
1056Copyright (c) 1985, 1996 Free Software Foundation 1135Copyright (c) 1985, 1996, 1998, 2001, 2002, 2005 Free Software Foundation
1057 1136
1058 Permission is granted to anyone to make or distribute verbatim copies 1137 Permission is granted to anyone to make or distribute verbatim copies
1059 of this document as received, in any medium, provided that the 1138 of this document as received, in any medium, provided that the
@@ -1066,16 +1145,14 @@ Copyright (c) 1985, 1996 Free Software Foundation
1066 under the above conditions, provided also that they 1145 under the above conditions, provided also that they
1067 carry prominent notices stating who last altered them. 1146 carry prominent notices stating who last altered them.
1068 1147
1069õÓÌÏ×ÉÑ ËÏÐÉÒÏ×ÁÎÉÑ ÓÁÍÏÇÏ Emacs ÂÏÌÅÅ ÓÌÏÖÎÙÅ, ÎÏ × ÔÏÍ ÖÅ ÄÕÈÅ. 1148õÓÌÏ×ÉÑ ËÏÐÉÒÏ×ÁÎÉÑ ÓÁÍÏÇÏ Emacs ÂÏÌÅÅ ÓÌÏÖÎÙÅ, ÎÏ ÐÒÉÍÅÒÎÏ × ÔÏÍ ÖÅ ÄÕÈÅ.
1070ðÏÖÁÌÕÊÓÔÁ, ÐÒÏÞÔÉÔÅ ÆÁÊÌ COPYING É ÚÁÔÅÍ ÄÁÊÔÅ ËÏÐÉÀ GNU Emacs ×ÁÛÉÍ 1149ðÏÖÁÌÕÊÓÔÁ, ÐÒÏÞÔÉÔÅ ÆÁÊÌ COPYING É ÚÁÔÅÍ ÄÁÊÔÅ ËÏÐÉÀ GNU Emacs ×ÁÛÉÍ
1071ÄÒÕÚØÑÍ. ðÏÍÏÇÉÔÅ ÕÎÉÞÔÏÖÉÔØ ÏÂÓÔÒÕËÃÉÏÎÉÚÍ × ÏÂÌÁÓÔÉ ÐÒÏÇÒÁÍÍÎÏÇÏ 1150ÄÒÕÚØÑÍ. ðÏÍÏÇÉÔÅ ÕÎÉÞÔÏÖÉÔØ ÏÂÓÔÒÕËÃÉÏÎÉÚÍ × ÏÂÌÁÓÔÉ ÐÒÏÇÒÁÍÍÎÏÇÏ
1072ÏÂÅÓÐÅÞÅÎÉÑ ("×ÌÁÄÅÎÉÅ"), ÉÓÐÏÌØÚÕÑ, ÓÏÚÄÁ×ÁÑ É ÒÁÓÐÒÏÓÔÒÁÎÑÑ Ó×ÏÂÏÄÎÏÅ 1151ÏÂÅÓÐÅÞÅÎÉÑ ("×ÌÁÄÅÎÉÅ"), ÉÓÐÏÌØÚÕÑ, ÓÏÚÄÁ×ÁÑ É ÒÁÓÐÒÏÓÔÒÁÎÑÑ Ó×ÏÂÏÄÎÏÅ
1073ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ! 1152ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ!
1074 1153
1075// ÚÁÍÅÞÁÎÉÑ, ÉÓÐÒÁ×ÌÅÎÉÑ ÏÛÉÂÏË Ó ÎÅÔÅÒÐÅÎÉÅÍ ÖÄÕ ÐÏ ÁÄÒÅÓÕ ottalex@narod.ru 1154// ÚÁÍÅÞÁÎÉÑ, ÉÓÐÒÁ×ÌÅÎÉÑ ÏÛÉÂÏË Ó ÖÄÕ ÐÏ ÁÄÒÅÓÕ alexott@gmail.com.
1076// Alex Ott. 1155// Alex Ott.
1077// âÏÌØÛÏÅ ÓÐÁÓÉÂÏ ÷ÌÁÄÉÍÉÒÕ âÏÒÍÏÔÏ×Õ, ÎÁ ÂÁÚÅ ÐÅÒÅ×ÏÄÁ ËÏÔÏÒÏÇÏ ÂÙÌ ÓÄÅÌÁÎ
1078// ÜÔÏÔ ÐÅÒÅ×ÏÄ
1079 1156
1080;;; Local Variables: 1157;;; Local Variables:
1081;;; coding: cyrillic-koi8 1158;;; coding: cyrillic-koi8
diff --git a/etc/e/eterm b/etc/e/eterm
index 0fcb95170ee..09d184fd762 100644
--- a/etc/e/eterm
+++ b/etc/e/eterm
Binary files differ
diff --git a/etc/e/eterm.ti b/etc/e/eterm.ti
index 2b600df0a12..8f88f0e6f88 100644
--- a/etc/e/eterm.ti
+++ b/etc/e/eterm.ti
@@ -1,4 +1,4 @@
1eterm, 1eterm|Emacs term.el terminal emulator term-protocol-version 0.96,
2 colors#8, 2 colors#8,
3 cols#80, 3 cols#80,
4 lines#24, 4 lines#24,
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 75822754e85..c95e169bebc 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,11 +1,590 @@
12005-05-05 Nick Roberts <nickrob@snap.net.nz>
2
3 * progmodes/cmacexp.el (c-macro-preprocessor): Update for BSD and
4 use gcc instead of cpp.
5
6 * progmodes/gdb-ui.el (gdb-cpp-define-alist-flags): New variable.
7 (gdb-create-define-alist): Use. it.
8 (gdb-cpp-define-alist-program): Update for MS-DOS?
9
102005-05-04 Nick Roberts <nickrob@snap.net.nz>
11
12 * progmodes/cmacexp.el (c-macro-preprocessor): Update for Mac OSX.
13
142005-05-03 Ulf Jasper <ulf.jasper@web.de>
15
16 * calendar/icalendar.el (icalendar-version): Now at 0.12.
17 (icalendar-duration-correction): Remove.
18 (icalendar--get-event-properties): Split result at commas.
19 (icalendar--decode-isoduration): New optional argument
20 DURATION-CORRECTION.
21 (icalendar--convert-ordinary-to-ical, icalendar--convert-sexp-to-ical)
22 (icalendar--convert-yearly-to-ical, icalendar--convert-weekly-to-ical)
23 (icalendar--convert-block-to-ical, icalendar--convert-float-to-ical)
24 (icalendar--convert-date-to-ical, icalendar--convert-cyclic-to-ical)
25 (icalendar--convert-anniversary-to-ical): New functions, extracted
26 from icalendar-export-region, with bug fixes.
27 (icalendar-export-region): Use the above functions.
28 (icalendar-import-buffer): Check before saving diary file.
29 (icalendar--convert-recurring-to-diary)
30 (icalendar--convert-non-recurring-all-day-to-diary)
31 (icalendar--convert-non-recurring-not-all-day-to-diary): New functions,
32 extracted from icalendar--convert-ical-to-diary, with bug fixes.
33 (icalendar--convert-ical-to-diary): Use the above functions.
34
352005-05-03 Nick Roberts <nickrob@snap.net.nz>
36
37 * progmodes/cc-mode.el (cc-define-alist, cc-create-define-alist):
38 Remove these recent additions.
39 (c-mode): Restore to before 2005-04-28.
40
41 * progmodes/cc-vars.el (cc-define-list-program): Remove this
42 recent addition.
43
44 * progmodes/gdb-ui.el (gdb-cpp-define-alist-program)
45 (gdb-define-alist): New variables.
46 (gdb-create-define-alist): New function.
47 (gdb-set-gud-minor-mode-1): Handle gdb-define-alist.
48 (gdb-source, gdb-memory-set-repeat-count): Replace string-to-int
49 with string-to-number.
50 (gdb-reset): Kill gdb-define-alist. Move assignments outside loop.
51
52 * progmodes/gud.el: Replace string-to-int with string-to-number.
53 (gud-find-file): Handle gdb-define-alist.
54
55 * tooltip.el (tooltip-gud-tips): Use gdb-define-alist.
56
572005-05-02 Jay Belanger <belanger@truman.edu>
58
59 * calc/calc-aent.el (math-read-token):
60 * calc/calc-bin.el (calc-word-size):
61 * calc/calc-ext.el (calc-read-number-fancy):
62 * calc/calc-forms.el (calc-time, calc-date-notation, math-this-year)
63 (math-parse-date, math-parse-standard-date, calcFunc-tzone):
64 * calc/calc-frac.el (calc-over-notation):
65 * calc/calc-graph.el (calc-graph-plot, calc-graph-set-styles)
66 (calc-graph-num-points, calc-graph-init):
67 * calc/calc-prog.el (calc-read-parse-table-part)
68 (calc-edit-macro-repeats):
69 * calc/calc-yank.el (calc-do-grab-rectangle):
70 * calc/calc.el (calcDigit-key, math-read-number, math-read-bignum):
71 Replace `string-to-int' by `string-to-number'.
72
732005-05-02 Kim F. Storm <storm@cua.dk>
74
75 * kmacro.el: Use executing-kbd-macro-index variable.
76
772005-05-02 Thien-Thi Nguyen <ttn@gnu.org>
78
79 * net/rlogin.el (rlogin-parse-words): Delete func.
80 (rlogin): Use split-string, not rlogin-parse-words.
81 Also, if there are option-like elements in the parsed args,
82 take the host to be the first arg immediately following them.
83 Suggested by Michael Mauger.
84
852005-05-01 Luc Teirlinck <teirllm@auburn.edu>
86
87 * subr.el (executing-macro): Use `define-obsolete-variable-alias'.
88
892005-05-02 Nick Roberts <nickrob@snap.net.nz>
90
91 * progmodes/cc-mode.el (cc-create-define-alist): Use a shell.
92 (cc-mode-cpp-program): Rename to cc-define-list-program and
93 move to cc-vars.el.
94
95 * progmodes/cc-vars.el (cc-define-list-program):
96 Change to "gcc -E -dM -". Make customizable.
97
982005-05-02 Kim F. Storm <storm@cua.dk>
99
100 * emulation/cua-base.el: Fix check for CUA-mode if no init file.
101
1022005-05-02 Nick Roberts <nickrob@snap.net.nz>
103
104 * progmodes/cc-mode.el (cc-mode-cpp-program): Change to "gcc -E".
105
106 * international/mule-util.el (truncate-string): Remove alias and
107 obsolete declaration.
108
109 * international/mule-cmds.el (update-iso-coding-systems):
110 Remove alias and obsolete declaration.
111
112 * international/mule.el (coding-system-parent): Remove alias and
113 obsolete declaration.
114
115 * subr.el (define-function, sref): Remove aliases and obsolete
116 declarations.
117 (chars-in-region): Remove obsolete declaration.
118
1192005-05-01 Richard M. Stallman <rms@gnu.org>
120
121 * info.el (Info-mode): Set widen-automatically to nil, locally.
122
123 * simple.el (widen-automatically): New variable.
124 (pop-global-mark): Obey widen-automatically.
125
1262005-05-01 Dan Nicolaescu <dann@ics.uci.edu>
127
128 * term/xterm.el (function-key-map): Call substitute-key-definition
129 before the keymap size is increased by a lot of define-key calls.
130
1312005-05-01 Richard M. Stallman <rms@gnu.org>
132
133 * subr.el (add-to-invisibility-spec, remove-from-invisibility-spec):
134 Rename ARG to ELEMENT. Doc fix.
135
1362005-05-01 Nick Roberts <nickrob@snap.net.nz>
137
138 * allout.el (allout-exposure): Remove macro and obsolete declaration.
139 Remove references to allout-exposure/change to allout-new-exposure.
140
141 * emacs-lisp/bytecomp.el (dot, dot-min, dot-max): Don't create
142 bytecode symbols.
143
144 * subr.el (dot, dot-marker, dot-min, dot-max, buffer-flush-undo)
145 (compiled-function-p, focus-frame, unfocus-frame):
146 Remove aliases and obsolete declarations.
147 Back out inadvertant changes from previous commit.
148
1492005-05-01 Luc Teirlinck <teirllm@auburn.edu>
150
151 * files.el (require-final-newline): Make Custom tags consistent
152 with mode-require-final-newline.
153 (mode-require-final-newline): Doc fix.
154
1552005-05-01 Lute Kamstra <lute@gnu.org>
156
157 * international/latexenc.el (latexenc-find-file-coding-system):
158 Fix regular expressions. Suggested by David Kastrup <dak@gnu.org>
159 and Stefan Monnier <monnier@iro.umontreal.ca>.
160
1612005-05-01 Nick Roberts <nickrob@snap.net.nz>
162
163 * subr.el (string-to-int): Make obsolete.
164
1652005-04-30 Richard M. Stallman <rms@gnu.org>
166
167 * simple.el (next-error-overlay-arrow-position): Turn off, for ttys.
168
169 * loadup.el: load jka-comp-hook.
170
171 * jka-compr.el: Many functions and vars moved to jka-compr-hook.el.
172 (jka-compr-handler): Add autoload. `put' calls moved
173 to jka-compr-hook.el.
174 (compression, jka-compr): defgroups moved to jka-compr-hook.el.
175 (jka-compr-inhibit): Autoload.
176
177 * jka-comp-hook.el: New file.
178 Enable the mode by default.
179
180 * files.el (backup-buffer-copy): Use copy-file instead
181 of write-region, and put back the 'excl.
182
1832005-04-30 Chong Yidong <cyd@stupidchicken.com>
184
185 * progmodes/flymake.el (flymake-split-string)
186 (flymake-split-string, flymake-log, flymake-pid-to-names)
187 (flymake-reg-names, flymake-get-source-buffer-name)
188 (flymake-unreg-names, flymake-add-line-err-info)
189 (flymake-add-err-info): Clarify docstrings.
190 (flymake-popup-menu, flymake-make-emacs-menu)
191 (flymake-make-xemacs-menu): Add docstrings.
192 (flymake-get-buffer-*, flymake-set-buffer-*): Functions deleted.
193 Set variables directly throughout.
194
1952005-04-30 Nick Roberts <nickrob@snap.net.nz>
196
197 * progmodes/cc-mode.el (cc-create-define-alist): Check that file
198 exists. Initialise cc-define-alist.
199 (c-mode): Add cc-create-define-alist locally to after-save-hook.
200 If there is no file (Macroexpansion) don't create an alist.
201
2022005-04-29 Sam Steingold <sds@gnu.org>
203
204 * progmodes/cc-mode.el (cc-mode-cpp-program): New user variable.
205 (cc-create-define-alist): Use it instead of the hard-coded string.
206
2072005-04-29 Stefan Monnier <monnier@iro.umontreal.ca>
208
209 * international/mule-conf.el (file-coding-system-alist): Fix regexp
210 for latexenc.
211
2122005-04-29 Lute Kamstra <lute@gnu.org>
213
214 * emacs-lisp/generic.el: Improve commentary section.
215 (define-generic-mode): Improve docstring.
216
2172005-04-29 Carsten Dominik <dominik@science.uva.nl>
218
219 * textmodes/org.el (many places): Change to quiet the byte compiler.
220 (org-prefix-format-compiled): New variable.
221 (org-compile-prefix-format): New function.
222 (org-timeline, org-agenda, org-diary): Call org-compile-prefix-format.
223 (org-agenda-prefix-format,org-timeline-prefix-format): New options.
224 (org-agenda-get-scheduled): Check if file is opened in `org-mode'.
225 (org-get-entries-from-diary): Use `org-get-time-of-day' for
226 consistency with entries from `org-mode' files.
227 (org-get-time-of-day): Fix bug with partial matches early in a line.
228 (org-non-link-chars): New constant.
229 (org-link-regexp): Respect `org-non-link-chars'.
230 (org-agenda-day-view): Remove command.
231 (org-agenda-toggle-week-view): Rename from `org-agenda-week-view'.
232 (org-follow-bbdb-link, org-store-link): Search also company field.
233 (org-highlight-overlay): New variable.
234 (org-highlight, org-unhighlight): New functions.
235 (org-agenda-mode): Add pre-command-hook to remove highlight.
236 (org-evaluate-time-range): Behavior depends upon whether time stamp
237 contains a time or not.
238 (org-show-subtree, org-show-entry): New functions.
239 (org-agenda-cleanup-fancy-diary): Remove empty lines.
240
2412005-04-28 Luc Teirlinck <teirllm@auburn.edu>
242
243 * comint.el (comint-output-filter-functions): Add autoload cookie.
244
2452005-04-28 Kim F. Storm <storm@cua.dk>
246
247 * ido.el (ido-everywhere): Fix last change.
248
2492005-04-28 Arne J,Ax(Brgensen <arne@arnested.dk>
250
251 * international/latexenc.el: New file.
252 * international/mule-conf.el (file-coding-system-alist): For .tex,
253 .ltx, .dtx and .drv extensions, use `latexenc-find-file-coding-system'.
254
2552005-04-28 Lute Kamstra <lute@gnu.org>
256
257 * font-lock.el (font-lock-add-keywords)
258 (font-lock-remove-keywords): Clarify docstring.
259 (font-lock-keywords-alist, font-lock-removed-keywords-alist):
260 Don't start docstrings with a `*'.
261 (font-lock-update-removed-keyword-alist): Give it a docstring.
262
263 * generic-x.el: Update commentary section.
264 Only require font-lock when compiling.
265 Define all modes conditionally.
266 Place all generic modes in the generic-x-modes customization group.
267 (generic-x-modes): New customization group.
268 (generic-default-modes, generic-mswindows-modes)
269 (generic-unix-modes, generic-other-modes): New constants.
270 (generic-define-mswindows-modes, generic-define-unix-modes):
271 Update docstrings. Make them obsolete.
272 (generic-extras-enable-list): New default value. Update docstring.
273 Improve :type. Change :set function.
274 (bat-generic-mode-syntax-table, rul-generic-mode-syntax-table):
275 Fix docstring.
276
277 * emacs-lisp/generic.el (generic-mode-internal):
278 Simplify font-lock-defaults.
279 (define-generic-mode): Fix docstring.
280
2812005-04-28 Stefan Monnier <monnier@iro.umontreal.ca>
282
283 * progmodes/grep.el (grep-mode-font-lock-keywords): Use the
284 font-lock-face property to highlight matches.
285
2862005-04-28 Nick Roberts <nickrob@snap.net.nz>
287
288 * progmodes/cc-mode.el: (cc-create-define-alist): New function.
289 (cc-define-alist): New variable.
290 (c-mode): Make it local and initialise it.
291
292 * progmodes/gdb-ui.el (gdb-active-process): New variable.
293 (gdb-exited): New function.
294 (gdb-annotation-rules): Use it.
295 (gdb-starting): Set gdb-active-process to t.
296 (gdb-stopping): Amend doc string.
297 (gdb-reset): Set gdb-active-process to nil.
298
299 * tooltip.el (tooltip-gud-tips): Show the associated #define
300 directives when a C program under GDB is not executing.
301
3022005-04-27 Stefan Monnier <monnier@iro.umontreal.ca>
303
304 * progmodes/cperl-mode.el (cperl-mode): Don't precompile the
305 font-lock-fontify-syntactic-keywords.
306
307 * font-lock.el (font-lock-default-fontify-region): Don't force
308 parse-sexp-lookup-properties to nil.
309
3102005-04-27 Alexander Klimov <alserkli@inbox.ru> (tiny change)
311
312 * man.el (man-mode-syntax-table): Set up `:' to have
313 word-constituent syntax.
314
3152005-04-27 Lute Kamstra <lute@gnu.org>
316
317 * novice.el (disable-command): Don't add spurious newlines to the
318 init file. Reported by Dan Jacobson <jidanni@jidanni.org>.
319
3202005-04-26 Jay Belanger <belanger@truman.edu>
321
322 * calc/calc-yank.el (calc-edit-finish): Make sure there is more
323 than one window before deleting window.
324
3252005-04-26 Luc Teirlinck <teirllm@auburn.edu>
326
327 * shell.el (shell-prompt-pattern): Doc fix.
328 (shell-mode): Set paragraph-separate buffer locally to "\\'".
329
330 * comint.el (comint-prompt-regexp, comint-get-old-input)
331 (comint-use-prompt-regexp)
332 (comint-use-prompt-regexp-instead-of-fields)
333 (comint-replace-by-expanded-history, comint-send-input)
334 (comint-output-filter, comint-get-old-input-default)
335 (comint-line-beginning-position, comint-bol, comint-show-output)
336 (comint-backward-matching-input, comint-forward-matching-input)
337 (comint-next-prompt, comint-previous-prompt):
338 Rename `comint-use-prompt-regexp-instead-of-fields' to
339 `comint-use-prompt-regexp'. Keep old name as alias and declare
340 obsolete.
341 (comint-use-prompt-regexp): Shorten first line of doc string.
342
343 * ielm.el (inferior-emacs-lisp-mode): Adapt to above name change.
344 Set paragraph-separate buffer locally to "\\'".
345
346 * hippie-exp.el (try-expand-line, try-expand-line-all-buffers):
347 Adapt to above name change.
348
349 * net/net-utils.el (nslookup-prompt-regexp, ftp-prompt-regexp)
350 (smbclient-prompt-regexp): Ditto.
351
352 * progmodes/inf-lisp.el (inferior-lisp-prompt): Ditto.
353
3542005-04-27 Nick Roberts <nickrob@snap.net.nz>
355
356 * progmodes/gdb-ui.el (gdb-location-alist): Rename from
357 gdb-location-list.
358 Break lines that are over 80 characters wide.
359
3602005-04-26 Stefan Monnier <monnier@iro.umontreal.ca>
361
362 * pcvs-info.el (cvs-fileinfo->full-path, cvs-display-full-path):
363 New fun and var, to preserve compatibility.
364
365 * pcvs.el, pcvs-info.el: Rename "full-path" -> "full-name".
366
3672005-04-26 Dominique de Waleffe <ddw@missioncriticalit.com> (tiny change)
368
369 * pcvs-info.el (cvs-fileinfo->backup-file): Don't pass the full file
370 name to file-newer-than-file-p.
371
3722005-04-26 Richard M. Stallman <rms@gnu.org>
373
374 * simple.el (line-move-1): Avoid using vertical-motion in easy cases.
375
376 * progmodes/python.el (python-mode):
377 Use new name eldoc-documentation-function.
378
379 * hexl.el (hexl-mode): Use new name eldoc-documentation-function.
380
381 * emacs-lisp/eldoc.el (eldoc-mode): Doc fix.
382 (eldoc-documentation-function):
383 Rename from eldoc-print-current-symbol-info-function. Calls changed.
384
3852005-04-26 Nick Roberts <nickrob@snap.net.nz>
386
387 * emacs-lisp/byte-run.el (define-obsolete-function-alias): New macro.
388
3892005-04-25 Dan Nicolaescu <dann@ics.uci.edu>
390
391 * term/xterm.el (function-key-map): Fix strings for
392 {C,S,A,C-S}-f[1-4]. Use substitute-key-definition to bind
393 {C,S,A,C-S}-{f1-f12}.
394
3952005-04-26 Kenichi Handa <handa@m17n.org>
396
397 * international/mule-cmds.el (select-safe-coding-system):
398 Fix previous change.
399
4002005-04-26 Lute Kamstra <lute@gnu.org>
401
402 * emacs-lisp/easy-mmode.el (define-minor-mode): Fix docstring.
403
404 * font-lock.el (font-lock-fontify-region-function): Fix docstring.
405 (font-lock-comment-delimiter-face): Ditto.
406
407 * calc/calc.el (calc-trail-mode): Don't set font-lock-defaults.
408
4092005-04-25 Jay Belanger <belanger@truman.edu>
410
411 * calc/calc-help.el (calc-view-news): Let-bind inhibit-read-only
412 to t while inserting information; use help-mode.
413
4142005-04-25 Dan Nicolaescu <dann@ics.uci.edu>
415
416 * term.el (ansi-term-color-vector): Use the xterm colors.
417 (term-raw-map): Don't add mappings for \eO and \e[. Map deletechar.
418
4192005-04-25 Lute Kamstra <lute@gnu.org>
420
421 * font-core.el (font-lock-defaults): Fix docstring.
422
423 * font-lock.el (font-lock-syntactic-face-function): Fix docstring.
424
4252005-04-25 Kenichi Handa <handa@m17n.org>
426
427 * international/mule-cmds.el (select-safe-coding-system):
428 Don't check consistency with coding: spec, etc if raw-text or
429 no-conversion was found to be safe.
430
4312005-04-24 Richard M. Stallman <rms@gnu.org>
432
433 * mail/sendmail.el (mail-font-lock-keywords): Match any number of
434 citation markers at start of each line.
435
436 * mail/rmail.el (rmail-font-lock-keywords): Match any number of
437 citation markers at start of each line.
438
439 * font-lock.el (font-lock-comment-delimiter-face): Doc fix.
440
441 * files.el (mode-require-final-newline): Fix previous change.
442 (require-final-newline): Fix type label.
443
4442005-04-24 Glenn Morris <gmorris@ast.cam.ac.uk>
445
446 * progmodes/f90.el (f90-calculate-indent): Fix treatment of first
447 statement in buffer (broken by 2004-11-24 change).
448
4492005-04-24 Kim F. Storm <storm@cua.dk>
450
451 * ido.el (ido-everywhere): Save and restore old read-buffer-function
452 and read-file-name-function values. Don't overwrite existing
453 non-nil values if ido-mode is enabled without ido-everywhere.
454
4552005-04-24 Luc Teirlinck <teirllm@auburn.edu>
456
457 * files.el (mode-require-final-newline): Minor doc fix.
458
4592005-04-24 Eli Zaretskii <eliz@gnu.org>
460
461 * subr.el (syntax-after): Doc fix.
462 (syntax-class): If argument is nil, return nil. Mask off upper 16
463 bits, not 8 bits.
464
465 * files.el (mode-require-final-newline): Doc fix.
466 (backup-buffer-copy): Fix last change.
467
4682005-04-24 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
469
470 * term/mac-win.el: Require select. Set selection-coding-system to
471 mac-system-coding-system. Call menu-bar-enable-clipboard.
472 (x-last-selected-text-clipboard, x-last-selected-text-primary)
473 (x-select-enable-clipboard): New variables.
474 (x-select-text, x-get-selection, x-selection-value)
475 (x-get-selection-value, mac-select-convert-to-string)
476 (mac-services-open-file, mac-services-open-selection)
477 (mac-services-insert-text): New functions.
478 (CLIPBOARD, FIND): Put mac-scrap-name property.
479 (com.apple.traditional-mac-plain-text, public.utf16-plain-text)
480 (public.tiff): Put mac-ostype property.
481 (selection-converter-alist): Add entries for them.
482 (mac-application-menu-map): New keymap.
483 (interprogram-cut-function, interprogram-paste-function): Set to
484 x-select-text and x-get-selection-value, respectively.
485 (split-window-keep-point): Set to t.
486
4872005-04-23 Richard M. Stallman <rms@gnu.org>
488
489 * files.el (read-directory-name): Always pass non-nil
490 DEFAULT-FILENAME arg to read-file-name.
491 (backup-buffer-copy, basic-save-buffer-2): Take care against
492 writing thru an unexpected existing symlink.
493 (revert-buffer): In indirect buffer, revert the base buffer.
494 (magic-mode-alist): Doc fix.
495 (buffer-stale-function): Doc fix.
496 (minibuffer-with-setup-hook): Avoid warning.
497 (mode-require-final-newline): Doc and custom fix.
498
499 * follow.el (follow-end-of-buffer): Use with-no-warnings.
500
501 * font-lock.el (font-lock-comment-face): On terminals with few colors,
502 use the default appearance.
503 (font-lock-comment-delimiter-face): New face, new variable.
504
505 * imenu.el (imenu--generic-function): The official position of a
506 definition is the start of the line that BEG is in.
507
508 * midnight.el (midnight-timer): Move defvar up.
509
510 * mouse.el (mouse-drag-region-1): Delete some debugging code.
511
512 * saveplace.el (save-place-to-alist): Use with-no-warnings.
513
514 * startup.el (command-line): Use with-no-warnings.
515
516 * window.el (window-size-fixed): New defvar.
517
518 * emacs-lisp/easymenu.el (easy-menu-do-define): Use defalias, not fset.
519
520 * mail/rmail.el (rmail-font-lock-keywords):
521 Use font-lock-comment-delimiter-face.
522
523 * mail/sendmail.el (mail-font-lock-keywords):
524 Use font-lock-comment-delimiter-face.
525
526 * progmodes/compile.el (next-error-highlight-timer): New defvar.
527
5282005-04-23 SAITO Takuya <tabmore@rivo.mediatti.net> (tiny change)
529
530 * progmodes/compile.el (compilation-mode-font-lock-keywords):
531 Specify t for LAXMATCH when matching directories.
532 Save match data around compilation-compat-error-properties form.
533
5342005-04-23 David Kastrup <dak@gnu.org>
535
536 * textmodes/tex-mode.el (TeX-mode, plain-TeX-mode, LaTeX-mode):
537 Mention that the autoloaded aliases should be kept for AUCTeX.
538
5392005-04-23 Andreas Schwab <schwab@suse.de>
540
541 * isearch.el (isearch-forward): Doc fix.
542
5432005-04-23 Eli Zaretskii <eliz@gnu.org>
544
545 * jit-lock.el (jit-lock-stealth-time): Change default value to 16.
546 (jit-lock-stealth-nice): Change default value to 0.5.
547
5482005-04-23 Eric Hanchrow <offby1@blarg.net> (tiny change)
549
550 * abbrev.el (write-abbrev-file): Write table entries in
551 alphabetical order by table name.
552
5532005-04-22 Kim F. Storm <storm@cua.dk>
554
555 * ido.el (ido-read-internal): Fix `list' completion.
556
5572005-04-22 Kenichi Handa <handa@m17n.org>
558
559 * recentf.el (recentf-save-file-coding-system): New variable.
560 (recentf-save-list): Encode the file by
561 recentf-save-file-coding-system and add coding: tag.
562
5632005-04-22 Nick Roberts <nickrob@snap.net.nz>
564
565 * emacs-lisp/byte-run.el (define-obsolete-variable-alias): New macro.
566
5672005-04-21 Lute Kamstra <lute@gnu.org>
568
569 * loadhist.el (unload-feature): Don't remove a function from hooks
570 if it is about to be restored to an autoload . Remove functions
571 that will become unbound from auto-mode-alist. Simplify the code.
572
573 * subr.el (assq-delete-all): New implementation that is linear,
574 not quadratic. Suggested by David Kastrup <dak@gnu.org>.
575 (rassq-delete-all): New function.
576
577 * menu-bar.el (menu-bar-options-save, menu-bar-showhide-menu):
578 Add size-indication-mode.
579
12005-04-21 Kenichi Handa <handa@m17n.org> 5802005-04-21 Kenichi Handa <handa@m17n.org>
2 581
3 * international/mule-cmds.el: Add autoload for widget-value in 582 * international/mule-cmds.el: Add autoload for widget-value in
4 eval-when-compile 583 eval-when-compile.
5 584
62005-04-21 Nick Roberts <nickrob@snap.net.nz> 5852005-04-21 Nick Roberts <nickrob@snap.net.nz>
7 586
8 * menu-bar.el (menu-bar-options-save, menu-bar-showhide-menu): 587 * menu-bar.el (menu-bar-options-save, menu-bar-showhide-menu):
9 Add tooltip-mode. 588 Add tooltip-mode.
10 589
11 * bindings.el (mode-line-mode-menu): Remove tooltip-mode. 590 * bindings.el (mode-line-mode-menu): Remove tooltip-mode.
@@ -372,8 +951,8 @@
3722005-04-11 Rajesh Vaidheeswarran <rv@gnu.org> 9512005-04-11 Rajesh Vaidheeswarran <rv@gnu.org>
373 952
374 * whitespace.el (whitespace-buffer-leading) 953 * whitespace.el (whitespace-buffer-leading)
375 (whitespace-buffer-trailing): Revert the incorrect test 954 (whitespace-buffer-trailing): Revert the incorrect test inversion.
376 inversion. However, fix the highlight area for the leading and 955 However, fix the highlight area for the leading and
377 trailing whitespaces to show space. 956 trailing whitespaces to show space.
378 957
3792005-04-11 Rajesh Vaidheeswarran <rv@gnu.org> 9582005-04-11 Rajesh Vaidheeswarran <rv@gnu.org>
diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index aa4249d014e..711e8e2ebe9 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -92,11 +92,11 @@ Mark is set after the inserted text."
92 (interactive) 92 (interactive)
93 (push-mark 93 (push-mark
94 (save-excursion 94 (save-excursion
95 (let ((tables abbrev-table-name-list)) 95 (let ((tables abbrev-table-name-list))
96 (while tables 96 (while tables
97 (insert-abbrev-table-description (car tables) t) 97 (insert-abbrev-table-description (car tables) t)
98 (setq tables (cdr tables)))) 98 (setq tables (cdr tables))))
99 (point)))) 99 (point))))
100 100
101(defun list-abbrevs (&optional local) 101(defun list-abbrevs (&optional local)
102 "Display a list of defined abbrevs. 102 "Display a list of defined abbrevs.
@@ -168,23 +168,23 @@ the ones defined from the buffer now."
168 (interactive "P") 168 (interactive "P")
169 (if arg (kill-all-abbrevs)) 169 (if arg (kill-all-abbrevs))
170 (save-excursion 170 (save-excursion
171 (goto-char (point-min)) 171 (goto-char (point-min))
172 (while (and (not (eobp)) (re-search-forward "^(" nil t)) 172 (while (and (not (eobp)) (re-search-forward "^(" nil t))
173 (let* ((buf (current-buffer)) 173 (let* ((buf (current-buffer))
174 (table (read buf)) 174 (table (read buf))
175 abbrevs name hook exp count sys) 175 abbrevs name hook exp count sys)
176 (forward-line 1) 176 (forward-line 1)
177 (while (progn (forward-line 1) 177 (while (progn (forward-line 1)
178 (not (eolp))) 178 (not (eolp)))
179 (setq name (read buf) count (read buf)) 179 (setq name (read buf) count (read buf))
180 (if (equal count '(sys)) 180 (if (equal count '(sys))
181 (setq sys t count (read buf))) 181 (setq sys t count (read buf)))
182 (setq exp (read buf)) 182 (setq exp (read buf))
183 (skip-chars-backward " \t\n\f") 183 (skip-chars-backward " \t\n\f")
184 (setq hook (if (not (eolp)) (read buf))) 184 (setq hook (if (not (eolp)) (read buf)))
185 (skip-chars-backward " \t\n\f") 185 (skip-chars-backward " \t\n\f")
186 (setq abbrevs (cons (list name exp hook count sys) abbrevs))) 186 (setq abbrevs (cons (list name exp hook count sys) abbrevs)))
187 (define-abbrev-table table abbrevs))))) 187 (define-abbrev-table table abbrevs)))))
188 188
189(defun read-abbrev-file (&optional file quietly) 189(defun read-abbrev-file (&optional file quietly)
190 "Read abbrev definitions from file written with `write-abbrev-file'. 190 "Read abbrev definitions from file written with `write-abbrev-file'.
@@ -201,7 +201,7 @@ Optional second argument QUIETLY non-nil means don't display a message."
201Optional argument FILE is the name of the file to read; 201Optional argument FILE is the name of the file to read;
202it defaults to the value of `abbrev-file-name'. 202it defaults to the value of `abbrev-file-name'.
203Does not display any message." 203Does not display any message."
204 ;(interactive "fRead abbrev file: ") 204 ;(interactive "fRead abbrev file: ")
205 (read-abbrev-file file t)) 205 (read-abbrev-file file t))
206 206
207(defun write-abbrev-file (&optional file) 207(defun write-abbrev-file (&optional file)
@@ -221,7 +221,17 @@ specified in `abbrev-file-name' is used."
221 (let ((coding-system-for-write 'emacs-mule)) 221 (let ((coding-system-for-write 'emacs-mule))
222 (with-temp-file file 222 (with-temp-file file
223 (insert ";;-*-coding: emacs-mule;-*-\n") 223 (insert ";;-*-coding: emacs-mule;-*-\n")
224 (dolist (table abbrev-table-name-list) 224 (dolist (table
225 ;; We sort the table in order to ease the automatic
226 ;; merging of different versions of the user's abbrevs
227 ;; file. This is useful, for example, for when the
228 ;; user keeps their home directory in a revision
229 ;; control system, and is therefore keeping multiple
230 ;; slightly-differing copies loosely synchronized.
231 (sort (copy-sequence abbrev-table-name-list)
232 (lambda (s1 s2)
233 (string< (symbol-name s1)
234 (symbol-name s2)))))
225 (insert-abbrev-table-description table nil))))) 235 (insert-abbrev-table-description table nil)))))
226 236
227(defun add-mode-abbrev (arg) 237(defun add-mode-abbrev (arg)
diff --git a/lisp/allout.el b/lisp/allout.el
index 4b1c152b6b1..6fb81f9f6f7 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -3975,18 +3975,16 @@ need not be quoted in `allout-new-exposure'.
3975 3975
3976Cursor is left at start position. 3976Cursor is left at start position.
3977 3977
3978Use this instead of obsolete `allout-exposure'.
3979
3980Examples: 3978Examples:
3981\(allout-exposure (-1 () () () 1) 0) 3979\(allout-new-exposure (-1 () () () 1) 0)
3982 Close current topic at current level so only the immediate 3980 Close current topic at current level so only the immediate
3983 subtopics are shown, except also show the children of the 3981 subtopics are shown, except also show the children of the
3984 third subtopic; and close the next topic at the current level. 3982 third subtopic; and close the next topic at the current level.
3985\(allout-exposure : -1 0) 3983\(allout-new-exposure : -1 0)
3986 Close all topics at current level to expose only their 3984 Close all topics at current level to expose only their
3987 immediate children, except for the last topic at the current 3985 immediate children, except for the last topic at the current
3988 level, in which even its immediate children are hidden. 3986 level, in which even its immediate children are hidden.
3989\(allout-exposure -2 : -1 *) 3987\(allout-new-exposure -2 : -1 *)
3990 Expose children and grandchildren of first topic at current 3988 Expose children and grandchildren of first topic at current
3991 level, and expose children of subsequent topics at current 3989 level, and expose children of subsequent topics at current
3992 level *except* for the last, which should be opened completely." 3990 level *except* for the last, which should be opened completely."
@@ -3995,17 +3993,6 @@ Examples:
3995 (allout-next-heading))) 3993 (allout-next-heading)))
3996 (error "allout-new-exposure: Can't find any outline topics")) 3994 (error "allout-new-exposure: Can't find any outline topics"))
3997 (list 'allout-expose-topic (list 'quote spec)))) 3995 (list 'allout-expose-topic (list 'quote spec))))
3998;;;_ > allout-exposure '()
3999(defmacro allout-exposure (&rest spec)
4000 "Literal frontend for `allout-old-expose-topic', doesn't evaluate arguments
4001and retains start position."
4002 (list 'save-excursion
4003 '(if (not (or (allout-goto-prefix)
4004 (allout-next-heading)))
4005 (error "Can't find any outline topics"))
4006 (cons 'allout-old-expose-topic
4007 (mapcar (function (lambda (x) (list 'quote x))) spec))))
4008(make-obsolete 'allout-exposure 'allout-new-exposure "19.23")
4009 3996
4010;;;_ #7 Systematic outline presentation - copying, printing, flattening 3997;;;_ #7 Systematic outline presentation - copying, printing, flattening
4011 3998
diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el
index a2d6e9dc88c..b947b597acf 100644
--- a/lisp/calc/calc-aent.el
+++ b/lisp/calc/calc-aent.el
@@ -1,6 +1,6 @@
1;;; calc-aent.el --- algebraic entry functions for Calc 1;;; calc-aent.el --- algebraic entry functions for Calc
2 2
3;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2005 Free Software Foundation, Inc.
4 4
5;; Author: Dave Gillespie <daveg@synaptics.com> 5;; Author: Dave Gillespie <daveg@synaptics.com>
6;; Maintainer: Jay Belanger <belanger@truman.edu> 6;; Maintainer: Jay Belanger <belanger@truman.edu>
@@ -734,7 +734,7 @@ in Calc algebraic input.")
734 math-exp-pos (match-end 1)) 734 math-exp-pos (match-end 1))
735 (if (eq (string-match "\\$\\([1-9][0-9]*\\)" math-exp-str math-exp-pos) 735 (if (eq (string-match "\\$\\([1-9][0-9]*\\)" math-exp-str math-exp-pos)
736 math-exp-pos) 736 math-exp-pos)
737 (setq math-expr-data (- (string-to-int (math-match-substring 737 (setq math-expr-data (- (string-to-number (math-match-substring
738 math-exp-str 1)))) 738 math-exp-str 1))))
739 (string-match "\\$+" math-exp-str math-exp-pos) 739 (string-match "\\$+" math-exp-str math-exp-pos)
740 (setq math-expr-data (- (match-end 0) (match-beginning 0)))) 740 (setq math-expr-data (- (match-end 0) (match-beginning 0))))
@@ -743,7 +743,7 @@ in Calc algebraic input.")
743 ((eq ch ?\#) 743 ((eq ch ?\#)
744 (if (eq (string-match "#\\([1-9][0-9]*\\)" math-exp-str math-exp-pos) 744 (if (eq (string-match "#\\([1-9][0-9]*\\)" math-exp-str math-exp-pos)
745 math-exp-pos) 745 math-exp-pos)
746 (setq math-expr-data (string-to-int 746 (setq math-expr-data (string-to-number
747 (math-match-substring math-exp-str 1)) 747 (math-match-substring math-exp-str 1))
748 math-exp-pos (match-end 0)) 748 math-exp-pos (match-end 0))
749 (setq math-expr-data 1 749 (setq math-expr-data 1
diff --git a/lisp/calc/calc-bin.el b/lisp/calc/calc-bin.el
index e960220c09b..445f9d28531 100644
--- a/lisp/calc/calc-bin.el
+++ b/lisp/calc/calc-bin.el
@@ -1,6 +1,6 @@
1;;; calc-bin.el --- binary functions for Calc 1;;; calc-bin.el --- binary functions for Calc
2 2
3;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2005 Free Software Foundation, Inc.
4 4
5;; Author: David Gillespie <daveg@synaptics.com> 5;; Author: David Gillespie <daveg@synaptics.com>
6;; Maintainer: Jay Belanger <belanger@truman.edu> 6;; Maintainer: Jay Belanger <belanger@truman.edu>
@@ -135,7 +135,7 @@
135 (if (equal n "") 135 (if (equal n "")
136 calc-word-size 136 calc-word-size
137 (if (string-match "\\`[-+]?[0-9]+\\'" n) 137 (if (string-match "\\`[-+]?[0-9]+\\'" n)
138 (string-to-int n) 138 (string-to-number n)
139 (error "Expected an integer"))) 139 (error "Expected an integer")))
140 (prefix-numeric-value n))) 140 (prefix-numeric-value n)))
141 (or (= n calc-word-size) 141 (or (= n calc-word-size)
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index d4d50d64658..df9f9512aaa 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -1,6 +1,6 @@
1;;; calc-ext.el --- various extension functions for Calc 1;;; calc-ext.el --- various extension functions for Calc
2 2
3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
4 4
5;; Author: David Gillespie <daveg@synaptics.com> 5;; Author: David Gillespie <daveg@synaptics.com>
6;; Maintainer: Jay Belanger <belanger@truman.edu> 6;; Maintainer: Jay Belanger <belanger@truman.edu>
@@ -2815,7 +2815,7 @@ calc-kill calc-kill-region calc-yank))))
2815 2815
2816 ;; Integer+fraction with explicit radix 2816 ;; Integer+fraction with explicit radix
2817 ((string-match "^\\([0-9]+\\)\\(#\\|\\^\\^\\)\\([0-9a-zA-Z]*\\)[:/]\\([0-9a-zA-Z]*\\)[:/]\\([0-9a-zA-Z]\\)$" s) 2817 ((string-match "^\\([0-9]+\\)\\(#\\|\\^\\^\\)\\([0-9a-zA-Z]*\\)[:/]\\([0-9a-zA-Z]*\\)[:/]\\([0-9a-zA-Z]\\)$" s)
2818 (let ((radix (string-to-int (math-match-substring s 1))) 2818 (let ((radix (string-to-number (math-match-substring s 1)))
2819 (int (math-match-substring s 3)) 2819 (int (math-match-substring s 3))
2820 (num (math-match-substring s 4)) 2820 (num (math-match-substring s 4))
2821 (den (math-match-substring s 5))) 2821 (den (math-match-substring s 5)))
@@ -2829,7 +2829,7 @@ calc-kill calc-kill-region calc-yank))))
2829 2829
2830 ;; Fraction with explicit radix 2830 ;; Fraction with explicit radix
2831 ((string-match "^\\([0-9]+\\)\\(#\\|\\^\\^\\)\\([0-9a-zA-Z]*\\)[:/]\\([0-9a-zA-Z]*\\)$" s) 2831 ((string-match "^\\([0-9]+\\)\\(#\\|\\^\\^\\)\\([0-9a-zA-Z]*\\)[:/]\\([0-9a-zA-Z]*\\)$" s)
2832 (let ((radix (string-to-int (math-match-substring s 1))) 2832 (let ((radix (string-to-number (math-match-substring s 1)))
2833 (num (math-match-substring s 3)) 2833 (num (math-match-substring s 3))
2834 (den (math-match-substring s 4))) 2834 (den (math-match-substring s 4)))
2835 (let ((num (if (> (length num) 0) (math-read-radix num radix) 1)) 2835 (let ((num (if (> (length num) 0) (math-read-radix num radix) 1))
@@ -2839,7 +2839,7 @@ calc-kill calc-kill-region calc-yank))))
2839 ;; Float with explicit radix and exponent 2839 ;; Float with explicit radix and exponent
2840 ((or (string-match "^0*\\(\\([2-9]\\|1[0-4]\\)\\(#\\|\\^\\^\\)[0-9a-dA-D.]+\\)[eE]\\([-+]?[0-9]+\\)$" s) 2840 ((or (string-match "^0*\\(\\([2-9]\\|1[0-4]\\)\\(#\\|\\^\\^\\)[0-9a-dA-D.]+\\)[eE]\\([-+]?[0-9]+\\)$" s)
2841 (string-match "^\\(\\([0-9]+\\)\\(#\\|\\^\\^\\)[0-9a-zA-Z.]+\\) *\\* *\\2\\.? *\\^ *\\([-+]?[0-9]+\\)$" s)) 2841 (string-match "^\\(\\([0-9]+\\)\\(#\\|\\^\\^\\)[0-9a-zA-Z.]+\\) *\\* *\\2\\.? *\\^ *\\([-+]?[0-9]+\\)$" s))
2842 (let ((radix (string-to-int (math-match-substring s 2))) 2842 (let ((radix (string-to-number (math-match-substring s 2)))
2843 (mant (math-match-substring s 1)) 2843 (mant (math-match-substring s 1))
2844 (exp (math-match-substring s 4))) 2844 (exp (math-match-substring s 4)))
2845 (let ((mant (math-read-number mant)) 2845 (let ((mant (math-read-number mant))
@@ -2849,7 +2849,7 @@ calc-kill calc-kill-region calc-yank))))
2849 2849
2850 ;; Float with explicit radix, no exponent 2850 ;; Float with explicit radix, no exponent
2851 ((string-match "^\\([0-9]+\\)\\(#\\|\\^\\^\\)\\([0-9a-zA-Z]*\\)\\.\\([0-9a-zA-Z]*\\)$" s) 2851 ((string-match "^\\([0-9]+\\)\\(#\\|\\^\\^\\)\\([0-9a-zA-Z]*\\)\\.\\([0-9a-zA-Z]*\\)$" s)
2852 (let ((radix (string-to-int (math-match-substring s 1))) 2852 (let ((radix (string-to-number (math-match-substring s 1)))
2853 (int (math-match-substring s 3)) 2853 (int (math-match-substring s 3))
2854 (fracs (math-match-substring s 4))) 2854 (fracs (math-match-substring s 4)))
2855 (let ((int (if (> (length int) 0) (math-read-radix int radix) 0)) 2855 (let ((int (if (> (length int) 0) (math-read-radix int radix) 0))
@@ -2861,7 +2861,7 @@ calc-kill calc-kill-region calc-yank))))
2861 ;; Integer with explicit radix 2861 ;; Integer with explicit radix
2862 ((string-match "^\\([0-9]+\\)\\(#\\|\\^\\^\\)\\([0-9a-zA-Z]+\\)$" s) 2862 ((string-match "^\\([0-9]+\\)\\(#\\|\\^\\^\\)\\([0-9a-zA-Z]+\\)$" s)
2863 (math-read-radix (math-match-substring s 3) 2863 (math-read-radix (math-match-substring s 3)
2864 (string-to-int (math-match-substring s 1)))) 2864 (string-to-number (math-match-substring s 1))))
2865 2865
2866 ;; C language hexadecimal notation 2866 ;; C language hexadecimal notation
2867 ((and (eq calc-language 'c) 2867 ((and (eq calc-language 'c)
diff --git a/lisp/calc/calc-forms.el b/lisp/calc/calc-forms.el
index 4870891231a..10e4793c7a5 100644
--- a/lisp/calc/calc-forms.el
+++ b/lisp/calc/calc-forms.el
@@ -39,9 +39,9 @@
39 (calc-enter-result 0 "time" 39 (calc-enter-result 0 "time"
40 (list 'mod 40 (list 'mod
41 (list 'hms 41 (list 'hms
42 (string-to-int (substring time 11 13)) 42 (string-to-number (substring time 11 13))
43 (string-to-int (substring time 14 16)) 43 (string-to-number (substring time 14 16))
44 (string-to-int (substring time 17 19))) 44 (string-to-number (substring time 17 19)))
45 (list 'hms 24 0 0)))))) 45 (list 'hms 24 0 0))))))
46 46
47(defun calc-to-hms (arg) 47(defun calc-to-hms (arg)
@@ -80,7 +80,7 @@
80 (if (equal fmt "") 80 (if (equal fmt "")
81 (setq fmt "1")) 81 (setq fmt "1"))
82 (if (string-match "\\` *[0-9] *\\'" fmt) 82 (if (string-match "\\` *[0-9] *\\'" fmt)
83 (setq fmt (nth (string-to-int fmt) calc-standard-date-formats))) 83 (setq fmt (nth (string-to-number fmt) calc-standard-date-formats)))
84 (or (string-match "[a-zA-Z]" fmt) 84 (or (string-match "[a-zA-Z]" fmt)
85 (error "Bad date format specifier")) 85 (error "Bad date format specifier"))
86 (and arg 86 (and arg
@@ -441,7 +441,7 @@
441 441
442 442
443(defun math-this-year () 443(defun math-this-year ()
444 (string-to-int (substring (current-time-string) -4))) 444 (string-to-number (substring (current-time-string) -4)))
445 445
446(defun math-leap-year-p (year) 446(defun math-leap-year-p (year)
447 (if (Math-lessp year 1752) 447 (if (Math-lessp year 1752)
@@ -730,14 +730,14 @@
730 (if (or (string-match "\\([0-9][0-9]?\\):\\([0-9][0-9]?\\)\\(:\\([0-9][0-9]?\\(\\.[0-9]+\\)?\\)\\)? *\\([ap]m?\\|[ap]\\. *m\\.\\|noon\\|n\\>\\|midnight\\|mid\\>\\|m\\>\\)?" math-pd-str) 730 (if (or (string-match "\\([0-9][0-9]?\\):\\([0-9][0-9]?\\)\\(:\\([0-9][0-9]?\\(\\.[0-9]+\\)?\\)\\)? *\\([ap]m?\\|[ap]\\. *m\\.\\|noon\\|n\\>\\|midnight\\|mid\\>\\|m\\>\\)?" math-pd-str)
731 (string-match "\\([0-9][0-9]?\\)\\(\\)\\(\\(\\(\\)\\)\\) *\\([ap]m?\\|[ap]\\. *m\\.\\|noon\\|n\\>\\|midnight\\|mid\\>\\|m\\>\\)" math-pd-str)) 731 (string-match "\\([0-9][0-9]?\\)\\(\\)\\(\\(\\(\\)\\)\\) *\\([ap]m?\\|[ap]\\. *m\\.\\|noon\\|n\\>\\|midnight\\|mid\\>\\|m\\>\\)" math-pd-str))
732 (let ((ampm (math-match-substring math-pd-str 6))) 732 (let ((ampm (math-match-substring math-pd-str 6)))
733 (setq hour (string-to-int (math-match-substring math-pd-str 1)) 733 (setq hour (string-to-number (math-match-substring math-pd-str 1))
734 minute (math-match-substring math-pd-str 2) 734 minute (math-match-substring math-pd-str 2)
735 second (math-match-substring math-pd-str 4) 735 second (math-match-substring math-pd-str 4)
736 math-pd-str (concat (substring math-pd-str 0 (match-beginning 0)) 736 math-pd-str (concat (substring math-pd-str 0 (match-beginning 0))
737 (substring math-pd-str (match-end 0)))) 737 (substring math-pd-str (match-end 0))))
738 (if (equal minute "") 738 (if (equal minute "")
739 (setq minute 0) 739 (setq minute 0)
740 (setq minute (string-to-int minute))) 740 (setq minute (string-to-number minute)))
741 (if (equal second "") 741 (if (equal second "")
742 (setq second 0) 742 (setq second 0)
743 (setq second (math-read-number second))) 743 (setq second (math-read-number second)))
@@ -801,7 +801,7 @@
801 (setq temp 0) 801 (setq temp 0)
802 (while (string-match "[0-9]+" math-pd-str temp) 802 (while (string-match "[0-9]+" math-pd-str temp)
803 (and c (throw 'syntax "Too many numbers in date")) 803 (and c (throw 'syntax "Too many numbers in date"))
804 (setq c (string-to-int (math-match-substring math-pd-str 0))) 804 (setq c (string-to-number (math-match-substring math-pd-str 0)))
805 (or b (setq b c c nil)) 805 (or b (setq b c c nil))
806 (or a (setq a b b nil)) 806 (or a (setq a b b nil))
807 (setq temp (match-end 0))) 807 (setq temp (match-end 0)))
@@ -1021,7 +1021,7 @@
1021 (string-match "\\` *[0-9][0-9][0-9]" math-pd-str) 1021 (string-match "\\` *[0-9][0-9][0-9]" math-pd-str)
1022 (string-match "\\` *[0-9][0-9]" math-pd-str)) 1022 (string-match "\\` *[0-9][0-9]" math-pd-str))
1023 (string-match "\\` *[0-9]+" math-pd-str))) 1023 (string-match "\\` *[0-9]+" math-pd-str)))
1024 (and (setq num (string-to-int 1024 (and (setq num (string-to-number
1025 (math-match-substring math-pd-str 0)) 1025 (math-match-substring math-pd-str 0))
1026 math-pd-str (substring math-pd-str (match-end 0))) 1026 math-pd-str (substring math-pd-str (match-end 0)))
1027 nil)) 1027 nil))
@@ -1236,13 +1236,13 @@
1236 (setq p (cdr p)))) 1236 (setq p (cdr p))))
1237 (if (looking-at "\\([-+][0-9]?[0-9]\\)\\([0-9][0-9]\\)?\\(\\'\\|[^0-9]\\)") 1237 (if (looking-at "\\([-+][0-9]?[0-9]\\)\\([0-9][0-9]\\)?\\(\\'\\|[^0-9]\\)")
1238 (setq offset (math-add 1238 (setq offset (math-add
1239 (string-to-int (buffer-substring 1239 (string-to-number (buffer-substring
1240 (match-beginning 1) 1240 (match-beginning 1)
1241 (match-end 1))) 1241 (match-end 1)))
1242 (if (match-beginning 2) 1242 (if (match-beginning 2)
1243 (math-div (string-to-int (buffer-substring 1243 (math-div (string-to-number (buffer-substring
1244 (match-beginning 2) 1244 (match-beginning 2)
1245 (match-end 2))) 1245 (match-end 2)))
1246 60) 1246 60)
1247 0))))) 1247 0)))))
1248 (if p 1248 (if p
diff --git a/lisp/calc/calc-frac.el b/lisp/calc/calc-frac.el
index cdb8ac9beb6..87ee59440c3 100644
--- a/lisp/calc/calc-frac.el
+++ b/lisp/calc/calc-frac.el
@@ -1,6 +1,6 @@
1;;; calc-frac.el --- fraction functions for Calc 1;;; calc-frac.el --- fraction functions for Calc
2 2
3;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2005 Free Software Foundation, Inc.
4 4
5;; Author: David Gillespie <daveg@synaptics.com> 5;; Author: David Gillespie <daveg@synaptics.com>
6;; Maintainer: Jay Belanger <belanger@truman.edu> 6;; Maintainer: Jay Belanger <belanger@truman.edu>
@@ -56,7 +56,7 @@
56 (if (string-match "\\`\\([^ 0-9][^ 0-9]?\\)[0-9]*\\'" fmt) 56 (if (string-match "\\`\\([^ 0-9][^ 0-9]?\\)[0-9]*\\'" fmt)
57 (let ((n nil)) 57 (let ((n nil))
58 (if (/= (match-end 0) (match-end 1)) 58 (if (/= (match-end 0) (match-end 1))
59 (setq n (string-to-int (substring fmt (match-end 1))) 59 (setq n (string-to-number (substring fmt (match-end 1)))
60 fmt (math-match-substring fmt 1))) 60 fmt (math-match-substring fmt 1)))
61 (if (eq n 0) (error "Bad denominator")) 61 (if (eq n 0) (error "Bad denominator"))
62 (calc-change-mode 'calc-frac-format (list fmt n) t)) 62 (calc-change-mode 'calc-frac-format (list fmt n) t))
diff --git a/lisp/calc/calc-graph.el b/lisp/calc/calc-graph.el
index 6a58a6215fa..09bea69cf73 100644
--- a/lisp/calc/calc-graph.el
+++ b/lisp/calc/calc-graph.el
@@ -407,13 +407,13 @@
407 (prin1-to-string output))))) 407 (prin1-to-string output)))))
408 (setq calc-graph-resolution (calc-graph-find-command "samples")) 408 (setq calc-graph-resolution (calc-graph-find-command "samples"))
409 (if calc-graph-resolution 409 (if calc-graph-resolution
410 (setq calc-graph-resolution (string-to-int calc-graph-resolution)) 410 (setq calc-graph-resolution (string-to-number calc-graph-resolution))
411 (setq calc-graph-resolution (if calc-graph-is-splot 411 (setq calc-graph-resolution (if calc-graph-is-splot
412 calc-graph-default-resolution-3d 412 calc-graph-default-resolution-3d
413 calc-graph-default-resolution))) 413 calc-graph-default-resolution)))
414 (setq precision (calc-graph-find-command "precision")) 414 (setq precision (calc-graph-find-command "precision"))
415 (if precision 415 (if precision
416 (setq precision (string-to-int precision)) 416 (setq precision (string-to-number precision))
417 (setq precision calc-graph-default-precision)) 417 (setq precision calc-graph-default-precision))
418 (calc-graph-set-command "terminal") 418 (calc-graph-set-command "terminal")
419 (calc-graph-set-command "output") 419 (calc-graph-set-command "output")
@@ -1078,11 +1078,11 @@ This \"dumb\" driver will be present in Gnuplot 3.0."
1078 (setq mode (buffer-substring (match-beginning 1) 1078 (setq mode (buffer-substring (match-beginning 1)
1079 (match-end 1)))) 1079 (match-end 1))))
1080 (if (looking-at "[ \ta-z]+\\([0-9]+\\)") 1080 (if (looking-at "[ \ta-z]+\\([0-9]+\\)")
1081 (setq lstyle (string-to-int 1081 (setq lstyle (string-to-number
1082 (buffer-substring (match-beginning 1) 1082 (buffer-substring (match-beginning 1)
1083 (match-end 1))))) 1083 (match-end 1)))))
1084 (if (looking-at "[ \ta-z]+[0-9]+[ \t]+\\([0-9]+\\)") 1084 (if (looking-at "[ \ta-z]+[0-9]+[ \t]+\\([0-9]+\\)")
1085 (setq pstyle (string-to-int 1085 (setq pstyle (string-to-number
1086 (buffer-substring (match-beginning 1) 1086 (buffer-substring (match-beginning 1)
1087 (match-end 1))))))) 1087 (match-end 1)))))))
1088 (setq lenbl (or (equal mode "lines") (equal mode "linespoints")) 1088 (setq lenbl (or (equal mode "lines") (equal mode "linespoints"))
@@ -1195,11 +1195,11 @@ This \"dumb\" driver will be present in Gnuplot 3.0."
1195 (if (equal res "") 1195 (if (equal res "")
1196 (message "Default resolution is %d" 1196 (message "Default resolution is %d"
1197 calc-graph-default-resolution) 1197 calc-graph-default-resolution)
1198 (setq calc-graph-default-resolution (string-to-int res))) 1198 (setq calc-graph-default-resolution (string-to-number res)))
1199 (if (equal res "") 1199 (if (equal res "")
1200 (message "Default 3D resolution is %d" 1200 (message "Default 3D resolution is %d"
1201 calc-graph-default-resolution-3d) 1201 calc-graph-default-resolution-3d)
1202 (setq calc-graph-default-resolution-3d (string-to-int res)))) 1202 (setq calc-graph-default-resolution-3d (string-to-number res))))
1203 (calc-graph-set-command "samples" (if (not (equal res "")) res)))) 1203 (calc-graph-set-command "samples" (if (not (equal res "")) res))))
1204 1204
1205(defun calc-graph-device (name flag) 1205(defun calc-graph-device (name flag)
@@ -1456,7 +1456,7 @@ This \"dumb\" driver will be present in Gnuplot 3.0."
1456 (goto-char origin) 1456 (goto-char origin)
1457 (re-search-forward 1457 (re-search-forward
1458 "G N U P L O T.*\n.*version \\([0-9]+\\)\\." nil t)) 1458 "G N U P L O T.*\n.*version \\([0-9]+\\)\\." nil t))
1459 (setq calc-gnuplot-version (string-to-int (buffer-substring 1459 (setq calc-gnuplot-version (string-to-number (buffer-substring
1460 (match-beginning 1) 1460 (match-beginning 1)
1461 (match-end 1)))) 1461 (match-end 1))))
1462 (setq calc-gnuplot-version 1)) 1462 (setq calc-gnuplot-version 1))
diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el
index 46b8cec2ac6..2a89bb2b883 100644
--- a/lisp/calc/calc-help.el
+++ b/lisp/calc/calc-help.el
@@ -393,12 +393,14 @@ C-w Describe how there is no warranty for Calc."
393 (error "Can't locate Calc sources")) 393 (error "Can't locate Calc sources"))
394 (calc-quit) 394 (calc-quit)
395 (switch-to-buffer "*Help*") 395 (switch-to-buffer "*Help*")
396 (erase-buffer) 396 (let ((inhibit-read-only t))
397 (insert-file-contents (expand-file-name "README" (car path))) 397 (erase-buffer)
398 (search-forward "Summary of changes") 398 (insert-file-contents (expand-file-name "README" (car path)))
399 (forward-line -1) 399 (search-forward "Summary of changes")
400 (delete-region (point-min) (point)) 400 (forward-line -1)
401 (goto-char (point-min)))) 401 (delete-region (point-min) (point))
402 (goto-char (point-min)))
403 (help-mode)))
402 404
403(defvar calc-help-long-names '((?b . "binary/business") 405(defvar calc-help-long-names '((?b . "binary/business")
404 (?g . "graphics") 406 (?g . "graphics")
diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el
index 05ec668cce9..01ca770ba27 100644
--- a/lisp/calc/calc-prog.el
+++ b/lisp/calc/calc-prog.el
@@ -1,6 +1,6 @@
1;;; calc-prog.el --- user programmability functions for Calc 1;;; calc-prog.el --- user programmability functions for Calc
2 2
3;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2005 Free Software Foundation, Inc.
4 4
5;; Author: David Gillespie <daveg@synaptics.com> 5;; Author: David Gillespie <daveg@synaptics.com>
6;; Maintainer: Jay Belanger <belanger@truman.edu> 6;; Maintainer: Jay Belanger <belanger@truman.edu>
@@ -637,7 +637,7 @@
637 (setq part (nconc part (list (if (= (match-beginning 1) 637 (setq part (nconc part (list (if (= (match-beginning 1)
638 (match-end 1)) 638 (match-end 1))
639 0 639 0
640 (string-to-int 640 (string-to-number
641 (buffer-substring 641 (buffer-substring
642 (1+ (match-beginning 1)) 642 (1+ (match-beginning 1))
643 (match-end 1))))))) 643 (match-end 1)))))))
@@ -727,7 +727,7 @@
727 (goto-char calc-edit-top) 727 (goto-char calc-edit-top)
728 (while 728 (while
729 (re-search-forward "^\\([0-9]+\\)\\*" nil t) 729 (re-search-forward "^\\([0-9]+\\)\\*" nil t)
730 (let ((num (string-to-int (match-string 1))) 730 (let ((num (string-to-number (match-string 1)))
731 (line (buffer-substring (point) (line-end-position)))) 731 (line (buffer-substring (point) (line-end-position))))
732 (goto-char (line-beginning-position)) 732 (goto-char (line-beginning-position))
733 (kill-line 1) 733 (kill-line 1)
diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el
index 339dfd838a4..84c117a1723 100644
--- a/lisp/calc/calc-yank.el
+++ b/lisp/calc/calc-yank.el
@@ -1,6 +1,6 @@
1;;; calc-yank.el --- kill-ring functionality for Calc 1;;; calc-yank.el --- kill-ring functionality for Calc
2 2
3;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2005 Free Software Foundation, Inc.
4 4
5;; Author: David Gillespie <daveg@synaptics.com> 5;; Author: David Gillespie <daveg@synaptics.com>
6;; Maintainer: Jay Belanger <belanger@truman.edu> 6;; Maintainer: Jay Belanger <belanger@truman.edu>
@@ -231,7 +231,7 @@
231 pos j))))) 231 pos j)))))
232 (if (string-match "\\` *-?[0-9][0-9]?[0-9]?[0-9]?[0-9]?[0-9]? *\\'" 232 (if (string-match "\\` *-?[0-9][0-9]?[0-9]?[0-9]?[0-9]?[0-9]? *\\'"
233 (car data)) 233 (car data))
234 (setq vals (list 'vec (string-to-int (car data)))) 234 (setq vals (list 'vec (string-to-number (car data))))
235 (if (and (null arg) 235 (if (and (null arg)
236 (string-match "[[{][^][{}]*[]}]" (car data))) 236 (string-match "[[{][^][{}]*[]}]" (car data)))
237 (setq pos (match-beginning 0) 237 (setq pos (match-beginning 0)
@@ -528,7 +528,7 @@ To cancel the edit, simply kill the *Calc Edit* buffer."
528 (goto-char calc-edit-top) 528 (goto-char calc-edit-top)
529 (if (buffer-modified-p) 529 (if (buffer-modified-p)
530 (eval calc-edit-handler)) 530 (eval calc-edit-handler))
531 (if one-window 531 (if (and one-window (not (one-window-p t)))
532 (delete-window)) 532 (delete-window))
533 (if (get-buffer-window return) 533 (if (get-buffer-window return)
534 (select-window (get-buffer-window return)) 534 (select-window (get-buffer-window return))
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index ceee013e493..617fc1ddc89 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -1174,8 +1174,6 @@ commands given here will actually operate on the *Calculator* stack."
1174 (setq buffer-read-only t) 1174 (setq buffer-read-only t)
1175 (make-local-variable 'overlay-arrow-position) 1175 (make-local-variable 'overlay-arrow-position)
1176 (make-local-variable 'overlay-arrow-string) 1176 (make-local-variable 'overlay-arrow-string)
1177 (set (make-local-variable 'font-lock-defaults)
1178 '(nil t nil nil nil (font-lock-core-only . t)))
1179 (when buf 1177 (when buf
1180 (set (make-local-variable 'calc-main-buffer) buf)) 1178 (set (make-local-variable 'calc-main-buffer) buf))
1181 (when (= (buffer-size) 0) 1179 (when (= (buffer-size) 0)
@@ -2138,7 +2136,7 @@ See calc-keypad for details."
2138 (t 2136 (t
2139 (insert (char-to-string last-command-char)) 2137 (insert (char-to-string last-command-char))
2140 (if (or (and (calc-minibuffer-contains "[-+]?\\(.*\\+/- *\\|.*mod *\\)?\\([0-9][0-9]?\\)#[0-9a-zA-Z]*\\(:[0-9a-zA-Z]*\\(:[0-9a-zA-Z]*\\)?\\|.[0-9a-zA-Z]*\\(e[-+]?[0-9]*\\)?\\)?\\'") 2138 (if (or (and (calc-minibuffer-contains "[-+]?\\(.*\\+/- *\\|.*mod *\\)?\\([0-9][0-9]?\\)#[0-9a-zA-Z]*\\(:[0-9a-zA-Z]*\\(:[0-9a-zA-Z]*\\)?\\|.[0-9a-zA-Z]*\\(e[-+]?[0-9]*\\)?\\)?\\'")
2141 (let ((radix (string-to-int 2139 (let ((radix (string-to-number
2142 (buffer-substring 2140 (buffer-substring
2143 (match-beginning 2) (match-end 2))))) 2141 (match-beginning 2) (match-end 2)))))
2144 (and (>= radix 2) 2142 (and (>= radix 2)
@@ -3280,7 +3278,7 @@ See calc-keypad for details."
3280 (eq (aref digs 0) ?0)) 3278 (eq (aref digs 0) ?0))
3281 (math-read-number (concat "8#" digs)) 3279 (math-read-number (concat "8#" digs))
3282 (if (<= (length digs) 6) 3280 (if (<= (length digs) 6)
3283 (string-to-int digs) 3281 (string-to-number digs)
3284 (cons 'bigpos (math-read-bignum digs)))))) 3282 (cons 'bigpos (math-read-bignum digs))))))
3285 3283
3286 ;; Clean up the string if necessary 3284 ;; Clean up the string if necessary
@@ -3317,7 +3315,7 @@ See calc-keypad for details."
3317 (exp (math-match-substring s 2))) 3315 (exp (math-match-substring s 2)))
3318 (let ((mant (if (> (length mant) 0) (math-read-number mant) 1)) 3316 (let ((mant (if (> (length mant) 0) (math-read-number mant) 1))
3319 (exp (if (<= (length exp) (if (memq (aref exp 0) '(?+ ?-)) 8 7)) 3317 (exp (if (<= (length exp) (if (memq (aref exp 0) '(?+ ?-)) 8 7))
3320 (string-to-int exp)))) 3318 (string-to-number exp))))
3321 (and mant exp (Math-realp mant) (> exp -4000000) (< exp 4000000) 3319 (and mant exp (Math-realp mant) (> exp -4000000) (< exp 4000000)
3322 (let ((mant (math-float mant))) 3320 (let ((mant (math-float mant)))
3323 (list 'float (nth 1 mant) (+ (nth 2 mant) exp))))))) 3321 (list 'float (nth 1 mant) (+ (nth 2 mant) exp)))))))
@@ -3332,9 +3330,9 @@ See calc-keypad for details."
3332 3330
3333(defun math-read-bignum (s) ; [l X] 3331(defun math-read-bignum (s) ; [l X]
3334 (if (> (length s) 3) 3332 (if (> (length s) 3)
3335 (cons (string-to-int (substring s -3)) 3333 (cons (string-to-number (substring s -3))
3336 (math-read-bignum (substring s 0 -3))) 3334 (math-read-bignum (substring s 0 -3)))
3337 (list (string-to-int s)))) 3335 (list (string-to-number s))))
3338 3336
3339 3337
3340(defconst math-tex-ignore-words 3338(defconst math-tex-ignore-words
diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el
index 320a6aa0f72..f37b966a45a 100644
--- a/lisp/calendar/icalendar.el
+++ b/lisp/calendar/icalendar.el
@@ -28,6 +28,13 @@
28 28
29;; This package is documented in the Emacs Manual. 29;; This package is documented in the Emacs Manual.
30 30
31;; Please note:
32;; - Diary entries which have a start time but no end time are assumed to
33;; last for one hour when they are exported.
34;; - Weekly diary entries are assumed to occur the first time in the first
35;; week of the year 2000 when they are exported.
36;; - Yearly diary entries are assumed to occur the first time in the year
37;; 1900 when they are exported.
31 38
32;;; History: 39;;; History:
33 40
@@ -75,11 +82,11 @@
75;; + the parser is too soft 82;; + the parser is too soft
76;; + error log is incomplete 83;; + error log is incomplete
77;; + nice to have: #include "webcal://foo.com/some-calendar.ics" 84;; + nice to have: #include "webcal://foo.com/some-calendar.ics"
85;; + timezones, currently all times are local!
78 86
79;; * Export from diary to ical 87;; * Export from diary to ical
80;; + diary-date, diary-float, and self-made sexp entries are not 88;; + diary-date, diary-float, and self-made sexp entries are not
81;; understood 89;; understood
82;; + timezones, currently all times are local!
83 90
84;; * Other things 91;; * Other things
85;; + clean up all those date/time parsing functions 92;; + clean up all those date/time parsing functions
@@ -90,7 +97,7 @@
90 97
91;;; Code: 98;;; Code:
92 99
93(defconst icalendar-version 0.11 100(defconst icalendar-version 0.12
94 "Version number of icalendar.el.") 101 "Version number of icalendar.el.")
95 102
96;; ====================================================================== 103;; ======================================================================
@@ -145,16 +152,8 @@ replaced by the organizer."
145 :type 'string 152 :type 'string
146 :group 'icalendar) 153 :group 'icalendar)
147 154
148(defcustom icalendar-duration-correction 155(defvar icalendar-debug nil
149 t 156 "Enable icalendar debug messages.")
150 "Workaround for all-day events.
151If non-nil the length=duration of iCalendar appointments that
152have a length of exactly n days is decreased by one day. This
153fixes problems with all-day events, which appear to be one day
154longer than they are."
155 :type 'boolean
156 :group 'icalendar)
157
158 157
159;; ====================================================================== 158;; ======================================================================
160;; NO USER SERVICABLE PARTS BELOW THIS LINE 159;; NO USER SERVICABLE PARTS BELOW THIS LINE
@@ -162,8 +161,6 @@ longer than they are."
162 161
163(defconst icalendar--weekday-array ["SU" "MO" "TU" "WE" "TH" "FR" "SA"]) 162(defconst icalendar--weekday-array ["SU" "MO" "TU" "WE" "TH" "FR" "SA"])
164 163
165(defvar icalendar-debug nil ".")
166
167;; ====================================================================== 164;; ======================================================================
168;; all the other libs we need 165;; all the other libs we need
169;; ====================================================================== 166;; ======================================================================
@@ -295,7 +292,7 @@ it finds"
295 (while props 292 (while props
296 (setq pp (car props)) 293 (setq pp (car props))
297 (if (eq (car pp) prop) 294 (if (eq (car pp) prop)
298 (setq result (cons (car (cddr pp)) result))) 295 (setq result (append (split-string (car (cddr pp)) ",") result)))
299 (setq props (cdr props))) 296 (setq props (cdr props)))
300 result)) 297 result))
301 298
@@ -411,12 +408,15 @@ FIXME: multiple comma-separated values should be allowed!"
411 ;; isodatetimestring == nil 408 ;; isodatetimestring == nil
412 nil)) 409 nil))
413 410
414(defun icalendar--decode-isoduration (isodurationstring) 411(defun icalendar--decode-isoduration (isodurationstring
415 "Return ISODURATIONSTRING in format like `decode-time'. 412 &optional duration-correction)
413 "Convert ISODURATIONSTRING into format provided by `decode-time'.
416Converts from ISO-8601 to Emacs representation. If ISODURATIONSTRING 414Converts from ISO-8601 to Emacs representation. If ISODURATIONSTRING
417specifies UTC time (trailing letter Z) the decoded time is given in 415specifies UTC time (trailing letter Z) the decoded time is given in
418the local time zone! 416the local time zone!
419 417
418Optional argument DURATION-CORRECTION shortens result by one day.
419
420FIXME: TZID-attributes are ignored....! 420FIXME: TZID-attributes are ignored....!
421FIXME: multiple comma-separated values should be allowed!" 421FIXME: multiple comma-separated values should be allowed!"
422 (if isodurationstring 422 (if isodurationstring
@@ -442,7 +442,7 @@ FIXME: multiple comma-separated values should be allowed!"
442 (setq days (read (substring isodurationstring 442 (setq days (read (substring isodurationstring
443 (match-beginning 3) 443 (match-beginning 3)
444 (match-end 3)))) 444 (match-end 3))))
445 (when icalendar-duration-correction 445 (when duration-correction
446 (setq days (1- days)))) 446 (setq days (1- days))))
447 ((match-beginning 4) ;days and time 447 ((match-beginning 4) ;days and time
448 (if (match-beginning 5) 448 (if (match-beginning 5)
@@ -710,14 +710,14 @@ FExport diary data into iCalendar file: ")
710 "?"))) 710 "?")))
711 ;; prepare buffer with error messages 711 ;; prepare buffer with error messages
712 (save-current-buffer 712 (save-current-buffer
713 (set-buffer (get-buffer-create " *icalendar-errors*")) 713 (set-buffer (get-buffer-create "*icalendar-errors*"))
714 (erase-buffer)) 714 (erase-buffer))
715 715
716 ;; here we go 716 ;; here we go
717 (save-excursion 717 (save-excursion
718 (goto-char min) 718 (goto-char min)
719 (while (re-search-forward 719 (while (re-search-forward
720 "^\\([^ \t\n].*\\)\\(\\(\n[ \t].*\\)*\\)" max t) 720 "^\\([^ \t\n].+\\)\\(\\(\n[ \t].*\\)*\\)" max t)
721 (setq entry-main (match-string 1)) 721 (setq entry-main (match-string 1))
722 (if (match-beginning 2) 722 (if (match-beginning 2)
723 (setq entry-rest (match-string 2)) 723 (setq entry-rest (match-string 2))
@@ -728,369 +728,42 @@ FExport diary data into iCalendar file: ")
728 (car (cddr (current-time))))) 728 (car (cddr (current-time)))))
729 (condition-case error-val 729 (condition-case error-val
730 (progn 730 (progn
731 (cond 731 (setq contents
732 ;; anniversaries 732 (or
733 ((string-match 733 ;; anniversaries -- %%(diary-anniversary ...)
734 (concat nonmarker 734 (icalendar--convert-anniversary-to-ical nonmarker
735 "%%(diary-anniversary \\([^)]+\\))\\s-*\\(.*\\)") 735 entry-main)
736 entry-main) 736 ;; cyclic events -- %%(diary-cyclic ...)
737 (icalendar--dmsg "diary-anniversary %s" entry-main) 737 (icalendar--convert-cyclic-to-ical nonmarker entry-main)
738 (let* ((datetime (substring entry-main (match-beginning 1) 738 ;; diary-date -- %%(diary-date ...)
739 (match-end 1))) 739 (icalendar--convert-date-to-ical nonmarker entry-main)
740 (summary (icalendar--convert-string-for-export 740 ;; float events -- %%(diary-float ...)
741 (substring entry-main (match-beginning 2) 741 (icalendar--convert-float-to-ical nonmarker entry-main)
742 (match-end 2)))) 742 ;; block events -- %%(diary-block ...)
743 (startisostring (icalendar--datestring-to-isodate 743 (icalendar--convert-block-to-ical nonmarker entry-main)
744 datetime)) 744 ;; other sexp diary entries
745 (endisostring (icalendar--datestring-to-isodate 745 (icalendar--convert-sexp-to-ical nonmarker entry-main)
746 datetime 1))) 746 ;; weekly by day -- Monday 8:30 Team meeting
747 (setq contents 747 (icalendar--convert-weekly-to-ical nonmarker entry-main)
748 (concat "\nDTSTART;VALUE=DATE:" startisostring 748 ;; yearly by day -- 1 May Tag der Arbeit
749 "\nDTEND;VALUE=DATE:" endisostring 749 (icalendar--convert-yearly-to-ical nonmarker entry-main)
750 "\nSUMMARY:" summary 750 ;; "ordinary" events, start and end time given
751 "\nRRULE:FREQ=YEARLY;INTERVAL=1" 751 ;; 1 Feb 2003 blah
752 ;; the following is redundant, 752 (icalendar--convert-ordinary-to-ical nonmarker entry-main)
753 ;; but korganizer seems to expect this... ;( 753 ;; everything else
754 ;; and evolution doesn't understand it... :( 754 ;; Oops! what's that?
755 ;; so... who is wrong?! 755 (error "Could not parse entry")))
756 ";BYMONTH=" 756 (unless (string= entry-rest "")
757 (substring startisostring 4 6) 757 (setq contents
758 ";BYMONTHDAY=" 758 (concat contents "\nDESCRIPTION:"
759 (substring startisostring 6 8)))) 759 (icalendar--convert-string-for-export
760 (unless (string= entry-rest "") 760 entry-rest))))
761 (setq contents
762 (concat contents "\nDESCRIPTION:"
763 (icalendar--convert-string-for-export
764 entry-rest)))))
765 ;; cyclic events
766 ;; %%(diary-cyclic )
767 ((string-match
768 (concat nonmarker
769 "%%(diary-cyclic \\([^ ]+\\) +"
770 "\\([^ /]+[ /]+[^ /]+[ /]+[^ ]+\\))\\s-*\\(.*\\)")
771 entry-main)
772 (icalendar--dmsg "diary-cyclic %s" entry-main)
773 (let* ((frequency (substring entry-main (match-beginning 1)
774 (match-end 1)))
775 (datetime (substring entry-main (match-beginning 2)
776 (match-end 2)))
777 (summary (icalendar--convert-string-for-export
778 (substring entry-main (match-beginning 3)
779 (match-end 3))))
780 (startisostring (icalendar--datestring-to-isodate
781 datetime))
782 (endisostring (icalendar--datestring-to-isodate
783 datetime 1)))
784 (setq contents
785 (concat "\nDTSTART;VALUE=DATE:" startisostring
786 "\nDTEND;VALUE=DATE:" endisostring
787 "\nSUMMARY:" summary
788 "\nRRULE:FREQ=DAILY;INTERVAL=" frequency
789 ;; strange: korganizer does not expect
790 ;; BYSOMETHING here...
791 )))
792 (unless (string= entry-rest "")
793 (setq contents
794 (concat contents "\nDESCRIPTION:"
795 (icalendar--convert-string-for-export
796 entry-rest)))))
797 ;; diary-date -- FIXME
798 ((string-match
799 (concat nonmarker
800 "%%(diary-date \\([^)]+\\))\\s-*\\(.*\\)")
801 entry-main)
802 (icalendar--dmsg "diary-date %s" entry-main)
803 (error "`diary-date' is not supported yet"))
804 ;; float events -- FIXME
805 ((string-match
806 (concat nonmarker
807 "%%(diary-float \\([^)]+\\))\\s-*\\(.*\\)")
808 entry-main)
809 (icalendar--dmsg "diary-float %s" entry-main)
810 (error "`diary-float' is not supported yet"))
811 ;; block events
812 ((string-match
813 (concat nonmarker
814 "%%(diary-block \\([^ /]+[ /]+[^ /]+[ /]+[^ ]+\\)"
815 " +\\([^ /]+[ /]+[^ /]+[ /]+[^ ]+\\))\\s-*"
816 "\\(.*\\)")
817 entry-main)
818 (icalendar--dmsg "diary-block %s" entry-main)
819 (let* ((startstring (substring entry-main
820 (match-beginning 1)
821 (match-end 1)))
822 (endstring (substring entry-main
823 (match-beginning 2)
824 (match-end 2)))
825 (summary (icalendar--convert-string-for-export
826 (substring entry-main (match-beginning 3)
827 (match-end 3))))
828 (startisostring (icalendar--datestring-to-isodate
829 startstring))
830 (endisostring (icalendar--datestring-to-isodate
831 endstring 1)))
832 (setq contents
833 (concat "\nDTSTART;VALUE=DATE:" startisostring
834 "\nDTEND;VALUE=DATE:" endisostring
835 "\nSUMMARY:" summary))
836 (unless (string= entry-rest "")
837 (setq contents
838 (concat contents "\nDESCRIPTION:"
839 (icalendar--convert-string-for-export
840 entry-rest))))))
841 ;; other sexp diary entries -- FIXME
842 ((string-match
843 (concat nonmarker
844 "%%(\\([^)]+\\))\\s-*\\(.*\\)")
845 entry-main)
846 (icalendar--dmsg "diary-sexp %s" entry-main)
847 (error "sexp-entries are not supported yet"))
848 ;; weekly by day
849 ;; Monday 8:30 Team meeting
850 ((and (string-match
851 (concat nonmarker
852 "\\([a-z]+\\)\\s-+"
853 "\\(0?\\([1-9][0-9]?:[0-9][0-9]\\)"
854 "\\([ap]m\\)?"
855 "\\(-0?"
856 "\\([1-9][0-9]?:[0-9][0-9]\\)"
857 "\\([ap]m\\)?\\)?"
858 "\\)?"
859 "\\s-*\\(.*\\)$")
860 entry-main)
861 (icalendar--get-weekday-abbrev
862 (substring entry-main (match-beginning 1)
863 (match-end 1))))
864 (icalendar--dmsg "weekly %s" entry-main)
865 (let* ((day (icalendar--get-weekday-abbrev
866 (substring entry-main (match-beginning 1)
867 (match-end 1))))
868 (starttimestring (icalendar--diarytime-to-isotime
869 (if (match-beginning 3)
870 (substring entry-main
871 (match-beginning 3)
872 (match-end 3))
873 nil)
874 (if (match-beginning 4)
875 (substring entry-main
876 (match-beginning 4)
877 (match-end 4))
878 nil)))
879 (endtimestring (icalendar--diarytime-to-isotime
880 (if (match-beginning 6)
881 (substring entry-main
882 (match-beginning 6)
883 (match-end 6))
884 nil)
885 (if (match-beginning 7)
886 (substring entry-main
887 (match-beginning 7)
888 (match-end 7))
889 nil)))
890 (summary (icalendar--convert-string-for-export
891 (substring entry-main (match-beginning 8)
892 (match-end 8)))))
893 (when starttimestring
894 (unless endtimestring
895 (let ((time (read
896 (icalendar--rris "^T0?" ""
897 starttimestring))))
898 (setq endtimestring (format "T%06d"
899 (+ 10000 time))))))
900 (setq contents
901 (concat "\nDTSTART;"
902 (if starttimestring
903 "VALUE=DATE-TIME:"
904 "VALUE=DATE:")
905 ;; find the correct week day,
906 ;; 1st january 2000 was a saturday
907 (format
908 "200001%02d"
909 (+ (icalendar--get-weekday-number day) 2))
910 (or starttimestring "")
911 "\nDTEND;"
912 (if endtimestring
913 "VALUE=DATE-TIME:"
914 "VALUE=DATE:")
915 (format
916 "200001%02d"
917 ;; end is non-inclusive!
918 (+ (icalendar--get-weekday-number day)
919 (if endtimestring 2 3)))
920 (or endtimestring "")
921 "\nSUMMARY:" summary
922 "\nRRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY="
923 day)))
924 (unless (string= entry-rest "")
925 (setq contents
926 (concat contents "\nDESCRIPTION:"
927 (icalendar--convert-string-for-export
928 entry-rest)))))
929 ;; yearly by day
930 ;; 1 May Tag der Arbeit
931 ((string-match
932 (concat nonmarker
933 (if european-calendar-style
934 "0?\\([1-9]+[0-9]?\\)\\s-+\\([a-z]+\\)\\s-+"
935 "\\([a-z]+\\)\\s-+0?\\([1-9]+[0-9]?\\)\\s-+")
936 "\\*?\\s-*"
937 "\\(0?\\([1-9][0-9]?:[0-9][0-9]\\)\\([ap]m\\)?"
938 "\\("
939 "-0?\\([1-9][0-9]?:[0-9][0-9]\\)\\([ap]m\\)?\\)?"
940 "\\)?"
941 "\\s-*\\([^0-9]+.*\\)$" ; must not match years
942 )
943 entry-main)
944 (icalendar--dmsg "yearly %s" entry-main)
945 (let* ((daypos (if european-calendar-style 1 2))
946 (monpos (if european-calendar-style 2 1))
947 (day (read (substring entry-main
948 (match-beginning daypos)
949 (match-end daypos))))
950 (month (icalendar--get-month-number
951 (substring entry-main
952 (match-beginning monpos)
953 (match-end monpos))))
954 (starttimestring (icalendar--diarytime-to-isotime
955 (if (match-beginning 4)
956 (substring entry-main
957 (match-beginning 4)
958 (match-end 4))
959 nil)
960 (if (match-beginning 5)
961 (substring entry-main
962 (match-beginning 5)
963 (match-end 5))
964 nil)))
965 (endtimestring (icalendar--diarytime-to-isotime
966 (if (match-beginning 7)
967 (substring entry-main
968 (match-beginning 7)
969 (match-end 7))
970 nil)
971 (if (match-beginning 8)
972 (substring entry-main
973 (match-beginning 8)
974 (match-end 8))
975 nil)))
976 (summary (icalendar--convert-string-for-export
977 (substring entry-main (match-beginning 9)
978 (match-end 9)))))
979 (when starttimestring
980 (unless endtimestring
981 (let ((time (read
982 (icalendar--rris "^T0?" ""
983 starttimestring))))
984 (setq endtimestring (format "T%06d"
985 (+ 10000 time))))))
986 (setq contents
987 (concat "\nDTSTART;"
988 (if starttimestring "VALUE=DATE-TIME:"
989 "VALUE=DATE:")
990 (format "1900%02d%02d" month day)
991 (or starttimestring "")
992 "\nDTEND;"
993 (if endtimestring "VALUE=DATE-TIME:"
994 "VALUE=DATE:")
995 ;; end is not included! shift by one day
996 (icalendar--date-to-isodate
997 (list month day 1900)
998 (if endtimestring 0 1))
999 (or endtimestring "")
1000 "\nSUMMARY:"
1001 summary
1002 "\nRRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH="
1003 (format "%2d" month)
1004 ";BYMONTHDAY="
1005 (format "%2d" day))))
1006 (unless (string= entry-rest "")
1007 (setq contents
1008 (concat contents "\nDESCRIPTION:"
1009 (icalendar--convert-string-for-export
1010 entry-rest)))))
1011 ;; "ordinary" events, start and end time given
1012 ;; 1 Feb 2003 Hs Hochzeitsfeier, Dreieich
1013 ((string-match
1014 (concat nonmarker
1015 "\\([^ /]+[ /]+[^ /]+[ /]+[^ ]+\\)\\s-+"
1016 "\\(0?\\([1-9][0-9]?:[0-9][0-9]\\)\\([ap]m\\)?"
1017 "\\("
1018 "-0?\\([1-9][0-9]?:[0-9][0-9]\\)\\([ap]m\\)?\\)?"
1019 "\\)?"
1020 "\\s-*\\(.*\\)")
1021 entry-main)
1022 (icalendar--dmsg "ordinary %s" entry-main)
1023 (let* ((startdatestring (icalendar--datestring-to-isodate
1024 (substring entry-main
1025 (match-beginning 1)
1026 (match-end 1))))
1027 (starttimestring (icalendar--diarytime-to-isotime
1028 (if (match-beginning 3)
1029 (substring entry-main
1030 (match-beginning 3)
1031 (match-end 3))
1032 nil)
1033 (if (match-beginning 4)
1034 (substring entry-main
1035 (match-beginning 4)
1036 (match-end 4))
1037 nil)))
1038 (endtimestring (icalendar--diarytime-to-isotime
1039 (if (match-beginning 6)
1040 (substring entry-main
1041 (match-beginning 6)
1042 (match-end 6))
1043 nil)
1044 (if (match-beginning 7)
1045 (substring entry-main
1046 (match-beginning 7)
1047 (match-end 7))
1048 nil)))
1049 (summary (icalendar--convert-string-for-export
1050 (substring entry-main (match-beginning 8)
1051 (match-end 8)))))
1052 (unless startdatestring
1053 (error "Could not parse date"))
1054 (when starttimestring
1055 (unless endtimestring
1056 (let ((time
1057 (read (icalendar--rris "^T0?" ""
1058 starttimestring))))
1059 (setq endtimestring (format "T%06d"
1060 (+ 10000 time))))))
1061 (setq contents (concat
1062 "\nDTSTART;"
1063 (if starttimestring "VALUE=DATE-TIME:"
1064 "VALUE=DATE:")
1065 startdatestring
1066 (or starttimestring "")
1067 "\nDTEND;"
1068 (if endtimestring "VALUE=DATE-TIME:"
1069 "VALUE=DATE:")
1070 (icalendar--datestring-to-isodate
1071 (substring entry-main
1072 (match-beginning 1)
1073 (match-end 1))
1074 (if endtimestring 0 1))
1075 (or endtimestring "")
1076 "\nSUMMARY:"
1077 summary))
1078 ;; could not parse the date
1079 (unless (string= entry-rest "")
1080 (setq contents
1081 (concat contents "\nDESCRIPTION:"
1082 (icalendar--convert-string-for-export
1083 entry-rest))))))
1084 ;; everything else
1085 (t
1086 ;; Oops! what's that?
1087 (error "Could not parse entry")))
1088 (setq result (concat result header contents "\nEND:VEVENT"))) 761 (setq result (concat result header contents "\nEND:VEVENT")))
1089 ;; handle errors 762 ;; handle errors
1090 (error 763 (error
1091 (setq found-error t) 764 (setq found-error t)
1092 (save-current-buffer 765 (save-current-buffer
1093 (set-buffer (get-buffer-create " *icalendar-errors*")) 766 (set-buffer (get-buffer-create "*icalendar-errors*"))
1094 (insert (format "Error in line %d -- %s: `%s'\n" 767 (insert (format "Error in line %d -- %s: `%s'\n"
1095 (count-lines (point-min) (point)) 768 (count-lines (point-min) (point))
1096 (cadr error-val) 769 (cadr error-val)
@@ -1110,6 +783,518 @@ FExport diary data into iCalendar file: ")
1110 (save-buffer)))) 783 (save-buffer))))
1111 found-error)) 784 found-error))
1112 785
786;; subroutines
787(defun icalendar--convert-ordinary-to-ical (nonmarker entry-main)
788 "Convert \"ordinary\" diary entry to icalendar format.
789
790NONMARKER is a regular expression matching the start of non-marking
791entries. ENTRY-MAIN is the first line of the diary entry."
792 (if (string-match (concat nonmarker
793 "\\([^ /]+[ /]+[^ /]+[ /]+[^ ]+\\)\\s-*"
794 "\\(0?\\([1-9][0-9]?:[0-9][0-9]\\)\\([ap]m\\)?"
795 "\\("
796 "-0?\\([1-9][0-9]?:[0-9][0-9]\\)\\([ap]m\\)?\\)?"
797 "\\)?"
798 "\\s-*\\(.*\\)")
799 entry-main)
800 (let* ((datetime (substring entry-main (match-beginning 1)
801 (match-end 1)))
802 (startisostring (icalendar--datestring-to-isodate
803 datetime))
804 (endisostring (icalendar--datestring-to-isodate
805 datetime 1))
806 (starttimestring (icalendar--diarytime-to-isotime
807 (if (match-beginning 3)
808 (substring entry-main
809 (match-beginning 3)
810 (match-end 3))
811 nil)
812 (if (match-beginning 4)
813 (substring entry-main
814 (match-beginning 4)
815 (match-end 4))
816 nil)))
817 (endtimestring (icalendar--diarytime-to-isotime
818 (if (match-beginning 6)
819 (substring entry-main
820 (match-beginning 6)
821 (match-end 6))
822 nil)
823 (if (match-beginning 7)
824 (substring entry-main
825 (match-beginning 7)
826 (match-end 7))
827 nil)))
828 (summary (icalendar--convert-string-for-export
829 (substring entry-main (match-beginning 8)
830 (match-end 8)))))
831 (icalendar--dmsg "ordinary %s" entry-main)
832
833 (unless startisostring
834 (error "Could not parse date"))
835 (when starttimestring
836 (unless endtimestring
837 (let ((time
838 (read (icalendar--rris "^T0?" ""
839 starttimestring))))
840 (setq endtimestring (format "T%06d"
841 (+ 10000 time))))))
842 (concat "\nDTSTART;"
843 (if starttimestring "VALUE=DATE-TIME:"
844 "VALUE=DATE:")
845 startisostring
846 (or starttimestring "")
847 "\nDTEND;"
848 (if endtimestring "VALUE=DATE-TIME:"
849 "VALUE=DATE:")
850 (if starttimestring
851 startisostring
852 endisostring)
853 (or endtimestring "")
854 "\nSUMMARY:"
855 summary))
856 ;; no match
857 nil))
858
859(defun icalendar--convert-weekly-to-ical (nonmarker entry-main)
860 "Convert weekly diary entry to icalendar format.
861
862NONMARKER is a regular expression matching the start of non-marking
863entries. ENTRY-MAIN is the first line of the diary entry."
864 (if (and (string-match (concat nonmarker
865 "\\([a-z]+\\)\\s-+"
866 "\\(0?\\([1-9][0-9]?:[0-9][0-9]\\)"
867 "\\([ap]m\\)?"
868 "\\(-0?"
869 "\\([1-9][0-9]?:[0-9][0-9]\\)"
870 "\\([ap]m\\)?\\)?"
871 "\\)?"
872 "\\s-*\\(.*\\)$")
873 entry-main)
874 (icalendar--get-weekday-abbrev
875 (substring entry-main (match-beginning 1)
876 (match-end 1))))
877 (let* ((day (icalendar--get-weekday-abbrev
878 (substring entry-main (match-beginning 1)
879 (match-end 1))))
880 (starttimestring (icalendar--diarytime-to-isotime
881 (if (match-beginning 3)
882 (substring entry-main
883 (match-beginning 3)
884 (match-end 3))
885 nil)
886 (if (match-beginning 4)
887 (substring entry-main
888 (match-beginning 4)
889 (match-end 4))
890 nil)))
891 (endtimestring (icalendar--diarytime-to-isotime
892 (if (match-beginning 6)
893 (substring entry-main
894 (match-beginning 6)
895 (match-end 6))
896 nil)
897 (if (match-beginning 7)
898 (substring entry-main
899 (match-beginning 7)
900 (match-end 7))
901 nil)))
902 (summary (icalendar--convert-string-for-export
903 (substring entry-main (match-beginning 8)
904 (match-end 8)))))
905 (icalendar--dmsg "weekly %s" entry-main)
906
907 (when starttimestring
908 (unless endtimestring
909 (let ((time (read
910 (icalendar--rris "^T0?" ""
911 starttimestring))))
912 (setq endtimestring (format "T%06d"
913 (+ 10000 time))))))
914 (concat "\nDTSTART;"
915 (if starttimestring
916 "VALUE=DATE-TIME:"
917 "VALUE=DATE:")
918 ;; find the correct week day,
919 ;; 1st january 2000 was a saturday
920 (format
921 "200001%02d"
922 (+ (icalendar--get-weekday-number day) 2))
923 (or starttimestring "")
924 "\nDTEND;"
925 (if endtimestring
926 "VALUE=DATE-TIME:"
927 "VALUE=DATE:")
928 (format
929 "200001%02d"
930 ;; end is non-inclusive!
931 (+ (icalendar--get-weekday-number day)
932 (if endtimestring 2 3)))
933 (or endtimestring "")
934 "\nSUMMARY:" summary
935 "\nRRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY="
936 day))
937 ;; no match
938 nil))
939
940(defun icalendar--convert-yearly-to-ical (nonmarker entry-main)
941 "Convert yearly diary entry to icalendar format.
942
943NONMARKER is a regular expression matching the start of non-marking
944entries. ENTRY-MAIN is the first line of the diary entry."
945 (if (string-match (concat nonmarker
946 (if european-calendar-style
947 "0?\\([1-9]+[0-9]?\\)\\s-+\\([a-z]+\\)\\s-+"
948 "\\([a-z]+\\)\\s-+0?\\([1-9]+[0-9]?\\)\\s-+")
949 "\\*?\\s-*"
950 "\\(0?\\([1-9][0-9]?:[0-9][0-9]\\)\\([ap]m\\)?"
951 "\\("
952 "-0?\\([1-9][0-9]?:[0-9][0-9]\\)\\([ap]m\\)?\\)?"
953 "\\)?"
954 "\\s-*\\([^0-9]+.*\\)$" ; must not match years
955 )
956 entry-main)
957 (let* ((daypos (if european-calendar-style 1 2))
958 (monpos (if european-calendar-style 2 1))
959 (day (read (substring entry-main
960 (match-beginning daypos)
961 (match-end daypos))))
962 (month (icalendar--get-month-number
963 (substring entry-main
964 (match-beginning monpos)
965 (match-end monpos))))
966 (starttimestring (icalendar--diarytime-to-isotime
967 (if (match-beginning 4)
968 (substring entry-main
969 (match-beginning 4)
970 (match-end 4))
971 nil)
972 (if (match-beginning 5)
973 (substring entry-main
974 (match-beginning 5)
975 (match-end 5))
976 nil)))
977 (endtimestring (icalendar--diarytime-to-isotime
978 (if (match-beginning 7)
979 (substring entry-main
980 (match-beginning 7)
981 (match-end 7))
982 nil)
983 (if (match-beginning 8)
984 (substring entry-main
985 (match-beginning 8)
986 (match-end 8))
987 nil)))
988 (summary (icalendar--convert-string-for-export
989 (substring entry-main (match-beginning 9)
990 (match-end 9)))))
991 (icalendar--dmsg "yearly %s" entry-main)
992
993 (when starttimestring
994 (unless endtimestring
995 (let ((time (read
996 (icalendar--rris "^T0?" ""
997 starttimestring))))
998 (setq endtimestring (format "T%06d"
999 (+ 10000 time))))))
1000 (concat "\nDTSTART;"
1001 (if starttimestring "VALUE=DATE-TIME:"
1002 "VALUE=DATE:")
1003 (format "1900%02d%02d" month day)
1004 (or starttimestring "")
1005 "\nDTEND;"
1006 (if endtimestring "VALUE=DATE-TIME:"
1007 "VALUE=DATE:")
1008 ;; end is not included! shift by one day
1009 (icalendar--date-to-isodate
1010 (list month day 1900)
1011 (if endtimestring 0 1))
1012 (or endtimestring "")
1013 "\nSUMMARY:"
1014 summary
1015 "\nRRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH="
1016 (format "%2d" month)
1017 ";BYMONTHDAY="
1018 (format "%2d" day)))
1019 ;; no match
1020 nil))
1021
1022(defun icalendar--convert-sexp-to-ical (nonmarker entry-main)
1023 "Convert complex sexp diary entry to icalendar format -- unsupported!
1024
1025FIXME!
1026
1027NONMARKER is a regular expression matching the start of non-marking
1028entries. ENTRY-MAIN is the first line of the diary entry."
1029 (if (string-match (concat nonmarker
1030 "%%(\\([^)]+\\))\\s-*\\(.*\\)")
1031 entry-main)
1032 (progn
1033 (icalendar--dmsg "diary-sexp %s" entry-main)
1034 (error "Sexp-entries are not supported yet"))
1035 ;; no match
1036 nil))
1037
1038(defun icalendar--convert-block-to-ical (nonmarker entry-main)
1039 "Convert block diary entry to icalendar format.
1040
1041NONMARKER is a regular expression matching the start of non-marking
1042entries. ENTRY-MAIN is the first line of the diary entry."
1043 (if (string-match (concat nonmarker
1044 "%%(diary-block \\([^ /]+[ /]+[^ /]+[ /]+[^ ]+\\)"
1045 " +\\([^ /]+[ /]+[^ /]+[ /]+[^ ]+\\))\\s-*"
1046 "\\(0?\\([1-9][0-9]?:[0-9][0-9]\\)\\([ap]m\\)?"
1047 "\\("
1048 "-0?\\([1-9][0-9]?:[0-9][0-9]\\)\\([ap]m\\)?\\)?"
1049 "\\)?"
1050 "\\s-*\\(.*\\)")
1051 entry-main)
1052 (let* ((startstring (substring entry-main
1053 (match-beginning 1)
1054 (match-end 1)))
1055 (endstring (substring entry-main
1056 (match-beginning 2)
1057 (match-end 2)))
1058 (startisostring (icalendar--datestring-to-isodate
1059 startstring))
1060 (endisostring (icalendar--datestring-to-isodate
1061 endstring))
1062 (endisostring+1 (icalendar--datestring-to-isodate
1063 endstring 1))
1064 (starttimestring (icalendar--diarytime-to-isotime
1065 (if (match-beginning 4)
1066 (substring entry-main
1067 (match-beginning 4)
1068 (match-end 4))
1069 nil)
1070 (if (match-beginning 5)
1071 (substring entry-main
1072 (match-beginning 5)
1073 (match-end 5))
1074 nil)))
1075 (endtimestring (icalendar--diarytime-to-isotime
1076 (if (match-beginning 7)
1077 (substring entry-main
1078 (match-beginning 7)
1079 (match-end 7))
1080 nil)
1081 (if (match-beginning 8)
1082 (substring entry-main
1083 (match-beginning 8)
1084 (match-end 8))
1085 nil)))
1086 (summary (icalendar--convert-string-for-export
1087 (substring entry-main (match-beginning 9)
1088 (match-end 9)))))
1089 (icalendar--dmsg "diary-block %s" entry-main)
1090 (when starttimestring
1091 (unless endtimestring
1092 (let ((time
1093 (read (icalendar--rris "^T0?" ""
1094 starttimestring))))
1095 (setq endtimestring (format "T%06d"
1096 (+ 10000 time))))))
1097 (if starttimestring
1098 ;; with time -> write rrule
1099 (concat "\nDTSTART;VALUE=DATE-TIME:"
1100 startisostring
1101 starttimestring
1102 "\nDTEND;VALUE=DATE-TIME:"
1103 startisostring
1104 endtimestring
1105 "\nSUMMARY:"
1106 summary
1107 "\nRRULE:FREQ=DAILY;INTERVAL=1;UNTIL="
1108 endisostring)
1109 ;; no time -> write long event
1110 (concat "\nDTSTART;VALUE=DATE:" startisostring
1111 "\nDTEND;VALUE=DATE:" endisostring+1
1112 "\nSUMMARY:" summary)))
1113 ;; no match
1114 nil))
1115
1116(defun icalendar--convert-float-to-ical (nonmarker entry-main)
1117 "Convert float diary entry to icalendar format -- unsupported!
1118
1119FIXME!
1120
1121NONMARKER is a regular expression matching the start of non-marking
1122entries. ENTRY-MAIN is the first line of the diary entry."
1123 (if (string-match (concat nonmarker
1124 "%%(diary-float \\([^)]+\\))\\s-*\\(.*\\)")
1125 entry-main)
1126 (progn
1127 (icalendar--dmsg "diary-float %s" entry-main)
1128 (error "`diary-float' is not supported yet"))
1129 ;; no match
1130 nil))
1131
1132(defun icalendar--convert-date-to-ical (nonmarker entry-main)
1133 "Convert `diary-date' diary entry to icalendar format -- unsupported!
1134
1135FIXME!
1136
1137NONMARKER is a regular expression matching the start of non-marking
1138entries. ENTRY-MAIN is the first line of the diary entry."
1139 (if (string-match (concat nonmarker
1140 "%%(diary-date \\([^)]+\\))\\s-*\\(.*\\)")
1141 entry-main)
1142 (progn
1143 (icalendar--dmsg "diary-date %s" entry-main)
1144 (error "`diary-date' is not supported yet"))
1145 ;; no match
1146 nil))
1147
1148(defun icalendar--convert-cyclic-to-ical (nonmarker entry-main)
1149 "Convert `diary-cyclic' diary entry to icalendar format.
1150
1151NONMARKER is a regular expression matching the start of non-marking
1152entries. ENTRY-MAIN is the first line of the diary entry."
1153 (if (string-match (concat nonmarker
1154 "%%(diary-cyclic \\([^ ]+\\) +"
1155 "\\([^ /]+[ /]+[^ /]+[ /]+[^ ]+\\))\\s-*"
1156 "\\(0?\\([1-9][0-9]?:[0-9][0-9]\\)\\([ap]m\\)?"
1157 "\\("
1158 "-0?\\([1-9][0-9]?:[0-9][0-9]\\)\\([ap]m\\)?\\)?"
1159 "\\)?"
1160 "\\s-*\\(.*\\)")
1161 entry-main)
1162 (let* ((frequency (substring entry-main (match-beginning 1)
1163 (match-end 1)))
1164 (datetime (substring entry-main (match-beginning 2)
1165 (match-end 2)))
1166 (startisostring (icalendar--datestring-to-isodate
1167 datetime))
1168 (endisostring (icalendar--datestring-to-isodate
1169 datetime))
1170 (endisostring+1 (icalendar--datestring-to-isodate
1171 datetime 1))
1172 (starttimestring (icalendar--diarytime-to-isotime
1173 (if (match-beginning 4)
1174 (substring entry-main
1175 (match-beginning 4)
1176 (match-end 4))
1177 nil)
1178 (if (match-beginning 5)
1179 (substring entry-main
1180 (match-beginning 5)
1181 (match-end 5))
1182 nil)))
1183 (endtimestring (icalendar--diarytime-to-isotime
1184 (if (match-beginning 7)
1185 (substring entry-main
1186 (match-beginning 7)
1187 (match-end 7))
1188 nil)
1189 (if (match-beginning 8)
1190 (substring entry-main
1191 (match-beginning 8)
1192 (match-end 8))
1193 nil)))
1194 (summary (icalendar--convert-string-for-export
1195 (substring entry-main (match-beginning 9)
1196 (match-end 9)))))
1197 (icalendar--dmsg "diary-cyclic %s" entry-main)
1198 (when starttimestring
1199 (unless endtimestring
1200 (let ((time
1201 (read (icalendar--rris "^T0?" ""
1202 starttimestring))))
1203 (setq endtimestring (format "T%06d"
1204 (+ 10000 time))))))
1205 (concat "\nDTSTART;"
1206 (if starttimestring "VALUE=DATE-TIME:"
1207 "VALUE=DATE:")
1208 startisostring
1209 (or starttimestring "")
1210 "\nDTEND;"
1211 (if endtimestring "VALUE=DATE-TIME:"
1212 "VALUE=DATE:")
1213 (if endtimestring endisostring endisostring+1)
1214 (or endtimestring "")
1215 "\nSUMMARY:" summary
1216 "\nRRULE:FREQ=DAILY;INTERVAL=" frequency
1217 ;; strange: korganizer does not expect
1218 ;; BYSOMETHING here...
1219 ))
1220 ;; no match
1221 nil))
1222
1223(defun icalendar--convert-anniversary-to-ical (nonmarker entry-main)
1224 "Convert `diary-anniversary' diary entry to icalendar format.
1225
1226NONMARKER is a regular expression matching the start of non-marking
1227entries. ENTRY-MAIN is the first line of the diary entry."
1228 (if (string-match (concat nonmarker
1229 "%%(diary-anniversary \\([^)]+\\))\\s-*"
1230 "\\(0?\\([1-9][0-9]?:[0-9][0-9]\\)\\([ap]m\\)?"
1231 "\\("
1232 "-0?\\([1-9][0-9]?:[0-9][0-9]\\)\\([ap]m\\)?\\)?"
1233 "\\)?"
1234 "\\s-*\\(.*\\)")
1235 entry-main)
1236 (let* ((datetime (substring entry-main (match-beginning 1)
1237 (match-end 1)))
1238 (startisostring (icalendar--datestring-to-isodate
1239 datetime))
1240 (endisostring (icalendar--datestring-to-isodate
1241 datetime 1))
1242 (starttimestring (icalendar--diarytime-to-isotime
1243 (if (match-beginning 3)
1244 (substring entry-main
1245 (match-beginning 3)
1246 (match-end 3))
1247 nil)
1248 (if (match-beginning 4)
1249 (substring entry-main
1250 (match-beginning 4)
1251 (match-end 4))
1252 nil)))
1253 (endtimestring (icalendar--diarytime-to-isotime
1254 (if (match-beginning 6)
1255 (substring entry-main
1256 (match-beginning 6)
1257 (match-end 6))
1258 nil)
1259 (if (match-beginning 7)
1260 (substring entry-main
1261 (match-beginning 7)
1262 (match-end 7))
1263 nil)))
1264 (summary (icalendar--convert-string-for-export
1265 (substring entry-main (match-beginning 8)
1266 (match-end 8)))))
1267 (icalendar--dmsg "diary-anniversary %s" entry-main)
1268 (when starttimestring
1269 (unless endtimestring
1270 (let ((time
1271 (read (icalendar--rris "^T0?" ""
1272 starttimestring))))
1273 (setq endtimestring (format "T%06d"
1274 (+ 10000 time))))))
1275 (concat "\nDTSTART;"
1276 (if starttimestring "VALUE=DATE-TIME:"
1277 "VALUE=DATE:")
1278 startisostring
1279 (or starttimestring "")
1280 "\nDTEND;"
1281 (if endtimestring "VALUE=DATE-TIME:"
1282 "VALUE=DATE:")
1283 endisostring
1284 (or endtimestring "")
1285 "\nSUMMARY:" summary
1286 "\nRRULE:FREQ=YEARLY;INTERVAL=1"
1287 ;; the following is redundant,
1288 ;; but korganizer seems to expect this... ;(
1289 ;; and evolution doesn't understand it... :(
1290 ;; so... who is wrong?!
1291 ";BYMONTH="
1292 (substring startisostring 4 6)
1293 ";BYMONTHDAY="
1294 (substring startisostring 6 8)))
1295 ;; no match
1296 nil))
1297
1113;; ====================================================================== 1298;; ======================================================================
1114;; Import -- convert icalendar to emacs-diary 1299;; Import -- convert icalendar to emacs-diary
1115;; ====================================================================== 1300;; ======================================================================
@@ -1170,10 +1355,12 @@ buffer `*icalendar-errors*'."
1170 ical-contents 1355 ical-contents
1171 diary-file do-not-ask non-marking)) 1356 diary-file do-not-ask non-marking))
1172 (when diary-file 1357 (when diary-file
1173 ;; save the diary file 1358 ;; save the diary file if it is visited already
1174 (save-current-buffer 1359 (let ((b (find-buffer-visiting diary-file)))
1175 (set-buffer (find-buffer-visiting diary-file)) 1360 (when b
1176 (save-buffer))) 1361 (save-current-buffer
1362 (set-buffer b)
1363 (save-buffer)))))
1177 (message "Converting icalendar...done") 1364 (message "Converting icalendar...done")
1178 ;; return t if no error occured 1365 ;; return t if no error occured
1179 (not ical-errors)) 1366 (not ical-errors))
@@ -1185,10 +1372,6 @@ buffer `*icalendar-errors*'."
1185(defalias 'icalendar-extract-ical-from-buffer 'icalendar-import-buffer) 1372(defalias 'icalendar-extract-ical-from-buffer 'icalendar-import-buffer)
1186(make-obsolete 'icalendar-extract-ical-from-buffer 'icalendar-import-buffer) 1373(make-obsolete 'icalendar-extract-ical-from-buffer 'icalendar-import-buffer)
1187 1374
1188;; ======================================================================
1189;; private area
1190;; ======================================================================
1191
1192(defun icalendar--format-ical-event (event) 1375(defun icalendar--format-ical-event (event)
1193 "Create a string representation of an iCalendar EVENT." 1376 "Create a string representation of an iCalendar EVENT."
1194 (let ((string icalendar-import-format) 1377 (let ((string icalendar-import-format)
@@ -1226,7 +1409,7 @@ whether to actually import it. NON-MARKING determines whether diary
1226events are created as non-marking. 1409events are created as non-marking.
1227This function attempts to return t if something goes wrong. In this 1410This function attempts to return t if something goes wrong. In this
1228case an error string which describes all the errors and problems is 1411case an error string which describes all the errors and problems is
1229written into the buffer ` *icalendar-errors*'." 1412written into the buffer `*icalendar-errors*'."
1230 (let* ((ev (icalendar--all-events ical-list)) 1413 (let* ((ev (icalendar--all-events ical-list))
1231 (error-string "") 1414 (error-string "")
1232 (event-ok t) 1415 (event-ok t)
@@ -1238,14 +1421,16 @@ written into the buffer ` *icalendar-errors*'."
1238 (setq ev (cdr ev)) 1421 (setq ev (cdr ev))
1239 (setq event-ok nil) 1422 (setq event-ok nil)
1240 (condition-case error-val 1423 (condition-case error-val
1241 (let* ((dtstart (icalendar--decode-isodatetime 1424 (let* ((dtstart (icalendar--get-event-property e 'DTSTART))
1242 (icalendar--get-event-property e 'DTSTART))) 1425 (dtstart-dec (icalendar--decode-isodatetime dtstart))
1243 (start-d (icalendar--datetime-to-diary-date 1426 (start-d (icalendar--datetime-to-diary-date
1244 dtstart)) 1427 dtstart-dec))
1245 (start-t (icalendar--datetime-to-colontime dtstart)) 1428 (start-t (icalendar--datetime-to-colontime dtstart-dec))
1246 (dtend (icalendar--decode-isodatetime 1429 (dtend (icalendar--get-event-property e 'DTEND))
1247 (icalendar--get-event-property e 'DTEND))) 1430 (dtend-dec (icalendar--decode-isodatetime dtend))
1431 (dtend-1-dec (icalendar--decode-isodatetime dtend -1))
1248 end-d 1432 end-d
1433 end-1-d
1249 end-t 1434 end-t
1250 (subject (icalendar--convert-string-for-import 1435 (subject (icalendar--convert-string-for-import
1251 (or (icalendar--get-event-property e 'SUMMARY) 1436 (or (icalendar--get-event-property e 'SUMMARY)
@@ -1253,165 +1438,50 @@ written into the buffer ` *icalendar-errors*'."
1253 (rrule (icalendar--get-event-property e 'RRULE)) 1438 (rrule (icalendar--get-event-property e 'RRULE))
1254 (rdate (icalendar--get-event-property e 'RDATE)) 1439 (rdate (icalendar--get-event-property e 'RDATE))
1255 (duration (icalendar--get-event-property e 'DURATION))) 1440 (duration (icalendar--get-event-property e 'DURATION)))
1256 (icalendar--dmsg "%s: %s" start-d subject) 1441 (icalendar--dmsg "%s: `%s'" start-d subject)
1257 ;; check whether start-time is missing 1442 ;; check whether start-time is missing
1258 (if (and (icalendar--get-event-property-attributes 1443 (if (and dtstart
1259 e 'DTSTART) 1444 (string=
1260 (string= (cadr (icalendar--get-event-property-attributes 1445 (cadr (icalendar--get-event-property-attributes
1261 e 'DTSTART)) 1446 e 'DTSTART))
1262 "DATE")) 1447 "DATE"))
1263 (setq start-t nil)) 1448 (setq start-t nil))
1264 (when duration 1449 (when duration
1265 (let ((dtend2 (icalendar--add-decoded-times 1450 (let ((dtend-dec-d (icalendar--add-decoded-times
1266 dtstart 1451 dtstart-dec
1267 (icalendar--decode-isoduration duration)))) 1452 (icalendar--decode-isoduration duration)))
1268 (if (and dtend (not (eq dtend dtend2))) 1453 (dtend-1-dec-d (icalendar--add-decoded-times
1454 dtstart-dec
1455 (icalendar--decode-isoduration duration
1456 t))))
1457 (if (and dtend-dec (not (eq dtend-dec dtend-dec-d)))
1269 (message "Inconsistent endtime and duration for %s" 1458 (message "Inconsistent endtime and duration for %s"
1270 subject)) 1459 subject))
1271 (setq dtend dtend2))) 1460 (setq dtend-dec dtend-dec-d)
1272 (setq end-d (if dtend 1461 (setq dtend-1-dec dtend-1-dec-d)))
1273 (icalendar--datetime-to-diary-date dtend) 1462 (setq end-d (if dtend-dec
1463 (icalendar--datetime-to-diary-date dtend-dec)
1274 start-d)) 1464 start-d))
1275 (setq end-t (if dtend 1465 (setq end-1-d (if dtend-1-dec
1276 (icalendar--datetime-to-colontime dtend) 1466 (icalendar--datetime-to-diary-date dtend-1-dec)
1467 start-d))
1468 (setq end-t (if (and
1469 dtend-dec
1470 (not (string=
1471 (cadr
1472 (icalendar--get-event-property-attributes
1473 e 'DTEND))
1474 "DATE")))
1475 (icalendar--datetime-to-colontime dtend-dec)
1277 start-t)) 1476 start-t))
1278 (icalendar--dmsg "start-d: %s, end-d: %s" start-d end-d) 1477 (icalendar--dmsg "start-d: %s, end-d: %s" start-d end-d)
1279 (cond 1478 (cond
1280 ;; recurring event 1479 ;; recurring event
1281 (rrule 1480 (rrule
1282 (icalendar--dmsg "recurring event") 1481 (setq diary-string
1283 (let* ((rrule-props (icalendar--split-value rrule)) 1482 (icalendar--convert-recurring-to-diary e dtstart-dec start-t
1284 (frequency (cadr (assoc 'FREQ rrule-props))) 1483 end-t))
1285 (until (cadr (assoc 'UNTIL rrule-props))) 1484 (setq event-ok t))
1286 (interval (read (cadr (assoc 'INTERVAL rrule-props)))))
1287 (cond ((string-equal frequency "WEEKLY")
1288 (if (not start-t)
1289 (progn
1290 ;; weekly and all-day
1291 (icalendar--dmsg "weekly all-day")
1292 (if until
1293 (let ((fro
1294 (icalendar--datetime-to-diary-date
1295 (icalendar--decode-isodatetime
1296 (icalendar--get-event-property
1297 e
1298 'DTSTART))))
1299 (unt
1300 (icalendar--datetime-to-diary-date
1301 (icalendar--decode-isodatetime
1302 until -1))))
1303 (setq diary-string
1304 (format
1305 (concat "%%%%(and "
1306 "(diary-cyclic %d %s) "
1307 "(diary-block %s %s))")
1308 (* interval 7)
1309 (icalendar--datetime-to-diary-date
1310 dtstart)
1311 (icalendar--datetime-to-diary-date
1312 dtstart)
1313 (icalendar--datetime-to-diary-date
1314 (icalendar--decode-isodatetime
1315 until -1)))))
1316 (setq diary-string
1317 (format "%%%%(and (diary-cyclic %d %s))"
1318 (* interval 7)
1319 (icalendar--datetime-to-diary-date
1320 dtstart))))
1321 (setq event-ok t))
1322 ;; weekly and not all-day
1323 (let* ((byday (cadr (assoc 'BYDAY rrule-props)))
1324 (weekday
1325 (icalendar--get-weekday-number byday)))
1326 (icalendar--dmsg "weekly not-all-day")
1327 (if until
1328 (let ((fro
1329 (icalendar--datetime-to-diary-date
1330 (icalendar--decode-isodatetime
1331 (icalendar--get-event-property
1332 e
1333 'DTSTART))))
1334 (unt
1335 (icalendar--datetime-to-diary-date
1336 (icalendar--decode-isodatetime
1337 until))))
1338 (setq diary-string
1339 (format
1340 (concat "%%%%(and "
1341 "(diary-cyclic %d %s) "
1342 "(diary-block %s %s)) "
1343 "%s%s%s")
1344 (* interval 7)
1345 (icalendar--datetime-to-diary-date
1346 dtstart)
1347 (icalendar--datetime-to-diary-date
1348 dtstart)
1349 (icalendar--datetime-to-diary-date
1350 (icalendar--decode-isodatetime
1351 until))
1352 start-t
1353 (if end-t "-" "") (or end-t ""))))
1354 ;; no limit
1355 ;; FIXME!!!!
1356 ;; DTSTART;VALUE=DATE-TIME:20030919T090000
1357 ;; DTEND;VALUE=DATE-TIME:20030919T113000
1358 (setq diary-string
1359 (format
1360 "%%%%(and (diary-cyclic %s %s)) %s%s%s"
1361 (* interval 7)
1362 (icalendar--datetime-to-diary-date
1363 dtstart)
1364 start-t
1365 (if end-t "-" "") (or end-t ""))))
1366 (setq event-ok t))))
1367 ;; yearly
1368 ((string-equal frequency "YEARLY")
1369 (icalendar--dmsg "yearly")
1370 (setq diary-string
1371 (format
1372 "%%%%(and (diary-anniversary %s))"
1373 (icalendar--datetime-to-diary-date dtstart)))
1374 (setq event-ok t))
1375 ;; FIXME: war auskommentiert:
1376 ((and (string-equal frequency "DAILY")
1377 ;;(not (string= start-d end-d))
1378 ;;(not start-t)
1379 ;;(not end-t)
1380 )
1381 (let ((ds (icalendar--datetime-to-diary-date
1382 (icalendar--decode-isodatetime
1383 (icalendar--get-event-property
1384 e 'DTSTART))))
1385 (de (icalendar--datetime-to-diary-date
1386 (icalendar--decode-isodatetime
1387 until -1))))
1388 (setq diary-string
1389 (format
1390 "%%%%(and (diary-block %s %s))"
1391 ds de)))
1392 (setq event-ok t))))
1393 ;; Handle exceptions from recurrence rules
1394 (let ((ex-dates (icalendar--get-event-properties e
1395 'EXDATE)))
1396 (while ex-dates
1397 (let* ((ex-start (icalendar--decode-isodatetime
1398 (car ex-dates)))
1399 (ex-d (icalendar--datetime-to-diary-date
1400 ex-start)))
1401 (setq diary-string
1402 (icalendar--rris "^%%(\\(and \\)?"
1403 (format
1404 "%%%%(and (not (diary-date %s)) "
1405 ex-d)
1406 diary-string)))
1407 (setq ex-dates (cdr ex-dates))))
1408 ;; FIXME: exception rules are not recognized
1409 (if (icalendar--get-event-property e 'EXRULE)
1410 (setq diary-string
1411 (concat diary-string
1412 "\n Exception rules: "
1413 (icalendar--get-event-properties
1414 e 'EXRULE)))))
1415 (rdate 1485 (rdate
1416 (icalendar--dmsg "rdate event") 1486 (icalendar--dmsg "rdate event")
1417 (setq diary-string "") 1487 (setq diary-string "")
@@ -1423,35 +1493,22 @@ written into the buffer ` *icalendar-errors*'."
1423 ;; non-recurring event 1493 ;; non-recurring event
1424 ;; all-day event 1494 ;; all-day event
1425 ((not (string= start-d end-d)) 1495 ((not (string= start-d end-d))
1426 (icalendar--dmsg "non-recurring event") 1496 (setq diary-string
1427 (let ((ds (icalendar--datetime-to-diary-date dtstart)) 1497 (icalendar--convert-non-recurring-all-day-to-diary
1428 (de (icalendar--datetime-to-diary-date dtend))) 1498 e start-d end-1-d))
1429 (setq diary-string
1430 (format "%%%%(and (diary-block %s %s))"
1431 ds de)))
1432 (setq event-ok t)) 1499 (setq event-ok t))
1433 ;; not all-day 1500 ;; not all-day
1434 ((and start-t (or (not end-t) 1501 ((and start-t (or (not end-t)
1435 (not (string= start-t end-t)))) 1502 (not (string= start-t end-t))))
1436 (icalendar--dmsg "not all day event") 1503 (setq diary-string
1437 (cond (end-t 1504 (icalendar--convert-non-recurring-not-all-day-to-diary
1438 (setq diary-string 1505 e dtstart-dec dtend-dec start-t end-t))
1439 (format "%s %s-%s"
1440 (icalendar--datetime-to-diary-date
1441 dtstart "/")
1442 start-t end-t)))
1443 (t
1444 (setq diary-string
1445 (format "%s %s"
1446 (icalendar--datetime-to-diary-date
1447 dtstart "/")
1448 start-t))))
1449 (setq event-ok t)) 1506 (setq event-ok t))
1450 ;; all-day event 1507 ;; all-day event
1451 (t 1508 (t
1452 (icalendar--dmsg "all day event") 1509 (icalendar--dmsg "all day event")
1453 (setq diary-string (icalendar--datetime-to-diary-date 1510 (setq diary-string (icalendar--datetime-to-diary-date
1454 dtstart "/")) 1511 dtstart-dec "/"))
1455 (setq event-ok t))) 1512 (setq event-ok t)))
1456 ;; add all other elements unless the user doesn't want to have 1513 ;; add all other elements unless the user doesn't want to have
1457 ;; them 1514 ;; them
@@ -1478,12 +1535,237 @@ written into the buffer ` *icalendar-errors*'."
1478 (message error-string)))) 1535 (message error-string))))
1479 (if found-error 1536 (if found-error
1480 (save-current-buffer 1537 (save-current-buffer
1481 (set-buffer (get-buffer-create " *icalendar-errors*")) 1538 (set-buffer (get-buffer-create "*icalendar-errors*"))
1482 (erase-buffer) 1539 (erase-buffer)
1483 (insert error-string))) 1540 (insert error-string)))
1484 (message "Converting icalendar...done") 1541 (message "Converting icalendar...done")
1485 found-error)) 1542 found-error))
1486 1543
1544;; subroutines for importing
1545(defun icalendar--convert-recurring-to-diary (e dtstart-dec start-t end-t)
1546 "Convert recurring icalendar event E to diary format.
1547
1548DTSTART-DEC is the DTSTART property of E.
1549START-T is the event's start time in diary format.
1550END-T is the event's end time in diary format."
1551 (icalendar--dmsg "recurring event")
1552 (let* ((rrule (icalendar--get-event-property e 'RRULE))
1553 (rrule-props (icalendar--split-value rrule))
1554 (frequency (cadr (assoc 'FREQ rrule-props)))
1555 (until (cadr (assoc 'UNTIL rrule-props)))
1556 (count (cadr (assoc 'COUNT rrule-props)))
1557 (interval (read (or (cadr (assoc 'INTERVAL rrule-props)) "1")))
1558 (dtstart-conv (icalendar--datetime-to-diary-date dtstart-dec))
1559 (until-conv (icalendar--datetime-to-diary-date
1560 (icalendar--decode-isodatetime until)))
1561 (until-1-conv (icalendar--datetime-to-diary-date
1562 (icalendar--decode-isodatetime until -1)))
1563 (result ""))
1564
1565 ;; FIXME FIXME interval!!!!!!!!!!!!!
1566
1567 (when count
1568 (if until
1569 (message "Must not have UNTIL and COUNT -- ignoring COUNT element!")
1570 (let ((until-1 0))
1571 (cond ((string-equal frequency "DAILY")
1572 (setq until (icalendar--add-decoded-times
1573 dtstart-dec
1574 (list 0 0 0 (* (read count) interval) 0 0)))
1575 (setq until-1 (icalendar--add-decoded-times
1576 dtstart-dec
1577 (list 0 0 0 (* (- (read count) 1) interval)
1578 0 0)))
1579 )
1580 ((string-equal frequency "WEEKLY")
1581 (setq until (icalendar--add-decoded-times
1582 dtstart-dec
1583 (list 0 0 0 (* (read count) 7 interval) 0 0)))
1584 (setq until-1 (icalendar--add-decoded-times
1585 dtstart-dec
1586 (list 0 0 0 (* (- (read count) 1) 7
1587 interval) 0 0)))
1588 )
1589 ((string-equal frequency "MONTHLY")
1590 (setq until (icalendar--add-decoded-times
1591 dtstart-dec (list 0 0 0 0 (* (- (read count) 1)
1592 interval) 0)))
1593 (setq until-1 (icalendar--add-decoded-times
1594 dtstart-dec (list 0 0 0 0 (* (- (read count) 1)
1595 interval) 0)))
1596 )
1597 ((string-equal frequency "YEARLY")
1598 (setq until (icalendar--add-decoded-times
1599 dtstart-dec (list 0 0 0 0 0 (* (- (read count) 1)
1600 interval))))
1601 (setq until-1 (icalendar--add-decoded-times
1602 dtstart-dec
1603 (list 0 0 0 0 0 (* (- (read count) 1)
1604 interval))))
1605 )
1606 (t
1607 (message "Cannot handle COUNT attribute for `%s' events."
1608 frequency)))
1609 (setq until-conv (icalendar--datetime-to-diary-date until))
1610 (setq until-1-conv (icalendar--datetime-to-diary-date until-1))
1611 ))
1612 )
1613 (cond ((string-equal frequency "WEEKLY")
1614 (if (not start-t)
1615 (progn
1616 ;; weekly and all-day
1617 (icalendar--dmsg "weekly all-day")
1618 (if until
1619 (setq result
1620 (format
1621 (concat "%%%%(and "
1622 "(diary-cyclic %d %s) "
1623 "(diary-block %s %s))")
1624 (* interval 7)
1625 dtstart-conv
1626 dtstart-conv
1627 (if count until-1-conv until-conv)
1628 ))
1629 (setq result
1630 (format "%%%%(and (diary-cyclic %d %s))"
1631 (* interval 7)
1632 dtstart-conv))))
1633 ;; weekly and not all-day
1634 (let* ((byday (cadr (assoc 'BYDAY rrule-props)))
1635 (weekday
1636 (icalendar--get-weekday-number byday)))
1637 (icalendar--dmsg "weekly not-all-day")
1638 (if until
1639 (setq result
1640 (format
1641 (concat "%%%%(and "
1642 "(diary-cyclic %d %s) "
1643 "(diary-block %s %s)) "
1644 "%s%s%s")
1645 (* interval 7)
1646 dtstart-conv
1647 dtstart-conv
1648 until-conv
1649 (or start-t "")
1650 (if end-t "-" "") (or end-t "")))
1651 ;; no limit
1652 ;; FIXME!!!!
1653 ;; DTSTART;VALUE=DATE-TIME:20030919T090000
1654 ;; DTEND;VALUE=DATE-TIME:20030919T113000
1655 (setq result
1656 (format
1657 "%%%%(and (diary-cyclic %s %s)) %s%s%s"
1658 (* interval 7)
1659 dtstart-conv
1660 (or start-t "")
1661 (if end-t "-" "") (or end-t "")))))))
1662 ;; yearly
1663 ((string-equal frequency "YEARLY")
1664 (icalendar--dmsg "yearly")
1665 (if until
1666 (setq result (format
1667 (concat "%%%%(and (diary-date %s %s t) "
1668 "(diary-block %s %s)) %s%s%s")
1669 (if european-calendar-style (nth 3 dtstart-dec)
1670 (nth 4 dtstart-dec))
1671 (if european-calendar-style (nth 4 dtstart-dec)
1672 (nth 3 dtstart-dec))
1673 dtstart-conv
1674 until-conv
1675 (or start-t "")
1676 (if end-t "-" "") (or end-t "")))
1677 (setq result (format
1678 "%%%%(and (diary-anniversary %s)) %s%s%s"
1679 dtstart-conv
1680 (or start-t "")
1681 (if end-t "-" "") (or end-t "")))))
1682 ;; monthly
1683 ((string-equal frequency "MONTHLY")
1684 (icalendar--dmsg "monthly")
1685 (setq result
1686 (format
1687 "%%%%(and (diary-date %s %s %s) (diary-block %s %s)) %s%s%s"
1688 (if european-calendar-style (nth 3 dtstart-dec) "t")
1689 (if european-calendar-style "t" (nth 3 dtstart-dec))
1690 "t"
1691 dtstart-conv
1692 (if until
1693 until-conv
1694 "1 1 9999") ;; FIXME: should be unlimited
1695 (or start-t "")
1696 (if end-t "-" "") (or end-t ""))))
1697 ;; daily
1698 ((and (string-equal frequency "DAILY"))
1699 (if until
1700 (setq result
1701 (format
1702 (concat "%%%%(and (diary-cyclic %s %s) "
1703 "(diary-block %s %s)) %s%s%s")
1704 interval dtstart-conv dtstart-conv
1705 (if count until-1-conv until-conv)
1706 (or start-t "")
1707 (if end-t "-" "") (or end-t "")))
1708 (setq result
1709 (format
1710 "%%%%(and (diary-cyclic %s %s)) %s%s%s"
1711 interval
1712 dtstart-conv
1713 (or start-t "")
1714 (if end-t "-" "") (or end-t ""))))))
1715 ;; Handle exceptions from recurrence rules
1716 (let ((ex-dates (icalendar--get-event-properties e 'EXDATE)))
1717 (while ex-dates
1718 (let* ((ex-start (icalendar--decode-isodatetime
1719 (car ex-dates)))
1720 (ex-d (icalendar--datetime-to-diary-date
1721 ex-start)))
1722 (setq result
1723 (icalendar--rris "^%%(\\(and \\)?"
1724 (format
1725 "%%%%(and (not (diary-date %s)) "
1726 ex-d)
1727 result)))
1728 (setq ex-dates (cdr ex-dates))))
1729 ;; FIXME: exception rules are not recognized
1730 (if (icalendar--get-event-property e 'EXRULE)
1731 (setq result
1732 (concat result
1733 "\n Exception rules: "
1734 (icalendar--get-event-properties
1735 e 'EXRULE))))
1736 result))
1737
1738(defun icalendar--convert-non-recurring-all-day-to-diary (event start-d end-d)
1739 "Convert non-recurring icalendar EVENT to diary format.
1740
1741DTSTART is the decoded DTSTART property of E.
1742Argument START-D gives the first day.
1743Argument END-D gives the last day."
1744 (icalendar--dmsg "non-recurring all-day event")
1745 (format "%%%%(and (diary-block %s %s))" start-d end-d))
1746
1747(defun icalendar--convert-non-recurring-not-all-day-to-diary (event dtstart-dec
1748 dtend-dec
1749 start-t
1750 end-t)
1751 "Convert recurring icalendar EVENT to diary format.
1752
1753DTSTART-DEC is the decoded DTSTART property of E.
1754DTEND-DEC is the decoded DTEND property of E.
1755START-T is the event's start time in diary format.
1756END-T is the event's end time in diary format."
1757 (icalendar--dmsg "not all day event")
1758 (cond (end-t
1759 (format "%s %s-%s"
1760 (icalendar--datetime-to-diary-date
1761 dtstart-dec "/")
1762 start-t end-t))
1763 (t
1764 (format "%s %s"
1765 (icalendar--datetime-to-diary-date
1766 dtstart-dec "/")
1767 start-t))))
1768
1487(defun icalendar--add-diary-entry (string diary-file non-marking 1769(defun icalendar--add-diary-entry (string diary-file non-marking
1488 &optional subject) 1770 &optional subject)
1489 "Add STRING to the diary file DIARY-FILE. 1771 "Add STRING to the diary file DIARY-FILE.
diff --git a/lisp/comint.el b/lisp/comint.el
index 35309f7507a..fbb5810de16 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -159,7 +159,7 @@
159Defaults to \"^\", the null string at BOL. 159Defaults to \"^\", the null string at BOL.
160 160
161This variable is only used if the variable 161This variable is only used if the variable
162`comint-use-prompt-regexp-instead-of-fields' is non-nil. 162`comint-use-prompt-regexp' is non-nil.
163 163
164Good choices: 164Good choices:
165 Canonical Lisp: \"^[^> \\n]*>+:? *\" (Lucid, franz, kcl, T, cscheme, oaklisp) 165 Canonical Lisp: \"^[^> \\n]*>+:? *\" (Lucid, franz, kcl, T, cscheme, oaklisp)
@@ -353,7 +353,7 @@ text. It returns the text to be submitted as process input. The
353default is `comint-get-old-input-default', which either grabs the 353default is `comint-get-old-input-default', which either grabs the
354current input field or grabs the current line and strips off leading 354current input field or grabs the current line and strips off leading
355text matching `comint-prompt-regexp', depending on the value of 355text matching `comint-prompt-regexp', depending on the value of
356`comint-use-prompt-regexp-instead-of-fields'.") 356`comint-use-prompt-regexp'.")
357 357
358(defvar comint-dynamic-complete-functions 358(defvar comint-dynamic-complete-functions
359 '(comint-replace-by-expanded-history comint-dynamic-complete-filename) 359 '(comint-replace-by-expanded-history comint-dynamic-complete-filename)
@@ -373,6 +373,7 @@ history list. Default is to save anything that isn't all whitespace.")
373 "Abnormal hook run before input is sent to the process. 373 "Abnormal hook run before input is sent to the process.
374These functions get one argument, a string containing the text to send.") 374These functions get one argument, a string containing the text to send.")
375 375
376;;;###autoload
376(defvar comint-output-filter-functions '(comint-postoutput-scroll-to-bottom comint-watch-for-password-prompt) 377(defvar comint-output-filter-functions '(comint-postoutput-scroll-to-bottom comint-watch-for-password-prompt)
377 "Functions to call after output is inserted into the buffer. 378 "Functions to call after output is inserted into the buffer.
378One possible function is `comint-postoutput-scroll-to-bottom'. 379One possible function is `comint-postoutput-scroll-to-bottom'.
@@ -406,8 +407,8 @@ See `comint-send-input'."
406;; Note: If it is decided to purge comint-prompt-regexp from the source 407;; Note: If it is decided to purge comint-prompt-regexp from the source
407;; entirely, searching for uses of this variable will help to identify 408;; entirely, searching for uses of this variable will help to identify
408;; places that need attention. 409;; places that need attention.
409(defcustom comint-use-prompt-regexp-instead-of-fields nil 410(defcustom comint-use-prompt-regexp nil
410 "*If non-nil, use `comint-prompt-regexp' to distinguish prompts from user-input. 411 "*If non-nil, use `comint-prompt-regexp' to recognize prompts.
411If nil, then program output and user-input are given different `field' 412If nil, then program output and user-input are given different `field'
412properties, which Emacs commands can use to distinguish them (in 413properties, which Emacs commands can use to distinguish them (in
413particular, common movement commands such as begining-of-line respect 414particular, common movement commands such as begining-of-line respect
@@ -415,6 +416,13 @@ field boundaries in a natural way)."
415 :type 'boolean 416 :type 'boolean
416 :group 'comint) 417 :group 'comint)
417 418
419;; Autoload is necessary for Custom to recognize old alias.
420;;;###autoload
421(defvaralias 'comint-use-prompt-regexp-instead-of-fields
422 'comint-use-prompt-regexp)
423(make-obsolete-variable 'comint-use-prompt-regexp-instead-of-fields
424 'comint-use-prompt-regexp "22.1")
425
418(defcustom comint-mode-hook '(turn-on-font-lock) 426(defcustom comint-mode-hook '(turn-on-font-lock)
419 "Hook run upon entry to `comint-mode'. 427 "Hook run upon entry to `comint-mode'.
420This is run before the process is cranked up." 428This is run before the process is cranked up."
@@ -1150,7 +1158,7 @@ See `comint-magic-space' and `comint-replace-by-expanded-history-before-point'.
1150Returns t if successful." 1158Returns t if successful."
1151 (interactive) 1159 (interactive)
1152 (if (and comint-input-autoexpand 1160 (if (and comint-input-autoexpand
1153 (if comint-use-prompt-regexp-instead-of-fields 1161 (if comint-use-prompt-regexp
1154 ;; Use comint-prompt-regexp 1162 ;; Use comint-prompt-regexp
1155 (save-excursion 1163 (save-excursion
1156 (beginning-of-line) 1164 (beginning-of-line)
@@ -1419,10 +1427,10 @@ in the buffer. E.g.,
1419 1427
1420If the interpreter is the csh, 1428If the interpreter is the csh,
1421 `comint-get-old-input' is the default: 1429 `comint-get-old-input' is the default:
1422 If `comint-use-prompt-regexp-instead-of-fields' is nil, then 1430 If `comint-use-prompt-regexp' is nil, then
1423 either return the current input field, if point is on an input 1431 either return the current input field, if point is on an input
1424 field, or the current line, if point is on an output field. 1432 field, or the current line, if point is on an output field.
1425 If `comint-use-prompt-regexp-instead-of-fields' is non-nil, then 1433 If `comint-use-prompt-regexp' is non-nil, then
1426 return the current line with any initial string matching the 1434 return the current line with any initial string matching the
1427 regexp `comint-prompt-regexp' removed. 1435 regexp `comint-prompt-regexp' removed.
1428 `comint-input-filter-functions' monitors input for \"cd\", \"pushd\", and 1436 `comint-input-filter-functions' monitors input for \"cd\", \"pushd\", and
@@ -1487,14 +1495,14 @@ Similarly for Soar, Scheme, etc."
1487 font-lock-face comint-highlight-input 1495 font-lock-face comint-highlight-input
1488 mouse-face highlight 1496 mouse-face highlight
1489 help-echo "mouse-2: insert after prompt as new input")) 1497 help-echo "mouse-2: insert after prompt as new input"))
1490 (unless comint-use-prompt-regexp-instead-of-fields 1498 (unless comint-use-prompt-regexp
1491 ;; Give old user input a field property of `input', to 1499 ;; Give old user input a field property of `input', to
1492 ;; distinguish it from both process output and unsent 1500 ;; distinguish it from both process output and unsent
1493 ;; input. The terminating newline is put into a special 1501 ;; input. The terminating newline is put into a special
1494 ;; `boundary' field to make cursor movement between input 1502 ;; `boundary' field to make cursor movement between input
1495 ;; and output fields smoother. 1503 ;; and output fields smoother.
1496 (put-text-property beg end 'field 'input))) 1504 (put-text-property beg end 'field 'input)))
1497 (unless (or no-newline comint-use-prompt-regexp-instead-of-fields) 1505 (unless (or no-newline comint-use-prompt-regexp)
1498 ;; Cover the terminating newline 1506 ;; Cover the terminating newline
1499 (add-text-properties end (1+ end) 1507 (add-text-properties end (1+ end)
1500 '(rear-nonsticky t 1508 '(rear-nonsticky t
@@ -1708,7 +1716,7 @@ Make backspaces delete the previous character."
1708 1716
1709 (goto-char (process-mark process)) ; in case a filter moved it 1717 (goto-char (process-mark process)) ; in case a filter moved it
1710 1718
1711 (unless comint-use-prompt-regexp-instead-of-fields 1719 (unless comint-use-prompt-regexp
1712 (let ((inhibit-read-only t) 1720 (let ((inhibit-read-only t)
1713 (inhibit-modification-hooks t)) 1721 (inhibit-modification-hooks t))
1714 (add-text-properties comint-last-output-start (point) 1722 (add-text-properties comint-last-output-start (point)
@@ -1844,10 +1852,10 @@ This function could be on `comint-output-filter-functions' or bound to a key."
1844 1852
1845(defun comint-get-old-input-default () 1853(defun comint-get-old-input-default ()
1846 "Default for `comint-get-old-input'. 1854 "Default for `comint-get-old-input'.
1847If `comint-use-prompt-regexp-instead-of-fields' is nil, then either 1855If `comint-use-prompt-regexp' is nil, then either
1848return the current input field, if point is on an input field, or the 1856return the current input field, if point is on an input field, or the
1849current line, if point is on an output field. 1857current line, if point is on an output field.
1850If `comint-use-prompt-regexp-instead-of-fields' is non-nil, then return 1858If `comint-use-prompt-regexp' is non-nil, then return
1851the current line with any initial string matching the regexp 1859the current line with any initial string matching the regexp
1852`comint-prompt-regexp' removed." 1860`comint-prompt-regexp' removed."
1853 (let ((bof (field-beginning))) 1861 (let ((bof (field-beginning)))
@@ -1880,10 +1888,10 @@ set the hook `comint-input-sender'."
1880 1888
1881(defun comint-line-beginning-position () 1889(defun comint-line-beginning-position ()
1882 "Return the buffer position of the beginning of the line, after any prompt. 1890 "Return the buffer position of the beginning of the line, after any prompt.
1883If `comint-use-prompt-regexp-instead-of-fields' is non-nil, then the 1891If `comint-use-prompt-regexp' is non-nil, then the prompt skip is done by
1884prompt skip is done by skipping text matching the regular expression 1892skipping text matching the regular expression `comint-prompt-regexp',
1885`comint-prompt-regexp', a buffer local variable." 1893a buffer local variable."
1886 (if comint-use-prompt-regexp-instead-of-fields 1894 (if comint-use-prompt-regexp
1887 ;; Use comint-prompt-regexp 1895 ;; Use comint-prompt-regexp
1888 (save-excursion 1896 (save-excursion
1889 (beginning-of-line) 1897 (beginning-of-line)
@@ -1901,9 +1909,9 @@ prompt skip is done by skipping text matching the regular expression
1901(defun comint-bol (&optional arg) 1909(defun comint-bol (&optional arg)
1902 "Go to the beginning of line, then skip past the prompt, if any. 1910 "Go to the beginning of line, then skip past the prompt, if any.
1903If prefix argument is given (\\[universal-argument]) the prompt is not skipped. 1911If prefix argument is given (\\[universal-argument]) the prompt is not skipped.
1904If `comint-use-prompt-regexp-instead-of-fields' is non-nil, then the 1912If `comint-use-prompt-regexp' is non-nil, then the prompt skip is done
1905prompt skip is done by skipping text matching the regular expression 1913by skipping text matching the regular expression `comint-prompt-regexp',
1906`comint-prompt-regexp', a buffer local variable." 1914a buffer local variable."
1907 (interactive "P") 1915 (interactive "P")
1908 (if arg 1916 (if arg
1909 ;; Unlike `beginning-of-line', forward-line ignores field boundaries 1917 ;; Unlike `beginning-of-line', forward-line ignores field boundaries
@@ -2034,7 +2042,7 @@ Sets mark to the value of point when this command is run."
2034 (interactive) 2042 (interactive)
2035 (push-mark) 2043 (push-mark)
2036 (let ((pos (or (marker-position comint-last-input-end) (point-max)))) 2044 (let ((pos (or (marker-position comint-last-input-end) (point-max))))
2037 (cond (comint-use-prompt-regexp-instead-of-fields 2045 (cond (comint-use-prompt-regexp
2038 (goto-char pos) 2046 (goto-char pos)
2039 (beginning-of-line 0) 2047 (beginning-of-line 0)
2040 (set-window-start (selected-window) (point)) 2048 (set-window-start (selected-window) (point))
@@ -2127,13 +2135,13 @@ Sends an EOF only if point is at the end of the buffer and there is no input."
2127 2135
2128(defun comint-backward-matching-input (regexp n) 2136(defun comint-backward-matching-input (regexp n)
2129 "Search backward through buffer for input fields that match REGEXP. 2137 "Search backward through buffer for input fields that match REGEXP.
2130If `comint-use-prompt-regexp-instead-of-fields' is non-nil, then input 2138If `comint-use-prompt-regexp' is non-nil, then input fields are identified
2131fields are identified by lines that match `comint-prompt-regexp'. 2139by lines that match `comint-prompt-regexp'.
2132 2140
2133With prefix argument N, search for Nth previous match. 2141With prefix argument N, search for Nth previous match.
2134If N is negative, find the next or Nth next match." 2142If N is negative, find the next or Nth next match."
2135 (interactive (comint-regexp-arg "Backward input matching (regexp): ")) 2143 (interactive (comint-regexp-arg "Backward input matching (regexp): "))
2136 (if comint-use-prompt-regexp-instead-of-fields 2144 (if comint-use-prompt-regexp
2137 ;; Use comint-prompt-regexp 2145 ;; Use comint-prompt-regexp
2138 (let* ((re (concat comint-prompt-regexp ".*" regexp)) 2146 (let* ((re (concat comint-prompt-regexp ".*" regexp))
2139 (pos (save-excursion (end-of-line (if (> n 0) 0 1)) 2147 (pos (save-excursion (end-of-line (if (> n 0) 0 1))
@@ -2159,8 +2167,8 @@ If N is negative, find the next or Nth next match."
2159 2167
2160(defun comint-forward-matching-input (regexp arg) 2168(defun comint-forward-matching-input (regexp arg)
2161 "Search forward through buffer for input fields that match REGEXP. 2169 "Search forward through buffer for input fields that match REGEXP.
2162If `comint-use-prompt-regexp-instead-of-fields' is non-nil, then input 2170If `comint-use-prompt-regexp' is non-nil, then input fields are identified
2163fields are identified by lines that match `comint-prompt-regexp'. 2171by lines that match `comint-prompt-regexp'.
2164 2172
2165With prefix argument N, search for Nth following match. 2173With prefix argument N, search for Nth following match.
2166If N is negative, find the previous or Nth previous match." 2174If N is negative, find the previous or Nth previous match."
@@ -2170,11 +2178,11 @@ If N is negative, find the previous or Nth previous match."
2170 2178
2171(defun comint-next-prompt (n) 2179(defun comint-next-prompt (n)
2172 "Move to end of Nth next prompt in the buffer. 2180 "Move to end of Nth next prompt in the buffer.
2173If `comint-use-prompt-regexp-instead-of-fields' is nil, then this means 2181If `comint-use-prompt-regexp' is nil, then this means the beginning of
2174the beginning of the Nth next `input' field, otherwise, it means the Nth 2182the Nth next `input' field, otherwise, it means the Nth occurrence of
2175occurrence of text matching `comint-prompt-regexp'." 2183text matching `comint-prompt-regexp'."
2176 (interactive "p") 2184 (interactive "p")
2177 (if comint-use-prompt-regexp-instead-of-fields 2185 (if comint-use-prompt-regexp
2178 ;; Use comint-prompt-regexp 2186 ;; Use comint-prompt-regexp
2179 (let ((paragraph-start comint-prompt-regexp)) 2187 (let ((paragraph-start comint-prompt-regexp))
2180 (end-of-line (if (> n 0) 1 0)) 2188 (end-of-line (if (> n 0) 1 0))
@@ -2207,9 +2215,9 @@ occurrence of text matching `comint-prompt-regexp'."
2207 2215
2208(defun comint-previous-prompt (n) 2216(defun comint-previous-prompt (n)
2209 "Move to end of Nth previous prompt in the buffer. 2217 "Move to end of Nth previous prompt in the buffer.
2210If `comint-use-prompt-regexp-instead-of-fields' is nil, then this means 2218If `comint-use-prompt-regexp' is nil, then this means the beginning of
2211the beginning of the Nth previous `input' field, otherwise, it means the Nth 2219the Nth previous `input' field, otherwise, it means the Nth occurrence of
2212occurrence of text matching `comint-prompt-regexp'." 2220text matching `comint-prompt-regexp'."
2213 (interactive "p") 2221 (interactive "p")
2214 (comint-next-prompt (- n))) 2222 (comint-next-prompt (- n)))
2215 2223
@@ -3022,7 +3030,7 @@ the process mark is at the beginning of the accumulated input."
3022;; appropriate magic default by examining what we think is the prompt)? 3030;; appropriate magic default by examining what we think is the prompt)?
3023;; 3031;;
3024;; Fixme: look for appropriate fields, rather than regexp, if 3032;; Fixme: look for appropriate fields, rather than regexp, if
3025;; `comint-use-prompt-regexp-instead-of-fields' is true. 3033;; `comint-use-prompt-regexp' is true.
3026 3034
3027;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3035;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3028;; Variables 3036;; Variables
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index 60fc862676d..5c92f247a05 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -114,6 +114,18 @@ was first made obsolete, for example a date or a release number."
114 (put function 'byte-obsolete-info (list new handler when))) 114 (put function 'byte-obsolete-info (list new handler when)))
115 function) 115 function)
116 116
117(defmacro define-obsolete-function-alias (function new
118 &optional when docstring)
119 "Set FUNCTION's function definition to NEW and warn that FUNCTION is obsolete.
120If provided, WHEN should be a string indicating when FUNCTION was
121first made obsolete, for example a date or a release number. The
122optional argument DOCSTRING specifies the documentation string
123for FUNCTION; if DOCSTRING is omitted or nil, FUNCTION uses the
124documentation string of NEW unluess it already has one."
125 `(progn
126 (defalias ,function ,new ,docstring)
127 (make-obsolete ,function ,new ,when)))
128
117(defun make-obsolete-variable (variable new &optional when) 129(defun make-obsolete-variable (variable new &optional when)
118 "Make the byte-compiler warn that VARIABLE is obsolete. 130 "Make the byte-compiler warn that VARIABLE is obsolete.
119The warning will say that NEW should be used instead. 131The warning will say that NEW should be used instead.
@@ -129,6 +141,18 @@ was first made obsolete, for example a date or a release number."
129 (put variable 'byte-obsolete-variable (cons new when)) 141 (put variable 'byte-obsolete-variable (cons new when))
130 variable) 142 variable)
131 143
144(defmacro define-obsolete-variable-alias (variable new
145 &optional when docstring)
146 "Make VARIABLE a variable alias for NEW and warn that VARIABLE is obsolete.
147If provided, WHEN should be a string indicating when VARIABLE was
148first made obsolete, for example a date or a release number. The
149optional argument DOCSTRING specifies the documentation string
150for VARIABLE; if DOCSTRING is omitted or nil, VARIABLE uses the
151documentation string of NEW unless it already has one."
152 `(progn
153 (defvaralias ,variable ,new ,docstring)
154 (make-obsolete-variable ,variable ,new ,when)))
155
132(defmacro dont-compile (&rest body) 156(defmacro dont-compile (&rest body)
133 "Like `progn', but the body always runs interpreted (not compiled). 157 "Like `progn', but the body always runs interpreted (not compiled).
134If you think you need this, you're probably making a mistake somewhere." 158If you think you need this, you're probably making a mistake somewhere."
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 950193463f7..a752f9f9b61 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -2900,9 +2900,6 @@ That command is designed for interactive use only" fn))
2900(put 'byte-concatN 'byte-opcode-invert 'concat) 2900(put 'byte-concatN 'byte-opcode-invert 'concat)
2901(put 'byte-insertN 'byte-opcode-invert 'insert) 2901(put 'byte-insertN 'byte-opcode-invert 'insert)
2902 2902
2903(byte-defop-compiler (dot byte-point) 0)
2904(byte-defop-compiler (dot-max byte-point-max) 0)
2905(byte-defop-compiler (dot-min byte-point-min) 0)
2906(byte-defop-compiler point 0) 2903(byte-defop-compiler point 0)
2907;;(byte-defop-compiler mark 0) ;; obsolete 2904;;(byte-defop-compiler mark 0) ;; obsolete
2908(byte-defop-compiler point-max 0) 2905(byte-defop-compiler point-max 0)
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index 01935c9d5e8..831ffb2d576 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -95,8 +95,8 @@ BODY contains code that will be executed each time the mode is (dis)activated.
95 will be passed to `defcustom' if the minor mode is global): 95 will be passed to `defcustom' if the minor mode is global):
96:group GROUP Custom group name to use in all generated `defcustom' forms. 96:group GROUP Custom group name to use in all generated `defcustom' forms.
97 Defaults to MODE without the possible trailing \"-mode\". 97 Defaults to MODE without the possible trailing \"-mode\".
98 (This default may not be a valid customization group defined 98 Don't use this default group name unless you have written a
99 with `defgroup'. Make sure it is.) 99 `defgroup' to define that group properly.
100:global GLOBAL If non-nil specifies that the minor mode is not meant to be 100:global GLOBAL If non-nil specifies that the minor mode is not meant to be
101 buffer-local, so don't make the variable MODE buffer-local. 101 buffer-local, so don't make the variable MODE buffer-local.
102 By default, the mode is buffer-local. 102 By default, the mode is buffer-local.
diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el
index b0f3b9b9d3e..78ba1fe27bf 100644
--- a/lisp/emacs-lisp/easymenu.el
+++ b/lisp/emacs-lisp/easymenu.el
@@ -160,18 +160,18 @@ A menu item can be a list with the same format as MENU. This is a submenu."
160 (let ((keymap (easy-menu-create-menu (car menu) (cdr menu)))) 160 (let ((keymap (easy-menu-create-menu (car menu) (cdr menu))))
161 (when symbol 161 (when symbol
162 (set symbol keymap) 162 (set symbol keymap)
163 (fset symbol 163 (defalias symbol
164 `(lambda (event) ,doc (interactive "@e") 164 `(lambda (event) ,doc (interactive "@e")
165 ;; FIXME: XEmacs uses popup-menu which calls the binding 165 ;; FIXME: XEmacs uses popup-menu which calls the binding
166 ;; while x-popup-menu only returns the selection. 166 ;; while x-popup-menu only returns the selection.
167 (x-popup-menu event 167 (x-popup-menu event
168 (or (and (symbolp ,symbol) 168 (or (and (symbolp ,symbol)
169 (funcall 169 (funcall
170 (or (plist-get (get ,symbol 'menu-prop) 170 (or (plist-get (get ,symbol 'menu-prop)
171 :filter) 171 :filter)
172 'identity) 172 'identity)
173 (symbol-function ,symbol))) 173 (symbol-function ,symbol)))
174 ,symbol))))) 174 ,symbol)))))
175 (mapcar (lambda (map) 175 (mapcar (lambda (map)
176 (define-key map (vector 'menu-bar (easy-menu-intern (car menu))) 176 (define-key map (vector 'menu-bar (easy-menu-intern (car menu)))
177 (cons 'menu-item 177 (cons 'menu-item
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index f31dafb7b11..b23217151e3 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -45,7 +45,7 @@
45 45
46;; Major modes for other languages may use Eldoc by defining an 46;; Major modes for other languages may use Eldoc by defining an
47;; appropriate function as the buffer-local value of 47;; appropriate function as the buffer-local value of
48;; `eldoc-print-current-symbol-info-function'. 48;; `eldoc-documentation-function'.
49 49
50;;; Code: 50;;; Code:
51 51
@@ -139,16 +139,11 @@ truncated to make more of the arglist or documentation string visible."
139;;;###autoload 139;;;###autoload
140(define-minor-mode eldoc-mode 140(define-minor-mode eldoc-mode
141 "Toggle ElDoc mode on or off. 141 "Toggle ElDoc mode on or off.
142Show the defined parameters for the elisp function near point. 142In ElDoc mode, the echo area displays information about a
143 143function or variable in the text where point is. If point is
144For the emacs lisp function at the beginning of the sexp which point is 144on a documented variable, it displays that variable's doc string.
145within, show the defined parameters for the function in the echo area. 145Otherwise it displays the argument list of the function called
146This information is extracted directly from the function or macro if it is 146in the expression point is on.
147in pure lisp. If the emacs function is a subr, the parameters are obtained
148from the documentation string if possible.
149
150If point is over a documented variable, print that variable's docstring
151instead.
152 147
153With prefix ARG, turn ElDoc mode on if and only if ARG is positive." 148With prefix ARG, turn ElDoc mode on if and only if ARG is positive."
154 :group 'eldoc :lighter eldoc-minor-mode-string 149 :group 'eldoc :lighter eldoc-minor-mode-string
@@ -167,7 +162,6 @@ With prefix ARG, turn ElDoc mode on if and only if ARG is positive."
167 (eldoc-mode 1)) 162 (eldoc-mode 1))
168 163
169 164
170;; Idle timers are part of Emacs 19.31 and later.
171(defun eldoc-schedule-timer () 165(defun eldoc-schedule-timer ()
172 (or (and eldoc-timer 166 (or (and eldoc-timer
173 (memq eldoc-timer timer-idle-list)) 167 (memq eldoc-timer timer-idle-list))
@@ -235,7 +229,7 @@ With prefix ARG, turn ElDoc mode on if and only if ARG is positive."
235 (not (eq (selected-window) (minibuffer-window))))) 229 (not (eq (selected-window) (minibuffer-window)))))
236 230
237 231
238(defvar eldoc-print-current-symbol-info-function nil 232(defvar eldoc-documentation-function nil
239 "If non-nil, function to call to return doc string. 233 "If non-nil, function to call to return doc string.
240The function of no args should return a one-line string for displaying 234The function of no args should return a one-line string for displaying
241doc about a function etc. appropriate to the context around point. 235doc about a function etc. appropriate to the context around point.
@@ -249,8 +243,8 @@ Emacs Lisp mode) that support Eldoc.")
249(defun eldoc-print-current-symbol-info () 243(defun eldoc-print-current-symbol-info ()
250 (condition-case err 244 (condition-case err
251 (and (eldoc-display-message-p) 245 (and (eldoc-display-message-p)
252 (if eldoc-print-current-symbol-info-function 246 (if eldoc-documentation-function
253 (eldoc-message (funcall eldoc-print-current-symbol-info-function)) 247 (eldoc-message (funcall eldoc-documentation-function))
254 (let* ((current-symbol (eldoc-current-symbol)) 248 (let* ((current-symbol (eldoc-current-symbol))
255 (current-fnsym (eldoc-fnsym-in-current-sexp)) 249 (current-fnsym (eldoc-fnsym-in-current-sexp))
256 (doc (cond 250 (doc (cond
diff --git a/lisp/emacs-lisp/generic.el b/lisp/emacs-lisp/generic.el
index 6851faeddd6..410b1d8eaa5 100644
--- a/lisp/emacs-lisp/generic.el
+++ b/lisp/emacs-lisp/generic.el
@@ -35,15 +35,15 @@
35;; 35;;
36;; Each generic mode can define the following: 36;; Each generic mode can define the following:
37;; 37;;
38;; * List of comment-characters. The entries in this list should be 38;; * List of comment-characters. The elements of this list should be
39;; either a character, a one or two character string or a cons pair. 39;; either a character, a one or two character string, or a cons
40;; If the entry is a character or a string, it is added to the 40;; cell. If the entry is a character or a string, it is added to
41;; mode's syntax table with `comment-start' syntax. If the entry is 41;; the mode's syntax table with "comment starter" syntax. If the
42;; a cons pair, the elements of the pair are considered to be 42;; entry is a cons cell, the `car' and `cdr' of the pair are
43;; `comment-start' and `comment-end' respectively. (The latter 43;; considered the "comment starter" and "comment ender"
44;; should be nil if you want comments to end at end of line.) 44;; respectively. (The latter should be nil if you want comments to
45;; LIMITATIONS: Emacs does not support comment strings of more than 45;; end at the end of the line.) Emacs does not support comment
46;; two characters in length. 46;; strings of more than two characters in length.
47;; 47;;
48;; * List of keywords to font-lock. Each keyword should be a string. 48;; * List of keywords to font-lock. Each keyword should be a string.
49;; If you have additional keywords which should be highlighted in a 49;; If you have additional keywords which should be highlighted in a
@@ -121,40 +121,42 @@ instead (which see).")
121 &rest custom-keyword-args) 121 &rest custom-keyword-args)
122 "Create a new generic mode MODE. 122 "Create a new generic mode MODE.
123 123
124MODE is the name of the command for the generic mode; it need not 124MODE is the name of the command for the generic mode; don't quote
125be quoted. The optional DOCSTRING is the documentation for the 125it. The optional DOCSTRING is the documentation for the mode
126mode command. If you do not supply it, a default documentation 126command. If you do not supply it, `define-generic-mode' uses a
127string will be used instead. 127default documentation string instead.
128 128
129COMMENT-LIST is a list, whose entries are either a single 129COMMENT-LIST is a list in which each element is either a
130character, a one or two character string or a cons pair. If the 130character, a string of one or two characters, or a cons cell. A
131entry is a character or a string, it is added to the mode's 131character or a string is set up in the mode's syntax table as a
132syntax table with `comment-start' syntax. If the entry is a cons 132\"comment starter\". If the entry is a cons cell, the `car' is
133pair, the elements of the pair are considered to be 133set up as a \"comment starter\" and the `cdr' as a \"comment
134`comment-start' and `comment-end' respectively. (The latter 134ender\". (Use nil for the latter if you want comments to end at
135should be nil if you want comments to end at end of line.) Note 135the end of the line.) Note that the syntax table has limitations
136that Emacs has limitations regarding comment characters. 136about what comment starters and enders are actually possible.
137 137
138KEYWORD-LIST is a list of keywords to highlight with 138KEYWORD-LIST is a list of keywords to highlight with
139`font-lock-keyword-face'. Each keyword should be a string. 139`font-lock-keyword-face'. Each keyword should be a string.
140 140
141FONT-LOCK-LIST is a list of additional expressions to highlight. 141FONT-LOCK-LIST is a list of additional expressions to highlight.
142Each entry in the list should have the same form as an entry in 142Each element of this list should have the same form as an element
143`font-lock-keywords'. 143of `font-lock-keywords'.
144 144
145AUTO-MODE-LIST is a list of regular expressions to add to 145AUTO-MODE-LIST is a list of regular expressions to add to
146`auto-mode-alist'. These regexps are added to `auto-mode-alist' 146`auto-mode-alist'. These regular expressions are added when
147as soon as `define-generic-mode' is called. 147Emacs runs the macro expansion.
148 148
149FUNCTION-LIST is a list of functions to call to do some 149FUNCTION-LIST is a list of functions to call to do some
150additional setup. 150additional setup. The mode command calls these functions just
151before it runs the mode hook.
151 152
152The optional CUSTOM-KEYWORD-ARGS are pairs of keywords and 153The optional CUSTOM-KEYWORD-ARGS are pairs of keywords and values
153values. They will be passed to the generated `defcustom' form of 154to include in the generated `defcustom' form for the mode hook
154the mode hook variable MODE-hook. Defaults to MODE without the 155variable `MODE-hook'. The default value for the `:group' keyword
155possible trailing \"-mode\". (This default may not be a valid 156is MODE with the final \"-mode\" (if any) removed. (Don't use
156customization group defined with `defgroup'. Make sure it is.) 157this default group name unless you have written a `defgroup' to
157You can specify keyword arguments without specifying a docstring. 158define that group properly.) You can specify keyword arguments
159without specifying a docstring.
158 160
159See the file generic-x.el for some examples of `define-generic-mode'." 161See the file generic-x.el for some examples of `define-generic-mode'."
160 (declare (debug (sexp def-form def-form def-form form def-form 162 (declare (debug (sexp def-form def-form def-form form def-form
@@ -178,7 +180,7 @@ See the file generic-x.el for some examples of `define-generic-mode'."
178 180
179 (unless (plist-get custom-keyword-args :group) 181 (unless (plist-get custom-keyword-args :group)
180 (setq custom-keyword-args 182 (setq custom-keyword-args
181 (plist-put custom-keyword-args 183 (plist-put custom-keyword-args
182 :group `',(intern (replace-regexp-in-string 184 :group `',(intern (replace-regexp-in-string
183 "-mode\\'" "" name))))) 185 "-mode\\'" "" name)))))
184 186
@@ -226,7 +228,7 @@ See the file generic-x.el for some examples of `define-generic-mode'."
226 (when keyword-list 228 (when keyword-list
227 (push (concat "\\_<" (regexp-opt keyword-list t) "\\_>") 229 (push (concat "\\_<" (regexp-opt keyword-list t) "\\_>")
228 generic-font-lock-keywords)) 230 generic-font-lock-keywords))
229 (setq font-lock-defaults '(generic-font-lock-keywords nil)) 231 (setq font-lock-defaults '(generic-font-lock-keywords))
230 232
231 ;; Call a list of functions 233 ;; Call a list of functions
232 (mapcar 'funcall function-list) 234 (mapcar 'funcall function-list)
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el
index 6aeb4bab5a2..2a515bc95f7 100644
--- a/lisp/emulation/cua-base.el
+++ b/lisp/emulation/cua-base.el
@@ -1397,10 +1397,11 @@ paste (in addition to the normal emacs bindings)."
1397;;;###autoload '(error (concat "\n\n" 1397;;;###autoload '(error (concat "\n\n"
1398;;;###autoload "CUA-mode is now part of the standard GNU Emacs distribution,\n" 1398;;;###autoload "CUA-mode is now part of the standard GNU Emacs distribution,\n"
1399;;;###autoload "so you may now enable and customize CUA via the Options menu.\n\n" 1399;;;###autoload "so you may now enable and customize CUA via the Options menu.\n\n"
1400;;;###autoload "Your " (file-name-nondirectory user-init-file) " loads an older version of CUA-mode which does\n" 1400;;;###autoload "You have loaded an older version of CUA-mode which does\n"
1401;;;###autoload "not work correctly with this version of GNU Emacs.\n" 1401;;;###autoload "not work correctly with this version of GNU Emacs.\n\n"
1402;;;###autoload (if user-init-file (concat
1402;;;###autoload "To correct this, remove the loading and customization of the\n" 1403;;;###autoload "To correct this, remove the loading and customization of the\n"
1403;;;###autoload "old version from the " user-init-file " file.\n\n"))) 1404;;;###autoload "old version from the " user-init-file " file.\n\n")))))
1404 1405
1405(provide 'cua) 1406(provide 'cua)
1406 1407
diff --git a/lisp/files.el b/lisp/files.el
index 407922082f1..ea4799968fe 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -286,30 +286,30 @@ from `mode-require-final-newline'."
286 :type '(choice (const :tag "When visiting" visit) 286 :type '(choice (const :tag "When visiting" visit)
287 (const :tag "When saving" t) 287 (const :tag "When saving" t)
288 (const :tag "When visiting or saving" visit-save) 288 (const :tag "When visiting or saving" visit-save)
289 (const :tag "Never" nil) 289 (const :tag "Don't add newlines" nil)
290 (other :tag "Ask" ask)) 290 (other :tag "Ask each time" ask))
291 :group 'editing-basics) 291 :group 'editing-basics)
292 292
293(defcustom mode-require-final-newline t 293(defcustom mode-require-final-newline t
294 "*Whether to add a newline at end of file, in certain major modes. 294 "*Whether to add a newline at end of file, in certain major modes.
295Those modes set `require-final-newline' to this value when you enable them. 295Those modes set `require-final-newline' to this value when you enable them.
296They do so because they are used for files that are supposed 296They do so because they are often used for files that are supposed
297to end in newlines, and the question is how to arrange that. 297to end in newlines, and the question is how to arrange that.
298 298
299A value of t means do this only when the file is about to be saved. 299A value of t means do this only when the file is about to be saved.
300A value of `visit' means do this right after the file is visited. 300A value of `visit' means do this right after the file is visited.
301A value of `visit-save' means do it at both of those times. 301A value of `visit-save' means do it at both of those times.
302Any other non-nil value means ask user whether to add a newline, when saving. 302Any other non-nil value means ask user whether to add a newline, when saving.
303nil means don't add newlines.
304 303
305You will have to be careful if you set this to nil: you will have 304nil means do not add newlines. That is a risky choice in this variable
306to remember to manually add a final newline whenever you finish a 305since this value is used for modes for files that ought to have final newlines.
307file that really needs one." 306So if you set this to nil, you must explicitly check and add
307a final newline, whenever you save a file that really needs one."
308 :type '(choice (const :tag "When visiting" visit) 308 :type '(choice (const :tag "When visiting" visit)
309 (const :tag "When saving" t) 309 (const :tag "When saving" t)
310 (const :tag "When visiting or saving" visit-save) 310 (const :tag "When visiting or saving" visit-save)
311 (const :tag "Never" nil) 311 (const :tag "Don't add newlines" nil)
312 (other :tag "Ask" ask)) 312 (other :tag "Ask each time" ask))
313 :group 'editing-basics 313 :group 'editing-basics
314 :version "22.1") 314 :version "22.1")
315 315
@@ -529,8 +529,8 @@ See Info node `(elisp)Standard File Names' for more details."
529Value is not expanded---you must call `expand-file-name' yourself. 529Value is not expanded---you must call `expand-file-name' yourself.
530Default name to DEFAULT-DIRNAME if user exits with the same 530Default name to DEFAULT-DIRNAME if user exits with the same
531non-empty string that was inserted by this function. 531non-empty string that was inserted by this function.
532 (If DEFAULT-DIRNAME is omitted, the current buffer's directory is used, 532 (If DEFAULT-DIRNAME is omitted, DIR combined with INITIAL is used,
533 except that if INITIAL is specified, that combined with DIR is used.) 533 or just DIR if INITIAL is nil.)
534If the user exits with an empty minibuffer, this function returns 534If the user exits with an empty minibuffer, this function returns
535an empty string. (This can only happen if the user erased the 535an empty string. (This can only happen if the user erased the
536pre-inserted contents or if `insert-default-directory' is nil.) 536pre-inserted contents or if `insert-default-directory' is nil.)
@@ -544,7 +544,10 @@ the value of `default-directory'."
544 (unless default-dirname 544 (unless default-dirname
545 (setq default-dirname 545 (setq default-dirname
546 (if initial (concat dir initial) default-directory))) 546 (if initial (concat dir initial) default-directory)))
547 (read-file-name prompt dir default-dirname mustmatch initial 547 (read-file-name prompt dir (or default-dirname
548 (if initial (expand-file-name initial dir)
549 dir))
550 mustmatch initial
548 'file-directory-p)) 551 'file-directory-p))
549 552
550 553
@@ -940,12 +943,13 @@ BODY should use the minibuffer at most once.
940Recursive uses of the minibuffer will not be affected." 943Recursive uses of the minibuffer will not be affected."
941 (declare (indent 1) (debug t)) 944 (declare (indent 1) (debug t))
942 (let ((hook (make-symbol "setup-hook"))) 945 (let ((hook (make-symbol "setup-hook")))
943 `(let ((,hook 946 `(let (,hook)
944 (lambda () 947 (setq ,hook
945 ;; Clear out this hook so it does not interfere 948 (lambda ()
946 ;; with any recursive minibuffer usage. 949 ;; Clear out this hook so it does not interfere
947 (remove-hook 'minibuffer-setup-hook ,hook) 950 ;; with any recursive minibuffer usage.
948 (,fun)))) 951 (remove-hook 'minibuffer-setup-hook ,hook)
952 (,fun)))
949 (unwind-protect 953 (unwind-protect
950 (progn 954 (progn
951 (add-hook 'minibuffer-setup-hook ,hook) 955 (add-hook 'minibuffer-setup-hook ,hook)
@@ -1973,8 +1977,13 @@ with that interpreter in `interpreter-mode-alist'.")
1973 ("%![^V]" . ps-mode) 1977 ("%![^V]" . ps-mode)
1974 ("# xmcd " . conf-unix-mode)) 1978 ("# xmcd " . conf-unix-mode))
1975 "Alist of buffer beginnings vs. corresponding major mode functions. 1979 "Alist of buffer beginnings vs. corresponding major mode functions.
1976Each element looks like (REGEXP . FUNCTION). FUNCTION will be 1980Each element looks like (REGEXP . FUNCTION). After visiting a file,
1977called, unless it is nil (to allow `auto-mode-alist' to override).") 1981if REGEXP matches the text at the beginning of the buffer,
1982`normal-mode' will call FUNCTION rather than allowing `auto-mode-alist'
1983to decide the buffer's major mode.
1984
1985If FUNCTION is nil, then it is not called. (That is a way of saying
1986\"allow `auto-mode-alist' to decide for these files.")
1978 1987
1979(defun set-auto-mode (&optional keep-mode-if-same) 1988(defun set-auto-mode (&optional keep-mode-if-same)
1980 "Select major mode appropriate for current buffer. 1989 "Select major mode appropriate for current buffer.
@@ -2740,15 +2749,26 @@ BACKUPNAME is the backup file name, which is the old file renamed."
2740 (file-error nil)))))) 2749 (file-error nil))))))
2741 2750
2742(defun backup-buffer-copy (from-name to-name modes) 2751(defun backup-buffer-copy (from-name to-name modes)
2743 (condition-case () 2752 (let ((umask (default-file-modes)))
2744 (copy-file from-name to-name t t) 2753 (unwind-protect
2745 (file-error 2754 (progn
2746 ;; If copying fails because file TO-NAME 2755 ;; Create temp files with strict access rights. It's easy to
2747 ;; is not writable, delete that file and try again. 2756 ;; loosen them later, whereas it's impossible to close the
2748 (if (and (file-exists-p to-name) 2757 ;; time-window of loose permissions otherwise.
2749 (not (file-writable-p to-name))) 2758 (set-default-file-modes ?\700)
2750 (delete-file to-name)) 2759 (while (condition-case ()
2751 (copy-file from-name to-name t t))) 2760 (progn
2761 (condition-case nil
2762 (delete-file to-name)
2763 (file-error nil))
2764 (copy-file from-name to-name t t 'excl)
2765 nil)
2766 (file-already-exists t))
2767 ;; The file was somehow created by someone else between
2768 ;; `delete-file' and `copy-file', so let's try again.
2769 nil))
2770 ;; Reset the umask.
2771 (set-default-file-modes umask)))
2752 (and modes 2772 (and modes
2753 (set-file-modes to-name (logand modes #o1777)))) 2773 (set-file-modes to-name (logand modes #o1777))))
2754 2774
@@ -3331,39 +3351,41 @@ Before and after saving the buffer, this function runs
3331 ;; This requires write access to the containing dir, 3351 ;; This requires write access to the containing dir,
3332 ;; which is why we don't try it if we don't have that access. 3352 ;; which is why we don't try it if we don't have that access.
3333 (let ((realname buffer-file-name) 3353 (let ((realname buffer-file-name)
3334 tempname nogood i succeed 3354 tempname succeed
3355 (umask (default-file-modes))
3335 (old-modtime (visited-file-modtime))) 3356 (old-modtime (visited-file-modtime)))
3336 (setq i 0) 3357 ;; Create temp files with strict access rights. It's easy to
3337 (setq nogood t) 3358 ;; loosen them later, whereas it's impossible to close the
3338 ;; Find the temporary name to write under. 3359 ;; time-window of loose permissions otherwise.
3339 (while nogood
3340 (setq tempname (format
3341 (if (and (eq system-type 'ms-dos)
3342 (not (msdos-long-file-names)))
3343 "%s#%d.tm#" ; MSDOS limits files to 8+3
3344 (if (memq system-type '(vax-vms axp-vms))
3345 "%s$tmp$%d"
3346 "%s#tmp#%d"))
3347 dir i))
3348 (setq nogood (file-exists-p tempname))
3349 (setq i (1+ i)))
3350 (unwind-protect 3360 (unwind-protect
3351 (progn (clear-visited-file-modtime) 3361 (progn
3352 (write-region (point-min) (point-max) 3362 (clear-visited-file-modtime)
3353 tempname nil realname 3363 (set-default-file-modes ?\700)
3354 buffer-file-truename) 3364 ;; Try various temporary names.
3355 (setq succeed t)) 3365 ;; This code follows the example of make-temp-file,
3356 ;; If writing the temp file fails, 3366 ;; but it calls write-region in the appropriate way
3357 ;; delete the temp file. 3367 ;; for saving the buffer.
3358 (or succeed 3368 (while (condition-case ()
3359 (progn 3369 (progn
3360 (condition-case nil 3370 (setq tempname
3361 (delete-file tempname) 3371 (make-temp-name
3362 (file-error nil)) 3372 (expand-file-name "tmp" dir)))
3363 (set-visited-file-modtime old-modtime)))) 3373 (write-region (point-min) (point-max)
3364 ;; Since we have created an entirely new file 3374 tempname nil realname
3365 ;; and renamed it, make sure it gets the 3375 buffer-file-truename 'excl)
3366 ;; right permission bits set. 3376 nil)
3377 (file-already-exists t))
3378 ;; The file was somehow created by someone else between
3379 ;; `make-temp-name' and `write-region', let's try again.
3380 nil)
3381 (setq succeed t))
3382 ;; Reset the umask.
3383 (set-default-file-modes umask)
3384 ;; If we failed, restore the buffer's modtime.
3385 (unless succeed
3386 (set-visited-file-modtime old-modtime)))
3387 ;; Since we have created an entirely new file,
3388 ;; make sure it gets the right permission bits set.
3367 (setq setmodes (or setmodes (cons (file-modes buffer-file-name) 3389 (setq setmodes (or setmodes (cons (file-modes buffer-file-name)
3368 buffer-file-name))) 3390 buffer-file-name)))
3369 ;; We succeeded in writing the temp file, 3391 ;; We succeeded in writing the temp file,
@@ -3649,7 +3671,7 @@ The function you specify is responsible for updating (or preserving) point.")
3649(defvar buffer-stale-function nil 3671(defvar buffer-stale-function nil
3650 "Function to check whether a non-file buffer needs reverting. 3672 "Function to check whether a non-file buffer needs reverting.
3651This should be a function with one optional argument NOCONFIRM. 3673This should be a function with one optional argument NOCONFIRM.
3652Auto Revert Mode sets NOCONFIRM to t. The function should return 3674Auto Revert Mode passes t for NOCONFIRM. The function should return
3653non-nil if the buffer should be reverted. A return value of 3675non-nil if the buffer should be reverted. A return value of
3654`fast' means that the need for reverting was not checked, but 3676`fast' means that the need for reverting was not checked, but
3655that reverting the buffer is fast. The buffer is current when 3677that reverting the buffer is fast. The buffer is current when
@@ -3718,91 +3740,93 @@ non-nil, it is called instead of rereading visited file contents."
3718 (interactive (list (not current-prefix-arg))) 3740 (interactive (list (not current-prefix-arg)))
3719 (if revert-buffer-function 3741 (if revert-buffer-function
3720 (funcall revert-buffer-function ignore-auto noconfirm) 3742 (funcall revert-buffer-function ignore-auto noconfirm)
3721 (let* ((auto-save-p (and (not ignore-auto) 3743 (with-current-buffer (or (buffer-base-buffer (current-buffer))
3722 (recent-auto-save-p) 3744 (current-buffer))
3723 buffer-auto-save-file-name 3745 (let* ((auto-save-p (and (not ignore-auto)
3724 (file-readable-p buffer-auto-save-file-name) 3746 (recent-auto-save-p)
3725 (y-or-n-p 3747 buffer-auto-save-file-name
3726 "Buffer has been auto-saved recently. Revert from auto-save file? "))) 3748 (file-readable-p buffer-auto-save-file-name)
3727 (file-name (if auto-save-p 3749 (y-or-n-p
3728 buffer-auto-save-file-name 3750 "Buffer has been auto-saved recently. Revert from auto-save file? ")))
3729 buffer-file-name))) 3751 (file-name (if auto-save-p
3730 (cond ((null file-name) 3752 buffer-auto-save-file-name
3731 (error "Buffer does not seem to be associated with any file")) 3753 buffer-file-name)))
3732 ((or noconfirm 3754 (cond ((null file-name)
3733 (and (not (buffer-modified-p)) 3755 (error "Buffer does not seem to be associated with any file"))
3734 (let ((tail revert-without-query) 3756 ((or noconfirm
3735 (found nil)) 3757 (and (not (buffer-modified-p))
3736 (while tail 3758 (let ((tail revert-without-query)
3737 (if (string-match (car tail) file-name) 3759 (found nil))
3738 (setq found t)) 3760 (while tail
3739 (setq tail (cdr tail))) 3761 (if (string-match (car tail) file-name)
3740 found)) 3762 (setq found t))
3741 (yes-or-no-p (format "Revert buffer from file %s? " 3763 (setq tail (cdr tail)))
3742 file-name))) 3764 found))
3743 (run-hooks 'before-revert-hook) 3765 (yes-or-no-p (format "Revert buffer from file %s? "
3744 ;; If file was backed up but has changed since, 3766 file-name)))
3745 ;; we shd make another backup. 3767 (run-hooks 'before-revert-hook)
3746 (and (not auto-save-p) 3768 ;; If file was backed up but has changed since,
3747 (not (verify-visited-file-modtime (current-buffer))) 3769 ;; we shd make another backup.
3748 (setq buffer-backed-up nil)) 3770 (and (not auto-save-p)
3749 ;; Get rid of all undo records for this buffer. 3771 (not (verify-visited-file-modtime (current-buffer)))
3750 (or (eq buffer-undo-list t) 3772 (setq buffer-backed-up nil))
3751 (setq buffer-undo-list nil)) 3773 ;; Get rid of all undo records for this buffer.
3752 ;; Effectively copy the after-revert-hook status, 3774 (or (eq buffer-undo-list t)
3753 ;; since after-find-file will clobber it. 3775 (setq buffer-undo-list nil))
3754 (let ((global-hook (default-value 'after-revert-hook)) 3776 ;; Effectively copy the after-revert-hook status,
3755 (local-hook-p (local-variable-p 'after-revert-hook)) 3777 ;; since after-find-file will clobber it.
3756 (local-hook (and (local-variable-p 'after-revert-hook) 3778 (let ((global-hook (default-value 'after-revert-hook))
3757 after-revert-hook))) 3779 (local-hook-p (local-variable-p 'after-revert-hook))
3758 (let (buffer-read-only 3780 (local-hook (and (local-variable-p 'after-revert-hook)
3759 ;; Don't make undo records for the reversion. 3781 after-revert-hook)))
3760 (buffer-undo-list t)) 3782 (let (buffer-read-only
3761 (if revert-buffer-insert-file-contents-function 3783 ;; Don't make undo records for the reversion.
3762 (funcall revert-buffer-insert-file-contents-function 3784 (buffer-undo-list t))
3763 file-name auto-save-p) 3785 (if revert-buffer-insert-file-contents-function
3764 (if (not (file-exists-p file-name)) 3786 (funcall revert-buffer-insert-file-contents-function
3765 (error (if buffer-file-number 3787 file-name auto-save-p)
3766 "File %s no longer exists!" 3788 (if (not (file-exists-p file-name))
3767 "Cannot revert nonexistent file %s") 3789 (error (if buffer-file-number
3768 file-name)) 3790 "File %s no longer exists!"
3769 ;; Bind buffer-file-name to nil 3791 "Cannot revert nonexistent file %s")
3770 ;; so that we don't try to lock the file. 3792 file-name))
3771 (let ((buffer-file-name nil)) 3793 ;; Bind buffer-file-name to nil
3772 (or auto-save-p 3794 ;; so that we don't try to lock the file.
3773 (unlock-buffer))) 3795 (let ((buffer-file-name nil))
3774 (widen) 3796 (or auto-save-p
3775 (let ((coding-system-for-read 3797 (unlock-buffer)))
3776 ;; Auto-saved file shoule be read by Emacs' 3798 (widen)
3777 ;; internal coding. 3799 (let ((coding-system-for-read
3778 (if auto-save-p 'auto-save-coding 3800 ;; Auto-saved file shoule be read by Emacs'
3779 (or coding-system-for-read 3801 ;; internal coding.
3780 buffer-file-coding-system-explicit)))) 3802 (if auto-save-p 'auto-save-coding
3781 ;; This force after-insert-file-set-coding 3803 (or coding-system-for-read
3782 ;; (called from insert-file-contents) to set 3804 buffer-file-coding-system-explicit))))
3783 ;; buffer-file-coding-system to a proper value. 3805 ;; This force after-insert-file-set-coding
3784 (kill-local-variable 'buffer-file-coding-system) 3806 ;; (called from insert-file-contents) to set
3785 3807 ;; buffer-file-coding-system to a proper value.
3786 ;; Note that this preserves point in an intelligent way. 3808 (kill-local-variable 'buffer-file-coding-system)
3787 (if preserve-modes 3809
3788 (let ((buffer-file-format buffer-file-format)) 3810 ;; Note that this preserves point in an intelligent way.
3789 (insert-file-contents file-name (not auto-save-p) 3811 (if preserve-modes
3790 nil nil t)) 3812 (let ((buffer-file-format buffer-file-format))
3791 (insert-file-contents file-name (not auto-save-p) 3813 (insert-file-contents file-name (not auto-save-p)
3792 nil nil t))))) 3814 nil nil t))
3793 ;; Recompute the truename in case changes in symlinks 3815 (insert-file-contents file-name (not auto-save-p)
3794 ;; have changed the truename. 3816 nil nil t)))))
3795 (setq buffer-file-truename 3817 ;; Recompute the truename in case changes in symlinks
3796 (abbreviate-file-name (file-truename buffer-file-name))) 3818 ;; have changed the truename.
3797 (after-find-file nil nil t t preserve-modes) 3819 (setq buffer-file-truename
3798 ;; Run after-revert-hook as it was before we reverted. 3820 (abbreviate-file-name (file-truename buffer-file-name)))
3799 (setq-default revert-buffer-internal-hook global-hook) 3821 (after-find-file nil nil t t preserve-modes)
3800 (if local-hook-p 3822 ;; Run after-revert-hook as it was before we reverted.
3801 (set (make-local-variable 'revert-buffer-internal-hook) 3823 (setq-default revert-buffer-internal-hook global-hook)
3802 local-hook) 3824 (if local-hook-p
3803 (kill-local-variable 'revert-buffer-internal-hook)) 3825 (set (make-local-variable 'revert-buffer-internal-hook)
3804 (run-hooks 'revert-buffer-internal-hook)) 3826 local-hook)
3805 t))))) 3827 (kill-local-variable 'revert-buffer-internal-hook))
3828 (run-hooks 'revert-buffer-internal-hook))
3829 t))))))
3806 3830
3807(defun recover-this-file () 3831(defun recover-this-file ()
3808 "Recover the visited file--get contents from its last auto-save file." 3832 "Recover the visited file--get contents from its last auto-save file."
diff --git a/lisp/follow.el b/lisp/follow.el
index a01b0e77eb2..61517a68ff1 100644
--- a/lisp/follow.el
+++ b/lisp/follow.el
@@ -980,7 +980,8 @@ of the way from the true end."
980 (t 980 (t
981 (select-window (car (reverse followers))))) 981 (select-window (car (reverse followers)))))
982 (goto-char pos) 982 (goto-char pos)
983 (end-of-buffer arg))) 983 (with-no-warnings
984 (end-of-buffer arg))))
984 985
985;;}}} 986;;}}}
986 987
diff --git a/lisp/font-core.el b/lisp/font-core.el
index 5bf30d4d6c5..a077ce756c0 100644
--- a/lisp/font-core.el
+++ b/lisp/font-core.el
@@ -32,7 +32,7 @@
32 "Defaults for Font Lock mode specified by the major mode. 32 "Defaults for Font Lock mode specified by the major mode.
33Defaults should be of the form: 33Defaults should be of the form:
34 34
35 (KEYWORDS KEYWORDS-ONLY CASE-FOLD SYNTAX-ALIST SYNTAX-BEGIN ...) 35 (KEYWORDS [KEYWORDS-ONLY [CASE-FOLD [SYNTAX-ALIST [SYNTAX-BEGIN ...]]]])
36 36
37KEYWORDS may be a symbol (a variable or function whose value is the keywords to 37KEYWORDS may be a symbol (a variable or function whose value is the keywords to
38use for fontification) or a list of symbols. If KEYWORDS-ONLY is non-nil, 38use for fontification) or a list of symbols. If KEYWORDS-ONLY is non-nil,
@@ -66,11 +66,10 @@ textual modes (i.e., the mode-dependent function is known to put point and mark
66around a text block relevant to that mode). 66around a text block relevant to that mode).
67 67
68Other variables include that for syntactic keyword fontification, 68Other variables include that for syntactic keyword fontification,
69`font-lock-syntactic-keywords' 69`font-lock-syntactic-keywords' and those for buffer-specialized fontification
70and those for buffer-specialized fontification functions, 70functions, `font-lock-fontify-buffer-function',
71`font-lock-fontify-buffer-function', `font-lock-unfontify-buffer-function', 71`font-lock-unfontify-buffer-function', `font-lock-fontify-region-function',
72`font-lock-fontify-region-function', `font-lock-unfontify-region-function', 72`font-lock-unfontify-region-function', and `font-lock-inhibit-thing-lock'.")
73`font-lock-inhibit-thing-lock' and `font-lock-maximum-size'.")
74(make-variable-buffer-local 'font-lock-defaults) 73(make-variable-buffer-local 'font-lock-defaults)
75 74
76(defvar font-lock-defaults-alist nil 75(defvar font-lock-defaults-alist nil
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 59d68e6376d..906169a0d9b 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -309,6 +309,9 @@ If a number, only buffers greater than this size have fontification messages."
309(defvar font-lock-comment-face 'font-lock-comment-face 309(defvar font-lock-comment-face 'font-lock-comment-face
310 "Face name to use for comments.") 310 "Face name to use for comments.")
311 311
312(defvar font-lock-comment-delimiter-face 'font-lock-comment-delimiter-face
313 "Face name to use for comment delimiters.")
314
312(defvar font-lock-string-face 'font-lock-string-face 315(defvar font-lock-string-face 'font-lock-string-face
313 "Face name to use for strings.") 316 "Face name to use for strings.")
314 317
@@ -463,12 +466,12 @@ user-level keywords, but normally their values have been
463optimized.") 466optimized.")
464 467
465(defvar font-lock-keywords-alist nil 468(defvar font-lock-keywords-alist nil
466 "*Alist of `font-lock-keywords' local to a `major-mode'. 469 "Alist of `font-lock-keywords' local to a `major-mode'.
467This is normally set via `font-lock-add-keywords' and 470This is normally set via `font-lock-add-keywords' and
468`font-lock-remove-keywords'.") 471`font-lock-remove-keywords'.")
469 472
470(defvar font-lock-removed-keywords-alist nil 473(defvar font-lock-removed-keywords-alist nil
471 "*Alist of `font-lock-keywords' removed from `major-mode'. 474 "Alist of `font-lock-keywords' removed from `major-mode'.
472This is normally set via `font-lock-add-keywords' and 475This is normally set via `font-lock-add-keywords' and
473`font-lock-remove-keywords'.") 476`font-lock-remove-keywords'.")
474 477
@@ -493,7 +496,7 @@ sometimes be slightly incorrect.")
493 "Function to determine which face to use when fontifying syntactically. 496 "Function to determine which face to use when fontifying syntactically.
494The function is called with a single parameter (the state as returned by 497The function is called with a single parameter (the state as returned by
495`parse-partial-sexp' at the beginning of the region to highlight) and 498`parse-partial-sexp' at the beginning of the region to highlight) and
496should return a face.") 499should return a face. This is normally set via `font-lock-defaults'.")
497 500
498(defvar font-lock-syntactic-keywords nil 501(defvar font-lock-syntactic-keywords nil
499 "A list of the syntactic keywords to highlight. 502 "A list of the syntactic keywords to highlight.
@@ -565,8 +568,8 @@ This is normally set via `font-lock-defaults'.")
565(defvar font-lock-fontify-region-function 'font-lock-default-fontify-region 568(defvar font-lock-fontify-region-function 'font-lock-default-fontify-region
566 "Function to use for fontifying a region. 569 "Function to use for fontifying a region.
567It should take two args, the beginning and end of the region, and an optional 570It should take two args, the beginning and end of the region, and an optional
568third arg VERBOSE. If non-nil, the function should print status messages. 571third arg VERBOSE. If VERBOSE is non-nil, the function should print status
569This is normally set via `font-lock-defaults'.") 572messages. This is normally set via `font-lock-defaults'.")
570 573
571(defvar font-lock-unfontify-region-function 'font-lock-default-unfontify-region 574(defvar font-lock-unfontify-region-function 'font-lock-default-unfontify-region
572 "Function to use for unfontifying a region. 575 "Function to use for unfontifying a region.
@@ -643,6 +646,7 @@ Major/minor modes can set this variable if they know which option applies.")
643;;;###autoload 646;;;###autoload
644(defun font-lock-add-keywords (mode keywords &optional append) 647(defun font-lock-add-keywords (mode keywords &optional append)
645 "Add highlighting KEYWORDS for MODE. 648 "Add highlighting KEYWORDS for MODE.
649
646MODE should be a symbol, the major mode command name, such as `c-mode' 650MODE should be a symbol, the major mode command name, such as `c-mode'
647or nil. If nil, highlighting keywords are added for the current buffer. 651or nil. If nil, highlighting keywords are added for the current buffer.
648KEYWORDS should be a list; see the variable `font-lock-keywords'. 652KEYWORDS should be a list; see the variable `font-lock-keywords'.
@@ -660,9 +664,9 @@ For example:
660adds two fontification patterns for C mode, to fontify `FIXME:' words, even in 664adds two fontification patterns for C mode, to fontify `FIXME:' words, even in
661comments, and to fontify `and', `or' and `not' words as keywords. 665comments, and to fontify `and', `or' and `not' words as keywords.
662 666
663When used from an elisp package (such as a minor mode), it is recommended 667When used from a Lisp program (such as a minor mode), it is recommended to
664to use nil for MODE (and place the call in a loop or on a hook) to avoid 668use nil for MODE (and place the call on a hook) to avoid subtle problems
665subtle problems due to details of the implementation. 669due to details of the implementation.
666 670
667Note that some modes have specialized support for additional patterns, e.g., 671Note that some modes have specialized support for additional patterns, e.g.,
668see the variables `c-font-lock-extra-types', `c++-font-lock-extra-types', 672see the variables `c-font-lock-extra-types', `c++-font-lock-extra-types',
@@ -703,9 +707,7 @@ see the variables `c-font-lock-extra-types', `c++-font-lock-extra-types',
703 (font-lock-compile-keywords font-lock-keywords t))))))) 707 (font-lock-compile-keywords font-lock-keywords t)))))))
704 708
705(defun font-lock-update-removed-keyword-alist (mode keywords append) 709(defun font-lock-update-removed-keyword-alist (mode keywords append)
706 ;; Update `font-lock-removed-keywords-alist' when adding new 710 "Update `font-lock-removed-keywords-alist' when adding new KEYWORDS to MODE."
707 ;; KEYWORDS to MODE.
708 ;;
709 ;; When font-lock is enabled first all keywords in the list 711 ;; When font-lock is enabled first all keywords in the list
710 ;; `font-lock-keywords-alist' are added, then all keywords in the 712 ;; `font-lock-keywords-alist' are added, then all keywords in the
711 ;; list `font-lock-removed-keywords-alist' are removed. If a 713 ;; list `font-lock-removed-keywords-alist' are removed. If a
@@ -753,9 +755,9 @@ see the variables `c-font-lock-extra-types', `c++-font-lock-extra-types',
753MODE should be a symbol, the major mode command name, such as `c-mode' 755MODE should be a symbol, the major mode command name, such as `c-mode'
754or nil. If nil, highlighting keywords are removed for the current buffer. 756or nil. If nil, highlighting keywords are removed for the current buffer.
755 757
756When used from an elisp package (such as a minor mode), it is recommended 758When used from a Lisp program (such as a minor mode), it is recommended to
757to use nil for MODE (and place the call in a loop or on a hook) to avoid 759use nil for MODE (and place the call on a hook) to avoid subtle problems
758subtle problems due to details of the implementation." 760due to details of the implementation."
759 (cond (mode 761 (cond (mode
760 ;; Remove one keyword at the time. 762 ;; Remove one keyword at the time.
761 (dolist (keyword keywords) 763 (dolist (keyword keywords)
@@ -1004,7 +1006,8 @@ a very meaningful entity to highlight.")
1004 1006
1005(defun font-lock-default-fontify-region (beg end loudly) 1007(defun font-lock-default-fontify-region (beg end loudly)
1006 (save-buffer-state 1008 (save-buffer-state
1007 ((parse-sexp-lookup-properties font-lock-syntactic-keywords) 1009 ((parse-sexp-lookup-properties
1010 (or parse-sexp-lookup-properties font-lock-syntactic-keywords))
1008 (old-syntax-table (syntax-table))) 1011 (old-syntax-table (syntax-table)))
1009 (unwind-protect 1012 (unwind-protect
1010 (save-restriction 1013 (save-restriction
@@ -1615,7 +1618,7 @@ Sets various variables using `font-lock-defaults' (or, if nil, using
1615 1618
1616;; But now we do it the custom way. Note that `defface' will not overwrite any 1619;; But now we do it the custom way. Note that `defface' will not overwrite any
1617;; faces declared above via `custom-declare-face'. 1620;; faces declared above via `custom-declare-face'.
1618(defface font-lock-comment-face 1621(defface font-lock-comment-delimiter-face
1619 '((((class grayscale) (background light)) 1622 '((((class grayscale) (background light))
1620 (:foreground "DimGray" :weight bold :slant italic)) 1623 (:foreground "DimGray" :weight bold :slant italic))
1621 (((class grayscale) (background dark)) 1624 (((class grayscale) (background dark))
@@ -1633,6 +1636,27 @@ Sets various variables using `font-lock-defaults' (or, if nil, using
1633 (((class color) (min-colors 8) (background dark)) 1636 (((class color) (min-colors 8) (background dark))
1634 (:foreground "red1")) 1637 (:foreground "red1"))
1635 (t (:weight bold :slant italic))) 1638 (t (:weight bold :slant italic)))
1639 "Font Lock mode face used to highlight comment delimiters."
1640 :group 'font-lock-highlighting-faces)
1641
1642(defface font-lock-comment-face
1643 '((((class grayscale) (background light))
1644 (:foreground "DimGray" :weight bold :slant italic))
1645 (((class grayscale) (background dark))
1646 (:foreground "LightGray" :weight bold :slant italic))
1647 (((class color) (min-colors 88) (background light))
1648 (:foreground "Firebrick"))
1649 (((class color) (min-colors 88) (background dark))
1650 (:foreground "chocolate1"))
1651 (((class color) (min-colors 16) (background light))
1652 (:foreground "red"))
1653 (((class color) (min-colors 16) (background dark))
1654 (:foreground "red1"))
1655 (((class color) (min-colors 8) (background light))
1656 )
1657 (((class color) (min-colors 8) (background dark))
1658 )
1659 (t (:weight bold :slant italic)))
1636 "Font Lock mode face used to highlight comments." 1660 "Font Lock mode face used to highlight comments."
1637 :group 'font-lock-highlighting-faces) 1661 :group 'font-lock-highlighting-faces)
1638 1662
diff --git a/lisp/generic-x.el b/lisp/generic-x.el
index a13103edb3d..31aa9299fbb 100644
--- a/lisp/generic-x.el
+++ b/lisp/generic-x.el
@@ -1,4 +1,4 @@
1;;; generic-x.el --- Extra Modes for generic-mode 1;;; generic-x.el --- A collection of generic modes
2 2
3;; Copyright (C) 1997, 1998, 2003, 2005 Free Software Foundation, Inc. 3;; Copyright (C) 1997, 1998, 2003, 2005 Free Software Foundation, Inc.
4 4
@@ -25,7 +25,7 @@
25 25
26;;; Commentary: 26;;; Commentary:
27;; 27;;
28;; This file contains some pre-defined generic-modes. 28;; This file contains a collection generic modes.
29;; 29;;
30;; INSTALLATION: 30;; INSTALLATION:
31;; 31;;
@@ -34,12 +34,18 @@
34;; (require 'generic-x) 34;; (require 'generic-x)
35;; 35;;
36;; You can decide which modes to load by setting the variable 36;; You can decide which modes to load by setting the variable
37;; `generic-extras-enable-list'. Some platform-specific modes are 37;; `generic-extras-enable-list'. Its default value is platform-
38;; affected by the variables `generic-define-mswindows-modes' and 38;; specific. The recommended way to set this variable is through
39;; `generic-define-unix-modes' (which see). 39;; customize:
40;; 40;;
41;; You can also send in new modes; if the file types a reasonably common, 41;; M-x customize-option RET generic-extras-enable-list RET
42;; we would like to install them. 42;;
43;; This lets you select generic modes from the list of available
44;; modes. If you manually set `generic-extras-enable-list' in your
45;; .emacs, do it BEFORE loading generic-x with (require 'generic-x).
46;;
47;; You can also send in new modes; if the file types are reasonably
48;; common, we would like to install them.
43;; 49;;
44;; DEFAULT GENERIC MODE: 50;; DEFAULT GENERIC MODE:
45;; 51;;
@@ -54,13 +60,13 @@
54;; PROBLEMS WHEN USED WITH FOLDING MODE: 60;; PROBLEMS WHEN USED WITH FOLDING MODE:
55;; 61;;
56;; [The following relates to the obsolete selective-display technique. 62;; [The following relates to the obsolete selective-display technique.
57;; Folding mode should use invisible text properties instead. -- Dave 63;; Folding mode should use invisible text properties instead. -- Dave
58;; Love] 64;; Love]
59;; 65;;
60;; From Anders Lindgren <andersl@csd.uu.se> 66;; From Anders Lindgren <andersl@csd.uu.se>
61;; 67;;
62;; Problem summary: Wayne Adams has found a problem when using folding 68;; Problem summary: Wayne Adams has found a problem when using folding
63;; mode in conjuction with font-lock for a mode defined in 69;; mode in conjunction with font-lock for a mode defined in
64;; `generic-x.el'. 70;; `generic-x.el'.
65;; 71;;
66;; The problem, as Wayne described it, was that error messages of the 72;; The problem, as Wayne described it, was that error messages of the
@@ -69,18 +75,18 @@
69;; > - various msgs including "Fontifying region...(error Stack 75;; > - various msgs including "Fontifying region...(error Stack
70;; > overflow in regexp matcher)" appear 76;; > overflow in regexp matcher)" appear
71;; 77;;
72;; I have just tracked down the cause of the problem. The regexp:s in 78;; I have just tracked down the cause of the problem. The regexp's in
73;; `generic-x.el' does not take into account the way that folding 79;; `generic-x.el' do not take into account the way that folding hides
74;; hides sections of the buffer. The technique is known as 80;; sections of the buffer. The technique is known as
75;; `selective-display' and has been available for a very long time (I 81;; `selective-display' and has been available for a very long time (I
76;; started using it back in the good old' Emacs 18 days). Basically, a 82;; started using it back in the good old Emacs 18 days). Basically, a
77;; section is hidden by creating one very long line were the newline 83;; section is hidden by creating one very long line were the newline
78;; character (C-j) is replaced by a linefeed (C-m) character. 84;; character (C-j) is replaced by a linefeed (C-m) character.
79;; 85;;
80;; Many other hiding packages, besides folding, use the same technique, 86;; Many other hiding packages, besides folding, use the same technique,
81;; the problem should occur when using them as well. 87;; the problem should occur when using them as well.
82;; 88;;
83;; The erroronous lines in `generic-extras' look like the following (this 89;; The erroneous lines in `generic-x.el' look like the following (this
84;; example is from the `ini' section): 90;; example is from the `ini' section):
85;; 91;;
86;; '(("^\\(\\[.*\\]\\)" 1 'font-lock-constant-face) 92;; '(("^\\(\\[.*\\]\\)" 1 'font-lock-constant-face)
@@ -92,17 +98,17 @@
92;; [foo] 98;; [foo]
93;; bar = xxx 99;; bar = xxx
94;; 100;;
95;; However, since the `.' regexp symbol match the linefeed character the 101;; However, since the `.' regexp symbol matches the linefeed character
96;; entire folded section is searched, resulting in a regexp stack 102;; the entire folded section is searched, resulting in a regexp stack
97;; overflow. 103;; overflow.
98;; 104;;
99;; Solution suggestion 2: Instead of using ".", use the sequence 105;; Solution suggestion: Instead of using ".", use the sequence
100;; "[^\n\r]". This will make the rules behave just as before, but they 106;; "[^\n\r]". This will make the rules behave just as before, but
101;; will work together with selective-display. 107;; they will work together with selective-display.
102 108
103;;; Code: 109;;; Code:
104 110
105(require 'font-lock) 111(eval-when-compile (require 'font-lock))
106 112
107(defgroup generic-x nil 113(defgroup generic-x nil
108 "A collection of generic modes." 114 "A collection of generic modes."
@@ -110,6 +116,11 @@
110 :group 'data 116 :group 'data
111 :version "20.3") 117 :version "20.3")
112 118
119(defgroup generic-x-modes nil
120 "Individual modes in the collection of generic modes."
121 :group 'generic-x
122 :version "22.1")
123
113;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 124;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
114;; Default-Generic mode 125;; Default-Generic mode
115;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 126;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -147,7 +158,7 @@ the regexp in `generic-find-file-regexp'. If the value is nil,
147 :type '(choice (const :tag "Don't check file names" nil) regexp)) 158 :type '(choice (const :tag "Don't check file names" nil) regexp))
148 159
149;; This generic mode is always defined 160;; This generic mode is always defined
150(define-generic-mode default-generic-mode (list ?#) nil nil nil nil :group 'generic) 161(define-generic-mode default-generic-mode (list ?#) nil nil nil nil :group 'generic-x-modes)
151 162
152;; A more general solution would allow us to enter generic-mode for 163;; A more general solution would allow us to enter generic-mode for
153;; *any* comment character, but would require us to synthesize a new 164;; *any* comment character, but would require us to synthesize a new
@@ -185,55 +196,101 @@ This hook will be installed if the variable
185;; Other Generic modes 196;; Other Generic modes
186;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 197;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
187 198
188(defcustom generic-extras-enable-list nil 199;; If you add a generic mode to this file, put it in one of these four
189 "*List of generic modes to enable by default. 200;; lists as well.
190Each entry in the list should be a symbol. The variables 201
191`generic-define-mswindows-modes' and `generic-define-unix-modes' 202(defconst generic-default-modes
192also affect which generic modes are defined. Please note that if 203 '(apache-conf-generic-mode
193you set this variable after generic-x is loaded, you must reload 204 apache-log-generic-mode
194generic-x to enable the specified modes." 205 hosts-generic-mode
195 :group 'generic-x 206 java-manifest-generic-mode
196 :type '(repeat sexp)) 207 java-properties-generic-mode
208 javascript-generic-mode
209 show-tabs-generic-mode
210 vrml-generic-mode)
211 "List of generic modes that are defined by default.")
212
213(defconst generic-mswindows-modes
214 '(bat-generic-mode
215 inf-generic-mode
216 ini-generic-mode
217 rc-generic-mode
218 reg-generic-mode
219 rul-generic-mode)
220 "List of generic modes that are defined by default on MS-Windows.")
221
222(defconst generic-unix-modes
223 '(alias-generic-mode
224 etc-fstab-generic-mode
225 etc-modules-conf-generic-mode
226 etc-passwd-generic-mode
227 etc-services-generic-mode
228 fvwm-generic-mode
229 inetd-conf-generic-mode
230 mailagent-rules-generic-mode
231 mailrc-generic-mode
232 named-boot-generic-mode
233 named-database-generic-mode
234 prototype-generic-mode
235 resolve-conf-generic-mode
236 samba-generic-mode
237 x-resource-generic-mode)
238 "List of generic modes that are defined by default on Unix.")
239
240(defconst generic-other-modes
241 '(astap-generic-mode
242 ibis-generic-mode
243 pkginfo-generic-mode
244 spice-generic-mode)
245 "List of generic mode that are not defined by default.")
197 246
198(defcustom generic-define-mswindows-modes 247(defcustom generic-define-mswindows-modes
199 (memq system-type '(windows-nt ms-dos)) 248 (memq system-type '(windows-nt ms-dos))
200 "*If non-nil, some MS-Windows specific generic modes will be defined." 249 "*Non-nil means the modes in `generic-mswindows-modes' will be defined.
250This is a list of MS-Windows specific generic modes. This variable
251only effects the default value of `generic-extras-enable-list'."
201 :group 'generic-x 252 :group 'generic-x
202 :type 'boolean) 253 :type 'boolean
254 :version "22.1")
255(make-obsolete-variable 'generic-define-mswindows-modes 'generic-extras-enable-list "22.1")
203 256
204(defcustom generic-define-unix-modes 257(defcustom generic-define-unix-modes
205 (not (memq system-type '(windows-nt ms-dos))) 258 (not (memq system-type '(windows-nt ms-dos)))
206 "*If non-nil, some Unix specific generic modes will be defined." 259 "*Non-nil means the modes in `generic-unix-modes' will be defined.
260This is a list of Unix specific generic modes. This variable only
261effects the default value of `generic-extras-enable-list'."
207 :group 'generic-x 262 :group 'generic-x
208 :type 'boolean) 263 :type 'boolean
209 264 :version "22.1")
210(and generic-define-mswindows-modes 265(make-obsolete-variable 'generic-define-unix-modes 'generic-extras-enable-list "22.1")
211 (setq generic-extras-enable-list 266
212 (append '(bat-generic-mode 267(defcustom generic-extras-enable-list
213 ini-generic-mode 268 (append generic-default-modes
214 inf-generic-mode 269 (if generic-define-mswindows-modes generic-mswindows-modes)
215 rc-generic-mode 270 (if generic-define-unix-modes generic-unix-modes)
216 reg-generic-mode 271 nil)
217 rul-generic-mode 272 "List of generic modes to define.
218 hosts-generic-mode 273Each entry in the list should be a symbol. If you set this variable
219 apache-conf-generic-mode 274directly, without using customize, you must reload generic-x to put
220 apache-log-generic-mode) 275your changes into effect."
221 generic-extras-enable-list))) 276 :group 'generic-x
222 277 :type (let (list)
223(and generic-define-unix-modes 278 (dolist (mode
224 (setq generic-extras-enable-list 279 (sort (append generic-default-modes
225 (append '(apache-conf-generic-mode 280 generic-mswindows-modes
226 apache-log-generic-mode 281 generic-unix-modes
227 samba-generic-mode 282 generic-other-modes
228 hosts-generic-mode 283 nil)
229 fvwm-generic-mode 284 (lambda (a b)
230 x-resource-generic-mode 285 (string< (symbol-name b)
231 alias-generic-mode 286 (symbol-name a))))
232 inetd-conf-generic-mode 287 (cons 'set list))
233 etc-services-generic-mode 288 (push `(const ,mode) list)))
234 etc-passwd-generic-mode 289 :set (lambda (s v)
235 etc-fstab-generic-mode) 290 (set-default s v)
236 generic-extras-enable-list))) 291 (unless load-in-progress
292 (load "generic-x")))
293 :version "22.1")
237 294
238;;; Apache 295;;; Apache
239(when (memq 'apache-conf-generic-mode generic-extras-enable-list) 296(when (memq 'apache-conf-generic-mode generic-extras-enable-list)
@@ -252,7 +309,7 @@ generic-x to enable the specified modes."
252 ("*Directories*" "^\\s-*<Directory\\s-*\\([^>]+\\)>" 1) 309 ("*Directories*" "^\\s-*<Directory\\s-*\\([^>]+\\)>" 1)
253 ("*Locations*" "^\\s-*<Location\\s-*\\([^>]+\\)>" 1)))))) 310 ("*Locations*" "^\\s-*<Location\\s-*\\([^>]+\\)>" 1))))))
254 "Generic mode for Apache or HTTPD configuration files." 311 "Generic mode for Apache or HTTPD configuration files."
255 :group 'generic-x)) 312 :group 'generic-x-modes))
256 313
257(when (memq 'apache-log-generic-mode generic-extras-enable-list) 314(when (memq 'apache-log-generic-mode generic-extras-enable-list)
258 315
@@ -266,7 +323,7 @@ generic-x to enable the specified modes."
266 '("access_log\\'") 323 '("access_log\\'")
267 nil 324 nil
268 "Mode for Apache log files" 325 "Mode for Apache log files"
269 :group 'generic-x)) 326 :group 'generic-x-modes))
270 327
271;;; Samba 328;;; Samba
272(when (memq 'samba-generic-mode generic-extras-enable-list) 329(when (memq 'samba-generic-mode generic-extras-enable-list)
@@ -281,7 +338,7 @@ generic-x to enable the specified modes."
281 '("smb\\.conf\\'") 338 '("smb\\.conf\\'")
282 '(generic-bracket-support) 339 '(generic-bracket-support)
283 "Generic mode for Samba configuration files." 340 "Generic mode for Samba configuration files."
284 :group 'generic-x)) 341 :group 'generic-x-modes))
285 342
286;;; Fvwm 343;;; Fvwm
287;; This is pretty basic. Also, modes for other window managers could 344;; This is pretty basic. Also, modes for other window managers could
@@ -307,7 +364,7 @@ generic-x to enable the specified modes."
307 '("\\.fvwmrc\\'" "\\.fvwm2rc\\'") 364 '("\\.fvwmrc\\'" "\\.fvwm2rc\\'")
308 nil 365 nil
309 "Generic mode for FVWM configuration files." 366 "Generic mode for FVWM configuration files."
310 :group 'generic-x)) 367 :group 'generic-x-modes))
311 368
312;;; X Resource 369;;; X Resource
313;; I'm pretty sure I've seen an actual mode to do this, but I don't 370;; I'm pretty sure I've seen an actual mode to do this, but I don't
@@ -321,7 +378,7 @@ generic-x to enable the specified modes."
321 '("\\.Xdefaults\\'" "\\.Xresources\\'" "\\.Xenvironment\\'" "\\.ad\\'") 378 '("\\.Xdefaults\\'" "\\.Xresources\\'" "\\.Xenvironment\\'" "\\.ad\\'")
322 nil 379 nil
323 "Generic mode for X Resource configuration files." 380 "Generic mode for X Resource configuration files."
324 :group 'generic-x)) 381 :group 'generic-x-modes))
325 382
326;;; Hosts 383;;; Hosts
327(when (memq 'hosts-generic-mode generic-extras-enable-list) 384(when (memq 'hosts-generic-mode generic-extras-enable-list)
@@ -333,7 +390,7 @@ generic-x to enable the specified modes."
333 '("[hH][oO][sS][tT][sS]\\'") 390 '("[hH][oO][sS][tT][sS]\\'")
334 nil 391 nil
335 "Generic mode for HOSTS files." 392 "Generic mode for HOSTS files."
336 :group 'generic-x)) 393 :group 'generic-x-modes))
337 394
338;;; Windows INF files 395;;; Windows INF files
339(when (memq 'inf-generic-mode generic-extras-enable-list) 396(when (memq 'inf-generic-mode generic-extras-enable-list)
@@ -345,7 +402,7 @@ generic-x to enable the specified modes."
345 '("\\.[iI][nN][fF]\\'") 402 '("\\.[iI][nN][fF]\\'")
346 '(generic-bracket-support) 403 '(generic-bracket-support)
347 "Generic mode for MS-Windows INF files." 404 "Generic mode for MS-Windows INF files."
348 :group 'generic-x)) 405 :group 'generic-x-modes))
349 406
350;;; Windows INI files 407;;; Windows INI files
351;; Should define escape character as well! 408;; Should define escape character as well!
@@ -368,7 +425,7 @@ generic-x to enable the specified modes."
368 "Generic mode for MS-Windows INI files. 425 "Generic mode for MS-Windows INI files.
369You can use `ini-generic-mode-find-file-hook' to enter this mode 426You can use `ini-generic-mode-find-file-hook' to enter this mode
370automatically for INI files whose names do not end in \".ini\"." 427automatically for INI files whose names do not end in \".ini\"."
371 :group 'generic-x) 428 :group 'generic-x-modes)
372 429
373(defun ini-generic-mode-find-file-hook () 430(defun ini-generic-mode-find-file-hook ()
374 "Hook function to enter Ini-Generic mode automatically for INI files. 431 "Hook function to enter Ini-Generic mode automatically for INI files.
@@ -397,7 +454,7 @@ like an INI file. You can add this hook to `find-file-hook'."
397 (setq imenu-generic-expression 454 (setq imenu-generic-expression
398 '((nil "^\\s-*\\(.*\\)\\s-*=" 1)))))) 455 '((nil "^\\s-*\\(.*\\)\\s-*=" 1))))))
399 "Generic mode for MS-Windows Registry files." 456 "Generic mode for MS-Windows Registry files."
400 :group 'generic-x)) 457 :group 'generic-x-modes))
401 458
402;;; DOS/Windows BAT files 459;;; DOS/Windows BAT files
403(when (memq 'bat-generic-mode generic-extras-enable-list) 460(when (memq 'bat-generic-mode generic-extras-enable-list)
@@ -472,10 +529,10 @@ like an INI file. You can add this hook to `find-file-hook'."
472 "\\`[aA][uU][tT][oO][eE][xX][eE][cC]\\.") 529 "\\`[aA][uU][tT][oO][eE][xX][eE][cC]\\.")
473 '(generic-bat-mode-setup-function) 530 '(generic-bat-mode-setup-function)
474 "Generic mode for MS-Windows BAT files." 531 "Generic mode for MS-Windows BAT files."
475 :group 'generic-x) 532 :group 'generic-x-modes)
476 533
477(defvar bat-generic-mode-syntax-table nil 534(defvar bat-generic-mode-syntax-table nil
478 "Syntax table in use in bat-generic-mode buffers.") 535 "Syntax table in use in `bat-generic-mode' buffers.")
479 536
480(defvar bat-generic-mode-keymap (make-sparse-keymap) 537(defvar bat-generic-mode-keymap (make-sparse-keymap)
481 "Keymap for bet-generic-mode.") 538 "Keymap for bet-generic-mode.")
@@ -552,7 +609,7 @@ like an INI file. You can add this hook to `find-file-hook'."
552 (setq imenu-generic-expression 609 (setq imenu-generic-expression
553 '((nil "\\s-/\\([^/]+\\)/[i, \t\n]" 1)))))) 610 '((nil "\\s-/\\([^/]+\\)/[i, \t\n]" 1))))))
554 "Mode for Mailagent rules files." 611 "Mode for Mailagent rules files."
555 :group 'generic-x)) 612 :group 'generic-x-modes))
556 613
557;; Solaris/Sys V prototype files 614;; Solaris/Sys V prototype files
558(when (memq 'prototype-generic-mode generic-extras-enable-list) 615(when (memq 'prototype-generic-mode generic-extras-enable-list)
@@ -576,7 +633,7 @@ like an INI file. You can add this hook to `find-file-hook'."
576 '("prototype\\'") 633 '("prototype\\'")
577 nil 634 nil
578 "Mode for Sys V prototype files." 635 "Mode for Sys V prototype files."
579 :group 'generic-x)) 636 :group 'generic-x-modes))
580 637
581;; Solaris/Sys V pkginfo files 638;; Solaris/Sys V pkginfo files
582(when (memq 'pkginfo-generic-mode generic-extras-enable-list) 639(when (memq 'pkginfo-generic-mode generic-extras-enable-list)
@@ -590,10 +647,12 @@ like an INI file. You can add this hook to `find-file-hook'."
590 '("pkginfo\\'") 647 '("pkginfo\\'")
591 nil 648 nil
592 "Mode for Sys V pkginfo files." 649 "Mode for Sys V pkginfo files."
593 :group 'generic-x)) 650 :group 'generic-x-modes))
594 651
595;; Javascript mode 652;; Javascript mode
596;; Includes extra keywords from Armando Singer [asinger@MAIL.COLGATE.EDU] 653;; Includes extra keywords from Armando Singer [asinger@MAIL.COLGATE.EDU]
654(when (memq 'javascript-generic-mode generic-extras-enable-list)
655
597(define-generic-mode javascript-generic-mode 656(define-generic-mode javascript-generic-mode
598 '("//" ("/*" . "*/")) 657 '("//" ("/*" . "*/"))
599 '("break" 658 '("break"
@@ -668,9 +727,11 @@ like an INI file. You can add this hook to `find-file-hook'."
668 '((nil "^function\\s-+\\([A-Za-z0-9_]+\\)" 1) 727 '((nil "^function\\s-+\\([A-Za-z0-9_]+\\)" 1)
669 ("*Variables*" "^var\\s-+\\([A-Za-z0-9_]+\\)" 1)))))) 728 ("*Variables*" "^var\\s-+\\([A-Za-z0-9_]+\\)" 1))))))
670 "Mode for JavaScript files." 729 "Mode for JavaScript files."
671 :group 'generic-x) 730 :group 'generic-x-modes))
672 731
673;; VRML files 732;; VRML files
733(when (memq 'vrml-generic-mode generic-extras-enable-list)
734
674(define-generic-mode vrml-generic-mode 735(define-generic-mode vrml-generic-mode
675 '(?#) 736 '(?#)
676 '("DEF" 737 '("DEF"
@@ -720,9 +781,11 @@ like an INI file. You can add this hook to `find-file-hook'."
720 "DEF\\s-+\\([-A-Za-z0-9_]+\\)\\s-+\\([A-Za-z0-9]+\\)\\s-*{" 781 "DEF\\s-+\\([-A-Za-z0-9_]+\\)\\s-+\\([A-Za-z0-9]+\\)\\s-*{"
721 1)))))) 782 1))))))
722 "Generic Mode for VRML files." 783 "Generic Mode for VRML files."
723 :group 'generic-x) 784 :group 'generic-x-modes))
724 785
725;; Java Manifests 786;; Java Manifests
787(when (memq 'java-manifest-generic-mode generic-extras-enable-list)
788
726(define-generic-mode java-manifest-generic-mode 789(define-generic-mode java-manifest-generic-mode
727 '(?#) 790 '(?#)
728 '("Name" 791 '("Name"
@@ -740,9 +803,11 @@ like an INI file. You can add this hook to `find-file-hook'."
740 '("[mM][aA][nN][iI][fF][eE][sS][tT]\\.[mM][fF]\\'") 803 '("[mM][aA][nN][iI][fF][eE][sS][tT]\\.[mM][fF]\\'")
741 nil 804 nil
742 "Mode for Java Manifest files" 805 "Mode for Java Manifest files"
743 :group 'generic-x) 806 :group 'generic-x-modes))
744 807
745;; Java properties files 808;; Java properties files
809(when (memq 'java-properties-generic-mode generic-extras-enable-list)
810
746(define-generic-mode java-properties-generic-mode 811(define-generic-mode java-properties-generic-mode
747 '(?! ?#) 812 '(?! ?#)
748 nil 813 nil
@@ -771,7 +836,7 @@ like an INI file. You can add this hook to `find-file-hook'."
771 (setq imenu-generic-expression 836 (setq imenu-generic-expression
772 '((nil "^\\([^#! \t\n\r=:]+\\)" 1)))))) 837 '((nil "^\\([^#! \t\n\r=:]+\\)" 1))))))
773 "Mode for Java properties files." 838 "Mode for Java properties files."
774 :group 'generic-x) 839 :group 'generic-x-modes))
775 840
776;; C shell alias definitions 841;; C shell alias definitions
777(when (memq 'alias-generic-mode generic-extras-enable-list) 842(when (memq 'alias-generic-mode generic-extras-enable-list)
@@ -790,7 +855,7 @@ like an INI file. You can add this hook to `find-file-hook'."
790 (setq imenu-generic-expression 855 (setq imenu-generic-expression
791 '((nil "^\\(alias\\|unalias\\)\\s-+\\([-a-zA-Z0-9_]+\\)" 2)))))) 856 '((nil "^\\(alias\\|unalias\\)\\s-+\\([-a-zA-Z0-9_]+\\)" 2))))))
792 "Mode for C Shell alias files." 857 "Mode for C Shell alias files."
793 :group 'generic-x)) 858 :group 'generic-x-modes))
794 859
795;;; Windows RC files 860;;; Windows RC files
796;; Contributed by ACorreir@pervasive-sw.com (Alfred Correira) 861;; Contributed by ACorreir@pervasive-sw.com (Alfred Correira)
@@ -883,7 +948,7 @@ like an INI file. You can add this hook to `find-file-hook'."
883 '("\\.[rR][cC]\\'") 948 '("\\.[rR][cC]\\'")
884 nil 949 nil
885 "Generic mode for MS-Windows Resource files." 950 "Generic mode for MS-Windows Resource files."
886 :group 'generic-x)) 951 :group 'generic-x-modes))
887 952
888;; InstallShield RUL files 953;; InstallShield RUL files
889;; Contributed by Alfred.Correira@Pervasive.Com 954;; Contributed by Alfred.Correira@Pervasive.Com
@@ -1436,7 +1501,7 @@ like an INI file. You can add this hook to `find-file-hook'."
1436 "Function argument constants used in InstallShield 3 and 5.")) 1501 "Function argument constants used in InstallShield 3 and 5."))
1437 1502
1438(defvar rul-generic-mode-syntax-table nil 1503(defvar rul-generic-mode-syntax-table nil
1439 "Syntax table to use in rul-generic-mode buffers.") 1504 "Syntax table to use in `rul-generic-mode' buffers.")
1440 1505
1441(setq rul-generic-mode-syntax-table 1506(setq rul-generic-mode-syntax-table
1442 (make-syntax-table c++-mode-syntax-table)) 1507 (make-syntax-table c++-mode-syntax-table))
@@ -1504,7 +1569,7 @@ like an INI file. You can add this hook to `find-file-hook'."
1504 '("\\.[rR][uU][lL]\\'") 1569 '("\\.[rR][uU][lL]\\'")
1505 '(generic-rul-mode-setup-function) 1570 '(generic-rul-mode-setup-function)
1506 "Generic mode for InstallShield RUL files." 1571 "Generic mode for InstallShield RUL files."
1507 :group 'generic-x) 1572 :group 'generic-x-modes)
1508 1573
1509(define-skeleton rul-if 1574(define-skeleton rul-if
1510 "Insert an if statement." 1575 "Insert an if statement."
@@ -1531,6 +1596,8 @@ like an INI file. You can add this hook to `find-file-hook'."
1531 > "end;")) 1596 > "end;"))
1532 1597
1533;; Additions by ACorreir@pervasive-sw.com (Alfred Correira) 1598;; Additions by ACorreir@pervasive-sw.com (Alfred Correira)
1599(when (memq 'mailrc-generic-mode generic-extras-enable-list)
1600
1534(define-generic-mode mailrc-generic-mode 1601(define-generic-mode mailrc-generic-mode
1535 '(?#) 1602 '(?#)
1536 '("alias" 1603 '("alias"
@@ -1553,7 +1620,7 @@ like an INI file. You can add this hook to `find-file-hook'."
1553 '("\\.mailrc\\'") 1620 '("\\.mailrc\\'")
1554 nil 1621 nil
1555 "Mode for mailrc files." 1622 "Mode for mailrc files."
1556 :group 'generic-x) 1623 :group 'generic-x-modes))
1557 1624
1558;; Inetd.conf 1625;; Inetd.conf
1559(when (memq 'inetd-conf-generic-mode generic-extras-enable-list) 1626(when (memq 'inetd-conf-generic-mode generic-extras-enable-list)
@@ -1574,7 +1641,7 @@ like an INI file. You can add this hook to `find-file-hook'."
1574 (lambda () 1641 (lambda ()
1575 (setq imenu-generic-expression 1642 (setq imenu-generic-expression
1576 '((nil "^\\([-A-Za-z0-9_]+\\)" 1)))))) 1643 '((nil "^\\([-A-Za-z0-9_]+\\)" 1))))))
1577 :group 'generic-x)) 1644 :group 'generic-x-modes))
1578 1645
1579;; Services 1646;; Services
1580(when (memq 'etc-services-generic-mode generic-extras-enable-list) 1647(when (memq 'etc-services-generic-mode generic-extras-enable-list)
@@ -1593,7 +1660,7 @@ like an INI file. You can add this hook to `find-file-hook'."
1593 (lambda () 1660 (lambda ()
1594 (setq imenu-generic-expression 1661 (setq imenu-generic-expression
1595 '((nil "^\\([-A-Za-z0-9_]+\\)" 1)))))) 1662 '((nil "^\\([-A-Za-z0-9_]+\\)" 1))))))
1596 :group 'generic-x)) 1663 :group 'generic-x-modes))
1597 1664
1598;; Password and Group files 1665;; Password and Group files
1599(when (memq 'etc-passwd-generic-mode generic-extras-enable-list) 1666(when (memq 'etc-passwd-generic-mode generic-extras-enable-list)
@@ -1636,7 +1703,7 @@ like an INI file. You can add this hook to `find-file-hook'."
1636 (lambda () 1703 (lambda ()
1637 (setq imenu-generic-expression 1704 (setq imenu-generic-expression
1638 '((nil "^\\([-A-Za-z0-9_]+\\):" 1)))))) 1705 '((nil "^\\([-A-Za-z0-9_]+\\):" 1))))))
1639 :group 'generic-x)) 1706 :group 'generic-x-modes))
1640 1707
1641;; Fstab 1708;; Fstab
1642(when (memq 'etc-fstab-generic-mode generic-extras-enable-list) 1709(when (memq 'etc-fstab-generic-mode generic-extras-enable-list)
@@ -1687,9 +1754,11 @@ like an INI file. You can add this hook to `find-file-hook'."
1687 (lambda () 1754 (lambda ()
1688 (setq imenu-generic-expression 1755 (setq imenu-generic-expression
1689 '((nil "^\\([/-A-Za-z0-9_]+\\)\\s-+" 1)))))) 1756 '((nil "^\\([/-A-Za-z0-9_]+\\)\\s-+" 1))))))
1690 :group 'generic-x)) 1757 :group 'generic-x-modes))
1691 1758
1692;; From Jacques Duthen <jacques.duthen@sncf.fr> 1759;; From Jacques Duthen <jacques.duthen@sncf.fr>
1760(when (memq 'show-tabs-generic-mode generic-extras-enable-list)
1761
1693(eval-when-compile 1762(eval-when-compile
1694 1763
1695(defconst show-tabs-generic-mode-font-lock-defaults-1 1764(defconst show-tabs-generic-mode-font-lock-defaults-1
@@ -1711,7 +1780,7 @@ like an INI file. You can add this hook to `find-file-hook'."
1711 (((class color)) (:background "red")) 1780 (((class color)) (:background "red"))
1712 (t (:weight bold))) 1781 (t (:weight bold)))
1713 "Font Lock mode face used to highlight TABs." 1782 "Font Lock mode face used to highlight TABs."
1714 :group 'generic-x) 1783 :group 'generic-x-modes)
1715 1784
1716(defface show-tabs-space-face 1785(defface show-tabs-space-face
1717 '((((class grayscale) (background light)) (:background "DimGray" :weight bold)) 1786 '((((class grayscale) (background light)) (:background "DimGray" :weight bold))
@@ -1720,7 +1789,7 @@ like an INI file. You can add this hook to `find-file-hook'."
1720 (((class color)) (:background "yellow")) 1789 (((class color)) (:background "yellow"))
1721 (t (:weight bold))) 1790 (t (:weight bold)))
1722 "Font Lock mode face used to highlight spaces." 1791 "Font Lock mode face used to highlight spaces."
1723 :group 'generic-x) 1792 :group 'generic-x-modes)
1724 1793
1725(define-generic-mode show-tabs-generic-mode 1794(define-generic-mode show-tabs-generic-mode
1726 nil ;; no comment char 1795 nil ;; no comment char
@@ -1730,12 +1799,14 @@ like an INI file. You can add this hook to `find-file-hook'."
1730 ;; '(show-tabs-generic-mode-hook-fun) 1799 ;; '(show-tabs-generic-mode-hook-fun)
1731 nil 1800 nil
1732 "Generic mode to show tabs and trailing spaces" 1801 "Generic mode to show tabs and trailing spaces"
1733 :group 'generic-x) 1802 :group 'generic-x-modes))
1734 1803
1735;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1804;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1736;; DNS modes 1805;; DNS modes
1737;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1806;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1738 1807
1808(when (memq 'named-boot-generic-mode generic-extras-enable-list)
1809
1739(define-generic-mode named-boot-generic-mode 1810(define-generic-mode named-boot-generic-mode
1740 ;; List of comment characters 1811 ;; List of comment characters
1741 '(?\;) 1812 '(?\;)
@@ -1752,7 +1823,9 @@ like an INI file. You can add this hook to `find-file-hook'."
1752 '("/etc/named.boot\\'") 1823 '("/etc/named.boot\\'")
1753 ;; List of set up functions to call 1824 ;; List of set up functions to call
1754 nil 1825 nil
1755 :group 'generic-x) 1826 :group 'generic-x-modes))
1827
1828(when (memq 'named-database-generic-mode generic-extras-enable-list)
1756 1829
1757(define-generic-mode named-database-generic-mode 1830(define-generic-mode named-database-generic-mode
1758 ;; List of comment characters 1831 ;; List of comment characters
@@ -1766,7 +1839,7 @@ like an INI file. You can add this hook to `find-file-hook'."
1766 nil 1839 nil
1767 ;; List of set up functions to call 1840 ;; List of set up functions to call
1768 nil 1841 nil
1769 :group 'generic-x) 1842 :group 'generic-x-modes)
1770 1843
1771(defvar named-database-time-string "%Y%m%d%H" 1844(defvar named-database-time-string "%Y%m%d%H"
1772 "Timestring for named serial numbers.") 1845 "Timestring for named serial numbers.")
@@ -1774,7 +1847,9 @@ like an INI file. You can add this hook to `find-file-hook'."
1774(defun named-database-print-serial () 1847(defun named-database-print-serial ()
1775 "Print a serial number based on the current date." 1848 "Print a serial number based on the current date."
1776 (interactive) 1849 (interactive)
1777 (insert (format-time-string named-database-time-string (current-time)))) 1850 (insert (format-time-string named-database-time-string (current-time)))))
1851
1852(when (memq 'resolve-conf-generic-mode generic-extras-enable-list)
1778 1853
1779(define-generic-mode resolve-conf-generic-mode 1854(define-generic-mode resolve-conf-generic-mode
1780 ;; List of comment characters 1855 ;; List of comment characters
@@ -1787,12 +1862,14 @@ like an INI file. You can add this hook to `find-file-hook'."
1787 '("/etc/resolv[e]?.conf\\'") 1862 '("/etc/resolv[e]?.conf\\'")
1788 ;; List of set up functions to call 1863 ;; List of set up functions to call
1789 nil 1864 nil
1790 :group 'generic-x) 1865 :group 'generic-x-modes))
1791 1866
1792;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1867;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1793;; Modes for spice and common electrical engineering circuit netlist formats 1868;; Modes for spice and common electrical engineering circuit netlist formats
1794;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1869;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1795 1870
1871(when (memq 'spice-generic-mode generic-extras-enable-list)
1872
1796(define-generic-mode spice-generic-mode 1873(define-generic-mode spice-generic-mode
1797 nil 1874 nil
1798 '("and" 1875 '("and"
@@ -1830,7 +1907,9 @@ like an INI file. You can add this hook to `find-file-hook'."
1830 (lambda() 1907 (lambda()
1831 (setq font-lock-defaults '(generic-font-lock-keywords nil t))))) 1908 (setq font-lock-defaults '(generic-font-lock-keywords nil t)))))
1832 "Generic mode for SPICE circuit netlist files." 1909 "Generic mode for SPICE circuit netlist files."
1833 :group 'generic-x) 1910 :group 'generic-x-modes))
1911
1912(when (memq 'ibis-generic-mode generic-extras-enable-list)
1834 1913
1835(define-generic-mode ibis-generic-mode 1914(define-generic-mode ibis-generic-mode
1836 '(?|) 1915 '(?|)
@@ -1840,7 +1919,9 @@ like an INI file. You can add this hook to `find-file-hook'."
1840 '("\\.[iI][bB][sS]\\'") 1919 '("\\.[iI][bB][sS]\\'")
1841 '(generic-bracket-support) 1920 '(generic-bracket-support)
1842 "Generic mode for IBIS circuit netlist files." 1921 "Generic mode for IBIS circuit netlist files."
1843 :group 'generic-x) 1922 :group 'generic-x-modes))
1923
1924(when (memq 'astap-generic-mode generic-extras-enable-list)
1844 1925
1845(define-generic-mode astap-generic-mode 1926(define-generic-mode astap-generic-mode
1846 nil 1927 nil
@@ -1876,7 +1957,9 @@ like an INI file. You can add this hook to `find-file-hook'."
1876 (lambda() 1957 (lambda()
1877 (setq font-lock-defaults '(generic-font-lock-keywords nil t))))) 1958 (setq font-lock-defaults '(generic-font-lock-keywords nil t)))))
1878 "Generic mode for ASTAP circuit netlist files." 1959 "Generic mode for ASTAP circuit netlist files."
1879 :group 'generic-x) 1960 :group 'generic-x-modes))
1961
1962(when (memq 'etc-modules-conf-generic-mode generic-extras-enable-list)
1880 1963
1881(define-generic-mode etc-modules-conf-generic-mode 1964(define-generic-mode etc-modules-conf-generic-mode
1882 ;; List of comment characters 1965 ;; List of comment characters
@@ -1919,7 +2002,7 @@ like an INI file. You can add this hook to `find-file-hook'."
1919 '("/etc/modules.conf" "/etc/conf.modules") 2002 '("/etc/modules.conf" "/etc/conf.modules")
1920 ;; List of set up functions to call 2003 ;; List of set up functions to call
1921 nil 2004 nil
1922 :group 'generic-x) 2005 :group 'generic-x-modes))
1923 2006
1924(provide 'generic-x) 2007(provide 'generic-x)
1925 2008
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index f08f21fadb7..a5c403f0d7d 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,24 @@
12005-04-24 Teodor Zlatanov <tzz@lifelogs.com>
2
3 * spam-report.el (spam-report-unplug-agent)
4 (spam-report-plug-agent, spam-report-deagentize)
5 (spam-report-agentize, spam-report-url-ping-temp-agent-function):
6 support for the Agent in spam-report: when unplugged, report to a
7 file; when plugged, submit all the requests.
8 [Added missing offline functionality from trunk.]
9
102005-04-24 Reiner Steib <Reiner.Steib@gmx.de>
11
12 * spam-report.el (spam-report-url-to-file)
13 (spam-report-requests-file): New function and variable for offline
14 reporting.
15 (spam-report-url-ping-function): Add `spam-report-url-to-file'
16 and user defined function.
17 (spam-report-process-queue): New function.
18 Process requests from `spam-report-requests-file'.
19 (spam-report-url-ping-mm-url): Autoload.
20 [Added missing offline functionality from trunk.]
21
12005-04-18 Katsumi Yamaoka <yamaoka@jpl.org> 222005-04-18 Katsumi Yamaoka <yamaoka@jpl.org>
2 23
3 * qp.el (quoted-printable-encode-region): Save excursion. 24 * qp.el (quoted-printable-encode-region): Save excursion.
diff --git a/lisp/gnus/spam-report.el b/lisp/gnus/spam-report.el
index 80d422b06ab..b8283ffaaa8 100644
--- a/lisp/gnus/spam-report.el
+++ b/lisp/gnus/spam-report.el
@@ -59,14 +59,32 @@ instead."
59 59
60(defcustom spam-report-url-ping-function 60(defcustom spam-report-url-ping-function
61 'spam-report-url-ping-plain 61 'spam-report-url-ping-plain
62 "Function to use for url ping spam reporting." 62 "Function to use for url ping spam reporting.
63The function must accept the arguments `host' and `report'."
63 :type '(choice 64 :type '(choice
64 (const :tag "Connect directly" 65 (const :tag "Connect directly"
65 spam-report-url-ping-plain) 66 spam-report-url-ping-plain)
66 (const :tag "Use the external program specified in `mm-url-program'" 67 (const :tag "Use the external program specified in `mm-url-program'"
67 spam-report-url-ping-mm-url)) 68 spam-report-url-ping-mm-url)
69 (const :tag "Store request URLs in `spam-report-requests-file'"
70 spam-report-url-to-file)
71 (function :tag "User defined function" nil))
68 :group 'spam-report) 72 :group 'spam-report)
69 73
74(defcustom spam-report-requests-file
75 (nnheader-concat gnus-directory "spam/" "spam-report-requests.url")
76 ;; Is there a convention for the extension of such a file?
77 ;; Should we use `spam-directory'?
78 "File where spam report request are stored."
79 :type 'file
80 :group 'spam-report)
81
82(defvar spam-report-url-ping-temp-agent-function nil
83 "Internal variable for `spam-report-agentize' and `spam-report-deagentize'.
84This variable will store the value of `spam-report-url-ping-function' from
85before `spam-report-agentize' was run, so that `spam-report-deagentize' can
86undo that change.")
87
70(defun spam-report-gmane (&rest articles) 88(defun spam-report-gmane (&rest articles)
71 "Report an article as spam through Gmane" 89 "Report an article as spam through Gmane"
72 (dolist (article articles) 90 (dolist (article articles)
@@ -75,10 +93,11 @@ instead."
75 (string-match spam-report-gmane-regex gnus-newsgroup-name))) 93 (string-match spam-report-gmane-regex gnus-newsgroup-name)))
76 (gnus-message 6 "Reporting spam article %d to spam.gmane.org..." article) 94 (gnus-message 6 "Reporting spam article %d to spam.gmane.org..." article)
77 (if spam-report-gmane-use-article-number 95 (if spam-report-gmane-use-article-number
78 (spam-report-url-ping "spam.gmane.org" 96 (spam-report-url-ping
79 (format "/%s:%d" 97 "spam.gmane.org"
80 (gnus-group-real-name gnus-newsgroup-name) 98 (format "/%s:%d"
81 article)) 99 (gnus-group-real-name gnus-newsgroup-name)
100 article))
82 (with-current-buffer nntp-server-buffer 101 (with-current-buffer nntp-server-buffer
83 (gnus-request-head article gnus-newsgroup-name) 102 (gnus-request-head article gnus-newsgroup-name)
84 (goto-char (point-min)) 103 (goto-char (point-min))
@@ -113,14 +132,113 @@ the function specified by `spam-report-url-ping-function'."
113 (format "GET %s HTTP/1.1\nUser-Agent: %s (spam-report.el)\nHost: %s\n\n" 132 (format "GET %s HTTP/1.1\nUser-Agent: %s (spam-report.el)\nHost: %s\n\n"
114 report (gnus-emacs-version) host))))) 133 report (gnus-emacs-version) host)))))
115 134
135;;;###autoload
136(defun spam-report-process-queue (&optional file keep)
137 "Report all queued requests from `spam-report-requests-file'.
138
139If FILE is given, use it instead of `spam-report-requests-file'.
140If KEEP is t, leave old requests in the file. If KEEP is the
141symbol `ask', query before flushing the queue file."
142 (interactive
143 (list (read-file-name
144 "File: "
145 (file-name-directory spam-report-requests-file)
146 spam-report-requests-file
147 nil
148 (file-name-nondirectory spam-report-requests-file))
149 current-prefix-arg))
150 (if (eq spam-report-url-ping-function 'spam-report-url-to-file)
151 (error (concat "Cannot process requests when "
152 "`spam-report-url-ping-function' is "
153 "`spam-report-url-to-file'."))
154 (gnus-message 7 "Processing requests using `%s'."
155 spam-report-url-ping-function))
156 (or file (setq file spam-report-requests-file))
157 (save-excursion
158 (set-buffer (find-file-noselect file))
159 (goto-char (point-min))
160 (while (and (not (eobp))
161 (re-search-forward
162 "http://\\([^/]+\\)\\(/.*\\) *$" (point-at-eol) t))
163 (funcall spam-report-url-ping-function (match-string 1) (match-string 2))
164 (forward-line 1))
165 (if (or (eq keep nil)
166 (and (eq keep 'ask)
167 (y-or-n-p
168 (format
169 "Flush requests from `%s'? " (current-buffer)))))
170 (progn
171 (gnus-message 7 "Flushing request file `%s'"
172 spam-report-requests-file)
173 (erase-buffer)
174 (save-buffer)
175 (kill-buffer (current-buffer)))
176 (gnus-message 7 "Keeping requests in `%s'" spam-report-requests-file))))
177
178;;;###autoload
116(defun spam-report-url-ping-mm-url (host report) 179(defun spam-report-url-ping-mm-url (host report)
117 "Ping a host through HTTP, addressing a specific GET resource. Use 180 "Ping a host through HTTP, addressing a specific GET resource. Use
118the external program specified in `mm-url-program' to connect to 181the external program specified in `mm-url-program' to connect to
119server." 182server."
120 (with-temp-buffer 183 (with-temp-buffer
121 (let ((url (concat "http://" host "/" report))) 184 (let ((url (concat "http://" host report)))
122 (mm-url-insert url t)))) 185 (mm-url-insert url t))))
123 186
187;;;###autoload
188(defun spam-report-url-to-file (host report)
189 "Collect spam report requests in `spam-report-requests-file'.
190Customize `spam-report-url-ping-function' to use this function."
191 (let ((url (concat "http://" host report))
192 (file spam-report-requests-file))
193 (gnus-make-directory (file-name-directory file))
194 (gnus-message 9 "Writing URL `%s' to file `%s'" url file)
195 (with-temp-buffer
196 (insert url)
197 (newline)
198 (append-to-file (point-min) (point-max) file))))
199
200;;;###autoload
201(defun spam-report-agentize ()
202 "Add spam-report support to the Agent.
203Spam reports will be queued with \\[spam-report-url-to-file] when
204the Agent is unplugged, and will be submitted in a batch when the
205Agent is plugged."
206 (interactive)
207 (add-hook 'gnus-agent-plugged-hook 'spam-report-plug-agent)
208 (add-hook 'gnus-agent-unplugged-hook 'spam-report-unplug-agent))
209
210;;;###autoload
211(defun spam-report-deagentize ()
212 "Remove spam-report support from the Agent.
213Spam reports will be queued with the method used when
214\\[spam-report-agentize] was run."
215 (interactive)
216 (remove-hook 'gnus-agent-plugged-hook 'spam-report-plug-agent)
217 (remove-hook 'gnus-agent-unplugged-hook 'spam-report-unplug-agent))
218
219(defun spam-report-plug-agent ()
220 "Adjust spam report settings for plugged state.
221Process queued spam reports."
222 ;; Process the queue, unless the user only wanted to report to a file
223 ;; anyway.
224 (unless (equal spam-report-url-ping-temp-agent-function
225 'spam-report-url-to-file)
226 (spam-report-process-queue))
227 ;; Set the reporting function, if we have memorized something otherwise,
228 ;; stick with plain URL reporting.
229 (setq spam-report-url-ping-function
230 (or spam-report-url-ping-temp-agent-function
231 'spam-report-url-ping-plain)))
232
233(defun spam-report-unplug-agent ()
234 "Restore spam report settings for unplugged state."
235 ;; save the old value
236 (setq spam-report-url-ping-temp-agent-function
237 spam-report-url-ping-function)
238 ;; store all reports to file
239 (setq spam-report-url-ping-function
240 'spam-report-url-to-file))
241
124(provide 'spam-report) 242(provide 'spam-report)
125 243
126;;; arch-tag: f6683295-ec89-4ab5-8803-8cc842293022 244;;; arch-tag: f6683295-ec89-4ab5-8803-8cc842293022
diff --git a/lisp/help.el b/lisp/help.el
index e65982623c1..76fc43d63ef 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -611,6 +611,7 @@ pass a string or a vector.
611If non-nil UNTRANSLATED is a vector of the untranslated events. 611If non-nil UNTRANSLATED is a vector of the untranslated events.
612It can also be a number in which case the untranslated events from 612It can also be a number in which case the untranslated events from
613the last key hit are used." 613the last key hit are used."
614 ;; UP-EVENT is the up-event that was discarded by reading KEY, or nil.
614 (interactive "kDescribe key: \np\nU") 615 (interactive "kDescribe key: \np\nU")
615 (if (numberp untranslated) 616 (if (numberp untranslated)
616 (setq untranslated (this-single-command-raw-keys))) 617 (setq untranslated (this-single-command-raw-keys)))
@@ -634,7 +635,8 @@ the last key hit are used."
634 ;; Don't bother user with strings from (e.g.) the select-paste menu. 635 ;; Don't bother user with strings from (e.g.) the select-paste menu.
635 (if (stringp (aref key (1- (length key)))) 636 (if (stringp (aref key (1- (length key))))
636 (aset key (1- (length key)) "(any string)")) 637 (aset key (1- (length key)) "(any string)"))
637 (if (stringp (aref untranslated (1- (length untranslated)))) 638 (if (and untranslated
639 (stringp (aref untranslated (1- (length untranslated)))))
638 (aset untranslated (1- (length untranslated)) 640 (aset untranslated (1- (length untranslated))
639 "(any string)")) 641 "(any string)"))
640 (with-output-to-temp-buffer (help-buffer) 642 (with-output-to-temp-buffer (help-buffer)
diff --git a/lisp/hexl.el b/lisp/hexl.el
index af996940f86..99bbda91c6c 100644
--- a/lisp/hexl.el
+++ b/lisp/hexl.el
@@ -284,7 +284,7 @@ You can use \\[hexl-find-file] to visit a file in Hexl mode.
284 (add-hook 'change-major-mode-hook 'hexl-maybe-dehexlify-buffer nil t) 284 (add-hook 'change-major-mode-hook 'hexl-maybe-dehexlify-buffer nil t)
285 285
286 ;; Set a callback function for eldoc. 286 ;; Set a callback function for eldoc.
287 (set (make-local-variable 'eldoc-print-current-symbol-info-function) 287 (set (make-local-variable 'eldoc-documentation-function)
288 'hexl-print-current-point-info) 288 'hexl-print-current-point-info)
289 (eldoc-add-command-completions "hexl-") 289 (eldoc-add-command-completions "hexl-")
290 (eldoc-remove-command "hexl-save-buffer" 290 (eldoc-remove-command "hexl-save-buffer"
diff --git a/lisp/hippie-exp.el b/lisp/hippie-exp.el
index 91eb01b5193..bd726564da6 100644
--- a/lisp/hippie-exp.el
+++ b/lisp/hippie-exp.el
@@ -634,7 +634,7 @@ for subsequent calls (for further possible completions of the same
634string). It returns t if a new completion is found, nil otherwise." 634string). It returns t if a new completion is found, nil otherwise."
635 (let ((expansion ()) 635 (let ((expansion ())
636 (strip-prompt (and (get-buffer-process (current-buffer)) 636 (strip-prompt (and (get-buffer-process (current-buffer))
637 comint-use-prompt-regexp-instead-of-fields 637 comint-use-prompt-regexp
638 comint-prompt-regexp))) 638 comint-prompt-regexp)))
639 (if (not old) 639 (if (not old)
640 (progn 640 (progn
@@ -681,7 +681,7 @@ for subsequent calls (for further possible completions of the same
681string). It returns t if a new completion is found, nil otherwise." 681string). It returns t if a new completion is found, nil otherwise."
682 (let ((expansion ()) 682 (let ((expansion ())
683 (strip-prompt (and (get-buffer-process (current-buffer)) 683 (strip-prompt (and (get-buffer-process (current-buffer))
684 comint-use-prompt-regexp-instead-of-fields 684 comint-use-prompt-regexp
685 comint-prompt-regexp)) 685 comint-prompt-regexp))
686 (buf (current-buffer)) 686 (buf (current-buffer))
687 (orig-case-fold-search case-fold-search)) 687 (orig-case-fold-search case-fold-search))
@@ -708,7 +708,7 @@ string). It returns t if a new completion is found, nil otherwise."
708 (widen)) 708 (widen))
709 (goto-char he-search-loc) 709 (goto-char he-search-loc)
710 (setq strip-prompt (and (get-buffer-process (current-buffer)) 710 (setq strip-prompt (and (get-buffer-process (current-buffer))
711 comint-use-prompt-regexp-instead-of-fields 711 comint-use-prompt-regexp
712 comint-prompt-regexp)) 712 comint-prompt-regexp))
713 (setq expansion 713 (setq expansion
714 (let ((case-fold-search orig-case-fold-search)) 714 (let ((case-fold-search orig-case-fold-search))
diff --git a/lisp/ido.el b/lisp/ido.el
index 2e2aca3126e..7ed2d62386c 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -56,7 +56,7 @@
56;; so I invented a common "ido-" namespace for the merged packages. 56;; so I invented a common "ido-" namespace for the merged packages.
57;; 57;;
58;; This version is based on ido.el version 1.57 released on 58;; This version is based on ido.el version 1.57 released on
59;; gnu.emacs.sources adapted for emacs 21.5 to use command remapping 59;; gnu.emacs.sources adapted for emacs 22.1 to use command remapping
60;; and optionally hooking the read-buffer and read-file-name functions. 60;; and optionally hooking the read-buffer and read-file-name functions.
61;; 61;;
62;; Prefix matching was added by Klaus Berndl <klaus.berndl@sdm.de> based on 62;; Prefix matching was added by Klaus Berndl <klaus.berndl@sdm.de> based on
@@ -1346,12 +1346,19 @@ This function also adds a hook to the minibuffer."
1346 (setq ido-everywhere (if arg 1346 (setq ido-everywhere (if arg
1347 (> (prefix-numeric-value arg) 0) 1347 (> (prefix-numeric-value arg) 0)
1348 (not ido-everywhere))) 1348 (not ido-everywhere)))
1349 (setq read-file-name-function 1349 (when (get 'ido-everywhere 'file)
1350 (and ido-everywhere (memq ido-mode '(both file)) 1350 (setq read-file-name-function (car (get 'ido-everywhere 'file)))
1351 'ido-read-file-name)) 1351 (put 'ido-everywhere 'file nil))
1352 (setq read-buffer-function 1352 (when (get 'ido-everywhere 'buffer)
1353 (and ido-everywhere (memq ido-mode '(both buffer)) 1353 (setq read-buffer-function (car (get 'ido-everywhere 'buffer)))
1354 'ido-read-buffer))) 1354 (put 'ido-everywhere 'buffer nil))
1355 (when ido-everywhere
1356 (when (memq ido-mode '(both file))
1357 (put 'ido-everywhere 'file (cons read-file-name-function nil))
1358 (setq read-file-name-function 'ido-read-file-name))
1359 (when (memq ido-mode '(both buffer))
1360 (put 'ido-everywhere 'buffer (cons read-buffer-function nil))
1361 (setq read-buffer-function 'ido-read-buffer))))
1355 1362
1356 1363
1357;;; IDO KEYMAP 1364;;; IDO KEYMAP
@@ -1793,7 +1800,7 @@ If INITIAL is non-nil, it specifies the initial input string."
1793 (ido-name (car ido-matches)))) 1800 (ido-name (car ido-matches))))
1794 1801
1795 (cond 1802 (cond
1796 ((eq item 'buffer) 1803 ((memq item '(buffer list))
1797 (setq done t)) 1804 (setq done t))
1798 1805
1799 ((string-equal "./" ido-selected) 1806 ((string-equal "./" ido-selected)
diff --git a/lisp/ielm.el b/lisp/ielm.el
index 5ef6ff1e1eb..65654ca2c7a 100644
--- a/lisp/ielm.el
+++ b/lisp/ielm.el
@@ -482,6 +482,7 @@ Customized bindings may be defined in `ielm-map', which currently contains:
482 (interactive) 482 (interactive)
483 (comint-mode) 483 (comint-mode)
484 (setq comint-prompt-regexp (concat "^" (regexp-quote ielm-prompt))) 484 (setq comint-prompt-regexp (concat "^" (regexp-quote ielm-prompt)))
485 (set (make-local-variable 'paragraph-separate) "\\'")
485 (make-local-variable 'paragraph-start) 486 (make-local-variable 'paragraph-start)
486 (setq paragraph-start comint-prompt-regexp) 487 (setq paragraph-start comint-prompt-regexp)
487 (setq comint-input-sender 'ielm-input-sender) 488 (setq comint-input-sender 'ielm-input-sender)
@@ -538,7 +539,7 @@ Customized bindings may be defined in `ielm-map', which currently contains:
538 ;; Add a silly header 539 ;; Add a silly header
539 (insert ielm-header) 540 (insert ielm-header)
540 (ielm-set-pm (point-max)) 541 (ielm-set-pm (point-max))
541 (unless comint-use-prompt-regexp-instead-of-fields 542 (unless comint-use-prompt-regexp
542 (let ((inhibit-read-only t)) 543 (let ((inhibit-read-only t))
543 (add-text-properties 544 (add-text-properties
544 (point-min) (point-max) 545 (point-min) (point-max)
diff --git a/lisp/imenu.el b/lisp/imenu.el
index 85430bbdbfc..831550bd7a3 100644
--- a/lisp/imenu.el
+++ b/lisp/imenu.el
@@ -777,7 +777,7 @@ They may also be nested index alists like:
777depending on PATTERNS." 777depending on PATTERNS."
778 778
779 (let ((index-alist (list 'dummy)) 779 (let ((index-alist (list 'dummy))
780 prev-pos beg 780 prev-pos
781 (case-fold-search (if (or (local-variable-p 'imenu-case-fold-search) 781 (case-fold-search (if (or (local-variable-p 'imenu-case-fold-search)
782 (not (local-variable-p 'font-lock-defaults))) 782 (not (local-variable-p 'font-lock-defaults)))
783 imenu-case-fold-search 783 imenu-case-fold-search
@@ -807,7 +807,7 @@ depending on PATTERNS."
807 (index (nth 2 pat)) 807 (index (nth 2 pat))
808 (function (nth 3 pat)) 808 (function (nth 3 pat))
809 (rest (nthcdr 4 pat)) 809 (rest (nthcdr 4 pat))
810 start) 810 start beg)
811 ;; Go backwards for convenience of adding items in order. 811 ;; Go backwards for convenience of adding items in order.
812 (goto-char (point-max)) 812 (goto-char (point-max))
813 (while (and (re-search-backward regexp nil t) 813 (while (and (re-search-backward regexp nil t)
@@ -815,32 +815,35 @@ depending on PATTERNS."
815 ;; because it means a bad regexp was specified. 815 ;; because it means a bad regexp was specified.
816 (not (= (match-beginning 0) (match-end 0)))) 816 (not (= (match-beginning 0) (match-end 0))))
817 (setq start (point)) 817 (setq start (point))
818 (goto-char (match-end index)) 818 ;; Record the start of the line in which the match starts.
819 (setq beg (match-beginning index))
820 ;; Go to the start of the match.
821 ;; That's the official position of this definition. 819 ;; That's the official position of this definition.
822 (goto-char start) 820 (goto-char (match-beginning index))
821 (beginning-of-line)
822 (setq beg (point))
823 (imenu-progress-message prev-pos nil t) 823 (imenu-progress-message prev-pos nil t)
824 ;; Add this sort of submenu only when we've found an 824 ;; Add this sort of submenu only when we've found an
825 ;; item for it, avoiding empty, duff menus. 825 ;; item for it, avoiding empty, duff menus.
826 (unless (assoc menu-title index-alist) 826 (unless (assoc menu-title index-alist)
827 (push (list menu-title) index-alist)) 827 (push (list menu-title) index-alist))
828 (if imenu-use-markers 828 (if imenu-use-markers
829 (setq start (copy-marker start))) 829 (setq beg (copy-marker beg)))
830 (let ((item 830 (let ((item
831 (if function 831 (if function
832 (nconc (list (match-string-no-properties index) 832 (nconc (list (match-string-no-properties index)
833 start function) 833 beg function)
834 rest) 834 rest)
835 (cons (match-string-no-properties index) 835 (cons (match-string-no-properties index)
836 start))) 836 beg)))
837 ;; This is the desired submenu, 837 ;; This is the desired submenu,
838 ;; starting with its title (or nil). 838 ;; starting with its title (or nil).
839 (menu (assoc menu-title index-alist))) 839 (menu (assoc menu-title index-alist)))
840 ;; Insert the item unless it is already present. 840 ;; Insert the item unless it is already present.
841 (unless (member item (cdr menu)) 841 (unless (member item (cdr menu))
842 (setcdr menu 842 (setcdr menu
843 (cons item (cdr menu)))))))) 843 (cons item (cdr menu)))))
844 ;; Go to the start of the match, to make sure we
845 ;; keep making progress backwards.
846 (goto-char start))))
844 (set-syntax-table old-table))) 847 (set-syntax-table old-table)))
845 (imenu-progress-message prev-pos 100 t) 848 (imenu-progress-message prev-pos 100 t)
846 ;; Sort each submenu by position. 849 ;; Sort each submenu by position.
diff --git a/lisp/info.el b/lisp/info.el
index 3ded620cb7a..cfb44cb18f1 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -3243,6 +3243,8 @@ Advanced commands:
3243 (make-local-variable 'line-move-ignore-invisible) 3243 (make-local-variable 'line-move-ignore-invisible)
3244 (setq line-move-ignore-invisible t) 3244 (setq line-move-ignore-invisible t)
3245 (make-local-variable 'desktop-save-buffer) 3245 (make-local-variable 'desktop-save-buffer)
3246 (make-local-variable 'widen-automatically)
3247 (setq widen-automatically nil)
3246 (setq desktop-save-buffer 'Info-desktop-buffer-misc-data) 3248 (setq desktop-save-buffer 'Info-desktop-buffer-misc-data)
3247 (add-hook 'kill-buffer-hook 'Info-kill-buffer nil t) 3249 (add-hook 'kill-buffer-hook 'Info-kill-buffer nil t)
3248 (add-hook 'clone-buffer-hook 'Info-clone-buffer-hook nil t) 3250 (add-hook 'clone-buffer-hook 'Info-clone-buffer-hook nil t)
diff --git a/lisp/international/latexenc.el b/lisp/international/latexenc.el
new file mode 100644
index 00000000000..1fd04b55919
--- /dev/null
+++ b/lisp/international/latexenc.el
@@ -0,0 +1,171 @@
1;;; latexenc.el --- guess correct coding system in LaTeX files
2
3;; Copyright (C) 2005 Free Software Foundation, Inc.
4
5;; Author: Arne J,Ax(Brgensen <arne@arnested.dk>
6;; Keywords: mule, coding system, latex
7
8;; This file is part of GNU Emacs.
9
10;; GNU Emacs is free software; you can redistribute it and/or modify
11;; it under the terms of the GNU General Public License as published by
12;; the Free Software Foundation; either version 2, or (at your option)
13;; any later version.
14
15;; GNU Emacs is distributed in the hope that it will be useful,
16;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;; GNU General Public License for more details.
19
20;; You should have received a copy of the GNU General Public License
21;; along with GNU Emacs; see the file COPYING. If not, write to the
22;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23;; Boston, MA 02111-1307, USA.
24
25;;; Commentary:
26
27;; This code tries to guess the correct coding system of a LaTeX file.
28
29;; First it searches for a \inputencoding{...} or
30;; \usepackage[...]{inputenc} line in the file and looks up the ... in
31;; `latex-inputenc-coding-alist' to find the corresponding coding
32;; system.
33
34;; If this fails it will search for AUCTeX's TeX-master or tex-mode's
35;; tex-main-file variable in the local variables section and visit
36;; that file to get the coding system from the master file. This check
37;; can be disabled by setting `latexenc-dont-use-TeX-master-flag' to
38;; t.
39
40;; If we have still not found a coding system we will try to use the
41;; standard tex-mode's `tex-guess-main-file' and get the coding system
42;; from the main file. This check can be disabled by setting
43;; `latexenc-dont-use-tex-guess-main-file-flag' to t.
44
45;; The functionality is enabled by adding the function
46;; `latexenc-find-file-coding-system' to `file-coding-system-alist'
47;; like this
48
49;; (add-to-list 'file-coding-system-alist
50;; '("\\.tex\\|\\.ltx\\|\\.dtx\\|\\.drv\\'" . latexenc-find-file-coding-system))
51
52;;; Code:
53
54;;;###autoload
55(defcustom latex-inputenc-coding-alist
56 '(("ansinew" . windows-1252) ; MS Windows ANSI encoding, extension of Latin-1
57 ("applemac" . mac-roman)
58 ("ascii" . us-ascii)
59 ("cp1250" . windows-1250) ; MS Windows encoding, codepage 1250
60 ("cp1252" . windows-1252) ; synonym of ansinew
61 ("cp1257" . cp1257)
62 ("cp437de" . cp437) ; IBM code page 437 (German version): 225 is \ss
63 ("cp437" . cp437) ; IBM code page 437: 225 is \beta
64 ("cp850" . cp850) ; IBM code page 850
65 ("cp852" . cp852) ; IBM code page 852
66 ;; ("cp858" . undecided) ; IBM code page 850 but with a euro symbol
67 ("cp865" . cp865) ; IBM code page 865
68 ;; The DECMultinational charaterset used by the OpenVMS system
69 ;; ("decmulti" . undecided)
70 ("latin1" . iso-8859-1)
71 ("latin2" . iso-8859-2)
72 ("latin3" . iso-8859-3)
73 ("latin4" . iso-8859-4)
74 ("latin5" . iso-8859-5)
75 ("latin9" . iso-8859-15)
76 ;; ("latin10" . undecided)
77 ;; ("macce" . undecided) ; Apple Central European
78 ("next" . next) ; The Next encoding
79 ("utf8" . utf-8)
80 ("utf8x" . utf-8)) ; used by the Unicode LaTeX package
81 "Mapping from encoding names used by LaTeX's \"inputenc.sty\" to Emacs coding systems.
82Used by the function `latexenc-find-file-coding-system'."
83 :group 'files
84 :group 'mule
85 :type '(alist :key-type (string :tag "LaTeX input encoding")
86 :value-type (coding-system :tag "Coding system")))
87
88;;;###autoload
89(defun latexenc-inputenc-to-coding-system (inputenc)
90 "Return the corresponding coding-system for the specified input encoding.
91Return nil if no matching coding system can be found."
92 (cdr (assoc inputenc latex-inputenc-coding-alist)))
93
94;;;###autoload
95(defun latexenc-coding-system-to-inputenc (cs)
96 "Return the corresponding input encoding for the specified coding system.
97Return nil if no matching input encoding can be found."
98 (let (result)
99 (catch 'result
100 (dolist (elem latex-inputenc-coding-alist result)
101 (let ((elem-cs (cdr elem)))
102 (when (and (coding-system-p elem-cs)
103 (coding-system-p cs)
104 (eq (coding-system-base cs) (coding-system-base elem-cs)))
105 (setq result (car elem))
106 (throw 'result result)))))))
107
108(defvar latexenc-dont-use-TeX-master-flag nil
109 "Non-nil means don't follow TeX-master to find the coding system.")
110
111(defvar latexenc-dont-use-tex-guess-main-file-flag nil
112 "Non-nil means don't use tex-guessmain-file to find the coding system.")
113
114;;;###autoload
115(defun latexenc-find-file-coding-system (arg-list)
116 "Determine the coding system of a LaTeX file if it uses \"inputenc.sty\".
117The mapping from LaTeX's \"inputenc.sty\" encoding names to Emacs
118coding system names is determined from `latex-inputenc-coding-alist'."
119 (if (eq (car arg-list) 'insert-file-contents)
120 (save-excursion
121 ;; try to find the coding system in this file
122 (goto-char (point-min))
123 (if (or
124 (re-search-forward "^[^%\n]*\\\\inputencoding{\\(.*\\)}" nil t)
125 (re-search-forward "^[^%\n]*\\\\usepackage\\[\\(.*\\)\\]{inputenc}" nil t))
126 (let* ((match (match-string 1))
127 (sym (intern match)))
128 (when (latexenc-inputenc-to-coding-system match)
129 (setq sym (latexenc-inputenc-to-coding-system match))
130 (when (coding-system-p sym)
131 sym
132 (if (and (require 'code-pages nil t) (coding-system-p sym))
133 sym
134 'undecided))))
135 ;; else try to find it in the master/main file
136 (let (latexenc-main-file)
137 ;; is there a TeX-master or tex-main-file in the local variable section
138 (unless latexenc-dont-use-TeX-master-flag
139 (goto-char (point-max))
140 (when (re-search-backward "^%+ *\\(TeX-master\\|tex-main-file\\): *\"\\(.+\\)\"" nil t)
141 (let ((file (concat (file-name-directory (nth 1 arg-list)) (match-string 2))))
142 (if (file-exists-p file)
143 (setq latexenc-main-file file)
144 (if (boundp 'TeX-default-extension)
145 (when (file-exists-p (concat file "." TeX-default-extension))
146 (setq latexenc-main-file (concat file "." TeX-default-extension)))
147 (dolist (ext '("drv" "dtx" "ltx" "tex"))
148 (if (file-exists-p (concat file "." ext))
149 (setq latexenc-main-file (concat file "." ext)))))))))
150 ;; try tex-modes tex-guess-main-file
151 (when (and (not latexenc-dont-use-tex-guess-main-file-flag)
152 (not latexenc-main-file))
153 (when (fboundp 'tex-guess-main-file)
154 (let ((tex-start-of-header "\\\\document\\(style\\|class\\)")
155 (default-directory (file-name-directory (nth 1 arg-list))))
156 (setq latexenc-main-file (tex-guess-main-file)))))
157 ;; if we found a master/main file get the coding system from it
158 (if (and latexenc-main-file
159 (file-readable-p latexenc-main-file))
160 (let* ((latexenc-dont-use-tex-guess-main-file-flag t)
161 (latexenc-dont-use-TeX-master-flag t)
162 (latexenc-main-buffer (find-file-noselect latexenc-main-file t)))
163 (or (buffer-local-value 'coding-system-for-write latexenc-main-buffer)
164 (buffer-local-value 'buffer-file-coding-system latexenc-main-buffer)))
165 'undecided))))
166 'undecided))
167
168(provide 'latexenc)
169
170;; arch-tag: f971bc3e-1fec-4609-8f2f-73dd41ab22e1
171;;; latexenc.el ends here
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 08827e09f0f..8a2c8da2665 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -354,9 +354,6 @@ This also sets the following values:
354 (setq default-process-coding-system 354 (setq default-process-coding-system
355 (cons output-coding input-coding)))) 355 (cons output-coding input-coding))))
356 356
357(defalias 'update-iso-coding-systems 'update-coding-systems-internal)
358(make-obsolete 'update-iso-coding-systems 'update-coding-systems-internal "20.3")
359
360(defun prefer-coding-system (coding-system) 357(defun prefer-coding-system (coding-system)
361 "Add CODING-SYSTEM at the front of the priority list for automatic detection. 358 "Add CODING-SYSTEM at the front of the priority list for automatic detection.
362This also sets the following coding systems: 359This also sets the following coding systems:
@@ -905,7 +902,10 @@ and TO is ignored."
905 ;; give when file is re-read. 902 ;; give when file is re-read.
906 ;; But don't do this if we explicitly ignored the cookie 903 ;; But don't do this if we explicitly ignored the cookie
907 ;; by using `find-file-literally'. 904 ;; by using `find-file-literally'.
908 (unless (or (stringp from) find-file-literally) 905 (unless (or (stringp from)
906 find-file-literally
907 (and coding-system
908 (memq (coding-system-type coding-system) '(0 5))))
909 (let ((auto-cs (save-excursion 909 (let ((auto-cs (save-excursion
910 (save-restriction 910 (save-restriction
911 (widen) 911 (widen)
diff --git a/lisp/international/mule-conf.el b/lisp/international/mule-conf.el
index a3a05a72958..79bf4f3432a 100644
--- a/lisp/international/mule-conf.el
+++ b/lisp/international/mule-conf.el
@@ -1443,7 +1443,8 @@ for decoding and encoding files, process I/O, etc."
1443 ;; the beginning of a doc string, work. 1443 ;; the beginning of a doc string, work.
1444 ("\\(\\`\\|/\\)loaddefs.el\\'" . (raw-text . raw-text-unix)) 1444 ("\\(\\`\\|/\\)loaddefs.el\\'" . (raw-text . raw-text-unix))
1445 ("\\.tar\\'" . (no-conversion . no-conversion)) 1445 ("\\.tar\\'" . (no-conversion . no-conversion))
1446 ( "\\.po[tx]?\\'\\|\\.po\\." . po-find-file-coding-system) 1446 ( "\\.po[tx]?\\'\\|\\.po\\." . po-find-file-coding-system)
1447 ("\\.\\(tex\\|ltx\\|dtx\\|drv\\)\\'" . latexenc-find-file-coding-system)
1447 ("" . (undecided . nil)))) 1448 ("" . (undecided . nil))))
1448 1449
1449 1450
diff --git a/lisp/international/mule-util.el b/lisp/international/mule-util.el
index bfaffba230d..b85d98a1787 100644
--- a/lisp/international/mule-util.el
+++ b/lisp/international/mule-util.el
@@ -211,12 +211,6 @@ defaults to \"...\"."
211;; (prin1-to-string (cdr ret))) 211;; (prin1-to-string (cdr ret)))
212;; (prin1-to-string ret)))))) 212;; (prin1-to-string ret))))))
213 213
214;;; For backward compatibility ...
215;;;###autoload
216(defalias 'truncate-string 'truncate-string-to-width)
217
218;;;###autoload
219(make-obsolete 'truncate-string 'truncate-string-to-width "20.1")
220 214
221;;; Nested alist handler. Nested alist is alist whose elements are 215;;; Nested alist handler. Nested alist is alist whose elements are
222;;; also nested alist. 216;;; also nested alist.
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index 8d5ca33881a..ca08d020c74 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -843,9 +843,6 @@ like `mime-charset' as well as the current style like `:mime-charset'."
843 (plist-get (coding-system-plist coding-system) 843 (plist-get (coding-system-plist coding-system)
844 (intern (concat ":" (symbol-name prop))))))) 844 (intern (concat ":" (symbol-name prop)))))))
845 845
846(defalias 'coding-system-parent 'coding-system-base)
847(make-obsolete 'coding-system-parent 'coding-system-base "20.3")
848
849(defun coding-system-eol-type-mnemonic (coding-system) 846(defun coding-system-eol-type-mnemonic (coding-system)
850 "Return the string indicating end-of-line format of CODING-SYSTEM." 847 "Return the string indicating end-of-line format of CODING-SYSTEM."
851 (let* ((eol-type (coding-system-eol-type coding-system)) 848 (let* ((eol-type (coding-system-eol-type coding-system))
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 0bcbfbb2b89..94210d3018b 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -527,9 +527,9 @@ Type \\[isearch-quote-char] to quote control character to search for it.
527 starting point. 527 starting point.
528 528
529Type \\[isearch-query-replace] to start `query-replace' with string to\ 529Type \\[isearch-query-replace] to start `query-replace' with string to\
530replace from last search string. 530 replace from last search string.
531Type \\[isearch-query-replace-regexp] to start `query-replace-regexp'\ 531Type \\[isearch-query-replace-regexp] to start `query-replace-regexp'\
532with string to replace from last search string.. 532 with string to replace from last search string..
533 533
534Type \\[isearch-toggle-case-fold] to toggle search case-sensitivity. 534Type \\[isearch-toggle-case-fold] to toggle search case-sensitivity.
535Type \\[isearch-toggle-regexp] to toggle regular-expression mode. 535Type \\[isearch-toggle-regexp] to toggle regular-expression mode.
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el
index fe64d871d96..100eb6076db 100644
--- a/lisp/jit-lock.el
+++ b/lisp/jit-lock.el
@@ -69,7 +69,7 @@ Preserves the `buffer-modified-p' state of the current buffer."
69 :group 'jit-lock) 69 :group 'jit-lock)
70 70
71 71
72(defcustom jit-lock-stealth-time 3 72(defcustom jit-lock-stealth-time 16
73 "*Time in seconds to wait before beginning stealth fontification. 73 "*Time in seconds to wait before beginning stealth fontification.
74Stealth fontification occurs if there is no input within this time. 74Stealth fontification occurs if there is no input within this time.
75If nil, stealth fontification is never performed. 75If nil, stealth fontification is never performed.
@@ -80,7 +80,7 @@ The value of this variable is used when JIT Lock mode is turned on."
80 :group 'jit-lock) 80 :group 'jit-lock)
81 81
82 82
83(defcustom jit-lock-stealth-nice 0.125 83(defcustom jit-lock-stealth-nice 0.5
84 "*Time in seconds to pause between chunks of stealth fontification. 84 "*Time in seconds to pause between chunks of stealth fontification.
85Each iteration of stealth fontification is separated by this amount of time, 85Each iteration of stealth fontification is separated by this amount of time,
86thus reducing the demand that stealth fontification makes on the system. 86thus reducing the demand that stealth fontification makes on the system.
diff --git a/lisp/jka-comp-hook.el b/lisp/jka-comp-hook.el
new file mode 100644
index 00000000000..ead50b76343
--- /dev/null
+++ b/lisp/jka-comp-hook.el
@@ -0,0 +1,293 @@
1;;; jka-comp-hook.el --- preloaded code to enable jka-compr.el
2
3;; Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
4
5;; Author: jka@ece.cmu.edu (Jay K. Adams)
6;; Maintainer: FSF
7;; Keywords: data
8
9;; This file is part of GNU Emacs.
10
11;; GNU Emacs is free software; you can redistribute it and/or modify
12;; it under the terms of the GNU General Public License as published by
13;; the Free Software Foundation; either version 2, or (at your option)
14;; any later version.
15
16;; GNU Emacs is distributed in the hope that it will be useful,
17;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;; GNU General Public License for more details.
20
21;; You should have received a copy of the GNU General Public License
22;; along with GNU Emacs; see the file COPYING. If not, write to the
23;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24;; Boston, MA 02111-1307, USA.
25
26;;; Commentary:
27
28;; This file contains the code to enable and disable Auto-Compression mode.
29;; It is preloaded. The guts of this mode are in jka-compr.el, which
30;; is loaded only when you really try to uncompress something.
31
32;;; Code:
33
34(defgroup compression nil
35 "Data compression utilities"
36 :group 'data)
37
38(defgroup jka-compr nil
39 "jka-compr customization"
40 :group 'compression)
41
42;;; I have this defined so that .Z files are assumed to be in unix
43;;; compress format; and .gz files, in gzip format, and .bz2 files in bzip fmt.
44(defcustom jka-compr-compression-info-list
45 ;;[regexp
46 ;; compr-message compr-prog compr-args
47 ;; uncomp-message uncomp-prog uncomp-args
48 ;; can-append auto-mode-flag strip-extension-flag file-magic-bytes]
49 '(["\\.Z\\(~\\|\\.~[0-9]+~\\)?\\'"
50 "compressing" "compress" ("-c")
51 "uncompressing" "uncompress" ("-c")
52 nil t "\037\235"]
53 ;; Formerly, these had an additional arg "-c", but that fails with
54 ;; "Version 0.1pl2, 29-Aug-97." (RedHat 5.1 GNU/Linux) and
55 ;; "Version 0.9.0b, 9-Sept-98".
56 ["\\.bz2\\'"
57 "bzip2ing" "bzip2" nil
58 "bunzip2ing" "bzip2" ("-d")
59 nil t "BZh"]
60 ["\\.tbz\\'"
61 "bzip2ing" "bzip2" nil
62 "bunzip2ing" "bzip2" ("-d")
63 nil nil "BZh"]
64 ["\\.tgz\\'"
65 "compressing" "gzip" ("-c" "-q")
66 "uncompressing" "gzip" ("-c" "-q" "-d")
67 t nil "\037\213"]
68 ["\\.g?z\\(~\\|\\.~[0-9]+~\\)?\\'"
69 "compressing" "gzip" ("-c" "-q")
70 "uncompressing" "gzip" ("-c" "-q" "-d")
71 t t "\037\213"]
72 ;; dzip is gzip with random access. Its compression program can't
73 ;; read/write stdin/out, so .dz files can only be viewed without
74 ;; saving, having their contents decompressed with gzip.
75 ["\\.dz\\'"
76 nil nil nil
77 "uncompressing" "gzip" ("-c" "-q" "-d")
78 nil t "\037\213"])
79
80 "List of vectors that describe available compression techniques.
81Each element, which describes a compression technique, is a vector of
82the form [REGEXP COMPRESS-MSG COMPRESS-PROGRAM COMPRESS-ARGS
83UNCOMPRESS-MSG UNCOMPRESS-PROGRAM UNCOMPRESS-ARGS
84APPEND-FLAG STRIP-EXTENSION-FLAG FILE-MAGIC-CHARS], where:
85
86 regexp is a regexp that matches filenames that are
87 compressed with this format
88
89 compress-msg is the message to issue to the user when doing this
90 type of compression (nil means no message)
91
92 compress-program is a program that performs this compression
93 (nil means visit file in read-only mode)
94
95 compress-args is a list of args to pass to the compress program
96
97 uncompress-msg is the message to issue to the user when doing this
98 type of uncompression (nil means no message)
99
100 uncompress-program is a program that performs this compression
101
102 uncompress-args is a list of args to pass to the uncompress program
103
104 append-flag is non-nil if this compression technique can be
105 appended
106
107 strip-extension-flag non-nil means strip the regexp from file names
108 before attempting to set the mode.
109
110 file-magic-chars is a string of characters that you would find
111 at the beginning of a file compressed in this way.
112
113Because of the way `call-process' is defined, discarding the stderr output of
114a program adds the overhead of starting a shell each time the program is
115invoked."
116 :type '(repeat (vector regexp
117 (choice :tag "Compress Message"
118 (string :format "%v")
119 (const :tag "No Message" nil))
120 (choice :tag "Compress Program"
121 (string)
122 (const :tag "None" nil))
123 (repeat :tag "Compress Arguments" string)
124 (choice :tag "Uncompress Message"
125 (string :format "%v")
126 (const :tag "No Message" nil))
127 (choice :tag "Uncompress Program"
128 (string)
129 (const :tag "None" nil))
130 (repeat :tag "Uncompress Arguments" string)
131 (boolean :tag "Append")
132 (boolean :tag "Strip Extension")
133 (string :tag "Magic Bytes")))
134 :group 'jka-compr)
135
136(defcustom jka-compr-mode-alist-additions
137 (list (cons "\\.tgz\\'" 'tar-mode) (cons "\\.tbz\\'" 'tar-mode))
138 "A list of pairs to add to `auto-mode-alist' when jka-compr is installed."
139 :type '(repeat (cons string symbol))
140 :group 'jka-compr)
141
142(defcustom jka-compr-load-suffixes '(".gz")
143 "List of suffixes to try when loading files."
144 :type '(repeat string)
145 :group 'jka-compr)
146
147;; List of all the elements we actually added to file-coding-system-alist.
148(defvar jka-compr-added-to-file-coding-system-alist nil)
149
150(defvar jka-compr-file-name-handler-entry
151 nil
152 "The entry in `file-name-handler-alist' used by the jka-compr I/O functions.")
153
154(defun jka-compr-build-file-regexp ()
155 (mapconcat
156 'jka-compr-info-regexp
157 jka-compr-compression-info-list
158 "\\|"))
159
160;;; Functions for accessing the return value of jka-compr-get-compression-info
161(defun jka-compr-info-regexp (info) (aref info 0))
162(defun jka-compr-info-compress-message (info) (aref info 1))
163(defun jka-compr-info-compress-program (info) (aref info 2))
164(defun jka-compr-info-compress-args (info) (aref info 3))
165(defun jka-compr-info-uncompress-message (info) (aref info 4))
166(defun jka-compr-info-uncompress-program (info) (aref info 5))
167(defun jka-compr-info-uncompress-args (info) (aref info 6))
168(defun jka-compr-info-can-append (info) (aref info 7))
169(defun jka-compr-info-strip-extension (info) (aref info 8))
170(defun jka-compr-info-file-magic-bytes (info) (aref info 9))
171
172
173(defun jka-compr-get-compression-info (filename)
174 "Return information about the compression scheme of FILENAME.
175The determination as to which compression scheme, if any, to use is
176based on the filename itself and `jka-compr-compression-info-list'."
177 (catch 'compression-info
178 (let ((case-fold-search nil))
179 (mapcar
180 (function (lambda (x)
181 (and (string-match (jka-compr-info-regexp x) filename)
182 (throw 'compression-info x))))
183 jka-compr-compression-info-list)
184 nil)))
185
186(defun jka-compr-install ()
187 "Install jka-compr.
188This adds entries to `file-name-handler-alist' and `auto-mode-alist'
189and `inhibit-first-line-modes-suffixes'."
190
191 (setq jka-compr-file-name-handler-entry
192 (cons (jka-compr-build-file-regexp) 'jka-compr-handler))
193
194 (setq file-name-handler-alist (cons jka-compr-file-name-handler-entry
195 file-name-handler-alist))
196
197 (setq jka-compr-added-to-file-coding-system-alist nil)
198
199 (mapcar
200 (function (lambda (x)
201 ;; Don't do multibyte encoding on the compressed files.
202 (let ((elt (cons (jka-compr-info-regexp x)
203 '(no-conversion . no-conversion))))
204 (setq file-coding-system-alist
205 (cons elt file-coding-system-alist))
206 (setq jka-compr-added-to-file-coding-system-alist
207 (cons elt jka-compr-added-to-file-coding-system-alist)))
208
209 (and (jka-compr-info-strip-extension x)
210 ;; Make entries in auto-mode-alist so that modes
211 ;; are chosen right according to the file names
212 ;; sans `.gz'.
213 (setq auto-mode-alist
214 (cons (list (jka-compr-info-regexp x)
215 nil 'jka-compr)
216 auto-mode-alist))
217 ;; Also add these regexps to
218 ;; inhibit-first-line-modes-suffixes, so that a
219 ;; -*- line in the first file of a compressed tar
220 ;; file doesn't override tar-mode.
221 (setq inhibit-first-line-modes-suffixes
222 (cons (jka-compr-info-regexp x)
223 inhibit-first-line-modes-suffixes)))))
224 jka-compr-compression-info-list)
225 (setq auto-mode-alist
226 (append auto-mode-alist jka-compr-mode-alist-additions))
227
228 ;; Make sure that (load "foo") will find /bla/foo.el.gz.
229 (setq load-suffixes
230 (apply 'append
231 (mapcar (lambda (suffix)
232 (cons suffix
233 (mapcar (lambda (ext) (concat suffix ext))
234 jka-compr-load-suffixes)))
235 load-suffixes))))
236
237
238(defun jka-compr-installed-p ()
239 "Return non-nil if jka-compr is installed.
240The return value is the entry in `file-name-handler-alist' for jka-compr."
241
242 (let ((fnha file-name-handler-alist)
243 (installed nil))
244
245 (while (and fnha (not installed))
246 (and (eq (cdr (car fnha)) 'jka-compr-handler)
247 (setq installed (car fnha)))
248 (setq fnha (cdr fnha)))
249
250 installed))
251
252(define-minor-mode auto-compression-mode
253 "Toggle automatic file compression and uncompression.
254With prefix argument ARG, turn auto compression on if positive, else off.
255Returns the new status of auto compression (non-nil means on)."
256 :global t :group 'jka-compr
257 (let* ((installed (jka-compr-installed-p))
258 (flag auto-compression-mode))
259 (cond
260 ((and flag installed) t) ; already installed
261 ((and (not flag) (not installed)) nil) ; already not installed
262 (flag (jka-compr-install))
263 (t (jka-compr-uninstall)))))
264
265(defmacro with-auto-compression-mode (&rest body)
266 "Evalute BODY with automatic file compression and uncompression enabled."
267 (let ((already-installed (make-symbol "already-installed")))
268 `(let ((,already-installed (jka-compr-installed-p)))
269 (unwind-protect
270 (progn
271 (unless ,already-installed
272 (jka-compr-install))
273 ,@body)
274 (unless ,already-installed
275 (jka-compr-uninstall))))))
276(put 'with-auto-compression-mode 'lisp-indent-function 0)
277
278
279;;; This is what we need to know about jka-compr-handler
280;;; in order to decide when to call it.
281
282(put 'jka-compr-handler 'safe-magic t)
283(put 'jka-compr-handler 'operations '(jka-compr-byte-compiler-base-file-name
284 write-region insert-file-contents
285 file-local-copy load))
286
287;;; Turn on the mode.
288(auto-compression-mode 1)
289
290(provide 'jka-comp-hook)
291
292;; arch-tag: 4bd73429-f400-45fe-a065-270a113e31a8
293;;; jka-comp-hook.el ends here \ No newline at end of file
diff --git a/lisp/jka-compr.el b/lisp/jka-compr.el
index 5bda4349288..ec2eab463cc 100644
--- a/lisp/jka-compr.el
+++ b/lisp/jka-compr.el
@@ -100,15 +100,6 @@
100 100
101;;; Code: 101;;; Code:
102 102
103(defgroup compression nil
104 "Data compression utilities"
105 :group 'data)
106
107(defgroup jka-compr nil
108 "jka-compr customization"
109 :group 'compression)
110
111
112(defcustom jka-compr-shell "sh" 103(defcustom jka-compr-shell "sh"
113 "*Shell to be used for calling compression programs. 104 "*Shell to be used for calling compression programs.
114The value of this variable only matters if you want to discard the 105The value of this variable only matters if you want to discard the
@@ -120,118 +111,6 @@ for `jka-compr-compression-info-list')."
120(defvar jka-compr-use-shell 111(defvar jka-compr-use-shell
121 (not (memq system-type '(ms-dos windows-nt)))) 112 (not (memq system-type '(ms-dos windows-nt))))
122 113
123;;; I have this defined so that .Z files are assumed to be in unix
124;;; compress format; and .gz files, in gzip format, and .bz2 files in bzip fmt.
125(defcustom jka-compr-compression-info-list
126 ;;[regexp
127 ;; compr-message compr-prog compr-args
128 ;; uncomp-message uncomp-prog uncomp-args
129 ;; can-append auto-mode-flag strip-extension-flag file-magic-bytes]
130 '(["\\.Z\\(~\\|\\.~[0-9]+~\\)?\\'"
131 "compressing" "compress" ("-c")
132 "uncompressing" "uncompress" ("-c")
133 nil t "\037\235"]
134 ;; Formerly, these had an additional arg "-c", but that fails with
135 ;; "Version 0.1pl2, 29-Aug-97." (RedHat 5.1 GNU/Linux) and
136 ;; "Version 0.9.0b, 9-Sept-98".
137 ["\\.bz2\\'"
138 "bzip2ing" "bzip2" nil
139 "bunzip2ing" "bzip2" ("-d")
140 nil t "BZh"]
141 ["\\.tbz\\'"
142 "bzip2ing" "bzip2" nil
143 "bunzip2ing" "bzip2" ("-d")
144 nil nil "BZh"]
145 ["\\.tgz\\'"
146 "zipping" "gzip" ("-c" "-q")
147 "unzipping" "gzip" ("-c" "-q" "-d")
148 t nil "\037\213"]
149 ["\\.g?z\\(~\\|\\.~[0-9]+~\\)?\\'"
150 "zipping" "gzip" ("-c" "-q")
151 "unzipping" "gzip" ("-c" "-q" "-d")
152 t t "\037\213"]
153 ;; dzip is gzip with random access. Its compression program can't
154 ;; read/write stdin/out, so .dz files can only be viewed without
155 ;; saving, having their contents decompressed with gzip.
156 ["\\.dz\\'"
157 nil nil nil
158 "unzipping" "gzip" ("-c" "-q" "-d")
159 nil t "\037\213"])
160
161 "List of vectors that describe available compression techniques.
162Each element, which describes a compression technique, is a vector of
163the form [REGEXP COMPRESS-MSG COMPRESS-PROGRAM COMPRESS-ARGS
164UNCOMPRESS-MSG UNCOMPRESS-PROGRAM UNCOMPRESS-ARGS
165APPEND-FLAG STRIP-EXTENSION-FLAG FILE-MAGIC-CHARS], where:
166
167 regexp is a regexp that matches filenames that are
168 compressed with this format
169
170 compress-msg is the message to issue to the user when doing this
171 type of compression (nil means no message)
172
173 compress-program is a program that performs this compression
174 (nil means visit file in read-only mode)
175
176 compress-args is a list of args to pass to the compress program
177
178 uncompress-msg is the message to issue to the user when doing this
179 type of uncompression (nil means no message)
180
181 uncompress-program is a program that performs this compression
182
183 uncompress-args is a list of args to pass to the uncompress program
184
185 append-flag is non-nil if this compression technique can be
186 appended
187
188 strip-extension-flag non-nil means strip the regexp from file names
189 before attempting to set the mode.
190
191 file-magic-chars is a string of characters that you would find
192 at the beginning of a file compressed in this way.
193
194Because of the way `call-process' is defined, discarding the stderr output of
195a program adds the overhead of starting a shell each time the program is
196invoked."
197 :type '(repeat (vector regexp
198 (choice :tag "Compress Message"
199 (string :format "%v")
200 (const :tag "No Message" nil))
201 (choice :tag "Compress Program"
202 (string)
203 (const :tag "None" nil))
204 (repeat :tag "Compress Arguments" string)
205 (choice :tag "Uncompress Message"
206 (string :format "%v")
207 (const :tag "No Message" nil))
208 (choice :tag "Uncompress Program"
209 (string)
210 (const :tag "None" nil))
211 (repeat :tag "Uncompress Arguments" string)
212 (boolean :tag "Append")
213 (boolean :tag "Strip Extension")
214 (string :tag "Magic Bytes")))
215 :group 'jka-compr)
216
217(defcustom jka-compr-mode-alist-additions
218 (list (cons "\\.tgz\\'" 'tar-mode) (cons "\\.tbz\\'" 'tar-mode))
219 "A list of pairs to add to `auto-mode-alist' when jka-compr is installed."
220 :type '(repeat (cons string symbol))
221 :group 'jka-compr)
222
223(defcustom jka-compr-load-suffixes '(".gz")
224 "List of suffixes to try when loading files."
225 :type '(repeat string)
226 :group 'jka-compr)
227
228;; List of all the elements we actually added to file-coding-system-alist.
229(defvar jka-compr-added-to-file-coding-system-alist nil)
230
231(defvar jka-compr-file-name-handler-entry
232 nil
233 "The entry in `file-name-handler-alist' used by the jka-compr I/O functions.")
234
235(defvar jka-compr-really-do-compress nil 114(defvar jka-compr-really-do-compress nil
236 "Non-nil in a buffer whose visited file was uncompressed on visiting it. 115 "Non-nil in a buffer whose visited file was uncompressed on visiting it.
237This means compress the data on writing the file, even if the 116This means compress the data on writing the file, even if the
@@ -764,12 +643,13 @@ There should be no more than seven characters after the final `/'."
764(put 'byte-compiler-base-file-name 'jka-compr 643(put 'byte-compiler-base-file-name 'jka-compr
765 'jka-compr-byte-compiler-base-file-name) 644 'jka-compr-byte-compiler-base-file-name)
766 645
646;;;###autoload
767(defvar jka-compr-inhibit nil 647(defvar jka-compr-inhibit nil
768 "Non-nil means inhibit automatic uncompression temporarily. 648 "Non-nil means inhibit automatic uncompression temporarily.
769Lisp programs can bind this to t to do that. 649Lisp programs can bind this to t to do that.
770It is not recommended to set this variable permanently to anything but nil.") 650It is not recommended to set this variable permanently to anything but nil.")
771 651
772(put 'jka-compr-handler 'safe-magic t) 652;;;###autoload
773(defun jka-compr-handler (operation &rest args) 653(defun jka-compr-handler (operation &rest args)
774 (save-match-data 654 (save-match-data
775 (let ((jka-op (get operation 'jka-compr))) 655 (let ((jka-op (get operation 'jka-compr)))
@@ -790,65 +670,6 @@ It is not recommended to set this variable permanently to anything but nil.")
790 (apply operation args))) 670 (apply operation args)))
791 671
792 672
793(defun jka-compr-build-file-regexp ()
794 (mapconcat
795 'jka-compr-info-regexp
796 jka-compr-compression-info-list
797 "\\|"))
798
799
800(defun jka-compr-install ()
801 "Install jka-compr.
802This adds entries to `file-name-handler-alist' and `auto-mode-alist'
803and `inhibit-first-line-modes-suffixes'."
804
805 (setq jka-compr-file-name-handler-entry
806 (cons (jka-compr-build-file-regexp) 'jka-compr-handler))
807
808 (setq file-name-handler-alist (cons jka-compr-file-name-handler-entry
809 file-name-handler-alist))
810
811 (setq jka-compr-added-to-file-coding-system-alist nil)
812
813 (mapcar
814 (function (lambda (x)
815 ;; Don't do multibyte encoding on the compressed files.
816 (let ((elt (cons (jka-compr-info-regexp x)
817 '(no-conversion . no-conversion))))
818 (setq file-coding-system-alist
819 (cons elt file-coding-system-alist))
820 (setq jka-compr-added-to-file-coding-system-alist
821 (cons elt jka-compr-added-to-file-coding-system-alist)))
822
823 (and (jka-compr-info-strip-extension x)
824 ;; Make entries in auto-mode-alist so that modes
825 ;; are chosen right according to the file names
826 ;; sans `.gz'.
827 (setq auto-mode-alist
828 (cons (list (jka-compr-info-regexp x)
829 nil 'jka-compr)
830 auto-mode-alist))
831 ;; Also add these regexps to
832 ;; inhibit-first-line-modes-suffixes, so that a
833 ;; -*- line in the first file of a compressed tar
834 ;; file doesn't override tar-mode.
835 (setq inhibit-first-line-modes-suffixes
836 (cons (jka-compr-info-regexp x)
837 inhibit-first-line-modes-suffixes)))))
838 jka-compr-compression-info-list)
839 (setq auto-mode-alist
840 (append auto-mode-alist jka-compr-mode-alist-additions))
841
842 ;; Make sure that (load "foo") will find /bla/foo.el.gz.
843 (setq load-suffixes
844 (apply 'append
845 (mapcar (lambda (suffix)
846 (cons suffix
847 (mapcar (lambda (ext) (concat suffix ext))
848 jka-compr-load-suffixes)))
849 load-suffixes))))
850
851
852(defun jka-compr-uninstall () 673(defun jka-compr-uninstall ()
853 "Uninstall jka-compr. 674 "Uninstall jka-compr.
854This removes the entries in `file-name-handler-alist' and `auto-mode-alist' 675This removes the entries in `file-name-handler-alist' and `auto-mode-alist'
@@ -908,59 +729,6 @@ by `jka-compr-installed'."
908 (push suffix suffixes))) 729 (push suffix suffixes)))
909 (setq load-suffixes (nreverse suffixes)))) 730 (setq load-suffixes (nreverse suffixes))))
910 731
911
912(defun jka-compr-installed-p ()
913 "Return non-nil if jka-compr is installed.
914The return value is the entry in `file-name-handler-alist' for jka-compr."
915
916 (let ((fnha file-name-handler-alist)
917 (installed nil))
918
919 (while (and fnha (not installed))
920 (and (eq (cdr (car fnha)) 'jka-compr-handler)
921 (setq installed (car fnha)))
922 (setq fnha (cdr fnha)))
923
924 installed))
925
926
927;;; Add the file I/O hook if it does not already exist.
928;;; Make sure that jka-compr-file-name-handler-entry is eq to the
929;;; entry for jka-compr in file-name-handler-alist.
930(and (jka-compr-installed-p)
931 (jka-compr-uninstall))
932
933
934;;;###autoload
935(define-minor-mode auto-compression-mode
936 "Toggle automatic file compression and uncompression.
937With prefix argument ARG, turn auto compression on if positive, else off.
938Returns the new status of auto compression (non-nil means on)."
939 :global t :group 'jka-compr
940 (let* ((installed (jka-compr-installed-p))
941 (flag auto-compression-mode))
942 (cond
943 ((and flag installed) t) ; already installed
944 ((and (not flag) (not installed)) nil) ; already not installed
945 (flag (jka-compr-install))
946 (t (jka-compr-uninstall)))))
947
948
949;;;###autoload
950(defmacro with-auto-compression-mode (&rest body)
951 "Evalute BODY with automatic file compression and uncompression enabled."
952 (let ((already-installed (make-symbol "already-installed")))
953 `(let ((,already-installed (jka-compr-installed-p)))
954 (unwind-protect
955 (progn
956 (unless ,already-installed
957 (jka-compr-install))
958 ,@body)
959 (unless ,already-installed
960 (jka-compr-uninstall))))))
961(put 'with-auto-compression-mode 'lisp-indent-function 0)
962
963
964(provide 'jka-compr) 732(provide 'jka-compr)
965 733
966;;; arch-tag: 3f15b630-e9a7-46c4-a22a-94afdde86ebc 734;;; arch-tag: 3f15b630-e9a7-46c4-a22a-94afdde86ebc
diff --git a/lisp/kmacro.el b/lisp/kmacro.el
index 20816fc7fea..7224786c50d 100644
--- a/lisp/kmacro.el
+++ b/lisp/kmacro.el
@@ -960,9 +960,9 @@ following additional answers: `insert', `insert-1', `replace', `replace-1',
960(defun kmacro-step-edit-prompt (macro index) 960(defun kmacro-step-edit-prompt (macro index)
961 ;; Show step-edit prompt 961 ;; Show step-edit prompt
962 (let ((keys (and (not kmacro-step-edit-appending) 962 (let ((keys (and (not kmacro-step-edit-appending)
963 index (substring macro index executing-macro-index))) 963 index (substring macro index executing-kbd-macro-index)))
964 (future (and (not kmacro-step-edit-appending) 964 (future (and (not kmacro-step-edit-appending)
965 (substring macro executing-macro-index))) 965 (substring macro executing-kbd-macro-index)))
966 (message-log-max nil) 966 (message-log-max nil)
967 (curmsg (current-message))) 967 (curmsg (current-message)))
968 968
@@ -1020,12 +1020,12 @@ following additional answers: `insert', `insert-1', `replace', `replace-1',
1020 (not (eq kmacro-step-edit-action t))) 1020 (not (eq kmacro-step-edit-action t)))
1021 ;; Find the actual end of this key sequence. 1021 ;; Find the actual end of this key sequence.
1022 ;; Must be able to backtrack in case we actually execute it. 1022 ;; Must be able to backtrack in case we actually execute it.
1023 (setq restore-index executing-macro-index) 1023 (setq restore-index executing-kbd-macro-index)
1024 (let (unread-command-events) 1024 (let (unread-command-events)
1025 (quoted-insert 0) 1025 (quoted-insert 0)
1026 (when unread-command-events 1026 (when unread-command-events
1027 (setq executing-macro-index (- executing-macro-index (length unread-command-events)) 1027 (setq executing-kbd-macro-index (- executing-kbd-macro-index (length unread-command-events))
1028 next-index executing-macro-index))))) 1028 next-index executing-kbd-macro-index)))))
1029 1029
1030 ;; Query the user; stop macro exection temporarily 1030 ;; Query the user; stop macro exection temporarily
1031 (let ((macro executing-kbd-macro) 1031 (let ((macro executing-kbd-macro)
@@ -1045,7 +1045,7 @@ following additional answers: `insert', `insert-1', `replace', `replace-1',
1045 (when unread-command-events 1045 (when unread-command-events
1046 (setq kmacro-step-edit-new-macro 1046 (setq kmacro-step-edit-new-macro
1047 (substring kmacro-step-edit-new-macro 0 (- (length unread-command-events))) 1047 (substring kmacro-step-edit-new-macro 0 (- (length unread-command-events)))
1048 executing-macro-index (- executing-macro-index (length unread-command-events))))) 1048 executing-kbd-macro-index (- executing-kbd-macro-index (length unread-command-events)))))
1049 (setq current-prefix-arg nil 1049 (setq current-prefix-arg nil
1050 prefix-arg nil) 1050 prefix-arg nil)
1051 (setq act 'ignore)) 1051 (setq act 'ignore))
@@ -1099,24 +1099,24 @@ following additional answers: `insert', `insert-1', `replace', `replace-1',
1099 (setq act t) 1099 (setq act t)
1100 t) 1100 t)
1101 ((member act '(insert-1 insert)) 1101 ((member act '(insert-1 insert))
1102 (setq executing-macro-index (or kmacro-step-edit-prefix-index kmacro-step-edit-key-index)) 1102 (setq executing-kbd-macro-index (or kmacro-step-edit-prefix-index kmacro-step-edit-key-index))
1103 (setq kmacro-step-edit-inserting (if (eq act 'insert-1) 1 t)) 1103 (setq kmacro-step-edit-inserting (if (eq act 'insert-1) 1 t))
1104 nil) 1104 nil)
1105 ((member act '(replace-1 replace)) 1105 ((member act '(replace-1 replace))
1106 (setq kmacro-step-edit-inserting (if (eq act 'replace-1) 1 t)) 1106 (setq kmacro-step-edit-inserting (if (eq act 'replace-1) 1 t))
1107 (setq kmacro-step-edit-prefix-index nil) 1107 (setq kmacro-step-edit-prefix-index nil)
1108 (if (= executing-macro-index (length executing-kbd-macro)) 1108 (if (= executing-kbd-macro-index (length executing-kbd-macro))
1109 (setq executing-kbd-macro (vconcat executing-kbd-macro [nil]) 1109 (setq executing-kbd-macro (vconcat executing-kbd-macro [nil])
1110 kmacro-step-edit-appending t)) 1110 kmacro-step-edit-appending t))
1111 nil) 1111 nil)
1112 ((eq act 'append) 1112 ((eq act 'append)
1113 (setq kmacro-step-edit-inserting t) 1113 (setq kmacro-step-edit-inserting t)
1114 (if (= executing-macro-index (length executing-kbd-macro)) 1114 (if (= executing-kbd-macro-index (length executing-kbd-macro))
1115 (setq executing-kbd-macro (vconcat executing-kbd-macro [nil]) 1115 (setq executing-kbd-macro (vconcat executing-kbd-macro [nil])
1116 kmacro-step-edit-appending t)) 1116 kmacro-step-edit-appending t))
1117 t) 1117 t)
1118 ((eq act 'append-end) 1118 ((eq act 'append-end)
1119 (if (= executing-macro-index (length executing-kbd-macro)) 1119 (if (= executing-kbd-macro-index (length executing-kbd-macro))
1120 (setq executing-kbd-macro (vconcat executing-kbd-macro [nil]) 1120 (setq executing-kbd-macro (vconcat executing-kbd-macro [nil])
1121 kmacro-step-edit-inserting t 1121 kmacro-step-edit-inserting t
1122 kmacro-step-edit-appending t) 1122 kmacro-step-edit-appending t)
@@ -1124,21 +1124,21 @@ following additional answers: `insert', `insert-1', `replace', `replace-1',
1124 (setq act t) 1124 (setq act t)
1125 t) 1125 t)
1126 ((eq act 'help) 1126 ((eq act 'help)
1127 (setq executing-macro-index (or kmacro-step-edit-prefix-index kmacro-step-edit-key-index)) 1127 (setq executing-kbd-macro-index (or kmacro-step-edit-prefix-index kmacro-step-edit-key-index))
1128 (setq kmacro-step-edit-help (not kmacro-step-edit-help)) 1128 (setq kmacro-step-edit-help (not kmacro-step-edit-help))
1129 nil) 1129 nil)
1130 (t ;; Ignore unknown responses 1130 (t ;; Ignore unknown responses
1131 (setq executing-macro-index (or kmacro-step-edit-prefix-index kmacro-step-edit-key-index)) 1131 (setq executing-kbd-macro-index (or kmacro-step-edit-prefix-index kmacro-step-edit-key-index))
1132 nil)) 1132 nil))
1133 (if (> executing-macro-index (or kmacro-step-edit-prefix-index kmacro-step-edit-key-index)) 1133 (if (> executing-kbd-macro-index (or kmacro-step-edit-prefix-index kmacro-step-edit-key-index))
1134 (setq kmacro-step-edit-new-macro 1134 (setq kmacro-step-edit-new-macro
1135 (vconcat kmacro-step-edit-new-macro 1135 (vconcat kmacro-step-edit-new-macro
1136 (substring executing-kbd-macro 1136 (substring executing-kbd-macro
1137 (or kmacro-step-edit-prefix-index kmacro-step-edit-key-index) 1137 (or kmacro-step-edit-prefix-index kmacro-step-edit-key-index)
1138 (if (eq act t) nil executing-macro-index))) 1138 (if (eq act t) nil executing-kbd-macro-index)))
1139 kmacro-step-edit-prefix-index nil)) 1139 kmacro-step-edit-prefix-index nil))
1140 (if restore-index 1140 (if restore-index
1141 (setq executing-macro-index restore-index))) 1141 (setq executing-kbd-macro-index restore-index)))
1142 (t 1142 (t
1143 (setq this-command 'ignore))) 1143 (setq this-command 'ignore)))
1144 (setq kmacro-step-edit-key-index next-index))) 1144 (setq kmacro-step-edit-key-index next-index)))
@@ -1151,7 +1151,7 @@ following additional answers: `insert', `insert-1', `replace', `replace-1',
1151 (executing-kbd-macro nil) 1151 (executing-kbd-macro nil)
1152 (defining-kbd-macro nil) 1152 (defining-kbd-macro nil)
1153 cmd keys next-index) 1153 cmd keys next-index)
1154 (setq executing-macro-index (or kmacro-step-edit-prefix-index kmacro-step-edit-key-index) 1154 (setq executing-kbd-macro-index (or kmacro-step-edit-prefix-index kmacro-step-edit-key-index)
1155 kmacro-step-edit-prefix-index nil) 1155 kmacro-step-edit-prefix-index nil)
1156 (kmacro-step-edit-prompt macro nil) 1156 (kmacro-step-edit-prompt macro nil)
1157 ;; Now, we have read a key sequence from the macro, but we don't want 1157 ;; Now, we have read a key sequence from the macro, but we don't want
@@ -1172,8 +1172,8 @@ following additional answers: `insert', `insert-1', `replace', `replace-1',
1172 (setq kmacro-step-edit-inserting nil) 1172 (setq kmacro-step-edit-inserting nil)
1173 (when unread-command-events 1173 (when unread-command-events
1174 (setq keys (substring keys 0 (- (length unread-command-events))) 1174 (setq keys (substring keys 0 (- (length unread-command-events)))
1175 executing-macro-index (- executing-macro-index (length unread-command-events)) 1175 executing-kbd-macro-index (- executing-kbd-macro-index (length unread-command-events))
1176 next-index executing-macro-index 1176 next-index executing-kbd-macro-index
1177 unread-command-events nil))) 1177 unread-command-events nil)))
1178 (setq cmd 'ignore) 1178 (setq cmd 'ignore)
1179 nil) 1179 nil)
@@ -1217,7 +1217,7 @@ following additional answers: `insert', `insert-1', `replace', `replace-1',
1217 ((eq kmacro-step-edit-active 'ignore) 1217 ((eq kmacro-step-edit-active 'ignore)
1218 (setq this-command 'ignore)) 1218 (setq this-command 'ignore))
1219 ((eq kmacro-step-edit-active 'append-end) 1219 ((eq kmacro-step-edit-active 'append-end)
1220 (if (= executing-macro-index (length executing-kbd-macro)) 1220 (if (= executing-kbd-macro-index (length executing-kbd-macro))
1221 (setq executing-kbd-macro (vconcat executing-kbd-macro [nil]) 1221 (setq executing-kbd-macro (vconcat executing-kbd-macro [nil])
1222 kmacro-step-edit-inserting t 1222 kmacro-step-edit-inserting t
1223 kmacro-step-edit-appending t 1223 kmacro-step-edit-appending t
@@ -1243,8 +1243,8 @@ following additional answers: `insert', `insert-1', `replace', `replace-1',
1243 (when kmacro-step-edit-active 1243 (when kmacro-step-edit-active
1244 (add-hook 'pre-command-hook 'kmacro-step-edit-pre-command nil nil) 1244 (add-hook 'pre-command-hook 'kmacro-step-edit-pre-command nil nil)
1245 (if kmacro-step-edit-key-index 1245 (if kmacro-step-edit-key-index
1246 (setq executing-macro-index kmacro-step-edit-key-index) 1246 (setq executing-kbd-macro-index kmacro-step-edit-key-index)
1247 (setq kmacro-step-edit-key-index executing-macro-index)))) 1247 (setq kmacro-step-edit-key-index executing-kbd-macro-index))))
1248 1248
1249 1249
1250(defun kmacro-step-edit-macro () 1250(defun kmacro-step-edit-macro ()
diff --git a/lisp/loadhist.el b/lisp/loadhist.el
index 1c71cc6cd07..da6fd695da3 100644
--- a/lisp/loadhist.el
+++ b/lisp/loadhist.el
@@ -188,27 +188,34 @@ such as redefining an Emacs function."
188 (string-match "-hooks?\\'" (symbol-name x))) 188 (string-match "-hooks?\\'" (symbol-name x)))
189 (memq x unload-feature-special-hooks))) ; Known abnormal hooks etc. 189 (memq x unload-feature-special-hooks))) ; Known abnormal hooks etc.
190 (dolist (y unload-hook-features-list) 190 (dolist (y unload-hook-features-list)
191 (when (eq (car-safe y) 'defun) 191 (when (and (eq (car-safe y) 'defun)
192 (remove-hook x (cdr y)))))))) 192 (not (get (cdr y) 'autoload)))
193 (remove-hook x (cdr y)))))))
194 ;; Remove any feature-symbols from auto-mode-alist as well.
195 (dolist (y unload-hook-features-list)
196 (when (and (eq (car-safe y) 'defun)
197 (not (get (cdr y) 'autoload)))
198 (setq auto-mode-alist
199 (rassq-delete-all (cdr y) auto-mode-alist)))))
193 (when (fboundp 'elp-restore-function) ; remove ELP stuff first 200 (when (fboundp 'elp-restore-function) ; remove ELP stuff first
194 (dolist (elt unload-hook-features-list) 201 (dolist (elt unload-hook-features-list)
195 (when (symbolp elt) 202 (when (symbolp elt)
196 (elp-restore-function elt)))) 203 (elp-restore-function elt))))
197 (dolist (x unload-hook-features-list) 204 (dolist (x unload-hook-features-list)
198 (if (consp x) 205 (if (consp x)
199 (progn 206 (cond
200 ;; Remove any feature names that this file provided. 207 ;; Remove any feature names that this file provided.
201 (when (eq (car x) 'provide) 208 ((eq (car x) 'provide)
202 (setq features (delq (cdr x) features))) 209 (setq features (delq (cdr x) features)))
203 (when (eq (car x) 'defun) 210 ((eq (car x) 'defun)
204 (let ((fun (cdr x))) 211 (let ((fun (cdr x)))
205 (when (fboundp fun) 212 (when (fboundp fun)
206 (when (fboundp 'ad-unadvise) 213 (when (fboundp 'ad-unadvise)
207 (ad-unadvise fun)) 214 (ad-unadvise fun))
208 (fmakunbound fun) 215 (fmakunbound fun)
209 (let ((aload (get fun 'autoload))) 216 (let ((aload (get fun 'autoload)))
210 (when aload 217 (when aload
211 (fset fun (cons 'autoload aload)))))))) 218 (fset fun (cons 'autoload aload))))))))
212 ;; Kill local values as much as possible. 219 ;; Kill local values as much as possible.
213 (dolist (buf (buffer-list)) 220 (dolist (buf (buffer-list))
214 (with-current-buffer buf 221 (with-current-buffer buf
@@ -217,8 +224,7 @@ such as redefining an Emacs function."
217 (unless (local-variable-if-set-p x) 224 (unless (local-variable-if-set-p x)
218 (makunbound x)))) 225 (makunbound x))))
219 ;; Delete the load-history element for this file. 226 ;; Delete the load-history element for this file.
220 (let ((elt (assoc file load-history))) 227 (setq load-history (delq (assoc file load-history) load-history))))
221 (setq load-history (delq elt load-history)))))
222 228
223(provide 'loadhist) 229(provide 'loadhist)
224 230
diff --git a/lisp/loadup.el b/lisp/loadup.el
index df7134edcc2..4cc6ebbff0f 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -179,6 +179,7 @@
179(message "%s" (garbage-collect)) 179(message "%s" (garbage-collect))
180 180
181(load "vc-hooks") 181(load "vc-hooks")
182(load "jka-comp-hook")
182(load "ediff-hook") 183(load "ediff-hook")
183(if (fboundp 'x-show-tip) (load "tooltip")) 184(if (fboundp 'x-show-tip) (load "tooltip"))
184(message "%s" (garbage-collect)) 185(message "%s" (garbage-collect))
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 377cb0e4d5a..1feaf94317f 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -662,11 +662,12 @@ The first parenthesized expression should match the MIME-charset name.")
662 ;; Use MATCH-ANCHORED to effectively anchor the regexp left side. 662 ;; Use MATCH-ANCHORED to effectively anchor the regexp left side.
663 `(,cite-chars 663 `(,cite-chars
664 (,(concat "\\=[ \t]*" 664 (,(concat "\\=[ \t]*"
665 "\\(\\([" cite-prefix "]+[" cite-suffix "]*\\)?" 665 "\\(\\(\\([" cite-prefix "]+[" cite-suffix "]*\\)?"
666 "\\(" cite-chars "[ \t]*\\)\\)+" 666 "\\(" cite-chars "[ \t]*\\)\\)+\\)"
667 "\\(.*\\)") 667 "\\(.*\\)")
668 (beginning-of-line) (end-of-line) 668 (beginning-of-line) (end-of-line)
669 (3 font-lock-comment-face nil t))) 669 (1 font-lock-comment-delimiter-face nil t)
670 (5 font-lock-comment-face nil t)))
670 '("^\\(X-[a-z0-9-]+\\|In-reply-to\\|Date\\):.*\\(\n[ \t]+.*\\)*$" 671 '("^\\(X-[a-z0-9-]+\\|In-reply-to\\|Date\\):.*\\(\n[ \t]+.*\\)*$"
671 . font-lock-string-face)))) 672 . font-lock-string-face))))
672 "Additional expressions to highlight in Rmail mode.") 673 "Additional expressions to highlight in Rmail mode.")
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index 91e768f7e7b..5667aa85ff1 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -378,11 +378,12 @@ actually occur.")
378 ;; Use MATCH-ANCHORED to effectively anchor the regexp left side. 378 ;; Use MATCH-ANCHORED to effectively anchor the regexp left side.
379 `(,cite-chars 379 `(,cite-chars
380 (,(concat "\\=[ \t]*" 380 (,(concat "\\=[ \t]*"
381 "\\(\\([" cite-prefix "]+[" cite-suffix "]*\\)?" 381 "\\(\\(\\([" cite-prefix "]+[" cite-suffix "]*\\)?"
382 "\\(" cite-chars "[ \t]*\\)\\)+" 382 "\\(" cite-chars "[ \t]*\\)\\)+\\)"
383 "\\(.*\\)") 383 "\\(.*\\)")
384 (beginning-of-line) (end-of-line) 384 (beginning-of-line) (end-of-line)
385 (3 font-lock-comment-face nil t))) 385 (1 font-lock-comment-delimiter-face nil t)
386 (5 font-lock-comment-face nil t)))
386 '("^\\(X-[A-Za-z0-9-]+\\|In-reply-to\\):.*\\(\n[ \t]+.*\\)*$" 387 '("^\\(X-[A-Za-z0-9-]+\\|In-reply-to\\):.*\\(\n[ \t]+.*\\)*$"
387 . font-lock-string-face)))) 388 . font-lock-string-face))))
388 "Additional expressions to highlight in Mail mode.") 389 "Additional expressions to highlight in Mail mode.")
diff --git a/lisp/man.el b/lisp/man.el
index 8c384028e17..712b1f30e7f 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -387,6 +387,7 @@ Otherwise, the value is whatever the function
387 (let ((table (copy-syntax-table (standard-syntax-table)))) 387 (let ((table (copy-syntax-table (standard-syntax-table))))
388 (modify-syntax-entry ?. "w" table) 388 (modify-syntax-entry ?. "w" table)
389 (modify-syntax-entry ?_ "w" table) 389 (modify-syntax-entry ?_ "w" table)
390 (modify-syntax-entry ?: "w" table) ; for PDL::Primitive in Perl man pages
390 table) 391 table)
391 "Syntax table used in Man mode buffers.") 392 "Syntax table used in Man mode buffers.")
392 393
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index d0d42b9666d..ee51e8c349a 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -639,9 +639,9 @@ by \"Save Options\" in Custom buffers.")
639 (let ((need-save nil)) 639 (let ((need-save nil))
640 ;; These are set with menu-bar-make-mm-toggle, which does not 640 ;; These are set with menu-bar-make-mm-toggle, which does not
641 ;; put on a customized-value property. 641 ;; put on a customized-value property.
642 (dolist (elt '(line-number-mode column-number-mode cua-mode show-paren-mode 642 (dolist (elt '(line-number-mode column-number-mode size-indication-mode
643 transient-mark-mode global-font-lock-mode 643 cua-mode show-paren-mode transient-mark-mode
644 blink-cursor-mode)) 644 global-font-lock-mode blink-cursor-mode))
645 (and (customize-mark-to-save elt) 645 (and (customize-mark-to-save elt)
646 (setq need-save t))) 646 (setq need-save t)))
647 ;; These are set with `customize-set-variable'. 647 ;; These are set with `customize-set-variable'.
@@ -692,6 +692,11 @@ by \"Save Options\" in Custom buffers.")
692 "Line Numbers" 692 "Line Numbers"
693 "Show the current line number in the mode line")) 693 "Show the current line number in the mode line"))
694 694
695(define-key menu-bar-showhide-menu [size-indication-mode]
696 (menu-bar-make-mm-toggle size-indication-mode
697 "Size Indication"
698 "Show the size of the buffer in the mode line"))
699
695(define-key menu-bar-showhide-menu [linecolumn-separator] 700(define-key menu-bar-showhide-menu [linecolumn-separator]
696 '("--")) 701 '("--"))
697 702
diff --git a/lisp/midnight.el b/lisp/midnight.el
index a81ce37856a..83b21dda7e4 100644
--- a/lisp/midnight.el
+++ b/lisp/midnight.el
@@ -48,6 +48,11 @@
48 :group 'calendar 48 :group 'calendar
49 :version "20.3") 49 :version "20.3")
50 50
51(defvar midnight-timer nil
52 "Timer running the `midnight-hook' `midnight-delay' seconds after midnight.
53Use `cancel-timer' to stop it and `midnight-delay-set' to change
54the time when it is run.")
55
51(defcustom midnight-mode nil 56(defcustom midnight-mode nil
52 "*Non-nil means run `midnight-hook' at midnight. 57 "*Non-nil means run `midnight-hook' at midnight.
53Setting this variable outside customize has no effect; 58Setting this variable outside customize has no effect;
@@ -204,11 +209,6 @@ The default value is `clean-buffer-list'."
204 (multiple-value-bind (sec min hrs) (decode-time) 209 (multiple-value-bind (sec min hrs) (decode-time)
205 (- (* 24 60 60) (* 60 60 hrs) (* 60 min) sec))) 210 (- (* 24 60 60) (* 60 60 hrs) (* 60 min) sec)))
206 211
207(defvar midnight-timer nil
208 "Timer running the `midnight-hook' `midnight-delay' seconds after midnight.
209Use `cancel-timer' to stop it and `midnight-delay-set' to change
210the time when it is run.")
211
212;;;###autoload 212;;;###autoload
213(defun midnight-delay-set (symb tm) 213(defun midnight-delay-set (symb tm)
214 "Modify `midnight-timer' according to `midnight-delay'. 214 "Modify `midnight-timer' according to `midnight-delay'.
diff --git a/lisp/mouse.el b/lisp/mouse.el
index a527b040d8a..f4f531959b7 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -908,7 +908,6 @@ at the same position."
908 (track-mouse 908 (track-mouse
909 (while (progn 909 (while (progn
910 (setq event (read-event)) 910 (setq event (read-event))
911 (setq mve (cons event (and (boundp 'mve) mve)))
912 (or (mouse-movement-p event) 911 (or (mouse-movement-p event)
913 (memq (car-safe event) '(switch-frame select-window)))) 912 (memq (car-safe event) '(switch-frame select-window))))
914 (if (memq (car-safe event) '(switch-frame select-window)) 913 (if (memq (car-safe event) '(switch-frame select-window))
diff --git a/lisp/net/net-utils.el b/lisp/net/net-utils.el
index 581a070134d..4a54702643a 100644
--- a/lisp/net/net-utils.el
+++ b/lisp/net/net-utils.el
@@ -160,7 +160,7 @@ These options can be used to limit how many ICMP packets are emitted."
160 "Regexp to match the nslookup prompt. 160 "Regexp to match the nslookup prompt.
161 161
162This variable is only used if the variable 162This variable is only used if the variable
163`comint-use-prompt-regexp-instead-of-fields' is non-nil." 163`comint-use-prompt-regexp' is non-nil."
164 :group 'net-utils 164 :group 'net-utils
165 :type 'regexp) 165 :type 'regexp)
166 166
@@ -183,7 +183,7 @@ This variable is only used if the variable
183 "Regexp which matches the FTP program's prompt. 183 "Regexp which matches the FTP program's prompt.
184 184
185This variable is only used if the variable 185This variable is only used if the variable
186`comint-use-prompt-regexp-instead-of-fields' is non-nil." 186`comint-use-prompt-regexp' is non-nil."
187 :group 'net-utils 187 :group 'net-utils
188 :type 'regexp) 188 :type 'regexp)
189 189
@@ -201,7 +201,7 @@ This variable is only used if the variable
201 "Regexp which matches the smbclient program's prompt. 201 "Regexp which matches the smbclient program's prompt.
202 202
203This variable is only used if the variable 203This variable is only used if the variable
204`comint-use-prompt-regexp-instead-of-fields' is non-nil." 204`comint-use-prompt-regexp' is non-nil."
205 :group 'net-utils 205 :group 'net-utils
206 :type 'regexp) 206 :type 'regexp)
207 207
diff --git a/lisp/net/rlogin.el b/lisp/net/rlogin.el
index fa7e0d1950e..67521ca2e73 100644
--- a/lisp/net/rlogin.el
+++ b/lisp/net/rlogin.el
@@ -179,10 +179,15 @@ variable."
179 179
180 (let* ((process-connection-type rlogin-process-connection-type) 180 (let* ((process-connection-type rlogin-process-connection-type)
181 (args (if rlogin-explicit-args 181 (args (if rlogin-explicit-args
182 (append (rlogin-parse-words input-args) 182 (append (split-string input-args)
183 rlogin-explicit-args) 183 rlogin-explicit-args)
184 (rlogin-parse-words input-args))) 184 (split-string input-args)))
185 (host (car args)) 185 (host (let ((tail args))
186 ;; Find first arg that doesn't look like an option.
187 ;; This still loses for args that take values, feh.
188 (while (and tail (= ?- (aref (car tail) 0)))
189 (setq tail (cdr tail)))
190 (car tail)))
186 (user (or (car (cdr (member "-l" args))) 191 (user (or (car (cdr (member "-l" args)))
187 (user-login-name))) 192 (user-login-name)))
188 (buffer-name (if (string= user (user-login-name)) 193 (buffer-name (if (string= user (user-login-name))
@@ -281,19 +286,6 @@ local one share the same directories (through NFS)."
281 (goto-char orig-point))))))) 286 (goto-char orig-point)))))))
282 287
283 288
284;; Parse a line into its constituent parts (words separated by
285;; whitespace). Return a list of the words.
286(defun rlogin-parse-words (line)
287 (let ((list nil)
288 (posn 0)
289 (match-data (match-data)))
290 (while (string-match "[^ \t\n]+" line posn)
291 (setq list (cons (substring line (match-beginning 0) (match-end 0))
292 list))
293 (setq posn (match-end 0)))
294 (set-match-data (match-data))
295 (nreverse list)))
296
297(defun rlogin-send-Ctrl-C () 289(defun rlogin-send-Ctrl-C ()
298 (interactive) 290 (interactive)
299 (process-send-string nil "\C-c")) 291 (process-send-string nil "\C-c"))
diff --git a/lisp/novice.el b/lisp/novice.el
index 3e63f0a7bc6..171285ca3f1 100644
--- a/lisp/novice.el
+++ b/lisp/novice.el
@@ -1,6 +1,6 @@
1;;; novice.el --- handling of disabled commands ("novice mode") for Emacs 1;;; novice.el --- handling of disabled commands ("novice mode") for Emacs
2 2
3;; Copyright (C) 1985, 1986, 1987, 1994, 2002, 2004 3;; Copyright (C) 1985, 1986, 1987, 1994, 2002, 2004, 2005
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Maintainer: FSF 6;; Maintainer: FSF
@@ -182,9 +182,10 @@ to future sessions."
182 (if (search-forward (concat "(put '" (symbol-name command) " ") nil t) 182 (if (search-forward (concat "(put '" (symbol-name command) " ") nil t)
183 (delete-region 183 (delete-region
184 (progn (beginning-of-line) (point)) 184 (progn (beginning-of-line) (point))
185 (progn (forward-line 1) (point)))) 185 (progn (forward-line 1) (point)))
186 (goto-char (point-max)) 186 (goto-char (point-max))
187 (insert "\n(put '" (symbol-name command) " 'disabled t)\n") 187 (insert ?\n))
188 (insert "(put '" (symbol-name command) " 'disabled t)\n")
188 (save-buffer)))) 189 (save-buffer))))
189 190
190(provide 'novice) 191(provide 'novice)
diff --git a/lisp/pcvs-info.el b/lisp/pcvs-info.el
index 0f66099c46f..cf367072838 100644
--- a/lisp/pcvs-info.el
+++ b/lisp/pcvs-info.el
@@ -41,11 +41,13 @@
41;;;; config variables 41;;;; config variables
42;;;; 42;;;;
43 43
44(defcustom cvs-display-full-path t 44(defcustom cvs-display-full-name t
45 "*Specifies how the filenames should look like in the listing. 45 "*Specifies how the filenames should be displayed in the listing.
46If t, their full path name will be displayed, else only the filename." 46If non-nil, their full filename name will be displayed, else only the
47non-directory part."
47 :group 'pcl-cvs 48 :group 'pcl-cvs
48 :type '(boolean)) 49 :type '(boolean))
50(define-obsolete-variable-alias 'cvs-display-full-path 'cvs-display-full-name)
49 51
50(defcustom cvs-allow-dir-commit nil 52(defcustom cvs-allow-dir-commit nil
51 "*Allow `cvs-mode-commit' on directories. 53 "*Allow `cvs-mode-commit' on directories.
@@ -165,7 +167,7 @@ to confuse some users sometimes."
165 ;; In addition to the above, the following values can be extracted: 167 ;; In addition to the above, the following values can be extracted:
166 168
167 ;; handled ;; t if this file doesn't require further action. 169 ;; handled ;; t if this file doesn't require further action.
168 ;; full-path ;; The complete relative filename. 170 ;; full-name ;; The complete relative filename.
169 ;; pp-name ;; The printed file name 171 ;; pp-name ;; The printed file name
170 ;; backup-file;; For MERGED and CONFLICT files after a \"cvs update\", 172 ;; backup-file;; For MERGED and CONFLICT files after a \"cvs update\",
171 ;; this is a full path to the backup file where the 173 ;; this is a full path to the backup file where the
@@ -201,7 +203,7 @@ to confuse some users sometimes."
201 203
202;; Fake selectors: 204;; Fake selectors:
203 205
204(defun cvs-fileinfo->full-path (fileinfo) 206(defun cvs-fileinfo->full-name (fileinfo)
205 "Return the full path for the file that is described in FILEINFO." 207 "Return the full path for the file that is described in FILEINFO."
206 (let ((dir (cvs-fileinfo->dir fileinfo))) 208 (let ((dir (cvs-fileinfo->dir fileinfo)))
207 (if (eq (cvs-fileinfo->type fileinfo) 'DIRCHANGE) 209 (if (eq (cvs-fileinfo->type fileinfo) 'DIRCHANGE)
@@ -209,11 +211,12 @@ to confuse some users sometimes."
209 ;; Here, I use `concat' rather than `expand-file-name' because I want 211 ;; Here, I use `concat' rather than `expand-file-name' because I want
210 ;; the resulting path to stay relative if `dir' is relative. 212 ;; the resulting path to stay relative if `dir' is relative.
211 (concat dir (cvs-fileinfo->file fileinfo))))) 213 (concat dir (cvs-fileinfo->file fileinfo)))))
214(define-obsolete-function-alias 'cvs-fileinfo->full-path 'cvs-fileinfo->full-name)
212 215
213(defun cvs-fileinfo->pp-name (fi) 216(defun cvs-fileinfo->pp-name (fi)
214 "Return the filename of FI as it should be displayed." 217 "Return the filename of FI as it should be displayed."
215 (if cvs-display-full-path 218 (if cvs-display-full-name
216 (cvs-fileinfo->full-path fi) 219 (cvs-fileinfo->full-name fi)
217 (cvs-fileinfo->file fi))) 220 (cvs-fileinfo->file fi)))
218 221
219(defun cvs-fileinfo->backup-file (fileinfo) 222(defun cvs-fileinfo->backup-file (fileinfo)
@@ -225,10 +228,11 @@ to confuse some users sometimes."
225 (concat "\\`" (regexp-quote cvs-bakprefix) 228 (concat "\\`" (regexp-quote cvs-bakprefix)
226 (regexp-quote file) "\\(\\.[0-9]+\\.[0-9]+\\)+\\'"))) 229 (regexp-quote file) "\\(\\.[0-9]+\\.[0-9]+\\)+\\'")))
227 bf) 230 bf)
228 (dolist (f files bf) 231 (dolist (f files)
229 (when (and (file-readable-p f) 232 (when (and (file-readable-p f)
230 (or (null bf) (file-newer-than-file-p f bf))) 233 (or (null bf) (file-newer-than-file-p f bf)))
231 (setq bf (concat dir f)))))) 234 (setq bf f)))
235 (concat dir bf)))
232 236
233;; (defun cvs-fileinfo->handled (fileinfo) 237;; (defun cvs-fileinfo->handled (fileinfo)
234;; "Tell if this requires further action" 238;; "Tell if this requires further action"
@@ -327,7 +331,7 @@ For use by the cookie package."
327 (insert 331 (insert
328 (case type 332 (case type
329 (DIRCHANGE (concat "In directory " 333 (DIRCHANGE (concat "In directory "
330 (cvs-add-face (cvs-fileinfo->full-path fileinfo) 334 (cvs-add-face (cvs-fileinfo->full-name fileinfo)
331 'cvs-header-face t 335 'cvs-header-face t
332 'cvs-goal-column t) 336 'cvs-goal-column t)
333 ":")) 337 ":"))
diff --git a/lisp/pcvs.el b/lisp/pcvs.el
index e7139d9cfba..6382705139e 100644
--- a/lisp/pcvs.el
+++ b/lisp/pcvs.el
@@ -233,7 +233,7 @@
233 nil ;don't update display while running 233 nil ;don't update display while running
234 "status" 234 "status"
235 "-v" 235 "-v"
236 (cvs-fileinfo->full-path (car marked))) 236 (cvs-fileinfo->full-name (car marked)))
237 (goto-char (point-min)) 237 (goto-char (point-min))
238 (let ((tags (cvs-status-get-tags))) 238 (let ((tags (cvs-status-get-tags)))
239 (when (listp tags) tags))))))) 239 (when (listp tags) tags)))))))
@@ -512,7 +512,7 @@ If non-nil, NEW means to create a new buffer no matter what."
512 (let* ((dir+files+rest 512 (let* ((dir+files+rest
513 (if (or (null fis) (not single-dir)) 513 (if (or (null fis) (not single-dir))
514 ;; not single-dir mode: just process the whole thing 514 ;; not single-dir mode: just process the whole thing
515 (list "" (mapcar 'cvs-fileinfo->full-path fis) nil) 515 (list "" (mapcar 'cvs-fileinfo->full-name fis) nil)
516 ;; single-dir mode: extract the same-dir-elements 516 ;; single-dir mode: extract the same-dir-elements
517 (let ((dir (cvs-fileinfo->dir (car fis)))) 517 (let ((dir (cvs-fileinfo->dir (car fis))))
518 ;; output the concerned dir so the parser can translate paths 518 ;; output the concerned dir so the parser can translate paths
@@ -611,7 +611,7 @@ If non-nil, NEW means to create a new buffer no matter what."
611 (append (cvs-flags-query 'cvs-cvs-flags nil 'noquery) 611 (append (cvs-flags-query 'cvs-cvs-flags nil 'noquery)
612 (if cvs-cvsroot (list "-d" cvs-cvsroot)) 612 (if cvs-cvsroot (list "-d" cvs-cvsroot))
613 args 613 args
614 (mapcar 'cvs-fileinfo->full-path fis)))))) 614 (mapcar 'cvs-fileinfo->full-name fis))))))
615 615
616(defun cvs-update-header (cmd add) 616(defun cvs-update-header (cmd add)
617 (let* ((hf (ewoc-get-hf cvs-cookies)) 617 (let* ((hf (ewoc-get-hf cvs-cookies))
@@ -831,7 +831,7 @@ the problem."
831 (and (or (eq (cvs-fileinfo->type fi) 'REMOVED) 831 (and (or (eq (cvs-fileinfo->type fi) 'REMOVED)
832 (and (eq (cvs-fileinfo->type fi) 'CONFLICT) 832 (and (eq (cvs-fileinfo->type fi) 'CONFLICT)
833 (eq (cvs-fileinfo->subtype fi) 'REMOVED))) 833 (eq (cvs-fileinfo->subtype fi) 'REMOVED)))
834 (file-exists-p (cvs-fileinfo->full-path fi)))) 834 (file-exists-p (cvs-fileinfo->full-name fi))))
835 835
836;; called at the following times: 836;; called at the following times:
837;; - postparse ((eq cvs-auto-remove-handled t) cvs-auto-remove-directories nil) 837;; - postparse ((eq cvs-auto-remove-handled t) cvs-auto-remove-directories nil)
@@ -1406,7 +1406,7 @@ If FILE is non-nil, directory entries won't be selected."
1406(defun cvs-mode-files (&rest -cvs-mode-files-args) 1406(defun cvs-mode-files (&rest -cvs-mode-files-args)
1407 (cvs-mode! 1407 (cvs-mode!
1408 (lambda () 1408 (lambda ()
1409 (mapcar 'cvs-fileinfo->full-path 1409 (mapcar 'cvs-fileinfo->full-name
1410 (apply 'cvs-mode-marked -cvs-mode-files-args))))) 1410 (apply 'cvs-mode-marked -cvs-mode-files-args)))))
1411 1411
1412;; 1412;;
@@ -1564,7 +1564,7 @@ With prefix argument, prompt for cvs flags."
1564 ;; find directories and look for fis needing a description 1564 ;; find directories and look for fis needing a description
1565 (dolist (fi fis) 1565 (dolist (fi fis)
1566 (cond 1566 (cond
1567 ((file-directory-p (cvs-fileinfo->full-path fi)) (push fi dirs)) 1567 ((file-directory-p (cvs-fileinfo->full-name fi)) (push fi dirs))
1568 ((eq (cvs-fileinfo->type fi) 'UNKNOWN) (setq needdesc t)))) 1568 ((eq (cvs-fileinfo->type fi) 'UNKNOWN) (setq needdesc t))))
1569 ;; prompt for description if necessary 1569 ;; prompt for description if necessary
1570 (let* ((msg (if (and needdesc 1570 (let* ((msg (if (and needdesc
@@ -1642,8 +1642,8 @@ or \"Conflict\" in the *cvs* buffer."
1642Signal an error if there is no backup file." 1642Signal an error if there is no backup file."
1643 (let ((backup-file (cvs-fileinfo->backup-file fileinfo))) 1643 (let ((backup-file (cvs-fileinfo->backup-file fileinfo)))
1644 (unless backup-file 1644 (unless backup-file
1645 (error "%s has no backup file" (cvs-fileinfo->full-path fileinfo))) 1645 (error "%s has no backup file" (cvs-fileinfo->full-name fileinfo)))
1646 (list backup-file (cvs-fileinfo->full-path fileinfo)))) 1646 (list backup-file (cvs-fileinfo->full-name fileinfo))))
1647 1647
1648;; 1648;;
1649;; Emerge support 1649;; Emerge support
@@ -1697,7 +1697,7 @@ Signal an error if there is no backup file."
1697 1697
1698(defun cvs-retrieve-revision (fileinfo rev) 1698(defun cvs-retrieve-revision (fileinfo rev)
1699 "Retrieve the given REVision of the file in FILEINFO into a new buffer." 1699 "Retrieve the given REVision of the file in FILEINFO into a new buffer."
1700 (let* ((file (cvs-fileinfo->full-path fileinfo)) 1700 (let* ((file (cvs-fileinfo->full-name fileinfo))
1701 (buffile (concat file "." rev))) 1701 (buffile (concat file "." rev)))
1702 (or (find-buffer-visiting buffile) 1702 (or (find-buffer-visiting buffile)
1703 (with-current-buffer (create-file-buffer buffile) 1703 (with-current-buffer (create-file-buffer buffile)
@@ -1729,7 +1729,7 @@ Signal an error if there is no backup file."
1729 (interactive) 1729 (interactive)
1730 (let ((fi (cvs-mode-marked 'merge nil :one t :file t))) 1730 (let ((fi (cvs-mode-marked 'merge nil :one t :file t)))
1731 (let ((merge (cvs-fileinfo->merge fi)) 1731 (let ((merge (cvs-fileinfo->merge fi))
1732 (file (cvs-fileinfo->full-path fi)) 1732 (file (cvs-fileinfo->full-name fi))
1733 (backup-file (cvs-fileinfo->backup-file fi))) 1733 (backup-file (cvs-fileinfo->backup-file fi)))
1734 (if (not (and merge backup-file)) 1734 (if (not (and merge backup-file))
1735 (let ((buf (find-file-noselect file))) 1735 (let ((buf (find-file-noselect file)))
@@ -1760,7 +1760,7 @@ Signal an error if there is no backup file."
1760 (list (or rev1 (cvs-flags-query 'cvs-idiff-version)) 1760 (list (or rev1 (cvs-flags-query 'cvs-idiff-version))
1761 rev2))) 1761 rev2)))
1762 (let ((fi (cvs-mode-marked 'diff "idiff" :one t :file t))) 1762 (let ((fi (cvs-mode-marked 'diff "idiff" :one t :file t)))
1763 (let* ((file (cvs-fileinfo->full-path fi)) 1763 (let* ((file (cvs-fileinfo->full-name fi))
1764 (rev1-buf (cvs-retrieve-revision fi (or rev1 "BASE"))) 1764 (rev1-buf (cvs-retrieve-revision fi (or rev1 "BASE")))
1765 (rev2-buf (if rev2 (cvs-retrieve-revision fi rev2))) 1765 (rev2-buf (if rev2 (cvs-retrieve-revision fi rev2)))
1766 ;; this binding is used by cvs-ediff-startup-hook 1766 ;; this binding is used by cvs-ediff-startup-hook
@@ -1778,13 +1778,13 @@ Signal an error if there is no backup file."
1778 (error "idiff-other cannot be applied to more than 2 files at a time")) 1778 (error "idiff-other cannot be applied to more than 2 files at a time"))
1779 (let* ((fi1 (car fis)) 1779 (let* ((fi1 (car fis))
1780 (rev1-buf (if rev1 (cvs-retrieve-revision fi1 rev1) 1780 (rev1-buf (if rev1 (cvs-retrieve-revision fi1 rev1)
1781 (find-file-noselect (cvs-fileinfo->full-path fi1)))) 1781 (find-file-noselect (cvs-fileinfo->full-name fi1))))
1782 rev2-buf) 1782 rev2-buf)
1783 (if (cdr fis) 1783 (if (cdr fis)
1784 (let ((fi2 (nth 1 fis))) 1784 (let ((fi2 (nth 1 fis)))
1785 (setq rev2-buf 1785 (setq rev2-buf
1786 (if rev2 (cvs-retrieve-revision fi2 rev2) 1786 (if rev2 (cvs-retrieve-revision fi2 rev2)
1787 (find-file-noselect (cvs-fileinfo->full-path fi2))))) 1787 (find-file-noselect (cvs-fileinfo->full-name fi2)))))
1788 (error "idiff-other doesn't know what other file/buffer to use")) 1788 (error "idiff-other doesn't know what other file/buffer to use"))
1789 (let* (;; this binding is used by cvs-ediff-startup-hook 1789 (let* (;; this binding is used by cvs-ediff-startup-hook
1790 (cvs-transient-buffers (list rev1-buf rev2-buf))) 1790 (cvs-transient-buffers (list rev1-buf rev2-buf)))
@@ -1799,7 +1799,7 @@ Signal an error if there is no backup file."
1799 (let (ret) 1799 (let (ret)
1800 (dolist (fi (or fis (list (cvs-create-fileinfo 'DIRCHANGE "" "." "")))) 1800 (dolist (fi (or fis (list (cvs-create-fileinfo 'DIRCHANGE "" "." ""))))
1801 (when (cvs-string-prefix-p 1801 (when (cvs-string-prefix-p
1802 (expand-file-name (cvs-fileinfo->full-path fi) dir) 1802 (expand-file-name (cvs-fileinfo->full-name fi) dir)
1803 buffer-file-name) 1803 buffer-file-name)
1804 (setq ret t))) 1804 (setq ret t)))
1805 ret))) 1805 ret)))
@@ -2002,7 +2002,7 @@ With a prefix, opens the buffer in an OTHER window."
2002 (set-buffer cvs-buf) 2002 (set-buffer cvs-buf)
2003 (setq default-directory odir)) 2003 (setq default-directory odir))
2004 (let ((buf (if rev (cvs-retrieve-revision fi rev) 2004 (let ((buf (if rev (cvs-retrieve-revision fi rev)
2005 (find-file-noselect (cvs-fileinfo->full-path fi))))) 2005 (find-file-noselect (cvs-fileinfo->full-name fi)))))
2006 (funcall (cond ((eq other 'dont-select) 'display-buffer) 2006 (funcall (cond ((eq other 'dont-select) 'display-buffer)
2007 (other 2007 (other
2008 (if view 'view-buffer-other-window 2008 (if view 'view-buffer-other-window
@@ -2093,14 +2093,14 @@ Returns a list of FIS that should be `cvs remove'd."
2093 (silent (or (not cvs-confirm-removals) 2093 (silent (or (not cvs-confirm-removals)
2094 (cvs-every (lambda (fi) 2094 (cvs-every (lambda (fi)
2095 (or (not (file-exists-p 2095 (or (not (file-exists-p
2096 (cvs-fileinfo->full-path fi))) 2096 (cvs-fileinfo->full-name fi)))
2097 (cvs-applicable-p fi 'safe-rm))) 2097 (cvs-applicable-p fi 'safe-rm)))
2098 files))) 2098 files)))
2099 (tmpbuf (cvs-temp-buffer))) 2099 (tmpbuf (cvs-temp-buffer)))
2100 (when (and (not silent) (equal cvs-confirm-removals 'list)) 2100 (when (and (not silent) (equal cvs-confirm-removals 'list))
2101 (with-current-buffer tmpbuf 2101 (with-current-buffer tmpbuf
2102 (let ((inhibit-read-only t)) 2102 (let ((inhibit-read-only t))
2103 (cvs-insert-strings (mapcar 'cvs-fileinfo->full-path fis)) 2103 (cvs-insert-strings (mapcar 'cvs-fileinfo->full-name fis))
2104 (cvs-pop-to-buffer-same-frame (current-buffer)) 2104 (cvs-pop-to-buffer-same-frame (current-buffer))
2105 (shrink-window-if-larger-than-buffer)))) 2105 (shrink-window-if-larger-than-buffer))))
2106 (if (not (or silent 2106 (if (not (or silent
@@ -2119,7 +2119,7 @@ Returns a list of FIS that should be `cvs remove'd."
2119 (progn (message "Aborting") nil) 2119 (progn (message "Aborting") nil)
2120 (dolist (fi files) 2120 (dolist (fi files)
2121 (let* ((type (cvs-fileinfo->type fi)) 2121 (let* ((type (cvs-fileinfo->type fi))
2122 (file (cvs-fileinfo->full-path fi))) 2122 (file (cvs-fileinfo->full-name fi)))
2123 (when (or all (eq type 'UNKNOWN)) 2123 (when (or all (eq type 'UNKNOWN))
2124 (when (file-exists-p file) (delete-file file)) 2124 (when (file-exists-p file) (delete-file file))
2125 (unless all (setf (cvs-fileinfo->type fi) 'DEAD) t)))) 2125 (unless all (setf (cvs-fileinfo->type fi) 'DEAD) t))))
@@ -2166,7 +2166,7 @@ With prefix argument, prompt for cvs flags."
2166 (interactive) 2166 (interactive)
2167 (let ((marked (cvs-get-marked (cvs-ignore-marks-p "byte-compile")))) 2167 (let ((marked (cvs-get-marked (cvs-ignore-marks-p "byte-compile"))))
2168 (dolist (fi marked) 2168 (dolist (fi marked)
2169 (let ((filename (cvs-fileinfo->full-path fi))) 2169 (let ((filename (cvs-fileinfo->full-name fi)))
2170 (when (string-match "\\.el\\'" filename) 2170 (when (string-match "\\.el\\'" filename)
2171 (byte-compile-file filename)))))) 2171 (byte-compile-file filename))))))
2172 2172
@@ -2237,7 +2237,7 @@ this file, or a list of arguments to send to the program."
2237 2237
2238(defun cvs-revert-if-needed (fis) 2238(defun cvs-revert-if-needed (fis)
2239 (dolist (fileinfo fis) 2239 (dolist (fileinfo fis)
2240 (let* ((file (cvs-fileinfo->full-path fileinfo)) 2240 (let* ((file (cvs-fileinfo->full-name fileinfo))
2241 (buffer (find-buffer-visiting file))) 2241 (buffer (find-buffer-visiting file)))
2242 ;; For a revert to happen the user must be editing the file... 2242 ;; For a revert to happen the user must be editing the file...
2243 (unless (or (null buffer) 2243 (unless (or (null buffer)
diff --git a/lisp/progmodes/cmacexp.el b/lisp/progmodes/cmacexp.el
index 27fe81e451d..28d988961a6 100644
--- a/lisp/progmodes/cmacexp.el
+++ b/lisp/progmodes/cmacexp.el
@@ -118,6 +118,7 @@
118 (file-exists-p "/opt/SUNWspro/SC3.0.1/bin/acomp")) 118 (file-exists-p "/opt/SUNWspro/SC3.0.1/bin/acomp"))
119 "/opt/SUNWspro/SC3.0.1/bin/acomp -C -E") 119 "/opt/SUNWspro/SC3.0.1/bin/acomp -C -E")
120 ((file-exists-p "/usr/ccs/lib/cpp") "/usr/ccs/lib/cpp -C") 120 ((file-exists-p "/usr/ccs/lib/cpp") "/usr/ccs/lib/cpp -C")
121 ((memq system-type '(darwin berkeley-unix)) "gcc -E -C -")
121 (t "/lib/cpp -C")) 122 (t "/lib/cpp -C"))
122 "The preprocessor used by the cmacexp package. 123 "The preprocessor used by the cmacexp package.
123 124
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 129a01f5498..0cc70386be8 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -710,7 +710,7 @@ FILE should be (ABSOLUTE-FILENAME) or (RELATIVE-FILENAME . DIRNAME) or nil."
710 `(,(car elt) 710 `(,(car elt)
711 (compilation-directory-properties 711 (compilation-directory-properties
712 ,(car elt) ,(cdr elt)) 712 ,(car elt) ,(cdr elt))
713 t)) 713 t t))
714 (cdr compilation-directory-matcher))))) 714 (cdr compilation-directory-matcher)))))
715 715
716 ;; Compiler warning/error lines. 716 ;; Compiler warning/error lines.
@@ -733,11 +733,12 @@ FILE should be (ABSOLUTE-FILENAME) or (RELATIVE-FILENAME . DIRNAME) or nil."
733 ;; allowed `line' to be a function that computed the actual 733 ;; allowed `line' to be a function that computed the actual
734 ;; error location. Let's do our best. 734 ;; error location. Let's do our best.
735 `(,(car item) 735 `(,(car item)
736 (0 (compilation-compat-error-properties 736 (0 (save-match-data
737 (funcall ',line (cons (match-string ,file) 737 (compilation-compat-error-properties
738 (cons default-directory 738 (funcall ',line (cons (match-string ,file)
739 ',(nthcdr 4 item))) 739 (cons default-directory
740 ,(if col `(match-string ,col))))) 740 ',(nthcdr 4 item)))
741 ,(if col `(match-string ,col))))))
741 (,file compilation-error-face t)) 742 (,file compilation-error-face t))
742 743
743 (unless (or (null (nth 5 item)) (integerp (nth 5 item))) 744 (unless (or (null (nth 5 item)) (integerp (nth 5 item)))
@@ -1589,6 +1590,8 @@ If nil, don't scroll the compilation output window."
1589 (point)))) 1590 (point))))
1590 (set-window-point w mk)) 1591 (set-window-point w mk))
1591 1592
1593(defvar next-error-highlight-timer)
1594
1592(defun compilation-goto-locus (msg mk end-mk) 1595(defun compilation-goto-locus (msg mk end-mk)
1593 "Jump to an error corresponding to MSG at MK. 1596 "Jump to an error corresponding to MSG at MK.
1594All arguments are markers. If END-MK is non-nil, mark is set there 1597All arguments are markers. If END-MK is non-nil, mark is set there
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 700fa1c9efe..4a701edcca2 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -1514,14 +1514,14 @@ or as help on variables `cperl-tips', `cperl-problems',
1514 (set 'font-lock-unfontify-region-function ; not present with old Emacs 1514 (set 'font-lock-unfontify-region-function ; not present with old Emacs
1515 'cperl-font-lock-unfontify-region-function) 1515 'cperl-font-lock-unfontify-region-function)
1516 (make-local-variable 'cperl-syntax-done-to) 1516 (make-local-variable 'cperl-syntax-done-to)
1517 ;; Another bug: unless font-lock-syntactic-keywords, font-lock
1518 ;; ignores syntax-table text-property. (t) is a hack
1519 ;; to make font-lock think that font-lock-syntactic-keywords
1520 ;; are defined
1521 (make-local-variable 'font-lock-syntactic-keywords) 1517 (make-local-variable 'font-lock-syntactic-keywords)
1522 (setq font-lock-syntactic-keywords 1518 (setq font-lock-syntactic-keywords
1523 (if cperl-syntaxify-by-font-lock 1519 (if cperl-syntaxify-by-font-lock
1524 '(t (cperl-fontify-syntaxically)) 1520 '((cperl-fontify-syntaxically))
1521 ;; unless font-lock-syntactic-keywords, font-lock (pre-22.1)
1522 ;; used to ignore syntax-table text-properties. (t) is a hack
1523 ;; to make font-lock think that font-lock-syntactic-keywords
1524 ;; are defined.
1525 '(t))))) 1525 '(t)))))
1526 (make-local-variable 'cperl-old-style) 1526 (make-local-variable 'cperl-old-style)
1527 (if (boundp 'normal-auto-fill-function) ; 19.33 and later 1527 (if (boundp 'normal-auto-fill-function) ; 19.33 and later
diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el
index 14363e4dccf..eb6db05c159 100644
--- a/lisp/progmodes/f90.el
+++ b/lisp/progmodes/f90.el
@@ -1109,9 +1109,15 @@ Does not check type and subprogram indentation."
1109 (let (icol cont (case-fold-search t) (pnt (point))) 1109 (let (icol cont (case-fold-search t) (pnt (point)))
1110 (save-excursion 1110 (save-excursion
1111 (if (not (f90-previous-statement)) 1111 (if (not (f90-previous-statement))
1112 ;; First statement in buffer. 1112 ;; If f90-previous-statement returns nil, we must have been
1113 ;; called from on or before the first line of the first statement.
1113 (setq icol (if (save-excursion 1114 (setq icol (if (save-excursion
1114 (f90-next-statement) 1115 ;; f90-previous-statement has moved us over
1116 ;; comment/blank lines, so we need to get
1117 ;; back to the first code statement.
1118 (when (looking-at "[ \t]*\\([!#]\\|$\\)")
1119 (f90-next-statement))
1120 (skip-chars-forward " \t0-9")
1115 (f90-looking-at-program-block-start)) 1121 (f90-looking-at-program-block-start))
1116 0 1122 0
1117 ;; No explicit PROGRAM start statement. 1123 ;; No explicit PROGRAM start statement.
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 73d77affdc4..a2fa660bff0 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -62,7 +62,8 @@
62 (replace-in-string str regexp rep))) 62 (replace-in-string str regexp rep)))
63 63
64(defun flymake-split-string (str pattern) 64(defun flymake-split-string (str pattern)
65 "Split, then remove first and/or last in case it's empty." 65 "Split STR into a list of substrings bounded by PATTERN.
66Zero-length substrings at the beginning and end of the list are omitted."
66 (let* ((splitted (split-string str pattern))) 67 (let* ((splitted (split-string str pattern)))
67 (if (and (> (length splitted) 0) (= 0 (length (elt splitted 0)))) 68 (if (and (> (length splitted) 0) (= 0 (length (elt splitted 0))))
68 (setq splitted (cdr splitted))) 69 (setq splitted (cdr splitted)))
@@ -86,7 +87,12 @@
86 (lambda (&optional arg) (save-excursion (end-of-line arg) (point))))) 87 (lambda (&optional arg) (save-excursion (end-of-line arg) (point)))))
87 88
88(defun flymake-popup-menu (pos menu-data) 89(defun flymake-popup-menu (pos menu-data)
89 (if (and (fboundp 'popup-menu) (fboundp 'make-event)) 90 "Pop up the flymake menu at position POS, using the data MENU-DATA.
91POS is a list of the form ((X Y) WINDOW), where X and Y are
92pixels positions from the top left corner of WINDOW's frame.
93MENU-DATA is a list of error and warning messages returned by
94`flymake-make-err-menu-data'."
95 (if (featurep 'xemacs)
90 (let* ((x-pos (nth 0 (nth 0 pos))) 96 (let* ((x-pos (nth 0 (nth 0 pos)))
91 (y-pos (nth 1 (nth 0 pos))) 97 (y-pos (nth 1 (nth 0 pos)))
92 (fake-event-props '(button 1 x 1 y 1))) 98 (fake-event-props '(button 1 x 1 y 1)))
@@ -96,6 +102,10 @@
96 (x-popup-menu pos (flymake-make-emacs-menu menu-data)))) 102 (x-popup-menu pos (flymake-make-emacs-menu menu-data))))
97 103
98(defun flymake-make-emacs-menu (menu-data) 104(defun flymake-make-emacs-menu (menu-data)
105 "Return a menu specifier using MENU-DATA.
106MENU-DATA is a list of error and warning messages returned by
107`flymake-make-err-menu-data'.
108See `x-popup-menu' for the menu specifier format."
99 (let* ((menu-title (nth 0 menu-data)) 109 (let* ((menu-title (nth 0 menu-data))
100 (menu-items (nth 1 menu-data)) 110 (menu-items (nth 1 menu-data))
101 (menu-commands nil)) 111 (menu-commands nil))
@@ -109,6 +119,7 @@
109(defun flymake-nop ()) 119(defun flymake-nop ())
110 120
111(defun flymake-make-xemacs-menu (menu-data) 121(defun flymake-make-xemacs-menu (menu-data)
122 "Return a menu specifier using MENU-DATA."
112 (let* ((menu-title (nth 0 menu-data)) 123 (let* ((menu-title (nth 0 menu-data))
113 (menu-items (nth 1 menu-data)) 124 (menu-items (nth 1 menu-data))
114 (menu-commands nil)) 125 (menu-commands nil))
@@ -152,7 +163,11 @@
152 :type 'integer) 163 :type 'integer)
153 164
154(defun flymake-log (level text &rest args) 165(defun flymake-log (level text &rest args)
155 "Log a message with optional arguments." 166 "Log a message at level LEVEL.
167If LEVEL is higher than `flymake-log-level', the message is
168ignored. Otherwise, it is printed using `message'.
169TEXT is a format control string, and the remaining arguments ARGS
170are the string substitutions (see `format')."
156 (if (<= level flymake-log-level) 171 (if (<= level flymake-log-level)
157 (let* ((msg (apply 'format text args))) 172 (let* ((msg (apply 'format text args)))
158 (message msg) 173 (message msg)
@@ -176,69 +191,37 @@
176 tmp)) 191 tmp))
177 192
178(defvar flymake-pid-to-names (flymake-makehash) 193(defvar flymake-pid-to-names (flymake-makehash)
179 "pid -> source buffer name, output file name mapping.") 194 "Hash table mapping PIDs to source buffer names and output files.")
180 195
181(defun flymake-reg-names (pid source-buffer-name) 196(defun flymake-reg-names (pid source-buffer-name)
182 "Save into in PID map." 197 "Associate PID with SOURCE-BUFFER-NAME in `flymake-pid-to-names'."
183 (unless (stringp source-buffer-name) 198 (unless (stringp source-buffer-name)
184 (error "Invalid buffer name")) 199 (error "Invalid buffer name"))
185 (puthash pid (list source-buffer-name) flymake-pid-to-names)) 200 (puthash pid (list source-buffer-name) flymake-pid-to-names))
186 201
187(defun flymake-get-source-buffer-name (pid) 202(defun flymake-get-source-buffer-name (pid)
188 "Return buffer name stored in PID map." 203 "Return buffer name associated with PID in `flymake-pid-to-names'."
189 (nth 0 (gethash pid flymake-pid-to-names))) 204 (nth 0 (gethash pid flymake-pid-to-names)))
190 205
191(defun flymake-unreg-names (pid) 206(defun flymake-unreg-names (pid)
192 "Delete PID->buffer name mapping." 207 "Remove the entry associated with PID from `flymake-pid-to-names'."
193 (remhash pid flymake-pid-to-names)) 208 (remhash pid flymake-pid-to-names))
194 209
195(defun flymake-get-buffer-var (buffer var-name)
196 "Switch to BUFFER if necessary and return local variable VAR-NAME."
197 (unless (bufferp buffer)
198 (error "Invalid buffer"))
199
200 (if (eq buffer (current-buffer))
201 (symbol-value var-name)
202 (with-current-buffer buffer
203 (symbol-value var-name))))
204
205(defun flymake-set-buffer-var (buffer var-name var-value)
206 "Switch to BUFFER if necessary and set local variable VAR-NAME to VAR-VALUE."
207 (unless (bufferp buffer)
208 (error "Invalid buffer"))
209
210 (if (eq buffer (current-buffer))
211 (set var-name var-value)
212 (with-current-buffer buffer
213 (set var-name var-value))))
214
215(defvar flymake-buffer-data (flymake-makehash) 210(defvar flymake-buffer-data (flymake-makehash)
216 "Data specific to syntax check tool, in name-value pairs.") 211 "Data specific to syntax check tool, in name-value pairs.")
217 212
218(make-variable-buffer-local 'flymake-buffer-data) 213(make-variable-buffer-local 'flymake-buffer-data)
219 214
220(defun flymake-get-buffer-data (buffer)
221 (flymake-get-buffer-var buffer 'flymake-buffer-data))
222
223(defun flymake-set-buffer-data (buffer data)
224 (flymake-set-buffer-var buffer 'flymake-buffer-data data))
225
226(defun flymake-get-buffer-value (buffer name) 215(defun flymake-get-buffer-value (buffer name)
227 (gethash name (flymake-get-buffer-data buffer))) 216 (gethash name (with-current-buffer buffer flymake-buffer-data)))
228 217
229(defun flymake-set-buffer-value (buffer name value) 218(defun flymake-set-buffer-value (buffer name value)
230 (puthash name value (flymake-get-buffer-data buffer))) 219 (puthash name value (with-current-buffer buffer flymake-buffer-data)))
231 220
232(defvar flymake-output-residual nil) 221(defvar flymake-output-residual nil)
233 222
234(make-variable-buffer-local 'flymake-output-residual) 223(make-variable-buffer-local 'flymake-output-residual)
235 224
236(defun flymake-get-buffer-output-residual (buffer)
237 (flymake-get-buffer-var buffer 'flymake-output-residual))
238
239(defun flymake-set-buffer-output-residual (buffer residual)
240 (flymake-set-buffer-var buffer 'flymake-output-residual residual))
241
242(defcustom flymake-allowed-file-name-masks 225(defcustom flymake-allowed-file-name-masks
243 '((".+\\.c$" flymake-simple-make-init flymake-simple-cleanup flymake-get-real-file-name) 226 '((".+\\.c$" flymake-simple-make-init flymake-simple-cleanup flymake-get-real-file-name)
244 (".+\\.cpp$" flymake-simple-make-init flymake-simple-cleanup flymake-get-real-file-name) 227 (".+\\.cpp$" flymake-simple-make-init flymake-simple-cleanup flymake-get-real-file-name)
@@ -642,35 +625,38 @@ It's flymake process filter."
642 625
643 (flymake-parse-residual source-buffer) 626 (flymake-parse-residual source-buffer)
644 (flymake-post-syntax-check source-buffer exit-status command) 627 (flymake-post-syntax-check source-buffer exit-status command)
645 (flymake-set-buffer-is-running source-buffer nil)))) 628 (setq flymake-is-running nil))))
646 (error 629 (error
647 (let ((err-str (format "Error in process sentinel for buffer %s: %s" 630 (let ((err-str (format "Error in process sentinel for buffer %s: %s"
648 source-buffer (error-message-string err)))) 631 source-buffer (error-message-string err))))
649 (flymake-log 0 err-str) 632 (flymake-log 0 err-str)
650 (flymake-set-buffer-is-running source-buffer nil))))))) 633 (with-current-buffer source-buffer
634 (setq flymake-is-running nil))))))))
651 635
652(defun flymake-post-syntax-check (source-buffer exit-status command) 636(defun flymake-post-syntax-check (source-buffer exit-status command)
653 (flymake-set-buffer-err-info source-buffer (flymake-get-buffer-new-err-info source-buffer)) 637 (with-current-buffer source-buffer
654 (flymake-set-buffer-new-err-info source-buffer nil) 638 (setq flymake-err-info flymake-new-err-info)
655 639 (setq flymake-new-err-info nil)
656 (flymake-set-buffer-err-info source-buffer (flymake-fix-line-numbers 640 (setq flymake-err-info
657 (flymake-get-buffer-err-info source-buffer) 641 (flymake-fix-line-numbers
658 1 642 flymake-err-info 1 (flymake-count-lines source-buffer))))
659 (flymake-count-lines source-buffer)))
660 (flymake-delete-own-overlays source-buffer) 643 (flymake-delete-own-overlays source-buffer)
661 (flymake-highlight-err-lines source-buffer (flymake-get-buffer-err-info source-buffer)) 644 (flymake-highlight-err-lines
662 645 source-buffer (with-current-buffer source-buffer flymake-err-info))
663 (let ((err-count (flymake-get-err-count (flymake-get-buffer-err-info source-buffer) "e")) 646 (let (err-count warn-count)
664 (warn-count (flymake-get-err-count (flymake-get-buffer-err-info source-buffer) "w"))) 647 (with-current-buffer source-buffer
665 648 (setq err-count (flymake-get-err-count flymake-err-info "e"))
666 (flymake-log 2 "%s: %d error(s), %d warning(s) in %.2f second(s)" 649 (setq warn-count (flymake-get-err-count flymake-err-info "w"))
650 (flymake-log 2 "%s: %d error(s), %d warning(s) in %.2f second(s)"
667 (buffer-name source-buffer) err-count warn-count 651 (buffer-name source-buffer) err-count warn-count
668 (- (flymake-float-time) (flymake-get-buffer-check-start-time source-buffer))) 652 (- (flymake-float-time) flymake-check-start-time))
669 (flymake-set-buffer-check-start-time source-buffer nil) 653 (setq flymake-check-start-time nil))
654
670 (if (and (equal 0 err-count) (equal 0 warn-count)) 655 (if (and (equal 0 err-count) (equal 0 warn-count))
671 (if (equal 0 exit-status) 656 (if (equal 0 exit-status)
672 (flymake-report-status source-buffer "" "") ; PASSED 657 (flymake-report-status source-buffer "" "") ; PASSED
673 (if (not (flymake-get-buffer-check-was-interrupted source-buffer)) 658 (if (not (with-current-buffer source-buffer
659 flymake-check-was-interrupted))
674 (flymake-report-fatal-status (current-buffer) "CFGERR" 660 (flymake-report-fatal-status (current-buffer) "CFGERR"
675 (format "Configuration error has occured while running %s" command)) 661 (format "Configuration error has occured while running %s" command))
676 (flymake-report-status source-buffer nil ""))) ; "STOPPED" 662 (flymake-report-status source-buffer nil ""))) ; "STOPPED"
@@ -679,38 +665,34 @@ It's flymake process filter."
679(defun flymake-parse-output-and-residual (source-buffer output) 665(defun flymake-parse-output-and-residual (source-buffer output)
680 "Split OUTPUT into lines, merge in residual if necessary." 666 "Split OUTPUT into lines, merge in residual if necessary."
681 (with-current-buffer source-buffer 667 (with-current-buffer source-buffer
682 (let* ((buffer-residual (flymake-get-buffer-output-residual source-buffer)) 668 (let* ((buffer-residual flymake-output-residual)
683 (total-output (if buffer-residual (concat buffer-residual output) output)) 669 (total-output (if buffer-residual (concat buffer-residual output) output))
684 (lines-and-residual (flymake-split-output total-output)) 670 (lines-and-residual (flymake-split-output total-output))
685 (lines (nth 0 lines-and-residual)) 671 (lines (nth 0 lines-and-residual))
686 (new-residual (nth 1 lines-and-residual))) 672 (new-residual (nth 1 lines-and-residual)))
687 673 (with-current-buffer source-buffer
688 (flymake-set-buffer-output-residual source-buffer new-residual) 674 (setq flymake-output-residual new-residual)
689 (flymake-set-buffer-new-err-info source-buffer (flymake-parse-err-lines 675 (setq flymake-new-err-info
690 (flymake-get-buffer-new-err-info source-buffer) 676 (flymake-parse-err-lines
691 source-buffer lines))))) 677 flymake-new-err-info
678 source-buffer lines))))))
692 679
693(defun flymake-parse-residual (source-buffer) 680(defun flymake-parse-residual (source-buffer)
694 "Parse residual if it's non empty." 681 "Parse residual if it's non empty."
695 (with-current-buffer source-buffer 682 (with-current-buffer source-buffer
696 (when (flymake-get-buffer-output-residual source-buffer) 683 (when flymake-output-residual
697 (flymake-set-buffer-new-err-info source-buffer (flymake-parse-err-lines 684 (setq flymake-new-err-info
698 (flymake-get-buffer-new-err-info source-buffer) 685 (flymake-parse-err-lines
699 source-buffer 686 flymake-new-err-info
700 (list (flymake-get-buffer-output-residual source-buffer)))) 687 source-buffer
701 (flymake-set-buffer-output-residual source-buffer nil)))) 688 (list flymake-output-residual)))
689 (setq flymake-output-residual nil))))
702 690
703(defvar flymake-err-info nil 691(defvar flymake-err-info nil
704 "Sorted list of line numbers and lists of err info in the form (file, err-text).") 692 "Sorted list of line numbers and lists of err info in the form (file, err-text).")
705 693
706(make-variable-buffer-local 'flymake-err-info) 694(make-variable-buffer-local 'flymake-err-info)
707 695
708(defun flymake-get-buffer-err-info (buffer)
709 (flymake-get-buffer-var buffer 'flymake-err-info))
710
711(defun flymake-set-buffer-err-info (buffer err-info)
712 (flymake-set-buffer-var buffer 'flymake-err-info err-info))
713
714(defun flymake-er-make-er (line-no line-err-info-list) 696(defun flymake-er-make-er (line-no line-err-info-list)
715 (list line-no line-err-info-list)) 697 (list line-no line-err-info-list))
716 698
@@ -725,12 +707,6 @@ It's flymake process filter."
725 707
726(make-variable-buffer-local 'flymake-new-err-info) 708(make-variable-buffer-local 'flymake-new-err-info)
727 709
728(defun flymake-get-buffer-new-err-info (buffer)
729 (flymake-get-buffer-var buffer 'flymake-new-err-info))
730
731(defun flymake-set-buffer-new-err-info (buffer new-err-info)
732 (flymake-set-buffer-var buffer 'flymake-new-err-info new-err-info))
733
734;; getters/setters for line-err-info: (file, line, type, text). 710;; getters/setters for line-err-info: (file, line, type, text).
735(defun flymake-ler-make-ler (file line type text &optional full-file) 711(defun flymake-ler-make-ler (file line type text &optional full-file)
736 (list file line type text full-file)) 712 (list file line type text full-file))
@@ -1067,7 +1043,11 @@ Return its components if so, nil if no."
1067 (and (not (flymake-ler-get-file line-one)) (not (flymake-ler-get-file line-two))))))) 1043 (and (not (flymake-ler-get-file line-one)) (not (flymake-ler-get-file line-two)))))))
1068 1044
1069(defun flymake-add-line-err-info (line-err-info-list line-err-info) 1045(defun flymake-add-line-err-info (line-err-info-list line-err-info)
1070 "Insert new err info favoring sorting: err-type e/w, filename nil/non-nil." 1046 "Update LINE-ERR-INFO-LIST with the error LINE-ERR-INFO.
1047For the format of LINE-ERR-INFO, see `flymake-ler-make-ler'.
1048The new element is inserted in the proper position, according to
1049the predicate `flymake-line-err-info-is-less-or-equal'.
1050The updated value of LINE-ERR-INFO-LIST is returned."
1071 (if (not line-err-info-list) 1051 (if (not line-err-info-list)
1072 (list line-err-info) 1052 (list line-err-info)
1073 (let* ((count (length line-err-info-list)) 1053 (let* ((count (length line-err-info-list))
@@ -1079,7 +1059,10 @@ Return its components if so, nil if no."
1079 line-err-info-list))) 1059 line-err-info-list)))
1080 1060
1081(defun flymake-add-err-info (err-info-list line-err-info) 1061(defun flymake-add-err-info (err-info-list line-err-info)
1082 "Add error info (file line type text) to err info list preserving sort order." 1062 "Update ERR-INFO-LIST with the error LINE-ERR-INFO, preserving sort order.
1063Returns the updated value of ERR-INFO-LIST.
1064For the format of ERR-INFO-LIST, see `flymake-err-info'.
1065For the format of LINE-ERR-INFO, see `flymake-ler-make-ler'."
1083 (let* ((line-no (if (flymake-ler-get-file line-err-info) 1 (flymake-ler-get-line line-err-info))) 1066 (let* ((line-no (if (flymake-ler-get-file line-err-info) 1 (flymake-ler-get-line line-err-info)))
1084 (info-and-pos (flymake-find-err-info err-info-list line-no)) 1067 (info-and-pos (flymake-find-err-info err-info-list line-no))
1085 (exists (car info-and-pos)) 1068 (exists (car info-and-pos))
@@ -1202,16 +1185,16 @@ Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if
1202 (unless (bufferp buffer) 1185 (unless (bufferp buffer)
1203 (error "Expected a buffer")) 1186 (error "Expected a buffer"))
1204 (with-current-buffer buffer 1187 (with-current-buffer buffer
1205 (flymake-log 3 "flymake is running: %s" (flymake-get-buffer-is-running buffer)) 1188 (flymake-log 3 "flymake is running: %s" flymake-is-running)
1206 (when (and (not (flymake-get-buffer-is-running buffer)) 1189 (when (and (not flymake-is-running)
1207 (flymake-can-syntax-check-file (buffer-file-name buffer))) 1190 (flymake-can-syntax-check-file (buffer-file-name buffer)))
1208 (when (or (not flymake-compilation-prevents-syntax-check) 1191 (when (or (not flymake-compilation-prevents-syntax-check)
1209 (not (flymake-compilation-is-running))) ;+ (flymake-rep-ort-status buffer "COMP") 1192 (not (flymake-compilation-is-running))) ;+ (flymake-rep-ort-status buffer "COMP")
1210 (flymake-clear-buildfile-cache) 1193 (flymake-clear-buildfile-cache)
1211 (flymake-clear-project-include-dirs-cache) 1194 (flymake-clear-project-include-dirs-cache)
1212 1195
1213 (flymake-set-buffer-check-was-interrupted buffer nil) 1196 (setq flymake-check-was-interrupted nil)
1214 (flymake-set-buffer-data buffer (flymake-makehash 'equal)) 1197 (setq flymake-buffer-data (flymake-makehash 'equal))
1215 1198
1216 (let* ((source-file-name (buffer-file-name buffer)) 1199 (let* ((source-file-name (buffer-file-name buffer))
1217 (init-f (flymake-get-init-function source-file-name)) 1200 (init-f (flymake-get-init-function source-file-name))
@@ -1225,7 +1208,7 @@ Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if
1225 (flymake-log 0 "init function %s for %s failed, cleaning up" init-f source-file-name) 1208 (flymake-log 0 "init function %s for %s failed, cleaning up" init-f source-file-name)
1226 (funcall cleanup-f buffer)) 1209 (funcall cleanup-f buffer))
1227 (progn 1210 (progn
1228 (flymake-set-buffer-last-change-time buffer nil) 1211 (setq flymake-last-change-time nil)
1229 (flymake-start-syntax-check-process buffer cmd args dir)))))))) 1212 (flymake-start-syntax-check-process buffer cmd args dir))))))))
1230 1213
1231(defun flymake-start-syntax-check-process (buffer cmd args dir) 1214(defun flymake-start-syntax-check-process (buffer cmd args dir)
@@ -1242,9 +1225,10 @@ Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if
1242 1225
1243 (flymake-reg-names (process-id process) (buffer-name buffer)) 1226 (flymake-reg-names (process-id process) (buffer-name buffer))
1244 1227
1245 (flymake-set-buffer-is-running buffer t) 1228 (with-current-buffer buffer
1246 (flymake-set-buffer-last-change-time buffer nil) 1229 (setq flymake-is-running t)
1247 (flymake-set-buffer-check-start-time buffer (flymake-float-time)) 1230 (setq flymake-last-change-time nil)
1231 (setq flymake-check-start-time (flymake-float-time)))
1248 1232
1249 (flymake-report-status buffer nil "*") 1233 (flymake-report-status buffer nil "*")
1250 (flymake-log 2 "started process %d, command=%s, dir=%s" 1234 (flymake-log 2 "started process %d, command=%s, dir=%s"
@@ -1264,7 +1248,8 @@ Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if
1264 (signal-process pid 9) 1248 (signal-process pid 9)
1265 (let* ((buffer-name (flymake-get-source-buffer-name pid))) 1249 (let* ((buffer-name (flymake-get-source-buffer-name pid)))
1266 (when (and buffer-name (get-buffer buffer-name)) 1250 (when (and buffer-name (get-buffer buffer-name))
1267 (flymake-set-buffer-check-was-interrupted (get-buffer buffer-name) t))) 1251 (with-current-buffer (get-buffer buffer-name)
1252 (setq flymake-check-was-interrupted t))))
1268 (flymake-log 1 "killed process %d" pid)) 1253 (flymake-log 1 "killed process %d" pid))
1269 1254
1270(defun flymake-stop-all-syntax-checks () 1255(defun flymake-stop-all-syntax-checks ()
@@ -1288,56 +1273,26 @@ Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if
1288 1273
1289(make-variable-buffer-local 'flymake-is-running) 1274(make-variable-buffer-local 'flymake-is-running)
1290 1275
1291(defun flymake-get-buffer-is-running (buffer)
1292 (flymake-get-buffer-var buffer 'flymake-is-running))
1293
1294(defun flymake-set-buffer-is-running (buffer is-running)
1295 (flymake-set-buffer-var buffer 'flymake-is-running is-running))
1296
1297(defvar flymake-timer nil 1276(defvar flymake-timer nil
1298 "Timer for starting syntax check.") 1277 "Timer for starting syntax check.")
1299 1278
1300(make-variable-buffer-local 'flymake-timer) 1279(make-variable-buffer-local 'flymake-timer)
1301 1280
1302(defun flymake-get-buffer-timer (buffer)
1303 (flymake-get-buffer-var buffer 'flymake-timer))
1304
1305(defun flymake-set-buffer-timer (buffer timer)
1306 (flymake-set-buffer-var buffer 'flymake-timer timer))
1307
1308(defvar flymake-last-change-time nil 1281(defvar flymake-last-change-time nil
1309 "Time of last buffer change.") 1282 "Time of last buffer change.")
1310 1283
1311(make-variable-buffer-local 'flymake-last-change-time) 1284(make-variable-buffer-local 'flymake-last-change-time)
1312 1285
1313(defun flymake-get-buffer-last-change-time (buffer)
1314 (flymake-get-buffer-var buffer 'flymake-last-change-time))
1315
1316(defun flymake-set-buffer-last-change-time (buffer change-time)
1317 (flymake-set-buffer-var buffer 'flymake-last-change-time change-time))
1318
1319(defvar flymake-check-start-time nil 1286(defvar flymake-check-start-time nil
1320 "Time at which syntax check was started.") 1287 "Time at which syntax check was started.")
1321 1288
1322(make-variable-buffer-local 'flymake-check-start-time) 1289(make-variable-buffer-local 'flymake-check-start-time)
1323 1290
1324(defun flymake-get-buffer-check-start-time (buffer)
1325 (flymake-get-buffer-var buffer 'flymake-check-start-time))
1326
1327(defun flymake-set-buffer-check-start-time (buffer check-start-time)
1328 (flymake-set-buffer-var buffer 'flymake-check-start-time check-start-time))
1329
1330(defvar flymake-check-was-interrupted nil 1291(defvar flymake-check-was-interrupted nil
1331 "Non-nil if syntax check was killed by `flymake-compile'.") 1292 "Non-nil if syntax check was killed by `flymake-compile'.")
1332 1293
1333(make-variable-buffer-local 'flymake-check-was-interrupted) 1294(make-variable-buffer-local 'flymake-check-was-interrupted)
1334 1295
1335(defun flymake-get-buffer-check-was-interrupted (buffer)
1336 (flymake-get-buffer-var buffer 'flymake-check-was-interrupted))
1337
1338(defun flymake-set-buffer-check-was-interrupted (buffer interrupted)
1339 (flymake-set-buffer-var buffer 'flymake-check-was-interrupted interrupted))
1340
1341(defcustom flymake-no-changes-timeout 0.5 1296(defcustom flymake-no-changes-timeout 0.5
1342 "Time to wait after last change before starting compilation." 1297 "Time to wait after last change before starting compilation."
1343 :group 'flymake 1298 :group 'flymake
@@ -1345,12 +1300,13 @@ Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if
1345 1300
1346(defun flymake-on-timer-event (buffer) 1301(defun flymake-on-timer-event (buffer)
1347 "Start a syntax check for buffer BUFFER if necessary." 1302 "Start a syntax check for buffer BUFFER if necessary."
1348 ;;+(flymake-log 3 "timer: running=%s, time=%s, cur-time=%s" (flymake-get-buffer-is-running buffer) (flymake-get-buffer-last-change-time buffer) (flymake-float-time)) 1303 (when (bufferp buffer)
1349 (when (and (bufferp buffer) (not (flymake-get-buffer-is-running buffer)))
1350 (with-current-buffer buffer 1304 (with-current-buffer buffer
1351 (when (and (flymake-get-buffer-last-change-time buffer) 1305 (when (and (not flymake-is-running)
1352 (> (flymake-float-time) (+ flymake-no-changes-timeout (flymake-get-buffer-last-change-time buffer)))) 1306 flymake-last-change-time
1353 (flymake-set-buffer-last-change-time buffer nil) 1307 (> (flymake-float-time) (+ flymake-no-changes-timeout flymake-last-change-time)))
1308
1309 (setq flymake-last-change-time nil)
1354 (flymake-log 3 "starting syntax check as more than 1 second passed since last change") 1310 (flymake-log 3 "starting syntax check as more than 1 second passed since last change")
1355 (flymake-start-syntax-check buffer))))) 1311 (flymake-start-syntax-check buffer)))))
1356 1312
@@ -1391,7 +1347,7 @@ Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if
1391 "Display a menu with errors/warnings for current line if it has errors and/or warnings." 1347 "Display a menu with errors/warnings for current line if it has errors and/or warnings."
1392 (interactive) 1348 (interactive)
1393 (let* ((line-no (flymake-current-line-no)) 1349 (let* ((line-no (flymake-current-line-no))
1394 (line-err-info-list (nth 0 (flymake-find-err-info (flymake-get-buffer-err-info (current-buffer)) line-no))) 1350 (line-err-info-list (nth 0 (flymake-find-err-info flymake-err-info line-no)))
1395 (menu-data (flymake-make-err-menu-data line-no line-err-info-list)) 1351 (menu-data (flymake-make-err-menu-data line-no line-err-info-list))
1396 (choice nil) 1352 (choice nil)
1397 (mouse-pos (flymake-get-point-pixel-pos)) 1353 (mouse-pos (flymake-get-point-pixel-pos))
@@ -1442,46 +1398,27 @@ Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if
1442 1398
1443(make-variable-buffer-local 'flymake-mode-line) 1399(make-variable-buffer-local 'flymake-mode-line)
1444 1400
1445(defun flymake-get-buffer-mode-line (buffer)
1446 (flymake-get-buffer-var buffer 'flymake-mode-line))
1447
1448(defun flymake-set-buffer-mode-line (buffer mode-line-string)
1449 (flymake-set-buffer-var buffer 'flymake-mode-line mode-line-string))
1450
1451(defvar flymake-mode-line-e-w nil) 1401(defvar flymake-mode-line-e-w nil)
1452 1402
1453(make-variable-buffer-local 'flymake-mode-line-e-w) 1403(make-variable-buffer-local 'flymake-mode-line-e-w)
1454 1404
1455(defun flymake-get-buffer-mode-line-e-w (buffer)
1456 (flymake-get-buffer-var buffer 'flymake-mode-line-e-w))
1457
1458(defun flymake-set-buffer-mode-line-e-w (buffer e-w)
1459 (flymake-set-buffer-var buffer 'flymake-mode-line-e-w e-w))
1460
1461(defvar flymake-mode-line-status nil) 1405(defvar flymake-mode-line-status nil)
1462 1406
1463(make-variable-buffer-local 'flymake-mode-line-status) 1407(make-variable-buffer-local 'flymake-mode-line-status)
1464 1408
1465(defun flymake-get-buffer-mode-line-status (buffer)
1466 (flymake-get-buffer-var buffer 'flymake-mode-line-status))
1467
1468(defun flymake-set-buffer-mode-line-status (buffer status)
1469 (flymake-set-buffer-var buffer 'flymake-mode-line-status status))
1470
1471(defun flymake-report-status (buffer e-w &optional status) 1409(defun flymake-report-status (buffer e-w &optional status)
1472 "Show status in mode line." 1410 "Show status in mode line."
1473 (when (bufferp buffer) 1411 (when (bufferp buffer)
1474 (with-current-buffer buffer 1412 (with-current-buffer buffer
1475 (when e-w 1413 (when e-w
1476 (flymake-set-buffer-mode-line-e-w buffer e-w) 1414 (setq flymake-mode-line-e-w e-w))
1477 )
1478 (when status 1415 (when status
1479 (flymake-set-buffer-mode-line-status buffer status)) 1416 (setq flymake-mode-line-status status))
1480 (let* ((mode-line " Flymake")) 1417 (let* ((mode-line " Flymake"))
1481 (when (> (length (flymake-get-buffer-mode-line-e-w buffer)) 0) 1418 (when (> (length flymake-mode-line-e-w) 0)
1482 (setq mode-line (concat mode-line ":" (flymake-get-buffer-mode-line-e-w buffer)))) 1419 (setq mode-line (concat mode-line ":" flymake-mode-line-e-w)))
1483 (setq mode-line (concat mode-line (flymake-get-buffer-mode-line-status buffer))) 1420 (setq mode-line (concat mode-line flymake-mode-line-status))
1484 (flymake-set-buffer-mode-line buffer mode-line) 1421 (setq flymake-mode-line mode-line)
1485 (force-mode-line-update))))) 1422 (force-mode-line-update)))))
1486 1423
1487(defun flymake-display-warning (warning) 1424(defun flymake-display-warning (warning)
@@ -1532,7 +1469,8 @@ With arg, turn Flymake mode on if and only if arg is positive."
1532 1469
1533 (flymake-report-status (current-buffer) "" "") 1470 (flymake-report-status (current-buffer) "" "")
1534 1471
1535 (flymake-set-buffer-timer (current-buffer) (run-at-time nil 1 'flymake-on-timer-event (current-buffer))) 1472 (setq flymake-timer
1473 (run-at-time nil 1 'flymake-on-timer-event (current-buffer)))
1536 1474
1537 (setq flymake-mode t) 1475 (setq flymake-mode t)
1538 (flymake-log 1 "flymake mode turned ON for buffer %s" (buffer-name (current-buffer))) 1476 (flymake-log 1 "flymake mode turned ON for buffer %s" (buffer-name (current-buffer)))
@@ -1550,12 +1488,11 @@ With arg, turn Flymake mode on if and only if arg is positive."
1550 1488
1551 (flymake-delete-own-overlays (current-buffer)) 1489 (flymake-delete-own-overlays (current-buffer))
1552 1490
1553 (when (flymake-get-buffer-timer (current-buffer)) 1491 (when flymake-timer
1554 (cancel-timer (flymake-get-buffer-timer (current-buffer))) 1492 (cancel-timer flymake-timer)
1555 (flymake-set-buffer-timer (current-buffer) nil)) 1493 (setq flymake-timer nil))
1556
1557 (flymake-set-buffer-is-running (current-buffer) nil)
1558 1494
1495 (setq flymake-is-running nil)
1559 (setq flymake-mode nil) 1496 (setq flymake-mode nil)
1560 (flymake-log 1 "flymake mode turned OFF for buffer %s" (buffer-name (current-buffer))))) 1497 (flymake-log 1 "flymake mode turned OFF for buffer %s" (buffer-name (current-buffer)))))
1561 1498
@@ -1571,7 +1508,7 @@ With arg, turn Flymake mode on if and only if arg is positive."
1571 (when (and flymake-start-syntax-check-on-newline (equal new-text "\n")) 1508 (when (and flymake-start-syntax-check-on-newline (equal new-text "\n"))
1572 (flymake-log 3 "starting syntax check as new-line has been seen") 1509 (flymake-log 3 "starting syntax check as new-line has been seen")
1573 (flymake-start-syntax-check-for-current-buffer)) 1510 (flymake-start-syntax-check-for-current-buffer))
1574 (flymake-set-buffer-last-change-time (current-buffer) (flymake-float-time)))) 1511 (setq flymake-last-change-time (flymake-float-time))))
1575 1512
1576(defun flymake-after-save-hook () 1513(defun flymake-after-save-hook ()
1577 (if (local-variable-p 'flymake-mode (current-buffer)) ; (???) other way to determine whether flymake is active in buffer being saved? 1514 (if (local-variable-p 'flymake-mode (current-buffer)) ; (???) other way to determine whether flymake is active in buffer being saved?
@@ -1580,9 +1517,9 @@ With arg, turn Flymake mode on if and only if arg is positive."
1580 (flymake-start-syntax-check-for-current-buffer)))) ; no more mode 3. cannot start check if mode 3 (to temp copies) is active - (???) 1517 (flymake-start-syntax-check-for-current-buffer)))) ; no more mode 3. cannot start check if mode 3 (to temp copies) is active - (???)
1581 1518
1582(defun flymake-kill-buffer-hook () 1519(defun flymake-kill-buffer-hook ()
1583 (when (flymake-get-buffer-timer (current-buffer)) 1520 (when flymake-timer
1584 (cancel-timer (flymake-get-buffer-timer (current-buffer))) 1521 (cancel-timer flymake-timer)
1585 (flymake-set-buffer-timer (current-buffer) nil))) 1522 (setq flymake-timer nil)))
1586 1523
1587(defun flymake-find-file-hook () 1524(defun flymake-find-file-hook ()
1588 ;;+(when flymake-start-syntax-check-on-find-file 1525 ;;+(when flymake-start-syntax-check-on-find-file
@@ -1636,9 +1573,9 @@ With arg, turn Flymake mode on if and only if arg is positive."
1636(defun flymake-goto-next-error () 1573(defun flymake-goto-next-error ()
1637 "Go to next error in err ring." 1574 "Go to next error in err ring."
1638 (interactive) 1575 (interactive)
1639 (let ((line-no (flymake-get-next-err-line-no (flymake-get-buffer-err-info (current-buffer)) (flymake-current-line-no)))) 1576 (let ((line-no (flymake-get-next-err-line-no flymake-err-info (flymake-current-line-no))))
1640 (when (not line-no) 1577 (when (not line-no)
1641 (setq line-no (flymake-get-first-err-line-no (flymake-get-buffer-err-info (current-buffer)))) 1578 (setq line-no (flymake-get-first-err-line-no flymake-err-info))
1642 (flymake-log 1 "passed end of file")) 1579 (flymake-log 1 "passed end of file"))
1643 (if line-no 1580 (if line-no
1644 (flymake-goto-line line-no) 1581 (flymake-goto-line line-no)
@@ -1647,9 +1584,9 @@ With arg, turn Flymake mode on if and only if arg is positive."
1647(defun flymake-goto-prev-error () 1584(defun flymake-goto-prev-error ()
1648 "Go to prev error in err ring." 1585 "Go to prev error in err ring."
1649 (interactive) 1586 (interactive)
1650 (let ((line-no (flymake-get-prev-err-line-no (flymake-get-buffer-err-info (current-buffer)) (flymake-current-line-no)))) 1587 (let ((line-no (flymake-get-prev-err-line-no flymake-err-info (flymake-current-line-no))))
1651 (when (not line-no) 1588 (when (not line-no)
1652 (setq line-no (flymake-get-last-err-line-no (flymake-get-buffer-err-info (current-buffer)))) 1589 (setq line-no (flymake-get-last-err-line-no flymake-err-info))
1653 (flymake-log 1 "passed beginning of file")) 1590 (flymake-log 1 "passed beginning of file"))
1654 (if line-no 1591 (if line-no
1655 (flymake-goto-line line-no) 1592 (flymake-goto-line line-no)
@@ -1721,7 +1658,8 @@ With arg, turn Flymake mode on if and only if arg is positive."
1721Delete temp file." 1658Delete temp file."
1722 (let* ((temp-source-file-name (flymake-get-buffer-value buffer "temp-source-file-name"))) 1659 (let* ((temp-source-file-name (flymake-get-buffer-value buffer "temp-source-file-name")))
1723 (flymake-safe-delete-file temp-source-file-name) 1660 (flymake-safe-delete-file temp-source-file-name)
1724 (flymake-set-buffer-last-change-time buffer nil))) 1661 (with-current-buffer buffer
1662 (setq flymake-last-change-time nil))))
1725 1663
1726(defun flymake-get-real-file-name (buffer file-name-from-err-msg) 1664(defun flymake-get-real-file-name (buffer file-name-from-err-msg)
1727 "Translate file name from error message to \"real\" file name. 1665 "Translate file name from error message to \"real\" file name.
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index 95920ff9f02..56344a67e5c 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -79,8 +79,11 @@
79(defvar gdb-overlay-arrow-position nil) 79(defvar gdb-overlay-arrow-position nil)
80(defvar gdb-server-prefix nil) 80(defvar gdb-server-prefix nil)
81(defvar gdb-flush-pending-output nil) 81(defvar gdb-flush-pending-output nil)
82(defvar gdb-location-list nil "Alist of breakpoint numbers and full filenames.") 82(defvar gdb-location-alist nil
83 "Alist of breakpoint numbers and full filenames.")
83(defvar gdb-find-file-unhook nil) 84(defvar gdb-find-file-unhook nil)
85(defvar gdb-active-process nil "GUD tooltips display variable values when t, \
86and #define directives otherwise.")
84 87
85(defvar gdb-buffer-type nil 88(defvar gdb-buffer-type nil
86 "One of the symbols bound in `gdb-buffer-rules'.") 89 "One of the symbols bound in `gdb-buffer-rules'.")
@@ -193,6 +196,43 @@ detailed description of this mode.
193 :group 'gud 196 :group 'gud
194 :version "22.1") 197 :version "22.1")
195 198
199(defcustom gdb-cpp-define-alist-program
200 (cond ((eq system-type 'ms-dos) "gcc -E -dM -o - -")
201 (t "gcc -E -dM -"))
202 "The program name for generating an alist of #define directives.
203This list is used to display the #define directive associated
204with an identifier as a tooltip. It works in a debug session with
205GDB, when tooltip-gud-tips-p is t."
206 :type 'string
207 :group 'gud
208 :version "22.1")
209
210(defcustom gdb-cpp-define-alist-flags ""
211 "*Preprocessor flags used by `gdb-create-define-alist'."
212 :type 'string
213 :group 'gud
214 :version "22.1")
215
216(defvar gdb-define-alist nil "Alist of #define directives for GUD tooltips.")
217
218(defun gdb-create-define-alist ()
219 "Create an alist of #define directives for GUD tooltips."
220 (let* ((file (buffer-file-name))
221 (output
222 (with-output-to-string
223 (with-current-buffer standard-output
224 (call-process shell-file-name
225 (if (file-exists-p file) file nil)
226 (list t nil) nil "-c"
227 (concat gdb-cpp-define-alist-program " "
228 gdb-cpp-define-alist-flags)))))
229 (define-list (split-string output "\n" t))
230 (name))
231 (setq gdb-define-alist nil)
232 (dolist (define define-list)
233 (setq name (nth 1 (split-string define "[( ]")))
234 (push (cons name define) gdb-define-alist))))
235
196(defun gdb-set-gud-minor-mode (buffer) 236(defun gdb-set-gud-minor-mode (buffer)
197 "Set gud-minor-mode from find-file if appropriate." 237 "Set gud-minor-mode from find-file if appropriate."
198 (goto-char (point-min)) 238 (goto-char (point-min))
@@ -205,13 +245,16 @@ detailed description of this mode.
205 245
206(defun gdb-set-gud-minor-mode-1 (buffer) 246(defun gdb-set-gud-minor-mode-1 (buffer)
207 (goto-char (point-min)) 247 (goto-char (point-min))
208 (if (and (search-forward "Located in " nil t) 248 (when (and (search-forward "Located in " nil t)
209 (looking-at "\\S-*") 249 (looking-at "\\S-*")
210 (string-equal (buffer-file-name buffer) 250 (string-equal (buffer-file-name buffer)
211 (match-string 0))) 251 (match-string 0)))
212 (with-current-buffer buffer 252 (with-current-buffer buffer
213 (set (make-local-variable 'gud-minor-mode) 'gdba) 253 (set (make-local-variable 'gud-minor-mode) 'gdba)
214 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)))) 254 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
255 (make-local-variable 'gdb-define-alist)
256 (gdb-create-define-alist)
257 (add-hook 'after-save-hook 'gdb-create-define-alist nil t))))
215 258
216(defun gdb-set-gud-minor-mode-existing-buffers () 259(defun gdb-set-gud-minor-mode-existing-buffers ()
217 (dolist (buffer (buffer-list)) 260 (dolist (buffer (buffer-list))
@@ -281,7 +324,7 @@ detailed description of this mode.
281 (setq gdb-output-sink 'user) 324 (setq gdb-output-sink 'user)
282 (setq gdb-server-prefix "server ") 325 (setq gdb-server-prefix "server ")
283 (setq gdb-flush-pending-output nil) 326 (setq gdb-flush-pending-output nil)
284 (setq gdb-location-list nil) 327 (setq gdb-location-alist nil)
285 (setq gdb-find-file-unhook nil) 328 (setq gdb-find-file-unhook nil)
286 ;; 329 ;;
287 (setq gdb-buffer-type 'gdba) 330 (setq gdb-buffer-type 'gdba)
@@ -301,7 +344,7 @@ detailed description of this mode.
301 (run-hooks 'gdba-mode-hook)) 344 (run-hooks 'gdba-mode-hook))
302 345
303(defcustom gdb-use-colon-colon-notation nil 346(defcustom gdb-use-colon-colon-notation nil
304 "If non-nil use FUN::VAR format to display variables in the speedbar." ; 347 "If non-nil use FUN::VAR format to display variables in the speedbar."
305 :type 'boolean 348 :type 'boolean
306 :group 'gud 349 :group 'gud
307 :version "22.1") 350 :version "22.1")
@@ -430,7 +473,8 @@ detailed description of this mode.
430 (let ((varnum (match-string 1))) 473 (let ((varnum (match-string 1)))
431 (gdb-enqueue-input 474 (gdb-enqueue-input
432 (list 475 (list
433 (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)) 476 (if (with-current-buffer gud-comint-buffer
477 (eq gud-minor-mode 'gdba))
434 (concat "server interpreter mi \"-var-evaluate-expression " 478 (concat "server interpreter mi \"-var-evaluate-expression "
435 varnum "\"\n") 479 varnum "\"\n")
436 (concat "-var-evaluate-expression " varnum "\n")) 480 (concat "-var-evaluate-expression " varnum "\n"))
@@ -482,7 +526,8 @@ detailed description of this mode.
482 (list 526 (list
483 (if (with-current-buffer gud-comint-buffer 527 (if (with-current-buffer gud-comint-buffer
484 (eq gud-minor-mode 'gdba)) 528 (eq gud-minor-mode 'gdba))
485 (concat "server interpreter mi \"-var-assign " varnum " " value "\"\n") 529 (concat "server interpreter mi \"-var-assign "
530 varnum " " value "\"\n")
486 (concat "-var-assign " varnum " " value "\n")) 531 (concat "-var-assign " varnum " " value "\n"))
487 'ignore)))) 532 'ignore))))
488 533
@@ -773,8 +818,8 @@ This filter may simply queue input for a later time."
773 ("post-prompt" gdb-post-prompt) 818 ("post-prompt" gdb-post-prompt)
774 ("source" gdb-source) 819 ("source" gdb-source)
775 ("starting" gdb-starting) 820 ("starting" gdb-starting)
776 ("exited" gdb-stopping) 821 ("exited" gdb-exited)
777 ("signalled" gdb-stopping) 822 ("signalled" gdb-exited)
778 ("signal" gdb-stopping) 823 ("signal" gdb-stopping)
779 ("breakpoint" gdb-stopping) 824 ("breakpoint" gdb-stopping)
780 ("watchpoint" gdb-stopping) 825 ("watchpoint" gdb-stopping)
@@ -800,7 +845,7 @@ This filter may simply queue input for a later time."
800 (setq gud-last-frame 845 (setq gud-last-frame
801 (cons 846 (cons
802 (match-string 1 args) 847 (match-string 1 args)
803 (string-to-int (match-string 2 args)))) 848 (string-to-number (match-string 2 args))))
804 (setq gdb-current-address (match-string 3 args)) 849 (setq gdb-current-address (match-string 3 args))
805 ;; cover for auto-display output which comes *before* 850 ;; cover for auto-display output which comes *before*
806 ;; stopped annotation 851 ;; stopped annotation
@@ -850,6 +895,7 @@ This sends the next command (if any) to gdb."
850 "An annotation handler for `starting'. 895 "An annotation handler for `starting'.
851This says that I/O for the subprocess is now the program being debugged, 896This says that I/O for the subprocess is now the program being debugged,
852not GDB." 897not GDB."
898 (setq gdb-active-process t)
853 (let ((sink gdb-output-sink)) 899 (let ((sink gdb-output-sink))
854 (cond 900 (cond
855 ((eq sink 'user) 901 ((eq sink 'user)
@@ -862,7 +908,7 @@ not GDB."
862 (error "Unexpected `starting' annotation"))))) 908 (error "Unexpected `starting' annotation")))))
863 909
864(defun gdb-stopping (ignored) 910(defun gdb-stopping (ignored)
865 "An annotation handler for `exited' and other annotations. 911 "An annotation handler for `breakpoint' and other annotations.
866They say that I/O for the subprocess is now GDB, not the program 912They say that I/O for the subprocess is now GDB, not the program
867being debugged." 913being debugged."
868 (if gdb-use-inferior-io-buffer 914 (if gdb-use-inferior-io-buffer
@@ -874,6 +920,15 @@ being debugged."
874 (gdb-resync) 920 (gdb-resync)
875 (error "Unexpected stopping annotation")))))) 921 (error "Unexpected stopping annotation"))))))
876 922
923(defun gdb-exited (ignored)
924 "An annotation handler for `exited' and `signalled'.
925They say that I/O for the subprocess is now GDB, not the program
926being debugged and that the program is no longer running. This
927function is used to change the focus of GUD tooltips to #define
928directives."
929 (setq gdb-active-process nil)
930 (gdb-stopping ignored))
931
877(defun gdb-frame-begin (ignored) 932(defun gdb-frame-begin (ignored)
878 (let ((sink gdb-output-sink)) 933 (let ((sink gdb-output-sink))
879 (cond 934 (cond
@@ -981,7 +1036,8 @@ happens to be appropriate."
981 (match-beginning 0)))) 1036 (match-beginning 0))))
982 ;; 1037 ;;
983 ;; Everything after, we save, to combine with later input. 1038 ;; Everything after, we save, to combine with later input.
984 (setq gud-marker-acc (substring gud-marker-acc (match-beginning 0)))) 1039 (setq gud-marker-acc (substring gud-marker-acc
1040 (match-beginning 0))))
985 ;; 1041 ;;
986 ;; In case we know the gud-marker-acc contains no partial annotations: 1042 ;; In case we know the gud-marker-acc contains no partial annotations:
987 (progn 1043 (progn
@@ -1045,7 +1101,7 @@ happens to be appropriate."
1045;; annotation rule binding of whatever gdb sends to tell us this command 1101;; annotation rule binding of whatever gdb sends to tell us this command
1046;; might have changed it's output. 1102;; might have changed it's output.
1047;; 1103;;
1048;; NAME is the function name. DEMAND-PREDICATE tests if output is really needed. 1104;; NAME is the function name. DEMAND-PREDICATE tests if output is really needed.
1049;; GDB-COMMAND is a string of such. OUTPUT-HANDLER is the function bound to the 1105;; GDB-COMMAND is a string of such. OUTPUT-HANDLER is the function bound to the
1050;; input in the input queue (see comment about ``gdb communications'' above). 1106;; input in the input queue (see comment about ``gdb communications'' above).
1051 1107
@@ -1077,8 +1133,9 @@ happens to be appropriate."
1077 ;; put customisation here 1133 ;; put customisation here
1078 (,custom-defun))) 1134 (,custom-defun)))
1079 1135
1080(defmacro def-gdb-auto-updated-buffer (buffer-key trigger-name gdb-command 1136(defmacro def-gdb-auto-updated-buffer (buffer-key
1081 output-handler-name custom-defun) 1137 trigger-name gdb-command
1138 output-handler-name custom-defun)
1082 `(progn 1139 `(progn
1083 (def-gdb-auto-update-trigger ,trigger-name 1140 (def-gdb-auto-update-trigger ,trigger-name
1084 ;; The demand predicate: 1141 ;; The demand predicate:
@@ -1225,7 +1282,7 @@ static char *magick[] = {
1225 '(mouse-face highlight 1282 '(mouse-face highlight
1226 help-echo "mouse-2, RET: visit breakpoint")) 1283 help-echo "mouse-2, RET: visit breakpoint"))
1227 (unless (file-exists-p file) 1284 (unless (file-exists-p file)
1228 (setq file (cdr (assoc bptno gdb-location-list)))) 1285 (setq file (cdr (assoc bptno gdb-location-alist))))
1229 (unless (string-equal file "File not found") 1286 (unless (string-equal file "File not found")
1230 (if file 1287 (if file
1231 (with-current-buffer (find-file-noselect file) 1288 (with-current-buffer (find-file-noselect file)
@@ -1233,13 +1290,15 @@ static char *magick[] = {
1233 'gdba) 1290 'gdba)
1234 (set (make-local-variable 'tool-bar-map) 1291 (set (make-local-variable 'tool-bar-map)
1235 gud-tool-bar-map) 1292 gud-tool-bar-map)
1236 ;; only want one breakpoint icon at each location 1293 ;; only want one breakpoint icon at each
1294 ;; location
1237 (save-excursion 1295 (save-excursion
1238 (goto-line (string-to-number line)) 1296 (goto-line (string-to-number line))
1239 (gdb-put-breakpoint-icon (eq flag ?y) bptno))) 1297 (gdb-put-breakpoint-icon (eq flag ?y) bptno)))
1240 (gdb-enqueue-input 1298 (gdb-enqueue-input
1241 (list (concat "list " 1299 (list
1242 (match-string-no-properties 1) ":1\n") 1300 (concat "list "
1301 (match-string-no-properties 1) ":1\n")
1243 'ignore)) 1302 'ignore))
1244 (gdb-enqueue-input 1303 (gdb-enqueue-input
1245 (list "info source\n" 1304 (list "info source\n"
@@ -1351,7 +1410,7 @@ static char *magick[] = {
1351 (if (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)) 1410 (if (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
1352 (looking-at "\\([0-9]+\\).*point\\s-*\\S-*\\s-*\\(.\\)") 1411 (looking-at "\\([0-9]+\\).*point\\s-*\\S-*\\s-*\\(.\\)")
1353 (looking-at 1412 (looking-at
1354 "\\([0-9]+\\)\\s-*\\S-*\\s-*\\S-*\\s-*\\(.\\)\\s-*\\S-*\\s-*\\S-*:[0-9]+")) 1413 "\\([0-9]+\\)\\s-*\\S-*\\s-*\\S-*\\s-*\\(.\\)\\s-*\\S-*\\s-*\\S-*:[0-9]+"))
1355 (gdb-enqueue-input 1414 (gdb-enqueue-input
1356 (list 1415 (list
1357 (concat gdb-server-prefix 1416 (concat gdb-server-prefix
@@ -1383,14 +1442,15 @@ static char *magick[] = {
1383 (if (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)) 1442 (if (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
1384 (looking-at "\\([0-9]+\\) .* in .* at\\s-+\\(\\S-*\\):\\([0-9]+\\)") 1443 (looking-at "\\([0-9]+\\) .* in .* at\\s-+\\(\\S-*\\):\\([0-9]+\\)")
1385 (looking-at 1444 (looking-at
1386 "\\([0-9]+\\)\\s-*\\S-*\\s-*\\S-*\\s-*.\\s-*\\S-*\\s-*\\(\\S-*\\):\\([0-9]+\\)")) 1445 "\\([0-9]+\\)\\s-*\\S-*\\s-*\\S-*\\s-*.\\s-*\\S-*\\s-*\
1446\\(\\S-*\\):\\([0-9]+\\)"))
1387 (let ((bptno (match-string 1)) 1447 (let ((bptno (match-string 1))
1388 (file (match-string 2)) 1448 (file (match-string 2))
1389 (line (match-string 3))) 1449 (line (match-string 3)))
1390 (save-selected-window 1450 (save-selected-window
1391 (let* ((buf (find-file-noselect 1451 (let* ((buf (find-file-noselect
1392 (if (file-exists-p file) file 1452 (if (file-exists-p file) file
1393 (cdr (assoc bptno gdb-location-list))))) 1453 (cdr (assoc bptno gdb-location-alist)))))
1394 (window (display-buffer buf))) 1454 (window (display-buffer buf)))
1395 (with-current-buffer buf 1455 (with-current-buffer buf
1396 (goto-line (string-to-number line)) 1456 (goto-line (string-to-number line))
@@ -1481,7 +1541,8 @@ static char *magick[] = {
1481 (interactive (list last-input-event)) 1541 (interactive (list last-input-event))
1482 (if event (mouse-set-point event)) 1542 (if event (mouse-set-point event))
1483 (gdb-enqueue-input 1543 (gdb-enqueue-input
1484 (list (concat gdb-server-prefix "frame " (gdb-get-frame-number) "\n") 'ignore)) 1544 (list (concat gdb-server-prefix "frame "
1545 (gdb-get-frame-number) "\n") 'ignore))
1485 (gud-display-frame)) 1546 (gud-display-frame))
1486 1547
1487 1548
@@ -1668,7 +1729,7 @@ static char *magick[] = {
1668 (save-selected-window 1729 (save-selected-window
1669 (select-window (posn-window (event-start event))) 1730 (select-window (posn-window (event-start event)))
1670 (let* ((arg (read-from-minibuffer "Repeat count: ")) 1731 (let* ((arg (read-from-minibuffer "Repeat count: "))
1671 (count (string-to-int arg))) 1732 (count (string-to-number arg)))
1672 (if (< count 0) 1733 (if (< count 0)
1673 (error "Non-negative numbers only") 1734 (error "Non-negative numbers only")
1674 (customize-set-variable 'gdb-memory-repeat-count count) 1735 (customize-set-variable 'gdb-memory-repeat-count count)
@@ -1976,7 +2037,8 @@ corresponding to the mode line clicked."
1976 2037
1977(let ((menu (make-sparse-keymap "GDB-Windows"))) 2038(let ((menu (make-sparse-keymap "GDB-Windows")))
1978 (define-key gud-menu-map [displays] 2039 (define-key gud-menu-map [displays]
1979 `(menu-item "GDB-Windows" ,menu :visible (eq gud-minor-mode 'gdba))) 2040 `(menu-item "GDB-Windows" ,menu
2041 :visible (memq gud-minor-mode '(gdbmi gdba))))
1980 (define-key menu [gdb] '("Gdb" . gdb-display-gdb-buffer)) 2042 (define-key menu [gdb] '("Gdb" . gdb-display-gdb-buffer))
1981 (define-key menu [threads] '("Threads" . gdb-display-threads-buffer)) 2043 (define-key menu [threads] '("Threads" . gdb-display-threads-buffer))
1982 (define-key menu [memory] '("Memory" . gdb-display-memory-buffer)) 2044 (define-key menu [memory] '("Memory" . gdb-display-memory-buffer))
@@ -1987,11 +2049,13 @@ corresponding to the mode line clicked."
1987 :enable gdb-use-inferior-io-buffer)) 2049 :enable gdb-use-inferior-io-buffer))
1988 (define-key menu [locals] '("Locals" . gdb-display-locals-buffer)) 2050 (define-key menu [locals] '("Locals" . gdb-display-locals-buffer))
1989 (define-key menu [frames] '("Stack" . gdb-display-stack-buffer)) 2051 (define-key menu [frames] '("Stack" . gdb-display-stack-buffer))
1990 (define-key menu [breakpoints] '("Breakpoints" . gdb-display-breakpoints-buffer))) 2052 (define-key menu [breakpoints]
2053 '("Breakpoints" . gdb-display-breakpoints-buffer)))
1991 2054
1992(let ((menu (make-sparse-keymap "GDB-Frames"))) 2055(let ((menu (make-sparse-keymap "GDB-Frames")))
1993 (define-key gud-menu-map [frames] 2056 (define-key gud-menu-map [frames]
1994 `(menu-item "GDB-Frames" ,menu :visible (eq gud-minor-mode 'gdba))) 2057 `(menu-item "GDB-Frames" ,menu
2058 :visible (memq gud-minor-mode '(gdbmi gdba))))
1995 (define-key menu [gdb] '("Gdb" . gdb-frame-gdb-buffer)) 2059 (define-key menu [gdb] '("Gdb" . gdb-frame-gdb-buffer))
1996 (define-key menu [threads] '("Threads" . gdb-frame-threads-buffer)) 2060 (define-key menu [threads] '("Threads" . gdb-frame-threads-buffer))
1997 (define-key menu [memory] '("Memory" . gdb-frame-memory-buffer)) 2061 (define-key menu [memory] '("Memory" . gdb-frame-memory-buffer))
@@ -2002,7 +2066,8 @@ corresponding to the mode line clicked."
2002 :enable gdb-use-inferior-io-buffer)) 2066 :enable gdb-use-inferior-io-buffer))
2003 (define-key menu [locals] '("Locals" . gdb-frame-locals-buffer)) 2067 (define-key menu [locals] '("Locals" . gdb-frame-locals-buffer))
2004 (define-key menu [frames] '("Stack" . gdb-frame-stack-buffer)) 2068 (define-key menu [frames] '("Stack" . gdb-frame-stack-buffer))
2005 (define-key menu [breakpoints] '("Breakpoints" . gdb-frame-breakpoints-buffer))) 2069 (define-key menu [breakpoints]
2070 '("Breakpoints" . gdb-frame-breakpoints-buffer)))
2006 2071
2007(let ((menu (make-sparse-keymap "GDB-UI"))) 2072(let ((menu (make-sparse-keymap "GDB-UI")))
2008 (define-key gud-menu-map [ui] 2073 (define-key gud-menu-map [ui]
@@ -2129,12 +2194,15 @@ Kills the gdb buffers and resets the source buffers."
2129 (gdb-remove-breakpoint-icons (point-min) (point-max) t) 2194 (gdb-remove-breakpoint-icons (point-min) (point-max) t)
2130 (setq gud-minor-mode nil) 2195 (setq gud-minor-mode nil)
2131 (kill-local-variable 'tool-bar-map) 2196 (kill-local-variable 'tool-bar-map)
2132 (setq gud-running nil)))))) 2197 (kill-local-variable 'gdb-define-alist))))))
2133 (when (markerp gdb-overlay-arrow-position) 2198 (when (markerp gdb-overlay-arrow-position)
2134 (move-marker gdb-overlay-arrow-position nil) 2199 (move-marker gdb-overlay-arrow-position nil)
2135 (setq gdb-overlay-arrow-position nil)) 2200 (setq gdb-overlay-arrow-position nil))
2136 (setq overlay-arrow-variable-list 2201 (setq overlay-arrow-variable-list
2137 (delq 'gdb-overlay-arrow-position overlay-arrow-variable-list))) 2202 (delq 'gdb-overlay-arrow-position overlay-arrow-variable-list))
2203 (setq gud-running nil)
2204 (setq gdb-active-process nil)
2205 (remove-hook 'after-save-hook 'gdb-create-define-alist t))
2138 2206
2139(defun gdb-source-info () 2207(defun gdb-source-info ()
2140 "Find the source file where the program starts and displays it with related 2208 "Find the source file where the program starts and displays it with related
@@ -2157,9 +2225,9 @@ Put in buffer and place breakpoint icon."
2157 (catch 'file-not-found 2225 (catch 'file-not-found
2158 (if (search-forward "Located in " nil t) 2226 (if (search-forward "Located in " nil t)
2159 (if (looking-at "\\S-*") 2227 (if (looking-at "\\S-*")
2160 (push (cons bptno (match-string 0)) gdb-location-list)) 2228 (push (cons bptno (match-string 0)) gdb-location-alist))
2161 (gdb-resync) 2229 (gdb-resync)
2162 (push (cons bptno "File not found") gdb-location-list) 2230 (push (cons bptno "File not found") gdb-location-alist)
2163 (message-box "Cannot find source file for breakpoint location.\n\ 2231 (message-box "Cannot find source file for breakpoint location.\n\
2164Add directory to search path for source files using the GDB command, dir.") 2232Add directory to search path for source files using the GDB command, dir.")
2165 (throw 'file-not-found nil)) 2233 (throw 'file-not-found nil))
@@ -2214,7 +2282,7 @@ BUFFER nil or omitted means use the current buffer."
2214 (unless buffer 2282 (unless buffer
2215 (setq buffer (current-buffer))) 2283 (setq buffer (current-buffer)))
2216 (dolist (overlay (overlays-in start end)) 2284 (dolist (overlay (overlays-in start end))
2217 (when (overlay-get overlay 'put-break) 2285 (when (overlay-get overlay 'put-break)
2218 (delete-overlay overlay)))) 2286 (delete-overlay overlay))))
2219 2287
2220(defun gdb-put-breakpoint-icon (enabled bptno) 2288(defun gdb-put-breakpoint-icon (enabled bptno)
@@ -2416,7 +2484,8 @@ BUFFER nil or omitted means use the current buffer."
2416 (setq gdb-input-queue 2484 (setq gdb-input-queue
2417 (delete item gdb-input-queue)))))) 2485 (delete item gdb-input-queue))))))
2418 (gdb-enqueue-input 2486 (gdb-enqueue-input
2419 (list (concat gdb-server-prefix "disassemble " gdb-current-address "\n") 2487 (list (concat gdb-server-prefix "disassemble "
2488 gdb-current-address "\n")
2420 'gdb-assembler-handler)) 2489 'gdb-assembler-handler))
2421 (push 'gdb-invalidate-assembler gdb-pending-triggers) 2490 (push 'gdb-invalidate-assembler gdb-pending-triggers)
2422 (setq gdb-previous-address gdb-current-address) 2491 (setq gdb-previous-address gdb-current-address)
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index ab705212397..4f5ffe0d23b 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -1,7 +1,7 @@
1;;; grep.el --- run compiler as inferior of Emacs, parse error messages 1;;; grep.el --- run compiler as inferior of Emacs, parse error messages
2 2
3;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 3;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4;; 2001, 2002, 2004 Free Software Foundation, Inc. 4;; 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
5 5
6;; Author: Roland McGrath <roland@gnu.org> 6;; Author: Roland McGrath <roland@gnu.org>
7;; Maintainer: FSF 7;; Maintainer: FSF
@@ -294,7 +294,10 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies
294 (2 compilation-line-face)) 294 (2 compilation-line-face))
295 ;; Highlight grep matches and delete markers 295 ;; Highlight grep matches and delete markers
296 ("\\(\033\\[01;41m\\)\\(.*?\\)\\(\033\\[00m\\(\033\\[K\\)?\\)" 296 ("\\(\033\\[01;41m\\)\\(.*?\\)\\(\033\\[00m\\(\033\\[K\\)?\\)"
297 (2 grep-match-face) 297 ;; Refontification does not work after the markers have been
298 ;; deleted. So we use the font-lock-face property here as Font
299 ;; Lock does not clear that.
300 (2 (list 'face nil 'font-lock-face grep-match-face))
298 ((lambda (p)) 301 ((lambda (p))
299 (progn 302 (progn
300 ;; Delete markers with `replace-match' because it updates 303 ;; Delete markers with `replace-match' because it updates
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 9a5d609c523..e98cb9eee58 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -228,6 +228,10 @@ Uses `gud-<MINOR-MODE>-directories' to find the source files."
228 (with-current-buffer buf 228 (with-current-buffer buf
229 (set (make-local-variable 'gud-minor-mode) minor-mode) 229 (set (make-local-variable 'gud-minor-mode) minor-mode)
230 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map) 230 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
231 (when (memq gud-minor-mode '(gdbmi gdba))
232 (make-local-variable 'gdb-define-alist)
233 (unless gdb-define-alist (gdb-create-define-alist))
234 (add-hook 'after-save-hook 'gdb-create-define-alist nil t))
231 (make-local-variable 'gud-keep-buffer)) 235 (make-local-variable 'gud-keep-buffer))
232 buf))) 236 buf)))
233 237
@@ -474,7 +478,7 @@ off the specialized speedbar mode."
474 478
475 ;; Extract the frame position from the marker. 479 ;; Extract the frame position from the marker.
476 gud-last-frame (cons (match-string 1 gud-marker-acc) 480 gud-last-frame (cons (match-string 1 gud-marker-acc)
477 (string-to-int (match-string 2 gud-marker-acc))) 481 (string-to-number (match-string 2 gud-marker-acc)))
478 482
479 ;; Append any text before the marker to the output we're going 483 ;; Append any text before the marker to the output we're going
480 ;; to return - we don't include the marker in this text. 484 ;; to return - we don't include the marker in this text.
@@ -775,14 +779,14 @@ SKIP is the number of chars to skip on each lines, it defaults to 0."
775 gud-marker-acc start) 779 gud-marker-acc start)
776 (setq gud-last-frame 780 (setq gud-last-frame
777 (cons (match-string 3 gud-marker-acc) 781 (cons (match-string 3 gud-marker-acc)
778 (string-to-int (match-string 4 gud-marker-acc))))) 782 (string-to-number (match-string 4 gud-marker-acc)))))
779 ;; System V Release 4.0 quite often clumps two lines together 783 ;; System V Release 4.0 quite often clumps two lines together
780 ((string-match "^\\(BREAKPOINT\\|STEPPED\\) process [0-9]+ function [^ ]+ in \\(.+\\)\n\\([0-9]+\\):" 784 ((string-match "^\\(BREAKPOINT\\|STEPPED\\) process [0-9]+ function [^ ]+ in \\(.+\\)\n\\([0-9]+\\):"
781 gud-marker-acc start) 785 gud-marker-acc start)
782 (setq gud-sdb-lastfile (match-string 2 gud-marker-acc)) 786 (setq gud-sdb-lastfile (match-string 2 gud-marker-acc))
783 (setq gud-last-frame 787 (setq gud-last-frame
784 (cons gud-sdb-lastfile 788 (cons gud-sdb-lastfile
785 (string-to-int (match-string 3 gud-marker-acc))))) 789 (string-to-number (match-string 3 gud-marker-acc)))))
786 ;; System V Release 4.0 790 ;; System V Release 4.0
787 ((string-match "^\\(BREAKPOINT\\|STEPPED\\) process [0-9]+ function [^ ]+ in \\(.+\\)\n" 791 ((string-match "^\\(BREAKPOINT\\|STEPPED\\) process [0-9]+ function [^ ]+ in \\(.+\\)\n"
788 gud-marker-acc start) 792 gud-marker-acc start)
@@ -791,7 +795,7 @@ SKIP is the number of chars to skip on each lines, it defaults to 0."
791 gud-marker-acc start)) 795 gud-marker-acc start))
792 (setq gud-last-frame 796 (setq gud-last-frame
793 (cons gud-sdb-lastfile 797 (cons gud-sdb-lastfile
794 (string-to-int (match-string 1 gud-marker-acc))))) 798 (string-to-number (match-string 1 gud-marker-acc)))))
795 (t 799 (t
796 (setq gud-sdb-lastfile nil))) 800 (setq gud-sdb-lastfile nil)))
797 (setq start (match-end 0))) 801 (setq start (match-end 0)))
@@ -877,7 +881,7 @@ containing the executable being debugged."
877 gud-marker-acc start)) 881 gud-marker-acc start))
878 (setq gud-last-frame 882 (setq gud-last-frame
879 (cons (match-string 2 gud-marker-acc) 883 (cons (match-string 2 gud-marker-acc)
880 (string-to-int (match-string 1 gud-marker-acc))) 884 (string-to-number (match-string 1 gud-marker-acc)))
881 start (match-end 0))) 885 start (match-end 0)))
882 886
883 ;; Search for the last incomplete line in this chunk 887 ;; Search for the last incomplete line in this chunk
@@ -924,7 +928,7 @@ containing the executable being debugged."
924 ;; Extract the frame position from the marker. 928 ;; Extract the frame position from the marker.
925 gud-last-frame 929 gud-last-frame
926 (cons (match-string 1 gud-marker-acc) 930 (cons (match-string 1 gud-marker-acc)
927 (string-to-int (match-string 2 gud-marker-acc))) 931 (string-to-number (match-string 2 gud-marker-acc)))
928 932
929 ;; Append any text before the marker to the output we're going 933 ;; Append any text before the marker to the output we're going
930 ;; to return - we don't include the marker in this text. 934 ;; to return - we don't include the marker in this text.
@@ -1032,7 +1036,7 @@ a better solution in 6.1 upwards.")
1032 (if (file-exists-p file) 1036 (if (file-exists-p file)
1033 (setq gud-last-frame 1037 (setq gud-last-frame
1034 (cons (match-string 1 result) 1038 (cons (match-string 1 result)
1035 (string-to-int (match-string 2 result)))))) 1039 (string-to-number (match-string 2 result))))))
1036 result) 1040 result)
1037 ((string-match ; kluged-up marker as above 1041 ((string-match ; kluged-up marker as above
1038 "\032\032\\([0-9]*\\):\\(.*\\)\n" result) 1042 "\032\032\\([0-9]*\\):\\(.*\\)\n" result)
@@ -1040,7 +1044,7 @@ a better solution in 6.1 upwards.")
1040 (if (and file (file-exists-p file)) 1044 (if (and file (file-exists-p file))
1041 (setq gud-last-frame 1045 (setq gud-last-frame
1042 (cons file 1046 (cons file
1043 (string-to-int (match-string 1 result)))))) 1047 (string-to-number (match-string 1 result))))))
1044 (setq result (substring result 0 (match-beginning 0)))))) 1048 (setq result (substring result 0 (match-beginning 0))))))
1045 (or result ""))) 1049 (or result "")))
1046 1050
@@ -1077,7 +1081,7 @@ This was tested using R4.11.")
1077 (while (string-match re gud-marker-acc start) 1081 (while (string-match re gud-marker-acc start)
1078 (setq gud-last-frame 1082 (setq gud-last-frame
1079 (cons (match-string 4 gud-marker-acc) 1083 (cons (match-string 4 gud-marker-acc)
1080 (string-to-int (match-string 3 gud-marker-acc))) 1084 (string-to-number (match-string 3 gud-marker-acc)))
1081 start (match-end 0))) 1085 start (match-end 0)))
1082 1086
1083 ;; Search for the last incomplete line in this chunk 1087 ;; Search for the last incomplete line in this chunk
@@ -1196,7 +1200,7 @@ containing the executable being debugged."
1196 result) 1200 result)
1197 (string-match "[^: \t]+:[ \t]+\\([^:]+\\): [^:]+: \\([0-9]+\\):" 1201 (string-match "[^: \t]+:[ \t]+\\([^:]+\\): [^:]+: \\([0-9]+\\):"
1198 result)) 1202 result))
1199 (let ((line (string-to-int (match-string 2 result))) 1203 (let ((line (string-to-number (match-string 2 result)))
1200 (file (gud-file-name (match-string 1 result)))) 1204 (file (gud-file-name (match-string 1 result))))
1201 (if file 1205 (if file
1202 (setq gud-last-frame (cons file line)))))) 1206 (setq gud-last-frame (cons file line))))))
@@ -1298,7 +1302,7 @@ into one that invokes an Emacs-enabled debugging session.
1298 ;; Extract the frame position from the marker. 1302 ;; Extract the frame position from the marker.
1299 gud-last-frame 1303 gud-last-frame
1300 (cons (match-string 1 gud-marker-acc) 1304 (cons (match-string 1 gud-marker-acc)
1301 (string-to-int (match-string 3 gud-marker-acc))) 1305 (string-to-number (match-string 3 gud-marker-acc)))
1302 1306
1303 ;; Append any text before the marker to the output we're going 1307 ;; Append any text before the marker to the output we're going
1304 ;; to return - we don't include the marker in this text. 1308 ;; to return - we don't include the marker in this text.
@@ -1396,7 +1400,7 @@ and source-file directory for your debugger."
1396 gud-last-frame 1400 gud-last-frame
1397 (let ((file (match-string gud-pdb-marker-regexp-file-group 1401 (let ((file (match-string gud-pdb-marker-regexp-file-group
1398 gud-marker-acc)) 1402 gud-marker-acc))
1399 (line (string-to-int 1403 (line (string-to-number
1400 (match-string gud-pdb-marker-regexp-line-group 1404 (match-string gud-pdb-marker-regexp-line-group
1401 gud-marker-acc)))) 1405 gud-marker-acc))))
1402 (if (string-equal file "<string>") 1406 (if (string-equal file "<string>")
@@ -2028,7 +2032,7 @@ nil)
2028 ;; (<file-name> . <line-number>) . 2032 ;; (<file-name> . <line-number>) .
2029 (if (if (match-beginning 1) 2033 (if (if (match-beginning 1)
2030 (let (n) 2034 (let (n)
2031 (setq n (string-to-int (substring 2035 (setq n (string-to-number (substring
2032 gud-marker-acc 2036 gud-marker-acc
2033 (1+ (match-beginning 1)) 2037 (1+ (match-beginning 1))
2034 (- (match-end 1) 2)))) 2038 (- (match-end 1) 2))))
@@ -2039,7 +2043,7 @@ nil)
2039 (gud-jdb-find-source (match-string 2 gud-marker-acc))) 2043 (gud-jdb-find-source (match-string 2 gud-marker-acc)))
2040 (setq gud-last-frame 2044 (setq gud-last-frame
2041 (cons file-found 2045 (cons file-found
2042 (string-to-int 2046 (string-to-number
2043 (let 2047 (let
2044 ((numstr (match-string 4 gud-marker-acc))) 2048 ((numstr (match-string 4 gud-marker-acc)))
2045 (if (string-match "[.,]" numstr) 2049 (if (string-match "[.,]" numstr)
@@ -2187,7 +2191,7 @@ gud, see `gud-mode'."
2187 ;; Extract the frame position from the marker. 2191 ;; Extract the frame position from the marker.
2188 gud-last-frame 2192 gud-last-frame
2189 (cons (match-string 2 gud-marker-acc) 2193 (cons (match-string 2 gud-marker-acc)
2190 (string-to-int (match-string 4 gud-marker-acc))) 2194 (string-to-number (match-string 4 gud-marker-acc)))
2191 2195
2192 ;; Append any text before the marker to the output we're going 2196 ;; Append any text before the marker to the output we're going
2193 ;; to return - we don't include the marker in this text. 2197 ;; to return - we don't include the marker in this text.
@@ -2977,6 +2981,7 @@ class of the file (using s to separate nested class ids)."
2977 (message "gud-find-class: class for file %s not found in gud-jdb-class-source-alist!" f) 2981 (message "gud-find-class: class for file %s not found in gud-jdb-class-source-alist!" f)
2978 nil)))) 2982 nil))))
2979 2983
2984
2980;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2985;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2981;;; GDB script mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2986;;; GDB script mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2982;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2987;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el
index 06ad2d591ad..083d87f581c 100644
--- a/lisp/progmodes/inf-lisp.el
+++ b/lisp/progmodes/inf-lisp.el
@@ -167,7 +167,7 @@ and franz. This variable is used to initialize `comint-prompt-regexp' in the
167Inferior Lisp buffer. 167Inferior Lisp buffer.
168 168
169This variable is only used if the variable 169This variable is only used if the variable
170`comint-use-prompt-regexp-instead-of-fields' is non-nil. 170`comint-use-prompt-regexp' is non-nil.
171 171
172More precise choices: 172More precise choices:
173Lucid Common Lisp: \"^\\\\(>\\\\|\\\\(->\\\\)+\\\\) *\" 173Lucid Common Lisp: \"^\\\\(>\\\\|\\\\(->\\\\)+\\\\) *\"
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 5073f2bc23a..3f556bdb695 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1680,7 +1680,7 @@ Repeating the command scrolls the completion window."
1680;;;; Modes. 1680;;;; Modes.
1681 1681
1682(defvar outline-heading-end-regexp) 1682(defvar outline-heading-end-regexp)
1683(defvar eldoc-print-current-symbol-info-function) 1683(defvar eldoc-documentation-function)
1684 1684
1685;;;###autoload 1685;;;###autoload
1686(define-derived-mode python-mode fundamental-mode "Python" 1686(define-derived-mode python-mode fundamental-mode "Python"
@@ -1740,7 +1740,7 @@ lines count as headers.
1740 'python-beginning-of-defun) 1740 'python-beginning-of-defun)
1741 (set (make-local-variable 'end-of-defun-function) 'python-end-of-defun) 1741 (set (make-local-variable 'end-of-defun-function) 'python-end-of-defun)
1742 (setq imenu-create-index-function #'python-imenu-create-index) 1742 (setq imenu-create-index-function #'python-imenu-create-index)
1743 (set (make-local-variable 'eldoc-print-current-symbol-info-function) 1743 (set (make-local-variable 'eldoc-documentation-function)
1744 #'python-eldoc-function) 1744 #'python-eldoc-function)
1745 (add-hook 'eldoc-mode-hook 1745 (add-hook 'eldoc-mode-hook
1746 '(lambda () (run-python 0 t)) nil t) ; need it running 1746 '(lambda () (run-python 0 t)) nil t) ; need it running
diff --git a/lisp/recentf.el b/lisp/recentf.el
index 40a9204267e..cf61b688eb5 100644
--- a/lisp/recentf.el
+++ b/lisp/recentf.el
@@ -1137,6 +1137,12 @@ default."
1137 ";;; Automatically generated by `recentf' on %s.\n" 1137 ";;; Automatically generated by `recentf' on %s.\n"
1138 "Header to be written into the `recentf-save-file'.") 1138 "Header to be written into the `recentf-save-file'.")
1139 1139
1140(defconst recentf-save-file-coding-system
1141 (if (coding-system-p 'utf-8-emacs)
1142 'utf-8-emacs
1143 'emacs-mule)
1144 "Coding system of the file `recentf-save-file'.")
1145
1140(defun recentf-save-list () 1146(defun recentf-save-list ()
1141 "Save the recent list. 1147 "Save the recent list.
1142Write data into the file specified by `recentf-save-file'." 1148Write data into the file specified by `recentf-save-file'."
@@ -1144,9 +1150,13 @@ Write data into the file specified by `recentf-save-file'."
1144 (condition-case error 1150 (condition-case error
1145 (with-temp-buffer 1151 (with-temp-buffer
1146 (erase-buffer) 1152 (erase-buffer)
1153 (set-buffer-file-coding-system recentf-save-file-coding-system)
1147 (insert (format recentf-save-file-header (current-time-string))) 1154 (insert (format recentf-save-file-header (current-time-string)))
1148 (recentf-dump-variable 'recentf-list recentf-max-saved-items) 1155 (recentf-dump-variable 'recentf-list recentf-max-saved-items)
1149 (recentf-dump-variable 'recentf-filter-changer-state) 1156 (recentf-dump-variable 'recentf-filter-changer-state)
1157 (insert "\n \n;;; Local Variables:\n"
1158 (format ";;; coding: %s\n" recentf-save-file-coding-system)
1159 ";;; End:\n")
1150 (write-file (expand-file-name recentf-save-file)) 1160 (write-file (expand-file-name recentf-save-file))
1151 nil) 1161 nil)
1152 (error 1162 (error
@@ -1207,6 +1217,6 @@ that were operated on recently."
1207(provide 'recentf) 1217(provide 'recentf)
1208 1218
1209(run-hooks 'recentf-load-hook) 1219(run-hooks 'recentf-load-hook)
1210 1220
1211;;; arch-tag: 78f1eec9-0d16-4d19-a4eb-2e4529edb62a 1221;;; arch-tag: 78f1eec9-0d16-4d19-a4eb-2e4529edb62a
1212;;; recentf.el ends here 1222;;; recentf.el ends here
diff --git a/lisp/saveplace.el b/lisp/saveplace.el
index cb61c8383b5..9dc7b858e37 100644
--- a/lisp/saveplace.el
+++ b/lisp/saveplace.el
@@ -166,7 +166,8 @@ To save places automatically in all files, put this in your `.emacs' file:
166 (let ((cell (assoc buffer-file-name save-place-alist)) 166 (let ((cell (assoc buffer-file-name save-place-alist))
167 (position (if (not (eq major-mode 'hexl-mode)) 167 (position (if (not (eq major-mode 'hexl-mode))
168 (point) 168 (point)
169 (1+ (hexl-current-address))))) 169 (with-no-warnings
170 (1+ (hexl-current-address))))))
170 (if cell 171 (if cell
171 (setq save-place-alist (delq cell save-place-alist))) 172 (setq save-place-alist (delq cell save-place-alist)))
172 (if (and save-place 173 (if (and save-place
diff --git a/lisp/shell.el b/lisp/shell.el
index 1817a1fd3b4..354ed88f80f 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -136,8 +136,9 @@ Defaults to \"^[^#$%>\\n]*[#$%>] *\", which works pretty well.
136This variable is used to initialise `comint-prompt-regexp' in the 136This variable is used to initialise `comint-prompt-regexp' in the
137shell buffer. 137shell buffer.
138 138
139This variable is only used if the variable 139If `comint-use-prompt-regexp' is nil, then this variable is only used
140`comint-use-prompt-regexp-instead-of-fields' is non-nil. 140to determine paragraph boundaries. See Info node `Shell Prompts' for
141how Shell mode treats paragraphs.
141 142
142The pattern should probably not match more than one line. If it does, 143The pattern should probably not match more than one line. If it does,
143Shell mode may become confused trying to distinguish prompt from input 144Shell mode may become confused trying to distinguish prompt from input
@@ -422,6 +423,7 @@ buffer."
422 (setq comint-file-name-chars shell-file-name-chars) 423 (setq comint-file-name-chars shell-file-name-chars)
423 (setq comint-file-name-quote-list shell-file-name-quote-list) 424 (setq comint-file-name-quote-list shell-file-name-quote-list)
424 (setq comint-dynamic-complete-functions shell-dynamic-complete-functions) 425 (setq comint-dynamic-complete-functions shell-dynamic-complete-functions)
426 (set (make-local-variable 'paragraph-separate) "\\'")
425 (make-local-variable 'paragraph-start) 427 (make-local-variable 'paragraph-start)
426 (setq paragraph-start comint-prompt-regexp) 428 (setq paragraph-start comint-prompt-regexp)
427 (make-local-variable 'font-lock-defaults) 429 (make-local-variable 'font-lock-defaults)
diff --git a/lisp/simple.el b/lisp/simple.el
index 2d10e68f6b9..011c1970f82 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -113,7 +113,9 @@ If `fringe-arrow', indicate the locus by the fringe arrow."
113(defvar next-error-highlight-timer nil) 113(defvar next-error-highlight-timer nil)
114 114
115(defvar next-error-overlay-arrow-position nil) 115(defvar next-error-overlay-arrow-position nil)
116(put 'next-error-overlay-arrow-position 'overlay-arrow-string "=>") 116;; This is nil so as not to really display anything on text
117;; terminals. On text terminals, it would hide part of the file name.
118(put 'next-error-overlay-arrow-position 'overlay-arrow-string "")
117(add-to-list 'overlay-arrow-variable-list 'next-error-overlay-arrow-position) 119(add-to-list 'overlay-arrow-variable-list 'next-error-overlay-arrow-position)
118 120
119(defvar next-error-last-buffer nil 121(defvar next-error-last-buffer nil
@@ -3199,6 +3201,14 @@ Invoke \\[apropos-documentation] and type \"transient\" or
3199commands which are sensitive to the Transient Mark mode." 3201commands which are sensitive to the Transient Mark mode."
3200 :global t :group 'editing-basics :require nil) 3202 :global t :group 'editing-basics :require nil)
3201 3203
3204(defvar widen-automatically t
3205 "Non-nil means it is ok for commands to call `widen' when they want to.
3206Some commands will do this in order to go to positions outside
3207the current accessible part of the buffer.
3208
3209If `widen-automatically' is nil, these commands will do something else
3210as a fallback, and won't change the buffer bounds.")
3211
3202(defun pop-global-mark () 3212(defun pop-global-mark ()
3203 "Pop off global mark ring and jump to the top location." 3213 "Pop off global mark ring and jump to the top location."
3204 (interactive) 3214 (interactive)
@@ -3215,7 +3225,9 @@ commands which are sensitive to the Transient Mark mode."
3215 (set-buffer buffer) 3225 (set-buffer buffer)
3216 (or (and (>= position (point-min)) 3226 (or (and (>= position (point-min))
3217 (<= position (point-max))) 3227 (<= position (point-max)))
3218 (widen)) 3228 (if widen-automatically
3229 (error "Global mark position is outside accessible part of buffer")
3230 (widen)))
3219 (goto-char position) 3231 (goto-char position)
3220 (switch-to-buffer buffer))) 3232 (switch-to-buffer buffer)))
3221 3233
@@ -3403,19 +3415,37 @@ Outline mode sets this."
3403 (goto-char (next-char-property-change (point)))) 3415 (goto-char (next-char-property-change (point))))
3404 ;; Now move a line. 3416 ;; Now move a line.
3405 (end-of-line) 3417 (end-of-line)
3406 (and (zerop (vertical-motion 1)) 3418 ;; If there's no invisibility here, move over the newline.
3407 (if (not noerror) 3419 (if (not (line-move-invisible-p (point)))
3408 (signal 'end-of-buffer nil) 3420 ;; We avoid vertical-motion when possible
3409 (setq done t))) 3421 ;; because that has to fontify.
3422 (if (eobp)
3423 (if (not noerror)
3424 (signal 'end-of-buffer nil)
3425 (setq done t))
3426 (forward-line 1))
3427 ;; Otherwise move a more sophisticated way.
3428 ;; (What's the logic behind this code?)
3429 (and (zerop (vertical-motion 1))
3430 (if (not noerror)
3431 (signal 'end-of-buffer nil)
3432 (setq done t))))
3410 (unless done 3433 (unless done
3411 (setq arg (1- arg)))) 3434 (setq arg (1- arg))))
3435 ;; The logic of this is the same as the loop above,
3436 ;; it just goes in the other direction.
3412 (while (and (< arg 0) (not done)) 3437 (while (and (< arg 0) (not done))
3413 (beginning-of-line) 3438 (beginning-of-line)
3414 3439 (if (or (bobp) (not (line-move-invisible-p (1- (point)))))
3415 (if (zerop (vertical-motion -1)) 3440 (if (bobp)
3416 (if (not noerror) 3441 (if (not noerror)
3417 (signal 'beginning-of-buffer nil) 3442 (signal 'beginning-of-buffer nil)
3418 (setq done t))) 3443 (setq done t))
3444 (forward-line -1))
3445 (if (zerop (vertical-motion -1))
3446 (if (not noerror)
3447 (signal 'beginning-of-buffer nil)
3448 (setq done t))))
3419 (unless done 3449 (unless done
3420 (setq arg (1+ arg)) 3450 (setq arg (1+ arg))
3421 (while (and ;; Don't move over previous invis lines 3451 (while (and ;; Don't move over previous invis lines
diff --git a/lisp/startup.el b/lisp/startup.el
index 46c44acbe23..2d1b27f4bd1 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -995,7 +995,8 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
995 ;; the session manager and we have a session manager connection. 995 ;; the session manager and we have a session manager connection.
996 (if (and (boundp 'x-session-previous-id) 996 (if (and (boundp 'x-session-previous-id)
997 (stringp x-session-previous-id)) 997 (stringp x-session-previous-id))
998 (emacs-session-restore x-session-previous-id))) 998 (with-no-warnings
999 (emacs-session-restore x-session-previous-id))))
999 1000
1000(defcustom initial-scratch-message (purecopy "\ 1001(defcustom initial-scratch-message (purecopy "\
1001;; This buffer is for notes you don't want to save, and for Lisp evaluation. 1002;; This buffer is for notes you don't want to save, and for Lisp evaluation.
diff --git a/lisp/subr.el b/lisp/subr.el
index b9ea857715c..1c2c01e6b16 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -753,35 +753,16 @@ and `event-end' functions."
753 753
754;;;; Obsolescent names for functions. 754;;;; Obsolescent names for functions.
755 755
756(defalias 'dot 'point)
757(defalias 'dot-marker 'point-marker)
758(defalias 'dot-min 'point-min)
759(defalias 'dot-max 'point-max)
760(defalias 'window-dot 'window-point) 756(defalias 'window-dot 'window-point)
761(defalias 'set-window-dot 'set-window-point) 757(defalias 'set-window-dot 'set-window-point)
762(defalias 'read-input 'read-string) 758(defalias 'read-input 'read-string)
763(defalias 'send-string 'process-send-string) 759(defalias 'send-string 'process-send-string)
764(defalias 'send-region 'process-send-region) 760(defalias 'send-region 'process-send-region)
765(defalias 'show-buffer 'set-window-buffer) 761(defalias 'show-buffer 'set-window-buffer)
766(defalias 'buffer-flush-undo 'buffer-disable-undo)
767(defalias 'eval-current-buffer 'eval-buffer) 762(defalias 'eval-current-buffer 'eval-buffer)
768(defalias 'compiled-function-p 'byte-code-function-p)
769(defalias 'define-function 'defalias)
770 763
771(defalias 'sref 'aref)
772(make-obsolete 'sref 'aref "20.4")
773(make-obsolete 'char-bytes "now always returns 1." "20.4") 764(make-obsolete 'char-bytes "now always returns 1." "20.4")
774(make-obsolete 'chars-in-region "use (abs (- BEG END))." "20.3")
775(make-obsolete 'dot 'point "before 19.15")
776(make-obsolete 'dot-max 'point-max "before 19.15")
777(make-obsolete 'dot-min 'point-min "before 19.15")
778(make-obsolete 'dot-marker 'point-marker "before 19.15")
779(make-obsolete 'buffer-flush-undo 'buffer-disable-undo "before 19.15")
780(make-obsolete 'baud-rate "use the `baud-rate' variable instead." "before 19.15") 765(make-obsolete 'baud-rate "use the `baud-rate' variable instead." "before 19.15")
781(make-obsolete 'compiled-function-p 'byte-code-function-p "before 19.15")
782(make-obsolete 'define-function 'defalias "20.1")
783(make-obsolete 'focus-frame "it does nothing." "19.32")
784(make-obsolete 'unfocus-frame "it does nothing." "19.32")
785 766
786(defun insert-string (&rest args) 767(defun insert-string (&rest args)
787 "Mocklisp-compatibility insert function. 768 "Mocklisp-compatibility insert function.
@@ -798,9 +779,6 @@ is converted into a string by expressing it in decimal."
798 "Return the value of the `baud-rate' variable." 779 "Return the value of the `baud-rate' variable."
799 baud-rate) 780 baud-rate)
800 781
801(defalias 'focus-frame 'ignore "")
802(defalias 'unfocus-frame 'ignore "")
803
804 782
805;;;; Obsolescence declarations for variables, and aliases. 783;;;; Obsolescence declarations for variables, and aliases.
806 784
@@ -809,12 +787,15 @@ is converted into a string by expressing it in decimal."
809(make-obsolete-variable 'unread-command-char 787(make-obsolete-variable 'unread-command-char
810 "use `unread-command-events' instead. That variable is a list of events to reread, so it now uses nil to mean `no event', instead of -1." 788 "use `unread-command-events' instead. That variable is a list of events to reread, so it now uses nil to mean `no event', instead of -1."
811 "before 19.15") 789 "before 19.15")
812(make-obsolete-variable 'executing-macro 'executing-kbd-macro "before 19.34")
813(make-obsolete-variable 'post-command-idle-hook 790(make-obsolete-variable 'post-command-idle-hook
814 "use timers instead, with `run-with-idle-timer'." "before 19.34") 791 "use timers instead, with `run-with-idle-timer'." "before 19.34")
815(make-obsolete-variable 'post-command-idle-delay 792(make-obsolete-variable 'post-command-idle-delay
816 "use timers instead, with `run-with-idle-timer'." "before 19.34") 793 "use timers instead, with `run-with-idle-timer'." "before 19.34")
817 794
795;; Lisp manual only updated in 22.1.
796(define-obsolete-variable-alias 'executing-macro 'executing-kbd-macro
797 "before 19.34")
798
818(defvaralias 'x-lost-selection-hooks 'x-lost-selection-functions) 799(defvaralias 'x-lost-selection-hooks 'x-lost-selection-functions)
819(make-obsolete-variable 'x-lost-selection-hooks 'x-lost-selection-functions "22.1") 800(make-obsolete-variable 'x-lost-selection-hooks 'x-lost-selection-functions "22.1")
820(defvaralias 'x-sent-selection-hooks 'x-sent-selection-functions) 801(defvaralias 'x-sent-selection-hooks 'x-sent-selection-functions)
@@ -843,7 +824,7 @@ is converted into a string by expressing it in decimal."
843 824
844;;; Should this be an obsolete name? If you decide it should, you get 825;;; Should this be an obsolete name? If you decide it should, you get
845;;; to go through all the sources and change them. 826;;; to go through all the sources and change them.
846(defalias 'string-to-int 'string-to-number) 827(define-obsolete-function-alias 'string-to-int 'string-to-number)
847 828
848;;;; Hook manipulation functions. 829;;;; Hook manipulation functions.
849 830
@@ -2279,7 +2260,8 @@ from `standard-syntax-table' otherwise."
2279 table)) 2260 table))
2280 2261
2281(defun syntax-after (pos) 2262(defun syntax-after (pos)
2282 "Return the raw syntax of the char after POS." 2263 "Return the raw syntax of the char after POS.
2264If POS is outside the buffer's accessible portion, return nil."
2283 (unless (or (< pos (point-min)) (>= pos (point-max))) 2265 (unless (or (< pos (point-min)) (>= pos (point-max)))
2284 (let ((st (if parse-sexp-lookup-properties 2266 (let ((st (if parse-sexp-lookup-properties
2285 (get-char-property pos 'syntax-table)))) 2267 (get-char-property pos 'syntax-table))))
@@ -2287,22 +2269,23 @@ from `standard-syntax-table' otherwise."
2287 (aref (or st (syntax-table)) (char-after pos)))))) 2269 (aref (or st (syntax-table)) (char-after pos))))))
2288 2270
2289(defun syntax-class (syntax) 2271(defun syntax-class (syntax)
2290 "Return the syntax class part of the syntax descriptor SYNTAX." 2272 "Return the syntax class part of the syntax descriptor SYNTAX.
2291 (logand (car syntax) 255)) 2273If SYNTAX is nil, return nil."
2274 (and syntax (logand (car syntax) 65535)))
2292 2275
2293(defun add-to-invisibility-spec (arg) 2276(defun add-to-invisibility-spec (element)
2294 "Add elements to `buffer-invisibility-spec'. 2277 "Add ELEMENT to `buffer-invisibility-spec'.
2295See documentation for `buffer-invisibility-spec' for the kind of elements 2278See documentation for `buffer-invisibility-spec' for the kind of elements
2296that can be added." 2279that can be added."
2297 (if (eq buffer-invisibility-spec t) 2280 (if (eq buffer-invisibility-spec t)
2298 (setq buffer-invisibility-spec (list t))) 2281 (setq buffer-invisibility-spec (list t)))
2299 (setq buffer-invisibility-spec 2282 (setq buffer-invisibility-spec
2300 (cons arg buffer-invisibility-spec))) 2283 (cons element buffer-invisibility-spec)))
2301 2284
2302(defun remove-from-invisibility-spec (arg) 2285(defun remove-from-invisibility-spec (element)
2303 "Remove elements from `buffer-invisibility-spec'." 2286 "Remove ELEMENT from `buffer-invisibility-spec'."
2304 (if (consp buffer-invisibility-spec) 2287 (if (consp buffer-invisibility-spec)
2305 (setq buffer-invisibility-spec (delete arg buffer-invisibility-spec)))) 2288 (setq buffer-invisibility-spec (delete element buffer-invisibility-spec))))
2306 2289
2307(defun global-set-key (key command) 2290(defun global-set-key (key command)
2308 "Give KEY a global binding as COMMAND. 2291 "Give KEY a global binding as COMMAND.
@@ -2376,15 +2359,34 @@ macros."
2376 (eq (car-safe object) 'lambda))) 2359 (eq (car-safe object) 'lambda)))
2377 2360
2378(defun assq-delete-all (key alist) 2361(defun assq-delete-all (key alist)
2379 "Delete from ALIST all elements whose car is KEY. 2362 "Delete from ALIST all elements whose car is `eq' to KEY.
2380Return the modified alist. 2363Return the modified alist.
2381Elements of ALIST that are not conses are ignored." 2364Elements of ALIST that are not conses are ignored."
2382 (let ((tail alist)) 2365 (while (and (consp (car alist))
2383 (while tail 2366 (eq (car (car alist)) key))
2384 (if (and (consp (car tail)) (eq (car (car tail)) key)) 2367 (setq alist (cdr alist)))
2385 (setq alist (delq (car tail) alist))) 2368 (let ((tail alist) tail-cdr)
2386 (setq tail (cdr tail))) 2369 (while (setq tail-cdr (cdr tail))
2387 alist)) 2370 (if (and (consp (car tail-cdr))
2371 (eq (car (car tail-cdr)) key))
2372 (setcdr tail (cdr tail-cdr))
2373 (setq tail tail-cdr))))
2374 alist)
2375
2376(defun rassq-delete-all (value alist)
2377 "Delete from ALIST all elements whose cdr is `eq' to VALUE.
2378Return the modified alist.
2379Elements of ALIST that are not conses are ignored."
2380 (while (and (consp (car alist))
2381 (eq (cdr (car alist)) value))
2382 (setq alist (cdr alist)))
2383 (let ((tail alist) tail-cdr)
2384 (while (setq tail-cdr (cdr tail))
2385 (if (and (consp (car tail-cdr))
2386 (eq (cdr (car tail-cdr)) value))
2387 (setcdr tail (cdr tail-cdr))
2388 (setq tail tail-cdr))))
2389 alist)
2388 2390
2389(defun make-temp-file (prefix &optional dir-flag suffix) 2391(defun make-temp-file (prefix &optional dir-flag suffix)
2390 "Create a temporary file. 2392 "Create a temporary file.
diff --git a/lisp/term.el b/lisp/term.el
index 8cfc11f3dba..1e04f7ac015 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -711,9 +711,10 @@ Buffer local variable.")
711 :group 'term 711 :group 'term
712 :type 'string) 712 :type 'string)
713 713
714;;; Use the same colors that xterm uses, see `xterm-standard-colors'.
714(defvar ansi-term-color-vector 715(defvar ansi-term-color-vector
715 [unspecified "black" "red" "green" "yellow" "blue" 716 [unspecified "black" "red3" "green3" "yellow3" "blue2"
716 "magenta" "cyan" "white"]) 717 "magenta3" "cyan3" "white"])
717 718
718;;; Inspiration came from comint.el -mm 719;;; Inspiration came from comint.el -mm
719(defvar term-buffer-maximum-size 2048 720(defvar term-buffer-maximum-size 2048
@@ -886,7 +887,9 @@ is buffer-local.")
886 (i 0)) 887 (i 0))
887 (while (< i 128) 888 (while (< i 128)
888 (define-key map (make-string 1 i) 'term-send-raw) 889 (define-key map (make-string 1 i) 'term-send-raw)
889 (define-key esc-map (make-string 1 i) 'term-send-raw-meta) 890 ;; Avoid O and [. They are used in escape sequences for various keys.
891 (unless (or (eq i ?O) (eq i 91))
892 (define-key esc-map (make-string 1 i) 'term-send-raw-meta))
890 (setq i (1+ i))) 893 (setq i (1+ i)))
891 (define-key map "\e" esc-map) 894 (define-key map "\e" esc-map)
892 (setq term-raw-map map) 895 (setq term-raw-map map)
@@ -907,6 +910,7 @@ is buffer-local.")
907 (define-key term-raw-map [right] 'term-send-right) 910 (define-key term-raw-map [right] 'term-send-right)
908 (define-key term-raw-map [left] 'term-send-left) 911 (define-key term-raw-map [left] 'term-send-left)
909 (define-key term-raw-map [delete] 'term-send-del) 912 (define-key term-raw-map [delete] 'term-send-del)
913 (define-key term-raw-map [deletechar] 'term-send-del)
910 (define-key term-raw-map [backspace] 'term-send-backspace) 914 (define-key term-raw-map [backspace] 'term-send-backspace)
911 (define-key term-raw-map [home] 'term-send-home) 915 (define-key term-raw-map [home] 'term-send-home)
912 (define-key term-raw-map [end] 'term-send-end) 916 (define-key term-raw-map [end] 'term-send-end)
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el
index d5f1e273988..2c5684091ad 100644
--- a/lisp/term/mac-win.el
+++ b/lisp/term/mac-win.el
@@ -74,7 +74,7 @@
74(require 'mouse) 74(require 'mouse)
75(require 'scroll-bar) 75(require 'scroll-bar)
76(require 'faces) 76(require 'faces)
77;;(require 'select) 77(require 'select)
78(require 'menu-bar) 78(require 'menu-bar)
79(require 'fontset) 79(require 'fontset)
80(require 'dnd) 80(require 'dnd)
@@ -1143,23 +1143,232 @@ correspoinding TextEncodingBase value."
1143 1143
1144(define-key special-event-map [language-change] 'mac-handle-language-change) 1144(define-key special-event-map [language-change] 'mac-handle-language-change)
1145 1145
1146;;;; Selections and cut buffers 1146;;;; Selections and Services menu
1147 1147
1148;; Setup to use the Mac clipboard. The functions mac-cut-function and 1148;; Setup to use the Mac clipboard.
1149;; mac-paste-function are defined in mac.c. 1149(set-selection-coding-system mac-system-coding-system)
1150(set-selection-coding-system 'compound-text-mac) 1150
1151 1151;;; We keep track of the last text selected here, so we can check the
1152(setq interprogram-cut-function 1152;;; current selection against it, and avoid passing back our own text
1153 '(lambda (str push) 1153;;; from x-get-selection-value.
1154 (mac-cut-function 1154(defvar x-last-selected-text-clipboard nil
1155 (encode-coding-string str selection-coding-system t) push))) 1155 "The value of the CLIPBOARD selection last time we selected or
1156 1156pasted text.")
1157(setq interprogram-paste-function 1157(defvar x-last-selected-text-primary nil
1158 '(lambda () 1158 "The value of the PRIMARY X selection last time we selected or
1159 (let ((clipboard (mac-paste-function))) 1159pasted text.")
1160 (if clipboard 1160
1161 (decode-coding-string clipboard selection-coding-system t))))) 1161(defcustom x-select-enable-clipboard t
1162 1162 "*Non-nil means cutting and pasting uses the clipboard.
1163This is in addition to the primary selection."
1164 :type 'boolean
1165 :group 'killing)
1166
1167;;; Make TEXT, a string, the primary X selection.
1168(defun x-select-text (text &optional push)
1169 (x-set-selection 'PRIMARY text)
1170 (setq x-last-selected-text-primary text)
1171 (when x-select-enable-clipboard
1172 (x-set-selection 'CLIPBOARD text)
1173 (setq x-last-selected-text-clipboard text))
1174 )
1175
1176(defun x-get-selection (&optional type data-type)
1177 "Return the value of a selection.
1178The argument TYPE (default `PRIMARY') says which selection,
1179and the argument DATA-TYPE (default `STRING') says
1180how to convert the data.
1181
1182TYPE may be any symbol \(but nil stands for `PRIMARY'). However,
1183only a few symbols are commonly used. They conventionally have
1184all upper-case names. The most often used ones, in addition to
1185`PRIMARY', are `SECONDARY' and `CLIPBOARD'.
1186
1187DATA-TYPE is usually `STRING', but can also be one of the symbols
1188in `selection-converter-alist', which see."
1189 (let ((data (x-get-selection-internal (or type 'PRIMARY)
1190 (or data-type 'STRING)))
1191 (coding (or next-selection-coding-system
1192 selection-coding-system)))
1193 (when (and (stringp data)
1194 (setq data-type (get-text-property 0 'foreign-selection data)))
1195 (cond ((eq data-type 'public.utf16-plain-text)
1196 (let ((encoded (and (fboundp 'mac-code-convert-string)
1197 (mac-code-convert-string data
1198 'utf-16 coding))))
1199 (if encoded
1200 (let ((coding-save last-coding-system-used))
1201 (setq data (decode-coding-string encoded coding))
1202 (setq last-coding-system-used coding-save))
1203 (setq data
1204 (decode-coding-string data 'utf-16)))))
1205 ((eq data-type 'com.apple.traditional-mac-plain-text)
1206 (setq data (decode-coding-string data coding))))
1207 (put-text-property 0 (length data) 'foreign-selection data-type data))
1208 data))
1209
1210(defun x-selection-value (type)
1211 (let (text tiff-image)
1212 (setq text (condition-case nil
1213 (x-get-selection type 'public.utf16-plain-text)
1214 (error nil)))
1215 (if (not text)
1216 (setq text (condition-case nil
1217 (x-get-selection type
1218 'com.apple.traditional-mac-plain-text)
1219 (error nil))))
1220 (if text
1221 (remove-text-properties 0 (length text) '(foreign-selection nil) text))
1222 (setq tiff-image (condition-case nil
1223 (x-get-selection type 'public.tiff)
1224 (error nil)))
1225 (when tiff-image
1226 (remove-text-properties 0 (length tiff-image)
1227 '(foreign-selection nil) tiff-image)
1228 (setq tiff-image (create-image tiff-image 'tiff t))
1229 (or text (setq text " "))
1230 (put-text-property 0 (length text) 'display tiff-image text))
1231 text))
1232
1233;;; Return the value of the current selection.
1234;;; Treat empty strings as if they were unset.
1235;;; If this function is called twice and finds the same text,
1236;;; it returns nil the second time. This is so that a single
1237;;; selection won't be added to the kill ring over and over.
1238(defun x-get-selection-value ()
1239 (let (clip-text primary-text)
1240 (when x-select-enable-clipboard
1241 (setq clip-text (x-selection-value 'CLIPBOARD))
1242 (if (string= clip-text "") (setq clip-text nil))
1243
1244 ;; Check the CLIPBOARD selection for 'newness', is it different
1245 ;; from what we remebered them to be last time we did a
1246 ;; cut/paste operation.
1247 (setq clip-text
1248 (cond;; check clipboard
1249 ((or (not clip-text) (string= clip-text ""))
1250 (setq x-last-selected-text-clipboard nil))
1251 ((eq clip-text x-last-selected-text-clipboard) nil)
1252 ((string= clip-text x-last-selected-text-clipboard)
1253 ;; Record the newer string,
1254 ;; so subsequent calls can use the `eq' test.
1255 (setq x-last-selected-text-clipboard clip-text)
1256 nil)
1257 (t
1258 (setq x-last-selected-text-clipboard clip-text))))
1259 )
1260
1261 (setq primary-text (x-selection-value 'PRIMARY))
1262 ;; Check the PRIMARY selection for 'newness', is it different
1263 ;; from what we remebered them to be last time we did a
1264 ;; cut/paste operation.
1265 (setq primary-text
1266 (cond;; check primary selection
1267 ((or (not primary-text) (string= primary-text ""))
1268 (setq x-last-selected-text-primary nil))
1269 ((eq primary-text x-last-selected-text-primary) nil)
1270 ((string= primary-text x-last-selected-text-primary)
1271 ;; Record the newer string,
1272 ;; so subsequent calls can use the `eq' test.
1273 (setq x-last-selected-text-primary primary-text)
1274 nil)
1275 (t
1276 (setq x-last-selected-text-primary primary-text))))
1277
1278 ;; As we have done one selection, clear this now.
1279 (setq next-selection-coding-system nil)
1280
1281 ;; At this point we have recorded the current values for the
1282 ;; selection from clipboard (if we are supposed to) and primary,
1283 ;; So return the first one that has changed (which is the first
1284 ;; non-null one).
1285 (or clip-text primary-text)
1286 ))
1287
1288(put 'CLIPBOARD 'mac-scrap-name "com.apple.scrap.clipboard")
1289(if (eq system-type 'darwin)
1290 (put 'FIND 'mac-scrap-name "com.apple.scrap.find"))
1291(put 'com.apple.traditional-mac-plain-text 'mac-ostype "TEXT")
1292(put 'public.utf16-plain-text 'mac-ostype "utxt")
1293(put 'public.tiff 'mac-ostype "TIFF")
1294
1295(defun mac-select-convert-to-string (selection type value)
1296 (let ((str (cdr (xselect-convert-to-string selection nil value)))
1297 coding)
1298 (setq coding (or next-selection-coding-system selection-coding-system))
1299 (if coding
1300 (setq coding (coding-system-base coding))
1301 (setq coding 'raw-text))
1302 (when str
1303 ;; If TYPE is nil, this is a local request, thus return STR as
1304 ;; is. Otherwise, encode STR.
1305 (if (not type)
1306 str
1307 (let ((inhibit-read-only t))
1308 (remove-text-properties 0 (length str) '(composition nil) str)
1309 (cond
1310 ((eq type 'public.utf16-plain-text)
1311 (let (s)
1312 (when (and (fboundp 'mac-code-convert-string)
1313 (memq coding (find-coding-systems-string str)))
1314 (setq coding (coding-system-change-eol-conversion coding 'mac))
1315 (setq s (mac-code-convert-string
1316 (encode-coding-string str coding)
1317 coding 'utf-16)))
1318 (setq str (or s (encode-coding-string str 'utf-16-mac)))))
1319 ((eq type 'com.apple.traditional-mac-plain-text)
1320 (setq coding (coding-system-change-eol-conversion coding 'mac))
1321 (setq str (encode-coding-string str coding)))
1322 (t
1323 (error "Unknown selection type: %S" type))
1324 )))
1325
1326 (setq next-selection-coding-system nil)
1327 (cons type str))))
1328
1329(setq selection-converter-alist
1330 (nconc
1331 '((public.utf16-plain-text . mac-select-convert-to-string)
1332 (com.apple.traditional-mac-plain-text . mac-select-convert-to-string)
1333 ;; This is not enabled by default because the `Import Image'
1334 ;; menu makes Emacs crash or hang for unknown reasons.
1335 ;; (public.tiff . nil)
1336 )
1337 selection-converter-alist))
1338
1339(defun mac-services-open-file ()
1340 (interactive)
1341 (find-file-existing (x-selection-value mac-services-selection)))
1342
1343(defun mac-services-open-selection ()
1344 (interactive)
1345 (switch-to-buffer (generate-new-buffer "*untitled*"))
1346 (insert (x-selection-value mac-services-selection))
1347 (sit-for 0)
1348 (save-buffer) ; It pops up the save dialog.
1349 )
1350
1351(defun mac-services-insert-text ()
1352 (interactive)
1353 (let ((text (x-selection-value mac-services-selection)))
1354 (if (not buffer-read-only)
1355 (insert text)
1356 (kill-new text)
1357 (message
1358 (substitute-command-keys
1359 "The text from the Services menu can be accessed with \\[yank]")))))
1360
1361(defvar mac-application-menu-map (make-sparse-keymap))
1362(define-key mac-application-menu-map [quit] 'save-buffers-kill-emacs)
1363(define-key mac-application-menu-map [services perform open-file]
1364 'mac-services-open-file)
1365(define-key mac-application-menu-map [services perform open-selection]
1366 'mac-services-open-selection)
1367(define-key mac-application-menu-map [services paste]
1368 'mac-services-insert-text)
1369(define-key mac-application-menu-map [preferences] 'customize)
1370(define-key mac-application-menu-map [about] 'display-splash-screen)
1371(global-set-key [menu-bar application] mac-application-menu-map)
1163 1372
1164;;; Do the actual Windows setup here; the above code just defines 1373;;; Do the actual Windows setup here; the above code just defines
1165;;; functions and variables that we use now. 1374;;; functions and variables that we use now.
@@ -1444,12 +1653,25 @@ It returns a name of the created fontset."
1444 (error "Suspending an Emacs running under Mac makes no sense")) 1653 (error "Suspending an Emacs running under Mac makes no sense"))
1445(add-hook 'suspend-hook 'x-win-suspend-error) 1654(add-hook 'suspend-hook 'x-win-suspend-error)
1446 1655
1656;;; Arrange for the kill and yank functions to set and check the clipboard.
1657(setq interprogram-cut-function 'x-select-text)
1658(setq interprogram-paste-function 'x-get-selection-value)
1659
1660
1661;;; Turn off window-splitting optimization; Mac is usually fast enough
1662;;; that this is only annoying.
1663(setq split-window-keep-point t)
1664
1447;; Don't show the frame name; that's redundant. 1665;; Don't show the frame name; that's redundant.
1448(setq-default mode-line-frame-identification " ") 1666(setq-default mode-line-frame-identification " ")
1449 1667
1450;; Turn on support for mouse wheels. 1668;; Turn on support for mouse wheels.
1451(mouse-wheel-mode 1) 1669(mouse-wheel-mode 1)
1452 1670
1671
1672;; Enable CLIPBOARD copy/paste through menu bar commands.
1673(menu-bar-enable-clipboard)
1674
1453(defun mac-drag-n-drop (event) 1675(defun mac-drag-n-drop (event)
1454 "Edit the files listed in the drag-n-drop EVENT. 1676 "Edit the files listed in the drag-n-drop EVENT.
1455Switch to a buffer editing the last file dropped." 1677Switch to a buffer editing the last file dropped."
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index 23a25dee827..d4fe99f1f6a 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -26,6 +26,66 @@
26 26
27;;; Code: 27;;; Code:
28 28
29;;; The terminal intialization C code file might have initialized
30;;; function keys F13->F60 from the termcap/terminfo information. On
31;;; a PC-style keyboard these keys correspond to
32;;; MODIFIER-FUNCTION_KEY, where modifier is S-, C, A-, C-S-. The
33;;; code here subsitutes the corresponding defintions in
34;;; function-key-map. This substitution is needed because if a key
35;;; definition if found in function-key-map, there are no further
36;;; lookups in other keymaps.
37(substitute-key-definition [f13] [S-f1] function-key-map)
38(substitute-key-definition [f14] [S-f2] function-key-map)
39(substitute-key-definition [f15] [S-f3] function-key-map)
40(substitute-key-definition [f16] [S-f4] function-key-map)
41(substitute-key-definition [f17] [S-f5] function-key-map)
42(substitute-key-definition [f18] [S-f6] function-key-map)
43(substitute-key-definition [f19] [S-f7] function-key-map)
44(substitute-key-definition [f20] [S-f8] function-key-map)
45(substitute-key-definition [f21] [S-f9] function-key-map)
46(substitute-key-definition [f22] [S-f10] function-key-map)
47(substitute-key-definition [f23] [S-f11] function-key-map)
48(substitute-key-definition [f24] [S-f12] function-key-map)
49
50(substitute-key-definition [f25] [C-f1] function-key-map)
51(substitute-key-definition [f26] [C-f2] function-key-map)
52(substitute-key-definition [f27] [C-f3] function-key-map)
53(substitute-key-definition [f28] [C-f4] function-key-map)
54(substitute-key-definition [f29] [C-f5] function-key-map)
55(substitute-key-definition [f30] [C-f6] function-key-map)
56(substitute-key-definition [f31] [C-f7] function-key-map)
57(substitute-key-definition [f32] [C-f8] function-key-map)
58(substitute-key-definition [f33] [C-f9] function-key-map)
59(substitute-key-definition [f34] [C-f10] function-key-map)
60(substitute-key-definition [f35] [C-f11] function-key-map)
61(substitute-key-definition [f36] [C-f12] function-key-map)
62
63(substitute-key-definition [f37] [C-S-f1] function-key-map)
64(substitute-key-definition [f38] [C-S-f2] function-key-map)
65(substitute-key-definition [f39] [C-S-f3] function-key-map)
66(substitute-key-definition [f40] [C-S-f4] function-key-map)
67(substitute-key-definition [f41] [C-S-f5] function-key-map)
68(substitute-key-definition [f42] [C-S-f6] function-key-map)
69(substitute-key-definition [f43] [C-S-f7] function-key-map)
70(substitute-key-definition [f44] [C-S-f8] function-key-map)
71(substitute-key-definition [f45] [C-S-f9] function-key-map)
72(substitute-key-definition [f46] [C-S-f10] function-key-map)
73(substitute-key-definition [f47] [C-S-f11] function-key-map)
74(substitute-key-definition [f48] [C-S-f12] function-key-map)
75
76(substitute-key-definition [f49] [A-f1] function-key-map)
77(substitute-key-definition [f50] [A-f2] function-key-map)
78(substitute-key-definition [f51] [A-f3] function-key-map)
79(substitute-key-definition [f52] [A-f4] function-key-map)
80(substitute-key-definition [f53] [A-f5] function-key-map)
81(substitute-key-definition [f54] [A-f6] function-key-map)
82(substitute-key-definition [f55] [A-f7] function-key-map)
83(substitute-key-definition [f56] [A-f8] function-key-map)
84(substitute-key-definition [f57] [A-f9] function-key-map)
85(substitute-key-definition [f58] [A-f10] function-key-map)
86(substitute-key-definition [f59] [A-f11] function-key-map)
87(substitute-key-definition [f60] [A-f12] function-key-map)
88
29(let ((map (make-sparse-keymap))) 89(let ((map (make-sparse-keymap)))
30 (define-key map "\e[A" [up]) 90 (define-key map "\e[A" [up])
31 (define-key map "\e[B" [down]) 91 (define-key map "\e[B" [down])
@@ -51,10 +111,15 @@
51 (define-key map "\e[24~" [f12]) 111 (define-key map "\e[24~" [f12])
52 (define-key map "\e[29~" [print]) 112 (define-key map "\e[29~" [print])
53 113
54 (define-key map "\e[11;2~" [S-f1]) 114 (define-key map "\eOP" [f1])
55 (define-key map "\e[12;2~" [S-f2]) 115 (define-key map "\eOQ" [f2])
56 (define-key map "\e[13;2~" [S-f3]) 116 (define-key map "\eOR" [f3])
57 (define-key map "\e[14;2~" [S-f4]) 117 (define-key map "\eOS" [f4])
118
119 (define-key map "\eO2P" [S-f1])
120 (define-key map "\eO2Q" [S-f2])
121 (define-key map "\eO2R" [S-f3])
122 (define-key map "\eO2S" [S-f4])
58 (define-key map "\e[15;2~" [S-f5]) 123 (define-key map "\e[15;2~" [S-f5])
59 (define-key map "\e[17;2~" [S-f6]) 124 (define-key map "\e[17;2~" [S-f6])
60 (define-key map "\e[18;2~" [S-f7]) 125 (define-key map "\e[18;2~" [S-f7])
@@ -64,10 +129,10 @@
64 (define-key map "\e[23;2~" [S-f11]) 129 (define-key map "\e[23;2~" [S-f11])
65 (define-key map "\e[24;2~" [S-f12]) 130 (define-key map "\e[24;2~" [S-f12])
66 131
67 (define-key map "\e[11;5~" [C-f1]) 132 (define-key map "\eO5P" [C-f1])
68 (define-key map "\e[12;5~" [C-f2]) 133 (define-key map "\eO5Q" [C-f2])
69 (define-key map "\e[13;5~" [C-f3]) 134 (define-key map "\eO5R" [C-f3])
70 (define-key map "\e[14;5~" [C-f4]) 135 (define-key map "\eO5S" [C-f4])
71 (define-key map "\e[15;5~" [C-f5]) 136 (define-key map "\e[15;5~" [C-f5])
72 (define-key map "\e[17;5~" [C-f6]) 137 (define-key map "\e[17;5~" [C-f6])
73 (define-key map "\e[18;5~" [C-f7]) 138 (define-key map "\e[18;5~" [C-f7])
@@ -77,10 +142,10 @@
77 (define-key map "\e[23;5~" [C-f11]) 142 (define-key map "\e[23;5~" [C-f11])
78 (define-key map "\e[24;5~" [C-f12]) 143 (define-key map "\e[24;5~" [C-f12])
79 144
80 (define-key map "\e[11;6~" [C-S-f1]) 145 (define-key map "\eO6P" [C-S-f1])
81 (define-key map "\e[12;6~" [C-S-f2]) 146 (define-key map "\eO6Q" [C-S-f2])
82 (define-key map "\e[13;6~" [C-S-f3]) 147 (define-key map "\eO6R" [C-S-f3])
83 (define-key map "\e[14;6~" [C-S-f4]) 148 (define-key map "\eO6S" [C-S-f4])
84 (define-key map "\e[15;6~" [C-S-f5]) 149 (define-key map "\e[15;6~" [C-S-f5])
85 (define-key map "\e[17;6~" [C-S-f6]) 150 (define-key map "\e[17;6~" [C-S-f6])
86 (define-key map "\e[18;6~" [C-S-f7]) 151 (define-key map "\e[18;6~" [C-S-f7])
@@ -90,10 +155,10 @@
90 (define-key map "\e[23;6~" [C-S-f11]) 155 (define-key map "\e[23;6~" [C-S-f11])
91 (define-key map "\e[24;6~" [C-S-f12]) 156 (define-key map "\e[24;6~" [C-S-f12])
92 157
93 (define-key map "\e[11;3~" [A-f1]) 158 (define-key map "\eO3P" [A-f1])
94 (define-key map "\e[12;3~" [A-f2]) 159 (define-key map "\eO3Q" [A-f2])
95 (define-key map "\e[13;3~" [A-f3]) 160 (define-key map "\eO3R" [A-f3])
96 (define-key map "\e[14;3~" [A-f4]) 161 (define-key map "\eO3S" [A-f4])
97 (define-key map "\e[15;3~" [A-f5]) 162 (define-key map "\e[15;3~" [A-f5])
98 (define-key map "\e[17;3~" [A-f6]) 163 (define-key map "\e[17;3~" [A-f6])
99 (define-key map "\e[18;3~" [A-f7]) 164 (define-key map "\e[18;3~" [A-f7])
diff --git a/lisp/textmodes/org.el b/lisp/textmodes/org.el
index c162160397e..2c0d1bea77c 100644
--- a/lisp/textmodes/org.el
+++ b/lisp/textmodes/org.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <dominik at science dot uva dot nl> 5;; Author: Carsten Dominik <dominik at science dot uva dot nl>
6;; Keywords: outlines, hypermedia, calendar 6;; Keywords: outlines, hypermedia, calendar
7;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/ 7;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/
8;; Version: 3.06 8;; Version: 3.08
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
@@ -79,6 +79,16 @@
79;; 79;;
80;; Changes: 80;; Changes:
81;; ------- 81;; -------
82;; Version 3.08
83;; - "|" no longer allowed as part of a link, to allow links in tables.
84;; - The prefix of items in the agenda buffer can be configured.
85;; - Cleanup.
86;;
87;; Version 3.07
88;; - Some folding incinsistencies removed.
89;; - BBDB links to company-only entries.
90;; - Bug fixes and global cleanup.
91;;
82;; Version 3.06 92;; Version 3.06
83;; - M-S-RET inserts a new TODO heading. 93;; - M-S-RET inserts a new TODO heading.
84;; - New startup option `content'. 94;; - New startup option `content'.
@@ -131,14 +141,14 @@
131 141
132;;; Code: 142;;; Code:
133 143
134(eval-when-compile (require 'cl)) 144(eval-when-compile (require 'cl) (require 'calendar))
135(require 'outline) 145(require 'outline)
136(require 'time-date) 146(require 'time-date)
137(require 'easymenu) 147(require 'easymenu)
138 148
139;;; Customization variables 149;;; Customization variables
140 150
141(defvar org-version "3.06" 151(defvar org-version "3.08"
142 "The version number of the file org.el.") 152 "The version number of the file org.el.")
143(defun org-version () 153(defun org-version ()
144 (interactive) 154 (interactive)
@@ -194,8 +204,7 @@ This can also be configured on a per-file basis by adding one of
194the following lines anywhere in the buffer: 204the following lines anywhere in the buffer:
195 205
196 #+STARTUP: dlcheck 206 #+STARTUP: dlcheck
197 #+STARTUP: nodlcheck 207 #+STARTUP: nodlcheck"
198"
199 :group 'org-startup 208 :group 'org-startup
200 :type 'boolean) 209 :type 'boolean)
201 210
@@ -215,8 +224,8 @@ has been set."
215 :group 'org) 224 :group 'org)
216 225
217(defcustom org-todo-keywords '("TODO" "DONE") 226(defcustom org-todo-keywords '("TODO" "DONE")
218 "List of TODO entry keywords.\\<org-mode-map> 227 "List of TODO entry keywords.
219By default, this is '(\"TODO\" \"DONE\"). The last entry in the list is 228\\<org-mode-map>By default, this is '(\"TODO\" \"DONE\"). The last entry in the list is
220considered to mean that the entry is \"done\". All the other mean that 229considered to mean that the entry is \"done\". All the other mean that
221action is required, and will make the entry show up in todo lists, diaries 230action is required, and will make the entry show up in todo lists, diaries
222etc. 231etc.
@@ -228,8 +237,8 @@ Changes become only effective after restarting Emacs."
228 :type '(repeat (string :tag "Keyword"))) 237 :type '(repeat (string :tag "Keyword")))
229 238
230(defcustom org-todo-interpretation 'sequence 239(defcustom org-todo-interpretation 'sequence
231 "Controls how TODO keywords are interpreted.\\<org-mode-map> 240 "Controls how TODO keywords are interpreted.
232Possible values are `sequence' and `type'. 241\\<org-mode-map>Possible values are `sequence' and `type'.
233This variable is only relevant if `org-todo-keywords' contains more than two 242This variable is only relevant if `org-todo-keywords' contains more than two
234states. There are two ways how these keywords can be used: 243states. There are two ways how these keywords can be used:
235 244
@@ -256,7 +265,7 @@ RELAXED. If you later return to this entry and press \\[org-todo] again,
256RELAXED will not be changed REMIND, but directly to DONE. 265RELAXED will not be changed REMIND, but directly to DONE.
257 266
258You can create a large number of types. To initially select a 267You can create a large number of types. To initially select a
259type, it is then best to use C-u \\[org-todo] in order to specify the 268type, it is then best to use \\[universal-argument] \\[org-todo] in order to specify the
260type with completion. Of course, you can also type the keyword 269type with completion. Of course, you can also type the keyword
261directly into the buffer. M-TAB completes TODO keywords at the 270directly into the buffer. M-TAB completes TODO keywords at the
262beginning of a headline." 271beginning of a headline."
@@ -304,7 +313,7 @@ Changes become only effective after restarting Emacs."
304(defcustom org-after-todo-state-change-hook nil 313(defcustom org-after-todo-state-change-hook nil
305 "Hook which is run after the state of a TODO item was changed. 314 "Hook which is run after the state of a TODO item was changed.
306The new state (a string with a todo keyword, or nil) is available in the 315The new state (a string with a todo keyword, or nil) is available in the
307lisp variable `state'." 316Lisp variable `state'."
308 :group 'org-keywords 317 :group 'org-keywords
309 :type 'hook) 318 :type 'hook)
310 319
@@ -313,7 +322,7 @@ lisp variable `state'."
313 "Do TODO items have priorities?") 322 "Do TODO items have priorities?")
314(make-variable-buffer-local 'org-todo-kwd-priority-p) 323(make-variable-buffer-local 'org-todo-kwd-priority-p)
315(defvar org-todo-kwd-max-priority nil 324(defvar org-todo-kwd-max-priority nil
316 "Maximum priority of TODO items") 325 "Maximum priority of TODO items.")
317(make-variable-buffer-local 'org-todo-kwd-max-priority) 326(make-variable-buffer-local 'org-todo-kwd-max-priority)
318(defvar org-ds-keyword-length 12 327(defvar org-ds-keyword-length 12
319 "Maximum length of the Deadline and SCHEDULED keywords.") 328 "Maximum length of the Deadline and SCHEDULED keywords.")
@@ -352,6 +361,15 @@ lisp variable `state'."
352 "Matches the SCHEDULED keyword together with a time stamp.") 361 "Matches the SCHEDULED keyword together with a time stamp.")
353(make-variable-buffer-local 'org-scheduled-time-regexp) 362(make-variable-buffer-local 'org-scheduled-time-regexp)
354 363
364(defvar org-category nil
365 "Variable used by org files to set a category for agenda display.
366Such files should use a file variable to set it, for example
367
368 -*- mode: org; org-category: \"ELisp\"
369
370If the file does not specify a category, the file's base name
371is used instead.")
372
355(defun org-set-regexps-and-options () 373(defun org-set-regexps-and-options ()
356 "Precompute regular expressions for current buffer." 374 "Precompute regular expressions for current buffer."
357 (when (eq major-mode 'org-mode) 375 (when (eq major-mode 'org-mode)
@@ -359,8 +377,8 @@ lisp variable `state'."
359 '("CATEGORY" "SEQ_TODO" "PRI_TODO" "TYP_TODO" "STARTUP"))) 377 '("CATEGORY" "SEQ_TODO" "PRI_TODO" "TYP_TODO" "STARTUP")))
360 (splitre "[ \t]+") 378 (splitre "[ \t]+")
361 kwds int key value cat) 379 kwds int key value cat)
362 (save-restriction 380 (save-excursion
363 (save-excursion 381 (save-restriction
364 (widen) 382 (widen)
365 (goto-char (point-min)) 383 (goto-char (point-min))
366 (while (re-search-forward re nil t) 384 (while (re-search-forward re nil t)
@@ -383,7 +401,7 @@ lisp variable `state'."
383 (let ((opts (org-split-string value splitre)) 401 (let ((opts (org-split-string value splitre))
384 (set '(("fold" org-startup-folded t) 402 (set '(("fold" org-startup-folded t)
385 ("nofold" org-startup-folded nil) 403 ("nofold" org-startup-folded nil)
386 ("content" org-startup-folded 'content) 404 ("content" org-startup-folded content)
387 ("dlcheck" org-startup-with-deadline-check t) 405 ("dlcheck" org-startup-with-deadline-check t)
388 ("nodlcheck" org-startup-with-deadline-check nil))) 406 ("nodlcheck" org-startup-with-deadline-check nil)))
389 l var val) 407 l var val)
@@ -515,8 +533,7 @@ the entries for specific days."
515 :type 'boolean) 533 :type 'boolean)
516 534
517(defcustom org-agenda-include-diary nil 535(defcustom org-agenda-include-diary nil
518 "Non-nil means, when preparing the agenda, also get the 536 "If non-nil, include in the agenda entries from the Emacs Calendar's diary."
519entries from the emacs calendars diary."
520 :group 'org-agenda 537 :group 'org-agenda
521 :type 'boolean) 538 :type 'boolean)
522 539
@@ -566,6 +583,43 @@ categories by priority."
566 (const priority-up) 583 (const priority-up)
567 (const priority-down)))) 584 (const priority-down))))
568 585
586(defcustom org-agenda-prefix-format " %-12:c% s"
587 "Format specification for the prefix of items in the agenda buffer.
588This format works similar to a printf format, with the following meaning:
589
590 %c the category of the item, \"Diary\" for entries from the diary, or
591 as given by the CATEGORY keyword or derived from the file name.
592 %t the time-of-day specification if one applies to the entry, in the
593 format HH:MM
594 %s Scheduling/Deadline information, a short string
595
596In addition to the normal printf field modifiers like field width and
597padding instructions, in this format you can also add an additional
598punctuation or whitespace character just before the final format letter.
599This character will be appended to the field value if the value is not
600empty. For example, the format \"%-12:c\" leads to \"Diary: \" if
601the category is \"Diary\". If the category were be empty, no additional
602colon would be interted.
603
604Including `%t' in the format string leads to a double time specification
605because the headline/diary item will contain the time specification as
606well. However, using `%t' in the format will result in a canonical 24
607hour time specification at a consistent position in the prefix, while the
608time specification in the headline/diary item may be at any position and in
609various formats.
610Example:
611 (setq org-agenda-prefix-format \" %-12:c% t% s\")"
612 :type 'string
613 :group 'org-agenda)
614
615(defcustom org-timeline-prefix-format " % s"
616 "Like `org-agenda-prefix-format', but for the timeline of a single file."
617 :type 'string
618 :group 'org-agenda)
619
620(defvar org-prefix-format-compiled nil
621 "The compiled version of `org-???-prefix-format'.")
622
569(defcustom org-sort-agenda-notime-is-late t 623(defcustom org-sort-agenda-notime-is-late t
570 "Non-nil means, items without time are considered late. 624 "Non-nil means, items without time are considered late.
571This is only relevant for sorting. When t, items which have no explicit 625This is only relevant for sorting. When t, items which have no explicit
@@ -574,15 +628,6 @@ do have a time. When nil, the default time is before 0:00."
574 :group 'org-agenda 628 :group 'org-agenda
575 :type 'boolean) 629 :type 'boolean)
576 630
577(defvar org-category nil
578 "Variable used by org files to set a category for agenda display.
579Such files should use a file variable to set it, for example
580
581 -*- mode: org; org-category: \"ELisp\"
582
583If the file does not specify a category, the file's base name
584is used instead.")
585
586(defgroup org-structure nil 631(defgroup org-structure nil
587 "Options concerning structure editing in Org-mode." 632 "Options concerning structure editing in Org-mode."
588 :tag "Org Structure" 633 :tag "Org Structure"
@@ -647,7 +692,10 @@ unnecessary clutter."
647 692
648(defcustom org-allow-space-in-links t 693(defcustom org-allow-space-in-links t
649 "Non-nil means, file names in links may contain space characters. 694 "Non-nil means, file names in links may contain space characters.
650When nil, it becomes possible to put several links into a line." 695When nil, it becomes possible to put several links into a line.
696Note that in tables, a link never extends accross fields, so in a table
697it is always possible to put several links into a line.
698Changing this varable requires a re-launch of Emacs of become effective."
651 :group 'org-link 699 :group 'org-link
652 :type 'boolean) 700 :type 'boolean)
653 701
@@ -667,7 +715,7 @@ The command `org-store-link' adds a link pointing to the current
667location to an internal list. These links accumulate during a session. 715location to an internal list. These links accumulate during a session.
668The command `org-insert-link' can be used to insert links into any 716The command `org-insert-link' can be used to insert links into any
669Org-mode file (offering completion for all stored links). When this 717Org-mode file (offering completion for all stored links). When this
670option is nil, every link which has been inserted once using `C-c C-l' 718option is nil, every link which has been inserted once using \\[org-insert-link]
671will be removed from the list, to make completing the unused links 719will be removed from the list, to make completing the unused links
672more efficient." 720more efficient."
673 :group 'org-link 721 :group 'org-link
@@ -682,15 +730,15 @@ When following a link with Emacs, it may often be useful to display
682this link in another window or frame. This variable can be used to 730this link in another window or frame. This variable can be used to
683set this up for the different types of links. 731set this up for the different types of links.
684For VM, use any of 732For VM, use any of
685 vm-visit-folder 733 `vm-visit-folder'
686 vm-visit-folder-other-frame 734 `vm-visit-folder-other-frame'
687For Gnus, use any of 735For Gnus, use any of
688 gnus 736 `gnus'
689 gnus-other-frame 737 `gnus-other-frame'
690For FILE, use any of 738For FILE, use any of
691 find-file 739 `find-file'
692 find-file-other-window 740 `find-file-other-window'
693 find-file-other-frame 741 `find-file-other-frame'
694For the calendar, use the variable `calendar-setup'. 742For the calendar, use the variable `calendar-setup'.
695For BBDB, it is currently only possible to display the matches in 743For BBDB, it is currently only possible to display the matches in
696another window." 744another window."
@@ -792,10 +840,10 @@ extension. The entries in this list are cons cells with a file extension
792and the corresponding command. Possible values for the command are: 840and the corresponding command. Possible values for the command are:
793 `emacs' The file will be visited by the current Emacs process. 841 `emacs' The file will be visited by the current Emacs process.
794 `default' Use the default application for this file type. 842 `default' Use the default application for this file type.
795 string A command to be executed by a shell. %s will be replaced 843 string A command to be executed by a shell; %s will be replaced
796 by the path to the file. 844 by the path to the file.
797 sexp A lisp form which will be evaluated. The file path will 845 sexp A Lisp form which will be evaluated. The file path will
798 be available in the lisp variable `file'. 846 be available in the Lisp variable `file'.
799For more examples, see the system specific constants 847For more examples, see the system specific constants
800`org-file-apps-defaults-macosx' 848`org-file-apps-defaults-macosx'
801`org-file-apps-defaults-windowsnt' 849`org-file-apps-defaults-windowsnt'
@@ -1076,7 +1124,7 @@ This option can also be set with the +OPTIONS line, e.g. \"::nil\"."
1076 :type 'boolean) 1124 :type 'boolean)
1077 1125
1078(defcustom org-export-with-tables t 1126(defcustom org-export-with-tables t
1079 "Non-nil means, lines starting with \"|\" define a table 1127 "If non-nil, lines starting with \"|\" define a table
1080For example: 1128For example:
1081 1129
1082 | Name | Address | Birthday | 1130 | Name | Address | Birthday |
@@ -1150,7 +1198,7 @@ This option can also be set with the +OPTIONS line, e.g. \"TeX:nil\"."
1150 :type 'boolean) 1198 :type 'boolean)
1151 1199
1152(defcustom org-export-html-with-timestamp nil 1200(defcustom org-export-html-with-timestamp nil
1153 "Non-nil means, write `org-export-html-html-helper-timestamp' 1201 "If non-nil, write `org-export-html-html-helper-timestamp'
1154into the exported html text. Otherwise, the buffer will just be saved 1202into the exported html text. Otherwise, the buffer will just be saved
1155to a file." 1203to a file."
1156 :group 'org-export 1204 :group 'org-export
@@ -1348,6 +1396,7 @@ When this is non-nil, the headline after the keyword is set to the
1348 (defvar org-cursor-color) 1396 (defvar org-cursor-color)
1349 (defvar org-time-was-given) 1397 (defvar org-time-was-given)
1350 (defvar org-ts-what) 1398 (defvar org-ts-what)
1399 (defvar mark-active)
1351 (defvar timecnt) 1400 (defvar timecnt)
1352 (defvar levels-open) 1401 (defvar levels-open)
1353 (defvar title) 1402 (defvar title)
@@ -1383,6 +1432,17 @@ When this is non-nil, the headline after the keyword is set to the
1383(defvar org-struct-menu) 1432(defvar org-struct-menu)
1384(defvar org-org-menu) 1433(defvar org-org-menu)
1385 1434
1435;; We use a before-change function to check if a table might need
1436;; an update.
1437(defvar org-table-may-need-update t
1438 "Indicates of a table might need an update.
1439This variable is set by `org-before-change-function'. `org-table-align'
1440sets it back to nil.")
1441
1442(defvar org-mode-hook nil)
1443(defvar org-inhibit-startup nil) ; Dynamically-scoped param.
1444
1445
1386;;;###autoload 1446;;;###autoload
1387(defun org-mode (&optional arg) 1447(defun org-mode (&optional arg)
1388 "Outline-based notes management and organizer, alias 1448 "Outline-based notes management and organizer, alias
@@ -1437,14 +1497,15 @@ The following commands are available:
1437 (goto-char (point-min)) 1497 (goto-char (point-min))
1438 (insert " -*- mode: org -*-\n\n"))) 1498 (insert " -*- mode: org -*-\n\n")))
1439 (run-hooks 'org-mode-hook) 1499 (run-hooks 'org-mode-hook)
1440 (unless (boundp 'org-inhibit-startup) 1500 (unless org-inhibit-startup
1441 (if org-startup-with-deadline-check 1501 (if org-startup-with-deadline-check
1442 (call-interactively 'org-check-deadlines) 1502 (call-interactively 'org-check-deadlines)
1443 (cond 1503 (cond
1444 ((eq org-startup-folded t) 1504 ((eq org-startup-folded t)
1445 (org-cycle)) 1505 (org-cycle '(4)))
1446 ((eq org-startup-folded 'contents) 1506 ((eq org-startup-folded 'content)
1447 (org-cycle) (org-cycle)))))) 1507 (let ((this-command 'org-cycle) (last-command 'org-cycle))
1508 (org-cycle '(4)) (org-cycle '(4))))))))
1448 1509
1449;;; Font-Lock stuff 1510;;; Font-Lock stuff
1450 1511
@@ -1456,10 +1517,13 @@ The following commands are available:
1456 1517
1457(require 'font-lock) 1518(require 'font-lock)
1458 1519
1520(defconst org-non-link-chars "\t\n\r|")
1459(defconst org-link-regexp 1521(defconst org-link-regexp
1460 (if org-allow-space-in-links 1522 (if org-allow-space-in-links
1461 "\\(https?\\|ftp\\|mailto\\|file\\|news\\|bbdb\\|vm\\|wl\\|rmail\\|gnus\\|shell\\):\\([^\t\n\r]+[^ \t\n\r]\\)" 1523 (concat
1462 "\\(https?\\|ftp\\|mailto\\|file\\|news\\|bbdb\\|vm\\|wl\\|rmail\\|gnus\\|shell\\):\\([^ \t\n\r]+\\)" 1524 "\\(https?\\|ftp\\|mailto|\\|file\\|news\\|bbdb\\|vm\\|wl\\|rmail\\|gnus\\|shell\\):\\([^" org-non-link-chars "]+[^ " org-non-link-chars "]\\)")
1525 (concat
1526 "\\(https?\\|ftp\\|mailto\\|file\\|news\\|bbdb\\|vm\\|wl\\|rmail\\|gnus\\|shell\\):\\([^ " org-non-link-chars "]+\\)")
1463 ) 1527 )
1464 "Regular expression for matching links.") 1528 "Regular expression for matching links.")
1465(defconst org-ts-lengths 1529(defconst org-ts-lengths
@@ -1502,6 +1566,8 @@ The following commands are available:
1502 (org-back-to-heading t) 1566 (org-back-to-heading t)
1503 (- (match-end 0) (match-beginning 0)))) 1567 (- (match-end 0) (match-beginning 0))))
1504 1568
1569(defvar org-font-lock-keywords nil)
1570
1505(defun org-set-font-lock-defaults () 1571(defun org-set-font-lock-defaults ()
1506 (let ((org-font-lock-extra-keywords 1572 (let ((org-font-lock-extra-keywords
1507 (list 1573 (list
@@ -1550,13 +1616,10 @@ The following commands are available:
1550 '(org-font-lock-keywords t nil nil backward-paragraph)) 1616 '(org-font-lock-keywords t nil nil backward-paragraph))
1551 (kill-local-variable 'font-lock-keywords) nil)) 1617 (kill-local-variable 'font-lock-keywords) nil))
1552 1618
1553(defvar org-font-lock-keywords nil)
1554
1555(defun org-unfontify-region (beg end &optional maybe_loudly) 1619(defun org-unfontify-region (beg end &optional maybe_loudly)
1556 "Remove fontification and activation overlays from links." 1620 "Remove fontification and activation overlays from links."
1557 (font-lock-default-unfontify-region beg end) 1621 (font-lock-default-unfontify-region beg end)
1558 (let* ((modified (buffer-modified-p)) ;; FIXME: Why did I add this??? 1622 (let* ((buffer-undo-list t)
1559 (buffer-undo-list t)
1560 (inhibit-read-only t) (inhibit-point-motion-hooks t) 1623 (inhibit-read-only t) (inhibit-point-motion-hooks t)
1561 (inhibit-modification-hooks t) 1624 (inhibit-modification-hooks t)
1562 deactivate-mark buffer-file-name buffer-file-truename) 1625 deactivate-mark buffer-file-name buffer-file-truename)
@@ -1651,15 +1714,15 @@ The following commands are available:
1651 (save-excursion 1714 (save-excursion
1652 (org-back-to-heading) 1715 (org-back-to-heading)
1653 (outline-up-heading arg) 1716 (outline-up-heading arg)
1654 (show-subtree))) 1717 (org-show-subtree)))
1655 1718
1656 ((save-excursion (beginning-of-line 1) (looking-at outline-regexp)) 1719 ((save-excursion (beginning-of-line 1) (looking-at outline-regexp))
1657 ;; At a heading: rotate between three different views 1720 ;; At a heading: rotate between three different views
1658 (org-back-to-heading) 1721 (org-back-to-heading)
1659 (let ((goal-column 0) beg eoh eol eos nxh) 1722 (let ((goal-column 0) eoh eol eos)
1660 ;; First, some boundaries 1723 ;; First, some boundaries
1661 (save-excursion 1724 (save-excursion
1662 (org-back-to-heading) (setq beg (point)) 1725 (org-back-to-heading)
1663 (save-excursion 1726 (save-excursion
1664 (beginning-of-line 2) 1727 (beginning-of-line 2)
1665 (while (and (not (eobp)) ;; this is like `next-line' 1728 (while (and (not (eobp)) ;; this is like `next-line'
@@ -1667,7 +1730,7 @@ The following commands are available:
1667 (beginning-of-line 2)) (setq eol (point))) 1730 (beginning-of-line 2)) (setq eol (point)))
1668 (outline-end-of-heading) (setq eoh (point)) 1731 (outline-end-of-heading) (setq eoh (point))
1669 (outline-end-of-subtree) (setq eos (point)) 1732 (outline-end-of-subtree) (setq eos (point))
1670 (outline-next-heading) (setq nxh (point))) 1733 (outline-next-heading))
1671 ;; Find out what to do next and set `this-command' 1734 ;; Find out what to do next and set `this-command'
1672 (cond 1735 (cond
1673 ((= eos eoh) 1736 ((= eos eoh)
@@ -1676,7 +1739,7 @@ The following commands are available:
1676 (setq org-cycle-subtree-status nil)) 1739 (setq org-cycle-subtree-status nil))
1677 ((>= eol eos) 1740 ((>= eol eos)
1678 ;; Entire subtree is hidden in one line: open it 1741 ;; Entire subtree is hidden in one line: open it
1679 (show-entry) 1742 (org-show-entry)
1680 (show-children) 1743 (show-children)
1681 (message "CHILDREN") 1744 (message "CHILDREN")
1682 (setq org-cycle-subtree-status 'children) 1745 (setq org-cycle-subtree-status 'children)
@@ -1684,7 +1747,7 @@ The following commands are available:
1684 ((and (eq last-command this-command) 1747 ((and (eq last-command this-command)
1685 (eq org-cycle-subtree-status 'children)) 1748 (eq org-cycle-subtree-status 'children))
1686 ;; We just showed the children, now show everything. 1749 ;; We just showed the children, now show everything.
1687 (show-subtree) 1750 (org-show-subtree)
1688 (message "SUBTREE") 1751 (message "SUBTREE")
1689 (setq org-cycle-subtree-status 'subtree) 1752 (setq org-cycle-subtree-status 'subtree)
1690 (run-hook-with-args 'org-cycle-hook 'subtree)) 1753 (run-hook-with-args 'org-cycle-hook 'subtree))
@@ -1733,9 +1796,9 @@ This function is the default value of the hook `org-cycle-hook'."
1733 "Move cursor to the first headline and recenter the headline. 1796 "Move cursor to the first headline and recenter the headline.
1734Optional argument N means, put the headline into the Nth line of the window." 1797Optional argument N means, put the headline into the Nth line of the window."
1735 (goto-char (point-min)) 1798 (goto-char (point-min))
1736 (re-search-forward (concat "^" outline-regexp)) 1799 (when (re-search-forward (concat "^" outline-regexp) nil t)
1737 (beginning-of-line) 1800 (beginning-of-line)
1738 (recenter (prefix-numeric-value N))) 1801 (recenter (prefix-numeric-value N))))
1739 1802
1740(defvar org-goto-window-configuration nil) 1803(defvar org-goto-window-configuration nil)
1741(defvar org-goto-marker nil) 1804(defvar org-goto-marker nil)
@@ -1836,9 +1899,9 @@ or nil."
1836 current-prefix-arg arg) 1899 current-prefix-arg arg)
1837 (throw 'exit nil)) 1900 (throw 'exit nil))
1838 1901
1839(defun org-goto-left (&optional arg) 1902(defun org-goto-left ()
1840 "Finish org-goto by going to the new location." 1903 "Finish org-goto by going to the new location."
1841 (interactive "P") 1904 (interactive)
1842 (if (org-on-heading-p) 1905 (if (org-on-heading-p)
1843 (progn 1906 (progn
1844 (beginning-of-line 1) 1907 (beginning-of-line 1)
@@ -1847,9 +1910,9 @@ or nil."
1847 (throw 'exit nil)) 1910 (throw 'exit nil))
1848 (error "Not on a heading"))) 1911 (error "Not on a heading")))
1849 1912
1850(defun org-goto-right (&optional arg) 1913(defun org-goto-right ()
1851 "Finish org-goto by going to the new location." 1914 "Finish org-goto by going to the new location."
1852 (interactive "P") 1915 (interactive)
1853 (if (org-on-heading-p) 1916 (if (org-on-heading-p)
1854 (progn 1917 (progn
1855 (outline-end-of-subtree) 1918 (outline-end-of-subtree)
@@ -1870,9 +1933,9 @@ or nil."
1870(defvar org-ignore-region nil 1933(defvar org-ignore-region nil
1871 "To temporarily disable the active region.") 1934 "To temporarily disable the active region.")
1872 1935
1873(defun org-insert-heading (&optional arg) 1936(defun org-insert-heading ()
1874 "Insert a new heading with same depth at point." 1937 "Insert a new heading with same depth at point."
1875 (interactive "P") 1938 (interactive)
1876 (let* ((head (save-excursion 1939 (let* ((head (save-excursion
1877 (condition-case nil 1940 (condition-case nil
1878 (org-back-to-heading) 1941 (org-back-to-heading)
@@ -1903,34 +1966,36 @@ state (TODO by default). Also with prefix arg, force first state."
1903 (insert (car org-todo-keywords) " ") 1966 (insert (car org-todo-keywords) " ")
1904 (insert (match-string 2) " "))) 1967 (insert (match-string 2) " ")))
1905 1968
1906(defun org-promote-subtree (&optional arg) 1969(defun org-promote-subtree ()
1907 "Promote the entire subtree. 1970 "Promote the entire subtree.
1908See also `org-promote'." 1971See also `org-promote'."
1909 (interactive "P") 1972 (interactive)
1910 (org-map-tree 'org-promote)) 1973 (save-excursion
1974 (org-map-tree 'org-promote)))
1911 1975
1912(defun org-demote-subtree (&optional arg) 1976(defun org-demote-subtree ()
1913 "Demote the entire subtree. See `org-demote'. 1977 "Demote the entire subtree. See `org-demote'.
1914See also `org-promote'." 1978See also `org-promote'."
1915 (interactive "P") 1979 (interactive)
1916 (org-map-tree 'org-demote)) 1980 (save-excursion
1981 (org-map-tree 'org-demote)))
1917 1982
1918(defun org-do-promote (&optional arg) 1983(defun org-do-promote ()
1919 "Promote the current heading higher up the tree. 1984 "Promote the current heading higher up the tree.
1920If the region is active in transient-mark-mode, promote all headings 1985If the region is active in t`ransient-mark-mode', promote all headings
1921in the region." 1986in the region."
1922 (interactive "P") 1987 (interactive)
1923 (save-excursion 1988 (save-excursion
1924 (if (org-region-active-p) 1989 (if (org-region-active-p)
1925 (org-map-region 'org-promote (region-beginning) (region-end)) 1990 (org-map-region 'org-promote (region-beginning) (region-end))
1926 (org-promote))) 1991 (org-promote)))
1927 (org-fix-position-after-promote)) 1992 (org-fix-position-after-promote))
1928 1993
1929(defun org-do-demote (&optional arg) 1994(defun org-do-demote ()
1930 "Demote the current heading lower down the tree. 1995 "Demote the current heading lower down the tree.
1931If the region is active in transient-mark-mode, demote all headings 1996If the region is active in `transient-mark-mode', demote all headings
1932in the region." 1997in the region."
1933 (interactive "P") 1998 (interactive)
1934 (save-excursion 1999 (save-excursion
1935 (if (org-region-active-p) 2000 (if (org-region-active-p)
1936 (org-map-region 'org-demote (region-beginning) (region-end)) 2001 (org-map-region 'org-demote (region-beginning) (region-end))
@@ -1945,7 +2010,7 @@ in the region."
1945 2010
1946(defun org-promote () 2011(defun org-promote ()
1947 "Promote the current heading higher up the tree. 2012 "Promote the current heading higher up the tree.
1948If the region is active in transient-mark-mode, promote all headings 2013If the region is active in `transient-mark-mode', promote all headings
1949in the region." 2014in the region."
1950 (org-back-to-heading t) 2015 (org-back-to-heading t)
1951 (let* ((level (save-match-data (funcall outline-level))) 2016 (let* ((level (save-match-data (funcall outline-level)))
@@ -1957,7 +2022,7 @@ in the region."
1957 2022
1958(defun org-demote () 2023(defun org-demote ()
1959 "Demote the current heading lower down the tree. 2024 "Demote the current heading lower down the tree.
1960If the region is active in transient-mark-mode, demote all headings 2025If the region is active in `transient-mark-mode', demote all headings
1961in the region." 2026in the region."
1962 (org-back-to-heading t) 2027 (org-back-to-heading t)
1963 (let* ((level (save-match-data (funcall outline-level))) 2028 (let* ((level (save-match-data (funcall outline-level)))
@@ -2066,17 +2131,17 @@ ring. We need it to check if the kill was created by `org-copy-subtree'.")
2066 "Was the last copied subtree folded? 2131 "Was the last copied subtree folded?
2067This is used to fold the tree back after pasting.") 2132This is used to fold the tree back after pasting.")
2068 2133
2069(defun org-cut-subtree (&optional arg) 2134(defun org-cut-subtree ()
2070 "Cut the current subtree into the clipboard. 2135 "Cut the current subtree into the clipboard.
2071This is a short-hand for marking the subtree and then cutting it." 2136This is a short-hand for marking the subtree and then cutting it."
2072 (interactive "p") 2137 (interactive)
2073 (org-copy-subtree arg 'cut)) 2138 (org-copy-subtree 'cut))
2074 2139
2075(defun org-copy-subtree (&optional arg cut) 2140(defun org-copy-subtree (&optional cut)
2076 "Cut the current subtree into the clipboard. 2141 "Cut the current subtree into the clipboard.
2077This is a short-hand for marking the subtree and then copying it. 2142This is a short-hand for marking the subtree and then copying it.
2078If CUT is non nil, actually cut the subtree." 2143If CUT is non nil, actually cut the subtree."
2079 (interactive "p") 2144 (interactive)
2080 (let (beg end folded) 2145 (let (beg end folded)
2081 (org-back-to-heading) 2146 (org-back-to-heading)
2082 (setq beg (point)) 2147 (setq beg (point))
@@ -2338,7 +2403,7 @@ prefix arg, switch to that state."
2338 ;; Fixup cursor location if close to the keyword 2403 ;; Fixup cursor location if close to the keyword
2339 (if (and (outline-on-heading-p) 2404 (if (and (outline-on-heading-p)
2340 (not (bolp)) 2405 (not (bolp))
2341 (save-excursion (goto-char (point-at-bol)) 2406 (save-excursion (beginning-of-line 1)
2342 (looking-at org-todo-line-regexp)) 2407 (looking-at org-todo-line-regexp))
2343 (< (point) (+ 2 (or (match-end 2) (match-end 1))))) 2408 (< (point) (+ 2 (or (match-end 2) (match-end 1)))))
2344 (progn 2409 (progn
@@ -2681,7 +2746,7 @@ This is used by `org-read-date' in a temporary keymap for the calendar buffer."
2681A deadline is considered due if it happens within `org-deadline-warning-days' 2746A deadline is considered due if it happens within `org-deadline-warning-days'
2682days from today's date. If the deadline appears in an entry marked DONE, 2747days from today's date. If the deadline appears in an entry marked DONE,
2683it is not shown. The prefix arg NDAYS can be used to test that many 2748it is not shown. The prefix arg NDAYS can be used to test that many
2684days. If the prefix is a raw C-u prefix, all deadlines are shown." 2749days. If the prefix is a raw \\[universal-argument] prefix, all deadlines are shown."
2685 (interactive "P") 2750 (interactive "P")
2686 (let* ((org-warn-days 2751 (let* ((org-warn-days
2687 (cond 2752 (cond
@@ -2718,6 +2783,7 @@ days in order to avoid rounding problems."
2718 (error "Not at a time-stamp range, and none found in current line."))) 2783 (error "Not at a time-stamp range, and none found in current line.")))
2719 (let* ((ts1 (match-string 1)) 2784 (let* ((ts1 (match-string 1))
2720 (ts2 (match-string 2)) 2785 (ts2 (match-string 2))
2786 (havetime (or (> (length ts1) 15) (> (length ts2) 15)))
2721 (match-end (match-end 0)) 2787 (match-end (match-end 0))
2722 (time1 (org-time-string-to-time ts1)) 2788 (time1 (org-time-string-to-time ts1))
2723 (time2 (org-time-string-to-time ts2)) 2789 (time2 (org-time-string-to-time ts2))
@@ -2725,17 +2791,27 @@ days in order to avoid rounding problems."
2725 (t2 (time-to-seconds time2)) 2791 (t2 (time-to-seconds time2))
2726 (diff (abs (- t2 t1))) 2792 (diff (abs (- t2 t1)))
2727 (negative (< (- t2 t1) 0)) 2793 (negative (< (- t2 t1) 0))
2728 (ys (floor (* 365 24 60 60))) 2794 ;; (ys (floor (* 365 24 60 60)))
2729 (ds (* 24 60 60)) 2795 (ds (* 24 60 60))
2730 (hs (* 60 60)) 2796 (hs (* 60 60))
2731 (fy "%dy %dd %02d:%02d") 2797 (fy "%dy %dd %02d:%02d")
2798 (fy1 "%dy %dd")
2732 (fd "%dd %02d:%02d") 2799 (fd "%dd %02d:%02d")
2800 (fd1 "%dd")
2733 (fh "%02d:%02d") 2801 (fh "%02d:%02d")
2734 y d h m align) 2802 y d h m align)
2735 (setq y (floor (/ diff ys)) diff (mod diff ys) 2803 ;; FIXME: Should I re-introduce years, make year refer to same date?
2736 d (floor (/ diff ds)) diff (mod diff ds) 2804 ;; This would be the only useful way to have years, actually.
2737 h (floor (/ diff hs)) diff (mod diff hs) 2805 (if havetime
2738 m (floor (/ diff 60))) 2806 (setq ; y (floor (/ diff ys)) diff (mod diff ys)
2807 y 0
2808 d (floor (/ diff ds)) diff (mod diff ds)
2809 h (floor (/ diff hs)) diff (mod diff hs)
2810 m (floor (/ diff 60)))
2811 (setq ; y (floor (/ diff ys)) diff (mod diff ys)
2812 y 0
2813 d (floor (+ (/ diff ds) 0.5))
2814 h 0 m 0))
2739 (if (not to-buffer) 2815 (if (not to-buffer)
2740 (message (org-make-tdiff-string y d h m)) 2816 (message (org-make-tdiff-string y d h m))
2741 (when (org-at-table-p) 2817 (when (org-at-table-p)
@@ -2746,8 +2822,8 @@ days in order to avoid rounding problems."
2746 "\\( *-? *[0-9]+y\\)?\\( *[0-9]+d\\)? *[0-9][0-9]:[0-9][0-9]") 2822 "\\( *-? *[0-9]+y\\)?\\( *[0-9]+d\\)? *[0-9][0-9]:[0-9][0-9]")
2747 (replace-match "")) 2823 (replace-match ""))
2748 (if negative (insert " -")) 2824 (if negative (insert " -"))
2749 (if (> y 0) (insert " " (format fy y d h m)) 2825 (if (> y 0) (insert " " (format (if havetime fy fy1) y d h m))
2750 (if (> d 0) (insert " " (format fd d h m)) 2826 (if (> d 0) (insert " " (format (if havetime fd fd1) d h m))
2751 (insert " " (format fh h m)))) 2827 (insert " " (format fh h m))))
2752 (if align (org-table-align)) 2828 (if align (org-table-align))
2753 (message "Time difference inserted")))) 2829 (message "Time difference inserted"))))
@@ -2770,7 +2846,7 @@ days in order to avoid rounding problems."
2770 2846
2771(defun org-parse-time-string (s) 2847(defun org-parse-time-string (s)
2772 "Parse the standard Org-mode time string. 2848 "Parse the standard Org-mode time string.
2773This should be a lot faster than the normal parse-time-string." 2849This should be a lot faster than the normal `parse-time-string'."
2774 (if (string-match org-ts-regexp1 s) 2850 (if (string-match org-ts-regexp1 s)
2775 (list 0 2851 (list 0
2776 (string-to-number (or (match-string 8 s) "0")) 2852 (string-to-number (or (match-string 8 s) "0"))
@@ -2927,7 +3003,7 @@ If there is already a time stamp at the cursor position, update it."
2927;;; Define the mode 3003;;; Define the mode
2928 3004
2929(defvar org-agenda-mode-map (make-sparse-keymap) 3005(defvar org-agenda-mode-map (make-sparse-keymap)
2930 "Keymap for org-agenda-mode.") 3006 "Keymap for `org-agenda-mode'.")
2931 3007
2932(defvar org-agenda-menu) 3008(defvar org-agenda-menu)
2933(defvar org-agenda-follow-mode nil) 3009(defvar org-agenda-follow-mode nil)
@@ -2949,6 +3025,7 @@ The following commands are available:
2949 (easy-menu-add org-agenda-menu) 3025 (easy-menu-add org-agenda-menu)
2950 (if org-startup-truncated (setq truncate-lines t)) 3026 (if org-startup-truncated (setq truncate-lines t))
2951 (add-hook 'post-command-hook 'org-agenda-post-command-hook nil 'local) 3027 (add-hook 'post-command-hook 'org-agenda-post-command-hook nil 'local)
3028 (add-hook 'pre-command-hook 'org-unhighlight nil 'local)
2952 (setq org-agenda-follow-mode nil) 3029 (setq org-agenda-follow-mode nil)
2953 (easy-menu-change 3030 (easy-menu-change
2954 '("Agenda") "Agenda Files" 3031 '("Agenda") "Agenda Files"
@@ -2968,7 +3045,7 @@ The following commands are available:
2968(define-key org-agenda-mode-map "l" 'org-agenda-recenter) 3045(define-key org-agenda-mode-map "l" 'org-agenda-recenter)
2969(define-key org-agenda-mode-map "t" 'org-agenda-todo) 3046(define-key org-agenda-mode-map "t" 'org-agenda-todo)
2970(define-key org-agenda-mode-map "." 'org-agenda-goto-today) 3047(define-key org-agenda-mode-map "." 'org-agenda-goto-today)
2971(define-key org-agenda-mode-map "w" 'org-agenda-week-view) 3048(define-key org-agenda-mode-map "w" 'org-agenda-toggle-week-view)
2972(define-key org-agenda-mode-map [(shift right)] 'org-agenda-date-later) 3049(define-key org-agenda-mode-map [(shift right)] 'org-agenda-date-later)
2973(define-key org-agenda-mode-map [(shift left)] 'org-agenda-date-earlier) 3050(define-key org-agenda-mode-map [(shift left)] 'org-agenda-date-earlier)
2974 3051
@@ -3043,7 +3120,8 @@ The following commands are available:
3043 ["Next Dates" org-agenda-later (local-variable-p 'starting-day)] 3120 ["Next Dates" org-agenda-later (local-variable-p 'starting-day)]
3044 ["Previous Dates" org-agenda-earlier (local-variable-p 'starting-day)] 3121 ["Previous Dates" org-agenda-earlier (local-variable-p 'starting-day)]
3045 "--" 3122 "--"
3046 ["Week/Day View" org-agenda-week-view (local-variable-p 'starting-day)] 3123 ["Week/Day View" org-agenda-toggle-week-view
3124 (local-variable-p 'starting-day)]
3047 ["Include Diary" org-agenda-toggle-diary 3125 ["Include Diary" org-agenda-toggle-diary
3048 :style toggle :selected org-agenda-include-diary :active t] 3126 :style toggle :selected org-agenda-include-diary :active t]
3049 "--" 3127 "--"
@@ -3060,7 +3138,7 @@ The following commands are available:
3060 )) 3138 ))
3061 3139
3062(defvar org-agenda-markers nil 3140(defvar org-agenda-markers nil
3063 "List of all currently active markers created by org-agenda") 3141 "List of all currently active markers created by `org-agenda'.")
3064(defvar org-agenda-last-marker-time (time-to-seconds (current-time)) 3142(defvar org-agenda-last-marker-time (time-to-seconds (current-time))
3065 "Creation time of the last agenda marker.") 3143 "Creation time of the last agenda marker.")
3066 3144
@@ -3074,7 +3152,7 @@ no longer in use."
3074 m)) 3152 m))
3075 3153
3076(defun org-agenda-maybe-reset-markers (&optional force) 3154(defun org-agenda-maybe-reset-markers (&optional force)
3077 "Reset markers created by org-agenda. But only if they are old enough." 3155 "Reset markers created by `org-agenda'. But only if they are old enough."
3078 (if (or force 3156 (if (or force
3079 (> (- (time-to-seconds (current-time)) 3157 (> (- (time-to-seconds (current-time))
3080 org-agenda-last-marker-time) 3158 org-agenda-last-marker-time)
@@ -3106,21 +3184,23 @@ When a buffer is unmodified, it is just killed. When modified, it is saved
3106 (when (and (buffer-modified-p buf) 3184 (when (and (buffer-modified-p buf)
3107 file 3185 file
3108 (y-or-n-p (format "Save file %s? " file))) 3186 (y-or-n-p (format "Save file %s? " file)))
3109 (save-excursion 3187 (with-current-buffer buf (save-buffer)))
3110 (set-buffer buf) (save-buffer)))
3111 (kill-buffer buf)))) 3188 (kill-buffer buf))))
3112 3189
3190(defvar org-respect-restriction nil) ; Dynamically-scoped param.
3191
3113(defun org-timeline (&optional include-all) 3192(defun org-timeline (&optional include-all)
3114 "Show a time-sorted view of the entries in the current org file. 3193 "Show a time-sorted view of the entries in the current org file.
3115Only entries with a time stamp of today or later will be listed. With 3194Only entries with a time stamp of today or later will be listed. With
3116one C-u prefix argument, past entries will also be listed. 3195one \\[universal-argument] prefix argument, past entries will also be listed.
3117With two C-u prefixes, all unfinished TODO items will also be shown, 3196With two \\[universal-argument] prefixes, all unfinished TODO items will also be shown,
3118under the current date. 3197under the current date.
3119If the buffer contains an active region, only check the region for 3198If the buffer contains an active region, only check the region for
3120dates." 3199dates."
3121 (interactive "P") 3200 (interactive "P")
3122 (require 'calendar) 3201 (require 'calendar)
3123 (org-agenda-maybe-reset-markers 'force) 3202 (org-agenda-maybe-reset-markers 'force)
3203 (org-compile-prefix-format org-timeline-prefix-format)
3124 (let* ((dopast include-all) 3204 (let* ((dopast include-all)
3125 (dotodo (equal include-all '(16))) 3205 (dotodo (equal include-all '(16)))
3126 (entry (buffer-file-name)) 3206 (entry (buffer-file-name))
@@ -3135,7 +3215,7 @@ dates."
3135 (today (time-to-days (current-time))) 3215 (today (time-to-days (current-time)))
3136 (org-respect-restriction t) 3216 (org-respect-restriction t)
3137 (past t) 3217 (past t)
3138 s e rtn d pos) 3218 s e rtn d)
3139 (setq org-agenda-redo-command 3219 (setq org-agenda-redo-command
3140 (list 'progn 3220 (list 'progn
3141 (list 'switch-to-buffer-other-window (current-buffer)) 3221 (list 'switch-to-buffer-other-window (current-buffer))
@@ -3188,13 +3268,14 @@ dates."
3188 "Produce a weekly view from all files in variable `org-agenda-files'. 3268 "Produce a weekly view from all files in variable `org-agenda-files'.
3189The view will be for the current week, but from the overview buffer you 3269The view will be for the current week, but from the overview buffer you
3190will be able to go to other weeks. 3270will be able to go to other weeks.
3191With one C-u prefix argument INCLUDE-ALL, all unfinished TODO items will 3271With one \\[universal-argument] prefix argument INCLUDE-ALL, all unfinished TODO items will
3192also be shown, under the current date. 3272also be shown, under the current date.
3193START-DAY defaults to TODAY, or to the most recent match for the weekday 3273START-DAY defaults to TODAY, or to the most recent match for the weekday
3194given in `org-agenda-start-on-weekday'. 3274given in `org-agenda-start-on-weekday'.
3195NDAYS defaults to `org-agenda-ndays'." 3275NDAYS defaults to `org-agenda-ndays'."
3196 (interactive "P") 3276 (interactive "P")
3197 (org-agenda-maybe-reset-markers 'force) 3277 (org-agenda-maybe-reset-markers 'force)
3278 (org-compile-prefix-format org-agenda-prefix-format)
3198 (require 'calendar) 3279 (require 'calendar)
3199 (let* ((org-agenda-start-on-weekday 3280 (let* ((org-agenda-start-on-weekday
3200 (if (or (equal ndays 1) 3281 (if (or (equal ndays 1)
@@ -3306,31 +3387,31 @@ NDAYS defaults to `org-agenda-ndays'."
3306 (throw 'nextfile t)) 3387 (throw 'nextfile t))
3307 (t (error "Abort")))))) 3388 (t (error "Abort"))))))
3308 3389
3309(defun org-agenda-quit (arg) 3390(defun org-agenda-quit ()
3310 "Exit agenda by removing the window or the buffer." 3391 "Exit agenda by removing the window or the buffer."
3311 (interactive "P") 3392 (interactive)
3312 (let ((buf (current-buffer))) 3393 (let ((buf (current-buffer)))
3313 (if (not (one-window-p)) (delete-window)) 3394 (if (not (one-window-p)) (delete-window))
3314 (kill-buffer buf) 3395 (kill-buffer buf)
3315 (org-agenda-maybe-reset-markers 'force))) 3396 (org-agenda-maybe-reset-markers 'force)))
3316 3397
3317(defun org-agenda-exit (arg) 3398(defun org-agenda-exit ()
3318 "Exit agenda by removing the window or the buffer. 3399 "Exit agenda by removing the window or the buffer.
3319Also kill all Org-mode buffers which have been loaded by `org-agenda'. 3400Also kill all Org-mode buffers which have been loaded by `org-agenda'.
3320Org-mode buffers visited directly by the user will not be touched." 3401Org-mode buffers visited directly by the user will not be touched."
3321 (interactive "P") 3402 (interactive)
3322 (org-release-buffers org-agenda-new-buffers) 3403 (org-release-buffers org-agenda-new-buffers)
3323 (setq org-agenda-new-buffers nil) 3404 (setq org-agenda-new-buffers nil)
3324 (org-agenda-quit arg)) 3405 (org-agenda-quit))
3325 3406
3326(defun org-agenda-redo (&optional arg) 3407(defun org-agenda-redo ()
3327 "Rebuild Agenda" 3408 "Rebuild Agenda."
3328 (interactive "P") 3409 (interactive)
3329 (eval org-agenda-redo-command)) 3410 (eval org-agenda-redo-command))
3330 3411
3331(defun org-agenda-goto-today (arg) 3412(defun org-agenda-goto-today ()
3332 "Go to today." 3413 "Go to today."
3333 (interactive "P") 3414 (interactive)
3334 (if (boundp 'starting-day) 3415 (if (boundp 'starting-day)
3335 (let ((cmd (car org-agenda-redo-command)) 3416 (let ((cmd (car org-agenda-redo-command))
3336 (iall (nth 1 org-agenda-redo-command)) 3417 (iall (nth 1 org-agenda-redo-command))
@@ -3357,17 +3438,9 @@ With prefix ARG, go back that many times `org-agenda-ndays'."
3357 (org-agenda (if (boundp 'include-all-loc) include-all-loc nil) 3438 (org-agenda (if (boundp 'include-all-loc) include-all-loc nil)
3358 (- starting-day (* arg org-agenda-ndays)))) 3439 (- starting-day (* arg org-agenda-ndays))))
3359 3440
3360(defun org-agenda-day-view (arg) 3441(defun org-agenda-toggle-week-view ()
3361 "Switch agenda to single day view." 3442 "Toggle weekly/daily view for aagenda."
3362 (interactive "P") 3443 (interactive)
3363 (unless (boundp 'starting-day)
3364 (error "Not allowed"))
3365 (setq org-agenda-ndays 1)
3366 (org-agenda include-all-loc starting-day 1))
3367
3368(defun org-agenda-week-view (arg)
3369 "Switch agenda to week view."
3370 (interactive "P")
3371 (unless (boundp 'starting-day) 3444 (unless (boundp 'starting-day)
3372 (error "Not allowed")) 3445 (error "Not allowed"))
3373 (setq org-agenda-ndays 3446 (setq org-agenda-ndays
@@ -3397,6 +3470,21 @@ With prefix ARG, go back that many times `org-agenda-ndays'."
3397 (if (not (re-search-backward "^\\S-" nil t arg)) 3470 (if (not (re-search-backward "^\\S-" nil t arg))
3398 (error "No previous date before this line in this buffer."))) 3471 (error "No previous date before this line in this buffer.")))
3399 3472
3473;; Initialize the highlight
3474(defvar org-hl (funcall (if org-xemacs-p 'make-extent 'make-overlay) 1 1))
3475(funcall (if org-xemacs-p 'set-extent-property 'overlay-put) org-hl
3476 'face 'highlight)
3477
3478(defun org-highlight (begin end &optional buffer)
3479 "Highlight a region with overlay."
3480 (funcall (if org-xemacs-p 'set-extent-endpoints 'move-overlay)
3481 org-hl begin end (or buffer (current-buffer))))
3482
3483(defun org-unhighlight ()
3484 "Detach overlay INDEX."
3485 (funcall (if org-xemacs-p 'detach-extent 'delete-overlay) org-hl))
3486
3487
3400(defun org-agenda-follow-mode () 3488(defun org-agenda-follow-mode ()
3401 "Toggle follow mode in an agenda buffer." 3489 "Toggle follow mode in an agenda buffer."
3402 (interactive) 3490 (interactive)
@@ -3430,21 +3518,22 @@ With prefix ARG, go back that many times `org-agenda-ndays'."
3430 (get-text-property (point) 'org-marker)) 3518 (get-text-property (point) 'org-marker))
3431 (org-agenda-show))) 3519 (org-agenda-show)))
3432 3520
3521(defvar org-disable-diary nil) ;Dynamically-scoped param.
3522
3433(defun org-get-entries-from-diary (date) 3523(defun org-get-entries-from-diary (date)
3434 "Get the (emacs calendar) diary entries for DATE." 3524 "Get the (Emacs Calendar) diary entries for DATE."
3435 (let* ((fancy-diary-buffer "*temporary-fancy-diary-buffer*") 3525 (let* ((fancy-diary-buffer "*temporary-fancy-diary-buffer*")
3436 (diary-display-hook '(fancy-diary-display)) 3526 (diary-display-hook '(fancy-diary-display))
3437 (list-diary-entries-hook 3527 (list-diary-entries-hook
3438 (cons 'org-diary-default-entry list-diary-entries-hook)) 3528 (cons 'org-diary-default-entry list-diary-entries-hook))
3439 entries 3529 entries tod tods
3440 (disable-org-diary t)) 3530 (org-disable-diary t))
3441 (save-excursion 3531 (save-excursion
3442 (save-window-excursion 3532 (save-window-excursion
3443 (list-diary-entries date 1))) 3533 (list-diary-entries date 1)))
3444 (if (not (get-buffer fancy-diary-buffer)) 3534 (if (not (get-buffer fancy-diary-buffer))
3445 (setq entries nil) 3535 (setq entries nil)
3446 (save-excursion 3536 (with-current-buffer fancy-diary-buffer
3447 (switch-to-buffer fancy-diary-buffer)
3448 (setq buffer-read-only nil) 3537 (setq buffer-read-only nil)
3449 (if (= (point-max) 1) 3538 (if (= (point-max) 1)
3450 ;; No entries 3539 ;; No entries
@@ -3452,11 +3541,6 @@ With prefix ARG, go back that many times `org-agenda-ndays'."
3452 ;; Omit the date and other unnecessary stuff 3541 ;; Omit the date and other unnecessary stuff
3453 (org-agenda-cleanup-fancy-diary) 3542 (org-agenda-cleanup-fancy-diary)
3454 ;; Add prefix to each line and extend the text properties 3543 ;; Add prefix to each line and extend the text properties
3455 (goto-char (point-min))
3456 (while (and (re-search-forward "^" nil t) (not (eobp)))
3457 (replace-match " Diary: ")
3458 (add-text-properties (point-at-bol) (point)
3459 (text-properties-at (point))))
3460 (if (= (point-max) 1) 3544 (if (= (point-max) 1)
3461 (setq entries nil) 3545 (setq entries nil)
3462 (setq entries (buffer-substring (point-min) (- (point-max) 1))))) 3546 (setq entries (buffer-substring (point-min) (- (point-max) 1)))))
@@ -3467,31 +3551,33 @@ With prefix ARG, go back that many times `org-agenda-ndays'."
3467 (setq entries 3551 (setq entries
3468 (mapcar 3552 (mapcar
3469 (lambda (x) 3553 (lambda (x)
3470 (if (string-match "\\<\\([012][0-9]\\):\\([0-6][0-9]\\)" x) 3554 (setq x (org-format-agenda-item "" x "Diary"))
3471 (add-text-properties 3555 ;; Extend the text properties to the beginning of the line
3472 1 (length x) 3556 (add-text-properties
3473 (list 'time-of-day 3557 0 (length x)
3474 (+ (* 100 (string-to-number 3558 (text-properties-at (1- (length x)) x)
3475 (match-string 1 x))) 3559 x)
3476 (string-to-number (match-string 2 x))))
3477 x))
3478 x) 3560 x)
3479 entries))))) 3561 entries)))))
3480 3562
3481(defun org-agenda-cleanup-fancy-diary () 3563(defun org-agenda-cleanup-fancy-diary ()
3482 "Remove unwanted stuff in buffer created by fancy-diary-display. 3564 "Remove unwanted stuff in buffer created by fancy-diary-display.
3483This gets rid of the date, the underline under the date, and 3565This gets rid of the date, the underline under the date, and
3484the dummy entry installed by org-mode to ensure non-empty diary for each 3566the dummy entry installed by `org-mode' to ensure non-empty diary for each
3485date." 3567date. Itt also removes lines that contain only whitespace."
3486 (goto-char (point-min)) 3568 (goto-char (point-min))
3487 (if (looking-at ".*?:[ \t]*") 3569 (if (looking-at ".*?:[ \t]*")
3488 (progn 3570 (progn
3489 (replace-match "") 3571 (replace-match "")
3490 (re-search-forward "\n=+$" nil t) 3572 (re-search-forward "\n=+$" nil t)
3491 (replace-match "") 3573 (replace-match "")
3492 (while (re-search-backward "^ +" nil t) (replace-match ""))) 3574 (while (re-search-backward "^ +\n?" nil t) (replace-match "")))
3493 (re-search-forward "\n=+$" nil t) 3575 (re-search-forward "\n=+$" nil t)
3494 (delete-region (point-min) (min (point-max) (1+ (match-end 0))))) 3576 (delete-region (point-min) (min (point-max) (1+ (match-end 0)))))
3577 (goto-char (point-min))
3578 (while (re-search-forward "^ +\n" nil t)
3579 (replace-match ""))
3580 (goto-char (point-min))
3495 (if (re-search-forward "^Org-mode dummy\n?" nil t) 3581 (if (re-search-forward "^Org-mode dummy\n?" nil t)
3496 (replace-match ""))) 3582 (replace-match "")))
3497 3583
@@ -3501,7 +3587,7 @@ date."
3501(eval-after-load "diary-lib" 3587(eval-after-load "diary-lib"
3502 '(defadvice add-to-diary-list (before org-mark-diary-entry activate) 3588 '(defadvice add-to-diary-list (before org-mark-diary-entry activate)
3503 "Make the position visible." 3589 "Make the position visible."
3504 (if (and (boundp 'disable-org-diary) ;; called from org-agenda 3590 (if (and org-disable-diary ;; called from org-agenda
3505 (stringp string) 3591 (stringp string)
3506 (buffer-file-name)) 3592 (buffer-file-name))
3507 (add-text-properties 3593 (add-text-properties
@@ -3606,7 +3692,7 @@ sure that TODAY is included in the list."
3606 3692
3607;;;###autoload 3693;;;###autoload
3608(defun org-diary (&rest args) 3694(defun org-diary (&rest args)
3609 "Returns diary information from org-files. 3695 "Return diary information from org-files.
3610This function can be used in a \"sexp\" diary entry in the Emacs calendar. 3696This function can be used in a \"sexp\" diary entry in the Emacs calendar.
3611It accesses org files and extracts information from those files to be 3697It accesses org files and extracts information from those files to be
3612listed in the diary. The function accepts arguments specifying what 3698listed in the diary. The function accepts arguments specifying what
@@ -3649,6 +3735,7 @@ The function expects the lisp variables `entry' and `date' to be provided
3649by the caller, because this is how the calendar works. Don't use this 3735by the caller, because this is how the calendar works. Don't use this
3650function from a program - use `org-agenda-get-day-entries' instead." 3736function from a program - use `org-agenda-get-day-entries' instead."
3651 (org-agenda-maybe-reset-markers) 3737 (org-agenda-maybe-reset-markers)
3738 (org-compile-agenda-prefix-format org-agenda-prefix-format)
3652 (setq args (or args '(:deadline :scheduled :timestamp))) 3739 (setq args (or args '(:deadline :scheduled :timestamp)))
3653 (let* ((files (if (and entry (stringp entry) (string-match "\\S-" entry)) 3740 (let* ((files (if (and entry (stringp entry) (string-match "\\S-" entry))
3654 (list entry) 3741 (list entry)
@@ -3656,14 +3743,14 @@ function from a program - use `org-agenda-get-day-entries' instead."
3656 file rtn results) 3743 file rtn results)
3657 ;; If this is called during org-agenda, don't return any entries to 3744 ;; If this is called during org-agenda, don't return any entries to
3658 ;; the calendar. Org Agenda will list these entries itself. 3745 ;; the calendar. Org Agenda will list these entries itself.
3659 (if (boundp 'disable-org-diary) (setq files nil)) 3746 (if org-disable-diary (setq files nil))
3660 (while (setq file (pop files)) 3747 (while (setq file (pop files))
3661 (setq rtn (apply 'org-agenda-get-day-entries file date args)) 3748 (setq rtn (apply 'org-agenda-get-day-entries file date args))
3662 (setq results (append results rtn))) 3749 (setq results (append results rtn)))
3663 (concat (org-finalize-agenda-entries results) "\n"))) 3750 (concat (org-finalize-agenda-entries results) "\n")))
3664 3751
3665(defun org-agenda-get-day-entries (file date &rest args) 3752(defun org-agenda-get-day-entries (file date &rest args)
3666 "Does the work for `org-diary' and `org-agenda' 3753 "Does the work for `org-diary' and `org-agenda'.
3667FILE is the path to a file to be checked for entries. DATE is date like 3754FILE is the path to a file to be checked for entries. DATE is date like
3668the one returned by `calendar-current-date'. ARGS are symbols indicating 3755the one returned by `calendar-current-date'. ARGS are symbols indicating
3669which kind of entries should be extracted. For details about these, see 3756which kind of entries should be extracted. For details about these, see
@@ -3672,26 +3759,26 @@ the documentation of `org-diary'."
3672 (let* ((org-startup-with-deadline-check nil) 3759 (let* ((org-startup-with-deadline-check nil)
3673 (org-startup-folded nil) 3760 (org-startup-folded nil)
3674 (buffer (if (file-exists-p file) 3761 (buffer (if (file-exists-p file)
3675; (find-file-noselect file)
3676 (org-get-agenda-file-buffer file) 3762 (org-get-agenda-file-buffer file)
3677 (error "No such file %s" file))) 3763 (error "No such file %s" file)))
3678 (respect-narrow-p (boundp 'org-respect-restriction))
3679 arg results rtn) 3764 arg results rtn)
3680 (if (not buffer) 3765 (if (not buffer)
3681 ;; If file does not exist, make sure an error message ends up in diary 3766 ;; If file does not exist, make sure an error message ends up in diary
3682 (format "ORG-AGENDA-ERROR: No such org-file %s" file) 3767 (format "ORG-AGENDA-ERROR: No such org-file %s" file)
3683 (save-excursion 3768 (with-current-buffer buffer
3684 (set-buffer buffer) 3769 (unless (eq major-mode 'org-mode)
3770 (error "Agenda file %s is not in `org-mode'" file))
3685 (let ((case-fold-search nil)) 3771 (let ((case-fold-search nil))
3686 (save-excursion 3772 (save-excursion
3687 (save-restriction 3773 (save-restriction
3688 (if respect-narrow-p 3774 (if org-respect-restriction
3689 (if (org-region-active-p) 3775 (if (org-region-active-p)
3690 ;; Respect a region to restrict search 3776 ;; Respect a region to restrict search
3691 (narrow-to-region (region-beginning) (region-end))) 3777 (narrow-to-region (region-beginning) (region-end)))
3692 ;; If we work for the calendar or many files, 3778 ;; If we work for the calendar or many files,
3693 ;; get rid of any restriction 3779 ;; get rid of any restriction
3694 (widen)) 3780 (widen))
3781 ;; The way we repeatedly append to `results' makes it O(n^2) :-(
3695 (while (setq arg (pop args)) 3782 (while (setq arg (pop args))
3696 (cond 3783 (cond
3697 ((and (eq arg :todo) 3784 ((and (eq arg :todo)
@@ -3748,7 +3835,7 @@ the documentation of `org-diary'."
3748 (regexp (concat "[\n\r]\\*+ *\\(" org-not-done-regexp 3835 (regexp (concat "[\n\r]\\*+ *\\(" org-not-done-regexp
3749 "[^\n\r]*\\)")) 3836 "[^\n\r]*\\)"))
3750 marker priority 3837 marker priority
3751 ee txt pl) 3838 ee txt)
3752 (goto-char (point-min)) 3839 (goto-char (point-min))
3753 (while (re-search-forward regexp nil t) 3840 (while (re-search-forward regexp nil t)
3754 (goto-char (match-beginning 1)) 3841 (goto-char (match-beginning 1))
@@ -3855,7 +3942,7 @@ the documentation of `org-diary'."
3855 (todayp (equal date (calendar-current-date))) ; DATE bound by calendar 3942 (todayp (equal date (calendar-current-date))) ; DATE bound by calendar
3856 (d1 (calendar-absolute-from-gregorian date)) ; DATE bound by calendar 3943 (d1 (calendar-absolute-from-gregorian date)) ; DATE bound by calendar
3857 d2 diff pos pos1 3944 d2 diff pos pos1
3858 ee txt head hdmarker) 3945 ee txt head)
3859 (goto-char (point-min)) 3946 (goto-char (point-min))
3860 (while (re-search-forward regexp nil t) 3947 (while (re-search-forward regexp nil t)
3861 (setq pos (1- (match-beginning 1)) 3948 (setq pos (1- (match-beginning 1))
@@ -3913,7 +4000,7 @@ the documentation of `org-diary'."
3913 (regexp org-scheduled-time-regexp) 4000 (regexp org-scheduled-time-regexp)
3914 (todayp (equal date (calendar-current-date))) ; DATE bound by calendar 4001 (todayp (equal date (calendar-current-date))) ; DATE bound by calendar
3915 (d1 (calendar-absolute-from-gregorian date)) ; DATE bound by calendar 4002 (d1 (calendar-absolute-from-gregorian date)) ; DATE bound by calendar
3916 d2 diff marker hdmarker pos pos1 4003 d2 diff pos pos1
3917 ee txt head) 4004 ee txt head)
3918 (goto-char (point-min)) 4005 (goto-char (point-min))
3919 (while (re-search-forward regexp nil t) 4006 (while (re-search-forward regexp nil t)
@@ -3990,38 +4077,66 @@ the documentation of `org-diary'."
3990 ;; Sort the entries by expiration date. 4077 ;; Sort the entries by expiration date.
3991 (nreverse ee))) 4078 (nreverse ee)))
3992 4079
3993 4080(defun org-format-agenda-item (prefix txt &optional category)
3994(defun org-format-agenda-item (prefix txt)
3995 "Format TXT to be inserted into the agenda buffer. 4081 "Format TXT to be inserted into the agenda buffer.
3996In particular, this indents the line and adds a category." 4082In particular, this indents the line and adds a category."
3997 (let ((cat (or org-category 4083 (let* ((category (or category
3998 (file-name-sans-extension 4084 org-category
3999 (file-name-nondirectory (buffer-file-name))))) 4085 (file-name-sans-extension
4000 time rtn) 4086 (file-name-nondirectory (buffer-file-name)))))
4001 (if (symbolp cat) (setq cat (symbol-name cat))) 4087 (extra prefix)
4002 (setq rtn (format " %-10s %s%s" (concat cat ":") prefix txt)) 4088 (time-of-day (org-get-time-of-day txt))
4003 (add-text-properties 4089 (t1 (if time-of-day (concat "0" (int-to-string time-of-day)) "0000"))
4004 0 2 (list 'category (downcase cat) 4090 (time (if time-of-day
4005 'prefix-length (- (length rtn) (length txt)) 4091 (concat (substring t1 -4 -2)
4006 'time-of-day (org-get-time-of-day rtn)) 4092 ":" (substring t1 -2))
4093 ""))
4094 rtn)
4095 (if (symbolp category) (setq category (symbol-name category)))
4096 (setq rtn (concat (eval org-prefix-format-compiled) txt))
4097 (add-text-properties
4098 0 (length rtn) (list 'category (downcase category)
4099 'prefix-length (- (length rtn) (length txt))
4100 'time-of-day time-of-day)
4007 rtn) 4101 rtn)
4008 rtn)) 4102 rtn))
4009 4103
4010;; FIXME: Should this be restricted to beginning of string? 4104(defun org-compile-prefix-format (format)
4105 "Compile the prefix format into a Lisp form that can be evaluated.
4106The resulting form is returned and stored in the variable
4107`org-prefix-format-compiled'."
4108 (let ((start 0) varform vars (s format) c)
4109 (while (string-match "%\\([-+]?[0-9.]*\\)\\([ .;,:!?=|/<>]?\\)\\([cts]\\)"
4110 s start)
4111 (setq var (cdr (assoc (match-string 3 s)
4112 '(("c" . category) ("t" . time) ("s" . extra))))
4113 c (match-string 2 s)
4114 start (1+ (match-beginning 0)))
4115 (if (= (length c) 1)
4116 (setq varform `(if (equal "" ,var) "" (concat ,var ,c)))
4117 (setq varform var))
4118 (setq s (replace-match "%\\1s" t nil s))
4119 (push varform vars))
4120 (setq vars (nreverse vars))
4121 (setq org-prefix-format-compiled `(format ,s ,@vars))))
4122
4011(defun org-get-time-of-day (s) 4123(defun org-get-time-of-day (s)
4012 "Check string S for a time of day." 4124 "Check string S for a time of day.
4125If found, return it as a military time number between 0 and 2400.
4126If not found, return nil."
4013 (save-match-data 4127 (save-match-data
4014 (when (and 4128 (when (or
4015 (string-match 4129 (string-match
4016 "\\<\\([012][0-9]\\)\\(:\\([0-6][0-9]\\)\\)?\\([AaPp][Mm]\\)?\\>" s) 4130 "\\<\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)\\([AaPp][Mm]\\)?\\>" s)
4017 (or (match-beginning 2) (match-beginning 4))) 4131 (string-match
4018 (+ (* 100 (+ (string-to-number (match-string 1 s)) 4132 "\\<\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)?\\([AaPp][Mm]\\)\\>" s))
4019 (if (and (match-beginning 4) 4133 (+ (* 100 (+ (string-to-number (match-string 1 s))
4020 (equal (downcase (match-string 4 s)) "pm")) 4134 (if (and (match-beginning 4)
4021 12 0))) 4135 (equal (downcase (match-string 4 s)) "pm"))
4022 (if (match-beginning 3) 4136 12 0)))
4023 (string-to-number (match-string 3 s)) 4137 (if (match-beginning 3)
4024 0))))) 4138 (string-to-number (match-string 3 s))
4139 0)))))
4025 4140
4026(defun org-finalize-agenda-entries (list) 4141(defun org-finalize-agenda-entries (list)
4027 "Sort and concatenate the agenda items." 4142 "Sort and concatenate the agenda items."
@@ -4073,7 +4188,7 @@ and by additional input from the age of a schedules or deadline entry."
4073 (let* ((pri (get-text-property (point-at-bol) 'priority))) 4188 (let* ((pri (get-text-property (point-at-bol) 'priority)))
4074 (message "Priority is %d" (if pri pri -1000)))) 4189 (message "Priority is %d" (if pri pri -1000))))
4075 4190
4076(defun org-agenda-goto () 4191(defun org-agenda-goto (&optional highlight)
4077 "Go to the Org-mode file which contains the item at point." 4192 "Go to the Org-mode file which contains the item at point."
4078 (interactive) 4193 (interactive)
4079 (let* ((marker (or (get-text-property (point) 'org-marker) 4194 (let* ((marker (or (get-text-property (point) 'org-marker)
@@ -4087,7 +4202,8 @@ and by additional input from the age of a schedules or deadline entry."
4087 (org-show-hidden-entry) 4202 (org-show-hidden-entry)
4088 (save-excursion 4203 (save-excursion
4089 (and (outline-next-heading) 4204 (and (outline-next-heading)
4090 (org-flag-heading nil)))))) ; show the next heading 4205 (org-flag-heading nil)))) ; show the next heading
4206 (and highlight (org-highlight (point-at-bol) (point-at-eol)))))
4091 4207
4092(defun org-agenda-switch-to () 4208(defun org-agenda-switch-to ()
4093 "Go to the Org-mode file which contains the item at point." 4209 "Go to the Org-mode file which contains the item at point."
@@ -4116,14 +4232,14 @@ and by additional input from the age of a schedules or deadline entry."
4116 "Display the Org-mode file which contains the item at point." 4232 "Display the Org-mode file which contains the item at point."
4117 (interactive) 4233 (interactive)
4118 (let ((win (selected-window))) 4234 (let ((win (selected-window)))
4119 (org-agenda-goto) 4235 (org-agenda-goto t)
4120 (select-window win))) 4236 (select-window win)))
4121 4237
4122(defun org-agenda-recenter (arg) 4238(defun org-agenda-recenter (arg)
4123 "Display the Org-mode file which contains the item at point and recenter." 4239 "Display the Org-mode file which contains the item at point and recenter."
4124 (interactive "P") 4240 (interactive "P")
4125 (let ((win (selected-window))) 4241 (let ((win (selected-window)))
4126 (org-agenda-goto) 4242 (org-agenda-goto t)
4127 (recenter arg) 4243 (recenter arg)
4128 (select-window win))) 4244 (select-window win)))
4129 4245
@@ -4159,8 +4275,7 @@ the same tree node, and the headline of the tree node in the Org-mode file."
4159 (hdmarker (get-text-property (point) 'org-hd-marker)) 4275 (hdmarker (get-text-property (point) 'org-hd-marker))
4160 (buffer-read-only nil) 4276 (buffer-read-only nil)
4161 newhead) 4277 newhead)
4162 (save-excursion 4278 (with-current-buffer buffer
4163 (set-buffer buffer)
4164 (widen) 4279 (widen)
4165 (goto-char pos) 4280 (goto-char pos)
4166 (org-show-hidden-entry) 4281 (org-show-hidden-entry)
@@ -4225,18 +4340,14 @@ This changes the line at point, all other lines in the agenda referring to
4225the same tree node, and the headline of the tree node in the Org-mode file." 4340the same tree node, and the headline of the tree node in the Org-mode file."
4226 (interactive) 4341 (interactive)
4227 (org-agenda-check-no-diary) 4342 (org-agenda-check-no-diary)
4228 (let* ((props (text-properties-at (point))) 4343 (let* ((marker (or (get-text-property (point) 'org-marker)
4229 (col (current-column))
4230 (marker (or (get-text-property (point) 'org-marker)
4231 (org-agenda-error))) 4344 (org-agenda-error)))
4232 (pl (get-text-property (point-at-bol) 'prefix-length))
4233 (buffer (marker-buffer marker)) 4345 (buffer (marker-buffer marker))
4234 (pos (marker-position marker)) 4346 (pos (marker-position marker))
4235 (hdmarker (get-text-property (point) 'org-hd-marker)) 4347 (hdmarker (get-text-property (point) 'org-hd-marker))
4236 (buffer-read-only nil) 4348 (buffer-read-only nil)
4237 newhead) 4349 newhead)
4238 (save-excursion 4350 (with-current-buffer buffer
4239 (set-buffer buffer)
4240 (widen) 4351 (widen)
4241 (goto-char pos) 4352 (goto-char pos)
4242 (org-show-hidden-entry) 4353 (org-show-hidden-entry)
@@ -4271,20 +4382,21 @@ the same tree node, and the headline of the tree node in the Org-mode file."
4271 (org-agenda-date-later (- arg) what)) 4382 (org-agenda-date-later (- arg) what))
4272 4383
4273(defun org-agenda-date-prompt (arg) 4384(defun org-agenda-date-prompt (arg)
4274 "Change the date of this item. Date is prompted for, with default today." 4385 "Change the date of this item. Date is prompted for, with default today.
4275 (interactive "p") 4386The prefix ARG is passed to the `org-time-stamp' command and can therefore
4387be used to request time specification in the time stamp."
4388 (interactive "P")
4276 (org-agenda-check-no-diary) 4389 (org-agenda-check-no-diary)
4277 (let* ((marker (or (get-text-property (point) 'org-marker) 4390 (let* ((marker (or (get-text-property (point) 'org-marker)
4278 (org-agenda-error))) 4391 (org-agenda-error)))
4279 (buffer (marker-buffer marker)) 4392 (buffer (marker-buffer marker))
4280 (pos (marker-position marker))) 4393 (pos (marker-position marker)))
4281 (save-excursion 4394 (with-current-buffer buffer
4282 (set-buffer buffer)
4283 (widen) 4395 (widen)
4284 (goto-char pos) 4396 (goto-char pos)
4285 (if (not (org-at-timestamp-p)) 4397 (if (not (org-at-timestamp-p))
4286 (error "Cannot find time stamp")) 4398 (error "Cannot find time stamp"))
4287 (org-time-stamp nil) 4399 (org-time-stamp arg)
4288 (message "Time stamp changed to %s" org-last-changed-timestamp)))) 4400 (message "Time stamp changed to %s" org-last-changed-timestamp))))
4289 4401
4290(defun org-get-heading () 4402(defun org-get-heading ()
@@ -4295,10 +4407,10 @@ the same tree node, and the headline of the tree node in the Org-mode file."
4295 (match-string 1) 4407 (match-string 1)
4296 ""))) 4408 "")))
4297 4409
4298(defun org-agenda-diary-entry (arg) 4410(defun org-agenda-diary-entry ()
4299 "Make a diary entry, like the `i' command from the calendar. 4411 "Make a diary entry, like the `i' command from the calendar.
4300All the standard commands work: block, weekly etc" 4412All the standard commands work: block, weekly etc"
4301 (interactive "P") 4413 (interactive)
4302 (require 'diary-lib) 4414 (require 'diary-lib)
4303 (let* ((char (progn 4415 (let* ((char (progn
4304 (message "Diary entry: [d]ay [w]eekly [m]onthly [y]early [a]nniversary [b]lock [c]yclic") 4416 (message "Diary entry: [d]ay [w]eekly [m]onthly [y]early [a]nniversary [b]lock [c]yclic")
@@ -4344,7 +4456,6 @@ the cursor position."
4344 (error "Don't know which date to use for calendar command")) 4456 (error "Don't know which date to use for calendar command"))
4345 (let* ((oldf (symbol-function 'calendar-cursor-to-date)) 4457 (let* ((oldf (symbol-function 'calendar-cursor-to-date))
4346 (point (point)) 4458 (point (point))
4347 (mark (or (mark t) (point)))
4348 (date (calendar-gregorian-from-absolute 4459 (date (calendar-gregorian-from-absolute
4349 (get-text-property point 'day))) 4460 (get-text-property point 'day)))
4350 (displayed-day (extract-calendar-day date)) 4461 (displayed-day (extract-calendar-day date))
@@ -4527,11 +4638,25 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file."
4527(defun org-follow-bbdb-link (name) 4638(defun org-follow-bbdb-link (name)
4528 "Follow a BBDB link to NAME." 4639 "Follow a BBDB link to NAME."
4529 (require 'bbdb) 4640 (require 'bbdb)
4530 ;; First try an exact match 4641 (let ((inhibit-redisplay t))
4531 (bbdb-name (concat "\\`" name "\\'") nil) 4642 (catch 'exit
4532 (if (= 0 (buffer-size (get-buffer "*BBDB*"))) 4643 ;; Exact match on name
4533 ;; No exact match - try partial match 4644 (bbdb-name (concat "\\`" name "\\'") nil)
4534 (bbdb-name name nil))) 4645 (if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
4646 ;; Exact match on name
4647 (bbdb-company (concat "\\`" name "\\'") nil)
4648 (if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
4649 ;; Partial match on name
4650 (bbdb-name name nil)
4651 (if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
4652 ;; Partial match on company
4653 (bbdb-company name nil)
4654 (if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
4655 ;; General match including network address and notes
4656 (bbdb name nil)
4657 (when (= 0 (buffer-size (get-buffer "*BBDB*")))
4658 (delete-window (get-buffer-window "*BBDB*"))
4659 (error "No matching BBDB record")))))
4535 4660
4536(defun org-follow-gnus-link (&optional group article) 4661(defun org-follow-gnus-link (&optional group article)
4537 "Follow a Gnus link to GROUP and ARTICLE." 4662 "Follow a Gnus link to GROUP and ARTICLE."
@@ -4545,7 +4670,6 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file."
4545 (gnus-summary-insert-cached-articles) 4670 (gnus-summary-insert-cached-articles)
4546 (gnus-summary-goto-article article nil 'force)) 4671 (gnus-summary-goto-article article nil 'force))
4547 (message "Message could not be found."))))) 4672 (message "Message could not be found.")))))
4548;; (if article (gnus-summary-goto-article article nil 'force)))
4549 4673
4550(defun org-follow-vm-link (&optional folder article readonly) 4674(defun org-follow-vm-link (&optional folder article readonly)
4551 "Follow a VM link to FOLDER and ARTICLE." 4675 "Follow a VM link to FOLDER and ARTICLE."
@@ -4681,8 +4805,9 @@ For file links, arg negates `org-line-numbers-in-file-links'."
4681 4805
4682 ((eq major-mode 'bbdb-mode) 4806 ((eq major-mode 'bbdb-mode)
4683 (setq link (concat "bbdb:" 4807 (setq link (concat "bbdb:"
4684 (bbdb-record-name (bbdb-current-record))))) 4808 (or (bbdb-record-name (bbdb-current-record))
4685 4809 (bbdb-record-company (bbdb-current-record))))))
4810
4686 ((eq major-mode 'calendar-mode) 4811 ((eq major-mode 'calendar-mode)
4687 (let ((cd (calendar-cursor-to-date))) 4812 (let ((cd (calendar-cursor-to-date)))
4688 (setq link 4813 (setq link
@@ -4702,7 +4827,6 @@ For file links, arg negates `org-line-numbers-in-file-links'."
4702 (folder (buffer-file-name)) 4827 (folder (buffer-file-name))
4703 (subject (vm-su-subject message)) 4828 (subject (vm-su-subject message))
4704 (author (vm-su-full-name message)) 4829 (author (vm-su-full-name message))
4705 (address (vm-su-from message))
4706 (message-id (vm-su-message-id message))) 4830 (message-id (vm-su-message-id message)))
4707 (setq folder (abbreviate-file-name folder)) 4831 (setq folder (abbreviate-file-name folder))
4708 (if (string-match (concat "^" (regexp-quote vm-folder-directory)) 4832 (if (string-match (concat "^" (regexp-quote vm-folder-directory))
@@ -4747,9 +4871,8 @@ For file links, arg negates `org-line-numbers-in-file-links'."
4747 group)) 4871 group))
4748 (setq link (concat "gnus:" group))))) 4872 (setq link (concat "gnus:" group)))))
4749 4873
4750 ((or (eq major-mode 'gnus-summary-mode) 4874 ((memq major-mode '(gnus-summary-mode gnus-article-mode))
4751 (eq major-mode 'gnus-article-mode)) 4875 (and (eq major-mode 'gnus-article-mode) (gnus-article-show-summary))
4752 (gnus-article-show-summary)
4753 (gnus-summary-beginning-of-article) 4876 (gnus-summary-beginning-of-article)
4754 (let* ((group (car gnus-article-current)) 4877 (let* ((group (car gnus-article-current))
4755 (article (cdr gnus-article-current)) 4878 (article (cdr gnus-article-current))
@@ -4825,8 +4948,7 @@ For file links, arg negates `org-line-numbers-in-file-links'."
4825 4948
4826 4949
4827(defun org-fixup-message-id-for-http (s) 4950(defun org-fixup-message-id-for-http (s)
4828 "Replace special characters in a message id, so that it can be used 4951 "Replace special characters in a message id, so it can be used in an http query."
4829in an http query."
4830 (while (string-match "<" s) 4952 (while (string-match "<" s)
4831 (setq s (replace-match "%3C" t t s))) 4953 (setq s (replace-match "%3C" t t s)))
4832 (while (string-match ">" s) 4954 (while (string-match ">" s)
@@ -4843,13 +4965,13 @@ Completion can be used to select a link previously stored with
4843press RET at the prompt), the link defaults to the most recently 4965press RET at the prompt), the link defaults to the most recently
4844stored link. 4966stored link.
4845 4967
4846With a C-u prefix, prompts for a file to link to. The file name can be 4968With a \\[universal-argument] prefix, prompts for a file to link to. The file name can be
4847selected using completion. The path to the file will be relative to 4969selected using completion. The path to the file will be relative to
4848the current directory if the file is in the current directory or a 4970the current directory if the file is in the current directory or a
4849subdirectory. Otherwise, the link will be the absolute path as 4971subdirectory. Otherwise, the link will be the absolute path as
4850completed in the minibuffer (i.e. normally ~/path/to/file). 4972completed in the minibuffer (i.e. normally ~/path/to/file).
4851 4973
4852With two C-u prefixes, enforce an absolute path even if the file 4974With two \\[universal-argument] prefixes, enforce an absolute path even if the file
4853is in the current directory or below." 4975is in the current directory or below."
4854 (interactive "P") 4976 (interactive "P")
4855 (let ((link (if complete-file 4977 (let ((link (if complete-file
@@ -4970,11 +5092,10 @@ See also the variable `org-reverse-note-order'."
4970 ;; Find the file 5092 ;; Find the file
4971 (if (not visiting) 5093 (if (not visiting)
4972 (find-file-noselect file)) 5094 (find-file-noselect file))
4973 (save-excursion 5095 (with-current-buffer (get-file-buffer file)
4974 (set-buffer (get-file-buffer file))
4975 (setq reversed (org-notes-order-reversed-p)) 5096 (setq reversed (org-notes-order-reversed-p))
4976 (save-restriction 5097 (save-excursion
4977 (save-excursion 5098 (save-restriction
4978 (widen) 5099 (widen)
4979 ;; Ask the User for a location 5100 ;; Ask the User for a location
4980 (setq spos (if fastp 1 (org-get-location 5101 (setq spos (if fastp 1 (org-get-location
@@ -5038,12 +5159,6 @@ See also the variable `org-reverse-note-order'."
5038;; Emacs package. We call the former org-type tables, and the latter 5159;; Emacs package. We call the former org-type tables, and the latter
5039;; table.el-type tables. 5160;; table.el-type tables.
5040 5161
5041;; We use a before-change function to check if a table might need
5042;; an update.
5043(defvar org-table-may-need-update t
5044 "Indicates of a table might need an update.
5045This variable is set by `org-before-change-function'. `org-table-align'
5046sets it back to nil.")
5047 5162
5048(defun org-before-change-function (beg end) 5163(defun org-before-change-function (beg end)
5049 "Every change indicates that a table might need an update." 5164 "Every change indicates that a table might need an update."
@@ -5058,7 +5173,7 @@ sets it back to nil.")
5058(defconst org-table1-hline-regexp "^[ \t]*\\+-[-+]" 5173(defconst org-table1-hline-regexp "^[ \t]*\\+-[-+]"
5059 "Detects a table-type table hline.") 5174 "Detects a table-type table hline.")
5060(defconst org-table-any-line-regexp "^[ \t]*\\(|\\|\\+-[-+]\\)" 5175(defconst org-table-any-line-regexp "^[ \t]*\\(|\\|\\+-[-+]\\)"
5061 "Detects an org-type or table-type table") 5176 "Detects an org-type or table-type table.")
5062(defconst org-table-border-regexp "^[ \t]*[^| \t]" 5177(defconst org-table-border-regexp "^[ \t]*[^| \t]"
5063 "Searching from within a table (any type) this finds the first line 5178 "Searching from within a table (any type) this finds the first line
5064outside the table.") 5179outside the table.")
@@ -5210,9 +5325,9 @@ This is being used to correctly align a single field after TAB or RET.")
5210This is being used to correctly align a single field after TAB or RET.") 5325This is being used to correctly align a single field after TAB or RET.")
5211 5326
5212 5327
5213(defun org-table-align (&optional arg) 5328(defun org-table-align ()
5214 "Align the table at point by aligning all vertical bars." 5329 "Align the table at point by aligning all vertical bars."
5215 (interactive "P") 5330 (interactive)
5216 (let* ( 5331 (let* (
5217 ;; Limits of table 5332 ;; Limits of table
5218 (beg (org-table-begin)) 5333 (beg (org-table-begin))
@@ -5366,10 +5481,10 @@ With argument TABLE-TYPE, go to the end of a table.el-type table."
5366 (setq org-table-may-need-update t)) 5481 (setq org-table-may-need-update t))
5367 (goto-char pos)))))) 5482 (goto-char pos))))))
5368 5483
5369(defun org-table-next-field (&optional arg) 5484(defun org-table-next-field ()
5370 "Go to the next field in the current table. 5485 "Go to the next field in the current table.
5371Before doing so, re-align the table if necessary." 5486Before doing so, re-align the table if necessary."
5372 (interactive "P") 5487 (interactive)
5373 (if (and org-table-automatic-realign 5488 (if (and org-table-automatic-realign
5374 org-table-may-need-update) 5489 org-table-may-need-update)
5375 (org-table-align)) 5490 (org-table-align))
@@ -5388,10 +5503,10 @@ Before doing so, re-align the table if necessary."
5388 (error 5503 (error
5389 (org-table-insert-row 'below)))) 5504 (org-table-insert-row 'below))))
5390 5505
5391(defun org-table-previous-field (&optional arg) 5506(defun org-table-previous-field ()
5392 "Go to the previous field in the table. 5507 "Go to the previous field in the table.
5393Before doing so, re-align the table if necessary." 5508Before doing so, re-align the table if necessary."
5394 (interactive "P") 5509 (interactive)
5395 (if (and org-table-automatic-realign 5510 (if (and org-table-automatic-realign
5396 org-table-may-need-update) 5511 org-table-may-need-update)
5397 (org-table-align)) 5512 (org-table-align))
@@ -5404,10 +5519,10 @@ Before doing so, re-align the table if necessary."
5404 (if (looking-at "| ?") 5519 (if (looking-at "| ?")
5405 (goto-char (match-end 0)))) 5520 (goto-char (match-end 0))))
5406 5521
5407(defun org-table-next-row (&optional arg) 5522(defun org-table-next-row ()
5408 "Go to the next row (same column) in the current table. 5523 "Go to the next row (same column) in the current table.
5409Before doing so, re-align the table if necessary." 5524Before doing so, re-align the table if necessary."
5410 (interactive "P") 5525 (interactive)
5411 (if (or (looking-at "[ \t]*$") 5526 (if (or (looking-at "[ \t]*$")
5412 (save-excursion (skip-chars-backward " \t") (bolp))) 5527 (save-excursion (skip-chars-backward " \t") (bolp)))
5413 (newline) 5528 (newline)
@@ -5470,6 +5585,9 @@ I.e. not on a hline or before the first or after the last column?"
5470 (looking-at "[ \t]*$")) 5585 (looking-at "[ \t]*$"))
5471 (error "Not in table data field"))) 5586 (error "Not in table data field")))
5472 5587
5588(defvar org-table-clip nil
5589 "Clipboard for table regions")
5590
5473(defun org-table-blank-field () 5591(defun org-table-blank-field ()
5474 "Blank the current table field or active region." 5592 "Blank the current table field or active region."
5475 (interactive) 5593 (interactive)
@@ -5497,7 +5615,6 @@ is always the old value."
5497 (backward-char 1) 5615 (backward-char 1)
5498 (if (looking-at "|[^|\r\n]*") 5616 (if (looking-at "|[^|\r\n]*")
5499 (let* ((pos (match-beginning 0)) 5617 (let* ((pos (match-beginning 0))
5500 (len (length (match-string 0)))
5501 (val (buffer-substring (1+ pos) (match-end 0)))) 5618 (val (buffer-substring (1+ pos) (match-end 0))))
5502 (if replace 5619 (if replace
5503 (replace-match (concat "|" replace))) 5620 (replace-match (concat "|" replace)))
@@ -5591,9 +5708,9 @@ However, when FORCE is non-nil, create new columns if necessary."
5591 (looking-at org-table-hline-regexp)) 5708 (looking-at org-table-hline-regexp))
5592 nil)) 5709 nil))
5593 5710
5594(defun org-table-insert-column (&optional arg) 5711(defun org-table-insert-column ()
5595 "Insert a new column into the table." 5712 "Insert a new column into the table."
5596 (interactive "P") 5713 (interactive)
5597 (if (not (org-at-table-p)) 5714 (if (not (org-at-table-p))
5598 (error "Not at a table")) 5715 (error "Not at a table"))
5599 (org-table-find-dataline) 5716 (org-table-find-dataline)
@@ -5634,9 +5751,9 @@ However, when FORCE is non-nil, create new columns if necessary."
5634 (error 5751 (error
5635 "Please position cursor in a data line for column operations"))))) 5752 "Please position cursor in a data line for column operations")))))
5636 5753
5637(defun org-table-delete-column (&optional arg) 5754(defun org-table-delete-column ()
5638 "Delete a column into the table." 5755 "Delete a column into the table."
5639 (interactive "P") 5756 (interactive)
5640 (if (not (org-at-table-p)) 5757 (if (not (org-at-table-p))
5641 (error "Not at a table")) 5758 (error "Not at a table"))
5642 (org-table-find-dataline) 5759 (org-table-find-dataline)
@@ -5777,9 +5894,9 @@ With prefix ARG, insert above the current line."
5777 (beginning-of-line 0) 5894 (beginning-of-line 0)
5778 (move-to-column col))) 5895 (move-to-column col)))
5779 5896
5780(defun org-table-kill-row (&optional arg) 5897(defun org-table-kill-row ()
5781 "Delete the current row or horizontal line from the table." 5898 "Delete the current row or horizontal line from the table."
5782 (interactive "P") 5899 (interactive)
5783 (if (not (org-at-table-p)) 5900 (if (not (org-at-table-p))
5784 (error "Not at a table")) 5901 (error "Not at a table"))
5785 (let ((col (current-column))) 5902 (let ((col (current-column)))
@@ -5788,14 +5905,11 @@ With prefix ARG, insert above the current line."
5788 (move-to-column col))) 5905 (move-to-column col)))
5789 5906
5790 5907
5791(defun org-table-cut-region (&optional arg) 5908(defun org-table-cut-region ()
5792 "Copy region in table to the clipboard and blank all relevant fields." 5909 "Copy region in table to the clipboard and blank all relevant fields."
5793 (interactive "P") 5910 (interactive)
5794 (org-table-copy-region 'cut)) 5911 (org-table-copy-region 'cut))
5795 5912
5796(defvar org-table-clip nil
5797 "Clipboard for table regions")
5798
5799(defun org-table-copy-region (&optional cut) 5913(defun org-table-copy-region (&optional cut)
5800 "Copy rectangular region in table to clipboard. 5914 "Copy rectangular region in table to clipboard.
5801A special clipboard is used which can only be accessed 5915A special clipboard is used which can only be accessed
@@ -5832,20 +5946,19 @@ with `org-table-paste-rectangle'"
5832 (setq org-table-clip (nreverse region)) 5946 (setq org-table-clip (nreverse region))
5833 (if cut (org-table-align)))) 5947 (if cut (org-table-align))))
5834 5948
5835(defun org-table-paste-rectangle (&optional arg) 5949(defun org-table-paste-rectangle ()
5836 "Paste a rectangular region into a table. 5950 "Paste a rectangular region into a table.
5837The upper right corner ends up in the current field. All involved fields 5951The upper right corner ends up in the current field. All involved fields
5838will be overwritten. If the rectangle does not fit into the present table, 5952will be overwritten. If the rectangle does not fit into the present table,
5839the table is enlarged as needed. The process ignores horizontal separator 5953the table is enlarged as needed. The process ignores horizontal separator
5840lines." 5954lines."
5841 (interactive "P") 5955 (interactive)
5842 (unless (and org-table-clip (listp org-table-clip)) 5956 (unless (and org-table-clip (listp org-table-clip))
5843 (error "First cut/copy a region to paste!")) 5957 (error "First cut/copy a region to paste!"))
5844 (org-table-check-inside-data-field) 5958 (org-table-check-inside-data-field)
5845 (let* ((clip org-table-clip) 5959 (let* ((clip org-table-clip)
5846 (line (count-lines (point-min) (point))) 5960 (line (count-lines (point-min) (point)))
5847 (col (org-table-current-column)) 5961 (col (org-table-current-column))
5848 (l line)
5849 (org-enable-table-editor t) 5962 (org-enable-table-editor t)
5850 (org-table-automatic-realign nil) 5963 (org-table-automatic-realign nil)
5851 c cols field) 5964 c cols field)
@@ -5864,7 +5977,7 @@ lines."
5864 (org-table-align))) 5977 (org-table-align)))
5865 5978
5866(defun org-table-convert () 5979(defun org-table-convert ()
5867 "Convert from org-mode table to table.el and back. 5980 "Convert from `org-mode' table to table.el and back.
5868Obviously, this only works within limits. When an Org-mode table is 5981Obviously, this only works within limits. When an Org-mode table is
5869converted to table.el, all horizontal separator lines get lost, because 5982converted to table.el, all horizontal separator lines get lost, because
5870table.el uses these as cell boundaries and has no notion of horizontal lines. 5983table.el uses these as cell boundaries and has no notion of horizontal lines.
@@ -5915,7 +6028,7 @@ lines, in order to keep the table compact.
5915If there is an active region, and both point and mark are in the same column, 6028If there is an active region, and both point and mark are in the same column,
5916the text in the column is wrapped to minimum width for the given number of 6029the text in the column is wrapped to minimum width for the given number of
5917lines. Generally, this makes the table more compact. A prefix ARG may be 6030lines. Generally, this makes the table more compact. A prefix ARG may be
5918used to change the number of desired lines. For example, `C-2 C-c C-q' 6031used to change the number of desired lines. For example, `C-2 \\[org-table-wrap]'
5919formats the selected text to two lines. If the region was longer than 2 6032formats the selected text to two lines. If the region was longer than 2
5920lines, the remaining lines remain empty. A negative prefix argument reduces 6033lines, the remaining lines remain empty. A negative prefix argument reduces
5921the current number of lines by that amount. The wrapped text is pasted back 6034the current number of lines by that amount. The wrapped text is pasted back
@@ -5984,8 +6097,6 @@ many lines, whatever width that takes.
5984The return value is a list of lines, without newlines at the end." 6097The return value is a list of lines, without newlines at the end."
5985 (let* ((words (org-split-string string "[ \t\n]+")) 6098 (let* ((words (org-split-string string "[ \t\n]+"))
5986 (maxword (apply 'max (mapcar 'length words))) 6099 (maxword (apply 'max (mapcar 'length words)))
5987 (black (apply '+ (mapcar 'length words)))
5988 (total (+ black (length words)))
5989 w ll) 6100 w ll)
5990 (cond (width 6101 (cond (width
5991 (org-do-wrap words (max maxword width))) 6102 (org-do-wrap words (max maxword width)))
@@ -6003,7 +6114,7 @@ The return value is a list of lines, without newlines at the end."
6003 6114
6004 6115
6005(defun org-do-wrap (words width) 6116(defun org-do-wrap (words width)
6006 "Creates lines of maximum width WIDTH (in characters) from word list WORDS." 6117 "Create lines of maximum width WIDTH (in characters) from word list WORDS."
6007 (let (lines line) 6118 (let (lines line)
6008 (while words 6119 (while words
6009 (setq line (pop words)) 6120 (setq line (pop words))
@@ -6222,10 +6333,10 @@ A few examples for formulae:
6222 $;%.1f Reformat current cell to 1 digit after dec.point 6333 $;%.1f Reformat current cell to 1 digit after dec.point
6223 ($3-32)*5/9 degrees F -> C conversion 6334 ($3-32)*5/9 degrees F -> C conversion
6224 6335
6225When called with a raw C-u prefix, the formula is applied to the current 6336When called with a raw \\[universal-argument] prefix, the formula is applied to the current
6226field, and to the same same column in all following rows, until reaching a 6337field, and to the same same column in all following rows, until reaching a
6227horizontal line or the end of the table. When the command is called with a 6338horizontal line or the end of the table. When the command is called with a
6228numeric prefix argument (like M-3 or C-7 or C-u 24), the formula is applied 6339numeric prefix argument (like M-3 or C-7 or \\[universal-argument] 24), the formula is applied
6229to the current row, and to the following n-1 rows (but not beyond a 6340to the current row, and to the following n-1 rows (but not beyond a
6230separator line)." 6341separator line)."
6231 (interactive "P") 6342 (interactive "P")
@@ -6297,7 +6408,7 @@ separator line)."
6297;; modified self-insert. 6408;; modified self-insert.
6298 6409
6299(defcustom orgtbl-optimized (eq org-enable-table-editor 'optimized) 6410(defcustom orgtbl-optimized (eq org-enable-table-editor 'optimized)
6300 "Non-nil means, use the optimized table editor version for orgtbl-mode. 6411 "Non-nil means, use the optimized table editor version for `orgtbl-mode'.
6301In the optimized version, the table editor takes over all simple keys that 6412In the optimized version, the table editor takes over all simple keys that
6302normally just insert a character. In tables, the characters are inserted 6413normally just insert a character. In tables, the characters are inserted
6303in a way to minimize disturbing the table structure (i.e. in overwrite mode 6414in a way to minimize disturbing the table structure (i.e. in overwrite mode
@@ -6311,21 +6422,21 @@ this variable requires a restart of Emacs to become effective."
6311 :type 'boolean) 6422 :type 'boolean)
6312 6423
6313(defvar orgtbl-mode nil 6424(defvar orgtbl-mode nil
6314 "Variable controlling orgtbl-mode, a minor mode enabling the org-mode 6425 "Variable controlling `orgtbl-mode', a minor mode enabling the `org-mode'
6315table editor in arbitrary modes.") 6426table editor in arbitrary modes.")
6316(make-variable-buffer-local 'orgtbl-mode) 6427(make-variable-buffer-local 'orgtbl-mode)
6317 6428
6318(defvar orgtbl-mode-map (make-sparse-keymap) 6429(defvar orgtbl-mode-map (make-sparse-keymap)
6319 "Keymap for orgtbl-mode.") 6430 "Keymap for `orgtbl-mode'.")
6320 6431
6321;;;###autoload 6432;;;###autoload
6322(defun turn-on-orgtbl () 6433(defun turn-on-orgtbl ()
6323 "Unconditionally turn on orgtbl-mode." 6434 "Unconditionally turn on `orgtbl-mode'."
6324 (orgtbl-mode 1)) 6435 (orgtbl-mode 1))
6325 6436
6326;;;###autoload 6437;;;###autoload
6327(defun orgtbl-mode (&optional arg) 6438(defun orgtbl-mode (&optional arg)
6328 "The org-mode table editor as a minor mode for use in other modes." 6439 "The `org-mode' table editor as a minor mode for use in other modes."
6329 (interactive) 6440 (interactive)
6330 (setq orgtbl-mode 6441 (setq orgtbl-mode
6331 (if arg (> (prefix-numeric-value arg) 0) (not orgtbl-mode))) 6442 (if arg (> (prefix-numeric-value arg) 0) (not orgtbl-mode)))
@@ -6435,13 +6546,13 @@ table editor in arbitrary modes.")
6435 (define-key org-mode-map "|" 'self-insert-command)) 6546 (define-key org-mode-map "|" 'self-insert-command))
6436 6547
6437(defun orgtbl-tab () 6548(defun orgtbl-tab ()
6438 "Justification and field motion for orgtbl-mode." 6549 "Justification and field motion for `orgtbl-mode'."
6439 (interactive) 6550 (interactive)
6440 (org-table-justify-field-maybe) 6551 (org-table-justify-field-maybe)
6441 (org-table-next-field)) 6552 (org-table-next-field))
6442 6553
6443(defun orgtbl-ret () 6554(defun orgtbl-ret ()
6444 "Justification and field motion for orgtbl-mode." 6555 "Justification and field motion for `orgtbl-mode'."
6445 (interactive) 6556 (interactive)
6446 (org-table-justify-field-maybe) 6557 (org-table-justify-field-maybe)
6447 (org-table-next-row)) 6558 (org-table-next-row))
@@ -6454,7 +6565,7 @@ overwritten, and the table is not marked as requiring realignment."
6454 (if (and (org-at-table-p) 6565 (if (and (org-at-table-p)
6455 (eq N 1) 6566 (eq N 1)
6456 (looking-at "[^|\n]* +|")) 6567 (looking-at "[^|\n]* +|"))
6457 (let (org-table-may-need-update (pos (point))) 6568 (let (org-table-may-need-update)
6458 (goto-char (1- (match-end 0))) 6569 (goto-char (1- (match-end 0)))
6459 (delete-backward-char 1) 6570 (delete-backward-char 1)
6460 (goto-char (match-beginning 0)) 6571 (goto-char (match-beginning 0))
@@ -6869,6 +6980,8 @@ The list contains HTML entities for Latin-1, Greek and other symbols.
6869It is supplemented by a number of commonly used TeX macros with appropriate 6980It is supplemented by a number of commonly used TeX macros with appropriate
6870translations.") 6981translations.")
6871 6982
6983(defvar org-last-level nil) ; dynamically scoped variable
6984
6872(defun org-export-as-ascii (arg) 6985(defun org-export-as-ascii (arg)
6873 "Export the outline as a pretty ASCII file. 6986 "Export the outline as a pretty ASCII file.
6874If there is an active region, export only the region. 6987If there is an active region, export only the region.
@@ -6898,10 +7011,10 @@ underlined headlines. The default is 3."
6898 (email user-mail-address) 7011 (email user-mail-address)
6899 (language org-export-default-language) 7012 (language org-export-default-language)
6900 (text nil) 7013 (text nil)
6901 (last-level 1)
6902 (todo nil) 7014 (todo nil)
6903 (lang-words nil)) 7015 (lang-words nil))
6904 7016
7017 (setq org-last-level 1)
6905 (org-init-section-numbers) 7018 (org-init-section-numbers)
6906 7019
6907 (find-file-noselect filename) 7020 (find-file-noselect filename)
@@ -6962,7 +7075,7 @@ underlined headlines. The default is 3."
6962 (insert 7075 (insert
6963 (make-string (* (1- level) 4) ?\ ) 7076 (make-string (* (1- level) 4) ?\ )
6964 (format (if todo "%s (*)\n" "%s\n") txt)) 7077 (format (if todo "%s (*)\n" "%s\n") txt))
6965 (setq last-level level)) 7078 (setq org-last-level level))
6966 )))) 7079 ))))
6967 lines))) 7080 lines)))
6968 7081
@@ -7030,11 +7143,11 @@ underlined headlines. The default is 3."
7030 (setq title (concat (org-section-number level) " " title))) 7143 (setq title (concat (org-section-number level) " " title)))
7031 (insert title "\n" (make-string (string-width title) char) "\n")))) 7144 (insert title "\n" (make-string (string-width title) char) "\n"))))
7032 7145
7033(defun org-export-copy-visible (&optional arg) 7146(defun org-export-copy-visible ()
7034 "Copy the visible part of the buffer to another buffer, for printing. 7147 "Copy the visible part of the buffer to another buffer, for printing.
7035Also removes the first line of the buffer if it specifies a mode, 7148Also removes the first line of the buffer if it specifies a mode,
7036and all options lines." 7149and all options lines."
7037 (interactive "P") 7150 (interactive)
7038 (let* ((filename (concat (file-name-sans-extension (buffer-file-name)) 7151 (let* ((filename (concat (file-name-sans-extension (buffer-file-name))
7039 ".txt")) 7152 ".txt"))
7040 (buffer (find-file-noselect filename)) 7153 (buffer (find-file-noselect filename))
@@ -7044,8 +7157,7 @@ and all options lines."
7044 "TITLE" "AUTHOR" "EMAIL" "TEXT" "OPTIONS" "LANGUAGE")) 7157 "TITLE" "AUTHOR" "EMAIL" "TEXT" "OPTIONS" "LANGUAGE"))
7045 (if org-noutline-p "\\(\n\\|$\\)" ""))) 7158 (if org-noutline-p "\\(\n\\|$\\)" "")))
7046 s e) 7159 s e)
7047 (save-excursion 7160 (with-current-buffer buffer
7048 (set-buffer buffer)
7049 (erase-buffer) 7161 (erase-buffer)
7050 (text-mode)) 7162 (text-mode))
7051 (save-excursion 7163 (save-excursion
@@ -7174,7 +7286,7 @@ headlines. The default is 3. Lower levels will become bulleted lists."
7174 (org-open-file (buffer-file-name))) 7286 (org-open-file (buffer-file-name)))
7175 7287
7176(defun org-export-as-html-batch () 7288(defun org-export-as-html-batch ()
7177 "Call org-export-as-html, may be used in batch processing as 7289 "Call `org-export-as-html', may be used in batch processing as
7178emacs --batch 7290emacs --batch
7179 --load=$HOME/lib/emacs/org.el 7291 --load=$HOME/lib/emacs/org.el
7180 --eval \"(setq org-export-headline-levels 2)\" 7292 --eval \"(setq org-export-headline-levels 2)\"
@@ -7199,7 +7311,6 @@ headlines. The default is 3. Lower levels will become bulleted lists."
7199 (org-skip-comments (org-split-string region "[\r\n]"))) 7311 (org-skip-comments (org-split-string region "[\r\n]")))
7200 (lines (org-export-find-first-heading-line all_lines)) 7312 (lines (org-export-find-first-heading-line all_lines))
7201 (level 0) (line "") (origline "") txt todo 7313 (level 0) (line "") (origline "") txt todo
7202 (last-level 1)
7203 (umax nil) 7314 (umax nil)
7204 (filename (concat (file-name-sans-extension (buffer-file-name)) 7315 (filename (concat (file-name-sans-extension (buffer-file-name))
7205 ".html")) 7316 ".html"))
@@ -7220,6 +7331,7 @@ headlines. The default is 3. Lower levels will become bulleted lists."
7220 ) 7331 )
7221 (message "Exporting...") 7332 (message "Exporting...")
7222 7333
7334 (setq org-last-level 1)
7223 (org-init-section-numbers) 7335 (org-init-section-numbers)
7224 7336
7225 ;; Search for the export key lines 7337 ;; Search for the export key lines
@@ -7284,15 +7396,15 @@ headlines. The default is 3. Lower levels will become bulleted lists."
7284 (if (<= level umax) 7396 (if (<= level umax)
7285 (progn 7397 (progn
7286 (setq head-count (+ head-count 1)) 7398 (setq head-count (+ head-count 1))
7287 (if (> level last-level) 7399 (if (> level org-last-level)
7288 (progn 7400 (progn
7289 (setq cnt (- level last-level)) 7401 (setq cnt (- level org-last-level))
7290 (while (>= (setq cnt (1- cnt)) 0) 7402 (while (>= (setq cnt (1- cnt)) 0)
7291 (insert "<ul>")) 7403 (insert "<ul>"))
7292 (insert "\n"))) 7404 (insert "\n")))
7293 (if (< level last-level) 7405 (if (< level org-last-level)
7294 (progn 7406 (progn
7295 (setq cnt (- last-level level)) 7407 (setq cnt (- org-last-level level))
7296 (while (>= (setq cnt (1- cnt)) 0) 7408 (while (>= (setq cnt (1- cnt)) 0)
7297 (insert "</ul>")) 7409 (insert "</ul>"))
7298 (insert "\n"))) 7410 (insert "\n")))
@@ -7302,11 +7414,11 @@ headlines. The default is 3. Lower levels will become bulleted lists."
7302 "<li><a href=\"#sec-%d\"><span style='color:red'>%s</span></a></li>\n" 7414 "<li><a href=\"#sec-%d\"><span style='color:red'>%s</span></a></li>\n"
7303 "<li><a href=\"#sec-%d\">%s</a></li>\n") 7415 "<li><a href=\"#sec-%d\">%s</a></li>\n")
7304 head-count txt)) 7416 head-count txt))
7305 (setq last-level level)) 7417 (setq org-last-level level))
7306 )))) 7418 ))))
7307 lines) 7419 lines)
7308 (while (> last-level 0) 7420 (while (> org-last-level 0)
7309 (setq last-level (1- last-level)) 7421 (setq org-last-level (1- org-last-level))
7310 (insert "</ul>\n")) 7422 (insert "</ul>\n"))
7311 )) 7423 ))
7312 (setq head-count 0) 7424 (setq head-count 0)
@@ -7537,17 +7649,14 @@ But it has the disadvantage, that no cell- or row-spanning is allowed."
7537This has the advantage that cell- or row-spanning is allowed. 7649This has the advantage that cell- or row-spanning is allowed.
7538But it has the disadvantage, that Org-mode's HTML conversions cannot be used." 7650But it has the disadvantage, that Org-mode's HTML conversions cannot be used."
7539 (require 'table) 7651 (require 'table)
7540 (save-excursion 7652 (with-current-buffer (get-buffer-create " org-tmp1 ")
7541 (set-buffer (get-buffer-create " org-tmp1 "))
7542 (erase-buffer) 7653 (erase-buffer)
7543 (insert (mapconcat 'identity lines "\n")) 7654 (insert (mapconcat 'identity lines "\n"))
7544 (goto-char (point-min)) 7655 (goto-char (point-min))
7545 (if (not (re-search-forward "|[^+]" nil t)) 7656 (if (not (re-search-forward "|[^+]" nil t))
7546 (error "Error processing table.")) 7657 (error "Error processing table."))
7547 (table-recognize-table) 7658 (table-recognize-table)
7548 (save-excursion 7659 (with-current-buffer (get-buffer-create " org-tmp2 ") (erase-buffer))
7549 (set-buffer (get-buffer-create " org-tmp2 "))
7550 (erase-buffer))
7551 (table-generate-source 'html " org-tmp2 ") 7660 (table-generate-source 'html " org-tmp2 ")
7552 (set-buffer " org-tmp2 ") 7661 (set-buffer " org-tmp2 ")
7553 (buffer-substring (point-min) (point-max)))) 7662 (buffer-substring (point-min) (point-max))))
@@ -7711,7 +7820,7 @@ stacked delimiters is N. Escaping delimiters is not possible."
7711 level head-count title level)) 7820 level head-count title level))
7712 (insert (format "\n<H%d>%s</H%d>\n" level title level)))))) 7821 (insert (format "\n<H%d>%s</H%d>\n" level title level))))))
7713 7822
7714(defun org-html-level-close (level) 7823(defun org-html-level-close (&rest args)
7715 "Terminate one level in HTML export." 7824 "Terminate one level in HTML export."
7716 (insert "</ul>")) 7825 (insert "</ul>"))
7717 7826
@@ -7800,6 +7909,7 @@ When LEVEL is non-nil, increase section numbers on that level."
7800(define-key org-mode-map "\C-c/" 'org-occur) ; Minor-mode reserved 7909(define-key org-mode-map "\C-c/" 'org-occur) ; Minor-mode reserved
7801(define-key org-mode-map "\C-c\C-m" 'org-insert-heading) 7910(define-key org-mode-map "\C-c\C-m" 'org-insert-heading)
7802(define-key org-mode-map "\M-\C-m" 'org-insert-heading) 7911(define-key org-mode-map "\M-\C-m" 'org-insert-heading)
7912(define-key org-mode-map [(meta shift return)] 'org-insert-todo-heading)
7803(define-key org-mode-map "\C-c\C-l" 'org-insert-link) 7913(define-key org-mode-map "\C-c\C-l" 'org-insert-link)
7804(define-key org-mode-map "\C-c\C-o" 'org-open-at-point) 7914(define-key org-mode-map "\C-c\C-o" 'org-open-at-point)
7805(define-key org-mode-map "\C-c\C-z" 'org-time-stamp) ; Alternative binding 7915(define-key org-mode-map "\C-c\C-z" 'org-time-stamp) ; Alternative binding
@@ -7811,8 +7921,6 @@ When LEVEL is non-nil, increase section numbers on that level."
7811(define-key org-mode-map "\C-c[" 'org-add-file) 7921(define-key org-mode-map "\C-c[" 'org-add-file)
7812(define-key org-mode-map "\C-c]" 'org-remove-file) 7922(define-key org-mode-map "\C-c]" 'org-remove-file)
7813(define-key org-mode-map "\C-c\C-r" 'org-timeline) 7923(define-key org-mode-map "\C-c\C-r" 'org-timeline)
7814;(define-key org-mode-map [(shift up)] 'org-timestamp-up)
7815;(define-key org-mode-map [(shift down)] 'org-timestamp-down)
7816(define-key org-mode-map [(shift up)] 'org-shiftup) 7924(define-key org-mode-map [(shift up)] 'org-shiftup)
7817(define-key org-mode-map [(shift down)] 'org-shiftdown) 7925(define-key org-mode-map [(shift down)] 'org-shiftdown)
7818(define-key org-mode-map [(shift left)] 'org-timestamp-down-day) 7926(define-key org-mode-map [(shift left)] 'org-timestamp-down-day)
@@ -7864,7 +7972,7 @@ overwritten, and the table is not marked as requiring realignment."
7864 (if (and (org-table-p) 7972 (if (and (org-table-p)
7865 (eq N 1) 7973 (eq N 1)
7866 (looking-at "[^|\n]* +|")) 7974 (looking-at "[^|\n]* +|"))
7867 (let (org-table-may-need-update (pos (point))) 7975 (let (org-table-may-need-update)
7868 (goto-char (1- (match-end 0))) 7976 (goto-char (1- (match-end 0)))
7869 (delete-backward-char 1) 7977 (delete-backward-char 1)
7870 (goto-char (match-beginning 0)) 7978 (goto-char (match-beginning 0))
@@ -7935,25 +8043,27 @@ a reduced column width."
7935 ((org-at-table-p) (org-table-previous-field)) 8043 ((org-at-table-p) (org-table-previous-field))
7936 (t (org-cycle '(4))))) 8044 (t (org-cycle '(4)))))
7937 8045
7938(defun org-shiftmetaleft (&optional arg) 8046(defun org-shiftmetaleft ()
7939 "Call `org-promote-subtree' or `org-table-delete-column'." 8047 "Call `org-promote-subtree' or `org-table-delete-column'."
7940 (interactive "P") 8048 (interactive)
7941 (cond 8049 (cond
7942 ((org-at-table-p) (org-table-delete-column arg)) 8050 ((org-at-table-p) (org-table-delete-column))
7943 ((org-on-heading-p) (org-promote-subtree arg)) 8051 ((org-on-heading-p) (org-promote-subtree))
7944 (t (org-shiftcursor-error)))) 8052 (t (org-shiftcursor-error))))
7945(defun org-shiftmetaright (&optional arg) 8053
8054(defun org-shiftmetaright ()
7946 "Call `org-demote-subtree' or `org-table-insert-column'." 8055 "Call `org-demote-subtree' or `org-table-insert-column'."
7947 (interactive "P") 8056 (interactive)
7948 (cond 8057 (cond
7949 ((org-at-table-p) (org-table-insert-column arg)) 8058 ((org-at-table-p) (org-table-insert-column))
7950 ((org-on-heading-p) (org-demote-subtree arg)) 8059 ((org-on-heading-p) (org-demote-subtree))
7951 (t (org-shiftcursor-error)))) 8060 (t (org-shiftcursor-error))))
8061
7952(defun org-shiftmetaup (&optional arg) 8062(defun org-shiftmetaup (&optional arg)
7953 "Call `org-move-subtree-up' or `org-table-kill-row'." 8063 "Call `org-move-subtree-up' or `org-table-kill-row'."
7954 (interactive "P") 8064 (interactive "P")
7955 (cond 8065 (cond
7956 ((org-at-table-p) (org-table-kill-row arg)) 8066 ((org-at-table-p) (org-table-kill-row))
7957 ((org-on-heading-p) (org-move-subtree-up arg)) 8067 ((org-on-heading-p) (org-move-subtree-up arg))
7958 (t (org-shiftcursor-error)))) 8068 (t (org-shiftcursor-error))))
7959(defun org-shiftmetadown (&optional arg) 8069(defun org-shiftmetadown (&optional arg)
@@ -7969,15 +8079,17 @@ a reduced column width."
7969 (interactive "P") 8079 (interactive "P")
7970 (cond 8080 (cond
7971 ((org-at-table-p) (org-table-move-column 'left)) 8081 ((org-at-table-p) (org-table-move-column 'left))
7972 ((or (org-on-heading-p) (org-region-active-p)) (org-do-promote arg)) 8082 ((or (org-on-heading-p) (org-region-active-p)) (org-do-promote))
7973 (t (backward-word (prefix-numeric-value arg))))) 8083 (t (backward-word (prefix-numeric-value arg)))))
8084
7974(defun org-metaright (&optional arg) 8085(defun org-metaright (&optional arg)
7975 "Call `org-do-demote' or `org-table-move-column' to right." 8086 "Call `org-do-demote' or `org-table-move-column' to right."
7976 (interactive "P") 8087 (interactive "P")
7977 (cond 8088 (cond
7978 ((org-at-table-p) (org-table-move-column nil)) 8089 ((org-at-table-p) (org-table-move-column nil))
7979 ((or (org-on-heading-p) (org-region-active-p)) (org-do-demote arg)) 8090 ((or (org-on-heading-p) (org-region-active-p)) (org-do-demote))
7980 (t (forward-word (prefix-numeric-value arg))))) 8091 (t (forward-word (prefix-numeric-value arg)))))
8092
7981(defun org-metaup (&optional arg) 8093(defun org-metaup (&optional arg)
7982 "Call `org-move-subtree-up' or `org-table-move-row' up." 8094 "Call `org-move-subtree-up' or `org-table-move-row' up."
7983 (interactive "P") 8095 (interactive "P")
@@ -7985,6 +8097,7 @@ a reduced column width."
7985 ((org-at-table-p) (org-table-move-row 'up)) 8097 ((org-at-table-p) (org-table-move-row 'up))
7986 ((org-on-heading-p) (org-move-subtree-up arg)) 8098 ((org-on-heading-p) (org-move-subtree-up arg))
7987 (t (org-shiftcursor-error)))) 8099 (t (org-shiftcursor-error))))
8100
7988(defun org-metadown (&optional arg) 8101(defun org-metadown (&optional arg)
7989 "Call `org-move-subtree-down' or `org-table-move-row' down." 8102 "Call `org-move-subtree-down' or `org-table-move-row' down."
7990 (interactive "P") 8103 (interactive "P")
@@ -8007,25 +8120,25 @@ a reduced column width."
8007 ((org-at-timestamp-p) (org-timestamp-down arg)) 8120 ((org-at-timestamp-p) (org-timestamp-down arg))
8008 (t (org-priority-down)))) 8121 (t (org-priority-down))))
8009 8122
8010(defun org-copy-special (arg) 8123(defun org-copy-special ()
8011 "Call either `org-table-copy' or `org-copy-subtree'." 8124 "Call either `org-table-copy' or `org-copy-subtree'."
8012 (interactive "P") 8125 (interactive)
8013 (if (org-at-table-p) 8126 (if (org-at-table-p)
8014 (org-table-copy-region arg) 8127 (org-table-copy-region)
8015 (org-copy-subtree arg))) 8128 (org-copy-subtree)))
8016 8129
8017(defun org-cut-special (arg) 8130(defun org-cut-special ()
8018 "Call either `org-table-copy' or `org-copy-subtree'." 8131 "Call either `org-table-copy' or `org-cut-subtree'."
8019 (interactive "P") 8132 (interactive)
8020 (if (org-at-table-p) 8133 (if (org-at-table-p)
8021 (org-table-cut-region arg) 8134 (org-table-cut-region)
8022 (org-cut-subtree arg))) 8135 (org-cut-subtree)))
8023 8136
8024(defun org-paste-special (arg) 8137(defun org-paste-special (arg)
8025 "Call either `org-table-paste-rectangle' or `org-paste-subtree'." 8138 "Call either `org-table-paste-rectangle' or `org-paste-subtree'."
8026 (interactive "P") 8139 (interactive "P")
8027 (if (org-at-table-p) 8140 (if (org-at-table-p)
8028 (org-table-paste-rectangle arg) 8141 (org-table-paste-rectangle)
8029 (org-paste-subtree arg))) 8142 (org-paste-subtree arg)))
8030 8143
8031(defun org-ctrl-c-ctrl-c (&optional arg) 8144(defun org-ctrl-c-ctrl-c (&optional arg)
@@ -8040,12 +8153,12 @@ the automatic table editor has been turned off."
8040 ((org-at-table.el-p) 8153 ((org-at-table.el-p)
8041 (require 'table) 8154 (require 'table)
8042 (beginning-of-line 1) 8155 (beginning-of-line 1)
8043 (re-search-forward "|" (save-excursion (end-of-line 2) (point))) 8156 (re-search-forward "|" (save-excursion (end-of-line 2) (point))) ;FIXME: line-end-position?
8044 (table-recognize-table)) 8157 (table-recognize-table))
8045 ((org-at-table-p) 8158 ((org-at-table-p)
8046 (org-table-align)) 8159 (org-table-align))
8047 ((save-excursion (beginning-of-line 1) (looking-at "#\\+[A-Z]+")) 8160 ((save-excursion (beginning-of-line 1) (looking-at "#\\+[A-Z]+"))
8048 (let (org-inhibit-startup) (org-mode))) 8161 (let ((org-inhibit-startup t)) (org-mode)))
8049 ((org-region-active-p) 8162 ((org-region-active-p)
8050 (org-table-convert-region (region-beginning) (region-end) arg)) 8163 (org-table-convert-region (region-beginning) (region-end) arg))
8051 ((and (region-beginning) (region-end)) 8164 ((and (region-beginning) (region-end))
@@ -8054,9 +8167,9 @@ the automatic table editor has been turned off."
8054 (error "Abort"))) 8167 (error "Abort")))
8055 (t (error "No table at point, and no region to make one."))))) 8168 (t (error "No table at point, and no region to make one.")))))
8056 8169
8057(defun org-return (&optional arg) 8170(defun org-return ()
8058 "Call `org-table-next-row' or `newline'." 8171 "Call `org-table-next-row' or `newline'."
8059 (interactive "P") 8172 (interactive)
8060 (cond 8173 (cond
8061 ((org-at-table-p) 8174 ((org-at-table-p)
8062 (org-table-justify-field-maybe) 8175 (org-table-justify-field-maybe)
@@ -8069,7 +8182,7 @@ the automatic table editor has been turned off."
8069 (cond 8182 (cond
8070 ((org-at-table-p) 8183 ((org-at-table-p)
8071 (org-table-wrap-region arg)) 8184 (org-table-wrap-region arg))
8072 (t (org-insert-heading arg)))) 8185 (t (org-insert-heading))))
8073 8186
8074;;; Menu entries 8187;;; Menu entries
8075 8188
@@ -8256,7 +8369,7 @@ With optional NODE, go directly to that node."
8256;;; Miscellaneous stuff 8369;;; Miscellaneous stuff
8257 8370
8258(defun org-move-line-down (arg) 8371(defun org-move-line-down (arg)
8259 "Move the current line up." 8372 "Move the current line down. With prefix argument, move it past ARG lines."
8260 (interactive "p") 8373 (interactive "p")
8261 (let ((col (current-column)) 8374 (let ((col (current-column))
8262 beg end pos) 8375 beg end pos)
@@ -8269,13 +8382,13 @@ With optional NODE, go directly to that node."
8269 (move-to-column col))) 8382 (move-to-column col)))
8270 8383
8271(defun org-move-line-up (arg) 8384(defun org-move-line-up (arg)
8272 "Move the current line up." 8385 "Move the current line up. With prefix argument, move it past ARG lines."
8273 (interactive "p") 8386 (interactive "p")
8274 (let ((col (current-column)) 8387 (let ((col (current-column))
8275 beg end pos) 8388 beg end pos)
8276 (beginning-of-line 1) (setq beg (point)) 8389 (beginning-of-line 1) (setq beg (point))
8277 (beginning-of-line 2) (setq end (point)) 8390 (beginning-of-line 2) (setq end (point))
8278 (beginning-of-line (+ -2 arg)) 8391 (beginning-of-line (- arg))
8279 (setq pos (move-marker (make-marker) (point))) 8392 (setq pos (move-marker (make-marker) (point)))
8280 (insert (delete-and-extract-region beg end)) 8393 (insert (delete-and-extract-region beg end))
8281 (goto-char pos) 8394 (goto-char pos)
@@ -8284,7 +8397,7 @@ With optional NODE, go directly to that node."
8284;; Functions needed for Emacs/XEmacs region compatibility 8397;; Functions needed for Emacs/XEmacs region compatibility
8285 8398
8286(defun org-region-active-p () 8399(defun org-region-active-p ()
8287 "Is transient-mark-mode on and the region active? 8400 "Is `transient-mark-mode' on and the region active?
8288Works on both Emacs and XEmacs." 8401Works on both Emacs and XEmacs."
8289 (if org-ignore-region 8402 (if org-ignore-region
8290 nil 8403 nil
@@ -8403,7 +8516,9 @@ If INVISIBLE-OK is non-nil, an invisible heading line is ok too."
8403This function considers both visible and invisible heading lines. 8516This function considers both visible and invisible heading lines.
8404With argument, move up ARG levels." 8517With argument, move up ARG levels."
8405 (if org-noutline-p 8518 (if org-noutline-p
8406 (outline-up-heading arg t) 8519 (if (fboundp 'outline-up-heading-all)
8520 (outline-up-heading-all arg) ; emacs 21 version of outline.el
8521 (outline-up-heading arg t)) ; emacs 22 version of outline.el
8407 (org-back-to-heading t) 8522 (org-back-to-heading t)
8408 (looking-at outline-regexp) 8523 (looking-at outline-regexp)
8409 (if (<= (- (match-end 0) (match-beginning 0)) arg) 8524 (if (<= (- (match-end 0) (match-beginning 0)) arg)
@@ -8422,7 +8537,7 @@ With argument, move up ARG levels."
8422 (progn 8537 (progn
8423 (org-back-to-heading t) 8538 (org-back-to-heading t)
8424 (org-flag-heading nil))) 8539 (org-flag-heading nil)))
8425 (show-entry))) 8540 (org-show-entry)))
8426 8541
8427(defun org-check-occur-regexp (regexp) 8542(defun org-check-occur-regexp (regexp)
8428 "If REGEXP starts with \"^\", modify it to check for \\r as well. 8543 "If REGEXP starts with \"^\", modify it to check for \\r as well.
@@ -8444,7 +8559,7 @@ When ENTRY is non-nil, show the entire entry."
8444 ;; Check if we should show the entire entry 8559 ;; Check if we should show the entire entry
8445 (if entry 8560 (if entry
8446 (progn 8561 (progn
8447 (show-entry) 8562 (org-show-entry)
8448 (save-excursion ;; FIXME: Is this the fix for points in the -| 8563 (save-excursion ;; FIXME: Is this the fix for points in the -|
8449 ;; middle of text? | 8564 ;; middle of text? |
8450 (and (outline-next-heading) ;; | 8565 (and (outline-next-heading) ;; |
@@ -8455,6 +8570,28 @@ When ENTRY is non-nil, show the entire entry."
8455 flag 8570 flag
8456 (if flag ?\r ?\n)))))) 8571 (if flag ?\r ?\n))))))
8457 8572
8573(defun org-show-subtree ()
8574 "Show everything after this heading at deeper levels."
8575 (outline-flag-region
8576 (point)
8577 (save-excursion
8578 (outline-end-of-subtree) (outline-next-heading) (point))
8579 (if org-noutline-p nil ?\n)))
8580
8581(defun org-show-entry ()
8582 "Show the body directly following this heading.
8583Show the heading too, if it is currently invisible."
8584 (interactive)
8585 (save-excursion
8586 (org-back-to-heading t)
8587 (outline-flag-region
8588 (1- (point))
8589 (save-excursion
8590 (re-search-forward (concat "[\r\n]\\(" outline-regexp "\\)") nil 'move)
8591 (or (match-beginning 1) (point-max)))
8592 (if org-noutline-p nil ?\n))))
8593
8594
8458(defun org-make-options-regexp (kwds) 8595(defun org-make-options-regexp (kwds)
8459 "Make a regular expression for keyword lines." 8596 "Make a regular expression for keyword lines."
8460 (concat 8597 (concat
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 1b3f06eb34b..04507fbc5e4 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -828,6 +828,14 @@ says which mode to use."
828 (tex-mode-internal) 828 (tex-mode-internal)
829 (tex-guess-mode))) 829 (tex-guess-mode)))
830 830
831;; The following three autoloaded aliases appear to conflict with
832;; AUCTeX. However, even though AUCTeX uses the mixed case variants
833;; for all mode relevant variables and hooks, the invocation function
834;; and setting of `major-mode' themselves need to be lowercase for
835;; AUCTeX to provide a fully functional user-level replacement. So
836;; these aliases should remain as they are, in particular since AUCTeX
837;; users are likely to use them.
838
831;;;###autoload 839;;;###autoload
832(defalias 'TeX-mode 'tex-mode) 840(defalias 'TeX-mode 'tex-mode)
833;;;###autoload 841;;;###autoload
diff --git a/lisp/tooltip.el b/lisp/tooltip.el
index 840aa3c2006..9bd35f05d11 100644
--- a/lisp/tooltip.el
+++ b/lisp/tooltip.el
@@ -119,8 +119,10 @@ position to pop up the tooltip."
119(defcustom tooltip-gud-tips-p nil 119(defcustom tooltip-gud-tips-p nil
120 "*Non-nil means show tooltips in GUD sessions. 120 "*Non-nil means show tooltips in GUD sessions.
121 121
122This allows you to display a variable's value in a tooltip simply by 122This allows you to display a variable's value in a tooltip simply
123pointing at it with the mouse." 123by pointing at it with the mouse. In the case of a C program
124controlled by GDB, it shows the associated #define directives
125when program is not executing."
124 :type 'boolean 126 :type 'boolean
125 :tag "GUD" 127 :tag "GUD"
126 :group 'tooltip) 128 :group 'tooltip)
@@ -453,29 +455,45 @@ If TOOLTIP-GUD-DEREFERENCE is t, also prepend a `*' to EXPR."
453 "Show tip for identifier or selection under the mouse. 455 "Show tip for identifier or selection under the mouse.
454The mouse must either point at an identifier or inside a selected 456The mouse must either point at an identifier or inside a selected
455region for the tip window to be shown. If tooltip-gud-dereference is t, 457region for the tip window to be shown. If tooltip-gud-dereference is t,
456add a `*' in front of the printed expression. 458add a `*' in front of the printed expression. In the case of a C program
459controlled by GDB, show the associated #define directives when program is
460not executing.
457 461
458This function must return nil if it doesn't handle EVENT." 462This function must return nil if it doesn't handle EVENT."
459 (let (process) 463 (let (process)
460 (when (and (eventp event) 464 (when (and (eventp event)
461 tooltip-gud-tips-p 465 tooltip-gud-tips-p
462 (boundp 'gud-comint-buffer) 466 (boundp 'gud-comint-buffer)
467 gud-comint-buffer
468 (buffer-name gud-comint-buffer); gud-comint-buffer might be killed
463 (setq process (get-buffer-process gud-comint-buffer)) 469 (setq process (get-buffer-process gud-comint-buffer))
464 (posn-point (event-end event)) 470 (posn-point (event-end event))
465 (progn (setq tooltip-gud-event event) 471 (or (eq gud-minor-mode 'gdba)
466 (eval (cons 'and tooltip-gud-display)))) 472 (progn (setq tooltip-gud-event event)
473 (eval (cons 'and tooltip-gud-display)))))
467 (let ((expr (tooltip-expr-to-print event))) 474 (let ((expr (tooltip-expr-to-print event)))
468 (when expr 475 (when expr
469 (let ((cmd (tooltip-gud-print-command expr))) 476 (if (and (eq gud-minor-mode 'gdba)
470 (unless (null cmd) ; CMD can be nil if unknown debugger 477 (not gdb-active-process))
471 (case gud-minor-mode 478 (progn
472 (gdba (gdb-enqueue-input 479 (with-current-buffer
473 (list (concat cmd "\n") 'gdb-tooltip-print))) 480 (window-buffer (let ((mouse (mouse-position)))
474 (t 481 (window-at (cadr mouse)
475 (setq tooltip-gud-original-filter (process-filter process)) 482 (cddr mouse))))
476 (set-process-filter process 'tooltip-gud-process-output) 483 (let ((define-elt (assoc expr gdb-define-alist)))
477 (gud-basic-call cmd))) 484 (unless (null define-elt)
478 expr))))))) 485 (tooltip-show (cdr define-elt))
486 expr))))
487 (let ((cmd (tooltip-gud-print-command expr)))
488 (unless (null cmd) ; CMD can be nil if unknown debugger
489 (case gud-minor-mode
490 (gdba (gdb-enqueue-input
491 (list (concat cmd "\n") 'gdb-tooltip-print)))
492 (t
493 (setq tooltip-gud-original-filter (process-filter process))
494 (set-process-filter process 'tooltip-gud-process-output)
495 (gud-basic-call cmd)))
496 expr))))))))
479 497
480(defun gdb-tooltip-print () 498(defun gdb-tooltip-print ()
481 (tooltip-show 499 (tooltip-show
diff --git a/lisp/window.el b/lisp/window.el
index b4fd664a43c..8c46addf444 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -29,6 +29,15 @@
29 29
30;;; Code: 30;;; Code:
31 31
32(defvar window-size-fixed nil
33 "*Non-nil in a buffer means windows displaying the buffer are fixed-size.
34If the value is`height', then only the window's height is fixed.
35If the value is `width', then only the window's width is fixed.
36Any other non-nil value fixes both the width and the height.
37Emacs won't change the size of any window displaying that buffer,
38unless you explicitly change the size, or Emacs has no other choice.")
39(make-variable-buffer-local 'window-size-fixed)
40
32(defmacro save-selected-window (&rest body) 41(defmacro save-selected-window (&rest body)
33 "Execute BODY, then select the window that was selected before BODY. 42 "Execute BODY, then select the window that was selected before BODY.
34Also restore the selected window of each frame as it was at the start 43Also restore the selected window of each frame as it was at the start
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index 2e440e48fa5..34dbb4d46f8 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,120 @@
12005-05-04 Richard M. Stallman <rms@gnu.org>
2
3 * commands.texi (Interactive Codes): Fix Texinfo usage.
4 Document U more clearly.
5
62005-05-01 Luc Teirlinck <teirllm@auburn.edu>
7
8 * variables.texi (Variable Aliases): `make-obsolete-variable' is a
9 function and not a macro.
10
11 * frames.texi (Pop-Up Menus): Correct and clarify description of
12 `x-popup-menu'.
13 (Dialog Boxes): Clarify description of `x-popup-dialog'.
14
152005-05-01 Richard M. Stallman <rms@gnu.org>
16
17 * edebug.texi (Checking Whether to Stop): Fix previous change.
18
192005-05-01 Luc Teirlinck <teirllm@auburn.edu>
20
21 * display.texi: Fix typos and Texinfo usage.
22
23 * edebug.texi (Checking Whether to Stop): executing-macro ->
24 executing-kbd-macro.
25
262005-05-01 Richard M. Stallman <rms@gnu.org>
27
28 * display.texi (Invisible Text): Correct add-to-invisibility-spec.
29
302005-04-30 Richard M. Stallman <rms@gnu.org>
31
32 * files.texi (Magic File Names): Document `operations' property.
33
342005-04-29 Lute Kamstra <lute@gnu.org>
35
36 * modes.texi (Generic Modes): New node.
37 (Major Modes): Add it to the menu.
38 (Derived Modes): Add "derived mode" to concept index.
39
402005-04-28 Lute Kamstra <lute@gnu.org>
41
42 * modes.texi (Defining Minor Modes): Fix previous change.
43 (Font Lock Mode): Simplify.
44 (Font Lock Basics): Say that font-lock-defaults is buffer-local
45 when set and that some parts are optional. Add cross references.
46 (Search-based Fontification): Say how to specify font-lock-keywords.
47 Add cross references. Add font-lock-multiline to index. Move
48 font-lock-keywords-case-fold-search here from node "Other Font
49 Lock Variables". Document font-lock-add-keywords and
50 font-lock-remove-keywords
51 (Other Font Lock Variables): Move font-lock-keywords-only,
52 font-lock-syntax-table, font-lock-beginning-of-syntax-function,
53 and font-lock-syntactic-face-function to node "Syntactic Font
54 Lock". Move font-lock-keywords-case-fold-search to node
55 "Search-based Fontification". Document font-lock-inhibit-thing-lock
56 and font-lock-{,un}fontify-{buffer,region}-function.
57 (Precalculated Fontification): Remove reference to deleted variable
58 font-lock-core-only.
59 (Faces for Font Lock): Add font-lock-comment-delimiter-face.
60 (Syntactic Font Lock): Add intro. Move font-lock-keywords-only,
61 font-lock-syntax-table, font-lock-beginning-of-syntax-function,
62 and font-lock-syntactic-face-function here from node "Other Font
63 Lock Variables". Move font-lock-syntactic-keywords to "Setting
64 Syntax Properties". Add cross references.
65 (Setting Syntax Properties): New node. Move
66 font-lock-syntactic-keywords here from "Syntactic Font Lock".
67 * syntax.texi (Syntax Properties): Add cross reference.
68 * hooks.texi (Standard Hooks): Add Font-Lock hooks.
69
702005-04-26 Richard M. Stallman <rms@gnu.org>
71
72 * display.texi (Defining Faces):
73 Document `default' elements of defface spec.
74
75 * modes.texi (Major Mode Conventions): Explain customizing ElDoc mode.
76
77 * variables.texi (Variable Aliases): Clarify text.
78
792005-04-25 Chong Yidong <cyd@stupidchicken.com>
80
81 * windows.texi (Window Hooks): Remove reference to obsolete Lazy Lock.
82
832005-04-25 Luc Teirlinck <teirllm@auburn.edu>
84
85 * hooks.texi (Standard Hooks): Most minor modes have mode hooks too.
86
872005-04-24 Eli Zaretskii <eliz@gnu.org>
88
89 * syntax.texi (Syntax Table Internals): Elaborate documentation of
90 syntax-after and syntax-class.
91
92 * files.texi (Changing Files): Fix last change's cross-reference.
93 (Unique File Names): Don't mention "numbers" in the documentation
94 of make-temp-file and make-temp-name.
95
962005-04-23 Richard M. Stallman <rms@gnu.org>
97
98 * files.texi (Changing Files): Document MUSTBENEW arg in copy-file.
99
1002005-04-22 Nick Roberts <nickrob@snap.net.nz>
101
102 * windows.texi (Cyclic Window Ordering): Clarify window-list.
103
1042005-04-22 Nick Roberts <nickrob@snap.net.nz>
105
106 * variables.texi (Variable Aliases): Describe make-obsolete-variable
107 and define-obsolete-variable-alias.
108
1092005-04-22 Kim F. Storm <storm@cua.dk>
110
111 * symbols.texi (Symbol Plists): Remove safe-get, as get is now safe.
112 (Other Plists): Remove safe-plist-get, as plist-get is now safe.
113
1142005-04-21 Lute Kamstra <lute@gnu.org>
115
116 * lists.texi (Association Lists): Document rassq-delete-all.
117
12005-04-19 Richard M. Stallman <rms@gnu.org> 1182005-04-19 Richard M. Stallman <rms@gnu.org>
2 119
3 * modes.texi (Search-based Fontification): Explain that 120 * modes.texi (Search-based Fontification): Explain that
@@ -1044,7 +1161,7 @@
1044 1161
1045 * hooks.texi (Standard Hooks): `disabled-command-hook' has been 1162 * hooks.texi (Standard Hooks): `disabled-command-hook' has been
1046 renamed to `disabled-command-function'. 1163 renamed to `disabled-command-function'.
1047 * commands.texi (Key Sequence Input): Remove unnecessary anchor, 1164 * commands.texi (Key Sequence Input): Remove unnecessary anchor.
1048 (Command Loop Info): Replace reference to it. 1165 (Command Loop Info): Replace reference to it.
1049 (Disabling Commands): `disabled-command-hook' has been renamed to 1166 (Disabling Commands): `disabled-command-hook' has been renamed to
1050 `disabled-command-function'. 1167 `disabled-command-function'.
diff --git a/lispref/commands.texi b/lispref/commands.texi
index 29a86f98632..225deab4a20 100644
--- a/lispref/commands.texi
+++ b/lispref/commands.texi
@@ -365,8 +365,9 @@ until a command (or undefined command) is found in the current key
365maps. The key sequence argument is represented as a string or vector. 365maps. The key sequence argument is represented as a string or vector.
366The cursor does not move into the echo area. Prompt. 366The cursor does not move into the echo area. Prompt.
367 367
368If the key sequence is a down-event, the following up-event is discarded, 368If @samp{k} reads a key sequence that ends with a down-event, it also
369but can be read via the @code{U} code character. 369reads and discards the following up-event. You can get access to that
370up-event with the @samp{U} code character.
370 371
371This kind of input is used by commands such as @code{describe-key} and 372This kind of input is used by commands such as @code{describe-key} and
372@code{global-set-key}. 373@code{global-set-key}.
@@ -425,9 +426,10 @@ the string.) Other characters that normally terminate a symbol (e.g.,
425parentheses and brackets) do not do so here. Prompt. 426parentheses and brackets) do not do so here. Prompt.
426 427
427@item U 428@item U
428A key sequence or @code{nil}. May be used after a @code{k} or @code{K} 429A key sequence or @code{nil}. Can be used after a @samp{k} or
429argument to get the up-event that was discarded in case the key 430@samp{K} argument to get the up-event that was discarded (if any)
430sequence read for that argument was a down-event. No I/O. 431after @samp{k} or @samp{K} read a down-event. If no up-event has been
432discarded, @samp{U} provides @code{nil} as the argument. No I/O.
431 433
432@item v 434@item v
433A variable declared to be a user option (i.e., satisfying the 435A variable declared to be a user option (i.e., satisfying the
@@ -442,8 +444,9 @@ Minibuffer}. Prompt.
442 444
443@item X 445@item X
444@cindex evaluated expression argument 446@cindex evaluated expression argument
445A Lisp form is read as with @kbd{x}, but then evaluated so that its 447A Lisp form's value. @samp{X} reads as @samp{x} does, then evaluates
446value becomes the argument for the command. Prompt. 448the form so that its value becomes the argument for the command.
449Prompt.
447 450
448@item z 451@item z
449A coding system name (a symbol). If the user enters null input, the 452A coding system name (a symbol). If the user enters null input, the
diff --git a/lispref/display.texi b/lispref/display.texi
index d5a28b0a0cc..76bf99e0ede 100644
--- a/lispref/display.texi
+++ b/lispref/display.texi
@@ -717,10 +717,9 @@ by a visible newline, it displays an ellipsis.
717 717
718@defun add-to-invisibility-spec element 718@defun add-to-invisibility-spec element
719This function adds the element @var{element} to 719This function adds the element @var{element} to
720@code{buffer-invisibility-spec} (if it is not already present in that 720@code{buffer-invisibility-spec}. If @code{buffer-invisibility-spec}
721list). If @code{buffer-invisibility-spec} was @code{t}, it changes to 721was @code{t}, it changes to a list, @code{(t)}, so that text whose
722a list, @code{(t)}, so that text whose @code{invisible} property 722@code{invisible} property is @code{t} remains invisible.
723is @code{t} remains invisible.
724@end defun 723@end defun
725 724
726@defun remove-from-invisibility-spec element 725@defun remove-from-invisibility-spec element
@@ -1143,9 +1142,9 @@ This function removes all the overlays between @var{start} and
1143@var{end} whose property @var{name} has the value @var{value}. It can 1142@var{end} whose property @var{name} has the value @var{value}. It can
1144move the endpoints of the overlays in the region, or split them. 1143move the endpoints of the overlays in the region, or split them.
1145 1144
1146If @var{name} is omitted or nil, it means to delete all overlays in 1145If @var{name} is omitted or @code{nil}, it means to delete all overlays in
1147the specified region. If @var{start} and/or @var{end} are omitted or 1146the specified region. If @var{start} and/or @var{end} are omitted or
1148nil, that means the beginning and end of the buffer respectively. 1147@code{nil}, that means the beginning and end of the buffer respectively.
1149Therefore, @code{(remove-overlays)} removes all the overlays in the 1148Therefore, @code{(remove-overlays)} removes all the overlays in the
1150current buffer. 1149current buffer.
1151@end defun 1150@end defun
@@ -1557,7 +1556,7 @@ This case is useful for tiling small images or image slices without
1557adding blank areas between the images. 1556adding blank areas between the images.
1558 1557
1559 If the property value is not @code{t}, it is a height spec. A height 1558 If the property value is not @code{t}, it is a height spec. A height
1560spec stands for a numeric height value; this heigh spec specifies the 1559spec stands for a numeric height value; this height spec specifies the
1561actual line height, @var{line-height}. There are several ways to 1560actual line height, @var{line-height}. There are several ways to
1562write a height spec; here's how each of them translates into a numeric 1561write a height spec; here's how each of them translates into a numeric
1563height: 1562height:
@@ -1573,7 +1572,7 @@ If the height spec is a cons of the format shown, the numeric height
1573is @var{ratio} times the height of face @var{face}. @var{ratio} can 1572is @var{ratio} times the height of face @var{face}. @var{ratio} can
1574be any type of number, or @code{nil} which means a ratio of 1. 1573be any type of number, or @code{nil} which means a ratio of 1.
1575If @var{face} is @code{t}, it refers to the current face. 1574If @var{face} is @code{t}, it refers to the current face.
1576@item (@code{nil} . @var{ratio}) 1575@item (nil . @var{ratio})
1577If the height spec is a cons of the format shown, the numeric height 1576If the height spec is a cons of the format shown, the numeric height
1578is @var{ratio} times the height of the contents of the line. 1577is @var{ratio} times the height of the contents of the line.
1579@end table 1578@end table
@@ -1584,7 +1583,7 @@ is less than @var{line-height}, Emacs adds extra vertical space above
1584the line to achieve the total height @var{line-height}. Otherwise, 1583the line to achieve the total height @var{line-height}. Otherwise,
1585@var{line-height} has no effect. 1584@var{line-height} has no effect.
1586 1585
1587 If you don't specify the @code{line-height} propery, the line's 1586 If you don't specify the @code{line-height} property, the line's
1588height consists of the contents' height plus the line spacing. 1587height consists of the contents' height plus the line spacing.
1589There are several ways to specify the line spacing for different 1588There are several ways to specify the line spacing for different
1590parts of Emacs text. 1589parts of Emacs text.
@@ -1800,19 +1799,28 @@ When @code{defface} executes, it defines the face according to
1800init file (@pxref{Init File}) to override that specification. 1799init file (@pxref{Init File}) to override that specification.
1801 1800
1802The purpose of @var{spec} is to specify how the face should appear on 1801The purpose of @var{spec} is to specify how the face should appear on
1803different kinds of terminals. It should be an alist whose elements have 1802different kinds of terminals. It should be an alist whose elements
1804the form @code{(@var{display} @var{atts})}. Each element's @sc{car}, 1803have the form @code{(@var{display} @var{atts})}. Each element's
1805@var{display}, specifies a class of terminals. The element's second element, 1804@sc{car}, @var{display}, specifies a class of terminals. (The first
1806@var{atts}, is a list of face attributes and their values; it specifies 1805element, if it s @sc{car} is @code{default}, is special---it specifies
1807what the face should look like on that kind of terminal. The possible 1806defaults for the remaining elements). The element's @sc{cadr},
1808attributes are defined in the value of @code{custom-face-attributes}. 1807@var{atts}, is a list of face attributes and their values; it
1808specifies what the face should look like on that kind of terminal.
1809The possible attributes are defined in the value of
1810@code{custom-face-attributes}.
1809 1811
1810The @var{display} part of an element of @var{spec} determines which 1812The @var{display} part of an element of @var{spec} determines which
1811frames the element applies to. If more than one element of @var{spec} 1813frames the element matches. If more than one element of @var{spec}
1812matches a given frame, the first matching element is the only one used 1814matches a given frame, the first element that matches is the one used
1813for that frame. There are two possibilities for @var{display}: 1815for that frame. There are three possibilities for @var{display}:
1814 1816
1815@table @asis 1817@table @asis
1818@item @code{default}
1819This element of @var{spec} doesn't match any frames; instead, it
1820specifies defaults that apply to all frames. This kind of element, if
1821used, must be the first element of @var{spec}. Each of the following
1822elements can override any or all of these defaults.
1823
1816@item @code{t} 1824@item @code{t}
1817This element of @var{spec} matches all frames. Therefore, any 1825This element of @var{spec} matches all frames. Therefore, any
1818subsequent elements of @var{spec} are never used. Normally 1826subsequent elements of @var{spec} are never used. Normally
@@ -1840,8 +1848,9 @@ What kinds of colors the frame supports---either @code{color},
1840The kind of background---either @code{light} or @code{dark}. 1848The kind of background---either @code{light} or @code{dark}.
1841 1849
1842@item min-colors 1850@item min-colors
1843An integer that represents the minimum number of colors the frame should 1851An integer that represents the minimum number of colors the frame
1844support, it is compared with the result of @code{display-color-cells}. 1852should support. This matches a frame if its
1853@code{display-color-cells} value is at least the specified integer.
1845 1854
1846@item supports 1855@item supports
1847Whether or not the frame can display the face attributes given in 1856Whether or not the frame can display the face attributes given in
@@ -2975,7 +2984,7 @@ given time.
2975@code{overlay-arrow-variable-list}. 2984@code{overlay-arrow-variable-list}.
2976 2985
2977@defvar overlay-arrow-variable-list 2986@defvar overlay-arrow-variable-list
2978This variable's value is a list of varibles, each of which specifies 2987This variable's value is a list of variables, each of which specifies
2979the position of an overlay arrow. The variable 2988the position of an overlay arrow. The variable
2980@code{overlay-arrow-position} has its normal meaning because it is on 2989@code{overlay-arrow-position} has its normal meaning because it is on
2981this list. 2990this list.
@@ -3151,7 +3160,7 @@ results:
3151@noindent 3160@noindent
3152This illustrates that what matters is the property value for 3161This illustrates that what matters is the property value for
3153each character. If two consecutive characters have the same 3162each character. If two consecutive characters have the same
3154object as the @code{display} property value, it's irrelevent 3163object as the @code{display} property value, it's irrelevant
3155whether they got this property from a single call to 3164whether they got this property from a single call to
3156@code{put-text-property} or from two different calls. 3165@code{put-text-property} or from two different calls.
3157 3166
diff --git a/lispref/edebug.texi b/lispref/edebug.texi
index c53bc8653d9..cc42926ecf7 100644
--- a/lispref/edebug.texi
+++ b/lispref/edebug.texi
@@ -955,9 +955,8 @@ however, still run out of stack space when using Edebug.
955 955
956@item 956@item
957The state of keyboard macro execution is saved and restored. While 957The state of keyboard macro execution is saved and restored. While
958Edebug is active, @code{executing-macro} is bound to 958Edebug is active, @code{executing-kbd-macro} is bound to @code{nil}
959@code{edebug-continue-kbd-macro}. 959unless @code{edebug-continue-kbd-macro} is non-@code{nil}.
960
961@end itemize 960@end itemize
962 961
963 962
diff --git a/lispref/files.texi b/lispref/files.texi
index 18a98a406c4..b39a552e3af 100644
--- a/lispref/files.texi
+++ b/lispref/files.texi
@@ -1364,7 +1364,7 @@ with @code{add-name-to-file} and then deleting @var{filename} has the
1364same effect as renaming, aside from momentary intermediate states. 1364same effect as renaming, aside from momentary intermediate states.
1365@end deffn 1365@end deffn
1366 1366
1367@deffn Command copy-file oldname newname &optional ok-if-exists time 1367@deffn Command copy-file oldname newname &optional ok-if-exists time mustbenew
1368This command copies the file @var{oldname} to @var{newname}. An 1368This command copies the file @var{oldname} to @var{newname}. An
1369error is signaled if @var{oldname} does not exist. If @var{newname} 1369error is signaled if @var{oldname} does not exist. If @var{newname}
1370names a directory, it copies @var{oldname} into that directory, 1370names a directory, it copies @var{oldname} into that directory,
@@ -1379,6 +1379,10 @@ This function copies the file modes, too.
1379 1379
1380In an interactive call, a prefix argument specifies a non-@code{nil} 1380In an interactive call, a prefix argument specifies a non-@code{nil}
1381value for @var{time}. 1381value for @var{time}.
1382
1383The argument @var{mustbenew} controls whether an existing file can be
1384overwritten. It works like the similarly-named argument of
1385@code{write-region} (@pxref{Writing to Files, mustbenew}).
1382@end deffn 1386@end deffn
1383 1387
1384@deffn Command make-symbolic-link filename newname &optional ok-if-exists 1388@deffn Command make-symbolic-link filename newname &optional ok-if-exists
@@ -2024,10 +2028,13 @@ two different jobs from trying to use the exact same file name.
2024 2028
2025@defun make-temp-file prefix &optional dir-flag suffix 2029@defun make-temp-file prefix &optional dir-flag suffix
2026@tindex make-temp-file 2030@tindex make-temp-file
2027This function creates a temporary file and returns its name. 2031This function creates a temporary file and returns its name. Emacs
2028The name starts with @var{prefix}; it also contains a number that is 2032creates the temporary file's name by adding to @var{prefix} some
2029different in each Emacs job. If @var{prefix} is a relative file name, 2033random characters that are different in each Emacs job. The result is
2030it is expanded against @code{temporary-file-directory}. 2034guaranteed to be a newly created empty file. On MS-DOS, this function
2035can truncate the @var{string} prefix to fit into the 8+3 file-name
2036limits. If @var{prefix} is a relative file name, it is expanded
2037against @code{temporary-file-directory}.
2031 2038
2032@example 2039@example
2033@group 2040@group
@@ -2072,13 +2079,13 @@ you should use @code{make-temp-name} instead:
2072@end example 2079@end example
2073 2080
2074@defun make-temp-name string 2081@defun make-temp-name string
2075This function generates a string that can be used as a unique file name. 2082This function generates a string that can be used as a unique file
2076The name starts with @var{string}, and contains a number that is 2083name. The name starts with @var{string}, and has several random
2077different in each Emacs job. It is like @code{make-temp-file} except 2084characters appended to it, which are different in each Emacs job. It
2078that it just constructs a name, and does not create a file. Another 2085is like @code{make-temp-file} except that it just constructs a name,
2079difference is that @var{string} should be an absolute file name. On 2086and does not create a file. Another difference is that @var{string}
2080MS-DOS, this function can truncate the @var{string} prefix to fit into 2087should be an absolute file name. On MS-DOS, this function can
2081the 8+3 file-name limits. 2088truncate the @var{string} prefix to fit into the 8+3 file-name limits.
2082@end defun 2089@end defun
2083 2090
2084@defvar temporary-file-directory 2091@defvar temporary-file-directory
@@ -2434,7 +2441,7 @@ check the given file name against @code{file-name-handler-alist}. If
2434the file name matches @var{regexp}, the primitives handle that file by 2441the file name matches @var{regexp}, the primitives handle that file by
2435calling @var{handler}. 2442calling @var{handler}.
2436 2443
2437The first argument given to @var{handler} is the name of the 2444 The first argument given to @var{handler} is the name of the
2438primitive, as a symbol; the remaining arguments are the arguments that 2445primitive, as a symbol; the remaining arguments are the arguments that
2439were passed to that primitive. (The first of these arguments is most 2446were passed to that primitive. (The first of these arguments is most
2440often the file name itself.) For example, if you do this: 2447often the file name itself.) For example, if you do this:
@@ -2451,7 +2458,7 @@ called like this:
2451(funcall @var{handler} 'file-exists-p @var{filename}) 2458(funcall @var{handler} 'file-exists-p @var{filename})
2452@end example 2459@end example
2453 2460
2454When a function takes two or more arguments that must be file names, 2461 When a function takes two or more arguments that must be file names,
2455it checks each of those names for a handler. For example, if you do 2462it checks each of those names for a handler. For example, if you do
2456this: 2463this:
2457 2464
@@ -2472,7 +2479,7 @@ this:
2472The @var{handler} then needs to figure out whether to handle 2479The @var{handler} then needs to figure out whether to handle
2473@var{filename} or @var{dirname}. 2480@var{filename} or @var{dirname}.
2474 2481
2475If the specified file name matches more than one handler, the one 2482 If the specified file name matches more than one handler, the one
2476whose match starts last in the file name gets precedence. This rule 2483whose match starts last in the file name gets precedence. This rule
2477is chosen so that handlers for jobs such as uncompression are handled 2484is chosen so that handlers for jobs such as uncompression are handled
2478first, before handlers for jobs such as remote file access. 2485first, before handlers for jobs such as remote file access.
@@ -2568,12 +2575,12 @@ Here are the operations that a magic file name handler gets to handle:
2568@end flushleft 2575@end flushleft
2569@end iftex 2576@end iftex
2570 2577
2571Handlers for @code{insert-file-contents} typically need to clear the 2578 Handlers for @code{insert-file-contents} typically need to clear the
2572buffer's modified flag, with @code{(set-buffer-modified-p nil)}, if the 2579buffer's modified flag, with @code{(set-buffer-modified-p nil)}, if the
2573@var{visit} argument is non-@code{nil}. This also has the effect of 2580@var{visit} argument is non-@code{nil}. This also has the effect of
2574unlocking the buffer if it is locked. 2581unlocking the buffer if it is locked.
2575 2582
2576The handler function must handle all of the above operations, and 2583 The handler function must handle all of the above operations, and
2577possibly others to be added in the future. It need not implement all 2584possibly others to be added in the future. It need not implement all
2578these operations itself---when it has nothing special to do for a 2585these operations itself---when it has nothing special to do for a
2579certain operation, it can reinvoke the primitive, to handle the 2586certain operation, it can reinvoke the primitive, to handle the
@@ -2596,7 +2603,7 @@ for an operation it does not recognize. Here's one way to do this:
2596 (apply operation args))))) 2603 (apply operation args)))))
2597@end smallexample 2604@end smallexample
2598 2605
2599When a handler function decides to call the ordinary Emacs primitive for 2606 When a handler function decides to call the ordinary Emacs primitive for
2600the operation at hand, it needs to prevent the primitive from calling 2607the operation at hand, it needs to prevent the primitive from calling
2601the same handler once again, thus leading to an infinite recursion. The 2608the same handler once again, thus leading to an infinite recursion. The
2602example above shows how to do this, with the variables 2609example above shows how to do this, with the variables
@@ -2607,7 +2614,7 @@ multiple handlers, and for operations that have two file names that may
2607each have handlers. 2614each have handlers.
2608 2615
2609@kindex safe-magic (@r{property}) 2616@kindex safe-magic (@r{property})
2610Handlers that don't really do anything special for actual access to the 2617 Handlers that don't really do anything special for actual access to the
2611file---such as the ones that implement completion of host names for 2618file---such as the ones that implement completion of host names for
2612remote file names---should have a non-@code{nil} @code{safe-magic} 2619remote file names---should have a non-@code{nil} @code{safe-magic}
2613property. For instance, Emacs normally ``protects'' directory names 2620property. For instance, Emacs normally ``protects'' directory names
@@ -2616,6 +2623,15 @@ file names, by prefixing them with @samp{/:}. But if the handler that
2616would be used for them has a non-@code{nil} @code{safe-magic} 2623would be used for them has a non-@code{nil} @code{safe-magic}
2617property, the @samp{/:} is not added. 2624property, the @samp{/:} is not added.
2618 2625
2626@kindex operations (@r{property})
2627 A file name handler can have an @code{operations} property to
2628declare which operations it handles in a nontrivial way. If this
2629property has a non-@code{nil} value, it should be a list of
2630operations; then only those operations will call the handler. This
2631avoids inefficiency, but its main purpose is for autoloaded handler
2632functions, so that they won't be loaded except when they have real
2633work to do.
2634
2619@defvar inhibit-file-name-handlers 2635@defvar inhibit-file-name-handlers
2620This variable holds a list of handlers whose use is presently inhibited 2636This variable holds a list of handlers whose use is presently inhibited
2621for a certain operation. 2637for a certain operation.
diff --git a/lispref/frames.texi b/lispref/frames.texi
index 712f05df597..d56c071ad1e 100644
--- a/lispref/frames.texi
+++ b/lispref/frames.texi
@@ -1360,8 +1360,9 @@ This function displays a pop-up menu and returns an indication of
1360what selection the user makes. 1360what selection the user makes.
1361 1361
1362The argument @var{position} specifies where on the screen to put the 1362The argument @var{position} specifies where on the screen to put the
1363menu. It can be either a mouse button event (which says to put the menu 1363top left corner of the menu. It can be either a mouse button event
1364where the user actuated the button) or a list of this form: 1364(which says to put the menu where the user actuated the button) or a
1365list of this form:
1365 1366
1366@example 1367@example
1367((@var{xoffset} @var{yoffset}) @var{window}) 1368((@var{xoffset} @var{yoffset}) @var{window})
@@ -1369,7 +1370,8 @@ where the user actuated the button) or a list of this form:
1369 1370
1370@noindent 1371@noindent
1371where @var{xoffset} and @var{yoffset} are coordinates, measured in 1372where @var{xoffset} and @var{yoffset} are coordinates, measured in
1372pixels, counting from the top left corner of @var{window}'s frame. 1373pixels, counting from the top left corner of @var{window}. @var{window}
1374may be a window or a frame.
1373 1375
1374If @var{position} is @code{t}, it means to use the current mouse 1376If @var{position} is @code{t}, it means to use the current mouse
1375position. If @var{position} is @code{nil}, it means to precompute the 1377position. If @var{position} is @code{nil}, it means to precompute the
@@ -1377,8 +1379,13 @@ key binding equivalents for the keymaps specified in @var{menu},
1377without actually displaying or popping up the menu. 1379without actually displaying or popping up the menu.
1378 1380
1379The argument @var{menu} says what to display in the menu. It can be a 1381The argument @var{menu} says what to display in the menu. It can be a
1380keymap or a list of keymaps (@pxref{Menu Keymaps}). Alternatively, it 1382keymap or a list of keymaps (@pxref{Menu Keymaps}). In this case, the
1381can have the following form: 1383return value is the list of events corresponding to the user's choice.
1384(This list has more than one element if the choice occurred in a
1385submenu.) Note that @code{x-popup-menu} does not actually execute the
1386command bound to that sequence of events.
1387
1388Alternatively, @var{menu} can have the following form:
1382 1389
1383@example 1390@example
1384(@var{title} @var{pane1} @var{pane2}...) 1391(@var{title} @var{pane1} @var{pane2}...)
@@ -1388,11 +1395,13 @@ can have the following form:
1388where each pane is a list of form 1395where each pane is a list of form
1389 1396
1390@example 1397@example
1391(@var{title} (@var{line} . @var{item})...) 1398(@var{title} @var{item1} @var{item2}...)
1392@end example 1399@end example
1393 1400
1394Each @var{line} should be a string, and each @var{item} should be the 1401Each item should normally be a cons cell @code{(@var{line} . @var{value})},
1395value to return if that @var{line} is chosen. 1402where @var{line} is a string, and @var{value} is the value to return if
1403that @var{line} is chosen. An item can also be a string; this makes a
1404non-selectable line in the menu.
1396@end defun 1405@end defun
1397 1406
1398 @strong{Usage note:} Don't use @code{x-popup-menu} to display a menu 1407 @strong{Usage note:} Don't use @code{x-popup-menu} to display a menu
@@ -1443,9 +1452,9 @@ which looks like the list that specifies a single pane for
1443 1452
1444The return value is @var{value} from the chosen alternative. 1453The return value is @var{value} from the chosen alternative.
1445 1454
1446An element of the list may be just a string instead of a cons cell 1455As for @code{x-popup-menu}, an element of the list may be just a
1447@code{(@var{string} . @var{value})}. That makes a box that cannot 1456string instead of a cons cell @code{(@var{string} . @var{value})}.
1448be selected. 1457That makes a box that cannot be selected.
1449 1458
1450If @code{nil} appears in the list, it separates the left-hand items from 1459If @code{nil} appears in the list, it separates the left-hand items from
1451the right-hand items; items that precede the @code{nil} appear on the 1460the right-hand items; items that precede the @code{nil} appear on the
@@ -1455,8 +1464,8 @@ items appear on each side.
1455 1464
1456Dialog boxes always appear in the center of a frame; the argument 1465Dialog boxes always appear in the center of a frame; the argument
1457@var{position} specifies which frame. The possible values are as in 1466@var{position} specifies which frame. The possible values are as in
1458@code{x-popup-menu}, but the precise coordinates don't matter; only the 1467@code{x-popup-menu}, but the precise coordinates or the individual
1459frame matters. 1468window don't matter; only the frame matters.
1460 1469
1461In some configurations, Emacs cannot display a real dialog box; so 1470In some configurations, Emacs cannot display a real dialog box; so
1462instead it displays the same items in a pop-up menu in the center of the 1471instead it displays the same items in a pop-up menu in the center of the
diff --git a/lispref/hooks.texi b/lispref/hooks.texi
index ea7c6605796..92dcb038b24 100644
--- a/lispref/hooks.texi
+++ b/lispref/hooks.texi
@@ -19,7 +19,8 @@ to put a new function on such a hook is to call @code{add-hook}.
19Every major mode defines a mode hook named 19Every major mode defines a mode hook named
20@samp{@var{modename}-mode-hook}. The major mode command runs this 20@samp{@var{modename}-mode-hook}. The major mode command runs this
21normal hook with @code{run-mode-hooks} as the very last thing it does. 21normal hook with @code{run-mode-hooks} as the very last thing it does.
22@xref{Mode Hooks}. Mode hooks are omitted in the list below. 22@xref{Mode Hooks}. Most minor modes have mode hooks too. Mode hooks
23are omitted in the list below.
23 24
24The variables whose names end in @samp{-hooks} or @samp{-functions} are 25The variables whose names end in @samp{-hooks} or @samp{-functions} are
25usually @dfn{abnormal hooks}; their values are lists of functions, but 26usually @dfn{abnormal hooks}; their values are lists of functions, but
@@ -147,6 +148,27 @@ for appointment notification.
147@item first-change-hook 148@item first-change-hook
148@xref{Change Hooks}. 149@xref{Change Hooks}.
149 150
151@item font-lock-beginning-of-syntax-function
152@xref{Syntactic Font Lock}.
153
154@item font-lock-fontify-buffer-function
155@xref{Other Font Lock Variables}.
156
157@item font-lock-fontify-region-function
158@xref{Other Font Lock Variables}.
159
160@item font-lock-mark-block-function
161@xref{Other Font Lock Variables}.
162
163@item font-lock-syntactic-face-function
164@xref{Syntactic Font Lock}.
165
166@item font-lock-unfontify-buffer-function
167@xref{Other Font Lock Variables}.
168
169@item font-lock-unfontify-region-function
170@xref{Other Font Lock Variables}.
171
150@item initial-calendar-window-hook 172@item initial-calendar-window-hook
151@inforef{Calendar Customizing,, emacs-xtra}. 173@inforef{Calendar Customizing,, emacs-xtra}.
152 174
diff --git a/lispref/lists.texi b/lispref/lists.texi
index 47ea5b7d541..ab7d496e461 100644
--- a/lispref/lists.texi
+++ b/lispref/lists.texi
@@ -1667,6 +1667,15 @@ alist
1667@end example 1667@end example
1668@end defun 1668@end defun
1669 1669
1670@defun rassq-delete-all value alist
1671This function deletes from @var{alist} all the elements whose @sc{cdr}
1672is @code{eq} to @var{value}. It returns the shortened alist, and
1673often modifies the original list structure of @var{alist}.
1674@code{rassq-delete-all} is like @code{assq-delete-all} except that it
1675compares the @sc{cdr} of each @var{alist} association instead of the
1676@sc{car}.
1677@end defun
1678
1670@ignore 1679@ignore
1671 arch-tag: 31fb8a4e-4aa8-4a74-a206-aa00451394d4 1680 arch-tag: 31fb8a4e-4aa8-4a74-a206-aa00451394d4
1672@end ignore 1681@end ignore
diff --git a/lispref/modes.texi b/lispref/modes.texi
index 6087d7f89ae..12c4493b36f 100644
--- a/lispref/modes.texi
+++ b/lispref/modes.texi
@@ -103,6 +103,8 @@ Fundamental mode. Rmail mode is a complicated and specialized mode.
103* Mode Help:: Finding out how to use a mode. 103* Mode Help:: Finding out how to use a mode.
104* Derived Modes:: Defining a new major mode based on another major 104* Derived Modes:: Defining a new major mode based on another major
105 mode. 105 mode.
106* Generic Modes:: Defining a simple major mode that supports
107 comment syntax and Font Lock mode.
106* Mode Hooks:: Hooks run at the end of major mode functions. 108* Mode Hooks:: Hooks run at the end of major mode functions.
107@end menu 109@end menu
108 110
@@ -255,6 +257,11 @@ variable @code{imenu-generic-expression}, for the pair of variables
255@code{imenu-create-index-function} (@pxref{Imenu}). 257@code{imenu-create-index-function} (@pxref{Imenu}).
256 258
257@item 259@item
260The mode can specify a local value for
261@code{eldoc-documentation-function} to tell ElDoc mode how to handle
262this mode.
263
264@item
258Use @code{defvar} or @code{defcustom} to set mode-related variables, so 265Use @code{defvar} or @code{defcustom} to set mode-related variables, so
259that they are not reinitialized if they already have a value. (Such 266that they are not reinitialized if they already have a value. (Such
260reinitialization could discard customizations made by the user.) 267reinitialization could discard customizations made by the user.)
@@ -793,6 +800,7 @@ mode.
793 800
794@node Derived Modes 801@node Derived Modes
795@subsection Defining Derived Modes 802@subsection Defining Derived Modes
803@cindex derived mode
796 804
797 It's often useful to define a new major mode in terms of an existing 805 It's often useful to define a new major mode in terms of an existing
798one. An easy way to do this is to use @code{define-derived-mode}. 806one. An easy way to do this is to use @code{define-derived-mode}.
@@ -855,6 +863,57 @@ Do not write an @code{interactive} spec in the definition;
855@code{define-derived-mode} does that automatically. 863@code{define-derived-mode} does that automatically.
856@end defmac 864@end defmac
857 865
866@node Generic Modes
867@subsection Generic Modes
868@cindex generic mode
869
870@dfn{Generic modes} are simple major modes with basic support for
871comment syntax and Font Lock mode. They are primarily useful for
872configuration files. To define a generic mode, use the macro
873@code{define-generic-mode}. See the file @file{generic-x.el} for some
874examples of the use of @code{define-generic-mode}.
875
876@defmac define-generic-mode mode comment-list keyword-list font-lock-list auto-mode-list function-list &optional docstring &rest custom-keyword-args
877This macro creates a new generic mode. The argument @var{mode} (an
878unquoted symbol) is the major mode command. The optional argument
879@var{docstring} is the documentation for the mode command. If you do
880not supply it, @code{define-generic-mode} uses a default documentation
881string instead.
882
883@var{comment-list} is a list in which each element is either a
884character, a string of one or two characters, or a cons cell. A
885character or a string is set up in the mode's syntax table as a
886``comment starter.'' If the entry is a cons cell, the @sc{car} is set
887up as a ``comment starter'' and the @sc{cdr} as a ``comment ender.''
888(Use @code{nil} for the latter if you want comments to end at the end
889of the line.) Note that the syntax table has limitations about what
890comment starters and enders are actually possible. @xref{Syntax
891Tables}.
892
893@var{keyword-list} is a list of keywords to highlight with
894@code{font-lock-keyword-face}. Each keyword should be a string.
895@var{font-lock-list} is a list of additional expressions to highlight.
896Each element of this list should have the same form as an element of
897@code{font-lock-keywords}. @xref{Search-based Fontification}.
898
899@var{auto-mode-list} is a list of regular expressions to add to the
900variable @code{auto-mode-alist}. These regular expressions are added
901when Emacs runs the macro expansion.
902
903@var{function-list} is a list of functions to call to do some
904additional setup. The mode command calls these functions just before
905it runs the mode hook.
906
907The optional @var{custom-keyword-args} are pairs of keywords and
908values to include in the generated @code{defcustom} form for the mode
909hook variable @code{@var{mode}-hook}. The default value for the
910@samp{:group} keyword is @var{mode} with the final @samp{-mode} (if
911any) removed. Don't use this default group name unless you have
912written a @code{defgroup} to define that group properly (@pxref{Group
913Definitions}). You can specify keyword arguments without specifying a
914docstring.
915@end defmac
916
858@node Mode Hooks 917@node Mode Hooks
859@subsection Mode Hooks 918@subsection Mode Hooks
860 919
@@ -1129,9 +1188,10 @@ corresponding values. A few keywords have special meanings:
1129@table @code 1188@table @code
1130@item :group @var{group} 1189@item :group @var{group}
1131Custom group name to use in all generated @code{defcustom} forms. 1190Custom group name to use in all generated @code{defcustom} forms.
1132Defaults to @var{mode} without the possible trailing @samp{-mode}. Be 1191Defaults to @var{mode} without the possible trailing @samp{-mode}.
1133aware that this default may not be a valid customization group defined 1192@strong{Warning:} don't use this default group name unless you have
1134with @code{defgroup}. Please make sure it is. 1193written a @code{defgroup} to define that group properly. @xref{Group
1194Definitions}.
1135 1195
1136@item :global @var{global} 1196@item :global @var{global}
1137If non-@code{nil} specifies that the minor mode should be global. 1197If non-@code{nil} specifies that the minor mode should be global.
@@ -2020,12 +2080,11 @@ most major modes define syntactic criteria for which faces to use in
2020which contexts. This section explains how to customize Font Lock for a 2080which contexts. This section explains how to customize Font Lock for a
2021particular major mode. 2081particular major mode.
2022 2082
2023 Font Lock mode finds text to highlight in two ways: through syntactic 2083 Font Lock mode finds text to highlight in two ways: through
2024parsing based on the syntax table, and through searching (usually for 2084syntactic parsing based on the syntax table, and through searching
2025regular expressions). Syntactic fontification happens first; it finds 2085(usually for regular expressions). Syntactic fontification happens
2026comments and string constants, and highlights them using 2086first; it finds comments and string constants and highlights them.
2027@code{font-lock-comment-face} and @code{font-lock-string-face} 2087Search-based fontification happens second.
2028(@pxref{Faces for Font Lock}). Search-based fontification follows.
2029 2088
2030@menu 2089@menu
2031* Font Lock Basics:: Overview of customizing Font Lock. 2090* Font Lock Basics:: Overview of customizing Font Lock.
@@ -2036,7 +2095,8 @@ comments and string constants, and highlights them using
2036* Precalculated Fontification:: How Lisp programs that produce the buffer 2095* Precalculated Fontification:: How Lisp programs that produce the buffer
2037 contents can also specify how to fontify it. 2096 contents can also specify how to fontify it.
2038* Faces for Font Lock:: Special faces specifically for Font Lock. 2097* Faces for Font Lock:: Special faces specifically for Font Lock.
2039* Syntactic Font Lock:: Defining character syntax based on context 2098* Syntactic Font Lock:: Fontification based on syntax tables.
2099* Setting Syntax Properties:: Defining character syntax based on context
2040 using the Font Lock mechanism. 2100 using the Font Lock mechanism.
2041@end menu 2101@end menu
2042 2102
@@ -2051,45 +2111,48 @@ Lock mode is enabled, to set all the other variables.
2051 2111
2052@defvar font-lock-defaults 2112@defvar font-lock-defaults
2053This variable is set by major modes, as a buffer-local variable, to 2113This variable is set by major modes, as a buffer-local variable, to
2054specify how to fontify text in that mode. The value should look like 2114specify how to fontify text in that mode. It automatically becomes
2055this: 2115buffer-local when you set it. The value should look like this:
2056 2116
2057@example 2117@example
2058(@var{keywords} @var{keywords-only} @var{case-fold} 2118(@var{keywords} [@var{keywords-only} [@var{case-fold}
2059 @var{syntax-alist} @var{syntax-begin} @var{other-vars}@dots{}) 2119 [@var{syntax-alist} [@var{syntax-begin} @var{other-vars}@dots{}]]]])
2060@end example 2120@end example
2061 2121
2062The first element, @var{keywords}, indirectly specifies the value of 2122The first element, @var{keywords}, indirectly specifies the value of
2063@code{font-lock-keywords}. It can be a symbol, a variable whose value 2123@code{font-lock-keywords} which directs search-based fontification.
2064is the list to use for @code{font-lock-keywords}. It can also be a list of 2124It can be a symbol, a variable or a function whose value is the list
2065several such symbols, one for each possible level of fontification. The 2125to use for @code{font-lock-keywords}. It can also be a list of
2066first symbol specifies how to do level 1 fontification, the second 2126several such symbols, one for each possible level of fontification.
2067symbol how to do level 2, and so on. 2127The first symbol specifies how to do level 1 fontification, the second
2128symbol how to do level 2, and so on. @xref{Levels of Font Lock}.
2068 2129
2069The second element, @var{keywords-only}, specifies the value of the 2130The second element, @var{keywords-only}, specifies the value of the
2070variable @code{font-lock-keywords-only}. If this is non-@code{nil}, 2131variable @code{font-lock-keywords-only}. If this is non-@code{nil},
2071syntactic fontification (of strings and comments) is not performed. 2132syntactic fontification (of strings and comments) is not performed.
2133@xref{Syntactic Font Lock}.
2072 2134
2073The third element, @var{case-fold}, specifies the value of 2135The third element, @var{case-fold}, specifies the value of
2074@code{font-lock-keywords-case-fold-search}. If it is non-@code{nil}, Font Lock 2136@code{font-lock-keywords-case-fold-search}. If it is non-@code{nil},
2075mode ignores case when searching as directed by 2137Font Lock mode ignores case when searching as directed by
2076@code{font-lock-keywords}. 2138@code{font-lock-keywords}.
2077 2139
2078If the fourth element, @var{syntax-alist}, is non-@code{nil}, it should be 2140If the fourth element, @var{syntax-alist}, is non-@code{nil}, it
2079a list of cons cells of the form @code{(@var{char-or-string} 2141should be a list of cons cells of the form @code{(@var{char-or-string}
2080. @var{string})}. These are used to set up a syntax table for 2142. @var{string})}. These are used to set up a syntax table for
2081fontification (@pxref{Syntax Table Functions}). The resulting syntax 2143syntactic fontification (@pxref{Syntax Table Functions}). The
2082table is stored in @code{font-lock-syntax-table}. 2144resulting syntax table is stored in @code{font-lock-syntax-table}.
2083 2145
2084The fifth element, @var{syntax-begin}, specifies the value of 2146The fifth element, @var{syntax-begin}, specifies the value of
2085@code{font-lock-beginning-of-syntax-function} (see below). 2147@code{font-lock-beginning-of-syntax-function}.
2086 2148
2087All the remaining elements (if any) are collectively called 2149All the remaining elements (if any) are collectively called
2088@var{other-vars}. Each of these elements should have the form 2150@var{other-vars}. Each of these elements should have the form
2089@code{(@var{variable} . @var{value})}---which means, make @var{variable} 2151@code{(@var{variable} . @var{value})}---which means, make
2090buffer-local and then set it to @var{value}. You can use these 2152@var{variable} buffer-local and then set it to @var{value}. You can
2091@var{other-vars} to set other variables that affect fontification, 2153use these @var{other-vars} to set other variables that affect
2092aside from those you can control with the first five elements. 2154fontification, aside from those you can control with the first five
2155elements. @xref{Other Font Lock Variables}.
2093@end defvar 2156@end defvar
2094 2157
2095@node Search-based Fontification 2158@node Search-based Fontification
@@ -2097,7 +2160,8 @@ aside from those you can control with the first five elements.
2097 2160
2098 The most important variable for customizing Font Lock mode is 2161 The most important variable for customizing Font Lock mode is
2099@code{font-lock-keywords}. It specifies the search criteria for 2162@code{font-lock-keywords}. It specifies the search criteria for
2100search-based fontification. 2163search-based fontification. You should specify the value of this
2164variable with @var{keywords} in @code{font-lock-defaults}.
2101 2165
2102@defvar font-lock-keywords 2166@defvar font-lock-keywords
2103This variable's value is a list of the keywords to highlight. Be 2167This variable's value is a list of the keywords to highlight. Be
@@ -2187,7 +2251,8 @@ other text property names that you set in this way to the value of
2187@code{font-lock-extra-managed-props} so that the properties will also 2251@code{font-lock-extra-managed-props} so that the properties will also
2188be cleared out when they are no longer appropriate. Alternatively, 2252be cleared out when they are no longer appropriate. Alternatively,
2189you can set the variable @code{font-lock-unfontify-region-function} to 2253you can set the variable @code{font-lock-unfontify-region-function} to
2190a function that clears these properties. 2254a function that clears these properties. @xref{Other Font Lock
2255Variables}.
2191 2256
2192@item (@var{matcher} . @var{subexp-highlighter}) 2257@item (@var{matcher} . @var{subexp-highlighter})
2193In this kind of element, @var{subexp-highlighter} is a list 2258In this kind of element, @var{subexp-highlighter} is a list
@@ -2307,6 +2372,7 @@ this value of @code{font-lock-keywords} is used in a buffer.
2307Its value should have one of the forms described in this table. 2372Its value should have one of the forms described in this table.
2308@end table 2373@end table
2309 2374
2375@vindex font-lock-multiline
2310@strong{Warning:} Do not design an element of @code{font-lock-keywords} 2376@strong{Warning:} Do not design an element of @code{font-lock-keywords}
2311to match text which spans lines; this does not work reliably. While 2377to match text which spans lines; this does not work reliably. While
2312@code{font-lock-fontify-buffer} handles multi-line patterns correctly, 2378@code{font-lock-fontify-buffer} handles multi-line patterns correctly,
@@ -2317,52 +2383,75 @@ line but can occasionally span two or three, such as
2317setting @code{font-lock-multiline} to @code{t}. But it still will not 2383setting @code{font-lock-multiline} to @code{t}. But it still will not
2318work in all cases. 2384work in all cases.
2319 2385
2320@node Other Font Lock Variables 2386You can use @var{case-fold} in @code{font-lock-defaults} to specify
2321@subsection Other Font Lock Variables 2387the value of @code{font-lock-keywords-case-fold-search} which says
2322 2388whether search-based fontification should be case-insensitive.
2323 This section describes additional variables that a major mode
2324can set by means of @code{font-lock-defaults}.
2325
2326@defvar font-lock-keywords-only
2327Non-@code{nil} means Font Lock should not fontify comments or strings
2328syntactically; it should only fontify based on
2329@code{font-lock-keywords}.
2330@end defvar
2331
2332@ignore
2333Other variables include those for buffer-specialized fontification functions,
2334`font-lock-fontify-buffer-function', `font-lock-unfontify-buffer-function',
2335`font-lock-fontify-region-function', `font-lock-unfontify-region-function',
2336`font-lock-inhibit-thing-lock' and `font-lock-maximum-size'.
2337@end ignore
2338 2389
2339@defvar font-lock-keywords-case-fold-search 2390@defvar font-lock-keywords-case-fold-search
2340Non-@code{nil} means that regular expression matching for the sake of 2391Non-@code{nil} means that regular expression matching for the sake of
2341@code{font-lock-keywords} should be case-insensitive. 2392@code{font-lock-keywords} should be case-insensitive.
2342@end defvar 2393@end defvar
2343 2394
2344@defvar font-lock-syntax-table 2395You can use @code{font-lock-add-keywords} to add additional
2345This variable specifies the syntax table to use for fontification of 2396search-based fontification rules to a major mode, and
2346comments and strings. 2397@code{font-lock-remove-keywords} to removes rules.
2347@end defvar 2398
2399@defun font-lock-add-keywords mode keywords &optional append
2400This function adds highlighting @var{keywords} for @var{mode}. The
2401argument @var{keywords} should be a list with the same format as the
2402variable @code{font-lock-keywords}. @var{mode} should be a symbol,
2403the major mode command name, such as @code{c-mode}. When Font Lock
2404mode is turned on in @var{mode}, it adds @var{keywords} to
2405@code{font-lock-keywords}. @var{mode} can also be @code{nil}; the
2406highlighting @var{keywords} are immediately added to
2407@code{font-lock-keywords} in the current buffer in that case.
2408
2409By default, @var{keywords} are added at the beginning of
2410@code{font-lock-keywords}. If the optional argument @var{append} is
2411@code{set}, they are used to replace the value of
2412@code{font-lock-keywords}. If @var{append} is any other
2413non-@code{nil} value, they are added at the end of
2414@code{font-lock-keywords}.
2348 2415
2349@defvar font-lock-beginning-of-syntax-function 2416For example:
2350If this variable is non-@code{nil}, it should be a function to move
2351point back to a position that is syntactically at ``top level'' and
2352outside of strings or comments. Font Lock uses this when necessary
2353to get the right results for syntactic fontification.
2354 2417
2355This function is called with no arguments. It should leave point at the 2418@smallexample
2356beginning of any enclosing syntactic block. Typical values are 2419(font-lock-add-keywords 'c-mode
2357@code{beginning-of-line} (i.e., the start of the line is known to be 2420 '(("\\<\\(FIXME\\):" 1 font-lock-warning-face prepend)
2358outside a syntactic block), or @code{beginning-of-defun} for programming 2421 ("\\<\\(and\\|or\\|not\\)\\>" . font-lock-keyword-face)))
2359modes or @code{backward-paragraph} for textual modes (i.e., the 2422@end smallexample
2360mode-dependent function is known to move outside a syntactic block).
2361 2423
2362If the value is @code{nil}, the beginning of the buffer is used as a 2424adds two fontification patterns for C mode: one to fontify the word
2363position outside of a syntactic block. This cannot be wrong, but it can 2425@samp{FIXME}, even in comments, and another to fontify the words
2364be slow. 2426@samp{and}, @samp{or} and @samp{not} as keywords.
2365@end defvar 2427
2428Some modes have specialized support for additional patterns. See the
2429variables @code{c-font-lock-extra-types},
2430@code{c++-font-lock-extra-types}, @code{objc-font-lock-extra-types}
2431and @code{java-font-lock-extra-types}, for example.
2432@end defun
2433
2434@defun font-lock-remove-keywords mode keywords
2435This function removes highlighting @var{keywords} for @var{mode}. As
2436in @code{font-lock-add-keywords}, @var{mode} should be a major mode
2437command name or @code{nil}. If @code{nil}, the highlighting
2438@var{keywords} are immediately removed in the current buffer.
2439@end defun
2440
2441@strong{Warning:} Only use a non-@code{nil} @var{mode} argument when
2442you use @code{font-lock-add-keywords} or
2443@code{font-lock-remove-keywords} in your @file{.emacs} file. When you
2444use these functions from a Lisp program (such as a minor mode), we
2445recommend that you use @code{nil} for @var{mode} (and place the call
2446on a hook) to avoid subtle problems due to the details of the
2447implementation.
2448
2449@node Other Font Lock Variables
2450@subsection Other Font Lock Variables
2451
2452 This section describes additional variables that a major mode can
2453set by means of @var{other-vars} in @code{font-lock-defaults}
2454(@pxref{Font Lock Basics}).
2366 2455
2367@defvar font-lock-mark-block-function 2456@defvar font-lock-mark-block-function
2368If this variable is non-@code{nil}, it should be a function that is 2457If this variable is non-@code{nil}, it should be a function that is
@@ -2378,25 +2467,38 @@ textual modes.
2378@end defvar 2467@end defvar
2379 2468
2380@defvar font-lock-extra-managed-props 2469@defvar font-lock-extra-managed-props
2381Additional properties (other than @code{font-lock-face}) that are 2470This variable specifies additional properties (other than
2382being managed by Font Lock mode. Font Lock mode normally manages only 2471@code{font-lock-face}) that are being managed by Font Lock mode. It
2383the @code{font-lock-face} property; if you want it to manage others as 2472is used by @code{font-lock-default-unfontify-region}, which normally
2384well, you must specify them in a @var{facespec} in 2473only manages the @code{font-lock-face} property. If you want Font
2385@code{font-lock-keywords} as well as adding them to this list. 2474Lock to manage other properties as well, you must specify them in a
2475@var{facespec} in @code{font-lock-keywords} as well as add them to
2476this list. @xref{Search-based Fontification}.
2386@end defvar 2477@end defvar
2387 2478
2388@defvar font-lock-syntactic-face-function 2479@defvar font-lock-fontify-buffer-function
2389A function to determine which face to use for a given syntactic 2480Function to use for fontifying the buffer. The default value is
2390element (a string or a comment). The function is called with one 2481@code{font-lock-default-fontify-buffer}.
2391argument, the parse state at point returned by 2482@end defvar
2392@code{parse-partial-sexp}, and should return a face. The default
2393value returns @code{font-lock-comment-face} for comments and
2394@code{font-lock-string-face} for strings.
2395 2483
2396This can be used to highlighting different kinds of strings or 2484@defvar font-lock-unfontify-buffer-function
2397comments differently. It is also sometimes abused together with 2485Function to use for unfontifying the buffer. This is used when
2398@code{font-lock-syntactic-keywords} to highlight elements that span 2486turning off Font Lock mode. The default value is
2399multiple lines, but this is too obscure to document in this manual. 2487@code{font-lock-default-unfontify-buffer}.
2488@end defvar
2489
2490@defvar font-lock-fontify-region-function
2491Function to use for fontifying a region. It should take two
2492arguments, the beginning and end of the region, and an optional third
2493argument @var{verbose}. If @var{verbose} is non-@code{nil}, the
2494function should print status messages. The default value is
2495@code{font-lock-default-fontify-region}.
2496@end defvar
2497
2498@defvar font-lock-unfontify-region-function
2499Function to use for unfontifying a region. It should take two
2500arguments, the beginning and end of the region. The default value is
2501@code{font-lock-default-unfontify-region}.
2400@end defvar 2502@end defvar
2401 2503
2402@defvar font-lock-lines-before 2504@defvar font-lock-lines-before
@@ -2407,6 +2509,14 @@ default is 1, but using a larger value can be useful for coping with
2407multi-line patterns. 2509multi-line patterns.
2408@end defvar 2510@end defvar
2409 2511
2512@ignore
2513@defvar font-lock-inhibit-thing-lock
2514List of Font Lock mode related modes that should not be turned on.
2515Currently, valid mode names are @code{fast-lock-mode},
2516@code{jit-lock-mode} and @code{lazy-lock-mode}.
2517@end defvar
2518@end ignore
2519
2410@node Levels of Font Lock 2520@node Levels of Font Lock
2411@subsection Levels of Font Lock 2521@subsection Levels of Font Lock
2412 2522
@@ -2451,16 +2561,9 @@ which construct their text programmatically, such as
2451@code{list-buffers} and @code{occur}. 2561@code{list-buffers} and @code{occur}.
2452 2562
2453If your mode does not use any of the other machinery of Font Lock 2563If your mode does not use any of the other machinery of Font Lock
2454(i.e. it only uses the @code{font-lock-face} property), you can tell 2564(i.e. it only uses the @code{font-lock-face} property), it should not
2455Emacs not to load all of font-lock.el (unless it's already loaded), by 2565set the variable @code{font-lock-defaults}. That way, it will not
2456setting the variable @code{font-lock-core-only} to non-@code{nil} as 2566cause loading of the @file{font-lock} library.
2457part of the @code{font-lock-defaults} settings. Here is the canonical
2458way to do this:
2459
2460@example
2461(set (make-local-variable 'font-lock-defaults)
2462 '(nil t nil nil nil (font-lock-core-only . t)))
2463@end example
2464 2567
2465@node Faces for Font Lock 2568@node Faces for Font Lock
2466@subsection Faces for Font Lock 2569@subsection Faces for Font Lock
@@ -2478,6 +2581,10 @@ Thus, the default value of @code{font-lock-comment-face} is
2478@vindex font-lock-comment-face 2581@vindex font-lock-comment-face
2479Used (typically) for comments. 2582Used (typically) for comments.
2480 2583
2584@item font-lock-comment-delimiter-face
2585@vindex font-lock-comment-delimiter-face
2586Used (typically) for comments delimiters.
2587
2481@item font-lock-doc-face 2588@item font-lock-doc-face
2482@vindex font-lock-doc-face 2589@vindex font-lock-doc-face
2483Used (typically) for documentation strings in the code. 2590Used (typically) for documentation strings in the code.
@@ -2529,14 +2636,78 @@ directives in C.
2529@node Syntactic Font Lock 2636@node Syntactic Font Lock
2530@subsection Syntactic Font Lock 2637@subsection Syntactic Font Lock
2531 2638
2639Syntactic fontification uses the syntax table to find comments and
2640string constants (@pxref{Syntax Tables}). It highlights them using
2641@code{font-lock-comment-face} and @code{font-lock-string-face}
2642(@pxref{Faces for Font Lock}). There are several variables that
2643affect syntactic fontification; you should set them by means of
2644@code{font-lock-defaults} (@pxref{Font Lock Basics}).
2645
2646@defvar font-lock-keywords-only
2647Non-@code{nil} means Font Lock should not do syntactic fontification;
2648it should only fontify based on @code{font-lock-keywords}. The normal
2649way for a mode to set this variable to @code{t} is with
2650@var{keywords-only} in @code{font-lock-defaults}.
2651@end defvar
2652
2653@defvar font-lock-syntax-table
2654This variable holds the syntax table to use for fontification of
2655comments and strings. Specify it using @var{syntax-alist} in
2656@code{font-lock-defaults}.
2657@end defvar
2658
2659@c ???
2660@c The docstring says that font-lock-syntax-table is semi-obsolete.
2661@c How the alternative should be used is not clear. --lute
2662
2663@defvar font-lock-beginning-of-syntax-function
2664If this variable is non-@code{nil}, it should be a function to move
2665point back to a position that is syntactically at ``top level'' and
2666outside of strings or comments. Font Lock uses this when necessary
2667to get the right results for syntactic fontification.
2668
2669This function is called with no arguments. It should leave point at
2670the beginning of any enclosing syntactic block. Typical values are
2671@code{beginning-of-line} (used when the start of the line is known to
2672be outside a syntactic block), or @code{beginning-of-defun} for
2673programming modes, or @code{backward-paragraph} for textual modes.
2674
2675If the value is @code{nil}, the beginning of the buffer is used as a
2676position outside of a syntactic block. This cannot be wrong, but it
2677can be slow.
2678
2679Specify this variable using @var{syntax-begin} in
2680@code{font-lock-defaults}.
2681@end defvar
2682
2683@defvar font-lock-syntactic-face-function
2684A function to determine which face to use for a given syntactic
2685element (a string or a comment). The function is called with one
2686argument, the parse state at point returned by
2687@code{parse-partial-sexp}, and should return a face. The default
2688value returns @code{font-lock-comment-face} for comments and
2689@code{font-lock-string-face} for strings.
2690
2691This can be used to highlighting different kinds of strings or
2692comments differently. It is also sometimes abused together with
2693@code{font-lock-syntactic-keywords} to highlight elements that span
2694multiple lines, but this is too obscure to document in this manual.
2695
2696Specify this variable using @var{other-vars} in
2697@code{font-lock-defaults}.
2698@end defvar
2699
2700@node Setting Syntax Properties
2701@subsection Setting Syntax Properties
2702
2532 Font Lock mode can be used to update @code{syntax-table} properties 2703 Font Lock mode can be used to update @code{syntax-table} properties
2533automatically. This is useful in languages for which a single syntax 2704automatically (@pxref{Syntax Properties}). This is useful in
2534table by itself is not sufficient. 2705languages for which a single syntax table by itself is not sufficient.
2535 2706
2536@defvar font-lock-syntactic-keywords 2707@defvar font-lock-syntactic-keywords
2537This variable enables and controls syntactic Font Lock. It is 2708This variable enables and controls updating @code{syntax-table}
2538normally set via @code{font-lock-defaults}. Its value should be a 2709properties by Font Lock. Its value should be a list of elements of
2539list of elements of this form: 2710this form:
2540 2711
2541@example 2712@example
2542(@var{matcher} @var{subexp} @var{syntax} @var{override} @var{laxmatch}) 2713(@var{matcher} @var{subexp} @var{syntax} @var{override} @var{laxmatch})
@@ -2546,10 +2717,10 @@ The parts of this element have the same meanings as in the corresponding
2546sort of element of @code{font-lock-keywords}, 2717sort of element of @code{font-lock-keywords},
2547 2718
2548@example 2719@example
2549(@var{matcher} @var{subexp} @var{facename} @var{override} @var{laxmatch}) 2720(@var{matcher} @var{subexp} @var{facespec} @var{override} @var{laxmatch})
2550@end example 2721@end example
2551 2722
2552However, instead of specifying the value @var{facename} to use for the 2723However, instead of specifying the value @var{facespec} to use for the
2553@code{face} property, it specifies the value @var{syntax} to use for 2724@code{face} property, it specifies the value @var{syntax} to use for
2554the @code{syntax-table} property. Here, @var{syntax} can be a string 2725the @code{syntax-table} property. Here, @var{syntax} can be a string
2555(as taken by @code{modify-syntax-entry}), a syntax table, a cons cell 2726(as taken by @code{modify-syntax-entry}), a syntax table, a cons cell
@@ -2586,6 +2757,8 @@ the form @samp{'@var{c}'} as strings syntactically. Other forms, such
2586as @samp{foo'bar} or @samp{'fubar'}, will not be highlighted as 2757as @samp{foo'bar} or @samp{'fubar'}, will not be highlighted as
2587strings. 2758strings.
2588 2759
2760Major modes normally set this variable with @var{other-vars} in
2761@code{font-lock-defaults}.
2589@end defvar 2762@end defvar
2590 2763
2591@node Desktop Save Mode 2764@node Desktop Save Mode
diff --git a/lispref/symbols.texi b/lispref/symbols.texi
index 2c81cb9493c..9f59ad1f02d 100644
--- a/lispref/symbols.texi
+++ b/lispref/symbols.texi
@@ -496,8 +496,6 @@ This function finds the value of the property named @var{property} in
496@var{symbol}'s property list. If there is no such property, @code{nil} 496@var{symbol}'s property list. If there is no such property, @code{nil}
497is returned. Thus, there is no distinction between a value of 497is returned. Thus, there is no distinction between a value of
498@code{nil} and the absence of the property. 498@code{nil} and the absence of the property.
499A @code{wrong-type-argument} error may be signaled if @var{symbol}
500has a malformed property list.
501 499
502The name @var{property} is compared with the existing property names 500The name @var{property} is compared with the existing property names
503using @code{eq}, so any object is a legitimate property. 501using @code{eq}, so any object is a legitimate property.
@@ -505,12 +503,6 @@ using @code{eq}, so any object is a legitimate property.
505See @code{put} for an example. 503See @code{put} for an example.
506@end defun 504@end defun
507 505
508@defun safe-get symbol property
509This function finds the value of the property named @var{property} in
510@var{symbol}'s property list. Unlike @code{get}, it just returns
511@code{nil} if @var{symbol} has a malformed property list.
512@end defun
513
514@defun put symbol property value 506@defun put symbol property value
515This function puts @var{value} onto @var{symbol}'s property list under 507This function puts @var{value} onto @var{symbol}'s property list under
516the property name @var{property}, replacing any previous property value. 508the property name @var{property}, replacing any previous property value.
@@ -536,9 +528,7 @@ that are stored in places other than symbols:
536 528
537@defun plist-get plist property 529@defun plist-get plist property
538This returns the value of the @var{property} property 530This returns the value of the @var{property} property
539stored in the property list @var{plist}. 531stored in the property list @var{plist}. For example,
540A @code{wrong-type-argument} error may be signaled if @var{plist} is
541not a valid property list. For example,
542 532
543@example 533@example
544(plist-get '(foo 4) 'foo) 534(plist-get '(foo 4) 'foo)
@@ -548,16 +538,12 @@ not a valid property list. For example,
548(plist-get '(foo 4 bad) 'bar) 538(plist-get '(foo 4 bad) 'bar)
549 @result{} @code{wrong-type-argument} error 539 @result{} @code{wrong-type-argument} error
550@end example 540@end example
551@end defun
552 541
553@defun safe-plist-get plist property 542It accepts a malformed @var{plist} argument and always returns @code{nil}
554This returns the value of the @var{property} property
555stored in the property list @var{plist}. Unlike @code{plist-get}, it
556accepts a malformed @var{plist} argument and always returns @code{nil}
557if @var{property} is not found in the @var{plist}. For example, 543if @var{property} is not found in the @var{plist}. For example,
558 544
559@example 545@example
560(safe-plist-get '(foo 4 bad) 'bar) 546(plist-get '(foo 4 bad) 'bar)
561 @result{} nil 547 @result{} nil
562@end example 548@end example
563@end defun 549@end defun
diff --git a/lispref/syntax.texi b/lispref/syntax.texi
index 7aa78aebf01..a9df79e9f57 100644
--- a/lispref/syntax.texi
+++ b/lispref/syntax.texi
@@ -528,10 +528,12 @@ execution starts. Other buffers are not affected.
528@section Syntax Properties 528@section Syntax Properties
529@kindex syntax-table @r{(text property)} 529@kindex syntax-table @r{(text property)}
530 530
531When the syntax table is not flexible enough to specify the syntax of a 531When the syntax table is not flexible enough to specify the syntax of
532language, you can use @code{syntax-table} text properties to override 532a language, you can use @code{syntax-table} text properties to
533the syntax table for specific character occurrences in the buffer. 533override the syntax table for specific character occurrences in the
534@xref{Text Properties}. 534buffer. @xref{Text Properties}. You can use Font Lock mode to set
535@code{syntax-table} text properties. @xref{Setting Syntax
536Properties}.
535 537
536The valid values of @code{syntax-table} text property are: 538The valid values of @code{syntax-table} text property are:
537 539
@@ -940,11 +942,25 @@ This function returns the internal form @code{(@var{syntax-code} .
940@defun syntax-after pos 942@defun syntax-after pos
941This function returns the syntax code of the character in the buffer 943This function returns the syntax code of the character in the buffer
942after position @var{pos}, taking account of syntax properties as well 944after position @var{pos}, taking account of syntax properties as well
943as the syntax table. 945as the syntax table. If @var{pos} is outside the buffer's accessible
946portion (@pxref{Narrowing, accessible portion}), this function returns
947@code{nil}.
944@end defun 948@end defun
945 949
946@defun syntax-class syntax 950@defun syntax-class syntax
947This function returns the syntax class of a syntax code. 951This function returns the syntax class of the syntax code
952@var{syntax}. (It masks off the high 16 bits that hold the flags
953encoded in the syntax descriptor.) If @var{syntax} is @code{nil}, it
954returns @code{nil}; this is so evaluating the expression
955
956@example
957(syntax-class (syntax-after pos))
958@end example
959
960@noindent
961where @code{pos} is outside the buffer's accessible portion, will
962yield @code{nil} without throwing errors or producing wrong syntax
963class codes.
948@end defun 964@end defun
949 965
950@node Categories 966@node Categories
diff --git a/lispref/variables.texi b/lispref/variables.texi
index de5fb40618f..8b34f4bb9aa 100644
--- a/lispref/variables.texi
+++ b/lispref/variables.texi
@@ -1714,6 +1714,38 @@ of the variable at the end of the chain of aliases.
1714This function returns @var{base-var}. 1714This function returns @var{base-var}.
1715@end defun 1715@end defun
1716 1716
1717 Variable aliases are convenient for replacing an old name for a
1718variable with a new name. @code{make-obsolete-variable} declares that
1719the old name is obsolete and therefore that it may be removed at some
1720stage in the future.
1721
1722@defun make-obsolete-variable variable new &optional when
1723This function makes the byte-compiler warn that the variable
1724@var{variable} is obsolete. If @var{new} is a symbol, it is the
1725variable's new name; then the warning message says to use @var{new}
1726instead of @var{variable}. If @var{new} is a string, this is the
1727message and there is no replacement variable.
1728
1729If provided, @var{when} should be a string indicating when the
1730variable was first made obsolete---for example, a date or a release
1731number.
1732@end defun
1733
1734 You can make two variables synonyms and declare one obsolete at the
1735same time using the macro @code{define-obsolete-variable-alias}.
1736
1737@defmac define-obsolete-variable-alias variable new &optional when docstring
1738This macro marks the variable @var{variable} as obsolete and also
1739makes it an alias for the variable @var{new}.
1740
1741If provided, @var{when} should be a string indicating when
1742@var{variable} was first made obsolete. The optional argument
1743@var{docstring} specifies the documentation string for @var{variable}.
1744If @var{docstring} is omitted or nil, @var{variable} uses the
1745documentation string of @var{new} unless it already has one of its
1746own.
1747@end defmac
1748
1717@defun indirect-variable variable 1749@defun indirect-variable variable
1718This function returns the variable at the end of the chain of aliases 1750This function returns the variable at the end of the chain of aliases
1719of @var{variable}. If @var{variable} is not a symbol, or if @var{variable} is 1751of @var{variable}. If @var{variable} is not a symbol, or if @var{variable} is
diff --git a/lispref/windows.texi b/lispref/windows.texi
index 042ede6ed4c..d9ecf5db7eb 100644
--- a/lispref/windows.texi
+++ b/lispref/windows.texi
@@ -665,17 +665,16 @@ for details.
665 665
666@defun window-list &optional frame minibuf window 666@defun window-list &optional frame minibuf window
667This function returns a list of the windows on @var{frame}, starting 667This function returns a list of the windows on @var{frame}, starting
668with @var{window}. If @var{frame} is @code{nil} or omitted, the 668with @var{window}. If @var{frame} is @code{nil} or omitted,
669selected frame is used instead; if @var{window} is @code{nil} or 669@code{window-list} uses the selected frame instead; if @var{window} is
670omitted, the selected window is used instead. 670@code{nil} or omitted, it uses the selected window.
671 671
672The value of @var{minibuf} determines if the minibuffer window will be 672The value of @var{minibuf} determines if the minibuffer window is
673included in the result list. If @var{minibuf} is @code{t}, the 673included in the result list. If @var{minibuf} is @code{t}, the result
674minibuffer window will be included, even if it isn't active. If 674always includes the minibuffer window. If @var{minibuf} is @code{nil}
675@var{minibuf} is @code{nil} or omitted, the minibuffer window will 675or omitted, that includes the minibuffer window if it is active. If
676only be included in the list if it is active. If @var{minibuf} is 676@var{minibuf} is neither @code{nil} nor @code{t}, the result never
677neither @code{nil} nor @code{t}, the minibuffer window is not 677includes the minibuffer window.
678included, whether or not it is active.
679@end defun 678@end defun
680 679
681@node Buffers and Windows 680@node Buffers and Windows
@@ -2289,8 +2288,7 @@ window displays a different part of its buffer or a different buffer.
2289There are three actions that can change this: scrolling the window, 2288There are three actions that can change this: scrolling the window,
2290switching buffers in the window, and changing the size of the window. 2289switching buffers in the window, and changing the size of the window.
2291The first two actions run @code{window-scroll-functions}; the last runs 2290The first two actions run @code{window-scroll-functions}; the last runs
2292@code{window-size-change-functions}. The paradigmatic use of these 2291@code{window-size-change-functions}.
2293hooks is in the implementation of Lazy Lock mode; see @file{lazy-lock.el}.
2294 2292
2295@defvar window-scroll-functions 2293@defvar window-scroll-functions
2296This variable holds a list of functions that Emacs should call before 2294This variable holds a list of functions that Emacs should call before
diff --git a/mac/ChangeLog b/mac/ChangeLog
index 4d3dba217d3..27cd5d98be9 100644
--- a/mac/ChangeLog
+++ b/mac/ChangeLog
@@ -1,3 +1,13 @@
12005-04-24 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2
3 * makefile.MPW (MacObjects): Add macselect.c.x.
4 (macselect.c.x): New target.
5 (mac.c): Fix dependency.
6
7 * Emacs.app/Contents/Info.plist: Add NSServices key and data.
8
9 * inc/s-mac.h: Define HAVE_PWD_H.
10
12005-04-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 112005-04-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2 12
3 * makefile.MPW (NonCarbonLibs): Add LocalesLib. Delete 13 * makefile.MPW (NonCarbonLibs): Add LocalesLib. Delete
diff --git a/mac/Emacs.app/Contents/Info.plist b/mac/Emacs.app/Contents/Info.plist
index afcf6cc3423..7f79e8f6ab0 100644
--- a/mac/Emacs.app/Contents/Info.plist
+++ b/mac/Emacs.app/Contents/Info.plist
@@ -35,5 +35,46 @@
35 <string>EMAx</string> 35 <string>EMAx</string>
36 <key>CFBundleVersion</key> 36 <key>CFBundleVersion</key>
37 <string>1.1</string> 37 <string>1.1</string>
38 <key>NSServices</key>
39 <array>
40 <dict>
41 <key>NSKeyEquivalent</key>
42 <dict/>
43 <key>NSMenuItem</key>
44 <dict>
45 <key>default</key>
46 <string>Emacs/Open Selected File</string>
47 </dict>
48 <key>NSMessage</key>
49 <string>open-file</string>
50 <key>NSPortName</key>
51 <string>Emacs</string>
52 <key>NSReturnTypes</key>
53 <array/>
54 <key>NSSendTypes</key>
55 <array>
56 <string>NSStringPboardType</string>
57 </array>
58 </dict>
59 <dict>
60 <key>NSKeyEquivalent</key>
61 <dict/>
62 <key>NSMenuItem</key>
63 <dict>
64 <key>default</key>
65 <string>Emacs/New Buffer Containing Selection</string>
66 </dict>
67 <key>NSMessage</key>
68 <string>open-selection</string>
69 <key>NSPortName</key>
70 <string>Emacs</string>
71 <key>NSReturnTypes</key>
72 <array/>
73 <key>NSSendTypes</key>
74 <array>
75 <string>NSStringPboardType</string>
76 </array>
77 </dict>
78 </array>
38</dict> 79</dict>
39</plist> 80</plist>
diff --git a/mac/inc/s-mac.h b/mac/inc/s-mac.h
index a9108a67ca5..56f4df5941c 100644
--- a/mac/inc/s-mac.h
+++ b/mac/inc/s-mac.h
@@ -96,6 +96,8 @@ Boston, MA 02111-1307, USA. */
96 96
97/* #define HAVE_PTYS */ 97/* #define HAVE_PTYS */
98 98
99#define HAVE_PWD_H 1
100
99/* 101/*
100 * Define NONSYSTEM_DIR_LIBRARY to make Emacs emulate 102 * Define NONSYSTEM_DIR_LIBRARY to make Emacs emulate
101 * The 4.2 opendir, etc., library functions. 103 * The 4.2 opendir, etc., library functions.
diff --git a/mac/makefile.MPW b/mac/makefile.MPW
index 02ead320649..e7c7e438973 100644
--- a/mac/makefile.MPW
+++ b/mac/makefile.MPW
@@ -133,6 +133,7 @@ MacObjects = ¶
133 "{Src}mac.c.x" ¶ 133 "{Src}mac.c.x" ¶
134 "{Src}macfns.c.x" ¶ 134 "{Src}macfns.c.x" ¶
135 "{Src}macmenu.c.x" ¶ 135 "{Src}macmenu.c.x" ¶
136 "{Src}macselect.c.x" ¶
136 "{Src}macterm.c.x" 137 "{Src}macterm.c.x"
137 138
138StdLibraries = ¶ 139StdLibraries = ¶
@@ -881,6 +882,14 @@ NonCarbon Ä
881 "{Includes}sys:types.h" ¶ 882 "{Includes}sys:types.h" ¶
882 {DISPEXTERN_H_GROUP} 883 {DISPEXTERN_H_GROUP}
883 884
885{Src}macselect.c.x Ä ¶
886 {CONFIG_H_GROUP} ¶
887 "{Src}lisp.h" ¶
888 "{Src}macterm.h" ¶
889 "{Src}macgui.h" ¶
890 "{Src}frame.h" ¶
891 {BLOCKINPUT_H_GROUP}
892
884{Src}mac.c Ä ¶ 893{Src}mac.c Ä ¶
885 {CONFIG_H_GROUP} ¶ 894 {CONFIG_H_GROUP} ¶
886 "{Includes}utime.h" ¶ 895 "{Includes}utime.h" ¶
@@ -895,7 +904,14 @@ NonCarbon Ä
895 "{Src}sysselect.h" ¶ 904 "{Src}sysselect.h" ¶
896 "{Src}systime.h" ¶ 905 "{Src}systime.h" ¶
897 "{Includes}sys:time.h" ¶ 906 "{Includes}sys:time.h" ¶
898 "{Includes}utsname.h" 907 "{Includes}utsname.h" ¶
908 "{Src}macterm.h" ¶
909 "{Src}macgui.h" ¶
910 "{Src}frame.h" ¶
911 {BLOCKINPUT_H_GROUP} ¶
912 "{Src}charset.h" ¶
913 "{Src}coding.h" ¶
914 "{Src}ccl.h"
899 915
900{Src}macfns.c Ä ¶ 916{Src}macfns.c Ä ¶
901 {CONFIG_H_GROUP} ¶ 917 {CONFIG_H_GROUP} ¶
diff --git a/man/ChangeLog b/man/ChangeLog
index bda82361828..553256ddd56 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,61 @@
12005-04-30 Richard M. Stallman <rms@gnu.org>
2
3 * files.texi (Compressed Files): Auto Compression normally enabled.
4
5 * building.texi (Debugger Operation): Clarify previous change.
6
72005-04-29 Carsten Dominik <dominik@science.uva.nl>
8
9 * org.texi: Version 3.08, structure reorganized.
10
112005-04-28 Nick Roberts <nickrob@snap.net.nz>
12
13 * building.texi (Debugger Operation): Add description for
14 GUD tooltips when program is not running.
15
162005-04-26 Luc Teirlinck <teirllm@auburn.edu>
17
18 * misc.texi (Shell): Add `Shell Prompts' to menu.
19 (Shell Mode): Add xref to `Shell Prompts'. Clarify `C-c C-u'
20 description. Delete remarks moved to new node.
21 (Shell Prompts): New node.
22 (History References): Replace remarks moved to `Shell Prompts'
23 with xref to that node.
24 (Remote Host): Clarify how to specify the terminal type when
25 logging in to a different machine.
26
272005-04-26 Richard M. Stallman <rms@gnu.org>
28
29 * emacs.texi (Top): Update submenus from files.texi.
30
31 * files.texi (Filesets): Clarify previous change.
32
33 * dired.texi (Misc Dired Features): Clarify previous change.
34
352005-04-25 Chong Yidong <cyd@stupidchicken.com>
36
37 * ack.texi (Acknowledgments): Delete info about iso-acc.el
38
39 * dired.texi (Misc Dired Features): Document
40 dired-compare-directories.
41
42 * files.texi (Filesets): New node.
43 (File Conveniences): Document Image mode.
44
45 * text.texi (TeX Print): Document tex-compile.
46
472005-04-25 Luc Teirlinck <teirllm@auburn.edu>
48
49 * frames.texi (Tooltips): Tooltip mode is enabled by default.
50 Delete redundant reference to tooltip Custom group. It is
51 referred too again in the next paragraph.
52
532005-04-24 Richard M. Stallman <rms@gnu.org>
54
55 * ack.texi: Delete info about lazy-lock.el and fast-lock.el.
56
57 * faq.texi: Delete info about lazy-lock.el and fast-lock.el.
58
12005-04-19 Kim F. Storm <storm@cua.dk> 592005-04-19 Kim F. Storm <storm@cua.dk>
2 60
3 * building.texi (Compilation Mode): Add M-g M-n and M-g M-p bindings. 61 * building.texi (Compilation Mode): Add M-g M-n and M-g M-p bindings.
diff --git a/man/ack.texi b/man/ack.texi
index 5920bd197ef..5d9b26be7c1 100644
--- a/man/ack.texi
+++ b/man/ack.texi
@@ -696,21 +696,9 @@ Brian Marick and Daniel LaLiberte wrote @file{hideif.el}, support for
696hiding selected code within C @code{#ifdef} clauses. 696hiding selected code within C @code{#ifdef} clauses.
697 697
698@item 698@item
699Simon Marshall wrote: 699Simon Marshall wrote @file{regexp-opt.el}, which generates a regular
700 700expression from a list of strings. He also extended @file{comint.el},
701@itemize @minus 701originally written by Olin Shivers.
702@item
703@file{fast-lock.el}, which caches the face data computed by Font Lock mode,
704@item
705@file{lazy-lock.el}, which delays fontification in Font Lock mode
706until text is actually displayed, and
707@item
708@file{regexp-opt.el}, which generates a regular expression from a list
709of strings.
710@end itemize
711
712Simon also extended @file{comint.el}, originally written by Olin
713Shivers.
714 702
715@item 703@item
716Bengt Martensson, Mark Shapiro, Mike Newton, Aaron Larson, and Stefan 704Bengt Martensson, Mark Shapiro, Mike Newton, Aaron Larson, and Stefan
@@ -1324,9 +1312,8 @@ Geoffrey Voelker wrote the Windows NT support. He also wrote
1324of Emacs, and @file{w32-fns.el}, MS-Windows specific support functions. 1312of Emacs, and @file{w32-fns.el}, MS-Windows specific support functions.
1325 1313
1326@item 1314@item
1327Johan Vromans wrote @file{forms.el} and its associated files, defining a 1315Johan Vromans wrote @file{forms.el} and its associated files, a
1328mode for filling in forms, and @file{iso-acc.el}, a minor mode providing 1316mode for filling in forms.
1329electric accent keys for text using the ISO-8859 character set.
1330 1317
1331@item 1318@item
1332Colin Walters wrote @file{ibuffer.el}, a Dired-like major mode for 1319Colin Walters wrote @file{ibuffer.el}, a Dired-like major mode for
diff --git a/man/building.texi b/man/building.texi
index 408d0eb339a..2fdfd1a72a3 100644
--- a/man/building.texi
+++ b/man/building.texi
@@ -496,8 +496,10 @@ history commands to repeat them. @xref{Shell Mode}.
496You activate this feature by setting the variable 496You activate this feature by setting the variable
497@code{tooltip-gud-tips-p} to @code{t}. Then you can display a 497@code{tooltip-gud-tips-p} to @code{t}. Then you can display a
498variable's value in a tooltip simply by pointing at it with the mouse. 498variable's value in a tooltip simply by pointing at it with the mouse.
499This operates in the GUD buffer and in source buffers with major modes 499In graphical mode, with a C program, you can also display the
500in the list @code{tooltip-gud-modes}. 500@code{#define} directive associated with an identifier when program is
501not executing. This operates in the GUD buffer and in source buffers
502with major modes in the list @code{tooltip-gud-modes}.
501 503
502@node Commands of GUD 504@node Commands of GUD
503@subsection Commands of GUD 505@subsection Commands of GUD
@@ -907,7 +909,7 @@ current frame for simple data types (@pxref{Frame Info,,, gdb, The GNU
907debugger}). 909debugger}).
908 910
909Arrays and structures display their type only. You must display them 911Arrays and structures display their type only. You must display them
910separately to examine their values. @ref{Watch Expressions}. 912separately to examine their values. @xref{Watch Expressions}.
911 913
912@item Registers Buffer 914@item Registers Buffer
913The registers buffer displays the values held by the registers 915The registers buffer displays the values held by the registers
diff --git a/man/dired.texi b/man/dired.texi
index dfd809c7607..f2699cfde07 100644
--- a/man/dired.texi
+++ b/man/dired.texi
@@ -1161,6 +1161,32 @@ if in a subdirectory.) As a special case, if point is on a directory
1161headerline, @kbd{w} gives you the absolute name of that directory. 1161headerline, @kbd{w} gives you the absolute name of that directory.
1162Any prefix argument or marked files are ignored in this case. 1162Any prefix argument or marked files are ignored in this case.
1163 1163
1164@findex dired-compare-directories
1165 The command @kbd{M-x dired-compare-directories} is used to compare
1166the current Dired buffer with another directory. It marks all the files
1167that are ``different'' between the two directories. It puts these marks
1168in all Dired buffers where these files are listed, which of course includes
1169the current buffer.
1170
1171 The default comparison method (used if you type @key{RET} at the
1172prompt) is to compare just the file names---each file name that does
1173not appear in the other directory is ``different''. You can specify
1174more stringent comparisons by entering a Lisp expression, which can
1175refer to the variables @code{size1} and @code{size2}, the respective
1176file sizes; @code{mtime1} and @code{mtime2}, the last modification
1177times in seconds, as floating point numers; and @code{fa1} and
1178@code{fa2}, the respective file attribute lists (as returned by the
1179function @code{file-attributes}). This expression is evaluated for
1180each pair of like-named files, and if the expression's value is
1181non-@code{nil}, those files are considered ``different''.
1182
1183 For instance, @code{M-x dired-compare-directories @key{RET} (>
1184mtime1 mtime2) @key{RET}} marks files newer in this directory than in
1185the other, and marks files older in the other directory than in this
1186one. It also marks files with no counterpart, in both directories, as
1187always.
1188
1189@cindex drag and drop, Dired
1164 On the X window system, Emacs supports the ``drag and drop'' 1190 On the X window system, Emacs supports the ``drag and drop''
1165protocol. You can drag a file object from another program, and drop 1191protocol. You can drag a file object from another program, and drop
1166it onto a Dired buffer; this either moves, copies, or creates a link 1192it onto a Dired buffer; this either moves, copies, or creates a link
diff --git a/man/emacs.texi b/man/emacs.texi
index 0ad3a5148c9..120e2648526 100644
--- a/man/emacs.texi
+++ b/man/emacs.texi
@@ -370,23 +370,31 @@ File Handling
370* Comparing Files:: Finding where two files differ. 370* Comparing Files:: Finding where two files differ.
371* Misc File Ops:: Other things you can do on files. 371* Misc File Ops:: Other things you can do on files.
372* Compressed Files:: Accessing compressed files. 372* Compressed Files:: Accessing compressed files.
373* File Archives:: Operating on tar, zip, jar etc. archive files.
373* Remote Files:: Accessing files on other sites. 374* Remote Files:: Accessing files on other sites.
374* Quoted File Names:: Quoting special characters in file names. 375* Quoted File Names:: Quoting special characters in file names.
376* File Name Cache:: Completion against a list of files you often use.
377* File Conveniences:: Convenience Features for Finding Files.
378* Filesets:: Handling sets of files.
375 379
376Saving Files 380Saving Files
377 381
378* Backup:: How Emacs saves the old version of your file. 382* Backup:: How Emacs saves the old version of your file.
379* Interlocking:: How Emacs protects against simultaneous editing 383* Interlocking:: How Emacs protects against simultaneous editing
380 of one file by two users. 384 of one file by two users.
385* Shadowing: File Shadowing.
386 Copying files to "shadows" automatically.
387* Time Stamps:: Emacs can update time stamps on saved files.
381 388
382Version Control 389Version Control
383 390
384* Introduction to VC:: How version control works in general. 391* Introduction to VC:: How version control works in general.
385* VC Mode Line:: How the mode line shows version control status. 392* VC Mode Line:: How the mode line shows version control status.
386* Basic VC Editing:: How to edit a file under version control. 393* Basic VC Editing:: How to edit a file under version control.
387* Old Versions:: Examining and comparing old versions. 394* Old Versions:: Examining and comparing old versions.
388* Secondary VC Commands:: The commands used a little less frequently. 395* Secondary VC Commands:: The commands used a little less frequently.
389* Branches:: Multiple lines of development. 396* Branches:: Multiple lines of development.
397* Remote Repositories:: Efficient access to remote CVS servers.
390* Snapshots:: Sets of file versions treated as a unit. 398* Snapshots:: Sets of file versions treated as a unit.
391* Miscellaneous VC:: Various other commands and features of VC. 399* Miscellaneous VC:: Various other commands and features of VC.
392* Customizing VC:: Variables that change VC's behavior. 400* Customizing VC:: Variables that change VC's behavior.
diff --git a/man/faq.texi b/man/faq.texi
index dc55c4b89b3..641f1f5b307 100644
--- a/man/faq.texi
+++ b/man/faq.texi
@@ -2549,17 +2549,6 @@ information, see the documentation for
2549@code{font-lock-maximum-decoration} with @kbd{C-h v} (or @kbd{M-x 2549@code{font-lock-maximum-decoration} with @kbd{C-h v} (or @kbd{M-x
2550describe-variable @key{RET}}). 2550describe-variable @key{RET}}).
2551 2551
2552@cindex Lazy font-lock
2553You might also want to investigate @code{fast-lock-mode} and
2554@code{lazy-lock-mode}, versions of @code{font-lock-mode} that speed up
2555highlighting. These are the alternatives for @code{jit-lock-mode} in
2556versions of Emacs before 21.1. The advantage of @code{lazy-lock-mode}
2557is that it only fontifies buffers when certain conditions are met, such
2558as after a certain amount of idle time, or after you have finished
2559scrolling through text. See the documentation for @code{lazy-lock-mode}
2560by typing @kbd{C-h f @code{lazy-lock-mode}} (@kbd{M-x describe-function
2561@key{RET} lazy-lock-mode @key{RET}}).
2562
2563Also see the documentation for the function @code{font-lock-mode}, 2552Also see the documentation for the function @code{font-lock-mode},
2564available by typing @kbd{C-h f font-lock-mode} (@kbd{M-x 2553available by typing @kbd{C-h f font-lock-mode} (@kbd{M-x
2565describe-function @key{RET} font-lock-mode @key{RET}}). 2554describe-function @key{RET} font-lock-mode @key{RET}}).
diff --git a/man/files.texi b/man/files.texi
index a03bb2a64ea..d7510862465 100644
--- a/man/files.texi
+++ b/man/files.texi
@@ -37,6 +37,7 @@ on file directories.
37* Quoted File Names:: Quoting special characters in file names. 37* Quoted File Names:: Quoting special characters in file names.
38* File Name Cache:: Completion against a list of files you often use. 38* File Name Cache:: Completion against a list of files you often use.
39* File Conveniences:: Convenience Features for Finding Files. 39* File Conveniences:: Convenience Features for Finding Files.
40* Filesets:: Handling sets of files.
40@end menu 41@end menu
41 42
42@node File Names 43@node File Names
@@ -3029,17 +3030,10 @@ support them, this command is not defined.
3029@cindex mode, Auto Compression 3030@cindex mode, Auto Compression
3030@pindex gzip 3031@pindex gzip
3031 3032
3032@findex auto-compression-mode 3033 Emacs automatically uncompresses compressed files when you visit
3033@vindex auto-compression-mode 3034them, and automatically recompress them if you alter them and save
3034 Emacs comes with a library that can automatically uncompress 3035them. Emacs recognizes compressed files by their file names. File
3035compressed files when you visit them, and automatically recompress them 3036names ending in @samp{.gz} indicate a file compressed with
3036if you alter them and save them. To enable this feature, type the
3037command @kbd{M-x auto-compression-mode}. You can enable it permanently
3038by customizing the variable @code{auto-compression-mode}.
3039
3040 When automatic compression (which implies automatic uncompression as
3041well) is enabled, Emacs recognizes compressed files by their file names.
3042File names ending in @samp{.gz} indicate a file compressed with
3043@code{gzip}. Other endings indicate other compression programs. 3037@code{gzip}. Other endings indicate other compression programs.
3044 3038
3045 Automatic uncompression and compression apply to all the operations in 3039 Automatic uncompression and compression apply to all the operations in
@@ -3047,6 +3041,12 @@ which Emacs uses the contents of a file. This includes visiting it,
3047saving it, inserting its contents into a buffer, loading it, and byte 3041saving it, inserting its contents into a buffer, loading it, and byte
3048compiling it. 3042compiling it.
3049 3043
3044@findex auto-compression-mode
3045@vindex auto-compression-mode
3046 To disable this feature, type the command @kbd{M-x
3047auto-compression-mode}. You can disenable it permanently by
3048customizing the variable @code{auto-compression-mode}.
3049
3050@node File Archives 3050@node File Archives
3051@section File Archives 3051@section File Archives
3052@cindex mode, tar 3052@cindex mode, tar
@@ -3325,6 +3325,15 @@ point. Partial Completion mode offers other features extending
3325@code{find-file}, which can be used with @code{ffap}. 3325@code{find-file}, which can be used with @code{ffap}.
3326@xref{Completion Options}. 3326@xref{Completion Options}.
3327 3327
3328@findex image-mode
3329@findex image-toggle-display
3330@cindex images, viewing
3331 Visiting image files automatically selects Image mode. This major
3332mode allows you to toggle between displaying the file as an image in
3333the Emacs buffer, and displaying its underlying text representation,
3334using the command @kbd{C-c C-c} (@code{image-toggle-display}). This
3335works only when Emacs can display the specific image type.
3336
3328@findex thumbs-mode 3337@findex thumbs-mode
3329@findex mode, thumbs 3338@findex mode, thumbs
3330 Thumbs mode is a major mode for viewing directories containing many 3339 Thumbs mode is a major mode for viewing directories containing many
@@ -3335,6 +3344,43 @@ thumbnail to view the full-size image. Thumbs mode requires the
3335@file{convert} program, which is part of the ImageMagick software 3344@file{convert} program, which is part of the ImageMagick software
3336package. 3345package.
3337 3346
3347@node Filesets
3348@section Filesets
3349@cindex filesets
3350
3351@findex filesets-init
3352 If you regularly edit a certain group of files, you can define them
3353as a @dfn{fileset}. This lets you perform certain operations, such as
3354visiting, @code{query-replace}, and shell commands on all the files
3355at once. To make use of filesets, you must first add the expression
3356@code{(filesets-init)} to your @file{.emacs} file (@pxref{Init File}).
3357This adds a @samp{Filesets} menu to the menu bar.
3358
3359@findex filesets-add-buffer
3360@findex filesets-remove-buffer
3361 The simplest way to define filesets is by adding files to them one
3362at a time. To add a file to fileset @var{name}, visit the file and
3363type @kbd{M-x filesets-add-buffer @kbd{RET} @var{name} @kbd{RET}}. If
3364there is no fileset @var{name}, this creates a new one, which
3365initially creates only the current file. The command @kbd{M-x
3366filesets-remove-buffer} removes the current file from a fileset.
3367
3368 You can also edit the list of filesets directly, with @kbd{M-x
3369filesets-edit} (or by choosing @samp{Edit Filesets} from the
3370@samp{Filesets} menu). The editing is performed in a Customize buffer
3371(@pxref{Easy Customization}). Filesets need not be a simple list of
3372files---you can also define filesets using regular expression matching
3373file names. Some examples of these more complicated filesets are
3374shown in the Customize buffer. Remember to select @samp{Save for
3375future sessions} if you want to use the same filesets in future Emacs
3376sessions.
3377
3378 You can use the command @kbd{M-x filesets-open} to visit all the
3379files in a fileset, and @kbd{M-x filesets-close} to close them. Use
3380@kbd{M-x filesets-run-cmd} to run a shell command on all the files in
3381a fileset. These commands are also available from the @samp{Filesets}
3382menu, where each existing fileset is represented by a submenu.
3383
3338@ignore 3384@ignore
3339 arch-tag: 768d32cb-e15a-4cc1-b7bf-62c00ee12250 3385 arch-tag: 768d32cb-e15a-4cc1-b7bf-62c00ee12250
3340@end ignore 3386@end ignore
diff --git a/man/frames.texi b/man/frames.texi
index af91cced8ce..f95d65a85fa 100644
--- a/man/frames.texi
+++ b/man/frames.texi
@@ -973,10 +973,9 @@ sometimes known as @dfn{balloon help}.) Help text may be available for
973menu items too. 973menu items too.
974 974
975@findex tooltip-mode 975@findex tooltip-mode
976 To use tooltips, enable Tooltip mode with the command @kbd{M-x 976 You can toggle Tooltip mode with the command @kbd{M-x tooltip-mode}.
977tooltip-mode}. The customization group @code{tooltip} controls 977When Tooltip mode is disabled, the help text is displayed in the echo
978various aspects of how tooltips work. When Tooltip mode is disabled, 978area instead.
979the help text is displayed in the echo area instead.
980 979
981@vindex tooltip-delay 980@vindex tooltip-delay
982 The variables @code{tooltip-delay} specifies how long Emacs should 981 The variables @code{tooltip-delay} specifies how long Emacs should
diff --git a/man/misc.texi b/man/misc.texi
index f54bb3a79e2..d6471166cc4 100644
--- a/man/misc.texi
+++ b/man/misc.texi
@@ -342,6 +342,7 @@ Start the Emacs shell.
342* Single Shell:: How to run one shell command and return. 342* Single Shell:: How to run one shell command and return.
343* Interactive Shell:: Permanent shell taking input via Emacs. 343* Interactive Shell:: Permanent shell taking input via Emacs.
344* Shell Mode:: Special Emacs commands used with permanent shell. 344* Shell Mode:: Special Emacs commands used with permanent shell.
345* Shell Prompts:: Two ways to recognize shell prompts.
345* History: Shell History. Repeating previous commands in a shell buffer. 346* History: Shell History. Repeating previous commands in a shell buffer.
346* Directory Tracking:: Keeping track when the subshell changes directory. 347* Directory Tracking:: Keeping track when the subshell changes directory.
347* Options: Shell Options. Options for customizing Shell mode. 348* Options: Shell Options. Options for customizing Shell mode.
@@ -405,7 +406,7 @@ searched; this list is initialized based on the environment variable
405either or both of these default initializations.@refill 406either or both of these default initializations.@refill
406 407
407 Both @kbd{M-!} and @kbd{M-|} wait for the shell command to complete, 408 Both @kbd{M-!} and @kbd{M-|} wait for the shell command to complete,
408unless you end the command with @samp{&} to make it asyncronous. To 409unless you end the command with @samp{&} to make it asynchronous. To
409stop waiting, type @kbd{C-g} to quit; that terminates the shell 410stop waiting, type @kbd{C-g} to quit; that terminates the shell
410command with the signal @code{SIGINT}---the same signal that @kbd{C-c} 411command with the signal @code{SIGINT}---the same signal that @kbd{C-c}
411normally generates in the shell. Emacs waits until the command 412normally generates in the shell. Emacs waits until the command
@@ -506,8 +507,8 @@ of the special key bindings of Shell mode:
506At end of buffer send line as input; otherwise, copy current line to 507At end of buffer send line as input; otherwise, copy current line to
507end of buffer and send it (@code{comint-send-input}). When a line is 508end of buffer and send it (@code{comint-send-input}). When a line is
508copied, any prompt at the beginning of the line (text output by 509copied, any prompt at the beginning of the line (text output by
509programs preceding your input) is omitted. (See also the variable 510programs preceding your input) is omitted. @xref{Shell Prompts}, for
510@code{comint-use-prompt-regexp-instead-of-fields}.) 511how Shell mode recognizes prompts.
511 512
512@item @key{TAB} 513@item @key{TAB}
513@kindex TAB @r{(Shell mode)} 514@kindex TAB @r{(Shell mode)}
@@ -562,7 +563,8 @@ the newline that separates them), when you type @key{RET}.
562@kindex C-c C-u @r{(Shell mode)} 563@kindex C-c C-u @r{(Shell mode)}
563@findex comint-kill-input 564@findex comint-kill-input
564Kill all text pending at end of buffer to be sent as input 565Kill all text pending at end of buffer to be sent as input
565(@code{comint-kill-input}). 566(@code{comint-kill-input}). If point is not at end of buffer,
567this only kills the part of this text that precedes point.
566 568
567@item C-c C-w 569@item C-c C-w
568@kindex C-c C-w @r{(Shell mode)} 570@kindex C-c C-w @r{(Shell mode)}
@@ -684,10 +686,6 @@ subshell:
684@end example 686@end example
685@end table 687@end table
686 688
687 Shell mode also customizes the paragraph commands so that only shell
688prompts start new paragraphs. Thus, a paragraph consists of an input
689command plus the output that follows it in the buffer.
690
691@cindex Comint mode 689@cindex Comint mode
692@cindex mode, Comint 690@cindex mode, Comint
693 Shell mode is a derivative of Comint mode, a general-purpose mode for 691 Shell mode is a derivative of Comint mode, a general-purpose mode for
@@ -704,6 +702,45 @@ the directory tracking feature, and a few user commands.
704in a subprocess using unmodified Comint mode---without the 702in a subprocess using unmodified Comint mode---without the
705specializations of Shell mode. 703specializations of Shell mode.
706 704
705@node Shell Prompts
706@subsection Shell Prompts
707
708@vindex shell-prompt-pattern
709@vindex comint-prompt-regexp
710@vindex comint-use-prompt-regexp
711@cindex prompt, shell
712 A prompt is text output by a program to show that it is ready to
713accept new user input. Normally, Comint mode (and thus Shell mode)
714considers the prompt to be any text output by a program at the
715beginning of an input line. However, if the variable
716@code{comint-use-prompt-regexp} is non-@code{nil}, then Comint mode
717uses a regular expression to recognize prompts. In Shell mode,
718@code{shell-prompt-pattern} specifies the regular expression.
719
720 The value of @code{comint-use-prompt-regexp} also affects many
721motion and paragraph commands. If the value is non-@code{nil}, the
722general Emacs motion commands behave as they normally do in buffers
723without special text properties. However, if the value is @code{nil},
724the default, then Comint mode divides the buffer into two types of
725``fields'' (ranges of consecutive characters having the same
726@code{field} text property): input and output. Prompts are part of
727the output. Most Emacs motion commands do not cross field boundaries,
728unless they move over multiple lines. For instance, when point is in
729input on the same line as a prompt, @kbd{C-a} puts point at the
730beginning of the input if @code{comint-use-prompt-regexp} is
731@code{nil} and at the beginning of the line otherwise.
732
733 In Shell mode, only shell prompts start new paragraphs. Thus, a
734paragraph consists of a prompt and the input and output that follow
735it. However, if @code{comint-use-prompt-regexp} is @code{nil}, the
736default, most paragraph commands do not cross field boundaries. This
737means that prompts, ranges of input, and ranges of non-prompt output
738behave mostly like separate paragraphs; with this setting, numeric
739arguments to most paragraph commands yield essentially undefined
740behavior. For the purpose of finding paragraph boundaries, Shell mode
741uses @code{shell-prompt-pattern}, regardless of
742@code{comint-use-prompt-regexp}.
743
707@node Shell History 744@node Shell History
708@subsection Shell Command History 745@subsection Shell Command History
709 746
@@ -810,7 +847,7 @@ that these commands access.
810 847
811@vindex shell-input-ring-file-name 848@vindex shell-input-ring-file-name
812 Some shells store their command histories in files so that you can 849 Some shells store their command histories in files so that you can
813refer to previous commands from previous shell sessions. Emacs reads 850refer to commands from previous shell sessions. Emacs reads
814the command history file for your chosen shell, to initialize its own 851the command history file for your chosen shell, to initialize its own
815command history. The file name is @file{~/.bash_history} for bash, 852command history. The file name is @file{~/.bash_history} for bash,
816@file{~/.sh_history} for ksh, and @file{~/.history} for other shells. 853@file{~/.sh_history} for ksh, and @file{~/.history} for other shells.
@@ -876,19 +913,8 @@ when you send them to the shell. To request this, set the variable
876@key{SPC} perform history expansion by binding @key{SPC} to the 913@key{SPC} perform history expansion by binding @key{SPC} to the
877command @code{comint-magic-space}. 914command @code{comint-magic-space}.
878 915
879@vindex shell-prompt-pattern
880@vindex comint-prompt-regexp
881@vindex comint-use-prompt-regexp-instead-of-fields
882@cindex prompt, shell
883 Shell mode recognizes history references when they follow a prompt. 916 Shell mode recognizes history references when they follow a prompt.
884Normally, any text output by a program at the beginning of an input 917@xref{Shell Prompts}, for how Shell mode recognizes prompts.
885line is considered a prompt. However, if the variable
886@code{comint-use-prompt-regexp-instead-of-fields} is non-@code{nil},
887then Comint mode uses a regular expression to recognize prompts. In
888general, the variable @code{comint-prompt-regexp} specifies the
889regular expression; Shell mode uses the variable
890@code{shell-prompt-pattern} to set up @code{comint-prompt-regexp} in
891the shell buffer.
892 918
893@node Directory Tracking 919@node Directory Tracking
894@subsection Directory Tracking 920@subsection Directory Tracking
@@ -1119,8 +1145,11 @@ temporarily visible, but will be erased when you hit return. (This
1119happens automatically; there is no special password processing.) 1145happens automatically; there is no special password processing.)
1120 1146
1121 When you log in to a different machine, you need to specify the type 1147 When you log in to a different machine, you need to specify the type
1122of terminal you're using. Terminal types @samp{ansi} or @samp{vt100} 1148of terminal you're using, by setting the @env{TERM} environment
1123will work on most systems. 1149variable in the environment for the remote login command. (If you use
1150bash, you do that by writing the variable assignment before the remote
1151login command, without separating comma.) Terminal types @samp{ansi}
1152or @samp{vt100} will work on most systems.
1124 1153
1125@c If you are talking to a Bourne-compatible 1154@c If you are talking to a Bourne-compatible
1126@c shell, and your system understands the @env{TERMCAP} variable, 1155@c shell, and your system understands the @env{TERMCAP} variable,
@@ -2078,7 +2107,7 @@ applications. @kbd{C-x} means cut (kill), @kbd{C-c} copy, @kbd{C-v}
2078paste (yank), and @kbd{C-z} undo. Standard Emacs commands like 2107paste (yank), and @kbd{C-z} undo. Standard Emacs commands like
2079@kbd{C-x C-c} still work, because @kbd{C-x} and @kbd{C-c} only take 2108@kbd{C-x C-c} still work, because @kbd{C-x} and @kbd{C-c} only take
2080effect when the mark is active. However, if you don't want these 2109effect when the mark is active. However, if you don't want these
2081bindings at all, set @code{cua-enable-cua-keys} to nil. 2110bindings at all, set @code{cua-enable-cua-keys} to @code{nil}.
2082 2111
2083In CUA mode, using @kbd{Shift} together with the movement keys 2112In CUA mode, using @kbd{Shift} together with the movement keys
2084activates the region over which they move. The standard (unshifted) 2113activates the region over which they move. The standard (unshifted)
diff --git a/man/org.texi b/man/org.texi
index c066a00fd15..a131f5aadb3 100644
--- a/man/org.texi
+++ b/man/org.texi
@@ -1,9 +1,10 @@
1\input texinfo 1\input texinfo
2@c %**start of header 2@c %**start of header
3@c @setfilename org
3@setfilename ../info/org 4@setfilename ../info/org
4@settitle Org Mode Manual 5@settitle Org Mode Manual
5 6
6@set VERSION 3.06 7@set VERSION 3.08
7@set DATE April 2005 8@set DATE April 2005
8 9
9@dircategory Emacs 10@dircategory Emacs
@@ -76,9 +77,9 @@ Software Foundation raise funds for GNU development.''
76@menu 77@menu
77* Introduction:: Getting started 78* Introduction:: Getting started
78* Document Structure:: A tree works like your brain 79* Document Structure:: A tree works like your brain
79* TODO items:: Every tree branch can be a TODO item
80* Tables:: Pure magic for quick formatting 80* Tables:: Pure magic for quick formatting
81* Hyperlinks:: Notes in context 81* Hyperlinks:: Notes in context
82* TODO items:: Every tree branch can be a TODO item
82* Timestamps:: Assign date and time to items 83* Timestamps:: Assign date and time to items
83* Timeline and Agenda:: Use time-stamped items to produce an agenda 84* Timeline and Agenda:: Use time-stamped items to produce an agenda
84* Exporting:: Sharing and publishing of notes 85* Exporting:: Sharing and publishing of notes
@@ -93,6 +94,7 @@ Introduction
93 94
94* Summary:: Brief summary of what Org-mode does 95* Summary:: Brief summary of what Org-mode does
95* Installation and Activation:: How to install Org-mode 96* Installation and Activation:: How to install Org-mode
97* Feedback:: Bug reportes, ideas, patches etc.
96 98
97Document Structure 99Document Structure
98 100
@@ -103,6 +105,17 @@ Document Structure
103* Structure editing:: Changing sequence and level of headlines 105* Structure editing:: Changing sequence and level of headlines
104* Sparse trees:: Matches embedded in context 106* Sparse trees:: Matches embedded in context
105 107
108Tables
109
110* Built-in table editor:: Simple tables
111* table.el:: Complex tables
112* orgtbl-mode:: The table editor as minor mode
113
114Hyperlinks
115
116* Links:: URL-like links to the world
117* Remember:: Org-trees store quick notes
118
106TODO items 119TODO items
107 120
108* TODO basics:: Marking and displaying TODO entries 121* TODO basics:: Marking and displaying TODO entries
@@ -115,17 +128,6 @@ Extended use of TODO keywords
115* TODO types:: I do this, Fred the rest 128* TODO types:: I do this, Fred the rest
116* Per file keywords:: Different files, different requirements 129* Per file keywords:: Different files, different requirements
117 130
118Tables
119
120* Built-in table editor:: Simple tables
121* table.el:: Complex tables
122* orgtbl-mode:: The table editor as minor mode
123
124Hyperlinks
125
126* Links:: URL-like links to the world
127* Remember:: Org-trees store quick notes
128
129Timestamps 131Timestamps
130 132
131* Time stamps:: Assigning a time to a tree entry 133* Time stamps:: Assigning a time to a tree entry
@@ -169,6 +171,7 @@ Miscellaneous
169@menu 171@menu
170* Summary:: Brief summary of what Org-mode does 172* Summary:: Brief summary of what Org-mode does
171* Installation and Activation:: How to install Org-mode 173* Installation and Activation:: How to install Org-mode
174* Feedback:: Bug reportes, ideas, patches etc.
172@end menu 175@end menu
173 176
174@node Summary, Installation and Activation, Introduction, Introduction 177@node Summary, Installation and Activation, Introduction, Introduction
@@ -214,7 +217,7 @@ and example files. This page is located at
214 217
215@page 218@page
216 219
217@node Installation and Activation, , Summary, Introduction 220@node Installation and Activation, Feedback, Summary, Introduction
218@section Installation and Activation 221@section Installation and Activation
219@cindex installation 222@cindex installation
220@cindex autoload 223@cindex autoload
@@ -263,7 +266,32 @@ MY PROJECTS -*- mode: org; -*-
263the file's name is. See also the variable 266the file's name is. See also the variable
264@code{org-insert-mode-line-in-empty-file'}. 267@code{org-insert-mode-line-in-empty-file'}.
265 268
266@node Document Structure, TODO items, Introduction, Top 269@node Feedback, , Installation and Activation, Introduction
270@section Feedback
271@cindex feedback
272@cindex bug reports
273@cindex maintainer
274@cindex author
275
276If you find problems with Org-mode, or if you have questions, remarks,
277or ideas about it, please contact the maintainer Carsten Dominik at
278@value{MAINTAINEREMAIL}.
279
280For bug reports, please provide as much information as possible,
281including the version information of Emacs (@kbd{C-h v emacs-version
282@key{RET}}) and Org-mode (@kbd{M-x org-version}), as well as the
283Org-mode related setup in @file{.emacs}. If an error occurs, a
284traceback can be very useful. Often a small example file helps, along
285with clear information about:
286@enumerate
287@item What exactly did you do?
288@item What did you expect to happen?
289@item What happened instead?
290@end enumerate
291@noindent Thanks for helping to improve this mode.
292
293
294@node Document Structure, Tables, Introduction, Top
267@chapter Document Structure 295@chapter Document Structure
268@cindex document structure 296@cindex document structure
269@cindex structure of document 297@cindex structure of document
@@ -503,209 +531,7 @@ Or you can use the command @kbd{C-c C-x v} to copy the visible part of
503the document to another file (extension @file{.txt}) which then can be 531the document to another file (extension @file{.txt}) which then can be
504printed in any desired way. 532printed in any desired way.
505 533
506@node TODO items, Tables, Document Structure, Top 534@node Tables, Hyperlinks, Document Structure, Top
507@chapter TODO items
508@cindex TODO items
509
510Org-mode does not maintain TODO lists as a separate document. TODO
511items are an integral part of the notes file, because TODO items
512usually come up while taking notes! With Org-mode, you simply mark
513any entry in a tree as being a TODO item. In this way, the
514information is not duplicated, and the entire context from which the
515item emerged is always present when you check.
516
517Of course, this technique causes TODO items to be scattered throughout
518your file. Org-mode provides methods to give you an overview over all
519things you have to do.
520
521@menu
522* TODO basics:: Marking and displaying TODO entries
523* TODO extensions:: Workflow and assignments
524* Priorities:: Some things are more important than others
525@end menu
526
527@node TODO basics, TODO extensions, TODO items, TODO items
528@section Basic TODO functionality
529
530Any headline can become a TODO item by starting it with the word TODO,
531for example
532
533@example
534*** TODO Write letter to Sam Fortune
535@end example
536
537@noindent
538The most important commands to work with TODO entries are:
539
540@table @kbd
541@kindex C-c C-t
542@item C-c C-t
543Rotate the TODO state of the current item between
544@example
545,-> (unmarked) -> TODO -> DONE --.
546'--------------------------------'
547@end example
548The same rotation can also be done ``remotely'' from the timeline and
549agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}).
550@kindex C-c C-v
551@cindex sparse tree, for TODO
552@item C-c C-v
553View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}). Folds
554the entire buffer, but shows all TODO items and the headings hierarchy
555above them. With prefix arg, show also the DONE entries.
556@item C-u C-c a
557A @kbd{C-u} argument to the @code{org-agenda command} (@pxref{Agenda})
558collects all unfinished TODO items into a single place.
559@end table
560
561@node TODO extensions, Priorities, TODO basics, TODO items
562@section Extended use of TODO keywords
563@cindex extended TODO keywords
564
565The default implementation of TODO entries is just two states: TODO
566and DONE. You can, however, use the TODO feature for more
567complicated things by configuring the variables
568@code{org-todo-keywords} and @code{org-todo-interpretation}. Using
569special setup, you can even use TODO keywords in different ways in
570different org files.
571
572@menu
573* Workflow states:: From TODO to DONE in steps
574* TODO types:: I do this, Fred the rest
575* Per file keywords:: Different files, different requirements
576@end menu
577
578@node Workflow states, TODO types, TODO extensions, TODO extensions
579@subsection TODO keywords as workflow states
580@cindex TODO workflow
581@cindex workflow states as TODO keywords
582
583You can use TODO keywords to indicate different states in the process
584of working on an item, for example
585
586@lisp
587(setq org-todo-keywords '("TODO" "FEEDBACK" "VERIFY" "DONE")
588 org-todo-interpretation 'sequence)
589@end lisp
590
591With this setup, the command @kbd{C-c C-t} will cycle an entry from
592TODO to FEEDBACK, then to VERIFY, and finally too DONE. You may also
593use a prefix argument to quickly select a specific state. For example
594@kbd{C-3 C-c C-t} will change the state immediately to VERIFY.
595If you define many keywords, you can use in-buffer completion (see
596@ref{Completion}) to insert these words into the buffer.
597
598@node TODO types, Per file keywords, Workflow states, TODO extensions
599@subsection TODO keywords as types
600@cindex TODO types
601@cindex names as TODO keywords
602@cindex types as TODO keywords
603
604The second possibility is to use TODO keywords to indicate different
605types of action items. For example, you might want to indicate that
606items are for ``work'' or ``home''. Or, when you work with several
607people on a single project, you might want to assign action items
608directly to persons, by using their names as TODO keywords. This
609would be set up like this:
610
611@lisp
612(setq org-todo-keywords '("Fred" "Sara" "Lucy" "Mike" "DONE")
613 org-todo-interpretation 'type)
614@end lisp
615
616In this case, different keywords do not indicate a sequence, but
617rather different types. So it is normally not useful to change from
618one type to another. Therefore, in this case the the behavior of the
619command @kbd{C-c C-t} is changed slightly@footnote{This is also true
620for the @kbd{t} command in the timeline and agenda buffers}. When
621used several times in succession, it will still cycle through all
622names. But when when you return to the item after some time and
623execute @kbd{C-c C-t} again, it will switch from each name directly to
624DONE. Use prefix arguments or completion to quickly select a specific
625name.
626
627@node Per file keywords, , TODO types, TODO extensions
628@subsection Setting up TODO keywords for individual files
629@cindex keyword options
630@cindex per file keywords
631
632It can be very useful to use different aspects of the TODO mechanism
633in different files, which is not possible with the global settings
634described above. For file-local settings, you need to add special
635lines to the file which set the keywords and interpretation for that
636file only. For example, to set one of the two examples discussed
637above, you need one of the following lines, starting in column zero
638anywhere in the file:
639
640@example
641#+SEQ_TODO: TODO FEEDBACK VERIFY DONE
642#+TYP_TODO: Fred Sara Lucy Mike DONE
643@end example
644
645@cindex Completing option keywords
646@kindex M-@key{TAB}
647@noindent To make sure you are using the correct keyword, type
648@samp{#+} into the buffer and then use @kbd{M-@key{TAB}} completion.
649
650@cindex DONE, final TODO keyword
651Remember that the last keyword must always mean that the item is DONE
652(you may use a different word, though). Also note that in each file,
653only one of the two aspects of TODO keywords can be used. After
654changing one of these lines, use @kbd{C-c C-c} with the cursor still
655in the line to make the changes known to Org-mode@footnote{Org-mode
656parses these lines only when Org-mode is activated after visiting a
657file. @kbd{C-c C-c} with the cursor in a line starting with @samp{#-}
658is simply restarting Org-mode, making sure that these changes will be
659respected.}.
660
661If you want to use very many keywords, for example when working with a
662large group of people, you may split the names over several lines:
663
664@example
665#+TYP_TODO: Fred Sara Lucy Mike
666#+TYP_TODO: Luis George Jules Jessica
667#+TYP_TODO: Kim Arnold Peter
668#+TYP_TODO: DONE
669@end example
670
671@node Priorities, , TODO extensions, TODO items
672@section Priorities
673@cindex priorities
674
675If you use Org-mode extensively to organize your work, you may end up
676with a number of TODO entries so large that you'd like to prioritize
677them. This can be done by placing a @emph{priority cookie} into the
678headline, like this
679
680@example
681*** TODO [#A] Write letter to Sam Fortune
682@end example
683
684@noindent
685With its standard setup, Org-mode supports priorities @samp{A},
686@samp{B}, and @samp{C}. @samp{A} is the highest priority. An entry
687without a cookie is treated as priority @samp{B}. Priorities make a
688difference only in the agenda (@pxref{Agenda}).
689
690@table @kbd
691@kindex @kbd{C-c ,}
692@item @kbd{C-c ,}
693Set the priority of the current item. The command prompts for a
694priority character @samp{A}, @samp{B} or @samp{C}. When you press
695@key{SPC} instead, the priority cookie is removed from the headline.
696The priorities can also be changed ``remotely'' from the timeline and
697agenda buffer with the @kbd{,} command (@pxref{Agenda commands}).
698
699@kindex S-@key{up}
700@kindex S-@key{down}
701@item S-@key{up}
702@itemx S-@key{down}
703Increase/decrease priority of current item. Note that these keys are
704also used to modify time stamps (@pxref{Creating timestamps}).
705@end table
706
707
708@node Tables, Hyperlinks, TODO items, Top
709@chapter Tables 535@chapter Tables
710@cindex tables 536@cindex tables
711 537
@@ -951,14 +777,14 @@ possible.
951 777
952If you like the intuitive way the Org-mode table editor works, you 778If you like the intuitive way the Org-mode table editor works, you
953might want to use it also in other modes like text-mode or mail-mode. 779might want to use it also in other modes like text-mode or mail-mode.
954The minor mode Orgtbl-mode make this possible. You can always toggle 780The minor mode Orgtbl-mode makes this possible. You can always toggle
955the mode with @kbd{M-x orgtbl-mode}. To turn it on by default, for 781the mode with @kbd{M-x orgtbl-mode}. To turn it on by default, for
956example in mail mode, use 782example in mail mode, use
957@lisp 783@lisp
958(add-hook 'mail-mode-hook 'turn-on-orgtbl) 784(add-hook 'mail-mode-hook 'turn-on-orgtbl)
959@end lisp 785@end lisp
960 786
961@node Hyperlinks, Timestamps, Tables, Top 787@node Hyperlinks, TODO items, Tables, Top
962@chapter Hyperlinks 788@chapter Hyperlinks
963@cindex hyperlinks 789@cindex hyperlinks
964 790
@@ -1006,7 +832,8 @@ shell:ls *.org @r{A shell command}
1006@end example 832@end example
1007 833
1008A link may contain space characters and is terminated by the end of 834A link may contain space characters and is terminated by the end of
1009the line. Therefore, there can be only one link per line (but see the 835the line or, in tables, by the end of the table field. Therefore,
836outside of tables there can be only one link per line (but see the
1010variable @code{org-allow-space-in-links}). 837variable @code{org-allow-space-in-links}).
1011 838
1012@cindex storing links 839@cindex storing links
@@ -1115,7 +942,210 @@ additional data. If the variable @code{org-adapt-indentation} is
1115non-nil, the entire text is also indented so that it starts in the 942non-nil, the entire text is also indented so that it starts in the
1116same column as the headline (after the asterisks). 943same column as the headline (after the asterisks).
1117 944
1118@node Timestamps, Timeline and Agenda, Hyperlinks, Top 945@node TODO items, Timestamps, Hyperlinks, Top
946@chapter TODO items
947@cindex TODO items
948
949Org-mode does not maintain TODO lists as a separate document. TODO
950items are an integral part of the notes file, because TODO items
951usually come up while taking notes! With Org-mode, you simply mark
952any entry in a tree as being a TODO item. In this way, the
953information is not duplicated, and the entire context from which the
954item emerged is always present when you check.
955
956Of course, this technique causes TODO items to be scattered throughout
957your file. Org-mode provides methods to give you an overview over all
958things you have to do.
959
960@menu
961* TODO basics:: Marking and displaying TODO entries
962* TODO extensions:: Workflow and assignments
963* Priorities:: Some things are more important than others
964@end menu
965
966@node TODO basics, TODO extensions, TODO items, TODO items
967@section Basic TODO functionality
968
969Any headline can become a TODO item by starting it with the word TODO,
970for example
971
972@example
973*** TODO Write letter to Sam Fortune
974@end example
975
976@noindent
977The most important commands to work with TODO entries are:
978
979@table @kbd
980@kindex C-c C-t
981@item C-c C-t
982Rotate the TODO state of the current item between
983@example
984,-> (unmarked) -> TODO -> DONE --.
985'--------------------------------'
986@end example
987The same rotation can also be done ``remotely'' from the timeline and
988agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}).
989@kindex C-c C-v
990@cindex sparse tree, for TODO
991@item C-c C-v
992View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}). Folds
993the entire buffer, but shows all TODO items and the headings hierarchy
994above them. With prefix arg, show also the DONE entries.
995@item C-u C-c a
996A @kbd{C-u} argument to the @code{org-agenda command} (@pxref{Agenda})
997collects all unfinished TODO items into a single place.
998@end table
999
1000@node TODO extensions, Priorities, TODO basics, TODO items
1001@section Extended use of TODO keywords
1002@cindex extended TODO keywords
1003
1004The default implementation of TODO entries is just two states: TODO
1005and DONE. You can, however, use the TODO feature for more
1006complicated things by configuring the variables
1007@code{org-todo-keywords} and @code{org-todo-interpretation}. Using
1008special setup, you can even use TODO keywords in different ways in
1009different org files.
1010
1011@menu
1012* Workflow states:: From TODO to DONE in steps
1013* TODO types:: I do this, Fred the rest
1014* Per file keywords:: Different files, different requirements
1015@end menu
1016
1017@node Workflow states, TODO types, TODO extensions, TODO extensions
1018@subsection TODO keywords as workflow states
1019@cindex TODO workflow
1020@cindex workflow states as TODO keywords
1021
1022You can use TODO keywords to indicate different states in the process
1023of working on an item, for example
1024
1025@lisp
1026(setq org-todo-keywords '("TODO" "FEEDBACK" "VERIFY" "DONE")
1027 org-todo-interpretation 'sequence)
1028@end lisp
1029
1030With this setup, the command @kbd{C-c C-t} will cycle an entry from
1031TODO to FEEDBACK, then to VERIFY, and finally too DONE. You may also
1032use a prefix argument to quickly select a specific state. For example
1033@kbd{C-3 C-c C-t} will change the state immediately to VERIFY.
1034If you define many keywords, you can use in-buffer completion (see
1035@ref{Completion}) to insert these words into the buffer.
1036
1037@node TODO types, Per file keywords, Workflow states, TODO extensions
1038@subsection TODO keywords as types
1039@cindex TODO types
1040@cindex names as TODO keywords
1041@cindex types as TODO keywords
1042
1043The second possibility is to use TODO keywords to indicate different
1044types of action items. For example, you might want to indicate that
1045items are for ``work'' or ``home''. Or, when you work with several
1046people on a single project, you might want to assign action items
1047directly to persons, by using their names as TODO keywords. This
1048would be set up like this:
1049
1050@lisp
1051(setq org-todo-keywords '("Fred" "Sara" "Lucy" "Mike" "DONE")
1052 org-todo-interpretation 'type)
1053@end lisp
1054
1055In this case, different keywords do not indicate a sequence, but
1056rather different types. So it is normally not useful to change from
1057one type to another. Therefore, in this case the the behavior of the
1058command @kbd{C-c C-t} is changed slightly@footnote{This is also true
1059for the @kbd{t} command in the timeline and agenda buffers}. When
1060used several times in succession, it will still cycle through all
1061names. But when when you return to the item after some time and
1062execute @kbd{C-c C-t} again, it will switch from each name directly to
1063DONE. Use prefix arguments or completion to quickly select a specific
1064name.
1065
1066@node Per file keywords, , TODO types, TODO extensions
1067@subsection Setting up TODO keywords for individual files
1068@cindex keyword options
1069@cindex per file keywords
1070
1071It can be very useful to use different aspects of the TODO mechanism
1072in different files, which is not possible with the global settings
1073described above. For file-local settings, you need to add special
1074lines to the file which set the keywords and interpretation for that
1075file only. For example, to set one of the two examples discussed
1076above, you need one of the following lines, starting in column zero
1077anywhere in the file:
1078
1079@example
1080#+SEQ_TODO: TODO FEEDBACK VERIFY DONE
1081#+TYP_TODO: Fred Sara Lucy Mike DONE
1082@end example
1083
1084@cindex Completing option keywords
1085@kindex M-@key{TAB}
1086@noindent To make sure you are using the correct keyword, type
1087@samp{#+} into the buffer and then use @kbd{M-@key{TAB}} completion.
1088
1089@cindex DONE, final TODO keyword
1090Remember that the last keyword must always mean that the item is DONE
1091(you may use a different word, though). Also note that in each file,
1092only one of the two aspects of TODO keywords can be used. After
1093changing one of these lines, use @kbd{C-c C-c} with the cursor still
1094in the line to make the changes known to Org-mode@footnote{Org-mode
1095parses these lines only when Org-mode is activated after visiting a
1096file. @kbd{C-c C-c} with the cursor in a line starting with @samp{#-}
1097is simply restarting Org-mode, making sure that these changes will be
1098respected.}.
1099
1100If you want to use very many keywords, for example when working with a
1101large group of people, you may split the names over several lines:
1102
1103@example
1104#+TYP_TODO: Fred Sara Lucy Mike
1105#+TYP_TODO: Luis George Jules Jessica
1106#+TYP_TODO: Kim Arnold Peter
1107#+TYP_TODO: DONE
1108@end example
1109
1110@node Priorities, , TODO extensions, TODO items
1111@section Priorities
1112@cindex priorities
1113
1114If you use Org-mode extensively to organize your work, you may end up
1115with a number of TODO entries so large that you'd like to prioritize
1116them. This can be done by placing a @emph{priority cookie} into the
1117headline, like this
1118
1119@example
1120*** TODO [#A] Write letter to Sam Fortune
1121@end example
1122
1123@noindent
1124With its standard setup, Org-mode supports priorities @samp{A},
1125@samp{B}, and @samp{C}. @samp{A} is the highest priority. An entry
1126without a cookie is treated as priority @samp{B}. Priorities make a
1127difference only in the agenda (@pxref{Agenda}).
1128
1129@table @kbd
1130@kindex @kbd{C-c ,}
1131@item @kbd{C-c ,}
1132Set the priority of the current item. The command prompts for a
1133priority character @samp{A}, @samp{B} or @samp{C}. When you press
1134@key{SPC} instead, the priority cookie is removed from the headline.
1135The priorities can also be changed ``remotely'' from the timeline and
1136agenda buffer with the @kbd{,} command (@pxref{Agenda commands}).
1137
1138@kindex S-@key{up}
1139@kindex S-@key{down}
1140@item S-@key{up}
1141@itemx S-@key{down}
1142Increase/decrease priority of current item. Note that these keys are
1143also used to modify time stamps (@pxref{Creating timestamps}).
1144@end table
1145
1146
1147
1148@node Timestamps, Timeline and Agenda, TODO items, Top
1119@chapter Timestamps 1149@chapter Timestamps
1120 1150
1121Items can be labeled with timestamps to make them useful for project 1151Items can be labeled with timestamps to make them useful for project
@@ -1415,10 +1445,11 @@ with a special line anywhere in the buffer, looking like this:
1415@end example 1445@end example
1416@noindent 1446@noindent
1417After changing this line, press @kbd{C-c C-c} with the cursor still in 1447After changing this line, press @kbd{C-c C-c} with the cursor still in
1418the line, to make the changes know to org-mode. Otherwise, the change 1448the line, to make the changes known to org-mode. Otherwise, the
1419will only be active the next time you visit this file with Emacs. 1449change will only be active the next time you visit this file with
1450Emacs.
1420 1451
1421The display in the agenda buffer looks best if the category is no 1452The display in the agenda buffer looks best if the category is not
1422longer than 10 characters. 1453longer than 10 characters.
1423 1454
1424@subsection Sorting of agenda items 1455@subsection Sorting of agenda items
@@ -2078,10 +2109,9 @@ Org mode cooperates with table.el, see @ref{table.el}.
2078@cindex acknowledgments 2109@cindex acknowledgments
2079 2110
2080Org-mode was written by Carsten Dominik, who still maintains it at the 2111Org-mode was written by Carsten Dominik, who still maintains it at the
2081Org-mode homepage 2112Org-mode homepage @uref{http://www.astro.uva.nl/~dominik/Tools/org/}.
2082@uref{http://www.astro.uva.nl/~dominik/Tools/org/}. The following 2113The following people have helped the development along with ideas,
2083people have helped the development along with ideas, suggestions and 2114suggestions and patches.
2084patches.
2085 2115
2086@itemize @bullet 2116@itemize @bullet
2087@item 2117@item
@@ -2112,6 +2142,9 @@ Oliver Oppitz sent several useful suggestions.
2112@item 2142@item
2113Carsten Wimmer suggested some changes and helped fix a bug in linking 2143Carsten Wimmer suggested some changes and helped fix a bug in linking
2114to GNUS. 2144to GNUS.
2145@item
2146Stefan Monnier provided a patch with lots of little fixes to keep the
2147Emacs-Lisp compiler happy.
2115@end itemize 2148@end itemize
2116 2149
2117@node Bugs, , Acknowledgments, Miscellaneous 2150@node Bugs, , Acknowledgments, Miscellaneous
@@ -2154,6 +2187,7 @@ The exporters work well, but could be made more efficient.
2154 2187
2155@bye 2188@bye
2156 2189
2190
2157@ignore 2191@ignore
2158 arch-tag: 7893d1fe-cc57-4d13-b5e5-f494a1bcc7ac 2192 arch-tag: 7893d1fe-cc57-4d13-b5e5-f494a1bcc7ac
2159@end ignore 2193@end ignore
diff --git a/man/text.texi b/man/text.texi
index 958e18db8d5..3d6c0a6b763 100644
--- a/man/text.texi
+++ b/man/text.texi
@@ -1540,6 +1540,9 @@ Preview the output from the last @kbd{C-c C-r}, @kbd{C-c C-b}, or @kbd{C-c
1540C-f} command (@code{tex-view}). 1540C-f} command (@code{tex-view}).
1541@item C-c C-q 1541@item C-c C-q
1542Show the printer queue (@code{tex-show-print-queue}). 1542Show the printer queue (@code{tex-show-print-queue}).
1543@item C-c C-c
1544Invoke some other compilation command on the entire current buffer
1545(@code{tex-compile}).
1543@end table 1546@end table
1544 1547
1545@findex tex-buffer 1548@findex tex-buffer
@@ -1684,6 +1687,15 @@ current buffer's file. Generally, you need to do @kbd{C-c C-f}
1684@kbd{C-c TAB} (@code{tex-bibtex-file}), and then repeat @kbd{C-c C-f} 1687@kbd{C-c TAB} (@code{tex-bibtex-file}), and then repeat @kbd{C-c C-f}
1685(@code{tex-file}) twice more to get the cross-references correct. 1688(@code{tex-file}) twice more to get the cross-references correct.
1686 1689
1690@findex tex-compile
1691@kindex C-c C-c @r{(@TeX{} mode)}
1692 To invoke some other compilation program on the current @TeX{}
1693buffer, type @kbd{C-c C-c} (@code{tex-compile}). This command knows
1694how to pass arguments to many common programs, including
1695@file{pdflatex}, @file{yap}, @file{xdvi}, and @file{dvips}. You can
1696select your desired compilation program using the standard completion
1697keys (@pxref{Completion}).
1698
1687@node TeX Misc 1699@node TeX Misc
1688@subsection @TeX{} Mode Miscellany 1700@subsection @TeX{} Mode Miscellany
1689 1701
diff --git a/nt/ChangeLog b/nt/ChangeLog
index f91c59a85c5..fd4ee0ab190 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,7 @@
12005-04-23 David Hunter <hunterd42@comcast.net> (tiny change)
2
3 * config.nt (HAVE_PWD_H): Undef.
4
12004-06-07 Juanma Barranquero <lektu@terra.es> 52004-06-07 Juanma Barranquero <lektu@terra.es>
2 6
3 * INSTALL: Clarify paragraph about compatibility between image 7 * INSTALL: Clarify paragraph about compatibility between image
diff --git a/nt/config.nt b/nt/config.nt
index 56ec72a56a6..a41d6ecac4b 100644
--- a/nt/config.nt
+++ b/nt/config.nt
@@ -139,6 +139,7 @@ Boston, MA 02111-1307, USA. */
139#undef HAVE_TERMIOS_H 139#undef HAVE_TERMIOS_H
140#undef HAVE_LIMITS_H 140#undef HAVE_LIMITS_H
141#undef HAVE_STRING_H 141#undef HAVE_STRING_H
142#undef HAVE_PWD_H
142#undef STDC_HEADERS 143#undef STDC_HEADERS
143#undef TIME_WITH_SYS_TIME 144#undef TIME_WITH_SYS_TIME
144 145
diff --git a/src/ChangeLog b/src/ChangeLog
index 7ace79442e9..6d9c1da92d5 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,245 @@
12005-05-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2
3 * mac.c: #undef init_process so not to conflict with system headers.
4
52005-05-02 Richard M. Stallman <rms@gnu.org>
6
7 * buffer.c (syms_of_buffer): Define cursor-in-non-selected-windows.
8
9 * buffer.h (struct buffer): Add cursor_in_non_selected_windows slot.
10
11 * xdisp.c (Vcursor_in_non_selected_windows)
12 (Qcursor_in_non_selected_windows): Vars deleted.
13 (syms_of_xdisp): Don't initialize them.
14 (get_window_cursor_type): Use cursor_in_non_selected_windows
15 buffer slot.
16
172005-05-02 Kim F. Storm <storm@cua.dk>
18
19 * macros.c (executing_kbd_macro_index): Rename from
20 executing_macro_index. All uses changed.
21 (executing_kbd_macro_iterations): Rename from
22 executing_macro_iterations. All uses changed.
23 (executing_kbd_macro): Rename from executing_macro.
24 All uses changed.
25 (syms_of_macros): Rename Lisp var executing-macro-index to
26 executing-kbd-macro-index.
27
28 * xdisp.c (move_it_in_display_line_to): Fix last change.
29
302005-05-01 Luc Teirlinck <teirllm@auburn.edu>
31
32 * xmenu.c (Fx_popup_menu): Doc fix.
33
34 * charset.c (syms_of_charset): Delete defsubr for Schars_in_region.
35
362005-05-02 Jason Rumney <jasonr@gnu.org>
37
38 * emacs.c (USAGE3, USAGE4): Keep strings below 2048 bytes.
39
402005-05-02 Nozomu Ando <nand@mac.com>
41
42 * sysselect.h: Fix typo.
43
442005-05-02 Nick Roberts <nickrob@snap.net.nz>
45
46 * charset.c (Fchars_in_region): Remove as obsolete.
47
482005-05-01 Kim F. Storm <storm@cua.dk>
49
50 * xdisp.c (move_it_in_display_line_to): Stop if we move beyond
51 TO_CHARPOS. This may happen if last glyphs was an image or stretch
52 glyph.
53
542005-05-01 Luc Teirlinck <teirllm@auburn.edu>
55
56 * dispnew.c (sit_for): Vexecuting_macro -> Vexecuting_kbd_macro.
57
582005-05-01 Richard M. Stallman <rms@gnu.org>
59
60 * xmenu.c [not HAVE_X_TOOLKIT] (xmenu_show):
61 If user cancels the menu, quit unless FOR_CLICK.
62
63 * macros.c (Vexecuting_kbd_macro): Renamed from Vexecuting_macro.
64 All uses changed.
65 (syms_of_macros): Define only executing-kbd-macro, not executing-macro.
66 * keyboard.c: Change Vexecuting_macro to Vexecuting_kbd_macro.
67 * macros.h (Vexecuting_kbd_macro): Declare instead of Vexecuting_macro.
68 * commands.h (Vexecuting_kbd_macro): Likewise.
69
702005-05-01 Thien-Thi Nguyen <ttn@gnu.org>
71
72 * sysdep.c (get_frame_size) [VMS]: Use a fresh i/o channel.
73
742005-04-30 Richard M. Stallman <rms@gnu.org>
75
76 * fileio.c (Ffind_file_name_handler): Handle the `operations'
77 property of the file name handler.
78 (Qoperations): New variable.
79 (syms_of_fileio): Initialize and staticpro it.
80
81 * xdisp.c (set_message_1): Delete xassert.
82
832005-04-29 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
84
85 * mac.c: Don't include time.h. Include sysselect.h after
86 systime.h.
87
88 * macfns.c (Fx_server_version): Add BLOCK_INPUT around Gestalt.
89
90 * macgui.h [HAVE_CARBON && MAC_OSX]: Don't undefine/define mktime
91 before/after including Carbon.h if there is a working mktime.
92
932005-04-28 Kim F. Storm <storm@cua.dk>
94
95 * xfaces.c (resolve_face_name): Add arg SIGNAL_P. Calls changed.
96 Fix cyclic alias check. If alias loop is detected, signal
97 circular-list error if SIGNAL_P, and return Qdefault if !SIGNAL_P.
98
992005-04-28 Lute Kamstra <lute@gnu.org>
100
101 * eval.c (do_autoload): Record only autoloads in the autoload
102 property of symbols.
103
1042005-04-28 Nick Roberts <nickrob@snap.net.nz>
105
106 * emacs.c (USAGE1): Add --basic-display and --quick options.
107
1082005-04-27 Kim F. Storm <storm@cua.dk>
109
110 * data.c (syms_of_data) Staticpro Qcyclic_variable_indirection.
111
1122005-04-26 Richard M. Stallman <rms@gnu.org>
113
114 * window.c (Fsame_window_p, Fspecial_display_p): Doc fixes.
115 (syms_of_window): Doc fixes.
116
117 * indent.c (Fvertical_motion): Undo previous change.
118
1192005-04-26 Kenichi Handa <handa@m17n.org>
120
121 * fns.c (char_table_range): New function.
122 (Fchar_table_range): Signal an error if characters in the range
123 have inconsistent values. Don't check the parent.
124
1252005-04-25 Kenichi Handa <handa@m17n.org>
126
127 * fontset.c (fontset_set): Fix previous change.
128
1292005-04-24 Richard M. Stallman <rms@gnu.org>
130
131 * indent.c (Fvertical_motion): Bind fontification-functions to nil.
132
1332005-04-24 Eli Zaretskii <eliz@gnu.org>
134
135 * regex.c (re_search_2, re_match_2_internal): Convert second arg
136 of RE_TRANSLATE to int, to shut up GCC warnings.
137
138 * fileio.c (Fcopy_file): Doc fix.
139 [MSDOS]: Fix call to emacs_open: buffer_file_type not defined and
140 not needed.
141
1422005-04-24 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
143
144 * Makefile.in [HAVE_CARBON] (MAC_OBJ): Add macselect.o.
145 (SOME_MACHINE_OBJECTS): Likewise.
146 (mac.o): Depend on ccl.h.
147 (macselect.o): New target.
148
149 * emacs.c (main) [MAC_OS8 || MAC_OSX && HAVE_CARBON]: Call
150 syms_of_macselect.
151
152 * frame.c (Fdelete_frame) [MAC_OS]: Call x_clear_frame_selections.
153
154 * mac.c [!TARGET_API_MAC_CARBON]: Don't include charset.h or
155 coding.h.
156 (QCLIPBOARD): Remove variable.
157 (syms_of_mac): Don't initialize it.
158 (Fmac_paste_function, Fmac_cut_function, Fx_selection_exists_p):
159 Remove functions.
160 (syms_of_mac): Don't defsubr them.
161 [TARGET_API_MAC_CARBON] (Qmime_charset, QNFD, QNFKD, QNFC, QNFKC)
162 (QHFS_plus_D, QHFS_plus_C): New variables.
163 (syms_of_mac) [TARGET_API_MAC_CARBON]: Initialize them.
164 [TARGET_API_MAC_CARBON] (get_cfstring_encoding_from_lisp)
165 (cfstring_create_normalized): New functions.
166 [TARGET_API_MAC_CARBON] (Fmac_code_convert_string): Likewise.
167 (syms_of_mac) [TARGET_API_MAC_CARBON]: Defsubr it.
168
169 * macterm.c (handling_window_update, terminate_flag): Remove
170 variables.
171 (do_window_update, do_ae_quit_application, XTread_socket): Don't
172 use them.
173 (WNE_SLEEP_AT_SUSPEND, WNE_SLEEP_AT_RESUME): Don't define.
174 [USE_CARBON_EVENTS && MAC_OSX] (mac_handle_service_event)
175 (init_service_handler): Move to macselect.c. Remove declarations.
176 [USE_CARBON_EVENTS && MAC_OSX] (init_service_handler): Add extern.
177 (Qapplication, Qabout): New variables.
178 (syms_of_mac): Initialize them.
179 [USE_CARBON_EVENTS && MAC_OSX] (Qpreferences, Qservices, Qpaste)
180 (Qperform): New variables.
181 (syms_of_mac) [USE_CARBON_EVENTS && MAC_OSX]: Initialize them.
182 (do_get_menus) [TARGET_API_MAC_CARBON]: Don't call AppendResMenu.
183 (do_menu_choice): Unhighlight menu bar also when menu_id is 0.
184 (mac_store_application_menu_event, init_menu_bar): New functions.
185 [USE_CARBON_EVENTS] (mac_handle_command_event)
186 (init_command_handler): New functions.
187 (mac_handle_window_event): Return noErr on window update event.
188 (do_ae_quit_application): Call mac_store_application_menu_event.
189 (mac_initialize) [USE_CARBON_EVENTS]: Call init_command_handler
190 and init_menu_bar.
191
192 * macterm.h (x_clear_frame_selections): Add extern.
193
194 * macselect.c: New file for selection processing on Mac OS.
195
1962005-04-23 Richard M. Stallman <rms@gnu.org>
197
198 * fileio.c (Fcopy_file): New arg MUSTBENEW.
199 (Frename_file): Pass new arg to Fcopy_file.
200
201 * window.c (window_size_fixed): Variable deleted.
202 (syms_of_window): Initialize window-size-fixed to nil.
203 But don't DEFVAR window_size_fixed.
204
2052005-04-23 Andreas Schwab <schwab@suse.de>
206
207 * m/macppc.h (LD_SWITCH_MACHINE) [LINUX]: Don't define.
208 (START_FILES, LIB_STANDARD) [LINUX && _ARCH_PPC64]: Override to
209 use lib64 instead of lib.
210 (_LP64) [_ARCH_PPC64]: Define if not defined.
211
2122005-04-23 David Hunter <hunterd42@comcast.net> (tiny change)
213
214 * s/ms-w32.h (HAVE_PWD_H): Define.
215
2162005-04-22 Kenichi Handa <handa@m17n.org>
217
218 * fns.c (copy_sub_char_table): Explicitly copy the default value
219 of the sub-chartable.
220
221 * fontset.c (fontset_set): When a sub-chartable is created,
222 explicitly sets the defalt value.
223
2242005-04-22 Kim F. Storm <storm@cua.dk>
225
226 * fns.c (Fplist_get): Replace by Fsafe_plist_get.
227 (Fsafe_plist_get): Rename to Fplist_get.
228 (Fsafe_get): Remove, as Fget now uses safe Fplist_get.
229 (defsubr): Remove defsubr for Fsafe_plist_get and Fsafe_get.
230
231 * lisp.h (Fsafe_plist_get, Fsafe_get): Remove EXFUN.
232
233 * xdisp.c (store_mode_line_string, produce_stretch_glyph)
234 (note_mode_line_or_margin_highlight, note_mouse_highlight):
235 Use Fplist_get instead of Fsafe_plist_get.
236
237 * xfaces.c (resolve_face_name): Use Fget instead of Fsafe_get.
238
2392005-04-21 Miles Bader <miles@gnu.org>
240
241 * xdisp.c (dump_glyph_row): Don't display overlay_arrow_p field.
242
12005-04-20 Thien-Thi Nguyen <ttn@gnu.org> 2432005-04-20 Thien-Thi Nguyen <ttn@gnu.org>
2 244
3 * sysdep.c: Remove reference to defunct vms-pwd.h. 245 * sysdep.c: Remove reference to defunct vms-pwd.h.
@@ -2763,7 +3005,7 @@
2763 3005
2764 * doc.c: New variable Vbuild_files. 3006 * doc.c: New variable Vbuild_files.
2765 (Fsnarf_documentation): If Vbuild_files is nil, populate it with 3007 (Fsnarf_documentation): If Vbuild_files is nil, populate it with
2766 file names from buildobh.lst. Only attach docstrings from files 3008 file names from buildobj.lst. Only attach docstrings from files
2767 that are in Vbuild_files. 3009 that are in Vbuild_files.
2768 (syms_of_doc): Defvar Vbuild_files. 3010 (syms_of_doc): Defvar Vbuild_files.
2769 3011
diff --git a/src/ChangeLog.unicode b/src/ChangeLog.unicode
index bc19b41e6d0..8ca882f9a07 100644
--- a/src/ChangeLog.unicode
+++ b/src/ChangeLog.unicode
@@ -1,3 +1,8 @@
12005-05-04 Miles Bader <miles@gnu.org>
2
3 * character.c (chars-in-region): Obsolete function removed.
4 (syms_of_character): Remove its initialization.
5
12005-04-28 Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net> 62005-04-28 Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net>
2 7
3 * w32select.c (validate_coding_system) 8 * w32select.c (validate_coding_system)
diff --git a/src/Makefile.in b/src/Makefile.in
index 2afdbb4771e..64047763a8f 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -570,7 +570,7 @@ CYGWIN_OBJ = sheap.o
570 570
571#ifdef HAVE_CARBON 571#ifdef HAVE_CARBON
572mac = $(dot)$(dot)/mac/ 572mac = $(dot)$(dot)/mac/
573MAC_OBJ = mac.o macterm.o macfns.o macmenu.o fontset.o fringe.o image.o 573MAC_OBJ = mac.o macterm.o macfns.o macmenu.o macselect.o fontset.o fringe.o image.o
574emacsapp = $(PWD)/$(mac)Emacs.app/ 574emacsapp = $(PWD)/$(mac)Emacs.app/
575emacsappsrc = ${srcdir}/../mac/Emacs.app/ 575emacsappsrc = ${srcdir}/../mac/Emacs.app/
576#endif 576#endif
@@ -597,7 +597,7 @@ obj= dispnew.o frame.o scroll.o xdisp.o $(XMENU_OBJ) window.o \
597 in case they are needed there. */ 597 in case they are needed there. */
598SOME_MACHINE_OBJECTS = sunfns.o dosfns.o msdos.o \ 598SOME_MACHINE_OBJECTS = sunfns.o dosfns.o msdos.o \
599 xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \ 599 xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
600 mac.o macterm.o macfns.o macmenu.o fontset.o \ 600 mac.o macterm.o macfns.o macmenu.o macselect.o fontset.o \
601 w32.o w32bdf.o w32console.o w32fns.o w32heap.o w32inevt.o \ 601 w32.o w32bdf.o w32console.o w32fns.o w32heap.o w32inevt.o \
602 w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o 602 w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o
603 603
@@ -1230,7 +1230,7 @@ abbrev.o buffer.o callint.o cmds.o dispnew.o editfns.o fileio.o frame.o \
1230 scroll.o sysdep.o term.o widget.o window.o xdisp.o xfaces.o xfns.o xmenu.o \ 1230 scroll.o sysdep.o term.o widget.o window.o xdisp.o xfaces.o xfns.o xmenu.o \
1231 xterm.o xselect.o sound.o: macgui.h 1231 xterm.o xselect.o sound.o: macgui.h
1232mac.o: mac.c process.h sysselect.h blockinput.h atimer.h systime.h charset.h \ 1232mac.o: mac.c process.h sysselect.h blockinput.h atimer.h systime.h charset.h \
1233 coding.h $(config_h) 1233 coding.h ccl.h $(config_h)
1234macfns.o: macfns.c charset.h macterm.h macgui.h frame.h window.h buffer.h \ 1234macfns.o: macfns.c charset.h macterm.h macgui.h frame.h window.h buffer.h \
1235 dispextern.h macgui.h fontset.h $(INTERVAL_SRC) keyboard.h blockinput.h \ 1235 dispextern.h macgui.h fontset.h $(INTERVAL_SRC) keyboard.h blockinput.h \
1236 atimer.h systime.h epaths.h termhooks.h coding.h systime.h $(config_h) 1236 atimer.h systime.h epaths.h termhooks.h coding.h systime.h $(config_h)
@@ -1240,6 +1240,7 @@ macterm.o: blockinput.h atimer.h systime.h syssignal.h macterm.h macgui.h \
1240 frame.h charset.h ccl.h dispextern.h fontset.h termhooks.h termopts.h \ 1240 frame.h charset.h ccl.h dispextern.h fontset.h termhooks.h termopts.h \
1241 termchar.h gnu.h disptab.h buffer.h window.h keyboard.h $(INTERVAL_SRC) \ 1241 termchar.h gnu.h disptab.h buffer.h window.h keyboard.h $(INTERVAL_SRC) \
1242 process.h coding.h $(config_h) 1242 process.h coding.h $(config_h)
1243macselect.o: blockinput.h macterm.h macgui.h frame.h $(config_h)
1243 1244
1244${emacsapp}Contents/Resources/English.lproj: 1245${emacsapp}Contents/Resources/English.lproj:
1245 mkdir -p $@ 1246 mkdir -p $@
diff --git a/src/buffer.c b/src/buffer.c
index d24deb0a9a1..6733cbf0815 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5084,6 +5084,7 @@ init_buffer_once ()
5084 XSETFASTINT (buffer_local_flags.header_line_format, idx); ++idx; 5084 XSETFASTINT (buffer_local_flags.header_line_format, idx); ++idx;
5085 XSETFASTINT (buffer_local_flags.cursor_type, idx); ++idx; 5085 XSETFASTINT (buffer_local_flags.cursor_type, idx); ++idx;
5086 XSETFASTINT (buffer_local_flags.extra_line_spacing, idx); ++idx; 5086 XSETFASTINT (buffer_local_flags.extra_line_spacing, idx); ++idx;
5087 XSETFASTINT (buffer_local_flags.cursor_in_non_selected_windows, idx); ++idx;
5087 5088
5088 /* Need more room? */ 5089 /* Need more room? */
5089 if (idx >= MAX_PER_BUFFER_VARS) 5090 if (idx >= MAX_PER_BUFFER_VARS)
@@ -5954,6 +5955,11 @@ The space is measured in pixels, and put below lines on window systems.
5954If value is a floating point number, it specifies the spacing relative 5955If value is a floating point number, it specifies the spacing relative
5955to the default frame line height. */); 5956to the default frame line height. */);
5956 5957
5958 DEFVAR_PER_BUFFER ("cursor-in-non-selected-windows",
5959 &current_buffer->cursor_in_non_selected_windows, Qt,
5960 doc: /* *Cursor type to display in non-selected windows.
5961t means to use hollow box cursor. See `cursor-type' for other values. */);
5962
5957 DEFVAR_LISP ("kill-buffer-query-functions", &Vkill_buffer_query_functions, 5963 DEFVAR_LISP ("kill-buffer-query-functions", &Vkill_buffer_query_functions,
5958 doc: /* List of functions called with no args to query before killing a buffer. */); 5964 doc: /* List of functions called with no args to query before killing a buffer. */);
5959 Vkill_buffer_query_functions = Qnil; 5965 Vkill_buffer_query_functions = Qnil;
diff --git a/src/buffer.h b/src/buffer.h
index 838ace7b18b..0da6b5c4953 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -765,6 +765,11 @@ struct buffer
765 /* An integer > 0 means put that number of pixels below text lines 765 /* An integer > 0 means put that number of pixels below text lines
766 in the display of this buffer. */ 766 in the display of this buffer. */
767 Lisp_Object extra_line_spacing; 767 Lisp_Object extra_line_spacing;
768
769 /* *Cursor type to display in non-selected windows.
770 t means to use hollow box cursor.
771 See `cursor-type' for other values. */
772 Lisp_Object cursor_in_non_selected_windows;
768}; 773};
769 774
770 775
diff --git a/src/character.c b/src/character.c
index e4a2ed4a253..91b889c3836 100644
--- a/src/character.c
+++ b/src/character.c
@@ -1,7 +1,7 @@
1/* Basic character support. 1/* Basic character support.
2 Copyright (C) 1995, 1997, 1998, 2001 Electrotechnical Laboratory, JAPAN. 2 Copyright (C) 1995, 1997, 1998, 2001 Electrotechnical Laboratory, JAPAN.
3 Licensed to the Free Software Foundation. 3 Licensed to the Free Software Foundation.
4 Copyright (C) 2001 Free Software Foundation, Inc. 4 Copyright (C) 2001, 2005 Free Software Foundation, Inc.
5 Copyright (C) 2003 5 Copyright (C) 2003
6 National Institute of Advanced Industrial Science and Technology (AIST) 6 National Institute of Advanced Industrial Science and Technology (AIST)
7 Registration Number H13PRO009 7 Registration Number H13PRO009
@@ -532,23 +532,6 @@ The returned value is 0 for left-to-right and 1 for right-to-left. */)
532 return CHAR_TABLE_REF (Vchar_direction_table, c); 532 return CHAR_TABLE_REF (Vchar_direction_table, c);
533} 533}
534 534
535DEFUN ("chars-in-region", Fchars_in_region, Schars_in_region, 2, 2, 0,
536 doc: /* Return number of characters between BEG and END.
537This is now an obsolete function. We keep it just for backward compatibility. */)
538 (beg, end)
539 Lisp_Object beg, end;
540{
541 int from, to;
542
543 CHECK_NUMBER_COERCE_MARKER (beg);
544 CHECK_NUMBER_COERCE_MARKER (end);
545
546 from = min (XFASTINT (beg), XFASTINT (end));
547 to = max (XFASTINT (beg), XFASTINT (end));
548
549 return make_number (to - from);
550}
551
552/* Return the number of characters in the NBYTES bytes at PTR. 535/* Return the number of characters in the NBYTES bytes at PTR.
553 This works by looking at the contents and checking for multibyte 536 This works by looking at the contents and checking for multibyte
554 sequences while assuming that there's no invalid sequence. 537 sequences while assuming that there's no invalid sequence.
@@ -943,7 +926,6 @@ syms_of_character ()
943 defsubr (&Schar_width); 926 defsubr (&Schar_width);
944 defsubr (&Sstring_width); 927 defsubr (&Sstring_width);
945 defsubr (&Schar_direction); 928 defsubr (&Schar_direction);
946 defsubr (&Schars_in_region);
947 defsubr (&Sstring); 929 defsubr (&Sstring);
948 930
949 DEFVAR_LISP ("translation-table-vector", &Vtranslation_table_vector, 931 DEFVAR_LISP ("translation-table-vector", &Vtranslation_table_vector,
diff --git a/src/commands.h b/src/commands.h
index f7831bc36a9..b9b1ad41933 100644
--- a/src/commands.h
+++ b/src/commands.h
@@ -76,11 +76,11 @@ extern Lisp_Object last_point_position_buffer;
76/* Nonzero means ^G can quit instantly */ 76/* Nonzero means ^G can quit instantly */
77extern int immediate_quit; 77extern int immediate_quit;
78 78
79extern Lisp_Object Vexecuting_macro; 79extern Lisp_Object Vexecuting_kbd_macro;
80 80
81/* Nonzero if input is coming from the keyboard */ 81/* Nonzero if input is coming from the keyboard */
82 82
83#define INTERACTIVE (NILP (Vexecuting_macro) && !noninteractive) 83#define INTERACTIVE (NILP (Vexecuting_kbd_macro) && !noninteractive)
84 84
85/* Set this nonzero to force reconsideration of mode line. */ 85/* Set this nonzero to force reconsideration of mode line. */
86 86
diff --git a/src/data.c b/src/data.c
index a78ff68c7e4..cb7f1649c00 100644
--- a/src/data.c
+++ b/src/data.c
@@ -3057,6 +3057,7 @@ syms_of_data ()
3057 staticpro (&Qargs_out_of_range); 3057 staticpro (&Qargs_out_of_range);
3058 staticpro (&Qvoid_function); 3058 staticpro (&Qvoid_function);
3059 staticpro (&Qcyclic_function_indirection); 3059 staticpro (&Qcyclic_function_indirection);
3060 staticpro (&Qcyclic_variable_indirection);
3060 staticpro (&Qvoid_variable); 3061 staticpro (&Qvoid_variable);
3061 staticpro (&Qsetting_constant); 3062 staticpro (&Qsetting_constant);
3062 staticpro (&Qinvalid_read_syntax); 3063 staticpro (&Qinvalid_read_syntax);
diff --git a/src/dispnew.c b/src/dispnew.c
index 70186e279b1..fd35ad338b2 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -6343,7 +6343,7 @@ sit_for (sec, usec, reading, display, initial_display)
6343{ 6343{
6344 swallow_events (display); 6344 swallow_events (display);
6345 6345
6346 if (detect_input_pending_run_timers (display) || !NILP (Vexecuting_macro)) 6346 if (detect_input_pending_run_timers (display) || !NILP (Vexecuting_kbd_macro))
6347 return Qnil; 6347 return Qnil;
6348 6348
6349 if (initial_display) 6349 if (initial_display)
diff --git a/src/emacs.c b/src/emacs.c
index 79c0654d379..597a86d2eec 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -264,7 +264,8 @@ Initialization options:\n\
264--no-shared-memory, -nl do not use shared memory\n\ 264--no-shared-memory, -nl do not use shared memory\n\
265--no-site-file do not load site-start.el\n\ 265--no-site-file do not load site-start.el\n\
266--no-splash do not display a splash screen on startup\n\ 266--no-splash do not display a splash screen on startup\n\
267--no-window-system, -nw don't communicate with X, ignoring $DISPLAY\n\ 267--no-window-system, -nw do not communicate with X, ignoring $DISPLAY\n\
268--quick, -Q equivalent to -q --no-site-file\n\
268--script FILE run FILE as an Emacs Lisp script\n\ 269--script FILE run FILE as an Emacs Lisp script\n\
269--terminal, -t DEVICE use DEVICE for terminal I/O\n\ 270--terminal, -t DEVICE use DEVICE for terminal I/O\n\
270--unibyte, --no-multibyte run Emacs in unibyte mode\n\ 271--unibyte, --no-multibyte run Emacs in unibyte mode\n\
@@ -294,6 +295,8 @@ FILE visit FILE using find-file\n\
294Display options:\n\ 295Display options:\n\
295\n\ 296\n\
296--background-color, -bg COLOR window background color\n\ 297--background-color, -bg COLOR window background color\n\
298--basic-display, -D disable many display features;\n\
299 used for debugging Emacs\n\
297--border-color, -bd COLOR main border color\n\ 300--border-color, -bd COLOR main border color\n\
298--border-width, -bw WIDTH width of main border\n\ 301--border-width, -bw WIDTH width of main border\n\
299--color, --color=MODE color mode for character terminals;\n\ 302--color, --color=MODE color mode for character terminals;\n\
@@ -320,16 +323,16 @@ Display options:\n\
320--xrm XRESOURCES set additional X resources\n\ 323--xrm XRESOURCES set additional X resources\n\
321--help display this help and exit\n\ 324--help display this help and exit\n\
322--version output version information and exit\n\ 325--version output version information and exit\n\
323\n\ 326\n"
327
328#define USAGE4 "\
324You can generally also specify long option names with a single -; for\n\ 329You can generally also specify long option names with a single -; for\n\
325example, -batch as well as --batch. You can use any unambiguous\n\ 330example, -batch as well as --batch. You can use any unambiguous\n\
326abbreviation for a --option.\n\ 331abbreviation for a --option.\n\
327\n\ 332\n\
328Various environment variables and window system resources also affect\n\ 333Various environment variables and window system resources also affect\n\
329Emacs' operation. See the main documentation.\n\ 334Emacs' operation. See the main documentation.\n\
330\n" 335\n\
331
332#define USAGE4 "\
333Report bugs to %s. First, please see the Bugs\n\ 336Report bugs to %s. First, please see the Bugs\n\
334section of the Emacs manual or the file BUGS.\n" 337section of the Emacs manual or the file BUGS.\n"
335 338
@@ -1318,6 +1321,7 @@ main (argc, argv
1318 syms_of_fontset (); 1321 syms_of_fontset ();
1319 syms_of_macterm (); 1322 syms_of_macterm ();
1320 syms_of_macmenu (); 1323 syms_of_macmenu ();
1324 syms_of_macselect ();
1321 syms_of_data (); 1325 syms_of_data ();
1322 syms_of_search (); 1326 syms_of_search ();
1323 syms_of_frame (); 1327 syms_of_frame ();
@@ -1637,6 +1641,7 @@ main (argc, argv
1637 syms_of_macterm (); 1641 syms_of_macterm ();
1638 syms_of_macfns (); 1642 syms_of_macfns ();
1639 syms_of_macmenu (); 1643 syms_of_macmenu ();
1644 syms_of_macselect ();
1640 syms_of_fontset (); 1645 syms_of_fontset ();
1641#endif /* MAC_OSX && HAVE_CARBON */ 1646#endif /* MAC_OSX && HAVE_CARBON */
1642 1647
diff --git a/src/eval.c b/src/eval.c
index 8700ca222ce..6832f3197ad 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1,6 +1,6 @@
1/* Evaluator for GNU Emacs Lisp interpreter. 1/* Evaluator for GNU Emacs Lisp interpreter.
2 Copyright (C) 1985, 86, 87, 93, 94, 95, 99, 2000, 2001, 02, 2004 2 Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1999, 2000, 2001,
3 Free Software Foundation, Inc. 3 2002, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -1982,10 +1982,7 @@ do_autoload (fundef, funname)
1982 second = Fcdr (first); 1982 second = Fcdr (first);
1983 first = Fcar (first); 1983 first = Fcar (first);
1984 1984
1985 /* Note: This test is subtle. The cdr of an autoload-queue entry 1985 if (CONSP (second) && EQ (XCAR (second), Qautoload))
1986 may be an atom if the autoload entry was generated by a defalias
1987 or fset. */
1988 if (CONSP (second))
1989 Fput (first, Qautoload, (XCDR (second))); 1986 Fput (first, Qautoload, (XCDR (second)));
1990 1987
1991 queue = XCDR (queue); 1988 queue = XCDR (queue);
diff --git a/src/fileio.c b/src/fileio.c
index 2a2703ba7a1..9ee4d10b081 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -175,6 +175,10 @@ Lisp_Object Vdefault_file_name_coding_system;
175 whose I/O is done with a special handler. */ 175 whose I/O is done with a special handler. */
176Lisp_Object Vfile_name_handler_alist; 176Lisp_Object Vfile_name_handler_alist;
177 177
178/* Property name of a file name handler,
179 which gives a list of operations it handles.. */
180Lisp_Object Qoperations;
181
178/* Lisp functions for translating file formats */ 182/* Lisp functions for translating file formats */
179Lisp_Object Qformat_decode, Qformat_annotate_function; 183Lisp_Object Qformat_decode, Qformat_annotate_function;
180 184
@@ -370,13 +374,16 @@ use the standard functions without calling themselves recursively. */)
370 elt = XCAR (chain); 374 elt = XCAR (chain);
371 if (CONSP (elt)) 375 if (CONSP (elt))
372 { 376 {
373 Lisp_Object string; 377 Lisp_Object string = XCAR (elt);
374 int match_pos; 378 int match_pos;
375 string = XCAR (elt); 379 Lisp_Object handler = XCDR (elt);
380 Lisp_Object operations = Fget (handler, Qoperations);
381
376 if (STRINGP (string) 382 if (STRINGP (string)
377 && (match_pos = fast_string_match (string, filename)) > pos) 383 && (match_pos = fast_string_match (string, filename)) > pos
384 && (NILP (operations) || ! NILP (Fmemq (operation, operations))))
378 { 385 {
379 Lisp_Object handler, tem; 386 Lisp_Object tem;
380 387
381 handler = XCDR (elt); 388 handler = XCDR (elt);
382 tem = Fmemq (handler, inhibited_handlers); 389 tem = Fmemq (handler, inhibited_handlers);
@@ -2393,7 +2400,7 @@ barf_or_query_if_file_exists (absname, querystring, interactive, statptr, quick)
2393 return; 2400 return;
2394} 2401}
2395 2402
2396DEFUN ("copy-file", Fcopy_file, Scopy_file, 2, 4, 2403DEFUN ("copy-file", Fcopy_file, Scopy_file, 2, 5,
2397 "fCopy file: \nGCopy %s to file: \np\nP", 2404 "fCopy file: \nGCopy %s to file: \np\nP",
2398 doc: /* Copy FILE to NEWNAME. Both args must be strings. 2405 doc: /* Copy FILE to NEWNAME. Both args must be strings.
2399If NEWNAME names a directory, copy FILE there. 2406If NEWNAME names a directory, copy FILE there.
@@ -2402,11 +2409,20 @@ unless a third argument OK-IF-ALREADY-EXISTS is supplied and non-nil.
2402A number as third arg means request confirmation if NEWNAME already exists. 2409A number as third arg means request confirmation if NEWNAME already exists.
2403This is what happens in interactive use with M-x. 2410This is what happens in interactive use with M-x.
2404Always sets the file modes of the output file to match the input file. 2411Always sets the file modes of the output file to match the input file.
2412
2405Fourth arg KEEP-TIME non-nil means give the output file the same 2413Fourth arg KEEP-TIME non-nil means give the output file the same
2406last-modified time as the old one. (This works on only some systems.) 2414last-modified time as the old one. (This works on only some systems.)
2407A prefix arg makes KEEP-TIME non-nil. */) 2415
2408 (file, newname, ok_if_already_exists, keep_time) 2416A prefix arg makes KEEP-TIME non-nil.
2409 Lisp_Object file, newname, ok_if_already_exists, keep_time; 2417
2418The optional fifth arg MUSTBENEW, if non-nil, insists on a check
2419for an existing file with the same name. If MUSTBENEW is `excl',
2420that means to get an error if the file already exists; never overwrite.
2421If MUSTBENEW is neither nil nor `excl', that means ask for
2422confirmation before overwriting, but do go ahead and overwrite the file
2423if the user confirms. */)
2424 (file, newname, ok_if_already_exists, keep_time, mustbenew)
2425 Lisp_Object file, newname, ok_if_already_exists, keep_time, mustbenew;
2410{ 2426{
2411 int ifd, ofd, n; 2427 int ifd, ofd, n;
2412 char buf[16 * 1024]; 2428 char buf[16 * 1024];
@@ -2422,6 +2438,9 @@ A prefix arg makes KEEP-TIME non-nil. */)
2422 CHECK_STRING (file); 2438 CHECK_STRING (file);
2423 CHECK_STRING (newname); 2439 CHECK_STRING (newname);
2424 2440
2441 if (!NILP (mustbenew) && !EQ (mustbenew, Qexcl))
2442 barf_or_query_if_file_exists (newname, "overwrite", 1, 0, 1);
2443
2425 if (!NILP (Ffile_directory_p (newname))) 2444 if (!NILP (Ffile_directory_p (newname)))
2426 newname = Fexpand_file_name (Ffile_name_nondirectory (file), newname); 2445 newname = Fexpand_file_name (Ffile_name_nondirectory (file), newname);
2427 else 2446 else
@@ -2522,9 +2541,15 @@ A prefix arg makes KEEP-TIME non-nil. */)
2522#else 2541#else
2523#ifdef MSDOS 2542#ifdef MSDOS
2524 /* System's default file type was set to binary by _fmode in emacs.c. */ 2543 /* System's default file type was set to binary by _fmode in emacs.c. */
2525 ofd = creat (SDATA (encoded_newname), S_IREAD | S_IWRITE); 2544 ofd = emacs_open (SDATA (encoded_newname),
2526#else /* not MSDOS */ 2545 O_WRONLY | O_TRUNC | O_CREAT
2527 ofd = creat (SDATA (encoded_newname), 0666); 2546 | (EQ (mustbenew, Qexcl) ? O_EXCL : 0),
2547 S_IREAD | S_IWRITE);
2548#else /* not MSDOS */
2549 ofd = emacs_open (SDATA (encoded_newname),
2550 O_WRONLY | O_TRUNC | O_CREAT
2551 | (EQ (mustbenew, Qexcl) ? O_EXCL : 0),
2552 0666);
2528#endif /* not MSDOS */ 2553#endif /* not MSDOS */
2529#endif /* VMS */ 2554#endif /* VMS */
2530 if (ofd < 0) 2555 if (ofd < 0)
@@ -2754,7 +2779,8 @@ This is what happens in interactive use with M-x. */)
2754 Fcopy_file (file, newname, 2779 Fcopy_file (file, newname,
2755 /* We have already prompted if it was an integer, 2780 /* We have already prompted if it was an integer,
2756 so don't have copy-file prompt again. */ 2781 so don't have copy-file prompt again. */
2757 NILP (ok_if_already_exists) ? Qnil : Qt, Qt); 2782 NILP (ok_if_already_exists) ? Qnil : Qt,
2783 Qt, Qnil);
2758 Fdelete_file (file); 2784 Fdelete_file (file);
2759 } 2785 }
2760 else 2786 else
@@ -6334,6 +6360,7 @@ init_fileio_once ()
6334void 6360void
6335syms_of_fileio () 6361syms_of_fileio ()
6336{ 6362{
6363 Qoperations = intern ("operations");
6337 Qexpand_file_name = intern ("expand-file-name"); 6364 Qexpand_file_name = intern ("expand-file-name");
6338 Qsubstitute_in_file_name = intern ("substitute-in-file-name"); 6365 Qsubstitute_in_file_name = intern ("substitute-in-file-name");
6339 Qdirectory_file_name = intern ("directory-file-name"); 6366 Qdirectory_file_name = intern ("directory-file-name");
@@ -6368,6 +6395,7 @@ syms_of_fileio ()
6368 Qset_visited_file_modtime = intern ("set-visited-file-modtime"); 6395 Qset_visited_file_modtime = intern ("set-visited-file-modtime");
6369 Qauto_save_coding = intern ("auto-save-coding"); 6396 Qauto_save_coding = intern ("auto-save-coding");
6370 6397
6398 staticpro (&Qoperations);
6371 staticpro (&Qexpand_file_name); 6399 staticpro (&Qexpand_file_name);
6372 staticpro (&Qsubstitute_in_file_name); 6400 staticpro (&Qsubstitute_in_file_name);
6373 staticpro (&Qdirectory_file_name); 6401 staticpro (&Qdirectory_file_name);
diff --git a/src/fns.c b/src/fns.c
index f1788bd88e1..4562eaff02e 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -184,8 +184,7 @@ To get the number of bytes, use `string-bytes'. */)
184 return val; 184 return val;
185} 185}
186 186
187/* This does not check for quits. That is safe 187/* This does not check for quits. That is safe since it must terminate. */
188 since it must terminate. */
189 188
190DEFUN ("safe-length", Fsafe_length, Ssafe_length, 1, 1, 0, 189DEFUN ("safe-length", Fsafe_length, Ssafe_length, 1, 1, 0,
191 doc: /* Return the length of a list, but avoid error or infinite loop. 190 doc: /* Return the length of a list, but avoid error or infinite loop.
@@ -1901,6 +1900,7 @@ merge (org_l1, org_l2, pred)
1901} 1900}
1902 1901
1903 1902
1903#if 0 /* Unsafe version. */
1904DEFUN ("plist-get", Fplist_get, Splist_get, 2, 2, 0, 1904DEFUN ("plist-get", Fplist_get, Splist_get, 2, 2, 0,
1905 doc: /* Extract a value from a property list. 1905 doc: /* Extract a value from a property list.
1906PLIST is a property list, which is a list of the form 1906PLIST is a property list, which is a list of the form
@@ -1931,14 +1931,16 @@ one of the properties on the list. */)
1931 1931
1932 return Qnil; 1932 return Qnil;
1933} 1933}
1934#endif
1935
1936/* This does not check for quits. That is safe since it must terminate. */
1934 1937
1935DEFUN ("safe-plist-get", Fsafe_plist_get, Ssafe_plist_get, 2, 2, 0, 1938DEFUN ("plist-get", Fplist_get, Splist_get, 2, 2, 0,
1936 doc: /* Extract a value from a property list. 1939 doc: /* Extract a value from a property list.
1937PLIST is a property list, which is a list of the form 1940PLIST is a property list, which is a list of the form
1938\(PROP1 VALUE1 PROP2 VALUE2...). This function returns the value 1941\(PROP1 VALUE1 PROP2 VALUE2...). This function returns the value
1939corresponding to the given PROP, or nil if PROP is not 1942corresponding to the given PROP, or nil if PROP is not one of the
1940one of the properties on the list. 1943properties on the list. This function never signals an error. */)
1941This function never signals an error. */)
1942 (plist, prop) 1944 (plist, prop)
1943 Lisp_Object plist; 1945 Lisp_Object plist;
1944 Lisp_Object prop; 1946 Lisp_Object prop;
@@ -1971,18 +1973,6 @@ This is the last value stored with `(put SYMBOL PROPNAME VALUE)'. */)
1971 return Fplist_get (XSYMBOL (symbol)->plist, propname); 1973 return Fplist_get (XSYMBOL (symbol)->plist, propname);
1972} 1974}
1973 1975
1974DEFUN ("safe-get", Fsafe_get, Ssafe_get, 2, 2, 0,
1975 doc: /* Return the value of SYMBOL's PROPNAME property.
1976This is the last value stored with `(put SYMBOL PROPNAME VALUE)'.
1977This function never signals an error. */)
1978 (symbol, propname)
1979 Lisp_Object symbol, propname;
1980{
1981 if (!SYMBOLP (symbol))
1982 return Qnil;
1983 return Fsafe_plist_get (XSYMBOL (symbol)->plist, propname);
1984}
1985
1986DEFUN ("plist-put", Fplist_put, Splist_put, 3, 3, 0, 1976DEFUN ("plist-put", Fplist_put, Splist_put, 3, 3, 0,
1987 doc: /* Change value in PLIST of PROP to VAL. 1977 doc: /* Change value in PLIST of PROP to VAL.
1988PLIST is a property list, which is a list of the form 1978PLIST is a property list, which is a list of the form
@@ -5263,9 +5253,7 @@ used if both `use-dialog-box' and this variable are non-nil. */);
5263 defsubr (&Sreverse); 5253 defsubr (&Sreverse);
5264 defsubr (&Ssort); 5254 defsubr (&Ssort);
5265 defsubr (&Splist_get); 5255 defsubr (&Splist_get);
5266 defsubr (&Ssafe_plist_get);
5267 defsubr (&Sget); 5256 defsubr (&Sget);
5268 defsubr (&Ssafe_get);
5269 defsubr (&Splist_put); 5257 defsubr (&Splist_put);
5270 defsubr (&Sput); 5258 defsubr (&Sput);
5271 defsubr (&Slax_plist_get); 5259 defsubr (&Slax_plist_get);
diff --git a/src/frame.c b/src/frame.c
index f2799206d4c..1a84072b40b 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1260,6 +1260,10 @@ The functions are run with one arg, the frame to be deleted. */)
1260 if (FRAME_X_P (f)) 1260 if (FRAME_X_P (f))
1261 x_clear_frame_selections (f); 1261 x_clear_frame_selections (f);
1262#endif 1262#endif
1263#ifdef MAC_OS
1264 if (FRAME_MAC_P (f))
1265 x_clear_frame_selections (f);
1266#endif
1263 1267
1264 /* Free glyphs. 1268 /* Free glyphs.
1265 This function must be called before the window tree of the 1269 This function must be called before the window tree of the
diff --git a/src/keyboard.c b/src/keyboard.c
index ab8c8907c00..dd4767585b7 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1173,21 +1173,21 @@ cmd_error (data)
1173 cancel_hourglass (); 1173 cancel_hourglass ();
1174#endif 1174#endif
1175 1175
1176 if (!NILP (executing_macro)) 1176 if (!NILP (executing_kbd_macro))
1177 { 1177 {
1178 if (executing_macro_iterations == 1) 1178 if (executing_kbd_macro_iterations == 1)
1179 sprintf (macroerror, "After 1 kbd macro iteration: "); 1179 sprintf (macroerror, "After 1 kbd macro iteration: ");
1180 else 1180 else
1181 sprintf (macroerror, "After %d kbd macro iterations: ", 1181 sprintf (macroerror, "After %d kbd macro iterations: ",
1182 executing_macro_iterations); 1182 executing_kbd_macro_iterations);
1183 } 1183 }
1184 else 1184 else
1185 *macroerror = 0; 1185 *macroerror = 0;
1186 1186
1187 Vstandard_output = Qt; 1187 Vstandard_output = Qt;
1188 Vstandard_input = Qt; 1188 Vstandard_input = Qt;
1189 Vexecuting_macro = Qnil; 1189 Vexecuting_kbd_macro = Qnil;
1190 executing_macro = Qnil; 1190 executing_kbd_macro = Qnil;
1191 current_kboard->Vprefix_arg = Qnil; 1191 current_kboard->Vprefix_arg = Qnil;
1192 current_kboard->Vlast_prefix_arg = Qnil; 1192 current_kboard->Vlast_prefix_arg = Qnil;
1193 cancel_echoing (); 1193 cancel_echoing ();
@@ -1288,7 +1288,7 @@ command_loop ()
1288 { 1288 {
1289 Lisp_Object val; 1289 Lisp_Object val;
1290 val = internal_catch (Qexit, command_loop_2, Qnil); 1290 val = internal_catch (Qexit, command_loop_2, Qnil);
1291 executing_macro = Qnil; 1291 executing_kbd_macro = Qnil;
1292 return val; 1292 return val;
1293 } 1293 }
1294 else 1294 else
@@ -1300,7 +1300,7 @@ command_loop ()
1300 other reason. */ 1300 other reason. */
1301 any_kboard_state (); 1301 any_kboard_state ();
1302 internal_catch (Qtop_level, command_loop_2, Qnil); 1302 internal_catch (Qtop_level, command_loop_2, Qnil);
1303 executing_macro = Qnil; 1303 executing_kbd_macro = Qnil;
1304 1304
1305 /* End of file in -batch run causes exit here. */ 1305 /* End of file in -batch run causes exit here. */
1306 if (noninteractive) 1306 if (noninteractive)
@@ -1453,7 +1453,7 @@ command_loop_1 ()
1453 if (NILP (Vunread_command_events) 1453 if (NILP (Vunread_command_events)
1454 && NILP (Vunread_input_method_events) 1454 && NILP (Vunread_input_method_events)
1455 && NILP (Vunread_post_input_method_events) 1455 && NILP (Vunread_post_input_method_events)
1456 && NILP (Vexecuting_macro) 1456 && NILP (Vexecuting_kbd_macro)
1457 && !NILP (sit_for (0, post_command_idle_delay, 0, 1, 1))) 1457 && !NILP (sit_for (0, post_command_idle_delay, 0, 1, 1)))
1458 safe_run_hooks (Qpost_command_idle_hook); 1458 safe_run_hooks (Qpost_command_idle_hook);
1459 } 1459 }
@@ -1582,11 +1582,11 @@ command_loop_1 ()
1582 } 1582 }
1583 1583
1584 cmd = read_key_sequence_cmd; 1584 cmd = read_key_sequence_cmd;
1585 if (!NILP (Vexecuting_macro)) 1585 if (!NILP (Vexecuting_kbd_macro))
1586 { 1586 {
1587 if (!NILP (Vquit_flag)) 1587 if (!NILP (Vquit_flag))
1588 { 1588 {
1589 Vexecuting_macro = Qt; 1589 Vexecuting_kbd_macro = Qt;
1590 QUIT; /* Make some noise. */ 1590 QUIT; /* Make some noise. */
1591 /* Will return since macro now empty. */ 1591 /* Will return since macro now empty. */
1592 } 1592 }
@@ -1685,7 +1685,7 @@ command_loop_1 ()
1685 && EQ (current_buffer->selective_display, Qnil) 1685 && EQ (current_buffer->selective_display, Qnil)
1686 && !detect_input_pending () 1686 && !detect_input_pending ()
1687 && NILP (XWINDOW (selected_window)->column_number_displayed) 1687 && NILP (XWINDOW (selected_window)->column_number_displayed)
1688 && NILP (Vexecuting_macro)) 1688 && NILP (Vexecuting_kbd_macro))
1689 direct_output_forward_char (1); 1689 direct_output_forward_char (1);
1690 goto directly_done; 1690 goto directly_done;
1691 } 1691 }
@@ -1720,7 +1720,7 @@ command_loop_1 ()
1720 && EQ (current_buffer->selective_display, Qnil) 1720 && EQ (current_buffer->selective_display, Qnil)
1721 && !detect_input_pending () 1721 && !detect_input_pending ()
1722 && NILP (XWINDOW (selected_window)->column_number_displayed) 1722 && NILP (XWINDOW (selected_window)->column_number_displayed)
1723 && NILP (Vexecuting_macro)) 1723 && NILP (Vexecuting_kbd_macro))
1724 direct_output_forward_char (-1); 1724 direct_output_forward_char (-1);
1725 goto directly_done; 1725 goto directly_done;
1726 } 1726 }
@@ -1733,7 +1733,7 @@ command_loop_1 ()
1733 = translate_char (Vtranslation_table_for_input, 1733 = translate_char (Vtranslation_table_for_input,
1734 XFASTINT (last_command_char)); 1734 XFASTINT (last_command_char));
1735 int value; 1735 int value;
1736 if (NILP (Vexecuting_macro) 1736 if (NILP (Vexecuting_kbd_macro)
1737 && !EQ (minibuf_window, selected_window)) 1737 && !EQ (minibuf_window, selected_window))
1738 { 1738 {
1739 if (!nonundocount || nonundocount >= 20) 1739 if (!nonundocount || nonundocount >= 20)
@@ -1755,7 +1755,7 @@ command_loop_1 ()
1755 || !EQ (current_buffer->selective_display, Qnil) 1755 || !EQ (current_buffer->selective_display, Qnil)
1756 || detect_input_pending () 1756 || detect_input_pending ()
1757 || !NILP (XWINDOW (selected_window)->column_number_displayed) 1757 || !NILP (XWINDOW (selected_window)->column_number_displayed)
1758 || !NILP (Vexecuting_macro)); 1758 || !NILP (Vexecuting_kbd_macro));
1759 1759
1760 value = internal_self_insert (c, 0); 1760 value = internal_self_insert (c, 0);
1761 1761
@@ -1783,7 +1783,7 @@ command_loop_1 ()
1783 int scount = SPECPDL_INDEX (); 1783 int scount = SPECPDL_INDEX ();
1784 1784
1785 if (display_hourglass_p 1785 if (display_hourglass_p
1786 && NILP (Vexecuting_macro)) 1786 && NILP (Vexecuting_kbd_macro))
1787 { 1787 {
1788 record_unwind_protect (cancel_hourglass_unwind, Qnil); 1788 record_unwind_protect (cancel_hourglass_unwind, Qnil);
1789 start_hourglass (); 1789 start_hourglass ();
@@ -1801,7 +1801,7 @@ command_loop_1 ()
1801 hourglass cursor anyway. 1801 hourglass cursor anyway.
1802 But don't cancel the hourglass within a macro 1802 But don't cancel the hourglass within a macro
1803 just because a command in the macro finishes. */ 1803 just because a command in the macro finishes. */
1804 if (NILP (Vexecuting_macro)) 1804 if (NILP (Vexecuting_kbd_macro))
1805 unbind_to (scount, Qnil); 1805 unbind_to (scount, Qnil);
1806#endif 1806#endif
1807 } 1807 }
@@ -1827,7 +1827,7 @@ command_loop_1 ()
1827 if (NILP (Vunread_command_events) 1827 if (NILP (Vunread_command_events)
1828 && NILP (Vunread_input_method_events) 1828 && NILP (Vunread_input_method_events)
1829 && NILP (Vunread_post_input_method_events) 1829 && NILP (Vunread_post_input_method_events)
1830 && NILP (Vexecuting_macro) 1830 && NILP (Vexecuting_kbd_macro)
1831 && !NILP (sit_for (0, post_command_idle_delay, 0, 1, 1))) 1831 && !NILP (sit_for (0, post_command_idle_delay, 0, 1, 1)))
1832 safe_run_hooks (Qpost_command_idle_hook); 1832 safe_run_hooks (Qpost_command_idle_hook);
1833 } 1833 }
@@ -2499,7 +2499,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
2499 2499
2500 this_command_key_count_reset = 0; 2500 this_command_key_count_reset = 0;
2501 2501
2502 if (!NILP (Vexecuting_macro)) 2502 if (!NILP (Vexecuting_kbd_macro))
2503 { 2503 {
2504 /* We set this to Qmacro; since that's not a frame, nobody will 2504 /* We set this to Qmacro; since that's not a frame, nobody will
2505 try to switch frames on us, and the selected window will 2505 try to switch frames on us, and the selected window will
@@ -2516,19 +2516,19 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
2516 /* Exit the macro if we are at the end. 2516 /* Exit the macro if we are at the end.
2517 Also, some things replace the macro with t 2517 Also, some things replace the macro with t
2518 to force an early exit. */ 2518 to force an early exit. */
2519 if (EQ (Vexecuting_macro, Qt) 2519 if (EQ (Vexecuting_kbd_macro, Qt)
2520 || executing_macro_index >= XFASTINT (Flength (Vexecuting_macro))) 2520 || executing_kbd_macro_index >= XFASTINT (Flength (Vexecuting_kbd_macro)))
2521 { 2521 {
2522 XSETINT (c, -1); 2522 XSETINT (c, -1);
2523 goto exit; 2523 goto exit;
2524 } 2524 }
2525 2525
2526 c = Faref (Vexecuting_macro, make_number (executing_macro_index)); 2526 c = Faref (Vexecuting_kbd_macro, make_number (executing_kbd_macro_index));
2527 if (STRINGP (Vexecuting_macro) 2527 if (STRINGP (Vexecuting_kbd_macro)
2528 && (XINT (c) & 0x80) && (XUINT (c) <= 0xff)) 2528 && (XINT (c) & 0x80) && (XUINT (c) <= 0xff))
2529 XSETFASTINT (c, CHAR_META | (XINT (c) & ~0x80)); 2529 XSETFASTINT (c, CHAR_META | (XINT (c) & ~0x80));
2530 2530
2531 executing_macro_index++; 2531 executing_kbd_macro_index++;
2532 2532
2533 goto from_macro; 2533 goto from_macro;
2534 } 2534 }
@@ -9815,7 +9815,7 @@ DEFUN ("execute-extended-command", Fexecute_extended_command, Sexecute_extended_
9815 9815
9816 /* If enabled, show which key runs this command. */ 9816 /* If enabled, show which key runs this command. */
9817 if (!NILP (Vsuggest_key_bindings) 9817 if (!NILP (Vsuggest_key_bindings)
9818 && NILP (Vexecuting_macro) 9818 && NILP (Vexecuting_kbd_macro)
9819 && SYMBOLP (function)) 9819 && SYMBOLP (function))
9820 bindings = Fwhere_is_internal (function, Voverriding_local_map, 9820 bindings = Fwhere_is_internal (function, Voverriding_local_map,
9821 Qt, Qnil, Qnil); 9821 Qt, Qnil, Qnil);
diff --git a/src/lisp.h b/src/lisp.h
index 766af053b60..20270bc357e 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2349,7 +2349,6 @@ EXFUN (Fsort, 2);
2349EXFUN (Freverse, 1); 2349EXFUN (Freverse, 1);
2350EXFUN (Fnreverse, 1); 2350EXFUN (Fnreverse, 1);
2351EXFUN (Fget, 2); 2351EXFUN (Fget, 2);
2352EXFUN (Fsafe_get, 2);
2353EXFUN (Fput, 3); 2352EXFUN (Fput, 3);
2354EXFUN (Fequal, 2); 2353EXFUN (Fequal, 2);
2355EXFUN (Ffillarray, 2); 2354EXFUN (Ffillarray, 2);
@@ -2372,7 +2371,6 @@ extern Lisp_Object string_to_multibyte P_ ((Lisp_Object));
2372extern Lisp_Object string_make_unibyte P_ ((Lisp_Object)); 2371extern Lisp_Object string_make_unibyte P_ ((Lisp_Object));
2373EXFUN (Fcopy_alist, 1); 2372EXFUN (Fcopy_alist, 1);
2374EXFUN (Fplist_get, 2); 2373EXFUN (Fplist_get, 2);
2375EXFUN (Fsafe_plist_get, 2);
2376EXFUN (Fplist_put, 3); 2374EXFUN (Fplist_put, 3);
2377EXFUN (Fplist_member, 2); 2375EXFUN (Fplist_member, 2);
2378EXFUN (Frassoc, 2); 2376EXFUN (Frassoc, 2);
diff --git a/src/m/macppc.h b/src/m/macppc.h
index 21ba90ad101..c068fca32a9 100644
--- a/src/m/macppc.h
+++ b/src/m/macppc.h
@@ -86,11 +86,16 @@ Boston, MA 02111-1307, USA. */
86 86
87#ifdef LINUX 87#ifdef LINUX
88#define LINKER $(CC) -nostdlib 88#define LINKER $(CC) -nostdlib
89#define LD_SWITCH_MACHINE -Xlinker -m -Xlinker elf32ppc
90/* s/gnu-linux.h defines this to `-z nocombreloc' which does not work here 89/* s/gnu-linux.h defines this to `-z nocombreloc' which does not work here
91 because prefix-args is not used. */ 90 because prefix-args is not used. */
92#undef LD_SWITCH_SYSTEM_TEMACS 91#undef LD_SWITCH_SYSTEM_TEMACS
93#define LD_SWITCH_MACHINE_TEMACS -Xlinker -znocombreloc 92#define LD_SWITCH_MACHINE_TEMACS -Xlinker -znocombreloc
93#ifdef _ARCH_PPC64
94#undef START_FILES
95#define START_FILES pre-crt0.o /usr/lib64/crt1.o /usr/lib64/crti.o
96#undef LIB_STANDARD
97#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib64/crtn.o
98#endif
94#endif 99#endif
95 100
96#if 0 /* This breaks things on PPC GNU/Linux ecept for Yellowdog, 101#if 0 /* This breaks things on PPC GNU/Linux ecept for Yellowdog,
@@ -105,5 +110,11 @@ Boston, MA 02111-1307, USA. */
105#endif 110#endif
106#endif /* 0 */ 111#endif /* 0 */
107 112
113#ifdef _ARCH_PPC64
114#ifndef _LP64
115#define _LP64
116#endif
117#endif
118
108/* arch-tag: 41913e4e-e7d1-4023-aadb-210cc31712ed 119/* arch-tag: 41913e4e-e7d1-4023-aadb-210cc31712ed
109 (do not change this comment) */ 120 (do not change this comment) */
diff --git a/src/mac.c b/src/mac.c
index 68e3bdfa065..14257fdee94 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -24,19 +24,20 @@ Boston, MA 02111-1307, USA. */
24 24
25#include <stdio.h> 25#include <stdio.h>
26#include <errno.h> 26#include <errno.h>
27#include <time.h>
28 27
29#include "lisp.h" 28#include "lisp.h"
30#include "process.h" 29#include "process.h"
31#include "sysselect.h" 30#undef init_process
32#include "systime.h" 31#include "systime.h"
32#include "sysselect.h"
33#include "blockinput.h" 33#include "blockinput.h"
34#include "charset.h"
35#include "coding.h"
36 34
37#include "macterm.h" 35#include "macterm.h"
38 36
39#ifndef HAVE_CARBON 37#if TARGET_API_MAC_CARBON
38#include "charset.h"
39#include "coding.h"
40#else /* not TARGET_API_MAC_CARBON */
40#include <Files.h> 41#include <Files.h>
41#include <MacTypes.h> 42#include <MacTypes.h>
42#include <TextUtils.h> 43#include <TextUtils.h>
@@ -52,7 +53,7 @@ Boston, MA 02111-1307, USA. */
52#include <Processes.h> 53#include <Processes.h>
53#include <EPPC.h> 54#include <EPPC.h>
54#include <MacLocales.h> 55#include <MacLocales.h>
55#endif /* not HAVE_CARBON */ 56#endif /* not TARGET_API_MAC_CARBON */
56 57
57#include <utime.h> 58#include <utime.h>
58#include <dirent.h> 59#include <dirent.h>
@@ -68,8 +69,6 @@ Boston, MA 02111-1307, USA. */
68#include <unistd.h> 69#include <unistd.h>
69#endif 70#endif
70 71
71Lisp_Object QCLIPBOARD;
72
73/* The system script code. */ 72/* The system script code. */
74static int mac_system_script_code; 73static int mac_system_script_code;
75 74
@@ -331,7 +330,7 @@ cfdata_to_lisp (data)
331{ 330{
332 CFIndex len = CFDataGetLength (data); 331 CFIndex len = CFDataGetLength (data);
333 Lisp_Object result = make_uninit_string (len); 332 Lisp_Object result = make_uninit_string (len);
334 333
335 CFDataGetBytes (data, CFRangeMake (0, len), SDATA (result)); 334 CFDataGetBytes (data, CFRangeMake (0, len), SDATA (result));
336 335
337 return result; 336 return result;
@@ -894,7 +893,7 @@ xrm_q_put_resource (database, quarks, value)
894 if (i < 0) 893 if (i < 0)
895 { 894 {
896 max_nid++; 895 max_nid++;
897 XSETINT (node_id, max_nid); 896 XSETINT (node_id, max_nid);
898 hash_put (h, key, node_id, hash_code); 897 hash_put (h, key, node_id, hash_code);
899 } 898 }
900 else 899 else
@@ -3515,169 +3514,9 @@ DEFUN ("posix-file-name-to-mac", Fposix_file_name_to_mac,
3515} 3514}
3516 3515
3517 3516
3518/* set interprogram-paste-function to mac-paste-function in mac-win.el
3519 to enable Emacs to obtain the contents of the Mac clipboard. */
3520DEFUN ("mac-paste-function", Fmac_paste_function, Smac_paste_function, 0, 0, 0,
3521 doc: /* Return the contents of the Mac clipboard as a string. */)
3522 ()
3523{
3524#if TARGET_API_MAC_CARBON
3525 OSStatus err;
3526 ScrapRef scrap;
3527 ScrapFlavorFlags sff;
3528 Size s;
3529 int i;
3530 char *data;
3531
3532 BLOCK_INPUT;
3533 err = GetCurrentScrap (&scrap);
3534 if (err == noErr)
3535 err = GetScrapFlavorFlags (scrap, kScrapFlavorTypeText, &sff);
3536 if (err == noErr)
3537 err = GetScrapFlavorSize (scrap, kScrapFlavorTypeText, &s);
3538 if (err == noErr && (data = (char*) alloca (s)))
3539 err = GetScrapFlavorData (scrap, kScrapFlavorTypeText, &s, data);
3540 UNBLOCK_INPUT;
3541 if (err != noErr || s == 0)
3542 return Qnil;
3543
3544 /* Emacs expects clipboard contents have Unix-style eol's */
3545 for (i = 0; i < s; i++)
3546 if (data[i] == '\r')
3547 data[i] = '\n';
3548
3549 return make_string (data, s);
3550#else /* not TARGET_API_MAC_CARBON */
3551 Lisp_Object value;
3552 Handle my_handle;
3553 long scrap_offset, rc, i;
3554
3555 my_handle = NewHandle (0); /* allocate 0-length data area */
3556
3557 rc = GetScrap (my_handle, 'TEXT', &scrap_offset);
3558 if (rc < 0)
3559 return Qnil;
3560
3561 HLock (my_handle);
3562
3563 /* Emacs expects clipboard contents have Unix-style eol's */
3564 for (i = 0; i < rc; i++)
3565 if ((*my_handle)[i] == '\r')
3566 (*my_handle)[i] = '\n';
3567
3568 value = make_string (*my_handle, rc);
3569
3570 HUnlock (my_handle);
3571
3572 DisposeHandle (my_handle);
3573
3574 return value;
3575#endif /* not TARGET_API_MAC_CARBON */
3576}
3577
3578
3579/* set interprogram-cut-function to mac-cut-function in mac-win.el
3580 to enable Emacs to write the top of the kill-ring to the Mac clipboard. */
3581DEFUN ("mac-cut-function", Fmac_cut_function, Smac_cut_function, 1, 2, 0,
3582 doc: /* Put the value of the string parameter to the Mac clipboard. */)
3583 (value, push)
3584 Lisp_Object value, push;
3585{
3586 char *buf;
3587 int len, i;
3588
3589 /* fixme: ignore the push flag for now */
3590
3591 CHECK_STRING (value);
3592
3593 len = SCHARS (value);
3594 buf = (char *) alloca (len+1);
3595 bcopy (SDATA (value), buf, len);
3596 buf[len] = '\0';
3597
3598 /* convert to Mac-style eol's before sending to clipboard */
3599 for (i = 0; i < len; i++)
3600 if (buf[i] == '\n')
3601 buf[i] = '\r';
3602
3603#if TARGET_API_MAC_CARBON
3604 {
3605 ScrapRef scrap;
3606
3607 BLOCK_INPUT;
3608 ClearCurrentScrap ();
3609 if (GetCurrentScrap (&scrap) != noErr)
3610 {
3611 UNBLOCK_INPUT;
3612 error ("cannot get current scrap");
3613 }
3614
3615 if (PutScrapFlavor (scrap, kScrapFlavorTypeText, kScrapFlavorMaskNone, len,
3616 buf) != noErr)
3617 {
3618 UNBLOCK_INPUT;
3619 error ("cannot put to scrap");
3620 }
3621 UNBLOCK_INPUT;
3622 }
3623#else /* not TARGET_API_MAC_CARBON */
3624 ZeroScrap ();
3625 PutScrap (len, 'TEXT', buf);
3626#endif /* not TARGET_API_MAC_CARBON */
3627
3628 return Qnil;
3629}
3630
3631
3632DEFUN ("x-selection-exists-p", Fx_selection_exists_p, Sx_selection_exists_p,
3633 0, 1, 0,
3634 doc: /* Whether there is an owner for the given X Selection.
3635The arg should be the name of the selection in question, typically one of
3636the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.
3637\(Those are literal upper-case symbol names, since that's what X expects.)
3638For convenience, the symbol nil is the same as `PRIMARY',
3639and t is the same as `SECONDARY'. */)
3640 (selection)
3641 Lisp_Object selection;
3642{
3643 CHECK_SYMBOL (selection);
3644
3645 /* Return nil for PRIMARY and SECONDARY selections; for CLIPBOARD, check
3646 if the clipboard currently has valid text format contents. */
3647
3648 if (EQ (selection, QCLIPBOARD))
3649 {
3650 Lisp_Object val = Qnil;
3651
3652#if TARGET_API_MAC_CARBON 3517#if TARGET_API_MAC_CARBON
3653 ScrapRef scrap; 3518static Lisp_Object Qxml, Qmime_charset;
3654 ScrapFlavorFlags sff; 3519static Lisp_Object QNFD, QNFKD, QNFC, QNFKC, QHFS_plus_D, QHFS_plus_C;
3655
3656 BLOCK_INPUT;
3657 if (GetCurrentScrap (&scrap) == noErr)
3658 if (GetScrapFlavorFlags (scrap, kScrapFlavorTypeText, &sff) == noErr)
3659 val = Qt;
3660 UNBLOCK_INPUT;
3661#else /* not TARGET_API_MAC_CARBON */
3662 Handle my_handle;
3663 long rc, scrap_offset;
3664
3665 my_handle = NewHandle (0);
3666
3667 rc = GetScrap (my_handle, 'TEXT', &scrap_offset);
3668 if (rc >= 0)
3669 val = Qt;
3670
3671 DisposeHandle (my_handle);
3672#endif /* not TARGET_API_MAC_CARBON */
3673
3674 return val;
3675 }
3676 return Qnil;
3677}
3678
3679#if TARGET_API_MAC_CARBON
3680static Lisp_Object Qxml;
3681 3520
3682DEFUN ("mac-get-preference", Fmac_get_preference, Smac_get_preference, 1, 4, 0, 3521DEFUN ("mac-get-preference", Fmac_get_preference, Smac_get_preference, 1, 4, 0,
3683 doc: /* Return the application preference value for KEY. 3522 doc: /* Return the application preference value for KEY.
@@ -3792,6 +3631,218 @@ otherwise. */)
3792 3631
3793 return result; 3632 return result;
3794} 3633}
3634
3635
3636static CFStringEncoding
3637get_cfstring_encoding_from_lisp (obj)
3638 Lisp_Object obj;
3639{
3640 CFStringRef iana_name;
3641 CFStringEncoding encoding = kCFStringEncodingInvalidId;
3642
3643 if (INTEGERP (obj))
3644 return XINT (obj);
3645
3646 if (SYMBOLP (obj) && !NILP (obj) && !NILP (Fcoding_system_p (obj)))
3647 {
3648 Lisp_Object coding_spec, plist;
3649
3650 coding_spec = Fget (obj, Qcoding_system);
3651 plist = XVECTOR (coding_spec)->contents[3];
3652 obj = Fplist_get (XVECTOR (coding_spec)->contents[3], Qmime_charset);
3653 }
3654
3655 if (SYMBOLP (obj))
3656 obj = SYMBOL_NAME (obj);
3657
3658 if (STRINGP (obj))
3659 {
3660 iana_name = cfstring_create_with_string (obj);
3661 if (iana_name)
3662 {
3663 encoding = CFStringConvertIANACharSetNameToEncoding (iana_name);
3664 CFRelease (iana_name);
3665 }
3666 }
3667
3668 return encoding;
3669}
3670
3671#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
3672static CFStringRef
3673cfstring_create_normalized (str, symbol)
3674 CFStringRef str;
3675 Lisp_Object symbol;
3676{
3677 int form = -1;
3678 TextEncodingVariant variant;
3679 float initial_mag = 0.0;
3680 CFStringRef result = NULL;
3681
3682 if (EQ (symbol, QNFD))
3683 form = kCFStringNormalizationFormD;
3684 else if (EQ (symbol, QNFKD))
3685 form = kCFStringNormalizationFormKD;
3686 else if (EQ (symbol, QNFC))
3687 form = kCFStringNormalizationFormC;
3688 else if (EQ (symbol, QNFKC))
3689 form = kCFStringNormalizationFormKC;
3690 else if (EQ (symbol, QHFS_plus_D))
3691 {
3692 variant = kUnicodeHFSPlusDecompVariant;
3693 initial_mag = 1.5;
3694 }
3695 else if (EQ (symbol, QHFS_plus_C))
3696 {
3697 variant = kUnicodeHFSPlusCompVariant;
3698 initial_mag = 1.0;
3699 }
3700
3701 if (form >= 0)
3702 {
3703 CFMutableStringRef mut_str = CFStringCreateMutableCopy (NULL, 0, str);
3704
3705 if (mut_str)
3706 {
3707 CFStringNormalize (mut_str, form);
3708 result = mut_str;
3709 }
3710 }
3711 else if (initial_mag > 0.0)
3712 {
3713 UnicodeToTextInfo uni = NULL;
3714 UnicodeMapping map;
3715 CFIndex length;
3716 UniChar *in_text, *buffer = NULL, *out_buf = NULL;
3717 OSErr err = noErr;
3718 ByteCount out_read, out_size, out_len;
3719
3720 map.unicodeEncoding = CreateTextEncoding (kTextEncodingUnicodeDefault,
3721 kUnicodeNoSubset,
3722 kTextEncodingDefaultFormat);
3723 map.otherEncoding = CreateTextEncoding (kTextEncodingUnicodeDefault,
3724 variant,
3725 kTextEncodingDefaultFormat);
3726 map.mappingVersion = kUnicodeUseLatestMapping;
3727
3728 length = CFStringGetLength (str);
3729 out_size = (int)((float)length * initial_mag) * sizeof (UniChar);
3730 if (out_size < 32)
3731 out_size = 32;
3732
3733 in_text = (UniChar *)CFStringGetCharactersPtr (str);
3734 if (in_text == NULL)
3735 {
3736 buffer = xmalloc (sizeof (UniChar) * length);
3737 if (buffer)
3738 {
3739 CFStringGetCharacters (str, CFRangeMake (0, length), buffer);
3740 in_text = buffer;
3741 }
3742 }
3743
3744 if (in_text)
3745 err = CreateUnicodeToTextInfo(&map, &uni);
3746 while (err == noErr)
3747 {
3748 out_buf = xmalloc (out_size);
3749 if (out_buf == NULL)
3750 err = mFulErr;
3751 else
3752 err = ConvertFromUnicodeToText (uni, length * sizeof (UniChar),
3753 in_text,
3754 kUnicodeDefaultDirectionMask,
3755 0, NULL, NULL, NULL,
3756 out_size, &out_read, &out_len,
3757 out_buf);
3758 if (err == noErr && out_read < length * sizeof (UniChar))
3759 {
3760 xfree (out_buf);
3761 out_size += length;
3762 }
3763 else
3764 break;
3765 }
3766 if (err == noErr)
3767 result = CFStringCreateWithCharacters (NULL, out_buf,
3768 out_len / sizeof (UniChar));
3769 if (uni)
3770 DisposeUnicodeToTextInfo (&uni);
3771 if (out_buf)
3772 xfree (out_buf);
3773 if (buffer)
3774 xfree (buffer);
3775 }
3776 else
3777 {
3778 result = str;
3779 CFRetain (result);
3780 }
3781
3782 return result;
3783}
3784#endif
3785
3786DEFUN ("mac-code-convert-string", Fmac_code_convert_string, Smac_code_convert_string, 3, 4, 0,
3787 doc: /* Convert STRING from SOURCE encoding to TARGET encoding.
3788The conversion is performed using the converter provided by the system.
3789Each encoding is specified by either a coding system symbol, a mime
3790charset string, or an integer as a CFStringEncoding value.
3791On Mac OS X 10.2 and later, you can do Unicode Normalization by
3792specifying the optional argument NORMALIZATION-FORM with a symbol NFD,
3793NFKD, NFC, NFKC, HFS+D, or HFS+C.
3794On successful conversion, returns the result string, else returns
3795nil. */)
3796 (string, source, target, normalization_form)
3797 Lisp_Object string, source, target, normalization_form;
3798{
3799 Lisp_Object result = Qnil;
3800 CFStringEncoding src_encoding, tgt_encoding;
3801 CFStringRef str = NULL;
3802 CFDataRef data = NULL;
3803
3804 CHECK_STRING (string);
3805 if (!INTEGERP (source) && !STRINGP (source))
3806 CHECK_SYMBOL (source);
3807 if (!INTEGERP (target) && !STRINGP (target))
3808 CHECK_SYMBOL (target);
3809 CHECK_SYMBOL (normalization_form);
3810
3811 BLOCK_INPUT;
3812
3813 src_encoding = get_cfstring_encoding_from_lisp (source);
3814 tgt_encoding = get_cfstring_encoding_from_lisp (target);
3815
3816 string = string_make_unibyte (string);
3817 if (src_encoding != kCFStringEncodingInvalidId
3818 && tgt_encoding != kCFStringEncodingInvalidId)
3819 str = CFStringCreateWithBytes (NULL, SDATA (string), SBYTES (string),
3820 src_encoding, true);
3821#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
3822 if (str)
3823 {
3824 CFStringRef saved_str = str;
3825
3826 str = cfstring_create_normalized (saved_str, normalization_form);
3827 CFRelease (saved_str);
3828 }
3829#endif
3830 if (str)
3831 {
3832 data = CFStringCreateExternalRepresentation (NULL, str,
3833 tgt_encoding, '\0');
3834 CFRelease (str);
3835 }
3836 if (data)
3837 {
3838 result = cfdata_to_lisp (data);
3839 CFRelease (data);
3840 }
3841
3842 UNBLOCK_INPUT;
3843
3844 return result;
3845}
3795#endif /* TARGET_API_MAC_CARBON */ 3846#endif /* TARGET_API_MAC_CARBON */
3796 3847
3797 3848
@@ -4232,9 +4283,6 @@ mac_get_system_locale ()
4232void 4283void
4233syms_of_mac () 4284syms_of_mac ()
4234{ 4285{
4235 QCLIPBOARD = intern ("CLIPBOARD");
4236 staticpro (&QCLIPBOARD);
4237
4238#if TARGET_API_MAC_CARBON 4286#if TARGET_API_MAC_CARBON
4239 Qstring = intern ("string"); staticpro (&Qstring); 4287 Qstring = intern ("string"); staticpro (&Qstring);
4240 Qnumber = intern ("number"); staticpro (&Qnumber); 4288 Qnumber = intern ("number"); staticpro (&Qnumber);
@@ -4246,13 +4294,21 @@ syms_of_mac ()
4246 4294
4247 Qxml = intern ("xml"); 4295 Qxml = intern ("xml");
4248 staticpro (&Qxml); 4296 staticpro (&Qxml);
4297
4298 Qmime_charset = intern ("mime-charset");
4299 staticpro (&Qmime_charset);
4300
4301 QNFD = intern ("NFD"); staticpro (&QNFD);
4302 QNFKD = intern ("NFKD"); staticpro (&QNFKD);
4303 QNFC = intern ("NFC"); staticpro (&QNFC);
4304 QNFKC = intern ("NFKC"); staticpro (&QNFKC);
4305 QHFS_plus_D = intern ("HFS+D"); staticpro (&QHFS_plus_D);
4306 QHFS_plus_C = intern ("HFS+C"); staticpro (&QHFS_plus_C);
4249#endif 4307#endif
4250 4308
4251 defsubr (&Smac_paste_function);
4252 defsubr (&Smac_cut_function);
4253 defsubr (&Sx_selection_exists_p);
4254#if TARGET_API_MAC_CARBON 4309#if TARGET_API_MAC_CARBON
4255 defsubr (&Smac_get_preference); 4310 defsubr (&Smac_get_preference);
4311 defsubr (&Smac_code_convert_string);
4256#endif 4312#endif
4257 defsubr (&Smac_clear_font_name_table); 4313 defsubr (&Smac_clear_font_name_table);
4258 4314
diff --git a/src/macfns.c b/src/macfns.c
index 4247888fb18..75cd7e76576 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -2969,8 +2969,13 @@ If omitted or nil, that stands for the selected frame's display. */)
2969{ 2969{
2970 int mac_major_version; 2970 int mac_major_version;
2971 SInt32 response; 2971 SInt32 response;
2972 OSErr err;
2972 2973
2973 if (Gestalt (gestaltSystemVersion, &response) != noErr) 2974 BLOCK_INPUT;
2975 err = Gestalt (gestaltSystemVersion, &response);
2976 UNBLOCK_INPUT;
2977
2978 if (err != noErr)
2974 error ("Cannot get Mac OS version"); 2979 error ("Cannot get Mac OS version");
2975 2980
2976 mac_major_version = (response >> 8) & 0xff; 2981 mac_major_version = (response >> 8) & 0xff;
diff --git a/src/macgui.h b/src/macgui.h
index 5d4f1894e2e..939496aaeef 100644
--- a/src/macgui.h
+++ b/src/macgui.h
@@ -32,7 +32,9 @@ typedef unsigned long Time;
32#ifdef HAVE_CARBON 32#ifdef HAVE_CARBON
33#undef Z 33#undef Z
34#ifdef MAC_OSX 34#ifdef MAC_OSX
35#if ! HAVE_MKTIME || BROKEN_MKTIME
35#undef mktime 36#undef mktime
37#endif
36#undef DEBUG 38#undef DEBUG
37#undef free 39#undef free
38#undef malloc 40#undef malloc
@@ -43,8 +45,10 @@ typedef unsigned long Time;
43#undef min 45#undef min
44#undef init_process 46#undef init_process
45#include <Carbon/Carbon.h> 47#include <Carbon/Carbon.h>
48#if ! HAVE_MKTIME || BROKEN_MKTIME
46#undef mktime 49#undef mktime
47#define mktime emacs_mktime 50#define mktime emacs_mktime
51#endif
48#undef free 52#undef free
49#define free unexec_free 53#define free unexec_free
50#undef malloc 54#undef malloc
diff --git a/src/macros.c b/src/macros.c
index 09ae87b0a59..8b17c9fb261 100644
--- a/src/macros.c
+++ b/src/macros.c
@@ -31,25 +31,25 @@ Lisp_Object Qexecute_kbd_macro, Qkbd_macro_termination_hook;
31 31
32/* Kbd macro currently being executed (a string or vector). */ 32/* Kbd macro currently being executed (a string or vector). */
33 33
34Lisp_Object Vexecuting_macro; 34Lisp_Object Vexecuting_kbd_macro;
35 35
36/* Index of next character to fetch from that macro. */ 36/* Index of next character to fetch from that macro. */
37 37
38EMACS_INT executing_macro_index; 38EMACS_INT executing_kbd_macro_index;
39 39
40/* Number of successful iterations so far 40/* Number of successful iterations so far
41 for innermost keyboard macro. 41 for innermost keyboard macro.
42 This is not bound at each level, 42 This is not bound at each level,
43 so after an error, it describes the innermost interrupted macro. */ 43 so after an error, it describes the innermost interrupted macro. */
44 44
45int executing_macro_iterations; 45int executing_kbd_macro_iterations;
46 46
47/* This is the macro that was executing. 47/* This is the macro that was executing.
48 This is not bound at each level, 48 This is not bound at each level,
49 so after an error, it describes the innermost interrupted macro. 49 so after an error, it describes the innermost interrupted macro.
50 We use it only as a kind of flag, so no need to protect it. */ 50 We use it only as a kind of flag, so no need to protect it. */
51 51
52Lisp_Object executing_macro; 52Lisp_Object executing_kbd_macro;
53 53
54extern Lisp_Object real_this_command; 54extern Lisp_Object real_this_command;
55 55
@@ -114,7 +114,7 @@ macro before appending to it. */)
114 } 114 }
115 115
116 /* Must convert meta modifier when copying string to vector. */ 116 /* Must convert meta modifier when copying string to vector. */
117 cvt = STRINGP (current_kboard->Vlast_kbd_macro); 117 cvt = STRINGP (current_kboard->Vlast_kbd_macro);
118 for (i = 0; i < len; i++) 118 for (i = 0; i < len; i++)
119 { 119 {
120 Lisp_Object c; 120 Lisp_Object c;
@@ -285,17 +285,17 @@ each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */)
285 return Qnil; 285 return Qnil;
286} 286}
287 287
288/* Restore Vexecuting_macro and executing_macro_index - called when 288/* Restore Vexecuting_kbd_macro and executing_kbd_macro_index.
289 the unwind-protect in Fexecute_kbd_macro gets invoked. */ 289 Called when the unwind-protect in Fexecute_kbd_macro gets invoked. */
290 290
291static Lisp_Object 291static Lisp_Object
292pop_kbd_macro (info) 292pop_kbd_macro (info)
293 Lisp_Object info; 293 Lisp_Object info;
294{ 294{
295 Lisp_Object tem; 295 Lisp_Object tem;
296 Vexecuting_macro = XCAR (info); 296 Vexecuting_kbd_macro = XCAR (info);
297 tem = XCDR (info); 297 tem = XCDR (info);
298 executing_macro_index = XINT (XCAR (tem)); 298 executing_kbd_macro_index = XINT (XCAR (tem));
299 real_this_command = XCDR (tem); 299 real_this_command = XCDR (tem);
300 Frun_hooks (1, &Qkbd_macro_termination_hook); 300 Frun_hooks (1, &Qkbd_macro_termination_hook);
301 return Qnil; 301 return Qnil;
@@ -318,7 +318,7 @@ each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */)
318 struct gcpro gcpro1, gcpro2; 318 struct gcpro gcpro1, gcpro2;
319 int success_count = 0; 319 int success_count = 0;
320 320
321 executing_macro_iterations = 0; 321 executing_kbd_macro_iterations = 0;
322 322
323 if (!NILP (count)) 323 if (!NILP (count))
324 { 324 {
@@ -330,17 +330,17 @@ each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */)
330 if (!STRINGP (final) && !VECTORP (final)) 330 if (!STRINGP (final) && !VECTORP (final))
331 error ("Keyboard macros must be strings or vectors"); 331 error ("Keyboard macros must be strings or vectors");
332 332
333 tem = Fcons (Vexecuting_macro, 333 tem = Fcons (Vexecuting_kbd_macro,
334 Fcons (make_number (executing_macro_index), 334 Fcons (make_number (executing_kbd_macro_index),
335 real_this_command)); 335 real_this_command));
336 record_unwind_protect (pop_kbd_macro, tem); 336 record_unwind_protect (pop_kbd_macro, tem);
337 337
338 GCPRO2 (final, loopfunc); 338 GCPRO2 (final, loopfunc);
339 do 339 do
340 { 340 {
341 Vexecuting_macro = final; 341 Vexecuting_kbd_macro = final;
342 executing_macro = final; 342 executing_kbd_macro = final;
343 executing_macro_index = 0; 343 executing_kbd_macro_index = 0;
344 344
345 current_kboard->Vprefix_arg = Qnil; 345 current_kboard->Vprefix_arg = Qnil;
346 346
@@ -354,16 +354,16 @@ each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */)
354 354
355 command_loop_1 (); 355 command_loop_1 ();
356 356
357 executing_macro_iterations = ++success_count; 357 executing_kbd_macro_iterations = ++success_count;
358 358
359 QUIT; 359 QUIT;
360 } 360 }
361 while (--repeat 361 while (--repeat
362 && (STRINGP (Vexecuting_macro) || VECTORP (Vexecuting_macro))); 362 && (STRINGP (Vexecuting_kbd_macro) || VECTORP (Vexecuting_kbd_macro)));
363 363
364 executing_macro = Qnil; 364 executing_kbd_macro = Qnil;
365 365
366 real_this_command = Vexecuting_macro; 366 real_this_command = Vexecuting_kbd_macro;
367 367
368 UNGCPRO; 368 UNGCPRO;
369 return unbind_to (pdlcount, Qnil); 369 return unbind_to (pdlcount, Qnil);
@@ -372,8 +372,8 @@ each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */)
372void 372void
373init_macros () 373init_macros ()
374{ 374{
375 Vexecuting_macro = Qnil; 375 Vexecuting_kbd_macro = Qnil;
376 executing_macro = Qnil; 376 executing_kbd_macro = Qnil;
377} 377}
378 378
379void 379void
@@ -396,15 +396,13 @@ syms_of_macros ()
396The value is the symbol `append' while appending to the definition of 396The value is the symbol `append' while appending to the definition of
397an existing macro. */); 397an existing macro. */);
398 398
399 DEFVAR_LISP ("executing-macro", &Vexecuting_macro, 399 DEFVAR_LISP ("executing-kbd-macro", &Vexecuting_kbd_macro,
400 doc: /* Currently executing keyboard macro (string or vector); nil if none executing. */); 400 doc: /* Currently executing keyboard macro (string or vector).
401This is nil when not executing a keyboard macro. */);
401 402
402 DEFVAR_INT ("executing-macro-index", &executing_macro_index, 403 DEFVAR_INT ("executing-kbd-macro-index", &executing_kbd_macro_index,
403 doc: /* Index in currently executing keyboard macro; undefined if none executing. */); 404 doc: /* Index in currently executing keyboard macro; undefined if none executing. */);
404 405
405 DEFVAR_LISP_NOPRO ("executing-kbd-macro", &Vexecuting_macro,
406 doc: /* Currently executing keyboard macro (string or vector); nil if none executing. */);
407
408 DEFVAR_KBOARD ("last-kbd-macro", Vlast_kbd_macro, 406 DEFVAR_KBOARD ("last-kbd-macro", Vlast_kbd_macro,
409 doc: /* Last kbd macro defined, as a string or vector; nil if none defined. */); 407 doc: /* Last kbd macro defined, as a string or vector; nil if none defined. */);
410} 408}
diff --git a/src/macros.h b/src/macros.h
index 41a32efe2e0..bf33ea8325b 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -21,24 +21,24 @@ Boston, MA 02111-1307, USA. */
21 21
22/* Kbd macro currently being executed (a string or vector). */ 22/* Kbd macro currently being executed (a string or vector). */
23 23
24extern Lisp_Object Vexecuting_macro; 24extern Lisp_Object Vexecuting_kbd_macro;
25 25
26/* Index of next character to fetch from that macro. */ 26/* Index of next character to fetch from that macro. */
27 27
28extern EMACS_INT executing_macro_index; 28extern EMACS_INT executing_kbd_macro_index;
29 29
30/* Number of successful iterations so far 30/* Number of successful iterations so far
31 for innermost keyboard macro. 31 for innermost keyboard macro.
32 This is not bound at each level, 32 This is not bound at each level,
33 so after an error, it describes the innermost interrupted macro. */ 33 so after an error, it describes the innermost interrupted macro. */
34 34
35extern int executing_macro_iterations; 35extern int executing_kbd_macro_iterations;
36 36
37/* This is the macro that was executing. 37/* This is the macro that was executing.
38 This is not bound at each level, 38 This is not bound at each level,
39 so after an error, it describes the innermost interrupted macro. */ 39 so after an error, it describes the innermost interrupted macro. */
40 40
41extern Lisp_Object executing_macro; 41extern Lisp_Object executing_kbd_macro;
42 42
43/* Finish defining the current keyboard macro. */ 43/* Finish defining the current keyboard macro. */
44 44
diff --git a/src/macselect.c b/src/macselect.c
new file mode 100644
index 00000000000..49246f7eddc
--- /dev/null
+++ b/src/macselect.c
@@ -0,0 +1,1121 @@
1/* Selection processing for Emacs on Mac OS.
2 Copyright (C) 2005 Free Software Foundation, Inc.
3
4This file is part of GNU Emacs.
5
6GNU Emacs is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)
9any later version.
10
11GNU Emacs is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU Emacs; see the file COPYING. If not, write to
18the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19Boston, MA 02111-1307, USA. */
20
21#include <config.h>
22
23#include "lisp.h"
24#include "macterm.h"
25#include "blockinput.h"
26
27#if !TARGET_API_MAC_CARBON
28#include <Endian.h>
29typedef int ScrapRef;
30typedef ResType ScrapFlavorType;
31#endif /* !TARGET_API_MAC_CARBON */
32
33static OSErr get_scrap_from_symbol P_ ((Lisp_Object, int, ScrapRef *));
34static ScrapFlavorType get_flavor_type_from_symbol P_ ((Lisp_Object));
35static int valid_scrap_target_type_p P_ ((Lisp_Object));
36static OSErr clear_scrap P_ ((ScrapRef *));
37static OSErr put_scrap_string P_ ((ScrapRef, Lisp_Object, Lisp_Object));
38static OSErr put_scrap_private_timestamp P_ ((ScrapRef, unsigned long));
39static ScrapFlavorType scrap_has_target_type P_ ((ScrapRef, Lisp_Object));
40static Lisp_Object get_scrap_string P_ ((ScrapRef, Lisp_Object));
41static OSErr get_scrap_private_timestamp P_ ((ScrapRef, unsigned long *));
42static Lisp_Object get_scrap_target_type_list P_ ((ScrapRef));
43static void x_own_selection P_ ((Lisp_Object, Lisp_Object));
44static Lisp_Object x_get_local_selection P_ ((Lisp_Object, Lisp_Object, int));
45static Lisp_Object x_get_foreign_selection P_ ((Lisp_Object,
46 Lisp_Object,
47 Lisp_Object));
48EXFUN (Fx_selection_owner_p, 1);
49#ifdef MAC_OSX
50static OSStatus mac_handle_service_event P_ ((EventHandlerCallRef,
51 EventRef, void *));
52void init_service_handler P_ ((void));
53#endif
54
55Lisp_Object QPRIMARY, QSECONDARY, QTIMESTAMP, QTARGETS;
56
57static Lisp_Object Vx_lost_selection_functions;
58/* Coding system for communicating with other programs via scrap. */
59static Lisp_Object Vselection_coding_system;
60
61/* Coding system for the next communicating with other programs. */
62static Lisp_Object Vnext_selection_coding_system;
63
64static Lisp_Object Qforeign_selection;
65
66/* The timestamp of the last input event Emacs received from the
67 window server. */
68/* Defined in keyboard.c. */
69extern unsigned long last_event_timestamp;
70
71/* This is an association list whose elements are of the form
72 ( SELECTION-NAME SELECTION-VALUE SELECTION-TIMESTAMP FRAME)
73 SELECTION-NAME is a lisp symbol.
74 SELECTION-VALUE is the value that emacs owns for that selection.
75 It may be any kind of Lisp object.
76 SELECTION-TIMESTAMP is the time at which emacs began owning this selection,
77 as a cons of two 16-bit numbers (making a 32 bit time.)
78 FRAME is the frame for which we made the selection.
79 If there is an entry in this alist, and the data for the flavor
80 type SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP in the corresponding scrap
81 (if exists) coincides with SELECTION-TIMESTAMP, then it can be
82 assumed that Emacs owns that selection.
83 The only (eq) parts of this list that are visible from Lisp are the
84 selection-values. */
85static Lisp_Object Vselection_alist;
86
87#define SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP 'Etsp'
88
89/* This is an alist whose CARs are selection-types and whose CDRs are
90 the names of Lisp functions to call to convert the given Emacs
91 selection value to a string representing the given selection type.
92 This is for Lisp-level extension of the emacs selection
93 handling. */
94static Lisp_Object Vselection_converter_alist;
95
96/* A selection name (represented as a Lisp symbol) can be associated
97 with a named scrap via `mac-scrap-name' property. Likewise for a
98 selection type with a scrap flavor type via `mac-ostype'. */
99static Lisp_Object Qmac_scrap_name, Qmac_ostype;
100
101/* Selection name for communication via Services menu. */
102static Lisp_Object Vmac_services_selection;
103
104/* Get a reference to the scrap corresponding to the symbol SYM. The
105 reference is set to *SCRAP, and it becomes NULL if there's no
106 corresponding scrap. Clear the scrap if CLEAR_P is non-zero. */
107
108static OSErr
109get_scrap_from_symbol (sym, clear_p, scrap)
110 Lisp_Object sym;
111 int clear_p;
112 ScrapRef *scrap;
113{
114 OSErr err = noErr;
115 Lisp_Object str = Fget (sym, Qmac_scrap_name);
116
117 if (!STRINGP (str))
118 *scrap = NULL;
119 else
120 {
121#if TARGET_API_MAC_CARBON
122#ifdef MAC_OSX
123 CFStringRef scrap_name = cfstring_create_with_string (str);
124 OptionBits options = (clear_p ? kScrapClearNamedScrap
125 : kScrapGetNamedScrap);
126
127 err = GetScrapByName (scrap_name, options, scrap);
128 CFRelease (scrap_name);
129#else /* !MAC_OSX */
130 if (clear_p)
131 err = ClearCurrentScrap ();
132 if (err == noErr)
133 err = GetCurrentScrap (scrap);
134#endif /* !MAC_OSX */
135#else /* !TARGET_API_MAC_CARBON */
136 if (clear_p)
137 err = ZeroScrap ();
138 if (err == noErr)
139 *scrap = 1;
140#endif /* !TARGET_API_MAC_CARBON */
141 }
142
143 return err;
144}
145
146/* Get a scrap flavor type from the symbol SYM. Return 0 if no
147 corresponding flavor type. */
148
149static ScrapFlavorType
150get_flavor_type_from_symbol (sym)
151 Lisp_Object sym;
152{
153 ScrapFlavorType val;
154 Lisp_Object str = Fget (sym, Qmac_ostype);
155
156 if (STRINGP (str) && SBYTES (str) == 4)
157 return EndianU32_BtoN (*((UInt32 *) SDATA (str)));
158
159 return 0;
160}
161
162/* Check if the symbol SYM has a corresponding scrap flavor type. */
163
164static int
165valid_scrap_target_type_p (sym)
166 Lisp_Object sym;
167{
168 return get_flavor_type_from_symbol (sym) != 0;
169}
170
171/* Clear the scrap whose reference is *SCRAP. */
172
173static INLINE OSErr
174clear_scrap (scrap)
175 ScrapRef *scrap;
176{
177#if TARGET_API_MAC_CARBON
178#ifdef MAC_OSX
179 return ClearScrap (scrap);
180#else
181 return ClearCurrentScrap ();
182#endif
183#else /* !TARGET_API_MAC_CARBON */
184 return ZeroScrap ();
185#endif /* !TARGET_API_MAC_CARBON */
186}
187
188/* Put Lisp String STR to the scrap SCRAP. The target type is
189 specified by TYPE. */
190
191static OSErr
192put_scrap_string (scrap, type, str)
193 ScrapRef scrap;
194 Lisp_Object type, str;
195{
196 ScrapFlavorType flavor_type = get_flavor_type_from_symbol (type);
197
198 if (flavor_type == 0)
199 return noTypeErr;
200
201#if TARGET_API_MAC_CARBON
202 return PutScrapFlavor (scrap, flavor_type, kScrapFlavorMaskNone,
203 SBYTES (str), SDATA (str));
204#else /* !TARGET_API_MAC_CARBON */
205 return PutScrap (SBYTES (str), flavor_type, SDATA (str));
206#endif /* !TARGET_API_MAC_CARBON */
207}
208
209/* Put TIMESTAMP to the scrap SCRAP. The timestamp is used for
210 checking if the scrap is owned by the process. */
211
212static INLINE OSErr
213put_scrap_private_timestamp (scrap, timestamp)
214 ScrapRef scrap;
215 unsigned long timestamp;
216{
217#if TARGET_API_MAC_CARBON
218 return PutScrapFlavor (scrap, SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP,
219 kScrapFlavorMaskSenderOnly,
220 sizeof (timestamp), &timestamp);
221#else /* !TARGET_API_MAC_CARBON */
222 return PutScrap (sizeof (timestamp), SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP,
223 &timestamp);
224#endif /* !TARGET_API_MAC_CARBON */
225}
226
227/* Check if data for the target type TYPE is available in SCRAP. */
228
229static ScrapFlavorType
230scrap_has_target_type (scrap, type)
231 ScrapRef scrap;
232 Lisp_Object type;
233{
234 OSErr err;
235 ScrapFlavorType flavor_type = get_flavor_type_from_symbol (type);
236
237 if (flavor_type)
238 {
239#if TARGET_API_MAC_CARBON
240 ScrapFlavorFlags flags;
241
242 err = GetScrapFlavorFlags (scrap, flavor_type, &flags);
243 if (err != noErr)
244 flavor_type = 0;
245#else /* !TARGET_API_MAC_CARBON */
246 SInt32 size, offset;
247
248 size = GetScrap (NULL, flavor_type, &offset);
249 if (size < 0)
250 flavor_type = 0;
251#endif /* !TARGET_API_MAC_CARBON */
252 }
253
254 return flavor_type;
255}
256
257/* Get data for the target type TYPE from SCRAP and create a Lisp
258 string. Return nil if failed to get data. */
259
260static Lisp_Object
261get_scrap_string (scrap, type)
262 ScrapRef scrap;
263 Lisp_Object type;
264{
265 OSErr err;
266 Lisp_Object result = Qnil;
267 ScrapFlavorType flavor_type = get_flavor_type_from_symbol (type);
268#if TARGET_API_MAC_CARBON
269 Size size;
270
271 if (flavor_type)
272 {
273 err = GetScrapFlavorSize (scrap, flavor_type, &size);
274 if (err == noErr)
275 {
276 do
277 {
278 result = make_uninit_string (size);
279 err = GetScrapFlavorData (scrap, flavor_type,
280 &size, SDATA (result));
281 if (err != noErr)
282 result = Qnil;
283 else if (size < SBYTES (result))
284 result = make_unibyte_string (SDATA (result), size);
285 }
286 while (STRINGP (result) && size > SBYTES (result));
287 }
288 }
289#else
290 Handle handle;
291 SInt32 size, offset;
292
293 if (flavor_type)
294 size = GetScrap (NULL, flavor_type, &offset);
295 if (size >= 0)
296 {
297 handle = NewHandle (size);
298 HLock (handle);
299 size = GetScrap (handle, flavor_type, &offset);
300 if (size >= 0)
301 result = make_unibyte_string (*handle, size);
302 DisposeHandle (handle);
303 }
304#endif
305
306 return result;
307}
308
309/* Get timestamp from the scrap SCRAP and set to *TIMPSTAMP. */
310
311static OSErr
312get_scrap_private_timestamp (scrap, timestamp)
313 ScrapRef scrap;
314 unsigned long *timestamp;
315{
316 OSErr err = noErr;
317#if TARGET_API_MAC_CARBON
318 ScrapFlavorFlags flags;
319
320 err = GetScrapFlavorFlags (scrap, SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP, &flags);
321 if (err == noErr)
322 if (!(flags & kScrapFlavorMaskSenderOnly))
323 err = noTypeErr;
324 else
325 {
326 Size size = sizeof (*timestamp);
327
328 err = GetScrapFlavorData (scrap, SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP,
329 &size, timestamp);
330 if (err == noErr && size != sizeof (*timestamp))
331 err = noTypeErr;
332 }
333#else /* !TARGET_API_MAC_CARBON */
334 Handle handle;
335 SInt32 size, offset;
336
337 size = GetScrap (NULL, SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP, &offset);
338 if (size == sizeof (*timestamp))
339 {
340 handle = NewHandle (size);
341 HLock (handle);
342 size = GetScrap (handle, SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP, &offset);
343 if (size == sizeof (*timestamp))
344 *timestamp = *((unsigned long *) *handle);
345 DisposeHandle (handle);
346 }
347 if (size != sizeof (*timestamp))
348 err = noTypeErr;
349#endif /* !TARGET_API_MAC_CARBON */
350
351 return err;
352}
353
354/* Get the list of target types in SCRAP. The return value is a list
355 of target type symbols possibly followed by scrap flavor type
356 strings. */
357
358static Lisp_Object
359get_scrap_target_type_list (scrap)
360 ScrapRef scrap;
361{
362 Lisp_Object result = Qnil, rest, target_type;
363#if TARGET_API_MAC_CARBON
364 OSErr err;
365 UInt32 count, i, type;
366 ScrapFlavorInfo *flavor_info = NULL;
367 Lisp_Object strings = Qnil;
368
369 err = GetScrapFlavorCount (scrap, &count);
370 if (err == noErr)
371 flavor_info = xmalloc (sizeof (ScrapFlavorInfo) * count);
372 if (err == noErr && flavor_info)
373 {
374 err = GetScrapFlavorInfoList (scrap, &count, flavor_info);
375 if (err != noErr)
376 {
377 xfree (flavor_info);
378 flavor_info = NULL;
379 }
380 }
381#endif
382 for (rest = Vselection_converter_alist; CONSP (rest); rest = XCDR (rest))
383 {
384 ScrapFlavorType flavor_type = 0;
385
386 if (CONSP (XCAR (rest)) && SYMBOLP (target_type = XCAR (XCAR (rest)))
387 && (flavor_type = scrap_has_target_type (scrap, target_type)))
388 {
389 result = Fcons (target_type, result);
390#if TARGET_API_MAC_CARBON
391 for (i = 0; i < count; i++)
392 if (flavor_info[i].flavorType == flavor_type)
393 {
394 flavor_info[i].flavorType = 0;
395 break;
396 }
397#endif
398 }
399 }
400#if TARGET_API_MAC_CARBON
401 if (flavor_info)
402 {
403 for (i = 0; i < count; i++)
404 if (flavor_info[i].flavorType)
405 {
406 type = EndianU32_NtoB (flavor_info[i].flavorType);
407 strings = Fcons (make_unibyte_string ((char *) &type, 4), strings);
408 }
409 result = nconc2 (result, strings);
410 xfree (flavor_info);
411 }
412#endif
413
414 return result;
415}
416
417/* Do protocol to assert ourself as a selection owner.
418 Update the Vselection_alist so that we can reply to later requests for
419 our selection. */
420
421static void
422x_own_selection (selection_name, selection_value)
423 Lisp_Object selection_name, selection_value;
424{
425 OSErr err;
426 ScrapRef scrap;
427 struct gcpro gcpro1, gcpro2;
428 Lisp_Object rest, handler_fn, value, type;
429 int count;
430
431 CHECK_SYMBOL (selection_name);
432
433 GCPRO2 (selection_name, selection_value);
434
435 BLOCK_INPUT;
436
437 err = get_scrap_from_symbol (selection_name, 1, &scrap);
438 if (err == noErr && scrap)
439 {
440 /* Don't allow a quit within the converter.
441 When the user types C-g, he would be surprised
442 if by luck it came during a converter. */
443 count = SPECPDL_INDEX ();
444 specbind (Qinhibit_quit, Qt);
445
446 for (rest = Vselection_converter_alist; CONSP (rest); rest = XCDR (rest))
447 {
448 if (!(CONSP (XCAR (rest))
449 && SYMBOLP (type = XCAR (XCAR (rest)))
450 && valid_scrap_target_type_p (type)
451 && SYMBOLP (handler_fn = XCDR (XCAR (rest)))))
452 continue;
453
454 if (!NILP (handler_fn))
455 value = call3 (handler_fn, selection_name,
456 type, selection_value);
457
458 if (CONSP (value)
459 && EQ (XCAR (value), type)
460 && STRINGP (XCDR (value)))
461 err = put_scrap_string (scrap, type, XCDR (value));
462 }
463
464 unbind_to (count, Qnil);
465
466 if (err == noErr)
467 err = put_scrap_private_timestamp (scrap, last_event_timestamp);
468 }
469
470 UNBLOCK_INPUT;
471
472 UNGCPRO;
473
474 if (scrap && err != noErr)
475 error ("Can't set selection");
476
477 /* Now update the local cache */
478 {
479 Lisp_Object selection_time;
480 Lisp_Object selection_data;
481 Lisp_Object prev_value;
482
483 selection_time = long_to_cons (last_event_timestamp);
484 selection_data = Fcons (selection_name,
485 Fcons (selection_value,
486 Fcons (selection_time,
487 Fcons (selected_frame, Qnil))));
488 prev_value = assq_no_quit (selection_name, Vselection_alist);
489
490 Vselection_alist = Fcons (selection_data, Vselection_alist);
491
492 /* If we already owned the selection, remove the old selection data.
493 Perhaps we should destructively modify it instead.
494 Don't use Fdelq as that may QUIT. */
495 if (!NILP (prev_value))
496 {
497 Lisp_Object rest; /* we know it's not the CAR, so it's easy. */
498 for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest))
499 if (EQ (prev_value, Fcar (XCDR (rest))))
500 {
501 XSETCDR (rest, Fcdr (XCDR (rest)));
502 break;
503 }
504 }
505 }
506}
507
508/* Given a selection-name and desired type, look up our local copy of
509 the selection value and convert it to the type.
510 The value is nil or a string.
511 This function is used both for remote requests (LOCAL_REQUEST is zero)
512 and for local x-get-selection-internal (LOCAL_REQUEST is nonzero).
513
514 This calls random Lisp code, and may signal or gc. */
515
516static Lisp_Object
517x_get_local_selection (selection_symbol, target_type, local_request)
518 Lisp_Object selection_symbol, target_type;
519 int local_request;
520{
521 Lisp_Object local_value;
522 Lisp_Object handler_fn, value, type, check;
523 int count;
524
525 if (NILP (Fx_selection_owner_p (selection_symbol)))
526 return Qnil;
527
528 local_value = assq_no_quit (selection_symbol, Vselection_alist);
529
530 /* TIMESTAMP is a special case 'cause that's easiest. */
531 if (EQ (target_type, QTIMESTAMP))
532 {
533 handler_fn = Qnil;
534 value = XCAR (XCDR (XCDR (local_value)));
535 }
536#if 0
537 else if (EQ (target_type, QDELETE))
538 {
539 handler_fn = Qnil;
540 Fx_disown_selection_internal
541 (selection_symbol,
542 XCAR (XCDR (XCDR (local_value))));
543 value = QNULL;
544 }
545#endif
546 else
547 {
548 /* Don't allow a quit within the converter.
549 When the user types C-g, he would be surprised
550 if by luck it came during a converter. */
551 count = SPECPDL_INDEX ();
552 specbind (Qinhibit_quit, Qt);
553
554 CHECK_SYMBOL (target_type);
555 handler_fn = Fcdr (Fassq (target_type, Vselection_converter_alist));
556 /* gcpro is not needed here since nothing but HANDLER_FN
557 is live, and that ought to be a symbol. */
558
559 if (!NILP (handler_fn))
560 value = call3 (handler_fn,
561 selection_symbol, (local_request ? Qnil : target_type),
562 XCAR (XCDR (local_value)));
563 else
564 value = Qnil;
565 unbind_to (count, Qnil);
566 }
567
568 /* Make sure this value is of a type that we could transmit
569 to another X client. */
570
571 check = value;
572 if (CONSP (value)
573 && SYMBOLP (XCAR (value)))
574 type = XCAR (value),
575 check = XCDR (value);
576
577 if (STRINGP (check)
578 || VECTORP (check)
579 || SYMBOLP (check)
580 || INTEGERP (check)
581 || NILP (value))
582 return value;
583 /* Check for a value that cons_to_long could handle. */
584 else if (CONSP (check)
585 && INTEGERP (XCAR (check))
586 && (INTEGERP (XCDR (check))
587 ||
588 (CONSP (XCDR (check))
589 && INTEGERP (XCAR (XCDR (check)))
590 && NILP (XCDR (XCDR (check))))))
591 return value;
592 else
593 return
594 Fsignal (Qerror,
595 Fcons (build_string ("invalid data returned by selection-conversion function"),
596 Fcons (handler_fn, Fcons (value, Qnil))));
597}
598
599
600/* Clear all selections that were made from frame F.
601 We do this when about to delete a frame. */
602
603void
604x_clear_frame_selections (f)
605 FRAME_PTR f;
606{
607 Lisp_Object frame;
608 Lisp_Object rest;
609
610 XSETFRAME (frame, f);
611
612 /* Otherwise, we're really honest and truly being told to drop it.
613 Don't use Fdelq as that may QUIT;. */
614
615 /* Delete elements from the beginning of Vselection_alist. */
616 while (!NILP (Vselection_alist)
617 && EQ (frame, Fcar (Fcdr (Fcdr (Fcdr (Fcar (Vselection_alist)))))))
618 {
619 /* Let random Lisp code notice that the selection has been stolen. */
620 Lisp_Object hooks, selection_symbol;
621
622 hooks = Vx_lost_selection_functions;
623 selection_symbol = Fcar (Fcar (Vselection_alist));
624
625 if (!EQ (hooks, Qunbound))
626 {
627 for (; CONSP (hooks); hooks = Fcdr (hooks))
628 call1 (Fcar (hooks), selection_symbol);
629#if 0 /* This can crash when deleting a frame
630 from x_connection_closed. Anyway, it seems unnecessary;
631 something else should cause a redisplay. */
632 redisplay_preserve_echo_area (21);
633#endif
634 }
635
636 Vselection_alist = Fcdr (Vselection_alist);
637 }
638
639 /* Delete elements after the beginning of Vselection_alist. */
640 for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest))
641 if (EQ (frame, Fcar (Fcdr (Fcdr (Fcdr (Fcar (XCDR (rest))))))))
642 {
643 /* Let random Lisp code notice that the selection has been stolen. */
644 Lisp_Object hooks, selection_symbol;
645
646 hooks = Vx_lost_selection_functions;
647 selection_symbol = Fcar (Fcar (XCDR (rest)));
648
649 if (!EQ (hooks, Qunbound))
650 {
651 for (; CONSP (hooks); hooks = Fcdr (hooks))
652 call1 (Fcar (hooks), selection_symbol);
653#if 0 /* See above */
654 redisplay_preserve_echo_area (22);
655#endif
656 }
657 XSETCDR (rest, Fcdr (XCDR (rest)));
658 break;
659 }
660}
661
662/* Do protocol to read selection-data from the server.
663 Converts this to Lisp data and returns it. */
664
665static Lisp_Object
666x_get_foreign_selection (selection_symbol, target_type, time_stamp)
667 Lisp_Object selection_symbol, target_type, time_stamp;
668{
669 OSErr err;
670 ScrapRef scrap;
671 Lisp_Object result = Qnil;
672
673 BLOCK_INPUT;
674
675 err = get_scrap_from_symbol (selection_symbol, 0, &scrap);
676 if (err == noErr && scrap)
677 if (EQ (target_type, QTARGETS))
678 {
679 result = get_scrap_target_type_list (scrap);
680 result = Fvconcat (1, &result);
681 }
682 else
683 {
684 result = get_scrap_string (scrap, target_type);
685 if (STRINGP (result))
686 Fput_text_property (make_number (0), make_number (SBYTES (result)),
687 Qforeign_selection, target_type, result);
688 }
689
690 UNBLOCK_INPUT;
691
692 return result;
693}
694
695
696DEFUN ("x-own-selection-internal", Fx_own_selection_internal,
697 Sx_own_selection_internal, 2, 2, 0,
698 doc: /* Assert a selection of the given TYPE with the given VALUE.
699TYPE is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.
700VALUE is typically a string, or a cons of two markers, but may be
701anything that the functions on `selection-converter-alist' know about. */)
702 (selection_name, selection_value)
703 Lisp_Object selection_name, selection_value;
704{
705 check_mac ();
706 CHECK_SYMBOL (selection_name);
707 if (NILP (selection_value)) error ("selection-value may not be nil");
708 x_own_selection (selection_name, selection_value);
709 return selection_value;
710}
711
712
713/* Request the selection value from the owner. If we are the owner,
714 simply return our selection value. If we are not the owner, this
715 will block until all of the data has arrived. */
716
717DEFUN ("x-get-selection-internal", Fx_get_selection_internal,
718 Sx_get_selection_internal, 2, 3, 0,
719 doc: /* Return text selected from some Mac window.
720SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.
721TYPE is the type of data desired, typically `STRING'.
722TIME_STAMP is ignored on Mac. */)
723 (selection_symbol, target_type, time_stamp)
724 Lisp_Object selection_symbol, target_type, time_stamp;
725{
726 Lisp_Object val = Qnil;
727 struct gcpro gcpro1, gcpro2;
728 GCPRO2 (target_type, val); /* we store newly consed data into these */
729 check_mac ();
730 CHECK_SYMBOL (selection_symbol);
731 CHECK_SYMBOL (target_type);
732
733 val = x_get_local_selection (selection_symbol, target_type, 1);
734
735 if (NILP (val))
736 {
737 val = x_get_foreign_selection (selection_symbol, target_type, time_stamp);
738 goto DONE;
739 }
740
741 if (CONSP (val)
742 && SYMBOLP (XCAR (val)))
743 {
744 val = XCDR (val);
745 if (CONSP (val) && NILP (XCDR (val)))
746 val = XCAR (val);
747 }
748 DONE:
749 UNGCPRO;
750 return val;
751}
752
753DEFUN ("x-disown-selection-internal", Fx_disown_selection_internal,
754 Sx_disown_selection_internal, 1, 2, 0,
755 doc: /* If we own the selection SELECTION, disown it.
756Disowning it means there is no such selection. */)
757 (selection, time)
758 Lisp_Object selection;
759 Lisp_Object time;
760{
761 OSErr err;
762 ScrapRef scrap;
763 Lisp_Object local_selection_data;
764
765 check_mac ();
766 CHECK_SYMBOL (selection);
767
768 if (NILP (Fx_selection_owner_p (selection)))
769 return Qnil; /* Don't disown the selection when we're not the owner. */
770
771 local_selection_data = assq_no_quit (selection, Vselection_alist);
772
773 /* Don't use Fdelq as that may QUIT;. */
774
775 if (EQ (local_selection_data, Fcar (Vselection_alist)))
776 Vselection_alist = Fcdr (Vselection_alist);
777 else
778 {
779 Lisp_Object rest;
780 for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest))
781 if (EQ (local_selection_data, Fcar (XCDR (rest))))
782 {
783 XSETCDR (rest, Fcdr (XCDR (rest)));
784 break;
785 }
786 }
787
788 /* Let random lisp code notice that the selection has been stolen. */
789
790 {
791 Lisp_Object rest;
792 rest = Vx_lost_selection_functions;
793 if (!EQ (rest, Qunbound))
794 {
795 for (; CONSP (rest); rest = Fcdr (rest))
796 call1 (Fcar (rest), selection);
797 prepare_menu_bars ();
798 redisplay_preserve_echo_area (20);
799 }
800 }
801
802 BLOCK_INPUT;
803
804 err = get_scrap_from_symbol (selection, 0, &scrap);
805 if (err == noErr && scrap)
806 clear_scrap (&scrap);
807
808 UNBLOCK_INPUT;
809
810 return Qt;
811}
812
813
814DEFUN ("x-selection-owner-p", Fx_selection_owner_p, Sx_selection_owner_p,
815 0, 1, 0,
816 doc: /* Whether the current Emacs process owns the given Selection.
817The arg should be the name of the selection in question, typically one of
818the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.
819For convenience, the symbol nil is the same as `PRIMARY',
820and t is the same as `SECONDARY'. */)
821 (selection)
822 Lisp_Object selection;
823{
824 OSErr err;
825 ScrapRef scrap;
826 Lisp_Object result = Qnil, local_selection_data;
827
828 check_mac ();
829 CHECK_SYMBOL (selection);
830 if (EQ (selection, Qnil)) selection = QPRIMARY;
831 if (EQ (selection, Qt)) selection = QSECONDARY;
832
833 local_selection_data = assq_no_quit (selection, Vselection_alist);
834
835 if (NILP (local_selection_data))
836 return Qnil;
837
838 BLOCK_INPUT;
839
840 err = get_scrap_from_symbol (selection, 0, &scrap);
841 if (err == noErr && scrap)
842 {
843 unsigned long timestamp;
844
845 err = get_scrap_private_timestamp (scrap, &timestamp);
846 if (err == noErr
847 && (timestamp
848 == cons_to_long (XCAR (XCDR (XCDR (local_selection_data))))))
849 result = Qt;
850 }
851 else
852 result = Qt;
853
854 UNBLOCK_INPUT;
855
856 return result;
857}
858
859DEFUN ("x-selection-exists-p", Fx_selection_exists_p, Sx_selection_exists_p,
860 0, 1, 0,
861 doc: /* Whether there is an owner for the given Selection.
862The arg should be the name of the selection in question, typically one of
863the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.
864For convenience, the symbol nil is the same as `PRIMARY',
865and t is the same as `SECONDARY'. */)
866 (selection)
867 Lisp_Object selection;
868{
869 OSErr err;
870 ScrapRef scrap;
871 Lisp_Object result = Qnil, rest;
872
873 /* It should be safe to call this before we have an Mac frame. */
874 if (! FRAME_MAC_P (SELECTED_FRAME ()))
875 return Qnil;
876
877 CHECK_SYMBOL (selection);
878 if (!NILP (Fx_selection_owner_p (selection)))
879 return Qt;
880 if (EQ (selection, Qnil)) selection = QPRIMARY;
881 if (EQ (selection, Qt)) selection = QSECONDARY;
882
883 BLOCK_INPUT;
884
885 err = get_scrap_from_symbol (selection, 0, &scrap);
886 if (err == noErr && scrap)
887 for (rest = Vselection_converter_alist; CONSP (rest); rest = XCDR (rest))
888 {
889 if (CONSP (XCAR (rest)) && SYMBOLP (XCAR (XCAR (rest)))
890 && scrap_has_target_type (scrap, XCAR (XCAR (rest))))
891 {
892 result = Qt;
893 break;
894 }
895 }
896
897 UNBLOCK_INPUT;
898
899 return result;
900}
901
902
903#ifdef MAC_OSX
904void
905init_service_handler ()
906{
907 EventTypeSpec specs[] = {{kEventClassService, kEventServiceGetTypes},
908 {kEventClassService, kEventServiceCopy},
909 {kEventClassService, kEventServicePaste},
910 {kEventClassService, kEventServicePerform}};
911 InstallApplicationEventHandler (NewEventHandlerUPP (mac_handle_service_event),
912 GetEventTypeCount (specs), specs, NULL, NULL);
913}
914
915extern void mac_store_services_event P_ ((EventRef));
916
917static OSStatus
918mac_handle_service_event (call_ref, event, data)
919 EventHandlerCallRef call_ref;
920 EventRef event;
921 void *data;
922{
923 OSStatus err = noErr;
924 ScrapRef cur_scrap;
925
926 /* Check if Vmac_services_selection is a valid selection that has a
927 corresponding scrap. */
928 if (!SYMBOLP (Vmac_services_selection))
929 err = eventNotHandledErr;
930 else
931 err = get_scrap_from_symbol (Vmac_services_selection, 0, &cur_scrap);
932 if (!(err == noErr && cur_scrap))
933 return eventNotHandledErr;
934
935 switch (GetEventKind (event))
936 {
937 case kEventServiceGetTypes:
938 {
939 CFMutableArrayRef copy_types, paste_types;
940 CFStringRef type;
941 Lisp_Object rest;
942 ScrapFlavorType flavor_type;
943
944 /* Set paste types. */
945 err = GetEventParameter (event, kEventParamServicePasteTypes,
946 typeCFMutableArrayRef, NULL,
947 sizeof (CFMutableArrayRef), NULL,
948 &paste_types);
949 if (err == noErr)
950 for (rest = Vselection_converter_alist; CONSP (rest);
951 rest = XCDR (rest))
952 if (CONSP (XCAR (rest)) && SYMBOLP (XCAR (XCAR (rest)))
953 && (flavor_type =
954 get_flavor_type_from_symbol (XCAR (XCAR (rest)))))
955 {
956 type = CreateTypeStringWithOSType (flavor_type);
957 if (type)
958 {
959 CFArrayAppendValue (paste_types, type);
960 CFRelease (type);
961 }
962 }
963
964 /* Set copy types. */
965 err = GetEventParameter (event, kEventParamServiceCopyTypes,
966 typeCFMutableArrayRef, NULL,
967 sizeof (CFMutableArrayRef), NULL,
968 &copy_types);
969 if (err == noErr
970 && !NILP (Fx_selection_owner_p (Vmac_services_selection)))
971 for (rest = get_scrap_target_type_list (cur_scrap);
972 CONSP (rest) && SYMBOLP (XCAR (rest)); rest = XCDR (rest))
973 {
974 flavor_type = get_flavor_type_from_symbol (XCAR (rest));
975 if (flavor_type)
976 {
977 type = CreateTypeStringWithOSType (flavor_type);
978 if (type)
979 {
980 CFArrayAppendValue (copy_types, type);
981 CFRelease (type);
982 }
983 }
984 }
985 }
986 break;
987
988 case kEventServiceCopy:
989 {
990 ScrapRef specific_scrap;
991 Lisp_Object rest, data;
992
993 err = GetEventParameter (event, kEventParamScrapRef,
994 typeScrapRef, NULL,
995 sizeof (ScrapRef), NULL, &specific_scrap);
996 if (err == noErr
997 && !NILP (Fx_selection_owner_p (Vmac_services_selection)))
998 for (rest = get_scrap_target_type_list (cur_scrap);
999 CONSP (rest) && SYMBOLP (XCAR (rest)); rest = XCDR (rest))
1000 {
1001 data = get_scrap_string (cur_scrap, XCAR (rest));
1002 if (STRINGP (data))
1003 err = put_scrap_string (specific_scrap, XCAR (rest), data);
1004 }
1005 else
1006 err = eventNotHandledErr;
1007 }
1008 break;
1009
1010 case kEventServicePaste:
1011 case kEventServicePerform:
1012 {
1013 ScrapRef specific_scrap;
1014 Lisp_Object rest, data;
1015 int data_exists_p = 0;
1016
1017 err = GetEventParameter (event, kEventParamScrapRef, typeScrapRef,
1018 NULL, sizeof (ScrapRef), NULL,
1019 &specific_scrap);
1020 if (err == noErr)
1021 err = clear_scrap (&cur_scrap);
1022 if (err == noErr)
1023 for (rest = Vselection_converter_alist; CONSP (rest);
1024 rest = XCDR (rest))
1025 {
1026 if (! (CONSP (XCAR (rest)) && SYMBOLP (XCAR (XCAR (rest)))))
1027 continue;
1028 data = get_scrap_string (specific_scrap, XCAR (XCAR (rest)));
1029 if (STRINGP (data))
1030 {
1031 err = put_scrap_string (cur_scrap, XCAR (XCAR (rest)),
1032 data);
1033 if (err != noErr)
1034 break;
1035 data_exists_p = 1;
1036 }
1037 }
1038 if (err == noErr)
1039 if (data_exists_p)
1040 mac_store_application_menu_event (event);
1041 else
1042 err = eventNotHandledErr;
1043 }
1044 break;
1045 }
1046
1047 return err;
1048}
1049#endif
1050
1051
1052void
1053syms_of_macselect ()
1054{
1055 defsubr (&Sx_get_selection_internal);
1056 defsubr (&Sx_own_selection_internal);
1057 defsubr (&Sx_disown_selection_internal);
1058 defsubr (&Sx_selection_owner_p);
1059 defsubr (&Sx_selection_exists_p);
1060
1061 Vselection_alist = Qnil;
1062 staticpro (&Vselection_alist);
1063
1064 DEFVAR_LISP ("selection-converter-alist", &Vselection_converter_alist,
1065 doc: /* An alist associating selection-types with functions.
1066These functions are called to convert the selection, with three args:
1067the name of the selection (typically `PRIMARY', `SECONDARY', or `CLIPBOARD');
1068a desired type to which the selection should be converted;
1069and the local selection value (whatever was given to `x-own-selection').
1070
1071The function should return the value to send to the Scrap Manager
1072\(a string). A return value of nil
1073means that the conversion could not be done.
1074A return value which is the symbol `NULL'
1075means that a side-effect was executed,
1076and there is no meaningful selection value. */);
1077 Vselection_converter_alist = Qnil;
1078
1079 DEFVAR_LISP ("x-lost-selection-functions", &Vx_lost_selection_functions,
1080 doc: /* A list of functions to be called when Emacs loses a selection.
1081\(This happens when a Lisp program explicitly clears the selection.)
1082The functions are called with one argument, the selection type
1083\(a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'). */);
1084 Vx_lost_selection_functions = Qnil;
1085
1086 DEFVAR_LISP ("selection-coding-system", &Vselection_coding_system,
1087 doc: /* Coding system for communicating with other programs.
1088When sending or receiving text via cut_buffer, selection, and clipboard,
1089the text is encoded or decoded by this coding system.
1090The default value is determined by the system script code. */);
1091 Vselection_coding_system = Qnil;
1092
1093 DEFVAR_LISP ("next-selection-coding-system", &Vnext_selection_coding_system,
1094 doc: /* Coding system for the next communication with other programs.
1095Usually, `selection-coding-system' is used for communicating with
1096other programs. But, if this variable is set, it is used for the
1097next communication only. After the communication, this variable is
1098set to nil. */);
1099 Vnext_selection_coding_system = Qnil;
1100
1101 DEFVAR_LISP ("mac-services-selection", &Vmac_services_selection,
1102 doc: /* Selection name for communication via Services menu. */);
1103 Vmac_services_selection = intern ("CLIPBOARD");
1104
1105 QPRIMARY = intern ("PRIMARY"); staticpro (&QPRIMARY);
1106 QSECONDARY = intern ("SECONDARY"); staticpro (&QSECONDARY);
1107 QTIMESTAMP = intern ("TIMESTAMP"); staticpro (&QTIMESTAMP);
1108 QTARGETS = intern ("TARGETS"); staticpro (&QTARGETS);
1109
1110 Qforeign_selection = intern ("foreign-selection");
1111 staticpro (&Qforeign_selection);
1112
1113 Qmac_scrap_name = intern ("mac-scrap-name");
1114 staticpro (&Qmac_scrap_name);
1115
1116 Qmac_ostype = intern ("mac-ostype");
1117 staticpro (&Qmac_ostype);
1118}
1119
1120/* arch-tag: f3c91ad8-99e0-4bd6-9eef-251b2f848732
1121 (do not change this comment) */
diff --git a/src/macterm.c b/src/macterm.c
index d98b6d2b784..114102f7648 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -7106,14 +7106,11 @@ x_find_ccl_program (fontp)
7106#define MIN_DOC_SIZE 64 7106#define MIN_DOC_SIZE 64
7107#define MAX_DOC_SIZE 32767 7107#define MAX_DOC_SIZE 32767
7108 7108
7109#if 0
7109/* sleep time for WaitNextEvent */ 7110/* sleep time for WaitNextEvent */
7110#define WNE_SLEEP_AT_SUSPEND 10 7111#define WNE_SLEEP_AT_SUSPEND 10
7111#define WNE_SLEEP_AT_RESUME 1 7112#define WNE_SLEEP_AT_RESUME 1
7112 7113
7113/* true when cannot handle any Mac OS events */
7114static int handling_window_update = 0;
7115
7116#if 0
7117/* the flag appl_is_suspended is used both for determining the sleep 7114/* the flag appl_is_suspended is used both for determining the sleep
7118 time to be passed to WaitNextEvent and whether the cursor should be 7115 time to be passed to WaitNextEvent and whether the cursor should be
7119 drawn when updating the display. The cursor is turned off when 7116 drawn when updating the display. The cursor is turned off when
@@ -7131,8 +7128,6 @@ static long app_sleep_time = WNE_SLEEP_AT_RESUME;
7131#define ABOUT_ALERT_ID 128 7128#define ABOUT_ALERT_ID 128
7132#define RAM_TOO_LARGE_ALERT_ID 129 7129#define RAM_TOO_LARGE_ALERT_ID 129
7133 7130
7134Boolean terminate_flag = false;
7135
7136/* Contains the string "reverse", which is a constant for mouse button emu.*/ 7131/* Contains the string "reverse", which is a constant for mouse button emu.*/
7137Lisp_Object Qreverse; 7132Lisp_Object Qreverse;
7138 7133
@@ -7188,11 +7183,11 @@ static DragTrackingHandlerUPP mac_do_track_dragUPP = NULL;
7188static DragReceiveHandlerUPP mac_do_receive_dragUPP = NULL; 7183static DragReceiveHandlerUPP mac_do_receive_dragUPP = NULL;
7189#endif 7184#endif
7190 7185
7186static Lisp_Object Qapplication, Qabout;
7191#if USE_CARBON_EVENTS 7187#if USE_CARBON_EVENTS
7192#ifdef MAC_OSX 7188#ifdef MAC_OSX
7193/* Preliminary Support for the OSX Services Menu */ 7189extern void init_service_handler ();
7194static OSStatus mac_handle_service_event (EventHandlerCallRef,EventRef,void*); 7190static Lisp_Object Qpreferences, Qservices, Qpaste, Qperform;
7195static void init_service_handler ();
7196#endif 7191#endif
7197/* Window Event Handler */ 7192/* Window Event Handler */
7198static pascal OSStatus mac_handle_window_event (EventHandlerCallRef, 7193static pascal OSStatus mac_handle_window_event (EventHandlerCallRef,
@@ -7350,11 +7345,13 @@ do_get_menus (void)
7350 SetMenuBar (menubar_handle); 7345 SetMenuBar (menubar_handle);
7351 DrawMenuBar (); 7346 DrawMenuBar ();
7352 7347
7348#if !TARGET_API_MAC_CARBON
7353 menu_handle = GetMenuHandle (M_APPLE); 7349 menu_handle = GetMenuHandle (M_APPLE);
7354 if(menu_handle != NULL) 7350 if(menu_handle != NULL)
7355 AppendResMenu (menu_handle,'DRVR'); 7351 AppendResMenu (menu_handle,'DRVR');
7356 else 7352 else
7357 abort (); 7353 abort ();
7354#endif
7358} 7355}
7359 7356
7360 7357
@@ -7426,8 +7423,6 @@ do_window_update (WindowPtr win)
7426 { 7423 {
7427 Rect r; 7424 Rect r;
7428 7425
7429 handling_window_update = 1;
7430
7431#if TARGET_API_MAC_CARBON 7426#if TARGET_API_MAC_CARBON
7432 { 7427 {
7433 RgnHandle region = NewRgn (); 7428 RgnHandle region = NewRgn ();
@@ -7443,8 +7438,6 @@ do_window_update (WindowPtr win)
7443 expose_frame (f, r.left, r.top, r.right - r.left, r.bottom - r.top); 7438 expose_frame (f, r.left, r.top, r.right - r.left, r.bottom - r.top);
7444 UpdateControls (win, win->visRgn); 7439 UpdateControls (win, win->visRgn);
7445#endif 7440#endif
7446
7447 handling_window_update = 0;
7448 } 7441 }
7449 } 7442 }
7450 7443
@@ -7513,11 +7506,11 @@ do_menu_choice (SInt32 menu_choice)
7513 menu_id = HiWord (menu_choice); 7506 menu_id = HiWord (menu_choice);
7514 menu_item = LoWord (menu_choice); 7507 menu_item = LoWord (menu_choice);
7515 7508
7516 if (menu_id == 0)
7517 return;
7518
7519 switch (menu_id) 7509 switch (menu_id)
7520 { 7510 {
7511 case 0:
7512 break;
7513
7521 case M_APPLE: 7514 case M_APPLE:
7522 do_apple_menu (menu_item); 7515 do_apple_menu (menu_item);
7523 break; 7516 break;
@@ -7767,105 +7760,157 @@ init_required_apple_events ()
7767 abort (); 7760 abort ();
7768} 7761}
7769 7762
7770#if USE_CARBON_EVENTS
7771#ifdef MAC_OSX
7772void 7763void
7773init_service_handler () 7764mac_store_application_menu_event (event)
7765#if USE_CARBON_EVENTS
7766 EventRef event;
7767#else
7768 UInt32 event;
7769#endif
7774{ 7770{
7775 EventTypeSpec specs[] = {{kEventClassService, kEventServiceGetTypes}, 7771 struct input_event buf;
7776 {kEventClassService, kEventServiceCopy}, 7772 Lisp_Object frame, entry;
7777 {kEventClassService, kEventServicePaste}};
7778 InstallApplicationEventHandler (NewEventHandlerUPP (mac_handle_service_event),
7779 3, specs, NULL, NULL);
7780}
7781 7773
7782/* 7774 EVENT_INIT (buf);
7783 MAC_TODO: Check to see if this is called by AEProcessDesc...
7784 */
7785OSStatus
7786mac_handle_service_event (EventHandlerCallRef callRef,
7787 EventRef event, void *data)
7788{
7789 OSStatus err = noErr;
7790 switch (GetEventKind (event))
7791 {
7792 case kEventServiceGetTypes:
7793 {
7794 CFMutableArrayRef copyTypes, pasteTypes;
7795 CFStringRef type;
7796 Boolean selection = true;
7797 /*
7798 GetEventParameter(event, kEventParamServicePasteTypes,
7799 typeCFMutableArrayRef, NULL,
7800 sizeof (CFMutableArrayRef), NULL, &pasteTypes);
7801 */
7802 GetEventParameter(event, kEventParamServiceCopyTypes,
7803 typeCFMutableArrayRef, NULL,
7804 sizeof (CFMutableArrayRef), NULL, &copyTypes);
7805 type = CreateTypeStringWithOSType (kScrapFlavorTypeText);
7806 if (type) {
7807 CFArrayAppendValue (copyTypes, type);
7808 //CFArrayAppendValue (pasteTypes, type);
7809 CFRelease (type);
7810 }
7811 }
7812 case kEventServiceCopy:
7813 {
7814 ScrapRef currentScrap, specificScrap;
7815 char * buf = "";
7816 Size byteCount = 0;
7817 7775
7818 GetCurrentScrap (&currentScrap); 7776 XSETFRAME (frame, mac_focus_frame (&one_mac_display_info));
7777 buf.kind = MENU_BAR_EVENT;
7778 buf.frame_or_window = frame;
7779 buf.arg = frame;
7780 kbd_buffer_store_event (&buf);
7819 7781
7820 err = GetScrapFlavorSize (currentScrap, kScrapFlavorTypeText, &byteCount); 7782 buf.arg = Qapplication;
7821 if (err == noErr) 7783 kbd_buffer_store_event (&buf);
7784
7785#if USE_CARBON_EVENTS
7786 switch (GetEventClass (event))
7787 {
7788#ifdef MAC_OSX
7789 case kEventClassService:
7790 buf.arg = Qservices;
7791 kbd_buffer_store_event (&buf);
7792 switch (GetEventKind (event))
7793 {
7794 case kEventServicePaste:
7795 entry = Qpaste;
7796 break;
7797
7798 case kEventServicePerform:
7822 { 7799 {
7823 void *buffer = xmalloc (byteCount); 7800 OSErr err;
7824 if (buffer != NULL) 7801 CFStringRef message;
7825 { 7802
7826 GetEventParameter (event, kEventParamScrapRef, typeScrapRef, NULL, 7803 err = GetEventParameter (event, kEventParamServiceMessageName,
7827 sizeof (ScrapRef), NULL, &specificScrap); 7804 typeCFStringRef, NULL,
7828 7805 sizeof (CFStringRef), NULL, &message);
7829 err = GetScrapFlavorData (currentScrap, kScrapFlavorTypeText, 7806 buf.arg = Qperform;
7830 &byteCount, buffer); 7807 kbd_buffer_store_event (&buf);
7831 if (err == noErr) 7808 if (err == noErr && message)
7832 PutScrapFlavor (specificScrap, kScrapFlavorTypeText, 7809 entry = intern (SDATA (cfstring_to_lisp (message)));
7833 kScrapFlavorMaskNone, byteCount, buffer); 7810 else
7834 xfree (buffer); 7811 entry = Qnil;
7835 }
7836 } 7812 }
7837 err = noErr; 7813 break;
7838 } 7814
7839 case kEventServicePaste: 7815 default:
7816 abort ();
7817 }
7818 break;
7819#endif /* MAC_OSX */
7820 case kEventClassCommand:
7840 { 7821 {
7841 /* 7822 HICommand command;
7842 // Get the current location 7823
7843 Size byteCount; 7824 GetEventParameter(event, kEventParamDirectObject, typeHICommand,
7844 ScrapRef specificScrap; 7825 NULL, sizeof (HICommand), NULL, &command);
7845 GetEventParameter(event, kEventParamScrapRef, typeScrapRef, NULL, 7826 switch (command.commandID)
7846 sizeof(ScrapRef), NULL, &specificScrap); 7827 {
7847 err = GetScrapFlavorSize(specificScrap, kScrapFlavorTypeText, &byteCount); 7828 case kHICommandAbout:
7848 if (err == noErr) { 7829 entry = Qabout;
7849 void * buffer = xmalloc(byteCount); 7830 break;
7850 if (buffer != NULL ) { 7831#ifdef MAC_OSX
7851 err = GetScrapFlavorData(specificScrap, kScrapFlavorTypeText, 7832 case kHICommandPreferences:
7852 &byteCount, buffer); 7833 entry = Qpreferences;
7853 if (err == noErr) { 7834 break;
7854 // Actually place in the buffer 7835#endif /* MAC_OSX */
7855 BLOCK_INPUT; 7836 case kHICommandQuit:
7856 // Get the current "selection" string here 7837 entry = Qquit;
7857 UNBLOCK_INPUT; 7838 break;
7858 } 7839 default:
7840 abort ();
7859 } 7841 }
7860 xfree(buffer);
7861 }
7862 */
7863 } 7842 }
7843 break;
7844
7845 default:
7846 abort ();
7847 }
7848#else /* USE_CARBON_EVENTS */
7849 switch (event)
7850 {
7851 case kHICommandAbout:
7852 entry = Qabout;
7853 break;
7854 case kHICommandQuit:
7855 entry = Qquit;
7856 break;
7857 default:
7858 abort ();
7864 } 7859 }
7865 return err;
7866}
7867#endif 7860#endif
7868 7861
7862 buf.arg = entry;
7863 kbd_buffer_store_event (&buf);
7864}
7865
7866#if USE_CARBON_EVENTS
7867static pascal OSStatus
7868mac_handle_command_event (next_handler, event, data)
7869 EventHandlerCallRef next_handler;
7870 EventRef event;
7871 void *data;
7872{
7873 HICommand command;
7874 OSErr result;
7875
7876 GetEventParameter(event, kEventParamDirectObject, typeHICommand, NULL,
7877 sizeof (HICommand), NULL, &command);
7878
7879 switch (command.commandID)
7880 {
7881 case kHICommandAbout:
7882#ifdef MAC_OSX
7883 case kHICommandPreferences:
7884#endif /* MAC_OSX */
7885 result = CallNextEventHandler (next_handler, event);
7886 if (result != eventNotHandledErr)
7887 return result;
7888
7889 mac_store_application_menu_event (event);
7890 return noErr;
7891
7892 default:
7893 break;
7894 }
7895
7896 return eventNotHandledErr;
7897}
7898
7899static OSErr
7900init_command_handler (window)
7901 WindowPtr window;
7902{
7903 OSErr err = noErr;
7904 EventTypeSpec specs[] = {{kEventClassCommand, kEventCommandProcess}};
7905 static EventHandlerUPP handle_command_eventUPP = NULL;
7906
7907 if (handle_command_eventUPP == NULL)
7908 handle_command_eventUPP = NewEventHandlerUPP (mac_handle_command_event);
7909 return InstallApplicationEventHandler (handle_command_eventUPP,
7910 GetEventTypeCount (specs), specs,
7911 NULL, NULL);
7912}
7913
7869static pascal OSStatus 7914static pascal OSStatus
7870mac_handle_window_event (next_handler, event, data) 7915mac_handle_window_event (next_handler, event, data)
7871 EventHandlerCallRef next_handler; 7916 EventHandlerCallRef next_handler;
@@ -7888,7 +7933,7 @@ mac_handle_window_event (next_handler, event, data)
7888 return result; 7933 return result;
7889 7934
7890 do_window_update (wp); 7935 do_window_update (wp);
7891 break; 7936 return noErr;
7892 7937
7893 case kEventWindowBoundsChanging: 7938 case kEventWindowBoundsChanging:
7894 result = CallNextEventHandler (next_handler, event); 7939 result = CallNextEventHandler (next_handler, event);
@@ -8267,14 +8312,30 @@ do_ae_print_documents (const AppleEvent *pAE, AppleEvent *reply, long refcon)
8267static pascal OSErr 8312static pascal OSErr
8268do_ae_quit_application (AppleEvent* message, AppleEvent *reply, long refcon) 8313do_ae_quit_application (AppleEvent* message, AppleEvent *reply, long refcon)
8269{ 8314{
8270 /* FixMe: Do we need an unwind-protect or something here? And what 8315#if USE_CARBON_EVENTS
8271 do we do about unsaved files. Currently just forces quit rather 8316 OSErr err;
8272 than doing recursive callback to get user input. */ 8317 EventRef event = NULL;
8318 static const HICommand quit_command = {kEventAttributeNone, kHICommandQuit};
8273 8319
8274 terminate_flag = true; 8320 err = CreateEvent (NULL, kEventClassCommand, kEventCommandProcess, 0,
8321 kEventAttributeUserEvent, &event);
8322 if (err == noErr)
8323 err = SetEventParameter (event, kEventParamDirectObject, typeHICommand,
8324 sizeof (HICommand), &quit_command);
8325 if (err == noErr)
8326 mac_store_application_menu_event (event);
8327 if (event)
8328 ReleaseEvent (event);
8329
8330 if (err == noErr)
8331 return noErr;
8332 else
8333 return errAEEventNotHandled;
8334#else
8335 mac_store_application_menu_event (kHICommandQuit);
8275 8336
8276 /* Fkill_emacs doesn't return. We have to return. (TI) */
8277 return noErr; 8337 return noErr;
8338#endif
8278} 8339}
8279 8340
8280 8341
@@ -8474,20 +8535,6 @@ XTread_socket (sd, expected, hold_quit)
8474 /* So people can tell when we have read the available input. */ 8535 /* So people can tell when we have read the available input. */
8475 input_signal_count++; 8536 input_signal_count++;
8476 8537
8477 /* Don't poll for events to process (specifically updateEvt) if
8478 window update currently already in progress. A call to redisplay
8479 (in do_window_update) can be preempted by another call to
8480 redisplay, causing blank regions to be left on the screen and the
8481 cursor to be left at strange places. */
8482 if (handling_window_update)
8483 {
8484 UNBLOCK_INPUT;
8485 return 0;
8486 }
8487
8488 if (terminate_flag)
8489 Fkill_emacs (make_number (1));
8490
8491#if USE_CARBON_EVENTS 8538#if USE_CARBON_EVENTS
8492 toolbox_dispatcher = GetEventDispatcherTarget (); 8539 toolbox_dispatcher = GetEventDispatcherTarget ();
8493 8540
@@ -9580,9 +9627,41 @@ mac_check_for_quit_char ()
9580 kbd_buffer_store_event (&e); 9627 kbd_buffer_store_event (&e);
9581 } 9628 }
9582} 9629}
9583
9584#endif /* MAC_OSX */ 9630#endif /* MAC_OSX */
9585 9631
9632static void
9633init_menu_bar ()
9634{
9635#ifdef MAC_OSX
9636 OSErr err;
9637 MenuRef menu;
9638 MenuItemIndex menu_index;
9639
9640 err = GetIndMenuItemWithCommandID (NULL, kHICommandQuit, 1,
9641 &menu, &menu_index);
9642 if (err == noErr)
9643 SetMenuItemCommandKey (menu, menu_index, false, 0);
9644#if USE_CARBON_EVENTS
9645 EnableMenuCommand (NULL, kHICommandPreferences);
9646 err = GetIndMenuItemWithCommandID (NULL, kHICommandPreferences, 1,
9647 &menu, &menu_index);
9648 if (err == noErr)
9649 {
9650 SetMenuItemCommandKey (menu, menu_index, false, 0);
9651 InsertMenuItemTextWithCFString (menu, NULL,
9652 0, kMenuItemAttrSeparator, 0);
9653 InsertMenuItemTextWithCFString (menu, CFSTR ("About Emacs"),
9654 0, 0, kHICommandAbout);
9655 }
9656#endif /* USE_CARBON_EVENTS */
9657#else /* !MAC_OSX */
9658#if USE_CARBON_EVENTS
9659 SetMenuItemCommandID (GetMenuHandle (M_APPLE), I_ABOUT, kHICommandAbout);
9660#endif
9661#endif
9662}
9663
9664
9586/* Set up use of X before we make the first connection. */ 9665/* Set up use of X before we make the first connection. */
9587 9666
9588extern frame_parm_handler mac_frame_parm_handlers[]; 9667extern frame_parm_handler mac_frame_parm_handlers[];
@@ -9699,13 +9778,17 @@ mac_initialize ()
9699#if TARGET_API_MAC_CARBON 9778#if TARGET_API_MAC_CARBON
9700 init_required_apple_events (); 9779 init_required_apple_events ();
9701 9780
9702#if USE_CARBON_EVENTS && defined (MAC_OSX) 9781#if USE_CARBON_EVENTS
9782#ifdef MAC_OSX
9703 init_service_handler (); 9783 init_service_handler ();
9704 9784
9705 init_quit_char_handler (); 9785 init_quit_char_handler ();
9706#endif 9786#endif /* MAC_OSX */
9707 9787
9708 DisableMenuCommand (NULL, kHICommandQuit); 9788 init_command_handler ();
9789
9790 init_menu_bar ();
9791#endif /* USE_CARBON_EVENTS */
9709 9792
9710#ifdef MAC_OSX 9793#ifdef MAC_OSX
9711 if (!inhibit_window_system) 9794 if (!inhibit_window_system)
@@ -9732,6 +9815,16 @@ syms_of_macterm ()
9732 Qsuper = intern ("super"); 9815 Qsuper = intern ("super");
9733 Fput (Qsuper, Qmodifier_value, make_number (super_modifier)); 9816 Fput (Qsuper, Qmodifier_value, make_number (super_modifier));
9734 9817
9818 Qapplication = intern ("application"); staticpro (&Qapplication);
9819 Qabout = intern ("about"); staticpro (&Qabout);
9820
9821#if USE_CARBON_EVENTS && defined (MAC_OSX)
9822 Qpreferences = intern ("preferences"); staticpro (&Qpreferences);
9823 Qservices = intern ("services"); staticpro (&Qservices);
9824 Qpaste = intern ("paste"); staticpro (&Qpaste);
9825 Qperform = intern ("perform"); staticpro (&Qperform);
9826#endif
9827
9735#ifdef MAC_OSX 9828#ifdef MAC_OSX
9736 Fprovide (intern ("mac-carbon"), Qnil); 9829 Fprovide (intern ("mac-carbon"), Qnil);
9737#endif 9830#endif
diff --git a/src/macterm.h b/src/macterm.h
index 48e028f9064..127c00b077b 100644
--- a/src/macterm.h
+++ b/src/macterm.h
@@ -620,6 +620,10 @@ extern void remove_window_handler P_ ((WindowPtr));
620#define FONT_TYPE_FOR_UNIBYTE(font, ch) 0 620#define FONT_TYPE_FOR_UNIBYTE(font, ch) 0
621#define FONT_TYPE_FOR_MULTIBYTE(font, ch) 0 621#define FONT_TYPE_FOR_MULTIBYTE(font, ch) 0
622 622
623/* Defined in macselect.c */
624
625extern void x_clear_frame_selections P_ ((struct frame *));
626
623/* Defined in mac.c. */ 627/* Defined in mac.c. */
624 628
625extern OSErr posix_pathname_to_fsspec P_ ((const char *, FSSpec *)); 629extern OSErr posix_pathname_to_fsspec P_ ((const char *, FSSpec *));
diff --git a/src/sysdep.c b/src/sysdep.c
index e7494a2755d..42179d97e82 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1718,10 +1718,16 @@ get_frame_size (widthp, heightp)
1718#else 1718#else
1719#ifdef VMS 1719#ifdef VMS
1720 1720
1721 /* Use a fresh channel since the current one may have stale info
1722 (for example, from prior to a suspend); and to avoid a dependency
1723 in the init sequence. */
1724 int chan;
1721 struct sensemode tty; 1725 struct sensemode tty;
1722 1726
1723 SYS$QIOW (0, input_fd, IO$_SENSEMODE, &tty, 0, 0, 1727 SYS$ASSIGN (&input_dsc, &chan, 0, 0);
1724 &tty.class, 12, 0, 0, 0, 0); 1728 SYS$QIOW (0, chan, IO$_SENSEMODE, &tty, 0, 0,
1729 &tty.class, 12, 0, 0, 0, 0);
1730 SYS$DASSGN (chan);
1725 *widthp = tty.scr_wid; 1731 *widthp = tty.scr_wid;
1726 *heightp = tty.scr_len; 1732 *heightp = tty.scr_len;
1727 1733
diff --git a/src/sysselect.h b/src/sysselect.h
index 5aa9eb4aee7..4c52bba677a 100644
--- a/src/sysselect.h
+++ b/src/sysselect.h
@@ -18,7 +18,7 @@ along with GNU Emacs; see the file COPYING. If not, write to
18the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19Boston, MA 02111-1307, USA. */ 19Boston, MA 02111-1307, USA. */
20 20
21#ifdef HAVE_SYS_SELECT 21#ifdef HAVE_SYS_SELECT_H
22#include <sys/select.h> 22#include <sys/select.h>
23#endif 23#endif
24 24
diff --git a/src/window.c b/src/window.c
index 0cfd4162fd7..454d712726c 100644
--- a/src/window.c
+++ b/src/window.c
@@ -79,10 +79,6 @@ static int foreach_window_1 P_ ((struct window *,
79 void *)); 79 void *));
80static Lisp_Object window_list_1 P_ ((Lisp_Object, Lisp_Object, Lisp_Object)); 80static Lisp_Object window_list_1 P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
81 81
82/* The value of `window-size-fixed'. */
83
84int window_size_fixed;
85
86/* This is the window in which the terminal's cursor should 82/* This is the window in which the terminal's cursor should
87 be left when nothing is being done with it. This must 83 be left when nothing is being done with it. This must
88 always be a leaf window, and its buffer is selected by 84 always be a leaf window, and its buffer is selected by
@@ -3267,9 +3263,10 @@ display_buffer_1 (window)
3267 3263
3268DEFUN ("special-display-p", Fspecial_display_p, Sspecial_display_p, 1, 1, 0, 3264DEFUN ("special-display-p", Fspecial_display_p, Sspecial_display_p, 1, 1, 0,
3269 doc: /* Returns non-nil if a buffer named BUFFER-NAME gets a special frame. 3265 doc: /* Returns non-nil if a buffer named BUFFER-NAME gets a special frame.
3270If the value is t, a frame would be created for that buffer 3266If the value is t, `display-buffer' or `pop-to-buffer' would create a
3271using the default frame parameters. If the value is a list, 3267special frame for that buffer using the default frame parameters.
3272it is a list of frame parameters that would be used 3268
3269If the value is a list, it is a list of frame parameters that would be used
3273to make a frame for that buffer. 3270to make a frame for that buffer.
3274The variables `special-display-buffer-names' 3271The variables `special-display-buffer-names'
3275and `special-display-regexps' control this. */) 3272and `special-display-regexps' control this. */)
@@ -3303,7 +3300,9 @@ and `special-display-regexps' control this. */)
3303} 3300}
3304 3301
3305DEFUN ("same-window-p", Fsame_window_p, Ssame_window_p, 1, 1, 0, 3302DEFUN ("same-window-p", Fsame_window_p, Ssame_window_p, 1, 1, 0,
3306 doc: /* Returns non-nil if a new buffer named BUFFER-NAME would use the same window. 3303 doc: /* Returns non-nil if a buffer named BUFFER-NAME would use the same window.
3304More precisely, if `display-buffer' or `pop-to-buffer' would display
3305that buffer in the selected window rather than (as usual) in some other window.
3307See `same-window-buffer-names' and `same-window-regexps'. */) 3306See `same-window-buffer-names' and `same-window-regexps'. */)
3308 (buffer_name) 3307 (buffer_name)
3309 Lisp_Object buffer_name; 3308 Lisp_Object buffer_name;
@@ -6669,6 +6668,7 @@ syms_of_window ()
6669{ 6668{
6670 Qwindow_size_fixed = intern ("window-size-fixed"); 6669 Qwindow_size_fixed = intern ("window-size-fixed");
6671 staticpro (&Qwindow_size_fixed); 6670 staticpro (&Qwindow_size_fixed);
6671 Fset (Qwindow_size_fixed, Qnil);
6672 6672
6673 staticpro (&Qwindow_configuration_change_hook); 6673 staticpro (&Qwindow_configuration_change_hook);
6674 Qwindow_configuration_change_hook 6674 Qwindow_configuration_change_hook
@@ -6751,7 +6751,8 @@ where `pop-up-frame-alist' would hold the default frame parameters. */);
6751 6751
6752 DEFVAR_LISP ("special-display-buffer-names", &Vspecial_display_buffer_names, 6752 DEFVAR_LISP ("special-display-buffer-names", &Vspecial_display_buffer_names,
6753 doc: /* *List of buffer names that should have their own special frames. 6753 doc: /* *List of buffer names that should have their own special frames.
6754Displaying a buffer whose name is in this list makes a special frame for it 6754Displaying a buffer with `display-buffer' or `pop-to-buffer',
6755if its name is in this list, makes a special frame for it
6755using `special-display-function'. See also `special-display-regexps'. 6756using `special-display-function'. See also `special-display-regexps'.
6756 6757
6757An element of the list can be a list instead of just a string. 6758An element of the list can be a list instead of just a string.
@@ -6776,9 +6777,9 @@ Those variables take precedence over this one. */);
6776 6777
6777 DEFVAR_LISP ("special-display-regexps", &Vspecial_display_regexps, 6778 DEFVAR_LISP ("special-display-regexps", &Vspecial_display_regexps,
6778 doc: /* *List of regexps saying which buffers should have their own special frames. 6779 doc: /* *List of regexps saying which buffers should have their own special frames.
6779If a buffer name matches one of these regexps, it gets its own frame. 6780When displaying a buffer with `display-buffer' or `pop-to-buffer',
6780Displaying a buffer whose name is in this list makes a special frame for it 6781if any regexp in this list matches the buffer name, it makes a
6781using `special-display-function'. 6782special frame for the buffer by calling `special-display-function'.
6782 6783
6783An element of the list can be a list instead of just a string. 6784An element of the list can be a list instead of just a string.
6784There are two ways to use a list as an element: 6785There are two ways to use a list as an element:
@@ -6877,16 +6878,6 @@ scroll as specified. */);
6877The selected frame is the one whose configuration has changed. */); 6878The selected frame is the one whose configuration has changed. */);
6878 Vwindow_configuration_change_hook = Qnil; 6879 Vwindow_configuration_change_hook = Qnil;
6879 6880
6880 DEFVAR_BOOL ("window-size-fixed", &window_size_fixed,
6881 doc: /* Non-nil in a buffer means windows displaying the buffer are fixed-size.
6882If the value is`height', then only the window's height is fixed.
6883If the value is `width', then only the window's width is fixed.
6884Any other non-nil value fixes both the width and the height.
6885Emacs won't change the size of any window displaying that buffer,
6886unless you explicitly change the size, or Emacs has no other choice. */);
6887 Fmake_variable_buffer_local (Qwindow_size_fixed);
6888 window_size_fixed = 0;
6889
6890 defsubr (&Sselected_window); 6881 defsubr (&Sselected_window);
6891 defsubr (&Sminibuffer_window); 6882 defsubr (&Sminibuffer_window);
6892 defsubr (&Swindow_minibuffer_p); 6883 defsubr (&Swindow_minibuffer_p);
diff --git a/src/xdisp.c b/src/xdisp.c
index c1bd7acb2a0..23898e78774 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -622,12 +622,6 @@ Lisp_Object Qmessage_truncate_lines;
622 622
623static int message_cleared_p; 623static int message_cleared_p;
624 624
625/* Non-zero means we want a hollow cursor in windows that are not
626 selected. Zero means there's no cursor in such windows. */
627
628Lisp_Object Vcursor_in_non_selected_windows;
629Lisp_Object Qcursor_in_non_selected_windows;
630
631/* How to blink the default frame cursor off. */ 625/* How to blink the default frame cursor off. */
632Lisp_Object Vblink_cursor_alist; 626Lisp_Object Vblink_cursor_alist;
633 627
@@ -5977,6 +5971,16 @@ move_it_in_display_line_to (it, to_charpos, to_x, op)
5977 { 5971 {
5978 int x, i, ascent = 0, descent = 0; 5972 int x, i, ascent = 0, descent = 0;
5979 5973
5974 /* Stop if we move beyond TO_CHARPOS (after an image or stretch glyph). */
5975 if ((op & MOVE_TO_POS) != 0
5976 && BUFFERP (it->object)
5977 && it->method == GET_FROM_BUFFER
5978 && IT_CHARPOS (*it) > to_charpos)
5979 {
5980 result = MOVE_POS_MATCH_OR_ZV;
5981 break;
5982 }
5983
5980 /* Stop when ZV reached. 5984 /* Stop when ZV reached.
5981 We used to stop here when TO_CHARPOS reached as well, but that is 5985 We used to stop here when TO_CHARPOS reached as well, but that is
5982 too soon if this glyph does not fit on this line. So we handle it 5986 too soon if this glyph does not fit on this line. So we handle it
@@ -8010,8 +8014,6 @@ set_message_1 (a1, a2, nbytes, multibyte_p)
8010 const char *s = (const char *) a1; 8014 const char *s = (const char *) a1;
8011 Lisp_Object string = a2; 8015 Lisp_Object string = a2;
8012 8016
8013 xassert (BEG == Z);
8014
8015 /* Change multibyteness of the echo buffer appropriately. */ 8017 /* Change multibyteness of the echo buffer appropriately. */
8016 if (message_enable_multibyte 8018 if (message_enable_multibyte
8017 != !NILP (current_buffer->enable_multibyte_characters)) 8019 != !NILP (current_buffer->enable_multibyte_characters))
@@ -14256,10 +14258,10 @@ dump_glyph_row (row, vpos, glyphs)
14256{ 14258{
14257 if (glyphs != 1) 14259 if (glyphs != 1)
14258 { 14260 {
14259 fprintf (stderr, "Row Start End Used oEI><O\\CTZFesm X Y W H V A P\n"); 14261 fprintf (stderr, "Row Start End Used oEI><\\CTZFesm X Y W H V A P\n");
14260 fprintf (stderr, "=======================================================================\n"); 14262 fprintf (stderr, "======================================================================\n");
14261 14263
14262 fprintf (stderr, "%3d %5d %5d %4d %1.1d%1.1d%1.1d%1.1d%1.1d\ 14264 fprintf (stderr, "%3d %5d %5d %4d %1.1d%1.1d%1.1d%1.1d\
14263%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d %4d %4d %4d %4d %4d %4d %4d\n", 14265%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d %4d %4d %4d %4d %4d %4d %4d\n",
14264 vpos, 14266 vpos,
14265 MATRIX_ROW_START_CHARPOS (row), 14267 MATRIX_ROW_START_CHARPOS (row),
@@ -14269,7 +14271,6 @@ dump_glyph_row (row, vpos, glyphs)
14269 row->enabled_p, 14271 row->enabled_p,
14270 row->truncated_on_left_p, 14272 row->truncated_on_left_p,
14271 row->truncated_on_right_p, 14273 row->truncated_on_right_p,
14272 row->overlay_arrow_p,
14273 row->continued_p, 14274 row->continued_p,
14274 MATRIX_ROW_CONTINUATION_LINE_P (row), 14275 MATRIX_ROW_CONTINUATION_LINE_P (row),
14275 row->displays_text_p, 14276 row->displays_text_p,
@@ -16189,7 +16190,7 @@ store_mode_line_string (string, lisp_string, copy_string, field_width, precision
16189 props = mode_line_string_face_prop; 16190 props = mode_line_string_face_prop;
16190 else if (!NILP (mode_line_string_face)) 16191 else if (!NILP (mode_line_string_face))
16191 { 16192 {
16192 Lisp_Object face = Fsafe_plist_get (props, Qface); 16193 Lisp_Object face = Fplist_get (props, Qface);
16193 props = Fcopy_sequence (props); 16194 props = Fcopy_sequence (props);
16194 if (NILP (face)) 16195 if (NILP (face))
16195 face = mode_line_string_face; 16196 face = mode_line_string_face;
@@ -16214,7 +16215,7 @@ store_mode_line_string (string, lisp_string, copy_string, field_width, precision
16214 Lisp_Object face; 16215 Lisp_Object face;
16215 if (NILP (props)) 16216 if (NILP (props))
16216 props = Ftext_properties_at (make_number (0), lisp_string); 16217 props = Ftext_properties_at (make_number (0), lisp_string);
16217 face = Fsafe_plist_get (props, Qface); 16218 face = Fplist_get (props, Qface);
16218 if (NILP (face)) 16219 if (NILP (face))
16219 face = mode_line_string_face; 16220 face = mode_line_string_face;
16220 else 16221 else
@@ -19023,14 +19024,14 @@ produce_stretch_glyph (it)
19023 plist = XCDR (it->object); 19024 plist = XCDR (it->object);
19024 19025
19025 /* Compute the width of the stretch. */ 19026 /* Compute the width of the stretch. */
19026 if ((prop = Fsafe_plist_get (plist, QCwidth), !NILP (prop)) 19027 if ((prop = Fplist_get (plist, QCwidth), !NILP (prop))
19027 && calc_pixel_width_or_height (&tem, it, prop, font, 1, 0)) 19028 && calc_pixel_width_or_height (&tem, it, prop, font, 1, 0))
19028 { 19029 {
19029 /* Absolute width `:width WIDTH' specified and valid. */ 19030 /* Absolute width `:width WIDTH' specified and valid. */
19030 zero_width_ok_p = 1; 19031 zero_width_ok_p = 1;
19031 width = (int)tem; 19032 width = (int)tem;
19032 } 19033 }
19033 else if (prop = Fsafe_plist_get (plist, QCrelative_width), 19034 else if (prop = Fplist_get (plist, QCrelative_width),
19034 NUMVAL (prop) > 0) 19035 NUMVAL (prop) > 0)
19035 { 19036 {
19036 /* Relative width `:relative-width FACTOR' specified and valid. 19037 /* Relative width `:relative-width FACTOR' specified and valid.
@@ -19054,7 +19055,7 @@ produce_stretch_glyph (it)
19054 x_produce_glyphs (&it2); 19055 x_produce_glyphs (&it2);
19055 width = NUMVAL (prop) * it2.pixel_width; 19056 width = NUMVAL (prop) * it2.pixel_width;
19056 } 19057 }
19057 else if ((prop = Fsafe_plist_get (plist, QCalign_to), !NILP (prop)) 19058 else if ((prop = Fplist_get (plist, QCalign_to), !NILP (prop))
19058 && calc_pixel_width_or_height (&tem, it, prop, font, 1, &align_to)) 19059 && calc_pixel_width_or_height (&tem, it, prop, font, 1, &align_to))
19059 { 19060 {
19060 if (it->glyph_row == NULL || !it->glyph_row->mode_line_p) 19061 if (it->glyph_row == NULL || !it->glyph_row->mode_line_p)
@@ -19074,13 +19075,13 @@ produce_stretch_glyph (it)
19074 width = 1; 19075 width = 1;
19075 19076
19076 /* Compute height. */ 19077 /* Compute height. */
19077 if ((prop = Fsafe_plist_get (plist, QCheight), !NILP (prop)) 19078 if ((prop = Fplist_get (plist, QCheight), !NILP (prop))
19078 && calc_pixel_width_or_height (&tem, it, prop, font, 0, 0)) 19079 && calc_pixel_width_or_height (&tem, it, prop, font, 0, 0))
19079 { 19080 {
19080 height = (int)tem; 19081 height = (int)tem;
19081 zero_height_ok_p = 1; 19082 zero_height_ok_p = 1;
19082 } 19083 }
19083 else if (prop = Fsafe_plist_get (plist, QCrelative_height), 19084 else if (prop = Fplist_get (plist, QCrelative_height),
19084 NUMVAL (prop) > 0) 19085 NUMVAL (prop) > 0)
19085 height = FONT_HEIGHT (font) * NUMVAL (prop); 19086 height = FONT_HEIGHT (font) * NUMVAL (prop);
19086 else 19087 else
@@ -19092,7 +19093,7 @@ produce_stretch_glyph (it)
19092 /* Compute percentage of height used for ascent. If 19093 /* Compute percentage of height used for ascent. If
19093 `:ascent ASCENT' is present and valid, use that. Otherwise, 19094 `:ascent ASCENT' is present and valid, use that. Otherwise,
19094 derive the ascent from the font in use. */ 19095 derive the ascent from the font in use. */
19095 if (prop = Fsafe_plist_get (plist, QCascent), 19096 if (prop = Fplist_get (plist, QCascent),
19096 NUMVAL (prop) > 0 && NUMVAL (prop) <= 100) 19097 NUMVAL (prop) > 0 && NUMVAL (prop) <= 100)
19097 ascent = height * NUMVAL (prop) / 100.0; 19098 ascent = height * NUMVAL (prop) / 100.0;
19098 else if (!NILP (prop) 19099 else if (!NILP (prop)
@@ -20273,7 +20274,7 @@ get_window_cursor_type (w, glyph, width, active_cursor)
20273 /* Use cursor-in-non-selected-windows for non-selected window or frame. */ 20274 /* Use cursor-in-non-selected-windows for non-selected window or frame. */
20274 if (non_selected) 20275 if (non_selected)
20275 { 20276 {
20276 alt_cursor = Fbuffer_local_value (Qcursor_in_non_selected_windows, w->buffer); 20277 alt_cursor = XBUFFER (w->buffer)->cursor_in_non_selected_windows;
20277 return get_specified_cursor_type (alt_cursor, width); 20278 return get_specified_cursor_type (alt_cursor, width);
20278 } 20279 }
20279 20280
@@ -21390,7 +21391,7 @@ note_mode_line_or_margin_highlight (w, x, y, area)
21390 if (IMAGEP (object)) 21391 if (IMAGEP (object))
21391 { 21392 {
21392 Lisp_Object image_map, hotspot; 21393 Lisp_Object image_map, hotspot;
21393 if ((image_map = Fsafe_plist_get (XCDR (object), QCmap), 21394 if ((image_map = Fplist_get (XCDR (object), QCmap),
21394 !NILP (image_map)) 21395 !NILP (image_map))
21395 && (hotspot = find_hot_spot (image_map, dx, dy), 21396 && (hotspot = find_hot_spot (image_map, dx, dy),
21396 CONSP (hotspot)) 21397 CONSP (hotspot))
@@ -21406,10 +21407,10 @@ note_mode_line_or_margin_highlight (w, x, y, area)
21406 if (CONSP (hotspot) 21407 if (CONSP (hotspot)
21407 && (plist = XCAR (hotspot), CONSP (plist))) 21408 && (plist = XCAR (hotspot), CONSP (plist)))
21408 { 21409 {
21409 pointer = Fsafe_plist_get (plist, Qpointer); 21410 pointer = Fplist_get (plist, Qpointer);
21410 if (NILP (pointer)) 21411 if (NILP (pointer))
21411 pointer = Qhand; 21412 pointer = Qhand;
21412 help = Fsafe_plist_get (plist, Qhelp_echo); 21413 help = Fplist_get (plist, Qhelp_echo);
21413 if (!NILP (help)) 21414 if (!NILP (help))
21414 { 21415 {
21415 help_echo_string = help; 21416 help_echo_string = help;
@@ -21421,7 +21422,7 @@ note_mode_line_or_margin_highlight (w, x, y, area)
21421 } 21422 }
21422 } 21423 }
21423 if (NILP (pointer)) 21424 if (NILP (pointer))
21424 pointer = Fsafe_plist_get (XCDR (object), QCpointer); 21425 pointer = Fplist_get (XCDR (object), QCpointer);
21425 } 21426 }
21426 21427
21427 if (STRINGP (string)) 21428 if (STRINGP (string))
@@ -21574,7 +21575,7 @@ note_mouse_highlight (f, x, y)
21574 if (img != NULL && IMAGEP (img->spec)) 21575 if (img != NULL && IMAGEP (img->spec))
21575 { 21576 {
21576 Lisp_Object image_map, hotspot; 21577 Lisp_Object image_map, hotspot;
21577 if ((image_map = Fsafe_plist_get (XCDR (img->spec), QCmap), 21578 if ((image_map = Fplist_get (XCDR (img->spec), QCmap),
21578 !NILP (image_map)) 21579 !NILP (image_map))
21579 && (hotspot = find_hot_spot (image_map, 21580 && (hotspot = find_hot_spot (image_map,
21580 glyph->slice.x + dx, 21581 glyph->slice.x + dx,
@@ -21592,10 +21593,10 @@ note_mouse_highlight (f, x, y)
21592 if (CONSP (hotspot) 21593 if (CONSP (hotspot)
21593 && (plist = XCAR (hotspot), CONSP (plist))) 21594 && (plist = XCAR (hotspot), CONSP (plist)))
21594 { 21595 {
21595 pointer = Fsafe_plist_get (plist, Qpointer); 21596 pointer = Fplist_get (plist, Qpointer);
21596 if (NILP (pointer)) 21597 if (NILP (pointer))
21597 pointer = Qhand; 21598 pointer = Qhand;
21598 help_echo_string = Fsafe_plist_get (plist, Qhelp_echo); 21599 help_echo_string = Fplist_get (plist, Qhelp_echo);
21599 if (!NILP (help_echo_string)) 21600 if (!NILP (help_echo_string))
21600 { 21601 {
21601 help_echo_window = window; 21602 help_echo_window = window;
@@ -21605,7 +21606,7 @@ note_mouse_highlight (f, x, y)
21605 } 21606 }
21606 } 21607 }
21607 if (NILP (pointer)) 21608 if (NILP (pointer))
21608 pointer = Fsafe_plist_get (XCDR (img->spec), QCpointer); 21609 pointer = Fplist_get (XCDR (img->spec), QCpointer);
21609 } 21610 }
21610 } 21611 }
21611 21612
@@ -22637,8 +22638,6 @@ syms_of_xdisp ()
22637 staticpro (&Qpoly); 22638 staticpro (&Qpoly);
22638 Qmessage_truncate_lines = intern ("message-truncate-lines"); 22639 Qmessage_truncate_lines = intern ("message-truncate-lines");
22639 staticpro (&Qmessage_truncate_lines); 22640 staticpro (&Qmessage_truncate_lines);
22640 Qcursor_in_non_selected_windows = intern ("cursor-in-non-selected-windows");
22641 staticpro (&Qcursor_in_non_selected_windows);
22642 Qgrow_only = intern ("grow-only"); 22641 Qgrow_only = intern ("grow-only");
22643 staticpro (&Qgrow_only); 22642 staticpro (&Qgrow_only);
22644 Qinhibit_menubar_update = intern ("inhibit-menubar-update"); 22643 Qinhibit_menubar_update = intern ("inhibit-menubar-update");
@@ -22932,12 +22931,6 @@ only, until their display becomes empty, at which point the windows
22932go back to their normal size. */); 22931go back to their normal size. */);
22933 Vresize_mini_windows = Qgrow_only; 22932 Vresize_mini_windows = Qgrow_only;
22934 22933
22935 DEFVAR_LISP ("cursor-in-non-selected-windows",
22936 &Vcursor_in_non_selected_windows,
22937 doc: /* *Cursor type to display in non-selected windows.
22938t means to use hollow box cursor. See `cursor-type' for other values. */);
22939 Vcursor_in_non_selected_windows = Qt;
22940
22941 DEFVAR_LISP ("blink-cursor-alist", &Vblink_cursor_alist, 22934 DEFVAR_LISP ("blink-cursor-alist", &Vblink_cursor_alist,
22942 doc: /* Alist specifying how to blink the cursor off. 22935 doc: /* Alist specifying how to blink the cursor off.
22943Each element has the form (ON-STATE . OFF-STATE). Whenever the 22936Each element has the form (ON-STATE . OFF-STATE). Whenever the
diff --git a/src/xfaces.c b/src/xfaces.c
index 4709d1cb285..edff936b08d 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -337,6 +337,8 @@ extern Lisp_Object Qmode_line;
337 337
338Lisp_Object Qface_alias; 338Lisp_Object Qface_alias;
339 339
340extern Lisp_Object Qcircular_list;
341
340/* Default stipple pattern used on monochrome displays. This stipple 342/* Default stipple pattern used on monochrome displays. This stipple
341 pattern is used on monochrome displays instead of shades of gray 343 pattern is used on monochrome displays instead of shades of gray
342 for a face background color. See `set-face-stipple' for possible 344 for a face background color. See `set-face-stipple' for possible
@@ -472,7 +474,7 @@ struct named_merge_point;
472 474
473static void map_tty_color P_ ((struct frame *, struct face *, 475static void map_tty_color P_ ((struct frame *, struct face *,
474 enum lface_attribute_index, int *)); 476 enum lface_attribute_index, int *));
475static Lisp_Object resolve_face_name P_ ((Lisp_Object)); 477static Lisp_Object resolve_face_name P_ ((Lisp_Object, int));
476static int may_use_scalable_font_p P_ ((const char *)); 478static int may_use_scalable_font_p P_ ((const char *));
477static void set_font_frame_param P_ ((Lisp_Object, Lisp_Object)); 479static void set_font_frame_param P_ ((Lisp_Object, Lisp_Object));
478static int better_font_p P_ ((int *, struct font_name *, struct font_name *, 480static int better_font_p P_ ((int *, struct font_name *, struct font_name *,
@@ -3266,27 +3268,47 @@ push_named_merge_point (struct named_merge_point *new_named_merge_point,
3266 3268
3267 3269
3268/* Resolve face name FACE_NAME. If FACE_NAME is a string, intern it 3270/* Resolve face name FACE_NAME. If FACE_NAME is a string, intern it
3269 to make it a symvol. If FACE_NAME is an alias for another face, 3271 to make it a symbol. If FACE_NAME is an alias for another face,
3270 return that face's name. */ 3272 return that face's name.
3273
3274 Return default face in case of errors. */
3271 3275
3272static Lisp_Object 3276static Lisp_Object
3273resolve_face_name (face_name) 3277resolve_face_name (face_name, signal_p)
3274 Lisp_Object face_name; 3278 Lisp_Object face_name;
3279 int signal_p;
3275{ 3280{
3276 Lisp_Object aliased; 3281 Lisp_Object orig_face;
3277 int alias_loop_max = 10; 3282 Lisp_Object tortoise, hare;
3278 3283
3279 if (STRINGP (face_name)) 3284 if (STRINGP (face_name))
3280 face_name = intern (SDATA (face_name)); 3285 face_name = intern (SDATA (face_name));
3281 3286
3282 while (SYMBOLP (face_name)) 3287 if (NILP (face_name) || !SYMBOLP (face_name))
3288 return face_name;
3289
3290 orig_face = face_name;
3291 tortoise = hare = face_name;
3292
3293 while (1)
3283 { 3294 {
3284 aliased = Fsafe_get (face_name, Qface_alias); 3295 face_name = hare;
3285 if (NILP (aliased)) 3296 hare = Fget (hare, Qface_alias);
3297 if (NILP (hare) || !SYMBOLP (hare))
3286 break; 3298 break;
3287 if (--alias_loop_max == 0) 3299
3300 face_name = hare;
3301 hare = Fget (hare, Qface_alias);
3302 if (NILP (hare) || !SYMBOLP (hare))
3288 break; 3303 break;
3289 face_name = aliased; 3304
3305 tortoise = Fget (tortoise, Qface_alias);
3306 if (EQ (hare, tortoise))
3307 {
3308 if (signal_p)
3309 Fsignal (Qcircular_list, Fcons (orig_face, Qnil));
3310 return Qdefault;
3311 }
3290 } 3312 }
3291 3313
3292 return face_name; 3314 return face_name;
@@ -3310,7 +3332,7 @@ lface_from_face_name (f, face_name, signal_p)
3310{ 3332{
3311 Lisp_Object lface; 3333 Lisp_Object lface;
3312 3334
3313 face_name = resolve_face_name (face_name); 3335 face_name = resolve_face_name (face_name, signal_p);
3314 3336
3315 if (f) 3337 if (f)
3316 lface = assq_no_quit (face_name, f->face_alist); 3338 lface = assq_no_quit (face_name, f->face_alist);
@@ -4061,7 +4083,7 @@ FRAME 0 means change the face on all frames, and change the default
4061 CHECK_SYMBOL (face); 4083 CHECK_SYMBOL (face);
4062 CHECK_SYMBOL (attr); 4084 CHECK_SYMBOL (attr);
4063 4085
4064 face = resolve_face_name (face); 4086 face = resolve_face_name (face, 1);
4065 4087
4066 /* If FRAME is 0, change face on all frames, and change the 4088 /* If FRAME is 0, change face on all frames, and change the
4067 default for new frames. */ 4089 default for new frames. */
diff --git a/src/xmenu.c b/src/xmenu.c
index 7d34c627692..85beb56d861 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -737,7 +737,7 @@ DEFUN ("x-popup-menu", Fx_popup_menu, Sx_popup_menu, 2, 2, 0,
737POSITION is a position specification. This is either a mouse button event 737POSITION is a position specification. This is either a mouse button event
738or a list ((XOFFSET YOFFSET) WINDOW) 738or a list ((XOFFSET YOFFSET) WINDOW)
739where XOFFSET and YOFFSET are positions in pixels from the top left 739where XOFFSET and YOFFSET are positions in pixels from the top left
740corner of WINDOW's frame. (WINDOW may be a frame object instead of a window.) 740corner of WINDOW. (WINDOW may be a window or a frame object.)
741This controls the position of the top left of the menu as a whole. 741This controls the position of the top left of the menu as a whole.
742If POSITION is t, it means to use the current mouse position. 742If POSITION is t, it means to use the current mouse position.
743 743
@@ -752,8 +752,11 @@ Otherwise, REAL-DEFINITION should be a valid key binding definition.
752 752
753You can also use a list of keymaps as MENU. 753You can also use a list of keymaps as MENU.
754 Then each keymap makes a separate pane. 754 Then each keymap makes a separate pane.
755When MENU is a keymap or a list of keymaps, the return value 755
756is a list of events. 756When MENU is a keymap or a list of keymaps, the return value is the
757list of events corresponding to the user's choice. Note that
758`x-popup-menu' does not actually execute the command bound to that
759sequence of events.
757 760
758Alternatively, you can specify a menu of multiple panes 761Alternatively, you can specify a menu of multiple panes
759 with a list of the form (TITLE PANE1 PANE2...), 762 with a list of the form (TITLE PANE1 PANE2...),
@@ -2889,6 +2892,9 @@ xmenu_show (f, x, y, for_click, keymaps, title, error)
2889 } 2892 }
2890 } 2893 }
2891 } 2894 }
2895 else if (!for_click)
2896 /* Make "Cancel" equivalent to C-g. */
2897 Fsignal (Qquit, Qnil);
2892 2898
2893 return Qnil; 2899 return Qnil;
2894} 2900}
@@ -3519,8 +3525,8 @@ xmenu_show (f, x, y, for_click, keymaps, title, error)
3519 entry = Qnil; 3525 entry = Qnil;
3520 break; 3526 break;
3521 case XM_NO_SELECT: 3527 case XM_NO_SELECT:
3522 /* Make "Cancel" equivalent to C-g unless this menu was popped up by 3528 /* Make "Cancel" equivalent to C-g unless FOR_CLICK (which means
3523 a mouse press. */ 3529 the menu was invoked with a mouse event as POSITION). */
3524 if (! for_click) 3530 if (! for_click)
3525 Fsignal (Qquit, Qnil); 3531 Fsignal (Qquit, Qnil);
3526 entry = Qnil; 3532 entry = Qnil;