Mercurial > emacs
changeset 111779:141d3f14d8c3
Merge changes from emacs-23 branch
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Sat, 27 Nov 2010 15:04:57 -0500 |
parents | f026c8607795 (current diff) 154433017097 (diff) |
children | e235f9dbb282 |
files | admin/notes/bugtracker doc/emacs/ChangeLog doc/emacs/emacs.texi doc/emacs/maintaining.texi doc/lispref/ChangeLog doc/lispref/help.texi doc/lispref/nonascii.texi doc/lispref/text.texi doc/misc/ChangeLog etc/ChangeLog etc/HELLO etc/NEWS.23 lib-src/ChangeLog lib-src/ebrowse.c lisp/ChangeLog lisp/ChangeLog.13 lisp/dired.el lisp/emacs-lisp/smie.el lisp/gnus/ChangeLog lisp/gnus/pop3.el lisp/locate.el lisp/lpr.el lisp/mail/rmail.el lisp/mail/rmailmm.el lisp/mail/rmailsum.el lisp/net/tramp.el lisp/progmodes/python.el lisp/vc/log-edit.el src/ChangeLog src/alloc.c src/charset.c src/charset.h src/coding.c src/editfns.c src/gtkutil.c src/lread.c |
diffstat | 46 files changed, 1229 insertions(+), 525 deletions(-) [+] |
line wrap: on
line diff
--- a/admin/notes/bugtracker Sat Nov 27 10:40:19 2010 +0200 +++ b/admin/notes/bugtracker Sat Nov 27 15:04:57 2010 -0500 @@ -475,8 +475,8 @@ ** Bazaar stuff *** 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 -or ~/locations.conf: +Emacs bug 123. You will first need to add a line to one of your +configuration files, ~/.bazaar/bazaar.conf or ~/.bazaar/locations.conf: bugtracker_debbugs_url = http://debbugs.gnu.org/{id} @@ -491,7 +491,7 @@ 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 located at `/home/projects/emacs/trunk', you need to have this in your -~/locations.conf file: +~/.bazaar/locations.conf file: [/home/projects/emacs/trunk] bugtracker_debbugs_url = http://debbugs.gnu.org/{id}
--- a/doc/emacs/ChangeLog Sat Nov 27 10:40:19 2010 +0200 +++ b/doc/emacs/ChangeLog Sat Nov 27 15:04:57 2010 -0500 @@ -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> * rmail.texi (Rmail Coding): Characters with no fonts are not
--- a/doc/emacs/emacs.texi Sat Nov 27 10:40:19 2010 +0200 +++ b/doc/emacs/emacs.texi Sat Nov 27 15:04:57 2010 -0500 @@ -771,6 +771,7 @@ * Introduction to VC:: How version control works in general. * VC Mode Line:: How the mode line shows version control status. * 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. * Secondary VC Commands:: The commands used a little less frequently. * VC Directory Mode:: Listing files managed by version control. @@ -785,6 +786,9 @@ * Why Version Control?:: Understanding the problems it addresses. * Version Control Systems:: Supported version control back-end systems. * 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. Basic Editing under Version Control @@ -792,7 +796,6 @@ * 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. * 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
--- a/doc/emacs/macos.texi Sat Nov 27 10:40:19 2010 +0200 +++ b/doc/emacs/macos.texi Sat Nov 27 15:04:57 2010 -0500 @@ -8,23 +8,22 @@ @cindex Macintosh @cindex GNUstep - This section briefly describes the peculiarities of using Emacs built with -the GNUstep libraries on GNU/Linux or other operating systems, or on Mac OS X -with native window system support. For Mac OS X, Emacs can be built either -without window system support, with X11, or with the Cocoa interface. This -section only applies to the Cocoa build. Emacs 23 does not support Mac OS -Classic. + 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 with native window system support. On Mac OS X, Emacs can be +built either without window system support, with X11, or with the +Cocoa interface; this section only applies to the Cocoa build. Emacs +does not support earlier versions of Mac OS. - Emacs, when built on Mac OS X, uses the Cocoa application interface. For -various historical and technical reasons, Emacs uses the term @samp{Nextstep} -internally, instead of ``Cocoa'' or ``Mac OS X''; for instance, most of the -commands and variables described in the following sections begin with -@samp{ns-}, which is short for @samp{Nextstep}. NeXTstep was an application -interface released by NeXT Inc during the 1980s, of which Cocoa is a direct -descendant. Apart from Cocoa, there is another NeXTstep-style system: -GNUstep, which is free software. As of this writing, the GNUstep support is -alpha status (@pxref{GNUstep Support}), but we hope to improve it in the -future. + For various historical and technical reasons, Emacs uses the term +@samp{Nextstep} internally, instead of ``Cocoa'' or ``Mac OS X''; for +instance, most of the commands and variables described in this section +begin with @samp{ns-}, which is short for @samp{Nextstep}. NeXTstep +was an application interface released by NeXT Inc during the 1980s, of +which Cocoa is a direct descendant. Apart from Cocoa, there is +another NeXTstep-style system: GNUstep, which is free software. As of +this writing, the GNUstep support is alpha status (@pxref{GNUstep +Support}), but we hope to improve it in the future. @menu * Mac / GNUstep Basics:: Basic Emacs usage under GNUstep or Mac OS. @@ -37,19 +36,24 @@ @section Basic Emacs usage under Mac OS and GNUstep 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 -same as @key{Super}, and Emacs provides a set of keybindings using -this modifier key that mimic other Mac / GNUstep applications (@pxref{Mac / -GNUstep Events}). You can change these bindings in the usual way (@pxref{Key -Bindings}). +@key{Meta}. The Mac @key{Cmd} key is the same as @key{Super}, and +Emacs provides a set of keybindings using this modifier key that mimic +other Mac / GNUstep applications (@pxref{Mac / GNUstep Events}). You +can change these bindings in the usual way (@pxref{Key Bindings}). - 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. -@c [unclear if the following holds.] -@c To finalize the settings for either color or font, choose @samp{Save Options} in the @samp{Options} menu. + The variable @code{ns-right-alternate-modifier} controls the +behavior of the right @key{alt} and @key{option} keys. These keys +behave like the left-hand keys if the value is @code{left} (the +default). A value of @code{control}, @code{meta}, @code{alt}, +@code{super}, or @code{hyper} makes them behave like the corresponding +modifier keys; a value of @code{none} tells Emacs to ignore them. + + 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 while holding down the @key{Shift} key) adjusts the region to the @@ -58,7 +62,7 @@ @key{S-Mouse-1} normally does (@pxref{Temporary Face Changes}). This 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 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 @@ -110,7 +114,7 @@ background color. @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} @code{list-faces-display}. @@ -193,7 +197,7 @@ @code{ns-input-fontsize}, respectively. @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. The default behavior is to save all file-visiting buffers. @end table @@ -208,26 +212,9 @@ services and receive the results back. Note that you may need to restart Emacs to access newly-available services. - @node GNUstep Support, , Mac / GNUstep Events, Mac OS / GNUstep @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 @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
--- a/doc/emacs/maintaining.texi Sat Nov 27 10:40:19 2010 +0200 +++ b/doc/emacs/maintaining.texi Sat Nov 27 15:04:57 2010 -0500 @@ -24,20 +24,20 @@ @section 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 -time of each version, who created it, and a description of what was -changed in that version. +time of each version, who made it, and a description of what was +changed. - The Emacs version control interface is called VC. Its commands work -with several different version control systems; currently, it supports -GNU Arch, Bazaar, CVS, Git, Mercurial, Monotone, RCS, SCCS/CSSC, and -Subversion. Of these, the GNU project distributes CVS, GNU Arch, RCS, -and Bazaar. + The Emacs version control interface is called @dfn{VC}. VC commands +work with several different version control systems; currently, it +supports GNU Arch, Bazaar, CVS, Git, Mercurial, Monotone, RCS, +SCCS/CSSC, and Subversion. Of these, the GNU project distributes CVS, +Arch, RCS, and Bazaar. - VC is enabled automatically whenever you visit a file that is -governed by a version control system. To disable VC entirely, set the -customizable variable @code{vc-handled-backends} to @code{nil} + VC is enabled automatically whenever you visit a file governed by a +version control system. To disable VC entirely, set the customizable +variable @code{vc-handled-backends} to @code{nil} @iftex (@pxref{Customizing VC,,,emacs-xtra, Specialized Emacs Features}). @end iftex @@ -49,6 +49,7 @@ * Introduction to VC:: How version control works in general. * VC Mode Line:: How the mode line shows version control status. * 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. * Secondary VC Commands:: The commands used a little less frequently. * VC Directory Mode:: Listing files managed by version control. @@ -65,12 +66,13 @@ @subsection Introduction to Version Control VC allows you to use a version control system from within Emacs, -integrating the version control operations smoothly with editing. -Though VC cannot completely bridge the gaps between version control -systems with widely differing capabilities, it does provide a uniform -interface to many version control operations. Regardless of which -version control system is in use, you will be able to do basic -operations in much the same way. +integrating the version control operations smoothly with editing. It +provides a uniform interface for common operations in many version +control operations. + + Some uncommon or intricate version control operations, such as +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 describes the version control systems that VC supports. You can skip @@ -81,6 +83,9 @@ * Why Version Control?:: Understanding the problems it addresses. * Version Control Systems:: Supported version control back-end systems. * 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. @end menu @@ -112,8 +117,8 @@ @subsubsection Supported Version Control Systems @cindex back end (version control) - VC currently works with many different version control systems or -@dfn{back ends}: + VC currently works with many different version control systems, +which it refers to as @dfn{back ends}: @itemize @bullet @@ -134,73 +139,60 @@ @cindex RCS @item 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. -However, you cannot use RCS over the network, and it only works at the -level of individual files rather than projects. +built. It is relatively primitive: it cannot be used over the +network, and works at the level of individual files. Almost +everything you can do with RCS can be done through VC. @cindex CVS @item CVS is the free version control system that was, until recently (circa 2008), used by the majority of free software projects. Nowadays, it is slowly being superseded by newer systems. CVS allows concurrent -multi-user development either locally or over the network. It lacks -support for atomic commits or file moving/renaming. VC supports all -basic editing operations under CVS. For some less common tasks, you -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. +multi-user development either locally or over the network. Unlike +newer systems, it lacks support for atomic commits and file +moving/renaming. VC supports all basic editing operations under CVS. @cindex SVN @cindex Subversion @item Subversion (SVN) is a free version control system designed to be -similar to CVS but without its problems. It supports atomic commits -of filesets, and versioning of directories, symbolic links, meta-data, -renames, copies, and deletes. +similar to CVS but without its problems (e.g., it supports atomic +commits of filesets, and versioning of directories, symbolic links, +meta-data, renames, copies, and deletes). @cindex GNU Arch @cindex Arch @item -GNU Arch is a version control system designed for distributed work. -It differs in many ways from older systems like CVS and RCS. It -provides different methods for interoperating between users, support -for offline operations, and good branching and merging features. It -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. +GNU Arch is one of the earliest @dfn{distributed} version control +systems (the other being Monotone). @xref{VCS Concepts}, for a +description of distributed version control systems. It is no longer +under active development, and has been deprecated in favor of Bazaar. @cindex git @item -Git is a distributed version control system invented by Linus Torvalds to support -development of Linux (his kernel). It supports atomic commits of filesets and -file moving/renaming. One significant feature of git is that it -largely abolishes the notion of a single centralized repository; -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. +Git is a distributed version control system originally invented by +Linus Torvalds to support development of Linux (his kernel). VC +supports many common git operations, but others, such as repository +syncing, must be done from the command line. @cindex hg @cindex Mercurial @item Mercurial (hg) is a distributed version control system broadly -resembling GNU Arch and git, with atomic fileset commits and file -moving/renaming. Like git, it is fully decentralized. VC supports -most Mercurial commands, with the exception of repository sync -operations; this needs to be done from the command line. +resembling git. VC supports most Mercurial commands, with the +exception of repository sync operations. @cindex bzr @cindex Bazaar @item -Bazaar (bzr) is a distributed version control system that supports both -repository-based and distributed versioning, with atomic fileset -commits and file moving/renaming. VC supports most basic editing -operations under Bazaar. +Bazaar (bzr) is a distributed version control system that supports +both repository-based and distributed versioning. VC supports most +basic editing operations under Bazaar. @end itemize Previous versions of VC supported a version control system known as -Meta-CVS. This support has been dropped because of limited interest -from users and developers. +Meta-CVS. This support was dropped due to limited interest from users +and developers. @node VCS Concepts @subsubsection Concepts of Version Control @@ -216,11 +208,11 @@ @cindex work file @cindex checking out files - A file @dfn{checked out} of a repository is called the @dfn{work -file}. You edit the work file and make changes in it, as you would -with 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 -the repository, along with a log entry for those changes. + The copy of a version-controlled file that you actually edit is +called the @dfn{work file}. You can change each work file as you +would an ordinary file. After you are done with a set of changes, you +@dfn{commit} (or @dfn{check in}) the changes; this records the changes +in the repository, along with a descriptive log entry. @cindex revision @cindex revision ID @@ -231,12 +223,15 @@ integer. To go beyond these basic concepts, you will need to understand three -aspects in which version control systems differ. -They can be locking-based or merging-based; they can be file-based or -changeset-based; and they can be centralized or decentralized. VC -handles all these modes of operation, but it cannot hide the differences. +aspects in which version control systems differ. As explained in the +next three sections, they can be lock-based or merge-based; file-based +or changeset-based; and centralized or decentralized. VC handles all +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 + A version control system typically has some mechanism to coordinate between users who want to change the same file. There are two ways to do this: merging and locking. @@ -244,8 +239,7 @@ 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 @dfn{merge} your work file, which may contain changes that have not -been checked in, with the latest changes that others have checked into -the repository. +been committed, with the latest changes that others have committed. Older version control systems use a @dfn{locking} scheme instead. Here, work files are normally read-only. To edit a file, you ask the @@ -253,7 +247,7 @@ 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 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 then lock the file to make their own changes. @@ -261,8 +255,8 @@ 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 unable to because it is locked. In merging systems, @dfn{merge -conflicts} happen when you check in a change to a file that conflicts -with a change checked in by someone else after your checkout. Both +conflicts} happen when you commit a change to a file that conflicts +with a change committed by someone else after your checkout. Both kinds of conflict have to be resolved by human judgment and communication. Experience has shown that merging is superior to locking, both in convenience to developers and in minimizing the @@ -275,27 +269,33 @@ Mercurial, are exclusively merging-based. VC mode supports both locking and merging version control. The -terms ``checkin'' and ``checkout'' come from locking-based version -control systems; newer version control systems have slightly different -operations usually called ``commit'' and ``update'', but VC hides the -differences between them as much as possible. +terms ``commit'' and ``update'' are used in newer version control +systems; older lock-based systems use the terms ``check in'' and +``check out''. VC hides the differences between them as much as +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 control operations are @dfn{file-based}: each file has its own comment -and revision history separate from that of all other files in the -system. Later systems, beginning with Subversion, are -@dfn{changeset-based}: a checkin may include changes to several files, -and the entire set of changes is treated as a unit by the system. Any -comment associated with the change does not belong to a single file, -but to the changeset itself. +and revision history separate from that of all other files. Newer +systems, beginning with Subversion, are @dfn{changeset-based}: a +checkin may include changes to several files, and the entire set of +changes is handled as a unit. Any comment associated with the change +does not belong to a single file, but to the changeset itself. Changeset-based version control is more flexible and powerful than 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 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 @dfn{centralized} model in which each project has only one repository used by all developers. SCCS, RCS, CVS, and Subversion share this @@ -306,14 +306,12 @@ control, later implemented in git, Mercurial, and Bazaar. A project may have several different repositories, and these systems support a sort of super-merge between repositories that tries to reconcile their -change histories. At the limit, each developer has his/her own -repository, and repository merges replace checkin/commit operations. +change histories. In effect, there is one repository for each +developer, and repository merges take the place of commit operations. - VC's job is to help you manage the traffic between your personal -workfiles and a repository. Whether that repository is a single -master or one of a network of peer repositories is not something VC -has to care about. Thus, the difference between a centralized and a -decentralized version control system is invisible to VC mode. + VC helps you manage the traffic between your personal workfiles and +a repository. Whether the repository is a single master, or one of a +network of peer repositories, is not something VC has to care about. @node Types of Log File @subsubsection Types of Log File @@ -323,9 +321,9 @@ 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: -each time you check in a change, you fill out a @dfn{log entry} for -the change (@pxref{Log Buffer}). This is called the @dfn{version -control log}. +each time you commit a change, you fill out a @dfn{log entry} for the +change (@pxref{Log Buffer}). This is called the @dfn{version control +log}. The other kind of log is the file @file{ChangeLog} (@pxref{Change Log}). It provides a chronological record of all changes to a large @@ -365,32 +363,29 @@ @cindex VC, mode line indicator 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 -back end is used for that file, and the current version of the file is -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. +this on the mode line. For example, @samp{Bzr-1223} says that Bazaar +is used for that file, and the current revision ID is 1223. The character between the back-end name and the revision ID -indicates the version control status of the file. @samp{-} means that -the work file is not locked (if locking is in use), or not modified (if -locking is not in use). @samp{:} indicates that the file is locked, or -that it is modified. If the file is locked by some other user (for +indicates the status of the work file. In a merge-based version +control system, a @samp{-} character indicates that the work file is +unmodified, and @samp{:} indicates that it has been modified. +@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}. @samp{@@} means that the file was locally added, but not yet committed -to the master repository. @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. +to the master repository. 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 description of the version control status. Pressing @kbd{Mouse-1} -over the indicator pops up a menu of VC commands. This menu is -identical to the @samp{Tools / Version Control} menu item. +over the indicator pops up a menu of VC commands, identical to +@samp{Tools / Version Control} on the menu bar. @vindex auto-revert-check-vc-info When Auto Revert mode (@pxref{Reverting}) reverts a buffer that is @@ -442,12 +437,6 @@ version control system; if they are not, Emacs signals an error when 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 viewing and visiting files in functional groups (@pxref{Filesets}). Unlike named filesets, VC filesets are not named and don't persist @@ -457,7 +446,6 @@ * 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. * Advanced C-x v v:: Advanced features available with a prefix argument. -* Log Buffer:: Features available in log entry buffers. @end menu @node VC With A Merging VCS @@ -490,9 +478,9 @@ in changes to the repository, merge those changes into the work file. @item -If you have made modifications to the work file, attempts to check in -your changes. To do this, Emacs first reads the log entry for the new -revision (@pxref{Log Buffer}). If some other user has checked in +If you have made modifications to the work file, attempt to commit +the changes. To do this, Emacs first reads the log entry for the new +revision (@pxref{Log Buffer}). If some other user has committed 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 into your own work file; this puts the work file into a ``conflicted'' @@ -507,8 +495,8 @@ These rules also apply when you use RCS in its ``non-locking'' mode, except that changes are not automatically merged from the repository. -Nothing informs you if another user has checked in changes in the same -file since you began editing it; when you check in your revision, his +Nothing informs you if another user has committed changes in the same +file since you began editing it; when you commit your revision, his changes are removed (however, they remain in the repository and are thus not irrevocably lost). Therefore, you must verify that the current revision is unchanged before checking in your changes. In @@ -528,7 +516,7 @@ can change it. @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 new revision. @xref{Log Buffer}. @@ -544,12 +532,12 @@ @end itemize 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 @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 C-x v v}), it still performs the next logical version control operation, but accepts additional arguments to specify precisely how @@ -558,8 +546,8 @@ @itemize @bullet @item 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 create a new branch (@pxref{Branches}). +to use for the new version that you commit. This is one way to create +a new branch (@pxref{Branches}). @item If the file is not modified (and unlocked), you can specify the @@ -585,34 +573,53 @@ @end itemize @node Log Buffer -@subsubsection Features of the Log Entry Buffer +@subsection Features of the Log Entry Buffer + + When you tell VC to commit a change, it pops up a buffer called +@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. - When you check in changes, Emacs pops up a buffer called -@samp{*VC-Log*} for you to enter a log entry. + While in the @samp{*VC-Log*} buffer, you can write one or more +@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: - After you have finished editing the log message, type @kbd{C-c C-c} -to exit the buffer and commit the change. +@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-diff - In the @samp{*VC-Log*} buffer, typing @kbd{C-c C-f} -(@code{log-edit-show-files}) displays a list of files in the VC -fileset you are committing. If you called @kbd{C-x v v} directly from -a work file, the VC fileset consists of that single file, so this -command is not very useful. If you called @kbd{C-x v v} from a VC -directory buffer, the VC fileset may consist of multiple files -(@pxref{VC Directory Mode}). + Type @kbd{C-c C-f} (@code{log-edit-show-files}) to display a list of +files in the current VC fileset. If you called @kbd{C-x v v} directly +from a work file, the fileset consists of that single file; if you +called @kbd{C-x v v} from a VC directory buffer (@pxref{VC Directory +Mode}), the fileset may consist of multiple files. @findex log-edit-insert-changelog - Type @kbd{C-c C-d} (@code{log-edit-show-diff}) to show a ``diff'' of -the changes you have made (i.e., the differences between the work file -and the repository revision from which you started editing the file). -The diff is displayed in a special buffer in another window. -@xref{Comparing Files}. + Type @kbd{C-c C-d} (@code{log-edit-show-diff}) to show a @dfn{diff} +of the changes you have made (i.e., the differences between the work +file and the repository revision from which you started editing). +@xref{Old Revisions}. - If you have written an entry in the @file{ChangeLog} (@pxref{Change -Log}), type @kbd{C-c C-a} (@code{log-edit-insert-changelog}) to pull -it into the @samp{*VC-Log*} buffer. If the topmost item in the + If the current VC fileset includes one or more @file{ChangeLog} +files (@pxref{Change Log}), type @kbd{C-c C-a} +(@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, this command searches that item for entries that match the file(s) to be committed; if found, these entries are inserted. @@ -627,7 +634,7 @@ 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 -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 any time to complete the check-in. @@ -636,7 +643,7 @@ is the normal way to do things on a changeset-oriented system, where comments are attached to changesets rather than the history of 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 you type @kbd{C-c C-c}. @@ -648,7 +655,7 @@ versions are used outside the minibuffer). @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} and @code{vc-log-mode-hook}. @xref{Hooks}. @@ -700,8 +707,12 @@ @kbd{C-x v =} (@code{vc-diff}) compares each file in the current VC fileset (saving them if necessary) with the repository revision(s) 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 -special buffer in another window. @xref{Comparing Files}. +be the latest revision of the file(s). + + 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 @kindex C-u C-x v = @@ -1008,7 +1019,7 @@ @kindex C-x v c @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 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 @@ -1075,8 +1086,8 @@ @noindent In this example, @samp{file1.c} is modified with respect to the repository, and @samp{file2.c} is not. @samp{file3.c} is modified, -but other changes have also been checked in to the repository---you -need to merge them with the work file before you can check it in. +but other changes have also been committed---you need to merge them +with the work file before you can check it in. @vindex vc-stay-local @vindex vc-cvs-stay-local @@ -1114,7 +1125,7 @@ VC Directory mode has a full set of navigation and marking commands 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 move vertically as in other list-browsing modes. @key{SPC} and @@ -1158,7 +1169,8 @@ @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 shelves in version control @@ -1174,11 +1186,11 @@ @kbd{+}, @kbd{l}, @kbd{i}, and @kbd{v} behave as through prefixed with @kbd{C-x v}. - The command @kbd{C-x v v} (@code{vc-next-action}) operates on all the -marked files, so that you can check in several files at once. -If the underlying VC supports atomic commits of multiple-file -changesets, @kbd{C-x v v} with a selected set of modified but not -committed files will commit all of them at once as a single changeset. + The command @kbd{C-x v v} (@code{vc-next-action}) operates on all +the marked files, so that you can commit several files at once. If +the underlying VC supports atomic commits of multiple-file changesets, +@kbd{C-x v v} with a selected set of modified but not committed files +will commit all of them at once as a single changeset. 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 @@ -1261,15 +1273,15 @@ @node Creating Branches @subsubsection Creating New Branches - To create a new branch from a head revision (one that is the latest in -the branch that contains it), first select that revision if necessary, -lock it with @kbd{C-x v v}, and make whatever changes you want. Then, -when you check in the changes, use @kbd{C-u C-x v v}. This lets you -specify the revision ID for the new revision. You should specify a -suitable branch ID for a branch starting at the current revision. -For example, if the current revision is 2.5, the branch ID should be -2.5.1, 2.5.2, and so on, depending on the number of existing branches at -that point. + To create a new branch from a head revision (one that is the latest +in the branch that contains it), first select that revision if +necessary, lock it with @kbd{C-x v v}, and make whatever changes you +want. Then, when you commit the changes, use @kbd{C-u C-x v v}. This +lets you specify the revision ID for the new revision. You should +specify a suitable branch ID for a branch starting at the current +revision. For example, if the current revision is 2.5, the branch ID +should be 2.5.1, 2.5.2, and so on, depending on the number of existing +branches at that point. 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 @@ -1282,11 +1294,11 @@ you'll be offered a chance to lock the latest revision instead. On 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 -selected revision. You need not specially request a new branch, because -that's the only way to add a new revision at a point that is not the head -of a branch. +selected revision. You need not specially request a new branch, +because that's the only way to add a new revision at a point that is +not the head of a branch. After the branch is created, you ``stay'' on it. That means that subsequent check-ins create new revisions on that branch. To leave the @@ -1334,11 +1346,11 @@ 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 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. 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 a better record of the history of changes. @@ -1374,7 +1386,7 @@ 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. 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 @subsubsection Multi-User Branching
--- a/doc/emacs/vc1-xtra.texi Sat Nov 27 10:40:19 2010 +0200 +++ b/doc/emacs/vc1-xtra.texi Sat Nov 27 15:04:57 2010 -0500 @@ -594,7 +594,7 @@ @vindex vc-handled-backends The variable @code{vc-handled-backends} determines which version 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 these systems, exclude its name from the list. To disable VC entirely, set this variable to @code{nil}. @@ -657,8 +657,8 @@ that it should always ask for confirmation.) @vindex vc-command-messages - VC mode does much of its work by running the shell commands for RCS, -CVS and SCCS. If @code{vc-command-messages} is non-@code{nil}, VC + VC mode does much of its work by running the shell commands for the +appropriate backend. If @code{vc-command-messages} is non-@code{nil}, VC displays messages to indicate which shell commands it runs, and additional messages when the commands finish.
--- a/doc/lispref/ChangeLog Sat Nov 27 10:40:19 2010 +0200 +++ b/doc/lispref/ChangeLog Sat Nov 27 15:04:57 2010 -0500 @@ -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> * commands.texi (Click Events): Document the values of X, Y and
--- a/doc/lispref/functions.texi Sat Nov 27 10:40:19 2010 +0200 +++ b/doc/lispref/functions.texi Sat Nov 27 15:04:57 2010 -0500 @@ -818,7 +818,7 @@ @result{} (a c e) (mapcar '1+ [1 2 3]) @result{} (2 3 4) -(mapcar 'char-to-string "abc") +(mapcar 'string "abc") @result{} ("a" "b" "c") @end group
--- a/doc/lispref/help.texi Sat Nov 27 10:40:19 2010 +0200 +++ b/doc/lispref/help.texi Sat Nov 27 15:04:57 2010 -0500 @@ -546,7 +546,7 @@ @smallexample @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) @end group @end smallexample
--- a/doc/lispref/nonascii.texi Sat Nov 27 10:40:19 2010 +0200 +++ b/doc/lispref/nonascii.texi Sat Nov 27 15:04:57 2010 -0500 @@ -199,6 +199,13 @@ characters. @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 This converts the multibyte character @var{char} to a unibyte character, and returns that character. If @var{char} is neither
--- a/doc/lispref/numbers.texi Sat Nov 27 10:40:19 2010 +0200 +++ b/doc/lispref/numbers.texi Sat Nov 27 15:04:57 2010 -0500 @@ -224,6 +224,14 @@ @end example @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 @section Type Predicates for Numbers @cindex predicates for numbers
--- a/doc/lispref/objects.texi Sat Nov 27 10:40:19 2010 +0200 +++ b/doc/lispref/objects.texi Sat Nov 27 15:04:57 2010 -0500 @@ -582,7 +582,6 @@ @group foo ; @r{A symbol named @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 @group 1+ ; @r{A symbol named @samp{1+}}
--- a/doc/lispref/strings.texi Sat Nov 27 10:40:19 2010 +0200 +++ b/doc/lispref/strings.texi Sat Nov 27 15:04:57 2010 -0500 @@ -126,9 +126,8 @@ @result{} "" @end example - Other functions to compare with this one include @code{char-to-string} -(@pxref{String Conversion}), @code{make-vector} (@pxref{Vectors}), and -@code{make-list} (@pxref{Building Lists}). + Other functions to compare with this one include @code{make-vector} +(@pxref{Vectors}) and @code{make-list} (@pxref{Building Lists}). @end defun @defun string &rest characters @@ -565,38 +564,6 @@ (@code{single-key-description} and @code{text-char-description}). These 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 @cindex integer to string @cindex integer to decimal @@ -659,19 +626,39 @@ @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 + Here are some other functions that can convert to or from a string: @table @code @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}. @item vconcat -@code{vconcat} can convert a string into a vector. @xref{Vector +This function converts a string into a vector. @xref{Vector Functions}. @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 @node Formatting Strings
--- a/doc/lispref/symbols.texi Sat Nov 27 10:40:19 2010 +0200 +++ b/doc/lispref/symbols.texi Sat Nov 27 15:04:57 2010 -0500 @@ -383,7 +383,7 @@ example using @code{mapatoms}. @end defun -@defun unintern symbol &optional obarray +@defun unintern symbol obarray This function deletes @var{symbol} from the obarray @var{obarray}. If @code{symbol} is not actually in the obarray, @code{unintern} does nothing. If @var{obarray} is @code{nil}, the current obarray is used.
--- a/doc/lispref/text.texi Sat Nov 27 10:40:19 2010 +0200 +++ b/doc/lispref/text.texi Sat Nov 27 15:04:57 2010 -0500 @@ -87,7 +87,7 @@ @example @group -(char-to-string (char-after 1)) +(string (char-after 1)) @result{} "@@" @end group @end example @@ -122,9 +122,9 @@ @end group @group -(char-to-string (preceding-char)) +(string (preceding-char)) @result{} "a" -(char-to-string (following-char)) +(string (following-char)) @result{} "c" @end group @end example @@ -866,7 +866,7 @@ @code{last-command}) whether the previous command was a kill command, 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 @var{end}. The text is deleted but saved in the kill ring, along with its text properties. The value is always @code{nil}. @@ -874,17 +874,10 @@ In an interactive call, @var{start} and @var{end} are point and the mark. -@c Emacs 19 feature 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. 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. - -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 @defopt kill-read-only-ok @@ -1069,7 +1062,7 @@ move the yanking pointer. @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 makes the yanking pointer point to it. It discards the oldest entry if appropriate. It also invokes the value of @@ -1078,25 +1071,15 @@ 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 @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 -@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 kill ring and makes the yanking pointer point to the combined entry. 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 function also invokes the value of @code{interprogram-cut-function} -(see below). This handles @var{yank-handler} just like -@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. +(see below). @end defun @defvar interprogram-paste-function
--- a/doc/lispref/variables.texi Sat Nov 27 10:40:19 2010 +0200 +++ b/doc/lispref/variables.texi Sat Nov 27 15:04:57 2010 -0500 @@ -544,21 +544,23 @@ buffer-local bindings for a symbol that is defined with @code{defconst}.) -Here, @code{pi} is a constant that presumably ought not to be changed -by anyone (attempts by the Indiana State Legislature notwithstanding). -As the second form illustrates, however, this is only advisory. +An example of the use of @code{defconst} is Emacs' definition of +@code{float-pi}---the mathematical constant @math{pi}, which ought not +to be changed by anyone (attempts by the Indiana State Legislature +notwithstanding). As the second form illustrates, however, +@code{defconst} is only advisory. @example @group -(defconst pi 3.1415 "Pi to five places.") - @result{} pi +(defconst float-pi 3.141592653589793 "The value of Pi.") + @result{} float-pi @end group @group -(setq pi 3) - @result{} pi +(setq float-pi 3) + @result{} float-pi @end group @group -pi +float-pi @result{} 3 @end group @end example
--- a/doc/misc/ChangeLog Sat Nov 27 10:40:19 2010 +0200 +++ b/doc/misc/ChangeLog Sat Nov 27 15:04:57 2010 -0500 @@ -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> * gnus.texi (Server Commands): Document gnus-server-show-server.
--- a/doc/misc/nxml-mode.texi Sat Nov 27 10:40:19 2010 +0200 +++ b/doc/misc/nxml-mode.texi Sat Nov 27 15:04:57 2010 -0500 @@ -8,7 +8,8 @@ This manual documents nxml-mode, an Emacs major mode for editing 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 Permission is granted to copy, distribute and/or modify this document @@ -43,6 +44,7 @@ This manual is not yet complete. @menu +* Introduction:: * Completion:: * Inserting end-tags:: * Paragraphs:: @@ -52,6 +54,58 @@ * Limitations:: @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 @chapter Completion @@ -855,6 +909,3 @@ @bye -@ignore - arch-tag: 3b6e8ac2-ae8d-4f38-bd43-ce9f80be04d6 -@end ignore
--- a/etc/ChangeLog Sat Nov 27 10:40:19 2010 +0200 +++ b/etc/ChangeLog Sat Nov 27 15:04:57 2010 -0500 @@ -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> * NEWS: Document display of glyphless characters.
--- a/etc/HELLO Sat Nov 27 10:40:19 2010 +0200 +++ b/etc/HELLO Sat Nov 27 15:04:57 2010 -0500 @@ -33,6 +33,7 @@ Georgian ($,1JEJ0J@J7J5J4J:J8(B) $,1J2J0J;J0J@JOJ=J1J0(B German (Deutsch) Guten Tag / Gr,A|_(B Gott 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 Hebrew $,1ro(B($,1-",q-(,y-*(B) ,Hylem(B Hungarian (magyar) Sz,Bi(Bp j,Bs(B napot!
--- a/etc/NEWS.23 Sat Nov 27 10:40:19 2010 +0200 +++ b/etc/NEWS.23 Sat Nov 27 15:04:57 2010 -0500 @@ -21,9 +21,6 @@ * 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 @@ -34,6 +31,42 @@ ** 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. +--- +** 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 +++ @@ -41,10 +74,12 @@ * New Modes and Packages in Emacs 23.3 + ** smie.el is a generic navigation and indentation engine. It takes a simple BNF description of the grammar, and provides both sexp-style navigation (jumping over begin..end pairs) as well as indentation, which can be adjusted via ad-hoc indentation rules. + * Incompatible Lisp Changes in Emacs 23.3 @@ -55,16 +90,29 @@ * Lisp changes in Emacs 23.3 ++++ ** `e' and `pi' are now called `float-e' and `float-pi'. 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. * 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
--- a/lib-src/ChangeLog Sat Nov 27 10:40:19 2010 +0200 +++ b/lib-src/ChangeLog Sat Nov 27 15:04:57 2010 -0500 @@ -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> * emacsclient.c (set_local_socket) [DARWIN_OS]: Add fall-back
--- a/lib-src/ebrowse.c Sat Nov 27 10:40:19 2010 +0200 +++ b/lib-src/ebrowse.c Sat Nov 27 15:04:57 2010 -0500 @@ -1700,6 +1700,11 @@ case '/': 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; break;
--- a/lisp/ChangeLog Sat Nov 27 10:40:19 2010 +0200 +++ b/lisp/ChangeLog Sat Nov 27 15:04:57 2010 -0500 @@ -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> * international/characters.el (glyphless-char-display-control): @@ -227,7 +337,8 @@ 2010-11-18 Stefan Monnier <monnier@iro.umontreal.ca> * 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> @@ -6074,7 +6185,7 @@ * vc/vc-annotate.el (vc-annotate): Add an optional argument for the VC backend. Use it when non-nil. (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. * 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> - * 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> @@ -10624,8 +10736,8 @@ 2009-12-18 Ulf Jasper <ulf.jasper@web.de> * calendar/icalendar.el (icalendar--convert-tz-offset): - Fix timezone names. - (icalendar--convert-tz-offset): Fix the "last-day-problem". + Fixed timezone names. + (icalendar--convert-tz-offset): Fixed the "last-day-problem". (icalendar--add-diary-entry): Remove the trailing blank that diary-make-entry inserts.
--- a/lisp/ChangeLog.13 Sat Nov 27 10:40:19 2010 +0200 +++ b/lisp/ChangeLog.13 Sat Nov 27 15:04:57 2010 -0500 @@ -6680,8 +6680,9 @@ buffer if the parent buffer is in vc-dired-mode. 2007-11-23 Mark A. Hershberger <mah@everybody.org> - - * nxml: Initial merge of nxml. Kept nxml/char-name subdir for now. + James Clark <none@example.com> + + * nxml/: Initial merge of nxml. Kept nxml/char-name subdir for now. 2007-11-23 Juri Linkov <juri@jurta.org> @@ -16693,10 +16694,9 @@ ;; Local Variables: ;; coding: utf-8 -;; add-log-time-zone-rule: t ;; 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. @@ -16712,5 +16712,3 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. - -;; arch-tag: 1e8aa93a-fc6c-4ac3-9b10-1f445e1840af
--- a/lisp/dired.el Sat Nov 27 10:40:19 2010 +0200 +++ b/lisp/dired.el Sat Nov 27 15:04:57 2010 -0500 @@ -2011,6 +2011,14 @@ ;; with quotation marks in their names. (while (string-match "\\(?:[^\\]\\|\\`\\)\\(\"\\)" file) (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 "\""))) ;; The above `read' will return a unibyte string if FILE ;; contains eight-bit-control/graphic characters.
--- a/lisp/emacs-lisp/smie.el Sat Nov 27 10:40:19 2010 +0200 +++ b/lisp/emacs-lisp/smie.el Sat Nov 27 15:04:57 2010 -0500 @@ -76,8 +76,6 @@ ;; 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 ;; 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 @@ -470,7 +468,7 @@ (to (cdar eqs))) (setq eqs (cdr eqs)) (if (eq to from) - nil ;Nothing to do. + nil ;Nothing to do. (dolist (other-eq eqs) (if (eq from (cdr other-eq)) (setcdr other-eq to)) (when (eq from (car other-eq)) @@ -523,24 +521,23 @@ (setcar (car eq) (cadr eq)) ;; (smie-check-grammar table prec2 'step2) ) - ;; Finally, fill in the remaining vars (which only appeared on the - ;; right side of the < constraints). - (let ((classification-table (gethash :smie-open/close-alist prec2))) - (dolist (x table) - ;; When both sides are nil, it means this operator binds very - ;; very tight, but it's still just an operator, so we give it - ;; the highest precedence. - ;; OTOH if only one side is nil, it usually means it's like an - ;; open-paren, which is very important for indentation purposes, - ;; so we keep it nil if so, to make it easier to recognize. - (unless (or (nth 1 x) - (eq 'opener (cdr (assoc (car x) classification-table)))) - (setf (nth 1 x) i) - (incf i)) ;See other (incf i) above. - (unless (or (nth 2 x) - (eq 'closer (cdr (assoc (car x) classification-table)))) - (setf (nth 2 x) i) - (incf i))))) ;See other (incf i) above. + ;; Finally, fill in the remaining vars (which did not appear on the + ;; left side of any < constraint). + (dolist (x table) + (unless (nth 1 x) + (setf (nth 1 x) i) + (incf i)) ;See other (incf i) above. + (unless (nth 2 x) + (setf (nth 2 x) i) + (incf i)))) ;See other (incf i) above. + ;; Mark closers and openers. + (dolist (x (gethash :smie-open/close-alist prec2)) + (let* ((token (car x)) + (cons (case (cdr x) + (closer (cddr (assoc token table))) + (opener (cdr (assoc token table)))))) + (assert (numberp (car cons))) + (setf (car cons) (list (car cons))))) (let ((ca (gethash :smie-closer-alist prec2))) (when ca (push (cons :smie-closer-alist ca) table))) ;; (smie-check-grammar table prec2 'step3) @@ -611,6 +608,8 @@ 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 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: (FORW-LEVEL POS TOKEN): we couldn't skip TOKEN because its back-level is too high. FORW-LEVEL is the forw-level of TOKEN, @@ -619,7 +618,10 @@ (nil POS TOKEN): we skipped over a paren-like pair. nil: we skipped over an identifier, matched parentheses, ..." (catch 'return - (let ((levels ())) + (let ((levels + (if (stringp halfsexp) + (prog1 (list (cdr (assoc halfsexp smie-grammar))) + (setq halfsexp nil))))) (while (let* ((pos (point)) (token (funcall next-token)) @@ -697,6 +699,8 @@ "Skip over one sexp. 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. +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: (LEFT-LEVEL POS TOKEN): we couldn't skip TOKEN because its right-level is too high. LEFT-LEVEL is the left-level of TOKEN, @@ -714,7 +718,9 @@ (defun smie-forward-sexp (&optional halfsexp) "Skip over one sexp. 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: (RIGHT-LEVEL POS TOKEN): we couldn't skip TOKEN because its left-level is too high. RIGHT-LEVEL is the right-level of TOKEN, @@ -791,7 +797,7 @@ (push (car other) found)))))) (cond ((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)))))))))) (unless (save-excursion (skip-chars-backward " \t") (bolp)) (newline)) @@ -1094,9 +1100,6 @@ ;; line, in which case we want to align it with its enclosing parent. (cond ((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))) (parent-pos-col ;FIXME: we knew this when computing smie--parent. (save-excursion @@ -1225,39 +1228,48 @@ (smie-indent-virtual)) ;:not-hanging (scan-error nil))))) -(defun smie-indent-keyword () - ;; Align closing token with the corresponding opening one. - ;; (e.g. "of" with "case", or "in" with "let"). +(defun smie-indent-keyword (&optional token) + "Indent point based on the token that follows it immediately. +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 (let* ((pos (point)) - (toklevels (smie-indent-forward-token)) - (token (pop toklevels))) + (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 - ((< pos (line-beginning-position)) - ;; The token we just read is actually not on the line where we started. - nil) + ((null (cdr toklevels)) nil) ;Not a keyword. ((not (numberp (car toklevels))) - (save-excursion - (goto-char pos) - ;; Different cases: - ;; - smie-indent--bolp: "indent according to others". - ;; - common hanging: "indent according to others". - ;; - SML-let hanging: "indent like parent". - ;; - if-after-else: "indent-like parent". - ;; - middle-of-line: "trust current position". - (cond - ((null (cdr toklevels)) nil) ;Not a keyword. - ((smie-indent--rule :before token)) - ((smie-indent--bolp) ;I.e. non-virtual indent. - ;; For an open-paren-like thingy at BOL, always indent only - ;; based on other rules (typically smie-indent-after-keyword). - nil) - (t - ;; By default use point unless we're hanging. - (unless (smie-indent--hanging-p) (current-column)))))) + ;; Different cases: + ;; - smie-indent--bolp: "indent according to others". + ;; - common hanging: "indent according to others". + ;; - SML-let hanging: "indent like parent". + ;; - if-after-else: "indent-like parent". + ;; - middle-of-line: "trust current position". + (cond + ((smie-indent--rule :before token)) + ((smie-indent--bolp) ;I.e. non-virtual indent. + ;; For an open-paren-like thingy at BOL, always indent only + ;; based on other rules (typically smie-indent-after-keyword). + nil) + (t + ;; By default use point unless we're hanging. + (unless (smie-indent--hanging-p) (current-column))))) (t ;; FIXME: This still looks too much like black magic!! - (let* ((parent (smie-backward-sexp 'halfsexp))) + (let* ((parent (smie-backward-sexp token))) ;; Different behaviors: ;; - align with parent. ;; - parent + offset.
--- a/lisp/gnus/ChangeLog Sat Nov 27 10:40:19 2010 +0200 +++ b/lisp/gnus/ChangeLog Sat Nov 27 15:04:57 2010 -0500 @@ -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> * color.el: Rename various rgb functions to srgb.
--- a/lisp/gnus/pop3.el Sat Nov 27 10:40:19 2010 +0200 +++ b/lisp/gnus/pop3.el Sat Nov 27 15:04:57 2010 -0500 @@ -327,21 +327,22 @@ ;; gnutls-cli, openssl don't accept service names (if (equal port "pop3") (setq port 110)) - (let ((process (starttls-open-stream "POP" (current-buffer) - mailhost (or port 110)))) - (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"))) - process)) + ;; Delay STLS until server greeting is read (Bug#7438). + (starttls-open-stream "POP" (current-buffer) + mailhost (or port 110))) (t (open-network-stream "POP" (current-buffer) mailhost port)))) (let ((response (pop3-read-response process t))) (setq pop3-timestamp (substring response (or (string-match "<" response) 0) (+ 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) process)))
--- a/lisp/locate.el Sat Nov 27 10:40:19 2010 +0200 +++ b/lisp/locate.el Sat Nov 27 15:04:57 2010 -0500 @@ -145,6 +145,11 @@ :type 'string :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 "The history list used by the \\[locate] command.") @@ -226,6 +231,11 @@ :group 'locate :type 'boolean) +(defcustom locate-mode-hook nil + "List of hook functions run by `locate-mode' (see `run-mode-hooks')." + :type 'hook + :group 'locate) + ;; Functions (defun locate-default-make-command-line (search-string) @@ -471,9 +481,9 @@ (make-local-variable 'directory-listing-before-filename-regexp) ;; This should support both Unix and Windoze style names (setq directory-listing-before-filename-regexp - (concat "^." + (concat "^.\\(" (make-string (1- locate-filename-indentation) ?\s) - "\\(/\\|[A-Za-z]:\\)\\|" + "\\)\\|" (default-value 'directory-listing-before-filename-regexp))) (make-local-variable 'dired-actual-switches) (setq dired-actual-switches "")
--- a/lisp/lpr.el Sat Nov 27 10:40:19 2010 +0200 +++ b/lisp/lpr.el Sat Nov 27 15:04:57 2010 -0500 @@ -152,7 +152,9 @@ "Print buffer contents without pagination or page headers. See the variables `lpr-switches' and `lpr-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)) ;;;###autoload @@ -169,7 +171,9 @@ See the variables `lpr-switches' and `lpr-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)) ;;;###autoload @@ -177,7 +181,10 @@ "Print region contents without pagination or page headers. See the variables `lpr-switches' and `lpr-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)) ;;;###autoload @@ -194,7 +201,10 @@ See the variables `lpr-switches' and `lpr-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)) (defun print-region-1 (start end switches page-headers)
--- a/lisp/mail/rmail.el Sat Nov 27 10:40:19 2010 +0200 +++ b/lisp/mail/rmail.el Sat Nov 27 15:04:57 2010 -0500 @@ -39,6 +39,7 @@ ;; (require 'mail-utils) +(require 'rfc2047) (defconst rmail-attribute-header "X-RMAIL-ATTRIBUTES" "The header that stores the Rmail attribute data.") @@ -638,7 +639,7 @@ 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 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 @@ -649,6 +650,7 @@ :type '(choice (const :tag "on" t) (const :tag "off" nil) (other :tag "when asked" ask)) + :version "23.3" :group 'rmail) (defvar rmail-enable-mime-composing nil @@ -693,13 +695,12 @@ where MSG is the message number, REGEXP is the regular 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. When starting Rmail, if `rmail-enable-mime' is non-nil, this feature is required with `require'. -The default value is `rmail-mime'. This feature is provided by -the rmail-mime package available at <http://www.m17n.org/rmail-mime/>.") +The default value is `rmailmm'") ;; FIXME this is unused. (defvar rmail-decode-mime-charset t @@ -1509,17 +1510,9 @@ (set-buffer-modified-p nil)) (replace-buffer-in-windows rmail-summary-buffer) (bury-buffer rmail-summary-buffer)) - (if rmail-enable-mime - (let ((obuf rmail-buffer) - (ovbuf rmail-view-buffer)) - (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)))) + (let ((obuf (current-buffer))) + (quit-window) + (replace-buffer-in-windows obuf))) (defun rmail-bury () "Bury current Rmail buffer and its summary buffer." @@ -2219,15 +2212,7 @@ (let ((blurb (rmail-get-labels))) (setq mode-line-process (format " %d/%d%s" - 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)))))) + rmail-current-message rmail-total-messages blurb)))) (defun rmail-get-attr-value (attr state) "Return the character value for ATTR. @@ -2706,6 +2691,11 @@ (message "Showing message %d" msg)) (narrow-to-region beg end) (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)) (narrow-to-region beg (point)) (goto-char beg) @@ -2722,11 +2712,6 @@ ;; unibyte temporary buffer where the character decoding takes ;; place. (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)) (if (null character-coding) ;; Do it directly since that is fast. @@ -2749,8 +2734,13 @@ (error "uuencoded messages are not supported yet")) (t)) (rmail-decode-region (point-min) (point-max) - coding-system view-buf))) + coding-system view-buf)))) (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 (goto-char (point-min)) (while (re-search-forward "^>+From " nil t) @@ -2766,6 +2756,10 @@ (with-current-buffer rmail-view-buffer (insert "\n") (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-activate-urls) ;(rmail-process-quoted-material)
--- a/lisp/mail/rmailmm.el Sat Nov 27 10:40:19 2010 +0200 +++ b/lisp/mail/rmailmm.el Sat Nov 27 15:04:57 2010 -0500 @@ -27,17 +27,57 @@ ;; Essentially based on the design of Alexander Pohoyda's MIME ;; 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: -;; 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). ;;; Code: (require 'rmail) (require 'mail-parse) +(require 'message) ;;; User options. @@ -91,6 +131,52 @@ ;;; 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 @@ -99,6 +185,7 @@ (let* ((filename (button-get button 'filename)) (directory (button-get button 'directory)) (data (button-get button 'data)) + (mbox-buf rmail-view-buffer) (ofilename filename)) (setq filename (expand-file-name (read-file-name (format "Save as (default: %s): " filename) @@ -117,7 +204,17 @@ ;; file, the magic signature compares equal with the unibyte ;; signature string recorded in jka-compr-compression-info-list. (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)))) (define-button-type 'rmail-mime-save 'action 'rmail-mime-save) @@ -134,6 +231,23 @@ (when (coding-system-p 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? (defun test-rmail-mime-handler () "Test of a mail using no MIME parts at all." @@ -152,10 +266,28 @@ (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) - (insert ?\n) - (insert-image (create-image data type t))) + (let ((modified (buffer-modified-p))) + (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) "Display the image associated with BUTTON." @@ -172,8 +304,19 @@ "Handle the current buffer as an attachment to download. For images that Emacs is capable of displaying, the behavior 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. - (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) (when (string-match (car entry) (car content-type)) (dolist (dir (cdr entry)) @@ -183,17 +326,21 @@ (cdr (assq 'filename (cdr content-disposition))) "noname")) (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)) - type) - (while (and (> size 1024.0) ; cribbed from gnus-agent-expire-done-message + data udata size osize type) + (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)) (setq size (/ size 1024.0) units (cdr units))) - (delete-region (point-min) (point-max)) (insert label) (insert-button filename :type 'rmail-mime-save @@ -249,6 +396,22 @@ CONTENT-DISPOSITION, and CONTENT-TRANSFER-ENCODING are the values of the respective parsed headers. See `rmail-mime-handle' for their 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 ;; with "CRLF--", as defined by RFC 2046: ;; The boundary delimiter MUST occur at the beginning of a line, @@ -257,7 +420,7 @@ ;; of the preceding part. ;; We currently don't handle that. (let ((boundary (cdr (assq 'boundary content-type))) - beg end next) + beg end next entities) (unless boundary (rmail-mm-get-boundary-error-message "No boundary defined" content-type content-disposition @@ -267,7 +430,9 @@ (goto-char (point-min)) (when (and (search-forward boundary nil t) (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 ;; the part and end points at the end of the part. next points at ;; the beginning of the next part. @@ -285,13 +450,17 @@ (rmail-mm-get-boundary-error-message "Malformed boundary" content-type content-disposition content-transfer-encoding))) - (delete-region end next) ;; Handle the part. - (save-restriction - (narrow-to-region beg end) - (rmail-mime-show)) - (goto-char (setq beg next))))) - + (if parse-only + (save-restriction + (narrow-to-region beg end) + (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 () "Test of a mail used as an example in RFC 2046." @@ -394,6 +563,9 @@ The current buffer must contain a single message. It will be modified." + (rmail-mime-process show-headers nil)) + +(defun rmail-mime-process (show-headers parse-only) (let ((end (point-min)) content-type content-transfer-encoding @@ -437,14 +609,105 @@ ;; attachment according to RFC 2183. (unless (member (car content-disposition) '("inline" "attachment")) (setq content-disposition '("attachment"))) - ;; 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)))) + + (if parse-only + (cond ((string-match "multipart/.*" (car content-type)) + (setq end (1- end)) + (save-restriction + (let ((header (if show-headers (cons (point-min) end)))) + (narrow-to-region end (point-max)) + (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" "Major mode used in `rmail-mime' buffers." @@ -480,6 +743,50 @@ (error "%s; type: %s; disposition: %s; encoding: %s" 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) ;; Local Variables:
--- a/lisp/mail/rmailsum.el Sat Nov 27 10:40:19 2010 +0200 +++ b/lisp/mail/rmailsum.el Sat Nov 27 15:04:57 2010 -0500 @@ -32,6 +32,7 @@ ;; For rmail-select-summary. (require 'rmail) +(require 'rfc2047) (defcustom rmail-summary-scroll-between-messages t "Non-nil means Rmail summary scroll commands move between messages. @@ -364,13 +365,15 @@ (aset rmail-summary-vector (1- msgnum) 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. It receives the summary line for one message as a 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 + :version "23.3" :group 'rmail-summary) (defun rmail-create-summary-line (msgnum) @@ -589,10 +592,17 @@ (t (- mch 14)))) (min len (+ lo 25))))))))) (concat (if (re-search-forward "^Subject:" nil t) - (progn (skip-chars-forward " \t") - (buffer-substring (point) - (progn (end-of-line) - (point)))) + (let (pos str) + (skip-chars-forward " \t") + (setq pos (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) (buffer-substring (point) (progn (end-of-line) (point)))) "\n")))
--- a/lisp/net/tramp.el Sat Nov 27 10:40:19 2010 +0200 +++ b/lisp/net/tramp.el Sat Nov 27 15:04:57 2010 -0500 @@ -331,9 +331,9 @@ See `tramp-methods' for a list of possibilities for METHOD." :group 'tramp - :type '(repeat (list (regexp :tag "Host regexp") - (regexp :tag "User regexp") - (string :tag "Method")))) + :type '(repeat (list (choice :tag "Host regexp" regexp sexp) + (choice :tag "User regexp" regexp sexp) + (choice :tag "Method name" string (const nil))))) (defcustom tramp-default-user nil "*Default user to use for transferring files. @@ -355,9 +355,9 @@ If the file name does not specify the method, lookup is done using the empty string for the method name." :group 'tramp - :type '(repeat (list (regexp :tag "Method regexp") - (regexp :tag "Host regexp") - (string :tag "User")))) + :type '(repeat (list (choice :tag "Method regexp" regexp sexp) + (choice :tag " Host regexp" regexp sexp) + (choice :tag " User name" string (const nil))))) (defcustom tramp-default-host (system-name) "*Default host to use for transferring files. @@ -382,7 +382,7 @@ :group 'tramp :type '(repeat (list (choice :tag "Host 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 (concat
--- a/lisp/progmodes/python.el Sat Nov 27 10:40:19 2010 +0200 +++ b/lisp/progmodes/python.el Sat Nov 27 15:04:57 2010 -0500 @@ -1462,6 +1462,16 @@ :type 'regexp :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) "`comint-input-filter' function for inferior Python. Don't save anything for STR matching `inferior-python-filter-regexp'." @@ -1559,20 +1569,24 @@ ;;;###autoload (defun run-python (&optional cmd noshow new) "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 -buffer automatically. +CMD is the Python command to run. NOSHOW non-nil means don't +show the buffer automatically. + +Interactively, a prefix arg means to prompt for the initial +Python command line (default is `python-command'). -Normally, if there is a process already running in `python-buffer', -switch to that buffer. Interactively, a prefix arg allows you to edit -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'. +A new process is started if one isn't running attached to +`python-buffer', or if called from Lisp with non-nil arg NEW. +Otherwise, if a process is already running in `python-buffer', +switch to that buffer. -Runs the hook `inferior-python-mode-hook' \(after the -`comint-mode-hook' is run). \(Type \\[describe-mode] in the process -buffer for a list of commands.)" +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 (list (read-string "Run Python: " python-command) nil t) (list python-command))) @@ -1586,13 +1600,9 @@ (when (or new (not (comint-check-proc python-buffer))) (with-current-buffer (let* ((cmdlist - (append (python-args-to-list cmd) - ;; It's easy for the user to cause the process to be - ;; started without realizing it (e.g. to perform - ;; 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('')"))) + (append (python-args-to-list cmd) '("-i") + (if python-remove-cwd-from-path + '("-c" "import sys; sys.path.remove('')")))) (path (getenv "PYTHONPATH")) (process-environment ; to import emacs.py (cons (concat "PYTHONPATH="
--- a/lisp/progmodes/which-func.el Sat Nov 27 10:40:19 2010 +0200 +++ b/lisp/progmodes/which-func.el Sat Nov 27 15:04:57 2010 -0500 @@ -154,7 +154,7 @@ :type 'sexp) ;;;###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. 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 @@ -242,6 +242,9 @@ With prefix ARG, turn Which Function mode on if arg is positive, and off otherwise." :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 ;;Turn it on (progn @@ -253,9 +256,6 @@ (or (eq which-func-modes t) (member major-mode which-func-modes)))))) ;; 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)) (with-current-buffer buf (setq which-func-mode nil)))))
--- a/lisp/vc/log-edit.el Sat Nov 27 10:40:19 2010 +0200 +++ b/lisp/vc/log-edit.el Sat Nov 27 15:04:57 2010 -0500 @@ -350,17 +350,16 @@ (defvar log-edit-font-lock-keywords ;; Copied/inspired by message-font-lock-keywords. `((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 (1 (if (assoc (match-string 2) log-edit-headers-alist) 'log-edit-header 'log-edit-unknown-header) nil lax) + ;; From `log-edit-header-contents-regexp': (3 (or (cdr (assoc (match-string 2) log-edit-headers-alist)) 'log-edit-header) - nil lax) - (4 font-lock-warning-face))))) + nil lax))))) ;;;###autoload (defun log-edit (callback &optional setup params buffer mode &rest ignore)
--- a/src/ChangeLog Sat Nov 27 10:40:19 2010 +0200 +++ b/src/ChangeLog Sat Nov 27 15:04:57 2010 -0500 @@ -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> * xdisp.c (set_message_1): Force paragraph direction in echo area
--- a/src/alloc.c Sat Nov 27 10:40:19 2010 +0200 +++ b/src/alloc.c Sat Nov 27 15:04:57 2010 -0500 @@ -5643,13 +5643,14 @@ for (t = terminal_list; t; t = t->next_terminal) { eassert (t->name != NULL); +#ifdef HAVE_WINDOW_SYSTEM + /* 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 */ if (!VECTOR_MARKED_P (t)) - { -#ifdef HAVE_WINDOW_SYSTEM - mark_image_cache (t->image_cache); -#endif /* HAVE_WINDOW_SYSTEM */ - mark_vectorlike ((struct Lisp_Vector *)t); - } + mark_vectorlike ((struct Lisp_Vector *)t); } }
--- a/src/charset.c Sat Nov 27 10:40:19 2010 +0200 +++ b/src/charset.c Sat Nov 27 15:04:57 2010 -0500 @@ -114,7 +114,7 @@ /* List of emacs-mule charsets. */ 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, CHARS, and FINAL-CHAR) to Emacs' charset. */ @@ -1210,7 +1210,7 @@ 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) emacs_mule_bytes[charset.emacs_mule_id] = charset.dimension + 1; else @@ -2330,7 +2330,7 @@ iso_charset_table[i][j][k] = -1; for (i = 0; i < 256; i++) - emacs_mule_charset[i] = NULL; + emacs_mule_charset[i] = -1; charset_jisx0201_roman = -1; charset_jisx0208_1978 = -1;
--- a/src/charset.h Sat Nov 27 10:40:19 2010 +0200 +++ b/src/charset.h Sat Nov 27 15:04:57 2010 -0500 @@ -255,7 +255,7 @@ extern Lisp_Object Viso_2022_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;
--- a/src/coding.c Sat Nov 27 10:40:19 2010 +0200 +++ b/src/coding.c Sat Nov 27 15:04:57 2010 -0500 @@ -2053,7 +2053,7 @@ const unsigned char *src_end = coding->source + coding->src_bytes; const unsigned char *src_base = src; int multibytep = coding->src_multibyte; - struct charset *charset; + int charset_id; unsigned code; int c; int consumed_chars = 0; @@ -2063,7 +2063,7 @@ if (c < 0) { c = -c; - charset = emacs_mule_charset[0]; + charset_id = emacs_mule_charset[0]; } else { @@ -2099,7 +2099,7 @@ switch (emacs_mule_bytes[c]) { case 2: - if (! (charset = emacs_mule_charset[c])) + if ((charset_id = emacs_mule_charset[c]) < 0) goto invalid_code; ONE_MORE_BYTE (c); if (c < 0xA0) @@ -2112,7 +2112,7 @@ || c == EMACS_MULE_LEADING_CODE_PRIVATE_12) { 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; ONE_MORE_BYTE (c); if (c < 0xA0) @@ -2121,7 +2121,7 @@ } else { - if (! (charset = emacs_mule_charset[c])) + if ((charset_id = emacs_mule_charset[c]) < 0) goto invalid_code; ONE_MORE_BYTE (c); if (c < 0xA0) @@ -2136,7 +2136,7 @@ case 4: 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; ONE_MORE_BYTE (c); if (c < 0xA0) @@ -2150,21 +2150,21 @@ case 1: code = c; - charset = CHARSET_FROM_ID (ASCII_BYTE_P (code) - ? charset_ascii : charset_eight_bit); + charset_id = ASCII_BYTE_P (code) ? charset_ascii : charset_eight_bit; break; default: 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) goto invalid_code; } *nbytes = src - src_base; *nchars = consumed_chars; if (id) - *id = charset->id; + *id = charset_id; return (mseq_found ? -c : c); no_more_source:
--- a/src/editfns.c Sat Nov 27 10:40:19 2010 +0200 +++ b/src/editfns.c Sat Nov 27 15:04:57 2010 -0500 @@ -218,11 +218,13 @@ } 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) { unsigned char b; CHECK_NUMBER (byte); + if (XINT (byte) < 0 || XINT (byte) > 255) + error ("Invalid byte"); b = XINT (byte); return make_string_from_bytes (&b, 1, 1); }
--- a/src/gtkutil.c Sat Nov 27 10:40:19 2010 +0200 +++ b/src/gtkutil.c Sat Nov 27 15:04:57 2010 -0500 @@ -3074,6 +3074,23 @@ 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 changed. Value is non-zero if widgets were updated. */ @@ -3095,10 +3112,20 @@ FALSE, FALSE, 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_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; return 1;
--- a/src/lread.c Sat Nov 27 10:40:19 2010 +0200 +++ b/src/lread.c Sat Nov 27 15:04:57 2010 -0500 @@ -582,7 +582,7 @@ if (len == 2) { - charset = emacs_mule_charset[buf[0]]; + charset = CHARSET_FROM_ID (emacs_mule_charset[buf[0]]); code = buf[1] & 0x7F; } else if (len == 3) @@ -590,18 +590,18 @@ if (buf[0] == EMACS_MULE_LEADING_CODE_PRIVATE_11 || 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; } else { - charset = emacs_mule_charset[buf[0]]; + charset = CHARSET_FROM_ID (emacs_mule_charset[buf[0]]); code = ((buf[1] << 8) | buf[2]) & 0x7F7F; } } else { - charset = emacs_mule_charset[buf[1]]; + charset = CHARSET_FROM_ID (emacs_mule_charset[buf[1]]); code = ((buf[2] << 8) | buf[3]) & 0x7F7F; } c = DECODE_CHAR (charset, code);