aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2005-02-18 00:41:50 +0000
committerMiles Bader2005-02-18 00:41:50 +0000
commit8d46efcc0f2045a1e5a2739c55ba6a88fbf4bcfc (patch)
treebc968a02587d51199537bb335d5494e756e35fdf
parent8589dc17f80450f5773a2d449fa6d94c9bb04fe3 (diff)
parent9b516537a9899900647d4eae5ec8778e6837ad3c (diff)
downloademacs-8d46efcc0f2045a1e5a2739c55ba6a88fbf4bcfc.tar.gz
emacs-8d46efcc0f2045a1e5a2739c55ba6a88fbf4bcfc.zip
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-15
Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-95 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-96 Move Gnus images into etc/images * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-97 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-105 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-14 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-15 Update from CVS: lisp/imap.el (imap-log): Doc fix. * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-16 Merge from emacs--cvs-trunk--0
-rw-r--r--admin/ChangeLog13
-rw-r--r--admin/FOR-RELEASE46
-rwxr-xr-xadmin/nt/makedist.bat251
-rw-r--r--etc/ChangeLog8
-rw-r--r--etc/NEWS8
-rw-r--r--etc/TODO2
-rw-r--r--etc/TUTORIAL.nl1471
-rw-r--r--etc/images/gnus/bar.xbm (renamed from lisp/gnus/bar.xbm)0
-rw-r--r--etc/images/gnus/bar.xpm (renamed from lisp/gnus/bar.xpm)0
-rw-r--r--etc/images/gnus/catchup.pbm (renamed from lisp/gnus/catchup.pbm)bin81 -> 81 bytes
-rw-r--r--etc/images/gnus/catchup.xpm (renamed from lisp/gnus/catchup.xpm)0
-rw-r--r--etc/images/gnus/cu-exit.pbm (renamed from lisp/gnus/cu-exit.pbm)bin81 -> 81 bytes
-rw-r--r--etc/images/gnus/cu-exit.xpm (renamed from lisp/gnus/cu-exit.xpm)0
-rw-r--r--etc/images/gnus/dead.xpm (renamed from lisp/gnus/dead.xpm)0
-rw-r--r--etc/images/gnus/describe-group.pbm (renamed from lisp/gnus/describe-group.pbm)bin81 -> 81 bytes
-rw-r--r--etc/images/gnus/describe-group.xpm (renamed from lisp/gnus/describe-group.xpm)0
-rw-r--r--etc/images/gnus/exit-gnus.pbm (renamed from lisp/gnus/exit-gnus.pbm)bin81 -> 81 bytes
-rw-r--r--etc/images/gnus/exit-gnus.xpm (renamed from lisp/gnus/exit-gnus.xpm)0
-rw-r--r--etc/images/gnus/exit-summ.pbm (renamed from lisp/gnus/exit-summ.pbm)bin81 -> 81 bytes
-rw-r--r--etc/images/gnus/exit-summ.xpm (renamed from lisp/gnus/exit-summ.xpm)0
-rw-r--r--etc/images/gnus/followup.pbm (renamed from lisp/gnus/followup.pbm)bin81 -> 81 bytes
-rw-r--r--etc/images/gnus/followup.xpm (renamed from lisp/gnus/followup.xpm)0
-rw-r--r--etc/images/gnus/fuwo.pbm (renamed from lisp/gnus/fuwo.pbm)bin81 -> 81 bytes
-rw-r--r--etc/images/gnus/fuwo.xpm (renamed from lisp/gnus/fuwo.xpm)0
-rw-r--r--etc/images/gnus/get-news.pbm (renamed from lisp/gnus/get-news.pbm)bin81 -> 81 bytes
-rw-r--r--etc/images/gnus/get-news.xpm (renamed from lisp/gnus/get-news.xpm)0
-rw-r--r--etc/images/gnus/gnntg.pbm (renamed from lisp/gnus/gnntg.pbm)bin81 -> 81 bytes
-rw-r--r--etc/images/gnus/gnntg.xpm (renamed from lisp/gnus/gnntg.xpm)0
-rw-r--r--etc/images/gnus/gnus-pointer.xbm (renamed from lisp/gnus/gnus-pointer.xbm)0
-rw-r--r--etc/images/gnus/gnus-pointer.xpm (renamed from lisp/gnus/gnus-pointer.xpm)0
-rw-r--r--etc/images/gnus/gnus.xbm (renamed from lisp/gnus/gnus.xbm)0
-rw-r--r--etc/images/gnus/gnus.xpm (renamed from lisp/gnus/gnus.xpm)0
-rw-r--r--etc/images/gnus/important.xpm (renamed from lisp/gnus/important.xpm)0
-rw-r--r--etc/images/gnus/kill-group.pbm (renamed from lisp/gnus/kill-group.pbm)bin81 -> 81 bytes
-rw-r--r--etc/images/gnus/kill-group.xpm (renamed from lisp/gnus/kill-group.xpm)0
-rw-r--r--etc/images/gnus/mail-reply.pbm (renamed from lisp/gnus/mail-reply.pbm)bin81 -> 81 bytes
-rw-r--r--etc/images/gnus/mail-reply.xpm (renamed from lisp/gnus/mail-reply.xpm)0
-rw-r--r--etc/images/gnus/next-ur.pbm (renamed from lisp/gnus/next-ur.pbm)bin81 -> 81 bytes
-rw-r--r--etc/images/gnus/next-ur.xpm (renamed from lisp/gnus/next-ur.xpm)0
-rw-r--r--etc/images/gnus/post.pbm (renamed from lisp/gnus/post.pbm)bin81 -> 81 bytes
-rw-r--r--etc/images/gnus/post.xpm (renamed from lisp/gnus/post.xpm)0
-rw-r--r--etc/images/gnus/prev-ur.pbm (renamed from lisp/gnus/prev-ur.pbm)bin81 -> 81 bytes
-rw-r--r--etc/images/gnus/prev-ur.xpm (renamed from lisp/gnus/prev-ur.xpm)0
-rw-r--r--etc/images/gnus/preview.xbm (renamed from lisp/gnus/preview.xbm)0
-rw-r--r--etc/images/gnus/preview.xpm (renamed from lisp/gnus/preview.xpm)0
-rw-r--r--etc/images/gnus/receipt.xpm (renamed from lisp/gnus/receipt.xpm)0
-rw-r--r--etc/images/gnus/reply-wo.pbm (renamed from lisp/gnus/reply-wo.pbm)bin81 -> 81 bytes
-rw-r--r--etc/images/gnus/reply-wo.xpm (renamed from lisp/gnus/reply-wo.xpm)0
-rw-r--r--etc/images/gnus/reply.pbm (renamed from lisp/gnus/reply.pbm)bin81 -> 81 bytes
-rw-r--r--etc/images/gnus/reply.xpm (renamed from lisp/gnus/reply.xpm)0
-rw-r--r--etc/images/gnus/reverse-smile.xpm (renamed from lisp/gnus/reverse-smile.xpm)0
-rw-r--r--etc/images/gnus/rot13.pbm (renamed from lisp/gnus/rot13.pbm)bin81 -> 81 bytes
-rw-r--r--etc/images/gnus/rot13.xpm (renamed from lisp/gnus/rot13.xpm)0
-rw-r--r--etc/images/gnus/save-aif.pbm (renamed from lisp/gnus/save-aif.pbm)bin81 -> 81 bytes
-rw-r--r--etc/images/gnus/save-aif.xpm (renamed from lisp/gnus/save-aif.xpm)0
-rw-r--r--etc/images/gnus/save-art.pbm (renamed from lisp/gnus/save-art.pbm)bin81 -> 81 bytes
-rw-r--r--etc/images/gnus/save-art.xpm (renamed from lisp/gnus/save-art.xpm)0
-rw-r--r--etc/images/gnus/subscribe.pbm (renamed from lisp/gnus/subscribe.pbm)bin81 -> 81 bytes
-rw-r--r--etc/images/gnus/subscribe.xpm (renamed from lisp/gnus/subscribe.xpm)0
-rw-r--r--etc/images/gnus/unimportant.xpm (renamed from lisp/gnus/unimportant.xpm)0
-rw-r--r--etc/images/gnus/unsubscribe.pbm (renamed from lisp/gnus/unsubscribe.pbm)bin81 -> 81 bytes
-rw-r--r--etc/images/gnus/unsubscribe.xpm (renamed from lisp/gnus/unsubscribe.xpm)0
-rw-r--r--etc/images/gnus/uu-decode.pbm (renamed from lisp/gnus/uu-decode.pbm)bin81 -> 81 bytes
-rw-r--r--etc/images/gnus/uu-decode.xpm (renamed from lisp/gnus/uu-decode.xpm)0
-rw-r--r--etc/images/gnus/uu-post.pbm (renamed from lisp/gnus/uu-post.pbm)bin81 -> 81 bytes
-rw-r--r--etc/images/gnus/uu-post.xpm (renamed from lisp/gnus/uu-post.xpm)0
-rw-r--r--etc/images/smilies/blink.pbm (renamed from lisp/gnus/blink.pbm)bin37 -> 37 bytes
-rw-r--r--etc/images/smilies/blink.xpm (renamed from lisp/gnus/blink.xpm)0
-rw-r--r--etc/images/smilies/braindamaged.xpm (renamed from lisp/gnus/braindamaged.xpm)0
-rw-r--r--etc/images/smilies/cry.xpm (renamed from lisp/gnus/cry.xpm)0
-rw-r--r--etc/images/smilies/evil.xpm (renamed from lisp/gnus/evil.xpm)0
-rw-r--r--etc/images/smilies/forced.xpm (renamed from lisp/gnus/forced.xpm)0
-rw-r--r--etc/images/smilies/frown.pbm (renamed from lisp/gnus/frown.pbm)bin37 -> 37 bytes
-rw-r--r--etc/images/smilies/frown.xpm (renamed from lisp/gnus/frown.xpm)0
-rw-r--r--etc/images/smilies/grin.xpm (renamed from lisp/gnus/grin.xpm)0
-rw-r--r--etc/images/smilies/indifferent.xpm (renamed from lisp/gnus/indifferent.xpm)0
-rw-r--r--etc/images/smilies/sad.pbm (renamed from lisp/gnus/sad.pbm)bin37 -> 37 bytes
-rw-r--r--etc/images/smilies/sad.xpm (renamed from lisp/gnus/sad.xpm)0
-rw-r--r--etc/images/smilies/smile.pbm (renamed from lisp/gnus/smile.pbm)bin37 -> 37 bytes
-rw-r--r--etc/images/smilies/smile.xpm (renamed from lisp/gnus/smile.xpm)0
-rw-r--r--etc/images/smilies/wry.pbm (renamed from lisp/gnus/wry.pbm)bin37 -> 37 bytes
-rw-r--r--etc/images/smilies/wry.xpm (renamed from lisp/gnus/wry.xpm)0
-rw-r--r--lisp/ChangeLog118
-rw-r--r--lisp/autorevert.el10
-rw-r--r--lisp/calc/calc-alg.el128
-rw-r--r--lisp/calc/calc-arith.el8
-rw-r--r--lisp/calc/calc-ext.el15
-rw-r--r--lisp/calc/calc-math.el389
-rw-r--r--lisp/calc/calc-rules.el10
-rw-r--r--lisp/calc/calc-undo.el3
-rw-r--r--lisp/calc/calc-units.el39
-rw-r--r--lisp/calc/calcalg2.el83
-rw-r--r--lisp/calc/calccomp.el2
-rw-r--r--lisp/cus-edit.el8
-rw-r--r--lisp/cus-start.el18
-rw-r--r--lisp/dired.el1
-rw-r--r--lisp/emacs-lisp/lisp-mode.el11
-rw-r--r--lisp/gnus/ChangeLog17
-rw-r--r--lisp/gnus/gnus.el5
-rw-r--r--lisp/gnus/imap.el6
-rw-r--r--lisp/gnus/mm-util.el2
-rw-r--r--lisp/gnus/smiley.el2
-rw-r--r--lisp/ido.el3
-rw-r--r--lisp/international/mule-cmds.el6
-rw-r--r--lisp/isearch.el35
-rw-r--r--lisp/menu-bar.el8
-rw-r--r--lisp/novice.el5
-rw-r--r--lisp/progmodes/gdb-ui.el75
-rw-r--r--lisp/replace.el16
-rw-r--r--lisp/textmodes/reftex-cite.el5
-rw-r--r--lisp/url/ChangeLog4
-rw-r--r--lisp/url/url-http.el2
-rw-r--r--lispref/ChangeLog69
-rw-r--r--lispref/compile.texi30
-rw-r--r--lispref/control.texi23
-rw-r--r--lispref/elisp.texi3
-rw-r--r--lispref/functions.texi86
-rw-r--r--lispref/hash.texi24
-rw-r--r--lispref/lists.texi109
-rw-r--r--lispref/loading.texi34
-rw-r--r--lispref/minibuf.texi5
-rw-r--r--lispref/numbers.texi62
-rw-r--r--lispref/objects.texi191
-rw-r--r--lispref/streams.texi2
-rw-r--r--lispref/symbols.texi4
-rw-r--r--lispref/variables.texi7
-rw-r--r--man/ChangeLog73
-rw-r--r--man/basic.texi21
-rw-r--r--man/dired.texi26
-rw-r--r--man/display.texi210
-rw-r--r--man/emacs.texi20
-rw-r--r--man/fixit.texi9
-rw-r--r--man/frames.texi2
-rw-r--r--man/help.texi80
-rw-r--r--man/indent.texi22
-rw-r--r--man/kmacro.texi23
-rw-r--r--man/major.texi13
-rw-r--r--man/msdog.texi64
-rw-r--r--man/programs.texi55
-rw-r--r--man/sending.texi16
-rw-r--r--man/text.texi10
-rw-r--r--man/trouble.texi18
-rw-r--r--man/windows.texi14
-rw-r--r--src/ChangeLog113
-rw-r--r--src/data.c4
-rw-r--r--src/dispextern.h15
-rw-r--r--src/doc.c11
-rw-r--r--src/emacs.c3
-rw-r--r--src/keyboard.c2
-rw-r--r--src/keymap.c77
-rw-r--r--src/keymap.h2
-rw-r--r--src/lread.c4
-rw-r--r--src/s/ms-w32.h2
-rw-r--r--src/w32.c2
-rw-r--r--src/w32.h22
-rw-r--r--src/w32select.c1079
-rw-r--r--src/xdisp.c149
-rw-r--r--src/xfns.c44
-rw-r--r--src/xselect.c20
-rw-r--r--src/xterm.c111
160 files changed, 3924 insertions, 1894 deletions
diff --git a/admin/ChangeLog b/admin/ChangeLog
index ac21c3aeabc..dbc48dfa696 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,8 @@
12005-02-15 Jason Rumney <jasonr@gnu.org>
2
3 * nt/makedist.bat: Do not rely on non-standard behaviour of
4 tar --exclude.
5
12004-11-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 62004-11-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2 7
3 * FOR-RELEASE (Indications): Remove two stage update for toolbar (Done). 8 * FOR-RELEASE (Indications): Remove two stage update for toolbar (Done).
@@ -31,7 +36,7 @@
31 36
32 * FOR-RELEASE: Remove entry about GTK and monochrome displays (done). 37 * FOR-RELEASE: Remove entry about GTK and monochrome displays (done).
33 38
342002-06-26 Eli Zaretskii <eliz@is.elta.co.il> 392004-06-26 Eli Zaretskii <eliz@is.elta.co.il>
35 40
36 * FOR-RELEASE: Moved here from the etc directory. 41 * FOR-RELEASE: Moved here from the etc directory.
37 42
@@ -44,6 +49,10 @@
44 * quick-install-emacs: Don't use "function" keyword when defining 49 * quick-install-emacs: Don't use "function" keyword when defining
45 shell functions. 50 shell functions.
46 51
522003-09-29 Lute Kamstra <lute@gnu.org>
53
54 * make-tarball.txt: Mention regenerating Emacs' AUTHORS file.
55
472003-09-27 Miles Bader <miles@gnu.ai.mit.edu> 562003-09-27 Miles Bader <miles@gnu.ai.mit.edu>
48 57
49 * quick-install-emacs: Remove fns-* pruning, since that file no 58 * quick-install-emacs: Remove fns-* pruning, since that file no
@@ -193,7 +202,7 @@
193 version of tar used. 202 version of tar used.
194 203
195;; Local Variables: 204;; Local Variables:
196;; coding: iso-2022-7bit-unix 205;; coding: iso-2022-7bit
197;; End: 206;; End:
198 207
199 Copyright (C) 2001 Free Software Foundation, Inc. 208 Copyright (C) 2001 Free Software Foundation, Inc.
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
index 55505c1ae6b..b4750dbc22d 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -218,40 +218,40 @@ man/anti.texi
218man/basic.texi "Luc Teirlinck" Chong Yidong 218man/basic.texi "Luc Teirlinck" Chong Yidong
219man/buffers.texi "Luc Teirlinck" Chong Yidong 219man/buffers.texi "Luc Teirlinck" Chong Yidong
220man/building.texi "Ted Zlatanov" <tzz@lifelogs.com> 220man/building.texi "Ted Zlatanov" <tzz@lifelogs.com>
221man/calendar.texi Joakim Verona <joakim@verona.se> 221man/calendar.texi joakim@verona.se
222man/cmdargs.texi Chong Yidong 222man/cmdargs.texi Chong Yidong
223man/commands.texi "Luc Teirlinck" 223man/commands.texi "Luc Teirlinck"
224man/custom.texi Chong Yidong 224man/custom.texi Chong Yidong
225man/dired.texi 225man/dired.texi Chong Yidong joakim@verona.se
226man/display.texi "Luc Teirlinck" 226man/display.texi "Luc Teirlinck" Chong Yidong
227man/emacs.texi "Luc Teirlinck" 227man/emacs.texi "Luc Teirlinck"
228man/entering.texi "Luc Teirlinck" Chong Yidong 228man/entering.texi "Luc Teirlinck" Chong Yidong
229man/files.texi "Luc Teirlinck" Chong Yidong 229man/files.texi "Luc Teirlinck" Chong Yidong
230man/fixit.texi "Luc Teirlinck" 230man/fixit.texi "Luc Teirlinck"
231man/frames.texi "Luc Teirlinck" Chong Yidong 231man/frames.texi "Luc Teirlinck" Chong Yidong
232man/glossary.texi 232man/glossary.texi
233man/help.texi "Luc Teirlinck" 233man/help.texi "Luc Teirlinck" Chong Yidong
234man/indent.texi "Luc Teirlinck" 234man/indent.texi "Luc Teirlinck" Chong Yidong
235man/killing.texi "Luc Teirlinck" Chong Yidong 235man/killing.texi "Luc Teirlinck" Chong Yidong
236man/kmacro.texi "Luc Teirlinck" 236man/kmacro.texi "Luc Teirlinck" Chong Yidong
237man/macos.texi 237man/macos.texi
238man/maintaining.texi 238man/maintaining.texi
239man/major.texi "Luc Teirlinck" 239man/major.texi "Luc Teirlinck" Chong Yidong
240man/mark.texi "Luc Teirlinck" 240man/mark.texi "Luc Teirlinck"
241man/mini.texi "Luc Teirlinck" 241man/mini.texi "Luc Teirlinck"
242man/misc.texi 242man/misc.texi
243man/msdog.texi 243man/msdog.texi Chong Yidong
244man/mule.texi "Luc Teirlinck" 244man/mule.texi "Luc Teirlinck"
245man/m-x.texi "Luc Teirlinck" 245man/m-x.texi "Luc Teirlinck"
246man/picture.texi Joakim Verona <joakim@verona.se> 246man/picture.texi Joakim Verona <joakim@verona.se>
247man/programs.texi "Stephen Eglen" 247man/programs.texi "Stephen Eglen" Chong Yidong
248man/regs.texi "Luc Teirlinck" Chong Yidong 248man/regs.texi "Luc Teirlinck" Chong Yidong
249man/rmail.texi 249man/rmail.texi
250man/screen.texi "Luc Teirlinck" 250man/screen.texi "Luc Teirlinck"
251man/search.texi "Luc Teirlinck" 251man/search.texi "Luc Teirlinck"
252man/sending.texi 252man/sending.texi
253man/text.texi "Luc Teirlinck" Chong Yidong 253man/text.texi "Luc Teirlinck" Chong Yidong
254man/trouble.texi 254man/trouble.texi Chong Yidong
255man/windows.texi "Luc Teirlinck" Chong Yidong 255man/windows.texi "Luc Teirlinck" Chong Yidong
256man/xresources.texi 256man/xresources.texi
257 257
@@ -271,47 +271,47 @@ lispref/backups.texi "Luc Teirlinck"
271lispref/buffers.texi "Luc Teirlinck" Chong Yidong 271lispref/buffers.texi "Luc Teirlinck" Chong Yidong
272lispref/calendar.texi Joakim Verona <joakim@verona.se> 272lispref/calendar.texi Joakim Verona <joakim@verona.se>
273lispref/commands.texi "Luc Teirlinck" 273lispref/commands.texi "Luc Teirlinck"
274lispref/compile.texi "Luc Teirlinck" 274lispref/compile.texi "Luc Teirlinck" Chong Yidong
275lispref/control.texi "Luc Teirlinck" 275lispref/control.texi "Luc Teirlinck" Chong Yidong
276lispref/customize.texi 276lispref/customize.texi
277lispref/debugging.texi Joakim Verona <joakim@verona.se> 277lispref/debugging.texi Joakim Verona <joakim@verona.se>
278lispref/display.texi 278lispref/display.texi
279lispref/edebug.texi 279lispref/edebug.texi
280lispref/elisp.texi "Luc Teirlinck" 280lispref/elisp.texi "Luc Teirlinck"
281lispref/errors.texi "Luc Teirlinck" 281lispref/errors.texi "Luc Teirlinck"
282lispref/eval.texi "Luc Teirlinck" 282lispref/eval.texi "Luc Teirlinck" Chong Yidong
283lispref/files.texi "Luc Teirlinck" Chong Yidong 283lispref/files.texi "Luc Teirlinck" Chong Yidong
284lispref/frames.texi "Luc Teirlinck" Chong Yidong 284lispref/frames.texi "Luc Teirlinck" Chong Yidong
285lispref/functions.texi "Luc Teirlinck" 285lispref/functions.texi "Luc Teirlinck" Chong Yidong
286lispref/hash.texi "Luc Teirlinck" 286lispref/hash.texi "Luc Teirlinck" Chong Yidong
287lispref/help.texi "Luc Teirlinck" 287lispref/help.texi "Luc Teirlinck"
288lispref/hooks.texi 288lispref/hooks.texi
289lispref/internals.texi "Luc Teirlinck" 289lispref/internals.texi "Luc Teirlinck"
290lispref/intro.texi "Luc Teirlinck" 290lispref/intro.texi "Luc Teirlinck"
291lispref/keymaps.texi "Luc Teirlinck" 291lispref/keymaps.texi "Luc Teirlinck"
292lispref/lists.texi "Luc Teirlinck" 292lispref/lists.texi "Luc Teirlinck" Chong Yidong
293lispref/loading.texi "Luc Teirlinck" 293lispref/loading.texi "Luc Teirlinck" Chong Yidong
294lispref/locals.texi 294lispref/locals.texi
295lispref/macros.texi "Luc Teirlinck" 295lispref/macros.texi "Luc Teirlinck"
296lispref/maps.texi 296lispref/maps.texi
297lispref/markers.texi "Luc Teirlinck" 297lispref/markers.texi "Luc Teirlinck"
298lispref/minibuf.texi "Luc Teirlinck" 298lispref/minibuf.texi "Luc Teirlinck" Chong Yidong
299lispref/modes.texi Chong Yidong 299lispref/modes.texi Chong Yidong
300lispref/nonascii.texi "Luc Teirlinck" 300lispref/nonascii.texi "Luc Teirlinck"
301lispref/numbers.texi "Luc Teirlinck" 301lispref/numbers.texi "Luc Teirlinck" Chong Yidong
302lispref/objects.texi "Luc Teirlinck" 302lispref/objects.texi "Luc Teirlinck" Chong Yidong
303lispref/os.texi "Luc Teirlinck" 303lispref/os.texi "Luc Teirlinck"
304lispref/positions.texi "Luc Teirlinck" Chong Yidong 304lispref/positions.texi "Luc Teirlinck" Chong Yidong
305lispref/processes.texi 305lispref/processes.texi
306lispref/searching.texi "Luc Teirlinck" 306lispref/searching.texi "Luc Teirlinck"
307lispref/sequences.texi "Luc Teirlinck" 307lispref/sequences.texi "Luc Teirlinck"
308lispref/streams.texi "Luc Teirlinck" 308lispref/streams.texi "Luc Teirlinck" Chong Yidong
309lispref/strings.texi "Luc Teirlinck" Chong Yidong 309lispref/strings.texi "Luc Teirlinck" Chong Yidong
310lispref/symbols.texi "Luc Teirlinck" 310lispref/symbols.texi "Luc Teirlinck" Chong Yidong
311lispref/syntax.texi "Luc Teirlinck" 311lispref/syntax.texi "Luc Teirlinck"
312lispref/text.texi Chong Yidong 312lispref/text.texi Chong Yidong
313lispref/tips.texi "Luc Teirlinck" 313lispref/tips.texi "Luc Teirlinck"
314lispref/variables.texi "Luc Teirlinck" 314lispref/variables.texi "Luc Teirlinck" Chong Yidong
315lispref/windows.texi "Luc Teirlinck" Chong Yidong 315lispref/windows.texi "Luc Teirlinck" Chong Yidong
316 316
317 317
diff --git a/admin/nt/makedist.bat b/admin/nt/makedist.bat
index feb6799080f..d48e6736004 100755
--- a/admin/nt/makedist.bat
+++ b/admin/nt/makedist.bat
@@ -1,127 +1,130 @@
1@echo off 1@echo off
2 2
3rem This batch file doesn't work with Cygwin tar because #files# 3rem Beware broken ports of tar. Recent cygwin versions work well, older
4rem has DOS line endings, which Cygwin tar misinterprets. 4rem cygwin versions and the current MSys port have problems with DOS
5rem I use the version of tar from 5rem line ends when reading file names from a file. Other ports have their
6rem ftp://ftp.gnu.org/gnu/windows/emacs/utilities/i386/tar-1.11.2a.exe 6rem own problems too.
7rem renamed as wtar.exe. 7set TAR=tar
8set TAR=wtar 8
9 9rem Make a copy of current Emacs source
10rem Make a copy of current Emacs source 10if (%3) == () goto usage
11if (%3) == () goto usage 11if not (%4) == () goto %4
12if not (%4) == () goto %4 12if not (%4) == (src) goto :lisp
13if not (%4) == (src) goto :lisp 13
14 14:src
15:src 15
16 16echo Create full source distribution, excluding leim
17echo Create full source distribution, excluding leim 17%TAR% --exclude leim --exclude _marker --exclude DOC --exclude DOC-X --exclude TAGS --exclude bin --exclude obj --exclude obj-spd --exclude oo --exclude oo-spd --exclude *~ --exclude *.rej -cvf - emacs-%1 | gzip -9 > %2-src.tar.gz
18%TAR% --exclude leim --exclude _marker --exclude DOC --exclude DOC-X --exclude TAGS --exclude bin --exclude obj --exclude obj-spd --exclude oo --exclude oo-spd --exclude *~ --exclude *.rej -cvf - emacs-%1 | gzip -9 > %2-src.tar.gz 18if not (%4) == () goto end
19if not (%4) == () goto end 19
20 20:lisp
21:lisp 21echo Create limited elisp source distribution
22echo Create limited elisp source distribution 22%TAR% --exclude *.rej --exclude *.elc --exclude *~ -cvf - emacs-%1/lisp | gzip -9 > %2-lisp.tar.gz
23%TAR% --exclude *.rej --exclude *.elc --exclude *~ -cvf - emacs-%1/lisp | gzip -9 > %2-lisp.tar.gz 23if not (%4) == () goto end
24if not (%4) == () goto end 24
25 25:bin
26:bin 26
27 27set eld=emacs-%1/lisp
28set eld=emacs-%1/lisp 28
29 29rem Keep this list in sync with the DONTCOMPILE list in lisp/makefile.w32-in
30rem Keep this list in sync with the DONTCOMPILE list in lisp/Makefile.in 30
31 31set elfiles=%eld%/cus-load.el %eld%/cus-start.el %eld%/emacs-lisp/cl-specs.el %eld%/eshell/esh-maint.el %eld%/eshell/esh-groups.el %eld%/finder-inf.el %eld%/forms-d2.el %eld%/forms-pass.el %eld%/generic-x.el %eld%/international/latin-1.el %eld%/international/latin-2.el %eld%/international/latin-3.el %eld%/international/latin-4.el %eld%/international/latin-5.el %eld%/international/latin-8.el %eld%/international/latin-9.el %eld%/international/mule-conf.el %eld%/loaddefs.el %eld%/loadup.el %eld%/mail/blessmail.el %eld%/patcomp.el %eld%/paths.el %eld%/play/bruce.el %eld%/subdirs.el %eld%/version.el
32set elfiles=%eld%/cus-load.el %eld%/cus-start.el %eld%/emacs-lisp/cl-specs.el %eld%/eshell/esh-maint.el %eld%/eshell/esh-groups.el %eld%/finder-inf.el %eld%/forms-d2.el %eld%/forms-pass.el %eld%/generic-x.el %eld%/international/latin-1.el %eld%/international/latin-2.el %eld%/international/latin-3.el %eld%/international/latin-4.el %eld%/international/latin-5.el %eld%/international/latin-8.el %eld%/international/latin-9.el %eld%/international/mule-conf.el %eld%/loaddefs.el %eld%/loadup.el %eld%/mail/blessmail.el %eld%/patcomp.el %eld%/paths.el %eld%/play/bruce.el %eld%/subdirs.el %eld%/version.el 32
33 33set fns_el=
34set fns_el= 34for %%f in (emacs-%1/bin/fns*) do set fns_el=%fns_el% emacs-%1/bin/%%f
35for %%f in (emacs-%1/bin/fns*) do set fns_el=%fns_el% emacs-%1/bin/%%f 35
36 36echo Create bin distribution
37echo Create bin distribution 37copy %3\README.W32 emacs-%1\README.W32
38copy %3\README.W32 emacs-%1\README.W32 38
39 39del #files# #elfiles#
40del #files# 40for %%f in (emacs-%1/BUGS emacs-%1/README emacs-%1/README.W32) do echo %%f>>#files#
41for %%f in (emacs-%1/BUGS emacs-%1/README emacs-%1/README.W32) do echo %%f>>#files# 41for %%f in (emacs-%1/bin/fns*) do echo emacs-%1/bin/%%f>>#elfiles#
42for %%f in (emacs-%1/bin/fns*) do echo emacs-%1/bin/%%f>>#files# 42for %%f in (emacs-%1/bin emacs-%1/etc emacs-%1/info emacs-%1/lisp) do echo %%f>>#files#
43for %%f in (emacs-%1/bin emacs-%1/etc emacs-%1/info emacs-%1/lisp %elfiles%) do echo %%f>>#files# 43for %%f in (emacs-%1/lock emacs-%1/site-lisp) do echo %%f>>#files#
44for %%f in (%eld%/term/*.el) do echo %eld%/term/%%f>>#files# 44for %%f in (%elfiles% emacs-%1/site-lisp/subdirs.el) do echo %%f>>#elfiles#
45for %%f in (emacs-%1/lock emacs-%1/site-lisp emacs-%1/site-lisp/subdirs.el) do echo %%f>>#files# 45for %%f in (%eld%/term/*.el) do echo %eld%/term/%%f>>#elfiles#
46%TAR% --exclude temacs.exe --exclude emacs.mdp --exclude *.pdb --exclude *.opt --exclude *.el --exclude *~ -T #files# -cvf - | gzip -9 > %2-bin-i386.tar.gz 46
47del emacs-%1\README.W32 47%TAR% --exclude temacs.exe --exclude emacs.mdp --exclude *.pdb --exclude *.opt --exclude "*.el" --exclude "*~" -T #files# -cvf %2-bin-i386.tar
48del #files# 48%TAR% -T #elfiles# -rvf %2-bin-i386.tar
49if not (%4) == () goto end 49gzip -9 %2-bin-i386.tar
50 50del emacs-%1\README.W32
51:fullbin 51rem del #files# #elfiles#
52 52if not (%4) == () goto end
53echo Create full bin distribution 53
54copy %3\README.W32 emacs-%1\README.W32 54:fullbin
55 55
56%TAR% --exclude temacs.exe --exclude emacs.mdp --exclude *.pdb --exclude *.opt --exclude *~ -cvf - emacs-%1/BUGS emacs-%1/README emacs-%1/README.W32 emacs-%1/bin emacs-%1/etc emacs-%1/info emacs-%1/lisp emacs-%1/lock emacs-%1/site-lisp | gzip -9 > %2-fullbin-i386.tar.gz 56echo Create full bin distribution
57del emacs-%1\README.W32 57copy %3\README.W32 emacs-%1\README.W32
58if not (%4) == () goto end 58
59 59%TAR% --exclude temacs.exe --exclude emacs.mdp --exclude *.pdb --exclude *.opt --exclude *~ -cvf - emacs-%1/BUGS emacs-%1/README emacs-%1/README.W32 emacs-%1/bin emacs-%1/etc emacs-%1/info emacs-%1/lisp emacs-%1/lock emacs-%1/site-lisp | gzip -9 > %2-fullbin-i386.tar.gz
60:leim 60del emacs-%1\README.W32
61 61if not (%4) == () goto end
62echo Create archive with precompiled leim files 62
63%TAR% -cvf - emacs-%1/leim/leim-list.el emacs-%1/leim/quail emacs-%1/leim/ja-dic | gzip -9 > %2-leim.tar.gz 63:leim
64if not (%4) == () goto end 64
65 65echo Create archive with precompiled leim files
66:undumped 66%TAR% -cvf - emacs-%1/leim/leim-list.el emacs-%1/leim/quail emacs-%1/leim/ja-dic | gzip -9 > %2-leim.tar.gz
67 67if not (%4) == () goto end
68echo Create archive with extra files needed for redumping emacs 68
69copy %3\README-UNDUMP.W32 emacs-%1\README-UNDUMP.W32 69:undumped
70copy %3\dump.bat emacs-%1\bin 70
71if exist emacs-%1\src\obj-spd\i386\temacs.exe copy emacs-%1\src\obj-spd\i386\temacs.exe emacs-%1\bin 71echo Create archive with extra files needed for redumping emacs
72if exist emacs-%1\src\oo-spd\i386\temacs.exe copy emacs-%1\src\oo-spd\i386\temacs.exe emacs-%1\bin 72copy %3\README-UNDUMP.W32 emacs-%1\README-UNDUMP.W32
73%TAR% -cvf - emacs-%1/README-UNDUMP.W32 emacs-%1/bin/dump.bat emacs-%1/bin/temacs.exe | gzip -9 > %2-undumped-i386.tar.gz 73copy %3\dump.bat emacs-%1\bin
74del emacs-%1\bin\temacs.exe 74if exist emacs-%1\src\obj-spd\i386\temacs.exe copy emacs-%1\src\obj-spd\i386\temacs.exe emacs-%1\bin
75del emacs-%1\bin\dump.bat 75if exist emacs-%1\src\oo-spd\i386\temacs.exe copy emacs-%1\src\oo-spd\i386\temacs.exe emacs-%1\bin
76del emacs-%1\README-UNDUMP.W32 76%TAR% -cvf - emacs-%1/README-UNDUMP.W32 emacs-%1/bin/dump.bat emacs-%1/bin/temacs.exe | gzip -9 > %2-undumped-i386.tar.gz
77if not (%4) == () goto end 77del emacs-%1\bin\temacs.exe
78 78del emacs-%1\bin\dump.bat
79:barebin 79del emacs-%1\README-UNDUMP.W32
80 80if not (%4) == () goto end
81echo Create archive with just the basic binaries and generated files 81
82echo (the user needs to unpack the full source distribution for 82:barebin
83echo everything else) 83
84copy %3\README.W32 emacs-%1\README.W32 84echo Create archive with just the basic binaries and generated files
85%TAR% -cvf - emacs-%1/README.W32 emacs-%1/bin emacs-%1/etc/DOC emacs-%1/etc/DOC-X | gzip -9 > %2-barebin-i386.tar.gz 85echo (the user needs to unpack the full source distribution for
86del emacs-%1\README.W32 86echo everything else)
87if not (%4) == () goto end 87copy %3\README.W32 emacs-%1\README.W32
88 88%TAR% -cvf - emacs-%1/README.W32 emacs-%1/bin emacs-%1/etc/DOC emacs-%1/etc/DOC-X | gzip -9 > %2-barebin-i386.tar.gz
89goto end 89del emacs-%1\README.W32
90 90if not (%4) == () goto end
91rem Only do this if explicitly requested 91
92:zipfiles 92goto end
93 93
94echo Create zip files for bin and lisp archives 94rem Only do this if explicitly requested
95mkdir distrib 95:zipfiles
96cd distrib 96
97gunzip -c ..\%2-bin-i386.tar.gz | %TAR% xf - 97echo Create zip files for bin and lisp archives
98rem Need to split emacs.exe into fragments because it is too big now 98mkdir distrib
99rem to fit on a floppy even by itself. 99cd distrib
100copy %3\stitch.bat %2\bin 100gunzip -c ..\%2-bin-i386.tar.gz | %TAR% xf -
101cd %2\bin 101rem Need to split emacs.exe into fragments because it is too big now
102split -b 1000000 emacs.exe emacs 102rem to fit on a floppy even by itself.
103del emacs.exe 103copy %3\stitch.bat %2\bin
104cd ..\.. 104cd %2\bin
105zip -rp9 em%5bin %2 105split -b 1000000 emacs.exe emacs
106rm -rf %2 106del emacs.exe
107zipsplit -n 1400000 -b .. em%5bin.zip 107cd ..\..
108del em%5bin.zip 108zip -rp9 em%5bin %2
109gunzip -c ..\%2-lisp.tar.gz | %TAR% xf - 109rm -rf %2
110zip -rp9 em%5lis %2 110zipsplit -n 1400000 -b .. em%5bin.zip
111rm -rf %2 111del em%5bin.zip
112zipsplit -n 1400000 -b .. em%5lis.zip 112gunzip -c ..\%2-lisp.tar.gz | %TAR% xf -
113del em%5lis.zip 113zip -rp9 em%5lis %2
114cd .. 114rm -rf %2
115 115zipsplit -n 1400000 -b .. em%5lis.zip
116goto end 116del em%5lis.zip
117 117cd ..
118:usage 118
119echo Generate source and binary distributions of emacs. 119goto end
120echo Usage: %0 emacs-version dist-basename distfiles [lisp,bin,undumped,barebin] 120
121echo (e.g., %0 19.34 emacs-19.34.5 d:\andrewi\distfiles) 121:usage
122echo Or: %0 emacs-version dist-basename distfiles "zipfiles" short-version 122echo Generate source and binary distributions of emacs.
123echo (e.g., %0 20.6 emacs-20.6 d:\andrewi\distfiles zipfiles 206) 123echo Usage: %0 emacs-version dist-basename distfiles [lisp,bin,undumped,barebin]
124:end 124echo (e.g., %0 19.34 emacs-19.34.5 d:\andrewi\distfiles)
125echo Or: %0 emacs-version dist-basename distfiles "zipfiles" short-version
126echo (e.g., %0 20.6 emacs-20.6 d:\andrewi\distfiles zipfiles 206)
127:end
125 128
126goto skipArchTag 129goto skipArchTag
127 arch-tag: 6e2ddd92-c1c9-4992-b6b5-207aaab72f68 130 arch-tag: 6e2ddd92-c1c9-4992-b6b5-207aaab72f68
diff --git a/etc/ChangeLog b/etc/ChangeLog
index e464e75dbe1..e357de8121a 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,11 @@
12005-02-14 Lute Kamstra <lute@gnu.org>
2
3 * TODO: Remove battery.el entry (DONE).
4
5 * TUTORIAL.nl: Synchronize with TUTORIAL. Correct some typos.
6 Make the terminology more consistent. Fill the text using the
7 default `fill-column'.
8
12005-02-08 Lute Kamstra <lute@gnu.org> 92005-02-08 Lute Kamstra <lute@gnu.org>
2 10
3 * TUTORIAL: Remove some uses of the term "buffer" before it is 11 * TUTORIAL: Remove some uses of the term "buffer" before it is
diff --git a/etc/NEWS b/etc/NEWS
index d3227df771e..b3db397d908 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2263,6 +2263,14 @@ some of them to initialize some of the default faces.
2263`list-colors-display' shows the list of System color names, in case 2263`list-colors-display' shows the list of System color names, in case
2264you wish to use them in other faces. 2264you wish to use them in other faces.
2265 2265
2266---
2267** On MS Windows NT/W2K/XP, Emacs uses Unicode for clipboard operations.
2268Those systems use Unicode internally, so this allows Emacs to share
2269multilingual text with other applications. On other versions of
2270MS Windows, Emacs now uses the appropriate locale coding-system, so
2271the clipboard should work correctly for your local language without
2272any customizations.
2273
2266+++ 2274+++
2267** Under X11, it is possible to swap Alt and Meta (and Super and Hyper). 2275** Under X11, it is possible to swap Alt and Meta (and Super and Hyper).
2268The new variables `x-alt-keysym', `x-hyper-keysym', `x-meta-keysym', 2276The new variables `x-alt-keysym', `x-hyper-keysym', `x-meta-keysym',
diff --git a/etc/TODO b/etc/TODO
index 406fa425c30..6f6f402206d 100644
--- a/etc/TODO
+++ b/etc/TODO
@@ -15,8 +15,6 @@ to the FSF.
15 ought to be possible to omit text which is invisible (due to a 15 ought to be possible to omit text which is invisible (due to a
16 text-property, overlay, or selective display) from the kill-ring. 16 text-property, overlay, or selective display) from the kill-ring.
17 17
18** battery.el display-battery should be replaced with a minor mode.
19
20** Redefine define-generic-mode as a macro, so the compiler 18** Redefine define-generic-mode as a macro, so the compiler
21 sees the definitions it generates. 19 sees the definitions it generates.
22 20
diff --git a/etc/TUTORIAL.nl b/etc/TUTORIAL.nl
index d02ddce4eb2..b4849dd73a1 100644
--- a/etc/TUTORIAL.nl
+++ b/etc/TUTORIAL.nl
@@ -1,5 +1,5 @@
1Copyright (c) 1985, 2004, 2005 Free Software Foundation, Inc; Zie de voorwaarden onderaan. 1Je leest nu de Emacs-inleiding. De kopieervoorwaarden staan onderaan.
2Je leest nu de Emacs-inleiding, zoals vertaald door Pieter Schoenmakers. 2Copyright (c) 1985, 1996, 1997, 2003, 2004, 2005 Free Software Foundation
3 3
4De meeste Emacs-commando's gebruiken de CONTROL-toets (soms CTRL of CTL 4De meeste Emacs-commando's gebruiken de CONTROL-toets (soms CTRL of CTL
5genaamd) en/of de META-toets (soms genaamd EDIT of ALT). In plaats van 5genaamd) en/of de META-toets (soms genaamd EDIT of ALT). In plaats van
@@ -7,31 +7,32 @@ steeds de volledige naam te noemen, gebruiken we de volgende afkortingen:
7 7
8 C-<ltr> betekent: houd de CONTROL-toets ingedrukt en tik de toets <ltr> 8 C-<ltr> betekent: houd de CONTROL-toets ingedrukt en tik de toets <ltr>
9 Dus C-f wordt: houd de CONTROL-toets ingedrukt en tik f. 9 Dus C-f wordt: houd de CONTROL-toets ingedrukt en tik f.
10 M-<ltr> betekent: houd de META-, EDIT- of ALT-toets ingedrukt en tik de 10 M-<ltr> betekent: houd de META-, EDIT- of ALT-toets ingedrukt en tik
11 toets <chr>. Als er geen toets META, EDIT of ALT is, kun je ook 11 de toets <ltr>. Als er geen toets META, EDIT of ALT is, kun
12 eerst de ESC-toets tikken, gevolgd door <ltr>. We verwijzen naar 12 je ook eerst de ESC-toets tikken, gevolgd door <ltr>. We
13 de ESC toets als <ESC>. 13 verwijzen naar de ESC-toets als <ESC>.
14 14
15BELANGRIJK: om Emacs te verlaten, tik C-x C-c (twee tekens). 15BELANGRIJK: om Emacs te verlaten, tik C-x C-c (twee tekens).
16De tekens ">>" tegen de linkerkantlijn nodigen je uit om een 16De tekens ">>" tegen de linkerkantlijn nodigen je uit om een bepaald
17bepaald commando te proberen. Bijvoorbeeld: 17commando te proberen. Bijvoorbeeld:
18<<Blank lines inserted here by startup of help-with-tutorial>> 18<<Blank lines inserted around following line by help-with-tutorial>>
19>> Tik nu C-v (volgend scherm) om naar het volgende scherm te gaan. 19[Lege regels om didactische redenen. Hieronder gaat het verder.]
20 (Geef nu het commando door de CONTROL-toets ingedrukt te houden 20>> Tik nu C-v (volgend scherm) om naar het volgende scherm te gaan.
21 terwijl je de v tikt.) 21 (Geef nu het commando door de CONTROL-toets ingedrukt te
22 Vanaf nu moet je dit steeds herhalen als je klaar bent met het 22 houden terwijl je de v tikt.) Vanaf nu moet je dit steeds
23 lezen van een scherm. 23 herhalen als je klaar bent met het lezen van een scherm.
24 24
25Merk op dat er een overlapping van twee regels is als je van een scherm naar 25Merk op dat er een overlapping van twee regels is als je van een
26het volgende gaat; dat zorgt voor continuïteit bij het lezen van 26scherm naar het volgende gaat; dat zorgt voor continuïteit bij het
27de tekst. 27lezen van de tekst.
28 28
29Het eerste wat je moet weten, is hoe je je naar verschillende plaatsen in de 29Het eerste wat je moet weten, is hoe je je naar verschillende plaatsen
30tekst kan bewegen. Je weet al hoe je een scherm vooruit moet gaan: met 30in de tekst kan bewegen. Je weet al hoe je een scherm vooruit moet
31C-v. Om een scherm terug te gaan, tik je M-v (houd de META-toets ingedrukt 31gaan: met C-v. Om een scherm terug te gaan, tik je M-v (houd de
32en tik v, of tik <ESC>-v als je geen META, EDIT of ALT toets hebt). 32META-toets ingedrukt en tik v, of tik <ESC> v als je geen META-, EDIT-
33of ALT-toets hebt).
33 34
34>> Probeer nu een paar keer M-v, steeds gevolgd door C-v. 35>> Probeer nu een paar keer M-v, steeds gevolgd door C-v.
35 36
36 37
37* SAMENVATTING 38* SAMENVATTING
@@ -39,16 +40,20 @@ en tik v, of tik <ESC>-v als je geen META, EDIT of ALT toets hebt).
39 40
40De volgende commando's zijn handig om volledige schermen te bekijken: 41De volgende commando's zijn handig om volledige schermen te bekijken:
41 42
42 C-v ga een scherm vooruit 43 C-v Ga een scherm vooruit
43 M-v ga een scherm terug 44 M-v Ga een scherm terug
44 C-l maak het scherm schoon en teken alle tekst 45 C-l Maak het scherm schoon en teken alle tekst opnieuw,
45 opnieuw, waarbij de regel waarop de cursor 46 waarbij de regel waarop de cursor staat, op het
46 staat, op het midden van het scherm terecht 47 midden van het scherm terecht komt. (C-l is
47 komt. (C-l is CONTROL-L, niet CONTROL-1.) 48 CONTROL-L, niet CONTROL-1.)
48 49
49>> Kijk waar de cursor staat, en onthoud de tekst errond. 50>> Kijk waar de cursor staat, en onthoud de tekst er omheen. Tik C-l.
50 Tik C-l. 51 Zoek de cursor en merk op dat hij nog steeds bij dezelfde tekst
51 Zoek de cursor en merk op dat hij nog steeds bij dezelfde tekst staat. 52 staat.
53
54Als je toetsenbord PageUp- en PageDn-toetsen heeft dan kun je deze ook
55gebruiken om een scherm terug dan wel vooruit te gaan, maar het werken
56met C-v en M-v is efficiënter.
52 57
53 58
54* BASISCOMMANDO'S CURSORBEWEGINGEN 59* BASISCOMMANDO'S CURSORBEWEGINGEN
@@ -58,12 +63,12 @@ Het is handig om je per scherm te bewegen, maar hoe beweeg je je nu
58naar een specifieke plaats op het scherm? 63naar een specifieke plaats op het scherm?
59 64
60Er is een aantal manieren waarop je dit kan doen. Je kan de 65Er is een aantal manieren waarop je dit kan doen. Je kan de
61pijltjestoetsen gebruiken, maar het is efficïenter om je handen in de 66pijltjestoetsen gebruiken, maar het is efficnter om je handen in de
62standaardhouding te laten, en de commando's C-p, C-b, C-f en C-n te 67standaardhouding te laten, en de commando's C-p, C-b, C-f en C-n te
63gebruiken. Elk van deze commando's 68gebruiken. Elk van deze commando's verplaatst de cursor precies een
64verplaatst de cursor precies een regel of teken in een bepaalde richting 69regel of teken in een bepaalde richting op het scherm. Hier volgt een
65op het scherm. Hier volgt een figuur met de vier commando's en de 70figuur met de vier commando's en de richting waarin ze de cursor
66richting waarin ze de cursor bewegen: 71bewegen:
67 72
68 vorige regel, C-p 73 vorige regel, C-p
69 : 74 :
@@ -73,113 +78,115 @@ richting waarin ze de cursor bewegen:
73 : 78 :
74 volgende regel, C-n 79 volgende regel, C-n
75 80
76>> Verplaats, met C-n of C-p, de cursor naar de middelste regel van 81>> Verplaats, met C-n of C-p, de cursor naar de middelste regel van de
77 de figuur. Tik dan C-l om de hele figuur in het midden van het 82 figuur. Tik dan C-l om de hele figuur in het midden van het
78 centrum te plaatsen. 83 centrum te plaatsen.
79 84
80Met een beetje kennis van het Engels zijn deze commando's gemakkelijk te 85Met een beetje kennis van het Engels zijn deze commando's gemakkelijk
81onthouden: de p komt van "previous" (vorige), de n van "next" (volgende), de 86te onthouden: de p komt van "previous" (vorige), de n van "next"
82b van "backward" (achteruit) en de f van "forward" (vooruit). Dit zijn de 87(volgende), de b van "backward" (achteruit) en de f van "forward"
83basiscommando's om de cursor te bewegen, dus je zult ze VOORTDUREND 88(vooruit). Dit zijn de basiscommando's om de cursor te bewegen, dus
84gebruiken: het is vooruitziend als je ze nu leert te gebruiken. 89je zult ze VOORTDUREND gebruiken: het is vooruitziend als je ze nu
90leert te gebruiken.
85 91
86>> Tik een paar keer C-n om de cursor op deze regel te krijgen. 92>> Tik een paar keer C-n om de cursor op deze regel te krijgen.
87 93
88>> Beweeg je binnen de regel met C-f (herhaaldelijk) en terug omhoog met C-p. 94>> Beweeg je binnen de regel met C-f (herhaaldelijk) en terug omhoog
89 Let op wat C-p doet als de cursor midden in een regel staat. 95 met C-p. Let op wat C-p doet als de cursor midden in een regel
96 staat.
90 97
91Elke regel eindigt met een Newline-teken (het Engelse "new line" betekent 98Elke regel eindigt met een Newline-teken (het Engelse "new line"
92"nieuwe regel"); dit teken scheidt elke regel van de volgende. De laatste 99betekent "nieuwe regel"); dit teken scheidt elke regel van de
93regel in een bestand zou eigenlijk ook met een Newline moeten eindigen (maar dat 100volgende. De laatste regel in een bestand zou eigenlijk ook met een
94is niet noodzakelijk voor Emacs). 101Newline moeten eindigen (maar dat is niet noodzakelijk voor Emacs).
95 102
96>> Probeer C-b aan het begin van een regel. 103>> Probeer C-b aan het begin van een regel. De cursor zal zich naar
97 De cursor zal zich naar het eind van de vorige regel bewegen, 104 het eind van de vorige regel bewegen, omdat je achteruit over het
98 omdat je achteruit over het Newline teken gaat. 105 Newline teken gaat.
99 106
100Net als C-b kan ook C-f zich over Newline-tekens heen bewegen. 107Net als C-b kan ook C-f zich over Newline-tekens heen bewegen.
101 108
102>> Tik nog een aantal keren het commando C-b, zodat je een gevoel krijgt waar de 109>> Tik nog een aantal keren het commando C-b, zodat je een gevoel
103 cursor is. 110 krijgt waar de cursor is. Tik dan enkele keren C-f om de cursor
104 Tik dan enkele keren C-f om de cursor terug naar het einde van de regel 111 terug naar het einde van de regel te bewegen. Een verder C-f
105 te bewegen. 112 commando beweegt de cursor dan naar de volgende regel.
106 Een verder C-f commando beweegt de cursor dan naar de volgende regel.
107 113
108Wanneer je de cursor voorbij het begin of het einde van het scherm beweegt, 114Wanneer je de cursor voorbij het begin of het einde van het scherm
109zal de tekst over het scherm heen schuiven. Dit heet "scrollen", of 115beweegt, zal de tekst over het scherm heen schuiven. Dit heet
110"schuiven" in goed Nederlands. Door te scrollen zorgt Emacs ervoor dat de 116"scrollen", of "schuiven" in goed Nederlands. Door te scrollen zorgt
111cursor de gewenste beweging kan maken zonder dat de cursor van het scherm 117Emacs ervoor dat de cursor de gewenste beweging kan maken zonder dat
112af beweegt. 118de cursor van het scherm af beweegt.
113 119
114>> Probeer de cursor voorbij de onderkant van het scherm te bewegen met 120>> Probeer de cursor voorbij de onderkant van het scherm te bewegen
115 C-n en zie wat er gebeurt. 121 met C-n en zie wat er gebeurt.
116 122
117Als de beweging per teken te langzaam gaat, kan je de cursor ook per 123Als de beweging per teken te langzaam gaat, kan je de cursor ook per
118woord bewegen. M-f (META-f) beweegt de cursor een woord vooruit en M-b 124woord bewegen. M-f (META-f) beweegt de cursor een woord vooruit en
119een woord achteruit. 125M-b een woord achteruit.
120 126
121>> Tik enkele keren M-f en M-b. 127>> Tik enkele keren M-f en M-b.
122 128
123Als je midden in een woord staat, beweegt M-f de cursor naar het eind van 129Als je midden in een woord staat, beweegt M-f de cursor naar het eind
124het woord. Als je op een witte ruimte tussen twee woorden staat, beweegt M-f de 130van het woord. Als je op een witte ruimte tussen twee woorden staat,
125cursor naar het eind van het volgende woord. Het commando M-b beweegt 131beweegt M-f de cursor naar het eind van het volgende woord. Het
126de cursor analoog de andere kant op. 132commando M-b beweegt de cursor analoog de andere kant op.
127 133
128>> Tik enkele keren M-f en M-b en daar tussendoor een paar maal C-f en C-b, 134>> Tik enkele keren M-f en M-b en daar tussendoor een paar maal C-f en
129 zodat je ziet wat M-f en M-b doen vanaf bepaalde plaatsen in een 135 C-b, zodat je ziet wat M-f en M-b doen vanaf bepaalde plaatsen in
130 woord en tussen twee woorden. 136 een woord en tussen twee woorden.
131 137
132Merk op dat er een analogie bestaat tussen enerzijds C-f en C-b en 138Merk op dat er een analogie bestaat tussen enerzijds C-f en C-b en
133anderzijds M-f en M-b. Het is bij veel commando's zo dat META-tekens 139anderzijds M-f en M-b. Het is bij veel commando's zo dat META-tekens
134gebruikt worden om iets te doen in eenheden van de taal (woorden, 140gebruikt worden om iets te doen in eenheden van de taal (woorden,
135zinnen, alinea's) terwijl Control-tekens te maken hebben met dingen die 141zinnen, alinea's) terwijl CONTROL-tekens te maken hebben met dingen
136los staan van wat je aan het editeren bent (tekens, regels, enz.). 142die los staan van wat je aan het bewerken bent (tekens, regels, enz.).
137 143
138Deze analogie gaat ook op voor regels en zinnen: C-a en C-e bewegen de 144Deze analogie gaat ook op voor regels en zinnen: C-a en C-e bewegen de
139cursor naar het begin of eind van een regel, terwijl met M-a, 145cursor naar het begin of eind van een regel, terwijl met M-a,
140respectievelijk M-e, de cursor naar het begin, respectievelijk het eind, 146respectievelijk M-e, de cursor naar het begin, respectievelijk het
141van een zin gaat. 147eind, van een zin gaat.
142 148
143>> Tik enkele keren C-a, en dan een enkele keren C-e. 149>> Tik enkele keren C-a, en dan een enkele keren C-e.
144 Tik een paar maal M-a, en dan enkele keren M-e. 150 Tik een paar maal M-a, en dan enkele keren M-e.
145 151
146Bemerk hoe herhaalde C-a commando's niets doen, terwijl herhaalde M-a 152Bemerk hoe herhaalde C-a commando's niets doen, terwijl herhaalde M-a
147commando's de cursor steeds een zin achteruit bewegen. Alhoewel ze niet volledig 153commando's de cursor steeds een zin achteruit bewegen. Alhoewel ze
148overeenkomen, is het gedrag van beide heel natuurlijk. 154niet volledig overeenkomen, is het gedrag van beide heel natuurlijk.
149 155
150De plaats van de cursor in de tekst wordt "punt" genoemd (zonder 156De plaats van de cursor in de tekst wordt "punt" genoemd (zonder
151lidwoord, "point" in het Engels). Anders gezegd: de cursor laat op het 157lidwoord, "point" in het Engels). Anders gezegd: de cursor laat op
152scherm de plek zien waar punt in de tekst staat. 158het scherm de plek zien waar punt in de tekst staat.
153 159
154Nu volgt een samenvatting van eenvoudige cursorbewegingen, 160Nu volgt een samenvatting van eenvoudige cursorbewegingen, met
155met inbegrip van de commando's die de cursor per woord of zin bewegen: 161inbegrip van de commando's die de cursor per woord of zin bewegen:
156 162
157 C-f ga een teken vooruit 163 C-f Ga een teken vooruit
158 C-b ga een teken achteruit 164 C-b Ga een teken achteruit
159 165
160 M-f ga een woord vooruit 166 M-f Ga een woord vooruit
161 M-b ga een woord achteruit 167 M-b Ga een woord achteruit
162 168
163 C-n ga naar de volgende regel 169 C-n Ga naar de volgende regel
164 C-p ga naar de vorige regel 170 C-p Ga naar de vorige regel
165 171
166 C-a ga naar het begin van de regel 172 C-a Ga naar het begin van de regel
167 C-e ga naar het eind van de regel 173 C-e Ga naar het eind van de regel
168 174
169 M-a ga terug naar het begin van de zin 175 M-a Ga terug naar het begin van de zin
170 M-e ga vooruit naar het eind van de zin 176 M-e Ga vooruit naar het eind van de zin
171 177
172>> Probeer al deze commando's een paar keer als oefening. 178>> Probeer al deze commando's een paar keer als oefening. Deze
173 Deze commando's worden het vaakst gebruikt. 179 commando's worden het vaakst gebruikt.
174 180
175Er zijn nog twee belangrijke cursorbewegingen: M-< 181Er zijn nog twee belangrijke cursorbewegingen: M-< (META kleiner-dan)
176(META kleiner-dan) beweegt de cursor naar het begin van het bestand, 182beweegt de cursor naar het begin van het bestand, en M-> (META
177en M-> (META groter-dan) beweegt hem naar het eind. 183groter-dan) beweegt hem naar het eind.
178 184
179Op de meeste toetsenborden zit de '<' boven de komma, zodat je de 185Op de meeste toetsenborden zit de '<' boven de komma, zodat je de
180Shift-toets (ook wel bekend als de hoofdlettertoets) moet gebruiken om het 186Shift-toets (ook wel bekend als de hoofdlettertoets) moet gebruiken om
181'<'-teken in te tikken. Op deze toetsenborden moet je ook de shift 187het '<'-teken in te tikken. Op deze toetsenborden moet je ook de
182gebruiken om M-< in te tikken: zonder shift zou je M-, (META komma) tikken. 188shift gebruiken om M-< in te tikken: zonder shift zou je M-, (META
189komma) tikken.
183 190
184>> Tik nu M-< om naar het begin van dit bestand te gaan. 191>> Tik nu M-< om naar het begin van dit bestand te gaan.
185 Gebruik daarna C-v om hier weer terug te komen. 192 Gebruik daarna C-v om hier weer terug te komen.
@@ -187,24 +194,25 @@ gebruiken om M-< in te tikken: zonder shift zou je M-, (META komma) tikken.
187>> Tik nu M-> om naar het eind van het bestand te springen. 194>> Tik nu M-> om naar het eind van het bestand te springen.
188 Gebruik daarna M-v om hier weer terug te komen. 195 Gebruik daarna M-v om hier weer terug te komen.
189 196
190Als je toetsenbord pijltjestoetsen heeft, kan je die ook gebruiken om de 197Als je toetsenbord pijltjestoetsen heeft, kan je die ook gebruiken om
191cursor te verplaatsen. We raden je aan om C-b, C-f, C-n en C-p 198de cursor te verplaatsen. We raden je aan om C-b, C-f, C-n en C-p te
192te leren, om drie redenen. Ten eerste werken ze op alle 199leren, om drie redenen. Ten eerste werken ze op alle toetsenborden,
193toetsenborden, ook die zonder pijltjestoetsen. Ten tweede zul je merken 200ook die zonder pijltjestoetsen. Ten tweede zul je merken dat wanneer
194dat wanneer je eenmaal wat ervaring hebt opgedaan in de omgang met 201je eenmaal wat ervaring hebt opgedaan in de omgang met Emacs, het
195Emacs, het gebruik van de CTRL-tekens sneller is dan werken met de 202gebruik van de CONTROL-tekens sneller is dan werken met de
196pijltjestoetsen (omdat je handen in de normale tikpositie kunnen blijven). Ten 203pijltjestoetsen (omdat je handen in de normale tikpositie kunnen
197derde, als je eenmaal gewend bent aan deze commando's met CTRL-tekens, 204blijven). Ten derde, als je eenmaal gewend bent aan deze commando's
198kan je makkelijk andere gevorderde cursorbewegingscommando's leren. 205met CONTROL-tekens, kan je makkelijk andere gevorderde
206cursorbewegingscommando's leren.
199 207
200De meeste Emacs-commando's accepteren een numeriek argument. Voor de 208De meeste Emacs-commando's accepteren een numeriek argument. Voor de
201meeste commando's is dit argument het aantal keren dat het commando 209meeste commando's is dit argument het aantal keren dat het commando
202herhaald moet worden. Je geeft dit numerieke argument aan met C-u en 210herhaald moet worden. Je geeft dit numerieke argument aan met C-u en
203vervolgens de cijfers van het getal, vóór het commando. 211vervolgens de cijfers van het getal, vóór het commando. Als je
204Als je toetsenbord een META- (of EDIT- of ALT-) toets hebt, is er ook 212toetsenbord een META- (of EDIT- of ALT-) toets heeft, is er ook een
205een andere manier om het getal aan te geven: tik de cijfers terwijl 213andere manier om het getal aan te geven: tik de cijfers terwijl je de
206je de META toets ingedrukt houdt. We raden je aan de C-u manier te 214META toets ingedrukt houdt. We raden je aan de C-u manier te leren
207leren omdat die beschikbaar is op elke terminal. 215omdat die beschikbaar is op elke terminal.
208 216
209Bijvoorbeeld, C-u 8 C-f beweegt de cursor 8 plaatsen naar voren. 217Bijvoorbeeld, C-u 8 C-f beweegt de cursor 8 plaatsen naar voren.
210 218
@@ -212,194 +220,221 @@ Bijvoorbeeld, C-u 8 C-f beweegt de cursor 8 plaatsen naar voren.
212 met slechts een commando naar een regel in de buurt van deze zin te 220 met slechts een commando naar een regel in de buurt van deze zin te
213 bewegen. 221 bewegen.
214 222
215Voor de meeste commando's is het numerieke argument het aantal keren dat 223Voor de meeste commando's is het numerieke argument het aantal keren
216het commando herhaald moet worden. Voor sommige commando's betekent het 224dat het commando herhaald moet worden. Voor sommige commando's
217echter iets anders. Verschillende commando's (die je totnogtoe niet 225betekent het echter iets anders. Verschillende commando's (die je
218geleerd hebt) gebruiken het als een vlag -- de aanwezigheid van een 226totnogtoe niet geleerd hebt) gebruiken het als een vlag -- de
219prefix-argument, ongeacht zijn waarde, maakt dat het commando iets anders 227aanwezigheid van een prefix-argument, ongeacht zijn waarde, maakt dat
220doet. 228het commando iets anders doet.
221 229
222C-v en M-v vormen een andere uitzondering. Met een numeriek 230C-v en M-v vormen een andere uitzondering. Met een numeriek argument
223argument verschuiven deze commando's de tekst het aangegeven aantal regels 231verschuiven deze commando's de tekst het aangegeven aantal regels in
224in plaats van (bijna) een heel scherm. Bijvoorbeeld, C-u 4 C-v verschuift 232plaats van (bijna) een heel scherm. Bijvoorbeeld, C-u 4 C-v
225de tekst 4 regels. 233verschuift de tekst 4 regels.
226 234
227>> Probeer nu C-u 8 C-v. 235>> Probeer nu C-u 8 C-v.
228 236
229Daarmee zou je tekst 8 regels opgeschoven moeten zijn. Als je terug 237Daarmee zou je tekst 8 regels opgeschoven moeten zijn. Als je terug
230omlaag wil scrollen, kan je M-v een argument geven. 238omlaag wil scrollen, kan je M-v een argument geven.
231 239
232Als je een scherm met vensters gebruikt, zoals X Windows of MS-Windows, 240Als je een scherm met vensters gebruikt, zoals X Windows of
233zou je een grote rechthoek moeten zien aan de linkerkant van het 241MS-Windows, zou je een grote rechthoek moeten zien aan de linkerkant
234Emacs-venster. Deze rechthoek heet een schuifbalk ("scrollbar"). Je kan 242van het Emacs-venster. Deze rechthoek heet een schuifbalk
235de tekst scrollen door met de muis in de schuifbalk te klikken. 243("scrollbar"). Je kan de tekst scrollen door met de muis in de
244schuifbalk te klikken.
236 245
237>> Klik met de middelste muisknop bovenaan het heldere gebied in de 246>> Klik met de middelste muisknop bovenaan het heldere gebied in de
238 schuifbalk. Dit zou de tekst moeten verschuiven naar een positie die 247 schuifbalk. Dit zou de tekst moeten verschuiven naar een positie
239 afhankelijk is van hoe hoog of laag je klikt. 248 die afhankelijk is van hoe hoog of laag je klikt.
240 249
241>> Beweeg de muis op en neer terwijl je de middelste muisknop ingedrukt 250>> Beweeg de muis op en neer terwijl je de middelste muisknop
242 houdt. Je zal zien dat de tekst met de muis mee heen en weer scrollt. 251 ingedrukt houdt. Je zal zien dat de tekst met de muis mee heen en
252 weer scrollt.
243 253
244 254
245* ALS EMACS HANGT 255* ALS EMACS HANGT
246----------------- 256-----------------
247 257
248Als Emacs niet meer op commando's reageert, kan je het veilig onderbreken 258Als Emacs niet meer op commando's reageert, kan je het veilig
249door C-g te tikken. Je kan C-g gebruiken om een commando te stoppen als 259onderbreken door C-g te tikken. Je kan C-g gebruiken om een commando
250het te lang duurt om uit te voeren. 260te stoppen als het te lang duurt om uit te voeren.
251 261
252Je kan C-g ook gebruiken om een numeriek argument te verwijderen of om het 262Je kan C-g ook gebruiken om een numeriek argument te verwijderen of om
253begin van een commando dat je niet wilt afmaken, te verwijderen. 263het begin van een commando dat je niet wilt afmaken, te verwijderen.
254 264
255>> Tik nu C-u 100 om een numeriek argument te maken met de waarde 100, en 265>> Tik nu C-u 100 om een numeriek argument te maken met de waarde 100,
256 tik dan C-g. Tik vervolgens C-f. Het zou de cursor maar 266 en tik dan C-g. Tik vervolgens C-f. Het zou de cursor maar één
257 één positie mogen verplaatsen, omdat je het argument verwijderd hebt met C-g. 267 positie mogen verplaatsen, omdat je het argument verwijderd hebt
268 met C-g.
258 269
259Als je per ongeluk een <ESC> tikt, kan je dat ongedaan maken met het 270Als je per ongeluk een <ESC> tikt, kan je dat ongedaan maken met het
260commando C-g. 271commando C-g.
261 272
262 273
263* ONMOGELIJKE COMMANDO'S 274* UITGESCHAKELDE COMMANDO'S
264------------------------ 275---------------------------
265 276
266Sommige Emacs-commando's zijn uitgeschakeld zodat beginnende gebruikers ze 277Sommige Emacs-commando's zijn uitgeschakeld zodat beginnende
267niet per ongeluk kunnen uitvoeren. 278gebruikers ze niet per ongeluk kunnen uitvoeren.
268 279
269Als je een van de uitgeschakelde commando's intikt, laat Emacs uitleg zien 280Als je een van de uitgeschakelde commando's intikt, laat Emacs uitleg
270over het commando dat je gegeven hebt, en vraagt of je het werkelijk wil 281zien over het commando dat je gegeven hebt, en vraagt of je het
271uitvoeren. 282werkelijk wil uitvoeren.
272 283
273Wanneer je het commando echt wil uitvoeren, tik dan Spatie (de 284Wanneer je het commando echt wil uitvoeren, tik dan <SPC> (de
274spatiebalk) als antwoord op de vraag. Normaal wil je het commando niet 285spatiebalk) als antwoord op de vraag. Normaal wil je het commando
275uitvoeren en beantwoord je de vraag met "n" (van "no" of "nee"). 286niet uitvoeren en beantwoord je de vraag met "n" (van "no" of "nee").
276 287
277>> Tik C-x C-l (een uitgeschakeld commando), 288>> Tik C-x C-l (een uitgeschakeld commando), en tik dan n als antwoord
278 en tik dan n als antwoord op de vraag. 289 op de vraag.
279 290
280 291
281* VENSTERS 292* VENSTERS
282---------- 293----------
283 294
284Emacs kan meerdere vensters laten zien, elk venster met zijn eigen tekst. 295Emacs kan meerdere vensters laten zien, elk venster met zijn eigen
285We zullen later uitleggen hoe je met meerdere vensters om kan gaan. Op 296tekst. We zullen later uitleggen hoe je met meerdere vensters om kan
286dit moment willen we slechts uitleggen hoe je van extra vensters af kunt 297gaan. Op dit moment willen we slechts uitleggen hoe je van extra
287komen en terug kan keren naar eenvoudig editeren met één venster. Het is 298vensters af kunt komen en terug kan keren naar het werken met één
288eenvoudig: 299venster. Het is eenvoudig:
289 300
290 C-x 1 een enkel venster (dat wil zeggen: verwijder alle andere vensters) 301 C-x 1 Een enkel venster (dat wil zeggen: verwijder alle
302 andere vensters).
291 303
292Het commando is CONTROL-x gevolgd door het cijfer 1. C-x 1 vergroot het 304Het commando is CONTROL-x gevolgd door het cijfer 1. C-x 1 vergroot
293venster waar de cursor in staat tot het hele scherm. Alle andere vensters 305het venster waar de cursor in staat tot het hele scherm. Alle andere
294worden verwijderd. 306vensters worden verwijderd.
295 307
296>> Zet de cursor op deze regel en tik C-u 0 C-l. 308>> Zet de cursor op deze regel en tik C-u 0 C-l.
297>> Tik nu Control-h k Control-f. 309>> Tik nu C-h k C-f.
298 Zie hoe dit venster kleiner is geworden, terwijl een nieuw venster verschijnt 310 Zie hoe dit venster kleiner is geworden, terwijl een nieuw venster
299 om de documentatie van het Control-f commando te laten zien. 311 verschijnt om de documentatie van het C-f commando te laten zien.
300 312
301>> Tik nu C-x 1 en zie het documentatievenster verdwijnen. 313>> Tik nu C-x 1 en zie het documentatievenster verdwijnen.
302 314
315Dit commando is anders dan de commando's die je tot nu toe geleerd
316hebt aangezien het uit twee tekens bestaat. Het begint met het teken
317CONTROL-x. Er zijn een heleboel commando's die met CONTROL-x
318beginnen. Veel van die commando's hebben te maken met vensters,
319bestanden, buffers, en gelijkaardige dingen. Dergelijke commando's
320bestaan uit twee, drie of vier tekens.
321
303 322
304* TOEVOEGEN EN WEGHALEN 323* TOEVOEGEN EN WEGHALEN
305----------------------- 324-----------------------
306 325
307Als je tekst toe wil voegen, tik je die eenvoudigweg in. Tekens die je 326Als je tekst toe wil voegen, tik je die eenvoudigweg in. Tekens die
308kan zien, zoals A, 7, * en dergelijke, worden door Emacs als tekst 327je kan zien, zoals A, 7, * en dergelijke, worden door Emacs als tekst
309geïnterpreteerd en meteen aan de tekst toegevoegd. Tik <Return> (de 328geïnterpreteerd en meteen aan de tekst toegevoegd. Tik <Return> (de
310"volgende regel"-toets) om een Newline toe te voegen en dus een nieuwe 329"volgende regel"-toets) om een Newline toe te voegen en dus een nieuwe
311regel te beginnen. 330regel te beginnen.
312 331
313Je kan het laatste teken dat je hebt ingetikt weghalen door <Delback> te tikken. 332Je kan het laatste teken dat je hebt ingetikt weghalen door <Delback>
314<Delback> is een toets op het toetsenbord -- dezelfde toets die je normaal 333te tikken. <Delback> is een toets op het toetsenbord -- dezelfde
315gesproken gebruikt, buiten Emacs, om het laatst ingetikte teken te wissen. 334toets die je normaal gesproken gebruikt, buiten Emacs, om het laatst
316Het is meestal een grote toets, een paar rijen boven de <Return>-toets, 335ingetikte teken te wissen. Het is meestal een grote toets, een paar
317waar "Delete", "Del" of "Backspace" op staat. 336rijen boven de <Return>-toets, waar "Delete", "Del" of "Backspace" op
337staat.
318 338
319Als er op die grote toets "Backspace" staat, dan is dat degene die je 339Als er op die grote toets "Backspace" staat, dan is dat degene die je
320gebruikt voor <Delback>. Er kan op een andere plaats ook nog een andere 340gebruikt voor <Delback>. Er kan op een andere plaats ook nog een
321toets zijn waarop "Delete" staat, maar dat is niet <Delback>. 341andere toets zijn waarop "Delete" staat, maar dat is niet <Delback>.
322 342
323In het algemeen haalt <Delback> het teken weg dat juist voor de cursorpositie 343In het algemeen haalt <Delback> het teken weg dat juist voor de
324staat. 344cursorpositie staat.
325 345
326>> Probeer dit nu: tik een paar letters en haal ze weer weg door een paar 346>> Probeer dit nu: tik een paar letters en haal ze weer weg door een
327 keer op <Delback> te drukken. Maak je niet druk over het feit dat dit 347 paar keer op <Delback> te drukken. Maak je niet druk over het feit
328 bestand verandert; je zal niets veranderen aan de originele versie van 348 dat dit bestand verandert; je zal niets veranderen aan de originele
329 deze inleiding. Je zit slechts je eigen kopie te wijzigen. 349 versie van deze inleiding. Je zit slechts je eigen kopie te
350 wijzigen.
330 351
331Als een regel tekst te lang wordt om helemaal op het scherm getoond 352Als een regel tekst te lang wordt om helemaal op het scherm getoond te
332te worden, dan gaat hij verder op de volgende schermregel. Een backslash 353worden, dan gaat hij verder op de volgende schermregel. Een backslash
333("\") in de rechtermarge (of, als je een scherm met vensters 354("\") in de rechtermarge (of, als je een scherm met vensters gebruikt,
334gebruikt, een kleine gebogen pijl) laat dan zien dat de regel op de 355een kleine gebogen pijl) laat dan zien dat de regel op de volgende
335volgende schermregel verder gaat. 356schermregel verder gaat.
336 357
337>> Voeg nu tekst toe totdat je de rechter kantlijn raakt, en blijf 358>> Voeg nu tekst toe totdat je de rechter kantlijn raakt, en blijf
338 toevoegen. Je zal zien dat er een vervolgregel verschijnt. 359 toevoegen. Je zal zien dat er een vervolgregel verschijnt.
339 360
340>> Tik weer enkele keren <Delback> om zoveel tekens weg te halen tot 361>> Tik weer enkele keren <Delback> om zoveel tekens weg te halen tot
341 de regel weer op een schermregel past. De vervolgregel zal verdwijnen. 362 de regel weer op een schermregel past. De vervolgregel zal
363 verdwijnen.
342 364
343Je kan een Newline zoals elk ander teken verwijderen. Als je een Newline 365Je kan een Newline zoals elk ander teken verwijderen. Als je een
344verwijdert, voeg je de twee regels waar de Newline tussen staat samen tot een 366Newline verwijdert, voeg je de twee regels waar de Newline tussen
345enkele regel. Als de regel die het resultaat is van deze operatie niet op 367staat samen tot een enkele regel. Als de regel die het resultaat is
346een schermregel past, zal hij getoond worden met een vervolgregel. 368van deze operatie niet op een schermregel past, zal hij getoond worden
369met een vervolgregel.
347 370
348>> Beweeg de cursor naar het begin van een regel en tik <Delback>. Dit 371>> Beweeg de cursor naar het begin van een regel en tik <Delback>.
349 voegt de huidige en vorige regel samen. 372 Dit voegt de huidige en vorige regel samen.
350 373
351>> Tik <Return> om de Newline die je net verwijderd hebt weer toe te voegen. 374>> Tik <Return> om de Newline die je net verwijderd hebt weer toe te
375 voegen.
352 376
353Je herinnert je dat je bij de meeste Emacs-commando's het aantal keren op kan 377Je herinnert je dat je bij de meeste Emacs-commando's het aantal keren
354geven, dat ze herhaald moeten worden. Dit geldt ook voor gewone tekens. 378op kan geven, dat ze herhaald moeten worden. Dit geldt ook voor
355Als je een gewoon teken herhaalt, wordt dat teken herhaaldelijk toegevoegd. 379gewone tekens. Als je een gewoon teken herhaalt, wordt dat teken
380herhaaldelijk toegevoegd.
356 381
357>> Probeer dat nu: tik C-u 8 * om ******** toe te voegen. 382>> Probeer dat nu: tik C-u 8 * om ******** toe te voegen.
358 383
359Je hebt nu de eenvoudigste manier geleerd om iets in Emacs te tikken en fouten te 384Je hebt nu de eenvoudigste manier geleerd om iets in Emacs te tikken
360verbeteren. Je kan tekst ook per woord of regel verwijderen. Hier volgt 385en fouten te verbeteren. Je kan tekst ook per woord of regel
361een samenvatting van de commando's om tekst te verwijderen: 386verwijderen. Hier volgt een samenvatting van de commando's om tekst
362 387te verwijderen:
363 <Delback> haal het teken weg dat voor de cursor staat 388
364 C-d haal het teken weg dat achter de cursor staat 389 <Delback> Haal het teken weg dat voor de cursor staat
365 390 C-d Haal het teken weg dat achter de cursor staat
366 M-<Delback> verwijder het woord dat voor de cursor staat 391
367 M-d verwijder het woord dat achter de cursor staat 392 M-<Delback> Verwijder het woord dat voor de cursor staat
368 393 M-d Verwijder het woord dat achter de cursor staat
369 C-k verwijder alles van de cursor tot het eind van de regel 394
370 M-k verwijder alles van de cursor tot het eind van de zin 395 C-k Verwijder alles van de cursor tot het eind van de regel
371 396 M-k Verwijder alles van de cursor tot het eind van de zin
372Merk op dat <Delback> en C-d, met M-<Delback> en M-d de analogie verder 397
373trekken, die begon met C-f en M-f (waarbij we voor het gemak even vergeten dat 398Merk op dat <Delback> en C-d, met M-<Delback> en M-d de analogie
374<Delback> niet echt een control teken is). C-k en M-k lijken enigzins op 399verder trekken, die begon met C-f en M-f (waarbij we voor het gemak
375C-e en M-e in hun relatie tot regels en zinnen. 400even vergeten dat <Delback> niet echt een CONTROL-teken is). C-k en
376 401M-k lijken enigzins op C-e en M-e in hun relatie tot regels en zinnen.
377Als je meer dan een enkel teken tegelijk weghaalt, bewaart Emacs de tekst 402
378die je verwijdert, zodat je hem weer terug kan halen. Verwijderde tekst 403Je kunt ook op één uniforme manier een willekeurig deel van de tekst
379terughalen heet "yanken". Je kan verwijderde tekst terugbrengen op de 404verwijderen. Beweeg daartoe naar één kant van het gedeelte dat je
380plaats waar je hem hebt verwijderd of op een andere plaats in de tekst. 405wilt verwijderen en tik C-@ of C-<SPC>. (<SPC> is de spatiebalk.)
381Je kan ook meerdere keren yanken om er meedere kopieën van te maken. Het 406Beweeg daarna naar de andere kant en tik C-w. Dat verwijdert alle
382yank-commando is C-y. 407tekst tussen de twee posities.
383 408
384Merk op dat er een verschil is tussen iets weghalen en iets verwijderen: 409>> Beweeg de cursor naar de J aan het begin van de vorige alinea.
385iets dat je hebt verwijderd, kan je terugbrengen, maar iets dat je hebt 410>> Tik C-<SPC>. Emacs toont nu de mededeling "Mark set" ("Markering
411 geplaatst") onderaan het scherm.
412>> Plaats de cursor op de n van "kant" op de tweede regel van de
413 alinea.
414>> Tik C-w. Dit zal de tekst vanaf de J tot vlak voor de n
415 verwijderen.
416
417Er is een verschil tussen iets weghalen en iets verwijderen: iets dat
418je hebt verwijderd, kan je terugbrengen, maar iets dat je hebt
386weggehaald niet. (In het Engels is het verschil tussen "killing" en 419weggehaald niet. (In het Engels is het verschil tussen "killing" en
387"deleting" duidelijker dan tussen de Nederlandse vertalingen "verwijderen" en 420"deleting" duidelijker dan tussen de Nederlandse vertalingen
388"weghalen".) In het algemeen geldt dat de commando's die meer tekst dan 421"verwijderen" en "weghalen".) Verwijderde tekst terughalen heet
389een enkel teken, Newline of spatie verwijderen, deze tekst bewaren zodat hij 422"yanken". In het algemeen geldt dat de commando's die meer tekst dan
390geyankt kan worden, terwijl dat niet geldt voor commando's die slechts een 423een enkel teken, Newline of spatie verwijderen, deze tekst bewaren
391enkel teken weghalen. 424zodat hij geyankt kan worden, terwijl dat niet geldt voor commando's
425die slechts een enkel teken weghalen.
392 426
393>> Zet de cursor op het begin van een regel die niet leeg is. 427>> Zet de cursor op het begin van een regel die niet leeg is.
394 Tik C-k om de tekst op die regel te verwijderen. 428 Tik C-k om de tekst op die regel te verwijderen.
395>> Tik C-k een tweede keer. Nu verwijdert dit commando het Newline-teken. 429>> Tik C-k een tweede keer. Nu verwijdert dit commando het
430 Newline-teken.
396 431
397Merk op hoe een enkel C-k commando de inhoud van een regel verwijdert, een 432Merk op hoe een enkel C-k commando de inhoud van een regel verwijdert,
398tweede C-k commando de regel zelf zodat alle volgende regels een regel 433een tweede C-k commando de regel zelf zodat alle volgende regels een
399omhoog komen. Het numerieke argument is voor C-k bijzonder: het aangegeven 434regel omhoog komen. Het numerieke argument is voor C-k bijzonder: het
400aantal regels zal worden verwijderd, inclusief de inhoud. Dit is meer dan 435aangegeven aantal regels zal worden verwijderd, inclusief de inhoud.
401simpelweg herhaling: C-u 2 C-k verwijdert twee regels, terwijl tweemaal 436Dit is meer dan simpelweg herhaling: C-u 2 C-k verwijdert twee regels,
402C-k tikken dat niet doet. 437terwijl tweemaal C-k tikken dat niet doet.
403 438
404Om de laatst verwijderde tekst terug te halen naar de plaats waar de 439Om de laatst verwijderde tekst terug te halen naar de plaats waar de
405cursor nu op staat (te yanken), tik C-y. 440cursor nu op staat (te yanken), tik C-y.
@@ -408,199 +443,229 @@ cursor nu op staat (te yanken), tik C-y.
408 443
409Het is alsof je met C-y iets uit de prullenbak haalt wat je net had 444Het is alsof je met C-y iets uit de prullenbak haalt wat je net had
410verwijderd. Merk op dat verschillende C-k's achter elkaar alle regels 445verwijderd. Merk op dat verschillende C-k's achter elkaar alle regels
411die verwijderd worden, bij elkaar bewaart zodat een enkele C-y die regels 446die verwijderd worden, bij elkaar bewaart zodat een enkele C-y die
412in een keer terugbrengt. 447regels in een keer terugbrengt.
413 448
414>> Probeer het nu: tik C-k een paar keer. 449>> Probeer het nu: tik C-k een paar keer.
415 450
416Om de verwijderde tekst terug te halen: 451Om de verwijderde tekst terug te halen:
417 452
418>> Tik C-y. Beweeg de cursor enkele regels naar beneden en tik weer C-y. 453>> Tik C-y. Beweeg de cursor enkele regels naar beneden en tik weer
419 Je ziet nu hoe je tekst kan kopiëren. 454 C-y. Je ziet nu hoe je tekst kan kopiëren.
420 455
421Wat moet je doen als je wat tekst terug wilt brengen, maar je intussen 456Wat moet je doen als je wat tekst terug wilt brengen, maar je intussen
422al iets anders verwijderd hebt? C-y zou datgene terugbrengen wat je het 457al iets anders verwijderd hebt? C-y zou datgene terugbrengen wat je
423recentst hebt verwijderd. Gelukkig is de voorgaande tekst niet verloren 458het recentst hebt verwijderd. Gelukkig is de voorgaande tekst niet
424gegaan. Je kunt die tekst terughalen met M-y. Nadat je C-y hebt getikt 459verloren gegaan. Je kunt die tekst terughalen met M-y. Nadat je C-y
425om de recentst weggegooide tekst terug te halen, vervangt M-y die tekst 460hebt getikt om de recentst weggegooide tekst terug te halen, vervangt
426met de tekst die je daarvoor had weggegooid. Je kunt M-y herhalen om 461M-y die tekst met de tekst die je daarvoor had weggegooid. Je kunt
427tekst terug te halen die je al langer geleden hebt weggegooid. Als 462M-y herhalen om tekst terug te halen die je al langer geleden hebt
428je de tekst te pakken hebt die je zocht, hoef je niets te doen om die 463weggegooid. Als je de tekst te pakken hebt die je zocht, hoef je
429daar te houden. Je kan gewoon verder werken en de teruggehaalde tekst 464niets te doen om die daar te houden. Je kan gewoon verder werken en
430met rust laten. 465de teruggehaalde tekst met rust laten.
431 466
432Als je M-y vaak genoeg tikt kom je terug waar je begon, bij de laatst 467Als je M-y vaak genoeg tikt kom je terug waar je begon, bij de laatst
433verwijderde tekst. 468verwijderde tekst.
434 469
435>> Verwijder een regel, beweeg de cursor wat, en verwijder nog een regel. 470>> Verwijder een regel, beweeg de cursor wat, en verwijder nog een
436 Tik C-y om de tweede regel die je verwijderde, terug te halen. 471 regel. Tik C-y om de tweede regel die je verwijderde, terug te
437 Tik nog een M-y en die regel wordt vervangen door de eerste regel 472 halen. Tik nog een M-y en die regel wordt vervangen door de eerste
438 die je verwijderde. 473 regel die je verwijderde. Tik nog enkele keren M-y en zie wat er
439 Tik nog enkele keren M-y en zie wat er langs komt. Herhaal dit tot de 474 langs komt. Herhaal dit tot de tweede regel weer langs komt, en
440 tweede regel weer langs komt, en dan nog een paar keer. 475 dan nog een paar keer. Je kan ook experimenteren met positieve en
441 Je kan ook experimenteren met positieve en negatieve argumenten bij 476 negatieve argumenten bij M-y.
442 M-y.
443 477
444 478
445* HERSTELLEN 479* HERSTELLEN
446------------ 480------------
447 481
448Als je de tekst veranderd hebt en je daar toch niet tevreden mee bent, 482Als je de tekst veranderd hebt en je daar toch niet tevreden mee bent,
449dan kan je de verandering ongedaan maken met het herstelcommando, C-x u. 483dan kan je de verandering ongedaan maken met het herstelcommando, C-x
484u.
450 485
451Normaal gesproken herstelt C-x u de veranderingen die het gevolg zijn van 486Normaal gesproken herstelt C-x u de veranderingen die het gevolg zijn
452een enkel commando; door herhaaldelijk C-x u te tikken, worden steeds 487van een enkel commando; door herhaaldelijk C-x u te tikken, worden
453eerdere commando's hersteld. 488steeds eerdere commando's hersteld.
454 489
455Er zijn echter twee uitzonderingen: commando's die de tekst niet wijzigen, 490Er zijn echter twee uitzonderingen: commando's die de tekst niet
456zoals cursorbewegingen, worden overgeslagen, en commando's die simpelweg 491wijzigen, zoals cursorbewegingen, worden overgeslagen, en commando's
457het ingetikte teken aan de tekst toevoegen, worden meestal gegroepeerd 492die simpelweg het ingetikte teken aan de tekst toevoegen, worden
458in groepjes van maximaal 20 tekens, zodat je minder vaak het commando 493meestal gegroepeerd in groepjes van maximaal 20 tekens, zodat je
459C-x u hoeft te tikken om teksttoevoegingen te herstellen. 494minder vaak het commando C-x u hoeft te tikken om teksttoevoegingen te
495herstellen.
460 496
461>> Gooi deze regel weg met C-k; met C-x u zou hij weer moeten verschijnen. 497>> Gooi deze regel weg met C-k; met C-x u zou hij weer moeten
498 verschijnen.
462 499
463C-_ is een alternatief voor C-x u. Het levert exact hetzelfde resultaat 500C-_ is een alternatief voor C-x u. Het levert exact hetzelfde
464op, maar is makkelijker om een paar keer achter elkaar te tikken. Een 501resultaat op, maar is makkelijker om een paar keer achter elkaar te
465nadeel van C-_ is dat op sommige toetsenborden het intikken ervan niet 502tikken. Een nadeel van C-_ is dat op sommige toetsenborden het
466gebruiksvriendelijk is. Dat is ook de reden voor het alternatief, C-x u. 503intikken ervan niet gebruiksvriendelijk is. Dat is ook de reden voor
467Op sommige terminals kan je C-_ tikken door "/" te tikken terwijl je de 504het alternatief, C-x u. Op sommige terminals kan je C-_ tikken door
468CONTROL-toets ingedrukt houdt. 505"/" te tikken terwijl je de CONTROL-toets ingedrukt houdt.
469 506
470Een numeriek argument bij C-_ of C-x u duidt het aantal herhalingen aan. 507Een numeriek argument bij C-_ of C-x u duidt het aantal herhalingen
508aan.
471 509
472 510
473* BESTANDEN 511* BESTANDEN
474----------- 512-----------
475 513
476Om een tekst die je gemaakt of veranderd hebt op te slaan, moet je de tekst 514Om een tekst die je gemaakt of veranderd hebt op te slaan, moet je de
477in een bestand stoppen ("to save a file" in het Engels). Als je dat niet 515tekst in een bestand stoppen ("to save a file" in het Engels). Als je
478doet, ben je die veranderingen kwijt op het moment dat je Emacs verlaat. 516dat niet doet, ben je die veranderingen kwijt op het moment dat je
479Je kan een bestand veranderen door het bestand te "bezoeken". (Ook wel 517Emacs verlaat. Je kan een bestand veranderen door het bestand te
480"vinden"; "finding" of "visiting" in het Engels.) 518"bezoeken". (Ook wel "vinden"; "finding" of "visiting" in het
519Engels.)
481 520
482Een bestand bezoeken betekent dat je de inhoud van dat bestand in 521Een bestand bezoeken betekent dat je de inhoud van dat bestand in
483Emacs ziet. Het lijkt er dan op alsof je het bestand aan het veranderen 522Emacs ziet. Het lijkt er dan op alsof je het bestand aan het
484bent. Deze veranderingen zijn echter slechts tijdelijk zolang je het 523veranderen bent. Deze veranderingen zijn echter slechts tijdelijk
485bestand niet opslaat. Op deze manier kan je nooit per ongeluk een half 524zolang je het bestand niet opslaat. Op deze manier kan je nooit per
486gewijzigd bestand op het systeem achterlaten. Zelfs als je het bestand 525ongeluk een half gewijzigd bestand op het systeem achterlaten. Zelfs
487opslaat, zorgt Emacs ervoor dat het originele bestand onder een gewijzigde 526als je het bestand opslaat, zorgt Emacs ervoor dat het originele
488naam nog steeds beschikbaar is, voor het geval je later besluit dat de 527bestand onder een gewijzigde naam nog steeds beschikbaar is, voor het
489veranderingen toch niet zo goed waren. 528geval je later besluit dat de veranderingen toch niet zo goed waren.
490 529
491Bij de onderkant van het scherm zie je een regel die begint en 530Bij de onderkant van het scherm zie je een regel die begint en eindigt
492eindigt met streepjes, met aan het begin "--:-- TUTORIAL.nl" of iets 531met streepjes, met aan het begin "-1:-- TUTORIAL.nl" of iets
493dergelijks. Dit deel van het scherm laat normaal de naam van het bestand 532dergelijks. Dit deel van het scherm laat normaal de naam van het
494zien dat je op dat moment bezoekt. Op dit moment bezoek je een bestand 533bestand zien dat je op dat moment bezoekt. Op dit moment bezoek je
495dat "TUTORIAL.nl" heet; het is je eigen kopie van de Nederlandstalige 534een bestand dat "TUTORIAL.nl" heet; het is je eigen kopie van de
496Emacs-inleiding ("tutorial" in het Engels). Als je in Emacs een bestand 535Nederlandstalige Emacs-inleiding ("tutorial" in het Engels). Als je
497bezoekt dan staat de naam van het bestand altijd op deze plaats. 536in Emacs een bestand bezoekt dan staat de naam van het bestand altijd
498 537op deze plaats.
499De commando's om een bestand te bezoeken of op te slaan zijn anders dan de 538
500commando's die je tot nu toe geleerd hebt; ze bestaan namelijk uit twee 539Iets bijzonders aan het commando om een bestand te bezoeken, is dat je
501tekens. Beide commando's beginnen met het teken Control-x. Er zijn een
502heleboel commando's die met Control-x beginnen. Veel van die commando's
503hebben te maken met bestanden, buffers, en gelijkaardige dingen.
504Dergelijke commando's bestaan uit twee, drie of vier tekens.
505
506Nog iets bijzonders aan het commando om een bestand te bezoeken, is dat je
507aan moet geven welk bestand je wil. Dit heet dat het commando "een 540aan moet geven welk bestand je wil. Dit heet dat het commando "een
508argument van de gebruiker vraagt"; in dit geval de naam van het bestand. 541argument van de gebruiker vraagt"; in dit geval de naam van het
509Nadat je het commando 542bestand. Nadat je het commando
510 543
511 C-x C-f bezoek bestand (met de f van "find file") 544 C-x C-f Bezoek bestand (met de f van "find file").
512 545
513hebt getikt vraagt Emacs om de naam van het bestand. De naam die je 546hebt getikt vraagt Emacs om de naam van het bestand. De naam die je
514intikt verschijnt op de onderste regel van het scherm. Wanneer die regel 547intikt verschijnt op de onderste regel van het scherm. Wanneer die
515voor dit soort invoer gebruikt wordt, heet hij de minibuffer. Je kan gewone 548regel voor dit soort invoer gebruikt wordt, heet hij de minibuffer.
516Emacs commando's gebruiken om de bestandsnaam te veranderen. 549Je kan gewone Emacs commando's gebruiken om de bestandsnaam te
550veranderen.
517 551
518Tijdens het invoeren van de bestandsnaam (of om het even welke 552Tijdens het invoeren van de bestandsnaam (of om het even welke invoer
519invoer in de minibuffer) kan je het commando afbreken met C-g. 553in de minibuffer) kan je het commando afbreken met C-g.
520 554
521>> Tik C-x C-f gevolgd door C-g. Dit commando breekt de minibuffer af en 555>> Tik C-x C-f gevolgd door C-g. Dit commando breekt de minibuffer af
522 ook het C-x C-f commando dat van de minibuffer gebruik maakte. 556 en ook het C-x C-f commando dat van de minibuffer gebruik maakte.
523 Het resultaat is dat je geen bestand bezoekt. 557 Het resultaat is dat je geen bestand bezoekt.
524 558
525Als je de naam van een bestand hebt ingevoerd, tik dan <Return> om het 559Als je de naam van een bestand hebt ingevoerd, tik dan <Return> om het
526commando af te sluiten. Hierna gaat het C-x C-f commando aan het werk en haalt 560commando af te sluiten. Hierna gaat het C-x C-f commando aan het werk
527het bestand op dat je aangegeven hebt. Als het C-x C-f commando daarmee 561en haalt het bestand op dat je aangegeven hebt. Als het C-x C-f
528klaar is, verdwijnt de minibuffer. 562commando daarmee klaar is, verdwijnt de minibuffer.
529 563
530Na korte tijd verschijnt de inhoud van het bestand op het scherm en kan 564Na korte tijd verschijnt de inhoud van het bestand op het scherm en
531je de inhoud wijzigen. Als je de wijzigingen op wilt slaan, tik dan het 565kan je de inhoud wijzigen. Als je de wijzigingen op wilt slaan, tik
532commando 566dan het commando
533 567
534 C-x C-s sla bestand op (met de s van "save file") 568 C-x C-s Sla bestand op (met de s van "save file").
535 569
536Dit commando slaat de tekst zoals Emacs die nu heeft in het bestand op. 570Dit commando slaat de tekst zoals Emacs die nu heeft in het bestand
537De eerste keer dat je dit doet, slaat Emacs het originele bestand onder een 571op. De eerste keer dat je dit doet, slaat Emacs het originele bestand
538andere naam op, zodat het niet verloren gaat. De nieuwe naam bestaat uit de 572onder een andere naam op, zodat het niet verloren gaat. De nieuwe
539oude bestandsnaam gevolgd door een "~". 573naam bestaat uit de oude bestandsnaam gevolgd door een "~".
540 574
541Als Emacs het bestand heeft opgeslagen, laat het de naam van het 575Als Emacs het bestand heeft opgeslagen, laat het de naam van het
542bestand zien. Het is een goede gewoonte een bestand regelmatig te op te slaan 576bestand zien. Het is een goede gewoonte een bestand regelmatig op te
543zodat er niet teveel werk verloren gaat als het systeem hangt of crasht. 577slaan zodat er niet teveel werk verloren gaat als het systeem hangt of
544 578crasht.
545>> Tik C-x C-s, om je kopie van deze inleiding op te slaan. Als het goed is 579
546 verschijnt "Wrote ...TUTORIAL" op de onderste schermregel. 580>> Tik C-x C-s, om je kopie van deze inleiding op te slaan. Als het
547 581 goed is verschijnt "Wrote ...TUTORIAL.nl" op de onderste
548OPMERKING: Op sommige systemen gebeurt er helemaal niets als je C-x C-s 582 schermregel.
549tikt, en daarna ook niets meer. Dit komt door een eigenschap van de 583
550machine waarop je werkt die te maken heeft met "flow control". Met C-s 584OPMERKING: Op sommige systemen gebeurt er helemaal niets als je C-x
551stopt de "flow" en komt niets meer van wat je tikt bij Emacs terecht. Om 585C-s tikt, en daarna ook niets meer. Dit komt door een eigenschap van
552deze situatie te herstellen, tik C-q. Lees daarna het hoofdstuk 586de machine waarop je werkt die te maken heeft met "flow control". Met
553"Spontaneous Entry to Incremental Search" in het Emacs-handboek over hoe 587C-s stopt de "flow" en komt niets meer van wat je tikt bij Emacs
554je moet omgaan met deze situatie. 588terecht. Om deze situatie te herstellen, tik C-q. Lees daarna het
589hoofdstuk "Spontaneous Entry to Incremental Search" in het
590Emacs-handboek over hoe je moet omgaan met deze situatie.
555 591
556Je kan een bestaand bestand bezoeken om het te bekijken of het te 592Je kan een bestaand bestand bezoeken om het te bekijken of het te
557wijzigen. Je kan ook een bestand bezoeken dat nog niet bestaat. Dit is 593wijzigen. Je kan ook een bestand bezoeken dat nog niet bestaat. Dit
558de manier om met Emacs een nieuw bestand te maken: bezoek het bestand, dat 594is de manier om met Emacs een nieuw bestand te maken: bezoek het
559eerst leeg zal zijn, en voeg tekst toe. Zodra je de tekst opslaat, wordt 595bestand, dat eerst leeg zal zijn, en voeg tekst toe. Zodra je de
560het bestand werkelijk gecreëerd, met de tekst als inhoud. Vanaf dat 596tekst opslaat, wordt het bestand werkelijk gecreëerd, met de tekst als
561moment ben je dus bezig met een bestaand bestand. 597inhoud. Vanaf dat moment ben je dus bezig met een bestaand bestand.
562 598
563 599
564* BUFFERS 600* BUFFERS
565--------- 601---------
566 602
567Als je een tweede bestand bezoekt met C-x C-f, blijft het eerste bestand 603Als je een tweede bestand bezoekt met C-x C-f, blijft het eerste
568gewoon in Emacs. Je kan naar dat bestand terug door het gewoon nog een 604bestand gewoon in Emacs. Je kan naar dat bestand terug door het
569keer te bezoeken met C-x C-f. Op deze manier kan je een behoorlijk aantal 605gewoon nog een keer te bezoeken met C-x C-f. Op deze manier kan je
570bestanden in Emacs krijgen. 606een behoorlijk aantal bestanden in Emacs krijgen.
571 607
572>> Creëer een bestand dat "foo" heet door te tikken: C-f C-f foo 608>> Creëer een bestand dat "foo" heet door te tikken: C-x C-f foo
573 <Return>. Voeg hieraan wat tekst toe, wijzig hem, en sla "foo" op 609 <Return>. Voeg hieraan wat tekst toe, wijzig hem, en sla "foo" op
574 door C-x C-s te tikken. Tik hierna C-x C-f TUTORIAL <Return> om 610 door C-x C-s te tikken. Tik hierna C-x C-f TUTORIAL <Return> om
575 weer hier, in de inleiding, terug te komen. 611 weer hier, in de inleiding, terug te komen.
576 612
577Emacs bewaart intern de tekst van elk bestand in een ding dat een "buffer" 613Emacs bewaart intern de tekst van elk bestand in een ding dat een
578genoemd wordt. Als je een bestand bezoekt wordt er een nieuwe buffer 614"buffer" genoemd wordt. Als je een bestand bezoekt wordt er een
579gemaakt. Om een lijst van de huidige buffers te zien, tik 615nieuwe buffer gemaakt. Om een lijst van de huidige buffers te zien,
616tik
580 617
581 C-x C-b laat de bufferlijst zien 618 C-x C-b Laat de bufferlijst zien
582 619
583>> Probeer C-x C-b nu. 620>> Probeer C-x C-b nu.
584 621
585Bemerk dat elke buffer een naam heeft en mogelijk ook een bestandsnaam; dit 622Bemerk dat elke buffer een naam heeft en mogelijk ook een
586is de naam van het bestand waarmee de buffer overeenkomt. Sommige buffers 623bestandsnaam; dit is de naam van het bestand waarmee de buffer
587hebben niets met een bestand te maken. Bijvoorbeeld, de buffer die 624overeenkomt. ALLE tekst die je in een Emacs venster ziet is altijd
588"*Buffer List*" heet heeft geen bestand. Die buffer is de buffer die de 625onderdeel van een of andere buffer.
589lijst bevat die door C-x C-b gemaakt wordt. ALLE tekst die je in een
590Emacs venster ziet is altijd onderdeel van een of andere buffer.
591 626
592>> Tik C-x 1 om de bufferlijst te verwijderen. 627>> Tik C-x 1 om de bufferlijst te verwijderen.
593 628
629Wanneer je met meerdere buffers werkt, dan is op elk moment slechts
630één van die buffers "actueel". De actuele buffer is degene die je aan
631het bewerken bent. Als je een andere buffer wilt bewerken, dan moet
632je daarnaar "omschakelen". Als je wilt omschakelen naar een buffer
633die overeenkomt met een bestand, dan kun je dit doen door dat bestand
634opnieuw te bezoeken met C-x C-f. Er is ook een makkelijkere manier:
635gebruik het commando C-x b. Dit commando vraagt je naar de naam van
636de buffer.
637
638>> Tik C-x b foo <Return> om terug te gaan naar de buffer "foo" die de
639 tekst van het bestand "foo" bevat. Tik vervolgens C-x b TUTORIAL
640 <Return> om terug te komen naar deze Emacs-inleiding.
641
642Meestal is de naam van de buffer gelijk aan de naam van het bestand
643(minus de naam van de directory). Dit klopt echter niet altijd. De
644lijst met buffers die je maakt met C-x C-b laat je altijd de naam van
645elke buffer zien.
646
647ALLE tekst die je ziet in een venster van Emacs is altijd onderdeel
648van een of andere buffer. Sommige buffers komen niet overeen met een
649bestand. De buffer genaamd "*Buffer List*" heeft bijvoorbeeld geen
650bijbehorend bestand. Deze buffer bevat de lijst met buffers die je
651gemaakt hebt met C-x C-b. Ook de buffer "*Messages*" heeft geen
652geassocieerd bestand; deze buffer bevat de mededelingen die Emacs je
653op de onderste regel toonde.
654
655>> Tik C-x b *Messages* <Return> om de buffer met mededelingen te
656 bekijken. Tik daarna weer C-x b TUTORIAL <Return> om terug te
657 keren naar deze buffer met de Emacs-inleiding
658
594Als je de tekst van het ene bestand verandert en dan een ander bestand 659Als je de tekst van het ene bestand verandert en dan een ander bestand
595bezoekt, wordt het eerste bestand niet opgeslagen. De wijzigingen blijven 660bezoekt, wordt het eerste bestand niet opgeslagen. De wijzigingen
596in Emacs, in de buffer die bij het bestand hoort. Het creëren of 661blijven in Emacs, in de buffer die bij het bestand hoort. Het creëren
597veranderen van de buffer van het tweede bestand heeft geen effect op de 662of veranderen van de buffer van het tweede bestand heeft geen effect
598eerste buffer. Dit is erg nuttig, maar betekent ook dat er een eenvoudige 663op de eerste buffer. Dit is erg nuttig, maar betekent ook dat er een
599manier nodig is om het eerste bestand te bewaren. Het zou erg vervelend 664eenvoudige manier nodig is om het eerste bestand te bewaren. Het zou
600zijn om er eerst naar terug te moeten gaan met C-x C-f om het dan te 665erg vervelend zijn om er eerst naar terug te moeten gaan met C-x C-f
601kunnen bewaren met C-x C-s. Dus hebben we het commando: 666om het dan te kunnen bewaren met C-x C-s. Dus hebben we het commando:
602 667
603 C-x s sla een paar buffers op 668 C-x s Sla een paar buffers op
604 669
605C-x s vraagt voor elke buffer die veranderingen heeft die nog niet 670C-x s vraagt voor elke buffer die veranderingen heeft die nog niet
606opgeslagen zijn, of je de buffer wilt bewaren. 671opgeslagen zijn, of je de buffer wilt bewaren.
@@ -616,56 +681,62 @@ opgeslagen zijn, of je de buffer wilt bewaren.
616 681
617Er zijn veel meer Emacs commando's dan er op de toetsen van het 682Er zijn veel meer Emacs commando's dan er op de toetsen van het
618toetsenbord passen, zelfs als we hun aantal kunnen vergroten door de 683toetsenbord passen, zelfs als we hun aantal kunnen vergroten door de
619control of meta toets te gebruiken. Emacs lost dit probleem op met het X 684CONTROL- of META-toets te gebruiken. Emacs lost dit probleem op met
620commando (met de X van eXtensie of uitbreiding). Het X commando komt voor in 685het X commando (met de X van eXtensie of uitbreiding). Het X commando
621twee smaken: 686komt voor in twee smaken:
622 687
623 C-x Tekenuitbreiding. Bevolgd door een teken. 688 C-x Tekenuitbreiding. Gevolgd door een teken.
624 M-x Commando-naam-uitbreiding. Wordt gevolgd door een naam. 689 M-x Commando-naam-uitbreiding. Wordt gevolgd door een naam.
625 690
626Deze commando's zijn in het algemeen nuttig, maar worden minder gebruikt 691Deze commando's zijn in het algemeen nuttig, maar worden minder
627dan de commando's die je tot nu toe al geleerd hebt. Je hebt al twee van deze 692gebruikt dan de commando's die je tot nu toe al geleerd hebt. Je hebt
628commando's gezien: C-x C-f om een bestand te bezoeken, en C-x C-s om het 693al enkele van deze commando's gezien: C-x C-f om een bestand te
629te bewaren. Een ander voorbeeld is het commando om Emacs te verlaten: dit 694bezoeken en C-x C-s om het te bewaren, bijvoorbeeld. Een ander
630is C-x C-c. (Maak je geen zorgen over het verloren gaan van veranderingen 695voorbeeld is het commando om Emacs te verlaten: dit is C-x C-c. (Maak
631die niet opgeslagen zijn; C-x C-c vraagt of je veranderde buffers wilt 696je geen zorgen over het verloren gaan van veranderingen die niet
632bewaren voordat Emacs helemaal eindigt.) 697opgeslagen zijn; C-x C-c vraagt of je veranderde buffers wilt bewaren
633 698voordat Emacs helemaal eindigt.)
634C-z is het commando om Emacs *tijdelijk* te verlaten, zodat je daarna weer 699
635terug kan keren in dezelfde Emacs-sessie. 700C-z is het commando om Emacs *tijdelijk* te verlaten, zodat je daarna
636 701weer terug kan keren in dezelfde Emacs-sessie.
637Op systemen die deze mogelijkheid bieden, zet C-z Emacs stil: je komt weer 702
638terug in de shell, maar Emacs is nog aanwezig. In de meeste shells kan je 703Op systemen die deze mogelijkheid bieden, zet C-z Emacs stil: je komt
639Emacs weer activeren met het "fg" commando, of met "%emacs". 704weer terug in de shell, maar Emacs is nog aanwezig. In de meeste
640 705shells kan je Emacs weer activeren met het "fg" commando, of met
641Op systemen die niet de mogelijkheid bieden om programma's stil te zetten, 706"%emacs".
642creëert C-z een subshell onder Emacs om je zo in de gelegenheid te 707
643stellen andere programma's uit te voeren en daarna weer in Emacs terug te 708Op systemen die niet de mogelijkheid bieden om programma's stil te
644keren; Emacs wordt dus niet werkelijk verlaten. In dit geval is het 709zetten, creëert C-z een subshell onder Emacs om je zo in de
645shellcommando "exit" de normale manier om de subshell te verlaten en in 710gelegenheid te stellen andere programma's uit te voeren en daarna weer
646Emacs terug te keren. 711in Emacs terug te keren; Emacs wordt dus niet werkelijk verlaten. In
647 712dit geval is het shellcommando "exit" de normale manier om de subshell
648Het moment om C-x C-c te gebruiken is wanneer je uit gaat loggen. Het is 713te verlaten en in Emacs terug te keren.
649ook het juiste commando om Emacs te beëindigen wanneer Emacs opgestart 714
650was door een mail-programma of iets dergelijks, aangezien die misschien 715Het moment om C-x C-c te gebruiken is wanneer je uit gaat loggen. Het
651niet met een stilgezette Emacs om kunnen gaan. Normaal gezien is het 716is ook het juiste commando om Emacs te beëindigen wanneer Emacs
652echter beter Emacs stil te zetten met C-z dan om Emacs te verlaten, 717opgestart was door een mail-programma of iets dergelijks, aangezien
653behalve als je uit wilt loggen natuurlijk. 718die misschien niet met een stilgezette Emacs om kunnen gaan. Normaal
654 719gezien is het echter beter Emacs stil te zetten met C-z dan om Emacs
655Er bestaan vele C-x commando's. Hier is een lijst van degene die je nu al 720te verlaten, behalve als je uit wilt loggen natuurlijk.
656kent: 721
657 722Er bestaan vele C-x commando's. Hier is een lijst van degene die je
658 C-x C-f bezoek bestand 723nu al kent:
659 C-x C-s sla bestand op 724
660 C-x C-b laat bufferlijst zien 725 C-x C-f Bezoek bestand
661 C-x C-c verlaat Emacs 726 C-x C-s Sla bestand op
662 C-x u herstel 727 C-x s Sla een paar buffers op
663 728 C-x C-b Laat bufferlijst zien
664Commando-naam-bevelen worden nog minder vaak gebruikt, of alleen onder bepaalde omstandigheden. 729 C-x b Schakel naar een buffer
665Een voorbeeld is het commando replace-string, dat in de hele tekst een string 730 C-x C-c Verlaat Emacs
666vervangt door een andere string ("to replace" betekent "vervangen"). 731 C-x 1 Een enkel venster
667Als je M-x tikt, toont Emacs onderaan het scherm "M-x" en moet je de naam van 732 C-x u Herstel
668het commando intikken, in dit geval "replace-string". Als je gewoon 733
734Commando-naam-bevelen worden nog minder vaak gebruikt, of alleen onder
735bepaalde omstandigheden. Een voorbeeld is het commando
736replace-string, dat in de hele tekst een string vervangt door een
737andere string ("to replace" betekent "vervangen"). Als je M-x tikt,
738toont Emacs onderaan het scherm "M-x" en moet je de naam van het
739commando intikken, in dit geval "replace-string". Als je gewoon
669"repl s<TAB>" tikt maakt Emacs de naam zelf af. Beëindig het commando 740"repl s<TAB>" tikt maakt Emacs de naam zelf af. Beëindig het commando
670met <Return>. 741met <Return>.
671 742
@@ -676,137 +747,146 @@ Je sluit elk argument af met <Return>.
676>> Plaats de cursor op de lege regel twee regels onder deze regel. 747>> Plaats de cursor op de lege regel twee regels onder deze regel.
677 Tik dan M-x repl s<Return>gewijzigd<Return>veranderd<Return>. 748 Tik dan M-x repl s<Return>gewijzigd<Return>veranderd<Return>.
678 749
679 Zie hoe deze regel daardoor gewijzigd is. Je hebt elk voorkomen van 750 Zie hoe deze regel daardoor gewijzigd is. Je hebt elk voorkomen
680 het woord g-e-w-i-j-z-i-g-d vervangen door "veranderd"; te beginnen op 751 van het woord g-e-w-i-j-z-i-g-d vervangen door "veranderd"; te
681 de plek waar de cursor staat. 752 beginnen op de plek waar de cursor staat.
682 753
683 754
684* AUTOMATISCH BEWAREN 755* AUTOMATISCH BEWAREN
685--------------------- 756---------------------
686 757
687Als je een bestand veranderd hebt maar het nog niet opgeslagen hebt, zouden 758Als je een bestand veranderd hebt maar het nog niet opgeslagen hebt,
688de veranderingen verloren kunnen gaan als het systeem zou hangen of 759zouden de veranderingen verloren kunnen gaan als het systeem zou
689herstarten. Om je hiertegen te beschermen, slaat Emacs regelmatig 760hangen of herstarten. Om je hiertegen te beschermen, slaat Emacs
690de veranderde tekst automatisch op. De naam van het bestand waarin de 761regelmatig de veranderde tekst automatisch op. De naam van het
691tekst automatisch wordt opgeslagen begint en eindigt met een #. 762bestand waarin de tekst automatisch wordt opgeslagen begint en eindigt
692Bijvoorbeeld, als je het bestand "hello.c" aan het editeren bent, wordt 763met een #. Bijvoorbeeld, als je het bestand "hello.c" aan het
693de tekst automatisch opgeslagen in een bestand dat "#hello.c#" heet. Zodra 764bewerken bent, wordt de tekst automatisch opgeslagen in een bestand
694je het bestand werkelijk opslaat, wordt het automatisch opgeslagen bestand 765dat "#hello.c#" heet. Zodra je het bestand werkelijk opslaat, wordt
695verwijderd. 766het automatisch opgeslagen bestand verwijderd.
696 767
697Als de computer crasht, kan je de automatisch opgeslagen tekst terugkrijgen 768Als de computer crasht, kan je de automatisch opgeslagen tekst
698door het bestand gewoon te bezoeken (het originele bestand, niet het automatisch 769terugkrijgen door het bestand gewoon te bezoeken (het originele
699opgeslagen), gevolgd door M-x recover-file<Return>. Als Emacs vraagt om 770bestand, niet het automatisch opgeslagen), gevolgd door M-x
700bevestiging, antwoord dan met yes<Return> en de automatisch opgeslagen 771recover-file<Return>. Als Emacs vraagt om bevestiging, antwoord dan
701informatie wordt teruggehaald. 772met yes<Return> en de automatisch opgeslagen informatie wordt
773teruggehaald.
702 774
703 775
704* ECHO-GEBIED 776* ECHO-GEBIED
705------------- 777-------------
706 778
707Als je een commando langzaam intikt, toont Emacs de tekens aan de 779Als je een commando langzaam intikt, toont Emacs de tekens aan de
708onderkant van het scherm in een deel dat het "echo-gebied" genoemd wordt. 780onderkant van het scherm in een deel dat het "echo-gebied" genoemd
709Dit gebied omvat de onderste regel van het scherm. 781wordt. Dit gebied omvat de onderste regel van het scherm.
710 782
711 783
712* MODUS-REGEL 784* MODUS-REGEL
713------------- 785-------------
714 786
715De regel direct boven het echo gebied heet de "modusregel". De modusregel 787De regel direct boven het echo gebied heet de "modusregel". De
716ziet er ongeveer zo uit: 788modusregel ziet er ongeveer zo uit:
789
790-1:** TUTORIAL.nl 62% L763 (Fundamental)-----------------------
717 791
718--**-Emacs: TUTORIAL.nl (Fundamental)--68%------------------------ 792Deze regel geeft interessante informatie over Emacs en de tekst die je
793aan het bewerken bent.
719 794
720Deze regel geeft interessante informatie over Emacs en de tekst die 795Je weet al wat de bestandsnaam betekent: het is de naam van het
721je aan het editeren bent. 796bestand dat je bezoekt. NN% geeft je huidige positie in de tekst aan:
797NN procent van de tekst bevindt zich boven het scherm. Als het
798bestand vanaf het begin op het scherm staat, staat er "Top" in plaats
799van " 0%". Als het laatste stuk tekst op het scherm staat, zal er
800"Bot" staan (van "bottom", "onderkant" in het Nederlands). Als de
801tekst zo klein is dat hij volledig op het scherm past staat "All" in
802de modus-regel.
722 803
723Je weet al wat de bestandsnaam betekent: het is de naam van het bestand 804De L gevolgd door een getal geeft het nummer van de regel waarin punt
724dat je bezoekt. -NN%-- geeft je huidige positie in de tekst aan: NN 805zich bevindt.
725procent van de tekst bevindt zich boven het scherm. Als het bestand vanaf
726het begin op het scherm staat, staat er --Top-- in plaats van --00%--.
727Als het laatste stuk tekst op het scherm staat, zal er --Bot-- staan (van
728"bottom", "onderkant" in het Nederlands). Als de tekst zo klein is dat hij
729volledig op het scherm past staat --All-- in de modus-regel.
730 806
731De sterretjes aan het begin betekenen dat je de tekst veranderd hebt. 807De sterretjes aan het begin betekenen dat je de tekst veranderd hebt.
732Direct na het bezoeken of opslaan staan er gewoon streepjes. 808Direct na het bezoeken of opslaan staan er gewoon streepjes.
733 809
734In de modusregel staat tussen haakjes in welke modus je aan het werken 810In de modusregel staat tussen haakjes in welke modus je aan het werken
735bent. De standaardmodus is de "Fundamental" modus, die je nu gebruikt 811bent. De standaardmodus is de "Fundamental" modus, die je nu gebruikt
736("fundamental" is "basis" in het Nederlands). Een dergelijke 812("fundamental" is "basis" in het Nederlands). Een dergelijke modus
737modus heet een hoofdmodus ("major mode" in het Engels). 813heet een hoofdmodus ("major mode" in het Engels).
738 814
739Emacs heeft verschillende hoofdmodi. Sommige daarvan zijn bedoeld voor 815Emacs heeft verschillende hoofdmodi. Sommige daarvan zijn bedoeld
740het editeren van verschillende talen of soorten tekst, zoals bijvoorbeeld 816voor het bewerken van verschillende talen of soorten tekst, zoals
741Lisp modus, Text modus, etc. Op elk moment is er altijd precies een modus 817bijvoorbeeld Lisp modus, Text modus, etc. Op elk moment is er altijd
742actief, en de naam daarvan staat in de modusregel, op de plaats waar nu 818precies een modus actief, en de naam daarvan staat in de modusregel,
743"Fundamental" staat. 819op de plaats waar nu "Fundamental" staat.
744 820
745Elke hoofdmodus zorgt ervoor dat sommige commando's zich anders gedragen. 821Elke hoofdmodus zorgt ervoor dat sommige commando's zich anders
746Zo bestaat er een commando om een commentaar in een programma te tikken, en 822gedragen. Zo bestaat er een commando om een commentaar in een
747aangezien elke programmeertaal een ander idee heeft over hoe commentaar 823programma te tikken, en aangezien elke programmeertaal een ander idee
748eruit moet zien, moet elke hoofdmodus op een andere manier het commentaar 824heeft over hoe commentaar eruit moet zien, moet elke hoofdmodus op een
749beginnen. Elke hoofdmodus is de naam van een uitgebreid commando, en met 825andere manier het commentaar beginnen. Elke hoofdmodus is de naam van
750dat commando schakel je om naar die hoofdmodus. Zo is bijvoorbeeld 826een uitgebreid commando, en met dat commando schakel je om naar die
751M-x fundamental-mode het commando om naar de basismodus om te schakelen. 827hoofdmodus. Zo is bijvoorbeeld M-x fundamental-mode het commando om
752 828naar de basismodus om te schakelen.
753Als je Nederlandse of Engelse tekst wil gaan editeren, zoals bijvoorbeeld 829
754dit bestand, kan je beter "Text mode" gebruiken, de modus om tekst in een 830Als je Nederlandse of Engelse tekst wil gaan bewerken, zoals
755gewone taal te editeren: 831bijvoorbeeld dit bestand, kan je beter "Text mode" gebruiken, de modus
832om tekst in een gewone taal te bewerken:
756 833
757>> Tik M-x text-mode<Return>. 834>> Tik M-x text-mode<Return>.
758 835
759Wees gerust; geen van de commando's die je geleerd hebt zorgen voor 836Wees gerust; geen van de commando's die je geleerd hebt zorgen voor
760grondige veranderingen in Emacs. Een van de dingen die je kan merken, is 837grondige veranderingen in Emacs. Een van de dingen die je kan merken,
761bijvoorbeeld dat M-f en M-b nu apostrofs als onderdeel van een woord 838is bijvoorbeeld dat M-f en M-b nu apostrofs als onderdeel van een
762beschouwen. In de vorige modus (Fundamental) behandelen M-f en M-b de 839woord beschouwen. In de vorige modus (Fundamental) behandelen M-f en
763apostrof als ruimte tussen twee woorden. 840M-b de apostrof als ruimte tussen twee woorden.
764 841
765Het is gebruikelijk dat hoofdmodi dergelijke subtiele verschillen hebben. 842Het is gebruikelijk dat hoofdmodi dergelijke subtiele verschillen
766De meeste commando's doen dus min of meer hetzelfde in elke hoofdmodus. 843hebben. De meeste commando's doen dus min of meer hetzelfde in elke
844hoofdmodus.
767 845
768Met het commando C-h m kan je de documentatie over de huidige hoofdmodus 846Met het commando C-h m kan je de documentatie over de huidige
769lezen. 847hoofdmodus lezen.
770 848
771>> Gebruik C-u C-v een paar keer om deze zin in de buurt van de bovenkant 849>> Gebruik C-u C-v een paar keer om deze zin in de buurt van de
772 van het scherm te krijgen. 850 bovenkant van het scherm te krijgen.
773>> Tik C-h m om te zien hoe de tekstmodus verschilt van de basismodus. 851>> Tik C-h m om te zien hoe de tekstmodus verschilt van de basismodus.
774>> Tik C-x 1 om de documentatie van het scherm te verwijderen. 852>> Tik C-x 1 om de documentatie van het scherm te verwijderen.
775 853
776Hoofdmodi heten zo omdat er ook bijmodi zijn. Bijmodi zijn 854Hoofdmodi heten zo omdat er ook bijmodi zijn. Bijmodi zijn geen
777geen alternatieven voor hoofdmodi; het zijn slechts kleine aanpassingen 855alternatieven voor hoofdmodi; het zijn slechts kleine aanpassingen
778daarvan. Elke bijmodus kan aan- of uitgezet worden, onafhankelijk van 856daarvan. Elke bijmodus kan aan- of uitgezet worden, onafhankelijk van
779andere bijmodi en onafhankelijk van de hoofdmodus. Het is dus mogelijk geen bijmodi, één bijmodus 857andere bijmodi en onafhankelijk van de hoofdmodus. Het is dus
780of een willekeurige combinatie van bijmodi te gebruiken. 858mogelijk geen bijmodi, één bijmodus of een willekeurige combinatie van
781 859bijmodi te gebruiken.
782Een nuttige bijmodus voor het editeren van tekst in een natuurlijke taal, 860
783zoals het Nederlands, is Auto Fill modus ("auto fill" betekent automatisch 861Een nuttige bijmodus voor het bewerken van tekst in een natuurlijke
784uitvullen). Wanneer deze modus aanstaat, breekt Emacs automatisch een 862taal, zoals het Nederlands, is Auto Fill modus ("auto fill" betekent
785regel tussen twee woorden af als de regel te lang wordt. 863automatisch uitvullen). Wanneer deze modus aanstaat, breekt Emacs
786 864automatisch een regel tussen twee woorden af als de regel te lang
787Je kan Auto Fill modus aanzetten met M-x auto-fill-mode<Return>. Als deze 865wordt.
788modus al aanstaat, kan je hem uitzetten met M-x auto-fill-mode<Return>. 866
789Als de modus uitstaat, zet dit commando de modus aan; als ze aanstaat, zet 867Je kan Auto Fill modus aanzetten met M-x auto-fill-mode<Return>. Als
790dit commando de modus uit. We zeggen dat het commando de modus "schakelt" 868deze modus al aanstaat, kan je hem uitzetten met M-x
791("to toggle" in het Engels). 869auto-fill-mode<Return>. Als de modus uitstaat, zet dit commando de
792 870modus aan; als ze aanstaat, zet dit commando de modus uit. We zeggen
793>> Tik nu M-x auto-fill-mode<Return>. Tik nu vele malen "asdf " op een 871dat het commando de modus "schakelt" ("to toggle" in het Engels).
794 regel zodat je kan zien dat de regel in tweeën gesplitst wordt. Er 872
795 moeten wel spaties tussen de woorden staan, omdat de Auto Fill modus 873>> Tik nu M-x auto-fill-mode<Return>. Tik nu vele malen "asdf " op
796 de regel alleen op spaties breekt. 874 een regel zodat je kan zien dat de regel in tweeën gesplitst wordt.
797 875 Er moeten wel spaties tussen de woorden staan, omdat de Auto Fill
798De rechterkantlijn staat meestal op 70 tekens, maar die kan je veranderen 876 modus de regel alleen op spaties breekt.
799met het C-x f commando. Dit commando accepteert een numeriek argument 877
800om de gewenste kantlijn te verkrijgen. 878De rechterkantlijn staat meestal op 70 tekens, maar die kan je
879veranderen met het C-x f commando. Dit commando accepteert een
880numeriek argument om de gewenste kantlijn te verkrijgen.
801 881
802>> Tik C-x f met 20 als argument (C-u 20 C-x f). 882>> Tik C-x f met 20 als argument (C-u 20 C-x f).
803 Tik wat tekst en zie dat Emacs de regels afbreekt bij 20 tekens. 883 Tik wat tekst en zie dat Emacs de regels afbreekt bij 20 tekens.
804 Zet de kantlijn nu terug op 70, dus met met C-u 70 C-x f. 884 Zet de kantlijn nu terug op 70, dus met met C-u 70 C-x f.
805 885
806Als je de tekst midden in een regel verandert vult Auto Fill modus 886Als je de tekst midden in een regel verandert vult Auto Fill modus de
807de regel niet opnieuw. 887regel niet opnieuw.
808Om een alinea opnieuw te vullen, tik M-q (META-q) terwijl de 888Om een alinea opnieuw te vullen, tik M-q (META-q) terwijl de cursor in
809cursor in de alinea staat. 889de alinea staat.
810 890
811>> Plaats de cursor in de voorgaande alinea en tik M-q. 891>> Plaats de cursor in de voorgaande alinea en tik M-q.
812 892
@@ -814,64 +894,75 @@ cursor in de alinea staat.
814* ZOEKEN 894* ZOEKEN
815-------- 895--------
816 896
817Emacs kan tekenreeksen ("strings") zoeken, zowel volgend op 897Emacs kan tekenreeksen ("strings") zoeken, zowel volgend op de
818de cursorpositie, als eraan voorafgaand. Het zoeken naar een string 898cursorpositie, als eraan voorafgaand. Het zoeken naar een string
819verplaatst de cursor naar de volgende plaats waar de gezochte string 899verplaatst de cursor naar de volgende plaats waar de gezochte string
820voorkomt. 900voorkomt.
821 901
822Het zoekcommando van Emacs is anders dan de zoekcommando's van de meeste 902Het zoekcommando van Emacs is anders dan de zoekcommando's van de
823tekstverwerkers; het zoekt incrementeel. Dit betekent dat het zoeken 903meeste tekstverwerkers; het zoekt incrementeel. Dit betekent dat het
824gebeurt tijdens het intikken van de gezochte string. 904zoeken gebeurt tijdens het intikken van de gezochte string.
825 905
826Het commando om het voorwaarts zoeken te starten is C-s (met de "s" van "to 906Het commando om het voorwaarts zoeken te starten is C-s (met de "s"
827search", zoeken); C-r start het achterwaarts zoeken (met de "r" van 907van "to search", zoeken); C-r start het achterwaarts zoeken (met de
828"reverse" of achteruit). MAAR WACHT! Probeer ze nu nog niet. 908"r" van "reverse" of achteruit). MAAR WACHT! Probeer ze nu nog niet.
829 909
830Als je C-s tikt verschijnt de string "I-search" in het echo-gebied. Dit 910Als je C-s tikt verschijnt de string "I-search" in het echo-gebied.
831betekent dat Emacs bezig is met een "incremental search" (incrementele 911Dit betekent dat Emacs bezig is met een "incremental search"
832zoekopdracht) en wacht op het intikken van de zoekstring. <RET> beëindigt 912(incrementele zoekopdracht) en wacht op het intikken van de
833het zoeken. 913zoekstring. <Return> beëindigt het zoeken.
834 914
835>> Tik nu C-s om het zoeken te starten. Tik nu, LANGZAAM, één letter per 915>> Tik nu C-s om het zoeken te starten. Tik nu, LANGZAAM, één letter
836 keer, het woord "cursor", met een pauze na elke letter zodat je kan 916 per keer, het woord "cursor", met een pauze na elke letter zodat je
837 zien wat er met de cursor gebeurt. Je hebt nu eenmaal naar het woord 917 kan zien wat er met de cursor gebeurt. Je hebt nu eenmaal naar het
838 "cursor" gezocht. 918 woord "cursor" gezocht.
839>> Tik nogmaals C-s, om naar het volgende voorkomen van het woord "cursor" te 919>> Tik nogmaals C-s, om naar het volgende voorkomen van het woord
840 zoeken. 920 "cursor" te zoeken.
841>> Tik nu viermaal <Delback> en let op de cursorbewegingen. 921>> Tik nu viermaal <Delback> en let op de cursorbewegingen.
842>> Tik <RET> om het zoeken te beëindigen. 922>> Tik <Return> om het zoeken te beëindigen.
923
924Zag je wat er gebeurde? Tijdens incrementeel zoeken probeert Emacs
925naar de eerste plek te gaan waar de string staat die je tot dan toe
926getikt hebt. Om naar de volgende plek te gaan, tik je C-s nog een
927keer. Als er geen volgende plek is gevonden, biept Emacs en vertelt
928je dat de zoekopdracht niets gevonden heeft ("failing" in het Engels).
929C-g zou het zoeken ook afbreken.
843 930
844Zag je wat er gebeurde? Tijdens incrementeel zoeken probeert Emacs naar 931OPMERKING: Op sommige systemen gebeurt er helemaal niets als je C-s
845de eerste plek te gaan waar de string staat die je tot dan toe getikt 932tikt, en daarna ook niets meer. Dit komt door een eigenschap van de
846hebt. Om naar de volgende plek te gaan, tik je C-s nog een keer. Als er 933machine waarop je werkt die te maken heeft met "flow control". Met
847geen volgende plek is gevonden, biept Emacs en vertelt je dat de zoekopdracht 934C-s stopt de "flow" en komt niets meer van wat je tikt bij Emacs
848niets gevonden heeft ("is failing" in het Engels). C-g zou het zoeken ook afbreken. 935terecht. Om deze situatie te herstellen, tik C-q. Lees daarna het
936hoofdstuk "Spontaneous Entry to Incremental Search" in het
937Emacs-handboek over hoe je moet omgaan met deze situatie.
849 938
850Als je tijdens incrementeel zoeken <Delback> tikt, zal je zien dat het 939Als je tijdens incrementeel zoeken <Delback> tikt, zal je zien dat het
851laatste teken dat je aan de zoekstring toegevoegd hebt, weggehaald wordt en dat het 940laatste teken dat je aan de zoekstring toegevoegd hebt, weggehaald
852zoeken teruggaat naar de voorgaande plaats. Als je bijvoorbeeld begint 941wordt en dat het zoeken teruggaat naar de voorgaande plaats. Als je
853met zoeken en je tikt een "c", dan ga je naar de plaats waar de "c" het 942bijvoorbeeld begint met zoeken en je tikt een "c", dan ga je naar de
854eerst voorkomt. Tik je vervolgens een "u", dan gaat de cursor naar de 943plaats waar de "c" het eerst voorkomt. Tik je vervolgens een "u", dan
855plaats waar de string "cu" het eerst voorkomt. Als je nu <Delback> tikt, dan 944gaat de cursor naar de plaats waar de string "cu" het eerst voorkomt.
856wordt de "u" van de zoekstring afgehaald, en gaat de cursor terug naar de 945Als je nu <Delback> tikt, dan wordt de "u" van de zoekstring
857plaats waar hij stond voordat je de "u" intikte, namelijk daar waar "c" het 946afgehaald, en gaat de cursor terug naar de plaats waar hij stond
858eerst voorkwam. 947voordat je de "u" intikte, namelijk daar waar "c" het eerst voorkwam.
859 948
860Als je tijdens een zoekoperatie een CONTROL- of META-teken intikt, dan 949Als je tijdens een zoekoperatie een CONTROL- of META-teken intikt, dan
861wordt het zoeken beëindigd. Er zijn een paar uitzonderingen, namelijk 950wordt het zoeken beëindigd. Er zijn een paar uitzonderingen, namelijk
862tekens die tijdens zoeken een speciale betekenis hebben, zoals C-s en C-r. 951tekens die tijdens zoeken een speciale betekenis hebben, zoals C-s en
952C-r.
863 953
864Met C-s begin je te zoeken naar de plaats waar de zoekstring voor het eerst 954Met C-s begin je te zoeken naar de plaats waar de zoekstring voor het
865voorkomt NA de huidige cursorpositie. Als je iets wilt zoeken dat eerder in 955eerst voorkomt NA de huidige cursorpositie. Als je iets wilt zoeken
866de tekst moet voorkomen, gebruik dan C-r in plaats van C-s. Alles wat we nu weten 956dat eerder in de tekst moet voorkomen, gebruik dan C-r in plaats van
867over C-s geldt ook voor C-r, alleen is de zoekrichting omgedraaid. 957C-s. Alles wat we nu weten over C-s geldt ook voor C-r, alleen is de
958zoekrichting omgedraaid.
868 959
869 960
870* MEERDERE VENSTERS 961* MEERDERE VENSTERS
871------------------- 962-------------------
872 963
873Een van Emacs' aardige eigenschappen is dat je meerdere vensters op het 964Een van Emacs' aardige eigenschappen is dat je meerdere vensters op
874scherm kan laten zien. 965het scherm kan laten zien.
875 966
876>> Zet de cursor op deze regel en tik C-u 0 C-l. 967>> Zet de cursor op deze regel en tik C-u 0 C-l.
877 968
@@ -880,52 +971,59 @@ scherm kan laten zien.
880 bovenste venster. 971 bovenste venster.
881 972
882>> Tik C-M-v om de tekst in het onderste venster te verschuiven. 973>> Tik C-M-v om de tekst in het onderste venster te verschuiven.
883 (Als je geen META-toets hebt, tik dan ESC C-v.) 974 (Als je geen META-toets hebt, tik dan <ESC> C-v.)
884 975
885>> Tik C-x o (met de o van "other"; "ander" in het Nederlands) 976>> Tik C-x o (met de o van "other"; "ander" in het Nederlands) om de
886 om de cursor naar het andere venster te verplaatsen. 977 cursor naar het andere venster te verplaatsen.
887 978
888>> Verschuif de tekst in het onderste venster, met C-v en M-v. 979>> Verschuif de tekst in het onderste venster, met C-v en M-v.
889 Zorg ervoor dat je deze inleiding in het bovenste venster leest. 980 Zorg ervoor dat je deze inleiding in het bovenste venster leest.
890 981
891>> Tik weer C-x o om de cursor weer in het bovenste venster 982>> Tik weer C-x o om de cursor weer in het bovenste venster te zetten.
892 te zetten. De cursor staat weer precies op de plaats waar 983 De cursor staat weer precies op de plaats waar hij stond toen je
893 hij stond toen je het venster verliet. 984 het venster verliet.
894 985
895Je kan C-x o blijven gebruiken om van venster naar venster te gaan. Elk 986Je kan C-x o blijven gebruiken om van venster naar venster te gaan.
896venster heeft zijn eigen cursorpositie; de cursor is altijd enkel zichtbaar 987Elk venster heeft zijn eigen cursorpositie; de cursor is altijd enkel
897in een daarvan. Alle normale commando's hebben betrekking op het venster 988zichtbaar in een daarvan. Alle normale commando's hebben betrekking
898waarin de cursor staat. Dit venster is het "geselecteerde venster" 989op het venster waarin de cursor staat. Dit venster is het
899("selected window" in het Engels). 990"geselecteerde venster" ("selected window" in het Engels).
900 991
901Het C-M-v commando is erg nuttig wanneer je tekst aan het editeren bent in 992Het C-M-v commando is erg nuttig wanneer je tekst aan het bewerken
902het ene venster, terwijl je het andere venster als referentie gebruikt. 993bent in het ene venster, terwijl je het andere venster als referentie
903Je kan de cursor dan altijd in het venster houden waarin je bezig bent, 994gebruikt. Je kan de cursor dan altijd in het venster houden waarin je
904terwijl je met C-M-v door de tekst in het andere venster loopt. 995bezig bent, terwijl je met C-M-v door de tekst in het andere venster
996loopt.
905 997
906C-M-v is een voorbeeld van een CONTROL-META teken. Als je een echte 998C-M-v is een voorbeeld van een CONTROL-META teken. Als je een echte
907META-toets hebt kan je C-M-v intikken door zowel CTRL als META ingedrukt te 999META-toets hebt kan je C-M-v intikken door zowel CONTROL als META
908houden terwijl je v tikt. Het maakt niet uit in welke volgorde je CTRL en 1000ingedrukt te houden terwijl je v tikt. Het maakt niet uit in welke
909META indrukt; het gaat erom welke toetsen ingedrukt zijn terwijl je tikt. 1001volgorde je CONTROL en META indrukt; het gaat erom welke toetsen
1002ingedrukt zijn terwijl je tikt.
910 1003
911Als je geen echte META-toets hebt kan je ESC gebruiken; de volgorde is dan 1004Als je geen echte META-toets hebt kan je <ESC> gebruiken; de volgorde
912wel belangrijk. Je moet dan eerst ESC tikken, gevolgd door CTRL-v; 1005is dan wel belangrijk. Je moet dan eerst <ESC> tikken, gevolgd door
913CTRL-ESC v zal niet werken. Dit komt doordat ESC zelf een teken is, 1006CONTROL-v; CONTROL-<ESC> v zal niet werken. Dit komt doordat <ESC>
914terwijl CTRL en META dat niet zijn. 1007zelf een teken is, terwijl CONTROL en META dat niet zijn.
915 1008
916>> Tik C-x 1 (in het bovenste venster) om het onderste venster te laten 1009>> Tik C-x 1 (in het bovenste venster) om het onderste venster te
917 verdwijnen. 1010 laten verdwijnen.
918 1011
919(Als je C-x 1 tikt in het onderste venster laat je het bovenste 1012(Als je C-x 1 tikt in het onderste venster laat je het bovenste
920verdwijnen. C-x 1 betekent zoveel als "ik wil maar 1 venster, 1013verdwijnen. C-x 1 betekent zoveel als "ik wil maar 1 venster, en wel
921en wel dat venster waar de cursor nu in staat.") 1014dat venster waar de cursor nu in staat.")
922 1015
923Hier is nog een manier om twee venster te krijgen die elk een andere tekst 1016Je hoeft niet dezelfde buffer in beide vensters te hebben. Wanneer je
924laten zien: 1017C-x C-f gebruikt om een bestand in één van de vensters te bezoeken,
1018zal het andere venster niet veranderen. Je kunt de vensters
1019onafhankelijk van elkaar gebruiken om bestanden te bezoeken.
925 1020
926>> Tik C-x 4 C-f gevolgd door de naam van een van je bestanden, gevolgd 1021Hier is nog een manier om twee venster te krijgen die elk een andere
927 door <Return>. Het opgegeven bestand zal in het onderste venster 1022tekst laten zien:
928 verschijnen, en de cursor zal in dat venster staan. 1023
1024>> Tik C-x 4 C-f gevolgd door de naam van een van je bestanden,
1025 gevolgd door <Return>. Het opgegeven bestand zal in het onderste
1026 venster verschijnen, en de cursor zal in dat venster staan.
929 1027
930>> Tik C-x o om terug naar het bovenste venster te gaan, en C-x 1 om 1028>> Tik C-x o om terug naar het bovenste venster te gaan, en C-x 1 om
931 het onderste venster te laten verdwijnen. 1029 het onderste venster te laten verdwijnen.
@@ -934,74 +1032,80 @@ laten zien:
934* RECURSIEVE BEWERKINGSNIVEAUS 1032* RECURSIEVE BEWERKINGSNIVEAUS
935------------------------------ 1033------------------------------
936 1034
937Soms kom je in Emacs in een recursief bewerkingsniveau terecht (Engels: 1035Soms kom je in Emacs in een recursief bewerkingsniveau terecht
938"recursive editing level"). Dit is te zien in de modusregel aan de vierkante 1036(Engels: "recursive editing level"). Dit is te zien in de modusregel
939haken die om de haakjes van de naam van de hoofdmodus staan. Dan staat er 1037aan de vierkante haken die om de haakjes van de naam van de hoofdmodus
940bijvoorbeeld [(Fundamental)] in plaats van (Fundamental). 1038staan. Dan staat er bijvoorbeeld [(Fundamental)] in plaats van
1039(Fundamental).
941 1040
942Tik ESC ESC ESC Om uit een recursief bewerkingsniveau te komen. Dit is 1041Tik <ESC> <ESC> <ESC> Om uit een recursief bewerkingsniveau te komen.
943een algemeen "ontsnappingscommando". Je kan het ook gebruiken om extra 1042Dit is een algemeen "ontsnappingscommando". Je kan het ook gebruiken
944vensters te verwijderen of om uit de minibuffer te komen. 1043om extra vensters te verwijderen of om uit de minibuffer te komen.
945 1044
946>> Tik M-x om in een minibuffer te komen, en tik dan ESC ESC ESC 1045>> Tik M-x om in een minibuffer te komen, en tik dan <ESC> <ESC> <ESC>
947 om er weer uit te komen. 1046 om er weer uit te komen.
948 1047
949C-g is niet bruikbaar om uit een recursief bewerkingsniveau te komen. De 1048C-g is niet bruikbaar om uit een recursief bewerkingsniveau te komen.
950reden hiervoor is dat C-g gebruikt wordt om commando's af te breken BINNEN 1049De reden hiervoor is dat C-g gebruikt wordt om commando's af te breken
951het recursieve bewerkingsniveau. 1050BINNEN het recursieve bewerkingsniveau.
952 1051
953 1052
954* MEER INFORMATIE 1053* MEER INFORMATIE
955----------------- 1054-----------------
956 1055
957We hebben geprobeerd je met deze inleiding precies genoeg informatie te leveren 1056We hebben geprobeerd je met deze inleiding precies genoeg informatie
958om met Emacs te beginnen werken. De mogelijkheden van Emacs zijn zo groot dat 1057te leveren om met Emacs te beginnen werken. De mogelijkheden van
959het onmogelijk is nu alles uit te leggen. Het kan zijn dat je meer over 1058Emacs zijn zo groot dat het onmogelijk is nu alles uit te leggen. Het
960Emacs wil leren omdat het zoveel nuttige mogelijkheden heeft. Emacs heeft 1059kan zijn dat je meer over Emacs wil leren omdat het zoveel nuttige
961commando's om documentatie te laten zien over Emacs commando's. Deze 1060mogelijkheden heeft. Emacs heeft commando's om documentatie te laten
962"helpcommando's" beginnen allemaal met C-h: "het Hulpteken". 1061zien over Emacs commando's. Deze "helpcommando's" beginnen allemaal
1062met C-h: "het Hulpteken".
963 1063
964Om hulp te krijgen tik je C-h, gevolgd door een teken om aan te duiden 1064Om hulp te krijgen tik je C-h, gevolgd door een teken om aan te duiden
965welke hulp je wilt. Als je het echt niet meer weet, tik C-h ? en Emacs 1065welke hulp je wilt. Als je het echt niet meer weet, tik C-h ? en
966vertelt welke hulp het allemaal te bieden heeft. Als je C-h hebt getikt 1066Emacs vertelt welke hulp het allemaal te bieden heeft. Als je C-h
967maar van gedachten veranderd bent, tik je gewoon C-g om het af te breken. 1067hebt getikt maar van gedachten veranderd bent, tik je gewoon C-g om
968 1068het af te breken.
969(In sommige installaties wordt de betekenis van C-h veranderd. Dat is geen goed 1069
970idee, zeker als die verandering op alle gebruikers invloed heeft, en is 1070(In sommige installaties wordt de betekenis van C-h veranderd. Dat is
971een geldige reden om je beklag te doen bij de systeembeheerder of de 1071geen goed idee, zeker als die verandering op alle gebruikers invloed
972helpdesk. Als C-h intussen niet een bericht onderaan het scherm laat zien 1072heeft, en is een geldige reden om je beklag te doen bij de
973over mogelijke hulp, probeer dan de F1 toets (functietoets 1) of gebruik 1073systeembeheerder of de helpdesk. Als C-h intussen niet een bericht
974M-x help RET.) 1074onderaan het scherm laat zien over mogelijke hulp, probeer dan de F1
1075toets (functietoets 1) of gebruik M-x help <Return>.)
975 1076
976De eenvoudigste hulp is C-h c. Tik C-h, het teken "c" en een teken of 1077De eenvoudigste hulp is C-h c. Tik C-h, het teken "c" en een teken of
977uitgebreid commando, en Emacs laat een zeer korte beschrijving van het 1078uitgebreid commando, en Emacs laat een zeer korte beschrijving van het
978commando zien. 1079commando zien.
979 1080
980>> Tik C-h c Control-p. 1081>> Tik C-h c C-p.
981 De beschrijving die getoond wordt zou zoiets moeten zijn als 1082
1083De beschrijving die getoond wordt, zou zoiets moeten zijn als:
982 1084
983 C-p runs the command previous-line 1085 C-p runs the command previous-line
984 1086
985 (Nederlands: C-p voert het commando previous-line uit.) 1087 (Nederlands: C-p voert het commando previous-line uit.)
986 1088
987Dit commando vertelt je "de naam van de functie". Functies worden vooral 1089Dit commando vertelt je "de naam van de functie". Functies worden
988gebruikt om Emacs uit te breiden of aan de wensen van de gebruiker aan te 1090vooral gebruikt om Emacs uit te breiden of aan de wensen van de
989passen. Aangezien functienamen gekozen zijn om aan te geven wat de 1091gebruiker aan te passen. Aangezien functienamen gekozen zijn om aan
990functie doet, zijn ze ook geschikt als heel korte documentatie; genoeg om 1092te geven wat de functie doet, zijn ze ook geschikt als heel korte
991je te herinneren aan wat de commando's die je al geleerd hebt betekenen. 1093documentatie; genoeg om je te herinneren aan wat de commando's die je
1094al geleerd hebt betekenen.
992 1095
993Uitgebreide commando's zoals C-x C-s en (als je geen META-, EDIT- of 1096Uitgebreide commando's zoals C-x C-s en (als je geen META-, EDIT- of
994ALT-toets hebt) <ESC> v kunnen ook getikt worden na C-h c. 1097ALT-toets hebt) <ESC> v kunnen ook getikt worden na C-h c.
995 1098
996Om meer informatie over een commando te krijgen, tik C-h k in plaats van 1099Om meer informatie over een commando te krijgen, tik C-h k in plaats
997C-h c. 1100van C-h c.
998 1101
999>> Tik C-h k C-p. 1102>> Tik C-h k C-p.
1000 1103
1001Dit laat de documentatie van de functie, inclusief de naam van de functie, 1104Dit laat de documentatie van de functie, inclusief de naam van de
1002in een apart venster zien. Als je klaar bent met lezen, tik C-x 1 om van 1105functie, in een apart venster zien. Als je klaar bent met lezen, tik
1003dat venster af te komen. Je hoeft dat natuurlijk niet meteen te doen. Je 1106C-x 1 om van dat venster af te komen. Je hoeft dat natuurlijk niet
1004kan ook eerst wat anders doen voordat je C-x 1 tikt. 1107meteen te doen. Je kan ook eerst wat anders doen voordat je C-x 1
1108tikt.
1005 1109
1006Hier zijn nog wat nuttige mogelijkheden van C-h: 1110Hier zijn nog wat nuttige mogelijkheden van C-h:
1007 1111
@@ -1009,91 +1113,134 @@ Hier zijn nog wat nuttige mogelijkheden van C-h:
1009 intikken. 1113 intikken.
1010 1114
1011>> Tik C-h f previous-line<Return> 1115>> Tik C-h f previous-line<Return>
1012 Dit laat alle informatie zien die Emacs heeft over de functie die het 1116 Dit laat alle informatie zien die Emacs heeft over de functie die
1013 C-p commando implementeert. 1117 het C-p commando implementeert.
1118
1119Een vergelijkbaar commando C-h v toont de documentatie van variabelen
1120die je kunt instellen om het gedrag van Emacs naar wens aan te passen.
1121Het commando vraagt je om de naam van een variabele.
1014 1122
1015 C-h a Commando Apropos. Tik een woord in en Emacs zal een 1123 C-h a Commando Apropos. Tik een woord in en Emacs zal een
1016 lijst van alle commando's laten zien waarin dat woord 1124 lijst van alle commando's laten zien waarin dat woord
1017 voorkomt. Al deze commando's kunnen aangeroepen worden 1125 voorkomt. Al deze commando's kunnen aangeroepen
1018 met M-x. Bij sommige commando's staat met welke tekens 1126 worden met M-x. Bij sommige commando's staat met
1019 dit commando direct uitgevoerd kan worden. 1127 welke tekens dit commando direct uitgevoerd kan
1128 worden.
1020 1129
1021>> Tik C-h a file<Return>. 1130>> Tik C-h a file<Return>.
1022 1131
1023Dit laat in een ander venster alle M-x commando's zien met "file" in hun 1132Dit laat in een ander venster alle M-x commando's zien met "file" in
1024naam. Je zal teken-commando's zien als C-x C-f naast de overeenkomende 1133hun naam. Je zal teken-commando's zien als C-x C-f naast de
1025commandonaam zoals find-file. 1134overeenkomende commandonaam zoals find-file.
1026 1135
1027>> Tik C-M-v herhaaldelijk om de tekst in het hulpvenster te verschuiven. 1136>> Tik C-M-v herhaaldelijk om de tekst in het hulpvenster te
1137 verschuiven.
1028 1138
1029>> Tik C-x 1 om het hulpvenster te verwijderen. 1139>> Tik C-x 1 om het hulpvenster te verwijderen.
1030 1140
1141 C-h i Lees de online handleidingen (ook wel Info genoemd).
1142 Dit commando zet je in een speciale buffer genaamd
1143 "*info*" waar je online handleidingen kunt lezen van
1144 software die op je computer is geïnstalleerd. Tik m
1145 Emacs <Return> om de handleiding van Emacs te lezen.
1146 Als je nog nooit Info hebt gebruikt dan kun je ?
1147 tikken zodat Emacs je een rondleiding geeft langs de
1148 mogelijkheden van het Info systeem. Wanneer je klaar
1149 bent met deze Emacs-inleiding dan kun je de
1150 Emacs-Info-handleiding gebruiken als je primaire bron
1151 van informatie.
1152
1153
1154* MEER MOGELIJKHEDEN
1155--------------------
1156
1157Je kunt meer over Emacs leren door haar handleiding te lezen. Deze is
1158zowel als boek als in elektronische vorm via Info beschikbaar (gebruik
1159het Help menu of tik <F10> h r). Kijk bijvoorbeeld eens naar
1160"completion", hetgeen minder tikwerk oplevert, of "dired" wat het
1161omgaan met bestanden vereenvoudigt.
1162
1163"Completion" (of "afmaken", in het Nederlands) is een manier om
1164onnodig tikwerk te voorkomen. Als je bijvoorbeeld naar de
1165"*Messages*" buffer wilt omschakelen, dan kun je C-x b *M<Tab> tikken
1166en dan zal Emacs de rest van de buffernaam invullen voor zover dit
1167mogelijk is. Completion staat beschreven in de node "Completion" in
1168de Emacs-Info-handleiding.
1169
1170"Dired" toont je een lijst van bestanden in een directory, waarmee je
1171gemakkelijk bestanden kunt bezoeken, van naam kunt veranderen, kunt
1172wissen, of andere acties op uit kunt voeren. Informatie over Dired
1173kun je vinden in de node "Dired" van de Emacs-Info-handleiding.
1174
1031 1175
1032* CONCLUSIE 1176* CONCLUSIE
1033----------- 1177-----------
1034 1178
1035Denk eraan dat je met C-x C-c gebruikt om Emacs te verlaten. Om tijdelijk 1179Denk eraan dat je met C-x C-c Emacs permanent verlaat. Om tijdelijk
1036een shell te krijgen en daarna weer in Emacs terug te komen, tik C-z. 1180een shell te krijgen en daarna weer in Emacs terug te komen, tik je
1181C-z.
1037 1182
1038De bedoeling van deze inleiding is dat ze begrijpelijk is voor alle nieuwe 1183De bedoeling van deze inleiding is dat ze begrijpelijk is voor alle
1039Emacs-gebruikers. Als je dus iets onduidelijks bent tegengekomen, blijf 1184nieuwe Emacs-gebruikers. Als je dus iets onduidelijks bent
1040dan niet zitten en maak jezelf geen verwijten. Doe je beklag! 1185tegengekomen, blijf dan niet zitten en maak jezelf geen verwijten.
1186Doe je beklag!
1041 1187
1042 1188
1043* KOPIËREN 1189* KOPIËREN
1044----------- 1190-----------
1045 1191
1046(De Engelse versie van) deze inleiding is voorafgegaan door een lange reeks 1192(De Engelse versie van) deze inleiding is voorafgegaan door een lange
1047van Emacs-inleidingen, die begon met de inleiding die Stuart Cracraft schreef 1193reeks van Emacs-inleidingen, die begon met de inleiding die Stuart
1048voor de originele Emacs. Deze Nederlandse vertaling is gemaakt door 1194Cracraft schreef voor de originele Emacs. Deze Nederlandse vertaling
1049Pieter Schoenmakers <tiggr@ics.ele.tue.nl> op basis van de GNU Emacs 20.2 1195is gemaakt door Pieter Schoenmakers <tiggr@ics.ele.tue.nl> op basis
1050TUTORIAL, en verbeterd en verbeterd door Frederik Fouvry. 1196van de GNU Emacs 20.2 TUTORIAL, en nagezien en verbeterd door Frederik
1197Fouvry en Lute Kamstra.
1051 1198
1052(Wat nu volgt is een vertaling naar het Nederlands van de condities voor 1199(Wat nu volgt is een vertaling naar het Nederlands van de condities
1053gebruik en verspreiding van deze inleiding. Deze vertaling is niet 1200voor gebruik en verspreiding van deze inleiding. Deze vertaling is
1054gecontroleerd door een jurist. Er kunnen derhalve geen rechten aan de 1201niet gecontroleerd door een jurist. Er kunnen derhalve geen rechten
1055vertaling worden ontleend, en de vertaling wordt gevolgd door het Engelse 1202aan de vertaling worden ontleend, en de vertaling wordt gevolgd door
1056origineel.) 1203het Engelse origineel.)
1057 1204
1058Deze versie van de inleiding valt onder copyright, net als GNU Emacs. 1205Deze versie van de inleiding valt onder copyright, net als GNU Emacs.
1059Je mag deze inleiding verdelen onder bepaalde voorwaarden: 1206Je mag deze inleiding verspreiden onder bepaalde voorwaarden:
1060 1207
1061Copyright (c) 1985, 1996, 1997 Free Software Foundation 1208Copyright (c) 1985, 1996, 1997, 2003, 2004, 2005 Free Software Foundation
1062 1209
1063 Iedereen mag letterlijke kopieën van dit document, zowel ontvangen als 1210 Iedereen mag letterlijke kopieën van dit document, zowel ontvangen
1064 verspreiden, op elk medium, vooropgesteld dat de copyrightvermelding en 1211 als verspreiden, op elk medium, vooropgesteld dat de
1065 de toestemmingsmelding niet veranderd worden en dat de verspreider aan de 1212 copyrightvermelding en de toestemmingsmelding niet veranderd worden
1066 ontvanger dezelfde distributierechten verleent als aan hem verleend 1213 en dat de verspreider aan de ontvanger dezelfde distributierechten
1067 worden door deze melding. 1214 verleent als aan hem verleend worden door deze melding.
1068 1215
1069 Toestemming wordt verleend om veranderde versies van dit document, 1216 Toestemming wordt verleend om veranderde versies van dit document,
1070 of delen daarvan, te verspreiden, onder bovenstaande voorwaarden, 1217 of delen daarvan, te verspreiden, onder bovenstaande voorwaarden,
1071 vooropgesteld dat ze ook duidelijk vermelden wie als 1218 vooropgesteld dat ze ook duidelijk vermelden wie als laatste
1072 laatste veranderingen aangebracht heeft. 1219 veranderingen aangebracht heeft.
1073 1220
1074De condities voor het kopiëren van Emacs zelf zijn ingewikkelder dan dit, 1221De condities voor het kopiëren van Emacs zelf zijn ingewikkelder dan
1075maar gebaseerd op dezelfde gedachte. Lees het bestand COPYING en geef 1222dit, maar gebaseerd op dezelfde gedachte. Lees het bestand COPYING en
1076vervolgens kopieën van Emacs aan al je vrienden. Help bij het uitroeien 1223geef vervolgens kopieën van Emacs aan al je vrienden. Help bij het
1077van softwarebeschermingspolitiek ("eigendom") door vrije software 1224uitroeien van softwarebeschermingspolitiek ("eigendom") door vrije
1078te gebruiken, te schrijven en te delen! 1225software te gebruiken, te schrijven en te delen!
1079 1226
1080(Engels origineel van de copyrightmelding en condities: 1227(Engels origineel van de copyrightmelding en condities:
1081 1228
1082This version of the tutorial, like GNU Emacs, is copyrighted, and 1229This version of the tutorial, like GNU Emacs, is copyrighted, and
1083comes with permission to distribute copies on certain conditions: 1230comes with permission to distribute copies on certain conditions:
1084 1231
1085Copyright (c) 1985, 1996 Free Software Foundation 1232Copyright (c) 1985, 1996, 1997, 2003, 2004, 2005 Free Software Foundation
1086 1233
1087 Permission is granted to anyone to make or distribute verbatim copies 1234 Permission is granted to anyone to make or distribute verbatim
1088 of this document as received, in any medium, provided that the 1235 copies of this document as received, in any medium, provided that
1089 copyright notice and permission notice are preserved, 1236 the copyright notice and permission notice are preserved, and that
1090 and that the distributor grants the recipient permission 1237 the distributor grants the recipient permission for further
1091 for further redistribution as permitted by this notice. 1238 redistribution as permitted by this notice.
1092 1239
1093 Permission is granted to distribute modified versions 1240 Permission is granted to distribute modified versions of this
1094 of this document, or of portions of it, 1241 document, or of portions of it, under the above conditions,
1095 under the above conditions, provided also that they 1242 provided also that they carry prominent notices stating who last
1096 carry prominent notices stating who last altered them. 1243 altered them.
1097 1244
1098The conditions for copying Emacs itself are more complex, but in the 1245The conditions for copying Emacs itself are more complex, but in the
1099same spirit. Please read the file COPYING and then do give copies of 1246same spirit. Please read the file COPYING and then do give copies of
diff --git a/lisp/gnus/bar.xbm b/etc/images/gnus/bar.xbm
index e61300adb20..e61300adb20 100644
--- a/lisp/gnus/bar.xbm
+++ b/etc/images/gnus/bar.xbm
diff --git a/lisp/gnus/bar.xpm b/etc/images/gnus/bar.xpm
index 2985065a5c6..2985065a5c6 100644
--- a/lisp/gnus/bar.xpm
+++ b/etc/images/gnus/bar.xpm
diff --git a/lisp/gnus/catchup.pbm b/etc/images/gnus/catchup.pbm
index 3fc571bdf80..3fc571bdf80 100644
--- a/lisp/gnus/catchup.pbm
+++ b/etc/images/gnus/catchup.pbm
Binary files differ
diff --git a/lisp/gnus/catchup.xpm b/etc/images/gnus/catchup.xpm
index cba849712df..cba849712df 100644
--- a/lisp/gnus/catchup.xpm
+++ b/etc/images/gnus/catchup.xpm
diff --git a/lisp/gnus/cu-exit.pbm b/etc/images/gnus/cu-exit.pbm
index 210869cce78..210869cce78 100644
--- a/lisp/gnus/cu-exit.pbm
+++ b/etc/images/gnus/cu-exit.pbm
Binary files differ
diff --git a/lisp/gnus/cu-exit.xpm b/etc/images/gnus/cu-exit.xpm
index 17236223fed..17236223fed 100644
--- a/lisp/gnus/cu-exit.xpm
+++ b/etc/images/gnus/cu-exit.xpm
diff --git a/lisp/gnus/dead.xpm b/etc/images/gnus/dead.xpm
index 56463a72951..56463a72951 100644
--- a/lisp/gnus/dead.xpm
+++ b/etc/images/gnus/dead.xpm
diff --git a/lisp/gnus/describe-group.pbm b/etc/images/gnus/describe-group.pbm
index de7bf110431..de7bf110431 100644
--- a/lisp/gnus/describe-group.pbm
+++ b/etc/images/gnus/describe-group.pbm
Binary files differ
diff --git a/lisp/gnus/describe-group.xpm b/etc/images/gnus/describe-group.xpm
index b4a6f42a94b..b4a6f42a94b 100644
--- a/lisp/gnus/describe-group.xpm
+++ b/etc/images/gnus/describe-group.xpm
diff --git a/lisp/gnus/exit-gnus.pbm b/etc/images/gnus/exit-gnus.pbm
index 32ad0e0ebe9..32ad0e0ebe9 100644
--- a/lisp/gnus/exit-gnus.pbm
+++ b/etc/images/gnus/exit-gnus.pbm
Binary files differ
diff --git a/lisp/gnus/exit-gnus.xpm b/etc/images/gnus/exit-gnus.xpm
index 534f3c2fafb..534f3c2fafb 100644
--- a/lisp/gnus/exit-gnus.xpm
+++ b/etc/images/gnus/exit-gnus.xpm
diff --git a/lisp/gnus/exit-summ.pbm b/etc/images/gnus/exit-summ.pbm
index d0192310607..d0192310607 100644
--- a/lisp/gnus/exit-summ.pbm
+++ b/etc/images/gnus/exit-summ.pbm
Binary files differ
diff --git a/lisp/gnus/exit-summ.xpm b/etc/images/gnus/exit-summ.xpm
index 5234ccb11ec..5234ccb11ec 100644
--- a/lisp/gnus/exit-summ.xpm
+++ b/etc/images/gnus/exit-summ.xpm
diff --git a/lisp/gnus/followup.pbm b/etc/images/gnus/followup.pbm
index 61be114096b..61be114096b 100644
--- a/lisp/gnus/followup.pbm
+++ b/etc/images/gnus/followup.pbm
Binary files differ
diff --git a/lisp/gnus/followup.xpm b/etc/images/gnus/followup.xpm
index 444895a4399..444895a4399 100644
--- a/lisp/gnus/followup.xpm
+++ b/etc/images/gnus/followup.xpm
diff --git a/lisp/gnus/fuwo.pbm b/etc/images/gnus/fuwo.pbm
index b81af10c399..b81af10c399 100644
--- a/lisp/gnus/fuwo.pbm
+++ b/etc/images/gnus/fuwo.pbm
Binary files differ
diff --git a/lisp/gnus/fuwo.xpm b/etc/images/gnus/fuwo.xpm
index 362cbc5725a..362cbc5725a 100644
--- a/lisp/gnus/fuwo.xpm
+++ b/etc/images/gnus/fuwo.xpm
diff --git a/lisp/gnus/get-news.pbm b/etc/images/gnus/get-news.pbm
index c0080716c44..c0080716c44 100644
--- a/lisp/gnus/get-news.pbm
+++ b/etc/images/gnus/get-news.pbm
Binary files differ
diff --git a/lisp/gnus/get-news.xpm b/etc/images/gnus/get-news.xpm
index d7e7b4a3553..d7e7b4a3553 100644
--- a/lisp/gnus/get-news.xpm
+++ b/etc/images/gnus/get-news.xpm
diff --git a/lisp/gnus/gnntg.pbm b/etc/images/gnus/gnntg.pbm
index 2f5e5261a97..2f5e5261a97 100644
--- a/lisp/gnus/gnntg.pbm
+++ b/etc/images/gnus/gnntg.pbm
Binary files differ
diff --git a/lisp/gnus/gnntg.xpm b/etc/images/gnus/gnntg.xpm
index 21bc5f16eb2..21bc5f16eb2 100644
--- a/lisp/gnus/gnntg.xpm
+++ b/etc/images/gnus/gnntg.xpm
diff --git a/lisp/gnus/gnus-pointer.xbm b/etc/images/gnus/gnus-pointer.xbm
index 94e915428c3..94e915428c3 100644
--- a/lisp/gnus/gnus-pointer.xbm
+++ b/etc/images/gnus/gnus-pointer.xbm
diff --git a/lisp/gnus/gnus-pointer.xpm b/etc/images/gnus/gnus-pointer.xpm
index c47443dbb74..c47443dbb74 100644
--- a/lisp/gnus/gnus-pointer.xpm
+++ b/etc/images/gnus/gnus-pointer.xpm
diff --git a/lisp/gnus/gnus.xbm b/etc/images/gnus/gnus.xbm
index 58d1ac845aa..58d1ac845aa 100644
--- a/lisp/gnus/gnus.xbm
+++ b/etc/images/gnus/gnus.xbm
diff --git a/lisp/gnus/gnus.xpm b/etc/images/gnus/gnus.xpm
index b6ee4d0d733..b6ee4d0d733 100644
--- a/lisp/gnus/gnus.xpm
+++ b/etc/images/gnus/gnus.xpm
diff --git a/lisp/gnus/important.xpm b/etc/images/gnus/important.xpm
index e972facff24..e972facff24 100644
--- a/lisp/gnus/important.xpm
+++ b/etc/images/gnus/important.xpm
diff --git a/lisp/gnus/kill-group.pbm b/etc/images/gnus/kill-group.pbm
index 50831447f50..50831447f50 100644
--- a/lisp/gnus/kill-group.pbm
+++ b/etc/images/gnus/kill-group.pbm
Binary files differ
diff --git a/lisp/gnus/kill-group.xpm b/etc/images/gnus/kill-group.xpm
index 1ee4fa42add..1ee4fa42add 100644
--- a/lisp/gnus/kill-group.xpm
+++ b/etc/images/gnus/kill-group.xpm
diff --git a/lisp/gnus/mail-reply.pbm b/etc/images/gnus/mail-reply.pbm
index 9ca76596fb1..9ca76596fb1 100644
--- a/lisp/gnus/mail-reply.pbm
+++ b/etc/images/gnus/mail-reply.pbm
Binary files differ
diff --git a/lisp/gnus/mail-reply.xpm b/etc/images/gnus/mail-reply.xpm
index a87f7846170..a87f7846170 100644
--- a/lisp/gnus/mail-reply.xpm
+++ b/etc/images/gnus/mail-reply.xpm
diff --git a/lisp/gnus/next-ur.pbm b/etc/images/gnus/next-ur.pbm
index 678bbb09f8b..678bbb09f8b 100644
--- a/lisp/gnus/next-ur.pbm
+++ b/etc/images/gnus/next-ur.pbm
Binary files differ
diff --git a/lisp/gnus/next-ur.xpm b/etc/images/gnus/next-ur.xpm
index bea13280b68..bea13280b68 100644
--- a/lisp/gnus/next-ur.xpm
+++ b/etc/images/gnus/next-ur.xpm
diff --git a/lisp/gnus/post.pbm b/etc/images/gnus/post.pbm
index 577d6236bfd..577d6236bfd 100644
--- a/lisp/gnus/post.pbm
+++ b/etc/images/gnus/post.pbm
Binary files differ
diff --git a/lisp/gnus/post.xpm b/etc/images/gnus/post.xpm
index 7a3eaa5e3b1..7a3eaa5e3b1 100644
--- a/lisp/gnus/post.xpm
+++ b/etc/images/gnus/post.xpm
diff --git a/lisp/gnus/prev-ur.pbm b/etc/images/gnus/prev-ur.pbm
index 49389198bdf..49389198bdf 100644
--- a/lisp/gnus/prev-ur.pbm
+++ b/etc/images/gnus/prev-ur.pbm
Binary files differ
diff --git a/lisp/gnus/prev-ur.xpm b/etc/images/gnus/prev-ur.xpm
index 80131332832..80131332832 100644
--- a/lisp/gnus/prev-ur.xpm
+++ b/etc/images/gnus/prev-ur.xpm
diff --git a/lisp/gnus/preview.xbm b/etc/images/gnus/preview.xbm
index a42e153d5d2..a42e153d5d2 100644
--- a/lisp/gnus/preview.xbm
+++ b/etc/images/gnus/preview.xbm
diff --git a/lisp/gnus/preview.xpm b/etc/images/gnus/preview.xpm
index f5743f91526..f5743f91526 100644
--- a/lisp/gnus/preview.xpm
+++ b/etc/images/gnus/preview.xpm
diff --git a/lisp/gnus/receipt.xpm b/etc/images/gnus/receipt.xpm
index 18caaf1cf78..18caaf1cf78 100644
--- a/lisp/gnus/receipt.xpm
+++ b/etc/images/gnus/receipt.xpm
diff --git a/lisp/gnus/reply-wo.pbm b/etc/images/gnus/reply-wo.pbm
index def54da8ede..def54da8ede 100644
--- a/lisp/gnus/reply-wo.pbm
+++ b/etc/images/gnus/reply-wo.pbm
Binary files differ
diff --git a/lisp/gnus/reply-wo.xpm b/etc/images/gnus/reply-wo.xpm
index 370678af70d..370678af70d 100644
--- a/lisp/gnus/reply-wo.xpm
+++ b/etc/images/gnus/reply-wo.xpm
diff --git a/lisp/gnus/reply.pbm b/etc/images/gnus/reply.pbm
index ee181e663be..ee181e663be 100644
--- a/lisp/gnus/reply.pbm
+++ b/etc/images/gnus/reply.pbm
Binary files differ
diff --git a/lisp/gnus/reply.xpm b/etc/images/gnus/reply.xpm
index a45884803fe..a45884803fe 100644
--- a/lisp/gnus/reply.xpm
+++ b/etc/images/gnus/reply.xpm
diff --git a/lisp/gnus/reverse-smile.xpm b/etc/images/gnus/reverse-smile.xpm
index 56db090e4b3..56db090e4b3 100644
--- a/lisp/gnus/reverse-smile.xpm
+++ b/etc/images/gnus/reverse-smile.xpm
diff --git a/lisp/gnus/rot13.pbm b/etc/images/gnus/rot13.pbm
index 104246cdb8f..104246cdb8f 100644
--- a/lisp/gnus/rot13.pbm
+++ b/etc/images/gnus/rot13.pbm
Binary files differ
diff --git a/lisp/gnus/rot13.xpm b/etc/images/gnus/rot13.xpm
index 6e2d7ac3ccf..6e2d7ac3ccf 100644
--- a/lisp/gnus/rot13.xpm
+++ b/etc/images/gnus/rot13.xpm
diff --git a/lisp/gnus/save-aif.pbm b/etc/images/gnus/save-aif.pbm
index 15829c289e7..15829c289e7 100644
--- a/lisp/gnus/save-aif.pbm
+++ b/etc/images/gnus/save-aif.pbm
Binary files differ
diff --git a/lisp/gnus/save-aif.xpm b/etc/images/gnus/save-aif.xpm
index f0325ac2fb9..f0325ac2fb9 100644
--- a/lisp/gnus/save-aif.xpm
+++ b/etc/images/gnus/save-aif.xpm
diff --git a/lisp/gnus/save-art.pbm b/etc/images/gnus/save-art.pbm
index 68fe0cb3098..68fe0cb3098 100644
--- a/lisp/gnus/save-art.pbm
+++ b/etc/images/gnus/save-art.pbm
Binary files differ
diff --git a/lisp/gnus/save-art.xpm b/etc/images/gnus/save-art.xpm
index fe9726fa3fe..fe9726fa3fe 100644
--- a/lisp/gnus/save-art.xpm
+++ b/etc/images/gnus/save-art.xpm
diff --git a/lisp/gnus/subscribe.pbm b/etc/images/gnus/subscribe.pbm
index fe6b3920d36..fe6b3920d36 100644
--- a/lisp/gnus/subscribe.pbm
+++ b/etc/images/gnus/subscribe.pbm
Binary files differ
diff --git a/lisp/gnus/subscribe.xpm b/etc/images/gnus/subscribe.xpm
index ff193a9e8ab..ff193a9e8ab 100644
--- a/lisp/gnus/subscribe.xpm
+++ b/etc/images/gnus/subscribe.xpm
diff --git a/lisp/gnus/unimportant.xpm b/etc/images/gnus/unimportant.xpm
index 4298224e56c..4298224e56c 100644
--- a/lisp/gnus/unimportant.xpm
+++ b/etc/images/gnus/unimportant.xpm
diff --git a/lisp/gnus/unsubscribe.pbm b/etc/images/gnus/unsubscribe.pbm
index 7d869fb53fe..7d869fb53fe 100644
--- a/lisp/gnus/unsubscribe.pbm
+++ b/etc/images/gnus/unsubscribe.pbm
Binary files differ
diff --git a/lisp/gnus/unsubscribe.xpm b/etc/images/gnus/unsubscribe.xpm
index a91180d00f8..a91180d00f8 100644
--- a/lisp/gnus/unsubscribe.xpm
+++ b/etc/images/gnus/unsubscribe.xpm
diff --git a/lisp/gnus/uu-decode.pbm b/etc/images/gnus/uu-decode.pbm
index 2b7fada1473..2b7fada1473 100644
--- a/lisp/gnus/uu-decode.pbm
+++ b/etc/images/gnus/uu-decode.pbm
Binary files differ
diff --git a/lisp/gnus/uu-decode.xpm b/etc/images/gnus/uu-decode.xpm
index b9d940cc99e..b9d940cc99e 100644
--- a/lisp/gnus/uu-decode.xpm
+++ b/etc/images/gnus/uu-decode.xpm
diff --git a/lisp/gnus/uu-post.pbm b/etc/images/gnus/uu-post.pbm
index a5face70980..a5face70980 100644
--- a/lisp/gnus/uu-post.pbm
+++ b/etc/images/gnus/uu-post.pbm
Binary files differ
diff --git a/lisp/gnus/uu-post.xpm b/etc/images/gnus/uu-post.xpm
index 7c4204c6957..7c4204c6957 100644
--- a/lisp/gnus/uu-post.xpm
+++ b/etc/images/gnus/uu-post.xpm
diff --git a/lisp/gnus/blink.pbm b/etc/images/smilies/blink.pbm
index 6c7531b92c6..6c7531b92c6 100644
--- a/lisp/gnus/blink.pbm
+++ b/etc/images/smilies/blink.pbm
Binary files differ
diff --git a/lisp/gnus/blink.xpm b/etc/images/smilies/blink.xpm
index 5035122119f..5035122119f 100644
--- a/lisp/gnus/blink.xpm
+++ b/etc/images/smilies/blink.xpm
diff --git a/lisp/gnus/braindamaged.xpm b/etc/images/smilies/braindamaged.xpm
index 25bd3e7bbee..25bd3e7bbee 100644
--- a/lisp/gnus/braindamaged.xpm
+++ b/etc/images/smilies/braindamaged.xpm
diff --git a/lisp/gnus/cry.xpm b/etc/images/smilies/cry.xpm
index 8d8558dbc5b..8d8558dbc5b 100644
--- a/lisp/gnus/cry.xpm
+++ b/etc/images/smilies/cry.xpm
diff --git a/lisp/gnus/evil.xpm b/etc/images/smilies/evil.xpm
index c364ac34ae1..c364ac34ae1 100644
--- a/lisp/gnus/evil.xpm
+++ b/etc/images/smilies/evil.xpm
diff --git a/lisp/gnus/forced.xpm b/etc/images/smilies/forced.xpm
index 43ba8d2b502..43ba8d2b502 100644
--- a/lisp/gnus/forced.xpm
+++ b/etc/images/smilies/forced.xpm
diff --git a/lisp/gnus/frown.pbm b/etc/images/smilies/frown.pbm
index f51ea4f3094..f51ea4f3094 100644
--- a/lisp/gnus/frown.pbm
+++ b/etc/images/smilies/frown.pbm
Binary files differ
diff --git a/lisp/gnus/frown.xpm b/etc/images/smilies/frown.xpm
index 25ca99d11a2..25ca99d11a2 100644
--- a/lisp/gnus/frown.xpm
+++ b/etc/images/smilies/frown.xpm
diff --git a/lisp/gnus/grin.xpm b/etc/images/smilies/grin.xpm
index 292cb1110e8..292cb1110e8 100644
--- a/lisp/gnus/grin.xpm
+++ b/etc/images/smilies/grin.xpm
diff --git a/lisp/gnus/indifferent.xpm b/etc/images/smilies/indifferent.xpm
index 639523855a9..639523855a9 100644
--- a/lisp/gnus/indifferent.xpm
+++ b/etc/images/smilies/indifferent.xpm
diff --git a/lisp/gnus/sad.pbm b/etc/images/smilies/sad.pbm
index 892e34352d7..892e34352d7 100644
--- a/lisp/gnus/sad.pbm
+++ b/etc/images/smilies/sad.pbm
Binary files differ
diff --git a/lisp/gnus/sad.xpm b/etc/images/smilies/sad.xpm
index b0acef42a53..b0acef42a53 100644
--- a/lisp/gnus/sad.xpm
+++ b/etc/images/smilies/sad.xpm
diff --git a/lisp/gnus/smile.pbm b/etc/images/smilies/smile.pbm
index f64e883498c..f64e883498c 100644
--- a/lisp/gnus/smile.pbm
+++ b/etc/images/smilies/smile.pbm
Binary files differ
diff --git a/lisp/gnus/smile.xpm b/etc/images/smilies/smile.xpm
index 374d240a955..374d240a955 100644
--- a/lisp/gnus/smile.xpm
+++ b/etc/images/smilies/smile.xpm
diff --git a/lisp/gnus/wry.pbm b/etc/images/smilies/wry.pbm
index 5fa5e9f2288..5fa5e9f2288 100644
--- a/lisp/gnus/wry.pbm
+++ b/etc/images/smilies/wry.pbm
Binary files differ
diff --git a/lisp/gnus/wry.xpm b/etc/images/smilies/wry.xpm
index 8cd8dedce65..8cd8dedce65 100644
--- a/lisp/gnus/wry.xpm
+++ b/etc/images/smilies/wry.xpm
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 831c0e9e747..a435c3a6c52 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,121 @@
12005-02-16 Luc Teirlinck <teirllm@auburn.edu>
2
3 * autorevert.el (auto-revert-stop-on-user-input): Further doc fix.
4
52005-02-16 Kim F. Storm <storm@cua.dk>
6
7 * ido.el (ido-fallback-command): Pass user input to fallback command.
8
92005-02-16 Nick Roberts <nickrob@snap.net.nz>
10
11 * progmodes/gdb-ui.el (gdb-set-gud-minor-mode-existing-buffers)
12 (gdb-find-file-hook): Add server prefix.
13
142005-02-16 Richard M. Stallman <rms@gnu.org>
15
16 * replace.el (perform-replace): Pass new args to replace-highlight.
17 (replace-highlight): Take region args,
18 and pass them to isearch-lazy-highlight-new-loop.
19
20 * novice.el (disabled-command-hook): Autoload the defalias
21 and the make-obsolete-variable call.
22
23 * menu-bar.el (menu-bar-select-frame): FRAME defaults to selected.
24
25 * isearch.el (isearch-lazy-highlight-start-limit)
26 (isearch-lazy-highlight-end-limit): New variables limit
27 the region for highlighting.
28 (isearch-lazy-highlight-new-loop): New args BEG and END.
29 (isearch-lazy-highlight-search): Use the new vars.
30 (isearch-lazy-highlight-update): Likewise.
31
32 * dired.el (dired-build-subdir-alist): Bind buffer-undo-list to t.
33
34 * cus-start.el (all): Use default-boundp.
35
362005-02-15 David Casperson <casper@unbc.ca> (tiny change)
37
38 * menu-bar.el (menu-bar-select-frame): Handle current frame.
39
402005-02-15 Luc Teirlinck <teirllm@auburn.edu>
41
42 * autorevert.el (auto-revert-stop-on-user-input)
43 (auto-revert-verbose): Doc fixes.
44
452005-02-15 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
46
47 * international/mule-cmds.el (set-locale-environment): Remove call
48 to set-selection-coding-system on Windows.
49
502005-02-15 Jay Belanger <belanger@truman.edu>
51
52 * calc/calc-alg.el: Add simplification rules for calcFunc-sec,
53 calcFunc-csc, calcFunc-cot, calcFunc-sech, calcFunc-csch and
54 calcFunc-coth.
55 (math-simplify-sqrt): Add simplifications.
56
57 * calc/calc-arith.el (math-real-if-arg-functions): Add functions
58 to list.
59
60 * calc/calc-ext.el: Add functions to autoloads.
61
62 * calc/calc-math.el (calc-sec, calc-csc, calc-cot, calc-sech)
63 (calc-csch, calc-coth, calcFunc-sec, calcFunc-csc, calcFunc-cot)
64 (calcFunc-sech, calcFunc-csch, calcFunc-coth, math-sec-raw)
65 (math-csc-raw, math-cot-raw): New functions.
66
67 * calc/calc-rules.el (calc-DistribRules, calc-NegateRules): Add rules.
68
69 * calc/calc-undo.el (calc-handle-undo): Remove prefix from
70 the variable name in a message.
71
72 * calc/calc-units.el: Add simplification rules for calcFunc-sec,
73 calcFunc-csc, calcFunc-cot.
74
75 * calc/calcalg2.el: Add derivative and integration rules for
76 calcFunc-sec, calcFunc-csc, calcFunc-cot, calcFunc-sech,
77 calcFunc-csch, calcFunc-coth.
78 (math-do-integral-methods): Add to checks for when to use
79 substitutions.
80
81 * calc/calccomp.el (math-eqn-special-funcs): Add functions to list.
82
832005-02-15 Lute Kamstra <lute@gnu.org>
84
85 * emacs-lisp/lisp-mode.el (lisp-mode-variables): Add
86 ;;;###autoload to `outline-regexp'. Suggested by Stefan Monnier
87 <monnier@iro.umontreal.ca>
88 (lisp-outline-level): Improve efficiency. Suggested by David
89 Kastrup <dak@gnu.org>.
90
912005-02-15 Nick Roberts <nickrob@snap.net.nz>
92
93 * progmodes/gdb-ui.el (gdb-find-file-unhook): New variable.
94 (gdb-set-gud-minor-mode, gdb-set-gud-minor-mode-1)
95 (gdb-set-gud-minor-mode-existing-buffers): New functions.
96 (gdb-find-file-hook): New hook. Add it to find-file-hook.
97 (gdb-info-breakpoints-custom, gdb-source-info): Simplify.
98
992005-02-14 Luc Teirlinck <teirllm@auburn.edu>
100
101 * cus-start.el (all): Comment change.
102
1032005-02-14 Lute Kamstra <lute@gnu.org>
104
105 * cus-start.el (all): Check if symbol is void.
106
1072005-02-14 Carsten Dominik <dominik@science.uva.nl>
108
109 * textmodes/reftex-cite.el (reftex-do-citation): Cleanup single
110 optional argument to \cite.
111
1122005-02-14 Richard M. Stallman <rms@gnu.org>
113
114 * cus-edit.el (custom-buffer-create-internal): Update help message.
115 (custom-magic-alist): Update help messages.
116
117 * cus-start.el (all): Allow a var to specify a standard value.
118
12005-02-12 Luc Teirlinck <teirllm@auburn.edu> 1192005-02-12 Luc Teirlinck <teirllm@auburn.edu>
2 120
3 * custom.el (custom-theme-set-variables): Handle variable aliases. 121 * custom.el (custom-theme-set-variables): Handle variable aliases.
diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index 8f209d8c488..31dd39c201f 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -150,12 +150,18 @@ next editing session."
150 (auto-revert-set-timer)))) 150 (auto-revert-set-timer))))
151 151
152(defcustom auto-revert-stop-on-user-input t 152(defcustom auto-revert-stop-on-user-input t
153 "When non-nil Auto-Revert Mode stops checking files on user input." 153 "When non-nil, user input temporarily interrupts Auto-Revert Mode.
154With this setting, Auto-Revert Mode checks for user input after
155handling each buffer and does not process any further buffers
156\(until the next run of the timer) if user input is available.
157When nil, Auto-Revert Mode checks files and reverts buffers,
158with quitting disabled, without paying attention to user input.
159Thus, Emacs might be non-responsive at times."
154 :group 'auto-revert 160 :group 'auto-revert
155 :type 'boolean) 161 :type 'boolean)
156 162
157(defcustom auto-revert-verbose t 163(defcustom auto-revert-verbose t
158 "When nil, Auto-Revert Mode will not generate any messages. 164 "When nil, Auto-Revert Mode does not generate any messages.
159When non-nil, a message is generated whenever a file is reverted." 165When non-nil, a message is generated whenever a file is reverted."
160 :group 'auto-revert 166 :group 'auto-revert
161 :type 'boolean) 167 :type 'boolean)
diff --git a/lisp/calc/calc-alg.el b/lisp/calc/calc-alg.el
index 4901883d094..b722261907d 100644
--- a/lisp/calc/calc-alg.el
+++ b/lisp/calc/calc-alg.el
@@ -746,6 +746,55 @@
746 (list '* (list 'calcFunc-sin (list '* (1- n) a)) 746 (list '* (list 'calcFunc-sin (list '* (1- n) a))
747 (list 'calcFunc-sin a)))))))) 747 (list 'calcFunc-sin a))))))))
748 748
749(math-defsimplify calcFunc-sec
750 (or (and (math-looks-negp (nth 1 math-simplify-expr))
751 (list 'calcFunc-sec (math-neg (nth 1 math-simplify-expr))))
752 (and (eq calc-angle-mode 'rad)
753 (let ((n (math-linear-in (nth 1 math-simplify-expr) '(var pi var-pi))))
754 (and n
755 (math-div 1 (math-known-sin (car n) (nth 1 n) 120 300)))))
756 (and (eq calc-angle-mode 'deg)
757 (let ((n (math-integer-plus (nth 1 math-simplify-expr))))
758 (and n
759 (math-div 1 (math-known-sin (car n) (nth 1 n) '(frac 2 3) 300)))))
760 (and (eq (car-safe (nth 1 math-simplify-expr)) 'calcFunc-arcsin)
761 (math-div
762 1
763 (list 'calcFunc-sqrt
764 (math-sub 1 (math-sqr (nth 1 (nth 1 math-simplify-expr)))))))
765 (and (eq (car-safe (nth 1 math-simplify-expr)) 'calcFunc-arccos)
766 (math-div
767 1
768 (nth 1 (nth 1 math-simplify-expr))))
769 (and (eq (car-safe (nth 1 math-simplify-expr)) 'calcFunc-arctan)
770 (list 'calcFunc-sqrt
771 (math-add 1
772 (math-sqr (nth 1 (nth 1 math-simplify-expr))))))))
773
774(math-defsimplify calcFunc-csc
775 (or (and (math-looks-negp (nth 1 math-simplify-expr))
776 (math-neg (list 'calcFunc-csc (math-neg (nth 1 math-simplify-expr)))))
777 (and (eq calc-angle-mode 'rad)
778 (let ((n (math-linear-in (nth 1 math-simplify-expr) '(var pi var-pi))))
779 (and n
780 (math-div 1 (math-known-sin (car n) (nth 1 n) 120 0)))))
781 (and (eq calc-angle-mode 'deg)
782 (let ((n (math-integer-plus (nth 1 math-simplify-expr))))
783 (and n
784 (math-div 1 (math-known-sin (car n) (nth 1 n) '(frac 2 3) 0)))))
785 (and (eq (car-safe (nth 1 math-simplify-expr)) 'calcFunc-arcsin)
786 (math-div 1 (nth 1 (nth 1 math-simplify-expr))))
787 (and (eq (car-safe (nth 1 math-simplify-expr)) 'calcFunc-arccos)
788 (math-div
789 1
790 (list 'calcFunc-sqrt (math-sub 1 (math-sqr
791 (nth 1 (nth 1 math-simplify-expr)))))))
792 (and (eq (car-safe (nth 1 math-simplify-expr)) 'calcFunc-arctan)
793 (math-div (list 'calcFunc-sqrt
794 (math-add 1 (math-sqr
795 (nth 1 (nth 1 math-simplify-expr)))))
796 (nth 1 (nth 1 math-simplify-expr))))))
797
749(defun math-should-expand-trig (x &optional hyperbolic) 798(defun math-should-expand-trig (x &optional hyperbolic)
750 (let ((m (math-is-multiple x))) 799 (let ((m (math-is-multiple x)))
751 (and math-living-dangerously 800 (and math-living-dangerously
@@ -827,6 +876,28 @@
827 (math-div (list 'calcFunc-sin (nth 1 math-simplify-expr)) 876 (math-div (list 'calcFunc-sin (nth 1 math-simplify-expr))
828 (list 'calcFunc-cos (nth 1 math-simplify-expr)))))))) 877 (list 'calcFunc-cos (nth 1 math-simplify-expr))))))))
829 878
879(math-defsimplify calcFunc-cot
880 (or (and (math-looks-negp (nth 1 math-simplify-expr))
881 (math-neg (list 'calcFunc-cot (math-neg (nth 1 math-simplify-expr)))))
882 (and (eq calc-angle-mode 'rad)
883 (let ((n (math-linear-in (nth 1 math-simplify-expr) '(var pi var-pi))))
884 (and n
885 (math-div 1 (math-known-tan (car n) (nth 1 n) 120)))))
886 (and (eq calc-angle-mode 'deg)
887 (let ((n (math-integer-plus (nth 1 math-simplify-expr))))
888 (and n
889 (math-div 1 (math-known-tan (car n) (nth 1 n) '(frac 2 3))))))
890 (and (eq (car-safe (nth 1 math-simplify-expr)) 'calcFunc-arcsin)
891 (math-div (list 'calcFunc-sqrt
892 (math-sub 1 (math-sqr (nth 1 (nth 1 math-simplify-expr)))))
893 (nth 1 (nth 1 math-simplify-expr))))
894 (and (eq (car-safe (nth 1 math-simplify-expr)) 'calcFunc-arccos)
895 (math-div (nth 1 (nth 1 math-simplify-expr))
896 (list 'calcFunc-sqrt
897 (math-sub 1 (math-sqr (nth 1 (nth 1 math-simplify-expr)))))))
898 (and (eq (car-safe (nth 1 math-simplify-expr)) 'calcFunc-arctan)
899 (math-div 1 (nth 1 (nth 1 math-simplify-expr))))))
900
830(defun math-known-tan (plus n mul) 901(defun math-known-tan (plus n mul)
831 (setq n (math-mul n mul)) 902 (setq n (math-mul n mul))
832 (and (math-num-integerp n) 903 (and (math-num-integerp n)
@@ -930,6 +1001,58 @@
930 (math-div (list 'calcFunc-sinh (nth 1 math-simplify-expr)) 1001 (math-div (list 'calcFunc-sinh (nth 1 math-simplify-expr))
931 (list 'calcFunc-cosh (nth 1 math-simplify-expr)))))))) 1002 (list 'calcFunc-cosh (nth 1 math-simplify-expr))))))))
932 1003
1004(math-defsimplify calcFunc-sech
1005 (or (and (math-looks-negp (nth 1 math-simplify-expr))
1006 (list 'calcFunc-sech (math-neg (nth 1 math-simplify-expr))))
1007 (and (eq (car-safe (nth 1 math-simplify-expr)) 'calcFunc-arcsinh)
1008 math-living-dangerously
1009 (math-div
1010 1
1011 (list 'calcFunc-sqrt
1012 (math-add (math-sqr (nth 1 (nth 1 math-simplify-expr))) 1))))
1013 (and (eq (car-safe (nth 1 math-simplify-expr)) 'calcFunc-arccosh)
1014 math-living-dangerously
1015 (math-div 1 (nth 1 (nth 1 math-simplify-expr))) 1)
1016 (and (eq (car-safe (nth 1 math-simplify-expr)) 'calcFunc-arctanh)
1017 math-living-dangerously
1018 (list 'calcFunc-sqrt
1019 (math-sub 1 (math-sqr (nth 1 (nth 1 math-simplify-expr))))))))
1020
1021(math-defsimplify calcFunc-csch
1022 (or (and (math-looks-negp (nth 1 math-simplify-expr))
1023 (math-neg (list 'calcFunc-csch (math-neg (nth 1 math-simplify-expr)))))
1024 (and (eq (car-safe (nth 1 math-simplify-expr)) 'calcFunc-arcsinh)
1025 math-living-dangerously
1026 (math-div 1 (nth 1 (nth 1 math-simplify-expr))))
1027 (and (eq (car-safe (nth 1 math-simplify-expr)) 'calcFunc-arccosh)
1028 math-living-dangerously
1029 (math-div
1030 1
1031 (list 'calcFunc-sqrt
1032 (math-sub (math-sqr (nth 1 (nth 1 math-simplify-expr))) 1))))
1033 (and (eq (car-safe (nth 1 math-simplify-expr)) 'calcFunc-arctanh)
1034 math-living-dangerously
1035 (math-div (list 'calcFunc-sqrt
1036 (math-sub 1 (math-sqr (nth 1 (nth 1 math-simplify-expr)))))
1037 (nth 1 (nth 1 math-simplify-expr))))))
1038
1039(math-defsimplify calcFunc-coth
1040 (or (and (math-looks-negp (nth 1 math-simplify-expr))
1041 (math-neg (list 'calcFunc-coth (math-neg (nth 1 math-simplify-expr)))))
1042 (and (eq (car-safe (nth 1 math-simplify-expr)) 'calcFunc-arcsinh)
1043 math-living-dangerously
1044 (math-div (list 'calcFunc-sqrt
1045 (math-add (math-sqr (nth 1 (nth 1 math-simplify-expr))) 1))
1046 (nth 1 (nth 1 math-simplify-expr))))
1047 (and (eq (car-safe (nth 1 math-simplify-expr)) 'calcFunc-arccosh)
1048 math-living-dangerously
1049 (math-div (nth 1 (nth 1 math-simplify-expr))
1050 (list 'calcFunc-sqrt
1051 (math-sub (math-sqr (nth 1 (nth 1 math-simplify-expr))) 1))))
1052 (and (eq (car-safe (nth 1 math-simplify-expr)) 'calcFunc-arctanh)
1053 math-living-dangerously
1054 (math-div 1 (nth 1 (nth 1 math-simplify-expr))))))
1055
933(math-defsimplify calcFunc-arcsin 1056(math-defsimplify calcFunc-arcsin
934 (or (and (math-looks-negp (nth 1 math-simplify-expr)) 1057 (or (and (math-looks-negp (nth 1 math-simplify-expr))
935 (math-neg (list 'calcFunc-arcsin (math-neg (nth 1 math-simplify-expr))))) 1058 (math-neg (list 'calcFunc-arcsin (math-neg (nth 1 math-simplify-expr)))))
@@ -1043,8 +1166,13 @@
1043 (math-equal-int (nth 2 a) 2) 1166 (math-equal-int (nth 2 a) 2)
1044 (or (and (eq (car-safe (nth 1 a)) 'calcFunc-sinh) 1167 (or (and (eq (car-safe (nth 1 a)) 'calcFunc-sinh)
1045 (list 'calcFunc-cosh (nth 1 (nth 1 a)))) 1168 (list 'calcFunc-cosh (nth 1 (nth 1 a))))
1169 (and (eq (car-safe (nth 1 a)) 'calcFunc-csch)
1170 (list 'calcFunc-coth (nth 1 (nth 1 a))))
1046 (and (eq (car-safe (nth 1 a)) 'calcFunc-tan) 1171 (and (eq (car-safe (nth 1 a)) 'calcFunc-tan)
1047 (list '/ 1 (list 'calcFunc-cos 1172 (list '/ 1 (list 'calcFunc-cos
1173 (nth 1 (nth 1 a)))))
1174 (and (eq (car-safe (nth 1 a)) 'calcFunc-cot)
1175 (list '/ 1 (list 'calcFunc-sin
1048 (nth 1 (nth 1 a))))))))) 1176 (nth 1 (nth 1 a)))))))))
1049 (and (eq (car-safe (nth 1 math-simplify-expr)) '^) 1177 (and (eq (car-safe (nth 1 math-simplify-expr)) '^)
1050 (list '^ 1178 (list '^
diff --git a/lisp/calc/calc-arith.el b/lisp/calc/calc-arith.el
index 3a436cb1d36..38c10f5cc9f 100644
--- a/lisp/calc/calc-arith.el
+++ b/lisp/calc/calc-arith.el
@@ -70,9 +70,13 @@
70 calcFunc-max calcFunc-min)) 70 calcFunc-max calcFunc-min))
71 71
72(defvar math-real-if-arg-functions '(calcFunc-sin calcFunc-cos 72(defvar math-real-if-arg-functions '(calcFunc-sin calcFunc-cos
73 calcFunc-tan calcFunc-arctan 73 calcFunc-tan calcFunc-sec
74 calcFunc-csc calcFunc-cot
75 calcFunc-arctan
74 calcFunc-sinh calcFunc-cosh 76 calcFunc-sinh calcFunc-cosh
75 calcFunc-tanh calcFunc-exp 77 calcFunc-tanh calcFunc-sech
78 calcFunc-csch calcFunc-coth
79 calcFunc-exp
76 calcFunc-gamma calcFunc-fact)) 80 calcFunc-gamma calcFunc-fact))
77 81
78(defvar math-integer-functions '(calcFunc-idiv 82(defvar math-integer-functions '(calcFunc-idiv
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index 374e89ec1f1..d4d50d64658 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -801,13 +801,16 @@ math-mul-mat-vec math-mul-mats math-row-matrix)
801 801
802 ("calc-math" calcFunc-alog calcFunc-arccos 802 ("calc-math" calcFunc-alog calcFunc-arccos
803calcFunc-arccosh calcFunc-arcsin calcFunc-arcsincos calcFunc-arcsinh 803calcFunc-arccosh calcFunc-arcsin calcFunc-arcsincos calcFunc-arcsinh
804calcFunc-arctan calcFunc-arctan2 calcFunc-arctanh calcFunc-cos 804calcFunc-arctan calcFunc-arctan2 calcFunc-arctanh calcFunc-csc
805calcFunc-cosh calcFunc-deg calcFunc-exp calcFunc-exp10 calcFunc-expm1 805calcFunc-csch calcFunc-cos calcFunc-cosh calcFunc-cot calcFunc-coth
806calcFunc-deg calcFunc-exp calcFunc-exp10 calcFunc-expm1
806calcFunc-hypot calcFunc-ilog calcFunc-isqrt calcFunc-ln calcFunc-lnp1 807calcFunc-hypot calcFunc-ilog calcFunc-isqrt calcFunc-ln calcFunc-lnp1
807calcFunc-log calcFunc-log10 calcFunc-nroot calcFunc-rad calcFunc-sin 808calcFunc-log calcFunc-log10 calcFunc-nroot calcFunc-rad calcFunc-sec
809calcFunc-sech calcFunc-sin
808calcFunc-sincos calcFunc-sinh calcFunc-sqr calcFunc-sqrt calcFunc-tan 810calcFunc-sincos calcFunc-sinh calcFunc-sqr calcFunc-sqrt calcFunc-tan
809calcFunc-tanh math-arccos-raw math-arcsin-raw math-arctan-raw 811calcFunc-tanh math-arccos-raw math-arcsin-raw math-arctan-raw
810math-arctan2-raw math-cos-raw math-exp-minus-1-raw math-exp-raw 812math-arctan2-raw math-cos-raw math-cot-raw math-csc-raw
813math-exp-minus-1-raw math-exp-raw
811math-from-radians math-from-radians-2 math-hypot math-infinite-dir 814math-from-radians math-from-radians-2 math-hypot math-infinite-dir
812math-isqrt-small math-ln-raw math-nearly-equal math-nearly-equal-float 815math-isqrt-small math-ln-raw math-nearly-equal math-nearly-equal-float
813math-nearly-zerop math-nearly-zerop-float math-nth-root 816math-nearly-zerop math-nearly-zerop-float math-nth-root
@@ -1008,9 +1011,11 @@ calc-map-equation calc-map-stack calc-outer-product calc-reduce)
1008 1011
1009 ("calc-math" calc-arccos calc-arccosh calc-arcsin calc-arcsinh 1012 ("calc-math" calc-arccos calc-arccosh calc-arcsin calc-arcsinh
1010calc-arctan calc-arctan2 calc-arctanh calc-conj calc-cos calc-cosh 1013calc-arctan calc-arctan2 calc-arctanh calc-conj calc-cos calc-cosh
1014calc-cot calc-coth calc-csc calc-csch
1011calc-degrees-mode calc-exp calc-expm1 calc-hypot calc-ilog 1015calc-degrees-mode calc-exp calc-expm1 calc-hypot calc-ilog
1012calc-imaginary calc-isqrt calc-ln calc-lnp1 calc-log calc-log10 1016calc-imaginary calc-isqrt calc-ln calc-lnp1 calc-log calc-log10
1013calc-pi calc-radians-mode calc-sin calc-sincos calc-sinh calc-sqrt 1017calc-pi calc-radians-mode calc-sec calc-sech
1018calc-sin calc-sincos calc-sinh calc-sqrt
1014calc-tan calc-tanh calc-to-degrees calc-to-radians) 1019calc-tan calc-tanh calc-to-degrees calc-to-radians)
1015 1020
1016 ("calc-mode" calc-alg-simplify-mode calc-algebraic-mode 1021 ("calc-mode" calc-alg-simplify-mode calc-algebraic-mode
diff --git a/lisp/calc/calc-math.el b/lisp/calc/calc-math.el
index 02c65ac22ea..d2c66c34d49 100644
--- a/lisp/calc/calc-math.el
+++ b/lisp/calc/calc-math.el
@@ -144,6 +144,18 @@
144 (calc-hyperbolic-func) 144 (calc-hyperbolic-func)
145 (calc-sin arg)) 145 (calc-sin arg))
146 146
147(defun calc-sec (arg)
148 (interactive "P")
149 (calc-slow-wrapper
150 (if (calc-is-hyperbolic)
151 (calc-unary-op "sech" 'calcFunc-sech arg)
152 (calc-unary-op "sec" 'calcFunc-sec arg))))
153
154(defun calc-sech (arg)
155 (interactive "P")
156 (calc-hyperbolic-func)
157 (calc-sec arg))
158
147(defun calc-cos (arg) 159(defun calc-cos (arg)
148 (interactive "P") 160 (interactive "P")
149 (calc-slow-wrapper 161 (calc-slow-wrapper
@@ -171,6 +183,18 @@
171 (calc-hyperbolic-func) 183 (calc-hyperbolic-func)
172 (calc-cos arg)) 184 (calc-cos arg))
173 185
186(defun calc-csc (arg)
187 (interactive "P")
188 (calc-slow-wrapper
189 (if (calc-is-hyperbolic)
190 (calc-unary-op "csch" 'calcFunc-csch arg)
191 (calc-unary-op "csc" 'calcFunc-csc arg))))
192
193(defun calc-csch (arg)
194 (interactive "P")
195 (calc-hyperbolic-func)
196 (calc-csc arg))
197
174(defun calc-sincos () 198(defun calc-sincos ()
175 (interactive) 199 (interactive)
176 (calc-slow-wrapper 200 (calc-slow-wrapper
@@ -205,6 +229,29 @@
205 (calc-hyperbolic-func) 229 (calc-hyperbolic-func)
206 (calc-tan arg)) 230 (calc-tan arg))
207 231
232(defun calc-cot (arg)
233 (interactive "P")
234 (calc-slow-wrapper
235 (if (calc-is-hyperbolic)
236 (calc-unary-op "coth" 'calcFunc-coth arg)
237 (calc-unary-op "cot" 'calcFunc-cot arg))))
238
239(defun calc-arctan (arg)
240 (interactive "P")
241 (calc-invert-func)
242 (calc-tan arg))
243
244(defun calc-tanh (arg)
245 (interactive "P")
246 (calc-hyperbolic-func)
247 (calc-tan arg))
248
249(defun calc-arctanh (arg)
250 (interactive "P")
251 (calc-invert-func)
252 (calc-hyperbolic-func)
253 (calc-tan arg))
254
208(defun calc-arctan2 () 255(defun calc-arctan2 ()
209 (interactive) 256 (interactive)
210 (calc-slow-wrapper 257 (calc-slow-wrapper
@@ -220,8 +267,6 @@
220 (calc-slow-wrapper 267 (calc-slow-wrapper
221 (calc-pop-push-record 1 "i*" (math-imaginary (calc-top-n 1))))) 268 (calc-pop-push-record 1 "i*" (math-imaginary (calc-top-n 1)))))
222 269
223
224
225(defun calc-to-degrees (arg) 270(defun calc-to-degrees (arg)
226 (interactive "P") 271 (interactive "P")
227 (calc-wrapper 272 (calc-wrapper
@@ -794,6 +839,169 @@
794 (t (calc-record-why 'scalarp x) 839 (t (calc-record-why 'scalarp x)
795 (list 'calcFunc-tan x)))) 840 (list 'calcFunc-tan x))))
796 841
842(defun calcFunc-sec (x)
843 (cond ((and (integerp x)
844 (eq calc-angle-mode 'deg)
845 (= (% x 180) 0))
846 (if (= (% x 360) 0)
847 1
848 -1))
849 ((and (integerp x)
850 (eq calc-angle-mode 'rad)
851 (= x 0))
852 1)
853 ((Math-scalarp x)
854 (math-with-extra-prec 2
855 (math-sec-raw (math-to-radians (math-float x)))))
856 ((eq (car x) 'sdev)
857 (if (math-constp x)
858 (math-with-extra-prec 2
859 (let* ((xx (math-to-radians (math-float (nth 1 x))))
860 (xs (math-to-radians (math-float (nth 2 x))))
861 (sc (math-sin-cos-raw xx)))
862 (if (and (math-zerop (cdr sc))
863 (not calc-infinite-mode))
864 (progn
865 (calc-record-why "*Division by zero")
866 (list 'calcFunc-sec x))
867 (math-make-sdev (math-div-float '(float 1 0) (cdr sc))
868 (math-div-float
869 (math-mul xs (car sc))
870 (math-sqr (cdr sc)))))))
871 (math-make-sdev (calcFunc-sec (nth 1 x))
872 (math-div
873 (math-mul (nth 2 x)
874 (calcFunc-sin (nth 1 x)))
875 (math-sqr (calcFunc-cos (nth 1 x)))))))
876 ((and (eq (car x) 'intv)
877 (math-intv-constp x))
878 (math-with-extra-prec 2
879 (let* ((xx (math-to-radians (math-float x)))
880 (na (math-floor (math-div (math-sub (nth 2 xx)
881 (math-pi-over-2))
882 (math-pi))))
883 (nb (math-floor (math-div (math-sub (nth 3 xx)
884 (math-pi-over-2))
885 (math-pi))))
886 (naa (math-floor (math-div (nth 2 xx) (math-pi-over-2))))
887 (nbb (math-floor (math-div (nth 3 xx) (math-pi-over-2))))
888 (span (math-sub nbb naa)))
889 (if (not (equal na nb))
890 '(intv 3 (neg (var inf var-inf)) (var inf var-inf))
891 (let ((int (math-sort-intv (nth 1 x)
892 (math-sec-raw (nth 2 xx))
893 (math-sec-raw (nth 3 xx)))))
894 (if (eq span 1)
895 (if (math-evenp (math-div (math-add naa 1) 2))
896 (math-make-intv (logior (nth 1 int) 2)
897 1
898 (nth 3 int))
899 (math-make-intv (logior (nth 1 int) 1)
900 (nth 2 int)
901 -1))
902 int))))))
903 ((equal x '(var nan var-nan))
904 x)
905 (t (calc-record-why 'scalarp x)
906 (list 'calcFunc-sec x))))
907
908(defun calcFunc-csc (x)
909 (cond ((and (integerp x)
910 (eq calc-angle-mode 'deg)
911 (= (% (- x 90) 180) 0))
912 (if (= (% (- x 90) 360) 0)
913 1
914 -1))
915 ((Math-scalarp x)
916 (math-with-extra-prec 2
917 (math-csc-raw (math-to-radians (math-float x)))))
918 ((eq (car x) 'sdev)
919 (if (math-constp x)
920 (math-with-extra-prec 2
921 (let* ((xx (math-to-radians (math-float (nth 1 x))))
922 (xs (math-to-radians (math-float (nth 2 x))))
923 (sc (math-sin-cos-raw xx)))
924 (if (and (math-zerop (car sc))
925 (not calc-infinite-mode))
926 (progn
927 (calc-record-why "*Division by zero")
928 (list 'calcFunc-csc x))
929 (math-make-sdev (math-div-float '(float 1 0) (car sc))
930 (math-div-float
931 (math-mul xs (cdr sc))
932 (math-sqr (car sc)))))))
933 (math-make-sdev (calcFunc-csc (nth 1 x))
934 (math-div
935 (math-mul (nth 2 x)
936 (calcFunc-cos (nth 1 x)))
937 (math-sqr (calcFunc-sin (nth 1 x)))))))
938 ((and (eq (car x) 'intv)
939 (math-intv-constp x))
940 (math-with-extra-prec 2
941 (let* ((xx (math-to-radians (math-float x)))
942 (na (math-floor (math-div (nth 2 xx) (math-pi))))
943 (nb (math-floor (math-div (nth 3 xx) (math-pi))))
944 (naa (math-floor (math-div (nth 2 xx) (math-pi-over-2))))
945 (nbb (math-floor (math-div (nth 3 xx) (math-pi-over-2))))
946 (span (math-sub nbb naa)))
947 (if (not (equal na nb))
948 '(intv 3 (neg (var inf var-inf)) (var inf var-inf))
949 (let ((int (math-sort-intv (nth 1 x)
950 (math-csc-raw (nth 2 xx))
951 (math-csc-raw (nth 3 xx)))))
952 (if (eq span 1)
953 (if (math-evenp (math-div naa 2))
954 (math-make-intv (logior (nth 1 int) 2)
955 1
956 (nth 3 int))
957 (math-make-intv (logior (nth 1 int) 1)
958 (nth 2 int)
959 -1))
960 int))))))
961 ((equal x '(var nan var-nan))
962 x)
963 (t (calc-record-why 'scalarp x)
964 (list 'calcFunc-csc x))))
965
966(defun calcFunc-cot (x) ; [N N] [Public]
967 (cond ((and (integerp x)
968 (if (eq calc-angle-mode 'deg)
969 (= (% (- x 90) 180) 0)
970 (= x 0)))
971 0)
972 ((Math-scalarp x)
973 (math-with-extra-prec 2
974 (math-cot-raw (math-to-radians (math-float x)))))
975 ((eq (car x) 'sdev)
976 (if (math-constp x)
977 (math-with-extra-prec 2
978 (let* ((xx (math-to-radians (math-float (nth 1 x))))
979 (xs (math-to-radians (math-float (nth 2 x))))
980 (sc (math-sin-cos-raw xx)))
981 (if (and (math-zerop (car sc)) (not calc-infinite-mode))
982 (progn
983 (calc-record-why "*Division by zero")
984 (list 'calcFunc-cot x))
985 (math-make-sdev (math-div-float (cdr sc) (car sc))
986 (math-div-float xs (math-sqr (car sc)))))))
987 (math-make-sdev (calcFunc-cot (nth 1 x))
988 (math-div (nth 2 x)
989 (math-sqr (calcFunc-sin (nth 1 x)))))))
990 ((and (eq (car x) 'intv) (math-intv-constp x))
991 (or (math-with-extra-prec 2
992 (let* ((xx (math-to-radians (math-float x)))
993 (na (math-floor (math-div (nth 2 xx) (math-pi))))
994 (nb (math-floor (math-div (nth 3 xx) (math-pi))))
995 (and (equal na nb)
996 (math-sort-intv (nth 1 x)
997 (math-cot-raw (nth 2 xx))
998 (math-cot-raw (nth 3 xx)))))))
999 '(intv 3 (neg (var inf var-inf)) (var inf var-inf))))
1000 ((equal x '(var nan var-nan))
1001 x)
1002 (t (calc-record-why 'scalarp x)
1003 (list 'calcFunc-cot x))))
1004
797(defun math-sin-raw (x) ; [N N] 1005(defun math-sin-raw (x) ; [N N]
798 (cond ((eq (car x) 'cplx) 1006 (cond ((eq (car x) 'cplx)
799 (let* ((expx (math-exp-raw (nth 2 x))) 1007 (let* ((expx (math-exp-raw (nth 2 x)))
@@ -819,6 +1027,85 @@
819 (math-polar (math-cos-raw (math-complex x))) 1027 (math-polar (math-cos-raw (math-complex x)))
820 (math-sin-raw (math-sub (math-pi-over-2) x)))) 1028 (math-sin-raw (math-sub (math-pi-over-2) x))))
821 1029
1030(defun math-sec-raw (x) ; [N N]
1031 (cond ((eq (car x) 'cplx)
1032 (let* ((x (math-mul x '(float 1 0)))
1033 (expx (math-exp-raw (nth 2 x)))
1034 (expmx (math-div-float '(float 1 0) expx))
1035 (sh (math-mul-float (math-sub-float expx expmx) '(float 5 -1)))
1036 (ch (math-mul-float (math-add-float expx expmx) '(float 5 -1)))
1037 (sc (math-sin-cos-raw (nth 1 x)))
1038 (d (math-add-float
1039 (math-mul-float (math-sqr (car sc))
1040 (math-sqr sh))
1041 (math-mul-float (math-sqr (cdr sc))
1042 (math-sqr ch)))))
1043 (and (not (eq (nth 1 d) 0))
1044 (list 'cplx
1045 (math-div-float (math-mul-float (cdr sc) ch) d)
1046 (math-div-float (math-mul-float (car sc) sh) d)))))
1047 ((eq (car x) 'polar)
1048 (math-polar (math-sec-raw (math-complex x))))
1049 (t
1050 (let ((cs (math-cos-raw x)))
1051 (if (eq cs 0)
1052 (math-div 1 0)
1053 (math-div-float '(float 1 0) cs))))))
1054
1055(defun math-csc-raw (x) ; [N N]
1056 (cond ((eq (car x) 'cplx)
1057 (let* ((x (math-mul x '(float 1 0)))
1058 (expx (math-exp-raw (nth 2 x)))
1059 (expmx (math-div-float '(float 1 0) expx))
1060 (sh (math-mul-float (math-sub-float expx expmx) '(float 5 -1)))
1061 (ch (math-mul-float (math-add-float expx expmx) '(float 5 -1)))
1062 (sc (math-sin-cos-raw (nth 1 x)))
1063 (d (math-add-float
1064 (math-mul-float (math-sqr (car sc))
1065 (math-sqr ch))
1066 (math-mul-float (math-sqr (cdr sc))
1067 (math-sqr sh)))))
1068 (and (not (eq (nth 1 d) 0))
1069 (list 'cplx
1070 (math-div-float (math-mul-float (car sc) ch) d)
1071 (math-div-float (math-mul-float (cdr sc) sh) d)))))
1072 ((eq (car x) 'polar)
1073 (math-polar (math-csc-raw (math-complex x))))
1074 (t
1075 (let ((sn (math-sin-raw x)))
1076 (if (eq sn 0)
1077 (math-div 1 0)
1078 (math-div-float '(float 1 0) sn))))))
1079
1080(defun math-cot-raw (x) ; [N N]
1081 (cond ((eq (car x) 'cplx)
1082 (let* ((x (math-mul x '(float 1 0)))
1083 (expx (math-exp-raw (nth 2 x)))
1084 (expmx (math-div-float '(float 1 0) expx))
1085 (sh (math-mul-float (math-sub-float expx expmx) '(float 5 -1)))
1086 (ch (math-mul-float (math-add-float expx expmx) '(float 5 -1)))
1087 (sc (math-sin-cos-raw (nth 1 x)))
1088 (d (math-add-float
1089 (math-sqr (car sc))
1090 (math-sqr sh))))
1091 (and (not (eq (nth 1 d) 0))
1092 (list 'cplx
1093 (math-div-float
1094 (math-mul-float (car sc) (cdr sc))
1095 d)
1096 (math-neg
1097 (math-div-float
1098 (math-mul-float sh ch)
1099 d))))))
1100 ((eq (car x) 'polar)
1101 (math-polar (math-cot-raw (math-complex x))))
1102 (t
1103 (let ((sc (math-sin-cos-raw x)))
1104 (if (eq (nth 1 (car sc)) 0)
1105 (math-div (cdr sc) 0)
1106 (math-div-float (cdr sc) (car sc)))))))
1107
1108
822;;; This could use a smarter method: Reduce x as in math-sin-raw, then 1109;;; This could use a smarter method: Reduce x as in math-sin-raw, then
823;;; compute either sin(x) or cos(x), whichever is smaller, and compute 1110;;; compute either sin(x) or cos(x), whichever is smaller, and compute
824;;; the other using the identity sin(x)^2 + cos(x)^2 = 1. 1111;;; the other using the identity sin(x)^2 + cos(x)^2 = 1.
@@ -1537,6 +1824,104 @@
1537 (list 'calcFunc-tanh x)))) 1824 (list 'calcFunc-tanh x))))
1538(put 'calcFunc-tanh 'math-expandable t) 1825(put 'calcFunc-tanh 'math-expandable t)
1539 1826
1827(defun calcFunc-sech (x) ; [N N] [Public]
1828 (cond ((eq x 0) 1)
1829 (math-expand-formulas
1830 (math-normalize
1831 (list '/ 2 (list '+ (list 'calcFunc-exp x)
1832 (list 'calcFunc-exp (list 'neg x))))))
1833 ((Math-numberp x)
1834 (if calc-symbolic-mode (signal 'inexact-result nil))
1835 (math-with-extra-prec 2
1836 (let ((expx (math-exp-raw (math-float x))))
1837 (math-div '(float 2 0) (math-add expx (math-div 1 expx))))))
1838 ((eq (car-safe x) 'sdev)
1839 (math-make-sdev (calcFunc-sech (nth 1 x))
1840 (math-mul (nth 2 x)
1841 (math-mul (calcFunc-sech (nth 1 x))
1842 (calcFunc-tanh (nth 1 x))))))
1843 ((and (eq (car x) 'intv) (math-intv-constp x))
1844 (setq x (math-abs x))
1845 (math-sort-intv (nth 1 x)
1846 (calcFunc-sech (nth 2 x))
1847 (calcFunc-sech (nth 3 x))))
1848 ((or (equal x '(var inf var-inf))
1849 (equal x '(neg (var inf var-inf))))
1850 0)
1851 ((equal x '(var nan var-nan))
1852 x)
1853 (t (calc-record-why 'numberp x)
1854 (list 'calcFunc-sech x))))
1855(put 'calcFunc-sech 'math-expandable t)
1856
1857(defun calcFunc-csch (x) ; [N N] [Public]
1858 (cond ((eq x 0) (math-div 1 0))
1859 (math-expand-formulas
1860 (math-normalize
1861 (list '/ 2 (list '- (list 'calcFunc-exp x)
1862 (list 'calcFunc-exp (list 'neg x))))))
1863 ((Math-numberp x)
1864 (if calc-symbolic-mode (signal 'inexact-result nil))
1865 (math-with-extra-prec 2
1866 (let ((expx (math-exp-raw (math-float x))))
1867 (math-div '(float 2 0) (math-add expx (math-div -1 expx))))))
1868 ((eq (car-safe x) 'sdev)
1869 (math-make-sdev (calcFunc-csch (nth 1 x))
1870 (math-mul (nth 2 x)
1871 (math-mul (calcFunc-csch (nth 1 x))
1872 (calcFunc-coth (nth 1 x))))))
1873 ((eq (car x) 'intv)
1874 (if (and (Math-negp (nth 2 x))
1875 (Math-posp (nth 3 x)))
1876 '(intv 3 (neg (var inf var-inf)) (var inf var-inf))
1877 (math-sort-intv (nth 1 x)
1878 (calcFunc-csch (nth 2 x))
1879 (calcFunc-csch (nth 3 x)))))
1880 ((or (equal x '(var inf var-inf))
1881 (equal x '(neg (var inf var-inf))))
1882 0)
1883 ((equal x '(var nan var-nan))
1884 x)
1885 (t (calc-record-why 'numberp x)
1886 (list 'calcFunc-csch x))))
1887(put 'calcFunc-csch 'math-expandable t)
1888
1889(defun calcFunc-coth (x) ; [N N] [Public]
1890 (cond ((eq x 0) (math-div 1 0))
1891 (math-expand-formulas
1892 (math-normalize
1893 (let ((expx (list 'calcFunc-exp x))
1894 (expmx (list 'calcFunc-exp (list 'neg x))))
1895 (math-normalize
1896 (list '/ (list '+ expx expmx) (list '- expx expmx))))))
1897 ((Math-numberp x)
1898 (if calc-symbolic-mode (signal 'inexact-result nil))
1899 (math-with-extra-prec 2
1900 (let* ((expx (calcFunc-exp (math-float x)))
1901 (expmx (math-div 1 expx)))
1902 (math-div (math-add expx expmx)
1903 (math-sub expx expmx)))))
1904 ((eq (car-safe x) 'sdev)
1905 (math-make-sdev (calcFunc-coth (nth 1 x))
1906 (math-div (nth 2 x)
1907 (math-sqr (calcFunc-sinh (nth 1 x))))))
1908 ((eq (car x) 'intv)
1909 (if (and (Math-negp (nth 2 x))
1910 (Math-posp (nth 3 x)))
1911 '(intv 3 (neg (var inf var-inf)) (var inf var-inf))
1912 (math-sort-intv (nth 1 x)
1913 (calcFunc-coth (nth 2 x))
1914 (calcFunc-coth (nth 3 x)))))
1915 ((equal x '(var inf var-inf))
1916 1)
1917 ((equal x '(neg (var inf var-inf)))
1918 -1)
1919 ((equal x '(var nan var-nan))
1920 x)
1921 (t (calc-record-why 'numberp x)
1922 (list 'calcFunc-coth x))))
1923(put 'calcFunc-coth 'math-expandable t)
1924
1540(defun calcFunc-arcsinh (x) ; [N N] [Public] 1925(defun calcFunc-arcsinh (x) ; [N N] [Public]
1541 (cond ((eq x 0) 0) 1926 (cond ((eq x 0) 0)
1542 (math-expand-formulas 1927 (math-expand-formulas
diff --git a/lisp/calc/calc-rules.el b/lisp/calc/calc-rules.el
index 1ccbf3fffac..7a11cfa5012 100644
--- a/lisp/calc/calc-rules.el
+++ b/lisp/calc/calc-rules.el
@@ -153,10 +153,14 @@ tan(select(2 a)) := 2 tan(select(a)) / (1 - tan(a)^2),
153tan(select(n a)) := (tan((n-1) select(a)) + tan(a)) / 153tan(select(n a)) := (tan((n-1) select(a)) + tan(a)) /
154 (1 - tan((n-1) a) tan(a)) 154 (1 - tan((n-1) a) tan(a))
155 :: integer(n) :: n > 2, 155 :: integer(n) :: n > 2,
156cot(select(a + b)) := (cot(select(a)) cot(b) - 1) /
157 (cot(a) + cot(b)),
156sinh(select(a + b)) := sinh(select(a)) cosh(b) + cosh(a) sinh(b), 158sinh(select(a + b)) := sinh(select(a)) cosh(b) + cosh(a) sinh(b),
157cosh(select(a + b)) := cosh(select(a)) cosh(b) + sinh(a) sinh(b), 159cosh(select(a + b)) := cosh(select(a)) cosh(b) + sinh(a) sinh(b),
158tanh(select(a + b)) := (tanh(select(a)) + tanh(b)) / 160tanh(select(a + b)) := (tanh(select(a)) + tanh(b)) /
159 (1 + tanh(a) tanh(b)), 161 (1 + tanh(a) tanh(b)),
162coth(select(a + b)) := (coth(select(a)) coth(b) + 1) /
163 (coth(a) + coth(b)),
160x && select(a || b) := (x && select(a)) || (x && b), 164x && select(a || b) := (x && select(a)) || (x && b),
161select(a || b) && x := (select(a) && x) || (b && x), 165select(a || b) && x := (select(a) && x) || (b && x),
162! select(a && b) := (!a) || (!b), 166! select(a && b) := (!a) || (!b),
@@ -269,12 +273,18 @@ exp(select(x)) := 1 / exp(select(-x)),
269sin(select(x)) := -sin(select(-x)), 273sin(select(x)) := -sin(select(-x)),
270cos(select(x)) := cos(select(-x)), 274cos(select(x)) := cos(select(-x)),
271tan(select(x)) := -tan(select(-x)), 275tan(select(x)) := -tan(select(-x)),
276sec(select(x)) := sec(select(-x)),
277csc(select(x)) := -csc(select(-x)),
278cot(select(x)) := -cot(select(-x)),
272arcsin(select(x)) := -arcsin(select(-x)), 279arcsin(select(x)) := -arcsin(select(-x)),
273arccos(select(x)) := 4 arctan(1) - arccos(select(-x)), 280arccos(select(x)) := 4 arctan(1) - arccos(select(-x)),
274arctan(select(x)) := -arctan(select(-x)), 281arctan(select(x)) := -arctan(select(-x)),
275sinh(select(x)) := -sinh(select(-x)), 282sinh(select(x)) := -sinh(select(-x)),
276cosh(select(x)) := cosh(select(-x)), 283cosh(select(x)) := cosh(select(-x)),
277tanh(select(x)) := -tanh(select(-x)), 284tanh(select(x)) := -tanh(select(-x)),
285sech(select(x)) := sech(select(-x)),
286csch(select(x)) := -csch(select(-x)),
287coth(select(x)) := -coth(select(-x)),
278arcsinh(select(x)) := -arcsinh(select(-x)), 288arcsinh(select(x)) := -arcsinh(select(-x)),
279arctanh(select(x)) := -arctanh(select(-x)), 289arctanh(select(x)) := -arctanh(select(-x)),
280select(x) = a := select(-x) = -a, 290select(x) = a := select(-x) = -a,
diff --git a/lisp/calc/calc-undo.el b/lisp/calc/calc-undo.el
index a49c34010ab..d946a1390d3 100644
--- a/lisp/calc/calc-undo.el
+++ b/lisp/calc/calc-undo.el
@@ -77,7 +77,8 @@
77 (let ((v (intern (nth 1 action)))) 77 (let ((v (intern (nth 1 action))))
78 (calc-record-undo (list 'store (nth 1 action) 78 (calc-record-undo (list 'store (nth 1 action)
79 (and (boundp v) (symbol-value v)))) 79 (and (boundp v) (symbol-value v))))
80 (if (y-or-n-p (format "Un-store variable %s? " (nth 1 action))) 80 (if (y-or-n-p (format "Un-store variable %s? "
81 (calc-var-name (nth 1 action))))
81 (progn 82 (progn
82 (if (nth 2 action) 83 (if (nth 2 action)
83 (set v (nth 2 action)) 84 (set v (nth 2 action))
diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el
index e8a3abfe958..4b3c284ddad 100644
--- a/lisp/calc/calc-units.el
+++ b/lisp/calc/calc-units.el
@@ -1241,6 +1241,45 @@ Entries are (SYMBOL EXPR DOC-STRING TEMP-TYPE BASE-UNITS).")
1241 (eq (nth 1 (nth 2 rad)) 'rad) 1241 (eq (nth 1 (nth 2 rad)) 'rad)
1242 (list 'calcFunc-tan (nth 1 rad)))))) 1242 (list 'calcFunc-tan (nth 1 rad))))))
1243 1243
1244(math-defsimplify calcFunc-sec
1245 (and math-simplifying-units
1246 (math-units-in-expr-p (nth 1 math-simplify-expr) nil)
1247 (let ((rad (math-simplify-units
1248 (math-evaluate-expr
1249 (math-to-standard-units (nth 1 math-simplify-expr) nil))))
1250 (calc-angle-mode 'rad))
1251 (and (eq (car-safe rad) '*)
1252 (math-realp (nth 1 rad))
1253 (eq (car-safe (nth 2 rad)) 'var)
1254 (eq (nth 1 (nth 2 rad)) 'rad)
1255 (list 'calcFunc-sec (nth 1 rad))))))
1256
1257(math-defsimplify calcFunc-csc
1258 (and math-simplifying-units
1259 (math-units-in-expr-p (nth 1 math-simplify-expr) nil)
1260 (let ((rad (math-simplify-units
1261 (math-evaluate-expr
1262 (math-to-standard-units (nth 1 math-simplify-expr) nil))))
1263 (calc-angle-mode 'rad))
1264 (and (eq (car-safe rad) '*)
1265 (math-realp (nth 1 rad))
1266 (eq (car-safe (nth 2 rad)) 'var)
1267 (eq (nth 1 (nth 2 rad)) 'rad)
1268 (list 'calcFunc-csc (nth 1 rad))))))
1269
1270(math-defsimplify calcFunc-cot
1271 (and math-simplifying-units
1272 (math-units-in-expr-p (nth 1 math-simplify-expr) nil)
1273 (let ((rad (math-simplify-units
1274 (math-evaluate-expr
1275 (math-to-standard-units (nth 1 math-simplify-expr) nil))))
1276 (calc-angle-mode 'rad))
1277 (and (eq (car-safe rad) '*)
1278 (math-realp (nth 1 rad))
1279 (eq (car-safe (nth 2 rad)) 'var)
1280 (eq (nth 1 (nth 2 rad)) 'rad)
1281 (list 'calcFunc-cot (nth 1 rad))))))
1282
1244 1283
1245(defun math-remove-units (expr) 1284(defun math-remove-units (expr)
1246 (if (math-check-unit-name expr) 1285 (if (math-check-unit-name expr)
diff --git a/lisp/calc/calcalg2.el b/lisp/calc/calcalg2.el
index 18b6c1328d7..d5a9009c1ac 100644
--- a/lisp/calc/calcalg2.el
+++ b/lisp/calc/calcalg2.el
@@ -412,6 +412,30 @@
412 (math-normalize 412 (math-normalize
413 (list 'calcFunc-cos u)))))))) 413 (list 'calcFunc-cos u))))))))
414 414
415(put 'calcFunc-sec\' 'math-derivative-1
416 (function (lambda (u) (math-to-radians-2
417 (math-mul
418 (math-normalize
419 (list 'calcFunc-sec u))
420 (math-normalize
421 (list 'calcFunc-tan u)))))))
422
423(put 'calcFunc-csc\' 'math-derivative-1
424 (function (lambda (u) (math-neg
425 (math-to-radians-2
426 (math-mul
427 (math-normalize
428 (list 'calcFunc-csc u))
429 (math-normalize
430 (list 'calcFunc-cot u))))))))
431
432(put 'calcFunc-cot\' 'math-derivative-1
433 (function (lambda (u) (math-neg
434 (math-to-radians-2
435 (math-div 1 (math-sqr
436 (math-normalize
437 (list 'calcFunc-sin u)))))))))
438
415(put 'calcFunc-arcsin\' 'math-derivative-1 439(put 'calcFunc-arcsin\' 'math-derivative-1
416 (function (lambda (u) 440 (function (lambda (u)
417 (math-from-radians-2 441 (math-from-radians-2
@@ -441,6 +465,24 @@
441 (math-normalize 465 (math-normalize
442 (list 'calcFunc-cosh u))))))) 466 (list 'calcFunc-cosh u)))))))
443 467
468(put 'calcFunc-sech\' 'math-derivative-1
469 (function (lambda (u) (math-neg
470 (math-mul
471 (math-normalize (list 'calcFunc-sech u))
472 (math-normalize (list 'calcFunc-tanh u)))))))
473
474(put 'calcFunc-csch\' 'math-derivative-1
475 (function (lambda (u) (math-neg
476 (math-mul
477 (math-normalize (list 'calcFunc-csch u))
478 (math-normalize (list 'calcFunc-coth u)))))))
479
480(put 'calcFunc-tanh\' 'math-derivative-1
481 (function (lambda (u) (math-neg
482 (math-div 1 (math-sqr
483 (math-normalize
484 (list 'calcFunc-sinh u))))))))
485
444(put 'calcFunc-arcsinh\' 'math-derivative-1 486(put 'calcFunc-arcsinh\' 'math-derivative-1
445 (function (lambda (u) 487 (function (lambda (u)
446 (math-div 1 (math-normalize 488 (math-div 1 (math-normalize
@@ -1053,7 +1095,10 @@
1053 (while (and p 1095 (while (and p
1054 (memq (car (car p)) '(calcFunc-sin 1096 (memq (car (car p)) '(calcFunc-sin
1055 calcFunc-cos 1097 calcFunc-cos
1056 calcFunc-tan)) 1098 calcFunc-tan
1099 calcFunc-sec
1100 calcFunc-csc
1101 calcFunc-cot))
1057 (equal (nth 1 (car p)) math-integ-var)) 1102 (equal (nth 1 (car p)) math-integ-var))
1058 (setq p (cdr p))) 1103 (setq p (cdr p)))
1059 (null p)) 1104 (null p))
@@ -1068,6 +1113,9 @@
1068 (memq (car (car p)) '(calcFunc-sinh 1113 (memq (car (car p)) '(calcFunc-sinh
1069 calcFunc-cosh 1114 calcFunc-cosh
1070 calcFunc-tanh 1115 calcFunc-tanh
1116 calcFunc-sech
1117 calcFunc-csch
1118 calcFunc-coth
1071 calcFunc-exp)) 1119 calcFunc-exp))
1072 (equal (nth 1 (car p)) math-integ-var)) 1120 (equal (nth 1 (car p)) math-integ-var))
1073 (setq p (cdr p))) 1121 (setq p (cdr p)))
@@ -1619,6 +1667,27 @@
1619 (math-neg (math-from-radians-2 1667 (math-neg (math-from-radians-2
1620 (list 'calcFunc-ln (list 'calcFunc-cos u)))))) 1668 (list 'calcFunc-ln (list 'calcFunc-cos u))))))
1621 1669
1670(math-defintegral calcFunc-sec
1671 (and (equal u math-integ-var)
1672 (math-from-radians-2
1673 (list 'calcFunc-ln
1674 (math-add
1675 (list 'calcFunc-sec u)
1676 (list 'calcFunc-tan u))))))
1677
1678(math-defintegral calcFunc-csc
1679 (and (equal u math-integ-var)
1680 (math-from-radians-2
1681 (list 'calcFunc-ln
1682 (math-sub
1683 (list 'calcFunc-csc u)
1684 (list 'calcFunc-cot u))))))
1685
1686(math-defintegral calcFunc-cot
1687 (and (equal u math-integ-var)
1688 (math-from-radians-2
1689 (list 'calcFunc-ln (list 'calcFunc-sin u)))))
1690
1622(math-defintegral calcFunc-arcsin 1691(math-defintegral calcFunc-arcsin
1623 (and (equal u math-integ-var) 1692 (and (equal u math-integ-var)
1624 (math-add (math-mul u (list 'calcFunc-arcsin u)) 1693 (math-add (math-mul u (list 'calcFunc-arcsin u))
@@ -1650,6 +1719,18 @@
1650 (and (equal u math-integ-var) 1719 (and (equal u math-integ-var)
1651 (list 'calcFunc-ln (list 'calcFunc-cosh u)))) 1720 (list 'calcFunc-ln (list 'calcFunc-cosh u))))
1652 1721
1722(math-defintegral calcFunc-sech
1723 (and (equal u math-integ-var)
1724 (list 'calcFunc-arctan (list 'calcFunc-sinh u))))
1725
1726(math-defintegral calcFunc-csch
1727 (and (equal u math-integ-var)
1728 (list 'calcFunc-ln (list 'calcFunc-tanh (math-div u 2)))))
1729
1730(math-defintegral calcFunc-coth
1731 (and (equal u math-integ-var)
1732 (list 'calcFunc-ln (list 'calcFunc-sinh u))))
1733
1653(math-defintegral calcFunc-arcsinh 1734(math-defintegral calcFunc-arcsinh
1654 (and (equal u math-integ-var) 1735 (and (equal u math-integ-var)
1655 (math-sub (math-mul u (list 'calcFunc-arcsinh u)) 1736 (math-sub (math-mul u (list 'calcFunc-arcsinh u))
diff --git a/lisp/calc/calccomp.el b/lisp/calc/calccomp.el
index eff7df2373d..305e155843e 100644
--- a/lisp/calc/calccomp.el
+++ b/lisp/calc/calccomp.el
@@ -35,7 +35,9 @@
35 '( calcFunc-log 35 '( calcFunc-log
36 calcFunc-ln calcFunc-exp 36 calcFunc-ln calcFunc-exp
37 calcFunc-sin calcFunc-cos calcFunc-tan 37 calcFunc-sin calcFunc-cos calcFunc-tan
38 calcFunc-sec calcFunc-csc calcFunc-cot
38 calcFunc-sinh calcFunc-cosh calcFunc-tanh 39 calcFunc-sinh calcFunc-cosh calcFunc-tanh
40 calcFunc-sech calcFunc-csch calcFunc-coth
39 calcFunc-arcsin calcFunc-arccos calcFunc-arctan 41 calcFunc-arcsin calcFunc-arccos calcFunc-arctan
40 calcFunc-arcsinh calcFunc-arccosh calcFunc-arctanh)) 42 calcFunc-arcsinh calcFunc-arccosh calcFunc-arctanh))
41 43
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 9ac11a85803..71fe7e18fe4 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -1397,7 +1397,7 @@ Make your editing in this buffer take effect for this session."
1397 :tag "Save for Future Sessions" 1397 :tag "Save for Future Sessions"
1398 :help-echo "\ 1398 :help-echo "\
1399Make your editing in this buffer take effect for future Emacs sessions. 1399Make your editing in this buffer take effect for future Emacs sessions.
1400This updates your Emacs initialization file or creates a new one one." 1400This updates your Emacs initialization file or creates a new one."
1401 :action (lambda (widget &optional event) 1401 :action (lambda (widget &optional event)
1402 (Custom-save))) 1402 (Custom-save)))
1403 (if custom-reset-button-menu 1403 (if custom-reset-button-menu
@@ -1671,15 +1671,15 @@ group now hidden, invoke \"Show\", above, to show contents.")
1671the value displayed for this %c is invalid and cannot be set.") 1671the value displayed for this %c is invalid and cannot be set.")
1672 (modified "*" custom-modified-face "\ 1672 (modified "*" custom-modified-face "\
1673you have edited the value as text, but you have not set the %c." "\ 1673you have edited the value as text, but you have not set the %c." "\
1674you have edited something in this group, but not set it.") 1674you have edited something in this group, but not set anything yet.")
1675 (set "+" custom-set-face "\ 1675 (set "+" custom-set-face "\
1676you have set this %c, but not saved it for future sessions." "\ 1676you have set this %c, but not saved it for future sessions." "\
1677something in this group has been set, but not saved.") 1677you have set something in this group, but not saved anything yet.")
1678 (changed ":" custom-changed-face "\ 1678 (changed ":" custom-changed-face "\
1679this %c has been changed outside the customize buffer." "\ 1679this %c has been changed outside the customize buffer." "\
1680something in this group has been changed outside customize.") 1680something in this group has been changed outside customize.")
1681 (saved "!" custom-saved-face "\ 1681 (saved "!" custom-saved-face "\
1682this %c has been set and saved." "\ 1682You have set this %c and saved it through Customize in your init file." "\
1683something in this group has been set and saved.") 1683something in this group has been set and saved.")
1684 (rogue "@" custom-rogue-face "\ 1684 (rogue "@" custom-rogue-face "\
1685this %c has not been changed with customize." "\ 1685this %c has not been changed with customize." "\
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index 9dcea001ae5..11ca245ffaf 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -1,6 +1,6 @@
1;;; cus-start.el --- define customization properties of builtins 1;;; cus-start.el --- define customization properties of builtins
2;; 2;;
3;; Copyright (C) 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. 3;; Copyright (C) 1997, 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
4;; 4;;
5;; Author: Per Abrahamsen <abraham@dina.kvl.dk> 5;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
6;; Keywords: internal 6;; Keywords: internal
@@ -39,6 +39,8 @@
39 (pre-abbrev-expand-hook abbrev-mode hook) 39 (pre-abbrev-expand-hook abbrev-mode hook)
40 ;; alloc.c 40 ;; alloc.c
41 (gc-cons-threshold alloc integer) 41 (gc-cons-threshold alloc integer)
42 (garbage-collection-messages alloc boolean)
43 ;; undo.c
42 (undo-limit undo integer) 44 (undo-limit undo integer)
43 (undo-strong-limit undo integer) 45 (undo-strong-limit undo integer)
44 (undo-outer-limit undo 46 (undo-outer-limit undo
@@ -52,7 +54,6 @@ This should only be chosen under exceptional circumstances,
52since it could result in memory overflow and make Emacs crash." 54since it could result in memory overflow and make Emacs crash."
53 nil)) 55 nil))
54 "22.1") 56 "22.1")
55 (garbage-collection-messages alloc boolean)
56 ;; buffer.c 57 ;; buffer.c
57 (mode-line-format modeline sexp) ;Hard to do right. 58 (mode-line-format modeline sexp) ;Hard to do right.
58 (default-major-mode internal function) 59 (default-major-mode internal function)
@@ -291,7 +292,7 @@ since it could result in memory overflow and make Emacs crash."
291 (mouse-autoselect-window display boolean "21.3") 292 (mouse-autoselect-window display boolean "21.3")
292 (x-use-underline-position-properties display boolean "21.3") 293 (x-use-underline-position-properties display boolean "21.3")
293 (x-stretch-cursor display boolean "21.1"))) 294 (x-stretch-cursor display boolean "21.1")))
294 this symbol group type native-p version 295 this symbol group type standard version native-p
295 ;; This function turns a value 296 ;; This function turns a value
296 ;; into an expression which produces that value. 297 ;; into an expression which produces that value.
297 (quoter (lambda (sexp) 298 (quoter (lambda (sexp)
@@ -300,8 +301,6 @@ since it could result in memory overflow and make Emacs crash."
300 (and (listp sexp) 301 (and (listp sexp)
301 (memq (car sexp) '(lambda))) 302 (memq (car sexp) '(lambda)))
302 (stringp sexp) 303 (stringp sexp)
303;; (and (fboundp 'characterp)
304;; (characterp sexp))
305 (numberp sexp)) 304 (numberp sexp))
306 sexp 305 sexp
307 (list 'quote sexp))))) 306 (list 'quote sexp)))))
@@ -312,6 +311,12 @@ since it could result in memory overflow and make Emacs crash."
312 group (nth 1 this) 311 group (nth 1 this)
313 type (nth 2 this) 312 type (nth 2 this)
314 version (nth 3 this) 313 version (nth 3 this)
314 ;; If we did not specify any standard value expression above,
315 ;; use the current value as the standard value.
316 standard (if (nthcdr 4 this)
317 (nth 4 this)
318 (when (default-boundp symbol)
319 (funcall quoter (default-value symbol))))
315 ;; Don't complain about missing variables which are 320 ;; Don't complain about missing variables which are
316 ;; irrelevant to this platform. 321 ;; irrelevant to this platform.
317 native-p (save-match-data 322 native-p (save-match-data
@@ -329,8 +334,7 @@ since it could result in memory overflow and make Emacs crash."
329 (message "Note, built-in variable `%S' not bound" symbol)) 334 (message "Note, built-in variable `%S' not bound" symbol))
330 ;; Save the standard value, unless we already did. 335 ;; Save the standard value, unless we already did.
331 (or (get symbol 'standard-value) 336 (or (get symbol 'standard-value)
332 (put symbol 'standard-value 337 (put symbol 'standard-value (list standard)))
333 (list (funcall quoter (default-value symbol)))))
334 ;; If this is NOT while dumping Emacs, 338 ;; If this is NOT while dumping Emacs,
335 ;; set up the rest of the customization info. 339 ;; set up the rest of the customization info.
336 (unless purify-flag 340 (unless purify-flag
diff --git a/lisp/dired.el b/lisp/dired.el
index f64c2472067..f9eb97f549e 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2128,6 +2128,7 @@ instead of `dired-actual-switches'."
2128 (save-excursion 2128 (save-excursion
2129 (let* ((count 0) 2129 (let* ((count 0)
2130 (buffer-read-only nil) 2130 (buffer-read-only nil)
2131 (buffer-undo-list t)
2131 (switches (or switches dired-actual-switches)) 2132 (switches (or switches dired-actual-switches))
2132 new-dir-name 2133 new-dir-name
2133 (R-ftp-base-dir-regex 2134 (R-ftp-base-dir-regex
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 6b5c0b1c0f1..1a7da113c12 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -182,7 +182,7 @@
182 (make-local-variable 'parse-sexp-ignore-comments) 182 (make-local-variable 'parse-sexp-ignore-comments)
183 (setq parse-sexp-ignore-comments t) 183 (setq parse-sexp-ignore-comments t)
184 (make-local-variable 'outline-regexp) 184 (make-local-variable 'outline-regexp)
185 (setq outline-regexp ";;;;* [^ \t\n]\\|(") 185 (setq outline-regexp ";;;\\(;* [^ \t\n]\\|###autoload\\)\\|(")
186 (make-local-variable 'outline-level) 186 (make-local-variable 'outline-level)
187 (setq outline-level 'lisp-outline-level) 187 (setq outline-level 'lisp-outline-level)
188 (make-local-variable 'comment-start) 188 (make-local-variable 'comment-start)
@@ -212,11 +212,10 @@
212 212
213(defun lisp-outline-level () 213(defun lisp-outline-level ()
214 "Lisp mode `outline-level' function." 214 "Lisp mode `outline-level' function."
215 (if (looking-at "(\\|;;;###autoload") 215 (let ((len (- (match-end 0) (match-beginning 0))))
216 1000 216 (if (looking-at "(\\|;;;###autoload")
217 (looking-at outline-regexp) 217 1000
218 (- (match-end 0) (match-beginning 0)))) 218 len)))
219
220 219
221(defvar lisp-mode-shared-map 220(defvar lisp-mode-shared-map
222 (let ((map (make-sparse-keymap))) 221 (let ((map (make-sparse-keymap)))
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 7a4b1e68e58..bc8b89a2519 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,20 @@
12005-02-13 Reiner Steib <Reiner.Steib@gmx.de>
2
3 * gnus.el (gnus-group-startup-message): Search for gnus images in
4 etc/images/gnus.
5 * mm-util.el (mm-find-charset-region): Likewise.
6 * smiley.el (smiley-data-directory): Search for smilies in
7 etc/images/smilies.
8
92005-02-09 Kim F. Storm <storm@cua.dk>
10
11 Change Emacs release version from 21.4 to 22.1 throughout.
12 Change Emacs development version from 21.3.50 to 22.0.50.
13
142005-02-08 Simon Josefsson <jas@extundo.com>
15
16 * imap.el (imap-log): Doc fix.
17
12005-02-03 Katsumi Yamaoka <yamaoka@jpl.org> 182005-02-03 Katsumi Yamaoka <yamaoka@jpl.org>
2 19
3 * gnus-art.el (gnus-mime-inline-part): Show the raw contents if a 20 * gnus-art.el (gnus-mime-inline-part): Show the raw contents if a
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index 674c8d2c0ad..f5dcd296d2b 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -326,7 +326,8 @@ be set in `.emacs' instead."
326 (defvar gnus-mode-line-image-cache t) 326 (defvar gnus-mode-line-image-cache t)
327 (if (fboundp 'find-image) 327 (if (fboundp 'find-image)
328 (defun gnus-mode-line-buffer-identification (line) 328 (defun gnus-mode-line-buffer-identification (line)
329 (let ((str (car-safe line))) 329 (let ((str (car-safe line))
330 (load-path (mm-image-load-path)))
330 (if (and (stringp str) 331 (if (and (stringp str)
331 (string-match "^Gnus:" str)) 332 (string-match "^Gnus:" str))
332 (progn (add-text-properties 333 (progn (add-text-properties
@@ -875,7 +876,7 @@ be set in `.emacs' instead."
875 ((and 876 ((and
876 (fboundp 'find-image) 877 (fboundp 'find-image)
877 (display-graphic-p) 878 (display-graphic-p)
878 (let* ((data-directory (nnheader-find-etc-directory "gnus")) 879 (let* ((data-directory (nnheader-find-etc-directory "images/gnus"))
879 (image (find-image 880 (image (find-image
880 `((:type xpm :file "gnus.xpm" 881 `((:type xpm :file "gnus.xpm"
881 :color-symbols 882 :color-symbols
diff --git a/lisp/gnus/imap.el b/lisp/gnus/imap.el
index 18a7cdd090d..aba0e88b92f 100644
--- a/lisp/gnus/imap.el
+++ b/lisp/gnus/imap.el
@@ -241,7 +241,11 @@ encoded mailboxes which doesn't translate into ISO-8859-1."
241 :type 'boolean) 241 :type 'boolean)
242 242
243(defcustom imap-log nil 243(defcustom imap-log nil
244 "If non-nil, a imap session trace is placed in *imap-log* buffer." 244 "If non-nil, a imap session trace is placed in *imap-log* buffer.
245Note that username, passwords and other privacy sensitive
246information (such as e-mail) may be stored in the *imap-log*
247buffer. It is not written to disk, however. Do not enable this
248variable unless you are comfortable with that."
245 :group 'imap 249 :group 'imap
246 :type 'boolean) 250 :type 'boolean)
247 251
diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el
index 3cccf0f4049..e874f23e6e6 100644
--- a/lisp/gnus/mm-util.el
+++ b/lisp/gnus/mm-util.el
@@ -843,7 +843,7 @@ If INHIBIT is non-nil, inhibit `mm-inhibit-file-name-handlers'."
843 (file-directory-p 843 (file-directory-p
844 (setq dir (concat (file-name-directory 844 (setq dir (concat (file-name-directory
845 (directory-file-name path)) 845 (directory-file-name path))
846 "etc/" (or package "gnus/"))))) 846 "etc/images/" (or package "gnus/")))))
847 (push dir result)) 847 (push dir result))
848 (push path result)))) 848 (push path result))))
849 849
diff --git a/lisp/gnus/smiley.el b/lisp/gnus/smiley.el
index 74a4d9cf596..27a54829aaf 100644
--- a/lisp/gnus/smiley.el
+++ b/lisp/gnus/smiley.el
@@ -44,7 +44,7 @@
44 :group 'gnus-visual) 44 :group 'gnus-visual)
45 45
46;; Maybe this should go. 46;; Maybe this should go.
47(defcustom smiley-data-directory (nnheader-find-etc-directory "smilies") 47(defcustom smiley-data-directory (nnheader-find-etc-directory "images/smilies")
48 "*Location of the smiley faces files." 48 "*Location of the smiley faces files."
49 :type 'directory 49 :type 'directory
50 :group 'smiley) 50 :group 'smiley)
diff --git a/lisp/ido.el b/lisp/ido.el
index 389ddb0b9a1..86a88d0d491 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -2280,6 +2280,9 @@ If no buffer or file exactly matching the prompt exists, maybe create a new one.
2280(defun ido-fallback-command () 2280(defun ido-fallback-command ()
2281 "Fallback to non-ido version of current command." 2281 "Fallback to non-ido version of current command."
2282 (interactive) 2282 (interactive)
2283 (let ((i (length ido-text)))
2284 (while (> i 0)
2285 (push (aref ido-text (setq i (1- i))) unread-command-events)))
2283 (setq ido-exit 'fallback) 2286 (setq ido-exit 'fallback)
2284 (exit-minibuffer)) 2287 (exit-minibuffer))
2285 2288
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 74bcfdefc2b..9d3cd06851d 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -2404,13 +2404,13 @@ See also `locale-charset-language-names', `locale-language-names',
2404 (message "Warning: Default coding system `%s' disagrees with 2404 (message "Warning: Default coding system `%s' disagrees with
2405system codeset `%s' for this locale." coding-system codeset)))))))) 2405system codeset `%s' for this locale." coding-system codeset))))))))
2406 2406
2407 ;; On Windows, override locale-coding-system, keyboard-coding-system, 2407 ;; On Windows, override locale-coding-system,
2408 ;; selection-coding-system with system codepage. 2408 ;; keyboard-coding-system with system codepage. Note:
2409 ;; selection-coding-system is already set in w32select.c.
2409 (when (boundp 'w32-ansi-code-page) 2410 (when (boundp 'w32-ansi-code-page)
2410 (let ((code-page-coding (intern (format "cp%d" w32-ansi-code-page)))) 2411 (let ((code-page-coding (intern (format "cp%d" w32-ansi-code-page))))
2411 (when (coding-system-p code-page-coding) 2412 (when (coding-system-p code-page-coding)
2412 (setq locale-coding-system code-page-coding) 2413 (setq locale-coding-system code-page-coding)
2413 (set-selection-coding-system code-page-coding)
2414 (set-keyboard-coding-system code-page-coding) 2414 (set-keyboard-coding-system code-page-coding)
2415 (set-terminal-coding-system code-page-coding)))) 2415 (set-terminal-coding-system code-page-coding))))
2416 2416
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 7702707c6ac..f1cb55e7fcc 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -736,7 +736,8 @@ is treated as a regexp. See \\[isearch-forward] for more info."
736 (setq ;; quit-flag nil not for isearch-mode 736 (setq ;; quit-flag nil not for isearch-mode
737 isearch-adjusted nil 737 isearch-adjusted nil
738 isearch-yank-flag nil) 738 isearch-yank-flag nil)
739 (if isearch-lazy-highlight (isearch-lazy-highlight-new-loop)) 739 (when isearch-lazy-highlight
740 (isearch-lazy-highlight-new-loop nil nil))
740 ;; We must prevent the point moving to the end of composition when a 741 ;; We must prevent the point moving to the end of composition when a
741 ;; part of the composition has just been searched. 742 ;; part of the composition has just been searched.
742 (setq disable-point-adjustment t)) 743 (setq disable-point-adjustment t))
@@ -2310,6 +2311,8 @@ since they have special meaning in a regexp."
2310 2311
2311(defvar isearch-lazy-highlight-overlays nil) 2312(defvar isearch-lazy-highlight-overlays nil)
2312(defvar isearch-lazy-highlight-wrapped nil) 2313(defvar isearch-lazy-highlight-wrapped nil)
2314(defvar isearch-lazy-highlight-start-limit nil)
2315(defvar isearch-lazy-highlight-end-limit nil)
2313(defvar isearch-lazy-highlight-start nil) 2316(defvar isearch-lazy-highlight-start nil)
2314(defvar isearch-lazy-highlight-end nil) 2317(defvar isearch-lazy-highlight-end nil)
2315(defvar isearch-lazy-highlight-timer nil) 2318(defvar isearch-lazy-highlight-timer nil)
@@ -2335,10 +2338,12 @@ is nil. This function is called when exiting an incremental search if
2335 (cancel-timer isearch-lazy-highlight-timer) 2338 (cancel-timer isearch-lazy-highlight-timer)
2336 (setq isearch-lazy-highlight-timer nil))) 2339 (setq isearch-lazy-highlight-timer nil)))
2337 2340
2338(defun isearch-lazy-highlight-new-loop () 2341(defun isearch-lazy-highlight-new-loop (beg end)
2339 "Cleanup any previous `lazy-highlight' loop and begin a new one. 2342 "Cleanup any previous `lazy-highlight' loop and begin a new one.
2340This happens when `isearch-update' is invoked (which can cause the 2343BEG and END specify the bounds within which highlighting should occur.
2341search string to change or the window to scroll)." 2344This is called when `isearch-update' is invoked (which can cause the
2345search string to change or the window to scroll). It is also used
2346by other Emacs features."
2342 (when (and (null executing-kbd-macro) 2347 (when (and (null executing-kbd-macro)
2343 (sit-for 0) ;make sure (window-start) is credible 2348 (sit-for 0) ;make sure (window-start) is credible
2344 (or (not (equal isearch-string 2349 (or (not (equal isearch-string
@@ -2356,6 +2361,8 @@ search string to change or the window to scroll)."
2356 ;; something important did indeed change 2361 ;; something important did indeed change
2357 (isearch-lazy-highlight-cleanup t) ;kill old loop & remove overlays 2362 (isearch-lazy-highlight-cleanup t) ;kill old loop & remove overlays
2358 (when (not isearch-invalid-regexp) 2363 (when (not isearch-invalid-regexp)
2364 (setq isearch-lazy-highlight-start-limit beg
2365 isearch-lazy-highlight-end-limit end)
2359 (setq isearch-lazy-highlight-window (selected-window) 2366 (setq isearch-lazy-highlight-window (selected-window)
2360 isearch-lazy-highlight-window-start (window-start) 2367 isearch-lazy-highlight-window-start (window-start)
2361 isearch-lazy-highlight-window-end (window-end) 2368 isearch-lazy-highlight-window-end (window-end)
@@ -2378,12 +2385,14 @@ Attempt to do the search exactly the way the pending isearch would."
2378 (funcall (isearch-search-fun) 2385 (funcall (isearch-search-fun)
2379 isearch-string 2386 isearch-string
2380 (if isearch-forward 2387 (if isearch-forward
2381 (if isearch-lazy-highlight-wrapped 2388 (min (or isearch-lazy-highlight-end-limit (point-max))
2382 isearch-lazy-highlight-start 2389 (if isearch-lazy-highlight-wrapped
2383 (window-end)) 2390 isearch-lazy-highlight-start
2384 (if isearch-lazy-highlight-wrapped 2391 (window-end)))
2385 isearch-lazy-highlight-end 2392 (max (or isearch-lazy-highlight-start-limit (point-min))
2386 (window-start))) 2393 (if isearch-lazy-highlight-wrapped
2394 isearch-lazy-highlight-end
2395 (window-start))))
2387 t))) 2396 t)))
2388 2397
2389(defun isearch-lazy-highlight-update () 2398(defun isearch-lazy-highlight-update ()
@@ -2442,9 +2451,11 @@ Attempt to do the search exactly the way the pending isearch would."
2442 (if isearch-forward 2451 (if isearch-forward
2443 (progn 2452 (progn
2444 (setq isearch-lazy-highlight-end (window-start)) 2453 (setq isearch-lazy-highlight-end (window-start))
2445 (goto-char (window-start))) 2454 (goto-char (max (or isearch-lazy-highlight-start-limit (point-min))
2455 (window-start))))
2446 (setq isearch-lazy-highlight-start (window-end)) 2456 (setq isearch-lazy-highlight-start (window-end))
2447 (goto-char (window-end))))))) 2457 (goto-char (min (or isearch-lazy-highlight-end-limit (point-max))
2458 (window-end))))))))
2448 (unless nomore 2459 (unless nomore
2449 (setq isearch-lazy-highlight-timer 2460 (setq isearch-lazy-highlight-timer
2450 (run-at-time lazy-highlight-interval nil 2461 (run-at-time lazy-highlight-interval nil
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 3fbc728f487..1c95e54dc5c 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -1515,9 +1515,11 @@ Buffers menu is regenerated."
1515 (dolist (f (frame-list)) 1515 (dolist (f (frame-list))
1516 (when (equal last-command-event (frame-parameter f 'name)) 1516 (when (equal last-command-event (frame-parameter f 'name))
1517 (setq frame f))) 1517 (setq frame f)))
1518 (make-frame-visible frame) 1518 ;; FRAME can be nil when user specifies the selected frame.
1519 (raise-frame frame) 1519 (setq frame (or frame (selected-frame)))
1520 (select-frame frame))) 1520 (make-frame-visible frame)
1521 (raise-frame frame)
1522 (select-frame frame)))
1521 1523
1522(defun menu-bar-update-buffers-1 (elt) 1524(defun menu-bar-update-buffers-1 (elt)
1523 (let* ((buf (car elt)) 1525 (let* ((buf (car elt))
diff --git a/lisp/novice.el b/lisp/novice.el
index e9db95bd619..de92857980b 100644
--- a/lisp/novice.el
+++ b/lisp/novice.el
@@ -41,10 +41,9 @@
41 "Function to call to handle disabled commands. 41 "Function to call to handle disabled commands.
42If nil, the feature is disabled, i.e., all commands work normally.") 42If nil, the feature is disabled, i.e., all commands work normally.")
43 43
44;;;###autoload
44(defvaralias 'disabled-command-hook 'disabled-command-function) 45(defvaralias 'disabled-command-hook 'disabled-command-function)
45(make-obsolete-variable 46;;;###autoload (make-obsolete-variable 'disabled-command-hook 'disabled-command-function "22.1")
46 'disabled-command-hook
47 'disabled-command-function "22.1")
48 47
49;;;###autoload 48;;;###autoload
50(defun disabled-command-function (&rest ignore) 49(defun disabled-command-function (&rest ignore)
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index 97511376086..4eeb8fa1886 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -79,6 +79,8 @@
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 "List of directories for source files.")
83(defvar gdb-find-file-unhook nil)
82 84
83(defvar gdb-buffer-type nil 85(defvar gdb-buffer-type nil
84 "One of the symbols bound in `gdb-buffer-rules'.") 86 "One of the symbols bound in `gdb-buffer-rules'.")
@@ -191,6 +193,36 @@ detailed description of this mode.
191 :group 'gud 193 :group 'gud
192 :version "22.1") 194 :version "22.1")
193 195
196(defun gdb-set-gud-minor-mode (buffer)
197 "Set gud-minor-mode from find-file if appropriate."
198 (goto-char (point-min))
199 (unless (search-forward "No source file named " nil t)
200 (condition-case nil
201 (gdb-enqueue-input
202 (list (concat gdb-server-prefix "info source\n")
203 `(lambda () (gdb-set-gud-minor-mode-1 ,buffer))))
204 (error (setq gdb-find-file-unhook t)))))
205
206(defun gdb-set-gud-minor-mode-1 (buffer)
207 (goto-char (point-min))
208 (if (and (search-forward "Located in " nil t)
209 (looking-at "\\S-*")
210 (string-equal (buffer-file-name buffer)
211 (match-string 0)))
212 (with-current-buffer buffer
213 (set (make-local-variable 'gud-minor-mode) 'gdba)
214 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map))))
215
216(defun gdb-set-gud-minor-mode-existing-buffers ()
217 (dolist (buffer (buffer-list))
218 (let ((file (buffer-file-name buffer)))
219 (if file
220 (progn
221 (gdb-enqueue-input
222 (list (concat gdb-server-prefix "list "
223 (file-name-nondirectory file) ":1\n")
224 `(lambda () (gdb-set-gud-minor-mode ,buffer)))))))))
225
194(defun gdb-ann3 () 226(defun gdb-ann3 ()
195 (setq gdb-debug-log nil) 227 (setq gdb-debug-log nil)
196 (set (make-local-variable 'gud-minor-mode) 'gdba) 228 (set (make-local-variable 'gud-minor-mode) 'gdba)
@@ -249,6 +281,7 @@ detailed description of this mode.
249 (setq gdb-server-prefix "server ") 281 (setq gdb-server-prefix "server ")
250 (setq gdb-flush-pending-output nil) 282 (setq gdb-flush-pending-output nil)
251 (setq gdb-location-list nil) 283 (setq gdb-location-list nil)
284 (setq gdb-find-file-unhook nil)
252 ;; 285 ;;
253 (setq gdb-buffer-type 'gdba) 286 (setq gdb-buffer-type 'gdba)
254 ;; 287 ;;
@@ -263,6 +296,7 @@ detailed description of this mode.
263 (gdb-enqueue-input (list "server list MAIN__\n" 'ignore)) ; Fortran program 296 (gdb-enqueue-input (list "server list MAIN__\n" 'ignore)) ; Fortran program
264 (gdb-enqueue-input (list "server info source\n" 'gdb-source-info)) 297 (gdb-enqueue-input (list "server info source\n" 'gdb-source-info))
265 ;; 298 ;;
299 (gdb-set-gud-minor-mode-existing-buffers)
266 (run-hooks 'gdba-mode-hook)) 300 (run-hooks 'gdba-mode-hook))
267 301
268(defcustom gdb-use-colon-colon-notation nil 302(defcustom gdb-use-colon-colon-notation nil
@@ -1048,8 +1082,6 @@ happens to be appropriate."
1048 ;; buffer specific functions 1082 ;; buffer specific functions
1049 gdb-info-breakpoints-custom) 1083 gdb-info-breakpoints-custom)
1050 1084
1051(defvar gdb-location-list nil "List of directories for source files.")
1052
1053(defconst breakpoint-xpm-data 1085(defconst breakpoint-xpm-data
1054 "/* XPM */ 1086 "/* XPM */
1055static char *magick[] = { 1087static char *magick[] = {
@@ -1159,13 +1191,11 @@ static char *magick[] = {
1159 (setq file (cdr (assoc bptno gdb-location-list)))) 1191 (setq file (cdr (assoc bptno gdb-location-list))))
1160 (unless (string-equal file "File not found") 1192 (unless (string-equal file "File not found")
1161 (if file 1193 (if file
1162 (with-current-buffer 1194 (with-current-buffer (find-file-noselect file)
1163 (find-file-noselect file) 1195 (set (make-local-variable 'gud-minor-mode)
1164 (save-current-buffer
1165 (set (make-local-variable 'gud-minor-mode)
1166 'gdba) 1196 'gdba)
1167 (set (make-local-variable 'tool-bar-map) 1197 (set (make-local-variable 'tool-bar-map)
1168 gud-tool-bar-map)) 1198 gud-tool-bar-map)
1169 ;; only want one breakpoint icon at each location 1199 ;; only want one breakpoint icon at each location
1170 (save-excursion 1200 (save-excursion
1171 (goto-line (string-to-number line)) 1201 (goto-line (string-to-number line))
@@ -2054,15 +2084,15 @@ Kills the gdb buffers and resets the source buffers."
2054 "Find the source file where the program starts and displays it with related 2084 "Find the source file where the program starts and displays it with related
2055buffers." 2085buffers."
2056 (goto-char (point-min)) 2086 (goto-char (point-min))
2057 (if (search-forward "Located in " nil t) 2087 (if (and (search-forward "Located in " nil t)
2058 (if (looking-at "\\S-*") 2088 (looking-at "\\S-*"))
2059 (setq gdb-main-file (match-string 0)))) 2089 (setq gdb-main-file (match-string 0)))
2060 (if gdb-many-windows 2090 (if gdb-many-windows
2061 (gdb-setup-windows) 2091 (gdb-setup-windows)
2062 (gdb-get-create-buffer 'gdb-breakpoints-buffer) 2092 (gdb-get-create-buffer 'gdb-breakpoints-buffer)
2063 (if gdb-show-main 2093 (if gdb-show-main
2064 (let ((pop-up-windows t)) 2094 (let ((pop-up-windows t))
2065 (display-buffer (gud-find-file gdb-main-file)))))) 2095 (display-buffer (gud-find-file gdb-main-file))))))
2066 2096
2067(defun gdb-get-location (bptno line flag) 2097(defun gdb-get-location (bptno line flag)
2068 "Find the directory containing the relevant source file. 2098 "Find the directory containing the relevant source file.
@@ -2085,6 +2115,23 @@ Add directory to search path for source files using the GDB command, dir."))
2085 (goto-line (string-to-number line)) 2115 (goto-line (string-to-number line))
2086 (gdb-put-breakpoint-icon (eq flag ?y) bptno)))) 2116 (gdb-put-breakpoint-icon (eq flag ?y) bptno))))
2087 2117
2118(add-hook 'find-file-hook 'gdb-find-file-hook)
2119
2120(defun gdb-find-file-hook ()
2121 (if (and (not gdb-find-file-unhook)
2122 ;; in case gud or gdb-ui is just loaded
2123 gud-comint-buffer
2124 (buffer-name gud-comint-buffer)
2125 (with-current-buffer gud-comint-buffer
2126 (eq gud-minor-mode 'gdba)))
2127 (condition-case nil
2128 (gdb-enqueue-input
2129 (list (concat gdb-server-prefix "list "
2130 (file-name-nondirectory buffer-file-name)
2131 ":1\n")
2132 `(lambda () (gdb-set-gud-minor-mode ,(current-buffer)))))
2133 (error (setq gdb-find-file-unhook t)))))
2134
2088;;from put-image 2135;;from put-image
2089(defun gdb-put-string (putstring pos &optional dprop) 2136(defun gdb-put-string (putstring pos &optional dprop)
2090 "Put string PUTSTRING in front of POS in the current buffer. 2137 "Put string PUTSTRING in front of POS in the current buffer.
diff --git a/lisp/replace.el b/lisp/replace.el
index 42480b656d6..de3577913c1 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1435,7 +1435,8 @@ make, or the user didn't cancel the call."
1435 query-replace-skip-read-only)) 1435 query-replace-skip-read-only))
1436 (unless (or literal noedit) 1436 (unless (or literal noedit)
1437 (replace-highlight (nth 0 real-match-data) 1437 (replace-highlight (nth 0 real-match-data)
1438 (nth 1 real-match-data))) 1438 (nth 1 real-match-data)
1439 start end))
1439 (setq noedit 1440 (setq noedit
1440 (replace-match-maybe-edit 1441 (replace-match-maybe-edit
1441 next-replacement nocasify literal 1442 next-replacement nocasify literal
@@ -1451,7 +1452,8 @@ make, or the user didn't cancel the call."
1451 ;; `real-match-data'. 1452 ;; `real-match-data'.
1452 (while (not done) 1453 (while (not done)
1453 (set-match-data real-match-data) 1454 (set-match-data real-match-data)
1454 (replace-highlight (match-beginning 0) (match-end 0)) 1455 (replace-highlight (match-beginning 0) (match-end 0)
1456 start end)
1455 ;; Bind message-log-max so we don't fill up the message log 1457 ;; Bind message-log-max so we don't fill up the message log
1456 ;; with a bunch of identical messages. 1458 ;; with a bunch of identical messages.
1457 (let ((message-log-max nil)) 1459 (let ((message-log-max nil))
@@ -1627,15 +1629,15 @@ make, or the user didn't cancel the call."
1627 1629
1628(defvar replace-overlay nil) 1630(defvar replace-overlay nil)
1629 1631
1630(defun replace-highlight (beg end) 1632(defun replace-highlight (match-beg match-end range-beg range-end)
1631 (if query-replace-highlight 1633 (if query-replace-highlight
1632 (if replace-overlay 1634 (if replace-overlay
1633 (move-overlay replace-overlay beg end (current-buffer)) 1635 (move-overlay replace-overlay match-beg match-end (current-buffer))
1634 (setq replace-overlay (make-overlay beg end)) 1636 (setq replace-overlay (make-overlay match-beg match-end))
1635 (overlay-put replace-overlay 'priority 1) ;higher than lazy overlays 1637 (overlay-put replace-overlay 'priority 1) ;higher than lazy overlays
1636 (overlay-put replace-overlay 'face 'query-replace))) 1638 (overlay-put replace-overlay 'face 'query-replace)))
1637 (if query-replace-lazy-highlight 1639 (when query-replace-lazy-highlight
1638 (isearch-lazy-highlight-new-loop))) 1640 (isearch-lazy-highlight-new-loop range-beg range-end)))
1639 1641
1640(defun replace-dehighlight () 1642(defun replace-dehighlight ()
1641 (when replace-overlay 1643 (when replace-overlay
diff --git a/lisp/textmodes/reftex-cite.el b/lisp/textmodes/reftex-cite.el
index 6369f9637db..bfe2cd8282b 100644
--- a/lisp/textmodes/reftex-cite.el
+++ b/lisp/textmodes/reftex-cite.el
@@ -679,9 +679,12 @@ While entering the regexp, completion on knows citation keys is possible.
679 (setq start (1+ start))))) 679 (setq start (1+ start)))))
680 ;; Should we cleanup empty optional arguments? 680 ;; Should we cleanup empty optional arguments?
681 ;; if the first is empty, it can be removed. If the second is empty, 681 ;; if the first is empty, it can be removed. If the second is empty,
682 ;; it has to go. 682 ;; it has to go. If there is only a single arg and empty, it can go
683 ;; as well.
683 (when reftex-cite-cleanup-optional-args 684 (when reftex-cite-cleanup-optional-args
684 (cond 685 (cond
686 ((string-match "\\([a-zA-Z0-9]\\)\\[\\]{" string)
687 (setq string (replace-match "\\1{" nil nil string)))
685 ((string-match "\\[\\]\\(\\[[a-zA-Z0-9., ]+\\]\\)" string) 688 ((string-match "\\[\\]\\(\\[[a-zA-Z0-9., ]+\\]\\)" string)
686 (setq string (replace-match "\\1" nil nil string))) 689 (setq string (replace-match "\\1" nil nil string)))
687 ((string-match "\\[\\]\\[\\]" string) 690 ((string-match "\\[\\]\\[\\]" string)
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index 6dac2389e71..8bc7209749f 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,7 @@
12005-02-14 Michael Welsh Duggan <md5i@cs.cmu.edu>
2
3 * url-http.el (url-http-parse-headers): Test url-automatic-caching.
4
12005-01-22 Klaus Straubinger <KSNetz@Arcor.DE> (tiny change) 52005-01-22 Klaus Straubinger <KSNetz@Arcor.DE> (tiny change)
2 6
3 * url-http.el (url-http-parse-headers) <302>: Reset url-http-data 7 * url-http.el (url-http-parse-headers) <302>: Reset url-http-data
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index 3a0fbf6ecd6..872ea22ce05 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -413,7 +413,7 @@ should be shown to the user."
413 ;; Generic success for all others. Store in the cache, and 413 ;; Generic success for all others. Store in the cache, and
414 ;; mark it as successful. 414 ;; mark it as successful.
415 (widen) 415 (widen)
416 (if (equal url-http-method "GET") 416 (if (and url-automatic-caching (equal url-http-method "GET"))
417 (url-store-in-cache (current-buffer))) 417 (url-store-in-cache (current-buffer)))
418 (setq success t)))) 418 (setq success t))))
419 (3 ; Redirection 419 (3 ; Redirection
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index ec5129e0b91..7da20942eaf 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,72 @@
12005-02-14 Lute Kamstra <lute@gnu.org>
2
3 * elisp.texi (Top): Remove reference to deleted node.
4
5 * lists.texi (Lists): Remove reference to deleted node.
6 (Cons Cells): Fix typo.
7
8 * loading.texi (Where Defined): Fix typo.
9
102005-02-14 Richard M. Stallman <rms@gnu.org>
11
12 * variables.texi (Creating Buffer-Local): change-major-mode-hook
13 is useful for discarding some minor modes.
14
15 * symbols.texi (Symbol Components): Reorder examples.
16
17 * streams.texi (Input Functions): State standard-input default.
18 (Output Variables): State standard-output default.
19
20 * objects.texi (Printed Representation): Clarify read syntax vs print.
21 (Floating Point Type): Explain meaning better.
22 (Symbol Type): Explain uniqueness better.
23 (Cons Cell Type): Explain empty list sooner. CAR and CDR later.
24 List examples sooner.
25 (Box Diagrams): New subnode broken out.
26 Some examples moved from old Lists as Boxes node.
27 (Dotted Pair Notation): Clarify intro.
28 (Array Type): Clarify.
29 (Type Predicates): Add hash-table-p.
30
31 * numbers.texi (Integer Basics): Clarify radix explanation.
32 (Predicates on Numbers): Minor clarification.
33 (Comparison of Numbers): Minor clarification. Clarify eql.
34 Typos in min, max.
35 (Math Functions): Clarify overflow in expt.
36
37 * minibuf.texi (Text from Minibuffer): Minor clarification.
38 Mention arrow keys.
39
40 * loading.texi (Autoload): defun's doc string overrides autoload's
41 doc string.
42 (Repeated Loading): Modernize "add to list" examples.
43 (Where Defined): Finish updating table of load-history elts.
44
45 * lists.texi (List-related Predicates): Minor wording improvement.
46 (Lists as Boxes): Node deleted.
47 (Building Lists): Explain trivial cases of number-sequence.
48
49 * hash.texi (Hash Tables): Add desc to menu items.
50 (Creating Hash): Expain "full" means "make larger",
51 (Hash Access): Any object can be a key.
52 State value of maphash.
53
54 * functions.texi (What Is a Function): Wording cleanup.
55 (Function Documentation): Minor cleanup.
56 Explain purpose of calling convention at end of doc string.
57 (Function Names): Wording cleanup.
58 (Calling Functions): Wording cleanup.
59 Explain better how funcall calls the function.
60 (Function Cells): Delete example of saving and redefining function.
61
62 * control.texi (Combining Conditions): Wording cleanup.
63 (Iteration): dolist and dotimes bind VAR locally.
64 (Cleanups): Xref to Atomic Changes.
65
66 * compile.texi (Byte Compilation): Delete 19.29 info.
67 (Compilation Functions): Macros' difficulties don't affect defsubst.
68 (Docs and Compilation): Delete 19.29 info.
69
12005-02-10 Richard M. Stallman <rms@gnu.org> 702005-02-10 Richard M. Stallman <rms@gnu.org>
2 71
3 * objects.texi (Symbol Type): Minor correction. 72 * objects.texi (Symbol Type): Minor correction.
diff --git a/lispref/compile.texi b/lispref/compile.texi
index 6c28708bdf1..91c0661a99e 100644
--- a/lispref/compile.texi
+++ b/lispref/compile.texi
@@ -27,17 +27,7 @@ results compatible with running the same file without compilation.
27@xref{Loading Non-ASCII}. 27@xref{Loading Non-ASCII}.
28 28
29 In general, any version of Emacs can run byte-compiled code produced 29 In general, any version of Emacs can run byte-compiled code produced
30by recent earlier versions of Emacs, but the reverse is not true. A 30by recent earlier versions of Emacs, but the reverse is not true.
31major incompatible change was introduced in Emacs version 19.29, and
32files compiled with versions since that one will definitely not run
33in earlier versions unless you specify a special option.
34@iftex
35@xref{Docs and Compilation}.
36@end iftex
37In addition, the modifier bits in keyboard characters were renumbered in
38Emacs 19.29; as a result, files compiled in versions before 19.29 will
39not work in subsequent versions if they contain character constants with
40modifier bits.
41 31
42@vindex no-byte-compile 32@vindex no-byte-compile
43 If you do not want a Lisp file to be compiled, ever, put a file-local 33 If you do not want a Lisp file to be compiled, ever, put a file-local
@@ -122,6 +112,9 @@ macros must already be defined for proper compilation. For more
122details, see @ref{Compiling Macros}. If a program does not work the 112details, see @ref{Compiling Macros}. If a program does not work the
123same way when compiled as it does when interpreted, erroneous macro 113same way when compiled as it does when interpreted, erroneous macro
124definitions are one likely cause (@pxref{Problems with Macros}). 114definitions are one likely cause (@pxref{Problems with Macros}).
115Inline (@code{defsubst}) functions are less troublesome; if you
116compile a call to such a function before its definition is known, the
117call will still work right, it will just run slower.
125 118
126 Normally, compiling a file does not evaluate the file's contents or 119 Normally, compiling a file does not evaluate the file's contents or
127load the file. But it does execute any @code{require} calls at top 120load the file. But it does execute any @code{require} calls at top
@@ -313,14 +306,13 @@ directory where you built it, you will experience this problem
313occasionally if you edit and recompile Lisp files. When it happens, you 306occasionally if you edit and recompile Lisp files. When it happens, you
314can cure the problem by reloading the file after recompiling it. 307can cure the problem by reloading the file after recompiling it.
315 308
316 Byte-compiled files made with recent versions of Emacs (since 19.29) 309 You can turn off this feature at compile time by setting
317will not load into older versions because the older versions don't 310@code{byte-compile-dynamic-docstrings} to @code{nil}; this is useful
318support this feature. You can turn off this feature at compile time by 311mainly if you expect to change the file, and you want Emacs processes
319setting @code{byte-compile-dynamic-docstrings} to @code{nil}; then you 312that have already loaded it to keep working when the file changes.
320can compile files that will load into older Emacs versions. You can do 313You can do this globally, or for one source file by specifying a
321this globally, or for one source file by specifying a file-local binding 314file-local binding for the variable. One way to do that is by adding
322for the variable. One way to do that is by adding this string to the 315this string to the file's first line:
323file's first line:
324 316
325@example 317@example
326-*-byte-compile-dynamic-docstrings: nil;-*- 318-*-byte-compile-dynamic-docstrings: nil;-*-
diff --git a/lispref/control.texi b/lispref/control.texi
index e2a1e26b170..760e7bb82de 100644
--- a/lispref/control.texi
+++ b/lispref/control.texi
@@ -346,8 +346,8 @@ Here is a more realistic example of using @code{and}:
346Note that @code{(car foo)} is not executed if @code{(consp foo)} returns 346Note that @code{(car foo)} is not executed if @code{(consp foo)} returns
347@code{nil}, thus avoiding an error. 347@code{nil}, thus avoiding an error.
348 348
349@code{and} can be expressed in terms of either @code{if} or @code{cond}. 349@code{and} expressions can also be written using either @code{if} or
350For example: 350@code{cond}. Here's how:
351 351
352@example 352@example
353@group 353@group
@@ -476,11 +476,11 @@ write two common kinds of loops.
476 476
477@defmac dolist (var list [result]) body@dots{} 477@defmac dolist (var list [result]) body@dots{}
478@tindex dolist 478@tindex dolist
479This construct executes @var{body} once for each element of @var{list}, 479This construct executes @var{body} once for each element of
480using the variable @var{var} to hold the current element. Then it 480@var{list}, binding the variable @var{var} locally to hold the current
481returns the value of evaluating @var{result}, or @code{nil} if 481element. Then it returns the value of evaluating @var{result}, or
482@var{result} is omitted. For example, here is how you could use 482@code{nil} if @var{result} is omitted. For example, here is how you
483@code{dolist} to define the @code{reverse} function: 483could use @code{dolist} to define the @code{reverse} function:
484 484
485@example 485@example
486(defun reverse (list) 486(defun reverse (list)
@@ -493,8 +493,8 @@ returns the value of evaluating @var{result}, or @code{nil} if
493@defmac dotimes (var count [result]) body@dots{} 493@defmac dotimes (var count [result]) body@dots{}
494@tindex dotimes 494@tindex dotimes
495This construct executes @var{body} once for each integer from 0 495This construct executes @var{body} once for each integer from 0
496(inclusive) to @var{count} (exclusive), using the variable @var{var} to 496(inclusive) to @var{count} (exclusive), binding the variable @var{var}
497hold the integer for the current iteration. Then it returns the value 497to the integer for the current iteration. Then it returns the value
498of evaluating @var{result}, or @code{nil} if @var{result} is omitted. 498of evaluating @var{result}, or @code{nil} if @var{result} is omitted.
499Here is an example of using @code{dotimes} to do something 100 times: 499Here is an example of using @code{dotimes} to do something 100 times:
500 500
@@ -1167,7 +1167,10 @@ and their conditions.
1167 1167
1168 The @code{unwind-protect} construct is essential whenever you 1168 The @code{unwind-protect} construct is essential whenever you
1169temporarily put a data structure in an inconsistent state; it permits 1169temporarily put a data structure in an inconsistent state; it permits
1170you to make the data consistent again in the event of an error or throw. 1170you to make the data consistent again in the event of an error or
1171throw. (Another more specific cleanup construct that is used only for
1172changes in buffer contents is the atomic change group; @ref{Atomic
1173Changes}.)
1171 1174
1172@defspec unwind-protect body-form cleanup-forms@dots{} 1175@defspec unwind-protect body-form cleanup-forms@dots{}
1173@cindex cleanup forms 1176@cindex cleanup forms
diff --git a/lispref/elisp.texi b/lispref/elisp.texi
index fa84a0a93fb..64e956afdf3 100644
--- a/lispref/elisp.texi
+++ b/lispref/elisp.texi
@@ -34,7 +34,7 @@ Published by the Free Software Foundation
3459 Temple Place, Suite 330 3459 Temple Place, Suite 330
35Boston, MA 02111-1307 USA 35Boston, MA 02111-1307 USA
36 36
37Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999,@* 37Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2005,@*
38 2000, 2002 Free Software Foundation, Inc. 38 2000, 2002 Free Software Foundation, Inc.
39 39
40Permission is granted to copy, distribute and/or modify this document 40Permission is granted to copy, distribute and/or modify this document
@@ -281,7 +281,6 @@ Strings and Characters
281Lists 281Lists
282 282
283* Cons Cells:: How lists are made out of cons cells. 283* Cons Cells:: How lists are made out of cons cells.
284* Lists as Boxes:: Graphical notation to explain lists.
285* List-related Predicates:: Is this object a list? Comparing two lists. 284* List-related Predicates:: Is this object a list? Comparing two lists.
286* List Elements:: Extracting the pieces of a list. 285* List Elements:: Extracting the pieces of a list.
287* Building Lists:: Creating list structure. 286* Building Lists:: Creating list structure.
diff --git a/lispref/functions.texi b/lispref/functions.texi
index 5c7433507b0..26c2449fee6 100644
--- a/lispref/functions.texi
+++ b/lispref/functions.texi
@@ -53,7 +53,7 @@ macros are not functions.
53@cindex built-in function 53@cindex built-in function
54A @dfn{primitive} is a function callable from Lisp that is written in C, 54A @dfn{primitive} is a function callable from Lisp that is written in C,
55such as @code{car} or @code{append}. These functions are also called 55such as @code{car} or @code{append}. These functions are also called
56@dfn{built-in} functions or @dfn{subrs}. (Special forms are also 56@dfn{built-in functions}, or @dfn{subrs}. (Special forms are also
57considered primitives.) 57considered primitives.)
58 58
59Usually the reason we implement a function as a primitive is either 59Usually the reason we implement a function as a primitive is either
@@ -412,13 +412,14 @@ are easier to access.
412because @code{apropos} displays just this first line. It should consist 412because @code{apropos} displays just this first line. It should consist
413of one or two complete sentences that summarize the function's purpose. 413of one or two complete sentences that summarize the function's purpose.
414 414
415 The start of the documentation string is usually indented in the source file, 415 The start of the documentation string is usually indented in the
416but since these spaces come before the starting double-quote, they are not part of 416source file, but since these spaces come before the starting
417the string. Some people make a practice of indenting any additional 417double-quote, they are not part of the string. Some people make a
418lines of the string so that the text lines up in the program source. 418practice of indenting any additional lines of the string so that the
419@emph{That is a mistake.} The indentation of the following lines is 419text lines up in the program source. @emph{That is a mistake.} The
420inside the string; what looks nice in the source code will look ugly 420indentation of the following lines is inside the string; what looks
421when displayed by the help commands. 421nice in the source code will look ugly when displayed by the help
422commands.
422 423
423 You may wonder how the documentation string could be optional, since 424 You may wonder how the documentation string could be optional, since
424there are required components of the function that follow it (the body). 425there are required components of the function that follow it (the body).
@@ -438,9 +439,14 @@ text like this:
438 439
439@noindent 440@noindent
440following a blank line, at the beginning of the line, with no newline 441following a blank line, at the beginning of the line, with no newline
441following it inside the documentation string. This feature is 442following it inside the documentation string. (The @samp{\} is used
442particularly useful for macro definitions. The @samp{\} is used to 443to avoid confusing the Emacs motion commands.) The calling convention
443avoid confusing the Emacs motion commands. 444specified in this way appears in help messages in place of the one
445derived from the actual arguments of the function.
446
447 This feature is particularly useful for macro definitions, since the
448arguments written in a macro definition often do not correspond to the
449way users think of the parts of the macro call.
444 450
445@node Function Names 451@node Function Names
446@section Naming a Function 452@section Naming a Function
@@ -481,8 +487,8 @@ practice).
481 We often identify functions with the symbols used to name them. For 487 We often identify functions with the symbols used to name them. For
482example, we often speak of ``the function @code{car}'', not 488example, we often speak of ``the function @code{car}'', not
483distinguishing between the symbol @code{car} and the primitive 489distinguishing between the symbol @code{car} and the primitive
484subr-object that is its function definition. For most purposes, there 490subr-object that is its function definition. For most purposes, the
485is no need to distinguish. 491distinction is not important.
486 492
487 Even so, keep in mind that a function need not have a unique name. While 493 Even so, keep in mind that a function need not have a unique name. While
488a given function object @emph{usually} appears in the function cell of only 494a given function object @emph{usually} appears in the function cell of only
@@ -626,13 +632,12 @@ For example, evaluating the list @code{(concat "a" "b")} calls the
626function @code{concat} with arguments @code{"a"} and @code{"b"}. 632function @code{concat} with arguments @code{"a"} and @code{"b"}.
627@xref{Evaluation}, for a description of evaluation. 633@xref{Evaluation}, for a description of evaluation.
628 634
629 When you write a list as an expression in your program, the function 635 When you write a list as an expression in your program, you specify
630name it calls is written in your program. This means that you choose 636which function to call, and how many arguments to give it, in the text
631which function to call, and how many arguments to give it, when you 637of the program. Usually that's just what you want. Occasionally you
632write the program. Usually that's just what you want. Occasionally you 638need to compute at run time which function to call. To do that, use
633need to compute at run time which function to call. To do that, use the 639the function @code{funcall}. When you also need to determine at run
634function @code{funcall}. When you also need to determine at run time 640time how many arguments to pass, use @code{apply}.
635how many arguments to pass, use @code{apply}.
636 641
637@defun funcall function &rest arguments 642@defun funcall function &rest arguments
638@code{funcall} calls @var{function} with @var{arguments}, and returns 643@code{funcall} calls @var{function} with @var{arguments}, and returns
@@ -641,11 +646,12 @@ whatever @var{function} returns.
641Since @code{funcall} is a function, all of its arguments, including 646Since @code{funcall} is a function, all of its arguments, including
642@var{function}, are evaluated before @code{funcall} is called. This 647@var{function}, are evaluated before @code{funcall} is called. This
643means that you can use any expression to obtain the function to be 648means that you can use any expression to obtain the function to be
644called. It also means that @code{funcall} does not see the expressions 649called. It also means that @code{funcall} does not see the
645you write for the @var{arguments}, only their values. These values are 650expressions you write for the @var{arguments}, only their values.
646@emph{not} evaluated a second time in the act of calling @var{function}; 651These values are @emph{not} evaluated a second time in the act of
647@code{funcall} enters the normal procedure for calling a function at the 652calling @var{function}; the operation of @code{funcall} is like the
648place where the arguments have already been evaluated. 653normal procedure for calling a function, once its arguments have
654already been evaluated.
649 655
650The argument @var{function} must be either a Lisp function or a 656The argument @var{function} must be either a Lisp function or a
651primitive function. Special forms and macros are not allowed, because 657primitive function. Special forms and macros are not allowed, because
@@ -1137,30 +1143,12 @@ Here are examples of these uses:
1137@end example 1143@end example
1138@end defun 1144@end defun
1139 1145
1140 When writing a function that extends a previously defined function, 1146 @code{fset} is sometimes used to save the old definition of a
1141the following idiom is sometimes used: 1147function before redefining it. That permits the new definition to
1142 1148invoke the old definition. But it is unmodular and unclean for a Lisp
1143@example 1149file to redefine a function defined elsewhere. If you want to modify
1144(fset 'old-foo (symbol-function 'foo)) 1150a function defined by another package, it is cleaner to use
1145(defun foo () 1151@code{defadvice} (@pxref{Advising Functions}).
1146 "Just like old-foo, except more so."
1147@group
1148 (old-foo)
1149 (more-so))
1150@end group
1151@end example
1152
1153@noindent
1154This does not work properly if @code{foo} has been defined to autoload.
1155In such a case, when @code{foo} calls @code{old-foo}, Lisp attempts
1156to define @code{old-foo} by loading a file. Since this presumably
1157defines @code{foo} rather than @code{old-foo}, it does not produce the
1158proper results. The only way to avoid this problem is to make sure the
1159file is loaded before moving aside the old definition of @code{foo}.
1160
1161 But it is unmodular and unclean, in any case, for a Lisp file to
1162redefine a function defined elsewhere. It is cleaner to use the advice
1163facility (@pxref{Advising Functions}).
1164 1152
1165@node Inline Functions 1153@node Inline Functions
1166@section Inline Functions 1154@section Inline Functions
diff --git a/lispref/hash.texi b/lispref/hash.texi
index 107935f1ba0..9343196a238 100644
--- a/lispref/hash.texi
+++ b/lispref/hash.texi
@@ -46,10 +46,10 @@ of object and are used only for recording interned symbols
46(@pxref{Creating Symbols}). 46(@pxref{Creating Symbols}).
47 47
48@menu 48@menu
49* Creating Hash:: 49* Creating Hash:: Functions to create hash tables.
50* Hash Access:: 50* Hash Access:: Reading and writing the hash table contents.
51* Defining Hash:: 51* Defining Hash:: Defining new comparison methods
52* Other Hash:: 52* Other Hash:: Miscellaneous.
53@end menu 53@end menu
54 54
55@node Creating Hash 55@node Creating Hash
@@ -146,11 +146,11 @@ number.
146The default value is 1.5. 146The default value is 1.5.
147 147
148@item :rehash-threshold @var{threshold} 148@item :rehash-threshold @var{threshold}
149This specifies the criterion for when the hash table is ``full.'' The 149This specifies the criterion for when the hash table is ``full'' (so
150value, @var{threshold}, should be a positive floating point number, no 150it should be made larger). The value, @var{threshold}, should be a
151greater than 1. The hash table is ``full'' whenever the actual number of 151positive floating point number, no greater than 1. The hash table is
152entries exceeds this fraction of the nominal size. The default for 152``full'' whenever the actual number of entries exceeds this fraction
153@var{threshold} is 0.8. 153of the nominal size. The default for @var{threshold} is 0.8.
154@end table 154@end table
155@end defun 155@end defun
156 156
@@ -167,7 +167,9 @@ This function is obsolete. Use @code{make-hash-table} instead.
167@section Hash Table Access 167@section Hash Table Access
168 168
169 This section describes the functions for accessing and storing 169 This section describes the functions for accessing and storing
170associations in a hash table. 170associations in a hash table. In general, any Lisp object can be used
171as a hash key, unless the comparison method imposes limits. Any Lisp
172object can also be used as the value.
171 173
172@tindex gethash 174@tindex gethash
173@defun gethash key table &optional default 175@defun gethash key table &optional default
@@ -210,7 +212,7 @@ table.
210This function calls @var{function} once for each of the associations in 212This function calls @var{function} once for each of the associations in
211@var{table}. The function @var{function} should accept two 213@var{table}. The function @var{function} should accept two
212arguments---a @var{key} listed in @var{table}, and its associated 214arguments---a @var{key} listed in @var{table}, and its associated
213@var{value}. 215@var{value}. @code{maphash} returns @code{nil}.
214@end defun 216@end defun
215 217
216@node Defining Hash 218@node Defining Hash
diff --git a/lispref/lists.texi b/lispref/lists.texi
index d30dcb0c270..dbcddd741b3 100644
--- a/lispref/lists.texi
+++ b/lispref/lists.texi
@@ -1,7 +1,7 @@
1@c -*-texinfo-*- 1@c -*-texinfo-*-
2@c This is part of the GNU Emacs Lisp Reference Manual. 2@c This is part of the GNU Emacs Lisp Reference Manual.
3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999,
4@c 2003, 2004 4@c 2003, 2004, 2005
5@c Free Software Foundation, Inc. 5@c Free Software Foundation, Inc.
6@c See the file elisp.texi for copying conditions. 6@c See the file elisp.texi for copying conditions.
7@setfilename ../info/lists 7@setfilename ../info/lists
@@ -18,7 +18,6 @@ the whole list.
18 18
19@menu 19@menu
20* Cons Cells:: How lists are made out of cons cells. 20* Cons Cells:: How lists are made out of cons cells.
21* Lists as Boxes:: Graphical notation to explain lists.
22* List-related Predicates:: Is this object a list? Comparing two lists. 21* List-related Predicates:: Is this object a list? Comparing two lists.
23* List Elements:: Extracting the pieces of a list. 22* List Elements:: Extracting the pieces of a list.
24* Building Lists:: Creating list structure. 23* Building Lists:: Creating list structure.
@@ -86,100 +85,17 @@ cells.
86 The @sc{cdr} of any nonempty list @var{l} is a list containing all the 85 The @sc{cdr} of any nonempty list @var{l} is a list containing all the
87elements of @var{l} except the first. 86elements of @var{l} except the first.
88 87
89@node Lists as Boxes
90@comment node-name, next, previous, up
91@section Lists as Linked Pairs of Boxes
92@cindex box representation for lists
93@cindex lists represented as boxes
94@cindex cons cell as box
95
96 A cons cell can be illustrated as a pair of boxes. The first box
97represents the @sc{car} and the second box represents the @sc{cdr}.
98Here is an illustration of the two-element list, @code{(tulip lily)},
99made from two cons cells:
100
101@example
102@group
103 --------------- ---------------
104| car | cdr | | car | cdr |
105| tulip | o---------->| lily | nil |
106| | | | | |
107 --------------- ---------------
108@end group
109@end example
110
111 Each pair of boxes represents a cons cell. Each box ``refers to'',
112``points to'' or ``holds'' a Lisp object. (These terms are
113synonymous.) The first box, which describes the @sc{car} of the first
114cons cell, contains the symbol @code{tulip}. The arrow from the
115@sc{cdr} box of the first cons cell to the second cons cell indicates
116that the @sc{cdr} of the first cons cell is the second cons cell.
117
118 The same list can be illustrated in a different sort of box notation
119like this:
120
121@example
122@group
123 --- --- --- ---
124 | | |--> | | |--> nil
125 --- --- --- ---
126 | |
127 | |
128 --> tulip --> lily
129@end group
130@end example
131
132 Here is a more complex illustration, showing the three-element list,
133@code{((pine needles) oak maple)}, the first element of which is a
134two-element list:
135
136@example
137@group
138 --- --- --- --- --- ---
139 | | |--> | | |--> | | |--> nil
140 --- --- --- --- --- ---
141 | | |
142 | | |
143 | --> oak --> maple
144 |
145 | --- --- --- ---
146 --> | | |--> | | |--> nil
147 --- --- --- ---
148 | |
149 | |
150 --> pine --> needles
151@end group
152@end example
153
154 The same list represented in the first box notation looks like this:
155
156@example
157@group
158 -------------- -------------- --------------
159| car | cdr | | car | cdr | | car | cdr |
160| o | o------->| oak | o------->| maple | nil |
161| | | | | | | | | |
162 -- | --------- -------------- --------------
163 |
164 |
165 | -------------- ----------------
166 | | car | cdr | | car | cdr |
167 ------>| pine | o------->| needles | nil |
168 | | | | | |
169 -------------- ----------------
170@end group
171@end example
172
173 @xref{Cons Cell Type}, for the read and print syntax of cons cells and 88 @xref{Cons Cell Type}, for the read and print syntax of cons cells and
174lists, and for more ``box and arrow'' illustrations of lists. 89lists, and for ``box and arrow'' illustrations of lists.
175 90
176@node List-related Predicates 91@node List-related Predicates
177@section Predicates on Lists 92@section Predicates on Lists
178 93
179 The following predicates test whether a Lisp object is an atom, is a 94 The following predicates test whether a Lisp object is an atom,
180cons cell or is a list, or whether it is the distinguished object 95whether it is a cons cell or is a list, or whether it is the
181@code{nil}. (Many of these predicates can be defined in terms of the 96distinguished object @code{nil}. (Many of these predicates can be
182others, but they are used so often that it is worth having all of them.) 97defined in terms of the others, but they are used so often that it is
98worth having all of them.)
183 99
184@defun consp object 100@defun consp object
185This function returns @code{t} if @var{object} is a cons cell, @code{nil} 101This function returns @code{t} if @var{object} is a cons cell, @code{nil}
@@ -749,9 +665,14 @@ This returns a list of numbers starting with @var{from} and
749incrementing by @var{separation}, and ending at or just before 665incrementing by @var{separation}, and ending at or just before
750@var{to}. @var{separation} can be positive or negative and defaults 666@var{to}. @var{separation} can be positive or negative and defaults
751to 1. If @var{to} is @code{nil} or numerically equal to @var{from}, 667to 1. If @var{to} is @code{nil} or numerically equal to @var{from},
752the one element list @code{(from)} is returned. If @var{separation} 668the value is the one-element list @code{(@var{from})}. If @var{to} is
753is 0 and @var{to} is neither @code{nil} nor numerically equal to 669less than @var{from} with a positive @var{separation}, or greater than
754@var{from}, an error is signaled. 670@var{from} with a negative @var{separation}, the value is @code{nil}
671because those arguments specify an empty sequence.
672
673If @var{separation} is 0 and @var{to} is neither @code{nil} nor
674numerically equal to @var{from}, @code{number-sequence} signals an
675error, since those arguments specify an infinite sequence.
755 676
756All arguments can be integers or floating point numbers. However, 677All arguments can be integers or floating point numbers. However,
757floating point arguments can be tricky, because floating point 678floating point arguments can be tricky, because floating point
diff --git a/lispref/loading.texi b/lispref/loading.texi
index 61c5b13ca6f..e12826af2f8 100644
--- a/lispref/loading.texi
+++ b/lispref/loading.texi
@@ -1,7 +1,7 @@
1@c -*-texinfo-*- 1@c -*-texinfo-*-
2@c This is part of the GNU Emacs Lisp Reference Manual. 2@c This is part of the GNU Emacs Lisp Reference Manual.
3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999,
4@c 2003, 2004 4@c 2003, 2004, 2005
5@c Free Software Foundation, Inc. 5@c Free Software Foundation, Inc.
6@c See the file elisp.texi for copying conditions. 6@c See the file elisp.texi for copying conditions.
7@setfilename ../info/loading 7@setfilename ../info/loading
@@ -365,10 +365,12 @@ one of these suffixes, and it will not load from a file whose name is
365just @var{filename} with no added suffix. 365just @var{filename} with no added suffix.
366 366
367The argument @var{docstring} is the documentation string for the 367The argument @var{docstring} is the documentation string for the
368function. Normally, this should be identical to the documentation string 368function. Specifying the documentation string in the call to
369in the function definition itself. Specifying the documentation string 369@code{autoload} makes it possible to look at the documentation without
370in the call to @code{autoload} makes it possible to look at the 370loading the function's real definition. Normally, this should be
371documentation without loading the function's real definition. 371identical to the documentation string in the function definition
372itself. If it isn't, the function definition's documentation string
373takes effect when it is loaded.
372 374
373If @var{interactive} is non-@code{nil}, that says @var{function} can be 375If @var{interactive} is non-@code{nil}, that says @var{function} can be
374called interactively. This lets completion in @kbd{M-x} work without 376called interactively. This lets completion in @kbd{M-x} work without
@@ -526,8 +528,7 @@ initialized. (@xref{Defining Variables}.)
526 The simplest way to add an element to an alist is like this: 528 The simplest way to add an element to an alist is like this:
527 529
528@example 530@example
529(setq minor-mode-alist 531(push '(leif-mode " Leif") minor-mode-alist)
530 (cons '(leif-mode " Leif") minor-mode-alist))
531@end example 532@end example
532 533
533@noindent 534@noindent
@@ -536,12 +537,15 @@ To avoid the problem, write this:
536 537
537@example 538@example
538(or (assq 'leif-mode minor-mode-alist) 539(or (assq 'leif-mode minor-mode-alist)
539 (setq minor-mode-alist 540 (push '(leif-mode " Leif") minor-mode-alist))
540 (cons '(leif-mode " Leif") minor-mode-alist)))
541@end example 541@end example
542 542
543 To add an element to a list just once, you can also use @code{add-to-list} 543@noindent
544(@pxref{Setting Variables}). 544or this:
545
546@example
547(add-to-list '(leif-mode " Leif") minor-mode-alist)
548@end example
545 549
546 Occasionally you will want to test explicitly whether a library has 550 Occasionally you will want to test explicitly whether a library has
547already been loaded. Here's one way to test, in a library, whether it 551already been loaded. Here's one way to test, in a library, whether it
@@ -746,12 +750,12 @@ elements have these forms:
746@item @var{var} 750@item @var{var}
747The symbol @var{var} was defined as a variable. 751The symbol @var{var} was defined as a variable.
748@item (defun . @var{fun}) 752@item (defun . @var{fun})
749The @var{fun} was defined by this library. 753The function @var{fun} was defined.
750@item (t . @var{fun}) 754@item (t . @var{fun})
751The function @var{fun} was previously an autoload before this library 755The function @var{fun} was previously an autoload before this library
752redefined it as a function. The following element is always the 756redefined it as a function. The following element is always
753symbol @var{fun}, which signifies that the library defined @var{fun} 757@code{(defun . @var{fun})}, which represents defining @var{fun} as a
754as a function. 758function.
755@item (autoload . @var{fun}) 759@item (autoload . @var{fun})
756The function @var{fun} was defined as an autoload. 760The function @var{fun} was defined as an autoload.
757@item (require . @var{feature}) 761@item (require . @var{feature})
diff --git a/lispref/minibuf.texi b/lispref/minibuf.texi
index 1455c63fe34..0e855b499ae 100644
--- a/lispref/minibuf.texi
+++ b/lispref/minibuf.texi
@@ -111,7 +111,8 @@ was supplied when Emacs was started.
111 Most often, the minibuffer is used to read text as a string. It can 111 Most often, the minibuffer is used to read text as a string. It can
112also be used to read a Lisp object in textual form. The most basic 112also be used to read a Lisp object in textual form. The most basic
113primitive for minibuffer input is @code{read-from-minibuffer}; it can do 113primitive for minibuffer input is @code{read-from-minibuffer}; it can do
114either one. 114either one. There are also specialized commands for reading
115commands, variables, file names, etc. (@pxref{Completion}).
115 116
116 In most cases, you should not call minibuffer input functions in the 117 In most cases, you should not call minibuffer input functions in the
117middle of a Lisp function. Instead, do all minibuffer input as part of 118middle of a Lisp function. Instead, do all minibuffer input as part of
@@ -234,9 +235,11 @@ default, it makes the following bindings:
234@code{abort-recursive-edit} 235@code{abort-recursive-edit}
235 236
236@item @kbd{M-n} 237@item @kbd{M-n}
238@itemx @key{DOWN}
237@code{next-history-element} 239@code{next-history-element}
238 240
239@item @kbd{M-p} 241@item @kbd{M-p}
242@itemx @key{UP}
240@code{previous-history-element} 243@code{previous-history-element}
241 244
242@item @kbd{M-s} 245@item @kbd{M-s}
diff --git a/lispref/numbers.texi b/lispref/numbers.texi
index 53435da081b..776251e4933 100644
--- a/lispref/numbers.texi
+++ b/lispref/numbers.texi
@@ -73,14 +73,21 @@ initial sign and optional final period.
73@cindex hex numbers 73@cindex hex numbers
74@cindex octal numbers 74@cindex octal numbers
75@cindex reading numbers in hex, octal, and binary 75@cindex reading numbers in hex, octal, and binary
76 In addition, the Lisp reader recognizes a syntax for integers in 76 The syntax for integers in bases other than 10 uses @samp{#}
77bases other than 10: @samp{#B@var{integer}} reads @var{integer} in 77followed by a letter that specifies the radix: @samp{b} for binary,
78binary (radix 2), @samp{#O@var{integer}} reads @var{integer} in octal 78@samp{o} for octal, @samp{x} for hex, or @samp{@var{radix}r} to
79(radix 8), @samp{#X@var{integer}} reads @var{integer} in hexadecimal 79specify radix @var{radix}. Case is not significant for the letter
80(radix 16), and @samp{#@var{radix}r@var{integer}} reads @var{integer} 80that specifies the radix. Thus, @samp{#b@var{integer}} reads
81in radix @var{radix} (where @var{radix} is between 2 and 36, 81@var{integer} in binary, and @samp{#@var{radix}r@var{integer}} reads
82inclusively). Case is not significant for the letter after @samp{#} 82@var{integer} in radix @var{radix}. Allowed values of @var{radix} run
83(@samp{B}, @samp{O}, etc.) that denotes the radix. 83from 2 to 36. For example:
84
85@example
86#b101100 @result{} 44
87#o54 @result{} 44
88#x2c @result{} 44
89#24r1k @result{} 44
90@end example
84 91
85 To understand how various functions work on integers, especially the 92 To understand how various functions work on integers, especially the
86bitwise operators (@pxref{Bitwise Operations}), it is often helpful to 93bitwise operators (@pxref{Bitwise Operations}), it is often helpful to
@@ -211,13 +218,12 @@ down to an integer.
211@node Predicates on Numbers 218@node Predicates on Numbers
212@section Type Predicates for Numbers 219@section Type Predicates for Numbers
213 220
214 The functions in this section test whether the argument is a number or 221 The functions in this section test for numbers, or for a specific
215whether it is a certain sort of number. The functions @code{integerp} 222type of number. The functions @code{integerp} and @code{floatp} can
216and @code{floatp} can take any type of Lisp object as argument (the 223take any type of Lisp object as argument (they would not be of much
217predicates would not be of much use otherwise); but the @code{zerop} 224use otherwise), but the @code{zerop} predicate requires a number as
218predicate requires a number as its argument. See also 225its argument. See also @code{integer-or-marker-p} and
219@code{integer-or-marker-p} and @code{number-or-marker-p}, in 226@code{number-or-marker-p}, in @ref{Predicates on Markers}.
220@ref{Predicates on Markers}.
221 227
222@defun floatp object 228@defun floatp object
223This predicate tests whether its argument is a floating point 229This predicate tests whether its argument is a floating point
@@ -251,7 +257,7 @@ considered non-negative.
251This predicate tests whether its argument is zero, and returns @code{t} 257This predicate tests whether its argument is zero, and returns @code{t}
252if so, @code{nil} otherwise. The argument must be a number. 258if so, @code{nil} otherwise. The argument must be a number.
253 259
254These two forms are equivalent: @code{(zerop x)} @equiv{} @code{(= x 0)}. 260@code{(zerop x)} is equivalent to @code{(= x 0)}.
255@end defun 261@end defun
256 262
257@node Comparison of Numbers 263@node Comparison of Numbers
@@ -275,10 +281,11 @@ numbers or markers. However, it is a good idea to use @code{=} if you
275can, even for comparing integers, just in case we change the 281can, even for comparing integers, just in case we change the
276representation of integers in a future Emacs version. 282representation of integers in a future Emacs version.
277 283
278 Sometimes it is useful to compare numbers with @code{equal}; it treats 284 Sometimes it is useful to compare numbers with @code{equal}; it
279two numbers as equal if they have the same data type (both integers, or 285treats two numbers as equal if they have the same data type (both
280both floating point) and the same value. By contrast, @code{=} can 286integers, or both floating point) and the same value. By contrast,
281treat an integer and a floating point number as equal. 287@code{=} can treat an integer and a floating point number as equal.
288@xref{Equality Predicates}.
282 289
283 There is another wrinkle: because floating point arithmetic is not 290 There is another wrinkle: because floating point arithmetic is not
284exact, it is often a bad idea to check for equality of two floating 291exact, it is often a bad idea to check for equality of two floating
@@ -309,10 +316,10 @@ returns @code{t} if so, @code{nil} otherwise.
309@end defun 316@end defun
310 317
311@defun eql value1 value2 318@defun eql value1 value2
312This function compares two floating point numbers like @code{=}, and 319This function acts like @code{eq} except when both arguments are
313compares two integers like @code{=}, and acts like @code{eq} in all 320numbers. It compares numbers by type and numberic value, so that
314other cases. Thus, @code{(eql 1.0 1)} returns @code{nil}, but 321@code{(eql 1.0 1)} returns @code{nil}, but @code{(eql 1.0 1.0)} and
315@code{(eql 1.0 1.0)} and @code{(eql 1 1)} both return @code{t}. 322@code{(eql 1 1)} both return @code{t}.
316@end defun 323@end defun
317 324
318@defun /= number-or-marker1 number-or-marker2 325@defun /= number-or-marker1 number-or-marker2
@@ -345,7 +352,7 @@ otherwise.
345 352
346@defun max number-or-marker &rest numbers-or-markers 353@defun max number-or-marker &rest numbers-or-markers
347This function returns the largest of its arguments. 354This function returns the largest of its arguments.
348If any of the argument is floating-point, the value is returned 355If any of the arguments is floating-point, the value is returned
349as floating point, even if it was given as an integer. 356as floating point, even if it was given as an integer.
350 357
351@example 358@example
@@ -360,7 +367,7 @@ as floating point, even if it was given as an integer.
360 367
361@defun min number-or-marker &rest numbers-or-markers 368@defun min number-or-marker &rest numbers-or-markers
362This function returns the smallest of its arguments. 369This function returns the smallest of its arguments.
363If any of the argument is floating-point, the value is returned 370If any of the arguments is floating-point, the value is returned
364as floating point, even if it was given as an integer. 371as floating point, even if it was given as an integer.
365 372
366@example 373@example
@@ -1147,8 +1154,7 @@ approximately.
1147@defun expt x y 1154@defun expt x y
1148This function returns @var{x} raised to power @var{y}. If both 1155This function returns @var{x} raised to power @var{y}. If both
1149arguments are integers and @var{y} is positive, the result is an 1156arguments are integers and @var{y} is positive, the result is an
1150integer; in this case, it is truncated to fit the range of possible 1157integer; in this case, overflow causes truncation, so watch out.
1151integer values.
1152@end defun 1158@end defun
1153 1159
1154@defun sqrt arg 1160@defun sqrt arg
diff --git a/lispref/objects.texi b/lispref/objects.texi
index 43ecb02f09e..f0bef593f29 100644
--- a/lispref/objects.texi
+++ b/lispref/objects.texi
@@ -68,36 +68,37 @@ to use these types can be found in later chapters.
68 68
69 The @dfn{printed representation} of an object is the format of the 69 The @dfn{printed representation} of an object is the format of the
70output generated by the Lisp printer (the function @code{prin1}) for 70output generated by the Lisp printer (the function @code{prin1}) for
71that object. The @dfn{read syntax} of an object is the format of the 71that object. Every data type has a unique printed representation.
72input accepted by the Lisp reader (the function @code{read}) for that 72The @dfn{read syntax} of an object is the format of the input accepted
73object. @xref{Read and Print}. 73by the Lisp reader (the function @code{read}) for that object. This
74 74is not necessarily unique; many kinds of object have more than one
75 Most objects have more than one possible read syntax. Some types of 75syntax. @xref{Read and Print}.
76object have no read syntax, since it may not make sense to enter objects
77of these types directly in a Lisp program. Except for these cases, the
78printed representation of an object is also a read syntax for it.
79
80 In other languages, an expression is text; it has no other form. In
81Lisp, an expression is primarily a Lisp object and only secondarily the
82text that is the object's read syntax. Often there is no need to
83emphasize this distinction, but you must keep it in the back of your
84mind, or you will occasionally be very confused.
85 76
86@cindex hash notation 77@cindex hash notation
87 Every type has a printed representation. Some types have no read 78 In most cases, an object's printed representation is also a read
88syntax---for example, the buffer type has none. Objects of these types 79syntax for the object. However, some types have no read syntax, since
89are printed in @dfn{hash notation}: the characters @samp{#<} followed by 80it does not make sense to enter objects of these types as constants in
90a descriptive string (typically the type name followed by the name of 81a Lisp program. These objects are printed in @dfn{hash notation}: the
91the object), and closed with a matching @samp{>}. Hash notation cannot 82characters @samp{#<} followed by a descriptive string (typically the
92be read at all, so the Lisp reader signals the error 83type name followed by the name of the object), and closed with a
93@code{invalid-read-syntax} whenever it encounters @samp{#<}. 84matching @samp{>}. For example:
94@kindex invalid-read-syntax
95 85
96@example 86@example
97(current-buffer) 87(current-buffer)
98 @result{} #<buffer objects.texi> 88 @result{} #<buffer objects.texi>
99@end example 89@end example
100 90
91@noindent
92Hash notation cannot be read at all, so the Lisp reader signals the
93error @code{invalid-read-syntax} whenever it encounters @samp{#<}.
94@kindex invalid-read-syntax
95
96 In other languages, an expression is text; it has no other form. In
97Lisp, an expression is primarily a Lisp object and only secondarily the
98text that is the object's read syntax. Often there is no need to
99emphasize this distinction, but you must keep it in the back of your
100mind, or you will occasionally be very confused.
101
101 When you evaluate an expression interactively, the Lisp interpreter 102 When you evaluate an expression interactively, the Lisp interpreter
102first reads the textual representation of it, producing a Lisp object, 103first reads the textual representation of it, producing a Lisp object,
103and then evaluates that object (@pxref{Evaluation}). However, 104and then evaluates that object (@pxref{Evaluation}). However,
@@ -204,9 +205,11 @@ leading @samp{+} or a final @samp{.}.
204@subsection Floating Point Type 205@subsection Floating Point Type
205 206
206 Floating point numbers are the computer equivalent of scientific 207 Floating point numbers are the computer equivalent of scientific
207notation. The precise number of significant figures and the range of 208notation; you can think of a floating point number as a fraction
208possible exponents is machine-specific; Emacs always uses the C data 209together with a power of ten. The precise number of significant
209type @code{double} to store the value. 210figures and the range of possible exponents is machine-specific; Emacs
211uses the C data type @code{double} to store the value, and internally
212this records a power of 2 rather than a power of 10.
210 213
211 The printed representation for floating point numbers requires either 214 The printed representation for floating point numbers requires either
212a decimal point (with at least one digit following), an exponent, or 215a decimal point (with at least one digit following), an exponent, or
@@ -474,9 +477,10 @@ following text.)
474@node Symbol Type 477@node Symbol Type
475@subsection Symbol Type 478@subsection Symbol Type
476 479
477 A @dfn{symbol} in GNU Emacs Lisp is an object with a name. The symbol 480 A @dfn{symbol} in GNU Emacs Lisp is an object with a name. The
478name serves as the printed representation of the symbol. In ordinary 481symbol name serves as the printed representation of the symbol. In
479use, the name is unique---no two symbols have the same name. 482ordinary Lisp use, with one single obarray (@pxref{Creating Symbols},
483a symbol's name is unique---no two symbols have the same name.
480 484
481 A symbol can serve as a variable, as a function name, or to hold a 485 A symbol can serve as a variable, as a function name, or to hold a
482property list. Or it may serve only to be distinct from all other Lisp 486property list. Or it may serve only to be distinct from all other Lisp
@@ -606,18 +610,10 @@ Lisp are implicit.
606 610
607 A @dfn{list} is a series of cons cells, linked together so that the 611 A @dfn{list} is a series of cons cells, linked together so that the
608@sc{cdr} slot of each cons cell holds either the next cons cell or the 612@sc{cdr} slot of each cons cell holds either the next cons cell or the
609empty list. @xref{Lists}, for functions that work on lists. Because 613empty list. The empty list is actually the symbol @code{nil}.
610most cons cells are used as part of lists, the phrase @dfn{list 614@xref{Lists}, for functions that work on lists. Because most cons
611structure} has come to refer to any structure made out of cons cells. 615cells are used as part of lists, the phrase @dfn{list structure} has
612 616come to refer to any structure made out of cons cells.
613 The names @sc{car} and @sc{cdr} derive from the history of Lisp. The
614original Lisp implementation ran on an @w{IBM 704} computer which
615divided words into two parts, called the ``address'' part and the
616``decrement''; @sc{car} was an instruction to extract the contents of
617the address part of a register, and @sc{cdr} an instruction to extract
618the contents of the decrement. By contrast, ``cons cells'' are named
619for the function @code{cons} that creates them, which in turn was named
620for its purpose, the construction of cells.
621 617
622@cindex atom 618@cindex atom
623 Because cons cells are so central to Lisp, we also have a word for 619 Because cons cells are so central to Lisp, we also have a word for
@@ -627,7 +623,18 @@ for its purpose, the construction of cells.
627@cindex parenthesis 623@cindex parenthesis
628 The read syntax and printed representation for lists are identical, and 624 The read syntax and printed representation for lists are identical, and
629consist of a left parenthesis, an arbitrary number of elements, and a 625consist of a left parenthesis, an arbitrary number of elements, and a
630right parenthesis. 626right parenthesis. Here are examples of lists:
627
628@example
629(A 2 "A") ; @r{A list of three elements.}
630() ; @r{A list of no elements (the empty list).}
631nil ; @r{A list of no elements (the empty list).}
632("A ()") ; @r{A list of one element: the string @code{"A ()"}.}
633(A ()) ; @r{A list of two elements: @code{A} and the empty list.}
634(A nil) ; @r{Equivalent to the previous.}
635((A B C)) ; @r{A list of one element}
636 ; @r{(which is a list of three elements).}
637@end example
631 638
632 Upon reading, each object inside the parentheses becomes an element 639 Upon reading, each object inside the parentheses becomes an element
633of the list. That is, a cons cell is made for each element. The 640of the list. That is, a cons cell is made for each element. The
@@ -636,8 +643,26 @@ slot refers to the next cons cell of the list, which holds the next
636element in the list. The @sc{cdr} slot of the last cons cell is set to 643element in the list. The @sc{cdr} slot of the last cons cell is set to
637hold @code{nil}. 644hold @code{nil}.
638 645
646 The names @sc{car} and @sc{cdr} derive from the history of Lisp. The
647original Lisp implementation ran on an @w{IBM 704} computer which
648divided words into two parts, called the ``address'' part and the
649``decrement''; @sc{car} was an instruction to extract the contents of
650the address part of a register, and @sc{cdr} an instruction to extract
651the contents of the decrement. By contrast, ``cons cells'' are named
652for the function @code{cons} that creates them, which in turn was named
653for its purpose, the construction of cells.
654
655@menu
656* Box Diagrams:: Drawing pictures of lists.
657* Dotted Pair Notation:: A general syntax for cons cells.
658* Association List Type:: A specially constructed list.
659@end menu
660
661@node Box Diagrams
662@subsubsection Drawing Lists as Box Diagrams
639@cindex box diagrams, for lists 663@cindex box diagrams, for lists
640@cindex diagrams, boxed, for lists 664@cindex diagrams, boxed, for lists
665
641 A list can be illustrated by a diagram in which the cons cells are 666 A list can be illustrated by a diagram in which the cons cells are
642shown as pairs of boxes, like dominoes. (The Lisp reader cannot read 667shown as pairs of boxes, like dominoes. (The Lisp reader cannot read
643such an illustration; unlike the textual notation, which can be 668such an illustration; unlike the textual notation, which can be
@@ -688,19 +713,6 @@ buttercup)}, sketched in a different manner:
688to the symbol @code{nil}. In other words, @code{nil} is both a symbol 713to the symbol @code{nil}. In other words, @code{nil} is both a symbol
689and a list. 714and a list.
690 715
691 Here are examples of lists written in Lisp syntax:
692
693@example
694(A 2 "A") ; @r{A list of three elements.}
695() ; @r{A list of no elements (the empty list).}
696nil ; @r{A list of no elements (the empty list).}
697("A ()") ; @r{A list of one element: the string @code{"A ()"}.}
698(A ()) ; @r{A list of two elements: @code{A} and the empty list.}
699(A nil) ; @r{Equivalent to the previous.}
700((A B C)) ; @r{A list of one element}
701 ; @r{(which is a list of three elements).}
702@end example
703
704 Here is the list @code{(A ())}, or equivalently @code{(A nil)}, 716 Here is the list @code{(A ())}, or equivalently @code{(A nil)},
705depicted with boxes and arrows: 717depicted with boxes and arrows:
706 718
@@ -715,27 +727,64 @@ depicted with boxes and arrows:
715@end group 727@end group
716@end example 728@end example
717 729
718@menu 730 Here is a more complex illustration, showing the three-element list,
719* Dotted Pair Notation:: An alternative syntax for lists. 731@code{((pine needles) oak maple)}, the first element of which is a
720* Association List Type:: A specially constructed list. 732two-element list:
721@end menu 733
734@example
735@group
736 --- --- --- --- --- ---
737 | | |--> | | |--> | | |--> nil
738 --- --- --- --- --- ---
739 | | |
740 | | |
741 | --> oak --> maple
742 |
743 | --- --- --- ---
744 --> | | |--> | | |--> nil
745 --- --- --- ---
746 | |
747 | |
748 --> pine --> needles
749@end group
750@end example
751
752 The same list represented in the first box notation looks like this:
753
754@example
755@group
756 -------------- -------------- --------------
757| car | cdr | | car | cdr | | car | cdr |
758| o | o------->| oak | o------->| maple | nil |
759| | | | | | | | | |
760 -- | --------- -------------- --------------
761 |
762 |
763 | -------------- ----------------
764 | | car | cdr | | car | cdr |
765 ------>| pine | o------->| needles | nil |
766 | | | | | |
767 -------------- ----------------
768@end group
769@end example
722 770
723@node Dotted Pair Notation 771@node Dotted Pair Notation
724@comment node-name, next, previous, up
725@subsubsection Dotted Pair Notation 772@subsubsection Dotted Pair Notation
726@cindex dotted pair notation 773@cindex dotted pair notation
727@cindex @samp{.} in lists 774@cindex @samp{.} in lists
728 775
729 @dfn{Dotted pair notation} is an alternative syntax for cons cells 776 @dfn{Dotted pair notation} is a general syntax for cons cells that
730that represents the @sc{car} and @sc{cdr} explicitly. In this syntax, 777represents the @sc{car} and @sc{cdr} explicitly. In this syntax,
731@code{(@var{a} .@: @var{b})} stands for a cons cell whose @sc{car} is 778@code{(@var{a} .@: @var{b})} stands for a cons cell whose @sc{car} is
732the object @var{a}, and whose @sc{cdr} is the object @var{b}. Dotted 779the object @var{a}, and whose @sc{cdr} is the object @var{b}. Dotted
733pair notation is therefore more general than list syntax. In the dotted 780pair notation is more general than list syntax because the @sc{cdr}
734pair notation, the list @samp{(1 2 3)} is written as @samp{(1 . (2 . (3 781does not have to be a list. However, it is more cumbersome in cases
735. nil)))}. For @code{nil}-terminated lists, you can use either 782where list syntax would work. In dotted pair notation, the list
736notation, but list notation is usually clearer and more convenient. 783@samp{(1 2 3)} is written as @samp{(1 . (2 . (3 . nil)))}. For
737When printing a list, the dotted pair notation is only used if the 784@code{nil}-terminated lists, you can use either notation, but list
738@sc{cdr} of a cons cell is not a list. 785notation is usually clearer and more convenient. When printing a
786list, the dotted pair notation is only used if the @sc{cdr} of a cons
787cell is not a list.
739 788
740 Here's an example using boxes to illustrate dotted pair notation. 789 Here's an example using boxes to illustrate dotted pair notation.
741This example shows the pair @code{(rose . violet)}: 790This example shows the pair @code{(rose . violet)}:
@@ -860,8 +909,9 @@ Once an array is created, its length is fixed.
860 909
861 All Emacs Lisp arrays are one-dimensional. (Most other programming 910 All Emacs Lisp arrays are one-dimensional. (Most other programming
862languages support multidimensional arrays, but they are not essential; 911languages support multidimensional arrays, but they are not essential;
863you can get the same effect with an array of arrays.) Each type of 912you can get the same effect with nested one-dimensional arrays.) Each
864array has its own read syntax; see the following sections for details. 913type of array has its own read syntax; see the following sections for
914details.
865 915
866 The array type is contained in the sequence type and 916 The array type is contained in the sequence type and
867contains the string type, the vector type, the bool-vector type, and the 917contains the string type, the vector type, the bool-vector type, and the
@@ -1661,6 +1711,9 @@ with references to further information.
1661@item functionp 1711@item functionp
1662@xref{Functions, functionp}. 1712@xref{Functions, functionp}.
1663 1713
1714@item hash-table-p
1715@xref{Other Hash, hash-table-p}.
1716
1664@item integer-or-marker-p 1717@item integer-or-marker-p
1665@xref{Predicates on Markers, integer-or-marker-p}. 1718@xref{Predicates on Markers, integer-or-marker-p}.
1666 1719
diff --git a/lispref/streams.texi b/lispref/streams.texi
index 599416fe679..2f27fe193dc 100644
--- a/lispref/streams.texi
+++ b/lispref/streams.texi
@@ -338,6 +338,7 @@ For example:
338@defvar standard-input 338@defvar standard-input
339This variable holds the default input stream---the stream that 339This variable holds the default input stream---the stream that
340@code{read} uses when the @var{stream} argument is @code{nil}. 340@code{read} uses when the @var{stream} argument is @code{nil}.
341The default is @code{t}, meaning use the minibuffer.
341@end defvar 342@end defvar
342 343
343@node Output Streams 344@node Output Streams
@@ -684,6 +685,7 @@ returns @code{"The buffer is foo"}.
684@defvar standard-output 685@defvar standard-output
685The value of this variable is the default output stream---the stream 686The value of this variable is the default output stream---the stream
686that print functions use when the @var{stream} argument is @code{nil}. 687that print functions use when the @var{stream} argument is @code{nil}.
688The default is @code{t}, meaning display in the echo area.
687@end defvar 689@end defvar
688 690
689@defvar print-quoted 691@defvar print-quoted
diff --git a/lispref/symbols.texi b/lispref/symbols.texi
index 858918445ff..92c8b0f1e82 100644
--- a/lispref/symbols.texi
+++ b/lispref/symbols.texi
@@ -115,10 +115,10 @@ the four cells of the symbol @code{buffer-file-name}:
115 @result{} "buffer-file-name" 115 @result{} "buffer-file-name"
116(symbol-value 'buffer-file-name) 116(symbol-value 'buffer-file-name)
117 @result{} "/gnu/elisp/symbols.texi" 117 @result{} "/gnu/elisp/symbols.texi"
118(symbol-plist 'buffer-file-name)
119 @result{} (variable-documentation 29529)
120(symbol-function 'buffer-file-name) 118(symbol-function 'buffer-file-name)
121 @result{} #<subr buffer-file-name> 119 @result{} #<subr buffer-file-name>
120(symbol-plist 'buffer-file-name)
121 @result{} (variable-documentation 29529)
122@end example 122@end example
123 123
124@noindent 124@noindent
diff --git a/lispref/variables.texi b/lispref/variables.texi
index 1f793b8f03f..de5fb40618f 100644
--- a/lispref/variables.texi
+++ b/lispref/variables.texi
@@ -1429,8 +1429,11 @@ variables that major modes set should not be marked permanent.
1429The function @code{kill-all-local-variables} runs this normal hook 1429The function @code{kill-all-local-variables} runs this normal hook
1430before it does anything else. This gives major modes a way to arrange 1430before it does anything else. This gives major modes a way to arrange
1431for something special to be done if the user switches to a different 1431for something special to be done if the user switches to a different
1432major mode. For best results, make this variable buffer-local, so that 1432major mode. It is also useful for buffer-specific minor modes
1433it will disappear after doing its job and will not interfere with the 1433that should be forgotten if the user changes the major mode.
1434
1435For best results, make this variable buffer-local, so that it will
1436disappear after doing its job and will not interfere with the
1434subsequent major mode. @xref{Hooks}. 1437subsequent major mode. @xref{Hooks}.
1435@end defvar 1438@end defvar
1436 1439
diff --git a/man/ChangeLog b/man/ChangeLog
index c2dc393be1d..bcba521884c 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,76 @@
12005-02-16 Luc Teirlinck <teirllm@auburn.edu>
2
3 * emacs.texi (Top): Update menu for splitting of node in
4 msdog.texi.
5 * frames.texi (Frames): Update xref for splitting of node in
6 msdog.texi.
7 * trouble.texi (Quitting): Ditto.
8
92005-02-16 Richard M. Stallman <rms@gnu.org>
10
11 * windows.texi (Split Window): Simplify line truncation info
12 and xref to Display Custom.
13
14 * trouble.texi (Quitting): Emergency escape only for text terminal.
15 (Screen Garbled): C-l for ungarbling is only for text terminal.
16
17 * text.texi (Text Mode): ESC TAB alternative for M-TAB.
18
19 * sending.texi (Header Editing): ESC TAB alternative for M-TAB.
20
21 * programs.texi (Program Modes): Mention Python mode.
22 (Moving by Defuns): Repeating C-M-h extends region.
23 (Basic Indent): Clarify.
24 (Custom C Indent): Clarify.
25 (Expressions): Repeating C-M-@ extends region.
26 (Info Lookup): Clarify for C-h S.
27 (Symbol Completion): ESC TAB alternative for M-TAB.
28 (Electric C): Clarify.
29
30 * emacs.texi (Top): Update display.texi and frames.texi submenu data.
31
32 * msdog.texi (MS-DOS Keyboard, MS-DOS Mouse): Split from
33 MS-DOS Input node.
34 (MS-DOS Keyboard): Start with explaining DEL and BREAK.
35 (MS-DOS and MULE): Clarify.
36 (MS-DOS Processes, Windows Processes): Fix typos.
37
38 * major.texi (Choosing Modes): Clarify.
39
40 * kmacro.texi (Basic Keyboard Macro): Doc F3, F4.
41 (Keyboard Macro Step-Edit): Clarify.
42
43 * indent.texi (Indentation): Clarifications.
44
45 * help.texi (Help): Correct error about C-h in query-replace.
46 Clarify apropos vs C-h a. Fix how to search in FAQ.
47 (Key Help): Describe C-h w here.
48 (Name Help): Minor cleanup. C-h w moved to Key Help.
49 Clarify the "object" joke.
50 (Apropos): Clarify. Mouse-1 like Mouse-2.
51 (Help Mode): Mouse-1 like Mouse-2.
52
53 * fixit.texi (Spelling): Mention ESC TAB as alt. for M-TAB.
54
55 * display.texi (Display): Reorder menu.
56 (Faces): Cleanup.
57 (Font Lock): Cleanup. Mention Options menu.
58 Delete obsolete text.
59 (Scrolling): For C-l, don't presume text terminal.
60 (Horizontal Scrolling): Simplify intro.
61 (Follow Mode): Clarify.
62 (Cursor Display): Moved before Display Custom.
63 (Display Custom): Explain no-redraw-on-reenter is for text terminals.
64 Doc default-tab-width. Doc line truncation more thoroughly.
65
66 * dired.texi (Dired Enter): C-x C-f can run Dired.
67 (Dired Visiting): Comment out `a' command.
68 Mouse-1 is like Mouse-2.
69 (Shell Commands in Dired): ? can be used more than once.
70
71 * basic.texi (Continuation Lines): Simplify description of truncation,
72 and refer to Display Custom for the rest of it.
73
12005-02-10 Jay Belanger <belanger@truman.edu> 742005-02-10 Jay Belanger <belanger@truman.edu>
2 75
3 * calc.texi: Change @LaTeX to La@TeX throughout. 76 * calc.texi: Change @LaTeX to La@TeX throughout.
diff --git a/man/basic.texi b/man/basic.texi
index 6a8ffc0000f..487e9579ece 100644
--- a/man/basic.texi
+++ b/man/basic.texi
@@ -544,25 +544,16 @@ character that indicates continuation.
544a line gets too long. Continuation on the screen does not do that. Use 544a line gets too long. Continuation on the screen does not do that. Use
545Auto Fill mode (@pxref{Filling}) if that's what you want. 545Auto Fill mode (@pxref{Filling}) if that's what you want.
546 546
547@vindex truncate-lines
548@cindex truncation 547@cindex truncation
549@cindex line truncation, and fringes 548@cindex line truncation, and fringes
550 As an alternative to continuation, Emacs can display long lines by 549 As an alternative to continuation, Emacs can display long lines by
551@dfn{truncation}. This means that all the characters that do not fit 550@dfn{truncation}. This means that all the characters that do not fit
552in the width of the screen or window do not appear at all. They 551in the width of the screen or window do not appear at all. @samp{$}
553remain in the buffer, temporarily invisible. On terminals, @samp{$} 552in the last column or a small straight arrow in the fringe to the
554in the last column informs you that the line has been truncated on the 553right of the window indicates a truncated line.
555display. On window systems, a small straight arrow in the fringe to 554
556the right of the window indicates a truncated line. 555 @xref{Display Custom}, for more information about line truncation,
557 556and other variables that affect how text is displayed.
558@findex toggle-truncate-lines
559 Truncation instead of continuation happens whenever horizontal
560scrolling is in use, and optionally in all side-by-side windows
561(@pxref{Windows}). You can enable or disable truncation for a
562particular buffer with the command @kbd{M-x toggle-truncate-lines}.
563
564 @xref{Display Custom}, for additional variables that affect how text is
565displayed.
566 557
567@node Position Info 558@node Position Info
568@section Cursor Position Information 559@section Cursor Position Information
diff --git a/man/dired.texi b/man/dired.texi
index 0390848faf6..3ce58f2b460 100644
--- a/man/dired.texi
+++ b/man/dired.texi
@@ -48,14 +48,15 @@ files.
48@findex dired 48@findex dired
49@kindex C-x d 49@kindex C-x d
50@vindex dired-listing-switches 50@vindex dired-listing-switches
51 To invoke Dired, do @kbd{C-x d} or @kbd{M-x dired}. The command reads 51 To invoke Dired, do @kbd{C-x d} or @kbd{M-x dired}. The command
52a directory name or wildcard file name pattern as a minibuffer argument 52reads a directory name or wildcard file name pattern as a minibuffer
53to specify which files to list. Where @code{dired} differs from 53argument to specify which files to list. @kbd{C-x C-f} given a
54@code{list-directory} is in putting the buffer into Dired mode so that 54directory name also invokes Dired. Where @code{dired} differs from
55the special commands of Dired are available. 55@code{list-directory} is that it puts the buffer into Dired mode, so
56that the special commands of Dired are available.
56 57
57 The variable @code{dired-listing-switches} specifies the options to 58 The variable @code{dired-listing-switches} specifies the options to
58give to @code{ls} for listing directory; this string @emph{must} contain 59give to @code{ls} for listing the directory; this string @emph{must} contain
59@samp{-l}. If you use a numeric prefix argument with the @code{dired} 60@samp{-l}. If you use a numeric prefix argument with the @code{dired}
60command, you can specify the @code{ls} switches with the minibuffer 61command, you can specify the @code{ls} switches with the minibuffer
61before you enter the directory specification. No matter how they are 62before you enter the directory specification. No matter how they are
@@ -255,11 +256,13 @@ and supplying that file name (@code{dired-find-file}). @xref{Visiting}.
255@kindex e @r{(Dired)} 256@kindex e @r{(Dired)}
256Equivalent to @kbd{f}. 257Equivalent to @kbd{f}.
257 258
259@ignore @c This command seems too risky to document at all.
258@item a 260@item a
259@kindex a @r{(Dired)} 261@kindex a @r{(Dired)}
260@findex dired-find-alternate-file 262@findex dired-find-alternate-file
261Like @kbd{f}, but replaces the contents of the Dired buffer with 263Like @kbd{f}, but replaces the contents of the Dired buffer with
262that of an alternate file or directory (@code{dired-find-alternate-file}). 264that of an alternate file or directory (@code{dired-find-alternate-file}).
265@end ignore
263 266
264@item o 267@item o
265@kindex o @r{(Dired)} 268@kindex o @r{(Dired)}
@@ -275,7 +278,8 @@ file. @xref{Windows}.
275Visit the file described on the current line, and display the buffer in 278Visit the file described on the current line, and display the buffer in
276another window, but do not select that window (@code{dired-display-file}). 279another window, but do not select that window (@code{dired-display-file}).
277 280
278@item Mouse-2 281@item Mouse-1
282@itemx Mouse-2
279@findex dired-mouse-find-file-other-window 283@findex dired-mouse-find-file-other-window
280Visit the file named by the line you click on 284Visit the file named by the line you click on
281(@code{dired-mouse-find-file-other-window}). This uses another window 285(@code{dired-mouse-find-file-other-window}). This uses another window
@@ -697,10 +701,10 @@ For example, @kbd{! uudecode @key{RET}} runs @code{uudecode} on each
697file. 701file.
698 702
699@item 703@item
700If the command string contains @samp{?} surrounded by whitespace, the 704However, if the command string contains @samp{?} surrounded by
701current file name is substituted for @samp{?}. You can use @samp{?} 705whitespace, the current file name is substituted for @samp{?} (rather
702this way more than once in the command, and each occurrence is 706than added at the end). You can use @samp{?} this way more than once
703replaced. 707in the command, and the same file name replaces each occurrence.
704@end itemize 708@end itemize
705 709
706To iterate over the file names in a more complicated fashion, use an 710To iterate over the file names in a more complicated fashion, use an
diff --git a/man/display.texi b/man/display.texi
index 23b79d1703e..c652b47787a 100644
--- a/man/display.texi
+++ b/man/display.texi
@@ -23,20 +23,20 @@ display it.
23* Selective Display:: Hiding lines with lots of indentation. 23* Selective Display:: Hiding lines with lots of indentation.
24* Optional Mode Line:: Optional mode line display features. 24* Optional Mode Line:: Optional mode line display features.
25* Text Display:: How text characters are normally displayed. 25* Text Display:: How text characters are normally displayed.
26* Display Custom:: Information on variables for customizing display.
27* Cursor Display:: Features for displaying the cursor. 26* Cursor Display:: Features for displaying the cursor.
27* Display Custom:: Information on variables for customizing display.
28@end menu 28@end menu
29 29
30@node Faces 30@node Faces
31@section Using Multiple Typefaces 31@section Using Multiple Typefaces
32@cindex faces 32@cindex faces
33 33
34 Emacs supports using multiple styles of displaying characters. Each 34 You can specify various styles for displaying text using
35style is called a @dfn{face}. Each face can specify various @dfn{face 35@dfn{faces}. Each face can specify various @dfn{face attributes},
36attributes}, such as the font family, the height, weight and slant of 36such as the font family, the height, weight and slant of the
37the characters, the foreground and background color, and underlining 37characters, the foreground and background color, and underlining or
38or overlining. A face does not have to specify all of these 38overlining. A face does not have to specify all of these attributes;
39attributes; often it inherits many of them from another face. 39often it inherits most of them from another face.
40 40
41 On a window system, all the Emacs face attributes are meaningful. 41 On a window system, all the Emacs face attributes are meaningful.
42On a character terminal, only some of them work. Some character 42On a character terminal, only some of them work. Some character
@@ -196,7 +196,7 @@ on your screen using the command @code{ps-print-buffer-with-faces}.
196@cindex syntax highlighting and coloring 196@cindex syntax highlighting and coloring
197 197
198 Font Lock mode is a minor mode, always local to a particular buffer, 198 Font Lock mode is a minor mode, always local to a particular buffer,
199which highlights (or ``fontifies'') using various faces according to 199which highlights (or ``fontifies'') the buffer contents according to
200the syntax of the text you are editing. It can recognize comments and 200the syntax of the text you are editing. It can recognize comments and
201strings in most languages; in several languages, it can also recognize 201strings in most languages; in several languages, it can also recognize
202and properly highlight various other important constructs---for 202and properly highlight various other important constructs---for
@@ -227,6 +227,10 @@ this:
227(global-font-lock-mode 1) 227(global-font-lock-mode 1)
228@end example 228@end example
229 229
230@noindent
231You can also specify this using the menu bar Options menu, specifying
232first Syntax Highlighting and then Save Options.
233
230 Font Lock mode uses several specifically named faces to do its job, 234 Font Lock mode uses several specifically named faces to do its job,
231including @code{font-lock-string-face}, @code{font-lock-comment-face}, 235including @code{font-lock-string-face}, @code{font-lock-comment-face},
232and others. The easiest way to find them all is to use completion 236and others. The easiest way to find them all is to use completion
@@ -248,10 +252,6 @@ Customize the faces interactively with @kbd{M-x customize-face}, as
248described in @ref{Face Customization}. 252described in @ref{Face Customization}.
249@end itemize 253@end itemize
250 254
251 To get the full benefit of Font Lock mode, you need to choose a
252default font which has bold, italic, and bold-italic variants; or else
253you need to have a color or gray-scale screen.
254
255@vindex font-lock-maximum-decoration 255@vindex font-lock-maximum-decoration
256 The variable @code{font-lock-maximum-decoration} specifies the 256 The variable @code{font-lock-maximum-decoration} specifies the
257preferred level of fontification, for modes that provide multiple 257preferred level of fontification, for modes that provide multiple
@@ -447,9 +447,10 @@ Scroll heuristically to bring useful information onto the screen
447@kindex C-l 447@kindex C-l
448@findex recenter 448@findex recenter
449 The most basic scrolling command is @kbd{C-l} (@code{recenter}) with 449 The most basic scrolling command is @kbd{C-l} (@code{recenter}) with
450no argument. It clears the entire screen and redisplays all windows. 450no argument. It scrolls the selected window so that point is halfway
451In addition, it scrolls the selected window so that point is halfway 451down from the top of the window. On a text terminal, it also clears
452down from the top of the window. 452the screen and redisplays all windows. That is useful in case the
453screen is garbled (@pxref{Screen Garbled}).
453 454
454@kindex C-v 455@kindex C-v
455@kindex M-v 456@kindex M-v
@@ -566,17 +567,12 @@ window, Emacs recenters the window. By default, @code{scroll-margin} is
566 567
567 @dfn{Horizontal scrolling} means shifting all the lines sideways 568 @dfn{Horizontal scrolling} means shifting all the lines sideways
568within a window---so that some of the text near the left margin is not 569within a window---so that some of the text near the left margin is not
569displayed at all. Emacs does this automatically in any window that 570displayed at all. When the text in a window is scrolled horizontally,
570uses line truncation rather than continuation: whenever point moves 571text lines are truncated rather than continued (@pxref{Display
571off the left or right edge of the screen, Emacs scrolls the buffer 572Custom}). Whenever a window shows truncated lines, Emacs
572horizontally to make point visible. 573automatically updates its horizontal scrolling whenever point moves
573 574off the left or right edge of the screen. You can also use these
574 When a window has been scrolled horizontally, text lines are truncated 575commands to do explicit horizontal scrolling.
575rather than continued (@pxref{Continuation Lines}), with a @samp{$}
576appearing in the first column when there is text truncated to the left,
577and in the last column when there is text truncated to the right.
578
579 You can use these commands to do explicit horizontal scrolling.
580 576
581@table @kbd 577@table @kbd
582@item C-x < 578@item C-x <
@@ -602,10 +598,10 @@ attempting to do so has no effect. This means that you don't have to
602calculate the argument precisely for @w{@kbd{C-x >}}; any sufficiently large 598calculate the argument precisely for @w{@kbd{C-x >}}; any sufficiently large
603argument will restore the normal display. 599argument will restore the normal display.
604 600
605 If you scroll a window horizontally by hand, that sets a lower bound 601 If you use those commands to scroll a window horizontally, that sets
606for automatic horizontal scrolling. Automatic scrolling will continue 602a lower bound for automatic horizontal scrolling. Automatic scrolling
607to scroll the window, but never farther to the right than the amount 603will continue to scroll the window, but never farther to the right
608you previously set by @code{scroll-left}. 604than the amount you previously set by @code{scroll-left}.
609 605
610@vindex hscroll-margin 606@vindex hscroll-margin
611 The value of the variable @code{hscroll-margin} controls how close 607 The value of the variable @code{hscroll-margin} controls how close
@@ -708,12 +704,12 @@ currently doesn't work on character terminals.)
708@cindex windows, synchronizing 704@cindex windows, synchronizing
709@cindex synchronizing windows 705@cindex synchronizing windows
710 706
711 @dfn{Follow mode} is a minor mode that makes two windows showing the 707 @dfn{Follow mode} is a minor mode that makes two windows, both
712same buffer scroll as one tall ``virtual window.'' To use Follow mode, 708showing the same buffer, scroll as a single tall ``virtual window.''
713go to a frame with just one window, split it into two side-by-side 709To use Follow mode, go to a frame with just one window, split it into
714windows using @kbd{C-x 3}, and then type @kbd{M-x follow-mode}. From 710two side-by-side windows using @kbd{C-x 3}, and then type @kbd{M-x
715then on, you can edit the buffer in either of the two windows, or scroll 711follow-mode}. From then on, you can edit the buffer in either of the
716either one; the other window follows it. 712two windows, or scroll either one; the other window follows it.
717 713
718 In Follow mode, if you move point outside the portion visible in one 714 In Follow mode, if you move point outside the portion visible in one
719window and into the portion visible in the other window, that selects 715window and into the portion visible in the other window, that selects
@@ -756,6 +752,9 @@ the three dots.
756precedes hidden lines. Then there is no visible indication of the 752precedes hidden lines. Then there is no visible indication of the
757hidden lines. This variable becomes local automatically when set. 753hidden lines. This variable becomes local automatically when set.
758 754
755 See also @ref{Outline Mode} for another way to hide part of
756the text in a buffer.
757
759@node Optional Mode Line 758@node Optional Mode Line
760@section Optional Mode Line Features 759@section Optional Mode Line Features
761 760
@@ -914,6 +913,46 @@ they are displayed using their graphics (assuming your terminal supports
914them), otherwise as escape sequences. @xref{Single-Byte Character 913them), otherwise as escape sequences. @xref{Single-Byte Character
915Support}. 914Support}.
916 915
916@node Cursor Display
917@section Displaying the Cursor
918
919@findex blink-cursor-mode
920@vindex blink-cursor-alist
921@cindex cursor, locating visually
922@cindex cursor, blinking
923 You can customize the cursor's color, and whether it blinks, using
924the @code{cursor} Custom group (@pxref{Easy Customization}). On
925graphical terminals, the command @kbd{M-x blink-cursor-mode} enables
926or disables the blinking of the cursor. (On text terminals, the
927terminal itself blinks the cursor, and Emacs has no control over it.)
928You can control how the cursor appears when it blinks off by setting
929the variable @code{blink-cursor-alist}.
930
931@cindex cursor in non-selected windows
932@vindex cursor-in-non-selected-windows
933 Normally, the cursor appears in non-selected windows in the ``off''
934state, with the same appearance as when the blinking cursor blinks
935``off''. For a box cursor, this is a hollow box; for a bar cursor,
936this is a thinner bar. To turn off cursors in non-selected windows,
937customize the variable @code{cursor-in-non-selected-windows} and assign
938it a @code{nil} value.
939
940@vindex x-stretch-cursor
941@cindex wide block cursor
942 On graphical terminals, Emacs can optionally draw the block cursor
943as wide as the character under the cursor---for example, if the cursor
944is on a tab character, it would cover the full width occupied by that
945tab character. To enable this feature, set the variable
946@code{x-stretch-cursor} to a non-@code{nil} value.
947
948@findex hl-line-mode
949@findex global-hl-line-mode
950@cindex highlight current line
951 If you find it hard to see the cursor, you might like HL Line mode,
952a minor mode that highlights the line containing point. Use @kbd{M-x
953hl-line-mode} to enable or disable it in the current buffer. @kbd{M-x
954global-hl-line-mode} enables or disables the same mode globally.
955
917@node Display Custom 956@node Display Custom
918@section Customization of Display 957@section Customization of Display
919 958
@@ -937,18 +976,19 @@ to invert all the lines of the display from what they normally are.
937 If the variable @code{visible-bell} is non-@code{nil}, Emacs attempts 976 If the variable @code{visible-bell} is non-@code{nil}, Emacs attempts
938to make the whole screen blink when it would normally make an audible bell 977to make the whole screen blink when it would normally make an audible bell
939sound. This variable has no effect if your terminal does not have a way 978sound. This variable has no effect if your terminal does not have a way
940to make the screen blink.@refill 979to make the screen blink.
941 980
942@vindex no-redraw-on-reenter 981@vindex no-redraw-on-reenter
943 When you reenter Emacs after suspending, Emacs normally clears the 982 On a text terminal, when you reenter Emacs after suspending, Emacs
944screen and redraws the entire display. On some terminals with more than 983normally clears the screen and redraws the entire display. On some
945one page of memory, it is possible to arrange the termcap entry so that 984terminals with more than one page of memory, it is possible to arrange
946the @samp{ti} and @samp{te} strings (output to the terminal when Emacs 985the termcap entry so that the @samp{ti} and @samp{te} strings (output
947is entered and exited, respectively) switch between pages of memory so 986to the terminal when Emacs is entered and exited, respectively) switch
948as to use one page for Emacs and another page for other output. Then 987between pages of memory so as to use one page for Emacs and another
949you might want to set the variable @code{no-redraw-on-reenter} 988page for other output. Then you might want to set the variable
950non-@code{nil}; this tells Emacs to assume, when resumed, that the 989@code{no-redraw-on-reenter} non-@code{nil}; this tells Emacs to
951screen page it is using still contains what Emacs last wrote there. 990assume, when resumed, that the screen page it is using still contains
991what Emacs last wrote there.
952 992
953@vindex echo-keystrokes 993@vindex echo-keystrokes
954 The variable @code{echo-keystrokes} controls the echoing of multi-character 994 The variable @code{echo-keystrokes} controls the echoing of multi-character
@@ -964,6 +1004,7 @@ default is initially @code{t}. @xref{Display Tables,, Display Tables,
964elisp, The Emacs Lisp Reference Manual}. 1004elisp, The Emacs Lisp Reference Manual}.
965 1005
966@vindex tab-width 1006@vindex tab-width
1007@vindex default-tab-width
967 Normally, a tab character in the buffer is displayed as whitespace which 1008 Normally, a tab character in the buffer is displayed as whitespace which
968extends to the next display tab stop position, and display tab stops come 1009extends to the next display tab stop position, and display tab stops come
969at intervals equal to eight spaces. The number of spaces per tab is 1010at intervals equal to eight spaces. The number of spaces per tab is
@@ -971,18 +1012,31 @@ controlled by the variable @code{tab-width}, which is made local by
971changing it, just like @code{ctl-arrow}. Note that how the tab character 1012changing it, just like @code{ctl-arrow}. Note that how the tab character
972in the buffer is displayed has nothing to do with the definition of 1013in the buffer is displayed has nothing to do with the definition of
973@key{TAB} as a command. The variable @code{tab-width} must have an 1014@key{TAB} as a command. The variable @code{tab-width} must have an
974integer value between 1 and 1000, inclusive. 1015integer value between 1 and 1000, inclusive. The variable
975 1016@code{default-tab-width} controls the default value of this variable
976@c @vindex truncate-lines @c No index entry here, because we have one 1017for buffers where you have not set it locally.
977@c in the continuation section. 1018
978 If the variable @code{truncate-lines} is non-@code{nil}, then each 1019@cindex truncation
979line of text gets just one screen line for display; if the text line is 1020@cindex line truncation, and fringes
980too long, display shows only the part that fits. If 1021 As an alternative to continuation, Emacs can display long lines by
981@code{truncate-lines} is @code{nil}, then long text lines display as 1022@dfn{truncation}. This means that all the characters that do not fit
982more than one screen line, enough to show the whole text of the line. 1023in the width of the screen or window do not appear at all. On
983@xref{Continuation Lines}. Altering the value of @code{truncate-lines} 1024graphical terminals, a small straight arrow in the fringe indicates
984makes it local to the current buffer; until that time, the default value 1025truncation at either end of the line. On text terminals, @samp{$}
985is in effect. The default is initially @code{nil}. 1026appears in the first column when there is text truncated to the left,
1027and in the last column when there is text truncated to the right.
1028
1029@vindex truncate-lines
1030@findex toggle-truncate-lines
1031 Horizontal scrolling automatically causes line truncation
1032(@pxref{Horizontal Scrolling}). You can explicitly enable line
1033truncation for a particular buffer with the command @kbd{M-x
1034toggle-truncate-lines}. This works by locally changing the variable
1035@code{truncate-lines}. If that variable is non-@code{nil}, long lines
1036are truncated; if it is @code{nil}, they are continued onto multiple
1037screen lines. Setting the variable @code{truncate-lines} in any way
1038makes it local to the current buffer; until that time, the default
1039value is in effect. The default value is normally @code{nil}.
986 1040
987@c @vindex truncate-partial-width-windows @c Idx entry is in Split Windows. 1041@c @vindex truncate-partial-width-windows @c Idx entry is in Split Windows.
988 If the variable @code{truncate-partial-width-windows} is 1042 If the variable @code{truncate-partial-width-windows} is
@@ -1066,46 +1120,6 @@ result in text that is hard to read. Call the function
1066@code{tty-suppress-bold-inverse-default-colors} with a non-@code{nil} 1120@code{tty-suppress-bold-inverse-default-colors} with a non-@code{nil}
1067argument to suppress the effect of bold-face in this case. 1121argument to suppress the effect of bold-face in this case.
1068 1122
1069@node Cursor Display
1070@section Displaying the Cursor
1071
1072@findex blink-cursor-mode
1073@vindex blink-cursor-alist
1074@cindex cursor, locating visually
1075@cindex cursor, blinking
1076 You can customize the cursor's color, and whether it blinks, using
1077the @code{cursor} Custom group (@pxref{Easy Customization}). On
1078graphical terminals, the command @kbd{M-x blink-cursor-mode} enables
1079or disables the blinking of the cursor. (On text terminals, the
1080terminal itself blinks the cursor, and Emacs has no control over it.)
1081You can control how the cursor appears when it blinks off by setting
1082the variable @code{blink-cursor-alist}.
1083
1084@cindex cursor in non-selected windows
1085@vindex cursor-in-non-selected-windows
1086 Normally, the cursor appears in non-selected windows in the ``off''
1087state, with the same appearance as when the blinking cursor blinks
1088``off''. For a box cursor, this is a hollow box; for a bar cursor,
1089this is a thinner bar. To turn off cursors in non-selected windows,
1090customize the variable @code{cursor-in-non-selected-windows} and assign
1091it a @code{nil} value.
1092
1093@vindex x-stretch-cursor
1094@cindex wide block cursor
1095 On graphical terminals, Emacs can optionally draw the block cursor
1096as wide as the character under the cursor---for example, if the cursor
1097is on a tab character, it would cover the full width occupied by that
1098tab character. To enable this feature, set the variable
1099@code{x-stretch-cursor} to a non-@code{nil} value.
1100
1101@findex hl-line-mode
1102@findex global-hl-line-mode
1103@cindex highlight current line
1104 If you find it hard to see the cursor, you might like HL Line mode,
1105a minor mode that highlights the line containing point. Use @kbd{M-x
1106hl-line-mode} to enable or disable it in the current buffer. @kbd{M-x
1107global-hl-line-mode} enables or disables the same mode globally.
1108
1109@ignore 1123@ignore
1110 arch-tag: 2219f910-2ff0-4521-b059-1bd231a536c4 1124 arch-tag: 2219f910-2ff0-4521-b059-1bd231a536c4
1111@end ignore 1125@end ignore
diff --git a/man/emacs.texi b/man/emacs.texi
index 3bfc95aac5a..dea25cdaa29 100644
--- a/man/emacs.texi
+++ b/man/emacs.texi
@@ -305,12 +305,19 @@ Registers
305 305
306Controlling the Display 306Controlling the Display
307 307
308* Faces:: How to change the display style using faces.
309* Font Lock:: Minor mode for syntactic highlighting using faces.
310* Highlight Changes:: Using colors to show where you changed the buffer.
311* Highlight Interactively:: Tell Emacs what text to highlight.
308* Scrolling:: Moving text up and down in a window. 312* Scrolling:: Moving text up and down in a window.
309* Horizontal Scrolling:: Moving text left and right in a window. 313* Horizontal Scrolling:: Moving text left and right in a window.
314* Fringes:: Enabling or disabling window fringes.
315* Useless Whitespace:: Showing possibly-spurious trailing whitespace.
310* Follow Mode:: Follow mode lets two windows scroll as one. 316* Follow Mode:: Follow mode lets two windows scroll as one.
311* Selective Display:: Hiding lines with lots of indentation. 317* Selective Display:: Hiding lines with lots of indentation.
312* Optional Mode Line:: Optional mode line display features. 318* Optional Mode Line:: Optional mode line display features.
313* Text Display:: How text is normally displayed. 319* Text Display:: How text characters are normally displayed.
320* Cursor Display:: Features for displaying the cursor.
314* Display Custom:: Information on variables for customizing display. 321* Display Custom:: Information on variables for customizing display.
315 322
316Searching and Replacement 323Searching and Replacement
@@ -418,15 +425,11 @@ Frames and X Windows
418* Frame Parameters:: Changing the colors and other modes of frames. 425* Frame Parameters:: Changing the colors and other modes of frames.
419* Scroll Bars:: How to enable and disable scroll bars; how to use them. 426* Scroll Bars:: How to enable and disable scroll bars; how to use them.
420* Wheeled Mice:: Using mouse wheels for scrolling. 427* Wheeled Mice:: Using mouse wheels for scrolling.
428* Drag and Drop:: Using drag and drop to open files and insert text.
421* Menu Bars:: Enabling and disabling the menu bar. 429* Menu Bars:: Enabling and disabling the menu bar.
422* Tool Bars:: Enabling and disabling the tool bar. 430* Tool Bars:: Enabling and disabling the tool bar.
423* Dialog Boxes:: Controlling use of dialog boxes. 431* Dialog Boxes:: Controlling use of dialog boxes.
424* Faces:: How to change the display style using faces. 432* Tooltips:: Showing "tooltips", AKA "balloon help" for active text.
425* Font Lock:: Minor mode for syntactic highlighting using faces.
426* Highlight Changes:: Using colors to show where you changed the buffer.
427* Highlight Interactively:: Tell Emacs what text to highlight.
428* Useless Whitespace:: Showing possibly-spurious trailing whitespace.
429* Tooltips:: Showing "tooltips", AKA "ballon help" for active text.
430* Mouse Avoidance:: Moving the mouse pointer out of the way. 433* Mouse Avoidance:: Moving the mouse pointer out of the way.
431* Non-Window Terminals:: Multiple frames on terminals that show only one. 434* Non-Window Terminals:: Multiple frames on terminals that show only one.
432* XTerm Mouse:: Using the mouse in an XTerm terminal emulator. 435* XTerm Mouse:: Using the mouse in an XTerm terminal emulator.
@@ -828,7 +831,8 @@ Environment Variables
828 831
829MS-DOS and Windows 95/98/NT 832MS-DOS and Windows 95/98/NT
830 833
831* MS-DOS Input:: Keyboard and mouse usage on MS-DOS. 834* MS-DOS Keyboard:: Keyboard usage on MS-DOS.
835* MS-DOS Mouse:: Mouse usage on MS-DOS.
832* MS-DOS Display:: Fonts, frames and display size on MS-DOS. 836* MS-DOS Display:: Fonts, frames and display size on MS-DOS.
833* MS-DOS File Names:: File-name conventions on MS-DOS. 837* MS-DOS File Names:: File-name conventions on MS-DOS.
834* Text and Binary:: Text files on MS-DOS use CRLF to separate lines. 838* Text and Binary:: Text files on MS-DOS use CRLF to separate lines.
diff --git a/man/fixit.texi b/man/fixit.texi
index 04fa823e76e..0982b0856ef 100644
--- a/man/fixit.texi
+++ b/man/fixit.texi
@@ -302,10 +302,11 @@ frame).
302 The command @code{ispell-complete-word}, which is bound to the key 302 The command @code{ispell-complete-word}, which is bound to the key
303@kbd{M-@key{TAB}} in Text mode and related modes, shows a list of 303@kbd{M-@key{TAB}} in Text mode and related modes, shows a list of
304completions based on spelling correction. Insert the beginning of a 304completions based on spelling correction. Insert the beginning of a
305word, and then type @kbd{M-@key{TAB}}; the command displays a completion 305word, and then type @kbd{M-@key{TAB}}; the command displays a
306list window. To choose one of the completions listed, click 306completion list window. (If your window manager intercepts
307@kbd{Mouse-2} on it, or move the cursor there in the completions window 307@kbd{M-@key{TAB}}, type @kbd{@key{ESC} @key{TAB}}.) To choose one of
308and type @key{RET}. @xref{Text Mode}. 308the completions listed, click @kbd{Mouse-2} on it, or move the cursor
309there in the completions window and type @key{RET}. @xref{Text Mode}.
309 310
310@ignore 311@ignore
311@findex reload-ispell 312@findex reload-ispell
diff --git a/man/frames.texi b/man/frames.texi
index 5c0c42b3d8b..a3f71e64bab 100644
--- a/man/frames.texi
+++ b/man/frames.texi
@@ -27,7 +27,7 @@ frame.
27 27
28 Emacs compiled for MS-DOS emulates some aspects of the window system 28 Emacs compiled for MS-DOS emulates some aspects of the window system
29so that you can use many of the features described in this chapter. 29so that you can use many of the features described in this chapter.
30@xref{MS-DOS Input}, for more information. 30@xref{MS-DOS Mouse}, for more information.
31 31
32@menu 32@menu
33* Mouse Commands:: Moving, cutting, and pasting, with the mouse. 33* Mouse Commands:: Moving, cutting, and pasting, with the mouse.
diff --git a/man/help.texi b/man/help.texi
index fb14eb150a2..d546440e114 100644
--- a/man/help.texi
+++ b/man/help.texi
@@ -25,11 +25,10 @@ help options, each with a brief description. Before you type a help
25option, you can use @key{SPC} or @key{DEL} to scroll through the list. 25option, you can use @key{SPC} or @key{DEL} to scroll through the list.
26 26
27 @kbd{C-h} or @key{F1} means ``help'' in various other contexts as 27 @kbd{C-h} or @key{F1} means ``help'' in various other contexts as
28well. For example, in the middle of @code{query-replace}, it describes 28well. After a prefix key, it displays a list of the alternatives that
29the options available for how to operate on the current match. After a 29can follow the prefix key. (A few prefix keys don't support
30prefix key, it displays a list of the alternatives that can follow the 30@kbd{C-h}, because they define other meanings for it, but they all
31prefix key. (A few prefix keys don't support @kbd{C-h}, because they 31support @key{F1}.)
32define other meanings for it, but they all support @key{F1}.)
33 32
34 Most help buffers use a special major mode, Help mode, which lets you 33 Most help buffers use a special major mode, Help mode, which lets you
35scroll conveniently with @key{SPC} and @key{DEL}. It also offers 34scroll conveniently with @key{SPC} and @key{DEL}. It also offers
@@ -51,9 +50,8 @@ be a regular expression (@pxref{Regexps}). Browse the buffer that this
51command displays to find what you are looking for. @xref{Apropos}. 50command displays to find what you are looking for. @xref{Apropos}.
52 51
53@item M-x apropos @key{RET} @var{topic} @key{RET} 52@item M-x apropos @key{RET} @var{topic} @key{RET}
54This works like @kbd{C-h a}, but it also searches for variables, 53This works like @kbd{C-h a}, but it also searches for noninteractive
55in case the feature you are looking for is controlled by a variable 54functions and for variables. @xref{Apropos}.
56rather than a command. @xref{Apropos}.
57 55
58@item M-x apropos-documentation @key{RET} @var{topic} @key{RET} 56@item M-x apropos-documentation @key{RET} @var{topic} @key{RET}
59This searches the @emph{documentation strings} (the built-in short 57This searches the @emph{documentation strings} (the built-in short
@@ -72,8 +70,8 @@ expression) in the @emph{text} of the manual rather than in its
72indices. 70indices.
73 71
74@item C-h C-f 72@item C-h C-f
75This brings up the Emacs FAQ, where you can use the usual search 73This brings up the Emacs FAQ. You can use the Info commands
76commands (@pxref{Search}) to find the information. 74to browse it.
77 75
78@item C-h p 76@item C-h p
79Finally, you can try looking up a suitable package using keywords 77Finally, you can try looking up a suitable package using keywords
@@ -198,6 +196,13 @@ This is too big for the echo area, so a window is used for the display.
198 @kbd{C-h c} and @kbd{C-h k} work for any sort of key sequences, 196 @kbd{C-h c} and @kbd{C-h k} work for any sort of key sequences,
199including function keys and mouse events. 197including function keys and mouse events.
200 198
199@kindex C-h w
200@findex where-is
201 @kbd{C-h w @var{command} @key{RET}} tells you what keys are bound to
202@var{command}. It displays a list of the keys in the echo area. If it
203says the command is not on any key, you must use @kbd{M-x} to run it.
204@kbd{C-h w} runs the command @code{where-is}.
205
201@node Name Help 206@node Name Help
202@section Help by Command or Variable Name 207@section Help by Command or Variable Name
203 208
@@ -217,15 +222,15 @@ displays the documentation of @code{auto-fill-mode}. This is the only
217way to get the documentation of a command that is not bound to any key 222way to get the documentation of a command that is not bound to any key
218(one which you would normally run using @kbd{M-x}). 223(one which you would normally run using @kbd{M-x}).
219 224
220 @kbd{C-h f} is also useful for Lisp functions that you are planning to 225 @kbd{C-h f} is also useful for Lisp functions that you are planning
221use in a Lisp program. For example, if you have just written the 226to use in a Lisp program. For example, if you have just written the
222expression @code{(make-vector len)} and want to check that you are using 227expression @code{(make-vector len)} and want to check that you are
223@code{make-vector} properly, type @kbd{C-h f make-vector @key{RET}}. 228using @code{make-vector} properly, type @kbd{C-h f make-vector
224Because @kbd{C-h f} allows all function names, not just command names, 229@key{RET}}. Because @kbd{C-h f} allows all function names, not just
225you may find that some of your favorite abbreviations that work in 230command names, you may find that some of your favorite completion
226@kbd{M-x} don't work in @kbd{C-h f}. An abbreviation may be unique 231abbreviations that work in @kbd{M-x} don't work in @kbd{C-h f}. An
227among command names yet fail to be unique when other function names are 232abbreviation may be unique among command names, yet fail to be unique
228allowed. 233when other function names are allowed.
229 234
230 The default function name for @kbd{C-h f} to describe, if you type 235 The default function name for @kbd{C-h f} to describe, if you type
231just @key{RET}, is the name of the function called by the innermost Lisp 236just @key{RET}, is the name of the function called by the innermost Lisp
@@ -241,13 +246,6 @@ buffer as the default, that name must be defined as a Lisp function. If
241that is all you want to know, just type @kbd{C-g} to cancel the @kbd{C-h 246that is all you want to know, just type @kbd{C-g} to cancel the @kbd{C-h
242f} command, then go on editing. 247f} command, then go on editing.
243 248
244@kindex C-h w
245@findex where-is
246 @kbd{C-h w @var{command} @key{RET}} tells you what keys are bound to
247@var{command}. It displays a list of the keys in the echo area. If it
248says the command is not on any key, you must use @kbd{M-x} to run it.
249@kbd{C-h w} runs the command @code{where-is}.
250
251 @kbd{C-h v} (@code{describe-variable}) is like @kbd{C-h f} but describes 249 @kbd{C-h v} (@code{describe-variable}) is like @kbd{C-h f} but describes
252Lisp variables instead of Lisp functions. Its default is the Lisp symbol 250Lisp variables instead of Lisp functions. Its default is the Lisp symbol
253around or before point, but only if that is the name of a known Lisp 251around or before point, but only if that is the name of a known Lisp
@@ -257,8 +255,9 @@ variable. @xref{Variables}.@refill
257normally have hyperlinks to the Lisp definition, if you have the Lisp 255normally have hyperlinks to the Lisp definition, if you have the Lisp
258source files installed. If you know Lisp, this provides the ultimate 256source files installed. If you know Lisp, this provides the ultimate
259documentation. If you don't know Lisp, you should learn it. If you 257documentation. If you don't know Lisp, you should learn it. If you
260are treating Emacs as an object file, then you are just @emph{using} 258are just @emph{using} Emacs, treating Emacs as an object (file), then
261Emacs. For real intimacy with Emacs, you must read the source code. 259you don't really love it. For true intimacy with your editor, you
260need to read the source code.
262 261
263@node Apropos 262@node Apropos
264@section Apropos 263@section Apropos
@@ -278,11 +277,11 @@ example, it would say that you can invoke @code{find-file} by typing
278normally checks only commands (interactive functions); if you specify a 277normally checks only commands (interactive functions); if you specify a
279prefix argument, it checks noninteractive functions as well. 278prefix argument, it checks noninteractive functions as well.
280 279
281 Because @kbd{C-h a} looks only for functions whose names contain the 280 Because @kbd{C-h a} looks only for commands whose names contain the
282string you specify, you must use ingenuity in choosing the 281string you specify, you must use ingenuity in choosing the string. If
283string. If you are looking for commands for killing backwards and 282you are looking for commands for killing backwards and @kbd{C-h a
284@kbd{C-h a kill-backwards @key{RET}} doesn't reveal any, don't give up. 283kill-backwards @key{RET}} doesn't reveal any, don't give up. Try just
285Try just @kbd{kill}, or just @kbd{backwards}, or just @kbd{back}. Be 284@kbd{kill}, or just @kbd{backwards}, or just @kbd{back}. Be
286persistent. Also note that you can use a regular expression as the 285persistent. Also note that you can use a regular expression as the
287argument, for more flexibility (@pxref{Regexps}). 286argument, for more flexibility (@pxref{Regexps}).
288 287
@@ -330,7 +329,7 @@ above all behave as if they had been given a prefix argument.
330 329
331 If you want more information about a function definition, variable or 330 If you want more information about a function definition, variable or
332symbol property listed in the Apropos buffer, you can click on it with 331symbol property listed in the Apropos buffer, you can click on it with
333@kbd{Mouse-2} or move there and type @key{RET}. 332@kbd{Mouse-1} or @kbd{Mouse-2}, or move there and type @key{RET}.
334 333
335@node Library Keywords 334@node Library Keywords
336@section Keyword Search for Lisp Libraries 335@section Keyword Search for Lisp Libraries
@@ -421,16 +420,17 @@ Follow a cross reference at point.
421Move point forward to the next cross reference. 420Move point forward to the next cross reference.
422@item S-@key{TAB} 421@item S-@key{TAB}
423Move point back to the previous cross reference. 422Move point back to the previous cross reference.
424@item Mouse-2 423@item Mouse-1
424@itemx Mouse-2
425Follow a cross reference that you click on. 425Follow a cross reference that you click on.
426@end table 426@end table
427 427
428 When a command name (@pxref{M-x,, Running Commands by Name}) or 428 When a function name (@pxref{M-x,, Running Commands by Name}) or
429variable name (@pxref{Variables}) appears in the documentation, it 429variable name (@pxref{Variables}) appears in the documentation, it
430normally appears inside paired single-quotes. You can click on the name 430normally appears inside paired single-quotes. You can click on the
431with @kbd{Mouse-2}, or move point there and type @key{RET}, to view the 431name with @kbd{Mouse-1} or @kbd{Mouse-2}, or move point there and type
432documentation of that command or variable. Use @kbd{C-c C-b} to retrace 432@key{RET}, to view the documentation of that command or variable. Use
433your steps. 433@kbd{C-c C-b} to retrace your steps.
434 434
435@kindex @key{TAB} @r{(Help mode)} 435@kindex @key{TAB} @r{(Help mode)}
436@findex help-next-ref 436@findex help-next-ref
diff --git a/man/indent.texi b/man/indent.texi
index ab640e76462..48a54747714 100644
--- a/man/indent.texi
+++ b/man/indent.texi
@@ -16,7 +16,7 @@ Indent the current line ``appropriately'' in a mode-dependent fashion.
16Perform @key{RET} followed by @key{TAB} (@code{newline-and-indent}). 16Perform @key{RET} followed by @key{TAB} (@code{newline-and-indent}).
17@item M-^ 17@item M-^
18Merge the previous and the current line (@code{delete-indentation}). 18Merge the previous and the current line (@code{delete-indentation}).
19This would cancel out the effect of @kbd{C-j}. 19This would cancel the effect of a preceding @kbd{C-j}.
20@item C-M-o 20@item C-M-o
21Split the current line at point; text on the line after point becomes a 21Split the current line at point; text on the line after point becomes a
22new line indented to the same column where point is located 22new line indented to the same column where point is located
@@ -25,9 +25,9 @@ new line indented to the same column where point is located
25Move (forward or back) to the first nonblank character on the current 25Move (forward or back) to the first nonblank character on the current
26line (@code{back-to-indentation}). 26line (@code{back-to-indentation}).
27@item C-M-\ 27@item C-M-\
28Indent several lines to the same column (@code{indent-region}). 28Indent lines in the region to the same column (@code{indent-region}).
29@item C-x @key{TAB} 29@item C-x @key{TAB}
30Shift a block of lines rigidly right or left (@code{indent-rigidly}). 30Shift lines in the region rigidly right or left (@code{indent-rigidly}).
31@item M-i 31@item M-i
32Indent from point to the next prespecified tab stop column 32Indent from point to the next prespecified tab stop column
33(@code{tab-to-tab-stop}). 33(@code{tab-to-tab-stop}).
@@ -47,11 +47,11 @@ to the next display tab stop position, and the default width of a tab
47stop is eight. @xref{Display Custom}, for more details. 47stop is eight. @xref{Display Custom}, for more details.
48 48
49@item 49@item
50Advance to the next tab stop. You can set tab stops at your choice of 50Insert whitespace up to the next tab stop. You can set tab stops at
51column positions, then type @kbd{M-i} to advance to the next tab stop. 51your choice of column positions, then type @kbd{M-i} to advance to the
52The default is to have tab stops every eight columns, which means by 52next tab stop. The default tab stop settings have a tab stop every
53default @kbd{M-i} inserts a tab character. To set the tab stops, use 53eight columns, which means by default @kbd{M-i} inserts a tab
54@kbd{M-x edit-tab-stops}. 54character. To set the tab stops, use @kbd{M-x edit-tab-stops}.
55 55
56@item 56@item
57Align a line with the previous line. More precisely, the command 57Align a line with the previous line. More precisely, the command
@@ -72,15 +72,11 @@ of the preceding lines. No matter where in the line you are when you
72type @key{TAB}, it aligns the line as a whole. 72type @key{TAB}, it aligns the line as a whole.
73@end enumerate 73@end enumerate
74 74
75 Normally, all of the above methods insert an optimal mix of tabs and 75 Normally, most of the above methods insert an optimal mix of tabs and
76spaces to align to the desired column. @xref{Just Spaces}, for how to 76spaces to align to the desired column. @xref{Just Spaces}, for how to
77disable use of tabs. However, @kbd{C-q @key{TAB}} always inserts a 77disable use of tabs. However, @kbd{C-q @key{TAB}} always inserts a
78tab, even when tabs are disabled for the indentation commands. 78tab, even when tabs are disabled for the indentation commands.
79 79
80@c In Text mode, @key{TAB} runs the command @code{tab-to-tab-stop}, which
81@c indents to the next tab stop column. You can set the tab stops with
82@c @kbd{M-x edit-tab-stops}.
83
84@menu 80@menu
85* Indentation Commands:: Various commands and techniques for indentation. 81* Indentation Commands:: Various commands and techniques for indentation.
86* Tab Stops:: You can set arbitrary "tab stops" and then 82* Tab Stops:: You can set arbitrary "tab stops" and then
diff --git a/man/kmacro.texi b/man/kmacro.texi
index 459752d3c4b..5ef34f6c929 100644
--- a/man/kmacro.texi
+++ b/man/kmacro.texi
@@ -46,6 +46,7 @@ intelligent or general. For such things, Lisp must be used.
46 46
47@table @kbd 47@table @kbd
48@item C-x ( 48@item C-x (
49@itemx @key{F3}
49Start defining a keyboard macro (@code{kmacro-start-macro}). 50Start defining a keyboard macro (@code{kmacro-start-macro}).
50@item C-x ) 51@item C-x )
51End the definition of a keyboard macro (@code{kmacro-end-macro}). 52End the definition of a keyboard macro (@code{kmacro-end-macro}).
@@ -53,6 +54,10 @@ End the definition of a keyboard macro (@code{kmacro-end-macro}).
53Execute the most recent keyboard macro (@code{kmacro-end-and-call-macro}). 54Execute the most recent keyboard macro (@code{kmacro-end-and-call-macro}).
54First end the definition of the keyboard macro, if currently defining it. 55First end the definition of the keyboard macro, if currently defining it.
55To immediately execute the keyboard macro again, just repeat the @kbd{e}. 56To immediately execute the keyboard macro again, just repeat the @kbd{e}.
57@item @key{F4}
58If a keyboard macro is being defined, end the definition; otherwise,
59execute the most recent keyboard macro
60(@code{kmacro-end-or-call-macro}).
56@item C-u C-x ( 61@item C-u C-x (
57Re-execute last keyboard macro, then add more keys to its definition. 62Re-execute last keyboard macro, then add more keys to its definition.
58@item C-u C-u C-x ( 63@item C-u C-u C-x (
@@ -120,6 +125,10 @@ of zero to @kbd{C-x e} or @kbd{C-x )} means repeat the macro
120indefinitely (until it gets an error or you type @kbd{C-g} or, on 125indefinitely (until it gets an error or you type @kbd{C-g} or, on
121MS-DOS, @kbd{C-@key{BREAK}}). 126MS-DOS, @kbd{C-@key{BREAK}}).
122 127
128 The key @key{F4} is like a combination of @kbd{C-x )} and @kbd{C-x
129e}. If you're defining a macro, @key{F4} ends the definition.
130Otherwise it executes the last macro.
131
123 If you wish to repeat an operation at regularly spaced places in the 132 If you wish to repeat an operation at regularly spaced places in the
124text, define a macro and include as part of the macro the commands to move 133text, define a macro and include as part of the macro the commands to move
125to the next place you want to use it. For example, if you want to change 134to the next place you want to use it. For example, if you want to change
@@ -490,18 +499,16 @@ keyboard input that you would use to invoke the macro---@kbd{C-x e} or
490 499
491@findex kmacro-step-edit-macro 500@findex kmacro-step-edit-macro
492@kindex C-x C-k SPC 501@kindex C-x C-k SPC
493 You can interactively and stepwise replay and edit the last keyboard 502 You can interactively replay and edit the last keyboard
494macro one command at a time by typing @kbd{C-x C-k SPC} 503macro, one command at a time, by typing @kbd{C-x C-k SPC}
495(@code{kmacro-step-edit-macro}). Unless you quit the macro using 504(@code{kmacro-step-edit-macro}). Unless you quit the macro using
496@kbd{q} or @kbd{C-g}, the edited macro replaces the last macro on the 505@kbd{q} or @kbd{C-g}, the edited macro replaces the last macro on the
497macro ring. 506macro ring.
498 507
499This shows the last macro in the minibuffer together with the first 508 This macro editing feature shows the last macro in the minibuffer
500(or next) command to be executed, and prompts you for an action. 509together with the first (or next) command to be executed, and prompts
501You can enter @kbd{?} to get a command summary. 510you for an action. You can enter @kbd{?} to get a summary of your
502 511options. These actions are available:
503The following commands are available in the step-edit mode and relate
504to the first (or current) command in the keyboard macro:
505 512
506@itemize @bullet{} 513@itemize @bullet{}
507@item 514@item
diff --git a/man/major.texi b/man/major.texi
index a7c3a9062cf..fa44b873031 100644
--- a/man/major.texi
+++ b/man/major.texi
@@ -92,14 +92,14 @@ For example, one element normally found in the list has the form
92@code{(@t{"\\.c\\'"} . c-mode)}, and it is responsible for selecting C 92@code{(@t{"\\.c\\'"} . c-mode)}, and it is responsible for selecting C
93mode for files whose names end in @file{.c}. (Note that @samp{\\} is 93mode for files whose names end in @file{.c}. (Note that @samp{\\} is
94needed in Lisp syntax to include a @samp{\} in the string, which must 94needed in Lisp syntax to include a @samp{\} in the string, which must
95be used to suppress the special meaning of @samp{.} in regexps.) If the 95be used to suppress the special meaning of @samp{.} in regexps.) If
96element has the form @code{(@var{regexp} @var{mode-function} 96the element has the form @code{(@var{regexp} @var{mode-function}
97@var{flag})} and @var{flag} is non-@code{nil}, then after calling 97@var{flag})} and @var{flag} is non-@code{nil}, then after calling
98@var{mode-function}, the suffix that matched @var{regexp} is discarded 98@var{mode-function}, Emacs discards the suffix that matched
99and the list is searched again for another match. 99@var{regexp} and searches the list again for another match.
100 100
101 You can specify which major mode should be used for editing a certain 101 You can specify the major mode to use for editing a certain file by
102file by a special sort of text in the first nonblank line of the file. The 102special text in the first nonblank line of the file. The
103mode name should appear in this line both preceded and followed by 103mode name should appear in this line both preceded and followed by
104@samp{-*-}. Other text may appear on the line as well. For example, 104@samp{-*-}. Other text may appear on the line as well. For example,
105 105
@@ -166,6 +166,7 @@ the file's local variables list (if any).
166@vindex change-major-mode-with-file-name 166@vindex change-major-mode-with-file-name
167 The commands @kbd{C-x C-w} and @code{set-visited-file-name} change to 167 The commands @kbd{C-x C-w} and @code{set-visited-file-name} change to
168a new major mode if the new file name implies a mode (@pxref{Saving}). 168a new major mode if the new file name implies a mode (@pxref{Saving}).
169(@kbd{C-x C-s} does this too, if the buffer wasn't visiting a file.)
169However, this does not happen if the buffer contents specify a major 170However, this does not happen if the buffer contents specify a major
170mode, and certain ``special'' major modes do not allow the mode to 171mode, and certain ``special'' major modes do not allow the mode to
171change. You can turn off this mode-changing feature by setting 172change. You can turn off this mode-changing feature by setting
diff --git a/man/msdog.texi b/man/msdog.texi
index dec258ec672..a1d7647a95d 100644
--- a/man/msdog.texi
+++ b/man/msdog.texi
@@ -24,7 +24,8 @@ sections at the end of this chapter which apply specifically for the
24Windows version. 24Windows version.
25 25
26@menu 26@menu
27* Input: MS-DOS Input. Keyboard and mouse usage on MS-DOS. 27* Keyboard: MS-DOS Keyboard. Keyboard conventions on MS-DOS.
28* Mouse: MS-DOS Mouse. Mouse conventions on MS-DOS.
28* Display: MS-DOS Display. Fonts, frames and display size on MS-DOS. 29* Display: MS-DOS Display. Fonts, frames and display size on MS-DOS.
29* Files: MS-DOS File Names. File name conventions on MS-DOS. 30* Files: MS-DOS File Names. File name conventions on MS-DOS.
30* Text and Binary:: Text files on MS-DOS use CRLF to separate lines. 31* Text and Binary:: Text files on MS-DOS use CRLF to separate lines.
@@ -35,8 +36,28 @@ Windows version.
35* Windows System Menu:: Controlling what the ALT key does. 36* Windows System Menu:: Controlling what the ALT key does.
36@end menu 37@end menu
37 38
38@node MS-DOS Input 39@node MS-DOS Keyboard
39@section Keyboard and Mouse on MS-DOS 40@section Keyboard Usage on MS-DOS
41
42@kindex DEL @r{(MS-DOS)}
43@kindex BS @r{(MS-DOS)}
44 The key that is called @key{DEL} in Emacs (because that's how it is
45designated on most workstations) is known as @key{BS} (backspace) on a
46PC. That is why the PC-specific terminal initialization remaps the
47@key{BS} key to act as @key{DEL}; the @key{DELETE} key is remapped to act
48as @kbd{C-d} for the same reasons.
49
50@kindex C-g @r{(MS-DOS)}
51@kindex C-BREAK @r{(MS-DOS)}
52@cindex quitting on MS-DOS
53 Emacs built for MS-DOS recognizes @kbd{C-@key{BREAK}} as a quit
54character, just like @kbd{C-g}. This is because Emacs cannot detect
55that you have typed @kbd{C-g} until it is ready for more input. As a
56consequence, you cannot use @kbd{C-g} to stop a running command
57(@pxref{Quitting}). By contrast, @kbd{C-@key{BREAK}} @emph{is} detected
58as soon as you type it (as @kbd{C-g} is on other systems), so it can be
59used to stop a running command and for emergency escape
60(@pxref{Emergency Escape}).
40 61
41@cindex Meta (under MS-DOS) 62@cindex Meta (under MS-DOS)
42@cindex Hyper (under MS-DOS) 63@cindex Hyper (under MS-DOS)
@@ -68,25 +89,8 @@ following line into your @file{_emacs} file:
68(define-key function-key-map [kp-enter] [?\C-j]) 89(define-key function-key-map [kp-enter] [?\C-j])
69@end smallexample 90@end smallexample
70 91
71@kindex DEL @r{(MS-DOS)} 92@node MS-DOS Mouse
72@kindex BS @r{(MS-DOS)} 93@section Mouse Usage on MS-DOS
73 The key that is called @key{DEL} in Emacs (because that's how it is
74designated on most workstations) is known as @key{BS} (backspace) on a
75PC. That is why the PC-specific terminal initialization remaps the
76@key{BS} key to act as @key{DEL}; the @key{DEL} key is remapped to act
77as @kbd{C-d} for the same reasons.
78
79@kindex C-g @r{(MS-DOS)}
80@kindex C-BREAK @r{(MS-DOS)}
81@cindex quitting on MS-DOS
82 Emacs built for MS-DOS recognizes @kbd{C-@key{BREAK}} as a quit
83character, just like @kbd{C-g}. This is because Emacs cannot detect
84that you have typed @kbd{C-g} until it is ready for more input. As a
85consequence, you cannot use @kbd{C-g} to stop a running command
86(@pxref{Quitting}). By contrast, @kbd{C-@key{BREAK}} @emph{is} detected
87as soon as you type it (as @kbd{C-g} is on other systems), so it can be
88used to stop a running command and for emergency escape
89(@pxref{Emergency Escape}).
90 94
91@cindex mouse support under MS-DOS 95@cindex mouse support under MS-DOS
92 Emacs on MS-DOS supports a mouse (on the default terminal only). 96 Emacs on MS-DOS supports a mouse (on the default terminal only).
@@ -281,7 +285,7 @@ only see their short 8+3 aliases.
281 285
282@cindex @env{HOME} directory under MS-DOS 286@cindex @env{HOME} directory under MS-DOS
283 MS-DOS has no notion of home directory, so Emacs on MS-DOS pretends 287 MS-DOS has no notion of home directory, so Emacs on MS-DOS pretends
284that the directory where it is installed is the value of @env{HOME} 288that the directory where it is installed is the value of the @env{HOME}
285environment variable. That is, if your Emacs binary, 289environment variable. That is, if your Emacs binary,
286@file{emacs.exe}, is in the directory @file{c:/utils/emacs/bin}, then 290@file{emacs.exe}, is in the directory @file{c:/utils/emacs/bin}, then
287Emacs acts as if @env{HOME} were set to @samp{c:/utils/emacs}. In 291Emacs acts as if @env{HOME} were set to @samp{c:/utils/emacs}. In
@@ -603,11 +607,11 @@ etc.
603MS-DOS normally doesn't allow use of several codepages in a single 607MS-DOS normally doesn't allow use of several codepages in a single
604session. MS-DOS was designed to load a single codepage at system 608session. MS-DOS was designed to load a single codepage at system
605startup, and require you to reboot in order to change 609startup, and require you to reboot in order to change
606it@footnote{Normally, one particular codepage is burnt into the display 610it@footnote{Normally, one particular codepage is burnt into the
607memory, while other codepages can be installed by modifying system 611display memory, while other codepages can be installed by modifying
608configuration files, such as @file{CONFIG.SYS}, and rebooting. While 612system configuration files, such as @file{CONFIG.SYS}, and rebooting.
609third-party software is known to exist that allows to change the 613While there is third-party software that allows changing the codepage
610codepage without rebooting, we describe here how a stock MS-DOS system 614without rebooting, we describe here how a stock MS-DOS system
611behaves.}. Much the same limitation applies when you run DOS 615behaves.}. Much the same limitation applies when you run DOS
612executables on other systems such as MS-Windows. 616executables on other systems such as MS-Windows.
613 617
@@ -749,7 +753,7 @@ asynchronous invocation on other platforms
749the @kbd{M-x eshell} command. This invokes the Eshell package that 753the @kbd{M-x eshell} command. This invokes the Eshell package that
750implements a Posix-like shell entirely in Emacs Lisp. 754implements a Posix-like shell entirely in Emacs Lisp.
751 755
752 By contrast, Emacs compiled as native Windows application 756 By contrast, Emacs compiled as a native Windows application
753@strong{does} support asynchronous subprocesses. @xref{Windows 757@strong{does} support asynchronous subprocesses. @xref{Windows
754Processes}. 758Processes}.
755 759
@@ -782,7 +786,7 @@ the @code{dired-listing-switches} variable. The options that work are
782@node Windows Processes 786@node Windows Processes
783@section Subprocesses on Windows 9X/ME and Windows NT/2K 787@section Subprocesses on Windows 9X/ME and Windows NT/2K
784 788
785Emacs compiled as a native Windows application (as opposed to the DOS 789 Emacs compiled as a native Windows application (as opposed to the DOS
786version) includes full support for asynchronous subprocesses. 790version) includes full support for asynchronous subprocesses.
787In the Windows version, synchronous and asynchronous subprocesses work 791In the Windows version, synchronous and asynchronous subprocesses work
788fine on both 792fine on both
diff --git a/man/programs.texi b/man/programs.texi
index 67b19c2e5e4..f884e019d22 100644
--- a/man/programs.texi
+++ b/man/programs.texi
@@ -73,6 +73,7 @@ and you can select it by typing @kbd{M-x @var{l}-mode @key{RET}}.
73@cindex Metafont mode 73@cindex Metafont mode
74@cindex Modula2 mode 74@cindex Modula2 mode
75@cindex Prolog mode 75@cindex Prolog mode
76@cindex Python mode
76@cindex Simula mode 77@cindex Simula mode
77@cindex VHDL mode 78@cindex VHDL mode
78@cindex M4 mode 79@cindex M4 mode
@@ -84,7 +85,7 @@ variant of Lisp) and the Scheme-based DSSSL expression language, Ada,
84ASM, AWK, C, C++, Delphi (Object Pascal), Fortran (free format and fixed 85ASM, AWK, C, C++, Delphi (Object Pascal), Fortran (free format and fixed
85format), Icon, IDL (CORBA), IDLWAVE, Java, Metafont (@TeX{}'s 86format), Icon, IDL (CORBA), IDLWAVE, Java, Metafont (@TeX{}'s
86companion for font creation), Modula2, Objective-C, Octave, Pascal, 87companion for font creation), Modula2, Objective-C, Octave, Pascal,
87Perl, Pike, PostScript, Prolog, Simula, Tcl, and VHDL. There is 88Perl, Pike, PostScript, Prolog, Python, Simula, Tcl, and VHDL. There is
88also a major mode for makefiles, called Makefile mode. An alternative 89also a major mode for makefiles, called Makefile mode. An alternative
89mode for Perl is called CPerl mode. Modes are available for the 90mode for Perl is called CPerl mode. Modes are available for the
90scripting languages of the common GNU and Unix shells, VMS DCL, and 91scripting languages of the common GNU and Unix shells, VMS DCL, and
@@ -241,6 +242,9 @@ which puts point at the beginning and mark at the end of the current
241defun. This is the easiest way to get ready to kill the defun in 242defun. This is the easiest way to get ready to kill the defun in
242order to move it to a different place in the file. If you use the 243order to move it to a different place in the file. If you use the
243command while point is between defuns, it uses the following defun. 244command while point is between defuns, it uses the following defun.
245Successive uses of @kbd{C-M-h}, or using it in Transient Mark mode
246when the mark is active, includes an additional defun in the region
247each time.
244 248
245 In C mode, @kbd{C-M-h} runs the function @code{c-mark-function}, 249 In C mode, @kbd{C-M-h} runs the function @code{c-mark-function},
246which is almost the same as @code{mark-defun}; the difference is that 250which is almost the same as @code{mark-defun}; the difference is that
@@ -375,7 +379,7 @@ whitespace at the beginning of the line, @key{TAB} puts it at the end of
375that whitespace; otherwise, @key{TAB} keeps point fixed with respect to 379that whitespace; otherwise, @key{TAB} keeps point fixed with respect to
376the characters around it. 380the characters around it.
377 381
378 Use @kbd{C-q @key{TAB}} to insert a tab at point. 382 Use @kbd{C-q @key{TAB}} to insert a tab character at point.
379 383
380@kindex C-j 384@kindex C-j
381@findex newline-and-indent 385@findex newline-and-indent
@@ -384,12 +388,13 @@ the characters around it.
384followed by a @key{TAB}. @kbd{C-j} at the end of a line creates a 388followed by a @key{TAB}. @kbd{C-j} at the end of a line creates a
385blank line and then gives it the appropriate indentation. 389blank line and then gives it the appropriate indentation.
386 390
387 @key{TAB} indents lines that start within a parenthetical grouping 391 @key{TAB} indents a line that starts within a parenthetical grouping
388each under the preceding line (or the text after the parenthesis). 392under the preceding line within the grouping, or the text after the
389Therefore, if you manually give one of these lines a nonstandard 393parenthesis. Therefore, if you manually give one of these lines a
390indentation, the lines below will tend to follow it. This behavior is 394nonstandard indentation, the lines below will tend to follow it. This
391convenient in cases where you have overridden the standard result of 395behavior is convenient in cases where you have overridden the standard
392@key{TAB} because you find it unaesthetic for a particular line. 396result of @key{TAB} because you find it unaesthetic for a particular
397line.
393 398
394 Remember that an open-parenthesis, open-brace or other opening delimiter 399 Remember that an open-parenthesis, open-brace or other opening delimiter
395at the left margin is assumed by Emacs (including the indentation routines) 400at the left margin is assumed by Emacs (including the indentation routines)
@@ -586,10 +591,11 @@ example,
586 591
587@noindent 592@noindent
588specifies an explicit choice for Java mode, and the default @samp{gnu} 593specifies an explicit choice for Java mode, and the default @samp{gnu}
589style for the other C-like modes. This variable takes effect when you 594style for the other C-like modes. (These settings are actually the
590select one of the C-like major modes; thus, if you specify a new 595defaults.) This variable takes effect when you select one of the
591default style for Java mode, you can make it take effect in an 596C-like major modes; thus, if you specify a new default style for Java
592existing Java mode buffer by typing @kbd{M-x java-mode} there. 597mode, you can make it take effect in an existing Java mode buffer by
598typing @kbd{M-x java-mode} there.
593 599
594 The @code{gnu} style specifies the formatting recommended by the GNU 600 The @code{gnu} style specifies the formatting recommended by the GNU
595Project for C; it is the default, so as to encourage use of our 601Project for C; it is the default, so as to encourage use of our
@@ -712,8 +718,10 @@ at or after point and the mark.
712use @kbd{C-M-@@} (@code{mark-sexp}), which sets mark at the same place 718use @kbd{C-M-@@} (@code{mark-sexp}), which sets mark at the same place
713that @kbd{C-M-f} would move to. @kbd{C-M-@@} takes arguments like 719that @kbd{C-M-f} would move to. @kbd{C-M-@@} takes arguments like
714@kbd{C-M-f}. In particular, a negative argument is useful for putting 720@kbd{C-M-f}. In particular, a negative argument is useful for putting
715the mark at the beginning of the previous balanced expression. 721the mark at the beginning of the previous balanced expression. The
716The alias @kbd{C-M-@key{SPC}} is equivalent to @kbd{C-M-@@}. 722alias @kbd{C-M-@key{SPC}} is equivalent to @kbd{C-M-@@}. If you use
723this command repeatedly, or in Transient Mark mode whenever the mark
724is active, it extends the region by one sexp each time.
717 725
718 In languages that use infix operators, such as C, it is not possible 726 In languages that use infix operators, such as C, it is not possible
719to recognize all balanced expressions as such because there can be 727to recognize all balanced expressions as such because there can be
@@ -1066,9 +1074,10 @@ use in your program.
1066@kindex C-h S 1074@kindex C-h S
1067 For C, Lisp, and other languages that have documentation in Info, 1075 For C, Lisp, and other languages that have documentation in Info,
1068you can use @kbd{C-h S} (@code{info-lookup-symbol}) to view the Info 1076you can use @kbd{C-h S} (@code{info-lookup-symbol}) to view the Info
1069documentation for a symbol. You specify the symbol with the 1077documentation for a symbol used in the program. You specify the
1070minibuffer; the default is the symbol appearing in the buffer at 1078symbol with the minibuffer; the default is the symbol appearing in the
1071point. 1079buffer at point. For example, in C mode this looks for the symbol in
1080the C Library Manual.
1072 1081
1073 The major mode determines where to look for documentation for the 1082 The major mode determines where to look for documentation for the
1074symbol---which Info files to look in, and which indices to search. 1083symbol---which Info files to look in, and which indices to search.
@@ -1316,7 +1325,9 @@ symbol names.
1316 The character @kbd{M-@key{TAB}} runs a command to complete the 1325 The character @kbd{M-@key{TAB}} runs a command to complete the
1317partial symbol before point against the set of meaningful symbol 1326partial symbol before point against the set of meaningful symbol
1318names. This command inserts at point any additional characters that 1327names. This command inserts at point any additional characters that
1319it can determine from the partial name. 1328it can determine from the partial name. (If your window manager
1329defines @kbd{M-@key{TAB}} to switch windows, you can type this Emacs
1330command as @kbd{@key{ESC} @key{TAB}}.)
1320 1331
1321 If the partial name in the buffer has multiple possible completions 1332 If the partial name in the buffer has multiple possible completions
1322that differ in the very next character, so that it is impossible to 1333that differ in the very next character, so that it is impossible to
@@ -1513,10 +1524,10 @@ With prefix argument @var{n}, move @var{n} times.
1513 1524
1514 In C mode and related modes, certain printing characters are 1525 In C mode and related modes, certain printing characters are
1515``electric''---in addition to inserting themselves, they also reindent 1526``electric''---in addition to inserting themselves, they also reindent
1516the current line and may insert newlines. This feature is controlled by 1527the current line, and optionally also insert newlines. The
1517the variable @code{c-auto-newline}. The ``electric'' characters are 1528``electric'' characters are @kbd{@{}, @kbd{@}}, @kbd{:}, @kbd{#},
1518@kbd{@{}, @kbd{@}}, @kbd{:}, @kbd{#}, @kbd{;}, @kbd{,}, @kbd{<}, 1529@kbd{;}, @kbd{,}, @kbd{<}, @kbd{>}, @kbd{/}, @kbd{*}, @kbd{(}, and
1519@kbd{>}, @kbd{/}, @kbd{*}, @kbd{(}, and @kbd{)}. 1530@kbd{)}.
1520 1531
1521 Electric characters insert newlines only when the @dfn{auto-newline} 1532 Electric characters insert newlines only when the @dfn{auto-newline}
1522feature is enabled (indicated by @samp{/a} in the mode line after the 1533feature is enabled (indicated by @samp{/a} in the mode line after the
diff --git a/man/sending.texi b/man/sending.texi
index a1564d4fc01..bb1ac2864ac 100644
--- a/man/sending.texi
+++ b/man/sending.texi
@@ -496,13 +496,15 @@ edit.
496 496
497@findex mail-complete 497@findex mail-complete
498@kindex M-TAB @r{(Mail mode)} 498@kindex M-TAB @r{(Mail mode)}
499 While editing a header field that contains mailing addresses, such as 499 While editing a header field that contains mailing addresses, such
500@samp{To:}, @samp{CC:} and @samp{BCC:}, you can complete a mailing 500as @samp{To:}, @samp{CC:} and @samp{BCC:}, you can complete a mailing
501address by typing @kbd{M-@key{TAB}} (@code{mail-complete}). It inserts 501address by typing @kbd{M-@key{TAB}} (@code{mail-complete}). It
502the full name corresponding to the address, if it can determine the full 502inserts the full name corresponding to the address, if it can
503name. The variable @code{mail-complete-style} controls whether to insert 503determine the full name. The variable @code{mail-complete-style}
504the full name, and what style to use, as in @code{mail-from-style} 504controls whether to insert the full name, and what style to use, as in
505(@pxref{Mail Headers}). 505@code{mail-from-style} (@pxref{Mail Headers}). (If your window
506manager defines @kbd{M-@key{TAB}} to switch windows, you can type this
507Emacs command as @kbd{@key{ESC} @key{TAB}}.)
506 508
507 For completion purposes, the valid mailing addresses are taken to be 509 For completion purposes, the valid mailing addresses are taken to be
508the local users' names plus your personal mail aliases. You can 510the local users' names plus your personal mail aliases. You can
diff --git a/man/text.texi b/man/text.texi
index 8eaa6178a8d..7b262e11abe 100644
--- a/man/text.texi
+++ b/man/text.texi
@@ -852,10 +852,12 @@ paragraph-indent-minor-mode} to enter an equivalent minor mode, for
852instance during mail composition. 852instance during mail composition.
853 853
854@kindex M-TAB @r{(Text mode)} 854@kindex M-TAB @r{(Text mode)}
855 Text mode, and all the modes based on it, define @kbd{M-@key{TAB}} as 855 Text mode, and all the modes based on it, define @kbd{M-@key{TAB}}
856the command @code{ispell-complete-word}, which performs completion of 856as the command @code{ispell-complete-word}, which performs completion
857the partial word in the buffer before point, using the spelling 857of the partial word in the buffer before point, using the spelling
858dictionary as the space of possible words. @xref{Spelling}. 858dictionary as the space of possible words. @xref{Spelling}. If your
859window manager defines @kbd{M-@key{TAB}} to switch windows, you can
860type this Emacs command as @kbd{@key{ESC} @key{TAB}}.
859 861
860@vindex text-mode-hook 862@vindex text-mode-hook
861 Entering Text mode runs the hook @code{text-mode-hook}. Other major 863 Entering Text mode runs the hook @code{text-mode-hook}. Other major
diff --git a/man/trouble.texi b/man/trouble.texi
index 142560c1fe8..ac9697eeeb5 100644
--- a/man/trouble.texi
+++ b/man/trouble.texi
@@ -57,7 +57,7 @@ successive @kbd{C-g} characters to get out of a search
57like @kbd{C-g}. The reason is that it is not feasible, on MS-DOS, to 57like @kbd{C-g}. The reason is that it is not feasible, on MS-DOS, to
58recognize @kbd{C-g} while a command is running, between interactions 58recognize @kbd{C-g} while a command is running, between interactions
59with the user. By contrast, it @emph{is} feasible to recognize 59with the user. By contrast, it @emph{is} feasible to recognize
60@kbd{C-@key{BREAK}} at all times. @xref{MS-DOS Input}. 60@kbd{C-@key{BREAK}} at all times. @xref{MS-DOS Keyboard}.
61 61
62@findex keyboard-quit 62@findex keyboard-quit
63 @kbd{C-g} works by setting the variable @code{quit-flag} to @code{t} 63 @kbd{C-g} works by setting the variable @code{quit-flag} to @code{t}
@@ -66,9 +66,9 @@ frequently and quits if it is non-@code{nil}. @kbd{C-g} is only
66actually executed as a command if you type it while Emacs is waiting for 66actually executed as a command if you type it while Emacs is waiting for
67input. In that case, the command it runs is @code{keyboard-quit}. 67input. In that case, the command it runs is @code{keyboard-quit}.
68 68
69 If you quit with @kbd{C-g} a second time before the first @kbd{C-g} is 69 On a text terminal, if you quit with @kbd{C-g} a second time before
70recognized, you activate the ``emergency escape'' feature and return to 70the first @kbd{C-g} is recognized, you activate the ``emergency
71the shell. @xref{Emergency Escape}. 71escape'' feature and return to the shell. @xref{Emergency Escape}.
72 72
73@cindex NFS and quitting 73@cindex NFS and quitting
74 There may be times when you cannot quit. When Emacs is waiting for 74 There may be times when you cannot quit. When Emacs is waiting for
@@ -237,11 +237,11 @@ back to top level. @xref{Recursive Edit}.
237@node Screen Garbled 237@node Screen Garbled
238@subsection Garbage on the Screen 238@subsection Garbage on the Screen
239 239
240 If the data on the screen looks wrong, the first thing to do is see 240 If the text on a text terminal looks wrong, the first thing to do is
241whether the text is really wrong. Type @kbd{C-l} to redisplay the 241see whether it is wrong in the buffer. Type @kbd{C-l} to redisplay
242entire screen. If the screen appears correct after this, the problem 242the entire screen. If the screen appears correct after this, the
243was entirely in the previous screen update. (Otherwise, see the following 243problem was entirely in the previous screen update. (Otherwise, see
244section.) 244the following section.)
245 245
246 Display updating problems often result from an incorrect termcap entry 246 Display updating problems often result from an incorrect termcap entry
247for the terminal you are using. The file @file{etc/TERMS} in the Emacs 247for the terminal you are using. The file @file{etc/TERMS} in the Emacs
diff --git a/man/windows.texi b/man/windows.texi
index 0d90a3b2e0c..092a678901b 100644
--- a/man/windows.texi
+++ b/man/windows.texi
@@ -109,15 +109,15 @@ scroll bar, the mode line of the split window is side by side with
109your click. 109your click.
110 110
111@vindex truncate-partial-width-windows 111@vindex truncate-partial-width-windows
112 When a window is less than the full width, text lines too long to fit are 112 When a window is less than the full width, text lines too long to
113frequent. Continuing all those lines might be confusing. The variable 113fit are frequent. Continuing all those lines might be confusing, so
114@code{truncate-partial-width-windows} can be set non-@code{nil} to force 114if the variable @code{truncate-partial-width-windows} is
115truncation in all windows less than the full width of the screen, 115non-@code{nil}, that forces truncation in all windows less than the
116independent of the buffer being displayed and its value for 116full width of the screen, independent of the buffer being displayed
117@code{truncate-lines}. @xref{Continuation Lines}.@refill 117and its value for @code{truncate-lines}. @xref{Display Custom}.
118 118
119 Horizontal scrolling is often used in side-by-side windows. 119 Horizontal scrolling is often used in side-by-side windows.
120@xref{Display}. 120@xref{Horizontal Scrolling}.
121 121
122@vindex split-window-keep-point 122@vindex split-window-keep-point
123 If @code{split-window-keep-point} is non-@code{nil}, the default, 123 If @code{split-window-keep-point} is non-@code{nil}, the default,
diff --git a/src/ChangeLog b/src/ChangeLog
index d2afed264eb..089a3f3a694 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,116 @@
12005-02-17 Andreas Schwab <schwab@suse.de>
2
3 * xfns.c (hack_wm_protocols): Use correct type for last parameter
4 of XGetWindowProperty to avoid aliasing issues.
5 (Fx_window_property): Likewise.
6
7 * xselect.c (Fx_disown_selection_internal): Use union of struct
8 input_event and struct selection_input_event to avoid aliasing
9 issues.
10
11 * xterm.c (handle_one_xevent): Use union of struct input_event and
12 struct selection_input_event to avoid aliasing issues.
13 (SET_SAVED_MENU_EVENT): Adapt reference to inev.
14
152005-02-17 Kim F. Storm <storm@cua.dk>
16
17 * dispextern.h (enum it_method): New enum.
18 (GET_FROM_*): Its members.
19 (struct it): Change member method from function pointer to enum.
20
21 * xdisp.c (check_it, init_from_display_pos, handle_stop)
22 (setup_for_ellipsis, handle_single_display_spec)
23 (handle_composition_prop, next_overlay_string)
24 (get_overlay_strings, reseat_1, reseat_to_string)
25 (next_element_from_ellipsis, BUFFER_POS_REACHED_P)
26 (in_display_vector_p, display_line, get_next_display_element):
27 Change it->method from function pointer to enum.
28 (get_next_element): New array to map it->method to function.
29 (get_next_display_element): Use it.
30 (set_iterator_to_next): Use switch instead of if/else chain.
31
322005-02-15 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
33
34 * w32select.c: Summary: Thorough rework to implement Unicode
35 clipboard operations and delayed rendering.
36
37 Drop last_clipboard_text and related code, keep track of
38 ownership via clipboard_owner instead. Drop old #if0
39 sections.
40
41 (DEFAULT_LCID, ANSICP, OEMCP, QUNICODE, QANSICP, QOEMCP)
42 (clipboard_owner, modifying_clipboard, cfg_coding_system)
43 (cfg_codepage, cfg_lcid, cfg_clipboard_type, current_text)
44 (current_coding_system, current_requires_encoding)
45 (current_num_nls, current_clipboard_type, current_lcid): New
46 static variables.
47
48 (convert_to_handle_as_ascii, convert_to_handle_as_coded)
49 (render, render_all, run_protected, lisp_error_handler)
50 (owner_callback, create_owner, setup_config)
51 (enum_locale_callback, cp_from_locale, coding_from_cp): New
52 local functions.
53
54 (term_w32select, globals_of_w32select): New global functions.
55
56 (Fw32_set_clipboard_data): Ignore parameter FRAME, use
57 clipboard_owner instead. Use delayed rendering and provide
58 all text formats. Provide CF_LOCALE if necessary.
59
60 (Fw32_get_clipboard_data): Handle CF_UNICODETEXT and
61 CF_LOCALE. Fall back to CF_TEXT, if CF_UNICODETEXT is not
62 available. Force DOS line-ends for decoding.
63
64 (Fx_selection_exists_p): Handle CF_UNICODETEXT.
65
66 (syms_of_w32select): Init and register new variables.
67
68 * w32.h: Add prototypes for globals_of_w32select and
69 term_w32select. Make the neighboring K&R declarations into
70 prototypes, too.
71
72 * emacs.c: Include w32.h to get function prototypes.
73 (main): Call globals_of_w32select.
74
75 * w32.c (term_ntproc): Call term_w32select.
76
77 * s/ms-w32.h: Guard MSC-specific #pragmas with an #ifdef.
78
792005-02-16 Kim F. Storm <storm@cua.dk>
80
81 * xdisp.c (BUFFER_POS_REACHED_P): Return true if pos reached and
82 at end of display vector.
83
842005-02-15 Richard M. Stallman <rms@gnu.org>
85
86 * xdisp.c (get_next_display_element): Fix escape-glyph criterion
87 for mode and header lines.
88
89 * lread.c (syms_of_lread) <user-init-file>: Doc fix.
90
91 * keymap.h (describe_map_tree): Change decl.
92
93 * keyboard.c (command_loop_1): Always use safe_run_hooks
94 to run Qdeferred_action_function.
95
96 * keymap.c (describe_map_tree): New arg MENTION_SHADOW. Calls changed.
97 (describe_map, describe_vector): Likewise. When it's 1,
98 don't omit shadowed bindings, instead mark them as shadowed.
99
100 * doc.c (Fsubstitute_command_keys): Compute list of shadowing maps
101 for describe_map_tree. Pass 1 for MENTION_SHADOW.
102
103 * data.c (Fsetq_default): Allow no arg case.
104
1052005-02-14 Kenichi Handa <handa@m17n.org>
106
107 * coding.c (encode_coding_string): Always return a unibyte string.
108 If NOCOPY is nonzero and there's no need of encoding, make STR
109 unibyte directly.
110
111 * xselect.c (lisp_data_to_selection_data): If OBJ is a non-ASCII
112 multibyte string, signal an error instead of aborting.
113
12005-02-12 Dan Nicolaescu <dann@ics.uci.edu> 1142005-02-12 Dan Nicolaescu <dann@ics.uci.edu>
2 115
3 * keyboard.c: If HAVE_FCNTL_H include fcntl.h. 116 * keyboard.c: If HAVE_FCNTL_H include fcntl.h.
diff --git a/src/data.c b/src/data.c
index c8b540cc4cc..a78ff68c7e4 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1458,7 +1458,7 @@ for this variable. */)
1458 return value; 1458 return value;
1459} 1459}
1460 1460
1461DEFUN ("setq-default", Fsetq_default, Ssetq_default, 2, UNEVALLED, 0, 1461DEFUN ("setq-default", Fsetq_default, Ssetq_default, 0, UNEVALLED, 0,
1462 doc: /* Set the default value of variable VAR to VALUE. 1462 doc: /* Set the default value of variable VAR to VALUE.
1463VAR, the variable name, is literal (not evaluated); 1463VAR, the variable name, is literal (not evaluated);
1464VALUE is an expression: it is evaluated and its value returned. 1464VALUE is an expression: it is evaluated and its value returned.
@@ -1470,7 +1470,7 @@ More generally, you can use multiple variables and values, as in
1470This sets each VAR's default value to the corresponding VALUE. 1470This sets each VAR's default value to the corresponding VALUE.
1471The VALUE for the Nth VAR can refer to the new default values 1471The VALUE for the Nth VAR can refer to the new default values
1472of previous VARs. 1472of previous VARs.
1473usage: (setq-default VAR VALUE [VAR VALUE...]) */) 1473usage: (setq-default [VAR VALUE...]) */)
1474 (args) 1474 (args)
1475 Lisp_Object args; 1475 Lisp_Object args;
1476{ 1476{
diff --git a/src/dispextern.h b/src/dispextern.h
index a438b305c35..19f35a744e8 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1780,6 +1780,16 @@ struct it_slice
1780 Lisp_Object height; 1780 Lisp_Object height;
1781}; 1781};
1782 1782
1783enum it_method {
1784 GET_FROM_BUFFER = 0,
1785 GET_FROM_DISPLAY_VECTOR,
1786 GET_FROM_COMPOSITION,
1787 GET_FROM_STRING,
1788 GET_FROM_C_STRING,
1789 GET_FROM_IMAGE,
1790 GET_FROM_STRETCH,
1791 NUM_IT_METHODS
1792};
1783 1793
1784struct it 1794struct it
1785{ 1795{
@@ -1790,9 +1800,8 @@ struct it
1790 /* The window's frame. */ 1800 /* The window's frame. */
1791 struct frame *f; 1801 struct frame *f;
1792 1802
1793 /* Function to call to load this structure with the next display 1803 /* Method to use to load this structure with the next display element. */
1794 element. */ 1804 enum it_method method;
1795 int (* method) P_ ((struct it *it));
1796 1805
1797 /* The next position at which to check for face changes, invisible 1806 /* The next position at which to check for face changes, invisible
1798 text, overlay strings, end of text etc., which see. */ 1807 text, overlay strings, end of text etc., which see. */
diff --git a/src/doc.c b/src/doc.c
index 1bb78c0c376..e1012b97198 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -882,6 +882,9 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int
882 { 882 {
883 struct buffer *oldbuf; 883 struct buffer *oldbuf;
884 int start_idx; 884 int start_idx;
885 /* This is for computing the SHADOWS arg for describe_map_tree. */
886 Lisp_Object active_maps = Fcurrent_active_maps (Qnil);
887 Lisp_Object earlier_maps;
885 888
886 changed = 1; 889 changed = 1;
887 strp += 2; /* skip \{ or \< */ 890 strp += 2; /* skip \{ or \< */
@@ -932,7 +935,13 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int
932 else if (start[-1] == '<') 935 else if (start[-1] == '<')
933 keymap = tem; 936 keymap = tem;
934 else 937 else
935 describe_map_tree (tem, 1, Qnil, Qnil, (char *)0, 1, 0, 0); 938 {
939 /* Get the list of active keymaps that precede this one.
940 If this one's not active, get nil. */
941 earlier_maps = Fcdr (Fmemq (tem, Freverse (active_maps)));
942 describe_map_tree (tem, 1, Fnreverse (earlier_maps),
943 Qnil, (char *)0, 1, 0, 0, 1);
944 }
936 tem = Fbuffer_string (); 945 tem = Fbuffer_string ();
937 Ferase_buffer (); 946 Ferase_buffer ();
938 set_buffer_internal (oldbuf); 947 set_buffer_internal (oldbuf);
diff --git a/src/emacs.c b/src/emacs.c
index becab72ccdd..300f8ef6858 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -42,6 +42,8 @@ Boston, MA 02111-1307, USA. */
42 42
43#ifdef WINDOWSNT 43#ifdef WINDOWSNT
44#include <fcntl.h> 44#include <fcntl.h>
45#include <windows.h> /* just for w32.h */
46#include "w32.h"
45#endif 47#endif
46 48
47#include "lisp.h" 49#include "lisp.h"
@@ -1660,6 +1662,7 @@ main (argc, argv
1660#ifdef HAVE_NTGUI 1662#ifdef HAVE_NTGUI
1661 globals_of_w32fns (); 1663 globals_of_w32fns ();
1662 globals_of_w32menu (); 1664 globals_of_w32menu ();
1665 globals_of_w32select ();
1663#endif /* HAVE_NTGUI */ 1666#endif /* HAVE_NTGUI */
1664 } 1667 }
1665 1668
diff --git a/src/keyboard.c b/src/keyboard.c
index e10b111d12d..32d8a34216b 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1442,7 +1442,7 @@ command_loop_1 ()
1442 resize_echo_area_exactly (); 1442 resize_echo_area_exactly ();
1443 1443
1444 if (!NILP (Vdeferred_action_list)) 1444 if (!NILP (Vdeferred_action_list))
1445 call0 (Vdeferred_action_function); 1445 safe_run_hooks (Qdeferred_action_function);
1446 1446
1447 if (!NILP (Vpost_command_idle_hook) && !NILP (Vrun_hooks)) 1447 if (!NILP (Vpost_command_idle_hook) && !NILP (Vrun_hooks))
1448 { 1448 {
diff --git a/src/keymap.c b/src/keymap.c
index 2977b4dec09..3aaecf1a5d7 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -121,10 +121,11 @@ static void describe_command P_ ((Lisp_Object, Lisp_Object));
121static void describe_translation P_ ((Lisp_Object, Lisp_Object)); 121static void describe_translation P_ ((Lisp_Object, Lisp_Object));
122static void describe_map P_ ((Lisp_Object, Lisp_Object, 122static void describe_map P_ ((Lisp_Object, Lisp_Object,
123 void (*) P_ ((Lisp_Object, Lisp_Object)), 123 void (*) P_ ((Lisp_Object, Lisp_Object)),
124 int, Lisp_Object, Lisp_Object*, int)); 124 int, Lisp_Object, Lisp_Object*, int, int));
125static void describe_vector P_ ((Lisp_Object, Lisp_Object, Lisp_Object, 125static void describe_vector P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
126 void (*) (Lisp_Object, Lisp_Object), int, 126 void (*) (Lisp_Object, Lisp_Object), int,
127 Lisp_Object, Lisp_Object, int *, int, int)); 127 Lisp_Object, Lisp_Object, int *,
128 int, int, int));
128static void silly_event_symbol_error P_ ((Lisp_Object)); 129static void silly_event_symbol_error P_ ((Lisp_Object));
129 130
130/* Keymap object support - constructors and predicates. */ 131/* Keymap object support - constructors and predicates. */
@@ -2853,7 +2854,7 @@ You type Translation\n\
2853 2854
2854 if (!NILP (Vkey_translation_map)) 2855 if (!NILP (Vkey_translation_map))
2855 describe_map_tree (Vkey_translation_map, 0, Qnil, prefix, 2856 describe_map_tree (Vkey_translation_map, 0, Qnil, prefix,
2856 "Key translations", nomenu, 1, 0); 2857 "Key translations", nomenu, 1, 0, 0);
2857 2858
2858 2859
2859 /* Print the (major mode) local map. */ 2860 /* Print the (major mode) local map. */
@@ -2866,7 +2867,7 @@ You type Translation\n\
2866 if (!NILP (start1)) 2867 if (!NILP (start1))
2867 { 2868 {
2868 describe_map_tree (start1, 1, shadow, prefix, 2869 describe_map_tree (start1, 1, shadow, prefix,
2869 "\f\nOverriding Bindings", nomenu, 0, 0); 2870 "\f\nOverriding Bindings", nomenu, 0, 0, 0);
2870 shadow = Fcons (start1, shadow); 2871 shadow = Fcons (start1, shadow);
2871 } 2872 }
2872 else 2873 else
@@ -2887,7 +2888,8 @@ You type Translation\n\
2887 if (!NILP (start1)) 2888 if (!NILP (start1))
2888 { 2889 {
2889 describe_map_tree (start1, 1, shadow, prefix, 2890 describe_map_tree (start1, 1, shadow, prefix,
2890 "\f\n`keymap' Property Bindings", nomenu, 0, 0); 2891 "\f\n`keymap' Property Bindings", nomenu,
2892 0, 0, 0);
2891 shadow = Fcons (start1, shadow); 2893 shadow = Fcons (start1, shadow);
2892 } 2894 }
2893 2895
@@ -2915,7 +2917,8 @@ You type Translation\n\
2915 p += sizeof (" Minor Mode Bindings") - 1; 2917 p += sizeof (" Minor Mode Bindings") - 1;
2916 *p = 0; 2918 *p = 0;
2917 2919
2918 describe_map_tree (maps[i], 1, shadow, prefix, title, nomenu, 0, 0); 2920 describe_map_tree (maps[i], 1, shadow, prefix,
2921 title, nomenu, 0, 0, 0);
2919 shadow = Fcons (maps[i], shadow); 2922 shadow = Fcons (maps[i], shadow);
2920 } 2923 }
2921 2924
@@ -2925,23 +2928,23 @@ You type Translation\n\
2925 { 2928 {
2926 if (EQ (start1, XBUFFER (buffer)->keymap)) 2929 if (EQ (start1, XBUFFER (buffer)->keymap))
2927 describe_map_tree (start1, 1, shadow, prefix, 2930 describe_map_tree (start1, 1, shadow, prefix,
2928 "\f\nMajor Mode Bindings", nomenu, 0, 0); 2931 "\f\nMajor Mode Bindings", nomenu, 0, 0, 0);
2929 else 2932 else
2930 describe_map_tree (start1, 1, shadow, prefix, 2933 describe_map_tree (start1, 1, shadow, prefix,
2931 "\f\n`local-map' Property Bindings", 2934 "\f\n`local-map' Property Bindings",
2932 nomenu, 0, 0); 2935 nomenu, 0, 0, 0);
2933 2936
2934 shadow = Fcons (start1, shadow); 2937 shadow = Fcons (start1, shadow);
2935 } 2938 }
2936 } 2939 }
2937 2940
2938 describe_map_tree (current_global_map, 1, shadow, prefix, 2941 describe_map_tree (current_global_map, 1, shadow, prefix,
2939 "\f\nGlobal Bindings", nomenu, 0, 1); 2942 "\f\nGlobal Bindings", nomenu, 0, 1, 0);
2940 2943
2941 /* Print the function-key-map translations under this prefix. */ 2944 /* Print the function-key-map translations under this prefix. */
2942 if (!NILP (Vfunction_key_map)) 2945 if (!NILP (Vfunction_key_map))
2943 describe_map_tree (Vfunction_key_map, 0, Qnil, prefix, 2946 describe_map_tree (Vfunction_key_map, 0, Qnil, prefix,
2944 "\f\nFunction key map translations", nomenu, 1, 0); 2947 "\f\nFunction key map translations", nomenu, 1, 0, 0);
2945 2948
2946 UNGCPRO; 2949 UNGCPRO;
2947 return Qnil; 2950 return Qnil;
@@ -2962,17 +2965,21 @@ You type Translation\n\
2962 so print strings and vectors differently. 2965 so print strings and vectors differently.
2963 2966
2964 If ALWAYS_TITLE is nonzero, print the title even if there are no maps 2967 If ALWAYS_TITLE is nonzero, print the title even if there are no maps
2965 to look through. */ 2968 to look through.
2969
2970 If MENTION_SHADOW is nonzero, then when something is shadowed by SHADOW,
2971 don't omit it; instead, mention it but say it is shadowed. */
2966 2972
2967void 2973void
2968describe_map_tree (startmap, partial, shadow, prefix, title, nomenu, transl, 2974describe_map_tree (startmap, partial, shadow, prefix, title, nomenu, transl,
2969 always_title) 2975 always_title, mention_shadow)
2970 Lisp_Object startmap, shadow, prefix; 2976 Lisp_Object startmap, shadow, prefix;
2971 int partial; 2977 int partial;
2972 char *title; 2978 char *title;
2973 int nomenu; 2979 int nomenu;
2974 int transl; 2980 int transl;
2975 int always_title; 2981 int always_title;
2982 int mention_shadow;
2976{ 2983{
2977 Lisp_Object maps, orig_maps, seen, sub_shadows; 2984 Lisp_Object maps, orig_maps, seen, sub_shadows;
2978 struct gcpro gcpro1, gcpro2, gcpro3; 2985 struct gcpro gcpro1, gcpro2, gcpro3;
@@ -3074,7 +3081,7 @@ key binding\n\
3074 3081
3075 describe_map (Fcdr (elt), prefix, 3082 describe_map (Fcdr (elt), prefix,
3076 transl ? describe_translation : describe_command, 3083 transl ? describe_translation : describe_command,
3077 partial, sub_shadows, &seen, nomenu); 3084 partial, sub_shadows, &seen, nomenu, mention_shadow);
3078 3085
3079 skip: ; 3086 skip: ;
3080 } 3087 }
@@ -3154,7 +3161,8 @@ describe_translation (definition, args)
3154 PARTIAL, SHADOW, NOMENU are as in `describe_map_tree' above. */ 3161 PARTIAL, SHADOW, NOMENU are as in `describe_map_tree' above. */
3155 3162
3156static void 3163static void
3157describe_map (map, prefix, elt_describer, partial, shadow, seen, nomenu) 3164describe_map (map, prefix, elt_describer, partial, shadow,
3165 seen, nomenu, mention_shadow)
3158 register Lisp_Object map; 3166 register Lisp_Object map;
3159 Lisp_Object prefix; 3167 Lisp_Object prefix;
3160 void (*elt_describer) P_ ((Lisp_Object, Lisp_Object)); 3168 void (*elt_describer) P_ ((Lisp_Object, Lisp_Object));
@@ -3162,6 +3170,7 @@ describe_map (map, prefix, elt_describer, partial, shadow, seen, nomenu)
3162 Lisp_Object shadow; 3170 Lisp_Object shadow;
3163 Lisp_Object *seen; 3171 Lisp_Object *seen;
3164 int nomenu; 3172 int nomenu;
3173 int mention_shadow;
3165{ 3174{
3166 Lisp_Object tail, definition, event; 3175 Lisp_Object tail, definition, event;
3167 Lisp_Object tem; 3176 Lisp_Object tem;
@@ -3191,9 +3200,10 @@ describe_map (map, prefix, elt_describer, partial, shadow, seen, nomenu)
3191 || CHAR_TABLE_P (XCAR (tail))) 3200 || CHAR_TABLE_P (XCAR (tail)))
3192 describe_vector (XCAR (tail), 3201 describe_vector (XCAR (tail),
3193 prefix, Qnil, elt_describer, partial, shadow, map, 3202 prefix, Qnil, elt_describer, partial, shadow, map,
3194 (int *)0, 0, 1); 3203 (int *)0, 0, 1, mention_shadow);
3195 else if (CONSP (XCAR (tail))) 3204 else if (CONSP (XCAR (tail)))
3196 { 3205 {
3206 int this_shadowed = 0;
3197 event = XCAR (XCAR (tail)); 3207 event = XCAR (XCAR (tail));
3198 3208
3199 /* Ignore bindings whose "prefix" are not really valid events. 3209 /* Ignore bindings whose "prefix" are not really valid events.
@@ -3222,7 +3232,13 @@ describe_map (map, prefix, elt_describer, partial, shadow, seen, nomenu)
3222 if (!NILP (shadow)) 3232 if (!NILP (shadow))
3223 { 3233 {
3224 tem = shadow_lookup (shadow, kludge, Qt); 3234 tem = shadow_lookup (shadow, kludge, Qt);
3225 if (!NILP (tem)) continue; 3235 if (!NILP (tem))
3236 {
3237 if (mention_shadow)
3238 this_shadowed = 1;
3239 else
3240 continue;
3241 }
3226 } 3242 }
3227 3243
3228 tem = Flookup_key (map, kludge, Qt); 3244 tem = Flookup_key (map, kludge, Qt);
@@ -3242,6 +3258,13 @@ describe_map (map, prefix, elt_describer, partial, shadow, seen, nomenu)
3242 elt_describer will take care of spacing out far enough 3258 elt_describer will take care of spacing out far enough
3243 for alignment purposes. */ 3259 for alignment purposes. */
3244 (*elt_describer) (definition, Qnil); 3260 (*elt_describer) (definition, Qnil);
3261
3262 if (this_shadowed)
3263 {
3264 SET_PT (PT - 1);
3265 insert_string (" (binding currently shadowed)");
3266 SET_PT (PT + 1);
3267 }
3245 } 3268 }
3246 else if (EQ (XCAR (tail), Qkeymap)) 3269 else if (EQ (XCAR (tail), Qkeymap))
3247 { 3270 {
@@ -3280,7 +3303,7 @@ DESCRIBER is the output function used; nil means use `princ'. */)
3280 specbind (Qstandard_output, Fcurrent_buffer ()); 3303 specbind (Qstandard_output, Fcurrent_buffer ());
3281 CHECK_VECTOR_OR_CHAR_TABLE (vector); 3304 CHECK_VECTOR_OR_CHAR_TABLE (vector);
3282 describe_vector (vector, Qnil, describer, describe_vector_princ, 0, 3305 describe_vector (vector, Qnil, describer, describe_vector_princ, 0,
3283 Qnil, Qnil, (int *)0, 0, 0); 3306 Qnil, Qnil, (int *)0, 0, 0, 0);
3284 3307
3285 return unbind_to (count, Qnil); 3308 return unbind_to (count, Qnil);
3286} 3309}
@@ -3323,7 +3346,8 @@ DESCRIBER is the output function used; nil means use `princ'. */)
3323static void 3346static void
3324describe_vector (vector, prefix, args, elt_describer, 3347describe_vector (vector, prefix, args, elt_describer,
3325 partial, shadow, entire_map, 3348 partial, shadow, entire_map,
3326 indices, char_table_depth, keymap_p) 3349 indices, char_table_depth, keymap_p,
3350 mention_shadow)
3327 register Lisp_Object vector; 3351 register Lisp_Object vector;
3328 Lisp_Object prefix, args; 3352 Lisp_Object prefix, args;
3329 void (*elt_describer) P_ ((Lisp_Object, Lisp_Object)); 3353 void (*elt_describer) P_ ((Lisp_Object, Lisp_Object));
@@ -3333,6 +3357,7 @@ describe_vector (vector, prefix, args, elt_describer,
3333 int *indices; 3357 int *indices;
3334 int char_table_depth; 3358 int char_table_depth;
3335 int keymap_p; 3359 int keymap_p;
3360 int mention_shadow;
3336{ 3361{
3337 Lisp_Object definition; 3362 Lisp_Object definition;
3338 Lisp_Object tem2; 3363 Lisp_Object tem2;
@@ -3377,6 +3402,7 @@ describe_vector (vector, prefix, args, elt_describer,
3377 3402
3378 for (i = from; i < to; i++) 3403 for (i = from; i < to; i++)
3379 { 3404 {
3405 int this_shadowed = 0;
3380 int range_beg, range_end; 3406 int range_beg, range_end;
3381 Lisp_Object val; 3407 Lisp_Object val;
3382 3408
@@ -3412,7 +3438,13 @@ describe_vector (vector, prefix, args, elt_describer,
3412 3438
3413 tem = shadow_lookup (shadow, kludge, Qt); 3439 tem = shadow_lookup (shadow, kludge, Qt);
3414 3440
3415 if (!NILP (tem)) continue; 3441 if (!NILP (tem))
3442 {
3443 if (mention_shadow)
3444 this_shadowed = 1;
3445 else
3446 continue;
3447 }
3416 } 3448 }
3417 3449
3418 /* Ignore this definition if it is shadowed by an earlier 3450 /* Ignore this definition if it is shadowed by an earlier
@@ -3477,6 +3509,13 @@ describe_vector (vector, prefix, args, elt_describer,
3477 elt_describer will take care of spacing out far enough 3509 elt_describer will take care of spacing out far enough
3478 for alignment purposes. */ 3510 for alignment purposes. */
3479 (*elt_describer) (definition, args); 3511 (*elt_describer) (definition, args);
3512
3513 if (this_shadowed)
3514 {
3515 SET_PT (PT - 1);
3516 insert_string (" (binding currently shadowed)");
3517 SET_PT (PT + 1);
3518 }
3480 } 3519 }
3481 3520
3482 if (CHAR_TABLE_P (vector) && ! NILP (XCHAR_TABLE (vector)->defalt)) 3521 if (CHAR_TABLE_P (vector) && ! NILP (XCHAR_TABLE (vector)->defalt))
diff --git a/src/keymap.h b/src/keymap.h
index 214ba605c76..e50a62c8aa5 100644
--- a/src/keymap.h
+++ b/src/keymap.h
@@ -37,7 +37,7 @@ extern Lisp_Object access_keymap P_ ((Lisp_Object, Lisp_Object, int, int, int));
37extern Lisp_Object get_keyelt P_ ((Lisp_Object, int)); 37extern Lisp_Object get_keyelt P_ ((Lisp_Object, int));
38extern Lisp_Object get_keymap P_ ((Lisp_Object, int, int)); 38extern Lisp_Object get_keymap P_ ((Lisp_Object, int, int));
39extern void describe_map_tree P_ ((Lisp_Object, int, Lisp_Object, Lisp_Object, 39extern void describe_map_tree P_ ((Lisp_Object, int, Lisp_Object, Lisp_Object,
40 char *, int, int, int)); 40 char *, int, int, int, int));
41extern int current_minor_maps P_ ((Lisp_Object **, Lisp_Object **)); 41extern int current_minor_maps P_ ((Lisp_Object **, Lisp_Object **));
42extern void initial_define_key P_ ((Lisp_Object, int, char *)); 42extern void initial_define_key P_ ((Lisp_Object, int, char *));
43extern void initial_define_lispy_key P_ ((Lisp_Object, char *, char *)); 43extern void initial_define_lispy_key P_ ((Lisp_Object, char *, char *));
diff --git a/src/lread.c b/src/lread.c
index ccd8909b971..709db3bf29e 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -3998,8 +3998,8 @@ as a function. */);
3998 3998
3999 DEFVAR_LISP ("user-init-file", &Vuser_init_file, 3999 DEFVAR_LISP ("user-init-file", &Vuser_init_file,
4000 doc: /* File name, including directory, of user's initialization file. 4000 doc: /* File name, including directory, of user's initialization file.
4001If the file loaded had extension `.elc' and there was a corresponding `.el' 4001If the file loaded had extension `.elc', and the corresponding source file
4002file, this variable contains the name of the .el file, suitable for use 4002exists, this variable contains the name of source file, suitable for use
4003by functions like `custom-save-all' which edit the init file. */); 4003by functions like `custom-save-all' which edit the init file. */);
4004 Vuser_init_file = Qnil; 4004 Vuser_init_file = Qnil;
4005 4005
diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h
index 09d31ed2e04..503c8547c69 100644
--- a/src/s/ms-w32.h
+++ b/src/s/ms-w32.h
@@ -477,8 +477,10 @@ extern char *get_emacs_configuration_options (void);
477 must include config.h to pick up this pragma. */ 477 must include config.h to pick up this pragma. */
478 478
479/* Names must be < 8 bytes */ 479/* Names must be < 8 bytes */
480#ifdef _MSC_VER
480#pragma data_seg("EMDATA") 481#pragma data_seg("EMDATA")
481#pragma bss_seg("EMBSS") 482#pragma bss_seg("EMBSS")
483#endif
482 484
483/* #define FULL_DEBUG */ 485/* #define FULL_DEBUG */
484/* #define EMACSDEBUG */ 486/* #define EMACSDEBUG */
diff --git a/src/w32.c b/src/w32.c
index 7b54924d736..cdc41a8c772 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -3884,6 +3884,8 @@ term_ntproc ()
3884 /* shutdown the socket interface if necessary */ 3884 /* shutdown the socket interface if necessary */
3885 term_winsock (); 3885 term_winsock ();
3886#endif 3886#endif
3887
3888 term_w32select ();
3887} 3889}
3888 3890
3889void 3891void
diff --git a/src/w32.h b/src/w32.h
index cce1f094363..79a78a5a544 100644
--- a/src/w32.h
+++ b/src/w32.h
@@ -122,16 +122,18 @@ extern void reset_standard_handles (int in, int out,
122/* Return the string resource associated with KEY of type TYPE. */ 122/* Return the string resource associated with KEY of type TYPE. */
123extern LPBYTE w32_get_resource (char * key, LPDWORD type); 123extern LPBYTE w32_get_resource (char * key, LPDWORD type);
124 124
125extern void init_ntproc (); 125extern void init_ntproc (void);
126extern void term_ntproc (); 126extern void term_ntproc (void);
127extern void globals_of_w32 (); 127extern void globals_of_w32 (void);
128extern void syms_of_w32term (); 128extern void syms_of_w32term (void);
129extern void syms_of_w32fns (); 129extern void syms_of_w32fns (void);
130extern void globals_of_w32fns (); 130extern void globals_of_w32fns (void);
131extern void syms_of_w32select (); 131extern void syms_of_w32select (void);
132extern void syms_of_w32menu (); 132extern void globals_of_w32select (void);
133extern void globals_of_w32menu (); 133extern void term_w32select (void);
134extern void syms_of_fontset (); 134extern void syms_of_w32menu (void);
135extern void globals_of_w32menu (void);
136extern void syms_of_fontset (void);
135 137
136#endif /* EMACS_W32_H */ 138#endif /* EMACS_W32_H */
137 139
diff --git a/src/w32select.c b/src/w32select.c
index af3d477f876..478774663c8 100644
--- a/src/w32select.c
+++ b/src/w32select.c
@@ -1,5 +1,5 @@
1/* Selection processing for Emacs on the Microsoft W32 API. 1/* Selection processing for Emacs on the Microsoft W32 API.
2 Copyright (C) 1993, 1994 Free Software Foundation. 2 Copyright (C) 1993, 1994, 2004 Free Software Foundation.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
@@ -18,261 +18,744 @@ 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/* Written by Kevin Gallo */ 21/* Written by Kevin Gallo, Benjamin Riefenstahl */
22 22
23
24/*
25 * Notes on usage of selection-coding-system and
26 * next-selection-coding-system on MS Windows:
27 *
28 * The selection coding system variables apply only to the version of
29 * the clipboard data that is closest in type, i.e. when a 16-bit
30 * Unicode coding system is given, they apply to he Unicode clipboard
31 * (CF_UNICODETEXT), when a well-known console codepage is given, they
32 * apply to the console version of the clipboard data (CF_OEMTEXT),
33 * else they apply to the normal 8-bit text clipboard (CF_TEXT).
34 *
35 * When pasting (getting data from the OS), the clipboard format that
36 * matches the {next-}selection-coding-system is retrieved. If
37 * Unicode is requested, but not available, 8-bit text (CF_TEXT) is
38 * used. In all other cases the OS will transparently convert
39 * formats, so no other fallback is needed.
40 *
41 * When copying or cutting (sending data to the OS), the data is
42 * announced and stored internally, but only actually rendered on
43 * request. The requester determines the format provided. The
44 * {next-}selection-coding-system is only used, when its corresponding
45 * clipboard type matches the type requested.
46 *
47 * Scenarios to use the facilities for customizing the selection
48 * coding system are:
49 *
50 * ;; Generally use KOI8-R instead of the russian MS codepage for
51 * ;; the 8-bit clipboard.
52 * (set-selection-coding-system 'koi8-r-dos)
53 *
54 * Or
55 *
56 * ;; Create a special clipboard copy function that uses codepage
57 * ;; 1253 (Greek) to copy Greek text to a specific non-Unicode
58 * ;; application.
59 * (defun greek-copy (beg end)
60 * (interactive "r")
61 * (set-next-selection-coding-system 'cp1253-dos)
62 * (copy-region-as-kill beg end))
63 * (global-set-key "\C-c\C-c" 'greek-copy)
64 */
65
66/*
67 * Ideas for further directions:
68 *
69 * The encoding and decoding routines could be moved to Lisp code
70 * similar to how xselect.c does it (using well-known routine names
71 * for the delayed rendering). If the definition of which clipboard
72 * types should be supported is also moved to Lisp, functionality
73 * could be expanded to CF_HTML, CF_RTF and maybe other types.
74 */
75
23#include <config.h> 76#include <config.h>
24#include "lisp.h" 77#include "lisp.h"
25#include "w32term.h" /* for all of the w32 includes */ 78#include "w32term.h" /* for all of the w32 includes */
26#include "dispextern.h" /* frame.h seems to want this */ 79#include "w32heap.h" /* os_subtype */
27#include "keyboard.h"
28#include "frame.h" /* Need this to get the X window of selected_frame */
29#include "blockinput.h" 80#include "blockinput.h"
30#include "buffer.h" 81#include "keyboard.h" /* cmd_error_internal() */
31#include "charset.h" 82#include "charset.h"
32#include "coding.h" 83#include "coding.h"
33#include "composite.h" 84#include "composite.h"
34 85
86
87static HGLOBAL convert_to_handle_as_ascii (void);
88static HGLOBAL convert_to_handle_as_coded (Lisp_Object coding_system);
89static Lisp_Object render (Lisp_Object oformat);
90static Lisp_Object render_locale (void);
91static Lisp_Object render_all (void);
92static void run_protected (Lisp_Object (*code) (), Lisp_Object arg);
93static Lisp_Object lisp_error_handler (Lisp_Object error);
94static LRESULT CALLBACK owner_callback (HWND win, UINT msg,
95 WPARAM wp, LPARAM lp);
96static HWND create_owner (void);
97
98static void setup_config (void);
99static BOOL WINAPI enum_locale_callback (/*const*/ char* loc_string);
100static UINT cp_from_locale (LCID lcid, UINT format);
101static Lisp_Object coding_from_cp (UINT codepage);
102
103
104/* A remnant from X11: Symbol for the CLIPBORD selection type. Other
105 selections are not used on Windows, so we don't need symbols for
106 PRIMARY and SECONDARY. */
35Lisp_Object QCLIPBOARD; 107Lisp_Object QCLIPBOARD;
36 108
37/* Coding system for communicating with other Windows programs via the 109/* Coding system for communicating with other programs via the
38 clipboard. */ 110 clipboard. */
39static Lisp_Object Vselection_coding_system; 111static Lisp_Object Vselection_coding_system;
40 112
41/* Coding system for the next communicating with other Windows programs. */ 113/* Coding system for the next communication with other programs. */
42static Lisp_Object Vnext_selection_coding_system; 114static Lisp_Object Vnext_selection_coding_system;
43 115
44/* Sequence number, used where possible to detect when we are pasting 116/* Internal pseudo-constants, initialized in globals_of_w32select()
45 our own text. */ 117 based on current system parameters. */
46static DWORD last_clipboard_sequence_number; 118static LCID DEFAULT_LCID;
47extern ClipboardSequence_Proc clipboard_sequence_fn; 119static UINT ANSICP, OEMCP;
48 120static Lisp_Object QUNICODE, QANSICP, QOEMCP;
49/* The last text we put into the clipboard. This is used when the OS 121
50 does not support sequence numbers (NT4, 95). It is undesirable to 122/* A hidden window just for the clipboard management. */
51 use data put on the clipboard by Emacs because the clipboard data 123static HWND clipboard_owner;
52 could be MULEtilated by inappropriately chosen 124/* A flag to tell WM_DESTROYCLIPBOARD who is to blame this time (just
53 (next-)selection-coding-system. For this reason, we must store the 125 checking GetClipboardOwner() doesn't work, sadly). */
54 text *after* it was encoded/Unix-to-DOS-converted. */ 126static int modifying_clipboard = 0;
55static unsigned char *last_clipboard_text = NULL; 127
56static size_t clipboard_storage_size = 0; 128/* Configured transfer parameters, based on the last inspection of
57 129 selection-coding-system. */
58#if 0 130static Lisp_Object cfg_coding_system;
59DEFUN ("w32-open-clipboard", Fw32_open_clipboard, Sw32_open_clipboard, 0, 1, 0, 131static UINT cfg_codepage;
60 doc: /* This opens the clipboard with the given frame pointer. */) 132static LCID cfg_lcid;
61 (frame) 133static UINT cfg_clipboard_type;
62 Lisp_Object frame; 134
135/* The current state for delayed rendering. */
136static Lisp_Object current_text;
137static Lisp_Object current_coding_system;
138static int current_requires_encoding, current_num_nls;
139static UINT current_clipboard_type;
140static LCID current_lcid;
141
142#if TRACE
143#define ONTRACE(stmt) stmt
144#else
145#define ONTRACE(stmt) /*stmt*/
146#endif
147
148
149/* This function assumes that there is no multibyte character in
150 current_text, so we can short-cut encoding. */
151
152static HGLOBAL
153convert_to_handle_as_ascii (void)
63{ 154{
64 BOOL ok = FALSE; 155 HGLOBAL htext = NULL;
156 int nbytes;
157 int truelen;
158 unsigned char *src;
159 unsigned char *dst;
65 160
66 if (!NILP (frame)) 161 ONTRACE (fprintf (stderr, "convert_to_handle_as_ascii\n"));
67 CHECK_LIVE_FRAME (frame);
68 162
69 BLOCK_INPUT; 163 nbytes = SBYTES (current_text) + 1;
164 src = SDATA (current_text);
70 165
71 ok = OpenClipboard ((!NILP (frame) && FRAME_W32_P (XFRAME (frame))) ? FRAME_W32_WINDOW (XFRAME (frame)) : NULL); 166 /* We need to add to the size the number of LF chars where we have
167 to insert CR chars (the standard CF_TEXT clipboard format uses
168 CRLF line endings, while Emacs uses just LF internally). */
72 169
73 UNBLOCK_INPUT; 170 truelen = nbytes + current_num_nls;
171
172 if ((htext = GlobalAlloc (GMEM_MOVEABLE | GMEM_DDESHARE, truelen)) == NULL)
173 return NULL;
74 174
75 return (ok ? frame : Qnil); 175 if ((dst = (unsigned char *) GlobalLock (htext)) == NULL)
176 {
177 GlobalFree (htext);
178 return NULL;
179 }
180
181 /* convert to CRLF line endings expected by clipboard */
182 while (1)
183 {
184 unsigned char *next;
185 /* copy next line or remaining bytes including '\0' */
186 next = _memccpy (dst, src, '\n', nbytes);
187 if (next)
188 {
189 /* copied one line ending with '\n' */
190 int copied = next - dst;
191 nbytes -= copied;
192 src += copied;
193 /* insert '\r' before '\n' */
194 next[-1] = '\r';
195 next[0] = '\n';
196 dst = next + 1;
197 }
198 else
199 /* copied remaining partial line -> now finished */
200 break;
201 }
202
203 GlobalUnlock (htext);
204
205 return htext;
76} 206}
77 207
78DEFUN ("w32-empty-clipboard", Fw32_empty_clipboard, 208/* This function assumes that there are multibyte or NUL characters in
79 Sw32_empty_clipboard, 0, 0, 0, 209 current_text, or that we need to construct Unicode. It runs the
80 doc: /* Empty the clipboard. 210 text through the encoding machinery. */
81Assigns ownership of the clipboard to the window which opened it. */) 211
82 () 212static HGLOBAL
213convert_to_handle_as_coded (Lisp_Object coding_system)
83{ 214{
84 BOOL ok = FALSE; 215 HGLOBAL htext = NULL, htext2;
216 int nbytes;
217 unsigned char *src;
218 unsigned char *dst = NULL;
219 int bufsize;
220 struct coding_system coding;
221 Lisp_Object string = Qnil;
222
223 ONTRACE (fprintf (stderr, "convert_to_handle_as_coded: %s\n",
224 SDATA (SYMBOL_NAME (coding_system))));
225
226 setup_coding_system (Fcheck_coding_system (coding_system), &coding);
227 coding.src_multibyte = 1;
228 coding.dst_multibyte = 0;
229 /* Need to set COMPOSITION_DISABLED, otherwise Emacs crashes in
230 encode_coding_iso2022 trying to dereference a null pointer. */
231 coding.composing = COMPOSITION_DISABLED;
232 if (coding.type == coding_type_iso2022)
233 coding.flags |= CODING_FLAG_ISO_SAFE;
234 coding.mode |= CODING_MODE_LAST_BLOCK;
235 /* Force DOS line-ends. */
236 coding.eol_type = CODING_EOL_CRLF;
237
238 if (SYMBOLP (coding.pre_write_conversion)
239 && !NILP (Ffboundp (coding.pre_write_conversion)))
240 string = run_pre_post_conversion_on_str (current_text, &coding, 1);
241 else
242 string = current_text;
243
244 nbytes = SBYTES (string);
245 src = SDATA (string);
85 246
86 BLOCK_INPUT; 247 bufsize = encoding_buffer_size (&coding, nbytes) +2;
248 htext = GlobalAlloc (GMEM_MOVEABLE | GMEM_DDESHARE, bufsize);
87 249
88 ok = EmptyClipboard (); 250 if (htext != NULL)
251 dst = (unsigned char *) GlobalLock (htext);
89 252
90 UNBLOCK_INPUT; 253 if (dst != NULL)
254 {
255 encode_coding (&coding, src, dst, nbytes, bufsize-2);
256 /* Add the string terminator. Add two NULs in case we are
257 producing Unicode here. */
258 dst[coding.produced] = dst[coding.produced+1] = '\0';
259 }
91 260
92 return (ok ? Qt : Qnil); 261 if (dst != NULL)
262 GlobalUnlock (htext);
263
264 if (htext != NULL)
265 {
266 /* Shrink data block to actual size. */
267 htext2 = GlobalReAlloc (htext, coding.produced+2,
268 GMEM_MOVEABLE | GMEM_DDESHARE);
269 if (htext2 != NULL) htext = htext2;
270 }
271
272 return htext;
273}
274
275static Lisp_Object
276render (Lisp_Object oformat)
277{
278 HGLOBAL htext = NULL;
279 UINT format = XFASTINT (oformat);
280
281 ONTRACE (fprintf (stderr, "render\n"));
282
283 if (NILP (current_text))
284 return Qnil;
285
286 if (current_requires_encoding || format == CF_UNICODETEXT)
287 {
288 if (format == current_clipboard_type)
289 htext = convert_to_handle_as_coded (current_coding_system);
290 else
291 switch (format)
292 {
293 case CF_UNICODETEXT:
294 htext = convert_to_handle_as_coded (QUNICODE);
295 break;
296 case CF_TEXT:
297 case CF_OEMTEXT:
298 {
299 Lisp_Object cs;
300 cs = coding_from_cp (cp_from_locale (current_lcid, format));
301 htext = convert_to_handle_as_coded (cs);
302 break;
303 }
304 }
305 }
306 else
307 htext = convert_to_handle_as_ascii ();
308
309 ONTRACE (fprintf (stderr, "render: htext = 0x%08X\n", (unsigned) htext));
310
311 if (htext == NULL)
312 return Qnil;
313
314 if (SetClipboardData (format, htext) == NULL)
315 {
316 GlobalFree(htext);
317 return Qnil;
318 }
319
320 return Qt;
93} 321}
94 322
95DEFUN ("w32-close-clipboard", Fw32_close_clipboard, 323static Lisp_Object
96 Sw32_close_clipboard, 0, 0, 0, 324render_locale (void)
97 doc: /* Close the clipboard. */)
98 ()
99{ 325{
100 BOOL ok = FALSE; 326 HANDLE hlocale = NULL;
327 LCID * lcid_ptr;
328
329 ONTRACE (fprintf (stderr, "render_locale\n"));
330
331 if (current_lcid == LOCALE_NEUTRAL || current_lcid == DEFAULT_LCID)
332 return Qt;
333
334 hlocale = GlobalAlloc (GMEM_MOVEABLE | GMEM_DDESHARE, sizeof (current_lcid));
335 if (hlocale == NULL)
336 return Qnil;
337
338 if ((lcid_ptr = (LCID *) GlobalLock (hlocale)) == NULL)
339 {
340 GlobalFree(hlocale);
341 return Qnil;
342 }
343
344 *lcid_ptr = current_lcid;
345 GlobalUnlock (hlocale);
346
347 if (SetClipboardData (CF_LOCALE, hlocale) == NULL)
348 {
349 GlobalFree(hlocale);
350 return Qnil;
351 }
352
353 return Qt;
354}
355
356/* At the end of the program, we want to ensure that our clipboard
357 data survives us. This code will do that. */
358
359static Lisp_Object
360render_all (void)
361{
362 ONTRACE (fprintf (stderr, "render_all\n"));
363
364 /* According to the docs we should not call OpenClipboard() here,
365 but testing on W2K and working code in other projects shows that
366 it is actually necessary. */
367
368 OpenClipboard (NULL);
369
370 /* There is no usefull means to report errors here, there are none
371 expected anyway, and even if there were errors, they wouldn't do
372 any harm. So we just go ahead and do what has to be done without
373 bothering with error handling. */
374
375 ++modifying_clipboard;
376 EmptyClipboard ();
377 --modifying_clipboard;
378
379 /* For text formats that we don't render here, the OS can use its
380 own translation rules instead, so we don't really need to offer
381 everything. To minimize memory consumption we cover three
382 possible situations based on our primary format as detected from
383 selection-coding-system (see setup_config()):
384
385 - Post CF_TEXT only. Let the OS convert to CF_OEMTEXT and the OS
386 (on NT) or the application (on 9x/Me) convert to
387 CF_UNICODETEXT.
388
389 - Post CF_OEMTEXT only. Similar automatic conversions happen as
390 for CF_TEXT.
391
392 - Post CF_UNICODETEXT + CF_TEXT. 9x itself ignores
393 CF_UNICODETEXT, even though some applications can still handle
394 it.
395
396 Note 1: We render the less capable CF_TEXT *before* the more
397 capable CF_UNICODETEXT, to prevent clobbering through automatic
398 conversions, just in case.
399
400 Note 2: We could check os_subtype here and only render the
401 additional CF_TEXT on 9x/Me. But OTOH with
402 current_clipboard_type == CF_UNICODETEXT we don't involve the
403 automatic conversions anywhere else, so to get consistent
404 results, we probably don't want to rely on it here either. */
405
406 render_locale();
407
408 if (current_clipboard_type == CF_UNICODETEXT)
409 render (make_number (CF_TEXT));
410 render (make_number (current_clipboard_type));
411
412 CloseClipboard ();
413
414 return Qnil;
415}
416
417static void
418run_protected (Lisp_Object (*code) (), Lisp_Object arg)
419{
420 /* FIXME: This works but it doesn't feel right. Too much fiddling
421 with global variables and calling strange looking functions. Is
422 this really the right way to run Lisp callbacks? */
423
424 extern int waiting_for_input;
425 int owfi;
101 426
102 BLOCK_INPUT; 427 BLOCK_INPUT;
103 428
104 ok = CloseClipboard (); 429 /* Fsignal calls abort() if it sees that waiting_for_input is
430 set. */
431 owfi = waiting_for_input;
432 waiting_for_input = 0;
433
434 internal_condition_case_1 (code, arg, Qt, lisp_error_handler);
435
436 waiting_for_input = owfi;
105 437
106 UNBLOCK_INPUT; 438 UNBLOCK_INPUT;
439}
107 440
108 return (ok ? Qt : Qnil); 441static Lisp_Object
442lisp_error_handler (Lisp_Object error)
443{
444 Vsignaling_function = Qnil;
445 cmd_error_internal (error, "Error in delayed clipboard rendering: ");
446 Vinhibit_quit = Qt;
447 return Qt;
109} 448}
110 449
111#endif
112 450
113DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data, 451static LRESULT CALLBACK
114 Sw32_set_clipboard_data, 1, 2, 0, 452owner_callback (HWND win, UINT msg, WPARAM wp, LPARAM lp)
115 doc: /* This sets the clipboard data to the given text. */)
116 (string, frame)
117 Lisp_Object string, frame;
118{ 453{
119 BOOL ok = TRUE; 454 switch (msg)
120 HANDLE htext; 455 {
121 int nbytes; 456 case WM_RENDERFORMAT:
122 int truelen, nlines = 0; 457 ONTRACE (fprintf (stderr, "WM_RENDERFORMAT\n"));
123 unsigned char *src; 458 run_protected (render, make_number (wp));
124 unsigned char *dst; 459 return 0;
460
461 case WM_RENDERALLFORMATS:
462 ONTRACE (fprintf (stderr, "WM_RENDERALLFORMATS\n"));
463 run_protected (render_all, Qnil);
464 return 0;
465
466 case WM_DESTROYCLIPBOARD:
467 if (!modifying_clipboard)
468 {
469 ONTRACE (fprintf (stderr, "WM_DESTROYCLIPBOARD (other)\n"));
470 current_text = Qnil;
471 current_coding_system = Qnil;
472 }
473 else
474 {
475 ONTRACE (fprintf (stderr, "WM_DESTROYCLIPBOARD (self)\n"));
476 }
477 return 0;
125 478
126 CHECK_STRING (string); 479 case WM_DESTROY:
480 if (win == clipboard_owner)
481 clipboard_owner = NULL;
482 break;
483 }
127 484
128 if (!NILP (frame)) 485 return DefWindowProc (win, msg, wp, lp);
129 CHECK_LIVE_FRAME (frame); 486}
130 487
131 BLOCK_INPUT; 488static HWND
489create_owner (void)
490{
491 static const char CLASSNAME[] = "Emacs Clipboard";
492 WNDCLASS wc;
132 493
133 /* Include the terminating NULL character in the source of 494 memset (&wc, 0, sizeof (wc));
134 conversion. */ 495 wc.lpszClassName = CLASSNAME;
135 nbytes = SBYTES (string) + 1; 496 wc.lpfnWndProc = owner_callback;
136 src = SDATA (string); 497 RegisterClass (&wc);
137 dst = src; 498
499 return CreateWindow (CLASSNAME, CLASSNAME, 0, 0, 0, 0, 0, NULL, NULL,
500 NULL, NULL);
501}
502
503/* Called on exit by term_ntproc() in w32.c */
504
505void
506term_w32select (void)
507{
508 /* This is needed to trigger WM_RENDERALLFORMATS. */
509 if (clipboard_owner != NULL)
510 DestroyWindow (clipboard_owner);
511}
138 512
139 /* We need to know how many lines there are, since we need CRLF line 513static void
140 termination for compatibility with other Windows Programs. 514setup_config (void)
141 avoid using strchr because it recomputes the length every time */ 515{
142 while ((dst = memchr (dst, '\n', nbytes - (dst - src))) != NULL) 516 const char *coding_name;
517 const char *cp;
518 char *end;
519 int slen;
520 Lisp_Object new_coding_system;
521
522 CHECK_SYMBOL (Vselection_coding_system);
523
524 /* Check if we have it cached */
525 new_coding_system = NILP (Vnext_selection_coding_system) ?
526 Vselection_coding_system : Vnext_selection_coding_system;
527 if (!NILP (cfg_coding_system)
528 && EQ (cfg_coding_system, new_coding_system))
529 return;
530 cfg_coding_system = new_coding_system;
531
532 /* Set some sensible fallbacks */
533 cfg_codepage = ANSICP;
534 cfg_lcid = LOCALE_NEUTRAL;
535 cfg_clipboard_type = CF_TEXT;
536
537 /* Interpret the coding system symbol name */
538 coding_name = SDATA (SYMBOL_NAME (cfg_coding_system));
539
540 /* "(.*-)?utf-16.*" -> CF_UNICODETEXT */
541 cp = strstr (coding_name, "utf-16");
542 if (cp != NULL && (cp == coding_name || cp[-1] == '-'))
143 { 543 {
144 nlines++; 544 cfg_clipboard_type = CF_UNICODETEXT;
145 dst++; 545 return;
146 } 546 }
147 547
148 { 548 /* "cp[0-9]+.*" or "windows-[0-9]+.*" -> CF_TEXT or CF_OEMTEXT */
149 /* Since we are now handling multilingual text, we must consider 549 slen = strlen (coding_name);
150 encoding text for the clipboard. */ 550 if (slen >= 4 && coding_name[0] == 'c' && coding_name[1] == 'p')
151 int result = string_xstring_p (string); 551 cp = coding_name + 2;
552 else if (slen >= 10 && memcmp (coding_name, "windows-", 8) == 0)
553 cp = coding_name + 8;
554 else
555 return;
556
557 end = (char*)cp;
558 cfg_codepage = strtol (cp, &end, 10);
559
560 /* Error return from strtol() or number of digits < 2 -> Restore the
561 default and drop it. */
562 if (cfg_codepage == 0 || (end-cp) < 2 )
563 {
564 cfg_codepage = ANSICP;
565 return;
566 }
152 567
153 if (result == 0) 568 /* Is it the currently active system default? */
154 { 569 if (cfg_codepage == ANSICP)
155 /* No multibyte character in OBJ. We need not encode it. */ 570 {
571 /* cfg_clipboard_type = CF_TEXT; */
572 return;
573 }
574 if (cfg_codepage == OEMCP)
575 {
576 cfg_clipboard_type = CF_OEMTEXT;
577 return;
578 }
156 579
157 /* Need to know final size after CR chars are inserted (the 580 /* Else determine a suitable locale the hard way. */
158 standard CF_TEXT clipboard format uses CRLF line endings, 581 EnumSystemLocales (enum_locale_callback, LCID_INSTALLED);
159 while Emacs uses just LF internally). */ 582}
160 583
161 truelen = nbytes + nlines; 584static BOOL WINAPI
585enum_locale_callback (/*const*/ char* loc_string)
586{
587 LCID lcid;
588 UINT codepage;
162 589
163 if ((htext = GlobalAlloc (GMEM_MOVEABLE | GMEM_DDESHARE, truelen)) == NULL) 590 lcid = strtoul (loc_string, NULL, 16);
164 goto error;
165 591
166 if ((dst = (unsigned char *) GlobalLock (htext)) == NULL) 592 /* Is the wanted codepage the "ANSI" codepage for this locale? */
167 goto error; 593 codepage = cp_from_locale (lcid, CF_TEXT);
594 if (codepage == cfg_codepage)
595 {
596 cfg_lcid = lcid;
597 cfg_clipboard_type = CF_TEXT;
598 return FALSE; /* Stop enumeration */
599 }
600
601 /* Is the wanted codepage the OEM codepage for this locale? */
602 codepage = cp_from_locale (lcid, CF_OEMTEXT);
603 if (codepage == cfg_codepage)
604 {
605 cfg_lcid = lcid;
606 cfg_clipboard_type = CF_OEMTEXT;
607 return FALSE; /* Stop enumeration */
608 }
168 609
169 /* convert to CRLF line endings expected by clipboard */ 610 return TRUE; /* Continue enumeration */
170 while (1) 611}
171 {
172 unsigned char *next;
173 /* copy next line or remaining bytes including '\0' */
174 next = _memccpy (dst, src, '\n', nbytes);
175 if (next)
176 {
177 /* copied one line ending with '\n' */
178 int copied = next - dst;
179 nbytes -= copied;
180 src += copied;
181 /* insert '\r' before '\n' */
182 next[-1] = '\r';
183 next[0] = '\n';
184 dst = next + 1;
185 }
186 else
187 /* copied remaining partial line -> now finished */
188 break;
189 }
190 612
191 GlobalUnlock (htext); 613static UINT
614cp_from_locale (LCID lcid, UINT format)
615{
616 char buffer[20] = "";
617 UINT variant, cp;
192 618
193 Vlast_coding_system_used = Qraw_text; 619 variant =
194 } 620 format == CF_TEXT ? LOCALE_IDEFAULTANSICODEPAGE : LOCALE_IDEFAULTCODEPAGE;
195 else
196 {
197 /* We must encode contents of OBJ to the selection coding
198 system. */
199 struct coding_system coding;
200 HANDLE htext2;
201 621
202 if (NILP (Vnext_selection_coding_system)) 622 GetLocaleInfo (lcid, variant, buffer, sizeof (buffer));
203 Vnext_selection_coding_system = Vselection_coding_system; 623 cp = strtoul (buffer, NULL, 10);
204 setup_coding_system
205 (Fcheck_coding_system (Vnext_selection_coding_system), &coding);
206 coding.mode |= (CODING_MODE_SAFE_ENCODING | CODING_MODE_LAST_BLOCK);
207 624
208 Vnext_selection_coding_system = Qnil; 625 if (cp == CP_ACP)
626 return ANSICP;
627 else if (cp == CP_OEMCP)
628 return OEMCP;
629 else
630 return cp;
631}
209 632
210 /* We suppress producing escape sequences for composition. */ 633static Lisp_Object
211 coding.common_flags &= ~CODING_ANNOTATION_MASK; 634coding_from_cp (UINT codepage)
212 coding.dst_bytes = SCHARS (string) * 2; 635{
213 if ((htext = GlobalAlloc (GMEM_MOVEABLE | GMEM_DDESHARE, coding.dst_bytes)) == NULL) 636 char buffer[30];
214 goto error; 637 sprintf (buffer, "cp%d-dos", (int) codepage);
215 if ((coding.destination = (unsigned char *) GlobalLock (htext)) == NULL) 638 return intern (buffer);
216 goto error; 639 /* We don't need to check that this coding system exists right here,
217 encode_coding_object (&coding, string, 0, 0, 640 because that is done when the coding system is actually
218 SCHARS (string), SBYTES (string), Qnil); 641 instantiated, i.e. it is passed through Fcheck_coding_system()
219 Vlast_coding_system_used = CODING_ID_NAME (coding.id); 642 there. */
643}
220 644
221 /* If clipboard sequence numbers are not supported, keep a copy for
222 later comparison. */
223 if (!clipboard_sequence_fn)
224 {
225 /* Stash away the data we are about to put into the
226 clipboard, so we could later check inside
227 Fw32_get_clipboard_data whether the clipboard still
228 holds our data. */
229 if (clipboard_storage_size < coding.produced)
230 {
231 clipboard_storage_size = coding.produced + 100;
232 last_clipboard_text = (char *) xrealloc (last_clipboard_text,
233 clipboard_storage_size);
234 }
235 if (last_clipboard_text)
236 memcpy (last_clipboard_text, coding.destination,
237 coding.produced);
238 }
239 645
240 GlobalUnlock (htext); 646DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data,
647 Sw32_set_clipboard_data, 1, 2, 0,
648 doc: /* This sets the clipboard data to the given text. */)
649 (string, ignored)
650 Lisp_Object string, ignored;
651{
652 BOOL ok = TRUE;
653 int nbytes;
654 unsigned char *src;
655 unsigned char *dst;
656 unsigned char *end;
241 657
242 /* Shrink data block to actual size. */ 658 /* This parameter used to be the current frame, but we don't use
243 htext2 = GlobalReAlloc (htext, coding.produced, 659 that any more. */
244 GMEM_MOVEABLE | GMEM_DDESHARE); 660 (void) ignored;
245 if (htext2 != NULL) htext = htext2;
246 }
247 }
248 661
249 if (!OpenClipboard ((!NILP (frame) && FRAME_W32_P (XFRAME (frame))) ? FRAME_W32_WINDOW (XFRAME (frame)) : NULL)) 662 CHECK_STRING (string);
663
664 setup_config ();
665
666 current_text = string;
667 current_coding_system = cfg_coding_system;
668 current_clipboard_type = cfg_clipboard_type;
669 current_lcid = cfg_lcid;
670 current_num_nls = 0;
671 current_requires_encoding = 0;
672
673 BLOCK_INPUT;
674
675 /* Check for non-ASCII characters. While we are at it, count the
676 number of LFs, so we know how many CRs we will have to add later
677 (just in the case where we can use our internal ASCII rendering,
678 see code and comment in convert_to_handle_as_ascii() above). */
679 nbytes = SBYTES (string);
680 src = SDATA (string);
681
682 for (dst = src, end = src+nbytes; dst < end; dst++)
683 {
684 if (*dst == '\n')
685 current_num_nls++;
686 else if (*dst >= 0x80 || *dst == 0)
687 {
688 current_requires_encoding = 1;
689 break;
690 }
691 }
692
693 if (!current_requires_encoding)
694 {
695 /* If all we have is ASCII we don't need to pretend we offer
696 anything fancy. */
697 current_coding_system = Qraw_text;
698 current_clipboard_type = CF_TEXT;
699 current_lcid = LOCALE_NEUTRAL;
700 }
701
702 if (!OpenClipboard (clipboard_owner))
250 goto error; 703 goto error;
251 704
252 ok = EmptyClipboard () && SetClipboardData (CF_TEXT, htext); 705 ++modifying_clipboard;
706 ok = EmptyClipboard ();
707 --modifying_clipboard;
708
709 /* If we have something non-ASCII we may want to set a locale. We
710 do that directly (non-delayed), as it's just a small bit. */
711 if (ok)
712 ok = !NILP(render_locale());
713
714 if (ok)
715 {
716 if (clipboard_owner == NULL)
717 {
718 /* If for some reason we don't have a clipboard_owner, we
719 just set the text format as chosen by the configuration
720 and than forget about the whole thing. */
721 ok = !NILP(render (make_number (current_clipboard_type)));
722 current_text = Qnil;
723 current_coding_system = Qnil;
724 }
725 else
726 {
727 /* Advertise all supported formats so that whatever the
728 requester chooses, only one encoding step needs to be
729 made. This is intentionally different from what we do in
730 the handler for WM_RENDERALLFORMATS. */
731 SetClipboardData (CF_UNICODETEXT, NULL);
732 SetClipboardData (CF_TEXT, NULL);
733 SetClipboardData (CF_OEMTEXT, NULL);
734 }
735 }
253 736
254 CloseClipboard (); 737 CloseClipboard ();
255 738
256 /* Common sense says to read the sequence number inside the 739 /* With delayed rendering we haven't really "used" this coding
257 OpenClipboard/ CloseClipboard block to avoid race conditions 740 system yet, and it's even unclear if we ever will. But this is a
258 where another app puts something on the clipboard straight after 741 way to tell the upper level what we *would* use under ideal
259 us. But experience suggests that the sequence number from the 742 circumstances.
260 SetClipboardData is not allocated until we close the clipboard! 743
261 Since clipboard operations are normally user-driven, the race 744 We don't signal the actually used coding-system later when we
262 condition is probably not going to really happen. */ 745 finally render, because that can happen at any time and we don't
263 if (clipboard_sequence_fn) 746 want to disturb the "foreground" action. */
264 last_clipboard_sequence_number = clipboard_sequence_fn (); 747 if (ok)
748 Vlast_coding_system_used = current_coding_system;
749
750 Vnext_selection_coding_system = Qnil;
265 751
266 if (ok) goto done; 752 if (ok) goto done;
267 753
268 error: 754 error:
269 755
270 ok = FALSE; 756 ok = FALSE;
271 if (htext) GlobalFree (htext); 757 current_text = Qnil;
272 if (last_clipboard_text) 758 current_coding_system = Qnil;
273 *last_clipboard_text = '\0';
274
275 last_clipboard_sequence_number = 0;
276 759
277 done: 760 done:
278 UNBLOCK_INPUT; 761 UNBLOCK_INPUT;
@@ -280,24 +763,52 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data,
280 return (ok ? string : Qnil); 763 return (ok ? string : Qnil);
281} 764}
282 765
766
283DEFUN ("w32-get-clipboard-data", Fw32_get_clipboard_data, 767DEFUN ("w32-get-clipboard-data", Fw32_get_clipboard_data,
284 Sw32_get_clipboard_data, 0, 1, 0, 768 Sw32_get_clipboard_data, 0, 1, 0,
285 doc: /* This gets the clipboard data in text format. */) 769 doc: /* This gets the clipboard data in text format. */)
286 (frame) 770 (ignored)
287 Lisp_Object frame; 771 Lisp_Object ignored;
288{ 772{
289 HANDLE htext; 773 HGLOBAL htext;
290 Lisp_Object ret = Qnil; 774 Lisp_Object ret = Qnil;
775 UINT actual_clipboard_type;
776 int use_configured_coding_system = 1;
777
778 /* This parameter used to be the current frame, but we don't use
779 that any more. */
780 (void) ignored;
291 781
292 if (!NILP (frame)) 782 /* Don't pass our own text from the clipboard (which might be
293 CHECK_LIVE_FRAME (frame); 783 troublesome if the killed text includes null characters). */
784 if (!NILP (current_text))
785 return ret;
786
787 setup_config ();
788 actual_clipboard_type = cfg_clipboard_type;
294 789
295 BLOCK_INPUT; 790 BLOCK_INPUT;
296 791
297 if (!OpenClipboard ((!NILP (frame) && FRAME_W32_P (XFRAME (frame))) ? FRAME_W32_WINDOW (XFRAME (frame)) : NULL)) 792 if (!OpenClipboard (clipboard_owner))
298 goto done; 793 goto done;
299 794
300 if ((htext = GetClipboardData (CF_TEXT)) == NULL) 795 if ((htext = GetClipboardData (actual_clipboard_type)) == NULL)
796 {
797 /* If we want CF_UNICODETEXT but can't get it, the current
798 coding system is useless. OTOH we can still try and decode
799 CF_TEXT based on the locale that the system gives us and that
800 we get down below. */
801 if (actual_clipboard_type == CF_UNICODETEXT)
802 {
803 htext = GetClipboardData (CF_TEXT);
804 if (htext != NULL)
805 {
806 actual_clipboard_type = CF_TEXT;
807 use_configured_coding_system = 0;
808 }
809 }
810 }
811 if (htext == NULL)
301 goto closeclip; 812 goto closeclip;
302 813
303 { 814 {
@@ -310,51 +821,105 @@ DEFUN ("w32-get-clipboard-data", Fw32_get_clipboard_data,
310 if ((src = (unsigned char *) GlobalLock (htext)) == NULL) 821 if ((src = (unsigned char *) GlobalLock (htext)) == NULL)
311 goto closeclip; 822 goto closeclip;
312 823
313 nbytes = strlen (src); 824 /* If the clipboard data contains any non-ascii code, we need to
314 825 decode it with a coding system. */
315 /* If the text in clipboard is identical to what we put there 826 if (actual_clipboard_type == CF_UNICODETEXT)
316 last time w32_set_clipboard_data was called, pretend there's no 827 {
317 data in the clipboard. This is so we don't pass our own text 828 nbytes = lstrlenW ((WCHAR *)src) * 2;
318 from the clipboard (which might be troublesome if the killed 829 require_decoding = 1;
319 text includes null characters). */ 830 }
320 if ((clipboard_sequence_fn 831 else
321 && clipboard_sequence_fn () == last_clipboard_sequence_number) 832 {
322 || (last_clipboard_text 833 int i;
323 && clipboard_storage_size >= nbytes
324 && memcmp(last_clipboard_text, src, nbytes) == 0))
325 goto closeclip;
326 834
327 { 835 nbytes = strlen (src);
328 /* If the clipboard data contains any non-ascii code, we
329 need to decode it. */
330 int i;
331 836
332 for (i = 0; i < nbytes; i++) 837 for (i = 0; i < nbytes; i++)
333 { 838 {
334 if (src[i] >= 0x80) 839 if (src[i] >= 0x80)
335 { 840 {
336 require_decoding = 1; 841 require_decoding = 1;
337 break; 842 break;
338 } 843 }
339 } 844 }
340 } 845 }
341 846
342 if (require_decoding) 847 if (require_decoding)
343 { 848 {
344 struct coding_system coding; 849 struct coding_system coding;
850 Lisp_Object coding_system = Qnil;
851
852 /* `next-selection-coding-system' should override everything,
853 even when the locale passed by the system disagrees. The
854 only exception is when `next-selection-coding-system'
855 requested CF_UNICODETEXT and we couldn't get that. */
856 if (use_configured_coding_system
857 && !NILP (Vnext_selection_coding_system))
858 coding_system = Vnext_selection_coding_system;
859
860 /* If we have CF_TEXT or CF_OEMTEXT, we want to check out
861 CF_LOCALE, too. */
862 else if (actual_clipboard_type != CF_UNICODETEXT)
863 {
864 HGLOBAL hlocale;
865 LCID lcid = DEFAULT_LCID;
866 UINT cp;
867
868 /* Documentation says that the OS always generates
869 CF_LOCALE info automatically, so the locale handle
870 should always be present. Fact is that this is not
871 always true on 9x ;-(. */
872 hlocale = GetClipboardData (CF_LOCALE);
873 if (hlocale != NULL)
874 {
875 const LCID * lcid_ptr;
876 lcid_ptr = (const LCID *) GlobalLock (hlocale);
877 if (lcid_ptr != NULL)
878 {
879 lcid = *lcid_ptr;
880 GlobalUnlock (hlocale);
881 }
882
883 /* 9x has garbage as the sort order (to be exact there
884 is another instance of the language id in the upper
885 word). We don't care about sort order anyway, so
886 we just filter out the unneeded mis-information to
887 avoid irritations. */
888 lcid = MAKELCID (LANGIDFROMLCID (lcid), SORT_DEFAULT);
889 }
890
891 /* If we are using fallback from CF_UNICODETEXT, we can't
892 use the configured coding system. Also we don't want
893 to use it, if the system has supplied us with a locale
894 and it is not just the system default. */
895 if (!use_configured_coding_system || lcid != DEFAULT_LCID)
896 {
897 cp = cp_from_locale (lcid, actual_clipboard_type);
898 /* If it's just our current standard setting anyway,
899 use the coding system that the user has selected.
900 Otherwise create a new spec to match the locale
901 that was specified by the other side or the
902 system. */
903 if (!use_configured_coding_system || cp != cfg_codepage)
904 coding_system = coding_from_cp (cp);
905 }
906 }
907
908 if (NILP (coding_system))
909 coding_system = Vselection_coding_system;
910 Vnext_selection_coding_system = Qnil;
345 911
346 if (NILP (Vnext_selection_coding_system)) 912 setup_coding_system (Fcheck_coding_system (coding_system), &coding);
347 Vnext_selection_coding_system = Vselection_coding_system;
348 setup_coding_system
349 (Fcheck_coding_system (Vnext_selection_coding_system), &coding);
350 coding.src_multibyte = 0; 913 coding.src_multibyte = 0;
351 coding.dst_multibyte = 1; 914 coding.dst_multibyte = 1;
352 Vnext_selection_coding_system = Qnil;
353 coding.mode |= CODING_MODE_LAST_BLOCK; 915 coding.mode |= CODING_MODE_LAST_BLOCK;
354 /* We explicitly disable composition handling because 916 /* We explicitly disable composition handling because
355 selection data should not contain any composition 917 selection data should not contain any composition
356 sequence. */ 918 sequence. */
357 coding.common_flags &= ~CODING_ANNOTATION_MASK; 919 coding.common_flags &= ~CODING_ANNOTATION_MASK;
920 /* Force DOS line-ends. */
921 coding.eol_type = CODING_EOL_CRLF;
922
358 coding.dst_bytes = nbytes * 2; 923 coding.dst_bytes = nbytes * 2;
359 coding.destination = (unsigned char *) xmalloc (coding.dst_bytes); 924 coding.destination = (unsigned char *) xmalloc (coding.dst_bytes);
360 decode_coding_c_string (&coding, src, nbytes, Qnil); 925 decode_coding_c_string (&coding, src, nbytes, Qnil);
@@ -365,10 +930,13 @@ DEFUN ("w32-get-clipboard-data", Fw32_get_clipboard_data,
365 } 930 }
366 else 931 else
367 { 932 {
368 /* Need to know final size after CR chars are removed because we 933 /* FIXME: We may want to repeat the code in this branch for
369 can't change the string size manually, and doing an extra 934 the Unicode case. */
370 copy is silly. Note that we only remove CR when it appears 935
371 as part of CRLF. */ 936 /* Need to know final size after CR chars are removed because
937 we can't change the string size manually, and doing an
938 extra copy is silly. We only remove CR when it appears as
939 part of CRLF. */
372 940
373 truelen = nbytes; 941 truelen = nbytes;
374 dst = src; 942 dst = src;
@@ -445,9 +1013,14 @@ and t is the same as `SECONDARY'. */)
445 1013
446 if (OpenClipboard (NULL)) 1014 if (OpenClipboard (NULL))
447 { 1015 {
448 int format = 0; 1016 UINT format = 0;
449 while (format = EnumClipboardFormats (format)) 1017 setup_config ();
450 if (format == CF_TEXT) 1018 while ((format = EnumClipboardFormats (format)))
1019 /* Check CF_TEXT in addition to cfg_clipboard_type,
1020 because we can fall back on that if CF_UNICODETEXT is
1021 not available. Actually a check for CF_TEXT only
1022 should be enough. */
1023 if (format == cfg_clipboard_type || format == CF_TEXT)
451 { 1024 {
452 val = Qt; 1025 val = Qt;
453 break; 1026 break;
@@ -459,24 +1032,25 @@ and t is the same as `SECONDARY'. */)
459 return Qnil; 1032 return Qnil;
460} 1033}
461 1034
1035/* One-time init. Called in the un-dumped Emacs, but not in the
1036 dumped version. */
1037
462void 1038void
463syms_of_w32select () 1039syms_of_w32select ()
464{ 1040{
465#if 0
466 defsubr (&Sw32_open_clipboard);
467 defsubr (&Sw32_empty_clipboard);
468 defsubr (&Sw32_close_clipboard);
469#endif
470 defsubr (&Sw32_set_clipboard_data); 1041 defsubr (&Sw32_set_clipboard_data);
471 defsubr (&Sw32_get_clipboard_data); 1042 defsubr (&Sw32_get_clipboard_data);
472 defsubr (&Sx_selection_exists_p); 1043 defsubr (&Sx_selection_exists_p);
473 1044
474 DEFVAR_LISP ("selection-coding-system", &Vselection_coding_system, 1045 DEFVAR_LISP ("selection-coding-system", &Vselection_coding_system,
475 doc: /* Coding system for communicating with other programs. 1046 doc: /* Coding system for communicating with other programs.
476When sending or receiving text via cut_buffer, selection, and clipboard, 1047When sending or receiving text via cut_buffer, selection, and
477the text is encoded or decoded by this coding system. 1048clipboard, the text is encoded or decoded by this coding system.
478The default value is `iso-latin-1-dos'. */); 1049The default value is the current system default encoding on 9x/Me and
479 Vselection_coding_system = intern ("iso-latin-1-dos"); 1050`utf-16le-dos' (Unicode) on NT/W2K/XP. */);
1051 /* The actual value is set dynamically in the dumped Emacs, see
1052 below. */
1053 Vselection_coding_system = Qnil;
480 1054
481 DEFVAR_LISP ("next-selection-coding-system", &Vnext_selection_coding_system, 1055 DEFVAR_LISP ("next-selection-coding-system", &Vnext_selection_coding_system,
482 doc: /* Coding system for the next communication with other programs. 1056 doc: /* Coding system for the next communication with other programs.
@@ -487,6 +1061,41 @@ set to nil. */);
487 Vnext_selection_coding_system = Qnil; 1061 Vnext_selection_coding_system = Qnil;
488 1062
489 QCLIPBOARD = intern ("CLIPBOARD"); staticpro (&QCLIPBOARD); 1063 QCLIPBOARD = intern ("CLIPBOARD"); staticpro (&QCLIPBOARD);
1064
1065 cfg_coding_system = Qnil; staticpro (&cfg_coding_system);
1066 current_text = Qnil; staticpro (&current_text);
1067 current_coding_system = Qnil; staticpro (&current_coding_system);
1068
1069 QUNICODE = intern ("utf-16le-dos"); staticpro (&QUNICODE);
1070 QANSICP = Qnil; staticpro (&QANSICP);
1071 QOEMCP = Qnil; staticpro (&QOEMCP);
1072}
1073
1074/* One-time init. Called in the dumped Emacs, but not in the
1075 un-dumped version. */
1076
1077void
1078globals_of_w32select ()
1079{
1080 DEFAULT_LCID = GetUserDefaultLCID ();
1081 /* Drop the sort order from the LCID, so we can compare this with
1082 CF_LOCALE objects that have the same fix on 9x. */
1083 DEFAULT_LCID = MAKELCID (LANGIDFROMLCID (DEFAULT_LCID), SORT_DEFAULT);
1084
1085 ANSICP = GetACP ();
1086 OEMCP = GetOEMCP ();
1087
1088 QANSICP = coding_from_cp (ANSICP);
1089 QOEMCP = coding_from_cp (OEMCP);
1090
1091 if (os_subtype == OS_NT)
1092 Vselection_coding_system = QUNICODE;
1093 else if (inhibit_window_system)
1094 Vselection_coding_system = QOEMCP;
1095 else
1096 Vselection_coding_system = QANSICP;
1097
1098 clipboard_owner = create_owner ();
490} 1099}
491 1100
492/* arch-tag: c96e9724-5eb1-4dad-be07-289f092fd2af 1101/* arch-tag: c96e9724-5eb1-4dad-be07-289f092fd2af
diff --git a/src/xdisp.c b/src/xdisp.c
index a90483aae1e..9aefcf5c9a5 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -830,7 +830,6 @@ static char *decode_mode_spec_coding P_ ((Lisp_Object, char *, int));
830static int invisible_text_between_p P_ ((struct it *, int, int)); 830static int invisible_text_between_p P_ ((struct it *, int, int));
831#endif 831#endif
832 832
833static int next_element_from_ellipsis P_ ((struct it *));
834static void pint2str P_ ((char *, int, int)); 833static void pint2str P_ ((char *, int, int));
835static void pint2hrstr P_ ((char *, int, int)); 834static void pint2hrstr P_ ((char *, int, int));
836static struct text_pos run_window_scroll_functions P_ ((Lisp_Object, 835static struct text_pos run_window_scroll_functions P_ ((Lisp_Object,
@@ -905,6 +904,7 @@ static void reseat_1 P_ ((struct it *, struct text_pos, int));
905static void back_to_previous_visible_line_start P_ ((struct it *)); 904static void back_to_previous_visible_line_start P_ ((struct it *));
906void reseat_at_previous_visible_line_start P_ ((struct it *)); 905void reseat_at_previous_visible_line_start P_ ((struct it *));
907static void reseat_at_next_visible_line_start P_ ((struct it *, int)); 906static void reseat_at_next_visible_line_start P_ ((struct it *, int));
907static int next_element_from_ellipsis P_ ((struct it *));
908static int next_element_from_display_vector P_ ((struct it *)); 908static int next_element_from_display_vector P_ ((struct it *));
909static int next_element_from_string P_ ((struct it *)); 909static int next_element_from_string P_ ((struct it *));
910static int next_element_from_c_string P_ ((struct it *)); 910static int next_element_from_c_string P_ ((struct it *));
@@ -2046,7 +2046,7 @@ static void
2046check_it (it) 2046check_it (it)
2047 struct it *it; 2047 struct it *it;
2048{ 2048{
2049 if (it->method == next_element_from_string) 2049 if (it->method == GET_FROM_STRING)
2050 { 2050 {
2051 xassert (STRINGP (it->string)); 2051 xassert (STRINGP (it->string));
2052 xassert (IT_STRING_CHARPOS (*it) >= 0); 2052 xassert (IT_STRING_CHARPOS (*it) >= 0);
@@ -2054,7 +2054,7 @@ check_it (it)
2054 else 2054 else
2055 { 2055 {
2056 xassert (IT_STRING_CHARPOS (*it) < 0); 2056 xassert (IT_STRING_CHARPOS (*it) < 0);
2057 if (it->method == next_element_from_buffer) 2057 if (it->method == GET_FROM_BUFFER)
2058 { 2058 {
2059 /* Check that character and byte positions agree. */ 2059 /* Check that character and byte positions agree. */
2060 xassert (IT_CHARPOS (*it) == BYTE_TO_CHAR (IT_BYTEPOS (*it))); 2060 xassert (IT_CHARPOS (*it) == BYTE_TO_CHAR (IT_BYTEPOS (*it)));
@@ -2564,7 +2564,7 @@ init_from_display_pos (it, w, pos)
2564 property for an image, the iterator will be set up for that 2564 property for an image, the iterator will be set up for that
2565 image, and we have to undo that setup first before we can 2565 image, and we have to undo that setup first before we can
2566 correct the overlay string index. */ 2566 correct the overlay string index. */
2567 if (it->method == next_element_from_image) 2567 if (it->method == GET_FROM_IMAGE)
2568 pop_it (it); 2568 pop_it (it);
2569 2569
2570 /* We already have the first chunk of overlay strings in 2570 /* We already have the first chunk of overlay strings in
@@ -2587,7 +2587,7 @@ init_from_display_pos (it, w, pos)
2587 it->string = it->overlay_strings[relative_index]; 2587 it->string = it->overlay_strings[relative_index];
2588 xassert (STRINGP (it->string)); 2588 xassert (STRINGP (it->string));
2589 it->current.string_pos = pos->string_pos; 2589 it->current.string_pos = pos->string_pos;
2590 it->method = next_element_from_string; 2590 it->method = GET_FROM_STRING;
2591 } 2591 }
2592 2592
2593#if 0 /* This is bogus because POS not having an overlay string 2593#if 0 /* This is bogus because POS not having an overlay string
@@ -2603,7 +2603,7 @@ init_from_display_pos (it, w, pos)
2603 while (it->sp) 2603 while (it->sp)
2604 pop_it (it); 2604 pop_it (it);
2605 it->current.overlay_string_index = -1; 2605 it->current.overlay_string_index = -1;
2606 it->method = next_element_from_buffer; 2606 it->method = GET_FROM_BUFFER;
2607 if (CHARPOS (pos->pos) == ZV) 2607 if (CHARPOS (pos->pos) == ZV)
2608 it->overlay_strings_at_end_processed_p = 1; 2608 it->overlay_strings_at_end_processed_p = 1;
2609 } 2609 }
@@ -2717,7 +2717,7 @@ handle_stop (it)
2717 { 2717 {
2718 /* Don't check for overlay strings below when set to deliver 2718 /* Don't check for overlay strings below when set to deliver
2719 characters from a display vector. */ 2719 characters from a display vector. */
2720 if (it->method == next_element_from_display_vector) 2720 if (it->method == GET_FROM_DISPLAY_VECTOR)
2721 handle_overlay_change_p = 0; 2721 handle_overlay_change_p = 0;
2722 2722
2723 /* Handle overlay changes. */ 2723 /* Handle overlay changes. */
@@ -3375,7 +3375,7 @@ setup_for_ellipsis (it, len)
3375 /* Remember the current face id in case glyphs specify faces. 3375 /* Remember the current face id in case glyphs specify faces.
3376 IT's face is restored in set_iterator_to_next. */ 3376 IT's face is restored in set_iterator_to_next. */
3377 it->saved_face_id = it->face_id; 3377 it->saved_face_id = it->face_id;
3378 it->method = next_element_from_display_vector; 3378 it->method = GET_FROM_DISPLAY_VECTOR;
3379 it->ellipsis_p = 1; 3379 it->ellipsis_p = 1;
3380} 3380}
3381 3381
@@ -3740,7 +3740,7 @@ handle_single_display_spec (it, spec, object, position,
3740 it->image_id = -1; /* no image */ 3740 it->image_id = -1; /* no image */
3741 it->position = start_pos; 3741 it->position = start_pos;
3742 it->object = NILP (object) ? it->w->buffer : object; 3742 it->object = NILP (object) ? it->w->buffer : object;
3743 it->method = next_element_from_image; 3743 it->method = GET_FROM_IMAGE;
3744 it->face_id = face_id; 3744 it->face_id = face_id;
3745 3745
3746 /* Say that we haven't consumed the characters with 3746 /* Say that we haven't consumed the characters with
@@ -3823,7 +3823,7 @@ handle_single_display_spec (it, spec, object, position,
3823 it->current.overlay_string_index = -1; 3823 it->current.overlay_string_index = -1;
3824 IT_STRING_CHARPOS (*it) = IT_STRING_BYTEPOS (*it) = 0; 3824 IT_STRING_CHARPOS (*it) = IT_STRING_BYTEPOS (*it) = 0;
3825 it->end_charpos = it->string_nchars = SCHARS (it->string); 3825 it->end_charpos = it->string_nchars = SCHARS (it->string);
3826 it->method = next_element_from_string; 3826 it->method = GET_FROM_STRING;
3827 it->stop_charpos = 0; 3827 it->stop_charpos = 0;
3828 it->string_from_display_prop_p = 1; 3828 it->string_from_display_prop_p = 1;
3829 /* Say that we haven't consumed the characters with 3829 /* Say that we haven't consumed the characters with
@@ -3833,7 +3833,7 @@ handle_single_display_spec (it, spec, object, position,
3833 } 3833 }
3834 else if (CONSP (value) && EQ (XCAR (value), Qspace)) 3834 else if (CONSP (value) && EQ (XCAR (value), Qspace))
3835 { 3835 {
3836 it->method = next_element_from_stretch; 3836 it->method = GET_FROM_STRETCH;
3837 it->object = value; 3837 it->object = value;
3838 it->current.pos = it->position = start_pos; 3838 it->current.pos = it->position = start_pos;
3839 } 3839 }
@@ -3844,7 +3844,7 @@ handle_single_display_spec (it, spec, object, position,
3844 it->image_id = lookup_image (it->f, value); 3844 it->image_id = lookup_image (it->f, value);
3845 it->position = start_pos; 3845 it->position = start_pos;
3846 it->object = NILP (object) ? it->w->buffer : object; 3846 it->object = NILP (object) ? it->w->buffer : object;
3847 it->method = next_element_from_image; 3847 it->method = GET_FROM_IMAGE;
3848 3848
3849 /* Say that we haven't consumed the characters with 3849 /* Say that we haven't consumed the characters with
3850 `display' property yet. The call to pop_it in 3850 `display' property yet. The call to pop_it in
@@ -4193,7 +4193,7 @@ handle_composition_prop (it)
4193 4193
4194 if (id >= 0) 4194 if (id >= 0)
4195 { 4195 {
4196 it->method = next_element_from_composition; 4196 it->method = GET_FROM_COMPOSITION;
4197 it->cmp_id = id; 4197 it->cmp_id = id;
4198 it->cmp_len = COMPOSITION_LENGTH (prop); 4198 it->cmp_len = COMPOSITION_LENGTH (prop);
4199 /* For a terminal, draw only the first character of the 4199 /* For a terminal, draw only the first character of the
@@ -4268,7 +4268,7 @@ next_overlay_string (it)
4268 it->current.overlay_string_index = -1; 4268 it->current.overlay_string_index = -1;
4269 SET_TEXT_POS (it->current.string_pos, -1, -1); 4269 SET_TEXT_POS (it->current.string_pos, -1, -1);
4270 it->n_overlay_strings = 0; 4270 it->n_overlay_strings = 0;
4271 it->method = next_element_from_buffer; 4271 it->method = GET_FROM_BUFFER;
4272 4272
4273 /* If we're at the end of the buffer, record that we have 4273 /* If we're at the end of the buffer, record that we have
4274 processed the overlay strings there already, so that 4274 processed the overlay strings there already, so that
@@ -4297,7 +4297,7 @@ next_overlay_string (it)
4297 it->string = it->overlay_strings[i]; 4297 it->string = it->overlay_strings[i];
4298 it->multibyte_p = STRING_MULTIBYTE (it->string); 4298 it->multibyte_p = STRING_MULTIBYTE (it->string);
4299 SET_TEXT_POS (it->current.string_pos, 0, 0); 4299 SET_TEXT_POS (it->current.string_pos, 0, 0);
4300 it->method = next_element_from_string; 4300 it->method = GET_FROM_STRING;
4301 it->stop_charpos = 0; 4301 it->stop_charpos = 0;
4302 } 4302 }
4303 4303
@@ -4562,13 +4562,13 @@ get_overlay_strings (it, charpos)
4562 xassert (STRINGP (it->string)); 4562 xassert (STRINGP (it->string));
4563 it->end_charpos = SCHARS (it->string); 4563 it->end_charpos = SCHARS (it->string);
4564 it->multibyte_p = STRING_MULTIBYTE (it->string); 4564 it->multibyte_p = STRING_MULTIBYTE (it->string);
4565 it->method = next_element_from_string; 4565 it->method = GET_FROM_STRING;
4566 } 4566 }
4567 else 4567 else
4568 { 4568 {
4569 it->string = Qnil; 4569 it->string = Qnil;
4570 it->current.overlay_string_index = -1; 4570 it->current.overlay_string_index = -1;
4571 it->method = next_element_from_buffer; 4571 it->method = GET_FROM_BUFFER;
4572 } 4572 }
4573 4573
4574 CHECK_IT (it); 4574 CHECK_IT (it);
@@ -4946,7 +4946,7 @@ reseat_1 (it, pos, set_stop_p)
4946 IT_STRING_CHARPOS (*it) = -1; 4946 IT_STRING_CHARPOS (*it) = -1;
4947 IT_STRING_BYTEPOS (*it) = -1; 4947 IT_STRING_BYTEPOS (*it) = -1;
4948 it->string = Qnil; 4948 it->string = Qnil;
4949 it->method = next_element_from_buffer; 4949 it->method = GET_FROM_BUFFER;
4950 /* RMS: I added this to fix a bug in move_it_vertically_backward 4950 /* RMS: I added this to fix a bug in move_it_vertically_backward
4951 where it->area continued to relate to the starting point 4951 where it->area continued to relate to the starting point
4952 for the backward motion. Bug report from 4952 for the backward motion. Bug report from
@@ -5012,7 +5012,7 @@ reseat_to_string (it, s, string, charpos, precision, field_width, multibyte)
5012 it->string = string; 5012 it->string = string;
5013 it->s = NULL; 5013 it->s = NULL;
5014 it->end_charpos = it->string_nchars = SCHARS (string); 5014 it->end_charpos = it->string_nchars = SCHARS (string);
5015 it->method = next_element_from_string; 5015 it->method = GET_FROM_STRING;
5016 it->current.string_pos = string_pos (charpos, string); 5016 it->current.string_pos = string_pos (charpos, string);
5017 } 5017 }
5018 else 5018 else
@@ -5034,7 +5034,7 @@ reseat_to_string (it, s, string, charpos, precision, field_width, multibyte)
5034 it->end_charpos = it->string_nchars = strlen (s); 5034 it->end_charpos = it->string_nchars = strlen (s);
5035 } 5035 }
5036 5036
5037 it->method = next_element_from_c_string; 5037 it->method = GET_FROM_C_STRING;
5038 } 5038 }
5039 5039
5040 /* PRECISION > 0 means don't return more than PRECISION characters 5040 /* PRECISION > 0 means don't return more than PRECISION characters
@@ -5065,6 +5065,20 @@ reseat_to_string (it, s, string, charpos, precision, field_width, multibyte)
5065 Iteration 5065 Iteration
5066 ***********************************************************************/ 5066 ***********************************************************************/
5067 5067
5068/* Map enum it_method value to corresponding next_element_from_* function. */
5069
5070static int (* get_next_element[NUM_IT_METHODS]) P_ ((struct it *it)) =
5071{
5072 next_element_from_buffer,
5073 next_element_from_display_vector,
5074 next_element_from_composition,
5075 next_element_from_string,
5076 next_element_from_c_string,
5077 next_element_from_image,
5078 next_element_from_stretch
5079};
5080
5081
5068/* Load IT's display element fields with information about the next 5082/* Load IT's display element fields with information about the next
5069 display element from the current position of IT. Value is zero if 5083 display element from the current position of IT. Value is zero if
5070 end of buffer (or C string) is reached. */ 5084 end of buffer (or C string) is reached. */
@@ -5080,7 +5094,7 @@ get_next_display_element (it)
5080 int success_p; 5094 int success_p;
5081 5095
5082 get_next: 5096 get_next:
5083 success_p = (*it->method) (it); 5097 success_p = (*get_next_element[it->method]) (it);
5084 5098
5085 if (it->what == IT_CHARACTER) 5099 if (it->what == IT_CHARACTER)
5086 { 5100 {
@@ -5114,7 +5128,7 @@ get_next_display_element (it)
5114 it->current.dpvec_index = 0; 5128 it->current.dpvec_index = 0;
5115 it->dpvec_face_id = -1; 5129 it->dpvec_face_id = -1;
5116 it->saved_face_id = it->face_id; 5130 it->saved_face_id = it->face_id;
5117 it->method = next_element_from_display_vector; 5131 it->method = GET_FROM_DISPLAY_VECTOR;
5118 it->ellipsis_p = 0; 5132 it->ellipsis_p = 0;
5119 } 5133 }
5120 else 5134 else
@@ -5139,7 +5153,7 @@ get_next_display_element (it)
5139 else if ((it->c < ' ' 5153 else if ((it->c < ' '
5140 ? (it->area != TEXT_AREA 5154 ? (it->area != TEXT_AREA
5141 /* In mode line, treat \n, \t like other crl chars. */ 5155 /* In mode line, treat \n, \t like other crl chars. */
5142 || (it->c != '\n' 5156 || (it->c != '\t'
5143 && it->glyph_row && it->glyph_row->mode_line_p) 5157 && it->glyph_row && it->glyph_row->mode_line_p)
5144 || (it->c != '\n' && it->c != '\t')) 5158 || (it->c != '\n' && it->c != '\t'))
5145 : (it->multibyte_p 5159 : (it->multibyte_p
@@ -5274,7 +5288,7 @@ get_next_display_element (it)
5274 it->current.dpvec_index = 0; 5288 it->current.dpvec_index = 0;
5275 it->dpvec_face_id = face_id; 5289 it->dpvec_face_id = face_id;
5276 it->saved_face_id = it->face_id; 5290 it->saved_face_id = it->face_id;
5277 it->method = next_element_from_display_vector; 5291 it->method = GET_FROM_DISPLAY_VECTOR;
5278 it->ellipsis_p = 0; 5292 it->ellipsis_p = 0;
5279 goto get_next; 5293 goto get_next;
5280 } 5294 }
@@ -5340,8 +5354,9 @@ set_iterator_to_next (it, reseat_p)
5340 moving the iterator to a new position might set them. */ 5354 moving the iterator to a new position might set them. */
5341 it->start_of_box_run_p = it->end_of_box_run_p = 0; 5355 it->start_of_box_run_p = it->end_of_box_run_p = 0;
5342 5356
5343 if (it->method == next_element_from_buffer) 5357 switch (it->method)
5344 { 5358 {
5359 case GET_FROM_BUFFER:
5345 /* The current display element of IT is a character from 5360 /* The current display element of IT is a character from
5346 current_buffer. Advance in the buffer, and maybe skip over 5361 current_buffer. Advance in the buffer, and maybe skip over
5347 invisible lines that are so because of selective display. */ 5362 invisible lines that are so because of selective display. */
@@ -5354,32 +5369,32 @@ set_iterator_to_next (it, reseat_p)
5354 IT_CHARPOS (*it) += 1; 5369 IT_CHARPOS (*it) += 1;
5355 xassert (IT_BYTEPOS (*it) == CHAR_TO_BYTE (IT_CHARPOS (*it))); 5370 xassert (IT_BYTEPOS (*it) == CHAR_TO_BYTE (IT_CHARPOS (*it)));
5356 } 5371 }
5357 } 5372 break;
5358 else if (it->method == next_element_from_composition) 5373
5359 { 5374 case GET_FROM_COMPOSITION:
5360 xassert (it->cmp_id >= 0 && it ->cmp_id < n_compositions); 5375 xassert (it->cmp_id >= 0 && it->cmp_id < n_compositions);
5361 if (STRINGP (it->string)) 5376 if (STRINGP (it->string))
5362 { 5377 {
5363 IT_STRING_BYTEPOS (*it) += it->len; 5378 IT_STRING_BYTEPOS (*it) += it->len;
5364 IT_STRING_CHARPOS (*it) += it->cmp_len; 5379 IT_STRING_CHARPOS (*it) += it->cmp_len;
5365 it->method = next_element_from_string; 5380 it->method = GET_FROM_STRING;
5366 goto consider_string_end; 5381 goto consider_string_end;
5367 } 5382 }
5368 else 5383 else
5369 { 5384 {
5370 IT_BYTEPOS (*it) += it->len; 5385 IT_BYTEPOS (*it) += it->len;
5371 IT_CHARPOS (*it) += it->cmp_len; 5386 IT_CHARPOS (*it) += it->cmp_len;
5372 it->method = next_element_from_buffer; 5387 it->method = GET_FROM_BUFFER;
5373 } 5388 }
5374 } 5389 break;
5375 else if (it->method == next_element_from_c_string) 5390
5376 { 5391 case GET_FROM_C_STRING:
5377 /* Current display element of IT is from a C string. */ 5392 /* Current display element of IT is from a C string. */
5378 IT_BYTEPOS (*it) += it->len; 5393 IT_BYTEPOS (*it) += it->len;
5379 IT_CHARPOS (*it) += 1; 5394 IT_CHARPOS (*it) += 1;
5380 } 5395 break;
5381 else if (it->method == next_element_from_display_vector) 5396
5382 { 5397 case GET_FROM_DISPLAY_VECTOR:
5383 /* Current display element of IT is from a display table entry. 5398 /* Current display element of IT is from a display table entry.
5384 Advance in the display table definition. Reset it to null if 5399 Advance in the display table definition. Reset it to null if
5385 end reached, and continue with characters from buffers/ 5400 end reached, and continue with characters from buffers/
@@ -5393,11 +5408,11 @@ set_iterator_to_next (it, reseat_p)
5393 if (it->dpvec + it->current.dpvec_index == it->dpend) 5408 if (it->dpvec + it->current.dpvec_index == it->dpend)
5394 { 5409 {
5395 if (it->s) 5410 if (it->s)
5396 it->method = next_element_from_c_string; 5411 it->method = GET_FROM_C_STRING;
5397 else if (STRINGP (it->string)) 5412 else if (STRINGP (it->string))
5398 it->method = next_element_from_string; 5413 it->method = GET_FROM_STRING;
5399 else 5414 else
5400 it->method = next_element_from_buffer; 5415 it->method = GET_FROM_BUFFER;
5401 5416
5402 it->dpvec = NULL; 5417 it->dpvec = NULL;
5403 it->current.dpvec_index = -1; 5418 it->current.dpvec_index = -1;
@@ -5414,9 +5429,9 @@ set_iterator_to_next (it, reseat_p)
5414 /* Recheck faces after display vector */ 5429 /* Recheck faces after display vector */
5415 it->stop_charpos = IT_CHARPOS (*it); 5430 it->stop_charpos = IT_CHARPOS (*it);
5416 } 5431 }
5417 } 5432 break;
5418 else if (it->method == next_element_from_string) 5433
5419 { 5434 case GET_FROM_STRING:
5420 /* Current display element is a character from a Lisp string. */ 5435 /* Current display element is a character from a Lisp string. */
5421 xassert (it->s == NULL && STRINGP (it->string)); 5436 xassert (it->s == NULL && STRINGP (it->string));
5422 IT_STRING_BYTEPOS (*it) += it->len; 5437 IT_STRING_BYTEPOS (*it) += it->len;
@@ -5441,34 +5456,35 @@ set_iterator_to_next (it, reseat_p)
5441 && it->sp > 0) 5456 && it->sp > 0)
5442 { 5457 {
5443 pop_it (it); 5458 pop_it (it);
5444 if (!STRINGP (it->string)) 5459 if (STRINGP (it->string))
5445 it->method = next_element_from_buffer;
5446 else
5447 goto consider_string_end; 5460 goto consider_string_end;
5461 it->method = GET_FROM_BUFFER;
5448 } 5462 }
5449 } 5463 }
5450 } 5464 break;
5451 else if (it->method == next_element_from_image 5465
5452 || it->method == next_element_from_stretch) 5466 case GET_FROM_IMAGE:
5453 { 5467 case GET_FROM_STRETCH:
5454 /* The position etc with which we have to proceed are on 5468 /* The position etc with which we have to proceed are on
5455 the stack. The position may be at the end of a string, 5469 the stack. The position may be at the end of a string,
5456 if the `display' property takes up the whole string. */ 5470 if the `display' property takes up the whole string. */
5471 xassert (it->sp > 0);
5457 pop_it (it); 5472 pop_it (it);
5458 it->image_id = 0; 5473 it->image_id = 0;
5459 if (STRINGP (it->string)) 5474 if (STRINGP (it->string))
5460 { 5475 {
5461 it->method = next_element_from_string; 5476 it->method = GET_FROM_STRING;
5462 goto consider_string_end; 5477 goto consider_string_end;
5463 } 5478 }
5464 else 5479 it->method = GET_FROM_BUFFER;
5465 it->method = next_element_from_buffer; 5480 break;
5481
5482 default:
5483 /* There are no other methods defined, so this should be a bug. */
5484 abort ();
5466 } 5485 }
5467 else
5468 /* There are no other methods defined, so this should be a bug. */
5469 abort ();
5470 5486
5471 xassert (it->method != next_element_from_string 5487 xassert (it->method != GET_FROM_STRING
5472 || (STRINGP (it->string) 5488 || (STRINGP (it->string)
5473 && IT_STRING_CHARPOS (*it) >= 0)); 5489 && IT_STRING_CHARPOS (*it) >= 0));
5474} 5490}
@@ -5680,7 +5696,7 @@ next_element_from_ellipsis (it)
5680 was in IT->saved_face_id, and signal that it's there by 5696 was in IT->saved_face_id, and signal that it's there by
5681 setting face_before_selective_p. */ 5697 setting face_before_selective_p. */
5682 it->saved_face_id = it->face_id; 5698 it->saved_face_id = it->face_id;
5683 it->method = next_element_from_buffer; 5699 it->method = GET_FROM_BUFFER;
5684 reseat_at_next_visible_line_start (it, 1); 5700 reseat_at_next_visible_line_start (it, 1);
5685 it->face_before_selective_p = 1; 5701 it->face_before_selective_p = 1;
5686 } 5702 }
@@ -5921,11 +5937,14 @@ move_it_in_display_line_to (it, to_charpos, to_x, op)
5921 saved_glyph_row = it->glyph_row; 5937 saved_glyph_row = it->glyph_row;
5922 it->glyph_row = NULL; 5938 it->glyph_row = NULL;
5923 5939
5924#define BUFFER_POS_REACHED_P() \ 5940#define BUFFER_POS_REACHED_P() \
5925 ((op & MOVE_TO_POS) != 0 \ 5941 ((op & MOVE_TO_POS) != 0 \
5926 && BUFFERP (it->object) \ 5942 && BUFFERP (it->object) \
5927 && IT_CHARPOS (*it) >= to_charpos \ 5943 && IT_CHARPOS (*it) >= to_charpos \
5928 && it->method == next_element_from_buffer) 5944 && (it->method == GET_FROM_BUFFER || \
5945 (it->method == GET_FROM_DISPLAY_VECTOR && \
5946 it->dpvec + it->current.dpvec_index + 1 >= it->dpend)))
5947
5929 5948
5930 while (1) 5949 while (1)
5931 { 5950 {
@@ -6616,7 +6635,7 @@ int
6616in_display_vector_p (it) 6635in_display_vector_p (it)
6617 struct it *it; 6636 struct it *it;
6618{ 6637{
6619 return (it->method == next_element_from_display_vector 6638 return (it->method == GET_FROM_DISPLAY_VECTOR
6620 && it->current.dpvec_index > 0 6639 && it->current.dpvec_index > 0
6621 && it->dpvec + it->current.dpvec_index != it->dpend); 6640 && it->dpvec + it->current.dpvec_index != it->dpend);
6622} 6641}
@@ -15348,7 +15367,7 @@ display_line (it)
15348 15367
15349 /* Record whether this row ends inside an ellipsis. */ 15368 /* Record whether this row ends inside an ellipsis. */
15350 row->ends_in_ellipsis_p 15369 row->ends_in_ellipsis_p
15351 = (it->method == next_element_from_display_vector 15370 = (it->method == GET_FROM_DISPLAY_VECTOR
15352 && it->ellipsis_p); 15371 && it->ellipsis_p);
15353 15372
15354 /* Save fringe bitmaps in this row. */ 15373 /* Save fringe bitmaps in this row. */
diff --git a/src/xfns.c b/src/xfns.c
index d1edf554feb..8267709767f 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1860,7 +1860,8 @@ hack_wm_protocols (f, widget)
1860 1860
1861 BLOCK_INPUT; 1861 BLOCK_INPUT;
1862 { 1862 {
1863 Atom type, *atoms = 0; 1863 Atom type;
1864 unsigned char *catoms;
1864 int format = 0; 1865 int format = 0;
1865 unsigned long nitems = 0; 1866 unsigned long nitems = 0;
1866 unsigned long bytes_after; 1867 unsigned long bytes_after;
@@ -1869,20 +1870,27 @@ hack_wm_protocols (f, widget)
1869 FRAME_X_DISPLAY_INFO (f)->Xatom_wm_protocols, 1870 FRAME_X_DISPLAY_INFO (f)->Xatom_wm_protocols,
1870 (long)0, (long)100, False, XA_ATOM, 1871 (long)0, (long)100, False, XA_ATOM,
1871 &type, &format, &nitems, &bytes_after, 1872 &type, &format, &nitems, &bytes_after,
1872 (unsigned char **) &atoms) 1873 &catoms)
1873 == Success) 1874 == Success)
1874 && format == 32 && type == XA_ATOM) 1875 && format == 32 && type == XA_ATOM)
1875 while (nitems > 0) 1876 {
1876 { 1877 Atom *atoms = (Atom *) catoms;
1877 nitems--; 1878 while (nitems > 0)
1878 if (atoms[nitems] == FRAME_X_DISPLAY_INFO (f)->Xatom_wm_delete_window) 1879 {
1879 need_delete = 0; 1880 nitems--;
1880 else if (atoms[nitems] == FRAME_X_DISPLAY_INFO (f)->Xatom_wm_take_focus) 1881 if (atoms[nitems]
1881 need_focus = 0; 1882 == FRAME_X_DISPLAY_INFO (f)->Xatom_wm_delete_window)
1882 else if (atoms[nitems] == FRAME_X_DISPLAY_INFO (f)->Xatom_wm_save_yourself) 1883 need_delete = 0;
1883 need_save = 0; 1884 else if (atoms[nitems]
1884 } 1885 == FRAME_X_DISPLAY_INFO (f)->Xatom_wm_take_focus)
1885 if (atoms) XFree ((char *) atoms); 1886 need_focus = 0;
1887 else if (atoms[nitems]
1888 == FRAME_X_DISPLAY_INFO (f)->Xatom_wm_save_yourself)
1889 need_save = 0;
1890 }
1891 }
1892 if (catoms)
1893 XFree (catoms);
1886 } 1894 }
1887 { 1895 {
1888 Atom props [10]; 1896 Atom props [10];
@@ -4140,7 +4148,7 @@ no value of TYPE. */)
4140 Atom prop_atom; 4148 Atom prop_atom;
4141 int rc; 4149 int rc;
4142 Lisp_Object prop_value = Qnil; 4150 Lisp_Object prop_value = Qnil;
4143 char *tmp_data = NULL; 4151 unsigned char *tmp_data = NULL;
4144 Atom actual_type; 4152 Atom actual_type;
4145 Atom target_type = XA_STRING; 4153 Atom target_type = XA_STRING;
4146 int actual_format; 4154 int actual_format;
@@ -4180,7 +4188,7 @@ no value of TYPE. */)
4180 rc = XGetWindowProperty (FRAME_X_DISPLAY (f), target_window, 4188 rc = XGetWindowProperty (FRAME_X_DISPLAY (f), target_window,
4181 prop_atom, 0, 0, False, target_type, 4189 prop_atom, 0, 0, False, target_type,
4182 &actual_type, &actual_format, &actual_size, 4190 &actual_type, &actual_format, &actual_size,
4183 &bytes_remaining, (unsigned char **) &tmp_data); 4191 &bytes_remaining, &tmp_data);
4184 if (rc == Success) 4192 if (rc == Success)
4185 { 4193 {
4186 int size = bytes_remaining; 4194 int size = bytes_remaining;
@@ -4193,7 +4201,7 @@ no value of TYPE. */)
4193 ! NILP (delete_p), target_type, 4201 ! NILP (delete_p), target_type,
4194 &actual_type, &actual_format, 4202 &actual_type, &actual_format,
4195 &actual_size, &bytes_remaining, 4203 &actual_size, &bytes_remaining,
4196 (unsigned char **) &tmp_data); 4204 &tmp_data);
4197 if (rc == Success && tmp_data) 4205 if (rc == Success && tmp_data)
4198 { 4206 {
4199 /* The man page for XGetWindowProperty says: 4207 /* The man page for XGetWindowProperty says:
@@ -4217,14 +4225,14 @@ no value of TYPE. */)
4217 long *ldata = (long *) tmp_data; 4225 long *ldata = (long *) tmp_data;
4218 4226
4219 for (i = 0; i < actual_size; ++i) 4227 for (i = 0; i < actual_size; ++i)
4220 idata[i]= (int) ldata[i]; 4228 idata[i] = (int) ldata[i];
4221 } 4229 }
4222 4230
4223 if (NILP (vector_ret_p)) 4231 if (NILP (vector_ret_p))
4224 prop_value = make_string (tmp_data, size); 4232 prop_value = make_string (tmp_data, size);
4225 else 4233 else
4226 prop_value = x_property_data_to_lisp (f, 4234 prop_value = x_property_data_to_lisp (f,
4227 (unsigned char *) tmp_data, 4235 tmp_data,
4228 actual_type, 4236 actual_type,
4229 actual_format, 4237 actual_format,
4230 actual_size); 4238 actual_size);
diff --git a/src/xselect.c b/src/xselect.c
index bf37cde4d0b..a49b6b89ee4 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -1908,7 +1908,12 @@ lisp_data_to_selection_data (display, obj,
1908 } 1908 }
1909 else if (STRINGP (obj)) 1909 else if (STRINGP (obj))
1910 { 1910 {
1911 xassert (! STRING_MULTIBYTE (obj)); 1911 if (SCHARS (obj) < SBYTES (obj))
1912 /* OBJ is a multibyte string containing a non-ASCII char. */
1913 Fsignal (Qerror, /* Qselection_error */
1914 Fcons (build_string
1915 ("Non-ASCII string must be encoded in advance"),
1916 Fcons (obj, Qnil)));
1912 if (NILP (type)) 1917 if (NILP (type))
1913 type = QSTRING; 1918 type = QSTRING;
1914 *format_ret = 8; 1919 *format_ret = 8;
@@ -2184,7 +2189,10 @@ Disowning it means there is no such selection. */)
2184{ 2189{
2185 Time timestamp; 2190 Time timestamp;
2186 Atom selection_atom; 2191 Atom selection_atom;
2187 struct selection_input_event event; 2192 union {
2193 struct selection_input_event sie;
2194 struct input_event ie;
2195 } event;
2188 Display *display; 2196 Display *display;
2189 struct x_display_info *dpyinfo; 2197 struct x_display_info *dpyinfo;
2190 struct frame *sf = SELECTED_FRAME (); 2198 struct frame *sf = SELECTED_FRAME ();
@@ -2212,10 +2220,10 @@ Disowning it means there is no such selection. */)
2212 the selection owner to None. The NCD server does, the MIT Sun4 server 2220 the selection owner to None. The NCD server does, the MIT Sun4 server
2213 doesn't. So we synthesize one; this means we might get two, but 2221 doesn't. So we synthesize one; this means we might get two, but
2214 that's ok, because the second one won't have any effect. */ 2222 that's ok, because the second one won't have any effect. */
2215 SELECTION_EVENT_DISPLAY (&event) = display; 2223 SELECTION_EVENT_DISPLAY (&event.sie) = display;
2216 SELECTION_EVENT_SELECTION (&event) = selection_atom; 2224 SELECTION_EVENT_SELECTION (&event.sie) = selection_atom;
2217 SELECTION_EVENT_TIME (&event) = timestamp; 2225 SELECTION_EVENT_TIME (&event.sie) = timestamp;
2218 x_handle_selection_clear ((struct input_event *) &event); 2226 x_handle_selection_clear (&event.ie);
2219 2227
2220 return Qt; 2228 return Qt;
2221} 2229}
diff --git a/src/xterm.c b/src/xterm.c
index 137e0d2ae9e..3b6d2e18ac6 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -5625,8 +5625,8 @@ static struct x_display_info *next_noop_dpyinfo;
5625 f->output_data.x->saved_menu_event \ 5625 f->output_data.x->saved_menu_event \
5626 = (XEvent *) xmalloc (sizeof (XEvent)); \ 5626 = (XEvent *) xmalloc (sizeof (XEvent)); \
5627 bcopy (&event, f->output_data.x->saved_menu_event, size); \ 5627 bcopy (&event, f->output_data.x->saved_menu_event, size); \
5628 inev.kind = MENU_BAR_ACTIVATE_EVENT; \ 5628 inev.ie.kind = MENU_BAR_ACTIVATE_EVENT; \
5629 XSETFRAME (inev.frame_or_window, f); \ 5629 XSETFRAME (inev.ie.frame_or_window, f); \
5630 } \ 5630 } \
5631 while (0) 5631 while (0)
5632 5632
@@ -5733,7 +5733,10 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
5733 int *finish; 5733 int *finish;
5734 struct input_event *hold_quit; 5734 struct input_event *hold_quit;
5735{ 5735{
5736 struct input_event inev; 5736 union {
5737 struct input_event ie;
5738 struct selection_input_event sie;
5739 } inev;
5737 int count = 0; 5740 int count = 0;
5738 int do_help = 0; 5741 int do_help = 0;
5739 int nbytes = 0; 5742 int nbytes = 0;
@@ -5743,9 +5746,9 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
5743 5746
5744 *finish = X_EVENT_NORMAL; 5747 *finish = X_EVENT_NORMAL;
5745 5748
5746 EVENT_INIT (inev); 5749 EVENT_INIT (inev.ie);
5747 inev.kind = NO_EVENT; 5750 inev.ie.kind = NO_EVENT;
5748 inev.arg = Qnil; 5751 inev.ie.arg = Qnil;
5749 5752
5750 switch (event.type) 5753 switch (event.type)
5751 { 5754 {
@@ -5843,8 +5846,8 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
5843 if (!f) 5846 if (!f)
5844 goto OTHER; /* May be a dialog that is to be removed */ 5847 goto OTHER; /* May be a dialog that is to be removed */
5845 5848
5846 inev.kind = DELETE_WINDOW_EVENT; 5849 inev.ie.kind = DELETE_WINDOW_EVENT;
5847 XSETFRAME (inev.frame_or_window, f); 5850 XSETFRAME (inev.ie.frame_or_window, f);
5848 goto done; 5851 goto done;
5849 } 5852 }
5850 5853
@@ -5907,7 +5910,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
5907 if (event.xclient.message_type 5910 if (event.xclient.message_type
5908 == dpyinfo->Xatom_Scrollbar) 5911 == dpyinfo->Xatom_Scrollbar)
5909 { 5912 {
5910 x_scroll_bar_to_input_event (&event, &inev); 5913 x_scroll_bar_to_input_event (&event, &inev.ie);
5911 *finish = X_EVENT_GOTO_OUT; 5914 *finish = X_EVENT_GOTO_OUT;
5912 goto done; 5915 goto done;
5913 } 5916 }
@@ -5918,7 +5921,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
5918 if (!f) 5921 if (!f)
5919 goto OTHER; 5922 goto OTHER;
5920 5923
5921 if (x_handle_dnd_message (f, &event.xclient, dpyinfo, &inev)) 5924 if (x_handle_dnd_message (f, &event.xclient, dpyinfo, &inev.ie))
5922 *finish = X_EVENT_DROP; 5925 *finish = X_EVENT_DROP;
5923 } 5926 }
5924 break; 5927 break;
@@ -5939,11 +5942,11 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
5939 { 5942 {
5940 XSelectionClearEvent *eventp = (XSelectionClearEvent *) &event; 5943 XSelectionClearEvent *eventp = (XSelectionClearEvent *) &event;
5941 5944
5942 inev.kind = SELECTION_CLEAR_EVENT; 5945 inev.ie.kind = SELECTION_CLEAR_EVENT;
5943 SELECTION_EVENT_DISPLAY (&inev) = eventp->display; 5946 SELECTION_EVENT_DISPLAY (&inev.sie) = eventp->display;
5944 SELECTION_EVENT_SELECTION (&inev) = eventp->selection; 5947 SELECTION_EVENT_SELECTION (&inev.sie) = eventp->selection;
5945 SELECTION_EVENT_TIME (&inev) = eventp->time; 5948 SELECTION_EVENT_TIME (&inev.sie) = eventp->time;
5946 inev.frame_or_window = Qnil; 5949 inev.ie.frame_or_window = Qnil;
5947 } 5950 }
5948 break; 5951 break;
5949 5952
@@ -5956,14 +5959,14 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
5956 XSelectionRequestEvent *eventp 5959 XSelectionRequestEvent *eventp
5957 = (XSelectionRequestEvent *) &event; 5960 = (XSelectionRequestEvent *) &event;
5958 5961
5959 inev.kind = SELECTION_REQUEST_EVENT; 5962 inev.ie.kind = SELECTION_REQUEST_EVENT;
5960 SELECTION_EVENT_DISPLAY (&inev) = eventp->display; 5963 SELECTION_EVENT_DISPLAY (&inev.sie) = eventp->display;
5961 SELECTION_EVENT_REQUESTOR (&inev) = eventp->requestor; 5964 SELECTION_EVENT_REQUESTOR (&inev.sie) = eventp->requestor;
5962 SELECTION_EVENT_SELECTION (&inev) = eventp->selection; 5965 SELECTION_EVENT_SELECTION (&inev.sie) = eventp->selection;
5963 SELECTION_EVENT_TARGET (&inev) = eventp->target; 5966 SELECTION_EVENT_TARGET (&inev.sie) = eventp->target;
5964 SELECTION_EVENT_PROPERTY (&inev) = eventp->property; 5967 SELECTION_EVENT_PROPERTY (&inev.sie) = eventp->property;
5965 SELECTION_EVENT_TIME (&inev) = eventp->time; 5968 SELECTION_EVENT_TIME (&inev.sie) = eventp->time;
5966 inev.frame_or_window = Qnil; 5969 inev.ie.frame_or_window = Qnil;
5967 } 5970 }
5968 break; 5971 break;
5969 5972
@@ -6102,8 +6105,8 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
6102 { 6105 {
6103 f->async_iconified = 1; 6106 f->async_iconified = 1;
6104 6107
6105 inev.kind = ICONIFY_EVENT; 6108 inev.ie.kind = ICONIFY_EVENT;
6106 XSETFRAME (inev.frame_or_window, f); 6109 XSETFRAME (inev.ie.frame_or_window, f);
6107 } 6110 }
6108 } 6111 }
6109 goto OTHER; 6112 goto OTHER;
@@ -6135,8 +6138,8 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
6135 6138
6136 if (f->iconified) 6139 if (f->iconified)
6137 { 6140 {
6138 inev.kind = DEICONIFY_EVENT; 6141 inev.ie.kind = DEICONIFY_EVENT;
6139 XSETFRAME (inev.frame_or_window, f); 6142 XSETFRAME (inev.ie.frame_or_window, f);
6140 } 6143 }
6141 else if (! NILP (Vframe_list) 6144 else if (! NILP (Vframe_list)
6142 && ! NILP (XCDR (Vframe_list))) 6145 && ! NILP (XCDR (Vframe_list)))
@@ -6302,18 +6305,18 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
6302 orig_keysym = keysym; 6305 orig_keysym = keysym;
6303 6306
6304 /* Common for all keysym input events. */ 6307 /* Common for all keysym input events. */
6305 XSETFRAME (inev.frame_or_window, f); 6308 XSETFRAME (inev.ie.frame_or_window, f);
6306 inev.modifiers 6309 inev.ie.modifiers
6307 = x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (f), modifiers); 6310 = x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (f), modifiers);
6308 inev.timestamp = event.xkey.time; 6311 inev.ie.timestamp = event.xkey.time;
6309 6312
6310 /* First deal with keysyms which have defined 6313 /* First deal with keysyms which have defined
6311 translations to characters. */ 6314 translations to characters. */
6312 if (keysym >= 32 && keysym < 128) 6315 if (keysym >= 32 && keysym < 128)
6313 /* Avoid explicitly decoding each ASCII character. */ 6316 /* Avoid explicitly decoding each ASCII character. */
6314 { 6317 {
6315 inev.kind = ASCII_KEYSTROKE_EVENT; 6318 inev.ie.kind = ASCII_KEYSTROKE_EVENT;
6316 inev.code = keysym; 6319 inev.ie.code = keysym;
6317 goto done_keysym; 6320 goto done_keysym;
6318 } 6321 }
6319 6322
@@ -6323,10 +6326,10 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
6323 Vx_keysym_table, 6326 Vx_keysym_table,
6324 Qnil)))) 6327 Qnil))))
6325 { 6328 {
6326 inev.kind = (SINGLE_BYTE_CHAR_P (XFASTINT (c)) 6329 inev.ie.kind = (SINGLE_BYTE_CHAR_P (XFASTINT (c))
6327 ? ASCII_KEYSTROKE_EVENT 6330 ? ASCII_KEYSTROKE_EVENT
6328 : MULTIBYTE_CHAR_KEYSTROKE_EVENT); 6331 : MULTIBYTE_CHAR_KEYSTROKE_EVENT);
6329 inev.code = XFASTINT (c); 6332 inev.ie.code = XFASTINT (c);
6330 goto done_keysym; 6333 goto done_keysym;
6331 } 6334 }
6332 6335
@@ -6416,8 +6419,8 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
6416 STORE_KEYSYM_FOR_DEBUG (keysym); 6419 STORE_KEYSYM_FOR_DEBUG (keysym);
6417 /* make_lispy_event will convert this to a symbolic 6420 /* make_lispy_event will convert this to a symbolic
6418 key. */ 6421 key. */
6419 inev.kind = NON_ASCII_KEYSTROKE_EVENT; 6422 inev.ie.kind = NON_ASCII_KEYSTROKE_EVENT;
6420 inev.code = keysym; 6423 inev.ie.code = keysym;
6421 goto done_keysym; 6424 goto done_keysym;
6422 } 6425 }
6423 6426
@@ -6469,18 +6472,18 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
6469 else 6472 else
6470 c = STRING_CHAR_AND_LENGTH (copy_bufptr + i, 6473 c = STRING_CHAR_AND_LENGTH (copy_bufptr + i,
6471 nbytes - i, len); 6474 nbytes - i, len);
6472 inev.kind = (SINGLE_BYTE_CHAR_P (c) 6475 inev.ie.kind = (SINGLE_BYTE_CHAR_P (c)
6473 ? ASCII_KEYSTROKE_EVENT 6476 ? ASCII_KEYSTROKE_EVENT
6474 : MULTIBYTE_CHAR_KEYSTROKE_EVENT); 6477 : MULTIBYTE_CHAR_KEYSTROKE_EVENT);
6475 inev.code = c; 6478 inev.ie.code = c;
6476 kbd_buffer_store_event_hold (&inev, hold_quit); 6479 kbd_buffer_store_event_hold (&inev.ie, hold_quit);
6477 } 6480 }
6478 6481
6479 /* Previous code updated count by nchars rather than nbytes, 6482 /* Previous code updated count by nchars rather than nbytes,
6480 but that seems bogus to me. ++kfs */ 6483 but that seems bogus to me. ++kfs */
6481 count += nbytes; 6484 count += nbytes;
6482 6485
6483 inev.kind = NO_EVENT; /* Already stored above. */ 6486 inev.ie.kind = NO_EVENT; /* Already stored above. */
6484 6487
6485 if (keysym == NoSymbol) 6488 if (keysym == NoSymbol)
6486 break; 6489 break;
@@ -6507,7 +6510,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
6507#endif 6510#endif
6508 6511
6509 case EnterNotify: 6512 case EnterNotify:
6510 x_detect_focus_change (dpyinfo, &event, &inev); 6513 x_detect_focus_change (dpyinfo, &event, &inev.ie);
6511 6514
6512 f = x_any_window_to_frame (dpyinfo, event.xcrossing.window); 6515 f = x_any_window_to_frame (dpyinfo, event.xcrossing.window);
6513 6516
@@ -6537,11 +6540,11 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
6537 goto OTHER; 6540 goto OTHER;
6538 6541
6539 case FocusIn: 6542 case FocusIn:
6540 x_detect_focus_change (dpyinfo, &event, &inev); 6543 x_detect_focus_change (dpyinfo, &event, &inev.ie);
6541 goto OTHER; 6544 goto OTHER;
6542 6545
6543 case LeaveNotify: 6546 case LeaveNotify:
6544 x_detect_focus_change (dpyinfo, &event, &inev); 6547 x_detect_focus_change (dpyinfo, &event, &inev.ie);
6545 6548
6546 f = x_top_window_to_frame (dpyinfo, event.xcrossing.window); 6549 f = x_top_window_to_frame (dpyinfo, event.xcrossing.window);
6547 if (f) 6550 if (f)
@@ -6564,7 +6567,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
6564 goto OTHER; 6567 goto OTHER;
6565 6568
6566 case FocusOut: 6569 case FocusOut:
6567 x_detect_focus_change (dpyinfo, &event, &inev); 6570 x_detect_focus_change (dpyinfo, &event, &inev.ie);
6568 goto OTHER; 6571 goto OTHER;
6569 6572
6570 case MotionNotify: 6573 case MotionNotify:
@@ -6604,8 +6607,8 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
6604 && !EQ (window, last_window) 6607 && !EQ (window, last_window)
6605 && !EQ (window, selected_window)) 6608 && !EQ (window, selected_window))
6606 { 6609 {
6607 inev.kind = SELECT_WINDOW_EVENT; 6610 inev.ie.kind = SELECT_WINDOW_EVENT;
6608 inev.frame_or_window = window; 6611 inev.ie.frame_or_window = window;
6609 } 6612 }
6610 6613
6611 last_window=window; 6614 last_window=window;
@@ -6764,13 +6767,13 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
6764 && (int)(event.xbutton.time - ignore_next_mouse_click_timeout) > 0) 6767 && (int)(event.xbutton.time - ignore_next_mouse_click_timeout) > 0)
6765 { 6768 {
6766 ignore_next_mouse_click_timeout = 0; 6769 ignore_next_mouse_click_timeout = 0;
6767 construct_mouse_click (&inev, &event, f); 6770 construct_mouse_click (&inev.ie, &event, f);
6768 } 6771 }
6769 if (event.type == ButtonRelease) 6772 if (event.type == ButtonRelease)
6770 ignore_next_mouse_click_timeout = 0; 6773 ignore_next_mouse_click_timeout = 0;
6771 } 6774 }
6772 else 6775 else
6773 construct_mouse_click (&inev, &event, f); 6776 construct_mouse_click (&inev.ie, &event, f);
6774 } 6777 }
6775 } 6778 }
6776 } 6779 }
@@ -6785,12 +6788,12 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
6785 scroll bars. */ 6788 scroll bars. */
6786 if (bar && event.xbutton.state & ControlMask) 6789 if (bar && event.xbutton.state & ControlMask)
6787 { 6790 {
6788 x_scroll_bar_handle_click (bar, &event, &inev); 6791 x_scroll_bar_handle_click (bar, &event, &inev.ie);
6789 *finish = X_EVENT_DROP; 6792 *finish = X_EVENT_DROP;
6790 } 6793 }
6791#else /* not USE_TOOLKIT_SCROLL_BARS */ 6794#else /* not USE_TOOLKIT_SCROLL_BARS */
6792 if (bar) 6795 if (bar)
6793 x_scroll_bar_handle_click (bar, &event, &inev); 6796 x_scroll_bar_handle_click (bar, &event, &inev.ie);
6794#endif /* not USE_TOOLKIT_SCROLL_BARS */ 6797#endif /* not USE_TOOLKIT_SCROLL_BARS */
6795 } 6798 }
6796 6799
@@ -6898,9 +6901,9 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
6898 } 6901 }
6899 6902
6900 done: 6903 done:
6901 if (inev.kind != NO_EVENT) 6904 if (inev.ie.kind != NO_EVENT)
6902 { 6905 {
6903 kbd_buffer_store_event_hold (&inev, hold_quit); 6906 kbd_buffer_store_event_hold (&inev.ie, hold_quit);
6904 count++; 6907 count++;
6905 } 6908 }
6906 6909