aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2010-11-27 15:04:57 -0500
committerChong Yidong2010-11-27 15:04:57 -0500
commit07976ae3b816dea4fd541bbba862603d3132eb2c (patch)
tree4a437b7cb3abb01fb144530a130c991882a1b7f2
parent9610796712a3bc43730c99005906571a2c0bccbd (diff)
parent402c8a49571227f8a4e678d4a6cdd6ba7841aef9 (diff)
downloademacs-07976ae3b816dea4fd541bbba862603d3132eb2c.tar.gz
emacs-07976ae3b816dea4fd541bbba862603d3132eb2c.zip
Merge changes from emacs-23 branch
-rw-r--r--admin/notes/bugtracker6
-rw-r--r--doc/emacs/ChangeLog25
-rw-r--r--doc/emacs/emacs.texi5
-rw-r--r--doc/emacs/macos.texi89
-rw-r--r--doc/emacs/maintaining.texi374
-rw-r--r--doc/emacs/vc1-xtra.texi6
-rw-r--r--doc/lispref/ChangeLog30
-rw-r--r--doc/lispref/functions.texi2
-rw-r--r--doc/lispref/help.texi2
-rw-r--r--doc/lispref/nonascii.texi7
-rw-r--r--doc/lispref/numbers.texi8
-rw-r--r--doc/lispref/objects.texi1
-rw-r--r--doc/lispref/strings.texi63
-rw-r--r--doc/lispref/symbols.texi2
-rw-r--r--doc/lispref/text.texi31
-rw-r--r--doc/lispref/variables.texi18
-rw-r--r--doc/misc/ChangeLog5
-rw-r--r--doc/misc/nxml-mode.texi59
-rw-r--r--etc/ChangeLog4
-rw-r--r--etc/HELLO1
-rw-r--r--etc/NEWS.2360
-rw-r--r--lib-src/ChangeLog5
-rw-r--r--lib-src/ebrowse.c5
-rw-r--r--lisp/ChangeLog122
-rw-r--r--lisp/ChangeLog.138
-rw-r--r--lisp/dired.el8
-rw-r--r--lisp/emacs-lisp/smie.el120
-rw-r--r--lisp/gnus/ChangeLog5
-rw-r--r--lisp/gnus/pop3.el19
-rw-r--r--lisp/locate.el14
-rw-r--r--lisp/lpr.el18
-rw-r--r--lisp/mail/rmail.el54
-rw-r--r--lisp/mail/rmailmm.el367
-rw-r--r--lisp/mail/rmailsum.el22
-rw-r--r--lisp/net/tramp.el14
-rw-r--r--lisp/progmodes/python.el52
-rw-r--r--lisp/progmodes/which-func.el8
-rw-r--r--lisp/vc/log-edit.el7
-rw-r--r--src/ChangeLog36
-rw-r--r--src/alloc.c11
-rw-r--r--src/charset.c6
-rw-r--r--src/charset.h2
-rw-r--r--src/coding.c20
-rw-r--r--src/editfns.c4
-rw-r--r--src/gtkutil.c31
-rw-r--r--src/lread.c8
46 files changed, 1234 insertions, 530 deletions
diff --git a/admin/notes/bugtracker b/admin/notes/bugtracker
index 902067011b0..7c6c0ff4272 100644
--- a/admin/notes/bugtracker
+++ b/admin/notes/bugtracker
@@ -475,8 +475,8 @@ http://lists.gnu.org/archive/html/emacs-devel/2009-11/msg00440.html
475** Bazaar stuff 475** Bazaar stuff
476 476
477*** You can use `bzr commit --fixes debbugs:123' to mark that a commit fixes 477*** You can use `bzr commit --fixes debbugs:123' to mark that a commit fixes
478Emacs bug 123. You will first need to add a line to your ~/bazaar.conf 478Emacs bug 123. You will first need to add a line to one of your
479or ~/locations.conf: 479configuration files, ~/.bazaar/bazaar.conf or ~/.bazaar/locations.conf:
480 480
481bugtracker_debbugs_url = http://debbugs.gnu.org/{id} 481bugtracker_debbugs_url = http://debbugs.gnu.org/{id}
482 482
@@ -491,7 +491,7 @@ In the locations.conf file, it should go into the branch-specific
491configuration section for the branch where you want this to be in 491configuration section for the branch where you want this to be in
492effect. For example, if you want this to be in effect for the branch 492effect. For example, if you want this to be in effect for the branch
493located at `/home/projects/emacs/trunk', you need to have this in your 493located at `/home/projects/emacs/trunk', you need to have this in your
494~/locations.conf file: 494~/.bazaar/locations.conf file:
495 495
496[/home/projects/emacs/trunk] 496[/home/projects/emacs/trunk]
497bugtracker_debbugs_url = http://debbugs.gnu.org/{id} 497bugtracker_debbugs_url = http://debbugs.gnu.org/{id}
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index cb243825d5d..e390c6cbc16 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,28 @@
12010-11-27 Bob Rogers <rogers-emacs@rgrjr.dyndns.org>
2
3 * maintaining.texi (VC With A Locking VCS, VC Directory Commands):
4 * vc1-xtra.texi (Customizing VC, General VC Options): Small fixes.
5
62010-11-27 Chong Yidong <cyd@stupidchicken.com>
7
8 * maintaining.texi (Version Control Systems): Fix repeated sentence.
9 Suggested by Štěpán Němec.
10
112010-11-27 Chong Yidong <cyd@stupidchicken.com>
12
13 * maintaining.texi (Version Control): Say "commit", not "check in".
14 (Version Control Systems): Simplify descriptions.
15 (VCS Merging, VCS Changesets, VCS Repositories): New nodes, split from
16 VCS Concepts.
17 (VC Mode Line): Update example.
18 (Old Revisions): Document revert-buffer for vc-diff.
19 (Log Buffer): Promote to a subsection. Document header lines.
20
21 * macos.texi (Mac / GNUstep Basics): Document
22 ns-right-alternate-modifier.
23
24 * emacs.texi (Top): Update node listing.
25
12010-11-13 Eli Zaretskii <eliz@gnu.org> 262010-11-13 Eli Zaretskii <eliz@gnu.org>
2 27
3 * rmail.texi (Rmail Coding): Characters with no fonts are not 28 * rmail.texi (Rmail Coding): Characters with no fonts are not
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi
index 1ece1ea6dd8..65a565dbe8e 100644
--- a/doc/emacs/emacs.texi
+++ b/doc/emacs/emacs.texi
@@ -771,6 +771,7 @@ Version Control
771* Introduction to VC:: How version control works in general. 771* Introduction to VC:: How version control works in general.
772* VC Mode Line:: How the mode line shows version control status. 772* VC Mode Line:: How the mode line shows version control status.
773* Basic VC Editing:: How to edit a file under version control. 773* Basic VC Editing:: How to edit a file under version control.
774* Log Buffer:: Features available in log entry buffers.
774* Old Revisions:: Examining and comparing old versions. 775* Old Revisions:: Examining and comparing old versions.
775* Secondary VC Commands:: The commands used a little less frequently. 776* Secondary VC Commands:: The commands used a little less frequently.
776* VC Directory Mode:: Listing files managed by version control. 777* VC Directory Mode:: Listing files managed by version control.
@@ -785,6 +786,9 @@ Introduction to Version Control
785* Why Version Control?:: Understanding the problems it addresses. 786* Why Version Control?:: Understanding the problems it addresses.
786* Version Control Systems:: Supported version control back-end systems. 787* Version Control Systems:: Supported version control back-end systems.
787* VCS Concepts:: Words and concepts related to version control. 788* VCS Concepts:: Words and concepts related to version control.
789* VCS Merging:: How file conflicts are handled.
790* VCS Changesets:: Changesets in version control.
791* VCS Repositories:: Where version control repositories are stored.
788* Types of Log File:: The VCS log in contrast to the ChangeLog. 792* Types of Log File:: The VCS log in contrast to the ChangeLog.
789 793
790Basic Editing under Version Control 794Basic Editing under Version Control
@@ -792,7 +796,6 @@ Basic Editing under Version Control
792* VC With A Merging VCS:: Without locking: default mode for CVS. 796* VC With A Merging VCS:: Without locking: default mode for CVS.
793* VC With A Locking VCS:: RCS in its default mode, SCCS, and optionally CVS. 797* VC With A Locking VCS:: RCS in its default mode, SCCS, and optionally CVS.
794* Advanced C-x v v:: Advanced features available with a prefix argument. 798* Advanced C-x v v:: Advanced features available with a prefix argument.
795* Log Buffer:: Features available in log entry buffers.
796 799
797The Secondary Commands of VC 800The Secondary Commands of VC
798 801
diff --git a/doc/emacs/macos.texi b/doc/emacs/macos.texi
index 6fa5666ba6f..044a722a07a 100644
--- a/doc/emacs/macos.texi
+++ b/doc/emacs/macos.texi
@@ -8,23 +8,22 @@
8@cindex Macintosh 8@cindex Macintosh
9@cindex GNUstep 9@cindex GNUstep
10 10
11 This section briefly describes the peculiarities of using Emacs built with 11 This section describes the peculiarities of using Emacs built with
12the GNUstep libraries on GNU/Linux or other operating systems, or on Mac OS X 12the GNUstep libraries on GNU/Linux or other operating systems, or on
13with native window system support. For Mac OS X, Emacs can be built either 13Mac OS X with native window system support. On Mac OS X, Emacs can be
14without window system support, with X11, or with the Cocoa interface. This 14built either without window system support, with X11, or with the
15section only applies to the Cocoa build. Emacs 23 does not support Mac OS 15Cocoa interface; this section only applies to the Cocoa build. Emacs
16Classic. 16does not support earlier versions of Mac OS.
17 17
18 Emacs, when built on Mac OS X, uses the Cocoa application interface. For 18 For various historical and technical reasons, Emacs uses the term
19various historical and technical reasons, Emacs uses the term @samp{Nextstep} 19@samp{Nextstep} internally, instead of ``Cocoa'' or ``Mac OS X''; for
20internally, instead of ``Cocoa'' or ``Mac OS X''; for instance, most of the 20instance, most of the commands and variables described in this section
21commands and variables described in the following sections begin with 21begin with @samp{ns-}, which is short for @samp{Nextstep}. NeXTstep
22@samp{ns-}, which is short for @samp{Nextstep}. NeXTstep was an application 22was an application interface released by NeXT Inc during the 1980s, of
23interface released by NeXT Inc during the 1980s, of which Cocoa is a direct 23which Cocoa is a direct descendant. Apart from Cocoa, there is
24descendant. Apart from Cocoa, there is another NeXTstep-style system: 24another NeXTstep-style system: GNUstep, which is free software. As of
25GNUstep, which is free software. As of this writing, the GNUstep support is 25this writing, the GNUstep support is alpha status (@pxref{GNUstep
26alpha status (@pxref{GNUstep Support}), but we hope to improve it in the 26Support}), but we hope to improve it in the future.
27future.
28 27
29@menu 28@menu
30* Mac / GNUstep Basics:: Basic Emacs usage under GNUstep or Mac OS. 29* Mac / GNUstep Basics:: Basic Emacs usage under GNUstep or Mac OS.
@@ -37,19 +36,24 @@ future.
37@section Basic Emacs usage under Mac OS and GNUstep 36@section Basic Emacs usage under Mac OS and GNUstep
38 37
39 By default, the @key{alt} and @key{option} keys are the same as 38 By default, the @key{alt} and @key{option} keys are the same as
40@key{Meta} when running under Mac OS. The Mac @key{Cmd} key is the 39@key{Meta}. The Mac @key{Cmd} key is the same as @key{Super}, and
41same as @key{Super}, and Emacs provides a set of keybindings using 40Emacs provides a set of keybindings using this modifier key that mimic
42this modifier key that mimic other Mac / GNUstep applications (@pxref{Mac / 41other Mac / GNUstep applications (@pxref{Mac / GNUstep Events}). You
43GNUstep Events}). You can change these bindings in the usual way (@pxref{Key 42can change these bindings in the usual way (@pxref{Key Bindings}).
44Bindings}). 43
45 44 The variable @code{ns-right-alternate-modifier} controls the
46 The standard Mac / GNUstep font and color panels are accessible via Lisp commands. 45behavior of the right @key{alt} and @key{option} keys. These keys
47 To use the color panel, drag from it to an Emacs frame to change the 46behave like the left-hand keys if the value is @code{left} (the
48foreground color of the face at that position (if the @key{shift} key 47default). A value of @code{control}, @code{meta}, @code{alt},
49is held down, it changes the background color instead). To discard the 48@code{super}, or @code{hyper} makes them behave like the corresponding
50settings, create a new frame and close the altered one. 49modifier keys; a value of @code{none} tells Emacs to ignore them.
51@c [unclear if the following holds.] 50
52@c To finalize the settings for either color or font, choose @samp{Save Options} in the @samp{Options} menu. 51 The standard Mac / GNUstep font and color panels are accessible via
52Lisp commands. To use the color panel, drag from it to an Emacs frame
53to change the foreground color of the face at that position (if the
54@key{shift} key is held down, it changes the background color
55instead). To discard the settings, create a new frame and close the
56altered one.
53 57
54 @key{S-Mouse-1} (i.e., clicking the left mouse button 58 @key{S-Mouse-1} (i.e., clicking the left mouse button
55while holding down the @key{Shift} key) adjusts the region to the 59while holding down the @key{Shift} key) adjusts the region to the
@@ -58,7 +62,7 @@ it does not pop up a menu for changing the default face, as
58@key{S-Mouse-1} normally does (@pxref{Temporary Face Changes}). This 62@key{S-Mouse-1} normally does (@pxref{Temporary Face Changes}). This
59change makes Emacs behave more like other Mac / GNUstep applications. 63change makes Emacs behave more like other Mac / GNUstep applications.
60 64
61 When you open or save files using the menus, or using the 65 When you open or save files using the menus, or using the
62@key{Cmd-o} and @key{Cmd-S} bindings, Emacs uses graphical file 66@key{Cmd-o} and @key{Cmd-S} bindings, Emacs uses graphical file
63dialogs to read file names. However, if you use the regular Emacs key 67dialogs to read file names. However, if you use the regular Emacs key
64sequences, such as @key{C-x C-f}, Emacs uses the minibuffer to read 68sequences, such as @key{C-x C-f}, Emacs uses the minibuffer to read
@@ -110,7 +114,7 @@ dragging will alter the foreground color. Shift dragging will alter the
110background color. 114background color.
111 115
112@c To make the changes permanent select the "Save Options" 116@c To make the changes permanent select the "Save Options"
113@c item in the "Options" menu, or run @code{menu-bar-options-save}. 117@c item in the "Options" menu, or run @code{menu-bar-options-save}.
114 118
115Useful in this context is the listing of all faces obtained by @key{M-x} 119Useful in this context is the listing of all faces obtained by @key{M-x}
116@code{list-faces-display}. 120@code{list-faces-display}.
@@ -193,7 +197,7 @@ font are stored in the variables @code{ns-input-font} and
193@code{ns-input-fontsize}, respectively. 197@code{ns-input-fontsize}, respectively.
194 198
195@item ns-power-off 199@item ns-power-off
196This event occurs when the user logs out and Emacs is still running, or when 200This event occurs when the user logs out and Emacs is still running, or when
197`Quit Emacs' is chosen from the application menu. 201`Quit Emacs' is chosen from the application menu.
198The default behavior is to save all file-visiting buffers. 202The default behavior is to save all file-visiting buffers.
199@end table 203@end table
@@ -208,26 +212,9 @@ and return the result as a string. You can also use the Lisp function
208services and receive the results back. Note that you may need to 212services and receive the results back. Note that you may need to
209restart Emacs to access newly-available services. 213restart Emacs to access newly-available services.
210 214
211
212@node GNUstep Support, , Mac / GNUstep Events, Mac OS / GNUstep 215@node GNUstep Support, , Mac / GNUstep Events, Mac OS / GNUstep
213@section GNUstep Support 216@section GNUstep Support
214 217
215Emacs can be built and run under GNUstep, however there are still some 218Emacs can be built and run under GNUstep, but there are still some
216issues to be addressed. Interested developers should contact 219issues to be addressed. Interested developers should contact
217@email{emacs-devel@@gnu.org}. 220@email{emacs-devel@@gnu.org}.
218
219@c Presumably no longer relevant since CANNOT_DUMP removed 2009-05-06:
220@ignore
221In particular, it may be necessary to run @samp{make bootstrap} with a
222plain X configuration, then @samp{make clean} and @samp{./configure
223--with-ns} followed by @samp{make install}.
224
225Currently CANNOT_DUMP is automatically enabled in GNUstep configurations,
226because the unex file(s) for GNUstep, mainly @samp{unexelf.c}, have not been
227updated yet with the ``zone'' code in and related to @samp{unexmacosx.c}.
228@end ignore
229
230
231@ignore
232 arch-tag: a822c2ab-4273-4997-927e-c153bb71dcf6
233@end ignore
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi
index b407f5b9c99..cf504b6be2a 100644
--- a/doc/emacs/maintaining.texi
+++ b/doc/emacs/maintaining.texi
@@ -24,20 +24,20 @@ programs.
24@section Version Control 24@section Version Control
25@cindex version control 25@cindex version control
26 26
27 A @dfn{version control system} is a package that can record multiple 27 A @dfn{version control system} is a program that can record multiple
28versions of a source file, storing information such as the creation 28versions of a source file, storing information such as the creation
29time of each version, who created it, and a description of what was 29time of each version, who made it, and a description of what was
30changed in that version. 30changed.
31 31
32 The Emacs version control interface is called VC. Its commands work 32 The Emacs version control interface is called @dfn{VC}. VC commands
33with several different version control systems; currently, it supports 33work with several different version control systems; currently, it
34GNU Arch, Bazaar, CVS, Git, Mercurial, Monotone, RCS, SCCS/CSSC, and 34supports GNU Arch, Bazaar, CVS, Git, Mercurial, Monotone, RCS,
35Subversion. Of these, the GNU project distributes CVS, GNU Arch, RCS, 35SCCS/CSSC, and Subversion. Of these, the GNU project distributes CVS,
36and Bazaar. 36Arch, RCS, and Bazaar.
37 37
38 VC is enabled automatically whenever you visit a file that is 38 VC is enabled automatically whenever you visit a file governed by a
39governed by a version control system. To disable VC entirely, set the 39version control system. To disable VC entirely, set the customizable
40customizable variable @code{vc-handled-backends} to @code{nil} 40variable @code{vc-handled-backends} to @code{nil}
41@iftex 41@iftex
42(@pxref{Customizing VC,,,emacs-xtra, Specialized Emacs Features}). 42(@pxref{Customizing VC,,,emacs-xtra, Specialized Emacs Features}).
43@end iftex 43@end iftex
@@ -49,6 +49,7 @@ customizable variable @code{vc-handled-backends} to @code{nil}
49* Introduction to VC:: How version control works in general. 49* Introduction to VC:: How version control works in general.
50* VC Mode Line:: How the mode line shows version control status. 50* VC Mode Line:: How the mode line shows version control status.
51* Basic VC Editing:: How to edit a file under version control. 51* Basic VC Editing:: How to edit a file under version control.
52* Log Buffer:: Features available in log entry buffers.
52* Old Revisions:: Examining and comparing old versions. 53* Old Revisions:: Examining and comparing old versions.
53* Secondary VC Commands:: The commands used a little less frequently. 54* Secondary VC Commands:: The commands used a little less frequently.
54* VC Directory Mode:: Listing files managed by version control. 55* VC Directory Mode:: Listing files managed by version control.
@@ -65,12 +66,13 @@ customizable variable @code{vc-handled-backends} to @code{nil}
65@subsection Introduction to Version Control 66@subsection Introduction to Version Control
66 67
67 VC allows you to use a version control system from within Emacs, 68 VC allows you to use a version control system from within Emacs,
68integrating the version control operations smoothly with editing. 69integrating the version control operations smoothly with editing. It
69Though VC cannot completely bridge the gaps between version control 70provides a uniform interface for common operations in many version
70systems with widely differing capabilities, it does provide a uniform 71control operations.
71interface to many version control operations. Regardless of which 72
72version control system is in use, you will be able to do basic 73 Some uncommon or intricate version control operations, such as
73operations in much the same way. 74altering repository settings, are not supported in VC. You should
75perform such tasks outside Emacs, e.g. via the command line.
74 76
75 This section provides a general overview of version control, and 77 This section provides a general overview of version control, and
76describes the version control systems that VC supports. You can skip 78describes the version control systems that VC supports. You can skip
@@ -81,6 +83,9 @@ you want to use.
81* Why Version Control?:: Understanding the problems it addresses. 83* Why Version Control?:: Understanding the problems it addresses.
82* Version Control Systems:: Supported version control back-end systems. 84* Version Control Systems:: Supported version control back-end systems.
83* VCS Concepts:: Words and concepts related to version control. 85* VCS Concepts:: Words and concepts related to version control.
86* VCS Merging:: How file conflicts are handled.
87* VCS Changesets:: How changes are grouped.
88* VCS Repositories:: Where version control repositories are stored.
84* Types of Log File:: The VCS log in contrast to the ChangeLog. 89* Types of Log File:: The VCS log in contrast to the ChangeLog.
85@end menu 90@end menu
86 91
@@ -112,8 +117,8 @@ vitally important form of communication among developers.
112@subsubsection Supported Version Control Systems 117@subsubsection Supported Version Control Systems
113 118
114@cindex back end (version control) 119@cindex back end (version control)
115 VC currently works with many different version control systems or 120 VC currently works with many different version control systems,
116@dfn{back ends}: 121which it refers to as @dfn{back ends}:
117 122
118@itemize @bullet 123@itemize @bullet
119 124
@@ -134,73 +139,60 @@ control system.
134@cindex RCS 139@cindex RCS
135@item 140@item
136RCS is the free version control system around which VC was initially 141RCS is the free version control system around which VC was initially
137built. Almost everything you can do with RCS can be done through VC. 142built. It is relatively primitive: it cannot be used over the
138However, you cannot use RCS over the network, and it only works at the 143network, and works at the level of individual files. Almost
139level of individual files rather than projects. 144everything you can do with RCS can be done through VC.
140 145
141@cindex CVS 146@cindex CVS
142@item 147@item
143CVS is the free version control system that was, until recently (circa 148CVS is the free version control system that was, until recently (circa
1442008), used by the majority of free software projects. Nowadays, it 1492008), used by the majority of free software projects. Nowadays, it
145is slowly being superseded by newer systems. CVS allows concurrent 150is slowly being superseded by newer systems. CVS allows concurrent
146multi-user development either locally or over the network. It lacks 151multi-user development either locally or over the network. Unlike
147support for atomic commits or file moving/renaming. VC supports all 152newer systems, it lacks support for atomic commits and file
148basic editing operations under CVS. For some less common tasks, you 153moving/renaming. VC supports all basic editing operations under CVS.
149still need to call CVS from the command line. Note also that before
150using CVS you must set up a repository, which is a subject too complex
151to treat here.
152 154
153@cindex SVN 155@cindex SVN
154@cindex Subversion 156@cindex Subversion
155@item 157@item
156Subversion (SVN) is a free version control system designed to be 158Subversion (SVN) is a free version control system designed to be
157similar to CVS but without its problems. It supports atomic commits 159similar to CVS but without its problems (e.g., it supports atomic
158of filesets, and versioning of directories, symbolic links, meta-data, 160commits of filesets, and versioning of directories, symbolic links,
159renames, copies, and deletes. 161meta-data, renames, copies, and deletes).
160 162
161@cindex GNU Arch 163@cindex GNU Arch
162@cindex Arch 164@cindex Arch
163@item 165@item
164GNU Arch is a version control system designed for distributed work. 166GNU Arch is one of the earliest @dfn{distributed} version control
165It differs in many ways from older systems like CVS and RCS. It 167systems (the other being Monotone). @xref{VCS Concepts}, for a
166provides different methods for interoperating between users, support 168description of distributed version control systems. It is no longer
167for offline operations, and good branching and merging features. It 169under active development, and has been deprecated in favor of Bazaar.
168also supports atomic commits of filesets and file moving/renaming. VC
169does not support all operations provided by GNU Arch, so you must
170sometimes invoke it from the command line.
171 170
172@cindex git 171@cindex git
173@item 172@item
174Git is a distributed version control system invented by Linus Torvalds to support 173Git is a distributed version control system originally invented by
175development of Linux (his kernel). It supports atomic commits of filesets and 174Linus Torvalds to support development of Linux (his kernel). VC
176file moving/renaming. One significant feature of git is that it 175supports many common git operations, but others, such as repository
177largely abolishes the notion of a single centralized repository; 176syncing, must be done from the command line.
178instead, each working copy of a git project is its own repository and
179coordination is done through repository-sync operations. VC supports
180most git operations, with the exception of news merges and repository
181syncing; these must be done from the command line.
182 177
183@cindex hg 178@cindex hg
184@cindex Mercurial 179@cindex Mercurial
185@item 180@item
186Mercurial (hg) is a distributed version control system broadly 181Mercurial (hg) is a distributed version control system broadly
187resembling GNU Arch and git, with atomic fileset commits and file 182resembling git. VC supports most Mercurial commands, with the
188moving/renaming. Like git, it is fully decentralized. VC supports 183exception of repository sync operations.
189most Mercurial commands, with the exception of repository sync
190operations; this needs to be done from the command line.
191 184
192@cindex bzr 185@cindex bzr
193@cindex Bazaar 186@cindex Bazaar
194@item 187@item
195Bazaar (bzr) is a distributed version control system that supports both 188Bazaar (bzr) is a distributed version control system that supports
196repository-based and distributed versioning, with atomic fileset 189both repository-based and distributed versioning. VC supports most
197commits and file moving/renaming. VC supports most basic editing 190basic editing operations under Bazaar.
198operations under Bazaar.
199@end itemize 191@end itemize
200 192
201 Previous versions of VC supported a version control system known as 193 Previous versions of VC supported a version control system known as
202Meta-CVS. This support has been dropped because of limited interest 194Meta-CVS. This support was dropped due to limited interest from users
203from users and developers. 195and developers.
204 196
205@node VCS Concepts 197@node VCS Concepts
206@subsubsection Concepts of Version Control 198@subsubsection Concepts of Version Control
@@ -216,11 +208,11 @@ as @dfn{log entries} that describe the changes made to each file.
216 208
217@cindex work file 209@cindex work file
218@cindex checking out files 210@cindex checking out files
219 A file @dfn{checked out} of a repository is called the @dfn{work 211 The copy of a version-controlled file that you actually edit is
220file}. You edit the work file and make changes in it, as you would 212called the @dfn{work file}. You can change each work file as you
221with an ordinary file. After you are done with a set of changes, you 213would an ordinary file. After you are done with a set of changes, you
222@dfn{check in} or @dfn{commit} the file; this records the changes in 214@dfn{commit} (or @dfn{check in}) the changes; this records the changes
223the repository, along with a log entry for those changes. 215in the repository, along with a descriptive log entry.
224 216
225@cindex revision 217@cindex revision
226@cindex revision ID 218@cindex revision ID
@@ -231,12 +223,15 @@ on the version control system; in the simplest case, it is just an
231integer. 223integer.
232 224
233 To go beyond these basic concepts, you will need to understand three 225 To go beyond these basic concepts, you will need to understand three
234aspects in which version control systems differ. 226aspects in which version control systems differ. As explained in the
235They can be locking-based or merging-based; they can be file-based or 227next three sections, they can be lock-based or merge-based; file-based
236changeset-based; and they can be centralized or decentralized. VC 228or changeset-based; and centralized or decentralized. VC handles all
237handles all these modes of operation, but it cannot hide the differences. 229these modes of operation, but it cannot hide the differences.
238 230
231@node VCS Merging
232@subsubsection Merge-based vs lock-based Version Control
239@cindex locking versus merging 233@cindex locking versus merging
234
240 A version control system typically has some mechanism to coordinate 235 A version control system typically has some mechanism to coordinate
241between users who want to change the same file. There are two ways to 236between users who want to change the same file. There are two ways to
242do this: merging and locking. 237do this: merging and locking.
@@ -244,8 +239,7 @@ do this: merging and locking.
244 In a version control system that uses merging, each user may check 239 In a version control system that uses merging, each user may check
245out and modify a work file at any time. The system lets you 240out and modify a work file at any time. The system lets you
246@dfn{merge} your work file, which may contain changes that have not 241@dfn{merge} your work file, which may contain changes that have not
247been checked in, with the latest changes that others have checked into 242been committed, with the latest changes that others have committed.
248the repository.
249 243
250 Older version control systems use a @dfn{locking} scheme instead. 244 Older version control systems use a @dfn{locking} scheme instead.
251Here, work files are normally read-only. To edit a file, you ask the 245Here, work files are normally read-only. To edit a file, you ask the
@@ -253,7 +247,7 @@ version control system to make it writable for you by @dfn{locking}
253it; only one user can lock a given file at any given time. This 247it; only one user can lock a given file at any given time. This
254procedure is analogous to, but different from, the locking that Emacs 248procedure is analogous to, but different from, the locking that Emacs
255uses to detect simultaneous editing of ordinary files 249uses to detect simultaneous editing of ordinary files
256(@pxref{Interlocking}). When you check in your changes, that unlocks 250(@pxref{Interlocking}). When you commit your changes, that unlocks
257the file, and the work file becomes read-only again. Other users may 251the file, and the work file becomes read-only again. Other users may
258then lock the file to make their own changes. 252then lock the file to make their own changes.
259 253
@@ -261,8 +255,8 @@ then lock the file to make their own changes.
261users try to modify the same file at the same time. Locking systems 255users try to modify the same file at the same time. Locking systems
262have @dfn{lock conflicts}; a user may try to check a file out and be 256have @dfn{lock conflicts}; a user may try to check a file out and be
263unable to because it is locked. In merging systems, @dfn{merge 257unable to because it is locked. In merging systems, @dfn{merge
264conflicts} happen when you check in a change to a file that conflicts 258conflicts} happen when you commit a change to a file that conflicts
265with a change checked in by someone else after your checkout. Both 259with a change committed by someone else after your checkout. Both
266kinds of conflict have to be resolved by human judgment and 260kinds of conflict have to be resolved by human judgment and
267communication. Experience has shown that merging is superior to 261communication. Experience has shown that merging is superior to
268locking, both in convenience to developers and in minimizing the 262locking, both in convenience to developers and in minimizing the
@@ -275,27 +269,33 @@ Distributed version control systems, such as GNU Arch, git, and
275Mercurial, are exclusively merging-based. 269Mercurial, are exclusively merging-based.
276 270
277 VC mode supports both locking and merging version control. The 271 VC mode supports both locking and merging version control. The
278terms ``checkin'' and ``checkout'' come from locking-based version 272terms ``commit'' and ``update'' are used in newer version control
279control systems; newer version control systems have slightly different 273systems; older lock-based systems use the terms ``check in'' and
280operations usually called ``commit'' and ``update'', but VC hides the 274``check out''. VC hides the differences between them as much as
281differences between them as much as possible. 275possible.
276
277@node VCS Changesets
278@subsubsection Changeset-based vs File-based Version Control
282 279
283@cindex files versus changesets. 280@cindex changesets
284 On SCCS, RCS, CVS, and other early version control systems, version 281 On SCCS, RCS, CVS, and other early version control systems, version
285control operations are @dfn{file-based}: each file has its own comment 282control operations are @dfn{file-based}: each file has its own comment
286and revision history separate from that of all other files in the 283and revision history separate from that of all other files. Newer
287system. Later systems, beginning with Subversion, are 284systems, beginning with Subversion, are @dfn{changeset-based}: a
288@dfn{changeset-based}: a checkin may include changes to several files, 285checkin may include changes to several files, and the entire set of
289and the entire set of changes is treated as a unit by the system. Any 286changes is handled as a unit. Any comment associated with the change
290comment associated with the change does not belong to a single file, 287does not belong to a single file, but to the changeset itself.
291but to the changeset itself.
292 288
293 Changeset-based version control is more flexible and powerful than 289 Changeset-based version control is more flexible and powerful than
294file-based version control; usually, when a change to multiple files 290file-based version control; usually, when a change to multiple files
295has to be reversed, it's good to be able to easily identify and remove 291has to be reversed, it's good to be able to easily identify and remove
296all of it. 292all of it.
297 293
298@cindex centralized vs. decentralized version control 294@node VCS Repositories
295@subsubsection Decentralized vs Centralized Repositories
296
297@cindex centralized version control
298@cindex decentralized version control
299 Early version control systems were designed around a 299 Early version control systems were designed around a
300@dfn{centralized} model in which each project has only one repository 300@dfn{centralized} model in which each project has only one repository
301used by all developers. SCCS, RCS, CVS, and Subversion share this 301used by all developers. SCCS, RCS, CVS, and Subversion share this
@@ -306,14 +306,12 @@ point for reliability and efficiency.
306control, later implemented in git, Mercurial, and Bazaar. A project 306control, later implemented in git, Mercurial, and Bazaar. A project
307may have several different repositories, and these systems support a 307may have several different repositories, and these systems support a
308sort of super-merge between repositories that tries to reconcile their 308sort of super-merge between repositories that tries to reconcile their
309change histories. At the limit, each developer has his/her own 309change histories. In effect, there is one repository for each
310repository, and repository merges replace checkin/commit operations. 310developer, and repository merges take the place of commit operations.
311 311
312 VC's job is to help you manage the traffic between your personal 312 VC helps you manage the traffic between your personal workfiles and
313workfiles and a repository. Whether that repository is a single 313a repository. Whether the repository is a single master, or one of a
314master or one of a network of peer repositories is not something VC 314network of peer repositories, is not something VC has to care about.
315has to care about. Thus, the difference between a centralized and a
316decentralized version control system is invisible to VC mode.
317 315
318@node Types of Log File 316@node Types of Log File
319@subsubsection Types of Log File 317@subsubsection Types of Log File
@@ -323,9 +321,9 @@ decentralized version control system is invisible to VC mode.
323 321
324 Projects that use a version control system can have two types of log 322 Projects that use a version control system can have two types of log
325for changes. One is the log maintained by the version control system: 323for changes. One is the log maintained by the version control system:
326each time you check in a change, you fill out a @dfn{log entry} for 324each time you commit a change, you fill out a @dfn{log entry} for the
327the change (@pxref{Log Buffer}). This is called the @dfn{version 325change (@pxref{Log Buffer}). This is called the @dfn{version control
328control log}. 326log}.
329 327
330 The other kind of log is the file @file{ChangeLog} (@pxref{Change 328 The other kind of log is the file @file{ChangeLog} (@pxref{Change
331Log}). It provides a chronological record of all changes to a large 329Log}). It provides a chronological record of all changes to a large
@@ -365,32 +363,29 @@ change, and later use the @kbd{C-x v a} command to copy it to
365@cindex VC, mode line indicator 363@cindex VC, mode line indicator
366 364
367 When you visit a file that is under version control, Emacs indicates 365 When you visit a file that is under version control, Emacs indicates
368this on the mode line. For example, @samp{RCS-1.3} says that the RCS 366this on the mode line. For example, @samp{Bzr-1223} says that Bazaar
369back end is used for that file, and the current version of the file is 367is used for that file, and the current revision ID is 1223.
3701.3.
371
372 The first part of the VC mode-line indicator is the name of the back
373end: @samp{RCS}, @samp{CVS}, @samp{Bzr}, etc. The back-end name is
374followed by a single character and the version of the file.
375 368
376 The character between the back-end name and the revision ID 369 The character between the back-end name and the revision ID
377indicates the version control status of the file. @samp{-} means that 370indicates the status of the work file. In a merge-based version
378the work file is not locked (if locking is in use), or not modified (if 371control system, a @samp{-} character indicates that the work file is
379locking is not in use). @samp{:} indicates that the file is locked, or 372unmodified, and @samp{:} indicates that it has been modified.
380that it is modified. If the file is locked by some other user (for 373@samp{!} indicates that the file contains conflicts as result of a
374recent merge operation (@pxref{Merging}), or that the file was removed
375from the version control. Finally, @samp{?} means that the file is
376under version control, but is missing from the working tree.
377
378 In a lock-based system, @samp{-} indicates an unlocked file, and
379@samp{:} a locked file; if the file is locked by another user (for
381instance, @samp{jim}), that is displayed as @samp{RCS:jim:1.3}. 380instance, @samp{jim}), that is displayed as @samp{RCS:jim:1.3}.
382@samp{@@} means that the file was locally added, but not yet committed 381@samp{@@} means that the file was locally added, but not yet committed
383to the master repository. @samp{!} indicates that the file contains 382to the master repository.
384conflicts as result of a recent merge operation (@pxref{Merging}), or
385that the file was removed from the version control. Finally, @samp{?}
386means that the file is under version control, but is missing from the
387working tree.
388 383
389 On a graphical display, you can move the mouse over this mode line 384 On a graphical display, you can move the mouse over this mode line
390indicator to pop up a ``tool-tip'', which displays a more verbose 385indicator to pop up a ``tool-tip'', which displays a more verbose
391description of the version control status. Pressing @kbd{Mouse-1} 386description of the version control status. Pressing @kbd{Mouse-1}
392over the indicator pops up a menu of VC commands. This menu is 387over the indicator pops up a menu of VC commands, identical to
393identical to the @samp{Tools / Version Control} menu item. 388@samp{Tools / Version Control} on the menu bar.
394 389
395@vindex auto-revert-check-vc-info 390@vindex auto-revert-check-vc-info
396 When Auto Revert mode (@pxref{Reverting}) reverts a buffer that is 391 When Auto Revert mode (@pxref{Reverting}) reverts a buffer that is
@@ -442,12 +437,6 @@ command line. All files in a VC fileset must be under the same
442version control system; if they are not, Emacs signals an error when 437version control system; if they are not, Emacs signals an error when
443you attempt to execute a command on the fileset. 438you attempt to execute a command on the fileset.
444 439
445 Support for VC filesets and changeset-based version control systems
446is the main improvement to VC in Emacs 23. When you mark multi-file
447VC in a VC Directory buffer, VC operations treat them as a VC fileset,
448and operate on them all at once if the version control system is
449changeset-based. @xref{VC Directory Mode}.
450
451 VC filesets are distinct from the ``named filesets'' used for 440 VC filesets are distinct from the ``named filesets'' used for
452viewing and visiting files in functional groups (@pxref{Filesets}). 441viewing and visiting files in functional groups (@pxref{Filesets}).
453Unlike named filesets, VC filesets are not named and don't persist 442Unlike named filesets, VC filesets are not named and don't persist
@@ -457,7 +446,6 @@ across sessions.
457* VC With A Merging VCS:: Without locking: default mode for CVS. 446* VC With A Merging VCS:: Without locking: default mode for CVS.
458* VC With A Locking VCS:: RCS in its default mode, SCCS, and optionally CVS. 447* VC With A Locking VCS:: RCS in its default mode, SCCS, and optionally CVS.
459* Advanced C-x v v:: Advanced features available with a prefix argument. 448* Advanced C-x v v:: Advanced features available with a prefix argument.
460* Log Buffer:: Features available in log entry buffers.
461@end menu 449@end menu
462 450
463@node VC With A Merging VCS 451@node VC With A Merging VCS
@@ -490,9 +478,9 @@ If you have not changed the work file, but some other user has checked
490in changes to the repository, merge those changes into the work file. 478in changes to the repository, merge those changes into the work file.
491 479
492@item 480@item
493If you have made modifications to the work file, attempts to check in 481If you have made modifications to the work file, attempt to commit
494your changes. To do this, Emacs first reads the log entry for the new 482the changes. To do this, Emacs first reads the log entry for the new
495revision (@pxref{Log Buffer}). If some other user has checked in 483revision (@pxref{Log Buffer}). If some other user has committed
496changes to the repository since you last checked it out, the checkin 484changes to the repository since you last checked it out, the checkin
497fails. In that case, type @kbd{C-x v v} again to merge those changes 485fails. In that case, type @kbd{C-x v v} again to merge those changes
498into your own work file; this puts the work file into a ``conflicted'' 486into your own work file; this puts the work file into a ``conflicted''
@@ -507,8 +495,8 @@ trying to commit your own changes, type @kbd{C-x v m @key{RET}}.
507 495
508 These rules also apply when you use RCS in its ``non-locking'' mode, 496 These rules also apply when you use RCS in its ``non-locking'' mode,
509except that changes are not automatically merged from the repository. 497except that changes are not automatically merged from the repository.
510Nothing informs you if another user has checked in changes in the same 498Nothing informs you if another user has committed changes in the same
511file since you began editing it; when you check in your revision, his 499file since you began editing it; when you commit your revision, his
512changes are removed (however, they remain in the repository and are 500changes are removed (however, they remain in the repository and are
513thus not irrevocably lost). Therefore, you must verify that the 501thus not irrevocably lost). Therefore, you must verify that the
514current revision is unchanged before checking in your changes. In 502current revision is unchanged before checking in your changes. In
@@ -528,7 +516,7 @@ If the file is not locked, lock it and make it writable, so that you
528can change it. 516can change it.
529 517
530@item 518@item
531If the file is locked by you, and contains changes, check in the 519If the file is locked by you, and contains changes, commit the
532changes. In order to do this, Emacs first reads the log entry for the 520changes. In order to do this, Emacs first reads the log entry for the
533new revision. @xref{Log Buffer}. 521new revision. @xref{Log Buffer}.
534 522
@@ -544,12 +532,12 @@ locked the file, to inform him of what has happened.
544@end itemize 532@end itemize
545 533
546 These rules also apply when you use CVS in locking mode, except 534 These rules also apply when you use CVS in locking mode, except
547that there is no such thing as stealing a lock. 535that CVS does not support stealing a lock.
548 536
549@node Advanced C-x v v 537@node Advanced C-x v v
550@subsubsection Advanced Control in @kbd{C-x v v} 538@subsubsection Advanced Control in @kbd{C-x v v}
551 539
552@cindex revision ID to check in/out 540@cindex revision ID in version control
553 When you give a prefix argument to @code{vc-next-action} (@kbd{C-u 541 When you give a prefix argument to @code{vc-next-action} (@kbd{C-u
554C-x v v}), it still performs the next logical version control 542C-x v v}), it still performs the next logical version control
555operation, but accepts additional arguments to specify precisely how 543operation, but accepts additional arguments to specify precisely how
@@ -558,8 +546,8 @@ to do the operation.
558@itemize @bullet 546@itemize @bullet
559@item 547@item
560If the file is modified (or locked), you can specify the revision ID 548If the file is modified (or locked), you can specify the revision ID
561to use for the new version that you check in. This is one way 549to use for the new version that you commit. This is one way to create
562to create a new branch (@pxref{Branches}). 550a new branch (@pxref{Branches}).
563 551
564@item 552@item
565If the file is not modified (and unlocked), you can specify the 553If the file is not modified (and unlocked), you can specify the
@@ -585,34 +573,53 @@ Features}).
585@end itemize 573@end itemize
586 574
587@node Log Buffer 575@node Log Buffer
588@subsubsection Features of the Log Entry Buffer 576@subsection Features of the Log Entry Buffer
577
578 When you tell VC to commit a change, it pops up a buffer called
579@samp{*VC-Log*}. In this buffer, you should write a @dfn{log entry}
580describing the changes you have made (@pxref{Why Version Control?}).
581After you are done, type @kbd{C-c C-c}; this exits the buffer and
582commits the change, together with your log entry.
583
584 While in the @samp{*VC-Log*} buffer, you can write one or more
585@dfn{header lines}, specifying additional information to be supplied
586to the version control system. Each header line must occupy a single
587line at the top of the buffer; the first line that is not a header
588line is treated as the start of the log entry. For example, the
589following header line states that the present change was not written
590by you, but by another developer:
589 591
590 When you check in changes, Emacs pops up a buffer called 592@smallexample
591@samp{*VC-Log*} for you to enter a log entry. 593Author: J. R. Hacker <jrh@@example.com>
594@end smallexample
592 595
593 After you have finished editing the log message, type @kbd{C-c C-c} 596@noindent
594to exit the buffer and commit the change. 597Apart from the @samp{Author} header, Emacs recognizes the headers
598@samp{Date} (a manually-specified commit time) and @samp{Fixes} (a
599reference to a bug fixed by the change). Not all version control
600systems recognize all headers: Bazaar recognizes all three headers,
601while git, Mercurial, and Monotone recognizes only @samp{Author} and
602@samp{Summary}. If you specify a header for a version control that
603does not support it, the header is treated as part of the log entry.
595 604
596@findex log-edit-show-files 605@findex log-edit-show-files
597@findex log-edit-show-diff 606@findex log-edit-show-diff
598 In the @samp{*VC-Log*} buffer, typing @kbd{C-c C-f} 607 Type @kbd{C-c C-f} (@code{log-edit-show-files}) to display a list of
599(@code{log-edit-show-files}) displays a list of files in the VC 608files in the current VC fileset. If you called @kbd{C-x v v} directly
600fileset you are committing. If you called @kbd{C-x v v} directly from 609from a work file, the fileset consists of that single file; if you
601a work file, the VC fileset consists of that single file, so this 610called @kbd{C-x v v} from a VC directory buffer (@pxref{VC Directory
602command is not very useful. If you called @kbd{C-x v v} from a VC 611Mode}), the fileset may consist of multiple files.
603directory buffer, the VC fileset may consist of multiple files
604(@pxref{VC Directory Mode}).
605 612
606@findex log-edit-insert-changelog 613@findex log-edit-insert-changelog
607 Type @kbd{C-c C-d} (@code{log-edit-show-diff}) to show a ``diff'' of 614 Type @kbd{C-c C-d} (@code{log-edit-show-diff}) to show a @dfn{diff}
608the changes you have made (i.e., the differences between the work file 615of the changes you have made (i.e., the differences between the work
609and the repository revision from which you started editing the file). 616file and the repository revision from which you started editing).
610The diff is displayed in a special buffer in another window. 617@xref{Old Revisions}.
611@xref{Comparing Files}. 618
612 619 If the current VC fileset includes one or more @file{ChangeLog}
613 If you have written an entry in the @file{ChangeLog} (@pxref{Change 620files (@pxref{Change Log}), type @kbd{C-c C-a}
614Log}), type @kbd{C-c C-a} (@code{log-edit-insert-changelog}) to pull 621(@code{log-edit-insert-changelog}) to pull the relevant entries into
615it into the @samp{*VC-Log*} buffer. If the topmost item in the 622the @samp{*VC-Log*} buffer. If the topmost item in each
616@file{ChangeLog} was made under your user name on the current date, 623@file{ChangeLog} was made under your user name on the current date,
617this command searches that item for entries that match the file(s) to 624this command searches that item for entries that match the file(s) to
618be committed; if found, these entries are inserted. 625be committed; if found, these entries are inserted.
@@ -627,7 +634,7 @@ the revision control log.
627 634
628 To abort a check-in, just @strong{don't} type @kbd{C-c C-c} in that 635 To abort a check-in, just @strong{don't} type @kbd{C-c C-c} in that
629buffer. You can switch buffers and do other editing. As long as you 636buffer. You can switch buffers and do other editing. As long as you
630don't try to check in another file, the entry you were editing remains 637don't try to commit another file, the entry you were editing remains
631in the @samp{*VC-Log*} buffer, and you can go back to that buffer at 638in the @samp{*VC-Log*} buffer, and you can go back to that buffer at
632any time to complete the check-in. 639any time to complete the check-in.
633 640
@@ -636,7 +643,7 @@ convenient to specify the same log entry for many of the files. (This
636is the normal way to do things on a changeset-oriented system, where 643is the normal way to do things on a changeset-oriented system, where
637comments are attached to changesets rather than the history of 644comments are attached to changesets rather than the history of
638individual files.) The most convenient way to do this is to mark all 645individual files.) The most convenient way to do this is to mark all
639the files in VC Directory Mode and check in from there; the log buffer 646the files in VC Directory Mode and commit from there; the log buffer
640will carry the fileset information with it and do a group commit when 647will carry the fileset information with it and do a group commit when
641you type @kbd{C-c C-c}. 648you type @kbd{C-c C-c}.
642 649
@@ -648,7 +655,7 @@ work just like the minibuffer history commands (except that these
648versions are used outside the minibuffer). 655versions are used outside the minibuffer).
649 656
650@vindex vc-log-mode-hook 657@vindex vc-log-mode-hook
651 Each time you check in a change, the log entry buffer is put into VC 658 Each time you commit a change, the log entry buffer is put into VC
652Log Edit mode, which involves running two hooks: @code{text-mode-hook} 659Log Edit mode, which involves running two hooks: @code{text-mode-hook}
653and @code{vc-log-mode-hook}. @xref{Hooks}. 660and @code{vc-log-mode-hook}. @xref{Hooks}.
654 661
@@ -700,8 +707,12 @@ buffer in a separate window.
700 @kbd{C-x v =} (@code{vc-diff}) compares each file in the current VC 707 @kbd{C-x v =} (@code{vc-diff}) compares each file in the current VC
701fileset (saving them if necessary) with the repository revision(s) 708fileset (saving them if necessary) with the repository revision(s)
702from which you started editing. Note that the latter may or may not 709from which you started editing. Note that the latter may or may not
703be the latest revision of the file(s). The diff is displayed in a 710be the latest revision of the file(s).
704special buffer in another window. @xref{Comparing Files}. 711
712 The diff is displayed in another window, in a Diff mode buffer
713(@pxref{Diff Mode}) named @file{*vc-diff*}. In this buffer, the
714@kbd{g} (@code{revert-buffer}) command performs the file comparison
715again, generating a new diff.
705 716
706@findex vc-diff 717@findex vc-diff
707@kindex C-u C-x v = 718@kindex C-u C-x v =
@@ -1008,7 +1019,7 @@ then decide not to change it.
1008 1019
1009@kindex C-x v c 1020@kindex C-x v c
1010@findex vc-rollback 1021@findex vc-rollback
1011 To cancel a change that you already checked in, use @kbd{C-x v c} 1022 To cancel a change that you already committed, use @kbd{C-x v c}
1012(@code{vc-rollback}). This command discards all record of the most 1023(@code{vc-rollback}). This command discards all record of the most
1013recent checked-in revision, but only if your work file corresponds to 1024recent checked-in revision, but only if your work file corresponds to
1014that revision---you cannot use @kbd{C-x v c} to cancel a revision that 1025that revision---you cannot use @kbd{C-x v c} to cancel a revision that
@@ -1075,8 +1086,8 @@ output is used. Here is an example using CVS:
1075@noindent 1086@noindent
1076In this example, @samp{file1.c} is modified with respect to the 1087In this example, @samp{file1.c} is modified with respect to the
1077repository, and @samp{file2.c} is not. @samp{file3.c} is modified, 1088repository, and @samp{file2.c} is not. @samp{file3.c} is modified,
1078but other changes have also been checked in to the repository---you 1089but other changes have also been committed---you need to merge them
1079need to merge them with the work file before you can check it in. 1090with the work file before you can check it in.
1080 1091
1081@vindex vc-stay-local 1092@vindex vc-stay-local
1082@vindex vc-cvs-stay-local 1093@vindex vc-cvs-stay-local
@@ -1114,7 +1125,7 @@ this includes Version Control subdirectories such as @samp{RCS} and
1114 1125
1115 VC Directory mode has a full set of navigation and marking commands 1126 VC Directory mode has a full set of navigation and marking commands
1116for picking out filesets. Some of these are also available in a 1127for picking out filesets. Some of these are also available in a
1117context menu invoked by the @kbd{mouse-2} button. 1128context menu invoked by @kbd{mouse-2}.
1118 1129
1119 Up- and down-arrow keys move in the buffer; @kbd{n} and @kbd{p} also 1130 Up- and down-arrow keys move in the buffer; @kbd{n} and @kbd{p} also
1120move vertically as in other list-browsing modes. @key{SPC} and 1131move vertically as in other list-browsing modes. @key{SPC} and
@@ -1158,7 +1169,8 @@ directory buffer will be used.
1158 1169
1159 @kbd{M-s a C-s} does an incremental search on the marked files. 1170 @kbd{M-s a C-s} does an incremental search on the marked files.
1160 1171
1161 @kbd{M-s a C-M-s} does an incremental search on the marked files. 1172 @kbd{M-s a C-M-s} does an incremental regular expression search
1173on the marked files.
1162 1174
1163@cindex stashes in version control 1175@cindex stashes in version control
1164@cindex shelves in version control 1176@cindex shelves in version control
@@ -1174,11 +1186,11 @@ buffers. Some single-key shortcuts are available as well; @kbd{=},
1174@kbd{+}, @kbd{l}, @kbd{i}, and @kbd{v} behave as through prefixed with 1186@kbd{+}, @kbd{l}, @kbd{i}, and @kbd{v} behave as through prefixed with
1175@kbd{C-x v}. 1187@kbd{C-x v}.
1176 1188
1177 The command @kbd{C-x v v} (@code{vc-next-action}) operates on all the 1189 The command @kbd{C-x v v} (@code{vc-next-action}) operates on all
1178marked files, so that you can check in several files at once. 1190the marked files, so that you can commit several files at once. If
1179If the underlying VC supports atomic commits of multiple-file 1191the underlying VC supports atomic commits of multiple-file changesets,
1180changesets, @kbd{C-x v v} with a selected set of modified but not 1192@kbd{C-x v v} with a selected set of modified but not committed files
1181committed files will commit all of them at once as a single changeset. 1193will commit all of them at once as a single changeset.
1182 1194
1183 When @kbd{C-x v v} (@code{vc-next-action}) operates on multiple 1195 When @kbd{C-x v v} (@code{vc-next-action}) operates on multiple
1184files, all of those files must be either in the same state or in 1196files, all of those files must be either in the same state or in
@@ -1261,15 +1273,15 @@ other branch.
1261@node Creating Branches 1273@node Creating Branches
1262@subsubsection Creating New Branches 1274@subsubsection Creating New Branches
1263 1275
1264 To create a new branch from a head revision (one that is the latest in 1276 To create a new branch from a head revision (one that is the latest
1265the branch that contains it), first select that revision if necessary, 1277in the branch that contains it), first select that revision if
1266lock it with @kbd{C-x v v}, and make whatever changes you want. Then, 1278necessary, lock it with @kbd{C-x v v}, and make whatever changes you
1267when you check in the changes, use @kbd{C-u C-x v v}. This lets you 1279want. Then, when you commit the changes, use @kbd{C-u C-x v v}. This
1268specify the revision ID for the new revision. You should specify a 1280lets you specify the revision ID for the new revision. You should
1269suitable branch ID for a branch starting at the current revision. 1281specify a suitable branch ID for a branch starting at the current
1270For example, if the current revision is 2.5, the branch ID should be 1282revision. For example, if the current revision is 2.5, the branch ID
12712.5.1, 2.5.2, and so on, depending on the number of existing branches at 1283should be 2.5.1, 2.5.2, and so on, depending on the number of existing
1272that point. 1284branches at that point.
1273 1285
1274 To create a new branch at an older revision (one that is no longer the 1286 To create a new branch at an older revision (one that is no longer the
1275head of a branch), first select that revision (@pxref{Switching 1287head of a branch), first select that revision (@pxref{Switching
@@ -1282,11 +1294,11 @@ revision, that you really mean to create a new branch---if you say no,
1282you'll be offered a chance to lock the latest revision instead. On 1294you'll be offered a chance to lock the latest revision instead. On
1283a merging-based VCS you will skip this step. 1295a merging-based VCS you will skip this step.
1284 1296
1285 Then make your changes and type @kbd{C-x v v} again to check in a new 1297 Then make your changes and type @kbd{C-x v v} again to commit a new
1286revision. This automatically creates a new branch starting from the 1298revision. This automatically creates a new branch starting from the
1287selected revision. You need not specially request a new branch, because 1299selected revision. You need not specially request a new branch,
1288that's the only way to add a new revision at a point that is not the head 1300because that's the only way to add a new revision at a point that is
1289of a branch. 1301not the head of a branch.
1290 1302
1291 After the branch is created, you ``stay'' on it. That means that 1303 After the branch is created, you ``stay'' on it. That means that
1292subsequent check-ins create new revisions on that branch. To leave the 1304subsequent check-ins create new revisions on that branch. To leave the
@@ -1334,11 +1346,11 @@ type @kbd{C-x v v} to lock revision 1.5 so that you can change it. Next,
1334type @kbd{C-x v m 1.3.1 @key{RET}}. This takes the entire set of changes on 1346type @kbd{C-x v m 1.3.1 @key{RET}}. This takes the entire set of changes on
1335branch 1.3.1 (relative to revision 1.3, where the branch started, up to 1347branch 1.3.1 (relative to revision 1.3, where the branch started, up to
1336the last revision on the branch) and merges it into the current revision 1348the last revision on the branch) and merges it into the current revision
1337of the work file. You can now check in the changed file, thus creating 1349of the work file. You can now commit the changed file, thus creating
1338revision 1.6 containing the changes from the branch. 1350revision 1.6 containing the changes from the branch.
1339 1351
1340 It is possible to do further editing after merging the branch, before 1352 It is possible to do further editing after merging the branch, before
1341the next check-in. But it is usually wiser to check in the merged 1353the next check-in. But it is usually wiser to commit the merged
1342revision, then lock it and make the further changes. This will keep 1354revision, then lock it and make the further changes. This will keep
1343a better record of the history of changes. 1355a better record of the history of changes.
1344 1356
@@ -1374,7 +1386,7 @@ master file revision with user B's changes in it is 1.11.
1374 Then you can resolve the conflicts by editing the file manually. Or 1386 Then you can resolve the conflicts by editing the file manually. Or
1375you can type @code{M-x vc-resolve-conflicts} after visiting the file. 1387you can type @code{M-x vc-resolve-conflicts} after visiting the file.
1376This starts an Ediff session, as described above. Don't forget to 1388This starts an Ediff session, as described above. Don't forget to
1377check in the merged version afterwards. 1389commit the merged version afterwards.
1378 1390
1379@node Multi-User Branching 1391@node Multi-User Branching
1380@subsubsection Multi-User Branching 1392@subsubsection Multi-User Branching
diff --git a/doc/emacs/vc1-xtra.texi b/doc/emacs/vc1-xtra.texi
index 5095c3f4764..04d37719013 100644
--- a/doc/emacs/vc1-xtra.texi
+++ b/doc/emacs/vc1-xtra.texi
@@ -594,7 +594,7 @@ headers.
594@vindex vc-handled-backends 594@vindex vc-handled-backends
595The variable @code{vc-handled-backends} determines which version 595The variable @code{vc-handled-backends} determines which version
596control systems VC should handle. The default value is @code{(RCS CVS 596control systems VC should handle. The default value is @code{(RCS CVS
597SVN SCCS BZR GIT HG Arch)}, so it contains all the version systems 597SVN SCCS Bzr Git Hg Mtn Arch)}, so it contains all the version systems
598that are currently supported. If you want VC to ignore one or more of 598that are currently supported. If you want VC to ignore one or more of
599these systems, exclude its name from the list. To disable VC entirely, 599these systems, exclude its name from the list. To disable VC entirely,
600set this variable to @code{nil}. 600set this variable to @code{nil}.
@@ -657,8 +657,8 @@ variable does not affect @kbd{C-x v c}; that operation is so drastic
657that it should always ask for confirmation.) 657that it should always ask for confirmation.)
658 658
659@vindex vc-command-messages 659@vindex vc-command-messages
660 VC mode does much of its work by running the shell commands for RCS, 660 VC mode does much of its work by running the shell commands for the
661CVS and SCCS. If @code{vc-command-messages} is non-@code{nil}, VC 661appropriate backend. If @code{vc-command-messages} is non-@code{nil}, VC
662displays messages to indicate which shell commands it runs, and 662displays messages to indicate which shell commands it runs, and
663additional messages when the commands finish. 663additional messages when the commands finish.
664 664
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index d1c2d861eb7..c6d851f55ec 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,33 @@
12010-11-27 Chong Yidong <cyd@stupidchicken.com>
2
3 * nonascii.texi (Converting Representations): Document
4 byte-to-string.
5
6 * strings.texi (Creating Strings): Don't mention semi-obsolete
7 function char-to-string.
8 (String Conversion): Shorten discussion of semi-obsolete function
9 string-to-char. Link to Converting Representations.
10
11 * objects.texi (Symbol Type):
12 * text.texi (Near Point):
13 * help.texi (Help Functions):
14 * functions.texi (Mapping Functions): Use string instead of
15 char-to-string in examples.
16
172010-11-27 Chong Yidong <cyd@stupidchicken.com>
18
19 * text.texi (Kill Functions, Kill Functions)
20 (Low-Level Kill Ring, Low-Level Kill Ring): Remove obsolete
21 YANK-HANDLER args.
22
23 * symbols.texi (Creating Symbols): Using unintern without an
24 obarray arg is now obsolete.
25
26 * numbers.texi (Float Basics): Document float-e and float-pi.
27
28 * variables.texi (Defining Variables): Change "pi" example to
29 "float-pi".
30
12010-11-26 Eli Zaretskii <eliz@gnu.org> 312010-11-26 Eli Zaretskii <eliz@gnu.org>
2 32
3 * commands.texi (Click Events): Document the values of X, Y and 33 * commands.texi (Click Events): Document the values of X, Y and
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi
index 6f3fd63013c..635245426fb 100644
--- a/doc/lispref/functions.texi
+++ b/doc/lispref/functions.texi
@@ -818,7 +818,7 @@ length of @var{sequence}. For example:
818 @result{} (a c e) 818 @result{} (a c e)
819(mapcar '1+ [1 2 3]) 819(mapcar '1+ [1 2 3])
820 @result{} (2 3 4) 820 @result{} (2 3 4)
821(mapcar 'char-to-string "abc") 821(mapcar 'string "abc")
822 @result{} ("a" "b" "c") 822 @result{} ("a" "b" "c")
823@end group 823@end group
824 824
diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi
index d3e289578c0..f21e16e104a 100644
--- a/doc/lispref/help.texi
+++ b/doc/lispref/help.texi
@@ -546,7 +546,7 @@ follows:
546 546
547@smallexample 547@smallexample
548@group 548@group
549(define-key global-map (char-to-string help-char) 'help-command) 549(define-key global-map (string help-char) 'help-command)
550(fset 'help-command help-map) 550(fset 'help-command help-map)
551@end group 551@end group
552@end smallexample 552@end smallexample
diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi
index 40c78d97da7..1c196c93f27 100644
--- a/doc/lispref/nonascii.texi
+++ b/doc/lispref/nonascii.texi
@@ -199,6 +199,13 @@ unibyte string, it is returned unchanged. Use this function for
199characters. 199characters.
200@end defun 200@end defun
201 201
202@defun byte-to-string byte
203@cindex byte to string
204This function returns a unibyte string containing a single byte of
205character data, @var{character}. It signals a error if
206@var{character} is not an integer between 0 and 255.
207@end defun
208
202@defun multibyte-char-to-unibyte char 209@defun multibyte-char-to-unibyte char
203This converts the multibyte character @var{char} to a unibyte 210This converts the multibyte character @var{char} to a unibyte
204character, and returns that character. If @var{char} is neither 211character, and returns that character. If @var{char} is neither
diff --git a/doc/lispref/numbers.texi b/doc/lispref/numbers.texi
index 62b4796350e..e83da348e05 100644
--- a/doc/lispref/numbers.texi
+++ b/doc/lispref/numbers.texi
@@ -224,6 +224,14 @@ down to an integer.
224@end example 224@end example
225@end defun 225@end defun
226 226
227@defvar float-e
228The mathematical constant @math{e} (2.71828@dots{}).
229@end defvar
230
231@defvar float-pi
232The mathematical constant @math{pi} (3.14159@dots{}).
233@end defvar
234
227@node Predicates on Numbers 235@node Predicates on Numbers
228@section Type Predicates for Numbers 236@section Type Predicates for Numbers
229@cindex predicates for numbers 237@cindex predicates for numbers
diff --git a/doc/lispref/objects.texi b/doc/lispref/objects.texi
index c8ccb15a2d3..8f72cc01680 100644
--- a/doc/lispref/objects.texi
+++ b/doc/lispref/objects.texi
@@ -582,7 +582,6 @@ makes it invalid as a number.
582@group 582@group
583foo ; @r{A symbol named @samp{foo}.} 583foo ; @r{A symbol named @samp{foo}.}
584FOO ; @r{A symbol named @samp{FOO}, different from @samp{foo}.} 584FOO ; @r{A symbol named @samp{FOO}, different from @samp{foo}.}
585char-to-string ; @r{A symbol named @samp{char-to-string}.}
586@end group 585@end group
587@group 586@group
5881+ ; @r{A symbol named @samp{1+}} 5871+ ; @r{A symbol named @samp{1+}}
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi
index 1128ca87d8a..94d2765a833 100644
--- a/doc/lispref/strings.texi
+++ b/doc/lispref/strings.texi
@@ -126,9 +126,8 @@ This function returns a string made up of @var{count} repetitions of
126 @result{} "" 126 @result{} ""
127@end example 127@end example
128 128
129 Other functions to compare with this one include @code{char-to-string} 129 Other functions to compare with this one include @code{make-vector}
130(@pxref{String Conversion}), @code{make-vector} (@pxref{Vectors}), and 130(@pxref{Vectors}) and @code{make-list} (@pxref{Building Lists}).
131@code{make-list} (@pxref{Building Lists}).
132@end defun 131@end defun
133 132
134@defun string &rest characters 133@defun string &rest characters
@@ -565,38 +564,6 @@ of text characters and general input events
565(@code{single-key-description} and @code{text-char-description}). These 564(@code{single-key-description} and @code{text-char-description}). These
566are used primarily for making help messages. 565are used primarily for making help messages.
567 566
568@defun char-to-string character
569@cindex character to string
570This function returns a new string containing one character,
571@var{character}. This function is semi-obsolete because the function
572@code{string} is more general. @xref{Creating Strings}.
573@end defun
574
575@defun string-to-char string
576@cindex string to character
577 This function returns the first character in @var{string}. If the
578string is empty, the function returns 0. The value is also 0 when the
579first character of @var{string} is the null character, @acronym{ASCII} code
5800.
581
582@example
583(string-to-char "ABC")
584 @result{} 65
585
586(string-to-char "xyz")
587 @result{} 120
588(string-to-char "")
589 @result{} 0
590@group
591(string-to-char "\000")
592 @result{} 0
593@end group
594@end example
595
596This function may be eliminated in the future if it does not seem useful
597enough to retain.
598@end defun
599
600@defun number-to-string number 567@defun number-to-string number
601@cindex integer to string 568@cindex integer to string
602@cindex integer to decimal 569@cindex integer to decimal
@@ -659,19 +626,39 @@ this function returns 0.
659@code{string-to-int} is an obsolete alias for this function. 626@code{string-to-int} is an obsolete alias for this function.
660@end defun 627@end defun
661 628
629@defun char-to-string character
630@cindex character to string
631This function returns a new string containing one character,
632@var{character}. This function is semi-obsolete because the function
633@code{string} is more general. @xref{Creating Strings}.
634@end defun
635
636@defun string-to-char string
637 This function returns the first character in @var{string}. This
638mostly identical to @code{(aref string 0)}, except that it returns 0
639if the string is empty. (The value is also 0 when the first character
640of @var{string} is the null character, @acronym{ASCII} code 0.) This
641function may be eliminated in the future if it does not seem useful
642enough to retain.
643@end defun
644
662 Here are some other functions that can convert to or from a string: 645 Here are some other functions that can convert to or from a string:
663 646
664@table @code 647@table @code
665@item concat 648@item concat
666@code{concat} can convert a vector or a list into a string. 649This function converts a vector or a list into a string.
667@xref{Creating Strings}. 650@xref{Creating Strings}.
668 651
669@item vconcat 652@item vconcat
670@code{vconcat} can convert a string into a vector. @xref{Vector 653This function converts a string into a vector. @xref{Vector
671Functions}. 654Functions}.
672 655
673@item append 656@item append
674@code{append} can convert a string into a list. @xref{Building Lists}. 657This function converts a string into a list. @xref{Building Lists}.
658
659@item byte-to-string
660This function converts a byte of character data into a unibyte string.
661@xref{Converting Representations}.
675@end table 662@end table
676 663
677@node Formatting Strings 664@node Formatting Strings
diff --git a/doc/lispref/symbols.texi b/doc/lispref/symbols.texi
index 5bb44ff9675..ccf90e33cd0 100644
--- a/doc/lispref/symbols.texi
+++ b/doc/lispref/symbols.texi
@@ -383,7 +383,7 @@ See @code{documentation} in @ref{Accessing Documentation}, for another
383example using @code{mapatoms}. 383example using @code{mapatoms}.
384@end defun 384@end defun
385 385
386@defun unintern symbol &optional obarray 386@defun unintern symbol obarray
387This function deletes @var{symbol} from the obarray @var{obarray}. If 387This function deletes @var{symbol} from the obarray @var{obarray}. If
388@code{symbol} is not actually in the obarray, @code{unintern} does 388@code{symbol} is not actually in the obarray, @code{unintern} does
389nothing. If @var{obarray} is @code{nil}, the current obarray is used. 389nothing. If @var{obarray} is @code{nil}, the current obarray is used.
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index b6723a0bee4..45d358366de 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -87,7 +87,7 @@ buffer is @samp{@@}:
87 87
88@example 88@example
89@group 89@group
90(char-to-string (char-after 1)) 90(string (char-after 1))
91 @result{} "@@" 91 @result{} "@@"
92@end group 92@end group
93@end example 93@end example
@@ -122,9 +122,9 @@ but there is no peace.
122@end group 122@end group
123 123
124@group 124@group
125(char-to-string (preceding-char)) 125(string (preceding-char))
126 @result{} "a" 126 @result{} "a"
127(char-to-string (following-char)) 127(string (following-char))
128 @result{} "c" 128 @result{} "c"
129@end group 129@end group
130@end example 130@end example
@@ -866,7 +866,7 @@ adds it to the most recent element. It determines automatically (using
866@code{last-command}) whether the previous command was a kill command, 866@code{last-command}) whether the previous command was a kill command,
867and if so appends the killed text to the most recent entry. 867and if so appends the killed text to the most recent entry.
868 868
869@deffn Command kill-region start end &optional yank-handler 869@deffn Command kill-region start end
870This function kills the text in the region defined by @var{start} and 870This function kills the text in the region defined by @var{start} and
871@var{end}. The text is deleted but saved in the kill ring, along with 871@var{end}. The text is deleted but saved in the kill ring, along with
872its text properties. The value is always @code{nil}. 872its text properties. The value is always @code{nil}.
@@ -874,17 +874,10 @@ its text properties. The value is always @code{nil}.
874In an interactive call, @var{start} and @var{end} are point and 874In an interactive call, @var{start} and @var{end} are point and
875the mark. 875the mark.
876 876
877@c Emacs 19 feature
878If the buffer or text is read-only, @code{kill-region} modifies the kill 877If the buffer or text is read-only, @code{kill-region} modifies the kill
879ring just the same, then signals an error without modifying the buffer. 878ring just the same, then signals an error without modifying the buffer.
880This is convenient because it lets the user use a series of kill 879This is convenient because it lets the user use a series of kill
881commands to copy text from a read-only buffer into the kill ring. 880commands to copy text from a read-only buffer into the kill ring.
882
883If @var{yank-handler} is non-@code{nil}, this puts that value onto
884the string of killed text, as a @code{yank-handler} text property.
885@xref{Yanking}. Note that if @var{yank-handler} is @code{nil}, any
886@code{yank-handler} properties present on the killed text are copied
887onto the kill ring, like other text properties.
888@end deffn 881@end deffn
889 882
890@defopt kill-read-only-ok 883@defopt kill-read-only-ok
@@ -1069,7 +1062,7 @@ it returns the entry pointed at by the yanking pointer and does not
1069move the yanking pointer. 1062move the yanking pointer.
1070@end defun 1063@end defun
1071 1064
1072@defun kill-new string &optional replace yank-handler 1065@defun kill-new string &optional replace
1073This function pushes the text @var{string} onto the kill ring and 1066This function pushes the text @var{string} onto the kill ring and
1074makes the yanking pointer point to it. It discards the oldest entry 1067makes the yanking pointer point to it. It discards the oldest entry
1075if appropriate. It also invokes the value of 1068if appropriate. It also invokes the value of
@@ -1078,25 +1071,15 @@ if appropriate. It also invokes the value of
1078If @var{replace} is non-@code{nil}, then @code{kill-new} replaces the 1071If @var{replace} is non-@code{nil}, then @code{kill-new} replaces the
1079first element of the kill ring with @var{string}, rather than pushing 1072first element of the kill ring with @var{string}, rather than pushing
1080@var{string} onto the kill ring. 1073@var{string} onto the kill ring.
1081
1082If @var{yank-handler} is non-@code{nil}, this puts that value onto
1083the string of killed text, as a @code{yank-handler} property.
1084@xref{Yanking}. Note that if @var{yank-handler} is @code{nil}, then
1085@code{kill-new} copies any @code{yank-handler} properties present on
1086@var{string} onto the kill ring, as it does with other text properties.
1087@end defun 1074@end defun
1088 1075
1089@defun kill-append string before-p &optional yank-handler 1076@defun kill-append string before-p
1090This function appends the text @var{string} to the first entry in the 1077This function appends the text @var{string} to the first entry in the
1091kill ring and makes the yanking pointer point to the combined entry. 1078kill ring and makes the yanking pointer point to the combined entry.
1092Normally @var{string} goes at the end of the entry, but if 1079Normally @var{string} goes at the end of the entry, but if
1093@var{before-p} is non-@code{nil}, it goes at the beginning. This 1080@var{before-p} is non-@code{nil}, it goes at the beginning. This
1094function also invokes the value of @code{interprogram-cut-function} 1081function also invokes the value of @code{interprogram-cut-function}
1095(see below). This handles @var{yank-handler} just like 1082(see below).
1096@code{kill-new}, except that if @var{yank-handler} is different from
1097the @code{yank-handler} property of the first entry of the kill ring,
1098@code{kill-append} pushes the concatenated string onto the kill ring,
1099instead of replacing the original first entry with it.
1100@end defun 1083@end defun
1101 1084
1102@defvar interprogram-paste-function 1085@defvar interprogram-paste-function
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi
index a3a550868f5..20fe4dbc9fa 100644
--- a/doc/lispref/variables.texi
+++ b/doc/lispref/variables.texi
@@ -544,21 +544,23 @@ not the buffer-local value. (But you should not be making
544buffer-local bindings for a symbol that is defined with 544buffer-local bindings for a symbol that is defined with
545@code{defconst}.) 545@code{defconst}.)
546 546
547Here, @code{pi} is a constant that presumably ought not to be changed 547An example of the use of @code{defconst} is Emacs' definition of
548by anyone (attempts by the Indiana State Legislature notwithstanding). 548@code{float-pi}---the mathematical constant @math{pi}, which ought not
549As the second form illustrates, however, this is only advisory. 549to be changed by anyone (attempts by the Indiana State Legislature
550notwithstanding). As the second form illustrates, however,
551@code{defconst} is only advisory.
550 552
551@example 553@example
552@group 554@group
553(defconst pi 3.1415 "Pi to five places.") 555(defconst float-pi 3.141592653589793 "The value of Pi.")
554 @result{} pi 556 @result{} float-pi
555@end group 557@end group
556@group 558@group
557(setq pi 3) 559(setq float-pi 3)
558 @result{} pi 560 @result{} float-pi
559@end group 561@end group
560@group 562@group
561pi 563float-pi
562 @result{} 3 564 @result{} 3
563@end group 565@end group
564@end example 566@end example
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 38671f1410c..91ac5f74b0e 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,8 @@
12010-11-27 Glenn Morris <rgm@gnu.org>
2 James Clark <none@example.com>
3
4 * nxml-mode.texi (Introduction): New section.
5
12010-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org> 62010-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 7
3 * gnus.texi (Server Commands): Document gnus-server-show-server. 8 * gnus.texi (Server Commands): Document gnus-server-show-server.
diff --git a/doc/misc/nxml-mode.texi b/doc/misc/nxml-mode.texi
index 423bdc85a24..d076f0dd820 100644
--- a/doc/misc/nxml-mode.texi
+++ b/doc/misc/nxml-mode.texi
@@ -8,7 +8,8 @@
8This manual documents nxml-mode, an Emacs major mode for editing 8This manual documents nxml-mode, an Emacs major mode for editing
9XML with RELAX NG support. 9XML with RELAX NG support.
10 10
11Copyright @copyright{} 2007, 2008, 2009, 2010 Free Software Foundation, Inc. 11Copyright @copyright{} 2007, 2008, 2009, 2010
12Free Software Foundation, Inc.
12 13
13@quotation 14@quotation
14Permission is granted to copy, distribute and/or modify this document 15Permission is granted to copy, distribute and/or modify this document
@@ -43,6 +44,7 @@ license to the document, as described in section 6 of the license.
43This manual is not yet complete. 44This manual is not yet complete.
44 45
45@menu 46@menu
47* Introduction::
46* Completion:: 48* Completion::
47* Inserting end-tags:: 49* Inserting end-tags::
48* Paragraphs:: 50* Paragraphs::
@@ -52,6 +54,58 @@ This manual is not yet complete.
52* Limitations:: 54* Limitations::
53@end menu 55@end menu
54 56
57@node Introduction
58@chapter Introduction
59
60nXML mode is an Emacs major-mode for editing XML documents. It supports
61editing well-formed XML documents, and provides schema-sensitive editing
62using RELAX NG Compact Syntax. To get started, visit a file containing an
63XML document, and, if necessary, use @kbd{M-x nxml-mode} to switch to nXML
64mode. By default, @code{auto-mode-alist} and @code{magic-fallback-alist}
65put buffers in nXML mode if they have recognizable XML content or file
66extensions. You may wish to customize the settings, for example to
67recognize different file extensions.
68
69Once in nXML mode, you can type @kbd{C-h m} for basic information on the
70mode.
71
72The @file{etc/nxml} directory in the Emacs distribution contains some data
73files used by nXML mode, and includes two files (@file{test.valid.xml} and
74@file{test.invalid.xml}) that provide examples of valid and invalid XML
75documents.
76
77To get validation and schema-sensitive editing, you need a RELAX NG Compact
78Syntax (RNC) schema for your document (@pxref{Locating a schema}). The
79@file{etc/schema} directory includes some schemas for popular document
80types. See @url{http://relaxng.org/} for more information on RELAX NG.
81You can use the @samp{Trang} program from
82@url{http://www.thaiopensource.com/relaxng/trang.html} to
83automatically create RNC schemas. This program can:
84
85@itemize @bullet
86@item
87infer an RNC schema from an instance document;
88@item
89convert a DTD to an RNC schema;
90@item
91convert a RELAX NG XML syntax schema to an RNC schema.
92@end itemize
93
94@noindent To convert a RELAX NG XML syntax (@samp{.rng}) schema to a RNC
95one, you can also use the XSLT stylesheet from
96@url{http://www.pantor.com/download.html}.
97
98To convert a W3C XML Schema to an RNC schema, you need first to convert it
99to RELAX NG XML syntax using the RELAX NG converter tool @code{rngconv}
100(built on top of MSV). See @url{https://github.com/kohsuke/msv}
101and @url{https://msv.dev.java.net/}.
102
103For historical discussions only, see the mailing list archives at
104@url{http://groups.yahoo.com/group/emacs-nxml-mode/}. Please make all new
105discussions on the @samp{help-gnu-emacs} and @samp{emacs-devel} mailing
106lists. Report any bugs with @kbd{M-x report-emacs-bug}.
107
108
55@node Completion 109@node Completion
56@chapter Completion 110@chapter Completion
57 111
@@ -855,6 +909,3 @@ specification are not enforced.
855 909
856@bye 910@bye
857 911
858@ignore
859 arch-tag: 3b6e8ac2-ae8d-4f38-bd43-ce9f80be04d6
860@end ignore
diff --git a/etc/ChangeLog b/etc/ChangeLog
index e0f292812bf..03f2edb55b2 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,7 @@
12010-11-27 Ulrich Mueller <ulm@gentoo.org>
2
3 * HELLO: Add ancient Greek (Bug#7418).
4
12010-11-13 Eli Zaretskii <eliz@gnu.org> 52010-11-13 Eli Zaretskii <eliz@gnu.org>
2 6
3 * NEWS: Document display of glyphless characters. 7 * NEWS: Document display of glyphless characters.
diff --git a/etc/HELLO b/etc/HELLO
index f7320f7301f..5461d4cd7ef 100644
--- a/etc/HELLO
+++ b/etc/HELLO
@@ -33,6 +33,7 @@ French (fran,Ag(Bais) Bonjour / Salut
33Georgian ($,1JEJ0J@J7J5J4J:J8(B) $,1J2J0J;J0J@JOJ=J1J0(B 33Georgian ($,1JEJ0J@J7J5J4J:J8(B) $,1J2J0J;J0J@JOJ=J1J0(B
34German (Deutsch) Guten Tag / Gr,A|_(B Gott 34German (Deutsch) Guten Tag / Gr,A|_(B Gott
35Greek (,Fekkgmij\(B) ,FCei\(B ,Fsar(B 35Greek (,Fekkgmij\(B) ,FCei\(B ,Fsar(B
36Greek, ancient ($,1p1,Fkkgmij^(B) ,FO$,1pv,Fk](B ,Fte(B ,Fja$,1q6(B ,Fl]ca(B ,Fwa$,1r6,Fqe(B
36Gujarati ($,19W:!9\9p9~9d: (B) $,19h9n9x:-9d:'(B 37Gujarati ($,19W:!9\9p9~9d: (B) $,19h9n9x:-9d:'(B
37Hebrew $,1ro(B($,1-",q-(,y-*(B) ,Hylem(B 38Hebrew $,1ro(B($,1-",q-(,y-*(B) ,Hylem(B
38Hungarian (magyar) Sz,Bi(Bp j,Bs(B napot! 39Hungarian (magyar) Sz,Bi(Bp j,Bs(B napot!
diff --git a/etc/NEWS.23 b/etc/NEWS.23
index 0d37746d460..0608286e6d5 100644
--- a/etc/NEWS.23
+++ b/etc/NEWS.23
@@ -21,9 +21,6 @@ with a prefix argument or by typing C-u C-h C-n.
21 21
22* Changes in Emacs 23.3 22* Changes in Emacs 23.3
23 23
24** The nextstep port can have different modifiers for the left and right
25alt/option key by customizing the value for ns-right-alternate-modifier.
26
27 24
28* Editing Changes in Emacs 23.3 25* Editing Changes in Emacs 23.3
29 26
@@ -34,6 +31,42 @@ alt/option key by customizing the value for ns-right-alternate-modifier.
34** The appt-add command takes an optional argument for the warning time. 31** The appt-add command takes an optional argument for the warning time.
35This can be used in place of the default appt-message-warning-time. 32This can be used in place of the default appt-message-warning-time.
36 33
34---
35** You can allow inferior Python processes to load modules from the
36current directory by setting `python-remove-cwd-from-path' to nil.
37
38** VC and related modes
39
40*** New VC command `vc-log-incoming', bound to `C-x v I'.
41This shows a log of changes to be received with a pull operation.
42For Git, this runs "git fetch" to make the necessary data available
43locally; this requires version 1.7 or newer.
44
45*** New VC command `vc-log-outgoing', bound to `C-x v O'.
46This shows a log of changes to be sent in the next commit.
47
48*** New VC command vc-find-conflicted-file.
49
50+++
51*** The 'g' key in VC diff, log, log-incoming and log-outgoing buffers
52reruns the corresponding VC command to compute an up to date version
53of the buffer.
54
55*** vc-dir for Bzr supports viewing shelve contents and shelving snapshots.
56
57+++
58*** Special markup can be added to log-edit buffers.
59You can add headers specifying additional information to be supplied
60to the version control system. For example:
61
62 Author: J. R. Hacker <jrh@example.com>
63 Fixes: 4204
64 Actual text of log entry...
65
66Bazaar recognizes the headers "Author", "Date" and "Fixes".
67Git, Mercurial, and Monotone recognize "Author" and "Date".
68Any unknown header is left as is in the message, so it is not lost.
69
37** Obsolete packages 70** Obsolete packages
38 71
39+++ 72+++
@@ -41,10 +74,12 @@ This can be used in place of the default appt-message-warning-time.
41 74
42 75
43* New Modes and Packages in Emacs 23.3 76* New Modes and Packages in Emacs 23.3
77
44** smie.el is a generic navigation and indentation engine. 78** smie.el is a generic navigation and indentation engine.
45It takes a simple BNF description of the grammar, and provides both 79It takes a simple BNF description of the grammar, and provides both
46sexp-style navigation (jumping over begin..end pairs) as well as 80sexp-style navigation (jumping over begin..end pairs) as well as
47indentation, which can be adjusted via ad-hoc indentation rules. 81indentation, which can be adjusted via ad-hoc indentation rules.
82
48 83
49* Incompatible Lisp Changes in Emacs 23.3 84* Incompatible Lisp Changes in Emacs 23.3
50 85
@@ -55,16 +90,29 @@ starting from the first line of text below the header line.
55 90
56* Lisp changes in Emacs 23.3 91* Lisp changes in Emacs 23.3
57 92
93+++
58** `e' and `pi' are now called `float-e' and `float-pi'. 94** `e' and `pi' are now called `float-e' and `float-pi'.
59 The old names are obsolete. 95 The old names are obsolete.
60** The use of unintern without an obarray arg is declared obsolete. 96
61** The function `princ-list' is declared obsolete. 97+++
62** The yank-handler argument to kill-region and friends is declared obsolete. 98** The use of unintern without an obarray arg is now obsolete.
99
100---
101** The function `princ-list' is now obsolete.
102
103+++
104** The yank-handler argument to kill-region and friends is now obsolete.
105
106+++
63** New function byte-to-string, like char-to-string but for bytes. 107** New function byte-to-string, like char-to-string but for bytes.
64 108
65 109
66* Changes in Emacs 23.3 on non-free operating systems 110* Changes in Emacs 23.3 on non-free operating systems
67 111
112+++
113** The nextstep port can have different modifiers for the left and right
114alt/option key by customizing the value for ns-right-alternate-modifier.
115
68 116
69* Installation Changes in Emacs 23.2 117* Installation Changes in Emacs 23.2
70 118
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index d1745a893bf..160a19099a3 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,8 @@
12010-11-27 Joe Matarazzo <joe.matarazzo@gmail.com> (tiny change)
2
3 * ebrowse.c (yylex): If end of input buffer encountered while
4 searching for a newline after "//", return YYEOF. (Bug#7446)
5
12010-11-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 62010-11-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2 7
3 * emacsclient.c (set_local_socket) [DARWIN_OS]: Add fall-back 8 * emacsclient.c (set_local_socket) [DARWIN_OS]: Add fall-back
diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c
index 1fcbb8662f5..81067a90819 100644
--- a/lib-src/ebrowse.c
+++ b/lib-src/ebrowse.c
@@ -1700,6 +1700,11 @@ yylex (void)
1700 case '/': 1700 case '/':
1701 while (GET (c) && c != '\n') 1701 while (GET (c) && c != '\n')
1702 ; 1702 ;
1703 /* Don't try to read past the end of the input buffer if
1704 the file ends in a C++ comment without a newline. */
1705 if (c == 0)
1706 return YYEOF;
1707
1703 INCREMENT_LINENO; 1708 INCREMENT_LINENO;
1704 break; 1709 break;
1705 1710
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f26911298e3..8544b0e53d3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,113 @@
12010-11-27 Chong Yidong <cyd@stupidchicken.com>
2
3 * log-edit.el (log-edit-font-lock-keywords): Don't try matching
4 stand-alone lines, since that is handled by log-edit-match-to-eoh
5 (Bug#6465).
6
72010-11-27 Eduard Wiebe <usenet@pusto.de>
8
9 * dired.el (dired-get-filename): Replace backslashes with slashes
10 in file names on MS-Windows, needed by `locate'. (Bug#7308)
11 * locate.el (locate-default-make-command-line): Don't consider
12 drive letter and root directory part of
13 `directory-listing-before-filename-regexp'. (Bug#7308)
14 (locate-post-command-hook, locate-post-command-hook): New defcustoms.
15
162010-11-27 Stefan Monnier <monnier@iro.umontreal.ca>
17
18 * emacs-lisp/smie.el (smie-prec2->grammar): Simplify handling
19 of :smie-open/close-alist.
20 (smie-next-sexp): Make it accept a "start token" as argument.
21 (smie-indent-keyword): Be careful not to misidentify tokens that span
22 more than one line, as empty lines. Add argument `token'.
23
242010-11-27 Kenichi Handa <handa@m17n.org>
25
26 * mail/rmailmm.el (rmail-mime-insert-multipart): For unsupported
27 multipart subtypes, insert all as usual.
28
29 * mail/rmail.el: Require rfc2047.
30
312010-11-27 Kenichi Handa <handa@m17n.org>
32
33 * mail/rmailmm.el (rmail-mime-entity, rmail-mime-entity-type)
34 (rmail-mime-entity-disposition)
35 (rmail-mime-entity-transfer-encoding, rmail-mime-entity-header)
36 (rmail-mime-entity-body, rmail-mime-entity-children): New functions.
37 (rmail-mime-save): Handle the case that the button's `data' is a
38 MIME entity.
39 (rmail-mime-insert-text): New function.
40 (rmail-mime-insert-image): Handle the case that DATA is a MIME
41 entity.
42 (rmail-mime-bulk-handler): Just call rmail-mime-insert-bulk.
43 (rmail-mime-insert-bulk): New function mostly copied from the old
44 rmail-mime-bulk-handler.
45 (rmail-mime-multipart-handler): Just call
46 rmail-mime-process-multipart.
47 (rmail-mime-process-multipart): New funciton mostly copied from
48 the old rmail-mime-multipart-handler.
49 (rmail-mime-show): Just call rmail-mime-process.
50 (rmail-mime-process): New funciton mostly copied from the old
51 rmail-mime-show.
52 (rmail-mime-insert-multipart, rmail-mime-parse)
53 (rmail-mime-insert, rmail-show-mime)
54 (rmail-insert-mime-forwarded-message)
55 (rmail-insert-mime-resent-message): New functions.
56 (rmail-insert-mime-forwarded-message-function): Set to
57 rmail-insert-mime-forwarded-message.
58 (rmail-insert-mime-resent-message-function): Set to
59 rmail-insert-mime-resent-message.
60
61 * mail/rmailsum.el: Require rfc2047.
62 (rmail-header-summary): Handle multiline Subject: field.
63 (rmail-summary-line-decoder): Change the default to
64 rfc2047-decode-string.
65
66 * mail/rmail.el (rmail-enable-mime): Change the default to t.
67 (rmail-mime-feature): Change the default to `rmailmm'.
68 (rmail-quit): Delete the specifal code for rmail-enable-mime.
69 (rmail-display-labels): Likewise.
70 (rmail-show-message-1): Check rmail-enable-mime, and use
71 rmail-show-mime-function for a MIME message. Decode the headers
72 according to RFC2047.
73
742010-11-27 Stefan Monnier <monnier@iro.umontreal.ca>
75
76 * progmodes/which-func.el (which-func-imenu-joiner-function):
77 Return a string, as expected.
78 (which-function-mode): Make sure we stop any previous timer before
79 starting a new one.
80
812010-11-27 Michael Albinus <michael.albinus@gmx.de>
82
83 * net/tramp.el (tramp-default-method-alist)
84 (tramp-default-user-alist, tramp-default-proxies-alist):
85 Adapt custom options type. (Bug#7445)
86
872010-11-27 Chong Yidong <cyd@stupidchicken.com>
88
89 * progmodes/python.el: Add Ipython support (Bug#5390).
90 (python-shell-prompt-alist)
91 (python-shell-continuation-prompt-alist): New options.
92 (python--set-prompt-regexp): New function.
93 (inferior-python-mode, run-python, python-shell):
94 Require ansi-color. Use python--set-prompt-regexp to set the comint
95 prompt based on the Python interpreter.
96 (python--prompt-regexp): New var.
97 (python-check-comint-prompt)
98 (python-comint-output-filter-function): Use it.
99 (run-python): Use a pipe (Bug#5694).
100
1012010-11-27 Chong Yidong <cyd@stupidchicken.com>
102
103 * progmodes/python.el (run-python): Doc fix.
104 (python-keep-current-directory-in-path): New var (Bug#7454).
105
1062010-11-27 Chong Yidong <cyd@stupidchicken.com>
107
108 * lpr.el (lpr-buffer, print-buffer, lpr-region, print-region):
109 Prompt user before actually printing.
110
12010-11-27 Eli Zaretskii <eliz@gnu.org> 1112010-11-27 Eli Zaretskii <eliz@gnu.org>
2 112
3 * international/characters.el (glyphless-char-display-control): 113 * international/characters.el (glyphless-char-display-control):
@@ -227,7 +337,8 @@
2272010-11-18 Stefan Monnier <monnier@iro.umontreal.ca> 3372010-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
228 338
229 * simple.el (kill-new, kill-append, kill-region): 339 * simple.el (kill-new, kill-append, kill-region):
230 * comint.el (comint-kill-region): Make the yank-handler argument obsolete. 340 * comint.el (comint-kill-region): Make the yank-handler argument
341 obsolete.
231 342
2322010-11-18 Stefan Monnier <monnier@iro.umontreal.ca> 3432010-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
233 344
@@ -6074,7 +6185,7 @@
6074 * vc/vc-annotate.el (vc-annotate): Add an optional argument for the 6185 * vc/vc-annotate.el (vc-annotate): Add an optional argument for the
6075 VC backend. Use it when non-nil. 6186 VC backend. Use it when non-nil.
6076 (vc-annotate-warp-revision): Pass the VC backend to vc-annotate. 6187 (vc-annotate-warp-revision): Pass the VC backend to vc-annotate.
6077 (Bug#6487) 6188 (Bug#6487).
6078 6189
6079 Fix vc-annotate-show-changeset-diff-revision-at-line for git. 6190 Fix vc-annotate-show-changeset-diff-revision-at-line for git.
6080 * vc/vc-annotate.el (vc-annotate-show-diff-revision-at-line-internal): 6191 * vc/vc-annotate.el (vc-annotate-show-diff-revision-at-line-internal):
@@ -9735,7 +9846,8 @@
9735 9846
97362010-02-06 Dan Nicolaescu <dann@ics.uci.edu> 98472010-02-06 Dan Nicolaescu <dann@ics.uci.edu>
9737 9848
9738 * vc-bzr.el (vc-bzr-dir-extra-headers): Disable the pending merges header. 9849 * vc-bzr.el (vc-bzr-dir-extra-headers):
9850 Disable the pending merges header.
9739 9851
97402010-02-05 Juri Linkov <juri@jurta.org> 98522010-02-05 Juri Linkov <juri@jurta.org>
9741 9853
@@ -10624,8 +10736,8 @@
106242009-12-18 Ulf Jasper <ulf.jasper@web.de> 107362009-12-18 Ulf Jasper <ulf.jasper@web.de>
10625 10737
10626 * calendar/icalendar.el (icalendar--convert-tz-offset): 10738 * calendar/icalendar.el (icalendar--convert-tz-offset):
10627 Fix timezone names. 10739 Fixed timezone names.
10628 (icalendar--convert-tz-offset): Fix the "last-day-problem". 10740 (icalendar--convert-tz-offset): Fixed the "last-day-problem".
10629 (icalendar--add-diary-entry): Remove the trailing blank that 10741 (icalendar--add-diary-entry): Remove the trailing blank that
10630 diary-make-entry inserts. 10742 diary-make-entry inserts.
10631 10743
diff --git a/lisp/ChangeLog.13 b/lisp/ChangeLog.13
index fa82dc2fc63..d8ec37390f1 100644
--- a/lisp/ChangeLog.13
+++ b/lisp/ChangeLog.13
@@ -6680,8 +6680,9 @@
6680 buffer if the parent buffer is in vc-dired-mode. 6680 buffer if the parent buffer is in vc-dired-mode.
6681 6681
66822007-11-23 Mark A. Hershberger <mah@everybody.org> 66822007-11-23 Mark A. Hershberger <mah@everybody.org>
6683 James Clark <none@example.com>
6683 6684
6684 * nxml: Initial merge of nxml. Kept nxml/char-name subdir for now. 6685 * nxml/: Initial merge of nxml. Kept nxml/char-name subdir for now.
6685 6686
66862007-11-23 Juri Linkov <juri@jurta.org> 66872007-11-23 Juri Linkov <juri@jurta.org>
6687 6688
@@ -16693,10 +16694,9 @@ See ChangeLog.12 for earlier changes.
16693 16694
16694;; Local Variables: 16695;; Local Variables:
16695;; coding: utf-8 16696;; coding: utf-8
16696;; add-log-time-zone-rule: t
16697;; End: 16697;; End:
16698 16698
16699 Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. 16699 Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
16700 16700
16701 This file is part of GNU Emacs. 16701 This file is part of GNU Emacs.
16702 16702
@@ -16712,5 +16712,3 @@ See ChangeLog.12 for earlier changes.
16712 16712
16713 You should have received a copy of the GNU General Public License 16713 You should have received a copy of the GNU General Public License
16714 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. 16714 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
16715
16716;; arch-tag: 1e8aa93a-fc6c-4ac3-9b10-1f445e1840af
diff --git a/lisp/dired.el b/lisp/dired.el
index bd3fb531d77..104cf4970ad 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2011,6 +2011,14 @@ Otherwise, an error occurs in these cases."
2011 ;; with quotation marks in their names. 2011 ;; with quotation marks in their names.
2012 (while (string-match "\\(?:[^\\]\\|\\`\\)\\(\"\\)" file) 2012 (while (string-match "\\(?:[^\\]\\|\\`\\)\\(\"\\)" file)
2013 (setq file (replace-match "\\\"" nil t file 1))) 2013 (setq file (replace-match "\\\"" nil t file 1)))
2014
2015 (when (eq system-type 'windows-nt)
2016 (save-match-data
2017 (let ((start 0))
2018 (while (string-match "\\\\" file start)
2019 (aset file (match-beginning 0) ?/)
2020 (setq start (match-end 0))))))
2021
2014 (setq file (read (concat "\"" file "\""))) 2022 (setq file (read (concat "\"" file "\"")))
2015 ;; The above `read' will return a unibyte string if FILE 2023 ;; The above `read' will return a unibyte string if FILE
2016 ;; contains eight-bit-control/graphic characters. 2024 ;; contains eight-bit-control/graphic characters.
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el
index 179e0a9f094..a7021b3cf7b 100644
--- a/lisp/emacs-lisp/smie.el
+++ b/lisp/emacs-lisp/smie.el
@@ -76,8 +76,6 @@
76 76
77;; TODO & BUGS: 77;; TODO & BUGS:
78;; 78;;
79;; - FIXME: I think the behavior on empty lines is wrong. It shouldn't
80;; look at the next token on subsequent lines.
81;; - Using the structural information SMIE gives us, it should be possible to 79;; - Using the structural information SMIE gives us, it should be possible to
82;; implement a `smie-align' command that would automatically figure out what 80;; implement a `smie-align' command that would automatically figure out what
83;; there is to align and how to do it (something like: align the token of 81;; there is to align and how to do it (something like: align the token of
@@ -470,7 +468,7 @@ PREC2 is a table as returned by `smie-precs->prec2' or
470 (to (cdar eqs))) 468 (to (cdar eqs)))
471 (setq eqs (cdr eqs)) 469 (setq eqs (cdr eqs))
472 (if (eq to from) 470 (if (eq to from)
473 nil ;Nothing to do. 471 nil ;Nothing to do.
474 (dolist (other-eq eqs) 472 (dolist (other-eq eqs)
475 (if (eq from (cdr other-eq)) (setcdr other-eq to)) 473 (if (eq from (cdr other-eq)) (setcdr other-eq to))
476 (when (eq from (car other-eq)) 474 (when (eq from (car other-eq))
@@ -523,24 +521,23 @@ PREC2 is a table as returned by `smie-precs->prec2' or
523 (setcar (car eq) (cadr eq)) 521 (setcar (car eq) (cadr eq))
524 ;; (smie-check-grammar table prec2 'step2) 522 ;; (smie-check-grammar table prec2 'step2)
525 ) 523 )
526 ;; Finally, fill in the remaining vars (which only appeared on the 524 ;; Finally, fill in the remaining vars (which did not appear on the
527 ;; right side of the < constraints). 525 ;; left side of any < constraint).
528 (let ((classification-table (gethash :smie-open/close-alist prec2))) 526 (dolist (x table)
529 (dolist (x table) 527 (unless (nth 1 x)
530 ;; When both sides are nil, it means this operator binds very 528 (setf (nth 1 x) i)
531 ;; very tight, but it's still just an operator, so we give it 529 (incf i)) ;See other (incf i) above.
532 ;; the highest precedence. 530 (unless (nth 2 x)
533 ;; OTOH if only one side is nil, it usually means it's like an 531 (setf (nth 2 x) i)
534 ;; open-paren, which is very important for indentation purposes, 532 (incf i)))) ;See other (incf i) above.
535 ;; so we keep it nil if so, to make it easier to recognize. 533 ;; Mark closers and openers.
536 (unless (or (nth 1 x) 534 (dolist (x (gethash :smie-open/close-alist prec2))
537 (eq 'opener (cdr (assoc (car x) classification-table)))) 535 (let* ((token (car x))
538 (setf (nth 1 x) i) 536 (cons (case (cdr x)
539 (incf i)) ;See other (incf i) above. 537 (closer (cddr (assoc token table)))
540 (unless (or (nth 2 x) 538 (opener (cdr (assoc token table))))))
541 (eq 'closer (cdr (assoc (car x) classification-table)))) 539 (assert (numberp (car cons)))
542 (setf (nth 2 x) i) 540 (setf (car cons) (list (car cons)))))
543 (incf i))))) ;See other (incf i) above.
544 (let ((ca (gethash :smie-closer-alist prec2))) 541 (let ((ca (gethash :smie-closer-alist prec2)))
545 (when ca (push (cons :smie-closer-alist ca) table))) 542 (when ca (push (cons :smie-closer-alist ca) table)))
546 ;; (smie-check-grammar table prec2 'step3) 543 ;; (smie-check-grammar table prec2 'step3)
@@ -611,6 +608,8 @@ OP-FORW is the accessor to the forward level of the level data.
611OP-BACK is the accessor to the backward level of the level data. 608OP-BACK is the accessor to the backward level of the level data.
612HALFSEXP if non-nil, means skip over a partial sexp if needed. I.e. if the 609HALFSEXP if non-nil, means skip over a partial sexp if needed. I.e. if the
613first token we see is an operator, skip over its left-hand-side argument. 610first token we see is an operator, skip over its left-hand-side argument.
611HALFSEXP can also be a token, in which case it means to parse as if
612we had just successfully passed this token.
614Possible return values: 613Possible return values:
615 (FORW-LEVEL POS TOKEN): we couldn't skip TOKEN because its back-level 614 (FORW-LEVEL POS TOKEN): we couldn't skip TOKEN because its back-level
616 is too high. FORW-LEVEL is the forw-level of TOKEN, 615 is too high. FORW-LEVEL is the forw-level of TOKEN,
@@ -619,7 +618,10 @@ Possible return values:
619 (nil POS TOKEN): we skipped over a paren-like pair. 618 (nil POS TOKEN): we skipped over a paren-like pair.
620 nil: we skipped over an identifier, matched parentheses, ..." 619 nil: we skipped over an identifier, matched parentheses, ..."
621 (catch 'return 620 (catch 'return
622 (let ((levels ())) 621 (let ((levels
622 (if (stringp halfsexp)
623 (prog1 (list (cdr (assoc halfsexp smie-grammar)))
624 (setq halfsexp nil)))))
623 (while 625 (while
624 (let* ((pos (point)) 626 (let* ((pos (point))
625 (token (funcall next-token)) 627 (token (funcall next-token))
@@ -697,6 +699,8 @@ Possible return values:
697 "Skip over one sexp. 699 "Skip over one sexp.
698HALFSEXP if non-nil, means skip over a partial sexp if needed. I.e. if the 700HALFSEXP if non-nil, means skip over a partial sexp if needed. I.e. if the
699first token we see is an operator, skip over its left-hand-side argument. 701first token we see is an operator, skip over its left-hand-side argument.
702HALFSEXP can also be a token, in which case we should skip the text
703assuming it is the left-hand-side argument of that token.
700Possible return values: 704Possible return values:
701 (LEFT-LEVEL POS TOKEN): we couldn't skip TOKEN because its right-level 705 (LEFT-LEVEL POS TOKEN): we couldn't skip TOKEN because its right-level
702 is too high. LEFT-LEVEL is the left-level of TOKEN, 706 is too high. LEFT-LEVEL is the left-level of TOKEN,
@@ -714,7 +718,9 @@ Possible return values:
714(defun smie-forward-sexp (&optional halfsexp) 718(defun smie-forward-sexp (&optional halfsexp)
715 "Skip over one sexp. 719 "Skip over one sexp.
716HALFSEXP if non-nil, means skip over a partial sexp if needed. I.e. if the 720HALFSEXP if non-nil, means skip over a partial sexp if needed. I.e. if the
717first token we see is an operator, skip over its left-hand-side argument. 721first token we see is an operator, skip over its right-hand-side argument.
722HALFSEXP can also be a token, in which case we should skip the text
723assuming it is the right-hand-side argument of that token.
718Possible return values: 724Possible return values:
719 (RIGHT-LEVEL POS TOKEN): we couldn't skip TOKEN because its left-level 725 (RIGHT-LEVEL POS TOKEN): we couldn't skip TOKEN because its left-level
720 is too high. RIGHT-LEVEL is the right-level of TOKEN, 726 is too high. RIGHT-LEVEL is the right-level of TOKEN,
@@ -791,7 +797,7 @@ Possible return values:
791 (push (car other) found)))))) 797 (push (car other) found))))))
792 (cond 798 (cond
793 ((null found) (error "No known closer for opener %s" open)) 799 ((null found) (error "No known closer for opener %s" open))
794 ;; FIXME: what should we do if there are various closers? 800 ;; What should we do if there are various closers?
795 (t (car found)))))))))) 801 (t (car found))))))))))
796 (unless (save-excursion (skip-chars-backward " \t") (bolp)) 802 (unless (save-excursion (skip-chars-backward " \t") (bolp))
797 (newline)) 803 (newline))
@@ -1094,9 +1100,6 @@ Only meaningful when called from within `smie-rules-function'."
1094 ;; line, in which case we want to align it with its enclosing parent. 1100 ;; line, in which case we want to align it with its enclosing parent.
1095 (cond 1101 (cond
1096 ((and (eq method :before) (smie-rule-bolp) (not (smie-rule-sibling-p))) 1102 ((and (eq method :before) (smie-rule-bolp) (not (smie-rule-sibling-p)))
1097 ;; FIXME: Rather than consult the number of spaces, we could *set* the
1098 ;; number of spaces so as to align the separator with the close-paren
1099 ;; while aligning the content with the rest.
1100 (let ((parent-col (cdr (smie-rule-parent))) 1103 (let ((parent-col (cdr (smie-rule-parent)))
1101 (parent-pos-col ;FIXME: we knew this when computing smie--parent. 1104 (parent-pos-col ;FIXME: we knew this when computing smie--parent.
1102 (save-excursion 1105 (save-excursion
@@ -1225,39 +1228,48 @@ in order to figure out the indentation of some other (further down) point."
1225 (smie-indent-virtual)) ;:not-hanging 1228 (smie-indent-virtual)) ;:not-hanging
1226 (scan-error nil))))) 1229 (scan-error nil)))))
1227 1230
1228(defun smie-indent-keyword () 1231(defun smie-indent-keyword (&optional token)
1229 ;; Align closing token with the corresponding opening one. 1232 "Indent point based on the token that follows it immediately.
1230 ;; (e.g. "of" with "case", or "in" with "let"). 1233If TOKEN is non-nil, assume that that is the token that follows point.
1234Returns either a column number or nil if it considers that indentation
1235should not be computed on the basis of the following token."
1231 (save-excursion 1236 (save-excursion
1232 (let* ((pos (point)) 1237 (let* ((pos (point))
1233 (toklevels (smie-indent-forward-token)) 1238 (toklevels
1234 (token (pop toklevels))) 1239 (if token
1240 (assoc token smie-grammar)
1241 (let* ((res (smie-indent-forward-token)))
1242 ;; Ignore tokens on subsequent lines.
1243 (if (and (< pos (line-beginning-position))
1244 ;; Make sure `token' also *starts* on another line.
1245 (save-excursion
1246 (smie-indent-backward-token)
1247 (< pos (line-beginning-position))))
1248 nil
1249 (goto-char pos)
1250 res)))))
1251 (setq token (pop toklevels))
1235 (cond 1252 (cond
1236 ((< pos (line-beginning-position)) 1253 ((null (cdr toklevels)) nil) ;Not a keyword.
1237 ;; The token we just read is actually not on the line where we started.
1238 nil)
1239 ((not (numberp (car toklevels))) 1254 ((not (numberp (car toklevels)))
1240 (save-excursion 1255 ;; Different cases:
1241 (goto-char pos) 1256 ;; - smie-indent--bolp: "indent according to others".
1242 ;; Different cases: 1257 ;; - common hanging: "indent according to others".
1243 ;; - smie-indent--bolp: "indent according to others". 1258 ;; - SML-let hanging: "indent like parent".
1244 ;; - common hanging: "indent according to others". 1259 ;; - if-after-else: "indent-like parent".
1245 ;; - SML-let hanging: "indent like parent". 1260 ;; - middle-of-line: "trust current position".
1246 ;; - if-after-else: "indent-like parent". 1261 (cond
1247 ;; - middle-of-line: "trust current position". 1262 ((smie-indent--rule :before token))
1248 (cond 1263 ((smie-indent--bolp) ;I.e. non-virtual indent.
1249 ((null (cdr toklevels)) nil) ;Not a keyword. 1264 ;; For an open-paren-like thingy at BOL, always indent only
1250 ((smie-indent--rule :before token)) 1265 ;; based on other rules (typically smie-indent-after-keyword).
1251 ((smie-indent--bolp) ;I.e. non-virtual indent. 1266 nil)
1252 ;; For an open-paren-like thingy at BOL, always indent only 1267 (t
1253 ;; based on other rules (typically smie-indent-after-keyword). 1268 ;; By default use point unless we're hanging.
1254 nil) 1269 (unless (smie-indent--hanging-p) (current-column)))))
1255 (t
1256 ;; By default use point unless we're hanging.
1257 (unless (smie-indent--hanging-p) (current-column))))))
1258 (t 1270 (t
1259 ;; FIXME: This still looks too much like black magic!! 1271 ;; FIXME: This still looks too much like black magic!!
1260 (let* ((parent (smie-backward-sexp 'halfsexp))) 1272 (let* ((parent (smie-backward-sexp token)))
1261 ;; Different behaviors: 1273 ;; Different behaviors:
1262 ;; - align with parent. 1274 ;; - align with parent.
1263 ;; - parent + offset. 1275 ;; - parent + offset.
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 3ae3c5bc740..651cfef7f00 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,8 @@
12010-11-27 Yuri Karaban <tech@askold.net> (tiny change)
2
3 * pop3.el (pop3-open-server): Read server greeting before starting TLS
4 negotiation.
5
12010-11-26 Julien Danjou <julien@danjou.info> 62010-11-26 Julien Danjou <julien@danjou.info>
2 7
3 * color.el: Rename various rgb functions to srgb. 8 * color.el: Rename various rgb functions to srgb.
diff --git a/lisp/gnus/pop3.el b/lisp/gnus/pop3.el
index 327c5297492..eef53c2797d 100644
--- a/lisp/gnus/pop3.el
+++ b/lisp/gnus/pop3.el
@@ -327,21 +327,22 @@ Returns the process associated with the connection."
327 ;; gnutls-cli, openssl don't accept service names 327 ;; gnutls-cli, openssl don't accept service names
328 (if (equal port "pop3") 328 (if (equal port "pop3")
329 (setq port 110)) 329 (setq port 110))
330 (let ((process (starttls-open-stream "POP" (current-buffer) 330 ;; Delay STLS until server greeting is read (Bug#7438).
331 mailhost (or port 110)))) 331 (starttls-open-stream "POP" (current-buffer)
332 (pop3-send-command process "STLS") 332 mailhost (or port 110)))
333 (let ((response (pop3-read-response process t)))
334 (if (and response (string-match "+OK" response))
335 (starttls-negotiate process)
336 (pop3-quit process)
337 (error "POP server doesn't support starttls")))
338 process))
339 (t 333 (t
340 (open-network-stream "POP" (current-buffer) mailhost port)))) 334 (open-network-stream "POP" (current-buffer) mailhost port))))
341 (let ((response (pop3-read-response process t))) 335 (let ((response (pop3-read-response process t)))
342 (setq pop3-timestamp 336 (setq pop3-timestamp
343 (substring response (or (string-match "<" response) 0) 337 (substring response (or (string-match "<" response) 0)
344 (+ 1 (or (string-match ">" response) -1))))) 338 (+ 1 (or (string-match ">" response) -1)))))
339 (when (eq pop3-stream-type 'starttls)
340 (pop3-send-command process "STLS")
341 (let ((response (pop3-read-response process t)))
342 (if (and response (string-match "+OK" response))
343 (starttls-negotiate process)
344 (pop3-quit process)
345 (error "POP server doesn't support starttls"))))
345 (pop3-set-process-query-on-exit-flag process nil) 346 (pop3-set-process-query-on-exit-flag process nil)
346 process))) 347 process)))
347 348
diff --git a/lisp/locate.el b/lisp/locate.el
index 4e8925665ca..4c4312b9598 100644
--- a/lisp/locate.el
+++ b/lisp/locate.el
@@ -145,6 +145,11 @@ the version.)"
145 :type 'string 145 :type 'string
146 :group 'locate) 146 :group 'locate)
147 147
148(defcustom locate-post-command-hook nil
149 "List of hook functions run after `locate' (see `run-hooks')."
150 :type 'hook
151 :group 'locate)
152
148(defvar locate-history-list nil 153(defvar locate-history-list nil
149 "The history list used by the \\[locate] command.") 154 "The history list used by the \\[locate] command.")
150 155
@@ -226,6 +231,11 @@ that is, with a prefix arg, you get the default behavior."
226 :group 'locate 231 :group 'locate
227 :type 'boolean) 232 :type 'boolean)
228 233
234(defcustom locate-mode-hook nil
235 "List of hook functions run by `locate-mode' (see `run-mode-hooks')."
236 :type 'hook
237 :group 'locate)
238
229;; Functions 239;; Functions
230 240
231(defun locate-default-make-command-line (search-string) 241(defun locate-default-make-command-line (search-string)
@@ -471,9 +481,9 @@ do not work in subdirectories.
471 (make-local-variable 'directory-listing-before-filename-regexp) 481 (make-local-variable 'directory-listing-before-filename-regexp)
472 ;; This should support both Unix and Windoze style names 482 ;; This should support both Unix and Windoze style names
473 (setq directory-listing-before-filename-regexp 483 (setq directory-listing-before-filename-regexp
474 (concat "^." 484 (concat "^.\\("
475 (make-string (1- locate-filename-indentation) ?\s) 485 (make-string (1- locate-filename-indentation) ?\s)
476 "\\(/\\|[A-Za-z]:\\)\\|" 486 "\\)\\|"
477 (default-value 'directory-listing-before-filename-regexp))) 487 (default-value 'directory-listing-before-filename-regexp)))
478 (make-local-variable 'dired-actual-switches) 488 (make-local-variable 'dired-actual-switches)
479 (setq dired-actual-switches "") 489 (setq dired-actual-switches "")
diff --git a/lisp/lpr.el b/lisp/lpr.el
index 559dc5513ae..3b91172a7ef 100644
--- a/lisp/lpr.el
+++ b/lisp/lpr.el
@@ -152,7 +152,9 @@ The variable `lpr-page-header-program' specifies the program to use."
152 "Print buffer contents without pagination or page headers. 152 "Print buffer contents without pagination or page headers.
153See the variables `lpr-switches' and `lpr-command' 153See the variables `lpr-switches' and `lpr-command'
154for customization of the printer command." 154for customization of the printer command."
155 (interactive) 155 (interactive
156 (unless (y-or-n-p "Send current buffer to default printer? ")
157 (error "Cancelled")))
156 (print-region-1 (point-min) (point-max) lpr-switches nil)) 158 (print-region-1 (point-min) (point-max) lpr-switches nil))
157 159
158;;;###autoload 160;;;###autoload
@@ -169,7 +171,9 @@ in the print command itself; we expect them to request pagination.
169 171
170See the variables `lpr-switches' and `lpr-command' 172See the variables `lpr-switches' and `lpr-command'
171for further customization of the printer command." 173for further customization of the printer command."
172 (interactive) 174 (interactive
175 (unless (y-or-n-p "Send current buffer to default printer? ")
176 (error "Cancelled")))
173 (print-region-1 (point-min) (point-max) lpr-switches t)) 177 (print-region-1 (point-min) (point-max) lpr-switches t))
174 178
175;;;###autoload 179;;;###autoload
@@ -177,7 +181,10 @@ for further customization of the printer command."
177 "Print region contents without pagination or page headers. 181 "Print region contents without pagination or page headers.
178See the variables `lpr-switches' and `lpr-command' 182See the variables `lpr-switches' and `lpr-command'
179for customization of the printer command." 183for customization of the printer command."
180 (interactive "r") 184 (interactive
185 (if (y-or-n-p "Send selected text to default printer? ")
186 (list (region-beginning) (region-end))
187 (error "Cancelled")))
181 (print-region-1 start end lpr-switches nil)) 188 (print-region-1 start end lpr-switches nil))
182 189
183;;;###autoload 190;;;###autoload
@@ -194,7 +201,10 @@ in the print command itself; we expect them to request pagination.
194 201
195See the variables `lpr-switches' and `lpr-command' 202See the variables `lpr-switches' and `lpr-command'
196for further customization of the printer command." 203for further customization of the printer command."
197 (interactive "r") 204 (interactive
205 (if (y-or-n-p "Send selected text to default printer? ")
206 (list (region-beginning) (region-end))
207 (error "Cancelled")))
198 (print-region-1 start end lpr-switches t)) 208 (print-region-1 start end lpr-switches t))
199 209
200(defun print-region-1 (start end switches page-headers) 210(defun print-region-1 (start end switches page-headers)
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 47e52f27aa1..a2629dfe1c7 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -39,6 +39,7 @@
39;; 39;;
40 40
41(require 'mail-utils) 41(require 'mail-utils)
42(require 'rfc2047)
42 43
43(defconst rmail-attribute-header "X-RMAIL-ATTRIBUTES" 44(defconst rmail-attribute-header "X-RMAIL-ATTRIBUTES"
44 "The header that stores the Rmail attribute data.") 45 "The header that stores the Rmail attribute data.")
@@ -638,7 +639,7 @@ Element N specifies the summary line for message N+1.")
638 639
639This is set to nil by default.") 640This is set to nil by default.")
640 641
641(defcustom rmail-enable-mime nil 642(defcustom rmail-enable-mime t
642 "If non-nil, RMAIL uses MIME features. 643 "If non-nil, RMAIL uses MIME features.
643If the value is t, RMAIL automatically shows MIME decoded message. 644If the value is t, RMAIL automatically shows MIME decoded message.
644If the value is neither t nor nil, RMAIL does not show MIME decoded message 645If the value is neither t nor nil, RMAIL does not show MIME decoded message
@@ -649,6 +650,7 @@ unless the feature specified by `rmail-mime-feature' is available."
649 :type '(choice (const :tag "on" t) 650 :type '(choice (const :tag "on" t)
650 (const :tag "off" nil) 651 (const :tag "off" nil)
651 (other :tag "when asked" ask)) 652 (other :tag "when asked" ask))
653 :version "23.3"
652 :group 'rmail) 654 :group 'rmail)
653 655
654(defvar rmail-enable-mime-composing nil 656(defvar rmail-enable-mime-composing nil
@@ -693,13 +695,12 @@ start of the header) with three arguments MSG, REGEXP, and LIMIT,
693where MSG is the message number, REGEXP is the regular 695where MSG is the message number, REGEXP is the regular
694expression, LIMIT is the position specifying the end of header.") 696expression, LIMIT is the position specifying the end of header.")
695 697
696(defvar rmail-mime-feature 'rmail-mime 698(defvar rmail-mime-feature 'rmailmm
697 "Feature to require to load MIME support in Rmail. 699 "Feature to require to load MIME support in Rmail.
698When starting Rmail, if `rmail-enable-mime' is non-nil, 700When starting Rmail, if `rmail-enable-mime' is non-nil,
699this feature is required with `require'. 701this feature is required with `require'.
700 702
701The default value is `rmail-mime'. This feature is provided by 703The default value is `rmailmm'")
702the rmail-mime package available at <http://www.m17n.org/rmail-mime/>.")
703 704
704;; FIXME this is unused. 705;; FIXME this is unused.
705(defvar rmail-decode-mime-charset t 706(defvar rmail-decode-mime-charset t
@@ -1509,17 +1510,9 @@ Hook `rmail-quit-hook' is run after expunging."
1509 (set-buffer-modified-p nil)) 1510 (set-buffer-modified-p nil))
1510 (replace-buffer-in-windows rmail-summary-buffer) 1511 (replace-buffer-in-windows rmail-summary-buffer)
1511 (bury-buffer rmail-summary-buffer)) 1512 (bury-buffer rmail-summary-buffer))
1512 (if rmail-enable-mime 1513 (let ((obuf (current-buffer)))
1513 (let ((obuf rmail-buffer) 1514 (quit-window)
1514 (ovbuf rmail-view-buffer)) 1515 (replace-buffer-in-windows obuf)))
1515 (set-buffer rmail-view-buffer)
1516 (quit-window)
1517 (replace-buffer-in-windows ovbuf)
1518 (replace-buffer-in-windows obuf)
1519 (bury-buffer obuf))
1520 (let ((obuf (current-buffer)))
1521 (quit-window)
1522 (replace-buffer-in-windows obuf))))
1523 1516
1524(defun rmail-bury () 1517(defun rmail-bury ()
1525 "Bury current Rmail buffer and its summary buffer." 1518 "Bury current Rmail buffer and its summary buffer."
@@ -2219,15 +2212,7 @@ If nil, that means the current message."
2219 (let ((blurb (rmail-get-labels))) 2212 (let ((blurb (rmail-get-labels)))
2220 (setq mode-line-process 2213 (setq mode-line-process
2221 (format " %d/%d%s" 2214 (format " %d/%d%s"
2222 rmail-current-message rmail-total-messages blurb)) 2215 rmail-current-message rmail-total-messages blurb))))
2223 ;; If rmail-enable-mime is non-nil, we may have to update
2224 ;; `mode-line-process' of rmail-view-buffer too.
2225 (if (and rmail-enable-mime
2226 (not (eq (current-buffer) rmail-view-buffer))
2227 (buffer-live-p rmail-view-buffer))
2228 (let ((mlp mode-line-process))
2229 (with-current-buffer rmail-view-buffer
2230 (setq mode-line-process mlp))))))
2231 2216
2232(defun rmail-get-attr-value (attr state) 2217(defun rmail-get-attr-value (attr state)
2233 "Return the character value for ATTR. 2218 "Return the character value for ATTR.
@@ -2706,6 +2691,11 @@ The current mail message becomes the message displayed."
2706 (message "Showing message %d" msg)) 2691 (message "Showing message %d" msg))
2707 (narrow-to-region beg end) 2692 (narrow-to-region beg end)
2708 (goto-char beg) 2693 (goto-char beg)
2694 (if (and rmail-enable-mime
2695 (re-search-forward "mime-version: 1.0" nil t))
2696 (let ((rmail-buffer mbox-buf)
2697 (rmail-view-buffer view-buf))
2698 (funcall rmail-show-mime-function))
2709 (setq body-start (search-forward "\n\n" nil t)) 2699 (setq body-start (search-forward "\n\n" nil t))
2710 (narrow-to-region beg (point)) 2700 (narrow-to-region beg (point))
2711 (goto-char beg) 2701 (goto-char beg)
@@ -2722,11 +2712,6 @@ The current mail message becomes the message displayed."
2722 ;; unibyte temporary buffer where the character decoding takes 2712 ;; unibyte temporary buffer where the character decoding takes
2723 ;; place. 2713 ;; place.
2724 (with-current-buffer rmail-view-buffer 2714 (with-current-buffer rmail-view-buffer
2725 ;; We give the view buffer a buffer-local value of
2726 ;; rmail-header-style based on the binding in effect when
2727 ;; this function is called; `rmail-toggle-headers' can
2728 ;; inspect this value to determine how to toggle.
2729 (set (make-local-variable 'rmail-header-style) header-style)
2730 (erase-buffer)) 2715 (erase-buffer))
2731 (if (null character-coding) 2716 (if (null character-coding)
2732 ;; Do it directly since that is fast. 2717 ;; Do it directly since that is fast.
@@ -2749,8 +2734,13 @@ The current mail message becomes the message displayed."
2749 (error "uuencoded messages are not supported yet")) 2734 (error "uuencoded messages are not supported yet"))
2750 (t)) 2735 (t))
2751 (rmail-decode-region (point-min) (point-max) 2736 (rmail-decode-region (point-min) (point-max)
2752 coding-system view-buf))) 2737 coding-system view-buf))))
2753 (with-current-buffer rmail-view-buffer 2738 (with-current-buffer rmail-view-buffer
2739 ;; We give the view buffer a buffer-local value of
2740 ;; rmail-header-style based on the binding in effect when
2741 ;; this function is called; `rmail-toggle-headers' can
2742 ;; inspect this value to determine how to toggle.
2743 (set (make-local-variable 'rmail-header-style) header-style)
2754 ;; Unquote quoted From lines 2744 ;; Unquote quoted From lines
2755 (goto-char (point-min)) 2745 (goto-char (point-min))
2756 (while (re-search-forward "^>+From " nil t) 2746 (while (re-search-forward "^>+From " nil t)
@@ -2766,6 +2756,10 @@ The current mail message becomes the message displayed."
2766 (with-current-buffer rmail-view-buffer 2756 (with-current-buffer rmail-view-buffer
2767 (insert "\n") 2757 (insert "\n")
2768 (goto-char (point-min)) 2758 (goto-char (point-min))
2759 ;; Decode the headers according to RFC2047.
2760 (save-excursion
2761 (search-forward "\n\n" nil 'move)
2762 (rfc2047-decode-region (point-min) (point)))
2769 (rmail-highlight-headers) 2763 (rmail-highlight-headers)
2770 ;(rmail-activate-urls) 2764 ;(rmail-activate-urls)
2771 ;(rmail-process-quoted-material) 2765 ;(rmail-process-quoted-material)
diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el
index 3882c9e47c8..918d2dfc365 100644
--- a/lisp/mail/rmailmm.el
+++ b/lisp/mail/rmailmm.el
@@ -27,17 +27,57 @@
27 27
28;; Essentially based on the design of Alexander Pohoyda's MIME 28;; Essentially based on the design of Alexander Pohoyda's MIME
29;; extensions (mime-display.el and mime.el). 29;; extensions (mime-display.el and mime.el).
30;; Call `M-x rmail-mime' when viewing an Rmail message. 30
31;; This file provides two operation modes for viewing a MIME message.
32
33;; (1) When rmail-enable-mime is non-nil (now it is the default), the
34;; function `rmail-show-mime' is automatically called. That function
35;; shows a MIME message directly in RMAIL's view buffer.
36
37;; (2) When rmail-enable-mime is nil, the command 'v' (or M-x
38;; rmail-mime) shows a MIME message in a new buffer "*RMAIL*".
39
40;; Both operations share the intermediate functions rmail-mime-process
41;; and rmail-mime-process-multipart as below.
42
43;; rmail-show-mime
44;; +- rmail-mime-parse
45;; | +- rmail-mime-process <--+------------+
46;; | | +---------+ |
47;; | + rmail-mime-process-multipart --+
48;; |
49;; + rmail-mime-insert <----------------+
50;; +- rmail-mime-insert-text |
51;; +- rmail-mime-insert-bulk |
52;; +- rmail-mime-insert-multipart --+
53;;
54;; rmail-mime
55;; +- rmail-mime-show <----------------------------------+
56;; +- rmail-mime-process |
57;; +- rmail-mime-handle |
58;; +- rmail-mime-text-handler |
59;; +- rmail-mime-bulk-handler |
60;; | + rmail-mime-insert-bulk
61;; +- rmail-mime-multipart-handler |
62;; +- rmail-mime-process-multipart --+
63
64;; In addition, for the case of rmail-enable-mime being non-nil, this
65;; file provides two functions rmail-insert-mime-forwarded-message and
66;; rmail-insert-mime-resent-message for composing forwarded and resent
67;; messages respectively.
31 68
32;; Todo: 69;; Todo:
33 70
34;; Handle multipart/alternative. 71;; Make rmail-mime-media-type-handlers-alist usable in the first
72;; operation mode.
73;; Handle multipart/alternative in the second operation mode.
35;; Offer the option to call external/internal viewers (doc-view, xpdf, etc). 74;; Offer the option to call external/internal viewers (doc-view, xpdf, etc).
36 75
37;;; Code: 76;;; Code:
38 77
39(require 'rmail) 78(require 'rmail)
40(require 'mail-parse) 79(require 'mail-parse)
80(require 'message)
41 81
42;;; User options. 82;;; User options.
43 83
@@ -91,6 +131,52 @@ automatically display the image in the buffer."
91 131
92;;; End of user options. 132;;; End of user options.
93 133
134;;; MIME-entity object
135
136(defun rmail-mime-entity (type disposition transfer-encoding
137 header body children)
138 "Retrun a newly created MIME-entity object.
139
140A MIME-entity is a vector of 6 elements:
141
142 [ TYPE DISPOSITION TRANSFER-ENCODING HEADER BODY CHILDREN ]
143
144TYPE and DISPOSITION correspond to MIME headers Content-Type: and
145Cotent-Disposition: respectively, and has this format:
146
147 \(VALUE (ATTRIBUTE . VALUE) (ATTRIBUTE . VALUE) ...)
148
149VALUE is a string and ATTRIBUTE is a symbol.
150
151Consider the following header, for example:
152
153Content-Type: multipart/mixed;
154 boundary=\"----=_NextPart_000_0104_01C617E4.BDEC4C40\"
155
156The corresponding TYPE argument must be:
157
158\(\"multipart/mixed\"
159 \(\"boundary\" . \"----=_NextPart_000_0104_01C617E4.BDEC4C40\"))
160
161TRANSFER-ENCODING corresponds to MIME header
162Content-Transfer-Encoding, and is a lowercased string.
163
164HEADER and BODY are a cons (BEG . END), where BEG and END specify
165the region of the corresponding part in RMAIL's data (mbox)
166buffer. BODY may be nil. In that case, the current buffer is
167narrowed to the body part.
168
169CHILDREN is a list of MIME-entities for a \"multipart\" entity, and
170nil for the other types."
171 (vector type disposition transfer-encoding header body children))
172
173;; Accessors for a MIME-entity object.
174(defsubst rmail-mime-entity-type (entity) (aref entity 0))
175(defsubst rmail-mime-entity-disposition (entity) (aref entity 1))
176(defsubst rmail-mime-entity-transfer-encoding (entity) (aref entity 2))
177(defsubst rmail-mime-entity-header (entity) (aref entity 3))
178(defsubst rmail-mime-entity-body (entity) (aref entity 4))
179(defsubst rmail-mime-entity-children (entity) (aref entity 5))
94 180
95;;; Buttons 181;;; Buttons
96 182
@@ -99,6 +185,7 @@ automatically display the image in the buffer."
99 (let* ((filename (button-get button 'filename)) 185 (let* ((filename (button-get button 'filename))
100 (directory (button-get button 'directory)) 186 (directory (button-get button 'directory))
101 (data (button-get button 'data)) 187 (data (button-get button 'data))
188 (mbox-buf rmail-view-buffer)
102 (ofilename filename)) 189 (ofilename filename))
103 (setq filename (expand-file-name 190 (setq filename (expand-file-name
104 (read-file-name (format "Save as (default: %s): " filename) 191 (read-file-name (format "Save as (default: %s): " filename)
@@ -117,7 +204,17 @@ automatically display the image in the buffer."
117 ;; file, the magic signature compares equal with the unibyte 204 ;; file, the magic signature compares equal with the unibyte
118 ;; signature string recorded in jka-compr-compression-info-list. 205 ;; signature string recorded in jka-compr-compression-info-list.
119 (set-buffer-multibyte nil) 206 (set-buffer-multibyte nil)
120 (insert data) 207 (setq buffer-undo-list t)
208 (if (stringp data)
209 (insert data)
210 ;; DATA is a MIME-entity object.
211 (let ((transfer-encoding (rmail-mime-entity-transfer-encoding data))
212 (body (rmail-mime-entity-body data)))
213 (insert-buffer-substring mbox-buf (car body) (cdr body))
214 (cond ((string= transfer-encoding "base64")
215 (ignore-errors (base64-decode-region (point-min) (point-max))))
216 ((string= transfer-encoding "quoted-printable")
217 (quoted-printable-decode-region (point-min) (point-max))))))
121 (write-region nil nil filename nil nil nil t)))) 218 (write-region nil nil filename nil nil nil t))))
122 219
123(define-button-type 'rmail-mime-save 'action 'rmail-mime-save) 220(define-button-type 'rmail-mime-save 'action 'rmail-mime-save)
@@ -134,6 +231,23 @@ automatically display the image in the buffer."
134 (when (coding-system-p coding-system) 231 (when (coding-system-p coding-system)
135 (decode-coding-region (point-min) (point-max) coding-system)))) 232 (decode-coding-region (point-min) (point-max) coding-system))))
136 233
234(defun rmail-mime-insert-text (entity)
235 "Insert MIME-entity ENTITY as a plain text MIME part in the current buffer."
236 (let* ((content-type (rmail-mime-entity-type entity))
237 (charset (cdr (assq 'charset (cdr content-type))))
238 (coding-system (if charset (intern (downcase charset))))
239 (transfer-encoding (rmail-mime-entity-transfer-encoding entity))
240 (body (rmail-mime-entity-body entity)))
241 (save-restriction
242 (narrow-to-region (point) (point))
243 (insert-buffer-substring rmail-buffer (car body) (cdr body))
244 (cond ((string= transfer-encoding "base64")
245 (ignore-errors (base64-decode-region (point-min) (point-max))))
246 ((string= transfer-encoding "quoted-printable")
247 (quoted-printable-decode-region (point-min) (point-max))))
248 (if (coding-system-p coding-system)
249 (decode-coding-region (point-min) (point-max) coding-system)))))
250
137;; FIXME move to the test/ directory? 251;; FIXME move to the test/ directory?
138(defun test-rmail-mime-handler () 252(defun test-rmail-mime-handler ()
139 "Test of a mail using no MIME parts at all." 253 "Test of a mail using no MIME parts at all."
@@ -152,10 +266,28 @@ MIME-Version: 1.0
152 266
153 267
154(defun rmail-mime-insert-image (type data) 268(defun rmail-mime-insert-image (type data)
155 "Insert an image of type TYPE, where DATA is the image data." 269 "Insert an image of type TYPE, where DATA is the image data.
270If DATA is not a string, it is a MIME-entity object."
156 (end-of-line) 271 (end-of-line)
157 (insert ?\n) 272 (let ((modified (buffer-modified-p)))
158 (insert-image (create-image data type t))) 273 (insert ?\n)
274 (unless (stringp data)
275 ;; DATA is a MIME-entity.
276 (let ((transfer-encoding (rmail-mime-entity-transfer-encoding data))
277 (body (rmail-mime-entity-body data))
278 (mbox-buffer rmail-view-buffer))
279 (with-temp-buffer
280 (set-buffer-multibyte nil)
281 (setq buffer-undo-list t)
282 (insert-buffer-substring mbox-buffer (car body) (cdr body))
283 (cond ((string= transfer-encoding "base64")
284 (ignore-errors (base64-decode-region (point-min) (point-max))))
285 ((string= transfer-encoding "quoted-printable")
286 (quoted-printable-decode-region (point-min) (point-max))))
287 (setq data
288 (buffer-substring-no-properties (point-min) (point-max))))))
289 (insert-image (create-image data type t))
290 (set-buffer-modified-p modified)))
159 291
160(defun rmail-mime-image (button) 292(defun rmail-mime-image (button)
161 "Display the image associated with BUTTON." 293 "Display the image associated with BUTTON."
@@ -172,8 +304,19 @@ MIME-Version: 1.0
172 "Handle the current buffer as an attachment to download. 304 "Handle the current buffer as an attachment to download.
173For images that Emacs is capable of displaying, the behavior 305For images that Emacs is capable of displaying, the behavior
174depends upon the value of `rmail-mime-show-images'." 306depends upon the value of `rmail-mime-show-images'."
307 (rmail-mime-insert-bulk
308 (rmail-mime-entity content-type content-disposition content-transfer-encoding
309 nil nil nil)))
310
311(defun rmail-mime-insert-bulk (entity)
312 "Inesrt a MIME-entity ENTITY as an attachment.
313The optional second arg DATA, if non-nil, is a string containing
314the attachment data that is already decoded."
175 ;; Find the default directory for this media type. 315 ;; Find the default directory for this media type.
176 (let* ((directory (catch 'directory 316 (let* ((content-type (rmail-mime-entity-type entity))
317 (content-disposition (rmail-mime-entity-disposition entity))
318 (body (rmail-mime-entity-body entity))
319 (directory (catch 'directory
177 (dolist (entry rmail-mime-attachment-dirs-alist) 320 (dolist (entry rmail-mime-attachment-dirs-alist)
178 (when (string-match (car entry) (car content-type)) 321 (when (string-match (car entry) (car content-type))
179 (dolist (dir (cdr entry)) 322 (dolist (dir (cdr entry))
@@ -183,17 +326,21 @@ depends upon the value of `rmail-mime-show-images'."
183 (cdr (assq 'filename (cdr content-disposition))) 326 (cdr (assq 'filename (cdr content-disposition)))
184 "noname")) 327 "noname"))
185 (label (format "\nAttached %s file: " (car content-type))) 328 (label (format "\nAttached %s file: " (car content-type)))
186 (data (buffer-string))
187 (udata (string-as-unibyte data))
188 (size (length udata))
189 (osize size)
190 (units '(B kB MB GB)) 329 (units '(B kB MB GB))
191 type) 330 data udata size osize type)
192 (while (and (> size 1024.0) ; cribbed from gnus-agent-expire-done-message 331 (if body
332 (setq data entity
333 udata entity
334 size (- (cdr body) (car body)))
335 (setq data (buffer-string)
336 udata (string-as-unibyte data)
337 size (length udata))
338 (delete-region (point-min) (point-max)))
339 (setq osize size)
340 (while (and (> size 1024.0) ; cribbed from gnus-agent-expire-done-message
193 (cdr units)) 341 (cdr units))
194 (setq size (/ size 1024.0) 342 (setq size (/ size 1024.0)
195 units (cdr units))) 343 units (cdr units)))
196 (delete-region (point-min) (point-max))
197 (insert label) 344 (insert label)
198 (insert-button filename 345 (insert-button filename
199 :type 'rmail-mime-save 346 :type 'rmail-mime-save
@@ -249,6 +396,22 @@ The current buffer should be narrowed to the body. CONTENT-TYPE,
249CONTENT-DISPOSITION, and CONTENT-TRANSFER-ENCODING are the values 396CONTENT-DISPOSITION, and CONTENT-TRANSFER-ENCODING are the values
250of the respective parsed headers. See `rmail-mime-handle' for their 397of the respective parsed headers. See `rmail-mime-handle' for their
251format." 398format."
399 (rmail-mime-process-multipart
400 content-type content-disposition content-transfer-encoding nil))
401
402(defun rmail-mime-process-multipart (content-type
403 content-disposition
404 content-transfer-encoding
405 parse-only)
406 "Process the current buffer as a multipart MIME body.
407
408If PARSE-ONLY is nil, modify the current buffer directly for showing
409the MIME body and return nil.
410
411Otherwise, just parse the current buffer and return a list of
412MIME-entity objects.
413
414The other arguments are the same as `rmail-mime-multipart-handler'."
252 ;; Some MUAs start boundaries with "--", while it should start 415 ;; Some MUAs start boundaries with "--", while it should start
253 ;; with "CRLF--", as defined by RFC 2046: 416 ;; with "CRLF--", as defined by RFC 2046:
254 ;; The boundary delimiter MUST occur at the beginning of a line, 417 ;; The boundary delimiter MUST occur at the beginning of a line,
@@ -257,7 +420,7 @@ format."
257 ;; of the preceding part. 420 ;; of the preceding part.
258 ;; We currently don't handle that. 421 ;; We currently don't handle that.
259 (let ((boundary (cdr (assq 'boundary content-type))) 422 (let ((boundary (cdr (assq 'boundary content-type)))
260 beg end next) 423 beg end next entities)
261 (unless boundary 424 (unless boundary
262 (rmail-mm-get-boundary-error-message 425 (rmail-mm-get-boundary-error-message
263 "No boundary defined" content-type content-disposition 426 "No boundary defined" content-type content-disposition
@@ -267,7 +430,9 @@ format."
267 (goto-char (point-min)) 430 (goto-char (point-min))
268 (when (and (search-forward boundary nil t) 431 (when (and (search-forward boundary nil t)
269 (looking-at "[ \t]*\n")) 432 (looking-at "[ \t]*\n"))
270 (delete-region (point-min) (match-end 0))) 433 (if parse-only
434 (narrow-to-region (match-end 0) (point-max))
435 (delete-region (point-min) (match-end 0))))
271 ;; Loop over all body parts, where beg points at the beginning of 436 ;; Loop over all body parts, where beg points at the beginning of
272 ;; the part and end points at the end of the part. next points at 437 ;; the part and end points at the end of the part. next points at
273 ;; the beginning of the next part. 438 ;; the beginning of the next part.
@@ -285,13 +450,17 @@ format."
285 (rmail-mm-get-boundary-error-message 450 (rmail-mm-get-boundary-error-message
286 "Malformed boundary" content-type content-disposition 451 "Malformed boundary" content-type content-disposition
287 content-transfer-encoding))) 452 content-transfer-encoding)))
288 (delete-region end next)
289 ;; Handle the part. 453 ;; Handle the part.
290 (save-restriction 454 (if parse-only
291 (narrow-to-region beg end) 455 (save-restriction
292 (rmail-mime-show)) 456 (narrow-to-region beg end)
293 (goto-char (setq beg next))))) 457 (setq entities (cons (rmail-mime-process nil t) entities)))
294 458 (delete-region end next)
459 (save-restriction
460 (narrow-to-region beg end)
461 (rmail-mime-show)))
462 (goto-char (setq beg next)))
463 (nreverse entities)))
295 464
296(defun test-rmail-mime-multipart-handler () 465(defun test-rmail-mime-multipart-handler ()
297 "Test of a mail used as an example in RFC 2046." 466 "Test of a mail used as an example in RFC 2046."
@@ -394,6 +563,9 @@ called recursively if multiple parts are available.
394 563
395The current buffer must contain a single message. It will be 564The current buffer must contain a single message. It will be
396modified." 565modified."
566 (rmail-mime-process show-headers nil))
567
568(defun rmail-mime-process (show-headers parse-only)
397 (let ((end (point-min)) 569 (let ((end (point-min))
398 content-type 570 content-type
399 content-transfer-encoding 571 content-transfer-encoding
@@ -437,14 +609,105 @@ modified."
437 ;; attachment according to RFC 2183. 609 ;; attachment according to RFC 2183.
438 (unless (member (car content-disposition) '("inline" "attachment")) 610 (unless (member (car content-disposition) '("inline" "attachment"))
439 (setq content-disposition '("attachment"))) 611 (setq content-disposition '("attachment")))
440 ;; Hide headers and handle the part. 612
441 (save-restriction 613 (if parse-only
442 (cond ((string= (car content-type) "message/rfc822") 614 (cond ((string-match "multipart/.*" (car content-type))
443 (narrow-to-region end (point-max))) 615 (setq end (1- end))
444 ((not show-headers) 616 (save-restriction
445 (delete-region (point-min) end))) 617 (let ((header (if show-headers (cons (point-min) end))))
446 (rmail-mime-handle content-type content-disposition 618 (narrow-to-region end (point-max))
447 content-transfer-encoding)))) 619 (rmail-mime-entity content-type
620 content-disposition
621 content-transfer-encoding
622 header nil
623 (rmail-mime-process-multipart
624 content-type content-disposition
625 content-transfer-encoding t)))))
626 ((string-match "message/rfc822" (car content-type))
627 (or show-headers
628 (narrow-to-region end (point-max)))
629 (rmail-mime-process t t))
630 (t
631 (rmail-mime-entity content-type
632 content-disposition
633 content-transfer-encoding
634 nil
635 (cons end (point-max))
636 nil)))
637 ;; Hide headers and handle the part.
638 (save-restriction
639 (cond ((string= (car content-type) "message/rfc822")
640 (narrow-to-region end (point-max)))
641 ((not show-headers)
642 (delete-region (point-min) end)))
643 (rmail-mime-handle content-type content-disposition
644 content-transfer-encoding)))))
645
646(defun rmail-mime-insert-multipart (entity)
647 "Insert MIME-entity ENTITY of multipart type in the current buffer."
648 (let ((subtype (cadr (split-string (car (rmail-mime-entity-type entity))
649 "/")))
650 (disposition (rmail-mime-entity-disposition entity))
651 (header (rmail-mime-entity-header entity))
652 (children (rmail-mime-entity-children entity)))
653 (if header
654 (let ((pos (point)))
655 (or (bolp)
656 (insert "\n"))
657 (insert-buffer-substring rmail-buffer (car header) (cdr header))
658 (rfc2047-decode-region pos (point))
659 (insert "\n")))
660 (cond
661 ((string= subtype "mixed")
662 (dolist (child children)
663 (rmail-mime-insert child '("text/plain") disposition)))
664 ((string= subtype "digest")
665 (dolist (child children)
666 (rmail-mime-insert child '("message/rfc822") disposition)))
667 ((string= subtype "alternative")
668 (let (best-plain-text best-text)
669 (dolist (child children)
670 (if (string= (or (car (rmail-mime-entity-disposition child))
671 (car disposition))
672 "inline")
673 (if (string-match "text/plain"
674 (car (rmail-mime-entity-type child)))
675 (setq best-plain-text child)
676 (if (string-match "text/.*"
677 (car (rmail-mime-entity-type child)))
678 (setq best-text child)))))
679 (if (or best-plain-text best-text)
680 (rmail-mime-insert (or best-plain-text best-text))
681 ;; No child could be handled. Insert all.
682 (dolist (child children)
683 (rmail-mime-insert child nil disposition)))))
684 (t
685 ;; Unsupported subtype. Insert all of them.
686 (dolist (child children)
687 (rmail-mime-insert child))))))
688
689(defun rmail-mime-parse ()
690 "Parse the current Rmail message as a MIME message.
691The value is a MIME-entiy object (see `rmail-mime-enty-new')."
692 (save-excursion
693 (goto-char (point-min))
694 (rmail-mime-process nil t)))
695
696(defun rmail-mime-insert (entity &optional content-type disposition)
697 "Insert a MIME-entity ENTITY in the current buffer.
698
699This function will be called recursively if multiple parts are
700available."
701 (if (rmail-mime-entity-children entity)
702 (rmail-mime-insert-multipart entity)
703 (setq content-type
704 (or (rmail-mime-entity-type entity) content-type))
705 (setq disposition
706 (or (rmail-mime-entity-disposition entity) disposition))
707 (if (and (string= (car disposition) "inline")
708 (string-match "text/.*" (car content-type)))
709 (rmail-mime-insert-text entity)
710 (rmail-mime-insert-bulk entity))))
448 711
449(define-derived-mode rmail-mime-mode fundamental-mode "RMIME" 712(define-derived-mode rmail-mime-mode fundamental-mode "RMIME"
450 "Major mode used in `rmail-mime' buffers." 713 "Major mode used in `rmail-mime' buffers."
@@ -480,6 +743,50 @@ attachments as specfied by `rmail-mime-attachment-dirs-alist'."
480 (error "%s; type: %s; disposition: %s; encoding: %s" 743 (error "%s; type: %s; disposition: %s; encoding: %s"
481 message type disposition encoding)) 744 message type disposition encoding))
482 745
746(defun rmail-show-mime ()
747 (let ((mbox-buf rmail-buffer))
748 (condition-case nil
749 (let ((entity (rmail-mime-parse)))
750 (with-current-buffer rmail-view-buffer
751 (let ((inhibit-read-only t)
752 (rmail-buffer mbox-buf))
753 (erase-buffer)
754 (rmail-mime-insert entity))))
755 (error
756 ;; Decoding failed. Insert the original message body as is.
757 (let ((region (with-current-buffer mbox-buf
758 (goto-char (point-min))
759 (re-search-forward "^$" nil t)
760 (forward-line 1)
761 (cons (point) (point-max)))))
762 (with-current-buffer rmail-view-buffer
763 (let ((inhibit-read-only t))
764 (erase-buffer)
765 (insert-buffer-substring mbox-buf (car region) (cdr region))))
766 (message "MIME decoding failed"))))))
767
768(setq rmail-show-mime-function 'rmail-show-mime)
769
770(defun rmail-insert-mime-forwarded-message (forward-buffer)
771 (let ((mbox-buf (with-current-buffer forward-buffer rmail-view-buffer)))
772 (save-restriction
773 (narrow-to-region (point) (point))
774 (message-forward-make-body-mime mbox-buf))))
775
776(setq rmail-insert-mime-forwarded-message-function
777 'rmail-insert-mime-forwarded-message)
778
779(defun rmail-insert-mime-resent-message (forward-buffer)
780 (insert-buffer-substring
781 (with-current-buffer forward-buffer rmail-view-buffer))
782 (goto-char (point-min))
783 (when (looking-at "From ")
784 (forward-line 1)
785 (delete-region (point-min) (point))))
786
787(setq rmail-insert-mime-resent-message-function
788 'rmail-insert-mime-resent-message)
789
483(provide 'rmailmm) 790(provide 'rmailmm)
484 791
485;; Local Variables: 792;; Local Variables:
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el
index 0b8abbca6a5..f1efb33e6cb 100644
--- a/lisp/mail/rmailsum.el
+++ b/lisp/mail/rmailsum.el
@@ -32,6 +32,7 @@
32 32
33;; For rmail-select-summary. 33;; For rmail-select-summary.
34(require 'rmail) 34(require 'rmail)
35(require 'rfc2047)
35 36
36(defcustom rmail-summary-scroll-between-messages t 37(defcustom rmail-summary-scroll-between-messages t
37 "Non-nil means Rmail summary scroll commands move between messages. 38 "Non-nil means Rmail summary scroll commands move between messages.
@@ -364,13 +365,15 @@ The current buffer contains the unrestricted message collection."
364 (aset rmail-summary-vector (1- msgnum) line)) 365 (aset rmail-summary-vector (1- msgnum) line))
365 line)) 366 line))
366 367
367(defcustom rmail-summary-line-decoder (function identity) 368(defcustom rmail-summary-line-decoder (function rfc2047-decode-string)
368 "Function to decode a Rmail summary line. 369 "Function to decode a Rmail summary line.
369It receives the summary line for one message as a string 370It receives the summary line for one message as a string
370and should return the decoded string. 371and should return the decoded string.
371 372
372By default, it is `identity', which returns the string unaltered." 373By default, it is `rfc2047-decode-string', which decodes MIME-encoded
374subject."
373 :type 'function 375 :type 'function
376 :version "23.3"
374 :group 'rmail-summary) 377 :group 'rmail-summary)
375 378
376(defun rmail-create-summary-line (msgnum) 379(defun rmail-create-summary-line (msgnum)
@@ -589,10 +592,17 @@ the message being processed."
589 (t (- mch 14)))) 592 (t (- mch 14))))
590 (min len (+ lo 25))))))))) 593 (min len (+ lo 25)))))))))
591 (concat (if (re-search-forward "^Subject:" nil t) 594 (concat (if (re-search-forward "^Subject:" nil t)
592 (progn (skip-chars-forward " \t") 595 (let (pos str)
593 (buffer-substring (point) 596 (skip-chars-forward " \t")
594 (progn (end-of-line) 597 (setq pos (point))
595 (point)))) 598 (forward-line 1)
599 (setq str (buffer-substring pos (1- (point))))
600 (while (looking-at "\\s ")
601 (setq str (concat str " "
602 (buffer-substring (match-end 0)
603 (line-end-position))))
604 (forward-line 1))
605 str)
596 (re-search-forward "[\n][\n]+" nil t) 606 (re-search-forward "[\n][\n]+" nil t)
597 (buffer-substring (point) (progn (end-of-line) (point)))) 607 (buffer-substring (point) (progn (end-of-line) (point))))
598 "\n"))) 608 "\n")))
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 10b3c7bd04c..789677ce643 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -331,9 +331,9 @@ empty string for the user name.
331 331
332See `tramp-methods' for a list of possibilities for METHOD." 332See `tramp-methods' for a list of possibilities for METHOD."
333 :group 'tramp 333 :group 'tramp
334 :type '(repeat (list (regexp :tag "Host regexp") 334 :type '(repeat (list (choice :tag "Host regexp" regexp sexp)
335 (regexp :tag "User regexp") 335 (choice :tag "User regexp" regexp sexp)
336 (string :tag "Method")))) 336 (choice :tag "Method name" string (const nil)))))
337 337
338(defcustom tramp-default-user nil 338(defcustom tramp-default-user nil
339 "*Default user to use for transferring files. 339 "*Default user to use for transferring files.
@@ -355,9 +355,9 @@ matches, the variable `tramp-default-user' takes effect.
355If the file name does not specify the method, lookup is done using the 355If the file name does not specify the method, lookup is done using the
356empty string for the method name." 356empty string for the method name."
357 :group 'tramp 357 :group 'tramp
358 :type '(repeat (list (regexp :tag "Method regexp") 358 :type '(repeat (list (choice :tag "Method regexp" regexp sexp)
359 (regexp :tag "Host regexp") 359 (choice :tag " Host regexp" regexp sexp)
360 (string :tag "User")))) 360 (choice :tag " User name" string (const nil)))))
361 361
362(defcustom tramp-default-host (system-name) 362(defcustom tramp-default-host (system-name)
363 "*Default host to use for transferring files. 363 "*Default host to use for transferring files.
@@ -382,7 +382,7 @@ interpreted as a regular expression which always matches."
382 :group 'tramp 382 :group 'tramp
383 :type '(repeat (list (choice :tag "Host regexp" regexp sexp) 383 :type '(repeat (list (choice :tag "Host regexp" regexp sexp)
384 (choice :tag "User regexp" regexp sexp) 384 (choice :tag "User regexp" regexp sexp)
385 (choice :tag "Proxy remote name" string (const nil))))) 385 (choice :tag " Proxy name" string (const nil)))))
386 386
387(defconst tramp-local-host-regexp 387(defconst tramp-local-host-regexp
388 (concat 388 (concat
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 9fe57beec30..0a641d0945f 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1462,6 +1462,16 @@ Default ignores all inputs of 0, 1, or 2 non-blank characters."
1462 :type 'regexp 1462 :type 'regexp
1463 :group 'python) 1463 :group 'python)
1464 1464
1465(defcustom python-remove-cwd-from-path t
1466 "Whether to allow loading of Python modules from the current directory.
1467If this is non-nil, Emacs removes '' from sys.path when starting
1468an inferior Python process. This is the default, for security
1469reasons, as it is easy for the Python process to be started
1470without the user's realization (e.g. to perform completion)."
1471 :type 'boolean
1472 :group 'python
1473 :version "23.3")
1474
1465(defun python-input-filter (str) 1475(defun python-input-filter (str)
1466 "`comint-input-filter' function for inferior Python. 1476 "`comint-input-filter' function for inferior Python.
1467Don't save anything for STR matching `inferior-python-filter-regexp'." 1477Don't save anything for STR matching `inferior-python-filter-regexp'."
@@ -1559,20 +1569,24 @@ print version_info >= (2, 2) and version_info < (3, 0)\""))))
1559;;;###autoload 1569;;;###autoload
1560(defun run-python (&optional cmd noshow new) 1570(defun run-python (&optional cmd noshow new)
1561 "Run an inferior Python process, input and output via buffer *Python*. 1571 "Run an inferior Python process, input and output via buffer *Python*.
1562CMD is the Python command to run. NOSHOW non-nil means don't show the 1572CMD is the Python command to run. NOSHOW non-nil means don't
1563buffer automatically. 1573show the buffer automatically.
1564 1574
1565Normally, if there is a process already running in `python-buffer', 1575Interactively, a prefix arg means to prompt for the initial
1566switch to that buffer. Interactively, a prefix arg allows you to edit 1576Python command line (default is `python-command').
1567the initial command line (default is `python-command'); `-i' etc. args 1577
1568will be added to this as appropriate. A new process is started if: 1578A new process is started if one isn't running attached to
1569one isn't running attached to `python-buffer', or interactively the 1579`python-buffer', or if called from Lisp with non-nil arg NEW.
1570default `python-command', or argument NEW is non-nil. See also the 1580Otherwise, if a process is already running in `python-buffer',
1571documentation for `python-buffer'. 1581switch to that buffer.
1572 1582
1573Runs the hook `inferior-python-mode-hook' \(after the 1583This command runs the hook `inferior-python-mode-hook' after
1574`comint-mode-hook' is run). \(Type \\[describe-mode] in the process 1584running `comint-mode-hook'. Type \\[describe-mode] in the
1575buffer for a list of commands.)" 1585process buffer for a list of commands.
1586
1587By default, Emacs inhibits the loading of Python modules from the
1588current working directory, for security reasons. To disable this
1589behavior, change `python-remove-cwd-from-path' to nil."
1576 (interactive (if current-prefix-arg 1590 (interactive (if current-prefix-arg
1577 (list (read-string "Run Python: " python-command) nil t) 1591 (list (read-string "Run Python: " python-command) nil t)
1578 (list python-command))) 1592 (list python-command)))
@@ -1586,13 +1600,9 @@ buffer for a list of commands.)"
1586 (when (or new (not (comint-check-proc python-buffer))) 1600 (when (or new (not (comint-check-proc python-buffer)))
1587 (with-current-buffer 1601 (with-current-buffer
1588 (let* ((cmdlist 1602 (let* ((cmdlist
1589 (append (python-args-to-list cmd) 1603 (append (python-args-to-list cmd) '("-i")
1590 ;; It's easy for the user to cause the process to be 1604 (if python-remove-cwd-from-path
1591 ;; started without realizing it (e.g. to perform 1605 '("-c" "import sys; sys.path.remove('')"))))
1592 ;; completion); for this reason loading files from the
1593 ;; current directory is a security risk. See
1594 ;; http://article.gmane.org/gmane.emacs.devel/103569
1595 '("-i" "-c" "import sys; sys.path.remove('')")))
1596 (path (getenv "PYTHONPATH")) 1606 (path (getenv "PYTHONPATH"))
1597 (process-environment ; to import emacs.py 1607 (process-environment ; to import emacs.py
1598 (cons (concat "PYTHONPATH=" 1608 (cons (concat "PYTHONPATH="
diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el
index 469786e04dd..049d708d191 100644
--- a/lisp/progmodes/which-func.el
+++ b/lisp/progmodes/which-func.el
@@ -154,7 +154,7 @@ mouse-3: go to end")
154 :type 'sexp) 154 :type 'sexp)
155;;;###autoload (put 'which-func-format 'risky-local-variable t) 155;;;###autoload (put 'which-func-format 'risky-local-variable t)
156 156
157(defvar which-func-imenu-joiner-function #'last 157(defvar which-func-imenu-joiner-function (lambda (x) (car (last x)))
158 "Function to join together multiple levels of imenu nomenclature. 158 "Function to join together multiple levels of imenu nomenclature.
159Called with a single argument, a list of strings giving the names 159Called with a single argument, a list of strings giving the names
160of the menus we had to traverse to get to the item. Returns a 160of the menus we had to traverse to get to the item. Returns a
@@ -242,6 +242,9 @@ continuously displayed in the mode line, in certain major modes.
242With prefix ARG, turn Which Function mode on if arg is positive, 242With prefix ARG, turn Which Function mode on if arg is positive,
243and off otherwise." 243and off otherwise."
244 :global t :group 'which-func 244 :global t :group 'which-func
245 (when (timerp which-func-update-timer)
246 (cancel-timer which-func-update-timer))
247 (setq which-func-update-timer nil)
245 (if which-function-mode 248 (if which-function-mode
246 ;;Turn it on 249 ;;Turn it on
247 (progn 250 (progn
@@ -253,9 +256,6 @@ and off otherwise."
253 (or (eq which-func-modes t) 256 (or (eq which-func-modes t)
254 (member major-mode which-func-modes)))))) 257 (member major-mode which-func-modes))))))
255 ;; Turn it off 258 ;; Turn it off
256 (when (timerp which-func-update-timer)
257 (cancel-timer which-func-update-timer))
258 (setq which-func-update-timer nil)
259 (dolist (buf (buffer-list)) 259 (dolist (buf (buffer-list))
260 (with-current-buffer buf (setq which-func-mode nil))))) 260 (with-current-buffer buf (setq which-func-mode nil)))))
261 261
diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el
index c0aa595d968..2bce58f50f2 100644
--- a/lisp/vc/log-edit.el
+++ b/lisp/vc/log-edit.el
@@ -350,17 +350,16 @@ automatically."
350(defvar log-edit-font-lock-keywords 350(defvar log-edit-font-lock-keywords
351 ;; Copied/inspired by message-font-lock-keywords. 351 ;; Copied/inspired by message-font-lock-keywords.
352 `((log-edit-match-to-eoh 352 `((log-edit-match-to-eoh
353 (,(concat "^\\(\\([a-z]+\\):\\)" log-edit-header-contents-regexp 353 (,(concat "^\\(\\([a-z]+\\):\\)" log-edit-header-contents-regexp)
354 "\\|\\(.*\\)")
355 (progn (goto-char (match-beginning 0)) (match-end 0)) nil 354 (progn (goto-char (match-beginning 0)) (match-end 0)) nil
356 (1 (if (assoc (match-string 2) log-edit-headers-alist) 355 (1 (if (assoc (match-string 2) log-edit-headers-alist)
357 'log-edit-header 356 'log-edit-header
358 'log-edit-unknown-header) 357 'log-edit-unknown-header)
359 nil lax) 358 nil lax)
359 ;; From `log-edit-header-contents-regexp':
360 (3 (or (cdr (assoc (match-string 2) log-edit-headers-alist)) 360 (3 (or (cdr (assoc (match-string 2) log-edit-headers-alist))
361 'log-edit-header) 361 'log-edit-header)
362 nil lax) 362 nil lax)))))
363 (4 font-lock-warning-face)))))
364 363
365;;;###autoload 364;;;###autoload
366(defun log-edit (callback &optional setup params buffer mode &rest ignore) 365(defun log-edit (callback &optional setup params buffer mode &rest ignore)
diff --git a/src/ChangeLog b/src/ChangeLog
index 8c98b52e6aa..b1d67c9c31f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,39 @@
12010-11-27 Kenichi Handa <handa@m17n.org>
2
3 * charset.c (emacs_mule_charset): Make it an array of charset ID;
4 i.e. integer.
5 (Fdefine_charset_internal): Adjusted for the above change.
6 (init_charset_once): Likewise.
7
8 * charset.h (emacs_mule_charset): Adjust the prototype. Delete
9 duplicated extern.
10
11 * coding.c (emacs_mule_char): Adjust for the change of
12 emacs_mule_charset.
13
14 * lread.c (read_emacs_mule_char): Adjust for the change of
15 emacs_mule_charset.
16
172010-11-27 Eli Zaretskii <eliz@gnu.org>
18
19 * w32.c (_PROCESS_MEMORY_COUNTERS_EX): Don't define with versions
20 of w32api >= 3.15. (Bug#6989) (Bug#7452)
21
222010-11-27 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
23
24 * alloc.c (mark_terminals): Ensure that the image cache is marked
25 even if the terminal object was marked earlier (Bug#6301).
26
272010-11-21 Chong Yidong <cyd@stupidchicken.com>
28
29 * editfns.c (Fbyte_to_string): Signal an error arg is not a byte.
30
312010-11-27 Jan Djärv <jan.h.d@swipnet.se>
32
33 * gtkutil.c (menubar_map_cb): New function (Bug#7425).
34 (xg_update_frame_menubar): Connect signal map to menubar_map_cb.
35 Use 23 as menubar height if 0. (Bug#7425).
36
12010-11-26 Eli Zaretskii <eliz@gnu.org> 372010-11-26 Eli Zaretskii <eliz@gnu.org>
2 38
3 * xdisp.c (set_message_1): Force paragraph direction in echo area 39 * xdisp.c (set_message_1): Force paragraph direction in echo area
diff --git a/src/alloc.c b/src/alloc.c
index 28636ec776c..a1c78a408d9 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -5643,13 +5643,14 @@ mark_terminals (void)
5643 for (t = terminal_list; t; t = t->next_terminal) 5643 for (t = terminal_list; t; t = t->next_terminal)
5644 { 5644 {
5645 eassert (t->name != NULL); 5645 eassert (t->name != NULL);
5646 if (!VECTOR_MARKED_P (t))
5647 {
5648#ifdef HAVE_WINDOW_SYSTEM 5646#ifdef HAVE_WINDOW_SYSTEM
5649 mark_image_cache (t->image_cache); 5647 /* If a terminal object is reachable from a stacpro'ed object,
5648 it might have been marked already. Make sure the image cache
5649 gets marked. */
5650 mark_image_cache (t->image_cache);
5650#endif /* HAVE_WINDOW_SYSTEM */ 5651#endif /* HAVE_WINDOW_SYSTEM */
5651 mark_vectorlike ((struct Lisp_Vector *)t); 5652 if (!VECTOR_MARKED_P (t))
5652 } 5653 mark_vectorlike ((struct Lisp_Vector *)t);
5653 } 5654 }
5654} 5655}
5655 5656
diff --git a/src/charset.c b/src/charset.c
index 0ab776b6914..39a376a947f 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -114,7 +114,7 @@ Lisp_Object Viso_2022_charset_list;
114/* List of emacs-mule charsets. */ 114/* List of emacs-mule charsets. */
115Lisp_Object Vemacs_mule_charset_list; 115Lisp_Object Vemacs_mule_charset_list;
116 116
117struct charset *emacs_mule_charset[256]; 117int emacs_mule_charset[256];
118 118
119/* Mapping table from ISO2022's charset (specified by DIMENSION, 119/* Mapping table from ISO2022's charset (specified by DIMENSION,
120 CHARS, and FINAL-CHAR) to Emacs' charset. */ 120 CHARS, and FINAL-CHAR) to Emacs' charset. */
@@ -1210,7 +1210,7 @@ usage: (define-charset-internal ...) */)
1210 1210
1211 if (charset.emacs_mule_id >= 0) 1211 if (charset.emacs_mule_id >= 0)
1212 { 1212 {
1213 emacs_mule_charset[charset.emacs_mule_id] = CHARSET_FROM_ID (id); 1213 emacs_mule_charset[charset.emacs_mule_id] = id;
1214 if (charset.emacs_mule_id < 0xA0) 1214 if (charset.emacs_mule_id < 0xA0)
1215 emacs_mule_bytes[charset.emacs_mule_id] = charset.dimension + 1; 1215 emacs_mule_bytes[charset.emacs_mule_id] = charset.dimension + 1;
1216 else 1216 else
@@ -2330,7 +2330,7 @@ init_charset_once (void)
2330 iso_charset_table[i][j][k] = -1; 2330 iso_charset_table[i][j][k] = -1;
2331 2331
2332 for (i = 0; i < 256; i++) 2332 for (i = 0; i < 256; i++)
2333 emacs_mule_charset[i] = NULL; 2333 emacs_mule_charset[i] = -1;
2334 2334
2335 charset_jisx0201_roman = -1; 2335 charset_jisx0201_roman = -1;
2336 charset_jisx0208_1978 = -1; 2336 charset_jisx0208_1978 = -1;
diff --git a/src/charset.h b/src/charset.h
index dbe9c776a0d..6e6422f3c73 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -255,7 +255,7 @@ extern Lisp_Object Vcharset_list;
255extern Lisp_Object Viso_2022_charset_list; 255extern Lisp_Object Viso_2022_charset_list;
256extern Lisp_Object Vemacs_mule_charset_list; 256extern Lisp_Object Vemacs_mule_charset_list;
257 257
258extern struct charset *emacs_mule_charset[256]; 258extern int emacs_mule_charset[256];
259 259
260extern Lisp_Object Vcurrent_iso639_language; 260extern Lisp_Object Vcurrent_iso639_language;
261 261
diff --git a/src/coding.c b/src/coding.c
index c834f76a65e..a7b7c7d6b23 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -2053,7 +2053,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
2053 const unsigned char *src_end = coding->source + coding->src_bytes; 2053 const unsigned char *src_end = coding->source + coding->src_bytes;
2054 const unsigned char *src_base = src; 2054 const unsigned char *src_base = src;
2055 int multibytep = coding->src_multibyte; 2055 int multibytep = coding->src_multibyte;
2056 struct charset *charset; 2056 int charset_id;
2057 unsigned code; 2057 unsigned code;
2058 int c; 2058 int c;
2059 int consumed_chars = 0; 2059 int consumed_chars = 0;
@@ -2063,7 +2063,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
2063 if (c < 0) 2063 if (c < 0)
2064 { 2064 {
2065 c = -c; 2065 c = -c;
2066 charset = emacs_mule_charset[0]; 2066 charset_id = emacs_mule_charset[0];
2067 } 2067 }
2068 else 2068 else
2069 { 2069 {
@@ -2099,7 +2099,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
2099 switch (emacs_mule_bytes[c]) 2099 switch (emacs_mule_bytes[c])
2100 { 2100 {
2101 case 2: 2101 case 2:
2102 if (! (charset = emacs_mule_charset[c])) 2102 if ((charset_id = emacs_mule_charset[c]) < 0)
2103 goto invalid_code; 2103 goto invalid_code;
2104 ONE_MORE_BYTE (c); 2104 ONE_MORE_BYTE (c);
2105 if (c < 0xA0) 2105 if (c < 0xA0)
@@ -2112,7 +2112,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
2112 || c == EMACS_MULE_LEADING_CODE_PRIVATE_12) 2112 || c == EMACS_MULE_LEADING_CODE_PRIVATE_12)
2113 { 2113 {
2114 ONE_MORE_BYTE (c); 2114 ONE_MORE_BYTE (c);
2115 if (c < 0xA0 || ! (charset = emacs_mule_charset[c])) 2115 if (c < 0xA0 || (charset_id = emacs_mule_charset[c]) < 0)
2116 goto invalid_code; 2116 goto invalid_code;
2117 ONE_MORE_BYTE (c); 2117 ONE_MORE_BYTE (c);
2118 if (c < 0xA0) 2118 if (c < 0xA0)
@@ -2121,7 +2121,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
2121 } 2121 }
2122 else 2122 else
2123 { 2123 {
2124 if (! (charset = emacs_mule_charset[c])) 2124 if ((charset_id = emacs_mule_charset[c]) < 0)
2125 goto invalid_code; 2125 goto invalid_code;
2126 ONE_MORE_BYTE (c); 2126 ONE_MORE_BYTE (c);
2127 if (c < 0xA0) 2127 if (c < 0xA0)
@@ -2136,7 +2136,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
2136 2136
2137 case 4: 2137 case 4:
2138 ONE_MORE_BYTE (c); 2138 ONE_MORE_BYTE (c);
2139 if (c < 0 || ! (charset = emacs_mule_charset[c])) 2139 if (c < 0 || (charset_id = emacs_mule_charset[c]) < 0)
2140 goto invalid_code; 2140 goto invalid_code;
2141 ONE_MORE_BYTE (c); 2141 ONE_MORE_BYTE (c);
2142 if (c < 0xA0) 2142 if (c < 0xA0)
@@ -2150,21 +2150,21 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
2150 2150
2151 case 1: 2151 case 1:
2152 code = c; 2152 code = c;
2153 charset = CHARSET_FROM_ID (ASCII_BYTE_P (code) 2153 charset_id = ASCII_BYTE_P (code) ? charset_ascii : charset_eight_bit;
2154 ? charset_ascii : charset_eight_bit);
2155 break; 2154 break;
2156 2155
2157 default: 2156 default:
2158 abort (); 2157 abort ();
2159 } 2158 }
2160 CODING_DECODE_CHAR (coding, src, src_base, src_end, charset, code, c); 2159 CODING_DECODE_CHAR (coding, src, src_base, src_end,
2160 CHARSET_FROM_ID (charset_id), code, c);
2161 if (c < 0) 2161 if (c < 0)
2162 goto invalid_code; 2162 goto invalid_code;
2163 } 2163 }
2164 *nbytes = src - src_base; 2164 *nbytes = src - src_base;
2165 *nchars = consumed_chars; 2165 *nchars = consumed_chars;
2166 if (id) 2166 if (id)
2167 *id = charset->id; 2167 *id = charset_id;
2168 return (mseq_found ? -c : c); 2168 return (mseq_found ? -c : c);
2169 2169
2170 no_more_source: 2170 no_more_source:
diff --git a/src/editfns.c b/src/editfns.c
index f76beb5e678..4a9e2314a84 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -218,11 +218,13 @@ usage: (char-to-string CHAR) */)
218} 218}
219 219
220DEFUN ("byte-to-string", Fbyte_to_string, Sbyte_to_string, 1, 1, 0, 220DEFUN ("byte-to-string", Fbyte_to_string, Sbyte_to_string, 1, 1, 0,
221 doc: /* Convert arg BYTE to a string containing that byte. */) 221 doc: /* Convert arg BYTE to a unibyte string containing that byte. */)
222 (Lisp_Object byte) 222 (Lisp_Object byte)
223{ 223{
224 unsigned char b; 224 unsigned char b;
225 CHECK_NUMBER (byte); 225 CHECK_NUMBER (byte);
226 if (XINT (byte) < 0 || XINT (byte) > 255)
227 error ("Invalid byte");
226 b = XINT (byte); 228 b = XINT (byte);
227 return make_string_from_bytes (&b, 1, 1); 229 return make_string_from_bytes (&b, 1, 1);
228} 230}
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 89b16a10fbc..b091df19905 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -3074,6 +3074,23 @@ xg_modify_menubar_widgets (GtkWidget *menubar, FRAME_PTR f, widget_value *val,
3074 gtk_widget_show_all (menubar); 3074 gtk_widget_show_all (menubar);
3075} 3075}
3076 3076
3077/* Callback called when the menu bar W is mapped.
3078 Used to find the height of the menu bar if we didn't get it
3079 after showing the widget. */
3080
3081static void
3082menubar_map_cb (GtkWidget *w, gpointer user_data)
3083{
3084 GtkRequisition req;
3085 FRAME_PTR f = (FRAME_PTR) user_data;
3086 gtk_widget_size_request (w, &req);
3087 if (FRAME_MENUBAR_HEIGHT (f) != req.height)
3088 {
3089 FRAME_MENUBAR_HEIGHT (f) = req.height;
3090 xg_height_changed (f);
3091 }
3092}
3093
3077/* Recompute all the widgets of frame F, when the menu bar has been 3094/* Recompute all the widgets of frame F, when the menu bar has been
3078 changed. Value is non-zero if widgets were updated. */ 3095 changed. Value is non-zero if widgets were updated. */
3079 3096
@@ -3095,10 +3112,20 @@ xg_update_frame_menubar (FRAME_PTR f)
3095 FALSE, FALSE, 0); 3112 FALSE, FALSE, 0);
3096 gtk_box_reorder_child (GTK_BOX (x->vbox_widget), x->menubar_widget, 0); 3113 gtk_box_reorder_child (GTK_BOX (x->vbox_widget), x->menubar_widget, 0);
3097 3114
3115 g_signal_connect (x->menubar_widget, "map", G_CALLBACK (menubar_map_cb), f);
3098 gtk_widget_show_all (x->menubar_widget); 3116 gtk_widget_show_all (x->menubar_widget);
3099 gtk_widget_size_request (x->menubar_widget, &req); 3117 gtk_widget_size_request (x->menubar_widget, &req);
3100 FRAME_MENUBAR_HEIGHT (f) = req.height; 3118
3101 xg_height_or_width_changed (f); 3119 /* If menu bar doesn't know its height yet, cheat a little so the frame
3120 doesn't jump so much when resized later in menubar_map_cb. */
3121 if (req.height == 0)
3122 req.height = 23;
3123
3124 if (FRAME_MENUBAR_HEIGHT (f) != req.height)
3125 {
3126 FRAME_MENUBAR_HEIGHT (f) = req.height;
3127 xg_height_or_width_changed (f);
3128 }
3102 UNBLOCK_INPUT; 3129 UNBLOCK_INPUT;
3103 3130
3104 return 1; 3131 return 1;
diff --git a/src/lread.c b/src/lread.c
index 18d4ba8360e..bfe3755cc51 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -582,7 +582,7 @@ read_emacs_mule_char (int c, int (*readbyte) (int, Lisp_Object), Lisp_Object rea
582 582
583 if (len == 2) 583 if (len == 2)
584 { 584 {
585 charset = emacs_mule_charset[buf[0]]; 585 charset = CHARSET_FROM_ID (emacs_mule_charset[buf[0]]);
586 code = buf[1] & 0x7F; 586 code = buf[1] & 0x7F;
587 } 587 }
588 else if (len == 3) 588 else if (len == 3)
@@ -590,18 +590,18 @@ read_emacs_mule_char (int c, int (*readbyte) (int, Lisp_Object), Lisp_Object rea
590 if (buf[0] == EMACS_MULE_LEADING_CODE_PRIVATE_11 590 if (buf[0] == EMACS_MULE_LEADING_CODE_PRIVATE_11
591 || buf[0] == EMACS_MULE_LEADING_CODE_PRIVATE_12) 591 || buf[0] == EMACS_MULE_LEADING_CODE_PRIVATE_12)
592 { 592 {
593 charset = emacs_mule_charset[buf[1]]; 593 charset = CHARSET_FROM_ID (emacs_mule_charset[buf[1]]);
594 code = buf[2] & 0x7F; 594 code = buf[2] & 0x7F;
595 } 595 }
596 else 596 else
597 { 597 {
598 charset = emacs_mule_charset[buf[0]]; 598 charset = CHARSET_FROM_ID (emacs_mule_charset[buf[0]]);
599 code = ((buf[1] << 8) | buf[2]) & 0x7F7F; 599 code = ((buf[1] << 8) | buf[2]) & 0x7F7F;
600 } 600 }
601 } 601 }
602 else 602 else
603 { 603 {
604 charset = emacs_mule_charset[buf[1]]; 604 charset = CHARSET_FROM_ID (emacs_mule_charset[buf[1]]);
605 code = ((buf[2] << 8) | buf[3]) & 0x7F7F; 605 code = ((buf[2] << 8) | buf[3]) & 0x7F7F;
606 } 606 }
607 c = DECODE_CHAR (charset, code); 607 c = DECODE_CHAR (charset, code);