aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2006-05-10 20:42:41 +0000
committerMiles Bader2006-05-10 20:42:41 +0000
commit3bcf2b084a0dd1ff0399480d57b87e01cfe061dc (patch)
tree355c68cda5a5c9c73824840df3cdae6320017283
parent0ea38cf9dca8f2b148d78f638eed17e8896984af (diff)
parentd105bfecce2288cd99f591382586a22a4ce1b6f2 (diff)
downloademacs-3bcf2b084a0dd1ff0399480d57b87e01cfe061dc.tar.gz
emacs-3bcf2b084a0dd1ff0399480d57b87e01cfe061dc.zip
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-60
Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 259-273) - Update from CVS - lisp/replace.el (occur-engine): Bind `inhibit-field-text-motion' to t - Merge from gnus--rel--5.10 - Rename "field-at-point" to "field-at-pos" - (comint-insert-input): Remove redundant calls to setq and goto-char * gnus--rel--5.10 (patch 99-100) - Merge from emacs--devo--0 - Update from CVS
-rw-r--r--ChangeLog6
-rw-r--r--Makefile.in2
-rw-r--r--admin/ChangeLog5
-rw-r--r--admin/FOR-RELEASE105
-rw-r--r--etc/ChangeLog6
-rw-r--r--etc/MH-E-NEWS1268
-rw-r--r--etc/NEWS91
-rw-r--r--info/dir1
-rw-r--r--lib-src/ChangeLog6
-rw-r--r--lib-src/etags.c13
-rw-r--r--lisp/ChangeLog364
-rw-r--r--lisp/add-log.el3
-rw-r--r--lisp/arc-mode.el48
-rw-r--r--lisp/autorevert.el4
-rw-r--r--lisp/avoid.el22
-rw-r--r--lisp/battery.el8
-rw-r--r--lisp/calc/calc-embed.el17
-rw-r--r--lisp/comint.el46
-rw-r--r--lisp/cus-start.el2
-rw-r--r--lisp/diff-mode.el18
-rw-r--r--lisp/dired-aux.el4
-rw-r--r--lisp/ediff.el68
-rw-r--r--lisp/emacs-lisp/crm.el41
-rw-r--r--lisp/emacs-lisp/easy-mmode.el8
-rw-r--r--lisp/emacs-lisp/ewoc.el101
-rw-r--r--lisp/emacs-lisp/re-builder.el35
-rw-r--r--lisp/emacs-lisp/syntax.el17
-rw-r--r--lisp/env.el2
-rw-r--r--lisp/files.el50
-rw-r--r--lisp/font-lock.el8
-rw-r--r--lisp/gnus/ChangeLog21
-rw-r--r--lisp/gnus/gnus-art.el61
-rw-r--r--lisp/gnus/mm-decode.el22
-rw-r--r--lisp/ibuffer.el4
-rw-r--r--lisp/isearch.el20
-rw-r--r--lisp/kmacro.el20
-rw-r--r--lisp/ldefs-boot.el4
-rw-r--r--lisp/mh-e/ChangeLog10
-rw-r--r--lisp/mh-e/mh-e.el35
-rw-r--r--lisp/msb.el5
-rw-r--r--lisp/mwheel.el21
-rw-r--r--lisp/net/tramp.el2
-rw-r--r--lisp/progmodes/gdb-ui.el69
-rw-r--r--lisp/progmodes/grep.el46
-rw-r--r--lisp/progmodes/gud.el114
-rw-r--r--lisp/progmodes/idlw-shell.el6
-rw-r--r--lisp/progmodes/idlwave.el67
-rw-r--r--lisp/progmodes/perl-mode.el5
-rw-r--r--lisp/progmodes/vhdl-mode.el3
-rw-r--r--lisp/progmodes/xscheme.el9
-rw-r--r--lisp/replace.el1
-rw-r--r--lisp/server.el2
-rw-r--r--lisp/simple.el8
-rw-r--r--lisp/speedbar.el17
-rw-r--r--lisp/startup.el27
-rw-r--r--lisp/subr.el32
-rw-r--r--lisp/term.el2
-rw-r--r--lisp/term/mac-win.el383
-rw-r--r--lisp/term/xterm.el8
-rw-r--r--lisp/textmodes/ispell.el30
-rw-r--r--lisp/url/ChangeLog5
-rw-r--r--lisp/url/url-http.el4
-rw-r--r--lispref/ChangeLog45
-rw-r--r--lispref/commands.texi2
-rw-r--r--lispref/compile.texi4
-rw-r--r--lispref/files.texi4
-rw-r--r--lispref/hooks.texi71
-rw-r--r--lispref/internals.texi16
-rw-r--r--lispref/keymaps.texi9
-rw-r--r--lispref/minibuf.texi19
-rw-r--r--lispref/nonascii.texi2
-rw-r--r--lispref/numbers.texi2
-rw-r--r--lispref/variables.texi16
-rw-r--r--lispref/windows.texi4
-rw-r--r--man/ChangeLog232
-rw-r--r--man/Makefile.in23
-rw-r--r--man/abbrevs.texi4
-rw-r--r--man/arevert-xtra.texi191
-rw-r--r--man/buffers.texi8
-rw-r--r--man/building.texi2
-rw-r--r--man/cal-xtra.texi838
-rw-r--r--man/calendar.texi82
-rw-r--r--man/cmdargs.texi5
-rw-r--r--man/commands.texi175
-rw-r--r--man/custom.texi13
-rw-r--r--man/dired-xtra.texi49
-rw-r--r--man/dired.texi9
-rw-r--r--man/display.texi6
-rw-r--r--man/emacs-xtra.texi3787
-rw-r--r--man/emacs.texi35
-rw-r--r--man/emerge-xtra.texi414
-rw-r--r--man/entering.texi115
-rw-r--r--man/faq.texi38
-rw-r--r--man/files.texi278
-rw-r--r--man/fortran-xtra.texi548
-rw-r--r--man/frames.texi8
-rw-r--r--man/gnu.texi2
-rw-r--r--man/help.texi2
-rw-r--r--man/killing.texi2
-rw-r--r--man/macos.texi7
-rw-r--r--man/maintaining.texi7
-rw-r--r--man/makefile.w32-in24
-rw-r--r--man/mh-e.texi78
-rw-r--r--man/mini.texi3
-rw-r--r--man/misc.texi85
-rw-r--r--man/msdog-xtra.texi687
-rw-r--r--man/msdog.texi32
-rw-r--r--man/picture-xtra.texi291
-rw-r--r--man/programs.texi18
-rw-r--r--man/screen.texi196
-rw-r--r--man/sending.texi2
-rw-r--r--man/texinfo.tex179
-rw-r--r--man/text.texi8
-rw-r--r--man/tramp.texi12
-rw-r--r--man/trouble.texi16
-rw-r--r--man/vc-xtra.texi32
-rw-r--r--man/vc1-xtra.texi151
-rw-r--r--man/vc2-xtra.texi789
-rw-r--r--man/xresmini.texi135
-rw-r--r--man/xresources.texi6
-rw-r--r--src/.gdbinit155
-rw-r--r--src/ChangeLog200
-rw-r--r--src/callproc.c2
-rw-r--r--src/coding.h3
-rw-r--r--src/image.c26
-rw-r--r--src/keyboard.c3
-rw-r--r--src/keymap.c13
-rw-r--r--src/mac.c125
-rw-r--r--src/macfns.c80
-rw-r--r--src/macgui.h7
-rw-r--r--src/macmenu.c2
-rw-r--r--src/macselect.c234
-rw-r--r--src/macterm.c684
-rw-r--r--src/macterm.h8
-rw-r--r--src/minibuf.c4
-rw-r--r--src/process.c10
-rw-r--r--src/sound.c71
-rw-r--r--src/termhooks.h6
-rw-r--r--src/xdisp.c18
-rw-r--r--src/xfaces.c10
140 files changed, 8765 insertions, 6146 deletions
diff --git a/ChangeLog b/ChangeLog
index 2bf1024844b..e2f103f8169 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
12006-05-06 Eli Zaretskii <eliz@gnu.org>
2
3 * Makefile.in (INFO_FILES): Remove emacs-xtra.
4
5 * info/dir: Remove the Emacs-Xtra entry.
6
12006-04-20 Ramprasad B <ramprasad_i82@yahoo.com> 72006-04-20 Ramprasad B <ramprasad_i82@yahoo.com>
2 8
3 * Copyright (sources/emacs): updated copyright year(s) 9 * Copyright (sources/emacs): updated copyright year(s)
diff --git a/Makefile.in b/Makefile.in
index 12ef4befb48..7193bd1af26 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -135,7 +135,7 @@ man1dir=$(mandir)/man1
135# system, it is inappropriate to imply that it is part of Emacs. 135# system, it is inappropriate to imply that it is part of Emacs.
136infodir=@infodir@ 136infodir=@infodir@
137INFO_FILES=ada-mode autotype calc ccmode cl dired-x ebrowse ediff efaq \ 137INFO_FILES=ada-mode autotype calc ccmode cl dired-x ebrowse ediff efaq \
138 elisp eintr emacs emacs-mime emacs-xtra eshell eudc flymake \ 138 elisp eintr emacs emacs-mime eshell eudc flymake \
139 forms gnus idlwave info message mh-e newsticker org pcl-cvs \ 139 forms gnus idlwave info message mh-e newsticker org pcl-cvs \
140 pgg reftex sc ses sieve speedbar tramp vip viper widget \ 140 pgg reftex sc ses sieve speedbar tramp vip viper widget \
141 woman smtpmail url rcirc erc 141 woman smtpmail url rcirc erc
diff --git a/admin/ChangeLog b/admin/ChangeLog
index 9dc0def4788..ef6fcb44041 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,8 @@
12006-05-06 Bill Wohler <wohler@newt.com>
2
3 * FOR-RELEASE: MH-E 8.0 has been released, so removed reminder
4 about it.
5
12006-04-17 Ramprasad B <ramprasad_i82@yahoo.com> 62006-04-17 Ramprasad B <ramprasad_i82@yahoo.com>
2 7
3 * ./* (Copyright): Updated Copyright year(s) 8 * ./* (Copyright): Updated Copyright year(s)
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
index c641fbe106c..88d3a0dcf48 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -23,22 +23,18 @@ face name prefixes should be in it for good results.
23 23
24** Ask maintainers of refcard translations to update them. 24** Ask maintainers of refcard translations to update them.
25 25
26** Check what should be deleted or updated in MORE.STUFF.
27
28** Send an email to the various distributions, including the GNOME 26** Send an email to the various distributions, including the GNOME
29and KDE projects, to use the new Emacs icons in etc/images/icons. 27and KDE projects, to use the new Emacs icons in etc/images/icons.
30 28
31** Ensure MH-E 8.0 has been released.
32Assigned to Bill Wohler <wohler@newt.com>.
33
34* BUGS 29* BUGS
35 30
36** Stefan Monnier's March 20 bug report about 3d boxes in header line. 31** JD Smith's 17 Apr 2006 bug report that CVS operations
32get mysterious unreproducible failures.
37 33
38** Is there a basic problem with cl-byte-compile-compiler-macro? 34** David Hansen's bug report on 16 Apr 2006 about point-entered and
35point-left text properties.
39 36
40** Recalculate the tool bar height after changing the default font. 37** Is there a basic problem with cl-byte-compile-compiler-macro?
41(Bug report by Yamamoto Mistuharu, 31 Mar 2006)
42 38
43** Markus Gritsch's report about Emacs looping on Windoze with the following 39** Markus Gritsch's report about Emacs looping on Windoze with the following
44.emacs file, and then reduce Emacs frame width to "something quite narrow": 40.emacs file, and then reduce Emacs frame width to "something quite narrow":
@@ -71,97 +67,6 @@ Lisp point of view.
71 67
72** Check man/info.texi. 68** Check man/info.texi.
73 69
74** Add missing years in copyright notices of all files.
75
76Please record your name here and say which part of the distribution
77you're going to handle.
78
79DIRECTORY STATUS IN CHARGE
80--------- ------ ---------
81etc (and subdirs) done Thien-Thi Nguyen (ttn(@gnu.org))
82leim done Kenichi Handa
83lib-src done ttn
84lisp done ttn
85lisp/calc done Jay Belanger
86lisp/calendar done Glenn Morris
87lisp/emacs-lisp done ttn
88lisp/emulation done ttn
89lisp/eshell done ttn
90lisp/gnus done Romain Francoise
91lisp/international done Kenichi Handa
92lisp/language done Kenichi Handa
93lisp/mail done ttn
94lisp/mh-e done Bill Wohler
95lisp/net done ttn
96lisp/obsolete done ttn
97lisp/play done Romain Francoise
98lisp/progmodes done Nick Roberts
99lisp/term done ttn
100lisp/textmodes done ttn
101lisp/url done ttn
102lispintro done ttn
103lispref done ttn
104lwlib done ttn
105m4 done ttn
106mac (and subdirs) done ttn
107man done ttn
108msdos done ttn
109nt (and subdirs) done ttn
110oldXMenu done ttn
111src (and subdirs) done ttn
112vms done ttn
113
114** Check the Emacs manual.
115
116Each manual section should be checked for factual correctness
117regarding recent changes by at least two people. After each file
118name, on the same line or the following line, come the names of the
119people who have checked it.
120
121SECTION READERS
122-----------------------------
123man/abbrevs.texi Chong Yidong Joakim Verona
124man/anti.texi Chong Yidong
125man/basic.texi "Luc Teirlinck" Chong Yidong
126man/buffers.texi "Luc Teirlinck" Chong Yidong
127man/building.texi "Ted Zlatanov" <tzz@lifelogs.com>
128man/calendar.texi joakim@verona.se Chong Yidong
129man/cmdargs.texi Chong Yidong "Luc Teirlinck"
130man/commands.texi "Luc Teirlinck" Chong Yidong
131man/custom.texi Chong Yidong "Luc Teirlinck"
132man/dired.texi Chong Yidong joakim@verona.se
133man/display.texi "Luc Teirlinck" Chong Yidong
134man/emacs.texi "Luc Teirlinck" Lute Kamstra
135man/entering.texi "Luc Teirlinck" Chong Yidong
136man/files.texi "Luc Teirlinck" Chong Yidong
137man/fixit.texi "Luc Teirlinck" Chong Yidong
138man/frames.texi "Luc Teirlinck" Chong Yidong
139man/glossary.texi Chong Yidong
140man/help.texi "Luc Teirlinck" Chong Yidong
141man/indent.texi "Luc Teirlinck" Chong Yidong
142man/killing.texi "Luc Teirlinck" Chong Yidong
143man/kmacro.texi "Luc Teirlinck" Chong Yidong
144man/macos.texi Chong Yidong
145man/maintaining.texi Chong Yidong
146man/major.texi "Luc Teirlinck" Chong Yidong
147man/mark.texi "Luc Teirlinck" Chong Yidong
148man/mini.texi "Luc Teirlinck" Chong Yidong
149man/misc.texi Chong Yidong
150man/msdog.texi Chong Yidong
151man/mule.texi "Luc Teirlinck" Kenichi Handa
152man/m-x.texi "Luc Teirlinck" Chong Yidong
153man/picture.texi Joakim Verona <joakim@verona.se> Chong Yidong
154man/programs.texi "Stephen Eglen" Chong Yidong
155man/regs.texi "Luc Teirlinck" Chong Yidong
156man/rmail.texi Chong Yidong "Luc Teirlinck"
157man/screen.texi "Luc Teirlinck" Chong Yidong
158man/search.texi "Luc Teirlinck" Chong Yidong
159man/sending.texi Chong Yidong "Luc Teirlinck"
160man/text.texi "Luc Teirlinck" Chong Yidong
161man/trouble.texi Chong Yidong
162man/windows.texi "Luc Teirlinck" Chong Yidong
163man/xresources.texi
164
165** Check the Emacs Lisp manual. 70** Check the Emacs Lisp manual.
166 71
167Each manual section should be checked for factual correctness 72Each manual section should be checked for factual correctness
diff --git a/etc/ChangeLog b/etc/ChangeLog
index c80b23c0489..c084d5ab205 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,9 @@
12006-05-06 Bill Wohler <wohler@newt.com>
2
3 Release MH-E version 8.0.
4
5 * NEWS, MH-E-NEWS: Update for MH-E release 8.0.
6
12006-04-28 Bill Wohler <wohler@newt.com> 72006-04-28 Bill Wohler <wohler@newt.com>
2 8
3 Release MH-E version 7.95. 9 Release MH-E version 7.95.
diff --git a/etc/MH-E-NEWS b/etc/MH-E-NEWS
index db9de4b9043..18744a67008 100644
--- a/etc/MH-E-NEWS
+++ b/etc/MH-E-NEWS
@@ -6,186 +6,259 @@ Copying and distribution of this file, with or without modification,
6are permitted in any medium without royalty provided the copyright 6are permitted in any medium without royalty provided the copyright
7notice and this notice are preserved. 7notice and this notice are preserved.
8 8
9* Changes in MH-E 7.95 9* Changes in MH-E 8.0
10 10
11Version 7.95, the second 8.0 release candidate, fixes a single bug. 11Version 8.0 supports GNU mailutils, S/MIME, picons, which-func-mode,
12It would be good to check this version ASAP since the Emacs pretest is 12sports an improved interface for hiding header fields, improves upon
13coming in days: if no showstopper problems are found in this version 13the MH variant detection, improves folder completion, makes the pick
14it will be promoted to 8.0 before the pretest. Thanks for your help! 14search equivalent to the other types of searches, spruces up the tool
15 15bar, creates the correct MIME type when including OpenOffice
16** Bug Fixes in MH-E 7.95 16documents, works on a Mac, adds colors to buttons for signed or
17 17encrypted messages, incorporates new features introduced in
18*** Folder Completion Fails in fcc: Field 18Emacs 22.1, fixes a bunch of bugs, and best of all, comes with an
19updated manual!
20
21Internally, MH-E now sports a new software organization which will
22help future maintainability. As a side-effect, the number of XEmacs
23compilation warnings has plummeted from hundreds to just three. CVS
24users will notice that MH-E has been migrated from the CVS repository
25from SourceForge to Savannah (but only for those files that were
26already part of Emacs). As a result, the location of MH-E in the
27load-path has changed, and mh-e-autoloads.el was renamed to
28mh-autoloads.el. See section INSTALL in the README for details. While
29this migration will benefit maintainers, it will also benefit users:
30CVS Emacs users will not have to check out MH-E separately and welcome
31faster MH-E updates, and CVS MH-E users will welcome faster MH-E
32updates from Emacs developers. Read section CVS MH-E INSTALL in the
33README for details.
19 34
20This has been fixed (closes SF #1476270). 35While not related to this release, the MH-E mailing lists are now
36gatewayed at gmane.org (closes SF #979308).
21 37
22* Changes in MH-E 7.94 38If you want to see the release notes for the alpha and beta releases
39leading up this release, please see:
23 40
24Version 7.94, the first 8.0 release candidate, fixes a bunch of bugs, 41 http://cvs.savannah.gnu.org/viewcvs/emacs/etc/MH-E-NEWS?rev=1.25&root=emacs&view=markup
25incorporates new features introduced in Emacs 22.1, improves folder
26completion, and spruces up the tool bar.
27 42
28** New Features in MH-E 7.94 43
29 44
30*** Add :package-version Keyword to Options 45** New Features in MH-E 8.0
31 46
32This `defcustom', `defgroup', and `defface' keyword was introduced in 47*** GNU mailutils Support
33Emacs 22.1. MH-E has been extended to take advantage of it. With this
34keyword, you can now use `M-x customize-changed-options' to see what
35options in MH-E have changed between versions of Emacs. In a future
36version of Emacs, you'll be able to see changes between MH-E versions
37as well (closes SF #1452724).
38 48
39** Bug Fixes in MH-E 7.94 49MH-E now supports GNU mailutils 0.4 and higher versions.
40 50
41*** mhparam -components Fails on mailutils 51*** S/MIME Support
42 52
43This error prevented MH-E from loading when using GNU mailutils. GNU 53MH-E now supports S/MIME using Gnus 5.10.6 or higher.
44mailutils drops the `s' in this argument, so we did too since
45-component still works in nmh and MH (closes SF #1446985).
46 54
47*** "/ s" Still Has Problems With []'d Mail 55*** Picon Support
48 56
49On XEmacs, subjects that had special characters would prevent `/ s' 57In addition to the other methods of displaying an icon for the sender
50from narrowing to the given subject. These characters are now quoted 58of a message, MH-E can now display images from a picon directory. The
51correctly in XEmacs (closes SF #1447598). 59directory search path is found in the `mh-picon-directory-list'
60variable. More documentation is found in the "facedb" sections in the
61xfaces man page.
52 62
53*** Incorrect Example in mh-folder-list Docstring 63*** Catchup Command
54 64
55This has been fixed (closes SF #1448498). 65There is a new `F c' (`mh-catchup') command that marks all unread
66messages in the current folder as read.
56 67
57*** Variable mh-send-args Is a String, Not a List 68*** Use which-func-mode to Display Folder in Index Mode
58 69
59This was causing errors when sending under GNU mailutils. The internal 70Turning on `which-func-mode' displays the folder name of the message
60variable `mh-send-args' is now a list which fixes the problem (closes 71under the cursor in index folders (closes SF #855520).
61SF #1448604).
62 72
63*** Update Icons 73*** Quick Key Help
64 74
65Most of the tool bar icons have been replaced by GTK or GNOME 2 icons 75The `?' (`mh-help') function now displays the help in its own buffer
66(closes SF #1452715). 76called *MH-E Help* (closes SF #493740 and SF #656631).
67 77
68*** Can't customize tool bar for current session 78*** Search Unification
69 79
70If you customized `mh-tool-bar-folder-buttons' or 80The old `F s' behavior of adding messages to the search sequence has
71`mh-tool-bar-letter-buttons', and clicked Set for Current Session, the 81been removed. The `F i' keybinding was deprecated and the new `F s'
72tool bar was not updated. This has been fixed (closes SF #1452718). 82(`mh-search') command is used to initiate either indexed or pick
83searches. Within the MH-Search buffer (renamed from MH-Pick), the
84command `C-c C-p' (`mh-pick-do-search') now runs pick on the given
85folder recursively and displays the results in a search folder like
86the other search methods (closes SF #829207).
73 87
74*** Strip Build Number From emacs-version in X-Mailer 88*** Entry Points Have Moved
75 89
76This has been done (closes SF #1466481). 90Emacs 21 users must now add `(require 'mh-autoloads)' because the
91entry points (such as `mh-rmail' and `mh-smail') have moved to
92different files which have made the autoloads that come with Emacs
93inaccurate. This change was necessary because the code was reorganized
94to remove circular dependencies, to make the code more stable and
95maintainable, and to reduce the time to load MH-E.
77 96
78*** mh-folder-completion-function Problems 97*** MH-Folder Keymap Changes
79 98
80One could not longer browse folders outside of the standard MH Mail 99There is now a keymap for the printing functions whose prefix is `P'.
81directory. This has been fixed. As a beneficial side-effect, you can 100The command `l' (`mh-print-msg') has been replaced with `P l' although
82once again use SPC to complete folders (closes SF #1470518). 101we suggest you use the new `P p' instead.
83 102
84*** Rename Function and Variable Definers 103Key 7.4.4 8.0
85 104
86If you had ever shown help for an MH-E symbol that was both a function 105; - mh-toggle-mh-decode-mime-flag
87or variable, you might have found that the hyperlink to the file 106l mh-print-msg -
88brought you to the wrong definition. This has been fixed by renaming 107/ f mh-narrow-to-from -
89the macros `mh-defgroup', `mh-defcustom', `mh-defface', 108/ r mh-narrow-to-range -
90`mh-defun-compat', and `mh-defmacro-compat' to `defgroup-mh', 109/ g - mh-narrow-to-range
91`defcustom-mh', `defface-mh', `defun-mh', `defmacro-mh' respectively 110/ m - mh-narrow-to-from
92(closes SF #1472029). 111F c - mh-catchup
112F i mh-index-search -
113F s mh-search-folder mh-search
114K e - mh-display-with-external-viewer
115K t - mh-toggle-mime-buttons
116P ? - mh-prefix-help
117P C - mh-ps-print-toggle-color
118P F - mh-ps-print-toggle-faces
119P f - mh-ps-print-msg-file
120P l - mh-print-msg
121P p - mh-ps-print-msg
93 122
94*** mh-insert-letter Uses Wrong Default 123*** MH-Letter Keymap Changes
95 124
96If you had used `C-c TAB' (`mh-insert-letter') to insert a letter into 125The change where `mh-letter-mode' derives from `mail-mode' adds a few
97your draft, specified a different folder, and chose the default 126keybindings. Some are interesting: experiment! Only the keybinding
98message number, you got the wrong message. This has been fixed (closes 127changes for MH-E functions are listed here.
99SF #1473729).
100 128
101*** "echo -e" in Makefile Causes Solaris 10 Problem 129Most of the changes have to do with the renaming of the functions with
130"mhn" in them to "mh" because nmh doesn't use `mhn'. The names were
131also made consistent with the the family of "mml" functions.
102 132
103This construct has been replaced with printf, which is reputed to be 133The type of signing or encryption has been generalized so the method
104more portable (closes SF #1467222, #1473908). 134is now an option rather than a part of the function's name. The option
135is `mh-mml-method-default' and choices include PGP (MIME), PGP,
136S/MIME, or none.
105 137
106* Changes in MH-E 7.93 138Key 7.4.4 8.0
107 139
108Version 7.93, the fourth 8.0 beta release, fixes a handful of bugs in 140C-c C-e mh-edit-mhn mh-mh-to-mime
109searching and limiting exposed during continued beta testing. 141C-c RET C-e mh-mml-secure-message-encrypt-pgpmime
142 mh-mml-secure-message-encrypt
143C-c RET C-g - mh-mh-compose-anon-ftp
144C-c RET C-n - mh-mml-unsecure-message
145C-c RET C-s mh-mml-secure-message-sign-pgpmime
146 mh-mml-secure-message-sign
147C-c RET C-t - mh-mh-compose-external-compressed-tar
148C-c RET C-u mh-revert-mhn-edit mh-mh-to-mime-undo
149C-c RET C-x - mh-mh-compose-external-type
150C-c RET e mh-mml-secure-message-encrypt-pgpmime
151 Prefix Command
152C-c RET e e - mh-mml-secure-message-encrypt
153C-c RET e s - mh-mml-secure-message-signencrypt
154C-c RET g - mh-mh-compose-anon-ftp
155C-c RET n - mh-mml-unsecure-message
156C-c RET s - Prefix Command
157C-c RET s e - mh-mml-secure-message-signencrypt
158C-c RET s s - mh-mml-secure-message-sign
159C-c RET t - mh-mh-compose-external-compressed-tar
160C-c RET u mh-revert-mhn-edit mh-mh-to-mime-undo
161C-c RET x - mh-mh-compose-external-type
110 162
111** Variables Deleted in MH-E 7.93 163C-c C-f C-a - mh-to-field
164C-c C-f C-l - mh-to-field
165C-c C-f RET - mh-to-field
166C-c C-f a - mh-to-field
167C-c C-f l - mh-to-field
168C-c C-f m - mh-to-field
112 169
113*** mh-show-use-goto-addr-flag 170*** MH-Search Keymap Changes
114 171
115This flag was redundant and inconsistent with 172These are the changes associated with the new search mode. The command
116`goto-address-highlight-p' at the same time, so we removed it. Please 173`C-c C-c' (`mh-index-do-search') now performs the standard indexed
117customize `goto-address-highlight-p' if you wish to turn off email 174search, while `C-c C-p' (`mh-pick-do-search') runs pick as before,
118address and URL highlighting. 175only better!
119 176
120** Bug Fixes in MH-E 7.93 177The `mh-to-field' keybindings were adjusted to be consistent with
178those in the MH-Letter mode.
121 179
122*** `/ s' Can Miss the Original Mail 180Key 7.4.4 8.0
123 181
124The command `/ s' failed to include the message with the "Re:" in the 182C-c C-c mh-do-search mh-index-do-search
125Subject. This has been fixed (closes SF #1438369). 183C-c C-f C-d mh-to-field -
184C-c C-f C-f mh-to-field -
185C-c C-f C-r mh-to-field -
186C-c C-f RET - mh-to-field
187C-c C-f d mh-to-field -
188C-c C-f f mh-to-field -
189C-c C-f m - mh-to-field
190C-c C-f r mh-to-field -
191C-c TAB mh-index-do-search -
126 192
127*** XEmacs -nw Fails with number-char-or-marker-p Error 193*** Updates to X-Image-URL
128 194
129Hopefully, this is the last we'll hear of problems associated with 195Now support the use of `curl' and `fetch' as alternatives to `wget' to
130XEmacs' incompatible `device-color-cells' function (closes SF 196obtain the image. The display of images are controlled with the
131#1436924). 197`mh-show-use-xface-flag' option while the `mh-fetch-x-image-url'
198option controls how the images are fetched.
132 199
133*** Pick-based Searches Fail 200The default of `mh-fetch-x-image-url' has been changed to "Never
201Fetch." Those of you who like the value of "Ask Before Fetching" will
202have to customize this option (closes SF #831278).
134 203
135The command `C-c C-p' failed to find any matches. This has been fixed 204WARNING: There are security concerns with this feature. Please read
136(closes SF #1435381). 205the documentation for these options carefully before changing the
206default.
137 207
138*** Can't Narrow to Subject with Regexp Chars 208*** Updates to mh-identity-list
139 209
140The command `/ s' could not limit subjects that had special pick 210Note that the field names found in `mh-identity-list' that refer to
141characters (such as [, *, $, .). This has been fixed (closes SF 211the fields in `mh-identity-handlers' have changed in an incompatible
142#1432548). 212way from 7.4.4. In general, the symbolic names now have a ":" prefix
213to avoid collisions with header fields. Before starting Emacs, edit
214your .emacs and insert ":" before "signature" if you have defined it.
143 215
144 216You can change your attribution in replies with the new "Attribution
217Verb" field, and you can set your default GPG user ID with the "GPG
218key ID" field.
145 219
146* Changes in MH-E 7.92 220Signatures can now be read from the `mh-signature-file-name' variable,
221or come from a function, in addition to a named file. If you write
222your own function, variables that you can use include
223`mh-signature-separator-regexp', `mh-signature-separator',
224and `mh-signature-separator-p'.
147 225
148Version 7.92, the third 8.0 beta release, removes the "sed -i" in the 226The handling of these fields has been moved into a new
149Makefile (SF #1432060), tunes the setting of `mh-image-load-path', 227`mh-identity-handlers' option, an alist of fields (strings) and
150works around systems that do not have face inheritance, fixes several 228handlers (functions). Strings are lowercase. Use ":signature" for
151issues with searching on XEmacs, and creates the correct MIME type 229Signature and ":pgg-default-user-id" for GPG Key ID. The function
152when including OpenOffice documents. 230associated with the string "default" is used if no other functions are
231appropriate. For this reason, don't name a header field "Default".
153 232
154* Changes in MH-E 7.91 233If you point your signature at a vCard file with a vcf suffix, then it
234will be incorporated as a vCard body part (closes SF #802723).
155 235
156Version 7.91 is the second 8.0 beta release and fixes several bugs 236*** Updates to Speedbar
157that were uncovered in wider testing.
158 237
159* Changes in MH-E 7.90 238The speedbar now renders the folders with unseen messages in boldface
239which makes them easier to identify (closes SF #623369).
160 240
161Version 7.90 is the first 8.0 beta release and is a release that has 241*** Updates to mh-msg-is-in-seq
162finally broken away from some unfortunate legacy decisions in favor of
163something that will be easier to use and support. Many bugs were fixed
164and many features were added, including making the pick search
165equivalent to the other types of searches.
166 242
167The rewrite of the manual accelerated dramatically in recent months 243Can now specify an alternate message number to `S s'
168and drove the changes in this release. In order to make the 244(`mh-msg-is-in-seq') with a prefix argument.
169manual--and hence the software--better, clearer, more consistent, more
170predictable, and easier to understand, many variables and functions
171were renamed. The changes to the user-visible variables are listed
172here. It is our hope that you, dear MH-E user, will embrace the
173changes for the better and forgive us from making so many incompatible
174changes.
175 245
176If you use undocumented functionality, be sure to read the ChangeLog 246*** Updates to mh-to-field-choices
177for changes that might affect you.
178 247
179** New Features in MH-E 7.90 248In MH-Letter mode, you can use the `C-c C-f' (`mh-to-field') prefix to
249go to and insert fields. The fields `Reply-To:', `Mail-Reply-To:',
250`Mail-Followup-To:' can now be created via the `C-r', `C-a' (for
251author), and `C-l' keys respectively. The key for the `From:' field
252has been renamed from `C-r' to `C-m' for consistency with `mail-mode'
253(closes SF #1400139).
180 254
181*** Entry Points Have Moved 255*** Change Content-Type Renderer on the Fly in MH-Show Buffer
182 256
183Emacs 21 users must now add `(require 'mh-autoloads)' because the 257This has been implemented by adding the key binding `K e'
184entry points (such as `mh-rmail' and `mh-smail') have moved to 258(`mh-display-with-external-viewer'). For inline text/html parts,
185different files which have made the autoloads that come with Emacs 259buttons aren't displayed by default. In that case use `K t'
186inaccurate. This change was necessary because the code was reorganized 260(`mh-toggle-mime-buttons') to display the button before viewing it
187to remove circular dependencies, to make the code more stable and 261with an external browser (closes SF #839318).
188maintainable, and to reduce the time to load MH-E.
189 262
190*** MH-E No Longer Calls install-mh 263*** MH-E No Longer Calls install-mh
191 264
@@ -193,28 +266,26 @@ The new variant detection code makes use of `mhparam' which assumes
193that your MH environment has already been set up. The code to call 266that your MH environment has already been set up. The code to call
194`install-mh', which could no longer be run anyway, was removed. 267`install-mh', which could no longer be run anyway, was removed.
195 268
196*** Use run-hook-with-args 269*** Add :package-version Keyword to Options
197 270
198We use normal hooks whenever possible and do not use 271This `defcustom', `defgroup', and `defface' keyword was introduced in
199`run-hook-with-args' (with one documented exception) (closes SF 272Emacs 22.1. MH-E has been extended to take advantage of it. With this
200#643702). 273keyword, you can now use `M-x customize-changed-options' to see what
274options in MH-E have changed between versions of Emacs. In a future
275version of Emacs, you'll be able to see changes between MH-E versions
276as well (closes SF #1452724).
201 277
202*** Merge mh-index.el and mh-pick.el 278*** Render Signature and vCard in Italics
203 279
204We merged `mh-index.el' and `mh-pick.el' into a new file 280This has been implemented. Use `mh-show-signature-face' to customize
205`mh-search.el'. As part of this process, the old `F s' behavior of 281the face used (closes SF #802722).
206adding messages to the search sequence has been removed. The `F i'
207keybinding was then renamed to `F s' (`mh-search'). The mode of the
208search-pattern buffer was renamed from MH-Pick to MH-Search. Within
209the MH-Search buffer, the command `C-c C-p' (`mh-pick-do-search') now
210runs pick on the given folder recursively and displays the results in
211a search folder like the other search methods (closes SF #829207).
212 282
213*** Improve Security of mh-fetch-x-image-url 283*** Derive mh-letter-mode from mail-mode
214 284
215The default has been changed to "Never Fetch." Those of you who like 285MH-Letter mode is now derived from `mail-mode'. We were able to delete
216the value of "Ask Before Fetching" will have to customize this option 286a lot of code. In return, there are a few `mail-mode' commands that
217(closes SF #831278). 287are available that may or may not be useful and the `mail-mode-hook'
288is run (closes SF #1385571).
218 289
219*** Remove Emacs 20 Support 290*** Remove Emacs 20 Support
220 291
@@ -222,100 +293,92 @@ As it turns out, we had already added some code that didn't work on
222Emacs 20. However, now we've formalized it and removed code that was 293Emacs 20. However, now we've formalized it and removed code that was
223present solely for Emacs 20 support (closes SF #1359240). 294present solely for Emacs 20 support (closes SF #1359240).
224 295
225*** Derive mh-letter-mode from mail-mode 296*** Glimpse Support Removed
226
227MH-Letter mode is now derived from `mail-mode'. We were able to delete
228a lot of code. In return, there are a few `mail-mode' commands that
229are available that may or may not be useful and the `mail-mode-hook'
230is run (closes SF #1385571).
231 297
232*** Add Choices to mh-to-field-choices 298Since glimpse isn't free, we cannot mention it. Glimpse has been
299removed from the option `mh-indexer-choices' (closes SF #831276).
233 300
234In MH-Letter mode, you can use the "C-c C-f (mh-to-field)" prefix to 301*** Use run-hook-with-args
235go to and insert fields. The fields "Reply-To:", "Mail-Reply-To:",
236"Mail-Followup-To:" can now be created via the "C-r", "C-a" (for
237author), and "C-l" keys respectively. The key for the "From:" field
238has been renamed from "C-r" to "C-m" for consistency with `mail-mode'
239(closes SF #1400139).
240 302
241*** MH-Folder Keymap Changes 303We use normal hooks whenever possible and do not use
304`run-hook-with-args' (with one documented exception) (closes SF
305#643702).
242 306
243The function `mh-ps-print-toggle-mime' was never implemented and the 307
244functionality in `mh-ps-print-msg-show' was better afforded by
245`mh-ps-print-msg' and `mh-ps-print-msg-file'.
246 308
247Key 7.4.85 7.4.90 309** New Variables in MH-E 8.0
248 310
249F i mh-index-search - 311*** mh-after-commands-processed-hook
250F s mh-search-folder mh-search
251P A mh-ps-print-toggle-mime -
252P M mh-ps-print-toggle-mime -
253P s mh-ps-print-msg-show -
254 312
255*** MH-Letter Keymap Changes 313Hook run by `x' (`mh-execute-commands') after performing outstanding
314refile and delete requests.
256 315
257The change where `mh-letter-mode' derives from `mail-mode' adds a few 316*** mh-alias-reloaded-hook
258keybindings. Some are interesting; experiment! Most of the changes
259have to do with the renaming of the functions with "mhn" in them to
260"mh" because nmh doesn't use `mhn'. The names were also made
261consistent with the the family of "mml" functions.
262 317
263Key 7.4.85 7.4.90 318Invoked by `mh-alias-reload' after reloading aliases.
264 319
265C-c C-e mh-edit-mhn mh-mh-to-mime 320*** mh-auto-fields-prompt-flag
266C-c C-f C-a - mh-to-field
267C-c C-f C-l - mh-to-field
268C-c C-f RET - mh-to-field
269C-c C-f a - mh-to-field
270C-c C-f l - mh-to-field
271C-c C-f m - mh-to-field
272C-c RET C-g mh-mhn-compose-anon-ftp mh-mh-compose-anon-ftp
273C-c RET C-t mh-mhn-compose-external-compressed-tar
274 mh-mh-compose-external-compressed-tar
275C-c RET C-u mh-revert-mhn-edit mh-mh-to-mime-undo
276C-c RET C-x mh-mhn-compose-external-type mh-mh-compose-external-type
277C-c RET g mh-mhn-compose-anon-ftp mh-mh-compose-anon-ftp
278C-c RET t mh-mhn-compose-external-compressed-tar
279 mh-mh-compose-external-compressed-tar
280C-c RET u mh-revert-mhn-edit mh-mh-to-mime-undo
281C-c RET x mh-mhn-compose-external-type mh-mh-compose-external-type
282 321
283*** MH-Search Keymap Changes 322On means to prompt before sending if fields in `mh-auto-fields-list'
323are inserted.
284 324
285These are the changes associated with the new search mode. The command 325*** mh-before-commands-processed-hook
286`C-c C-c' (`mh-index-do-search') now performs the standard indexed
287search, while `C-c C-p' (`mh-pick-do-search') runs pick as before,
288only better!
289 326
290Key 7.4.85 7.4.90 327Renamed from `mh-folder-updated-hook'. It wasn't clear whether
328`mh-folder-updated-hook' was run before or after the commands were
329executed. We now provide both with clear names.
291 330
292C-c C-c mh-do-search mh-index-do-search 331*** mh-compose-forward-as-mime-flag
293C-c TAB mh-index-do-search -
294 332
295** New Variables in MH-E 7.90 333On means that messages are forwarded as attachments (closes SF
334#827203).
296 335
297*** mh-after-commands-processed-hook 336*** mh-default-folder-for-message-function
298 337
299Hook run by `x' (`mh-execute-commands') after performing outstanding 338Function to select a default folder for refiling or `Fcc:'.
300refile and delete requests.
301 339
302*** mh-before-commands-processed-hook 340*** mh-forward-hook
303 341
304Renamed from `mh-folder-updated-hook'. It wasn't clear whether 342Invoked on the forwarded letter by `f' (`mh-forward').
305`mh-folder-updated-hook' was run before or after the commands were
306executed. We now provide both with clear names.
307 343
308*** mh-highlight-citation-style 344*** mh-highlight-citation-style
309 345
310Renamed from `mh-highlight-citation-p' since it wasn't a boolean. The 346Renamed from `mh-highlight-citation-p' since it wasn't a boolean. The
311new name is also more descriptive. 347new name is also more descriptive.
312 348
349*** mh-identity-handlers
350
351Handler functions for fields in `mh-identity-list'.
352
313*** mh-insert-signature-hook 353*** mh-insert-signature-hook
314 354
315Renamed from `mh-letter-insert-signature-hook' since most of the other 355Renamed from `mh-letter-insert-signature-hook' since most of the other
316hooks do not carry the mode in the prefix and because the new name is 356hooks do not carry the mode in the prefix and because the new name is
317equally clear. 357equally clear.
318 358
359*** mh-invisible-header-fields-default
360
361List of hidden header fields. The header fields listed in this option
362are hidden, although you can check off any field that you would like
363to see. Header fields that you would like to hide that aren't listed
364can be added to the `mh-invisible-header-fields' option (closes SF
365#752045).
366
367The option `mh-visible-header-fields' has been deleted.
368
369*** mh-junk-background
370
371If on, spam programs are run in background. This used to be the
372default behavior but this could overwhelm a system if many messages
373were black- or whitelisted at once. The spam programs are now run in
374the foreground, but this option can be used to put them back in the
375background.
376
377*** mh-junk-disposition
378
379Renamed from `mh-junk-mail-folder' since this variable can accept
380values other than folder names.
381
319*** mh-kill-folder-suppress-prompt-hooks 382*** mh-kill-folder-suppress-prompt-hooks
320 383
321Renamed from `mh-kill-folder-suppress-prompt-hook'. By convention, 384Renamed from `mh-kill-folder-suppress-prompt-hook'. By convention,
@@ -333,6 +396,10 @@ Renamed from `mh-edit-mhn-hook'. We have a family of `mh-mml-to-mime'
333functions and variables; the older mhn functions and variables were 396functions and variables; the older mhn functions and variables were
334renamed to have a consistent `mh-mh-to-mime' prefix. 397renamed to have a consistent `mh-mh-to-mime' prefix.
335 398
399*** mh-mml-method-default
400
401Default method to use in security tags.
402
336*** mh-new-messages-folders 403*** mh-new-messages-folders
337 404
338Renamed from `mh-index-new-messages-folders' for clarity. 405Renamed from `mh-index-new-messages-folders' for clarity.
@@ -356,6 +423,14 @@ Renamed from `mh-pick-mode-hook' as part of the
356Renamed from `mh-index-program' as part of the 423Renamed from `mh-index-program' as part of the
357`mh-index.el'/`mh-pick.el' merge into `mh-search.el'. 424`mh-index.el'/`mh-pick.el' merge into `mh-search.el'.
358 425
426*** mh-signature-separator-flag
427
428On means a signature separator should be inserted. It is not
429recommended that you change this option since various mail user
430agents, including MH-E, use the separator to present the signature
431differently, and to suppress the signature when replying or yanking a
432letter into a draft.
433
359*** mh-sortm-args 434*** mh-sortm-args
360 435
361Additional arguments for `sortm'. This was previously an internal 436Additional arguments for `sortm'. This was previously an internal
@@ -369,6 +444,25 @@ Renamed from `mh-speed-flists-interval' for clarity.
369 444
370Renamed from `mh-index-ticked-messages-folders' for clarity. 445Renamed from `mh-index-ticked-messages-folders' for clarity.
371 446
447*** mh-variant
448
449Specifies the variant used by MH-E. The default setting of this option
450is `Auto-detect' which means that MH-E will automatically choose the
451first of nmh, MH, or GNU mailutils that it finds in the directories
452listed in `mh-path', `mh-sys-path', and `exec-path'. If, for example,
453you have both nmh and mailutils installed and `mh-variant-in-use' was
454initialized to nmh but you want to use mailutils, then you can set
455this option to `mailutils'.
456
457When this variable is changed, MH-E resets `mh-progs', `mh-lib',
458`mh-lib-progs', `mh-flists-present-flag', and `mh-variant-in-use'
459accordingly.
460
461If you've set these variables in your .emacs, it is strongly suggested
462that you comment them out. The MH detection code has been completely
463rewritten and it is very likely that you no longer to set them and
464their setting may confuse other MH-E settings.
465
372*** mh-xemacs-tool-bar-position 466*** mh-xemacs-tool-bar-position
373 467
374Renamed from `mh-xemacs-toolbar-position' per GNU Emacs naming conventions. 468Renamed from `mh-xemacs-toolbar-position' per GNU Emacs naming conventions.
@@ -381,11 +475,13 @@ Renamed from `mh-xemacs-use-toolbar-flag' per GNU Emacs naming conventions.
381 475
382Renamed from `mh-yank-from-start-of-msg' for clarity. 476Renamed from `mh-yank-from-start-of-msg' for clarity.
383 477
384** Variables Deleted in MH-E 7.90 478
385 479
386*** mail-citation-hook 480** Variables Deleted in MH-E 8.0
387 481
388This is already defined in `sendmail.el'. 482*** mh-alias-system-aliases
483
484System definitions should not be a user option.
389 485
390*** mh-edit-mhn-hook 486*** mh-edit-mhn-hook
391 487
@@ -411,6 +507,11 @@ Renamed to `mh-search-program'.
411 507
412Renamed to `mh-ticked-messages-folders'. 508Renamed to `mh-ticked-messages-folders'.
413 509
510*** mh-junk-mail-folder
511
512Since this variable can accept values other than folder names, it was
513renamed to `mh-junk-disposition' to more accurately reflect the content.
514
414*** mh-kill-folder-suppress-prompt-hook 515*** mh-kill-folder-suppress-prompt-hook
415 516
416Renamed to `mh-kill-folder-suppress-prompt-hooks'. 517Renamed to `mh-kill-folder-suppress-prompt-hooks'.
@@ -419,14 +520,17 @@ Renamed to `mh-kill-folder-suppress-prompt-hooks'.
419 520
420Renamed to `mh-insert-signature-hook'. 521Renamed to `mh-insert-signature-hook'.
421 522
422*** mhl-formfile
423
424Renamed to `mh-mhl-format-file'.
425
426*** mh-pick-mode-hook 523*** mh-pick-mode-hook
427 524
428Renamed to `mh-search-mode-hook'. 525Renamed to `mh-search-mode-hook'.
429 526
527*** mh-show-use-goto-addr-flag
528
529This flag was redundant with and inconsistent with
530`goto-address-highlight-p' at the same time, so we removed it. Please
531customize `goto-address-highlight-p' if you wish to turn off email
532address and URL highlighting.
533
430*** mh-speed-flists-interval 534*** mh-speed-flists-interval
431 535
432Renamed to `mh-speed-update-interval'. 536Renamed to `mh-speed-update-interval'.
@@ -436,6 +540,10 @@ Renamed to `mh-speed-update-interval'.
436Deleted since setting `mh-speed-flists-interval' to 0 accomplishes the 540Deleted since setting `mh-speed-flists-interval' to 0 accomplishes the
437same thing. 541same thing.
438 542
543*** mh-visible-header-fields
544
545Deleted since it would hide new header fields you might want to see.
546
439*** mh-xemacs-toolbar-position 547*** mh-xemacs-toolbar-position
440 548
441Renamed to `mh-xemacs-tool-bar-position'. 549Renamed to `mh-xemacs-tool-bar-position'.
@@ -448,538 +556,263 @@ Renamed to `mh-xemacs-use-tool-bar-flag'.
448 556
449Renamed to `mh-yank-behavior'. 557Renamed to `mh-yank-behavior'.
450 558
451** Bug Fixes in MH-E 7.90 559*** mhl-formfile
452
453*** Error Message When Trying to Send Using MH-E
454
455This behavior is no longer observed (closes SF #1002103).
456
457*** "Args out of range" Error in Displaying Message
458
459This behavior is no longer observed (closes SF #1227504).
460
461*** Front-and-back Truncation in mailto: Rendering
462
463This behavior is no longer observed (closes SF #1227510).
464
465*** Completions Offered by mh-refile-message Are Not Sorted
466
467This behavior is no longer observed (closes SF #698734).
468
469*** Add Message-ID to Outgoing Messages
470
471If you replied to a message in your `+outbox', an `In-Reply-To:'
472header field was created that broke threading at the recipient's end.
473We now add a `Message-ID:' to outgoing messages which fixes this
474(closes SF #725425).
475
476*** Speedbar Creating New Folders Instead of Visiting Existing
477
478This was actually fixed in 7.4.3 (closes SF #792300).
479
480*** Args Out of Range
481
482This compilation error was actually fixed in 7.4.3 (closes SF
483#806577).
484
485*** Initialization Fails If ~/Mail Exists
486
487MH-E no longer calls `install-mh' so this issue has gone away (closes
488SF #835192).
489
490*** RETURN Causes Infinite Loop in mh-letter
491
492This behavior is no longer observed (closes SF #887346).
493
494*** Missing Headers When Replying to All
495
496User needed to edit `replgroupcomps' (closes SF #918194).
497
498*** mh-find-path Doesn't Use mhparam
499
500MH-E no longer peeks into the MH profile `~/.mh_profile' directly. It
501uses `mhparam' instead (closes SF #1016027).
502
503*** mh-index-previous-folder Does Not Work Correctly
504
505If your cursor was on an item below a folder heading and you used
506`M-TAB' (`mh-index-previous-folder'), you would move to the previous
507folder heading. This has been fixed (closes SF #1126188).
508
509*** XEmacs Compile Fails
510 560
511Compiling produced a "Symbol's value as variable is void: require" 561Renamed to `mh-mhl-format-file'.
512error on all files. This has been fixed. As a bonus, warnings have
513been reduced from hundreds to just a few (closes SF #1127595).
514 562
515*** buffer-offer-save Permanent Local 563
516 564
517There was a movement to make `buffer-offer-save' a permanent local 565** New Faces in MH-E 8.0
518which would have meant that we could not set it in `mh-letter-mode'.
519However, this movement was fraught with issues and was postponed
520(closes SF #1184756).
521 566
522*** Better Handling of Empty cur Sequence 567*** mh-folder-address
523 568
524If you refiled a message into a folder and then used `F r' 569Renamed from `mh-folder-address-face' per new Emacs conventions.
525(`mh-rescan-folder') in that folder, your cursor would be taken to the
526first message. The cursor now stays where it was (closes SF #1207247).
527 570
528*** Name of the Draft File in mh-comp.el 571*** mh-folder-body
529 572
530MH is documented to use the draft file. If you use a draft file for 573Renamed from `mh-folder-body-face' per new Emacs conventions.
531something else (like Sylpheed), then use draft folders (closes SF
532#1231483).
533 574
534*** Use Standard Default Notation in Prompts 575*** mh-folder-cur-msg-number
535 576
536Emacs changed their defaults in prompts from "Prompt: [value]" to 577Renamed from `mh-folder-cur-msg-number-face' per new Emacs conventions.
537"Prompt (default value): ". All MH-E prompts have been updated to
538comply with the new standard (closes SF #1275933).
539 578
540*** Msg Display Broken After Displaying Msg with Inline Image 579*** mh-folder-date
541 580
542Messages with inline images no longer trim certain message header 581Renamed from `mh-folder-date-face' per new Emacs conventions.
543fields (closes SF #1306141).
544 582
545*** mh-visit-folder Munges font-lock-keywords 583*** mh-folder-deleted
546 584
547MH-E broke highlighting in Gnus buffers. This was actually a problem 585Renamed from `mh-folder-deleted-face' per new Emacs conventions.
548in CVS Emacs 22 and has been fixed there (closes SF #1393879).
549 586
550*** Illegal Filename Chars for W32 Filesystems 587*** mh-folder-followup
551 588
552Windows users who view `X-Image-URL:' images could not cache the 589Renamed from `mh-folder-followup-face' per new Emacs conventions.
553images since the cached image file names had illegal characters. This
554has been fixed (closes SF #1396499).
555 590
556*** mh-send Doesn't Handle mml Insertions Via mail-user-agent 591*** mh-folder-msg-number
557 592
558Can now forward messages in Gnus if MH-E is your `mail-user-agent' 593Renamed from `mh-folder-msg-number-face' per new Emacs conventions.
559(closes SF #1399307).
560 594
561 595*** mh-folder-refiled
562 596
563* Changes in MH-E 7.85 597Renamed from `mh-folder-refiled-face' per new Emacs conventions.
564 598
565Version 7.85 heralds a migration of the CVS repository from 599*** mh-folder-sent-to-me-hint
566SourceForge to Savannah only for those files that were already part of
567Emacs. As a result, two incompatibilities were introduced with this
568release: the location of MH-E in the load-path has changed, and
569mh-e-autoloads.el was renamed to mh-autoloads.el. While this migration
570will benefit maintainers, it will also benefit users: CVS Emacs users
571will not have to check out MH-E separately and welcome faster MH-E
572updates, and CVS MH-E users will welcome faster MH-E updates from
573Emacs developers. Read section CVS MH-E INSTALL in the README for
574details.
575 600
576MH-E now works on a Mac. See section INSTALL in the README for details. 601Fontification hint face in messages sent directly to us.
577 602
578** Bug Fixes in MH-E 7.85 603*** mh-folder-sent-to-me-sender
579 604
580*** Prompts Now Follow Current Conventions 605Sender face in messages sent directly to us.
581 606
582Instead of "Prompt: [<default>] ", the prompts now look like "Prompt 607*** mh-folder-subject
583(default: <default>): ".
584 608
585*** Face Variable Names Now Follow Current Conventions 609Renamed from `mh-folder-subject-face' per new Emacs conventions.
586 610
587The -face suffix has been dropped from all face names. 611*** mh-folder-tick
588 612
589*** Default Identity Prevents Insertion of Auto Fields 613Renamed from `mh-folder-tick-face' per new Emacs conventions.
590 614
591Auto insertion of an identity now occurs even when the default 615*** mh-folder-to
592identity is used (closes SF #1204506).
593 616
594*** mh-compose-forward and Default Message Number 617Renamed from `mh-folder-to-face' per new Emacs conventions.
595 618
596mh-compose-forward will now default to the sent message in the sent 619*** mh-letter-header-field
597folder and the `cur' message in other folders. It also takes ranges of
598messages and can include multiple messages at a time (closes SF
599#1205890).
600 620
601*** mh-customize Uses Group mh, Not mh-e 621Renamed from `mh-letter-header-field-face' per new Emacs conventions.
602 622
603The `mh' customization group alias has been deleted to avoid some 623*** mh-search-folder
604problems that were found (closes SF #1213716).
605 624
606*** font-lock Error in mh-letter-mode 625Renamed from `mh-index-folder-face'.
607 626
608An error in MH-E was introduced as a result of a change in CVS Emacs. 627*** mh-show-cc
609This has been fixed (closes SF #1241017).
610 628
611 629Renamed from `mh-show-cc-face' per new Emacs conventions.
612 630
613* Changes in MH-E 7.84 631*** mh-show-date
614 632
615Version 7.84 contains no user-visible changes. This version 633Renamed from `mh-show--face' per new Emacs conventions.
616incorporates changes made in CVS Emacs such as the removal of some
617deprecated software.
618 634
619* Changes in MH-E 7.83 635*** mh-show-from
620 636
621Version 7.83 fixes a handful of bugs, adds colors to buttons for 637Renamed from `mh-show-from-face' per new Emacs conventions.
622signed or encrypted messages, and contains some documentation changes
623related to the upcoming release of the manual. Some options were moved
624to other customization groups as a result.
625 638
626While not related to this release, the MH-E mailing lists are now 639*** mh-show-header
627gatewayed at gmane.org (closes SF #979308).
628 640
629** New Variables in MH-E 7.83 641Renamed from `mh-show-header-face' per new Emacs conventions.
630 642
631*** mh-show-pgg-bad-face 643*** mh-show-pgg-bad
632 644
633Face used to highlight a bad PGG signature. 645Face used to highlight a bad PGG signature.
634 646
635*** mh-show-pgg-good-face 647*** mh-show-pgg-good
636 648
637Face used to highlight a good PGG signature. 649Face used to highlight a good PGG signature.
638 650
639*** mh-show-pgg-unknown-face 651*** mh-show-pgg-unknown
640 652
641Face used to highlight a PGG signature whose status is unknown. This 653Face used to highlight a PGG signature whose status is unknown. This
642face is also used for a signature when the signer is untrusted. 654face is also used for a signature when the signer is untrusted.
643 655
644** Bug Fixes in MH-E 7.83 656*** mh-show-signature
645 657
646*** Whitespace in pick Expressions 658Face used to highlight the signature.
647 659
648The "C-u / s RET" command now works. In addition, you can now add 660*** mh-show-subject
649whitespace to any of the limiting (/) commands (closes SF #1122655).
650 661
651*** auto-mode-alist Updated 662Renamed from `mh-show-subject-face' per new Emacs conventions.
652 663
653MH-E originally updated auto-mode-alist to set the major mode of 664*** mh-show-to
654drafts. Now that we explicitly set the mode, there is no reason to do
655this, and this behavior caused problems for people who didn't use MH-E
656who were editing files that looked like MH message files (closes SF
657#1032353).
658 665
659*** mh-show-unquote-From Fails (read-only buffer) 666Renamed from `mh-show-to-face' per new Emacs conventions.
660 667
661MH-E quotes the "From " header field that is inserted by MTAs. 668*** mh-show-xface
662However, it was trying to do this in a read-only buffer. This has been
663fixed (closes SF #1089870).
664 669
665*** rmmproc Refile Complains No Such Message 670Renamed from `mh-show-xface-face' per new Emacs conventions.
666 671
667MH-E would get confused about which folder to delete messages from if 672*** mh-speedbar-folder
668you were refiling and deleting messages at the same time. This has
669been fixed (closes SF #1023959).
670 673
671*** ! Doesn't Do Regions 674Renamed from `mh-speedbar-folder-face' per new Emacs conventions.
672 675
673Now it does (closes SF #1046330). 676*** mh-speedbar-folder-with-unseen-messages
674 677
675*** Swish Fixes 678Renamed from `mh-speedbar-folder-with-unseen-messages-face' per new
679Emacs conventions.
676 680
677Items in swish indexes that aren't mail messages are now handled more 681*** mh-speedbar-selected-folder
678gracefully.
679 682
680*** Spamassassin Fixes 683Renamed from `mh-speedbar-selected-folder-face' per new Emacs conventions.
681
682If you use spamassassin, there was an error when you tried to junk
683mail if the option mh-junk-background was set. This has been fixed.
684 684
685*** Mairix Support 685*** mh-speedbar-selected-folder-with-unseen-messages
686 686
687Indexing now compatible with Mairix version 0.12 and later. 687Renamed from `mh-speedbar-selected-folder-with-unseen-messages-face'
688per new Emacs conventions.
688 689
689 690
690 691
691* Changes in MH-E 7.82 692** Faces Deleted in MH-E 8.0
692 693
693Version 7.82 continues to address the saga surrounding the use of CL 694*** mh-folder-address-face
694macros in CVS Emacs and fixes the auto-detection of vanilla MH (closes
695SF #1014781).
696 695
697* Changes in MH-E 7.81 696Renamed to `mh-folder-address' per new Emacs conventions.
698 697
699Version 7.81 fixes a `wrong-type-argument' argument error that 698*** mh-folder-body-face
700sometimes occurred when processing the Message-ID, adds the ";
701(mh-toggle-mh-decode-mime-flag)" command, and uses ":default" instead
702of "default" in `mh-identity-handlers' to avoid problems with
703"Default:" as a user defined field. If you have modified
704`mh-identity-handlers' in your .emacs, you'll need to rename "default"
705to ":default". This release also corrects the release numbering; the
706previous version number was intended to be 7.80.
707 699
708 700Renamed to `mh-folder-body' per new Emacs conventions.
709 701
710* Changes in MH-E 7.4.80 702*** mh-folder-cur-msg-face
711
712Version 7.4.80 now supports GNU mailutils, S/MIME, picons,
713which-func-mode, has an improved interface for hiding header fields,
714improves upon the MH variant detection, and contains many bug fixes.
715Those of you familiar with the GNU version numbering schemes will
716recognize this as an alpha release. This does not reflect on the
717quality of this release which is as high as it has always been.
718Although we are not ready to release 8.0, we want you to have access
719to the work that has been hiding in CVS. At the same time we want to
720make it clear that there are incompatible changes with previous
721versions.
722
723We are planning to release the long-awaited manual update synchronized
724with version 8.0. We are using documentation from the manual in the
725docstrings which is hoped to make "C-h f (describe-function)" really
726useful and create a seamless experience when switching back and forth
727between the manual and the docstrings. This has been done in about
728half of the variables and functions in this version.
729
730The writing of the manual has revealed a few inconsistencies in the
731software whose fixes have resulted in incompatible changes, and there
732may well be more. So, unlike version 7 which was chock full of new
733features, version 8's strengths will include complete documentation
734and higher quality.
735
736** New Features in MH-E 7.4.80
737 703
738*** GNU mailutils Support 704Deleted. Not used.
739 705
740MH-E now supports GNU mailutils 0.4 and higher versions. 706*** mh-folder-cur-msg-number-face
741 707
742*** S/MIME Support 708Renamed to `mh-folder-cur-msg-number' per new Emacs conventions.
743 709
744MH-E now supports S/MIME using Gnus 5.10.6 or higher. 710*** mh-folder-date-face
745 711
746*** Picon Support 712Renamed to `mh-folder-date' per new Emacs conventions.
747 713
748In addition to the other methods of displaying an icon for the sender 714*** mh-folder-deleted-face
749of a message, MH-E can now display images from a picon directory. The
750directory search path is found in the `mh-picon-directory-list'
751variable. More documentation is found in the "facedb" sections in the
752xfaces man page. [NOTE: need to make mh-picon-directory-list an option
753and add xfaces facedb documentation to it.]
754 715
755*** X-Image-URL Updates 716Renamed to `mh-folder-deleted' per new Emacs conventions.
756 717
757Now support the use of `curl' and `fetch' as alternatives to `wget' to 718*** mh-folder-followup-face
758obtain the image. The display of images are controlled with the
759`mh-show-use-xface-flag' option while the `mh-fetch-x-image-url'
760option controls how the images are fetched.
761 719
762WARNING: There are security concerns with this feature. Please read 720Renamed to `mh-folder-followup' per new Emacs conventions.
763the documentation for these options carefully before changing the
764default.
765 721
766*** Updates to mh-identity-list 722*** mh-folder-msg-number-face
767 723
768Note that the field names found in `mh-identity-list' that refer to 724Renamed to `mh-folder-msg-number' per new Emacs conventions.
769the fields in `mh-identity-handlers' have changed in an incompatible
770way from 7.4.4. In general, the symbolic names now have a ":" prefix
771to avoid collisions with header fields. Before starting Emacs, edit
772your .emacs and insert ":" before "signature" if you have defined it.
773 725
774You can change your attribution in replies with the new "Attribution 726*** mh-folder-refiled-face
775Verb" field, and you can set your default GPG user ID with the "GPG
776key ID" field.
777 727
778Signatures can now be read from the `mh-signature-file-name' variable, 728Renamed to `mh-folder-refiled' per new Emacs conventions.
779or come from a function, in addition to a named file. If you write
780your own function, variables that you can use include
781`mh-signature-separator-regexp', `mh-signature-separator',
782and `mh-signature-separator-p'.
783 729
784The handling of these fields has been moved into a new 730*** mh-folder-subject-face
785`mh-identity-handlers' option, an alist of fields (strings) and
786handlers (functions). Strings are lowercase. Use ":signature" for
787Signature and ":pgg-default-user-id" for GPG Key ID. The function
788associated with the string "default" is used if no other functions are
789appropriate. For this reason, don't name a header field "Default".
790 731
791If you point your signature at a vCard file with a vcf suffix, then it 732Renamed to `mh-folder-subject' per new Emacs conventions.
792will be incorporated as a vCard body part (closes SF #802723).
793 733
794*** Catchup Command 734*** mh-folder-tick-face
795 735
796There is a new "F c (mh-catchup)" command that marks all unread 736Renamed to `mh-folder-tick' per new Emacs conventions.
797messages in the current folder as read.
798 737
799*** Change Content-Type Renderer on the Fly in MH-Show Buffer 738*** mh-folder-to-face
800 739
801This has been implemented by adding the key binding "K e 740Renamed to `mh-folder-to' per new Emacs conventions.
802(mh-display-with-external-viewer)". For inline text/html parts,
803buttons aren't displayed by default. In that case use "K t
804(mh-toggle-mime-buttons)" to display the button before viewing it with
805an external browser (closes SF #839318).
806 741
807*** Use which-func-mode to Display Folder in Index Mode 742*** mh-index-folder-face
808 743
809Turning on `which-func-mode' displays the folder name of the message 744Renamed to `mh-search-folder'.
810under the cursor in index folders (closes SF #855520).
811
812*** Render Signature and vCard in Italics
813
814This has been implemented. Use `mh-show-signature-face' to customize
815the face used (closes SF #802722).
816 745
817*** New Print Map 746*** mh-letter-header-field-face
818 747
819There is now a keymap for the printing functions whose prefix is "P". 748Renamed to `mh-letter-header-field' per new Emacs conventions.
820The command "l (mh-print-msg)" has been replaced with "P l". Other new
821functions in this keymap include:
822 749
823 P A mh-ps-print-toggle-mime 750*** mh-show-cc-face
824 P C mh-ps-print-toggle-color
825 P F mh-ps-print-toggle-faces
826 P M mh-ps-print-toggle-mime
827 P f mh-ps-print-msg-file
828 P l mh-print-msg
829 P p mh-ps-print-msg
830 P s mh-ps-print-msg-show
831 751
832*** Draft Buffer Keymap Changes 752Renamed to `mh-show-cc' per new Emacs conventions.
833
834The keymap in the draft buffer has been modified slightly. The old
835anonymous ftp and tar composition commands have been reinstated and
836letter signing and encrypting keymaps have been added.
837
838The type of signing or encryption has been generalized so the method
839is now an option rather than a part of the function's name. The option
840is `mh-mml-method-default' and choices include PGP (MIME), PGP,
841S/MIME, or none.
842
843Key 7.4.4 7.4.80
844
845C-c RET C-e mh-mml-secure-message-encrypt-pgpmime
846 mh-mml-secure-message-encrypt
847C-c RET C-s mh-mml-secure-message-sign-pgpmime
848 -
849C-c RET C-g - mh-mhn-compose-anon-ftp
850C-c RET C-n - mh-mml-unsecure-message
851C-c RET C-s - mh-mml-secure-message-sign
852C-c RET C-t - mh-mhn-compose-external-compressed-tar
853C-c RET C-s mh-mml-secure-message-sign-pgpmime
854 mh-mml-secure-message-sign
855C-c RET C-x - mh-mhn-compose-external-type
856C-c RET e mh-mml-secure-message-encrypt-pgpmime
857 Prefix Command
858C-c RET e e - mh-mml-secure-message-encrypt
859C-c RET e s - mh-mml-secure-message-signencrypt
860C-c RET g - mh-mhn-compose-anon-ftp
861C-c RET n - mh-mml-unsecure-message
862C-c RET s mh-mml-secure-message-sign-pgpmime
863 Prefix Command
864C-c RET s e - mh-mml-secure-message-signencrypt
865C-c RET s s - mh-mml-secure-message-sign
866C-c RET t - mh-mhn-compose-external-compressed-tar
867C-c RET x - mh-mhn-compose-external-type
868
869*** Speedbar: Highlight Folders With Unseen
870
871The speedbar now renders the folders with unseen messages in boldface
872which makes them easier to identify (closes SF #623369).
873
874*** Quick Key Help
875
876The "? (mh-help)" function now displays the help in its own buffer
877called *MH-E Help* (closes SF #493740 and SF #656631).
878
879*** New Startup File mh-e-autoloads.el
880
881If you are installing MH-E yourself, then you can replace any
882autoloads you may have with "(require 'mh-e-autoloads.el)". See the
883README for details.
884 753
885*** Glimpse Support Removed 754*** mh-show-date-face
886 755
887Since glimpse isn't free, we cannot mention it. Glimpse has been 756Renamed to `mh-show-date' per new Emacs conventions.
888removed from the option `mh-indexer-choices' (closes SF #831276).
889 757
890*** mh-msg-is-in-seq Update 758*** mh-show-from-face
891 759
892Can now specify an alternate message number to "S s 760Renamed to `mh-show-from' per new Emacs conventions.
893(mh-msg-is-in-seq)" with a prefix argument.
894 761
895** New Variables in MH-E 7.4.80 762*** mh-show-header-face
896 763
897Variables that have been added to MH-E that have not been discussed 764Renamed to `mh-show-header' per new Emacs conventions.
898elsewhere are listed here.
899 765
900*** mail-citation-hook 766*** mh-show-subject-face
901 767
902Hook for modifying a citation just inserted in the mail buffer. 768Renamed to `mh-show-subject' per new Emacs conventions.
903 769
904*** mh-alias-reloaded-hook 770*** mh-show-to-face
905 771
906Invoked by `mh-alias-reload' after reloading aliases. 772Renamed to `mh-show-to' per new Emacs conventions.
907 773
908*** mh-auto-fields-prompt-flag 774*** mh-show-xface-face
909 775
910Non-nil means to prompt before sending if fields in 776Renamed to `mh-show-xface' per new Emacs conventions.
911`mh-auto-fields-list' are inserted.
912 777
913*** mh-default-folder-for-message-function 778*** mh-speedbar-folder-face
914 779
915Function to select a default folder for refiling or `Fcc'. 780Renamed to `mh-speedbar-folder' per new Emacs conventions.
916 781
917*** mh-forward-hook 782*** mh-speedbar-folder-with-unseen-messages-face
918 783
919Invoked on the forwarded letter by "f (mh-forward)". 784Renamed to `mh-speedbar-folder-with-unseen-messages' per new Emacs conventions.
920 785
921*** mh-invisible-header-fields-default 786*** mh-speedbar-selected-folder-face
922 787
923List of hidden header fields. The header fields listed in this option 788Renamed to `mh-speedbar-selected-folder' per new Emacs conventions.
924are hidden, although you can check off any field that you would like
925to see. Header fields that you would like to hide that aren't listed
926can be added to the `mh-invisible-header-fields' option (closes SF
927#752045).
928 789
929The option `mh-visible-header-fields' has been deleted. 790*** mh-speedbar-selected-folder-with-unseen-messages-face
930 791
931*** mh-junk-background 792Renamed to `mh-speedbar-selected-folder-with-unseen-messages' per new
793Emacs conventions.
932 794
933If on, spam programs are run in background. This used to be the 795
934default behavior but this could overwhelm a system if many messages
935were black- or whitelisted at once. The spam programs are now run in
936the foreground, but this option can be used to put them back in the
937background.
938
939*** mh-signature-separator-flag
940
941Non-nil means a signature separator should be inserted. It is not
942recommended that you change this option since various mail user
943agents, including MH-E, use the separator to present the signature
944differently, and to suppress the signature when replying or yanking a
945letter into a draft.
946
947*** mh-variant
948
949Specifies the variant used by MH-E. The default setting of this option
950is `Auto-detect' which means that MH-E will automatically choose the
951first of nmh, MH, or GNU mailutils that it finds in the directories
952listed in `mh-path', `mh-sys-path', and `exec-path'. If, for example,
953you have both nmh and mailutils installed and `mh-variant-in-use' was
954initialized to nmh but you want to use mailutils, then you can set
955this option to `mailutils'.
956 796
957When this variable is changed, MH-E resets `mh-progs', `mh-lib', 797** Bug Fixes in MH-E 8.0
958`mh-lib-progs', `mh-flists-present-flag', and `mh-variant-in-use'
959accordingly.
960 798
961If you've set these variables in your .emacs, it is strongly suggested 799*** Face Variable Names Now Follow Current Conventions
962that you comment them out. The MH detection code has been completely
963rewritten and it is very likely that you no longer to set them and
964their setting may confuse other MH-E settings.
965
966** Variables Deleted in MH-E 7.4.80
967 800
968Variables that have been removed from MH-E that have not been 801The -face suffix has been dropped from all face names.
969discussed elsewhere are listed here.
970 802
971*** mh-alias-system-aliases 803*** Swish Fixes
972 804
973System definitions should not be a user option. 805Items in swish indexes that aren't mail messages are now handled more
806gracefully.
974 807
975*** mh-junk-mail-folder 808*** Spamassassin Fixes
976 809
977Since this variable can accept values other than folder names, it was 810If you use spamassassin, there was an error when you tried to junk
978renamed to `mh-junk-disposition' to more accurately reflect the content. 811mail if the option `mh-junk-background' was set. This has been fixed.
979 812
980** Bug Fixes in MH-E 7.4.80 813*** Mairix Support
981 814
982Many bugs were fixed in this version that aren't listed below. 815Indexing now compatible with Mairix version 0.12 and later.
983 816
984*** mh-extract-rejected-mail Can't Do MIME (and Other Formats) 817*** mh-extract-rejected-mail Can't Do MIME (and Other Formats)
985 818
@@ -992,10 +825,23 @@ XEmacs (21.5.9-21.5.16). More recent versions work fine. If you think
992our list is too broad, please let us know which version of XEmacs you 825our list is too broad, please let us know which version of XEmacs you
993are using (closes SF #644321). 826are using (closes SF #644321).
994 827
828*** Completions Offered by mh-refile-message Are Not Sorted
829
830This behavior is no longer observed (closes SF #698734).
831
832*** Add Message-ID to Outgoing Messages
833
834If you replied to a message in your `+outbox', an `In-Reply-To:'
835header field was created that broke threading at the recipient's end.
836We now add a `Message-ID:' to outgoing messages which fixes this
837(closes SF #725425).
838
995*** Inconsistent Prompts 839*** Inconsistent Prompts
996 840
997Prompt formats are now consistent throughout the application (closes 841Emacs changed their defaults in prompts from "Prompt: [value]" to
998SF #730470). 842"Prompt (default value): ". All MH-E prompts have been updated to
843comply with the new standard and are therefore now consistent
844throughout the application (closes SF #730470, SF #1275933).
999 845
1000*** Empty Shell Comments Confuse mh-mhn-directive-present-p 846*** Empty Shell Comments Confuse mh-mhn-directive-present-p
1001 847
@@ -1034,16 +880,10 @@ user would be flashed, but the alias would be used when sending. This
1034has been fixed so that the user name that is flashed is the same as 880has been fixed so that the user name that is flashed is the same as
1035the name that is sent (closes SF #772595). 881the name that is sent (closes SF #772595).
1036 882
1037*** Args out of range 883*** Initialization Fails If ~/Mail Exists
1038
1039In rare and non-reproducible circumstances, compilation sometimes
1040threw an "Args out of range" error. Nonetheless, this has been fixed
1041(closes SF #806577).
1042
1043*** mh-forward hard-codes '-mime' Switch on nmh
1044 884
1045Added new option `mh-compose-forward-as-mime-flag' that controls whether 885MH-E no longer calls `install-mh' so this issue has gone away (closes
1046messages are forwarded as MIME attachments (closes SF #827203). 886SF #835192).
1047 887
1048*** Not Re-prompted to Sign After Pass Phrase Typo 888*** Not Re-prompted to Sign After Pass Phrase Typo
1049 889
@@ -1059,17 +899,187 @@ to start typing their message, any line in the body with a colon would
1059be fontified with a gray background. This has been fixed (closes SF 899be fontified with a gray background. This has been fixed (closes SF
1060#855479). 900#855479).
1061 901
902*** RETURN Causes Infinite Loop in mh-letter
903
904This behavior is no longer observed (closes SF #887346).
905
1062*** mh-refile-msg Fails to Suggest Folder for Empty Message 906*** mh-refile-msg Fails to Suggest Folder for Empty Message
1063 907
1064If you received a message with an empty body from someone who is 908If you received a message with an empty body from someone who is
1065listed in your aliases file, "o (mh-refile-msg)" failed to suggest the 909listed in your aliases file, `o' (`mh-refile-msg') failed to suggest
1066correct folder. This has been fixed (closes SF #917096). 910the correct folder. This has been fixed (closes SF #917096).
911
912*** Missing Headers When Replying to All
913
914User needed to edit `replgroupcomps' (closes SF #918194).
1067 915
1068*** Error Visiting Folder With no Unseen Messages 916*** Error Visiting Folder With no Unseen Messages
1069 917
1070If you visited a folder without unseen messages and the option "flist: 918If you visited a folder without unseen messages and the option "flist:
1071-noshowzero" is present in your ~/.mh_profile, you'd get an error. This 919-noshowzero" is present in your `~/.mh_profile', you'd get an error.
1072has been fixed (closes SF #933954). 920This has been fixed (closes SF #933954).
921
922*** Error Message When Trying to Send Using MH-E
923
924This behavior is no longer observed (closes SF #1002103).
925
926*** mh-find-path Doesn't Use mhparam
927
928MH-E no longer peeks into the MH profile `~/.mh_profile' directly. It
929uses `mhparam' instead (closes SF #1016027).
930
931*** rmmproc Refile Complains No Such Message
932
933MH-E would get confused about which folder to delete messages from if
934you were refiling and deleting messages at the same time. This has
935been fixed (closes SF #1023959).
936
937*** auto-mode-alist Updated
938
939MH-E originally updated auto-mode-alist to set the major mode of
940drafts. Now that we explicitly set the mode, there is no reason to do
941this, and this behavior caused problems for people who didn't use MH-E
942who were editing files that looked like MH message files (closes SF
943#1032353).
944
945*** ! Doesn't Do Regions
946
947Now it does (closes SF #1046330).
948
949*** mh-show-unquote-From Fails (read-only buffer)
950
951MH-E quotes the `From ' header field that is inserted by MTAs.
952However, it was trying to do this in a read-only buffer. This has been
953fixed (closes SF #1089870).
954
955*** Whitespace in pick Expressions
956
957The `C-u / s RET' command now works. In addition, you can now add
958whitespace to any of the limiting (/) commands (closes SF #1122655).
959
960*** mh-index-previous-folder Does Not Work Correctly
961
962If your cursor was on an item below a folder heading and you used
963`M-TAB' (`mh-index-previous-folder'), you would move to the previous
964folder heading. This has been fixed (closes SF #1126188).
965
966*** Default Identity Prevents Insertion of Auto Fields
967
968Auto insertion of an identity now occurs even when the default
969identity is used (closes SF #1204506).
970
971*** mh-compose-forward and Default Message Number
972
973`mh-compose-forward' will now default to the sent message in the sent
974folder and the `cur' message in other folders. It also takes ranges of
975messages and can include multiple messages at a time (closes SF
976#1205890).
977
978*** Better Handling of Empty cur Sequence
979
980If you refiled a message into a folder and then used `F r'
981(`mh-rescan-folder') in that folder, your cursor would be taken to the
982first message. The cursor now stays where it was (closes SF #1207247).
983
984*** mh-customize Uses Group mh, Not mh-e
985
986The `mh' customization group alias has been deleted to avoid some
987problems that were found (closes SF #1213716).
988
989*** "Args out of range" Error in Displaying Message
990
991This behavior is no longer observed (closes SF #1227504).
992
993*** Front-and-back Truncation in mailto: Rendering
994
995This behavior is no longer observed (closes SF #1227510).
996
997*** Name of the Draft File in mh-comp.el
998
999MH is documented to use the draft file. If you use a draft file for
1000something else (like Sylpheed), then use draft folders (closes SF
1001#1231483).
1002
1003*** font-lock Error in mh-letter-mode
1004
1005An error in MH-E was introduced as a result of a change in CVS Emacs.
1006This has been fixed (closes SF #1241017).
1007
1008*** Msg Display Broken After Displaying Msg with Inline Image
1009
1010Messages with inline images no longer trim certain message header
1011fields (closes SF #1306141).
1012
1013*** mh-visit-folder Munges font-lock-keywords
1014
1015MH-E broke highlighting in Gnus buffers. This was actually a problem
1016in CVS Emacs 22 and has been fixed there (closes SF #1393879).
1017
1018*** Illegal Filename Chars for W32 Filesystems
1019
1020Windows users who view `X-Image-URL:' images could not cache the
1021images since the cached image file names had illegal characters. This
1022has been fixed (closes SF #1396499).
1023
1024*** mh-send Doesn't Handle mml Insertions Via mail-user-agent
1025
1026Can now forward messages in Gnus if MH-E is your `mail-user-agent'
1027(closes SF #1399307).
1028
1029*** Can't Narrow to Subject with Regexp Chars
1030
1031The command `/ s' could not limit subjects that had special pick
1032characters (such as [, *, $, .). This has been fixed (closes SF
1033#1432548).
1034
1035*** `/ s' Can Miss the Original Mail
1036
1037The command `/ s' failed to include the message with the "Re:" in the
1038Subject. This has been fixed (closes SF #1438369).
1039
1040*** mhparam -components Fails on mailutils
1041
1042This error prevented MH-E from loading when using GNU mailutils. GNU
1043mailutils drops the `s' in this argument, so we did too since
1044-component still works in nmh and MH (closes SF #1446985).
1045
1046*** `/ s' Still Has Problems With []'d Mail
1047
1048On XEmacs, subjects that had special characters would prevent `/ s'
1049from narrowing to the given subject. These characters are now quoted
1050correctly in XEmacs (closes SF #1447598).
1051
1052*** Variable mh-send-args Is a String, Not a List
1053
1054This was causing errors when sending under GNU mailutils. The internal
1055variable `mh-send-args' is now a list which fixes the problem (closes
1056SF #1448604).
1057
1058*** Update Icons
1059
1060Most of the tool bar icons have been replaced by GTK or GNOME 2 icons
1061(closes SF #1452715).
1062
1063*** Strip Build Number From emacs-version in X-Mailer
1064
1065This has been done (closes SF #1466481).
1066
1067*** Rename Function and Variable Definers
1068
1069If you had ever shown help for an MH-E symbol that was both a function
1070or variable, you might have found that the hyperlink to the file
1071brought you to the wrong definition. This has been fixed by renaming
1072the macros `mh-defgroup', `mh-defcustom', `mh-defface',
1073`mh-defun-compat', and `mh-defmacro-compat' to `defgroup-mh',
1074`defcustom-mh', `defface-mh', `defun-mh', `defmacro-mh' respectively
1075(closes SF #1472029).
1076
1077*** mh-insert-letter Uses Wrong Default
1078
1079If you had used `C-c TAB' (`mh-insert-letter') to insert a letter into
1080your draft, specified a different folder, and chose the default
1081message number, you got the wrong message. This has been fixed (closes
1082SF #1473729).
1073 1083
1074 1084
1075 1085
diff --git a/etc/NEWS b/etc/NEWS
index 9b7eb5e88da..aad95f3e4c8 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -646,26 +646,26 @@ can be edited for each replacement.
646*** The current match in query-replace is highlighted in new face 646*** The current match in query-replace is highlighted in new face
647`query-replace' which by default inherits from isearch face. 647`query-replace' which by default inherits from isearch face.
648 648
649** File operation changes: 649** Local variables lists:
650
651+++
652*** Unquoted `$' in file names do not signal an error any more when
653the corresponding environment variable does not exist.
654Instead, the `$ENVVAR' text is left as is, so that `$$' quoting
655is only rarely needed.
656 650
657+++ 651+++
658*** In processing a local variables list, Emacs strips the prefix and 652*** In processing a local variables list, Emacs strips the prefix and
659suffix from every line before processing all the lines. 653suffix from every line before processing all the lines.
660 654
661+++ 655+++
656*** Text properties in local variables.
657
658A file local variables list cannot specify a string with text
659properties--any specified text properties are discarded.
660
661+++
662*** If the local variables list contains any variable-value pairs that 662*** If the local variables list contains any variable-value pairs that
663are not known to be safe, Emacs shows a prompt asking whether to apply 663are not known to be safe, Emacs shows a prompt asking whether to apply
664the local variables list as a whole. In earlier versions, a prompt 664the local variables list as a whole. In earlier versions, a prompt
665was only issued for variables explicitly marked as risky (for the 665was only issued for variables explicitly marked as risky (for the
666definition of risky variables, see `risky-local-variable-p'). 666definition of risky variables, see `risky-local-variable-p').
667 667
668At the prompt, the user can choose to save the contents of this local 668At the prompt, you can choose to save the contents of this local
669variables list to `safe-local-variable-values'. This new customizable 669variables list to `safe-local-variable-values'. This new customizable
670option is a list of variable-value pairs that are known to be safe. 670option is a list of variable-value pairs that are known to be safe.
671Variables can also be marked as safe with the existing 671Variables can also be marked as safe with the existing
@@ -674,6 +674,38 @@ However, risky variables will not be added to
674`safe-local-variable-values' in this way. 674`safe-local-variable-values' in this way.
675 675
676+++ 676+++
677*** The variable `enable-local-variables' controls how local variable
678lists are handled. t, the default, specifies the standard querying
679behavior. :safe means use only safe values, and ignore the rest.
680nil means ignore them all. Anything else means always query.
681
682+++
683*** The variable `safe-local-eval-forms' specifies a list of forms that
684are ok to evaluate when they appear in an `eval' local variables
685specification. Normally Emacs asks for confirmation before evaluating
686such a form, but if the form appears in this list, no confirmation is
687needed.
688
689+++
690*** If a function has a non-nil `safe-local-eval-function' property,
691that means it is ok to evaluate some calls to that function when it
692appears in an `eval' local variables specification. If the property
693is t, then any form calling that function with constant arguments is
694ok. If the property is a function or list of functions, they are called
695with the form as argument, and if any returns t, the form is ok to call.
696
697If the form is not "ok to call", that means Emacs asks for
698confirmation as before.
699
700** File operation changes:
701
702+++
703*** Unquoted `$' in file names do not signal an error any more when
704the corresponding environment variable does not exist.
705Instead, the `$ENVVAR' text is left as is, so that `$$' quoting
706is only rarely needed.
707
708+++
677*** find-file-read-only visits multiple files in read-only mode, 709*** find-file-read-only visits multiple files in read-only mode,
678when the file name contains wildcard characters. 710when the file name contains wildcard characters.
679 711
@@ -3130,7 +3162,7 @@ See the file GNUS-NEWS or the node "Oort Gnus" in the Gnus manual for details.
3130--- 3162---
3131** MH-E changes. 3163** MH-E changes.
3132 3164
3133Upgraded to MH-E version 7.95. There have been major changes since 3165Upgraded to MH-E version 8.0. There have been major changes since
3134version 5.0.2; see MH-E-NEWS for details. 3166version 5.0.2; see MH-E-NEWS for details.
3135 3167
3136** Calendar changes: 3168** Calendar changes:
@@ -3633,6 +3665,15 @@ occurrences of an element in the list, the one that's kept is the
3633first one. 3665first one.
3634 3666
3635+++ 3667+++
3668*** New function `add-to-history' adds an element to a history list.
3669
3670Lisp packages should use this function to add elements to their
3671history lists.
3672
3673If `history-delete-duplicates' is non-nil, it removes duplicates of
3674the new element from the history list it updates.
3675
3676+++
3636*** New function `rassq-delete-all'. 3677*** New function `rassq-delete-all'.
3637 3678
3638(rassq-delete-all VALUE ALIST) deletes, from ALIST, each element whose 3679(rassq-delete-all VALUE ALIST) deletes, from ALIST, each element whose
@@ -4069,38 +4110,6 @@ the minibuffer with a default value: if DEF is non-nil, the minibuffer
4069prompt provided in PROMPT is edited to show the default value provided 4110prompt provided in PROMPT is edited to show the default value provided
4070in DEF before the terminal colon and space. 4111in DEF before the terminal colon and space.
4071 4112
4072** Local variables lists:
4073
4074+++
4075*** Text properties in local variables.
4076
4077A file local variables list cannot specify a string with text
4078properties--any specified text properties are discarded.
4079
4080+++
4081*** The variable `enable-local-variables' controls how local variable
4082lists are handled. t, the default, specifies the standard querying
4083behavior. :safe means use only safe values, and ignore the rest.
4084nil means ignore them all. Anything else means always query.
4085
4086+++
4087*** The variable `safe-local-eval-forms' specifies a list of forms that
4088are ok to evaluate when they appear in an `eval' local variables
4089specification. Normally Emacs asks for confirmation before evaluating
4090such a form, but if the form appears in this list, no confirmation is
4091needed.
4092
4093---
4094*** If a function has a non-nil `safe-local-eval-function' property,
4095that means it is ok to evaluate some calls to that function when it
4096appears in an `eval' local variables specification. If the property
4097is t, then any form calling that function with constant arguments is
4098ok. If the property is a function or list of functions, they are called
4099with the form as argument, and if any returns t, the form is ok to call.
4100
4101If the form is not "ok to call", that means Emacs asks for
4102confirmation as before.
4103
4104** Searching and matching changes: 4113** Searching and matching changes:
4105 4114
4106+++ 4115+++
diff --git a/info/dir b/info/dir
index 035ed6e7319..46b8c173c12 100644
--- a/info/dir
+++ b/info/dir
@@ -32,7 +32,6 @@ Emacs
32* CL: (cl). Partial Common Lisp support for Emacs Lisp. 32* CL: (cl). Partial Common Lisp support for Emacs Lisp.
33* Dired-X: (dired-x). Dired Extra Features. 33* Dired-X: (dired-x). Dired Extra Features.
34* Ediff: (ediff). A visual interface for comparing and merging programs. 34* Ediff: (ediff). A visual interface for comparing and merging programs.
35* Emacs-Xtra: (emacs-xtra). Specialized Emacs features.
36* Org Mode: (org). Outline-based notes management and organizer. 35* Org Mode: (org). Outline-based notes management and organizer.
37* PCL-CVS: (pcl-cvs). Emacs front-end to CVS. 36* PCL-CVS: (pcl-cvs). Emacs front-end to CVS.
38* Speedbar: (speedbar). File/Tag summarizing utility. 37* Speedbar: (speedbar). File/Tag summarizing utility.
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 115e43c2d03..2e8581a6f57 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,9 @@
12006-05-02 Francesco Potort,Al(B <pot@gnu.org>
2
3 * etags.c (Perl_functions): Free space allocated for var package.
4 (Erlang_functions): Possibly free space allocated for var last.
5 (Prolog_functions): Possibly free space allocated for var last.
6
12006-04-29 Dan Nicolaescu <dann@ics.uci.edu> 72006-04-29 Dan Nicolaescu <dann@ics.uci.edu>
2 8
3 * sorted-doc.c (main): Initialize docs to NULL. 9 * sorted-doc.c (main): Initialize docs to NULL.
diff --git a/lib-src/etags.c b/lib-src/etags.c
index a7c98f090bb..e206443f39b 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -41,7 +41,7 @@
41 * configuration file containing regexp definitions for etags. 41 * configuration file containing regexp definitions for etags.
42 */ 42 */
43 43
44char pot_etags_version[] = "@(#) pot revision number is 17.15"; 44char pot_etags_version[] = "@(#) pot revision number is 17.17";
45 45
46#define TRUE 1 46#define TRUE 1
47#define FALSE 0 47#define FALSE 0
@@ -4543,6 +4543,7 @@ Perl_functions (inf)
4543 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); 4543 lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
4544 } 4544 }
4545 } 4545 }
4546 free (package);
4546} 4547}
4547 4548
4548 4549
@@ -5441,6 +5442,8 @@ Prolog_functions (inf)
5441 last[len] = '\0'; 5442 last[len] = '\0';
5442 } 5443 }
5443 } 5444 }
5445 if (last != NULL)
5446 free (last);
5444} 5447}
5445 5448
5446 5449
@@ -5597,7 +5600,11 @@ Erlang_functions (inf)
5597 else if (cp[0] == '-') /* attribute, e.g. "-define" */ 5600 else if (cp[0] == '-') /* attribute, e.g. "-define" */
5598 { 5601 {
5599 erlang_attribute (cp); 5602 erlang_attribute (cp);
5600 last = NULL; 5603 if (last != NULL)
5604 {
5605 free (last);
5606 last = NULL;
5607 }
5601 } 5608 }
5602 else if ((len = erlang_func (cp, last)) > 0) 5609 else if ((len = erlang_func (cp, last)) > 0)
5603 { 5610 {
@@ -5614,6 +5621,8 @@ Erlang_functions (inf)
5614 last[len] = '\0'; 5621 last[len] = '\0';
5615 } 5622 }
5616 } 5623 }
5624 if (last != NULL)
5625 free (last);
5617} 5626}
5618 5627
5619 5628
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b39bebc7215..da019cc2cbb 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,339 @@
12006-05-10 J.D. Smith <jdsmith@as.arizona.edu>
2
3 * progmodes/idlw-shell.el (idlwave-shell-move-or-history):
4 Remove spurious move to point-max (new comint behavior fixes).
5
6 * progmodes/idlwave.el (idlwave-push-mark): Removed obsolete
7 compatibility function (Emacs 18/19).
8 (idlwave-is-continuation-line): Always return point at start of
9 previous non-blank continuation line.
10 `keyword-parameters': Fix continued comment font-lock matcher.
11 (idlwave-font-lock-fontify-region): Written, use as
12 font-lock-fontify-region-function, to fix continued keyword
13 fontification issues.
14
152006-05-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16
17 * term/mac-win.el (mac-font-panel-mode): Doc fix.
18 (mac-service-selection, mac-service-open-file)
19 (mac-service-open-selection, mac-service-mail-selection)
20 (mac-service-mail-to, mac-service-insert-text): Rename from
21 mac-services-*. All uses changed.
22 (mac-apple-event-map): Rename event symbol `services' to `service'.
23
242006-05-10 Thien-Thi Nguyen <ttn@gnu.org>
25
26 * emacs-lisp/ewoc.el (ewoc--dll-create, ewoc--node-delete)
27 (ewoc--node-enter-first, ewoc--node-enter-last)
28 (ewoc--delete-node-internal): Merge funcs into unique callers.
29
302006-05-09 Chong Yidong <cyd@stupidchicken.com>
31
32 * emacs-lisp/crm.el (completing-read-multiple): Properly handle
33 return value of read-from-minibuffer for empty input.
34
352006-05-09 Miles Bader <miles@gnu.org>
36
37 * comint.el (comint-insert-input): Remove redundant calls to setq
38 and goto-char.
39
402006-05-10 Nick Roberts <nickrob@snap.net.nz>
41
42 * comint.el (comint-insert-input): Make it work when
43 comint-use-prompt-regexp is t.
44
452006-05-10 Miles Bader <miles@gnu.org>
46
47 * subr.el (field-at-pos): New function.
48
49 * comint.el (comint-insert-input): Use it.
50
512006-05-09 Juri Linkov <juri@jurta.org>
52
53 * battery.el (battery-linux-proc-acpi): Also try
54 `/proc/acpi/thermal_zone/THR2/temperature'.
55
56 * files.el <safe-local-variable>: Remove `eval' and `let' binding
57 for now unused lambda `string-or-null'.
58
59 * add-log.el (change-log-default-name): Put `string-or-null-p'
60 instead of lambda on `safe-local-variable' property.
61
62 * diff-mode.el (diff-context->unified): Use `region-beginning' and
63 `region-end' instead of `mark' and `point'.
64 (diff-unified->context, diff-reverse-direction, diff-fixup-modifs):
65 Operate on region in Transient Mark mode when the mark is active.
66 Use `region-beginning' and `region-end' instead of `mark' and
67 `point'.
68 (diff-hunk-text, diff-goto-source): Doc fix.
69
70 * startup.el (fancy-splash-screens, normal-splash-screen): Use
71 face `mode-line-buffer-id' for mode-line buffer face instead of
72 hard-coded `(:weight bold)'.
73
74 * arc-mode.el (archive-set-buffer-as-visiting-file): Bind
75 buffer-undo-list to t (undo-ask is reproducible by visiting
76 nested archives).
77
782006-05-09 Kim F. Storm <storm@cua.dk>
79
80 * progmodes/grep.el (rgrep): Set default directory of *grep*
81 buffer if we start M-x rgrep in the *grep* buffer and choose
82 a different base directory.
83
842006-05-09 Michael Albinus <michael.albinus@gmx.de>
85
86 * net/tramp.el (tramp-register-file-name-handlers): Enable Tramp
87 completion also when ido is loaded.
88
892006-05-09 Masatake YAMATO <jet@gyve.org>
90
91 * font-lock.el (cpp-font-lock-keywords-source-directives): Addded
92 "warning" and "import".
93 (cpp-font-lock-keywords): Added "warning".
94
952006-05-08 Dan Nicolaescu <dann@ics.uci.edu>
96
97 * term/xterm.el (terminal-init-xterm): Add more key bindings.
98
992006-05-08 Stefan Monnier <monnier@iro.umontreal.ca>
100
101 * mwheel.el (mwheel-scroll): Make sure that when scrolling multiple
102 pages at a time, if we signal the end, we should indeed reach that end.
103
1042006-05-08 David Reitter <david.reitter@gmail.com>
105
106 * emacs-lisp/easy-mmode.el (define-minor-mode): Only preserve messages
107 output during execution of the body.
108
1092006-05-08 Kim F. Storm <storm@cua.dk>
110
111 * progmodes/grep.el (lgrep, rgrep): Doc fixes.
112
1132006-05-08 Thien-Thi Nguyen <ttn@gnu.org>
114
115 * emacs-lisp/ewoc.el (ewoc--set-buffer-bind-dll-let*):
116 Use with-current-buffer.
117
1182006-05-07 Kim F. Storm <storm@cua.dk>
119
120 * subr.el (add-to-history): Remove keep-dups arg.
121
122 * kmacro.el (kmacro-push-ring): Let-bind history-delete-duplicates
123 to nil around call to add-to-history.
124
1252006-05-07 Stefan Monnier <monnier@iro.umontreal.ca>
126
127 * emacs-lisp/syntax.el (syntax-ppss): Flush the cache before rather
128 than after a buffer modification.
129
1302006-05-08 Nick Roberts <nickrob@snap.net.nz>
131
132 * progmodes/gdb-ui.el (gdb-var-create-handler): Move speedbar
133 call to...
134 (gud-watch): ...here so speedbar is raised for already watched
135 expressions.
136 (gdb-speedbar-refresh): Delete function.
137 (gdb-speedbar-update, gdb-speedbar-timer-fn): New functions.
138 Use speedbar-timer-fn instead of speedbar-refresh (reverting
139 earlier change).
140 (gdb-var-evaluate-expression-handler)
141 (gdb-var-list-children-handler-1, gdb-var-update-handler-1): Use it.
142
143 * speedbar.el (speedbar-timer-fn): Remove save-window-excursion.
144 Update localized contents for all buffers except ignored modes.
145
1462006-05-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
147
148 * term/mac-win.el (mac-utxt-to-string): Use `eq' instead of `='.
149 (mac-atsu-font-table, mac-font-panel-mode): Add defvars.
150 (mac-bytes-to-digits, mac-handle-toolbar-switch-mode)
151 (mac-handle-font-panel-closed, mac-handle-font-selection):
152 New functions.
153 (mac-font-panel-mode): New minor mode.
154 (mac-apple-event-map): Add bindings for toolbar toggle button and
155 font panel.
156 (menu-bar-showhide-menu): Add mac-font-panel-mode.
157
1582006-05-07 John Paul Wallington <jpw@pobox.com>
159
160 * ibuffer.el (ibuffer-compressed-file-name-regexp):
161 Avoid `regexp-opt'; simplify regexp for readability.
162
1632006-05-06 Eli Zaretskii <eliz@gnu.org>
164
165 * ldefs-boot.el (dired-do-redisplay, dired-maybe-insert-subdir):
166 * files.el (buffer-stale-function):
167 * dired-aux.el (dired-do-redisplay, dired-maybe-insert-subdir):
168 * autorevert.el (global-auto-revert-non-file-buffers): Point Info
169 links to the main manual, not to emacs-xtra.
170
1712006-05-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
172
173 * term/mac-win.el: (mac-utxt-to-string): Don't make adjustment for
174 MacJapanese if text is ASCII-only.
175
1762006-05-06 Nick Roberts <nickrob@snap.net.nz>
177
178 * progmodes/gdb-ui.el (gdb-goto-breakpoint): Use or instead of
179 unless so nil isn't returned.
180 (gdb-setup-windows, gdb-restore-windows): Reset gdb-source-window.
181
1822006-05-06 Kim F. Storm <storm@cua.dk>
183
184 * subr.el (add-to-history): New function.
185
186 * ediff.el (ediff-files, ediff-files3, ediff-merge-files)
187 (ediff-merge-files-with-ancestor):
188 * env.el (setenv):
189 * isearch.el (isearch-update-ring):
190 * server.el (server-visit-files):
191 * progmodes/grep.el (lgrep, rgrep):
192 * progmodes/vhdl-mode.el (vhdl-generate-makefile-1):
193 * progmodes/xscheme.el (xscheme-insert-expression):
194 Use add-to-history.
195
196 * kmacro.el (kmacro-push-ring): Use add-to-history.
197 (kmacro-ring-length): Remove unused defun.
198 (kmacro-start-macro): Use kmacro-push-ring.
199
2002006-05-06 Thien-Thi Nguyen <ttn@gnu.org>
201
202 * emacs-lisp/ewoc.el (ewoc-create, ewoc-set-hf): Use `insert'
203 directly instead of a lambda expression that calls it.
204
2052006-05-06 Kim F. Storm <storm@cua.dk>
206
207 * avoid.el (mouse-avoidance-point-position): Use posn-at-point
208 instead of compute-motion.
209
2102006-05-05 Dan Nicolaescu <dann@ics.uci.edu>
211
212 * ibuffer.el (ibuffer-compressed-file-name-regexp): Undo previous
213 change.
214
2152006-05-05 Reiner Steib <Reiner.Steib@gmx.de>
216
217 * startup.el (command-line-1): Refer to "Pure Storage" on
218 pure-space-overflow.
219
2202006-05-05 Martin Rudalics <rudalics@gmx.at>
221
222 * emacs-lisp/re-builder.el (reb-update-overlays): Cycle through
223 provided faces once they all have been used up.
224
2252006-05-05 Eli Zaretskii <eliz@gnu.org>
226
227 * startup.el (normal-splash-screen, fancy-splash-screens-1): Add a
228 reference to the Lisp manual to the warning about pure space
229 overflow.
230
2312006-05-05 Micha,Ak(Bl Cadilhac <michael.cadilhac@lrde.org>
232
233 * textmodes/ispell.el (ispell-buffer-local-dict): Add a `no-reload'
234 argument to avoid the call to `ispell-internal-change-dictionary'
235 when not needed.
236 (ispell-change-dictionary): Use this argument and call
237 `ispell-internal-change-dictionary' after the possible change
238 to `ispell-local-dictionary'.
239 (ispell-internal-change-dictionary): Check for a change in
240 personal dictionary use too.
241 Cosmetic changes from Agustin Martin
242 <agustin.martin@hispalinux.es>.
243
2442006-05-05 Eli Zaretskii <eliz@gnu.org>
245
246 * startup.el (command-line): On MS-Windows, probe "~", not
247 "~USER", for warning about non-existent home directory
248
249 * arc-mode.el (archive-l-e): New optional argument `float' means
250 generate a float value.
251 (archive-arc-summarize, archive-lzh-summarize)
252 (archive-zip-summarize, archive-zoo-summarize): Invoke archive-l-e
253 with 3rd argument non-nil when file's size is being computed.
254 Format the file sizes with %8.0f instead of %8d.
255
2562006-05-05 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
257
258 * cus-start.el (all): Add mac-dnd-known-types.
259
260 * term/mac-win.el: (mac-utxt-to-string, mac-string-to-utxt)
261 (mac-TEXT-to-string, mac-string-to-TEXT, mac-furl-to-string)
262 (mac-TIFF-to-string): New functions.
263 (x-get-selection, x-selection-value)
264 (mac-select-convert-to-string): Use them.
265 (mac-text-encoding-mac-japanese-basic-variant): New constant.
266 (mac-dnd-types-alist): New customization variable.
267 (mac-dnd-handle-furl, mac-dnd-handle-hfs, mac-dnd-insert-utxt)
268 (mac-dnd-insert-TEXT, mac-dnd-insert-TIFF, mac-dnd-drop-data)
269 (mac-dnd-handle-drag-n-drop-event): New functions.
270 (mac-drag-n-drop): Remove function.
271 (global-map): Bind drag-n-drop and M-drag-n-drop to
272 mac-dnd-handle-drag-n-drop-event.
273
2742006-05-04 Karl Chen <quarl@NOSPAM.quarl.org>
275
276 * progmodes/perl-mode.el (perl-beginning-of-function):
277 Skip anonymous subs.
278
2792006-05-04 Dan Nicolaescu <dann@ics.uci.edu>
280
281 * ibuffer.el (ibuffer-compressed-file-name-regexp): Avoid loading
282 regexp-opt at run time.
283
284 * term.el (term-handle-ansi-escape): Fix off by one error.
285
2862006-05-04 Nick Roberts <nickrob@snap.net.nz>
287
288 * progmodes/gdb-ui.el (gdb-force-update): Delete variable...
289 (gdb-init-1, gdb-post-prompt): ...and references to it.
290 (gdb-frame-handler): Strip directory name from filename if present.
291
292 * progmodes/gud.el (gdb-force-update): Delete defvar
293 (gud-speedbar-buttons): ...and references to it. Use window-start
294 to try to keep positon in watch expression.
295
2962006-05-03 Richard Stallman <rms@gnu.org>
297
298 * simple.el (next-history-element, previous-history-element): Doc fix.
299
300 * isearch.el (isearch-update-ring): Doc fix.
301
3022006-05-03 Dan Nicolaescu <dann@ics.uci.edu>
303
304 * isearch.el (isearch-update-ring): Take history-delete-duplicates
305 into consideration. Replace one arm ifs with whens.
306
3072006-05-03 Nick Roberts <nickrob@snap.net.nz>
308
309 * progmodes/gdb-ui.el (gud-watch): Let user select an expression.
310 (menu): Fix typo.
311
3122006-05-02 Miles Bader <miles@gnu.org>
313
314 * replace.el (occur-engine): Bind `inhibit-field-text-motion' to t.
315
3162006-05-02 Jay Belanger <belanger@truman.edu>
317
318 * calc/calc-embed.el: (calc-override-minor-modes-map)
319 (calc-override-minor-modes): New variables.
320 (calc-do-embedded): Make sure that Calc keystrokes aren't
321 overwritten by minor modes.
322
3232006-05-02 Chong Yidong <cyd@mit.edu>
324
325 * msb.el (msb): If EVENT is a down event, read and discard the up event.
326
3272006-05-02 Reiner Steib <Reiner.Steib@gmx.de>
328
329 * startup.el (command-line-1): Refer to Lisp manual when
330 pure-space-overflow occurs.
331
332 * files.el (byte-compile-dynamic, byte-compile-dynamic-docstrings)
333 (byte-compile-warnings, find-file-visit-truename, indent-tabs-mode)
334 (left-margin, no-byte-compile, no-update-autoloads, truncate-lines)
335 (version-control): Don't use `t' for safe-local-variable declarations.
336
12006-05-01 Richard Stallman <rms@gnu.org> 3372006-05-01 Richard Stallman <rms@gnu.org>
2 338
3 * diff-mode.el (diff-mode-shared-map): Don't bind M-W, M-U, M-C, 339 * diff-mode.el (diff-mode-shared-map): Don't bind M-W, M-U, M-C,
@@ -26,35 +362,35 @@
26 (tramp-completion-handle-file-name-directory) 362 (tramp-completion-handle-file-name-directory)
27 (tramp-completion-handle-file-name-nondirectory) 363 (tramp-completion-handle-file-name-nondirectory)
28 (tramp-completion-handle-expand-file-name): Remove them. 364 (tramp-completion-handle-expand-file-name): Remove them.
29 (tramp-handle-file-name-directory): Return the real directory 365 (tramp-handle-file-name-directory): Return the real directory name.
30 name. Returning "/" only doesn't need to be necessary any longer. 366 Returning "/" only doesn't need to be necessary any longer.
31 (tramp-file-name-handler): Make special attention when in hostname 367 (tramp-file-name-handler): Make special attention when in hostname
32 completion mode. 368 completion mode.
33 (tramp-completion-file-name-handler): Revert patch from 369 (tramp-completion-file-name-handler): Revert patch from 2006-04-28.
34 2006-04-28. 370 (tramp-register-file-name-handlers):
35 (tramp-register-file-name-handlers): Register 371 Register `tramp-completion-file-name-handler' only when
36 `tramp-completion-file-name-handler' only when 372 `partial-completion-mode' is enabled.
37 `partial-completion-mode is enabled. 373 (tramp-completion-handle-file-name-all-completions):
38 (tramp-completion-handle-file-name-all-completions): Delete 374 Delete directory part from results.
39 directory part from results.
40 (tramp-get-completion-methods, tramp-get-completion-user-host): 375 (tramp-get-completion-methods, tramp-get-completion-user-host):
41 Discard deleting "/", it doesn't work after the change of 376 Discard deleting "/", it doesn't work after the change of
42 `tramp-handle-file-name-directory' above. 377 `tramp-handle-file-name-directory' above.
43 378
442006-05-01 Kim F. Storm <storm@cua.dk> 3792006-05-01 Kim F. Storm <storm@cua.dk>
45 380
46 * progmodes/grep.el (grep-expand-template): Use save-match-data. 381 * progmodes/grep.el (grep-expand-template): Use save-match-data
382 and symbol-value.
47 383
482006-05-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 3842006-05-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
49 385
50 * term/mac-win.el (mac-ae-open-documents, mac-drag-n-drop): Use 386 * term/mac-win.el (mac-ae-open-documents, mac-drag-n-drop):
51 select-frame-set-input-focus instead of raise-frame. 387 Use select-frame-set-input-focus instead of raise-frame.
52 (global-map): Bind M-drag-n-drop to mac-drag-n-drop. 388 (global-map): Bind M-drag-n-drop to mac-drag-n-drop.
53 389
542006-05-01 Nick Roberts <nickrob@snap.net.nz> 3902006-05-01 Nick Roberts <nickrob@snap.net.nz>
55 391
56 * progmodes/gud.el (gud-def): Add %c case. 392 * progmodes/gud.el (gud-def): Add %c case.
57 (gud-speedbar-buttons): Don'bind case-fold-search unnecessarily. 393 (gud-speedbar-buttons): Don't bind case-fold-search unnecessarily.
58 (gud-format-command): Make match case sensitive. Match on %F. 394 (gud-format-command): Make match case sensitive. Match on %F.
59 395
602006-04-30 Glenn Morris <rgm@gnu.org> 3962006-04-30 Glenn Morris <rgm@gnu.org>
@@ -121,7 +457,7 @@
121 (grep-read-regexp, grep-read-files): New helper functions. 457 (grep-read-regexp, grep-read-files): New helper functions.
122 (rgrep): Rename from grep-tree. Rework to use proper histories. 458 (rgrep): Rename from grep-tree. Rework to use proper histories.
123 Adapt to changes in defcustoms and functions above. 459 Adapt to changes in defcustoms and functions above.
124 (lgrep): New command, as grep, but using same interactive api as rgrep. 460 (lgrep): New command, as grep, but using same interactive UI as rgrep.
125 461
1262006-04-28 Michael Albinus <michael.albinus@gmx.de> 4622006-04-28 Michael Albinus <michael.albinus@gmx.de>
127 463
diff --git a/lisp/add-log.el b/lisp/add-log.el
index 47a839d539d..393a696d3f1 100644
--- a/lisp/add-log.el
+++ b/lisp/add-log.el
@@ -45,8 +45,7 @@
45 :type '(choice (const :tag "default" nil) 45 :type '(choice (const :tag "default" nil)
46 string) 46 string)
47 :group 'change-log) 47 :group 'change-log)
48(put 'change-log-default-name 'safe-local-variable 48(put 'change-log-default-name 'safe-local-variable 'string-or-null-p)
49 (lambda (a) (or (stringp a) (null a))))
50 49
51(defcustom change-log-mode-hook nil 50(defcustom change-log-mode-hook nil
52 "Normal hook run by `change-log-mode'." 51 "Normal hook run by `change-log-mode'."
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el
index d699a78f8e8..9da83f1a635 100644
--- a/lisp/arc-mode.el
+++ b/lisp/arc-mode.el
@@ -480,10 +480,12 @@ Each descriptor is a vector of the form
480(defsubst archive-name (suffix) 480(defsubst archive-name (suffix)
481 (intern (concat "archive-" (symbol-name archive-subtype) "-" suffix))) 481 (intern (concat "archive-" (symbol-name archive-subtype) "-" suffix)))
482 482
483(defun archive-l-e (str &optional len) 483(defun archive-l-e (str &optional len float)
484 "Convert little endian string/vector STR to integer. 484 "Convert little endian string/vector STR to integer.
485Alternatively, STR may be a buffer position in the current buffer 485Alternatively, STR may be a buffer position in the current buffer
486in which case a second argument, length LEN, should be supplied." 486in which case a second argument, length LEN, should be supplied.
487FLOAT, if non-nil, means generate and return a float instead of an integer
488\(use this for numbers that can overflow the Emacs integer)."
487 (if (stringp str) 489 (if (stringp str)
488 (setq len (length str)) 490 (setq len (length str))
489 (setq str (buffer-substring str (+ str len)))) 491 (setq str (buffer-substring str (+ str len))))
@@ -492,7 +494,8 @@ in which case a second argument, length LEN, should be supplied."
492 (i 0)) 494 (i 0))
493 (while (< i len) 495 (while (< i len)
494 (setq i (1+ i) 496 (setq i (1+ i)
495 result (+ (ash result 8) (aref str (- len i))))) 497 result (+ (if float (* result 256.0) (ash result 8))
498 (aref str (- len i)))))
496 result)) 499 result))
497 500
498(defun archive-int-to-mode (mode) 501(defun archive-int-to-mode (mode)
@@ -882,7 +885,8 @@ using `make-temp-file', and the generated name is returned."
882 "Set the current buffer as if it were visiting FILENAME." 885 "Set the current buffer as if it were visiting FILENAME."
883 (save-excursion 886 (save-excursion
884 (goto-char (point-min)) 887 (goto-char (point-min))
885 (let ((coding 888 (let ((buffer-undo-list t)
889 (coding
886 (or coding-system-for-read 890 (or coding-system-for-read
887 (and set-auto-coding-function 891 (and set-auto-coding-function
888 (save-excursion 892 (save-excursion
@@ -1355,13 +1359,14 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
1355 (fnlen (or (string-match "\0" namefld) 13)) 1359 (fnlen (or (string-match "\0" namefld) 13))
1356 (efnname (decode-coding-string (substring namefld 0 fnlen) 1360 (efnname (decode-coding-string (substring namefld 0 fnlen)
1357 archive-file-name-coding-system)) 1361 archive-file-name-coding-system))
1358 (csize (archive-l-e (+ p 15) 4)) 1362 ;; Convert to float to avoid overflow for very large files.
1363 (csize (archive-l-e (+ p 15) 4 'float))
1359 (moddate (archive-l-e (+ p 19) 2)) 1364 (moddate (archive-l-e (+ p 19) 2))
1360 (modtime (archive-l-e (+ p 21) 2)) 1365 (modtime (archive-l-e (+ p 21) 2))
1361 (ucsize (archive-l-e (+ p 25) 4)) 1366 (ucsize (archive-l-e (+ p 25) 4 'float))
1362 (fiddle (string= efnname (upcase efnname))) 1367 (fiddle (string= efnname (upcase efnname)))
1363 (ifnname (if fiddle (downcase efnname) efnname)) 1368 (ifnname (if fiddle (downcase efnname) efnname))
1364 (text (format " %8d %-11s %-8s %s" 1369 (text (format " %8.0f %-11s %-8s %s"
1365 ucsize 1370 ucsize
1366 (archive-dosdate moddate) 1371 (archive-dosdate moddate)
1367 (archive-dostime modtime) 1372 (archive-dostime modtime)
@@ -1383,7 +1388,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
1383 dash) 1388 dash)
1384 (archive-summarize-files (nreverse visual)) 1389 (archive-summarize-files (nreverse visual))
1385 (insert dash 1390 (insert dash
1386 (format " %8d %d file%s" 1391 (format " %8.0f %d file%s"
1387 totalsize 1392 totalsize
1388 (length files) 1393 (length files)
1389 (if (= 1 (length files)) "" "s")) 1394 (if (= 1 (length files)) "" "s"))
@@ -1416,9 +1421,10 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
1416 (while (progn (goto-char p) ;beginning of a base header. 1421 (while (progn (goto-char p) ;beginning of a base header.
1417 (looking-at "\\(.\\|\n\\)\\(.\\|\n\\)-l[hz][0-9ds]-")) 1422 (looking-at "\\(.\\|\n\\)\\(.\\|\n\\)-l[hz][0-9ds]-"))
1418 (let* ((hsize (byte-after p)) ;size of the base header (level 0 and 1) 1423 (let* ((hsize (byte-after p)) ;size of the base header (level 0 and 1)
1419 (csize (archive-l-e (+ p 7) 4)) ;size of a compressed file to follow (level 0 and 2), 1424 ;; Convert to float to avoid overflow for very large files.
1425 (csize (archive-l-e (+ p 7) 4 'float)) ;size of a compressed file to follow (level 0 and 2),
1420 ;size of extended headers + the compressed file to follow (level 1). 1426 ;size of extended headers + the compressed file to follow (level 1).
1421 (ucsize (archive-l-e (+ p 11) 4)) ;size of an uncompressed file. 1427 (ucsize (archive-l-e (+ p 11) 4 'float)) ;size of an uncompressed file.
1422 (time1 (archive-l-e (+ p 15) 2)) ;date/time (MSDOS format in level 0, 1 headers 1428 (time1 (archive-l-e (+ p 15) 2)) ;date/time (MSDOS format in level 0, 1 headers
1423 (time2 (archive-l-e (+ p 17) 2)) ;and UNIX format in level 2 header.) 1429 (time2 (archive-l-e (+ p 17) 2)) ;and UNIX format in level 2 header.)
1424 (hdrlvl (byte-after (+ p 20))) ;header level 1430 (hdrlvl (byte-after (+ p 20))) ;header level
@@ -1493,12 +1499,12 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
1493 (archive-unixtime time1 time2) 1499 (archive-unixtime time1 time2)
1494 (archive-dostime time1))) 1500 (archive-dostime time1)))
1495 (setq text (if archive-alternate-display 1501 (setq text (if archive-alternate-display
1496 (format " %8d %5S %5S %s" 1502 (format " %8.0f %5S %5S %s"
1497 ucsize 1503 ucsize
1498 (or uid "?") 1504 (or uid "?")
1499 (or gid "?") 1505 (or gid "?")
1500 ifnname) 1506 ifnname)
1501 (format " %10s %8d %-11s %-8s %s" 1507 (format " %10s %8.0f %-11s %-8s %s"
1502 modestr 1508 modestr
1503 ucsize 1509 ucsize
1504 moddate 1510 moddate
@@ -1527,8 +1533,8 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
1527 "M Length Uid Gid File\n" 1533 "M Length Uid Gid File\n"
1528 "M Filemode Length Date Time File\n")) 1534 "M Filemode Length Date Time File\n"))
1529 (sumline (if archive-alternate-display 1535 (sumline (if archive-alternate-display
1530 " %8d %d file%s" 1536 " %8.0f %d file%s"
1531 " %8d %d file%s"))) 1537 " %8.0f %d file%s")))
1532 (insert header dash) 1538 (insert header dash)
1533 (archive-summarize-files (nreverse visual)) 1539 (archive-summarize-files (nreverse visual))
1534 (insert dash 1540 (insert dash
@@ -1622,7 +1628,8 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
1622 ;; (method (archive-l-e (+ p 10) 2)) 1628 ;; (method (archive-l-e (+ p 10) 2))
1623 (modtime (archive-l-e (+ p 12) 2)) 1629 (modtime (archive-l-e (+ p 12) 2))
1624 (moddate (archive-l-e (+ p 14) 2)) 1630 (moddate (archive-l-e (+ p 14) 2))
1625 (ucsize (archive-l-e (+ p 24) 4)) 1631 ;; Convert to float to avoid overflow for very large files.
1632 (ucsize (archive-l-e (+ p 24) 4 'float))
1626 (fnlen (archive-l-e (+ p 28) 2)) 1633 (fnlen (archive-l-e (+ p 28) 2))
1627 (exlen (archive-l-e (+ p 30) 2)) 1634 (exlen (archive-l-e (+ p 30) 2))
1628 (fclen (archive-l-e (+ p 32) 2)) 1635 (fclen (archive-l-e (+ p 32) 2))
@@ -1647,7 +1654,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
1647 (string= (upcase efnname) efnname))) 1654 (string= (upcase efnname) efnname)))
1648 (ifnname (if fiddle (downcase efnname) efnname)) 1655 (ifnname (if fiddle (downcase efnname) efnname))
1649 (width (string-width ifnname)) 1656 (width (string-width ifnname))
1650 (text (format " %10s %8d %-11s %-8s %s" 1657 (text (format " %10s %8.0f %-11s %-8s %s"
1651 modestr 1658 modestr
1652 ucsize 1659 ucsize
1653 (archive-dosdate moddate) 1660 (archive-dosdate moddate)
@@ -1673,7 +1680,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
1673 dash) 1680 dash)
1674 (archive-summarize-files (nreverse visual)) 1681 (archive-summarize-files (nreverse visual))
1675 (insert dash 1682 (insert dash
1676 (format " %8d %d file%s" 1683 (format " %8.0f %d file%s"
1677 totalsize 1684 totalsize
1678 (length files) 1685 (length files)
1679 (if (= 1 (length files)) "" "s")) 1686 (if (= 1 (length files)) "" "s"))
@@ -1726,7 +1733,8 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
1726 (let* ((next (1+ (archive-l-e (+ p 6) 4))) 1733 (let* ((next (1+ (archive-l-e (+ p 6) 4)))
1727 (moddate (archive-l-e (+ p 14) 2)) 1734 (moddate (archive-l-e (+ p 14) 2))
1728 (modtime (archive-l-e (+ p 16) 2)) 1735 (modtime (archive-l-e (+ p 16) 2))
1729 (ucsize (archive-l-e (+ p 20) 4)) 1736 ;; Convert to float to avoid overflow for very large files.
1737 (ucsize (archive-l-e (+ p 20) 4 'float))
1730 (namefld (buffer-substring (+ p 38) (+ p 38 13))) 1738 (namefld (buffer-substring (+ p 38) (+ p 38 13)))
1731 (dirtype (byte-after (+ p 4))) 1739 (dirtype (byte-after (+ p 4)))
1732 (lfnlen (if (= dirtype 2) (byte-after (+ p 56)) 0)) 1740 (lfnlen (if (= dirtype 2) (byte-after (+ p 56)) 0))
@@ -1749,7 +1757,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
1749 (fiddle (and (= lfnlen 0) (string= efnname (upcase efnname)))) 1757 (fiddle (and (= lfnlen 0) (string= efnname (upcase efnname))))
1750 (ifnname (if fiddle (downcase efnname) efnname)) 1758 (ifnname (if fiddle (downcase efnname) efnname))
1751 (width (string-width ifnname)) 1759 (width (string-width ifnname))
1752 (text (format " %8d %-11s %-8s %s" 1760 (text (format " %8.0f %-11s %-8s %s"
1753 ucsize 1761 ucsize
1754 (archive-dosdate moddate) 1762 (archive-dosdate moddate)
1755 (archive-dostime modtime) 1763 (archive-dostime modtime)
@@ -1771,7 +1779,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
1771 dash) 1779 dash)
1772 (archive-summarize-files (nreverse visual)) 1780 (archive-summarize-files (nreverse visual))
1773 (insert dash 1781 (insert dash
1774 (format " %8d %d file%s" 1782 (format " %8.0f %d file%s"
1775 totalsize 1783 totalsize
1776 (length files) 1784 (length files)
1777 (if (= 1 (length files)) "" "s")) 1785 (if (= 1 (length files)) "" "s"))
diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index 4119dba5755..9d189e027c0 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -215,10 +215,10 @@ changes in subdirectories or in the contents, size, modes, etc.,
215of files. You may still sometimes want to revert them manually. 215of files. You may still sometimes want to revert them manually.
216 216
217Use this option with care since it could lead to excessive auto-reverts. 217Use this option with care since it could lead to excessive auto-reverts.
218For more information, see Info node `(emacs-xtra)Autorevert'." 218For more information, see Info node `(emacs)Autorevert'."
219 :group 'auto-revert 219 :group 'auto-revert
220 :type 'boolean 220 :type 'boolean
221 :link '(info-link "(emacs-xtra)Autorevert")) 221 :link '(info-link "(emacs)Autorevert"))
222 222
223(defcustom global-auto-revert-ignore-modes () 223(defcustom global-auto-revert-ignore-modes ()
224 "List of major modes Global Auto-Revert Mode should not check." 224 "List of major modes Global Auto-Revert Mode should not check."
diff --git a/lisp/avoid.el b/lisp/avoid.el
index 1d97dd306db..1868707720e 100644
--- a/lisp/avoid.el
+++ b/lisp/avoid.el
@@ -139,23 +139,13 @@ Only applies in mouse-avoidance-modes `animate' and `jump'."
139(defun mouse-avoidance-point-position () 139(defun mouse-avoidance-point-position ()
140 "Return the position of point as (FRAME X . Y). 140 "Return the position of point as (FRAME X . Y).
141Analogous to `mouse-position'." 141Analogous to `mouse-position'."
142 (let* ((w (selected-window)) 142 (let ((edges (window-inside-edges))
143 (edges (window-inside-edges w)) 143 (x-y (posn-x-y (posn-at-point))))
144 (list
145 (compute-motion (max (window-start w) (point-min)) ; start pos
146 ;; window-start can be < point-min if the
147 ;; latter has changed since the last redisplay
148 '(0 . 0) ; start XY
149 (point) ; stop pos
150 nil ; stop XY: none
151 nil ; width
152 (cons (window-hscroll w) 0) ; 0 may not be right?
153 (selected-window))))
154 ;; compute-motion returns (pos HPOS VPOS prevhpos contin)
155 ;; we want: (frame hpos . vpos)
156 (cons (selected-frame) 144 (cons (selected-frame)
157 (cons (+ (car edges) (car (cdr list))) 145 (cons (+ (car edges)
158 (+ (car (cdr edges)) (car (cdr (cdr list)))))))) 146 (/ (car x-y) (frame-char-width)))
147 (+ (car (cdr edges))
148 (/ (cdr x-y) (frame-char-height)))))))
159 149
160;(defun mouse-avoidance-point-position-test () 150;(defun mouse-avoidance-point-position-test ()
161; (interactive) 151; (interactive)
diff --git a/lisp/battery.el b/lisp/battery.el
index 34f74aa9932..50edc8dde8a 100644
--- a/lisp/battery.el
+++ b/lisp/battery.el
@@ -386,6 +386,14 @@ The following %-sequences are provided:
386 (when (re-search-forward 386 (when (re-search-forward
387 "temperature: +\\([0-9]+\\) C$" nil t) 387 "temperature: +\\([0-9]+\\) C$" nil t)
388 (match-string 1)))) 388 (match-string 1))))
389 (when (file-exists-p
390 "/proc/acpi/thermal_zone/THR2/temperature")
391 (with-temp-buffer
392 (insert-file-contents
393 "/proc/acpi/thermal_zone/THR2/temperature")
394 (when (re-search-forward
395 "temperature: +\\([0-9]+\\) C$" nil t)
396 (match-string 1))))
389 "N/A")) 397 "N/A"))
390 (cons ?r (or (and rate (concat (number-to-string rate) " " 398 (cons ?r (or (and rate (concat (number-to-string rate) " "
391 rate-type)) "N/A")) 399 rate-type)) "N/A"))
diff --git a/lisp/calc/calc-embed.el b/lisp/calc/calc-embed.el
index adb94ef7381..e54a94e4d39 100644
--- a/lisp/calc/calc-embed.el
+++ b/lisp/calc/calc-embed.el
@@ -206,6 +206,18 @@
206(defvar calc-embedded-firsttime-buf) 206(defvar calc-embedded-firsttime-buf)
207(defvar calc-embedded-firsttime-formula) 207(defvar calc-embedded-firsttime-formula)
208 208
209;; The following is to take care of any minor modes which override
210;; a Calc command.
211(defvar calc-override-minor-modes-map
212 (make-sparse-keymap)
213 "A list of keybindings that might be overwritten by minor modes.")
214
215;; Add any keys that might be overwritten here.
216(define-key calc-override-minor-modes-map "`" 'calc-edit)
217
218(defvar calc-override-minor-modes
219 (cons t calc-override-minor-modes-map))
220
209(defun calc-do-embedded (calc-embed-arg end obeg oend) 221(defun calc-do-embedded (calc-embed-arg end obeg oend)
210 (if calc-embedded-info 222 (if calc-embedded-info
211 223
@@ -237,6 +249,8 @@
237 truncate-lines (nth 2 mode) 249 truncate-lines (nth 2 mode)
238 buffer-read-only nil) 250 buffer-read-only nil)
239 (use-local-map (nth 1 mode)) 251 (use-local-map (nth 1 mode))
252 (setq minor-mode-overriding-map-alist
253 (remq calc-override-minor-modes minor-mode-overriding-map-alist))
240 (set-buffer-modified-p (buffer-modified-p)) 254 (set-buffer-modified-p (buffer-modified-p))
241 (calc-embedded-restore-original-modes) 255 (calc-embedded-restore-original-modes)
242 (or calc-embedded-quiet 256 (or calc-embedded-quiet
@@ -297,6 +311,9 @@
297 buffer-read-only t) 311 buffer-read-only t)
298 (set-buffer-modified-p (buffer-modified-p)) 312 (set-buffer-modified-p (buffer-modified-p))
299 (use-local-map calc-mode-map) 313 (use-local-map calc-mode-map)
314 (setq minor-mode-overriding-map-alist
315 (cons calc-override-minor-modes
316 minor-mode-overriding-map-alist))
300 (setq calc-no-refresh-evaltos nil) 317 (setq calc-no-refresh-evaltos nil)
301 (and chg calc-any-evaltos (calc-wrapper (calc-refresh-evaltos))) 318 (and chg calc-any-evaltos (calc-wrapper (calc-refresh-evaltos)))
302 (let (str) 319 (let (str)
diff --git a/lisp/comint.el b/lisp/comint.el
index 946085661fc..c7e5b3bdddd 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -802,27 +802,31 @@ buffer. The hook `comint-exec-hook' is run after each exec."
802 ;; This doesn't use "e" because it is supposed to work 802 ;; This doesn't use "e" because it is supposed to work
803 ;; for events without parameters. 803 ;; for events without parameters.
804 (interactive (list last-input-event)) 804 (interactive (list last-input-event))
805 (let ((pos (point))) 805 (when event
806 (if event (posn-set-point (event-end event))) 806 (posn-set-point (event-end event)))
807 (if (not (eq (get-char-property (point) 'field) 'input)) 807 (if comint-use-prompt-regexp
808 ;; No input at POS, fall back to the global definition. 808 (let ((input (funcall comint-get-old-input))
809 (let* ((keys (this-command-keys)) 809 (process (get-buffer-process (current-buffer))))
810 (last-key (and (vectorp keys) (aref keys (1- (length keys))))) 810 (if (not process)
811 (fun (and last-key (lookup-key global-map (vector last-key))))) 811 (error "Current buffer has no process")
812 (goto-char pos) 812 (goto-char (process-mark process))
813 (and fun (call-interactively fun))) 813 (insert input)))
814 (setq pos (point)) 814 (let ((pos (point)))
815 ;; There's previous input at POS, insert it at the end of the buffer. 815 (if (not (eq (field-at-pos pos) 'input))
816 (goto-char (point-max)) 816 ;; No input at POS, fall back to the global definition.
817 ;; First delete any old unsent input at the end 817 (let* ((keys (this-command-keys))
818 (delete-region 818 (last-key (and (vectorp keys) (aref keys (1- (length keys)))))
819 (or (marker-position comint-accum-marker) 819 (fun (and last-key (lookup-key global-map (vector last-key)))))
820 (process-mark (get-buffer-process (current-buffer)))) 820 (and fun (call-interactively fun)))
821 (point)) 821 ;; There's previous input at POS, insert it at the end of the buffer.
822 ;; Insert the input at point 822 (goto-char (point-max))
823 (insert (buffer-substring-no-properties 823 ;; First delete any old unsent input at the end
824 (previous-single-char-property-change (1+ pos) 'field) 824 (delete-region
825 (next-single-char-property-change pos 'field)))))) 825 (or (marker-position comint-accum-marker)
826 (process-mark (get-buffer-process (current-buffer))))
827 (point))
828 ;; Insert the input at point
829 (insert (field-string-no-properties pos))))))
826 830
827 831
828;; Input history processing in a buffer 832;; Input history processing in a buffer
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index d6af9e999f5..79b142470d1 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -196,6 +196,8 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
196 (suggest-key-bindings keyboard (choice (const :tag "off" nil) 196 (suggest-key-bindings keyboard (choice (const :tag "off" nil)
197 (integer :tag "time" 2) 197 (integer :tag "time" 2)
198 (other :tag "on"))) 198 (other :tag "on")))
199 ;; macselect.c
200 (mac-dnd-known-types mac (repeat string) "22.1")
199 ;; macterm.c 201 ;; macterm.c
200 (mac-control-modifier mac (choice (const :tag "No modifier" nil) 202 (mac-control-modifier mac (choice (const :tag "No modifier" nil)
201 (const control) (const meta) 203 (const control) (const meta)
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el
index cc89aad6ca3..1a8402e06c4 100644
--- a/lisp/diff-mode.el
+++ b/lisp/diff-mode.el
@@ -633,8 +633,8 @@ Non-nil OLD means that we want the old file."
633 "Convert unified diffs to context diffs. 633 "Convert unified diffs to context diffs.
634START and END are either taken from the region (if a prefix arg is given) or 634START and END are either taken from the region (if a prefix arg is given) or
635else cover the whole bufer." 635else cover the whole bufer."
636 (interactive (if current-prefix-arg 636 (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active))
637 (list (mark) (point)) 637 (list (region-beginning) (region-end))
638 (list (point-min) (point-max)))) 638 (list (point-min) (point-max))))
639 (unless (markerp end) (setq end (copy-marker end))) 639 (unless (markerp end) (setq end (copy-marker end)))
640 (let (;;(diff-inhibit-after-change t) 640 (let (;;(diff-inhibit-after-change t)
@@ -722,7 +722,7 @@ START and END are either taken from the region
722\(when it is highlighted) or else cover the whole buffer. 722\(when it is highlighted) or else cover the whole buffer.
723With a prefix argument, convert unified format to context format." 723With a prefix argument, convert unified format to context format."
724 (interactive (if (and transient-mark-mode mark-active) 724 (interactive (if (and transient-mark-mode mark-active)
725 (list (mark) (point) current-prefix-arg) 725 (list (region-beginning) (region-end) current-prefix-arg)
726 (list (point-min) (point-max) current-prefix-arg))) 726 (list (point-min) (point-max) current-prefix-arg)))
727 (if to-context 727 (if to-context
728 (diff-unified->context start end) 728 (diff-unified->context start end)
@@ -795,8 +795,8 @@ With a prefix argument, convert unified format to context format."
795 "Reverse the direction of the diffs. 795 "Reverse the direction of the diffs.
796START and END are either taken from the region (if a prefix arg is given) or 796START and END are either taken from the region (if a prefix arg is given) or
797else cover the whole bufer." 797else cover the whole bufer."
798 (interactive (if current-prefix-arg 798 (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active))
799 (list (mark) (point)) 799 (list (region-beginning) (region-end))
800 (list (point-min) (point-max)))) 800 (list (point-min) (point-max))))
801 (unless (markerp end) (setq end (copy-marker end))) 801 (unless (markerp end) (setq end (copy-marker end)))
802 (let (;;(diff-inhibit-after-change t) 802 (let (;;(diff-inhibit-after-change t)
@@ -857,8 +857,8 @@ else cover the whole bufer."
857 "Fixup the hunk headers (in case the buffer was modified). 857 "Fixup the hunk headers (in case the buffer was modified).
858START and END are either taken from the region (if a prefix arg is given) or 858START and END are either taken from the region (if a prefix arg is given) or
859else cover the whole bufer." 859else cover the whole bufer."
860 (interactive (if current-prefix-arg 860 (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active))
861 (list (mark) (point)) 861 (list (region-beginning) (region-end))
862 (list (point-min) (point-max)))) 862 (list (point-min) (point-max))))
863 (let ((inhibit-read-only t)) 863 (let ((inhibit-read-only t))
864 (save-excursion 864 (save-excursion
@@ -1069,7 +1069,7 @@ Only works for unified diffs."
1069 1069
1070(defun diff-hunk-text (hunk destp char-offset) 1070(defun diff-hunk-text (hunk destp char-offset)
1071 "Return the literal source text from HUNK as (TEXT . OFFSET). 1071 "Return the literal source text from HUNK as (TEXT . OFFSET).
1072if DESTP is nil TEXT is the source, otherwise the destination text. 1072If DESTP is nil, TEXT is the source, otherwise the destination text.
1073CHAR-OFFSET is a char-offset in HUNK, and OFFSET is the corresponding 1073CHAR-OFFSET is a char-offset in HUNK, and OFFSET is the corresponding
1074char-offset in TEXT." 1074char-offset in TEXT."
1075 (with-temp-buffer 1075 (with-temp-buffer
@@ -1302,7 +1302,7 @@ With a prefix argument, try to REVERSE the hunk."
1302`diff-jump-to-old-file' (or its opposite if the OTHER-FILE prefix arg 1302`diff-jump-to-old-file' (or its opposite if the OTHER-FILE prefix arg
1303is given) determines whether to jump to the old or the new file. 1303is given) determines whether to jump to the old or the new file.
1304If the prefix arg is bigger than 8 (for example with \\[universal-argument] \\[universal-argument]) 1304If the prefix arg is bigger than 8 (for example with \\[universal-argument] \\[universal-argument])
1305 then `diff-jump-to-old-file' is also set, for the next invocations." 1305then `diff-jump-to-old-file' is also set, for the next invocations."
1306 (interactive (list current-prefix-arg last-input-event)) 1306 (interactive (list current-prefix-arg last-input-event))
1307 ;; When pointing at a removal line, we probably want to jump to 1307 ;; When pointing at a removal line, we probably want to jump to
1308 ;; the old location, and else to the new (i.e. as if reverting). 1308 ;; the old location, and else to the new (i.e. as if reverting).
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 20b0037ab7e..e07689973e4 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -918,7 +918,7 @@ or delete subdirectories can bypass this machinery. Hence, you sometimes
918may have to reset some subdirectory switches after a `dired-undo'. 918may have to reset some subdirectory switches after a `dired-undo'.
919You can reset all subdirectory switches to the default using 919You can reset all subdirectory switches to the default using
920\\<dired-mode-map>\\[dired-reset-subdir-switches]. 920\\<dired-mode-map>\\[dired-reset-subdir-switches].
921See Info node `(emacs-xtra)Subdir switches' for more details." 921See Info node `(emacs)Subdir switches' for more details."
922 ;; Moves point if the next ARG files are redisplayed. 922 ;; Moves point if the next ARG files are redisplayed.
923 (interactive "P\np") 923 (interactive "P\np")
924 (if (and test-for-subdir (dired-get-subdir)) 924 (if (and test-for-subdir (dired-get-subdir))
@@ -1761,7 +1761,7 @@ or delete subdirectories can bypass this machinery. Hence, you sometimes
1761may have to reset some subdirectory switches after a `dired-undo'. 1761may have to reset some subdirectory switches after a `dired-undo'.
1762You can reset all subdirectory switches to the default using 1762You can reset all subdirectory switches to the default using
1763\\<dired-mode-map>\\[dired-reset-subdir-switches]. 1763\\<dired-mode-map>\\[dired-reset-subdir-switches].
1764See Info node `(emacs-xtra)Subdir switches' for more details." 1764See Info node `(emacs)Subdir switches' for more details."
1765 (interactive 1765 (interactive
1766 (list (dired-get-filename) 1766 (list (dired-get-filename)
1767 (if current-prefix-arg 1767 (if current-prefix-arg
diff --git a/lisp/ediff.el b/lisp/ediff.el
index bb6cfc6b72e..14f634f0cd2 100644
--- a/lisp/ediff.el
+++ b/lisp/ediff.el
@@ -210,12 +210,11 @@
210 ediff-last-dir-B 210 ediff-last-dir-B
211 (file-name-directory f))) 211 (file-name-directory f)))
212 (progn 212 (progn
213 (setq file-name-history 213 (add-to-history 'file-name-history
214 (cons (ediff-abbreviate-file-name 214 (ediff-abbreviate-file-name
215 (expand-file-name 215 (expand-file-name
216 (file-name-nondirectory f) 216 (file-name-nondirectory f)
217 dir-B)) 217 dir-B)))
218 file-name-history))
219 (ediff-get-default-file-name f 1))) 218 (ediff-get-default-file-name f 1)))
220 ))) 219 )))
221 (ediff-files-internal file-A 220 (ediff-files-internal file-A
@@ -246,25 +245,22 @@
246 ediff-last-dir-B 245 ediff-last-dir-B
247 (file-name-directory f))) 246 (file-name-directory f)))
248 (progn 247 (progn
249 (setq file-name-history 248 (add-to-history 'file-name-history
250 (cons 249 (ediff-abbreviate-file-name
251 (ediff-abbreviate-file-name 250 (expand-file-name
252 (expand-file-name 251 (file-name-nondirectory f)
253 (file-name-nondirectory f) 252 dir-B)))
254 dir-B))
255 file-name-history))
256 (ediff-get-default-file-name f 1)))) 253 (ediff-get-default-file-name f 1))))
257 (ediff-read-file-name "File C to compare" 254 (ediff-read-file-name "File C to compare"
258 (setq dir-C (if ediff-use-last-dir 255 (setq dir-C (if ediff-use-last-dir
259 ediff-last-dir-C 256 ediff-last-dir-C
260 (file-name-directory ff))) 257 (file-name-directory ff)))
261 (progn 258 (progn
262 (setq file-name-history 259 (add-to-history 'file-name-history
263 (cons (ediff-abbreviate-file-name 260 (ediff-abbreviate-file-name
264 (expand-file-name 261 (expand-file-name
265 (file-name-nondirectory ff) 262 (file-name-nondirectory ff)
266 dir-C)) 263 dir-C)))
267 file-name-history))
268 (ediff-get-default-file-name ff 2))) 264 (ediff-get-default-file-name ff 2)))
269 ))) 265 )))
270 (ediff-files-internal file-A 266 (ediff-files-internal file-A
@@ -1109,12 +1105,11 @@ lines. For small regions, use `ediff-regions-wordwise'."
1109 ediff-last-dir-B 1105 ediff-last-dir-B
1110 (file-name-directory f))) 1106 (file-name-directory f)))
1111 (progn 1107 (progn
1112 (setq file-name-history 1108 (add-to-history 'file-name-history
1113 (cons (ediff-abbreviate-file-name 1109 (ediff-abbreviate-file-name
1114 (expand-file-name 1110 (expand-file-name
1115 (file-name-nondirectory f) 1111 (file-name-nondirectory f)
1116 dir-B)) 1112 dir-B)))
1117 file-name-history))
1118 (ediff-get-default-file-name f 1))) 1113 (ediff-get-default-file-name f 1)))
1119 ))) 1114 )))
1120 (setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks)) 1115 (setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks))
@@ -1153,13 +1148,11 @@ lines. For small regions, use `ediff-regions-wordwise'."
1153 ediff-last-dir-B 1148 ediff-last-dir-B
1154 (file-name-directory f))) 1149 (file-name-directory f)))
1155 (progn 1150 (progn
1156 (setq file-name-history 1151 (add-to-history 'file-name-history
1157 (cons 1152 (ediff-abbreviate-file-name
1158 (ediff-abbreviate-file-name 1153 (expand-file-name
1159 (expand-file-name 1154 (file-name-nondirectory f)
1160 (file-name-nondirectory f) 1155 dir-B)))
1161 dir-B))
1162 file-name-history))
1163 (ediff-get-default-file-name f 1)))) 1156 (ediff-get-default-file-name f 1))))
1164 (ediff-read-file-name "Ancestor file" 1157 (ediff-read-file-name "Ancestor file"
1165 (setq dir-ancestor 1158 (setq dir-ancestor
@@ -1167,12 +1160,11 @@ lines. For small regions, use `ediff-regions-wordwise'."
1167 ediff-last-dir-ancestor 1160 ediff-last-dir-ancestor
1168 (file-name-directory ff))) 1161 (file-name-directory ff)))
1169 (progn 1162 (progn
1170 (setq file-name-history 1163 (add-to-history 'file-name-history
1171 (cons (ediff-abbreviate-file-name 1164 (ediff-abbreviate-file-name
1172 (expand-file-name 1165 (expand-file-name
1173 (file-name-nondirectory ff) 1166 (file-name-nondirectory ff)
1174 dir-ancestor)) 1167 dir-ancestor)))
1175 file-name-history))
1176 (ediff-get-default-file-name ff 2))) 1168 (ediff-get-default-file-name ff 2)))
1177 ))) 1169 )))
1178 (setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks)) 1170 (setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks))
diff --git a/lisp/emacs-lisp/crm.el b/lisp/emacs-lisp/crm.el
index 5a9787b5ca8..11d4d7fb2ba 100644
--- a/lisp/emacs-lisp/crm.el
+++ b/lisp/emacs-lisp/crm.el
@@ -592,25 +592,28 @@ The return value of this function is a list of the read strings.
592See the documentation for `completing-read' for details on the arguments: 592See the documentation for `completing-read' for details on the arguments:
593PROMPT, TABLE, PREDICATE, REQUIRE-MATCH, INITIAL-INPUT, HIST, DEF, and 593PROMPT, TABLE, PREDICATE, REQUIRE-MATCH, INITIAL-INPUT, HIST, DEF, and
594INHERIT-INPUT-METHOD." 594INHERIT-INPUT-METHOD."
595 (let ((minibuffer-completion-table (function crm-collection-fn)) 595 (let* ((minibuffer-completion-table (function crm-collection-fn))
596 (minibuffer-completion-predicate predicate) 596 (minibuffer-completion-predicate predicate)
597 ;; see completing_read in src/minibuf.c 597 ;; see completing_read in src/minibuf.c
598 (minibuffer-completion-confirm 598 (minibuffer-completion-confirm
599 (unless (eq require-match t) require-match)) 599 (unless (eq require-match t) require-match))
600 (crm-completion-table table) 600 (crm-completion-table table)
601 crm-last-exact-completion 601 crm-last-exact-completion
602 crm-current-element 602 crm-current-element
603 crm-left-of-element 603 crm-left-of-element
604 crm-right-of-element 604 crm-right-of-element
605 crm-beginning-of-element 605 crm-beginning-of-element
606 crm-end-of-element 606 crm-end-of-element
607 (map (if require-match 607 (map (if require-match
608 crm-local-must-match-map 608 crm-local-must-match-map
609 crm-local-completion-map))) 609 crm-local-completion-map))
610 (split-string (read-from-minibuffer 610 ;; If the user enters empty input, read-from-minibuffer returns
611 prompt initial-input map 611 ;; the empty string, not DEF.
612 nil hist def inherit-input-method) 612 (input (read-from-minibuffer
613 crm-separator))) 613 prompt initial-input map
614 nil hist def inherit-input-method)))
615 (and def (string-equal input "") (setq input def))
616 (split-string input crm-separator)))
614 617
615;; testing and debugging 618;; testing and debugging
616;; (defun crm-init-test-environ () 619;; (defun crm-init-test-environ ()
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index caac02c2ee3..5475ed530d3 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -139,7 +139,8 @@ For example, you could write
139 (setq body (list* lighter keymap body) lighter nil keymap nil)) 139 (setq body (list* lighter keymap body) lighter nil keymap nil))
140 ((keywordp keymap) (push keymap body) (setq keymap nil))) 140 ((keywordp keymap) (push keymap body) (setq keymap nil)))
141 141
142 (let* ((mode-name (symbol-name mode)) 142 (let* ((last-message (current-message))
143 (mode-name (symbol-name mode))
143 (pretty-name (easy-mmode-pretty-mode-name mode lighter)) 144 (pretty-name (easy-mmode-pretty-mode-name mode lighter))
144 (globalp nil) 145 (globalp nil)
145 (set nil) 146 (set nil)
@@ -236,7 +237,10 @@ With zero or negative ARG turn mode off.
236 (if (called-interactively-p) 237 (if (called-interactively-p)
237 (progn 238 (progn
238 ,(if globalp `(customize-mark-as-set ',mode)) 239 ,(if globalp `(customize-mark-as-set ',mode))
239 (unless (current-message) 240 ;; Avoid overwriting a message shown by the body,
241 ;; but do overwrite previous messages.
242 (unless ,(and (current-message)
243 (not (equal last-message (current-message))))
240 (message ,(format "%s %%sabled" pretty-name) 244 (message ,(format "%s %%sabled" pretty-name)
241 (if ,mode "en" "dis"))))) 245 (if ,mode "en" "dis")))))
242 (force-mode-line-update) 246 (force-mode-line-update)
diff --git a/lisp/emacs-lisp/ewoc.el b/lisp/emacs-lisp/ewoc.el
index 085ae532a63..6ef14558a6a 100644
--- a/lisp/emacs-lisp/ewoc.el
+++ b/lisp/emacs-lisp/ewoc.el
@@ -144,13 +144,6 @@
144 144
145\(fn NODE CHILD)") 145\(fn NODE CHILD)")
146 146
147(defun ewoc--dll-create ()
148 "Create an empty doubly linked list."
149 (let ((dummy-node (ewoc--node-create 'DL-LIST 'DL-LIST)))
150 (setf (ewoc--node-right dummy-node) dummy-node)
151 (setf (ewoc--node-left dummy-node) dummy-node)
152 dummy-node))
153
154(defun ewoc--node-enter-before (node elemnode) 147(defun ewoc--node-enter-before (node elemnode)
155 "Insert ELEMNODE before NODE in a DLL." 148 "Insert ELEMNODE before NODE in a DLL."
156 (assert (and (null (ewoc--node-left elemnode)) (null (ewoc--node-right elemnode)))) 149 (assert (and (null (ewoc--node-left elemnode)) (null (ewoc--node-right elemnode))))
@@ -159,14 +152,6 @@
159 (setf (ewoc--node-right (ewoc--node-left node)) elemnode) 152 (setf (ewoc--node-right (ewoc--node-left node)) elemnode)
160 (setf (ewoc--node-left node) elemnode)) 153 (setf (ewoc--node-left node) elemnode))
161 154
162(defun ewoc--node-enter-first (dll node)
163 "Add a free floating NODE first in DLL."
164 (ewoc--node-enter-before (ewoc--node-right dll) node))
165
166(defun ewoc--node-enter-last (dll node)
167 "Add a free floating NODE last in DLL."
168 (ewoc--node-enter-before dll node))
169
170(defun ewoc--node-next (dll node) 155(defun ewoc--node-next (dll node)
171 "Return the node after NODE, or nil if NODE is the last node." 156 "Return the node after NODE, or nil if NODE is the last node."
172 (unless (eq (ewoc--node-right node) dll) (ewoc--node-right node))) 157 (unless (eq (ewoc--node-right node) dll) (ewoc--node-right node)))
@@ -175,16 +160,6 @@
175 "Return the node before NODE, or nil if NODE is the first node." 160 "Return the node before NODE, or nil if NODE is the first node."
176 (unless (eq (ewoc--node-left node) dll) (ewoc--node-left node))) 161 (unless (eq (ewoc--node-left node) dll) (ewoc--node-left node)))
177 162
178(defun ewoc--node-delete (node)
179 "Unbind NODE from its doubly linked list and return it."
180 ;; This is a no-op when applied to the dummy node. This will return
181 ;; nil if applied to the dummy node since it always contains nil.
182 (setf (ewoc--node-right (ewoc--node-left node)) (ewoc--node-right node))
183 (setf (ewoc--node-left (ewoc--node-right node)) (ewoc--node-left node))
184 (setf (ewoc--node-left node) nil)
185 (setf (ewoc--node-right node) nil)
186 node)
187
188(defun ewoc--node-nth (dll n) 163(defun ewoc--node-nth (dll n)
189 "Return the Nth node from the doubly linked list DLL. 164 "Return the Nth node from the doubly linked list DLL.
190N counts from zero. If DLL is not that long, nil is returned. 165N counts from zero. If DLL is not that long, nil is returned.
@@ -221,16 +196,12 @@ dll bound to ewoc--dll, and VARLIST bound as in a let*.
221dll will be bound when VARLIST is initialized, but the current 196dll will be bound when VARLIST is initialized, but the current
222buffer will *not* have been changed. 197buffer will *not* have been changed.
223Return value of last form in FORMS." 198Return value of last form in FORMS."
224 (let ((old-buffer (make-symbol "old-buffer")) 199 (let ((hnd (make-symbol "ewoc")))
225 (hnd (make-symbol "ewoc"))) 200 `(let* ((,hnd ,ewoc)
226 `(let* ((,old-buffer (current-buffer))
227 (,hnd ,ewoc)
228 (dll (ewoc--dll ,hnd)) 201 (dll (ewoc--dll ,hnd))
229 ,@varlist) 202 ,@varlist)
230 (set-buffer (ewoc--buffer ,hnd)) 203 (with-current-buffer (ewoc--buffer ,hnd)
231 (unwind-protect 204 ,@forms))))
232 (progn ,@forms)
233 (set-buffer ,old-buffer)))))
234 205
235(defmacro ewoc--set-buffer-bind-dll (ewoc &rest forms) 206(defmacro ewoc--set-buffer-bind-dll (ewoc &rest forms)
236 `(ewoc--set-buffer-bind-dll-let* ,ewoc nil ,@forms)) 207 `(ewoc--set-buffer-bind-dll-let* ,ewoc nil ,@forms))
@@ -261,26 +232,6 @@ start position and the element DATA."
261 (funcall pretty-printer data) 232 (funcall pretty-printer data)
262 (ewoc--node-create (copy-marker pos) data)))) 233 (ewoc--node-create (copy-marker pos) data))))
263 234
264
265(defun ewoc--delete-node-internal (ewoc node)
266 "Delete a data string from EWOC.
267Can not be used on the footer. Return the wrapper that is deleted.
268The start-marker in the wrapper is set to nil, so that it doesn't
269consume any more resources."
270 (let ((dll (ewoc--dll ewoc))
271 (inhibit-read-only t))
272 ;; If we are about to delete the node pointed at by last-node,
273 ;; set last-node to nil.
274 (if (eq (ewoc--last-node ewoc) node)
275 (setf (ewoc--last-node ewoc) nil))
276
277 (delete-region (ewoc--node-start-marker node)
278 (ewoc--node-start-marker (ewoc--node-next dll node)))
279 (set-marker (ewoc--node-start-marker node) nil)
280 ;; Delete the node, and return the wrapper.
281 (ewoc--node-delete node)))
282
283
284(defun ewoc--refresh-node (pp node) 235(defun ewoc--refresh-node (pp node)
285 "Redisplay the element represented by NODE using the pretty-printer PP." 236 "Redisplay the element represented by NODE using the pretty-printer PP."
286 (let ((inhibit-read-only t)) 237 (let ((inhibit-read-only t))
@@ -313,19 +264,23 @@ Optional second argument HEADER is a string that will always be
313present at the top of the ewoc. HEADER should end with a 264present at the top of the ewoc. HEADER should end with a
314newline. Optional third argument FOOTER is similar, and will 265newline. Optional third argument FOOTER is similar, and will
315be inserted at the bottom of the ewoc." 266be inserted at the bottom of the ewoc."
316 (let ((new-ewoc 267 (let* ((dummy-node (ewoc--node-create 'DL-LIST 'DL-LIST))
317 (ewoc--create (current-buffer) 268 (dll (progn (setf (ewoc--node-right dummy-node) dummy-node)
318 pretty-printer nil nil (ewoc--dll-create))) 269 (setf (ewoc--node-left dummy-node) dummy-node)
319 (pos (point))) 270 dummy-node))
271 (new-ewoc
272 (ewoc--create (current-buffer)
273 pretty-printer nil nil dll))
274 (pos (point)))
320 (ewoc--set-buffer-bind-dll new-ewoc 275 (ewoc--set-buffer-bind-dll new-ewoc
321 ;; Set default values 276 ;; Set default values
322 (unless header (setq header "")) 277 (unless header (setq header ""))
323 (unless footer (setq footer "")) 278 (unless footer (setq footer ""))
324 (setf (ewoc--node-start-marker dll) (copy-marker pos)) 279 (setf (ewoc--node-start-marker dll) (copy-marker pos))
325 (let ((foot (ewoc--create-node footer (lambda (x) (insert footer)) pos)) 280 (let ((foot (ewoc--create-node footer 'insert pos))
326 (head (ewoc--create-node header (lambda (x) (insert header)) pos))) 281 (head (ewoc--create-node header 'insert pos)))
327 (ewoc--node-enter-first dll head) 282 (ewoc--node-enter-before (ewoc--node-right dll) head)
328 (ewoc--node-enter-last dll foot) 283 (ewoc--node-enter-before dll foot)
329 (setf (ewoc--header new-ewoc) head) 284 (setf (ewoc--header new-ewoc) head)
330 (setf (ewoc--footer new-ewoc) foot))) 285 (setf (ewoc--footer new-ewoc) foot)))
331 ;; Return the ewoc 286 ;; Return the ewoc
@@ -421,11 +376,27 @@ ARGS are given they will be passed to the PREDICATE."
421 (ewoc--set-buffer-bind-dll-let* ewoc 376 (ewoc--set-buffer-bind-dll-let* ewoc
422 ((node (ewoc--node-nth dll 1)) 377 ((node (ewoc--node-nth dll 1))
423 (footer (ewoc--footer ewoc)) 378 (footer (ewoc--footer ewoc))
424 (next nil)) 379 (next nil)
380 (L nil) (R nil)
381 (inhibit-read-only t))
425 (while (not (eq node footer)) 382 (while (not (eq node footer))
426 (setq next (ewoc--node-next dll node)) 383 (setq next (ewoc--node-next dll node))
427 (unless (apply predicate (ewoc--node-data node) args) 384 (unless (apply predicate (ewoc--node-data node) args)
428 (ewoc--delete-node-internal ewoc node)) 385 ;; If we are about to delete the node pointed at by last-node,
386 ;; set last-node to nil.
387 (if (eq (ewoc--last-node ewoc) node)
388 (setf (ewoc--last-node ewoc) nil))
389 (delete-region (ewoc--node-start-marker node)
390 (ewoc--node-start-marker (ewoc--node-next dll node)))
391 (set-marker (ewoc--node-start-marker node) nil)
392 (setf L (ewoc--node-left node)
393 R (ewoc--node-right node)
394 ;; Link neighbors to each other.
395 (ewoc--node-right L) R
396 (ewoc--node-left R) L
397 ;; Forget neighbors.
398 (ewoc--node-left node) nil
399 (ewoc--node-right node) nil))
429 (setq node next)))) 400 (setq node next))))
430 401
431(defun ewoc-locate (ewoc &optional pos guess) 402(defun ewoc-locate (ewoc &optional pos guess)
@@ -601,8 +572,8 @@ Return nil if the buffer has been deleted."
601 "Set the HEADER and FOOTER of EWOC." 572 "Set the HEADER and FOOTER of EWOC."
602 (setf (ewoc--node-data (ewoc--header ewoc)) header) 573 (setf (ewoc--node-data (ewoc--header ewoc)) header)
603 (setf (ewoc--node-data (ewoc--footer ewoc)) footer) 574 (setf (ewoc--node-data (ewoc--footer ewoc)) footer)
604 (ewoc--refresh-node (lambda (x) (insert header)) (ewoc--header ewoc)) 575 (ewoc--refresh-node 'insert (ewoc--header ewoc))
605 (ewoc--refresh-node (lambda (x) (insert footer)) (ewoc--footer ewoc))) 576 (ewoc--refresh-node 'insert (ewoc--footer ewoc)))
606 577
607 578
608(provide 'ewoc) 579(provide 'ewoc)
diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el
index 827578f694c..5dc67e4ac21 100644
--- a/lisp/emacs-lisp/re-builder.el
+++ b/lisp/emacs-lisp/re-builder.el
@@ -112,7 +112,7 @@
112(if (not (fboundp 'make-overlay)) 112(if (not (fboundp 'make-overlay))
113 (require 'overlay)) 113 (require 'overlay))
114 114
115;; User costomizable variables 115;; User customizable variables
116(defgroup re-builder nil 116(defgroup re-builder nil
117 "Options for the RE Builder." 117 "Options for the RE Builder."
118 :group 'lisp 118 :group 'lisp
@@ -627,11 +627,9 @@ Return t if the (cooked) expression changed."
627 beg (match-end 0))) 627 beg (match-end 0)))
628 i)) 628 i))
629 629
630
631(defun reb-update-overlays (&optional subexp) 630(defun reb-update-overlays (&optional subexp)
632 "Switch to `reb-target-buffer' and mark all matches of `reb-regexp'. 631 "Switch to `reb-target-buffer' and mark all matches of `reb-regexp'.
633If SUBEXP is non-nil mark only the corresponding sub-expressions." 632If SUBEXP is non-nil mark only the corresponding sub-expressions."
634
635 (let* ((re (reb-target-binding reb-regexp)) 633 (let* ((re (reb-target-binding reb-regexp))
636 (subexps (reb-count-subexps re)) 634 (subexps (reb-count-subexps re))
637 (matches 0) 635 (matches 0)
@@ -645,24 +643,35 @@ If SUBEXP is non-nil mark only the corresponding sub-expressions."
645 (or (not reb-auto-match-limit) 643 (or (not reb-auto-match-limit)
646 (< matches reb-auto-match-limit))) 644 (< matches reb-auto-match-limit)))
647 (if (= 0 (length (match-string 0))) 645 (if (= 0 (length (match-string 0)))
648 (error "Empty regular expression!")) 646 (error "Empty regular expression!"))
649 (let ((i 0)) 647 (let ((i 0)
648 suffix max-suffix)
650 (setq matches (1+ matches)) 649 (setq matches (1+ matches))
651 (while (<= i subexps) 650 (while (<= i subexps)
652 (if (and (or (not subexp) (= subexp i)) 651 (if (and (or (not subexp) (= subexp i))
653 (match-beginning i)) 652 (match-beginning i))
654 (let ((overlay (make-overlay (match-beginning i) 653 (let ((overlay (make-overlay (match-beginning i)
655 (match-end i))) 654 (match-end i)))
656 (face-name (format "reb-match-%d" i))) 655 ;; When we have exceeded the number of provided faces,
657 (if (not firstmatch) 656 ;; cycle thru them where `max-suffix' denotes the maximum
658 (setq firstmatch (match-data))) 657 ;; suffix for `reb-match-*' that has been defined and
658 ;; `suffix' the suffix calculated for the current match.
659 (face
660 (cond
661 (max-suffix
662 (if (= suffix max-suffix)
663 (setq suffix 1)
664 (setq suffix (1+ suffix)))
665 (intern-soft (format "reb-match-%d" suffix)))
666 ((intern-soft (format "reb-match-%d" i)))
667 ((setq max-suffix (1- i))
668 (setq suffix 1)
669 ;; `reb-match-1' must exist.
670 'reb-match-1))))
671 (unless firstmatch (setq firstmatch (match-data)))
659 (setq reb-overlays (cons overlay reb-overlays) 672 (setq reb-overlays (cons overlay reb-overlays)
660 submatches (1+ submatches)) 673 submatches (1+ submatches))
661 (overlay-put 674 (overlay-put overlay 'face face)
662 overlay 'face
663 (or (intern-soft face-name)
664 (error "Too many subexpressions - face `%s' not defined"
665 face-name )))
666 (overlay-put overlay 'priority i))) 675 (overlay-put overlay 'priority i)))
667 (setq i (1+ i)))))) 676 (setq i (1+ i))))))
668 (let ((count (if subexp submatches matches))) 677 (let ((count (if subexp submatches matches)))
diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el
index 1484c38a403..695d7877b38 100644
--- a/lisp/emacs-lisp/syntax.el
+++ b/lisp/emacs-lisp/syntax.el
@@ -27,9 +27,9 @@
27 27
28;; The main exported function is `syntax-ppss'. You might also need 28;; The main exported function is `syntax-ppss'. You might also need
29;; to call `syntax-ppss-flush-cache' or to add it to 29;; to call `syntax-ppss-flush-cache' or to add it to
30;; after-change-functions'(although this is automatically done by 30;; before-change-functions'(although this is automatically done by
31;; syntax-ppss when needed, but that might fail if syntax-ppss is 31;; syntax-ppss when needed, but that might fail if syntax-ppss is
32;; called in a context where after-change-functions is temporarily 32;; called in a context where before-change-functions is temporarily
33;; let-bound to nil). 33;; let-bound to nil).
34 34
35;;; Todo: 35;;; Todo:
@@ -94,10 +94,9 @@ point (where the PPSS is equivalent to nil).")
94 (setq syntax-ppss-last nil) 94 (setq syntax-ppss-last nil)
95 (setcar syntax-ppss-last nil))) 95 (setcar syntax-ppss-last nil)))
96 ;; Unregister if there's no cache left. Sadly this doesn't work 96 ;; Unregister if there's no cache left. Sadly this doesn't work
97 ;; because `after-change-functions' is temporarily bound to nil here. 97 ;; because `before-change-functions' is temporarily bound to nil here.
98 ;; (unless syntax-ppss-cache 98 ;; (unless syntax-ppss-cache
99 ;; (remove-hook 'after-change-functions 99 ;; (remove-hook 'before-change-functions 'syntax-ppss-flush-cache t))
100 ;; 'syntax-ppss-after-change-function t))
101 ) 100 )
102 101
103(defvar syntax-ppss-stats 102(defvar syntax-ppss-stats
@@ -148,7 +147,7 @@ Point is at POS when this function returns."
148 ;; too far from `pos', we could try to use other positions 147 ;; too far from `pos', we could try to use other positions
149 ;; in (nth 9 old-ppss), but that doesn't seem to happen in 148 ;; in (nth 9 old-ppss), but that doesn't seem to happen in
150 ;; practice and it would complicate this code (and the 149 ;; practice and it would complicate this code (and the
151 ;; after-change-function code even more). But maybe it 150 ;; before-change-function code even more). But maybe it
152 ;; would be useful in "degenerate" cases such as when the 151 ;; would be useful in "degenerate" cases such as when the
153 ;; whole file is wrapped in a set of parenthesis. 152 ;; whole file is wrapped in a set of parenthesis.
154 (setq pt-min (or (car (nth 9 old-ppss)) 153 (setq pt-min (or (car (nth 9 old-ppss))
@@ -176,10 +175,10 @@ Point is at POS when this function returns."
176 (setq cache (cdr cache))) 175 (setq cache (cdr cache)))
177 (if cache (setq pt-min (caar cache) ppss (cdar cache))) 176 (if cache (setq pt-min (caar cache) ppss (cdar cache)))
178 177
179 ;; Setup the after-change function if necessary. 178 ;; Setup the before-change function if necessary.
180 (unless (or syntax-ppss-cache syntax-ppss-last) 179 (unless (or syntax-ppss-cache syntax-ppss-last)
181 (add-hook 'after-change-functions 180 (add-hook 'before-change-functions
182 'syntax-ppss-flush-cache nil t)) 181 'syntax-ppss-flush-cache t t))
183 182
184 ;; Use the best of OLD-POS and CACHE. 183 ;; Use the best of OLD-POS and CACHE.
185 (if (or (not old-pos) (< old-pos pt-min)) 184 (if (or (not old-pos) (< old-pos pt-min))
diff --git a/lisp/env.el b/lisp/env.el
index 1b6c038cbea..5a3de0ac712 100644
--- a/lisp/env.el
+++ b/lisp/env.el
@@ -117,7 +117,7 @@ a side-effect."
117 (let* ((var (read-envvar-name "Set environment variable: " nil)) 117 (let* ((var (read-envvar-name "Set environment variable: " nil))
118 (value (getenv var))) 118 (value (getenv var)))
119 (when value 119 (when value
120 (push value setenv-history)) 120 (add-to-history 'setenv-history value))
121 ;; Here finally we specify the args to give call setenv with. 121 ;; Here finally we specify the args to give call setenv with.
122 (list var 122 (list var
123 (read-from-minibuffer (format "Set %s to value: " var) 123 (read-from-minibuffer (format "Set %s to value: " var)
diff --git a/lisp/files.el b/lisp/files.el
index 76167eb27cf..29cd3038500 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2349,31 +2349,29 @@ asking you for confirmation."
2349;; For variables defined in the C source code the declaration should go here: 2349;; For variables defined in the C source code the declaration should go here:
2350 2350
2351;; FIXME: Some variables should be moved according to the rules above. 2351;; FIXME: Some variables should be moved according to the rules above.
2352(let ((string-or-null (lambda (a) (or (stringp a) (null a))))) 2352(mapc (lambda (pair)
2353 (eval 2353 (put (car pair) 'safe-local-variable (cdr pair)))
2354 `(mapc (lambda (pair) 2354 '((byte-compile-dynamic . booleanp)
2355 (put (car pair) 'safe-local-variable (cdr pair))) 2355 (byte-compile-dynamic-docstrings . booleanp)
2356 '((byte-compile-dynamic . t) 2356 (byte-compile-warnings . booleanp)
2357 (byte-compile-dynamic-docstrings . t) 2357 (c-basic-offset . integerp)
2358 (byte-compile-warnings . t) 2358 (c-file-style . stringp)
2359 (c-basic-offset . integerp) 2359 (c-indent-level . integerp)
2360 (c-file-style . stringp) 2360 (comment-column . integerp)
2361 (c-indent-level . integerp) 2361 (compile-command . string-or-null-p)
2362 (comment-column . integerp) 2362 (find-file-visit-truename . booleanp)
2363 (compile-command . string-or-null-p) 2363 (fill-column . integerp)
2364 (find-file-visit-truename . t) 2364 (fill-prefix . string-or-null-p)
2365 (fill-column . integerp) 2365 (indent-tabs-mode . booleanp) ;; C source code
2366 (fill-prefix . string-or-null-p) 2366 (kept-old-versions . integerp)
2367 (indent-tabs-mode . t) 2367 (kept-new-versions . integerp)
2368 (kept-old-versions . integerp) 2368 (left-margin . integerp)
2369 (kept-new-versions . integerp) 2369 (no-byte-compile . booleanp)
2370 (left-margin . t) 2370 (no-update-autoloads . booleanp)
2371 (no-byte-compile . t) 2371 (outline-regexp . string-or-null-p)
2372 (no-update-autoloads . t) 2372 (tab-width . integerp) ;; C source code
2373 (outline-regexp . string-or-null-p) 2373 (truncate-lines . booleanp) ;; C source code
2374 (tab-width . integerp) ;; C source code 2374 (version-control . symbolp)))
2375 (truncate-lines . t) ;; C source code
2376 (version-control . t)))))
2377 2375
2378(put 'c-set-style 'safe-local-eval-function t) 2376(put 'c-set-style 'safe-local-eval-function t)
2379 2377
@@ -3931,7 +3929,7 @@ user. In such situations, one has to be careful with potentially
3931time consuming operations. 3929time consuming operations.
3932 3930
3933For more information on how this variable is used by Auto Revert mode, 3931For more information on how this variable is used by Auto Revert mode,
3934see Info node `(emacs-xtra)Supporting additional buffers'.") 3932see Info node `(emacs)Supporting additional buffers'.")
3935 3933
3936(defvar before-revert-hook nil 3934(defvar before-revert-hook nil
3937 "Normal hook for `revert-buffer' to run before reverting. 3935 "Normal hook for `revert-buffer' to run before reverting.
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 83f7b542139..b16a0cc1096 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -1975,17 +1975,17 @@ This function could be MATCHER in a MATCH-ANCHORED `font-lock-keywords' item."
1975;; 1975;;
1976;; (regexp-opt 1976;; (regexp-opt
1977;; '("define" "elif" "else" "endif" "error" "file" "if" "ifdef" 1977;; '("define" "elif" "else" "endif" "error" "file" "if" "ifdef"
1978;; "ifndef" "include" "line" "pragma" "undef")) 1978;; "ifndef" "import" "include" "line" "pragma" "undef" "warning"))
1979;; 1979;;
1980(defconst cpp-font-lock-keywords-source-directives 1980(defconst cpp-font-lock-keywords-source-directives
1981 "define\\|e\\(?:l\\(?:if\\|se\\)\\|ndif\\|rror\\)\\|file\\|i\\(?:f\\(?:n?def\\)?\\|nclude\\)\\|line\\|pragma\\|undef" 1981 "define\\|e\\(?:l\\(?:if\\|se\\)\\|ndif\\|rror\\)\\|file\\|i\\(?:f\\(?:n?def\\)?\\|mport\\|nclude\\)\\|line\\|pragma\\|undef\\|warning"
1982 "Regular expressoin used in `cpp-font-lock-keywords'.") 1982 "Regular expressoin used in `cpp-font-lock-keywords'.")
1983 1983
1984;; `cpp-font-lock-keywords-source-depth' is calculated from: 1984;; `cpp-font-lock-keywords-source-depth' is calculated from:
1985;; 1985;;
1986;; (regexp-opt-depth (regexp-opt 1986;; (regexp-opt-depth (regexp-opt
1987;; '("define" "elif" "else" "endif" "error" "file" "if" "ifdef" 1987;; '("define" "elif" "else" "endif" "error" "file" "if" "ifdef"
1988;; "ifndef" "include" "line" "pragma" "undef"))) 1988;; "ifndef" "import" "include" "line" "pragma" "undef" "warning")))
1989;; 1989;;
1990(defconst cpp-font-lock-keywords-source-depth 0 1990(defconst cpp-font-lock-keywords-source-depth 0
1991 "An integer representing regular expression depth of `cpp-font-lock-keywords-source-directives'. 1991 "An integer representing regular expression depth of `cpp-font-lock-keywords-source-directives'.
@@ -1997,7 +1997,7 @@ Used in `cpp-font-lock-keywords'.")
1997 (list 1997 (list
1998 ;; 1998 ;;
1999 ;; Fontify error directives. 1999 ;; Fontify error directives.
2000 '("^#[ \t]*error[ \t]+\\(.+\\)" 1 font-lock-warning-face prepend) 2000 '("^#[ \t]*\\(?:error\\|warning\\)[ \t]+\\(.+\\)" 1 font-lock-warning-face prepend)
2001 ;; 2001 ;;
2002 ;; Fontify filenames in #include <...> preprocessor directives as strings. 2002 ;; Fontify filenames in #include <...> preprocessor directives as strings.
2003 '("^#[ \t]*\\(?:import\\|include\\)[ \t]*\\(<[^>\"\n]*>?\\)" 2003 '("^#[ \t]*\\(?:import\\|include\\)[ \t]*\\(<[^>\"\n]*>?\\)"
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index cecc180f522..7f0f248c7cf 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,24 @@
12006-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * mm-decode.el (mm-dissect-buffer): Remove spurious double assignment.
4 (mm-copy-to-buffer): Use with-current-buffer.
5 (mm-display-part): Simplify.
6 (mm-inlinable-p): Add optional arg `type'.
7
8 * gnus-art.el (gnus-mime-view-part-as-type): Add optional PRED
9 argument.
10 (gnus-mime-view-part-externally, gnus-mime-view-part-internally):
11 Try harder to show the attachment internally or externally using
12 gnus-mime-view-part-as-type.
13
142006-05-04 Reiner Steib <Reiner.Steib@gmx.de>
15
16 * gnus-art.el (gnus-mime-view-part-as-type-internal): Try to fetch
17 `filename' from Content-Disposition if Content-Type doesn't
18 provide `name'.
19 (gnus-mime-view-part-as-type): Set default instead of
20 initial-input.
21
12006-04-28 Katsumi Yamaoka <yamaoka@jpl.org> 222006-04-28 Katsumi Yamaoka <yamaoka@jpl.org>
2 23
3 * mm-uu.el (mm-uu-pgp-encrypted-extract-1): Assume buffer is made 24 * mm-uu.el (mm-uu-pgp-encrypted-extract-1): Assume buffer is made
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 7e3b843d500..208103f805d 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -4317,21 +4317,29 @@ Deleting parts may malfunction or destroy the article; continue? ")
4317 4317
4318(defun gnus-mime-view-part-as-type-internal () 4318(defun gnus-mime-view-part-as-type-internal ()
4319 (gnus-article-check-buffer) 4319 (gnus-article-check-buffer)
4320 (let* ((name (mail-content-type-get 4320 (let* ((handle (get-text-property (point) 'gnus-data))
4321 (mm-handle-type (get-text-property (point) 'gnus-data)) 4321 (name (or
4322 'name)) 4322 ;; Content-Type: foo/bar; name=...
4323 (mail-content-type-get (mm-handle-type handle) 'name)
4324 ;; Content-Disposition: attachment; filename=...
4325 (cdr (assq 'filename (cdr (mm-handle-disposition handle))))))
4323 (def-type (and name (mm-default-file-encoding name)))) 4326 (def-type (and name (mm-default-file-encoding name))))
4324 (and def-type (cons def-type 0)))) 4327 (and def-type (cons def-type 0))))
4325 4328
4326(defun gnus-mime-view-part-as-type (&optional mime-type) 4329(defun gnus-mime-view-part-as-type (&optional mime-type pred)
4327 "Choose a MIME media type, and view the part as such." 4330 "Choose a MIME media type, and view the part as such.
4331If non-nil, PRED is a predicate to use during completion to limit the
4332available media-types."
4328 (interactive) 4333 (interactive)
4329 (unless mime-type 4334 (unless mime-type
4330 (setq mime-type (completing-read 4335 (setq mime-type
4331 "View as MIME type: " 4336 (let ((default (gnus-mime-view-part-as-type-internal)))
4332 (mapcar #'list (mailcap-mime-types)) 4337 (completing-read
4333 nil nil 4338 (format "View as MIME type (default %s): "
4334 (gnus-mime-view-part-as-type-internal)))) 4339 (car default))
4340 (mapcar #'list (mailcap-mime-types))
4341 pred nil nil nil
4342 (car default)))))
4335 (gnus-article-check-buffer) 4343 (gnus-article-check-buffer)
4336 (let ((handle (get-text-property (point) 'gnus-data))) 4344 (let ((handle (get-text-property (point) 'gnus-data)))
4337 (when handle 4345 (when handle
@@ -4511,12 +4519,18 @@ specified charset."
4511 (mm-inlined-types nil) 4519 (mm-inlined-types nil)
4512 (mail-parse-charset gnus-newsgroup-charset) 4520 (mail-parse-charset gnus-newsgroup-charset)
4513 (mail-parse-ignored-charsets 4521 (mail-parse-ignored-charsets
4514 (save-excursion (set-buffer gnus-summary-buffer) 4522 (with-current-buffer gnus-summary-buffer
4515 gnus-newsgroup-ignored-charsets))) 4523 gnus-newsgroup-ignored-charsets))
4516 (when handle 4524 (type (mm-handle-media-type handle))
4517 (if (mm-handle-undisplayer handle) 4525 (method (mailcap-mime-info type))
4518 (mm-remove-part handle) 4526 (mm-enable-external t))
4519 (mm-display-part handle))))) 4527 (if (not (stringp method))
4528 (gnus-mime-view-part-as-type
4529 nil (lambda (type) (stringp (mailcap-mime-info type))))
4530 (when handle
4531 (if (mm-handle-undisplayer handle)
4532 (mm-remove-part handle)
4533 (mm-display-part handle))))))
4520 4534
4521(defun gnus-mime-view-part-internally (&optional handle) 4535(defun gnus-mime-view-part-internally (&optional handle)
4522 "View the MIME part under point with an internal viewer. 4536 "View the MIME part under point with an internal viewer.
@@ -4528,13 +4542,16 @@ If no internal viewer is available, use an external viewer."
4528 (mm-inline-large-images t) 4542 (mm-inline-large-images t)
4529 (mail-parse-charset gnus-newsgroup-charset) 4543 (mail-parse-charset gnus-newsgroup-charset)
4530 (mail-parse-ignored-charsets 4544 (mail-parse-ignored-charsets
4531 (save-excursion (set-buffer gnus-summary-buffer) 4545 (with-current-buffer gnus-summary-buffer
4532 gnus-newsgroup-ignored-charsets)) 4546 gnus-newsgroup-ignored-charsets))
4533 (inhibit-read-only t)) 4547 (inhibit-read-only t))
4534 (when handle 4548 (if (not (mm-inlinable-p handle))
4535 (if (mm-handle-undisplayer handle) 4549 (gnus-mime-view-part-as-type
4536 (mm-remove-part handle) 4550 nil (lambda (type) (mm-inlinable-p handle type)))
4537 (mm-display-part handle))))) 4551 (when handle
4552 (if (mm-handle-undisplayer handle)
4553 (mm-remove-part handle)
4554 (mm-display-part handle))))))
4538 4555
4539(defun gnus-mime-action-on-part (&optional action) 4556(defun gnus-mime-action-on-part (&optional action)
4540 "Do something with the MIME attachment at \(point\)." 4557 "Do something with the MIME attachment at \(point\)."
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index b79e081f0e1..c5fd5d3c258 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -562,7 +562,7 @@ Postpone undisplaying of viewers for types in
562 description) 562 description)
563 (setq type (split-string (car ctl) "/")) 563 (setq type (split-string (car ctl) "/"))
564 (setq subtype (cadr type) 564 (setq subtype (cadr type)
565 type (pop type)) 565 type (car type))
566 (setq 566 (setq
567 result 567 result
568 (cond 568 (cond
@@ -641,16 +641,15 @@ Postpone undisplaying of viewers for types in
641 641
642(defun mm-copy-to-buffer () 642(defun mm-copy-to-buffer ()
643 "Copy the contents of the current buffer to a fresh buffer." 643 "Copy the contents of the current buffer to a fresh buffer."
644 (save-excursion
645 (let ((obuf (current-buffer)) 644 (let ((obuf (current-buffer))
646 beg) 645 beg)
647 (goto-char (point-min)) 646 (goto-char (point-min))
648 (search-forward-regexp "^\n" nil t) 647 (search-forward-regexp "^\n" nil t)
649 (setq beg (point)) 648 (setq beg (point))
650 (set-buffer 649 (with-current-buffer
651 ;; Preserve the data's unibyteness (for url-insert-file-contents). 650 ;; Preserve the data's unibyteness (for url-insert-file-contents).
652 (let ((default-enable-multibyte-characters (mm-multibyte-p))) 651 (let ((default-enable-multibyte-characters (mm-multibyte-p)))
653 (generate-new-buffer " *mm*"))) 652 (generate-new-buffer " *mm*"))
654 (insert-buffer-substring obuf beg) 653 (insert-buffer-substring obuf beg)
655 (current-buffer)))) 654 (current-buffer))))
656 655
@@ -701,7 +700,8 @@ external if displayed external."
701 (forward-line 1) 700 (forward-line 1)
702 (mm-insert-inline handle (mm-get-part handle)) 701 (mm-insert-inline handle (mm-get-part handle))
703 'inline) 702 'inline)
704 (if (and method ;; If nil, we always use "save". 703 (setq external
704 (and method ;; If nil, we always use "save".
705 (stringp method) ;; 'mailcap-save-binary-file 705 (stringp method) ;; 'mailcap-save-binary-file
706 (or (eq mm-enable-external t) 706 (or (eq mm-enable-external t)
707 (and (eq mm-enable-external 'ask) 707 (and (eq mm-enable-external 'ask)
@@ -714,9 +714,7 @@ external if displayed external."
714 (concat 714 (concat
715 " \"" (format method filename) "\"") 715 " \"" (format method filename) "\"")
716 "") 716 "")
717 "? "))))) 717 "? "))))))
718 (setq external t)
719 (setq external nil))
720 (if external 718 (if external
721 (mm-display-external 719 (mm-display-external
722 handle (or method 'mailcap-save-binary-file)) 720 handle (or method 'mailcap-save-binary-file))
@@ -1019,10 +1017,12 @@ external if displayed external."
1019 methods nil))) 1017 methods nil)))
1020 result)) 1018 result))
1021 1019
1022(defun mm-inlinable-p (handle) 1020(defun mm-inlinable-p (handle &optional type)
1023 "Say whether HANDLE can be displayed inline." 1021 "Say whether HANDLE can be displayed inline.
1022TYPE is the mime-type of the object; it defaults to the one given
1023in HANDLE."
1024 (unless type (setq type (mm-handle-media-type handle)))
1024 (let ((alist mm-inline-media-tests) 1025 (let ((alist mm-inline-media-tests)
1025 (type (mm-handle-media-type handle))
1026 test) 1026 test)
1027 (while alist 1027 (while alist
1028 (when (string-match (caar alist) type) 1028 (when (string-match (caar alist) type)
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index 0a84f9b0c82..6264d2e56b5 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -325,9 +325,7 @@ directory, like `default-directory'."
325 :group 'ibuffer) 325 :group 'ibuffer)
326 326
327(defcustom ibuffer-compressed-file-name-regexp 327(defcustom ibuffer-compressed-file-name-regexp
328 (concat "\\.\\(" 328 "\\.\\(arj\\|bgz\\|bz2\\|gz\\|lzh\\|taz\\|tgz\\|zip\\|z\\)$"
329 (regexp-opt '("arj" "bgz" "bz2" "gz" "lzh" "taz" "tgz" "zip" "z"))
330 "\\)$")
331 "Regexp to match compressed file names." 329 "Regexp to match compressed file names."
332 :type 'regexp 330 :type 'regexp
333 :group 'ibuffer) 331 :group 'ibuffer)
diff --git a/lisp/isearch.el b/lisp/isearch.el
index c372880a5e6..356f6e9fbb1 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -826,21 +826,11 @@ NOPUSH is t and EDIT is t."
826 826
827(defun isearch-update-ring (string &optional regexp) 827(defun isearch-update-ring (string &optional regexp)
828 "Add STRING to the beginning of the search ring. 828 "Add STRING to the beginning of the search ring.
829REGEXP says which ring to use." 829REGEXP if non-nil says use the regexp search ring."
830 (if regexp 830 (add-to-history
831 (if (or (null regexp-search-ring) 831 (if regexp 'regexp-search-ring 'search-ring)
832 (not (string= string (car regexp-search-ring)))) 832 string
833 (progn 833 (if regexp regexp-search-ring-max search-ring-max)))
834 (push string regexp-search-ring)
835 (if (> (length regexp-search-ring) regexp-search-ring-max)
836 (setcdr (nthcdr (1- search-ring-max) regexp-search-ring)
837 nil))))
838 (if (or (null search-ring)
839 (not (string= string (car search-ring))))
840 (progn
841 (push string search-ring)
842 (if (> (length search-ring) search-ring-max)
843 (setcdr (nthcdr (1- search-ring-max) search-ring) nil))))))
844 834
845;; Switching buffers should first terminate isearch-mode. 835;; Switching buffers should first terminate isearch-mode.
846;; ;; For Emacs 19, the frame switch event is handled. 836;; ;; For Emacs 19, the frame switch event is handled.
diff --git a/lisp/kmacro.el b/lisp/kmacro.el
index 4566d4c32c3..d3db76fcc8a 100644
--- a/lisp/kmacro.el
+++ b/lisp/kmacro.el
@@ -349,10 +349,8 @@ and `kmacro-counter-format'.")
349(defun kmacro-push-ring (&optional elt) 349(defun kmacro-push-ring (&optional elt)
350 "Push ELT or current macro onto `kmacro-ring'." 350 "Push ELT or current macro onto `kmacro-ring'."
351 (when (setq elt (or elt (kmacro-ring-head))) 351 (when (setq elt (or elt (kmacro-ring-head)))
352 (let ((len (length kmacro-ring))) 352 (let ((history-delete-duplicates nil))
353 (setq kmacro-ring (cons elt kmacro-ring)) 353 (add-to-history 'kmacro-ring elt kmacro-ring-max))))
354 (if (>= len kmacro-ring-max)
355 (setcdr (nthcdr len kmacro-ring) nil)))))
356 354
357 355
358(defun kmacro-split-ring-element (elt) 356(defun kmacro-split-ring-element (elt)
@@ -377,11 +375,6 @@ Non-nil arg RAW means just return raw first element."
377 (kmacro-pop-ring1 raw))) 375 (kmacro-pop-ring1 raw)))
378 376
379 377
380(defun kmacro-ring-length ()
381 "Return length of macro ring, including pseudo head."
382 (+ (if last-kbd-macro 1 0) (length kmacro-ring)))
383
384
385(defun kmacro-ring-empty-p (&optional none) 378(defun kmacro-ring-empty-p (&optional none)
386 "Tell user and return t if `last-kbd-macro' is nil or `kmacro-ring' is empty. 379 "Tell user and return t if `last-kbd-macro' is nil or `kmacro-ring' is empty.
387Check only `last-kbd-macro' if optional arg NONE is non-nil." 380Check only `last-kbd-macro' if optional arg NONE is non-nil."
@@ -577,13 +570,8 @@ Use \\[kmacro-bind-to-key] to bind it to a key sequence."
577 (let ((append (and arg (listp arg)))) 570 (let ((append (and arg (listp arg))))
578 (unless append 571 (unless append
579 (if last-kbd-macro 572 (if last-kbd-macro
580 (let ((len (length kmacro-ring))) 573 (kmacro-push-ring
581 (setq kmacro-ring 574 (list last-kbd-macro kmacro-counter kmacro-counter-format-start)))
582 (cons
583 (list last-kbd-macro kmacro-counter kmacro-counter-format-start)
584 kmacro-ring))
585 (if (>= len kmacro-ring-max)
586 (setcdr (nthcdr len kmacro-ring) nil))))
587 (setq kmacro-counter (or (if arg (prefix-numeric-value arg)) 575 (setq kmacro-counter (or (if arg (prefix-numeric-value arg))
588 kmacro-initial-counter-value 576 kmacro-initial-counter-value
589 0) 577 0)
diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el
index 6e2bc5c8eb5..da95c93bb08 100644
--- a/lisp/ldefs-boot.el
+++ b/lisp/ldefs-boot.el
@@ -6978,7 +6978,7 @@ or delete subdirectories can bypass this machinery. Hence, you sometimes
6978may have to reset some subdirectory switches after a `dired-undo'. 6978may have to reset some subdirectory switches after a `dired-undo'.
6979You can reset all subdirectory switches to the default using 6979You can reset all subdirectory switches to the default using
6980\\<dired-mode-map>\\[dired-reset-subdir-switches]. 6980\\<dired-mode-map>\\[dired-reset-subdir-switches].
6981See Info node `(emacs-xtra)Subdir switches' for more details. 6981See Info node `(emacs)Subdir switches' for more details.
6982 6982
6983\(fn &optional ARG TEST-FOR-SUBDIR)" t nil) 6983\(fn &optional ARG TEST-FOR-SUBDIR)" t nil)
6984 6984
@@ -7116,7 +7116,7 @@ or delete subdirectories can bypass this machinery. Hence, you sometimes
7116may have to reset some subdirectory switches after a `dired-undo'. 7116may have to reset some subdirectory switches after a `dired-undo'.
7117You can reset all subdirectory switches to the default using 7117You can reset all subdirectory switches to the default using
7118\\<dired-mode-map>\\[dired-reset-subdir-switches]. 7118\\<dired-mode-map>\\[dired-reset-subdir-switches].
7119See Info node `(emacs-xtra)Subdir switches' for more details. 7119See Info node `(emacs)Subdir switches' for more details.
7120 7120
7121\(fn DIRNAME &optional SWITCHES NO-ERROR-IF-NOT-DIR-P)" t nil) 7121\(fn DIRNAME &optional SWITCHES NO-ERROR-IF-NOT-DIR-P)" t nil)
7122 7122
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index f7846394638..94632f8c38d 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,3 +1,13 @@
12006-05-06 Bill Wohler <wohler@newt.com>
2
3 Release MH-E version 8.0.
4
5 * mh-e.el (Version, mh-version): Update for release 8.0.
6
72006-05-05 Bill Wohler <wohler@newt.com>
8
9 * mh-e.el: Update commentary.
10
12006-04-28 Bill Wohler <wohler@newt.com> 112006-04-28 Bill Wohler <wohler@newt.com>
2 12
3 Release MH-E version 7.95. 13 Release MH-E version 7.95.
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el
index 88b8c5bac09..28fff81e93b 100644
--- a/lisp/mh-e/mh-e.el
+++ b/lisp/mh-e/mh-e.el
@@ -6,7 +6,7 @@
6 6
7;; Author: Bill Wohler <wohler@newt.com> 7;; Author: Bill Wohler <wohler@newt.com>
8;; Maintainer: Bill Wohler <wohler@newt.com> 8;; Maintainer: Bill Wohler <wohler@newt.com>
9;; Version: 7.95 9;; Version: 8.0
10;; Keywords: mail 10;; Keywords: mail
11 11
12;; This file is part of GNU Emacs. 12;; This file is part of GNU Emacs.
@@ -28,6 +28,20 @@
28 28
29;;; Commentary: 29;;; Commentary:
30 30
31;; MH-E is an Emacs interface to the MH mail system.
32
33;; MH-E is supported by GNU Emacs 21 and 22, as well as XEmacs 21
34;; (except for versions 21.5.9-21.5.16). It is compatible with MH
35;; versions 6.8.4 and higher, all versions of nmh, and GNU mailutils
36;; 0.4 and higher.
37
38;; MH (Message Handler) is a powerful mail reader. See
39;; http://rand-mh.sourceforge.net/.
40
41;; N.B. MH must have been compiled with the MHE compiler flag or several
42;; features necessary for MH-E will be missing from MH commands, specifically
43;; the -build switch to repl and forw.
44
31;; How to use: 45;; How to use:
32;; M-x mh-rmail to read mail. Type C-h m there for a list of commands. 46;; M-x mh-rmail to read mail. Type C-h m there for a list of commands.
33;; C-u M-x mh-rmail to visit any folder. 47;; C-u M-x mh-rmail to visit any folder.
@@ -44,23 +58,6 @@
44;; If you want to customize MH-E before explicitly loading it, add this: 58;; If you want to customize MH-E before explicitly loading it, add this:
45;; (require 'mh-cus-load) 59;; (require 'mh-cus-load)
46 60
47;; MH (Message Handler) is a powerful mail reader.
48
49;; The MH newsgroup is comp.mail.mh; the mailing list is mh-users@ics.uci.edu
50;; (send to mh-users-request to be added). See the monthly Frequently Asked
51;; Questions posting there for information on getting MH and MH-E:
52;; http://www.faqs.org/faqs/mail/mh-faq/part1/preamble.html
53
54;; N.B. MH must have been compiled with the MHE compiler flag or several
55;; features necessary for MH-E will be missing from MH commands, specifically
56;; the -build switch to repl and forw.
57
58;; MH-E is an Emacs interface to the MH mail system.
59
60;; MH-E is supported in GNU Emacs 21 and 22 as well as XEmacs 21
61;; (except for versions 21.5.9-21.5.16), with MH 6.8.4 on, nmh 1.0.4
62;; on, and GNU mailutils 0.4 on.
63
64;; Mailing Lists: 61;; Mailing Lists:
65;; mh-e-users@lists.sourceforge.net 62;; mh-e-users@lists.sourceforge.net
66;; mh-e-announce@lists.sourceforge.net 63;; mh-e-announce@lists.sourceforge.net
@@ -136,7 +133,7 @@
136;; Try to keep variables local to a single file. Provide accessors if 133;; Try to keep variables local to a single file. Provide accessors if
137;; variables are shared. Use this section as a last resort. 134;; variables are shared. Use this section as a last resort.
138 135
139(defconst mh-version "7.95" "Version number of MH-E.") 136(defconst mh-version "8.0" "Version number of MH-E.")
140 137
141;; Variants 138;; Variants
142 139
diff --git a/lisp/msb.el b/lisp/msb.el
index 95cbfc85df4..61ddce5dae0 100644
--- a/lisp/msb.el
+++ b/lisp/msb.el
@@ -473,6 +473,11 @@ selects that window.
473See the function `mouse-select-buffer' and the variable 473See the function `mouse-select-buffer' and the variable
474`msb-menu-cond' for more information about how the menus are split." 474`msb-menu-cond' for more information about how the menus are split."
475 (interactive "e") 475 (interactive "e")
476 ;; If EVENT is a down-event, read and discard the
477 ;; corresponding up-event.
478 (and (eventp event)
479 (memq 'down (event-modifiers event))
480 (read-event))
476 (let ((old-window (selected-window)) 481 (let ((old-window (selected-window))
477 (window (posn-window (event-start event)))) 482 (window (posn-window (event-start event))))
478 (unless (framep window) (select-window window)) 483 (unless (framep window) (select-window window))
diff --git a/lisp/mwheel.el b/lisp/mwheel.el
index 662b992b343..b61971c7ea5 100644
--- a/lisp/mwheel.el
+++ b/lisp/mwheel.el
@@ -204,8 +204,25 @@ This should only be bound to mouse buttons 4 and 5."
204 (setq amt (* amt (event-click-count event)))) 204 (setq amt (* amt (event-click-count event))))
205 (unwind-protect 205 (unwind-protect
206 (let ((button (mwheel-event-button event))) 206 (let ((button (mwheel-event-button event)))
207 (cond ((eq button mouse-wheel-down-event) (scroll-down amt)) 207 (cond ((eq button mouse-wheel-down-event)
208 ((eq button mouse-wheel-up-event) (scroll-up amt)) 208 (condition-case nil (scroll-down amt)
209 ;; Make sure we do indeed scroll to the beginning of
210 ;; the buffer.
211 (beginning-of-buffer
212 (unwind-protect
213 (scroll-down)
214 ;; If the first scroll succeeded, then some scrolling
215 ;; is possible: keep scrolling til the beginning but
216 ;; do not signal an error. For some reason, we have
217 ;; to do it even if the first scroll signalled an
218 ;; error, because otherwise the window is recentered
219 ;; for a reason that escapes me. This problem seems
220 ;; to only affect scroll-down. --Stef
221 (set-window-start (selected-window) (point-min))))))
222 ((eq button mouse-wheel-up-event)
223 (condition-case nil (scroll-up amt)
224 ;; Make sure we do indeed scroll to the end of the buffer.
225 (end-of-buffer (while t (scroll-up)))))
209 (t (error "Bad binding in mwheel-scroll")))) 226 (t (error "Bad binding in mwheel-scroll"))))
210 (if curwin (select-window curwin)))) 227 (if curwin (select-window curwin))))
211 (when (and mouse-wheel-click-event mouse-wheel-inhibit-click-time) 228 (when (and mouse-wheel-click-event mouse-wheel-inhibit-click-time)
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 6e166aa2393..2ebc4d0b45e 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -4331,7 +4331,7 @@ Falls back to normal file name handler if no tramp file name handler exists."
4331 "Add tramp file name handlers to `file-name-handler-alist'." 4331 "Add tramp file name handlers to `file-name-handler-alist'."
4332 (add-to-list 'file-name-handler-alist 4332 (add-to-list 'file-name-handler-alist
4333 (cons tramp-file-name-regexp 'tramp-file-name-handler)) 4333 (cons tramp-file-name-regexp 'tramp-file-name-handler))
4334 (when partial-completion-mode 4334 (when (or partial-completion-mode (featurep 'ido))
4335 (add-to-list 'file-name-handler-alist 4335 (add-to-list 'file-name-handler-alist
4336 (cons tramp-completion-file-name-regexp 4336 (cons tramp-completion-file-name-regexp
4337 'tramp-completion-file-name-handler)) 4337 'tramp-completion-file-name-handler))
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index a5163319fbf..a20f11e0aa2 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -114,8 +114,6 @@ Set to \"main\" at start if gdb-show-main is t.")
114Each element has the form (VARNUM EXPRESSION NUMCHILD TYPE VALUE STATUS FP) 114Each element has the form (VARNUM EXPRESSION NUMCHILD TYPE VALUE STATUS FP)
115where STATUS is nil (unchanged), `changed' or `out-of-scope', FP the frame 115where STATUS is nil (unchanged), `changed' or `out-of-scope', FP the frame
116address for root variables.") 116address for root variables.")
117(defvar gdb-force-update t
118 "Non-nil means that view of watch expressions will be updated in the speedbar.")
119(defvar gdb-main-file nil "Source file from which program execution begins.") 117(defvar gdb-main-file nil "Source file from which program execution begins.")
120(defvar gdb-overlay-arrow-position nil) 118(defvar gdb-overlay-arrow-position nil)
121(defvar gdb-server-prefix nil) 119(defvar gdb-server-prefix nil)
@@ -527,7 +525,6 @@ With arg, use separate IO iff arg is positive."
527 gdb-current-language nil 525 gdb-current-language nil
528 gdb-frame-number nil 526 gdb-frame-number nil
529 gdb-var-list nil 527 gdb-var-list nil
530 gdb-force-update t
531 gdb-main-file nil 528 gdb-main-file nil
532 gdb-first-post-prompt t 529 gdb-first-post-prompt t
533 gdb-prompting nil 530 gdb-prompting nil
@@ -690,10 +687,14 @@ With arg, enter name of variable to be watched in the minibuffer."
690 (if event (posn-set-point (event-end event))) 687 (if event (posn-set-point (event-end event)))
691 (require 'tooltip) 688 (require 'tooltip)
692 (save-selected-window 689 (save-selected-window
693 (let ((expr (if arg 690 (let ((expr
694 (completing-read "Name of variable: " 691 (if arg
695 'gud-gdb-complete-command) 692 (completing-read "Name of variable: "
696 (tooltip-identifier-from-point (point))))) 693 'gud-gdb-complete-command)
694 (if (and transient-mark-mode mark-active)
695 (buffer-substring (region-beginning) (region-end))
696 (tooltip-identifier-from-point (point))))))
697 (speedbar 1)
697 (catch 'already-watched 698 (catch 'already-watched
698 (dolist (var gdb-var-list) 699 (dolist (var gdb-var-list)
699 (unless (string-match "\\." (car var)) 700 (unless (string-match "\\." (car var))
@@ -725,7 +726,6 @@ With arg, enter name of variable to be watched in the minibuffer."
725 (match-string 3) 726 (match-string 3)
726 nil nil gdb-frame-address))) 727 nil nil gdb-frame-address)))
727 (push var gdb-var-list) 728 (push var gdb-var-list)
728 (speedbar 1)
729 (unless (string-equal 729 (unless (string-equal
730 speedbar-initial-expansion-list-name "GUD") 730 speedbar-initial-expansion-list-name "GUD")
731 (speedbar-change-initial-expansion-list "GUD")) 731 (speedbar-change-initial-expansion-list "GUD"))
@@ -741,13 +741,26 @@ With arg, enter name of variable to be watched in the minibuffer."
741 (message-box "Watching expressions requires gdb 6.0 onwards") 741 (message-box "Watching expressions requires gdb 6.0 onwards")
742 (message-box "No symbol \"%s\" in current context." expr)))) 742 (message-box "No symbol \"%s\" in current context." expr))))
743 743
744(defun gdb-speedbar-update ()
745 (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
746 ;; Dummy command to update speedbar even when idle.
747 (gdb-enqueue-input (list "server pwd\n" 'gdb-speedbar-timer-fn))
748 ;; Keep gdb-pending-triggers non-nil till end.
749 (push 'gdb-speedbar-timer gdb-pending-triggers)))
750
751(defun gdb-speedbar-timer-fn ()
752 (setq gdb-pending-triggers
753 (delq 'gdb-speedbar-timer gdb-pending-triggers))
754 (speedbar-timer-fn))
755
744(defun gdb-var-evaluate-expression-handler (varnum changed) 756(defun gdb-var-evaluate-expression-handler (varnum changed)
745 (goto-char (point-min)) 757 (goto-char (point-min))
746 (re-search-forward ".*value=\\(\".*\"\\)" nil t) 758 (re-search-forward ".*value=\\(\".*\"\\)" nil t)
747 (let ((var (assoc varnum gdb-var-list))) 759 (let ((var (assoc varnum gdb-var-list)))
748 (when var 760 (when var
749 (if changed (setcar (nthcdr 5 var) 'changed)) 761 (if changed (setcar (nthcdr 5 var) 'changed))
750 (setcar (nthcdr 4 var) (read (match-string 1)))))) 762 (setcar (nthcdr 4 var) (read (match-string 1)))))
763 (gdb-speedbar-update))
751 764
752(defun gdb-var-list-children (varnum) 765(defun gdb-var-list-children (varnum)
753 (gdb-enqueue-input 766 (gdb-enqueue-input
@@ -811,21 +824,7 @@ type_changed=\".*?\".*?}")
811 varnum "\"\n") 824 varnum "\"\n")
812 `(lambda () (gdb-var-evaluate-expression-handler ,varnum t))))))) 825 `(lambda () (gdb-var-evaluate-expression-handler ,varnum t)))))))
813 (setq gdb-pending-triggers 826 (setq gdb-pending-triggers
814 (delq 'gdb-var-update gdb-pending-triggers)) 827 (delq 'gdb-var-update gdb-pending-triggers)))
815 (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
816 ;; Dummy command to update speedbar at right time.
817 (gdb-enqueue-input (list "server pwd\n" 'gdb-speedbar-refresh))
818 ;; Keep gdb-pending-triggers non-nil till end.
819 (push 'gdb-speedbar-refresh gdb-pending-triggers)))
820
821(defun gdb-speedbar-refresh ()
822 (setq gdb-pending-triggers
823 (delq 'gdb-speedbar-refresh gdb-pending-triggers))
824 (with-current-buffer gud-comint-buffer
825 (let ((speedbar-verbosity-level 0)
826 (speedbar-shown-directories nil))
827 (save-excursion
828 (speedbar-refresh)))))
829 828
830(defun gdb-var-delete () 829(defun gdb-var-delete ()
831 "Delete watch expression at point from the speedbar." 830 "Delete watch expression at point from the speedbar."
@@ -1378,7 +1377,6 @@ happens to be appropriate."
1378 ;; FIXME: with GDB-6 on Darwin, this might very well work. 1377 ;; FIXME: with GDB-6 on Darwin, this might very well work.
1379 ;; Only needed/used with speedbar/watch expressions. 1378 ;; Only needed/used with speedbar/watch expressions.
1380 (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) 1379 (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
1381 (setq gdb-force-update t)
1382 (if (string-equal gdb-version "pre-6.4") 1380 (if (string-equal gdb-version "pre-6.4")
1383 (gdb-var-update) 1381 (gdb-var-update)
1384 (gdb-var-update-1))))) 1382 (gdb-var-update-1)))))
@@ -1913,7 +1911,7 @@ static char *magick[] = {
1913 (let* ((buffer (find-file-noselect 1911 (let* ((buffer (find-file-noselect
1914 (if (file-exists-p file) file 1912 (if (file-exists-p file) file
1915 (cdr (assoc bptno gdb-location-alist))))) 1913 (cdr (assoc bptno gdb-location-alist)))))
1916 (window (unless (gdb-display-source-buffer buffer) 1914 (window (or (gdb-display-source-buffer buffer)
1917 (display-buffer buffer)))) 1915 (display-buffer buffer))))
1918 (setq gdb-source-window window) 1916 (setq gdb-source-window window)
1919 (with-current-buffer buffer 1917 (with-current-buffer buffer
@@ -2691,7 +2689,7 @@ corresponding to the mode line clicked."
2691 '(menu-item "Inferior IO" gdb-frame-separate-io-buffer 2689 '(menu-item "Inferior IO" gdb-frame-separate-io-buffer
2692 :enable gdb-use-separate-io-buffer)) 2690 :enable gdb-use-separate-io-buffer))
2693 (define-key menu [registers] '("Registers" . gdb-frame-registers-buffer)) 2691 (define-key menu [registers] '("Registers" . gdb-frame-registers-buffer))
2694 (define-key menu [disassembly] '("Disassembiy" . gdb-frame-assembler-buffer)) 2692 (define-key menu [disassembly] '("Disassembly" . gdb-frame-assembler-buffer))
2695 (define-key menu [breakpoints] 2693 (define-key menu [breakpoints]
2696 '("Breakpoints" . gdb-frame-breakpoints-buffer)) 2694 '("Breakpoints" . gdb-frame-breakpoints-buffer))
2697 (define-key menu [locals] '("Locals" . gdb-frame-locals-buffer)) 2695 (define-key menu [locals] '("Locals" . gdb-frame-locals-buffer))
@@ -2755,6 +2753,7 @@ corresponding to the mode line clicked."
2755 ;; Put buffer list in window if we 2753 ;; Put buffer list in window if we
2756 ;; can't find a source file. 2754 ;; can't find a source file.
2757 (list-buffers-noselect)))) 2755 (list-buffers-noselect))))
2756 (setq gdb-source-window (selected-window))
2758 (when gdb-use-separate-io-buffer 2757 (when gdb-use-separate-io-buffer
2759 (split-window-horizontally) 2758 (split-window-horizontally)
2760 (other-window 1) 2759 (other-window 1)
@@ -2782,6 +2781,7 @@ This arrangement depends on the value of `gdb-many-windows'."
2782 (if gud-last-last-frame 2781 (if gud-last-last-frame
2783 (gud-find-file (car gud-last-last-frame)) 2782 (gud-find-file (car gud-last-last-frame))
2784 (gud-find-file gdb-main-file))) 2783 (gud-find-file gdb-main-file)))
2784 (setq gdb-source-window (selected-window))
2785 (other-window 1)))) 2785 (other-window 1))))
2786 2786
2787(defun gdb-reset () 2787(defun gdb-reset ()
@@ -2803,8 +2803,6 @@ Kills the gdb buffers, and resets variables and the source buffers."
2803 (setq overlay-arrow-variable-list 2803 (setq overlay-arrow-variable-list
2804 (delq 'gdb-overlay-arrow-position overlay-arrow-variable-list)) 2804 (delq 'gdb-overlay-arrow-position overlay-arrow-variable-list))
2805 (setq fringe-indicator-alist '((overlay-arrow . right-triangle))) 2805 (setq fringe-indicator-alist '((overlay-arrow . right-triangle)))
2806 (if (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
2807 (speedbar-refresh))
2808 (setq gud-running nil) 2806 (setq gud-running nil)
2809 (setq gdb-active-process nil) 2807 (setq gdb-active-process nil)
2810 (setq gdb-var-list nil) 2808 (setq gdb-var-list nil)
@@ -3163,7 +3161,9 @@ BUFFER nil or omitted means use the current buffer."
3163 (if (and (match-string 3) gud-overlay-arrow-position) 3161 (if (and (match-string 3) gud-overlay-arrow-position)
3164 (let ((buffer (marker-buffer gud-overlay-arrow-position)) 3162 (let ((buffer (marker-buffer gud-overlay-arrow-position))
3165 (position (marker-position gud-overlay-arrow-position))) 3163 (position (marker-position gud-overlay-arrow-position)))
3166 (when (and buffer (string-equal (buffer-name buffer) (match-string 3))) 3164 (when (and buffer
3165 (string-equal (buffer-name buffer)
3166 (file-name-nondirectory (match-string 3))))
3167 (with-current-buffer buffer 3167 (with-current-buffer buffer
3168 (setq fringe-indicator-alist 3168 (setq fringe-indicator-alist
3169 (if (string-equal gdb-frame-number "0") 3169 (if (string-equal gdb-frame-number "0")
@@ -3230,7 +3230,8 @@ numchild=\"\\(.+?\\)\",.*?value=\\(\".*?\"\\),.*?type=\"\\(.+?\\)\".*?}")
3230 (throw 'child-already-watched nil)) 3230 (throw 'child-already-watched nil))
3231 (push varchild var-list)))) 3231 (push varchild var-list))))
3232 (push var var-list))) 3232 (push var var-list)))
3233 (setq gdb-var-list (nreverse var-list))))) 3233 (setq gdb-var-list (nreverse var-list))))
3234 (gdb-speedbar-update))
3234 3235
3235; Uses "-var-update --all-values". Needs GDB 6.4 onwards. 3236; Uses "-var-update --all-values". Needs GDB 6.4 onwards.
3236(defun gdb-var-update-1 () 3237(defun gdb-var-update-1 ()
@@ -3263,11 +3264,7 @@ in_scope=\"\\(.*?\\)\".*?}")
3263 (read (match-string 2))))))) 3264 (read (match-string 2)))))))
3264 (setq gdb-pending-triggers 3265 (setq gdb-pending-triggers
3265 (delq 'gdb-var-update gdb-pending-triggers)) 3266 (delq 'gdb-var-update gdb-pending-triggers))
3266 (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) 3267 (gdb-speedbar-update))
3267 ;; dummy command to update speedbar at right time
3268 (gdb-enqueue-input (list "server pwd\n" 'gdb-speedbar-refresh))
3269 ;; keep gdb-pending-triggers non-nil till end
3270 (push 'gdb-speedbar-refresh gdb-pending-triggers)))
3271 3268
3272;; Registers buffer. 3269;; Registers buffer.
3273;; 3270;;
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 0aba9d42b84..410a973d1b4 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -584,7 +584,7 @@ substitution string. Note dynamic scoping of variables.")
584 (setq command 584 (setq command
585 (replace-match 585 (replace-match
586 (or (if (symbolp (cdr kw)) 586 (or (if (symbolp (cdr kw))
587 (eval (cdr kw)) 587 (symbol-value (cdr kw))
588 (save-match-data (eval (cdr kw)))) 588 (save-match-data (eval (cdr kw))))
589 "") 589 "")
590 t t command)))))) 590 t t command))))))
@@ -639,9 +639,9 @@ The search is limited to file names matching shell pattern FILES.
639FILES may use abbreviations defined in `grep-files-aliases', e.g. 639FILES may use abbreviations defined in `grep-files-aliases', e.g.
640entering `ch' is equivalent to `*.[ch]'. 640entering `ch' is equivalent to `*.[ch]'.
641 641
642With \\[universal-argument] prefix, allow user to edit the constructed 642With \\[universal-argument] prefix, you can edit the constructed shell command line
643shell command line before it is executed. 643before it is executed.
644With two \\[universal-argument] prefixes, edit and run grep shell command. 644With two \\[universal-argument] prefixes, directly edit and run `grep-command'.
645 645
646Collect output in a buffer. While grep runs asynchronously, you 646Collect output in a buffer. While grep runs asynchronously, you
647can use \\[next-error] (M-x next-error), or \\<grep-mode-map>\\[compile-goto-error] 647can use \\[next-error] (M-x next-error), or \\<grep-mode-map>\\[compile-goto-error]
@@ -676,7 +676,7 @@ This command shares argument histories with \\[rgrep] and \\[grep]."
676 (setq command 676 (setq command
677 (read-from-minibuffer "Confirm: " 677 (read-from-minibuffer "Confirm: "
678 command nil nil 'grep-history)) 678 command nil nil 'grep-history))
679 (push command grep-history)))) 679 (add-to-history 'grep-history command))))
680 (when command 680 (when command
681 ;; Setting process-setup-function makes exit-message-function work 681 ;; Setting process-setup-function makes exit-message-function work
682 ;; even when async processes aren't supported. 682 ;; even when async processes aren't supported.
@@ -687,14 +687,14 @@ This command shares argument histories with \\[rgrep] and \\[grep]."
687 687
688;;;###autoload 688;;;###autoload
689(defun rgrep (regexp &optional files dir) 689(defun rgrep (regexp &optional files dir)
690 "Recusively grep for REGEXP in FILES in directory tree rooted at DIR. 690 "Recursively grep for REGEXP in FILES in directory tree rooted at DIR.
691The search is limited to file names matching shell pattern FILES. 691The search is limited to file names matching shell pattern FILES.
692FILES may use abbreviations defined in `grep-files-aliases', e.g. 692FILES may use abbreviations defined in `grep-files-aliases', e.g.
693entering `ch' is equivalent to `*.[ch]'. 693entering `ch' is equivalent to `*.[ch]'.
694 694
695With \\[universal-argument] prefix, allow user to edit the constructed 695With \\[universal-argument] prefix, you can edit the constructed shell command line
696shell command line before it is executed. 696before it is executed.
697With two \\[universal-argument] prefixes, edit and run grep-find shell command. 697With two \\[universal-argument] prefixes, directly edit and run `grep-find-command'.
698 698
699Collect output in a buffer. While find runs asynchronously, you 699Collect output in a buffer. While find runs asynchronously, you
700can use \\[next-error] (M-x next-error), or \\<grep-mode-map>\\[compile-goto-error] 700can use \\[next-error] (M-x next-error), or \\<grep-mode-map>\\[compile-goto-error]
@@ -721,16 +721,16 @@ This command shares argument histories with \\[lgrep] and \\[grep-find]."
721 (if (null files) 721 (if (null files)
722 (if (not (string= regexp grep-find-command)) 722 (if (not (string= regexp grep-find-command))
723 (compilation-start regexp 'grep-mode)) 723 (compilation-start regexp 'grep-mode))
724 (let* ((default-directory (file-name-as-directory (expand-file-name dir))) 724 (setq dir (file-name-as-directory (expand-file-name dir)))
725 (command (grep-expand-template 725 (let ((command (grep-expand-template
726 grep-find-template 726 grep-find-template
727 regexp 727 regexp
728 (concat "\\( -name " 728 (concat "\\( -name "
729 (mapconcat #'shell-quote-argument 729 (mapconcat #'shell-quote-argument
730 (split-string files) 730 (split-string files)
731 " -o -name ") 731 " -o -name ")
732 " \\)") 732 " \\)")
733 default-directory 733 dir
734 (and grep-find-ignored-directories 734 (and grep-find-ignored-directories
735 (concat "\\( -path '*/" 735 (concat "\\( -path '*/"
736 (mapconcat #'identity 736 (mapconcat #'identity
@@ -742,8 +742,12 @@ This command shares argument histories with \\[lgrep] and \\[grep-find]."
742 (setq command 742 (setq command
743 (read-from-minibuffer "Confirm: " 743 (read-from-minibuffer "Confirm: "
744 command nil nil 'grep-find-history)) 744 command nil nil 'grep-find-history))
745 (push command grep-find-history)) 745 (add-to-history 'grep-find-history command))
746 (compilation-start command 'grep-mode)))))) 746 (let ((default-directory dir))
747 (compilation-start command 'grep-mode))
748 ;; Set default-directory if we started rgrep in the *grep* buffer.
749 (if (eq next-error-last-buffer (current-buffer))
750 (setq default-directory dir)))))))
747 751
748 752
749(provide 'grep) 753(provide 'grep)
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 11259aa3965..5be88668353 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -49,7 +49,6 @@
49(defvar gdb-macro-info) 49(defvar gdb-macro-info)
50(defvar gdb-server-prefix) 50(defvar gdb-server-prefix)
51(defvar gdb-show-changed-values) 51(defvar gdb-show-changed-values)
52(defvar gdb-force-update)
53(defvar gdb-var-list) 52(defvar gdb-var-list)
54(defvar gdb-speedbar-auto-raise) 53(defvar gdb-speedbar-auto-raise)
55(defvar tool-bar-map) 54(defvar tool-bar-map)
@@ -442,37 +441,55 @@ required by the caller."
442 (buffer-name gud-comint-buffer)) 441 (buffer-name gud-comint-buffer))
443 (let* ((minor-mode (with-current-buffer buffer gud-minor-mode)) 442 (let* ((minor-mode (with-current-buffer buffer gud-minor-mode))
444 (window (get-buffer-window (current-buffer) 0)) 443 (window (get-buffer-window (current-buffer) 0))
444 (start (window-start window))
445 (p (window-point window))) 445 (p (window-point window)))
446 (cond 446 (cond
447 ((memq minor-mode '(gdbmi gdba)) 447 ((memq minor-mode '(gdbmi gdba))
448 (when (or gdb-force-update 448 (erase-buffer)
449 (not (save-excursion 449 (insert "Watch Expressions:\n")
450 (goto-char (point-min)) 450 (if gdb-speedbar-auto-raise
451 (looking-at "Watch Expressions:")))) 451 (raise-frame speedbar-frame))
452 (erase-buffer) 452 (let ((var-list gdb-var-list) parent)
453 (insert "Watch Expressions:\n") 453 (while var-list
454 (if gdb-speedbar-auto-raise 454 (let* (char (depth 0) (start 0) (var (car var-list))
455 (raise-frame speedbar-frame)) 455 (varnum (car var)) (expr (nth 1 var))
456 (let ((var-list gdb-var-list) parent) 456 (type (nth 3 var)) (value (nth 4 var))
457 (while var-list 457 (status (nth 5 var)))
458 (let* (char (depth 0) (start 0) (var (car var-list)) 458 (put-text-property
459 (varnum (car var)) (expr (nth 1 var)) 459 0 (length expr) 'face font-lock-variable-name-face expr)
460 (type (nth 3 var)) (value (nth 4 var)) 460 (put-text-property
461 (status (nth 5 var))) 461 0 (length type) 'face font-lock-type-face type)
462 (put-text-property 462 (while (string-match "\\." varnum start)
463 0 (length expr) 'face font-lock-variable-name-face expr) 463 (setq depth (1+ depth)
464 (put-text-property 464 start (1+ (match-beginning 0))))
465 0 (length type) 'face font-lock-type-face type) 465 (if (eq depth 0) (setq parent nil))
466 (while (string-match "\\." varnum start) 466 (if (or (equal (nth 2 var) "0")
467 (setq depth (1+ depth) 467 (and (equal (nth 2 var) "1")
468 start (1+ (match-beginning 0)))) 468 (string-match "char \\*$" type)))
469 (if (eq depth 0) (setq parent nil)) 469 (speedbar-make-tag-line
470 (if (or (equal (nth 2 var) "0") 470 'bracket ?? nil nil
471 (and (equal (nth 2 var) "1") 471 (concat expr "\t" value)
472 (string-match "char \\*$" type))) 472 (if (or parent (eq status 'out-of-scope))
473 nil 'gdb-edit-value)
474 nil
475 (if gdb-show-changed-values
476 (or parent (case status
477 (changed 'font-lock-warning-face)
478 (out-of-scope 'shadow)
479 (t t)))
480 t)
481 depth)
482 (if (eq status 'out-of-scope) (setq parent 'shadow))
483 (if (and (nth 1 var-list)
484 (string-match (concat varnum "\\.")
485 (car (nth 1 var-list))))
486 (setq char ?-)
487 (setq char ?+))
488 (if (string-match "\\*$" type)
473 (speedbar-make-tag-line 489 (speedbar-make-tag-line
474 'bracket ?? nil nil 490 'bracket char
475 (concat expr "\t" value) 491 'gdb-speedbar-expand-node varnum
492 (concat expr "\t" type "\t" value)
476 (if (or parent (eq status 'out-of-scope)) 493 (if (or parent (eq status 'out-of-scope))
477 nil 'gdb-edit-value) 494 nil 'gdb-edit-value)
478 nil 495 nil
@@ -483,37 +500,15 @@ required by the caller."
483 (t t))) 500 (t t)))
484 t) 501 t)
485 depth) 502 depth)
486 (if (eq status 'out-of-scope) (setq parent 'shadow)) 503 (speedbar-make-tag-line
487 (if (and (nth 1 var-list) 504 'bracket char
488 (string-match (concat varnum "\\.") 505 'gdb-speedbar-expand-node varnum
489 (car (nth 1 var-list)))) 506 (concat expr "\t" type)
490 (setq char ?-) 507 nil nil
491 (setq char ?+)) 508 (if (and (or parent status) gdb-show-changed-values)
492 (if (string-match "\\*$" type) 509 'shadow t)
493 (speedbar-make-tag-line 510 depth))))
494 'bracket char 511 (setq var-list (cdr var-list)))))
495 'gdb-speedbar-expand-node varnum
496 (concat expr "\t" type "\t" value)
497 (if (or parent (eq status 'out-of-scope))
498 nil 'gdb-edit-value)
499 nil
500 (if gdb-show-changed-values
501 (or parent (case status
502 (changed 'font-lock-warning-face)
503 (out-of-scope 'shadow)
504 (t t)))
505 t)
506 depth)
507 (speedbar-make-tag-line
508 'bracket char
509 'gdb-speedbar-expand-node varnum
510 (concat expr "\t" type)
511 nil nil
512 (if (and (or parent status) gdb-show-changed-values)
513 'shadow t)
514 depth))))
515 (setq var-list (cdr var-list))))
516 (setq gdb-force-update nil)))
517 (t (unless (and (save-excursion 512 (t (unless (and (save-excursion
518 (goto-char (point-min)) 513 (goto-char (point-min))
519 (looking-at "Current Stack:")) 514 (looking-at "Current Stack:"))
@@ -544,6 +539,7 @@ required by the caller."
544 (t (error "Should never be here"))) 539 (t (error "Should never be here")))
545 frame t)))) 540 frame t))))
546 (setq gud-last-speedbar-stackframe gud-last-last-frame)))) 541 (setq gud-last-speedbar-stackframe gud-last-last-frame))))
542 (set-window-start window start)
547 (set-window-point window p)))) 543 (set-window-point window p))))
548 544
549 545
diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el
index 410875f2006..bdc8161c80f 100644
--- a/lisp/progmodes/idlw-shell.el
+++ b/lisp/progmodes/idlw-shell.el
@@ -1471,11 +1471,7 @@ Otherwise just move the line. Move down unless UP is non-nil."
1471 (if (eq t idlwave-shell-arrows-do-history) (goto-char proc-pos)) 1471 (if (eq t idlwave-shell-arrows-do-history) (goto-char proc-pos))
1472 (if (and idlwave-shell-arrows-do-history 1472 (if (and idlwave-shell-arrows-do-history
1473 (>= (1+ (save-excursion (end-of-line) (point))) proc-pos)) 1473 (>= (1+ (save-excursion (end-of-line) (point))) proc-pos))
1474 (progn 1474 (comint-previous-input arg)
1475 ;;(goto-char proc-pos)
1476 (goto-char (point-max))
1477 ;;(and (not (eolp)) (kill-line nil))
1478 (comint-previous-input arg))
1479 (previous-line arg)))) 1475 (previous-line arg))))
1480 1476
1481(defun idlwave-shell-up-or-history (&optional arg) 1477(defun idlwave-shell-up-or-history (&optional arg)
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index 7a778766821..2f26c90ac21 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -1208,8 +1208,8 @@ As a user, you should not set this to t.")
1208 ;; Treats continuation lines, works only during whole buffer 1208 ;; Treats continuation lines, works only during whole buffer
1209 ;; fontification. Slow, use it only in fancy fontification. 1209 ;; fontification. Slow, use it only in fancy fontification.
1210 (keyword-parameters 1210 (keyword-parameters
1211 '("\\(,\\|[a-zA-Z0-9_](\\)[ \t]*\\(\\$[ \t]*\\(;.*\\)?\\(\n[ \t]*;.*\\)*\n[ \t]*\\)?\\(/[a-zA-Z_]\\sw*\\|[a-zA-Z_]\\sw*[ \t]*=\\)" 1211 '("\\(,\\|[a-zA-Z0-9_](\\)[ \t]*\\(\\$[ \t]*\\(;.*\\)?\n\\([ \t]*\\(;.*\\)?\n\\)*[ \t]*\\)?\\(/[a-zA-Z_]\\sw*\\|[a-zA-Z_]\\sw*[ \t]*=\\)"
1212 (5 font-lock-reference-face))) 1212 (6 font-lock-reference-face)))
1213 1213
1214 ;; System variables start with a bang. 1214 ;; System variables start with a bang.
1215 (system-variables 1215 (system-variables
@@ -1915,6 +1915,7 @@ The main features of this mode are
1915 1915
1916 (set (make-local-variable 'comment-start-skip) ";+[ \t]*") 1916 (set (make-local-variable 'comment-start-skip) ";+[ \t]*")
1917 (set (make-local-variable 'comment-start) ";") 1917 (set (make-local-variable 'comment-start) ";")
1918 (set (make-local-variable 'comment-add) 1) ; ";;" for new and regions
1918 (set (make-local-variable 'require-final-newline) t) 1919 (set (make-local-variable 'require-final-newline) t)
1919 (set (make-local-variable 'abbrev-all-caps) t) 1920 (set (make-local-variable 'abbrev-all-caps) t)
1920 (set (make-local-variable 'indent-tabs-mode) nil) 1921 (set (make-local-variable 'indent-tabs-mode) nil)
@@ -1947,6 +1948,10 @@ The main features of this mode are
1947 ;; Following line is for Emacs - XEmacs uses the corresponding property 1948 ;; Following line is for Emacs - XEmacs uses the corresponding property
1948 ;; on the `idlwave-mode' symbol. 1949 ;; on the `idlwave-mode' symbol.
1949 (set (make-local-variable 'font-lock-defaults) idlwave-font-lock-defaults) 1950 (set (make-local-variable 'font-lock-defaults) idlwave-font-lock-defaults)
1951 (set (make-local-variable 'font-lock-mark-block-function)
1952 'idlwave-mark-subprogram)
1953 (set (make-local-variable 'font-lock-fontify-region-function)
1954 'idlwave-font-lock-fontify-region)
1950 1955
1951 ;; Imenu setup 1956 ;; Imenu setup
1952 (set (make-local-variable 'imenu-create-index-function) 1957 (set (make-local-variable 'imenu-create-index-function)
@@ -1956,6 +1961,15 @@ The main features of this mode are
1956 (set (make-local-variable 'imenu-prev-index-position-function) 1961 (set (make-local-variable 'imenu-prev-index-position-function)
1957 'idlwave-prev-index-position) 1962 'idlwave-prev-index-position)
1958 1963
1964 ;; HideShow setup
1965 (add-to-list 'hs-special-modes-alist
1966 (list 'idlwave-mode
1967 idlwave-begin-block-reg
1968 idlwave-end-block-reg
1969 ";"
1970 'idlwave-forward-block nil))
1971
1972
1959 ;; Make a local post-command-hook and add our hook to it 1973 ;; Make a local post-command-hook and add our hook to it
1960 ;; NB: `make-local-hook' needed for older/alternative Emacs compatibility 1974 ;; NB: `make-local-hook' needed for older/alternative Emacs compatibility
1961 ;; (make-local-hook 'post-command-hook) 1975 ;; (make-local-hook 'post-command-hook)
@@ -2000,16 +2014,22 @@ The main features of this mode are
2000 (idlwave-read-paths) ; we may need these early 2014 (idlwave-read-paths) ; we may need these early
2001 (setq idlwave-setup-done t))) 2015 (setq idlwave-setup-done t)))
2002 2016
2017(defun idlwave-font-lock-fontify-region (beg end &optional verbose)
2018 "Fontify continuation lines correctly."
2019 (let (pos)
2020 (save-excursion
2021 (goto-char beg)
2022 (forward-line -1)
2023 (when (setq pos (idlwave-is-continuation-line))
2024 (goto-char pos)
2025 (idlwave-beginning-of-statement)
2026 (setq beg (point)))))
2027 (font-lock-default-fontify-region beg end verbose))
2028
2003;; 2029;;
2004;; Code Formatting ---------------------------------------------------- 2030;; Code Formatting ----------------------------------------------------
2005;; 2031;;
2006 2032
2007(defun idlwave-push-mark (&rest rest)
2008 "Push mark for compatibility with Emacs 18/19."
2009 (if (fboundp 'iconify-frame)
2010 (apply 'push-mark rest)
2011 (push-mark)))
2012
2013(defun idlwave-hard-tab () 2033(defun idlwave-hard-tab ()
2014 "Inserts TAB in buffer in current position." 2034 "Inserts TAB in buffer in current position."
2015 (interactive) 2035 (interactive)
@@ -2403,7 +2423,7 @@ non-nil."
2403 (idlwave-end-of-statement) 2423 (idlwave-end-of-statement)
2404 (let ((end (point))) 2424 (let ((end (point)))
2405 (idlwave-beginning-of-statement) 2425 (idlwave-beginning-of-statement)
2406 (idlwave-push-mark end nil t))) 2426 (push-mark end nil t)))
2407 2427
2408(defun idlwave-mark-block () 2428(defun idlwave-mark-block ()
2409 "Mark containing block." 2429 "Mark containing block."
@@ -2414,7 +2434,7 @@ non-nil."
2414 (let ((end (point))) 2434 (let ((end (point)))
2415 (idlwave-backward-block) 2435 (idlwave-backward-block)
2416 (idlwave-beginning-of-statement) 2436 (idlwave-beginning-of-statement)
2417 (idlwave-push-mark end nil t))) 2437 (push-mark end nil t)))
2418 2438
2419 2439
2420(defun idlwave-mark-subprogram () 2440(defun idlwave-mark-subprogram ()
@@ -2425,7 +2445,7 @@ The marks are pushed."
2425 (idlwave-beginning-of-subprogram) 2445 (idlwave-beginning-of-subprogram)
2426 (let ((beg (point))) 2446 (let ((beg (point)))
2427 (idlwave-forward-block) 2447 (idlwave-forward-block)
2428 (idlwave-push-mark beg nil t)) 2448 (push-mark beg nil t))
2429 (exchange-point-and-mark)) 2449 (exchange-point-and-mark))
2430 2450
2431(defun idlwave-backward-up-block (&optional arg) 2451(defun idlwave-backward-up-block (&optional arg)
@@ -2446,11 +2466,12 @@ If prefix ARG < 0 then move forward to enclosing block end."
2446 (idlwave-block-jump-out 1 'nomark) 2466 (idlwave-block-jump-out 1 'nomark)
2447 (backward-word 1)) 2467 (backward-word 1))
2448 2468
2449(defun idlwave-forward-block () 2469(defun idlwave-forward-block (&optional arg)
2450 "Move across next nested block." 2470 "Move across next nested block."
2451 (interactive) 2471 (interactive)
2452 (if (idlwave-down-block 1) 2472 (let ((arg (or arg 1)))
2453 (idlwave-block-jump-out 1 'nomark))) 2473 (if (idlwave-down-block arg)
2474 (idlwave-block-jump-out arg 'nomark))))
2454 2475
2455(defun idlwave-backward-block () 2476(defun idlwave-backward-block ()
2456 "Move backward across previous nested block." 2477 "Move backward across previous nested block."
@@ -2496,12 +2517,11 @@ The marks are pushed."
2496 (if (re-search-forward idlwave-doclib-end nil t) 2517 (if (re-search-forward idlwave-doclib-end nil t)
2497 (progn 2518 (progn
2498 (forward-line 1) 2519 (forward-line 1)
2499 (idlwave-push-mark beg nil t) 2520 (push-mark beg nil t)
2500 (message "Could not find end of doc library header."))) 2521 (message "Could not find end of doc library header.")))
2501 (message "Could not find doc library header start.") 2522 (message "Could not find doc library header start.")
2502 (goto-char here))))) 2523 (goto-char here)))))
2503 2524
2504
2505(defun idlwave-current-routine () 2525(defun idlwave-current-routine ()
2506 "Return (NAME TYPE CLASS) of current routine." 2526 "Return (NAME TYPE CLASS) of current routine."
2507 (idlwave-routines) 2527 (idlwave-routines)
@@ -3194,13 +3214,14 @@ Skips any whitespace. Returns 0 if the end-of-line follows the whitespace."
3194 "Tests if current line is continuation line. 3214 "Tests if current line is continuation line.
3195Blank or comment-only lines following regular continuation lines (with 3215Blank or comment-only lines following regular continuation lines (with
3196`$') count as continuations too." 3216`$') count as continuations too."
3197 (save-excursion 3217 (let (p)
3198 (or 3218 (save-excursion
3199 (idlwave-look-at "\\<\\$") 3219 (or
3200 (catch 'loop 3220 (idlwave-look-at "\\<\\$")
3201 (while (and (looking-at "^[ \t]*\\(;.*\\)?$") 3221 (catch 'loop
3202 (eq (forward-line -1) 0)) 3222 (while (and (looking-at "^[ \t]*\\(;.*\\)?$")
3203 (if (idlwave-look-at "\\<\\$") (throw 'loop t))))))) 3223 (eq (forward-line -1) 0))
3224 (if (setq p (idlwave-look-at "\\<\\$")) (throw 'loop p))))))))
3204 3225
3205(defun idlwave-is-comment-line () 3226(defun idlwave-is-comment-line ()
3206 "Tests if the current line is a comment line." 3227 "Tests if the current line is a comment line."
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index 43b33aa39ae..4d63b07d87c 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -923,8 +923,9 @@ Returns new value of point in all cases."
923 (or arg (setq arg 1)) 923 (or arg (setq arg 1))
924 (if (< arg 0) (forward-char 1)) 924 (if (< arg 0) (forward-char 1))
925 (and (/= arg 0) 925 (and (/= arg 0)
926 (re-search-backward "^\\s(\\|^\\s-*sub\\b[^{]+{\\|^\\s-*format\\b[^=]*=\\|^\\." 926 (re-search-backward
927 nil 'move arg) 927 "^\\s(\\|^\\s-*sub\\b[ \t\n]*\\_<[^{]+{\\|^\\s-*format\\b[^=]*=\\|^\\."
928 nil 'move arg)
928 (goto-char (1- (match-end 0)))) 929 (goto-char (1- (match-end 0))))
929 (point)) 930 (point))
930 931
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index d81a5fcf47b..987b37cf2c2 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -16723,8 +16723,7 @@ specified by a target."
16723 (progn (save-buffer) 16723 (progn (save-buffer)
16724 (kill-buffer (current-buffer)) 16724 (kill-buffer (current-buffer))
16725 (set-buffer orig-buffer) 16725 (set-buffer orig-buffer)
16726 (setq file-name-history 16726 (add-to-history 'file-name-history makefile-path-name))
16727 (cons makefile-path-name file-name-history)))
16728 (vhdl-warning-when-idle 16727 (vhdl-warning-when-idle
16729 (format "File not writable: \"%s\"" 16728 (format "File not writable: \"%s\""
16730 (abbreviate-file-name makefile-path-name))) 16729 (abbreviate-file-name makefile-path-name)))
diff --git a/lisp/progmodes/xscheme.el b/lisp/progmodes/xscheme.el
index 4f1cd37a9f7..0f55c71ac70 100644
--- a/lisp/progmodes/xscheme.el
+++ b/lisp/progmodes/xscheme.el
@@ -580,12 +580,9 @@ The strings are concatenated and terminated by a newline."
580;;;; Scheme expressions ring 580;;;; Scheme expressions ring
581 581
582(defun xscheme-insert-expression (string) 582(defun xscheme-insert-expression (string)
583 (setq xscheme-expressions-ring (cons string xscheme-expressions-ring)) 583 (setq xscheme-expressions-ring-yank-pointer
584 (if (> (length xscheme-expressions-ring) xscheme-expressions-ring-max) 584 (add-to-history 'xscheme-expressions-ring string
585 (setcdr (nthcdr (1- xscheme-expressions-ring-max) 585 xscheme-expressions-ring-max)))
586 xscheme-expressions-ring)
587 nil))
588 (setq xscheme-expressions-ring-yank-pointer xscheme-expressions-ring))
589 586
590(defun xscheme-rotate-yank-pointer (arg) 587(defun xscheme-rotate-yank-pointer (arg)
591 "Rotate the yanking point in the kill ring." 588 "Rotate the yanking point in the kill ring."
diff --git a/lisp/replace.el b/lisp/replace.el
index 3187bbbbd36..f1792b499fc 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1098,6 +1098,7 @@ See also `multi-occur'."
1098 (endpt nil) 1098 (endpt nil)
1099 (marker nil) 1099 (marker nil)
1100 (curstring "") 1100 (curstring "")
1101 (inhibit-field-text-motion t)
1101 (headerpt (with-current-buffer out-buf (point)))) 1102 (headerpt (with-current-buffer out-buf (point))))
1102 (with-current-buffer buf 1103 (with-current-buffer buf
1103 (or coding 1104 (or coding
diff --git a/lisp/server.el b/lisp/server.el
index befcd22ad3a..43b2dc63389 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -411,7 +411,7 @@ so don't mark these buffers specially, just visit them normally."
411 ;; deleted file, offer to write it. 411 ;; deleted file, offer to write it.
412 (let* ((filen (car file)) 412 (let* ((filen (car file))
413 (obuf (get-file-buffer filen))) 413 (obuf (get-file-buffer filen)))
414 (push filen file-name-history) 414 (add-to-history 'file-name-history filen)
415 (if (and obuf (set-buffer obuf)) 415 (if (and obuf (set-buffer obuf))
416 (progn 416 (progn
417 (cond ((file-exists-p filen) 417 (cond ((file-exists-p filen)
diff --git a/lisp/simple.el b/lisp/simple.el
index 6b571aaba3f..9fc0770ad68 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1156,7 +1156,7 @@ they are expressions; otherwise they are strings.
1156\(That convention is designed to do the right thing for 1156\(That convention is designed to do the right thing for
1157recursive uses of the minibuffer.)") 1157recursive uses of the minibuffer.)")
1158(setq minibuffer-history-variable 'minibuffer-history) 1158(setq minibuffer-history-variable 'minibuffer-history)
1159(setq minibuffer-history-position nil) 1159(setq minibuffer-history-position nil) ;; Defvar is in C code.
1160(defvar minibuffer-history-search-history nil) 1160(defvar minibuffer-history-search-history nil)
1161 1161
1162(defvar minibuffer-text-before-history nil 1162(defvar minibuffer-text-before-history nil
@@ -1281,7 +1281,8 @@ makes the search case-sensitive."
1281(defvar minibuffer-temporary-goal-position nil) 1281(defvar minibuffer-temporary-goal-position nil)
1282 1282
1283(defun next-history-element (n) 1283(defun next-history-element (n)
1284 "Insert the next element of the minibuffer history into the minibuffer." 1284 "Puts next element of the minibuffer history in the minibuffer.
1285With argument N, it uses the Nth following element."
1285 (interactive "p") 1286 (interactive "p")
1286 (or (zerop n) 1287 (or (zerop n)
1287 (let ((narg (- minibuffer-history-position n)) 1288 (let ((narg (- minibuffer-history-position n))
@@ -1324,7 +1325,8 @@ makes the search case-sensitive."
1324 (goto-char (or minibuffer-temporary-goal-position (point-max)))))) 1325 (goto-char (or minibuffer-temporary-goal-position (point-max))))))
1325 1326
1326(defun previous-history-element (n) 1327(defun previous-history-element (n)
1327 "Inserts the previous element of the minibuffer history into the minibuffer." 1328 "Puts previous element of the minibuffer history in the minibuffer.
1329With argument N, it uses the Nth previous element."
1328 (interactive "p") 1330 (interactive "p")
1329 (next-history-element (- n))) 1331 (next-history-element (- n)))
1330 1332
diff --git a/lisp/speedbar.el b/lisp/speedbar.el
index 4b83f08d89d..b3913f6f6c6 100644
--- a/lisp/speedbar.el
+++ b/lisp/speedbar.el
@@ -2529,8 +2529,7 @@ name will have the function FIND-FUN and not token."
2529 default-directory) 2529 default-directory)
2530 (speedbar-message nil)))) 2530 (speedbar-message nil))))
2531 ;; Else, we can do a short cut. No text cache. 2531 ;; Else, we can do a short cut. No text cache.
2532 (let ((cbd (expand-file-name default-directory)) 2532 (let ((cbd (expand-file-name default-directory)))
2533 )
2534 (set-buffer speedbar-buffer) 2533 (set-buffer speedbar-buffer)
2535 (speedbar-with-writable 2534 (speedbar-with-writable
2536 (let* ((window (get-buffer-window speedbar-buffer 0)) 2535 (let* ((window (get-buffer-window speedbar-buffer 0))
@@ -2542,8 +2541,7 @@ name will have the function FIND-FUN and not token."
2542 (funcall func cbd 0)) 2541 (funcall func cbd 0))
2543 (speedbar-reconfigure-keymaps) 2542 (speedbar-reconfigure-keymaps)
2544 (set-window-point window p) 2543 (set-window-point window p)
2545 (set-window-start window start))) 2544 (set-window-start window start)))))))
2546 ))))
2547 2545
2548(defun speedbar-update-directory-contents () 2546(defun speedbar-update-directory-contents ()
2549 "Update the contents of the speedbar buffer based on the current directory." 2547 "Update the contents of the speedbar buffer based on the current directory."
@@ -2677,7 +2675,6 @@ Also resets scanner functions."
2677 (frame-visible-p (speedbar-current-frame)) 2675 (frame-visible-p (speedbar-current-frame))
2678 (not (eq (frame-visible-p (speedbar-current-frame)) 'icon))) 2676 (not (eq (frame-visible-p (speedbar-current-frame)) 'icon)))
2679 (let ((af (selected-frame))) 2677 (let ((af (selected-frame)))
2680 (save-window-excursion
2681 (dframe-select-attached-frame speedbar-frame) 2678 (dframe-select-attached-frame speedbar-frame)
2682 ;; make sure we at least choose a window to 2679 ;; make sure we at least choose a window to
2683 ;; get a good directory from 2680 ;; get a good directory from
@@ -2704,14 +2701,8 @@ Also resets scanner functions."
2704 "Updating speedbar to special mode: %s...done" 2701 "Updating speedbar to special mode: %s...done"
2705 major-mode) 2702 major-mode)
2706 (speedbar-message nil)))) 2703 (speedbar-message nil))))
2707 ;; Update all the contents if directories change! 2704 (speedbar-update-localized-contents))
2708 (if (or (member major-mode speedbar-ignored-modes) 2705 (select-frame af))
2709 (eq af (speedbar-current-frame))
2710 (not (buffer-file-name)))
2711 nil
2712 (speedbar-update-localized-contents)
2713 ))
2714 (select-frame af)))
2715 ;; Now run stealthy updates of time-consuming items 2706 ;; Now run stealthy updates of time-consuming items
2716 (speedbar-stealthy-updates))))) 2707 (speedbar-stealthy-updates)))))
2717 (run-hooks 'speedbar-timer-hook)) 2708 (run-hooks 'speedbar-timer-hook))
diff --git a/lisp/startup.el b/lisp/startup.el
index 66676c302b9..f1a68fd8509 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -821,7 +821,16 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
821 (format "Invalid user name %s" 821 (format "Invalid user name %s"
822 init-file-user) 822 init-file-user)
823 :error) 823 :error)
824 (if (file-directory-p (expand-file-name (concat "~" init-file-user))) 824 (if (file-directory-p (expand-file-name
825 ;; We don't support ~USER on MS-Windows except
826 ;; for the current user, and always load .emacs
827 ;; from the current user's home directory (see
828 ;; below). So always check "~", even if invoked
829 ;; with "-u USER", or if $USER or $LOGNAME are
830 ;; set to something different.
831 (if (eq system-type 'windows-nt)
832 "~"
833 (concat "~" init-file-user))))
825 nil 834 nil
826 (display-warning 'initialization 835 (display-warning 'initialization
827 (format "User %s has no home directory" 836 (format "User %s has no home directory"
@@ -1302,7 +1311,9 @@ where FACE is a valid face specification, as it can be used with
1302 (set-buffer buffer) 1311 (set-buffer buffer)
1303 (erase-buffer) 1312 (erase-buffer)
1304 (if pure-space-overflow 1313 (if pure-space-overflow
1305 (insert "Warning Warning Pure space overflow Warning Warning\n")) 1314 (insert "\
1315Warning Warning!!! Pure space overflow !!!Warning Warning
1316\(See the node Pure Storage in the Lisp manual for details.)\n"))
1306 (fancy-splash-head) 1317 (fancy-splash-head)
1307 (apply #'fancy-splash-insert text) 1318 (apply #'fancy-splash-insert text)
1308 (fancy-splash-tail) 1319 (fancy-splash-tail)
@@ -1359,7 +1370,7 @@ mouse."
1359 emulation-mode-map-alists nil 1370 emulation-mode-map-alists nil
1360 buffer-undo-list t 1371 buffer-undo-list t
1361 mode-line-format (propertize "---- %b %-" 1372 mode-line-format (propertize "---- %b %-"
1362 'face '(:weight bold)) 1373 'face 'mode-line-buffer-id)
1363 fancy-splash-stop-time (+ (float-time) 1374 fancy-splash-stop-time (+ (float-time)
1364 fancy-splash-max-time) 1375 fancy-splash-max-time)
1365 timer (run-with-timer 0 fancy-splash-delay 1376 timer (run-with-timer 0 fancy-splash-delay
@@ -1408,10 +1419,12 @@ we put it on this frame."
1408 (with-current-buffer (get-buffer-create "GNU Emacs") 1419 (with-current-buffer (get-buffer-create "GNU Emacs")
1409 (set (make-local-variable 'tab-width) 8) 1420 (set (make-local-variable 'tab-width) 8)
1410 (set (make-local-variable 'mode-line-format) 1421 (set (make-local-variable 'mode-line-format)
1411 (propertize "---- %b %-" 'face '(:weight bold))) 1422 (propertize "---- %b %-" 'face 'mode-line-buffer-id))
1412 1423
1413 (if pure-space-overflow 1424 (if pure-space-overflow
1414 (insert "Warning Warning Pure space overflow Warning Warning\n")) 1425 (insert "\
1426Warning Warning!!! Pure space overflow !!!Warning Warning
1427\(See the node Pure Storage in the Lisp manual for details.)\n"))
1415 1428
1416 ;; The convention for this piece of code is that 1429 ;; The convention for this piece of code is that
1417 ;; each piece of output starts with one or two newlines 1430 ;; each piece of output starts with one or two newlines
@@ -1624,9 +1637,7 @@ normal otherwise."
1624 (not noninteractive)) 1637 (not noninteractive))
1625 (display-warning 1638 (display-warning
1626 'initialization 1639 'initialization
1627 "Building Emacs overflowed pure space." 1640 "Building Emacs overflowed pure space. (See the node Pure Storage in the Lisp manual for details.)"
1628 ;; FIXME: Tell the user what kind of problems are possible and how to fix
1629 ;; the overflow.
1630 :warning)) 1641 :warning))
1631 1642
1632 (when command-line-args-left 1643 (when command-line-args-left
diff --git a/lisp/subr.el b/lisp/subr.el
index 5c0317d00c3..5cc5be5f56b 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1122,6 +1122,31 @@ The return value is the new value of LIST-VAR."
1122 (if (and oa ob) 1122 (if (and oa ob)
1123 (< oa ob) 1123 (< oa ob)
1124 oa))))))) 1124 oa)))))))
1125
1126(defun add-to-history (history-var newelt &optional maxelt)
1127 "Add NEWELT to the history list stored in the variable HISTORY-VAR.
1128Return the new history list.
1129If MAXELT is non-nil, it specifies the maximum length of the history.
1130Otherwise, the maximum history length is the value of the `history-length'
1131property on symbol HISTORY-VAR, if set, or the value of the `history-length'
1132variable.
1133Remove duplicates of NEWELT unless `history-delete-duplicates' is nil."
1134 (unless maxelt
1135 (setq maxelt (or (get history-var 'history-length)
1136 history-length)))
1137 (let ((history (symbol-value history-var))
1138 tail)
1139 (if history-delete-duplicates
1140 (setq history (delete newelt history)))
1141 (setq history (cons newelt history))
1142 (when (integerp maxelt)
1143 (if (= 0 maxelt)
1144 (setq history nil)
1145 (setq tail (nthcdr (1- maxelt) history))
1146 (when (consp tail)
1147 (setcdr tail nil))))
1148 (set history-var history)))
1149
1125 1150
1126;;;; Mode hooks. 1151;;;; Mode hooks.
1127 1152
@@ -1931,6 +1956,13 @@ Otherwise, return nil."
1931 "Return non-nil if OBJECT is one of the two canonical boolean values: t or nil." 1956 "Return non-nil if OBJECT is one of the two canonical boolean values: t or nil."
1932 (memq object '(nil t))) 1957 (memq object '(nil t)))
1933 1958
1959(defun field-at-pos (pos)
1960 "Return the field at position POS, taking stickiness etc into account"
1961 (let ((raw-field (get-char-property (field-beginning pos) 'field)))
1962 (if (eq raw-field 'boundary)
1963 (get-char-property (1- (field-end pos)) 'field)
1964 raw-field)))
1965
1934 1966
1935;;;; Support for yanking and text properties. 1967;;;; Support for yanking and text properties.
1936 1968
diff --git a/lisp/term.el b/lisp/term.el
index 97d55dc107e..64f0efc767b 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -3318,7 +3318,7 @@ See `term-prompt-regexp'."
3318 ((eq char ?r) 3318 ((eq char ?r)
3319 (term-set-scroll-region 3319 (term-set-scroll-region
3320 (1- term-terminal-previous-parameter) 3320 (1- term-terminal-previous-parameter)
3321 term-terminal-parameter)) 3321 (1- term-terminal-parameter)))
3322 (t))) 3322 (t)))
3323 3323
3324(defun term-set-scroll-region (top bottom) 3324(defun term-set-scroll-region (top bottom)
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el
index fa8934aec9e..b97a3a9ec3a 100644
--- a/lisp/term/mac-win.el
+++ b/lisp/term/mac-win.el
@@ -79,9 +79,11 @@
79(eval-when-compile (require 'url)) 79(eval-when-compile (require 'url))
80 80
81(defvar mac-charset-info-alist) 81(defvar mac-charset-info-alist)
82(defvar mac-services-selection) 82(defvar mac-service-selection)
83(defvar mac-system-script-code) 83(defvar mac-system-script-code)
84(defvar mac-apple-event-map) 84(defvar mac-apple-event-map)
85(defvar mac-atsu-font-table)
86(defvar mac-font-panel-mode)
85(defvar x-invocation-args) 87(defvar x-invocation-args)
86 88
87(defvar x-command-line-resources nil) 89(defvar x-command-line-resources nil)
@@ -1128,6 +1130,17 @@ correspoinding TextEncodingBase value."
1128(mac-add-charset-info "mac-dingbats" 34) 1130(mac-add-charset-info "mac-dingbats" 34)
1129(mac-add-charset-info "iso10646-1" 126) ; for ATSUI 1131(mac-add-charset-info "iso10646-1" 126) ; for ATSUI
1130 1132
1133(defconst mac-system-coding-system
1134 (let ((base (or (cdr (assq mac-system-script-code
1135 mac-script-code-coding-systems))
1136 'mac-roman)))
1137 (if (eq system-type 'darwin)
1138 base
1139 (coding-system-change-eol-conversion base 'mac)))
1140 "Coding system derived from the system script code.")
1141
1142(set-selection-coding-system mac-system-coding-system)
1143
1131 1144
1132;;;; Keyboard layout/language change events 1145;;;; Keyboard layout/language change events
1133(defun mac-handle-language-change (event) 1146(defun mac-handle-language-change (event)
@@ -1141,6 +1154,91 @@ correspoinding TextEncodingBase value."
1141 (define-key key-translation-map [?\x80] "\\")))) 1154 (define-key key-translation-map [?\x80] "\\"))))
1142 1155
1143(define-key special-event-map [language-change] 'mac-handle-language-change) 1156(define-key special-event-map [language-change] 'mac-handle-language-change)
1157
1158
1159;;;; Conversion between common flavors and Lisp string.
1160
1161(defconst mac-text-encoding-mac-japanese-basic-variant #x20001
1162 "MacJapanese text encoding without Apple double-byte extensions.")
1163
1164(defun mac-utxt-to-string (data &optional coding-system)
1165 (or coding-system (setq coding-system mac-system-coding-system))
1166 (let* ((encoding
1167 (and (eq system-type 'darwin)
1168 (eq (coding-system-base coding-system) 'japanese-shift-jis)
1169 mac-text-encoding-mac-japanese-basic-variant))
1170 (str (and (fboundp 'mac-code-convert-string)
1171 (mac-code-convert-string data nil
1172 (or encoding coding-system)))))
1173 (when str
1174 (setq str (decode-coding-string str coding-system))
1175 (if (eq encoding mac-text-encoding-mac-japanese-basic-variant)
1176 ;; Does it contain Apple one-byte extensions other than
1177 ;; reverse solidus?
1178 (if (string-match "[\xa0\xfd-\xff]" str)
1179 (setq str nil)
1180 ;; ASCII-only?
1181 (unless (string-match "\\`[[:ascii:]]*\\'" str)
1182 (subst-char-in-string ?\x5c ?\(J\(B str t)
1183 (subst-char-in-string ?\x80 ?\\ str t)))))
1184 (or str
1185 (decode-coding-string data
1186 (if (eq (byteorder) ?B) 'utf-16be 'utf-16le)))))
1187
1188(defun mac-string-to-utxt (string &optional coding-system)
1189 (or coding-system (setq coding-system mac-system-coding-system))
1190 (let (data encoding)
1191 (when (and (fboundp 'mac-code-convert-string)
1192 (memq (coding-system-base coding-system)
1193 (find-coding-systems-string string)))
1194 (setq coding-system
1195 (coding-system-change-eol-conversion coding-system 'mac))
1196 (when (and (eq system-type 'darwin)
1197 (eq coding-system 'japanese-shift-jis-mac))
1198 (setq encoding mac-text-encoding-mac-japanese-basic-variant)
1199 (setq string (subst-char-in-string ?\\ ?\x80 string))
1200 (subst-char-in-string ?\(J\(B ?\x5c string t))
1201 (setq data (mac-code-convert-string
1202 (encode-coding-string string coding-system)
1203 (or encoding coding-system) nil)))
1204 (or data (encode-coding-string string (if (eq (byteorder) ?B)
1205 'utf-16be-mac
1206 'utf-16le-mac)))))
1207
1208(defun mac-TEXT-to-string (data &optional coding-system)
1209 (or coding-system (setq coding-system mac-system-coding-system))
1210 (prog1 (setq data (decode-coding-string data coding-system))
1211 (when (eq (coding-system-base coding-system) 'japanese-shift-jis)
1212 ;; (subst-char-in-string ?\x5c ?\(J\(B data t)
1213 (subst-char-in-string ?\x80 ?\\ data t))))
1214
1215(defun mac-string-to-TEXT (string &optional coding-system)
1216 (or coding-system (setq coding-system mac-system-coding-system))
1217 (let ((encodables (find-coding-systems-string string))
1218 (rest mac-script-code-coding-systems))
1219 (unless (memq (coding-system-base coding-system) encodables)
1220 (while (and rest (not (memq (cdar rest) encodables)))
1221 (setq rest (cdr rest)))
1222 (if rest
1223 (setq coding-system (cdar rest)))))
1224 (setq coding-system
1225 (coding-system-change-eol-conversion coding-system 'mac))
1226 (when (eq coding-system 'japanese-shift-jis-mac)
1227 ;; (setq string (subst-char-in-string ?\\ ?\x80 string))
1228 (setq string (subst-char-in-string ?\(J\(B ?\x5c string)))
1229 (encode-coding-string string coding-system))
1230
1231(defun mac-furl-to-string (data)
1232 ;; Remove a trailing nul character.
1233 (let ((len (length data)))
1234 (if (and (> len 0) (= (aref data (1- len)) ?\0))
1235 (substring data 0 (1- len))
1236 data)))
1237
1238(defun mac-TIFF-to-string (data &optional text)
1239 (prog1 (or text (setq text (copy-sequence " ")))
1240 (put-text-property 0 (length text) 'display (create-image data 'tiff t)
1241 text)))
1144 1242
1145;;;; Selections 1243;;;; Selections
1146 1244
@@ -1190,22 +1288,11 @@ in `selection-converter-alist', which see."
1190 (when (and (stringp data) 1288 (when (and (stringp data)
1191 (setq data-type (get-text-property 0 'foreign-selection data))) 1289 (setq data-type (get-text-property 0 'foreign-selection data)))
1192 (cond ((eq data-type 'public.utf16-plain-text) 1290 (cond ((eq data-type 'public.utf16-plain-text)
1193 (let ((encoded (and (fboundp 'mac-code-convert-string) 1291 (setq data (mac-utxt-to-string data coding)))
1194 (mac-code-convert-string data nil coding))))
1195 (if encoded
1196 (setq data (decode-coding-string encoded coding))
1197 (setq data
1198 (decode-coding-string data
1199 (if (eq (byteorder) ?B)
1200 'utf-16be 'utf-16le))))))
1201 ((eq data-type 'com.apple.traditional-mac-plain-text) 1292 ((eq data-type 'com.apple.traditional-mac-plain-text)
1202 (setq data (decode-coding-string data coding))) 1293 (setq data (mac-TEXT-to-string data coding)))
1203 ((eq data-type 'public.file-url) 1294 ((eq data-type 'public.file-url)
1204 (setq data (decode-coding-string data 'utf-8)) 1295 (setq data (mac-furl-to-string data))))
1205 ;; Remove a trailing nul character.
1206 (let ((len (length data)))
1207 (if (and (> len 0) (= (aref data (1- len)) ?\0))
1208 (setq data (substring data 0 (1- len)))))))
1209 (put-text-property 0 (length data) 'foreign-selection data-type data)) 1296 (put-text-property 0 (length data) 'foreign-selection data-type data))
1210 data)) 1297 data))
1211 1298
@@ -1227,9 +1314,7 @@ in `selection-converter-alist', which see."
1227 (when tiff-image 1314 (when tiff-image
1228 (remove-text-properties 0 (length tiff-image) 1315 (remove-text-properties 0 (length tiff-image)
1229 '(foreign-selection nil) tiff-image) 1316 '(foreign-selection nil) tiff-image)
1230 (setq tiff-image (create-image tiff-image 'tiff t)) 1317 (setq text (mac-TIFF-to-string tiff-image text)))
1231 (or text (setq text " "))
1232 (put-text-property 0 (length text) 'display tiff-image text))
1233 text)) 1318 text))
1234 1319
1235;;; Return the value of the current selection. 1320;;; Return the value of the current selection.
@@ -1300,11 +1385,7 @@ in `selection-converter-alist', which see."
1300 1385
1301(defun mac-select-convert-to-string (selection type value) 1386(defun mac-select-convert-to-string (selection type value)
1302 (let ((str (cdr (xselect-convert-to-string selection nil value))) 1387 (let ((str (cdr (xselect-convert-to-string selection nil value)))
1303 coding) 1388 (coding (or next-selection-coding-system selection-coding-system)))
1304 (setq coding (or next-selection-coding-system selection-coding-system))
1305 (if coding
1306 (setq coding (coding-system-base coding))
1307 (setq coding 'raw-text))
1308 (when str 1389 (when str
1309 ;; If TYPE is nil, this is a local request, thus return STR as 1390 ;; If TYPE is nil, this is a local request, thus return STR as
1310 ;; is. Otherwise, encode STR. 1391 ;; is. Otherwise, encode STR.
@@ -1314,28 +1395,9 @@ in `selection-converter-alist', which see."
1314 (remove-text-properties 0 (length str) '(composition nil) str) 1395 (remove-text-properties 0 (length str) '(composition nil) str)
1315 (cond 1396 (cond
1316 ((eq type 'public.utf16-plain-text) 1397 ((eq type 'public.utf16-plain-text)
1317 (let (s) 1398 (setq str (mac-string-to-utxt str coding)))
1318 (when (and (fboundp 'mac-code-convert-string)
1319 (memq coding (find-coding-systems-string str)))
1320 (setq coding (coding-system-change-eol-conversion coding 'mac))
1321 (setq s (mac-code-convert-string
1322 (encode-coding-string str coding)
1323 coding nil)))
1324 (setq str (or s
1325 (encode-coding-string str
1326 (if (eq (byteorder) ?B)
1327 'utf-16be-mac
1328 'utf-16le-mac))))))
1329 ((eq type 'com.apple.traditional-mac-plain-text) 1399 ((eq type 'com.apple.traditional-mac-plain-text)
1330 (let ((encodables (find-coding-systems-string str)) 1400 (setq str (mac-string-to-TEXT str coding)))
1331 (rest mac-script-code-coding-systems))
1332 (unless (memq coding encodables)
1333 (while (and rest (not (memq (cdar rest) encodables)))
1334 (setq rest (cdr rest)))
1335 (if rest
1336 (setq coding (cdar rest)))))
1337 (setq coding (coding-system-change-eol-conversion coding 'mac))
1338 (setq str (encode-coding-string str coding)))
1339 (t 1401 (t
1340 (error "Unknown selection type: %S" type)) 1402 (error "Unknown selection type: %S" type))
1341 ))) 1403 )))
@@ -1433,6 +1495,17 @@ in `selection-converter-alist', which see."
1433 (ash (lsh result extended-sign-len) (- extended-sign-len)) 1495 (ash (lsh result extended-sign-len) (- extended-sign-len))
1434 result))) 1496 result)))
1435 1497
1498(defun mac-bytes-to-digits (bytes &optional from to)
1499 (or from (setq from 0))
1500 (or to (setq to (length bytes)))
1501 (let ((len (- to from))
1502 (val 0.0))
1503 (dotimes (i len)
1504 (setq val (+ (* val 256.0)
1505 (aref bytes (+ from (if (eq (byteorder) ?B) i
1506 (- len i 1)))))))
1507 (format "%.0f" val)))
1508
1436(defun mac-ae-selection-range (ae) 1509(defun mac-ae-selection-range (ae)
1437;; #pragma options align=mac68k 1510;; #pragma options align=mac68k
1438;; typedef struct SelectionRange { 1511;; typedef struct SelectionRange {
@@ -1518,37 +1591,109 @@ Currently the `mailto' scheme is supported."
1518 1591
1519(define-key mac-apple-event-map [hicommand about] 'display-splash-screen) 1592(define-key mac-apple-event-map [hicommand about] 'display-splash-screen)
1520 1593
1521(defun mac-services-open-file () 1594;;; Converted Carbon Events
1595(defun mac-handle-toolbar-switch-mode (event)
1596 "Toggle visibility of tool-bars in response to EVENT.
1597With no keyboard modifiers, it toggles the visibility of the
1598frame where the tool-bar toggle button was pressed. With some
1599modifiers, it changes global tool-bar visibility setting."
1600 (interactive "e")
1601 (let* ((ae (mac-event-ae event))
1602 (modifiers (cdr (mac-ae-parameter ae "kmod"))))
1603 (if (and modifiers (not (string= modifiers "\000\000\000\000")))
1604 ;; Globally toggle tool-bar-mode if some modifier key is pressed.
1605 (tool-bar-mode)
1606 (let ((window-id (mac-bytes-to-digits (cdr (mac-ae-parameter ae))))
1607 (rest (frame-list))
1608 frame)
1609 (while (and (null frame) rest)
1610 (if (string= (frame-parameter (car rest) 'window-id) window-id)
1611 (setq frame (car rest)))
1612 (setq rest (cdr rest)))
1613 (set-frame-parameter frame 'tool-bar-lines
1614 (if (= (frame-parameter frame 'tool-bar-lines) 0)
1615 1 0))))))
1616
1617;; kEventClassWindow/kEventWindowToolbarSwitchMode
1618(define-key mac-apple-event-map [window toolbar-switch-mode]
1619 'mac-handle-toolbar-switch-mode)
1620
1621;;; Font panel
1622(when (fboundp 'mac-set-font-panel-visibility)
1623
1624(define-minor-mode mac-font-panel-mode
1625 "Toggle use of the font panel.
1626With numeric ARG, display the font panel if and only if ARG is positive."
1627 :init-value nil
1628 :global t
1629 :group 'mac
1630 (mac-set-font-panel-visibility mac-font-panel-mode))
1631
1632(defun mac-handle-font-panel-closed (event)
1633 "Update internal status in response to font panel closed EVENT."
1634 (interactive "e")
1635 ;; Synchronize with the minor mode variable.
1636 (mac-font-panel-mode 0))
1637
1638(defun mac-handle-font-selection (event)
1639 "Change default face attributes according to font selection EVENT."
1640 (interactive "e")
1641 (let* ((ae (mac-event-ae event))
1642 (fm-font-size (cdr (mac-ae-parameter ae "fmsz")))
1643 (atsu-font-id (cdr (mac-ae-parameter ae "auid")))
1644 (attribute-values (gethash atsu-font-id mac-atsu-font-table)))
1645 (if fm-font-size
1646 (setq attribute-values
1647 `(:height ,(* 10 (mac-bytes-to-integer fm-font-size))
1648 ,@attribute-values)))
1649 (apply 'set-face-attribute 'default (selected-frame) attribute-values)))
1650
1651;; kEventClassFont/kEventFontPanelClosed
1652(define-key mac-apple-event-map [font panel-closed]
1653 'mac-handle-font-panel-closed)
1654;; kEventClassFont/kEventFontSelection
1655(define-key mac-apple-event-map [font selection] 'mac-handle-font-selection)
1656
1657(define-key-after menu-bar-showhide-menu [mac-font-panel-mode]
1658 (menu-bar-make-mm-toggle mac-font-panel-mode
1659 "Font Panel"
1660 "Show the font panel as a floating dialog")
1661 'showhide-speedbar)
1662
1663) ;; (fboundp 'mac-set-font-panel-visibility)
1664
1665;;; Services
1666(defun mac-service-open-file ()
1522 "Open the file specified by the selection value for Services." 1667 "Open the file specified by the selection value for Services."
1523 (interactive) 1668 (interactive)
1524 (find-file-existing (x-selection-value mac-services-selection))) 1669 (find-file-existing (x-selection-value mac-service-selection)))
1525 1670
1526(defun mac-services-open-selection () 1671(defun mac-service-open-selection ()
1527 "Create a new buffer containing the selection value for Services." 1672 "Create a new buffer containing the selection value for Services."
1528 (interactive) 1673 (interactive)
1529 (switch-to-buffer (generate-new-buffer "*untitled*")) 1674 (switch-to-buffer (generate-new-buffer "*untitled*"))
1530 (insert (x-selection-value mac-services-selection)) 1675 (insert (x-selection-value mac-service-selection))
1531 (sit-for 0) 1676 (sit-for 0)
1532 (save-buffer) ; It pops up the save dialog. 1677 (save-buffer) ; It pops up the save dialog.
1533 ) 1678 )
1534 1679
1535(defun mac-services-mail-selection () 1680(defun mac-service-mail-selection ()
1536 "Prepare a mail buffer containing the selection value for Services." 1681 "Prepare a mail buffer containing the selection value for Services."
1537 (interactive) 1682 (interactive)
1538 (compose-mail) 1683 (compose-mail)
1539 (rfc822-goto-eoh) 1684 (rfc822-goto-eoh)
1540 (forward-line 1) 1685 (forward-line 1)
1541 (insert (x-selection-value mac-services-selection) "\n")) 1686 (insert (x-selection-value mac-service-selection) "\n"))
1542 1687
1543(defun mac-services-mail-to () 1688(defun mac-service-mail-to ()
1544 "Prepare a mail buffer to be sent to the selection value for Services." 1689 "Prepare a mail buffer to be sent to the selection value for Services."
1545 (interactive) 1690 (interactive)
1546 (compose-mail (x-selection-value mac-services-selection))) 1691 (compose-mail (x-selection-value mac-service-selection)))
1547 1692
1548(defun mac-services-insert-text () 1693(defun mac-service-insert-text ()
1549 "Insert the selection value for Services." 1694 "Insert the selection value for Services."
1550 (interactive) 1695 (interactive)
1551 (let ((text (x-selection-value mac-services-selection))) 1696 (let ((text (x-selection-value mac-service-selection)))
1552 (if (not buffer-read-only) 1697 (if (not buffer-read-only)
1553 (insert text) 1698 (insert text)
1554 (kill-new text) 1699 (kill-new text)
@@ -1556,15 +1701,17 @@ Currently the `mailto' scheme is supported."
1556 (substitute-command-keys 1701 (substitute-command-keys
1557 "The text from the Services menu can be accessed with \\[yank]"))))) 1702 "The text from the Services menu can be accessed with \\[yank]")))))
1558 1703
1559(define-key mac-apple-event-map [services paste] 'mac-services-insert-text) 1704;; kEventClassService/kEventServicePaste
1560(define-key mac-apple-event-map [services perform open-file] 1705(define-key mac-apple-event-map [service paste] 'mac-service-insert-text)
1561 'mac-services-open-file) 1706;; kEventClassService/kEventServicePerform
1562(define-key mac-apple-event-map [services perform open-selection] 1707(define-key mac-apple-event-map [service perform open-file]
1563 'mac-services-open-selection) 1708 'mac-service-open-file)
1564(define-key mac-apple-event-map [services perform mail-selection] 1709(define-key mac-apple-event-map [service perform open-selection]
1565 'mac-services-mail-selection) 1710 'mac-service-open-selection)
1566(define-key mac-apple-event-map [services perform mail-to] 1711(define-key mac-apple-event-map [service perform mail-selection]
1567 'mac-services-mail-to) 1712 'mac-service-mail-selection)
1713(define-key mac-apple-event-map [service perform mail-to]
1714 'mac-service-mail-to)
1568 1715
1569(defun mac-dispatch-apple-event (event) 1716(defun mac-dispatch-apple-event (event)
1570 "Dispatch EVENT according to the keymap `mac-apple-event-map'." 1717 "Dispatch EVENT according to the keymap `mac-apple-event-map'."
@@ -1589,6 +1736,83 @@ Currently the `mailto' scheme is supported."
1589;; processed when the initial frame has been created: this is where 1736;; processed when the initial frame has been created: this is where
1590;; the files should be opened. 1737;; the files should be opened.
1591(add-hook 'after-init-hook 'mac-process-deferred-apple-events) 1738(add-hook 'after-init-hook 'mac-process-deferred-apple-events)
1739
1740
1741;;;; Drag and drop
1742
1743(defcustom mac-dnd-types-alist
1744 '(("furl" . mac-dnd-handle-furl)
1745 ("hfs " . mac-dnd-handle-hfs)
1746 ("utxt" . mac-dnd-insert-utxt)
1747 ("TEXT" . mac-dnd-insert-TEXT)
1748 ("TIFF" . mac-dnd-insert-TIFF))
1749 "Which function to call to handle a drop of that type.
1750The function takes three arguments, WINDOW, ACTION and DATA.
1751WINDOW is where the drop occured, ACTION is always `private' on
1752Mac. DATA is the drop data. Unlike the x-dnd counterpart, the
1753return value of the function is not significant.
1754
1755See also `mac-dnd-known-types'."
1756 :version "22.1"
1757 :type 'alist
1758 :group 'mac)
1759
1760(defun mac-dnd-handle-furl (window action data)
1761 (dnd-handle-one-url window action (mac-furl-to-string data)))
1762
1763(defun mac-dnd-handle-hfs (window action data)
1764;; struct HFSFlavor {
1765;; OSType fileType;
1766;; OSType fileCreator;
1767;; UInt16 fdFlags;
1768;; FSSpec fileSpec;
1769;; };
1770 (let* ((file-name (mac-coerce-ae-data "fss " (substring data 10)
1771 'undecoded-file-name))
1772 (url (concat "file://"
1773 (mapconcat 'url-hexify-string
1774 (split-string file-name "/") "/"))))
1775 (dnd-handle-one-url window action url)))
1776
1777(defun mac-dnd-insert-utxt (window action data)
1778 (dnd-insert-text window action (mac-utxt-to-string data)))
1779
1780(defun mac-dnd-insert-TEXT (window action data)
1781 (dnd-insert-text window action (mac-TEXT-to-string data)))
1782
1783(defun mac-dnd-insert-TIFF (window action data)
1784 (dnd-insert-text window action (mac-TIFF-to-string data)))
1785
1786(defun mac-dnd-drop-data (event frame window data type)
1787 (let* ((type-info (assoc type mac-dnd-types-alist))
1788 (handler (cdr type-info))
1789 (action 'private)
1790 (w (posn-window (event-start event))))
1791 (when handler
1792 (if (and (windowp w) (window-live-p w)
1793 (not (window-minibuffer-p w))
1794 (not (window-dedicated-p w)))
1795 ;; If dropping in an ordinary window which we could use,
1796 ;; let dnd-open-file-other-window specify what to do.
1797 (progn
1798 (goto-char (posn-point (event-start event)))
1799 (funcall handler window action data))
1800 ;; If we can't display the file here,
1801 ;; make a new window for it.
1802 (let ((dnd-open-file-other-window t))
1803 (select-frame frame)
1804 (funcall handler window action data))))))
1805
1806(defun mac-dnd-handle-drag-n-drop-event (event)
1807 "Receive drag and drop events."
1808 (interactive "e")
1809 (let ((window (posn-window (event-start event))))
1810 (when (windowp window) (select-window window))
1811 (dolist (item (mac-ae-list (mac-event-ae event)))
1812 (if (not (equal (car item) "null"))
1813 (mac-dnd-drop-data event (selected-frame) window
1814 (cdr item) (car item)))))
1815 (select-frame-set-input-focus (selected-frame)))
1592 1816
1593;;; Do the actual Windows setup here; the above code just defines 1817;;; Do the actual Windows setup here; the above code just defines
1594;;; functions and variables that we use now. 1818;;; functions and variables that we use now.
@@ -1884,37 +2108,11 @@ It returns a name of the created fontset."
1884;; Enable CLIPBOARD copy/paste through menu bar commands. 2108;; Enable CLIPBOARD copy/paste through menu bar commands.
1885(menu-bar-enable-clipboard) 2109(menu-bar-enable-clipboard)
1886 2110
1887(defconst mac-system-coding-system 2111;; Initiate drag and drop
1888 (let ((base (or (cdr (assq mac-system-script-code
1889 mac-script-code-coding-systems))
1890 'mac-roman)))
1891 (if (eq system-type 'darwin)
1892 base
1893 (coding-system-change-eol-conversion base 'mac)))
1894 "Coding system derived from the system script code.")
1895 2112
1896(set-selection-coding-system mac-system-coding-system) 2113(global-set-key [drag-n-drop] 'mac-dnd-handle-drag-n-drop-event)
2114(global-set-key [M-drag-n-drop] 'mac-dnd-handle-drag-n-drop-event)
1897 2115
1898(defun mac-drag-n-drop (event)
1899 "Edit the files listed in the drag-n-drop EVENT.
1900Switch to a buffer editing the last file dropped."
1901 (interactive "e")
1902 ;; Make sure the drop target has positive co-ords
1903 ;; before setting the selected frame - otherwise it
1904 ;; won't work. <skx@tardis.ed.ac.uk>
1905 (let* ((window (posn-window (event-start event)))
1906 (coords (posn-x-y (event-start event)))
1907 (x (car coords))
1908 (y (cdr coords)))
1909 (if (and (> x 0) (> y 0))
1910 (set-frame-selected-window nil window))
1911 (dolist (file-name (nth 2 event))
1912 (dnd-handle-one-url window 'private
1913 (concat "file:" file-name))))
1914 (select-frame-set-input-focus (selected-frame)))
1915
1916(global-set-key [drag-n-drop] 'mac-drag-n-drop)
1917(global-set-key [M-drag-n-drop] 'mac-drag-n-drop)
1918 2116
1919;;;; Non-toolkit Scroll bars 2117;;;; Non-toolkit Scroll bars
1920 2118
@@ -1979,6 +2177,7 @@ Switch to a buffer editing the last file dropped."
1979 (scroll-up 1))) 2177 (scroll-up 1)))
1980 2178
1981) 2179)
2180
1982 2181
1983;;;; Others 2182;;;; Others
1984 2183
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index 9cb7253b642..9ce9f34da96 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -227,6 +227,14 @@
227 227
228 (define-key map "\e[4~" [select]) 228 (define-key map "\e[4~" [select])
229 (define-key map "\e[29~" [print]) 229 (define-key map "\e[29~" [print])
230
231 ;; These keys will be available xterm starting probably from
232 ;; version 214.
233 (define-key map "\e[27;5;8~" [(control ?\t)])
234 (define-key map "\e[27;5;44~" [(control ?\,)])
235 (define-key map "\e[27;5;46~" [(control ?\.)])
236 (define-key map "\e[27;5;47~" [(control ?\/)])
237 (define-key map "\e[27;5;92~" [(control ?\\)])
230 238
231 ;; Other versions of xterm might emit these. 239 ;; Other versions of xterm might emit these.
232 (define-key map "\e[A" [up]) 240 (define-key map "\e[A" [up])
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index b83997baa2e..5629e8feb31 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -2577,15 +2577,18 @@ By just answering RET you can find out what the current dictionary is."
2577 (mapcar 'list (ispell-valid-dictionary-list))) 2577 (mapcar 'list (ispell-valid-dictionary-list)))
2578 nil t) 2578 nil t)
2579 current-prefix-arg)) 2579 current-prefix-arg))
2580 (unless arg (ispell-buffer-local-dict)) 2580 (unless arg (ispell-buffer-local-dict 'no-reload))
2581 (if (equal dict "default") (setq dict nil)) 2581 (if (equal dict "default") (setq dict nil))
2582 ;; This relies on completing-read's bug of returning "" for no match 2582 ;; This relies on completing-read's bug of returning "" for no match
2583 (cond ((equal dict "") 2583 (cond ((equal dict "")
2584 (ispell-internal-change-dictionary)
2584 (message "Using %s dictionary" 2585 (message "Using %s dictionary"
2585 (or ispell-local-dictionary ispell-dictionary "default"))) 2586 (or ispell-local-dictionary ispell-dictionary "default")))
2586 ((equal dict (or ispell-local-dictionary 2587 ((equal dict (or ispell-local-dictionary
2587 ispell-dictionary "default")) 2588 ispell-dictionary "default"))
2588 ;; Specified dictionary is the default already. No-op 2589 ;; Specified dictionary is the default already. Could reload
2590 ;; the dictionaries if needed.
2591 (ispell-internal-change-dictionary)
2589 (and (interactive-p) 2592 (and (interactive-p)
2590 (message "No change, using %s dictionary" dict))) 2593 (message "No change, using %s dictionary" dict)))
2591 (t ; reset dictionary! 2594 (t ; reset dictionary!
@@ -2604,13 +2607,16 @@ By just answering RET you can find out what the current dictionary is."
2604 dict)))) 2607 dict))))
2605 2608
2606(defun ispell-internal-change-dictionary () 2609(defun ispell-internal-change-dictionary ()
2607 "Update the dictionary actually used by Ispell. 2610 "Update the dictionary and the personal dictionary used by Ispell.
2608This may kill the Ispell process; if so, 2611This may kill the Ispell process; if so,
2609a new one will be started when needed." 2612a new one will be started when needed."
2610 (let ((dict (or ispell-local-dictionary ispell-dictionary))) 2613 (let ((dict (or ispell-local-dictionary ispell-dictionary))
2611 (unless (equal ispell-current-dictionary dict) 2614 (pdict (or ispell-local-pdict ispell-personal-dictionary)))
2615 (unless (and (equal ispell-current-dictionary dict)
2616 (equal ispell-current-personal-dictionary pdict))
2612 (ispell-kill-ispell t) 2617 (ispell-kill-ispell t)
2613 (setq ispell-current-dictionary dict)))) 2618 (setq ispell-current-dictionary dict
2619 ispell-current-personal-dictionary pdict))))
2614 2620
2615;;; Spelling of comments are checked when ispell-check-comments is non-nil. 2621;;; Spelling of comments are checked when ispell-check-comments is non-nil.
2616 2622
@@ -3637,8 +3643,9 @@ Includes Latex/Nroff modes and extended character mode."
3637 3643
3638;;; Can kill the current ispell process 3644;;; Can kill the current ispell process
3639 3645
3640(defun ispell-buffer-local-dict () 3646(defun ispell-buffer-local-dict (&optional no-reload)
3641 "Initializes local dictionary and local personal dictionary. 3647 "Initializes local dictionary and local personal dictionary.
3648If optional NO-RELOAD is non-nil, do not make any dictionary reloading.
3642When a dictionary is defined in the buffer (see variable 3649When a dictionary is defined in the buffer (see variable
3643`ispell-dictionary-keyword'), it will override the local setting 3650`ispell-dictionary-keyword'), it will override the local setting
3644from \\[ispell-change-dictionary]. 3651from \\[ispell-change-dictionary].
@@ -3665,12 +3672,9 @@ Both should not be used to define a buffer-local dictionary."
3665 (if (re-search-forward " *\\([^ \"]+\\)" end t) 3672 (if (re-search-forward " *\\([^ \"]+\\)" end t)
3666 (setq ispell-local-pdict 3673 (setq ispell-local-pdict
3667 (match-string-no-properties 1))))))) 3674 (match-string-no-properties 1)))))))
3668 ;; Reload if new personal dictionary defined. 3675 (unless no-reload
3669 (if (not (equal ispell-current-personal-dictionary 3676 ;; Reload if new dictionary (maybe the personal one) defined.
3670 (or ispell-local-pdict ispell-personal-dictionary))) 3677 (ispell-internal-change-dictionary)))
3671 (ispell-kill-ispell t))
3672 ;; Reload if new dictionary defined.
3673 (ispell-internal-change-dictionary))
3674 3678
3675 3679
3676(defun ispell-buffer-local-words () 3680(defun ispell-buffer-local-words ()
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index 92bdf480e06..1c3e383c9fb 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,8 @@
12006-05-05 Andreas Seltenreich <seltenreich@gmx.de> (tiny change)
2
3 * url-http.el (url-http-parse-headers): Don't reuse connection if
4 "Connection: close" header was seen.
5
12006-04-26 Stefan Monnier <monnier@iro.umontreal.ca> 62006-04-26 Stefan Monnier <monnier@iro.umontreal.ca>
2 7
3 * url-gw.el (url-open-stream): Don't hide errors. 8 * url-gw.el (url-open-stream): Don't hide errors.
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index c401094593e..45bf97ec6b6 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -386,6 +386,10 @@ should be shown to the user."
386 (url-http-parse-response) 386 (url-http-parse-response)
387 (mail-narrow-to-head) 387 (mail-narrow-to-head)
388 ;;(narrow-to-region (point-min) url-http-end-of-headers) 388 ;;(narrow-to-region (point-min) url-http-end-of-headers)
389 (let ((connection (mail-fetch-field "Connection")))
390 (if (and connection
391 (string= (downcase connection) "close"))
392 (delete-process url-http-process)))
389 (let ((class nil) 393 (let ((class nil)
390 (success nil)) 394 (success nil))
391 (setq class (/ url-http-response-status 100)) 395 (setq class (/ url-http-response-status 100))
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index 020e667ec16..56e6dc9ba3f 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,48 @@
12006-05-10 Reiner Steib <Reiner.Steib@gmx.de>
2
3 * variables.texi (File Local Variables): Recommend to quote lambda
4 expressions in safe-local-variable property.
5
62006-05-09 Richard Stallman <rms@gnu.org>
7
8 * variables.texi (File Local Variables): Document
9 safe-local-eval-forms and safe-local-eval-function.
10
112006-05-07 Kim F. Storm <storm@cua.dk>
12
13 * minibuf.texi (Minibuffer History): Remove keep-dups arg
14 from add-to-history.
15
162006-05-07 Romain Francoise <romain@orebokech.com>
17
18 * commands.texi (Event Input Misc):
19 * compile.texi (Eval During Compile):
20 * internals.texi (Buffer Internals):
21 * minibuf.texi (Initial Input):
22 * nonascii.texi (Scanning Charsets):
23 * numbers.texi (Comparison of Numbers):
24 * windows.texi (Textual Scrolling, Vertical Scrolling):
25 Fix various typos.
26
272006-05-06 Eli Zaretskii <eliz@gnu.org>
28
29 * hooks.texi (Standard Hooks): Replace inforef to emacs-xtra by
30 conditional xref's to either emacs or emacs-xtra, depending on
31 @iftex/@ifnottex.
32
33 * minibuf.texi (Minibuffer History): Document add-to-history.
34
352006-05-05 Eli Zaretskii <eliz@gnu.org>
36
37 * internals.texi (Pure Storage): Mention the pure overflow message
38 at startup.
39
402006-05-05 Johan Bockg,Ae(Brd <bojohan@dd.chalmers.se>
41
42 * keymaps.texi (Active Keymaps): Fix pseudo-Lisp syntax.
43 (Searching Keymaps): Fix pseudo-Lisp description of keymap
44 search.
45
12006-05-01 Richard Stallman <rms@gnu.org> 462006-05-01 Richard Stallman <rms@gnu.org>
2 47
3 * intro.texi (nil and t): Clarify. 48 * intro.texi (nil and t): Clarify.
diff --git a/lispref/commands.texi b/lispref/commands.texi
index 797a5ced8e9..fa5d95f0408 100644
--- a/lispref/commands.texi
+++ b/lispref/commands.texi
@@ -2451,7 +2451,7 @@ If a part of @var{body} binds @code{inhibit-quit} to non-@code{nil},
2451arrival of input during those parts won't cause an abort until 2451arrival of input during those parts won't cause an abort until
2452the end of that part. 2452the end of that part.
2453 2453
2454If you want to be able to distingish all possible values computed 2454If you want to be able to distinguish all possible values computed
2455by @var{body} from both kinds of abort conditions, write the code 2455by @var{body} from both kinds of abort conditions, write the code
2456like this: 2456like this:
2457 2457
diff --git a/lispref/compile.texi b/lispref/compile.texi
index 1d8823a48c5..4b796697731 100644
--- a/lispref/compile.texi
+++ b/lispref/compile.texi
@@ -412,7 +412,7 @@ automatically @code{eval-and-compile}, the package is loaded both when
412compiling and executing. 412compiling and executing.
413 413
414@code{autoload} is also effectively @code{eval-and-compile} too. It's 414@code{autoload} is also effectively @code{eval-and-compile} too. It's
415recognised when compiling, so uses of such a function don't produce 415recognized when compiling, so uses of such a function don't produce
416``not known to be defined'' warnings. 416``not known to be defined'' warnings.
417 417
418Most uses of @code{eval-and-compile} are fairly sophisticated. 418Most uses of @code{eval-and-compile} are fairly sophisticated.
@@ -456,7 +456,7 @@ used to load it for compiling, but not executing. For example,
456The same sort of thing goes for macros or @code{defalias}es defined 456The same sort of thing goes for macros or @code{defalias}es defined
457locally and only for use within the file. They can be defined while 457locally and only for use within the file. They can be defined while
458compiling, but then not needed when executing. This is good for code 458compiling, but then not needed when executing. This is good for code
459that's only a fallback for compability with other versions of Emacs. 459that's only a fallback for compatibility with other versions of Emacs.
460For example. 460For example.
461 461
462@lisp 462@lisp
diff --git a/lispref/files.texi b/lispref/files.texi
index 4d3cfd52c94..8a566f62ee0 100644
--- a/lispref/files.texi
+++ b/lispref/files.texi
@@ -1602,7 +1602,7 @@ directory name (@pxref{Directory Names}), or @code{nil} if
1602@var{filename} does not include a directory part. 1602@var{filename} does not include a directory part.
1603 1603
1604On GNU and Unix systems, a string returned by this function always 1604On GNU and Unix systems, a string returned by this function always
1605ends in a slash. On MSDOS it can also end in a colon. On VMS, it 1605ends in a slash. On MS-DOS it can also end in a colon. On VMS, it
1606returns a string ending in one of the three characters @samp{:}, 1606returns a string ending in one of the three characters @samp{:},
1607@samp{]}, or @samp{>}. 1607@samp{]}, or @samp{>}.
1608 1608
@@ -1809,7 +1809,7 @@ the directory name but not identical to it. (This is not quite the
1809same as the usual Unix terminology.) These two different names for 1809same as the usual Unix terminology.) These two different names for
1810the same entity are related by a syntactic transformation. On GNU and 1810the same entity are related by a syntactic transformation. On GNU and
1811Unix systems, this is simple: a directory name ends in a slash, 1811Unix systems, this is simple: a directory name ends in a slash,
1812whereas the directory's name as a file lacks that slash. On MSDOS and 1812whereas the directory's name as a file lacks that slash. On MS-DOS and
1813VMS, the relationship is more complicated. 1813VMS, the relationship is more complicated.
1814 1814
1815 The difference between a directory name and its name as a file is 1815 The difference between a directory name and its name as a file is
diff --git a/lispref/hooks.texi b/lispref/hooks.texi
index 562d728339e..4dcc5f5b51c 100644
--- a/lispref/hooks.texi
+++ b/lispref/hooks.texi
@@ -87,7 +87,13 @@ or their values are used). The variables whose names end in
87@xref{Lazy Properties}. 87@xref{Lazy Properties}.
88 88
89@item calendar-load-hook 89@item calendar-load-hook
90@inforef{Calendar Customizing,, emacs-xtra}. 90@iftex
91@xref{Calendar Customizing,,, emacs-xtra}.
92@end iftex
93@ifnottex
94@xref{Calendar Customizing,,, emacs}.
95@end ifnottex
96
91 97
92@item change-major-mode-hook 98@item change-major-mode-hook
93@xref{Creating Buffer-Local}. 99@xref{Creating Buffer-Local}.
@@ -124,7 +130,12 @@ is useful for truncating history lists, for example. @xref{Saving
124Emacs Sessions,, Saving Emacs Sessions, emacs, the GNU Emacs Manual}. 130Emacs Sessions,, Saving Emacs Sessions, emacs, the GNU Emacs Manual}.
125 131
126@item diary-display-hook 132@item diary-display-hook
127@inforef{Fancy Diary Display,, emacs-xtra}. 133@iftex
134@xref{Fancy Diary Display,,, emacs-xtra}.
135@end iftex
136@ifnottex
137@xref{Fancy Diary Display,,, emacs}.
138@end ifnottex
128 139
129@item diary-hook 140@item diary-hook
130List of functions called after the display of the diary. Can be used 141List of functions called after the display of the diary. Can be used
@@ -170,7 +181,12 @@ for appointment notification.
170@xref{Other Font Lock Variables}. 181@xref{Other Font Lock Variables}.
171 182
172@item initial-calendar-window-hook 183@item initial-calendar-window-hook
173@inforef{Calendar Customizing,, emacs-xtra}. 184@iftex
185@xref{Calendar Customizing,,, emacs-xtra}.
186@end iftex
187@ifnottex
188@xref{Calendar Customizing,,, emacs}.
189@end ifnottex
174 190
175@item kbd-macro-termination-hook 191@item kbd-macro-termination-hook
176@xref{Keyboard Macros}. 192@xref{Keyboard Macros}.
@@ -190,14 +206,24 @@ for appointment notification.
190@item lisp-indent-function 206@item lisp-indent-function
191 207
192@item list-diary-entries-hook 208@item list-diary-entries-hook
193@inforef{Fancy Diary Display,, emacs-xtra}. 209@iftex
210@xref{Fancy Diary Display,,, emacs-xtra}.
211@end iftex
212@ifnottex
213@xref{Fancy Diary Display,,, emacs}.
214@end ifnottex
194 215
195@item mail-setup-hook 216@item mail-setup-hook
196@xref{Mail Mode Misc,, Mail Mode Miscellany, emacs, the GNU Emacs 217@xref{Mail Mode Misc,, Mail Mode Miscellany, emacs, the GNU Emacs
197Manual}. 218Manual}.
198 219
199@item mark-diary-entries-hook 220@item mark-diary-entries-hook
200@inforef{Fancy Diary Display,, emacs-xtra}. 221@iftex
222@xref{Fancy Diary Display,,, emacs-xtra}.
223@end iftex
224@ifnottex
225@xref{Fancy Diary Display,,, emacs}.
226@end ifnottex
201 227
202@item menu-bar-update-hook 228@item menu-bar-update-hook
203@xref{Menu Bar}. 229@xref{Menu Bar}.
@@ -212,10 +238,20 @@ Manual}.
212@xref{Mouse Position}. 238@xref{Mouse Position}.
213 239
214@item nongregorian-diary-listing-hook 240@item nongregorian-diary-listing-hook
215@inforef{Hebrew/Islamic Entries,, emacs-xtra}. 241@iftex
242@xref{Hebrew/Islamic Entries,,, emacs-xtra}.
243@end iftex
244@ifnottex
245@xref{Hebrew/Islamic Entries,,, emacs}.
246@end ifnottex
216 247
217@item nongregorian-diary-marking-hook 248@item nongregorian-diary-marking-hook
218@inforef{Hebrew/Islamic Entries,, emacs-xtra}. 249@iftex
250@xref{Hebrew/Islamic Entries,,, emacs-xtra}.
251@end iftex
252@ifnottex
253@xref{Hebrew/Islamic Entries,,, emacs}.
254@end ifnottex
219 255
220@item occur-hook 256@item occur-hook
221 257
@@ -229,7 +265,12 @@ Manual}.
229@xref{Command Overview}. 265@xref{Command Overview}.
230 266
231@item print-diary-entries-hook 267@item print-diary-entries-hook
232@inforef{Diary Customizing,, emacs-xtra}. 268@iftex
269@xref{Diary Customizing,,, emacs-xtra}.
270@end iftex
271@ifnottex
272@xref{Diary Customizing,,, emacs}.
273@end ifnottex
233 274
234@item redisplay-end-trigger-functions 275@item redisplay-end-trigger-functions
235@xref{Window Hooks}. 276@xref{Window Hooks}.
@@ -255,10 +296,20 @@ Manual}.
255@xref{Terminal-Specific}. 296@xref{Terminal-Specific}.
256 297
257@item today-visible-calendar-hook 298@item today-visible-calendar-hook
258@inforef{Calendar Customizing,, emacs-xtra}. 299@iftex
300@xref{Calendar Customizing,,, emacs-xtra}.
301@end iftex
302@ifnottex
303@xref{Calendar Customizing,,, emacs}.
304@end ifnottex
259 305
260@item today-invisible-calendar-hook 306@item today-invisible-calendar-hook
261@inforef{Calendar Customizing,, emacs-xtra}. 307@iftex
308@xref{Calendar Customizing,,, emacs-xtra}.
309@end iftex
310@ifnottex
311@xref{Calendar Customizing,,, emacs}.
312@end ifnottex
262 313
263@item window-configuration-change-hook 314@item window-configuration-change-hook
264@xref{Window Hooks}. 315@xref{Window Hooks}.
diff --git a/lispref/internals.texi b/lispref/internals.texi
index ee6423ef37b..f46a162aef1 100644
--- a/lispref/internals.texi
+++ b/lispref/internals.texi
@@ -155,11 +155,15 @@ standard preloaded Lisp libraries. In the file @file{emacs}, it is
155marked as read-only (on operating systems that permit this), so that 155marked as read-only (on operating systems that permit this), so that
156the memory space can be shared by all the Emacs jobs running on the 156the memory space can be shared by all the Emacs jobs running on the
157machine at once. Pure storage is not expandable; a fixed amount is 157machine at once. Pure storage is not expandable; a fixed amount is
158allocated when Emacs is compiled, and if that is not sufficient for the 158allocated when Emacs is compiled, and if that is not sufficient for
159preloaded libraries, @file{temacs} crashes. If that happens, you must 159the preloaded libraries, @file{temacs} allocates dynamic memory for
160increase the compilation parameter @code{PURESIZE} in the file 160the part that didn't fit. If that happens, you should increase the
161@file{src/puresize.h}. This normally won't happen unless you try to 161compilation parameter @code{PURESIZE} in the file
162preload additional libraries or add features to the standard ones. 162@file{src/puresize.h} and rebuild Emacs, even though the resulting
163image will work. Such an overflow normally won't happen unless you
164try to preload additional libraries or add features to the standard
165ones. Emacs will display a warning about the overflow when it
166starts.
163 167
164@defun purecopy object 168@defun purecopy object
165This function makes a copy in pure storage of @var{object}, and returns 169This function makes a copy in pure storage of @var{object}, and returns
@@ -1015,7 +1019,7 @@ Mode line element that controls the format of the mode line. If this
1015is @code{nil}, no mode line will be displayed. 1019is @code{nil}, no mode line will be displayed.
1016 1020
1017@item header_line_format 1021@item header_line_format
1018This field is analoguous to @code{mode_line_format} for the mode 1022This field is analogous to @code{mode_line_format} for the mode
1019line displayed at the top of windows. 1023line displayed at the top of windows.
1020 1024
1021@item keymap 1025@item keymap
diff --git a/lispref/keymaps.texi b/lispref/keymaps.texi
index b1e2f7fbaea..39a57eddf13 100644
--- a/lispref/keymaps.texi
+++ b/lispref/keymaps.texi
@@ -561,7 +561,7 @@ pseudo-Lisp description of how this process works:
561 (@var{find-in-any} emulation-mode-map-alists) 561 (@var{find-in-any} emulation-mode-map-alists)
562 (@var{find-in-any} minor-mode-overriding-map-alist) 562 (@var{find-in-any} minor-mode-overriding-map-alist)
563 (@var{find-in-any} minor-mode-map-alist) 563 (@var{find-in-any} minor-mode-map-alist)
564 (if (get-text-property (point) 'local-map)) 564 (if (get-text-property (point) 'local-map)
565 (@var{find-in} (get-text-property (point) 'local-map)) 565 (@var{find-in} (get-text-property (point) 'local-map))
566 (@var{find-in} (current-local-map)))))) 566 (@var{find-in} (current-local-map))))))
567 (@var{find-in} (current-global-map))) 567 (@var{find-in} (current-global-map)))
@@ -670,14 +670,15 @@ description of the order in which the active keymaps are searched:
670 (@var{find-in-any} emulation-mode-map-alists) 670 (@var{find-in-any} emulation-mode-map-alists)
671 (@var{find-in-any} minor-mode-overriding-map-alist) 671 (@var{find-in-any} minor-mode-overriding-map-alist)
672 (@var{find-in-any} minor-mode-map-alist) 672 (@var{find-in-any} minor-mode-map-alist)
673 (@var{find-in} (get-text-property (point) 'local-map)) 673 (if (get-text-property (point) 'local-map)
674 (@var{find-in} (current-local-map))))) 674 (@var{find-in} (get-text-property (point) 'local-map))
675 (@var{find-in} (current-local-map))))))
675 (@var{find-in} (current-global-map))) 676 (@var{find-in} (current-global-map)))
676@end lisp 677@end lisp
677 678
678@noindent 679@noindent
679The @var{find-in} and @var{find-in-any} are pseudo functions that 680The @var{find-in} and @var{find-in-any} are pseudo functions that
680searches in one keymap respectively an alist of keymaps. 681search in one keymap and in an alist of keymaps, respectively.
681 682
682@enumerate 683@enumerate
683@item 684@item
diff --git a/lispref/minibuf.texi b/lispref/minibuf.texi
index 4faf8fd374c..b5bcc3a77dc 100644
--- a/lispref/minibuf.texi
+++ b/lispref/minibuf.texi
@@ -449,11 +449,26 @@ list, put the length in the @code{history-length} property of the
449history list symbol. The variable @code{history-delete-duplicates} 449history list symbol. The variable @code{history-delete-duplicates}
450specifies whether to delete duplicates in history. 450specifies whether to delete duplicates in history.
451 451
452@defun add-to-history history-var newelt &optional maxelt
453This function adds a new element @var{newelt} to the history list
454stored in the variable @var{history-var}, and returns the updated
455history list. By default, the list length is limited by the value
456specified by @code{history-length} (described below), but the optional
457argument @var{maxelt} overrides that. The possible values of
458@var{maxelt} have the same meaning as the values of
459@code{history-length}.
460
461Duplicate members are removed from the history list, unless
462@code{history-delete-duplicates} is @code{nil}.
463@end defun
464
452@defvar history-length 465@defvar history-length
453The value of this variable specifies the maximum length for all 466The value of this variable specifies the maximum length for all
454history lists that don't specify their own maximum lengths. If the 467history lists that don't specify their own maximum lengths. If the
455value is @code{t}, that means there no maximum (don't delete old 468value is @code{t}, that means there no maximum (don't delete old
456elements). 469elements). The value of @code{history-length} property of the history
470list variable's symbol, if set, overrides this variable for that
471particular history list.
457@end defvar 472@end defvar
458 473
459@defvar history-delete-duplicates 474@defvar history-delete-duplicates
@@ -501,7 +516,7 @@ A history list for arguments that are Lisp expressions to evaluate.
501 516
502Several of the functions for minibuffer input have an argument called 517Several of the functions for minibuffer input have an argument called
503@var{initial} or @var{initial-contents}. This is a mostly-deprecated 518@var{initial} or @var{initial-contents}. This is a mostly-deprecated
504feature for specifiying that the minibuffer should start out with 519feature for specifying that the minibuffer should start out with
505certain text, instead of empty as usual. 520certain text, instead of empty as usual.
506 521
507If @var{initial} is a string, the minibuffer starts out containing the 522If @var{initial} is a string, the minibuffer starts out containing the
diff --git a/lispref/nonascii.texi b/lispref/nonascii.texi
index b09a3fc78a3..c526d419766 100644
--- a/lispref/nonascii.texi
+++ b/lispref/nonascii.texi
@@ -484,7 +484,7 @@ of the text in question.
484@defun charset-after &optional pos 484@defun charset-after &optional pos
485This function return the charset of a character in the current buffer 485This function return the charset of a character in the current buffer
486at position @var{pos}. If @var{pos} is omitted or @code{nil}, it 486at position @var{pos}. If @var{pos} is omitted or @code{nil}, it
487defauls to the current value of point. If @var{pos} is out of range, 487defaults to the current value of point. If @var{pos} is out of range,
488the value is @code{nil}. 488the value is @code{nil}.
489@end defun 489@end defun
490 490
diff --git a/lispref/numbers.texi b/lispref/numbers.texi
index 3cbc1a7ae16..bac3b0e114c 100644
--- a/lispref/numbers.texi
+++ b/lispref/numbers.texi
@@ -322,7 +322,7 @@ returns @code{t} if so, @code{nil} otherwise.
322 322
323@defun eql value1 value2 323@defun eql value1 value2
324This function acts like @code{eq} except when both arguments are 324This function acts like @code{eq} except when both arguments are
325numbers. It compares numbers by type and numberic value, so that 325numbers. It compares numbers by type and numeric value, so that
326@code{(eql 1.0 1)} returns @code{nil}, but @code{(eql 1.0 1.0)} and 326@code{(eql 1.0 1)} returns @code{nil}, but @code{(eql 1.0 1.0)} and
327@code{(eql 1 1)} both return @code{t}. 327@code{(eql 1 1)} both return @code{t}.
328@end defun 328@end defun
diff --git a/lispref/variables.texi b/lispref/variables.texi
index 5b4b779448e..cd7c22b0bff 100644
--- a/lispref/variables.texi
+++ b/lispref/variables.texi
@@ -1784,7 +1784,8 @@ returns non-@code{nil} given that value. Many commonly encountered
1784file variables standardly have @code{safe-local-variable} properties, 1784file variables standardly have @code{safe-local-variable} properties,
1785including @code{fill-column}, @code{fill-prefix}, and 1785including @code{fill-column}, @code{fill-prefix}, and
1786@code{indent-tabs-mode}. For boolean-valued variables that are safe, 1786@code{indent-tabs-mode}. For boolean-valued variables that are safe,
1787use @code{booleanp} as the property value. 1787use @code{booleanp} as the property value. Lambda expressions should
1788be quoted so that @code{describe-variable} can display the predicate.
1788 1789
1789@defopt safe-local-variable-values 1790@defopt safe-local-variable-values
1790This variable provides another way to mark some variable values as 1791This variable provides another way to mark some variable values as
@@ -1844,6 +1845,19 @@ unconditionally; @code{nil} means ignore them; anything else means ask
1844the user what to do for each file. The default value is @code{maybe}. 1845the user what to do for each file. The default value is @code{maybe}.
1845@end defopt 1846@end defopt
1846 1847
1848@defopt safe-local-eval-forms
1849This variable holds a list of expressions that are safe to
1850evaluate when found in the @samp{Eval:} ``variable'' in a file
1851local variables list.
1852@end defopt
1853
1854 If the expression is a function call and the function has a
1855@code{safe-local-eval-function} property, the property value
1856determines whether the expression is safe to evaluate. The property
1857value can be a predicate to call to test the expression, a list of
1858such predicates (it's safe if any predicate succeeds), or @code{t}
1859(always safe provided the arguments are constant).
1860
1847 Text properties are also potential loopholes, since their values 1861 Text properties are also potential loopholes, since their values
1848could include functions to call. So Emacs discards all text 1862could include functions to call. So Emacs discards all text
1849properties from string values specified for file local variables. 1863properties from string values specified for file local variables.
diff --git a/lispref/windows.texi b/lispref/windows.texi
index dc780e7b828..a2746889633 100644
--- a/lispref/windows.texi
+++ b/lispref/windows.texi
@@ -1419,7 +1419,7 @@ buffer is different from the buffer that is displayed in the selected
1419window. @xref{Current Buffer}. 1419window. @xref{Current Buffer}.
1420 1420
1421 If the window contains a row which is taller than the height of the 1421 If the window contains a row which is taller than the height of the
1422window (for example in the presense of a large image), the scroll 1422window (for example in the presence of a large image), the scroll
1423functions will adjust the window vscroll to scroll the partially 1423functions will adjust the window vscroll to scroll the partially
1424visible row. To disable this feature, Lisp code may bind the variable 1424visible row. To disable this feature, Lisp code may bind the variable
1425`auto-window-vscroll' to @code{nil} (@pxref{Vertical Scrolling}). 1425`auto-window-vscroll' to @code{nil} (@pxref{Vertical Scrolling}).
@@ -1656,7 +1656,7 @@ pixels. In this case, the return value is @var{lines}.
1656If this variable is non-@code{nil}, the line-move, scroll-up, and 1656If this variable is non-@code{nil}, the line-move, scroll-up, and
1657scroll-down functions will automatically modify the window vscroll to 1657scroll-down functions will automatically modify the window vscroll to
1658scroll through display rows that are taller that the height of the 1658scroll through display rows that are taller that the height of the
1659window, for example in the presense of large images. 1659window, for example in the presence of large images.
1660@end defvar 1660@end defvar
1661 1661
1662@node Horizontal Scrolling 1662@node Horizontal Scrolling
diff --git a/man/ChangeLog b/man/ChangeLog
index bd48e3f4f20..30933b5f0a3 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,233 @@
12006-05-09 Michael Albinus <michael.albinus@gmx.de>
2
3 * tramp.texi (Filename completion): Improve wording.
4
52006-05-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
6
7 * xresmini.texi (GTK resources): Inserted GTK description.
8
9 * xresources.texi (GTK resources): metafont should be menufont.
10
112006-05-07 Romain Francoise <romain@orebokech.com>
12
13 * faq.texi (Using regular expressions): Fix typo.
14 (Packages that do not come with Emacs): Fix capitalization.
15 (Replacing text across multiple files): Expand node to explain how
16 to use `dired-do-query-replace-regexp' in more detail, based on
17 suggestion by Eric Hanchrow <offby1@blarg.net>.
18
192006-05-06 Michael Albinus <michael.albinus@gmx.de>
20
21 * mini.texi (Completion Options):
22 * tramp.texi (Filename completion): Completion of remote files'
23 method, user name and host name is active only in partial
24 completion mode.
25
262006-05-06 Bill Wohler <wohler@newt.com>
27
28 Release MH-E manual version 8.0.
29
30 * mh-e.texi (VERSION, EDITION, UPDATED, UPDATE-MONTH): Update for
31 release 8.0.
32
332006-05-06 Bill Wohler <wohler@newt.com>
34
35 * mh-e.texi (MH-BOOK-HOME): Change from
36 http://www.ics.uci.edu/~mh/book/mh to
37 http://rand-mh.sourceforge.net/book/mh.
38 Replace .htm suffix with .html for MH book files.
39 (Using This Manual): Update key binding for getting relevant
40 chapter in Info from command key.
41 (Ranges): Fix itemx.
42
432006-05-06 Eli Zaretskii <eliz@gnu.org>
44
45 * makefile.w32-in (emacs.dvi):
46 * Makefile.in (emacs.dvi): Add xresmini.texi
47
48 * xresmini.texi (Table of Resources): Remove xref to non-existent
49 node "LessTif Resources".
50
51 * msdog.texi (Microsoft Windows):
52 * calendar.texi (Calendar/Diary, Displaying the Diary)
53 (Special Diary Entries, Importing Diary, Holidays):
54 * programs.texi (Program Modes):
55 * text.texi (Text):
56 * buffers.texi (Several Buffers):
57 * files.texi (Comparing Files): Fix cross-references to emacs-xtra.
58
592006-05-06 Eli Zaretskii <eliz@gnu.org>
60
61 The following changes merge the emacs-xtra manual into the main
62 manual, but only for on-line version of the manual.
63
64 * vc2-xtra.texi (Version Backups, Local Version Control)
65 (Making Snapshots, Change Logs and VC, Version Headers)
66 (Customizing VC, CVS Options) [ifnottex]: Conditional xref's for
67 on-line manual.
68
69 * vc1-xtra.texi (VC Dired Mode) [ifnottex]: Conditional xref's
70 for on-line manual.
71
72 * msdog-xtra.texi (MS-DOS, MS-DOS Keyboard, MS-DOS Mouse)
73 (MS-DOS Display, MS-DOS File Names, MS-DOS Printing)
74 (MS-DOS and MULE, MS-DOS Processes) [ifnottex]: Conditional xref's
75 for on-line manual.
76
77 * fortran-xtra.texi (Fortran, Fortran Autofill)
78 (Fortran Autofill, Fortran Abbrev) [ifnottex]: Conditional xref's
79 for on-line manual.
80
81 * picture-xtra.texi (Basic Picture, Rectangles in Picture) [ifnottex]:
82 Conditional xref's for on-line manual.
83
84 * emerge-xtra.texi (Emerge, Overview of Emerge)
85 (Fine Points of Emerge) [ifnottex]: Conditional xref's for on-line
86 manual.
87
88 * Makefile.in (INFO_TARGETS): Remove ../info/emacs-xtra.
89 (EMACS_XTRA): New variable, lists the new *-xtra.texi files.
90 (EMACSSOURCES): Use EMACS_XTRA.
91 (../info/emacs-xtra): Remove.
92 (emacs-xtra.dvi): Add EMACS_XTRA to prerequisites.
93
94 * makefile.w32-in (INFO_TARGETS): Remove $(infodir)/emacs-xtra.
95 (EMACS_XTRA): New variable, lists the new *-xtra.texi files.
96 (EMACSSOURCES): Use EMACS_XTRA.
97 ($(infodir)/emacs-xtra): Remove.
98 (emacs-xtra.dvi): Add EMACS_XTRA to prerequisites.
99
100 * trouble.texi (Quitting):
101 * text.texi (Text):
102 * programs.texi (Program Modes):
103 * msdog.texi (Microsoft Windows):
104 * frames.texi (Frames):
105 * files.texi (Backup, Version Control, VC Concepts)
106 (Types of Log File, Advanced C-x v v, Log Buffer, Old Versions)
107 (Registering, VC Status, VC Undo, Multi-User Branching)
108 (Comparing Files):
109 * calendar.texi (Calendar/Diary, Holidays, Displaying the Diary)
110 (Displaying the Diary, Special Diary Entries, Importing Diary):
111 * buffers.texi (Several Buffers): Replace inforef to emacs-xtra by
112 conditional xref's, depending on @iftex/@ifnottex.
113
114 * msdog.texi (Microsoft Windows) [ifnottex]: Add menu entry for
115 "MS-DOS". @include msdog-xtra.texi.
116
117 * programs.texi (Programs) [ifnottex]: Add menu entry for "Fortran".
118 <Top Level> [ifnottex]: @include fortran-xtra.texi.
119
120 * files.texi (Secondary VC Commands) [ifnottex]: Add menu entries
121 for vc-xtra.texi subsections.
122 (VC Undo) [ifnottex]: @include vc1-xtra.texi and @lowersections it.
123 (Multi-User Branching) [ifnottex]: @include vc2-xtra.texi.
124
125 * sending.texi (Sending Mail): A @node line without explicit Prev,
126 Next, and Up links.
127
128 * abbrevs.texi (Abbrevs): A @node line without explicit Prev,
129 Next, and Up links.
130
131 * emacs.texi (Top) [ifnottex]: Add menu entries for "Picture Mode"
132 and its sections. @include picture-xtra.texi
133
134 * maintaining.texi (Maintaining) [ifnottex]: Add menu entry for
135 "Emerge".
136 (List Tags) [ifnottex]: @include emerge-xtra.texi.
137
138 * cal-xtra.texi (Daylight Savings): Remove this node: it is an
139 exact duplicate of its name-sake in calendar.texi.
140
141 * calendar.texi (Calendar/Diary) [ifnottex]: Add menu item for
142 "Advanced Calendar/Diary Usage".
143 (Time Intervals) [ifnottex]: @include cal-xtra.texi.
144
145 * dired.texi (Subdirectories in Dired) [ifnottex]: @include
146 dired-xtra.texi.
147 (Dired) [ifnottex]: Add menu entry for "Subdir Switches".
148
149 * files.texi (Reverting) [ifnottex]: @include arevert-xtra.texi.
150 (Files) [ifnottex]: Add menu entry for Autorevert.
151
152 * emacs-xtra.texi (Introduction): Reword to make consistent with
153 printed version only.
154 <Top level>: Remove the body of all chapters and move them to the
155 new *-xtra.texi files. Use @raisesections and @lowersections to
156 convert sections to chapters etc.
157
158 * msdog-xtra.texi:
159 * fortran-xtra.texi:
160 * vc-xtra.texi:
161 * vc1-xtra.texi:
162 * vc2-xtra.texi:
163 * emerge-xtra.texi:
164 * cal-xtra.texi:
165 * dired-xtra.texi:
166 * arevert-xtra.texi: New files, with text from respective chapters
167 of emacs-xtra.texi. Convert each @chapter into @section, @section
168 into @subsection, etc.
169
170 * emacs-xtra.texi (MS-DOS): Renamed from "MS-DOG". All references
171 updated.
172
173 * msdog.texi (Microsoft Windows): Rename from "Emacs and Microsoft
174 Windows". All references updated.
175
1762006-05-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
177
178 * macos.texi (Mac Input): Mention input from Character Palette.
179 (Mac Font Specs): Fix typo.
180
1812006-05-05 Richard Stallman <rms@gnu.org>
182
183 * files.texi (Diff Mode): Minor cleanup.
184
1852006-05-05 Karl Berry <karl@gnu.org>
186
187 * texinfo.tex (\definetextfonsizexi, \definetextfonsizex): new cmds.
188 (\fonttextsize): new user-level command to change text font size.
189 * emacs.texi: call @fonttextsize 10, inside @tex to avoid
190 errors from the current release of makeinfo (4.8).
191 * help.texi (Library Keywords): change widest word in multitable
192 template from `emulations' to `convenience'. (Not sure if this is
193 related to the font change.)
194
1952006-05-05 Eli Zaretskii <eliz@gnu.org>
196
197 * files.texi (File Names): Add a footnote about limited support of
198 ~USER on MS-Windows.
199
200 * cmdargs.texi (Initial Options): Add a footnote about limited
201 support of ~USER on MS-Windows.
202
2032006-05-03 Richard Stallman <rms@gnu.org>
204
205 * files.texi (Diff Mode): Node moved here.
206 (Comparing Files): Delete what duplicates new node.
207 (Files): Put Diff Mode in menu.
208
209 * misc.texi (Diff Mode): Moved to files.texi.
210
211 * emacs.texi (Top): Update menu for Diff Mode.
212
213 * trouble.texi (Emergency Escape): Simplify.
214
215 * emacs.texi (Top): Minor clarification.
216
2172006-05-03 Teodor Zlatanov <tzz@lifelogs.com>
218
219 * commands.texi, entering.texi, screen.texi: Many simplifications.
220
2212006-05-03 Richard Stallman <rms@gnu.org>
222
223 * commands.texi (Text Characters): Delete paragraph about unibyte
224 non-ASCII printing chars.
225
226 * killing.texi (Killing): Say "graphical displays".
227 * display.texi: Say "graphical displays".
228
229 * cmdargs.texi (Misc X): Say "graphical displays".
230
12006-05-01 Richard Stallman <rms@gnu.org> 2312006-05-01 Richard Stallman <rms@gnu.org>
2 232
3 * emacs.texi (Top): Add Diff Mode to menu. 233 * emacs.texi (Top): Add Diff Mode to menu.
@@ -33,7 +263,7 @@
33 263
34 * pgg.texi (Caching passphrase): Fix markup and typos. Simplify. 264 * pgg.texi (Caching passphrase): Fix markup and typos. Simplify.
35 265
362006-04-26 Sascha Wilde <wilde@sha-bang.de> 2662006-04-26 Sascha Wilde <wilde@sha-bang.de> (tiny change)
37 267
38 * pgg.texi (Caching passphrase): Add pgg-gpg-use-agent. 268 * pgg.texi (Caching passphrase): Add pgg-gpg-use-agent.
39 269
diff --git a/man/Makefile.in b/man/Makefile.in
index 749252f5492..61f775231ae 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -33,7 +33,7 @@ VPATH=@srcdir@
33# The makeinfo program is part of the Texinfo distribution. 33# The makeinfo program is part of the Texinfo distribution.
34# Use --force so that it generates output even if there are errors. 34# Use --force so that it generates output even if there are errors.
35MAKEINFO = makeinfo --force 35MAKEINFO = makeinfo --force
36INFO_TARGETS = ../info/emacs ../info/emacs-xtra ../info/ccmode ../info/cl \ 36INFO_TARGETS = ../info/emacs ../info/ccmode ../info/cl \
37 ../info/dired-x ../info/ediff ../info/forms ../info/gnus \ 37 ../info/dired-x ../info/ediff ../info/forms ../info/gnus \
38 ../info/message ../info/sieve ../info/pgg ../info/emacs-mime \ 38 ../info/message ../info/sieve ../info/pgg ../info/emacs-mime \
39 ../info/info ../info/mh-e ../info/reftex \ 39 ../info/info ../info/mh-e ../info/reftex \
@@ -61,6 +61,18 @@ INFOSOURCES = info.texi
61TEXI2DVI = texi2dvi 61TEXI2DVI = texi2dvi
62ENVADD = TEXINPUTS="$(srcdir):$(TEXINPUTS)" MAKEINFO="$(MAKEINFO) -I$(srcdir)" 62ENVADD = TEXINPUTS="$(srcdir):$(TEXINPUTS)" MAKEINFO="$(MAKEINFO) -I$(srcdir)"
63 63
64EMACS_XTRA=\
65 $(srcdir)/arevert-xtra.texi \
66 $(srcdir)/cal-xtra.texi \
67 $(srcdir)/dired-xtra.texi \
68 $(srcdir)/picture-xtra.texi \
69 $(srcdir)/emerge-xtra.texi \
70 $(srcdir)/vc-xtra.texi \
71 $(srcdir)/vc1-xtra.texi \
72 $(srcdir)/vc2-xtra.texi \
73 $(srcdir)/fortran-xtra.texi \
74 $(srcdir)/msdog-xtra.texi
75
64EMACSSOURCES= \ 76EMACSSOURCES= \
65 ${srcdir}/emacs.texi \ 77 ${srcdir}/emacs.texi \
66 ${srcdir}/doclicense.texi \ 78 ${srcdir}/doclicense.texi \
@@ -104,7 +116,8 @@ EMACSSOURCES= \
104 ${srcdir}/gnu.texi \ 116 ${srcdir}/gnu.texi \
105 ${srcdir}/glossary.texi \ 117 ${srcdir}/glossary.texi \
106 ${srcdir}/ack.texi \ 118 ${srcdir}/ack.texi \
107 ${srcdir}/kmacro.texi 119 ${srcdir}/kmacro.texi \
120 $(EMACS_XTRA)
108 121
109info: $(top_srcdir)/info $(INFO_TARGETS) 122info: $(top_srcdir)/info $(INFO_TARGETS)
110 123
@@ -131,7 +144,7 @@ info.dvi: ${INFOSOURCES}
131../info/emacs: ${EMACSSOURCES} 144../info/emacs: ${EMACSSOURCES}
132 cd $(srcdir); $(MAKEINFO) emacs.texi 145 cd $(srcdir); $(MAKEINFO) emacs.texi
133 146
134emacs.dvi: ${EMACSSOURCES} 147emacs.dvi: ${EMACSSOURCES} $(srcdir)/xresmini.texi
135 $(ENVADD) $(TEXI2DVI) ${srcdir}/emacs.texi 148 $(ENVADD) $(TEXI2DVI) ${srcdir}/emacs.texi
136 149
137# This target is here so you could easily get the list of the *.texi 150# This target is here so you could easily get the list of the *.texi
@@ -176,9 +189,7 @@ dired-x.dvi: dired-x.texi
176ediff.dvi: ediff.texi 189ediff.dvi: ediff.texi
177 $(ENVADD) $(TEXI2DVI) ${srcdir}/ediff.texi 190 $(ENVADD) $(TEXI2DVI) ${srcdir}/ediff.texi
178 191
179../info/emacs-xtra: emacs-xtra.texi 192emacs-xtra.dvi: emacs-xtra.texi $(EMACS_XTRA)
180 cd $(srcdir); $(MAKEINFO) emacs-xtra.texi
181emacs-xtra.dvi: emacs-xtra.texi
182 $(ENVADD) $(TEXI2DVI) ${srcdir}/emacs-xtra.texi 193 $(ENVADD) $(TEXI2DVI) ${srcdir}/emacs-xtra.texi
183 194
184../info/forms: forms.texi 195../info/forms: forms.texi
diff --git a/man/abbrevs.texi b/man/abbrevs.texi
index 14b6bdbb9f2..31d9b933661 100644
--- a/man/abbrevs.texi
+++ b/man/abbrevs.texi
@@ -2,7 +2,7 @@
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2002, 2003, 2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2002, 2003,
3@c 2004, 2005, 2006 Free Software Foundation, Inc. 3@c 2004, 2005, 2006 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions. 4@c See file emacs.texi for copying conditions.
5@node Abbrevs, Sending Mail, Maintaining, Top 5@node Abbrevs
6@chapter Abbrevs 6@chapter Abbrevs
7@cindex abbrevs 7@cindex abbrevs
8@cindex expansion (of abbrevs) 8@cindex expansion (of abbrevs)
@@ -63,7 +63,7 @@ all major modes. The same abbrev can have a global definition and various
63mode-specific definitions for different major modes. A mode-specific 63mode-specific definitions for different major modes. A mode-specific
64definition for the current major mode overrides a global definition. 64definition for the current major mode overrides a global definition.
65 65
66 Yu can define abbrevs interactively during the editing session. You 66 You can define abbrevs interactively during the editing session. You
67can also save lists of abbrev definitions in files for use in later 67can also save lists of abbrev definitions in files for use in later
68sessions. Some users keep extensive lists of abbrevs that they load 68sessions. Some users keep extensive lists of abbrevs that they load
69in every session. 69in every session.
diff --git a/man/arevert-xtra.texi b/man/arevert-xtra.texi
new file mode 100644
index 00000000000..8a207cc63cf
--- /dev/null
+++ b/man/arevert-xtra.texi
@@ -0,0 +1,191 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions.
4@c
5@c This file is included either in emacs-xtra.texi (when producing the
6@c printed version) or in the main Emacs manual (for the on-line version).
7@node Autorevert
8@section Auto Reverting non-file Buffers
9
10Normally Global Auto Revert Mode only reverts file buffers. There are
11two ways to auto-revert certain non-file buffers: enabling Auto Revert
12Mode in those buffers (using @kbd{M-x auto-revert-mode}) and setting
13@code{global-auto-revert-non-file-buffers} to @code{t}. The latter
14enables Auto Reverting for all types of buffers for which it is
15implemented, that is, for the types of buffers listed in the menu
16below.
17
18Like file buffers, non-file buffers should normally not revert while
19you are working on them, or while they contain information that might
20get lost after reverting. Therefore, they do not revert if they are
21``modified''. This can get tricky, because deciding when a non-file
22buffer should be marked modified is usually more difficult than for
23file buffers.
24
25Another tricky detail is that, for efficiency reasons, Auto Revert
26often does not try to detect all possible changes in the buffer, only
27changes that are ``major'' or easy to detect. Hence, enabling
28auto-reverting for a non-file buffer does not always guarantee that
29all information in the buffer is up to date and does not necessarily
30make manual reverts useless.
31
32At the other extreme, certain buffers automatically auto-revert every
33@code{auto-revert-interval} seconds. (This currently only applies to
34the Buffer Menu.) In this case, Auto Revert does not print any
35messages while reverting, even when @code{auto-revert-verbose} is
36non-@code{nil}.
37
38The details depend on the particular types of buffers and are
39explained in the corresponding sections.
40
41@menu
42* Auto Reverting the Buffer Menu::
43* Auto Reverting Dired::
44* Supporting additional buffers::
45@end menu
46
47@node Auto Reverting the Buffer Menu
48@subsection Auto Reverting the Buffer Menu
49
50If auto-reverting of non-file buffers is enabled, the Buffer Menu
51automatically reverts every @code{auto-revert-interval} seconds,
52whether there is a need for it or not. (It would probably take longer
53to check whether there is a need than to actually revert.)
54
55If the Buffer Menu inappropriately gets marked modified, just revert
56it manually using @kbd{g} and auto-reverting will resume. However, if
57you marked certain buffers to get deleted or to be displayed, you have
58to be careful, because reverting erases all marks. The fact that
59adding marks sets the buffer's modified flag prevents Auto Revert from
60automatically erasing the marks.
61
62@node Auto Reverting Dired
63@subsection Auto Reverting Dired buffers
64
65Auto-reverting Dired buffers currently works on GNU or Unix style
66operating systems. It may not work satisfactorily on some other
67systems.
68
69Dired buffers only auto-revert when the file list of the buffer's main
70directory changes. They do not auto-revert when information about a
71particular file changes or when inserted subdirectories change. To be
72sure that @emph{all} listed information is up to date, you have to
73manually revert using @kbd{g}, @emph{even} if auto-reverting is
74enabled in the Dired buffer. Sometimes, you might get the impression
75that modifying or saving files listed in the main directory actually
76does cause auto-reverting. This is because making changes to a file,
77or saving it, very often causes changes in the directory itself, for
78instance, through backup files or auto-save files. However, this is
79not guaranteed.
80
81If the Dired buffer is marked modified and there are no changes you
82want to protect, then most of the time you can make auto-reverting
83resume by manually reverting the buffer using @kbd{g}. There is one
84exception. If you flag or mark files, you can safely revert the
85buffer. This will not erase the flags or marks (unless the marked
86file has been deleted, of course). However, the buffer will stay
87modified, even after reverting, and auto-reverting will not resume.
88This is because, if you flag or mark files, you may be working on the
89buffer and you might not want the buffer to change without warning.
90If you want auto-reverting to resume in the presence of marks and
91flags, mark the buffer non-modified using @kbd{M-~}. However, adding,
92deleting or changing marks or flags will mark it modified again.
93
94Remote Dired buffers are not auto-reverted. Neither are Dired buffers
95for which you used shell wildcards or file arguments to list only some
96of the files. @samp{*Find*} and @samp{*Locate*} buffers do not
97auto-revert either.
98
99@node Supporting additional buffers
100@subsection Adding Support for Auto-Reverting additional Buffers.
101
102This section is intended for Elisp programmers who would like to add
103support for auto-reverting new types of buffers.
104
105To support auto-reverting the buffer must first of all have a
106@code{revert-buffer-function}. @xref{Definition of
107revert-buffer-function,, Reverting, elisp, the Emacs Lisp Reference Manual}.
108
109In addition, it @emph{must} have a @code{buffer-stale-function}.
110
111@defvar buffer-stale-function
112The value of this variable is a function to check whether a non-file
113buffer needs reverting. This should be a function with one optional
114argument @var{noconfirm}. The function should return non-@code{nil}
115if the buffer should be reverted. The buffer is current when this
116function is called.
117
118While this function is mainly intended for use in auto-reverting, it
119could be used for other purposes as well. For instance, if
120auto-reverting is not enabled, it could be used to warn the user that
121the buffer needs reverting. The idea behind the @var{noconfirm}
122argument is that it should be @code{t} if the buffer is going to be
123reverted without asking the user and @code{nil} if the function is
124just going to be used to warn the user that the buffer is out of date.
125In particular, for use in auto-reverting, @var{noconfirm} is @code{t}.
126If the function is only going to be used for auto-reverting, you can
127ignore the @var{noconfirm} argument.
128
129If you just want to automatically auto-revert every
130@code{auto-revert-interval} seconds, use:
131
132@example
133(set (make-local-variable 'buffer-stale-function)
134 #'(lambda (&optional noconfirm) 'fast))
135@end example
136
137@noindent
138in the buffer's mode function.
139
140The special return value @samp{fast} tells the caller that the need
141for reverting was not checked, but that reverting the buffer is fast.
142It also tells Auto Revert not to print any revert messages, even if
143@code{auto-revert-verbose} is non-@code{nil}. This is important, as
144getting revert messages every @code{auto-revert-interval} seconds can
145be very annoying. The information provided by this return value could
146also be useful if the function is consulted for purposes other than
147auto-reverting.
148@end defvar
149
150Once the buffer has a @code{revert-buffer-function} and a
151@code{buffer-stale-function}, several problems usually remain.
152
153The buffer will only auto-revert if it is marked unmodified. Hence,
154you will have to make sure that various functions mark the buffer
155modified if and only if either the buffer contains information that
156might be lost by reverting or there is reason to believe that the user
157might be inconvenienced by auto-reverting, because he is actively
158working on the buffer. The user can always override this by manually
159adjusting the modified status of the buffer. To support this, calling
160the @code{revert-buffer-function} on a buffer that is marked
161unmodified should always keep the buffer marked unmodified.
162
163It is important to assure that point does not continuously jump around
164as a consequence of auto-reverting. Of course, moving point might be
165inevitable if the buffer radically changes.
166
167You should make sure that the @code{revert-buffer-function} does not
168print messages that unnecessarily duplicate Auto Revert's own messages
169if @code{auto-revert-verbose} is @code{t} and effectively override a
170@code{nil} value for @code{auto-revert-verbose}. Hence, adapting a
171mode for auto-reverting often involves getting rid of such messages.
172This is especially important for buffers that automatically
173auto-revert every @code{auto-revert-interval} seconds.
174
175Also, you may want to update the documentation string of
176@code{global-auto-revert-non-file-buffers}.
177
178@ifinfo
179Finally, you should add a node to this chapter's menu. This node
180@end ifinfo
181@ifnotinfo
182Finally, you should add a section to this chapter. This section
183@end ifnotinfo
184should at the very least make clear whether enabling auto-reverting
185for the buffer reliably assures that all information in the buffer is
186completely up to date (or will be after @code{auto-revert-interval}
187seconds).
188
189@ignore
190 arch-tag: 2983e613-a272-45f6-9593-3010ad7f865e
191@end ignore
diff --git a/man/buffers.texi b/man/buffers.texi
index 3b3afc2eb92..548a9c9cb2c 100644
--- a/man/buffers.texi
+++ b/man/buffers.texi
@@ -480,7 +480,13 @@ every @code{auto-revert-interval} seconds if you enable Auto Revert
480mode in this buffer, as long as it is not marked modified. Global 480mode in this buffer, as long as it is not marked modified. Global
481Auto Revert mode applies to the @samp{*Buffer List*} buffer only if 481Auto Revert mode applies to the @samp{*Buffer List*} buffer only if
482@code{global-auto-revert-non-file-buffers} is non-@code{nil}. 482@code{global-auto-revert-non-file-buffers} is non-@code{nil}.
483@inforef{Autorevert,, emacs-xtra}, for details. 483@iftex
484@xref{Autorevert,,, emacs-xtra, Specialized Emacs Features}, for details.
485@end iftex
486@ifnottex
487@xref{Autorevert, global-auto-revert-non-file-buffers}, for details.
488@end ifnottex
489
484 490
485 The command @code{buffer-menu-other-window} works the same as 491 The command @code{buffer-menu-other-window} works the same as
486@code{buffer-menu}, except that it displays the buffers list in 492@code{buffer-menu}, except that it displays the buffers list in
diff --git a/man/building.texi b/man/building.texi
index 0cbaa5d1826..8feebe3bd99 100644
--- a/man/building.texi
+++ b/man/building.texi
@@ -381,7 +381,7 @@ the @code{find-grep-dired} command, in @ref{Dired and Find}.
381(recursive grep) are more user-friendly versions of @code{grep} and 381(recursive grep) are more user-friendly versions of @code{grep} and
382@code{grep-find}, which prompt separately for the regular expression 382@code{grep-find}, which prompt separately for the regular expression
383to match, the files to search, and the base directory for the search 383to match, the files to search, and the base directory for the search
384(rgrep only). Case sensitivitivy of the search is controlled by the 384(rgrep only). Case sensitivity of the search is controlled by the
385current value of @code{case-fold-search}. 385current value of @code{case-fold-search}.
386 386
387These commands build the shell commands based on the variables 387These commands build the shell commands based on the variables
diff --git a/man/cal-xtra.texi b/man/cal-xtra.texi
new file mode 100644
index 00000000000..3214474533e
--- /dev/null
+++ b/man/cal-xtra.texi
@@ -0,0 +1,838 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions.
4@c
5@c This file is included either in emacs-xtra.texi (when producing the
6@c printed version) or in the main Emacs manual (for the on-line version).
7
8@c Moved here from the Emacs Lisp Reference Manual, 2005-03-26.
9@node Advanced Calendar/Diary Usage
10@section Customizing the Calendar and Diary
11
12 There are many customizations that you can use to make the calendar and
13diary suit your personal tastes.
14
15@menu
16* Calendar Customizing:: Defaults you can set.
17* Holiday Customizing:: Defining your own holidays.
18* Date Display Format:: Changing the format.
19* Time Display Format:: Changing the format.
20* Diary Customizing:: Defaults you can set.
21* Hebrew/Islamic Entries:: How to obtain them.
22* Fancy Diary Display:: Enhancing the diary display, sorting entries,
23 using included diary files.
24* Sexp Diary Entries:: Fancy things you can do.
25@end menu
26
27@node Calendar Customizing
28@subsection Customizing the Calendar
29@vindex calendar-holiday-marker
30@vindex diary-entry-marker
31 The variable @code{calendar-holiday-marker} specifies how to mark a
32date as being a holiday. Its value may be a single-character string
33to insert next to the date, or a face name to use for displaying the
34date. Likewise, the variable @code{diary-entry-marker} specifies how
35to mark a date that has diary entries. The calendar creates faces
36named @code{holiday-face} and @code{diary-face} for these purposes;
37those symbols are the default values of these variables.
38
39@vindex calendar-load-hook
40 The variable @code{calendar-load-hook} is a normal hook run when the
41calendar package is first loaded (before actually starting to display
42the calendar).
43
44@vindex initial-calendar-window-hook
45 Starting the calendar runs the normal hook
46@code{initial-calendar-window-hook}. Recomputation of the calendar
47display does not run this hook. But if you leave the calendar with the
48@kbd{q} command and reenter it, the hook runs again.@refill
49
50@vindex today-visible-calendar-hook
51 The variable @code{today-visible-calendar-hook} is a normal hook run
52after the calendar buffer has been prepared with the calendar when the
53current date is visible in the window. One use of this hook is to
54replace today's date with asterisks; to do that, use the hook function
55@code{calendar-star-date}.
56
57@findex calendar-star-date
58@example
59(add-hook 'today-visible-calendar-hook 'calendar-star-date)
60@end example
61
62@noindent
63Another standard hook function marks the current date, either by
64changing its face or by adding an asterisk. Here's how to use it:
65
66@findex calendar-mark-today
67@example
68(add-hook 'today-visible-calendar-hook 'calendar-mark-today)
69@end example
70
71@noindent
72@vindex calendar-today-marker
73The variable @code{calendar-today-marker} specifies how to mark
74today's date. Its value should be a single-character string to insert
75next to the date or a face name to use for displaying the date. A
76face named @code{calendar-today-face} is provided for this purpose;
77that symbol is the default for this variable.
78
79@vindex today-invisible-calendar-hook
80@noindent
81 A similar normal hook, @code{today-invisible-calendar-hook} is run if
82the current date is @emph{not} visible in the window.
83
84@vindex calendar-move-hook
85 Each of the calendar cursor motion commands runs the hook
86@code{calendar-move-hook} after it moves the cursor.
87
88@node Holiday Customizing
89@subsection Customizing the Holidays
90
91@vindex calendar-holidays
92@vindex christian-holidays
93@vindex hebrew-holidays
94@vindex islamic-holidays
95 Emacs knows about holidays defined by entries on one of several lists.
96You can customize these lists of holidays to your own needs, adding or
97deleting holidays. The lists of holidays that Emacs uses are for
98general holidays (@code{general-holidays}), local holidays
99(@code{local-holidays}), Christian holidays (@code{christian-holidays}),
100Hebrew (Jewish) holidays (@code{hebrew-holidays}), Islamic (Muslim)
101holidays (@code{islamic-holidays}), and other holidays
102(@code{other-holidays}).
103
104@vindex general-holidays
105 The general holidays are, by default, holidays common throughout the
106United States. To eliminate these holidays, set @code{general-holidays}
107to @code{nil}.
108
109@vindex local-holidays
110 There are no default local holidays (but sites may supply some). You
111can set the variable @code{local-holidays} to any list of holidays, as
112described below.
113
114@vindex all-christian-calendar-holidays
115@vindex all-hebrew-calendar-holidays
116@vindex all-islamic-calendar-holidays
117 By default, Emacs does not include all the holidays of the religions
118that it knows, only those commonly found in secular calendars. For a
119more extensive collection of religious holidays, you can set any (or
120all) of the variables @code{all-christian-calendar-holidays},
121@code{all-hebrew-calendar-holidays}, or
122@code{all-islamic-calendar-holidays} to @code{t}. If you want to
123eliminate the religious holidays, set any or all of the corresponding
124variables @code{christian-holidays}, @code{hebrew-holidays}, and
125@code{islamic-holidays} to @code{nil}.@refill
126
127@vindex other-holidays
128 You can set the variable @code{other-holidays} to any list of
129holidays. This list, normally empty, is intended for individual use.
130
131@cindex holiday forms
132 Each of the lists (@code{general-holidays}, @code{local-holidays},
133@code{christian-holidays}, @code{hebrew-holidays},
134@code{islamic-holidays}, and @code{other-holidays}) is a list of
135@dfn{holiday forms}, each holiday form describing a holiday (or
136sometimes a list of holidays).
137
138 Here is a table of the possible kinds of holiday form. Day numbers
139and month numbers count starting from 1, but ``dayname'' numbers
140count Sunday as 0. The element @var{string} is always the
141name of the holiday, as a string.
142
143@table @code
144@item (holiday-fixed @var{month} @var{day} @var{string})
145A fixed date on the Gregorian calendar.
146
147@item (holiday-float @var{month} @var{dayname} @var{k} @var{string})
148The @var{k}th @var{dayname} in @var{month} on the Gregorian calendar
149(@var{dayname}=0 for Sunday, and so on); negative @var{k} means count back
150from the end of the month.
151
152@item (holiday-hebrew @var{month} @var{day} @var{string})
153A fixed date on the Hebrew calendar.
154
155@item (holiday-islamic @var{month} @var{day} @var{string})
156A fixed date on the Islamic calendar.
157
158@item (holiday-julian @var{month} @var{day} @var{string})
159A fixed date on the Julian calendar.
160
161@item (holiday-sexp @var{sexp} @var{string})
162A date calculated by the Lisp expression @var{sexp}. The expression
163should use the variable @code{year} to compute and return the date of a
164holiday, or @code{nil} if the holiday doesn't happen this year. The
165value of @var{sexp} must represent the date as a list of the form
166@code{(@var{month} @var{day} @var{year})}.
167
168@item (if @var{condition} @var{holiday-form})
169A holiday that happens only if @var{condition} is true.
170
171@item (@var{function} @r{[}@var{args}@r{]})
172A list of dates calculated by the function @var{function}, called with
173arguments @var{args}.
174@end table
175
176 For example, suppose you want to add Bastille Day, celebrated in
177France on July 14. You can do this as follows:
178
179@smallexample
180(setq other-holidays '((holiday-fixed 7 14 "Bastille Day")))
181@end smallexample
182
183@noindent
184The holiday form @code{(holiday-fixed 7 14 "Bastille Day")} specifies the
185fourteenth day of the seventh month (July).
186
187 Many holidays occur on a specific day of the week, at a specific time
188of month. Here is a holiday form describing Hurricane Supplication Day,
189celebrated in the Virgin Islands on the fourth Monday in August:
190
191@smallexample
192(holiday-float 8 1 4 "Hurricane Supplication Day")
193@end smallexample
194
195@noindent
196Here the 8 specifies August, the 1 specifies Monday (Sunday is 0,
197Tuesday is 2, and so on), and the 4 specifies the fourth occurrence in
198the month (1 specifies the first occurrence, 2 the second occurrence,
199@minus{}1 the last occurrence, @minus{}2 the second-to-last occurrence, and
200so on).
201
202 You can specify holidays that occur on fixed days of the Hebrew,
203Islamic, and Julian calendars too. For example,
204
205@smallexample
206(setq other-holidays
207 '((holiday-hebrew 10 2 "Last day of Hanukkah")
208 (holiday-islamic 3 12 "Mohammed's Birthday")
209 (holiday-julian 4 2 "Jefferson's Birthday")))
210@end smallexample
211
212@noindent
213adds the last day of Hanukkah (since the Hebrew months are numbered with
2141 starting from Nisan), the Islamic feast celebrating Mohammed's
215birthday (since the Islamic months are numbered from 1 starting with
216Muharram), and Thomas Jefferson's birthday, which is 2 April 1743 on the
217Julian calendar.
218
219 To include a holiday conditionally, use either Emacs Lisp's @code{if} or the
220@code{holiday-sexp} form. For example, American presidential elections
221occur on the first Tuesday after the first Monday in November of years
222divisible by 4:
223
224@smallexample
225(holiday-sexp '(if (= 0 (% year 4))
226 (calendar-gregorian-from-absolute
227 (1+ (calendar-dayname-on-or-before
228 1 (+ 6 (calendar-absolute-from-gregorian
229 (list 11 1 year)))))))
230 "US Presidential Election")
231@end smallexample
232
233@noindent
234or
235
236@smallexample
237(if (= 0 (% displayed-year 4))
238 (fixed 11
239 (extract-calendar-day
240 (calendar-gregorian-from-absolute
241 (1+ (calendar-dayname-on-or-before
242 1 (+ 6 (calendar-absolute-from-gregorian
243 (list 11 1 displayed-year)))))))
244 "US Presidential Election"))
245@end smallexample
246
247 Some holidays just don't fit into any of these forms because special
248calculations are involved in their determination. In such cases you
249must write a Lisp function to do the calculation. To include eclipses,
250for example, add @code{(eclipses)} to @code{other-holidays}
251and write an Emacs Lisp function @code{eclipses} that returns a
252(possibly empty) list of the relevant Gregorian dates among the range
253visible in the calendar window, with descriptive strings, like this:
254
255@smallexample
256(((6 27 1991) "Lunar Eclipse") ((7 11 1991) "Solar Eclipse") ... )
257@end smallexample
258
259@node Date Display Format
260@subsection Date Display Format
261@vindex calendar-date-display-form
262
263 You can customize the manner of displaying dates in the diary, in mode
264lines, and in messages by setting @code{calendar-date-display-form}.
265This variable holds a list of expressions that can involve the variables
266@code{month}, @code{day}, and @code{year}, which are all numbers in
267string form, and @code{monthname} and @code{dayname}, which are both
268alphabetic strings. In the American style, the default value of this
269list is as follows:
270
271@smallexample
272((if dayname (concat dayname ", ")) monthname " " day ", " year)
273@end smallexample
274
275@noindent
276while in the European style this value is the default:
277
278@smallexample
279((if dayname (concat dayname ", ")) day " " monthname " " year)
280@end smallexample
281
282@noindent
283The ISO standard date representation is this:
284
285@smallexample
286(year "-" month "-" day)
287@end smallexample
288
289@noindent
290This specifies a typical American format:
291
292@smallexample
293(month "/" day "/" (substring year -2))
294@end smallexample
295
296@node Time Display Format
297@subsection Time Display Format
298@vindex calendar-time-display-form
299
300 The calendar and diary by default display times of day in the
301conventional American style with the hours from 1 through 12, minutes,
302and either @samp{am} or @samp{pm}. If you prefer the European style,
303also known in the US as military, in which the hours go from 00 to 23,
304you can alter the variable @code{calendar-time-display-form}. This
305variable is a list of expressions that can involve the variables
306@code{12-hours}, @code{24-hours}, and @code{minutes}, which are all
307numbers in string form, and @code{am-pm} and @code{time-zone}, which are
308both alphabetic strings. The default value of
309@code{calendar-time-display-form} is as follows:
310
311@smallexample
312(12-hours ":" minutes am-pm
313 (if time-zone " (") time-zone (if time-zone ")"))
314@end smallexample
315
316@noindent
317Here is a value that provides European style times:
318
319@smallexample
320(24-hours ":" minutes
321 (if time-zone " (") time-zone (if time-zone ")"))
322@end smallexample
323
324@node Diary Customizing
325@subsection Customizing the Diary
326
327@vindex holidays-in-diary-buffer
328 Ordinarily, the mode line of the diary buffer window indicates any
329holidays that fall on the date of the diary entries. The process of
330checking for holidays can take several seconds, so including holiday
331information delays the display of the diary buffer noticeably. If you'd
332prefer to have a faster display of the diary buffer but without the
333holiday information, set the variable @code{holidays-in-diary-buffer} to
334@code{nil}.@refill
335
336@vindex number-of-diary-entries
337 The variable @code{number-of-diary-entries} controls the number of
338days of diary entries to be displayed at one time. It affects the
339initial display when @code{view-diary-entries-initially} is @code{t}, as
340well as the command @kbd{M-x diary}. For example, the default value is
3411, which says to display only the current day's diary entries. If the
342value is 2, both the current day's and the next day's entries are
343displayed. The value can also be a vector of seven elements: for
344example, if the value is @code{[0 2 2 2 2 4 1]} then no diary entries
345appear on Sunday, the current date's and the next day's diary entries
346appear Monday through Thursday, Friday through Monday's entries appear
347on Friday, while on Saturday only that day's entries appear.
348
349@vindex print-diary-entries-hook
350@findex print-diary-entries
351 The variable @code{print-diary-entries-hook} is a normal hook run
352after preparation of a temporary buffer containing just the diary
353entries currently visible in the diary buffer. (The other, irrelevant
354diary entries are really absent from the temporary buffer; in the diary
355buffer, they are merely hidden.) The default value of this hook does
356the printing with the command @code{lpr-buffer}. If you want to use a
357different command to do the printing, just change the value of this
358hook. Other uses might include, for example, rearranging the lines into
359order by day and time.
360
361@vindex diary-date-forms
362 You can customize the form of dates in your diary file, if neither the
363standard American nor European styles suits your needs, by setting the
364variable @code{diary-date-forms}. This variable is a list of patterns
365for recognizing a date. Each date pattern is a list whose elements may
366be regular expressions (@pxref{Regular Expressions,,, elisp, the Emacs
367Lisp Reference Manual}) or the symbols @code{month}, @code{day},
368@code{year}, @code{monthname}, and @code{dayname}. All these elements
369serve as patterns that match certain kinds of text in the diary file.
370In order for the date pattern, as a whole, to match, all of its elements
371must match consecutively.
372
373 A regular expression in a date pattern matches in its usual fashion,
374using the standard syntax table altered so that @samp{*} is a word
375constituent.
376
377 The symbols @code{month}, @code{day}, @code{year}, @code{monthname},
378and @code{dayname} match the month number, day number, year number,
379month name, and day name of the date being considered. The symbols that
380match numbers allow leading zeros; those that match names allow
381three-letter abbreviations and capitalization. All the symbols can
382match @samp{*}; since @samp{*} in a diary entry means ``any day'', ``any
383month'', and so on, it should match regardless of the date being
384considered.
385
386 The default value of @code{diary-date-forms} in the American style is
387this:
388
389@example
390((month "/" day "[^/0-9]")
391 (month "/" day "/" year "[^0-9]")
392 (monthname " *" day "[^,0-9]")
393 (monthname " *" day ", *" year "[^0-9]")
394 (dayname "\\W"))
395@end example
396
397 The date patterns in the list must be @emph{mutually exclusive} and
398must not match any portion of the diary entry itself, just the date and
399one character of whitespace. If, to be mutually exclusive, the pattern
400must match a portion of the diary entry text---beyond the whitespace
401that ends the date---then the first element of the date pattern
402@emph{must} be @code{backup}. This causes the date recognizer to back
403up to the beginning of the current word of the diary entry, after
404finishing the match. Even if you use @code{backup}, the date pattern
405must absolutely not match more than a portion of the first word of the
406diary entry. The default value of @code{diary-date-forms} in the
407European style is this list:
408
409@example
410((day "/" month "[^/0-9]")
411 (day "/" month "/" year "[^0-9]")
412 (backup day " *" monthname "\\W+\\<[^*0-9]")
413 (day " *" monthname " *" year "[^0-9]")
414 (dayname "\\W"))
415@end example
416
417@noindent
418Notice the use of @code{backup} in the third pattern, because it needs
419to match part of a word beyond the date itself to distinguish it from
420the fourth pattern.
421
422@node Hebrew/Islamic Entries
423@subsection Hebrew- and Islamic-Date Diary Entries
424
425 Your diary file can have entries based on Hebrew or Islamic dates, as
426well as entries based on the world-standard Gregorian calendar.
427However, because recognition of such entries is time-consuming and most
428people don't use them, you must explicitly enable their use. If you
429want the diary to recognize Hebrew-date diary entries, for example,
430you must do this:
431
432@vindex nongregorian-diary-listing-hook
433@vindex nongregorian-diary-marking-hook
434@findex list-hebrew-diary-entries
435@findex mark-hebrew-diary-entries
436@smallexample
437(add-hook 'nongregorian-diary-listing-hook 'list-hebrew-diary-entries)
438(add-hook 'nongregorian-diary-marking-hook 'mark-hebrew-diary-entries)
439@end smallexample
440
441@noindent
442If you want Islamic-date entries, do this:
443
444@findex list-islamic-diary-entries
445@findex mark-islamic-diary-entries
446@smallexample
447(add-hook 'nongregorian-diary-listing-hook 'list-islamic-diary-entries)
448(add-hook 'nongregorian-diary-marking-hook 'mark-islamic-diary-entries)
449@end smallexample
450
451 Hebrew- and Islamic-date diary entries have the same formats as
452Gregorian-date diary entries, except that @samp{H} precedes a Hebrew
453date and @samp{I} precedes an Islamic date. Moreover, because the
454Hebrew and Islamic month names are not uniquely specified by the first
455three letters, you may not abbreviate them. For example, a diary entry
456for the Hebrew date Heshvan 25 could look like this:
457
458@smallexample
459HHeshvan 25 Happy Hebrew birthday!
460@end smallexample
461
462@noindent
463and would appear in the diary for any date that corresponds to Heshvan 25
464on the Hebrew calendar. And here is an Islamic-date diary entry that matches
465Dhu al-Qada 25:
466
467@smallexample
468IDhu al-Qada 25 Happy Islamic birthday!
469@end smallexample
470
471 As with Gregorian-date diary entries, Hebrew- and Islamic-date entries
472are nonmarking if they are preceded with an ampersand (@samp{&}).
473
474 Here is a table of commands used in the calendar to create diary entries
475that match the selected date and other dates that are similar in the Hebrew
476or Islamic calendar:
477
478@table @kbd
479@item i h d
480Add a diary entry for the Hebrew date corresponding to the selected date
481(@code{insert-hebrew-diary-entry}).
482@item i h m
483Add a diary entry for the day of the Hebrew month corresponding to the
484selected date (@code{insert-monthly-hebrew-diary-entry}). This diary
485entry matches any date that has the same Hebrew day-within-month as the
486selected date.
487@item i h y
488Add a diary entry for the day of the Hebrew year corresponding to the
489selected date (@code{insert-yearly-hebrew-diary-entry}). This diary
490entry matches any date which has the same Hebrew month and day-within-month
491as the selected date.
492@item i i d
493Add a diary entry for the Islamic date corresponding to the selected date
494(@code{insert-islamic-diary-entry}).
495@item i i m
496Add a diary entry for the day of the Islamic month corresponding to the
497selected date (@code{insert-monthly-islamic-diary-entry}).
498@item i i y
499Add a diary entry for the day of the Islamic year corresponding to the
500selected date (@code{insert-yearly-islamic-diary-entry}).
501@end table
502
503@findex insert-hebrew-diary-entry
504@findex insert-monthly-hebrew-diary-entry
505@findex insert-yearly-hebrew-diary-entry
506@findex insert-islamic-diary-entry
507@findex insert-monthly-islamic-diary-entry
508@findex insert-yearly-islamic-diary-entry
509 These commands work much like the corresponding commands for ordinary
510diary entries: they apply to the date that point is on in the calendar
511window, and what they do is insert just the date portion of a diary entry
512at the end of your diary file. You must then insert the rest of the
513diary entry.
514
515@node Fancy Diary Display
516@subsection Fancy Diary Display
517@vindex diary-display-hook
518@findex simple-diary-display
519
520 Diary display works by preparing the diary buffer and then running the
521hook @code{diary-display-hook}. The default value of this hook
522(@code{simple-diary-display}) hides the irrelevant diary entries and
523then displays the buffer. However, if you specify the hook as follows,
524
525@cindex diary buffer
526@findex fancy-diary-display
527@example
528(add-hook 'diary-display-hook 'fancy-diary-display)
529@end example
530
531@noindent
532this enables fancy diary display. It displays diary entries and
533holidays by copying them into a special buffer that exists only for the
534sake of display. Copying to a separate buffer provides an opportunity
535to change the displayed text to make it prettier---for example, to sort
536the entries by the dates they apply to.
537
538 As with simple diary display, you can print a hard copy of the buffer
539with @code{print-diary-entries}. To print a hard copy of a day-by-day
540diary for a week, position point on Sunday of that week, type
541@kbd{7 d}, and then do @kbd{M-x print-diary-entries}. As usual, the
542inclusion of the holidays slows down the display slightly; you can speed
543things up by setting the variable @code{holidays-in-diary-buffer} to
544@code{nil}.
545
546@vindex diary-list-include-blanks
547 Ordinarily, the fancy diary buffer does not show days for which there are
548no diary entries, even if that day is a holiday. If you want such days to be
549shown in the fancy diary buffer, set the variable
550@code{diary-list-include-blanks} to @code{t}.@refill
551
552@cindex sorting diary entries
553 If you use the fancy diary display, you can use the normal hook
554@code{list-diary-entries-hook} to sort each day's diary entries by their
555time of day. Here's how:
556
557@findex sort-diary-entries
558@example
559(add-hook 'list-diary-entries-hook 'sort-diary-entries t)
560@end example
561
562@noindent
563For each day, this sorts diary entries that begin with a recognizable
564time of day according to their times. Diary entries without times come
565first within each day.
566
567 Fancy diary display also has the ability to process included diary
568files. This permits a group of people to share a diary file for events
569that apply to all of them. Lines in the diary file of this form:
570
571@smallexample
572#include "@var{filename}"
573@end smallexample
574
575@noindent
576includes the diary entries from the file @var{filename} in the fancy
577diary buffer. The include mechanism is recursive, so that included files
578can include other files, and so on; you must be careful not to have a
579cycle of inclusions, of course. Here is how to enable the include
580facility:
581
582@vindex list-diary-entries-hook
583@vindex mark-diary-entries-hook
584@findex include-other-diary-files
585@findex mark-included-diary-files
586@smallexample
587(add-hook 'list-diary-entries-hook 'include-other-diary-files)
588(add-hook 'mark-diary-entries-hook 'mark-included-diary-files)
589@end smallexample
590
591The include mechanism works only with the fancy diary display, because
592ordinary diary display shows the entries directly from your diary file.
593
594@node Sexp Diary Entries
595@subsection Sexp Entries and the Fancy Diary Display
596@cindex sexp diary entries
597
598 Sexp diary entries allow you to do more than just have complicated
599conditions under which a diary entry applies. If you use the fancy
600diary display, sexp entries can generate the text of the entry depending
601on the date itself. For example, an anniversary diary entry can insert
602the number of years since the anniversary date into the text of the
603diary entry. Thus the @samp{%d} in this dairy entry:
604
605@findex diary-anniversary
606@smallexample
607%%(diary-anniversary 10 31 1948) Arthur's birthday (%d years old)
608@end smallexample
609
610@noindent
611gets replaced by the age, so on October 31, 1990 the entry appears in
612the fancy diary buffer like this:
613
614@smallexample
615Arthur's birthday (42 years old)
616@end smallexample
617
618@noindent
619If the diary file instead contains this entry:
620
621@smallexample
622%%(diary-anniversary 10 31 1948) Arthur's %d%s birthday
623@end smallexample
624
625@noindent
626the entry in the fancy diary buffer for October 31, 1990 appears like this:
627
628@smallexample
629Arthur's 42nd birthday
630@end smallexample
631
632 Similarly, cyclic diary entries can interpolate the number of repetitions
633that have occurred:
634
635@findex diary-cyclic
636@smallexample
637%%(diary-cyclic 50 1 1 1990) Renew medication (%d%s time)
638@end smallexample
639
640@noindent
641looks like this:
642
643@smallexample
644Renew medication (5th time)
645@end smallexample
646
647@noindent
648in the fancy diary display on September 8, 1990.
649
650 There is an early reminder diary sexp that includes its entry in the
651diary not only on the date of occurrence, but also on earlier dates.
652For example, if you want a reminder a week before your anniversary, you
653can use
654
655@findex diary-remind
656@smallexample
657%%(diary-remind '(diary-anniversary 12 22 1968) 7) Ed's anniversary
658@end smallexample
659
660@noindent
661and the fancy diary will show
662@smallexample
663Ed's anniversary
664@end smallexample
665@noindent
666both on December 15 and on December 22.
667
668@findex diary-date
669 The function @code{diary-date} applies to dates described by a month,
670day, year combination, each of which can be an integer, a list of
671integers, or @code{t}. The value @code{t} means all values. For
672example,
673
674@smallexample
675%%(diary-date '(10 11 12) 22 t) Rake leaves
676@end smallexample
677
678@noindent
679causes the fancy diary to show
680
681@smallexample
682Rake leaves
683@end smallexample
684
685@noindent
686on October 22, November 22, and December 22 of every year.
687
688@findex diary-float
689 The function @code{diary-float} allows you to describe diary entries
690that apply to dates like the third Friday of November, or the last
691Tuesday in April. The parameters are the @var{month}, @var{dayname},
692and an index @var{n}. The entry appears on the @var{n}th @var{dayname}
693of @var{month}, where @var{dayname}=0 means Sunday, 1 means Monday, and
694so on. If @var{n} is negative it counts backward from the end of
695@var{month}. The value of @var{month} can be a list of months, a single
696month, or @code{t} to specify all months. You can also use an optional
697parameter @var{day} to specify the @var{n}th @var{dayname} of
698@var{month} on or after/before @var{day}; the value of @var{day} defaults
699to 1 if @var{n} is positive and to the last day of @var{month} if
700@var{n} is negative. For example,
701
702@smallexample
703%%(diary-float t 1 -1) Pay rent
704@end smallexample
705
706@noindent
707causes the fancy diary to show
708
709@smallexample
710Pay rent
711@end smallexample
712
713@noindent
714on the last Monday of every month.
715
716 The generality of sexp diary entries lets you specify any diary
717entry that you can describe algorithmically. A sexp diary entry
718contains an expression that computes whether the entry applies to any
719given date. If its value is non-@code{nil}, the entry applies to that
720date; otherwise, it does not. The expression can use the variable
721@code{date} to find the date being considered; its value is a list
722(@var{month} @var{day} @var{year}) that refers to the Gregorian
723calendar.
724
725 The sexp diary entry applies to a date when the expression's value
726is non-@code{nil}, but some values have more specific meanings. If
727the value is a string, that string is a description of the event which
728occurs on that date. The value can also have the form
729@code{(@var{mark} . @var{string})}; then @var{mark} specifies how to
730mark the date in the calendar, and @var{string} is the description of
731the event. If @var{mark} is a single-character string, that character
732appears next to the date in the calendar. If @var{mark} is a face
733name, the date is displayed in that face. If @var{mark} is
734@code{nil}, that specifies no particular highlighting for the date.
735
736 Suppose you get paid on the 21st of the month if it is a weekday, and
737on the Friday before if the 21st is on a weekend. Here is how to write
738a sexp diary entry that matches those dates:
739
740@smallexample
741&%%(let ((dayname (calendar-day-of-week date))
742 (day (car (cdr date))))
743 (or (and (= day 21) (memq dayname '(1 2 3 4 5)))
744 (and (memq day '(19 20)) (= dayname 5)))
745 ) Pay check deposited
746@end smallexample
747
748 The following sexp diary entries take advantage of the ability (in the fancy
749diary display) to concoct diary entries whose text varies based on the date:
750
751@findex diary-sunrise-sunset
752@findex diary-phases-of-moon
753@findex diary-day-of-year
754@findex diary-iso-date
755@findex diary-julian-date
756@findex diary-astro-day-number
757@findex diary-hebrew-date
758@findex diary-islamic-date
759@findex diary-french-date
760@findex diary-mayan-date
761@table @code
762@item %%(diary-sunrise-sunset)
763Make a diary entry for the local times of today's sunrise and sunset.
764@item %%(diary-phases-of-moon)
765Make a diary entry for the phases (quarters) of the moon.
766@item %%(diary-day-of-year)
767Make a diary entry with today's day number in the current year and the number
768of days remaining in the current year.
769@item %%(diary-iso-date)
770Make a diary entry with today's equivalent ISO commercial date.
771@item %%(diary-julian-date)
772Make a diary entry with today's equivalent date on the Julian calendar.
773@item %%(diary-astro-day-number)
774Make a diary entry with today's equivalent astronomical (Julian) day number.
775@item %%(diary-hebrew-date)
776Make a diary entry with today's equivalent date on the Hebrew calendar.
777@item %%(diary-islamic-date)
778Make a diary entry with today's equivalent date on the Islamic calendar.
779@item %%(diary-french-date)
780Make a diary entry with today's equivalent date on the French Revolutionary
781calendar.
782@item %%(diary-mayan-date)
783Make a diary entry with today's equivalent date on the Mayan calendar.
784@end table
785
786@noindent
787Thus including the diary entry
788
789@example
790&%%(diary-hebrew-date)
791@end example
792
793@noindent
794causes every day's diary display to contain the equivalent date on the
795Hebrew calendar, if you are using the fancy diary display. (With simple
796diary display, the line @samp{&%%(diary-hebrew-date)} appears in the
797diary for any date, but does nothing particularly useful.)
798
799 These functions can be used to construct sexp diary entries based on
800the Hebrew calendar in certain standard ways:
801
802@cindex rosh hodesh
803@findex diary-rosh-hodesh
804@cindex parasha, weekly
805@findex diary-parasha
806@cindex candle lighting times
807@findex diary-sabbath-candles
808@cindex omer count
809@findex diary-omer
810@cindex yahrzeits
811@findex diary-yahrzeit
812@table @code
813@item %%(diary-rosh-hodesh)
814Make a diary entry that tells the occurrence and ritual announcement of each
815new Hebrew month.
816@item %%(diary-parasha)
817Make a Saturday diary entry that tells the weekly synagogue scripture reading.
818@item %%(diary-sabbath-candles)
819Make a Friday diary entry that tells the @emph{local time} of Sabbath
820candle lighting.
821@item %%(diary-omer)
822Make a diary entry that gives the omer count, when appropriate.
823@item %%(diary-yahrzeit @var{month} @var{day} @var{year}) @var{name}
824Make a diary entry marking the anniversary of a date of death. The date
825is the @emph{Gregorian} (civil) date of death. The diary entry appears
826on the proper Hebrew calendar anniversary and on the day before. (In
827the European style, the order of the parameters is changed to @var{day},
828@var{month}, @var{year}.)
829@end table
830
831 All the functions documented above take an optional argument
832@var{mark} which specifies how to mark the date in the calendar display.
833If one of these functions decides that it applies to a certain date,
834it returns a value that contains @var{mark}.
835
836@ignore
837 arch-tag: 52cb299f-fd1f-4616-bfe6-91b988669431
838@end ignore
diff --git a/man/calendar.texi b/man/calendar.texi
index b48b1d547de..cbe1cbc8a6e 100644
--- a/man/calendar.texi
+++ b/man/calendar.texi
@@ -24,9 +24,11 @@ particular date; @kbd{Mouse-3} brings up a menu of commonly used
24calendar features that are independent of any particular date. To exit 24calendar features that are independent of any particular date. To exit
25the calendar, type @kbd{q}. 25the calendar, type @kbd{q}.
26 26
27@iftex
27 This chapter describes the basic calendar features. 28 This chapter describes the basic calendar features.
28@inforef{Advanced Calendar/Diary Usage,, emacs-xtra}, for information 29@xref{Advanced Calendar/Diary Usage,,, emacs-xtra, Specialized Emacs
29about more specialized features. 30Features}, for information about more specialized features.
31@end iftex
30 32
31@menu 33@menu
32* Calendar Motion:: Moving through the calendar; selecting a date. 34* Calendar Motion:: Moving through the calendar; selecting a date.
@@ -43,6 +45,9 @@ about more specialized features.
43* Importing Diary:: Converting diary events to/from other formats. 45* Importing Diary:: Converting diary events to/from other formats.
44* Daylight Savings:: How to specify when daylight savings time is active. 46* Daylight Savings:: How to specify when daylight savings time is active.
45* Time Intervals:: Keeping track of time intervals. 47* Time Intervals:: Keeping track of time intervals.
48@ifnottex
49* Advanced Calendar/Diary Usage:: Advanced Calendar/Diary customization.
50@end ifnottex
46@end menu 51@end menu
47 52
48@node Calendar Motion 53@node Calendar Motion
@@ -444,14 +449,20 @@ window.
444 To view the distribution of holidays for all the dates shown in the 449 To view the distribution of holidays for all the dates shown in the
445calendar, use the @kbd{x} command. This displays the dates that are 450calendar, use the @kbd{x} command. This displays the dates that are
446holidays in a different face (or places a @samp{*} after these dates, if 451holidays in a different face (or places a @samp{*} after these dates, if
447display with multiple faces is not available). @inforef{Calendar 452display with multiple faces is not available).
448Customizing, calendar-holiday-marker, emacs-xtra}. The command applies 453@iftex
449both to the currently visible months and to other months that 454@xref{Calendar Customizing, calendar-holiday-marker,, emacs-xtra,
450subsequently become visible by scrolling. To turn marking off and erase 455Specialized Emacs Features}.
451the current marks, type @kbd{u}, which also erases any diary marks 456@end iftex
452(@pxref{Diary}). If the variable @code{mark-holidays-in-calendar} is 457@ifnottex
453non-@code{nil}, creating or updating the calendar marks holidays 458@xref{Calendar Customizing, calendar-holiday-marker}.
454automatically. 459@end ifnottex
460 The command applies both to the currently visible months and to
461other months that subsequently become visible by scrolling. To turn
462marking off and erase the current marks, type @kbd{u}, which also
463erases any diary marks (@pxref{Diary}). If the variable
464@code{mark-holidays-in-calendar} is non-@code{nil}, creating or
465updating the calendar marks holidays automatically.
455 466
456@kindex a @r{(Calendar mode)} 467@kindex a @r{(Calendar mode)}
457@findex list-calendar-holidays 468@findex list-calendar-holidays
@@ -1029,14 +1040,20 @@ current date is visible).
1029 To get a broader view of which days are mentioned in the diary, use 1040 To get a broader view of which days are mentioned in the diary, use
1030the @kbd{m} command. This displays the dates that have diary entries in 1041the @kbd{m} command. This displays the dates that have diary entries in
1031a different face (or places a @samp{+} after these dates, if display 1042a different face (or places a @samp{+} after these dates, if display
1032with multiple faces is not available). @inforef{Calendar Customizing, 1043with multiple faces is not available).
1033diary-entry-marker, emacs-xtra}. The command applies both to the 1044@iftex
1034currently visible months and to other months that subsequently become 1045@xref{Calendar Customizing, diary-entry-marker,, emacs-xtra,
1035visible by scrolling. To turn marking off and erase the current marks, 1046Specialized Emacs Features}.
1036type @kbd{u}, which also turns off holiday marks (@pxref{Holidays}). 1047@end iftex
1037If the variable @code{mark-diary-entries-in-calendar} is 1048@ifnottex
1038non-@code{nil}, creating or updating the calendar marks diary dates 1049@xref{Calendar Customizing, diary-entry-marker}.
1039automatically. 1050@end ifnottex
1051 The command applies both to the currently visible months and to
1052other months that subsequently become visible by scrolling. To turn
1053marking off and erase the current marks, type @kbd{u}, which also
1054turns off holiday marks (@pxref{Holidays}). If the variable
1055@code{mark-diary-entries-in-calendar} is non-@code{nil}, creating or
1056updating the calendar marks diary dates automatically.
1040 1057
1041@kindex s @r{(Calendar mode)} 1058@kindex s @r{(Calendar mode)}
1042@findex show-all-diary-entries 1059@findex show-all-diary-entries
@@ -1055,7 +1072,13 @@ can customize it like @code{lpr-region} (@pxref{Printing}).
1055 The command @kbd{M-x diary} displays the diary entries for the current 1072 The command @kbd{M-x diary} displays the diary entries for the current
1056date, independently of the calendar display, and optionally for the next 1073date, independently of the calendar display, and optionally for the next
1057few days as well; the variable @code{number-of-diary-entries} specifies 1074few days as well; the variable @code{number-of-diary-entries} specifies
1058how many days to include. @inforef{Diary Customizing,, emacs-xtra}. 1075how many days to include.
1076@iftex
1077@xref{Diary Customizing,,, emacs-xtra, Specialized Emacs Features}.
1078@end iftex
1079@ifnottex
1080@xref{Diary Customizing, number-of-diary-entries}.
1081@end ifnottex
1059 1082
1060 If you put @code{(diary)} in your @file{.emacs} file, this 1083 If you put @code{(diary)} in your @file{.emacs} file, this
1061automatically displays a window with the day's diary entries, when you 1084automatically displays a window with the day's diary entries, when you
@@ -1360,7 +1383,12 @@ entry applies to all months of the year.@refill
1360specifying the name of a face or a single-character string to use when 1383specifying the name of a face or a single-character string to use when
1361marking the entry in the calendar. Most generally, sexp diary entries 1384marking the entry in the calendar. Most generally, sexp diary entries
1362can perform arbitrary computations to determine when they apply. 1385can perform arbitrary computations to determine when they apply.
1363@inforef{Sexp Diary Entries,, emacs-xtra}. 1386@iftex
1387@xref{Sexp Diary Entries,,, emacs-xtra, Specialized Emacs Features}.
1388@end iftex
1389@ifnottex
1390@inforef{Sexp Diary Entries}.
1391@end ifnottex
1364 1392
1365@node Appointments 1393@node Appointments
1366@section Appointments 1394@section Appointments
@@ -1479,8 +1507,14 @@ and adds the results to an Emacs diary file. For example:
1479 1507
1480@noindent 1508@noindent
1481You can use an @code{#include} directive to add the import file contents 1509You can use an @code{#include} directive to add the import file contents
1482to the main diary file, if these are different files. @inforef{Fancy Diary 1510to the main diary file, if these are different files.
1483Display,, emacs-xtra}. 1511@iftex
1512@xref{Fancy Diary Display,,, emacs-xtra, Specialized Emacs Features}.
1513@end iftex
1514@ifnottex
1515@xref{Fancy Diary Display}.
1516@end ifnottex
1517
1484 1518
1485@findex icalendar-export-file, icalendar-export-region 1519@findex icalendar-export-file, icalendar-export-region
1486 Use @code{icalendar-export-file} to interactively export an entire 1520 Use @code{icalendar-export-file} to interactively export an entire
@@ -1608,6 +1642,10 @@ you change the value of any of timeclock's customizable variables, you
1608should run the command @kbd{M-x timeclock-reread-log} to update the 1642should run the command @kbd{M-x timeclock-reread-log} to update the
1609data in Emacs from the file. 1643data in Emacs from the file.
1610 1644
1645@ifnottex
1646@include cal-xtra.texi
1647@end ifnottex
1648
1611@ignore 1649@ignore
1612 arch-tag: 4531ef09-9df3-449d-9c52-2b5a4a337f92 1650 arch-tag: 4531ef09-9df3-449d-9c52-2b5a4a337f92
1613@end ignore 1651@end ignore
diff --git a/man/cmdargs.texi b/man/cmdargs.texi
index f1e7c539f76..9689782decb 100644
--- a/man/cmdargs.texi
+++ b/man/cmdargs.texi
@@ -293,7 +293,8 @@ Do not reload any saved desktop. @xref{Saving Emacs Sessions}.
293@opindex --user 293@opindex --user
294@cindex load init file of another user 294@cindex load init file of another user
295Load @var{user}'s Emacs init file @file{~@var{user}/.emacs} instead of 295Load @var{user}'s Emacs init file @file{~@var{user}/.emacs} instead of
296your own. 296your own@footnote{
297This option has no effect on MS-Windows.}.
297 298
298@item --debug-init 299@item --debug-init
299@opindex --debug-init 300@opindex --debug-init
@@ -1227,7 +1228,7 @@ Specify @var{pixels} as additional space to put between lines, in pixels.
1227@itemx --no-blinking-cursor 1228@itemx --no-blinking-cursor
1228@opindex --no-blinking-cursor 1229@opindex --no-blinking-cursor
1229@cindex blinking cursor disable, command-line argument 1230@cindex blinking cursor disable, command-line argument
1230Disable the blinking cursor on graphical terminals. 1231Disable the blinking cursor on graphical displays.
1231 1232
1232@item -D 1233@item -D
1233@opindex -D 1234@opindex -D
diff --git a/man/commands.texi b/man/commands.texi
index eba539c15b7..f798b92f829 100644
--- a/man/commands.texi
+++ b/man/commands.texi
@@ -6,9 +6,9 @@
6@chapter Characters, Keys and Commands 6@chapter Characters, Keys and Commands
7 7
8 This chapter explains the character sets used by Emacs for input 8 This chapter explains the character sets used by Emacs for input
9commands and for the contents of files, and also explains the concepts 9commands and for the contents of files, and the fundamental concepts of
10of @dfn{keys} and @dfn{commands}, which are fundamental for understanding 10@dfn{keys} and @dfn{commands}, whereby Emacs interprets your keyboard
11how Emacs interprets your keyboard and mouse input. 11and mouse input.
12@end iftex 12@end iftex
13 13
14@ifnottex 14@ifnottex
@@ -35,11 +35,11 @@ control characters, such as @kbd{Control-a} (usually written @kbd{C-a}
35for short). @kbd{C-a} gets its name from the fact that you type it by 35for short). @kbd{C-a} gets its name from the fact that you type it by
36holding down the @key{CTRL} key while pressing @kbd{a}. 36holding down the @key{CTRL} key while pressing @kbd{a}.
37 37
38 Some @acronym{ASCII} control characters have special names, and most terminals 38 Some @acronym{ASCII} control characters have special names, and most
39have special keys you can type them with: for example, @key{RET}, 39terminals have special keys you can type them with: for example,
40@key{TAB}, @key{DEL} and @key{ESC}. The space character is usually 40@key{RET}, @key{TAB}, @key{DEL} and @key{ESC}. The space character is
41referred to below as @key{SPC}, even though strictly speaking it is a 41usually known as @key{SPC}, even though strictly speaking it is a
42graphic character whose graphic happens to be blank. 42graphic character that is blank.
43 43
44 Emacs extends the @acronym{ASCII} character set with thousands more printing 44 Emacs extends the @acronym{ASCII} character set with thousands more printing
45characters (@pxref{International}), additional control characters, and a 45characters (@pxref{International}), additional control characters, and a
@@ -51,11 +51,11 @@ addition, the shift key is meaningless with control characters:
51@kbd{C-a} and @kbd{C-A} are the same character, and Emacs cannot 51@kbd{C-a} and @kbd{C-A} are the same character, and Emacs cannot
52distinguish them. 52distinguish them.
53 53
54 But the Emacs character set has room for control variants of all 54 The Emacs character set has room for control variants of all
55printing characters, and for distinguishing between @kbd{C-a} and 55printing characters, and distinguishes @kbd{C-A} from @kbd{C-a}.
56@kbd{C-A}. Graphical terminals make it possible to enter all these 56Graphical terminals make it possible to enter all these characters.
57characters. For example, @kbd{C--} (that's Control-Minus) and 57For example, @kbd{C--} (that's Control-Minus) and @kbd{C-5} are
58@kbd{C-5} are meaningful Emacs commands on a graphical terminal. 58meaningful Emacs commands on a graphical terminal.
59 59
60 Another Emacs character-set extension is additional modifier bits. 60 Another Emacs character-set extension is additional modifier bits.
61Only one modifier bit is commonly used; it is called Meta. Every 61Only one modifier bit is commonly used; it is called Meta. Every
@@ -106,10 +106,10 @@ two modifiers by using @kbd{C-x @@} twice for the same character,
106because the first one goes to work on the @kbd{C-x}.) 106because the first one goes to work on the @kbd{C-x}.)
107 107
108 Keyboard input includes keyboard keys that are not characters at 108 Keyboard input includes keyboard keys that are not characters at
109all: for example function keys and arrow keys. Mouse buttons are also 109all, such as function keys and arrow keys. Mouse buttons are also not
110outside the gamut of characters. However, you can modify these events 110characters. However, you can modify these events with the modifier
111with the modifier keys @key{CTRL}, @key{META}, @key{SUPER}, 111keys @key{CTRL}, @key{META}, @key{SUPER}, @key{HYPER} and @key{ALT},
112@key{HYPER} and @key{ALT}, just as you can modify keyboard characters. 112just like keyboard characters.
113 113
114@cindex input event 114@cindex input event
115 Input characters and non-character inputs are collectively called 115 Input characters and non-character inputs are collectively called
@@ -121,7 +121,7 @@ some characters or non-character events, see @ref{Customization}.
121 @acronym{ASCII} terminals cannot really send anything to the computer except 121 @acronym{ASCII} terminals cannot really send anything to the computer except
122@acronym{ASCII} characters. These terminals use a sequence of characters to 122@acronym{ASCII} characters. These terminals use a sequence of characters to
123represent each function key. But that is invisible to the Emacs user, 123represent each function key. But that is invisible to the Emacs user,
124because the keyboard input routines recognize these special sequences 124because the keyboard input routines catch these special sequences
125and convert them to function key events before any other part of Emacs 125and convert them to function key events before any other part of Emacs
126gets to see them. 126gets to see them.
127 127
@@ -131,9 +131,9 @@ gets to see them.
131@cindex key sequence 131@cindex key sequence
132@cindex key 132@cindex key
133 A @dfn{key sequence} (@dfn{key}, for short) is a sequence of input 133 A @dfn{key sequence} (@dfn{key}, for short) is a sequence of input
134events that are meaningful as a unit---as ``a single command.'' Some 134events that is meaningful as a unit---a ``single command.'' Some
135Emacs command sequences are just one character or one event; for 135Emacs command sequences are invoked by just one character or one
136example, just @kbd{C-f} is enough to move forward one character in the 136event; for example, just @kbd{C-f} moves forward one character in the
137buffer. But Emacs also has commands that take two or more events to 137buffer. But Emacs also has commands that take two or more events to
138invoke. 138invoke.
139 139
@@ -158,33 +158,33 @@ r}, are themselves prefix keys that lead to three-event key
158sequences. There's no limit to the length of a key sequence, but in 158sequences. There's no limit to the length of a key sequence, but in
159practice people rarely use sequences longer than four events. 159practice people rarely use sequences longer than four events.
160 160
161 By contrast, you can't add more events onto a complete key. For 161 You can't add input events onto a complete key. For example, the
162example, the two-event sequence @kbd{C-f C-k} is not a key, because 162two-event sequence @kbd{C-f C-k} is not a key, because the @kbd{C-f}
163the @kbd{C-f} is a complete key in itself. It's impossible to give 163is a complete key in itself. It's impossible to give @kbd{C-f C-k} an
164@kbd{C-f C-k} an independent meaning as a command. @kbd{C-f C-k} is two 164independent meaning as a command. @kbd{C-f C-k} is two key sequences,
165key sequences, not one.@refill 165not one.@refill
166 166
167 All told, the prefix keys in Emacs are @kbd{C-c}, @kbd{C-h}, 167 All told, the prefix keys in Emacs are @kbd{C-c}, @kbd{C-h},
168@kbd{C-x}, @kbd{C-x @key{RET}}, @kbd{C-x @@}, @kbd{C-x a}, @kbd{C-x 168@kbd{C-x}, @kbd{C-x @key{RET}}, @kbd{C-x @@}, @kbd{C-x a}, @kbd{C-x
169n}, @w{@kbd{C-x r}}, @kbd{C-x v}, @kbd{C-x 4}, @kbd{C-x 5}, @kbd{C-x 169n}, @w{@kbd{C-x r}}, @kbd{C-x v}, @kbd{C-x 4}, @kbd{C-x 5}, @kbd{C-x
1706}, @key{ESC}, @kbd{M-g}, and @kbd{M-o}. (@key{F1} and @key{F2} are 1706}, @key{ESC}, @kbd{M-g}, and @kbd{M-o}. (@key{F1} and @key{F2} are
171aliases for @kbd{C-h} and @kbd{C-x 6}.) But this list is not cast in 171aliases for @kbd{C-h} and @kbd{C-x 6}.) This list is not cast in stone;
172concrete; it is just a matter of Emacs's standard key bindings. If 172it describes the standard key bindings. If you customize Emacs, you can make
173you customize Emacs, you can make new prefix keys, or eliminate some 173new prefix keys, or eliminate some of the standard ones (not
174of the standard ones. @xref{Key Bindings}. 174recommended for most users). @xref{Key Bindings}.
175 175
176 If you do make or eliminate prefix keys, that changes the set of 176 If you make or eliminate prefix keys, that changes the set of
177possible key sequences. For example, if you redefine @kbd{C-f} as a 177possible key sequences. For example, if you redefine @kbd{C-f} as a
178prefix, @kbd{C-f C-k} automatically becomes a key (complete, unless you 178prefix, @kbd{C-f C-k} automatically becomes a key (complete, unless
179define that too as a prefix). Conversely, if you remove the prefix 179you define that too as a prefix). Conversely, if you remove the
180definition of @kbd{C-x 4}, then @kbd{C-x 4 f} (or @kbd{C-x 4 180prefix definition of @kbd{C-x 4}, then @kbd{C-x 4 f} and @kbd{C-x 4
181@var{anything}}) is no longer a key. 181@var{anything}} are no longer keys.
182 182
183 Typing the help character (@kbd{C-h} or @key{F1}) after a prefix key 183 Typing the help character (@kbd{C-h} or @key{F1}) after a prefix key
184displays a list of the commands starting with that prefix. There are 184displays a list of the commands starting with that prefix. There are
185a few prefix keys for which @kbd{C-h} does not work---for historical 185a few prefix keys after which @kbd{C-h} does not work---for historical
186reasons, they define other meanings for @kbd{C-h} which are painful to 186reasons, they define other meanings for @kbd{C-h} which are painful to
187change. But @key{F1} should work for all prefix keys. 187change. @key{F1} works after all prefix keys.
188 188
189@node Commands, Text Characters, Keys, Top 189@node Commands, Text Characters, Keys, Top
190@section Keys and Commands 190@section Keys and Commands
@@ -197,61 +197,65 @@ do. But Emacs does not assign meanings to keys directly. Instead,
197Emacs assigns meanings to named @dfn{commands}, and then gives keys 197Emacs assigns meanings to named @dfn{commands}, and then gives keys
198their meanings by @dfn{binding} them to commands. 198their meanings by @dfn{binding} them to commands.
199 199
200 Every command has a name chosen by a programmer. The name is usually 200 Every command has a name chosen by a programmer. The name is
201made of a few English words separated by dashes; for example, 201usually made of a few English words separated by dashes; for example,
202@code{next-line} or @code{forward-word}. A command also has a 202@code{next-line} or @code{forward-word}. A command also has a
203@dfn{function definition} which is a Lisp program; this is what makes 203@dfn{function definition} which is a Lisp program; this is how the
204the command do what it does. In Emacs Lisp, a command is actually a 204command does its work. In Emacs Lisp, a command is a Lisp function with
205special kind of Lisp function; one which specifies how to read arguments 205special options to read arguments and for interactive use. For more
206for it and call it interactively. For more information on commands and 206information on commands and functions, see @ref{What Is a Function,,
207functions, see @ref{What Is a Function,, What Is a Function, elisp, The 207What Is a Function, elisp, The Emacs Lisp Reference Manual}. (The
208Emacs Lisp Reference Manual}. (The definition we use in this manual is 208definition here is simplified slightly.)
209simplified slightly.)
210 209
211 The bindings between keys and commands are recorded in various tables 210 The bindings between keys and commands are recorded in tables called
212called @dfn{keymaps}. @xref{Keymaps}. 211@dfn{keymaps}. @xref{Keymaps}.
213 212
214 When we say that ``@kbd{C-n} moves down vertically one line'' we are 213 When we say that ``@kbd{C-n} moves down vertically one line'' we are
215glossing over a distinction that is irrelevant in ordinary use but is vital 214glossing over a subtle distinction that is irrelevant in ordinary use,
216in understanding how to customize Emacs. It is the command 215but vital for Emacs customization. The command @code{next-line} does
217@code{next-line} that is programmed to move down vertically. @kbd{C-n} has 216a vertical move downward. @kbd{C-n} has this effect @emph{because} it
218this effect @emph{because} it is bound to that command. If you rebind 217is bound to @code{next-line}. If you rebind @kbd{C-n} to the command
219@kbd{C-n} to the command @code{forward-word} then @kbd{C-n} will move 218@code{forward-word}, @kbd{C-n} will move forward one word instead.
220forward by words instead. Rebinding keys is a common method of 219Rebinding keys is an important method of customization.
221customization.@refill
222 220
223 In the rest of this manual, we usually ignore this distinction to 221 In the rest of this manual, we usually ignore this distinction to
224keep things simple. We will often speak of keys like @kbd{C-n} as 222keep things simple. We will often speak of keys like @kbd{C-n} as
225commands, even though strictly speaking a key is bound to some 223commands, even though strictly speaking the key is bound to a command.
226command. To give the information needed for customization, we state 224Usually we state the name of the command which really does the work in
227the name of the command which really does the work in parentheses 225parentheses after mentioning the key that runs it. For example, we
228after mentioning the key that runs it. For example, we will say that 226will say that ``The command @kbd{C-n} (@code{next-line}) moves point
229``The command @kbd{C-n} (@code{next-line}) moves point vertically 227vertically down,'' meaning that the command @code{next-line} moves
230down,'' meaning that @code{next-line} is a command that moves 228vertically down, and the key @kbd{C-n} is normally bound to it.
231vertically down, and @kbd{C-n} is a key that is normally bound to it. 229
232 230 Since we are discussing customization, we should tell you about
233 While we are on the subject of information for customization only, 231@dfn{variables}. Often the description of a command will say, ``To
234it's a good time to tell you about @dfn{variables}. Often the 232change this, set the variable @code{mumble-foo}.'' A variable is a
235description of a command will say, ``To change this, set the variable 233name used to store a value. Most of the variables documented in this
236@code{mumble-foo}.'' A variable is a name used to remember a value. 234manual are meant for customization: some command or other part of
237Most of the variables documented in this manual exist just to facilitate 235Emacs examines the variable and behaves differently according to the
238customization: some command or other part of Emacs examines the variable 236value that you set. You can ignore the information about variables
239and behaves differently according to the value that you set. Until you 237until you are interested in customizing them. Then read the basic
240are interested in customizing, you can ignore the information about 238information on variables (@pxref{Variables}) and the information about
241variables. When you are ready to be interested, read the basic 239specific variables will make sense.
242information on variables, and then the information on individual
243variables will make sense. @xref{Variables}.
244 240
245@node Text Characters, Entering Emacs, Commands, Top 241@node Text Characters, Entering Emacs, Commands, Top
246@section Character Set for Text 242@section Character Set for Text
247@cindex characters (in text) 243@cindex characters (in text)
248 244
249 Text in Emacs buffers is a sequence of 8-bit bytes. Each byte can 245 Text in Emacs buffers is a sequence of characters. In the simplest
250hold a single @acronym{ASCII} character. Both @acronym{ASCII} control characters (octal 246case, these are @acronym{ASCII} characters, each stored in one 8-bit
251codes 000 through 037, and 0177) and @acronym{ASCII} printing characters (codes 247byte. Both @acronym{ASCII} control characters (octal codes 000
252040 through 0176) are allowed; however, non-@acronym{ASCII} control characters 248through 037, and 0177) and @acronym{ASCII} printing characters (codes
253cannot appear in a buffer. The other modifier flags used in keyboard 249040 through 0176) are allowed. The other modifier flags used in
254input, such as Meta, are not allowed in buffers either. 250keyboard input, such as Meta, are not allowed in buffers.
251
252 Non-@acronym{ASCII} printing characters can also appear in buffers,
253when multibyte characters are enabled. They have character codes
254starting at 256, octal 0400, and each one is represented as a sequence
255of two or more bytes. @xref{International}. Single-byte characters
256with codes 128 through 255 can also appear in multibyte buffers.
257However, non-@acronym{ASCII} control characters cannot appear in a
258buffer.
255 259
256 Some @acronym{ASCII} control characters serve special purposes in text, and have 260 Some @acronym{ASCII} control characters serve special purposes in text, and have
257special names. For example, the newline character (octal code 012) is 261special names. For example, the newline character (octal code 012) is
@@ -259,16 +263,9 @@ used in the buffer to end a line, and the tab character (octal code 011)
259is used for indenting to the next tab stop column (normally every 8 263is used for indenting to the next tab stop column (normally every 8
260columns). @xref{Text Display}. 264columns). @xref{Text Display}.
261 265
262 Non-@acronym{ASCII} printing characters can also appear in buffers. When
263multibyte characters are enabled, you can use any of the non-@acronym{ASCII}
264printing characters that Emacs supports. They have character codes
265starting at 256, octal 0400, and each one is represented as a sequence
266of two or more bytes. @xref{International}. Single-byte characters
267with codes 128 through 255 can also appear in multibyte buffers.
268
269 If you disable multibyte characters, then you can use only one 266 If you disable multibyte characters, then you can use only one
270alphabet of non-@acronym{ASCII} characters, but they all fit in one byte. They 267alphabet of non-@acronym{ASCII} characters, which all fit in one byte.
271use codes 0200 through 0377. @xref{Unibyte Mode}. 268They use octal codes 0200 through 0377. @xref{Unibyte Mode}.
272 269
273@ifnottex 270@ifnottex
274@lowersections 271@lowersections
diff --git a/man/custom.texi b/man/custom.texi
index 35c9222628c..78a51716031 100644
--- a/man/custom.texi
+++ b/man/custom.texi
@@ -1977,11 +1977,12 @@ usual to do so.
1977@subsection Disabling Commands 1977@subsection Disabling Commands
1978@cindex disabled command 1978@cindex disabled command
1979 1979
1980 Disabling a command menas it requires confirmation before it can be 1980 Disabling a command means that invoking it interactively asks for
1981executed. The purpose of disabling a command is to prevent users from 1981confirmation from the user. The purpose of disabling a command is to
1982executing it by accident and being confused. 1982prevent users from executing it by accident; we do this for commands
1983that might be confusing to the uninitiated.
1983 1984
1984 An attempt to invoke a disabled command interactively in Emacs 1985 Attempting to invoke a disabled command interactively in Emacs
1985displays a window containing the command's name, its documentation, 1986displays a window containing the command's name, its documentation,
1986and some instructions on what to do immediately; then Emacs asks for 1987and some instructions on what to do immediately; then Emacs asks for
1987input saying whether to execute the command as requested, enable it 1988input saying whether to execute the command as requested, enable it
@@ -2021,8 +2022,8 @@ because Emacs has not read your init file.
2021 2022
2022 Whether a command is disabled is independent of what key is used to 2023 Whether a command is disabled is independent of what key is used to
2023invoke it; disabling also applies if the command is invoked using 2024invoke it; disabling also applies if the command is invoked using
2024@kbd{M-x}. Disabling a command has no effect on calling it as a 2025@kbd{M-x}. However, disabling a command has no effect on calling it
2025function from Lisp programs. 2026as a function from Lisp programs.
2026 2027
2027@node Syntax 2028@node Syntax
2028@section The Syntax Table 2029@section The Syntax Table
diff --git a/man/dired-xtra.texi b/man/dired-xtra.texi
new file mode 100644
index 00000000000..01d6963c582
--- /dev/null
+++ b/man/dired-xtra.texi
@@ -0,0 +1,49 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions.
4@c
5@c This file is included either in emacs-xtra.texi (when producing the
6@c printed version) or in the main Emacs manual (for the on-line version).
7@node Subdir Switches
8@section Subdirectory Switches in Dired
9
10You can insert subdirectories with specified @code{ls} switches in
11Dired buffers, using @kbd{C-u i}. You can change the @code{ls}
12switches of an already inserted subdirectory using @kbd{C-u l}.
13
14In Emacs versions 22.1 and later, Dired remembers the switches, so
15that reverting the buffer will not change them back to the main
16directory's switches. Deleting a subdirectory forgets about its
17switches.
18
19Using @code{dired-undo} (usually bound to @kbd{C-_} and @kbd{C-x u})
20to reinsert or delete subdirectories, that were inserted with explicit
21switches, can bypass Dired's machinery for remembering (or forgetting)
22switches. Deleting a subdirectory using @code{dired-undo} does not
23forget its switches. When later reinserted using @kbd{i}, it will be
24reinserted using its old switches. Using @code{dired-undo} to
25reinsert a subdirectory that was deleted using the regular
26Dired commands (not @code{dired-undo}) will originally insert it with
27its old switches. However, reverting the buffer will relist it using
28the buffer's default switches. If any of this yields problems, you
29can easily correct the situation using @kbd{C-u i} or @kbd{C-u l}.
30
31Dired does not remember the @code{R} switch. Inserting a subdirectory
32with switches that include the @code{R} switch is equivalent with
33inserting each of its subdirectories using all remaining switches.
34For instance, updating or killing a subdirectory that was inserted
35with the @code{R} switch will not update or kill its subdirectories.
36
37The buffer's default switches do not affect subdirectories that were
38inserted using explicitly specified switches. In particular,
39commands such as @kbd{s}, that change the buffer's switches do not
40affect such subdirectories. (They do affect subdirectories without
41explicitly assigned switches, however.)
42
43You can make Dired forget about all subdirectory switches and relist
44all subdirectories with the buffer's default switches using
45@kbd{M-x dired-reset-subdir-switches}. This also reverts the Dired buffer.
46
47@ignore
48 arch-tag: e3865701-9179-4ffb-bc34-d321111c688d
49@end ignore
diff --git a/man/dired.texi b/man/dired.texi
index 5face67a7b3..1e3582bebb0 100644
--- a/man/dired.texi
+++ b/man/dired.texi
@@ -36,6 +36,9 @@ on all of them with on command.
36* Transforming File Names:: Using patterns to rename multiple files. 36* Transforming File Names:: Using patterns to rename multiple files.
37* Comparison in Dired:: Running `diff' by way of Dired. 37* Comparison in Dired:: Running `diff' by way of Dired.
38* Subdirectories in Dired:: Adding subdirectories to the Dired buffer. 38* Subdirectories in Dired:: Adding subdirectories to the Dired buffer.
39@ifnottex
40* Subdir Switches:: Subdirectory switches in Dired.
41@end ifnottex
39* Subdirectory Motion:: Moving across subdirectories, and up and down. 42* Subdirectory Motion:: Moving across subdirectories, and up and down.
40* Hiding Subdirectories:: Making subdirectories visible or invisible. 43* Hiding Subdirectories:: Making subdirectories visible or invisible.
41* Updating: Dired Updating. Discarding lines for files of no interest. 44* Updating: Dired Updating. Discarding lines for files of no interest.
@@ -906,6 +909,10 @@ Use the @kbd{l} command (@code{dired-do-redisplay}) to update the
906subdirectory's contents. Use @kbd{C-u k} on the subdirectory header 909subdirectory's contents. Use @kbd{C-u k} on the subdirectory header
907line to delete the subdirectory. @xref{Dired Updating}. 910line to delete the subdirectory. @xref{Dired Updating}.
908 911
912@ifnottex
913@include dired-xtra.texi
914@end ifnottex
915
909@node Subdirectory Motion 916@node Subdirectory Motion
910@section Moving Over Subdirectories 917@section Moving Over Subdirectories
911 918
@@ -1198,7 +1205,7 @@ not appear in the other directory is ``different''. You can specify
1198more stringent comparisons by entering a Lisp expression, which can 1205more stringent comparisons by entering a Lisp expression, which can
1199refer to the variables @code{size1} and @code{size2}, the respective 1206refer to the variables @code{size1} and @code{size2}, the respective
1200file sizes; @code{mtime1} and @code{mtime2}, the last modification 1207file sizes; @code{mtime1} and @code{mtime2}, the last modification
1201times in seconds, as floating point numers; and @code{fa1} and 1208times in seconds, as floating point numbers; and @code{fa1} and
1202@code{fa2}, the respective file attribute lists (as returned by the 1209@code{fa2}, the respective file attribute lists (as returned by the
1203function @code{file-attributes}). This expression is evaluated for 1210function @code{file-attributes}). This expression is evaluated for
1204each pair of like-named files, and if the expression's value is 1211each pair of like-named files, and if the expression's value is
diff --git a/man/display.texi b/man/display.texi
index 83b5ae48554..eaf2ab212bc 100644
--- a/man/display.texi
+++ b/man/display.texi
@@ -1026,7 +1026,7 @@ elisp, The Emacs Lisp Reference Manual}.
1026@cindex cursor, blinking 1026@cindex cursor, blinking
1027 You can customize the cursor's color, and whether it blinks, using 1027 You can customize the cursor's color, and whether it blinks, using
1028the @code{cursor} Custom group (@pxref{Easy Customization}). On 1028the @code{cursor} Custom group (@pxref{Easy Customization}). On
1029graphical terminals, the command @kbd{M-x blink-cursor-mode} enables 1029a graphical display, the command @kbd{M-x blink-cursor-mode} enables
1030or disables the blinking of the cursor. (On text terminals, the 1030or disables the blinking of the cursor. (On text terminals, the
1031terminal itself blinks the cursor, and Emacs has no control over it.) 1031terminal itself blinks the cursor, and Emacs has no control over it.)
1032You can control how the cursor appears when it blinks off by setting 1032You can control how the cursor appears when it blinks off by setting
@@ -1050,7 +1050,7 @@ it a @code{nil} value.
1050 1050
1051@vindex x-stretch-cursor 1051@vindex x-stretch-cursor
1052@cindex wide block cursor 1052@cindex wide block cursor
1053 On graphical terminals, Emacs can optionally draw the block cursor 1053 On graphical displays, Emacs can optionally draw the block cursor
1054as wide as the character under the cursor---for example, if the cursor 1054as wide as the character under the cursor---for example, if the cursor
1055is on a tab character, it would cover the full width occupied by that 1055is on a tab character, it would cover the full width occupied by that
1056tab character. To enable this feature, set the variable 1056tab character. To enable this feature, set the variable
@@ -1127,7 +1127,7 @@ fringe when positioned on that newline.
1127 1127
1128@vindex indicate-buffer-boundaries 1128@vindex indicate-buffer-boundaries
1129 On a graphical display, Emacs can indicate the buffer boundaries in 1129 On a graphical display, Emacs can indicate the buffer boundaries in
1130the fringes. It inddicates the first line and the last line with 1130the fringes. It indicates the first line and the last line with
1131angle images in the fringes. This can be combined with up and down 1131angle images in the fringes. This can be combined with up and down
1132arrow images which say whether it is possible to scroll the window up 1132arrow images which say whether it is possible to scroll the window up
1133and down. 1133and down.
diff --git a/man/emacs-xtra.texi b/man/emacs-xtra.texi
index d6b1ca42583..65625522298 100644
--- a/man/emacs-xtra.texi
+++ b/man/emacs-xtra.texi
@@ -55,18 +55,19 @@ license to the document, as described in section 6 of the license.
55@end ifnottex 55@end ifnottex
56 56
57@menu 57@menu
58* Introduction:: What documentation belongs here? 58* Introduction:: What documentation belongs here?
59* Autorevert:: Auto Reverting non-file buffers. 59@iftex
60* Subdir Switches:: Subdirectory switches in Dired. 60* Picture Mode:: Editing pictures made up of characters using
61* Advanced Calendar/Diary Usage:: Advanced Calendar/Diary customization. 61 the quarter-plane screen model.
62* Emerge:: A convenient way of merging two versions
63 of a program.
64* Picture Mode:: Editing pictures made up of characters
65 using the quarter-plane screen model.
66 62
67* Advanced VC Usage:: Advanced VC (version control) features. 63* Autorevert:: Auto Reverting non-file buffers.
68* Fortran:: Fortran mode and its special features. 64* Subdir Switches:: Subdirectory switches in Dired.
69* MS-DOG:: 65* Advanced Calendar/Diary Usage:: Advanced Calendar/Diary customization.
66* Emerge:: A convenient way of merging two versions of a program.
67* Advanced VC Usage:: Advanced VC (version control) features.
68* Fortran:: Fortran mode and its special features.
69* MS-DOS:: Using Emacs on MS-DOS (otherwise known as @dfn{MS-DOG}).
70@end iftex
70* Index:: 71* Index::
71@end menu 72@end menu
72 73
@@ -74,3772 +75,44 @@ license to the document, as described in section 6 of the license.
74@unnumbered Introduction 75@unnumbered Introduction
75 76
76This manual contains detailed information about various features that 77This manual contains detailed information about various features that
77are too specialized to be included in the Emacs manual. It is 78are too specialized to be included in the printed Emacs manual. It is
78intended to be readable by anyone having a basic knowledge of Emacs. 79intended to be readable by anyone having a basic knowledge of Emacs.
79However, certain sections may be intended for a more specialized 80However, certain sections may be intended for a more specialized
80audience, such as Elisp authors. This should be clearly pointed out 81audience, such as Elisp authors. This should be clearly pointed out
81at the beginning of these sections. 82at the beginning of these sections.
82 83
83This manual is intended as a complement, rather than an alternative, 84Certain packages, or collections of related features, have their own
84to other ways to gain a more detailed knowledge of Emacs than the 85manuals, separate from the main Emacs User's manual. This manual is
85Emacs manual can provide, such as browsing packages using @kbd{C-h p}, 86intended as a complement, rather than an alternative, to reading those
86accessing mode documentation using @kbd{C-h m} and browsing user 87additional manuals; in a nutshell, it is a collection of smaller
87options using Custom. Also, certain packages, or collections of 88specialized features, too small or too obscure to justify their own
88related features, have their own manuals. The present manual is 89manual.
89mainly intended to be a collection of smaller specialized features,
90too small to get their own manual.
91 90
92Sections intended specifically for Elisp programmers can follow the 91Sections intended specifically for Elisp programmers can follow the
93style of the Elisp manual. Other sections should follow the style of 92style of the Elisp manual. Other sections should follow the style of
94the Emacs manual. 93the Emacs manual.
95 94
96@node Autorevert
97@chapter Auto Reverting non-file Buffers
98
99Normally Global Auto Revert Mode only reverts file buffers. There are
100two ways to auto-revert certain non-file buffers: enabling Auto Revert
101Mode in those buffers (using @kbd{M-x auto-revert-mode}) and setting
102@code{global-auto-revert-non-file-buffers} to @code{t}. The latter
103enables Auto Reverting for all types of buffers for which it is
104implemented, that is, for the types of buffers listed in the menu
105below.
106
107Like file buffers, non-file buffers should normally not revert while
108you are working on them, or while they contain information that might
109get lost after reverting. Therefore, they do not revert if they are
110``modified''. This can get tricky, because deciding when a non-file
111buffer should be marked modified is usually more difficult than for
112file buffers.
113
114Another tricky detail is that, for efficiency reasons, Auto Revert
115often does not try to detect all possible changes in the buffer, only
116changes that are ``major'' or easy to detect. Hence, enabling
117auto-reverting for a non-file buffer does not always guarantee that
118all information in the buffer is up to date and does not necessarily
119make manual reverts useless.
120
121At the other extreme, certain buffers automatically auto-revert every
122@code{auto-revert-interval} seconds. (This currently only applies to
123the Buffer Menu.) In this case, Auto Revert does not print any
124messages while reverting, even when @code{auto-revert-verbose} is
125non-@code{nil}.
126
127The details depend on the particular types of buffers and are
128explained in the corresponding sections.
129
130@menu
131* Auto Reverting the Buffer Menu::
132* Auto Reverting Dired::
133* Supporting additional buffers::
134@end menu
135
136@node Auto Reverting the Buffer Menu
137@section Auto Reverting the Buffer Menu
138
139If auto-reverting of non-file buffers is enabled, the Buffer Menu
140automatically reverts every @code{auto-revert-interval} seconds,
141whether there is a need for it or not. (It would probably take longer
142to check whether there is a need than to actually revert.)
143
144If the Buffer Menu inappropriately gets marked modified, just revert
145it manually using @kbd{g} and auto-reverting will resume. However, if
146you marked certain buffers to get deleted or to be displayed, you have
147to be careful, because reverting erases all marks. The fact that
148adding marks sets the buffer's modified flag prevents Auto Revert from
149automatically erasing the marks.
150
151@node Auto Reverting Dired
152@section Auto Reverting Dired buffers
153
154Auto-reverting Dired buffers currently works on GNU or Unix style
155operating systems. It may not work satisfactorily on some other
156systems.
157
158Dired buffers only auto-revert when the file list of the buffer's main
159directory changes. They do not auto-revert when information about a
160particular file changes or when inserted subdirectories change. To be
161sure that @emph{all} listed information is up to date, you have to
162manually revert using @kbd{g}, @emph{even} if auto-reverting is
163enabled in the Dired buffer. Sometimes, you might get the impression
164that modifying or saving files listed in the main directory actually
165does cause auto-reverting. This is because making changes to a file,
166or saving it, very often causes changes in the directory itself, for
167instance, through backup files or auto-save files. However, this is
168not guaranteed.
169
170If the Dired buffer is marked modified and there are no changes you
171want to protect, then most of the time you can make auto-reverting
172resume by manually reverting the buffer using @kbd{g}. There is one
173exception. If you flag or mark files, you can safely revert the
174buffer. This will not erase the flags or marks (unless the marked
175file has been deleted, of course). However, the buffer will stay
176modified, even after reverting, and auto-reverting will not resume.
177This is because, if you flag or mark files, you may be working on the
178buffer and you might not want the buffer to change without warning.
179If you want auto-reverting to resume in the presence of marks and
180flags, mark the buffer non-modified using @kbd{M-~}. However, adding,
181deleting or changing marks or flags will mark it modified again.
182
183Remote Dired buffers are not auto-reverted. Neither are Dired buffers
184for which you used shell wildcards or file arguments to list only some
185of the files. @samp{*Find*} and @samp{*Locate*} buffers do not
186auto-revert either.
187
188@node Supporting additional buffers
189@section Adding Support for Auto-Reverting additional Buffers.
190
191This section is intended for Elisp programmers who would like to add
192support for auto-reverting new types of buffers.
193
194To support auto-reverting the buffer must first of all have a
195@code{revert-buffer-function}. @xref{Definition of
196revert-buffer-function,, Reverting, elisp, the Emacs Lisp Reference Manual}.
197
198In addition, it @emph{must} have a @code{buffer-stale-function}.
199
200@defvar buffer-stale-function
201The value of this variable is a function to check whether a non-file
202buffer needs reverting. This should be a function with one optional
203argument @var{noconfirm}. The function should return non-@code{nil}
204if the buffer should be reverted. The buffer is current when this
205function is called.
206
207While this function is mainly intended for use in auto-reverting, it
208could be used for other purposes as well. For instance, if
209auto-reverting is not enabled, it could be used to warn the user that
210the buffer needs reverting. The idea behind the @var{noconfirm}
211argument is that it should be @code{t} if the buffer is going to be
212reverted without asking the user and @code{nil} if the function is
213just going to be used to warn the user that the buffer is out of date.
214In particular, for use in auto-reverting, @var{noconfirm} is @code{t}.
215If the function is only going to be used for auto-reverting, you can
216ignore the @var{noconfirm} argument.
217
218If you just want to automatically auto-revert every
219@code{auto-revert-interval} seconds, use:
220
221@example
222(set (make-local-variable 'buffer-stale-function)
223 #'(lambda (&optional noconfirm) 'fast))
224@end example
225
226@noindent
227in the buffer's mode function.
228
229The special return value @samp{fast} tells the caller that the need
230for reverting was not checked, but that reverting the buffer is fast.
231It also tells Auto Revert not to print any revert messages, even if
232@code{auto-revert-verbose} is non-@code{nil}. This is important, as
233getting revert messages every @code{auto-revert-interval} seconds can
234be very annoying. The information provided by this return value could
235also be useful if the function is consulted for purposes other than
236auto-reverting.
237@end defvar
238
239Once the buffer has a @code{revert-buffer-function} and a
240@code{buffer-stale-function}, several problems usually remain.
241
242The buffer will only auto-revert if it is marked unmodified. Hence,
243you will have to make sure that various functions mark the buffer
244modified if and only if either the buffer contains information that
245might be lost by reverting or there is reason to believe that the user
246might be inconvenienced by auto-reverting, because he is actively
247working on the buffer. The user can always override this by manually
248adjusting the modified status of the buffer. To support this, calling
249the @code{revert-buffer-function} on a buffer that is marked
250unmodified should always keep the buffer marked unmodified.
251
252It is important to assure that point does not continuously jump around
253as a consequence of auto-reverting. Of course, moving point might be
254inevitable if the buffer radically changes.
255
256You should make sure that the @code{revert-buffer-function} does not
257print messages that unnecessarily duplicate Auto Revert's own messages
258if @code{auto-revert-verbose} is @code{t} and effectively override a
259@code{nil} value for @code{auto-revert-verbose}. Hence, adapting a
260mode for auto-reverting often involves getting rid of such messages.
261This is especially important for buffers that automatically
262auto-revert every @code{auto-revert-interval} seconds.
263
264Also, you may want to update the documentation string of
265@code{global-auto-revert-non-file-buffers}.
266
267@ifinfo
268Finally, you should add a node to this chapter's menu. This node
269@end ifinfo
270@ifnotinfo
271Finally, you should add a section to this chapter. This section
272@end ifnotinfo
273should at the very least make clear whether enabling auto-reverting
274for the buffer reliably assures that all information in the buffer is
275completely up to date (or will be after @code{auto-revert-interval}
276seconds).
277
278@node Subdir Switches
279@chapter Subdirectory Switches in Dired
280
281You can insert subdirectories with specified @code{ls} switches in
282Dired buffers, using @kbd{C-u i}. You can change the @code{ls}
283switches of an already inserted subdirectory using @kbd{C-u l}.
284
285In Emacs versions 22.1 and later, Dired remembers the switches, so
286that reverting the buffer will not change them back to the main
287directory's switches. Deleting a subdirectory forgets about its
288switches.
289
290Using @code{dired-undo} (usually bound to @kbd{C-_} and @kbd{C-x u})
291to reinsert or delete subdirectories, that were inserted with explicit
292switches, can bypass Dired's machinery for remembering (or forgetting)
293switches. Deleting a subdirectory using @code{dired-undo} does not
294forget its switches. When later reinserted using @kbd{i}, it will be
295reinserted using its old switches. Using @code{dired-undo} to
296reinsert a subdirectory that was deleted using the regular
297Dired commands (not @code{dired-undo}) will originally insert it with
298its old switches. However, reverting the buffer will relist it using
299the buffer's default switches. If any of this yields problems, you
300can easily correct the situation using @kbd{C-u i} or @kbd{C-u l}.
301
302Dired does not remember the @code{R} switch. Inserting a subdirectory
303with switches that include the @code{R} switch is equivalent with
304inserting each of its subdirectories using all remaining switches.
305For instance, updating or killing a subdirectory that was inserted
306with the @code{R} switch will not update or kill its subdirectories.
307
308The buffer's default switches do not affect subdirectories that were
309inserted using explicitly specified switches. In particular,
310commands such as @kbd{s}, that change the buffer's switches do not
311affect such subdirectories. (They do affect subdirectories without
312explicitly assigned switches, however.)
313
314You can make Dired forget about all subdirectory switches and relist
315all subdirectories with the buffer's default switches using
316@kbd{M-x dired-reset-subdir-switches}. This also reverts the Dired buffer.
317
318
319@c Moved here from the Emacs Lisp Reference Manual, 2005-03-26.
320@node Advanced Calendar/Diary Usage
321@chapter Customizing the Calendar and Diary
322
323 There are many customizations that you can use to make the calendar and
324diary suit your personal tastes.
325
326@menu
327* Calendar Customizing:: Defaults you can set.
328* Holiday Customizing:: Defining your own holidays.
329* Date Display Format:: Changing the format.
330* Time Display Format:: Changing the format.
331* Daylight Savings:: Changing the default.
332* Diary Customizing:: Defaults you can set.
333* Hebrew/Islamic Entries:: How to obtain them.
334* Fancy Diary Display:: Enhancing the diary display, sorting entries,
335 using included diary files.
336* Sexp Diary Entries:: Fancy things you can do.
337@end menu
338
339@node Calendar Customizing
340@section Customizing the Calendar
341@vindex calendar-holiday-marker
342@vindex diary-entry-marker
343 The variable @code{calendar-holiday-marker} specifies how to mark a
344date as being a holiday. Its value may be a single-character string
345to insert next to the date, or a face name to use for displaying the
346date. Likewise, the variable @code{diary-entry-marker} specifies how
347to mark a date that has diary entries. The calendar creates faces
348named @code{holiday-face} and @code{diary-face} for these purposes;
349those symbols are the default values of these variables.
350
351@vindex calendar-load-hook
352 The variable @code{calendar-load-hook} is a normal hook run when the
353calendar package is first loaded (before actually starting to display
354the calendar).
355
356@vindex initial-calendar-window-hook
357 Starting the calendar runs the normal hook
358@code{initial-calendar-window-hook}. Recomputation of the calendar
359display does not run this hook. But if you leave the calendar with the
360@kbd{q} command and reenter it, the hook runs again.@refill
361
362@vindex today-visible-calendar-hook
363 The variable @code{today-visible-calendar-hook} is a normal hook run
364after the calendar buffer has been prepared with the calendar when the
365current date is visible in the window. One use of this hook is to
366replace today's date with asterisks; to do that, use the hook function
367@code{calendar-star-date}.
368
369@findex calendar-star-date
370@example
371(add-hook 'today-visible-calendar-hook 'calendar-star-date)
372@end example
373
374@noindent
375Another standard hook function marks the current date, either by
376changing its face or by adding an asterisk. Here's how to use it:
377
378@findex calendar-mark-today
379@example
380(add-hook 'today-visible-calendar-hook 'calendar-mark-today)
381@end example
382
383@noindent
384@vindex calendar-today-marker
385The variable @code{calendar-today-marker} specifies how to mark
386today's date. Its value should be a single-character string to insert
387next to the date or a face name to use for displaying the date. A
388face named @code{calendar-today-face} is provided for this purpose;
389that symbol is the default for this variable.
390
391@vindex today-invisible-calendar-hook
392@noindent
393 A similar normal hook, @code{today-invisible-calendar-hook} is run if
394the current date is @emph{not} visible in the window.
395
396@vindex calendar-move-hook
397 Each of the calendar cursor motion commands runs the hook
398@code{calendar-move-hook} after it moves the cursor.
399
400@node Holiday Customizing
401@section Customizing the Holidays
402
403@vindex calendar-holidays
404@vindex christian-holidays
405@vindex hebrew-holidays
406@vindex islamic-holidays
407 Emacs knows about holidays defined by entries on one of several lists.
408You can customize these lists of holidays to your own needs, adding or
409deleting holidays. The lists of holidays that Emacs uses are for
410general holidays (@code{general-holidays}), local holidays
411(@code{local-holidays}), Christian holidays (@code{christian-holidays}),
412Hebrew (Jewish) holidays (@code{hebrew-holidays}), Islamic (Muslim)
413holidays (@code{islamic-holidays}), and other holidays
414(@code{other-holidays}).
415
416@vindex general-holidays
417 The general holidays are, by default, holidays common throughout the
418United States. To eliminate these holidays, set @code{general-holidays}
419to @code{nil}.
420
421@vindex local-holidays
422 There are no default local holidays (but sites may supply some). You
423can set the variable @code{local-holidays} to any list of holidays, as
424described below.
425
426@vindex all-christian-calendar-holidays
427@vindex all-hebrew-calendar-holidays
428@vindex all-islamic-calendar-holidays
429 By default, Emacs does not include all the holidays of the religions
430that it knows, only those commonly found in secular calendars. For a
431more extensive collection of religious holidays, you can set any (or
432all) of the variables @code{all-christian-calendar-holidays},
433@code{all-hebrew-calendar-holidays}, or
434@code{all-islamic-calendar-holidays} to @code{t}. If you want to
435eliminate the religious holidays, set any or all of the corresponding
436variables @code{christian-holidays}, @code{hebrew-holidays}, and
437@code{islamic-holidays} to @code{nil}.@refill
438
439@vindex other-holidays
440 You can set the variable @code{other-holidays} to any list of
441holidays. This list, normally empty, is intended for individual use.
442
443@cindex holiday forms
444 Each of the lists (@code{general-holidays}, @code{local-holidays},
445@code{christian-holidays}, @code{hebrew-holidays},
446@code{islamic-holidays}, and @code{other-holidays}) is a list of
447@dfn{holiday forms}, each holiday form describing a holiday (or
448sometimes a list of holidays).
449
450 Here is a table of the possible kinds of holiday form. Day numbers
451and month numbers count starting from 1, but ``dayname'' numbers
452count Sunday as 0. The element @var{string} is always the
453name of the holiday, as a string.
454
455@table @code
456@item (holiday-fixed @var{month} @var{day} @var{string})
457A fixed date on the Gregorian calendar.
458
459@item (holiday-float @var{month} @var{dayname} @var{k} @var{string})
460The @var{k}th @var{dayname} in @var{month} on the Gregorian calendar
461(@var{dayname}=0 for Sunday, and so on); negative @var{k} means count back
462from the end of the month.
463
464@item (holiday-hebrew @var{month} @var{day} @var{string})
465A fixed date on the Hebrew calendar.
466
467@item (holiday-islamic @var{month} @var{day} @var{string})
468A fixed date on the Islamic calendar.
469
470@item (holiday-julian @var{month} @var{day} @var{string})
471A fixed date on the Julian calendar.
472
473@item (holiday-sexp @var{sexp} @var{string})
474A date calculated by the Lisp expression @var{sexp}. The expression
475should use the variable @code{year} to compute and return the date of a
476holiday, or @code{nil} if the holiday doesn't happen this year. The
477value of @var{sexp} must represent the date as a list of the form
478@code{(@var{month} @var{day} @var{year})}.
479
480@item (if @var{condition} @var{holiday-form})
481A holiday that happens only if @var{condition} is true.
482
483@item (@var{function} @r{[}@var{args}@r{]})
484A list of dates calculated by the function @var{function}, called with
485arguments @var{args}.
486@end table
487
488 For example, suppose you want to add Bastille Day, celebrated in
489France on July 14. You can do this as follows:
490
491@smallexample
492(setq other-holidays '((holiday-fixed 7 14 "Bastille Day")))
493@end smallexample
494
495@noindent
496The holiday form @code{(holiday-fixed 7 14 "Bastille Day")} specifies the
497fourteenth day of the seventh month (July).
498
499 Many holidays occur on a specific day of the week, at a specific time
500of month. Here is a holiday form describing Hurricane Supplication Day,
501celebrated in the Virgin Islands on the fourth Monday in August:
502
503@smallexample
504(holiday-float 8 1 4 "Hurricane Supplication Day")
505@end smallexample
506
507@noindent
508Here the 8 specifies August, the 1 specifies Monday (Sunday is 0,
509Tuesday is 2, and so on), and the 4 specifies the fourth occurrence in
510the month (1 specifies the first occurrence, 2 the second occurrence,
511@minus{}1 the last occurrence, @minus{}2 the second-to-last occurrence, and
512so on).
513
514 You can specify holidays that occur on fixed days of the Hebrew,
515Islamic, and Julian calendars too. For example,
516
517@smallexample
518(setq other-holidays
519 '((holiday-hebrew 10 2 "Last day of Hanukkah")
520 (holiday-islamic 3 12 "Mohammed's Birthday")
521 (holiday-julian 4 2 "Jefferson's Birthday")))
522@end smallexample
523
524@noindent
525adds the last day of Hanukkah (since the Hebrew months are numbered with
5261 starting from Nisan), the Islamic feast celebrating Mohammed's
527birthday (since the Islamic months are numbered from 1 starting with
528Muharram), and Thomas Jefferson's birthday, which is 2 April 1743 on the
529Julian calendar.
530
531 To include a holiday conditionally, use either Emacs Lisp's @code{if} or the
532@code{holiday-sexp} form. For example, American presidential elections
533occur on the first Tuesday after the first Monday in November of years
534divisible by 4:
535
536@smallexample
537(holiday-sexp '(if (= 0 (% year 4))
538 (calendar-gregorian-from-absolute
539 (1+ (calendar-dayname-on-or-before
540 1 (+ 6 (calendar-absolute-from-gregorian
541 (list 11 1 year)))))))
542 "US Presidential Election")
543@end smallexample
544
545@noindent
546or
547
548@smallexample
549(if (= 0 (% displayed-year 4))
550 (fixed 11
551 (extract-calendar-day
552 (calendar-gregorian-from-absolute
553 (1+ (calendar-dayname-on-or-before
554 1 (+ 6 (calendar-absolute-from-gregorian
555 (list 11 1 displayed-year)))))))
556 "US Presidential Election"))
557@end smallexample
558
559 Some holidays just don't fit into any of these forms because special
560calculations are involved in their determination. In such cases you
561must write a Lisp function to do the calculation. To include eclipses,
562for example, add @code{(eclipses)} to @code{other-holidays}
563and write an Emacs Lisp function @code{eclipses} that returns a
564(possibly empty) list of the relevant Gregorian dates among the range
565visible in the calendar window, with descriptive strings, like this:
566
567@smallexample
568(((6 27 1991) "Lunar Eclipse") ((7 11 1991) "Solar Eclipse") ... )
569@end smallexample
570
571@node Date Display Format
572@section Date Display Format
573@vindex calendar-date-display-form
574
575 You can customize the manner of displaying dates in the diary, in mode
576lines, and in messages by setting @code{calendar-date-display-form}.
577This variable holds a list of expressions that can involve the variables
578@code{month}, @code{day}, and @code{year}, which are all numbers in
579string form, and @code{monthname} and @code{dayname}, which are both
580alphabetic strings. In the American style, the default value of this
581list is as follows:
582
583@smallexample
584((if dayname (concat dayname ", ")) monthname " " day ", " year)
585@end smallexample
586
587@noindent
588while in the European style this value is the default:
589
590@smallexample
591((if dayname (concat dayname ", ")) day " " monthname " " year)
592@end smallexample
593
594@noindent
595The ISO standard date representation is this:
596
597@smallexample
598(year "-" month "-" day)
599@end smallexample
600
601@noindent
602This specifies a typical American format:
603
604@smallexample
605(month "/" day "/" (substring year -2))
606@end smallexample
607
608@node Time Display Format
609@section Time Display Format
610@vindex calendar-time-display-form
611
612 The calendar and diary by default display times of day in the
613conventional American style with the hours from 1 through 12, minutes,
614and either @samp{am} or @samp{pm}. If you prefer the European style,
615also known in the US as military, in which the hours go from 00 to 23,
616you can alter the variable @code{calendar-time-display-form}. This
617variable is a list of expressions that can involve the variables
618@code{12-hours}, @code{24-hours}, and @code{minutes}, which are all
619numbers in string form, and @code{am-pm} and @code{time-zone}, which are
620both alphabetic strings. The default value of
621@code{calendar-time-display-form} is as follows:
622
623@smallexample
624(12-hours ":" minutes am-pm
625 (if time-zone " (") time-zone (if time-zone ")"))
626@end smallexample
627
628@noindent
629Here is a value that provides European style times:
630
631@smallexample
632(24-hours ":" minutes
633 (if time-zone " (") time-zone (if time-zone ")"))
634@end smallexample
635
636@node Daylight Savings
637@section Daylight Savings Time
638@cindex daylight savings time
639
640 Emacs understands the difference between standard time and daylight
641savings time---the times given for sunrise, sunset, solstices,
642equinoxes, and the phases of the moon take that into account. The rules
643for daylight savings time vary from place to place and have also varied
644historically from year to year. To do the job properly, Emacs needs to
645know which rules to use.
646
647 Some operating systems keep track of the rules that apply to the place
648where you are; on these systems, Emacs gets the information it needs
649from the system automatically. If some or all of this information is
650missing, Emacs fills in the gaps with the rules currently used in
651Cambridge, Massachusetts, which is the center of GNU's world.
652
653
654@vindex calendar-daylight-savings-starts
655@vindex calendar-daylight-savings-ends
656 If the default choice of rules is not appropriate for your location,
657you can tell Emacs the rules to use by setting the variables
658@code{calendar-daylight-savings-starts} and
659@code{calendar-daylight-savings-ends}. Their values should be Lisp
660expressions that refer to the variable @code{year}, and evaluate to the
661Gregorian date on which daylight savings time starts or (respectively)
662ends, in the form of a list @code{(@var{month} @var{day} @var{year})}.
663The values should be @code{nil} if your area does not use daylight
664savings time.
665
666 Emacs uses these expressions to determine the start and end dates of
667daylight savings time as holidays and for correcting times of day in the
668solar and lunar calculations.
669
670 The values for Cambridge, Massachusetts are as follows:
671
672@example
673@group
674(calendar-nth-named-day 1 0 4 year)
675(calendar-nth-named-day -1 0 10 year)
676@end group
677@end example
678
679@noindent
680i.e., the first 0th day (Sunday) of the fourth month (April) in
681the year specified by @code{year}, and the last Sunday of the tenth month
682(October) of that year. If daylight savings time were
683changed to start on October 1, you would set
684@code{calendar-daylight-savings-starts} to this:
685
686@example
687(list 10 1 year)
688@end example
689
690 For a more complex example, suppose daylight savings time begins on
691the first of Nisan on the Hebrew calendar. You should set
692@code{calendar-daylight-savings-starts} to this value:
693
694@example
695(calendar-gregorian-from-absolute
696 (calendar-absolute-from-hebrew
697 (list 1 1 (+ year 3760))))
698@end example
699
700@noindent
701because Nisan is the first month in the Hebrew calendar and the Hebrew
702year differs from the Gregorian year by 3760 at Nisan.
703
704 If there is no daylight savings time at your location, or if you want
705all times in standard time, set @code{calendar-daylight-savings-starts}
706and @code{calendar-daylight-savings-ends} to @code{nil}.
707
708@vindex calendar-daylight-time-offset
709 The variable @code{calendar-daylight-time-offset} specifies the
710difference between daylight savings time and standard time, measured in
711minutes. The value for Cambridge is 60.
712
713@vindex calendar-daylight-savings-starts-time
714@vindex calendar-daylight-savings-ends-time
715 The variable @code{calendar-daylight-savings-starts-time} and the
716variable @code{calendar-daylight-savings-ends-time} specify the number
717of minutes after midnight local time when the transition to and from
718daylight savings time should occur. For Cambridge, both variables'
719values are 120.
720
721@node Diary Customizing
722@section Customizing the Diary
723
724@vindex holidays-in-diary-buffer
725 Ordinarily, the mode line of the diary buffer window indicates any
726holidays that fall on the date of the diary entries. The process of
727checking for holidays can take several seconds, so including holiday
728information delays the display of the diary buffer noticeably. If you'd
729prefer to have a faster display of the diary buffer but without the
730holiday information, set the variable @code{holidays-in-diary-buffer} to
731@code{nil}.@refill
732
733@vindex number-of-diary-entries
734 The variable @code{number-of-diary-entries} controls the number of
735days of diary entries to be displayed at one time. It affects the
736initial display when @code{view-diary-entries-initially} is @code{t}, as
737well as the command @kbd{M-x diary}. For example, the default value is
7381, which says to display only the current day's diary entries. If the
739value is 2, both the current day's and the next day's entries are
740displayed. The value can also be a vector of seven elements: for
741example, if the value is @code{[0 2 2 2 2 4 1]} then no diary entries
742appear on Sunday, the current date's and the next day's diary entries
743appear Monday through Thursday, Friday through Monday's entries appear
744on Friday, while on Saturday only that day's entries appear.
745
746@vindex print-diary-entries-hook
747@findex print-diary-entries
748 The variable @code{print-diary-entries-hook} is a normal hook run
749after preparation of a temporary buffer containing just the diary
750entries currently visible in the diary buffer. (The other, irrelevant
751diary entries are really absent from the temporary buffer; in the diary
752buffer, they are merely hidden.) The default value of this hook does
753the printing with the command @code{lpr-buffer}. If you want to use a
754different command to do the printing, just change the value of this
755hook. Other uses might include, for example, rearranging the lines into
756order by day and time.
757
758@vindex diary-date-forms
759 You can customize the form of dates in your diary file, if neither the
760standard American nor European styles suits your needs, by setting the
761variable @code{diary-date-forms}. This variable is a list of patterns
762for recognizing a date. Each date pattern is a list whose elements may
763be regular expressions (@pxref{Regular Expressions,,, elisp, the Emacs
764Lisp Reference Manual}) or the symbols @code{month}, @code{day},
765@code{year}, @code{monthname}, and @code{dayname}. All these elements
766serve as patterns that match certain kinds of text in the diary file.
767In order for the date pattern, as a whole, to match, all of its elements
768must match consecutively.
769
770 A regular expression in a date pattern matches in its usual fashion,
771using the standard syntax table altered so that @samp{*} is a word
772constituent.
773
774 The symbols @code{month}, @code{day}, @code{year}, @code{monthname},
775and @code{dayname} match the month number, day number, year number,
776month name, and day name of the date being considered. The symbols that
777match numbers allow leading zeros; those that match names allow
778three-letter abbreviations and capitalization. All the symbols can
779match @samp{*}; since @samp{*} in a diary entry means ``any day'', ``any
780month'', and so on, it should match regardless of the date being
781considered.
782
783 The default value of @code{diary-date-forms} in the American style is
784this:
785
786@example
787((month "/" day "[^/0-9]")
788 (month "/" day "/" year "[^0-9]")
789 (monthname " *" day "[^,0-9]")
790 (monthname " *" day ", *" year "[^0-9]")
791 (dayname "\\W"))
792@end example
793
794 The date patterns in the list must be @emph{mutually exclusive} and
795must not match any portion of the diary entry itself, just the date and
796one character of whitespace. If, to be mutually exclusive, the pattern
797must match a portion of the diary entry text---beyond the whitespace
798that ends the date---then the first element of the date pattern
799@emph{must} be @code{backup}. This causes the date recognizer to back
800up to the beginning of the current word of the diary entry, after
801finishing the match. Even if you use @code{backup}, the date pattern
802must absolutely not match more than a portion of the first word of the
803diary entry. The default value of @code{diary-date-forms} in the
804European style is this list:
805
806@example
807((day "/" month "[^/0-9]")
808 (day "/" month "/" year "[^0-9]")
809 (backup day " *" monthname "\\W+\\<[^*0-9]")
810 (day " *" monthname " *" year "[^0-9]")
811 (dayname "\\W"))
812@end example
813
814@noindent
815Notice the use of @code{backup} in the third pattern, because it needs
816to match part of a word beyond the date itself to distinguish it from
817the fourth pattern.
818
819@node Hebrew/Islamic Entries
820@section Hebrew- and Islamic-Date Diary Entries
821
822 Your diary file can have entries based on Hebrew or Islamic dates, as
823well as entries based on the world-standard Gregorian calendar.
824However, because recognition of such entries is time-consuming and most
825people don't use them, you must explicitly enable their use. If you
826want the diary to recognize Hebrew-date diary entries, for example,
827you must do this:
828
829@vindex nongregorian-diary-listing-hook
830@vindex nongregorian-diary-marking-hook
831@findex list-hebrew-diary-entries
832@findex mark-hebrew-diary-entries
833@smallexample
834(add-hook 'nongregorian-diary-listing-hook 'list-hebrew-diary-entries)
835(add-hook 'nongregorian-diary-marking-hook 'mark-hebrew-diary-entries)
836@end smallexample
837
838@noindent
839If you want Islamic-date entries, do this:
840
841@findex list-islamic-diary-entries
842@findex mark-islamic-diary-entries
843@smallexample
844(add-hook 'nongregorian-diary-listing-hook 'list-islamic-diary-entries)
845(add-hook 'nongregorian-diary-marking-hook 'mark-islamic-diary-entries)
846@end smallexample
847
848 Hebrew- and Islamic-date diary entries have the same formats as
849Gregorian-date diary entries, except that @samp{H} precedes a Hebrew
850date and @samp{I} precedes an Islamic date. Moreover, because the
851Hebrew and Islamic month names are not uniquely specified by the first
852three letters, you may not abbreviate them. For example, a diary entry
853for the Hebrew date Heshvan 25 could look like this:
854
855@smallexample
856HHeshvan 25 Happy Hebrew birthday!
857@end smallexample
858
859@noindent
860and would appear in the diary for any date that corresponds to Heshvan 25
861on the Hebrew calendar. And here is an Islamic-date diary entry that matches
862Dhu al-Qada 25:
863
864@smallexample
865IDhu al-Qada 25 Happy Islamic birthday!
866@end smallexample
867
868 As with Gregorian-date diary entries, Hebrew- and Islamic-date entries
869are nonmarking if they are preceded with an ampersand (@samp{&}).
870
871 Here is a table of commands used in the calendar to create diary entries
872that match the selected date and other dates that are similar in the Hebrew
873or Islamic calendar:
874
875@table @kbd
876@item i h d
877Add a diary entry for the Hebrew date corresponding to the selected date
878(@code{insert-hebrew-diary-entry}).
879@item i h m
880Add a diary entry for the day of the Hebrew month corresponding to the
881selected date (@code{insert-monthly-hebrew-diary-entry}). This diary
882entry matches any date that has the same Hebrew day-within-month as the
883selected date.
884@item i h y
885Add a diary entry for the day of the Hebrew year corresponding to the
886selected date (@code{insert-yearly-hebrew-diary-entry}). This diary
887entry matches any date which has the same Hebrew month and day-within-month
888as the selected date.
889@item i i d
890Add a diary entry for the Islamic date corresponding to the selected date
891(@code{insert-islamic-diary-entry}).
892@item i i m
893Add a diary entry for the day of the Islamic month corresponding to the
894selected date (@code{insert-monthly-islamic-diary-entry}).
895@item i i y
896Add a diary entry for the day of the Islamic year corresponding to the
897selected date (@code{insert-yearly-islamic-diary-entry}).
898@end table
899
900@findex insert-hebrew-diary-entry
901@findex insert-monthly-hebrew-diary-entry
902@findex insert-yearly-hebrew-diary-entry
903@findex insert-islamic-diary-entry
904@findex insert-monthly-islamic-diary-entry
905@findex insert-yearly-islamic-diary-entry
906 These commands work much like the corresponding commands for ordinary
907diary entries: they apply to the date that point is on in the calendar
908window, and what they do is insert just the date portion of a diary entry
909at the end of your diary file. You must then insert the rest of the
910diary entry.
911
912@node Fancy Diary Display
913@section Fancy Diary Display
914@vindex diary-display-hook
915@findex simple-diary-display
916
917 Diary display works by preparing the diary buffer and then running the
918hook @code{diary-display-hook}. The default value of this hook
919(@code{simple-diary-display}) hides the irrelevant diary entries and
920then displays the buffer. However, if you specify the hook as follows,
921
922@cindex diary buffer
923@findex fancy-diary-display
924@example
925(add-hook 'diary-display-hook 'fancy-diary-display)
926@end example
927
928@noindent
929this enables fancy diary display. It displays diary entries and
930holidays by copying them into a special buffer that exists only for the
931sake of display. Copying to a separate buffer provides an opportunity
932to change the displayed text to make it prettier---for example, to sort
933the entries by the dates they apply to.
934
935 As with simple diary display, you can print a hard copy of the buffer
936with @code{print-diary-entries}. To print a hard copy of a day-by-day
937diary for a week, position point on Sunday of that week, type
938@kbd{7 d}, and then do @kbd{M-x print-diary-entries}. As usual, the
939inclusion of the holidays slows down the display slightly; you can speed
940things up by setting the variable @code{holidays-in-diary-buffer} to
941@code{nil}.
942
943@vindex diary-list-include-blanks
944 Ordinarily, the fancy diary buffer does not show days for which there are
945no diary entries, even if that day is a holiday. If you want such days to be
946shown in the fancy diary buffer, set the variable
947@code{diary-list-include-blanks} to @code{t}.@refill
948
949@cindex sorting diary entries
950 If you use the fancy diary display, you can use the normal hook
951@code{list-diary-entries-hook} to sort each day's diary entries by their
952time of day. Here's how:
953
954@findex sort-diary-entries
955@example
956(add-hook 'list-diary-entries-hook 'sort-diary-entries t)
957@end example
958
959@noindent
960For each day, this sorts diary entries that begin with a recognizable
961time of day according to their times. Diary entries without times come
962first within each day.
963
964 Fancy diary display also has the ability to process included diary
965files. This permits a group of people to share a diary file for events
966that apply to all of them. Lines in the diary file of this form:
967
968@smallexample
969#include "@var{filename}"
970@end smallexample
971
972@noindent
973includes the diary entries from the file @var{filename} in the fancy
974diary buffer. The include mechanism is recursive, so that included files
975can include other files, and so on; you must be careful not to have a
976cycle of inclusions, of course. Here is how to enable the include
977facility:
978
979@vindex list-diary-entries-hook
980@vindex mark-diary-entries-hook
981@findex include-other-diary-files
982@findex mark-included-diary-files
983@smallexample
984(add-hook 'list-diary-entries-hook 'include-other-diary-files)
985(add-hook 'mark-diary-entries-hook 'mark-included-diary-files)
986@end smallexample
987
988The include mechanism works only with the fancy diary display, because
989ordinary diary display shows the entries directly from your diary file.
990
991@node Sexp Diary Entries
992@section Sexp Entries and the Fancy Diary Display
993@cindex sexp diary entries
994
995 Sexp diary entries allow you to do more than just have complicated
996conditions under which a diary entry applies. If you use the fancy
997diary display, sexp entries can generate the text of the entry depending
998on the date itself. For example, an anniversary diary entry can insert
999the number of years since the anniversary date into the text of the
1000diary entry. Thus the @samp{%d} in this dairy entry:
1001
1002@findex diary-anniversary
1003@smallexample
1004%%(diary-anniversary 10 31 1948) Arthur's birthday (%d years old)
1005@end smallexample
1006
1007@noindent
1008gets replaced by the age, so on October 31, 1990 the entry appears in
1009the fancy diary buffer like this:
1010
1011@smallexample
1012Arthur's birthday (42 years old)
1013@end smallexample
1014
1015@noindent
1016If the diary file instead contains this entry:
1017
1018@smallexample
1019%%(diary-anniversary 10 31 1948) Arthur's %d%s birthday
1020@end smallexample
1021
1022@noindent
1023the entry in the fancy diary buffer for October 31, 1990 appears like this:
1024
1025@smallexample
1026Arthur's 42nd birthday
1027@end smallexample
1028
1029 Similarly, cyclic diary entries can interpolate the number of repetitions
1030that have occurred:
1031
1032@findex diary-cyclic
1033@smallexample
1034%%(diary-cyclic 50 1 1 1990) Renew medication (%d%s time)
1035@end smallexample
1036
1037@noindent
1038looks like this:
1039
1040@smallexample
1041Renew medication (5th time)
1042@end smallexample
1043
1044@noindent
1045in the fancy diary display on September 8, 1990.
1046
1047 There is an early reminder diary sexp that includes its entry in the
1048diary not only on the date of occurrence, but also on earlier dates.
1049For example, if you want a reminder a week before your anniversary, you
1050can use
1051
1052@findex diary-remind
1053@smallexample
1054%%(diary-remind '(diary-anniversary 12 22 1968) 7) Ed's anniversary
1055@end smallexample
1056
1057@noindent
1058and the fancy diary will show
1059@smallexample
1060Ed's anniversary
1061@end smallexample
1062@noindent
1063both on December 15 and on December 22.
1064
1065@findex diary-date
1066 The function @code{diary-date} applies to dates described by a month,
1067day, year combination, each of which can be an integer, a list of
1068integers, or @code{t}. The value @code{t} means all values. For
1069example,
1070
1071@smallexample
1072%%(diary-date '(10 11 12) 22 t) Rake leaves
1073@end smallexample
1074
1075@noindent
1076causes the fancy diary to show
1077
1078@smallexample
1079Rake leaves
1080@end smallexample
1081
1082@noindent
1083on October 22, November 22, and December 22 of every year.
1084
1085@findex diary-float
1086 The function @code{diary-float} allows you to describe diary entries
1087that apply to dates like the third Friday of November, or the last
1088Tuesday in April. The parameters are the @var{month}, @var{dayname},
1089and an index @var{n}. The entry appears on the @var{n}th @var{dayname}
1090of @var{month}, where @var{dayname}=0 means Sunday, 1 means Monday, and
1091so on. If @var{n} is negative it counts backward from the end of
1092@var{month}. The value of @var{month} can be a list of months, a single
1093month, or @code{t} to specify all months. You can also use an optional
1094parameter @var{day} to specify the @var{n}th @var{dayname} of
1095@var{month} on or after/before @var{day}; the value of @var{day} defaults
1096to 1 if @var{n} is positive and to the last day of @var{month} if
1097@var{n} is negative. For example,
1098
1099@smallexample
1100%%(diary-float t 1 -1) Pay rent
1101@end smallexample
1102
1103@noindent
1104causes the fancy diary to show
1105
1106@smallexample
1107Pay rent
1108@end smallexample
1109
1110@noindent
1111on the last Monday of every month.
1112
1113 The generality of sexp diary entries lets you specify any diary
1114entry that you can describe algorithmically. A sexp diary entry
1115contains an expression that computes whether the entry applies to any
1116given date. If its value is non-@code{nil}, the entry applies to that
1117date; otherwise, it does not. The expression can use the variable
1118@code{date} to find the date being considered; its value is a list
1119(@var{month} @var{day} @var{year}) that refers to the Gregorian
1120calendar.
1121
1122 The sexp diary entry applies to a date when the expression's value
1123is non-@code{nil}, but some values have more specific meanings. If
1124the value is a string, that string is a description of the event which
1125occurs on that date. The value can also have the form
1126@code{(@var{mark} . @var{string})}; then @var{mark} specifies how to
1127mark the date in the calendar, and @var{string} is the description of
1128the event. If @var{mark} is a single-character string, that character
1129appears next to the date in the calendar. If @var{mark} is a face
1130name, the date is displayed in that face. If @var{mark} is
1131@code{nil}, that specifies no particular highlighting for the date.
1132
1133 Suppose you get paid on the 21st of the month if it is a weekday, and
1134on the Friday before if the 21st is on a weekend. Here is how to write
1135a sexp diary entry that matches those dates:
1136
1137@smallexample
1138&%%(let ((dayname (calendar-day-of-week date))
1139 (day (car (cdr date))))
1140 (or (and (= day 21) (memq dayname '(1 2 3 4 5)))
1141 (and (memq day '(19 20)) (= dayname 5)))
1142 ) Pay check deposited
1143@end smallexample
1144
1145 The following sexp diary entries take advantage of the ability (in the fancy
1146diary display) to concoct diary entries whose text varies based on the date:
1147
1148@findex diary-sunrise-sunset
1149@findex diary-phases-of-moon
1150@findex diary-day-of-year
1151@findex diary-iso-date
1152@findex diary-julian-date
1153@findex diary-astro-day-number
1154@findex diary-hebrew-date
1155@findex diary-islamic-date
1156@findex diary-french-date
1157@findex diary-mayan-date
1158@table @code
1159@item %%(diary-sunrise-sunset)
1160Make a diary entry for the local times of today's sunrise and sunset.
1161@item %%(diary-phases-of-moon)
1162Make a diary entry for the phases (quarters) of the moon.
1163@item %%(diary-day-of-year)
1164Make a diary entry with today's day number in the current year and the number
1165of days remaining in the current year.
1166@item %%(diary-iso-date)
1167Make a diary entry with today's equivalent ISO commercial date.
1168@item %%(diary-julian-date)
1169Make a diary entry with today's equivalent date on the Julian calendar.
1170@item %%(diary-astro-day-number)
1171Make a diary entry with today's equivalent astronomical (Julian) day number.
1172@item %%(diary-hebrew-date)
1173Make a diary entry with today's equivalent date on the Hebrew calendar.
1174@item %%(diary-islamic-date)
1175Make a diary entry with today's equivalent date on the Islamic calendar.
1176@item %%(diary-french-date)
1177Make a diary entry with today's equivalent date on the French Revolutionary
1178calendar.
1179@item %%(diary-mayan-date)
1180Make a diary entry with today's equivalent date on the Mayan calendar.
1181@end table
1182
1183@noindent
1184Thus including the diary entry
1185
1186@example
1187&%%(diary-hebrew-date)
1188@end example
1189
1190@noindent
1191causes every day's diary display to contain the equivalent date on the
1192Hebrew calendar, if you are using the fancy diary display. (With simple
1193diary display, the line @samp{&%%(diary-hebrew-date)} appears in the
1194diary for any date, but does nothing particularly useful.)
1195
1196 These functions can be used to construct sexp diary entries based on
1197the Hebrew calendar in certain standard ways:
1198
1199@cindex rosh hodesh
1200@findex diary-rosh-hodesh
1201@cindex parasha, weekly
1202@findex diary-parasha
1203@cindex candle lighting times
1204@findex diary-sabbath-candles
1205@cindex omer count
1206@findex diary-omer
1207@cindex yahrzeits
1208@findex diary-yahrzeit
1209@table @code
1210@item %%(diary-rosh-hodesh)
1211Make a diary entry that tells the occurrence and ritual announcement of each
1212new Hebrew month.
1213@item %%(diary-parasha)
1214Make a Saturday diary entry that tells the weekly synagogue scripture reading.
1215@item %%(diary-sabbath-candles)
1216Make a Friday diary entry that tells the @emph{local time} of Sabbath
1217candle lighting.
1218@item %%(diary-omer)
1219Make a diary entry that gives the omer count, when appropriate.
1220@item %%(diary-yahrzeit @var{month} @var{day} @var{year}) @var{name}
1221Make a diary entry marking the anniversary of a date of death. The date
1222is the @emph{Gregorian} (civil) date of death. The diary entry appears
1223on the proper Hebrew calendar anniversary and on the day before. (In
1224the European style, the order of the parameters is changed to @var{day},
1225@var{month}, @var{year}.)
1226@end table
1227
1228 All the functions documented above take an optional argument
1229@var{mark} which specifies how to mark the date in the calendar display.
1230If one of these functions decides that it applies to a certain date,
1231it returns a value that contains @var{mark}.
1232
1233@node Emerge
1234@chapter Merging Files with Emerge
1235@cindex Emerge
1236@cindex merging files
1237
1238 It's not unusual for programmers to get their signals crossed and
1239modify the same program in two different directions. To recover from
1240this confusion, you need to merge the two versions. Emerge makes this
1241easier. For other ways to compare files, see @ref{Comparing Files,,,
1242emacs, the Emacs Manual} and @ref{Top, Ediff,, ediff, The Ediff
1243Manual}.
1244
1245@menu
1246* Overview of Emerge:: How to start Emerge. Basic concepts.
1247* Submodes of Emerge:: Fast mode vs. Edit mode.
1248 Skip Prefers mode and Auto Advance mode.
1249* State of Difference:: You do the merge by specifying state A or B
1250 for each difference.
1251* Merge Commands:: Commands for selecting a difference,
1252 changing states of differences, etc.
1253* Exiting Emerge:: What to do when you've finished the merge.
1254* Combining in Emerge:: How to keep both alternatives for a difference.
1255* Fine Points of Emerge:: Misc.
1256@end menu
1257
1258@node Overview of Emerge
1259@section Overview of Emerge
1260
1261 To start Emerge, run one of these four commands:
1262
1263@table @kbd
1264@item M-x emerge-files
1265@findex emerge-files
1266Merge two specified files.
1267
1268@item M-x emerge-files-with-ancestor
1269@findex emerge-files-with-ancestor
1270Merge two specified files, with reference to a common ancestor.
1271
1272@item M-x emerge-buffers
1273@findex emerge-buffers
1274Merge two buffers.
1275
1276@item M-x emerge-buffers-with-ancestor
1277@findex emerge-buffers-with-ancestor
1278Merge two buffers with reference to a common ancestor in a third
1279buffer.
1280@end table
1281
1282@cindex merge buffer (Emerge)
1283@cindex A and B buffers (Emerge)
1284 The Emerge commands compare two files or buffers, and display the
1285comparison in three buffers: one for each input text (the @dfn{A buffer}
1286and the @dfn{B buffer}), and one (the @dfn{merge buffer}) where merging
1287takes place. The merge buffer shows the full merged text, not just the
1288differences. Wherever the two input texts differ, you can choose which
1289one of them to include in the merge buffer.
1290
1291 The Emerge commands that take input from existing buffers use only
1292the accessible portions of those buffers, if they are narrowed.
1293@xref{Narrowing,,, emacs, the Emacs Manual}.
1294
1295
1296 If a common ancestor version is available, from which the two texts to
1297be merged were both derived, Emerge can use it to guess which
1298alternative is right. Wherever one current version agrees with the
1299ancestor, Emerge presumes that the other current version is a deliberate
1300change which should be kept in the merged version. Use the
1301@samp{with-ancestor} commands if you want to specify a common ancestor
1302text. These commands read three file or buffer names---variant A,
1303variant B, and the common ancestor.
1304
1305 After the comparison is done and the buffers are prepared, the
1306interactive merging starts. You control the merging by typing special
1307@dfn{merge commands} in the merge buffer (@pxref{Merge Commands}).
1308For each run of differences between the input texts, you can choose
1309which one of them to keep, or edit them both together.
1310
1311 The merge buffer uses a special major mode, Emerge mode, with commands
1312for making these choices. But you can also edit the buffer with
1313ordinary Emacs commands.
1314
1315 At any given time, the attention of Emerge is focused on one
1316particular difference, called the @dfn{selected} difference. This
1317difference is marked off in the three buffers like this:
1318
1319@example
1320vvvvvvvvvvvvvvvvvvvv
1321@var{text that differs}
1322^^^^^^^^^^^^^^^^^^^^
1323@end example
1324
1325@noindent
1326Emerge numbers all the differences sequentially and the mode
1327line always shows the number of the selected difference.
1328
1329 Normally, the merge buffer starts out with the A version of the text.
1330But when the A version of a difference agrees with the common ancestor,
1331then the B version is initially preferred for that difference.
1332
1333 Emerge leaves the merged text in the merge buffer when you exit. At
1334that point, you can save it in a file with @kbd{C-x C-w}. If you give a
1335numeric argument to @code{emerge-files} or
1336@code{emerge-files-with-ancestor}, it reads the name of the output file
1337using the minibuffer. (This is the last file name those commands read.)
1338Then exiting from Emerge saves the merged text in the output file.
1339
1340 Normally, Emerge commands save the output buffer in its file when you
1341exit. If you abort Emerge with @kbd{C-]}, the Emerge command does not
1342save the output buffer, but you can save it yourself if you wish.
1343
1344@node Submodes of Emerge
1345@section Submodes of Emerge
1346
1347 You can choose between two modes for giving merge commands: Fast mode
1348and Edit mode. In Fast mode, basic merge commands are single
1349characters, but ordinary Emacs commands are disabled. This is
1350convenient if you use only merge commands. In Edit mode, all merge
1351commands start with the prefix key @kbd{C-c C-c}, and the normal Emacs
1352commands are also available. This allows editing the merge buffer, but
1353slows down Emerge operations.
1354
1355 Use @kbd{e} to switch to Edit mode, and @kbd{C-c C-c f} to switch to
1356Fast mode. The mode line indicates Edit and Fast modes with @samp{E}
1357and @samp{F}.
1358
1359 Emerge has two additional submodes that affect how particular merge
1360commands work: Auto Advance mode and Skip Prefers mode.
1361
1362 If Auto Advance mode is in effect, the @kbd{a} and @kbd{b} commands
1363advance to the next difference. This lets you go through the merge
1364faster as long as you simply choose one of the alternatives from the
1365input. The mode line indicates Auto Advance mode with @samp{A}.
1366
1367 If Skip Prefers mode is in effect, the @kbd{n} and @kbd{p} commands
1368skip over differences in states prefer-A and prefer-B (@pxref{State of
1369Difference}). Thus you see only differences for which neither version
1370is presumed ``correct.'' The mode line indicates Skip Prefers mode with
1371@samp{S}.
1372
1373@findex emerge-auto-advance-mode
1374@findex emerge-skip-prefers-mode
1375 Use the command @kbd{s a} (@code{emerge-auto-advance-mode}) to set or
1376clear Auto Advance mode. Use @kbd{s s}
1377(@code{emerge-skip-prefers-mode}) to set or clear Skip Prefers mode.
1378These commands turn on the mode with a positive argument, turns it off
1379with a negative or zero argument, and toggle the mode with no argument.
1380
1381@node State of Difference
1382@section State of a Difference
1383
1384 In the merge buffer, a difference is marked with lines of @samp{v} and
1385@samp{^} characters. Each difference has one of these seven states:
1386
1387@table @asis
1388@item A
1389The difference is showing the A version. The @kbd{a} command always
1390produces this state; the mode line indicates it with @samp{A}.
1391
1392@item B
1393The difference is showing the B version. The @kbd{b} command always
1394produces this state; the mode line indicates it with @samp{B}.
1395
1396@item default-A
1397@itemx default-B
1398The difference is showing the A or the B state by default, because you
1399haven't made a choice. All differences start in the default-A state
1400(and thus the merge buffer is a copy of the A buffer), except those for
1401which one alternative is ``preferred'' (see below).
1402
1403When you select a difference, its state changes from default-A or
1404default-B to plain A or B. Thus, the selected difference never has
1405state default-A or default-B, and these states are never displayed in
1406the mode line.
1407
1408The command @kbd{d a} chooses default-A as the default state, and @kbd{d
1409b} chooses default-B. This chosen default applies to all differences
1410which you haven't ever selected and for which no alternative is preferred.
1411If you are moving through the merge sequentially, the differences you
1412haven't selected are those following the selected one. Thus, while
1413moving sequentially, you can effectively make the A version the default
1414for some sections of the merge buffer and the B version the default for
1415others by using @kbd{d a} and @kbd{d b} between sections.
1416
1417@item prefer-A
1418@itemx prefer-B
1419The difference is showing the A or B state because it is
1420@dfn{preferred}. This means that you haven't made an explicit choice,
1421but one alternative seems likely to be right because the other
1422alternative agrees with the common ancestor. Thus, where the A buffer
1423agrees with the common ancestor, the B version is preferred, because
1424chances are it is the one that was actually changed.
1425
1426These two states are displayed in the mode line as @samp{A*} and @samp{B*}.
1427
1428@item combined
1429The difference is showing a combination of the A and B states, as a
1430result of the @kbd{x c} or @kbd{x C} commands.
1431
1432Once a difference is in this state, the @kbd{a} and @kbd{b} commands
1433don't do anything to it unless you give them a numeric argument.
1434
1435The mode line displays this state as @samp{comb}.
1436@end table
1437
1438@node Merge Commands
1439@section Merge Commands
1440
1441 Here are the Merge commands for Fast mode; in Edit mode, precede them
1442with @kbd{C-c C-c}:
1443
1444@table @kbd
1445@item p
1446Select the previous difference.
1447
1448@item n
1449Select the next difference.
1450
1451@item a
1452Choose the A version of this difference.
1453
1454@item b
1455Choose the B version of this difference.
1456
1457@item C-u @var{n} j
1458Select difference number @var{n}.
1459
1460@item .
1461Select the difference containing point. You can use this command in the
1462merge buffer or in the A or B buffer.
1463
1464@item q
1465Quit---finish the merge.
1466
1467@item C-]
1468Abort---exit merging and do not save the output.
1469
1470@item f
1471Go into Fast mode. (In Edit mode, this is actually @kbd{C-c C-c f}.)
1472
1473@item e
1474Go into Edit mode.
1475
1476@item l
1477Recenter (like @kbd{C-l}) all three windows.
1478
1479@item -
1480Specify part of a prefix numeric argument.
1481
1482@item @var{digit}
1483Also specify part of a prefix numeric argument.
1484
1485@item d a
1486Choose the A version as the default from here down in
1487the merge buffer.
1488
1489@item d b
1490Choose the B version as the default from here down in
1491the merge buffer.
1492
1493@item c a
1494Copy the A version of this difference into the kill ring.
1495
1496@item c b
1497Copy the B version of this difference into the kill ring.
1498
1499@item i a
1500Insert the A version of this difference at point.
1501
1502@item i b
1503Insert the B version of this difference at point.
1504
1505@item m
1506Put point and mark around the difference.
1507
1508@item ^
1509Scroll all three windows down (like @kbd{M-v}).
1510
1511@item v
1512Scroll all three windows up (like @kbd{C-v}).
1513
1514@item <
1515Scroll all three windows left (like @kbd{C-x <}).
1516
1517@item >
1518Scroll all three windows right (like @kbd{C-x >}).
1519
1520@item |
1521Reset horizontal scroll on all three windows.
1522
1523@item x 1
1524Shrink the merge window to one line. (Use @kbd{C-u l} to restore it
1525to full size.)
1526
1527@item x c
1528Combine the two versions of this difference (@pxref{Combining in
1529Emerge}).
1530
1531@item x f
1532Show the names of the files/buffers Emerge is operating on, in a Help
1533window. (Use @kbd{C-u l} to restore windows.)
1534
1535@item x j
1536Join this difference with the following one.
1537(@kbd{C-u x j} joins this difference with the previous one.)
1538
1539@item x s
1540Split this difference into two differences. Before you use this
1541command, position point in each of the three buffers at the place where
1542you want to split the difference.
1543
1544@item x t
1545Trim identical lines off the top and bottom of the difference.
1546Such lines occur when the A and B versions are
1547identical but differ from the ancestor version.
1548@end table
1549
1550@node Exiting Emerge
1551@section Exiting Emerge
1552
1553 The @kbd{q} command (@code{emerge-quit}) finishes the merge, storing
1554the results into the output file if you specified one. It restores the
1555A and B buffers to their proper contents, or kills them if they were
1556created by Emerge and you haven't changed them. It also disables the
1557Emerge commands in the merge buffer, since executing them later could
1558damage the contents of the various buffers.
1559
1560 @kbd{C-]} aborts the merge. This means exiting without writing the
1561output file. If you didn't specify an output file, then there is no
1562real difference between aborting and finishing the merge.
1563
1564 If the Emerge command was called from another Lisp program, then its
1565return value is @code{t} for successful completion, or @code{nil} if you
1566abort.
1567
1568@node Combining in Emerge
1569@section Combining the Two Versions
1570
1571 Sometimes you want to keep @emph{both} alternatives for a particular
1572difference. To do this, use @kbd{x c}, which edits the merge buffer
1573like this:
1574
1575@example
1576@group
1577#ifdef NEW
1578@var{version from A buffer}
1579#else /* not NEW */
1580@var{version from B buffer}
1581#endif /* not NEW */
1582@end group
1583@end example
1584
1585@noindent
1586@vindex emerge-combine-versions-template
1587While this example shows C preprocessor conditionals delimiting the two
1588alternative versions, you can specify the strings to use by setting
1589the variable @code{emerge-combine-versions-template} to a string of your
1590choice. In the string, @samp{%a} says where to put version A, and
1591@samp{%b} says where to put version B. The default setting, which
1592produces the results shown above, looks like this:
1593
1594@example
1595@group
1596"#ifdef NEW\n%a#else /* not NEW */\n%b#endif /* not NEW */\n"
1597@end group
1598@end example
1599
1600@node Fine Points of Emerge
1601@section Fine Points of Emerge
1602
1603 During the merge, you mustn't try to edit the A and B buffers yourself.
1604Emerge modifies them temporarily, but ultimately puts them back the way
1605they were.
1606
1607 You can have any number of merges going at once---just don't use any one
1608buffer as input to more than one merge at once, since the temporary
1609changes made in these buffers would get in each other's way.
1610
1611 Starting Emerge can take a long time because it needs to compare the
1612files fully. Emacs can't do anything else until @code{diff} finishes.
1613Perhaps in the future someone will change Emerge to do the comparison in
1614the background when the input files are large---then you could keep on
1615doing other things with Emacs until Emerge is ready to accept
1616commands.
1617
1618@vindex emerge-startup-hook
1619 After setting up the merge, Emerge runs the hook
1620@code{emerge-startup-hook}. @xref{Hooks,,, emacs, the Emacs Manual}.
1621
1622@node Picture Mode
1623@chapter Editing Pictures
1624@cindex pictures
1625@cindex making pictures out of text characters
1626@findex edit-picture
1627
1628 To edit a picture made out of text characters (for example, a picture
1629of the division of a register into fields, as a comment in a program),
1630use the command @kbd{M-x edit-picture} to enter Picture mode.
1631
1632 In Picture mode, editing is based on the @dfn{quarter-plane} model of
1633text, according to which the text characters lie studded on an area that
1634stretches infinitely far to the right and downward. The concept of the end
1635of a line does not exist in this model; the most you can say is where the
1636last nonblank character on the line is found.
1637
1638 Of course, Emacs really always considers text as a sequence of
1639characters, and lines really do have ends. But Picture mode replaces
1640the most frequently-used commands with variants that simulate the
1641quarter-plane model of text. They do this by inserting spaces or by
1642converting tabs to spaces.
1643
1644 Most of the basic editing commands of Emacs are redefined by Picture mode
1645to do essentially the same thing but in a quarter-plane way. In addition,
1646Picture mode defines various keys starting with the @kbd{C-c} prefix to
1647run special picture editing commands.
1648
1649 One of these keys, @kbd{C-c C-c}, is particularly important. Often a
1650picture is part of a larger file that is usually edited in some other
1651major mode. @kbd{M-x edit-picture} records the name of the previous
1652major mode so you can use the @kbd{C-c C-c} command
1653(@code{picture-mode-exit}) later to go back to that mode. @kbd{C-c C-c}
1654also deletes spaces from the ends of lines, unless given a numeric
1655argument.
1656
1657 The special commands of Picture mode all work in other modes (provided
1658the @file{picture} library is loaded), but are not bound to keys except
1659in Picture mode. The descriptions below talk of moving ``one column''
1660and so on, but all the picture mode commands handle numeric arguments as
1661their normal equivalents do.
1662
1663@vindex picture-mode-hook
1664 Turning on Picture mode runs the hook @code{picture-mode-hook}.
1665Additional extensions to Picture mode can be found in
1666@file{artist.el}.
1667
1668@menu
1669* Basic Picture:: Basic concepts and simple commands of Picture Mode.
1670* Insert in Picture:: Controlling direction of cursor motion
1671 after "self-inserting" characters.
1672* Tabs in Picture:: Various features for tab stops and indentation.
1673* Rectangles in Picture:: Clearing and superimposing rectangles.
1674@end menu
1675
1676@node Basic Picture
1677@section Basic Editing in Picture Mode
1678
1679@findex picture-forward-column
1680@findex picture-backward-column
1681@findex picture-move-down
1682@findex picture-move-up
1683@cindex editing in Picture mode
1684
1685 Most keys do the same thing in Picture mode that they usually do, but
1686do it in a quarter-plane style. For example, @kbd{C-f} is rebound to
1687run @code{picture-forward-column}, a command which moves point one
1688column to the right, inserting a space if necessary so that the actual
1689end of the line makes no difference. @kbd{C-b} is rebound to run
1690@code{picture-backward-column}, which always moves point left one
1691column, converting a tab to multiple spaces if necessary. @kbd{C-n} and
1692@kbd{C-p} are rebound to run @code{picture-move-down} and
1693@code{picture-move-up}, which can either insert spaces or convert tabs
1694as necessary to make sure that point stays in exactly the same column.
1695@kbd{C-e} runs @code{picture-end-of-line}, which moves to after the last
1696nonblank character on the line. There is no need to change @kbd{C-a},
1697as the choice of screen model does not affect beginnings of
1698lines.
1699
1700@findex picture-newline
1701 Insertion of text is adapted to the quarter-plane screen model
1702through the use of Overwrite mode (@pxref{Minor Modes,,, emacs, the
1703Emacs Manual}.) Self-inserting characters replace existing text,
1704column by column, rather than pushing existing text to the right.
1705@key{RET} runs @code{picture-newline}, which just moves to the
1706beginning of the following line so that new text will replace that
1707line.
1708
1709@findex picture-backward-clear-column
1710@findex picture-clear-column
1711@findex picture-clear-line
1712 In Picture mode, the commands that normally delete or kill text,
1713instead erase text (replacing it with spaces). @key{DEL}
1714(@code{picture-backward-clear-column}) replaces the preceding
1715character with a space rather than removing it; this moves point
1716backwards. @kbd{C-d} (@code{picture-clear-column}) replaces the next
1717character or characters with spaces, but does not move point. (If you
1718want to clear characters to spaces and move forward over them, use
1719@key{SPC}.) @kbd{C-k} (@code{picture-clear-line}) really kills the
1720contents of lines, but does not delete the newlines from the buffer.
1721
1722@findex picture-open-line
1723 To do actual insertion, you must use special commands. @kbd{C-o}
1724(@code{picture-open-line}) creates a blank line after the current
1725line; it never splits a line. @kbd{C-M-o} (@code{split-line}) makes
1726sense in Picture mode, so it is not changed. @kbd{C-j}
1727(@code{picture-duplicate-line}) inserts another line with the same
1728contents below the current line.
1729
1730@kindex C-c C-d @r{(Picture mode)}
1731 To do actual deletion in Picture mode, use @kbd{C-w}, @kbd{C-c C-d}
1732(which is defined as @code{delete-char}, as @kbd{C-d} is in other
1733modes), or one of the picture rectangle commands (@pxref{Rectangles in
1734Picture}).
1735
1736@node Insert in Picture
1737@section Controlling Motion after Insert
1738
1739@findex picture-movement-up
1740@findex picture-movement-down
1741@findex picture-movement-left
1742@findex picture-movement-right
1743@findex picture-movement-nw
1744@findex picture-movement-ne
1745@findex picture-movement-sw
1746@findex picture-movement-se
1747@kindex C-c < @r{(Picture mode)}
1748@kindex C-c > @r{(Picture mode)}
1749@kindex C-c ^ @r{(Picture mode)}
1750@kindex C-c . @r{(Picture mode)}
1751@kindex C-c ` @r{(Picture mode)}
1752@kindex C-c ' @r{(Picture mode)}
1753@kindex C-c / @r{(Picture mode)}
1754@kindex C-c \ @r{(Picture mode)}
1755 Since ``self-inserting'' characters in Picture mode overwrite and move
1756point, there is no essential restriction on how point should be moved.
1757Normally point moves right, but you can specify any of the eight
1758orthogonal or diagonal directions for motion after a ``self-inserting''
1759character. This is useful for drawing lines in the buffer.
1760
1761@table @kbd
1762@item C-c <
1763@itemx C-c @key{LEFT}
1764Move left after insertion (@code{picture-movement-left}).
1765@item C-c >
1766@itemx C-c @key{RIGHT}
1767Move right after insertion (@code{picture-movement-right}).
1768@item C-c ^
1769@itemx C-c @key{UP}
1770Move up after insertion (@code{picture-movement-up}).
1771@item C-c .
1772@itemx C-c @key{DOWN}
1773Move down after insertion (@code{picture-movement-down}).
1774@item C-c `
1775@itemx C-c @key{HOME}
1776Move up and left (``northwest'') after insertion (@code{picture-movement-nw}).
1777@item C-c '
1778@itemx C-c @key{PAGEUP}
1779Move up and right (``northeast'') after insertion
1780(@code{picture-movement-ne}).
1781@item C-c /
1782@itemx C-c @key{END}
1783Move down and left (``southwest'') after insertion
1784@*(@code{picture-movement-sw}).
1785@item C-c \
1786@itemx C-c @key{PAGEDOWN}
1787Move down and right (``southeast'') after insertion
1788@*(@code{picture-movement-se}).
1789@end table
1790
1791@kindex C-c C-f @r{(Picture mode)}
1792@kindex C-c C-b @r{(Picture mode)}
1793@findex picture-motion
1794@findex picture-motion-reverse
1795 Two motion commands move based on the current Picture insertion
1796direction. The command @kbd{C-c C-f} (@code{picture-motion}) moves in the
1797same direction as motion after ``insertion'' currently does, while @kbd{C-c
1798C-b} (@code{picture-motion-reverse}) moves in the opposite direction.
1799
1800@node Tabs in Picture
1801@section Picture Mode Tabs
1802
1803@kindex M-TAB @r{(Picture mode)}
1804@findex picture-tab-search
1805@vindex picture-tab-chars
1806 Two kinds of tab-like action are provided in Picture mode. Use
1807@kbd{M-@key{TAB}} (@code{picture-tab-search}) for context-based tabbing.
1808With no argument, it moves to a point underneath the next
1809``interesting'' character that follows whitespace in the previous
1810nonblank line. ``Next'' here means ``appearing at a horizontal position
1811greater than the one point starts out at.'' With an argument, as in
1812@kbd{C-u M-@key{TAB}}, this command moves to the next such interesting
1813character in the current line. @kbd{M-@key{TAB}} does not change the
1814text; it only moves point. ``Interesting'' characters are defined by
1815the variable @code{picture-tab-chars}, which should define a set of
1816characters. The syntax for this variable is like the syntax used inside
1817of @samp{[@dots{}]} in a regular expression---but without the @samp{[}
1818and the @samp{]}. Its default value is @code{"!-~"}.
1819
1820@findex picture-tab
1821 @key{TAB} itself runs @code{picture-tab}, which operates based on the
1822current tab stop settings; it is the Picture mode equivalent of
1823@code{tab-to-tab-stop}. Normally it just moves point, but with a numeric
1824argument it clears the text that it moves over.
1825
1826@kindex C-c TAB @r{(Picture mode)}
1827@findex picture-set-tab-stops
1828 The context-based and tab-stop-based forms of tabbing are brought
1829together by the command @kbd{C-c @key{TAB}} (@code{picture-set-tab-stops}).
1830This command sets the tab stops to the positions which @kbd{M-@key{TAB}}
1831would consider significant in the current line. The use of this command,
1832together with @key{TAB}, can get the effect of context-based tabbing. But
1833@kbd{M-@key{TAB}} is more convenient in the cases where it is sufficient.
1834
1835 It may be convenient to prevent use of actual tab characters in
1836pictures. For example, this prevents @kbd{C-x @key{TAB}} from messing
1837up the picture. You can do this by setting the variable
1838@code{indent-tabs-mode} to @code{nil}.
1839
1840@node Rectangles in Picture
1841@section Picture Mode Rectangle Commands
1842@cindex rectangles and Picture mode
1843@cindex Picture mode and rectangles
1844
1845 Picture mode defines commands for working on rectangular pieces of
1846the text in ways that fit with the quarter-plane model. The standard
1847rectangle commands may also be useful. @xref{Rectangles,,, emacs, the
1848Emacs Manual}.
1849
1850@table @kbd
1851@item C-c C-k
1852Clear out the region-rectangle with spaces
1853(@code{picture-clear-rectangle}). With argument, delete the text.
1854@item C-c C-w @var{r}
1855Similar, but save rectangle contents in register @var{r} first
1856(@code{picture-clear-rectangle-to-register}).
1857@item C-c C-y
1858Copy last killed rectangle into the buffer by overwriting, with upper
1859left corner at point (@code{picture-yank-rectangle}). With argument,
1860insert instead.
1861@item C-c C-x @var{r}
1862Similar, but use the rectangle in register @var{r}
1863(@code{picture-yank-rectangle-from-register}).
1864@end table
1865
1866@kindex C-c C-k @r{(Picture mode)}
1867@kindex C-c C-w @r{(Picture mode)}
1868@findex picture-clear-rectangle
1869@findex picture-clear-rectangle-to-register
1870 The picture rectangle commands @kbd{C-c C-k}
1871(@code{picture-clear-rectangle}) and @kbd{C-c C-w}
1872(@code{picture-clear-rectangle-to-register}) differ from the standard
1873rectangle commands in that they normally clear the rectangle instead of
1874deleting it; this is analogous with the way @kbd{C-d} is changed in Picture
1875mode.
1876
1877 However, deletion of rectangles can be useful in Picture mode, so
1878these commands delete the rectangle if given a numeric argument.
1879@kbd{C-c C-k} either with or without a numeric argument saves the
1880rectangle for @kbd{C-c C-y}.
1881
1882@kindex C-c C-y @r{(Picture mode)}
1883@kindex C-c C-x @r{(Picture mode)}
1884@findex picture-yank-rectangle
1885@findex picture-yank-rectangle-from-register
1886 The Picture mode commands for yanking rectangles differ from the
1887standard ones in that they overwrite instead of inserting. This is
1888the same way that Picture mode insertion of other text differs from
1889other modes. @kbd{C-c C-y} (@code{picture-yank-rectangle}) inserts
1890(by overwriting) the rectangle that was most recently killed, while
1891@kbd{C-c C-x} (@code{picture-yank-rectangle-from-register}) does
1892likewise for the rectangle found in a specified register.
1893
1894@node Advanced VC Usage
1895@chapter Advanced VC Usage
1896
1897 Commonly used features of Emacs' version control (VC) support are
1898described in the main Emacs manual (@pxref{Version Control,,,emacs,
1899the Emacs Manual}). This chapter describes more advanced VC usage.
1900
1901@menu
1902* VC Dired Mode:: Listing files managed by version control.
1903* VC Dired Commands:: Commands to use in a VC Dired buffer.
1904* Remote Repositories:: Efficient access to remote CVS servers.
1905* Snapshots:: Sets of file versions treated as a unit.
1906* Miscellaneous VC:: Various other commands and features of VC.
1907* Customizing VC:: Variables that change VC's behavior.
1908@end menu
1909
1910@node VC Dired Mode
1911@section Dired under VC
1912
1913@cindex PCL-CVS
1914@pindex cvs
1915@cindex CVS Dired Mode
1916 The VC Dired Mode described here works with all the version control
1917systems that VC supports. Another more powerful facility, designed
1918specifically for CVS, is called PCL-CVS. @xref{Top, , About PCL-CVS,
1919pcl-cvs, PCL-CVS --- The Emacs Front-End to CVS}.
1920
1921@kindex C-x v d
1922@findex vc-directory
1923 When you are working on a large program, it is often useful to find
1924out which files have changed within an entire directory tree, or to view
1925the status of all files under version control at once, and to perform
1926version control operations on collections of files. You can use the
1927command @kbd{C-x v d} (@code{vc-directory}) to make a directory listing
1928that includes only files relevant for version control.
1929
1930@vindex vc-dired-terse-display
1931 @kbd{C-x v d} creates a buffer which uses VC Dired Mode. This looks
1932much like an ordinary Dired buffer (@pxref{Dired,,,emacs, the
1933Emacs Manual}); however, normally it shows only the noteworthy files
1934(those locked or not up-to-date). This is called @dfn{terse display}.
1935If you set the variable @code{vc-dired-terse-display} to @code{nil},
1936then VC Dired shows all relevant files---those managed under version
1937control, plus all subdirectories (@dfn{full display}). The command
1938@kbd{v t} in a VC Dired buffer toggles between terse display and full
1939display (@pxref{VC Dired Commands}).
1940
1941@vindex vc-dired-recurse
1942 By default, VC Dired produces a recursive listing of noteworthy or
1943relevant files at or below the given directory. You can change this by
1944setting the variable @code{vc-dired-recurse} to @code{nil}; then VC
1945Dired shows only the files in the given directory.
1946
1947 The line for an individual file shows the version control state in the
1948place of the hard link count, owner, group, and size of the file. If
1949the file is unmodified, in sync with the master file, the version
1950control state shown is blank. Otherwise it consists of text in
1951parentheses. Under RCS and SCCS, the name of the user locking the file
1952is shown; under CVS, an abbreviated version of the @samp{cvs status}
1953output is used. Here is an example using RCS:
1954
1955@smallexample
1956@group
1957 /home/jim/project:
1958
1959 -rw-r--r-- (jim) Apr 2 23:39 file1
1960 -r--r--r-- Apr 5 20:21 file2
1961@end group
1962@end smallexample
1963
1964@noindent
1965The files @samp{file1} and @samp{file2} are under version control,
1966@samp{file1} is locked by user jim, and @samp{file2} is unlocked.
1967
1968 Here is an example using CVS:
1969
1970@smallexample
1971@group
1972 /home/joe/develop:
1973
1974 -rw-r--r-- (modified) Aug 2 1997 file1.c
1975 -rw-r--r-- Apr 4 20:09 file2.c
1976 -rw-r--r-- (merge) Sep 13 1996 file3.c
1977@end group
1978@end smallexample
1979
1980 Here @samp{file1.c} is modified with respect to the repository, and
1981@samp{file2.c} is not. @samp{file3.c} is modified, but other changes
1982have also been checked in to the repository---you need to merge them
1983with the work file before you can check it in.
1984
1985@vindex vc-stay-local
1986@vindex vc-cvs-stay-local
1987 In the above, if the repository were on a remote machine, VC would
1988only contact it when the variable @code{vc-stay-local} (or
1989@code{vc-cvs-stay-local}) is nil (@pxref{CVS Options}). This is
1990because access to the repository may be slow, or you may be working
1991offline and not have access to the repository at all. As a
1992consequence, VC would not be able to tell you that @samp{file3.c} is
1993in the ``merge'' state; you would learn that only when you try to
1994check-in your modified copy of the file, or use a command such as
1995@kbd{C-x v m}.
1996
1997 In practice, this is not a problem because CVS handles this case
1998consistently whenever it arises. In VC, you'll simply get prompted to
1999merge the remote changes into your work file first. The benefits of
2000less network communication usually outweigh the disadvantage of not
2001seeing remote changes immediately.
2002
2003@vindex vc-directory-exclusion-list
2004 When VC Dired displays subdirectories (in the ``full'' display mode),
2005it omits some that should never contain any files under version control.
2006By default, this includes Version Control subdirectories such as
2007@samp{RCS} and @samp{CVS}; you can customize this by setting the
2008variable @code{vc-directory-exclusion-list}.
2009
2010 You can fine-tune VC Dired's format by typing @kbd{C-u C-x v d}---as in
2011ordinary Dired, that allows you to specify additional switches for the
2012@samp{ls} command.
2013
2014@node VC Dired Commands
2015@section VC Dired Commands
2016
2017 All the usual Dired commands work normally in VC Dired mode, except
2018for @kbd{v}, which is redefined as the version control prefix. You can
2019invoke VC commands such as @code{vc-diff} and @code{vc-print-log} by
2020typing @kbd{v =}, or @kbd{v l}, and so on. Most of these commands apply
2021to the file name on the current line.
2022
2023 The command @kbd{v v} (@code{vc-next-action}) operates on all the
2024marked files, so that you can lock or check in several files at once.
2025If it operates on more than one file, it handles each file according to
2026its current state; thus, it might lock one file, but check in another
2027file. This could be confusing; it is up to you to avoid confusing
2028behavior by marking a set of files that are in a similar state. If no
2029files are marked, @kbd{v v} operates on the file in the current line.
2030
2031 If any files call for check-in, @kbd{v v} reads a single log entry,
2032then uses it for all the files being checked in. This is convenient for
2033registering or checking in several files at once, as part of the same
2034change.
2035
2036@findex vc-dired-toggle-terse-mode
2037@findex vc-dired-mark-locked
2038 You can toggle between terse display (only locked files, or files not
2039up-to-date) and full display at any time by typing @kbd{v t}
2040(@code{vc-dired-toggle-terse-mode}). There is also a special command
2041@kbd{* l} (@code{vc-dired-mark-locked}), which marks all files currently
2042locked (or, with CVS, all files not up-to-date). Thus, typing @kbd{* l
2043t k} is another way to delete from the buffer all files except those
2044currently locked.
2045
2046@node Remote Repositories
2047@section Remote Repositories
2048@cindex remote repositories (CVS)
2049
2050 A common way of using CVS is to set up a central CVS repository on
2051some Internet host, then have each developer check out a personal
2052working copy of the files on his local machine. Committing changes to
2053the repository, and picking up changes from other users into one's own
2054working area, then works by direct interactions with the CVS server.
2055
2056 One difficulty is that access to the CVS server is often slow, and
2057that developers might need to work off-line as well. VC is designed
2058to reduce the amount of network interaction necessary.
2059
2060@menu
2061* Version Backups:: Keeping local copies of repository versions.
2062* Local Version Control:: Using another version system for local editing.
2063@end menu
2064
2065@node Version Backups
2066@subsection Version Backups
2067@cindex version backups
2068
2069@cindex automatic version backups
2070 When VC sees that the CVS repository for a file is on a remote
2071machine, it automatically makes local backups of unmodified versions
2072of the file---@dfn{automatic version backups}. This means that you
2073can compare the file to the repository version (@kbd{C-x v =}), or
2074revert to that version (@kbd{C-x v u}), without any network
2075interactions.
2076
2077 The local copy of the unmodified file is called a @dfn{version
2078backup} to indicate that it corresponds exactly to a version that is
2079stored in the repository. Note that version backups are not the same
2080as ordinary Emacs backup files (@pxref{Backup,,,emacs, the Emacs
2081Manual}). But they follow a similar naming convention.
2082
2083 For a file that comes from a remote CVS repository, VC makes a
2084version backup whenever you save the first changes to the file, and
2085removes it after you have committed your modified version to the
2086repository. You can disable the making of automatic version backups by
2087setting @code{vc-cvs-stay-local} to @code{nil} (@pxref{CVS Options}).
2088
2089@cindex manual version backups
2090 The name of the automatic version backup for version @var{version}
2091of file @var{file} is @code{@var{file}.~@var{version}.~}. This is
2092almost the same as the name used by @kbd{C-x v ~} (@pxref{Old
2093Versions,,,emacs, the Emacs Manual}), the only difference being
2094the additional dot (@samp{.}) after the version number. This
2095similarity is intentional, because both kinds of files store the same
2096kind of information. The file made by @kbd{C-x v ~} acts as a
2097@dfn{manual version backup}.
2098
2099 All the VC commands that operate on old versions of a file can use
2100both kinds of version backups. For instance, @kbd{C-x v ~} uses
2101either an automatic or a manual version backup, if possible, to get
2102the contents of the version you request. Likewise, @kbd{C-x v =} and
2103@kbd{C-x v u} use either an automatic or a manual version backup, if
2104one of them exists, to get the contents of a version to compare or
2105revert to. If you changed a file outside of Emacs, so that no
2106automatic version backup was created for the previous text, you can
2107create a manual backup of that version using @kbd{C-x v ~}, and thus
2108obtain the benefit of the local copy for Emacs commands.
2109
2110 The only difference in Emacs's handling of manual and automatic
2111version backups, once they exist, is that Emacs deletes automatic
2112version backups when you commit to the repository. By contrast,
2113manual version backups remain until you delete them.
2114
2115@node Local Version Control
2116@subsection Local Version Control
2117@cindex local version control
2118@cindex local back end (version control)
2119
2120When you make many changes to a file that comes from a remote
2121repository, it can be convenient to have version control on your local
2122machine as well. You can then record intermediate versions, revert to
2123a previous state, etc., before you actually commit your changes to the
2124remote server.
2125
2126VC lets you do this by putting a file under a second, local version
2127control system, so that the file is effectively registered in two
2128systems at the same time. For the description here, we will assume
2129that the remote system is CVS, and you use RCS locally, although the
2130mechanism works with any combination of version control systems
2131(@dfn{back ends}).
2132
2133To make it work with other back ends, you must make sure that the
2134``more local'' back end comes before the ``more remote'' back end in
2135the setting of @code{vc-handled-backends} (@pxref{Customizing VC}). By
2136default, this variable is set up so that you can use remote CVS and
2137local RCS as described here.
2138
2139To start using local RCS for a file that comes from a remote CVS
2140server, you must @emph{register the file in RCS}, by typing @kbd{C-u
2141C-x v v rcs @key{RET}}. (In other words, use @code{vc-next-action} with a
2142prefix argument, and specify RCS as the back end.)
2143
2144You can do this at any time; it does not matter whether you have
2145already modified the file with respect to the version in the CVS
2146repository. If possible, VC tries to make the RCS master start with
2147the unmodified repository version, then checks in any local changes
2148as a new version. This works if you have not made any changes yet, or
2149if the unmodified repository version exists locally as a version
2150backup (@pxref{Version Backups}). If the unmodified version is not
2151available locally, the RCS master starts with the modified version;
2152the only drawback to this is that you cannot compare your changes
2153locally to what is stored in the repository.
2154
2155The version number of the RCS master is derived from the current CVS
2156version, starting a branch from it. For example, if the current CVS
2157version is 1.23, the local RCS branch will be 1.23.1. Version 1.23 in
2158the RCS master will be identical to version 1.23 under CVS; your first
2159changes are checked in as 1.23.1.1. (If the unmodified file is not
2160available locally, VC will check in the modified file twice, both as
21611.23 and 1.23.1.1, to make the revision numbers consistent.)
2162
2163If you do not use locking under CVS (the default), locking is also
2164disabled for RCS, so that editing under RCS works exactly as under
2165CVS.
2166
2167When you are done with local editing, you can commit the final version
2168back to the CVS repository by typing @kbd{C-u C-x v v cvs @key{RET}}.
2169This initializes the log entry buffer (@pxref{Log Buffer,,,emacs, the
2170Emacs Manual}) to contain all the log entries you have recorded in the
2171RCS master; you can edit them as you wish, and then commit in CVS by
2172typing @kbd{C-c C-c}. If the commit is successful, VC removes the RCS
2173master, so that the file is once again registered under CVS only.
2174(The RCS master is not actually deleted, just renamed by appending
2175@samp{~} to the name, so that you can refer to it later if you wish.)
2176
2177While using local RCS, you can pick up recent changes from the CVS
2178repository into your local file, or commit some of your changes back
2179to CVS, without terminating local RCS version control. To do this,
2180switch to the CVS back end temporarily, with the @kbd{C-x v b} command:
2181
2182@table @kbd
2183@item C-x v b
2184Switch to another back end that the current file is registered
2185under (@code{vc-switch-backend}).
2186
2187@item C-u C-x v b @var{backend} @key{RET}
2188Switch to @var{backend} for the current file.
2189@end table
2190
2191@kindex C-x v b
2192@findex vc-switch-backend
2193@kbd{C-x v b} does not change the buffer contents, or any files; it
2194only changes VC's perspective on how to handle the file. Any
2195subsequent VC commands for that file will operate on the back end that
2196is currently selected.
2197
2198If the current file is registered in more than one back end, typing
2199@kbd{C-x v b} ``cycles'' through all of these back ends. With a
2200prefix argument, it asks for the back end to use in the minibuffer.
2201
2202Thus, if you are using local RCS, and you want to pick up some recent
2203changes in the file from remote CVS, first visit the file, then type
2204@kbd{C-x v b} to switch to CVS, and finally use @kbd{C-x v m
2205@key{RET}} to merge the news (@pxref{Merging,,,emacs, the Emacs
2206Manual}). You can then switch back to RCS by typing @kbd{C-x v b}
2207again, and continue to edit locally.
2208
2209But if you do this, the revision numbers in the RCS master no longer
2210correspond to those of CVS. Technically, this is not a problem, but
2211it can become difficult to keep track of what is in the CVS repository
2212and what is not. So we suggest that you return from time to time to
2213CVS-only operation, by committing your local changes back to the
2214repository using @kbd{C-u C-x v v cvs @key{RET}}.
2215
2216@node Snapshots
2217@section Snapshots
2218@cindex snapshots and version control
2219
2220 A @dfn{snapshot} is a named set of file versions (one for each
2221registered file) that you can treat as a unit. One important kind of
2222snapshot is a @dfn{release}, a (theoretically) stable version of the
2223system that is ready for distribution to users.
2224
2225@menu
2226* Making Snapshots:: The snapshot facilities.
2227* Snapshot Caveats:: Things to be careful of when using snapshots.
2228@end menu
2229
2230@node Making Snapshots
2231@subsection Making and Using Snapshots
2232
2233 There are two basic commands for snapshots; one makes a
2234snapshot with a given name, the other retrieves a named snapshot.
2235
2236@table @code
2237@kindex C-x v s
2238@findex vc-create-snapshot
2239@item C-x v s @var{name} @key{RET}
2240Define the last saved versions of every registered file in or under the
2241current directory as a snapshot named @var{name}
2242(@code{vc-create-snapshot}).
2243
2244@kindex C-x v r
2245@findex vc-retrieve-snapshot
2246@item C-x v r @var{name} @key{RET}
2247For all registered files at or below the current directory level, select
2248whatever versions correspond to the snapshot @var{name}
2249(@code{vc-retrieve-snapshot}).
2250
2251This command reports an error if any files are locked at or below the
2252current directory, without changing anything; this is to avoid
2253overwriting work in progress.
2254@end table
2255
2256 A snapshot uses a very small amount of resources---just enough to record
2257the list of file names and which version belongs to the snapshot. Thus,
2258you need not hesitate to create snapshots whenever they are useful.
2259
2260 You can give a snapshot name as an argument to @kbd{C-x v =} or
2261@kbd{C-x v ~} (@pxref{Old Versions,,,emacs, the Emacs Manual}).
2262Thus, you can use it to compare a snapshot against the current files,
2263or two snapshots against each other, or a snapshot against a named
2264version.
2265
2266@node Snapshot Caveats
2267@subsection Snapshot Caveats
2268
2269@cindex named configurations (RCS)
2270 VC's snapshot facilities are modeled on RCS's named-configuration
2271support. They use RCS's native facilities for this, so
2272snapshots made using RCS through VC are visible even when you bypass VC.
2273
2274 With CVS, Meta-CVS, and Subversion, VC also uses the native
2275mechanism provided by that back end to make snapshots and retrieve them
2276(@dfn{tags} for CVS and Meta-CVS, @dfn{copies} for Subversion).
2277
2278@c worded verbosely to avoid overfull hbox.
2279 For SCCS, VC implements snapshots itself. The files it uses contain
2280name/file/version-number triples. These snapshots are visible only
2281through VC.
2282
2283 There is no support for VC snapshots using GNU Arch yet.
2284
2285 A snapshot is a set of checked-in versions. So make sure that all the
2286files are checked in and not locked when you make a snapshot.
2287
2288 File renaming and deletion can create some difficulties with snapshots.
2289This is not a VC-specific problem, but a general design issue in version
2290control systems that no one has solved very well yet.
2291
2292 If you rename a registered file, you need to rename its master along
2293with it (the command @code{vc-rename-file} does this automatically). If
2294you are using SCCS, you must also update the records of the snapshot, to
2295mention the file by its new name (@code{vc-rename-file} does this,
2296too). An old snapshot that refers to a master file that no longer
2297exists under the recorded name is invalid; VC can no longer retrieve
2298it. It would be beyond the scope of this manual to explain enough about
2299RCS and SCCS to explain how to update the snapshots by hand.
2300
2301 Using @code{vc-rename-file} makes the snapshot remain valid for
2302retrieval, but it does not solve all problems. For example, some of the
2303files in your program probably refer to others by name. At the very
2304least, the makefile probably mentions the file that you renamed. If you
2305retrieve an old snapshot, the renamed file is retrieved under its new
2306name, which is not the name that the makefile expects. So the program
2307won't really work as retrieved.
2308
2309@node Miscellaneous VC
2310@section Miscellaneous Commands and Features of VC
2311
2312 This section explains the less-frequently-used features of VC.
2313
2314@menu
2315* Change Logs and VC:: Generating a change log file from log entries.
2316* Renaming and VC:: A command to rename both the source and master
2317 file correctly.
2318* Version Headers:: Inserting version control headers into working files.
2319@end menu
2320
2321@node Change Logs and VC
2322@subsection Change Logs and VC
2323
2324 If you use RCS or CVS for a program and also maintain a change log
2325file for it (@pxref{Change Log,,,emacs, the Emacs Manual}), you
2326can generate change log entries automatically from the version control
2327log entries:
2328
2329@table @kbd
2330@item C-x v a
2331@kindex C-x v a
2332@findex vc-update-change-log
2333Visit the current directory's change log file and, for registered files
2334in that directory, create new entries for versions checked in since the
2335most recent entry in the change log file.
2336(@code{vc-update-change-log}).
2337
2338This command works with RCS or CVS only, not with any of the other
2339back ends.
2340
2341@item C-u C-x v a
2342As above, but only find entries for the current buffer's file.
2343
2344@item M-1 C-x v a
2345As above, but find entries for all the currently visited files that are
2346maintained with version control. This works only with RCS, and it puts
2347all entries in the log for the default directory, which may not be
2348appropriate.
2349@end table
2350
2351 For example, suppose the first line of @file{ChangeLog} is dated
23521999-04-10, and that the only check-in since then was by Nathaniel
2353Bowditch to @file{rcs2log} on 1999-05-22 with log text @samp{Ignore log
2354messages that start with `#'.}. Then @kbd{C-x v a} visits
2355@file{ChangeLog} and inserts text like this:
2356
2357@iftex 95@iftex
2358@medbreak 96@c ``Picture Mode'' is a chapter, not a section, so it's outside @raisesections.
2359@end iftex 97@include picture-xtra.texi
2360@smallexample
2361@group
23621999-05-22 Nathaniel Bowditch <nat@@apn.org>
2363 98
2364 * rcs2log: Ignore log messages that start with `#'. 99@raisesections
2365@end group 100@include arevert-xtra.texi
2366@end smallexample
2367@iftex
2368@medbreak
2369@end iftex
2370 101
2371@noindent 102@include dired-xtra.texi
2372You can then edit the new change log entry further as you wish.
2373 103
2374 Some of the new change log entries may duplicate what's already in 104@include cal-xtra.texi
2375ChangeLog. You will have to remove these duplicates by hand.
2376 105
2377 Normally, the log entry for file @file{foo} is displayed as @samp{* 106@include emerge-xtra.texi
2378foo: @var{text of log entry}}. The @samp{:} after @file{foo} is omitted
2379if the text of the log entry starts with @w{@samp{(@var{functionname}):
2380}}. For example, if the log entry for @file{vc.el} is
2381@samp{(vc-do-command): Check call-process status.}, then the text in
2382@file{ChangeLog} looks like this:
2383 107
2384@iftex 108@include vc-xtra.texi
2385@medbreak
2386@end iftex
2387@smallexample
2388@group
23891999-05-06 Nathaniel Bowditch <nat@@apn.org>
2390 109
2391 * vc.el (vc-do-command): Check call-process status. 110@include fortran-xtra.texi
2392@end group
2393@end smallexample
2394@iftex
2395@medbreak
2396@end iftex
2397
2398 When @kbd{C-x v a} adds several change log entries at once, it groups
2399related log entries together if they all are checked in by the same
2400author at nearly the same time. If the log entries for several such
2401files all have the same text, it coalesces them into a single entry.
2402For example, suppose the most recent check-ins have the following log
2403entries:
2404 111
2405@flushleft 112@include msdog-xtra.texi
2406@bullet{} For @file{vc.texinfo}: @samp{Fix expansion typos.}
2407@bullet{} For @file{vc.el}: @samp{Don't call expand-file-name.}
2408@bullet{} For @file{vc-hooks.el}: @samp{Don't call expand-file-name.}
2409@end flushleft
2410 113
2411@noindent 114@lowersections
2412They appear like this in @file{ChangeLog}:
2413
2414@iftex
2415@medbreak
2416@end iftex
2417@smallexample
2418@group
24191999-04-01 Nathaniel Bowditch <nat@@apn.org>
2420
2421 * vc.texinfo: Fix expansion typos.
2422
2423 * vc.el, vc-hooks.el: Don't call expand-file-name.
2424@end group
2425@end smallexample
2426@iftex
2427@medbreak
2428@end iftex
2429
2430 Normally, @kbd{C-x v a} separates log entries by a blank line, but you
2431can mark several related log entries to be clumped together (without an
2432intervening blank line) by starting the text of each related log entry
2433with a label of the form @w{@samp{@{@var{clumpname}@} }}. The label
2434itself is not copied to @file{ChangeLog}. For example, suppose the log
2435entries are:
2436
2437@flushleft
2438@bullet{} For @file{vc.texinfo}: @samp{@{expand@} Fix expansion typos.}
2439@bullet{} For @file{vc.el}: @samp{@{expand@} Don't call expand-file-name.}
2440@bullet{} For @file{vc-hooks.el}: @samp{@{expand@} Don't call expand-file-name.}
2441@end flushleft
2442
2443@noindent
2444Then the text in @file{ChangeLog} looks like this:
2445
2446@iftex
2447@medbreak
2448@end iftex 115@end iftex
2449@smallexample
2450@group
24511999-04-01 Nathaniel Bowditch <nat@@apn.org>
2452
2453 * vc.texinfo: Fix expansion typos.
2454 * vc.el, vc-hooks.el: Don't call expand-file-name.
2455@end group
2456@end smallexample
2457@iftex
2458@medbreak
2459@end iftex
2460
2461 A log entry whose text begins with @samp{#} is not copied to
2462@file{ChangeLog}. For example, if you merely fix some misspellings in
2463comments, you can log the change with an entry beginning with @samp{#}
2464to avoid putting such trivia into @file{ChangeLog}.
2465
2466@node Renaming and VC
2467@subsection Renaming VC Work Files and Master Files
2468
2469@findex vc-rename-file
2470 When you rename a registered file, you must also rename its master
2471file correspondingly to get proper results. Use @code{vc-rename-file}
2472to rename the source file as you specify, and rename its master file
2473accordingly. It also updates any snapshots (@pxref{Snapshots}) that
2474mention the file, so that they use the new name; despite this, the
2475snapshot thus modified may not completely work (@pxref{Snapshot
2476Caveats}).
2477
2478 Some back ends do not provide an explicit rename operation to their
2479repositories. After issuing @code{vc-rename-file}, use @kbd{C-x v v}
2480on the original and renamed buffers and provide the necessary edit
2481log.
2482
2483 You cannot use @code{vc-rename-file} on a file that is locked by
2484someone else.
2485
2486@node Version Headers
2487@subsection Inserting Version Control Headers
2488
2489 Sometimes it is convenient to put version identification strings
2490directly into working files. Certain special strings called
2491@dfn{version headers} are replaced in each successive version by the
2492number of that version, the name of the user who created it, and other
2493relevant information. All of the back ends that VC supports have such
2494a mechanism, except GNU Arch.
2495
2496 VC does not normally use the information contained in these headers.
2497The exception is RCS---with RCS, version headers are sometimes more
2498reliable than the master file to determine which version of the file
2499you are editing. Note that in a multi-branch environment, version
2500headers are necessary to make VC behave correctly (@pxref{Multi-User
2501Branching,,,emacs, the Emacs Manual}).
2502
2503 Searching for RCS version headers is controlled by the variable
2504@code{vc-consult-headers}. If it is non-@code{nil} (the default),
2505Emacs searches for headers to determine the version number you are
2506editing. Setting it to @code{nil} disables this feature.
2507
2508 Note that although CVS uses the same kind of version headers as RCS
2509does, VC never searches for these headers if you are using CVS,
2510regardless of the above setting.
2511
2512@kindex C-x v h
2513@findex vc-insert-headers
2514 You can use the @kbd{C-x v h} command (@code{vc-insert-headers}) to
2515insert a suitable header string.
2516
2517@table @kbd
2518@item C-x v h
2519Insert headers in a file for use with your version-control system.
2520@end table
2521
2522@vindex vc-@var{backend}-header
2523 The default header string is @samp{@w{$}Id$} for RCS and
2524@samp{@w{%}W%} for SCCS. You can specify other headers to insert by
2525setting the variables @code{vc-@var{backend}-header} where
2526@var{backend} is @code{rcs} or @code{sccs}.
2527
2528 Instead of a single string, you can specify a list of strings; then
2529each string in the list is inserted as a separate header on a line of
2530its own.
2531
2532 It may be necessary to use apparently-superfluous backslashes when
2533writing the strings that you put in this variable. For instance, you
2534might write @code{"$Id\$"} rather than @code{"$Id@w{$}"}. The extra
2535backslash prevents the string constant from being interpreted as a
2536header, if the Emacs Lisp file containing it is maintained with
2537version control.
2538
2539@vindex vc-comment-alist
2540 Each header is inserted surrounded by tabs, inside comment delimiters,
2541on a new line at point. Normally the ordinary comment
2542start and comment end strings of the current mode are used, but for
2543certain modes, there are special comment delimiters for this purpose;
2544the variable @code{vc-comment-alist} specifies them. Each element of
2545this list has the form @code{(@var{mode} @var{starter} @var{ender})}.
2546
2547@vindex vc-static-header-alist
2548 The variable @code{vc-static-header-alist} specifies further strings
2549to add based on the name of the buffer. Its value should be a list of
2550elements of the form @code{(@var{regexp} . @var{format})}. Whenever
2551@var{regexp} matches the buffer name, @var{format} is inserted as part
2552of the header. A header line is inserted for each element that matches
2553the buffer name, and for each string specified by
2554@code{vc-@var{backend}-header}. The header line is made by processing the
2555string from @code{vc-@var{backend}-header} with the format taken from the
2556element. The default value for @code{vc-static-header-alist} is as follows:
2557
2558@example
2559@group
2560(("\\.c$" .
2561 "\n#ifndef lint\nstatic char vcid[] = \"\%s\";\n\
2562#endif /* lint */\n"))
2563@end group
2564@end example
2565
2566@noindent
2567It specifies insertion of text of this form:
2568
2569@example
2570@group
2571
2572#ifndef lint
2573static char vcid[] = "@var{string}";
2574#endif /* lint */
2575@end group
2576@end example
2577
2578@noindent
2579Note that the text above starts with a blank line.
2580
2581 If you use more than one version header in a file, put them close
2582together in the file. The mechanism in @code{revert-buffer} that
2583preserves markers may not handle markers positioned between two version
2584headers.
2585
2586@node Customizing VC
2587@section Customizing VC
2588
2589@vindex vc-handled-backends
2590The variable @code{vc-handled-backends} determines which version
2591control systems VC should handle. The default value is @code{(RCS CVS
2592SVN SCCS Arch MCVS)}, so it contains all six version systems that are
2593currently supported. If you want VC to ignore one or more of these
2594systems, exclude its name from the list. To disable VC entirely, set
2595this variable to @code{nil}.
2596
2597The order of systems in the list is significant: when you visit a file
2598registered in more than one system (@pxref{Local Version Control}), VC
2599uses the system that comes first in @code{vc-handled-backends} by
2600default. The order is also significant when you register a file for
2601the first time, @pxref{Registering,,,emacs, the Emacs Manual} for
2602details.
2603
2604@menu
2605* General VC Options:: Options that apply to multiple back ends.
2606* RCS and SCCS:: Options for RCS and SCCS.
2607* CVS Options:: Options for CVS.
2608@end menu
2609
2610@node General VC Options
2611@subsection General Options
2612
2613@vindex vc-make-backup-files
2614 Emacs normally does not save backup files for source files that are
2615maintained with version control. If you want to make backup files even
2616for files that use version control, set the variable
2617@code{vc-make-backup-files} to a non-@code{nil} value.
2618
2619@vindex vc-keep-workfiles
2620 Normally the work file exists all the time, whether it is locked or
2621not. If you set @code{vc-keep-workfiles} to @code{nil}, then checking
2622in a new version with @kbd{C-x v v} deletes the work file; but any
2623attempt to visit the file with Emacs creates it again. (With CVS, work
2624files are always kept.)
2625
2626@vindex vc-follow-symlinks
2627 Editing a version-controlled file through a symbolic link can be
2628dangerous. It bypasses the version control system---you can edit the
2629file without locking it, and fail to check your changes in. Also,
2630your changes might overwrite those of another user. To protect against
2631this, VC checks each symbolic link that you visit, to see if it points
2632to a file under version control.
2633
2634 The variable @code{vc-follow-symlinks} controls what to do when a
2635symbolic link points to a version-controlled file. If it is @code{nil},
2636VC only displays a warning message. If it is @code{t}, VC automatically
2637follows the link, and visits the real file instead, telling you about
2638this in the echo area. If the value is @code{ask} (the default), VC
2639asks you each time whether to follow the link.
2640
2641@vindex vc-suppress-confirm
2642 If @code{vc-suppress-confirm} is non-@code{nil}, then @kbd{C-x v v}
2643and @kbd{C-x v i} can save the current buffer without asking, and
2644@kbd{C-x v u} also operates without asking for confirmation. (This
2645variable does not affect @kbd{C-x v c}; that operation is so drastic
2646that it should always ask for confirmation.)
2647
2648@vindex vc-command-messages
2649 VC mode does much of its work by running the shell commands for RCS,
2650CVS and SCCS. If @code{vc-command-messages} is non-@code{nil}, VC
2651displays messages to indicate which shell commands it runs, and
2652additional messages when the commands finish.
2653
2654@vindex vc-path
2655 You can specify additional directories to search for version control
2656programs by setting the variable @code{vc-path}. These directories
2657are searched before the usual search path. It is rarely necessary to
2658set this variable, because VC normally finds the proper files
2659automatically.
2660
2661@node RCS and SCCS
2662@subsection Options for RCS and SCCS
2663
2664@cindex non-strict locking (RCS)
2665@cindex locking, non-strict (RCS)
2666 By default, RCS uses locking to coordinate the activities of several
2667users, but there is a mode called @dfn{non-strict locking} in which
2668you can check-in changes without locking the file first. Use
2669@samp{rcs -U} to switch to non-strict locking for a particular file,
2670see the @code{rcs} manual page for details.
2671
2672 When deducing the version control state of an RCS file, VC first
2673looks for an RCS version header string in the file (@pxref{Version
2674Headers}). If there is no header string, VC normally looks at the
2675file permissions of the work file; this is fast. But there might be
2676situations when the file permissions cannot be trusted. In this case
2677the master file has to be consulted, which is rather expensive. Also
2678the master file can only tell you @emph{if} there's any lock on the
2679file, but not whether your work file really contains that locked
2680version.
2681
2682@vindex vc-consult-headers
2683 You can tell VC not to use version headers to determine the file
2684status by setting @code{vc-consult-headers} to @code{nil}. VC then
2685always uses the file permissions (if it is supposed to trust them), or
2686else checks the master file.
2687
2688@vindex vc-mistrust-permissions
2689 You can specify the criterion for whether to trust the file
2690permissions by setting the variable @code{vc-mistrust-permissions}.
2691Its value can be @code{t} (always mistrust the file permissions and
2692check the master file), @code{nil} (always trust the file
2693permissions), or a function of one argument which makes the decision.
2694The argument is the directory name of the @file{RCS} subdirectory. A
2695non-@code{nil} value from the function says to mistrust the file
2696permissions. If you find that the file permissions of work files are
2697changed erroneously, set @code{vc-mistrust-permissions} to @code{t}.
2698Then VC always checks the master file to determine the file's status.
2699
2700 VC determines the version control state of files under SCCS much as
2701with RCS. It does not consider SCCS version headers, though. Thus,
2702the variable @code{vc-mistrust-permissions} affects SCCS use, but
2703@code{vc-consult-headers} does not.
2704
2705@node CVS Options
2706@subsection Options specific for CVS
2707
2708@cindex locking (CVS)
2709 By default, CVS does not use locking to coordinate the activities of
2710several users; anyone can change a work file at any time. However,
2711there are ways to restrict this, resulting in behavior that resembles
2712locking.
2713
2714@cindex CVSREAD environment variable (CVS)
2715 For one thing, you can set the @env{CVSREAD} environment variable
2716(the value you use makes no difference). If this variable is defined,
2717CVS makes your work files read-only by default. In Emacs, you must
2718type @kbd{C-x v v} to make the file writable, so that editing works
2719in fact similar as if locking was used. Note however, that no actual
2720locking is performed, so several users can make their files writable
2721at the same time. When setting @env{CVSREAD} for the first time, make
2722sure to check out all your modules anew, so that the file protections
2723are set correctly.
2724
2725@cindex cvs watch feature
2726@cindex watching files (CVS)
2727 Another way to achieve something similar to locking is to use the
2728@dfn{watch} feature of CVS. If a file is being watched, CVS makes it
2729read-only by default, and you must also use @kbd{C-x v v} in Emacs to
2730make it writable. VC calls @code{cvs edit} to make the file writable,
2731and CVS takes care to notify other developers of the fact that you
2732intend to change the file. See the CVS documentation for details on
2733using the watch feature.
2734
2735@vindex vc-stay-local
2736@vindex vc-cvs-stay-local
2737@cindex remote repositories (CVS)
2738 When a file's repository is on a remote machine, VC tries to keep
2739network interactions to a minimum. This is controlled by the variable
2740@code{vc-cvs-stay-local}. There is another variable,
2741@code{vc-stay-local}, which enables the feature also for other back
2742ends that support it, including CVS. In the following, we will talk
2743only about @code{vc-cvs-stay-local}, but everything applies to
2744@code{vc-stay-local} as well.
2745
2746If @code{vc-cvs-stay-local} is @code{t} (the default), then VC uses
2747only the entry in the local CVS subdirectory to determine the file's
2748state (and possibly information returned by previous CVS commands).
2749One consequence of this is that when you have modified a file, and
2750somebody else has already checked in other changes to the file, you
2751are not notified of it until you actually try to commit. (But you can
2752try to pick up any recent changes from the repository first, using
2753@kbd{C-x v m @key{RET}}, @pxref{Merging,,,emacs, the Emacs Manual}).
2754
2755 When @code{vc-cvs-stay-local} is @code{t}, VC also makes local
2756version backups, so that simple diff and revert operations are
2757completely local (@pxref{Version Backups}).
2758
2759 On the other hand, if you set @code{vc-cvs-stay-local} to @code{nil},
2760then VC queries the remote repository @emph{before} it decides what to
2761do in @code{vc-next-action} (@kbd{C-x v v}), just as it does for local
2762repositories. It also does not make any version backups.
2763
2764 You can also set @code{vc-cvs-stay-local} to a regular expression
2765that is matched against the repository host name; VC then stays local
2766only for repositories from hosts that match the pattern.
2767
2768@vindex vc-cvs-global-switches
2769 You can specify additional command line options to pass to all CVS
2770operations in the variable @code{vc-cvs-global-switches}. These
2771switches are inserted immediately after the @code{cvs} command, before
2772the name of the operation to invoke.
2773
2774
2775@node Fortran
2776@chapter Fortran Mode
2777@cindex Fortran mode
2778@cindex mode, Fortran
2779
2780 Fortran mode provides special motion commands for Fortran statements
2781and subprograms, and indentation commands that understand Fortran
2782conventions of nesting, line numbers and continuation statements.
2783Fortran mode has support for Auto Fill mode that breaks long lines into
2784proper Fortran continuation lines.
2785
2786 Special commands for comments are provided because Fortran comments
2787are unlike those of other languages. Built-in abbrevs optionally save
2788typing when you insert Fortran keywords.
2789
2790 Use @kbd{M-x fortran-mode} to switch to this major mode. This
2791command runs the hook @code{fortran-mode-hook}. @xref{Hooks,,, emacs,
2792the Emacs Manual}.
2793
2794@cindex Fortran77 and Fortran90
2795@findex f90-mode
2796@findex fortran-mode
2797 Fortran mode is meant for editing Fortran77 ``fixed format'' (and also
2798``tab format'') source code. For editing the modern Fortran90 or
2799Fortran95 ``free format'' source code, use F90 mode (@code{f90-mode}).
2800Emacs normally uses Fortran mode for files with extension @samp{.f},
2801@samp{.F} or @samp{.for}, and F90 mode for the extension @samp{.f90} and
2802@samp{.f95}. GNU Fortran supports both kinds of format.
2803
2804@menu
2805* Motion: Fortran Motion. Moving point by statements or subprograms.
2806* Indent: Fortran Indent. Indentation commands for Fortran.
2807* Comments: Fortran Comments. Inserting and aligning comments.
2808* Autofill: Fortran Autofill. Auto fill support for Fortran.
2809* Columns: Fortran Columns. Measuring columns for valid Fortran.
2810* Abbrev: Fortran Abbrev. Built-in abbrevs for Fortran keywords.
2811@end menu
2812
2813@node Fortran Motion
2814@section Motion Commands
2815
2816 In addition to the normal commands for moving by and operating on
2817``defuns'' (Fortran subprograms---functions and subroutines, as well as
2818modules for F90 mode), Fortran mode provides special commands to move by
2819statements and other program units.
2820
2821@table @kbd
2822@kindex C-c C-n @r{(Fortran mode)}
2823@findex fortran-next-statement
2824@findex f90-next-statement
2825@item C-c C-n
2826Move to the beginning of the next statement
2827(@code{fortran-next-statement}/@code{f90-next-statement}).
2828
2829@kindex C-c C-p @r{(Fortran mode)}
2830@findex fortran-previous-statement
2831@findex f90-previous-statement
2832@item C-c C-p
2833Move to the beginning of the previous statement
2834(@code{fortran-previous-statement}/@code{f90-previous-statement}).
2835If there is no previous statement (i.e. if called from the first
2836statement in the buffer), move to the start of the buffer.
2837
2838@kindex C-c C-e @r{(F90 mode)}
2839@findex f90-next-block
2840@item C-c C-e
2841Move point forward to the start of the next code block
2842(@code{f90-next-block}). A code block is a subroutine,
2843@code{if}--@code{endif} statement, and so forth. This command exists
2844for F90 mode only, not Fortran mode. With a numeric argument, this
2845moves forward that many blocks.
2846
2847@kindex C-c C-a @r{(F90 mode)}
2848@findex f90-previous-block
2849@item C-c C-a
2850Move point backward to the previous code block
2851(@code{f90-previous-block}). This is like @code{f90-next-block}, but
2852moves backwards.
2853
2854@kindex C-M-n @r{(Fortran mode)}
2855@findex fortran-end-of-block
2856@findex f90-end-of-block
2857@item C-M-n
2858Move to the end of the current code block
2859(@code{fortran-end-of-block}/@code{f90-end-of-block}). With a numeric
2860agument, move forward that number of blocks. The mark is set before
2861moving point. The F90 mode version of this command checks for
2862consistency of block types and labels (if present), but it does not
2863check the outermost block since that may be incomplete.
2864
2865@kindex C-M-p @r{(Fortran mode)}
2866@findex fortran-beginning-of-block
2867@findex f90-beginning-of-block
2868@item C-M-p
2869Move to the start of the current code block
2870(@code{fortran-beginning-of-block}/@code{f90-beginning-of-block}). This
2871is like @code{fortran-end-of-block}, but moves backwards.
2872@end table
2873
2874@node Fortran Indent
2875@section Fortran Indentation
2876
2877 Special commands and features are needed for indenting Fortran code in
2878order to make sure various syntactic entities (line numbers, comment line
2879indicators and continuation line flags) appear in the columns that are
2880required for standard, fixed (or tab) format Fortran.
2881
2882@menu
2883* Commands: ForIndent Commands. Commands for indenting and filling Fortran.
2884* Contline: ForIndent Cont. How continuation lines indent.
2885* Numbers: ForIndent Num. How line numbers auto-indent.
2886* Conv: ForIndent Conv. Conventions you must obey to avoid trouble.
2887* Vars: ForIndent Vars. Variables controlling Fortran indent style.
2888@end menu
2889
2890@node ForIndent Commands
2891@subsection Fortran Indentation and Filling Commands
2892
2893@table @kbd
2894@item C-M-j
2895Break the current line at point and set up a continuation line
2896(@code{fortran-split-line}).
2897@item M-^
2898Join this line to the previous line (@code{fortran-join-line}).
2899@item C-M-q
2900Indent all the lines of the subprogram point is in
2901(@code{fortran-indent-subprogram}).
2902@item M-q
2903Fill a comment block or statement.
2904@end table
2905
2906@kindex C-M-q @r{(Fortran mode)}
2907@findex fortran-indent-subprogram
2908 The key @kbd{C-M-q} runs @code{fortran-indent-subprogram}, a command
2909to reindent all the lines of the Fortran subprogram (function or
2910subroutine) containing point.
2911
2912@kindex C-M-j @r{(Fortran mode)}
2913@findex fortran-split-line
2914 The key @kbd{C-M-j} runs @code{fortran-split-line}, which splits
2915a line in the appropriate fashion for Fortran. In a non-comment line,
2916the second half becomes a continuation line and is indented
2917accordingly. In a comment line, both halves become separate comment
2918lines.
2919
2920@kindex M-^ @r{(Fortran mode)}
2921@kindex C-c C-d @r{(Fortran mode)}
2922@findex fortran-join-line
2923 @kbd{M-^} or @kbd{C-c C-d} runs the command @code{fortran-join-line},
2924which joins a continuation line back to the previous line, roughly as
2925the inverse of @code{fortran-split-line}. The point must be on a
2926continuation line when this command is invoked.
2927
2928@kindex M-q @r{(Fortran mode)}
2929@kbd{M-q} in Fortran mode fills the comment block or statement that
2930point is in. This removes any excess statement continuations.
2931
2932@node ForIndent Cont
2933@subsection Continuation Lines
2934@cindex Fortran continuation lines
2935
2936@vindex fortran-continuation-string
2937 Most Fortran77 compilers allow two ways of writing continuation lines.
2938If the first non-space character on a line is in column 5, then that
2939line is a continuation of the previous line. We call this @dfn{fixed
2940format}. (In GNU Emacs we always count columns from 0; but note that
2941the Fortran standard counts from 1.) The variable
2942@code{fortran-continuation-string} specifies what character to put in
2943column 5. A line that starts with a tab character followed by any digit
2944except @samp{0} is also a continuation line. We call this style of
2945continuation @dfn{tab format}. (Fortran90 introduced ``free format'',
2946with another style of continuation lines).
2947
2948@vindex indent-tabs-mode @r{(Fortran mode)}
2949@vindex fortran-analyze-depth
2950@vindex fortran-tab-mode-default
2951 Fortran mode can use either style of continuation line. When you
2952enter Fortran mode, it tries to deduce the proper continuation style
2953automatically from the buffer contents. It does this by scanning up to
2954@code{fortran-analyze-depth} (default 100) lines from the start of the
2955buffer. The first line that begins with either a tab character or six
2956spaces determines the choice. If the scan fails (for example, if the
2957buffer is new and therefore empty), the value of
2958@code{fortran-tab-mode-default} (@code{nil} for fixed format, and
2959non-@code{nil} for tab format) is used. @samp{/t} in the mode line
2960indicates tab format is selected. Fortran mode sets the value of
2961@code{indent-tabs-mode} accordingly.
2962
2963 If the text on a line starts with the Fortran continuation marker
2964@samp{$}, or if it begins with any non-whitespace character in column
29655, Fortran mode treats it as a continuation line. When you indent a
2966continuation line with @key{TAB}, it converts the line to the current
2967continuation style. When you split a Fortran statement with
2968@kbd{C-M-j}, the continuation marker on the newline is created according
2969to the continuation style.
2970
2971 The setting of continuation style affects several other aspects of
2972editing in Fortran mode. In fixed format mode, the minimum column
2973number for the body of a statement is 6. Lines inside of Fortran
2974blocks that are indented to larger column numbers always use only the
2975space character for whitespace. In tab format mode, the minimum
2976column number for the statement body is 8, and the whitespace before
2977column 8 must always consist of one tab character.
2978
2979@node ForIndent Num
2980@subsection Line Numbers
2981
2982 If a number is the first non-whitespace in the line, Fortran
2983indentation assumes it is a line number and moves it to columns 0
2984through 4. (Columns always count from 0 in GNU Emacs.)
2985
2986@vindex fortran-line-number-indent
2987 Line numbers of four digits or less are normally indented one space.
2988The variable @code{fortran-line-number-indent} controls this; it
2989specifies the maximum indentation a line number can have. The default
2990value of the variable is 1. Fortran mode tries to prevent line number
2991digits passing column 4, reducing the indentation below the specified
2992maximum if necessary. If @code{fortran-line-number-indent} has the
2993value 5, line numbers are right-justified to end in column 4.
2994
2995@vindex fortran-electric-line-number
2996 Simply inserting a line number is enough to indent it according to
2997these rules. As each digit is inserted, the indentation is recomputed.
2998To turn off this feature, set the variable
2999@code{fortran-electric-line-number} to @code{nil}.
3000
3001
3002@node ForIndent Conv
3003@subsection Syntactic Conventions
3004
3005 Fortran mode assumes that you follow certain conventions that simplify
3006the task of understanding a Fortran program well enough to indent it
3007properly:
3008
3009@itemize @bullet
3010@item
3011Two nested @samp{do} loops never share a @samp{continue} statement.
3012
3013@item
3014Fortran keywords such as @samp{if}, @samp{else}, @samp{then}, @samp{do}
3015and others are written without embedded whitespace or line breaks.
3016
3017Fortran compilers generally ignore whitespace outside of string
3018constants, but Fortran mode does not recognize these keywords if they
3019are not contiguous. Constructs such as @samp{else if} or @samp{end do}
3020are acceptable, but the second word should be on the same line as the
3021first and not on a continuation line.
3022@end itemize
3023
3024@noindent
3025If you fail to follow these conventions, the indentation commands may
3026indent some lines unaesthetically. However, a correct Fortran program
3027retains its meaning when reindented even if the conventions are not
3028followed.
3029
3030@node ForIndent Vars
3031@subsection Variables for Fortran Indentation
3032
3033@vindex fortran-do-indent
3034@vindex fortran-if-indent
3035@vindex fortran-structure-indent
3036@vindex fortran-continuation-indent
3037@vindex fortran-check-all-num@dots{}
3038@vindex fortran-minimum-statement-indent@dots{}
3039 Several additional variables control how Fortran indentation works:
3040
3041@table @code
3042@item fortran-do-indent
3043Extra indentation within each level of @samp{do} statement (default 3).
3044
3045@item fortran-if-indent
3046Extra indentation within each level of @samp{if}, @samp{select case}, or
3047@samp{where} statements (default 3).
3048
3049@item fortran-structure-indent
3050Extra indentation within each level of @samp{structure}, @samp{union},
3051@samp{map}, or @samp{interface} statements (default 3).
3052
3053@item fortran-continuation-indent
3054Extra indentation for bodies of continuation lines (default 5).
3055
3056@item fortran-check-all-num-for-matching-do
3057In Fortran77, a numbered @samp{do} statement is ended by any statement
3058with a matching line number. It is common (but not compulsory) to use a
3059@samp{continue} statement for this purpose. If this variable has a
3060non-@code{nil} value, indenting any numbered statement must check for a
3061@samp{do} that ends there. If you always end @samp{do} statements with
3062a @samp{continue} line (or if you use the more modern @samp{enddo}),
3063then you can speed up indentation by setting this variable to
3064@code{nil}. The default is @code{nil}.
3065
3066@item fortran-blink-matching-if
3067If this is @code{t}, indenting an @samp{endif} (or @samp{enddo}
3068statement moves the cursor momentarily to the matching @samp{if} (or
3069@samp{do}) statement to show where it is. The default is @code{nil}.
3070
3071@item fortran-minimum-statement-indent-fixed
3072Minimum indentation for Fortran statements when using fixed format
3073continuation line style. Statement bodies are never indented less than
3074this much. The default is 6.
3075
3076@item fortran-minimum-statement-indent-tab
3077Minimum indentation for Fortran statements for tab format continuation line
3078style. Statement bodies are never indented less than this much. The
3079default is 8.
3080@end table
3081
3082The variables controlling the indentation of comments are described in
3083the following section.
3084
3085@node Fortran Comments
3086@section Fortran Comments
3087
3088 The usual Emacs comment commands assume that a comment can follow a
3089line of code. In Fortran77, the standard comment syntax requires an
3090entire line to be just a comment. Therefore, Fortran mode replaces the
3091standard Emacs comment commands and defines some new variables.
3092
3093@vindex fortran-comment-line-start
3094 Fortran mode can also handle the Fortran90 comment syntax where comments
3095start with @samp{!} and can follow other text. Because only some Fortran77
3096compilers accept this syntax, Fortran mode will not insert such comments
3097unless you have said in advance to do so. To do this, set the variable
3098@code{fortran-comment-line-start} to @samp{"!"}.
3099
3100@table @kbd
3101@item M-;
3102Align comment or insert new comment (@code{fortran-indent-comment}).
3103
3104@item C-x ;
3105Applies to nonstandard @samp{!} comments only.
3106
3107@item C-c ;
3108Turn all lines of the region into comments, or (with argument) turn them back
3109into real code (@code{fortran-comment-region}).
3110@end table
3111
3112@findex fortran-indent-comment
3113 @kbd{M-;} in Fortran mode is redefined as the command
3114@code{fortran-indent-comment}. Like the usual @kbd{M-;} command, this
3115recognizes any kind of existing comment and aligns its text appropriately;
3116if there is no existing comment, a comment is inserted and aligned. But
3117inserting and aligning comments are not the same in Fortran mode as in
3118other modes.
3119
3120 When a new comment must be inserted, if the current line is blank, a
3121full-line comment is inserted. On a non-blank line, a nonstandard @samp{!}
3122comment is inserted if you have said you want to use them. Otherwise a
3123full-line comment is inserted on a new line before the current line.
3124
3125 Nonstandard @samp{!} comments are aligned like comments in other
3126languages, but full-line comments are different. In a standard full-line
3127comment, the comment delimiter itself must always appear in column zero.
3128What can be aligned is the text within the comment. You can choose from
3129three styles of alignment by setting the variable
3130@code{fortran-comment-indent-style} to one of these values:
3131
3132@vindex fortran-comment-indent-style
3133@vindex fortran-comment-line-extra-indent
3134@table @code
3135@item fixed
3136Align the text at a fixed column, which is the sum of
3137@code{fortran-comment-line-extra-indent} and the minimum statement
3138indentation. This is the default.
3139
3140The minimum statement indentation is
3141@code{fortran-minimum-statement-indent-fixed} for fixed format
3142continuation line style and @code{fortran-minimum-statement-indent-tab}
3143for tab format style.
3144
3145@item relative
3146Align the text as if it were a line of code, but with an additional
3147@code{fortran-comment-line-extra-indent} columns of indentation.
3148
3149@item nil
3150Don't move text in full-line comments automatically.
3151@end table
3152
3153@vindex fortran-comment-indent-char
3154 In addition, you can specify the character to be used to indent within
3155full-line comments by setting the variable
3156@code{fortran-comment-indent-char} to the single-character string you want
3157to use.
3158
3159@vindex fortran-directive-re
3160 Compiler directive lines, or preprocessor lines, have much the same
3161appearance as comment lines. It is important, though, that such lines
3162never be indented at all, no matter what the value of
3163@code{fortran-comment-indent-style}. The variable
3164@code{fortran-directive-re} is a regular expression that specifies which
3165lines are directives. Matching lines are never indented, and receive
3166distinctive font-locking.
3167
3168 The normal Emacs comment command @kbd{C-x ;} has not been redefined. If
3169you use @samp{!} comments, this command can be used with them. Otherwise
3170it is useless in Fortran mode.
3171
3172@kindex C-c ; @r{(Fortran mode)}
3173@findex fortran-comment-region
3174@vindex fortran-comment-region
3175 The command @kbd{C-c ;} (@code{fortran-comment-region}) turns all the
3176lines of the region into comments by inserting the string @samp{C$$$} at
3177the front of each one. With a numeric argument, it turns the region
3178back into live code by deleting @samp{C$$$} from the front of each line
3179in it. The string used for these comments can be controlled by setting
3180the variable @code{fortran-comment-region}. Note that here we have an
3181example of a command and a variable with the same name; these two uses
3182of the name never conflict because in Lisp and in Emacs it is always
3183clear from the context which one is meant.
3184
3185@node Fortran Autofill
3186@section Auto Fill in Fortran Mode
3187
3188 Fortran mode has specialized support for Auto Fill mode, which is a
3189minor mode that automatically splits statements as you insert them
3190when they become too wide. Splitting a statement involves making
3191continuation lines using @code{fortran-continuation-string}
3192(@pxref{ForIndent Cont}). This splitting happens when you type
3193@key{SPC}, @key{RET}, or @key{TAB}, and also in the Fortran
3194indentation commands. You activate Auto Fill in Fortran mode in the
3195normal way. @xref{Auto Fill,,, emacs, the Emacs Manual}.
3196
3197@vindex fortran-break-before-delimiters
3198 Auto Fill breaks lines at spaces or delimiters when the lines get
3199longer than the desired width (the value of @code{fill-column}). The
3200delimiters (besides whitespace) that Auto Fill can break at are
3201@samp{+}, @samp{-}, @samp{/}, @samp{*}, @samp{=}, @samp{<}, @samp{>},
3202and @samp{,}. The line break comes after the delimiter if the
3203variable @code{fortran-break-before-delimiters} is @code{nil}.
3204Otherwise (and by default), the break comes before the delimiter.
3205
3206 To enable Auto Fill in all Fortran buffers, add
3207@code{turn-on-auto-fill} to @code{fortran-mode-hook}. @xref{Hooks,,,
3208emacs, the Emacs Manual}.
3209
3210@node Fortran Columns
3211@section Checking Columns in Fortran
3212
3213@table @kbd
3214@item C-c C-r
3215Display a ``column ruler'' momentarily above the current line
3216(@code{fortran-column-ruler}).
3217@item C-c C-w
3218Split the current window horizontally temporarily so that it is 72
3219columns wide (@code{fortran-window-create-momentarily}). This may
3220help you avoid making lines longer than the 72-character limit that
3221some Fortran compilers impose.
3222@item C-u C-c C-w
3223Split the current window horizontally so that it is 72 columns wide
3224(@code{fortran-window-create}). You can then continue editing.
3225@item M-x fortran-strip-sequence-nos
3226Delete all text in column 72 and beyond.
3227@end table
3228
3229@kindex C-c C-r @r{(Fortran mode)}
3230@findex fortran-column-ruler
3231 The command @kbd{C-c C-r} (@code{fortran-column-ruler}) shows a column
3232ruler momentarily above the current line. The comment ruler is two lines
3233of text that show you the locations of columns with special significance in
3234Fortran programs. Square brackets show the limits of the columns for line
3235numbers, and curly brackets show the limits of the columns for the
3236statement body. Column numbers appear above them.
3237
3238 Note that the column numbers count from zero, as always in GNU Emacs.
3239As a result, the numbers may be one less than those you are familiar
3240with; but the positions they indicate in the line are standard for
3241Fortran.
3242
3243@vindex fortran-column-ruler-fixed
3244@vindex fortran-column-ruler-tabs
3245 The text used to display the column ruler depends on the value of the
3246variable @code{indent-tabs-mode}. If @code{indent-tabs-mode} is
3247@code{nil}, then the value of the variable
3248@code{fortran-column-ruler-fixed} is used as the column ruler.
3249Otherwise, the value of the variable @code{fortran-column-ruler-tab} is
3250displayed. By changing these variables, you can change the column ruler
3251display.
3252
3253@kindex C-c C-w @r{(Fortran mode)}
3254@findex fortran-window-create-momentarily
3255 @kbd{C-c C-w} (@code{fortran-window-create-momentarily}) temporarily
3256splits the current window horizontally, making a window 72 columns
3257wide, so you can see any lines that are too long. Type a space to
3258restore the normal width.
3259
3260@kindex C-u C-c C-w @r{(Fortran mode)}
3261@findex fortran-window-create
3262 You can also split the window horizontally and continue editing with
3263the split in place. To do this, use @kbd{C-u C-c C-w} (@code{M-x
3264fortran-window-create}). By editing in this window you can
3265immediately see when you make a line too wide to be correct Fortran.
3266
3267@findex fortran-strip-sequence-nos
3268 The command @kbd{M-x fortran-strip-sequence-nos} deletes all text in
3269column 72 and beyond, on all lines in the current buffer. This is the
3270easiest way to get rid of old sequence numbers.
3271
3272@node Fortran Abbrev
3273@section Fortran Keyword Abbrevs
3274
3275 Fortran mode provides many built-in abbrevs for common keywords and
3276declarations. These are the same sort of abbrev that you can define
3277yourself. To use them, you must turn on Abbrev mode.
3278@xref{Abbrevs,,, emacs, the Emacs Manual}.
3279
3280 The built-in abbrevs are unusual in one way: they all start with a
3281semicolon. You cannot normally use semicolon in an abbrev, but Fortran
3282mode makes this possible by changing the syntax of semicolon to ``word
3283constituent.''
3284
3285 For example, one built-in Fortran abbrev is @samp{;c} for
3286@samp{continue}. If you insert @samp{;c} and then insert a punctuation
3287character such as a space or a newline, the @samp{;c} expands automatically
3288to @samp{continue}, provided Abbrev mode is enabled.@refill
3289
3290 Type @samp{;?} or @samp{;C-h} to display a list of all the built-in
3291Fortran abbrevs and what they stand for.
3292
3293
3294@node MS-DOG
3295@chapter Emacs and MS-DOS
3296@cindex MS-DOG
3297@cindex MS-DOS peculiarities
3298
3299 This section briefly describes the peculiarities of using Emacs on
3300the MS-DOS ``operating system'' (also known as ``MS-DOG'').
3301Information about Emacs and Microsoft's current operating system
3302Windows (also known as ``Losedows) is in the main Emacs manual
3303(@pxref{Emacs and Microsoft Systems,,, emacs, the Emacs Manual}).
3304
3305 If you build Emacs for MS-DOS, the binary will also run on Windows
33063.X, Windows NT, Windows 9X/ME, Windows 2000, or OS/2 as a DOS
3307application; all of this chapter applies for all of those systems, if
3308you use an Emacs that was built for MS-DOS.
3309
3310 @xref{Text and Binary,,,emacs, the Emacs Manual}, for information
3311about Emacs' special handling of text files under MS-DOS (and
3312Windows).
3313
3314@menu
3315* Keyboard: MS-DOS Keyboard. Keyboard conventions on MS-DOS.
3316* Mouse: MS-DOS Mouse. Mouse conventions on MS-DOS.
3317* Display: MS-DOS Display. Fonts, frames and display size on MS-DOS.
3318* Files: MS-DOS File Names. File name conventions on MS-DOS.
3319* Printing: MS-DOS Printing. Printing specifics on MS-DOS.
3320* I18N: MS-DOS and MULE. Support for internationalization on MS-DOS.
3321* Processes: MS-DOS Processes. Running subprocesses on MS-DOS.
3322@end menu
3323
3324@node MS-DOS Keyboard
3325@section Keyboard Usage on MS-DOS
3326
3327@kindex DEL @r{(MS-DOS)}
3328@kindex BS @r{(MS-DOS)}
3329 The key that is called @key{DEL} in Emacs (because that's how it is
3330designated on most workstations) is known as @key{BS} (backspace) on a
3331PC. That is why the PC-specific terminal initialization remaps the
3332@key{BS} key to act as @key{DEL}; the @key{DELETE} key is remapped to act
3333as @kbd{C-d} for the same reasons.
3334
3335@kindex C-g @r{(MS-DOS)}
3336@kindex C-BREAK @r{(MS-DOS)}
3337@cindex quitting on MS-DOS
3338 Emacs built for MS-DOS recognizes @kbd{C-@key{BREAK}} as a quit
3339character, just like @kbd{C-g}. This is because Emacs cannot detect
3340that you have typed @kbd{C-g} until it is ready for more input. As a
3341consequence, you cannot use @kbd{C-g} to stop a running command
3342(@pxref{Quitting,,,emacs, the Emacs Manual}). By contrast,
3343@kbd{C-@key{BREAK}} @emph{is} detected as soon as you type it (as
3344@kbd{C-g} is on other systems), so it can be used to stop a running
3345command and for emergency escape (@pxref{Emergency Escape,,,emacs, the
3346Emacs Manual}).
3347
3348@cindex Meta (under MS-DOS)
3349@cindex Hyper (under MS-DOS)
3350@cindex Super (under MS-DOS)
3351@vindex dos-super-key
3352@vindex dos-hyper-key
3353 The PC keyboard maps use the left @key{ALT} key as the @key{META} key.
3354You have two choices for emulating the @key{SUPER} and @key{HYPER} keys:
3355choose either the right @key{CTRL} key or the right @key{ALT} key by
3356setting the variables @code{dos-hyper-key} and @code{dos-super-key} to 1
3357or 2 respectively. If neither @code{dos-super-key} nor
3358@code{dos-hyper-key} is 1, then by default the right @key{ALT} key is
3359also mapped to the @key{META} key. However, if the MS-DOS international
3360keyboard support program @file{KEYB.COM} is installed, Emacs will
3361@emph{not} map the right @key{ALT} to @key{META}, since it is used for
3362accessing characters like @kbd{~} and @kbd{@@} on non-US keyboard
3363layouts; in this case, you may only use the left @key{ALT} as @key{META}
3364key.
3365
3366@kindex C-j @r{(MS-DOS)}
3367@vindex dos-keypad-mode
3368 The variable @code{dos-keypad-mode} is a flag variable that controls
3369what key codes are returned by keys in the numeric keypad. You can also
3370define the keypad @key{ENTER} key to act like @kbd{C-j}, by putting the
3371following line into your @file{_emacs} file:
3372
3373@smallexample
3374;; @r{Make the @key{ENTER} key from the numeric keypad act as @kbd{C-j}.}
3375(define-key function-key-map [kp-enter] [?\C-j])
3376@end smallexample
3377
3378@node MS-DOS Mouse
3379@section Mouse Usage on MS-DOS
3380
3381@cindex mouse support under MS-DOS
3382 Emacs on MS-DOS supports a mouse (on the default terminal only).
3383The mouse commands work as documented, including those that use menus
3384and the menu bar (@pxref{Menu Bar,,,emacs, the Emacs Manual}). Scroll
3385bars don't work in MS-DOS Emacs. PC mice usually have only two
3386buttons; these act as @kbd{Mouse-1} and @kbd{Mouse-2}, but if you
3387press both of them together, that has the effect of @kbd{Mouse-3}. If
3388the mouse does have 3 buttons, Emacs detects that at startup, and all
3389the 3 buttons function normally, as on X.
3390
3391 Help strings for menu-bar and pop-up menus are displayed in the echo
3392area when the mouse pointer moves across the menu items. Highlighting
3393of mouse-sensitive text (@pxref{Mouse References,,,emacs, the Emacs
3394Manual}) is also supported.
3395
3396@cindex mouse, set number of buttons
3397@findex msdos-set-mouse-buttons
3398 Some versions of mouse drivers don't report the number of mouse
3399buttons correctly. For example, mice with a wheel report that they
3400have 3 buttons, but only 2 of them are passed to Emacs; the clicks on
3401the wheel, which serves as the middle button, are not passed. In
3402these cases, you can use the @kbd{M-x msdos-set-mouse-buttons} command
3403to tell Emacs how many mouse buttons to expect. You could make such a
3404setting permanent by adding this fragment to your @file{_emacs} init
3405file:
3406
3407@example
3408;; @r{Treat the mouse like a 2-button mouse.}
3409(msdos-set-mouse-buttons 2)
3410@end example
3411
3412@cindex Windows clipboard support
3413 Emacs built for MS-DOS supports clipboard operations when it runs on
3414Windows. Commands that put text on the kill ring, or yank text from
3415the ring, check the Windows clipboard first, just as Emacs does on the
3416X Window System (@pxref{Mouse Commands,,,emacs, the Emacs Manual}).
3417Only the primary selection and the cut buffer are supported by MS-DOS
3418Emacs on Windows; the secondary selection always appears as empty.
3419
3420 Due to the way clipboard access is implemented by Windows, the
3421length of text you can put into the clipboard is limited by the amount
3422of free DOS memory that is available to Emacs. Usually, up to 620KB of
3423text can be put into the clipboard, but this limit depends on the system
3424configuration and is lower if you run Emacs as a subprocess of
3425another program. If the killed text does not fit, Emacs outputs a
3426message saying so, and does not put the text into the clipboard.
3427
3428 Null characters also cannot be put into the Windows clipboard. If the
3429killed text includes null characters, Emacs does not put such text into
3430the clipboard, and displays in the echo area a message to that effect.
3431
3432@vindex dos-display-scancodes
3433 The variable @code{dos-display-scancodes}, when non-@code{nil},
3434directs Emacs to display the @acronym{ASCII} value and the keyboard scan code of
3435each keystroke; this feature serves as a complement to the
3436@code{view-lossage} command, for debugging.
3437
3438@node MS-DOS Display
3439@section Display on MS-DOS
3440@cindex faces under MS-DOS
3441@cindex fonts, emulating under MS-DOS
3442
3443 Display on MS-DOS cannot use font variants, like bold or italic, but
3444it does support multiple faces, each of which can specify a foreground
3445and a background color. Therefore, you can get the full functionality
3446of Emacs packages that use fonts (such as @code{font-lock}, Enriched
3447Text mode, and others) by defining the relevant faces to use different
3448colors. Use the @code{list-colors-display} command (@pxref{Frame
3449Parameters,,,emacs, the Emacs Manual}) and the
3450@code{list-faces-display} command (@pxref{Faces,,,emacs, the Emacs
3451Manual}) to see what colors and faces are available and what they look
3452like.
3453
3454 @xref{MS-DOS and MULE}, later in this chapter, for information on
3455how Emacs displays glyphs and characters that aren't supported by the
3456native font built into the DOS display.
3457
3458@cindex cursor shape on MS-DOS
3459 When Emacs starts, it changes the cursor shape to a solid box. This
3460is for compatibility with other systems, where the box cursor is the
3461default in Emacs. This default shape can be changed to a bar by
3462specifying the @code{cursor-type} parameter in the variable
3463@code{default-frame-alist} (@pxref{Creating Frames,,,emacs, the Emacs
3464Manual}). The MS-DOS terminal doesn't support a vertical-bar cursor,
3465so the bar cursor is horizontal, and the @code{@var{width}} parameter,
3466if specified by the frame parameters, actually determines its height.
3467For this reason, the @code{bar} and @code{hbar} cursor types produce
3468the same effect on MS-DOS. As an extension, the bar cursor
3469specification can include the starting scan line of the cursor as well
3470as its width, like this:
3471
3472@example
3473 '(cursor-type bar @var{width} . @var{start})
3474@end example
3475
3476@noindent
3477In addition, if the @var{width} parameter is negative, the cursor bar
3478begins at the top of the character cell.
3479
3480@cindex frames on MS-DOS
3481 The MS-DOS terminal can only display a single frame at a time. The
3482Emacs frame facilities work on MS-DOS much as they do on text-only
3483terminals (@pxref{Frames,,,emacs, the Emacs Manual}). When you run
3484Emacs from a DOS window on MS-Windows, you can make the visible frame
3485smaller than the full screen, but Emacs still cannot display more than
3486a single frame at a time.
3487
3488@cindex frame size under MS-DOS
3489@findex mode4350
3490@findex mode25
3491 The @code{mode4350} command switches the display to 43 or 50
3492lines, depending on your hardware; the @code{mode25} command switches
3493to the default 80x25 screen size.
3494
3495 By default, Emacs only knows how to set screen sizes of 80 columns by
349625, 28, 35, 40, 43 or 50 rows. However, if your video adapter has
3497special video modes that will switch the display to other sizes, you can
3498have Emacs support those too. When you ask Emacs to switch the frame to
3499@var{n} rows by @var{m} columns dimensions, it checks if there is a
3500variable called @code{screen-dimensions-@var{n}x@var{m}}, and if so,
3501uses its value (which must be an integer) as the video mode to switch
3502to. (Emacs switches to that video mode by calling the BIOS @code{Set
3503Video Mode} function with the value of
3504@code{screen-dimensions-@var{n}x@var{m}} in the @code{AL} register.)
3505For example, suppose your adapter will switch to 66x80 dimensions when
3506put into video mode 85. Then you can make Emacs support this screen
3507size by putting the following into your @file{_emacs} file:
3508
3509@example
3510(setq screen-dimensions-66x80 85)
3511@end example
3512
3513 Since Emacs on MS-DOS can only set the frame size to specific
3514supported dimensions, it cannot honor every possible frame resizing
3515request. When an unsupported size is requested, Emacs chooses the next
3516larger supported size beyond the specified size. For example, if you
3517ask for 36x80 frame, you will get 40x80 instead.
3518
3519 The variables @code{screen-dimensions-@var{n}x@var{m}} are used only
3520when they exactly match the specified size; the search for the next
3521larger supported size ignores them. In the above example, even if your
3522VGA supports 38x80 dimensions and you define a variable
3523@code{screen-dimensions-38x80} with a suitable value, you will still get
352440x80 screen when you ask for a 36x80 frame. If you want to get the
352538x80 size in this case, you can do it by setting the variable named
3526@code{screen-dimensions-36x80} with the same video mode value as
3527@code{screen-dimensions-38x80}.
3528
3529 Changing frame dimensions on MS-DOS has the effect of changing all the
3530other frames to the new dimensions.
3531
3532@node MS-DOS File Names
3533@section File Names on MS-DOS
3534@cindex file names under MS-DOS
3535@cindex init file, default name under MS-DOS
3536
3537 On MS-DOS, file names are case-insensitive and limited to eight
3538characters, plus optionally a period and three more characters. Emacs
3539knows enough about these limitations to handle file names that were
3540meant for other operating systems. For instance, leading dots
3541@samp{.} in file names are invalid in MS-DOS, so Emacs transparently
3542converts them to underscores @samp{_}; thus your default init file
3543(@pxref{Init File,,,emacs, the Emacs Manual}) is called @file{_emacs}
3544on MS-DOS. Excess characters before or after the period are generally
3545ignored by MS-DOS itself; thus, if you visit the file
3546@file{LongFileName.EvenLongerExtension}, you will silently get
3547@file{longfile.eve}, but Emacs will still display the long file name
3548on the mode line. Other than that, it's up to you to specify file
3549names which are valid under MS-DOS; the transparent conversion as
3550described above only works on file names built into Emacs.
3551
3552@cindex backup file names on MS-DOS
3553 The above restrictions on the file names on MS-DOS make it almost
3554impossible to construct the name of a backup file (@pxref{Backup
3555Names,,,emacs, the Emacs Manual}) without losing some of the original
3556file name characters. For example, the name of a backup file for
3557@file{docs.txt} is @file{docs.tx~} even if single backup is used.
3558
3559@cindex file names under Windows 95/NT
3560@cindex long file names in DOS box under Windows 95/NT
3561 If you run Emacs as a DOS application under Windows 9X, Windows ME, or
3562Windows 2000, you can turn on support for long file names. If you do
3563that, Emacs doesn't truncate file names or convert them to lower case;
3564instead, it uses the file names that you specify, verbatim. To enable
3565long file name support, set the environment variable @env{LFN} to
3566@samp{y} before starting Emacs. Unfortunately, Windows NT doesn't allow
3567DOS programs to access long file names, so Emacs built for MS-DOS will
3568only see their short 8+3 aliases.
3569
3570@cindex @env{HOME} directory under MS-DOS
3571 MS-DOS has no notion of home directory, so Emacs on MS-DOS pretends
3572that the directory where it is installed is the value of the @env{HOME}
3573environment variable. That is, if your Emacs binary,
3574@file{emacs.exe}, is in the directory @file{c:/utils/emacs/bin}, then
3575Emacs acts as if @env{HOME} were set to @samp{c:/utils/emacs}. In
3576particular, that is where Emacs looks for the init file @file{_emacs}.
3577With this in mind, you can use @samp{~} in file names as an alias for
3578the home directory, as you would on GNU or Unix. You can also set
3579@env{HOME} variable in the environment before starting Emacs; its
3580value will then override the above default behavior.
3581
3582 Emacs on MS-DOS handles the directory name @file{/dev} specially,
3583because of a feature in the emulator libraries of DJGPP that pretends
3584I/O devices have names in that directory. We recommend that you avoid
3585using an actual directory named @file{/dev} on any disk.
3586
3587@node MS-DOS Printing
3588@section Printing and MS-DOS
3589
3590 Printing commands, such as @code{lpr-buffer}
3591(@pxref{Printing,,,emacs, the Emacs Manual}) and
3592@code{ps-print-buffer} (@pxref{PostScript,,,emacs, the Emacs Manual})
3593can work on MS-DOS by sending the output to one of the printer ports,
3594if a Posix-style @code{lpr} program is unavailable. The same Emacs
3595variables control printing on all systems, but in some cases they have
3596different default values on MS-DOS.
3597
3598@xref{MS-Windows Printing,,,emacs, the Emacs Manual}, for details.
3599
3600 Some printers expect DOS codepage encoding of non-@acronym{ASCII} text, even
3601though they are connected to a Windows machine which uses a different
3602encoding for the same locale. For example, in the Latin-1 locale, DOS
3603uses codepage 850 whereas Windows uses codepage 1252. @xref{MS-DOS and
3604MULE}. When you print to such printers from Windows, you can use the
3605@kbd{C-x RET c} (@code{universal-coding-system-argument}) command before
3606@kbd{M-x lpr-buffer}; Emacs will then convert the text to the DOS
3607codepage that you specify. For example, @kbd{C-x RET c cp850-dos RET
3608M-x lpr-region RET} will print the region while converting it to the
3609codepage 850 encoding. You may need to create the @code{cp@var{nnn}}
3610coding system with @kbd{M-x codepage-setup}.
3611
3612@vindex dos-printer
3613@vindex dos-ps-printer
3614 For backwards compatibility, the value of @code{dos-printer}
3615(@code{dos-ps-printer}), if it has a value, overrides the value of
3616@code{printer-name} (@code{ps-printer-name}), on MS-DOS.
3617
3618
3619@node MS-DOS and MULE
3620@section International Support on MS-DOS
3621@cindex international support @r{(MS-DOS)}
3622
3623 Emacs on MS-DOS supports the same international character sets as it
3624does on GNU, Unix and other platforms (@pxref{International,,,emacs,
3625the Emacs Manual}), including coding systems for converting between
3626the different character sets. However, due to incompatibilities
3627between MS-DOS/MS-Windows and other systems, there are several
3628DOS-specific aspects of this support that you should be aware of.
3629This section describes these aspects.
3630
3631 The description below is largely specific to the MS-DOS port of
3632Emacs, especially where it talks about practical implications for
3633Emacs users. For other operating systems, see the @file{code-pages.el}
3634package, which implements support for MS-DOS- and MS-Windows-specific
3635encodings for all platforms other than MS-DOS.
3636
3637@table @kbd
3638@item M-x dos-codepage-setup
3639Set up Emacs display and coding systems as appropriate for the current
3640DOS codepage.
3641
3642@item M-x codepage-setup
3643Create a coding system for a certain DOS codepage.
3644@end table
3645
3646@cindex codepage, MS-DOS
3647@cindex DOS codepages
3648 MS-DOS is designed to support one character set of 256 characters at
3649any given time, but gives you a variety of character sets to choose
3650from. The alternative character sets are known as @dfn{DOS codepages}.
3651Each codepage includes all 128 @acronym{ASCII} characters, but the other 128
3652characters (codes 128 through 255) vary from one codepage to another.
3653Each DOS codepage is identified by a 3-digit number, such as 850, 862,
3654etc.
3655
3656 In contrast to X, which lets you use several fonts at the same time,
3657MS-DOS normally doesn't allow use of several codepages in a single
3658session. MS-DOS was designed to load a single codepage at system
3659startup, and require you to reboot in order to change
3660it@footnote{Normally, one particular codepage is burnt into the
3661display memory, while other codepages can be installed by modifying
3662system configuration files, such as @file{CONFIG.SYS}, and rebooting.
3663While there is third-party software that allows changing the codepage
3664without rebooting, we describe here how a stock MS-DOS system
3665behaves.}. Much the same limitation applies when you run DOS
3666executables on other systems such as MS-Windows.
3667
3668@cindex unibyte operation @r{(MS-DOS)}
3669 If you invoke Emacs on MS-DOS with the @samp{--unibyte} option
3670(@pxref{Initial Options,,,emacs, the Emacs Manual}), Emacs does not
3671perform any conversion of non-@acronym{ASCII} characters. Instead, it
3672reads and writes any non-@acronym{ASCII} characters verbatim, and
3673sends their 8-bit codes to the display verbatim. Thus, unibyte Emacs
3674on MS-DOS supports the current codepage, whatever it may be, but
3675cannot even represent any other characters.
3676
3677@vindex dos-codepage
3678 For multibyte operation on MS-DOS, Emacs needs to know which
3679characters the chosen DOS codepage can display. So it queries the
3680system shortly after startup to get the chosen codepage number, and
3681stores the number in the variable @code{dos-codepage}. Some systems
3682return the default value 437 for the current codepage, even though the
3683actual codepage is different. (This typically happens when you use the
3684codepage built into the display hardware.) You can specify a different
3685codepage for Emacs to use by setting the variable @code{dos-codepage} in
3686your init file.
3687
3688@cindex language environment, automatic selection on @r{MS-DOS}
3689 Multibyte Emacs supports only certain DOS codepages: those which can
3690display Far-Eastern scripts, like the Japanese codepage 932, and those
3691that encode a single ISO 8859 character set.
3692
3693 The Far-Eastern codepages can directly display one of the MULE
3694character sets for these countries, so Emacs simply sets up to use the
3695appropriate terminal coding system that is supported by the codepage.
3696The special features described in the rest of this section mostly
3697pertain to codepages that encode ISO 8859 character sets.
3698
3699 For the codepages which correspond to one of the ISO character sets,
3700Emacs knows the character set name based on the codepage number. Emacs
3701automatically creates a coding system to support reading and writing
3702files that use the current codepage, and uses this coding system by
3703default. The name of this coding system is @code{cp@var{nnn}}, where
3704@var{nnn} is the codepage number.@footnote{The standard Emacs coding
3705systems for ISO 8859 are not quite right for the purpose, because
3706typically the DOS codepage does not match the standard ISO character
3707codes. For example, the letter @samp{@,{c}} (@samp{c} with cedilla) has
3708code 231 in the standard Latin-1 character set, but the corresponding
3709DOS codepage 850 uses code 135 for this glyph.}
3710
3711@cindex mode line @r{(MS-DOS)}
3712 All the @code{cp@var{nnn}} coding systems use the letter @samp{D}
3713(for ``DOS'') as their mode-line mnemonic. Since both the terminal
3714coding system and the default coding system for file I/O are set to
3715the proper @code{cp@var{nnn}} coding system at startup, it is normal
3716for the mode line on MS-DOS to begin with @samp{-DD\-}. @xref{Mode
3717Line,,,emacs, the Emacs Manual}. Far-Eastern DOS terminals do not use
3718the @code{cp@var{nnn}} coding systems, and thus their initial mode
3719line looks like the Emacs default.
3720
3721 Since the codepage number also indicates which script you are using,
3722Emacs automatically runs @code{set-language-environment} to select the
3723language environment for that script (@pxref{Language
3724Environments,,,emacs, the Emacs Manual}).
3725
3726 If a buffer contains a character belonging to some other ISO 8859
3727character set, not the one that the chosen DOS codepage supports, Emacs
3728displays it using a sequence of @acronym{ASCII} characters. For example, if the
3729current codepage doesn't have a glyph for the letter @samp{@`o} (small
3730@samp{o} with a grave accent), it is displayed as @samp{@{`o@}}, where
3731the braces serve as a visual indication that this is a single character.
3732(This may look awkward for some non-Latin characters, such as those from
3733Greek or Hebrew alphabets, but it is still readable by a person who
3734knows the language.) Even though the character may occupy several
3735columns on the screen, it is really still just a single character, and
3736all Emacs commands treat it as one.
3737
3738@cindex IBM graphics characters (MS-DOS)
3739@cindex box-drawing characters (MS-DOS)
3740@cindex line-drawing characters (MS-DOS)
3741 Not all characters in DOS codepages correspond to ISO 8859
3742characters---some are used for other purposes, such as box-drawing
3743characters and other graphics. Emacs maps these characters to two
3744special character sets called @code{eight-bit-control} and
3745@code{eight-bit-graphic}, and displays them as their IBM glyphs.
3746However, you should be aware that other systems might display these
3747characters differently, so you should avoid them in text that might be
3748copied to a different operating system, or even to another DOS machine
3749that uses a different codepage.
3750
3751@vindex dos-unsupported-character-glyph
3752 Emacs supports many other characters sets aside from ISO 8859, but it
3753cannot display them on MS-DOS. So if one of these multibyte characters
3754appears in a buffer, Emacs on MS-DOS displays them as specified by the
3755@code{dos-unsupported-character-glyph} variable; by default, this glyph
3756is an empty triangle. Use the @kbd{C-u C-x =} command to display the
3757actual code and character set of such characters. @xref{Position
3758Info,,,emacs, the Emacs Manual}.
3759
3760@findex codepage-setup
3761 By default, Emacs defines a coding system to support the current
3762codepage. To define a coding system for some other codepage (e.g., to
3763visit a file written on a DOS machine in another country), use the
3764@kbd{M-x codepage-setup} command. It prompts for the 3-digit code of
3765the codepage, with completion, then creates the coding system for the
3766specified codepage. You can then use the new coding system to read and
3767write files, but you must specify it explicitly for the file command
3768when you want to use it (@pxref{Text Coding,,,emacs, the Emacs Manual}).
3769
3770 These coding systems are also useful for visiting a file encoded using
3771a DOS codepage, using Emacs running on some other operating system.
3772
3773@cindex MS-Windows codepages
3774 MS-Windows provides its own codepages, which are different from the
3775DOS codepages for the same locale. For example, DOS codepage 850
3776supports the same character set as Windows codepage 1252; DOS codepage
3777855 supports the same character set as Windows codepage 1251, etc.
3778The MS-Windows version of Emacs uses the current codepage for display
3779when invoked with the @samp{-nw} option. Support for codepages in the
3780Windows port of Emacs is part of the @file{code-pages.el} package.
3781
3782@node MS-DOS Processes
3783@section Subprocesses on MS-DOS
3784
3785@cindex compilation under MS-DOS
3786@cindex inferior processes under MS-DOS
3787@findex compile @r{(MS-DOS)}
3788@findex grep @r{(MS-DOS)}
3789 Because MS-DOS is a single-process ``operating system,''
3790asynchronous subprocesses are not available. In particular, Shell
3791mode and its variants do not work. Most Emacs features that use
3792asynchronous subprocesses also don't work on MS-DOS, including
3793Shell mode and GUD. When in doubt, try and see; commands that
3794don't work output an error message saying that asynchronous processes
3795aren't supported.
3796
3797 Compilation under Emacs with @kbd{M-x compile}, searching files with
3798@kbd{M-x grep} and displaying differences between files with @kbd{M-x
3799diff} do work, by running the inferior processes synchronously. This
3800means you cannot do any more editing until the inferior process
3801finishes.
3802
3803 Spell checking also works, by means of special support for synchronous
3804invocation of the @code{ispell} program. This is slower than the
3805asynchronous invocation on other platforms
3806
3807 Instead of the Shell mode, which doesn't work on MS-DOS, you can use
3808the @kbd{M-x eshell} command. This invokes the Eshell package that
3809implements a Posix-like shell entirely in Emacs Lisp.
3810
3811 By contrast, Emacs compiled as a native Windows application
3812@strong{does} support asynchronous subprocesses. @xref{Windows
3813Processes,,,emacs, the Emacs Manual}.
3814
3815@cindex printing under MS-DOS
3816 Printing commands, such as @code{lpr-buffer}
3817(@pxref{Printing,,,emacs, the Emacs Manual}) and
3818@code{ps-print-buffer} (@pxref{PostScript,,,emacs, the Emacs Manual}),
3819work in MS-DOS by sending the output to one of the printer ports.
3820@xref{MS-DOS Printing,,,emacs, the Emacs Manual}.
3821
3822 When you run a subprocess synchronously on MS-DOS, make sure the
3823program terminates and does not try to read keyboard input. If the
3824program does not terminate on its own, you will be unable to terminate
3825it, because MS-DOS provides no general way to terminate a process.
3826Pressing @kbd{C-c} or @kbd{C-@key{BREAK}} might sometimes help in these
3827cases.
3828
3829 Accessing files on other machines is not supported on MS-DOS. Other
3830network-oriented commands such as sending mail, Web browsing, remote
3831login, etc., don't work either, unless network access is built into
3832MS-DOS with some network redirector.
3833
3834@cindex directory listing on MS-DOS
3835@vindex dired-listing-switches @r{(MS-DOS)}
3836 Dired on MS-DOS uses the @code{ls-lisp} package where other
3837platforms use the system @code{ls} command. Therefore, Dired on
3838MS-DOS supports only some of the possible options you can mention in
3839the @code{dired-listing-switches} variable. The options that work are
3840@samp{-A}, @samp{-a}, @samp{-c}, @samp{-i}, @samp{-r}, @samp{-S},
3841@samp{-s}, @samp{-t}, and @samp{-u}.
3842
3843 116
3844@node Index 117@node Index
3845@unnumbered Index 118@unnumbered Index
diff --git a/man/emacs.texi b/man/emacs.texi
index c058e02d8eb..94ec0cc52a6 100644
--- a/man/emacs.texi
+++ b/man/emacs.texi
@@ -42,7 +42,13 @@ Software Foundation raise funds for GNU development.''
42 42
43@smallbook 43@smallbook
44 44
45@setchapternewpage odd 45@c per rms and peterb, use 10pt fonts for the main text, mostly to
46@c save on paper cost. Also do not declare @setchapternewpage odd.
47@c Do this inside @tex for now, so current makeinfo does not complain.
48@tex
49@fonttextsize 10
50@end tex
51
46@defcodeindex op 52@defcodeindex op
47@synindex pg cp 53@synindex pg cp
48 54
@@ -127,7 +133,7 @@ and Sending Mail and Registers and Minibuffer.
127* Glossary:: The glossary. 133* Glossary:: The glossary.
128* Antinews:: Information about Emacs version 21. 134* Antinews:: Information about Emacs version 21.
129* Mac OS:: Using Emacs in the Mac. 135* Mac OS:: Using Emacs in the Mac.
130* Emacs and Microsoft Windows:: Using Emacs on Microsoft Windows. 136* Microsoft Windows:: Using Emacs on Microsoft Windows and MS-DOS.
131* Manifesto:: What's GNU? Gnu's Not Unix! 137* Manifesto:: What's GNU? Gnu's Not Unix!
132* Acknowledgments:: Major contributors to GNU Emacs. 138* Acknowledgments:: Major contributors to GNU Emacs.
133 139
@@ -186,6 +192,10 @@ Advanced Features
186* Maintaining:: Features for maintaining large programs. 192* Maintaining:: Features for maintaining large programs.
187* Abbrevs:: How to define text abbreviations to reduce 193* Abbrevs:: How to define text abbreviations to reduce
188 the number of characters you must type. 194 the number of characters you must type.
195@ifnottex
196* Picture Mode:: Editing pictures made up of characters using
197 the quarter-plane screen model.
198@end ifnottex
189* Sending Mail:: Sending mail in Emacs. 199* Sending Mail:: Sending mail in Emacs.
190* Rmail:: Reading mail in Emacs. 200* Rmail:: Reading mail in Emacs.
191* Dired:: You can ``edit'' a directory to manage files in it. 201* Dired:: You can ``edit'' a directory to manage files in it.
@@ -197,7 +207,6 @@ Advanced Features
197* Sorting:: Sorting lines, paragraphs or pages within Emacs. 207* Sorting:: Sorting lines, paragraphs or pages within Emacs.
198* Narrowing:: Restricting display and editing to a portion 208* Narrowing:: Restricting display and editing to a portion
199 of the buffer. 209 of the buffer.
200* Diff Mode:: Editing diff output.
201* Two-Column:: Splitting apart columns to edit them 210* Two-Column:: Splitting apart columns to edit them
202 in side-by-side windows. 211 in side-by-side windows.
203* Editing Binary Files::Using Hexl mode to edit binary files. 212* Editing Binary Files::Using Hexl mode to edit binary files.
@@ -373,6 +382,7 @@ File Handling
373* Version Control:: Version control systems (RCS, CVS and SCCS). 382* Version Control:: Version control systems (RCS, CVS and SCCS).
374* Directories:: Creating, deleting, and listing file directories. 383* Directories:: Creating, deleting, and listing file directories.
375* Comparing Files:: Finding where two files differ. 384* Comparing Files:: Finding where two files differ.
385* Diff Mode:: Editing diff output.
376* Misc File Ops:: Other things you can do on files. 386* Misc File Ops:: Other things you can do on files.
377* Compressed Files:: Accessing compressed files. 387* Compressed Files:: Accessing compressed files.
378* File Archives:: Operating on tar, zip, jar etc. archive files. 388* File Archives:: Operating on tar, zip, jar etc. archive files.
@@ -626,6 +636,16 @@ Abbrevs
626* Dynamic Abbrevs:: Abbreviations for words already in the buffer. 636* Dynamic Abbrevs:: Abbreviations for words already in the buffer.
627* Dabbrev Customization:: What is a word, for dynamic abbrevs. Case handling. 637* Dabbrev Customization:: What is a word, for dynamic abbrevs. Case handling.
628 638
639@ifnottex
640Editing Pictures
641
642* Basic Picture:: Basic concepts and simple commands of Picture Mode.
643* Insert in Picture:: Controlling direction of cursor motion
644 after "self-inserting" characters.
645* Tabs in Picture:: Various features for tab stops and indentation.
646* Rectangles in Picture:: Clearing and superimposing rectangles.
647@end ifnottex
648
629Sending Mail 649Sending Mail
630 650
631* Mail Format:: Format of the mail being composed. 651* Mail Format:: Format of the mail being composed.
@@ -873,7 +893,7 @@ programmer, but if you are not interested in customizing, you can
873ignore the customization hints. 893ignore the customization hints.
874 894
875 This is primarily a reference manual, but can also be used as a 895 This is primarily a reference manual, but can also be used as a
876primer. If you are a complete beginner, we recommend you start with 896primer. If you are new to Emacs, we recommend you start with
877the on-line, learn-by-doing tutorial, before reading the manual. To 897the on-line, learn-by-doing tutorial, before reading the manual. To
878run the tutorial, start Emacs and type @kbd{C-h t}. The tutorial 898run the tutorial, start Emacs and type @kbd{C-h t}. The tutorial
879describes commands, tells you when to try them, and explains the 899describes commands, tells you when to try them, and explains the
@@ -921,8 +941,8 @@ This edition of the manual is intended for use with GNU Emacs
921installed on GNU and Unix systems. GNU Emacs can also be used on VMS, 941installed on GNU and Unix systems. GNU Emacs can also be used on VMS,
922MS-DOS (also called MS-DOG), Microsoft Windows, and Macintosh systems. 942MS-DOS (also called MS-DOG), Microsoft Windows, and Macintosh systems.
923Those systems use different file name syntax; in addition, VMS and 943Those systems use different file name syntax; in addition, VMS and
924MS-DOS do not support all GNU Emacs features. @xref{Emacs and 944MS-DOS do not support all GNU Emacs features. @xref{Microsoft
925Microsoft Windows}, for information about using Emacs on Windows. 945Windows}, for information about using Emacs on Windows.
926@xref{Mac OS}, for information about using Emacs on Macintosh. We 946@xref{Mac OS}, for information about using Emacs on Macintosh. We
927don't try to describe VMS usage in this manual. 947don't try to describe VMS usage in this manual.
928@end iftex 948@end iftex
@@ -1131,6 +1151,9 @@ while running shell commands.
1131@include building.texi 1151@include building.texi
1132@include maintaining.texi 1152@include maintaining.texi
1133@include abbrevs.texi 1153@include abbrevs.texi
1154@ifnottex
1155@include picture-xtra.texi
1156@end ifnottex
1134@include sending.texi 1157@include sending.texi
1135@include rmail.texi 1158@include rmail.texi
1136@include dired.texi 1159@include dired.texi
diff --git a/man/emerge-xtra.texi b/man/emerge-xtra.texi
new file mode 100644
index 00000000000..3b5fe7cd17f
--- /dev/null
+++ b/man/emerge-xtra.texi
@@ -0,0 +1,414 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions.
4@c
5@c This file is included either in emacs-xtra.texi (when producing the
6@c printed version) or in the main Emacs manual (for the on-line version).
7@node Emerge
8@section Merging Files with Emerge
9@cindex Emerge
10@cindex merging files
11
12 It's not unusual for programmers to get their signals crossed and
13modify the same program in two different directions. To recover from
14this confusion, you need to merge the two versions. Emerge makes this
15easier. For other ways to compare files, see
16@iftex
17@ref{Comparing Files,,, emacs, the Emacs Manual},
18@end iftex
19@ifnottex
20@ref{Comparing Files},
21@end ifnottex
22and @ref{Top, Ediff,, ediff, The Ediff Manual}.
23
24@menu
25* Overview of Emerge:: How to start Emerge. Basic concepts.
26* Submodes of Emerge:: Fast mode vs. Edit mode.
27 Skip Prefers mode and Auto Advance mode.
28* State of Difference:: You do the merge by specifying state A or B
29 for each difference.
30* Merge Commands:: Commands for selecting a difference,
31 changing states of differences, etc.
32* Exiting Emerge:: What to do when you've finished the merge.
33* Combining in Emerge:: How to keep both alternatives for a difference.
34* Fine Points of Emerge:: Misc.
35@end menu
36
37@node Overview of Emerge
38@subsection Overview of Emerge
39
40 To start Emerge, run one of these four commands:
41
42@table @kbd
43@item M-x emerge-files
44@findex emerge-files
45Merge two specified files.
46
47@item M-x emerge-files-with-ancestor
48@findex emerge-files-with-ancestor
49Merge two specified files, with reference to a common ancestor.
50
51@item M-x emerge-buffers
52@findex emerge-buffers
53Merge two buffers.
54
55@item M-x emerge-buffers-with-ancestor
56@findex emerge-buffers-with-ancestor
57Merge two buffers with reference to a common ancestor in a third
58buffer.
59@end table
60
61@cindex merge buffer (Emerge)
62@cindex A and B buffers (Emerge)
63 The Emerge commands compare two files or buffers, and display the
64comparison in three buffers: one for each input text (the @dfn{A buffer}
65and the @dfn{B buffer}), and one (the @dfn{merge buffer}) where merging
66takes place. The merge buffer shows the full merged text, not just the
67differences. Wherever the two input texts differ, you can choose which
68one of them to include in the merge buffer.
69
70 The Emerge commands that take input from existing buffers use only
71the accessible portions of those buffers, if they are narrowed.
72@iftex
73@xref{Narrowing,,, emacs, the Emacs Manual}.
74@end iftex
75@ifnottex
76@xref{Narrowing}.
77@end ifnottex
78
79
80 If a common ancestor version is available, from which the two texts to
81be merged were both derived, Emerge can use it to guess which
82alternative is right. Wherever one current version agrees with the
83ancestor, Emerge presumes that the other current version is a deliberate
84change which should be kept in the merged version. Use the
85@samp{with-ancestor} commands if you want to specify a common ancestor
86text. These commands read three file or buffer names---variant A,
87variant B, and the common ancestor.
88
89 After the comparison is done and the buffers are prepared, the
90interactive merging starts. You control the merging by typing special
91@dfn{merge commands} in the merge buffer (@pxref{Merge Commands}).
92For each run of differences between the input texts, you can choose
93which one of them to keep, or edit them both together.
94
95 The merge buffer uses a special major mode, Emerge mode, with commands
96for making these choices. But you can also edit the buffer with
97ordinary Emacs commands.
98
99 At any given time, the attention of Emerge is focused on one
100particular difference, called the @dfn{selected} difference. This
101difference is marked off in the three buffers like this:
102
103@example
104vvvvvvvvvvvvvvvvvvvv
105@var{text that differs}
106^^^^^^^^^^^^^^^^^^^^
107@end example
108
109@noindent
110Emerge numbers all the differences sequentially and the mode
111line always shows the number of the selected difference.
112
113 Normally, the merge buffer starts out with the A version of the text.
114But when the A version of a difference agrees with the common ancestor,
115then the B version is initially preferred for that difference.
116
117 Emerge leaves the merged text in the merge buffer when you exit. At
118that point, you can save it in a file with @kbd{C-x C-w}. If you give a
119numeric argument to @code{emerge-files} or
120@code{emerge-files-with-ancestor}, it reads the name of the output file
121using the minibuffer. (This is the last file name those commands read.)
122Then exiting from Emerge saves the merged text in the output file.
123
124 Normally, Emerge commands save the output buffer in its file when you
125exit. If you abort Emerge with @kbd{C-]}, the Emerge command does not
126save the output buffer, but you can save it yourself if you wish.
127
128@node Submodes of Emerge
129@subsection Submodes of Emerge
130
131 You can choose between two modes for giving merge commands: Fast mode
132and Edit mode. In Fast mode, basic merge commands are single
133characters, but ordinary Emacs commands are disabled. This is
134convenient if you use only merge commands. In Edit mode, all merge
135commands start with the prefix key @kbd{C-c C-c}, and the normal Emacs
136commands are also available. This allows editing the merge buffer, but
137slows down Emerge operations.
138
139 Use @kbd{e} to switch to Edit mode, and @kbd{C-c C-c f} to switch to
140Fast mode. The mode line indicates Edit and Fast modes with @samp{E}
141and @samp{F}.
142
143 Emerge has two additional submodes that affect how particular merge
144commands work: Auto Advance mode and Skip Prefers mode.
145
146 If Auto Advance mode is in effect, the @kbd{a} and @kbd{b} commands
147advance to the next difference. This lets you go through the merge
148faster as long as you simply choose one of the alternatives from the
149input. The mode line indicates Auto Advance mode with @samp{A}.
150
151 If Skip Prefers mode is in effect, the @kbd{n} and @kbd{p} commands
152skip over differences in states prefer-A and prefer-B (@pxref{State of
153Difference}). Thus you see only differences for which neither version
154is presumed ``correct.'' The mode line indicates Skip Prefers mode with
155@samp{S}.
156
157@findex emerge-auto-advance-mode
158@findex emerge-skip-prefers-mode
159 Use the command @kbd{s a} (@code{emerge-auto-advance-mode}) to set or
160clear Auto Advance mode. Use @kbd{s s}
161(@code{emerge-skip-prefers-mode}) to set or clear Skip Prefers mode.
162These commands turn on the mode with a positive argument, turns it off
163with a negative or zero argument, and toggle the mode with no argument.
164
165@node State of Difference
166@subsection State of a Difference
167
168 In the merge buffer, a difference is marked with lines of @samp{v} and
169@samp{^} characters. Each difference has one of these seven states:
170
171@table @asis
172@item A
173The difference is showing the A version. The @kbd{a} command always
174produces this state; the mode line indicates it with @samp{A}.
175
176@item B
177The difference is showing the B version. The @kbd{b} command always
178produces this state; the mode line indicates it with @samp{B}.
179
180@item default-A
181@itemx default-B
182The difference is showing the A or the B state by default, because you
183haven't made a choice. All differences start in the default-A state
184(and thus the merge buffer is a copy of the A buffer), except those for
185which one alternative is ``preferred'' (see below).
186
187When you select a difference, its state changes from default-A or
188default-B to plain A or B. Thus, the selected difference never has
189state default-A or default-B, and these states are never displayed in
190the mode line.
191
192The command @kbd{d a} chooses default-A as the default state, and @kbd{d
193b} chooses default-B. This chosen default applies to all differences
194which you haven't ever selected and for which no alternative is preferred.
195If you are moving through the merge sequentially, the differences you
196haven't selected are those following the selected one. Thus, while
197moving sequentially, you can effectively make the A version the default
198for some sections of the merge buffer and the B version the default for
199others by using @kbd{d a} and @kbd{d b} between sections.
200
201@item prefer-A
202@itemx prefer-B
203The difference is showing the A or B state because it is
204@dfn{preferred}. This means that you haven't made an explicit choice,
205but one alternative seems likely to be right because the other
206alternative agrees with the common ancestor. Thus, where the A buffer
207agrees with the common ancestor, the B version is preferred, because
208chances are it is the one that was actually changed.
209
210These two states are displayed in the mode line as @samp{A*} and @samp{B*}.
211
212@item combined
213The difference is showing a combination of the A and B states, as a
214result of the @kbd{x c} or @kbd{x C} commands.
215
216Once a difference is in this state, the @kbd{a} and @kbd{b} commands
217don't do anything to it unless you give them a numeric argument.
218
219The mode line displays this state as @samp{comb}.
220@end table
221
222@node Merge Commands
223@subsection Merge Commands
224
225 Here are the Merge commands for Fast mode; in Edit mode, precede them
226with @kbd{C-c C-c}:
227
228@table @kbd
229@item p
230Select the previous difference.
231
232@item n
233Select the next difference.
234
235@item a
236Choose the A version of this difference.
237
238@item b
239Choose the B version of this difference.
240
241@item C-u @var{n} j
242Select difference number @var{n}.
243
244@item .
245Select the difference containing point. You can use this command in the
246merge buffer or in the A or B buffer.
247
248@item q
249Quit---finish the merge.
250
251@item C-]
252Abort---exit merging and do not save the output.
253
254@item f
255Go into Fast mode. (In Edit mode, this is actually @kbd{C-c C-c f}.)
256
257@item e
258Go into Edit mode.
259
260@item l
261Recenter (like @kbd{C-l}) all three windows.
262
263@item -
264Specify part of a prefix numeric argument.
265
266@item @var{digit}
267Also specify part of a prefix numeric argument.
268
269@item d a
270Choose the A version as the default from here down in
271the merge buffer.
272
273@item d b
274Choose the B version as the default from here down in
275the merge buffer.
276
277@item c a
278Copy the A version of this difference into the kill ring.
279
280@item c b
281Copy the B version of this difference into the kill ring.
282
283@item i a
284Insert the A version of this difference at point.
285
286@item i b
287Insert the B version of this difference at point.
288
289@item m
290Put point and mark around the difference.
291
292@item ^
293Scroll all three windows down (like @kbd{M-v}).
294
295@item v
296Scroll all three windows up (like @kbd{C-v}).
297
298@item <
299Scroll all three windows left (like @kbd{C-x <}).
300
301@item >
302Scroll all three windows right (like @kbd{C-x >}).
303
304@item |
305Reset horizontal scroll on all three windows.
306
307@item x 1
308Shrink the merge window to one line. (Use @kbd{C-u l} to restore it
309to full size.)
310
311@item x c
312Combine the two versions of this difference (@pxref{Combining in
313Emerge}).
314
315@item x f
316Show the names of the files/buffers Emerge is operating on, in a Help
317window. (Use @kbd{C-u l} to restore windows.)
318
319@item x j
320Join this difference with the following one.
321(@kbd{C-u x j} joins this difference with the previous one.)
322
323@item x s
324Split this difference into two differences. Before you use this
325command, position point in each of the three buffers at the place where
326you want to split the difference.
327
328@item x t
329Trim identical lines off the top and bottom of the difference.
330Such lines occur when the A and B versions are
331identical but differ from the ancestor version.
332@end table
333
334@node Exiting Emerge
335@subsection Exiting Emerge
336
337 The @kbd{q} command (@code{emerge-quit}) finishes the merge, storing
338the results into the output file if you specified one. It restores the
339A and B buffers to their proper contents, or kills them if they were
340created by Emerge and you haven't changed them. It also disables the
341Emerge commands in the merge buffer, since executing them later could
342damage the contents of the various buffers.
343
344 @kbd{C-]} aborts the merge. This means exiting without writing the
345output file. If you didn't specify an output file, then there is no
346real difference between aborting and finishing the merge.
347
348 If the Emerge command was called from another Lisp program, then its
349return value is @code{t} for successful completion, or @code{nil} if you
350abort.
351
352@node Combining in Emerge
353@subsection Combining the Two Versions
354
355 Sometimes you want to keep @emph{both} alternatives for a particular
356difference. To do this, use @kbd{x c}, which edits the merge buffer
357like this:
358
359@example
360@group
361#ifdef NEW
362@var{version from A buffer}
363#else /* not NEW */
364@var{version from B buffer}
365#endif /* not NEW */
366@end group
367@end example
368
369@noindent
370@vindex emerge-combine-versions-template
371While this example shows C preprocessor conditionals delimiting the two
372alternative versions, you can specify the strings to use by setting
373the variable @code{emerge-combine-versions-template} to a string of your
374choice. In the string, @samp{%a} says where to put version A, and
375@samp{%b} says where to put version B. The default setting, which
376produces the results shown above, looks like this:
377
378@example
379@group
380"#ifdef NEW\n%a#else /* not NEW */\n%b#endif /* not NEW */\n"
381@end group
382@end example
383
384@node Fine Points of Emerge
385@subsection Fine Points of Emerge
386
387 During the merge, you mustn't try to edit the A and B buffers yourself.
388Emerge modifies them temporarily, but ultimately puts them back the way
389they were.
390
391 You can have any number of merges going at once---just don't use any one
392buffer as input to more than one merge at once, since the temporary
393changes made in these buffers would get in each other's way.
394
395 Starting Emerge can take a long time because it needs to compare the
396files fully. Emacs can't do anything else until @code{diff} finishes.
397Perhaps in the future someone will change Emerge to do the comparison in
398the background when the input files are large---then you could keep on
399doing other things with Emacs until Emerge is ready to accept
400commands.
401
402@vindex emerge-startup-hook
403 After setting up the merge, Emerge runs the hook
404@code{emerge-startup-hook}.
405@iftex
406@xref{Hooks,,, emacs, the Emacs Manual}.
407@end iftex
408@ifnottex
409@xref{Hooks}.
410@end ifnottex
411
412@ignore
413 arch-tag: cda63f09-9c5f-4ea1-adb9-4a820fdfb24e
414@end ignore
diff --git a/man/entering.texi b/man/entering.texi
index 6a9ac0e8347..bef6a5a4db0 100644
--- a/man/entering.texi
+++ b/man/entering.texi
@@ -8,58 +8,54 @@
8@cindex starting Emacs 8@cindex starting Emacs
9 9
10 The usual way to invoke Emacs is with the shell command 10 The usual way to invoke Emacs is with the shell command
11@command{emacs}. Emacs clears the screen and then displays an initial 11@command{emacs}. Emacs clears the screen, then displays an initial
12help message and copyright notice. Some operating systems discard all 12help message and copyright notice. Some operating systems discard
13type-ahead when Emacs starts up; they give Emacs no way to prevent 13your type-ahead when Emacs starts up; they give Emacs no way to
14this. If you ever use those systems, learn the habit of waiting for 14prevent this. On those systems, wait for Emacs to clear the screen
15Emacs to clear the screen before typing your first editing command. 15before you start typing.
16 16
17 If you run Emacs from a shell window under the X Window System, run it 17 From a shell window under the X Window System, run Emacs in the
18in the background with @command{emacs&}. This way, Emacs does not tie up 18background with @command{emacs&}. This way, Emacs won't tie up the
19the shell window, so you can use that to run other shell commands while 19shell window, so you can use it to run other shell commands while
20Emacs operates its own X windows. You can begin typing Emacs commands 20Emacs is running. You can type Emacs commands as soon as you direct
21as soon as you direct your keyboard input to the Emacs frame. 21your keyboard input to an Emacs frame.
22 22
23@vindex initial-major-mode 23@vindex initial-major-mode
24 When Emacs starts up, it creates a buffer named @samp{*scratch*}. 24 When Emacs starts up, it creates a buffer named @samp{*scratch*}.
25That's the buffer you start out in. The @samp{*scratch*} buffer uses 25That's the buffer you start out in. The @samp{*scratch*} buffer uses
26Lisp Interaction mode; you can use it to type Lisp expressions and 26Lisp Interaction mode; you can use it to type Lisp expressions and
27evaluate them, or you can ignore that capability and just write notes 27evaluate them. You can also ignore that capability and just write notes
28in it. (You can specify a different major mode for this buffer by 28there. You can specify a different major mode for this buffer by
29setting the variable @code{initial-major-mode} in your init file. 29setting the variable @code{initial-major-mode} in your init file.
30@xref{Init File}.) 30@xref{Init File}.
31 31
32 It is possible to specify files to be visited, Lisp files to be 32 It is possible to specify files to be visited, Lisp files to be
33loaded, and functions to be called, by giving Emacs arguments in the 33loaded, and functions to be called through Emacs command-line
34shell command line. @xref{Emacs Invocation}. But we don't recommend 34arguments. @xref{Emacs Invocation}. The feature exists mainly for
35doing this. The feature exists mainly for compatibility with other 35compatibility with other editors, and for scripts.
36editors. 36
37 37 Many editors are designed to edit one file. When done with that
38 Many other editors are designed to be started afresh each time you 38file, you exit the editor. The next time you want to edit a file, you
39want to edit. You edit one file and then exit the editor. The next 39must start the editor again. Working this way, it is convenient to
40time you want to edit either another file or the same one, you must run 40use a command-line argument to say which file to edit.
41the editor again. With these editors, it makes sense to use a 41
42command-line argument to say which file to edit. 42 It's not smart to start Emacs afresh for every file you edit. Emacs
43 43can visit more than one file in a single editing session, and upon
44 But starting a new Emacs each time you want to edit a different file 44exit Emacs loses valuable accumulated context, such as the kill ring,
45does not make sense. This would fail to take advantage of Emacs's 45registers, undo history, and mark ring. These features are useful for
46ability to visit more than one file in a single editing session, and 46operating on multiple files, or even one. If you kill Emacs after
47it would lose the other accumulated context, such as the kill ring, 47each file, you don't take advantage of them.
48registers, undo history, and mark ring, that are useful for operating
49on multiple files or even one.
50 48
51 The recommended way to use GNU Emacs is to start it only once, just 49 The recommended way to use GNU Emacs is to start it only once, just
52after you log in, and do all your editing in the same Emacs session. 50after you log in, and do all your editing in the same Emacs session.
53Each time you want to edit a different file, you visit it with the 51Each time you edit a file, you visit it with the existing Emacs, which
54existing Emacs, which eventually comes to have many files in it ready 52eventually has many files in it ready for editing. Usually you do not
55for editing. Usually you do not kill the Emacs until you are about to 53kill Emacs until you are about to log out. @xref{Files}, for more
56log out. @xref{Files}, for more information on visiting more than one 54information on visiting more than one file.
57file.
58 55
59 If you want to edit a file from another program and already have 56 To edit a file from another program while Emacs is running, you can
60Emacs running, you can use the @command{emacsclient} program to open a 57use the @command{emacsclient} helper program to open a file in the
61file in the already running Emacs. @xref{Emacs Server}, for more 58already running Emacs. @xref{Emacs Server}.
62information on editing files with Emacs from other programs.
63 59
64@ifnottex 60@ifnottex
65@raisesections 61@raisesections
@@ -73,9 +69,9 @@ information on editing files with Emacs from other programs.
73@cindex leaving Emacs 69@cindex leaving Emacs
74@cindex quitting Emacs 70@cindex quitting Emacs
75 71
76 There are two commands for exiting Emacs because there are three 72 There are two commands for exiting Emacs, and three kinds of exiting:
77kinds of exiting: @dfn{suspending} Emacs, @dfn{Iconifying} Emacs, and 73@dfn{suspending} Emacs, @dfn{Iconifying} Emacs, and @dfn{killing}
78@dfn{killing} Emacs. 74Emacs.
79 75
80 @dfn{Suspending} means stopping Emacs temporarily and returning 76 @dfn{Suspending} means stopping Emacs temporarily and returning
81control to its parent process (usually a shell), allowing you to resume 77control to its parent process (usually a shell), allowing you to resume
@@ -110,11 +106,11 @@ it iconifies the Emacs frame.
110Emacs. You can resume Emacs with the shell command @command{%emacs} 106Emacs. You can resume Emacs with the shell command @command{%emacs}
111in most common shells. On systems that don't support suspending 107in most common shells. On systems that don't support suspending
112programs, @kbd{C-z} starts an inferior shell that communicates 108programs, @kbd{C-z} starts an inferior shell that communicates
113directly with the terminal, and Emacs waits until you exit the subshell. 109directly with the terminal, and Emacs waits until you exit the
114(The way to do that is probably with @kbd{C-d} or @command{exit}, but 110subshell. (The way to do that is probably with @kbd{C-d} or
115it depends on which shell you use.) The only way on these systems to 111@command{exit}, but it depends on which shell you use.) On these
116get back to the shell from which Emacs was run (to log out, for 112systems, you can only get back to the shell from which Emacs was run
117example) is to kill Emacs. 113(to log out, for example) when you kill Emacs.
118 114
119 Suspending can fail if you run Emacs under a shell that doesn't 115 Suspending can fail if you run Emacs under a shell that doesn't
120support suspending programs, even if the system itself does support 116support suspending programs, even if the system itself does support
@@ -133,13 +129,13 @@ a shell window.
133@kindex C-x C-c 129@kindex C-x C-c
134@findex save-buffers-kill-emacs 130@findex save-buffers-kill-emacs
135 To exit and kill Emacs, type @kbd{C-x C-c} 131 To exit and kill Emacs, type @kbd{C-x C-c}
136(@code{save-buffers-kill-emacs}). A two-character key is used for 132(@code{save-buffers-kill-emacs}). A two-character key is used to make
137this to make it harder to type by accident. This command first offers 133it harder to type by accident. This command first offers to save any
138to save any modified file-visiting buffers. If you do not save them 134modified file-visiting buffers. If you do not save them all, it asks
139all, it asks for reconfirmation with @kbd{yes} before killing Emacs, 135for confirmation with @kbd{yes} before killing Emacs, since any
140since any changes not saved will be lost forever. Also, if any 136changes not saved now will be lost forever. Also, if any subprocesses are
141subprocesses are still running, @kbd{C-x C-c} asks for confirmation 137still running, @kbd{C-x C-c} asks for confirmation about them, since
142about them, since killing Emacs will also kill the subprocesses. 138killing Emacs will also kill the subprocesses.
143 139
144@vindex confirm-kill-emacs 140@vindex confirm-kill-emacs
145 If the value of the variable @code{confirm-kill-emacs} is 141 If the value of the variable @code{confirm-kill-emacs} is
@@ -150,11 +146,10 @@ function to use as the value of @code{confirm-kill-emacs} is the
150function @code{yes-or-no-p}. The default value of 146function @code{yes-or-no-p}. The default value of
151@code{confirm-kill-emacs} is @code{nil}. 147@code{confirm-kill-emacs} is @code{nil}.
152 148
153 There is no way to resume an Emacs session once you have killed it. 149 You can't resume an Emacs session after killing it. Emacs can,
154You can, however, arrange for Emacs to record certain session 150however, record certain session information when you kill it, such as
155information when you kill it, such as which files are visited, so that 151which files you visited, so the next time you start Emacs it will try
156the next time you start Emacs it will try to visit the same files and 152to visit the same files. @xref{Saving Emacs Sessions}.
157so on. @xref{Saving Emacs Sessions}.
158 153
159 The operating system usually listens for certain special characters 154 The operating system usually listens for certain special characters
160whose meaning is to kill or suspend the program you are running. 155whose meaning is to kill or suspend the program you are running.
diff --git a/man/faq.texi b/man/faq.texi
index a2ec12f6408..3fa69aa4395 100644
--- a/man/faq.texi
+++ b/man/faq.texi
@@ -2229,7 +2229,7 @@ otherwise. @inforef{Frame Commands, Frame Commands, emacs}.
2229@cindex Regexps 2229@cindex Regexps
2230@cindex Regular expressions 2230@cindex Regular expressions
2231@cindex Differences between Unix and Emacs regexps 2231@cindex Differences between Unix and Emacs regexps
2232@cindex Unix regeps, differences from Emacs 2232@cindex Unix regexps, differences from Emacs
2233@cindex Text strings, putting regexps in 2233@cindex Text strings, putting regexps in
2234 2234
2235@inforef{Regexp Backslash, Regexp Backslash, emacs}. 2235@inforef{Regexp Backslash, Regexp Backslash, emacs}.
@@ -2261,15 +2261,35 @@ is actually typical for regexp syntax.)
2261@cindex Replacing strings across files 2261@cindex Replacing strings across files
2262@cindex Multiple files, replacing across 2262@cindex Multiple files, replacing across
2263@cindex Files, replacing strings across multiple 2263@cindex Files, replacing strings across multiple
2264@cindex Recursive search/replace operations
2264 2265
2265The ``tags'' feature of Emacs includes the command 2266As of Emacs 19.29, Dired mode (@kbd{M-x dired @key{RET}}, or @kbd{C-x
2266@code{tags-query-replace} which performs a query-replace across all the 2267d}) supports the command @code{dired-do-query-replace} (@kbd{Q}), which
2267files mentioned in the @file{TAGS} file. @inforef{Tags Search, Tags Search, 2268allows users to replace regular expressions in multiple files.
2268emacs}. 2269
2270You can use this command to perform search/replace operations on
2271multiple files by following the following steps:
2272
2273@itemize @bullet
2274@item
2275Assemble a list of files you want to operate on with either
2276@code{find-dired}, @code{find-name-dired} or @code{find-grep-dired}.
2277
2278@item
2279Mark all files in the resulting Dired buffer using @kbd{t}.
2280
2281@item
2282Use @kbd{Q} to start a @code{query-replace-regexp} session on the marked
2283files.
2284
2285@item
2286To accept all replacements in each file, hit @kbd{!}.
2287@end itemize
2269 2288
2270As of Emacs 19.29, Dired mode (@kbd{M-x dired @key{RET}}, or @kbd{C-x d}) 2289Another way to do the same thing is to use the ``tags'' feature of
2271supports the command @code{dired-do-query-replace} (@kbd{Q}), which allows 2290Emacs: it includes the command @code{tags-query-replace} which performs
2272users to replace regular expressions in multiple files. 2291a query-replace across all the files mentioned in the @file{TAGS} file.
2292@inforef{Tags Search, Tags Search, emacs}.
2273 2293
2274@node Documentation for etags, Disabling backups, Replacing text across multiple files, Common requests 2294@node Documentation for etags, Disabling backups, Replacing text across multiple files, Common requests
2275@section Where is the documentation for @code{etags}? 2295@section Where is the documentation for @code{etags}?
@@ -3474,7 +3494,7 @@ see @ref{Packages that do not come with Emacs}.
3474@uref{http://www.anc.ed.ac.uk/~stephen/emacs/ell.html, The Emacs Lisp 3494@uref{http://www.anc.ed.ac.uk/~stephen/emacs/ell.html, The Emacs Lisp
3475List (ELL)}, maintained by @email{stephen@@anc.ed.ac.uk, Stephen Eglen}, 3495List (ELL)}, maintained by @email{stephen@@anc.ed.ac.uk, Stephen Eglen},
3476aims to provide one compact list with links to all of the current Emacs 3496aims to provide one compact list with links to all of the current Emacs
3477Lisp files on the internet. The ELL can be browsed over the web, or 3497Lisp files on the Internet. The ELL can be browsed over the web, or
3478from Emacs with @uref{http://www.anc.ed.ac.uk/~stephen/emacs/ell.el, 3498from Emacs with @uref{http://www.anc.ed.ac.uk/~stephen/emacs/ell.el,
3479the @file{ell} package}. 3499the @file{ell} package}.
3480 3500
diff --git a/man/files.texi b/man/files.texi
index ab3fe7bb583..ad90a2758b2 100644
--- a/man/files.texi
+++ b/man/files.texi
@@ -25,11 +25,15 @@ on file directories.
25* Visiting:: Visiting a file prepares Emacs to edit the file. 25* Visiting:: Visiting a file prepares Emacs to edit the file.
26* Saving:: Saving makes your changes permanent. 26* Saving:: Saving makes your changes permanent.
27* Reverting:: Reverting cancels all the changes not saved. 27* Reverting:: Reverting cancels all the changes not saved.
28@ifnottex
29* Autorevert:: Auto Reverting non-file buffers.
30@end ifnottex
28* Auto Save:: Auto Save periodically protects against loss of data. 31* Auto Save:: Auto Save periodically protects against loss of data.
29* File Aliases:: Handling multiple names for one file. 32* File Aliases:: Handling multiple names for one file.
30* Version Control:: Version control systems (RCS, CVS and SCCS). 33* Version Control:: Version control systems (RCS, CVS and SCCS).
31* Directories:: Creating, deleting, and listing file directories. 34* Directories:: Creating, deleting, and listing file directories.
32* Comparing Files:: Finding where two files differ. 35* Comparing Files:: Finding where two files differ.
36* Diff Mode:: Mode for editing file differences.
33* Misc File Ops:: Other things you can do on files. 37* Misc File Ops:: Other things you can do on files.
34* Compressed Files:: Accessing compressed files. 38* Compressed Files:: Accessing compressed files.
35* File Archives:: Operating on tar, zip, jar etc. archive files. 39* File Archives:: Operating on tar, zip, jar etc. archive files.
@@ -106,10 +110,13 @@ first slash in the double slash; the result is @samp{/x1/rms/foo}.
106@cindex home directory shorthand 110@cindex home directory shorthand
107 You can use @file{~/} in a file name to mean your home directory, 111 You can use @file{~/} in a file name to mean your home directory,
108or @file{~@var{user-id}/} to mean the home directory of a user whose 112or @file{~@var{user-id}/} to mean the home directory of a user whose
109login name is @code{user-id}. (On DOS and Windows systems, where a user 113login name is @code{user-id}@footnote{
110doesn't have a home directory, Emacs substitutes @file{~/} with the 114On MS-Windows and MS-DOS systems, where a user doesn't have a home
111value of the environment variable @code{HOME}; see @ref{General 115directory, Emacs substitutes @file{~/} with the value of the
112Variables}.) 116environment variable @code{HOME}; see @ref{General Variables}. The
117@file{~@var{user-id}/} construct is supported on those systems only
118for the current user, i.e., only if @var{user-id} is the current
119user's login name.}.
113 120
114@cindex environment variables in file names 121@cindex environment variables in file names
115@cindex expansion of environment variables 122@cindex expansion of environment variables
@@ -517,8 +524,14 @@ value is @code{t}, so that Emacs does write backup files.
517Control}), the variable @code{vc-make-backup-files} determines whether 524Control}), the variable @code{vc-make-backup-files} determines whether
518to make backup files. By default it is @code{nil}, since backup files 525to make backup files. By default it is @code{nil}, since backup files
519are redundant when you store all the previous versions in a version 526are redundant when you store all the previous versions in a version
520control system. @xref{General VC Options,,,emacs-xtra, Specialized 527control system.
521Emacs Features}. 528@iftex
529@xref{General VC Options,,,emacs-xtra, Specialized Emacs Features}.
530@end iftex
531@ifnottex
532@xref{General VC Options}.
533@end ifnottex
534
522 535
523 At your option, Emacs can keep either a single backup for each file, 536 At your option, Emacs can keep either a single backup for each file,
524or make a series of numbered backup files for each file that you edit. 537or make a series of numbered backup files for each file that you edit.
@@ -972,6 +985,10 @@ modes do not check or revert remote files.
972 @xref{VC Mode Line}, for Auto Revert peculiarities in buffers that 985 @xref{VC Mode Line}, for Auto Revert peculiarities in buffers that
973visit files under version control. 986visit files under version control.
974 987
988@ifnottex
989@include arevert-xtra.texi
990@end ifnottex
991
975@node Auto Save 992@node Auto Save
976@section Auto-Saving: Protection Against Disasters 993@section Auto-Saving: Protection Against Disasters
977@cindex Auto Save mode 994@cindex Auto Save mode
@@ -1201,7 +1218,13 @@ RCS or CVS, you can switch to CSSC.
1201 1218
1202 VC is enabled by default in Emacs. To disable it, set the 1219 VC is enabled by default in Emacs. To disable it, set the
1203customizable variable @code{vc-handled-backends} to @code{nil} 1220customizable variable @code{vc-handled-backends} to @code{nil}
1221@iftex
1204(@pxref{Customizing VC,,,emacs-xtra, Specialized Emacs Features}). 1222(@pxref{Customizing VC,,,emacs-xtra, Specialized Emacs Features}).
1223@end iftex
1224@ifnottex
1225(@pxref{Customizing VC}).
1226@end ifnottex
1227
1205 1228
1206@menu 1229@menu
1207* Introduction to VC:: How version control works in general. 1230* Introduction to VC:: How version control works in general.
@@ -1210,6 +1233,12 @@ customizable variable @code{vc-handled-backends} to @code{nil}
1210* Old Versions:: Examining and comparing old versions. 1233* Old Versions:: Examining and comparing old versions.
1211* Secondary VC Commands:: The commands used a little less frequently. 1234* Secondary VC Commands:: The commands used a little less frequently.
1212* Branches:: Multiple lines of development. 1235* Branches:: Multiple lines of development.
1236@ifnottex
1237* Remote Repositories:: Efficient access to remote CVS servers.
1238* Snapshots:: Sets of file versions treated as a unit.
1239* Miscellaneous VC:: Various other commands and features of VC.
1240* Customizing VC:: Variables that change VC's behavior.
1241@end ifnottex
1213@end menu 1242@end menu
1214 1243
1215@node Introduction to VC 1244@node Introduction to VC
@@ -1347,7 +1376,13 @@ permitted; check-in is still the way to record a new version.
1347 CVS normally allows each user to modify his own copy of the work file 1376 CVS normally allows each user to modify his own copy of the work file
1348at any time, but requires merging with changes from other users at 1377at any time, but requires merging with changes from other users at
1349check-in time. However, CVS can also be set up to require locking. 1378check-in time. However, CVS can also be set up to require locking.
1379@iftex
1350(@pxref{CVS Options,,,emacs-xtra, Specialized Emacs Features}). 1380(@pxref{CVS Options,,,emacs-xtra, Specialized Emacs Features}).
1381@end iftex
1382@ifnottex
1383(@pxref{CVS Options}).
1384@end ifnottex
1385
1351 1386
1352@node Types of Log File 1387@node Types of Log File
1353@subsubsection Types of Log File 1388@subsubsection Types of Log File
@@ -1379,8 +1414,14 @@ for each change just once, then put it into both logs. You can write
1379the entry in @file{ChangeLog}, then copy it to the log buffer when you 1414the entry in @file{ChangeLog}, then copy it to the log buffer when you
1380check in the change. Or you can write the entry in the log buffer 1415check in the change. Or you can write the entry in the log buffer
1381while checking in the change, and later use the @kbd{C-x v a} command 1416while checking in the change, and later use the @kbd{C-x v a} command
1382to copy it to @file{ChangeLog} (@pxref{Change Logs and 1417to copy it to @file{ChangeLog}
1383VC,,,emacs-xtra, Specialized Emacs Features}). 1418@iftex
1419(@pxref{Change Logs and VC,,,emacs-xtra, Specialized Emacs Features}).
1420@end iftex
1421@ifnottex
1422(@pxref{Change Logs and VC}).
1423@end ifnottex
1424
1384 1425
1385@node VC Mode Line 1426@node VC Mode Line
1386@subsection Version Control and the Mode Line 1427@subsection Version Control and the Mode Line
@@ -1544,8 +1585,15 @@ the repository.
1544@cindex specific version control system 1585@cindex specific version control system
1545Instead of the version number, you can also specify the name of a 1586Instead of the version number, you can also specify the name of a
1546version control system. This is useful when one file is being managed 1587version control system. This is useful when one file is being managed
1547with two version control systems at the same time (@pxref{Local 1588with two version control systems at the same time
1548Version Control,,,emacs-xtra, Specialized Emacs Features}). 1589@iftex
1590(@pxref{Local Version Control,,,emacs-xtra, Specialized Emacs
1591Features}).
1592@end iftex
1593@ifnottex
1594(@pxref{Local Version Control}).
1595@end ifnottex
1596
1549@end itemize 1597@end itemize
1550 1598
1551@node Log Buffer 1599@node Log Buffer
@@ -1567,16 +1615,27 @@ control, you can generate the Log Edit text from the ChangeLog using
1567entries for the file(s) concerned in the top entry in the ChangeLog 1615entries for the file(s) concerned in the top entry in the ChangeLog
1568and uses those paragraphs as the log text. This text is only inserted 1616and uses those paragraphs as the log text. This text is only inserted
1569if the top entry was made under your user name on the current date. 1617if the top entry was made under your user name on the current date.
1618@iftex
1570@xref{Change Logs and VC,,,emacs-xtra, Specialized Emacs Features}, 1619@xref{Change Logs and VC,,,emacs-xtra, Specialized Emacs Features},
1620@end iftex
1621@ifnottex
1622@xref{Change Logs and VC},
1623@end ifnottex
1571for the opposite way of working---generating ChangeLog entries from 1624for the opposite way of working---generating ChangeLog entries from
1572the revision control log. 1625the revision control log.
1573 1626
1574 In the @samp{*VC-Log*} buffer, @kbd{C-c C-f} (@kbd{M-x 1627 In the @samp{*VC-Log*} buffer, @kbd{C-c C-f} (@kbd{M-x
1575log-edit-show-files}) shows the list of files to be committed in case 1628log-edit-show-files}) shows the list of files to be committed in case
1576you need to check that. (This can be a list of more than one file if 1629you need to check that. (This can be a list of more than one file if
1577you use VC Dired mode or PCL-CVS. @xref{VC Dired Mode,,,emacs-xtra, 1630you use VC Dired mode or PCL-CVS.
1578Specialized Emacs Features}, and @ref{Top, , About PCL-CVS, pcl-cvs, 1631@iftex
1579PCL-CVS --- The Emacs Front-End to CVS}.) 1632@xref{VC Dired Mode,,,emacs-xtra, Specialized Emacs Features},
1633@end iftex
1634@ifnottex
1635@xref{VC Dired Mode},
1636@end ifnottex
1637and @ref{Top, , About PCL-CVS, pcl-cvs, PCL-CVS --- The Emacs
1638Front-End to CVS}.)
1580 1639
1581 When you have finished editing the log message, type @kbd{C-c C-c} to 1640 When you have finished editing the log message, type @kbd{C-c C-c} to
1582exit the buffer and commit the change. 1641exit the buffer and commit the change.
@@ -1644,7 +1703,13 @@ Both forms display the output in a special buffer in another window.
1644 You can specify a checked-in version by its number; an empty input 1703 You can specify a checked-in version by its number; an empty input
1645specifies the current contents of the work file (which may be different 1704specifies the current contents of the work file (which may be different
1646from all the checked-in versions). You can also specify a snapshot name 1705from all the checked-in versions). You can also specify a snapshot name
1647(@pxref{Snapshots,,,emacs-xtra, Specialized Emacs Features}) instead of one or both version numbers. 1706@iftex
1707(@pxref{Snapshots,,,emacs-xtra, Specialized Emacs Features})
1708@end iftex
1709@ifnottex
1710(@pxref{Snapshots})
1711@end ifnottex
1712instead of one or both version numbers.
1648 1713
1649 If you supply a directory name instead of the name of a registered 1714 If you supply a directory name instead of the name of a registered
1650file, this command compares the two specified versions of all registered 1715file, this command compares the two specified versions of all registered
@@ -1733,6 +1798,10 @@ use once a day.
1733* Registering:: Putting a file under version control. 1798* Registering:: Putting a file under version control.
1734* VC Status:: Viewing the VC status of files. 1799* VC Status:: Viewing the VC status of files.
1735* VC Undo:: Canceling changes before or after check-in. 1800* VC Undo:: Canceling changes before or after check-in.
1801@ifnottex
1802* VC Dired Mode:: Listing files managed by version control.
1803* VC Dired Commands:: Commands to use in a VC Dired buffer.
1804@end ifnottex
1736@end menu 1805@end menu
1737 1806
1738@node Registering 1807@node Registering
@@ -1753,8 +1822,13 @@ to use for it. If the file's directory already contains files
1753registered in a version control system, Emacs uses that system. If 1822registered in a version control system, Emacs uses that system. If
1754there is more than one system in use for a directory, Emacs uses the 1823there is more than one system in use for a directory, Emacs uses the
1755one that appears first in @code{vc-handled-backends} 1824one that appears first in @code{vc-handled-backends}
1756(@pxref{Customizing VC,,,emacs-xtra, Specialized Emacs Features}). On 1825@iftex
1757the other hand, if there are no files already registered, Emacs uses 1826(@pxref{Customizing VC,,,emacs-xtra, Specialized Emacs Features}).
1827@end iftex
1828@ifnottex
1829(@pxref{Customizing VC}).
1830@end ifnottex
1831On the other hand, if there are no files already registered, Emacs uses
1758the first system from @code{vc-handled-backends} that could register 1832the first system from @code{vc-handled-backends} that could register
1759the file (for example, you cannot register a file under CVS if its 1833the file (for example, you cannot register a file under CVS if its
1760directory is not already part of a CVS tree); with the default value 1834directory is not already part of a CVS tree); with the default value
@@ -1814,16 +1888,27 @@ count.
1814 1888
1815@item P 1889@item P
1816Move to the log of the previous file, when the logs of multiple files 1890Move to the log of the previous file, when the logs of multiple files
1817are in the log buffer (@pxref{VC Dired Mode,,,emacs-xtra, Specialized 1891are in the log buffer
1818Emacs Features}). Otherwise, just move to the beginning of the log. A 1892@iftex
1819numeric prefix argument is a repeat count, so @kbd{C-u 10 P} would 1893(@pxref{VC Dired Mode,,,emacs-xtra, Specialized Emacs Features}).
1820move backward 10 files. 1894@end iftex
1895@ifnottex
1896(@pxref{VC Dired Mode}).
1897@end ifnottex
1898Otherwise, just move to the beginning of the log. A numeric prefix
1899argument is a repeat count, so @kbd{C-u 10 P} would move backward 10
1900files.
1821 1901
1822@item N 1902@item N
1823Move to the log of the next file, when the logs of multiple files are 1903Move to the log of the next file, when the logs of multiple files are
1824in the log buffer (@pxref{VC Dired Mode,,,emacs-xtra, Specialized 1904in the log buffer
1825Emacs Features}). It also takes a numeric prefix argument as a repeat 1905@iftex
1826count. 1906(@pxref{VC Dired Mode,,,emacs-xtra, Specialized Emacs Features}).
1907@end iftex
1908@ifnottex
1909(@pxref{VC Dired Mode}).
1910@end ifnottex
1911It also takes a numeric prefix argument as a repeat count.
1827 1912
1828@item f 1913@item f
1829Visit the revision indicated at the current line, like typing @kbd{C-x 1914Visit the revision indicated at the current line, like typing @kbd{C-x
@@ -1877,11 +1962,16 @@ change and then discover a trivial error in it; you can cancel the
1877erroneous check-in, fix the error, and check the file in again. 1962erroneous check-in, fix the error, and check the file in again.
1878 1963
1879 When @kbd{C-x v c} does not revert the buffer, it unexpands all 1964 When @kbd{C-x v c} does not revert the buffer, it unexpands all
1880version control headers in the buffer instead (@pxref{Version 1965version control headers in the buffer instead
1881Headers,,,emacs-xtra, Specialized Emacs Features}). This is because 1966@iftex
1882the buffer no longer corresponds to any existing version. If you 1967(@pxref{Version Headers,,,emacs-xtra, Specialized Emacs Features}).
1883check it in again, the check-in process will expand the headers 1968@end iftex
1884properly for the new version number. 1969@ifnottex
1970(@pxref{Version Headers}).
1971@end ifnottex
1972This is because the buffer no longer corresponds to any existing
1973version. If you check it in again, the check-in process will expand
1974the headers properly for the new version number.
1885 1975
1886 However, it is impossible to unexpand the RCS @samp{@w{$}Log$} header 1976 However, it is impossible to unexpand the RCS @samp{@w{$}Log$} header
1887automatically. If you use that header feature, you have to unexpand it 1977automatically. If you use that header feature, you have to unexpand it
@@ -1893,6 +1983,13 @@ confirmation with @kbd{yes}. Note also that this command is disabled
1893under CVS, because canceling versions is very dangerous and discouraged 1983under CVS, because canceling versions is very dangerous and discouraged
1894with CVS. 1984with CVS.
1895 1985
1986@ifnottex
1987@c vc1-xtra.texi needs extra level of lowering.
1988@lowersections
1989@include vc1-xtra.texi
1990@raisesections
1991@end ifnottex
1992
1896@node Branches 1993@node Branches
1897@subsection Multiple Branches of a File 1994@subsection Multiple Branches of a File
1898@cindex branch (version control) 1995@cindex branch (version control)
@@ -2071,10 +2168,15 @@ own choice of selected versions, but all share the same common RCS
2071records. 2168records.
2072 2169
2073 This technique works reliably and automatically, provided that the 2170 This technique works reliably and automatically, provided that the
2074source files contain RCS version headers (@pxref{Version 2171source files contain RCS version headers
2075Headers,,,emacs-xtra, Specialized Emacs Features}). The headers enable 2172@iftex
2076Emacs to be sure, at all times, which version number is present in the 2173(@pxref{Version Headers,,,emacs-xtra, Specialized Emacs Features}).
2077work file. 2174@end iftex
2175@ifnottex
2176(@pxref{Version Headers}).
2177@end ifnottex
2178The headers enable Emacs to be sure, at all times, which version
2179number is present in the work file.
2078 2180
2079 If the files do not have version headers, you must instead tell Emacs 2181 If the files do not have version headers, you must instead tell Emacs
2080explicitly in each session which branch you are working on. To do this, 2182explicitly in each session which branch you are working on. To do this,
@@ -2082,6 +2184,10 @@ first find the file, then type @kbd{C-u C-x v v} and specify the correct
2082branch number. This ensures that Emacs knows which branch it is using 2184branch number. This ensures that Emacs knows which branch it is using
2083during this particular editing session. 2185during this particular editing session.
2084 2186
2187@ifnottex
2188@include vc2-xtra.texi
2189@end ifnottex
2190
2085@node Directories 2191@node Directories
2086@section File Directories 2192@section File Directories
2087 2193
@@ -2159,6 +2265,8 @@ differences in an Emacs buffer named @samp{*diff*}. It works by
2159running the @code{diff} program, using options taken from the variable 2265running the @code{diff} program, using options taken from the variable
2160@code{diff-switches}. The value of @code{diff-switches} should be a 2266@code{diff-switches}. The value of @code{diff-switches} should be a
2161string; the default is @code{"-c"} to specify a context diff. 2267string; the default is @code{"-c"} to specify a context diff.
2268@xref{Top,, Diff, diff, Comparing and Merging Files}, for more
2269information about @command{diff} output formats.
2162 2270
2163@findex diff-backup 2271@findex diff-backup
2164 The command @kbd{M-x diff-backup} compares a specified file with its most 2272 The command @kbd{M-x diff-backup} compares a specified file with its most
@@ -2166,20 +2274,6 @@ recent backup. If you specify the name of a backup file,
2166@code{diff-backup} compares it with the source file that it is a backup 2274@code{diff-backup} compares it with the source file that it is a backup
2167of. 2275of.
2168 2276
2169@findex diff-goto-source
2170@findex diff-mode
2171@cindex Diff mode
2172 The @samp{*diff*} buffer uses Diff mode, which enables you to use
2173@kbd{C-x `} to visit successive changed locations in the two source
2174files, as in Compilation mode (@pxref{Compilation Mode}.) You can
2175also move to a particular hunk of changes and type @kbd{C-c C-c}
2176(@code{diff-goto-source}) to visit the corresponding source location.
2177
2178@cindex patches
2179 Differences between versions of files are often distributed as
2180patches, which are the output from the @command{diff} program. You
2181can use Diff mode to operate on a patch by typing @kbd{M-x diff-mode}.
2182
2183@findex compare-windows 2277@findex compare-windows
2184 The command @kbd{M-x compare-windows} compares the text in the 2278 The command @kbd{M-x compare-windows} compares the text in the
2185current window with that in the next window. (For more information 2279current window with that in the next window. (For more information
@@ -2216,8 +2310,94 @@ typically the result of a failed merge from a version control system
2216mode provides commands to resolve conflicts by selecting specific 2310mode provides commands to resolve conflicts by selecting specific
2217changes. 2311changes.
2218 2312
2219 @inforef{Emerge,, emacs-xtra} for the Emerge facility, which 2313@iftex
2220provides a powerful interface for merging files. 2314@xref{Emerge,,, emacs-xtra, Specialized Emacs Features},
2315@end iftex
2316@ifnottex
2317@xref{Emerge},
2318@end ifnottex
2319for the Emerge facility, which provides a powerful interface for
2320merging files.
2321
2322@node Diff Mode
2323@section Diff Mode
2324@cindex Diff mode
2325@findex diff-mode
2326@cindex patches, editing
2327
2328 Diff mode is used for the output of @kbd{M-x diff}; it is also
2329useful for editing patches and comparisons produced by the
2330@command{diff} program. To select Diff mode manually, type @kbd{M-x
2331diff-mode}.
2332
2333 One general feature of Diff mode is that manual edits to the patch
2334automatically correct line numbers, including those in the hunk
2335header, so that you can actually apply the edited patch. Diff mode
2336also provides the following commands to navigate, manipulate and apply
2337parts of patches:
2338
2339@table @kbd
2340@item M-n
2341Move to the next hunk-start (@code{diff-hunk-next}).
2342
2343@item M-p
2344Move to the previous hunk-start (@code{diff-hunk-prev}).
2345
2346@item M-@}
2347Move to the next file-start, in a multi-file patch
2348(@code{diff-file-next}).
2349
2350@item M-@{
2351Move to the previous file-start, in a multi-file patch
2352(@code{diff-file-prev}).
2353
2354@item M-k
2355Kill the hunk at point (@code{diff-hunk-kill}).
2356
2357@item M-K
2358In a multi-file patch, kill the current file part.
2359(@code{diff-file-kill}).
2360
2361@item C-c C-a
2362Apply this hunk to its target file (@code{diff-apply-hunk}). With a
2363prefix argument of @kbd{C-u}, revert this hunk.
2364
2365@item C-c C-c
2366Go to the source corresponding to this hunk (@code{diff-goto-source}).
2367
2368@item C-c C-e
2369Start an Ediff session with the patch (@code{diff-ediff-patch}).
2370@xref{Top, Ediff, Ediff, ediff, The Ediff Manual}.
2371
2372@item C-c C-n
2373Restrict the view to the current hunk (@code{diff-restrict-view}).
2374@xref{Narrowing}. With a prefix argument of @kbd{C-u}, restrict the
2375view to the current patch of a multiple file patch. To widen again,
2376use @kbd{C-x n w}.
2377
2378@item C-c C-r
2379Reverse the direction of comparison for the entire buffer
2380(@code{diff-reverse-direction}).
2381
2382@item C-c C-s
2383Split the hunk at point (@code{diff-split-hunk}). This is for
2384manually editing patches, and only works with the unified diff format.
2385
2386@item C-c C-u
2387Convert the entire buffer to unified format
2388(@code{diff-context->unified}). With a prefix argument, convert
2389unified format to context format. In Transient Mark mode, when the
2390mark is active, this command operates only on the region.
2391
2392@item C-c C-w
2393Refine the current hunk so that it disregards changes in whitespace
2394(@code{diff-refine-hunk}).
2395@end table
2396
2397 @kbd{C-x 4 a} in Diff mode operates on behalf of the target file,
2398but gets the function name from the patch itself. @xref{Change Log}.
2399This is useful for making log entries for functions that are deleted
2400by the patch.
2221 2401
2222@node Misc File Ops 2402@node Misc File Ops
2223@section Miscellaneous File Operations 2403@section Miscellaneous File Operations
@@ -2328,7 +2508,7 @@ compiling it.
2328@findex auto-compression-mode 2508@findex auto-compression-mode
2329@vindex auto-compression-mode 2509@vindex auto-compression-mode
2330 To disable this feature, type the command @kbd{M-x 2510 To disable this feature, type the command @kbd{M-x
2331auto-compression-mode}. You can disenable it permanently by 2511auto-compression-mode}. You can disable it permanently by
2332customizing the variable @code{auto-compression-mode}. 2512customizing the variable @code{auto-compression-mode}.
2333 2513
2334@node File Archives 2514@node File Archives
diff --git a/man/fortran-xtra.texi b/man/fortran-xtra.texi
new file mode 100644
index 00000000000..f157013f1d6
--- /dev/null
+++ b/man/fortran-xtra.texi
@@ -0,0 +1,548 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions.
4@c
5@c This file is included either in emacs-xtra.texi (when producing the
6@c printed version) or in the main Emacs manual (for the on-line version).
7@node Fortran
8@section Fortran Mode
9@cindex Fortran mode
10@cindex mode, Fortran
11
12 Fortran mode provides special motion commands for Fortran statements
13and subprograms, and indentation commands that understand Fortran
14conventions of nesting, line numbers and continuation statements.
15Fortran mode has support for Auto Fill mode that breaks long lines into
16proper Fortran continuation lines.
17
18 Special commands for comments are provided because Fortran comments
19are unlike those of other languages. Built-in abbrevs optionally save
20typing when you insert Fortran keywords.
21
22 Use @kbd{M-x fortran-mode} to switch to this major mode. This
23command runs the hook @code{fortran-mode-hook}.
24@iftex
25@xref{Hooks,,, emacs, the Emacs Manual}.
26@end iftex
27@ifnottex
28@xref{Hooks}.
29@end ifnottex
30
31@cindex Fortran77 and Fortran90
32@findex f90-mode
33@findex fortran-mode
34 Fortran mode is meant for editing Fortran77 ``fixed format'' (and also
35``tab format'') source code. For editing the modern Fortran90 or
36Fortran95 ``free format'' source code, use F90 mode (@code{f90-mode}).
37Emacs normally uses Fortran mode for files with extension @samp{.f},
38@samp{.F} or @samp{.for}, and F90 mode for the extension @samp{.f90} and
39@samp{.f95}. GNU Fortran supports both kinds of format.
40
41@menu
42* Motion: Fortran Motion. Moving point by statements or subprograms.
43* Indent: Fortran Indent. Indentation commands for Fortran.
44* Comments: Fortran Comments. Inserting and aligning comments.
45* Autofill: Fortran Autofill. Auto fill support for Fortran.
46* Columns: Fortran Columns. Measuring columns for valid Fortran.
47* Abbrev: Fortran Abbrev. Built-in abbrevs for Fortran keywords.
48@end menu
49
50@node Fortran Motion
51@subsection Motion Commands
52
53 In addition to the normal commands for moving by and operating on
54``defuns'' (Fortran subprograms---functions and subroutines, as well as
55modules for F90 mode), Fortran mode provides special commands to move by
56statements and other program units.
57
58@table @kbd
59@kindex C-c C-n @r{(Fortran mode)}
60@findex fortran-next-statement
61@findex f90-next-statement
62@item C-c C-n
63Move to the beginning of the next statement
64(@code{fortran-next-statement}/@code{f90-next-statement}).
65
66@kindex C-c C-p @r{(Fortran mode)}
67@findex fortran-previous-statement
68@findex f90-previous-statement
69@item C-c C-p
70Move to the beginning of the previous statement
71(@code{fortran-previous-statement}/@code{f90-previous-statement}).
72If there is no previous statement (i.e. if called from the first
73statement in the buffer), move to the start of the buffer.
74
75@kindex C-c C-e @r{(F90 mode)}
76@findex f90-next-block
77@item C-c C-e
78Move point forward to the start of the next code block
79(@code{f90-next-block}). A code block is a subroutine,
80@code{if}--@code{endif} statement, and so forth. This command exists
81for F90 mode only, not Fortran mode. With a numeric argument, this
82moves forward that many blocks.
83
84@kindex C-c C-a @r{(F90 mode)}
85@findex f90-previous-block
86@item C-c C-a
87Move point backward to the previous code block
88(@code{f90-previous-block}). This is like @code{f90-next-block}, but
89moves backwards.
90
91@kindex C-M-n @r{(Fortran mode)}
92@findex fortran-end-of-block
93@findex f90-end-of-block
94@item C-M-n
95Move to the end of the current code block
96(@code{fortran-end-of-block}/@code{f90-end-of-block}). With a numeric
97argument, move forward that number of blocks. The mark is set before
98moving point. The F90 mode version of this command checks for
99consistency of block types and labels (if present), but it does not
100check the outermost block since that may be incomplete.
101
102@kindex C-M-p @r{(Fortran mode)}
103@findex fortran-beginning-of-block
104@findex f90-beginning-of-block
105@item C-M-p
106Move to the start of the current code block
107(@code{fortran-beginning-of-block}/@code{f90-beginning-of-block}). This
108is like @code{fortran-end-of-block}, but moves backwards.
109@end table
110
111@node Fortran Indent
112@subsection Fortran Indentation
113
114 Special commands and features are needed for indenting Fortran code in
115order to make sure various syntactic entities (line numbers, comment line
116indicators and continuation line flags) appear in the columns that are
117required for standard, fixed (or tab) format Fortran.
118
119@menu
120* Commands: ForIndent Commands. Commands for indenting and filling Fortran.
121* Contline: ForIndent Cont. How continuation lines indent.
122* Numbers: ForIndent Num. How line numbers auto-indent.
123* Conv: ForIndent Conv. Conventions you must obey to avoid trouble.
124* Vars: ForIndent Vars. Variables controlling Fortran indent style.
125@end menu
126
127@node ForIndent Commands
128@subsubsection Fortran Indentation and Filling Commands
129
130@table @kbd
131@item C-M-j
132Break the current line at point and set up a continuation line
133(@code{fortran-split-line}).
134@item M-^
135Join this line to the previous line (@code{fortran-join-line}).
136@item C-M-q
137Indent all the lines of the subprogram point is in
138(@code{fortran-indent-subprogram}).
139@item M-q
140Fill a comment block or statement.
141@end table
142
143@kindex C-M-q @r{(Fortran mode)}
144@findex fortran-indent-subprogram
145 The key @kbd{C-M-q} runs @code{fortran-indent-subprogram}, a command
146to reindent all the lines of the Fortran subprogram (function or
147subroutine) containing point.
148
149@kindex C-M-j @r{(Fortran mode)}
150@findex fortran-split-line
151 The key @kbd{C-M-j} runs @code{fortran-split-line}, which splits
152a line in the appropriate fashion for Fortran. In a non-comment line,
153the second half becomes a continuation line and is indented
154accordingly. In a comment line, both halves become separate comment
155lines.
156
157@kindex M-^ @r{(Fortran mode)}
158@kindex C-c C-d @r{(Fortran mode)}
159@findex fortran-join-line
160 @kbd{M-^} or @kbd{C-c C-d} runs the command @code{fortran-join-line},
161which joins a continuation line back to the previous line, roughly as
162the inverse of @code{fortran-split-line}. The point must be on a
163continuation line when this command is invoked.
164
165@kindex M-q @r{(Fortran mode)}
166@kbd{M-q} in Fortran mode fills the comment block or statement that
167point is in. This removes any excess statement continuations.
168
169@node ForIndent Cont
170@subsubsection Continuation Lines
171@cindex Fortran continuation lines
172
173@vindex fortran-continuation-string
174 Most Fortran77 compilers allow two ways of writing continuation lines.
175If the first non-space character on a line is in column 5, then that
176line is a continuation of the previous line. We call this @dfn{fixed
177format}. (In GNU Emacs we always count columns from 0; but note that
178the Fortran standard counts from 1.) The variable
179@code{fortran-continuation-string} specifies what character to put in
180column 5. A line that starts with a tab character followed by any digit
181except @samp{0} is also a continuation line. We call this style of
182continuation @dfn{tab format}. (Fortran90 introduced ``free format'',
183with another style of continuation lines).
184
185@vindex indent-tabs-mode @r{(Fortran mode)}
186@vindex fortran-analyze-depth
187@vindex fortran-tab-mode-default
188 Fortran mode can use either style of continuation line. When you
189enter Fortran mode, it tries to deduce the proper continuation style
190automatically from the buffer contents. It does this by scanning up to
191@code{fortran-analyze-depth} (default 100) lines from the start of the
192buffer. The first line that begins with either a tab character or six
193spaces determines the choice. If the scan fails (for example, if the
194buffer is new and therefore empty), the value of
195@code{fortran-tab-mode-default} (@code{nil} for fixed format, and
196non-@code{nil} for tab format) is used. @samp{/t} in the mode line
197indicates tab format is selected. Fortran mode sets the value of
198@code{indent-tabs-mode} accordingly.
199
200 If the text on a line starts with the Fortran continuation marker
201@samp{$}, or if it begins with any non-whitespace character in column
2025, Fortran mode treats it as a continuation line. When you indent a
203continuation line with @key{TAB}, it converts the line to the current
204continuation style. When you split a Fortran statement with
205@kbd{C-M-j}, the continuation marker on the newline is created according
206to the continuation style.
207
208 The setting of continuation style affects several other aspects of
209editing in Fortran mode. In fixed format mode, the minimum column
210number for the body of a statement is 6. Lines inside of Fortran
211blocks that are indented to larger column numbers always use only the
212space character for whitespace. In tab format mode, the minimum
213column number for the statement body is 8, and the whitespace before
214column 8 must always consist of one tab character.
215
216@node ForIndent Num
217@subsubsection Line Numbers
218
219 If a number is the first non-whitespace in the line, Fortran
220indentation assumes it is a line number and moves it to columns 0
221through 4. (Columns always count from 0 in GNU Emacs.)
222
223@vindex fortran-line-number-indent
224 Line numbers of four digits or less are normally indented one space.
225The variable @code{fortran-line-number-indent} controls this; it
226specifies the maximum indentation a line number can have. The default
227value of the variable is 1. Fortran mode tries to prevent line number
228digits passing column 4, reducing the indentation below the specified
229maximum if necessary. If @code{fortran-line-number-indent} has the
230value 5, line numbers are right-justified to end in column 4.
231
232@vindex fortran-electric-line-number
233 Simply inserting a line number is enough to indent it according to
234these rules. As each digit is inserted, the indentation is recomputed.
235To turn off this feature, set the variable
236@code{fortran-electric-line-number} to @code{nil}.
237
238
239@node ForIndent Conv
240@subsubsection Syntactic Conventions
241
242 Fortran mode assumes that you follow certain conventions that simplify
243the task of understanding a Fortran program well enough to indent it
244properly:
245
246@itemize @bullet
247@item
248Two nested @samp{do} loops never share a @samp{continue} statement.
249
250@item
251Fortran keywords such as @samp{if}, @samp{else}, @samp{then}, @samp{do}
252and others are written without embedded whitespace or line breaks.
253
254Fortran compilers generally ignore whitespace outside of string
255constants, but Fortran mode does not recognize these keywords if they
256are not contiguous. Constructs such as @samp{else if} or @samp{end do}
257are acceptable, but the second word should be on the same line as the
258first and not on a continuation line.
259@end itemize
260
261@noindent
262If you fail to follow these conventions, the indentation commands may
263indent some lines unaesthetically. However, a correct Fortran program
264retains its meaning when reindented even if the conventions are not
265followed.
266
267@node ForIndent Vars
268@subsubsection Variables for Fortran Indentation
269
270@vindex fortran-do-indent
271@vindex fortran-if-indent
272@vindex fortran-structure-indent
273@vindex fortran-continuation-indent
274@vindex fortran-check-all-num@dots{}
275@vindex fortran-minimum-statement-indent@dots{}
276 Several additional variables control how Fortran indentation works:
277
278@table @code
279@item fortran-do-indent
280Extra indentation within each level of @samp{do} statement (default 3).
281
282@item fortran-if-indent
283Extra indentation within each level of @samp{if}, @samp{select case}, or
284@samp{where} statements (default 3).
285
286@item fortran-structure-indent
287Extra indentation within each level of @samp{structure}, @samp{union},
288@samp{map}, or @samp{interface} statements (default 3).
289
290@item fortran-continuation-indent
291Extra indentation for bodies of continuation lines (default 5).
292
293@item fortran-check-all-num-for-matching-do
294In Fortran77, a numbered @samp{do} statement is ended by any statement
295with a matching line number. It is common (but not compulsory) to use a
296@samp{continue} statement for this purpose. If this variable has a
297non-@code{nil} value, indenting any numbered statement must check for a
298@samp{do} that ends there. If you always end @samp{do} statements with
299a @samp{continue} line (or if you use the more modern @samp{enddo}),
300then you can speed up indentation by setting this variable to
301@code{nil}. The default is @code{nil}.
302
303@item fortran-blink-matching-if
304If this is @code{t}, indenting an @samp{endif} (or @samp{enddo}
305statement moves the cursor momentarily to the matching @samp{if} (or
306@samp{do}) statement to show where it is. The default is @code{nil}.
307
308@item fortran-minimum-statement-indent-fixed
309Minimum indentation for Fortran statements when using fixed format
310continuation line style. Statement bodies are never indented less than
311this much. The default is 6.
312
313@item fortran-minimum-statement-indent-tab
314Minimum indentation for Fortran statements for tab format continuation line
315style. Statement bodies are never indented less than this much. The
316default is 8.
317@end table
318
319The variables controlling the indentation of comments are described in
320the following section.
321
322@node Fortran Comments
323@subsection Fortran Comments
324
325 The usual Emacs comment commands assume that a comment can follow a
326line of code. In Fortran77, the standard comment syntax requires an
327entire line to be just a comment. Therefore, Fortran mode replaces the
328standard Emacs comment commands and defines some new variables.
329
330@vindex fortran-comment-line-start
331 Fortran mode can also handle the Fortran90 comment syntax where comments
332start with @samp{!} and can follow other text. Because only some Fortran77
333compilers accept this syntax, Fortran mode will not insert such comments
334unless you have said in advance to do so. To do this, set the variable
335@code{fortran-comment-line-start} to @samp{"!"}.
336
337@table @kbd
338@item M-;
339Align comment or insert new comment (@code{fortran-indent-comment}).
340
341@item C-x ;
342Applies to nonstandard @samp{!} comments only.
343
344@item C-c ;
345Turn all lines of the region into comments, or (with argument) turn them back
346into real code (@code{fortran-comment-region}).
347@end table
348
349@findex fortran-indent-comment
350 @kbd{M-;} in Fortran mode is redefined as the command
351@code{fortran-indent-comment}. Like the usual @kbd{M-;} command, this
352recognizes any kind of existing comment and aligns its text appropriately;
353if there is no existing comment, a comment is inserted and aligned. But
354inserting and aligning comments are not the same in Fortran mode as in
355other modes.
356
357 When a new comment must be inserted, if the current line is blank, a
358full-line comment is inserted. On a non-blank line, a nonstandard @samp{!}
359comment is inserted if you have said you want to use them. Otherwise a
360full-line comment is inserted on a new line before the current line.
361
362 Nonstandard @samp{!} comments are aligned like comments in other
363languages, but full-line comments are different. In a standard full-line
364comment, the comment delimiter itself must always appear in column zero.
365What can be aligned is the text within the comment. You can choose from
366three styles of alignment by setting the variable
367@code{fortran-comment-indent-style} to one of these values:
368
369@vindex fortran-comment-indent-style
370@vindex fortran-comment-line-extra-indent
371@table @code
372@item fixed
373Align the text at a fixed column, which is the sum of
374@code{fortran-comment-line-extra-indent} and the minimum statement
375indentation. This is the default.
376
377The minimum statement indentation is
378@code{fortran-minimum-statement-indent-fixed} for fixed format
379continuation line style and @code{fortran-minimum-statement-indent-tab}
380for tab format style.
381
382@item relative
383Align the text as if it were a line of code, but with an additional
384@code{fortran-comment-line-extra-indent} columns of indentation.
385
386@item nil
387Don't move text in full-line comments automatically.
388@end table
389
390@vindex fortran-comment-indent-char
391 In addition, you can specify the character to be used to indent within
392full-line comments by setting the variable
393@code{fortran-comment-indent-char} to the single-character string you want
394to use.
395
396@vindex fortran-directive-re
397 Compiler directive lines, or preprocessor lines, have much the same
398appearance as comment lines. It is important, though, that such lines
399never be indented at all, no matter what the value of
400@code{fortran-comment-indent-style}. The variable
401@code{fortran-directive-re} is a regular expression that specifies which
402lines are directives. Matching lines are never indented, and receive
403distinctive font-locking.
404
405 The normal Emacs comment command @kbd{C-x ;} has not been redefined. If
406you use @samp{!} comments, this command can be used with them. Otherwise
407it is useless in Fortran mode.
408
409@kindex C-c ; @r{(Fortran mode)}
410@findex fortran-comment-region
411@vindex fortran-comment-region
412 The command @kbd{C-c ;} (@code{fortran-comment-region}) turns all the
413lines of the region into comments by inserting the string @samp{C$$$} at
414the front of each one. With a numeric argument, it turns the region
415back into live code by deleting @samp{C$$$} from the front of each line
416in it. The string used for these comments can be controlled by setting
417the variable @code{fortran-comment-region}. Note that here we have an
418example of a command and a variable with the same name; these two uses
419of the name never conflict because in Lisp and in Emacs it is always
420clear from the context which one is meant.
421
422@node Fortran Autofill
423@subsection Auto Fill in Fortran Mode
424
425 Fortran mode has specialized support for Auto Fill mode, which is a
426minor mode that automatically splits statements as you insert them
427when they become too wide. Splitting a statement involves making
428continuation lines using @code{fortran-continuation-string}
429(@pxref{ForIndent Cont}). This splitting happens when you type
430@key{SPC}, @key{RET}, or @key{TAB}, and also in the Fortran
431indentation commands. You activate Auto Fill in Fortran mode in the
432normal way.
433@iftex
434@xref{Auto Fill,,, emacs, the Emacs Manual}.
435@end iftex
436@ifnottex
437@xref{Auto Fill}.
438@end ifnottex
439
440@vindex fortran-break-before-delimiters
441 Auto Fill breaks lines at spaces or delimiters when the lines get
442longer than the desired width (the value of @code{fill-column}). The
443delimiters (besides whitespace) that Auto Fill can break at are
444@samp{+}, @samp{-}, @samp{/}, @samp{*}, @samp{=}, @samp{<}, @samp{>},
445and @samp{,}. The line break comes after the delimiter if the
446variable @code{fortran-break-before-delimiters} is @code{nil}.
447Otherwise (and by default), the break comes before the delimiter.
448
449 To enable Auto Fill in all Fortran buffers, add
450@code{turn-on-auto-fill} to @code{fortran-mode-hook}.
451@iftex
452@xref{Hooks,,, emacs, the Emacs Manual}.
453@end iftex
454@ifnottex
455@xref{Hooks}.
456@end ifnottex
457
458@node Fortran Columns
459@subsection Checking Columns in Fortran
460
461@table @kbd
462@item C-c C-r
463Display a ``column ruler'' momentarily above the current line
464(@code{fortran-column-ruler}).
465@item C-c C-w
466Split the current window horizontally temporarily so that it is 72
467columns wide (@code{fortran-window-create-momentarily}). This may
468help you avoid making lines longer than the 72-character limit that
469some Fortran compilers impose.
470@item C-u C-c C-w
471Split the current window horizontally so that it is 72 columns wide
472(@code{fortran-window-create}). You can then continue editing.
473@item M-x fortran-strip-sequence-nos
474Delete all text in column 72 and beyond.
475@end table
476
477@kindex C-c C-r @r{(Fortran mode)}
478@findex fortran-column-ruler
479 The command @kbd{C-c C-r} (@code{fortran-column-ruler}) shows a column
480ruler momentarily above the current line. The comment ruler is two lines
481of text that show you the locations of columns with special significance in
482Fortran programs. Square brackets show the limits of the columns for line
483numbers, and curly brackets show the limits of the columns for the
484statement body. Column numbers appear above them.
485
486 Note that the column numbers count from zero, as always in GNU Emacs.
487As a result, the numbers may be one less than those you are familiar
488with; but the positions they indicate in the line are standard for
489Fortran.
490
491@vindex fortran-column-ruler-fixed
492@vindex fortran-column-ruler-tabs
493 The text used to display the column ruler depends on the value of the
494variable @code{indent-tabs-mode}. If @code{indent-tabs-mode} is
495@code{nil}, then the value of the variable
496@code{fortran-column-ruler-fixed} is used as the column ruler.
497Otherwise, the value of the variable @code{fortran-column-ruler-tab} is
498displayed. By changing these variables, you can change the column ruler
499display.
500
501@kindex C-c C-w @r{(Fortran mode)}
502@findex fortran-window-create-momentarily
503 @kbd{C-c C-w} (@code{fortran-window-create-momentarily}) temporarily
504splits the current window horizontally, making a window 72 columns
505wide, so you can see any lines that are too long. Type a space to
506restore the normal width.
507
508@kindex C-u C-c C-w @r{(Fortran mode)}
509@findex fortran-window-create
510 You can also split the window horizontally and continue editing with
511the split in place. To do this, use @kbd{C-u C-c C-w} (@code{M-x
512fortran-window-create}). By editing in this window you can
513immediately see when you make a line too wide to be correct Fortran.
514
515@findex fortran-strip-sequence-nos
516 The command @kbd{M-x fortran-strip-sequence-nos} deletes all text in
517column 72 and beyond, on all lines in the current buffer. This is the
518easiest way to get rid of old sequence numbers.
519
520@node Fortran Abbrev
521@subsection Fortran Keyword Abbrevs
522
523 Fortran mode provides many built-in abbrevs for common keywords and
524declarations. These are the same sort of abbrev that you can define
525yourself. To use them, you must turn on Abbrev mode.
526@iftex
527@xref{Abbrevs,,, emacs, the Emacs Manual}.
528@end iftex
529@ifnottex
530@xref{Abbrevs}.
531@end ifnottex
532
533 The built-in abbrevs are unusual in one way: they all start with a
534semicolon. You cannot normally use semicolon in an abbrev, but Fortran
535mode makes this possible by changing the syntax of semicolon to ``word
536constituent.''
537
538 For example, one built-in Fortran abbrev is @samp{;c} for
539@samp{continue}. If you insert @samp{;c} and then insert a punctuation
540character such as a space or a newline, the @samp{;c} expands automatically
541to @samp{continue}, provided Abbrev mode is enabled.@refill
542
543 Type @samp{;?} or @samp{;C-h} to display a list of all the built-in
544Fortran abbrevs and what they stand for.
545
546@ignore
547 arch-tag: 23ed7c36-1517-4646-9235-2d5ade5f06f6
548@end ignore
diff --git a/man/frames.texi b/man/frames.texi
index c11d6f74685..227aab7559d 100644
--- a/man/frames.texi
+++ b/man/frames.texi
@@ -27,7 +27,13 @@ it terminates all the frames. To delete just one frame, use @kbd{C-x 5
27 27
28 Emacs compiled for MS-DOS emulates some windowing functionality, 28 Emacs compiled for MS-DOS emulates some windowing functionality,
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@iftex
30@xref{MS-DOS Mouse,,,emacs-xtra,Specialized Emacs Features}. 31@xref{MS-DOS Mouse,,,emacs-xtra,Specialized Emacs Features}.
32@end iftex
33@ifnottex
34@xref{MS-DOS Mouse}.
35@end ifnottex
36
31 37
32@menu 38@menu
33* Mouse Commands:: Moving, cutting, and pasting, with the mouse. 39* Mouse Commands:: Moving, cutting, and pasting, with the mouse.
@@ -512,7 +518,7 @@ Here's a similar example for specifying a foreground color:
512Iconify the selected Emacs frame (@code{iconify-or-deiconify-frame}). 518Iconify the selected Emacs frame (@code{iconify-or-deiconify-frame}).
513The normal meaning of @kbd{C-z}, to suspend Emacs, is not useful under 519The normal meaning of @kbd{C-z}, to suspend Emacs, is not useful under
514a graphical display that allows multiple applications to operate 520a graphical display that allows multiple applications to operate
515simultaneously in their own windies, so Emacs gives @kbd{C-z} a 521simultaneously in their own windows, so Emacs gives @kbd{C-z} a
516different binding in that case. 522different binding in that case.
517 523
518If you type this command on an Emacs frame's icon, it deiconifies the frame. 524If you type this command on an Emacs frame's icon, it deiconifies the frame.
diff --git a/man/gnu.texi b/man/gnu.texi
index 6b050d7839a..27fe2e24953 100644
--- a/man/gnu.texi
+++ b/man/gnu.texi
@@ -2,7 +2,7 @@
2@c Copyright (C) 1985, 1986, 1987, 1993, 1995, 2002, 2003, 2004, 2@c Copyright (C) 1985, 1986, 1987, 1993, 1995, 2002, 2003, 2004,
3@c 2005, 2006 Free Software Foundation, Inc. 3@c 2005, 2006 Free Software Foundation, Inc.
4@ifclear justgnu 4@ifclear justgnu
5@node Manifesto,, Emacs and Microsoft Windows, Top 5@node Manifesto,, Microsoft Windows, Top
6@unnumbered The GNU Manifesto 6@unnumbered The GNU Manifesto
7@end ifclear 7@end ifclear
8@ifset justgnu 8@ifset justgnu
diff --git a/man/help.texi b/man/help.texi
index 35470551862..4d69e18cc39 100644
--- a/man/help.texi
+++ b/man/help.texi
@@ -401,7 +401,7 @@ The @kbd{C-h p} command lets you search the standard Emacs Lisp
401libraries by topic keywords. Here is a partial list of keywords you can 401libraries by topic keywords. Here is a partial list of keywords you can
402use: 402use:
403 403
404@multitable {emulations} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} 404@multitable {convenience} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
405@item abbrev@tab abbreviation handling, typing shortcuts, macros. 405@item abbrev@tab abbreviation handling, typing shortcuts, macros.
406@item bib@tab code related to the @code{bib} bibliography processor. 406@item bib@tab code related to the @code{bib} bibliography processor.
407@item c@tab support for the C language and related languages. 407@item c@tab support for the C language and related languages.
diff --git a/man/killing.texi b/man/killing.texi
index c69f6ca2805..ad79e5595ca 100644
--- a/man/killing.texi
+++ b/man/killing.texi
@@ -62,7 +62,7 @@ message in the echo area to explain why the text has not been erased.
62* Killing by Lines:: How to kill entire lines of text at one time. 62* Killing by Lines:: How to kill entire lines of text at one time.
63* Other Kill Commands:: Commands to kill large regions of text and 63* Other Kill Commands:: Commands to kill large regions of text and
64 syntactic units such as words and sentences. 64 syntactic units such as words and sentences.
65* Graphical Kill:: The kill ring on graphical terminals: 65* Graphical Kill:: The kill ring on graphical displays:
66 yanking between applications. 66 yanking between applications.
67@end menu 67@end menu
68 68
diff --git a/man/macos.texi b/man/macos.texi
index 272609b8392..a6c1020fbc5 100644
--- a/man/macos.texi
+++ b/man/macos.texi
@@ -2,7 +2,7 @@
2@c Copyright (C) 2000, 2001, 2002, 2003, 2004, 2@c Copyright (C) 2000, 2001, 2002, 2003, 2004,
3@c 2005, 2006 Free Software Foundation, Inc. 3@c 2005, 2006 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions. 4@c See file emacs.texi for copying conditions.
5@node Mac OS, Emacs and Microsoft Windows, Antinews, Top 5@node Mac OS, Microsoft Windows, Antinews, Top
6@appendix Emacs and Mac OS 6@appendix Emacs and Mac OS
7@cindex Mac OS 7@cindex Mac OS
8@cindex Macintosh 8@cindex Macintosh
@@ -67,7 +67,8 @@ Classic) or the International system preference pane (Mac OS X) and
67supports international and alternative keyboard layouts (e.g., Dvorak) 67supports international and alternative keyboard layouts (e.g., Dvorak)
68if its script is either Roman, Japanese, Traditional Chinese, Korean, 68if its script is either Roman, Japanese, Traditional Chinese, Korean,
69Cyrillic, Simplified Chinese, or Central European. Keyboard layouts 69Cyrillic, Simplified Chinese, or Central European. Keyboard layouts
70based on Unicode may not work properly. Selecting one of the layouts 70based on Unicode may not work properly. (Try drag-and-drop if input
71from the Character Palette does not work.) Selecting one of the layouts
71from the keyboard layout pull-down menu will affect how the keys typed 72from the keyboard layout pull-down menu will affect how the keys typed
72on the keyboard are interpreted. 73on the keyboard are interpreted.
73 74
@@ -318,7 +319,7 @@ charset @code{iso10646-1}. For example 12-point Monaco can be specified
318by the name 319by the name
319@samp{-apple-monaco-medium-r-normal--12-*-*-*-*-*-iso10646-1}. Note 320@samp{-apple-monaco-medium-r-normal--12-*-*-*-*-*-iso10646-1}. Note
320that it must be specified in a format containing 14 @samp{-}s (i.e., not 321that it must be specified in a format containing 14 @samp{-}s (i.e., not
321by @samp{-apple-monaco-medium-r-normal-12-*-iso10646-1}) because every 322by @samp{-apple-monaco-medium-r-normal--12-*-iso10646-1}) because every
322@acronym{ATSUI}-compatible font is a scalable one. 323@acronym{ATSUI}-compatible font is a scalable one.
323 324
324 QuickDraw Text fonts have maker name @code{apple} and various charset 325 QuickDraw Text fonts have maker name @code{apple} and various charset
diff --git a/man/maintaining.texi b/man/maintaining.texi
index f0b5f1c31af..1307ce6a229 100644
--- a/man/maintaining.texi
+++ b/man/maintaining.texi
@@ -14,6 +14,9 @@ also particularly useful for this purpose.
14* Format of ChangeLog:: What the change log file looks like. 14* Format of ChangeLog:: What the change log file looks like.
15* Tags:: Go direct to any function in your program in one 15* Tags:: Go direct to any function in your program in one
16 command. Tags remembers which file it is in. 16 command. Tags remembers which file it is in.
17@ifnottex
18* Emerge:: A convenient way of merging two versions of a program.
19@end ifnottex
17@end menu 20@end menu
18 21
19@node Change Log 22@node Change Log
@@ -845,6 +848,10 @@ details.
845 You can also use the collection of tag names to complete a symbol 848 You can also use the collection of tag names to complete a symbol
846name in the buffer. @xref{Symbol Completion}. 849name in the buffer. @xref{Symbol Completion}.
847 850
851@ifnottex
852@include emerge-xtra.texi
853@end ifnottex
854
848@ignore 855@ignore
849 arch-tag: b9d83dfb-82ea-4ff6-bab5-05a3617091fb 856 arch-tag: b9d83dfb-82ea-4ff6-bab5-05a3617091fb
850@end ignore 857@end ignore
diff --git a/man/makefile.w32-in b/man/makefile.w32-in
index 93f79f49689..613151f7ff5 100644
--- a/man/makefile.w32-in
+++ b/man/makefile.w32-in
@@ -30,7 +30,7 @@ infodir = $(srcdir)/../info
30# The makeinfo program is part of the Texinfo distribution. 30# The makeinfo program is part of the Texinfo distribution.
31MAKEINFO = makeinfo --force 31MAKEINFO = makeinfo --force
32MULTI_INSTALL_INFO = $(srcdir)\..\nt\multi-install-info.bat 32MULTI_INSTALL_INFO = $(srcdir)\..\nt\multi-install-info.bat
33INFO_TARGETS = $(infodir)/emacs $(infodir)/emacs-xtra $(infodir)/ccmode \ 33INFO_TARGETS = $(infodir)/emacs $(infodir)/ccmode \
34 $(infodir)/cl $(infodir)/dired-x $(infodir)/ediff \ 34 $(infodir)/cl $(infodir)/dired-x $(infodir)/ediff \
35 $(infodir)/forms $(infodir)/gnus $(infodir)/message \ 35 $(infodir)/forms $(infodir)/gnus $(infodir)/message \
36 $(infodir)/sieve $(infodir)/pgg $(infodir)/emacs-mime \ 36 $(infodir)/sieve $(infodir)/pgg $(infodir)/emacs-mime \
@@ -62,6 +62,18 @@ TEXI2DVI = texi2dvi
62ENVADD = $(srcdir)\..\nt\envadd.bat "TEXINPUTS=$(srcdir);$(TEXINPUTS)" \ 62ENVADD = $(srcdir)\..\nt\envadd.bat "TEXINPUTS=$(srcdir);$(TEXINPUTS)" \
63 "MAKEINFO=$(MAKEINFO) -I$(srcdir)" /C 63 "MAKEINFO=$(MAKEINFO) -I$(srcdir)" /C
64 64
65EMACS_XTRA=\
66 $(srcdir)/arevert-xtra.texi \
67 $(srcdir)/cal-xtra.texi \
68 $(srcdir)/dired-xtra.texi \
69 $(srcdir)/picture-xtra.texi \
70 $(srcdir)/emerge-xtra.texi \
71 $(srcdir)/vc-xtra.texi \
72 $(srcdir)/vc1-xtra.texi \
73 $(srcdir)/vc2-xtra.texi \
74 $(srcdir)/fortran-xtra.texi \
75 $(srcdir)/msdog-xtra.texi
76
65EMACSSOURCES= \ 77EMACSSOURCES= \
66 $(srcdir)/emacs.texi \ 78 $(srcdir)/emacs.texi \
67 $(srcdir)/doclicense.texi \ 79 $(srcdir)/doclicense.texi \
@@ -105,7 +117,8 @@ EMACSSOURCES= \
105 $(srcdir)/gnu.texi \ 117 $(srcdir)/gnu.texi \
106 $(srcdir)/glossary.texi \ 118 $(srcdir)/glossary.texi \
107 $(srcdir)/ack.texi \ 119 $(srcdir)/ack.texi \
108 $(srcdir)/kmacro.texi 120 $(srcdir)/kmacro.texi \
121 $(EMACS_XTRA)
109 122
110info: $(INFO_TARGETS) 123info: $(INFO_TARGETS)
111 124
@@ -134,7 +147,7 @@ info.dvi: $(INFOSOURCES)
134$(infodir)/emacs: $(EMACSSOURCES) 147$(infodir)/emacs: $(EMACSSOURCES)
135 $(MAKEINFO) emacs.texi 148 $(MAKEINFO) emacs.texi
136 149
137emacs.dvi: $(EMACSSOURCES) 150emacs.dvi: $(EMACSSOURCES) $(srcdir)/xresmini.texi
138 $(ENVADD) $(TEXI2DVI) $(srcdir)/emacs.texi 151 $(ENVADD) $(TEXI2DVI) $(srcdir)/emacs.texi
139 152
140# This target is here so you could easily get the list of the *.texi 153# This target is here so you could easily get the list of the *.texi
@@ -309,10 +322,7 @@ $(infodir)/smtpmail: smtpmail.texi
309smtpmail.dvi: smtpmail.texi 322smtpmail.dvi: smtpmail.texi
310 $(ENVADD) $(TEXI2DVI) $(srcdir)/smtpmail.texi 323 $(ENVADD) $(TEXI2DVI) $(srcdir)/smtpmail.texi
311 324
312$(infodir)/emacs-xtra: emacs-xtra.texi 325emacs-xtra.dvi: emacs-xtra.texi $(EMACS_XTRA)
313 $(MAKEINFO) emacs-xtra.texi
314
315emacs-xtra.dvi: emacs-xtra.texi
316 $(ENVADD) $(TEXI2DVI) $(srcdir)/emacs-xtra.texi 326 $(ENVADD) $(TEXI2DVI) $(srcdir)/emacs-xtra.texi
317 327
318$(infodir)/org: org.texi 328$(infodir)/org: org.texi
diff --git a/man/mh-e.texi b/man/mh-e.texi
index 6f20c47f40f..b72ca62cded 100644
--- a/man/mh-e.texi
+++ b/man/mh-e.texi
@@ -8,15 +8,15 @@
8@c %**end of header 8@c %**end of header
9 9
10@c Version of the software and manual. 10@c Version of the software and manual.
11@set VERSION 7.94 11@set VERSION 8.0
12@c Edition of the manual. It is either empty for the first edition or 12@c Edition of the manual. It is either empty for the first edition or
13@c has the form ", nth Edition" (without the quotes). 13@c has the form ", nth Edition" (without the quotes).
14@set EDITION , 2nd Edition 14@set EDITION
15@set UPDATED 2006-04-24 15@set UPDATED 2006-05-06
16@set UPDATE-MONTH April, 2006 16@set UPDATE-MONTH May, 2006
17 17
18@c Other variables. 18@c Other variables.
19@set MH-BOOK-HOME http://www.ics.uci.edu/~mh/book/mh 19@set MH-BOOK-HOME http://rand-mh.sourceforge.net/book/mh
20@set MH-E-HOME http://mh-e.sourceforge.net/ 20@set MH-E-HOME http://mh-e.sourceforge.net/
21 21
22@c Copyright 22@c Copyright
@@ -564,12 +564,12 @@ has packages for both of these.
564If you've never run MH before, you need to run @command{install-mh} 564If you've never run MH before, you need to run @command{install-mh}
565from the shell before you continue. This sets up your personal MH 565from the shell before you continue. This sets up your personal MH
566environment@footnote{See the section 566environment@footnote{See the section
567@uref{@value{MH-BOOK-HOME}/../overall/setup.htm, Setting Up MH} in the 567@uref{@value{MH-BOOK-HOME}/../overall/setup.html, Setting Up MH} in the
568MH book.}. If you don't, you'll be greeted with the error message: 568MH book.}. If you don't, you'll be greeted with the error message:
569@samp{Install MH and run install-mh before running MH-E}. This is all 569@samp{Install MH and run install-mh before running MH-E}. This is all
570you need to know about MH to use MH-E, but the more you know about MH, 570you need to know about MH to use MH-E, but the more you know about MH,
571the more you can leverage its power. See the 571the more you can leverage its power. See the
572@uref{@value{MH-BOOK-HOME}, MH book} to learn more about MH. 572@uref{@value{MH-BOOK-HOME}/../, MH book} to learn more about MH.
573 573
574@cindex @samp{Path:} MH profile component 574@cindex @samp{Path:} MH profile component
575@cindex MH profile 575@cindex MH profile
@@ -763,10 +763,10 @@ message. Type @kbd{C-c C-c} now. That's all there is to it!
763To read the mail you've just sent yourself, enter @kbd{M-x mh-rmail}. 763To read the mail you've just sent yourself, enter @kbd{M-x mh-rmail}.
764This incorporates the new mail and puts the output from 764This incorporates the new mail and puts the output from
765@command{inc}@footnote{See the section 765@command{inc}@footnote{See the section
766@uref{@value{MH-BOOK-HOME}/reapre.htm, Reading Mail: inc show next 766@uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
767prev} in the MH book.} (called @dfn{scan lines} after the MH program 767prev} in the MH book.} (called @dfn{scan lines} after the MH program
768@command{scan}@footnote{See the section 768@command{scan}@footnote{See the section
769@uref{@value{MH-BOOK-HOME}/faswsprs.htm, Find and Specify with scan 769@uref{@value{MH-BOOK-HOME}/faswsprs.html, Find and Specify with scan
770pick Ranges Sequences} in the MH book.} which prints a one-line 770pick Ranges Sequences} in the MH book.} which prints a one-line
771summary of each message) into a buffer called @samp{+inbox} whose 771summary of each message) into a buffer called @samp{+inbox} whose
772major mode is MH-Folder. 772major mode is MH-Folder.
@@ -1088,7 +1088,7 @@ i} to read this manual via Info. The online help is quite good; try
1088running @kbd{C-h C-h}. This brings up a list of available help topics, 1088running @kbd{C-h C-h}. This brings up a list of available help topics,
1089one of which displays the documentation for a given key (like @kbd{C-h 1089one of which displays the documentation for a given key (like @kbd{C-h
1090k C-n}). Another useful help feature is to view the manual section 1090k C-n}). Another useful help feature is to view the manual section
1091that describes a given key (such as @kbd{C-h C-k i}). In addition, 1091that describes a given key (such as @kbd{C-h K i}). In addition,
1092review @ref{Conventions}, if any of the GNU Emacs conventions are 1092review @ref{Conventions}, if any of the GNU Emacs conventions are
1093strange to you. 1093strange to you.
1094 1094
@@ -1158,7 +1158,7 @@ mh-execute-commands @key{RET}}. If you write your own functions,
1158please do not prefix your symbols (variables and functions) with 1158please do not prefix your symbols (variables and functions) with
1159@samp{mh-}. This prefix is reserved for the MH-E package. To avoid 1159@samp{mh-}. This prefix is reserved for the MH-E package. To avoid
1160conflicts with existing MH-E symbols, use a prefix like @samp{my-} or 1160conflicts with existing MH-E symbols, use a prefix like @samp{my-} or
1161your initials. 1161your initials. (Unless, of course, your initials happen to be @emph{mh}!)
1162 1162
1163@menu 1163@menu
1164* Options:: 1164* Options::
@@ -1252,7 +1252,7 @@ Indicates all messages in the range <num1> to <num2>, inclusive. The
1252range must be nonempty. 1252range must be nonempty.
1253@c ------------------------- 1253@c -------------------------
1254@item <num>:N 1254@item <num>:N
1255@item <num>:+N 1255@itemx <num>:+N
1256@itemx <num>:-N 1256@itemx <num>:-N
1257Up to N messages beginning with (or ending with) message num. Num may 1257Up to N messages beginning with (or ending with) message num. Num may
1258be any of the predefined symbols: first, prev, cur, next or last. 1258be any of the predefined symbols: first, prev, cur, next or last.
@@ -1459,8 +1459,8 @@ is an absolute pathname, the file is assumed to be in the
1459@code{mh-progs} directory (@pxref{Getting Started}). You may also link 1459@code{mh-progs} directory (@pxref{Getting Started}). You may also link
1460a file to @command{inc} that uses a different format (see 1460a file to @command{inc} that uses a different format (see
1461@samp{mh-profile}(5), and sections 1461@samp{mh-profile}(5), and sections
1462@uref{@value{MH-BOOK-HOME}/reapre.htm, Reading Mail: inc show next 1462@uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
1463prev} and @uref{@value{MH-BOOK-HOME}/mhstr.htm, MH Format Strings} in 1463prev} and @uref{@value{MH-BOOK-HOME}/mhstr.html, MH Format Strings} in
1464the MH book). You'll then need to modify several variables 1464the MH book). You'll then need to modify several variables
1465appropriately (@pxref{Scan Line Formats}). 1465appropriately (@pxref{Scan Line Formats}).
1466 1466
@@ -2169,7 +2169,7 @@ Default mhl Format} to get the same output as you would get if you ran
2169@command{mhl} from the shell. If you have a format file that you want 2169@command{mhl} from the shell. If you have a format file that you want
2170MH-E to use, you can set this option to @samp{Specify an mhl Format 2170MH-E to use, you can set this option to @samp{Specify an mhl Format
2171File} and enter the name of your format file (@command{mhl}(1) or 2171File} and enter the name of your format file (@command{mhl}(1) or
2172section @uref{@value{MH-BOOK-HOME}/shomes.htm#Usisho, Using mhl} in 2172section @uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in
2173the MH book tells you how to write one). Your format file should 2173the MH book tells you how to write one). Your format file should
2174specify a non-zero value for @samp{overflowoffset} to allow MH-E to 2174specify a non-zero value for @samp{overflowoffset} to allow MH-E to
2175parse the header. Note that @command{mhl} is always used for printing 2175parse the header. Note that @command{mhl} is always used for printing
@@ -2291,9 +2291,9 @@ MH has the ability to display @dfn{@sc{mime}} (Multipurpose Internet
2291Mail Extensions) messages which are simply messages with additional 2291Mail Extensions) messages which are simply messages with additional
2292@dfn{body parts} or @dfn{attachments}. You can use the MH commands 2292@dfn{body parts} or @dfn{attachments}. You can use the MH commands
2293@command{show}@footnote{See the section 2293@command{show}@footnote{See the section
2294@uref{@value{MH-BOOK-HOME}/reapre.htm, Reading Mail: inc show next 2294@uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
2295prev} in the MH book.} or @command{mhshow}@footnote{See the section 2295prev} in the MH book.} or @command{mhshow}@footnote{See the section
2296@uref{@value{MH-BOOK-HOME}/usimim.htm#ReMIMa, Reading MIME Mail} in 2296@uref{@value{MH-BOOK-HOME}/usimim.html#ReMIMa, Reading MIME Mail} in
2297the MH book.} from the shell to read @sc{mime} messages@footnote{You 2297the MH book.} from the shell to read @sc{mime} messages@footnote{You
2298can call them directly from Emacs if you're running the X Window 2298can call them directly from Emacs if you're running the X Window
2299System: type @kbd{M-! xterm -e mhshow @var{message-number}}. You can 2299System: type @kbd{M-! xterm -e mhshow @var{message-number}}. You can
@@ -2656,7 +2656,7 @@ use @kbd{D @key{BS}} (@code{mh-page-digest-backwards}).
2656 2656
2657Another handy command is @kbd{D b} (@code{mh-burst-digest}). This 2657Another handy command is @kbd{D b} (@code{mh-burst-digest}). This
2658command uses the MH command @command{burst}@footnote{See the section 2658command uses the MH command @command{burst}@footnote{See the section
2659@uref{@value{MH-BOOK-HOME}/burdig.htm, Bursting Messages} in the MH 2659@uref{@value{MH-BOOK-HOME}/burdig.html, Bursting Messages} in the MH
2660book.} to break out each message in the digest into its own message. 2660book.} to break out each message in the digest into its own message.
2661Using this command, you can quickly delete unwanted messages, like 2661Using this command, you can quickly delete unwanted messages, like
2662this: Once the digest is split up, toggle out of MH-Folder Show mode 2662this: Once the digest is split up, toggle out of MH-Folder Show mode
@@ -2867,7 +2867,7 @@ An alternative to using the @samp{ps-print} package is the command
2867@kbd{P l} (@code{mh-print-msg}) (the @i{l} is for @i{l}ine printer or 2867@kbd{P l} (@code{mh-print-msg}) (the @i{l} is for @i{l}ine printer or
2868@i{l}pr). You can print all the messages in a range. The message is 2868@i{l}pr). You can print all the messages in a range. The message is
2869formatted with @command{mhl}@footnote{See the section 2869formatted with @command{mhl}@footnote{See the section
2870@uref{@value{MH-BOOK-HOME}/shomes.htm#Usisho, Using mhl} in the MH 2870@uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in the MH
2871book.} and printed with the @command{lpr} command. 2871book.} and printed with the @command{lpr} command.
2872 2872
2873@kindex P f 2873@kindex P f
@@ -3471,8 +3471,8 @@ bindings, for example:
3471 3471
3472MH-E has analogies for each of the MH @command{folder} and 3472MH-E has analogies for each of the MH @command{folder} and
3473@command{refile} commands@footnote{See the sections 3473@command{refile} commands@footnote{See the sections
3474@uref{@value{MH-BOOK-HOME}/fol.htm#Youfol, Your Current Folder: 3474@uref{@value{MH-BOOK-HOME}/fol.html#Youfol, Your Current Folder:
3475folder} and @uref{@value{MH-BOOK-HOME}/fol.htm#Movref, Moving and 3475folder} and @uref{@value{MH-BOOK-HOME}/fol.html#Movref, Moving and
3476Linking Messages: refile} in the MH book.}. To refile a message in 3476Linking Messages: refile} in the MH book.}. To refile a message in
3477another folder, use the command @kbd{o} (@code{mh-refile-msg}) 3477another folder, use the command @kbd{o} (@code{mh-refile-msg})
3478(mnemonic: ``output''). You are prompted for the folder name 3478(mnemonic: ``output''). You are prompted for the folder name
@@ -3720,7 +3720,7 @@ Use this hook with care. If there is a bug in your hook which returns
3720 3720
3721The option @code{mh-sortm-args} holds extra arguments to pass on to 3721The option @code{mh-sortm-args} holds extra arguments to pass on to
3722the command @command{sortm}@footnote{See the section 3722the command @command{sortm}@footnote{See the section
3723@uref{@value{MH-BOOK-HOME}/sorsor.htm, Sorting Messages: sortm} in the 3723@uref{@value{MH-BOOK-HOME}/sorsor.html, Sorting Messages: sortm} in the
3724MH book.} when a prefix argument is used with @kbd{F S}. Normally 3724MH book.} when a prefix argument is used with @kbd{F S}. Normally
3725default arguments to @command{sortm} are specified in the MH profile. 3725default arguments to @command{sortm} are specified in the MH profile.
3726This option may be used to provide an alternate view. For example, 3726This option may be used to provide an alternate view. For example,
@@ -4103,7 +4103,7 @@ recipients.
4103@vindex mh-reply-default-reply-to 4103@vindex mh-reply-default-reply-to
4104 4104
4105Depending on your answer, @command{repl}@footnote{See the section 4105Depending on your answer, @command{repl}@footnote{See the section
4106@uref{@value{MH-BOOK-HOME}/reprep.htm, Replying to Messages: repl} in 4106@uref{@value{MH-BOOK-HOME}/reprep.html, Replying to Messages: repl} in
4107the MH book.} is given a different argument to form your reply. 4107the MH book.} is given a different argument to form your reply.
4108Specifically, a choice of @kbd{from} or none at all runs @samp{repl 4108Specifically, a choice of @kbd{from} or none at all runs @samp{repl
4109-nocc all}, and a choice of @kbd{to} runs @samp{repl -cc to}. Finally, 4109-nocc all}, and a choice of @kbd{to} runs @samp{repl -cc to}. Finally,
@@ -4133,7 +4133,7 @@ If you supply a prefix argument (as in @kbd{C-u r}), the message you
4133are replying to is inserted in your reply after having first been run 4133are replying to is inserted in your reply after having first been run
4134through @command{mhl} with the format file @file{mhl.reply}. See 4134through @command{mhl} with the format file @file{mhl.reply}. See
4135@command{mhl}(1) or the section 4135@command{mhl}(1) or the section
4136@uref{@value{MH-BOOK-HOME}/shomes.htm#Usisho, Using mhl} in the MH 4136@uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in the MH
4137book to see how you can modify the default @file{mhl.reply} file. 4137book to see how you can modify the default @file{mhl.reply} file.
4138 4138
4139@vindex mh-yank-behavior 4139@vindex mh-yank-behavior
@@ -4169,7 +4169,7 @@ To forward a message, use the @kbd{f} (@code{mh-forward}) command. You
4169are prompted for the @samp{To:} and @samp{cc:} recipients. You are 4169are prompted for the @samp{To:} and @samp{cc:} recipients. You are
4170given a draft to edit that looks like it would if you had run the MH 4170given a draft to edit that looks like it would if you had run the MH
4171command @command{forw}@footnote{See the section 4171command @command{forw}@footnote{See the section
4172@uref{@value{MH-BOOK-HOME}/forfor.htm, Forwarding Messages: forw} in 4172@uref{@value{MH-BOOK-HOME}/forfor.html, Forwarding Messages: forw} in
4173the MH book.}. You can then add some text (@pxref{Editing Drafts}). 4173the MH book.}. You can then add some text (@pxref{Editing Drafts}).
4174You can forward several messages by using a range (@pxref{Ranges}). 4174You can forward several messages by using a range (@pxref{Ranges}).
4175All of the messages in the range are inserted into your draft. The 4175All of the messages in the range are inserted into your draft. The
@@ -4243,10 +4243,10 @@ For more information on redistributing messages, see
4243 4243
4244The option @code{mh-redist-full-contents-flag} must be turned on if 4244The option @code{mh-redist-full-contents-flag} must be turned on if
4245@command{dist}@footnote{See the section 4245@command{dist}@footnote{See the section
4246@uref{@value{MH-BOOK-HOME}/disdis.htm, Distributing Messages with 4246@uref{@value{MH-BOOK-HOME}/disdis.html, Distributing Messages with
4247dist} in the MH book.} requires the whole letter for redistribution, 4247dist} in the MH book.} requires the whole letter for redistribution,
4248which is the case if @command{send}@footnote{See the section 4248which is the case if @command{send}@footnote{See the section
4249@uref{@value{MH-BOOK-HOME}/sensen.htm, Sending Some Mail: comp send} 4249@uref{@value{MH-BOOK-HOME}/sensen.html, Sending Some Mail: comp send}
4250in the MH book.} is compiled with the @sc{berk} option (which many 4250in the MH book.} is compiled with the @sc{berk} option (which many
4251people abhor). If you find that MH will not allow you to redistribute 4251people abhor). If you find that MH will not allow you to redistribute
4252a message that has been redistributed before, turn off this option. 4252a message that has been redistributed before, turn off this option.
@@ -5143,7 +5143,7 @@ although it provides a handful of commands prefixed with @kbd{C-c C-m}
5143to insert the directives so you don't need to remember the syntax of 5143to insert the directives so you don't need to remember the syntax of
5144them. Remember: you can always add MH-style directives by 5144them. Remember: you can always add MH-style directives by
5145hand@footnote{See the section 5145hand@footnote{See the section
5146@uref{@value{MH-BOOK-HOME}/usimim.htm#SeMIMa, Sending MIME Mail} in 5146@uref{@value{MH-BOOK-HOME}/usimim.html#SeMIMa, Sending MIME Mail} in
5147the MH book.}. 5147the MH book.}.
5148 5148
5149@cindex MIME Meta Language (MML) 5149@cindex MIME Meta Language (MML)
@@ -5432,7 +5432,7 @@ If you're using MH-style directives, use @kbd{C-c C-e}
5432(@code{mh-mh-to-mime}) instead of @kbd{C-c C-m C-m}. This runs the 5432(@code{mh-mh-to-mime}) instead of @kbd{C-c C-m C-m}. This runs the
5433command @command{mhbuild} (@command{mhn}) on the message which expands 5433command @command{mhbuild} (@command{mhn}) on the message which expands
5434the tags@footnote{See the section 5434the tags@footnote{See the section
5435@uref{@value{MH-BOOK-HOME}/usimim.htm#SeMIMa, Sending MIME Mail} in 5435@uref{@value{MH-BOOK-HOME}/usimim.html#SeMIMa, Sending MIME Mail} in
5436the MH book.}. This action can be undone by running @kbd{C-c C-m C-u} 5436the MH book.}. This action can be undone by running @kbd{C-c C-m C-u}
5437(@code{mh-mh-to-mime-undo}), which works by reverting to a backup 5437(@code{mh-mh-to-mime-undo}), which works by reverting to a backup
5438file. You are prompted to confirm this action, but you can avoid the 5438file. You are prompted to confirm this action, but you can avoid the
@@ -5565,7 +5565,7 @@ The command @kbd{C-c C-w} (@code{mh-check-whom}) expands aliases so
5565you can check the actual address(es) in the alias. A new buffer named 5565you can check the actual address(es) in the alias. A new buffer named
5566@samp{*MH-E Recipients*} is created with the output of @command{whom} 5566@samp{*MH-E Recipients*} is created with the output of @command{whom}
5567(@pxref{Miscellaneous})@footnote{See the section 5567(@pxref{Miscellaneous})@footnote{See the section
5568@uref{@value{MH-BOOK-HOME}/senove.htm#WhaPro, What now? -- and the 5568@uref{@value{MH-BOOK-HOME}/senove.html#WhaPro, What now? -- and the
5569whatnow Program} in the MH book.}. 5569whatnow Program} in the MH book.}.
5570 5570
5571@node Sending Message, Killing Draft, Checking Recipients, Editing Drafts 5571@node Sending Message, Killing Draft, Checking Recipients, Editing Drafts
@@ -5599,7 +5599,7 @@ spelling in your message before sending, add the function
5599@vindex mh-send-prog 5599@vindex mh-send-prog
5600 5600
5601In case the MH @command{send} program@footnote{See the section 5601In case the MH @command{send} program@footnote{See the section
5602@uref{@value{MH-BOOK-HOME}/sensen.htm, Sending Some Mail: comp send} 5602@uref{@value{MH-BOOK-HOME}/sensen.html, Sending Some Mail: comp send}
5603in the MH book.} is installed under a different name, use 5603in the MH book.} is installed under a different name, use
5604@code{mh-send-prog} to tell MH-E the name. 5604@code{mh-send-prog} to tell MH-E the name.
5605 5605
@@ -5780,7 +5780,7 @@ Recipients}.
5780 5780
5781MH-E loads aliases for completion and folder name hints from various 5781MH-E loads aliases for completion and folder name hints from various
5782places. It uses the MH command @command{ali}@footnote{See the section 5782places. It uses the MH command @command{ali}@footnote{See the section
5783@uref{@value{MH-BOOK-HOME}/mh.htm, MH Aliases} in the MH book.} to 5783@uref{@value{MH-BOOK-HOME}/mh.html, MH Aliases} in the MH book.} to
5784read aliases from the files listed in the profile component 5784read aliases from the files listed in the profile component
5785@samp{Aliasfile:} as well as system-wide aliases (for example, 5785@samp{Aliasfile:} as well as system-wide aliases (for example,
5786@file{/etc/nmh/MailAliases}). 5786@file{/etc/nmh/MailAliases}).
@@ -6253,7 +6253,7 @@ contains these items. Dismiss the speedbar with @kbd{C-x 5 0}
6253@cindex customization group, @samp{mh-speedbar} 6253@cindex customization group, @samp{mh-speedbar}
6254 6254
6255The MH-E speedbar uses the MH command @command{flists}@footnote{See 6255The MH-E speedbar uses the MH command @command{flists}@footnote{See
6256the section @uref{@value{MH-BOOK-HOME}/morseq.htm#flist, Searching for 6256the section @uref{@value{MH-BOOK-HOME}/morseq.html#flist, Searching for
6257Sequences with flist} in the MH book.} to generate the list of 6257Sequences with flist} in the MH book.} to generate the list of
6258folders. The @samp{mh-speedbar} customization group contains the 6258folders. The @samp{mh-speedbar} customization group contains the
6259following option which controls how often the speedbar calls 6259following option which controls how often the speedbar calls
@@ -6951,7 +6951,7 @@ mknmz -f /home/user/Mail/.namazu/mknmzrc -O /home/user/Mail/.namazu \
6951This search method does not require any setup. 6951This search method does not require any setup.
6952 6952
6953Read @command{pick}(1) or the section 6953Read @command{pick}(1) or the section
6954@uref{@value{MH-BOOK-HOME}/finpic.htm, Finding Messages with pick} in 6954@uref{@value{MH-BOOK-HOME}/finpic.html, Finding Messages with pick} in
6955the MH book to find out more about how to enter the criteria. 6955the MH book to find out more about how to enter the criteria.
6956 6956
6957@subsection grep 6957@subsection grep
@@ -7180,7 +7180,7 @@ messages matching the content of the respective field in the current
7180message. However, you can give any of these a prefix argument to edit 7180message. However, you can give any of these a prefix argument to edit
7181the @command{pick} expression used to narrow the view@footnote{See 7181the @command{pick} expression used to narrow the view@footnote{See
7182@command{pick}(1) or the section 7182@command{pick}(1) or the section
7183@uref{@value{MH-BOOK-HOME}/finpic.htm, Finding Messages with pick} in 7183@uref{@value{MH-BOOK-HOME}/finpic.html, Finding Messages with pick} in
7184the MH book.}. 7184the MH book.}.
7185 7185
7186@cindex @samp{tick} sequence 7186@cindex @samp{tick} sequence
@@ -7212,7 +7212,7 @@ command. Give this command a prefix argument to remove all limits.
7212 7212
7213For the whole scoop on MH sequences, refer to 7213For the whole scoop on MH sequences, refer to
7214@samp{mh-sequence}(5)@footnote{See the section 7214@samp{mh-sequence}(5)@footnote{See the section
7215@uref{@value{MH-BOOK-HOME}/morseq.htm, More About Sequences} in the MH 7215@uref{@value{MH-BOOK-HOME}/morseq.html, More About Sequences} in the MH
7216book.}. As you've read, several of the MH-E commands can operate on a 7216book.}. As you've read, several of the MH-E commands can operate on a
7217sequence, which is a shorthand for a range or group of messages. For 7217sequence, which is a shorthand for a range or group of messages. For
7218example, you might want to forward several messages to a friend or 7218example, you might want to forward several messages to a friend or
@@ -7452,7 +7452,7 @@ from the unseen sequence.
7452 7452
7453With the exceptions of @kbd{S n} and @kbd{S w}, the underlying MH 7453With the exceptions of @kbd{S n} and @kbd{S w}, the underlying MH
7454command dealing with sequences is @command{mark}@footnote{See the 7454command dealing with sequences is @command{mark}@footnote{See the
7455section @uref{@value{MH-BOOK-HOME}/mmbwm.htm, Make Message Bookmarks 7455section @uref{@value{MH-BOOK-HOME}/mmbwm.html, Make Message Bookmarks
7456with mark} in the MH book.}. 7456with mark} in the MH book.}.
7457 7457
7458@node Junk, Miscellaneous, Sequences, Top 7458@node Junk, Miscellaneous, Sequences, Top
@@ -8050,7 +8050,7 @@ Unless this variable contains an absolute pathname, it is assumed to
8050be in the @code{mh-progs} directory (@pxref{Getting Started}). You may 8050be in the @code{mh-progs} directory (@pxref{Getting Started}). You may
8051link another program to @command{scan} (see @samp{mh-profile}(5)) to 8051link another program to @command{scan} (see @samp{mh-profile}(5)) to
8052produce a different type of listing@footnote{See the section 8052produce a different type of listing@footnote{See the section
8053@uref{@value{MH-BOOK-HOME}/faswsprs.htm, Find and Specify with scan 8053@uref{@value{MH-BOOK-HOME}/faswsprs.html, Find and Specify with scan
8054pick Ranges Sequences} in the MH book.}. 8054pick Ranges Sequences} in the MH book.}.
8055 8055
8056@cindex regular expressions, scan line formats 8056@cindex regular expressions, scan line formats
@@ -8087,7 +8087,7 @@ The first variable has to do with pruning out garbage.
8087This regular expression describes a valid scan line. This is used to 8087This regular expression describes a valid scan line. This is used to
8088eliminate error messages that are occasionally produced by 8088eliminate error messages that are occasionally produced by
8089@command{inc}@footnote{See the section 8089@command{inc}@footnote{See the section
8090@uref{@value{MH-BOOK-HOME}/reapre.htm, Reading Mail: inc show next 8090@uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
8091prev} in the MH book.} or @command{scan} (default: @code{"^ *[0-9]"}). 8091prev} in the MH book.} or @command{scan} (default: @code{"^ *[0-9]"}).
8092@end vtable 8092@end vtable
8093 8093
diff --git a/man/mini.texi b/man/mini.texi
index f88adf01f9f..4c3748a78f1 100644
--- a/man/mini.texi
+++ b/man/mini.texi
@@ -415,6 +415,9 @@ whose initials are @samp{p} and @samp{b}.
415indicate the places for completion; thus, @file{/u*/b*/f*} might 415indicate the places for completion; thus, @file{/u*/b*/f*} might
416complete to @file{/usr/bin/foo}. 416complete to @file{/usr/bin/foo}.
417 417
418 For remote files, partial completion enables completion of methods,
419user names and host names. @xref{Remote Files}.
420
418 To enable this mode, use the command @kbd{M-x 421 To enable this mode, use the command @kbd{M-x
419partial-completion-mode}, or customize the variable 422partial-completion-mode}, or customize the variable
420@code{partial-completion-mode}. This binds the partial completion 423@code{partial-completion-mode}. This binds the partial completion
diff --git a/man/misc.texi b/man/misc.texi
index 71f4aba2b49..9e5d2835e20 100644
--- a/man/misc.texi
+++ b/man/misc.texi
@@ -1761,7 +1761,7 @@ rectangle moves along with the text inside the rectangle.
1761 Many of the sort commands ignore case differences when comparing, if 1761 Many of the sort commands ignore case differences when comparing, if
1762@code{sort-fold-case} is non-@code{nil}. 1762@code{sort-fold-case} is non-@code{nil}.
1763 1763
1764@node Narrowing, Diff Mode, Sorting, Top 1764@node Narrowing, Two-Column, Sorting, Top
1765@section Narrowing 1765@section Narrowing
1766@cindex widening 1766@cindex widening
1767@cindex restriction 1767@cindex restriction
@@ -1827,86 +1827,7 @@ this command asks for confirmation and gives you the option of enabling it;
1827if you enable the command, confirmation will no longer be required for 1827if you enable the command, confirmation will no longer be required for
1828it. @xref{Disabling}. 1828it. @xref{Disabling}.
1829 1829
1830@node Diff Mode, Two-Column, Narrowing, Top 1830@node Two-Column, Editing Binary Files, Narrowing, Top
1831@section Diff Mode
1832@cindex Diff mode
1833
1834 Diff mode is useful for editing patches and comparisons produced by
1835the @command{diff} program. You can select Diff mode by typing
1836@kbd{M-x diff-mode}; Emacs commands that compare files automatically
1837select Diff mode. @xref{Top,, Diff, diff, Comparing and Merging Files},
1838for more information about @command{diff} output formats.
1839
1840 One general feature of Diff mode is that manual edits to the patch
1841automatically correct line numbers, including those in the hunk
1842header, so that you can actually apply the edited patch. Diff mode
1843also provides the following commands to navigate, manipulate and apply
1844parts of patches:
1845
1846@table @kbd
1847@item M-n
1848Move to the next hunk-start (@code{diff-hunk-next}).
1849
1850@item M-p
1851Move to the previous hunk-start (@code{diff-hunk-prev}).
1852
1853@item M-@}
1854Move to the next file-start, in a multi-file patch
1855(@code{diff-file-next}).
1856
1857@item M-@{
1858Move to the previous file-start, in a multi-file patch
1859(@code{diff-file-prev}).
1860
1861@item M-k
1862Kill the hunk at point (@code{diff-hunk-kill}).
1863
1864@item M-K
1865In a multi-file patch, kill the current file part.
1866(@code{diff-file-kill}).
1867
1868@item C-c C-a
1869Apply this hunk to its target file (@code{diff-apply-hunk}). With a
1870prefix argument of @kbd{C-u}, revert this hunk.
1871
1872@item C-c C-c
1873Go to the source corresponding to this hunk (@code{diff-goto-source}).
1874
1875@item C-c C-e
1876Start an Ediff session with the patch (@code{diff-ediff-patch}).
1877@xref{Top, Ediff, Ediff, ediff, The Ediff Manual}.
1878
1879@item C-c C-n
1880Restrict the view to the current hunk (@code{diff-restrict-view}).
1881@xref{Narrowing}. With a prefix argument of @kbd{C-u}, restrict the
1882view to the current patch of a multiple file patch. To widen again,
1883use @kbd{C-x n w}.
1884
1885@item C-c C-r
1886Reverse the direction of comparison for the entire buffer
1887(@code{diff-reverse-direction}).
1888
1889@item C-c C-s
1890Split the hunk at point (@code{diff-split-hunk}). This is for
1891manually editing patches, and only works with the unified diff format.
1892
1893@item C-c C-u
1894Convert the entire buffer to unified format
1895(@code{diff-context->unified}). With a prefix argument, convert
1896unified format to context format. In Transient Mark mode, when the
1897mark is active, this command operates only on the region.
1898
1899@item C-c C-w
1900Refine the current hunk so that it disregards changes in whitespace
1901(@code{diff-refine-hunk}).
1902@end table
1903
1904 @kbd{C-x 4 a} in Diff mode operates on behalf of the target file,
1905but gets the function name from the patch itself. @xref{Change Log}.
1906This is useful for making log entries for functions that are deleted
1907by the patch.
1908
1909@node Two-Column, Editing Binary Files, Diff Mode, Top
1910@section Two-Column Editing 1831@section Two-Column Editing
1911@cindex two-column editing 1832@cindex two-column editing
1912@cindex splitting columns 1833@cindex splitting columns
@@ -2462,7 +2383,7 @@ a buffer containing thumbnails, corresponding to the marked files.
2462(@code{tumme-display-thumbnail-original-image}) to display a sized 2383(@code{tumme-display-thumbnail-original-image}) to display a sized
2463version of it in another window. This sizes the image to fit the 2384version of it in another window. This sizes the image to fit the
2464window. Use the arrow keys to move around in the buffer. For easy 2385window. Use the arrow keys to move around in the buffer. For easy
2465browing, type @kbd{SPC} (@code{tumme-display-next-thumbnail-original}) 2386browsing, type @kbd{SPC} (@code{tumme-display-next-thumbnail-original})
2466to advance and display the next image. Typing @kbd{DEL} 2387to advance and display the next image. Typing @kbd{DEL}
2467(@code{tumme-display-previous-thumbnail-original}) backs up to the 2388(@code{tumme-display-previous-thumbnail-original}) backs up to the
2468previous thumbnail and displays that instead. 2389previous thumbnail and displays that instead.
diff --git a/man/msdog-xtra.texi b/man/msdog-xtra.texi
new file mode 100644
index 00000000000..1c4e50785f2
--- /dev/null
+++ b/man/msdog-xtra.texi
@@ -0,0 +1,687 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions.
4@c
5@c This file is included either in emacs-xtra.texi (when producing the
6@c printed version) or in the main Emacs manual (for the on-line version).
7@node MS-DOS
8@section Emacs and MS-DOS
9@cindex MS-DOG
10@cindex MS-DOS peculiarities
11
12 This section briefly describes the peculiarities of using Emacs on
13the MS-DOS ``operating system'' (also known as ``MS-DOG'').
14@iftex
15Information about Emacs and Microsoft's current operating system
16Windows (also known as ``Losedows) is in the main Emacs manual
17(@pxref{Microsoft Systems,,, emacs, the Emacs Manual}).
18@end iftex
19@ifnottex
20Information about peculiarities common to MS-DOS and Microsoft's
21current operating systems Windows (also known as ``Losedows) is in
22@ref{Microsoft Windows}.
23@end ifnottex
24
25 If you build Emacs for MS-DOS, the binary will also run on Windows
263.X, Windows NT, Windows 9X/ME, Windows 2000/XP, or OS/2 as a DOS
27application; all of this chapter applies for all of those systems, if
28you use an Emacs that was built for MS-DOS.
29
30@iftex
31 @xref{Text and Binary,,,emacs, the Emacs Manual}, for information
32@end iftex
33@ifnottex
34 @xref{Text and Binary}, for information
35@end ifnottex
36about Emacs' special handling of text files under MS-DOS (and Windows).
37
38@menu
39* Keyboard: MS-DOS Keyboard. Keyboard conventions on MS-DOS.
40* Mouse: MS-DOS Mouse. Mouse conventions on MS-DOS.
41* Display: MS-DOS Display. Fonts, frames and display size on MS-DOS.
42* Files: MS-DOS File Names. File name conventions on MS-DOS.
43* Printing: MS-DOS Printing. Printing specifics on MS-DOS.
44* I18N: MS-DOS and MULE. Support for internationalization on MS-DOS.
45* Processes: MS-DOS Processes. Running subprocesses on MS-DOS.
46@end menu
47
48@node MS-DOS Keyboard
49@subsection Keyboard Usage on MS-DOS
50
51@kindex DEL @r{(MS-DOS)}
52@kindex BS @r{(MS-DOS)}
53 The key that is called @key{DEL} in Emacs (because that's how it is
54designated on most workstations) is known as @key{BS} (backspace) on a
55PC. That is why the PC-specific terminal initialization remaps the
56@key{BS} key to act as @key{DEL}; the @key{DELETE} key is remapped to act
57as @kbd{C-d} for the same reasons.
58
59@kindex C-g @r{(MS-DOS)}
60@kindex C-BREAK @r{(MS-DOS)}
61@cindex quitting on MS-DOS
62 Emacs built for MS-DOS recognizes @kbd{C-@key{BREAK}} as a quit
63character, just like @kbd{C-g}. This is because Emacs cannot detect
64that you have typed @kbd{C-g} until it is ready for more input. As a
65consequence, you cannot use @kbd{C-g} to stop a running command
66@iftex
67(@pxref{Quitting,,,emacs, the Emacs Manual}).
68@end iftex
69@ifnottex
70(@pxref{Quitting}).
71@end ifnottex
72By contrast, @kbd{C-@key{BREAK}} @emph{is} detected as soon as you
73type it (as @kbd{C-g} is on other systems), so it can be used to stop
74a running command and for emergency escape
75@iftex
76(@pxref{Emergency Escape,,,emacs, the Emacs Manual}).
77@end iftex
78@ifnottex
79(@pxref{Emergency Escape}).
80@end ifnottex
81
82@cindex Meta (under MS-DOS)
83@cindex Hyper (under MS-DOS)
84@cindex Super (under MS-DOS)
85@vindex dos-super-key
86@vindex dos-hyper-key
87 The PC keyboard maps use the left @key{ALT} key as the @key{META} key.
88You have two choices for emulating the @key{SUPER} and @key{HYPER} keys:
89choose either the right @key{CTRL} key or the right @key{ALT} key by
90setting the variables @code{dos-hyper-key} and @code{dos-super-key} to 1
91or 2 respectively. If neither @code{dos-super-key} nor
92@code{dos-hyper-key} is 1, then by default the right @key{ALT} key is
93also mapped to the @key{META} key. However, if the MS-DOS international
94keyboard support program @file{KEYB.COM} is installed, Emacs will
95@emph{not} map the right @key{ALT} to @key{META}, since it is used for
96accessing characters like @kbd{~} and @kbd{@@} on non-US keyboard
97layouts; in this case, you may only use the left @key{ALT} as @key{META}
98key.
99
100@kindex C-j @r{(MS-DOS)}
101@vindex dos-keypad-mode
102 The variable @code{dos-keypad-mode} is a flag variable that controls
103what key codes are returned by keys in the numeric keypad. You can also
104define the keypad @key{ENTER} key to act like @kbd{C-j}, by putting the
105following line into your @file{_emacs} file:
106
107@smallexample
108;; @r{Make the @key{ENTER} key from the numeric keypad act as @kbd{C-j}.}
109(define-key function-key-map [kp-enter] [?\C-j])
110@end smallexample
111
112@node MS-DOS Mouse
113@subsection Mouse Usage on MS-DOS
114
115@cindex mouse support under MS-DOS
116 Emacs on MS-DOS supports a mouse (on the default terminal only).
117The mouse commands work as documented, including those that use menus
118and the menu bar
119@iftex
120(@pxref{Menu Bar,,,emacs, the Emacs Manual}).
121@end iftex
122@ifnottex
123(@pxref{Menu Bar}).
124@end ifnottex
125 Scroll bars don't work in MS-DOS Emacs. PC mice usually have only
126two buttons; these act as @kbd{Mouse-1} and @kbd{Mouse-2}, but if you
127press both of them together, that has the effect of @kbd{Mouse-3}. If
128the mouse does have 3 buttons, Emacs detects that at startup, and all
129the 3 buttons function normally, as on X.
130
131 Help strings for menu-bar and pop-up menus are displayed in the echo
132area when the mouse pointer moves across the menu items. Highlighting
133of mouse-sensitive text
134@iftex
135(@pxref{Mouse References,,,emacs, the Emacs Manual})
136@end iftex
137@ifnottex
138(@pxref{Mouse References})
139@end ifnottex
140is also supported.
141
142@cindex mouse, set number of buttons
143@findex msdos-set-mouse-buttons
144 Some versions of mouse drivers don't report the number of mouse
145buttons correctly. For example, mice with a wheel report that they
146have 3 buttons, but only 2 of them are passed to Emacs; the clicks on
147the wheel, which serves as the middle button, are not passed. In
148these cases, you can use the @kbd{M-x msdos-set-mouse-buttons} command
149to tell Emacs how many mouse buttons to expect. You could make such a
150setting permanent by adding this fragment to your @file{_emacs} init
151file:
152
153@example
154;; @r{Treat the mouse like a 2-button mouse.}
155(msdos-set-mouse-buttons 2)
156@end example
157
158@cindex Windows clipboard support
159 Emacs built for MS-DOS supports clipboard operations when it runs on
160Windows. Commands that put text on the kill ring, or yank text from
161the ring, check the Windows clipboard first, just as Emacs does on the
162X Window System
163@iftex
164(@pxref{Mouse Commands,,,emacs, the Emacs Manual}).
165@end iftex
166@ifnottex
167(@pxref{Mouse Commands}).
168@end ifnottex
169Only the primary selection and the cut buffer are supported by MS-DOS
170Emacs on Windows; the secondary selection always appears as empty.
171
172 Due to the way clipboard access is implemented by Windows, the
173length of text you can put into the clipboard is limited by the amount
174of free DOS memory that is available to Emacs. Usually, up to 620KB of
175text can be put into the clipboard, but this limit depends on the system
176configuration and is lower if you run Emacs as a subprocess of
177another program. If the killed text does not fit, Emacs outputs a
178message saying so, and does not put the text into the clipboard.
179
180 Null characters also cannot be put into the Windows clipboard. If the
181killed text includes null characters, Emacs does not put such text into
182the clipboard, and displays in the echo area a message to that effect.
183
184@vindex dos-display-scancodes
185 The variable @code{dos-display-scancodes}, when non-@code{nil},
186directs Emacs to display the @acronym{ASCII} value and the keyboard scan code of
187each keystroke; this feature serves as a complement to the
188@code{view-lossage} command, for debugging.
189
190@node MS-DOS Display
191@subsection Display on MS-DOS
192@cindex faces under MS-DOS
193@cindex fonts, emulating under MS-DOS
194
195 Display on MS-DOS cannot use font variants, like bold or italic, but
196it does support multiple faces, each of which can specify a foreground
197and a background color. Therefore, you can get the full functionality
198of Emacs packages that use fonts (such as @code{font-lock}, Enriched
199Text mode, and others) by defining the relevant faces to use different
200colors. Use the @code{list-colors-display} command
201@iftex
202(@pxref{Frame Parameters,,,emacs, the Emacs Manual})
203@end iftex
204@ifnottex
205(@pxref{Frame Parameters})
206@end ifnottex
207and the @code{list-faces-display} command
208@iftex
209(@pxref{Faces,,,emacs, the Emacs Manual})
210@end iftex
211@ifnottex
212(@pxref{Faces})
213@end ifnottex
214to see what colors and faces are available and what they look like.
215
216 @xref{MS-DOS and MULE}, later in this chapter, for information on
217how Emacs displays glyphs and characters that aren't supported by the
218native font built into the DOS display.
219
220@cindex cursor shape on MS-DOS
221 When Emacs starts, it changes the cursor shape to a solid box. This
222is for compatibility with other systems, where the box cursor is the
223default in Emacs. This default shape can be changed to a bar by
224specifying the @code{cursor-type} parameter in the variable
225@code{default-frame-alist}
226@iftex
227(@pxref{Creating Frames,,,emacs, the Emacs Manual}).
228@end iftex
229@ifnottex
230(@pxref{Creating Frames}).
231@end ifnottex
232The MS-DOS terminal doesn't support a vertical-bar cursor,
233so the bar cursor is horizontal, and the @code{@var{width}} parameter,
234if specified by the frame parameters, actually determines its height.
235For this reason, the @code{bar} and @code{hbar} cursor types produce
236the same effect on MS-DOS. As an extension, the bar cursor
237specification can include the starting scan line of the cursor as well
238as its width, like this:
239
240@example
241 '(cursor-type bar @var{width} . @var{start})
242@end example
243
244@noindent
245In addition, if the @var{width} parameter is negative, the cursor bar
246begins at the top of the character cell.
247
248@cindex frames on MS-DOS
249 The MS-DOS terminal can only display a single frame at a time. The
250Emacs frame facilities work on MS-DOS much as they do on text-only
251terminals
252@iftex
253(@pxref{Frames,,,emacs, the Emacs Manual}).
254@end iftex
255@ifnottex
256(@pxref{Frames}).
257@end ifnottex
258When you run Emacs from a DOS window on MS-Windows, you can make the
259visible frame smaller than the full screen, but Emacs still cannot
260display more than a single frame at a time.
261
262@cindex frame size under MS-DOS
263@findex mode4350
264@findex mode25
265 The @code{mode4350} command switches the display to 43 or 50
266lines, depending on your hardware; the @code{mode25} command switches
267to the default 80x25 screen size.
268
269 By default, Emacs only knows how to set screen sizes of 80 columns by
27025, 28, 35, 40, 43 or 50 rows. However, if your video adapter has
271special video modes that will switch the display to other sizes, you can
272have Emacs support those too. When you ask Emacs to switch the frame to
273@var{n} rows by @var{m} columns dimensions, it checks if there is a
274variable called @code{screen-dimensions-@var{n}x@var{m}}, and if so,
275uses its value (which must be an integer) as the video mode to switch
276to. (Emacs switches to that video mode by calling the BIOS @code{Set
277Video Mode} function with the value of
278@code{screen-dimensions-@var{n}x@var{m}} in the @code{AL} register.)
279For example, suppose your adapter will switch to 66x80 dimensions when
280put into video mode 85. Then you can make Emacs support this screen
281size by putting the following into your @file{_emacs} file:
282
283@example
284(setq screen-dimensions-66x80 85)
285@end example
286
287 Since Emacs on MS-DOS can only set the frame size to specific
288supported dimensions, it cannot honor every possible frame resizing
289request. When an unsupported size is requested, Emacs chooses the next
290larger supported size beyond the specified size. For example, if you
291ask for 36x80 frame, you will get 40x80 instead.
292
293 The variables @code{screen-dimensions-@var{n}x@var{m}} are used only
294when they exactly match the specified size; the search for the next
295larger supported size ignores them. In the above example, even if your
296VGA supports 38x80 dimensions and you define a variable
297@code{screen-dimensions-38x80} with a suitable value, you will still get
29840x80 screen when you ask for a 36x80 frame. If you want to get the
29938x80 size in this case, you can do it by setting the variable named
300@code{screen-dimensions-36x80} with the same video mode value as
301@code{screen-dimensions-38x80}.
302
303 Changing frame dimensions on MS-DOS has the effect of changing all the
304other frames to the new dimensions.
305
306@node MS-DOS File Names
307@subsection File Names on MS-DOS
308@cindex file names under MS-DOS
309@cindex init file, default name under MS-DOS
310
311 On MS-DOS, file names are case-insensitive and limited to eight
312characters, plus optionally a period and three more characters. Emacs
313knows enough about these limitations to handle file names that were
314meant for other operating systems. For instance, leading dots
315@samp{.} in file names are invalid in MS-DOS, so Emacs transparently
316converts them to underscores @samp{_}; thus your default init file
317@iftex
318(@pxref{Init File,,,emacs, the Emacs Manual})
319@end iftex
320@ifnottex
321(@pxref{Init File})
322@end ifnottex
323is called @file{_emacs} on MS-DOS. Excess characters before or after
324the period are generally ignored by MS-DOS itself; thus, if you visit
325the file @file{LongFileName.EvenLongerExtension}, you will silently
326get @file{longfile.eve}, but Emacs will still display the long file
327name on the mode line. Other than that, it's up to you to specify
328file names which are valid under MS-DOS; the transparent conversion as
329described above only works on file names built into Emacs.
330
331@cindex backup file names on MS-DOS
332 The above restrictions on the file names on MS-DOS make it almost
333impossible to construct the name of a backup file
334@iftex
335(@pxref{Backup Names,,,emacs, the Emacs Manual})
336@end iftex
337@ifnottex
338(@pxref{Backup Names})
339@end ifnottex
340without losing some of the original file name characters. For
341example, the name of a backup file for @file{docs.txt} is
342@file{docs.tx~} even if single backup is used.
343
344@cindex file names under Windows 95/NT
345@cindex long file names in DOS box under Windows 95/NT
346 If you run Emacs as a DOS application under Windows 9X, Windows ME, or
347Windows 2000/XP, you can turn on support for long file names. If you do
348that, Emacs doesn't truncate file names or convert them to lower case;
349instead, it uses the file names that you specify, verbatim. To enable
350long file name support, set the environment variable @env{LFN} to
351@samp{y} before starting Emacs. Unfortunately, Windows NT doesn't allow
352DOS programs to access long file names, so Emacs built for MS-DOS will
353only see their short 8+3 aliases.
354
355@cindex @env{HOME} directory under MS-DOS
356 MS-DOS has no notion of home directory, so Emacs on MS-DOS pretends
357that the directory where it is installed is the value of the @env{HOME}
358environment variable. That is, if your Emacs binary,
359@file{emacs.exe}, is in the directory @file{c:/utils/emacs/bin}, then
360Emacs acts as if @env{HOME} were set to @samp{c:/utils/emacs}. In
361particular, that is where Emacs looks for the init file @file{_emacs}.
362With this in mind, you can use @samp{~} in file names as an alias for
363the home directory, as you would on GNU or Unix. You can also set
364@env{HOME} variable in the environment before starting Emacs; its
365value will then override the above default behavior.
366
367 Emacs on MS-DOS handles the directory name @file{/dev} specially,
368because of a feature in the emulator libraries of DJGPP that pretends
369I/O devices have names in that directory. We recommend that you avoid
370using an actual directory named @file{/dev} on any disk.
371
372@node MS-DOS Printing
373@subsection Printing and MS-DOS
374
375 Printing commands, such as @code{lpr-buffer}
376@iftex
377(@pxref{Printing,,,emacs, the Emacs Manual}) and @code{ps-print-buffer}
378(@pxref{PostScript,,,emacs, the Emacs Manual})
379@end iftex
380@ifnottex
381(@pxref{Printing}) and @code{ps-print-buffer} (@pxref{PostScript})
382@end ifnottex
383can work on MS-DOS by sending the output to one of the printer ports,
384if a Posix-style @code{lpr} program is unavailable. The same Emacs
385variables control printing on all systems, but in some cases they have
386different default values on MS-DOS.
387
388@iftex
389@xref{Windows Printing,,,emacs, the Emacs Manual},
390@end iftex
391@ifnottex
392@xref{Windows Printing},
393@end ifnottex
394for details about setting up printing to a networked printer.
395
396 Some printers expect DOS codepage encoding of non-@acronym{ASCII} text, even
397though they are connected to a Windows machine which uses a different
398encoding for the same locale. For example, in the Latin-1 locale, DOS
399uses codepage 850 whereas Windows uses codepage 1252. @xref{MS-DOS and
400MULE}. When you print to such printers from Windows, you can use the
401@kbd{C-x RET c} (@code{universal-coding-system-argument}) command before
402@kbd{M-x lpr-buffer}; Emacs will then convert the text to the DOS
403codepage that you specify. For example, @kbd{C-x RET c cp850-dos RET
404M-x lpr-region RET} will print the region while converting it to the
405codepage 850 encoding. You may need to create the @code{cp@var{nnn}}
406coding system with @kbd{M-x codepage-setup}.
407
408@vindex dos-printer
409@vindex dos-ps-printer
410 For backwards compatibility, the value of @code{dos-printer}
411(@code{dos-ps-printer}), if it has a value, overrides the value of
412@code{printer-name} (@code{ps-printer-name}), on MS-DOS.
413
414
415@node MS-DOS and MULE
416@subsection International Support on MS-DOS
417@cindex international support @r{(MS-DOS)}
418
419 Emacs on MS-DOS supports the same international character sets as it
420does on GNU, Unix and other platforms
421@iftex
422(@pxref{International,,,emacs, the Emacs Manual}),
423@end iftex
424@ifnottex
425(@pxref{International}),
426@end ifnottex
427including coding systems for converting between the different
428character sets. However, due to incompatibilities between
429MS-DOS/MS-Windows and other systems, there are several DOS-specific
430aspects of this support that you should be aware of. This section
431describes these aspects.
432
433 The description below is largely specific to the MS-DOS port of
434Emacs, especially where it talks about practical implications for
435Emacs users. For other operating systems, see the @file{code-pages.el}
436package, which implements support for MS-DOS- and MS-Windows-specific
437encodings for all platforms other than MS-DOS.
438
439@table @kbd
440@item M-x dos-codepage-setup
441Set up Emacs display and coding systems as appropriate for the current
442DOS codepage.
443
444@item M-x codepage-setup
445Create a coding system for a certain DOS codepage.
446@end table
447
448@cindex codepage, MS-DOS
449@cindex DOS codepages
450 MS-DOS is designed to support one character set of 256 characters at
451any given time, but gives you a variety of character sets to choose
452from. The alternative character sets are known as @dfn{DOS codepages}.
453Each codepage includes all 128 @acronym{ASCII} characters, but the other 128
454characters (codes 128 through 255) vary from one codepage to another.
455Each DOS codepage is identified by a 3-digit number, such as 850, 862,
456etc.
457
458 In contrast to X, which lets you use several fonts at the same time,
459MS-DOS normally doesn't allow use of several codepages in a single
460session. MS-DOS was designed to load a single codepage at system
461startup, and require you to reboot in order to change
462it@footnote{Normally, one particular codepage is burnt into the
463display memory, while other codepages can be installed by modifying
464system configuration files, such as @file{CONFIG.SYS}, and rebooting.
465While there is third-party software that allows changing the codepage
466without rebooting, we describe here how a stock MS-DOS system
467behaves.}. Much the same limitation applies when you run DOS
468executables on other systems such as MS-Windows.
469
470@cindex unibyte operation @r{(MS-DOS)}
471 If you invoke Emacs on MS-DOS with the @samp{--unibyte} option
472@iftex
473(@pxref{Initial Options,,,emacs, the Emacs Manual}),
474@end iftex
475@ifnottex
476(@pxref{Initial Options}),
477@end ifnottex
478Emacs does not perform any conversion of non-@acronym{ASCII}
479characters. Instead, it reads and writes any non-@acronym{ASCII}
480characters verbatim, and sends their 8-bit codes to the display
481verbatim. Thus, unibyte Emacs on MS-DOS supports the current
482codepage, whatever it may be, but cannot even represent any other
483characters.
484
485@vindex dos-codepage
486 For multibyte operation on MS-DOS, Emacs needs to know which
487characters the chosen DOS codepage can display. So it queries the
488system shortly after startup to get the chosen codepage number, and
489stores the number in the variable @code{dos-codepage}. Some systems
490return the default value 437 for the current codepage, even though the
491actual codepage is different. (This typically happens when you use the
492codepage built into the display hardware.) You can specify a different
493codepage for Emacs to use by setting the variable @code{dos-codepage} in
494your init file.
495
496@cindex language environment, automatic selection on @r{MS-DOS}
497 Multibyte Emacs supports only certain DOS codepages: those which can
498display Far-Eastern scripts, like the Japanese codepage 932, and those
499that encode a single ISO 8859 character set.
500
501 The Far-Eastern codepages can directly display one of the MULE
502character sets for these countries, so Emacs simply sets up to use the
503appropriate terminal coding system that is supported by the codepage.
504The special features described in the rest of this section mostly
505pertain to codepages that encode ISO 8859 character sets.
506
507 For the codepages which correspond to one of the ISO character sets,
508Emacs knows the character set name based on the codepage number. Emacs
509automatically creates a coding system to support reading and writing
510files that use the current codepage, and uses this coding system by
511default. The name of this coding system is @code{cp@var{nnn}}, where
512@var{nnn} is the codepage number.@footnote{The standard Emacs coding
513systems for ISO 8859 are not quite right for the purpose, because
514typically the DOS codepage does not match the standard ISO character
515codes. For example, the letter @samp{@,{c}} (@samp{c} with cedilla) has
516code 231 in the standard Latin-1 character set, but the corresponding
517DOS codepage 850 uses code 135 for this glyph.}
518
519@cindex mode line @r{(MS-DOS)}
520 All the @code{cp@var{nnn}} coding systems use the letter @samp{D}
521(for ``DOS'') as their mode-line mnemonic. Since both the terminal
522coding system and the default coding system for file I/O are set to
523the proper @code{cp@var{nnn}} coding system at startup, it is normal
524for the mode line on MS-DOS to begin with @samp{-DD\-}.
525@iftex
526@xref{Mode Line,,,emacs, the Emacs Manual}.
527@end iftex
528@ifnottex
529@xref{Mode Line}.
530@end ifnottex
531Far-Eastern DOS terminals do not use the @code{cp@var{nnn}} coding
532systems, and thus their initial mode line looks like the Emacs
533default.
534
535 Since the codepage number also indicates which script you are using,
536Emacs automatically runs @code{set-language-environment} to select the
537language environment for that script
538@iftex
539(@pxref{Language Environments,,,emacs, the Emacs Manual}).
540@end iftex
541@ifnottex
542(@pxref{Language Environments}).
543@end ifnottex
544
545 If a buffer contains a character belonging to some other ISO 8859
546character set, not the one that the chosen DOS codepage supports, Emacs
547displays it using a sequence of @acronym{ASCII} characters. For example, if the
548current codepage doesn't have a glyph for the letter @samp{@`o} (small
549@samp{o} with a grave accent), it is displayed as @samp{@{`o@}}, where
550the braces serve as a visual indication that this is a single character.
551(This may look awkward for some non-Latin characters, such as those from
552Greek or Hebrew alphabets, but it is still readable by a person who
553knows the language.) Even though the character may occupy several
554columns on the screen, it is really still just a single character, and
555all Emacs commands treat it as one.
556
557@cindex IBM graphics characters (MS-DOS)
558@cindex box-drawing characters (MS-DOS)
559@cindex line-drawing characters (MS-DOS)
560 Not all characters in DOS codepages correspond to ISO 8859
561characters---some are used for other purposes, such as box-drawing
562characters and other graphics. Emacs maps these characters to two
563special character sets called @code{eight-bit-control} and
564@code{eight-bit-graphic}, and displays them as their IBM glyphs.
565However, you should be aware that other systems might display these
566characters differently, so you should avoid them in text that might be
567copied to a different operating system, or even to another DOS machine
568that uses a different codepage.
569
570@vindex dos-unsupported-character-glyph
571 Emacs supports many other characters sets aside from ISO 8859, but it
572cannot display them on MS-DOS. So if one of these multibyte characters
573appears in a buffer, Emacs on MS-DOS displays them as specified by the
574@code{dos-unsupported-character-glyph} variable; by default, this glyph
575is an empty triangle. Use the @kbd{C-u C-x =} command to display the
576actual code and character set of such characters.
577@iftex
578@xref{Position Info,,,emacs, the Emacs Manual}.
579@end iftex
580@ifnottex
581@xref{Position Info}.
582@end ifnottex
583
584@findex codepage-setup
585 By default, Emacs defines a coding system to support the current
586codepage. To define a coding system for some other codepage (e.g., to
587visit a file written on a DOS machine in another country), use the
588@kbd{M-x codepage-setup} command. It prompts for the 3-digit code of
589the codepage, with completion, then creates the coding system for the
590specified codepage. You can then use the new coding system to read and
591write files, but you must specify it explicitly for the file command
592when you want to use it
593@iftex
594(@pxref{Text Coding,,,emacs, the Emacs Manual}).
595@end iftex
596@ifnottex
597(@pxref{Text Coding}).
598@end ifnottex
599
600 These coding systems are also useful for visiting a file encoded using
601a DOS codepage, using Emacs running on some other operating system.
602
603@cindex MS-Windows codepages
604 MS-Windows provides its own codepages, which are different from the
605DOS codepages for the same locale. For example, DOS codepage 850
606supports the same character set as Windows codepage 1252; DOS codepage
607855 supports the same character set as Windows codepage 1251, etc.
608The MS-Windows version of Emacs uses the current codepage for display
609when invoked with the @samp{-nw} option. Support for codepages in the
610Windows port of Emacs is part of the @file{code-pages.el} package.
611
612@node MS-DOS Processes
613@subsection Subprocesses on MS-DOS
614
615@cindex compilation under MS-DOS
616@cindex inferior processes under MS-DOS
617@findex compile @r{(MS-DOS)}
618@findex grep @r{(MS-DOS)}
619 Because MS-DOS is a single-process ``operating system,''
620asynchronous subprocesses are not available. In particular, Shell
621mode and its variants do not work. Most Emacs features that use
622asynchronous subprocesses also don't work on MS-DOS, including
623Shell mode and GUD. When in doubt, try and see; commands that
624don't work output an error message saying that asynchronous processes
625aren't supported.
626
627 Compilation under Emacs with @kbd{M-x compile}, searching files with
628@kbd{M-x grep} and displaying differences between files with @kbd{M-x
629diff} do work, by running the inferior processes synchronously. This
630means you cannot do any more editing until the inferior process
631finishes.
632
633 Spell checking also works, by means of special support for synchronous
634invocation of the @code{ispell} program. This is slower than the
635asynchronous invocation on other platforms
636
637 Instead of the Shell mode, which doesn't work on MS-DOS, you can use
638the @kbd{M-x eshell} command. This invokes the Eshell package that
639implements a Posix-like shell entirely in Emacs Lisp.
640
641 By contrast, Emacs compiled as a native Windows application
642@strong{does} support asynchronous subprocesses.
643@iftex
644@xref{Windows Processes,,,emacs, the Emacs Manual}.
645@end iftex
646@ifnottex
647@xref{Windows Processes}.
648@end ifnottex
649
650@cindex printing under MS-DOS
651 Printing commands, such as @code{lpr-buffer}
652@iftex
653(@pxref{Printing,,,emacs, the Emacs Manual}) and
654@code{ps-print-buffer} (@pxref{PostScript,,,emacs, the Emacs Manual}),
655work in MS-DOS by sending the output to one of the printer ports.
656@xref{MS-DOS Printing,,,emacs, the Emacs Manual}.
657@end iftex
658@ifnottex
659(@pxref{Printing}) and @code{ps-print-buffer} (@pxref{PostScript}),
660work in MS-DOS by sending the output to one of the printer ports.
661@xref{MS-DOS Printing}.
662@end ifnottex
663
664 When you run a subprocess synchronously on MS-DOS, make sure the
665program terminates and does not try to read keyboard input. If the
666program does not terminate on its own, you will be unable to terminate
667it, because MS-DOS provides no general way to terminate a process.
668Pressing @kbd{C-c} or @kbd{C-@key{BREAK}} might sometimes help in these
669cases.
670
671 Accessing files on other machines is not supported on MS-DOS. Other
672network-oriented commands such as sending mail, Web browsing, remote
673login, etc., don't work either, unless network access is built into
674MS-DOS with some network redirector.
675
676@cindex directory listing on MS-DOS
677@vindex dired-listing-switches @r{(MS-DOS)}
678 Dired on MS-DOS uses the @code{ls-lisp} package where other
679platforms use the system @code{ls} command. Therefore, Dired on
680MS-DOS supports only some of the possible options you can mention in
681the @code{dired-listing-switches} variable. The options that work are
682@samp{-A}, @samp{-a}, @samp{-c}, @samp{-i}, @samp{-r}, @samp{-S},
683@samp{-s}, @samp{-t}, and @samp{-u}.
684
685@ignore
686 arch-tag: 868d50ff-07f8-4a13-a807-dab6f1cdb431
687@end ignore
diff --git a/man/msdog.texi b/man/msdog.texi
index 2f7cc229884..0dfb57ffdc9 100644
--- a/man/msdog.texi
+++ b/man/msdog.texi
@@ -2,8 +2,8 @@
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, 2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
3@c 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 3@c 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions. 4@c See file emacs.texi for copying conditions.
5@node Emacs and Microsoft Windows, Manifesto, Mac OS, Top 5@node Microsoft Windows, Manifesto, Mac OS, Top
6@appendix Emacs and Microsoft Windows 6@appendix Emacs and Microsoft Windows/MS-DOS
7@cindex Microsoft Windows 7@cindex Microsoft Windows
8@cindex MS-Windows, Emacs peculiarities 8@cindex MS-Windows, Emacs peculiarities
9 9
@@ -11,7 +11,14 @@
11Windows. Some of these peculiarities are also relevant to Microsoft's 11Windows. Some of these peculiarities are also relevant to Microsoft's
12older MS-DOS ``operating system'' (also known as ``MS-DOG''). 12older MS-DOS ``operating system'' (also known as ``MS-DOG'').
13However, Emacs features that are relevant @emph{only} to MS-DOS are 13However, Emacs features that are relevant @emph{only} to MS-DOS are
14described in a separate manual (@inforef{MS-DOG,, emacs-xtra}). 14described in a separate
15@iftex
16manual (@pxref{MS-DOS,,, emacs-xtra, Specialized Emacs Features}).
17@end iftex
18@ifnottex
19section (@pxref{MS-DOS}).
20@end ifnottex
21
15 22
16 The behavior of Emacs on MS-Windows is reasonably similar to what is 23 The behavior of Emacs on MS-Windows is reasonably similar to what is
17documented in the rest of the manual, including support for long file 24documented in the rest of the manual, including support for long file
@@ -20,12 +27,15 @@ However, a few special considerations apply, and they are described
20here. 27here.
21 28
22@menu 29@menu
23* Text and Binary:: Text files use CRLF to terminate lines. 30* Text and Binary:: Text files use CRLF to terminate lines.
24* Windows Files:: File-name conventions on Windows. 31* Windows Files:: File-name conventions on Windows.
25* Windows HOME:: Where Emacs looks for your @file{.emacs}. 32* Windows HOME:: Where Emacs looks for your @file{.emacs}.
26* Windows Processes:: Running subprocesses on Windows. 33* Windows Processes:: Running subprocesses on Windows.
27* Windows Printing:: How to specify the printer on MS-Windows. 34* Windows Printing:: How to specify the printer on MS-Windows.
28* Windows System Menu:: Controlling what the ALT key does. 35* Windows System Menu:: Controlling what the ALT key does.
36@ifnottex
37* MS-DOS:: Using Emacs on MS-DOS (otherwise known as @dfn{MS-DOG}).
38@end ifnottex
29@end menu 39@end menu
30 40
31@node Text and Binary 41@node Text and Binary
@@ -408,6 +418,10 @@ users find this frustrating.
408You can re-enable Windows' default handling of tapping the @key{ALT} key 418You can re-enable Windows' default handling of tapping the @key{ALT} key
409by setting @code{w32-pass-alt-to-system} to a non-@code{nil} value. 419by setting @code{w32-pass-alt-to-system} to a non-@code{nil} value.
410 420
421@ifnottex
422@include msdog-xtra.texi
423@end ifnottex
424
411@ignore 425@ignore
412 arch-tag: f39d2590-5dcc-4318-88d9-0eb73ca10fa2 426 arch-tag: f39d2590-5dcc-4318-88d9-0eb73ca10fa2
413@end ignore 427@end ignore
diff --git a/man/picture-xtra.texi b/man/picture-xtra.texi
new file mode 100644
index 00000000000..61ff949f448
--- /dev/null
+++ b/man/picture-xtra.texi
@@ -0,0 +1,291 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions.
4@c
5@c This file is included either in emacs-xtra.texi (when producing the
6@c printed version) or in the main Emacs manual (for the on-line version).
7@node Picture Mode
8@chapter Editing Pictures
9@cindex pictures
10@cindex making pictures out of text characters
11@findex edit-picture
12
13 To edit a picture made out of text characters (for example, a picture
14of the division of a register into fields, as a comment in a program),
15use the command @kbd{M-x edit-picture} to enter Picture mode.
16
17 In Picture mode, editing is based on the @dfn{quarter-plane} model of
18text, according to which the text characters lie studded on an area that
19stretches infinitely far to the right and downward. The concept of the end
20of a line does not exist in this model; the most you can say is where the
21last nonblank character on the line is found.
22
23 Of course, Emacs really always considers text as a sequence of
24characters, and lines really do have ends. But Picture mode replaces
25the most frequently-used commands with variants that simulate the
26quarter-plane model of text. They do this by inserting spaces or by
27converting tabs to spaces.
28
29 Most of the basic editing commands of Emacs are redefined by Picture mode
30to do essentially the same thing but in a quarter-plane way. In addition,
31Picture mode defines various keys starting with the @kbd{C-c} prefix to
32run special picture editing commands.
33
34 One of these keys, @kbd{C-c C-c}, is particularly important. Often a
35picture is part of a larger file that is usually edited in some other
36major mode. @kbd{M-x edit-picture} records the name of the previous
37major mode so you can use the @kbd{C-c C-c} command
38(@code{picture-mode-exit}) later to go back to that mode. @kbd{C-c C-c}
39also deletes spaces from the ends of lines, unless given a numeric
40argument.
41
42 The special commands of Picture mode all work in other modes (provided
43the @file{picture} library is loaded), but are not bound to keys except
44in Picture mode. The descriptions below talk of moving ``one column''
45and so on, but all the picture mode commands handle numeric arguments as
46their normal equivalents do.
47
48@vindex picture-mode-hook
49 Turning on Picture mode runs the hook @code{picture-mode-hook}.
50Additional extensions to Picture mode can be found in
51@file{artist.el}.
52
53@menu
54* Basic Picture:: Basic concepts and simple commands of Picture Mode.
55* Insert in Picture:: Controlling direction of cursor motion
56 after "self-inserting" characters.
57* Tabs in Picture:: Various features for tab stops and indentation.
58* Rectangles in Picture:: Clearing and superimposing rectangles.
59@end menu
60
61@node Basic Picture
62@section Basic Editing in Picture Mode
63
64@findex picture-forward-column
65@findex picture-backward-column
66@findex picture-move-down
67@findex picture-move-up
68@cindex editing in Picture mode
69
70 Most keys do the same thing in Picture mode that they usually do, but
71do it in a quarter-plane style. For example, @kbd{C-f} is rebound to
72run @code{picture-forward-column}, a command which moves point one
73column to the right, inserting a space if necessary so that the actual
74end of the line makes no difference. @kbd{C-b} is rebound to run
75@code{picture-backward-column}, which always moves point left one
76column, converting a tab to multiple spaces if necessary. @kbd{C-n} and
77@kbd{C-p} are rebound to run @code{picture-move-down} and
78@code{picture-move-up}, which can either insert spaces or convert tabs
79as necessary to make sure that point stays in exactly the same column.
80@kbd{C-e} runs @code{picture-end-of-line}, which moves to after the last
81nonblank character on the line. There is no need to change @kbd{C-a},
82as the choice of screen model does not affect beginnings of
83lines.
84
85@findex picture-newline
86 Insertion of text is adapted to the quarter-plane screen model
87through the use of Overwrite mode
88@iftex
89(@pxref{Minor Modes,,, emacs, the Emacs Manual}.)
90@end iftex
91@ifnottex
92(@pxref{Minor Modes}.)
93@end ifnottex
94Self-inserting characters replace existing text, column by column,
95rather than pushing existing text to the right. @key{RET} runs
96@code{picture-newline}, which just moves to the beginning of the
97following line so that new text will replace that line.
98
99@findex picture-backward-clear-column
100@findex picture-clear-column
101@findex picture-clear-line
102 In Picture mode, the commands that normally delete or kill text,
103instead erase text (replacing it with spaces). @key{DEL}
104(@code{picture-backward-clear-column}) replaces the preceding
105character with a space rather than removing it; this moves point
106backwards. @kbd{C-d} (@code{picture-clear-column}) replaces the next
107character or characters with spaces, but does not move point. (If you
108want to clear characters to spaces and move forward over them, use
109@key{SPC}.) @kbd{C-k} (@code{picture-clear-line}) really kills the
110contents of lines, but does not delete the newlines from the buffer.
111
112@findex picture-open-line
113 To do actual insertion, you must use special commands. @kbd{C-o}
114(@code{picture-open-line}) creates a blank line after the current
115line; it never splits a line. @kbd{C-M-o} (@code{split-line}) makes
116sense in Picture mode, so it is not changed. @kbd{C-j}
117(@code{picture-duplicate-line}) inserts another line with the same
118contents below the current line.
119
120@kindex C-c C-d @r{(Picture mode)}
121 To do actual deletion in Picture mode, use @kbd{C-w}, @kbd{C-c C-d}
122(which is defined as @code{delete-char}, as @kbd{C-d} is in other
123modes), or one of the picture rectangle commands (@pxref{Rectangles in
124Picture}).
125
126@node Insert in Picture
127@section Controlling Motion after Insert
128
129@findex picture-movement-up
130@findex picture-movement-down
131@findex picture-movement-left
132@findex picture-movement-right
133@findex picture-movement-nw
134@findex picture-movement-ne
135@findex picture-movement-sw
136@findex picture-movement-se
137@kindex C-c < @r{(Picture mode)}
138@kindex C-c > @r{(Picture mode)}
139@kindex C-c ^ @r{(Picture mode)}
140@kindex C-c . @r{(Picture mode)}
141@kindex C-c ` @r{(Picture mode)}
142@kindex C-c ' @r{(Picture mode)}
143@kindex C-c / @r{(Picture mode)}
144@kindex C-c \ @r{(Picture mode)}
145 Since ``self-inserting'' characters in Picture mode overwrite and move
146point, there is no essential restriction on how point should be moved.
147Normally point moves right, but you can specify any of the eight
148orthogonal or diagonal directions for motion after a ``self-inserting''
149character. This is useful for drawing lines in the buffer.
150
151@table @kbd
152@item C-c <
153@itemx C-c @key{LEFT}
154Move left after insertion (@code{picture-movement-left}).
155@item C-c >
156@itemx C-c @key{RIGHT}
157Move right after insertion (@code{picture-movement-right}).
158@item C-c ^
159@itemx C-c @key{UP}
160Move up after insertion (@code{picture-movement-up}).
161@item C-c .
162@itemx C-c @key{DOWN}
163Move down after insertion (@code{picture-movement-down}).
164@item C-c `
165@itemx C-c @key{HOME}
166Move up and left (``northwest'') after insertion (@code{picture-movement-nw}).
167@item C-c '
168@itemx C-c @key{PAGEUP}
169Move up and right (``northeast'') after insertion
170(@code{picture-movement-ne}).
171@item C-c /
172@itemx C-c @key{END}
173Move down and left (``southwest'') after insertion
174@*(@code{picture-movement-sw}).
175@item C-c \
176@itemx C-c @key{PAGEDOWN}
177Move down and right (``southeast'') after insertion
178@*(@code{picture-movement-se}).
179@end table
180
181@kindex C-c C-f @r{(Picture mode)}
182@kindex C-c C-b @r{(Picture mode)}
183@findex picture-motion
184@findex picture-motion-reverse
185 Two motion commands move based on the current Picture insertion
186direction. The command @kbd{C-c C-f} (@code{picture-motion}) moves in the
187same direction as motion after ``insertion'' currently does, while @kbd{C-c
188C-b} (@code{picture-motion-reverse}) moves in the opposite direction.
189
190@node Tabs in Picture
191@section Picture Mode Tabs
192
193@kindex M-TAB @r{(Picture mode)}
194@findex picture-tab-search
195@vindex picture-tab-chars
196 Two kinds of tab-like action are provided in Picture mode. Use
197@kbd{M-@key{TAB}} (@code{picture-tab-search}) for context-based tabbing.
198With no argument, it moves to a point underneath the next
199``interesting'' character that follows whitespace in the previous
200nonblank line. ``Next'' here means ``appearing at a horizontal position
201greater than the one point starts out at.'' With an argument, as in
202@kbd{C-u M-@key{TAB}}, this command moves to the next such interesting
203character in the current line. @kbd{M-@key{TAB}} does not change the
204text; it only moves point. ``Interesting'' characters are defined by
205the variable @code{picture-tab-chars}, which should define a set of
206characters. The syntax for this variable is like the syntax used inside
207of @samp{[@dots{}]} in a regular expression---but without the @samp{[}
208and the @samp{]}. Its default value is @code{"!-~"}.
209
210@findex picture-tab
211 @key{TAB} itself runs @code{picture-tab}, which operates based on the
212current tab stop settings; it is the Picture mode equivalent of
213@code{tab-to-tab-stop}. Normally it just moves point, but with a numeric
214argument it clears the text that it moves over.
215
216@kindex C-c TAB @r{(Picture mode)}
217@findex picture-set-tab-stops
218 The context-based and tab-stop-based forms of tabbing are brought
219together by the command @kbd{C-c @key{TAB}} (@code{picture-set-tab-stops}).
220This command sets the tab stops to the positions which @kbd{M-@key{TAB}}
221would consider significant in the current line. The use of this command,
222together with @key{TAB}, can get the effect of context-based tabbing. But
223@kbd{M-@key{TAB}} is more convenient in the cases where it is sufficient.
224
225 It may be convenient to prevent use of actual tab characters in
226pictures. For example, this prevents @kbd{C-x @key{TAB}} from messing
227up the picture. You can do this by setting the variable
228@code{indent-tabs-mode} to @code{nil}.
229
230@node Rectangles in Picture
231@section Picture Mode Rectangle Commands
232@cindex rectangles and Picture mode
233@cindex Picture mode and rectangles
234
235 Picture mode defines commands for working on rectangular pieces of
236the text in ways that fit with the quarter-plane model. The standard
237rectangle commands may also be useful.
238@iftex
239@xref{Rectangles,,, emacs, the Emacs Manual}.
240@end iftex
241@ifnottex
242@xref{Rectangles}.
243@end ifnottex
244
245@table @kbd
246@item C-c C-k
247Clear out the region-rectangle with spaces
248(@code{picture-clear-rectangle}). With argument, delete the text.
249@item C-c C-w @var{r}
250Similar, but save rectangle contents in register @var{r} first
251(@code{picture-clear-rectangle-to-register}).
252@item C-c C-y
253Copy last killed rectangle into the buffer by overwriting, with upper
254left corner at point (@code{picture-yank-rectangle}). With argument,
255insert instead.
256@item C-c C-x @var{r}
257Similar, but use the rectangle in register @var{r}
258(@code{picture-yank-rectangle-from-register}).
259@end table
260
261@kindex C-c C-k @r{(Picture mode)}
262@kindex C-c C-w @r{(Picture mode)}
263@findex picture-clear-rectangle
264@findex picture-clear-rectangle-to-register
265 The picture rectangle commands @kbd{C-c C-k}
266(@code{picture-clear-rectangle}) and @kbd{C-c C-w}
267(@code{picture-clear-rectangle-to-register}) differ from the standard
268rectangle commands in that they normally clear the rectangle instead of
269deleting it; this is analogous with the way @kbd{C-d} is changed in Picture
270mode.
271
272 However, deletion of rectangles can be useful in Picture mode, so
273these commands delete the rectangle if given a numeric argument.
274@kbd{C-c C-k} either with or without a numeric argument saves the
275rectangle for @kbd{C-c C-y}.
276
277@kindex C-c C-y @r{(Picture mode)}
278@kindex C-c C-x @r{(Picture mode)}
279@findex picture-yank-rectangle
280@findex picture-yank-rectangle-from-register
281 The Picture mode commands for yanking rectangles differ from the
282standard ones in that they overwrite instead of inserting. This is
283the same way that Picture mode insertion of other text differs from
284other modes. @kbd{C-c C-y} (@code{picture-yank-rectangle}) inserts
285(by overwriting) the rectangle that was most recently killed, while
286@kbd{C-c C-x} (@code{picture-yank-rectangle-from-register}) does
287likewise for the rectangle found in a specified register.
288
289@ignore
290 arch-tag: 10e423ad-d896-42f2-a7e8-7018adeaf8c2
291@end ignore
diff --git a/man/programs.texi b/man/programs.texi
index 59ea979399d..f4ede8e5e2f 100644
--- a/man/programs.texi
+++ b/man/programs.texi
@@ -42,6 +42,9 @@ Highlight program syntax (@pxref{Font Lock}).
42* C Modes:: Special commands of C, C++, Objective-C, 42* C Modes:: Special commands of C, C++, Objective-C,
43 Java, and Pike modes. 43 Java, and Pike modes.
44* Asm Mode:: Asm mode and its special features. 44* Asm Mode:: Asm mode and its special features.
45@ifnottex
46* Fortran:: Fortran mode and its special features.
47@end ifnottex
45@end menu 48@end menu
46 49
47@node Program Modes 50@node Program Modes
@@ -109,7 +112,14 @@ tab character before point, in these modes.
109Mode, ada-mode, Ada Mode}), C/C++/Objective C/Java/Corba IDL/Pike/AWK 112Mode, ada-mode, Ada Mode}), C/C++/Objective C/Java/Corba IDL/Pike/AWK
110(@pxref{Top, , CC Mode, ccmode, CC Mode}) and the IDLWAVE modes 113(@pxref{Top, , CC Mode, ccmode, CC Mode}) and the IDLWAVE modes
111(@pxref{Top, , IDLWAVE, idlwave, IDLWAVE User Manual}). For Fortran 114(@pxref{Top, , IDLWAVE, idlwave, IDLWAVE User Manual}). For Fortran
112mode, @inforef{Fortran,, emacs-xtra}. 115mode, see
116@iftex
117@ref{Fortran,,, emacs-xtra, Specialized Emacs Features}.
118@end iftex
119@ifnottex
120@ref{Fortran}.
121@end ifnottex
122
113 123
114@cindex mode hook 124@cindex mode hook
115@vindex c-mode-hook 125@vindex c-mode-hook
@@ -1591,7 +1601,7 @@ hungry-delete feature is enabled.
1591@itemx M-x c-subword-mode 1601@itemx M-x c-subword-mode
1592@findex c-subword-mode 1602@findex c-subword-mode
1593Enable (or disable) @dfn{subword mode}. In subword mode, Emacs's word 1603Enable (or disable) @dfn{subword mode}. In subword mode, Emacs's word
1594commands then recognize upper case letters in 1604commands recognize upper case letters in
1595@samp{StudlyCapsIdentifiers} as word boundaries. This is indicated by 1605@samp{StudlyCapsIdentifiers} as word boundaries. This is indicated by
1596the flag @samp{/w} on the mode line after the mode name 1606the flag @samp{/w} on the mode line after the mode name
1597(e.g. @samp{C/law}). You can even use @kbd{M-x c-subword-mode} in 1607(e.g. @samp{C/law}). You can even use @kbd{M-x c-subword-mode} in
@@ -1742,6 +1752,10 @@ Insert or align a comment.
1742 The variable @code{asm-comment-char} specifies which character 1752 The variable @code{asm-comment-char} specifies which character
1743starts comments in assembler syntax. 1753starts comments in assembler syntax.
1744 1754
1755@ifnottex
1756@include fortran-xtra.texi
1757@end ifnottex
1758
1745@ignore 1759@ignore
1746 arch-tag: c7ee7409-40a4-45c7-bfb7-ae7f2c74d0c0 1760 arch-tag: c7ee7409-40a4-45c7-bfb7-ae7f2c74d0c0
1747@end ignore 1761@end ignore
diff --git a/man/screen.texi b/man/screen.texi
index 72ed3261f01..b1b37be6239 100644
--- a/man/screen.texi
+++ b/man/screen.texi
@@ -24,8 +24,8 @@ be a @dfn{tool bar}, a row of icons that perform editing commands if
24you click on them. Below this, the window begins, often with a 24you click on them. Below this, the window begins, often with a
25@dfn{scroll bar} on one side. Below the window comes the last line of 25@dfn{scroll bar} on one side. Below the window comes the last line of
26the frame, a special @dfn{echo area} or @dfn{minibuffer window}, where 26the frame, a special @dfn{echo area} or @dfn{minibuffer window}, where
27prompts appear and where you enter information when Emacs asks for it. 27prompts appear and you enter information when Emacs asks for it. See
28See following sections for more information about these special lines. 28following sections for more information about these special lines.
29 29
30 You can subdivide the window horizontally or vertically to make 30 You can subdivide the window horizontally or vertically to make
31multiple text windows, each of which can independently display some 31multiple text windows, each of which can independently display some
@@ -34,22 +34,22 @@ refers to the initial large window if not subdivided, or any one of
34the multiple windows you have subdivided it into. 34the multiple windows you have subdivided it into.
35 35
36 At any time, one window is the @dfn{selected window}. On graphical 36 At any time, one window is the @dfn{selected window}. On graphical
37terminals, the selected window normally shows a more prominent cursor 37displays, the selected window normally shows a more prominent cursor
38(usually solid and blinking) while other windows show a weaker cursor 38(usually solid and blinking) while other windows show a weaker cursor
39(such as a hollow box). On text terminals, which have just one 39(such as a hollow box). Text terminals have just one cursor, so it
40cursor, that cursor always appears in the selected window. 40always appears in the selected window.
41 41
42 Most Emacs commands implicitly apply to the text in the selected 42 Most Emacs commands implicitly apply to the text in the selected
43window (though mouse commands generally operate on whatever window you 43window; the text in unselected windows is mostly visible for
44click them in, whether selected or not). The text in other windows is 44reference. However, mouse commands generally operate on whatever
45mostly visible for reference, unless/until you select them. If you 45window you click them in, whether selected or not. If you use
46use multiple frames on a graphical display, then giving the input 46multiple frames on a graphical display, then giving the input focus to
47focus to a particular frame selects a window in that frame. 47a particular frame selects a window in that frame.
48 48
49 Each window's last line is a @dfn{mode line}, which describes what 49 Each window's last line is a @dfn{mode line}, which describes what
50is going on in that window. It appears in different color and/or a 50is going on in that window. It appears in different color and/or a ``3D''
51``3D'' box, if the terminal supports that; its contents normally begin 51box if the terminal supports them; its contents normally begin with
52with @w{@samp{--:-- @ *scratch*}} when Emacs starts. The mode line 52@w{@samp{--:-- @ *scratch*}} when Emacs starts. The mode line
53displays status information such as what buffer is being displayed 53displays status information such as what buffer is being displayed
54above it in the window, what major and minor modes are in use, and 54above it in the window, what major and minor modes are in use, and
55whether the buffer contains unsaved changes. 55whether the buffer contains unsaved changes.
@@ -89,18 +89,17 @@ each buffer has its own point location. A buffer that is not
89currently displayed remembers its point location in case you display 89currently displayed remembers its point location in case you display
90it again later. When Emacs displays multiple windows, each window has 90it again later. When Emacs displays multiple windows, each window has
91its own point location. If the same buffer appears in more than one 91its own point location. If the same buffer appears in more than one
92window, each window has its own position for point in that buffer, and 92window, each window has its own point position in that buffer, and (when
93(when possible) its own cursor. 93possible) its own cursor.
94 94
95 A text-only terminal has just one cursor, so Emacs puts it 95 A text-only terminal has just one cursor, in the selected window.
96in the selected window. The other windows do not show a cursor, even 96The other windows do not show a cursor, even though they do have their
97though they do have a location of point. When Emacs updates the 97own position of point. When Emacs updates the screen on a text-only
98screen on a text-only terminal, it has to put the cursor temporarily 98terminal, it has to put the cursor temporarily at the place the output
99at the place the output goes. This doesn't mean point is there, 99goes. This doesn't mean point is there, though. Once display
100though. Once display updating finishes, Emacs puts the cursor where 100updating finishes, Emacs puts the cursor where point is.
101point is. 101
102 102 On graphical displays, Emacs shows a cursor in each window; the
103 On graphical terminals, Emacs shows a cursor in each window; the
104selected window's cursor is solid and blinking, and the other cursors 103selected window's cursor is solid and blinking, and the other cursors
105are just hollow. Thus, the most prominent cursor always shows you the 104are just hollow. Thus, the most prominent cursor always shows you the
106selected window, on all kinds of terminals. 105selected window, on all kinds of terminals.
@@ -165,18 +164,19 @@ that appears briefly on the screen, you can switch to the
165are often collapsed into one in that buffer.) 164are often collapsed into one in that buffer.)
166 165
167@vindex message-log-max 166@vindex message-log-max
168 The size of @samp{*Messages*} is limited to a certain number of lines. 167 The size of @samp{*Messages*} is limited to a certain number of
169The variable @code{message-log-max} specifies how many lines. Once the 168lines. The variable @code{message-log-max} specifies how many lines.
170buffer has that many lines, each line added at the end deletes one line 169Once the buffer has that many lines, adding lines at the end deletes lines
171from the beginning. @xref{Variables}, for how to set variables such as 170from the beginning, to keep the size constant. @xref{Variables}, for
172@code{message-log-max}. 171how to set variables such as @code{message-log-max}.
173 172
174 The echo area is also used to display the @dfn{minibuffer}, a window that 173 The echo area is also used to display the @dfn{minibuffer}, a window
175is used for reading arguments to commands, such as the name of a file to be 174where you can input arguments to commands, such as the name of a file
176edited. When the minibuffer is in use, the echo area begins with a prompt 175to be edited. When the minibuffer is in use, the echo area begins
177string that usually ends with a colon; also, the cursor appears in that line 176with a prompt string that usually ends with a colon; also, the cursor
178because it is the selected window. You can always get out of the 177appears in that line because it is the selected window. You can
179minibuffer by typing @kbd{C-g}. @xref{Minibuffer}. 178always get out of the minibuffer by typing @kbd{C-g}.
179@xref{Minibuffer}.
180 180
181@node Mode Line 181@node Mode Line
182@section The Mode Line 182@section The Mode Line
@@ -188,11 +188,11 @@ minibuffer by typing @kbd{C-g}. @xref{Minibuffer}.
188what is going on in that window. The mode line starts and ends with 188what is going on in that window. The mode line starts and ends with
189dashes. When there is only one text window, the mode line appears 189dashes. When there is only one text window, the mode line appears
190right above the echo area; it is the next-to-last line in the frame. 190right above the echo area; it is the next-to-last line in the frame.
191On a text-mode display, the mode line is in inverse video if the 191On a text-only terminal, the mode line is in inverse video if the
192terminal supports that; on a graphics display, the mode line has a 3D 192terminal supports that; on a graphics display, the mode line has a 3D
193box appearance to help it stand out. The mode line of the selected 193box appearance to help it stand out. The mode line of the selected
194window has a slightly different appearance than those of other 194window is highlighted if possible; see @ref{Optional Mode Line}, for
195windows; see @ref{Optional Mode Line}, for more about this. 195more information.
196 196
197 Normally, the mode line looks like this: 197 Normally, the mode line looks like this:
198 198
@@ -201,26 +201,26 @@ windows; see @ref{Optional Mode Line}, for more about this.
201@end example 201@end example
202 202
203@noindent 203@noindent
204This gives information about the buffer being displayed in the window: the 204This gives information about the window and the buffer it displays: the
205buffer's name, what major and minor modes are in use, whether the buffer's 205buffer's name, what major and minor modes are in use, whether the
206text has been changed, and how far down the buffer you are currently 206buffer's text has been changed, and how far down the buffer you are
207looking. 207currently looking.
208 208
209 @var{ch} contains two stars @samp{**} if the text in the buffer has 209 @var{ch} contains two stars @samp{**} if the text in the buffer has
210been edited (the buffer is ``modified''), or @samp{--} if the buffer has 210been edited (the buffer is ``modified''), or @samp{--} if the buffer has
211not been edited. For a read-only buffer, it is @samp{%*} if the buffer 211not been edited. For a read-only buffer, it is @samp{%*} if the buffer
212is modified, and @samp{%%} otherwise. 212is modified, and @samp{%%} otherwise.
213 213
214 @var{fr} appears only on text-only terminals, to show the selected 214 @var{fr} gives the selected frame name (@pxref{Frames}). It appears
215frame name. @xref{Frames}. The initial frame's name is @samp{F1}. 215only on text-only terminals. The initial frame's name is @samp{F1}.
216 216
217 @var{buf} is the name of the window's @dfn{buffer}. In most cases 217 @var{buf} is the name of the window's @dfn{buffer}. Usually this is
218this is the same as the name of a file you are editing. @xref{Buffers}. 218the same as the name of a file you are editing. @xref{Buffers}.
219 219
220 The buffer displayed in the selected window (the window that the 220 The buffer displayed in the selected window (the window with the
221cursor is in) is the @dfn{current buffer}--the one that editing takes 221cursor) is the @dfn{current buffer}, where editing happens. When a
222place in. When we speak of what some command does to ``the buffer,'' 222command's effect applies to ``the buffer,'' we mean it does those
223we mean it does those things to the current buffer. 223things to the current buffer.
224 224
225 @var{pos} tells you whether there is additional text above the top of 225 @var{pos} tells you whether there is additional text above the top of
226the window, or below the bottom. If your buffer is small and it is all 226the window, or below the bottom. If your buffer is small and it is all
@@ -232,17 +232,17 @@ With Size Indication mode, you can display the size of the buffer as
232well. @xref{Optional Mode Line}. 232well. @xref{Optional Mode Line}.
233 233
234 @var{line} is @samp{L} followed by the current line number of point. 234 @var{line} is @samp{L} followed by the current line number of point.
235This is present when Line Number mode is enabled (which it normally is). 235This is present when Line Number mode is enabled (it normally is).
236You can optionally display the current column number too, by turning on 236You can display the current column number too, by turning on Column
237Column Number mode (which is not enabled by default because it is 237Number mode. It is not enabled by default because it is somewhat
238somewhat slower). @xref{Optional Mode Line}. 238slower. @xref{Optional Mode Line}.
239 239
240 @var{major} is the name of the @dfn{major mode} in effect in the 240 @var{major} is the name of the @dfn{major mode} in effect in the
241buffer. At any time, each buffer is in one and only one of the possible 241buffer. A buffer can only be in one major mode at a time. The major
242major modes. The major modes available include Fundamental mode (the 242modes available include Fundamental mode (the least specialized), Text
243least specialized), Text mode, Lisp mode, C mode, Texinfo mode, and many 243mode, Lisp mode, C mode, Texinfo mode, and many others. @xref{Major
244others. @xref{Major Modes}, for details of how the modes differ and how 244Modes}, for details of how the modes differ and how to select
245to select one.@refill 245them.
246 246
247 Some major modes display additional information after the major mode 247 Some major modes display additional information after the major mode
248name. For example, Rmail buffers display the current message number and 248name. For example, Rmail buffers display the current message number and
@@ -253,14 +253,15 @@ display the status of the subprocess.
253turned on at the moment in the window's chosen buffer. For example, 253turned on at the moment in the window's chosen buffer. For example,
254@samp{Fill} means that Auto Fill mode is on. @samp{Abbrev} means that 254@samp{Fill} means that Auto Fill mode is on. @samp{Abbrev} means that
255Word Abbrev mode is on. @samp{Ovwrt} means that Overwrite mode is on. 255Word Abbrev mode is on. @samp{Ovwrt} means that Overwrite mode is on.
256@xref{Minor Modes}, for more information. @samp{Narrow} means that 256@xref{Minor Modes}, for more information.
257the buffer being displayed has editing restricted to only a portion of 257
258its text. (This is not really a minor mode, but is like one.) 258 @samp{Narrow} means that the buffer being displayed has editing
259@xref{Narrowing}. @samp{Def} means that a keyboard macro is being 259restricted to only a portion of its text. (This is not really a minor
260defined. @xref{Keyboard Macros}. 260mode, but is like one.) @xref{Narrowing}. @samp{Def} means that a
261 261keyboard macro is being defined. @xref{Keyboard Macros}.
262 In addition, if Emacs is currently inside a recursive editing level, 262
263square brackets (@samp{[@dots{}]}) appear around the parentheses that 263 In addition, if Emacs is inside a recursive editing level, square
264brackets (@samp{[@dots{}]}) appear around the parentheses that
264surround the modes. If Emacs is in one recursive editing level within 265surround the modes. If Emacs is in one recursive editing level within
265another, double square brackets appear, and so on. Since recursive 266another, double square brackets appear, and so on. Since recursive
266editing levels affect Emacs globally, not just one buffer, the square 267editing levels affect Emacs globally, not just one buffer, the square
@@ -288,22 +289,21 @@ identifies the input method. (Some input methods show @samp{+} or
288all. @xref{Enabling Multibyte}. 289all. @xref{Enabling Multibyte}.
289 290
290@cindex end-of-line conversion, mode-line indication 291@cindex end-of-line conversion, mode-line indication
291 The colon after @var{cs} can change to another string in certain 292 The colon after @var{cs} changes to another string in some cases.
292circumstances. Emacs uses newline characters to separate lines in the buffer. 293Emacs uses newline characters to separate lines in the buffer. Some
293Some files use different conventions for separating lines: either 294files use different conventions for separating lines: either
294carriage-return linefeed (the MS-DOS convention) or just carriage-return 295carriage-return linefeed (the MS-DOS convention) or just
295(the Macintosh convention). If the buffer's file uses carriage-return 296carriage-return (the Macintosh convention). If the buffer's file uses
296linefeed, the colon changes to either a backslash (@samp{\}) or 297carriage-return linefeed, the colon changes to either a backslash
297@samp{(DOS)}, depending on the operating system. If the file uses just 298(@samp{\}) or @samp{(DOS)}, depending on the operating system. If the
298carriage-return, the colon indicator changes to either a forward slash 299file uses just carriage-return, the colon indicator changes to either
299(@samp{/}) or @samp{(Mac)}. On some systems, Emacs displays 300a forward slash (@samp{/}) or @samp{(Mac)}. On some systems, Emacs
300@samp{(Unix)} instead of the colon even for files that use newline to 301displays @samp{(Unix)} instead of the colon for files that use newline
301separate lines. 302as the line separator.
302 303
303 @xref{Optional Mode Line}, for features that add other handy 304 @xref{Optional Mode Line}, to add other handy information to the
304information to the mode line, such as the size of the buffer, the 305mode line, such as the size of the buffer, the current column number
305current column number of point, and whether new mail for you has 306of point, and whether new mail for you has arrived.
306arrived.
307 307
308 The mode line is mouse-sensitive; when you move the mouse across 308 The mode line is mouse-sensitive; when you move the mouse across
309various parts of it, Emacs displays help text to say what a click in 309various parts of it, Emacs displays help text to say what a click in
@@ -314,17 +314,17 @@ that place will do. @xref{Mode Line Mouse}.
314@cindex menu bar 314@cindex menu bar
315 315
316 Each Emacs frame normally has a @dfn{menu bar} at the top which you 316 Each Emacs frame normally has a @dfn{menu bar} at the top which you
317can use to perform certain common operations. There's no need to list 317can use to perform common operations. There's no need to list them
318them here, as you can more easily see for yourself. 318here, as you can more easily see them yourself.
319 319
320@kindex M-` 320@kindex M-`
321@kindex F10 321@kindex F10
322@findex tmm-menubar 322@findex tmm-menubar
323 On a graphical terminal, you can use the mouse to choose a command 323 On a graphical display, you can use the mouse to choose a command
324from the menu bar. An arrow pointing right, after the menu item, 324from the menu bar. A right-arrow at the end of the menu item means it
325indicates that the item leads to a subsidiary menu; @samp{...} at the 325leads to a subsidiary menu; @samp{...} at the end means that the
326end means that the command will read arguments (further input from 326command invoked will read arguments (further input from you) before it
327you) before it actually does anything. 327actually does anything.
328 328
329 To view the full command name and documentation for a menu item, type 329 To view the full command name and documentation for a menu item, type
330@kbd{C-h k}, and then select the menu bar with the mouse in the usual 330@kbd{C-h k}, and then select the menu bar with the mouse in the usual
@@ -332,11 +332,10 @@ way (@pxref{Key Help}).
332 332
333 On text-only terminals with no mouse, you can use the menu bar by 333 On text-only terminals with no mouse, you can use the menu bar by
334typing @kbd{M-`} or @key{F10} (these run the command 334typing @kbd{M-`} or @key{F10} (these run the command
335@code{tmm-menubar}). This command enters a mode in which you can select 335@code{tmm-menubar}). This lets you select a menu item with the
336a menu item from the keyboard. A provisional choice appears in the echo 336keyboard. A provisional choice appears in the echo area. You can use
337area. You can use the up and down arrow keys to move through the 337the up and down arrow keys to move through the menu to different
338menu to different choices. When you have found the choice you want, 338items, and then you can type @key{RET} to select the item.
339type @key{RET} to select it.
340 339
341 Each menu item also has an assigned letter or digit which designates 340 Each menu item also has an assigned letter or digit which designates
342that item; it is usually the initial of some word in the item's name. 341that item; it is usually the initial of some word in the item's name.
@@ -344,8 +343,7 @@ This letter or digit is separated from the item name by @samp{=>}. You
344can type the item's letter or digit to select the item. 343can type the item's letter or digit to select the item.
345 344
346 Some of the commands in the menu bar have ordinary key bindings as 345 Some of the commands in the menu bar have ordinary key bindings as
347well; if so, the menu lists one equivalent key binding in parentheses 346well; one such binding is shown in parentheses after the item itself.
348after the item itself.
349 347
350@ignore 348@ignore
351 arch-tag: 104ba40e-d972-4866-a542-a98be94bdf2f 349 arch-tag: 104ba40e-d972-4866-a542-a98be94bdf2f
diff --git a/man/sending.texi b/man/sending.texi
index 0c0c249ba5d..df2ccd962a0 100644
--- a/man/sending.texi
+++ b/man/sending.texi
@@ -2,7 +2,7 @@
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, 2002, 2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, 2002,
3@c 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 3@c 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions. 4@c See file emacs.texi for copying conditions.
5@node Sending Mail, Rmail, Abbrevs, Top 5@node Sending Mail
6@chapter Sending Mail 6@chapter Sending Mail
7@cindex sending mail 7@cindex sending mail
8@cindex mail 8@cindex mail
diff --git a/man/texinfo.tex b/man/texinfo.tex
index 7ed20f016b1..fcddd268999 100644
--- a/man/texinfo.tex
+++ b/man/texinfo.tex
@@ -3,7 +3,7 @@
3% Load plain if necessary, i.e., if running under initex. 3% Load plain if necessary, i.e., if running under initex.
4\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi 4\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
5% 5%
6\def\texinfoversion{2006-03-21.13} 6\def\texinfoversion{2006-05-07.15}
7% 7%
8% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, 8% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
9% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free 9% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
@@ -1237,9 +1237,10 @@ where each line of input produces a line of output.}
1237\ifpdf 1237\ifpdf
1238 \input pdfcolor 1238 \input pdfcolor
1239 \pdfcatalog{/PageMode /UseOutlines}% 1239 \pdfcatalog{/PageMode /UseOutlines}%
1240 % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
1240 \def\dopdfimage#1#2#3{% 1241 \def\dopdfimage#1#2#3{%
1241 \def\imagewidth{#2}% 1242 \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
1242 \def\imageheight{#3}% 1243 \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
1243 % without \immediate, pdftex seg faults when the same image is 1244 % without \immediate, pdftex seg faults when the same image is
1244 % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) 1245 % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
1245 \ifnum\pdftexversion < 14 1246 \ifnum\pdftexversion < 14
@@ -1247,8 +1248,8 @@ where each line of input produces a line of output.}
1247 \else 1248 \else
1248 \immediate\pdfximage 1249 \immediate\pdfximage
1249 \fi 1250 \fi
1250 \ifx\empty\imagewidth\else width \imagewidth \fi 1251 \ifdim \wd0 >0pt width \imagewidth \fi
1251 \ifx\empty\imageheight\else height \imageheight \fi 1252 \ifdim \wd2 >0pt height \imageheight \fi
1252 \ifnum\pdftexversion<13 1253 \ifnum\pdftexversion<13
1253 #1.pdf% 1254 #1.pdf%
1254 \else 1255 \else
@@ -1471,6 +1472,7 @@ where each line of input produces a line of output.}
1471% We don't need math for this font style. 1472% We don't need math for this font style.
1472\def\ttsl{\setfontstyle{ttsl}} 1473\def\ttsl{\setfontstyle{ttsl}}
1473 1474
1475
1474% Default leading. 1476% Default leading.
1475\newdimen\textleading \textleading = 13.2pt 1477\newdimen\textleading \textleading = 13.2pt
1476 1478
@@ -1492,11 +1494,13 @@ where each line of input produces a line of output.}
1492 }% 1494 }%
1493} 1495}
1494 1496
1497
1495% Set the font macro #1 to the font named #2, adding on the 1498% Set the font macro #1 to the font named #2, adding on the
1496% specified font prefix (normally `cm'). 1499% specified font prefix (normally `cm').
1497% #3 is the font's design size, #4 is a scale factor 1500% #3 is the font's design size, #4 is a scale factor
1498\def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4} 1501\def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}
1499 1502
1503
1500% Use cm as the default font prefix. 1504% Use cm as the default font prefix.
1501% To specify the font prefix, you must define \fontprefix 1505% To specify the font prefix, you must define \fontprefix
1502% before you read in texinfo.tex. 1506% before you read in texinfo.tex.
@@ -1520,6 +1524,10 @@ where each line of input produces a line of output.}
1520\def\scshape{csc} 1524\def\scshape{csc}
1521\def\scbshape{csc} 1525\def\scbshape{csc}
1522 1526
1527% Definitions for a main text size of 11pt. This is the default in
1528% Texinfo.
1529%
1530\def\definetextfontsizexi{
1523% Text fonts (11.2pt, magstep1). 1531% Text fonts (11.2pt, magstep1).
1524\def\textnominalsize{11pt} 1532\def\textnominalsize{11pt}
1525\edef\mainmagstep{\magstephalf} 1533\edef\mainmagstep{\magstephalf}
@@ -1633,6 +1641,165 @@ where each line of input produces a line of output.}
1633\font\reducedi=cmmi10 1641\font\reducedi=cmmi10
1634\font\reducedsy=cmsy10 1642\font\reducedsy=cmsy10
1635 1643
1644% reset the current fonts
1645\textfonts
1646\rm
1647} % end of 11pt text font size definitions
1648
1649
1650% Definitions to make the main text be 10pt Computer Modern, with
1651% section, chapter, etc., sizes following suit. This is for the GNU
1652% Press printing of the Emacs 22 manual. Maybe other manuals in the
1653% future. Used with @smallbook, which sets the leading to 12pt.
1654%
1655\def\definetextfontsizex{%
1656% Text fonts (10pt).
1657\def\textnominalsize{10pt}
1658\edef\mainmagstep{1000}
1659\setfont\textrm\rmshape{10}{\mainmagstep}
1660\setfont\texttt\ttshape{10}{\mainmagstep}
1661\setfont\textbf\bfshape{10}{\mainmagstep}
1662\setfont\textit\itshape{10}{\mainmagstep}
1663\setfont\textsl\slshape{10}{\mainmagstep}
1664\setfont\textsf\sfshape{10}{\mainmagstep}
1665\setfont\textsc\scshape{10}{\mainmagstep}
1666\setfont\textttsl\ttslshape{10}{\mainmagstep}
1667\font\texti=cmmi10 scaled \mainmagstep
1668\font\textsy=cmsy10 scaled \mainmagstep
1669
1670% A few fonts for @defun names and args.
1671\setfont\defbf\bfshape{10}{\magstephalf}
1672\setfont\deftt\ttshape{10}{\magstephalf}
1673\setfont\defttsl\ttslshape{10}{\magstephalf}
1674\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
1675
1676% Fonts for indices, footnotes, small examples (9pt).
1677\def\smallnominalsize{9pt}
1678\setfont\smallrm\rmshape{9}{1000}
1679\setfont\smalltt\ttshape{9}{1000}
1680\setfont\smallbf\bfshape{10}{900}
1681\setfont\smallit\itshape{9}{1000}
1682\setfont\smallsl\slshape{9}{1000}
1683\setfont\smallsf\sfshape{9}{1000}
1684\setfont\smallsc\scshape{10}{900}
1685\setfont\smallttsl\ttslshape{10}{900}
1686\font\smalli=cmmi9
1687\font\smallsy=cmsy9
1688
1689% Fonts for small examples (8pt).
1690\def\smallernominalsize{8pt}
1691\setfont\smallerrm\rmshape{8}{1000}
1692\setfont\smallertt\ttshape{8}{1000}
1693\setfont\smallerbf\bfshape{10}{800}
1694\setfont\smallerit\itshape{8}{1000}
1695\setfont\smallersl\slshape{8}{1000}
1696\setfont\smallersf\sfshape{8}{1000}
1697\setfont\smallersc\scshape{10}{800}
1698\setfont\smallerttsl\ttslshape{10}{800}
1699\font\smalleri=cmmi8
1700\font\smallersy=cmsy8
1701
1702% Fonts for title page (20.4pt):
1703\def\titlenominalsize{20pt}
1704\setfont\titlerm\rmbshape{12}{\magstep3}
1705\setfont\titleit\itbshape{10}{\magstep4}
1706\setfont\titlesl\slbshape{10}{\magstep4}
1707\setfont\titlett\ttbshape{12}{\magstep3}
1708\setfont\titlettsl\ttslshape{10}{\magstep4}
1709\setfont\titlesf\sfbshape{17}{\magstep1}
1710\let\titlebf=\titlerm
1711\setfont\titlesc\scbshape{10}{\magstep4}
1712\font\titlei=cmmi12 scaled \magstep3
1713\font\titlesy=cmsy10 scaled \magstep4
1714\def\authorrm{\secrm}
1715\def\authortt{\sectt}
1716
1717% Chapter fonts (14.4pt).
1718\def\chapnominalsize{14pt}
1719\setfont\chaprm\rmbshape{12}{\magstep1}
1720\setfont\chapit\itbshape{10}{\magstep2}
1721\setfont\chapsl\slbshape{10}{\magstep2}
1722\setfont\chaptt\ttbshape{12}{\magstep1}
1723\setfont\chapttsl\ttslshape{10}{\magstep2}
1724\setfont\chapsf\sfbshape{12}{\magstep1}
1725\let\chapbf\chaprm
1726\setfont\chapsc\scbshape{10}{\magstep2}
1727\font\chapi=cmmi12 scaled \magstep1
1728\font\chapsy=cmsy10 scaled \magstep2
1729
1730% Section fonts (12pt).
1731\def\secnominalsize{12pt}
1732\setfont\secrm\rmbshape{12}{1000}
1733\setfont\secit\itbshape{10}{\magstep1}
1734\setfont\secsl\slbshape{10}{\magstep1}
1735\setfont\sectt\ttbshape{12}{1000}
1736\setfont\secttsl\ttslshape{10}{\magstep1}
1737\setfont\secsf\sfbshape{12}{1000}
1738\let\secbf\secrm
1739\setfont\secsc\scbshape{10}{\magstep1}
1740\font\seci=cmmi12
1741\font\secsy=cmsy10 scaled \magstep1
1742
1743% Subsection fonts (10pt).
1744\def\ssecnominalsize{10pt}
1745\setfont\ssecrm\rmbshape{10}{1000}
1746\setfont\ssecit\itbshape{10}{1000}
1747\setfont\ssecsl\slbshape{10}{1000}
1748\setfont\ssectt\ttbshape{10}{1000}
1749\setfont\ssecttsl\ttslshape{10}{1000}
1750\setfont\ssecsf\sfbshape{10}{1000}
1751\let\ssecbf\ssecrm
1752\setfont\ssecsc\scbshape{10}{1000}
1753\font\sseci=cmmi10
1754\font\ssecsy=cmsy10
1755
1756% Reduced fonts for @acro in text (9pt).
1757\def\reducednominalsize{9pt}
1758\setfont\reducedrm\rmshape{9}{1000}
1759\setfont\reducedtt\ttshape{9}{1000}
1760\setfont\reducedbf\bfshape{10}{900}
1761\setfont\reducedit\itshape{9}{1000}
1762\setfont\reducedsl\slshape{9}{1000}
1763\setfont\reducedsf\sfshape{9}{1000}
1764\setfont\reducedsc\scshape{10}{900}
1765\setfont\reducedttsl\ttslshape{10}{900}
1766\font\reducedi=cmmi9
1767\font\reducedsy=cmsy9
1768
1769% reduce space between paragraphs
1770\divide\parskip by 2
1771
1772% reset the current fonts
1773\textfonts
1774\rm
1775} % end of 10pt text font size definitions
1776
1777
1778% We provide the user-level command
1779% @fonttextsize 10
1780% (or 11) to redefine the text font size. pt is assumed.
1781%
1782\def\xword{10}
1783\def\xiword{11}
1784%
1785\parseargdef\fonttextsize{%
1786 \def\textsizearg{#1}%
1787 \wlog{doing @fonttextsize \textsizearg}%
1788 %
1789 % Set \globaldefs so that documents can use this inside @tex, since
1790 % makeinfo 4.8 does not support it, but we need it nonetheless.
1791 %
1792 \begingroup \globaldefs=1
1793 \ifx\textsizearg\xword \definetextfontsizex
1794 \else \ifx\textsizearg\xiword \definetextfontsizexi
1795 \else
1796 \errhelp=\EMsimple
1797 \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
1798 \fi\fi
1799 \endgroup
1800}
1801
1802
1636% In order for the font changes to affect most math symbols and letters, 1803% In order for the font changes to affect most math symbols and letters,
1637% we have to define the \textfont of the standard families. Since 1804% we have to define the \textfont of the standard families. Since
1638% texinfo doesn't allow for producing subscripts and superscripts except 1805% texinfo doesn't allow for producing subscripts and superscripts except
@@ -1743,7 +1910,7 @@ where each line of input produces a line of output.}
1743 1910
1744% Set up the default fonts, so we can use them for creating boxes. 1911% Set up the default fonts, so we can use them for creating boxes.
1745% 1912%
1746\textfonts \rm 1913\definetextfontsizexi
1747 1914
1748% Define these so they can be easily changed for other fonts. 1915% Define these so they can be easily changed for other fonts.
1749\def\angleleft{$\langle$} 1916\def\angleleft{$\langle$}
diff --git a/man/text.texi b/man/text.texi
index 97e6aa50338..f9b1d312453 100644
--- a/man/text.texi
+++ b/man/text.texi
@@ -55,7 +55,13 @@ Then the formatting appears on the screen in Emacs while you edit.
55 If you need to edit pictures made out of text characters (commonly 55 If you need to edit pictures made out of text characters (commonly
56referred to as ``ASCII art''), use @kbd{M-x edit-picture} to enter 56referred to as ``ASCII art''), use @kbd{M-x edit-picture} to enter
57Picture mode, a special major mode for editing such pictures. 57Picture mode, a special major mode for editing such pictures.
58@inforef{Picture Mode,, emacs-xtra}. 58@iftex
59@xref{Picture Mode,,, emacs-xtra, Specialized Emacs Features}.
60@end iftex
61@ifnottex
62@xref{Picture Mode}.
63@end ifnottex
64
59 65
60@cindex skeletons 66@cindex skeletons
61@cindex templates 67@cindex templates
diff --git a/man/tramp.texi b/man/tramp.texi
index 89773534096..acee8ce7321 100644
--- a/man/tramp.texi
+++ b/man/tramp.texi
@@ -1831,9 +1831,15 @@ should you want to add your own.
1831@section Filename completion 1831@section Filename completion
1832@cindex filename completion 1832@cindex filename completion
1833 1833
1834Filename completion works with @value{tramp} for both completing methods, 1834Filename completion works with @value{tramp} for completion of method
1835user names and machine names (except multi hop methods) as well as for 1835names, of user names and of machine names (except multi-hop methods)
1836files on remote machines. 1836as well as for completion of file names on remote machines.
1837@ifset emacs
1838In order to enable this, Partial Completion mode must be set on.
1839@ifinfo
1840@xref{Completion Options, , , @value{emacsdir}}.
1841@end ifinfo
1842@end ifset
1837 1843
1838If you, for example, type @kbd{C-x C-f @value{prefix}t 1844If you, for example, type @kbd{C-x C-f @value{prefix}t
1839@key{TAB}}, @value{tramp} might give you as result the choice for 1845@key{TAB}}, @value{tramp} might give you as result the choice for
diff --git a/man/trouble.texi b/man/trouble.texi
index f44862598c4..9e09dac4d43 100644
--- a/man/trouble.texi
+++ b/man/trouble.texi
@@ -58,8 +58,14 @@ Search}).
58like @kbd{C-g}. The reason is that it is not feasible, on MS-DOS, to 58like @kbd{C-g}. The reason is that it is not feasible, on MS-DOS, to
59recognize @kbd{C-g} while a command is running, between interactions 59recognize @kbd{C-g} while a command is running, between interactions
60with the user. By contrast, it @emph{is} feasible to recognize 60with the user. By contrast, it @emph{is} feasible to recognize
61@kbd{C-@key{BREAK}} at all times. @xref{MS-DOS Keyboard,,,emacs-xtra, 61@kbd{C-@key{BREAK}} at all times.
62Specialized Emacs Features}. 62@iftex
63@xref{MS-DOS Keyboard,,,emacs-xtra, Specialized Emacs Features}.
64@end iftex
65@ifnottex
66@xref{MS-DOS Keyboard}.
67@end ifnottex
68
63 69
64@findex keyboard-quit 70@findex keyboard-quit
65 @kbd{C-g} works by setting the variable @code{quit-flag} to @code{t} 71 @kbd{C-g} works by setting the variable @code{quit-flag} to @code{t}
@@ -381,9 +387,9 @@ subsequent @kbd{C-g} invokes emergency escape again.
381answer @kbd{n} to both questions, and you will get back to the former 387answer @kbd{n} to both questions, and you will get back to the former
382state. The quit you requested will happen by and by. 388state. The quit you requested will happen by and by.
383 389
384 Emergency escape is active only for text terminals. On a graphical 390 Emergency escape is active only for text terminals. On graphical
385display that supports multiple windows, you can use the window manager 391displays, you can use the mouse to kill Emacs or switch to another
386to kill Emacs, or to switch to some other program. 392program.
387 393
388 On MS-DOS, you must type @kbd{C-@key{BREAK}} (twice) to cause 394 On MS-DOS, you must type @kbd{C-@key{BREAK}} (twice) to cause
389emergency escape---but there are cases where it won't work, when 395emergency escape---but there are cases where it won't work, when
diff --git a/man/vc-xtra.texi b/man/vc-xtra.texi
new file mode 100644
index 00000000000..6e8985b2e39
--- /dev/null
+++ b/man/vc-xtra.texi
@@ -0,0 +1,32 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions.
4@c
5@c This file is included in emacs-xtra.texi when producing the printed
6@c version.
7@iftex
8@node Advanced VC Usage
9@section Advanced VC Usage
10
11 Commonly used features of Emacs' version control (VC) support are
12described in the main Emacs manual (@pxref{Version Control,,,emacs,
13the Emacs Manual}). This chapter describes more advanced VC usage.
14
15@menu
16* VC Dired Mode:: Listing files managed by version control.
17* VC Dired Commands:: Commands to use in a VC Dired buffer.
18* Remote Repositories:: Efficient access to remote CVS servers.
19* Snapshots:: Sets of file versions treated as a unit.
20* Miscellaneous VC:: Various other commands and features of VC.
21* Customizing VC:: Variables that change VC's behavior.
22@end menu
23@end iftex
24
25@iftex
26@include vc1-xtra.texi
27@include vc2-xtra.texi
28@end iftex
29
30@ignore
31 arch-tag: 11a18d0e-1baf-49da-8e38-f61195ae4dc3
32@end ignore
diff --git a/man/vc1-xtra.texi b/man/vc1-xtra.texi
new file mode 100644
index 00000000000..16edf79a3bd
--- /dev/null
+++ b/man/vc1-xtra.texi
@@ -0,0 +1,151 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions.
4@c
5@c This file is included either in vc-xtra.texi (when producing the
6@c printed version) or in the main Emacs manual (for the on-line version).
7@node VC Dired Mode
8@subsection Dired under VC
9
10@cindex PCL-CVS
11@pindex cvs
12@cindex CVS Dired Mode
13 The VC Dired Mode described here works with all the version control
14systems that VC supports. Another more powerful facility, designed
15specifically for CVS, is called PCL-CVS. @xref{Top, , About PCL-CVS,
16pcl-cvs, PCL-CVS --- The Emacs Front-End to CVS}.
17
18@kindex C-x v d
19@findex vc-directory
20 When you are working on a large program, it is often useful to find
21out which files have changed within an entire directory tree, or to view
22the status of all files under version control at once, and to perform
23version control operations on collections of files. You can use the
24command @kbd{C-x v d} (@code{vc-directory}) to make a directory listing
25that includes only files relevant for version control.
26
27@vindex vc-dired-terse-display
28 @kbd{C-x v d} creates a buffer which uses VC Dired Mode. This looks
29much like an ordinary Dired buffer
30@iftex
31(@pxref{Dired,,,emacs, the Emacs Manual});
32@end iftex
33@ifnottex
34(@pxref{Dired});
35@end ifnottex
36however, normally it shows only the noteworthy files (those locked or
37not up-to-date). This is called @dfn{terse display}. If you set the
38variable @code{vc-dired-terse-display} to @code{nil}, then VC Dired
39shows all relevant files---those managed under version control, plus
40all subdirectories (@dfn{full display}). The command @kbd{v t} in a
41VC Dired buffer toggles between terse display and full display
42(@pxref{VC Dired Commands}).
43
44@vindex vc-dired-recurse
45 By default, VC Dired produces a recursive listing of noteworthy or
46relevant files at or below the given directory. You can change this by
47setting the variable @code{vc-dired-recurse} to @code{nil}; then VC
48Dired shows only the files in the given directory.
49
50 The line for an individual file shows the version control state in the
51place of the hard link count, owner, group, and size of the file. If
52the file is unmodified, in sync with the master file, the version
53control state shown is blank. Otherwise it consists of text in
54parentheses. Under RCS and SCCS, the name of the user locking the file
55is shown; under CVS, an abbreviated version of the @samp{cvs status}
56output is used. Here is an example using RCS:
57
58@smallexample
59@group
60 /home/jim/project:
61
62 -rw-r--r-- (jim) Apr 2 23:39 file1
63 -r--r--r-- Apr 5 20:21 file2
64@end group
65@end smallexample
66
67@noindent
68The files @samp{file1} and @samp{file2} are under version control,
69@samp{file1} is locked by user jim, and @samp{file2} is unlocked.
70
71 Here is an example using CVS:
72
73@smallexample
74@group
75 /home/joe/develop:
76
77 -rw-r--r-- (modified) Aug 2 1997 file1.c
78 -rw-r--r-- Apr 4 20:09 file2.c
79 -rw-r--r-- (merge) Sep 13 1996 file3.c
80@end group
81@end smallexample
82
83 Here @samp{file1.c} is modified with respect to the repository, and
84@samp{file2.c} is not. @samp{file3.c} is modified, but other changes
85have also been checked in to the repository---you need to merge them
86with the work file before you can check it in.
87
88@vindex vc-stay-local
89@vindex vc-cvs-stay-local
90 In the above, if the repository were on a remote machine, VC would
91only contact it when the variable @code{vc-stay-local} (or
92@code{vc-cvs-stay-local}) is nil (@pxref{CVS Options}). This is
93because access to the repository may be slow, or you may be working
94offline and not have access to the repository at all. As a
95consequence, VC would not be able to tell you that @samp{file3.c} is
96in the ``merge'' state; you would learn that only when you try to
97check-in your modified copy of the file, or use a command such as
98@kbd{C-x v m}.
99
100 In practice, this is not a problem because CVS handles this case
101consistently whenever it arises. In VC, you'll simply get prompted to
102merge the remote changes into your work file first. The benefits of
103less network communication usually outweigh the disadvantage of not
104seeing remote changes immediately.
105
106@vindex vc-directory-exclusion-list
107 When VC Dired displays subdirectories (in the ``full'' display mode),
108it omits some that should never contain any files under version control.
109By default, this includes Version Control subdirectories such as
110@samp{RCS} and @samp{CVS}; you can customize this by setting the
111variable @code{vc-directory-exclusion-list}.
112
113 You can fine-tune VC Dired's format by typing @kbd{C-u C-x v d}---as in
114ordinary Dired, that allows you to specify additional switches for the
115@samp{ls} command.
116
117@node VC Dired Commands
118@subsection VC Dired Commands
119
120 All the usual Dired commands work normally in VC Dired mode, except
121for @kbd{v}, which is redefined as the version control prefix. You can
122invoke VC commands such as @code{vc-diff} and @code{vc-print-log} by
123typing @kbd{v =}, or @kbd{v l}, and so on. Most of these commands apply
124to the file name on the current line.
125
126 The command @kbd{v v} (@code{vc-next-action}) operates on all the
127marked files, so that you can lock or check in several files at once.
128If it operates on more than one file, it handles each file according to
129its current state; thus, it might lock one file, but check in another
130file. This could be confusing; it is up to you to avoid confusing
131behavior by marking a set of files that are in a similar state. If no
132files are marked, @kbd{v v} operates on the file in the current line.
133
134 If any files call for check-in, @kbd{v v} reads a single log entry,
135then uses it for all the files being checked in. This is convenient for
136registering or checking in several files at once, as part of the same
137change.
138
139@findex vc-dired-toggle-terse-mode
140@findex vc-dired-mark-locked
141 You can toggle between terse display (only locked files, or files not
142up-to-date) and full display at any time by typing @kbd{v t}
143(@code{vc-dired-toggle-terse-mode}). There is also a special command
144@kbd{* l} (@code{vc-dired-mark-locked}), which marks all files currently
145locked (or, with CVS, all files not up-to-date). Thus, typing @kbd{* l
146t k} is another way to delete from the buffer all files except those
147currently locked.
148
149@ignore
150 arch-tag: 8e8c2a01-ad41-4e61-a89a-60131ad67263
151@end ignore
diff --git a/man/vc2-xtra.texi b/man/vc2-xtra.texi
new file mode 100644
index 00000000000..14b8bc9fb07
--- /dev/null
+++ b/man/vc2-xtra.texi
@@ -0,0 +1,789 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions.
4@c
5@c This file is included either in vc-xtra.texi (when producing the
6@c printed version) or in the main Emacs manual (for the on-line version).
7@node Remote Repositories
8@subsection Remote Repositories
9@cindex remote repositories (CVS)
10
11 A common way of using CVS is to set up a central CVS repository on
12some Internet host, then have each developer check out a personal
13working copy of the files on his local machine. Committing changes to
14the repository, and picking up changes from other users into one's own
15working area, then works by direct interactions with the CVS server.
16
17 One difficulty is that access to the CVS server is often slow, and
18that developers might need to work off-line as well. VC is designed
19to reduce the amount of network interaction necessary.
20
21@menu
22* Version Backups:: Keeping local copies of repository versions.
23* Local Version Control:: Using another version system for local editing.
24@end menu
25
26@node Version Backups
27@subsubsection Version Backups
28@cindex version backups
29
30@cindex automatic version backups
31 When VC sees that the CVS repository for a file is on a remote
32machine, it automatically makes local backups of unmodified versions
33of the file---@dfn{automatic version backups}. This means that you
34can compare the file to the repository version (@kbd{C-x v =}), or
35revert to that version (@kbd{C-x v u}), without any network
36interactions.
37
38 The local copy of the unmodified file is called a @dfn{version
39backup} to indicate that it corresponds exactly to a version that is
40stored in the repository. Note that version backups are not the same
41as ordinary Emacs backup files
42@iftex
43(@pxref{Backup,,,emacs, the Emacs Manual}).
44@end iftex
45@ifnottex
46(@pxref{Backup}).
47@end ifnottex
48But they follow a similar naming convention.
49
50 For a file that comes from a remote CVS repository, VC makes a
51version backup whenever you save the first changes to the file, and
52removes it after you have committed your modified version to the
53repository. You can disable the making of automatic version backups by
54setting @code{vc-cvs-stay-local} to @code{nil} (@pxref{CVS Options}).
55
56@cindex manual version backups
57 The name of the automatic version backup for version @var{version}
58of file @var{file} is @code{@var{file}.~@var{version}.~}. This is
59almost the same as the name used by @kbd{C-x v ~}
60@iftex
61(@pxref{Old Versions,,,emacs, the Emacs Manual}),
62@end iftex
63@ifnottex
64(@pxref{Old Versions}),
65@end ifnottex
66the only difference being the additional dot (@samp{.}) after the
67version number. This similarity is intentional, because both kinds of
68files store the same kind of information. The file made by @kbd{C-x v
69~} acts as a @dfn{manual version backup}.
70
71 All the VC commands that operate on old versions of a file can use
72both kinds of version backups. For instance, @kbd{C-x v ~} uses
73either an automatic or a manual version backup, if possible, to get
74the contents of the version you request. Likewise, @kbd{C-x v =} and
75@kbd{C-x v u} use either an automatic or a manual version backup, if
76one of them exists, to get the contents of a version to compare or
77revert to. If you changed a file outside of Emacs, so that no
78automatic version backup was created for the previous text, you can
79create a manual backup of that version using @kbd{C-x v ~}, and thus
80obtain the benefit of the local copy for Emacs commands.
81
82 The only difference in Emacs's handling of manual and automatic
83version backups, once they exist, is that Emacs deletes automatic
84version backups when you commit to the repository. By contrast,
85manual version backups remain until you delete them.
86
87@node Local Version Control
88@subsubsection Local Version Control
89@cindex local version control
90@cindex local back end (version control)
91
92When you make many changes to a file that comes from a remote
93repository, it can be convenient to have version control on your local
94machine as well. You can then record intermediate versions, revert to
95a previous state, etc., before you actually commit your changes to the
96remote server.
97
98VC lets you do this by putting a file under a second, local version
99control system, so that the file is effectively registered in two
100systems at the same time. For the description here, we will assume
101that the remote system is CVS, and you use RCS locally, although the
102mechanism works with any combination of version control systems
103(@dfn{back ends}).
104
105To make it work with other back ends, you must make sure that the
106``more local'' back end comes before the ``more remote'' back end in
107the setting of @code{vc-handled-backends} (@pxref{Customizing VC}). By
108default, this variable is set up so that you can use remote CVS and
109local RCS as described here.
110
111To start using local RCS for a file that comes from a remote CVS
112server, you must @emph{register the file in RCS}, by typing @kbd{C-u
113C-x v v rcs @key{RET}}. (In other words, use @code{vc-next-action} with a
114prefix argument, and specify RCS as the back end.)
115
116You can do this at any time; it does not matter whether you have
117already modified the file with respect to the version in the CVS
118repository. If possible, VC tries to make the RCS master start with
119the unmodified repository version, then checks in any local changes
120as a new version. This works if you have not made any changes yet, or
121if the unmodified repository version exists locally as a version
122backup (@pxref{Version Backups}). If the unmodified version is not
123available locally, the RCS master starts with the modified version;
124the only drawback to this is that you cannot compare your changes
125locally to what is stored in the repository.
126
127The version number of the RCS master is derived from the current CVS
128version, starting a branch from it. For example, if the current CVS
129version is 1.23, the local RCS branch will be 1.23.1. Version 1.23 in
130the RCS master will be identical to version 1.23 under CVS; your first
131changes are checked in as 1.23.1.1. (If the unmodified file is not
132available locally, VC will check in the modified file twice, both as
1331.23 and 1.23.1.1, to make the revision numbers consistent.)
134
135If you do not use locking under CVS (the default), locking is also
136disabled for RCS, so that editing under RCS works exactly as under
137CVS.
138
139When you are done with local editing, you can commit the final version
140back to the CVS repository by typing @kbd{C-u C-x v v cvs @key{RET}}.
141This initializes the log entry buffer
142@iftex
143(@pxref{Log Buffer,,,emacs, the Emacs Manual})
144@end iftex
145@ifnottex
146(@pxref{Log Buffer})
147@end ifnottex
148to contain all the log entries you have recorded in the RCS master;
149you can edit them as you wish, and then commit in CVS by typing
150@kbd{C-c C-c}. If the commit is successful, VC removes the RCS
151master, so that the file is once again registered under CVS only.
152(The RCS master is not actually deleted, just renamed by appending
153@samp{~} to the name, so that you can refer to it later if you wish.)
154
155While using local RCS, you can pick up recent changes from the CVS
156repository into your local file, or commit some of your changes back
157to CVS, without terminating local RCS version control. To do this,
158switch to the CVS back end temporarily, with the @kbd{C-x v b} command:
159
160@table @kbd
161@item C-x v b
162Switch to another back end that the current file is registered
163under (@code{vc-switch-backend}).
164
165@item C-u C-x v b @var{backend} @key{RET}
166Switch to @var{backend} for the current file.
167@end table
168
169@kindex C-x v b
170@findex vc-switch-backend
171@kbd{C-x v b} does not change the buffer contents, or any files; it
172only changes VC's perspective on how to handle the file. Any
173subsequent VC commands for that file will operate on the back end that
174is currently selected.
175
176If the current file is registered in more than one back end, typing
177@kbd{C-x v b} ``cycles'' through all of these back ends. With a
178prefix argument, it asks for the back end to use in the minibuffer.
179
180Thus, if you are using local RCS, and you want to pick up some recent
181changes in the file from remote CVS, first visit the file, then type
182@kbd{C-x v b} to switch to CVS, and finally use @kbd{C-x v m
183@key{RET}} to merge the news
184@iftex
185(@pxref{Merging,,,emacs, the Emacs Manual}).
186@end iftex
187@ifnottex
188(@pxref{Merging}).
189@end ifnottex
190You can then switch back to RCS by typing @kbd{C-x v b} again, and
191continue to edit locally.
192
193But if you do this, the revision numbers in the RCS master no longer
194correspond to those of CVS. Technically, this is not a problem, but
195it can become difficult to keep track of what is in the CVS repository
196and what is not. So we suggest that you return from time to time to
197CVS-only operation, by committing your local changes back to the
198repository using @kbd{C-u C-x v v cvs @key{RET}}.
199
200@node Snapshots
201@subsection Snapshots
202@cindex snapshots and version control
203
204 A @dfn{snapshot} is a named set of file versions (one for each
205registered file) that you can treat as a unit. One important kind of
206snapshot is a @dfn{release}, a (theoretically) stable version of the
207system that is ready for distribution to users.
208
209@menu
210* Making Snapshots:: The snapshot facilities.
211* Snapshot Caveats:: Things to be careful of when using snapshots.
212@end menu
213
214@node Making Snapshots
215@subsubsection Making and Using Snapshots
216
217 There are two basic commands for snapshots; one makes a
218snapshot with a given name, the other retrieves a named snapshot.
219
220@table @code
221@kindex C-x v s
222@findex vc-create-snapshot
223@item C-x v s @var{name} @key{RET}
224Define the last saved versions of every registered file in or under the
225current directory as a snapshot named @var{name}
226(@code{vc-create-snapshot}).
227
228@kindex C-x v r
229@findex vc-retrieve-snapshot
230@item C-x v r @var{name} @key{RET}
231For all registered files at or below the current directory level, select
232whatever versions correspond to the snapshot @var{name}
233(@code{vc-retrieve-snapshot}).
234
235This command reports an error if any files are locked at or below the
236current directory, without changing anything; this is to avoid
237overwriting work in progress.
238@end table
239
240 A snapshot uses a very small amount of resources---just enough to record
241the list of file names and which version belongs to the snapshot. Thus,
242you need not hesitate to create snapshots whenever they are useful.
243
244 You can give a snapshot name as an argument to @kbd{C-x v =} or
245@kbd{C-x v ~}
246@iftex
247(@pxref{Old Versions,,,emacs, the Emacs Manual}).
248@end iftex
249@ifnottex
250(@pxref{Old Versions}).
251@end ifnottex
252Thus, you can use it to compare a snapshot against the current files,
253or two snapshots against each other, or a snapshot against a named
254version.
255
256@node Snapshot Caveats
257@subsubsection Snapshot Caveats
258
259@cindex named configurations (RCS)
260 VC's snapshot facilities are modeled on RCS's named-configuration
261support. They use RCS's native facilities for this, so
262snapshots made using RCS through VC are visible even when you bypass VC.
263
264 With CVS, Meta-CVS, and Subversion, VC also uses the native
265mechanism provided by that back end to make snapshots and retrieve them
266(@dfn{tags} for CVS and Meta-CVS, @dfn{copies} for Subversion).
267
268@c worded verbosely to avoid overfull hbox.
269 For SCCS, VC implements snapshots itself. The files it uses contain
270name/file/version-number triples. These snapshots are visible only
271through VC.
272
273 There is no support for VC snapshots using GNU Arch yet.
274
275 A snapshot is a set of checked-in versions. So make sure that all the
276files are checked in and not locked when you make a snapshot.
277
278 File renaming and deletion can create some difficulties with snapshots.
279This is not a VC-specific problem, but a general design issue in version
280control systems that no one has solved very well yet.
281
282 If you rename a registered file, you need to rename its master along
283with it (the command @code{vc-rename-file} does this automatically). If
284you are using SCCS, you must also update the records of the snapshot, to
285mention the file by its new name (@code{vc-rename-file} does this,
286too). An old snapshot that refers to a master file that no longer
287exists under the recorded name is invalid; VC can no longer retrieve
288it. It would be beyond the scope of this manual to explain enough about
289RCS and SCCS to explain how to update the snapshots by hand.
290
291 Using @code{vc-rename-file} makes the snapshot remain valid for
292retrieval, but it does not solve all problems. For example, some of the
293files in your program probably refer to others by name. At the very
294least, the makefile probably mentions the file that you renamed. If you
295retrieve an old snapshot, the renamed file is retrieved under its new
296name, which is not the name that the makefile expects. So the program
297won't really work as retrieved.
298
299@node Miscellaneous VC
300@subsection Miscellaneous Commands and Features of VC
301
302 This section explains the less-frequently-used features of VC.
303
304@menu
305* Change Logs and VC:: Generating a change log file from log entries.
306* Renaming and VC:: A command to rename both the source and master
307 file correctly.
308* Version Headers:: Inserting version control headers into working files.
309@end menu
310
311@node Change Logs and VC
312@subsubsection Change Logs and VC
313
314 If you use RCS or CVS for a program and also maintain a change log
315file for it
316@iftex
317(@pxref{Change Log,,,emacs, the Emacs Manual}),
318@end iftex
319@ifnottex
320(@pxref{Change Log}),
321@end ifnottex
322you can generate change log entries automatically from the version
323control log entries:
324
325@table @kbd
326@item C-x v a
327@kindex C-x v a
328@findex vc-update-change-log
329Visit the current directory's change log file and, for registered files
330in that directory, create new entries for versions checked in since the
331most recent entry in the change log file.
332(@code{vc-update-change-log}).
333
334This command works with RCS or CVS only, not with any of the other
335back ends.
336
337@item C-u C-x v a
338As above, but only find entries for the current buffer's file.
339
340@item M-1 C-x v a
341As above, but find entries for all the currently visited files that are
342maintained with version control. This works only with RCS, and it puts
343all entries in the log for the default directory, which may not be
344appropriate.
345@end table
346
347 For example, suppose the first line of @file{ChangeLog} is dated
3481999-04-10, and that the only check-in since then was by Nathaniel
349Bowditch to @file{rcs2log} on 1999-05-22 with log text @samp{Ignore log
350messages that start with `#'.}. Then @kbd{C-x v a} visits
351@file{ChangeLog} and inserts text like this:
352
353@iftex
354@medbreak
355@end iftex
356@smallexample
357@group
3581999-05-22 Nathaniel Bowditch <nat@@apn.org>
359
360 * rcs2log: Ignore log messages that start with `#'.
361@end group
362@end smallexample
363@iftex
364@medbreak
365@end iftex
366
367@noindent
368You can then edit the new change log entry further as you wish.
369
370 Some of the new change log entries may duplicate what's already in
371ChangeLog. You will have to remove these duplicates by hand.
372
373 Normally, the log entry for file @file{foo} is displayed as @samp{*
374foo: @var{text of log entry}}. The @samp{:} after @file{foo} is omitted
375if the text of the log entry starts with @w{@samp{(@var{functionname}):
376}}. For example, if the log entry for @file{vc.el} is
377@samp{(vc-do-command): Check call-process status.}, then the text in
378@file{ChangeLog} looks like this:
379
380@iftex
381@medbreak
382@end iftex
383@smallexample
384@group
3851999-05-06 Nathaniel Bowditch <nat@@apn.org>
386
387 * vc.el (vc-do-command): Check call-process status.
388@end group
389@end smallexample
390@iftex
391@medbreak
392@end iftex
393
394 When @kbd{C-x v a} adds several change log entries at once, it groups
395related log entries together if they all are checked in by the same
396author at nearly the same time. If the log entries for several such
397files all have the same text, it coalesces them into a single entry.
398For example, suppose the most recent check-ins have the following log
399entries:
400
401@flushleft
402@bullet{} For @file{vc.texinfo}: @samp{Fix expansion typos.}
403@bullet{} For @file{vc.el}: @samp{Don't call expand-file-name.}
404@bullet{} For @file{vc-hooks.el}: @samp{Don't call expand-file-name.}
405@end flushleft
406
407@noindent
408They appear like this in @file{ChangeLog}:
409
410@iftex
411@medbreak
412@end iftex
413@smallexample
414@group
4151999-04-01 Nathaniel Bowditch <nat@@apn.org>
416
417 * vc.texinfo: Fix expansion typos.
418
419 * vc.el, vc-hooks.el: Don't call expand-file-name.
420@end group
421@end smallexample
422@iftex
423@medbreak
424@end iftex
425
426 Normally, @kbd{C-x v a} separates log entries by a blank line, but you
427can mark several related log entries to be clumped together (without an
428intervening blank line) by starting the text of each related log entry
429with a label of the form @w{@samp{@{@var{clumpname}@} }}. The label
430itself is not copied to @file{ChangeLog}. For example, suppose the log
431entries are:
432
433@flushleft
434@bullet{} For @file{vc.texinfo}: @samp{@{expand@} Fix expansion typos.}
435@bullet{} For @file{vc.el}: @samp{@{expand@} Don't call expand-file-name.}
436@bullet{} For @file{vc-hooks.el}: @samp{@{expand@} Don't call expand-file-name.}
437@end flushleft
438
439@noindent
440Then the text in @file{ChangeLog} looks like this:
441
442@iftex
443@medbreak
444@end iftex
445@smallexample
446@group
4471999-04-01 Nathaniel Bowditch <nat@@apn.org>
448
449 * vc.texinfo: Fix expansion typos.
450 * vc.el, vc-hooks.el: Don't call expand-file-name.
451@end group
452@end smallexample
453@iftex
454@medbreak
455@end iftex
456
457 A log entry whose text begins with @samp{#} is not copied to
458@file{ChangeLog}. For example, if you merely fix some misspellings in
459comments, you can log the change with an entry beginning with @samp{#}
460to avoid putting such trivia into @file{ChangeLog}.
461
462@node Renaming and VC
463@subsubsection Renaming VC Work Files and Master Files
464
465@findex vc-rename-file
466 When you rename a registered file, you must also rename its master
467file correspondingly to get proper results. Use @code{vc-rename-file}
468to rename the source file as you specify, and rename its master file
469accordingly. It also updates any snapshots (@pxref{Snapshots}) that
470mention the file, so that they use the new name; despite this, the
471snapshot thus modified may not completely work (@pxref{Snapshot
472Caveats}).
473
474 Some back ends do not provide an explicit rename operation to their
475repositories. After issuing @code{vc-rename-file}, use @kbd{C-x v v}
476on the original and renamed buffers and provide the necessary edit
477log.
478
479 You cannot use @code{vc-rename-file} on a file that is locked by
480someone else.
481
482@node Version Headers
483@subsubsection Inserting Version Control Headers
484
485 Sometimes it is convenient to put version identification strings
486directly into working files. Certain special strings called
487@dfn{version headers} are replaced in each successive version by the
488number of that version, the name of the user who created it, and other
489relevant information. All of the back ends that VC supports have such
490a mechanism, except GNU Arch.
491
492 VC does not normally use the information contained in these headers.
493The exception is RCS---with RCS, version headers are sometimes more
494reliable than the master file to determine which version of the file
495you are editing. Note that in a multi-branch environment, version
496headers are necessary to make VC behave correctly
497@iftex
498(@pxref{Multi-User Branching,,,emacs, the Emacs Manual}).
499@end iftex
500@ifnottex
501(@pxref{Multi-User Branching}).
502@end ifnottex
503
504 Searching for RCS version headers is controlled by the variable
505@code{vc-consult-headers}. If it is non-@code{nil} (the default),
506Emacs searches for headers to determine the version number you are
507editing. Setting it to @code{nil} disables this feature.
508
509 Note that although CVS uses the same kind of version headers as RCS
510does, VC never searches for these headers if you are using CVS,
511regardless of the above setting.
512
513@kindex C-x v h
514@findex vc-insert-headers
515 You can use the @kbd{C-x v h} command (@code{vc-insert-headers}) to
516insert a suitable header string.
517
518@table @kbd
519@item C-x v h
520Insert headers in a file for use with your version-control system.
521@end table
522
523@vindex vc-@var{backend}-header
524 The default header string is @samp{@w{$}Id$} for RCS and
525@samp{@w{%}W%} for SCCS. You can specify other headers to insert by
526setting the variables @code{vc-@var{backend}-header} where
527@var{backend} is @code{rcs} or @code{sccs}.
528
529 Instead of a single string, you can specify a list of strings; then
530each string in the list is inserted as a separate header on a line of
531its own.
532
533 It may be necessary to use apparently-superfluous backslashes when
534writing the strings that you put in this variable. For instance, you
535might write @code{"$Id\$"} rather than @code{"$Id@w{$}"}. The extra
536backslash prevents the string constant from being interpreted as a
537header, if the Emacs Lisp file containing it is maintained with
538version control.
539
540@vindex vc-comment-alist
541 Each header is inserted surrounded by tabs, inside comment delimiters,
542on a new line at point. Normally the ordinary comment
543start and comment end strings of the current mode are used, but for
544certain modes, there are special comment delimiters for this purpose;
545the variable @code{vc-comment-alist} specifies them. Each element of
546this list has the form @code{(@var{mode} @var{starter} @var{ender})}.
547
548@vindex vc-static-header-alist
549 The variable @code{vc-static-header-alist} specifies further strings
550to add based on the name of the buffer. Its value should be a list of
551elements of the form @code{(@var{regexp} . @var{format})}. Whenever
552@var{regexp} matches the buffer name, @var{format} is inserted as part
553of the header. A header line is inserted for each element that matches
554the buffer name, and for each string specified by
555@code{vc-@var{backend}-header}. The header line is made by processing the
556string from @code{vc-@var{backend}-header} with the format taken from the
557element. The default value for @code{vc-static-header-alist} is as follows:
558
559@example
560@group
561(("\\.c$" .
562 "\n#ifndef lint\nstatic char vcid[] = \"\%s\";\n\
563#endif /* lint */\n"))
564@end group
565@end example
566
567@noindent
568It specifies insertion of text of this form:
569
570@example
571@group
572
573#ifndef lint
574static char vcid[] = "@var{string}";
575#endif /* lint */
576@end group
577@end example
578
579@noindent
580Note that the text above starts with a blank line.
581
582 If you use more than one version header in a file, put them close
583together in the file. The mechanism in @code{revert-buffer} that
584preserves markers may not handle markers positioned between two version
585headers.
586
587@node Customizing VC
588@subsection Customizing VC
589
590@vindex vc-handled-backends
591The variable @code{vc-handled-backends} determines which version
592control systems VC should handle. The default value is @code{(RCS CVS
593SVN SCCS Arch MCVS)}, so it contains all six version systems that are
594currently supported. If you want VC to ignore one or more of these
595systems, exclude its name from the list. To disable VC entirely, set
596this variable to @code{nil}.
597
598The order of systems in the list is significant: when you visit a file
599registered in more than one system (@pxref{Local Version Control}), VC
600uses the system that comes first in @code{vc-handled-backends} by
601default. The order is also significant when you register a file for
602the first time, see
603@iftex
604@ref{Registering,,,emacs, the Emacs Manual},
605@end iftex
606@ifnottex
607@ref{Registering},
608@end ifnottex
609for details.
610
611@menu
612* General VC Options:: Options that apply to multiple back ends.
613* RCS and SCCS:: Options for RCS and SCCS.
614* CVS Options:: Options for CVS.
615@end menu
616
617@node General VC Options
618@subsubsection General Options
619
620@vindex vc-make-backup-files
621 Emacs normally does not save backup files for source files that are
622maintained with version control. If you want to make backup files even
623for files that use version control, set the variable
624@code{vc-make-backup-files} to a non-@code{nil} value.
625
626@vindex vc-keep-workfiles
627 Normally the work file exists all the time, whether it is locked or
628not. If you set @code{vc-keep-workfiles} to @code{nil}, then checking
629in a new version with @kbd{C-x v v} deletes the work file; but any
630attempt to visit the file with Emacs creates it again. (With CVS, work
631files are always kept.)
632
633@vindex vc-follow-symlinks
634 Editing a version-controlled file through a symbolic link can be
635dangerous. It bypasses the version control system---you can edit the
636file without locking it, and fail to check your changes in. Also,
637your changes might overwrite those of another user. To protect against
638this, VC checks each symbolic link that you visit, to see if it points
639to a file under version control.
640
641 The variable @code{vc-follow-symlinks} controls what to do when a
642symbolic link points to a version-controlled file. If it is @code{nil},
643VC only displays a warning message. If it is @code{t}, VC automatically
644follows the link, and visits the real file instead, telling you about
645this in the echo area. If the value is @code{ask} (the default), VC
646asks you each time whether to follow the link.
647
648@vindex vc-suppress-confirm
649 If @code{vc-suppress-confirm} is non-@code{nil}, then @kbd{C-x v v}
650and @kbd{C-x v i} can save the current buffer without asking, and
651@kbd{C-x v u} also operates without asking for confirmation. (This
652variable does not affect @kbd{C-x v c}; that operation is so drastic
653that it should always ask for confirmation.)
654
655@vindex vc-command-messages
656 VC mode does much of its work by running the shell commands for RCS,
657CVS and SCCS. If @code{vc-command-messages} is non-@code{nil}, VC
658displays messages to indicate which shell commands it runs, and
659additional messages when the commands finish.
660
661@vindex vc-path
662 You can specify additional directories to search for version control
663programs by setting the variable @code{vc-path}. These directories
664are searched before the usual search path. It is rarely necessary to
665set this variable, because VC normally finds the proper files
666automatically.
667
668@node RCS and SCCS
669@subsubsection Options for RCS and SCCS
670
671@cindex non-strict locking (RCS)
672@cindex locking, non-strict (RCS)
673 By default, RCS uses locking to coordinate the activities of several
674users, but there is a mode called @dfn{non-strict locking} in which
675you can check-in changes without locking the file first. Use
676@samp{rcs -U} to switch to non-strict locking for a particular file,
677see the @code{rcs} manual page for details.
678
679 When deducing the version control state of an RCS file, VC first
680looks for an RCS version header string in the file (@pxref{Version
681Headers}). If there is no header string, VC normally looks at the
682file permissions of the work file; this is fast. But there might be
683situations when the file permissions cannot be trusted. In this case
684the master file has to be consulted, which is rather expensive. Also
685the master file can only tell you @emph{if} there's any lock on the
686file, but not whether your work file really contains that locked
687version.
688
689@vindex vc-consult-headers
690 You can tell VC not to use version headers to determine the file
691status by setting @code{vc-consult-headers} to @code{nil}. VC then
692always uses the file permissions (if it is supposed to trust them), or
693else checks the master file.
694
695@vindex vc-mistrust-permissions
696 You can specify the criterion for whether to trust the file
697permissions by setting the variable @code{vc-mistrust-permissions}.
698Its value can be @code{t} (always mistrust the file permissions and
699check the master file), @code{nil} (always trust the file
700permissions), or a function of one argument which makes the decision.
701The argument is the directory name of the @file{RCS} subdirectory. A
702non-@code{nil} value from the function says to mistrust the file
703permissions. If you find that the file permissions of work files are
704changed erroneously, set @code{vc-mistrust-permissions} to @code{t}.
705Then VC always checks the master file to determine the file's status.
706
707 VC determines the version control state of files under SCCS much as
708with RCS. It does not consider SCCS version headers, though. Thus,
709the variable @code{vc-mistrust-permissions} affects SCCS use, but
710@code{vc-consult-headers} does not.
711
712@node CVS Options
713@subsubsection Options specific for CVS
714
715@cindex locking (CVS)
716 By default, CVS does not use locking to coordinate the activities of
717several users; anyone can change a work file at any time. However,
718there are ways to restrict this, resulting in behavior that resembles
719locking.
720
721@cindex CVSREAD environment variable (CVS)
722 For one thing, you can set the @env{CVSREAD} environment variable
723(the value you use makes no difference). If this variable is defined,
724CVS makes your work files read-only by default. In Emacs, you must
725type @kbd{C-x v v} to make the file writable, so that editing works
726in fact similar as if locking was used. Note however, that no actual
727locking is performed, so several users can make their files writable
728at the same time. When setting @env{CVSREAD} for the first time, make
729sure to check out all your modules anew, so that the file protections
730are set correctly.
731
732@cindex cvs watch feature
733@cindex watching files (CVS)
734 Another way to achieve something similar to locking is to use the
735@dfn{watch} feature of CVS. If a file is being watched, CVS makes it
736read-only by default, and you must also use @kbd{C-x v v} in Emacs to
737make it writable. VC calls @code{cvs edit} to make the file writable,
738and CVS takes care to notify other developers of the fact that you
739intend to change the file. See the CVS documentation for details on
740using the watch feature.
741
742@vindex vc-stay-local
743@vindex vc-cvs-stay-local
744@cindex remote repositories (CVS)
745 When a file's repository is on a remote machine, VC tries to keep
746network interactions to a minimum. This is controlled by the variable
747@code{vc-cvs-stay-local}. There is another variable,
748@code{vc-stay-local}, which enables the feature also for other back
749ends that support it, including CVS. In the following, we will talk
750only about @code{vc-cvs-stay-local}, but everything applies to
751@code{vc-stay-local} as well.
752
753If @code{vc-cvs-stay-local} is @code{t} (the default), then VC uses
754only the entry in the local CVS subdirectory to determine the file's
755state (and possibly information returned by previous CVS commands).
756One consequence of this is that when you have modified a file, and
757somebody else has already checked in other changes to the file, you
758are not notified of it until you actually try to commit. (But you can
759try to pick up any recent changes from the repository first, using
760@kbd{C-x v m @key{RET}},
761@iftex
762@pxref{Merging,,,emacs, the Emacs Manual}).
763@end iftex
764@ifnottex
765@pxref{Merging}).
766@end ifnottex
767
768 When @code{vc-cvs-stay-local} is @code{t}, VC also makes local
769version backups, so that simple diff and revert operations are
770completely local (@pxref{Version Backups}).
771
772 On the other hand, if you set @code{vc-cvs-stay-local} to @code{nil},
773then VC queries the remote repository @emph{before} it decides what to
774do in @code{vc-next-action} (@kbd{C-x v v}), just as it does for local
775repositories. It also does not make any version backups.
776
777 You can also set @code{vc-cvs-stay-local} to a regular expression
778that is matched against the repository host name; VC then stays local
779only for repositories from hosts that match the pattern.
780
781@vindex vc-cvs-global-switches
782 You can specify additional command line options to pass to all CVS
783operations in the variable @code{vc-cvs-global-switches}. These
784switches are inserted immediately after the @code{cvs} command, before
785the name of the operation to invoke.
786
787@ignore
788 arch-tag: 140b8629-4339-4b5e-9e50-72453e51615e
789@end ignore
diff --git a/man/xresmini.texi b/man/xresmini.texi
index bf791a59e36..7445028e0be 100644
--- a/man/xresmini.texi
+++ b/man/xresmini.texi
@@ -131,8 +131,8 @@ Additional space (@dfn{leading}) between lines, in pixels.
131@item @code{menuBar} (class @code{MenuBar}) 131@item @code{menuBar} (class @code{MenuBar})
132@cindex menu bar 132@cindex menu bar
133Give frames menu bars if @samp{on}; don't have menu bars if 133Give frames menu bars if @samp{on}; don't have menu bars if
134@samp{off}. @xref{Lucid Resources}, and @ref{LessTif Resources}, for 134@samp{off}. @xref{Lucid Resources}, for how to control the appearance
135how to control the appearance of the menu bar if you have one. 135of the menu bar if you have one.
136 136
137@item @code{pointerColor} (class @code{Foreground}) 137@item @code{pointerColor} (class @code{Foreground})
138Color of the mouse cursor. 138Color of the mouse cursor.
@@ -296,7 +296,136 @@ The margin of the menu bar, in characters. Default is 1.
296@node GTK resources 296@node GTK resources
297@appendixsec GTK resources 297@appendixsec GTK resources
298 298
299@c Waiting for contents 299 The most common way to customize the GTK widgets Emacs uses (menus, dialogs
300tool bars and scroll bars) is by choosing an appropriate theme, for example
301with the GNOME theme selector. You can also do Emacs specific customization
302by inserting GTK style directives in the file @file{~/.emacs.d/gtkrc}. Some GTK
303themes ignore customizations in @file{~/.emacs.d/gtkrc} so not everything
304works with all themes. To customize Emacs font, background, faces, etc., use
305the normal X resources (@pxref{Resources}). We will present some examples of
306customizations here, but for a more detailed description, see the online manual.
307
308 The first example is just one line. It changes the font on all GTK widgets
309to courier with size 12:
310
311@smallexample
312gtk-font-name = "courier 12"
313@end smallexample
314
315 The thing to note is that the font name is not an X font name, like
316-*-helvetica-medium-r-*--*-120-*-*-*-*-*-*, but a Pango font name. A Pango
317font name is basically of the format "family style size", where the style
318is optional as in the case above. A name with a style could be for example:
319
320@smallexample
321gtk-font-name = "helvetica bold 10"
322@end smallexample
323
324 To customize widgets you first define a style and then apply the style to
325the widgets. Here is an example that sets the font for menus, but not
326for other widgets:
327
328@smallexample
329# @r{Define the style @samp{menufont}.}
330style "menufont"
331@{
332 font_name = "helvetica bold 14" # This is a Pango font name
333@}
334
335# @r{Specify that widget type @samp{*emacs-menuitem*} uses @samp{menufont}.}
336widget "*emacs-menuitem*" style "menufont"
337@end smallexample
338
339The widget name in this example contains wildcards, so the style will be
340applied to all widgets that match "*emacs-menuitem*". The widgets are
341named by the way they are contained, from the outer widget to the inner widget.
342So to apply the style "my_style" (not shown) with the full, absolute name, for
343the menubar and the scroll bar in Emacs we use:
344
345@smallexample
346widget "Emacs.pane.menubar" style "my_style"
347widget "Emacs.pane.emacs.verticalScrollBar" style "my_style"
348@end smallexample
349
350But to aoid having to type it all, wildcards are often used. @samp{*}
351matches zero or more characters and @samp{?} matches one character. So "*"
352matches all widgets.
353
354 Each widget has a class (for example GtkMenuItem) and a name (emacs-menuitem).
355You can assign styles by name or by class. In this example we have used the
356class:
357
358@smallexample
359style "menufont"
360@{
361 font_name = "helvetica bold 14"
362@}
363
364widget_class "*GtkMenuBar" style "menufont"
365@end smallexample
366
367@noindent
368The names and classes for the GTK widgets Emacs uses are:
369
370@multitable {@code{verticalScrollbar plus}} {@code{GtkFileSelection} and some}
371@item @code{emacs-filedialog}
372@tab @code{GtkFileSelection}
373@item @code{emacs-dialog}
374@tab @code{GtkDialog}
375@item @code{Emacs}
376@tab @code{GtkWindow}
377@item @code{pane}
378@tab @code{GtkVHbox}
379@item @code{emacs}
380@tab @code{GtkFixed}
381@item @code{verticalScrollBar}
382@tab @code{GtkVScrollbar}
383@item @code{emacs-toolbar}
384@tab @code{GtkToolbar}
385@item @code{menubar}
386@tab @code{GtkMenuBar}
387@item @code{emacs-menuitem}
388@tab anything in menus
389@end multitable
390
391 GTK absolute names are quite strange when it comes to menus
392and dialogs. The names do not start with @samp{Emacs}, as they are
393free-standing windows and not contained (in the GTK sense) by the
394Emacs GtkWindow. To customize the dialogs and menus, use wildcards like this:
395
396@smallexample
397widget "*emacs-dialog*" style "my_dialog_style"
398widget "*emacs-filedialog* style "my_file_style"
399widget "*emacs-menuitem* style "my_menu_style"
400@end smallexample
401
402 If you specify a customization in @file{~/.emacs.d/gtkrc}, then it
403automatically applies only to Emacs, since other programs don't read
404that file. For example, the drop down menu in the file dialog can not
405be customized by any absolute widget name, only by an absolute class
406name. This is because the widgets in the drop down menu do not
407have names and the menu is not contained in the Emacs GtkWindow. To
408have all menus in Emacs look the same, use this in
409@file{~/.emacs.d/gtkrc}:
410
411@smallexample
412widget_class "*Menu*" style "my_menu_style"
413@end smallexample
414
415 Here is a more elaborate example, showing how to change the parts of
416the scroll bar:
417
418@smallexample
419style "scroll"
420@{
421 fg[NORMAL] = "red"@ @ @ @ @ # @r{The arrow color.}
422 bg[NORMAL] = "yellow"@ @ # @r{The thumb and background around the arrow.}
423 bg[ACTIVE] = "blue"@ @ @ @ # @r{The trough color.}
424 bg[PRELIGHT] = "white"@ # @r{The thumb color when the mouse is over it.}
425@}
426
427widget "*verticalScrollBar*" style "scroll"
428@end smallexample
300 429
301@ignore 430@ignore
302 arch-tag: e1856f29-2482-42c0-a990-233cdccd1f21 431 arch-tag: e1856f29-2482-42c0-a990-233cdccd1f21
diff --git a/man/xresources.texi b/man/xresources.texi
index ce6709ad764..5f027a4ad4a 100644
--- a/man/xresources.texi
+++ b/man/xresources.texi
@@ -585,7 +585,7 @@ The color for the border shadow, on the top and the left.
585@cindex @file{~/.gtkrc-2.0} file 585@cindex @file{~/.gtkrc-2.0} file
586@cindex @file{~/.emacs.d/gtkrc} file 586@cindex @file{~/.emacs.d/gtkrc} file
587 587
588 If Emacs was built to use the GTK widget set, then the menu bar, 588 If Emacs was built to use the GTK widget set, then the menu bar, tool bar,
589scroll bar and the dialogs are customized with the standard GTK 589scroll bar and the dialogs are customized with the standard GTK
590customization file, @file{~/.gtkrc-2.0}, or with the Emacs specific 590customization file, @file{~/.gtkrc-2.0}, or with the Emacs specific
591file @file{~/.emacs.d/gtkrc}. We recommend that you use 591file @file{~/.emacs.d/gtkrc}. We recommend that you use
@@ -603,13 +603,13 @@ widget names}). Here is an example of how to change the font for
603Emacs menus: 603Emacs menus:
604 604
605@smallexample 605@smallexample
606# @r{Define the style @samp{metafont}.} 606# @r{Define the style @samp{menufont}.}
607style "menufont" 607style "menufont"
608@{ 608@{
609 font_name = "helvetica bold 14" # This is a Pango font name 609 font_name = "helvetica bold 14" # This is a Pango font name
610@} 610@}
611 611
612# @r{Specify that widget type @samp{*emacs-menuitem*} uses @samp{metafont}.} 612# @r{Specify that widget type @samp{*emacs-menuitem*} uses @samp{menufont}.}
613widget "*emacs-menuitem*" style "menufont" 613widget "*emacs-menuitem*" style "menufont"
614@end smallexample 614@end smallexample
615 615
diff --git a/src/.gdbinit b/src/.gdbinit
index 881a11dc8c0..7de361fddfb 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -211,6 +211,7 @@ define pitx
211 printf "vpos=%d hpos=%d", $it->vpos, $it->hpos, 211 printf "vpos=%d hpos=%d", $it->vpos, $it->hpos,
212 printf " y=%d lvy=%d", $it->current_y, $it->last_visible_y 212 printf " y=%d lvy=%d", $it->current_y, $it->last_visible_y
213 printf " x=%d vx=%d-%d", $it->current_x, $it->first_visible_x, $it->last_visible_x 213 printf " x=%d vx=%d-%d", $it->current_x, $it->first_visible_x, $it->last_visible_x
214 printf " w=%d", $it->pixel_width
214 printf " a+d=%d+%d=%d", $it->ascent, $it->descent, $it->ascent+$it->descent 215 printf " a+d=%d+%d=%d", $it->ascent, $it->descent, $it->ascent+$it->descent
215 printf " max=%d+%d=%d", $it->max_ascent, $it->max_descent, $it->max_ascent+$it->max_descent 216 printf " max=%d+%d=%d", $it->max_ascent, $it->max_descent, $it->max_ascent+$it->max_descent
216 printf "\n" 217 printf "\n"
@@ -544,6 +545,10 @@ end
544define xframe 545define xframe
545 xgetptr $ 546 xgetptr $
546 print (struct frame *) $ptr 547 print (struct frame *) $ptr
548 xgetptr $->name
549 set $ptr = (struct Lisp_String *) $ptr
550 xprintstr $ptr
551 echo \n
547end 552end
548document xframe 553document xframe
549Print $ as a frame pointer, assuming it is an Emacs Lisp frame value. 554Print $ as a frame pointer, assuming it is an Emacs Lisp frame value.
@@ -676,6 +681,31 @@ document xcdr
676Print the cdr of $, assuming it is an Emacs Lisp pair. 681Print the cdr of $, assuming it is an Emacs Lisp pair.
677end 682end
678 683
684define xlist
685 xgetptr $
686 set $cons = (struct Lisp_Cons *) $ptr
687 xgetptr Qnil
688 set $nil = $ptr
689 set $i = 0
690 while $cons != $nil && $i < 10
691 p/x $cons->car
692 xpr
693 xgetptr $cons->u.cdr
694 set $cons = (struct Lisp_Cons *) $ptr
695 set $i = $i + 1
696 printf "---\n"
697 end
698 if $cons == $nil
699 printf "nil\n"
700 else
701 printf "...\n"
702 p $ptr
703 end
704end
705document xlist
706Print $ assuming it is a list.
707end
708
679define xfloat 709define xfloat
680 xgetptr $ 710 xgetptr $
681 print ((struct Lisp_Float *) $ptr)->u.data 711 print ((struct Lisp_Float *) $ptr)->u.data
@@ -694,6 +724,108 @@ document xscrollbar
694Print $ as a scrollbar pointer. 724Print $ as a scrollbar pointer.
695end 725end
696 726
727define xpr
728 xtype
729 if $type == Lisp_Int
730 xint
731 end
732 if $type == Lisp_Symbol
733 xsymbol
734 end
735 if $type == Lisp_String
736 xstring
737 end
738 if $type == Lisp_Cons
739 xcons
740 end
741 if $type == Lisp_Float
742 xfloat
743 end
744 if $type == Lisp_Misc
745 set $misc = (enum Lisp_Misc_Type) (((struct Lisp_Free *) $ptr)->type)
746 if $misc == Lisp_Misc_Free
747 xmiscfree
748 end
749 if $misc == Lisp_Misc_Boolfwd
750 xboolfwd
751 end
752 if $misc == Lisp_Misc_Marker
753 xmarker
754 end
755 if $misc == Lisp_Misc_Intfwd
756 xintfwd
757 end
758 if $misc == Lisp_Misc_Boolfwd
759 xboolfwd
760 end
761 if $misc == Lisp_Misc_Objfwd
762 xobjfwd
763 end
764 if $misc == Lisp_Misc_Buffer_Objfwd
765 xbufobjfwd
766 end
767 if $misc == Lisp_Misc_Buffer_Local_Value
768 xbuflocal
769 end
770# if $misc == Lisp_Misc_Some_Buffer_Local_Value
771# xvalue
772# end
773 if $misc == Lisp_Misc_Overlay
774 xoverlay
775 end
776 if $misc == Lisp_Misc_Kboard_Objfwd
777 xkbobjfwd
778 end
779# if $misc == Lisp_Misc_Save_Value
780# xsavevalue
781# end
782 end
783 if $type == Lisp_Vectorlike
784 set $size = ((struct Lisp_Vector *) $ptr)->size
785 if ($size & PVEC_FLAG)
786 set $vec = (enum pvec_type) ($size & PVEC_TYPE_MASK)
787 if $vec == PVEC_NORMAL_VECTOR
788 xvector
789 end
790 if $vec == PVEC_PROCESS
791 xprocess
792 end
793 if $vec == PVEC_FRAME
794 xframe
795 end
796 if $vec == PVEC_COMPILED
797 xcompiled
798 end
799 if $vec == PVEC_WINDOW
800 xwindow
801 end
802 if $vec == PVEC_WINDOW_CONFIGURATION
803 xwinconfig
804 end
805 if $vec == PVEC_SUBR
806 xsubr
807 end
808 if $vec == PVEC_CHAR_TABLE
809 xchartable
810 end
811 if $vec == PVEC_BOOL_VECTOR
812 xboolvector
813 end
814 if $vec == PVEC_BUFFER
815 xbuffer
816 end
817 if $vec == PVEC_HASH_TABLE
818 xhashtable
819 end
820 else
821 xvector
822 end
823 end
824end
825document xpr
826Print $ as a lisp object of any type.
827end
828
697define xprintstr 829define xprintstr
698 set $data = $arg0->data 830 set $data = $arg0->data
699 output ($arg0->size > 1000) ? 0 : ($data[0])@($arg0->size_byte < 0 ? $arg0->size & ~gdb_array_mark_flag : $arg0->size_byte) 831 output ($arg0->size > 1000) ? 0 : ($data[0])@($arg0->size_byte < 0 ? $arg0->size & ~gdb_array_mark_flag : $arg0->size_byte)
@@ -739,7 +871,7 @@ define xbacktrace
739 xgettype (*$bt->function) 871 xgettype (*$bt->function)
740 if $type == Lisp_Symbol 872 if $type == Lisp_Symbol
741 xprintsym (*$bt->function) 873 xprintsym (*$bt->function)
742 echo \n 874 printf " (0x%x)\n", *$bt->args
743 else 875 else
744 printf "0x%x ", *$bt->function 876 printf "0x%x ", *$bt->function
745 if $type == Lisp_Vectorlike 877 if $type == Lisp_Vectorlike
@@ -760,6 +892,27 @@ document xbacktrace
760 an error was signaled. 892 an error was signaled.
761end 893end
762 894
895define which
896 set debug_print (which_symbols ($arg0))
897end
898document which
899 Print symbols which references a given lisp object,
900 either as its symbol value or symbol function.
901end
902
903define xbytecode
904 set $bt = byte_stack_list
905 while $bt
906 xgettype ($bt->byte_string)
907 printf "0x%x => ", $bt->byte_string
908 which $bt->byte_string
909 set $bt = $bt->next
910 end
911end
912document xbytecode
913 Print a backtrace of the byte code stack.
914end
915
763# Show Lisp backtrace after normal backtrace. 916# Show Lisp backtrace after normal backtrace.
764define hookpost-backtrace 917define hookpost-backtrace
765 set $bt = backtrace_list 918 set $bt = backtrace_list
diff --git a/src/ChangeLog b/src/ChangeLog
index f68510f2fb4..d7e8293ad27 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,203 @@
12006-05-10 Kenichi Handa <handa@m17n.org>
2
3 * xfaces.c (realize_default_face) [HAVE_X_WINDOWS]: If the font
4 chosen for the default face was different from the frame font,
5 adjust the frame font.
6
72006-05-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8
9 * image.c (Qduration) [MAC_OS]: Undo previous change.
10 (syms_of_image) [MAC_OS]: Likewise.
11 [MAC_OS] (gif_load): Emulate Graphic Control Extension block.
12
13 * macfns.c (x_to_mac_color): Fix shift amount change.
14 [USE_MAC_FONT_PANEL] (mac_set_font): Use x_get_focus_frame.
15 [USE_MAC_FONT_PANEL] (Fmac_set_font_panel_visibility): Doc fix.
16
17 * macselect.c (Vmac_service_selection) [MAC_OSX]: Rename from
18 Vmac_services_selection. All uses changed.
19 (mac_store_service_event): Rename from mac_store_services_event in
20 extern and calls.
21
22 * macterm.c (Qservice) [MAC_OSX]: Rename from Qservices. All uses
23 changed.
24 [MAC_OSX] (mac_store_service_event): Rename from
25 mac_store_services_event. All callers changed.
26 [USE_MAC_FONT_PANEL] (mac_set_font_info_for_selection): Add args
27 FACE_ID and C. All callers changed.
28 (x_free_frame_resources) [USE_MAC_FONT_PANEL]: Call
29 mac_set_font_info_for_selection when focus frame is destroyed.
30 (XTread_socket): Revert to FrontNonFloatingWindow/FrontWindow.
31
32 * macterm.h (mac_set_font_info_for_selection): Add 2nd and 3rd
33 args in extern.
34
352006-05-09 Chong Yidong <cyd@stupidchicken.com>
36
37 * keymap.c (describe_map): Avoid generating duplicate entries if
38 the shadowed binding has the same definition.
39
402006-05-09 Kenichi Handa <handa@m17n.org>
41
42 * keymap.c (push_key_description): Handle invalid character key.
43
442006-05-08 Kenichi Handa <handa@m17n.org>
45
46 * callproc.c (Fcall_process): Use system_eol_type for encoding
47 arguments if eol_type is not yet decided.
48
49 * coding.h (system_eol_type): Extern it.
50
51 * coding.c (setup_coding_system): For invalid coding-system, set
52 coding->eol_type to CODING_EOL_UNDECIDED.
53 (encode_coding): Cancel previous change.
54 (shrink_encoding_region): Likewise.
55 (code_convert_region1): Likewise.
56 (code_convert_string1): Likewise.
57 (code_convert_string_norecord): Likewise.
58
59 * fileio.c (choose_write_coding_system): Use system_eol_type for
60 encoding if eol_type is not yet decided.
61
62 * process.c (setup_process_coding_systems): Use system_eol_type
63 for encoding if eol_type is not yet decided.
64 (read_process_output): Likewise.
65 (send_process): Likewise.
66
672006-05-07 Juanma Barranquero <lekktu@gmail.com>
68
69 * minibuf.c (syms_of_minibuf) <history-length>: Fix typo in doc.
70
712006-05-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
72
73 * mac.c (Fmac_clear_font_name_table): Move defun to macfns.c.
74 (syms_of_mac): Likewise for defsubr.
75
76 * macfns.c (mac_set_font): New function.
77 (mac_frame_parm_handlers, syms_of_macfns): Replace x_set_font with it.
78 (mac_window) [TARGET_API_MAC_CARBON && MAC_OSX]: Specify
79 kWindowToolbarButtonAttribute when creating window.
80 (Fmac_clear_font_name_table): Move from macfns.c.
81 (syms_of_macfns): Likewise for defsubr.
82 [USE_MAC_FONT_PANEL] (Fmac_set_font_panel_visibility): New defun.
83 (syms_of_macfns) [USE_MAC_FONT_PANEL]: Defsubr it.
84
85 * macgui.h (USE_MAC_FONT_PANEL): Define to 1 if USE_ATSUI is set
86 and build is done on Mac OS X 10.2 and later.
87
88 * macselect.c (mac_do_receive_drag): Remove unused variable `index'.
89 (mac_store_services_event): Change return type in extern.
90
91 * macterm.c (XLoadQueryFont) [USE_ATSUI]: Set font->mac_fontnum to
92 FMFontFamily value.
93 [USE_MAC_FONT_PANEL] (mac_set_font_info_for_selection): New function.
94 (x_new_focus_frame) [USE_MAC_FONT_PANEL]: Use it.
95 (QCfamily, QCweight, QCslant, Qnormal, Qbold, Qitalic): Add extern.
96 (QWindow) [MAC_OSX]: Likewise.
97 (Qfont) [USE_MAC_FONT_PANEL]: Likewise.
98 (Vmac_atsu_font_table) [USE_ATSUI]: New variable.
99 (syms_of_macterm) [USE_ATSUI]: Defvar it.
100 (Qtoolbar_switch_mode) [MAC_OSX]: New variable.
101 (Qpanel_closed, Qselection) [USE_MAC_FONT_PANEL]: Likewise.
102 (syms_of_macterm): Intern and staticpro them.
103 (init_font_name_table) [USE_ATSUI]: Add data to Vmac_atsu_font_table.
104 [TARGET_API_MAC_CARBON] (mac_store_event_ref_as_apple_event): New
105 function.
106 [USE_CARBON_EVENTS] (mac_handle_command_event): Use it.
107 [MAC_OSX] (mac_store_services_event): Likewise.
108 [USE_CARBON_EVENTS] (mac_handle_window_event) [MAC_OSX]: Handle
109 kEventWindowToolbarSwitchMode event.
110 (install_window_handler) [USE_CARBON_EVENTS && MAC_OSX]: Register it.
111 [MAC_OSX] (mac_store_services_event): Change return type to OSStatus.
112 [USE_MAC_FONT_PANEL] (mac_handle_font_event): New function.
113 (install_window_handler) [USE_MAC_FONT_PANEL]: Install it.
114 (XTread_socket): Select window on mouse click if x_focus_frame is NULL.
115
116 * macterm.h (mac_set_font_info_for_selection): Add extern.
117
1182006-05-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
119
120 * image.c (Qduration) [MAC_OS]: New variable.
121 (syms_of_image) [MAC_OS]: Intern and staticpro it.
122 [MAC_OS] (gif_load): Save image extension data in img->data.lisp_val.
123 [MAC_OSX] (image_load_quartz2d): Use cfstring_create_with_utf8_cstring
124 instead of cfstring_create_with_string.
125
1262006-05-06 Kim F. Storm <storm@cua.dk>
127
128 * .gdbinit (xframe): Print frame name.
129 (xlist): New command to print a list (max 10 elements).
130 (xpr): Print lisp object of any type.
131 (pitx): Print it->pixel_width.
132
1332006-05-05 Kenichi Handa <handa@m17n.org>
134
135 * xdisp.c (handle_composition_prop): Fix for the case of empty
136 composition component.
137
1382006-05-05 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
139
140 * keyboard.c (make_lispy_event) [MAC_OS]: Get Apple event info
141 from event->arg.
142
143 * termhooks.h (enum event_kind) [MAC_OS]: Update comment for
144 MAC_APPLE_EVENT.
145
146 * macterm.h (mac_make_lispy_event_code): Remove extern.
147 (mac_post_mouse_moved_event): Add extern.
148 (mac_aelist_to_lisp, mac_aedesc_to_lisp): Change arg 1 to
149 `const AEDesc *' in externs.
150 (create_apple_event_from_drag_ref) [TARGET_API_MAC_CARBON]: New extern.
151
152 * mac.c (mac_aelist_to_lisp, mac_aedesc_to_lisp): Change arg 1 to
153 `const AEDesc *'.
154 [TARGET_API_MAC_CARBON] (create_apple_event): New function.
155 [TARGET_API_MAC_CARBON] (create_apple_event_from_event_ref): Use it.
156 Use xrealloc instead of repeated xmalloc/xfree.
157 [TARGET_API_MAC_CARBON] (create_apple_event_from_drag_ref): New
158 function.
159
160 * macmenu.c (restore_menu_items, cleanup_popup_menu): Return a value.
161
162 * macselect.c: Update copyright year.
163 (mac_store_apple_event): Change return type to void in extern.
164 (mac_handle_apple_event): Don't get return value from
165 mac_store_apple_event.
166 [TARGET_API_MAC_CARBON] (Vmac_dnd_known_types): New variable.
167 (syms_of_macselect) [TARGET_API_MAC_CARBON]: Defvar it.
168 [TARGET_API_MAC_CARBON] (mac_do_track_drag): Move function from
169 macterm.c. Use Vmac_dnd_known_types as acceptable flavors.
170 [TARGET_API_MAC_CARBON] (mac_do_receive_drag): Likewise. New
171 implementation using create_apple_event_from_drag_ref.
172 [TARGET_API_MAC_CARBON] (mac_do_track_dragUPP)
173 (mac_do_receive_dragUPP): Move variables from macterm.c.
174 (install_drag_handler, remove_drag_handler): New functions.
175
176 * macterm.c (XTread_socket) [TARGET_API_MAC_CARBON]: Try window
177 path select also for proxy icon click.
178 [TARGET_API_MAC_CARBON] (mac_post_mouse_moved_event): New function.
179 [USE_TOOLKIT_SCROLL_BARS] (scroll_bar_timer_callback): Use it.
180 (xlfdpat_create): Remove unused label `error' and trailing sentences.
181 (mac_do_track_drag, mac_do_receive_drag): Move functions to macselect.c.
182 (mac_do_track_dragUPP, mac_do_receive_dragUPP): Move variables to
183 macselect.c.
184 (install_drag_handler, remove_drag_handler): Add extern.
185 (mac_store_apple_event): Change return type to void. All uses changed.
186 Create Lisp object from Apple event and store it into input event.
187 (mac_make_lispy_event_code): Remove function.
188 [TARGET_API_MAC_CARBON] (mac_store_drag_event): New function.
189 (install_window_handler): Call install_drag_handler.
190 (remove_window_handler): Call remove_drag_handler.
191
1922006-05-03 Richard Stallman <rms@gnu.org>
193
194 * sound.c (Fplay_sound_internal): Dynamically allocate
195 current_sound_device and current_sound.
196 (sound_cleanup): Free them.
197
198 * minibuf.c (read_minibuf): Don't use read_minibuf_noninteractive
199 when inside a keyboard macro.
200
12006-05-02 Andreas Schwab <schwab@suse.de> 2012006-05-02 Andreas Schwab <schwab@suse.de>
2 202
3 * xmenu.c (restore_menu_items): Return a value. 203 * xmenu.c (restore_menu_items): Return a value.
diff --git a/src/callproc.c b/src/callproc.c
index 54ebf53979e..5f314f4de2a 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -295,6 +295,8 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
295 val = Qnil; 295 val = Qnil;
296 } 296 }
297 setup_coding_system (Fcheck_coding_system (val), &argument_coding); 297 setup_coding_system (Fcheck_coding_system (val), &argument_coding);
298 if (argument_coding.eol_type == CODING_EOL_UNDECIDED)
299 argument_coding.eol_type = system_eol_type;
298 } 300 }
299 } 301 }
300 302
diff --git a/src/coding.h b/src/coding.h
index 41f4aab509c..aa5c8f05015 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -717,6 +717,9 @@ extern Lisp_Object eol_mnemonic_unix, eol_mnemonic_dos, eol_mnemonic_mac;
717/* Mnemonic string to indicate type of end-of-line is not yet decided. */ 717/* Mnemonic string to indicate type of end-of-line is not yet decided. */
718extern Lisp_Object eol_mnemonic_undecided; 718extern Lisp_Object eol_mnemonic_undecided;
719 719
720/* Format of end-of-line decided by system. */
721extern int system_eol_type;
722
720#ifdef emacs 723#ifdef emacs
721extern Lisp_Object Qfile_coding_system; 724extern Lisp_Object Qfile_coding_system;
722extern Lisp_Object Qcall_process, Qcall_process_region; 725extern Lisp_Object Qcall_process, Qcall_process_region;
diff --git a/src/image.c b/src/image.c
index 688ff200055..f309a401139 100644
--- a/src/image.c
+++ b/src/image.c
@@ -2628,7 +2628,7 @@ image_load_quartz2d (f, img, png_p)
2628 UNGCPRO; 2628 UNGCPRO;
2629 return 0; 2629 return 0;
2630 } 2630 }
2631 path = cfstring_create_with_string (file); 2631 path = cfstring_create_with_utf8_cstring (SDATA (file));
2632 url = CFURLCreateWithFileSystemPath (NULL, path, 2632 url = CFURLCreateWithFileSystemPath (NULL, path,
2633 kCFURLPOSIXPathStyle, 0); 2633 kCFURLPOSIXPathStyle, 0);
2634 CFRelease (path); 2634 CFRelease (path);
@@ -7920,7 +7920,8 @@ gif_load (f, img)
7920 RGBColor bg_color; 7920 RGBColor bg_color;
7921 int width, height; 7921 int width, height;
7922 XImagePtr ximg; 7922 XImagePtr ximg;
7923 TimeValue time; 7923 TimeScale time_scale;
7924 TimeValue time, duration;
7924 int ino; 7925 int ino;
7925 CGrafPtr old_port; 7926 CGrafPtr old_port;
7926 GDHandle old_gdh; 7927 GDHandle old_gdh;
@@ -8028,6 +8029,7 @@ gif_load (f, img)
8028 image, img->spec); 8029 image, img->spec);
8029 goto error; 8030 goto error;
8030 } 8031 }
8032 time_scale = GetMediaTimeScale (media);
8031 8033
8032 specified_bg = image_spec_value (img->spec, QCbackground, NULL); 8034 specified_bg = image_spec_value (img->spec, QCbackground, NULL);
8033 if (!STRINGP (specified_bg) || 8035 if (!STRINGP (specified_bg) ||
@@ -8053,7 +8055,7 @@ gif_load (f, img)
8053 SetGWorld (old_port, old_gdh); 8055 SetGWorld (old_port, old_gdh);
8054 SetMovieActive (movie, 1); 8056 SetMovieActive (movie, 1);
8055 SetMovieGWorld (movie, ximg, NULL); 8057 SetMovieGWorld (movie, ximg, NULL);
8056 SampleNumToMediaTime (media, ino + 1, &time, NULL); 8058 SampleNumToMediaTime (media, ino + 1, &time, &duration);
8057 SetMovieTimeValue (movie, time); 8059 SetMovieTimeValue (movie, time);
8058 MoviesTask (movie, 0L); 8060 MoviesTask (movie, 0L);
8059 DisposeTrackMedia (media); 8061 DisposeTrackMedia (media);
@@ -8061,6 +8063,24 @@ gif_load (f, img)
8061 DisposeMovie (movie); 8063 DisposeMovie (movie);
8062 if (dh) 8064 if (dh)
8063 DisposeHandle (dh); 8065 DisposeHandle (dh);
8066
8067 /* Save GIF image extension data for `image-extension-data'.
8068 Format is (count IMAGES 0xf9 GRAPHIC_CONTROL_EXTENSION_BLOCK). */
8069 {
8070 unsigned char gce[4];
8071 int centisec = ((float)duration / time_scale) * 100.0f + 0.5f;
8072
8073 /* Fill the delay time field. */
8074 gce[1] = centisec & 0xff;
8075 gce[2] = (centisec >> 8) & 0xff;
8076 /* We don't know about other fields. */
8077 gce[0] = gce[3] = 0;
8078
8079 img->data.lisp_val = list4 (Qcount, make_number (nsamples),
8080 make_number (0xf9),
8081 make_unibyte_string (gce, 4));
8082 }
8083
8064 /* Maybe fill in the background field while we have ximg handy. */ 8084 /* Maybe fill in the background field while we have ximg handy. */
8065 if (NILP (image_spec_value (img->spec, QCbackground, NULL))) 8085 if (NILP (image_spec_value (img->spec, QCbackground, NULL)))
8066 IMAGE_BACKGROUND (img, f, ximg); 8086 IMAGE_BACKGROUND (img, f, ximg);
diff --git a/src/keyboard.c b/src/keyboard.c
index e3a77653ed6..b47df2bec7a 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -5881,8 +5881,7 @@ make_lispy_event (event)
5881 spec[1] = event->y; 5881 spec[1] = event->y;
5882 return Fcons (Qmac_apple_event, 5882 return Fcons (Qmac_apple_event,
5883 Fcons (Fvector (2, spec), 5883 Fcons (Fvector (2, spec),
5884 Fcons (mac_make_lispy_event_code (event->code), 5884 Fcons (event->arg, Qnil)));
5885 Qnil)));
5886 } 5885 }
5887#endif 5886#endif
5888 5887
diff --git a/src/keymap.c b/src/keymap.c
index f5aea3b3902..fb506200a1c 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -2120,12 +2120,21 @@ push_key_description (c, p, force_multibyte)
2120 int force_multibyte; 2120 int force_multibyte;
2121{ 2121{
2122 unsigned c2; 2122 unsigned c2;
2123 int valid_p;
2123 2124
2124 /* Clear all the meaningless bits above the meta bit. */ 2125 /* Clear all the meaningless bits above the meta bit. */
2125 c &= meta_modifier | ~ - meta_modifier; 2126 c &= meta_modifier | ~ - meta_modifier;
2126 c2 = c & ~(alt_modifier | ctrl_modifier | hyper_modifier 2127 c2 = c & ~(alt_modifier | ctrl_modifier | hyper_modifier
2127 | meta_modifier | shift_modifier | super_modifier); 2128 | meta_modifier | shift_modifier | super_modifier);
2128 2129
2130 valid_p = SINGLE_BYTE_CHAR_P (c2) || char_valid_p (c2, 0);
2131 if (! valid_p)
2132 {
2133 /* KEY_DESCRIPTION_SIZE is large enough for this. */
2134 p += sprintf (p, "[%d]", c);
2135 return p;
2136 }
2137
2129 if (c & alt_modifier) 2138 if (c & alt_modifier)
2130 { 2139 {
2131 *p++ = 'A'; 2140 *p++ = 'A';
@@ -3310,7 +3319,9 @@ describe_map (map, prefix, elt_describer, partial, shadow,
3310 tem = shadow_lookup (shadow, kludge, Qt); 3319 tem = shadow_lookup (shadow, kludge, Qt);
3311 if (!NILP (tem)) 3320 if (!NILP (tem))
3312 { 3321 {
3313 if (mention_shadow) 3322 /* Avoid generating duplicate entries if the
3323 shadowed binding has the same definition. */
3324 if (mention_shadow && !EQ (tem, definition))
3314 this_shadowed = 1; 3325 this_shadowed = 1;
3315 else 3326 else
3316 continue; 3327 continue;
diff --git a/src/mac.c b/src/mac.c
index 444320322c3..f7fcbe9ac88 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -272,7 +272,7 @@ static Lisp_Object Qundecoded_file_name;
272 272
273static Lisp_Object 273static Lisp_Object
274mac_aelist_to_lisp (desc_list) 274mac_aelist_to_lisp (desc_list)
275 AEDescList *desc_list; 275 const AEDescList *desc_list;
276{ 276{
277 OSErr err; 277 OSErr err;
278 long count; 278 long count;
@@ -337,7 +337,7 @@ mac_aelist_to_lisp (desc_list)
337 337
338Lisp_Object 338Lisp_Object
339mac_aedesc_to_lisp (desc) 339mac_aedesc_to_lisp (desc)
340 AEDesc *desc; 340 const AEDesc *desc;
341{ 341{
342 OSErr err = noErr; 342 OSErr err = noErr;
343 DescType desc_type = desc->descriptorType; 343 DescType desc_type = desc->descriptorType;
@@ -665,33 +665,46 @@ init_coercion_handler ()
665} 665}
666 666
667#if TARGET_API_MAC_CARBON 667#if TARGET_API_MAC_CARBON
668OSErr 668static OSErr
669create_apple_event_from_event_ref (event, num_params, names, types, result) 669create_apple_event (class, id, result)
670 EventRef event; 670 AEEventClass class;
671 UInt32 num_params; 671 AEEventID id;
672 EventParamName *names;
673 EventParamType *types;
674 AppleEvent *result; 672 AppleEvent *result;
675{ 673{
676 OSErr err; 674 OSErr err;
677 static const ProcessSerialNumber psn = {0, kCurrentProcess}; 675 static const ProcessSerialNumber psn = {0, kCurrentProcess};
678 AEAddressDesc address_desc; 676 AEAddressDesc address_desc;
679 UInt32 i, size;
680 CFStringRef string;
681 CFDataRef data;
682 char *buf;
683 677
684 err = AECreateDesc (typeProcessSerialNumber, &psn, 678 err = AECreateDesc (typeProcessSerialNumber, &psn,
685 sizeof (ProcessSerialNumber), &address_desc); 679 sizeof (ProcessSerialNumber), &address_desc);
686 if (err == noErr) 680 if (err == noErr)
687 { 681 {
688 err = AECreateAppleEvent (0, 0, /* Dummy class and ID. */ 682 err = AECreateAppleEvent (class, id,
689 &address_desc, /* NULL is not allowed 683 &address_desc, /* NULL is not allowed
690 on Mac OS Classic. */ 684 on Mac OS Classic. */
691 kAutoGenerateReturnID, 685 kAutoGenerateReturnID,
692 kAnyTransactionID, result); 686 kAnyTransactionID, result);
693 AEDisposeDesc (&address_desc); 687 AEDisposeDesc (&address_desc);
694 } 688 }
689
690 return err;
691}
692
693OSErr
694create_apple_event_from_event_ref (event, num_params, names, types, result)
695 EventRef event;
696 UInt32 num_params;
697 EventParamName *names;
698 EventParamType *types;
699 AppleEvent *result;
700{
701 OSErr err;
702 UInt32 i, size;
703 CFStringRef string;
704 CFDataRef data;
705 char *buf = NULL;
706
707 err = create_apple_event (0, 0, result); /* Dummy class and ID. */
695 if (err != noErr) 708 if (err != noErr)
696 return err; 709 return err;
697 710
@@ -721,19 +734,88 @@ create_apple_event_from_event_ref (event, num_params, names, types, result)
721 0, &size, NULL); 734 0, &size, NULL);
722 if (err != noErr) 735 if (err != noErr)
723 break; 736 break;
724 buf = xmalloc (size); 737 buf = xrealloc (buf, size);
725 err = GetEventParameter (event, names[i], types[i], NULL, 738 err = GetEventParameter (event, names[i], types[i], NULL,
726 size, NULL, buf); 739 size, NULL, buf);
727 if (err == noErr) 740 if (err == noErr)
728 AEPutParamPtr (result, names[i], types[i], buf, size); 741 AEPutParamPtr (result, names[i], types[i], buf, size);
729 xfree (buf);
730 break; 742 break;
731 } 743 }
744 if (buf)
745 xfree (buf);
732 746
733 return noErr; 747 return noErr;
734} 748}
735#endif
736 749
750OSErr
751create_apple_event_from_drag_ref (drag, num_types, types, result)
752 DragRef drag;
753 UInt32 num_types;
754 FlavorType *types;
755 AppleEvent *result;
756{
757 OSErr err;
758 UInt16 num_items;
759 AppleEvent items;
760 long index;
761 char *buf = NULL;
762
763 err = CountDragItems (drag, &num_items);
764 if (err != noErr)
765 return err;
766 err = AECreateList (NULL, 0, false, &items);
767 if (err != noErr)
768 return err;
769
770 for (index = 1; index <= num_items; index++)
771 {
772 ItemReference item;
773 DescType desc_type = typeNull;
774 Size size;
775
776 err = GetDragItemReferenceNumber (drag, index, &item);
777 if (err == noErr)
778 {
779 int i;
780
781 for (i = 0; i < num_types; i++)
782 {
783 err = GetFlavorDataSize (drag, item, types[i], &size);
784 if (err == noErr)
785 {
786 buf = xrealloc (buf, size);
787 err = GetFlavorData (drag, item, types[i], buf, &size, 0);
788 }
789 if (err == noErr)
790 {
791 desc_type = types[i];
792 break;
793 }
794 }
795 }
796 err = AEPutPtr (&items, index, desc_type,
797 desc_type != typeNull ? buf : NULL,
798 desc_type != typeNull ? size : 0);
799 if (err != noErr)
800 break;
801 }
802 if (buf)
803 xfree (buf);
804
805 if (err == noErr)
806 {
807 err = create_apple_event (0, 0, result); /* Dummy class and ID. */
808 if (err == noErr)
809 err = AEPutParamDesc (result, keyDirectObject, &items);
810 if (err != noErr)
811 AEDisposeDesc (result);
812 }
813
814 AEDisposeDesc (&items);
815
816 return err;
817}
818#endif /* TARGET_API_MAC_CARBON */
737 819
738/*********************************************************************** 820/***********************************************************************
739 Conversion between Lisp and Core Foundation objects 821 Conversion between Lisp and Core Foundation objects
@@ -4686,16 +4768,6 @@ On successful conversion, return the result string, else return nil. */)
4686#endif /* TARGET_API_MAC_CARBON */ 4768#endif /* TARGET_API_MAC_CARBON */
4687 4769
4688 4770
4689DEFUN ("mac-clear-font-name-table", Fmac_clear_font_name_table, Smac_clear_font_name_table, 0, 0, 0,
4690 doc: /* Clear the font name table. */)
4691 ()
4692{
4693 check_mac ();
4694 mac_clear_font_name_table ();
4695 return Qnil;
4696}
4697
4698
4699static Lisp_Object 4771static Lisp_Object
4700mac_get_system_locale () 4772mac_get_system_locale ()
4701{ 4773{
@@ -5167,7 +5239,6 @@ syms_of_mac ()
5167 defsubr (&Smac_get_preference); 5239 defsubr (&Smac_get_preference);
5168 defsubr (&Smac_code_convert_string); 5240 defsubr (&Smac_code_convert_string);
5169#endif 5241#endif
5170 defsubr (&Smac_clear_font_name_table);
5171 5242
5172 defsubr (&Smac_set_file_creator); 5243 defsubr (&Smac_set_file_creator);
5173 defsubr (&Smac_set_file_type); 5244 defsubr (&Smac_set_file_type);
diff --git a/src/macfns.c b/src/macfns.c
index 74b5288e781..8e0d5153034 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -1091,7 +1091,7 @@ x_to_mac_color (colorname)
1091 char *color; 1091 char *color;
1092 unsigned long colorval; 1092 unsigned long colorval;
1093 int i, pos; 1093 int i, pos;
1094 pos = 0; 1094 pos = 16;
1095 1095
1096 colorval = 0; 1096 colorval = 0;
1097 color = colorname + 4; 1097 color = colorname + 4;
@@ -1127,7 +1127,7 @@ x_to_mac_color (colorname)
1127 if (value == ULONG_MAX) 1127 if (value == ULONG_MAX)
1128 break; 1128 break;
1129 colorval |= (value << pos); 1129 colorval |= (value << pos);
1130 pos += 0x8; 1130 pos -= 0x8;
1131 if (i == 2) 1131 if (i == 2)
1132 { 1132 {
1133 if (*end != '\0') 1133 if (*end != '\0')
@@ -1146,7 +1146,7 @@ x_to_mac_color (colorname)
1146 char *color; 1146 char *color;
1147 unsigned long colorval; 1147 unsigned long colorval;
1148 int i, pos; 1148 int i, pos;
1149 pos = 0; 1149 pos = 16;
1150 1150
1151 colorval = 0; 1151 colorval = 0;
1152 color = colorname + 5; 1152 color = colorname + 5;
@@ -1168,7 +1168,7 @@ x_to_mac_color (colorname)
1168 if (val == 0x100) 1168 if (val == 0x100)
1169 val = 0xFF; 1169 val = 0xFF;
1170 colorval |= (val << pos); 1170 colorval |= (val << pos);
1171 pos += 0x8; 1171 pos -= 0x8;
1172 if (i == 2) 1172 if (i == 2)
1173 { 1173 {
1174 if (*end != '\0') 1174 if (*end != '\0')
@@ -1919,6 +1919,27 @@ mac_set_scroll_bar_width (f, arg, oldval)
1919 x_set_scroll_bar_width (f, arg, oldval); 1919 x_set_scroll_bar_width (f, arg, oldval);
1920} 1920}
1921 1921
1922static void
1923mac_set_font (f, arg, oldval)
1924 struct frame *f;
1925 Lisp_Object arg, oldval;
1926{
1927 x_set_font (f, arg, oldval);
1928#if USE_MAC_FONT_PANEL
1929 {
1930 Lisp_Object focus_frame = x_get_focus_frame (f);
1931
1932 if ((NILP (focus_frame) && f == SELECTED_FRAME ())
1933 || XFRAME (focus_frame) == f)
1934 {
1935 BLOCK_INPUT;
1936 mac_set_font_info_for_selection (f, DEFAULT_FACE_ID, 0);
1937 UNBLOCK_INPUT;
1938 }
1939 }
1940#endif
1941}
1942
1922#if TARGET_API_MAC_CARBON 1943#if TARGET_API_MAC_CARBON
1923static void 1944static void
1924mac_update_proxy_icon (f) 1945mac_update_proxy_icon (f)
@@ -2213,8 +2234,10 @@ mac_window (f)
2213#if TARGET_API_MAC_CARBON 2234#if TARGET_API_MAC_CARBON
2214 CreateNewWindow (kDocumentWindowClass, 2235 CreateNewWindow (kDocumentWindowClass,
2215 kWindowStandardDocumentAttributes 2236 kWindowStandardDocumentAttributes
2216 /* | kWindowToolbarButtonAttribute */, 2237#ifdef MAC_OSX
2217 &r, &FRAME_MAC_WINDOW (f)); 2238 | kWindowToolbarButtonAttribute
2239#endif
2240 , &r, &FRAME_MAC_WINDOW (f));
2218 if (FRAME_MAC_WINDOW (f)) 2241 if (FRAME_MAC_WINDOW (f))
2219 { 2242 {
2220 SetWRefCon (FRAME_MAC_WINDOW (f), (long) f->output_data.mac); 2243 SetWRefCon (FRAME_MAC_WINDOW (f), (long) f->output_data.mac);
@@ -4469,6 +4492,43 @@ mac_nav_event_callback (selector, parms, data)
4469#endif 4492#endif
4470 4493
4471/*********************************************************************** 4494/***********************************************************************
4495 Fonts
4496 ***********************************************************************/
4497
4498DEFUN ("mac-clear-font-name-table", Fmac_clear_font_name_table,
4499 Smac_clear_font_name_table, 0, 0, 0,
4500 doc: /* Clear the font name table. */)
4501 ()
4502{
4503 check_mac ();
4504 mac_clear_font_name_table ();
4505 return Qnil;
4506}
4507
4508#if USE_MAC_FONT_PANEL
4509DEFUN ("mac-set-font-panel-visibility", Fmac_set_font_panel_visibility,
4510 Smac_set_font_panel_visibility, 1, 1, 0,
4511 doc: /* Make the font panel visible if and only if VISIBLE is non-nil.
4512This is for internal use only. Use `mac-font-panel-mode' instead. */)
4513 (visible)
4514 Lisp_Object visible;
4515{
4516 OSStatus err = noErr;
4517
4518 check_mac ();
4519
4520 BLOCK_INPUT;
4521 if (NILP (visible) == (FPIsFontPanelVisible () == true))
4522 err = FPShowHideFontPanel ();
4523 UNBLOCK_INPUT;
4524
4525 if (err != noErr)
4526 error ("Cannot change visibility of the font panel");
4527 return Qnil;
4528}
4529#endif
4530
4531/***********************************************************************
4472 Initialization 4532 Initialization
4473 ***********************************************************************/ 4533 ***********************************************************************/
4474 4534
@@ -4484,7 +4544,7 @@ frame_parm_handler mac_frame_parm_handlers[] =
4484 x_set_border_width, 4544 x_set_border_width,
4485 x_set_cursor_color, 4545 x_set_cursor_color,
4486 x_set_cursor_type, 4546 x_set_cursor_type,
4487 x_set_font, 4547 mac_set_font,
4488 x_set_foreground_color, 4548 x_set_foreground_color,
4489 x_set_icon_name, 4549 x_set_icon_name,
4490 0, /* MAC_TODO: x_set_icon_type, */ 4550 0, /* MAC_TODO: x_set_icon_type, */
@@ -4660,7 +4720,7 @@ Chinese, Japanese, and Korean. */);
4660 load_font_func = x_load_font; 4720 load_font_func = x_load_font;
4661 find_ccl_program_func = x_find_ccl_program; 4721 find_ccl_program_func = x_find_ccl_program;
4662 query_font_func = x_query_font; 4722 query_font_func = x_query_font;
4663 set_frame_fontset_func = x_set_font; 4723 set_frame_fontset_func = mac_set_font;
4664 check_window_system_func = check_mac; 4724 check_window_system_func = check_mac;
4665 4725
4666 hourglass_atimer = NULL; 4726 hourglass_atimer = NULL;
@@ -4679,6 +4739,10 @@ Chinese, Japanese, and Korean. */);
4679#if TARGET_API_MAC_CARBON 4739#if TARGET_API_MAC_CARBON
4680 defsubr (&Sx_file_dialog); 4740 defsubr (&Sx_file_dialog);
4681#endif 4741#endif
4742 defsubr (&Smac_clear_font_name_table);
4743#if USE_MAC_FONT_PANEL
4744 defsubr (&Smac_set_font_panel_visibility);
4745#endif
4682} 4746}
4683 4747
4684/* arch-tag: d7591289-f374-4377-b245-12f5dbbb8edc 4748/* arch-tag: d7591289-f374-4377-b245-12f5dbbb8edc
diff --git a/src/macgui.h b/src/macgui.h
index c09f1a8d173..690840c6c33 100644
--- a/src/macgui.h
+++ b/src/macgui.h
@@ -105,6 +105,13 @@ typedef unsigned long Time;
105#endif 105#endif
106#endif 106#endif
107 107
108/* Whether to use the standard Font Panel floating dialog. */
109#ifndef USE_MAC_FONT_PANEL
110#if USE_ATSUI && MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
111#define USE_MAC_FONT_PANEL 1
112#endif
113#endif
114
108typedef WindowPtr Window; 115typedef WindowPtr Window;
109typedef GWorldPtr Pixmap; 116typedef GWorldPtr Pixmap;
110 117
diff --git a/src/macmenu.c b/src/macmenu.c
index be565f89259..e7d69d5657c 100644
--- a/src/macmenu.c
+++ b/src/macmenu.c
@@ -318,6 +318,7 @@ restore_menu_items (saved)
318 menu_items_n_panes = XINT (XCAR (saved)); 318 menu_items_n_panes = XINT (XCAR (saved));
319 saved = XCDR (saved); 319 saved = XCDR (saved);
320 menu_items_submenu_depth = XINT (XCAR (saved)); 320 menu_items_submenu_depth = XINT (XCAR (saved));
321 return Qnil;
321} 322}
322 323
323/* Push the whole state of menu_items processing onto the specpdl. 324/* Push the whole state of menu_items processing onto the specpdl.
@@ -634,6 +635,7 @@ cleanup_popup_menu (arg)
634 Lisp_Object arg; 635 Lisp_Object arg;
635{ 636{
636 discard_menu_items (); 637 discard_menu_items ();
638 return Qnil;
637} 639}
638 640
639DEFUN ("x-popup-menu", Fx_popup_menu, Sx_popup_menu, 2, 2, 0, 641DEFUN ("x-popup-menu", Fx_popup_menu, Sx_popup_menu, 2, 2, 0,
diff --git a/src/macselect.c b/src/macselect.c
index fe4a7c8eccc..1b6a1a46cc3 100644
--- a/src/macselect.c
+++ b/src/macselect.c
@@ -1,5 +1,5 @@
1/* Selection processing for Emacs on Mac OS. 1/* Selection processing for Emacs on Mac OS.
2 Copyright (C) 2005 Free Software Foundation, Inc. 2 Copyright (C) 2005, 2006 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
@@ -101,7 +101,7 @@ static Lisp_Object Qmac_scrap_name, Qmac_ostype;
101 101
102#ifdef MAC_OSX 102#ifdef MAC_OSX
103/* Selection name for communication via Services menu. */ 103/* Selection name for communication via Services menu. */
104static Lisp_Object Vmac_services_selection; 104static Lisp_Object Vmac_service_selection;
105#endif 105#endif
106 106
107/* Get a reference to the scrap corresponding to the symbol SYM. The 107/* Get a reference to the scrap corresponding to the symbol SYM. The
@@ -918,8 +918,8 @@ static struct
918 int size, count; 918 int size, count;
919} deferred_apple_events; 919} deferred_apple_events;
920extern Lisp_Object Qundefined; 920extern Lisp_Object Qundefined;
921extern OSErr mac_store_apple_event P_ ((Lisp_Object, Lisp_Object, 921extern void mac_store_apple_event P_ ((Lisp_Object, Lisp_Object,
922 const AEDesc *)); 922 const AEDesc *));
923 923
924struct apple_event_binding 924struct apple_event_binding
925{ 925{
@@ -1079,9 +1079,8 @@ mac_handle_apple_event (apple_event, reply, refcon)
1079 { 1079 {
1080 if (INTEGERP (binding)) 1080 if (INTEGERP (binding))
1081 return XINT (binding); 1081 return XINT (binding);
1082 err = mac_store_apple_event (class_key, id_key, apple_event); 1082 mac_store_apple_event (class_key, id_key, apple_event);
1083 if (err == noErr) 1083 return noErr;
1084 return noErr;
1085 } 1084 }
1086 } 1085 }
1087 return errAEEventNotHandled; 1086 return errAEEventNotHandled;
@@ -1146,6 +1145,198 @@ DEFUN ("mac-process-deferred-apple-events", Fmac_process_deferred_apple_events,
1146} 1145}
1147 1146
1148 1147
1148#if TARGET_API_MAC_CARBON
1149static Lisp_Object Vmac_dnd_known_types;
1150static pascal OSErr mac_do_track_drag P_ ((DragTrackingMessage, WindowRef,
1151 void *, DragRef));
1152static pascal OSErr mac_do_receive_drag P_ ((WindowRef, void *, DragRef));
1153static DragTrackingHandlerUPP mac_do_track_dragUPP = NULL;
1154static DragReceiveHandlerUPP mac_do_receive_dragUPP = NULL;
1155
1156extern void mac_store_drag_event P_ ((WindowRef, Point, SInt16,
1157 const AEDesc *));
1158
1159static pascal OSErr
1160mac_do_track_drag (message, window, refcon, drag)
1161 DragTrackingMessage message;
1162 WindowRef window;
1163 void *refcon;
1164 DragRef drag;
1165{
1166 OSErr err = noErr;
1167 static int can_accept;
1168 UInt16 num_items, index;
1169
1170 if (GetFrontWindowOfClass (kMovableModalWindowClass, false))
1171 return dragNotAcceptedErr;
1172
1173 switch (message)
1174 {
1175 case kDragTrackingEnterHandler:
1176 err = CountDragItems (drag, &num_items);
1177 if (err != noErr)
1178 break;
1179 can_accept = 0;
1180 for (index = 1; index <= num_items; index++)
1181 {
1182 ItemReference item;
1183 FlavorFlags flags;
1184 Lisp_Object rest;
1185
1186 err = GetDragItemReferenceNumber (drag, index, &item);
1187 if (err != noErr)
1188 continue;
1189 for (rest = Vmac_dnd_known_types; CONSP (rest); rest = XCDR (rest))
1190 {
1191 Lisp_Object str;
1192 FlavorType type;
1193
1194 str = XCAR (rest);
1195 if (!(STRINGP (str) && SBYTES (str) == 4))
1196 continue;
1197 type = EndianU32_BtoN (*((UInt32 *) SDATA (str)));
1198
1199 err = GetFlavorFlags (drag, item, type, &flags);
1200 if (err == noErr)
1201 {
1202 can_accept = 1;
1203 break;
1204 }
1205 }
1206 }
1207 break;
1208
1209 case kDragTrackingEnterWindow:
1210 if (can_accept)
1211 {
1212 RgnHandle hilite_rgn = NewRgn ();
1213
1214 if (hilite_rgn)
1215 {
1216 Rect r;
1217
1218 GetWindowPortBounds (window, &r);
1219 OffsetRect (&r, -r.left, -r.top);
1220 RectRgn (hilite_rgn, &r);
1221 ShowDragHilite (drag, hilite_rgn, true);
1222 DisposeRgn (hilite_rgn);
1223 }
1224 SetThemeCursor (kThemeCopyArrowCursor);
1225 }
1226 break;
1227
1228 case kDragTrackingInWindow:
1229 break;
1230
1231 case kDragTrackingLeaveWindow:
1232 if (can_accept)
1233 {
1234 HideDragHilite (drag);
1235 SetThemeCursor (kThemeArrowCursor);
1236 }
1237 break;
1238
1239 case kDragTrackingLeaveHandler:
1240 break;
1241 }
1242
1243 if (err != noErr)
1244 return dragNotAcceptedErr;
1245 return noErr;
1246}
1247
1248static pascal OSErr
1249mac_do_receive_drag (window, refcon, drag)
1250 WindowRef window;
1251 void *refcon;
1252 DragRef drag;
1253{
1254 OSErr err;
1255 int num_types, i;
1256 Lisp_Object rest, str;
1257 FlavorType *types;
1258 AppleEvent apple_event;
1259 Point mouse_pos;
1260 SInt16 modifiers;
1261
1262 if (GetFrontWindowOfClass (kMovableModalWindowClass, false))
1263 return dragNotAcceptedErr;
1264
1265 num_types = 0;
1266 for (rest = Vmac_dnd_known_types; CONSP (rest); rest = XCDR (rest))
1267 {
1268 str = XCAR (rest);
1269 if (STRINGP (str) && SBYTES (str) == 4)
1270 num_types++;
1271 }
1272
1273 types = xmalloc (sizeof (FlavorType) * num_types);
1274 i = 0;
1275 for (rest = Vmac_dnd_known_types; CONSP (rest); rest = XCDR (rest))
1276 {
1277 str = XCAR (rest);
1278 if (STRINGP (str) && SBYTES (str) == 4)
1279 types[i++] = EndianU32_BtoN (*((UInt32 *) SDATA (str)));
1280 }
1281
1282 err = create_apple_event_from_drag_ref (drag, num_types, types,
1283 &apple_event);
1284 xfree (types);
1285
1286 if (err == noErr)
1287 err = GetDragMouse (drag, &mouse_pos, NULL);
1288 if (err == noErr)
1289 {
1290 GlobalToLocal (&mouse_pos);
1291 err = GetDragModifiers (drag, NULL, NULL, &modifiers);
1292 }
1293
1294 if (err == noErr)
1295 {
1296 mac_store_drag_event (window, mouse_pos, modifiers, &apple_event);
1297 AEDisposeDesc (&apple_event);
1298 /* Post a harmless event so as to wake up from ReceiveNextEvent. */
1299 mac_post_mouse_moved_event ();
1300 return noErr;
1301 }
1302 else
1303 return dragNotAcceptedErr;
1304}
1305#endif /* TARGET_API_MAC_CARBON */
1306
1307OSErr
1308install_drag_handler (window)
1309 WindowRef window;
1310{
1311 OSErr err = noErr;
1312
1313#if TARGET_API_MAC_CARBON
1314 if (mac_do_track_dragUPP == NULL)
1315 mac_do_track_dragUPP = NewDragTrackingHandlerUPP (mac_do_track_drag);
1316 if (mac_do_receive_dragUPP == NULL)
1317 mac_do_receive_dragUPP = NewDragReceiveHandlerUPP (mac_do_receive_drag);
1318
1319 err = InstallTrackingHandler (mac_do_track_dragUPP, window, NULL);
1320 if (err == noErr)
1321 err = InstallReceiveHandler (mac_do_receive_dragUPP, window, NULL);
1322#endif
1323
1324 return err;
1325}
1326
1327void
1328remove_drag_handler (window)
1329 WindowRef window;
1330{
1331#if TARGET_API_MAC_CARBON
1332 if (mac_do_track_dragUPP)
1333 RemoveTrackingHandler (mac_do_track_dragUPP, window);
1334 if (mac_do_receive_dragUPP)
1335 RemoveReceiveHandler (mac_do_receive_dragUPP, window);
1336#endif
1337}
1338
1339
1149#ifdef MAC_OSX 1340#ifdef MAC_OSX
1150void 1341void
1151init_service_handler () 1342init_service_handler ()
@@ -1158,7 +1349,7 @@ init_service_handler ()
1158 GetEventTypeCount (specs), specs, NULL, NULL); 1349 GetEventTypeCount (specs), specs, NULL, NULL);
1159} 1350}
1160 1351
1161extern OSErr mac_store_services_event P_ ((EventRef)); 1352extern OSStatus mac_store_service_event P_ ((EventRef));
1162 1353
1163static OSStatus 1354static OSStatus
1164copy_scrap_flavor_data (from_scrap, to_scrap, flavor_type) 1355copy_scrap_flavor_data (from_scrap, to_scrap, flavor_type)
@@ -1215,12 +1406,12 @@ mac_handle_service_event (call_ref, event, data)
1215 Lisp_Object rest; 1406 Lisp_Object rest;
1216 ScrapFlavorType flavor_type; 1407 ScrapFlavorType flavor_type;
1217 1408
1218 /* Check if Vmac_services_selection is a valid selection that has a 1409 /* Check if Vmac_service_selection is a valid selection that has a
1219 corresponding scrap. */ 1410 corresponding scrap. */
1220 if (!SYMBOLP (Vmac_services_selection)) 1411 if (!SYMBOLP (Vmac_service_selection))
1221 err = eventNotHandledErr; 1412 err = eventNotHandledErr;
1222 else 1413 else
1223 err = get_scrap_from_symbol (Vmac_services_selection, 0, &cur_scrap); 1414 err = get_scrap_from_symbol (Vmac_service_selection, 0, &cur_scrap);
1224 if (!(err == noErr && cur_scrap)) 1415 if (!(err == noErr && cur_scrap))
1225 return eventNotHandledErr; 1416 return eventNotHandledErr;
1226 1417
@@ -1257,7 +1448,7 @@ mac_handle_service_event (call_ref, event, data)
1257 if (err != noErr) 1448 if (err != noErr)
1258 break; 1449 break;
1259 1450
1260 if (NILP (Fx_selection_owner_p (Vmac_services_selection))) 1451 if (NILP (Fx_selection_owner_p (Vmac_service_selection)))
1261 break; 1452 break;
1262 else 1453 else
1263 goto copy_all_flavors; 1454 goto copy_all_flavors;
@@ -1267,7 +1458,7 @@ mac_handle_service_event (call_ref, event, data)
1267 typeScrapRef, NULL, 1458 typeScrapRef, NULL,
1268 sizeof (ScrapRef), NULL, &specific_scrap); 1459 sizeof (ScrapRef), NULL, &specific_scrap);
1269 if (err != noErr 1460 if (err != noErr
1270 || NILP (Fx_selection_owner_p (Vmac_services_selection))) 1461 || NILP (Fx_selection_owner_p (Vmac_service_selection)))
1271 { 1462 {
1272 err = eventNotHandledErr; 1463 err = eventNotHandledErr;
1273 break; 1464 break;
@@ -1342,7 +1533,7 @@ mac_handle_service_event (call_ref, event, data)
1342 if (!data_exists_p) 1533 if (!data_exists_p)
1343 err = eventNotHandledErr; 1534 err = eventNotHandledErr;
1344 else 1535 else
1345 err = mac_store_services_event (event); 1536 err = mac_store_service_event (event);
1346 } 1537 }
1347 break; 1538 break;
1348 } 1539 }
@@ -1408,10 +1599,21 @@ set to nil. */);
1408 doc: /* Keymap for Apple events handled by Emacs. */); 1599 doc: /* Keymap for Apple events handled by Emacs. */);
1409 Vmac_apple_event_map = Qnil; 1600 Vmac_apple_event_map = Qnil;
1410 1601
1602#if TARGET_API_MAC_CARBON
1603 DEFVAR_LISP ("mac-dnd-known-types", &Vmac_dnd_known_types,
1604 doc: /* The types accepted by default for dropped data.
1605The types are chosen in the order they appear in the list. */);
1606 Vmac_dnd_known_types = list4 (build_string ("hfs "), build_string ("utxt"),
1607 build_string ("TEXT"), build_string ("TIFF"));
1608#ifdef MAC_OSX
1609 Vmac_dnd_known_types = Fcons (build_string ("furl"), Vmac_dnd_known_types);
1610#endif
1611#endif
1612
1411#ifdef MAC_OSX 1613#ifdef MAC_OSX
1412 DEFVAR_LISP ("mac-services-selection", &Vmac_services_selection, 1614 DEFVAR_LISP ("mac-service-selection", &Vmac_service_selection,
1413 doc: /* Selection name for communication via Services menu. */); 1615 doc: /* Selection name for communication via Services menu. */);
1414 Vmac_services_selection = intern ("PRIMARY"); 1616 Vmac_service_selection = intern ("PRIMARY");
1415#endif 1617#endif
1416 1618
1417 QPRIMARY = intern ("PRIMARY"); staticpro (&QPRIMARY); 1619 QPRIMARY = intern ("PRIMARY"); staticpro (&QPRIMARY);
diff --git a/src/macterm.c b/src/macterm.c
index 8ddd8febd69..e3b8b3b5881 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -4099,6 +4099,11 @@ x_new_focus_frame (dpyinfo, frame)
4099 pending_autoraise_frame = dpyinfo->x_focus_frame; 4099 pending_autoraise_frame = dpyinfo->x_focus_frame;
4100 else 4100 else
4101 pending_autoraise_frame = 0; 4101 pending_autoraise_frame = 0;
4102
4103#if USE_MAC_FONT_PANEL
4104 if (frame)
4105 mac_set_font_info_for_selection (frame, DEFAULT_FACE_ID, 0);
4106#endif
4102 } 4107 }
4103 4108
4104 x_frame_rehighlight (dpyinfo); 4109 x_frame_rehighlight (dpyinfo);
@@ -4456,35 +4461,11 @@ scroll_bar_timer_callback (timer, data)
4456 EventLoopTimerRef timer; 4461 EventLoopTimerRef timer;
4457 void *data; 4462 void *data;
4458{ 4463{
4459 EventRef event = NULL; 4464 OSStatus err;
4460 OSErr err;
4461
4462 err = CreateEvent (NULL, kEventClassMouse, kEventMouseMoved, 0,
4463 kEventAttributeNone, &event);
4464 if (err == noErr)
4465 {
4466 Point mouse_pos;
4467
4468 GetMouse (&mouse_pos);
4469 LocalToGlobal (&mouse_pos);
4470 err = SetEventParameter (event, kEventParamMouseLocation, typeQDPoint,
4471 sizeof (Point), &mouse_pos);
4472 }
4473 if (err == noErr)
4474 {
4475 UInt32 modifiers = GetCurrentKeyModifiers ();
4476 4465
4477 err = SetEventParameter (event, kEventParamKeyModifiers, typeUInt32, 4466 err = mac_post_mouse_moved_event ();
4478 sizeof (UInt32), &modifiers);
4479 }
4480 if (err == noErr)
4481 err = PostEventToQueue (GetCurrentEventQueue (), event,
4482 kEventPriorityStandard);
4483 if (err == noErr) 4467 if (err == noErr)
4484 scroll_bar_timer_event_posted_p = 1; 4468 scroll_bar_timer_event_posted_p = 1;
4485
4486 if (event)
4487 ReleaseEvent (event);
4488} 4469}
4489 4470
4490static OSStatus 4471static OSStatus
@@ -6386,7 +6367,12 @@ x_free_frame_resources (f)
6386 f->output_data.mac = NULL; 6367 f->output_data.mac = NULL;
6387 6368
6388 if (f == dpyinfo->x_focus_frame) 6369 if (f == dpyinfo->x_focus_frame)
6389 dpyinfo->x_focus_frame = 0; 6370 {
6371 dpyinfo->x_focus_frame = 0;
6372#if USE_MAC_FONT_PANEL
6373 mac_set_font_info_for_selection (NULL, DEFAULT_FACE_ID, 0);
6374#endif
6375 }
6390 if (f == dpyinfo->x_focus_event_frame) 6376 if (f == dpyinfo->x_focus_event_frame)
6391 dpyinfo->x_focus_event_frame = 0; 6377 dpyinfo->x_focus_event_frame = 0;
6392 if (f == dpyinfo->x_highlight_frame) 6378 if (f == dpyinfo->x_highlight_frame)
@@ -6742,10 +6728,6 @@ xlfdpat_create (pattern)
6742 } 6728 }
6743 6729
6744 return pat; 6730 return pat;
6745
6746 error:
6747 xlfdpat_destroy (pat);
6748 return NULL;
6749} 6731}
6750 6732
6751static INLINE int 6733static INLINE int
@@ -6914,6 +6896,8 @@ static Lisp_Object fm_font_family_alist;
6914#if USE_ATSUI 6896#if USE_ATSUI
6915/* Hash table linking font family names to ATSU font IDs. */ 6897/* Hash table linking font family names to ATSU font IDs. */
6916static Lisp_Object atsu_font_id_hash; 6898static Lisp_Object atsu_font_id_hash;
6899static Lisp_Object Vmac_atsu_font_table;
6900extern Lisp_Object QCfamily, QCweight, QCslant, Qnormal, Qbold, Qitalic;
6917#endif 6901#endif
6918 6902
6919/* Alist linking character set strings to Mac text encoding and Emacs 6903/* Alist linking character set strings to Mac text encoding and Emacs
@@ -7209,8 +7193,21 @@ init_font_name_table ()
7209 NULL, NULL); 7193 NULL, NULL);
7210 if (err == noErr) 7194 if (err == noErr)
7211 { 7195 {
7196 FMFontFamily ff;
7197 FMFontStyle style = normal;
7198
7212 decode_mac_font_name (name, name_len + 1, Qnil); 7199 decode_mac_font_name (name, name_len + 1, Qnil);
7213 family = make_unibyte_string (name, name_len); 7200 family = make_unibyte_string (name, name_len);
7201 FMGetFontFamilyInstanceFromFont (font_ids[i], &ff, &style);
7202 Fputhash (make_unibyte_string ((char *)(font_ids + i),
7203 sizeof (ATSUFontID)),
7204 Fcons (QCfamily,
7205 list5 (family,
7206 QCweight,
7207 style & bold ? Qbold : Qnormal,
7208 QCslant,
7209 style & italic ? Qitalic : Qnormal)),
7210 Vmac_atsu_font_table);
7214 if (*name != '.' 7211 if (*name != '.'
7215 && hash_lookup (h, family, &hash_code) < 0) 7212 && hash_lookup (h, family, &hash_code) < 0)
7216 { 7213 {
@@ -7756,6 +7753,7 @@ XLoadQueryFont (Display *dpy, char *fontname)
7756 ATSUFontFeatureSelector selectors[] = {kAllTypeFeaturesOffSelector, 7753 ATSUFontFeatureSelector selectors[] = {kAllTypeFeaturesOffSelector,
7757 kDecomposeDiacriticsSelector}; 7754 kDecomposeDiacriticsSelector};
7758 Lisp_Object font_id_cons; 7755 Lisp_Object font_id_cons;
7756 FMFontStyle style;
7759 7757
7760 font_id_cons = Fgethash (make_unibyte_string (family, strlen (family)), 7758 font_id_cons = Fgethash (make_unibyte_string (family, strlen (family)),
7761 atsu_font_id_hash, Qnil); 7759 atsu_font_id_hash, Qnil);
@@ -7774,7 +7772,11 @@ XLoadQueryFont (Display *dpy, char *fontname)
7774 return NULL; 7772 return NULL;
7775 err = ATSUSetAttributes (mac_style, sizeof (tags) / sizeof (tags[0]), 7773 err = ATSUSetAttributes (mac_style, sizeof (tags) / sizeof (tags[0]),
7776 tags, sizes, values); 7774 tags, sizes, values);
7777 fontnum = -1; 7775 if (err != noErr)
7776 return NULL;
7777 err = FMGetFontFamilyInstanceFromFont (font_id, &fontnum, &style);
7778 if (err != noErr)
7779 fontnum = -1;
7778 scriptcode = kTextEncodingMacUnicode; 7780 scriptcode = kTextEncodingMacUnicode;
7779 } 7781 }
7780 else 7782 else
@@ -7834,22 +7836,20 @@ XLoadQueryFont (Display *dpy, char *fontname)
7834 pcm_init (font->bounds.rows[0], 0x100); 7836 pcm_init (font->bounds.rows[0], 0x100);
7835 7837
7836#if USE_CG_TEXT_DRAWING 7838#if USE_CG_TEXT_DRAWING
7837 { 7839 if (fontnum != -1)
7838 FMFontFamily font_family; 7840 {
7839 FMFontStyle style; 7841 FMFontStyle style;
7840 ATSFontRef ats_font; 7842 ATSFontRef ats_font;
7841 7843
7842 err = FMGetFontFamilyInstanceFromFont (font_id, &font_family, &style); 7844 err = FMGetFontFromFontFamilyInstance (fontnum, fontface,
7843 if (err == noErr)
7844 err = FMGetFontFromFontFamilyInstance (font_family, fontface,
7845 &font_id, &style); 7845 &font_id, &style);
7846 /* Use CG text drawing if italic/bold is not synthesized. */ 7846 /* Use CG text drawing if italic/bold is not synthesized. */
7847 if (err == noErr && style == fontface) 7847 if (err == noErr && style == fontface)
7848 { 7848 {
7849 ats_font = FMGetATSFontRefFromFont (font_id); 7849 ats_font = FMGetATSFontRefFromFont (font_id);
7850 font->cg_font = CGFontCreateWithPlatformFont (&ats_font); 7850 font->cg_font = CGFontCreateWithPlatformFont (&ats_font);
7851 } 7851 }
7852 } 7852 }
7853 7853
7854 if (font->cg_font) 7854 if (font->cg_font)
7855 { 7855 {
@@ -8340,6 +8340,55 @@ x_find_ccl_program (fontp)
8340 } 8340 }
8341} 8341}
8342 8342
8343#if USE_MAC_FONT_PANEL
8344OSStatus
8345mac_set_font_info_for_selection (f, face_id, c)
8346 struct frame *f;
8347 int face_id, c;
8348{
8349 OSStatus err;
8350 EventTargetRef target = NULL;
8351 XFontStruct *font = NULL;
8352
8353 if (f)
8354 {
8355 target = GetWindowEventTarget (FRAME_MAC_WINDOW (f));
8356
8357 if (FRAME_FACE_CACHE (f) && CHAR_VALID_P (c, 0))
8358 {
8359 struct face *face;
8360
8361 face_id = FACE_FOR_CHAR (f, FACE_FROM_ID (f, face_id), c);
8362 face = FACE_FROM_ID (f, face_id);
8363 font = face->font;
8364 }
8365 }
8366
8367 if (font == NULL)
8368 err = SetFontInfoForSelection (kFontSelectionATSUIType, 0, NULL, target);
8369 else
8370 {
8371 if (font->mac_fontnum != -1)
8372 {
8373 FontSelectionQDStyle qd_style;
8374
8375 qd_style.version = kFontSelectionQDStyleVersionZero;
8376 qd_style.instance.fontFamily = font->mac_fontnum;
8377 qd_style.instance.fontStyle = font->mac_fontface;
8378 qd_style.size = font->mac_fontsize;
8379 qd_style.hasColor = false;
8380
8381 err = SetFontInfoForSelection (kFontSelectionQDType,
8382 1, &qd_style, target);
8383 }
8384 else
8385 err = SetFontInfoForSelection (kFontSelectionATSUIType,
8386 1, &font->mac_style, target);
8387 }
8388
8389 return err;
8390}
8391#endif
8343 8392
8344 8393
8345/* The Mac Event loop code */ 8394/* The Mac Event loop code */
@@ -8427,6 +8476,14 @@ Point saved_menu_event_location;
8427/* Apple Events */ 8476/* Apple Events */
8428#if USE_CARBON_EVENTS 8477#if USE_CARBON_EVENTS
8429static Lisp_Object Qhicommand; 8478static Lisp_Object Qhicommand;
8479#ifdef MAC_OSX
8480extern Lisp_Object Qwindow;
8481static Lisp_Object Qtoolbar_switch_mode;
8482#endif
8483#if USE_MAC_FONT_PANEL
8484extern Lisp_Object Qfont;
8485static Lisp_Object Qpanel_closed, Qselection;
8486#endif
8430#endif 8487#endif
8431extern int mac_ready_for_apple_events; 8488extern int mac_ready_for_apple_events;
8432extern Lisp_Object Qundefined; 8489extern Lisp_Object Qundefined;
@@ -8436,18 +8493,14 @@ extern void mac_find_apple_event_spec P_ ((AEEventClass, AEEventID,
8436 Lisp_Object *)); 8493 Lisp_Object *));
8437extern OSErr init_coercion_handler P_ ((void)); 8494extern OSErr init_coercion_handler P_ ((void));
8438 8495
8439#if TARGET_API_MAC_CARBON
8440/* Drag and Drop */ 8496/* Drag and Drop */
8441static pascal OSErr mac_do_track_drag (DragTrackingMessage, WindowPtr, void*, DragReference); 8497OSErr install_drag_handler P_ ((WindowRef));
8442static pascal OSErr mac_do_receive_drag (WindowPtr, void*, DragReference); 8498void remove_drag_handler P_ ((WindowRef));
8443static DragTrackingHandlerUPP mac_do_track_dragUPP = NULL;
8444static DragReceiveHandlerUPP mac_do_receive_dragUPP = NULL;
8445#endif
8446 8499
8447#if USE_CARBON_EVENTS 8500#if USE_CARBON_EVENTS
8448#ifdef MAC_OSX 8501#ifdef MAC_OSX
8449extern void init_service_handler (); 8502extern void init_service_handler ();
8450static Lisp_Object Qservices, Qpaste, Qperform; 8503static Lisp_Object Qservice, Qpaste, Qperform;
8451#endif 8504#endif
8452/* Window Event Handler */ 8505/* Window Event Handler */
8453static pascal OSStatus mac_handle_window_event (EventHandlerCallRef, 8506static pascal OSStatus mac_handle_window_event (EventHandlerCallRef,
@@ -8998,47 +9051,84 @@ do_zoom_window (WindowPtr w, int zoom_in_or_out)
8998 x_real_positions (f, &f->left_pos, &f->top_pos); 9051 x_real_positions (f, &f->left_pos, &f->top_pos);
8999} 9052}
9000 9053
9001OSErr 9054void
9002mac_store_apple_event (class, id, desc) 9055mac_store_apple_event (class, id, desc)
9003 Lisp_Object class, id; 9056 Lisp_Object class, id;
9004 const AEDesc *desc; 9057 const AEDesc *desc;
9005{ 9058{
9006 OSErr err;
9007 struct input_event buf; 9059 struct input_event buf;
9008 AEDesc *desc_copy;
9009 9060
9010 desc_copy = xmalloc (sizeof (AEDesc)); 9061 EVENT_INIT (buf);
9011 err = AEDuplicateDesc (desc, desc_copy); 9062
9012 if (err == noErr) 9063 buf.kind = MAC_APPLE_EVENT;
9013 { 9064 buf.x = class;
9014 EVENT_INIT (buf); 9065 buf.y = id;
9066 XSETFRAME (buf.frame_or_window,
9067 mac_focus_frame (&one_mac_display_info));
9068 /* Now that Lisp object allocations are protected by BLOCK_INPUT, it
9069 is safe to use them during read_socket_hook. */
9070 buf.arg = mac_aedesc_to_lisp (desc);
9071 kbd_buffer_store_event (&buf);
9072}
9015 9073
9016 buf.kind = MAC_APPLE_EVENT; 9074#if TARGET_API_MAC_CARBON
9017 buf.x = class; 9075static OSStatus
9018 buf.y = id; 9076mac_store_event_ref_as_apple_event (class, id, class_key, id_key,
9019 buf.code = (int)desc_copy; 9077 event, num_params, names, types)
9020 XSETFRAME (buf.frame_or_window, 9078 AEEventClass class;
9021 mac_focus_frame (&one_mac_display_info)); 9079 AEEventID id;
9022 buf.arg = Qnil; 9080 Lisp_Object class_key, id_key;
9023 kbd_buffer_store_event (&buf); 9081 EventRef event;
9082 UInt32 num_params;
9083 EventParamName *names;
9084 EventParamType *types;
9085{
9086 OSStatus err = eventNotHandledErr;
9087 Lisp_Object binding;
9088
9089 mac_find_apple_event_spec (class, id, &class_key, &id_key, &binding);
9090 if (!NILP (binding) && !EQ (binding, Qundefined))
9091 {
9092 if (INTEGERP (binding))
9093 err = XINT (binding);
9094 else
9095 {
9096 AppleEvent apple_event;
9097 err = create_apple_event_from_event_ref (event, num_params,
9098 names, types,
9099 &apple_event);
9100 if (err == noErr)
9101 {
9102 mac_store_apple_event (class_key, id_key, &apple_event);
9103 AEDisposeDesc (&apple_event);
9104 }
9105 }
9024 } 9106 }
9025 9107
9026 return err; 9108 return err;
9027} 9109}
9028 9110
9029Lisp_Object 9111void
9030mac_make_lispy_event_code (code) 9112mac_store_drag_event (window, mouse_pos, modifiers, desc)
9031 int code; 9113 WindowRef window;
9114 Point mouse_pos;
9115 SInt16 modifiers;
9116 const AEDesc *desc;
9032{ 9117{
9033 AEDesc *desc = (AEDesc *)code; 9118 struct input_event buf;
9034 Lisp_Object obj;
9035 9119
9036 obj = mac_aedesc_to_lisp (desc); 9120 EVENT_INIT (buf);
9037 AEDisposeDesc (desc);
9038 xfree (desc);
9039 9121
9040 return obj; 9122 buf.kind = DRAG_N_DROP_EVENT;
9123 buf.modifiers = mac_to_emacs_modifiers (modifiers);
9124 buf.timestamp = TickCount () * (1000 / 60);
9125 XSETINT (buf.x, mouse_pos.h);
9126 XSETINT (buf.y, mouse_pos.v);
9127 XSETFRAME (buf.frame_or_window, mac_window_to_frame (window));
9128 buf.arg = mac_aedesc_to_lisp (desc);
9129 kbd_buffer_store_event (&buf);
9041} 9130}
9131#endif
9042 9132
9043#if USE_CARBON_EVENTS 9133#if USE_CARBON_EVENTS
9044static pascal OSStatus 9134static pascal OSStatus
@@ -9049,7 +9139,11 @@ mac_handle_command_event (next_handler, event, data)
9049{ 9139{
9050 OSStatus result, err; 9140 OSStatus result, err;
9051 HICommand command; 9141 HICommand command;
9052 Lisp_Object class_key, id_key, binding; 9142 static EventParamName names[] = {kEventParamDirectObject,
9143 kEventParamKeyModifiers};
9144 static EventParamType types[] = {typeHICommand,
9145 typeUInt32};
9146 int num_params = sizeof (names) / sizeof (names[0]);
9053 9147
9054 result = CallNextEventHandler (next_handler, event); 9148 result = CallNextEventHandler (next_handler, event);
9055 if (result != eventNotHandledErr) 9149 if (result != eventNotHandledErr)
@@ -9063,33 +9157,10 @@ mac_handle_command_event (next_handler, event, data)
9063 9157
9064 /* A HICommand event is mapped to an Apple event whose event class 9158 /* A HICommand event is mapped to an Apple event whose event class
9065 symbol is `hicommand' and event ID is its command ID. */ 9159 symbol is `hicommand' and event ID is its command ID. */
9066 class_key = Qhicommand; 9160 err = mac_store_event_ref_as_apple_event (0, command.commandID,
9067 mac_find_apple_event_spec (0, command.commandID, 9161 Qhicommand, Qnil,
9068 &class_key, &id_key, &binding); 9162 event, num_params, names, types);
9069 if (!NILP (binding) && !EQ (binding, Qundefined)) 9163 return err == noErr ? noErr : eventNotHandledErr;
9070 {
9071 if (INTEGERP (binding))
9072 return XINT (binding);
9073 else
9074 {
9075 AppleEvent apple_event;
9076 static EventParamName names[] = {kEventParamDirectObject,
9077 kEventParamKeyModifiers};
9078 static EventParamType types[] = {typeHICommand,
9079 typeUInt32};
9080 err = create_apple_event_from_event_ref (event, 2, names, types,
9081 &apple_event);
9082 if (err == noErr)
9083 {
9084 err = mac_store_apple_event (class_key, id_key, &apple_event);
9085 AEDisposeDesc (&apple_event);
9086 }
9087 if (err == noErr)
9088 return noErr;
9089 }
9090 }
9091
9092 return eventNotHandledErr;
9093} 9164}
9094 9165
9095static OSErr 9166static OSErr
@@ -9192,6 +9263,33 @@ mac_handle_window_event (next_handler, event, data)
9192 return noErr; 9263 return noErr;
9193 9264
9194 break; 9265 break;
9266
9267#ifdef MAC_OSX
9268 case kEventWindowToolbarSwitchMode:
9269 result = CallNextEventHandler (next_handler, event);
9270 {
9271 static EventParamName names[] = {kEventParamDirectObject,
9272 kEventParamWindowMouseLocation,
9273 kEventParamKeyModifiers,
9274 kEventParamMouseButton,
9275 kEventParamClickCount,
9276 kEventParamMouseChord};
9277 static EventParamType types[] = {typeWindowRef,
9278 typeQDPoint,
9279 typeUInt32,
9280 typeMouseButton,
9281 typeUInt32,
9282 typeUInt32};
9283 int num_params = sizeof (names) / sizeof (names[0]);
9284
9285 err = mac_store_event_ref_as_apple_event (0, 0,
9286 Qwindow,
9287 Qtoolbar_switch_mode,
9288 event, num_params,
9289 names, types);
9290 }
9291 return err == noErr ? noErr : result;
9292#endif
9195 } 9293 }
9196 9294
9197 return eventNotHandledErr; 9295 return eventNotHandledErr;
@@ -9266,45 +9364,96 @@ mac_handle_mouse_event (next_handler, event, data)
9266 return eventNotHandledErr; 9364 return eventNotHandledErr;
9267} 9365}
9268 9366
9367#if USE_MAC_FONT_PANEL
9368static pascal OSStatus
9369mac_handle_font_event (next_handler, event, data)
9370 EventHandlerCallRef next_handler;
9371 EventRef event;
9372 void *data;
9373{
9374 OSStatus result, err;
9375 Lisp_Object id_key;
9376 int num_params;
9377 EventParamName *names;
9378 EventParamType *types;
9379 static EventParamName names_sel[] = {kEventParamATSUFontID,
9380 kEventParamATSUFontSize,
9381 kEventParamFMFontFamily,
9382 kEventParamFMFontSize,
9383 kEventParamFontColor};
9384 static EventParamType types_sel[] = {typeATSUFontID,
9385 typeATSUSize,
9386 typeFMFontFamily,
9387 typeFMFontSize,
9388 typeFontColor};
9389
9390 result = CallNextEventHandler (next_handler, event);
9391 if (result != eventNotHandledErr)
9392 return result;
9393
9394 switch (GetEventKind (event))
9395 {
9396 case kEventFontPanelClosed:
9397 id_key = Qpanel_closed;
9398 num_params = 0;
9399 names = NULL;
9400 types = NULL;
9401 break;
9402
9403 case kEventFontSelection:
9404 id_key = Qselection;
9405 num_params = sizeof (names_sel) / sizeof (names_sel[0]);
9406 names = names_sel;
9407 types = types_sel;
9408 break;
9409 }
9410
9411 err = mac_store_event_ref_as_apple_event (0, 0, Qfont, id_key,
9412 event, num_params,
9413 names, types);
9414
9415 return err == noErr ? noErr : eventNotHandledErr;
9416}
9417#endif
9418
9269#ifdef MAC_OSX 9419#ifdef MAC_OSX
9270OSErr 9420OSStatus
9271mac_store_services_event (event) 9421mac_store_service_event (event)
9272 EventRef event; 9422 EventRef event;
9273{ 9423{
9274 OSErr err; 9424 OSStatus err;
9275 AppleEvent apple_event;
9276 Lisp_Object id_key; 9425 Lisp_Object id_key;
9426 int num_params;
9427 EventParamName *names;
9428 EventParamType *types;
9429 static EventParamName names_pfm[] = {kEventParamServiceMessageName,
9430 kEventParamServiceUserData};
9431 static EventParamType types_pfm[] = {typeCFStringRef,
9432 typeCFStringRef};
9277 9433
9278 switch (GetEventKind (event)) 9434 switch (GetEventKind (event))
9279 { 9435 {
9280 case kEventServicePaste: 9436 case kEventServicePaste:
9281 id_key = Qpaste; 9437 id_key = Qpaste;
9282 err = create_apple_event_from_event_ref (event, 0, NULL, NULL, 9438 num_params = 0;
9283 &apple_event); 9439 names = NULL;
9440 types = NULL;
9284 break; 9441 break;
9285 9442
9286 case kEventServicePerform: 9443 case kEventServicePerform:
9287 { 9444 id_key = Qperform;
9288 static EventParamName names[] = {kEventParamServiceMessageName, 9445 num_params = sizeof (names_pfm) / sizeof (names_pfm[0]);
9289 kEventParamServiceUserData}; 9446 names = names_pfm;
9290 static EventParamType types[] = {typeCFStringRef, 9447 types = types_pfm;
9291 typeCFStringRef};
9292
9293 id_key = Qperform;
9294 err = create_apple_event_from_event_ref (event, 2, names, types,
9295 &apple_event);
9296 }
9297 break; 9448 break;
9298 9449
9299 default: 9450 default:
9300 abort (); 9451 abort ();
9301 } 9452 }
9302 9453
9303 if (err == noErr) 9454 err = mac_store_event_ref_as_apple_event (0, 0, Qservice, id_key,
9304 { 9455 event, num_params,
9305 err = mac_store_apple_event (Qservices, id_key, &apple_event); 9456 names, types);
9306 AEDisposeDesc (&apple_event);
9307 }
9308 9457
9309 return err; 9458 return err;
9310} 9459}
@@ -9324,15 +9473,28 @@ install_window_handler (window)
9324 {kEventClassWindow, kEventWindowShown}, 9473 {kEventClassWindow, kEventWindowShown},
9325 {kEventClassWindow, kEventWindowHidden}, 9474 {kEventClassWindow, kEventWindowHidden},
9326 {kEventClassWindow, kEventWindowExpanded}, 9475 {kEventClassWindow, kEventWindowExpanded},
9327 {kEventClassWindow, kEventWindowCollapsed}}; 9476 {kEventClassWindow, kEventWindowCollapsed},
9477#ifdef MAC_OSX
9478 {kEventClassWindow, kEventWindowToolbarSwitchMode},
9479#endif
9480 };
9328 EventTypeSpec specs_mouse[] = {{kEventClassMouse, kEventMouseWheelMoved}}; 9481 EventTypeSpec specs_mouse[] = {{kEventClassMouse, kEventMouseWheelMoved}};
9329 static EventHandlerUPP handle_window_eventUPP = NULL; 9482 static EventHandlerUPP handle_window_eventUPP = NULL;
9330 static EventHandlerUPP handle_mouse_eventUPP = NULL; 9483 static EventHandlerUPP handle_mouse_eventUPP = NULL;
9484#if USE_MAC_FONT_PANEL
9485 EventTypeSpec specs_font[] = {{kEventClassFont, kEventFontPanelClosed},
9486 {kEventClassFont, kEventFontSelection}};
9487 static EventHandlerUPP handle_font_eventUPP = NULL;
9488#endif
9331 9489
9332 if (handle_window_eventUPP == NULL) 9490 if (handle_window_eventUPP == NULL)
9333 handle_window_eventUPP = NewEventHandlerUPP (mac_handle_window_event); 9491 handle_window_eventUPP = NewEventHandlerUPP (mac_handle_window_event);
9334 if (handle_mouse_eventUPP == NULL) 9492 if (handle_mouse_eventUPP == NULL)
9335 handle_mouse_eventUPP = NewEventHandlerUPP (mac_handle_mouse_event); 9493 handle_mouse_eventUPP = NewEventHandlerUPP (mac_handle_mouse_event);
9494#if USE_MAC_FONT_PANEL
9495 if (handle_font_eventUPP == NULL)
9496 handle_font_eventUPP = NewEventHandlerUPP (mac_handle_font_event);
9497#endif
9336 err = InstallWindowEventHandler (window, handle_window_eventUPP, 9498 err = InstallWindowEventHandler (window, handle_window_eventUPP,
9337 GetEventTypeCount (specs_window), 9499 GetEventTypeCount (specs_window),
9338 specs_window, NULL, NULL); 9500 specs_window, NULL, NULL);
@@ -9340,18 +9502,16 @@ install_window_handler (window)
9340 err = InstallWindowEventHandler (window, handle_mouse_eventUPP, 9502 err = InstallWindowEventHandler (window, handle_mouse_eventUPP,
9341 GetEventTypeCount (specs_mouse), 9503 GetEventTypeCount (specs_mouse),
9342 specs_mouse, NULL, NULL); 9504 specs_mouse, NULL, NULL);
9343#endif 9505#if USE_MAC_FONT_PANEL
9344#if TARGET_API_MAC_CARBON
9345 if (mac_do_track_dragUPP == NULL)
9346 mac_do_track_dragUPP = NewDragTrackingHandlerUPP (mac_do_track_drag);
9347 if (mac_do_receive_dragUPP == NULL)
9348 mac_do_receive_dragUPP = NewDragReceiveHandlerUPP (mac_do_receive_drag);
9349
9350 if (err == noErr) 9506 if (err == noErr)
9351 err = InstallTrackingHandler (mac_do_track_dragUPP, window, NULL); 9507 err = InstallWindowEventHandler (window, handle_font_eventUPP,
9352 if (err == noErr) 9508 GetEventTypeCount (specs_font),
9353 err = InstallReceiveHandler (mac_do_receive_dragUPP, window, NULL); 9509 specs_font, NULL, NULL);
9510#endif
9354#endif 9511#endif
9512 if (err == noErr)
9513 err = install_drag_handler (window);
9514
9355 return err; 9515 return err;
9356} 9516}
9357 9517
@@ -9359,167 +9519,9 @@ void
9359remove_window_handler (window) 9519remove_window_handler (window)
9360 WindowPtr window; 9520 WindowPtr window;
9361{ 9521{
9362#if TARGET_API_MAC_CARBON 9522 remove_drag_handler (window);
9363 if (mac_do_track_dragUPP)
9364 RemoveTrackingHandler (mac_do_track_dragUPP, window);
9365 if (mac_do_receive_dragUPP)
9366 RemoveReceiveHandler (mac_do_receive_dragUPP, window);
9367#endif
9368} 9523}
9369 9524
9370#if TARGET_API_MAC_CARBON
9371static pascal OSErr
9372mac_do_track_drag (DragTrackingMessage message, WindowPtr window,
9373 void *handlerRefCon, DragReference theDrag)
9374{
9375 static int can_accept;
9376 short items;
9377 short index;
9378 ItemReference theItem;
9379 FlavorFlags theFlags;
9380 OSErr result;
9381
9382 if (GetFrontWindowOfClass (kMovableModalWindowClass, false))
9383 return dragNotAcceptedErr;
9384
9385 switch (message)
9386 {
9387 case kDragTrackingEnterHandler:
9388 CountDragItems (theDrag, &items);
9389 can_accept = 0;
9390 for (index = 1; index <= items; index++)
9391 {
9392 GetDragItemReferenceNumber (theDrag, index, &theItem);
9393 result = GetFlavorFlags (theDrag, theItem, flavorTypeHFS, &theFlags);
9394 if (result == noErr)
9395 {
9396 can_accept = 1;
9397 break;
9398 }
9399 }
9400 break;
9401
9402 case kDragTrackingEnterWindow:
9403 if (can_accept)
9404 {
9405 RgnHandle hilite_rgn = NewRgn ();
9406 Rect r;
9407 struct frame *f = mac_window_to_frame (window);
9408
9409 GetWindowPortBounds (window, &r);
9410 OffsetRect (&r, -r.left, -r.top);
9411 RectRgn (hilite_rgn, &r);
9412 ShowDragHilite (theDrag, hilite_rgn, true);
9413 DisposeRgn (hilite_rgn);
9414 SetThemeCursor (kThemeCopyArrowCursor);
9415 }
9416 break;
9417
9418 case kDragTrackingInWindow:
9419 break;
9420
9421 case kDragTrackingLeaveWindow:
9422 if (can_accept)
9423 {
9424 struct frame *f = mac_window_to_frame (window);
9425
9426 HideDragHilite (theDrag);
9427 SetThemeCursor (kThemeArrowCursor);
9428 }
9429 break;
9430
9431 case kDragTrackingLeaveHandler:
9432 break;
9433 }
9434
9435 return noErr;
9436}
9437
9438static pascal OSErr
9439mac_do_receive_drag (WindowPtr window, void *handlerRefCon,
9440 DragReference theDrag)
9441{
9442 short items;
9443 short index;
9444 FlavorFlags theFlags;
9445 Point mouse;
9446 OSErr result;
9447 ItemReference theItem;
9448 HFSFlavor data;
9449 Size size = sizeof (HFSFlavor);
9450 Lisp_Object file_list;
9451
9452 if (GetFrontWindowOfClass (kMovableModalWindowClass, false))
9453 return dragNotAcceptedErr;
9454
9455 file_list = Qnil;
9456 GetDragMouse (theDrag, &mouse, 0L);
9457 CountDragItems (theDrag, &items);
9458 for (index = 1; index <= items; index++)
9459 {
9460 /* Only handle file references. */
9461 GetDragItemReferenceNumber (theDrag, index, &theItem);
9462 result = GetFlavorFlags (theDrag, theItem, flavorTypeHFS, &theFlags);
9463 if (result == noErr)
9464 {
9465 OSErr err;
9466 AEDesc desc;
9467
9468 err = GetFlavorData (theDrag, theItem, flavorTypeHFS,
9469 &data, &size, 0L);
9470 if (err == noErr)
9471 err = AECoercePtr (typeFSS, &data.fileSpec, sizeof (FSSpec),
9472 TYPE_FILE_NAME, &desc);
9473 if (err == noErr)
9474 {
9475 Lisp_Object file;
9476
9477 /* x-dnd functions expect undecoded filenames. */
9478 file = make_uninit_string (AEGetDescDataSize (&desc));
9479 err = AEGetDescData (&desc, SDATA (file), SBYTES (file));
9480 if (err == noErr)
9481 file_list = Fcons (file, file_list);
9482 AEDisposeDesc (&desc);
9483 }
9484 }
9485 }
9486 /* If there are items in the list, construct an event and post it to
9487 the queue like an interrupt using kbd_buffer_store_event. */
9488 if (!NILP (file_list))
9489 {
9490 struct input_event event;
9491 Lisp_Object frame;
9492 struct frame *f = mac_window_to_frame (window);
9493 SInt16 modifiers;
9494
9495 GlobalToLocal (&mouse);
9496 GetDragModifiers (theDrag, NULL, NULL, &modifiers);
9497
9498 event.kind = DRAG_N_DROP_EVENT;
9499 event.code = 0;
9500 event.modifiers = mac_to_emacs_modifiers (modifiers);
9501 event.timestamp = TickCount () * (1000 / 60);
9502 XSETINT (event.x, mouse.h);
9503 XSETINT (event.y, mouse.v);
9504 XSETFRAME (frame, f);
9505 event.frame_or_window = frame;
9506 event.arg = file_list;
9507 /* Post to the interrupt queue */
9508 kbd_buffer_store_event (&event);
9509 /* MAC_TODO: Mimic behavior of windows by switching contexts to Emacs */
9510 {
9511 ProcessSerialNumber psn;
9512 GetCurrentProcess (&psn);
9513 SetFrontProcess (&psn);
9514 }
9515
9516 return noErr;
9517 }
9518 else
9519 return dragNotAcceptedErr;
9520}
9521#endif
9522
9523 9525
9524#if __profile__ 9526#if __profile__
9525void 9527void
@@ -9805,6 +9807,41 @@ mac_wait_next_event (er, sleep_time, dequeue)
9805} 9807}
9806#endif /* not USE_CARBON_EVENTS */ 9808#endif /* not USE_CARBON_EVENTS */
9807 9809
9810#if TARGET_API_MAC_CARBON
9811OSStatus
9812mac_post_mouse_moved_event ()
9813{
9814 EventRef event = NULL;
9815 OSStatus err;
9816
9817 err = CreateEvent (NULL, kEventClassMouse, kEventMouseMoved, 0,
9818 kEventAttributeNone, &event);
9819 if (err == noErr)
9820 {
9821 Point mouse_pos;
9822
9823 GetMouse (&mouse_pos);
9824 LocalToGlobal (&mouse_pos);
9825 err = SetEventParameter (event, kEventParamMouseLocation, typeQDPoint,
9826 sizeof (Point), &mouse_pos);
9827 }
9828 if (err == noErr)
9829 {
9830 UInt32 modifiers = GetCurrentKeyModifiers ();
9831
9832 err = SetEventParameter (event, kEventParamKeyModifiers, typeUInt32,
9833 sizeof (UInt32), &modifiers);
9834 }
9835 if (err == noErr)
9836 err = PostEventToQueue (GetCurrentEventQueue (), event,
9837 kEventPriorityStandard);
9838 if (event)
9839 ReleaseEvent (event);
9840
9841 return err;
9842}
9843#endif
9844
9808/* Emacs calls this whenever it wants to read an input event from the 9845/* Emacs calls this whenever it wants to read an input event from the
9809 user. */ 9846 user. */
9810int 9847int
@@ -9932,7 +9969,13 @@ XTread_socket (sd, expected, hold_quit)
9932 break; 9969 break;
9933 9970
9934 case inContent: 9971 case inContent:
9935 if (window_ptr != FRAME_MAC_WINDOW (mac_focus_frame (dpyinfo))) 9972 if (
9973#if TARGET_API_MAC_CARBON
9974 FrontNonFloatingWindow ()
9975#else
9976 FrontWindow ()
9977#endif
9978 != window_ptr)
9936 SelectWindow (window_ptr); 9979 SelectWindow (window_ptr);
9937 else 9980 else
9938 { 9981 {
@@ -10079,20 +10122,18 @@ XTread_socket (sd, expected, hold_quit)
10079 } 10122 }
10080 break; 10123 break;
10081 10124
10082#if TARGET_API_MAC_CARBON
10083 case inProxyIcon:
10084 if (TrackWindowProxyDrag (window_ptr, er.where)
10085 != errUserWantsToDragWindow)
10086 break;
10087 /* fall through */
10088#endif
10089 case inDrag: 10125 case inDrag:
10090#if TARGET_API_MAC_CARBON 10126#if TARGET_API_MAC_CARBON
10127 case inProxyIcon:
10091 if (IsWindowPathSelectClick (window_ptr, &er)) 10128 if (IsWindowPathSelectClick (window_ptr, &er))
10092 { 10129 {
10093 WindowPathSelect (window_ptr, NULL, NULL); 10130 WindowPathSelect (window_ptr, NULL, NULL);
10094 break; 10131 break;
10095 } 10132 }
10133 if (part_code == inProxyIcon
10134 && (TrackWindowProxyDrag (window_ptr, er.where)
10135 != errUserWantsToDragWindow))
10136 break;
10096 DragWindow (window_ptr, er.where, NULL); 10137 DragWindow (window_ptr, er.where, NULL);
10097#else /* not TARGET_API_MAC_CARBON */ 10138#else /* not TARGET_API_MAC_CARBON */
10098 DragWindow (window_ptr, er.where, &qd.screenBits.bounds); 10139 DragWindow (window_ptr, er.where, &qd.screenBits.bounds);
@@ -11030,7 +11071,14 @@ syms_of_macterm ()
11030#if USE_CARBON_EVENTS 11071#if USE_CARBON_EVENTS
11031 Qhicommand = intern ("hicommand"); staticpro (&Qhicommand); 11072 Qhicommand = intern ("hicommand"); staticpro (&Qhicommand);
11032#ifdef MAC_OSX 11073#ifdef MAC_OSX
11033 Qservices = intern ("services"); staticpro (&Qservices); 11074 Qtoolbar_switch_mode = intern ("toolbar-switch-mode");
11075 staticpro (&Qtoolbar_switch_mode);
11076#if USE_MAC_FONT_PANEL
11077 Qpanel_closed = intern ("panel-closed"); staticpro (&Qpanel_closed);
11078 Qselection = intern ("selection"); staticpro (&Qselection);
11079#endif
11080
11081 Qservice = intern ("service"); staticpro (&Qservice);
11034 Qpaste = intern ("paste"); staticpro (&Qpaste); 11082 Qpaste = intern ("paste"); staticpro (&Qpaste);
11035 Qperform = intern ("perform"); staticpro (&Qperform); 11083 Qperform = intern ("perform"); staticpro (&Qperform);
11036#endif 11084#endif
@@ -11070,7 +11118,7 @@ NOTE: Not supported on Mac yet. */);
11070 x_use_underline_position_properties = 0; 11118 x_use_underline_position_properties = 0;
11071 11119
11072 DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars, 11120 DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars,
11073 doc: /* If not nil, Emacs uses toolkit scroll bars. */); 11121 doc: /* If not nil, Emacs uses toolkit scroll bars. */);
11074#ifdef USE_TOOLKIT_SCROLL_BARS 11122#ifdef USE_TOOLKIT_SCROLL_BARS
11075 Vx_toolkit_scroll_bars = Qt; 11123 Vx_toolkit_scroll_bars = Qt;
11076#else 11124#else
@@ -11124,23 +11172,23 @@ mouse-3 and the command-key will register for mouse-2. */);
11124 11172
11125#if USE_CARBON_EVENTS 11173#if USE_CARBON_EVENTS
11126 DEFVAR_BOOL ("mac-wheel-button-is-mouse-2", &mac_wheel_button_is_mouse_2, 11174 DEFVAR_BOOL ("mac-wheel-button-is-mouse-2", &mac_wheel_button_is_mouse_2,
11127 doc: /* *Non-nil if the wheel button is mouse-2 and the right click mouse-3. 11175 doc: /* *Non-nil if the wheel button is mouse-2 and the right click mouse-3.
11128Otherwise, the right click will be treated as mouse-2 and the wheel 11176Otherwise, the right click will be treated as mouse-2 and the wheel
11129button will be mouse-3. */); 11177button will be mouse-3. */);
11130 mac_wheel_button_is_mouse_2 = 1; 11178 mac_wheel_button_is_mouse_2 = 1;
11131 11179
11132 DEFVAR_BOOL ("mac-pass-command-to-system", &mac_pass_command_to_system, 11180 DEFVAR_BOOL ("mac-pass-command-to-system", &mac_pass_command_to_system,
11133 doc: /* *Non-nil if command key presses are passed on to the Mac Toolbox. */); 11181 doc: /* *Non-nil if command key presses are passed on to the Mac Toolbox. */);
11134 mac_pass_command_to_system = 1; 11182 mac_pass_command_to_system = 1;
11135 11183
11136 DEFVAR_BOOL ("mac-pass-control-to-system", &mac_pass_control_to_system, 11184 DEFVAR_BOOL ("mac-pass-control-to-system", &mac_pass_control_to_system,
11137 doc: /* *Non-nil if control key presses are passed on to the Mac Toolbox. */); 11185 doc: /* *Non-nil if control key presses are passed on to the Mac Toolbox. */);
11138 mac_pass_control_to_system = 1; 11186 mac_pass_control_to_system = 1;
11139 11187
11140#endif 11188#endif
11141 11189
11142 DEFVAR_BOOL ("mac-allow-anti-aliasing", &mac_use_core_graphics, 11190 DEFVAR_BOOL ("mac-allow-anti-aliasing", &mac_use_core_graphics,
11143 doc: /* *If non-nil, allow anti-aliasing. 11191 doc: /* *If non-nil, allow anti-aliasing.
11144The text will be rendered using Core Graphics text rendering which 11192The text will be rendered using Core Graphics text rendering which
11145may anti-alias the text. */); 11193may anti-alias the text. */);
11146#if USE_CG_DRAWING 11194#if USE_CG_DRAWING
@@ -11153,7 +11201,7 @@ may anti-alias the text. */);
11153 creating the terminal frame on Mac OS 9 before loading 11201 creating the terminal frame on Mac OS 9 before loading
11154 term/mac-win.elc. */ 11202 term/mac-win.elc. */
11155 DEFVAR_LISP ("mac-charset-info-alist", &Vmac_charset_info_alist, 11203 DEFVAR_LISP ("mac-charset-info-alist", &Vmac_charset_info_alist,
11156 doc: /* Alist of Emacs character sets vs text encodings and coding systems. 11204 doc: /* Alist of Emacs character sets vs text encodings and coding systems.
11157Each entry should be of the form: 11205Each entry should be of the form:
11158 11206
11159 (CHARSET-NAME TEXT-ENCODING CODING-SYSTEM) 11207 (CHARSET-NAME TEXT-ENCODING CODING-SYSTEM)
@@ -11164,6 +11212,18 @@ CODING_SYSTEM is a coding system corresponding to TEXT-ENCODING. */);
11164 Vmac_charset_info_alist = 11212 Vmac_charset_info_alist =
11165 Fcons (list3 (build_string ("mac-roman"), 11213 Fcons (list3 (build_string ("mac-roman"),
11166 make_number (smRoman), Qnil), Qnil); 11214 make_number (smRoman), Qnil), Qnil);
11215
11216#if USE_ATSUI
11217 DEFVAR_LISP ("mac-atsu-font-table", &Vmac_atsu_font_table,
11218 doc: /* Hash table of ATSU font IDs vs plist of attributes and values.
11219Each font ID is represented as a four-byte string in native byte
11220order. */);
11221 Vmac_atsu_font_table =
11222 make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE),
11223 make_float (DEFAULT_REHASH_SIZE),
11224 make_float (DEFAULT_REHASH_THRESHOLD),
11225 Qnil, Qnil, Qnil);
11226#endif
11167} 11227}
11168 11228
11169/* arch-tag: f2259165-4454-4c04-a029-a133c8af7b5b 11229/* arch-tag: f2259165-4454-4c04-a029-a133c8af7b5b
diff --git a/src/macterm.h b/src/macterm.h
index f23554f01c6..8b45777e546 100644
--- a/src/macterm.h
+++ b/src/macterm.h
@@ -584,10 +584,11 @@ extern void mac_draw_line_to_pixmap P_ ((Display *, Pixmap, GC, int, int,
584extern void mac_clear_area P_ ((struct frame *, int, int, 584extern void mac_clear_area P_ ((struct frame *, int, int,
585 unsigned int, unsigned int)); 585 unsigned int, unsigned int));
586extern void mac_unload_font P_ ((struct mac_display_info *, XFontStruct *)); 586extern void mac_unload_font P_ ((struct mac_display_info *, XFontStruct *));
587extern OSStatus mac_set_font_info_for_selection P_ ((struct frame *, int, int));
587extern OSErr install_window_handler P_ ((WindowPtr)); 588extern OSErr install_window_handler P_ ((WindowPtr));
588extern void remove_window_handler P_ ((WindowPtr)); 589extern void remove_window_handler P_ ((WindowPtr));
589extern Lisp_Object mac_make_lispy_event_code P_ ((int));
590extern void do_menu_choice P_ ((SInt32)); 590extern void do_menu_choice P_ ((SInt32));
591extern OSStatus mac_post_mouse_moved_event P_ ((void));
591#if USE_CG_DRAWING 592#if USE_CG_DRAWING
592extern void mac_prepare_for_quickdraw P_ ((struct frame *)); 593extern void mac_prepare_for_quickdraw P_ ((struct frame *));
593#endif 594#endif
@@ -623,12 +624,15 @@ extern void free_frame_menubar P_ ((struct frame *));
623/* Defined in mac.c. */ 624/* Defined in mac.c. */
624 625
625extern void mac_clear_font_name_table P_ ((void)); 626extern void mac_clear_font_name_table P_ ((void));
626extern Lisp_Object mac_aedesc_to_lisp P_ ((AEDesc *)); 627extern Lisp_Object mac_aedesc_to_lisp P_ ((const AEDesc *));
627#if TARGET_API_MAC_CARBON 628#if TARGET_API_MAC_CARBON
628extern OSErr create_apple_event_from_event_ref P_ ((EventRef, UInt32, 629extern OSErr create_apple_event_from_event_ref P_ ((EventRef, UInt32,
629 EventParamName *, 630 EventParamName *,
630 EventParamType *, 631 EventParamType *,
631 AppleEvent *)); 632 AppleEvent *));
633extern OSErr create_apple_event_from_drag_ref P_ ((DragRef, UInt32,
634 FlavorType *,
635 AppleEvent *));
632extern CFStringRef cfstring_create_with_utf8_cstring P_ ((const char *)); 636extern CFStringRef cfstring_create_with_utf8_cstring P_ ((const char *));
633extern CFStringRef cfstring_create_with_string P_ ((Lisp_Object)); 637extern CFStringRef cfstring_create_with_string P_ ((Lisp_Object));
634extern Lisp_Object cfdata_to_lisp P_ ((CFDataRef)); 638extern Lisp_Object cfdata_to_lisp P_ ((CFDataRef));
diff --git a/src/minibuf.c b/src/minibuf.c
index 2894eb19324..d37f82c9dcd 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -523,7 +523,7 @@ read_minibuf (map, initial, prompt, backup_n, expflag,
523 build_string ("Command attempted to use minibuffer while in minibuffer")); 523 build_string ("Command attempted to use minibuffer while in minibuffer"));
524 } 524 }
525 525
526 if (noninteractive) 526 if (noninteractive && NILP (Vexecuting_kbd_macro))
527 { 527 {
528 val = read_minibuf_noninteractive (map, initial, prompt, 528 val = read_minibuf_noninteractive (map, initial, prompt,
529 make_number (pos), 529 make_number (pos),
@@ -2790,7 +2790,7 @@ syms_of_minibuf ()
2790 DEFVAR_LISP ("history-length", &Vhistory_length, 2790 DEFVAR_LISP ("history-length", &Vhistory_length,
2791 doc: /* *Maximum length for history lists before truncation takes place. 2791 doc: /* *Maximum length for history lists before truncation takes place.
2792A number means that length; t means infinite. Truncation takes place 2792A number means that length; t means infinite. Truncation takes place
2793just after a new element is inserted. Setting the history-length 2793just after a new element is inserted. Setting the `history-length'
2794property of a history variable overrides this default. */); 2794property of a history variable overrides this default. */);
2795 XSETFASTINT (Vhistory_length, 30); 2795 XSETFASTINT (Vhistory_length, 30);
2796 2796
diff --git a/src/process.c b/src/process.c
index 8e4a0d22160..4e2717577cd 100644
--- a/src/process.c
+++ b/src/process.c
@@ -696,6 +696,8 @@ setup_process_coding_systems (process)
696 = (struct coding_system *) xmalloc (sizeof (struct coding_system)); 696 = (struct coding_system *) xmalloc (sizeof (struct coding_system));
697 setup_coding_system (p->encode_coding_system, 697 setup_coding_system (p->encode_coding_system,
698 proc_encode_coding_system[outch]); 698 proc_encode_coding_system[outch]);
699 if (proc_encode_coding_system[outch]->eol_type == CODING_EOL_UNDECIDED)
700 proc_encode_coding_system[outch]->eol_type = system_eol_type;
699} 701}
700 702
701DEFUN ("processp", Fprocessp, Sprocessp, 1, 1, 0, 703DEFUN ("processp", Fprocessp, Sprocessp, 1, 1, 0,
@@ -5067,6 +5069,10 @@ read_process_output (proc, channel)
5067 p->encode_coding_system = Vlast_coding_system_used; 5069 p->encode_coding_system = Vlast_coding_system_used;
5068 setup_coding_system (p->encode_coding_system, 5070 setup_coding_system (p->encode_coding_system,
5069 proc_encode_coding_system[XINT (p->outfd)]); 5071 proc_encode_coding_system[XINT (p->outfd)]);
5072 if (proc_encode_coding_system[XINT (p->outfd)]->eol_type
5073 == CODING_EOL_UNDECIDED)
5074 proc_encode_coding_system[XINT (p->outfd)]->eol_type
5075 = system_eol_type;
5070 } 5076 }
5071 } 5077 }
5072 5078
@@ -5176,6 +5182,10 @@ read_process_output (proc, channel)
5176 p->encode_coding_system = Vlast_coding_system_used; 5182 p->encode_coding_system = Vlast_coding_system_used;
5177 setup_coding_system (p->encode_coding_system, 5183 setup_coding_system (p->encode_coding_system,
5178 proc_encode_coding_system[XINT (p->outfd)]); 5184 proc_encode_coding_system[XINT (p->outfd)]);
5185 if (proc_encode_coding_system[XINT (p->outfd)]->eol_type
5186 == CODING_EOL_UNDECIDED)
5187 proc_encode_coding_system[XINT (p->outfd)]->eol_type
5188 = system_eol_type;
5179 } 5189 }
5180 } 5190 }
5181 if (coding->carryover_bytes > 0) 5191 if (coding->carryover_bytes > 0)
diff --git a/src/sound.c b/src/sound.c
index c1d5c40e9bb..0fbeceb4b9e 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -452,13 +452,12 @@ static Lisp_Object
452sound_cleanup (arg) 452sound_cleanup (arg)
453 Lisp_Object arg; 453 Lisp_Object arg;
454{ 454{
455 if (current_sound_device) 455 if (current_sound_device->close)
456 { 456 current_sound_device->close (current_sound_device);
457 if (current_sound_device->close) 457 if (current_sound->fd > 0)
458 current_sound_device->close (current_sound_device); 458 emacs_close (current_sound->fd);
459 if (current_sound->fd > 0) 459 free (current_sound_device);
460 emacs_close (current_sound->fd); 460 free (current_sound);
461 }
462 461
463 return Qnil; 462 return Qnil;
464} 463}
@@ -991,8 +990,6 @@ Internal use only, use `play-sound' instead.\n */)
991#ifndef WINDOWSNT 990#ifndef WINDOWSNT
992 Lisp_Object file; 991 Lisp_Object file;
993 struct gcpro gcpro1, gcpro2; 992 struct gcpro gcpro1, gcpro2;
994 struct sound_device sd;
995 struct sound s;
996 Lisp_Object args[2]; 993 Lisp_Object args[2];
997#else /* WINDOWSNT */ 994#else /* WINDOWSNT */
998 int len = 0; 995 int len = 0;
@@ -1010,48 +1007,50 @@ Internal use only, use `play-sound' instead.\n */)
1010#ifndef WINDOWSNT 1007#ifndef WINDOWSNT
1011 file = Qnil; 1008 file = Qnil;
1012 GCPRO2 (sound, file); 1009 GCPRO2 (sound, file);
1013 bzero (&sd, sizeof sd); 1010 current_sound_device = (struct sound_device *) xmalloc (sizeof (struct sound_device));
1014 bzero (&s, sizeof s); 1011 bzero (current_sound_device, sizeof (struct sound_device));
1015 current_sound_device = &sd; 1012 current_sound = (struct sound *) xmalloc (sizeof (struct sound));
1016 current_sound = &s; 1013 bzero (current_sound, sizeof (struct sound));
1017 record_unwind_protect (sound_cleanup, Qnil); 1014 record_unwind_protect (sound_cleanup, Qnil);
1018 s.header = (char *) alloca (MAX_SOUND_HEADER_BYTES); 1015 current_sound->header = (char *) alloca (MAX_SOUND_HEADER_BYTES);
1019 1016
1020 if (STRINGP (attrs[SOUND_FILE])) 1017 if (STRINGP (attrs[SOUND_FILE]))
1021 { 1018 {
1022 /* Open the sound file. */ 1019 /* Open the sound file. */
1023 s.fd = openp (Fcons (Vdata_directory, Qnil), 1020 current_sound->fd = openp (Fcons (Vdata_directory, Qnil),
1024 attrs[SOUND_FILE], Qnil, &file, Qnil); 1021 attrs[SOUND_FILE], Qnil, &file, Qnil);
1025 if (s.fd < 0) 1022 if (current_sound->fd < 0)
1026 sound_perror ("Could not open sound file"); 1023 sound_perror ("Could not open sound file");
1027 1024
1028 /* Read the first bytes from the file. */ 1025 /* Read the first bytes from the file. */
1029 s.header_size = emacs_read (s.fd, s.header, MAX_SOUND_HEADER_BYTES); 1026 current_sound->header_size
1030 if (s.header_size < 0) 1027 = emacs_read (current_sound->fd, current_sound->header,
1028 MAX_SOUND_HEADER_BYTES);
1029 if (current_sound->header_size < 0)
1031 sound_perror ("Invalid sound file header"); 1030 sound_perror ("Invalid sound file header");
1032 } 1031 }
1033 else 1032 else
1034 { 1033 {
1035 s.data = attrs[SOUND_DATA]; 1034 current_sound->data = attrs[SOUND_DATA];
1036 s.header_size = min (MAX_SOUND_HEADER_BYTES, SBYTES (s.data)); 1035 current_sound->header_size = min (MAX_SOUND_HEADER_BYTES, SBYTES (current_sound->data));
1037 bcopy (SDATA (s.data), s.header, s.header_size); 1036 bcopy (SDATA (current_sound->data), current_sound->header, current_sound->header_size);
1038 } 1037 }
1039 1038
1040 /* Find out the type of sound. Give up if we can't tell. */ 1039 /* Find out the type of sound. Give up if we can't tell. */
1041 find_sound_type (&s); 1040 find_sound_type (current_sound);
1042 1041
1043 /* Set up a device. */ 1042 /* Set up a device. */
1044 if (STRINGP (attrs[SOUND_DEVICE])) 1043 if (STRINGP (attrs[SOUND_DEVICE]))
1045 { 1044 {
1046 int len = SCHARS (attrs[SOUND_DEVICE]); 1045 int len = SCHARS (attrs[SOUND_DEVICE]);
1047 sd.file = (char *) alloca (len + 1); 1046 current_sound_device->file = (char *) alloca (len + 1);
1048 strcpy (sd.file, SDATA (attrs[SOUND_DEVICE])); 1047 strcpy (current_sound_device->file, SDATA (attrs[SOUND_DEVICE]));
1049 } 1048 }
1050 1049
1051 if (INTEGERP (attrs[SOUND_VOLUME])) 1050 if (INTEGERP (attrs[SOUND_VOLUME]))
1052 sd.volume = XFASTINT (attrs[SOUND_VOLUME]); 1051 current_sound_device->volume = XFASTINT (attrs[SOUND_VOLUME]);
1053 else if (FLOATP (attrs[SOUND_VOLUME])) 1052 else if (FLOATP (attrs[SOUND_VOLUME]))
1054 sd.volume = XFLOAT_DATA (attrs[SOUND_VOLUME]) * 100; 1053 current_sound_device->volume = XFLOAT_DATA (attrs[SOUND_VOLUME]) * 100;
1055 1054
1056 args[0] = Qplay_sound_functions; 1055 args[0] = Qplay_sound_functions;
1057 args[1] = sound; 1056 args[1] = sound;
@@ -1060,27 +1059,15 @@ Internal use only, use `play-sound' instead.\n */)
1060 /* There is only one type of device we currently support, the VOX 1059 /* There is only one type of device we currently support, the VOX
1061 sound driver. Set up the device interface functions for that 1060 sound driver. Set up the device interface functions for that
1062 device. */ 1061 device. */
1063 vox_init (&sd); 1062 vox_init (current_sound_device);
1064 1063
1065 /* Open the device. */ 1064 /* Open the device. */
1066 sd.open (&sd); 1065 current_sound_device->open (current_sound_device);
1067 1066
1068 /* Play the sound. */ 1067 /* Play the sound. */
1069 s.play (&s, &sd); 1068 current_sound->play (current_sound, current_sound_device);
1070
1071 /* Close the input file, if any. */
1072 if (!STRINGP (s.data))
1073 {
1074 emacs_close (s.fd);
1075 s.fd = -1;
1076 }
1077
1078 /* Close the device. */
1079 sd.close (&sd);
1080 1069
1081 /* Clean up. */ 1070 /* Clean up. */
1082 current_sound_device = NULL;
1083 current_sound = NULL;
1084 UNGCPRO; 1071 UNGCPRO;
1085 1072
1086#else /* WINDOWSNT */ 1073#else /* WINDOWSNT */
diff --git a/src/termhooks.h b/src/termhooks.h
index 8405cac3b88..de43d580c9b 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -332,9 +332,9 @@ enum event_kind
332 /* Generated when an Apple event, a HICommand event, or a Services 332 /* Generated when an Apple event, a HICommand event, or a Services
333 menu event is received and the corresponding handler is 333 menu event is received and the corresponding handler is
334 registered. Members `x' and `y' are for the event class and ID 334 registered. Members `x' and `y' are for the event class and ID
335 symbols, respectively. Member `code' points to the Apple event 335 symbols, respectively. Member `arg' is a Lisp object converted
336 descriptor. Parameters for Non-Apple events are converted to 336 from the received Apple event. Parameters for non-Apple events
337 those in Apple events. */ 337 are converted to those in Apple events. */
338 MAC_APPLE_EVENT 338 MAC_APPLE_EVENT
339#endif 339#endif
340}; 340};
diff --git a/src/xdisp.c b/src/xdisp.c
index 63a1338b2cb..b1404d9c593 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -4543,6 +4543,24 @@ handle_composition_prop (it)
4543 4543
4544 if (id >= 0) 4544 if (id >= 0)
4545 { 4545 {
4546 struct composition *cmp = composition_table[id];
4547
4548 if (cmp->glyph_len == 0)
4549 {
4550 /* No glyph. */
4551 if (STRINGP (it->string))
4552 {
4553 IT_STRING_CHARPOS (*it) = end;
4554 IT_STRING_BYTEPOS (*it) = string_char_to_byte (it->string,
4555 end);
4556 }
4557 else
4558 {
4559 IT_CHARPOS (*it) = end;
4560 IT_BYTEPOS (*it) = CHAR_TO_BYTE (end);
4561 }
4562 return HANDLED_RECOMPUTE_PROPS;
4563 }
4546 it->method = GET_FROM_COMPOSITION; 4564 it->method = GET_FROM_COMPOSITION;
4547 it->cmp_id = id; 4565 it->cmp_id = id;
4548 it->cmp_len = COMPOSITION_LENGTH (prop); 4566 it->cmp_len = COMPOSITION_LENGTH (prop);
diff --git a/src/xfaces.c b/src/xfaces.c
index 3a066ee12c3..5596d5dc613 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -7255,6 +7255,16 @@ realize_default_face (f)
7255 check_lface (lface); 7255 check_lface (lface);
7256 bcopy (XVECTOR (lface)->contents, attrs, sizeof attrs); 7256 bcopy (XVECTOR (lface)->contents, attrs, sizeof attrs);
7257 face = realize_face (c, attrs, DEFAULT_FACE_ID); 7257 face = realize_face (c, attrs, DEFAULT_FACE_ID);
7258
7259#ifdef HAVE_WINDOW_SYSTEM
7260#ifdef HAVE_X_WINDOWS
7261 if (face->font != FRAME_FONT (f))
7262 /* As the font specified for the frame was not acceptable as a
7263 font for the default face (perhaps because auto-scaled fonts
7264 are rejected), we must adjust the frame font. */
7265 x_set_font (f, build_string (face->font_name), Qnil);
7266#endif /* HAVE_X_WINDOWS */
7267#endif /* HAVE_WINDOW_SYSTEM */
7258 return 1; 7268 return 1;
7259} 7269}
7260 7270