1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 22:41:06 -08:00

Merge changes from emacs-23 branch

This commit is contained in:
Chong Yidong 2010-11-27 15:04:57 -05:00
commit 07976ae3b8
46 changed files with 1227 additions and 523 deletions

View file

@ -475,8 +475,8 @@ http://lists.gnu.org/archive/html/emacs-devel/2009-11/msg00440.html
** Bazaar stuff ** Bazaar stuff
*** You can use `bzr commit --fixes debbugs:123' to mark that a commit fixes *** You can use `bzr commit --fixes debbugs:123' to mark that a commit fixes
Emacs bug 123. You will first need to add a line to your ~/bazaar.conf Emacs bug 123. You will first need to add a line to one of your
or ~/locations.conf: configuration files, ~/.bazaar/bazaar.conf or ~/.bazaar/locations.conf:
bugtracker_debbugs_url = http://debbugs.gnu.org/{id} bugtracker_debbugs_url = http://debbugs.gnu.org/{id}
@ -491,7 +491,7 @@ In the locations.conf file, it should go into the branch-specific
configuration section for the branch where you want this to be in configuration section for the branch where you want this to be in
effect. For example, if you want this to be in effect for the branch effect. For example, if you want this to be in effect for the branch
located at `/home/projects/emacs/trunk', you need to have this in your located at `/home/projects/emacs/trunk', you need to have this in your
~/locations.conf file: ~/.bazaar/locations.conf file:
[/home/projects/emacs/trunk] [/home/projects/emacs/trunk]
bugtracker_debbugs_url = http://debbugs.gnu.org/{id} bugtracker_debbugs_url = http://debbugs.gnu.org/{id}

View file

@ -1,3 +1,28 @@
2010-11-27 Bob Rogers <rogers-emacs@rgrjr.dyndns.org>
* maintaining.texi (VC With A Locking VCS, VC Directory Commands):
* vc1-xtra.texi (Customizing VC, General VC Options): Small fixes.
2010-11-27 Chong Yidong <cyd@stupidchicken.com>
* maintaining.texi (Version Control Systems): Fix repeated sentence.
Suggested by Štěpán Němec.
2010-11-27 Chong Yidong <cyd@stupidchicken.com>
* maintaining.texi (Version Control): Say "commit", not "check in".
(Version Control Systems): Simplify descriptions.
(VCS Merging, VCS Changesets, VCS Repositories): New nodes, split from
VCS Concepts.
(VC Mode Line): Update example.
(Old Revisions): Document revert-buffer for vc-diff.
(Log Buffer): Promote to a subsection. Document header lines.
* macos.texi (Mac / GNUstep Basics): Document
ns-right-alternate-modifier.
* emacs.texi (Top): Update node listing.
2010-11-13 Eli Zaretskii <eliz@gnu.org> 2010-11-13 Eli Zaretskii <eliz@gnu.org>
* rmail.texi (Rmail Coding): Characters with no fonts are not * rmail.texi (Rmail Coding): Characters with no fonts are not

View file

@ -771,6 +771,7 @@ Version Control
* Introduction to VC:: How version control works in general. * Introduction to VC:: How version control works in general.
* VC Mode Line:: How the mode line shows version control status. * VC Mode Line:: How the mode line shows version control status.
* Basic VC Editing:: How to edit a file under version control. * Basic VC Editing:: How to edit a file under version control.
* Log Buffer:: Features available in log entry buffers.
* Old Revisions:: Examining and comparing old versions. * Old Revisions:: Examining and comparing old versions.
* Secondary VC Commands:: The commands used a little less frequently. * Secondary VC Commands:: The commands used a little less frequently.
* VC Directory Mode:: Listing files managed by version control. * VC Directory Mode:: Listing files managed by version control.
@ -785,6 +786,9 @@ Introduction to Version Control
* Why Version Control?:: Understanding the problems it addresses. * Why Version Control?:: Understanding the problems it addresses.
* Version Control Systems:: Supported version control back-end systems. * Version Control Systems:: Supported version control back-end systems.
* VCS Concepts:: Words and concepts related to version control. * VCS Concepts:: Words and concepts related to version control.
* VCS Merging:: How file conflicts are handled.
* VCS Changesets:: Changesets in version control.
* VCS Repositories:: Where version control repositories are stored.
* Types of Log File:: The VCS log in contrast to the ChangeLog. * Types of Log File:: The VCS log in contrast to the ChangeLog.
Basic Editing under Version Control Basic Editing under Version Control
@ -792,7 +796,6 @@ Basic Editing under Version Control
* VC With A Merging VCS:: Without locking: default mode for CVS. * VC With A Merging VCS:: Without locking: default mode for CVS.
* VC With A Locking VCS:: RCS in its default mode, SCCS, and optionally CVS. * VC With A Locking VCS:: RCS in its default mode, SCCS, and optionally CVS.
* Advanced C-x v v:: Advanced features available with a prefix argument. * Advanced C-x v v:: Advanced features available with a prefix argument.
* Log Buffer:: Features available in log entry buffers.
The Secondary Commands of VC The Secondary Commands of VC

View file

@ -8,23 +8,22 @@
@cindex Macintosh @cindex Macintosh
@cindex GNUstep @cindex GNUstep
This section briefly describes the peculiarities of using Emacs built with This section describes the peculiarities of using Emacs built with
the GNUstep libraries on GNU/Linux or other operating systems, or on Mac OS X the GNUstep libraries on GNU/Linux or other operating systems, or on
with native window system support. For Mac OS X, Emacs can be built either Mac OS X with native window system support. On Mac OS X, Emacs can be
without window system support, with X11, or with the Cocoa interface. This built either without window system support, with X11, or with the
section only applies to the Cocoa build. Emacs 23 does not support Mac OS Cocoa interface; this section only applies to the Cocoa build. Emacs
Classic. does not support earlier versions of Mac OS.
Emacs, when built on Mac OS X, uses the Cocoa application interface. For For various historical and technical reasons, Emacs uses the term
various historical and technical reasons, Emacs uses the term @samp{Nextstep} @samp{Nextstep} internally, instead of ``Cocoa'' or ``Mac OS X''; for
internally, instead of ``Cocoa'' or ``Mac OS X''; for instance, most of the instance, most of the commands and variables described in this section
commands and variables described in the following sections begin with begin with @samp{ns-}, which is short for @samp{Nextstep}. NeXTstep
@samp{ns-}, which is short for @samp{Nextstep}. NeXTstep was an application was an application interface released by NeXT Inc during the 1980s, of
interface released by NeXT Inc during the 1980s, of which Cocoa is a direct which Cocoa is a direct descendant. Apart from Cocoa, there is
descendant. Apart from Cocoa, there is another NeXTstep-style system: another NeXTstep-style system: GNUstep, which is free software. As of
GNUstep, which is free software. As of this writing, the GNUstep support is this writing, the GNUstep support is alpha status (@pxref{GNUstep
alpha status (@pxref{GNUstep Support}), but we hope to improve it in the Support}), but we hope to improve it in the future.
future.
@menu @menu
* Mac / GNUstep Basics:: Basic Emacs usage under GNUstep or Mac OS. * Mac / GNUstep Basics:: Basic Emacs usage under GNUstep or Mac OS.
@ -37,19 +36,24 @@ future.
@section Basic Emacs usage under Mac OS and GNUstep @section Basic Emacs usage under Mac OS and GNUstep
By default, the @key{alt} and @key{option} keys are the same as By default, the @key{alt} and @key{option} keys are the same as
@key{Meta} when running under Mac OS. The Mac @key{Cmd} key is the @key{Meta}. The Mac @key{Cmd} key is the same as @key{Super}, and
same as @key{Super}, and Emacs provides a set of keybindings using Emacs provides a set of keybindings using this modifier key that mimic
this modifier key that mimic other Mac / GNUstep applications (@pxref{Mac / other Mac / GNUstep applications (@pxref{Mac / GNUstep Events}). You
GNUstep Events}). You can change these bindings in the usual way (@pxref{Key can change these bindings in the usual way (@pxref{Key Bindings}).
Bindings}).
The standard Mac / GNUstep font and color panels are accessible via Lisp commands. The variable @code{ns-right-alternate-modifier} controls the
To use the color panel, drag from it to an Emacs frame to change the behavior of the right @key{alt} and @key{option} keys. These keys
foreground color of the face at that position (if the @key{shift} key behave like the left-hand keys if the value is @code{left} (the
is held down, it changes the background color instead). To discard the default). A value of @code{control}, @code{meta}, @code{alt},
settings, create a new frame and close the altered one. @code{super}, or @code{hyper} makes them behave like the corresponding
@c [unclear if the following holds.] modifier keys; a value of @code{none} tells Emacs to ignore them.
@c To finalize the settings for either color or font, choose @samp{Save Options} in the @samp{Options} menu.
The standard Mac / GNUstep font and color panels are accessible via
Lisp commands. To use the color panel, drag from it to an Emacs frame
to change the foreground color of the face at that position (if the
@key{shift} key is held down, it changes the background color
instead). To discard the settings, create a new frame and close the
altered one.
@key{S-Mouse-1} (i.e., clicking the left mouse button @key{S-Mouse-1} (i.e., clicking the left mouse button
while holding down the @key{Shift} key) adjusts the region to the while 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
@key{S-Mouse-1} normally does (@pxref{Temporary Face Changes}). This @key{S-Mouse-1} normally does (@pxref{Temporary Face Changes}). This
change makes Emacs behave more like other Mac / GNUstep applications. change makes Emacs behave more like other Mac / GNUstep applications.
When you open or save files using the menus, or using the When you open or save files using the menus, or using the
@key{Cmd-o} and @key{Cmd-S} bindings, Emacs uses graphical file @key{Cmd-o} and @key{Cmd-S} bindings, Emacs uses graphical file
dialogs to read file names. However, if you use the regular Emacs key dialogs to read file names. However, if you use the regular Emacs key
sequences, such as @key{C-x C-f}, Emacs uses the minibuffer to read sequences, 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
background color. background color.
@c To make the changes permanent select the "Save Options" @c To make the changes permanent select the "Save Options"
@c item in the "Options" menu, or run @code{menu-bar-options-save}. @c item in the "Options" menu, or run @code{menu-bar-options-save}.
Useful in this context is the listing of all faces obtained by @key{M-x} Useful in this context is the listing of all faces obtained by @key{M-x}
@code{list-faces-display}. @code{list-faces-display}.
@ -193,7 +197,7 @@ font are stored in the variables @code{ns-input-font} and
@code{ns-input-fontsize}, respectively. @code{ns-input-fontsize}, respectively.
@item ns-power-off @item ns-power-off
This event occurs when the user logs out and Emacs is still running, or when This event occurs when the user logs out and Emacs is still running, or when
`Quit Emacs' is chosen from the application menu. `Quit Emacs' is chosen from the application menu.
The default behavior is to save all file-visiting buffers. The default behavior is to save all file-visiting buffers.
@end table @end table
@ -208,26 +212,9 @@ and return the result as a string. You can also use the Lisp function
services and receive the results back. Note that you may need to services and receive the results back. Note that you may need to
restart Emacs to access newly-available services. restart Emacs to access newly-available services.
@node GNUstep Support, , Mac / GNUstep Events, Mac OS / GNUstep @node GNUstep Support, , Mac / GNUstep Events, Mac OS / GNUstep
@section GNUstep Support @section GNUstep Support
Emacs can be built and run under GNUstep, however there are still some Emacs can be built and run under GNUstep, but there are still some
issues to be addressed. Interested developers should contact issues to be addressed. Interested developers should contact
@email{emacs-devel@@gnu.org}. @email{emacs-devel@@gnu.org}.
@c Presumably no longer relevant since CANNOT_DUMP removed 2009-05-06:
@ignore
In particular, it may be necessary to run @samp{make bootstrap} with a
plain X configuration, then @samp{make clean} and @samp{./configure
--with-ns} followed by @samp{make install}.
Currently CANNOT_DUMP is automatically enabled in GNUstep configurations,
because the unex file(s) for GNUstep, mainly @samp{unexelf.c}, have not been
updated yet with the ``zone'' code in and related to @samp{unexmacosx.c}.
@end ignore
@ignore
arch-tag: a822c2ab-4273-4997-927e-c153bb71dcf6
@end ignore

View file

@ -24,20 +24,20 @@ programs.
@section Version Control @section Version Control
@cindex version control @cindex version control
A @dfn{version control system} is a package that can record multiple A @dfn{version control system} is a program that can record multiple
versions of a source file, storing information such as the creation versions of a source file, storing information such as the creation
time of each version, who created it, and a description of what was time of each version, who made it, and a description of what was
changed in that version. changed.
The Emacs version control interface is called VC. Its commands work The Emacs version control interface is called @dfn{VC}. VC commands
with several different version control systems; currently, it supports work with several different version control systems; currently, it
GNU Arch, Bazaar, CVS, Git, Mercurial, Monotone, RCS, SCCS/CSSC, and supports GNU Arch, Bazaar, CVS, Git, Mercurial, Monotone, RCS,
Subversion. Of these, the GNU project distributes CVS, GNU Arch, RCS, SCCS/CSSC, and Subversion. Of these, the GNU project distributes CVS,
and Bazaar. Arch, RCS, and Bazaar.
VC is enabled automatically whenever you visit a file that is VC is enabled automatically whenever you visit a file governed by a
governed by a version control system. To disable VC entirely, set the version control system. To disable VC entirely, set the customizable
customizable variable @code{vc-handled-backends} to @code{nil} variable @code{vc-handled-backends} to @code{nil}
@iftex @iftex
(@pxref{Customizing VC,,,emacs-xtra, Specialized Emacs Features}). (@pxref{Customizing VC,,,emacs-xtra, Specialized Emacs Features}).
@end iftex @end iftex
@ -49,6 +49,7 @@ customizable variable @code{vc-handled-backends} to @code{nil}
* Introduction to VC:: How version control works in general. * Introduction to VC:: How version control works in general.
* VC Mode Line:: How the mode line shows version control status. * VC Mode Line:: How the mode line shows version control status.
* Basic VC Editing:: How to edit a file under version control. * Basic VC Editing:: How to edit a file under version control.
* Log Buffer:: Features available in log entry buffers.
* Old Revisions:: Examining and comparing old versions. * Old Revisions:: Examining and comparing old versions.
* Secondary VC Commands:: The commands used a little less frequently. * Secondary VC Commands:: The commands used a little less frequently.
* VC Directory Mode:: Listing files managed by version control. * VC Directory Mode:: Listing files managed by version control.
@ -65,12 +66,13 @@ customizable variable @code{vc-handled-backends} to @code{nil}
@subsection Introduction to Version Control @subsection Introduction to Version Control
VC allows you to use a version control system from within Emacs, VC allows you to use a version control system from within Emacs,
integrating the version control operations smoothly with editing. integrating the version control operations smoothly with editing. It
Though VC cannot completely bridge the gaps between version control provides a uniform interface for common operations in many version
systems with widely differing capabilities, it does provide a uniform control operations.
interface to many version control operations. Regardless of which
version control system is in use, you will be able to do basic Some uncommon or intricate version control operations, such as
operations in much the same way. altering repository settings, are not supported in VC. You should
perform such tasks outside Emacs, e.g. via the command line.
This section provides a general overview of version control, and This section provides a general overview of version control, and
describes the version control systems that VC supports. You can skip describes the version control systems that VC supports. You can skip
@ -81,6 +83,9 @@ you want to use.
* Why Version Control?:: Understanding the problems it addresses. * Why Version Control?:: Understanding the problems it addresses.
* Version Control Systems:: Supported version control back-end systems. * Version Control Systems:: Supported version control back-end systems.
* VCS Concepts:: Words and concepts related to version control. * VCS Concepts:: Words and concepts related to version control.
* VCS Merging:: How file conflicts are handled.
* VCS Changesets:: How changes are grouped.
* VCS Repositories:: Where version control repositories are stored.
* Types of Log File:: The VCS log in contrast to the ChangeLog. * Types of Log File:: The VCS log in contrast to the ChangeLog.
@end menu @end menu
@ -112,8 +117,8 @@ vitally important form of communication among developers.
@subsubsection Supported Version Control Systems @subsubsection Supported Version Control Systems
@cindex back end (version control) @cindex back end (version control)
VC currently works with many different version control systems or VC currently works with many different version control systems,
@dfn{back ends}: which it refers to as @dfn{back ends}:
@itemize @bullet @itemize @bullet
@ -134,73 +139,60 @@ control system.
@cindex RCS @cindex RCS
@item @item
RCS is the free version control system around which VC was initially RCS is the free version control system around which VC was initially
built. Almost everything you can do with RCS can be done through VC. built. It is relatively primitive: it cannot be used over the
However, you cannot use RCS over the network, and it only works at the network, and works at the level of individual files. Almost
level of individual files rather than projects. everything you can do with RCS can be done through VC.
@cindex CVS @cindex CVS
@item @item
CVS is the free version control system that was, until recently (circa CVS is the free version control system that was, until recently (circa
2008), used by the majority of free software projects. Nowadays, it 2008), used by the majority of free software projects. Nowadays, it
is slowly being superseded by newer systems. CVS allows concurrent is slowly being superseded by newer systems. CVS allows concurrent
multi-user development either locally or over the network. It lacks multi-user development either locally or over the network. Unlike
support for atomic commits or file moving/renaming. VC supports all newer systems, it lacks support for atomic commits and file
basic editing operations under CVS. For some less common tasks, you moving/renaming. VC supports all basic editing operations under CVS.
still need to call CVS from the command line. Note also that before
using CVS you must set up a repository, which is a subject too complex
to treat here.
@cindex SVN @cindex SVN
@cindex Subversion @cindex Subversion
@item @item
Subversion (SVN) is a free version control system designed to be Subversion (SVN) is a free version control system designed to be
similar to CVS but without its problems. It supports atomic commits similar to CVS but without its problems (e.g., it supports atomic
of filesets, and versioning of directories, symbolic links, meta-data, commits of filesets, and versioning of directories, symbolic links,
renames, copies, and deletes. meta-data, renames, copies, and deletes).
@cindex GNU Arch @cindex GNU Arch
@cindex Arch @cindex Arch
@item @item
GNU Arch is a version control system designed for distributed work. GNU Arch is one of the earliest @dfn{distributed} version control
It differs in many ways from older systems like CVS and RCS. It systems (the other being Monotone). @xref{VCS Concepts}, for a
provides different methods for interoperating between users, support description of distributed version control systems. It is no longer
for offline operations, and good branching and merging features. It under active development, and has been deprecated in favor of Bazaar.
also supports atomic commits of filesets and file moving/renaming. VC
does not support all operations provided by GNU Arch, so you must
sometimes invoke it from the command line.
@cindex git @cindex git
@item @item
Git is a distributed version control system invented by Linus Torvalds to support Git is a distributed version control system originally invented by
development of Linux (his kernel). It supports atomic commits of filesets and Linus Torvalds to support development of Linux (his kernel). VC
file moving/renaming. One significant feature of git is that it supports many common git operations, but others, such as repository
largely abolishes the notion of a single centralized repository; syncing, must be done from the command line.
instead, each working copy of a git project is its own repository and
coordination is done through repository-sync operations. VC supports
most git operations, with the exception of news merges and repository
syncing; these must be done from the command line.
@cindex hg @cindex hg
@cindex Mercurial @cindex Mercurial
@item @item
Mercurial (hg) is a distributed version control system broadly Mercurial (hg) is a distributed version control system broadly
resembling GNU Arch and git, with atomic fileset commits and file resembling git. VC supports most Mercurial commands, with the
moving/renaming. Like git, it is fully decentralized. VC supports exception of repository sync operations.
most Mercurial commands, with the exception of repository sync
operations; this needs to be done from the command line.
@cindex bzr @cindex bzr
@cindex Bazaar @cindex Bazaar
@item @item
Bazaar (bzr) is a distributed version control system that supports both Bazaar (bzr) is a distributed version control system that supports
repository-based and distributed versioning, with atomic fileset both repository-based and distributed versioning. VC supports most
commits and file moving/renaming. VC supports most basic editing basic editing operations under Bazaar.
operations under Bazaar.
@end itemize @end itemize
Previous versions of VC supported a version control system known as Previous versions of VC supported a version control system known as
Meta-CVS. This support has been dropped because of limited interest Meta-CVS. This support was dropped due to limited interest from users
from users and developers. and developers.
@node VCS Concepts @node VCS Concepts
@subsubsection Concepts of Version Control @subsubsection Concepts of Version Control
@ -216,11 +208,11 @@ as @dfn{log entries} that describe the changes made to each file.
@cindex work file @cindex work file
@cindex checking out files @cindex checking out files
A file @dfn{checked out} of a repository is called the @dfn{work The copy of a version-controlled file that you actually edit is
file}. You edit the work file and make changes in it, as you would called the @dfn{work file}. You can change each work file as you
with an ordinary file. After you are done with a set of changes, you would an ordinary file. After you are done with a set of changes, you
@dfn{check in} or @dfn{commit} the file; this records the changes in @dfn{commit} (or @dfn{check in}) the changes; this records the changes
the repository, along with a log entry for those changes. in the repository, along with a descriptive log entry.
@cindex revision @cindex revision
@cindex revision ID @cindex revision ID
@ -231,12 +223,15 @@ on the version control system; in the simplest case, it is just an
integer. integer.
To go beyond these basic concepts, you will need to understand three To go beyond these basic concepts, you will need to understand three
aspects in which version control systems differ. aspects in which version control systems differ. As explained in the
They can be locking-based or merging-based; they can be file-based or next three sections, they can be lock-based or merge-based; file-based
changeset-based; and they can be centralized or decentralized. VC or changeset-based; and centralized or decentralized. VC handles all
handles all these modes of operation, but it cannot hide the differences. these modes of operation, but it cannot hide the differences.
@node VCS Merging
@subsubsection Merge-based vs lock-based Version Control
@cindex locking versus merging @cindex locking versus merging
A version control system typically has some mechanism to coordinate A version control system typically has some mechanism to coordinate
between users who want to change the same file. There are two ways to between users who want to change the same file. There are two ways to
do this: merging and locking. do this: merging and locking.
@ -244,8 +239,7 @@ do this: merging and locking.
In a version control system that uses merging, each user may check In a version control system that uses merging, each user may check
out and modify a work file at any time. The system lets you out and modify a work file at any time. The system lets you
@dfn{merge} your work file, which may contain changes that have not @dfn{merge} your work file, which may contain changes that have not
been checked in, with the latest changes that others have checked into been committed, with the latest changes that others have committed.
the repository.
Older version control systems use a @dfn{locking} scheme instead. Older version control systems use a @dfn{locking} scheme instead.
Here, work files are normally read-only. To edit a file, you ask the Here, 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}
it; only one user can lock a given file at any given time. This it; only one user can lock a given file at any given time. This
procedure is analogous to, but different from, the locking that Emacs procedure is analogous to, but different from, the locking that Emacs
uses to detect simultaneous editing of ordinary files uses to detect simultaneous editing of ordinary files
(@pxref{Interlocking}). When you check in your changes, that unlocks (@pxref{Interlocking}). When you commit your changes, that unlocks
the file, and the work file becomes read-only again. Other users may the file, and the work file becomes read-only again. Other users may
then lock the file to make their own changes. then lock the file to make their own changes.
@ -261,8 +255,8 @@ then lock the file to make their own changes.
users try to modify the same file at the same time. Locking systems users try to modify the same file at the same time. Locking systems
have @dfn{lock conflicts}; a user may try to check a file out and be have @dfn{lock conflicts}; a user may try to check a file out and be
unable to because it is locked. In merging systems, @dfn{merge unable to because it is locked. In merging systems, @dfn{merge
conflicts} happen when you check in a change to a file that conflicts conflicts} happen when you commit a change to a file that conflicts
with a change checked in by someone else after your checkout. Both with a change committed by someone else after your checkout. Both
kinds of conflict have to be resolved by human judgment and kinds of conflict have to be resolved by human judgment and
communication. Experience has shown that merging is superior to communication. Experience has shown that merging is superior to
locking, both in convenience to developers and in minimizing the locking, both in convenience to developers and in minimizing the
@ -275,27 +269,33 @@ Distributed version control systems, such as GNU Arch, git, and
Mercurial, are exclusively merging-based. Mercurial, are exclusively merging-based.
VC mode supports both locking and merging version control. The VC mode supports both locking and merging version control. The
terms ``checkin'' and ``checkout'' come from locking-based version terms ``commit'' and ``update'' are used in newer version control
control systems; newer version control systems have slightly different systems; older lock-based systems use the terms ``check in'' and
operations usually called ``commit'' and ``update'', but VC hides the ``check out''. VC hides the differences between them as much as
differences between them as much as possible. possible.
@cindex files versus changesets. @node VCS Changesets
@subsubsection Changeset-based vs File-based Version Control
@cindex changesets
On SCCS, RCS, CVS, and other early version control systems, version On SCCS, RCS, CVS, and other early version control systems, version
control operations are @dfn{file-based}: each file has its own comment control operations are @dfn{file-based}: each file has its own comment
and revision history separate from that of all other files in the and revision history separate from that of all other files. Newer
system. Later systems, beginning with Subversion, are systems, beginning with Subversion, are @dfn{changeset-based}: a
@dfn{changeset-based}: a checkin may include changes to several files, checkin may include changes to several files, and the entire set of
and the entire set of changes is treated as a unit by the system. Any changes is handled as a unit. Any comment associated with the change
comment associated with the change does not belong to a single file, does not belong to a single file, but to the changeset itself.
but to the changeset itself.
Changeset-based version control is more flexible and powerful than Changeset-based version control is more flexible and powerful than
file-based version control; usually, when a change to multiple files file-based version control; usually, when a change to multiple files
has to be reversed, it's good to be able to easily identify and remove has to be reversed, it's good to be able to easily identify and remove
all of it. all of it.
@cindex centralized vs. decentralized version control @node VCS Repositories
@subsubsection Decentralized vs Centralized Repositories
@cindex centralized version control
@cindex decentralized version control
Early version control systems were designed around a Early version control systems were designed around a
@dfn{centralized} model in which each project has only one repository @dfn{centralized} model in which each project has only one repository
used by all developers. SCCS, RCS, CVS, and Subversion share this used by all developers. SCCS, RCS, CVS, and Subversion share this
@ -306,14 +306,12 @@ point for reliability and efficiency.
control, later implemented in git, Mercurial, and Bazaar. A project control, later implemented in git, Mercurial, and Bazaar. A project
may have several different repositories, and these systems support a may have several different repositories, and these systems support a
sort of super-merge between repositories that tries to reconcile their sort of super-merge between repositories that tries to reconcile their
change histories. At the limit, each developer has his/her own change histories. In effect, there is one repository for each
repository, and repository merges replace checkin/commit operations. developer, and repository merges take the place of commit operations.
VC's job is to help you manage the traffic between your personal VC helps you manage the traffic between your personal workfiles and
workfiles and a repository. Whether that repository is a single a repository. Whether the repository is a single master, or one of a
master or one of a network of peer repositories is not something VC network of peer repositories, is not something VC has to care about.
has to care about. Thus, the difference between a centralized and a
decentralized version control system is invisible to VC mode.
@node Types of Log File @node Types of Log File
@subsubsection Types of Log File @subsubsection Types of Log File
@ -323,9 +321,9 @@ decentralized version control system is invisible to VC mode.
Projects that use a version control system can have two types of log Projects that use a version control system can have two types of log
for changes. One is the log maintained by the version control system: for changes. One is the log maintained by the version control system:
each time you check in a change, you fill out a @dfn{log entry} for each time you commit a change, you fill out a @dfn{log entry} for the
the change (@pxref{Log Buffer}). This is called the @dfn{version change (@pxref{Log Buffer}). This is called the @dfn{version control
control log}. log}.
The other kind of log is the file @file{ChangeLog} (@pxref{Change The other kind of log is the file @file{ChangeLog} (@pxref{Change
Log}). It provides a chronological record of all changes to a large Log}). 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
@cindex VC, mode line indicator @cindex VC, mode line indicator
When you visit a file that is under version control, Emacs indicates When you visit a file that is under version control, Emacs indicates
this on the mode line. For example, @samp{RCS-1.3} says that the RCS this on the mode line. For example, @samp{Bzr-1223} says that Bazaar
back end is used for that file, and the current version of the file is is used for that file, and the current revision ID is 1223.
1.3.
The first part of the VC mode-line indicator is the name of the back
end: @samp{RCS}, @samp{CVS}, @samp{Bzr}, etc. The back-end name is
followed by a single character and the version of the file.
The character between the back-end name and the revision ID The character between the back-end name and the revision ID
indicates the version control status of the file. @samp{-} means that indicates the status of the work file. In a merge-based version
the work file is not locked (if locking is in use), or not modified (if control system, a @samp{-} character indicates that the work file is
locking is not in use). @samp{:} indicates that the file is locked, or unmodified, and @samp{:} indicates that it has been modified.
that it is modified. If the file is locked by some other user (for @samp{!} indicates that the file contains conflicts as result of a
recent merge operation (@pxref{Merging}), or that the file was removed
from the version control. Finally, @samp{?} means that the file is
under version control, but is missing from the working tree.
In a lock-based system, @samp{-} indicates an unlocked file, and
@samp{:} a locked file; if the file is locked by another user (for
instance, @samp{jim}), that is displayed as @samp{RCS:jim:1.3}. instance, @samp{jim}), that is displayed as @samp{RCS:jim:1.3}.
@samp{@@} means that the file was locally added, but not yet committed @samp{@@} means that the file was locally added, but not yet committed
to the master repository. @samp{!} indicates that the file contains to the master repository.
conflicts as result of a recent merge operation (@pxref{Merging}), or
that the file was removed from the version control. Finally, @samp{?}
means that the file is under version control, but is missing from the
working tree.
On a graphical display, you can move the mouse over this mode line On a graphical display, you can move the mouse over this mode line
indicator to pop up a ``tool-tip'', which displays a more verbose indicator to pop up a ``tool-tip'', which displays a more verbose
description of the version control status. Pressing @kbd{Mouse-1} description of the version control status. Pressing @kbd{Mouse-1}
over the indicator pops up a menu of VC commands. This menu is over the indicator pops up a menu of VC commands, identical to
identical to the @samp{Tools / Version Control} menu item. @samp{Tools / Version Control} on the menu bar.
@vindex auto-revert-check-vc-info @vindex auto-revert-check-vc-info
When Auto Revert mode (@pxref{Reverting}) reverts a buffer that is 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
version control system; if they are not, Emacs signals an error when version control system; if they are not, Emacs signals an error when
you attempt to execute a command on the fileset. you attempt to execute a command on the fileset.
Support for VC filesets and changeset-based version control systems
is the main improvement to VC in Emacs 23. When you mark multi-file
VC in a VC Directory buffer, VC operations treat them as a VC fileset,
and operate on them all at once if the version control system is
changeset-based. @xref{VC Directory Mode}.
VC filesets are distinct from the ``named filesets'' used for VC filesets are distinct from the ``named filesets'' used for
viewing and visiting files in functional groups (@pxref{Filesets}). viewing and visiting files in functional groups (@pxref{Filesets}).
Unlike named filesets, VC filesets are not named and don't persist Unlike named filesets, VC filesets are not named and don't persist
@ -457,7 +446,6 @@ across sessions.
* VC With A Merging VCS:: Without locking: default mode for CVS. * VC With A Merging VCS:: Without locking: default mode for CVS.
* VC With A Locking VCS:: RCS in its default mode, SCCS, and optionally CVS. * VC With A Locking VCS:: RCS in its default mode, SCCS, and optionally CVS.
* Advanced C-x v v:: Advanced features available with a prefix argument. * Advanced C-x v v:: Advanced features available with a prefix argument.
* Log Buffer:: Features available in log entry buffers.
@end menu @end menu
@node VC With A Merging VCS @node VC With A Merging VCS
@ -490,9 +478,9 @@ If you have not changed the work file, but some other user has checked
in changes to the repository, merge those changes into the work file. in changes to the repository, merge those changes into the work file.
@item @item
If you have made modifications to the work file, attempts to check in If you have made modifications to the work file, attempt to commit
your changes. To do this, Emacs first reads the log entry for the new the changes. To do this, Emacs first reads the log entry for the new
revision (@pxref{Log Buffer}). If some other user has checked in revision (@pxref{Log Buffer}). If some other user has committed
changes to the repository since you last checked it out, the checkin changes to the repository since you last checked it out, the checkin
fails. In that case, type @kbd{C-x v v} again to merge those changes fails. In that case, type @kbd{C-x v v} again to merge those changes
into your own work file; this puts the work file into a ``conflicted'' into 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}}.
These rules also apply when you use RCS in its ``non-locking'' mode, These rules also apply when you use RCS in its ``non-locking'' mode,
except that changes are not automatically merged from the repository. except that changes are not automatically merged from the repository.
Nothing informs you if another user has checked in changes in the same Nothing informs you if another user has committed changes in the same
file since you began editing it; when you check in your revision, his file since you began editing it; when you commit your revision, his
changes are removed (however, they remain in the repository and are changes are removed (however, they remain in the repository and are
thus not irrevocably lost). Therefore, you must verify that the thus not irrevocably lost). Therefore, you must verify that the
current revision is unchanged before checking in your changes. In current 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
can change it. can change it.
@item @item
If the file is locked by you, and contains changes, check in the If the file is locked by you, and contains changes, commit the
changes. In order to do this, Emacs first reads the log entry for the changes. In order to do this, Emacs first reads the log entry for the
new revision. @xref{Log Buffer}. new revision. @xref{Log Buffer}.
@ -544,12 +532,12 @@ locked the file, to inform him of what has happened.
@end itemize @end itemize
These rules also apply when you use CVS in locking mode, except These rules also apply when you use CVS in locking mode, except
that there is no such thing as stealing a lock. that CVS does not support stealing a lock.
@node Advanced C-x v v @node Advanced C-x v v
@subsubsection Advanced Control in @kbd{C-x v v} @subsubsection Advanced Control in @kbd{C-x v v}
@cindex revision ID to check in/out @cindex revision ID in version control
When you give a prefix argument to @code{vc-next-action} (@kbd{C-u When you give a prefix argument to @code{vc-next-action} (@kbd{C-u
C-x v v}), it still performs the next logical version control C-x v v}), it still performs the next logical version control
operation, but accepts additional arguments to specify precisely how operation, but accepts additional arguments to specify precisely how
@ -558,8 +546,8 @@ to do the operation.
@itemize @bullet @itemize @bullet
@item @item
If the file is modified (or locked), you can specify the revision ID If the file is modified (or locked), you can specify the revision ID
to use for the new version that you check in. This is one way to use for the new version that you commit. This is one way to create
to create a new branch (@pxref{Branches}). a new branch (@pxref{Branches}).
@item @item
If the file is not modified (and unlocked), you can specify the If the file is not modified (and unlocked), you can specify the
@ -585,34 +573,53 @@ Features}).
@end itemize @end itemize
@node Log Buffer @node Log Buffer
@subsubsection Features of the Log Entry Buffer @subsection Features of the Log Entry Buffer
When you check in changes, Emacs pops up a buffer called When you tell VC to commit a change, it pops up a buffer called
@samp{*VC-Log*} for you to enter a log entry. @samp{*VC-Log*}. In this buffer, you should write a @dfn{log entry}
describing the changes you have made (@pxref{Why Version Control?}).
After you are done, type @kbd{C-c C-c}; this exits the buffer and
commits the change, together with your log entry.
After you have finished editing the log message, type @kbd{C-c C-c} While in the @samp{*VC-Log*} buffer, you can write one or more
to exit the buffer and commit the change. @dfn{header lines}, specifying additional information to be supplied
to the version control system. Each header line must occupy a single
line at the top of the buffer; the first line that is not a header
line is treated as the start of the log entry. For example, the
following header line states that the present change was not written
by you, but by another developer:
@smallexample
Author: J. R. Hacker <jrh@@example.com>
@end smallexample
@noindent
Apart from the @samp{Author} header, Emacs recognizes the headers
@samp{Date} (a manually-specified commit time) and @samp{Fixes} (a
reference to a bug fixed by the change). Not all version control
systems recognize all headers: Bazaar recognizes all three headers,
while git, Mercurial, and Monotone recognizes only @samp{Author} and
@samp{Summary}. If you specify a header for a version control that
does not support it, the header is treated as part of the log entry.
@findex log-edit-show-files @findex log-edit-show-files
@findex log-edit-show-diff @findex log-edit-show-diff
In the @samp{*VC-Log*} buffer, typing @kbd{C-c C-f} Type @kbd{C-c C-f} (@code{log-edit-show-files}) to display a list of
(@code{log-edit-show-files}) displays a list of files in the VC files in the current VC fileset. If you called @kbd{C-x v v} directly
fileset you are committing. If you called @kbd{C-x v v} directly from from a work file, the fileset consists of that single file; if you
a work file, the VC fileset consists of that single file, so this called @kbd{C-x v v} from a VC directory buffer (@pxref{VC Directory
command is not very useful. If you called @kbd{C-x v v} from a VC Mode}), the fileset may consist of multiple files.
directory buffer, the VC fileset may consist of multiple files
(@pxref{VC Directory Mode}).
@findex log-edit-insert-changelog @findex log-edit-insert-changelog
Type @kbd{C-c C-d} (@code{log-edit-show-diff}) to show a ``diff'' of Type @kbd{C-c C-d} (@code{log-edit-show-diff}) to show a @dfn{diff}
the changes you have made (i.e., the differences between the work file of the changes you have made (i.e., the differences between the work
and the repository revision from which you started editing the file). file and the repository revision from which you started editing).
The diff is displayed in a special buffer in another window. @xref{Old Revisions}.
@xref{Comparing Files}.
If you have written an entry in the @file{ChangeLog} (@pxref{Change If the current VC fileset includes one or more @file{ChangeLog}
Log}), type @kbd{C-c C-a} (@code{log-edit-insert-changelog}) to pull files (@pxref{Change Log}), type @kbd{C-c C-a}
it into the @samp{*VC-Log*} buffer. If the topmost item in the (@code{log-edit-insert-changelog}) to pull the relevant entries into
the @samp{*VC-Log*} buffer. If the topmost item in each
@file{ChangeLog} was made under your user name on the current date, @file{ChangeLog} was made under your user name on the current date,
this command searches that item for entries that match the file(s) to this command searches that item for entries that match the file(s) to
be committed; if found, these entries are inserted. be committed; if found, these entries are inserted.
@ -627,7 +634,7 @@ the revision control log.
To abort a check-in, just @strong{don't} type @kbd{C-c C-c} in that To abort a check-in, just @strong{don't} type @kbd{C-c C-c} in that
buffer. You can switch buffers and do other editing. As long as you buffer. You can switch buffers and do other editing. As long as you
don't try to check in another file, the entry you were editing remains don't try to commit another file, the entry you were editing remains
in the @samp{*VC-Log*} buffer, and you can go back to that buffer at in the @samp{*VC-Log*} buffer, and you can go back to that buffer at
any time to complete the check-in. any time to complete the check-in.
@ -636,7 +643,7 @@ convenient to specify the same log entry for many of the files. (This
is the normal way to do things on a changeset-oriented system, where is the normal way to do things on a changeset-oriented system, where
comments are attached to changesets rather than the history of comments are attached to changesets rather than the history of
individual files.) The most convenient way to do this is to mark all individual files.) The most convenient way to do this is to mark all
the files in VC Directory Mode and check in from there; the log buffer the files in VC Directory Mode and commit from there; the log buffer
will carry the fileset information with it and do a group commit when will carry the fileset information with it and do a group commit when
you type @kbd{C-c C-c}. you type @kbd{C-c C-c}.
@ -648,7 +655,7 @@ work just like the minibuffer history commands (except that these
versions are used outside the minibuffer). versions are used outside the minibuffer).
@vindex vc-log-mode-hook @vindex vc-log-mode-hook
Each time you check in a change, the log entry buffer is put into VC Each time you commit a change, the log entry buffer is put into VC
Log Edit mode, which involves running two hooks: @code{text-mode-hook} Log Edit mode, which involves running two hooks: @code{text-mode-hook}
and @code{vc-log-mode-hook}. @xref{Hooks}. and @code{vc-log-mode-hook}. @xref{Hooks}.
@ -700,8 +707,12 @@ buffer in a separate window.
@kbd{C-x v =} (@code{vc-diff}) compares each file in the current VC @kbd{C-x v =} (@code{vc-diff}) compares each file in the current VC
fileset (saving them if necessary) with the repository revision(s) fileset (saving them if necessary) with the repository revision(s)
from which you started editing. Note that the latter may or may not from which you started editing. Note that the latter may or may not
be the latest revision of the file(s). The diff is displayed in a be the latest revision of the file(s).
special buffer in another window. @xref{Comparing Files}.
The diff is displayed in another window, in a Diff mode buffer
(@pxref{Diff Mode}) named @file{*vc-diff*}. In this buffer, the
@kbd{g} (@code{revert-buffer}) command performs the file comparison
again, generating a new diff.
@findex vc-diff @findex vc-diff
@kindex C-u C-x v = @kindex C-u C-x v =
@ -1008,7 +1019,7 @@ then decide not to change it.
@kindex C-x v c @kindex C-x v c
@findex vc-rollback @findex vc-rollback
To cancel a change that you already checked in, use @kbd{C-x v c} To cancel a change that you already committed, use @kbd{C-x v c}
(@code{vc-rollback}). This command discards all record of the most (@code{vc-rollback}). This command discards all record of the most
recent checked-in revision, but only if your work file corresponds to recent checked-in revision, but only if your work file corresponds to
that revision---you cannot use @kbd{C-x v c} to cancel a revision that that 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:
@noindent @noindent
In this example, @samp{file1.c} is modified with respect to the In this example, @samp{file1.c} is modified with respect to the
repository, and @samp{file2.c} is not. @samp{file3.c} is modified, repository, and @samp{file2.c} is not. @samp{file3.c} is modified,
but other changes have also been checked in to the repository---you but other changes have also been committed---you need to merge them
need to merge them with the work file before you can check it in. with the work file before you can check it in.
@vindex vc-stay-local @vindex vc-stay-local
@vindex vc-cvs-stay-local @vindex vc-cvs-stay-local
@ -1114,7 +1125,7 @@ this includes Version Control subdirectories such as @samp{RCS} and
VC Directory mode has a full set of navigation and marking commands VC Directory mode has a full set of navigation and marking commands
for picking out filesets. Some of these are also available in a for picking out filesets. Some of these are also available in a
context menu invoked by the @kbd{mouse-2} button. context menu invoked by @kbd{mouse-2}.
Up- and down-arrow keys move in the buffer; @kbd{n} and @kbd{p} also Up- and down-arrow keys move in the buffer; @kbd{n} and @kbd{p} also
move vertically as in other list-browsing modes. @key{SPC} and move vertically as in other list-browsing modes. @key{SPC} and
@ -1158,7 +1169,8 @@ directory buffer will be used.
@kbd{M-s a C-s} does an incremental search on the marked files. @kbd{M-s a C-s} does an incremental search on the marked files.
@kbd{M-s a C-M-s} does an incremental search on the marked files. @kbd{M-s a C-M-s} does an incremental regular expression search
on the marked files.
@cindex stashes in version control @cindex stashes in version control
@cindex shelves in version control @cindex shelves in version control
@ -1174,11 +1186,11 @@ buffers. Some single-key shortcuts are available as well; @kbd{=},
@kbd{+}, @kbd{l}, @kbd{i}, and @kbd{v} behave as through prefixed with @kbd{+}, @kbd{l}, @kbd{i}, and @kbd{v} behave as through prefixed with
@kbd{C-x v}. @kbd{C-x v}.
The command @kbd{C-x v v} (@code{vc-next-action}) operates on all the The command @kbd{C-x v v} (@code{vc-next-action}) operates on all
marked files, so that you can check in several files at once. the marked files, so that you can commit several files at once. If
If the underlying VC supports atomic commits of multiple-file the underlying VC supports atomic commits of multiple-file changesets,
changesets, @kbd{C-x v v} with a selected set of modified but not @kbd{C-x v v} with a selected set of modified but not committed files
committed files will commit all of them at once as a single changeset. will commit all of them at once as a single changeset.
When @kbd{C-x v v} (@code{vc-next-action}) operates on multiple When @kbd{C-x v v} (@code{vc-next-action}) operates on multiple
files, all of those files must be either in the same state or in files, all of those files must be either in the same state or in
@ -1261,15 +1273,15 @@ other branch.
@node Creating Branches @node Creating Branches
@subsubsection Creating New Branches @subsubsection Creating New Branches
To create a new branch from a head revision (one that is the latest in To create a new branch from a head revision (one that is the latest
the branch that contains it), first select that revision if necessary, in the branch that contains it), first select that revision if
lock it with @kbd{C-x v v}, and make whatever changes you want. Then, necessary, lock it with @kbd{C-x v v}, and make whatever changes you
when you check in the changes, use @kbd{C-u C-x v v}. This lets you want. Then, when you commit the changes, use @kbd{C-u C-x v v}. This
specify the revision ID for the new revision. You should specify a lets you specify the revision ID for the new revision. You should
suitable branch ID for a branch starting at the current revision. specify a suitable branch ID for a branch starting at the current
For example, if the current revision is 2.5, the branch ID should be revision. For example, if the current revision is 2.5, the branch ID
2.5.1, 2.5.2, and so on, depending on the number of existing branches at should be 2.5.1, 2.5.2, and so on, depending on the number of existing
that point. branches at that point.
To create a new branch at an older revision (one that is no longer the To create a new branch at an older revision (one that is no longer the
head of a branch), first select that revision (@pxref{Switching head 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,
you'll be offered a chance to lock the latest revision instead. On you'll be offered a chance to lock the latest revision instead. On
a merging-based VCS you will skip this step. a merging-based VCS you will skip this step.
Then make your changes and type @kbd{C-x v v} again to check in a new Then make your changes and type @kbd{C-x v v} again to commit a new
revision. This automatically creates a new branch starting from the revision. This automatically creates a new branch starting from the
selected revision. You need not specially request a new branch, because selected revision. You need not specially request a new branch,
that's the only way to add a new revision at a point that is not the head because that's the only way to add a new revision at a point that is
of a branch. not the head of a branch.
After the branch is created, you ``stay'' on it. That means that After the branch is created, you ``stay'' on it. That means that
subsequent check-ins create new revisions on that branch. To leave the subsequent 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,
type @kbd{C-x v m 1.3.1 @key{RET}}. This takes the entire set of changes on type @kbd{C-x v m 1.3.1 @key{RET}}. This takes the entire set of changes on
branch 1.3.1 (relative to revision 1.3, where the branch started, up to branch 1.3.1 (relative to revision 1.3, where the branch started, up to
the last revision on the branch) and merges it into the current revision the last revision on the branch) and merges it into the current revision
of the work file. You can now check in the changed file, thus creating of the work file. You can now commit the changed file, thus creating
revision 1.6 containing the changes from the branch. revision 1.6 containing the changes from the branch.
It is possible to do further editing after merging the branch, before It is possible to do further editing after merging the branch, before
the next check-in. But it is usually wiser to check in the merged the next check-in. But it is usually wiser to commit the merged
revision, then lock it and make the further changes. This will keep revision, then lock it and make the further changes. This will keep
a better record of the history of changes. a better record of the history of changes.
@ -1374,7 +1386,7 @@ master file revision with user B's changes in it is 1.11.
Then you can resolve the conflicts by editing the file manually. Or Then you can resolve the conflicts by editing the file manually. Or
you can type @code{M-x vc-resolve-conflicts} after visiting the file. you can type @code{M-x vc-resolve-conflicts} after visiting the file.
This starts an Ediff session, as described above. Don't forget to This starts an Ediff session, as described above. Don't forget to
check in the merged version afterwards. commit the merged version afterwards.
@node Multi-User Branching @node Multi-User Branching
@subsubsection Multi-User Branching @subsubsection Multi-User Branching

View file

@ -594,7 +594,7 @@ headers.
@vindex vc-handled-backends @vindex vc-handled-backends
The variable @code{vc-handled-backends} determines which version The variable @code{vc-handled-backends} determines which version
control systems VC should handle. The default value is @code{(RCS CVS control systems VC should handle. The default value is @code{(RCS CVS
SVN SCCS BZR GIT HG Arch)}, so it contains all the version systems SVN SCCS Bzr Git Hg Mtn Arch)}, so it contains all the version systems
that are currently supported. If you want VC to ignore one or more of that are currently supported. If you want VC to ignore one or more of
these systems, exclude its name from the list. To disable VC entirely, these systems, exclude its name from the list. To disable VC entirely,
set this variable to @code{nil}. set this variable to @code{nil}.
@ -657,8 +657,8 @@ variable does not affect @kbd{C-x v c}; that operation is so drastic
that it should always ask for confirmation.) that it should always ask for confirmation.)
@vindex vc-command-messages @vindex vc-command-messages
VC mode does much of its work by running the shell commands for RCS, VC mode does much of its work by running the shell commands for the
CVS and SCCS. If @code{vc-command-messages} is non-@code{nil}, VC appropriate backend. If @code{vc-command-messages} is non-@code{nil}, VC
displays messages to indicate which shell commands it runs, and displays messages to indicate which shell commands it runs, and
additional messages when the commands finish. additional messages when the commands finish.

View file

@ -1,3 +1,33 @@
2010-11-27 Chong Yidong <cyd@stupidchicken.com>
* nonascii.texi (Converting Representations): Document
byte-to-string.
* strings.texi (Creating Strings): Don't mention semi-obsolete
function char-to-string.
(String Conversion): Shorten discussion of semi-obsolete function
string-to-char. Link to Converting Representations.
* objects.texi (Symbol Type):
* text.texi (Near Point):
* help.texi (Help Functions):
* functions.texi (Mapping Functions): Use string instead of
char-to-string in examples.
2010-11-27 Chong Yidong <cyd@stupidchicken.com>
* text.texi (Kill Functions, Kill Functions)
(Low-Level Kill Ring, Low-Level Kill Ring): Remove obsolete
YANK-HANDLER args.
* symbols.texi (Creating Symbols): Using unintern without an
obarray arg is now obsolete.
* numbers.texi (Float Basics): Document float-e and float-pi.
* variables.texi (Defining Variables): Change "pi" example to
"float-pi".
2010-11-26 Eli Zaretskii <eliz@gnu.org> 2010-11-26 Eli Zaretskii <eliz@gnu.org>
* commands.texi (Click Events): Document the values of X, Y and * commands.texi (Click Events): Document the values of X, Y and

View file

@ -818,7 +818,7 @@ length of @var{sequence}. For example:
@result{} (a c e) @result{} (a c e)
(mapcar '1+ [1 2 3]) (mapcar '1+ [1 2 3])
@result{} (2 3 4) @result{} (2 3 4)
(mapcar 'char-to-string "abc") (mapcar 'string "abc")
@result{} ("a" "b" "c") @result{} ("a" "b" "c")
@end group @end group

View file

@ -546,7 +546,7 @@ follows:
@smallexample @smallexample
@group @group
(define-key global-map (char-to-string help-char) 'help-command) (define-key global-map (string help-char) 'help-command)
(fset 'help-command help-map) (fset 'help-command help-map)
@end group @end group
@end smallexample @end smallexample

View file

@ -199,6 +199,13 @@ unibyte string, it is returned unchanged. Use this function for
characters. characters.
@end defun @end defun
@defun byte-to-string byte
@cindex byte to string
This function returns a unibyte string containing a single byte of
character data, @var{character}. It signals a error if
@var{character} is not an integer between 0 and 255.
@end defun
@defun multibyte-char-to-unibyte char @defun multibyte-char-to-unibyte char
This converts the multibyte character @var{char} to a unibyte This converts the multibyte character @var{char} to a unibyte
character, and returns that character. If @var{char} is neither character, and returns that character. If @var{char} is neither

View file

@ -224,6 +224,14 @@ down to an integer.
@end example @end example
@end defun @end defun
@defvar float-e
The mathematical constant @math{e} (2.71828@dots{}).
@end defvar
@defvar float-pi
The mathematical constant @math{pi} (3.14159@dots{}).
@end defvar
@node Predicates on Numbers @node Predicates on Numbers
@section Type Predicates for Numbers @section Type Predicates for Numbers
@cindex predicates for numbers @cindex predicates for numbers

View file

@ -582,7 +582,6 @@ makes it invalid as a number.
@group @group
foo ; @r{A symbol named @samp{foo}.} foo ; @r{A symbol named @samp{foo}.}
FOO ; @r{A symbol named @samp{FOO}, different from @samp{foo}.} FOO ; @r{A symbol named @samp{FOO}, different from @samp{foo}.}
char-to-string ; @r{A symbol named @samp{char-to-string}.}
@end group @end group
@group @group
1+ ; @r{A symbol named @samp{1+}} 1+ ; @r{A symbol named @samp{1+}}

View file

@ -126,9 +126,8 @@ This function returns a string made up of @var{count} repetitions of
@result{} "" @result{} ""
@end example @end example
Other functions to compare with this one include @code{char-to-string} Other functions to compare with this one include @code{make-vector}
(@pxref{String Conversion}), @code{make-vector} (@pxref{Vectors}), and (@pxref{Vectors}) and @code{make-list} (@pxref{Building Lists}).
@code{make-list} (@pxref{Building Lists}).
@end defun @end defun
@defun string &rest characters @defun string &rest characters
@ -565,38 +564,6 @@ of text characters and general input events
(@code{single-key-description} and @code{text-char-description}). These (@code{single-key-description} and @code{text-char-description}). These
are used primarily for making help messages. are used primarily for making help messages.
@defun char-to-string character
@cindex character to string
This function returns a new string containing one character,
@var{character}. This function is semi-obsolete because the function
@code{string} is more general. @xref{Creating Strings}.
@end defun
@defun string-to-char string
@cindex string to character
This function returns the first character in @var{string}. If the
string is empty, the function returns 0. The value is also 0 when the
first character of @var{string} is the null character, @acronym{ASCII} code
0.
@example
(string-to-char "ABC")
@result{} 65
(string-to-char "xyz")
@result{} 120
(string-to-char "")
@result{} 0
@group
(string-to-char "\000")
@result{} 0
@end group
@end example
This function may be eliminated in the future if it does not seem useful
enough to retain.
@end defun
@defun number-to-string number @defun number-to-string number
@cindex integer to string @cindex integer to string
@cindex integer to decimal @cindex integer to decimal
@ -657,21 +624,41 @@ this function returns 0.
@findex string-to-int @findex string-to-int
@code{string-to-int} is an obsolete alias for this function. @code{string-to-int} is an obsolete alias for this function.
@end defun
@defun char-to-string character
@cindex character to string
This function returns a new string containing one character,
@var{character}. This function is semi-obsolete because the function
@code{string} is more general. @xref{Creating Strings}.
@end defun
@defun string-to-char string
This function returns the first character in @var{string}. This
mostly identical to @code{(aref string 0)}, except that it returns 0
if the string is empty. (The value is also 0 when the first character
of @var{string} is the null character, @acronym{ASCII} code 0.) This
function may be eliminated in the future if it does not seem useful
enough to retain.
@end defun @end defun
Here are some other functions that can convert to or from a string: Here are some other functions that can convert to or from a string:
@table @code @table @code
@item concat @item concat
@code{concat} can convert a vector or a list into a string. This function converts a vector or a list into a string.
@xref{Creating Strings}. @xref{Creating Strings}.
@item vconcat @item vconcat
@code{vconcat} can convert a string into a vector. @xref{Vector This function converts a string into a vector. @xref{Vector
Functions}. Functions}.
@item append @item append
@code{append} can convert a string into a list. @xref{Building Lists}. This function converts a string into a list. @xref{Building Lists}.
@item byte-to-string
This function converts a byte of character data into a unibyte string.
@xref{Converting Representations}.
@end table @end table
@node Formatting Strings @node Formatting Strings

View file

@ -383,7 +383,7 @@ See @code{documentation} in @ref{Accessing Documentation}, for another
example using @code{mapatoms}. example using @code{mapatoms}.
@end defun @end defun
@defun unintern symbol &optional obarray @defun unintern symbol obarray
This function deletes @var{symbol} from the obarray @var{obarray}. If This function deletes @var{symbol} from the obarray @var{obarray}. If
@code{symbol} is not actually in the obarray, @code{unintern} does @code{symbol} is not actually in the obarray, @code{unintern} does
nothing. If @var{obarray} is @code{nil}, the current obarray is used. nothing. If @var{obarray} is @code{nil}, the current obarray is used.

View file

@ -87,7 +87,7 @@ buffer is @samp{@@}:
@example @example
@group @group
(char-to-string (char-after 1)) (string (char-after 1))
@result{} "@@" @result{} "@@"
@end group @end group
@end example @end example
@ -122,9 +122,9 @@ but there is no peace.
@end group @end group
@group @group
(char-to-string (preceding-char)) (string (preceding-char))
@result{} "a" @result{} "a"
(char-to-string (following-char)) (string (following-char))
@result{} "c" @result{} "c"
@end group @end group
@end example @end example
@ -866,7 +866,7 @@ adds it to the most recent element. It determines automatically (using
@code{last-command}) whether the previous command was a kill command, @code{last-command}) whether the previous command was a kill command,
and if so appends the killed text to the most recent entry. and if so appends the killed text to the most recent entry.
@deffn Command kill-region start end &optional yank-handler @deffn Command kill-region start end
This function kills the text in the region defined by @var{start} and This function kills the text in the region defined by @var{start} and
@var{end}. The text is deleted but saved in the kill ring, along with @var{end}. The text is deleted but saved in the kill ring, along with
its text properties. The value is always @code{nil}. its text properties. The value is always @code{nil}.
@ -874,17 +874,10 @@ its text properties. The value is always @code{nil}.
In an interactive call, @var{start} and @var{end} are point and In an interactive call, @var{start} and @var{end} are point and
the mark. the mark.
@c Emacs 19 feature
If the buffer or text is read-only, @code{kill-region} modifies the kill If the buffer or text is read-only, @code{kill-region} modifies the kill
ring just the same, then signals an error without modifying the buffer. ring just the same, then signals an error without modifying the buffer.
This is convenient because it lets the user use a series of kill This is convenient because it lets the user use a series of kill
commands to copy text from a read-only buffer into the kill ring. commands to copy text from a read-only buffer into the kill ring.
If @var{yank-handler} is non-@code{nil}, this puts that value onto
the string of killed text, as a @code{yank-handler} text property.
@xref{Yanking}. Note that if @var{yank-handler} is @code{nil}, any
@code{yank-handler} properties present on the killed text are copied
onto the kill ring, like other text properties.
@end deffn @end deffn
@defopt kill-read-only-ok @defopt kill-read-only-ok
@ -1069,7 +1062,7 @@ it returns the entry pointed at by the yanking pointer and does not
move the yanking pointer. move the yanking pointer.
@end defun @end defun
@defun kill-new string &optional replace yank-handler @defun kill-new string &optional replace
This function pushes the text @var{string} onto the kill ring and This function pushes the text @var{string} onto the kill ring and
makes the yanking pointer point to it. It discards the oldest entry makes the yanking pointer point to it. It discards the oldest entry
if appropriate. It also invokes the value of if appropriate. It also invokes the value of
@ -1078,25 +1071,15 @@ if appropriate. It also invokes the value of
If @var{replace} is non-@code{nil}, then @code{kill-new} replaces the If @var{replace} is non-@code{nil}, then @code{kill-new} replaces the
first element of the kill ring with @var{string}, rather than pushing first element of the kill ring with @var{string}, rather than pushing
@var{string} onto the kill ring. @var{string} onto the kill ring.
If @var{yank-handler} is non-@code{nil}, this puts that value onto
the string of killed text, as a @code{yank-handler} property.
@xref{Yanking}. Note that if @var{yank-handler} is @code{nil}, then
@code{kill-new} copies any @code{yank-handler} properties present on
@var{string} onto the kill ring, as it does with other text properties.
@end defun @end defun
@defun kill-append string before-p &optional yank-handler @defun kill-append string before-p
This function appends the text @var{string} to the first entry in the This function appends the text @var{string} to the first entry in the
kill ring and makes the yanking pointer point to the combined entry. kill ring and makes the yanking pointer point to the combined entry.
Normally @var{string} goes at the end of the entry, but if Normally @var{string} goes at the end of the entry, but if
@var{before-p} is non-@code{nil}, it goes at the beginning. This @var{before-p} is non-@code{nil}, it goes at the beginning. This
function also invokes the value of @code{interprogram-cut-function} function also invokes the value of @code{interprogram-cut-function}
(see below). This handles @var{yank-handler} just like (see below).
@code{kill-new}, except that if @var{yank-handler} is different from
the @code{yank-handler} property of the first entry of the kill ring,
@code{kill-append} pushes the concatenated string onto the kill ring,
instead of replacing the original first entry with it.
@end defun @end defun
@defvar interprogram-paste-function @defvar interprogram-paste-function

View file

@ -544,21 +544,23 @@ not the buffer-local value. (But you should not be making
buffer-local bindings for a symbol that is defined with buffer-local bindings for a symbol that is defined with
@code{defconst}.) @code{defconst}.)
Here, @code{pi} is a constant that presumably ought not to be changed An example of the use of @code{defconst} is Emacs' definition of
by anyone (attempts by the Indiana State Legislature notwithstanding). @code{float-pi}---the mathematical constant @math{pi}, which ought not
As the second form illustrates, however, this is only advisory. to be changed by anyone (attempts by the Indiana State Legislature
notwithstanding). As the second form illustrates, however,
@code{defconst} is only advisory.
@example @example
@group @group
(defconst pi 3.1415 "Pi to five places.") (defconst float-pi 3.141592653589793 "The value of Pi.")
@result{} pi @result{} float-pi
@end group @end group
@group @group
(setq pi 3) (setq float-pi 3)
@result{} pi @result{} float-pi
@end group @end group
@group @group
pi float-pi
@result{} 3 @result{} 3
@end group @end group
@end example @end example

View file

@ -1,3 +1,8 @@
2010-11-27 Glenn Morris <rgm@gnu.org>
James Clark <none@example.com>
* nxml-mode.texi (Introduction): New section.
2010-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org> 2010-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
* gnus.texi (Server Commands): Document gnus-server-show-server. * gnus.texi (Server Commands): Document gnus-server-show-server.

View file

@ -8,7 +8,8 @@
This manual documents nxml-mode, an Emacs major mode for editing This manual documents nxml-mode, an Emacs major mode for editing
XML with RELAX NG support. XML with RELAX NG support.
Copyright @copyright{} 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Copyright @copyright{} 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
@quotation @quotation
Permission is granted to copy, distribute and/or modify this document Permission 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.
This manual is not yet complete. This manual is not yet complete.
@menu @menu
* Introduction::
* Completion:: * Completion::
* Inserting end-tags:: * Inserting end-tags::
* Paragraphs:: * Paragraphs::
@ -52,6 +54,58 @@ This manual is not yet complete.
* Limitations:: * Limitations::
@end menu @end menu
@node Introduction
@chapter Introduction
nXML mode is an Emacs major-mode for editing XML documents. It supports
editing well-formed XML documents, and provides schema-sensitive editing
using RELAX NG Compact Syntax. To get started, visit a file containing an
XML document, and, if necessary, use @kbd{M-x nxml-mode} to switch to nXML
mode. By default, @code{auto-mode-alist} and @code{magic-fallback-alist}
put buffers in nXML mode if they have recognizable XML content or file
extensions. You may wish to customize the settings, for example to
recognize different file extensions.
Once in nXML mode, you can type @kbd{C-h m} for basic information on the
mode.
The @file{etc/nxml} directory in the Emacs distribution contains some data
files used by nXML mode, and includes two files (@file{test.valid.xml} and
@file{test.invalid.xml}) that provide examples of valid and invalid XML
documents.
To get validation and schema-sensitive editing, you need a RELAX NG Compact
Syntax (RNC) schema for your document (@pxref{Locating a schema}). The
@file{etc/schema} directory includes some schemas for popular document
types. See @url{http://relaxng.org/} for more information on RELAX NG.
You can use the @samp{Trang} program from
@url{http://www.thaiopensource.com/relaxng/trang.html} to
automatically create RNC schemas. This program can:
@itemize @bullet
@item
infer an RNC schema from an instance document;
@item
convert a DTD to an RNC schema;
@item
convert a RELAX NG XML syntax schema to an RNC schema.
@end itemize
@noindent To convert a RELAX NG XML syntax (@samp{.rng}) schema to a RNC
one, you can also use the XSLT stylesheet from
@url{http://www.pantor.com/download.html}.
To convert a W3C XML Schema to an RNC schema, you need first to convert it
to RELAX NG XML syntax using the RELAX NG converter tool @code{rngconv}
(built on top of MSV). See @url{https://github.com/kohsuke/msv}
and @url{https://msv.dev.java.net/}.
For historical discussions only, see the mailing list archives at
@url{http://groups.yahoo.com/group/emacs-nxml-mode/}. Please make all new
discussions on the @samp{help-gnu-emacs} and @samp{emacs-devel} mailing
lists. Report any bugs with @kbd{M-x report-emacs-bug}.
@node Completion @node Completion
@chapter Completion @chapter Completion
@ -855,6 +909,3 @@ specification are not enforced.
@bye @bye
@ignore
arch-tag: 3b6e8ac2-ae8d-4f38-bd43-ce9f80be04d6
@end ignore

View file

@ -1,3 +1,7 @@
2010-11-27 Ulrich Mueller <ulm@gentoo.org>
* HELLO: Add ancient Greek (Bug#7418).
2010-11-13 Eli Zaretskii <eliz@gnu.org> 2010-11-13 Eli Zaretskii <eliz@gnu.org>
* NEWS: Document display of glyphless characters. * NEWS: Document display of glyphless characters.

View file

@ -33,6 +33,7 @@ French (fran,Ag(Bais) Bonjour / Salut
Georgian ($,1JEJ0J@J7J5J4J:J8(B) $,1J2J0J;J0J@JOJ=J1J0(B Georgian ($,1JEJ0J@J7J5J4J:J8(B) $,1J2J0J;J0J@JOJ=J1J0(B
German (Deutsch) Guten Tag / Gr,A|_(B Gott German (Deutsch) Guten Tag / Gr,A|_(B Gott
Greek (,Fekkgmij\(B) ,FCei\(B ,Fsar(B Greek (,Fekkgmij\(B) ,FCei\(B ,Fsar(B
Greek, ancient ($,1p1,Fkkgmij^(B) ,FO$,1pv,Fk](B ,Fte(B ,Fja$,1q6(B ,Fl]ca(B ,Fwa$,1r6,Fqe(B
Gujarati ($,19W:!9\9p9~9d: (B) $,19h9n9x:-9d:'(B Gujarati ($,19W:!9\9p9~9d: (B) $,19h9n9x:-9d:'(B
Hebrew $,1ro(B($,1-",q-(,y-*(B) ,Hylem(B Hebrew $,1ro(B($,1-",q-(,y-*(B) ,Hylem(B
Hungarian (magyar) Sz,Bi(Bp j,Bs(B napot! Hungarian (magyar) Sz,Bi(Bp j,Bs(B napot!

View file

@ -21,9 +21,6 @@ with a prefix argument or by typing C-u C-h C-n.
* Changes in Emacs 23.3 * Changes in Emacs 23.3
** The nextstep port can have different modifiers for the left and right
alt/option key by customizing the value for ns-right-alternate-modifier.
* Editing Changes in Emacs 23.3 * Editing Changes in Emacs 23.3
@ -34,6 +31,42 @@ alt/option key by customizing the value for ns-right-alternate-modifier.
** The appt-add command takes an optional argument for the warning time. ** The appt-add command takes an optional argument for the warning time.
This can be used in place of the default appt-message-warning-time. This can be used in place of the default appt-message-warning-time.
---
** You can allow inferior Python processes to load modules from the
current directory by setting `python-remove-cwd-from-path' to nil.
** VC and related modes
*** New VC command `vc-log-incoming', bound to `C-x v I'.
This shows a log of changes to be received with a pull operation.
For Git, this runs "git fetch" to make the necessary data available
locally; this requires version 1.7 or newer.
*** New VC command `vc-log-outgoing', bound to `C-x v O'.
This shows a log of changes to be sent in the next commit.
*** New VC command vc-find-conflicted-file.
+++
*** The 'g' key in VC diff, log, log-incoming and log-outgoing buffers
reruns the corresponding VC command to compute an up to date version
of the buffer.
*** vc-dir for Bzr supports viewing shelve contents and shelving snapshots.
+++
*** Special markup can be added to log-edit buffers.
You can add headers specifying additional information to be supplied
to the version control system. For example:
Author: J. R. Hacker <jrh@example.com>
Fixes: 4204
Actual text of log entry...
Bazaar recognizes the headers "Author", "Date" and "Fixes".
Git, Mercurial, and Monotone recognize "Author" and "Date".
Any unknown header is left as is in the message, so it is not lost.
** Obsolete packages ** Obsolete packages
+++ +++
@ -41,10 +74,12 @@ This can be used in place of the default appt-message-warning-time.
* New Modes and Packages in Emacs 23.3 * New Modes and Packages in Emacs 23.3
** smie.el is a generic navigation and indentation engine. ** smie.el is a generic navigation and indentation engine.
It takes a simple BNF description of the grammar, and provides both It takes a simple BNF description of the grammar, and provides both
sexp-style navigation (jumping over begin..end pairs) as well as sexp-style navigation (jumping over begin..end pairs) as well as
indentation, which can be adjusted via ad-hoc indentation rules. indentation, which can be adjusted via ad-hoc indentation rules.
* Incompatible Lisp Changes in Emacs 23.3 * Incompatible Lisp Changes in Emacs 23.3
@ -55,16 +90,29 @@ starting from the first line of text below the header line.
* Lisp changes in Emacs 23.3 * Lisp changes in Emacs 23.3
+++
** `e' and `pi' are now called `float-e' and `float-pi'. ** `e' and `pi' are now called `float-e' and `float-pi'.
The old names are obsolete. The old names are obsolete.
** The use of unintern without an obarray arg is declared obsolete.
** The function `princ-list' is declared obsolete. +++
** The yank-handler argument to kill-region and friends is declared obsolete. ** The use of unintern without an obarray arg is now obsolete.
---
** The function `princ-list' is now obsolete.
+++
** The yank-handler argument to kill-region and friends is now obsolete.
+++
** New function byte-to-string, like char-to-string but for bytes. ** New function byte-to-string, like char-to-string but for bytes.
* Changes in Emacs 23.3 on non-free operating systems * Changes in Emacs 23.3 on non-free operating systems
+++
** The nextstep port can have different modifiers for the left and right
alt/option key by customizing the value for ns-right-alternate-modifier.
* Installation Changes in Emacs 23.2 * Installation Changes in Emacs 23.2

View file

@ -1,3 +1,8 @@
2010-11-27 Joe Matarazzo <joe.matarazzo@gmail.com> (tiny change)
* ebrowse.c (yylex): If end of input buffer encountered while
searching for a newline after "//", return YYEOF. (Bug#7446)
2010-11-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 2010-11-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
* emacsclient.c (set_local_socket) [DARWIN_OS]: Add fall-back * emacsclient.c (set_local_socket) [DARWIN_OS]: Add fall-back

View file

@ -1700,6 +1700,11 @@ yylex (void)
case '/': case '/':
while (GET (c) && c != '\n') while (GET (c) && c != '\n')
; ;
/* Don't try to read past the end of the input buffer if
the file ends in a C++ comment without a newline. */
if (c == 0)
return YYEOF;
INCREMENT_LINENO; INCREMENT_LINENO;
break; break;

View file

@ -1,3 +1,113 @@
2010-11-27 Chong Yidong <cyd@stupidchicken.com>
* log-edit.el (log-edit-font-lock-keywords): Don't try matching
stand-alone lines, since that is handled by log-edit-match-to-eoh
(Bug#6465).
2010-11-27 Eduard Wiebe <usenet@pusto.de>
* dired.el (dired-get-filename): Replace backslashes with slashes
in file names on MS-Windows, needed by `locate'. (Bug#7308)
* locate.el (locate-default-make-command-line): Don't consider
drive letter and root directory part of
`directory-listing-before-filename-regexp'. (Bug#7308)
(locate-post-command-hook, locate-post-command-hook): New defcustoms.
2010-11-27 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/smie.el (smie-prec2->grammar): Simplify handling
of :smie-open/close-alist.
(smie-next-sexp): Make it accept a "start token" as argument.
(smie-indent-keyword): Be careful not to misidentify tokens that span
more than one line, as empty lines. Add argument `token'.
2010-11-27 Kenichi Handa <handa@m17n.org>
* mail/rmailmm.el (rmail-mime-insert-multipart): For unsupported
multipart subtypes, insert all as usual.
* mail/rmail.el: Require rfc2047.
2010-11-27 Kenichi Handa <handa@m17n.org>
* mail/rmailmm.el (rmail-mime-entity, rmail-mime-entity-type)
(rmail-mime-entity-disposition)
(rmail-mime-entity-transfer-encoding, rmail-mime-entity-header)
(rmail-mime-entity-body, rmail-mime-entity-children): New functions.
(rmail-mime-save): Handle the case that the button's `data' is a
MIME entity.
(rmail-mime-insert-text): New function.
(rmail-mime-insert-image): Handle the case that DATA is a MIME
entity.
(rmail-mime-bulk-handler): Just call rmail-mime-insert-bulk.
(rmail-mime-insert-bulk): New function mostly copied from the old
rmail-mime-bulk-handler.
(rmail-mime-multipart-handler): Just call
rmail-mime-process-multipart.
(rmail-mime-process-multipart): New funciton mostly copied from
the old rmail-mime-multipart-handler.
(rmail-mime-show): Just call rmail-mime-process.
(rmail-mime-process): New funciton mostly copied from the old
rmail-mime-show.
(rmail-mime-insert-multipart, rmail-mime-parse)
(rmail-mime-insert, rmail-show-mime)
(rmail-insert-mime-forwarded-message)
(rmail-insert-mime-resent-message): New functions.
(rmail-insert-mime-forwarded-message-function): Set to
rmail-insert-mime-forwarded-message.
(rmail-insert-mime-resent-message-function): Set to
rmail-insert-mime-resent-message.
* mail/rmailsum.el: Require rfc2047.
(rmail-header-summary): Handle multiline Subject: field.
(rmail-summary-line-decoder): Change the default to
rfc2047-decode-string.
* mail/rmail.el (rmail-enable-mime): Change the default to t.
(rmail-mime-feature): Change the default to `rmailmm'.
(rmail-quit): Delete the specifal code for rmail-enable-mime.
(rmail-display-labels): Likewise.
(rmail-show-message-1): Check rmail-enable-mime, and use
rmail-show-mime-function for a MIME message. Decode the headers
according to RFC2047.
2010-11-27 Stefan Monnier <monnier@iro.umontreal.ca>
* progmodes/which-func.el (which-func-imenu-joiner-function):
Return a string, as expected.
(which-function-mode): Make sure we stop any previous timer before
starting a new one.
2010-11-27 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (tramp-default-method-alist)
(tramp-default-user-alist, tramp-default-proxies-alist):
Adapt custom options type. (Bug#7445)
2010-11-27 Chong Yidong <cyd@stupidchicken.com>
* progmodes/python.el: Add Ipython support (Bug#5390).
(python-shell-prompt-alist)
(python-shell-continuation-prompt-alist): New options.
(python--set-prompt-regexp): New function.
(inferior-python-mode, run-python, python-shell):
Require ansi-color. Use python--set-prompt-regexp to set the comint
prompt based on the Python interpreter.
(python--prompt-regexp): New var.
(python-check-comint-prompt)
(python-comint-output-filter-function): Use it.
(run-python): Use a pipe (Bug#5694).
2010-11-27 Chong Yidong <cyd@stupidchicken.com>
* progmodes/python.el (run-python): Doc fix.
(python-keep-current-directory-in-path): New var (Bug#7454).
2010-11-27 Chong Yidong <cyd@stupidchicken.com>
* lpr.el (lpr-buffer, print-buffer, lpr-region, print-region):
Prompt user before actually printing.
2010-11-27 Eli Zaretskii <eliz@gnu.org> 2010-11-27 Eli Zaretskii <eliz@gnu.org>
* international/characters.el (glyphless-char-display-control): * international/characters.el (glyphless-char-display-control):
@ -227,7 +337,8 @@
2010-11-18 Stefan Monnier <monnier@iro.umontreal.ca> 2010-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
* simple.el (kill-new, kill-append, kill-region): * simple.el (kill-new, kill-append, kill-region):
* comint.el (comint-kill-region): Make the yank-handler argument obsolete. * comint.el (comint-kill-region): Make the yank-handler argument
obsolete.
2010-11-18 Stefan Monnier <monnier@iro.umontreal.ca> 2010-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
@ -6074,7 +6185,7 @@
* vc/vc-annotate.el (vc-annotate): Add an optional argument for the * vc/vc-annotate.el (vc-annotate): Add an optional argument for the
VC backend. Use it when non-nil. VC backend. Use it when non-nil.
(vc-annotate-warp-revision): Pass the VC backend to vc-annotate. (vc-annotate-warp-revision): Pass the VC backend to vc-annotate.
(Bug#6487) (Bug#6487).
Fix vc-annotate-show-changeset-diff-revision-at-line for git. Fix vc-annotate-show-changeset-diff-revision-at-line for git.
* vc/vc-annotate.el (vc-annotate-show-diff-revision-at-line-internal): * vc/vc-annotate.el (vc-annotate-show-diff-revision-at-line-internal):
@ -9735,7 +9846,8 @@
2010-02-06 Dan Nicolaescu <dann@ics.uci.edu> 2010-02-06 Dan Nicolaescu <dann@ics.uci.edu>
* vc-bzr.el (vc-bzr-dir-extra-headers): Disable the pending merges header. * vc-bzr.el (vc-bzr-dir-extra-headers):
Disable the pending merges header.
2010-02-05 Juri Linkov <juri@jurta.org> 2010-02-05 Juri Linkov <juri@jurta.org>
@ -10624,8 +10736,8 @@
2009-12-18 Ulf Jasper <ulf.jasper@web.de> 2009-12-18 Ulf Jasper <ulf.jasper@web.de>
* calendar/icalendar.el (icalendar--convert-tz-offset): * calendar/icalendar.el (icalendar--convert-tz-offset):
Fix timezone names. Fixed timezone names.
(icalendar--convert-tz-offset): Fix the "last-day-problem". (icalendar--convert-tz-offset): Fixed the "last-day-problem".
(icalendar--add-diary-entry): Remove the trailing blank that (icalendar--add-diary-entry): Remove the trailing blank that
diary-make-entry inserts. diary-make-entry inserts.

View file

@ -6680,8 +6680,9 @@
buffer if the parent buffer is in vc-dired-mode. buffer if the parent buffer is in vc-dired-mode.
2007-11-23 Mark A. Hershberger <mah@everybody.org> 2007-11-23 Mark A. Hershberger <mah@everybody.org>
James Clark <none@example.com>
* nxml: Initial merge of nxml. Kept nxml/char-name subdir for now. * nxml/: Initial merge of nxml. Kept nxml/char-name subdir for now.
2007-11-23 Juri Linkov <juri@jurta.org> 2007-11-23 Juri Linkov <juri@jurta.org>
@ -16693,10 +16694,9 @@ See ChangeLog.12 for earlier changes.
;; Local Variables: ;; Local Variables:
;; coding: utf-8 ;; coding: utf-8
;; add-log-time-zone-rule: t
;; End: ;; End:
Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Emacs. This file is part of GNU Emacs.
@ -16712,5 +16712,3 @@ See ChangeLog.12 for earlier changes.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;; arch-tag: 1e8aa93a-fc6c-4ac3-9b10-1f445e1840af

View file

@ -2011,6 +2011,14 @@ Otherwise, an error occurs in these cases."
;; with quotation marks in their names. ;; with quotation marks in their names.
(while (string-match "\\(?:[^\\]\\|\\`\\)\\(\"\\)" file) (while (string-match "\\(?:[^\\]\\|\\`\\)\\(\"\\)" file)
(setq file (replace-match "\\\"" nil t file 1))) (setq file (replace-match "\\\"" nil t file 1)))
(when (eq system-type 'windows-nt)
(save-match-data
(let ((start 0))
(while (string-match "\\\\" file start)
(aset file (match-beginning 0) ?/)
(setq start (match-end 0))))))
(setq file (read (concat "\"" file "\""))) (setq file (read (concat "\"" file "\"")))
;; The above `read' will return a unibyte string if FILE ;; The above `read' will return a unibyte string if FILE
;; contains eight-bit-control/graphic characters. ;; contains eight-bit-control/graphic characters.

View file

@ -76,8 +76,6 @@
;; TODO & BUGS: ;; TODO & BUGS:
;; ;;
;; - FIXME: I think the behavior on empty lines is wrong. It shouldn't
;; look at the next token on subsequent lines.
;; - Using the structural information SMIE gives us, it should be possible to ;; - Using the structural information SMIE gives us, it should be possible to
;; implement a `smie-align' command that would automatically figure out what ;; implement a `smie-align' command that would automatically figure out what
;; there is to align and how to do it (something like: align the token of ;; 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
(to (cdar eqs))) (to (cdar eqs)))
(setq eqs (cdr eqs)) (setq eqs (cdr eqs))
(if (eq to from) (if (eq to from)
nil ;Nothing to do. nil ;Nothing to do.
(dolist (other-eq eqs) (dolist (other-eq eqs)
(if (eq from (cdr other-eq)) (setcdr other-eq to)) (if (eq from (cdr other-eq)) (setcdr other-eq to))
(when (eq from (car other-eq)) (when (eq from (car other-eq))
@ -523,24 +521,23 @@ PREC2 is a table as returned by `smie-precs->prec2' or
(setcar (car eq) (cadr eq)) (setcar (car eq) (cadr eq))
;; (smie-check-grammar table prec2 'step2) ;; (smie-check-grammar table prec2 'step2)
) )
;; Finally, fill in the remaining vars (which only appeared on the ;; Finally, fill in the remaining vars (which did not appear on the
;; right side of the < constraints). ;; left side of any < constraint).
(let ((classification-table (gethash :smie-open/close-alist prec2))) (dolist (x table)
(dolist (x table) (unless (nth 1 x)
;; When both sides are nil, it means this operator binds very (setf (nth 1 x) i)
;; very tight, but it's still just an operator, so we give it (incf i)) ;See other (incf i) above.
;; the highest precedence. (unless (nth 2 x)
;; OTOH if only one side is nil, it usually means it's like an (setf (nth 2 x) i)
;; open-paren, which is very important for indentation purposes, (incf i)))) ;See other (incf i) above.
;; so we keep it nil if so, to make it easier to recognize. ;; Mark closers and openers.
(unless (or (nth 1 x) (dolist (x (gethash :smie-open/close-alist prec2))
(eq 'opener (cdr (assoc (car x) classification-table)))) (let* ((token (car x))
(setf (nth 1 x) i) (cons (case (cdr x)
(incf i)) ;See other (incf i) above. (closer (cddr (assoc token table)))
(unless (or (nth 2 x) (opener (cdr (assoc token table))))))
(eq 'closer (cdr (assoc (car x) classification-table)))) (assert (numberp (car cons)))
(setf (nth 2 x) i) (setf (car cons) (list (car cons)))))
(incf i))))) ;See other (incf i) above.
(let ((ca (gethash :smie-closer-alist prec2))) (let ((ca (gethash :smie-closer-alist prec2)))
(when ca (push (cons :smie-closer-alist ca) table))) (when ca (push (cons :smie-closer-alist ca) table)))
;; (smie-check-grammar table prec2 'step3) ;; (smie-check-grammar table prec2 'step3)
@ -611,6 +608,8 @@ OP-FORW is the accessor to the forward level of the level data.
OP-BACK is the accessor to the backward level of the level data. OP-BACK is the accessor to the backward level of the level data.
HALFSEXP if non-nil, means skip over a partial sexp if needed. I.e. if the HALFSEXP if non-nil, means skip over a partial sexp if needed. I.e. if the
first token we see is an operator, skip over its left-hand-side argument. first token we see is an operator, skip over its left-hand-side argument.
HALFSEXP can also be a token, in which case it means to parse as if
we had just successfully passed this token.
Possible return values: Possible return values:
(FORW-LEVEL POS TOKEN): we couldn't skip TOKEN because its back-level (FORW-LEVEL POS TOKEN): we couldn't skip TOKEN because its back-level
is too high. FORW-LEVEL is the forw-level of TOKEN, is too high. FORW-LEVEL is the forw-level of TOKEN,
@ -619,7 +618,10 @@ Possible return values:
(nil POS TOKEN): we skipped over a paren-like pair. (nil POS TOKEN): we skipped over a paren-like pair.
nil: we skipped over an identifier, matched parentheses, ..." nil: we skipped over an identifier, matched parentheses, ..."
(catch 'return (catch 'return
(let ((levels ())) (let ((levels
(if (stringp halfsexp)
(prog1 (list (cdr (assoc halfsexp smie-grammar)))
(setq halfsexp nil)))))
(while (while
(let* ((pos (point)) (let* ((pos (point))
(token (funcall next-token)) (token (funcall next-token))
@ -697,6 +699,8 @@ Possible return values:
"Skip over one sexp. "Skip over one sexp.
HALFSEXP if non-nil, means skip over a partial sexp if needed. I.e. if the HALFSEXP if non-nil, means skip over a partial sexp if needed. I.e. if the
first token we see is an operator, skip over its left-hand-side argument. first token we see is an operator, skip over its left-hand-side argument.
HALFSEXP can also be a token, in which case we should skip the text
assuming it is the left-hand-side argument of that token.
Possible return values: Possible return values:
(LEFT-LEVEL POS TOKEN): we couldn't skip TOKEN because its right-level (LEFT-LEVEL POS TOKEN): we couldn't skip TOKEN because its right-level
is too high. LEFT-LEVEL is the left-level of TOKEN, is too high. LEFT-LEVEL is the left-level of TOKEN,
@ -714,7 +718,9 @@ Possible return values:
(defun smie-forward-sexp (&optional halfsexp) (defun smie-forward-sexp (&optional halfsexp)
"Skip over one sexp. "Skip over one sexp.
HALFSEXP if non-nil, means skip over a partial sexp if needed. I.e. if the HALFSEXP if non-nil, means skip over a partial sexp if needed. I.e. if the
first token we see is an operator, skip over its left-hand-side argument. first token we see is an operator, skip over its right-hand-side argument.
HALFSEXP can also be a token, in which case we should skip the text
assuming it is the right-hand-side argument of that token.
Possible return values: Possible return values:
(RIGHT-LEVEL POS TOKEN): we couldn't skip TOKEN because its left-level (RIGHT-LEVEL POS TOKEN): we couldn't skip TOKEN because its left-level
is too high. RIGHT-LEVEL is the right-level of TOKEN, is too high. RIGHT-LEVEL is the right-level of TOKEN,
@ -791,7 +797,7 @@ Possible return values:
(push (car other) found)))))) (push (car other) found))))))
(cond (cond
((null found) (error "No known closer for opener %s" open)) ((null found) (error "No known closer for opener %s" open))
;; FIXME: what should we do if there are various closers? ;; What should we do if there are various closers?
(t (car found)))))))))) (t (car found))))))))))
(unless (save-excursion (skip-chars-backward " \t") (bolp)) (unless (save-excursion (skip-chars-backward " \t") (bolp))
(newline)) (newline))
@ -1094,9 +1100,6 @@ Only meaningful when called from within `smie-rules-function'."
;; line, in which case we want to align it with its enclosing parent. ;; line, in which case we want to align it with its enclosing parent.
(cond (cond
((and (eq method :before) (smie-rule-bolp) (not (smie-rule-sibling-p))) ((and (eq method :before) (smie-rule-bolp) (not (smie-rule-sibling-p)))
;; FIXME: Rather than consult the number of spaces, we could *set* the
;; number of spaces so as to align the separator with the close-paren
;; while aligning the content with the rest.
(let ((parent-col (cdr (smie-rule-parent))) (let ((parent-col (cdr (smie-rule-parent)))
(parent-pos-col ;FIXME: we knew this when computing smie--parent. (parent-pos-col ;FIXME: we knew this when computing smie--parent.
(save-excursion (save-excursion
@ -1225,39 +1228,48 @@ in order to figure out the indentation of some other (further down) point."
(smie-indent-virtual)) ;:not-hanging (smie-indent-virtual)) ;:not-hanging
(scan-error nil))))) (scan-error nil)))))
(defun smie-indent-keyword () (defun smie-indent-keyword (&optional token)
;; Align closing token with the corresponding opening one. "Indent point based on the token that follows it immediately.
;; (e.g. "of" with "case", or "in" with "let"). If TOKEN is non-nil, assume that that is the token that follows point.
Returns either a column number or nil if it considers that indentation
should not be computed on the basis of the following token."
(save-excursion (save-excursion
(let* ((pos (point)) (let* ((pos (point))
(toklevels (smie-indent-forward-token)) (toklevels
(token (pop toklevels))) (if token
(assoc token smie-grammar)
(let* ((res (smie-indent-forward-token)))
;; Ignore tokens on subsequent lines.
(if (and (< pos (line-beginning-position))
;; Make sure `token' also *starts* on another line.
(save-excursion
(smie-indent-backward-token)
(< pos (line-beginning-position))))
nil
(goto-char pos)
res)))))
(setq token (pop toklevels))
(cond (cond
((< pos (line-beginning-position)) ((null (cdr toklevels)) nil) ;Not a keyword.
;; The token we just read is actually not on the line where we started.
nil)
((not (numberp (car toklevels))) ((not (numberp (car toklevels)))
(save-excursion ;; Different cases:
(goto-char pos) ;; - smie-indent--bolp: "indent according to others".
;; Different cases: ;; - common hanging: "indent according to others".
;; - smie-indent--bolp: "indent according to others". ;; - SML-let hanging: "indent like parent".
;; - common hanging: "indent according to others". ;; - if-after-else: "indent-like parent".
;; - SML-let hanging: "indent like parent". ;; - middle-of-line: "trust current position".
;; - if-after-else: "indent-like parent". (cond
;; - middle-of-line: "trust current position". ((smie-indent--rule :before token))
(cond ((smie-indent--bolp) ;I.e. non-virtual indent.
((null (cdr toklevels)) nil) ;Not a keyword. ;; For an open-paren-like thingy at BOL, always indent only
((smie-indent--rule :before token)) ;; based on other rules (typically smie-indent-after-keyword).
((smie-indent--bolp) ;I.e. non-virtual indent. nil)
;; For an open-paren-like thingy at BOL, always indent only (t
;; based on other rules (typically smie-indent-after-keyword). ;; By default use point unless we're hanging.
nil) (unless (smie-indent--hanging-p) (current-column)))))
(t
;; By default use point unless we're hanging.
(unless (smie-indent--hanging-p) (current-column))))))
(t (t
;; FIXME: This still looks too much like black magic!! ;; FIXME: This still looks too much like black magic!!
(let* ((parent (smie-backward-sexp 'halfsexp))) (let* ((parent (smie-backward-sexp token)))
;; Different behaviors: ;; Different behaviors:
;; - align with parent. ;; - align with parent.
;; - parent + offset. ;; - parent + offset.

View file

@ -1,3 +1,8 @@
2010-11-27 Yuri Karaban <tech@askold.net> (tiny change)
* pop3.el (pop3-open-server): Read server greeting before starting TLS
negotiation.
2010-11-26 Julien Danjou <julien@danjou.info> 2010-11-26 Julien Danjou <julien@danjou.info>
* color.el: Rename various rgb functions to srgb. * color.el: Rename various rgb functions to srgb.

View file

@ -327,21 +327,22 @@ Returns the process associated with the connection."
;; gnutls-cli, openssl don't accept service names ;; gnutls-cli, openssl don't accept service names
(if (equal port "pop3") (if (equal port "pop3")
(setq port 110)) (setq port 110))
(let ((process (starttls-open-stream "POP" (current-buffer) ;; Delay STLS until server greeting is read (Bug#7438).
mailhost (or port 110)))) (starttls-open-stream "POP" (current-buffer)
(pop3-send-command process "STLS") mailhost (or port 110)))
(let ((response (pop3-read-response process t)))
(if (and response (string-match "+OK" response))
(starttls-negotiate process)
(pop3-quit process)
(error "POP server doesn't support starttls")))
process))
(t (t
(open-network-stream "POP" (current-buffer) mailhost port)))) (open-network-stream "POP" (current-buffer) mailhost port))))
(let ((response (pop3-read-response process t))) (let ((response (pop3-read-response process t)))
(setq pop3-timestamp (setq pop3-timestamp
(substring response (or (string-match "<" response) 0) (substring response (or (string-match "<" response) 0)
(+ 1 (or (string-match ">" response) -1))))) (+ 1 (or (string-match ">" response) -1)))))
(when (eq pop3-stream-type 'starttls)
(pop3-send-command process "STLS")
(let ((response (pop3-read-response process t)))
(if (and response (string-match "+OK" response))
(starttls-negotiate process)
(pop3-quit process)
(error "POP server doesn't support starttls"))))
(pop3-set-process-query-on-exit-flag process nil) (pop3-set-process-query-on-exit-flag process nil)
process))) process)))

View file

@ -145,6 +145,11 @@ the version.)"
:type 'string :type 'string
:group 'locate) :group 'locate)
(defcustom locate-post-command-hook nil
"List of hook functions run after `locate' (see `run-hooks')."
:type 'hook
:group 'locate)
(defvar locate-history-list nil (defvar locate-history-list nil
"The history list used by the \\[locate] command.") "The history list used by the \\[locate] command.")
@ -226,6 +231,11 @@ that is, with a prefix arg, you get the default behavior."
:group 'locate :group 'locate
:type 'boolean) :type 'boolean)
(defcustom locate-mode-hook nil
"List of hook functions run by `locate-mode' (see `run-mode-hooks')."
:type 'hook
:group 'locate)
;; Functions ;; Functions
(defun locate-default-make-command-line (search-string) (defun locate-default-make-command-line (search-string)
@ -471,9 +481,9 @@ do not work in subdirectories.
(make-local-variable 'directory-listing-before-filename-regexp) (make-local-variable 'directory-listing-before-filename-regexp)
;; This should support both Unix and Windoze style names ;; This should support both Unix and Windoze style names
(setq directory-listing-before-filename-regexp (setq directory-listing-before-filename-regexp
(concat "^." (concat "^.\\("
(make-string (1- locate-filename-indentation) ?\s) (make-string (1- locate-filename-indentation) ?\s)
"\\(/\\|[A-Za-z]:\\)\\|" "\\)\\|"
(default-value 'directory-listing-before-filename-regexp))) (default-value 'directory-listing-before-filename-regexp)))
(make-local-variable 'dired-actual-switches) (make-local-variable 'dired-actual-switches)
(setq dired-actual-switches "") (setq dired-actual-switches "")

View file

@ -152,7 +152,9 @@ The variable `lpr-page-header-program' specifies the program to use."
"Print buffer contents without pagination or page headers. "Print buffer contents without pagination or page headers.
See the variables `lpr-switches' and `lpr-command' See the variables `lpr-switches' and `lpr-command'
for customization of the printer command." for customization of the printer command."
(interactive) (interactive
(unless (y-or-n-p "Send current buffer to default printer? ")
(error "Cancelled")))
(print-region-1 (point-min) (point-max) lpr-switches nil)) (print-region-1 (point-min) (point-max) lpr-switches nil))
;;;###autoload ;;;###autoload
@ -169,7 +171,9 @@ in the print command itself; we expect them to request pagination.
See the variables `lpr-switches' and `lpr-command' See the variables `lpr-switches' and `lpr-command'
for further customization of the printer command." for further customization of the printer command."
(interactive) (interactive
(unless (y-or-n-p "Send current buffer to default printer? ")
(error "Cancelled")))
(print-region-1 (point-min) (point-max) lpr-switches t)) (print-region-1 (point-min) (point-max) lpr-switches t))
;;;###autoload ;;;###autoload
@ -177,7 +181,10 @@ for further customization of the printer command."
"Print region contents without pagination or page headers. "Print region contents without pagination or page headers.
See the variables `lpr-switches' and `lpr-command' See the variables `lpr-switches' and `lpr-command'
for customization of the printer command." for customization of the printer command."
(interactive "r") (interactive
(if (y-or-n-p "Send selected text to default printer? ")
(list (region-beginning) (region-end))
(error "Cancelled")))
(print-region-1 start end lpr-switches nil)) (print-region-1 start end lpr-switches nil))
;;;###autoload ;;;###autoload
@ -194,7 +201,10 @@ in the print command itself; we expect them to request pagination.
See the variables `lpr-switches' and `lpr-command' See the variables `lpr-switches' and `lpr-command'
for further customization of the printer command." for further customization of the printer command."
(interactive "r") (interactive
(if (y-or-n-p "Send selected text to default printer? ")
(list (region-beginning) (region-end))
(error "Cancelled")))
(print-region-1 start end lpr-switches t)) (print-region-1 start end lpr-switches t))
(defun print-region-1 (start end switches page-headers) (defun print-region-1 (start end switches page-headers)

View file

@ -39,6 +39,7 @@
;; ;;
(require 'mail-utils) (require 'mail-utils)
(require 'rfc2047)
(defconst rmail-attribute-header "X-RMAIL-ATTRIBUTES" (defconst rmail-attribute-header "X-RMAIL-ATTRIBUTES"
"The header that stores the Rmail attribute data.") "The header that stores the Rmail attribute data.")
@ -638,7 +639,7 @@ Element N specifies the summary line for message N+1.")
This is set to nil by default.") This is set to nil by default.")
(defcustom rmail-enable-mime nil (defcustom rmail-enable-mime t
"If non-nil, RMAIL uses MIME features. "If non-nil, RMAIL uses MIME features.
If the value is t, RMAIL automatically shows MIME decoded message. If the value is t, RMAIL automatically shows MIME decoded message.
If the value is neither t nor nil, RMAIL does not show MIME decoded message If 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."
:type '(choice (const :tag "on" t) :type '(choice (const :tag "on" t)
(const :tag "off" nil) (const :tag "off" nil)
(other :tag "when asked" ask)) (other :tag "when asked" ask))
:version "23.3"
:group 'rmail) :group 'rmail)
(defvar rmail-enable-mime-composing nil (defvar rmail-enable-mime-composing nil
@ -693,13 +695,12 @@ start of the header) with three arguments MSG, REGEXP, and LIMIT,
where MSG is the message number, REGEXP is the regular where MSG is the message number, REGEXP is the regular
expression, LIMIT is the position specifying the end of header.") expression, LIMIT is the position specifying the end of header.")
(defvar rmail-mime-feature 'rmail-mime (defvar rmail-mime-feature 'rmailmm
"Feature to require to load MIME support in Rmail. "Feature to require to load MIME support in Rmail.
When starting Rmail, if `rmail-enable-mime' is non-nil, When starting Rmail, if `rmail-enable-mime' is non-nil,
this feature is required with `require'. this feature is required with `require'.
The default value is `rmail-mime'. This feature is provided by The default value is `rmailmm'")
the rmail-mime package available at <http://www.m17n.org/rmail-mime/>.")
;; FIXME this is unused. ;; FIXME this is unused.
(defvar rmail-decode-mime-charset t (defvar rmail-decode-mime-charset t
@ -1509,17 +1510,9 @@ Hook `rmail-quit-hook' is run after expunging."
(set-buffer-modified-p nil)) (set-buffer-modified-p nil))
(replace-buffer-in-windows rmail-summary-buffer) (replace-buffer-in-windows rmail-summary-buffer)
(bury-buffer rmail-summary-buffer)) (bury-buffer rmail-summary-buffer))
(if rmail-enable-mime (let ((obuf (current-buffer)))
(let ((obuf rmail-buffer) (quit-window)
(ovbuf rmail-view-buffer)) (replace-buffer-in-windows obuf)))
(set-buffer rmail-view-buffer)
(quit-window)
(replace-buffer-in-windows ovbuf)
(replace-buffer-in-windows obuf)
(bury-buffer obuf))
(let ((obuf (current-buffer)))
(quit-window)
(replace-buffer-in-windows obuf))))
(defun rmail-bury () (defun rmail-bury ()
"Bury current Rmail buffer and its summary buffer." "Bury current Rmail buffer and its summary buffer."
@ -2219,15 +2212,7 @@ If nil, that means the current message."
(let ((blurb (rmail-get-labels))) (let ((blurb (rmail-get-labels)))
(setq mode-line-process (setq mode-line-process
(format " %d/%d%s" (format " %d/%d%s"
rmail-current-message rmail-total-messages blurb)) rmail-current-message rmail-total-messages blurb))))
;; If rmail-enable-mime is non-nil, we may have to update
;; `mode-line-process' of rmail-view-buffer too.
(if (and rmail-enable-mime
(not (eq (current-buffer) rmail-view-buffer))
(buffer-live-p rmail-view-buffer))
(let ((mlp mode-line-process))
(with-current-buffer rmail-view-buffer
(setq mode-line-process mlp))))))
(defun rmail-get-attr-value (attr state) (defun rmail-get-attr-value (attr state)
"Return the character value for ATTR. "Return the character value for ATTR.
@ -2706,6 +2691,11 @@ The current mail message becomes the message displayed."
(message "Showing message %d" msg)) (message "Showing message %d" msg))
(narrow-to-region beg end) (narrow-to-region beg end)
(goto-char beg) (goto-char beg)
(if (and rmail-enable-mime
(re-search-forward "mime-version: 1.0" nil t))
(let ((rmail-buffer mbox-buf)
(rmail-view-buffer view-buf))
(funcall rmail-show-mime-function))
(setq body-start (search-forward "\n\n" nil t)) (setq body-start (search-forward "\n\n" nil t))
(narrow-to-region beg (point)) (narrow-to-region beg (point))
(goto-char beg) (goto-char beg)
@ -2722,11 +2712,6 @@ The current mail message becomes the message displayed."
;; unibyte temporary buffer where the character decoding takes ;; unibyte temporary buffer where the character decoding takes
;; place. ;; place.
(with-current-buffer rmail-view-buffer (with-current-buffer rmail-view-buffer
;; We give the view buffer a buffer-local value of
;; rmail-header-style based on the binding in effect when
;; this function is called; `rmail-toggle-headers' can
;; inspect this value to determine how to toggle.
(set (make-local-variable 'rmail-header-style) header-style)
(erase-buffer)) (erase-buffer))
(if (null character-coding) (if (null character-coding)
;; Do it directly since that is fast. ;; Do it directly since that is fast.
@ -2749,8 +2734,13 @@ The current mail message becomes the message displayed."
(error "uuencoded messages are not supported yet")) (error "uuencoded messages are not supported yet"))
(t)) (t))
(rmail-decode-region (point-min) (point-max) (rmail-decode-region (point-min) (point-max)
coding-system view-buf))) coding-system view-buf))))
(with-current-buffer rmail-view-buffer (with-current-buffer rmail-view-buffer
;; We give the view buffer a buffer-local value of
;; rmail-header-style based on the binding in effect when
;; this function is called; `rmail-toggle-headers' can
;; inspect this value to determine how to toggle.
(set (make-local-variable 'rmail-header-style) header-style)
;; Unquote quoted From lines ;; Unquote quoted From lines
(goto-char (point-min)) (goto-char (point-min))
(while (re-search-forward "^>+From " nil t) (while (re-search-forward "^>+From " nil t)
@ -2766,6 +2756,10 @@ The current mail message becomes the message displayed."
(with-current-buffer rmail-view-buffer (with-current-buffer rmail-view-buffer
(insert "\n") (insert "\n")
(goto-char (point-min)) (goto-char (point-min))
;; Decode the headers according to RFC2047.
(save-excursion
(search-forward "\n\n" nil 'move)
(rfc2047-decode-region (point-min) (point)))
(rmail-highlight-headers) (rmail-highlight-headers)
;(rmail-activate-urls) ;(rmail-activate-urls)
;(rmail-process-quoted-material) ;(rmail-process-quoted-material)

View file

@ -27,17 +27,57 @@
;; Essentially based on the design of Alexander Pohoyda's MIME ;; Essentially based on the design of Alexander Pohoyda's MIME
;; extensions (mime-display.el and mime.el). ;; extensions (mime-display.el and mime.el).
;; Call `M-x rmail-mime' when viewing an Rmail message.
;; This file provides two operation modes for viewing a MIME message.
;; (1) When rmail-enable-mime is non-nil (now it is the default), the
;; function `rmail-show-mime' is automatically called. That function
;; shows a MIME message directly in RMAIL's view buffer.
;; (2) When rmail-enable-mime is nil, the command 'v' (or M-x
;; rmail-mime) shows a MIME message in a new buffer "*RMAIL*".
;; Both operations share the intermediate functions rmail-mime-process
;; and rmail-mime-process-multipart as below.
;; rmail-show-mime
;; +- rmail-mime-parse
;; | +- rmail-mime-process <--+------------+
;; | | +---------+ |
;; | + rmail-mime-process-multipart --+
;; |
;; + rmail-mime-insert <----------------+
;; +- rmail-mime-insert-text |
;; +- rmail-mime-insert-bulk |
;; +- rmail-mime-insert-multipart --+
;;
;; rmail-mime
;; +- rmail-mime-show <----------------------------------+
;; +- rmail-mime-process |
;; +- rmail-mime-handle |
;; +- rmail-mime-text-handler |
;; +- rmail-mime-bulk-handler |
;; | + rmail-mime-insert-bulk
;; +- rmail-mime-multipart-handler |
;; +- rmail-mime-process-multipart --+
;; In addition, for the case of rmail-enable-mime being non-nil, this
;; file provides two functions rmail-insert-mime-forwarded-message and
;; rmail-insert-mime-resent-message for composing forwarded and resent
;; messages respectively.
;; Todo: ;; Todo:
;; Handle multipart/alternative. ;; Make rmail-mime-media-type-handlers-alist usable in the first
;; operation mode.
;; Handle multipart/alternative in the second operation mode.
;; Offer the option to call external/internal viewers (doc-view, xpdf, etc). ;; Offer the option to call external/internal viewers (doc-view, xpdf, etc).
;;; Code: ;;; Code:
(require 'rmail) (require 'rmail)
(require 'mail-parse) (require 'mail-parse)
(require 'message)
;;; User options. ;;; User options.
@ -91,6 +131,52 @@ automatically display the image in the buffer."
;;; End of user options. ;;; End of user options.
;;; MIME-entity object
(defun rmail-mime-entity (type disposition transfer-encoding
header body children)
"Retrun a newly created MIME-entity object.
A MIME-entity is a vector of 6 elements:
[ TYPE DISPOSITION TRANSFER-ENCODING HEADER BODY CHILDREN ]
TYPE and DISPOSITION correspond to MIME headers Content-Type: and
Cotent-Disposition: respectively, and has this format:
\(VALUE (ATTRIBUTE . VALUE) (ATTRIBUTE . VALUE) ...)
VALUE is a string and ATTRIBUTE is a symbol.
Consider the following header, for example:
Content-Type: multipart/mixed;
boundary=\"----=_NextPart_000_0104_01C617E4.BDEC4C40\"
The corresponding TYPE argument must be:
\(\"multipart/mixed\"
\(\"boundary\" . \"----=_NextPart_000_0104_01C617E4.BDEC4C40\"))
TRANSFER-ENCODING corresponds to MIME header
Content-Transfer-Encoding, and is a lowercased string.
HEADER and BODY are a cons (BEG . END), where BEG and END specify
the region of the corresponding part in RMAIL's data (mbox)
buffer. BODY may be nil. In that case, the current buffer is
narrowed to the body part.
CHILDREN is a list of MIME-entities for a \"multipart\" entity, and
nil for the other types."
(vector type disposition transfer-encoding header body children))
;; Accessors for a MIME-entity object.
(defsubst rmail-mime-entity-type (entity) (aref entity 0))
(defsubst rmail-mime-entity-disposition (entity) (aref entity 1))
(defsubst rmail-mime-entity-transfer-encoding (entity) (aref entity 2))
(defsubst rmail-mime-entity-header (entity) (aref entity 3))
(defsubst rmail-mime-entity-body (entity) (aref entity 4))
(defsubst rmail-mime-entity-children (entity) (aref entity 5))
;;; Buttons ;;; Buttons
@ -99,6 +185,7 @@ automatically display the image in the buffer."
(let* ((filename (button-get button 'filename)) (let* ((filename (button-get button 'filename))
(directory (button-get button 'directory)) (directory (button-get button 'directory))
(data (button-get button 'data)) (data (button-get button 'data))
(mbox-buf rmail-view-buffer)
(ofilename filename)) (ofilename filename))
(setq filename (expand-file-name (setq filename (expand-file-name
(read-file-name (format "Save as (default: %s): " filename) (read-file-name (format "Save as (default: %s): " filename)
@ -117,7 +204,17 @@ automatically display the image in the buffer."
;; file, the magic signature compares equal with the unibyte ;; file, the magic signature compares equal with the unibyte
;; signature string recorded in jka-compr-compression-info-list. ;; signature string recorded in jka-compr-compression-info-list.
(set-buffer-multibyte nil) (set-buffer-multibyte nil)
(insert data) (setq buffer-undo-list t)
(if (stringp data)
(insert data)
;; DATA is a MIME-entity object.
(let ((transfer-encoding (rmail-mime-entity-transfer-encoding data))
(body (rmail-mime-entity-body data)))
(insert-buffer-substring mbox-buf (car body) (cdr body))
(cond ((string= transfer-encoding "base64")
(ignore-errors (base64-decode-region (point-min) (point-max))))
((string= transfer-encoding "quoted-printable")
(quoted-printable-decode-region (point-min) (point-max))))))
(write-region nil nil filename nil nil nil t)))) (write-region nil nil filename nil nil nil t))))
(define-button-type 'rmail-mime-save 'action 'rmail-mime-save) (define-button-type 'rmail-mime-save 'action 'rmail-mime-save)
@ -134,6 +231,23 @@ automatically display the image in the buffer."
(when (coding-system-p coding-system) (when (coding-system-p coding-system)
(decode-coding-region (point-min) (point-max) coding-system)))) (decode-coding-region (point-min) (point-max) coding-system))))
(defun rmail-mime-insert-text (entity)
"Insert MIME-entity ENTITY as a plain text MIME part in the current buffer."
(let* ((content-type (rmail-mime-entity-type entity))
(charset (cdr (assq 'charset (cdr content-type))))
(coding-system (if charset (intern (downcase charset))))
(transfer-encoding (rmail-mime-entity-transfer-encoding entity))
(body (rmail-mime-entity-body entity)))
(save-restriction
(narrow-to-region (point) (point))
(insert-buffer-substring rmail-buffer (car body) (cdr body))
(cond ((string= transfer-encoding "base64")
(ignore-errors (base64-decode-region (point-min) (point-max))))
((string= transfer-encoding "quoted-printable")
(quoted-printable-decode-region (point-min) (point-max))))
(if (coding-system-p coding-system)
(decode-coding-region (point-min) (point-max) coding-system)))))
;; FIXME move to the test/ directory? ;; FIXME move to the test/ directory?
(defun test-rmail-mime-handler () (defun test-rmail-mime-handler ()
"Test of a mail using no MIME parts at all." "Test of a mail using no MIME parts at all."
@ -152,10 +266,28 @@ MIME-Version: 1.0
(defun rmail-mime-insert-image (type data) (defun rmail-mime-insert-image (type data)
"Insert an image of type TYPE, where DATA is the image data." "Insert an image of type TYPE, where DATA is the image data.
If DATA is not a string, it is a MIME-entity object."
(end-of-line) (end-of-line)
(insert ?\n) (let ((modified (buffer-modified-p)))
(insert-image (create-image data type t))) (insert ?\n)
(unless (stringp data)
;; DATA is a MIME-entity.
(let ((transfer-encoding (rmail-mime-entity-transfer-encoding data))
(body (rmail-mime-entity-body data))
(mbox-buffer rmail-view-buffer))
(with-temp-buffer
(set-buffer-multibyte nil)
(setq buffer-undo-list t)
(insert-buffer-substring mbox-buffer (car body) (cdr body))
(cond ((string= transfer-encoding "base64")
(ignore-errors (base64-decode-region (point-min) (point-max))))
((string= transfer-encoding "quoted-printable")
(quoted-printable-decode-region (point-min) (point-max))))
(setq data
(buffer-substring-no-properties (point-min) (point-max))))))
(insert-image (create-image data type t))
(set-buffer-modified-p modified)))
(defun rmail-mime-image (button) (defun rmail-mime-image (button)
"Display the image associated with BUTTON." "Display the image associated with BUTTON."
@ -172,8 +304,19 @@ MIME-Version: 1.0
"Handle the current buffer as an attachment to download. "Handle the current buffer as an attachment to download.
For images that Emacs is capable of displaying, the behavior For images that Emacs is capable of displaying, the behavior
depends upon the value of `rmail-mime-show-images'." depends upon the value of `rmail-mime-show-images'."
(rmail-mime-insert-bulk
(rmail-mime-entity content-type content-disposition content-transfer-encoding
nil nil nil)))
(defun rmail-mime-insert-bulk (entity)
"Inesrt a MIME-entity ENTITY as an attachment.
The optional second arg DATA, if non-nil, is a string containing
the attachment data that is already decoded."
;; Find the default directory for this media type. ;; Find the default directory for this media type.
(let* ((directory (catch 'directory (let* ((content-type (rmail-mime-entity-type entity))
(content-disposition (rmail-mime-entity-disposition entity))
(body (rmail-mime-entity-body entity))
(directory (catch 'directory
(dolist (entry rmail-mime-attachment-dirs-alist) (dolist (entry rmail-mime-attachment-dirs-alist)
(when (string-match (car entry) (car content-type)) (when (string-match (car entry) (car content-type))
(dolist (dir (cdr entry)) (dolist (dir (cdr entry))
@ -183,17 +326,21 @@ depends upon the value of `rmail-mime-show-images'."
(cdr (assq 'filename (cdr content-disposition))) (cdr (assq 'filename (cdr content-disposition)))
"noname")) "noname"))
(label (format "\nAttached %s file: " (car content-type))) (label (format "\nAttached %s file: " (car content-type)))
(data (buffer-string))
(udata (string-as-unibyte data))
(size (length udata))
(osize size)
(units '(B kB MB GB)) (units '(B kB MB GB))
type) data udata size osize type)
(while (and (> size 1024.0) ; cribbed from gnus-agent-expire-done-message (if body
(setq data entity
udata entity
size (- (cdr body) (car body)))
(setq data (buffer-string)
udata (string-as-unibyte data)
size (length udata))
(delete-region (point-min) (point-max)))
(setq osize size)
(while (and (> size 1024.0) ; cribbed from gnus-agent-expire-done-message
(cdr units)) (cdr units))
(setq size (/ size 1024.0) (setq size (/ size 1024.0)
units (cdr units))) units (cdr units)))
(delete-region (point-min) (point-max))
(insert label) (insert label)
(insert-button filename (insert-button filename
:type 'rmail-mime-save :type 'rmail-mime-save
@ -249,6 +396,22 @@ The current buffer should be narrowed to the body. CONTENT-TYPE,
CONTENT-DISPOSITION, and CONTENT-TRANSFER-ENCODING are the values CONTENT-DISPOSITION, and CONTENT-TRANSFER-ENCODING are the values
of the respective parsed headers. See `rmail-mime-handle' for their of the respective parsed headers. See `rmail-mime-handle' for their
format." format."
(rmail-mime-process-multipart
content-type content-disposition content-transfer-encoding nil))
(defun rmail-mime-process-multipart (content-type
content-disposition
content-transfer-encoding
parse-only)
"Process the current buffer as a multipart MIME body.
If PARSE-ONLY is nil, modify the current buffer directly for showing
the MIME body and return nil.
Otherwise, just parse the current buffer and return a list of
MIME-entity objects.
The other arguments are the same as `rmail-mime-multipart-handler'."
;; Some MUAs start boundaries with "--", while it should start ;; Some MUAs start boundaries with "--", while it should start
;; with "CRLF--", as defined by RFC 2046: ;; with "CRLF--", as defined by RFC 2046:
;; The boundary delimiter MUST occur at the beginning of a line, ;; The boundary delimiter MUST occur at the beginning of a line,
@ -257,7 +420,7 @@ format."
;; of the preceding part. ;; of the preceding part.
;; We currently don't handle that. ;; We currently don't handle that.
(let ((boundary (cdr (assq 'boundary content-type))) (let ((boundary (cdr (assq 'boundary content-type)))
beg end next) beg end next entities)
(unless boundary (unless boundary
(rmail-mm-get-boundary-error-message (rmail-mm-get-boundary-error-message
"No boundary defined" content-type content-disposition "No boundary defined" content-type content-disposition
@ -267,7 +430,9 @@ format."
(goto-char (point-min)) (goto-char (point-min))
(when (and (search-forward boundary nil t) (when (and (search-forward boundary nil t)
(looking-at "[ \t]*\n")) (looking-at "[ \t]*\n"))
(delete-region (point-min) (match-end 0))) (if parse-only
(narrow-to-region (match-end 0) (point-max))
(delete-region (point-min) (match-end 0))))
;; Loop over all body parts, where beg points at the beginning of ;; Loop over all body parts, where beg points at the beginning of
;; the part and end points at the end of the part. next points at ;; the part and end points at the end of the part. next points at
;; the beginning of the next part. ;; the beginning of the next part.
@ -285,13 +450,17 @@ format."
(rmail-mm-get-boundary-error-message (rmail-mm-get-boundary-error-message
"Malformed boundary" content-type content-disposition "Malformed boundary" content-type content-disposition
content-transfer-encoding))) content-transfer-encoding)))
(delete-region end next)
;; Handle the part. ;; Handle the part.
(save-restriction (if parse-only
(narrow-to-region beg end) (save-restriction
(rmail-mime-show)) (narrow-to-region beg end)
(goto-char (setq beg next))))) (setq entities (cons (rmail-mime-process nil t) entities)))
(delete-region end next)
(save-restriction
(narrow-to-region beg end)
(rmail-mime-show)))
(goto-char (setq beg next)))
(nreverse entities)))
(defun test-rmail-mime-multipart-handler () (defun test-rmail-mime-multipart-handler ()
"Test of a mail used as an example in RFC 2046." "Test of a mail used as an example in RFC 2046."
@ -394,6 +563,9 @@ called recursively if multiple parts are available.
The current buffer must contain a single message. It will be The current buffer must contain a single message. It will be
modified." modified."
(rmail-mime-process show-headers nil))
(defun rmail-mime-process (show-headers parse-only)
(let ((end (point-min)) (let ((end (point-min))
content-type content-type
content-transfer-encoding content-transfer-encoding
@ -437,14 +609,105 @@ modified."
;; attachment according to RFC 2183. ;; attachment according to RFC 2183.
(unless (member (car content-disposition) '("inline" "attachment")) (unless (member (car content-disposition) '("inline" "attachment"))
(setq content-disposition '("attachment"))) (setq content-disposition '("attachment")))
;; Hide headers and handle the part.
(save-restriction (if parse-only
(cond ((string= (car content-type) "message/rfc822") (cond ((string-match "multipart/.*" (car content-type))
(narrow-to-region end (point-max))) (setq end (1- end))
((not show-headers) (save-restriction
(delete-region (point-min) end))) (let ((header (if show-headers (cons (point-min) end))))
(rmail-mime-handle content-type content-disposition (narrow-to-region end (point-max))
content-transfer-encoding)))) (rmail-mime-entity content-type
content-disposition
content-transfer-encoding
header nil
(rmail-mime-process-multipart
content-type content-disposition
content-transfer-encoding t)))))
((string-match "message/rfc822" (car content-type))
(or show-headers
(narrow-to-region end (point-max)))
(rmail-mime-process t t))
(t
(rmail-mime-entity content-type
content-disposition
content-transfer-encoding
nil
(cons end (point-max))
nil)))
;; Hide headers and handle the part.
(save-restriction
(cond ((string= (car content-type) "message/rfc822")
(narrow-to-region end (point-max)))
((not show-headers)
(delete-region (point-min) end)))
(rmail-mime-handle content-type content-disposition
content-transfer-encoding)))))
(defun rmail-mime-insert-multipart (entity)
"Insert MIME-entity ENTITY of multipart type in the current buffer."
(let ((subtype (cadr (split-string (car (rmail-mime-entity-type entity))
"/")))
(disposition (rmail-mime-entity-disposition entity))
(header (rmail-mime-entity-header entity))
(children (rmail-mime-entity-children entity)))
(if header
(let ((pos (point)))
(or (bolp)
(insert "\n"))
(insert-buffer-substring rmail-buffer (car header) (cdr header))
(rfc2047-decode-region pos (point))
(insert "\n")))
(cond
((string= subtype "mixed")
(dolist (child children)
(rmail-mime-insert child '("text/plain") disposition)))
((string= subtype "digest")
(dolist (child children)
(rmail-mime-insert child '("message/rfc822") disposition)))
((string= subtype "alternative")
(let (best-plain-text best-text)
(dolist (child children)
(if (string= (or (car (rmail-mime-entity-disposition child))
(car disposition))
"inline")
(if (string-match "text/plain"
(car (rmail-mime-entity-type child)))
(setq best-plain-text child)
(if (string-match "text/.*"
(car (rmail-mime-entity-type child)))
(setq best-text child)))))
(if (or best-plain-text best-text)
(rmail-mime-insert (or best-plain-text best-text))
;; No child could be handled. Insert all.
(dolist (child children)
(rmail-mime-insert child nil disposition)))))
(t
;; Unsupported subtype. Insert all of them.
(dolist (child children)
(rmail-mime-insert child))))))
(defun rmail-mime-parse ()
"Parse the current Rmail message as a MIME message.
The value is a MIME-entiy object (see `rmail-mime-enty-new')."
(save-excursion
(goto-char (point-min))
(rmail-mime-process nil t)))
(defun rmail-mime-insert (entity &optional content-type disposition)
"Insert a MIME-entity ENTITY in the current buffer.
This function will be called recursively if multiple parts are
available."
(if (rmail-mime-entity-children entity)
(rmail-mime-insert-multipart entity)
(setq content-type
(or (rmail-mime-entity-type entity) content-type))
(setq disposition
(or (rmail-mime-entity-disposition entity) disposition))
(if (and (string= (car disposition) "inline")
(string-match "text/.*" (car content-type)))
(rmail-mime-insert-text entity)
(rmail-mime-insert-bulk entity))))
(define-derived-mode rmail-mime-mode fundamental-mode "RMIME" (define-derived-mode rmail-mime-mode fundamental-mode "RMIME"
"Major mode used in `rmail-mime' buffers." "Major mode used in `rmail-mime' buffers."
@ -480,6 +743,50 @@ attachments as specfied by `rmail-mime-attachment-dirs-alist'."
(error "%s; type: %s; disposition: %s; encoding: %s" (error "%s; type: %s; disposition: %s; encoding: %s"
message type disposition encoding)) message type disposition encoding))
(defun rmail-show-mime ()
(let ((mbox-buf rmail-buffer))
(condition-case nil
(let ((entity (rmail-mime-parse)))
(with-current-buffer rmail-view-buffer
(let ((inhibit-read-only t)
(rmail-buffer mbox-buf))
(erase-buffer)
(rmail-mime-insert entity))))
(error
;; Decoding failed. Insert the original message body as is.
(let ((region (with-current-buffer mbox-buf
(goto-char (point-min))
(re-search-forward "^$" nil t)
(forward-line 1)
(cons (point) (point-max)))))
(with-current-buffer rmail-view-buffer
(let ((inhibit-read-only t))
(erase-buffer)
(insert-buffer-substring mbox-buf (car region) (cdr region))))
(message "MIME decoding failed"))))))
(setq rmail-show-mime-function 'rmail-show-mime)
(defun rmail-insert-mime-forwarded-message (forward-buffer)
(let ((mbox-buf (with-current-buffer forward-buffer rmail-view-buffer)))
(save-restriction
(narrow-to-region (point) (point))
(message-forward-make-body-mime mbox-buf))))
(setq rmail-insert-mime-forwarded-message-function
'rmail-insert-mime-forwarded-message)
(defun rmail-insert-mime-resent-message (forward-buffer)
(insert-buffer-substring
(with-current-buffer forward-buffer rmail-view-buffer))
(goto-char (point-min))
(when (looking-at "From ")
(forward-line 1)
(delete-region (point-min) (point))))
(setq rmail-insert-mime-resent-message-function
'rmail-insert-mime-resent-message)
(provide 'rmailmm) (provide 'rmailmm)
;; Local Variables: ;; Local Variables:

View file

@ -32,6 +32,7 @@
;; For rmail-select-summary. ;; For rmail-select-summary.
(require 'rmail) (require 'rmail)
(require 'rfc2047)
(defcustom rmail-summary-scroll-between-messages t (defcustom rmail-summary-scroll-between-messages t
"Non-nil means Rmail summary scroll commands move between messages. "Non-nil means Rmail summary scroll commands move between messages.
@ -364,13 +365,15 @@ The current buffer contains the unrestricted message collection."
(aset rmail-summary-vector (1- msgnum) line)) (aset rmail-summary-vector (1- msgnum) line))
line)) line))
(defcustom rmail-summary-line-decoder (function identity) (defcustom rmail-summary-line-decoder (function rfc2047-decode-string)
"Function to decode a Rmail summary line. "Function to decode a Rmail summary line.
It receives the summary line for one message as a string It receives the summary line for one message as a string
and should return the decoded string. and should return the decoded string.
By default, it is `identity', which returns the string unaltered." By default, it is `rfc2047-decode-string', which decodes MIME-encoded
subject."
:type 'function :type 'function
:version "23.3"
:group 'rmail-summary) :group 'rmail-summary)
(defun rmail-create-summary-line (msgnum) (defun rmail-create-summary-line (msgnum)
@ -589,10 +592,17 @@ the message being processed."
(t (- mch 14)))) (t (- mch 14))))
(min len (+ lo 25))))))))) (min len (+ lo 25)))))))))
(concat (if (re-search-forward "^Subject:" nil t) (concat (if (re-search-forward "^Subject:" nil t)
(progn (skip-chars-forward " \t") (let (pos str)
(buffer-substring (point) (skip-chars-forward " \t")
(progn (end-of-line) (setq pos (point))
(point)))) (forward-line 1)
(setq str (buffer-substring pos (1- (point))))
(while (looking-at "\\s ")
(setq str (concat str " "
(buffer-substring (match-end 0)
(line-end-position))))
(forward-line 1))
str)
(re-search-forward "[\n][\n]+" nil t) (re-search-forward "[\n][\n]+" nil t)
(buffer-substring (point) (progn (end-of-line) (point)))) (buffer-substring (point) (progn (end-of-line) (point))))
"\n"))) "\n")))

View file

@ -331,9 +331,9 @@ empty string for the user name.
See `tramp-methods' for a list of possibilities for METHOD." See `tramp-methods' for a list of possibilities for METHOD."
:group 'tramp :group 'tramp
:type '(repeat (list (regexp :tag "Host regexp") :type '(repeat (list (choice :tag "Host regexp" regexp sexp)
(regexp :tag "User regexp") (choice :tag "User regexp" regexp sexp)
(string :tag "Method")))) (choice :tag "Method name" string (const nil)))))
(defcustom tramp-default-user nil (defcustom tramp-default-user nil
"*Default user to use for transferring files. "*Default user to use for transferring files.
@ -355,9 +355,9 @@ matches, the variable `tramp-default-user' takes effect.
If the file name does not specify the method, lookup is done using the If the file name does not specify the method, lookup is done using the
empty string for the method name." empty string for the method name."
:group 'tramp :group 'tramp
:type '(repeat (list (regexp :tag "Method regexp") :type '(repeat (list (choice :tag "Method regexp" regexp sexp)
(regexp :tag "Host regexp") (choice :tag " Host regexp" regexp sexp)
(string :tag "User")))) (choice :tag " User name" string (const nil)))))
(defcustom tramp-default-host (system-name) (defcustom tramp-default-host (system-name)
"*Default host to use for transferring files. "*Default host to use for transferring files.
@ -382,7 +382,7 @@ interpreted as a regular expression which always matches."
:group 'tramp :group 'tramp
:type '(repeat (list (choice :tag "Host regexp" regexp sexp) :type '(repeat (list (choice :tag "Host regexp" regexp sexp)
(choice :tag "User regexp" regexp sexp) (choice :tag "User regexp" regexp sexp)
(choice :tag "Proxy remote name" string (const nil))))) (choice :tag " Proxy name" string (const nil)))))
(defconst tramp-local-host-regexp (defconst tramp-local-host-regexp
(concat (concat

View file

@ -1462,6 +1462,16 @@ Default ignores all inputs of 0, 1, or 2 non-blank characters."
:type 'regexp :type 'regexp
:group 'python) :group 'python)
(defcustom python-remove-cwd-from-path t
"Whether to allow loading of Python modules from the current directory.
If this is non-nil, Emacs removes '' from sys.path when starting
an inferior Python process. This is the default, for security
reasons, as it is easy for the Python process to be started
without the user's realization (e.g. to perform completion)."
:type 'boolean
:group 'python
:version "23.3")
(defun python-input-filter (str) (defun python-input-filter (str)
"`comint-input-filter' function for inferior Python. "`comint-input-filter' function for inferior Python.
Don't save anything for STR matching `inferior-python-filter-regexp'." Don't save anything for STR matching `inferior-python-filter-regexp'."
@ -1559,20 +1569,24 @@ print version_info >= (2, 2) and version_info < (3, 0)\""))))
;;;###autoload ;;;###autoload
(defun run-python (&optional cmd noshow new) (defun run-python (&optional cmd noshow new)
"Run an inferior Python process, input and output via buffer *Python*. "Run an inferior Python process, input and output via buffer *Python*.
CMD is the Python command to run. NOSHOW non-nil means don't show the CMD is the Python command to run. NOSHOW non-nil means don't
buffer automatically. show the buffer automatically.
Normally, if there is a process already running in `python-buffer', Interactively, a prefix arg means to prompt for the initial
switch to that buffer. Interactively, a prefix arg allows you to edit Python command line (default is `python-command').
the initial command line (default is `python-command'); `-i' etc. args
will be added to this as appropriate. A new process is started if:
one isn't running attached to `python-buffer', or interactively the
default `python-command', or argument NEW is non-nil. See also the
documentation for `python-buffer'.
Runs the hook `inferior-python-mode-hook' \(after the A new process is started if one isn't running attached to
`comint-mode-hook' is run). \(Type \\[describe-mode] in the process `python-buffer', or if called from Lisp with non-nil arg NEW.
buffer for a list of commands.)" Otherwise, if a process is already running in `python-buffer',
switch to that buffer.
This command runs the hook `inferior-python-mode-hook' after
running `comint-mode-hook'. Type \\[describe-mode] in the
process buffer for a list of commands.
By default, Emacs inhibits the loading of Python modules from the
current working directory, for security reasons. To disable this
behavior, change `python-remove-cwd-from-path' to nil."
(interactive (if current-prefix-arg (interactive (if current-prefix-arg
(list (read-string "Run Python: " python-command) nil t) (list (read-string "Run Python: " python-command) nil t)
(list python-command))) (list python-command)))
@ -1586,13 +1600,9 @@ buffer for a list of commands.)"
(when (or new (not (comint-check-proc python-buffer))) (when (or new (not (comint-check-proc python-buffer)))
(with-current-buffer (with-current-buffer
(let* ((cmdlist (let* ((cmdlist
(append (python-args-to-list cmd) (append (python-args-to-list cmd) '("-i")
;; It's easy for the user to cause the process to be (if python-remove-cwd-from-path
;; started without realizing it (e.g. to perform '("-c" "import sys; sys.path.remove('')"))))
;; completion); for this reason loading files from the
;; current directory is a security risk. See
;; http://article.gmane.org/gmane.emacs.devel/103569
'("-i" "-c" "import sys; sys.path.remove('')")))
(path (getenv "PYTHONPATH")) (path (getenv "PYTHONPATH"))
(process-environment ; to import emacs.py (process-environment ; to import emacs.py
(cons (concat "PYTHONPATH=" (cons (concat "PYTHONPATH="

View file

@ -154,7 +154,7 @@ mouse-3: go to end")
:type 'sexp) :type 'sexp)
;;;###autoload (put 'which-func-format 'risky-local-variable t) ;;;###autoload (put 'which-func-format 'risky-local-variable t)
(defvar which-func-imenu-joiner-function #'last (defvar which-func-imenu-joiner-function (lambda (x) (car (last x)))
"Function to join together multiple levels of imenu nomenclature. "Function to join together multiple levels of imenu nomenclature.
Called with a single argument, a list of strings giving the names Called with a single argument, a list of strings giving the names
of the menus we had to traverse to get to the item. Returns a of 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.
With prefix ARG, turn Which Function mode on if arg is positive, With prefix ARG, turn Which Function mode on if arg is positive,
and off otherwise." and off otherwise."
:global t :group 'which-func :global t :group 'which-func
(when (timerp which-func-update-timer)
(cancel-timer which-func-update-timer))
(setq which-func-update-timer nil)
(if which-function-mode (if which-function-mode
;;Turn it on ;;Turn it on
(progn (progn
@ -253,9 +256,6 @@ and off otherwise."
(or (eq which-func-modes t) (or (eq which-func-modes t)
(member major-mode which-func-modes)))))) (member major-mode which-func-modes))))))
;; Turn it off ;; Turn it off
(when (timerp which-func-update-timer)
(cancel-timer which-func-update-timer))
(setq which-func-update-timer nil)
(dolist (buf (buffer-list)) (dolist (buf (buffer-list))
(with-current-buffer buf (setq which-func-mode nil))))) (with-current-buffer buf (setq which-func-mode nil)))))

View file

@ -350,17 +350,16 @@ automatically."
(defvar log-edit-font-lock-keywords (defvar log-edit-font-lock-keywords
;; Copied/inspired by message-font-lock-keywords. ;; Copied/inspired by message-font-lock-keywords.
`((log-edit-match-to-eoh `((log-edit-match-to-eoh
(,(concat "^\\(\\([a-z]+\\):\\)" log-edit-header-contents-regexp (,(concat "^\\(\\([a-z]+\\):\\)" log-edit-header-contents-regexp)
"\\|\\(.*\\)")
(progn (goto-char (match-beginning 0)) (match-end 0)) nil (progn (goto-char (match-beginning 0)) (match-end 0)) nil
(1 (if (assoc (match-string 2) log-edit-headers-alist) (1 (if (assoc (match-string 2) log-edit-headers-alist)
'log-edit-header 'log-edit-header
'log-edit-unknown-header) 'log-edit-unknown-header)
nil lax) nil lax)
;; From `log-edit-header-contents-regexp':
(3 (or (cdr (assoc (match-string 2) log-edit-headers-alist)) (3 (or (cdr (assoc (match-string 2) log-edit-headers-alist))
'log-edit-header) 'log-edit-header)
nil lax) nil lax)))))
(4 font-lock-warning-face)))))
;;;###autoload ;;;###autoload
(defun log-edit (callback &optional setup params buffer mode &rest ignore) (defun log-edit (callback &optional setup params buffer mode &rest ignore)

View file

@ -1,3 +1,39 @@
2010-11-27 Kenichi Handa <handa@m17n.org>
* charset.c (emacs_mule_charset): Make it an array of charset ID;
i.e. integer.
(Fdefine_charset_internal): Adjusted for the above change.
(init_charset_once): Likewise.
* charset.h (emacs_mule_charset): Adjust the prototype. Delete
duplicated extern.
* coding.c (emacs_mule_char): Adjust for the change of
emacs_mule_charset.
* lread.c (read_emacs_mule_char): Adjust for the change of
emacs_mule_charset.
2010-11-27 Eli Zaretskii <eliz@gnu.org>
* w32.c (_PROCESS_MEMORY_COUNTERS_EX): Don't define with versions
of w32api >= 3.15. (Bug#6989) (Bug#7452)
2010-11-27 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
* alloc.c (mark_terminals): Ensure that the image cache is marked
even if the terminal object was marked earlier (Bug#6301).
2010-11-21 Chong Yidong <cyd@stupidchicken.com>
* editfns.c (Fbyte_to_string): Signal an error arg is not a byte.
2010-11-27 Jan Djärv <jan.h.d@swipnet.se>
* gtkutil.c (menubar_map_cb): New function (Bug#7425).
(xg_update_frame_menubar): Connect signal map to menubar_map_cb.
Use 23 as menubar height if 0. (Bug#7425).
2010-11-26 Eli Zaretskii <eliz@gnu.org> 2010-11-26 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (set_message_1): Force paragraph direction in echo area * xdisp.c (set_message_1): Force paragraph direction in echo area

View file

@ -5643,13 +5643,14 @@ mark_terminals (void)
for (t = terminal_list; t; t = t->next_terminal) for (t = terminal_list; t; t = t->next_terminal)
{ {
eassert (t->name != NULL); eassert (t->name != NULL);
if (!VECTOR_MARKED_P (t))
{
#ifdef HAVE_WINDOW_SYSTEM #ifdef HAVE_WINDOW_SYSTEM
mark_image_cache (t->image_cache); /* If a terminal object is reachable from a stacpro'ed object,
it might have been marked already. Make sure the image cache
gets marked. */
mark_image_cache (t->image_cache);
#endif /* HAVE_WINDOW_SYSTEM */ #endif /* HAVE_WINDOW_SYSTEM */
mark_vectorlike ((struct Lisp_Vector *)t); if (!VECTOR_MARKED_P (t))
} mark_vectorlike ((struct Lisp_Vector *)t);
} }
} }

View file

@ -114,7 +114,7 @@ Lisp_Object Viso_2022_charset_list;
/* List of emacs-mule charsets. */ /* List of emacs-mule charsets. */
Lisp_Object Vemacs_mule_charset_list; Lisp_Object Vemacs_mule_charset_list;
struct charset *emacs_mule_charset[256]; int emacs_mule_charset[256];
/* Mapping table from ISO2022's charset (specified by DIMENSION, /* Mapping table from ISO2022's charset (specified by DIMENSION,
CHARS, and FINAL-CHAR) to Emacs' charset. */ CHARS, and FINAL-CHAR) to Emacs' charset. */
@ -1210,7 +1210,7 @@ usage: (define-charset-internal ...) */)
if (charset.emacs_mule_id >= 0) if (charset.emacs_mule_id >= 0)
{ {
emacs_mule_charset[charset.emacs_mule_id] = CHARSET_FROM_ID (id); emacs_mule_charset[charset.emacs_mule_id] = id;
if (charset.emacs_mule_id < 0xA0) if (charset.emacs_mule_id < 0xA0)
emacs_mule_bytes[charset.emacs_mule_id] = charset.dimension + 1; emacs_mule_bytes[charset.emacs_mule_id] = charset.dimension + 1;
else else
@ -2330,7 +2330,7 @@ init_charset_once (void)
iso_charset_table[i][j][k] = -1; iso_charset_table[i][j][k] = -1;
for (i = 0; i < 256; i++) for (i = 0; i < 256; i++)
emacs_mule_charset[i] = NULL; emacs_mule_charset[i] = -1;
charset_jisx0201_roman = -1; charset_jisx0201_roman = -1;
charset_jisx0208_1978 = -1; charset_jisx0208_1978 = -1;

View file

@ -255,7 +255,7 @@ extern Lisp_Object Vcharset_list;
extern Lisp_Object Viso_2022_charset_list; extern Lisp_Object Viso_2022_charset_list;
extern Lisp_Object Vemacs_mule_charset_list; extern Lisp_Object Vemacs_mule_charset_list;
extern struct charset *emacs_mule_charset[256]; extern int emacs_mule_charset[256];
extern Lisp_Object Vcurrent_iso639_language; extern Lisp_Object Vcurrent_iso639_language;

View file

@ -2053,7 +2053,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
const unsigned char *src_end = coding->source + coding->src_bytes; const unsigned char *src_end = coding->source + coding->src_bytes;
const unsigned char *src_base = src; const unsigned char *src_base = src;
int multibytep = coding->src_multibyte; int multibytep = coding->src_multibyte;
struct charset *charset; int charset_id;
unsigned code; unsigned code;
int c; int c;
int consumed_chars = 0; int consumed_chars = 0;
@ -2063,7 +2063,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
if (c < 0) if (c < 0)
{ {
c = -c; c = -c;
charset = emacs_mule_charset[0]; charset_id = emacs_mule_charset[0];
} }
else else
{ {
@ -2099,7 +2099,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
switch (emacs_mule_bytes[c]) switch (emacs_mule_bytes[c])
{ {
case 2: case 2:
if (! (charset = emacs_mule_charset[c])) if ((charset_id = emacs_mule_charset[c]) < 0)
goto invalid_code; goto invalid_code;
ONE_MORE_BYTE (c); ONE_MORE_BYTE (c);
if (c < 0xA0) if (c < 0xA0)
@ -2112,7 +2112,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
|| c == EMACS_MULE_LEADING_CODE_PRIVATE_12) || c == EMACS_MULE_LEADING_CODE_PRIVATE_12)
{ {
ONE_MORE_BYTE (c); ONE_MORE_BYTE (c);
if (c < 0xA0 || ! (charset = emacs_mule_charset[c])) if (c < 0xA0 || (charset_id = emacs_mule_charset[c]) < 0)
goto invalid_code; goto invalid_code;
ONE_MORE_BYTE (c); ONE_MORE_BYTE (c);
if (c < 0xA0) if (c < 0xA0)
@ -2121,7 +2121,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
} }
else else
{ {
if (! (charset = emacs_mule_charset[c])) if ((charset_id = emacs_mule_charset[c]) < 0)
goto invalid_code; goto invalid_code;
ONE_MORE_BYTE (c); ONE_MORE_BYTE (c);
if (c < 0xA0) if (c < 0xA0)
@ -2136,7 +2136,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
case 4: case 4:
ONE_MORE_BYTE (c); ONE_MORE_BYTE (c);
if (c < 0 || ! (charset = emacs_mule_charset[c])) if (c < 0 || (charset_id = emacs_mule_charset[c]) < 0)
goto invalid_code; goto invalid_code;
ONE_MORE_BYTE (c); ONE_MORE_BYTE (c);
if (c < 0xA0) if (c < 0xA0)
@ -2150,21 +2150,21 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
case 1: case 1:
code = c; code = c;
charset = CHARSET_FROM_ID (ASCII_BYTE_P (code) charset_id = ASCII_BYTE_P (code) ? charset_ascii : charset_eight_bit;
? charset_ascii : charset_eight_bit);
break; break;
default: default:
abort (); abort ();
} }
CODING_DECODE_CHAR (coding, src, src_base, src_end, charset, code, c); CODING_DECODE_CHAR (coding, src, src_base, src_end,
CHARSET_FROM_ID (charset_id), code, c);
if (c < 0) if (c < 0)
goto invalid_code; goto invalid_code;
} }
*nbytes = src - src_base; *nbytes = src - src_base;
*nchars = consumed_chars; *nchars = consumed_chars;
if (id) if (id)
*id = charset->id; *id = charset_id;
return (mseq_found ? -c : c); return (mseq_found ? -c : c);
no_more_source: no_more_source:

View file

@ -218,11 +218,13 @@ usage: (char-to-string CHAR) */)
} }
DEFUN ("byte-to-string", Fbyte_to_string, Sbyte_to_string, 1, 1, 0, DEFUN ("byte-to-string", Fbyte_to_string, Sbyte_to_string, 1, 1, 0,
doc: /* Convert arg BYTE to a string containing that byte. */) doc: /* Convert arg BYTE to a unibyte string containing that byte. */)
(Lisp_Object byte) (Lisp_Object byte)
{ {
unsigned char b; unsigned char b;
CHECK_NUMBER (byte); CHECK_NUMBER (byte);
if (XINT (byte) < 0 || XINT (byte) > 255)
error ("Invalid byte");
b = XINT (byte); b = XINT (byte);
return make_string_from_bytes (&b, 1, 1); return make_string_from_bytes (&b, 1, 1);
} }

View file

@ -3074,6 +3074,23 @@ xg_modify_menubar_widgets (GtkWidget *menubar, FRAME_PTR f, widget_value *val,
gtk_widget_show_all (menubar); gtk_widget_show_all (menubar);
} }
/* Callback called when the menu bar W is mapped.
Used to find the height of the menu bar if we didn't get it
after showing the widget. */
static void
menubar_map_cb (GtkWidget *w, gpointer user_data)
{
GtkRequisition req;
FRAME_PTR f = (FRAME_PTR) user_data;
gtk_widget_size_request (w, &req);
if (FRAME_MENUBAR_HEIGHT (f) != req.height)
{
FRAME_MENUBAR_HEIGHT (f) = req.height;
xg_height_changed (f);
}
}
/* Recompute all the widgets of frame F, when the menu bar has been /* Recompute all the widgets of frame F, when the menu bar has been
changed. Value is non-zero if widgets were updated. */ changed. Value is non-zero if widgets were updated. */
@ -3095,10 +3112,20 @@ xg_update_frame_menubar (FRAME_PTR f)
FALSE, FALSE, 0); FALSE, FALSE, 0);
gtk_box_reorder_child (GTK_BOX (x->vbox_widget), x->menubar_widget, 0); gtk_box_reorder_child (GTK_BOX (x->vbox_widget), x->menubar_widget, 0);
g_signal_connect (x->menubar_widget, "map", G_CALLBACK (menubar_map_cb), f);
gtk_widget_show_all (x->menubar_widget); gtk_widget_show_all (x->menubar_widget);
gtk_widget_size_request (x->menubar_widget, &req); gtk_widget_size_request (x->menubar_widget, &req);
FRAME_MENUBAR_HEIGHT (f) = req.height;
xg_height_or_width_changed (f); /* If menu bar doesn't know its height yet, cheat a little so the frame
doesn't jump so much when resized later in menubar_map_cb. */
if (req.height == 0)
req.height = 23;
if (FRAME_MENUBAR_HEIGHT (f) != req.height)
{
FRAME_MENUBAR_HEIGHT (f) = req.height;
xg_height_or_width_changed (f);
}
UNBLOCK_INPUT; UNBLOCK_INPUT;
return 1; return 1;

View file

@ -582,7 +582,7 @@ read_emacs_mule_char (int c, int (*readbyte) (int, Lisp_Object), Lisp_Object rea
if (len == 2) if (len == 2)
{ {
charset = emacs_mule_charset[buf[0]]; charset = CHARSET_FROM_ID (emacs_mule_charset[buf[0]]);
code = buf[1] & 0x7F; code = buf[1] & 0x7F;
} }
else if (len == 3) else if (len == 3)
@ -590,18 +590,18 @@ read_emacs_mule_char (int c, int (*readbyte) (int, Lisp_Object), Lisp_Object rea
if (buf[0] == EMACS_MULE_LEADING_CODE_PRIVATE_11 if (buf[0] == EMACS_MULE_LEADING_CODE_PRIVATE_11
|| buf[0] == EMACS_MULE_LEADING_CODE_PRIVATE_12) || buf[0] == EMACS_MULE_LEADING_CODE_PRIVATE_12)
{ {
charset = emacs_mule_charset[buf[1]]; charset = CHARSET_FROM_ID (emacs_mule_charset[buf[1]]);
code = buf[2] & 0x7F; code = buf[2] & 0x7F;
} }
else else
{ {
charset = emacs_mule_charset[buf[0]]; charset = CHARSET_FROM_ID (emacs_mule_charset[buf[0]]);
code = ((buf[1] << 8) | buf[2]) & 0x7F7F; code = ((buf[1] << 8) | buf[2]) & 0x7F7F;
} }
} }
else else
{ {
charset = emacs_mule_charset[buf[1]]; charset = CHARSET_FROM_ID (emacs_mule_charset[buf[1]]);
code = ((buf[2] << 8) | buf[3]) & 0x7F7F; code = ((buf[2] << 8) | buf[3]) & 0x7F7F;
} }
c = DECODE_CHAR (charset, code); c = DECODE_CHAR (charset, code);