Now on revision 111648.

revno: 111648
author: Alex Harsanyi
committer: Michael Albinus .
diff:
=== modified file 'lisp/ChangeLog'
 lisp/ChangeLog 20130201 03:58:50 +0000
+++ lisp/ChangeLog 20130201 07:28:10 +0000
@@ 1,3 +1,9 @@
+20130201 Alex Harsanyi
+
+ * net/soapclient.el (soapinvoke): Encode the string for
+ `urlrequestdata' as UTF8. Fixes
+ .
+
20130201 Glenn Morris
* calc/calchelp.el (calcviewnews): Use viewemacsnews.
=== modified file 'lisp/net/soapclient.el'
 lisp/net/soapclient.el 20130101 09:11:05 +0000
+++ lisp/net/soapclient.el 20130201 07:28:10 +0000
@@ 1768,7 +1768,11 @@
(urlpackagename "soapclient.el")
(urlpackageversion "1.0")
(urlhttpversion "1.0")
 (urlrequestdata (soapcreateenvelope operation parameters wsdl))
+ (urlrequestdata
+ ;; urlrequestdata expects a unibyte string already encoded...
+ (encodecodingstring
+ (soapcreateenvelope operation parameters wsdl)
+ 'utf8))
(urlmimecharsetstring "utf8;q=1, iso88591;q=0.5")
(urlrequestcodingsystem 'utf8)
(urlhttpattemptkeepalives t)

revno: 111647
committer: Dmitry Antipov
branch nick: trunk
timestamp: Fri 20130201 11:23:18 +0400
message:
* window.h (struct window): Convert base_line_number, base_line_pos
and column_number_displayed members from Lisp_Object to ptrdiff_t.
Convert region_showing member from Lisp_Object to bitfield.
Remove sequence_number member. Adjust comments.
* window.c (sequence_number): Remove.
(make_window): Initialize column_number_displayed.
* print.c (print_object): Follow the printed representation of
frames and print window pointer to distinguish between windows.
(adjust_window_count): Invalidate base_line_pos. Adjust comment.
* xdisp.c (wset_base_line_number, wset_base_line_pos)
(wset_column_number_displayed, wset_region_showing): Remove.
(window_buffer_changed, mode_line_update_needed, redisplay_internal)
(try_scrolling, try_cursor_movement, redisplay_window)
(try_window_reusing_current_matrix, try_window_id, display_line)
(display_mode_lines, decode_mode_spec): Adjust users.
* .gdbinit (pwinx): Do not print sequence_number.
diff:
=== modified file 'src/.gdbinit'
 src/.gdbinit 20130102 16:13:04 +0000
+++ src/.gdbinit 20130201 07:23:18 +0000
@@ 358,7 +358,6 @@
define pwinx
set $w = $arg0
 xgetint $w>sequence_number
if ($w>mini_p != Qnil)
printf "Mini "
end
=== modified file 'src/ChangeLog'
 src/ChangeLog 20130201 06:30:51 +0000
+++ src/ChangeLog 20130201 07:23:18 +0000
@@ 1,3 +1,22 @@
+20130201 Dmitry Antipov
+
+ * window.h (struct window): Convert base_line_number, base_line_pos
+ and column_number_displayed members from Lisp_Object to ptrdiff_t.
+ Convert region_showing member from Lisp_Object to bitfield.
+ Remove sequence_number member. Adjust comments.
+ * window.c (sequence_number): Remove.
+ (make_window): Initialize column_number_displayed.
+ * print.c (print_object): Follow the printed representation of
+ frames and print window pointer to distinguish between windows.
+ (adjust_window_count): Invalidate base_line_pos. Adjust comment.
+ * xdisp.c (wset_base_line_number, wset_base_line_pos)
+ (wset_column_number_displayed, wset_region_showing): Remove.
+ (window_buffer_changed, mode_line_update_needed, redisplay_internal)
+ (try_scrolling, try_cursor_movement, redisplay_window)
+ (try_window_reusing_current_matrix, try_window_id, display_line)
+ (display_mode_lines, decode_mode_spec): Adjust users.
+ * .gdbinit (pwinx): Do not print sequence_number.
+
20130201 Paul Eggert
Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
=== modified file 'src/print.c'
 src/print.c 20130114 17:46:14 +0000
+++ src/print.c 20130201 07:23:18 +0000
@@ 1766,7 +1766,7 @@
{
int len;
strout ("#sequence_number);
+ len = sprintf (buf, "%p", XWINDOW (obj));
strout (buf, len, len, printcharfun);
if (!NILP (XWINDOW (obj)>buffer))
{
=== modified file 'src/window.c'
 src/window.c 20130124 05:41:28 +0000
+++ src/window.c 20130201 07:23:18 +0000
@@ 116,9 +116,6 @@
/* Hook run at end of temp_output_buffer_show. */
static Lisp_Object Qtemp_buffer_show_hook;
/* Incremented for each window created. */
static int sequence_number;

/* Nonzero after init_window_once has finished. */
static int window_initialized;
@@ 286,8 +283,9 @@
b = b>base_buffer;
b>window_count += arg;
eassert (b>window_count >= 0);
 /* Catch redisplay's attention. */
+ /* These should be recalculated by redisplay code. */
w>window_end_valid = 0;
+ w>base_line_pos = 0;
}
}
@@ 3429,8 +3427,6 @@
adjust_window_count (p, 1);
XSETWINDOW (parent, p);
 p>sequence_number = ++sequence_number;

replace_window (window, parent, 1);
wset_next (o, Qnil);
@@ 3479,7 +3475,7 @@
w>nrows_scale_factor = w>ncols_scale_factor = 1;
w>phys_cursor_type = 1;
w>phys_cursor_width = 1;
 w>sequence_number = ++sequence_number;
+ w>column_number_displayed = 1;
/* Reset window_list. */
Vwindow_list = Qnil;
=== modified file 'src/window.h'
 src/window.h 20130122 11:48:00 +0000
+++ src/window.h 20130201 07:23:18 +0000
@@ 192,23 +192,6 @@
and Qt, so bitfield can't be used here. */
Lisp_Object dedicated;
 /* Line number and position of a line somewhere above the top of the
 screen. If this field is nil, it means we don't have a base
 line. */
 Lisp_Object base_line_number;
 /* If this field is nil, it means we don't have a base line.
 If it is a buffer, it means don't display the line number
 as long as the window shows that buffer. */
 Lisp_Object base_line_pos;

 /* If we have highlighted the region (or any part of it),
 this is the mark position that we used, as an integer. */
 Lisp_Object region_showing;

 /* The column number currently displayed in this window's mode line,
 or nil if column numbers are not being displayed. */
 Lisp_Object column_number_displayed;

/* If redisplay in this window goes beyond this buffer position,
must run the redisplayendtriggerhook. */
Lisp_Object redisplay_end_trigger;
@@ 238,9 +221,6 @@
/* Number saying how recently window was selected. */
int use_time;
 /* Unique number of window assigned when it was created. */
 int sequence_number;

/* Number of columns display within the window is scrolled to the left. */
ptrdiff_t hscroll;
@@ 260,6 +240,19 @@
it should be positive. */
ptrdiff_t last_point;
+ /* Line number and position of a line somewhere above the top of the
+ screen. If this field is zero, it means we don't have a base line. */
+ ptrdiff_t base_line_number;
+
+ /* If this field is zero, it means we don't have a base line.
+ If it is 1, it means don't display the line number as long
+ as the window shows its buffer. */
+ ptrdiff_t base_line_pos;
+
+ /* The column number currently displayed in this window's mode
+ line, or 1 if column numbers are not being displayed. */
+ ptrdiff_t column_number_displayed;
+
/* Scaling factor for the glyph_matrix size calculation in this window.
Used if window contains many small images or uses proportional fonts,
as the normal may yield a matrix which is too small. */
@@ 340,6 +333,9 @@
the frame image that window_end_pos did not get onto the frame. */
unsigned window_end_valid : 1;
+ /* Nonzero if we have highlighted the region (or any part of it). */
+ unsigned region_showing : 1;
+
/* Amount by which lines of this window are scrolled in
ydirection (smooth scrolling). */
int vscroll;
=== modified file 'src/xdisp.c'
 src/xdisp.c 20130125 17:13:31 +0000
+++ src/xdisp.c 20130201 07:23:18 +0000
@@ 367,28 +367,6 @@
static Lisp_Object Qmargin, Qpointer;
static Lisp_Object Qline_height;
/* These setters are used only in this file, so they can be private. */
static void
wset_base_line_number (struct window *w, Lisp_Object val)
{
 w>base_line_number = val;
}
static void
wset_base_line_pos (struct window *w, Lisp_Object val)
{
 w>base_line_pos = val;
}
static void
wset_column_number_displayed (struct window *w, Lisp_Object val)
{
 w>column_number_displayed = val;
}
static void
wset_region_showing (struct window *w, Lisp_Object val)
{
 w>region_showing = val;
}

#ifdef HAVE_WINDOW_SYSTEM
/* Test if overflow newline into fringe. Called with iterator IT
@@ 10775,7 +10753,7 @@
return (((BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)) != w>last_had_star)
 ((!NILP (Vtransient_mark_mode) && !NILP (BVAR (b, mark_active)))
 != !NILP (w>region_showing)));
+ != w>region_showing));
}
/* Nonzero if W has %c in its mode line and mode line should be updated. */
@@ 10783,9 +10761,9 @@
static int
mode_line_update_needed (struct window *w)
{
 return (!NILP (w>column_number_displayed)
+ return (w>column_number_displayed != 1
&& !(PT == w>last_point && !window_outdated (w))
 && (XFASTINT (w>column_number_displayed) != current_column ()));
+ && (w>column_number_displayed != current_column ()));
}
/***********************************************************************
@@ 13038,18 +13016,6 @@
clear_garbaged_frames ();
}

 /* If showing the region, and mark has changed, we must redisplay
 the whole window. The assignment to this_line_start_pos prevents
 the optimization directly below this ifstatement. */
 if (((!NILP (Vtransient_mark_mode)
 && !NILP (BVAR (XBUFFER (w>buffer), mark_active)))
 != !NILP (w>region_showing))
  (!NILP (w>region_showing)
 && !EQ (w>region_showing,
 Fmarker_position (BVAR (XBUFFER (w>buffer), mark)))))
 CHARPOS (this_line_start_pos) = 0;

/* Optimize the case that only the line containing the cursor in the
selected window has changed. Variables starting with this_ are
set in display_line and record information about the line
@@ 13213,7 +13179,7 @@
&& (EQ (selected_window,
BVAR (current_buffer, last_selected_window))
 highlight_nonselected_windows)
 && NILP (w>region_showing)
+ && !w>region_showing
&& NILP (Vshow_trailing_whitespace)
&& !cursor_in_echo_area)
{
@@ 14710,7 +14676,7 @@
if (!just_this_one_p
 current_buffer>clip_changed
 BEG_UNCHANGED < CHARPOS (startp))
 wset_base_line_number (w, Qnil);
+ w>base_line_number = 0;
/* If cursor ends up on a partially visible line,
treat that as being off the bottom of the screen. */
@@ 14859,7 +14825,7 @@
region exists, cursor movement has to do more than just
set the cursor. */
&& markpos_of_region () < 0
 && NILP (w>region_showing)
+ && !w>region_showing
&& NILP (Vshow_trailing_whitespace)
/* This code is not used for minibuffer for the sake of the case
of redisplaying to replace an echo area message; since in
@@ 15425,7 +15391,7 @@
/* Forget any recorded base line for line number display. */
if (!buffer_unchanged_p)
 wset_base_line_number (w, Qnil);
+ w>base_line_number = 0;
/* Redisplay the mode line. Select the buffer properly for that.
Also, run the hook windowscrollfunctions
@@ 15665,7 +15631,7 @@
 current_buffer>clip_changed
 BEG_UNCHANGED < CHARPOS (startp))
/* Forget any recorded base line for line number display. */
 wset_base_line_number (w, Qnil);
+ w>base_line_number = 0;
if (!cursor_row_fully_visible_p (w, 1, 0))
{
@@ 15732,11 +15698,9 @@
debug_method_add (w, "recenter");
#endif
 /* w>vscroll = 0; */

/* Forget any previously recorded base line for line number display. */
if (!buffer_unchanged_p)
 wset_base_line_number (w, Qnil);
+ w>base_line_number = 0;
/* Determine the window start relative to point. */
init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID);
@@ 15956,10 +15920,10 @@
&& !FRAME_WINDOW_P (f)
&& !WINDOW_FULL_WIDTH_P (w))
/* Line number to display. */
  INTEGERP (w>base_line_pos)
+  w>base_line_pos > 0
/* Column number is displayed and different from the one displayed. */
  (!NILP (w>column_number_displayed)
 && (XFASTINT (w>column_number_displayed) != current_column ())))
+  (w>column_number_displayed != 1
+ && (w>column_number_displayed != current_column ())))
/* This means that the window has a mode line. */
&& (WINDOW_WANTS_MODELINE_P (w)
 WINDOW_WANTS_HEADER_LINE_P (w)))
@@ 15990,11 +15954,10 @@
goto need_larger_matrices;
}
 if (!line_number_displayed
 && !BUFFERP (w>base_line_pos))
+ if (!line_number_displayed && w>base_line_pos != 1)
{
 wset_base_line_pos (w, Qnil);
 wset_base_line_number (w, Qnil);
+ w>base_line_pos = 0;
+ w>base_line_number = 0;
}
finish_menu_bars:
@@ 16231,7 +16194,7 @@
/* Can't do this if region may have changed. */
if (0 <= markpos_of_region ()
  !NILP (w>region_showing)
+  w>region_showing
 !NILP (Vshow_trailing_whitespace))
return 0;
@@ 17070,7 +17033,7 @@
GIVE_UP (11);
/* Likewise if showing a region. */
 if (!NILP (w>region_showing))
+ if (w>region_showing)
GIVE_UP (10);
/* Can't use this if overlay arrow position and/or string have
@@ 19157,7 +19120,7 @@
}
/* Is IT>w showing the region? */
 wset_region_showing (it>w, it>region_beg_charpos > 0 ? Qt : Qnil);
+ it>w>region_showing = it>region_beg_charpos > 0;
/* Clear the result glyph row and enable it. */
prepare_desired_row (row);
@@ 20161,7 +20124,7 @@
/* These will be set while the mode line specs are processed. */
line_number_displayed = 0;
 wset_column_number_displayed (w, Qnil);
+ w>column_number_displayed = 1;
if (WINDOW_WANTS_MODELINE_P (w))
{
@@ 21184,8 +21147,7 @@
returned with spaces to that value. Return a Lisp string in
*STRING if the resulting string is taken from that Lisp string.
 Note we operate on the current buffer for most purposes,
 the exception being w>base_line_pos. */
+ Note we operate on the current buffer for most purposes. */
static char lots_of_dashes[] = "";
@@ 21296,7 +21258,7 @@
else
{
ptrdiff_t col = current_column ();
 wset_column_number_displayed (w, make_number (col));
+ w>column_number_displayed = col;
pint2str (decode_mode_spec_buf, width, col);
return decode_mode_spec_buf;
}
@@ 21355,27 +21317,24 @@
/* If we decided that this buffer isn't suitable for line numbers,
don't forget that too fast. */
 if (EQ (w>base_line_pos, w>buffer))
+ if (w>base_line_pos == 1)
goto no_value;
 /* But do forget it, if the window shows a different buffer now. */
 else if (BUFFERP (w>base_line_pos))
 wset_base_line_pos (w, Qnil);
/* If the buffer is very big, don't waste time. */
if (INTEGERP (Vline_number_display_limit)
&& BUF_ZV (b)  BUF_BEGV (b) > XINT (Vline_number_display_limit))
{
 wset_base_line_pos (w, Qnil);
 wset_base_line_number (w, Qnil);
+ w>base_line_pos = 0;
+ w>base_line_number = 0;
goto no_value;
}
 if (INTEGERP (w>base_line_number)
 && INTEGERP (w>base_line_pos)
 && XFASTINT (w>base_line_pos) <= startpos)
+ if (w>base_line_number > 0
+ && w>base_line_pos > 0
+ && w>base_line_pos <= startpos)
{
 line = XFASTINT (w>base_line_number);
 linepos = XFASTINT (w>base_line_pos);
+ line = w>base_line_number;
+ linepos = w>base_line_pos;
linepos_byte = buf_charpos_to_bytepos (b, linepos);
}
else
@@ 21398,8 +21357,8 @@
go back past it. */
if (startpos == BUF_BEGV (b))
{
 wset_base_line_number (w, make_number (topline));
 wset_base_line_pos (w, make_number (BUF_BEGV (b)));
+ w>base_line_number = topline;
+ w>base_line_pos = BUF_BEGV (b);
}
else if (nlines < height + 25  nlines > height * 3 + 50
 linepos == BUF_BEGV (b))
@@ 21425,13 +21384,13 @@
give up on line numbers for this window. */
if (position == limit_byte && limit == startpos  distance)
{
 wset_base_line_pos (w, w>buffer);
 wset_base_line_number (w, Qnil);
+ w>base_line_pos = 1;
+ w>base_line_number = 0;
goto no_value;
}
 wset_base_line_number (w, make_number (topline  nlines));
 wset_base_line_pos (w, make_number (BYTE_TO_CHAR (position)));
+ w>base_line_number = topline  nlines;
+ w>base_line_pos = BYTE_TO_CHAR (position);
}
/* Now count lines from the start pos to point. */

revno: 111646
fixes bug: http://debbugs.gnu.org/13539
committer: Paul Eggert
branch nick: trunk
timestamp: Thu 20130131 22:30:51 0800
message:
Use fdopendir, fstatat and readlinkat, for efficiency.
On my host, this speeds up directoryfilesandattributes by a
factor of 3, when applied to Emacs's src directory.
These functions are standardized by POSIX and are common these
days; fall back on a (slower) gnulib implementation if the host
is too old to supply them.
* .bzrignore: Add lib/dirent.h.
* lib/Makefile.am (libgnu_a_SOURCES): Add openatdie.c, savecwd.c.
* lib/careadlinkat.c, lib/careadlinkat.h: Merge from gnulib,
incorporating: 20130129 careadlinkat: do not provide careadlinkatcwd.
* lib/gnulib.mk, m4/gnulibcomp.m4: Regenerate.
* lib/dirent.in.h, lib/fdopendir.c, lib/fstatat.c, lib/openatpriv.h:
* lib/openatproc.c, lib/openat.h, m4/dirent_h.m4, m4/fdopendir.m4:
* m4/fstatat.m4: New files, from gnulib.
* lib/openatdie.c, lib/savecwd.c, lib/savecwd.h: New files.
These last three are specific to Emacs and are not copied from gnulib.
They are simpler than the gnulib versions and are tuned for Emacs.
* admin/mergegnulib (GNULIB_MODULES): Add fdopendir, fstatat, readlinkat.
(GNULIB_TOOL_FLAGS): Do not avoid atinternal, openath.
Avoid dup, open, opendir.
* nt/inc/sys/stat.h (fstatat):
* nt/inc/unistd.h (readlinkat): New decls.
* src/conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
* src/dired.c: Include .
(open_directory): New function, which uses open and fdopendir
rather than opendir. DOS_NT platforms still use opendir, though.
(directory_files_internal, file_name_completion): Use it.
(file_attributes): New function, with most of the old Ffile_attributes.
(directory_files_internal, Ffile_attributes): Use it.
(file_attributes, file_name_completion_stat): First arg is now fd,
not dir name. All uses changed. Use fstatat rather than lstat +
stat.
(file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
* src/fileio.c: Include , .
(emacs_readlinkat): New function, with much of the old
Ffile_symlink_p, but with an fd argument for speed.
It uses readlinkat rather than careadlinkatcwd, so that it
need not assume the working directory.
(Ffile_symlink_p): Use it.
* src/filelock.c (current_lock_owner): Use emacs_readlinkat
rather than emacs_readlink.
* src/lisp.h (emacs_readlinkat): New decl.
(READLINK_BUFSIZE, emacs_readlink): Remove.
* src/sysdep.c: Do not include , .
(emacs_norealloc_allocator, emacs_readlink): Remove.
This stuff is moved to fileio.c.
* src/w32.c (fstatat, readlinkat): New functions.
(careadlinkat): Don't check that fd == AT_FDCWD.
(careadlinkatcwd): Remove; no longer needed.
diff:
=== modified file '.bzrignore'
 .bzrignore 20130123 23:49:46 +0000
+++ .bzrignore 20130201 06:30:51 +0000
@@ 87,6 +87,7 @@
lib/alloca.h
lib/argnonnull.h
lib/c++defs.h
+lib/dirent.h
lib/execinfo.h
lib/fcntl.h
lib/getopt.h
=== modified file 'ChangeLog'
 ChangeLog 20130201 03:58:50 +0000
+++ ChangeLog 20130201 06:30:51 +0000
@@ 1,3 +1,23 @@
+20130201 Paul Eggert
+
+ Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
+ On my host, this speeds up directoryfilesandattributes by a
+ factor of 3, when applied to Emacs's src directory.
+ These functions are standardized by POSIX and are common these
+ days; fall back on a (slower) gnulib implementation if the host
+ is too old to supply them.
+ * .bzrignore: Add lib/dirent.h.
+ * lib/Makefile.am (libgnu_a_SOURCES): Add openatdie.c, savecwd.c.
+ * lib/careadlinkat.c, lib/careadlinkat.h: Merge from gnulib,
+ incorporating: 20130129 careadlinkat: do not provide careadlinkatcwd.
+ * lib/gnulib.mk, m4/gnulibcomp.m4: Regenerate.
+ * lib/dirent.in.h, lib/fdopendir.c, lib/fstatat.c, lib/openatpriv.h:
+ * lib/openatproc.c, lib/openat.h, m4/dirent_h.m4, m4/fdopendir.m4:
+ * m4/fstatat.m4: New files, from gnulib.
+ * lib/openatdie.c, lib/savecwd.c, lib/savecwd.h: New files.
+ These last three are specific to Emacs and are not copied from gnulib.
+ They are simpler than the gnulib versions and are tuned for Emacs.
+
20130201 Glenn Morris
* makedist: Only README files exist in lisp/ now, not README*.
=== modified file 'admin/ChangeLog'
 admin/ChangeLog 20130115 09:22:25 +0000
+++ admin/ChangeLog 20130201 06:30:51 +0000
@@ 1,3 +1,10 @@
+20130201 Paul Eggert
+
+ Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
+ * mergegnulib (GNULIB_MODULES): Add fdopendir, fstatat, readlinkat.
+ (GNULIB_TOOL_FLAGS): Do not avoid atinternal, openath.
+ Avoid dup, open, opendir.
+
20130115 Dmitry Antipov
* coccinelle/xsave.cocci: Semantic patch to adjust users of
=== modified file 'admin/mergegnulib'
 admin/mergegnulib 20130102 16:13:04 +0000
+++ admin/mergegnulib 20130201 06:30:51 +0000
@@ 29,9 +29,9 @@
allocaopt cctype cstrcase
careadlinkat closestream crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512
dtoastr dtotimespec dup2 environ execinfo faccessat
 fcntlh filemode getloadavg getoptgnu gettime gettimeofday
+ fcntlh fdopendir filemode fstatat getloadavg getoptgnu gettime gettimeofday
ignorevalue intprops largefile lstat
 manywarnings mktime pselect pthread_sigmask putenv readlink
+ manywarnings mktime pselect pthread_sigmask putenv readlink readlinkat
sig2str socklen stattime stdalign stdarg stdbool stdio
strftime strtoimax strtoumax symlink sys_stat
sys_time time timertime timespecadd timespecsub unsetenv utimens
@@ 39,10 +39,10 @@
'
GNULIB_TOOL_FLAGS='
 avoid=atinternal
+ avoid=dup
avoid=errno avoid=fchdir avoid=fcntl avoid=fstat
avoid=mallocposix avoid=msvcinval avoid=msvcnothrow
 avoid=openatdie avoid=openath
+ avoid=open avoid=openatdie avoid=opendir
avoid=raise
avoid=savecwd avoid=select avoid=sigprocmask avoid=sys_types
avoid=threadlib
=== modified file 'lib/Makefile.am'
 lib/Makefile.am 20120802 10:39:47 +0000
+++ lib/Makefile.am 20130201 06:30:51 +0000
@@ 8,3 +8,5 @@
DEFAULT_INCLUDES = I. I$(top_srcdir)/lib I../src I$(top_srcdir)/src
include gnulib.mk
+
+libgnu_a_SOURCES += openatdie.c savecwd.c
=== modified file 'lib/careadlinkat.c'
 lib/careadlinkat.c 20130101 09:11:05 +0000
+++ lib/careadlinkat.c 20130201 06:30:51 +0000
@@ 24,9 +24,7 @@
#include
#include
#include
#include
#include
/* Define this independently so that stdint.h is not a prerequisite. */
#ifndef SIZE_MAX
@@ 39,20 +37,6 @@
#include "allocator.h"
/* Get the symbolic link value of FILENAME and put it into BUFFER, with
 size BUFFER_SIZE. This function acts like readlink but has
 readlinkat's signature. */
ssize_t
careadlinkatcwd (int fd, char const *filename, char *buffer,
 size_t buffer_size)
{
 /* FD must be AT_FDCWD here, otherwise the caller is using this
 function in contexts for which it was not meant for. */
 if (fd != AT_FDCWD)
 abort ();
 return readlink (filename, buffer, buffer_size);
}

/* Assuming the current directory is FD, get the symbolic link value
of FILENAME as a nullterminated string and put it into a buffer.
If FD is AT_FDCWD, FILENAME is interpreted relative to the current
=== modified file 'lib/careadlinkat.h'
 lib/careadlinkat.h 20130101 09:11:05 +0000
+++ lib/careadlinkat.h 20130201 06:30:51 +0000
@@ 52,9 +52,9 @@
ssize_t (*preadlinkat) (int, char const *,
char *, size_t));
/* Suitable values for careadlinkat's FD and PREADLINKAT arguments,
+/* Suitable value for careadlinkat's FD argument,
when doing a plain readlink:
 Pass FD = AT_FDCWD and PREADLINKAT = careadlinkatcwd. */
+ Pass FD = AT_FDCWD. */
#if HAVE_READLINKAT
/* AT_FDCWD is declared in . */
#else
@@ 66,7 +66,5 @@
# define AT_FDCWD (3041965)
# endif
#endif
ssize_t careadlinkatcwd (int fd, char const *filename,
 char *buffer, size_t buffer_size);
#endif /* _GL_CAREADLINKAT_H */
=== added file 'lib/dirent.in.h'
 lib/dirent.in.h 19700101 00:00:00 +0000
+++ lib/dirent.in.h 20130201 06:30:51 +0000
@@ 0,0 +1,258 @@
+/* A GNUlike .
+ Copyright (C) 20062013 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see . */
+
+#ifndef _@GUARD_PREFIX@_DIRENT_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* The include_next requires a split doubleinclusion guard. */
+#if @HAVE_DIRENT_H@
+# @INCLUDE_NEXT@ @NEXT_DIRENT_H@
+#endif
+
+#ifndef _@GUARD_PREFIX@_DIRENT_H
+#define _@GUARD_PREFIX@_DIRENT_H
+
+/* Get ino_t. Needed on some systems, including glibc 2.8. */
+#include
+
+#if !@HAVE_DIRENT_H@
+/* Define types DIR and 'struct dirent'. */
+# if !GNULIB_defined_struct_dirent
+struct dirent
+{
+ char d_type;
+ char d_name[1];
+};
+/* Possible values for 'd_type'. */
+# define DT_UNKNOWN 0
+# define DT_FIFO 1 /* FIFO */
+# define DT_CHR 2 /* character device */
+# define DT_DIR 4 /* directory */
+# define DT_BLK 6 /* block device */
+# define DT_REG 8 /* regular file */
+# define DT_LNK 10 /* symbolic link */
+# define DT_SOCK 12 /* socket */
+# define DT_WHT 14 /* whiteout */
+typedef struct gl_directory DIR;
+# define GNULIB_defined_struct_dirent 1
+# endif
+#endif
+
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+ The attribute __pure__ was added in gcc 2.96. */
+#if __GNUC__ > 2  (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE /* empty */
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+
+/* Declare overridden functions. */
+
+#if @GNULIB_OPENDIR@
+# if @REPLACE_OPENDIR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef opendir
+# define opendir rpl_opendir
+# endif
+_GL_FUNCDECL_RPL (opendir, DIR *, (const char *dir_name) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (opendir, DIR *, (const char *dir_name));
+# else
+# if !@HAVE_OPENDIR@
+_GL_FUNCDECL_SYS (opendir, DIR *, (const char *dir_name) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (opendir, DIR *, (const char *dir_name));
+# endif
+_GL_CXXALIASWARN (opendir);
+#elif defined GNULIB_POSIXCHECK
+# undef opendir
+# if HAVE_RAW_DECL_OPENDIR
+_GL_WARN_ON_USE (opendir, "opendir is not portable  "
+ "use gnulib module opendir for portability");
+# endif
+#endif
+
+#if @GNULIB_READDIR@
+# if !@HAVE_READDIR@
+_GL_FUNCDECL_SYS (readdir, struct dirent *, (DIR *dirp) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (readdir, struct dirent *, (DIR *dirp));
+_GL_CXXALIASWARN (readdir);
+#elif defined GNULIB_POSIXCHECK
+# undef readdir
+# if HAVE_RAW_DECL_READDIR
+_GL_WARN_ON_USE (readdir, "readdir is not portable  "
+ "use gnulib module readdir for portability");
+# endif
+#endif
+
+#if @GNULIB_REWINDDIR@
+# if !@HAVE_REWINDDIR@
+_GL_FUNCDECL_SYS (rewinddir, void, (DIR *dirp) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (rewinddir, void, (DIR *dirp));
+_GL_CXXALIASWARN (rewinddir);
+#elif defined GNULIB_POSIXCHECK
+# undef rewinddir
+# if HAVE_RAW_DECL_REWINDDIR
+_GL_WARN_ON_USE (rewinddir, "rewinddir is not portable  "
+ "use gnulib module rewinddir for portability");
+# endif
+#endif
+
+#if @GNULIB_CLOSEDIR@
+# if @REPLACE_CLOSEDIR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef closedir
+# define closedir rpl_closedir
+# endif
+_GL_FUNCDECL_RPL (closedir, int, (DIR *dirp) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (closedir, int, (DIR *dirp));
+# else
+# if !@HAVE_CLOSEDIR@
+_GL_FUNCDECL_SYS (closedir, int, (DIR *dirp) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (closedir, int, (DIR *dirp));
+# endif
+_GL_CXXALIASWARN (closedir);
+#elif defined GNULIB_POSIXCHECK
+# undef closedir
+# if HAVE_RAW_DECL_CLOSEDIR
+_GL_WARN_ON_USE (closedir, "closedir is not portable  "
+ "use gnulib module closedir for portability");
+# endif
+#endif
+
+#if @GNULIB_DIRFD@
+/* Return the file descriptor associated with the given directory stream,
+ or 1 if none exists. */
+# if @REPLACE_DIRFD@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef dirfd
+# define dirfd rpl_dirfd
+# endif
+_GL_FUNCDECL_RPL (dirfd, int, (DIR *) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (dirfd, int, (DIR *));
+# else
+# if defined __cplusplus && defined GNULIB_NAMESPACE && defined dirfd
+ /* dirfd is defined as a macro and not as a function.
+ Turn it into a function and get rid of the macro. */
+static inline int (dirfd) (DIR *dp) { return dirfd (dp); }
+# undef dirfd
+# endif
+# if !(@HAVE_DECL_DIRFD@  defined dirfd)
+_GL_FUNCDECL_SYS (dirfd, int, (DIR *) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (dirfd, int, (DIR *));
+# endif
+_GL_CXXALIASWARN (dirfd);
+#elif defined GNULIB_POSIXCHECK
+# undef dirfd
+# if HAVE_RAW_DECL_DIRFD
+_GL_WARN_ON_USE (dirfd, "dirfd is unportable  "
+ "use gnulib module dirfd for portability");
+# endif
+#endif
+
+#if @GNULIB_FDOPENDIR@
+/* Open a directory stream visiting the given directory file
+ descriptor. Return NULL and set errno if fd is not visiting a
+ directory. On success, this function consumes fd (it will be
+ implicitly closed either by this function or by a subsequent
+ closedir). */
+# if @REPLACE_FDOPENDIR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fdopendir
+# define fdopendir rpl_fdopendir
+# endif
+_GL_FUNCDECL_RPL (fdopendir, DIR *, (int fd));
+_GL_CXXALIAS_RPL (fdopendir, DIR *, (int fd));
+# else
+# if !@HAVE_FDOPENDIR@  !@HAVE_DECL_FDOPENDIR@
+_GL_FUNCDECL_SYS (fdopendir, DIR *, (int fd));
+# endif
+_GL_CXXALIAS_SYS (fdopendir, DIR *, (int fd));
+# endif
+_GL_CXXALIASWARN (fdopendir);
+#elif defined GNULIB_POSIXCHECK
+# undef fdopendir
+# if HAVE_RAW_DECL_FDOPENDIR
+_GL_WARN_ON_USE (fdopendir, "fdopendir is unportable  "
+ "use gnulib module fdopendir for portability");
+# endif
+#endif
+
+#if @GNULIB_SCANDIR@
+/* Scan the directory DIR, calling FILTER on each directory entry.
+ Entries for which FILTER returns nonzero are individually malloc'd,
+ sorted using qsort with CMP, and collected in a malloc'd array in
+ *NAMELIST. Returns the number of entries selected, or 1 on error. */
+# if !@HAVE_SCANDIR@
+_GL_FUNCDECL_SYS (scandir, int,
+ (const char *dir, struct dirent ***namelist,
+ int (*filter) (const struct dirent *),
+ int (*cmp) (const struct dirent **, const struct dirent **))
+ _GL_ARG_NONNULL ((1, 2, 4)));
+# endif
+/* Need to cast, because on glibc systems, the fourth parameter is
+ int (*cmp) (const void *, const void *). */
+_GL_CXXALIAS_SYS_CAST (scandir, int,
+ (const char *dir, struct dirent ***namelist,
+ int (*filter) (const struct dirent *),
+ int (*cmp) (const struct dirent **, const struct dirent **)));
+_GL_CXXALIASWARN (scandir);
+#elif defined GNULIB_POSIXCHECK
+# undef scandir
+# if HAVE_RAW_DECL_SCANDIR
+_GL_WARN_ON_USE (scandir, "scandir is unportable  "
+ "use gnulib module scandir for portability");
+# endif
+#endif
+
+#if @GNULIB_ALPHASORT@
+/* Compare two 'struct dirent' entries alphabetically. */
+# if !@HAVE_ALPHASORT@
+_GL_FUNCDECL_SYS (alphasort, int,
+ (const struct dirent **, const struct dirent **)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+/* Need to cast, because on glibc systems, the parameters are
+ (const void *, const void *). */
+_GL_CXXALIAS_SYS_CAST (alphasort, int,
+ (const struct dirent **, const struct dirent **));
+_GL_CXXALIASWARN (alphasort);
+#elif defined GNULIB_POSIXCHECK
+# undef alphasort
+# if HAVE_RAW_DECL_ALPHASORT
+_GL_WARN_ON_USE (alphasort, "alphasort is unportable  "
+ "use gnulib module alphasort for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_DIRENT_H */
+#endif /* _@GUARD_PREFIX@_DIRENT_H */
=== added file 'lib/fdopendir.c'
 lib/fdopendir.c 19700101 00:00:00 +0000
+++ lib/fdopendir.c 20130201 06:30:51 +0000
@@ 0,0 +1,204 @@
+/* provide a replacement fdopendir function
+ Copyright (C) 20042013 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see . */
+
+/* written by Jim Meyering */
+
+#include
+
+#include
+
+#include
+#include
+
+#if !HAVE_FDOPENDIR
+
+# include "openat.h"
+# include "openatpriv.h"
+# include "savecwd.h"
+
+# if GNULIB_DIRENT_SAFER
+# include "dirent.h"
+# endif
+
+# ifndef REPLACE_FCHDIR
+# define REPLACE_FCHDIR 0
+# endif
+
+static DIR *fdopendir_with_dup (int, int, struct saved_cwd const *);
+static DIR *fd_clone_opendir (int, struct saved_cwd const *);
+
+/* Replacement for POSIX fdopendir.
+
+ First, try to simulate it via opendir ("/proc/self/fd/..."). Failing
+ that, simulate it by using fchdir metadata, or by doing
+ save_cwd/fchdir/opendir(".")/restore_cwd.
+ If either the save_cwd or the restore_cwd fails (relatively unlikely),
+ then give a diagnostic and exit nonzero.
+
+ If successful, the resulting stream is based on FD in
+ implementations where streams are based on file descriptors and in
+ applications where no other thread or signal handler allocates or
+ frees file descriptors. In other cases, consult dirfd on the result
+ to find out whether FD is still being used.
+
+ Otherwise, this function works just like POSIX fdopendir.
+
+ W A R N I N G:
+
+ Unlike other fdrelated functions, this one places constraints on FD.
+ If this function returns successfully, FD is under control of the
+ dirent.h system, and the caller should not close or modify the state of
+ FD other than by the dirent.h functions. */
+DIR *
+fdopendir (int fd)
+{
+ DIR *dir = fdopendir_with_dup (fd, 1, NULL);
+
+ if (! REPLACE_FCHDIR && ! dir)
+ {
+ int saved_errno = errno;
+ if (EXPECTED_ERRNO (saved_errno))
+ {
+ struct saved_cwd cwd;
+ if (save_cwd (&cwd) != 0)
+ openat_save_fail (errno);
+ dir = fdopendir_with_dup (fd, 1, &cwd);
+ saved_errno = errno;
+ free_cwd (&cwd);
+ errno = saved_errno;
+ }
+ }
+
+ return dir;
+}
+
+/* Like fdopendir, except that if OLDER_DUPFD is not 1, it is known
+ to be a dup of FD which is less than FD  1 and which will be
+ closed by the caller and not otherwise used by the caller. This
+ function makes sure that FD is closed and all file descriptors less
+ than FD are open, and then calls fd_clone_opendir on a dup of FD.
+ That way, barring race conditions, fd_clone_opendir returns a
+ stream whose file descriptor is FD.
+
+ If REPLACE_CHDIR or CWD is null, use opendir ("/proc/self/fd/...",
+ falling back on fchdir metadata. Otherwise, CWD is a saved version
+ of the working directory; use fchdir/opendir(".")/restore_cwd(CWD). */
+static DIR *
+fdopendir_with_dup (int fd, int older_dupfd, struct saved_cwd const *cwd)
+{
+ int dupfd = dup (fd);
+ if (dupfd < 0 && errno == EMFILE)
+ dupfd = older_dupfd;
+ if (dupfd < 0)
+ return NULL;
+ else
+ {
+ DIR *dir;
+ int saved_errno;
+ if (dupfd < fd  1 && dupfd != older_dupfd)
+ {
+ dir = fdopendir_with_dup (fd, dupfd, cwd);
+ saved_errno = errno;
+ }
+ else
+ {
+ close (fd);
+ dir = fd_clone_opendir (dupfd, cwd);
+ saved_errno = errno;
+ if (! dir)
+ {
+ int fd1 = dup (dupfd);
+ if (fd1 != fd)
+ openat_save_fail (fd1 < 0 ? errno : EBADF);
+ }
+ }
+
+ if (dupfd != older_dupfd)
+ close (dupfd);
+ errno = saved_errno;
+ return dir;
+ }
+}
+
+/* Like fdopendir, except the result controls a clone of FD. It is
+ the caller's responsibility both to close FD and (if the result is
+ not null) to closedir the result. */
+static DIR *
+fd_clone_opendir (int fd, struct saved_cwd const *cwd)
+{
+ if (REPLACE_FCHDIR  ! cwd)
+ {
+ DIR *dir = NULL;
+ int saved_errno = EOPNOTSUPP;
+ char buf[OPENAT_BUFFER_SIZE];
+ char *proc_file = openat_proc_name (buf, fd, ".");
+ if (proc_file)
+ {
+ dir = opendir (proc_file);
+ saved_errno = errno;
+ if (proc_file != buf)
+ free (proc_file);
+ }
+# if REPLACE_FCHDIR
+ if (! dir && EXPECTED_ERRNO (saved_errno))
+ {
+ char const *name = _gl_directory_name (fd);
+ return (name ? opendir (name) : NULL);
+ }
+# endif
+ errno = saved_errno;
+ return dir;
+ }
+ else
+ {
+ if (fchdir (fd) != 0)
+ return NULL;
+ else
+ {
+ DIR *dir = opendir (".");
+ int saved_errno = errno;
+ if (restore_cwd (cwd) != 0)
+ openat_restore_fail (errno);
+ errno = saved_errno;
+ return dir;
+ }
+ }
+}
+
+#else /* HAVE_FDOPENDIR */
+
+# include
+# include
+
+# undef fdopendir
+
+/* Like fdopendir, but work around GNU/Hurd bug by validating FD. */
+
+DIR *
+rpl_fdopendir (int fd)
+{
+ struct stat st;
+ if (fstat (fd, &st))
+ return NULL;
+ if (!S_ISDIR (st.st_mode))
+ {
+ errno = ENOTDIR;
+ return NULL;
+ }
+ return fdopendir (fd);
+}
+
+#endif /* HAVE_FDOPENDIR */
=== added file 'lib/fstatat.c'
 lib/fstatat.c 19700101 00:00:00 +0000
+++ lib/fstatat.c 20130201 06:30:51 +0000
@@ 0,0 +1,135 @@
+/* Work around an fstatat bug on Solaris 9.
+
+ Copyright (C) 2006, 20092013 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see . */
+
+/* Written by Paul Eggert and Jim Meyering. */
+
+/* If the user's config.h happens to include , let it include only
+ the system's here, so that orig_fstatat doesn't recurse to
+ rpl_fstatat. */
+#define __need_system_sys_stat_h
+#include
+
+/* Get the original definition of fstatat. It might be defined as a macro. */
+#include
+#include
+#undef __need_system_sys_stat_h
+
+#if HAVE_FSTATAT
+static int
+orig_fstatat (int fd, char const *filename, struct stat *buf, int flags)
+{
+ return fstatat (fd, filename, buf, flags);
+}
+#endif
+
+/* Write "sys/stat.h" here, not , otherwise OSF/1 5.1 DTK cc
+ eliminates this include because of the preliminary #include
+ above. */
+#include "sys/stat.h"
+
+#include
+#include
+#include
+
+#if HAVE_FSTATAT && HAVE_WORKING_FSTATAT_ZERO_FLAG
+
+# ifndef LSTAT_FOLLOWS_SLASHED_SYMLINK
+# define LSTAT_FOLLOWS_SLASHED_SYMLINK 0
+# endif
+
+/* fstatat should always follow symbolic links that end in /, but on
+ Solaris 9 it doesn't if AT_SYMLINK_NOFOLLOW is specified.
+ Likewise, trailing slash on a nondirectory should be an error.
+ These are the same problems that lstat.c and stat.c address, so
+ solve it in a similar way.
+
+ AIX 7.1 fstatat (AT_FDCWD, ..., 0) always fails, which is a bug.
+ Work around this bug if FSTATAT_AT_FDCWD_0_BROKEN is nonzero. */
+
+int
+rpl_fstatat (int fd, char const *file, struct stat *st, int flag)
+{
+ int result = orig_fstatat (fd, file, st, flag);
+ size_t len;
+
+ if (LSTAT_FOLLOWS_SLASHED_SYMLINK  result != 0)
+ return result;
+ len = strlen (file);
+ if (flag & AT_SYMLINK_NOFOLLOW)
+ {
+ /* Fix lstat behavior. */
+ if (file[len  1] != '/'  S_ISDIR (st>st_mode))
+ return 0;
+ if (!S_ISLNK (st>st_mode))
+ {
+ errno = ENOTDIR;
+ return 1;
+ }
+ result = orig_fstatat (fd, file, st, flag & ~AT_SYMLINK_NOFOLLOW);
+ }
+ /* Fix stat behavior. */
+ if (result == 0 && !S_ISDIR (st>st_mode) && file[len  1] == '/')
+ {
+ errno = ENOTDIR;
+ return 1;
+ }
+ return result;
+}
+
+#else /* ! (HAVE_FSTATAT && HAVE_WORKING_FSTATAT_ZERO_FLAG) */
+
+/* On mingw, the gnulib defines 'stat' as a functionlike
+ macro; but using it in AT_FUNC_F2 causes compilation failure
+ because the preprocessor sees a use of a macro that requires two
+ arguments but is only given one. Hence, we need an inline
+ forwarder to get past the preprocessor. */
+static int
+stat_func (char const *name, struct stat *st)
+{
+ return stat (name, st);
+}
+
+/* Likewise, if there is no native 'lstat', then the gnulib
+ defined it as stat, which also needs adjustment. */
+# if !HAVE_LSTAT
+# undef lstat
+# define lstat stat_func
+# endif
+
+/* Replacement for Solaris' function by the same name.
+
+ First, try to simulate it via l?stat ("/proc/self/fd/FD/FILE").
+ Failing that, simulate it via save_cwd/fchdir/(statlstat)/restore_cwd.
+ If either the save_cwd or the restore_cwd fails (relatively unlikely),
+ then give a diagnostic and exit nonzero.
+ Otherwise, this function works just like Solaris' fstatat. */
+
+# define AT_FUNC_NAME fstatat
+# define AT_FUNC_F1 lstat
+# define AT_FUNC_F2 stat_func
+# define AT_FUNC_USE_F1_COND AT_SYMLINK_NOFOLLOW
+# define AT_FUNC_POST_FILE_PARAM_DECLS , struct stat *st, int flag
+# define AT_FUNC_POST_FILE_ARGS , st
+# include "atfunc.c"
+# undef AT_FUNC_NAME
+# undef AT_FUNC_F1
+# undef AT_FUNC_F2
+# undef AT_FUNC_USE_F1_COND
+# undef AT_FUNC_POST_FILE_PARAM_DECLS
+# undef AT_FUNC_POST_FILE_ARGS
+
+#endif /* !HAVE_FSTATAT */
=== modified file 'lib/gnulib.mk'
 lib/gnulib.mk 20130104 02:17:49 +0000
+++ lib/gnulib.mk 20130201 06:30:51 +0000
@@ 21,7 +21,7 @@
# the same distribution terms as the rest of that program.
#
# Generated by gnulibtool.
# Reproduce by: gnulibtool import dir=. lib=libgnu sourcebase=lib m4base=m4 docbase=doc testsbase=tests auxdir=buildaux avoid=atinternal avoid=errno avoid=fchdir avoid=fcntl avoid=fstat avoid=mallocposix avoid=msvcinval avoid=msvcnothrow avoid=openatdie avoid=openath avoid=raise avoid=savecwd avoid=select avoid=sigprocmask avoid=sys_types avoid=threadlib makefilename=gnulib.mk conditionaldependencies nolibtool macroprefix=gl novcfiles allocaopt cctype cstrcase careadlinkat closestream crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntlh filemode getloadavg getoptgnu gettime gettimeofday ignorevalue intprops largefile lstat manywarnings mktime pselect pthread_sigmask putenv readlink sig2str socklen stattime stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timertime timespecadd timespecsub unsetenv utimens warnings
+# Reproduce by: gnulibtool import dir=. lib=libgnu sourcebase=lib m4base=m4 docbase=doc testsbase=tests auxdir=buildaux avoid=dup avoid=errno avoid=fchdir avoid=fcntl avoid=fstat avoid=mallocposix avoid=msvcinval avoid=msvcnothrow avoid=open avoid=openatdie avoid=opendir avoid=raise avoid=savecwd avoid=select avoid=sigprocmask avoid=sys_types avoid=threadlib makefilename=gnulib.mk conditionaldependencies nolibtool macroprefix=gl novcfiles allocaopt cctype cstrcase careadlinkat closestream crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntlh fdopendir filemode fstatat getloadavg getoptgnu gettime gettimeofday ignorevalue intprops largefile lstat manywarnings mktime pselect pthread_sigmask putenv readlink readlinkat sig2str socklen stattime stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timertime timespecadd timespecsub unsetenv utimens warnings
MOSTLYCLEANFILES += core *.stackdump
@@ 64,6 +64,17 @@
## end gnulib module allocator
+## begin gnulib module atinternal
+
+if gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b
+
+endif
+EXTRA_DIST += openatpriv.h openatproc.c
+
+EXTRA_libgnu_a_SOURCES += openatproc.c
+
+## end gnulib module atinternal
+
## begin gnulib module cctype
libgnu_a_SOURCES += cctype.h cctype.c
@@ 124,6 +135,54 @@
## end gnulib module crypto/sha512
+## begin gnulib module dirent
+
+BUILT_SOURCES += dirent.h
+
+# We need the following in order to create when the system
+# doesn't have one that works with the given compiler.
+dirent.h: dirent.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(AM_V_GEN)rm f $@t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed e 's@''GUARD_PREFIX''@GLg' \
+ e 's@''HAVE_DIRENT_H''@$(HAVE_DIRENT_H)g' \
+ e 's@''INCLUDE_NEXT''@$(INCLUDE_NEXT)g' \
+ e 's@''PRAGMA_SYSTEM_HEADER''@@PRAGMA_SYSTEM_HEADER@g' \
+ e 's@''PRAGMA_COLUMNS''@@PRAGMA_COLUMNS@g' \
+ e 's@''NEXT_DIRENT_H''@$(NEXT_DIRENT_H)g' \
+ e 's/@''GNULIB_OPENDIR''@/$(GNULIB_OPENDIR)/g' \
+ e 's/@''GNULIB_READDIR''@/$(GNULIB_READDIR)/g' \
+ e 's/@''GNULIB_REWINDDIR''@/$(GNULIB_REWINDDIR)/g' \
+ e 's/@''GNULIB_CLOSEDIR''@/$(GNULIB_CLOSEDIR)/g' \
+ e 's/@''GNULIB_DIRFD''@/$(GNULIB_DIRFD)/g' \
+ e 's/@''GNULIB_FDOPENDIR''@/$(GNULIB_FDOPENDIR)/g' \
+ e 's/@''GNULIB_SCANDIR''@/$(GNULIB_SCANDIR)/g' \
+ e 's/@''GNULIB_ALPHASORT''@/$(GNULIB_ALPHASORT)/g' \
+ e 's/@''HAVE_OPENDIR''@/$(HAVE_OPENDIR)/g' \
+ e 's/@''HAVE_READDIR''@/$(HAVE_READDIR)/g' \
+ e 's/@''HAVE_REWINDDIR''@/$(HAVE_REWINDDIR)/g' \
+ e 's/@''HAVE_CLOSEDIR''@/$(HAVE_CLOSEDIR)/g' \
+ e 's@''HAVE_DECL_DIRFD''@$(HAVE_DECL_DIRFD)g' \
+ e 's@''HAVE_DECL_FDOPENDIR''@$(HAVE_DECL_FDOPENDIR)g' \
+ e 's@''HAVE_FDOPENDIR''@$(HAVE_FDOPENDIR)g' \
+ e 's@''HAVE_SCANDIR''@$(HAVE_SCANDIR)g' \
+ e 's@''HAVE_ALPHASORT''@$(HAVE_ALPHASORT)g' \
+ e 's@''REPLACE_OPENDIR''@$(REPLACE_OPENDIR)g' \
+ e 's@''REPLACE_CLOSEDIR''@$(REPLACE_CLOSEDIR)g' \
+ e 's@''REPLACE_DIRFD''@$(REPLACE_DIRFD)g' \
+ e 's@''REPLACE_FDOPENDIR''@$(REPLACE_FDOPENDIR)g' \
+ e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ < $(srcdir)/dirent.in.h; \
+ } > $@t && \
+ mv $@t $@
+MOSTLYCLEANFILES += dirent.h dirent.ht
+
+EXTRA_DIST += dirent.in.h
+
+## end gnulib module dirent
+
## begin gnulib module dosname
if gl_GNULIB_ENABLED_dosname
@@ 238,6 +297,15 @@
## end gnulib module fcntlh
+## begin gnulib module fdopendir
+
+
+EXTRA_DIST += fdopendir.c
+
+EXTRA_libgnu_a_SOURCES += fdopendir.c
+
+## end gnulib module fdopendir
+
## begin gnulib module filemode
libgnu_a_SOURCES += filemode.c
@@ 255,6 +323,15 @@
## end gnulib module fpending
+## begin gnulib module fstatat
+
+
+EXTRA_DIST += atfunc.c fstatat.c
+
+EXTRA_libgnu_a_SOURCES += atfunc.c fstatat.c
+
+## end gnulib module fstatat
+
## begin gnulib module getgroups
if gl_GNULIB_ENABLED_getgroups
@@ 412,6 +489,15 @@
## end gnulib module mktime
+## begin gnulib module openath
+
+if gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7
+
+endif
+EXTRA_DIST += openat.h
+
+## end gnulib module openath
+
## begin gnulib module pathmax
if gl_GNULIB_ENABLED_pathmax
@@ 457,6 +543,15 @@
## end gnulib module readlink
+## begin gnulib module readlinkat
+
+
+EXTRA_DIST += atfunc.c readlinkat.c
+
+EXTRA_libgnu_a_SOURCES += atfunc.c readlinkat.c
+
+## end gnulib module readlinkat
+
## begin gnulib module rootuid
if gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c
=== added file 'lib/openatdie.c'
 lib/openatdie.c 19700101 00:00:00 +0000
+++ lib/openatdie.c 20130201 06:30:51 +0000
@@ 0,0 +1,6 @@
+/* Respond to a save or restorecwd failure.
+ This should never happen with Emacs. */
+#include
+#include "openat.h"
+void openat_save_fail (int errnum) { abort (); }
+void openat_restore_fail (int errnum) { abort (); }
=== added file 'lib/openatpriv.h'
 lib/openatpriv.h 19700101 00:00:00 +0000
+++ lib/openatpriv.h 20130201 06:30:51 +0000
@@ 0,0 +1,64 @@
+/* Internals for openatlike functions.
+
+ Copyright (C) 20052006, 20092013 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see . */
+
+/* written by Jim Meyering */
+
+#ifndef _GL_HEADER_OPENAT_PRIV
+#define _GL_HEADER_OPENAT_PRIV
+
+#include
+#include
+#include
+
+/* Maximum number of bytes that it is safe to allocate as a single
+ array on the stack, and that is known as a compiletime constant.
+ The assumption is that we'll touch the array very quickly, or a
+ temporary very near the array, provoking an outofmemory trap. On
+ some operating systems, there is only one guard page for the stack,
+ and a page size can be as small as 4096 bytes. Subtract 64 in the
+ hope that this will let the compiler touch a nearby temporary and
+ provoke a trap. */
+#define SAFER_ALLOCA_MAX (4096  64)
+
+#define SAFER_ALLOCA(m) ((m) < SAFER_ALLOCA_MAX ? (m) : SAFER_ALLOCA_MAX)
+
+#if defined PATH_MAX
+# define OPENAT_BUFFER_SIZE SAFER_ALLOCA (PATH_MAX)
+#elif defined _XOPEN_PATH_MAX
+# define OPENAT_BUFFER_SIZE SAFER_ALLOCA (_XOPEN_PATH_MAX)
+#else
+# define OPENAT_BUFFER_SIZE SAFER_ALLOCA (1024)
+#endif
+
+char *openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int fd, char const *file);
+
+/* Trying to access a BUILD_PROC_NAME file will fail on systems without
+ /proc support, and even on systems *with* ProcFS support. Return
+ nonzero if the failure may be legitimate, e.g., because /proc is not
+ readable, or the particular .../fd/N directory is not present. */
+#define EXPECTED_ERRNO(Errno) \
+ ((Errno) == ENOTDIR  (Errno) == ENOENT \
+  (Errno) == EPERM  (Errno) == EACCES \
+  (Errno) == ENOSYS /* Solaris 8 */ \
+  (Errno) == EOPNOTSUPP /* FreeBSD */)
+
+/* Wrapper function shared among linkat and renameat. */
+int at_func2 (int fd1, char const *file1,
+ int fd2, char const *file2,
+ int (*func) (char const *file1, char const *file2));
+
+#endif /* _GL_HEADER_OPENAT_PRIV */
=== added file 'lib/openatproc.c'
 lib/openatproc.c 19700101 00:00:00 +0000
+++ lib/openatproc.c 20130201 06:30:51 +0000
@@ 0,0 +1,110 @@
+/* Create /proc/self/fdrelated names for subfiles of open directories.
+
+ Copyright (C) 2006, 20092013 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see . */
+
+/* Written by Paul Eggert. */
+
+#include
+
+#include "openatpriv.h"
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+#include "intprops.h"
+
+/* The results of open() in this file are not used with fchdir,
+ and we do not leak fds to any singlethreaded code that could use stdio,
+ therefore save some unnecessary work in fchdir.c.
+ FIXME  if the kernel ever adds support for multithread safety for
+ avoiding standard fds, then we should use open_safer. */
+#undef open
+#undef close
+
+#define PROC_SELF_FD_FORMAT "/proc/self/fd/%d/%s"
+
+#define PROC_SELF_FD_NAME_SIZE_BOUND(len) \
+ (sizeof PROC_SELF_FD_FORMAT  sizeof "%d%s" \
+ + INT_STRLEN_BOUND (int) + (len) + 1)
+
+
+/* Set BUF to the expansion of PROC_SELF_FD_FORMAT, using FD and FILE
+ respectively for %d and %s. If successful, return BUF if the
+ result fits in BUF, dynamically allocated memory otherwise. But
+ return NULL if /proc is not reliable, either because the operating
+ system support is lacking or because memory is low. */
+char *
+openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int fd, char const *file)
+{
+ static int proc_status = 0;
+
+ /* Make sure the caller gets ENOENT when appropriate. */
+ if (!*file)
+ {
+ buf[0] = '\0';
+ return buf;
+ }
+
+ if (! proc_status)
+ {
+ /* Set PROC_STATUS to a positive value if /proc/self/fd is
+ reliable, and a negative value otherwise. Solaris 10
+ /proc/self/fd mishandles "..", and any file name might expand
+ to ".." after symbolic link expansion, so avoid /proc/self/fd
+ if it mishandles "..". Solaris 10 has openat, but this
+ problem is exhibited on code that built on Solaris 8 and
+ running on Solaris 10. */
+
+ int proc_self_fd = open ("/proc/self/fd",
+ O_SEARCH  O_DIRECTORY  O_NOCTTY  O_NONBLOCK);
+ if (proc_self_fd < 0)
+ proc_status = 1;
+ else
+ {
+ /* Detect whether /proc/self/fd/%i/../fd exists, where %i is the
+ number of a file descriptor open on /proc/self/fd. On Linux,
+ that name resolves to /proc/self/fd, which was opened above.
+ However, on Solaris, it may resolve to /proc/self/fd/fd, which
+ cannot exist, since all names in /proc/self/fd are numeric. */
+ char dotdot_buf[PROC_SELF_FD_NAME_SIZE_BOUND (sizeof "../fd"  1)];
+ sprintf (dotdot_buf, PROC_SELF_FD_FORMAT, proc_self_fd, "../fd");
+ proc_status = access (dotdot_buf, F_OK) ? 1 : 1;
+ close (proc_self_fd);
+ }
+ }
+
+ if (proc_status < 0)
+ return NULL;
+ else
+ {
+ size_t bufsize = PROC_SELF_FD_NAME_SIZE_BOUND (strlen (file));
+ char *result = buf;
+ if (OPENAT_BUFFER_SIZE < bufsize)
+ {
+ result = malloc (bufsize);
+ if (! result)
+ return NULL;
+ }
+ sprintf (result, PROC_SELF_FD_FORMAT, fd, file);
+ return result;
+ }
+}
=== added file 'lib/openat.h'
 lib/openat.h 19700101 00:00:00 +0000
+++ lib/openat.h 20130201 06:30:51 +0000
@@ 0,0 +1,120 @@
+/* provide a replacement openat function
+ Copyright (C) 20042006, 20082013 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see . */
+
+/* written by Jim Meyering */
+
+#ifndef _GL_HEADER_OPENAT
+#define _GL_HEADER_OPENAT
+
+#include
+
+#include
+#include
+#include
+#include
+
+_GL_INLINE_HEADER_BEGIN
+
+#if !HAVE_OPENAT
+
+int openat_permissive (int fd, char const *file, int flags, mode_t mode,
+ int *cwd_errno);
+bool openat_needs_fchdir (void);
+
+#else
+
+# define openat_permissive(Fd, File, Flags, Mode, Cwd_errno) \
+ openat (Fd, File, Flags, Mode)
+# define openat_needs_fchdir() false
+
+#endif
+
+_Noreturn void openat_restore_fail (int);
+_Noreturn void openat_save_fail (int);
+
+/* Using these function names makes application code
+ slightly more readable than it would be with
+ fchownat (..., 0) or fchownat (..., AT_SYMLINK_NOFOLLOW). */
+
+#if GNULIB_FCHOWNAT
+
+# ifndef FCHOWNAT_INLINE
+# define FCHOWNAT_INLINE _GL_INLINE
+# endif
+
+FCHOWNAT_INLINE int
+chownat (int fd, char const *file, uid_t owner, gid_t group)
+{
+ return fchownat (fd, file, owner, group, 0);
+}
+
+FCHOWNAT_INLINE int
+lchownat (int fd, char const *file, uid_t owner, gid_t group)
+{
+ return fchownat (fd, file, owner, group, AT_SYMLINK_NOFOLLOW);
+}
+
+#endif
+
+#if GNULIB_FCHMODAT
+
+# ifndef FCHMODAT_INLINE
+# define FCHMODAT_INLINE _GL_INLINE
+# endif
+
+FCHMODAT_INLINE int
+chmodat (int fd, char const *file, mode_t mode)
+{
+ return fchmodat (fd, file, mode, 0);
+}
+
+FCHMODAT_INLINE int
+lchmodat (int fd, char const *file, mode_t mode)
+{
+ return fchmodat (fd, file, mode, AT_SYMLINK_NOFOLLOW);
+}
+
+#endif
+
+#if GNULIB_STATAT
+
+# ifndef STATAT_INLINE
+# define STATAT_INLINE _GL_INLINE
+# endif
+
+STATAT_INLINE int
+statat (int fd, char const *name, struct stat *st)
+{
+ return fstatat (fd, name, st, 0);
+}
+
+STATAT_INLINE int
+lstatat (int fd, char const *name, struct stat *st)
+{
+ return fstatat (fd, name, st, AT_SYMLINK_NOFOLLOW);
+}
+
+#endif
+
+/* For now, there are no wrappers named laccessat or leuidaccessat,
+ since gnulib doesn't support faccessat(,AT_SYMLINK_NOFOLLOW) and
+ since access rights on symlinks are of limited utility. Likewise,
+ wrappers are not provided for accessat or euidaccessat, so as to
+ avoid dragging in lgen on some platforms. */
+
+_GL_INLINE_HEADER_END
+
+#endif /* _GL_HEADER_OPENAT */
=== added file 'lib/readlinkat.c'
 lib/readlinkat.c 19700101 00:00:00 +0000
+++ lib/readlinkat.c 20130201 06:30:51 +0000
@@ 0,0 +1,47 @@
+/* Read a symlink relative to an open directory.
+ Copyright (C) 20092013 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see . */
+
+/* written by Eric Blake */
+
+#include
+
+#include
+
+/* Gnulib provides a readlink stub for mingw; use it for distinction
+ between EINVAL and ENOENT, rather than always failing with ENOSYS. */
+
+/* POSIX 2008 says that unlike readlink, readlinkat returns 0 for
+ success instead of the buffer length. But this would render
+ readlinkat worthless since readlink does not guarantee a
+ NULterminated buffer. Assume this was a bug in POSIX. */
+
+/* Read the contents of symlink FILE into buffer BUF of size LEN, in the
+ directory open on descriptor FD. If possible, do it without changing
+ the working directory. Otherwise, resort to using save_cwd/fchdir,
+ then readlink/restore_cwd. If either the save_cwd or the restore_cwd
+ fails, then give a diagnostic and exit nonzero. */
+
+#define AT_FUNC_NAME readlinkat
+#define AT_FUNC_F1 readlink
+#define AT_FUNC_POST_FILE_PARAM_DECLS , char *buf, size_t len
+#define AT_FUNC_POST_FILE_ARGS , buf, len
+#define AT_FUNC_RESULT ssize_t
+#include "atfunc.c"
+#undef AT_FUNC_NAME
+#undef AT_FUNC_F1
+#undef AT_FUNC_POST_FILE_PARAM_DECLS
+#undef AT_FUNC_POST_FILE_ARGS
+#undef AT_FUNC_RESULT
=== added file 'lib/savecwd.c'
 lib/savecwd.c 19700101 00:00:00 +0000
+++ lib/savecwd.c 20130201 06:30:51 +0000
@@ 0,0 +1,3 @@
+#include
+#define SAVE_CWD_INLINE _GL_EXTERN_INLINE
+#include "savecwd.h"
=== added file 'lib/savecwd.h'
 lib/savecwd.h 19700101 00:00:00 +0000
+++ lib/savecwd.h 20130201 06:30:51 +0000
@@ 0,0 +1,46 @@
+/* Do not save and restore the current working directory.
+
+ Copyright 2013 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see . */
+
+/* Gnulib needs to save and restore the current working directory to
+ fully emulate functions like fstatat. But Emacs doesn't care what
+ the current working directory is; it always uses absolute file
+ names. This module replaces the Gnulib module by omitting the code
+ that Emacs does not need. */
+
+#ifndef SAVE_CWD_H
+#define SAVE_CWD_H 1
+
+_GL_INLINE_HEADER_BEGIN
+#ifndef SAVE_CWD_INLINE
+# define SAVE_CWD_INLINE _GL_INLINE
+#endif
+
+struct saved_cwd { int desc; };
+
+SAVE_CWD_INLINE int
+save_cwd (struct saved_cwd *cwd)
+{
+ cwd>desc = 1;
+ return 0;
+}
+
+SAVE_CWD_INLINE int restore_cwd (struct saved_cwd const *cwd) { return 0; }
+SAVE_CWD_INLINE void free_cwd (struct saved_cwd *cwd) { }
+
+_GL_INLINE_HEADER_END
+
+#endif
=== added file 'm4/dirent_h.m4'
 m4/dirent_h.m4 19700101 00:00:00 +0000
+++ m4/dirent_h.m4 20130201 06:30:51 +0000
@@ 0,0 +1,64 @@
+# dirent_h.m4 serial 16
+dnl Copyright (C) 20082013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Bruno Haible.
+
+AC_DEFUN([gl_DIRENT_H],
+[
+ dnl Use AC_REQUIRE here, so that the default behavior below is expanded
+ dnl once only, before all statements that occur in other macros.
+ AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+
+ dnl is always overridden, because of GNULIB_POSIXCHECK.
+ gl_CHECK_NEXT_HEADERS([dirent.h])
+ if test $ac_cv_header_dirent_h = yes; then
+ HAVE_DIRENT_H=1
+ else
+ HAVE_DIRENT_H=0
+ fi
+ AC_SUBST([HAVE_DIRENT_H])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include
+ ]], [alphasort closedir dirfd fdopendir opendir readdir rewinddir scandir])
+])
+
+AC_DEFUN([gl_DIRENT_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_DIRENT_H_DEFAULTS],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR
+ GNULIB_OPENDIR=0; AC_SUBST([GNULIB_OPENDIR])
+ GNULIB_READDIR=0; AC_SUBST([GNULIB_READDIR])
+ GNULIB_REWINDDIR=0; AC_SUBST([GNULIB_REWINDDIR])
+ GNULIB_CLOSEDIR=0; AC_SUBST([GNULIB_CLOSEDIR])
+ GNULIB_DIRFD=0; AC_SUBST([GNULIB_DIRFD])
+ GNULIB_FDOPENDIR=0; AC_SUBST([GNULIB_FDOPENDIR])
+ GNULIB_SCANDIR=0; AC_SUBST([GNULIB_SCANDIR])
+ GNULIB_ALPHASORT=0; AC_SUBST([GNULIB_ALPHASORT])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_OPENDIR=1; AC_SUBST([HAVE_OPENDIR])
+ HAVE_READDIR=1; AC_SUBST([HAVE_READDIR])
+ HAVE_REWINDDIR=1; AC_SUBST([HAVE_REWINDDIR])
+ HAVE_CLOSEDIR=1; AC_SUBST([HAVE_CLOSEDIR])
+ HAVE_DECL_DIRFD=1; AC_SUBST([HAVE_DECL_DIRFD])
+ HAVE_DECL_FDOPENDIR=1;AC_SUBST([HAVE_DECL_FDOPENDIR])
+ HAVE_FDOPENDIR=1; AC_SUBST([HAVE_FDOPENDIR])
+ HAVE_SCANDIR=1; AC_SUBST([HAVE_SCANDIR])
+ HAVE_ALPHASORT=1; AC_SUBST([HAVE_ALPHASORT])
+ REPLACE_OPENDIR=0; AC_SUBST([REPLACE_OPENDIR])
+ REPLACE_CLOSEDIR=0; AC_SUBST([REPLACE_CLOSEDIR])
+ REPLACE_DIRFD=0; AC_SUBST([REPLACE_DIRFD])
+ REPLACE_FDOPENDIR=0; AC_SUBST([REPLACE_FDOPENDIR])
+])
=== added file 'm4/fdopendir.m4'
 m4/fdopendir.m4 19700101 00:00:00 +0000
+++ m4/fdopendir.m4 20130201 06:30:51 +0000
@@ 0,0 +1,61 @@
+# serial 10
+# See if we need to provide fdopendir.
+
+dnl Copyright (C) 20092013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Written by Eric Blake.
+
+AC_DEFUN([gl_FUNC_FDOPENDIR],
+[
+ AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for crosscompiles
+
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ dnl FreeBSD 7.3 has the function, but failed to declare it.
+ AC_CHECK_DECLS([fdopendir], [], [HAVE_DECL_FDOPENDIR=0], [[
+#include
+ ]])
+ AC_CHECK_FUNCS_ONCE([fdopendir])
+ if test $ac_cv_func_fdopendir = no; then
+ HAVE_FDOPENDIR=0
+ else
+ AC_CACHE_CHECK([whether fdopendir works],
+ [gl_cv_func_fdopendir_works],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include
+#include
+#include
+#if !HAVE_DECL_FDOPENDIR
+extern
+# ifdef __cplusplus
+"C"
+# endif
+DIR *fdopendir (int);
+#endif
+]], [int result = 0;
+ int fd = open ("conftest.c", O_RDONLY);
+ if (fd < 0) result = 1;
+ if (fdopendir (fd)) result = 2;
+ if (close (fd)) result = 4;
+ return result;])],
+ [gl_cv_func_fdopendir_works=yes],
+ [gl_cv_func_fdopendir_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *gnu*) gl_cv_func_fdopendir_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_fdopendir_works="guessing no" ;;
+ esac
+ ])])
+ case "$gl_cv_func_fdopendir_works" in
+ *yes) ;;
+ *)
+ REPLACE_FDOPENDIR=1
+ ;;
+ esac
+ fi
+])
=== added file 'm4/fstatat.m4'
 m4/fstatat.m4 19700101 00:00:00 +0000
+++ m4/fstatat.m4 20130201 06:30:51 +0000
@@ 0,0 +1,60 @@
+# fstatat.m4 serial 3
+dnl Copyright (C) 20042013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Written by Jim Meyering.
+
+# If we have the fstatat function, and it has the bug (in AIX 7.1)
+# that it does not fill in st_size correctly, use the replacement function.
+AC_DEFUN([gl_FUNC_FSTATAT],
+[
+ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for crosscompiles
+ AC_CHECK_FUNCS_ONCE([fstatat])
+
+ if test $ac_cv_func_fstatat = no; then
+ HAVE_FSTATAT=0
+ else
+ dnl Test for an AIX 7.1 bug; see
+ dnl .
+ AC_CACHE_CHECK([whether fstatat (..., 0) works],
+ [gl_cv_func_fstatat_zero_flag],
+ [AC_RUN_IFELSE(
+ [AC_LANG_SOURCE(
+ [[
+ #include
+ #include
+ int
+ main (void)
+ {
+ struct stat a;
+ return fstatat (AT_FDCWD, ".", &a, 0) != 0;
+ }
+ ]])],
+ [gl_cv_func_fstatat_zero_flag=yes],
+ [gl_cv_func_fstatat_zero_flag=no],
+ [case "$host_os" in
+ aix*) gl_cv_func_fstatat_zero_flag="guessing no";;
+ *) gl_cv_func_fstatat_zero_flag="guessing yes";;
+ esac
+ ])
+ ])
+
+ case $gl_cv_func_fstatat_zero_flag+$gl_cv_func_lstat_dereferences_slashed_symlink in
+ *yes+*yes) ;;
+ *) REPLACE_FSTATAT=1
+ case $gl_cv_func_fstatat_zero_flag in
+ *yes)
+ AC_DEFINE([HAVE_WORKING_FSTATAT_ZERO_FLAG], [1],
+ [Define to 1 if fstatat (..., 0) works.
+ For example, it does not work in AIX 7.1.])
+ ;;
+ esac
+ ;;
+ esac
+ fi
+])
=== modified file 'm4/gnulibcomp.m4'
 m4/gnulibcomp.m4 20130104 02:17:49 +0000
+++ m4/gnulibcomp.m4 20130201 06:30:51 +0000
@@ 40,6 +40,7 @@
AC_REQUIRE([gl_PROG_AR_RANLIB])
# Code from module allocaopt:
# Code from module allocator:
+ # Code from module atinternal:
# Code from module cctype:
# Code from module cstrcase:
# Code from module careadlinkat:
@@ 49,6 +50,7 @@
# Code from module crypto/sha1:
# Code from module crypto/sha256:
# Code from module crypto/sha512:
+ # Code from module dirent:
# Code from module dosname:
# Code from module dtoastr:
# Code from module dtotimespec:
@@ 61,8 +63,10 @@
# Code from module externinline:
# Code from module faccessat:
# Code from module fcntlh:
+ # Code from module fdopendir:
# Code from module filemode:
# Code from module fpending:
+ # Code from module fstatat:
# Code from module getgroups:
# Code from module getloadavg:
# Code from module getoptgnu:
@@ 82,11 +86,13 @@
# Code from module mktime:
# Code from module multiarch:
# Code from module nocrash:
+ # Code from module openath:
# Code from module pathmax:
# Code from module pselect:
# Code from module pthread_sigmask:
# Code from module putenv:
# Code from module readlink:
+ # Code from module readlinkat:
# Code from module rootuid:
# Code from module sig2str:
# Code from module signalh:
@@ 159,6 +165,7 @@
gl_SHA1
gl_SHA256
gl_SHA512
+ gl_DIRENT_H
AC_REQUIRE([gl_C99_STRTOLD])
gl_FUNC_DUP2
if test $HAVE_DUP2 = 0  test $REPLACE_DUP2 = 1; then
@@ 178,12 +185,23 @@
gl_MODULE_INDICATOR([faccessat])
gl_UNISTD_MODULE_INDICATOR([faccessat])
gl_FCNTL_H
+ gl_FUNC_FDOPENDIR
+ if test $HAVE_FDOPENDIR = 0  test $REPLACE_FDOPENDIR = 1; then
+ AC_LIBOBJ([fdopendir])
+ fi
+ gl_DIRENT_MODULE_INDICATOR([fdopendir])
+ gl_MODULE_INDICATOR([fdopendir])
gl_FILEMODE
gl_FUNC_FPENDING
if test $ac_cv_func___fpending = no; then
AC_LIBOBJ([fpending])
gl_PREREQ_FPENDING
fi
+ gl_FUNC_FSTATAT
+ if test $HAVE_FSTATAT = 0  test $REPLACE_FSTATAT = 1; then
+ AC_LIBOBJ([fstatat])
+ fi
+ gl_SYS_STAT_MODULE_INDICATOR([fstatat])
gl_GETLOADAVG
if test $HAVE_GETLOADAVG = 0; then
AC_LIBOBJ([getloadavg])
@@ 253,6 +271,11 @@
gl_PREREQ_READLINK
fi
gl_UNISTD_MODULE_INDICATOR([readlink])
+ gl_FUNC_READLINKAT
+ if test $HAVE_READLINKAT = 0; then
+ AC_LIBOBJ([readlinkat])
+ fi
+ gl_UNISTD_MODULE_INDICATOR([readlinkat])
gl_FUNC_SIG2STR
if test $ac_cv_func_sig2str = no; then
AC_LIBOBJ([sig2str])
@@ 311,11 +334,13 @@
fi
gl_STDLIB_MODULE_INDICATOR([unsetenv])
gl_UTIMENS
+ gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b=false
gl_gnulib_enabled_dosname=false
gl_gnulib_enabled_euidaccess=false
gl_gnulib_enabled_getgroups=false
gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false
gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1=false
+ gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7=false
gl_gnulib_enabled_pathmax=false
gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c=false
gl_gnulib_enabled_stat=false
@@ 323,6 +348,13 @@
gl_gnulib_enabled_strtoull=false
gl_gnulib_enabled_verify=false
gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec=false
+ func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b ()
+ {
+ if ! $gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b; then
+ AC_LIBOBJ([openatproc])
+ gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b=true
+ fi
+ }
func_gl_gnulib_m4code_dosname ()
{
if ! $gl_gnulib_enabled_dosname; then
@@ 385,6 +417,12 @@
fi
fi
}
+ func_gl_gnulib_m4code_03e0aaad4cb89ca757653bd367a6ccb7 ()
+ {
+ if ! $gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7; then
+ gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7=true
+ fi
+ }
func_gl_gnulib_m4code_pathmax ()
{
if ! $gl_gnulib_enabled_pathmax; then
@@ 456,11 +494,29 @@
fi
}
if test $HAVE_FACCESSAT = 0; then
+ func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b
+ fi
+ if test $HAVE_FACCESSAT = 0; then
func_gl_gnulib_m4code_dosname
fi
if test $HAVE_FACCESSAT = 0; then
func_gl_gnulib_m4code_euidaccess
fi
+ if test $HAVE_FACCESSAT = 0; then
+ func_gl_gnulib_m4code_03e0aaad4cb89ca757653bd367a6ccb7
+ fi
+ if test $HAVE_FDOPENDIR = 0; then
+ func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b
+ fi
+ if test $HAVE_FSTATAT = 0  test $REPLACE_FSTATAT = 1; then
+ func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b
+ fi
+ if test $HAVE_FSTATAT = 0  test $REPLACE_FSTATAT = 1; then
+ func_gl_gnulib_m4code_dosname
+ fi
+ if test $HAVE_FSTATAT = 0  test $REPLACE_FSTATAT = 1; then
+ func_gl_gnulib_m4code_03e0aaad4cb89ca757653bd367a6ccb7
+ fi
if test $REPLACE_GETOPT = 1; then
func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36
fi
@@ 473,6 +529,15 @@
if test $HAVE_READLINK = 0  test $REPLACE_READLINK = 1; then
func_gl_gnulib_m4code_stat
fi
+ if test $HAVE_READLINKAT = 0; then
+ func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b
+ fi
+ if test $HAVE_READLINKAT = 0; then
+ func_gl_gnulib_m4code_dosname
+ fi
+ if test $HAVE_READLINKAT = 0; then
+ func_gl_gnulib_m4code_03e0aaad4cb89ca757653bd367a6ccb7
+ fi
if { test $HAVE_STRTOIMAX = 0  test $REPLACE_STRTOIMAX = 1; } && test $ac_cv_type_long_long_int = yes; then
func_gl_gnulib_m4code_strtoll
fi
@@ 486,11 +551,13 @@
func_gl_gnulib_m4code_verify
fi
m4_pattern_allow([^gl_GNULIB_ENABLED_])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b], [$gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b])
AM_CONDITIONAL([gl_GNULIB_ENABLED_dosname], [$gl_gnulib_enabled_dosname])
AM_CONDITIONAL([gl_GNULIB_ENABLED_euidaccess], [$gl_gnulib_enabled_euidaccess])
AM_CONDITIONAL([gl_GNULIB_ENABLED_getgroups], [$gl_gnulib_enabled_getgroups])
AM_CONDITIONAL([gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36], [$gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36])
AM_CONDITIONAL([gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1], [$gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7], [$gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7])
AM_CONDITIONAL([gl_GNULIB_ENABLED_pathmax], [$gl_gnulib_enabled_pathmax])
AM_CONDITIONAL([gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c], [$gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c])
AM_CONDITIONAL([gl_GNULIB_ENABLED_stat], [$gl_gnulib_enabled_stat])
@@ 656,6 +723,7 @@
lib/careadlinkat.h
lib/closestream.c
lib/closestream.h
+ lib/dirent.in.h
lib/dosname.h
lib/dtoastr.c
lib/dtotimespec.c
@@ 665,10 +733,12 @@
lib/execinfo.in.h
lib/faccessat.c
lib/fcntl.in.h
+ lib/fdopendir.c
lib/filemode.c
lib/filemode.h
lib/fpending.c
lib/fpending.h
+ lib/fstatat.c
lib/ftoastr.c
lib/ftoastr.h
lib/getgroups.c
@@ 689,11 +759,15 @@
lib/md5.h
lib/mktimeinternal.h
lib/mktime.c
+ lib/openatpriv.h
+ lib/openatproc.c
+ lib/openat.h
lib/pathmax.h
lib/pselect.c
lib/pthread_sigmask.c
lib/putenv.c
lib/readlink.c
+ lib/readlinkat.c
lib/rootuid.h
lib/sha1.c
lib/sha1.h
@@ 746,6 +820,7 @@
m4/cstrtod.m4
m4/clock_time.m4
m4/closestream.m4
+ m4/dirent_h.m4
m4/dup2.m4
m4/environ.m4
m4/euidaccess.m4
@@ 755,8 +830,10 @@
m4/faccessat.m4
m4/fcntlo.m4
m4/fcntl_h.m4
+ m4/fdopendir.m4
m4/filemode.m4
m4/fpending.m4
+ m4/fstatat.m4
m4/getgroups.m4
m4/getloadavg.m4
m4/getopt.m4
@@ 780,6 +857,7 @@
m4/pthread_sigmask.m4
m4/putenv.m4
m4/readlink.m4
+ m4/readlinkat.m4
m4/setenv.m4
m4/sha1.m4
m4/sha256.m4
=== added file 'm4/readlinkat.m4'
 m4/readlinkat.m4 19700101 00:00:00 +0000
+++ m4/readlinkat.m4 20130201 06:30:51 +0000
@@ 0,0 +1,19 @@
+# serial 3
+# See if we need to provide readlinkat replacement.
+
+dnl Copyright (C) 20092013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Written by Eric Blake.
+
+AC_DEFUN([gl_FUNC_READLINKAT],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_CHECK_FUNCS_ONCE([readlinkat])
+ if test $ac_cv_func_readlinkat = no; then
+ HAVE_READLINKAT=0
+ fi
+])
=== modified file 'nt/ChangeLog'
 nt/ChangeLog 20130128 14:41:08 +0000
+++ nt/ChangeLog 20130201 06:30:51 +0000
@@ 1,3 +1,9 @@
+20130201 Paul Eggert
+
+ Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
+ * inc/sys/stat.h (fstatat):
+ * inc/unistd.h (readlinkat): New decls.
+
20130128 Eli Zaretskii
* inc/dirent.h (opendir): Update prototype.
=== modified file 'nt/inc/sys/stat.h'
 nt/inc/sys/stat.h 20130102 16:13:04 +0000
+++ nt/inc/sys/stat.h 20130201 06:30:51 +0000
@@ 110,6 +110,7 @@
_CRTIMP int __cdecl __MINGW_NOTHROW chmod (const char*, int);
_CRTIMP int __cdecl __MINGW_NOTHROW stat (const char*, struct stat*);
_CRTIMP int __cdecl __MINGW_NOTHROW lstat (const char*, struct stat*);
+_CRTIMP int __cdecl __MINGW_NOTHROW fstatat (int, char const *,
+ struct stat *, int);
#endif /* INC_SYS_STAT_H_ */

=== modified file 'nt/inc/unistd.h'
 nt/inc/unistd.h 20130111 09:33:54 +0000
+++ nt/inc/unistd.h 20130201 06:30:51 +0000
@@ 12,6 +12,7 @@
and whose prototypes are usually found in unistd.h on POSIX
platforms. */
extern ssize_t readlink (const char *, char *, size_t);
+extern ssize_t readlinkat (int, const char *, char *, size_t);
extern int symlink (char const *, char const *);
extern int setpgid (pid_t, pid_t);
extern pid_t getpgrp (void);
=== modified file 'src/ChangeLog'
 src/ChangeLog 20130131 17:07:57 +0000
+++ src/ChangeLog 20130201 06:30:51 +0000
@@ 1,3 +1,34 @@
+20130201 Paul Eggert
+
+ Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
+ * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
+ * dired.c: Include .
+ (open_directory): New function, which uses open and fdopendir
+ rather than opendir. DOS_NT platforms still use opendir, though.
+ (directory_files_internal, file_name_completion): Use it.
+ (file_attributes): New function, with most of the old Ffile_attributes.
+ (directory_files_internal, Ffile_attributes): Use it.
+ (file_attributes, file_name_completion_stat): First arg is now fd,
+ not dir name. All uses changed. Use fstatat rather than lstat +
+ stat.
+ (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
+ * fileio.c: Include , .
+ (emacs_readlinkat): New function, with much of the old
+ Ffile_symlink_p, but with an fd argument for speed.
+ It uses readlinkat rather than careadlinkatcwd, so that it
+ need not assume the working directory.
+ (Ffile_symlink_p): Use it.
+ * filelock.c (current_lock_owner): Use emacs_readlinkat
+ rather than emacs_readlink.
+ * lisp.h (emacs_readlinkat): New decl.
+ (READLINK_BUFSIZE, emacs_readlink): Remove.
+ * sysdep.c: Do not include , .
+ (emacs_norealloc_allocator, emacs_readlink): Remove.
+ This stuff is moved to fileio.c.
+ * w32.c (fstatat, readlinkat): New functions.
+ (careadlinkat): Don't check that fd == AT_FDCWD.
+ (careadlinkatcwd): Remove; no longer needed.
+
20130131 Glenn Morris
* fileio.c (choose_write_coding_system): Make it callable from Lisp.
=== modified file 'src/conf_post.h'
 src/conf_post.h 20130102 16:13:04 +0000
+++ src/conf_post.h 20130201 06:30:51 +0000
@@ 182,10 +182,6 @@
#endif
#endif
/* Tell gnulib to omit support for openatrelated functions having a
 first argument other than AT_FDCWD. */
#define GNULIB_SUPPORT_ONLY_AT_FDCWD

#include
#include
=== modified file 'src/dired.c'
 src/dired.c 20130117 06:29:40 +0000
+++ src/dired.c 20130201 06:30:51 +0000
@@ 30,6 +30,7 @@
#include
#include
+#include
#include
#include
@@ 54,6 +55,7 @@
static Lisp_Object Qfile_attributes_lessp;
static ptrdiff_t scmp (const char *, const char *, ptrdiff_t);
+static Lisp_Object file_attributes (int, char const *, Lisp_Object);
/* Return the number of bytes in DP's name. */
static ptrdiff_t
@@ 66,6 +68,44 @@
#endif
}
+static DIR *
+open_directory (char const *name, int *fdp)
+{
+ DIR *d;
+ int fd, opendir_errno;
+
+ block_input ();
+
+#ifdef DOS_NT
+ /* Directories cannot be opened. The emulation assumes that any
+ file descriptor other than AT_FDCWD corresponds to the most
+ recently opened directory. This hack is good enough for Emacs. */
+ fd = 0;
+ d = opendir (name);
+ opendir_errno = errno;
+#else
+ fd = emacs_open (name, O_RDONLY  O_DIRECTORY, 0);
+ if (fd < 0)
+ {
+ opendir_errno = errno;
+ d = 0;
+ }
+ else
+ {
+ d = fdopendir (fd);
+ opendir_errno = errno;
+ if (! d)
+ close (fd);
+ }
+#endif
+
+ unblock_input ();
+
+ *fdp = fd;
+ errno = opendir_errno;
+ return d;
+}
+
#ifdef WINDOWSNT
Lisp_Object
directory_files_internal_w32_unwind (Lisp_Object arg)
@@ 96,6 +136,7 @@
Lisp_Object id_format)
{
DIR *d;
+ int fd;
ptrdiff_t directory_nbytes;
Lisp_Object list, dirfilename, encoded_directory;
struct re_pattern_buffer *bufp = NULL;
@@ 142,9 +183,7 @@
/* Now *bufp is the compiled form of MATCH; don't call anything
which might compile a new regexp until we're done with the loop! */
 block_input ();
 d = opendir (SSDATA (dirfilename));
 unblock_input ();
+ d = open_directory (SSDATA (dirfilename), &fd);
if (d == NULL)
report_file_error ("Opening directory", Fcons (directory, Qnil));
@@ 259,20 +298,9 @@
if (attrs)
{
 /* Construct an expanded filename for the directory entry.
 Use the decoded names for input to Ffile_attributes. */
 Lisp_Object decoded_fullname, fileattrs;
 struct gcpro gcpro1, gcpro2;

 decoded_fullname = fileattrs = Qnil;
 GCPRO2 (decoded_fullname, fileattrs);

 /* Both Fexpand_file_name and Ffile_attributes can GC. */
 decoded_fullname = Fexpand_file_name (name, directory);
 fileattrs = Ffile_attributes (decoded_fullname, id_format);

+ Lisp_Object fileattrs
+ = file_attributes (fd, dp>d_name, id_format);
list = Fcons (Fcons (finalname, fileattrs), list);
 UNGCPRO;
}
else
list = Fcons (finalname, list);
@@ 413,8 +441,7 @@
return file_name_completion (file, directory, 1, Qnil);
}
static int file_name_completion_stat (Lisp_Object dirname, struct dirent *dp,
 struct stat *st_addr);
+static int file_name_completion_stat (int, struct dirent *, struct stat *);
static Lisp_Object Qdefault_directory;
static Lisp_Object
@@ 422,6 +449,7 @@
Lisp_Object predicate)
{
DIR *d;
+ int fd;
ptrdiff_t bestmatchsize = 0;
int matchcount = 0;
/* If ALL_FLAG is 1, BESTMATCH is the list of all matches, decoded.
@@ 458,9 +486,7 @@
encoded_dir = ENCODE_FILE (dirname);
 block_input ();
 d = opendir (SSDATA (Fdirectory_file_name (encoded_dir)));
 unblock_input ();
+ d = open_directory (SSDATA (Fdirectory_file_name (encoded_dir)), &fd);
if (!d)
report_file_error ("Opening directory", Fcons (dirname, Qnil));
@@ 495,7 +521,7 @@
SCHARS (encoded_file)))
continue;
 if (file_name_completion_stat (encoded_dir, dp, &st) < 0)
+ if (file_name_completion_stat (fd, dp, &st) < 0)
continue;
directoryp = S_ISDIR (st.st_mode) != 0;
@@ 772,14 +798,9 @@
}
static int
file_name_completion_stat (Lisp_Object dirname, struct dirent *dp,
 struct stat *st_addr)
+file_name_completion_stat (int fd, struct dirent *dp, struct stat *st_addr)
{
 ptrdiff_t len = dirent_namelen (dp);
 ptrdiff_t pos = SCHARS (dirname);
int value;
 USE_SAFE_ALLOCA;
 char *fullname = SAFE_ALLOCA (len + pos + 2);
#ifdef MSDOS
/* Some fields of struct stat are *very* expensive to compute on MSDOS,
@@ 792,23 +813,15 @@
_djstat_flags = _STAT_INODE  _STAT_EXEC_MAGIC  _STAT_DIRSIZE;
#endif /* MSDOS */
 memcpy (fullname, SDATA (dirname), pos);
 if (!IS_DIRECTORY_SEP (fullname[pos  1]))
 fullname[pos++] = DIRECTORY_SEP;

 memcpy (fullname + pos, dp>d_name, len);
 fullname[pos + len] = 0;

/* We want to return success if a link points to a nonexistent file,
but we want to return the status for what the link points to,
in case it is a directory. */
 value = lstat (fullname, st_addr);
+ value = fstatat (fd, dp>d_name, st_addr, AT_SYMLINK_NOFOLLOW);
if (value == 0 && S_ISLNK (st_addr>st_mode))
 stat (fullname, st_addr);
+ fstatat (fd, dp>d_name, st_addr, 0);
#ifdef MSDOS
_djstat_flags = save_djstat_flags;
#endif /* MSDOS */
 SAFE_FREE ();
return value;
}
@@ 886,18 +899,8 @@
so last access time will always be midnight of that day. */)
(Lisp_Object filename, Lisp_Object id_format)
{
 Lisp_Object values[12];
Lisp_Object encoded;
 struct stat s;
 int lstat_result;

 /* An array to hold the mode string generated by filemodestring,
 including its terminating space and null byte. */
 char modes[sizeof "rwxrxrx "];

Lisp_Object handler;
 struct gcpro gcpro1;
 char *uname = NULL, *gname = NULL;
filename = Fexpand_file_name (filename, Qnil);
@@ 913,9 +916,22 @@
return call3 (handler, Qfile_attributes, filename, id_format);
}
 GCPRO1 (filename);
encoded = ENCODE_FILE (filename);
 UNGCPRO;
+ return file_attributes (AT_FDCWD, SSDATA (encoded), id_format);
+}
+
+static Lisp_Object
+file_attributes (int fd, char const *name, Lisp_Object id_format)
+{
+ Lisp_Object values[12];
+ struct stat s;
+ int lstat_result;
+
+ /* An array to hold the mode string generated by filemodestring,
+ including its terminating space and null byte. */
+ char modes[sizeof "rwxrxrx "];
+
+ char *uname = NULL, *gname = NULL;
#ifdef WINDOWSNT
/* We usually don't request accurate owner and group info, because
@@ 925,7 +941,7 @@
w32_stat_get_owner_group = 1;
#endif
 lstat_result = lstat (SSDATA (encoded), &s);
+ lstat_result = fstatat (fd, name, &s, AT_SYMLINK_NOFOLLOW);
#ifdef WINDOWSNT
w32_stat_get_owner_group = 0;
@@ 934,7 +950,7 @@
if (lstat_result < 0)
return Qnil;
 values[0] = (S_ISLNK (s.st_mode) ? Ffile_symlink_p (filename)
+ values[0] = (S_ISLNK (s.st_mode) ? emacs_readlinkat (fd, name)
: S_ISDIR (s.st_mode) ? Qt : Qnil);
values[1] = make_number (s.st_nlink);
=== modified file 'src/fileio.c'
 src/fileio.c 20130131 16:53:37 +0000
+++ src/fileio.c 20130201 06:30:51 +0000
@@ 82,6 +82,8 @@
#endif
#include "systime.h"
+#include
+#include
#include
#ifdef HPUX
@@ 2759,6 +2761,29 @@
return Qnil;
}
+/* Relative to directory FD, return the symbolic link value of FILENAME.
+ On failure, return nil. */
+Lisp_Object
+emacs_readlinkat (int fd, char const *filename)
+{
+ static struct allocator const emacs_norealloc_allocator =
+ { xmalloc, NULL, xfree, memory_full };
+ Lisp_Object val;
+ char readlink_buf[1024];
+ char *buf = careadlinkat (fd, filename, readlink_buf, sizeof readlink_buf,
+ &emacs_norealloc_allocator, readlinkat);
+ if (!buf)
+ return Qnil;
+
+ val = build_string (buf);
+ if (buf[0] == '/' && strchr (buf, ':'))
+ val = concat2 (build_string ("/:"), val);
+ if (buf != readlink_buf)
+ xfree (buf);
+ val = DECODE_FILE (val);
+ return val;
+}
+
DEFUN ("filesymlinkp", Ffile_symlink_p, Sfile_symlink_p, 1, 1, 0,
doc: /* Return nonnil if file FILENAME is the name of a symbolic link.
The value is the link target, as a string.
@@ 2769,9 +2794,6 @@
(Lisp_Object filename)
{
Lisp_Object handler;
 char *buf;
 Lisp_Object val;
 char readlink_buf[READLINK_BUFSIZE];
CHECK_STRING (filename);
filename = Fexpand_file_name (filename, Qnil);
@@ 2784,17 +2806,7 @@
filename = ENCODE_FILE (filename);
 buf = emacs_readlink (SSDATA (filename), readlink_buf);
 if (! buf)
 return Qnil;

 val = build_string (buf);
 if (buf[0] == '/' && strchr (buf, ':'))
 val = concat2 (build_string ("/:"), val);
 if (buf != readlink_buf)
 xfree (buf);
 val = DECODE_FILE (val);
 return val;
+ return emacs_readlinkat (AT_FDCWD, SSDATA (filename));
}
DEFUN ("filedirectoryp", Ffile_directory_p, Sfile_directory_p, 1, 1, 0,
=== modified file 'src/filelock.c'
 src/filelock.c 20130101 09:11:05 +0000
+++ src/filelock.c 20130201 06:30:51 +0000
@@ 390,12 +390,14 @@
lock_info_type local_owner;
intmax_t n;
char *at, *dot, *colon;
 char readlink_buf[READLINK_BUFSIZE];
 char *lfinfo = emacs_readlink (lfname, readlink_buf);
+ Lisp_Object lfinfo_object = emacs_readlinkat (AT_FDCWD, lfname);
+ char *lfinfo;
+ struct gcpro gcpro1;
/* If nonexistent lock file, all is well; otherwise, got strange error. */
 if (!lfinfo)
+ if (NILP (lfinfo_object))
return errno == ENOENT ? 0 : 1;
+ lfinfo = SSDATA (lfinfo_object);
/* Even if the caller doesn't want the owner info, we still have to
read it to determine return value. */
@@ 407,12 +409,9 @@
at = strrchr (lfinfo, '@');
dot = strrchr (lfinfo, '.');
if (!at  !dot)
 {
 if (lfinfo != readlink_buf)
 xfree (lfinfo);
 return 1;
 }
+ return 1;
len = at  lfinfo;
+ GCPRO1 (lfinfo_object);
owner>user = xmalloc (len + 1);
memcpy (owner>user, lfinfo, len);
owner>user[len] = 0;
@@ 445,8 +444,7 @@
owner>host[len] = 0;
/* We're done looking at the link info. */
 if (lfinfo != readlink_buf)
 xfree (lfinfo);
+ UNGCPRO;
/* On current host? */
if (STRINGP (Fsystem_name ())
=== modified file 'src/lisp.h'
 src/lisp.h 20130125 17:13:31 +0000
+++ src/lisp.h 20130201 06:30:51 +0000
@@ 3294,6 +3294,7 @@
extern Lisp_Object restore_point_unwind (Lisp_Object);
extern _Noreturn void report_file_error (const char *, Lisp_Object);
extern bool internal_delete_file (Lisp_Object);
+extern Lisp_Object emacs_readlinkat (int, const char *);
extern bool file_directory_p (const char *);
extern bool file_accessible_directory_p (const char *);
extern void init_fileio (void);
@@ 3566,8 +3567,6 @@
extern int emacs_close (int);
extern ptrdiff_t emacs_read (int, char *, ptrdiff_t);
extern ptrdiff_t emacs_write (int, const char *, ptrdiff_t);
enum { READLINK_BUFSIZE = 1024 };
extern char *emacs_readlink (const char *, char [READLINK_BUFSIZE]);
extern void unlock_all_files (void);
extern void lock_file (Lisp_Object);
=== modified file 'src/sysdep.c'
 src/sysdep.c 20130113 20:03:01 +0000
+++ src/sysdep.c 20130201 06:30:51 +0000
@@ 30,9 +30,7 @@
#include
#include
#include
#include
#include
#include
#include
@@ 2247,22 +2245,6 @@
return (bytes_written);
}

static struct allocator const emacs_norealloc_allocator =
 { xmalloc, NULL, xfree, memory_full };

/* Get the symbolic link value of FILENAME. Return a pointer to a
 NULterminated string. If readlink fails, return NULL and set
 errno. If the value fits in INITIAL_BUF, return INITIAL_BUF.
 Otherwise, allocate memory and return a pointer to that memory. If
 memory allocation fails, diagnose and fail without returning. If
 successful, store the length of the symbolic link into *LINKLEN. */
char *
emacs_readlink (char const *filename, char initial_buf[READLINK_BUFSIZE])
{
 return careadlinkat (AT_FDCWD, filename, initial_buf, READLINK_BUFSIZE,
 &emacs_norealloc_allocator, careadlinkatcwd);
}
/* Return a struct timeval that is roughly equivalent to T.
Use the least timeval not less than T.
=== modified file 'src/w32.c'
 src/w32.c 20130130 08:07:37 +0000
+++ src/w32.c 20130201 06:30:51 +0000
@@ 4274,6 +4274,30 @@
return stat_worker (path, buf, 0);
}
+int
+fstatat (int fd, char const *name, struct stat *st, int flags)
+{
+ /* Rely on a hack: an open directory is modeled as file descriptor 0.
+ This is good enough for the current usage in Emacs, but is fragile.
+
+ FIXME: Add proper support for fdopendir, fstatatat, readlinkat.
+ Gnulib does this and can serve as a model. */
+ char fullname[MAX_PATH];
+
+ if (fd != AT_FDCWD)
+ {
+ if (_snprintf (fullname, sizeof fullname, "%s/%s", dir_pathname, name)
+ < 0)
+ {
+ errno = ENAMETOOLONG;
+ return 1;
+ }
+ name = fullname;
+ }
+
+ return stat_worker (name, st, ! (flags & AT_SYMLINK_NOFOLLOW));
+}
+
/* Provide fstat and utime as well as stat for consistent handling of
file timestamps. */
int
@@ 4816,6 +4840,28 @@
return retval;
}
+ssize_t
+readlinkat (int fd, char const *name, char *buffer,
+ size_t buffer_size)
+{
+ /* Rely on a hack: an open directory is modeled as file descriptor 0,
+ as in fstatat. FIXME: Add proper support for readlinkat. */
+ char fullname[MAX_PATH];
+
+ if (fd != AT_FDCWD)
+ {
+ if (_snprintf (fullname, sizeof fullname, "%s/%s", dir_pathname, name)
+ < 0)
+ {
+ errno = ENAMETOOLONG;
+ return 1;
+ }
+ name = fullname;
+ }
+
+ return readlink (name, buffer, buffer_size);
+}
+
/* If FILE is a symlink, return its target (stored in a static
buffer); otherwise return FILE.
@@ 5168,12 +5214,6 @@
char linkname[MAX_PATH];
ssize_t link_size;
 if (fd != AT_FDCWD)
 {
 errno = EINVAL;
 return NULL;
 }

link_size = preadlinkat (fd, filename, linkname, sizeof(linkname));
if (link_size > 0)
@@ 5191,14 +5231,6 @@
return NULL;
}
ssize_t
careadlinkatcwd (int fd, char const *filename, char *buffer,
 size_t buffer_size)
{
 (void) fd;
 return readlink (filename, buffer, buffer_size);
}

/* Support for browsing other processes and their attributes. See
process.c for the Lisp bindings. */

revno: 111645
committer: Glenn Morris
branch nick: trunk
timestamp: Thu 20130131 20:04:23 0800
message:
Remove info duplicated from manual; convert to outline mode format.
diff:
=== modified file 'etc/CALCNEWS'
 etc/CALCNEWS 20130201 03:58:50 +0000
+++ etc/CALCNEWS 20130201 04:04:23 +0000
@@ 3,9 +3,7 @@
Calc is an advanced desk calculator for GNU Emacs.
"Calc" Copyright (C) 19901993, 20012013 Free Software Foundation, Inc.

Written by:
+Originally written by:
Dave Gillespie
c/o Synaptics, Inc.
2698 Orchard Parkway
@@ 15,53 +13,13 @@
Currently maintained by:
Jay Belanger
From the introduction to the manual:

 "Calc" is an advanced calculator and mathematical tool that runs as
 part of the GNU Emacs environment. Very roughly based on the HP28/48
 series of calculators, its many features include:

 * Choice of algebraic or RPN (stackbased) entry of calculations.

 * Arbitrary precision integers and floatingpoint numbers.

 * Arithmetic on rational numbers, complex numbers (rectangular and
 polar), error forms with standard deviations, open and closed
 intervals, vectors and matrices, dates and times, infinities,
 sets, quantities with units, and algebraic formulas.

 * Mathematical operations such as logarithms and trigonometric functions.

 * Programmer's features (bitwise operations, nondecimal numbers).

 * Financial functions such as future value and internal rate of return.

 * Number theoretical features such as prime factorization and
 arithmetic modulo M for any M.

 * Algebraic manipulation features, including symbolic calculus.

 * Moving data to and from regular editing buffers.

 * "Embedded mode" for manipulating Calc formulas and data directly
 inside any editing buffer.

 * Graphics using GNUPLOT, a versatile (and free) plotting program.

 * Easy programming using keyboard macros, algebraic formulas,
 algebraic rewrite rules, or extended Emacs Lisp.


Calc is written entirely in Emacs Lisp, for maximum portability.

I am anxious to hear about your experiences using Calc. Send mail to
"jay.p.belanger@gmail.com". A bug report is most useful if you include the
exact input and output that occurred, any modes in effect (such as the
current precision), and so on. If you find Calc is difficult to operate
in any way, or if you have other suggestions, don't hesitate to let me
know. If you find errors (including simple typos) in the manual, let
me know. Even if you find no bugs at all I would love to hear your
opinions.
+know. If you find errors (including simple typos) in the manual, let me
+know. Even if you find no bugs at all I would love to hear your opinions.
Summary of changes to "Calc"
@@ 69,1125 +27,1125 @@
For changes in Emacs 23.1 and later, see the main Emacs NEWS file.
Version 2.1:
+* Version 2.1:
* New matrix mode for square matrices. Improved handling of
+** New matrix mode for square matrices. Improved handling of
noncommutative products.
* New functions: powerexpand and ldiv.

* Added new functions: sec, csc, cot, sech, csch, coth.

* 0^0 now evaluates to 1.

* Added a new language mode for LaTeX.

* Calc now tries to use an appropriate language mode in embedded mode.

* Calc now restores original modes when leaving embedded mode.

* User settable variables which are not set with keystrokes are now
+** New functions: powerexpand and ldiv.
+
+** Added new functions: sec, csc, cot, sech, csch, coth.
+
+** 0^0 now evaluates to 1.
+
+** Added a new language mode for LaTeX.
+
+** Calc now tries to use an appropriate language mode in embedded mode.
+
+** Calc now restores original modes when leaving embedded mode.
+
+** User settable variables which are not set with keystrokes are now
customizable.
* Made ~/.calc.el the default Calc settings file.

* Miscellaneous updates and bugfixes.


Version 2.02f:

 * Fixed a bug which broke `I', `H', `K' prefix keys in recent Emacs.

 * Fixed a bug in calc.texinfo which prevented "make tex2" from working.

 * Updated `Cy' (calcyank) to understand Emacs 19 generalized kill ring.

 * Added a copy of "calccard.tex", the Calc quick reference card.


Version 2.02e:

 * Fixed an installation bug caused by recent changes to `writeregion'.


Version 2.02d:

 * Fixed a minor installation problem with a Emacs 19.29 bytecompiler bug.

 * Removed archaic "macedit" package (superseded by "edmacro").


Version 2.02c:

 * Patch to port Calc to Lucid Emacs 19; still works with GNU 18 and GNU 19.

 * Fixed a bug that broke `Cx Cc' after Calc graphics had been used.


Version 2.02b:

 * Minor patch to port Calc to GNU Emacs 19. Will be superseded by Calc 3.00.


Version 2.02:

 * Revamped the manual a bit; rearranged some sections.

 * Added marginal notes for Key/Function Index refs in printed manual.

 * Changed `M# r' to deal more gracefully with blank lines.

 * Made reductions like `V R +' and `M# :' considerably faster.

 * Improved parsing and display of cases like "[a + b]".

 * Added `t +' and `t ' for doing business date arithmetic.

 * Added "syntax tables," the opposite of compositions.

 * Added another Rewrites Tutorial exercise.

 * Added the "vmatches" function.

 * Added the `Modes' variable and `m g' command.

 * Improved `u s' to cancel, e.g., "11 mph hr / yd" to get a number.

 * Added "quick units" commands "u 0" through "u 9".

 * Moved `M%' to calc.el to avoid autoloading problems.

 * Added `M=' during algebraic entry, acts like `RET ='.

 * Made `LFD' prevent evaluation when finishing a calcedit command.

 * Changed calcstore commands to use `t .' mode for trail display.

 * Improved integrator to understand forms involving "erf".

 * Fixed parser to make sense of "[1....1e2]" input.

 * Fixed FORTRAN parser to treat a(i,j) as a_i_j if a is declared matrix.

 * Got rid of some version number stamps to reduce size of patches.

 * Fixed a bug in defmath treating "<=" and ">=" predicates.

 * Fixed a bug in which Calc crashed multiplying two date forms.

 * Fixed a bug in line breaker that crashed for large, nested formulas.

 * Fixed a bug using ` to edit string("foo").

 * Fixed a bug where `M# y' in Big mode copied stack level number.

 * Fixed a bug where `g O' used wrong default directory, no completion.

 * Fixed a bug where "foo_bar(i)" parsed in C mode but showed as foo#bar.

 * Fixed several bugs where large calculations got "computation too long."


Version 2.01:

 * Added percentage commands `M%', `b %', and `c %'.

 * Changed Big mode to force radix10 in superscripts.

 * Improved display of fractions in various language modes.

 * Changed `a n' to work properly with equations and inequalities.

 * The problem with cross references to Index nodes in TeX has been fixed.

 * Fixed a bug where recursive escmaps make calcext/aent unloadable.

 * Fixed a bug in `M# k', then `OFF' right away, with fresh Emacs.

 * Fixed a bug in which "S_i_j" was formatted wrong after `j s'.

 * Fixed a bug in which `h k u c' positioned cursor on wrong line.

 * Fixed a bug where `z ?' crashed if `z %' was defined.

 * Fixed a bug in `j O' (calcselectoncemaybe).

 * Fixed "make private" not to ask "Delete excess versions" and crash.


Version 2.00:

 * First complete posting of Calc since 1.01.

 * Most parts of Calc have seen changes since version 1.07. See
+** Made ~/.calc.el the default Calc settings file.
+
+** Miscellaneous updates and bugfixes.
+
+
+* Version 2.02f:
+
+** Fixed a bug which broke `I', `H', `K' prefix keys in recent Emacs.
+
+** Fixed a bug in calc.texinfo which prevented "make tex2" from working.
+
+** Updated `Cy' (calcyank) to understand Emacs 19 generalized kill ring.
+
+** Added a copy of "calccard.tex", the Calc quick reference card.
+
+
+* Version 2.02e:
+
+** Fixed an installation bug caused by recent changes to `writeregion'.
+
+
+* Version 2.02d:
+
+** Fixed a minor installation problem with a Emacs 19.29 bytecompiler bug.
+
+** Removed archaic "macedit" package (superseded by "edmacro").
+
+
+* Version 2.02c:
+
+** Patch to port Calc to Lucid Emacs 19; still works with GNU 18 and GNU 19.
+
+** Fixed a bug that broke `Cx Cc' after Calc graphics had been used.
+
+
+* Version 2.02b:
+
+** Minor patch to port Calc to GNU Emacs 19. Will be superseded by Calc 3.00.
+
+
+* Version 2.02:
+
+** Revamped the manual a bit; rearranged some sections.
+
+** Added marginal notes for Key/Function Index refs in printed manual.
+
+** Changed `M# r' to deal more gracefully with blank lines.
+
+** Made reductions like `V R +' and `M# :' considerably faster.
+
+** Improved parsing and display of cases like "[a + b]".
+
+** Added `t +' and `t ' for doing business date arithmetic.
+
+** Added "syntax tables," the opposite of compositions.
+
+** Added another Rewrites Tutorial exercise.
+
+** Added the "vmatches" function.
+
+** Added the `Modes' variable and `m g' command.
+
+** Improved `u s' to cancel, e.g., "11 mph hr / yd" to get a number.
+
+** Added "quick units" commands "u 0" through "u 9".
+
+** Moved `M%' to calc.el to avoid autoloading problems.
+
+** Added `M=' during algebraic entry, acts like `RET ='.
+
+** Made `LFD' prevent evaluation when finishing a calcedit command.
+
+** Changed calcstore commands to use `t .' mode for trail display.
+
+** Improved integrator to understand forms involving "erf".
+
+** Fixed parser to make sense of "[1....1e2]" input.
+
+** Fixed FORTRAN parser to treat a(i,j) as a_i_j if a is declared matrix.
+
+** Got rid of some version number stamps to reduce size of patches.
+
+** Fixed a bug in defmath treating "<=" and ">=" predicates.
+
+** Fixed a bug in which Calc crashed multiplying two date forms.
+
+** Fixed a bug in line breaker that crashed for large, nested formulas.
+
+** Fixed a bug using ` to edit string("foo").
+
+** Fixed a bug where `M# y' in Big mode copied stack level number.
+
+** Fixed a bug where `g O' used wrong default directory, no completion.
+
+** Fixed a bug where "foo_bar(i)" parsed in C mode but showed as foo#bar.
+
+** Fixed several bugs where large calculations got "computation too long."
+
+
+* Version 2.01:
+
+** Added percentage commands `M%', `b %', and `c %'.
+
+** Changed Big mode to force radix10 in superscripts.
+
+** Improved display of fractions in various language modes.
+
+** Changed `a n' to work properly with equations and inequalities.
+
+** The problem with cross references to Index nodes in TeX has been fixed.
+
+** Fixed a bug where recursive escmaps make calcext/aent unloadable.
+
+** Fixed a bug in `M# k', then `OFF' right away, with fresh Emacs.
+
+** Fixed a bug in which "S_i_j" was formatted wrong after `j s'.
+
+** Fixed a bug in which `h k u c' positioned cursor on wrong line.
+
+** Fixed a bug where `z ?' crashed if `z %' was defined.
+
+** Fixed a bug in `j O' (calcselectoncemaybe).
+
+** Fixed "make private" not to ask "Delete excess versions" and crash.
+
+
+* Version 2.00:
+
+** First complete posting of Calc since 1.01.
+
+** Most parts of Calc have seen changes since version 1.07. See
section "New for Calc 2.00" in the manual for a summary.
 * Changed to compile calcmacs/maint, to allow "cp *.elc newdir".

 * Improved calcdescribebindings to avoid showing redundant ESC maps.


Version 2.00 beta 3:

 * Removed version numbers from most .el files to reduce size of patches.

 * Added a "calcversion" command.

 * Changed `M# ? ?' to allow for modified describefunction.

 * Changed date parser to accept "Sept" as an alternative for "Sep".

 * Inhibited answers to exercise from showing up in table of contents.

 * Changed Makefile to say "texindex calc.[cfkptv]?" to avoid "calc.el".

 * Fixed up the Makefile in various other ways.

 * Rearranged banner at top of `h h' command's output.

 * Changed "make summary" to print "Calc Summary" on the title page.

 * Added "IntegSimpRules".

 * Added `M# :', `M# _', and `M# Z' options.

 * Changed `^' to evaluate "[3..1]^2" properly.

 * Improved `f g' to give symbolic answers for, e.g., 101:2 and 3:2.

 * Fixed a bug where `h k RET' didn't find the right place on the page.

 * Fixed a bug that formatted "x*(y ? a : b)" as "x y ? a : b".

 * Fixed a bug where defmath translated (< x 0) as (mathposp x)!

 * Fixed a bug that prevented quickcalc from working sometimes.

 * Fixed the `z ?' bug again (maybe this time for good?).

 * Fixed a bug in which `V ^' (vint) was just plain wrong, wrong, wrong!

 * Scanned for and fixed remaining bugs relating to autoloading.


Version 2.00 beta 2:

 * Changed "make info" to try "make texinfo" if "makeinfo" not found.

 * Changed to "New for Calc 2.00"; texinfo.tex chokes on apostrophes.

 * Added List Tutorial Exercise 14 (just in case there weren't enough!).

 * Added a discussion of the `Z F' command to the Programming Tutorial.

 * Improved `H a f' not to lose info if input is partially prefactored.

 * Improved simplification of expressions like sqrt(3) + 3^3:2.

 * Changed Big mode to omit "*" in expressions like 2 sqrt(3) 5^3:4.

 * Replaced European date format D/M/Y with D.M.Y.

 * Changed `a N' and `a X' to consider the endpoints of the interval.

 * Fixed a bug where TeX mode made c*(1+a/b) look like a function call.

 * Fixed a bug formatting toplevel evalto's while using selections.

 * Fixed a bug that caused `z ?' to crash.

 * Fixed a bug where `Z F' broke for argument names "t" and "nil".

 * Fixed several bugs relating to autoloading.


Version 2.00 beta 1:

 * Added "What's new in Calc 2.00" to the manual (summary of info below).

 * Added support for many GNUPLOT 3.0 features.

 * Tweaked the Makefile and calccompile a bit more.

 * Modified to work with Zawinski's/Furuseth's optimizing byte compiler.

 * Modified Calc to garbagecollect less often (raised gcconsthreshold).

 * Changed quickcalc to avoid autoloading so many parts of Calc.

 * Changed Calc subfiles to work properly if not bytecompiled.

 * Renamed `M# s' to `M# j', made `M# s' be equivalent to `h s'.

 * Changed calcquit to avoid reapportioning space among other windows.

 * Added `MDEL' (calcpopabove) key, to DEL as LFD is to RET.

 * Added `{' and `}' to scroll vertically, analogous to `<' and `>'.

 * Added `m t' for "total" algebraic mode.

 * Added `d , \' option to group digits with "\,".

 * Improved support of "prime" accent in "eqn" language mode.

 * Changed macedit's readkbdmacro to accept a string argument in Lisp.

 * Changed calccheckdefines to use a more concise runhooks linkage.

 * Changed autowhy mode not to say [w=more] if next msg is not urgent.

 * Made `a d' able to differentiate "a?b:c" and "a_i" formulas.

 * Changed probability dist. functions to work with `a f' and `a d'.

 * Added special constants "phi" and "gamma".

 * Added "poly" function, simpler cousin of "gpoly".

 * Added "pdeg", "plead", "pcont", "pprim"; cleaned up "pdiv" and "pgcd".

 * Added `a p' command for polynomial interpolation.

 * Added `a I' command for numerical integration; made IntegLimit variable.

 * Added `a f' to factor polynomials; moved old `a f' to `a "'.

 * Added `a a' to do partial fraction decompositions.

 * Improved `a i' to integrate many more kinds of formulas.

 * Modified `a P' to find numerical roots of highdegree polynomials.

 * Modified `c 0' through `c 9' to convert intvalued floats to integers.

 * Made sinh, arctanh, etc., expandable into exps/logs by `a f'.

 * Added more algebraic simplifications having to do with logs and exps.

 * Changed `s s', `s t', `s x', `s l' to accept an equation at prompt.

 * Changed `s i' not to store Decls if its value is the default, [].

 * Changed `s i' to store in `d O' language mode if in Normal or Big mode.

 * Rearranged `V M'/`V R' matrix mapping modes.

 * Added <#1+#2> notation for lambda expressions.

 * Extended `b l' and other binary shifts to have a 2argument version.

 * Changed `u c' and `u t' to give unitless result for unitless input.

 * Changed sqrt(1cos(x)^2)tosin(x) to be an unsafe simplification.

 * Improved simplification of sqrts, e.g., sqrt(a^2 x + a^2 y).

 * Changed solver to treat (xa)(xb)(xc) more intelligently.

 * Changed Pascal language mode to use "$FFFF" for hexadecimal numbers.

 * Added support for nondecimal display of floats.

 * Changed `p' to refresh stack display if current float format uses it.

 * Changed Big mode to use subscript notation for log10(x), log(x,b), r#nnn.

 * Changed Big mode to format deriv(u,x) and tderiv(u,x) as du/dx.

 * Changed Big mode to format integ(1/x,x) as "dx/x" instead of "1/x dx".

 * Added "tty" output type for graphics commands.

 * Documented Calc's random number generation algorithm in the manual.

 * Fixed a bug involving having "(setq calctiming t)" in .emacs.

 * Fixed a bug that incorrectly parsed "x  1" in TeX mode.

 * Fixed bugs and made improvements in `a R' when widening the guess.

 * Fixed a bug that where `a S' didn't solve (x  a)^2 = (x  b)^2.

 * Fixed a bug that sometimes crashed `a P' on systems of equations.

 * Fixed a bug that prevented `b p' (calcpackbits) from working.

 * Fixed some bugs in which certain functions didn't get autoloaded.

 * Fixed a bug in which the date <1/1/13> was incorrectly parsed.

 * Fixed a bug which prevented `j D' from expanding (a+b)/c.

 * Fixed a bug in solver: bad inverses for sinh and cosh.

 * Fixed a bug in mathpossiblesigns that failed for x*0.

 * Fixed a bug where sqrt(a) was rewritten sqrt(a)*i even if a<0.

 * Fixed a bug in line breaker when first "word" of line was too long.

 * Worked around a makeinfo bug that handled @end group/@group badly.


Version 2.00 alpha 3:

 * Changed logic for locating component .elc files to be even smarter.

 * Changed "make install" to "make compile"; added different "make install".

 * Improved "make compile" to check file dates and compile only when needed.

 * Made output of "make compile" in batch mode more compact and readable.

 * Replaced "Quick Overview" in manual with "Demonstration of Calc".

 * Changed to use keymaps for dispatching M# and h prefix keys.

 * Added TAGS target to the Calc Makefile.

 * Removed most doc strings from functions; new help commands are better.

 * Got rid of some crufty "fset" calls that were cluttering the code.

 * Split calcgrabregion into two functions, calcgrabregion/rectangle.

 * Swapped positions of stack and trail in fullcalckeypad display.

 * Improved linebreaking algorithm for displaying long formulas.

 * Improved display of control characters in vectors shown as strings.

 * Changed `d o' to allow fraction format to specify desired denominator.

 * Changed `M# y' to respect overwrite mode in target buffer.

 * Added `H' prefix to displaymode commands to suppress stack refresh.

 * Changed "calcwhy" mechanism to display urgent messages automatically.

 * Handled taking derivatives of symbolic integrals and viceversa.

 * Handled integrating vectors of formulas.

 * Incorporated Ewerlid's polynomial division and GCD functions into Calc.

 * Improved algebraic operations on "mod" forms, esp. polynomials.

 * Added some more financial functions (sln, syd, ddb).

 * Added nest, anest, fixp, and afixp (`H V R' and `H V U') functions.

 * Added `a .' (calcremoveequal) command to take apart equations.

 * Generalized dfact to work for negative odd integers; added !! syntax.

 * Changed `k f' to factor 1, 0, and negative integers.

 * Changed `u M', etc., to accept +/ and [ .. ] forms as distributions.

 * Changed `g q' to remove *Gnuplot Commands/Trail* window if present.

 * Added support for Francois Pinard's "dumb terminal" driver for GNUPLOT.

 * Added ":: remember" feature for rewrite rules.

 * Changed rewrites to let pattern "a*b" match "x/2" with a=x, b=1/2.

 * Added ability to put function names like "simplify" in rewrite schedule.

 * Added "Rewrites Tutorial" to the manual.

 * Changed ` to bind RET as newline instead of finish if editing a vector.

 * Added some new exercises to the List Tutorial.

 * Changed `Z F', `V M', etc. not to remove stored vars from def arg list.

 * Added parsing for /1, 2, 3/ notation for Fortran mode vectors.

 * Added a "%%" syntax for comments in formulas being read.

 * Fixed a bug in which failing `h k' removed an existing Info window.

 * Fixed a bug in `j /' operating on subformulas like "a + b".

 * Fixed a bug in which "inf = inf" undesirably evaluated to 1.

 * Fixed a bug that simplified "0 = 1 + a + 2" to "0 = a".

 * Fixed a bug that failed for rewrite patterns like "fib(1  2)".

 * Fixed a bug that arose because rewrite programs are nonreentrant.


Version 2.00 alpha 2:

 * Changed LFD terminating algebraic entry to push in nosimplify mode.

 * Changed so that `K ' interprets `' as calcminus, not neg prefix arg.

 * Improved `h c' command to understand all Calc key sequences.

 * Fixed problems with DistribRules, NegateRules, and FitRules.

 * Fixed several bad node pointers in the manual.

 * Fixed a bug in `h Cw' when used with makeinfoformatted manuals.

 * Fixed a bug in sqrt(1) when Polar and HMS modes are enabled.

 * Fixed/improved dscalar and deven functions; added dodd.

 * Fixed a bug in polynomial handling that also affected sum(sin(k),k,1,n).

 * Fixed various other glitches in the manual.


Version 2.00 alpha 1:

 * Calc's tar file now creates a calc(version) directory to unpack into.

 * Calc now comes with a Makefile; install with "make install".

 * Calc now comes already split into many files; installation is much simpler.

 * Changed base file name of the manual from "calcinfo" to "calc.info".

 * Key binding for `M# w' was documented but not implemented.

 * Bound M# ' to be synonymous with `M# f' (used to be `M# q').

 * Changed M# M# to use last interface of C or K; E no longer counts.

 * Changed `i' (and `M# i') not to return to Top node unnecessarily.

 * Changed `h' to be a prefix key with various help commands.

 * Changed `s' to be a prefix key with various store and recall commands.

 * Keys `i', `r', and `l' are obsolete (moved to `h' and `s' prefixes).

 * Rearranged `K', `X', and `MRET' keys; `K' is now calckeepargs.

 * Changed quickcalc to display input formula as well as output if room.

 * Changed quickcalc to interact with the editing buffer and kill ring.

 * Created pack, unpack, unpackt function equivalents of `v p', `v u'.

 * Changed to expand (a/b)^x to a^x/b^x only if b > 0 (not if a > 0).

 * Changed mathpossiblesigns to understand sqrt function.

 * Changed Z [, rewrites to consider any provably nonzero value as true.

 * Changed normal language modes to accept ** as a synonym for ^.

 * Added "maple" language mode.

 * Changed, e.g., Mathematica "(2 + 3 I)^(1.23*10^20)" to include parens.

 * Generalized mathcomposebig properties for all language modes.

 * Introduced "string" and other function for composing expressions.

 * Changed many recursive vector routines to use loops instead.

 * Added evalv, evalvn function equivalents to `=', `N'.

 * Changed "expr =>" not to evaluate at all if in nosimplify mode.

 * Redesigned user interface of `a F' (calccurvefit) command.

 * Added "phase" feature to the rewrite rule system.

 * Added "&&&", "", "!!!" to the rewrite rule system.

 * Introduced a new notation for rewrites: LHS := RHS :: COND.

 * Changed `a r' (but not `j r') to repeat 100 times by default.

 * Integrated EvalRules more cleanly into the default simplifications.

 * Added `H v l' [mdims] to measure the dimensions of a matrix.

 * Changed `u c' to interpret "/units" as "1/units".

 * Added `u a' to adjust unit prefix letters automatically.

 * Changed `u s' to enable scalar mode while simplifying.

 * Changed `c f' [pfloat] not to float integer powers or subscripts.

 * Added a threeargument form for the "hms" function.

 * Changed, e.g., sin(90) degrees to produce 1 instead of 1.0.

 * Changed symbolic mode to prefer sqrt(int): abs([1 2 3]) => sqrt(14).

 * Enhanced solver to handle, e.g., x + 1/x = a; exp(x) + exp(x) = a.

 * Enhanced simplifier to handle, e.g., exp(a+2) / e^a => e^2.

 * Enhanced `a s' to simplify sqrt(x)  x^1:2 and exp(x)  e^x to 0.

 * Added (a + b) to a  b as a default simplification.

 * Added rules for differentiating sum() and prod() functions.

 * Added a few more energy units (due to Przemek Klosowski).

 * Added overflow/underflow checking for all floatingpoint arithmetic.

 * Extended error forms to work with complex numbers.

 * Generalized GCD to handle fractional arguments.

 * Changed graphics routines to evaluate "x" values, e.g., [pi .. pi].

 * Added `g q', like `g K' but without viewing the Gnuplot Trail.

 * Changed `g p' and `V M' to display better "Working..." messages.

 * Modified `M# g' to be more robust about grabbing formulas.

 * Added `Y' prefix key reserved for userwritten extensions.

 * Added calcloadhook and calcextloadhook.

 * Prevented calcinstall from leaving large ~ files behind.

 * Changed @bullet to @bullet{} in manual to conform to texinfo spec.

 * Rearranged some chapters in the manual to be a bit more logical.

 * Added calcsplitsummary command.

 * Fixed several bugs in embedded mode.

 * Fixed a bug in calcvectorcovariance that required a prefix arg.

 * Fixed a bug that prevented parsing "a=>" with no righthand side.

 * Fixed a bug which allowed incorrectly dividing a vector by a vector.

 * Fixed a bug formatting sum(...)^2 in Big mode.

 * Fixed a bug that prevented Calc from deleting old graphics temp files.

 * Fixed some typos calling calcinversefunc instead of calcinvertfunc.

 * Fixed bugs in the derivatives of conj, deg, and rad; added re, im.

 * Fixed a bug where (r;theta) parsed as r exp(theta i) even in Deg mode.

 * Fixed a bug which gave wrong answer for exp of a polar complex number.

 * Fixed a bug in `Z F' that failed if formula used nonarg variables.

 * Fixed a bad pointer to Info node "Assignments in Embedded Mode".

 * Fixed several errors in the Calc Summary.


Version 1.08 beta 1:

 * Calc's copyright has been assigned to FSF, for inclusion in Emacs 19!

 * Changed M# to be a twokey sequence; use M# M# to start Calc now.

 * Rewrote and expanded the introductory chapter of the manual.

 * Added a key and function summary to the manual.

 * Changed the manual to take better advantage of TeX's math formatting.

 * Changed manual to be printable in @smallbook format.

 * Added "calcembedded" mode.

 * Added "=>" [evalto] operator.

 * Added facilities for date and date/time arithmetic.

 * Added a set of financial functions (pv, fv, etc.).

 * Added infinite quantities inf, uinf, and nan (plus infinite intervals).

 * Added "EvalRules", "SimpRules", and "ExtSimpRules" variables.

 * Added sum and product commands `a +', `a ', `a *', `a T'.

 * Enhanced `a S' and `a P' to solve systems of equations.

 * Enhanced solver to handle eqns like sin(x) = cos(2 x), sqrt(x) + x = 1.

 * Added `a M' (calcmapequation) command.

 * Added new statistical functions: mean, standard deviation, etc.

 * Added line, polynomial, and curve fitting commands (`a L' and `a F').

 * Added support for composite units, e.g., "mi+ft+in".

 * Enhanced "Big" mode to format square roots, choose, and powers better.

 * Enhanced "Big" mode to display fractions in large notation.

 * Added several alternate formats for matrix display.

 * Changed TeX mode to write "(1 + x^2)" instead of "\left(1 + x^2\right)".

 * Added support for relational operators in TeX and FORTRAN modes.

 * Added recognition of accents like \dot, \tilde, \underline in TeX mode.

 * Added "eqn" language mode.

 * Added extra control over display justification with `d <', `d =', `d >'.

 * Added calcleftlabel and calcrightlabel (`d {', `d }').

 * Added "nn%" syntax for algebraic formulas; equivalent to "nn * .01".

 * Added input syntaxes like a = b = c, a != b != c, a <= b < c.

 * Changed "_" to mean subscripts; old use of "_" in vars is now "#".

 * Introduced "matrix mode" and "scalar mode" (`m v').

 * Introduced generic identity matrices (idn(1)).

 * Added a method for declaring variables to be real, integer, > 0, etc.

 * Added `Z S' command for editing stored value of a variable.

 * Added "subst" algebraic function equivalent to the `a b' command.

 * Added `a f' command, changed deriv/integ/solvefor to use it.

 * Improved `a s' to simplify (x + y) (y + x) to (x + y)^2.

 * Improved `a s' to simplify i^2 to 1.

 * Improved `a s' to simplify, e.g., sin(pi/3) in Symbolic mode.

 * Improved `a s' to simplify sqrt(8) to 2 sqrt(2), 1/sqrt(2) to sqrt(2)/2.

 * Moved sin(arccos(x)) from `a e' to `a s'; not unsafe after all!

 * Changed (x y)^z => x^z y^z to be a usuallyunsafe simplification.

 * Added thorough documentation of `a s' and `a e' to the manual.

 * Improved `a c' to collect "f(a)" even if "a" also appears elsewhere.

 * Introduced lin, linnt, islin, islinnt functions for linearity testing.

 * Improved `a x' to use binomial theorem to give simpler answers.

 * Improved `j D' to distribute powers of sums: (a + b)^n.

 * Improved `j M' to merge products of powers (may need nosimplify mode).

 * Changed to use defvar for DistribRules etc. so `Z V' works with them.

 * Improved `j *' and `j /' to work properly in a few more cases.

 * Improved `V R' to use identity value when reducing empty vectors.

 * Improved `v p' and `v u' to support more complex packing operations.

 * Disabled automatic simplification of sqrt(2)/2 to 1/sqrt(2).

 * Bound SPC and RET to press, TAB to nextmenu in *Calc Keypad* buffer.

 * Added Cu ' to do algebraic entry with language mode forced to normal.

 * Added "$1", "$2", etc. input notation for algebraic entry.

 * Changed unary operators like `n', `&' to treat neg prefix args like RET.

 * Changed ` (calcedit) to show full precision regardless of float format.

 * Enhanced quickcalc to display integers in several formats.

 * Documented `g H' (calcgraphhide) command (had been left from manual).

 * Enhanced floor/ceil/trunc/round in several ways.

 * Added rounde and roundu functions.

 * Changed `c 1' through `c 9' to change small floats to 0.0; added `c 0'.

 * Enhanced set operations to work on sets of intervals.

 * Fixed erf(0), utpn(x,x,y), and arccosh(1) to work properly.

 * Changed complex arctan and arctanh to follow Steele 2nd edition.

 * Expanded "Branch Cuts" section of the manual with some useful tables.

 * Rearranged order of words in mode line to be a bit more logical.

 * Changed `m N' (numsimplify) mode to evaluate constant vectors, too.

 * Changed `a r'/`j r' to prompt twice for separate LHS/RHS if necessary.

 * Enhanced `let(v,x)' in rewrites by allowing arbitrary patterns for v.

 * Changed cursor positioning in second prompt for `a b' (calcsubstitute).

 * Changed `y' to omit line numbers more consistently.

 * Changed `o' (calcrealign) to reset horizontal scrolling to zero, also.

 * Added "pred" mode for calceval.

 * Added "calcreportbug" as an alias for "reportcalcbug".

 * Added `Z T' and "calcpasserrors" to aid debugging Calcrelated code.

 * Added "calcloadeverything" (`m X' or `M# L') command.

 * Enhanced calcinstall to prebuild units table, CommuteRules, etc.

 * Changed Calc to interact more gracefully with loadpath.

 * Changed Lisp Variable Index in manual to include user variables, too.

 * Fixed a bug that prevented calcinstall from working under VMS.

 * Fixed a bug that sometimes crashed rewrites dealing with subtractions.

 * Fixed a bug that prevented `a S' from solving "3  x = 1 + x"!

 * Fixed a bug in solver that crashed for certain cubics and quartics.

 * Fixed a bug in calcsimplify that crashed for equations and ineqs.

 * Fixed a bug which placed the "[" oddly in `d B' + `v /' mode.

 * Fixed a bug where finishing calcedit improperly obeyed language mode.

 * Fixed a bug formatting (1)^n in Big mode after selection commands.

 * Fixed a bug that got ">=" and "<=" backwards in rewrite conditions.

 * Fixed a bug that broke the `"x"' key in calckeypad mode.

 * Fixed a bug in which `MAP$' in calckeypad didn't display "Working...".

 * Fixed a bug where matrix division gave bad result for singular matrix.

 * Fixed a bug which closed Calc window if calcgrabregion got an error.

 * Fixed a bug where `a s' failed on formulas containing dimension errors.

 * Fixed a bug that caused `m F' to hang.

 * Fixed a bug in complex arithmetic that caused problems with solver.

 * Fixed a bug which raised intervals to interval powers incorrectly.

 * Fixed a bug in utpp/ltpp (order of arguments did not match the manual).

 * Fixed a bug in which `t y' rounded yanked data with old precision.

 * Fixed a bug in which "in(3, [3 .. 3))" returned true.

 * Fixed a bug which simplified abs(abs(x)) incorrectly.

 * Fixed a bug in which (a^2)^1:3 was unsafely simplified to a^2:3.

 * Fixed a bug in rewrite system which missed pattern "2 sin(x) cos(x)".

 * Fixed a bug in rewrite system which missed pattern "a  a cos(x)^2".

 * Fixed obsolete trail tags gsmp, gneg, ginv to jsmp, jneg, jinv.

 * Fixed some errors and made improvements in units table [Ulrich Mueller].


Version 1.07:

 * Added `m F' (calcsettingsfilename) command.

 * Added calcautoloaddirectory variable.

 * Extended Z ` to accept a prefix argument.

 * Added keystrokes (v h, v k) for head, tail, cons.

 * Extended `v e' to accept a vector as the filler.

 * Changed `V M', `V R' to accept mappingmode keys in uppercase, too.

 * Changed V M ' etc. to accept $, $$, ... as argument indicators.

 * Changed `t y' to accept a prefix argument.

 * Put in a cleaner and safer random number generator for `k r' et al.

 * Fixed a bug which completely broke `a r' command!

 * Fixed "0 * matrix" to generate a zero matrix instead of 0.

 * Fixed a bug in `a R' which sometimes caused it to crash.

 * Fixed a fatal typo in the TeX version of the manual.

 * Fixed a bug that prevented Ck, Cw, Mw from working in Trail buffer.

 * Fixed another bug in `Z P' command.

 * Fixed a bug in `u s' which incorrectly simplified subtractions.

 * Fixed an argumentname aliasing bug evaluating lambda( ) formulas.

 * Fixed overfull hboxes in the manual.

 * Fixed various other bugs in the manual.


Version 1.06:

 * Added "calckeypad" mode for X window system users (try it!).

 * Improved "calceval" for calling/operating Calc from userwritten Lisp.

 * Moved vector accumulate command to `V U' (old `H V R' still supported).

 * Added righttoleft reductions: `I V R' and `I V U'.

 * Added set operations on vectors: intersect, union, diff, xor.

 * Added `I v s' to remove a subvector from a vector.

 * Introduced `H ' to append two vectors with no magical special cases.

 * Introduced rhead, rtail, and rcons for isolating last vector element.

 * Changed `g p' to keep temp files around until data actually change.

 * Improved `a S' to solve many higherorder polynomial equations.

 * Added `a P' to produce a vector of all solutions to an equation.

 * Enhanced `a v' and `j v' to allow toplevelonly evaluation.

 * Changed `j DEL' to delete a side of an eqn or ineq, leaving other side.

 * Fixed binding for keys `j 1' through `j 9'.

 * Introduced "let" marker in rewrite rules.

 * Enhanced the "sign" function to provide a twoargument version.

 * Changed "maxspecpdlsize exceeded" error message to be userfriendly.

 * Put "" in the trail in above case and when user presses Cg.

 * Changed TeX mode to generate \ldots instead of \dots, recognize both.

 * Changed "sin(0)" etc. (for integer 0) to generate "0" instead of "0.".

 * Enhanced Programming Tutorial exercise 2.

 * Fixed an error in the answer to Types Tutorial exercise 3.

 * Fixed several bugs relating to head, tail, and cons functions.

 * Fixed some other minor typos in the manual.

 * Fixed several bugs in `Z P' (calcuserdefinepermanent).

 * Fixed several bugs that broke the `g P' command.


Version 1.05:

 * Created a calcinstall command to ease installation.

 * Added lots of exercises to the Tutorial section of the manual.

 * Added ability to select and operate on subformulas.

 * Substantially improved the algebraic rewriterule system.

 * Added a set of graphing commands that use GNUPLOT.

 * Added a command (`a R') for finding numerical roots to equations.

 * Added several new math functions, such as erf and Bessel functions.

 * Added key bindings for miscellaneous commands using the "f" prefix key.

 * Added lots of new vector operations, many of them in the spirit of APL.

 * Added more control over vector display, including an abbreviated mode.

 * Improved keyboard macro editing; added readkbdmacro to macedit.el.

 * Introduced the `m S' (calcshiftprefix) command.

 * Enhanced the calcedit command in several ways.

 * Made it possible to hit ` (calcedit) during numeric/algebraic entry.

 * Enhanced the calcsolvefor command to handle inequalities.

 * Enhanced calcsimplify to handle equations and inequalities.

 * Taught log10 and log to look for exact integer or rational results.

 * Added ability to take Nth roots directly.

 * Added "increment" and "decrement" commands for integers and floats.

 * Added "fullhelp" command, changed "h" key to invoke it.

 * Added special help for Inverse and Hyperbolic prefixes.

 * Added an optional prefix argument to `o' (calcrealign).

 * Changed `t s' and `t r' to use RET as the search exit key.

 * Made handling of operator keys for V M, V R, etc. more regular.

 * Improved TeX mode; added support for \matrix format.

 * Added a variant of `m a' mode that only affects ( and [ keys.

 * Fixed "Mismatch" message for algebraic entry of semiopen intervals.

 * Trimmed fat from calc.el to speed loading, moved more to calcext.el.

 * Fixed a bug in which minibuffer entry rounded to outofdate precision.

 * Fixed a bug which crashed Calc 1.04 under Epoch.

 * Fixed a bug which messed up Calc Trail's mode line, among other things.

 * Fixed a bug which caused trail ">" to show only when in Trail buffer.

 * Fixed a bug in which "calc" called "calcgrabregion" with too few args.

 * Fixed bugs in both implementation and documentation of calcperm.

 * Fixed a bug in which calcsimplifyextended always used radians.

 * Fixed a bug where calccomma failed to override "polar" mode.

 * Fixed a bug doing mixed arithmetic on rectangular+polar complex numbers.

 * Fixed several bugs in transcendental functions with complex arguments.

 * Fixed a bug in which `a s' simplified "x / .5" to ".5 x".

 * Fixed numerous other bugs in various parts of Calc.

 * Completed the "Hooks" section of the "Internals" chapter of the manual.


Version 1.04:

 * Included a copy of revision history (from README) in calc.el.

 * Added the "calcsplit" feature to split calcext.el into smaller bits.

 * Changed calcunpack to unpack floats and fractions, too.

 * Added "mant", "xpon", and "scf" functions for decomposing floats.

 * Fixed a bug in the "y" command with positive prefix arguments.

 * Rearranged binary shift/rotate command keys to be a bit more convenient.

 * Fixed a bug in which simplifying "(0/0) * 2" crashed with a Lisp error.

 * Made `H F' [ffloor] and friends faster for very large arguments.

 * Made calcdefinedel more robust.

 * Handled pasting of data into the Calculator using the mouse under X.

 * Made overlayarrow variables bufferlocal to avoid interference.

 * Fixed a problem in which Calc Trail buffer got stuck after a Cx Cw.


Version 1.03:

 * Changed mathchoose to compute nchoosem faster when m is large.

 * Fixed some problems with TeX mode.

 * Fixed a bug that prevented `b s' from working without a prefix argument.

 * Added "calceval" function.

 * Improved calcgrabregion.


Version 1.02:

 * Fixed a bug in Tutorial: telephone pole height/distance were switched!

 * Fixed a few other things in the manual.

 * Added "fullcalc" command.

 * Added "calcinsertvariables" (`Z I') command.

 * Quick Calc now works even if you are already in the minibuffer.

 * Fixed a bug in mathmulbignumdigit which affected mathand, etc.

 * Definition of "Hectares" was wrong in units table.

 * Fixed a bug in calcexecutekbdmacro concerning undo and refresh.

 * Bound "calcundo" to `Cx u' as well as `C_' and `U'.

Version 1.01:

 * Added a tutorial section to the manual.

 * Next and Prev for node Strings in the manual were reversed; fixed.

 * Changed "'bignum" in calcisqrtbignumiter to "'bigpos".

 * Fixed a bug that prevented "$" from working during algebraic entry.

 * Fixed a bug caused by an X (lastX) command following a K (macro) cmd.

 * Fixed a bug in which K command incorrectly formatted stack in Big mode.

 * Added space between unary operators and nonflat compositions.
+** Changed to compile calcmacs/maint, to allow "cp *.elc newdir".
+
+** Improved calcdescribebindings to avoid showing redundant ESC maps.
+
+
+* Version 2.00 beta 3:
+
+** Removed version numbers from most .el files to reduce size of patches.
+
+** Added a "calcversion" command.
+
+** Changed `M# ? ?' to allow for modified describefunction.
+
+** Changed date parser to accept "Sept" as an alternative for "Sep".
+
+** Inhibited answers to exercise from showing up in table of contents.
+
+** Changed Makefile to say "texindex calc.[cfkptv]?" to avoid "calc.el".
+
+** Fixed up the Makefile in various other ways.
+
+** Rearranged banner at top of `h h' command's output.
+
+** Changed "make summary" to print "Calc Summary" on the title page.
+
+** Added "IntegSimpRules".
+
+** Added `M# :', `M# _', and `M# Z' options.
+
+** Changed `^' to evaluate "[3..1]^2" properly.
+
+** Improved `f g' to give symbolic answers for, e.g., 101:2 and 3:2.
+
+** Fixed a bug where `h k RET' didn't find the right place on the page.
+
+** Fixed a bug that formatted "x*(y ? a : b)" as "x y ? a : b".
+
+** Fixed a bug where defmath translated (< x 0) as (mathposp x)!
+
+** Fixed a bug that prevented quickcalc from working sometimes.
+
+** Fixed the `z ?' bug again (maybe this time for good?).
+
+** Fixed a bug in which `V ^' (vint) was just plain wrong, wrong, wrong!
+
+** Scanned for and fixed remaining bugs relating to autoloading.
+
+
+* Version 2.00 beta 2:
+
+** Changed "make info" to try "make texinfo" if "makeinfo" not found.
+
+** Changed to "New for Calc 2.00"; texinfo.tex chokes on apostrophes.
+
+** Added List Tutorial Exercise 14 (just in case there weren't enough!).
+
+** Added a discussion of the `Z F' command to the Programming Tutorial.
+
+** Improved `H a f' not to lose info if input is partially prefactored.
+
+** Improved simplification of expressions like sqrt(3) + 3^3:2.
+
+** Changed Big mode to omit "*" in expressions like 2 sqrt(3) 5^3:4.
+
+** Replaced European date format D/M/Y with D.M.Y.
+
+** Changed `a N' and `a X' to consider the endpoints of the interval.
+
+** Fixed a bug where TeX mode made c*(1+a/b) look like a function call.
+
+** Fixed a bug formatting toplevel evalto's while using selections.
+
+** Fixed a bug that caused `z ?' to crash.
+
+** Fixed a bug where `Z F' broke for argument names "t" and "nil".
+
+** Fixed several bugs relating to autoloading.
+
+
+* Version 2.00 beta 1:
+
+** Added "What's new in Calc 2.00" to the manual (summary of info below).
+
+** Added support for many GNUPLOT 3.0 features.
+
+** Tweaked the Makefile and calccompile a bit more.
+
+** Modified to work with Zawinski's/Furuseth's optimizing byte compiler.
+
+** Modified Calc to garbagecollect less often (raised gcconsthreshold).
+
+** Changed quickcalc to avoid autoloading so many parts of Calc.
+
+** Changed Calc subfiles to work properly if not bytecompiled.
+
+** Renamed `M# s' to `M# j', made `M# s' be equivalent to `h s'.
+
+** Changed calcquit to avoid reapportioning space among other windows.
+
+** Added `MDEL' (calcpopabove) key, to DEL as LFD is to RET.
+
+** Added `{' and `}' to scroll vertically, analogous to `<' and `>'.
+
+** Added `m t' for "total" algebraic mode.
+
+** Added `d , \' option to group digits with "\,".
+
+** Improved support of "prime" accent in "eqn" language mode.
+
+** Changed macedit's readkbdmacro to accept a string argument in Lisp.
+
+** Changed calccheckdefines to use a more concise runhooks linkage.
+
+** Changed autowhy mode not to say [w=more] if next msg is not urgent.
+
+** Made `a d' able to differentiate "a?b:c" and "a_i" formulas.
+
+** Changed probability dist. functions to work with `a f' and `a d'.
+
+** Added special constants "phi" and "gamma".
+
+** Added "poly" function, simpler cousin of "gpoly".
+
+** Added "pdeg", "plead", "pcont", "pprim"; cleaned up "pdiv" and "pgcd".
+
+** Added `a p' command for polynomial interpolation.
+
+** Added `a I' command for numerical integration; made IntegLimit variable.
+
+** Added `a f' to factor polynomials; moved old `a f' to `a "'.
+
+** Added `a a' to do partial fraction decompositions.
+
+** Improved `a i' to integrate many more kinds of formulas.
+
+** Modified `a P' to find numerical roots of highdegree polynomials.
+
+** Modified `c 0' through `c 9' to convert intvalued floats to integers.
+
+** Made sinh, arctanh, etc., expandable into exps/logs by `a f'.
+
+** Added more algebraic simplifications having to do with logs and exps.
+
+** Changed `s s', `s t', `s x', `s l' to accept an equation at prompt.
+
+** Changed `s i' not to store Decls if its value is the default, [].
+
+** Changed `s i' to store in `d O' language mode if in Normal or Big mode.
+
+** Rearranged `V M'/`V R' matrix mapping modes.
+
+** Added <#1+#2> notation for lambda expressions.
+
+** Extended `b l' and other binary shifts to have a 2argument version.
+
+** Changed `u c' and `u t' to give unitless result for unitless input.
+
+** Changed sqrt(1cos(x)^2)tosin(x) to be an unsafe simplification.
+
+** Improved simplification of sqrts, e.g., sqrt(a^2 x + a^2 y).
+
+** Changed solver to treat (xa)(xb)(xc) more intelligently.
+
+** Changed Pascal language mode to use "$FFFF" for hexadecimal numbers.
+
+** Added support for nondecimal display of floats.
+
+** Changed `p' to refresh stack display if current float format uses it.
+
+** Changed Big mode to use subscript notation for log10(x), log(x,b), r#nnn.
+
+** Changed Big mode to format deriv(u,x) and tderiv(u,x) as du/dx.
+
+** Changed Big mode to format integ(1/x,x) as "dx/x" instead of "1/x dx".
+
+** Added "tty" output type for graphics commands.
+
+** Documented Calc's random number generation algorithm in the manual.
+
+** Fixed a bug involving having "(setq calctiming t)" in .emacs.
+
+** Fixed a bug that incorrectly parsed "x  1" in TeX mode.
+
+** Fixed bugs and made improvements in `a R' when widening the guess.
+
+** Fixed a bug that where `a S' didn't solve (x  a)^2 = (x  b)^2.
+
+** Fixed a bug that sometimes crashed `a P' on systems of equations.
+
+** Fixed a bug that prevented `b p' (calcpackbits) from working.
+
+** Fixed some bugs in which certain functions didn't get autoloaded.
+
+** Fixed a bug in which the date <1/1/13> was incorrectly parsed.
+
+** Fixed a bug which prevented `j D' from expanding (a+b)/c.
+
+** Fixed a bug in solver: bad inverses for sinh and cosh.
+
+** Fixed a bug in mathpossiblesigns that failed for x*0.
+
+** Fixed a bug where sqrt(a) was rewritten sqrt(a)*i even if a<0.
+
+** Fixed a bug in line breaker when first "word" of line was too long.
+
+** Worked around a makeinfo bug that handled @end group/@group badly.
+
+
+* Version 2.00 alpha 3:
+
+** Changed logic for locating component .elc files to be even smarter.
+
+** Changed "make install" to "make compile"; added different "make install".
+
+** Improved "make compile" to check file dates and compile only when needed.
+
+** Made output of "make compile" in batch mode more compact and readable.
+
+** Replaced "Quick Overview" in manual with "Demonstration of Calc".
+
+** Changed to use keymaps for dispatching M# and h prefix keys.
+
+** Added TAGS target to the Calc Makefile.
+
+** Removed most doc strings from functions; new help commands are better.
+
+** Got rid of some crufty "fset" calls that were cluttering the code.
+
+** Split calcgrabregion into two functions, calcgrabregion/rectangle.
+
+** Swapped positions of stack and trail in fullcalckeypad display.
+
+** Improved linebreaking algorithm for displaying long formulas.
+
+** Improved display of control characters in vectors shown as strings.
+
+** Changed `d o' to allow fraction format to specify desired denominator.
+
+** Changed `M# y' to respect overwrite mode in target buffer.
+
+** Added `H' prefix to displaymode commands to suppress stack refresh.
+
+** Changed "calcwhy" mechanism to display urgent messages automatically.
+
+** Handled taking derivatives of symbolic integrals and viceversa.
+
+** Handled integrating vectors of formulas.
+
+** Incorporated Ewerlid's polynomial division and GCD functions into Calc.
+
+** Improved algebraic operations on "mod" forms, esp. polynomials.
+
+** Added some more financial functions (sln, syd, ddb).
+
+** Added nest, anest, fixp, and afixp (`H V R' and `H V U') functions.
+
+** Added `a .' (calcremoveequal) command to take apart equations.
+
+** Generalized dfact to work for negative odd integers; added !! syntax.
+
+** Changed `k f' to factor 1, 0, and negative integers.
+
+** Changed `u M', etc., to accept +/ and [ .. ] forms as distributions.
+
+** Changed `g q' to remove *Gnuplot Commands/Trail* window if present.
+
+** Added support for Francois Pinard's "dumb terminal" driver for GNUPLOT.
+
+** Added ":: remember" feature for rewrite rules.
+
+** Changed rewrites to let pattern "a*b" match "x/2" with a=x, b=1/2.
+
+** Added ability to put function names like "simplify" in rewrite schedule.
+
+** Added "Rewrites Tutorial" to the manual.
+
+** Changed ` to bind RET as newline instead of finish if editing a vector.
+
+** Added some new exercises to the List Tutorial.
+
+** Changed `Z F', `V M', etc. not to remove stored vars from def arg list.
+
+** Added parsing for /1, 2, 3/ notation for Fortran mode vectors.
+
+** Added a "%%" syntax for comments in formulas being read.
+
+** Fixed a bug in which failing `h k' removed an existing Info window.
+
+** Fixed a bug in `j /' operating on subformulas like "a + b".
+
+** Fixed a bug in which "inf = inf" undesirably evaluated to 1.
+
+** Fixed a bug that simplified "0 = 1 + a + 2" to "0 = a".
+
+** Fixed a bug that failed for rewrite patterns like "fib(1  2)".
+
+** Fixed a bug that arose because rewrite programs are nonreentrant.
+
+
+* Version 2.00 alpha 2:
+
+** Changed LFD terminating algebraic entry to push in nosimplify mode.
+
+** Changed so that `K ' interprets `' as calcminus, not neg prefix arg.
+
+** Improved `h c' command to understand all Calc key sequences.
+
+** Fixed problems with DistribRules, NegateRules, and FitRules.
+
+** Fixed several bad node pointers in the manual.
+
+** Fixed a bug in `h Cw' when used with makeinfoformatted manuals.
+
+** Fixed a bug in sqrt(1) when Polar and HMS modes are enabled.
+
+** Fixed/improved dscalar and deven functions; added dodd.
+
+** Fixed a bug in polynomial handling that also affected sum(sin(k),k,1,n).
+
+** Fixed various other glitches in the manual.
+
+
+* Version 2.00 alpha 1:
+
+** Calc's tar file now creates a calc(version) directory to unpack into.
+
+** Calc now comes with a Makefile; install with "make install".
+
+** Calc now comes already split into many files; installation is much simpler.
+
+** Changed base file name of the manual from "calcinfo" to "calc.info".
+
+** Key binding for `M# w' was documented but not implemented.
+
+** Bound M# ' to be synonymous with `M# f' (used to be `M# q').
+
+** Changed M# M# to use last interface of C or K; E no longer counts.
+
+** Changed `i' (and `M# i') not to return to Top node unnecessarily.
+
+** Changed `h' to be a prefix key with various help commands.
+
+** Changed `s' to be a prefix key with various store and recall commands.
+
+** Keys `i', `r', and `l' are obsolete (moved to `h' and `s' prefixes).
+
+** Rearranged `K', `X', and `MRET' keys; `K' is now calckeepargs.
+
+** Changed quickcalc to display input formula as well as output if room.
+
+** Changed quickcalc to interact with the editing buffer and kill ring.
+
+** Created pack, unpack, unpackt function equivalents of `v p', `v u'.
+
+** Changed to expand (a/b)^x to a^x/b^x only if b > 0 (not if a > 0).
+
+** Changed mathpossiblesigns to understand sqrt function.
+
+** Changed Z [, rewrites to consider any provably nonzero value as true.
+
+** Changed normal language modes to accept ** as a synonym for ^.
+
+** Added "maple" language mode.
+
+** Changed, e.g., Mathematica "(2 + 3 I)^(1.23*10^20)" to include parens.
+
+** Generalized mathcomposebig properties for all language modes.
+
+** Introduced "string" and other function for composing expressions.
+
+** Changed many recursive vector routines to use loops instead.
+
+** Added evalv, evalvn function equivalents to `=', `N'.
+
+** Changed "expr =>" not to evaluate at all if in nosimplify mode.
+
+** Redesigned user interface of `a F' (calccurvefit) command.
+
+** Added "phase" feature to the rewrite rule system.
+
+** Added "&&&", "", "!!!" to the rewrite rule system.
+
+** Introduced a new notation for rewrites: LHS := RHS :: COND.
+
+** Changed `a r' (but not `j r') to repeat 100 times by default.
+
+** Integrated EvalRules more cleanly into the default simplifications.
+
+** Added `H v l' [mdims] to measure the dimensions of a matrix.
+
+** Changed `u c' to interpret "/units" as "1/units".
+
+** Added `u a' to adjust unit prefix letters automatically.
+
+** Changed `u s' to enable scalar mode while simplifying.
+
+** Changed `c f' [pfloat] not to float integer powers or subscripts.
+
+** Added a threeargument form for the "hms" function.
+
+** Changed, e.g., sin(90) degrees to produce 1 instead of 1.0.
+
+** Changed symbolic mode to prefer sqrt(int): abs([1 2 3]) => sqrt(14).
+
+** Enhanced solver to handle, e.g., x + 1/x = a; exp(x) + exp(x) = a.
+
+** Enhanced simplifier to handle, e.g., exp(a+2) / e^a => e^2.
+
+** Enhanced `a s' to simplify sqrt(x)  x^1:2 and exp(x)  e^x to 0.
+
+** Added (a + b) to a  b as a default simplification.
+
+** Added rules for differentiating sum() and prod() functions.
+
+** Added a few more energy units (due to Przemek Klosowski).
+
+** Added overflow/underflow checking for all floatingpoint arithmetic.
+
+** Extended error forms to work with complex numbers.
+
+** Generalized GCD to handle fractional arguments.
+
+** Changed graphics routines to evaluate "x" values, e.g., [pi .. pi].
+
+** Added `g q', like `g K' but without viewing the Gnuplot Trail.
+
+** Changed `g p' and `V M' to display better "Working..." messages.
+
+** Modified `M# g' to be more robust about grabbing formulas.
+
+** Added `Y' prefix key reserved for userwritten extensions.
+
+** Added calcloadhook and calcextloadhook.
+
+** Prevented calcinstall from leaving large ~ files behind.
+
+** Changed @bullet to @bullet{} in manual to conform to texinfo spec.
+
+** Rearranged some chapters in the manual to be a bit more logical.
+
+** Added calcsplitsummary command.
+
+** Fixed several bugs in embedded mode.
+
+** Fixed a bug in calcvectorcovariance that required a prefix arg.
+
+** Fixed a bug that prevented parsing "a=>" with no righthand side.
+
+** Fixed a bug which allowed incorrectly dividing a vector by a vector.
+
+** Fixed a bug formatting sum(...)^2 in Big mode.
+
+** Fixed a bug that prevented Calc from deleting old graphics temp files.
+
+** Fixed some typos calling calcinversefunc instead of calcinvertfunc.
+
+** Fixed bugs in the derivatives of conj, deg, and rad; added re, im.
+
+** Fixed a bug where (r;theta) parsed as r exp(theta i) even in Deg mode.
+
+** Fixed a bug which gave wrong answer for exp of a polar complex number.
+
+** Fixed a bug in `Z F' that failed if formula used nonarg variables.
+
+** Fixed a bad pointer to Info node "Assignments in Embedded Mode".
+
+** Fixed several errors in the Calc Summary.
+
+
+* Version 1.08 beta 1:
+
+** Calc's copyright has been assigned to FSF, for inclusion in Emacs 19!
+
+** Changed M# to be a twokey sequence; use M# M# to start Calc now.
+
+** Rewrote and expanded the introductory chapter of the manual.
+
+** Added a key and function summary to the manual.
+
+** Changed the manual to take better advantage of TeX's math formatting.
+
+** Changed manual to be printable in @smallbook format.
+
+** Added "calcembedded" mode.
+
+** Added "=>" [evalto] operator.
+
+** Added facilities for date and date/time arithmetic.
+
+** Added a set of financial functions (pv, fv, etc.).
+
+** Added infinite quantities inf, uinf, and nan (plus infinite intervals).
+
+** Added "EvalRules", "SimpRules", and "ExtSimpRules" variables.
+
+** Added sum and product commands `a +', `a ', `a *', `a T'.
+
+** Enhanced `a S' and `a P' to solve systems of equations.
+
+** Enhanced solver to handle eqns like sin(x) = cos(2 x), sqrt(x) + x = 1.
+
+** Added `a M' (calcmapequation) command.
+
+** Added new statistical functions: mean, standard deviation, etc.
+
+** Added line, polynomial, and curve fitting commands (`a L' and `a F').
+
+** Added support for composite units, e.g., "mi+ft+in".
+
+** Enhanced "Big" mode to format square roots, choose, and powers better.
+
+** Enhanced "Big" mode to display fractions in large notation.
+
+** Added several alternate formats for matrix display.
+
+** Changed TeX mode to write "(1 + x^2)" instead of "\left(1 + x^2\right)".
+
+** Added support for relational operators in TeX and FORTRAN modes.
+
+** Added recognition of accents like \dot, \tilde, \underline in TeX mode.
+
+** Added "eqn" language mode.
+
+** Added extra control over display justification with `d <', `d =', `d >'.
+
+** Added calcleftlabel and calcrightlabel (`d {', `d }').
+
+** Added "nn%" syntax for algebraic formulas; equivalent to "nn * .01".
+
+** Added input syntaxes like a = b = c, a != b != c, a <= b < c.
+
+** Changed "_" to mean subscripts; old use of "_" in vars is now "#".
+
+** Introduced "matrix mode" and "scalar mode" (`m v').
+
+** Introduced generic identity matrices (idn(1)).
+
+** Added a method for declaring variables to be real, integer, > 0, etc.
+
+** Added `Z S' command for editing stored value of a variable.
+
+** Added "subst" algebraic function equivalent to the `a b' command.
+
+** Added `a f' command, changed deriv/integ/solvefor to use it.
+
+** Improved `a s' to simplify (x + y) (y + x) to (x + y)^2.
+
+** Improved `a s' to simplify i^2 to 1.
+
+** Improved `a s' to simplify, e.g., sin(pi/3) in Symbolic mode.
+
+** Improved `a s' to simplify sqrt(8) to 2 sqrt(2), 1/sqrt(2) to sqrt(2)/2.
+
+** Moved sin(arccos(x)) from `a e' to `a s'; not unsafe after all!
+
+** Changed (x y)^z => x^z y^z to be a usuallyunsafe simplification.
+
+** Added thorough documentation of `a s' and `a e' to the manual.
+
+** Improved `a c' to collect "f(a)" even if "a" also appears elsewhere.
+
+** Introduced lin, linnt, islin, islinnt functions for linearity testing.
+
+** Improved `a x' to use binomial theorem to give simpler answers.
+
+** Improved `j D' to distribute powers of sums: (a + b)^n.
+
+** Improved `j M' to merge products of powers (may need nosimplify mode).
+
+** Changed to use defvar for DistribRules etc. so `Z V' works with them.
+
+** Improved `j *' and `j /' to work properly in a few more cases.
+
+** Improved `V R' to use identity value when reducing empty vectors.
+
+** Improved `v p' and `v u' to support more complex packing operations.
+
+** Disabled automatic simplification of sqrt(2)/2 to 1/sqrt(2).
+
+** Bound SPC and RET to press, TAB to nextmenu in *Calc Keypad* buffer.
+
+** Added Cu ' to do algebraic entry with language mode forced to normal.
+
+** Added "$1", "$2", etc. input notation for algebraic entry.
+
+** Changed unary operators like `n', `&' to treat neg prefix args like RET.
+
+** Changed ` (calcedit) to show full precision regardless of float format.
+
+** Enhanced quickcalc to display integers in several formats.
+
+** Documented `g H' (calcgraphhide) command (had been left from manual).
+
+** Enhanced floor/ceil/trunc/round in several ways.
+
+** Added rounde and roundu functions.
+
+** Changed `c 1' through `c 9' to change small floats to 0.0; added `c 0'.
+
+** Enhanced set operations to work on sets of intervals.
+
+** Fixed erf(0), utpn(x,x,y), and arccosh(1) to work properly.
+
+** Changed complex arctan and arctanh to follow Steele 2nd edition.
+
+** Expanded "Branch Cuts" section of the manual with some useful tables.
+
+** Rearranged order of words in mode line to be a bit more logical.
+
+** Changed `m N' (numsimplify) mode to evaluate constant vectors, too.
+
+** Changed `a r'/`j r' to prompt twice for separate LHS/RHS if necessary.
+
+** Enhanced `let(v,x)' in rewrites by allowing arbitrary patterns for v.
+
+** Changed cursor positioning in second prompt for `a b' (calcsubstitute).
+
+** Changed `y' to omit line numbers more consistently.
+
+** Changed `o' (calcrealign) to reset horizontal scrolling to zero, also.
+
+** Added "pred" mode for calceval.
+
+** Added "calcreportbug" as an alias for "reportcalcbug".
+
+** Added `Z T' and "calcpasserrors" to aid debugging Calcrelated code.
+
+** Added "calcloadeverything" (`m X' or `M# L') command.
+
+** Enhanced calcinstall to prebuild units table, CommuteRules, etc.
+
+** Changed Calc to interact more gracefully with loadpath.
+
+** Changed Lisp Variable Index in manual to include user variables, too.
+
+** Fixed a bug that prevented calcinstall from working under VMS.
+
+** Fixed a bug that sometimes crashed rewrites dealing with subtractions.
+
+** Fixed a bug that prevented `a S' from solving "3  x = 1 + x"!
+
+** Fixed a bug in solver that crashed for certain cubics and quartics.
+
+** Fixed a bug in calcsimplify that crashed for equations and ineqs.
+
+** Fixed a bug which placed the "[" oddly in `d B' + `v /' mode.
+
+** Fixed a bug where finishing calcedit improperly obeyed language mode.
+
+** Fixed a bug formatting (1)^n in Big mode after selection commands.
+
+** Fixed a bug that got ">=" and "<=" backwards in rewrite conditions.
+
+** Fixed a bug that broke the `"x"' key in calckeypad mode.
+
+** Fixed a bug in which `MAP$' in calckeypad didn't display "Working...".
+
+** Fixed a bug where matrix division gave bad result for singular matrix.
+
+** Fixed a bug which closed Calc window if calcgrabregion got an error.
+
+** Fixed a bug where `a s' failed on formulas containing dimension errors.
+
+** Fixed a bug that caused `m F' to hang.
+
+** Fixed a bug in complex arithmetic that caused problems with solver.
+
+** Fixed a bug which raised intervals to interval powers incorrectly.
+
+** Fixed a bug in utpp/ltpp (order of arguments did not match the manual).
+
+** Fixed a bug in which `t y' rounded yanked data with old precision.
+
+** Fixed a bug in which "in(3, [3 .. 3))" returned true.
+
+** Fixed a bug which simplified abs(abs(x)) incorrectly.
+
+** Fixed a bug in which (a^2)^1:3 was unsafely simplified to a^2:3.
+
+** Fixed a bug in rewrite system which missed pattern "2 sin(x) cos(x)".
+
+** Fixed a bug in rewrite system which missed pattern "a  a cos(x)^2".
+
+** Fixed obsolete trail tags gsmp, gneg, ginv to jsmp, jneg, jinv.
+
+** Fixed some errors and made improvements in units table [Ulrich Mueller].
+
+
+* Version 1.07:
+
+** Added `m F' (calcsettingsfilename) command.
+
+** Added calcautoloaddirectory variable.
+
+** Extended Z ` to accept a prefix argument.
+
+** Added keystrokes (v h, v k) for head, tail, cons.
+
+** Extended `v e' to accept a vector as the filler.
+
+** Changed `V M', `V R' to accept mappingmode keys in uppercase, too.
+
+** Changed V M ' etc. to accept $, $$, ... as argument indicators.
+
+** Changed `t y' to accept a prefix argument.
+
+** Put in a cleaner and safer random number generator for `k r' et al.
+
+** Fixed a bug which completely broke `a r' command!
+
+** Fixed "0 * matrix" to generate a zero matrix instead of 0.
+
+** Fixed a bug in `a R' which sometimes caused it to crash.
+
+** Fixed a fatal typo in the TeX version of the manual.
+
+** Fixed a bug that prevented Ck, Cw, Mw from working in Trail buffer.
+
+** Fixed another bug in `Z P' command.
+
+** Fixed a bug in `u s' which incorrectly simplified subtractions.
+
+** Fixed an argumentname aliasing bug evaluating lambda( ) formulas.
+
+** Fixed overfull hboxes in the manual.
+
+** Fixed various other bugs in the manual.
+
+
+* Version 1.06:
+
+** Added "calckeypad" mode for X window system users (try it!).
+
+** Improved "calceval" for calling/operating Calc from userwritten Lisp.
+
+** Moved vector accumulate command to `V U' (old `H V R' still supported).
+
+** Added righttoleft reductions: `I V R' and `I V U'.
+
+** Added set operations on vectors: intersect, union, diff, xor.
+
+** Added `I v s' to remove a subvector from a vector.
+
+** Introduced `H ' to append two vectors with no magical special cases.
+
+** Introduced rhead, rtail, and rcons for isolating last vector element.
+
+** Changed `g p' to keep temp files around until data actually change.
+
+** Improved `a S' to solve many higherorder polynomial equations.
+
+** Added `a P' to produce a vector of all solutions to an equation.
+
+** Enhanced `a v' and `j v' to allow toplevelonly evaluation.
+
+** Changed `j DEL' to delete a side of an eqn or ineq, leaving other side.
+
+** Fixed binding for keys `j 1' through `j 9'.
+
+** Introduced "let" marker in rewrite rules.
+
+** Enhanced the "sign" function to provide a twoargument version.
+
+** Changed "maxspecpdlsize exceeded" error message to be userfriendly.
+
+** Put "" in the trail in above case and when user presses Cg.
+
+** Changed TeX mode to generate \ldots instead of \dots, recognize both.
+
+** Changed "sin(0)" etc. (for integer 0) to generate "0" instead of "0.".
+
+** Enhanced Programming Tutorial exercise 2.
+
+** Fixed an error in the answer to Types Tutorial exercise 3.
+
+** Fixed several bugs relating to head, tail, and cons functions.
+
+** Fixed some other minor typos in the manual.
+
+** Fixed several bugs in `Z P' (calcuserdefinepermanent).
+
+** Fixed several bugs that broke the `g P' command.
+
+
+* Version 1.05:
+
+** Created a calcinstall command to ease installation.
+
+** Added lots of exercises to the Tutorial section of the manual.
+
+** Added ability to select and operate on subformulas.
+
+** Substantially improved the algebraic rewriterule system.
+
+** Added a set of graphing commands that use GNUPLOT.
+
+** Added a command (`a R') for finding numerical roots to equations.
+
+** Added several new math functions, such as erf and Bessel functions.
+
+** Added key bindings for miscellaneous commands using the "f" prefix key.
+
+** Added lots of new vector operations, many of them in the spirit of APL.
+
+** Added more control over vector display, including an abbreviated mode.
+
+** Improved keyboard macro editing; added readkbdmacro to macedit.el.
+
+** Introduced the `m S' (calcshiftprefix) command.
+
+** Enhanced the calcedit command in several ways.
+
+** Made it possible to hit ` (calcedit) during numeric/algebraic entry.
+
+** Enhanced the calcsolvefor command to handle inequalities.
+
+** Enhanced calcsimplify to handle equations and inequalities.
+
+** Taught log10 and log to look for exact integer or rational results.
+
+** Added ability to take Nth roots directly.
+
+** Added "increment" and "decrement" commands for integers and floats.
+
+** Added "fullhelp" command, changed "h" key to invoke it.
+
+** Added special help for Inverse and Hyperbolic prefixes.
+
+** Added an optional prefix argument to `o' (calcrealign).
+
+** Changed `t s' and `t r' to use RET as the search exit key.
+
+** Made handling of operator keys for V M, V R, etc. more regular.
+
+** Improved TeX mode; added support for \matrix format.
+
+** Added a variant of `m a' mode that only affects ( and [ keys.
+
+** Fixed "Mismatch" message for algebraic entry of semiopen intervals.
+
+** Trimmed fat from calc.el to speed loading, moved more to calcext.el.
+
+** Fixed a bug in which minibuffer entry rounded to outofdate precision.
+
+** Fixed a bug which crashed Calc 1.04 under Epoch.
+
+** Fixed a bug which messed up Calc Trail's mode line, among other things.
+
+** Fixed a bug which caused trail ">" to show only when in Trail buffer.
+
+** Fixed a bug in which "calc" called "calcgrabregion" with too few args.
+
+** Fixed bugs in both implementation and documentation of calcperm.
+
+** Fixed a bug in which calcsimplifyextended always used radians.
+
+** Fixed a bug where calccomma failed to override "polar" mode.
+
+** Fixed a bug doing mixed arithmetic on rectangular+polar complex numbers.
+
+** Fixed several bugs in transcendental functions with complex arguments.
+
+** Fixed a bug in which `a s' simplified "x / .5" to ".5 x".
+
+** Fixed numerous other bugs in various parts of Calc.
+
+** Completed the "Hooks" section of the "Internals" chapter of the manual.
+
+
+* Version 1.04:
+
+** Included a copy of revision history (from README) in calc.el.
+
+** Added the "calcsplit" feature to split calcext.el into smaller bits.
+
+** Changed calcunpack to unpack floats and fractions, too.
+
+** Added "mant", "xpon", and "scf" functions for decomposing floats.
+
+** Fixed a bug in the "y" command with positive prefix arguments.
+
+** Rearranged binary shift/rotate command keys to be a bit more convenient.
+
+** Fixed a bug in which simplifying "(0/0) * 2" crashed with a Lisp error.
+
+** Made `H F' [ffloor] and friends faster for very large arguments.
+
+** Made calcdefinedel more robust.
+
+** Handled pasting of data into the Calculator using the mouse under X.
+
+** Made overlayarrow variables bufferlocal to avoid interference.
+
+** Fixed a problem in which Calc Trail buffer got stuck after a Cx Cw.
+
+
+* Version 1.03:
+
+** Changed mathchoose to compute nchoosem faster when m is large.
+
+** Fixed some problems with TeX mode.
+
+** Fixed a bug that prevented `b s' from working without a prefix argument.
+
+** Added "calceval" function.
+
+** Improved calcgrabregion.
+
+
+* Version 1.02:
+
+** Fixed a bug in Tutorial: telephone pole height/distance were switched!
+
+** Fixed a few other things in the manual.
+
+** Added "fullcalc" command.
+
+** Added "calcinsertvariables" (`Z I') command.
+
+** Quick Calc now works even if you are already in the minibuffer.
+
+** Fixed a bug in mathmulbignumdigit which affected mathand, etc.
+
+** Definition of "Hectares" was wrong in units table.
+
+** Fixed a bug in calcexecutekbdmacro concerning undo and refresh.
+
+** Bound "calcundo" to `Cx u' as well as `C_' and `U'.
+
+* Version 1.01:
+
+** Added a tutorial section to the manual.
+
+** Next and Prev for node Strings in the manual were reversed; fixed.
+
+** Changed "'bignum" in calcisqrtbignumiter to "'bigpos".
+
+** Fixed a bug that prevented "$" from working during algebraic entry.
+
+** Fixed a bug caused by an X (lastX) command following a K (macro) cmd.
+
+** Fixed a bug in which K command incorrectly formatted stack in Big mode.
+
+** Added space between unary operators and nonflat compositions.
(Otherwise, "(a/b)" in Big mode blended the minus sign into the rule!)
 * Fixed formatting of (1)^n in Big mode.

 * Fixed some problems relating to "not" operator in Pascal language mode.

 * Fixed several bugs relating to V M ' and V M $ sequences.

 * Fixed matrixvector multiplication to produce a vector.

 * Introduced Z ` ... Z ' commands; renamed old Z ' to Z #.

 * Fixed various other bugs.

 * Added calcsettingsfile variable suggested by C. Witty.
+** Fixed formatting of (1)^n in Big mode.
+
+** Fixed some problems relating to "not" operator in Pascal language mode.
+
+** Fixed several bugs relating to V M ' and V M $ sequences.
+
+** Fixed matrixvector multiplication to produce a vector.
+
+** Introduced Z ` ... Z ' commands; renamed old Z ' to Z #.
+
+** Fixed various other bugs.
+
+** Added calcsettingsfile variable suggested by C. Witty.
Version 1.00:

 * First official release of Calc.

 * If you used the Beta test version (0.01), you will find that this
+* Version 1.00:
+
+** First official release of Calc.
+
+** If you used the Beta test version (0.01), you will find that this
version of Calc is over 50% larger than the original release.
General areas of improvement include much better algebra features;
operations on units; language modes; simplification modes; interval
@@ 1210,3 +1168,8 @@
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see .
+
+
+Local variables:
+mode: outline
+end:

revno: 111644
committer: Glenn Morris
branch nick: trunk
timestamp: Thu 20130131 19:58:50 0800
message:
Move lisp/calc/README* to etc/CALCNEWS
* makedist: Only README files exist in lisp/ now, not README*.
* doc/misc/calc.texi (Help Commands): Mention etc/CALCNEWS.
* etc/CALCNEWS: Move here from lisp/calc/README, README.prev.
* lisp/calc/README, lisp/calc/README.prev: Rename/merge to etc/CALCNEWS.
diff:
=== modified file 'ChangeLog'
 ChangeLog 20130123 23:49:46 +0000
+++ ChangeLog 20130201 03:58:50 +0000
@@ 1,3 +1,7 @@
+20130201 Glenn Morris
+
+ * makedist: Only README files exist in lisp/ now, not README*.
+
20130123 Giorgos Keramidas (tiny change)
* .bzrignore: add libsrc/blessmail.
=== modified file 'doc/misc/ChangeLog'
 doc/misc/ChangeLog 20130201 03:51:08 +0000
+++ doc/misc/ChangeLog 20130201 03:58:50 +0000
@@ 1,6 +1,7 @@
20130201 Glenn Morris
* calc.texi (Help Commands): Update calcviewnews description.
+ Mention etc/CALCNEWS.
20130124 Michael Albinus
=== modified file 'doc/misc/calc.texi'
 doc/misc/calc.texi 20130201 03:51:08 +0000
+++ doc/misc/calc.texi 20130201 03:58:50 +0000
@@ 9910,7 +9910,8 @@
@kindex h n
The @kbd{h n} or @kbd{h Cn} (@code{calcviewnews}) command displays
the ``news'' or change history of Emacs, and jumps to the most recent
portion concerning Calc (if present).
+portion concerning Calc (if present). For older history, see the file
+@file{etc/CALCNEWS} in the Emacs distribution.
@kindex h Cc
@kindex h Cd
=== renamed file 'lisp/calc/README' => 'etc/CALCNEWS'
 lisp/calc/README 20130201 03:51:08 +0000
+++ etc/CALCNEWS 20130201 03:58:50 +0000
@@ 1,9 +1,7 @@
Copyright (C) 20012013 Free Software Foundation, Inc.
See the end of the file for license conditions.

This directory contains Calc, an advanced desk calculator for GNU
Emacs.
+Calc is an advanced desk calculator for GNU Emacs.
"Calc" Copyright (C) 19901993, 20012013 Free Software Foundation, Inc.
@@ 66,7 +64,6 @@
opinions.

Summary of changes to "Calc"
    
@@ 223,9 +220,980 @@
* First complete posting of Calc since 1.01.
* Most parts of Calc have seen changes since version 1.07. See
 section "New for Calc 2.00" in the manual for a summary. In
 the FTP version of the Calc distribution, the file README.prev
 contains a detailed change history from 1.00 up to 2.00.
+ section "New for Calc 2.00" in the manual for a summary.
+
+ * Changed to compile calcmacs/maint, to allow "cp *.elc newdir".
+
+ * Improved calcdescribebindings to avoid showing redundant ESC maps.
+
+
+Version 2.00 beta 3:
+
+ * Removed version numbers from most .el files to reduce size of patches.
+
+ * Added a "calcversion" command.
+
+ * Changed `M# ? ?' to allow for modified describefunction.
+
+ * Changed date parser to accept "Sept" as an alternative for "Sep".
+
+ * Inhibited answers to exercise from showing up in table of contents.
+
+ * Changed Makefile to say "texindex calc.[cfkptv]?" to avoid "calc.el".
+
+ * Fixed up the Makefile in various other ways.
+
+ * Rearranged banner at top of `h h' command's output.
+
+ * Changed "make summary" to print "Calc Summary" on the title page.
+
+ * Added "IntegSimpRules".
+
+ * Added `M# :', `M# _', and `M# Z' options.
+
+ * Changed `^' to evaluate "[3..1]^2" properly.
+
+ * Improved `f g' to give symbolic answers for, e.g., 101:2 and 3:2.
+
+ * Fixed a bug where `h k RET' didn't find the right place on the page.
+
+ * Fixed a bug that formatted "x*(y ? a : b)" as "x y ? a : b".
+
+ * Fixed a bug where defmath translated (< x 0) as (mathposp x)!
+
+ * Fixed a bug that prevented quickcalc from working sometimes.
+
+ * Fixed the `z ?' bug again (maybe this time for good?).
+
+ * Fixed a bug in which `V ^' (vint) was just plain wrong, wrong, wrong!
+
+ * Scanned for and fixed remaining bugs relating to autoloading.
+
+
+Version 2.00 beta 2:
+
+ * Changed "make info" to try "make texinfo" if "makeinfo" not found.
+
+ * Changed to "New for Calc 2.00"; texinfo.tex chokes on apostrophes.
+
+ * Added List Tutorial Exercise 14 (just in case there weren't enough!).
+
+ * Added a discussion of the `Z F' command to the Programming Tutorial.
+
+ * Improved `H a f' not to lose info if input is partially prefactored.
+
+ * Improved simplification of expressions like sqrt(3) + 3^3:2.
+
+ * Changed Big mode to omit "*" in expressions like 2 sqrt(3) 5^3:4.
+
+ * Replaced European date format D/M/Y with D.M.Y.
+
+ * Changed `a N' and `a X' to consider the endpoints of the interval.
+
+ * Fixed a bug where TeX mode made c*(1+a/b) look like a function call.
+
+ * Fixed a bug formatting toplevel evalto's while using selections.
+
+ * Fixed a bug that caused `z ?' to crash.
+
+ * Fixed a bug where `Z F' broke for argument names "t" and "nil".
+
+ * Fixed several bugs relating to autoloading.
+
+
+Version 2.00 beta 1:
+
+ * Added "What's new in Calc 2.00" to the manual (summary of info below).
+
+ * Added support for many GNUPLOT 3.0 features.
+
+ * Tweaked the Makefile and calccompile a bit more.
+
+ * Modified to work with Zawinski's/Furuseth's optimizing byte compiler.
+
+ * Modified Calc to garbagecollect less often (raised gcconsthreshold).
+
+ * Changed quickcalc to avoid autoloading so many parts of Calc.
+
+ * Changed Calc subfiles to work properly if not bytecompiled.
+
+ * Renamed `M# s' to `M# j', made `M# s' be equivalent to `h s'.
+
+ * Changed calcquit to avoid reapportioning space among other windows.
+
+ * Added `MDEL' (calcpopabove) key, to DEL as LFD is to RET.
+
+ * Added `{' and `}' to scroll vertically, analogous to `<' and `>'.
+
+ * Added `m t' for "total" algebraic mode.
+
+ * Added `d , \' option to group digits with "\,".
+
+ * Improved support of "prime" accent in "eqn" language mode.
+
+ * Changed macedit's readkbdmacro to accept a string argument in Lisp.
+
+ * Changed calccheckdefines to use a more concise runhooks linkage.
+
+ * Changed autowhy mode not to say [w=more] if next msg is not urgent.
+
+ * Made `a d' able to differentiate "a?b:c" and "a_i" formulas.
+
+ * Changed probability dist. functions to work with `a f' and `a d'.
+
+ * Added special constants "phi" and "gamma".
+
+ * Added "poly" function, simpler cousin of "gpoly".
+
+ * Added "pdeg", "plead", "pcont", "pprim"; cleaned up "pdiv" and "pgcd".
+
+ * Added `a p' command for polynomial interpolation.
+
+ * Added `a I' command for numerical integration; made IntegLimit variable.
+
+ * Added `a f' to factor polynomials; moved old `a f' to `a "'.
+
+ * Added `a a' to do partial fraction decompositions.
+
+ * Improved `a i' to integrate many more kinds of formulas.
+
+ * Modified `a P' to find numerical roots of highdegree polynomials.
+
+ * Modified `c 0' through `c 9' to convert intvalued floats to integers.
+
+ * Made sinh, arctanh, etc., expandable into exps/logs by `a f'.
+
+ * Added more algebraic simplifications having to do with logs and exps.
+
+ * Changed `s s', `s t', `s x', `s l' to accept an equation at prompt.
+
+ * Changed `s i' not to store Decls if its value is the default, [].
+
+ * Changed `s i' to store in `d O' language mode if in Normal or Big mode.
+
+ * Rearranged `V M'/`V R' matrix mapping modes.
+
+ * Added <#1+#2> notation for lambda expressions.
+
+ * Extended `b l' and other binary shifts to have a 2argument version.
+
+ * Changed `u c' and `u t' to give unitless result for unitless input.
+
+ * Changed sqrt(1cos(x)^2)tosin(x) to be an unsafe simplification.
+
+ * Improved simplification of sqrts, e.g., sqrt(a^2 x + a^2 y).
+
+ * Changed solver to treat (xa)(xb)(xc) more intelligently.
+
+ * Changed Pascal language mode to use "$FFFF" for hexadecimal numbers.
+
+ * Added support for nondecimal display of floats.
+
+ * Changed `p' to refresh stack display if current float format uses it.
+
+ * Changed Big mode to use subscript notation for log10(x), log(x,b), r#nnn.
+
+ * Changed Big mode to format deriv(u,x) and tderiv(u,x) as du/dx.
+
+ * Changed Big mode to format integ(1/x,x) as "dx/x" instead of "1/x dx".
+
+ * Added "tty" output type for graphics commands.
+
+ * Documented Calc's random number generation algorithm in the manual.
+
+ * Fixed a bug involving having "(setq calctiming t)" in .emacs.
+
+ * Fixed a bug that incorrectly parsed "x  1" in TeX mode.
+
+ * Fixed bugs and made improvements in `a R' when widening the guess.
+
+ * Fixed a bug that where `a S' didn't solve (x  a)^2 = (x  b)^2.
+
+ * Fixed a bug that sometimes crashed `a P' on systems of equations.
+
+ * Fixed a bug that prevented `b p' (calcpackbits) from working.
+
+ * Fixed some bugs in which certain functions didn't get autoloaded.
+
+ * Fixed a bug in which the date <1/1/13> was incorrectly parsed.
+
+ * Fixed a bug which prevented `j D' from expanding (a+b)/c.
+
+ * Fixed a bug in solver: bad inverses for sinh and cosh.
+
+ * Fixed a bug in mathpossiblesigns that failed for x*0.
+
+ * Fixed a bug where sqrt(a) was rewritten sqrt(a)*i even if a<0.
+
+ * Fixed a bug in line breaker when first "word" of line was too long.
+
+ * Worked around a makeinfo bug that handled @end group/@group badly.
+
+
+Version 2.00 alpha 3:
+
+ * Changed logic for locating component .elc files to be even smarter.
+
+ * Changed "make install" to "make compile"; added different "make install".
+
+ * Improved "make compile" to check file dates and compile only when needed.
+
+ * Made output of "make compile" in batch mode more compact and readable.
+
+ * Replaced "Quick Overview" in manual with "Demonstration of Calc".
+
+ * Changed to use keymaps for dispatching M# and h prefix keys.
+
+ * Added TAGS target to the Calc Makefile.
+
+ * Removed most doc strings from functions; new help commands are better.
+
+ * Got rid of some crufty "fset" calls that were cluttering the code.
+
+ * Split calcgrabregion into two functions, calcgrabregion/rectangle.
+
+ * Swapped positions of stack and trail in fullcalckeypad display.
+
+ * Improved linebreaking algorithm for displaying long formulas.
+
+ * Improved display of control characters in vectors shown as strings.
+
+ * Changed `d o' to allow fraction format to specify desired denominator.
+
+ * Changed `M# y' to respect overwrite mode in target buffer.
+
+ * Added `H' prefix to displaymode commands to suppress stack refresh.
+
+ * Changed "calcwhy" mechanism to display urgent messages automatically.
+
+ * Handled taking derivatives of symbolic integrals and viceversa.
+
+ * Handled integrating vectors of formulas.
+
+ * Incorporated Ewerlid's polynomial division and GCD functions into Calc.
+
+ * Improved algebraic operations on "mod" forms, esp. polynomials.
+
+ * Added some more financial functions (sln, syd, ddb).
+
+ * Added nest, anest, fixp, and afixp (`H V R' and `H V U') functions.
+
+ * Added `a .' (calcremoveequal) command to take apart equations.
+
+ * Generalized dfact to work for negative odd integers; added !! syntax.
+
+ * Changed `k f' to factor 1, 0, and negative integers.
+
+ * Changed `u M', etc., to accept +/ and [ .. ] forms as distributions.
+
+ * Changed `g q' to remove *Gnuplot Commands/Trail* window if present.
+
+ * Added support for Francois Pinard's "dumb terminal" driver for GNUPLOT.
+
+ * Added ":: remember" feature for rewrite rules.
+
+ * Changed rewrites to let pattern "a*b" match "x/2" with a=x, b=1/2.
+
+ * Added ability to put function names like "simplify" in rewrite schedule.
+
+ * Added "Rewrites Tutorial" to the manual.
+
+ * Changed ` to bind RET as newline instead of finish if editing a vector.
+
+ * Added some new exercises to the List Tutorial.
+
+ * Changed `Z F', `V M', etc. not to remove stored vars from def arg list.
+
+ * Added parsing for /1, 2, 3/ notation for Fortran mode vectors.
+
+ * Added a "%%" syntax for comments in formulas being read.
+
+ * Fixed a bug in which failing `h k' removed an existing Info window.
+
+ * Fixed a bug in `j /' operating on subformulas like "a + b".
+
+ * Fixed a bug in which "inf = inf" undesirably evaluated to 1.
+
+ * Fixed a bug that simplified "0 = 1 + a + 2" to "0 = a".
+
+ * Fixed a bug that failed for rewrite patterns like "fib(1  2)".
+
+ * Fixed a bug that arose because rewrite programs are nonreentrant.
+
+
+Version 2.00 alpha 2:
+
+ * Changed LFD terminating algebraic entry to push in nosimplify mode.
+
+ * Changed so that `K ' interprets `' as calcminus, not neg prefix arg.
+
+ * Improved `h c' command to understand all Calc key sequences.
+
+ * Fixed problems with DistribRules, NegateRules, and FitRules.
+
+ * Fixed several bad node pointers in the manual.
+
+ * Fixed a bug in `h Cw' when used with makeinfoformatted manuals.
+
+ * Fixed a bug in sqrt(1) when Polar and HMS modes are enabled.
+
+ * Fixed/improved dscalar and deven functions; added dodd.
+
+ * Fixed a bug in polynomial handling that also affected sum(sin(k),k,1,n).
+
+ * Fixed various other glitches in the manual.
+
+
+Version 2.00 alpha 1:
+
+ * Calc's tar file now creates a calc(version) directory to unpack into.
+
+ * Calc now comes with a Makefile; install with "make install".
+
+ * Calc now comes already split into many files; installation is much simpler.
+
+ * Changed base file name of the manual from "calcinfo" to "calc.info".
+
+ * Key binding for `M# w' was documented but not implemented.
+
+ * Bound M# ' to be synonymous with `M# f' (used to be `M# q').
+
+ * Changed M# M# to use last interface of C or K; E no longer counts.
+
+ * Changed `i' (and `M# i') not to return to Top node unnecessarily.
+
+ * Changed `h' to be a prefix key with various help commands.
+
+ * Changed `s' to be a prefix key with various store and recall commands.
+
+ * Keys `i', `r', and `l' are obsolete (moved to `h' and `s' prefixes).
+
+ * Rearranged `K', `X', and `MRET' keys; `K' is now calckeepargs.
+
+ * Changed quickcalc to display input formula as well as output if room.
+
+ * Changed quickcalc to interact with the editing buffer and kill ring.
+
+ * Created pack, unpack, unpackt function equivalents of `v p', `v u'.
+
+ * Changed to expand (a/b)^x to a^x/b^x only if b > 0 (not if a > 0).
+
+ * Changed mathpossiblesigns to understand sqrt function.
+
+ * Changed Z [, rewrites to consider any provably nonzero value as true.
+
+ * Changed normal language modes to accept ** as a synonym for ^.
+
+ * Added "maple" language mode.
+
+ * Changed, e.g., Mathematica "(2 + 3 I)^(1.23*10^20)" to include parens.
+
+ * Generalized mathcomposebig properties for all language modes.
+
+ * Introduced "string" and other function for composing expressions.
+
+ * Changed many recursive vector routines to use loops instead.
+
+ * Added evalv, evalvn function equivalents to `=', `N'.
+
+ * Changed "expr =>" not to evaluate at all if in nosimplify mode.
+
+ * Redesigned user interface of `a F' (calccurvefit) command.
+
+ * Added "phase" feature to the rewrite rule system.
+
+ * Added "&&&", "", "!!!" to the rewrite rule system.
+
+ * Introduced a new notation for rewrites: LHS := RHS :: COND.
+
+ * Changed `a r' (but not `j r') to repeat 100 times by default.
+
+ * Integrated EvalRules more cleanly into the default simplifications.
+
+ * Added `H v l' [mdims] to measure the dimensions of a matrix.
+
+ * Changed `u c' to interpret "/units" as "1/units".
+
+ * Added `u a' to adjust unit prefix letters automatically.
+
+ * Changed `u s' to enable scalar mode while simplifying.
+
+ * Changed `c f' [pfloat] not to float integer powers or subscripts.
+
+ * Added a threeargument form for the "hms" function.
+
+ * Changed, e.g., sin(90) degrees to produce 1 instead of 1.0.
+
+ * Changed symbolic mode to prefer sqrt(int): abs([1 2 3]) => sqrt(14).
+
+ * Enhanced solver to handle, e.g., x + 1/x = a; exp(x) + exp(x) = a.
+
+ * Enhanced simplifier to handle, e.g., exp(a+2) / e^a => e^2.
+
+ * Enhanced `a s' to simplify sqrt(x)  x^1:2 and exp(x)  e^x to 0.
+
+ * Added (a + b) to a  b as a default simplification.
+
+ * Added rules for differentiating sum() and prod() functions.
+
+ * Added a few more energy units (due to Przemek Klosowski).
+
+ * Added overflow/underflow checking for all floatingpoint arithmetic.
+
+ * Extended error forms to work with complex numbers.
+
+ * Generalized GCD to handle fractional arguments.
+
+ * Changed graphics routines to evaluate "x" values, e.g., [pi .. pi].
+
+ * Added `g q', like `g K' but without viewing the Gnuplot Trail.
+
+ * Changed `g p' and `V M' to display better "Working..." messages.
+
+ * Modified `M# g' to be more robust about grabbing formulas.
+
+ * Added `Y' prefix key reserved for userwritten extensions.
+
+ * Added calcloadhook and calcextloadhook.
+
+ * Prevented calcinstall from leaving large ~ files behind.
+
+ * Changed @bullet to @bullet{} in manual to conform to texinfo spec.
+
+ * Rearranged some chapters in the manual to be a bit more logical.
+
+ * Added calcsplitsummary command.
+
+ * Fixed several bugs in embedded mode.
+
+ * Fixed a bug in calcvectorcovariance that required a prefix arg.
+
+ * Fixed a bug that prevented parsing "a=>" with no righthand side.
+
+ * Fixed a bug which allowed incorrectly dividing a vector by a vector.
+
+ * Fixed a bug formatting sum(...)^2 in Big mode.
+
+ * Fixed a bug that prevented Calc from deleting old graphics temp files.
+
+ * Fixed some typos calling calcinversefunc instead of calcinvertfunc.
+
+ * Fixed bugs in the derivatives of conj, deg, and rad; added re, im.
+
+ * Fixed a bug where (r;theta) parsed as r exp(theta i) even in Deg mode.
+
+ * Fixed a bug which gave wrong answer for exp of a polar complex number.
+
+ * Fixed a bug in `Z F' that failed if formula used nonarg variables.
+
+ * Fixed a bad pointer to Info node "Assignments in Embedded Mode".
+
+ * Fixed several errors in the Calc Summary.
+
+
+Version 1.08 beta 1:
+
+ * Calc's copyright has been assigned to FSF, for inclusion in Emacs 19!
+
+ * Changed M# to be a twokey sequence; use M# M# to start Calc now.
+
+ * Rewrote and expanded the introductory chapter of the manual.
+
+ * Added a key and function summary to the manual.
+
+ * Changed the manual to take better advantage of TeX's math formatting.
+
+ * Changed manual to be printable in @smallbook format.
+
+ * Added "calcembedded" mode.
+
+ * Added "=>" [evalto] operator.
+
+ * Added facilities for date and date/time arithmetic.
+
+ * Added a set of financial functions (pv, fv, etc.).
+
+ * Added infinite quantities inf, uinf, and nan (plus infinite intervals).
+
+ * Added "EvalRules", "SimpRules", and "ExtSimpRules" variables.
+
+ * Added sum and product commands `a +', `a ', `a *', `a T'.
+
+ * Enhanced `a S' and `a P' to solve systems of equations.
+
+ * Enhanced solver to handle eqns like sin(x) = cos(2 x), sqrt(x) + x = 1.
+
+ * Added `a M' (calcmapequation) command.
+
+ * Added new statistical functions: mean, standard deviation, etc.
+
+ * Added line, polynomial, and curve fitting commands (`a L' and `a F').
+
+ * Added support for composite units, e.g., "mi+ft+in".
+
+ * Enhanced "Big" mode to format square roots, choose, and powers better.
+
+ * Enhanced "Big" mode to display fractions in large notation.
+
+ * Added several alternate formats for matrix display.
+
+ * Changed TeX mode to write "(1 + x^2)" instead of "\left(1 + x^2\right)".
+
+ * Added support for relational operators in TeX and FORTRAN modes.
+
+ * Added recognition of accents like \dot, \tilde, \underline in TeX mode.
+
+ * Added "eqn" language mode.
+
+ * Added extra control over display justification with `d <', `d =', `d >'.
+
+ * Added calcleftlabel and calcrightlabel (`d {', `d }').
+
+ * Added "nn%" syntax for algebraic formulas; equivalent to "nn * .01".
+
+ * Added input syntaxes like a = b = c, a != b != c, a <= b < c.
+
+ * Changed "_" to mean subscripts; old use of "_" in vars is now "#".
+
+ * Introduced "matrix mode" and "scalar mode" (`m v').
+
+ * Introduced generic identity matrices (idn(1)).
+
+ * Added a method for declaring variables to be real, integer, > 0, etc.
+
+ * Added `Z S' command for editing stored value of a variable.
+
+ * Added "subst" algebraic function equivalent to the `a b' command.
+
+ * Added `a f' command, changed deriv/integ/solvefor to use it.
+
+ * Improved `a s' to simplify (x + y) (y + x) to (x + y)^2.
+
+ * Improved `a s' to simplify i^2 to 1.
+
+ * Improved `a s' to simplify, e.g., sin(pi/3) in Symbolic mode.
+
+ * Improved `a s' to simplify sqrt(8) to 2 sqrt(2), 1/sqrt(2) to sqrt(2)/2.
+
+ * Moved sin(arccos(x)) from `a e' to `a s'; not unsafe after all!
+
+ * Changed (x y)^z => x^z y^z to be a usuallyunsafe simplification.
+
+ * Added thorough documentation of `a s' and `a e' to the manual.
+
+ * Improved `a c' to collect "f(a)" even if "a" also appears elsewhere.
+
+ * Introduced lin, linnt, islin, islinnt functions for linearity testing.
+
+ * Improved `a x' to use binomial theorem to give simpler answers.
+
+ * Improved `j D' to distribute powers of sums: (a + b)^n.
+
+ * Improved `j M' to merge products of powers (may need nosimplify mode).
+
+ * Changed to use defvar for DistribRules etc. so `Z V' works with them.
+
+ * Improved `j *' and `j /' to work properly in a few more cases.
+
+ * Improved `V R' to use identity value when reducing empty vectors.
+
+ * Improved `v p' and `v u' to support more complex packing operations.
+
+ * Disabled automatic simplification of sqrt(2)/2 to 1/sqrt(2).
+
+ * Bound SPC and RET to press, TAB to nextmenu in *Calc Keypad* buffer.
+
+ * Added Cu ' to do algebraic entry with language mode forced to normal.
+
+ * Added "$1", "$2", etc. input notation for algebraic entry.
+
+ * Changed unary operators like `n', `&' to treat neg prefix args like RET.
+
+ * Changed ` (calcedit) to show full precision regardless of float format.
+
+ * Enhanced quickcalc to display integers in several formats.
+
+ * Documented `g H' (calcgraphhide) command (had been left from manual).
+
+ * Enhanced floor/ceil/trunc/round in several ways.
+
+ * Added rounde and roundu functions.
+
+ * Changed `c 1' through `c 9' to change small floats to 0.0; added `c 0'.
+
+ * Enhanced set operations to work on sets of intervals.
+
+ * Fixed erf(0), utpn(x,x,y), and arccosh(1) to work properly.
+
+ * Changed complex arctan and arctanh to follow Steele 2nd edition.
+
+ * Expanded "Branch Cuts" section of the manual with some useful tables.
+
+ * Rearranged order of words in mode line to be a bit more logical.
+
+ * Changed `m N' (numsimplify) mode to evaluate constant vectors, too.
+
+ * Changed `a r'/`j r' to prompt twice for separate LHS/RHS if necessary.
+
+ * Enhanced `let(v,x)' in rewrites by allowing arbitrary patterns for v.
+
+ * Changed cursor positioning in second prompt for `a b' (calcsubstitute).
+
+ * Changed `y' to omit line numbers more consistently.
+
+ * Changed `o' (calcrealign) to reset horizontal scrolling to zero, also.
+
+ * Added "pred" mode for calceval.
+
+ * Added "calcreportbug" as an alias for "reportcalcbug".
+
+ * Added `Z T' and "calcpasserrors" to aid debugging Calcrelated code.
+
+ * Added "calcloadeverything" (`m X' or `M# L') command.
+
+ * Enhanced calcinstall to prebuild units table, CommuteRules, etc.
+
+ * Changed Calc to interact more gracefully with loadpath.
+
+ * Changed Lisp Variable Index in manual to include user variables, too.
+
+ * Fixed a bug that prevented calcinstall from working under VMS.
+
+ * Fixed a bug that sometimes crashed rewrites dealing with subtractions.
+
+ * Fixed a bug that prevented `a S' from solving "3  x = 1 + x"!
+
+ * Fixed a bug in solver that crashed for certain cubics and quartics.
+
+ * Fixed a bug in calcsimplify that crashed for equations and ineqs.
+
+ * Fixed a bug which placed the "[" oddly in `d B' + `v /' mode.
+
+ * Fixed a bug where finishing calcedit improperly obeyed language mode.
+
+ * Fixed a bug formatting (1)^n in Big mode after selection commands.
+
+ * Fixed a bug that got ">=" and "<=" backwards in rewrite conditions.
+
+ * Fixed a bug that broke the `"x"' key in calckeypad mode.
+
+ * Fixed a bug in which `MAP$' in calckeypad didn't display "Working...".
+
+ * Fixed a bug where matrix division gave bad result for singular matrix.
+
+ * Fixed a bug which closed Calc window if calcgrabregion got an error.
+
+ * Fixed a bug where `a s' failed on formulas containing dimension errors.
+
+ * Fixed a bug that caused `m F' to hang.
+
+ * Fixed a bug in complex arithmetic that caused problems with solver.
+
+ * Fixed a bug which raised intervals to interval powers incorrectly.
+
+ * Fixed a bug in utpp/ltpp (order of arguments did not match the manual).
+
+ * Fixed a bug in which `t y' rounded yanked data with old precision.
+
+ * Fixed a bug in which "in(3, [3 .. 3))" returned true.
+
+ * Fixed a bug which simplified abs(abs(x)) incorrectly.
+
+ * Fixed a bug in which (a^2)^1:3 was unsafely simplified to a^2:3.
+
+ * Fixed a bug in rewrite system which missed pattern "2 sin(x) cos(x)".
+
+ * Fixed a bug in rewrite system which missed pattern "a  a cos(x)^2".
+
+ * Fixed obsolete trail tags gsmp, gneg, ginv to jsmp, jneg, jinv.
+
+ * Fixed some errors and made improvements in units table [Ulrich Mueller].
+
+
+Version 1.07:
+
+ * Added `m F' (calcsettingsfilename) command.
+
+ * Added calcautoloaddirectory variable.
+
+ * Extended Z ` to accept a prefix argument.
+
+ * Added keystrokes (v h, v k) for head, tail, cons.
+
+ * Extended `v e' to accept a vector as the filler.
+
+ * Changed `V M', `V R' to accept mappingmode keys in uppercase, too.
+
+ * Changed V M ' etc. to accept $, $$, ... as argument indicators.
+
+ * Changed `t y' to accept a prefix argument.
+
+ * Put in a cleaner and safer random number generator for `k r' et al.
+
+ * Fixed a bug which completely broke `a r' command!
+
+ * Fixed "0 * matrix" to generate a zero matrix instead of 0.
+
+ * Fixed a bug in `a R' which sometimes caused it to crash.
+
+ * Fixed a fatal typo in the TeX version of the manual.
+
+ * Fixed a bug that prevented Ck, Cw, Mw from working in Trail buffer.
+
+ * Fixed another bug in `Z P' command.
+
+ * Fixed a bug in `u s' which incorrectly simplified subtractions.
+
+ * Fixed an argumentname aliasing bug evaluating lambda( ) formulas.
+
+ * Fixed overfull hboxes in the manual.
+
+ * Fixed various other bugs in the manual.
+
+
+Version 1.06:
+
+ * Added "calckeypad" mode for X window system users (try it!).
+
+ * Improved "calceval" for calling/operating Calc from userwritten Lisp.
+
+ * Moved vector accumulate command to `V U' (old `H V R' still supported).
+
+ * Added righttoleft reductions: `I V R' and `I V U'.
+
+ * Added set operations on vectors: intersect, union, diff, xor.
+
+ * Added `I v s' to remove a subvector from a vector.
+
+ * Introduced `H ' to append two vectors with no magical special cases.
+
+ * Introduced rhead, rtail, and rcons for isolating last vector element.
+
+ * Changed `g p' to keep temp files around until data actually change.
+
+ * Improved `a S' to solve many higherorder polynomial equations.
+
+ * Added `a P' to produce a vector of all solutions to an equation.
+
+ * Enhanced `a v' and `j v' to allow toplevelonly evaluation.
+
+ * Changed `j DEL' to delete a side of an eqn or ineq, leaving other side.
+
+ * Fixed binding for keys `j 1' through `j 9'.
+
+ * Introduced "let" marker in rewrite rules.
+
+ * Enhanced the "sign" function to provide a twoargument version.
+
+ * Changed "maxspecpdlsize exceeded" error message to be userfriendly.
+
+ * Put "" in the trail in above case and when user presses Cg.
+
+ * Changed TeX mode to generate \ldots instead of \dots, recognize both.
+
+ * Changed "sin(0)" etc. (for integer 0) to generate "0" instead of "0.".
+
+ * Enhanced Programming Tutorial exercise 2.
+
+ * Fixed an error in the answer to Types Tutorial exercise 3.
+
+ * Fixed several bugs relating to head, tail, and cons functions.
+
+ * Fixed some other minor typos in the manual.
+
+ * Fixed several bugs in `Z P' (calcuserdefinepermanent).
+
+ * Fixed several bugs that broke the `g P' command.
+
+
+Version 1.05:
+
+ * Created a calcinstall command to ease installation.
+
+ * Added lots of exercises to the Tutorial section of the manual.
+
+ * Added ability to select and operate on subformulas.
+
+ * Substantially improved the algebraic rewriterule system.
+
+ * Added a set of graphing commands that use GNUPLOT.
+
+ * Added a command (`a R') for finding numerical roots to equations.
+
+ * Added several new math functions, such as erf and Bessel functions.
+
+ * Added key bindings for miscellaneous commands using the "f" prefix key.
+
+ * Added lots of new vector operations, many of them in the spirit of APL.
+
+ * Added more control over vector display, including an abbreviated mode.
+
+ * Improved keyboard macro editing; added readkbdmacro to macedit.el.
+
+ * Introduced the `m S' (calcshiftprefix) command.
+
+ * Enhanced the calcedit command in several ways.
+
+ * Made it possible to hit ` (calcedit) during numeric/algebraic entry.
+
+ * Enhanced the calcsolvefor command to handle inequalities.
+
+ * Enhanced calcsimplify to handle equations and inequalities.
+
+ * Taught log10 and log to look for exact integer or rational results.
+
+ * Added ability to take Nth roots directly.
+
+ * Added "increment" and "decrement" commands for integers and floats.
+
+ * Added "fullhelp" command, changed "h" key to invoke it.
+
+ * Added special help for Inverse and Hyperbolic prefixes.
+
+ * Added an optional prefix argument to `o' (calcrealign).
+
+ * Changed `t s' and `t r' to use RET as the search exit key.
+
+ * Made handling of operator keys for V M, V R, etc. more regular.
+
+ * Improved TeX mode; added support for \matrix format.
+
+ * Added a variant of `m a' mode that only affects ( and [ keys.
+
+ * Fixed "Mismatch" message for algebraic entry of semiopen intervals.
+
+ * Trimmed fat from calc.el to speed loading, moved more to calcext.el.
+
+ * Fixed a bug in which minibuffer entry rounded to outofdate precision.
+
+ * Fixed a bug which crashed Calc 1.04 under Epoch.
+
+ * Fixed a bug which messed up Calc Trail's mode line, among other things.
+
+ * Fixed a bug which caused trail ">" to show only when in Trail buffer.
+
+ * Fixed a bug in which "calc" called "calcgrabregion" with too few args.
+
+ * Fixed bugs in both implementation and documentation of calcperm.
+
+ * Fixed a bug in which calcsimplifyextended always used radians.
+
+ * Fixed a bug where calccomma failed to override "polar" mode.
+
+ * Fixed a bug doing mixed arithmetic on rectangular+polar complex numbers.
+
+ * Fixed several bugs in transcendental functions with complex arguments.
+
+ * Fixed a bug in which `a s' simplified "x / .5" to ".5 x".
+
+ * Fixed numerous other bugs in various parts of Calc.
+
+ * Completed the "Hooks" section of the "Internals" chapter of the manual.
+
+
+Version 1.04:
+
+ * Included a copy of revision history (from README) in calc.el.
+
+ * Added the "calcsplit" feature to split calcext.el into smaller bits.
+
+ * Changed calcunpack to unpack floats and fractions, too.
+
+ * Added "mant", "xpon", and "scf" functions for decomposing floats.
+
+ * Fixed a bug in the "y" command with positive prefix arguments.
+
+ * Rearranged binary shift/rotate command keys to be a bit more convenient.
+
+ * Fixed a bug in which simplifying "(0/0) * 2" crashed with a Lisp error.
+
+ * Made `H F' [ffloor] and friends faster for very large arguments.
+
+ * Made calcdefinedel more robust.
+
+ * Handled pasting of data into the Calculator using the mouse under X.
+
+ * Made overlayarrow variables bufferlocal to avoid interference.
+
+ * Fixed a problem in which Calc Trail buffer got stuck after a Cx Cw.
+
+
+Version 1.03:
+
+ * Changed mathchoose to compute nchoosem faster when m is large.
+
+ * Fixed some problems with TeX mode.
+
+ * Fixed a bug that prevented `b s' from working without a prefix argument.
+
+ * Added "calceval" function.
+
+ * Improved calcgrabregion.
+
+
+Version 1.02:
+
+ * Fixed a bug in Tutorial: telephone pole height/distance were switched!
+
+ * Fixed a few other things in the manual.
+
+ * Added "fullcalc" command.
+
+ * Added "calcinsertvariables" (`Z I') command.
+
+ * Quick Calc now works even if you are already in the minibuffer.
+
+ * Fixed a bug in mathmulbignumdigit which affected mathand, etc.
+
+ * Definition of "Hectares" was wrong in units table.
+
+ * Fixed a bug in calcexecutekbdmacro concerning undo and refresh.
+
+ * Bound "calcundo" to `Cx u' as well as `C_' and `U'.
+
+Version 1.01:
+
+ * Added a tutorial section to the manual.
+
+ * Next and Prev for node Strings in the manual were reversed; fixed.
+
+ * Changed "'bignum" in calcisqrtbignumiter to "'bigpos".
+
+ * Fixed a bug that prevented "$" from working during algebraic entry.
+
+ * Fixed a bug caused by an X (lastX) command following a K (macro) cmd.
+
+ * Fixed a bug in which K command incorrectly formatted stack in Big mode.
+
+ * Added space between unary operators and nonflat compositions.
+ (Otherwise, "(a/b)" in Big mode blended the minus sign into the rule!)
+
+ * Fixed formatting of (1)^n in Big mode.
+
+ * Fixed some problems relating to "not" operator in Pascal language mode.
+
+ * Fixed several bugs relating to V M ' and V M $ sequences.
+
+ * Fixed matrixvector multiplication to produce a vector.
+
+ * Introduced Z ` ... Z ' commands; renamed old Z ' to Z #.
+
+ * Fixed various other bugs.
+
+ * Added calcsettingsfile variable suggested by C. Witty.
+
+
+Version 1.00:
+
+ * First official release of Calc.
+
+ * If you used the Beta test version (0.01), you will find that this
+ version of Calc is over 50% larger than the original release.
+ General areas of improvement include much better algebra features;
+ operations on units; language modes; simplification modes; interval
+ arithmetic; vector mapping and reduction. Other new commands include
+ calcfraction and calcgrabregion. The program has been split into
+ two parts for faster loading, and the manual is more complete.
This file is part of GNU Emacs.
=== modified file 'etc/ChangeLog'
 etc/ChangeLog 20130110 03:43:02 +0000
+++ etc/ChangeLog 20130201 03:58:50 +0000
@@ 1,3 +1,7 @@
+20130201 Glenn Morris
+
+ * CALCNEWS: Move here from lisp/calc/README, README.prev.
+
20121223 Jan Djärv
* TODO: Adjust entry about NS event loop.
=== modified file 'lisp/ChangeLog'
 lisp/ChangeLog 20130201 03:51:08 +0000
+++ lisp/ChangeLog 20130201 03:58:50 +0000
@@ 2,6 +2,8 @@
* calc/calchelp.el (calcviewnews): Use viewemacsnews.
+ * calc/README, calc/README.prev: Rename/merge to etc/CALCNEWS.
+
20130131 Michael Albinus
* net/tramp.el (tramptrampfilep): Comment check for
=== removed file 'lisp/calc/README.prev'
 lisp/calc/README.prev 20130101 09:11:05 +0000
+++ lisp/calc/README.prev 19700101 00:00:00 +0000
@@ 1,998 +0,0 @@
Copyright (C) 20012013 Free Software Foundation, Inc.
See the end of the file for license conditions.


Summary of changes to "Calc" Preceding 2.00
      


Version 2.00:

 * Changed to compile calcmacs/maint, to allow "cp *.elc newdir".

 * Improved calcdescribebindings to avoid showing redundant ESC maps.


Version 2.00 beta 3:

 * Removed version numbers from most .el files to reduce size of patches.

 * Added a "calcversion" command.

 * Changed `M# ? ?' to allow for modified describefunction.

 * Changed date parser to accept "Sept" as an alternative for "Sep".

 * Inhibited answers to exercise from showing up in table of contents.

 * Changed Makefile to say "texindex calc.[cfkptv]?" to avoid "calc.el".

 * Fixed up the Makefile in various other ways.

 * Rearranged banner at top of `h h' command's output.

 * Changed "make summary" to print "Calc Summary" on the title page.

 * Added "IntegSimpRules".

 * Added `M# :', `M# _', and `M# Z' options.

 * Changed `^' to evaluate "[3..1]^2" properly.

 * Improved `f g' to give symbolic answers for, e.g., 101:2 and 3:2.

 * Fixed a bug where `h k RET' didn't find the right place on the page.

 * Fixed a bug that formatted "x*(y ? a : b)" as "x y ? a : b".

 * Fixed a bug where defmath translated (< x 0) as (mathposp x)!

 * Fixed a bug that prevented quickcalc from working sometimes.

 * Fixed the `z ?' bug again (maybe this time for good?).

 * Fixed a bug in which `V ^' (vint) was just plain wrong, wrong, wrong!

 * Scanned for and fixed remaining bugs relating to autoloading.


Version 2.00 beta 2:

 * Changed "make info" to try "make texinfo" if "makeinfo" not found.

 * Changed to "New for Calc 2.00"; texinfo.tex chokes on apostrophes.

 * Added List Tutorial Exercise 14 (just in case there weren't enough!).

 * Added a discussion of the `Z F' command to the Programming Tutorial.

 * Improved `H a f' not to lose info if input is partially prefactored.

 * Improved simplification of expressions like sqrt(3) + 3^3:2.

 * Changed Big mode to omit "*" in expressions like 2 sqrt(3) 5^3:4.

 * Replaced European date format D/M/Y with D.M.Y.

 * Changed `a N' and `a X' to consider the endpoints of the interval.

 * Fixed a bug where TeX mode made c*(1+a/b) look like a function call.

 * Fixed a bug formatting toplevel evalto's while using selections.

 * Fixed a bug that caused `z ?' to crash.

 * Fixed a bug where `Z F' broke for argument names "t" and "nil".

 * Fixed several bugs relating to autoloading.


Version 2.00 beta 1:

 * Added "What's new in Calc 2.00" to the manual (summary of info below).

 * Added support for many GNUPLOT 3.0 features.

 * Tweaked the Makefile and calccompile a bit more.

 * Modified to work with Zawinski's/Furuseth's optimizing byte compiler.

 * Modified Calc to garbagecollect less often (raised gcconsthreshold).

 * Changed quickcalc to avoid autoloading so many parts of Calc.

 * Changed Calc subfiles to work properly if not bytecompiled.

 * Renamed `M# s' to `M# j', made `M# s' be equivalent to `h s'.

 * Changed calcquit to avoid reapportioning space among other windows.

 * Added `MDEL' (calcpopabove) key, to DEL as LFD is to RET.

 * Added `{' and `}' to scroll vertically, analogous to `<' and `>'.

 * Added `m t' for "total" algebraic mode.

 * Added `d , \' option to group digits with "\,".

 * Improved support of "prime" accent in "eqn" language mode.

 * Changed macedit's readkbdmacro to accept a string argument in Lisp.

 * Changed calccheckdefines to use a more concise runhooks linkage.

 * Changed autowhy mode not to say [w=more] if next msg is not urgent.

 * Made `a d' able to differentiate "a?b:c" and "a_i" formulas.

 * Changed probability dist. functions to work with `a f' and `a d'.

 * Added special constants "phi" and "gamma".

 * Added "poly" function, simpler cousin of "gpoly".

 * Added "pdeg", "plead", "pcont", "pprim"; cleaned up "pdiv" and "pgcd".

 * Added `a p' command for polynomial interpolation.

 * Added `a I' command for numerical integration; made IntegLimit variable.

 * Added `a f' to factor polynomials; moved old `a f' to `a "'.

 * Added `a a' to do partial fraction decompositions.

 * Improved `a i' to integrate many more kinds of formulas.

 * Modified `a P' to find numerical roots of highdegree polynomials.

 * Modified `c 0' through `c 9' to convert intvalued floats to integers.

 * Made sinh, arctanh, etc., expandable into exps/logs by `a f'.

 * Added more algebraic simplifications having to do with logs and exps.

 * Changed `s s', `s t', `s x', `s l' to accept an equation at prompt.

 * Changed `s i' not to store Decls if its value is the default, [].

 * Changed `s i' to store in `d O' language mode if in Normal or Big mode.

 * Rearranged `V M'/`V R' matrix mapping modes.

 * Added <#1+#2> notation for lambda expressions.

 * Extended `b l' and other binary shifts to have a 2argument version.

 * Changed `u c' and `u t' to give unitless result for unitless input.

 * Changed sqrt(1cos(x)^2)tosin(x) to be an unsafe simplification.

 * Improved simplification of sqrts, e.g., sqrt(a^2 x + a^2 y).

 * Changed solver to treat (xa)(xb)(xc) more intelligently.

 * Changed Pascal language mode to use "$FFFF" for hexadecimal numbers.

 * Added support for nondecimal display of floats.

 * Changed `p' to refresh stack display if current float format uses it.

 * Changed Big mode to use subscript notation for log10(x), log(x,b), r#nnn.

 * Changed Big mode to format deriv(u,x) and tderiv(u,x) as du/dx.

 * Changed Big mode to format integ(1/x,x) as "dx/x" instead of "1/x dx".

 * Added "tty" output type for graphics commands.

 * Documented Calc's random number generation algorithm in the manual.

 * Fixed a bug involving having "(setq calctiming t)" in .emacs.

 * Fixed a bug that incorrectly parsed "x  1" in TeX mode.

 * Fixed bugs and made improvements in `a R' when widening the guess.

 * Fixed a bug that where `a S' didn't solve (x  a)^2 = (x  b)^2.

 * Fixed a bug that sometimes crashed `a P' on systems of equations.

 * Fixed a bug that prevented `b p' (calcpackbits) from working.

 * Fixed some bugs in which certain functions didn't get autoloaded.

 * Fixed a bug in which the date <1/1/13> was incorrectly parsed.

 * Fixed a bug which prevented `j D' from expanding (a+b)/c.

 * Fixed a bug in solver: bad inverses for sinh and cosh.

 * Fixed a bug in mathpossiblesigns that failed for x*0.

 * Fixed a bug where sqrt(a) was rewritten sqrt(a)*i even if a<0.

 * Fixed a bug in line breaker when first "word" of line was too long.

 * Worked around a makeinfo bug that handled @end group/@group badly.


Version 2.00 alpha 3:

 * Changed logic for locating component .elc files to be even smarter.

 * Changed "make install" to "make compile"; added different "make install".

 * Improved "make compile" to check file dates and compile only when needed.

 * Made output of "make compile" in batch mode more compact and readable.

 * Replaced "Quick Overview" in manual with "Demonstration of Calc".

 * Changed to use keymaps for dispatching M# and h prefix keys.

 * Added TAGS target to the Calc Makefile.

 * Removed most doc strings from functions; new help commands are better.

 * Got rid of some crufty "fset" calls that were cluttering the code.

 * Split calcgrabregion into two functions, calcgrabregion/rectangle.

 * Swapped positions of stack and trail in fullcalckeypad display.

 * Improved linebreaking algorithm for displaying long formulas.

 * Improved display of control characters in vectors shown as strings.

 * Changed `d o' to allow fraction format to specify desired denominator.

 * Changed `M# y' to respect overwrite mode in target buffer.

 * Added `H' prefix to displaymode commands to suppress stack refresh.

 * Changed "calcwhy" mechanism to display urgent messages automatically.

 * Handled taking derivatives of symbolic integrals and viceversa.

 * Handled integrating vectors of formulas.

 * Incorporated Ewerlid's polynomial division and GCD functions into Calc.

 * Improved algebraic operations on "mod" forms, esp. polynomials.

 * Added some more financial functions (sln, syd, ddb).

 * Added nest, anest, fixp, and afixp (`H V R' and `H V U') functions.

 * Added `a .' (calcremoveequal) command to take apart equations.

 * Generalized dfact to work for negative odd integers; added !! syntax.

 * Changed `k f' to factor 1, 0, and negative integers.

 * Changed `u M', etc., to accept +/ and [ .. ] forms as distributions.

 * Changed `g q' to remove *Gnuplot Commands/Trail* window if present.

 * Added support for Francois Pinard's "dumb terminal" driver for GNUPLOT.

 * Added ":: remember" feature for rewrite rules.

 * Changed rewrites to let pattern "a*b" match "x/2" with a=x, b=1/2.

 * Added ability to put function names like "simplify" in rewrite schedule.

 * Added "Rewrites Tutorial" to the manual.

 * Changed ` to bind RET as newline instead of finish if editing a vector.

 * Added some new exercises to the List Tutorial.

 * Changed `Z F', `V M', etc. not to remove stored vars from def arg list.

 * Added parsing for /1, 2, 3/ notation for Fortran mode vectors.

 * Added a "%%" syntax for comments in formulas being read.

 * Fixed a bug in which failing `h k' removed an existing Info window.

 * Fixed a bug in `j /' operating on subformulas like "a + b".

 * Fixed a bug in which "inf = inf" undesirably evaluated to 1.

 * Fixed a bug that simplified "0 = 1 + a + 2" to "0 = a".

 * Fixed a bug that failed for rewrite patterns like "fib(1  2)".

 * Fixed a bug that arose because rewrite programs are nonreentrant.


Version 2.00 alpha 2:

 * Changed LFD terminating algebraic entry to push in nosimplify mode.

 * Changed so that `K ' interprets `' as calcminus, not neg prefix arg.

 * Improved `h c' command to understand all Calc key sequences.

 * Fixed problems with DistribRules, NegateRules, and FitRules.

 * Fixed several bad node pointers in the manual.

 * Fixed a bug in `h Cw' when used with makeinfoformatted manuals.

 * Fixed a bug in sqrt(1) when Polar and HMS modes are enabled.

 * Fixed/improved dscalar and deven functions; added dodd.

 * Fixed a bug in polynomial handling that also affected sum(sin(k),k,1,n).

 * Fixed various other glitches in the manual.


Version 2.00 alpha 1:

 * Calc's tar file now creates a calc(version) directory to unpack into.

 * Calc now comes with a Makefile; install with "make install".

 * Calc now comes already split into many files; installation is much simpler.

 * Changed base file name of the manual from "calcinfo" to "calc.info".

 * Key binding for `M# w' was documented but not implemented.

 * Bound M# ' to be synonymous with `M# f' (used to be `M# q').

 * Changed M# M# to use last interface of C or K; E no longer counts.

 * Changed `i' (and `M# i') not to return to Top node unnecessarily.

 * Changed `h' to be a prefix key with various help commands.

 * Changed `s' to be a prefix key with various store and recall commands.

 * Keys `i', `r', and `l' are obsolete (moved to `h' and `s' prefixes).

 * Rearranged `K', `X', and `MRET' keys; `K' is now calckeepargs.

 * Changed quickcalc to display input formula as well as output if room.

 * Changed quickcalc to interact with the editing buffer and kill ring.

 * Created pack, unpack, unpackt function equivalents of `v p', `v u'.

 * Changed to expand (a/b)^x to a^x/b^x only if b > 0 (not if a > 0).

 * Changed mathpossiblesigns to understand sqrt function.

 * Changed Z [, rewrites to consider any provably nonzero value as true.

 * Changed normal language modes to accept ** as a synonym for ^.

 * Added "maple" language mode.

 * Changed, e.g., Mathematica "(2 + 3 I)^(1.23*10^20)" to include parens.

 * Generalized mathcomposebig properties for all language modes.

 * Introduced "string" and other function for composing expressions.

 * Changed many recursive vector routines to use loops instead.

 * Added evalv, evalvn function equivalents to `=', `N'.

 * Changed "expr =>" not to evaluate at all if in nosimplify mode.

 * Redesigned user interface of `a F' (calccurvefit) command.

 * Added "phase" feature to the rewrite rule system.

 * Added "&&&", "", "!!!" to the rewrite rule system.

 * Introduced a new notation for rewrites: LHS := RHS :: COND.

 * Changed `a r' (but not `j r') to repeat 100 times by default.

 * Integrated EvalRules more cleanly into the default simplifications.

 * Added `H v l' [mdims] to measure the dimensions of a matrix.

 * Changed `u c' to interpret "/units" as "1/units".

 * Added `u a' to adjust unit prefix letters automatically.

 * Changed `u s' to enable scalar mode while simplifying.

 * Changed `c f' [pfloat] not to float integer powers or subscripts.

 * Added a threeargument form for the "hms" function.

 * Changed, e.g., sin(90) degrees to produce 1 instead of 1.0.

 * Changed symbolic mode to prefer sqrt(int): abs([1 2 3]) => sqrt(14).

 * Enhanced solver to handle, e.g., x + 1/x = a; exp(x) + exp(x) = a.

 * Enhanced simplifier to handle, e.g., exp(a+2) / e^a => e^2.

 * Enhanced `a s' to simplify sqrt(x)  x^1:2 and exp(x)  e^x to 0.

 * Added (a + b) to a  b as a default simplification.

 * Added rules for differentiating sum() and prod() functions.

 * Added a few more energy units (due to Przemek Klosowski).

 * Added overflow/underflow checking for all floatingpoint arithmetic.

 * Extended error forms to work with complex numbers.

 * Generalized GCD to handle fractional arguments.

 * Changed graphics routines to evaluate "x" values, e.g., [pi .. pi].

 * Added `g q', like `g K' but without viewing the Gnuplot Trail.

 * Changed `g p' and `V M' to display better "Working..." messages.

 * Modified `M# g' to be more robust about grabbing formulas.

 * Added `Y' prefix key reserved for userwritten extensions.

 * Added calcloadhook and calcextloadhook.

 * Prevented calcinstall from leaving large ~ files behind.

 * Changed @bullet to @bullet{} in manual to conform to texinfo spec.

 * Rearranged some chapters in the manual to be a bit more logical.

 * Added calcsplitsummary command.

 * Fixed several bugs in embedded mode.

 * Fixed a bug in calcvectorcovariance that required a prefix arg.

 * Fixed a bug that prevented parsing "a=>" with no righthand side.

 * Fixed a bug which allowed incorrectly dividing a vector by a vector.

 * Fixed a bug formatting sum(...)^2 in Big mode.

 * Fixed a bug that prevented Calc from deleting old graphics temp files.

 * Fixed some typos calling calcinversefunc instead of calcinvertfunc.

 * Fixed bugs in the derivatives of conj, deg, and rad; added re, im.

 * Fixed a bug where (r;theta) parsed as r exp(theta i) even in Deg mode.

 * Fixed a bug which gave wrong answer for exp of a polar complex number.

 * Fixed a bug in `Z F' that failed if formula used nonarg variables.

 * Fixed a bad pointer to Info node "Assignments in Embedded Mode".

 * Fixed several errors in the Calc Summary.


Version 1.08 beta 1:

 * Calc's copyright has been assigned to FSF, for inclusion in Emacs 19!

 * Changed M# to be a twokey sequence; use M# M# to start Calc now.

 * Rewrote and expanded the introductory chapter of the manual.

 * Added a key and function summary to the manual.

 * Changed the manual to take better advantage of TeX's math formatting.

 * Changed manual to be printable in @smallbook format.

 * Added "calcembedded" mode.

 * Added "=>" [evalto] operator.

 * Added facilities for date and date/time arithmetic.

 * Added a set of financial functions (pv, fv, etc.).

 * Added infinite quantities inf, uinf, and nan (plus infinite intervals).

 * Added "EvalRules", "SimpRules", and "ExtSimpRules" variables.

 * Added sum and product commands `a +', `a ', `a *', `a T'.

 * Enhanced `a S' and `a P' to solve systems of equations.

 * Enhanced solver to handle eqns like sin(x) = cos(2 x), sqrt(x) + x = 1.

 * Added `a M' (calcmapequation) command.

 * Added new statistical functions: mean, standard deviation, etc.

 * Added line, polynomial, and curve fitting commands (`a L' and `a F').

 * Added support for composite units, e.g., "mi+ft+in".

 * Enhanced "Big" mode to format square roots, choose, and powers better.

 * Enhanced "Big" mode to display fractions in large notation.

 * Added several alternate formats for matrix display.

 * Changed TeX mode to write "(1 + x^2)" instead of "\left(1 + x^2\right)".

 * Added support for relational operators in TeX and FORTRAN modes.

 * Added recognition of accents like \dot, \tilde, \underline in TeX mode.

 * Added "eqn" language mode.

 * Added extra control over display justification with `d <', `d =', `d >'.

 * Added calcleftlabel and calcrightlabel (`d {', `d }').

 * Added "nn%" syntax for algebraic formulas; equivalent to "nn * .01".

 * Added input syntaxes like a = b = c, a != b != c, a <= b < c.

 * Changed "_" to mean subscripts; old use of "_" in vars is now "#".

 * Introduced "matrix mode" and "scalar mode" (`m v').

 * Introduced generic identity matrices (idn(1)).

 * Added a method for declaring variables to be real, integer, > 0, etc.

 * Added `Z S' command for editing stored value of a variable.

 * Added "subst" algebraic function equivalent to the `a b' command.

 * Added `a f' command, changed deriv/integ/solvefor to use it.

 * Improved `a s' to simplify (x + y) (y + x) to (x + y)^2.

 * Improved `a s' to simplify i^2 to 1.

 * Improved `a s' to simplify, e.g., sin(pi/3) in Symbolic mode.

 * Improved `a s' to simplify sqrt(8) to 2 sqrt(2), 1/sqrt(2) to sqrt(2)/2.

 * Moved sin(arccos(x)) from `a e' to `a s'; not unsafe after all!

 * Changed (x y)^z => x^z y^z to be a usuallyunsafe simplification.

 * Added thorough documentation of `a s' and `a e' to the manual.

 * Improved `a c' to collect "f(a)" even if "a" also appears elsewhere.

 * Introduced lin, linnt, islin, islinnt functions for linearity testing.

 * Improved `a x' to use binomial theorem to give simpler answers.

 * Improved `j D' to distribute powers of sums: (a + b)^n.

 * Improved `j M' to merge products of powers (may need nosimplify mode).

 * Changed to use defvar for DistribRules etc. so `Z V' works with them.

 * Improved `j *' and `j /' to work properly in a few more cases.

 * Improved `V R' to use identity value when reducing empty vectors.

 * Improved `v p' and `v u' to support more complex packing operations.

 * Disabled automatic simplification of sqrt(2)/2 to 1/sqrt(2).

 * Bound SPC and RET to press, TAB to nextmenu in *Calc Keypad* buffer.

 * Added Cu ' to do algebraic entry with language mode forced to normal.

 * Added "$1", "$2", etc. input notation for algebraic entry.

 * Changed unary operators like `n', `&' to treat neg prefix args like RET.

 * Changed ` (calcedit) to show full precision regardless of float format.

 * Enhanced quickcalc to display integers in several formats.

 * Documented `g H' (calcgraphhide) command (had been left from manual).

 * Enhanced floor/ceil/trunc/round in several ways.

 * Added rounde and roundu functions.

 * Changed `c 1' through `c 9' to change small floats to 0.0; added `c 0'.

 * Enhanced set operations to work on sets of intervals.

 * Fixed erf(0), utpn(x,x,y), and arccosh(1) to work properly.

 * Changed complex arctan and arctanh to follow Steele 2nd edition.

 * Expanded "Branch Cuts" section of the manual with some useful tables.

 * Rearranged order of words in mode line to be a bit more logical.

 * Changed `m N' (numsimplify) mode to evaluate constant vectors, too.

 * Changed `a r'/`j r' to prompt twice for separate LHS/RHS if necessary.

 * Enhanced `let(v,x)' in rewrites by allowing arbitrary patterns for v.

 * Changed cursor positioning in second prompt for `a b' (calcsubstitute).

 * Changed `y' to omit line numbers more consistently.

 * Changed `o' (calcrealign) to reset horizontal scrolling to zero, also.

 * Added "pred" mode for calceval.

 * Added "calcreportbug" as an alias for "reportcalcbug".

 * Added `Z T' and "calcpasserrors" to aid debugging Calcrelated code.

 * Added "calcloadeverything" (`m X' or `M# L') command.

 * Enhanced calcinstall to prebuild units table, CommuteRules, etc.

 * Changed Calc to interact more gracefully with loadpath.

 * Changed Lisp Variable Index in manual to include user variables, too.

 * Fixed a bug that prevented calcinstall from working under VMS.

 * Fixed a bug that sometimes crashed rewrites dealing with subtractions.

 * Fixed a bug that prevented `a S' from solving "3  x = 1 + x"!

 * Fixed a bug in solver that crashed for certain cubics and quartics.

 * Fixed a bug in calcsimplify that crashed for equations and ineqs.

 * Fixed a bug which placed the "[" oddly in `d B' + `v /' mode.

 * Fixed a bug where finishing calcedit improperly obeyed language mode.

 * Fixed a bug formatting (1)^n in Big mode after selection commands.

 * Fixed a bug that got ">=" and "<=" backwards in rewrite conditions.

 * Fixed a bug that broke the `"x"' key in calckeypad mode.

 * Fixed a bug in which `MAP$' in calckeypad didn't display "Working...".

 * Fixed a bug where matrix division gave bad result for singular matrix.

 * Fixed a bug which closed Calc window if calcgrabregion got an error.

 * Fixed a bug where `a s' failed on formulas containing dimension errors.

 * Fixed a bug that caused `m F' to hang.

 * Fixed a bug in complex arithmetic that caused problems with solver.

 * Fixed a bug which raised intervals to interval powers incorrectly.

 * Fixed a bug in utpp/ltpp (order of arguments did not match the manual).

 * Fixed a bug in which `t y' rounded yanked data with old precision.

 * Fixed a bug in which "in(3, [3 .. 3))" returned true.

 * Fixed a bug which simplified abs(abs(x)) incorrectly.

 * Fixed a bug in which (a^2)^1:3 was unsafely simplified to a^2:3.

 * Fixed a bug in rewrite system which missed pattern "2 sin(x) cos(x)".

 * Fixed a bug in rewrite system which missed pattern "a  a cos(x)^2".

 * Fixed obsolete trail tags gsmp, gneg, ginv to jsmp, jneg, jinv.

 * Fixed some errors and made improvements in units table [Ulrich Mueller].


Version 1.07:

 * Added `m F' (calcsettingsfilename) command.

 * Added calcautoloaddirectory variable.

 * Extended Z ` to accept a prefix argument.

 * Added keystrokes (v h, v k) for head, tail, cons.

 * Extended `v e' to accept a vector as the filler.

 * Changed `V M', `V R' to accept mappingmode keys in uppercase, too.

 * Changed V M ' etc. to accept $, $$, ... as argument indicators.

 * Changed `t y' to accept a prefix argument.

 * Put in a cleaner and safer random number generator for `k r' et al.

 * Fixed a bug which completely broke `a r' command!

 * Fixed "0 * matrix" to generate a zero matrix instead of 0.

 * Fixed a bug in `a R' which sometimes caused it to crash.

 * Fixed a fatal typo in the TeX version of the manual.

 * Fixed a bug that prevented Ck, Cw, Mw from working in Trail buffer.

 * Fixed another bug in `Z P' command.

 * Fixed a bug in `u s' which incorrectly simplified subtractions.

 * Fixed an argumentname aliasing bug evaluating lambda( ) formulas.

 * Fixed overfull hboxes in the manual.

 * Fixed various other bugs in the manual.


Version 1.06:

 * Added "calckeypad" mode for X window system users (try it!).

 * Improved "calceval" for calling/operating Calc from userwritten Lisp.

 * Moved vector accumulate command to `V U' (old `H V R' still supported).

 * Added righttoleft reductions: `I V R' and `I V U'.

 * Added set operations on vectors: intersect, union, diff, xor.

 * Added `I v s' to remove a subvector from a vector.

 * Introduced `H ' to append two vectors with no magical special cases.

 * Introduced rhead, rtail, and rcons for isolating last vector element.

 * Changed `g p' to keep temp files around until data actually change.

 * Improved `a S' to solve many higherorder polynomial equations.

 * Added `a P' to produce a vector of all solutions to an equation.

 * Enhanced `a v' and `j v' to allow toplevelonly evaluation.

 * Changed `j DEL' to delete a side of an eqn or ineq, leaving other side.

 * Fixed binding for keys `j 1' through `j 9'.

 * Introduced "let" marker in rewrite rules.

 * Enhanced the "sign" function to provide a twoargument version.

 * Changed "maxspecpdlsize exceeded" error message to be userfriendly.

 * Put "" in the trail in above case and when user presses Cg.

 * Changed TeX mode to generate \ldots instead of \dots, recognize both.

 * Changed "sin(0)" etc. (for integer 0) to generate "0" instead of "0.".

 * Enhanced Programming Tutorial exercise 2.

 * Fixed an error in the answer to Types Tutorial exercise 3.

 * Fixed several bugs relating to head, tail, and cons functions.

 * Fixed some other minor typos in the manual.

 * Fixed several bugs in `Z P' (calcuserdefinepermanent).

 * Fixed several bugs that broke the `g P' command.


Version 1.05:

 * Created a calcinstall command to ease installation.

 * Added lots of exercises to the Tutorial section of the manual.

 * Added ability to select and operate on subformulas.

 * Substantially improved the algebraic rewriterule system.

 * Added a set of graphing commands that use GNUPLOT.

 * Added a command (`a R') for finding numerical roots to equations.

 * Added several new math functions, such as erf and Bessel functions.

 * Added key bindings for miscellaneous commands using the "f" prefix key.

 * Added lots of new vector operations, many of them in the spirit of APL.

 * Added more control over vector display, including an abbreviated mode.

 * Improved keyboard macro editing; added readkbdmacro to macedit.el.

 * Introduced the `m S' (calcshiftprefix) command.

 * Enhanced the calcedit command in several ways.

 * Made it possible to hit ` (calcedit) during numeric/algebraic entry.

 * Enhanced the calcsolvefor command to handle inequalities.

 * Enhanced calcsimplify to handle equations and inequalities.

 * Taught log10 and log to look for exact integer or rational results.

 * Added ability to take Nth roots directly.

 * Added "increment" and "decrement" commands for integers and floats.

 * Added "fullhelp" command, changed "h" key to invoke it.

 * Added special help for Inverse and Hyperbolic prefixes.

 * Added an optional prefix argument to `o' (calcrealign).

 * Changed `t s' and `t r' to use RET as the search exit key.

 * Made handling of operator keys for V M, V R, etc. more regular.

 * Improved TeX mode; added support for \matrix format.

 * Added a variant of `m a' mode that only affects ( and [ keys.

 * Fixed "Mismatch" message for algebraic entry of semiopen intervals.

 * Trimmed fat from calc.el to speed loading, moved more to calcext.el.

 * Fixed a bug in which minibuffer entry rounded to outofdate precision.

 * Fixed a bug which crashed Calc 1.04 under Epoch.

 * Fixed a bug which messed up Calc Trail's mode line, among other things.

 * Fixed a bug which caused trail ">" to show only when in Trail buffer.

 * Fixed a bug in which "calc" called "calcgrabregion" with too few args.

 * Fixed bugs in both implementation and documentation of calcperm.

 * Fixed a bug in which calcsimplifyextended always used radians.

 * Fixed a bug where calccomma failed to override "polar" mode.

 * Fixed a bug doing mixed arithmetic on rectangular+polar complex numbers.

 * Fixed several bugs in transcendental functions with complex arguments.

 * Fixed a bug in which `a s' simplified "x / .5" to ".5 x".

 * Fixed numerous other bugs in various parts of Calc.

 * Completed the "Hooks" section of the "Internals" chapter of the manual.


Version 1.04:

 * Included a copy of revision history (from README) in calc.el.

 * Added the "calcsplit" feature to split calcext.el into smaller bits.

 * Changed calcunpack to unpack floats and fractions, too.

 * Added "mant", "xpon", and "scf" functions for decomposing floats.

 * Fixed a bug in the "y" command with positive prefix arguments.

 * Rearranged binary shift/rotate command keys to be a bit more convenient.

 * Fixed a bug in which simplifying "(0/0) * 2" crashed with a Lisp error.

 * Made `H F' [ffloor] and friends faster for very large arguments.

 * Made calcdefinedel more robust.

 * Handled pasting of data into the Calculator using the mouse under X.

 * Made overlayarrow variables bufferlocal to avoid interference.

 * Fixed a problem in which Calc Trail buffer got stuck after a Cx Cw.


Version 1.03:

 * Changed mathchoose to compute nchoosem faster when m is large.

 * Fixed some problems with TeX mode.

 * Fixed a bug that prevented `b s' from working without a prefix argument.

 * Added "calceval" function.

 * Improved calcgrabregion.


Version 1.02:

 * Fixed a bug in Tutorial: telephone pole height/distance were switched!

 * Fixed a few other things in the manual.

 * Added "fullcalc" command.

 * Added "calcinsertvariables" (`Z I') command.

 * Quick Calc now works even if you are already in the minibuffer.

 * Fixed a bug in mathmulbignumdigit which affected mathand, etc.

 * Definition of "Hectares" was wrong in units table.

 * Fixed a bug in calcexecutekbdmacro concerning undo and refresh.

 * Bound "calcundo" to `Cx u' as well as `C_' and `U'.

Version 1.01:

 * Added a tutorial section to the manual.

 * Next and Prev for node Strings in the manual were reversed; fixed.

 * Changed "'bignum" in calcisqrtbignumiter to "'bigpos".

 * Fixed a bug that prevented "$" from working during algebraic entry.

 * Fixed a bug caused by an X (lastX) command following a K (macro) cmd.

 * Fixed a bug in which K command incorrectly formatted stack in Big mode.

 * Added space between unary operators and nonflat compositions.
 (Otherwise, "(a/b)" in Big mode blended the minus sign into the rule!)

 * Fixed formatting of (1)^n in Big mode.

 * Fixed some problems relating to "not" operator in Pascal language mode.

 * Fixed several bugs relating to V M ' and V M $ sequences.

 * Fixed matrixvector multiplication to produce a vector.

 * Introduced Z ` ... Z ' commands; renamed old Z ' to Z #.

 * Fixed various other bugs.

 * Added calcsettingsfile variable suggested by C. Witty.


Version 1.00:

 * First official release of Calc.

 * If you used the Beta test version (0.01), you will find that this
 version of Calc is over 50% larger than the original release.
 General areas of improvement include much better algebra features;
 operations on units; language modes; simplification modes; interval
 arithmetic; vector mapping and reduction. Other new commands include
 calcfraction and calcgrabregion. The program has been split into
 two parts for faster loading, and the manual is more complete.


This file is part of GNU Emacs.

GNU Emacs is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see .
=== modified file 'makedist'
 makedist 20130110 04:00:02 +0000
+++ makedist 20130201 03:58:50 +0000
@@ 314,7 +314,7 @@
echo "Making links to \`lisp' and its subdirectories"
files=`find lisp \( name '*.el' o name '*.elc' o name 'ChangeLog*' \
 o name 'README*' \)`
+ o name 'README' \)`
### Don't distribute siteinit.el, siteload.el, or default.el.
for file in lisp/Makefile.in lisp/makefile.w32in $files; do

revno: 111643
committer: Glenn Morris
branch nick: trunk
timestamp: Thu 20130131 19:51:08 0800
message:
Merge calc news from lisp/calc/README into etc/NEWS files
* doc/misc/calc.texi (Help Commands): Update calcviewnews description.
* lisp/calc/calchelp.el (calcviewnews): Use viewemacsnews.
* lisp/calc/README: Move news entries from here...
* etc/NEWS, etc/NEWS.23: ... to here
diff:
=== modified file 'doc/misc/ChangeLog'
 doc/misc/ChangeLog 20130124 09:43:32 +0000
+++ doc/misc/ChangeLog 20130201 03:51:08 +0000
@@ 1,3 +1,7 @@
+20130201 Glenn Morris
+
+ * calc.texi (Help Commands): Update calcviewnews description.
+
20130124 Michael Albinus
* tramp.texi (Filename Syntax): Filenames must be unibyte strings.
=== modified file 'doc/misc/calc.texi'
 doc/misc/calc.texi 20130102 16:13:04 +0000
+++ doc/misc/calc.texi 20130201 03:51:08 +0000
@@ 9909,9 +9909,8 @@
@kindex h n
The @kbd{h n} or @kbd{h Cn} (@code{calcviewnews}) command displays
the ``news'' or change history of Calc. This is kept in the file
@file{README}, which Calc looks for in the same directory as the Calc
source files.
+the ``news'' or change history of Emacs, and jumps to the most recent
+portion concerning Calc (if present).
@kindex h Cc
@kindex h Cd
=== modified file 'etc/NEWS'
 etc/NEWS 20130131 02:57:35 +0000
+++ etc/NEWS 20130201 03:51:08 +0000
@@ 107,6 +107,8 @@
The value (YEAR MONTH DAY) means to start using the Gregorian calendar
on the given date.
+*** Support for ISO 8601 dates.
+
** ERC
*** New option `ercaccidentalpastethresholdseconds'.
@@ 719,6 +721,12 @@
*** Option `Buffermenubuffer+sizewidth' is now obsolete.
Use `Buffermenunamewidth' and `Buffermenusizewidth' instead.
+** Calc
+
+*** Algebraic simplification mode is now the default.
+To restrict to the limited simplifications given by the former
+default simplification mode, use `m I'.
+
** Calendar
*** You can customize the header text that appears above each calendar month.
@@ 1648,6 +1656,23 @@
*** The default browser used by the package is now the "xdgopen" program,
on platforms that support it. This calls your desktop's preferred browser.
+** Calc
+
+*** Support for musical notes.
+
+*** Support for logarithmic units.
+
+*** No longer uses the tex prefix for TeX specific unit names when
+using TeX or LaTeX mode.
+
+*** New option to highlight selections using faces.
+
+*** `calchistogram' has the option of using a vector to determine the bins.
+
+*** New "O" option prefix.
+
+*** Use the "O" prefix to "d r" (`calcradix') to turn on twoscomplement mode.
+
** Calendar, Diary, and Appt
*** Diary entries can contain nonprinting "comments".
=== modified file 'etc/NEWS.23'
 etc/NEWS.23 20130101 09:11:05 +0000
+++ etc/NEWS.23 20130201 03:51:08 +0000
@@ 329,6 +329,8 @@
useremacsdirectory; but the old location, ~/.calc.el, is used if
that file exists.
+*** New twoscomplement display.
+
*** Graphing commands (`g f' etc.) now work on MSWindows, if you have
the native Windows port of Gnuplot version 3.8 or later installed.
@@ 1372,6 +1374,30 @@
bookmark.el can read a .emacs.bmk file saved by an older Emacs, but an
older Emacs cannot read one saved by Emacs 23.
+** Calc
+
+*** `j *' (calselmultbothsides) has an option to expand the denominator.
+
+*** `calcembeddedwordregexp' is used for finding words in
+`calcembeddedword' in place of delimiters.
+
+*** The separate Calc version number has been removed; use the Emacs
+version for reference.
+
+*** Support for using registers.
+
+*** Support for Yacas, Maxima and Giac languages.
+
+*** Addition of a menu.
+
+*** Logistic nonlinear curves have been added to curvefitting.
+
+*** New option to plot data points and curve when curvefitting.
+
+*** Unit conversions are now exact when possible.
+
+*** The precedence of negation has been lowered.
+
** Calendar and diary
*** There is a new date style, `iso', essentially year/month/day.
=== modified file 'lisp/ChangeLog'
 lisp/ChangeLog 20130131 08:33:03 +0000
+++ lisp/ChangeLog 20130201 03:51:08 +0000
@@ 1,3 +1,7 @@
+20130201 Glenn Morris
+
+ * calc/calchelp.el (calcviewnews): Use viewemacsnews.
+
20130131 Michael Albinus
* net/tramp.el (tramptrampfilep): Comment check for
=== modified file 'lisp/calc/README'
 lisp/calc/README 20130103 02:37:57 +0000
+++ lisp/calc/README 20130201 03:51:08 +0000
@@ 70,64 +70,7 @@
Summary of changes to "Calc"
    
Emacs 24.4

* The date forms use the Gregorian calendar for all dates.
 (Previously they were a combination of Julian and Gregorian
 dates.) This can be configured with the customizable variable
 `calcgregorianswitch'.

* Support for ISO 8601 dates added.
Emacs 24.3

* Algebraic simplification mode is now the default.
 To restrict to the limited simplifications given by the former
 default simplification mode, use `m I'.

Emacs 24.1

* Support for musical notes added.

* Support for logarithmic units added.

* Calc no longer uses the tex prefix for TeX specific unit
names when using TeX or LaTeX mode.

* Added option to highlight selections using faces.

* Gave `calchistogram' the option of using a vector to determine the bins.

* Added "O" option prefix.

* Used "O" prefix to "d r" (`calcradix') to turn on twoscomplement mode.

Emacs 23.2

* Added twoscomplement display.

Emacs 23.1:

* Gave `j *' (calselmultbothsides) an option to expand the
 denominator.

* Use `calcembeddedwordregexp' for finding words in
 `calcembeddedword' in place of delimiters.

* Remove version numbering; use Emacs version for reference.

* Added support for using registers.

* Added support for Yacas, Maxima and Giac languages.

* Added a menu.

* Added logistic nonlinear curves to curvefitting.

* Added option of plotting data points and curve when curvefitting.

* Made unit conversions exact when possible.

* Lowered the precedence of negation.
+For changes in Emacs 23.1 and later, see the main Emacs NEWS file.
Version 2.1:
=== modified file 'lisp/calc/calchelp.el'
 lisp/calc/calchelp.el 20130101 09:11:05 +0000
+++ lisp/calc/calchelp.el 20130201 03:51:08 +0000
@@ 386,23 +386,9 @@
(defun calcviewnews ()
(interactive)
 (let ((path loadpath))
 (while (and path
 (not (fileexistsp (expandfilename "calc.el" (car path)))))
 (setq path (cdr path)))
 (or (and path
 (fileexistsp (expandfilename "README" (car path))))
 (error "Can't locate Calc sources"))
 (calcquit)
 (switchtobuffer "*Help*")
 (let ((inhibitreadonly t))
 (erasebuffer)
 (insertfilecontents (expandfilename "README" (car path)))
 (searchforward "Summary of changes")
 (forwardline 1)
 (deleteregion (pointmin) (point))
 (gotochar (pointmin)))
 (helpmode)))
+ (calcquit)
+ (viewemacsnews)
+ (researchforward "^\*+ .*\\" nil t))
(defvar calchelplongnames '((?b . "binary/business")
(?g . "graphics")

revno: 111642
committer: Sam Steingold
branch nick: trunk
timestamp: Thu 20130131 17:37:54 0500
message:
fix last patch
diff:
=== modified file 'lisp/simple.el'
 lisp/simple.el 20130131 02:57:35 +0000
+++ lisp/simple.el 20130131 22:37:54 +0000
@@ 805,7 +805,7 @@
;; otherwise delete all excees spaces.
(deleteregion (if (and (not singleshot) (zerop n) (= mid end))
start mid) end)
 (insert (makestring ?\s n))))
+ (insert (makestring n ?\s))))
;; Command run for the second time.
((not (equal origpos (point)))

revno: 111641
committer: Glenn Morris
branch nick: trunk
timestamp: Thu 20130131 09:07:57 0800
message:
ChangeLog for previous fileio.c change
diff:
=== modified file 'src/ChangeLog'
 src/ChangeLog 20130131 06:35:45 +0000
+++ src/ChangeLog 20130131 17:07:57 +0000
@@ 1,9 +1,8 @@
20130131 Glenn Morris
* fileio.c (choose_write_coding_system): Make it callable from Lisp.
 (Fwrite_region): If codingsystemforwrite is set, don't
 call choose_write_coding_system. Move the last piece of
 choose_write_coding_system here. (Bug#13522)
+ (Fwrite_region): Update for new choose_write_coding_system args.
+ Move the last piece of choose_write_coding_system here. (Bug#13522)
(syms_of_fileio): Add choosewritecodingsystem.
20130130 Eli Zaretskii

revno: 111640
committer: Glenn Morris
branch nick: trunk
timestamp: Thu 20130131 08:53:37 0800
message:
Simplify part of previous Fwrite_region change
diff:
=== modified file 'src/fileio.c'
 src/fileio.c 20130131 06:35:45 +0000
+++ src/fileio.c 20130131 16:53:37 +0000
@@ 4881,10 +4881,9 @@
We used to make this choice before calling build_annotations, but that
leads to problems when a writeannotatefunction takes care of
unsavable chars (as was the case with XSymbol). */
 Vlast_coding_system_used = NILP (Vcoding_system_for_write) ?
+ Vlast_coding_system_used =
Fchoose_write_coding_system (start, end, filename,
 append, visit, lockname) :
 Vcoding_system_for_write;
+ append, visit, lockname);
setup_coding_system (Vlast_coding_system_used, &coding);

revno: 111639
committer: Michael Albinus
+
+ * net/tramp.el (tramptrampfilep): Comment check for
+ `stringasunibyte'. The function does not exist on XEmacs, and
+ likely we need another approach.
+
+ * net/trampsh.el (trampcomputemultihops): Check, whether
+ `trampgw*' variables are bound.
+
20130131 Glenn Morris
* files.el (basicsavebuffer2): Choose coding system for
=== modified file 'lisp/net/trampsh.el'
 lisp/net/trampsh.el 20130130 09:16:16 +0000
+++ lisp/net/trampsh.el 20130131 08:33:03 +0000
@@ 4272,7 +4272,7 @@
(setq choices trampdefaultproxiesalist)))))
;; Handle gateways.
 (when (and trampgwtunnelmethod trampgwsocksmethod
+ (when (and (boundp 'trampgwtunnelmethod) (boundp 'trampgwsocksmethod)
(stringmatch
(format
"^\\(%s\\%s\\)$" trampgwtunnelmethod trampgwsocksmethod)
=== modified file 'lisp/net/tramp.el'
 lisp/net/tramp.el 20130130 09:16:16 +0000
+++ lisp/net/tramp.el 20130131 08:33:03 +0000
@@ 1158,7 +1158,7 @@
It checks also, whether NAME is unibyte encoded."
(savematchdata
(and (stringp name)
 (stringequal name (stringasunibyte name))
+; (stringequal name (stringasunibyte name))
(stringmatch trampfilenameregexp name))))
(defun trampfindmethod (method user host)

revno: 111638
fixes bug: http://debbugs.gnu.org/13522
committer: Glenn Morris
branch nick: trunk
timestamp: Wed 20130130 22:35:45 0800
message:
Reduce delay between backing up a file and saving new version
* lisp/files.el (basicsavebuffer2):
Choose coding system for writing the file before backing it up.
* src/fileio.c (choose_write_coding_system): Make it callable from Lisp.
(Fwrite_region): If codingsystemforwrite is set, don't call
choose_write_coding_system.
Move the last piece of choose_write_coding_system here.
(syms_of_fileio): Add choosewritecodingsystem.
diff:
=== modified file 'lisp/ChangeLog'
 lisp/ChangeLog 20130131 02:57:35 +0000
+++ lisp/ChangeLog 20130131 06:35:45 +0000
@@ 1,3 +1,9 @@
+20130131 Glenn Morris
+
+ * files.el (basicsavebuffer2): Choose coding system for
+ writing the file before backing it up, to reduce delay between
+ backing up and writing the new version. (Bug#13522)
+
20130131 Michal Nazarewicz
* simple.el (cyclespacing): New command.
=== modified file 'lisp/files.el'
 lisp/files.el 20130110 15:50:04 +0000
+++ lisp/files.el 20130131 06:35:45 +0000
@@ 4656,7 +4656,7 @@
;; This returns a value (MODES EXTENDEDATTRIBUTES BACKUPNAME), like
;; backupbuffer.
(defun basicsavebuffer2 ()
 (let (tempsetmodes setmodes)
+ (let (tempsetmodes setmodes writecoding)
(if (not (filewritablep bufferfilename))
(let ((dir (filenamedirectory bufferfilename)))
(if (not (filedirectoryp dir))
@@ 4672,6 +4672,14 @@
bufferfilename)))
(setq tempsetmodes t)
(error "Attempt to save to a file which you aren't allowed to write"))))))
+ ;; This may involve prompting, so do it now before backing up the file.
+ ;; Otherwise there can be a delay while the user answers the
+ ;; prompt during which the original file has been renamed. (Bug#13522)
+ (setq writecoding
+ ;; Args here should match writeregion call below around
+ ;; which we use writecoding.
+ (choosewritecodingsystem nil nil bufferfilename nil t
+ bufferfiletruename))
(or bufferbackedup
(setq setmodes (backupbuffer)))
(let* ((dir (filenamedirectory bufferfilename))
@@ 4753,10 +4761,11 @@
(logior (car setmodes) 128))))))
(let (success)
(unwindprotect
 (progn
;; Pass in nil&nil rather than pointmin&max to indicate
;; we're saving the buffer rather than just a region.
;; writeregionannotatefunctions may make us of it.
+ (let ((codingsystemforwrite writecoding)
+ (codingsystemrequirewarning nil))
(writeregion nil nil
bufferfilename nil t bufferfiletruename)
(setq success t))
=== modified file 'src/ChangeLog'
 src/ChangeLog 20130130 08:07:37 +0000
+++ src/ChangeLog 20130131 06:35:45 +0000
@@ 1,3 +1,11 @@
+20130131 Glenn Morris
+
+ * fileio.c (choose_write_coding_system): Make it callable from Lisp.
+ (Fwrite_region): If codingsystemforwrite is set, don't
+ call choose_write_coding_system. Move the last piece of
+ choose_write_coding_system here. (Bug#13522)
+ (syms_of_fileio): Add choosewritecodingsystem.
+
20130130 Eli Zaretskii
* w32.c (sys_open): Zero out the flags for the new file descriptor.
=== modified file 'src/fileio.c'
 src/fileio.c 20130123 20:07:28 +0000
+++ src/fileio.c 20130131 06:35:45 +0000
@@ 249,6 +249,7 @@
static Lisp_Object Qset_file_acl;
static Lisp_Object Qfile_newer_than_file_p;
Lisp_Object Qinsert_file_contents;
+Lisp_Object Qchoose_write_coding_system;
Lisp_Object Qwrite_region;
static Lisp_Object Qverify_visited_file_modtime;
static Lisp_Object Qset_visited_file_modtime;
@@ 4615,14 +4616,24 @@
/* Decide the codingsystem to encode the data with. */
static Lisp_Object
choose_write_coding_system (Lisp_Object start, Lisp_Object end, Lisp_Object filename,
 Lisp_Object append, Lisp_Object visit, Lisp_Object lockname,
 struct coding_system *coding)
+DEFUN ("choosewritecodingsystem", Fchoose_write_coding_system,
+ Schoose_write_coding_system, 3, 6, 0,
+ doc: /* Choose the coding system for writing a file.
+Arguments are as for `writeregion'.
+This function is for internal use only. It may prompt the user. */ )
+ (Lisp_Object start, Lisp_Object end, Lisp_Object filename,
+ Lisp_Object append, Lisp_Object visit, Lisp_Object lockname)
{
Lisp_Object val;
Lisp_Object eol_parent = Qnil;
+ /* Mimic writeregion behavior. */
+ if (NILP (start))
+ {
+ XSETFASTINT (start, BEGV);
+ XSETFASTINT (end, ZV);
+ }
+
if (auto_saving
&& NILP (Fstring_equal (BVAR (current_buffer, filename),
BVAR (current_buffer, auto_save_file_name))))
@@ 4715,10 +4726,6 @@
}
val = coding_inherit_eol_type (val, eol_parent);
 setup_coding_system (val, coding);

 if (!STRINGP (start) && !NILP (BVAR (current_buffer, selective_display)))
 coding>mode = CODING_MODE_SELECTIVE_DISPLAY;
return val;
}
@@ 4874,9 +4881,15 @@
We used to make this choice before calling build_annotations, but that
leads to problems when a writeannotatefunction takes care of
unsavable chars (as was the case with XSymbol). */
 Vlast_coding_system_used
 = choose_write_coding_system (start, end, filename,
 append, visit, lockname, &coding);
+ Vlast_coding_system_used = NILP (Vcoding_system_for_write) ?
+ Fchoose_write_coding_system (start, end, filename,
+ append, visit, lockname) :
+ Vcoding_system_for_write;
+
+ setup_coding_system (Vlast_coding_system_used, &coding);
+
+ if (!STRINGP (start) && !NILP (BVAR (current_buffer, selective_display)))
+ coding.mode = CODING_MODE_SELECTIVE_DISPLAY;
#ifdef CLASH_DETECTION
if (!auto_saving)
@@ 5861,6 +5874,7 @@
DEFSYM (Qset_file_acl, "setfileacl");
DEFSYM (Qfile_newer_than_file_p, "filenewerthanfilep");
DEFSYM (Qinsert_file_contents, "insertfilecontents");
+ DEFSYM (Qchoose_write_coding_system, "choosewritecodingsystem");
DEFSYM (Qwrite_region, "writeregion");
DEFSYM (Qverify_visited_file_modtime, "verifyvisitedfilemodtime");
DEFSYM (Qset_visited_file_modtime, "setvisitedfilemodtime");
@@ 6085,6 +6099,7 @@
defsubr (&Sdefault_file_modes);
defsubr (&Sfile_newer_than_file_p);
defsubr (&Sinsert_file_contents);
+ defsubr (&Schoose_write_coding_system);
defsubr (&Swrite_region);
defsubr (&Scar_less_than_car);
defsubr (&Sverify_visited_file_modtime);