aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaroly Lorentey2006-05-10 15:04:01 +0000
committerKaroly Lorentey2006-05-10 15:04:01 +0000
commit8dadeb1e1f78c7be07db5ae78aa9eed58d272a4e (patch)
tree6262988e87d6b347a8c90fcc3c5b49f9bb5b36e1
parentf6cf85ac95e469835a2643024f995b471a4c5d52 (diff)
parent9a4d87c8d5f4503d67d5155eae6d543cc31f86d0 (diff)
downloademacs-8dadeb1e1f78c7be07db5ae78aa9eed58d272a4e.tar.gz
emacs-8dadeb1e1f78c7be07db5ae78aa9eed58d272a4e.zip
Merged from emacs@sv.gnu.org
Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-266 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-267 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-268 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-269 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-270 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-271 Rename "field-at-point" to "field-at-pos" * emacs@sv.gnu.org/emacs--devo--0--patch-272 (comint-insert-input): Remove redundant calls to setq and goto-char git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-556
-rw-r--r--ChangeLog6
-rw-r--r--Makefile.in2
-rw-r--r--admin/ChangeLog5
-rw-r--r--admin/FOR-RELEASE3
-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--lisp/ChangeLog239
-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/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/easy-mmode.el8
-rw-r--r--lisp/emacs-lisp/ewoc.el20
-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/ibuffer.el7
-rw-r--r--lisp/isearch.el19
-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/mwheel.el21
-rw-r--r--lisp/net/tramp.el2
-rw-r--r--lisp/progmodes/gdb-ui.el48
-rw-r--r--lisp/progmodes/grep.el44
-rw-r--r--lisp/progmodes/vhdl-mode.el3
-rw-r--r--lisp/progmodes/xscheme.el9
-rw-r--r--lisp/server.el2
-rw-r--r--lisp/simple.el2
-rw-r--r--lisp/speedbar.el17
-rw-r--r--lisp/startup.el27
-rw-r--r--lisp/subr.el32
-rw-r--r--lisp/term/mac-win.el521
-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/ChangeLog40
-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.texi13
-rw-r--r--lispref/windows.texi4
-rw-r--r--man/ChangeLog206
-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.texi3
-rw-r--r--man/custom.texi13
-rw-r--r--man/dired-xtra.texi49
-rw-r--r--man/dired.texi9
-rw-r--r--man/display.texi2
-rw-r--r--man/emacs-xtra.texi3787
-rw-r--r--man/emacs.texi31
-rw-r--r--man/emerge-xtra.texi414
-rw-r--r--man/faq.texi38
-rw-r--r--man/files.texi189
-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/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.texi2
-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/sending.texi2
-rw-r--r--man/texinfo.tex170
-rw-r--r--man/text.texi8
-rw-r--r--man/tramp.texi12
-rw-r--r--man/trouble.texi10
-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/ChangeLog152
-rw-r--r--src/callproc.c2
-rw-r--r--src/coding.c19
-rw-r--r--src/coding.h3
-rw-r--r--src/fileio.c2
-rw-r--r--src/image.c21
-rw-r--r--src/keyboard.c3
-rw-r--r--src/keymap.c16
-rw-r--r--src/mac.c125
-rw-r--r--src/macfns.c67
-rw-r--r--src/macgui.h7
-rw-r--r--src/macmenu.c2
-rw-r--r--src/macselect.c216
-rw-r--r--src/macterm.c653
-rw-r--r--src/macterm.h8
-rw-r--r--src/minibuf.c2
-rw-r--r--src/process.c12
-rw-r--r--src/termhooks.h6
-rw-r--r--src/xdisp.c18
122 files changed, 7942 insertions, 5500 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 9fcdb57f250..a34bde7d329 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -26,9 +26,6 @@ face name prefixes should be in it for good results.
26** Send an email to the various distributions, including the GNOME 26** Send an email to the various distributions, including the GNOME
27and 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.
28 28
29** Ensure MH-E 8.0 has been released.
30Assigned to Bill Wohler <wohler@newt.com>.
31
32* BUGS 29* BUGS
33 30
34** JD Smith's 17 Apr 2006 bug report that CVS operations 31** JD Smith's 17 Apr 2006 bug report that CVS operations
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 378f715b286..6662ffe9bad 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -571,26 +571,26 @@ can be edited for each replacement.
571*** The current match in query-replace is highlighted in new face 571*** The current match in query-replace is highlighted in new face
572`query-replace' which by default inherits from isearch face. 572`query-replace' which by default inherits from isearch face.
573 573
574** File operation changes: 574** Local variables lists:
575
576+++
577*** Unquoted `$' in file names do not signal an error any more when
578the corresponding environment variable does not exist.
579Instead, the `$ENVVAR' text is left as is, so that `$$' quoting
580is only rarely needed.
581 575
582+++ 576+++
583*** In processing a local variables list, Emacs strips the prefix and 577*** In processing a local variables list, Emacs strips the prefix and
584suffix from every line before processing all the lines. 578suffix from every line before processing all the lines.
585 579
586+++ 580+++
581*** Text properties in local variables.
582
583A file local variables list cannot specify a string with text
584properties--any specified text properties are discarded.
585
586+++
587*** If the local variables list contains any variable-value pairs that 587*** If the local variables list contains any variable-value pairs that
588are not known to be safe, Emacs shows a prompt asking whether to apply 588are not known to be safe, Emacs shows a prompt asking whether to apply
589the local variables list as a whole. In earlier versions, a prompt 589the local variables list as a whole. In earlier versions, a prompt
590was only issued for variables explicitly marked as risky (for the 590was only issued for variables explicitly marked as risky (for the
591definition of risky variables, see `risky-local-variable-p'). 591definition of risky variables, see `risky-local-variable-p').
592 592
593At the prompt, the user can choose to save the contents of this local 593At the prompt, you can choose to save the contents of this local
594variables list to `safe-local-variable-values'. This new customizable 594variables list to `safe-local-variable-values'. This new customizable
595option is a list of variable-value pairs that are known to be safe. 595option is a list of variable-value pairs that are known to be safe.
596Variables can also be marked as safe with the existing 596Variables can also be marked as safe with the existing
@@ -599,6 +599,38 @@ However, risky variables will not be added to
599`safe-local-variable-values' in this way. 599`safe-local-variable-values' in this way.
600 600
601+++ 601+++
602*** The variable `enable-local-variables' controls how local variable
603lists are handled. t, the default, specifies the standard querying
604behavior. :safe means use only safe values, and ignore the rest.
605nil means ignore them all. Anything else means always query.
606
607+++
608*** The variable `safe-local-eval-forms' specifies a list of forms that
609are ok to evaluate when they appear in an `eval' local variables
610specification. Normally Emacs asks for confirmation before evaluating
611such a form, but if the form appears in this list, no confirmation is
612needed.
613
614+++
615*** If a function has a non-nil `safe-local-eval-function' property,
616that means it is ok to evaluate some calls to that function when it
617appears in an `eval' local variables specification. If the property
618is t, then any form calling that function with constant arguments is
619ok. If the property is a function or list of functions, they are called
620with the form as argument, and if any returns t, the form is ok to call.
621
622If the form is not "ok to call", that means Emacs asks for
623confirmation as before.
624
625** File operation changes:
626
627+++
628*** Unquoted `$' in file names do not signal an error any more when
629the corresponding environment variable does not exist.
630Instead, the `$ENVVAR' text is left as is, so that `$$' quoting
631is only rarely needed.
632
633+++
602*** find-file-read-only visits multiple files in read-only mode, 634*** find-file-read-only visits multiple files in read-only mode,
603when the file name contains wildcard characters. 635when the file name contains wildcard characters.
604 636
@@ -3055,7 +3087,7 @@ See the file GNUS-NEWS or the node "Oort Gnus" in the Gnus manual for details.
3055--- 3087---
3056** MH-E changes. 3088** MH-E changes.
3057 3089
3058Upgraded to MH-E version 7.95. There have been major changes since 3090Upgraded to MH-E version 8.0. There have been major changes since
3059version 5.0.2; see MH-E-NEWS for details. 3091version 5.0.2; see MH-E-NEWS for details.
3060 3092
3061** Calendar changes: 3093** Calendar changes:
@@ -3558,6 +3590,15 @@ occurrences of an element in the list, the one that's kept is the
3558first one. 3590first one.
3559 3591
3560+++ 3592+++
3593*** New function `add-to-history' adds an element to a history list.
3594
3595Lisp packages should use this function to add elements to their
3596history lists.
3597
3598If `history-delete-duplicates' is non-nil, it removes duplicates of
3599the new element from the history list it updates.
3600
3601+++
3561*** New function `rassq-delete-all'. 3602*** New function `rassq-delete-all'.
3562 3603
3563(rassq-delete-all VALUE ALIST) deletes, from ALIST, each element whose 3604(rassq-delete-all VALUE ALIST) deletes, from ALIST, each element whose
@@ -3994,38 +4035,6 @@ the minibuffer with a default value: if DEF is non-nil, the minibuffer
3994prompt provided in PROMPT is edited to show the default value provided 4035prompt provided in PROMPT is edited to show the default value provided
3995in DEF before the terminal colon and space. 4036in DEF before the terminal colon and space.
3996 4037
3997** Local variables lists:
3998
3999+++
4000*** Text properties in local variables.
4001
4002A file local variables list cannot specify a string with text
4003properties--any specified text properties are discarded.
4004
4005+++
4006*** The variable `enable-local-variables' controls how local variable
4007lists are handled. t, the default, specifies the standard querying
4008behavior. :safe means use only safe values, and ignore the rest.
4009nil means ignore them all. Anything else means always query.
4010
4011+++
4012*** The variable `safe-local-eval-forms' specifies a list of forms that
4013are ok to evaluate when they appear in an `eval' local variables
4014specification. Normally Emacs asks for confirmation before evaluating
4015such a form, but if the form appears in this list, no confirmation is
4016needed.
4017
4018---
4019*** If a function has a non-nil `safe-local-eval-function' property,
4020that means it is ok to evaluate some calls to that function when it
4021appears in an `eval' local variables specification. If the property
4022is t, then any form calling that function with constant arguments is
4023ok. If the property is a function or list of functions, they are called
4024with the form as argument, and if any returns t, the form is ok to call.
4025
4026If the form is not "ok to call", that means Emacs asks for
4027confirmation as before.
4028
4029** Searching and matching changes: 4038** Searching and matching changes:
4030 4039
4031+++ 4040+++
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/lisp/ChangeLog b/lisp/ChangeLog
index 5c3c58767f7..4b3f30e9692 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,242 @@
12006-05-09 Miles Bader <miles@gnu.org>
2
3 * comint.el (comint-insert-input): Remove redundant calls to setq
4 and goto-char.
5
62006-05-10 Nick Roberts <nickrob@snap.net.nz>
7
8 * comint.el (comint-insert-input): Make it work when
9 comint-use-prompt-regexp is t.
10
112006-05-10 Miles Bader <miles@gnu.org>
12
13 * subr.el (field-at-pos): New function.
14
15 * comint.el (comint-insert-input): Use it.
16
172006-05-09 Juri Linkov <juri@jurta.org>
18
19 * battery.el (battery-linux-proc-acpi): Also try
20 `/proc/acpi/thermal_zone/THR2/temperature'.
21
22 * files.el <safe-local-variable>: Remove `eval' and `let' binding
23 for now unused lambda `string-or-null'.
24
25 * add-log.el (change-log-default-name): Put `string-or-null-p'
26 instead of lambda on `safe-local-variable' property.
27
28 * diff-mode.el (diff-context->unified): Use `region-beginning' and
29 `region-end' instead of `mark' and `point'.
30 (diff-unified->context, diff-reverse-direction, diff-fixup-modifs):
31 Operate on region in Transient Mark mode when the mark is active.
32 Use `region-beginning' and `region-end' instead of `mark' and
33 `point'.
34 (diff-hunk-text, diff-goto-source): Doc fix.
35
36 * startup.el (fancy-splash-screens, normal-splash-screen): Use
37 face `mode-line-buffer-id' for mode-line buffer face instead of
38 hard-coded `(:weight bold)'.
39
40 * arc-mode.el (archive-set-buffer-as-visiting-file): Bind
41 buffer-undo-list to t (undo-ask is reproducible by visiting
42 nested archives).
43
442006-05-09 Kim F. Storm <storm@cua.dk>
45
46 * progmodes/grep.el (rgrep): Set default directory of *grep*
47 buffer if we start M-x rgrep in the *grep* buffer and choose
48 a different base directory.
49
502006-05-09 Michael Albinus <michael.albinus@gmx.de>
51
52 * net/tramp.el (tramp-register-file-name-handlers): Enable Tramp
53 completion also when ido is loaded.
54
552006-05-09 Masatake YAMATO <jet@gyve.org>
56
57 * font-lock.el (cpp-font-lock-keywords-source-directives): Addded
58 "warning" and "import".
59 (cpp-font-lock-keywords): Added "warning".
60
612006-05-08 Dan Nicolaescu <dann@ics.uci.edu>
62
63 * term/xterm.el (terminal-init-xterm): Add more key bindings.
64
652006-05-08 Stefan Monnier <monnier@iro.umontreal.ca>
66
67 * mwheel.el (mwheel-scroll): Make sure that when scrolling multiple
68 pages at a time, if we signal the end, we should indeed reach that end.
69
702006-05-08 David Reitter <david.reitter@gmail.com>
71
72 * emacs-lisp/easy-mmode.el (define-minor-mode): Only preserve messages
73 output during execution of the body.
74
752006-05-08 Kim F. Storm <storm@cua.dk>
76
77 * progmodes/grep.el (lgrep, rgrep): Doc fixes.
78
792006-05-08 Thien-Thi Nguyen <ttn@gnu.org>
80
81 * emacs-lisp/ewoc.el (ewoc--set-buffer-bind-dll-let*):
82 Use with-current-buffer.
83
842006-05-07 Kim F. Storm <storm@cua.dk>
85
86 * subr.el (add-to-history): Remove keep-dups arg.
87
88 * kmacro.el (kmacro-push-ring): Let-bind history-delete-duplicates
89 to nil around call to add-to-history.
90
912006-05-07 Stefan Monnier <monnier@iro.umontreal.ca>
92
93 * emacs-lisp/syntax.el (syntax-ppss): Flush the cache before rather
94 than after a buffer modification.
95
962006-05-08 Nick Roberts <nickrob@snap.net.nz>
97
98 * progmodes/gdb-ui.el (gdb-var-create-handler): Move speedbar
99 call to...
100 (gud-watch): ...here so speedbar is raised for already watched
101 expressions.
102 (gdb-speedbar-refresh): Delete function.
103 (gdb-speedbar-update, gdb-speedbar-timer-fn): New functions.
104 Use speedbar-timer-fn instead of speedbar-refresh (reverting
105 earlier change).
106 (gdb-var-evaluate-expression-handler)
107 (gdb-var-list-children-handler-1, gdb-var-update-handler-1): Use it.
108
109 * speedbar.el (speedbar-timer-fn): Remove save-window-excursion.
110 Update localized contents for all buffers except ignored modes.
111
1122006-05-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
113
114 * term/mac-win.el (mac-utxt-to-string): Use `eq' instead of `='.
115 (mac-atsu-font-table, mac-font-panel-mode): Add defvars.
116 (mac-bytes-to-digits, mac-handle-toolbar-switch-mode)
117 (mac-handle-font-panel-closed, mac-handle-font-selection):
118 New functions.
119 (mac-font-panel-mode): New minor mode.
120 (mac-apple-event-map): Add bindings for toolbar toggle button and
121 font panel.
122 (menu-bar-showhide-menu): Add mac-font-panel-mode.
123
1242006-05-07 John Paul Wallington <jpw@pobox.com>
125
126 * ibuffer.el (ibuffer-compressed-file-name-regexp):
127 Avoid `regexp-opt'; simplify regexp for readability.
128
1292006-05-06 Eli Zaretskii <eliz@gnu.org>
130
131 * ldefs-boot.el (dired-do-redisplay, dired-maybe-insert-subdir):
132 * files.el (buffer-stale-function):
133 * dired-aux.el (dired-do-redisplay, dired-maybe-insert-subdir):
134 * autorevert.el (global-auto-revert-non-file-buffers): Point Info
135 links to the main manual, not to emacs-xtra.
136
1372006-05-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
138
139 * term/mac-win.el: (mac-utxt-to-string): Don't make adjustment for
140 MacJapanese if text is ASCII-only.
141
1422006-05-06 Nick Roberts <nickrob@snap.net.nz>
143
144 * progmodes/gdb-ui.el (gdb-goto-breakpoint): Use or instead of
145 unless so nil isn't returned.
146 (gdb-setup-windows, gdb-restore-windows): Reset gdb-source-window.
147
1482006-05-06 Kim F. Storm <storm@cua.dk>
149
150 * subr.el (add-to-history): New function.
151
152 * ediff.el (ediff-files, ediff-files3, ediff-merge-files)
153 (ediff-merge-files-with-ancestor):
154 * env.el (setenv):
155 * isearch.el (isearch-update-ring):
156 * server.el (server-visit-files):
157 * progmodes/grep.el (lgrep, rgrep):
158 * progmodes/vhdl-mode.el (vhdl-generate-makefile-1):
159 * progmodes/xscheme.el (xscheme-insert-expression):
160 Use add-to-history.
161
162 * kmacro.el (kmacro-push-ring): Use add-to-history.
163 (kmacro-ring-length): Remove unused defun.
164 (kmacro-start-macro): Use kmacro-push-ring.
165
1662006-05-06 Thien-Thi Nguyen <ttn@gnu.org>
167
168 * emacs-lisp/ewoc.el (ewoc-create, ewoc-set-hf): Use `insert'
169 directly instead of a lambda expression that calls it.
170
1712006-05-06 Kim F. Storm <storm@cua.dk>
172
173 * avoid.el (mouse-avoidance-point-position): Use posn-at-point
174 instead of compute-motion.
175
1762006-05-05 Dan Nicolaescu <dann@ics.uci.edu>
177
178 * ibuffer.el (ibuffer-compressed-file-name-regexp): Undo previous
179 change.
180
1812006-05-05 Reiner Steib <Reiner.Steib@gmx.de>
182
183 * startup.el (command-line-1): Refer to "Pure Storage" on
184 pure-space-overflow.
185
1862006-05-05 Martin Rudalics <rudalics@gmx.at>
187
188 * emacs-lisp/re-builder.el (reb-update-overlays): Cycle through
189 provided faces once they all have been used up.
190
1912006-05-05 Eli Zaretskii <eliz@gnu.org>
192
193 * startup.el (normal-splash-screen, fancy-splash-screens-1): Add a
194 reference to the Lisp manual to the warning about pure space
195 overflow.
196
1972006-05-05 Micha,Ak(Bl Cadilhac <michael.cadilhac@lrde.org>
198
199 * textmodes/ispell.el (ispell-buffer-local-dict): Add a `no-reload'
200 argument to avoid the call to `ispell-internal-change-dictionary'
201 when not needed.
202 (ispell-change-dictionary): Use this argument and call
203 `ispell-internal-change-dictionary' after the possible change
204 to `ispell-local-dictionary'.
205 (ispell-internal-change-dictionary): Check for a change in
206 personal dictionary use too.
207 Cosmetic changes from Agustin Martin
208 <agustin.martin@hispalinux.es>.
209
2102006-05-05 Eli Zaretskii <eliz@gnu.org>
211
212 * startup.el (command-line): On MS-Windows, probe "~", not
213 "~USER", for warning about non-existent home directory
214
215 * arc-mode.el (archive-l-e): New optional argument `float' means
216 generate a float value.
217 (archive-arc-summarize, archive-lzh-summarize)
218 (archive-zip-summarize, archive-zoo-summarize): Invoke archive-l-e
219 with 3rd argument non-nil when file's size is being computed.
220 Format the file sizes with %8.0f instead of %8d.
221
2222006-05-05 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
223
224 * cus-start.el (all): Add mac-dnd-known-types.
225
226 * term/mac-win.el: (mac-utxt-to-string, mac-string-to-utxt)
227 (mac-TEXT-to-string, mac-string-to-TEXT, mac-furl-to-string)
228 (mac-TIFF-to-string): New functions.
229 (x-get-selection, x-selection-value)
230 (mac-select-convert-to-string): Use them.
231 (mac-text-encoding-mac-japanese-basic-variant): New constant.
232 (mac-dnd-types-alist): New customization variable.
233 (mac-dnd-handle-furl, mac-dnd-handle-hfs, mac-dnd-insert-utxt)
234 (mac-dnd-insert-TEXT, mac-dnd-insert-TIFF, mac-dnd-drop-data)
235 (mac-dnd-handle-drag-n-drop-event): New functions.
236 (mac-drag-n-drop): Remove function.
237 (global-map): Bind drag-n-drop and M-drag-n-drop to
238 mac-dnd-handle-drag-n-drop-event.
239
12006-05-04 Karl Chen <quarl@NOSPAM.quarl.org> 2402006-05-04 Karl Chen <quarl@NOSPAM.quarl.org>
2 241
3 * progmodes/perl-mode.el (perl-beginning-of-function): 242 * progmodes/perl-mode.el (perl-beginning-of-function):
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 abf38994235..96b41eca88d 100644
--- a/lisp/arc-mode.el
+++ b/lisp/arc-mode.el
@@ -464,10 +464,12 @@ Each descriptor is a vector of the form
464(defsubst archive-name (suffix) 464(defsubst archive-name (suffix)
465 (intern (concat "archive-" (symbol-name archive-subtype) "-" suffix))) 465 (intern (concat "archive-" (symbol-name archive-subtype) "-" suffix)))
466 466
467(defun archive-l-e (str &optional len) 467(defun archive-l-e (str &optional len float)
468 "Convert little endian string/vector STR to integer. 468 "Convert little endian string/vector STR to integer.
469Alternatively, STR may be a buffer position in the current buffer 469Alternatively, STR may be a buffer position in the current buffer
470in which case a second argument, length LEN, should be supplied." 470in which case a second argument, length LEN, should be supplied.
471FLOAT, if non-nil, means generate and return a float instead of an integer
472\(use this for numbers that can overflow the Emacs integer)."
471 (if (stringp str) 473 (if (stringp str)
472 (setq len (length str)) 474 (setq len (length str))
473 (setq str (buffer-substring str (+ str len)))) 475 (setq str (buffer-substring str (+ str len))))
@@ -475,7 +477,8 @@ in which case a second argument, length LEN, should be supplied."
475 (i 0)) 477 (i 0))
476 (while (< i len) 478 (while (< i len)
477 (setq i (1+ i) 479 (setq i (1+ i)
478 result (+ (ash result 8) (aref str (- len i))))) 480 result (+ (if float (* result 256.0) (ash result 8))
481 (aref str (- len i)))))
479 result)) 482 result))
480 483
481(defun archive-int-to-mode (mode) 484(defun archive-int-to-mode (mode)
@@ -860,7 +863,8 @@ using `make-temp-file', and the generated name is returned."
860 "Set the current buffer as if it were visiting FILENAME." 863 "Set the current buffer as if it were visiting FILENAME."
861 (save-excursion 864 (save-excursion
862 (goto-char (point-min)) 865 (goto-char (point-min))
863 (let ((coding 866 (let ((buffer-undo-list t)
867 (coding
864 (or coding-system-for-read 868 (or coding-system-for-read
865 (and set-auto-coding-function 869 (and set-auto-coding-function
866 (save-excursion 870 (save-excursion
@@ -1331,13 +1335,14 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
1331 (let* ((namefld (buffer-substring (+ p 2) (+ p 2 13))) 1335 (let* ((namefld (buffer-substring (+ p 2) (+ p 2 13)))
1332 (fnlen (or (string-match "\0" namefld) 13)) 1336 (fnlen (or (string-match "\0" namefld) 13))
1333 (efnname (substring namefld 0 fnlen)) 1337 (efnname (substring namefld 0 fnlen))
1334 (csize (archive-l-e (+ p 15) 4)) 1338 ;; Convert to float to avoid overflow for very large files.
1339 (csize (archive-l-e (+ p 15) 4 'float))
1335 (moddate (archive-l-e (+ p 19) 2)) 1340 (moddate (archive-l-e (+ p 19) 2))
1336 (modtime (archive-l-e (+ p 21) 2)) 1341 (modtime (archive-l-e (+ p 21) 2))
1337 (ucsize (archive-l-e (+ p 25) 4)) 1342 (ucsize (archive-l-e (+ p 25) 4 'float))
1338 (fiddle (string= efnname (upcase efnname))) 1343 (fiddle (string= efnname (upcase efnname)))
1339 (ifnname (if fiddle (downcase efnname) efnname)) 1344 (ifnname (if fiddle (downcase efnname) efnname))
1340 (text (format " %8d %-11s %-8s %s" 1345 (text (format " %8.0f %-11s %-8s %s"
1341 ucsize 1346 ucsize
1342 (archive-dosdate moddate) 1347 (archive-dosdate moddate)
1343 (archive-dostime modtime) 1348 (archive-dostime modtime)
@@ -1359,7 +1364,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
1359 dash) 1364 dash)
1360 (archive-summarize-files (nreverse visual)) 1365 (archive-summarize-files (nreverse visual))
1361 (insert dash 1366 (insert dash
1362 (format " %8d %d file%s" 1367 (format " %8.0f %d file%s"
1363 totalsize 1368 totalsize
1364 (length files) 1369 (length files)
1365 (if (= 1 (length files)) "" "s")) 1370 (if (= 1 (length files)) "" "s"))
@@ -1393,9 +1398,10 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
1393 (while (progn (goto-char p) ;beginning of a base header. 1398 (while (progn (goto-char p) ;beginning of a base header.
1394 (looking-at "\\(.\\|\n\\)\\(.\\|\n\\)-l[hz][0-9ds]-")) 1399 (looking-at "\\(.\\|\n\\)\\(.\\|\n\\)-l[hz][0-9ds]-"))
1395 (let* ((hsize (char-after p)) ;size of the base header (level 0 and 1) 1400 (let* ((hsize (char-after p)) ;size of the base header (level 0 and 1)
1396 (csize (archive-l-e (+ p 7) 4)) ;size of a compressed file to follow (level 0 and 2), 1401 ;; Convert to float to avoid overflow for very large files.
1402 (csize (archive-l-e (+ p 7) 4 'float)) ;size of a compressed file to follow (level 0 and 2),
1397 ;size of extended headers + the compressed file to follow (level 1). 1403 ;size of extended headers + the compressed file to follow (level 1).
1398 (ucsize (archive-l-e (+ p 11) 4)) ;size of an uncompressed file. 1404 (ucsize (archive-l-e (+ p 11) 4 'float)) ;size of an uncompressed file.
1399 (time1 (archive-l-e (+ p 15) 2)) ;date/time (MSDOS format in level 0, 1 headers 1405 (time1 (archive-l-e (+ p 15) 2)) ;date/time (MSDOS format in level 0, 1 headers
1400 (time2 (archive-l-e (+ p 17) 2)) ;and UNIX format in level 2 header.) 1406 (time2 (archive-l-e (+ p 17) 2)) ;and UNIX format in level 2 header.)
1401 (hdrlvl (char-after (+ p 20))) ;header level 1407 (hdrlvl (char-after (+ p 20))) ;header level
@@ -1471,12 +1477,12 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
1471 (archive-unixtime time1 time2) 1477 (archive-unixtime time1 time2)
1472 (archive-dostime time1))) 1478 (archive-dostime time1)))
1473 (setq text (if archive-alternate-display 1479 (setq text (if archive-alternate-display
1474 (format " %8d %5S %5S %s" 1480 (format " %8.0f %5S %5S %s"
1475 ucsize 1481 ucsize
1476 (or uid "?") 1482 (or uid "?")
1477 (or gid "?") 1483 (or gid "?")
1478 ifnname) 1484 ifnname)
1479 (format " %10s %8d %-11s %-8s %s" 1485 (format " %10s %8.0f %-11s %-8s %s"
1480 modestr 1486 modestr
1481 ucsize 1487 ucsize
1482 moddate 1488 moddate
@@ -1506,8 +1512,8 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
1506 "M Length Uid Gid File\n" 1512 "M Length Uid Gid File\n"
1507 "M Filemode Length Date Time File\n")) 1513 "M Filemode Length Date Time File\n"))
1508 (sumline (if archive-alternate-display 1514 (sumline (if archive-alternate-display
1509 " %8d %d file%s" 1515 " %8.0f %d file%s"
1510 " %8d %d file%s"))) 1516 " %8.0f %d file%s")))
1511 (insert header dash) 1517 (insert header dash)
1512 (archive-summarize-files (nreverse visual)) 1518 (archive-summarize-files (nreverse visual))
1513 (insert dash 1519 (insert dash
@@ -1603,7 +1609,8 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
1603 ;; (method (archive-l-e (+ p 10) 2)) 1609 ;; (method (archive-l-e (+ p 10) 2))
1604 (modtime (archive-l-e (+ p 12) 2)) 1610 (modtime (archive-l-e (+ p 12) 2))
1605 (moddate (archive-l-e (+ p 14) 2)) 1611 (moddate (archive-l-e (+ p 14) 2))
1606 (ucsize (archive-l-e (+ p 24) 4)) 1612 ;; Convert to float to avoid overflow for very large files.
1613 (ucsize (archive-l-e (+ p 24) 4 'float))
1607 (fnlen (archive-l-e (+ p 28) 2)) 1614 (fnlen (archive-l-e (+ p 28) 2))
1608 (exlen (archive-l-e (+ p 30) 2)) 1615 (exlen (archive-l-e (+ p 30) 2))
1609 (fclen (archive-l-e (+ p 32) 2)) 1616 (fclen (archive-l-e (+ p 32) 2))
@@ -1629,7 +1636,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
1629 (string= (upcase efnname) efnname))) 1636 (string= (upcase efnname) efnname)))
1630 (ifnname (if fiddle (downcase efnname) efnname)) 1637 (ifnname (if fiddle (downcase efnname) efnname))
1631 (width (string-width ifnname)) 1638 (width (string-width ifnname))
1632 (text (format " %10s %8d %-11s %-8s %s" 1639 (text (format " %10s %8.0f %-11s %-8s %s"
1633 modestr 1640 modestr
1634 ucsize 1641 ucsize
1635 (archive-dosdate moddate) 1642 (archive-dosdate moddate)
@@ -1655,7 +1662,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
1655 dash) 1662 dash)
1656 (archive-summarize-files (nreverse visual)) 1663 (archive-summarize-files (nreverse visual))
1657 (insert dash 1664 (insert dash
1658 (format " %8d %d file%s" 1665 (format " %8.0f %d file%s"
1659 totalsize 1666 totalsize
1660 (length files) 1667 (length files)
1661 (if (= 1 (length files)) "" "s")) 1668 (if (= 1 (length files)) "" "s"))
@@ -1709,7 +1716,8 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
1709 (let* ((next (1+ (archive-l-e (+ p 6) 4))) 1716 (let* ((next (1+ (archive-l-e (+ p 6) 4)))
1710 (moddate (archive-l-e (+ p 14) 2)) 1717 (moddate (archive-l-e (+ p 14) 2))
1711 (modtime (archive-l-e (+ p 16) 2)) 1718 (modtime (archive-l-e (+ p 16) 2))
1712 (ucsize (archive-l-e (+ p 20) 4)) 1719 ;; Convert to float to avoid overflow for very large files.
1720 (ucsize (archive-l-e (+ p 20) 4 'float))
1713 (namefld (buffer-substring (+ p 38) (+ p 38 13))) 1721 (namefld (buffer-substring (+ p 38) (+ p 38 13)))
1714 (dirtype (char-after (+ p 4))) 1722 (dirtype (char-after (+ p 4)))
1715 (lfnlen (if (= dirtype 2) (char-after (+ p 56)) 0)) 1723 (lfnlen (if (= dirtype 2) (char-after (+ p 56)) 0))
@@ -1733,7 +1741,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
1733 (fiddle (and (= lfnlen 0) (string= efnname (upcase efnname)))) 1741 (fiddle (and (= lfnlen 0) (string= efnname (upcase efnname))))
1734 (ifnname (if fiddle (downcase efnname) efnname)) 1742 (ifnname (if fiddle (downcase efnname) efnname))
1735 (width (string-width ifnname)) 1743 (width (string-width ifnname))
1736 (text (format " %8d %-11s %-8s %s" 1744 (text (format " %8.0f %-11s %-8s %s"
1737 ucsize 1745 ucsize
1738 (archive-dosdate moddate) 1746 (archive-dosdate moddate)
1739 (archive-dostime modtime) 1747 (archive-dostime modtime)
@@ -1755,7 +1763,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
1755 dash) 1763 dash)
1756 (archive-summarize-files (nreverse visual)) 1764 (archive-summarize-files (nreverse visual))
1757 (insert dash 1765 (insert dash
1758 (format " %8d %d file%s" 1766 (format " %8.0f %d file%s"
1759 totalsize 1767 totalsize
1760 (length files) 1768 (length files)
1761 (if (= 1 (length files)) "" "s")) 1769 (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/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 f15dc3f7a4c..3110252288b 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -193,6 +193,8 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
193 (suggest-key-bindings keyboard (choice (const :tag "off" nil) 193 (suggest-key-bindings keyboard (choice (const :tag "off" nil)
194 (integer :tag "time" 2) 194 (integer :tag "time" 2)
195 (other :tag "on"))) 195 (other :tag "on")))
196 ;; macselect.c
197 (mac-dnd-known-types mac (repeat string) "22.1")
196 ;; macterm.c 198 ;; macterm.c
197 (mac-control-modifier mac (choice (const :tag "No modifier" nil) 199 (mac-control-modifier mac (choice (const :tag "No modifier" nil)
198 (const control) (const meta) 200 (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/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..278ffe6e7ca 100644
--- a/lisp/emacs-lisp/ewoc.el
+++ b/lisp/emacs-lisp/ewoc.el
@@ -221,16 +221,12 @@ dll bound to ewoc--dll, and VARLIST bound as in a let*.
221dll will be bound when VARLIST is initialized, but the current 221dll will be bound when VARLIST is initialized, but the current
222buffer will *not* have been changed. 222buffer will *not* have been changed.
223Return value of last form in FORMS." 223Return value of last form in FORMS."
224 (let ((old-buffer (make-symbol "old-buffer")) 224 (let ((hnd (make-symbol "ewoc")))
225 (hnd (make-symbol "ewoc"))) 225 `(let* ((,hnd ,ewoc)
226 `(let* ((,old-buffer (current-buffer))
227 (,hnd ,ewoc)
228 (dll (ewoc--dll ,hnd)) 226 (dll (ewoc--dll ,hnd))
229 ,@varlist) 227 ,@varlist)
230 (set-buffer (ewoc--buffer ,hnd)) 228 (with-current-buffer (ewoc--buffer ,hnd)
231 (unwind-protect 229 ,@forms))))
232 (progn ,@forms)
233 (set-buffer ,old-buffer)))))
234 230
235(defmacro ewoc--set-buffer-bind-dll (ewoc &rest forms) 231(defmacro ewoc--set-buffer-bind-dll (ewoc &rest forms)
236 `(ewoc--set-buffer-bind-dll-let* ,ewoc nil ,@forms)) 232 `(ewoc--set-buffer-bind-dll-let* ,ewoc nil ,@forms))
@@ -322,8 +318,8 @@ be inserted at the bottom of the ewoc."
322 (unless header (setq header "")) 318 (unless header (setq header ""))
323 (unless footer (setq footer "")) 319 (unless footer (setq footer ""))
324 (setf (ewoc--node-start-marker dll) (copy-marker pos)) 320 (setf (ewoc--node-start-marker dll) (copy-marker pos))
325 (let ((foot (ewoc--create-node footer (lambda (x) (insert footer)) pos)) 321 (let ((foot (ewoc--create-node footer 'insert pos))
326 (head (ewoc--create-node header (lambda (x) (insert header)) pos))) 322 (head (ewoc--create-node header 'insert pos)))
327 (ewoc--node-enter-first dll head) 323 (ewoc--node-enter-first dll head)
328 (ewoc--node-enter-last dll foot) 324 (ewoc--node-enter-last dll foot)
329 (setf (ewoc--header new-ewoc) head) 325 (setf (ewoc--header new-ewoc) head)
@@ -601,8 +597,8 @@ Return nil if the buffer has been deleted."
601 "Set the HEADER and FOOTER of EWOC." 597 "Set the HEADER and FOOTER of EWOC."
602 (setf (ewoc--node-data (ewoc--header ewoc)) header) 598 (setf (ewoc--node-data (ewoc--header ewoc)) header)
603 (setf (ewoc--node-data (ewoc--footer ewoc)) footer) 599 (setf (ewoc--node-data (ewoc--footer ewoc)) footer)
604 (ewoc--refresh-node (lambda (x) (insert header)) (ewoc--header ewoc)) 600 (ewoc--refresh-node 'insert (ewoc--header ewoc))
605 (ewoc--refresh-node (lambda (x) (insert footer)) (ewoc--footer ewoc))) 601 (ewoc--refresh-node 'insert (ewoc--footer ewoc)))
606 602
607 603
608(provide 'ewoc) 604(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 66d505ee011..d0c2208fc6f 100644
--- a/lisp/env.el
+++ b/lisp/env.el
@@ -133,7 +133,7 @@ a side-effect."
133 (let* ((var (read-envvar-name "Set environment variable: " nil)) 133 (let* ((var (read-envvar-name "Set environment variable: " nil))
134 (value (getenv var))) 134 (value (getenv var)))
135 (when value 135 (when value
136 (push value setenv-history)) 136 (add-to-history 'setenv-history value))
137 ;; Here finally we specify the args to give call setenv with. 137 ;; Here finally we specify the args to give call setenv with.
138 (list var 138 (list var
139 (read-from-minibuffer (format "Set %s to value: " var) 139 (read-from-minibuffer (format "Set %s to value: " var)
diff --git a/lisp/files.el b/lisp/files.el
index 16c0f1288a1..c79365a6926 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2350,31 +2350,29 @@ asking you for confirmation."
2350;; For variables defined in the C source code the declaration should go here: 2350;; For variables defined in the C source code the declaration should go here:
2351 2351
2352;; FIXME: Some variables should be moved according to the rules above. 2352;; FIXME: Some variables should be moved according to the rules above.
2353(let ((string-or-null (lambda (a) (or (stringp a) (null a))))) 2353(mapc (lambda (pair)
2354 (eval 2354 (put (car pair) 'safe-local-variable (cdr pair)))
2355 `(mapc (lambda (pair) 2355 '((byte-compile-dynamic . booleanp)
2356 (put (car pair) 'safe-local-variable (cdr pair))) 2356 (byte-compile-dynamic-docstrings . booleanp)
2357 '((byte-compile-dynamic . booleanp) 2357 (byte-compile-warnings . booleanp)
2358 (byte-compile-dynamic-docstrings . booleanp) 2358 (c-basic-offset . integerp)
2359 (byte-compile-warnings . booleanp) 2359 (c-file-style . stringp)
2360 (c-basic-offset . integerp) 2360 (c-indent-level . integerp)
2361 (c-file-style . stringp) 2361 (comment-column . integerp)
2362 (c-indent-level . integerp) 2362 (compile-command . string-or-null-p)
2363 (comment-column . integerp) 2363 (find-file-visit-truename . booleanp)
2364 (compile-command . string-or-null-p) 2364 (fill-column . integerp)
2365 (find-file-visit-truename . booleanp) 2365 (fill-prefix . string-or-null-p)
2366 (fill-column . integerp) 2366 (indent-tabs-mode . booleanp) ;; C source code
2367 (fill-prefix . string-or-null-p) 2367 (kept-old-versions . integerp)
2368 (indent-tabs-mode . booleanp) ;; C source code 2368 (kept-new-versions . integerp)
2369 (kept-old-versions . integerp) 2369 (left-margin . integerp)
2370 (kept-new-versions . integerp) 2370 (no-byte-compile . booleanp)
2371 (left-margin . integerp) 2371 (no-update-autoloads . booleanp)
2372 (no-byte-compile . booleanp) 2372 (outline-regexp . string-or-null-p)
2373 (no-update-autoloads . booleanp) 2373 (tab-width . integerp) ;; C source code
2374 (outline-regexp . string-or-null-p) 2374 (truncate-lines . booleanp) ;; C source code
2375 (tab-width . integerp) ;; C source code 2375 (version-control . symbolp)))
2376 (truncate-lines . booleanp) ;; C source code
2377 (version-control . symbolp)))))
2378 2376
2379(put 'c-set-style 'safe-local-eval-function t) 2377(put 'c-set-style 'safe-local-eval-function t)
2380 2378
@@ -3932,7 +3930,7 @@ user. In such situations, one has to be careful with potentially
3932time consuming operations. 3930time consuming operations.
3933 3931
3934For more information on how this variable is used by Auto Revert mode, 3932For more information on how this variable is used by Auto Revert mode,
3935see Info node `(emacs-xtra)Supporting additional buffers'.") 3933see Info node `(emacs)Supporting additional buffers'.")
3936 3934
3937(defvar before-revert-hook nil 3935(defvar before-revert-hook nil
3938 "Normal hook for `revert-buffer' to run before reverting. 3936 "Normal hook for `revert-buffer' to run before reverting.
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index c2b8d7200da..f001a0bfaac 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -1974,17 +1974,17 @@ This function could be MATCHER in a MATCH-ANCHORED `font-lock-keywords' item."
1974;; 1974;;
1975;; (regexp-opt 1975;; (regexp-opt
1976;; '("define" "elif" "else" "endif" "error" "file" "if" "ifdef" 1976;; '("define" "elif" "else" "endif" "error" "file" "if" "ifdef"
1977;; "ifndef" "include" "line" "pragma" "undef")) 1977;; "ifndef" "import" "include" "line" "pragma" "undef" "warning"))
1978;; 1978;;
1979(defconst cpp-font-lock-keywords-source-directives 1979(defconst cpp-font-lock-keywords-source-directives
1980 "define\\|e\\(?:l\\(?:if\\|se\\)\\|ndif\\|rror\\)\\|file\\|i\\(?:f\\(?:n?def\\)?\\|nclude\\)\\|line\\|pragma\\|undef" 1980 "define\\|e\\(?:l\\(?:if\\|se\\)\\|ndif\\|rror\\)\\|file\\|i\\(?:f\\(?:n?def\\)?\\|mport\\|nclude\\)\\|line\\|pragma\\|undef\\|warning"
1981 "Regular expressoin used in `cpp-font-lock-keywords'.") 1981 "Regular expressoin used in `cpp-font-lock-keywords'.")
1982 1982
1983;; `cpp-font-lock-keywords-source-depth' is calculated from: 1983;; `cpp-font-lock-keywords-source-depth' is calculated from:
1984;; 1984;;
1985;; (regexp-opt-depth (regexp-opt 1985;; (regexp-opt-depth (regexp-opt
1986;; '("define" "elif" "else" "endif" "error" "file" "if" "ifdef" 1986;; '("define" "elif" "else" "endif" "error" "file" "if" "ifdef"
1987;; "ifndef" "include" "line" "pragma" "undef"))) 1987;; "ifndef" "import" "include" "line" "pragma" "undef" "warning")))
1988;; 1988;;
1989(defconst cpp-font-lock-keywords-source-depth 0 1989(defconst cpp-font-lock-keywords-source-depth 0
1990 "An integer representing regular expression depth of `cpp-font-lock-keywords-source-directives'. 1990 "An integer representing regular expression depth of `cpp-font-lock-keywords-source-directives'.
@@ -1996,7 +1996,7 @@ Used in `cpp-font-lock-keywords'.")
1996 (list 1996 (list
1997 ;; 1997 ;;
1998 ;; Fontify error directives. 1998 ;; Fontify error directives.
1999 '("^#[ \t]*error[ \t]+\\(.+\\)" 1 font-lock-warning-face prepend) 1999 '("^#[ \t]*\\(?:error\\|warning\\)[ \t]+\\(.+\\)" 1 font-lock-warning-face prepend)
2000 ;; 2000 ;;
2001 ;; Fontify filenames in #include <...> preprocessor directives as strings. 2001 ;; Fontify filenames in #include <...> preprocessor directives as strings.
2002 '("^#[ \t]*\\(?:import\\|include\\)[ \t]*\\(<[^>\"\n]*>?\\)" 2002 '("^#[ \t]*\\(?:import\\|include\\)[ \t]*\\(<[^>\"\n]*>?\\)"
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index 4b1069b26c1..6264d2e56b5 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -324,14 +324,11 @@ directory, like `default-directory'."
324 :type '(repeat function) 324 :type '(repeat function)
325 :group 'ibuffer) 325 :group 'ibuffer)
326 326
327(eval-when-compile
328(defcustom ibuffer-compressed-file-name-regexp 327(defcustom ibuffer-compressed-file-name-regexp
329 (concat "\\.\\(" 328 "\\.\\(arj\\|bgz\\|bz2\\|gz\\|lzh\\|taz\\|tgz\\|zip\\|z\\)$"
330 (regexp-opt '("arj" "bgz" "bz2" "gz" "lzh" "taz" "tgz" "zip" "z"))
331 "\\)$")
332 "Regexp to match compressed file names." 329 "Regexp to match compressed file names."
333 :type 'regexp 330 :type 'regexp
334 :group 'ibuffer)) 331 :group 'ibuffer)
335 332
336(defcustom ibuffer-hook nil 333(defcustom ibuffer-hook nil
337 "Hook run when `ibuffer' is called." 334 "Hook run when `ibuffer' is called."
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 78b523f3845..840af2a9b81 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -831,21 +831,10 @@ NOPUSH is t and EDIT is t."
831(defun isearch-update-ring (string &optional regexp) 831(defun isearch-update-ring (string &optional regexp)
832 "Add STRING to the beginning of the search ring. 832 "Add STRING to the beginning of the search ring.
833REGEXP if non-nil says use the regexp search ring." 833REGEXP if non-nil says use the regexp search ring."
834 (if regexp 834 (add-to-history
835 (when (or (null regexp-search-ring) 835 (if regexp 'regexp-search-ring 'search-ring)
836 (not (string= string (car regexp-search-ring)))) 836 string
837 (when history-delete-duplicates 837 (if regexp regexp-search-ring-max search-ring-max)))
838 (setq regexp-search-ring (delete string regexp-search-ring)))
839 (push string regexp-search-ring)
840 (when (> (length regexp-search-ring) regexp-search-ring-max)
841 (setcdr (nthcdr (1- search-ring-max) regexp-search-ring) nil)))
842 (when (or (null search-ring)
843 (not (string= string (car search-ring))))
844 (when history-delete-duplicates
845 (setq search-ring (delete string search-ring)))
846 (push string search-ring)
847 (when (> (length search-ring) search-ring-max)
848 (setcdr (nthcdr (1- search-ring-max) search-ring) nil)))))
849 838
850;; Switching buffers should first terminate isearch-mode. 839;; Switching buffers should first terminate isearch-mode.
851;; ;; For Emacs 19, the frame switch event is handled. 840;; ;; 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 402278489bf..6d6c03823d3 100644
--- a/lisp/ldefs-boot.el
+++ b/lisp/ldefs-boot.el
@@ -7037,7 +7037,7 @@ or delete subdirectories can bypass this machinery. Hence, you sometimes
7037may have to reset some subdirectory switches after a `dired-undo'. 7037may have to reset some subdirectory switches after a `dired-undo'.
7038You can reset all subdirectory switches to the default using 7038You can reset all subdirectory switches to the default using
7039\\<dired-mode-map>\\[dired-reset-subdir-switches]. 7039\\<dired-mode-map>\\[dired-reset-subdir-switches].
7040See Info node `(emacs-xtra)Subdir switches' for more details. 7040See Info node `(emacs)Subdir switches' for more details.
7041 7041
7042\(fn &optional ARG TEST-FOR-SUBDIR)" t nil) 7042\(fn &optional ARG TEST-FOR-SUBDIR)" t nil)
7043 7043
@@ -7175,7 +7175,7 @@ or delete subdirectories can bypass this machinery. Hence, you sometimes
7175may have to reset some subdirectory switches after a `dired-undo'. 7175may have to reset some subdirectory switches after a `dired-undo'.
7176You can reset all subdirectory switches to the default using 7176You can reset all subdirectory switches to the default using
7177\\<dired-mode-map>\\[dired-reset-subdir-switches]. 7177\\<dired-mode-map>\\[dired-reset-subdir-switches].
7178See Info node `(emacs-xtra)Subdir switches' for more details. 7178See Info node `(emacs)Subdir switches' for more details.
7179 7179
7180\(fn DIRNAME &optional SWITCHES NO-ERROR-IF-NOT-DIR-P)" t nil) 7180\(fn DIRNAME &optional SWITCHES NO-ERROR-IF-NOT-DIR-P)" t nil)
7181 7181
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/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 28fcb70bb8b..a20f11e0aa2 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -694,6 +694,7 @@ With arg, enter name of variable to be watched in the minibuffer."
694 (if (and transient-mark-mode mark-active) 694 (if (and transient-mark-mode mark-active)
695 (buffer-substring (region-beginning) (region-end)) 695 (buffer-substring (region-beginning) (region-end))
696 (tooltip-identifier-from-point (point)))))) 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."
@@ -1912,7 +1911,7 @@ static char *magick[] = {
1912 (let* ((buffer (find-file-noselect 1911 (let* ((buffer (find-file-noselect
1913 (if (file-exists-p file) file 1912 (if (file-exists-p file) file
1914 (cdr (assoc bptno gdb-location-alist))))) 1913 (cdr (assoc bptno gdb-location-alist)))))
1915 (window (unless (gdb-display-source-buffer buffer) 1914 (window (or (gdb-display-source-buffer buffer)
1916 (display-buffer buffer)))) 1915 (display-buffer buffer))))
1917 (setq gdb-source-window window) 1916 (setq gdb-source-window window)
1918 (with-current-buffer buffer 1917 (with-current-buffer buffer
@@ -2754,6 +2753,7 @@ corresponding to the mode line clicked."
2754 ;; Put buffer list in window if we 2753 ;; Put buffer list in window if we
2755 ;; can't find a source file. 2754 ;; can't find a source file.
2756 (list-buffers-noselect)))) 2755 (list-buffers-noselect))))
2756 (setq gdb-source-window (selected-window))
2757 (when gdb-use-separate-io-buffer 2757 (when gdb-use-separate-io-buffer
2758 (split-window-horizontally) 2758 (split-window-horizontally)
2759 (other-window 1) 2759 (other-window 1)
@@ -2781,6 +2781,7 @@ This arrangement depends on the value of `gdb-many-windows'."
2781 (if gud-last-last-frame 2781 (if gud-last-last-frame
2782 (gud-find-file (car gud-last-last-frame)) 2782 (gud-find-file (car gud-last-last-frame))
2783 (gud-find-file gdb-main-file))) 2783 (gud-find-file gdb-main-file)))
2784 (setq gdb-source-window (selected-window))
2784 (other-window 1)))) 2785 (other-window 1))))
2785 2786
2786(defun gdb-reset () 2787(defun gdb-reset ()
@@ -2802,8 +2803,6 @@ Kills the gdb buffers, and resets variables and the source buffers."
2802 (setq overlay-arrow-variable-list 2803 (setq overlay-arrow-variable-list
2803 (delq 'gdb-overlay-arrow-position overlay-arrow-variable-list)) 2804 (delq 'gdb-overlay-arrow-position overlay-arrow-variable-list))
2804 (setq fringe-indicator-alist '((overlay-arrow . right-triangle))) 2805 (setq fringe-indicator-alist '((overlay-arrow . right-triangle)))
2805 (if (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
2806 (speedbar-refresh))
2807 (setq gud-running nil) 2806 (setq gud-running nil)
2808 (setq gdb-active-process nil) 2807 (setq gdb-active-process nil)
2809 (setq gdb-var-list nil) 2808 (setq gdb-var-list nil)
@@ -3231,7 +3230,8 @@ numchild=\"\\(.+?\\)\",.*?value=\\(\".*?\"\\),.*?type=\"\\(.+?\\)\".*?}")
3231 (throw 'child-already-watched nil)) 3230 (throw 'child-already-watched nil))
3232 (push varchild var-list)))) 3231 (push varchild var-list))))
3233 (push var var-list))) 3232 (push var var-list)))
3234 (setq gdb-var-list (nreverse var-list))))) 3233 (setq gdb-var-list (nreverse var-list))))
3234 (gdb-speedbar-update))
3235 3235
3236; Uses "-var-update --all-values". Needs GDB 6.4 onwards. 3236; Uses "-var-update --all-values". Needs GDB 6.4 onwards.
3237(defun gdb-var-update-1 () 3237(defun gdb-var-update-1 ()
@@ -3264,11 +3264,7 @@ in_scope=\"\\(.*?\\)\".*?}")
3264 (read (match-string 2))))))) 3264 (read (match-string 2)))))))
3265 (setq gdb-pending-triggers 3265 (setq gdb-pending-triggers
3266 (delq 'gdb-var-update gdb-pending-triggers)) 3266 (delq 'gdb-var-update gdb-pending-triggers))
3267 (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) 3267 (gdb-speedbar-update))
3268 ;; dummy command to update speedbar at right time
3269 (gdb-enqueue-input (list "server pwd\n" 'gdb-speedbar-refresh))
3270 ;; keep gdb-pending-triggers non-nil till end
3271 (push 'gdb-speedbar-refresh gdb-pending-triggers)))
3272 3268
3273;; Registers buffer. 3269;; Registers buffer.
3274;; 3270;;
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index c695272e92b..410a973d1b4 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -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/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/server.el b/lisp/server.el
index 015c4c6f171..7835c56c3e2 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -858,7 +858,7 @@ so don't mark these buffers specially, just visit them normally."
858 ;; deleted file, offer to write it. 858 ;; deleted file, offer to write it.
859 (let* ((filen (car file)) 859 (let* ((filen (car file))
860 (obuf (get-file-buffer filen))) 860 (obuf (get-file-buffer filen)))
861 (push filen file-name-history) 861 (add-to-history 'file-name-history filen)
862 (if (and obuf (set-buffer obuf)) 862 (if (and obuf (set-buffer obuf))
863 (progn 863 (progn
864 (cond ((file-exists-p filen) 864 (cond ((file-exists-p filen)
diff --git a/lisp/simple.el b/lisp/simple.el
index bd8a9d1a284..57e716e4683 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1144,7 +1144,7 @@ they are expressions; otherwise they are strings.
1144\(That convention is designed to do the right thing for 1144\(That convention is designed to do the right thing for
1145recursive uses of the minibuffer.)") 1145recursive uses of the minibuffer.)")
1146(setq minibuffer-history-variable 'minibuffer-history) 1146(setq minibuffer-history-variable 'minibuffer-history)
1147(setq minibuffer-history-position nil) 1147(setq minibuffer-history-position nil) ;; Defvar is in C code.
1148(defvar minibuffer-history-search-history nil) 1148(defvar minibuffer-history-search-history nil)
1149 1149
1150(defvar minibuffer-text-before-history nil 1150(defvar minibuffer-text-before-history nil
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 07039fa8c18..12a53113f0a 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -827,7 +827,16 @@ opening the first frame (e.g. open a connection to an X server).")
827 (format "Invalid user name %s" 827 (format "Invalid user name %s"
828 init-file-user) 828 init-file-user)
829 :error) 829 :error)
830 (if (file-directory-p (expand-file-name (concat "~" init-file-user))) 830 (if (file-directory-p (expand-file-name
831 ;; We don't support ~USER on MS-Windows except
832 ;; for the current user, and always load .emacs
833 ;; from the current user's home directory (see
834 ;; below). So always check "~", even if invoked
835 ;; with "-u USER", or if $USER or $LOGNAME are
836 ;; set to something different.
837 (if (eq system-type 'windows-nt)
838 "~"
839 (concat "~" init-file-user))))
831 nil 840 nil
832 (display-warning 'initialization 841 (display-warning 'initialization
833 (format "User %s has no home directory" 842 (format "User %s has no home directory"
@@ -1282,7 +1291,9 @@ where FACE is a valid face specification, as it can be used with
1282 (set-buffer buffer) 1291 (set-buffer buffer)
1283 (erase-buffer) 1292 (erase-buffer)
1284 (if pure-space-overflow 1293 (if pure-space-overflow
1285 (insert "Warning Warning Pure space overflow Warning Warning\n")) 1294 (insert "\
1295Warning Warning!!! Pure space overflow !!!Warning Warning
1296\(See the node Pure Storage in the Lisp manual for details.)\n"))
1286 (fancy-splash-head) 1297 (fancy-splash-head)
1287 (apply #'fancy-splash-insert text) 1298 (apply #'fancy-splash-insert text)
1288 (fancy-splash-tail) 1299 (fancy-splash-tail)
@@ -1354,7 +1365,7 @@ mouse."
1354 emulation-mode-map-alists nil 1365 emulation-mode-map-alists nil
1355 buffer-undo-list t 1366 buffer-undo-list t
1356 mode-line-format (propertize "---- %b %-" 1367 mode-line-format (propertize "---- %b %-"
1357 'face '(:weight bold)) 1368 'face 'mode-line-buffer-id)
1358 fancy-splash-stop-time (+ (float-time) 1369 fancy-splash-stop-time (+ (float-time)
1359 fancy-splash-max-time) 1370 fancy-splash-max-time)
1360 timer (run-with-timer 0 fancy-splash-delay 1371 timer (run-with-timer 0 fancy-splash-delay
@@ -1406,10 +1417,12 @@ we put it on this frame."
1406 (with-current-buffer (get-buffer-create "GNU Emacs") 1417 (with-current-buffer (get-buffer-create "GNU Emacs")
1407 (set (make-local-variable 'tab-width) 8) 1418 (set (make-local-variable 'tab-width) 8)
1408 (set (make-local-variable 'mode-line-format) 1419 (set (make-local-variable 'mode-line-format)
1409 (propertize "---- %b %-" 'face '(:weight bold))) 1420 (propertize "---- %b %-" 'face 'mode-line-buffer-id))
1410 1421
1411 (if pure-space-overflow 1422 (if pure-space-overflow
1412 (insert "Warning Warning Pure space overflow Warning Warning\n")) 1423 (insert "\
1424Warning Warning!!! Pure space overflow !!!Warning Warning
1425\(See the node Pure Storage in the Lisp manual for details.)\n"))
1413 1426
1414 ;; The convention for this piece of code is that 1427 ;; The convention for this piece of code is that
1415 ;; each piece of output starts with one or two newlines 1428 ;; each piece of output starts with one or two newlines
@@ -1623,9 +1636,7 @@ normal otherwise."
1623 (not noninteractive)) 1636 (not noninteractive))
1624 (display-warning 1637 (display-warning
1625 'initialization 1638 'initialization
1626 "Building Emacs overflowed pure space. See \"(elisp)Building Emacs\" for more information." 1639 "Building Emacs overflowed pure space. (See the node Pure Storage in the Lisp manual for details.)"
1627 ;; FIXME: Tell the user what kind of problems are possible and how to fix
1628 ;; the overflow.
1629 :warning)) 1640 :warning))
1630 1641
1631 (when command-line-args-left 1642 (when command-line-args-left
diff --git a/lisp/subr.el b/lisp/subr.el
index 43f1d5e57b1..bc7789f3384 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/mac-win.el b/lisp/term/mac-win.el
index 4ab0606c18a..6931f796e5c 100644
--- a/lisp/term/mac-win.el
+++ b/lisp/term/mac-win.el
@@ -82,6 +82,8 @@
82(defvar mac-services-selection) 82(defvar mac-services-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,107 @@ 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(cp-make-coding-system
1134 mac-centraleurroman
1135 [?\,AD(B ?\$,1 (B ?\$,1 !(B ?\,AI(B ?\$,1 $(B ?\,AV(B ?\,A\(B ?\,Aa(B ?\$,1 %(B ?\$,1 ,(B ?\,Ad(B ?\$,1 -(B ?\$,1 &(B ?\$,1 '(B ?\,Ai(B ?\$,1!9(B
1136 ?\$,1!:(B ?\$,1 .(B ?\,Am(B ?\$,1 /(B ?\$,1 2(B ?\$,1 3(B ?\$,1 6(B ?\,As(B ?\$,1 7(B ?\,At(B ?\,Av(B ?\,Au(B ?\,Az(B ?\$,1 :(B ?\$,1 ;(B ?\,A|(B
1137 ?\$,1s (B ?\,A0(B ?\$,1 8(B ?\,A#(B ?\,A'(B ?\$,1s"(B ?\,A6(B ?\,A_(B ?\,A.(B ?\,A)(B ?\$,1ub(B ?\$,1 9(B ?\,A((B ?\$,1y (B ?\$,1 C(B ?\$,1 N(B
1138 ?\$,1 O(B ?\$,1 J(B ?\$,1y$(B ?\$,1y%(B ?\$,1 K(B ?\$,1 V(B ?\$,1x"(B ?\$,1x1(B ?\$,1 b(B ?\$,1 [(B ?\$,1 \(B ?\$,1 ](B ?\$,1 ^(B ?\$,1 Y(B ?\$,1 Z(B ?\$,1 e(B
1139 ?\$,1 f(B ?\$,1 c(B ?\,A,(B ?\$,1x:(B ?\$,1 d(B ?\$,1 g(B ?\$,1x&(B ?\,A+(B ?\,A;(B ?\$,1s&(B ?\,A (B ?\$,1 h(B ?\$,1 p(B ?\,AU(B ?\$,1 q(B ?\$,1 l(B
1140 ?\$,1rs(B ?\$,1rt(B ?\$,1r|(B ?\$,1r}(B ?\$,1rx(B ?\$,1ry(B ?\,Aw(B ?\$,2"*(B ?\$,1 m(B ?\$,1 t(B ?\$,1 u(B ?\$,1 x(B ?\$,1s9(B ?\$,1s:(B ?\$,1 y(B ?\$,1 v(B
1141 ?\$,1 w(B ?\$,1! (B ?\$,1rz(B ?\$,1r~(B ?\$,1!!(B ?\$,1 z(B ?\$,1 {(B ?\,AA(B ?\$,1!$(B ?\$,1!%(B ?\,AM(B ?\$,1!=(B ?\$,1!>(B ?\$,1!*(B ?\,AS(B ?\,AT(B
1142 ?\$,1!+(B ?\$,1!.(B ?\,AZ(B ?\$,1!/(B ?\$,1!0(B ?\$,1!1(B ?\$,1!2(B ?\$,1!3(B ?\,A](B ?\,A}(B ?\$,1 W(B ?\$,1!;(B ?\$,1 a(B ?\$,1!<(B ?\$,1 B(B ?\$,1$g(B]
1143 "Mac Central European Roman Encoding (MIME:x-mac-centraleurroman).")
1144(coding-system-put 'mac-centraleurroman 'mime-charset 'x-mac-centraleurroman)
1145
1146(cp-make-coding-system
1147 mac-cyrillic
1148 [?\$,1(0(B ?\$,1(1(B ?\$,1(2(B ?\$,1(3(B ?\$,1(4(B ?\$,1(5(B ?\$,1(6(B ?\$,1(7(B ?\$,1(8(B ?\$,1(9(B ?\$,1(:(B ?\$,1(;(B ?\$,1(<(B ?\$,1(=(B ?\$,1(>(B ?\$,1(?(B
1149 ?\$,1(@(B ?\$,1(A(B ?\$,1(B(B ?\$,1(C(B ?\$,1(D(B ?\$,1(E(B ?\$,1(F(B ?\$,1(G(B ?\$,1(H(B ?\$,1(I(B ?\$,1(J(B ?\$,1(K(B ?\$,1(L(B ?\$,1(M(B ?\$,1(N(B ?\$,1(O(B
1150 ?\$,1s (B ?\,A0(B ?\$,1)P(B ?\,A#(B ?\,A'(B ?\$,1s"(B ?\,A6(B ?\$,1(&(B ?\,A.(B ?\,A)(B ?\$,1ub(B ?\$,1("(B ?\$,1(r(B ?\$,1y (B ?\$,1(#(B ?\$,1(s(B
1151 ?\$,1x>(B ?\,A1(B ?\$,1y$(B ?\$,1y%(B ?\$,1(v(B ?\,A5(B ?\$,1)Q(B ?\$,1(((B ?\$,1($(B ?\$,1(t(B ?\$,1('(B ?\$,1(w(B ?\$,1()(B ?\$,1(y(B ?\$,1(*(B ?\$,1(z(B
1152 ?\$,1(x(B ?\$,1(%(B ?\,A,(B ?\$,1x:(B ?\$,1!R(B ?\$,1xh(B ?\$,1x&(B ?\,A+(B ?\,A;(B ?\$,1s&(B ?\,A (B ?\$,1(+(B ?\$,1({(B ?\$,1(,(B ?\$,1(|(B ?\$,1(u(B
1153 ?\$,1rs(B ?\$,1rt(B ?\$,1r|(B ?\$,1r}(B ?\$,1rx(B ?\$,1ry(B ?\,Aw(B ?\$,1r~(B ?\$,1(.(B ?\$,1(~(B ?\$,1(/(B ?\$,1((B ?\$,1uV(B ?\$,1(!(B ?\$,1(q(B ?\$,1(o(B
1154 ?\$,1(P(B ?\$,1(Q(B ?\$,1(R(B ?\$,1(S(B ?\$,1(T(B ?\$,1(U(B ?\$,1(V(B ?\$,1(W(B ?\$,1(X(B ?\$,1(Y(B ?\$,1(Z(B ?\$,1([(B ?\$,1(\(B ?\$,1(](B ?\$,1(^(B ?\$,1(_(B
1155 ?\$,1(`(B ?\$,1(a(B ?\$,1(b(B ?\$,1(c(B ?\$,1(d(B ?\$,1(e(B ?\$,1(f(B ?\$,1(g(B ?\$,1(h(B ?\$,1(i(B ?\$,1(j(B ?\$,1(k(B ?\$,1(l(B ?\$,1(m(B ?\$,1(n(B ?\$,1tL(B]
1156 "Mac Cyrillic Encoding (MIME:x-mac-cyrillic).")
1157(coding-system-put 'mac-cyrillic 'mime-charset 'x-mac-cyrillic)
1158
1159(let
1160 ((encoding-vector
1161 (vconcat
1162 (make-vector 32 nil)
1163 ;; mac-symbol (32..126) -> emacs-mule mapping
1164 [?\ ?\! ?\$,1x (B ?\# ?\$,1x#(B ?\% ?\& ?\$,1x-(B ?\( ?\) ?\$,1x7(B ?\+ ?\, ?\$,1x2(B ?\. ?\/
1165 ?\0 ?\1 ?\2 ?\3 ?\4 ?\5 ?\6 ?\7 ?\8 ?\9 ?\: ?\; ?\< ?\= ?\> ?\?
1166 ?\$,1xe(B ?\$,1&q(B ?\$,1&r(B ?\$,1''(B ?\$,1&t(B ?\$,1&u(B ?\$,1'&(B ?\$,1&s(B ?\$,1&w(B ?\$,1&y(B ?\$,1'Q(B ?\$,1&z(B ?\$,1&{(B ?\$,1&|(B ?\$,1&}(B ?\$,1&(B
1167 ?\$,1' (B ?\$,1&x(B ?\$,1'!(B ?\$,1'#(B ?\$,1'$(B ?\$,1'%(B ?\$,1'B(B ?\$,1')(B ?\$,1&~(B ?\$,1'((B ?\$,1&v(B ?\[ ?\$,1xT(B ?\] ?\$,1ye(B ?\_
1168 ?\$,3bE(B ?\$,1'1(B ?\$,1'2(B ?\$,1'G(B ?\$,1'4(B ?\$,1'5(B ?\$,1'F(B ?\$,1'3(B ?\$,1'7(B ?\$,1'9(B ?\$,1'U(B ?\$,1':(B ?\$,1';(B ?\$,1'<(B ?\$,1'=(B ?\$,1'?(B
1169 ?\$,1'@(B ?\$,1'8(B ?\$,1'A(B ?\$,1'C(B ?\$,1'D(B ?\$,1'E(B ?\$,1'V(B ?\$,1'I(B ?\$,1'>(B ?\$,1'H(B ?\$,1'6(B ?\{ ?\| ?\} ?\$,1x\(B]
1170 (make-vector (- 160 127) nil)
1171 ;; mac-symbol (160..254) -> emacs-mule mapping
1172 ;; Mapping of the following characters are changed from the
1173 ;; original one:
1174 ;; 0xE2 0x00AE+0xF87F -> 0x00AE # REGISTERED SIGN, alternate: sans serif
1175 ;; 0xE3 0x00A9+0xF87F -> 0x00A9 # COPYRIGHT SIGN, alternate: sans serif
1176 ;; 0xE4 0x2122+0xF87F -> 0x2122 # TRADE MARK SIGN, alternate: sans serif
1177 [?\$,1tL(B ?\$,1'R(B ?\$,1s2(B ?\$,1y$(B ?\$,1sD(B ?\$,1x>(B ?\$,1!R(B ?\$,2#c(B ?\$,2#f(B ?\$,2#e(B ?\$,2#`(B ?\$,1vt(B ?\$,1vp(B ?\$,1vq(B ?\$,1vr(B ?\$,1vs(B
1178 ?\,A0(B ?\,A1(B ?\$,1s3(B ?\$,1y%(B ?\,AW(B ?\$,1x=(B ?\$,1x"(B ?\$,1s"(B ?\,Aw(B ?\$,1y (B ?\$,1y!(B ?\$,1xh(B ?\$,1s&(B ?\$,1|p(B ?\$,1|O(B ?\$,1w5(B
1179 ?\$,1uu(B ?\$,1uQ(B ?\$,1u\(B ?\$,1uX(B ?\$,1yW(B ?\$,1yU(B ?\$,1x%(B ?\$,1xI(B ?\$,1xJ(B ?\$,1yC(B ?\$,1yG(B ?\$,1yD(B ?\$,1yB(B ?\$,1yF(B ?\$,1x((B ?\$,1x)(B
1180 ?\$,1x@(B ?\$,1x'(B ?\,A.(B ?\,A)(B ?\$,1ub(B ?\$,1x/(B ?\$,1x:(B ?\$,1z%(B ?\,A,(B ?\$,1xG(B ?\$,1xH(B ?\$,1wT(B ?\$,1wP(B ?\$,1wQ(B ?\$,1wR(B ?\$,1wS(B
1181 ?\$,2"*(B ?\$,2=H(B ?\,A.(B ?\,A)(B ?\$,1ub(B ?\$,1x1(B ?\$,1|;(B ?\$,1|<(B ?\$,1|=(B ?\$,1|A(B ?\$,1|B(B ?\$,1|C(B ?\$,1|G(B ?\$,1|H(B ?\$,1|I(B ?\$,1|J(B
1182 ?\$,3b_(B ?\$,2=I(B ?\$,1xK(B ?\$,1{ (B ?\$,1|N(B ?\$,1{!(B ?\$,1|>(B ?\$,1|?(B ?\$,1|@(B ?\$,1|D(B ?\$,1|E(B ?\$,1|F(B ?\$,1|K(B ?\$,1|L(B ?\$,1|M(B
1183 nil]))
1184 translation-table)
1185 (setq translation-table
1186 (make-translation-table-from-vector encoding-vector))
1187;; (define-translation-table 'mac-symbol-decoder translation-table)
1188 (define-translation-table 'mac-symbol-encoder
1189 (char-table-extra-slot translation-table 0)))
1190
1191(let
1192 ((encoding-vector
1193 (vconcat
1194 (make-vector 32 nil)
1195 ;; mac-dingbats (32..126) -> emacs-mule mapping
1196 [?\ ?\$,2%A(B ?\$,2%B(B ?\$,2%C(B ?\$,2%D(B ?\$,2"n(B ?\$,2%F(B ?\$,2%G(B ?\$,2%H(B ?\$,2%I(B ?\$,2"{(B ?\$,2"~(B ?\$,2%L(B ?\$,2%M(B ?\$,2%N(B ?\$,2%O(B
1197 ?\$,2%P(B ?\$,2%Q(B ?\$,2%R(B ?\$,2%S(B ?\$,2%T(B ?\$,2%U(B ?\$,2%V(B ?\$,2%W(B ?\$,2%X(B ?\$,2%Y(B ?\$,2%Z(B ?\$,2%[(B ?\$,2%\(B ?\$,2%](B ?\$,2%^(B ?\$,2%_(B
1198 ?\$,2%`(B ?\$,2%a(B ?\$,2%b(B ?\$,2%c(B ?\$,2%d(B ?\$,2%e(B ?\$,2%f(B ?\$,2%g(B ?\$,2"e(B ?\$,2%i(B ?\$,2%j(B ?\$,2%k(B ?\$,2%l(B ?\$,2%m(B ?\$,2%n(B ?\$,2%o(B
1199 ?\$,2%p(B ?\$,2%q(B ?\$,2%r(B ?\$,2%s(B ?\$,2%t(B ?\$,2%u(B ?\$,2%v(B ?\$,2%w(B ?\$,2%x(B ?\$,2%y(B ?\$,2%z(B ?\$,2%{(B ?\$,2%|(B ?\$,2%}(B ?\$,2%~(B ?\$,2%(B
1200 ?\$,2& (B ?\$,2&!(B ?\$,2&"(B ?\$,2&#(B ?\$,2&$(B ?\$,2&%(B ?\$,2&&(B ?\$,2&'(B ?\$,2&((B ?\$,2&)(B ?\$,2&*(B ?\$,2&+(B ?\$,2"/(B ?\$,2&-(B ?\$,2!`(B ?\$,2&/(B
1201 ?\$,2&0(B ?\$,2&1(B ?\$,2&2(B ?\$,2!r(B ?\$,2!|(B ?\$,2"&(B ?\$,2&6(B ?\$,2"7(B ?\$,2&8(B ?\$,2&9(B ?\$,2&:(B ?\$,2&;(B ?\$,2&<(B ?\$,2&=(B ?\$,2&>(B
1202 nil
1203 ;; mac-dingbats (128..141) -> emacs-mule mapping
1204 ?\$,2&H(B ?\$,2&I(B ?\$,2&J(B ?\$,2&K(B ?\$,2&L(B ?\$,2&M(B ?\$,2&N(B ?\$,2&O(B ?\$,2&P(B ?\$,2&Q(B ?\$,2&R(B ?\$,2&S(B ?\$,2&T(B ?\$,2&U(B]
1205 (make-vector (- 161 142) nil)
1206 ;; mac-dingbats (161..239) -> emacs-mule mapping
1207 [?\$,2&A(B ?\$,2&B(B ?\$,2&C(B ?\$,2&D(B ?\$,2&E(B ?\$,2&F(B ?\$,2&G(B ?\$,2#c(B ?\$,2#f(B ?\$,2#e(B ?\$,2#`(B ?\$,1~@(B ?\$,1~A(B ?\$,1~B(B ?\$,1~C(B
1208 ?\$,1~D(B ?\$,1~E(B ?\$,1~F(B ?\$,1~G(B ?\$,1~H(B ?\$,1~I(B ?\$,2&V(B ?\$,2&W(B ?\$,2&X(B ?\$,2&Y(B ?\$,2&Z(B ?\$,2&[(B ?\$,2&\(B ?\$,2&](B ?\$,2&^(B ?\$,2&_(B
1209 ?\$,2&`(B ?\$,2&a(B ?\$,2&b(B ?\$,2&c(B ?\$,2&d(B ?\$,2&e(B ?\$,2&f(B ?\$,2&g(B ?\$,2&h(B ?\$,2&i(B ?\$,2&j(B ?\$,2&k(B ?\$,2&l(B ?\$,2&m(B ?\$,2&n(B ?\$,2&o(B
1210 ?\$,2&p(B ?\$,2&q(B ?\$,2&r(B ?\$,2&s(B ?\$,2&t(B ?\$,1vr(B ?\$,1vt(B ?\$,1vu(B ?\$,2&x(B ?\$,2&y(B ?\$,2&z(B ?\$,2&{(B ?\$,2&|(B ?\$,2&}(B ?\$,2&~(B ?\$,2&(B
1211 ?\$,2' (B ?\$,2'!(B ?\$,2'"(B ?\$,2'#(B ?\$,2'$(B ?\$,2'%(B ?\$,2'&(B ?\$,2''(B ?\$,2'((B ?\$,2')(B ?\$,2'*(B ?\$,2'+(B ?\$,2',(B ?\$,2'-(B ?\$,2'.(B ?\$,2'/(B
1212 nil
1213 ;; mac-dingbats (241..254) -> emacs-mule mapping
1214 ?\$,2'1(B ?\$,2'2(B ?\$,2'3(B ?\$,2'4(B ?\$,2'5(B ?\$,2'6(B ?\$,2'7(B ?\$,2'8(B ?\$,2'9(B ?\$,2':(B ?\$,2';(B ?\$,2'<(B ?\$,2'=(B ?\$,2'>(B
1215 nil]))
1216 translation-table)
1217 (setq translation-table
1218 (make-translation-table-from-vector encoding-vector))
1219;; (define-translation-table 'mac-dingbats-decoder translation-table)
1220 (define-translation-table 'mac-dingbats-encoder
1221 (char-table-extra-slot translation-table 0)))
1222
1223(defconst mac-system-coding-system
1224 (let ((base (or (cdr (assq mac-system-script-code
1225 mac-script-code-coding-systems))
1226 'mac-roman)))
1227 (if (eq system-type 'darwin)
1228 base
1229 (coding-system-change-eol-conversion base 'mac)))
1230 "Coding system derived from the system script code.")
1231
1232(set-selection-coding-system mac-system-coding-system)
1233
1131 1234
1132;;;; Keyboard layout/language change events 1235;;;; Keyboard layout/language change events
1133(defun mac-handle-language-change (event) 1236(defun mac-handle-language-change (event)
@@ -1141,6 +1244,91 @@ correspoinding TextEncodingBase value."
1141 (define-key key-translation-map [?\x80] "\\")))) 1244 (define-key key-translation-map [?\x80] "\\"))))
1142 1245
1143(define-key special-event-map [language-change] 'mac-handle-language-change) 1246(define-key special-event-map [language-change] 'mac-handle-language-change)
1247
1248
1249;;;; Conversion between common flavors and Lisp string.
1250
1251(defconst mac-text-encoding-mac-japanese-basic-variant #x20001
1252 "MacJapanese text encoding without Apple double-byte extensions.")
1253
1254(defun mac-utxt-to-string (data &optional coding-system)
1255 (or coding-system (setq coding-system mac-system-coding-system))
1256 (let* ((encoding
1257 (and (eq system-type 'darwin)
1258 (eq (coding-system-base coding-system) 'japanese-shift-jis)
1259 mac-text-encoding-mac-japanese-basic-variant))
1260 (str (and (fboundp 'mac-code-convert-string)
1261 (mac-code-convert-string data nil
1262 (or encoding coding-system)))))
1263 (when str
1264 (setq str (decode-coding-string str coding-system))
1265 (if (eq encoding mac-text-encoding-mac-japanese-basic-variant)
1266 ;; Does it contain Apple one-byte extensions other than
1267 ;; reverse solidus?
1268 (if (string-match "[\xa0\xfd-\xff]" str)
1269 (setq str nil)
1270 ;; ASCII-only?
1271 (unless (string-match "\\`[[:ascii:]]*\\'" str)
1272 (subst-char-in-string ?\x5c ?\(J\(B str t)
1273 (subst-char-in-string ?\x80 ?\\ str t)))))
1274 (or str
1275 (decode-coding-string data
1276 (if (eq (byteorder) ?B) 'utf-16be 'utf-16le)))))
1277
1278(defun mac-string-to-utxt (string &optional coding-system)
1279 (or coding-system (setq coding-system mac-system-coding-system))
1280 (let (data encoding)
1281 (when (and (fboundp 'mac-code-convert-string)
1282 (memq (coding-system-base coding-system)
1283 (find-coding-systems-string string)))
1284 (setq coding-system
1285 (coding-system-change-eol-conversion coding-system 'mac))
1286 (when (and (eq system-type 'darwin)
1287 (eq coding-system 'japanese-shift-jis-mac))
1288 (setq encoding mac-text-encoding-mac-japanese-basic-variant)
1289 (setq string (subst-char-in-string ?\\ ?\x80 string))
1290 (subst-char-in-string ?\(J\(B ?\x5c string t))
1291 (setq data (mac-code-convert-string
1292 (encode-coding-string string coding-system)
1293 (or encoding coding-system) nil)))
1294 (or data (encode-coding-string string (if (eq (byteorder) ?B)
1295 'utf-16be-mac
1296 'utf-16le-mac)))))
1297
1298(defun mac-TEXT-to-string (data &optional coding-system)
1299 (or coding-system (setq coding-system mac-system-coding-system))
1300 (prog1 (setq data (decode-coding-string data coding-system))
1301 (when (eq (coding-system-base coding-system) 'japanese-shift-jis)
1302 ;; (subst-char-in-string ?\x5c ?\(J\(B data t)
1303 (subst-char-in-string ?\x80 ?\\ data t))))
1304
1305(defun mac-string-to-TEXT (string &optional coding-system)
1306 (or coding-system (setq coding-system mac-system-coding-system))
1307 (let ((encodables (find-coding-systems-string string))
1308 (rest mac-script-code-coding-systems))
1309 (unless (memq (coding-system-base coding-system) encodables)
1310 (while (and rest (not (memq (cdar rest) encodables)))
1311 (setq rest (cdr rest)))
1312 (if rest
1313 (setq coding-system (cdar rest)))))
1314 (setq coding-system
1315 (coding-system-change-eol-conversion coding-system 'mac))
1316 (when (eq coding-system 'japanese-shift-jis-mac)
1317 ;; (setq string (subst-char-in-string ?\\ ?\x80 string))
1318 (setq string (subst-char-in-string ?\(J\(B ?\x5c string)))
1319 (encode-coding-string string coding-system))
1320
1321(defun mac-furl-to-string (data)
1322 ;; Remove a trailing nul character.
1323 (let ((len (length data)))
1324 (if (and (> len 0) (= (aref data (1- len)) ?\0))
1325 (substring data 0 (1- len))
1326 data)))
1327
1328(defun mac-TIFF-to-string (data &optional text)
1329 (prog1 (or text (setq text (copy-sequence " ")))
1330 (put-text-property 0 (length text) 'display (create-image data 'tiff t)
1331 text)))
1144 1332
1145;;;; Selections 1333;;;; Selections
1146 1334
@@ -1190,22 +1378,11 @@ in `selection-converter-alist', which see."
1190 (when (and (stringp data) 1378 (when (and (stringp data)
1191 (setq data-type (get-text-property 0 'foreign-selection data))) 1379 (setq data-type (get-text-property 0 'foreign-selection data)))
1192 (cond ((eq data-type 'public.utf16-plain-text) 1380 (cond ((eq data-type 'public.utf16-plain-text)
1193 (let ((encoded (and (fboundp 'mac-code-convert-string) 1381 (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) 1382 ((eq data-type 'com.apple.traditional-mac-plain-text)
1202 (setq data (decode-coding-string data coding))) 1383 (setq data (mac-TEXT-to-string data coding)))
1203 ((eq data-type 'public.file-url) 1384 ((eq data-type 'public.file-url)
1204 (setq data (decode-coding-string data 'utf-8)) 1385 (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)) 1386 (put-text-property 0 (length data) 'foreign-selection data-type data))
1210 data)) 1387 data))
1211 1388
@@ -1227,9 +1404,7 @@ in `selection-converter-alist', which see."
1227 (when tiff-image 1404 (when tiff-image
1228 (remove-text-properties 0 (length tiff-image) 1405 (remove-text-properties 0 (length tiff-image)
1229 '(foreign-selection nil) tiff-image) 1406 '(foreign-selection nil) tiff-image)
1230 (setq tiff-image (create-image tiff-image 'tiff t)) 1407 (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)) 1408 text))
1234 1409
1235;;; Return the value of the current selection. 1410;;; Return the value of the current selection.
@@ -1300,11 +1475,7 @@ in `selection-converter-alist', which see."
1300 1475
1301(defun mac-select-convert-to-string (selection type value) 1476(defun mac-select-convert-to-string (selection type value)
1302 (let ((str (cdr (xselect-convert-to-string selection nil value))) 1477 (let ((str (cdr (xselect-convert-to-string selection nil value)))
1303 coding) 1478 (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 1479 (when str
1309 ;; If TYPE is nil, this is a local request, thus return STR as 1480 ;; If TYPE is nil, this is a local request, thus return STR as
1310 ;; is. Otherwise, encode STR. 1481 ;; is. Otherwise, encode STR.
@@ -1314,28 +1485,9 @@ in `selection-converter-alist', which see."
1314 (remove-text-properties 0 (length str) '(composition nil) str) 1485 (remove-text-properties 0 (length str) '(composition nil) str)
1315 (cond 1486 (cond
1316 ((eq type 'public.utf16-plain-text) 1487 ((eq type 'public.utf16-plain-text)
1317 (let (s) 1488 (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) 1489 ((eq type 'com.apple.traditional-mac-plain-text)
1330 (let ((encodables (find-coding-systems-string str)) 1490 (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 1491 (t
1340 (error "Unknown selection type: %S" type)) 1492 (error "Unknown selection type: %S" type))
1341 ))) 1493 )))
@@ -1433,6 +1585,17 @@ in `selection-converter-alist', which see."
1433 (ash (lsh result extended-sign-len) (- extended-sign-len)) 1585 (ash (lsh result extended-sign-len) (- extended-sign-len))
1434 result))) 1586 result)))
1435 1587
1588(defun mac-bytes-to-digits (bytes &optional from to)
1589 (or from (setq from 0))
1590 (or to (setq to (length bytes)))
1591 (let ((len (- to from))
1592 (val 0.0))
1593 (dotimes (i len)
1594 (setq val (+ (* val 256.0)
1595 (aref bytes (+ from (if (eq (byteorder) ?B) i
1596 (- len i 1)))))))
1597 (format "%.0f" val)))
1598
1436(defun mac-ae-selection-range (ae) 1599(defun mac-ae-selection-range (ae)
1437;; #pragma options align=mac68k 1600;; #pragma options align=mac68k
1438;; typedef struct SelectionRange { 1601;; typedef struct SelectionRange {
@@ -1518,6 +1681,78 @@ Currently the `mailto' scheme is supported."
1518 1681
1519(define-key mac-apple-event-map [hicommand about] 'display-splash-screen) 1682(define-key mac-apple-event-map [hicommand about] 'display-splash-screen)
1520 1683
1684;;; Converted Carbon Events
1685(defun mac-handle-toolbar-switch-mode (event)
1686 "Toggle visibility of tool-bars in response to EVENT.
1687With no keyboard modifiers, it toggles the visibility of the
1688frame where the tool-bar toggle button was pressed. With some
1689modifiers, it changes global tool-bar visibility setting."
1690 (interactive "e")
1691 (let* ((ae (mac-event-ae event))
1692 (modifiers (cdr (mac-ae-parameter ae "kmod"))))
1693 (if (and modifiers (not (string= modifiers "\000\000\000\000")))
1694 ;; Globally toggle tool-bar-mode if some modifier key is pressed.
1695 (tool-bar-mode)
1696 (let ((window-id (mac-bytes-to-digits (cdr (mac-ae-parameter ae))))
1697 (rest (frame-list))
1698 frame)
1699 (while (and (null frame) rest)
1700 (if (string= (frame-parameter (car rest) 'window-id) window-id)
1701 (setq frame (car rest)))
1702 (setq rest (cdr rest)))
1703 (set-frame-parameter frame 'tool-bar-lines
1704 (if (= (frame-parameter frame 'tool-bar-lines) 0)
1705 1 0))))))
1706
1707;; kEventClassWindow/kEventWindowToolbarSwitchMode
1708(define-key mac-apple-event-map [window toolbar-switch-mode]
1709 'mac-handle-toolbar-switch-mode)
1710
1711;;; Font panel
1712(when (fboundp 'mac-set-font-panel-visibility)
1713
1714(define-minor-mode mac-font-panel-mode
1715 "Toggle use of the font panel.
1716With numeric ARG, display the panel bar if and only if ARG is positive."
1717 :init-value nil
1718 :global t
1719 :group 'mac
1720 (mac-set-font-panel-visibility mac-font-panel-mode))
1721
1722(defun mac-handle-font-panel-closed (event)
1723 "Update internal status in response to font panel closed EVENT."
1724 (interactive "e")
1725 ;; Synchronize with the minor mode variable.
1726 (mac-font-panel-mode 0))
1727
1728(defun mac-handle-font-selection (event)
1729 "Change default face attributes according to font selection EVENT."
1730 (interactive "e")
1731 (let* ((ae (mac-event-ae event))
1732 (fm-font-size (cdr (mac-ae-parameter ae "fmsz")))
1733 (atsu-font-id (cdr (mac-ae-parameter ae "auid")))
1734 (attribute-values (gethash atsu-font-id mac-atsu-font-table)))
1735 (if fm-font-size
1736 (setq attribute-values
1737 `(:height ,(* 10 (mac-bytes-to-integer fm-font-size))
1738 ,@attribute-values)))
1739 (apply 'set-face-attribute 'default (selected-frame) attribute-values)))
1740
1741;; kEventClassFont/kEventFontPanelClosed
1742(define-key mac-apple-event-map [font panel-closed]
1743 'mac-handle-font-panel-closed)
1744;; kEventClassFont/kEventFontSelection
1745(define-key mac-apple-event-map [font selection] 'mac-handle-font-selection)
1746
1747(define-key-after menu-bar-showhide-menu [mac-font-panel-mode]
1748 (menu-bar-make-mm-toggle mac-font-panel-mode
1749 "Font Panel"
1750 "Show the font panel as a floating dialog")
1751 'showhide-speedbar)
1752
1753) ;; (fboundp 'mac-set-font-panel-visibility)
1754
1755;;; Services
1521(defun mac-services-open-file () 1756(defun mac-services-open-file ()
1522 "Open the file specified by the selection value for Services." 1757 "Open the file specified by the selection value for Services."
1523 (interactive) 1758 (interactive)
@@ -1589,6 +1824,83 @@ Currently the `mailto' scheme is supported."
1589;; processed when the initial frame has been created: this is where 1824;; processed when the initial frame has been created: this is where
1590;; the files should be opened. 1825;; the files should be opened.
1591(add-hook 'after-init-hook 'mac-process-deferred-apple-events) 1826(add-hook 'after-init-hook 'mac-process-deferred-apple-events)
1827
1828
1829;;;; Drag and drop
1830
1831(defcustom mac-dnd-types-alist
1832 '(("furl" . mac-dnd-handle-furl)
1833 ("hfs " . mac-dnd-handle-hfs)
1834 ("utxt" . mac-dnd-insert-utxt)
1835 ("TEXT" . mac-dnd-insert-TEXT)
1836 ("TIFF" . mac-dnd-insert-TIFF))
1837 "Which function to call to handle a drop of that type.
1838The function takes three arguments, WINDOW, ACTION and DATA.
1839WINDOW is where the drop occured, ACTION is always `private' on
1840Mac. DATA is the drop data. Unlike the x-dnd counterpart, the
1841return value of the function is not significant.
1842
1843See also `mac-dnd-known-types'."
1844 :version "22.1"
1845 :type 'alist
1846 :group 'mac)
1847
1848(defun mac-dnd-handle-furl (window action data)
1849 (dnd-handle-one-url window action (mac-furl-to-string data)))
1850
1851(defun mac-dnd-handle-hfs (window action data)
1852;; struct HFSFlavor {
1853;; OSType fileType;
1854;; OSType fileCreator;
1855;; UInt16 fdFlags;
1856;; FSSpec fileSpec;
1857;; };
1858 (let* ((file-name (mac-coerce-ae-data "fss " (substring data 10)
1859 'undecoded-file-name))
1860 (url (concat "file://"
1861 (mapconcat 'url-hexify-string
1862 (split-string file-name "/") "/"))))
1863 (dnd-handle-one-url window action url)))
1864
1865(defun mac-dnd-insert-utxt (window action data)
1866 (dnd-insert-text window action (mac-utxt-to-string data)))
1867
1868(defun mac-dnd-insert-TEXT (window action data)
1869 (dnd-insert-text window action (mac-TEXT-to-string data)))
1870
1871(defun mac-dnd-insert-TIFF (window action data)
1872 (dnd-insert-text window action (mac-TIFF-to-string data)))
1873
1874(defun mac-dnd-drop-data (event frame window data type)
1875 (let* ((type-info (assoc type mac-dnd-types-alist))
1876 (handler (cdr type-info))
1877 (action 'private)
1878 (w (posn-window (event-start event))))
1879 (when handler
1880 (if (and (windowp w) (window-live-p w)
1881 (not (window-minibuffer-p w))
1882 (not (window-dedicated-p w)))
1883 ;; If dropping in an ordinary window which we could use,
1884 ;; let dnd-open-file-other-window specify what to do.
1885 (progn
1886 (goto-char (posn-point (event-start event)))
1887 (funcall handler window action data))
1888 ;; If we can't display the file here,
1889 ;; make a new window for it.
1890 (let ((dnd-open-file-other-window t))
1891 (select-frame frame)
1892 (funcall handler window action data))))))
1893
1894(defun mac-dnd-handle-drag-n-drop-event (event)
1895 "Receive drag and drop events."
1896 (interactive "e")
1897 (let ((window (posn-window (event-start event))))
1898 (when (windowp window) (select-window window))
1899 (dolist (item (mac-ae-list (mac-event-ae event)))
1900 (if (not (equal (car item) "null"))
1901 (mac-dnd-drop-data event (selected-frame) window
1902 (cdr item) (car item)))))
1903 (select-frame-set-input-focus (selected-frame)))
1592 1904
1593;;; Do the actual Windows setup here; the above code just defines 1905;;; Do the actual Windows setup here; the above code just defines
1594;;; functions and variables that we use now. 1906;;; functions and variables that we use now.
@@ -1618,96 +1930,6 @@ Currently the `mailto' scheme is supported."
1618 1930
1619(setq frame-creation-function 'x-create-frame-with-faces) 1931(setq frame-creation-function 'x-create-frame-with-faces)
1620 1932
1621(cp-make-coding-system
1622 mac-centraleurroman
1623 [?\,AD(B ?\$,1 (B ?\$,1 !(B ?\,AI(B ?\$,1 $(B ?\,AV(B ?\,A\(B ?\,Aa(B ?\$,1 %(B ?\$,1 ,(B ?\,Ad(B ?\$,1 -(B ?\$,1 &(B ?\$,1 '(B ?\,Ai(B ?\$,1!9(B
1624 ?\$,1!:(B ?\$,1 .(B ?\,Am(B ?\$,1 /(B ?\$,1 2(B ?\$,1 3(B ?\$,1 6(B ?\,As(B ?\$,1 7(B ?\,At(B ?\,Av(B ?\,Au(B ?\,Az(B ?\$,1 :(B ?\$,1 ;(B ?\,A|(B
1625 ?\$,1s (B ?\,A0(B ?\$,1 8(B ?\,A#(B ?\,A'(B ?\$,1s"(B ?\,A6(B ?\,A_(B ?\,A.(B ?\,A)(B ?\$,1ub(B ?\$,1 9(B ?\,A((B ?\$,1y (B ?\$,1 C(B ?\$,1 N(B
1626 ?\$,1 O(B ?\$,1 J(B ?\$,1y$(B ?\$,1y%(B ?\$,1 K(B ?\$,1 V(B ?\$,1x"(B ?\$,1x1(B ?\$,1 b(B ?\$,1 [(B ?\$,1 \(B ?\$,1 ](B ?\$,1 ^(B ?\$,1 Y(B ?\$,1 Z(B ?\$,1 e(B
1627 ?\$,1 f(B ?\$,1 c(B ?\,A,(B ?\$,1x:(B ?\$,1 d(B ?\$,1 g(B ?\$,1x&(B ?\,A+(B ?\,A;(B ?\$,1s&(B ?\,A (B ?\$,1 h(B ?\$,1 p(B ?\,AU(B ?\$,1 q(B ?\$,1 l(B
1628 ?\$,1rs(B ?\$,1rt(B ?\$,1r|(B ?\$,1r}(B ?\$,1rx(B ?\$,1ry(B ?\,Aw(B ?\$,2"*(B ?\$,1 m(B ?\$,1 t(B ?\$,1 u(B ?\$,1 x(B ?\$,1s9(B ?\$,1s:(B ?\$,1 y(B ?\$,1 v(B
1629 ?\$,1 w(B ?\$,1! (B ?\$,1rz(B ?\$,1r~(B ?\$,1!!(B ?\$,1 z(B ?\$,1 {(B ?\,AA(B ?\$,1!$(B ?\$,1!%(B ?\,AM(B ?\$,1!=(B ?\$,1!>(B ?\$,1!*(B ?\,AS(B ?\,AT(B
1630 ?\$,1!+(B ?\$,1!.(B ?\,AZ(B ?\$,1!/(B ?\$,1!0(B ?\$,1!1(B ?\$,1!2(B ?\$,1!3(B ?\,A](B ?\,A}(B ?\$,1 W(B ?\$,1!;(B ?\$,1 a(B ?\$,1!<(B ?\$,1 B(B ?\$,1$g(B]
1631 "Mac Central European Roman Encoding (MIME:x-mac-centraleurroman).")
1632(coding-system-put 'mac-centraleurroman 'mime-charset 'x-mac-centraleurroman)
1633
1634(cp-make-coding-system
1635 mac-cyrillic
1636 [?\$,1(0(B ?\$,1(1(B ?\$,1(2(B ?\$,1(3(B ?\$,1(4(B ?\$,1(5(B ?\$,1(6(B ?\$,1(7(B ?\$,1(8(B ?\$,1(9(B ?\$,1(:(B ?\$,1(;(B ?\$,1(<(B ?\$,1(=(B ?\$,1(>(B ?\$,1(?(B
1637 ?\$,1(@(B ?\$,1(A(B ?\$,1(B(B ?\$,1(C(B ?\$,1(D(B ?\$,1(E(B ?\$,1(F(B ?\$,1(G(B ?\$,1(H(B ?\$,1(I(B ?\$,1(J(B ?\$,1(K(B ?\$,1(L(B ?\$,1(M(B ?\$,1(N(B ?\$,1(O(B
1638 ?\$,1s (B ?\,A0(B ?\$,1)P(B ?\,A#(B ?\,A'(B ?\$,1s"(B ?\,A6(B ?\$,1(&(B ?\,A.(B ?\,A)(B ?\$,1ub(B ?\$,1("(B ?\$,1(r(B ?\$,1y (B ?\$,1(#(B ?\$,1(s(B
1639 ?\$,1x>(B ?\,A1(B ?\$,1y$(B ?\$,1y%(B ?\$,1(v(B ?\,A5(B ?\$,1)Q(B ?\$,1(((B ?\$,1($(B ?\$,1(t(B ?\$,1('(B ?\$,1(w(B ?\$,1()(B ?\$,1(y(B ?\$,1(*(B ?\$,1(z(B
1640 ?\$,1(x(B ?\$,1(%(B ?\,A,(B ?\$,1x:(B ?\$,1!R(B ?\$,1xh(B ?\$,1x&(B ?\,A+(B ?\,A;(B ?\$,1s&(B ?\,A (B ?\$,1(+(B ?\$,1({(B ?\$,1(,(B ?\$,1(|(B ?\$,1(u(B
1641 ?\$,1rs(B ?\$,1rt(B ?\$,1r|(B ?\$,1r}(B ?\$,1rx(B ?\$,1ry(B ?\,Aw(B ?\$,1r~(B ?\$,1(.(B ?\$,1(~(B ?\$,1(/(B ?\$,1((B ?\$,1uV(B ?\$,1(!(B ?\$,1(q(B ?\$,1(o(B
1642 ?\$,1(P(B ?\$,1(Q(B ?\$,1(R(B ?\$,1(S(B ?\$,1(T(B ?\$,1(U(B ?\$,1(V(B ?\$,1(W(B ?\$,1(X(B ?\$,1(Y(B ?\$,1(Z(B ?\$,1([(B ?\$,1(\(B ?\$,1(](B ?\$,1(^(B ?\$,1(_(B
1643 ?\$,1(`(B ?\$,1(a(B ?\$,1(b(B ?\$,1(c(B ?\$,1(d(B ?\$,1(e(B ?\$,1(f(B ?\$,1(g(B ?\$,1(h(B ?\$,1(i(B ?\$,1(j(B ?\$,1(k(B ?\$,1(l(B ?\$,1(m(B ?\$,1(n(B ?\$,1tL(B]
1644 "Mac Cyrillic Encoding (MIME:x-mac-cyrillic).")
1645(coding-system-put 'mac-cyrillic 'mime-charset 'x-mac-cyrillic)
1646
1647(let
1648 ((encoding-vector
1649 (vconcat
1650 (make-vector 32 nil)
1651 ;; mac-symbol (32..126) -> emacs-mule mapping
1652 [?\ ?\! ?\$,1x (B ?\# ?\$,1x#(B ?\% ?\& ?\$,1x-(B ?\( ?\) ?\$,1x7(B ?\+ ?\, ?\$,1x2(B ?\. ?\/
1653 ?\0 ?\1 ?\2 ?\3 ?\4 ?\5 ?\6 ?\7 ?\8 ?\9 ?\: ?\; ?\< ?\= ?\> ?\?
1654 ?\$,1xe(B ?\$,1&q(B ?\$,1&r(B ?\$,1''(B ?\$,1&t(B ?\$,1&u(B ?\$,1'&(B ?\$,1&s(B ?\$,1&w(B ?\$,1&y(B ?\$,1'Q(B ?\$,1&z(B ?\$,1&{(B ?\$,1&|(B ?\$,1&}(B ?\$,1&(B
1655 ?\$,1' (B ?\$,1&x(B ?\$,1'!(B ?\$,1'#(B ?\$,1'$(B ?\$,1'%(B ?\$,1'B(B ?\$,1')(B ?\$,1&~(B ?\$,1'((B ?\$,1&v(B ?\[ ?\$,1xT(B ?\] ?\$,1ye(B ?\_
1656 ?\$,3bE(B ?\$,1'1(B ?\$,1'2(B ?\$,1'G(B ?\$,1'4(B ?\$,1'5(B ?\$,1'F(B ?\$,1'3(B ?\$,1'7(B ?\$,1'9(B ?\$,1'U(B ?\$,1':(B ?\$,1';(B ?\$,1'<(B ?\$,1'=(B ?\$,1'?(B
1657 ?\$,1'@(B ?\$,1'8(B ?\$,1'A(B ?\$,1'C(B ?\$,1'D(B ?\$,1'E(B ?\$,1'V(B ?\$,1'I(B ?\$,1'>(B ?\$,1'H(B ?\$,1'6(B ?\{ ?\| ?\} ?\$,1x\(B]
1658 (make-vector (- 160 127) nil)
1659 ;; mac-symbol (160..254) -> emacs-mule mapping
1660 ;; Mapping of the following characters are changed from the
1661 ;; original one:
1662 ;; 0xE2 0x00AE+0xF87F -> 0x00AE # REGISTERED SIGN, alternate: sans serif
1663 ;; 0xE3 0x00A9+0xF87F -> 0x00A9 # COPYRIGHT SIGN, alternate: sans serif
1664 ;; 0xE4 0x2122+0xF87F -> 0x2122 # TRADE MARK SIGN, alternate: sans serif
1665 [?\$,1tL(B ?\$,1'R(B ?\$,1s2(B ?\$,1y$(B ?\$,1sD(B ?\$,1x>(B ?\$,1!R(B ?\$,2#c(B ?\$,2#f(B ?\$,2#e(B ?\$,2#`(B ?\$,1vt(B ?\$,1vp(B ?\$,1vq(B ?\$,1vr(B ?\$,1vs(B
1666 ?\,A0(B ?\,A1(B ?\$,1s3(B ?\$,1y%(B ?\,AW(B ?\$,1x=(B ?\$,1x"(B ?\$,1s"(B ?\,Aw(B ?\$,1y (B ?\$,1y!(B ?\$,1xh(B ?\$,1s&(B ?\$,1|p(B ?\$,1|O(B ?\$,1w5(B
1667 ?\$,1uu(B ?\$,1uQ(B ?\$,1u\(B ?\$,1uX(B ?\$,1yW(B ?\$,1yU(B ?\$,1x%(B ?\$,1xI(B ?\$,1xJ(B ?\$,1yC(B ?\$,1yG(B ?\$,1yD(B ?\$,1yB(B ?\$,1yF(B ?\$,1x((B ?\$,1x)(B
1668 ?\$,1x@(B ?\$,1x'(B ?\,A.(B ?\,A)(B ?\$,1ub(B ?\$,1x/(B ?\$,1x:(B ?\$,1z%(B ?\,A,(B ?\$,1xG(B ?\$,1xH(B ?\$,1wT(B ?\$,1wP(B ?\$,1wQ(B ?\$,1wR(B ?\$,1wS(B
1669 ?\$,2"*(B ?\$,2=H(B ?\,A.(B ?\,A)(B ?\$,1ub(B ?\$,1x1(B ?\$,1|;(B ?\$,1|<(B ?\$,1|=(B ?\$,1|A(B ?\$,1|B(B ?\$,1|C(B ?\$,1|G(B ?\$,1|H(B ?\$,1|I(B ?\$,1|J(B
1670 ?\$,3b_(B ?\$,2=I(B ?\$,1xK(B ?\$,1{ (B ?\$,1|N(B ?\$,1{!(B ?\$,1|>(B ?\$,1|?(B ?\$,1|@(B ?\$,1|D(B ?\$,1|E(B ?\$,1|F(B ?\$,1|K(B ?\$,1|L(B ?\$,1|M(B
1671 nil]))
1672 translation-table)
1673 (setq translation-table
1674 (make-translation-table-from-vector encoding-vector))
1675;; (define-translation-table 'mac-symbol-decoder translation-table)
1676 (define-translation-table 'mac-symbol-encoder
1677 (char-table-extra-slot translation-table 0)))
1678
1679(let
1680 ((encoding-vector
1681 (vconcat
1682 (make-vector 32 nil)
1683 ;; mac-dingbats (32..126) -> emacs-mule mapping
1684 [?\ ?\$,2%A(B ?\$,2%B(B ?\$,2%C(B ?\$,2%D(B ?\$,2"n(B ?\$,2%F(B ?\$,2%G(B ?\$,2%H(B ?\$,2%I(B ?\$,2"{(B ?\$,2"~(B ?\$,2%L(B ?\$,2%M(B ?\$,2%N(B ?\$,2%O(B
1685 ?\$,2%P(B ?\$,2%Q(B ?\$,2%R(B ?\$,2%S(B ?\$,2%T(B ?\$,2%U(B ?\$,2%V(B ?\$,2%W(B ?\$,2%X(B ?\$,2%Y(B ?\$,2%Z(B ?\$,2%[(B ?\$,2%\(B ?\$,2%](B ?\$,2%^(B ?\$,2%_(B
1686 ?\$,2%`(B ?\$,2%a(B ?\$,2%b(B ?\$,2%c(B ?\$,2%d(B ?\$,2%e(B ?\$,2%f(B ?\$,2%g(B ?\$,2"e(B ?\$,2%i(B ?\$,2%j(B ?\$,2%k(B ?\$,2%l(B ?\$,2%m(B ?\$,2%n(B ?\$,2%o(B
1687 ?\$,2%p(B ?\$,2%q(B ?\$,2%r(B ?\$,2%s(B ?\$,2%t(B ?\$,2%u(B ?\$,2%v(B ?\$,2%w(B ?\$,2%x(B ?\$,2%y(B ?\$,2%z(B ?\$,2%{(B ?\$,2%|(B ?\$,2%}(B ?\$,2%~(B ?\$,2%(B
1688 ?\$,2& (B ?\$,2&!(B ?\$,2&"(B ?\$,2&#(B ?\$,2&$(B ?\$,2&%(B ?\$,2&&(B ?\$,2&'(B ?\$,2&((B ?\$,2&)(B ?\$,2&*(B ?\$,2&+(B ?\$,2"/(B ?\$,2&-(B ?\$,2!`(B ?\$,2&/(B
1689 ?\$,2&0(B ?\$,2&1(B ?\$,2&2(B ?\$,2!r(B ?\$,2!|(B ?\$,2"&(B ?\$,2&6(B ?\$,2"7(B ?\$,2&8(B ?\$,2&9(B ?\$,2&:(B ?\$,2&;(B ?\$,2&<(B ?\$,2&=(B ?\$,2&>(B
1690 nil
1691 ;; mac-dingbats (128..141) -> emacs-mule mapping
1692 ?\$,2&H(B ?\$,2&I(B ?\$,2&J(B ?\$,2&K(B ?\$,2&L(B ?\$,2&M(B ?\$,2&N(B ?\$,2&O(B ?\$,2&P(B ?\$,2&Q(B ?\$,2&R(B ?\$,2&S(B ?\$,2&T(B ?\$,2&U(B]
1693 (make-vector (- 161 142) nil)
1694 ;; mac-dingbats (161..239) -> emacs-mule mapping
1695 [?\$,2&A(B ?\$,2&B(B ?\$,2&C(B ?\$,2&D(B ?\$,2&E(B ?\$,2&F(B ?\$,2&G(B ?\$,2#c(B ?\$,2#f(B ?\$,2#e(B ?\$,2#`(B ?\$,1~@(B ?\$,1~A(B ?\$,1~B(B ?\$,1~C(B
1696 ?\$,1~D(B ?\$,1~E(B ?\$,1~F(B ?\$,1~G(B ?\$,1~H(B ?\$,1~I(B ?\$,2&V(B ?\$,2&W(B ?\$,2&X(B ?\$,2&Y(B ?\$,2&Z(B ?\$,2&[(B ?\$,2&\(B ?\$,2&](B ?\$,2&^(B ?\$,2&_(B
1697 ?\$,2&`(B ?\$,2&a(B ?\$,2&b(B ?\$,2&c(B ?\$,2&d(B ?\$,2&e(B ?\$,2&f(B ?\$,2&g(B ?\$,2&h(B ?\$,2&i(B ?\$,2&j(B ?\$,2&k(B ?\$,2&l(B ?\$,2&m(B ?\$,2&n(B ?\$,2&o(B
1698 ?\$,2&p(B ?\$,2&q(B ?\$,2&r(B ?\$,2&s(B ?\$,2&t(B ?\$,1vr(B ?\$,1vt(B ?\$,1vu(B ?\$,2&x(B ?\$,2&y(B ?\$,2&z(B ?\$,2&{(B ?\$,2&|(B ?\$,2&}(B ?\$,2&~(B ?\$,2&(B
1699 ?\$,2' (B ?\$,2'!(B ?\$,2'"(B ?\$,2'#(B ?\$,2'$(B ?\$,2'%(B ?\$,2'&(B ?\$,2''(B ?\$,2'((B ?\$,2')(B ?\$,2'*(B ?\$,2'+(B ?\$,2',(B ?\$,2'-(B ?\$,2'.(B ?\$,2'/(B
1700 nil
1701 ;; mac-dingbats (241..254) -> emacs-mule mapping
1702 ?\$,2'1(B ?\$,2'2(B ?\$,2'3(B ?\$,2'4(B ?\$,2'5(B ?\$,2'6(B ?\$,2'7(B ?\$,2'8(B ?\$,2'9(B ?\$,2':(B ?\$,2';(B ?\$,2'<(B ?\$,2'=(B ?\$,2'>(B
1703 nil]))
1704 translation-table)
1705 (setq translation-table
1706 (make-translation-table-from-vector encoding-vector))
1707;; (define-translation-table 'mac-dingbats-decoder translation-table)
1708 (define-translation-table 'mac-dingbats-encoder
1709 (char-table-extra-slot translation-table 0)))
1710
1711(defvar mac-font-encoder-list 1933(defvar mac-font-encoder-list
1712 '(("mac-roman" mac-roman-encoder 1934 '(("mac-roman" mac-roman-encoder
1713 ccl-encode-mac-roman-font "%s") 1935 ccl-encode-mac-roman-font "%s")
@@ -2012,37 +2234,11 @@ ascii:-*-Monaco-*-*-*-*-12-*-*-*-*-*-mac-roman")
2012;; Enable CLIPBOARD copy/paste through menu bar commands. 2234;; Enable CLIPBOARD copy/paste through menu bar commands.
2013(menu-bar-enable-clipboard) 2235(menu-bar-enable-clipboard)
2014 2236
2015(defconst mac-system-coding-system 2237;; Initiate drag and drop
2016 (let ((base (or (cdr (assq mac-system-script-code
2017 mac-script-code-coding-systems))
2018 'mac-roman)))
2019 (if (eq system-type 'darwin)
2020 base
2021 (coding-system-change-eol-conversion base 'mac)))
2022 "Coding system derived from the system script code.")
2023
2024(set-selection-coding-system mac-system-coding-system)
2025 2238
2026(defun mac-drag-n-drop (event) 2239(global-set-key [drag-n-drop] 'mac-dnd-handle-drag-n-drop-event)
2027 "Edit the files listed in the drag-n-drop EVENT. 2240(global-set-key [M-drag-n-drop] 'mac-dnd-handle-drag-n-drop-event)
2028Switch to a buffer editing the last file dropped."
2029 (interactive "e")
2030 ;; Make sure the drop target has positive co-ords
2031 ;; before setting the selected frame - otherwise it
2032 ;; won't work. <skx@tardis.ed.ac.uk>
2033 (let* ((window (posn-window (event-start event)))
2034 (coords (posn-x-y (event-start event)))
2035 (x (car coords))
2036 (y (cdr coords)))
2037 (if (and (> x 0) (> y 0))
2038 (set-frame-selected-window nil window))
2039 (dolist (file-name (nth 2 event))
2040 (dnd-handle-one-url window 'private
2041 (concat "file:" file-name))))
2042 (select-frame-set-input-focus (selected-frame)))
2043 2241
2044(global-set-key [drag-n-drop] 'mac-drag-n-drop)
2045(global-set-key [M-drag-n-drop] 'mac-drag-n-drop)
2046 2242
2047;;;; Non-toolkit Scroll bars 2243;;;; Non-toolkit Scroll bars
2048 2244
@@ -2107,6 +2303,7 @@ Switch to a buffer editing the last file dropped."
2107 (scroll-up 1))) 2303 (scroll-up 1)))
2108 2304
2109) 2305)
2306
2110 2307
2111;;;; Others 2308;;;; Others
2112 2309
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index 049d65c62fa..2bf36283983 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -162,6 +162,14 @@
162 (define-key xterm-function-map "\e[4~" [select]) 162 (define-key xterm-function-map "\e[4~" [select])
163 (define-key xterm-function-map "\e[29~" [print]) 163 (define-key xterm-function-map "\e[29~" [print])
164 164
165 ;; These keys will be available xterm starting probably from
166 ;; version 214.
167 (define-key xterm-function-map "\e[27;5;8~" [(control ?\t)])
168 (define-key xterm-function-map "\e[27;5;44~" [(control ?\,)])
169 (define-key xterm-function-map "\e[27;5;46~" [(control ?\.)])
170 (define-key xterm-function-map "\e[27;5;47~" [(control ?\/)])
171 (define-key xterm-function-map "\e[27;5;92~" [(control ?\\)])
172
165 ;; Other versions of xterm might emit these. 173 ;; Other versions of xterm might emit these.
166 (define-key xterm-function-map "\e[A" [up]) 174 (define-key xterm-function-map "\e[A" [up])
167 (define-key xterm-function-map "\e[B" [down]) 175 (define-key xterm-function-map "\e[B" [down])
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index da77508dce3..fed06a572bb 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -2607,15 +2607,18 @@ By just answering RET you can find out what the current dictionary is."
2607 (mapcar 'list (ispell-valid-dictionary-list))) 2607 (mapcar 'list (ispell-valid-dictionary-list)))
2608 nil t) 2608 nil t)
2609 current-prefix-arg)) 2609 current-prefix-arg))
2610 (unless arg (ispell-buffer-local-dict)) 2610 (unless arg (ispell-buffer-local-dict 'no-reload))
2611 (if (equal dict "default") (setq dict nil)) 2611 (if (equal dict "default") (setq dict nil))
2612 ;; This relies on completing-read's bug of returning "" for no match 2612 ;; This relies on completing-read's bug of returning "" for no match
2613 (cond ((equal dict "") 2613 (cond ((equal dict "")
2614 (ispell-internal-change-dictionary)
2614 (message "Using %s dictionary" 2615 (message "Using %s dictionary"
2615 (or ispell-local-dictionary ispell-dictionary "default"))) 2616 (or ispell-local-dictionary ispell-dictionary "default")))
2616 ((equal dict (or ispell-local-dictionary 2617 ((equal dict (or ispell-local-dictionary
2617 ispell-dictionary "default")) 2618 ispell-dictionary "default"))
2618 ;; Specified dictionary is the default already. No-op 2619 ;; Specified dictionary is the default already. Could reload
2620 ;; the dictionaries if needed.
2621 (ispell-internal-change-dictionary)
2619 (and (interactive-p) 2622 (and (interactive-p)
2620 (message "No change, using %s dictionary" dict))) 2623 (message "No change, using %s dictionary" dict)))
2621 (t ; reset dictionary! 2624 (t ; reset dictionary!
@@ -2634,13 +2637,16 @@ By just answering RET you can find out what the current dictionary is."
2634 dict)))) 2637 dict))))
2635 2638
2636(defun ispell-internal-change-dictionary () 2639(defun ispell-internal-change-dictionary ()
2637 "Update the dictionary actually used by Ispell. 2640 "Update the dictionary and the personal dictionary used by Ispell.
2638This may kill the Ispell process; if so, 2641This may kill the Ispell process; if so,
2639a new one will be started when needed." 2642a new one will be started when needed."
2640 (let ((dict (or ispell-local-dictionary ispell-dictionary))) 2643 (let ((dict (or ispell-local-dictionary ispell-dictionary))
2641 (unless (equal ispell-current-dictionary dict) 2644 (pdict (or ispell-local-pdict ispell-personal-dictionary)))
2645 (unless (and (equal ispell-current-dictionary dict)
2646 (equal ispell-current-personal-dictionary pdict))
2642 (ispell-kill-ispell t) 2647 (ispell-kill-ispell t)
2643 (setq ispell-current-dictionary dict)))) 2648 (setq ispell-current-dictionary dict
2649 ispell-current-personal-dictionary pdict))))
2644 2650
2645;;; Spelling of comments are checked when ispell-check-comments is non-nil. 2651;;; Spelling of comments are checked when ispell-check-comments is non-nil.
2646 2652
@@ -3667,8 +3673,9 @@ Includes Latex/Nroff modes and extended character mode."
3667 3673
3668;;; Can kill the current ispell process 3674;;; Can kill the current ispell process
3669 3675
3670(defun ispell-buffer-local-dict () 3676(defun ispell-buffer-local-dict (&optional no-reload)
3671 "Initializes local dictionary and local personal dictionary. 3677 "Initializes local dictionary and local personal dictionary.
3678If optional NO-RELOAD is non-nil, do not make any dictionary reloading.
3672When a dictionary is defined in the buffer (see variable 3679When a dictionary is defined in the buffer (see variable
3673`ispell-dictionary-keyword'), it will override the local setting 3680`ispell-dictionary-keyword'), it will override the local setting
3674from \\[ispell-change-dictionary]. 3681from \\[ispell-change-dictionary].
@@ -3695,12 +3702,9 @@ Both should not be used to define a buffer-local dictionary."
3695 (if (re-search-forward " *\\([^ \"]+\\)" end t) 3702 (if (re-search-forward " *\\([^ \"]+\\)" end t)
3696 (setq ispell-local-pdict 3703 (setq ispell-local-pdict
3697 (match-string-no-properties 1))))))) 3704 (match-string-no-properties 1)))))))
3698 ;; Reload if new personal dictionary defined. 3705 (unless no-reload
3699 (if (not (equal ispell-current-personal-dictionary 3706 ;; Reload if new dictionary (maybe the personal one) defined.
3700 (or ispell-local-pdict ispell-personal-dictionary))) 3707 (ispell-internal-change-dictionary)))
3701 (ispell-kill-ispell t))
3702 ;; Reload if new dictionary defined.
3703 (ispell-internal-change-dictionary))
3704 3708
3705 3709
3706(defun ispell-buffer-local-words () 3710(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..f4bdfc81aff 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,43 @@
12006-05-09 Richard Stallman <rms@gnu.org>
2
3 * variables.texi (File Local Variables): Document
4 safe-local-eval-forms and safe-local-eval-function.
5
62006-05-07 Kim F. Storm <storm@cua.dk>
7
8 * minibuf.texi (Minibuffer History): Remove keep-dups arg
9 from add-to-history.
10
112006-05-07 Romain Francoise <romain@orebokech.com>
12
13 * commands.texi (Event Input Misc):
14 * compile.texi (Eval During Compile):
15 * internals.texi (Buffer Internals):
16 * minibuf.texi (Initial Input):
17 * nonascii.texi (Scanning Charsets):
18 * numbers.texi (Comparison of Numbers):
19 * windows.texi (Textual Scrolling, Vertical Scrolling):
20 Fix various typos.
21
222006-05-06 Eli Zaretskii <eliz@gnu.org>
23
24 * hooks.texi (Standard Hooks): Replace inforef to emacs-xtra by
25 conditional xref's to either emacs or emacs-xtra, depending on
26 @iftex/@ifnottex.
27
28 * minibuf.texi (Minibuffer History): Document add-to-history.
29
302006-05-05 Eli Zaretskii <eliz@gnu.org>
31
32 * internals.texi (Pure Storage): Mention the pure overflow message
33 at startup.
34
352006-05-05 Johan Bockg,Ae(Brd <bojohan@dd.chalmers.se>
36
37 * keymaps.texi (Active Keymaps): Fix pseudo-Lisp syntax.
38 (Searching Keymaps): Fix pseudo-Lisp description of keymap
39 search.
40
12006-05-01 Richard Stallman <rms@gnu.org> 412006-05-01 Richard Stallman <rms@gnu.org>
2 42
3 * intro.texi (nil and t): Clarify. 43 * 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..87008d6961b 100644
--- a/lispref/variables.texi
+++ b/lispref/variables.texi
@@ -1844,6 +1844,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}. 1844the user what to do for each file. The default value is @code{maybe}.
1845@end defopt 1845@end defopt
1846 1846
1847@defopt safe-local-eval-forms
1848This variable holds a list of expressions that are safe to
1849evaluate when found in the @samp{Eval:} ``variable'' in a file
1850local variables list.
1851@end defopt
1852
1853 If the expression is a function call and the function has a
1854@code{safe-local-eval-function} property, the property value
1855determines whether the expression is safe to evaluate. The property
1856value can be a predicate to call to test the expression, a list of
1857such predicates (it's safe if any predicate succeeds), or @code{t}
1858(always safe provided the arguments are constant).
1859
1847 Text properties are also potential loopholes, since their values 1860 Text properties are also potential loopholes, since their values
1848could include functions to call. So Emacs discards all text 1861could include functions to call. So Emacs discards all text
1849properties from string values specified for file local variables. 1862properties 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 3e220fa5f4c..30933b5f0a3 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,205 @@
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
12006-05-03 Richard Stallman <rms@gnu.org> 2032006-05-03 Richard Stallman <rms@gnu.org>
2 204
3 * files.texi (Diff Mode): Node moved here. 205 * files.texi (Diff Mode): Node moved here.
@@ -23,7 +225,7 @@
23 225
24 * killing.texi (Killing): Say "graphical displays". 226 * killing.texi (Killing): Say "graphical displays".
25 * display.texi: Say "graphical displays". 227 * display.texi: Say "graphical displays".
26 228
27 * cmdargs.texi (Misc X): Say "graphical displays". 229 * cmdargs.texi (Misc X): Say "graphical displays".
28 230
292006-05-01 Richard Stallman <rms@gnu.org> 2312006-05-01 Richard Stallman <rms@gnu.org>
@@ -61,7 +263,7 @@
61 263
62 * pgg.texi (Caching passphrase): Fix markup and typos. Simplify. 264 * pgg.texi (Caching passphrase): Fix markup and typos. Simplify.
63 265
642006-04-26 Sascha Wilde <wilde@sha-bang.de> 2662006-04-26 Sascha Wilde <wilde@sha-bang.de> (tiny change)
65 267
66 * pgg.texi (Caching passphrase): Add pgg-gpg-use-agent. 268 * pgg.texi (Caching passphrase): Add pgg-gpg-use-agent.
67 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 a674473c91e..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
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 3f6fd58b125..eaf2ab212bc 100644
--- a/man/display.texi
+++ b/man/display.texi
@@ -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 95f7d5ad9ed..7843788a99b 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.
@@ -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.
@@ -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/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 be9f4443418..ad90a2758b2 100644
--- a/man/files.texi
+++ b/man/files.texi
@@ -25,6 +25,9 @@ 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).
@@ -107,10 +110,13 @@ first slash in the double slash; the result is @samp{/x1/rms/foo}.
107@cindex home directory shorthand 110@cindex home directory shorthand
108 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,
109or @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
110login name is @code{user-id}. (On DOS and Windows systems, where a user 113login name is @code{user-id}@footnote{
111doesn'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
112value of the environment variable @code{HOME}; see @ref{General 115directory, Emacs substitutes @file{~/} with the value of the
113Variables}.) 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.}.
114 120
115@cindex environment variables in file names 121@cindex environment variables in file names
116@cindex expansion of environment variables 122@cindex expansion of environment variables
@@ -518,8 +524,14 @@ value is @code{t}, so that Emacs does write backup files.
518Control}), the variable @code{vc-make-backup-files} determines whether 524Control}), the variable @code{vc-make-backup-files} determines whether
519to 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
520are redundant when you store all the previous versions in a version 526are redundant when you store all the previous versions in a version
521control system. @xref{General VC Options,,,emacs-xtra, Specialized 527control system.
522Emacs 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
523 535
524 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,
525or 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.
@@ -973,6 +985,10 @@ modes do not check or revert remote files.
973 @xref{VC Mode Line}, for Auto Revert peculiarities in buffers that 985 @xref{VC Mode Line}, for Auto Revert peculiarities in buffers that
974visit files under version control. 986visit files under version control.
975 987
988@ifnottex
989@include arevert-xtra.texi
990@end ifnottex
991
976@node Auto Save 992@node Auto Save
977@section Auto-Saving: Protection Against Disasters 993@section Auto-Saving: Protection Against Disasters
978@cindex Auto Save mode 994@cindex Auto Save mode
@@ -1202,7 +1218,13 @@ RCS or CVS, you can switch to CSSC.
1202 1218
1203 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
1204customizable variable @code{vc-handled-backends} to @code{nil} 1220customizable variable @code{vc-handled-backends} to @code{nil}
1221@iftex
1205(@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
1206 1228
1207@menu 1229@menu
1208* Introduction to VC:: How version control works in general. 1230* Introduction to VC:: How version control works in general.
@@ -1211,6 +1233,12 @@ customizable variable @code{vc-handled-backends} to @code{nil}
1211* Old Versions:: Examining and comparing old versions. 1233* Old Versions:: Examining and comparing old versions.
1212* Secondary VC Commands:: The commands used a little less frequently. 1234* Secondary VC Commands:: The commands used a little less frequently.
1213* 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
1214@end menu 1242@end menu
1215 1243
1216@node Introduction to VC 1244@node Introduction to VC
@@ -1348,7 +1376,13 @@ permitted; check-in is still the way to record a new version.
1348 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
1349at any time, but requires merging with changes from other users at 1377at any time, but requires merging with changes from other users at
1350check-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
1351(@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
1352 1386
1353@node Types of Log File 1387@node Types of Log File
1354@subsubsection Types of Log File 1388@subsubsection Types of Log File
@@ -1380,8 +1414,14 @@ for each change just once, then put it into both logs. You can write
1380the 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
1381check 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
1382while 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
1383to copy it to @file{ChangeLog} (@pxref{Change Logs and 1417to copy it to @file{ChangeLog}
1384VC,,,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
1385 1425
1386@node VC Mode Line 1426@node VC Mode Line
1387@subsection Version Control and the Mode Line 1427@subsection Version Control and the Mode Line
@@ -1545,8 +1585,15 @@ the repository.
1545@cindex specific version control system 1585@cindex specific version control system
1546Instead 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
1547version control system. This is useful when one file is being managed 1587version control system. This is useful when one file is being managed
1548with two version control systems at the same time (@pxref{Local 1588with two version control systems at the same time
1549Version 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
1550@end itemize 1597@end itemize
1551 1598
1552@node Log Buffer 1599@node Log Buffer
@@ -1568,16 +1615,27 @@ control, you can generate the Log Edit text from the ChangeLog using
1568entries 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
1569and 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
1570if 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
1571@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
1572for the opposite way of working---generating ChangeLog entries from 1624for the opposite way of working---generating ChangeLog entries from
1573the revision control log. 1625the revision control log.
1574 1626
1575 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
1576log-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
1577you 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
1578you use VC Dired mode or PCL-CVS. @xref{VC Dired Mode,,,emacs-xtra, 1630you use VC Dired mode or PCL-CVS.
1579Specialized Emacs Features}, and @ref{Top, , About PCL-CVS, pcl-cvs, 1631@iftex
1580PCL-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}.)
1581 1639
1582 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
1583exit the buffer and commit the change. 1641exit the buffer and commit the change.
@@ -1645,7 +1703,13 @@ Both forms display the output in a special buffer in another window.
1645 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
1646specifies the current contents of the work file (which may be different 1704specifies the current contents of the work file (which may be different
1647from 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
1648(@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.
1649 1713
1650 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
1651file, this command compares the two specified versions of all registered 1715file, this command compares the two specified versions of all registered
@@ -1734,6 +1798,10 @@ use once a day.
1734* Registering:: Putting a file under version control. 1798* Registering:: Putting a file under version control.
1735* VC Status:: Viewing the VC status of files. 1799* VC Status:: Viewing the VC status of files.
1736* 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
1737@end menu 1805@end menu
1738 1806
1739@node Registering 1807@node Registering
@@ -1754,8 +1822,13 @@ to use for it. If the file's directory already contains files
1754registered in a version control system, Emacs uses that system. If 1822registered in a version control system, Emacs uses that system. If
1755there 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
1756one that appears first in @code{vc-handled-backends} 1824one that appears first in @code{vc-handled-backends}
1757(@pxref{Customizing VC,,,emacs-xtra, Specialized Emacs Features}). On 1825@iftex
1758the 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
1759the first system from @code{vc-handled-backends} that could register 1832the first system from @code{vc-handled-backends} that could register
1760the 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
1761directory 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
@@ -1815,16 +1888,27 @@ count.
1815 1888
1816@item P 1889@item P
1817Move 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
1818are in the log buffer (@pxref{VC Dired Mode,,,emacs-xtra, Specialized 1891are in the log buffer
1819Emacs Features}). Otherwise, just move to the beginning of the log. A 1892@iftex
1820numeric prefix argument is a repeat count, so @kbd{C-u 10 P} would 1893(@pxref{VC Dired Mode,,,emacs-xtra, Specialized Emacs Features}).
1821move 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.
1822 1901
1823@item N 1902@item N
1824Move 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
1825in the log buffer (@pxref{VC Dired Mode,,,emacs-xtra, Specialized 1904in the log buffer
1826Emacs Features}). It also takes a numeric prefix argument as a repeat 1905@iftex
1827count. 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.
1828 1912
1829@item f 1913@item f
1830Visit 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
@@ -1878,11 +1962,16 @@ change and then discover a trivial error in it; you can cancel the
1878erroneous check-in, fix the error, and check the file in again. 1962erroneous check-in, fix the error, and check the file in again.
1879 1963
1880 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
1881version control headers in the buffer instead (@pxref{Version 1965version control headers in the buffer instead
1882Headers,,,emacs-xtra, Specialized Emacs Features}). This is because 1966@iftex
1883the buffer no longer corresponds to any existing version. If you 1967(@pxref{Version Headers,,,emacs-xtra, Specialized Emacs Features}).
1884check it in again, the check-in process will expand the headers 1968@end iftex
1885properly 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.
1886 1975
1887 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
1888automatically. If you use that header feature, you have to unexpand it 1977automatically. If you use that header feature, you have to unexpand it
@@ -1894,6 +1983,13 @@ confirmation with @kbd{yes}. Note also that this command is disabled
1894under CVS, because canceling versions is very dangerous and discouraged 1983under CVS, because canceling versions is very dangerous and discouraged
1895with CVS. 1984with CVS.
1896 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
1897@node Branches 1993@node Branches
1898@subsection Multiple Branches of a File 1994@subsection Multiple Branches of a File
1899@cindex branch (version control) 1995@cindex branch (version control)
@@ -2072,10 +2168,15 @@ own choice of selected versions, but all share the same common RCS
2072records. 2168records.
2073 2169
2074 This technique works reliably and automatically, provided that the 2170 This technique works reliably and automatically, provided that the
2075source files contain RCS version headers (@pxref{Version 2171source files contain RCS version headers
2076Headers,,,emacs-xtra, Specialized Emacs Features}). The headers enable 2172@iftex
2077Emacs to be sure, at all times, which version number is present in the 2173(@pxref{Version Headers,,,emacs-xtra, Specialized Emacs Features}).
2078work 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.
2079 2180
2080 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
2081explicitly 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,
@@ -2083,6 +2184,10 @@ first find the file, then type @kbd{C-u C-x v v} and specify the correct
2083branch number. This ensures that Emacs knows which branch it is using 2184branch number. This ensures that Emacs knows which branch it is using
2084during this particular editing session. 2185during this particular editing session.
2085 2186
2187@ifnottex
2188@include vc2-xtra.texi
2189@end ifnottex
2190
2086@node Directories 2191@node Directories
2087@section File Directories 2192@section File Directories
2088 2193
@@ -2205,8 +2310,14 @@ typically the result of a failed merge from a version control system
2205mode provides commands to resolve conflicts by selecting specific 2310mode provides commands to resolve conflicts by selecting specific
2206changes. 2311changes.
2207 2312
2208 @inforef{Emerge,, emacs-xtra} for the Emerge facility, which 2313@iftex
2209provides 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.
2210 2321
2211@node Diff Mode 2322@node Diff Mode
2212@section Diff Mode 2323@section Diff Mode
@@ -2214,10 +2325,10 @@ provides a powerful interface for merging files.
2214@findex diff-mode 2325@findex diff-mode
2215@cindex patches, editing 2326@cindex patches, editing
2216 2327
2217 The @samp{*diff*} buffer uses Diff mode (@pxref{Diff Mode}). Diff 2328 Diff mode is used for the output of @kbd{M-x diff}; it is also
2218mode is also useful for editing patches and comparisons produced by 2329useful for editing patches and comparisons produced by the
2219the @command{diff} program. To select Diff mode manually, type 2330@command{diff} program. To select Diff mode manually, type @kbd{M-x
2220@kbd{M-x diff-mode}. 2331diff-mode}.
2221 2332
2222 One general feature of Diff mode is that manual edits to the patch 2333 One general feature of Diff mode is that manual edits to the patch
2223automatically correct line numbers, including those in the hunk 2334automatically correct line numbers, including those in the hunk
@@ -2397,7 +2508,7 @@ compiling it.
2397@findex auto-compression-mode 2508@findex auto-compression-mode
2398@vindex auto-compression-mode 2509@vindex auto-compression-mode
2399 To disable this feature, type the command @kbd{M-x 2510 To disable this feature, type the command @kbd{M-x
2400auto-compression-mode}. You can disenable it permanently by 2511auto-compression-mode}. You can disable it permanently by
2401customizing the variable @code{auto-compression-mode}. 2512customizing the variable @code{auto-compression-mode}.
2402 2513
2403@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/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 0b07e04ed68..9e5d2835e20 100644
--- a/man/misc.texi
+++ b/man/misc.texi
@@ -2383,7 +2383,7 @@ a buffer containing thumbnails, corresponding to the marked files.
2383(@code{tumme-display-thumbnail-original-image}) to display a sized 2383(@code{tumme-display-thumbnail-original-image}) to display a sized
2384version 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
2385window. 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
2386browing, type @kbd{SPC} (@code{tumme-display-next-thumbnail-original}) 2386browsing, type @kbd{SPC} (@code{tumme-display-next-thumbnail-original})
2387to advance and display the next image. Typing @kbd{DEL} 2387to advance and display the next image. Typing @kbd{DEL}
2388(@code{tumme-display-previous-thumbnail-original}) backs up to the 2388(@code{tumme-display-previous-thumbnail-original}) backs up to the
2389previous 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/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..f6ac94ed734 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-05.09}
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
@@ -1471,6 +1471,7 @@ where each line of input produces a line of output.}
1471% We don't need math for this font style. 1471% We don't need math for this font style.
1472\def\ttsl{\setfontstyle{ttsl}} 1472\def\ttsl{\setfontstyle{ttsl}}
1473 1473
1474
1474% Default leading. 1475% Default leading.
1475\newdimen\textleading \textleading = 13.2pt 1476\newdimen\textleading \textleading = 13.2pt
1476 1477
@@ -1492,11 +1493,13 @@ where each line of input produces a line of output.}
1492 }% 1493 }%
1493} 1494}
1494 1495
1496
1495% Set the font macro #1 to the font named #2, adding on the 1497% Set the font macro #1 to the font named #2, adding on the
1496% specified font prefix (normally `cm'). 1498% specified font prefix (normally `cm').
1497% #3 is the font's design size, #4 is a scale factor 1499% #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} 1500\def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}
1499 1501
1502
1500% Use cm as the default font prefix. 1503% Use cm as the default font prefix.
1501% To specify the font prefix, you must define \fontprefix 1504% To specify the font prefix, you must define \fontprefix
1502% before you read in texinfo.tex. 1505% before you read in texinfo.tex.
@@ -1520,6 +1523,10 @@ where each line of input produces a line of output.}
1520\def\scshape{csc} 1523\def\scshape{csc}
1521\def\scbshape{csc} 1524\def\scbshape{csc}
1522 1525
1526% Definitions for a main text size of 11pt. This is the default in
1527% Texinfo.
1528%
1529\def\definetextfontsizexi{
1523% Text fonts (11.2pt, magstep1). 1530% Text fonts (11.2pt, magstep1).
1524\def\textnominalsize{11pt} 1531\def\textnominalsize{11pt}
1525\edef\mainmagstep{\magstephalf} 1532\edef\mainmagstep{\magstephalf}
@@ -1633,6 +1640,165 @@ where each line of input produces a line of output.}
1633\font\reducedi=cmmi10 1640\font\reducedi=cmmi10
1634\font\reducedsy=cmsy10 1641\font\reducedsy=cmsy10
1635 1642
1643% reset the current fonts
1644\textfonts
1645\rm
1646} % end of 11pt text font size definitions
1647
1648
1649% Definitions to make the main text be 10pt Computer Modern, with
1650% section, chapter, etc., sizes following suit. This is for the GNU
1651% Press printing of the Emacs 22 manual. Maybe other manuals in the
1652% future. Used with @smallbook, which sets the leading to 12pt.
1653%
1654\def\definetextfontsizex{%
1655% Text fonts (10pt).
1656\def\textnominalsize{10pt}
1657\edef\mainmagstep{1000}
1658\setfont\textrm\rmshape{10}{\mainmagstep}
1659\setfont\texttt\ttshape{10}{\mainmagstep}
1660\setfont\textbf\bfshape{10}{\mainmagstep}
1661\setfont\textit\itshape{10}{\mainmagstep}
1662\setfont\textsl\slshape{10}{\mainmagstep}
1663\setfont\textsf\sfshape{10}{\mainmagstep}
1664\setfont\textsc\scshape{10}{\mainmagstep}
1665\setfont\textttsl\ttslshape{10}{\mainmagstep}
1666\font\texti=cmmi10 scaled \mainmagstep
1667\font\textsy=cmsy10 scaled \mainmagstep
1668
1669% A few fonts for @defun names and args.
1670\setfont\defbf\bfshape{10}{\magstephalf}
1671\setfont\deftt\ttshape{10}{\magstephalf}
1672\setfont\defttsl\ttslshape{10}{\magstephalf}
1673\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
1674
1675% Fonts for indices, footnotes, small examples (9pt).
1676\def\smallnominalsize{9pt}
1677\setfont\smallrm\rmshape{9}{1000}
1678\setfont\smalltt\ttshape{9}{1000}
1679\setfont\smallbf\bfshape{10}{900}
1680\setfont\smallit\itshape{9}{1000}
1681\setfont\smallsl\slshape{9}{1000}
1682\setfont\smallsf\sfshape{9}{1000}
1683\setfont\smallsc\scshape{10}{900}
1684\setfont\smallttsl\ttslshape{10}{900}
1685\font\smalli=cmmi9
1686\font\smallsy=cmsy9
1687
1688% Fonts for small examples (8pt).
1689\def\smallernominalsize{8pt}
1690\setfont\smallerrm\rmshape{8}{1000}
1691\setfont\smallertt\ttshape{8}{1000}
1692\setfont\smallerbf\bfshape{10}{800}
1693\setfont\smallerit\itshape{8}{1000}
1694\setfont\smallersl\slshape{8}{1000}
1695\setfont\smallersf\sfshape{8}{1000}
1696\setfont\smallersc\scshape{10}{800}
1697\setfont\smallerttsl\ttslshape{10}{800}
1698\font\smalleri=cmmi8
1699\font\smallersy=cmsy8
1700
1701% Fonts for title page (20.4pt):
1702\def\titlenominalsize{20pt}
1703\setfont\titlerm\rmbshape{12}{\magstep3}
1704\setfont\titleit\itbshape{10}{\magstep4}
1705\setfont\titlesl\slbshape{10}{\magstep4}
1706\setfont\titlett\ttbshape{12}{\magstep3}
1707\setfont\titlettsl\ttslshape{10}{\magstep4}
1708\setfont\titlesf\sfbshape{17}{\magstep1}
1709\let\titlebf=\titlerm
1710\setfont\titlesc\scbshape{10}{\magstep4}
1711\font\titlei=cmmi12 scaled \magstep3
1712\font\titlesy=cmsy10 scaled \magstep4
1713\def\authorrm{\secrm}
1714\def\authortt{\sectt}
1715
1716% Chapter fonts (14.4pt).
1717\def\chapnominalsize{14pt}
1718\setfont\chaprm\rmbshape{12}{\magstep1}
1719\setfont\chapit\itbshape{10}{\magstep2}
1720\setfont\chapsl\slbshape{10}{\magstep2}
1721\setfont\chaptt\ttbshape{12}{\magstep1}
1722\setfont\chapttsl\ttslshape{10}{\magstep2}
1723\setfont\chapsf\sfbshape{12}{\magstep1}
1724\let\chapbf\chaprm
1725\setfont\chapsc\scbshape{10}{\magstep2}
1726\font\chapi=cmmi12 scaled \magstep1
1727\font\chapsy=cmsy10 scaled \magstep2
1728
1729% Section fonts (12pt).
1730\def\secnominalsize{12pt}
1731\setfont\secrm\rmbshape{12}{1000}
1732\setfont\secit\itbshape{10}{\magstep1}
1733\setfont\secsl\slbshape{10}{\magstep1}
1734\setfont\sectt\ttbshape{12}{1000}
1735\setfont\secttsl\ttslshape{10}{\magstep1}
1736\setfont\secsf\sfbshape{12}{1000}
1737\let\secbf\secrm
1738\setfont\secsc\scbshape{10}{\magstep1}
1739\font\seci=cmmi12
1740\font\secsy=cmsy10 scaled \magstep1
1741
1742% Subsection fonts (10pt).
1743\def\ssecnominalsize{10pt}
1744\setfont\ssecrm\rmbshape{10}{1000}
1745\setfont\ssecit\itbshape{10}{1000}
1746\setfont\ssecsl\slbshape{10}{1000}
1747\setfont\ssectt\ttbshape{10}{1000}
1748\setfont\ssecttsl\ttslshape{10}{1000}
1749\setfont\ssecsf\sfbshape{10}{1000}
1750\let\ssecbf\ssecrm
1751\setfont\ssecsc\scbshape{10}{1000}
1752\font\sseci=cmmi10
1753\font\ssecsy=cmsy10
1754
1755% Reduced fonts for @acro in text (9pt).
1756\def\reducednominalsize{9pt}
1757\setfont\reducedrm\rmshape{9}{1000}
1758\setfont\reducedtt\ttshape{9}{1000}
1759\setfont\reducedbf\bfshape{10}{900}
1760\setfont\reducedit\itshape{9}{1000}
1761\setfont\reducedsl\slshape{9}{1000}
1762\setfont\reducedsf\sfshape{9}{1000}
1763\setfont\reducedsc\scshape{10}{900}
1764\setfont\reducedttsl\ttslshape{10}{900}
1765\font\reducedi=cmmi9
1766\font\reducedsy=cmsy9
1767
1768% reduce space between paragraphs
1769\divide\parskip by 2
1770
1771% reset the current fonts
1772\textfonts
1773\rm
1774} % end of 10pt text font size definitions
1775
1776
1777% We provide the user-level command
1778% @fonttextsize 10
1779% (or 11) to redefine the text font size. pt is assumed.
1780%
1781\def\xword{10}
1782\def\xiword{11}
1783%
1784\parseargdef\fonttextsize{%
1785 \def\textsizearg{#1}%
1786 \wlog{doing @fonttextsize \textsizearg}%
1787 %
1788 % Set \globaldefs so that documents can use this inside @tex, since
1789 % makeinfo 4.8 does not support it, but we need it nonetheless.
1790 %
1791 \begingroup \globaldefs=1
1792 \ifx\textsizearg\xword \definetextfontsizex
1793 \else \ifx\textsizearg\xiword \definetextfontsizexi
1794 \else
1795 \errhelp=\EMsimple
1796 \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
1797 \fi\fi
1798 \endgroup
1799}
1800
1801
1636% In order for the font changes to affect most math symbols and letters, 1802% 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 1803% we have to define the \textfont of the standard families. Since
1638% texinfo doesn't allow for producing subscripts and superscripts except 1804% texinfo doesn't allow for producing subscripts and superscripts except
@@ -1743,7 +1909,7 @@ where each line of input produces a line of output.}
1743 1909
1744% Set up the default fonts, so we can use them for creating boxes. 1910% Set up the default fonts, so we can use them for creating boxes.
1745% 1911%
1746\textfonts \rm 1912\definetextfontsizexi
1747 1913
1748% Define these so they can be easily changed for other fonts. 1914% Define these so they can be easily changed for other fonts.
1749\def\angleleft{$\langle$} 1915\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 90e99a0ea59..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}
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 ea9bf3f6092..54d68dc123d 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)
@@ -716,7 +848,7 @@ define xbacktrace
716 xgettype (*$bt->function) 848 xgettype (*$bt->function)
717 if $type == Lisp_Symbol 849 if $type == Lisp_Symbol
718 xprintsym (*$bt->function) 850 xprintsym (*$bt->function)
719 echo \n 851 printf " (0x%x)\n", *$bt->args
720 else 852 else
721 printf "0x%x ", *$bt->function 853 printf "0x%x ", *$bt->function
722 if $type == Lisp_Vectorlike 854 if $type == Lisp_Vectorlike
@@ -737,6 +869,27 @@ document xbacktrace
737 an error was signaled. 869 an error was signaled.
738end 870end
739 871
872define which
873 set debug_print (which_symbols ($arg0))
874end
875document which
876 Print symbols which references a given lisp object,
877 either as its symbol value or symbol function.
878end
879
880define xbytecode
881 set $bt = byte_stack_list
882 while $bt
883 xgettype ($bt->byte_string)
884 printf "0x%x => ", $bt->byte_string
885 which $bt->byte_string
886 set $bt = $bt->next
887 end
888end
889document xbytecode
890 Print a backtrace of the byte code stack.
891end
892
740# Show Lisp backtrace after normal backtrace. 893# Show Lisp backtrace after normal backtrace.
741define hookpost-backtrace 894define hookpost-backtrace
742 set $bt = backtrace_list 895 set $bt = backtrace_list
diff --git a/src/ChangeLog b/src/ChangeLog
index c0e8f035a17..89147db983f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,155 @@
12006-05-09 Kenichi Handa <handa@m17n.org>
2
3 * keymap.c (push_key_description): Handle invalid character key.
4
52006-05-08 Kenichi Handa <handa@m17n.org>
6
7 * callproc.c (Fcall_process): Use system_eol_type for encoding
8 arguments if eol_type is not yet decided.
9
10 * coding.h (system_eol_type): Extern it.
11
12 * coding.c (setup_coding_system): For invalid coding-system, set
13 coding->eol_type to CODING_EOL_UNDECIDED.
14 (encode_coding): Cancel previous change.
15 (shrink_encoding_region): Likewise.
16 (code_convert_region1): Likewise.
17 (code_convert_string1): Likewise.
18 (code_convert_string_norecord): Likewise.
19
20 * fileio.c (choose_write_coding_system): Use system_eol_type for
21 encoding if eol_type is not yet decided.
22
23 * process.c (setup_process_coding_systems): Use system_eol_type
24 for encoding if eol_type is not yet decided.
25 (read_process_output): Likewise.
26 (send_process): Likewise.
27
282006-05-07 Juanma Barranquero <lekktu@gmail.com>
29
30 * minibuf.c (syms_of_minibuf) <history-length>: Fix typo in doc.
31
322006-05-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
33
34 * mac.c (Fmac_clear_font_name_table): Move defun to macfns.c.
35 (syms_of_mac): Likewise for defsubr.
36
37 * macfns.c (mac_set_font): New function.
38 (mac_frame_parm_handlers, syms_of_macfns): Replace x_set_font with it.
39 (mac_window) [TARGET_API_MAC_CARBON && MAC_OSX]: Specify
40 kWindowToolbarButtonAttribute when creating window.
41 (Fmac_clear_font_name_table): Move from macfns.c.
42 (syms_of_macfns): Likewise for defsubr.
43 [USE_MAC_FONT_PANEL] (Fmac_set_font_panel_visibility): New defun.
44 (syms_of_macfns) [USE_MAC_FONT_PANEL]: Defsubr it.
45
46 * macgui.h (USE_MAC_FONT_PANEL): Define to 1 if USE_ATSUI is set
47 and build is done on Mac OS X 10.2 and later.
48
49 * macselect.c (mac_do_receive_drag): Remove unused variable `index'.
50 (mac_store_services_event): Change return type in extern.
51
52 * macterm.c (XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
53 to font->mac_fontnum.
54 [USE_MAC_FONT_PANEL] (mac_set_font_info_for_selection): New function.
55 (x_new_focus_frame) [USE_MAC_FONT_PANEL]: Use it.
56 (QCfamily, QCweight, QCslant, Qnormal, Qbold, Qitalic): Add extern.
57 (QWindow) [MAC_OSX]: Likewise.
58 (Qfont) [USE_MAC_FONT_PANEL]: Likewise.
59 (Vmac_atsu_font_table) [USE_ATSUI]: New variable.
60 (syms_of_macterm) [USE_ATSUI]: Defvar it.
61 (Qtoolbar_switch_mode) [MAC_OSX]: New variable.
62 (Qpanel_closed, Qselection) [USE_MAC_FONT_PANEL]: Likewise.
63 (syms_of_macterm): Intern and staticpro them.
64 (init_font_name_table) [USE_ATSUI]: Set data to Vmac_atsu_font_table.
65 [TARGET_API_MAC_CARBON] (mac_store_event_ref_as_apple_event): New
66 function.
67 [USE_CARBON_EVENTS] (mac_handle_command_event): Use it.
68 [MAC_OSX] (mac_store_services_event): Likewise.
69 [USE_CARBON_EVENTS] (mac_handle_window_event) [MAC_OSX]: Handle
70 kEventWindowToolbarSwitchMode event.
71 (install_window_handler) [USE_CARBON_EVENTS && MAC_OSX]: Register it.
72 [MAC_OSX] (mac_store_services_event): Change return type to OSStatus.
73 [USE_MAC_FONT_PANEL] (mac_handle_font_event): New function.
74 (install_window_handler) [USE_MAC_FONT_PANEL]: Install it.
75 (XTread_socket): Select window on mouse click if x_focus_frame is NULL.
76
77 * macterm.h (mac_set_font_info_for_selection): Add extern.
78
792006-05-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
80
81 * image.c (Qduration) [MAC_OS]: New variable.
82 (syms_of_image) [MAC_OS]: Intern and staticpro it.
83 [MAC_OS] (gif_load): Save image extension data in img->data.lisp_val.
84 [MAC_OSX] (image_load_quartz2d): Use cfstring_create_with_utf8_cstring
85 instead of cfstring_create_with_string.
86
872006-05-06 Kim F. Storm <storm@cua.dk>
88
89 * .gdbinit (xframe): Print frame name.
90 (xlist): New command to print a list (max 10 elements).
91 (xpr): Print lisp object of any type.
92 (pitx): Print it->pixel_width.
93
942006-05-05 Kenichi Handa <handa@m17n.org>
95
96 * xdisp.c (handle_composition_prop): Fix for the case of empty
97 composition component.
98
992006-05-05 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
100
101 * keyboard.c (make_lispy_event) [MAC_OS]: Get Apple event info
102 from event->arg.
103
104 * termhooks.h (enum event_kind) [MAC_OS]: Update comment for
105 MAC_APPLE_EVENT.
106
107 * macterm.h (mac_make_lispy_event_code): Remove extern.
108 (mac_post_mouse_moved_event): Add extern.
109 (mac_aelist_to_lisp, mac_aedesc_to_lisp): Change arg 1 to
110 `const AEDesc *' in externs.
111 (create_apple_event_from_drag_ref) [TARGET_API_MAC_CARBON]: New extern.
112
113 * mac.c (mac_aelist_to_lisp, mac_aedesc_to_lisp): Change arg 1 to
114 `const AEDesc *'.
115 [TARGET_API_MAC_CARBON] (create_apple_event): New function.
116 [TARGET_API_MAC_CARBON] (create_apple_event_from_event_ref): Use it.
117 Use xrealloc instead of repeated xmalloc/xfree.
118 [TARGET_API_MAC_CARBON] (create_apple_event_from_drag_ref): New
119 function.
120
121 * macmenu.c (restore_menu_items, cleanup_popup_menu): Return a value.
122
123 * macselect.c: Update copyright year.
124 (mac_store_apple_event): Change return type to void in extern.
125 (mac_handle_apple_event): Don't get return value from
126 mac_store_apple_event.
127 [TARGET_API_MAC_CARBON] (Vmac_dnd_known_types): New variable.
128 (syms_of_macselect) [TARGET_API_MAC_CARBON]: Defvar it.
129 [TARGET_API_MAC_CARBON] (mac_do_track_drag): Move function from
130 macterm.c. Use Vmac_dnd_known_types as acceptable flavors.
131 [TARGET_API_MAC_CARBON] (mac_do_receive_drag): Likewise. New
132 implementation using create_apple_event_from_drag_ref.
133 [TARGET_API_MAC_CARBON] (mac_do_track_dragUPP)
134 (mac_do_receive_dragUPP): Move variables from macterm.c.
135 (install_drag_handler, remove_drag_handler): New functions.
136
137 * macterm.c (XTread_socket) [TARGET_API_MAC_CARBON]: Try window
138 path select also for proxy icon click.
139 [TARGET_API_MAC_CARBON] (mac_post_mouse_moved_event): New function.
140 [USE_TOOLKIT_SCROLL_BARS] (scroll_bar_timer_callback): Use it.
141 (xlfdpat_create): Remove unused label `error' and trailing sentences.
142 (mac_do_track_drag, mac_do_receive_drag): Move functions to macselect.c.
143 (mac_do_track_dragUPP, mac_do_receive_dragUPP): Move variables to
144 macselect.c.
145 (install_drag_handler, remove_drag_handler): Add extern.
146 (mac_store_apple_event): Change return type to void. All uses changed.
147 Create Lisp object from Apple event and store it into input event.
148 (mac_make_lispy_event_code): Remove function.
149 [TARGET_API_MAC_CARBON] (mac_store_drag_event): New function.
150 (install_window_handler): Call install_drag_handler.
151 (remove_window_handler): Call remove_drag_handler.
152
12006-05-03 Richard Stallman <rms@gnu.org> 1532006-05-03 Richard Stallman <rms@gnu.org>
2 154
3 * sound.c (Fplay_sound_internal): Dynamically allocate 155 * sound.c (Fplay_sound_internal): Dynamically allocate
diff --git a/src/callproc.c b/src/callproc.c
index a6841317e63..25c79bf926c 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -302,6 +302,8 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
302 val = Qnil; 302 val = Qnil;
303 } 303 }
304 setup_coding_system (Fcheck_coding_system (val), &argument_coding); 304 setup_coding_system (Fcheck_coding_system (val), &argument_coding);
305 if (argument_coding.eol_type == CODING_EOL_UNDECIDED)
306 argument_coding.eol_type = system_eol_type;
305 } 307 }
306 } 308 }
307 309
diff --git a/src/coding.c b/src/coding.c
index d261418def5..a83aadfd468 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -386,7 +386,9 @@ Lisp_Object eol_mnemonic_unix, eol_mnemonic_dos, eol_mnemonic_mac;
386Lisp_Object eol_mnemonic_undecided; 386Lisp_Object eol_mnemonic_undecided;
387 387
388/* Format of end-of-line decided by system. This is CODING_EOL_LF on 388/* Format of end-of-line decided by system. This is CODING_EOL_LF on
389 Unix, CODING_EOL_CRLF on DOS/Windows, and CODING_EOL_CR on Mac. */ 389 Unix, CODING_EOL_CRLF on DOS/Windows, and CODING_EOL_CR on Mac.
390 This has an effect only for external encoding (i.e. for output to
391 file and process), not for in-buffer or Lisp string encoding. */
390int system_eol_type; 392int system_eol_type;
391 393
392#ifdef emacs 394#ifdef emacs
@@ -3920,10 +3922,7 @@ setup_coding_system (coding_system, coding)
3920 coding->type = coding_type_no_conversion; 3922 coding->type = coding_type_no_conversion;
3921 coding->category_idx = CODING_CATEGORY_IDX_BINARY; 3923 coding->category_idx = CODING_CATEGORY_IDX_BINARY;
3922 coding->common_flags = 0; 3924 coding->common_flags = 0;
3923 coding->eol_type = NILP (coding_system) ? system_eol_type : CODING_EOL_LF; 3925 coding->eol_type = CODING_EOL_UNDECIDED;
3924 if (coding->eol_type != CODING_EOL_LF)
3925 coding->common_flags
3926 |= CODING_REQUIRE_DECODING_MASK | CODING_REQUIRE_ENCODING_MASK;
3927 coding->pre_write_conversion = coding->post_read_conversion = Qnil; 3926 coding->pre_write_conversion = coding->post_read_conversion = Qnil;
3928 return NILP (coding_system) ? 0 : -1; 3927 return NILP (coding_system) ? 0 : -1;
3929} 3928}
@@ -5000,7 +4999,7 @@ encode_coding (coding, source, destination, src_bytes, dst_bytes)
5000 coding->errors = 0; 4999 coding->errors = 0;
5001 coding->result = CODING_FINISH_NORMAL; 5000 coding->result = CODING_FINISH_NORMAL;
5002 if (coding->eol_type == CODING_EOL_UNDECIDED) 5001 if (coding->eol_type == CODING_EOL_UNDECIDED)
5003 coding->eol_type = system_eol_type; 5002 coding->eol_type = CODING_EOL_LF;
5004 5003
5005 switch (coding->type) 5004 switch (coding->type)
5006 { 5005 {
@@ -5257,8 +5256,6 @@ shrink_encoding_region (beg, end, coding, str)
5257 if (coding->type == coding_type_ccl 5256 if (coding->type == coding_type_ccl
5258 || coding->eol_type == CODING_EOL_CRLF 5257 || coding->eol_type == CODING_EOL_CRLF
5259 || coding->eol_type == CODING_EOL_CR 5258 || coding->eol_type == CODING_EOL_CR
5260 || (coding->eol_type == CODING_EOL_UNDECIDED
5261 && system_eol_type != CODING_EOL_LF)
5262 || (coding->cmp_data && coding->cmp_data->used > 0)) 5259 || (coding->cmp_data && coding->cmp_data->used > 0))
5263 { 5260 {
5264 /* We can't skip any data. */ 5261 /* We can't skip any data. */
@@ -7114,7 +7111,7 @@ code_convert_region1 (start, end, coding_system, encodep)
7114 from = XFASTINT (start); 7111 from = XFASTINT (start);
7115 to = XFASTINT (end); 7112 to = XFASTINT (end);
7116 7113
7117 if (NILP (coding_system) && system_eol_type == CODING_EOL_LF) 7114 if (NILP (coding_system))
7118 return make_number (to - from); 7115 return make_number (to - from);
7119 7116
7120 if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0) 7117 if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0)
@@ -7169,7 +7166,7 @@ code_convert_string1 (string, coding_system, nocopy, encodep)
7169 CHECK_STRING (string); 7166 CHECK_STRING (string);
7170 CHECK_SYMBOL (coding_system); 7167 CHECK_SYMBOL (coding_system);
7171 7168
7172 if (NILP (coding_system) && system_eol_type == CODING_EOL_LF) 7169 if (NILP (coding_system))
7173 return (NILP (nocopy) ? Fcopy_sequence (string) : string); 7170 return (NILP (nocopy) ? Fcopy_sequence (string) : string);
7174 7171
7175 if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0) 7172 if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0)
@@ -7228,7 +7225,7 @@ code_convert_string_norecord (string, coding_system, encodep)
7228 CHECK_STRING (string); 7225 CHECK_STRING (string);
7229 CHECK_SYMBOL (coding_system); 7226 CHECK_SYMBOL (coding_system);
7230 7227
7231 if (NILP (coding_system) && system_eol_type == CODING_EOL_LF) 7228 if (NILP (coding_system))
7232 return string; 7229 return string;
7233 7230
7234 if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0) 7231 if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0)
diff --git a/src/coding.h b/src/coding.h
index 5d649fbf9ff..cac11d1514c 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -666,6 +666,9 @@ extern Lisp_Object eol_mnemonic_unix, eol_mnemonic_dos, eol_mnemonic_mac;
666/* Mnemonic string to indicate type of end-of-line is not yet decided. */ 666/* Mnemonic string to indicate type of end-of-line is not yet decided. */
667extern Lisp_Object eol_mnemonic_undecided; 667extern Lisp_Object eol_mnemonic_undecided;
668 668
669/* Format of end-of-line decided by system. */
670extern int system_eol_type;
671
669#ifdef emacs 672#ifdef emacs
670extern Lisp_Object Qfile_coding_system; 673extern Lisp_Object Qfile_coding_system;
671extern Lisp_Object Qcall_process, Qcall_process_region; 674extern Lisp_Object Qcall_process, Qcall_process_region;
diff --git a/src/fileio.c b/src/fileio.c
index 2248963102a..7bfcc98541b 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -4940,6 +4940,8 @@ choose_write_coding_system (start, end, filename,
4940 setup_coding_system (Fcheck_coding_system (val), coding); 4940 setup_coding_system (Fcheck_coding_system (val), coding);
4941 4941
4942 done_setup_coding: 4942 done_setup_coding:
4943 if (coding->eol_type == CODING_EOL_UNDECIDED)
4944 coding->eol_type = system_eol_type;
4943 if (!STRINGP (start) && !NILP (current_buffer->selective_display)) 4945 if (!STRINGP (start) && !NILP (current_buffer->selective_display))
4944 coding->mode |= CODING_MODE_SELECTIVE_DISPLAY; 4946 coding->mode |= CODING_MODE_SELECTIVE_DISPLAY;
4945} 4947}
diff --git a/src/image.c b/src/image.c
index eae25fdb02e..98e44be9d44 100644
--- a/src/image.c
+++ b/src/image.c
@@ -2630,7 +2630,7 @@ image_load_quartz2d (f, img, png_p)
2630 UNGCPRO; 2630 UNGCPRO;
2631 return 0; 2631 return 0;
2632 } 2632 }
2633 path = cfstring_create_with_string (file); 2633 path = cfstring_create_with_utf8_cstring (SDATA (file));
2634 url = CFURLCreateWithFileSystemPath (NULL, path, 2634 url = CFURLCreateWithFileSystemPath (NULL, path,
2635 kCFURLPOSIXPathStyle, 0); 2635 kCFURLPOSIXPathStyle, 0);
2636 CFRelease (path); 2636 CFRelease (path);
@@ -7901,6 +7901,8 @@ gif_load (f, img)
7901#else /* !HAVE_GIF */ 7901#else /* !HAVE_GIF */
7902 7902
7903#ifdef MAC_OS 7903#ifdef MAC_OS
7904static Lisp_Object Qduration;
7905
7904static int 7906static int
7905gif_load (f, img) 7907gif_load (f, img)
7906 struct frame *f; 7908 struct frame *f;
@@ -7922,7 +7924,8 @@ gif_load (f, img)
7922 RGBColor bg_color; 7924 RGBColor bg_color;
7923 int width, height; 7925 int width, height;
7924 XImagePtr ximg; 7926 XImagePtr ximg;
7925 TimeValue time; 7927 TimeScale time_scale;
7928 TimeValue time, duration;
7926 int ino; 7929 int ino;
7927 CGrafPtr old_port; 7930 CGrafPtr old_port;
7928 GDHandle old_gdh; 7931 GDHandle old_gdh;
@@ -8030,6 +8033,7 @@ gif_load (f, img)
8030 image, img->spec); 8033 image, img->spec);
8031 goto error; 8034 goto error;
8032 } 8035 }
8036 time_scale = GetMediaTimeScale (media);
8033 8037
8034 specified_bg = image_spec_value (img->spec, QCbackground, NULL); 8038 specified_bg = image_spec_value (img->spec, QCbackground, NULL);
8035 if (!STRINGP (specified_bg) || 8039 if (!STRINGP (specified_bg) ||
@@ -8055,7 +8059,7 @@ gif_load (f, img)
8055 SetGWorld (old_port, old_gdh); 8059 SetGWorld (old_port, old_gdh);
8056 SetMovieActive (movie, 1); 8060 SetMovieActive (movie, 1);
8057 SetMovieGWorld (movie, ximg, NULL); 8061 SetMovieGWorld (movie, ximg, NULL);
8058 SampleNumToMediaTime (media, ino + 1, &time, NULL); 8062 SampleNumToMediaTime (media, ino + 1, &time, &duration);
8059 SetMovieTimeValue (movie, time); 8063 SetMovieTimeValue (movie, time);
8060 MoviesTask (movie, 0L); 8064 MoviesTask (movie, 0L);
8061 DisposeTrackMedia (media); 8065 DisposeTrackMedia (media);
@@ -8063,6 +8067,12 @@ gif_load (f, img)
8063 DisposeMovie (movie); 8067 DisposeMovie (movie);
8064 if (dh) 8068 if (dh)
8065 DisposeHandle (dh); 8069 DisposeHandle (dh);
8070
8071 /* Save GIF image extension data for `image-extension-data'.
8072 Format is (count IMAGES duration DURATION). */
8073 img->data.lisp_val = list4 (Qcount, make_number (nsamples), Qduration,
8074 make_float ((double)duration / time_scale));
8075
8066 /* Maybe fill in the background field while we have ximg handy. */ 8076 /* Maybe fill in the background field while we have ximg handy. */
8067 if (NILP (image_spec_value (img->spec, QCbackground, NULL))) 8077 if (NILP (image_spec_value (img->spec, QCbackground, NULL)))
8068 IMAGE_BACKGROUND (img, f, ximg); 8078 IMAGE_BACKGROUND (img, f, ximg);
@@ -8618,6 +8628,11 @@ non-numeric, there is no explicit limit on the size of images. */);
8618 ADD_IMAGE_TYPE(Qgif); 8628 ADD_IMAGE_TYPE(Qgif);
8619#endif 8629#endif
8620 8630
8631#ifdef MAC_OS
8632 Qduration = intern ("duration");
8633 staticpro (&Qduration);
8634#endif
8635
8621#if defined (HAVE_PNG) || defined (MAC_OS) 8636#if defined (HAVE_PNG) || defined (MAC_OS)
8622 Qpng = intern ("png"); 8637 Qpng = intern ("png");
8623 staticpro (&Qpng); 8638 staticpro (&Qpng);
diff --git a/src/keyboard.c b/src/keyboard.c
index 1ad852c819a..5dcd2f8f5ae 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -5992,8 +5992,7 @@ make_lispy_event (event)
5992 spec[1] = event->y; 5992 spec[1] = event->y;
5993 return Fcons (Qmac_apple_event, 5993 return Fcons (Qmac_apple_event,
5994 Fcons (Fvector (2, spec), 5994 Fcons (Fvector (2, spec),
5995 Fcons (mac_make_lispy_event_code (event->code), 5995 Fcons (event->arg, Qnil)));
5996 Qnil)));
5997 } 5996 }
5998#endif 5997#endif
5999 5998
diff --git a/src/keymap.c b/src/keymap.c
index c609ed6c4e4..31b9378d3ad 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -2083,12 +2083,21 @@ push_key_description (c, p, force_multibyte)
2083 int force_multibyte; 2083 int force_multibyte;
2084{ 2084{
2085 unsigned c2; 2085 unsigned c2;
2086 int valid_p;
2086 2087
2087 /* Clear all the meaningless bits above the meta bit. */ 2088 /* Clear all the meaningless bits above the meta bit. */
2088 c &= meta_modifier | ~ - meta_modifier; 2089 c &= meta_modifier | ~ - meta_modifier;
2089 c2 = c & ~(alt_modifier | ctrl_modifier | hyper_modifier 2090 c2 = c & ~(alt_modifier | ctrl_modifier | hyper_modifier
2090 | meta_modifier | shift_modifier | super_modifier); 2091 | meta_modifier | shift_modifier | super_modifier);
2091 2092
2093 valid_p = SINGLE_BYTE_CHAR_P (c2) || char_valid_p (c2, 0);
2094 if (! valid_p)
2095 {
2096 /* KEY_DESCRIPTION_SIZE is large enough for this. */
2097 p += sprintf (p, "[%d]", c);
2098 return p;
2099 }
2100
2092 if (c & alt_modifier) 2101 if (c & alt_modifier)
2093 { 2102 {
2094 *p++ = 'A'; 2103 *p++ = 'A';
@@ -2176,16 +2185,13 @@ push_key_description (c, p, force_multibyte)
2176 } 2185 }
2177 else 2186 else
2178 { 2187 {
2179 int valid_p = SINGLE_BYTE_CHAR_P (c) || char_valid_p (c, 0); 2188 if (force_multibyte)
2180
2181 if (force_multibyte && valid_p)
2182 { 2189 {
2183 if (SINGLE_BYTE_CHAR_P (c)) 2190 if (SINGLE_BYTE_CHAR_P (c))
2184 c = unibyte_char_to_multibyte (c); 2191 c = unibyte_char_to_multibyte (c);
2185 p += CHAR_STRING (c, p); 2192 p += CHAR_STRING (c, p);
2186 } 2193 }
2187 else if (NILP (current_buffer->enable_multibyte_characters) 2194 else if (NILP (current_buffer->enable_multibyte_characters))
2188 || valid_p)
2189 { 2195 {
2190 int bit_offset; 2196 int bit_offset;
2191 *p++ = '\\'; 2197 *p++ = '\\';
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 2a83fef0870..bb2b8b540ff 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -2013,6 +2013,22 @@ mac_update_title_bar (f, save_match_data)
2013#endif 2013#endif
2014} 2014}
2015 2015
2016static void
2017mac_set_font (f, arg, oldval)
2018 struct frame *f;
2019 Lisp_Object arg, oldval;
2020{
2021 x_set_font (f, arg, oldval);
2022#if USE_MAC_FONT_PANEL
2023 if (FRAME_MAC_DISPLAY_INFO (f)->x_focus_frame == f)
2024 {
2025 BLOCK_INPUT;
2026 mac_set_font_info_for_selection (f);
2027 UNBLOCK_INPUT;
2028 }
2029#endif
2030}
2031
2016 2032
2017/* Subroutines of creating a frame. */ 2033/* Subroutines of creating a frame. */
2018 2034
@@ -2213,8 +2229,10 @@ mac_window (f)
2213#if TARGET_API_MAC_CARBON 2229#if TARGET_API_MAC_CARBON
2214 CreateNewWindow (kDocumentWindowClass, 2230 CreateNewWindow (kDocumentWindowClass,
2215 kWindowStandardDocumentAttributes 2231 kWindowStandardDocumentAttributes
2216 /* | kWindowToolbarButtonAttribute */, 2232#ifdef MAC_OSX
2217 &r, &FRAME_MAC_WINDOW (f)); 2233 | kWindowToolbarButtonAttribute
2234#endif
2235 , &r, &FRAME_MAC_WINDOW (f));
2218 if (FRAME_MAC_WINDOW (f)) 2236 if (FRAME_MAC_WINDOW (f))
2219 { 2237 {
2220 SetWRefCon (FRAME_MAC_WINDOW (f), (long) f->output_data.mac); 2238 SetWRefCon (FRAME_MAC_WINDOW (f), (long) f->output_data.mac);
@@ -4469,6 +4487,43 @@ mac_nav_event_callback (selector, parms, data)
4469#endif 4487#endif
4470 4488
4471/*********************************************************************** 4489/***********************************************************************
4490 Fonts
4491 ***********************************************************************/
4492
4493DEFUN ("mac-clear-font-name-table", Fmac_clear_font_name_table,
4494 Smac_clear_font_name_table, 0, 0, 0,
4495 doc: /* Clear the font name table. */)
4496 ()
4497{
4498 check_mac ();
4499 mac_clear_font_name_table ();
4500 return Qnil;
4501}
4502
4503#if USE_MAC_FONT_PANEL
4504DEFUN ("mac-set-font-panel-visibility", Fmac_set_font_panel_visibility,
4505 Smac_set_font_panel_visibility, 1, 1, 0,
4506 doc: /* Set the font panel visibile if and only if VISIBLE is non-nil.
4507This is for internal use only. Use `mac-font-panel-mode' instead. */)
4508 (visible)
4509 Lisp_Object visible;
4510{
4511 OSStatus err = noErr;
4512
4513 check_mac ();
4514
4515 BLOCK_INPUT;
4516 if (NILP (visible) == (FPIsFontPanelVisible () == true))
4517 err = FPShowHideFontPanel ();
4518 UNBLOCK_INPUT;
4519
4520 if (err != noErr)
4521 error ("Cannot change visibility of the font panel");
4522 return Qnil;
4523}
4524#endif
4525
4526/***********************************************************************
4472 Initialization 4527 Initialization
4473 ***********************************************************************/ 4528 ***********************************************************************/
4474 4529
@@ -4484,7 +4539,7 @@ frame_parm_handler mac_frame_parm_handlers[] =
4484 x_set_border_width, 4539 x_set_border_width,
4485 x_set_cursor_color, 4540 x_set_cursor_color,
4486 x_set_cursor_type, 4541 x_set_cursor_type,
4487 x_set_font, 4542 mac_set_font,
4488 x_set_foreground_color, 4543 x_set_foreground_color,
4489 x_set_icon_name, 4544 x_set_icon_name,
4490 0, /* MAC_TODO: x_set_icon_type, */ 4545 0, /* MAC_TODO: x_set_icon_type, */
@@ -4660,7 +4715,7 @@ Chinese, Japanese, and Korean. */);
4660 load_font_func = x_load_font; 4715 load_font_func = x_load_font;
4661 find_ccl_program_func = x_find_ccl_program; 4716 find_ccl_program_func = x_find_ccl_program;
4662 query_font_func = x_query_font; 4717 query_font_func = x_query_font;
4663 set_frame_fontset_func = x_set_font; 4718 set_frame_fontset_func = mac_set_font;
4664 check_window_system_func = check_mac; 4719 check_window_system_func = check_mac;
4665 4720
4666 hourglass_atimer = NULL; 4721 hourglass_atimer = NULL;
@@ -4679,6 +4734,10 @@ Chinese, Japanese, and Korean. */);
4679#if TARGET_API_MAC_CARBON 4734#if TARGET_API_MAC_CARBON
4680 defsubr (&Sx_file_dialog); 4735 defsubr (&Sx_file_dialog);
4681#endif 4736#endif
4737 defsubr (&Smac_clear_font_name_table);
4738#if USE_MAC_FONT_PANEL
4739 defsubr (&Smac_set_font_panel_visibility);
4740#endif
4682} 4741}
4683 4742
4684/* arch-tag: d7591289-f374-4377-b245-12f5dbbb8edc 4743/* arch-tag: d7591289-f374-4377-b245-12f5dbbb8edc
diff --git a/src/macgui.h b/src/macgui.h
index 579ae2b7663..f7005600d43 100644
--- a/src/macgui.h
+++ b/src/macgui.h
@@ -103,6 +103,13 @@ typedef unsigned long Time;
103#endif 103#endif
104#endif 104#endif
105 105
106/* Whether to use the standard Font Panel floating dialog. */
107#ifndef USE_MAC_FONT_PANEL
108#if USE_ATSUI && MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
109#define USE_MAC_FONT_PANEL 1
110#endif
111#endif
112
106typedef WindowPtr Window; 113typedef WindowPtr Window;
107typedef GWorldPtr Pixmap; 114typedef GWorldPtr Pixmap;
108 115
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..dd96102e19b 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
@@ -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_services_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)
@@ -1408,6 +1599,17 @@ 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-services-selection", &Vmac_services_selection,
1413 doc: /* Selection name for communication via Services menu. */); 1615 doc: /* Selection name for communication via Services menu. */);
diff --git a/src/macterm.c b/src/macterm.c
index 45bc533893c..8af067e086b 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -4097,6 +4097,11 @@ x_new_focus_frame (dpyinfo, frame)
4097 pending_autoraise_frame = dpyinfo->x_focus_frame; 4097 pending_autoraise_frame = dpyinfo->x_focus_frame;
4098 else 4098 else
4099 pending_autoraise_frame = 0; 4099 pending_autoraise_frame = 0;
4100
4101#if USE_MAC_FONT_PANEL
4102 if (frame)
4103 mac_set_font_info_for_selection (frame);
4104#endif
4100 } 4105 }
4101 4106
4102 x_frame_rehighlight (dpyinfo); 4107 x_frame_rehighlight (dpyinfo);
@@ -4454,35 +4459,11 @@ scroll_bar_timer_callback (timer, data)
4454 EventLoopTimerRef timer; 4459 EventLoopTimerRef timer;
4455 void *data; 4460 void *data;
4456{ 4461{
4457 EventRef event = NULL; 4462 OSStatus err;
4458 OSErr err;
4459
4460 err = CreateEvent (NULL, kEventClassMouse, kEventMouseMoved, 0,
4461 kEventAttributeNone, &event);
4462 if (err == noErr)
4463 {
4464 Point mouse_pos;
4465
4466 GetMouse (&mouse_pos);
4467 LocalToGlobal (&mouse_pos);
4468 err = SetEventParameter (event, kEventParamMouseLocation, typeQDPoint,
4469 sizeof (Point), &mouse_pos);
4470 }
4471 if (err == noErr)
4472 {
4473 UInt32 modifiers = GetCurrentKeyModifiers ();
4474 4463
4475 err = SetEventParameter (event, kEventParamKeyModifiers, typeUInt32, 4464 err = mac_post_mouse_moved_event ();
4476 sizeof (UInt32), &modifiers);
4477 }
4478 if (err == noErr)
4479 err = PostEventToQueue (GetCurrentEventQueue (), event,
4480 kEventPriorityStandard);
4481 if (err == noErr) 4465 if (err == noErr)
4482 scroll_bar_timer_event_posted_p = 1; 4466 scroll_bar_timer_event_posted_p = 1;
4483
4484 if (event)
4485 ReleaseEvent (event);
4486} 4467}
4487 4468
4488static OSStatus 4469static OSStatus
@@ -6723,10 +6704,6 @@ xlfdpat_create (pattern)
6723 } 6704 }
6724 6705
6725 return pat; 6706 return pat;
6726
6727 error:
6728 xlfdpat_destroy (pat);
6729 return NULL;
6730} 6707}
6731 6708
6732static INLINE int 6709static INLINE int
@@ -6895,6 +6872,8 @@ static Lisp_Object fm_font_family_alist;
6895#if USE_ATSUI 6872#if USE_ATSUI
6896/* Hash table linking font family names to ATSU font IDs. */ 6873/* Hash table linking font family names to ATSU font IDs. */
6897static Lisp_Object atsu_font_id_hash; 6874static Lisp_Object atsu_font_id_hash;
6875static Lisp_Object Vmac_atsu_font_table;
6876extern Lisp_Object QCfamily, QCweight, QCslant, Qnormal, Qbold, Qitalic;
6898#endif 6877#endif
6899 6878
6900/* Alist linking character set strings to Mac text encoding and Emacs 6879/* Alist linking character set strings to Mac text encoding and Emacs
@@ -7190,8 +7169,21 @@ init_font_name_table ()
7190 NULL, NULL); 7169 NULL, NULL);
7191 if (err == noErr) 7170 if (err == noErr)
7192 { 7171 {
7172 FMFontFamily ff;
7173 FMFontStyle style = normal;
7174
7193 decode_mac_font_name (name, name_len + 1, Qnil); 7175 decode_mac_font_name (name, name_len + 1, Qnil);
7194 family = make_unibyte_string (name, name_len); 7176 family = make_unibyte_string (name, name_len);
7177 FMGetFontFamilyInstanceFromFont (font_ids[i], &ff, &style);
7178 Fputhash (make_unibyte_string ((char *)(font_ids + i),
7179 sizeof (ATSUFontID)),
7180 Fcons (QCfamily,
7181 list5 (family,
7182 QCweight,
7183 style & bold ? Qbold : Qnormal,
7184 QCslant,
7185 style & italic ? Qitalic : Qnormal)),
7186 Vmac_atsu_font_table);
7195 if (*name != '.' 7187 if (*name != '.'
7196 && hash_lookup (h, family, &hash_code) < 0) 7188 && hash_lookup (h, family, &hash_code) < 0)
7197 { 7189 {
@@ -7737,6 +7729,7 @@ XLoadQueryFont (Display *dpy, char *fontname)
7737 ATSUFontFeatureSelector selectors[] = {kAllTypeFeaturesOffSelector, 7729 ATSUFontFeatureSelector selectors[] = {kAllTypeFeaturesOffSelector,
7738 kDecomposeDiacriticsSelector}; 7730 kDecomposeDiacriticsSelector};
7739 Lisp_Object font_id_cons; 7731 Lisp_Object font_id_cons;
7732 FMFontStyle style;
7740 7733
7741 font_id_cons = Fgethash (make_unibyte_string (family, strlen (family)), 7734 font_id_cons = Fgethash (make_unibyte_string (family, strlen (family)),
7742 atsu_font_id_hash, Qnil); 7735 atsu_font_id_hash, Qnil);
@@ -7755,7 +7748,11 @@ XLoadQueryFont (Display *dpy, char *fontname)
7755 return NULL; 7748 return NULL;
7756 err = ATSUSetAttributes (mac_style, sizeof (tags) / sizeof (tags[0]), 7749 err = ATSUSetAttributes (mac_style, sizeof (tags) / sizeof (tags[0]),
7757 tags, sizes, values); 7750 tags, sizes, values);
7758 fontnum = -1; 7751 if (err != noErr)
7752 return NULL;
7753 err = FMGetFontFamilyInstanceFromFont (font_id, &fontnum, &style);
7754 if (err != noErr)
7755 fontnum = -1;
7759 scriptcode = kTextEncodingMacUnicode; 7756 scriptcode = kTextEncodingMacUnicode;
7760 } 7757 }
7761 else 7758 else
@@ -7815,22 +7812,20 @@ XLoadQueryFont (Display *dpy, char *fontname)
7815 pcm_init (font->bounds.rows[0], 0x100); 7812 pcm_init (font->bounds.rows[0], 0x100);
7816 7813
7817#if USE_CG_TEXT_DRAWING 7814#if USE_CG_TEXT_DRAWING
7818 { 7815 if (fontnum != -1)
7819 FMFontFamily font_family; 7816 {
7820 FMFontStyle style; 7817 FMFontStyle style;
7821 ATSFontRef ats_font; 7818 ATSFontRef ats_font;
7822 7819
7823 err = FMGetFontFamilyInstanceFromFont (font_id, &font_family, &style); 7820 err = FMGetFontFromFontFamilyInstance (fontnum, fontface,
7824 if (err == noErr)
7825 err = FMGetFontFromFontFamilyInstance (font_family, fontface,
7826 &font_id, &style); 7821 &font_id, &style);
7827 /* Use CG text drawing if italic/bold is not synthesized. */ 7822 /* Use CG text drawing if italic/bold is not synthesized. */
7828 if (err == noErr && style == fontface) 7823 if (err == noErr && style == fontface)
7829 { 7824 {
7830 ats_font = FMGetATSFontRefFromFont (font_id); 7825 ats_font = FMGetATSFontRefFromFont (font_id);
7831 font->cg_font = CGFontCreateWithPlatformFont (&ats_font); 7826 font->cg_font = CGFontCreateWithPlatformFont (&ats_font);
7832 } 7827 }
7833 } 7828 }
7834 7829
7835 if (font->cg_font) 7830 if (font->cg_font)
7836 { 7831 {
@@ -8319,6 +8314,42 @@ x_find_ccl_program (fontp)
8319 } 8314 }
8320} 8315}
8321 8316
8317#if USE_MAC_FONT_PANEL
8318OSStatus
8319mac_set_font_info_for_selection (f)
8320 struct frame *f;
8321{
8322 OSStatus err;
8323
8324 if (f == NULL)
8325 err = SetFontInfoForSelection (kFontSelectionATSUIType, 0, NULL, NULL);
8326 else
8327 {
8328 struct face *default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID);
8329 XFontStruct *ascii_font = default_face->ascii_face->font;
8330 EventTargetRef target = GetWindowEventTarget (FRAME_MAC_WINDOW (f));
8331
8332 if (ascii_font->mac_fontnum != -1)
8333 {
8334 FontSelectionQDStyle qd_style;
8335
8336 qd_style.version = kFontSelectionQDStyleVersionZero;
8337 qd_style.instance.fontFamily = ascii_font->mac_fontnum;
8338 qd_style.instance.fontStyle = ascii_font->mac_fontface;
8339 qd_style.size = ascii_font->mac_fontsize;
8340 qd_style.hasColor = false;
8341
8342 err = SetFontInfoForSelection (kFontSelectionQDType,
8343 1, &qd_style, target);
8344 }
8345 else
8346 err = SetFontInfoForSelection (kFontSelectionATSUIType,
8347 1, &ascii_font->mac_style, target);
8348 }
8349
8350 return err;
8351}
8352#endif
8322 8353
8323 8354
8324/* The Mac Event loop code */ 8355/* The Mac Event loop code */
@@ -8406,6 +8437,14 @@ Point saved_menu_event_location;
8406/* Apple Events */ 8437/* Apple Events */
8407#if USE_CARBON_EVENTS 8438#if USE_CARBON_EVENTS
8408static Lisp_Object Qhicommand; 8439static Lisp_Object Qhicommand;
8440#ifdef MAC_OSX
8441extern Lisp_Object Qwindow;
8442static Lisp_Object Qtoolbar_switch_mode;
8443#endif
8444#if USE_MAC_FONT_PANEL
8445extern Lisp_Object Qfont;
8446static Lisp_Object Qpanel_closed, Qselection;
8447#endif
8409#endif 8448#endif
8410extern int mac_ready_for_apple_events; 8449extern int mac_ready_for_apple_events;
8411extern Lisp_Object Qundefined; 8450extern Lisp_Object Qundefined;
@@ -8415,13 +8454,9 @@ extern void mac_find_apple_event_spec P_ ((AEEventClass, AEEventID,
8415 Lisp_Object *)); 8454 Lisp_Object *));
8416extern OSErr init_coercion_handler P_ ((void)); 8455extern OSErr init_coercion_handler P_ ((void));
8417 8456
8418#if TARGET_API_MAC_CARBON
8419/* Drag and Drop */ 8457/* Drag and Drop */
8420static pascal OSErr mac_do_track_drag (DragTrackingMessage, WindowPtr, void*, DragReference); 8458OSErr install_drag_handler P_ ((WindowRef));
8421static pascal OSErr mac_do_receive_drag (WindowPtr, void*, DragReference); 8459void remove_drag_handler P_ ((WindowRef));
8422static DragTrackingHandlerUPP mac_do_track_dragUPP = NULL;
8423static DragReceiveHandlerUPP mac_do_receive_dragUPP = NULL;
8424#endif
8425 8460
8426#if USE_CARBON_EVENTS 8461#if USE_CARBON_EVENTS
8427#ifdef MAC_OSX 8462#ifdef MAC_OSX
@@ -8977,47 +9012,84 @@ do_zoom_window (WindowPtr w, int zoom_in_or_out)
8977 x_real_positions (f, &f->left_pos, &f->top_pos); 9012 x_real_positions (f, &f->left_pos, &f->top_pos);
8978} 9013}
8979 9014
8980OSErr 9015void
8981mac_store_apple_event (class, id, desc) 9016mac_store_apple_event (class, id, desc)
8982 Lisp_Object class, id; 9017 Lisp_Object class, id;
8983 const AEDesc *desc; 9018 const AEDesc *desc;
8984{ 9019{
8985 OSErr err;
8986 struct input_event buf; 9020 struct input_event buf;
8987 AEDesc *desc_copy;
8988 9021
8989 desc_copy = xmalloc (sizeof (AEDesc)); 9022 EVENT_INIT (buf);
8990 err = AEDuplicateDesc (desc, desc_copy); 9023
8991 if (err == noErr) 9024 buf.kind = MAC_APPLE_EVENT;
8992 { 9025 buf.x = class;
8993 EVENT_INIT (buf); 9026 buf.y = id;
9027 XSETFRAME (buf.frame_or_window,
9028 mac_focus_frame (&one_mac_display_info));
9029 /* Now that Lisp object allocations are protected by BLOCK_INPUT, it
9030 is safe to use them during read_socket_hook. */
9031 buf.arg = mac_aedesc_to_lisp (desc);
9032 kbd_buffer_store_event (&buf);
9033}
9034
9035#if TARGET_API_MAC_CARBON
9036static OSStatus
9037mac_store_event_ref_as_apple_event (class, id, class_key, id_key,
9038 event, num_params, names, types)
9039 AEEventClass class;
9040 AEEventID id;
9041 Lisp_Object class_key, id_key;
9042 EventRef event;
9043 UInt32 num_params;
9044 EventParamName *names;
9045 EventParamType *types;
9046{
9047 OSStatus err = eventNotHandledErr;
9048 Lisp_Object binding;
8994 9049
8995 buf.kind = MAC_APPLE_EVENT; 9050 mac_find_apple_event_spec (class, id, &class_key, &id_key, &binding);
8996 buf.x = class; 9051 if (!NILP (binding) && !EQ (binding, Qundefined))
8997 buf.y = id; 9052 {
8998 buf.code = (int)desc_copy; 9053 if (INTEGERP (binding))
8999 XSETFRAME (buf.frame_or_window, 9054 err = XINT (binding);
9000 mac_focus_frame (&one_mac_display_info)); 9055 else
9001 buf.arg = Qnil; 9056 {
9002 kbd_buffer_store_event (&buf); 9057 AppleEvent apple_event;
9058 err = create_apple_event_from_event_ref (event, num_params,
9059 names, types,
9060 &apple_event);
9061 if (err == noErr)
9062 {
9063 mac_store_apple_event (class_key, id_key, &apple_event);
9064 AEDisposeDesc (&apple_event);
9065 }
9066 }
9003 } 9067 }
9004 9068
9005 return err; 9069 return err;
9006} 9070}
9007 9071
9008Lisp_Object 9072void
9009mac_make_lispy_event_code (code) 9073mac_store_drag_event (window, mouse_pos, modifiers, desc)
9010 int code; 9074 WindowRef window;
9075 Point mouse_pos;
9076 SInt16 modifiers;
9077 const AEDesc *desc;
9011{ 9078{
9012 AEDesc *desc = (AEDesc *)code; 9079 struct input_event buf;
9013 Lisp_Object obj;
9014 9080
9015 obj = mac_aedesc_to_lisp (desc); 9081 EVENT_INIT (buf);
9016 AEDisposeDesc (desc);
9017 xfree (desc);
9018 9082
9019 return obj; 9083 buf.kind = DRAG_N_DROP_EVENT;
9084 buf.modifiers = mac_to_emacs_modifiers (modifiers);
9085 buf.timestamp = TickCount () * (1000 / 60);
9086 XSETINT (buf.x, mouse_pos.h);
9087 XSETINT (buf.y, mouse_pos.v);
9088 XSETFRAME (buf.frame_or_window, mac_window_to_frame (window));
9089 buf.arg = mac_aedesc_to_lisp (desc);
9090 kbd_buffer_store_event (&buf);
9020} 9091}
9092#endif
9021 9093
9022#if USE_CARBON_EVENTS 9094#if USE_CARBON_EVENTS
9023static pascal OSStatus 9095static pascal OSStatus
@@ -9028,7 +9100,11 @@ mac_handle_command_event (next_handler, event, data)
9028{ 9100{
9029 OSStatus result, err; 9101 OSStatus result, err;
9030 HICommand command; 9102 HICommand command;
9031 Lisp_Object class_key, id_key, binding; 9103 static EventParamName names[] = {kEventParamDirectObject,
9104 kEventParamKeyModifiers};
9105 static EventParamType types[] = {typeHICommand,
9106 typeUInt32};
9107 int num_params = sizeof (names) / sizeof (names[0]);
9032 9108
9033 result = CallNextEventHandler (next_handler, event); 9109 result = CallNextEventHandler (next_handler, event);
9034 if (result != eventNotHandledErr) 9110 if (result != eventNotHandledErr)
@@ -9042,33 +9118,10 @@ mac_handle_command_event (next_handler, event, data)
9042 9118
9043 /* A HICommand event is mapped to an Apple event whose event class 9119 /* A HICommand event is mapped to an Apple event whose event class
9044 symbol is `hicommand' and event ID is its command ID. */ 9120 symbol is `hicommand' and event ID is its command ID. */
9045 class_key = Qhicommand; 9121 err = mac_store_event_ref_as_apple_event (0, command.commandID,
9046 mac_find_apple_event_spec (0, command.commandID, 9122 Qhicommand, Qnil,
9047 &class_key, &id_key, &binding); 9123 event, num_params, names, types);
9048 if (!NILP (binding) && !EQ (binding, Qundefined)) 9124 return err == noErr ? noErr : eventNotHandledErr;
9049 {
9050 if (INTEGERP (binding))
9051 return XINT (binding);
9052 else
9053 {
9054 AppleEvent apple_event;
9055 static EventParamName names[] = {kEventParamDirectObject,
9056 kEventParamKeyModifiers};
9057 static EventParamType types[] = {typeHICommand,
9058 typeUInt32};
9059 err = create_apple_event_from_event_ref (event, 2, names, types,
9060 &apple_event);
9061 if (err == noErr)
9062 {
9063 err = mac_store_apple_event (class_key, id_key, &apple_event);
9064 AEDisposeDesc (&apple_event);
9065 }
9066 if (err == noErr)
9067 return noErr;
9068 }
9069 }
9070
9071 return eventNotHandledErr;
9072} 9125}
9073 9126
9074static OSErr 9127static OSErr
@@ -9171,6 +9224,33 @@ mac_handle_window_event (next_handler, event, data)
9171 return noErr; 9224 return noErr;
9172 9225
9173 break; 9226 break;
9227
9228#ifdef MAC_OSX
9229 case kEventWindowToolbarSwitchMode:
9230 result = CallNextEventHandler (next_handler, event);
9231 {
9232 static EventParamName names[] = {kEventParamDirectObject,
9233 kEventParamWindowMouseLocation,
9234 kEventParamKeyModifiers,
9235 kEventParamMouseButton,
9236 kEventParamClickCount,
9237 kEventParamMouseChord};
9238 static EventParamType types[] = {typeWindowRef,
9239 typeQDPoint,
9240 typeUInt32,
9241 typeMouseButton,
9242 typeUInt32,
9243 typeUInt32};
9244 int num_params = sizeof (names) / sizeof (names[0]);
9245
9246 err = mac_store_event_ref_as_apple_event (0, 0,
9247 Qwindow,
9248 Qtoolbar_switch_mode,
9249 event, num_params,
9250 names, types);
9251 }
9252 return err == noErr ? noErr : result;
9253#endif
9174 } 9254 }
9175 9255
9176 return eventNotHandledErr; 9256 return eventNotHandledErr;
@@ -9245,45 +9325,96 @@ mac_handle_mouse_event (next_handler, event, data)
9245 return eventNotHandledErr; 9325 return eventNotHandledErr;
9246} 9326}
9247 9327
9328#if USE_MAC_FONT_PANEL
9329static pascal OSStatus
9330mac_handle_font_event (next_handler, event, data)
9331 EventHandlerCallRef next_handler;
9332 EventRef event;
9333 void *data;
9334{
9335 OSStatus result, err;
9336 Lisp_Object id_key;
9337 int num_params;
9338 EventParamName *names;
9339 EventParamType *types;
9340 static EventParamName names_sel[] = {kEventParamATSUFontID,
9341 kEventParamATSUFontSize,
9342 kEventParamFMFontFamily,
9343 kEventParamFMFontSize,
9344 kEventParamFontColor};
9345 static EventParamType types_sel[] = {typeATSUFontID,
9346 typeATSUSize,
9347 typeFMFontFamily,
9348 typeFMFontSize,
9349 typeFontColor};
9350
9351 result = CallNextEventHandler (next_handler, event);
9352 if (result != eventNotHandledErr)
9353 return result;
9354
9355 switch (GetEventKind (event))
9356 {
9357 case kEventFontPanelClosed:
9358 id_key = Qpanel_closed;
9359 num_params = 0;
9360 names = NULL;
9361 types = NULL;
9362 break;
9363
9364 case kEventFontSelection:
9365 id_key = Qselection;
9366 num_params = sizeof (names_sel) / sizeof (names_sel[0]);
9367 names = names_sel;
9368 types = types_sel;
9369 break;
9370 }
9371
9372 err = mac_store_event_ref_as_apple_event (0, 0, Qfont, id_key,
9373 event, num_params,
9374 names, types);
9375
9376 return err == noErr ? noErr : eventNotHandledErr;
9377}
9378#endif
9379
9248#ifdef MAC_OSX 9380#ifdef MAC_OSX
9249OSErr 9381OSStatus
9250mac_store_services_event (event) 9382mac_store_services_event (event)
9251 EventRef event; 9383 EventRef event;
9252{ 9384{
9253 OSErr err; 9385 OSStatus err;
9254 AppleEvent apple_event;
9255 Lisp_Object id_key; 9386 Lisp_Object id_key;
9387 int num_params;
9388 EventParamName *names;
9389 EventParamType *types;
9390 static EventParamName names_pfm[] = {kEventParamServiceMessageName,
9391 kEventParamServiceUserData};
9392 static EventParamType types_pfm[] = {typeCFStringRef,
9393 typeCFStringRef};
9256 9394
9257 switch (GetEventKind (event)) 9395 switch (GetEventKind (event))
9258 { 9396 {
9259 case kEventServicePaste: 9397 case kEventServicePaste:
9260 id_key = Qpaste; 9398 id_key = Qpaste;
9261 err = create_apple_event_from_event_ref (event, 0, NULL, NULL, 9399 num_params = 0;
9262 &apple_event); 9400 names = NULL;
9401 types = NULL;
9263 break; 9402 break;
9264 9403
9265 case kEventServicePerform: 9404 case kEventServicePerform:
9266 { 9405 id_key = Qperform;
9267 static EventParamName names[] = {kEventParamServiceMessageName, 9406 num_params = sizeof (names_pfm) / sizeof (names_pfm[0]);
9268 kEventParamServiceUserData}; 9407 names = names_pfm;
9269 static EventParamType types[] = {typeCFStringRef, 9408 types = types_pfm;
9270 typeCFStringRef};
9271
9272 id_key = Qperform;
9273 err = create_apple_event_from_event_ref (event, 2, names, types,
9274 &apple_event);
9275 }
9276 break; 9409 break;
9277 9410
9278 default: 9411 default:
9279 abort (); 9412 abort ();
9280 } 9413 }
9281 9414
9282 if (err == noErr) 9415 err = mac_store_event_ref_as_apple_event (0, 0, Qservices, id_key,
9283 { 9416 event, num_params,
9284 err = mac_store_apple_event (Qservices, id_key, &apple_event); 9417 names, types);
9285 AEDisposeDesc (&apple_event);
9286 }
9287 9418
9288 return err; 9419 return err;
9289} 9420}
@@ -9303,15 +9434,28 @@ install_window_handler (window)
9303 {kEventClassWindow, kEventWindowShown}, 9434 {kEventClassWindow, kEventWindowShown},
9304 {kEventClassWindow, kEventWindowHidden}, 9435 {kEventClassWindow, kEventWindowHidden},
9305 {kEventClassWindow, kEventWindowExpanded}, 9436 {kEventClassWindow, kEventWindowExpanded},
9306 {kEventClassWindow, kEventWindowCollapsed}}; 9437 {kEventClassWindow, kEventWindowCollapsed},
9438#ifdef MAC_OSX
9439 {kEventClassWindow, kEventWindowToolbarSwitchMode},
9440#endif
9441 };
9307 EventTypeSpec specs_mouse[] = {{kEventClassMouse, kEventMouseWheelMoved}}; 9442 EventTypeSpec specs_mouse[] = {{kEventClassMouse, kEventMouseWheelMoved}};
9308 static EventHandlerUPP handle_window_eventUPP = NULL; 9443 static EventHandlerUPP handle_window_eventUPP = NULL;
9309 static EventHandlerUPP handle_mouse_eventUPP = NULL; 9444 static EventHandlerUPP handle_mouse_eventUPP = NULL;
9445#if USE_MAC_FONT_PANEL
9446 EventTypeSpec specs_font[] = {{kEventClassFont, kEventFontPanelClosed},
9447 {kEventClassFont, kEventFontSelection}};
9448 static EventHandlerUPP handle_font_eventUPP = NULL;
9449#endif
9310 9450
9311 if (handle_window_eventUPP == NULL) 9451 if (handle_window_eventUPP == NULL)
9312 handle_window_eventUPP = NewEventHandlerUPP (mac_handle_window_event); 9452 handle_window_eventUPP = NewEventHandlerUPP (mac_handle_window_event);
9313 if (handle_mouse_eventUPP == NULL) 9453 if (handle_mouse_eventUPP == NULL)
9314 handle_mouse_eventUPP = NewEventHandlerUPP (mac_handle_mouse_event); 9454 handle_mouse_eventUPP = NewEventHandlerUPP (mac_handle_mouse_event);
9455#if USE_MAC_FONT_PANEL
9456 if (handle_font_eventUPP == NULL)
9457 handle_font_eventUPP = NewEventHandlerUPP (mac_handle_font_event);
9458#endif
9315 err = InstallWindowEventHandler (window, handle_window_eventUPP, 9459 err = InstallWindowEventHandler (window, handle_window_eventUPP,
9316 GetEventTypeCount (specs_window), 9460 GetEventTypeCount (specs_window),
9317 specs_window, NULL, NULL); 9461 specs_window, NULL, NULL);
@@ -9319,18 +9463,16 @@ install_window_handler (window)
9319 err = InstallWindowEventHandler (window, handle_mouse_eventUPP, 9463 err = InstallWindowEventHandler (window, handle_mouse_eventUPP,
9320 GetEventTypeCount (specs_mouse), 9464 GetEventTypeCount (specs_mouse),
9321 specs_mouse, NULL, NULL); 9465 specs_mouse, NULL, NULL);
9322#endif 9466#if USE_MAC_FONT_PANEL
9323#if TARGET_API_MAC_CARBON
9324 if (mac_do_track_dragUPP == NULL)
9325 mac_do_track_dragUPP = NewDragTrackingHandlerUPP (mac_do_track_drag);
9326 if (mac_do_receive_dragUPP == NULL)
9327 mac_do_receive_dragUPP = NewDragReceiveHandlerUPP (mac_do_receive_drag);
9328
9329 if (err == noErr)
9330 err = InstallTrackingHandler (mac_do_track_dragUPP, window, NULL);
9331 if (err == noErr) 9467 if (err == noErr)
9332 err = InstallReceiveHandler (mac_do_receive_dragUPP, window, NULL); 9468 err = InstallWindowEventHandler (window, handle_font_eventUPP,
9469 GetEventTypeCount (specs_font),
9470 specs_font, NULL, NULL);
9333#endif 9471#endif
9472#endif
9473 if (err == noErr)
9474 err = install_drag_handler (window);
9475
9334 return err; 9476 return err;
9335} 9477}
9336 9478
@@ -9338,167 +9480,9 @@ void
9338remove_window_handler (window) 9480remove_window_handler (window)
9339 WindowPtr window; 9481 WindowPtr window;
9340{ 9482{
9341#if TARGET_API_MAC_CARBON 9483 remove_drag_handler (window);
9342 if (mac_do_track_dragUPP)
9343 RemoveTrackingHandler (mac_do_track_dragUPP, window);
9344 if (mac_do_receive_dragUPP)
9345 RemoveReceiveHandler (mac_do_receive_dragUPP, window);
9346#endif
9347}
9348
9349#if TARGET_API_MAC_CARBON
9350static pascal OSErr
9351mac_do_track_drag (DragTrackingMessage message, WindowPtr window,
9352 void *handlerRefCon, DragReference theDrag)
9353{
9354 static int can_accept;
9355 short items;
9356 short index;
9357 ItemReference theItem;
9358 FlavorFlags theFlags;
9359 OSErr result;
9360
9361 if (GetFrontWindowOfClass (kMovableModalWindowClass, false))
9362 return dragNotAcceptedErr;
9363
9364 switch (message)
9365 {
9366 case kDragTrackingEnterHandler:
9367 CountDragItems (theDrag, &items);
9368 can_accept = 0;
9369 for (index = 1; index <= items; index++)
9370 {
9371 GetDragItemReferenceNumber (theDrag, index, &theItem);
9372 result = GetFlavorFlags (theDrag, theItem, flavorTypeHFS, &theFlags);
9373 if (result == noErr)
9374 {
9375 can_accept = 1;
9376 break;
9377 }
9378 }
9379 break;
9380
9381 case kDragTrackingEnterWindow:
9382 if (can_accept)
9383 {
9384 RgnHandle hilite_rgn = NewRgn ();
9385 Rect r;
9386 struct frame *f = mac_window_to_frame (window);
9387
9388 GetWindowPortBounds (window, &r);
9389 OffsetRect (&r, -r.left, -r.top);
9390 RectRgn (hilite_rgn, &r);
9391 ShowDragHilite (theDrag, hilite_rgn, true);
9392 DisposeRgn (hilite_rgn);
9393 SetThemeCursor (kThemeCopyArrowCursor);
9394 }
9395 break;
9396
9397 case kDragTrackingInWindow:
9398 break;
9399
9400 case kDragTrackingLeaveWindow:
9401 if (can_accept)
9402 {
9403 struct frame *f = mac_window_to_frame (window);
9404
9405 HideDragHilite (theDrag);
9406 SetThemeCursor (kThemeArrowCursor);
9407 }
9408 break;
9409
9410 case kDragTrackingLeaveHandler:
9411 break;
9412 }
9413
9414 return noErr;
9415} 9484}
9416 9485
9417static pascal OSErr
9418mac_do_receive_drag (WindowPtr window, void *handlerRefCon,
9419 DragReference theDrag)
9420{
9421 short items;
9422 short index;
9423 FlavorFlags theFlags;
9424 Point mouse;
9425 OSErr result;
9426 ItemReference theItem;
9427 HFSFlavor data;
9428 Size size = sizeof (HFSFlavor);
9429 Lisp_Object file_list;
9430
9431 if (GetFrontWindowOfClass (kMovableModalWindowClass, false))
9432 return dragNotAcceptedErr;
9433
9434 file_list = Qnil;
9435 GetDragMouse (theDrag, &mouse, 0L);
9436 CountDragItems (theDrag, &items);
9437 for (index = 1; index <= items; index++)
9438 {
9439 /* Only handle file references. */
9440 GetDragItemReferenceNumber (theDrag, index, &theItem);
9441 result = GetFlavorFlags (theDrag, theItem, flavorTypeHFS, &theFlags);
9442 if (result == noErr)
9443 {
9444 OSErr err;
9445 AEDesc desc;
9446
9447 err = GetFlavorData (theDrag, theItem, flavorTypeHFS,
9448 &data, &size, 0L);
9449 if (err == noErr)
9450 err = AECoercePtr (typeFSS, &data.fileSpec, sizeof (FSSpec),
9451 TYPE_FILE_NAME, &desc);
9452 if (err == noErr)
9453 {
9454 Lisp_Object file;
9455
9456 /* x-dnd functions expect undecoded filenames. */
9457 file = make_uninit_string (AEGetDescDataSize (&desc));
9458 err = AEGetDescData (&desc, SDATA (file), SBYTES (file));
9459 if (err == noErr)
9460 file_list = Fcons (file, file_list);
9461 AEDisposeDesc (&desc);
9462 }
9463 }
9464 }
9465 /* If there are items in the list, construct an event and post it to
9466 the queue like an interrupt using kbd_buffer_store_event. */
9467 if (!NILP (file_list))
9468 {
9469 struct input_event event;
9470 Lisp_Object frame;
9471 struct frame *f = mac_window_to_frame (window);
9472 SInt16 modifiers;
9473
9474 GlobalToLocal (&mouse);
9475 GetDragModifiers (theDrag, NULL, NULL, &modifiers);
9476
9477 event.kind = DRAG_N_DROP_EVENT;
9478 event.code = 0;
9479 event.modifiers = mac_to_emacs_modifiers (modifiers);
9480 event.timestamp = TickCount () * (1000 / 60);
9481 XSETINT (event.x, mouse.h);
9482 XSETINT (event.y, mouse.v);
9483 XSETFRAME (frame, f);
9484 event.frame_or_window = frame;
9485 event.arg = file_list;
9486 /* Post to the interrupt queue */
9487 kbd_buffer_store_event (&event);
9488 /* MAC_TODO: Mimic behavior of windows by switching contexts to Emacs */
9489 {
9490 ProcessSerialNumber psn;
9491 GetCurrentProcess (&psn);
9492 SetFrontProcess (&psn);
9493 }
9494
9495 return noErr;
9496 }
9497 else
9498 return dragNotAcceptedErr;
9499}
9500#endif
9501
9502 9486
9503#if __profile__ 9487#if __profile__
9504void 9488void
@@ -9784,6 +9768,41 @@ mac_wait_next_event (er, sleep_time, dequeue)
9784} 9768}
9785#endif /* not USE_CARBON_EVENTS */ 9769#endif /* not USE_CARBON_EVENTS */
9786 9770
9771#if TARGET_API_MAC_CARBON
9772OSStatus
9773mac_post_mouse_moved_event ()
9774{
9775 EventRef event = NULL;
9776 OSStatus err;
9777
9778 err = CreateEvent (NULL, kEventClassMouse, kEventMouseMoved, 0,
9779 kEventAttributeNone, &event);
9780 if (err == noErr)
9781 {
9782 Point mouse_pos;
9783
9784 GetMouse (&mouse_pos);
9785 LocalToGlobal (&mouse_pos);
9786 err = SetEventParameter (event, kEventParamMouseLocation, typeQDPoint,
9787 sizeof (Point), &mouse_pos);
9788 }
9789 if (err == noErr)
9790 {
9791 UInt32 modifiers = GetCurrentKeyModifiers ();
9792
9793 err = SetEventParameter (event, kEventParamKeyModifiers, typeUInt32,
9794 sizeof (UInt32), &modifiers);
9795 }
9796 if (err == noErr)
9797 err = PostEventToQueue (GetCurrentEventQueue (), event,
9798 kEventPriorityStandard);
9799 if (event)
9800 ReleaseEvent (event);
9801
9802 return err;
9803}
9804#endif
9805
9787/* Emacs calls this whenever it wants to read an input event from the 9806/* Emacs calls this whenever it wants to read an input event from the
9788 user. */ 9807 user. */
9789int 9808int
@@ -9911,7 +9930,8 @@ XTread_socket (sd, expected, hold_quit)
9911 break; 9930 break;
9912 9931
9913 case inContent: 9932 case inContent:
9914 if (window_ptr != FRAME_MAC_WINDOW (mac_focus_frame (dpyinfo))) 9933 if (dpyinfo->x_focus_frame == NULL
9934 || window_ptr != FRAME_MAC_WINDOW (dpyinfo->x_focus_frame))
9915 SelectWindow (window_ptr); 9935 SelectWindow (window_ptr);
9916 else 9936 else
9917 { 9937 {
@@ -10058,20 +10078,18 @@ XTread_socket (sd, expected, hold_quit)
10058 } 10078 }
10059 break; 10079 break;
10060 10080
10061#if TARGET_API_MAC_CARBON
10062 case inProxyIcon:
10063 if (TrackWindowProxyDrag (window_ptr, er.where)
10064 != errUserWantsToDragWindow)
10065 break;
10066 /* fall through */
10067#endif
10068 case inDrag: 10081 case inDrag:
10069#if TARGET_API_MAC_CARBON 10082#if TARGET_API_MAC_CARBON
10083 case inProxyIcon:
10070 if (IsWindowPathSelectClick (window_ptr, &er)) 10084 if (IsWindowPathSelectClick (window_ptr, &er))
10071 { 10085 {
10072 WindowPathSelect (window_ptr, NULL, NULL); 10086 WindowPathSelect (window_ptr, NULL, NULL);
10073 break; 10087 break;
10074 } 10088 }
10089 if (part_code == inProxyIcon
10090 && (TrackWindowProxyDrag (window_ptr, er.where)
10091 != errUserWantsToDragWindow))
10092 break;
10075 DragWindow (window_ptr, er.where, NULL); 10093 DragWindow (window_ptr, er.where, NULL);
10076#else /* not TARGET_API_MAC_CARBON */ 10094#else /* not TARGET_API_MAC_CARBON */
10077 DragWindow (window_ptr, er.where, &qd.screenBits.bounds); 10095 DragWindow (window_ptr, er.where, &qd.screenBits.bounds);
@@ -11010,6 +11028,13 @@ syms_of_macterm ()
11010#if USE_CARBON_EVENTS 11028#if USE_CARBON_EVENTS
11011 Qhicommand = intern ("hicommand"); staticpro (&Qhicommand); 11029 Qhicommand = intern ("hicommand"); staticpro (&Qhicommand);
11012#ifdef MAC_OSX 11030#ifdef MAC_OSX
11031 Qtoolbar_switch_mode = intern ("toolbar-switch-mode");
11032 staticpro (&Qtoolbar_switch_mode);
11033#if USE_MAC_FONT_PANEL
11034 Qpanel_closed = intern ("panel-closed"); staticpro (&Qpanel_closed);
11035 Qselection = intern ("selection"); staticpro (&Qselection);
11036#endif
11037
11013 Qservices = intern ("services"); staticpro (&Qservices); 11038 Qservices = intern ("services"); staticpro (&Qservices);
11014 Qpaste = intern ("paste"); staticpro (&Qpaste); 11039 Qpaste = intern ("paste"); staticpro (&Qpaste);
11015 Qperform = intern ("perform"); staticpro (&Qperform); 11040 Qperform = intern ("perform"); staticpro (&Qperform);
@@ -11050,7 +11075,7 @@ NOTE: Not supported on Mac yet. */);
11050 x_use_underline_position_properties = 0; 11075 x_use_underline_position_properties = 0;
11051 11076
11052 DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars, 11077 DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars,
11053 doc: /* If not nil, Emacs uses toolkit scroll bars. */); 11078 doc: /* If not nil, Emacs uses toolkit scroll bars. */);
11054#ifdef USE_TOOLKIT_SCROLL_BARS 11079#ifdef USE_TOOLKIT_SCROLL_BARS
11055 Vx_toolkit_scroll_bars = Qt; 11080 Vx_toolkit_scroll_bars = Qt;
11056#else 11081#else
@@ -11104,23 +11129,23 @@ mouse-3 and the command-key will register for mouse-2. */);
11104 11129
11105#if USE_CARBON_EVENTS 11130#if USE_CARBON_EVENTS
11106 DEFVAR_BOOL ("mac-wheel-button-is-mouse-2", &mac_wheel_button_is_mouse_2, 11131 DEFVAR_BOOL ("mac-wheel-button-is-mouse-2", &mac_wheel_button_is_mouse_2,
11107 doc: /* *Non-nil if the wheel button is mouse-2 and the right click mouse-3. 11132 doc: /* *Non-nil if the wheel button is mouse-2 and the right click mouse-3.
11108Otherwise, the right click will be treated as mouse-2 and the wheel 11133Otherwise, the right click will be treated as mouse-2 and the wheel
11109button will be mouse-3. */); 11134button will be mouse-3. */);
11110 mac_wheel_button_is_mouse_2 = 1; 11135 mac_wheel_button_is_mouse_2 = 1;
11111 11136
11112 DEFVAR_BOOL ("mac-pass-command-to-system", &mac_pass_command_to_system, 11137 DEFVAR_BOOL ("mac-pass-command-to-system", &mac_pass_command_to_system,
11113 doc: /* *Non-nil if command key presses are passed on to the Mac Toolbox. */); 11138 doc: /* *Non-nil if command key presses are passed on to the Mac Toolbox. */);
11114 mac_pass_command_to_system = 1; 11139 mac_pass_command_to_system = 1;
11115 11140
11116 DEFVAR_BOOL ("mac-pass-control-to-system", &mac_pass_control_to_system, 11141 DEFVAR_BOOL ("mac-pass-control-to-system", &mac_pass_control_to_system,
11117 doc: /* *Non-nil if control key presses are passed on to the Mac Toolbox. */); 11142 doc: /* *Non-nil if control key presses are passed on to the Mac Toolbox. */);
11118 mac_pass_control_to_system = 1; 11143 mac_pass_control_to_system = 1;
11119 11144
11120#endif 11145#endif
11121 11146
11122 DEFVAR_BOOL ("mac-allow-anti-aliasing", &mac_use_core_graphics, 11147 DEFVAR_BOOL ("mac-allow-anti-aliasing", &mac_use_core_graphics,
11123 doc: /* *If non-nil, allow anti-aliasing. 11148 doc: /* *If non-nil, allow anti-aliasing.
11124The text will be rendered using Core Graphics text rendering which 11149The text will be rendered using Core Graphics text rendering which
11125may anti-alias the text. */); 11150may anti-alias the text. */);
11126#if USE_CG_DRAWING 11151#if USE_CG_DRAWING
@@ -11133,7 +11158,7 @@ may anti-alias the text. */);
11133 creating the terminal frame on Mac OS 9 before loading 11158 creating the terminal frame on Mac OS 9 before loading
11134 term/mac-win.elc. */ 11159 term/mac-win.elc. */
11135 DEFVAR_LISP ("mac-charset-info-alist", &Vmac_charset_info_alist, 11160 DEFVAR_LISP ("mac-charset-info-alist", &Vmac_charset_info_alist,
11136 doc: /* Alist of Emacs character sets vs text encodings and coding systems. 11161 doc: /* Alist of Emacs character sets vs text encodings and coding systems.
11137Each entry should be of the form: 11162Each entry should be of the form:
11138 11163
11139 (CHARSET-NAME TEXT-ENCODING CODING-SYSTEM) 11164 (CHARSET-NAME TEXT-ENCODING CODING-SYSTEM)
@@ -11144,6 +11169,18 @@ CODING_SYSTEM is a coding system corresponding to TEXT-ENCODING. */);
11144 Vmac_charset_info_alist = 11169 Vmac_charset_info_alist =
11145 Fcons (list3 (build_string ("mac-roman"), 11170 Fcons (list3 (build_string ("mac-roman"),
11146 make_number (smRoman), Qnil), Qnil); 11171 make_number (smRoman), Qnil), Qnil);
11172
11173#if USE_ATSUI
11174 DEFVAR_LISP ("mac-atsu-font-table", &Vmac_atsu_font_table,
11175 doc: /* Hash table of ATSU font IDs vs plist of attributes and values.
11176Each font ID is represented as a four-byte string in native byte
11177order. */);
11178 Vmac_atsu_font_table =
11179 make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE),
11180 make_float (DEFAULT_REHASH_SIZE),
11181 make_float (DEFAULT_REHASH_THRESHOLD),
11182 Qnil, Qnil, Qnil);
11183#endif
11147} 11184}
11148 11185
11149/* arch-tag: f2259165-4454-4c04-a029-a133c8af7b5b 11186/* arch-tag: f2259165-4454-4c04-a029-a133c8af7b5b
diff --git a/src/macterm.h b/src/macterm.h
index 80276b45102..7406fb2fda6 100644
--- a/src/macterm.h
+++ b/src/macterm.h
@@ -581,10 +581,11 @@ extern void mac_draw_line_to_pixmap P_ ((Display *, Pixmap, GC, int, int,
581extern void mac_clear_area P_ ((struct frame *, int, int, 581extern void mac_clear_area P_ ((struct frame *, int, int,
582 unsigned int, unsigned int)); 582 unsigned int, unsigned int));
583extern void mac_unload_font P_ ((struct mac_display_info *, XFontStruct *)); 583extern void mac_unload_font P_ ((struct mac_display_info *, XFontStruct *));
584extern OSStatus mac_set_font_info_for_selection P_ ((struct frame *));
584extern OSErr install_window_handler P_ ((WindowPtr)); 585extern OSErr install_window_handler P_ ((WindowPtr));
585extern void remove_window_handler P_ ((WindowPtr)); 586extern void remove_window_handler P_ ((WindowPtr));
586extern Lisp_Object mac_make_lispy_event_code P_ ((int));
587extern void do_menu_choice P_ ((SInt32)); 587extern void do_menu_choice P_ ((SInt32));
588extern OSStatus mac_post_mouse_moved_event P_ ((void));
588#if USE_CG_DRAWING 589#if USE_CG_DRAWING
589extern void mac_prepare_for_quickdraw P_ ((struct frame *)); 590extern void mac_prepare_for_quickdraw P_ ((struct frame *));
590#endif 591#endif
@@ -620,12 +621,15 @@ extern void free_frame_menubar P_ ((struct frame *));
620/* Defined in mac.c. */ 621/* Defined in mac.c. */
621 622
622extern void mac_clear_font_name_table P_ ((void)); 623extern void mac_clear_font_name_table P_ ((void));
623extern Lisp_Object mac_aedesc_to_lisp P_ ((AEDesc *)); 624extern Lisp_Object mac_aedesc_to_lisp P_ ((const AEDesc *));
624#if TARGET_API_MAC_CARBON 625#if TARGET_API_MAC_CARBON
625extern OSErr create_apple_event_from_event_ref P_ ((EventRef, UInt32, 626extern OSErr create_apple_event_from_event_ref P_ ((EventRef, UInt32,
626 EventParamName *, 627 EventParamName *,
627 EventParamType *, 628 EventParamType *,
628 AppleEvent *)); 629 AppleEvent *));
630extern OSErr create_apple_event_from_drag_ref P_ ((DragRef, UInt32,
631 FlavorType *,
632 AppleEvent *));
629extern CFStringRef cfstring_create_with_utf8_cstring P_ ((const char *)); 633extern CFStringRef cfstring_create_with_utf8_cstring P_ ((const char *));
630extern CFStringRef cfstring_create_with_string P_ ((Lisp_Object)); 634extern CFStringRef cfstring_create_with_string P_ ((Lisp_Object));
631extern Lisp_Object cfdata_to_lisp P_ ((CFDataRef)); 635extern Lisp_Object cfdata_to_lisp P_ ((CFDataRef));
diff --git a/src/minibuf.c b/src/minibuf.c
index 5f3f7454a0c..dc920287304 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -2805,7 +2805,7 @@ syms_of_minibuf ()
2805 DEFVAR_LISP ("history-length", &Vhistory_length, 2805 DEFVAR_LISP ("history-length", &Vhistory_length,
2806 doc: /* *Maximum length for history lists before truncation takes place. 2806 doc: /* *Maximum length for history lists before truncation takes place.
2807A number means that length; t means infinite. Truncation takes place 2807A number means that length; t means infinite. Truncation takes place
2808just after a new element is inserted. Setting the history-length 2808just after a new element is inserted. Setting the `history-length'
2809property of a history variable overrides this default. */); 2809property of a history variable overrides this default. */);
2810 XSETFASTINT (Vhistory_length, 30); 2810 XSETFASTINT (Vhistory_length, 30);
2811 2811
diff --git a/src/process.c b/src/process.c
index 6e633a5825c..de4dbd4a3ff 100644
--- a/src/process.c
+++ b/src/process.c
@@ -695,6 +695,8 @@ setup_process_coding_systems (process)
695 = (struct coding_system *) xmalloc (sizeof (struct coding_system)); 695 = (struct coding_system *) xmalloc (sizeof (struct coding_system));
696 setup_coding_system (p->encode_coding_system, 696 setup_coding_system (p->encode_coding_system,
697 proc_encode_coding_system[outch]); 697 proc_encode_coding_system[outch]);
698 if (proc_encode_coding_system[outch]->eol_type == CODING_EOL_UNDECIDED)
699 proc_encode_coding_system[outch]->eol_type = system_eol_type;
698} 700}
699 701
700DEFUN ("processp", Fprocessp, Sprocessp, 1, 1, 0, 702DEFUN ("processp", Fprocessp, Sprocessp, 1, 1, 0,
@@ -5071,6 +5073,10 @@ read_process_output (proc, channel)
5071 p->encode_coding_system = coding->symbol; 5073 p->encode_coding_system = coding->symbol;
5072 setup_coding_system (coding->symbol, 5074 setup_coding_system (coding->symbol,
5073 proc_encode_coding_system[XINT (p->outfd)]); 5075 proc_encode_coding_system[XINT (p->outfd)]);
5076 if (proc_encode_coding_system[XINT (p->outfd)]->eol_type
5077 == CODING_EOL_UNDECIDED)
5078 proc_encode_coding_system[XINT (p->outfd)]->eol_type
5079 = system_eol_type;
5074 } 5080 }
5075 } 5081 }
5076 5082
@@ -5178,6 +5184,10 @@ read_process_output (proc, channel)
5178 p->encode_coding_system = coding->symbol; 5184 p->encode_coding_system = coding->symbol;
5179 setup_coding_system (coding->symbol, 5185 setup_coding_system (coding->symbol,
5180 proc_encode_coding_system[XINT (p->outfd)]); 5186 proc_encode_coding_system[XINT (p->outfd)]);
5187 if (proc_encode_coding_system[XINT (p->outfd)]->eol_type
5188 == CODING_EOL_UNDECIDED)
5189 proc_encode_coding_system[XINT (p->outfd)]->eol_type
5190 = system_eol_type;
5181 } 5191 }
5182 } 5192 }
5183 carryover = nbytes - coding->consumed; 5193 carryover = nbytes - coding->consumed;
@@ -5320,6 +5330,8 @@ send_process (proc, buf, len, object)
5320 sending a multibyte text, thus we must encode it by the 5330 sending a multibyte text, thus we must encode it by the
5321 original coding system specified for the current process. */ 5331 original coding system specified for the current process. */
5322 setup_coding_system (p->encode_coding_system, coding); 5332 setup_coding_system (p->encode_coding_system, coding);
5333 if (coding->eol_type == CODING_EOL_UNDECIDED)
5334 coding->eol_type = system_eol_type;
5323 /* src_multibyte should be set to 1 _after_ a call to 5335 /* src_multibyte should be set to 1 _after_ a call to
5324 setup_coding_system, since it resets src_multibyte to 5336 setup_coding_system, since it resets src_multibyte to
5325 zero. */ 5337 zero. */
diff --git a/src/termhooks.h b/src/termhooks.h
index 13b41f95f70..8937a709f85 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -183,9 +183,9 @@ enum event_kind
183 /* Generated when an Apple event, a HICommand event, or a Services 183 /* Generated when an Apple event, a HICommand event, or a Services
184 menu event is received and the corresponding handler is 184 menu event is received and the corresponding handler is
185 registered. Members `x' and `y' are for the event class and ID 185 registered. Members `x' and `y' are for the event class and ID
186 symbols, respectively. Member `code' points to the Apple event 186 symbols, respectively. Member `arg' is a Lisp object converted
187 descriptor. Parameters for Non-Apple events are converted to 187 from the received Apple event. Parameters for non-Apple events
188 those in Apple events. */ 188 are converted to those in Apple events. */
189 MAC_APPLE_EVENT 189 MAC_APPLE_EVENT
190#endif 190#endif
191}; 191};
diff --git a/src/xdisp.c b/src/xdisp.c
index d05b1c5293d..4ad511c18b0 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -4433,6 +4433,24 @@ handle_composition_prop (it)
4433 4433
4434 if (id >= 0) 4434 if (id >= 0)
4435 { 4435 {
4436 struct composition *cmp = composition_table[id];
4437
4438 if (cmp->glyph_len == 0)
4439 {
4440 /* No glyph. */
4441 if (STRINGP (it->string))
4442 {
4443 IT_STRING_CHARPOS (*it) = end;
4444 IT_STRING_BYTEPOS (*it) = string_char_to_byte (it->string,
4445 end);
4446 }
4447 else
4448 {
4449 IT_CHARPOS (*it) = end;
4450 IT_BYTEPOS (*it) = CHAR_TO_BYTE (end);
4451 }
4452 return HANDLED_RECOMPUTE_PROPS;
4453 }
4436 it->method = GET_FROM_COMPOSITION; 4454 it->method = GET_FROM_COMPOSITION;
4437 it->cmp_id = id; 4455 it->cmp_id = id;
4438 it->cmp_len = COMPOSITION_LENGTH (prop); 4456 it->cmp_len = COMPOSITION_LENGTH (prop);