Now on revision 109290. ------------------------------------------------------------ revno: 109290 committer: Dmitry Antipov branch nick: trunk timestamp: Mon 2012-07-30 10:43:46 +0400 message: Convert safe_call to use variable number of arguments. * xdisp.c (safe_call): Convert to use varargs. Adjust users. (safe_call2): Fix comment. * lisp.h (safe_call): Adjust prototype. * coding.c (encode_coding_object): Change to use safe_call2. * xfaces.c (merge_face_heights): Change to use safe_call1. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-30 06:34:22 +0000 +++ src/ChangeLog 2012-07-30 06:43:46 +0000 @@ -1,3 +1,12 @@ +2012-07-30 Dmitry Antipov + + Convert safe_call to use variable number of arguments. + * xdisp.c (safe_call): Convert to use varargs. Adjust users. + (safe_call2): Fix comment. + * lisp.h (safe_call): Adjust prototype. + * coding.c (encode_coding_object): Change to use safe_call2. + * xfaces.c (merge_face_heights): Change to use safe_call1. + 2012-07-30 Glenn Morris * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h === modified file 'src/coding.c' --- src/coding.c 2012-07-27 09:24:34 +0000 +++ src/coding.c 2012-07-30 06:43:46 +0000 @@ -7931,15 +7931,12 @@ } { - Lisp_Object args[3]; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; GCPRO5 (coding->src_object, coding->dst_object, src_object, dst_object, old_deactivate_mark); - args[0] = CODING_ATTR_PRE_WRITE (attrs); - args[1] = make_number (BEG); - args[2] = make_number (Z); - safe_call (3, args); + safe_call2 (CODING_ATTR_PRE_WRITE (attrs), + make_number (BEG), make_number (Z)); UNGCPRO; } if (XBUFFER (coding->src_object) != current_buffer) === modified file 'src/composite.c' --- src/composite.c 2012-07-06 05:07:44 +0000 +++ src/composite.c 2012-07-30 06:43:46 +0000 @@ -947,20 +947,12 @@ string); if (NILP (LGSTRING_ID (lgstring))) { - Lisp_Object args[6]; - /* Save point as marker before calling out to lisp. */ if (NILP (string)) record_unwind_protect (restore_point_unwind, build_marker (current_buffer, pt, pt_byte)); - - args[0] = Vauto_composition_function; - args[1] = AREF (rule, 2); - args[2] = pos; - args[3] = make_number (to); - args[4] = font_object; - args[5] = string; - lgstring = safe_call (6, args); + lgstring = safe_call (6, Vauto_composition_function, AREF (rule, 2), + pos, make_number (to), font_object, string); } return unbind_to (count, lgstring); } === modified file 'src/keyboard.c' --- src/keyboard.c 2012-07-26 01:27:33 +0000 +++ src/keyboard.c 2012-07-30 06:43:46 +0000 @@ -2185,14 +2185,7 @@ if (!NILP (help) && !STRINGP (help)) { if (FUNCTIONP (help)) - { - Lisp_Object args[4]; - args[0] = help; - args[1] = window; - args[2] = object; - args[3] = pos; - help = safe_call (4, args); - } + help = safe_call (4, help, window, object, pos); else help = safe_eval (help); === modified file 'src/lisp.h' --- src/lisp.h 2012-07-30 05:41:10 +0000 +++ src/lisp.h 2012-07-30 06:43:46 +0000 @@ -2842,7 +2842,7 @@ ATTRIBUTE_FORMAT_PRINTF (1, 0); extern Lisp_Object un_autoload (Lisp_Object); extern void init_eval_once (void); -extern Lisp_Object safe_call (ptrdiff_t, Lisp_Object *); +extern Lisp_Object safe_call (ptrdiff_t, Lisp_Object, ...); extern Lisp_Object safe_call1 (Lisp_Object, Lisp_Object); extern Lisp_Object safe_call2 (Lisp_Object, Lisp_Object, Lisp_Object); extern void init_eval (void); === modified file 'src/term.c' --- src/term.c 2012-07-08 16:38:43 +0000 +++ src/term.c 2012-07-30 06:43:46 +0000 @@ -2209,11 +2209,10 @@ if (mode != tty->previous_color_mode) { - Lisp_Object funsym = intern ("tty-set-up-initial-frame-faces"); tty->previous_color_mode = mode; tty_setup_colors (tty , mode); /* This recomputes all the faces given the new color definitions. */ - safe_call (1, &funsym); + safe_call (1, intern ("tty-set-up-initial-frame-faces")); } } === modified file 'src/xdisp.c' --- src/xdisp.c 2012-07-28 07:59:34 +0000 +++ src/xdisp.c 2012-07-30 06:43:46 +0000 @@ -2403,16 +2403,12 @@ return Qnil; } - -/* Evaluate SEXPR and return the result, or nil if something went +/* Call function FUNC with the rest of NARGS - 1 arguments + following. Return the result, or nil if something went wrong. Prevent redisplay during the evaluation. */ -/* Call function ARGS[0] with arguments ARGS[1] to ARGS[NARGS - 1]. - Return the result, or nil if something went wrong. Prevent - redisplay during the evaluation. */ - Lisp_Object -safe_call (ptrdiff_t nargs, Lisp_Object *args) +safe_call (ptrdiff_t nargs, Lisp_Object func, ...) { Lisp_Object val; @@ -2420,8 +2416,17 @@ val = Qnil; else { + va_list ap; + ptrdiff_t i; ptrdiff_t count = SPECPDL_INDEX (); struct gcpro gcpro1; + Lisp_Object *args = alloca (nargs * sizeof (Lisp_Object)); + + args[0] = func; + va_start (ap, func); + for (i = 1; i < nargs; i++) + args[i] = va_arg (ap, Lisp_Object); + va_end (ap); GCPRO1 (args[0]); gcpro1.nvars = nargs; @@ -2444,10 +2449,7 @@ Lisp_Object safe_call1 (Lisp_Object fn, Lisp_Object arg) { - Lisp_Object args[2]; - args[0] = fn; - args[1] = arg; - return safe_call (2, args); + return safe_call (2, fn, arg); } static Lisp_Object Qeval; @@ -2458,17 +2460,13 @@ return safe_call1 (Qeval, sexpr); } -/* Call function FN with one argument ARG. +/* Call function FN with two arguments ARG1 and ARG2. Return the result, or nil if something went wrong. */ Lisp_Object safe_call2 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2) { - Lisp_Object args[3]; - args[0] = fn; - args[1] = arg1; - args[2] = arg2; - return safe_call (3, args); + return safe_call (3, fn, arg1, arg2); } === modified file 'src/xfaces.c' --- src/xfaces.c 2012-07-10 08:43:46 +0000 +++ src/xfaces.c 2012-07-30 06:43:46 +0000 @@ -2254,11 +2254,7 @@ { /* Call function with current height as argument. From is the new height. */ - Lisp_Object args[2]; - - args[0] = from; - args[1] = to; - result = safe_call (2, args); + result = safe_call1 (from, to); /* Ensure that if TO was absolute, so is the result. */ if (INTEGERP (to) && !INTEGERP (result)) ------------------------------------------------------------ revno: 109289 committer: Glenn Morris branch nick: trunk timestamp: Sun 2012-07-29 23:34:22 -0700 message: Remove s/aix4-2.h * configure.ac (opsysfile): Set to empty on aix4-2. * src/s/aix4-2.h: Remove empty file. diff: === modified file 'ChangeLog' --- ChangeLog 2012-07-30 06:24:20 +0000 +++ ChangeLog 2012-07-30 06:34:22 +0000 @@ -2,8 +2,8 @@ * configure.ac (opsysfile): Tweak message for null case. - * configure.ac (opsysfile): Set to empty on freebsd, gnu-linux, - gnu-kfreebsd; and to usg5-4-common.h on sol2*, unixware. + * configure.ac (opsysfile): Set to empty on aix4-2, freebsd, + gnu-linux, gnu-kfreebsd; and to usg5-4-common.h on sol2*, unixware. 2012-07-30 Paul Eggert === modified file 'configure.ac' --- configure.ac 2012-07-30 06:24:20 +0000 +++ configure.ac 2012-07-30 06:34:22 +0000 @@ -3650,6 +3650,7 @@ case $opsys in aix4-2) + opsysfile= AC_DEFINE(USG, []) AC_DEFINE(USG5, []) dnl This symbol should be defined on AIX Version 3 ??????? === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-30 06:32:04 +0000 +++ src/ChangeLog 2012-07-30 06:34:22 +0000 @@ -1,7 +1,7 @@ 2012-07-30 Glenn Morris * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h - does that unconditionally. + does that unconditionally. Remove file, which is now empty. * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h: Remove empty files. === removed file 'src/s/aix4-2.h' --- src/s/aix4-2.h 2012-07-30 06:32:04 +0000 +++ src/s/aix4-2.h 1970-01-01 00:00:00 +0000 @@ -1,18 +0,0 @@ -/* -Copyright (C) 1999, 2001-2012 Free Software Foundation, Inc. - -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 . */ - ------------------------------------------------------------ revno: 109288 committer: Glenn Morris branch nick: trunk timestamp: Sun 2012-07-29 23:32:04 -0700 message: * s/aix4-2.h (sigmask): No need to undefine it. (syssignal.h does that unconditionally) diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-30 06:18:28 +0000 +++ src/ChangeLog 2012-07-30 06:32:04 +0000 @@ -1,5 +1,8 @@ 2012-07-30 Glenn Morris + * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h + does that unconditionally. + * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h: Remove empty files. === modified file 'src/s/aix4-2.h' --- src/s/aix4-2.h 2012-07-14 00:04:10 +0000 +++ src/s/aix4-2.h 2012-07-30 06:32:04 +0000 @@ -16,6 +16,3 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ -/* Perry Smith says these are correct. */ -#undef sigmask - ------------------------------------------------------------ revno: 109287 committer: Glenn Morris branch nick: trunk timestamp: Sun 2012-07-29 23:24:20 -0700 message: * configure.ac (opsysfile): Tweak message for null case. (The autoconf manual says this is portable.) diff: === modified file 'ChangeLog' --- ChangeLog 2012-07-30 06:18:28 +0000 +++ ChangeLog 2012-07-30 06:24:20 +0000 @@ -1,5 +1,7 @@ 2012-07-30 Glenn Morris + * configure.ac (opsysfile): Tweak message for null case. + * configure.ac (opsysfile): Set to empty on freebsd, gnu-linux, gnu-kfreebsd; and to usg5-4-common.h on sol2*, unixware. === modified file 'configure.ac' --- configure.ac 2012-07-30 06:18:28 +0000 +++ configure.ac 2012-07-30 06:24:20 +0000 @@ -4298,7 +4298,7 @@ Configured for \`${canonical}'. Where should the build process find the source code? ${srcdir} - What operating system file should Emacs use? ${opsysfile-none} + What operating system file should Emacs use? ${opsysfile:-none} What compiler should emacs be built with? ${CC} ${CFLAGS} Should Emacs use the GNU version of malloc? ${GNU_MALLOC}${GNU_MALLOC_reason} Should Emacs use a relocating allocator for buffers? ${REL_ALLOC} ------------------------------------------------------------ revno: 109286 committer: Glenn Morris branch nick: trunk timestamp: Sun 2012-07-29 23:18:28 -0700 message: Remove some empty src/s files. * configure.ac (opsysfile): Set to empty on freebsd, gnu-linux, gnu-kfreebsd; and to usg5-4-common.h on sol2*, unixware. * src/s/freebsd.h, src/s/gnu-linux.h, src/s/sol2-6.h, src/s/unixware.h: Remove empty files. diff: === modified file 'ChangeLog' --- ChangeLog 2012-07-30 06:07:22 +0000 +++ ChangeLog 2012-07-30 06:18:28 +0000 @@ -1,3 +1,8 @@ +2012-07-30 Glenn Morris + + * configure.ac (opsysfile): Set to empty on freebsd, gnu-linux, + gnu-kfreebsd; and to usg5-4-common.h on sol2*, unixware. + 2012-07-30 Paul Eggert Merge from gnulib, incorporating: === modified file 'configure.ac' --- configure.ac 2012-07-28 23:05:32 +0000 +++ configure.ac 2012-07-30 06:18:28 +0000 @@ -3677,6 +3677,7 @@ ;; freebsd) + opsysfile= AC_DEFINE(BSD4_2, []) dnl Hack to avoid calling AC_PREPROC_IFELSE multiple times. dnl Would not be needed with autoconf >= 2.67, where the @@ -3694,6 +3695,7 @@ ;; gnu-linux | gnu-kfreebsd ) + opsysfile= AC_DEFINE(USG, []) AC_DEFINE(GNU_LINUX, [], [Define if ths system is compatible with GNU/Linux.]) ;; @@ -3711,12 +3713,14 @@ ;; sol2*) + opsysfile="s/usg5-4-common.h" AC_DEFINE(USG, []) AC_DEFINE(USG5, []) AC_DEFINE(SOLARIS2, [], [Define if the system is Solaris.]) ;; unixware) + opsysfile="s/usg5-4-common.h" AC_DEFINE(USG, []) AC_DEFINE(USG5, []) ;; @@ -3736,8 +3740,6 @@ gnu) opsysfile= ;; - gnu-kfreebsd) opsysfile="s/gnu-linux.h" ;; - hpux11) dnl See comments in sysdep.c:sys_signal. dnl SA_RESTART resets the timeout of `select' on hpux11. === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-30 05:41:10 +0000 +++ src/ChangeLog 2012-07-30 06:18:28 +0000 @@ -1,3 +1,8 @@ +2012-07-30 Glenn Morris + + * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h: + Remove empty files. + 2012-07-30 Paul Eggert Export to GDB most of lisp.h's remaining object-like macros. === removed file 'src/s/freebsd.h' --- src/s/freebsd.h 2012-07-14 00:04:10 +0000 +++ src/s/freebsd.h 1970-01-01 00:00:00 +0000 @@ -1,22 +0,0 @@ -/* System description header for FreeBSD systems. - -Copyright (C) 1994-2012 Free Software Foundation, Inc. - -Author: Shawn M. Carey -(according to authors.el) - -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 . */ - === removed file 'src/s/gnu-linux.h' --- src/s/gnu-linux.h 2012-07-14 00:04:10 +0000 +++ src/s/gnu-linux.h 1970-01-01 00:00:00 +0000 @@ -1,22 +0,0 @@ -/* This file is the configuration file for Linux-based GNU systems - -Copyright (C) 1985-1986, 1992, 1994, 1996, 1999, 2001-2012 - Free Software Foundation, Inc. - -This file was put together by Michael K. Johnson and Rik Faith. - -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 . */ - === removed file 'src/s/sol2-6.h' --- src/s/sol2-6.h 2012-07-14 00:04:10 +0000 +++ src/s/sol2-6.h 1970-01-01 00:00:00 +0000 @@ -1,21 +0,0 @@ -/* Definitions file for GNU Emacs running on Solaris 2.6. - -Copyright (C) 1999-2012 Free Software Foundation, Inc. - -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 . */ - -#include "usg5-4-common.h" - === removed file 'src/s/unixware.h' --- src/s/unixware.h 2012-07-14 00:04:10 +0000 +++ src/s/unixware.h 1970-01-01 00:00:00 +0000 @@ -1,20 +0,0 @@ -/* s/ file for Unixware. - -Copyright (C) 1999-2012 Free Software Foundation, Inc. - -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 . */ - -#include "usg5-4-common.h" ------------------------------------------------------------ revno: 109285 committer: Paul Eggert branch nick: trunk timestamp: Sun 2012-07-29 23:07:22 -0700 message: Merge from gnulib, incorporating: * doc/misc/texinfo.tex: Update to 2012-07-29.17 version. diff: === modified file 'ChangeLog' --- ChangeLog 2012-07-29 16:55:02 +0000 +++ ChangeLog 2012-07-30 06:07:22 +0000 @@ -1,3 +1,8 @@ +2012-07-30 Paul Eggert + + Merge from gnulib, incorporating: + * doc/misc/texinfo.tex: Update to 2012-07-29.17 version. + 2012-07-29 Jan Djärv * Makefile.in (install-arch-indep): Handle space in locallisppath. === modified file 'doc/misc/texinfo.tex' --- doc/misc/texinfo.tex 2012-07-09 08:34:39 +0000 +++ doc/misc/texinfo.tex 2012-07-30 06:07:22 +0000 @@ -3,7 +3,7 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2012-07-03.16} +\def\texinfoversion{2012-07-29.17} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, @@ -2448,34 +2448,12 @@ % @samp. \def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}} -% definition of @key that produces a lozenge. Doesn't adjust to text size. -%\setfont\keyrm\rmshape{8}{1000}{OT1} -%\font\keysy=cmsy9 -%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% -% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% -% \vbox{\hrule\kern-0.4pt -% \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% -% \kern-0.4pt\hrule}% -% \kern-.06em\raise0.4pt\hbox{\angleright}}}} - -% definition of @key with no lozenge. If the current font is already -% monospace, don't change it; that way, we respect @kbdinputstyle. But -% if it isn't monospace, then use \tt. -% -\def\key#1{{\setupmarkupstyle{key}% - \nohyphenation - \ifmonospace\else\tt\fi - #1}\null} - -% ctrl is no longer a Texinfo command. -\def\ctrl #1{{\tt \rawbackslash \hat}#1} - -% @file, @option are the same as @samp. -\let\file=\samp -\let\option=\samp - -% @code is a modification of @t, -% which makes spaces the same size as normal in the surrounding text. +% @indicateurl is \samp, that is, with quotes. +\let\indicateurl=\samp + +% @code (and similar) prints in typewriter, but with spaces the same +% size as normal in the surrounding text, without hyphenation, etc. +% This is a subroutine for that. \def\tclose#1{% {% % Change normal interword space to be same as for the current font. @@ -2500,7 +2478,7 @@ % We *must* turn on hyphenation at `-' and `_' in @code. % Otherwise, it is too hard to avoid overfull hboxes % in the Emacs manual, the Library manual, etc. - +% % Unfortunately, TeX uses one parameter (\hyphenchar) to control % both hyphenation at - and hyphenation within words. % We must therefore turn them both off (\tclose does that) @@ -2564,6 +2542,13 @@ \fi\fi } +% For @command, @env, @file, @option quotes seem unnecessary, +% so use \code rather than \samp. +\let\command=\code +\let\env=\code +\let\file=\code +\let\option=\code + % @uref (abbreviation for `urlref') takes an optional (comma-separated) % second argument specifying the text to display and an optional third % arg as text to display instead of (rather than in addition to) the url @@ -2743,10 +2728,24 @@ \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi} -% For @indicateurl, @env, @command quotes seem unnecessary, so use \code. -\let\indicateurl=\code -\let\env=\code -\let\command=\code +% definition of @key that produces a lozenge. Doesn't adjust to text size. +%\setfont\keyrm\rmshape{8}{1000}{OT1} +%\font\keysy=cmsy9 +%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% +% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% +% \vbox{\hrule\kern-0.4pt +% \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% +% \kern-0.4pt\hrule}% +% \kern-.06em\raise0.4pt\hbox{\angleright}}}} + +% definition of @key with no lozenge. If the current font is already +% monospace, don't change it; that way, we respect @kbdinputstyle. But +% if it isn't monospace, then use \tt. +% +\def\key#1{{\setupmarkupstyle{key}% + \nohyphenation + \ifmonospace\else\tt\fi + #1}\null} % @clicksequence{File @click{} Open ...} \def\clicksequence#1{\begingroup #1\endgroup} @@ -2854,6 +2853,9 @@ } } +% ctrl is no longer a Texinfo command, but leave this definition for fun. +\def\ctrl #1{{\tt \rawbackslash \hat}#1} + % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}. % Ignore unless FMTNAME == tex; then it is like @iftex and @tex, % except specified as a normal braced arg, so no newlines to worry about. ------------------------------------------------------------ revno: 109284 committer: Paul Eggert branch nick: trunk timestamp: Sun 2012-07-29 22:41:10 -0700 message: Export to GDB most of lisp.h's remaining object-like macros. * lisp.h (min, max): Move earlier, because they're used earlier now. (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK) (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0) (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3) (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE) (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING) (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT) (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS) (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA): Now constants, for GDB. They need not be macros. (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND): Now constants, for GDB, as well as macros, for static initializers. (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS): Move to after the definition of struct Lisp_Char_Table, since the former now needs that type defined. (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS) (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits) (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA): New enums, for gdb_make_enums_visible. (GLYPH_MODE_LINE_FACE): Remove; unused. * alloc.c (STRING_BYTES_MAX): Now a constant, now a macro. (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE, enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled, enum maxargs, enum MAX_ALLOCA. (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove. (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove; no longer needed, now that they are done in lisp.h. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-30 04:02:39 +0000 +++ src/ChangeLog 2012-07-30 05:41:10 +0000 @@ -1,3 +1,35 @@ +2012-07-30 Paul Eggert + + Export to GDB most of lisp.h's remaining object-like macros. + * lisp.h (min, max): Move earlier, because they're used earlier now. + (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK) + (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0) + (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3) + (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE) + (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING) + (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT) + (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS) + (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA): + Now constants, for GDB. They need not be macros. + (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND): + Now constants, for GDB, as well as macros, for static initializers. + (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS): + Move to after the definition of struct Lisp_Char_Table, + since the former now needs that type defined. + (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS) + (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits) + (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA): + New enums, for gdb_make_enums_visible. + (GLYPH_MODE_LINE_FACE): Remove; unused. + * alloc.c (STRING_BYTES_MAX): Now a constant, now a macro. + (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum + CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE, + enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled, + enum maxargs, enum MAX_ALLOCA. + (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove. + (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove; + no longer needed, now that they are done in lisp.h. + 2012-07-30 Dmitry Antipov Cleanup string bytes checking. === modified file 'src/alloc.c' --- src/alloc.c 2012-07-30 04:02:39 +0000 +++ src/alloc.c 2012-07-30 05:41:10 +0000 @@ -1774,13 +1774,13 @@ STRING_BYTES_BOUND, nor can it be so long that the size_t arithmetic in allocate_string_data would overflow while it is calculating a value to be passed to malloc. */ -#define STRING_BYTES_MAX \ - min (STRING_BYTES_BOUND, \ - ((SIZE_MAX - XMALLOC_OVERRUN_CHECK_OVERHEAD \ - - GC_STRING_EXTRA \ - - offsetof (struct sblock, first_data) \ - - SDATA_DATA_OFFSET) \ - & ~(sizeof (EMACS_INT) - 1))) +static ptrdiff_t const STRING_BYTES_MAX = + min (STRING_BYTES_BOUND, + ((SIZE_MAX - XMALLOC_OVERRUN_CHECK_OVERHEAD + - GC_STRING_EXTRA + - offsetof (struct sblock, first_data) + - SDATA_DATA_OFFSET) + & ~(sizeof (EMACS_INT) - 1))); /* Initialize string allocation. Called from init_alloc_once. */ @@ -6863,41 +6863,23 @@ #endif } -/* Make some symbols visible to GDB. This section is last, so that - the #undef lines don't mess up later code. */ - /* When compiled with GCC, GDB might say "No enum type named pvec_type" if we don't have at least one symbol with that type, and then xbacktrace could fail. Similarly for the other enums and their values. */ union { + enum CHARTAB_SIZE_BITS CHARTAB_SIZE_BITS; + enum CHAR_TABLE_STANDARD_SLOTS CHAR_TABLE_STANDARD_SLOTS; + enum char_bits char_bits; enum CHECK_LISP_OBJECT_TYPE CHECK_LISP_OBJECT_TYPE; + enum DEFAULT_HASH_SIZE DEFAULT_HASH_SIZE; enum enum_USE_LSB_TAG enum_USE_LSB_TAG; + enum FLOAT_TO_STRING_BUFSIZE FLOAT_TO_STRING_BUFSIZE; enum Lisp_Bits Lisp_Bits; + enum Lisp_Compiled Lisp_Compiled; + enum maxargs maxargs; + enum MAX_ALLOCA MAX_ALLOCA; enum More_Lisp_Bits More_Lisp_Bits; enum pvec_type pvec_type; } const EXTERNALLY_VISIBLE gdb_make_enums_visible = {0}; - -/* These symbols cannot be done as enums, since values might not be - in 'int' range. Each symbol X has a corresponding X_VAL symbol, - verified to have the correct value. */ - -#define ARRAY_MARK_FLAG_VAL PTRDIFF_MIN -#define PSEUDOVECTOR_FLAG_VAL (PTRDIFF_MAX - PTRDIFF_MAX / 2) -#define VALMASK_VAL (USE_LSB_TAG ? -1 << GCTYPEBITS : VAL_MAX) - -verify (ARRAY_MARK_FLAG_VAL == ARRAY_MARK_FLAG); -verify (PSEUDOVECTOR_FLAG_VAL == PSEUDOVECTOR_FLAG); -verify (VALMASK_VAL == VALMASK); - -#undef ARRAY_MARK_FLAG -#undef PSEUDOVECTOR_FLAG -#undef VALMASK - -ptrdiff_t const EXTERNALLY_VISIBLE - ARRAY_MARK_FLAG = ARRAY_MARK_FLAG_VAL, - PSEUDOVECTOR_FLAG = PSEUDOVECTOR_FLAG_VAL; - -EMACS_INT const EXTERNALLY_VISIBLE - VALMASK = VALMASK_VAL; === modified file 'src/lisp.h' --- src/lisp.h 2012-07-29 22:42:12 +0000 +++ src/lisp.h 2012-07-30 05:41:10 +0000 @@ -28,6 +28,12 @@ #include +/* The ubiquitous max and min macros. */ +#undef min +#undef max +#define max(a, b) ((a) > (b) ? (a) : (b)) +#define min(a, b) ((a) < (b) ? (a) : (b)) + /* EMACS_INT - signed integer wide enough to hold an Emacs value EMACS_INT_MAX - maximum value of EMACS_INT; can be used in #if pI - printf length modifier for EMACS_INT @@ -212,7 +218,7 @@ /* Lisp integers use 2 tags, to give them one extra bit, thus extending their range from, e.g., -2^28..2^28-1 to -2^29..2^29-1. */ -#define INTMASK (EMACS_INT_MAX >> (INTTYPEBITS - 1)) +static EMACS_INT const INTMASK = EMACS_INT_MAX >> (INTTYPEBITS - 1); #define case_Lisp_Int case Lisp_Int0: case Lisp_Int1 #define LISP_INT_TAG_P(x) (((x) & ~Lisp_Int1) == 0) @@ -320,11 +326,11 @@ /* In the size word of a vector, this bit means the vector has been marked. */ -#define ARRAY_MARK_FLAG PTRDIFF_MIN +static ptrdiff_t const ARRAY_MARK_FLAG = PTRDIFF_MIN; /* In the size word of a struct Lisp_Vector, this bit means it's really some other vector-like object. */ -#define PSEUDOVECTOR_FLAG (PTRDIFF_MAX - PTRDIFF_MAX / 2) +static ptrdiff_t const PSEUDOVECTOR_FLAG = PTRDIFF_MAX - PTRDIFF_MAX / 2; /* In a pseudovector, the size field actually contains a word with one PSEUDOVECTOR_FLAG bit set, and exactly one of the following bits to @@ -392,7 +398,7 @@ #if USE_LSB_TAG -#define VALMASK (-1 << GCTYPEBITS) +static int const VALMASK = -1 << GCTYPEBITS; #define TYPEMASK ((1 << GCTYPEBITS) - 1) #define XTYPE(a) ((enum Lisp_Type) (XLI (a) & TYPEMASK)) #define XINT(a) (XLI (a) >> INTTYPEBITS) @@ -407,7 +413,7 @@ #else /* not USE_LSB_TAG */ -#define VALMASK VAL_MAX +static EMACS_INT const VALMASK = VAL_MAX; #define XTYPE(a) ((enum Lisp_Type) ((EMACS_UINT) XLI (a) >> VALBITS)) @@ -455,9 +461,14 @@ #define EQ(x, y) (XHASH (x) == XHASH (y)) /* Largest and smallest representable fixnum values. These are the C - values. */ + values. They are macros for use in static initializers, and + constants for visibility to GDB. */ +static EMACS_INT const MOST_POSITIVE_FIXNUM = #define MOST_POSITIVE_FIXNUM (EMACS_INT_MAX >> INTTYPEBITS) + MOST_POSITIVE_FIXNUM; +static EMACS_INT const MOST_NEGATIVE_FIXNUM = #define MOST_NEGATIVE_FIXNUM (-1 - MOST_POSITIVE_FIXNUM) + MOST_NEGATIVE_FIXNUM; /* Value is non-zero if I doesn't fit into a Lisp fixnum. It is written this way so that it also works if I is of unsigned @@ -702,10 +713,15 @@ Although the actual size limit (see STRING_BYTES_MAX in alloc.c) may be a bit smaller than STRING_BYTES_BOUND, calculating it here would expose alloc.c internal details that we'd rather keep - private. The cast to ptrdiff_t ensures that STRING_BYTES_BOUND is - signed. */ + private. + + This is a macros for use in static initializers, and a constant for + visibility to GDB. The cast to ptrdiff_t ensures that + STRING_BYTES_BOUND is signed. */ +static ptrdiff_t const STRING_BYTES_BOUND = #define STRING_BYTES_BOUND \ min (MOST_POSITIVE_FIXNUM, (ptrdiff_t) min (SIZE_MAX, PTRDIFF_MAX) - 1) + STRING_BYTES_BOUND; /* Mark STR as a unibyte string. */ #define STRING_SET_UNIBYTE(STR) \ @@ -814,16 +830,6 @@ of a char-table, and there's no way to access it directly from Emacs Lisp program. */ -/* This is the number of slots that every char table must have. This - counts the ordinary slots and the top, defalt, parent, and purpose - slots. */ -#define CHAR_TABLE_STANDARD_SLOTS (VECSIZE (struct Lisp_Char_Table) - 1) - -/* Return the number of "extra" slots in the char table CT. */ - -#define CHAR_TABLE_EXTRA_SLOTS(CT) \ - (((CT)->header.size & PSEUDOVECTOR_SIZE_MASK) - CHAR_TABLE_STANDARD_SLOTS) - #ifdef __GNUC__ #define CHAR_TABLE_REF_ASCII(CT, IDX) \ @@ -885,10 +891,13 @@ ? XSUB_CHAR_TABLE (XCHAR_TABLE (CT)->ascii)->contents[IDX] = VAL \ : char_table_set (CT, IDX, VAL)) -#define CHARTAB_SIZE_BITS_0 6 -#define CHARTAB_SIZE_BITS_1 4 -#define CHARTAB_SIZE_BITS_2 5 -#define CHARTAB_SIZE_BITS_3 7 +enum CHARTAB_SIZE_BITS + { + CHARTAB_SIZE_BITS_0 = 6, + CHARTAB_SIZE_BITS_1 = 4, + CHARTAB_SIZE_BITS_2 = 5, + CHARTAB_SIZE_BITS_3 = 7 + }; extern const int chartab_size[4]; @@ -987,6 +996,19 @@ const char *doc; }; +/* This is the number of slots that every char table must have. This + counts the ordinary slots and the top, defalt, parent, and purpose + slots. */ +enum CHAR_TABLE_STANDARD_SLOTS + { + CHAR_TABLE_STANDARD_SLOTS = VECSIZE (struct Lisp_Char_Table) - 1 + }; + +/* Return the number of "extra" slots in the char table CT. */ + +#define CHAR_TABLE_EXTRA_SLOTS(CT) \ + (((CT)->header.size & PSEUDOVECTOR_SIZE_MASK) - CHAR_TABLE_STANDARD_SLOTS) + /*********************************************************************** Symbols @@ -1214,7 +1236,7 @@ /* Default size for hash tables if not specified. */ -#define DEFAULT_HASH_SIZE 65 +enum DEFAULT_HASH_SIZE { DEFAULT_HASH_SIZE = 65 }; /* Default threshold specifying when to resize a hash table. The value gives the ratio of current entries in the hash table and the @@ -1471,31 +1493,38 @@ /* Meanings of slots in a Lisp_Compiled: */ -#define COMPILED_ARGLIST 0 -#define COMPILED_BYTECODE 1 -#define COMPILED_CONSTANTS 2 -#define COMPILED_STACK_DEPTH 3 -#define COMPILED_DOC_STRING 4 -#define COMPILED_INTERACTIVE 5 +enum Lisp_Compiled + { + COMPILED_ARGLIST = 0, + COMPILED_BYTECODE = 1, + COMPILED_CONSTANTS = 2, + COMPILED_STACK_DEPTH = 3, + COMPILED_DOC_STRING = 4, + COMPILED_INTERACTIVE = 5 + }; /* Flag bits in a character. These also get used in termhooks.h. Richard Stallman thinks that MULE (MUlti-Lingual Emacs) might need 22 bits for the character value itself, so we probably shouldn't use any bits lower than 0x0400000. */ -#define CHAR_ALT (0x0400000) -#define CHAR_SUPER (0x0800000) -#define CHAR_HYPER (0x1000000) -#define CHAR_SHIFT (0x2000000) -#define CHAR_CTL (0x4000000) -#define CHAR_META (0x8000000) - -#define CHAR_MODIFIER_MASK \ - (CHAR_ALT | CHAR_SUPER | CHAR_HYPER | CHAR_SHIFT | CHAR_CTL | CHAR_META) - - -/* Actually, the current Emacs uses 22 bits for the character value - itself. */ -#define CHARACTERBITS 22 +enum char_bits + { + CHAR_ALT = 0x0400000, + CHAR_SUPER = 0x0800000, + CHAR_HYPER = 0x1000000, + CHAR_SHIFT = 0x2000000, + CHAR_CTL = 0x4000000, + CHAR_META = 0x8000000, + + CHAR_MODIFIER_MASK = + (CHAR_ALT | CHAR_SUPER | CHAR_HYPER | CHAR_SHIFT | CHAR_CTL | CHAR_META), + + /* Actually, the current Emacs uses 22 bits for the character value + itself. */ + CHARACTERBITS = 22 + }; + + /* The glyph datatype, used to represent characters on the display. @@ -1552,9 +1581,6 @@ (XINT (gc) >> CHARACTERBITS)); \ } \ while (0) - -/* The ID of the mode line highlighting face. */ -#define GLYPH_MODE_LINE_FACE 1 /* Structure to hold mouse highlight data. This is here because other header files need it for defining struct x_output etc. */ @@ -1874,8 +1900,11 @@ is how we define the symbol for function `name' at start-up time. */ extern void defsubr (struct Lisp_Subr *); -#define MANY -2 -#define UNEVALLED -1 +enum maxargs + { + MANY = -2, + UNEVALLED = -1 + }; extern void defvar_lisp (struct Lisp_Objfwd *, const char *, Lisp_Object *); extern void defvar_lisp_nopro (struct Lisp_Objfwd *, const char *, Lisp_Object *); @@ -2708,7 +2737,7 @@ Lisp_Object); extern Lisp_Object internal_with_output_to_temp_buffer (const char *, Lisp_Object (*) (Lisp_Object), Lisp_Object); -#define FLOAT_TO_STRING_BUFSIZE 350 +enum FLOAT_TO_STRING_BUFSIZE { FLOAT_TO_STRING_BUFSIZE = 350 }; extern int float_to_string (char *, double); extern void syms_of_print (void); @@ -3304,15 +3333,6 @@ # define lint_assume(cond) ((void) (0 && (cond))) #endif -/* The ubiquitous min and max macros. */ - -#ifdef max -#undef max -#undef min -#endif -#define min(a, b) ((a) < (b) ? (a) : (b)) -#define max(a, b) ((a) > (b) ? (a) : (b)) - /* We used to use `abs', but that clashes with system headers on some platforms, and using a name reserved by Standard C is a bad idea anyway. */ @@ -3355,7 +3375,7 @@ /* SAFE_ALLOCA normally allocates memory on the stack, but if size is larger than MAX_ALLOCA, use xmalloc to avoid overflowing the stack. */ -#define MAX_ALLOCA 16*1024 +enum MAX_ALLOCA { MAX_ALLOCA = 16*1024 }; extern Lisp_Object safe_alloca_unwind (Lisp_Object); ------------------------------------------------------------ revno: 109283 committer: Dmitry Antipov branch nick: trunk timestamp: Mon 2012-07-30 08:02:39 +0400 message: Cleanup string bytes checking. * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES. (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES. (check_sblock, compact_small_strings): Simplify. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-29 22:42:12 +0000 +++ src/ChangeLog 2012-07-30 04:02:39 +0000 @@ -1,3 +1,11 @@ +2012-07-30 Dmitry Antipov + + Cleanup string bytes checking. + * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert + all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES. + (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES. + (check_sblock, compact_small_strings): Simplify. + 2012-07-29 Paul Eggert * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove. === modified file 'src/alloc.c' --- src/alloc.c 2012-07-29 17:14:51 +0000 +++ src/alloc.c 2012-07-30 04:02:39 +0000 @@ -150,12 +150,6 @@ #define VECTOR_UNMARK(V) ((V)->header.size &= ~ARRAY_MARK_FLAG) #define VECTOR_MARKED_P(V) (((V)->header.size & ARRAY_MARK_FLAG) != 0) -/* Value is the number of bytes of S, a pointer to a struct Lisp_String. - Be careful during GC, because S->size contains the mark bit for - strings. */ - -#define GC_STRING_BYTES(S) (STRING_BYTES (S)) - /* Default value of gc_cons_threshold (see below). */ #define GC_DEFAULT_THRESHOLD (100000 * sizeof (Lisp_Object)) @@ -1802,10 +1796,8 @@ static int check_string_bytes_count; -#define CHECK_STRING_BYTES(S) STRING_BYTES (S) - - -/* Like GC_STRING_BYTES, but with debugging check. */ +/* Like STRING_BYTES, but with debugging check. Can be + called during GC, so pay attention to the mark bit. */ ptrdiff_t string_bytes (struct Lisp_String *s) @@ -1837,15 +1829,8 @@ /* Check that the string size recorded in the string is the same as the one recorded in the sdata structure. */ - if (from->string) - CHECK_STRING_BYTES (from->string); - - if (from->string) - nbytes = GC_STRING_BYTES (from->string); - else - nbytes = SDATA_NBYTES (from); - - nbytes = SDATA_SIZE (nbytes); + nbytes = SDATA_SIZE (from->string ? string_bytes (from->string) + : SDATA_NBYTES (from)); from_end = (struct sdata *) ((char *) from + nbytes + GC_STRING_EXTRA); } } @@ -1866,7 +1851,7 @@ { struct Lisp_String *s = b->first_data.string; if (s) - CHECK_STRING_BYTES (s); + string_bytes (s); } for (b = oldest_sblock; b; b = b->next) @@ -1876,6 +1861,10 @@ check_sblock (current_sblock); } +#else /* not GC_CHECK_STRING_BYTES */ + +#define check_string_bytes(all) ((void) 0) + #endif /* GC_CHECK_STRING_BYTES */ #ifdef GC_CHECK_STRING_FREE_LIST @@ -1987,7 +1976,7 @@ if (s->data) { old_data = SDATA_OF_STRING (s); - old_nbytes = GC_STRING_BYTES (s); + old_nbytes = STRING_BYTES (s); } else old_data = NULL; @@ -2121,10 +2110,10 @@ how large that is. Reset the sdata's string back-pointer so that we know it's free. */ #ifdef GC_CHECK_STRING_BYTES - if (GC_STRING_BYTES (s) != SDATA_NBYTES (data)) + if (string_bytes (s) != SDATA_NBYTES (data)) abort (); #else - data->u.nbytes = GC_STRING_BYTES (s); + data->u.nbytes = STRING_BYTES (s); #endif data->string = NULL; @@ -2227,22 +2216,17 @@ /* Compute the next FROM here because copying below may overwrite data we need to compute it. */ ptrdiff_t nbytes; + struct Lisp_String *s = from->string; #ifdef GC_CHECK_STRING_BYTES /* Check that the string size recorded in the string is the same as the one recorded in the sdata structure. */ - if (from->string - && GC_STRING_BYTES (from->string) != SDATA_NBYTES (from)) + if (s && string_bytes (s) != SDATA_NBYTES (from)) abort (); #endif /* GC_CHECK_STRING_BYTES */ - if (from->string) - nbytes = GC_STRING_BYTES (from->string); - else - nbytes = SDATA_NBYTES (from); - - if (nbytes > LARGE_STRING_BYTES) - abort (); + nbytes = s ? STRING_BYTES (s) : SDATA_NBYTES (from); + eassert (nbytes <= LARGE_STRING_BYTES); nbytes = SDATA_SIZE (nbytes); from_end = (struct sdata *) ((char *) from + nbytes + GC_STRING_EXTRA); @@ -2254,8 +2238,8 @@ abort (); #endif - /* FROM->string non-null means it's alive. Copy its data. */ - if (from->string) + /* Non-NULL S means it's alive. Copy its data. */ + if (s) { /* If TB is full, proceed with the next sblock. */ to_end = (struct sdata *) ((char *) to + nbytes + GC_STRING_EXTRA); @@ -5955,7 +5939,7 @@ #ifdef GC_CHECK_STRING_BYTES /* Check that the string size recorded in the string is the same as the one recorded in the sdata structure. */ - CHECK_STRING_BYTES (ptr); + string_bytes (ptr); #endif /* GC_CHECK_STRING_BYTES */ } break; @@ -6294,10 +6278,7 @@ sweep_weak_hash_tables (); sweep_strings (); -#ifdef GC_CHECK_STRING_BYTES - if (!noninteractive) - check_string_bytes (1); -#endif + check_string_bytes (!noninteractive); /* Put all unmarked conses on free list */ { @@ -6617,11 +6598,7 @@ } sweep_vectors (); - -#ifdef GC_CHECK_STRING_BYTES - if (!noninteractive) - check_string_bytes (1); -#endif + check_string_bytes (!noninteractive); } ------------------------------------------------------------ revno: 109282 committer: Jay Belanger branch nick: trunk timestamp: Sun 2012-07-29 22:38:24 -0500 message: doc/misc/calc.texi (Getting Started, Tutorial): Change simulated Calc output to match actual output. (Simplifying Formulas): Mention that algebraic simplification is now the default. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2012-07-29 08:18:29 +0000 +++ doc/misc/ChangeLog 2012-07-30 03:38:24 +0000 @@ -1,3 +1,10 @@ +2012-07-30 Jay Belanger + + * calc.texi (Getting Started, Tutorial): Change simulated + Calc output to match actual output. + (Simplifying Formulas): Mention that algebraic simplification is now + the default. + 2012-07-28 Eli Zaretskii * faq.texi (Right-to-left alphabets): Update for Emacs 24. === modified file 'doc/misc/calc.texi' --- doc/misc/calc.texi 2012-07-25 05:48:19 +0000 +++ doc/misc/calc.texi 2012-07-30 03:38:24 +0000 @@ -910,12 +910,12 @@ is -1 / ln(x) x +1 / x ln(x) @end group @end smallexample (Note that by default, Calc gives division lower precedence than multiplication, -so that @samp{1 / ln(x) x} is equivalent to @samp{1 / (ln(x) x)}.) +so that @samp{1 / x ln(x)} is equivalent to @samp{1 / (x ln(x))}.) To make this look nicer, you might want to press @kbd{d =} to center the formula, and even @kbd{d B} to use Big display mode. @@ -932,7 +932,7 @@ 1 ------- - ln(x) x + x ln(x) @end group @end smallexample @@ -964,7 +964,9 @@ The related command @kbd{C-x * w} operates on a single word, which generally means a single number, inside text. It searches for an expression which ``looks'' like a number containing the point. -Here's an example of its use: +Here's an example of its use (before you try this, remove the Calc +annotations or use a new buffer so that the extra settings in the +annotations don't take effect): @smallexample A slope of one-third corresponds to an angle of 1 degrees. @@ -1175,15 +1177,16 @@ Emacs Lisp didn't have built-in floating point math (now it does), so this had to be simulated in software. In fact, Emacs integers would -only comfortably fit six decimal digits or so---not enough for a decent -calculator. So I had to write my own high-precision integer code as -well, and once I had this I figured that arbitrary-size integers were -just as easy as large integers. Arbitrary floating-point precision was -the logical next step. Also, since the large integer arithmetic was -there anyway it seemed only fair to give the user direct access to it, -which in turn made it practical to support fractions as well as floats. -All these features inspired me to look around for other data types that -might be worth having. +only comfortably fit six decimal digits or so (at the time)---not +enough for a decent calculator. So I had to write my own +high-precision integer code as well, and once I had this I figured +that arbitrary-size integers were just as easy as large integers. +Arbitrary floating-point precision was the logical next step. Also, +since the large integer arithmetic was there anyway it seemed only +fair to give the user direct access to it, which in turn made it +practical to support fractions as well as floats. All these features +inspired me to look around for other data types that might be worth +having. Around this time, my friend Rick Koshi showed me his nifty new HP-28 calculator. It allowed the user to manipulate formulas as well as @@ -1359,15 +1362,14 @@ @subsection RPN Calculations and the Stack @cindex RPN notation +@noindent @ifnottex -@noindent Calc normally uses RPN notation. You may be familiar with the RPN system from Hewlett-Packard calculators, FORTH, or PostScript. (Reverse Polish Notation, RPN, is named after the Polish mathematician Jan Lukasiewicz.) @end ifnottex @tex -\noindent Calc normally uses RPN notation. You may be familiar with the RPN system from Hewlett-Packard calculators, FORTH, or PostScript. (Reverse Polish Notation, RPN, is named after the Polish mathematician @@ -1473,7 +1475,7 @@ if you're right. @xref{RPN Answer 1, 1}. (@bullet{}) (@bullet{}) @strong{Exercise 2.} Compute -@texline @math{(2\times4) + (7\times9.4) + {5\over4}} +@texline @math{(2\times4) + (7\times9.5) + {5\over4}} @infoline @expr{2*4 + 7*9.5 + 5/4} using the stack. @xref{RPN Answer 2, 2}. (@bullet{}) @@ -1964,7 +1966,7 @@ @smallexample @group -1: 2 a + 2 b 1: 34 + 2 b +1: 2 a + 2 b 1: 2 b + 34 . . ' 2a+2b @key{RET} = @@ -1976,7 +1978,7 @@ @smallexample @group -1: 2 + log10(0) + log10(x) + log10(5, 6) + foo(3) +1: log10(0) + log10(x) + log10(5, 6) + foo(3) + 2 . ' log10(100) + log10(0) + log10(x) + log10(5,6) + foo(3) @key{RET} @@ -4588,7 +4590,7 @@ @cindex Fermat, primality test of (@bullet{}) @strong{Exercise 10.} A theorem of Pierre de Fermat says that -@texline @w{@math{x^{n-1} \bmod n = 1}} +@texline @math{x^{n-1} \bmod n = 1} @infoline @expr{x^(n-1) mod n = 1} if @expr{n} is a prime number and @expr{x} is an integer less than @expr{n}. If @expr{n} is @emph{not} a prime number, this will @@ -4704,19 +4706,17 @@ @smallexample @group -1: 20 degF 1: 11.1111 degC 1: -20:3 degC 1: -6.666 degC +1: 20 degF 1: 11.1111 degC 1: -6.666 degC . . . . - ' 20 degF @key{RET} u c degC @key{RET} U u t degC @key{RET} c f + ' 20 degF @key{RET} u c degC @key{RET} U u t degC @key{RET} @end group @end smallexample @noindent First we convert a change of 20 degrees Fahrenheit into an equivalent change in degrees Celsius (or Centigrade). Then, we convert the -absolute temperature 20 degrees Fahrenheit into Celsius. Since -this comes out as an exact fraction, we then convert to floating-point -for easier comparison with the other result. +absolute temperature 20 degrees Fahrenheit into Celsius. For simple unit conversions, you can put a plain number on the stack. Then @kbd{u c} and @kbd{u t} will prompt for both old and new units. @@ -4775,7 +4775,7 @@ @smallexample @group -1: 2 x^2 - 6 1: 6 - 2 x^2 1: (6 - 2 x^2) (3 x^2 + y) +1: 2 x^2 - 6 1: 6 - 2 x^2 1: (3 x^2 + y) (6 - 2 x^2) . . . ' 2x^2-6 @key{RET} n ' 3x^2+y @key{RET} * @@ -4791,7 +4791,7 @@ @smallexample @group -1: 18 x^2 + 6 y - 6 x^4 - 2 x^2 y 1: (18 - 2 y) x^2 - 6 x^4 + 6 y +1: 18 x^2 - 6 x^4 + 6 y - 2 y x^2 1: (18 - 2 y) x^2 - 6 x^4 + 6 y . . a x a c x @key{RET} @@ -4849,17 +4849,17 @@ @smallexample @group -1: (34 x - 24 x^3) / x 1: 34 x / x - 24 x^3 / x 1: 34 - 24 x^2 - . . . +1: (34 x - 24 x^3) / x 1: 34 - 24 x^2 + . . - ' x @key{RET} / a x a s + ' x @key{RET} / a x @end group @end smallexample @noindent @smallexample @group -1: 34 - 24 x^2 = 0 1: x = 1.19023 +1: 0.70588 x^2 = 1 1: x = 1.19023 . . 0 a = s 3 a S x @key{RET} @@ -4867,10 +4867,6 @@ @end smallexample @noindent -Notice the use of @kbd{a s} to ``simplify'' the formula. When the -default algebraic simplifications don't do enough, you can use -@kbd{a s} to tell Calc to spend more time on the job. - Now we compute the second derivative and plug in our values of @expr{x}: @smallexample @@ -4905,7 +4901,7 @@ local @emph{minimum} at @expr{x = 0}.) When we solved for @expr{x}, we got only one value even though -@expr{34 - 24 x^2 = 0} is a quadratic equation that ought to have +@expr{0.70588 x^2 = 1} is a quadratic equation that ought to have two solutions. The reason is that @w{@kbd{a S}} normally returns a single ``principal'' solution. If it needs to come up with an arbitrary sign (as occurs in the quadratic formula) it picks @expr{+}. @@ -4914,7 +4910,7 @@ @smallexample @group -1: 34 - 24 x^2 = 0 1: x = 1.19023 s1 1: x = -1.19023 +1: 0.70588 x^2 = 1 1: x = 1.19023 s1 1: x = -1.19023 . . . r 3 H a S x @key{RET} s 5 1 n s l s1 @key{RET} @@ -5135,7 +5131,7 @@ @smallexample @group 2: [1, 1.1, ... ] 1: [0., 0.084941, 0.16993, ... ] -1: sin(x) ln(x) . +1: ln(x) sin(x) . . ' sin(x) ln(x) @key{RET} s 1 m r p 5 @key{RET} V M $ @key{RET} @@ -5168,7 +5164,7 @@ @smallexample @group -1: sin(x) ln(x) 1: 0.84147 x - 0.84147 + 0.11957 (x - 1)^2 - ... +1: ln(x) sin(x) 1: 0.84147 x + 0.11957 (x - 1)^2 - ... . . r 1 a t x=1 @key{RET} 4 @key{RET} @@ -5277,60 +5273,43 @@ @smallexample @group -1: 2 / cos(x)^2 - 2 tan(x)^2 +1: 2 sec(x)^2 / tan(x)^2 - 2 / tan(x)^2 . - ' 2/cos(x)^2 - 2tan(x)^2 @key{RET} s 1 + ' 2sec(x)^2/tan(x)^2 - 2/tan(x)^2 @key{RET} s 1 @end group @end smallexample @noindent -If we were simplifying this by hand, we'd probably replace the -@samp{tan} with a @samp{sin/cos} first, then combine over a common -denominator. The @kbd{I a s} command will do the former and the @kbd{a n} -algebra command will do the latter, but we'll do both with rewrite -rules just for practice. +If we were simplifying this by hand, we'd probably combine over the common +denominator. The @kbd{a n} algebra command will do this, but we'll do +it with a rewrite rule just for practice. Rewrite rules are written with the @samp{:=} symbol. @smallexample @group -1: 2 / cos(x)^2 - 2 sin(x)^2 / cos(x)^2 +1: (2 sec(x)^2 - 2) / tan(x)^2 . - a r tan(a) := sin(a)/cos(a) @key{RET} + a r a/x + b/x := (a+b)/x @key{RET} @end group @end smallexample @noindent (The ``assignment operator'' @samp{:=} has several uses in Calc. All -by itself the formula @samp{tan(a) := sin(a)/cos(a)} doesn't do anything, +by itself the formula @samp{a/x + b/x := (a+b)/x} doesn't do anything, but when it is given to the @kbd{a r} command, that command interprets it as a rewrite rule.) -The lefthand side, @samp{tan(a)}, is called the @dfn{pattern} of the +The lefthand side, @samp{a/x + b/x}, is called the @dfn{pattern} of the rewrite rule. Calc searches the formula on the stack for parts that match the pattern. Variables in a rewrite pattern are called @dfn{meta-variables}, and when matching the pattern each meta-variable can match any sub-formula. Here, the meta-variable @samp{a} matched -the actual variable @samp{x}. - -When the pattern part of a rewrite rule matches a part of the formula, -that part is replaced by the righthand side with all the meta-variables -substituted with the things they matched. So the result is -@samp{sin(x) / cos(x)}. Calc's normal algebraic simplifications then -mix this in with the rest of the original formula. - -To merge over a common denominator, we can use another simple rule: - -@smallexample -@group -1: (2 - 2 sin(x)^2) / cos(x)^2 - . - - a r a/x + b/x := (a+b)/x @key{RET} -@end group -@end smallexample +the expression @samp{2 sec(x)^2}, the meta-variable @samp{b} matched +the constant @samp{-2} and the meta-variable @samp{x} matched +the expression @samp{tan(x)^2}. This rule points out several interesting features of rewrite patterns. First, if a meta-variable appears several times in a pattern, it must @@ -5340,13 +5319,18 @@ Second, meta-variable names are independent from variables in the target formula. Notice that the meta-variable @samp{x} here matches -the subformula @samp{cos(x)^2}; Calc never confuses the two meanings of +the subformula @samp{tan(x)^2}; Calc never confuses the two meanings of @samp{x}. And third, rewrite patterns know a little bit about the algebraic properties of formulas. The pattern called for a sum of two quotients; Calc was able to match a difference of two quotients by matching -@samp{a = 2}, @samp{b = -2 sin(x)^2}, and @samp{x = cos(x)^2}. +@samp{a = 2 sec(x)^2}, @samp{b = -2}, and @samp{x = tan(x)^2}. + +When the pattern part of a rewrite rule matches a part of the formula, +that part is replaced by the righthand side with all the meta-variables +substituted with the things they matched. So the result is +@samp{(2 sec(x)^2 - 2) / tan(x)^2}. @c [fix-ref Algebraic Properties of Rewrite Rules] We could just as easily have written @samp{a/x - b/x := (a-b)/x} for @@ -5356,19 +5340,19 @@ of Rewrite Rules}, for some examples of this.) One more rewrite will complete the job. We want to use the identity -@samp{sin(x)^2 + cos(x)^2 = 1}, but of course we must first rearrange +@samp{tan(x)^2 + 1 = sec(x)^2}, but of course we must first rearrange the identity in a way that matches our formula. The obvious rule -would be @samp{@w{2 - 2 sin(x)^2} := 2 cos(x)^2}, but a little thought shows -that the rule @samp{sin(x)^2 := 1 - cos(x)^2} will also work. The +would be @samp{@w{2 sec(x)^2 - 2} := 2 tan(x)^2}, but a little thought shows +that the rule @samp{sec(x)^2 := 1 + tan(x)^2} will also work. The latter rule has a more general pattern so it will work in many other situations, too. @smallexample @group -1: (2 + 2 cos(x)^2 - 2) / cos(x)^2 1: 2 - . . +1: 2 + . - a r sin(x)^2 := 1 - cos(x)^2 @key{RET} a s + a r sec(x)^2 := 1 + tan(x)^2 @key{RET} @end group @end smallexample @@ -5383,14 +5367,13 @@ @smallexample @group -' tan(x) := sin(x)/cos(x) @key{RET} s t tsc @key{RET} -' a/x + b/x := (a+b)/x @key{RET} s t merge @key{RET} -' sin(x)^2 := 1 - cos(x)^2 @key{RET} s t sinsqr @key{RET} +' a/x + b/x := (a+b)/x @key{RET} s t merge @key{RET} +' sec(x)^2 := 1 + tan(x)^2 @key{RET} s t secsqr @key{RET} -1: 2 / cos(x)^2 - 2 tan(x)^2 1: 2 +1: 2 sec(x)^2 / tan(x)^2 - 2 / tan(x)^2 1: 2 . . - r 1 a r tsc @key{RET} a r merge @key{RET} a r sinsqr @key{RET} a s + r 1 a r merge @key{RET} a r secsqr @key{RET} @end group @end smallexample @@ -5420,20 +5403,20 @@ @smallexample @group -1: [tsc, merge, sinsqr] 1: [tan(x) := sin(x) / cos(x), ... ] +1: [merge, secsqr] 1: [a/x + b/x := (a + b)/x, ... ] . . - ' [tsc,merge,sinsqr] @key{RET} = + ' [merge,sinsqr] @key{RET} = @end group @end smallexample @noindent @smallexample @group -1: 1 / cos(x) - sin(x) tan(x) 1: cos(x) +1: 2 sec(x)^2 / tan(x)^2 - 2 / tan(x)^2 1: 2 . . - s t trig @key{RET} r 1 a r trig @key{RET} a s + s t trig @key{RET} r 1 a r trig @key{RET} @end group @end smallexample @@ -5451,10 +5434,10 @@ @smallexample @group -1: 1 / cos(x) - sin(x)^2 / cos(x) 1: (1 - sin(x)^2) / cos(x) - . . +1: (2 sec(x)^2 - 2) / tan(x)^2 1: 2 + . . - r 1 M-1 a r trig @key{RET} M-1 a r trig @key{RET} + r 1 M-1 a r trig @key{RET} M-1 a r trig @key{RET} @end group @end smallexample @@ -5466,20 +5449,20 @@ @smallexample @group -1: exp(2 pi i) + exp(3 pi i) + exp(4 pi i) +1: sin(x + 2 pi) + sin(x + 3 pi) + sin(x + 4 pi) . - ' exp(2 pi i) + exp(3 pi i) + exp(4 pi i) @key{RET} + ' sin(x+2pi) + sin(x+3pi) + sin(x+4pi) @key{RET} @end group @end smallexample @noindent @smallexample @group -1: 1 + exp(3 pi i) + 1 +1: sin(x + 3 pi) + 2 sin(x) . - a r exp(k pi i) := 1 :: k % 2 = 0 @key{RET} + a r sin(a + k pi) := sin(a) :: k % 2 = 0 @key{RET} @end group @end smallexample @@ -5487,10 +5470,10 @@ (Recall, @samp{k % 2} is the remainder from dividing @samp{k} by 2, which will be zero only when @samp{k} is an even integer.) -An interesting point is that the variables @samp{pi} and @samp{i} -were matched literally rather than acting as meta-variables. -This is because they are special-constant variables. The special -constants @samp{e}, @samp{phi}, and so on also match literally. +An interesting point is that the variable @samp{pi} was matched +literally rather than acting as a meta-variable. +This is because it is a special-constant variable. The special +constants @samp{e}, @samp{i}, @samp{phi}, and so on also match literally. A common error with rewrite rules is to write, say, @samp{f(a,b,c,d,e) := g(a+b+c+d+e)}, expecting to match any @samp{f} with five arguments but in fact matching @@ -5541,7 +5524,7 @@ @smallexample @group -1: fib(6) + fib(x) + fib(0) 1: 8 + fib(x) + fib(0) +1: fib(6) + fib(x) + fib(0) 1: fib(x) + fib(0) + 8 . . ' fib(6)+fib(x)+fib(0) @key{RET} a r fib @key{RET} @@ -5707,10 +5690,10 @@ For example, given @samp{1 - x^2 / 2 + O(x^3)} and @samp{x - x^3 / 6 + O(x^4)} on the stack, we want to be able to type @kbd{*} and get the result @samp{x - 2:3 x^3 + O(x^4)}. Don't worry if the terms of the sum are -rearranged or if @kbd{a s} needs to be typed after rewriting. (This one -is rather tricky; the solution at the end of this chapter uses 6 rewrite -rules. Hint: The @samp{constant(x)} condition tests whether @samp{x} is -a number.) @xref{Rewrites Answer 6, 6}. (@bullet{}) +rearranged. (This one is rather tricky; the solution at the end of +this chapter uses 6 rewrite rules. Hint: The @samp{constant(x)} +condition tests whether @samp{x} is a number.) @xref{Rewrites Answer +6, 6}. (@bullet{}) Just for kicks, try adding the rule @code{2+3 := 6} to @code{EvalRules}. What happens? (Be sure to remove this rule afterward, or you might get @@ -5737,7 +5720,7 @@ @smallexample @group -1: 1 + x + x^2 / 2 + x^3 / 6 1: 1 + x + x^2 / 2 + x^3 / 6 +1: x + x^2 / 2 + x^3 / 6 + 1 1: x + x^2 / 2 + x^3 / 6 + 1 . . ' 1 + x + x^2/2! + x^3/3! @key{RET} Z F e myexp @key{RET} @key{RET} @key{RET} y @@ -5808,7 +5791,7 @@ ' y=sqrt(x) @key{RET} C-x ( H a S x @key{RET} C-x ) -1: y = cos(x) 1: x = s1 arccos(y) + 2 pi n1 +1: y = cos(x) 1: x = s1 arccos(y) + 2 n1 pi . . ' y=cos(x) @key{RET} X @@ -6874,7 +6857,7 @@ @smallexample @group -1: [6, 10] 2: [6, 10] 1: [6 - 4 a / (b - a), 4 / (b - a) ] +1: [6, 10] 2: [6, 10] 1: [4 a / (a - b) + 6, 4 / (b - a) ] . 1: [ [ 1, a ] . [ 1, b ] ] . @@ -6888,9 +6871,9 @@ @smallexample @group - 4 a 4 -1: [6 - -----, -----] - b - a b - a + 4 a 4 +1: [----- + 6, -----] + a - b b - a @end group @end smallexample @@ -8442,11 +8425,11 @@ @smallexample @group -1: 3.3356 ns 1: 0.81356 ns / ns 1: 0.81356 -2: 4.1 ns . . +1: 3.3356 ns 1: 0.81356 +2: 4.1 ns . . - ' 4.1 ns @key{RET} / u s + ' 4.1 ns @key{RET} / @end group @end smallexample @@ -8523,7 +8506,7 @@ @noindent @smallexample @group -1: [x - 1.19023, x + 1.19023, x] 1: (x - 1.19023) (x + 1.19023) x +1: [x - 1.19023, x + 1.19023, x] 1: x*(x + 1.19023) (x - 1.19023) . . V M ' x-$ @key{RET} V R * @@ -8549,7 +8532,7 @@ @smallexample @group -1: x sin(pi x) 1: (sin(pi x) - pi x cos(pi x)) / pi^2 +1: x sin(pi x) 1: sin(pi x) / pi^2 - x cos(pi x) / pi . . ' x sin(pi x) @key{RET} m r a i x @key{RET} @@ -8560,7 +8543,7 @@ @smallexample @group 1: [y, 1] -2: (sin(pi x) - pi x cos(pi x)) / pi^2 +2: sin(pi x) / pi^2 - x cos(pi x) / pi . ' [y,1] @key{RET} @key{TAB} @@ -8570,7 +8553,7 @@ @noindent @smallexample @group -1: [(sin(pi y) - pi y cos(pi y)) / pi^2, (sin(pi) - pi cos(pi)) / pi^2] +1: [sin(pi y) / pi^2 - y cos(pi y) / pi, 1 / pi] . V M $ @key{RET} @@ -8580,7 +8563,7 @@ @noindent @smallexample @group -1: (sin(pi y) - pi y cos(pi y)) / pi^2 + (pi cos(pi) - sin(pi)) / pi^2 +1: sin(pi y) / pi^2 - y cos(pi y) / pi - 1 / pi . V R - @@ -8590,7 +8573,7 @@ @noindent @smallexample @group -1: (sin(3.14159 y) - 3.14159 y cos(3.14159 y)) / 9.8696 - 0.3183 +1: sin(3.14159 y) / 9.8696 - y cos(3.14159 y) / 3.14159 - 0.3183 . = @@ -8685,11 +8668,11 @@ @smallexample @group - ___ - 2 + V 2 -1: (2 + sqrt(2)) / (1 + sqrt(2)) 1: -------- - . ___ - 1 + V 2 + ___ + V 2 + 2 +1: (2 + sqrt(2)) / (1 + sqrt(2)) 1: --------- + . ___ + V 2 + 1 . @@ -8713,11 +8696,11 @@ @noindent @smallexample @group - ___ ___ -1: 2 + V 2 - 2 1: V 2 - . . + ___ +1: V 2 + . - a r a*(b+c) := a*b + a*c a s + a r a*(b+c) := a*b + a*c @end group @end smallexample @@ -12601,7 +12584,11 @@ The @kbd{m O} (@code{calc-no-simplify-mode}) command turns off all optional simplifications. These would leave a formula like @expr{2+3} alone. In fact, nothing except simple numbers are ever affected by normalization -in this mode. +in this mode. Explicit simplification commands, such as @kbd{=} or +@kbd{a s}, can still be given to simplify any formulas. +@xref{Algebraic Definitions}, for a sample use of +No-Simplification mode. + @kindex m N @pindex calc-num-simplify-mode @@ -12616,29 +12603,27 @@ error form or modulo form), or a vector all of whose elements are constant. -@kindex m D -@pindex calc-default-simplify-mode -The @kbd{m D} (@code{calc-default-simplify-mode}) command restores the -default simplifications for all formulas. This includes many easy and +@kindex m L +@pindex calc-limited-simplify-mode +The @kbd{m L} (@code{calc-limited-simplify-mode}) command does limited +simplifications for all formulas. This includes many easy and fast algebraic simplifications such as @expr{a+0} to @expr{a}, and @expr{a + 2 a} to @expr{3 a}, as well as evaluating functions like @expr{@tfn{deriv}(x^2, x)} to @expr{2 x}. @kindex m B @pindex calc-bin-simplify-mode -The @kbd{m B} (@code{calc-bin-simplify-mode}) mode applies the default +The @kbd{m B} (@code{calc-bin-simplify-mode}) mode applies the limited simplifications to a result and then, if the result is an integer, uses the @kbd{b c} (@code{calc-clip}) command to clip the integer according to the current binary word size. @xref{Binary Functions}. Real numbers are rounded to the nearest integer and then clipped; other kinds of results (after the default simplifications) are left alone. -@kindex m A -@pindex calc-alg-simplify-mode -The @kbd{m A} (@code{calc-alg-simplify-mode}) mode does algebraic -simplification; it applies all the default simplifications, and also -the more powerful (and slower) simplifications made by @kbd{a s} -(@code{calc-simplify}). @xref{Algebraic Simplifications}. +@kindex m D +@pindex calc-default-simplify-mode +The @kbd{m D} (@code{calc-default-simplify-mode}) mode does standard +algebraic simplifications. @xref{Algebraic Simplifications}. @kindex m E @pindex calc-ext-simplify-mode @@ -12658,9 +12643,7 @@ A common technique is to set the simplification mode down to the lowest amount of simplification you will allow to be applied automatically, then use manual commands like @kbd{a s} and @kbd{c c} (@code{calc-clean}) to -perform higher types of simplifications on demand. @xref{Algebraic -Definitions}, for another sample use of No-Simplification mode. - +perform higher types of simplifications on demand. @node Declarations, Display Modes, Simplification Modes, Mode Settings @section Declarations @@ -15893,8 +15876,8 @@ @item BinSimp@var{w} Binary-integer simplification mode; word size @var{w} (@kbd{m B}, @kbd{b w}). -@item AlgSimp -Algebraic simplification mode (@kbd{m A}). +@item LimSimp +Limited simplification mode (@kbd{m L}). @item ExtSimp Extended algebraic simplification mode (@kbd{m E}). @@ -16733,9 +16716,9 @@ operation. Vectors and formulas are cleaned by cleaning each component number (i.e., pervasively). -If the simplification mode is set below the default level, it is raised -to the default level for the purposes of this command. Thus, @kbd{c c} -applies the default simplifications even if their automatic application +If the simplification mode is set below the limited level, it is raised +to the limited level for the purposes of this command. Thus, @kbd{c c} +applies the limited simplifications even if their automatic application is disabled. @xref{Simplification Modes}. @cindex Roundoff errors, correcting @@ -18336,7 +18319,7 @@ Also, the symbolic variable @code{pi} is not ordinarily recognized in arguments to trigonometric functions, as in @samp{sin(3 pi / 4)}, but -the @kbd{a s} (@code{calc-simplify}) command recognizes many such +the default algebraic simplifications recognize many such formulas when the current angular mode is Radians @emph{and} Symbolic mode is enabled; this example would be replaced by @samp{sqrt(2) / 2}. @xref{Symbolic Mode}. Beware, this simplification occurs even if you @@ -22075,8 +22058,8 @@ @pindex calc-sel-div-both-sides The @kbd{j *} (@code{calc-sel-mult-both-sides}) command prompts for a formula using algebraic entry, then multiplies both sides of the -selected quotient or equation by that formula. It simplifies each -side with @kbd{a s} (@code{calc-simplify}) before re-forming the +selected quotient or equation by that formula. It performs the +default algebraic simplifications before re-forming the quotient or equation. You can suppress this simplification by providing a prefix argument: @kbd{C-u j *}. There is also a @kbd{j /} (@code{calc-sel-div-both-sides}) which is similar to @kbd{j *} but @@ -22143,15 +22126,15 @@ @kindex j v @pindex calc-sel-evaluate The @kbd{j v} (@code{calc-sel-evaluate}) command performs the -normal default simplifications on the selected sub-formula. -These are the simplifications that are normally done automatically -on all results, but which may have been partially inhibited by +limited simplifications on the selected sub-formula. +These simplifications would normally be done automatically +on all results, but may have been partially inhibited by previous selection-related operations, or turned off altogether by the @kbd{m O} command. This command is just an auto-selecting version of the @w{@kbd{a v}} command (@pxref{Algebraic Manipulation}). With a numeric prefix argument of 2, @kbd{C-u 2 j v} applies -the @kbd{a s} (@code{calc-simplify}) command to the selected +the default algebraic simplifications to the selected sub-formula. With a prefix argument of 3 or more, e.g., @kbd{C-u j v} applies the @kbd{a e} (@code{calc-simplify-extended}) command. @xref{Simplifying Formulas}. With a negative prefix argument @@ -22340,15 +22323,8 @@ @kindex H a s @pindex calc-simplify @tindex simplify -The @kbd{a s} (@code{calc-simplify}) [@code{simplify}] command applies -various algebraic rules to simplify a formula. This includes rules which -are not part of the default simplifications because they may be too slow -to apply all the time, or may not be desirable all of the time. For -example, non-adjacent terms of sums are combined, as in @samp{a + b + 2 a} -to @samp{b + 3 a}, and some formulas like @samp{sin(arcsin(x))} are -simplified to @samp{x}. -The sections below describe all the various kinds of algebraic +The sections below describe all the various kinds of simplifications Calc provides in full detail. None of Calc's simplification commands are designed to pull rabbits out of hats; they simply apply certain specific rules to put formulas into @@ -22358,8 +22334,10 @@ @xref{Rewrite Rules}. @xref{Simplification Modes}, for commands to control what level of -simplification occurs automatically. Normally only the ``default -simplifications'' occur. +simplification occurs automatically. Normally only the default +algebraic simplifications occur. If you have turned on a +simplification mode which does not do these default simplifications, +you can still perform them on a formula with the @kbd{a s} command. There are some simplifications that, while sometimes useful, are never done automatically. For example, the @kbd{I} prefix can be given to @@ -22379,29 +22357,23 @@ @menu -* Default Simplifications:: +* Limited Simplifications:: * Algebraic Simplifications:: * Unsafe Simplifications:: * Simplification of Units:: @end menu -@node Default Simplifications, Algebraic Simplifications, Simplifying Formulas, Simplifying Formulas -@subsection Default Simplifications +@node Limited Simplifications, Algebraic Simplifications, Simplifying Formulas, Simplifying Formulas +@subsection Limited Simplifications @noindent -@cindex Default simplifications -This section describes the ``default simplifications,'' those which are -normally applied to all results. For example, if you enter the variable -@expr{x} on the stack twice and push @kbd{+}, Calc's default -simplifications automatically change @expr{x + x} to @expr{2 x}. - -The @kbd{m O} command turns off the default simplifications, so that -@expr{x + x} will remain in this form unless you give an explicit -``simplify'' command like @kbd{=} or @kbd{a v}. @xref{Algebraic -Manipulation}. The @kbd{m D} command turns the default simplifications -back on. - -The most basic default simplification is the evaluation of functions. +@cindex Limited simplifications +This section describes a limited set of simplifications. These, as +well as those described in the next section, are normally applied to +all results. You can type @kbd{m L} to restrict the simplifications +done on the stack to this limited set. + +The most basic simplification is the evaluation of functions. For example, @expr{2 + 3} is evaluated to @expr{5}, and @expr{@tfn{sqrt}(9)} is evaluated to @expr{3}. Evaluation does not occur if the arguments to a function are somehow of the wrong type @expr{@tfn{tan}([2,3,4])}), @@ -22419,16 +22391,17 @@ operator) does not evaluate all of its arguments, and @code{evalto} does not evaluate its lefthand argument. -Most commands apply the default simplifications to all arguments they -take from the stack, perform a particular operation, then simplify -the result before pushing it back on the stack. In the common special -case of regular arithmetic commands like @kbd{+} and @kbd{Q} [@code{sqrt}], -the arguments are simply popped from the stack and collected into a -suitable function call, which is then simplified (the arguments being -simplified first as part of the process, as described above). +Most commands apply at least these limited simplifications to all +arguments they take from the stack, perform a particular operation, +then simplify the result before pushing it back on the stack. In the +common special case of regular arithmetic commands like @kbd{+} and +@kbd{Q} [@code{sqrt}], the arguments are simply popped from the stack +and collected into a suitable function call, which is then simplified +(the arguments being simplified first as part of the process, as +described above). -The default simplifications are too numerous to describe completely -here, but this section will describe the ones that apply to the +Even the limited set of simplifications are too numerous to describe +completely here, but this section will describe the ones that apply to the major arithmetic operators. This list will be rather technical in nature, and will probably be interesting to you only if you are a serious user of Calc's algebra facilities. @@ -22446,7 +22419,7 @@ \bigskip @end tex -And now, on with the default simplifications: +And now, on with the limited set of simplifications: Arithmetic operators like @kbd{+} and @kbd{*} always take two arguments in Calc's internal form. Sums and products of three or @@ -22720,29 +22693,29 @@ defined, aside of course from evaluation when the arguments are suitable numbers. -@node Algebraic Simplifications, Unsafe Simplifications, Default Simplifications, Simplifying Formulas +@node Algebraic Simplifications, Unsafe Simplifications, Limited Simplifications, Simplifying Formulas @subsection Algebraic Simplifications @noindent @cindex Algebraic simplifications -The @kbd{a s} command makes simplifications that may be too slow to -do all the time, or that may not be desirable all of the time. -If you find these simplifications are worthwhile, you can type -@kbd{m A} to have Calc apply them automatically. - +@kindex a s +@kindex I a s +@kindex H a s +@pindex calc-simplify +@tindex simplify This section describes all simplifications that are performed by -the @kbd{a s} command. Note that these occur in addition to the -default simplifications; even if the default simplifications have -been turned off by an @kbd{m O} command, @kbd{a s} will turn them -back on temporarily while it simplifies the formula. +the default algebraic simplification mode. If you have switched to a different +simplification mode, you can switch back with the @kbd{m D} command. +Even in other simplification modes, the @kbd{a s} command will use +these algebraic simplifications to simplifies the formula. There is a variable, @code{AlgSimpRules}, in which you can put rewrites -to be applied by @kbd{a s}. Its use is analogous to @code{EvalRules}, +to be applied. Its use is analogous to @code{EvalRules}, but without the special restrictions. Basically, the simplifier does @samp{@w{a r} AlgSimpRules} with an infinite repeat count on the whole expression being simplified, then it traverses the expression applying the built-in rules described below. If the result is different from -the original expression, the process repeats with the default +the original expression, the process repeats with the limited simplifications (including @code{EvalRules}), then @code{AlgSimpRules}, then the built-in simplifications, and so on. @@ -22767,11 +22740,11 @@ Products are sorted into a canonical order using the commutative law. For example, @expr{b c a} is commuted to @expr{a b c}. -This allows easier comparison of products; for example, the default +This allows easier comparison of products; for example, the limited simplifications will not change @expr{x y + y x} to @expr{2 x y}, -but @kbd{a s} will; it first rewrites the sum to @expr{x y + x y}, -and then the default simplifications are able to recognize a sum -of identical terms. +but the algebraic simplifications; it first rewrites the sum to +@expr{x y + x y} which can then be recognized as a sum of identical +terms. The canonical ordering used to sort terms of products has the property that real-valued numbers, interval forms and infinities @@ -22813,10 +22786,11 @@ factor in the numerator and denominator, it is canceled out; for example, @expr{(4 x + 6) / 8 x} simplifies to @expr{(2 x + 3) / 4 x}. -Non-constant common factors are not found even by @kbd{a s}. To -cancel the factor @expr{a} in @expr{(a x + a) / a^2} you could first -use @kbd{j M} on the product @expr{a x} to Merge the numerator to -@expr{a (1+x)}, which can then be simplified successfully. +Non-constant common factors are not found even by algebraic +simplifications. To cancel the factor @expr{a} in +@expr{(a x + a) / a^2} you could first use @kbd{j M} on the product +@expr{a x} to Merge the numerator to @expr{a (1+x)}, which can then be +simplified successfully. @tex \bigskip @@ -22825,11 +22799,10 @@ Integer powers of the variable @code{i} are simplified according to the identity @expr{i^2 = -1}. If you store a new value other than the complex number @expr{(0,1)} in @code{i}, this simplification -will no longer occur. This is done by @kbd{a s} instead of by default -in case someone (unwisely) uses the name @code{i} for a variable -unrelated to complex numbers; it would be unfortunate if Calc -quietly and automatically changed this formula for reasons the -user might not have been thinking of. +will no longer occur. This is not done by the limited +simplifications; in case someone (unwisely) wants to use the name +@code{i} for a variable unrelated to complex numbers, they can use +limited simplifications. Square roots of integer or rational arguments are simplified in several ways. (Note that these will be left unevaluated only in @@ -28800,7 +28773,7 @@ @item s D Edit @code{Decls}. @xref{Declarations}. @item s E -Edit @code{EvalRules}. @xref{Default Simplifications}. +Edit @code{EvalRules}. @xref{Limited Simplifications}. @item s F Edit @code{FitRules}. @xref{Curve Fitting}. @item s G ------------------------------------------------------------ revno: 109281 committer: Jay Belanger branch nick: trunk timestamp: Sun 2012-07-29 21:32:57 -0500 message: calc/calc-mode.el (calc-alg-simplify-mode): Remove function. (calc-limited-simplify-mode): Renamed from calc-lim-simplify-mode. calc/calc-ext.el (calc-init-extensions): Fix bindings for `calc-limited-simplify-mode'. diff: === modified file 'lisp/calc/calc-ext.el' --- lisp/calc/calc-ext.el 2012-07-29 23:19:09 +0000 +++ lisp/calc/calc-ext.el 2012-07-30 02:32:57 +0000 @@ -459,7 +459,7 @@ (define-key calc-mode-map "mD" 'calc-default-simplify-mode) (define-key calc-mode-map "mE" 'calc-ext-simplify-mode) (define-key calc-mode-map "mF" 'calc-settings-file-name) - (define-key calc-mode-map "mL" 'calc-lim-simplify-mode) + (define-key calc-mode-map "mL" 'calc-limited-simplify-mode) (define-key calc-mode-map "mM" 'calc-more-recursion-depth) (define-key calc-mode-map "mN" 'calc-num-simplify-mode) (define-key calc-mode-map "mO" 'calc-no-simplify-mode) @@ -1093,7 +1093,7 @@ calc-sin calc-sincos calc-sinh calc-sqrt calc-tan calc-tanh calc-to-degrees calc-to-radians) - ("calc-mode" calc-lim-simplify-mode calc-algebraic-mode + ("calc-mode" calc-limited-simplify-mode calc-algebraic-mode calc-always-load-extensions calc-auto-recompute calc-auto-why calc-bin-simplify-mode calc-break-vectors calc-center-justify calc-default-simplify-mode calc-display-raw calc-eng-notation === modified file 'lisp/calc/calc-mode.el' --- lisp/calc/calc-mode.el 2012-07-29 23:19:09 +0000 +++ lisp/calc/calc-mode.el 2012-07-30 02:32:57 +0000 @@ -542,7 +542,7 @@ (format "Binary simplification occurs by default (word size=%d)" calc-word-size)))) -(defun calc-lim-simplify-mode (arg) +(defun calc-limited-simplify-mode (arg) (interactive "P") (calc-wrapper (calc-set-simplify-mode nil arg ------------------------------------------------------------ revno: 109280 committer: Jay Belanger branch nick: trunk timestamp: Sun 2012-07-29 18:25:39 -0500 message: calc/calc-help (calc-m-prefix-help): Change message. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-29 23:19:09 +0000 +++ lisp/ChangeLog 2012-07-29 23:25:39 +0000 @@ -12,6 +12,9 @@ * calc/calc-ext.el (calc-init-extensions): Remove binding for `calc-alg-simplify-mode'. Add binding for `calc-lim-simplify-mode'. + * calc/calc-help (calc-m-prefix-help): Change messages to + indicate new simplification modes. + * calc/README: Mention new default simplification mode. * calc/calc.el (math-normalize-error): New variable. === modified file 'lisp/calc/calc-help.el' --- lisp/calc/calc-help.el 2012-01-19 07:21:25 +0000 +++ lisp/calc/calc-help.el 2012-07-29 23:25:39 +0000 @@ -642,7 +642,7 @@ '("Deg, Rad, HMS; Frac; Polar; Inf; Alg, Total; Symb; Vec/mat" "Working; Xtensions; Mode-save; preserve Embedded modes" "SHIFT + Shifted-prefixes, mode-Filename; Record; reCompute" - "SHIFT + simplify: Off, Num, Default, Bin, Alg, Ext, Units") + "SHIFT + simplify: Off, Num, Limited, Default, Bin, Ext, Units") "mode" ?m)) ------------------------------------------------------------ revno: 109279 committer: Jay Belanger branch nick: trunk timestamp: Sun 2012-07-29 18:19:09 -0500 message: calc/calc.el (calc-simplify-mode): Make 'alg the default value. (calc-set-mode-line): Don't display "AlgSimp ". calc/calc-mode.el (calc-alg-simplify-mode): Remove function. (calc-lim-simplify-mode): New function. (calc-set-simplify-mode): Default to 'alg. (calc-default-simplify-mode): Make algebraic simplifications the default. calc/calc-ext.el (calc-init-extensions): Remove binding for `calc-alg-simplify-mode'. Add binding for `calc-lim-simplify-mode'. calc/README: Mention new default simplification mode. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-29 18:51:16 +0000 +++ lisp/ChangeLog 2012-07-29 23:19:09 +0000 @@ -1,5 +1,19 @@ 2012-07-29 Jay Belanger + * calc/calc.el (calc-simplify-mode): Make 'alg the default value. + (calc-set-mode-line): Don't display "AlgSimp ". + + * calc/calc-mode.el (calc-alg-simplify-mode): Remove function. + (calc-lim-simplify-mode): New function. + (calc-set-simplify-mode): Default to 'alg. + (calc-default-simplify-mode): Make algebraic simplifications + the default. + + * calc/calc-ext.el (calc-init-extensions): Remove binding for + `calc-alg-simplify-mode'. Add binding for `calc-lim-simplify-mode'. + + * calc/README: Mention new default simplification mode. + * calc/calc.el (math-normalize-error): New variable. (math-normalize): Set `math-normalize-error' to t when there's an error. === modified file 'lisp/calc/README' --- lisp/calc/README 2012-01-19 07:21:25 +0000 +++ lisp/calc/README 2012-07-29 23:19:09 +0000 @@ -70,6 +70,12 @@ Summary of changes to "Calc" ------- -- ------- -- ---- +Emacs 24.2 + +Algebraic simplification mode is now the default. +To restrict to the limited simplifications given by the former +default simplification mode, use `m L'. + Emacs 24.1 * Support for musical notes added. === modified file 'lisp/calc/calc-ext.el' --- lisp/calc/calc-ext.el 2012-01-19 07:21:25 +0000 +++ lisp/calc/calc-ext.el 2012-07-29 23:19:09 +0000 @@ -454,12 +454,12 @@ (define-key calc-mode-map "mv" 'calc-matrix-mode) (define-key calc-mode-map "mw" 'calc-working) (define-key calc-mode-map "mx" 'calc-always-load-extensions) - (define-key calc-mode-map "mA" 'calc-alg-simplify-mode) (define-key calc-mode-map "mB" 'calc-bin-simplify-mode) (define-key calc-mode-map "mC" 'calc-auto-recompute) (define-key calc-mode-map "mD" 'calc-default-simplify-mode) (define-key calc-mode-map "mE" 'calc-ext-simplify-mode) (define-key calc-mode-map "mF" 'calc-settings-file-name) + (define-key calc-mode-map "mL" 'calc-lim-simplify-mode) (define-key calc-mode-map "mM" 'calc-more-recursion-depth) (define-key calc-mode-map "mN" 'calc-num-simplify-mode) (define-key calc-mode-map "mO" 'calc-no-simplify-mode) @@ -1093,7 +1093,7 @@ calc-sin calc-sincos calc-sinh calc-sqrt calc-tan calc-tanh calc-to-degrees calc-to-radians) - ("calc-mode" calc-alg-simplify-mode calc-algebraic-mode + ("calc-mode" calc-lim-simplify-mode calc-algebraic-mode calc-always-load-extensions calc-auto-recompute calc-auto-why calc-bin-simplify-mode calc-break-vectors calc-center-justify calc-default-simplify-mode calc-display-raw calc-eng-notation === modified file 'lisp/calc/calc-mode.el' --- lisp/calc/calc-mode.el 2012-01-19 07:21:25 +0000 +++ lisp/calc/calc-mode.el 2012-07-29 23:19:09 +0000 @@ -504,7 +504,7 @@ mode))) (message "%s" (if (eq calc-simplify-mode mode) msg - "Default simplifications enabled"))) + "Default algebraic simplifications enabled"))) (defun calc-no-simplify-mode (arg) (interactive "P") @@ -519,15 +519,18 @@ "Default simplifications apply only if arguments are numeric"))) (defun calc-default-simplify-mode (arg) - (interactive "p") - (cond ((= arg 1) + (interactive "P") + (cond ((or (not arg) (= arg 3)) + (calc-wrapper + (calc-set-simplify-mode + 'alg nil "Default algebraic simplifications enabled"))) + ((= arg 1) (calc-wrapper (calc-set-simplify-mode - nil nil "Usual default simplifications are enabled"))) + nil nil "Limited simplifications occur by default"))) ((= arg 0) (calc-num-simplify-mode 1)) ((< arg 0) (calc-no-simplify-mode 1)) ((= arg 2) (calc-bin-simplify-mode 1)) - ((= arg 3) (calc-alg-simplify-mode 1)) ((= arg 4) (calc-ext-simplify-mode 1)) ((= arg 5) (calc-units-simplify-mode 1)) (t (error "Prefix argument out of range")))) @@ -539,11 +542,11 @@ (format "Binary simplification occurs by default (word size=%d)" calc-word-size)))) -(defun calc-alg-simplify-mode (arg) +(defun calc-lim-simplify-mode (arg) (interactive "P") (calc-wrapper - (calc-set-simplify-mode 'alg arg - "Algebraic simplification occurs by default"))) + (calc-set-simplify-mode nil arg + "Limited simplifications occur by default"))) (defun calc-ext-simplify-mode (arg) (interactive "P") === modified file 'lisp/calc/calc.el' --- lisp/calc/calc.el 2012-07-29 18:51:16 +0000 +++ lisp/calc/calc.el 2012-07-29 23:19:09 +0000 @@ -698,11 +698,11 @@ (defcalcmodevar calc-previous-modulo nil "Most recently used value of M in a modulo form.") -(defcalcmodevar calc-simplify-mode nil +(defcalcmodevar calc-simplify-mode 'alg "Type of simplification applied to results. If `none', results are not simplified when pushed on the stack. If `num', functions are simplified only when args are constant. -If nil, only fast simplifications are applied. +If nil, only limited simplifications are applied. If `binary', `math-clip' is applied if appropriate. If `alg', `math-simplify' is applied. If `ext', `math-simplify-extended' is applied. @@ -1757,10 +1757,10 @@ ((eq calc-simplify-mode 'num) "NumSimp ") ((eq calc-simplify-mode 'binary) (format "BinSimp%d " calc-word-size)) - ((eq calc-simplify-mode 'alg) "AlgSimp ") + ((eq calc-simplify-mode 'alg) "") ((eq calc-simplify-mode 'ext) "ExtSimp ") ((eq calc-simplify-mode 'units) "UnitSimp ") - (t "")) + (t "LimSimp ")) ;; Display modes (cond ((= calc-number-radix 10) "") ------------------------------------------------------------ revno: 109278 committer: Paul Eggert branch nick: trunk timestamp: Sun 2012-07-29 15:42:12 -0700 message: * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove. These macros are confusing and no longer need to be defined, as the enum values now suffice. Each use replaced with definiens. (Lisp_Int1, Lisp_String): Define directly; this is clearer. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-29 17:20:16 +0000 +++ src/ChangeLog 2012-07-29 22:42:12 +0000 @@ -1,3 +1,10 @@ +2012-07-29 Paul Eggert + + * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove. + These macros are confusing and no longer need to be defined, as + the enum values now suffice. All uses replaced with definiens. + (Lisp_Int1, Lisp_String): Define directly; this is clearer. + 2012-07-29 Juanma Barranquero * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O)) === modified file 'src/buffer.c' --- src/buffer.c 2012-07-28 23:05:32 +0000 +++ src/buffer.c 2012-07-29 22:42:12 +0000 @@ -5457,17 +5457,17 @@ doc: /* Non-nil if searches and matches should ignore case. */); DEFVAR_PER_BUFFER ("fill-column", &BVAR (current_buffer, fill_column), - make_number (LISP_INT_TAG), + make_number (Lisp_Int0), doc: /* Column beyond which automatic line-wrapping should happen. Interactively, you can set the buffer local value using \\[set-fill-column]. */); DEFVAR_PER_BUFFER ("left-margin", &BVAR (current_buffer, left_margin), - make_number (LISP_INT_TAG), + make_number (Lisp_Int0), doc: /* Column for the default `indent-line-function' to indent to. Linefeed indents to this column in Fundamental mode. */); DEFVAR_PER_BUFFER ("tab-width", &BVAR (current_buffer, tab_width), - make_number (LISP_INT_TAG), + make_number (Lisp_Int0), doc: /* Distance between tab stops (for display of tab characters), in columns. This should be an integer greater than zero. */); @@ -5588,7 +5588,7 @@ Backing up is done before the first time the file is saved. */); DEFVAR_PER_BUFFER ("buffer-saved-size", &BVAR (current_buffer, save_length), - make_number (LISP_INT_TAG), + make_number (Lisp_Int0), doc: /* Length of current buffer when last read in, saved or auto-saved. 0 initially. -1 means auto-saving turned off until next real save. === modified file 'src/data.c' --- src/data.c 2012-07-26 01:27:33 +0000 +++ src/data.c 2012-07-29 22:42:12 +0000 @@ -928,7 +928,7 @@ Lisp_Object type = XBUFFER_OBJFWD (valcontents)->slottype; if (!(NILP (type) || NILP (newval) - || (XINT (type) == LISP_INT_TAG + || (XINT (type) == Lisp_Int0 ? INTEGERP (newval) : XTYPE (newval) == XINT (type)))) buffer_slot_type_mismatch (newval, XINT (type)); === modified file 'src/lisp.h' --- src/lisp.h 2012-07-29 17:14:51 +0000 +++ src/lisp.h 2012-07-29 22:42:12 +0000 @@ -213,11 +213,8 @@ /* Lisp integers use 2 tags, to give them one extra bit, thus extending their range from, e.g., -2^28..2^28-1 to -2^29..2^29-1. */ #define INTMASK (EMACS_INT_MAX >> (INTTYPEBITS - 1)) -#define LISP_INT_TAG Lisp_Int0 #define case_Lisp_Int case Lisp_Int0: case Lisp_Int1 -#define LISP_INT1_TAG (USE_LSB_TAG ? 1 << INTTYPEBITS : 1) -#define LISP_STRING_TAG (5 - LISP_INT1_TAG) -#define LISP_INT_TAG_P(x) (((x) & ~LISP_INT1_TAG) == 0) +#define LISP_INT_TAG_P(x) (((x) & ~Lisp_Int1) == 0) /* Stolen from GDB. The only known compiler that doesn't support enums in bitfields is MSVC. */ @@ -232,7 +229,7 @@ { /* Integer. XINT (obj) is the integer value. */ Lisp_Int0 = 0, - Lisp_Int1 = LISP_INT1_TAG, + Lisp_Int1 = USE_LSB_TAG ? 1 << INTTYPEBITS : 1, /* Symbol. XSYMBOL (object) points to a struct Lisp_Symbol. */ Lisp_Symbol = 2, @@ -243,7 +240,7 @@ /* String. XSTRING (object) points to a struct Lisp_String. The length of the string, and its contents, are stored therein. */ - Lisp_String = LISP_STRING_TAG, + Lisp_String = USE_LSB_TAG ? 1 : 1 << INTTYPEBITS, /* Vector of Lisp objects, or something resembling it. XVECTOR (object) points to a struct Lisp_Vector, which contains ------------------------------------------------------------ revno: 109277 author: Ted Zlatanov committer: Katsumi Yamaoka branch nick: trunk timestamp: Sun 2012-07-29 22:17:54 +0000 message: lisp/gnus/auth-source.el: Fix last change diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2012-07-29 22:07:41 +0000 +++ lisp/gnus/ChangeLog 2012-07-29 22:17:54 +0000 @@ -8,6 +8,7 @@ auth-source.el through the /usr/bin/security utility. (auth-sources): Fix syntax error. (auth-source-macos-keychain-result-append): Fix variable name. + (auth-sources, auth-source-macos-keychain-result-append): More fixes. 2012-07-27 Julien Danjou === modified file 'lisp/gnus/auth-source.el' --- lisp/gnus/auth-source.el 2012-07-29 22:07:41 +0000 +++ lisp/gnus/auth-source.el 2012-07-29 22:17:54 +0000 @@ -280,7 +280,7 @@ :value :macos-keychain-internet) (choice :tag "Collection to use" (string :tag "internet Keychain path") - (const :tag "default" 'default)))) + (const :tag "default" 'default))) (list :tag "Mac OS generic Keychain" (const :format "" @@ -1757,7 +1757,7 @@ (and (plist-get ret :secret) (list ret)))) (defun auth-source-macos-keychain-result-append (result generic k v) - (push v ret) + (push v result) (setq k (cond ((equal k "acct") "user") ;; for generic keychains, creator is host, service is port @@ -1768,7 +1768,7 @@ ((and (not generic) (equal k "srvr")) "host") (t k))) - (push (intern (format ":%s" k)) ret)) + (push (intern (format ":%s" k)) result)) (defun* auth-source-macos-keychain-create (&rest spec ------------------------------------------------------------ revno: 109276 author: Ted Zlatanov committer: Katsumi Yamaoka branch nick: trunk timestamp: Sun 2012-07-29 22:07:41 +0000 message: lisp/gnus/auth-source.el: Support Mac OS X Keychains diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2012-07-28 11:38:47 +0000 +++ lisp/gnus/ChangeLog 2012-07-29 22:07:41 +0000 @@ -1,3 +1,14 @@ +2012-07-29 Teodor Zlatanov + + * auth-source.el (auth-sources, auth-source-backend-parse) + (auth-source-macos-keychain-search) + (auth-source-macos-keychain-search-items) + (auth-source-macos-keychain-result-append) + (auth-source-macos-keychain-create): Support Mac OS X Keychains in + auth-source.el through the /usr/bin/security utility. + (auth-sources): Fix syntax error. + (auth-source-macos-keychain-result-append): Fix variable name. + 2012-07-27 Julien Danjou * message.el (fboundp): Add a defalias on `mail-dont-reply-to' for === modified file 'lisp/gnus/auth-source.el' --- lisp/gnus/auth-source.el 2012-06-01 20:12:11 +0000 +++ lisp/gnus/auth-source.el 2012-07-29 22:07:41 +0000 @@ -254,6 +254,13 @@ (const :tag "Default Secrets API Collection" 'default) (const :tag "Login Secrets API Collection" "secrets:Login") (const :tag "Temp Secrets API Collection" "secrets:session") + + (const :tag "Default internet Mac OS Keychain" + 'macos-keychain-internet) + + (const :tag "Default generic Mac OS Keychain" + 'macos-keychain-generic) + (list :tag "Source definition" (const :format "" :value :source) (choice :tag "Authentication backend choice" @@ -266,7 +273,21 @@ (const :tag "Default" 'default) (const :tag "Login" "Login") (const - :tag "Temporary" "session")))) + :tag "Temporary" "session"))) + (list + :tag "Mac OS internet Keychain" + (const :format "" + :value :macos-keychain-internet) + (choice :tag "Collection to use" + (string :tag "internet Keychain path") + (const :tag "default" 'default)))) + (list + :tag "Mac OS generic Keychain" + (const :format "" + :value :macos-keychain-generic) + (choice :tag "Collection to use" + (string :tag "generic Keychain path") + (const :tag "default" 'default)))) (repeat :tag "Extra Parameters" :inline t (choice :tag "Extra parameter" (list @@ -377,6 +398,10 @@ ;; (auth-source-backend-parse "myfile.gpg") ;; (auth-source-backend-parse 'default) ;; (auth-source-backend-parse "secrets:Login") +;; (auth-source-backend-parse 'macos-keychain-internet) +;; (auth-source-backend-parse 'macos-keychain-generic) +;; (auth-source-backend-parse "macos-keychain-internet:/path/here.keychain") +;; (auth-source-backend-parse "macos-keychain-generic:/path/here.keychain") (defun auth-source-backend-parse (entry) "Creates an auth-source-backend from an ENTRY in `auth-sources'." @@ -391,6 +416,28 @@ ;; matching any user, host, and protocol ((and (stringp entry) (string-match "^secrets:\\(.+\\)" entry)) (auth-source-backend-parse `(:source (:secrets ,(match-string 1 entry))))) + + ;; take 'macos-keychain-internet and recurse to get it as a Mac OS + ;; Keychain collection matching any user, host, and protocol + ((eq entry 'macos-keychain-internet) + (auth-source-backend-parse '(:source (:macos-keychain-internet default)))) + ;; take 'macos-keychain-generic and recurse to get it as a Mac OS + ;; Keychain collection matching any user, host, and protocol + ((eq entry 'macos-keychain-generic) + (auth-source-backend-parse '(:source (:macos-keychain-generic default)))) + ;; take macos-keychain-internet:XYZ and recurse to get it as MacOS + ;; Keychain "XYZ" matching any user, host, and protocol + ((and (stringp entry) (string-match "^macos-keychain-internet:\\(.+\\)" + entry)) + (auth-source-backend-parse `(:source (:macos-keychain-internet + ,(match-string 1 entry))))) + ;; take macos-keychain-generic:XYZ and recurse to get it as MacOS + ;; Keychain "XYZ" matching any user, host, and protocol + ((and (stringp entry) (string-match "^macos-keychain-generic:\\(.+\\)" + entry)) + (auth-source-backend-parse `(:source (:macos-keychain-generic + ,(match-string 1 entry))))) + ;; take just a file name and recurse to get it as a netrc file ;; matching any user, host, and protocol ((stringp entry) @@ -413,6 +460,33 @@ :search-function 'auth-source-netrc-search :create-function 'auth-source-netrc-create))) + ;; the MacOS Keychain + ((and + (not (null (plist-get entry :source))) ; the source must not be nil + (listp (plist-get entry :source)) ; and it must be a list + (or + (plist-get (plist-get entry :source) :macos-keychain-generic) + (plist-get (plist-get entry :source) :macos-keychain-internet))) + + (let* ((source-spec (plist-get entry :source)) + (keychain-generic (plist-get source-spec :macos-keychain-generic)) + (keychain-type (if keychain-generic + 'macos-keychain-generic + 'macos-keychain-internet)) + (source (plist-get source-spec (if keychain-generic + :macos-keychain-generic + :macos-keychain-internet)))) + + (when (symbolp source) + (setq source (symbol-name source))) + + (auth-source-backend + (format "Mac OS Keychain (%s)" source) + :source source + :type keychain-type + :search-function 'auth-source-macos-keychain-search + :create-function 'auth-source-macos-keychain-create))) + ;; the Secrets API. We require the package, in order to have a ;; defined value for `secrets-enabled'. ((and @@ -694,6 +768,7 @@ (let* ((bmatches (apply (slot-value backend 'search-function) :backend backend + :type (slot-value backend :type) ;; note we're overriding whatever the spec ;; has for :require, :create, and :delete :require require @@ -1515,6 +1590,193 @@ ;; (apply 'secrets-create-item (auth-get-source entry) name passwd spec) (debug spec)) +;;; Backend specific parsing: Mac OS Keychain (using /usr/bin/security) backend + +;; (let ((auth-sources '(macos-keychain-internet))) (auth-source-search :max 1 :create t)) +;; (let ((auth-sources '(macos-keychain-internet))) (auth-source-search :max 1 :delete t)) +;; (let ((auth-sources '(macos-keychain-internet))) (auth-source-search :max 1)) +;; (let ((auth-sources '(macos-keychain-internet))) (auth-source-search)) + +;; (let ((auth-sources '(macos-keychain-generic))) (auth-source-search :max 1 :create t)) +;; (let ((auth-sources '(macos-keychain-generic))) (auth-source-search :max 1 :delete t)) +;; (let ((auth-sources '(macos-keychain-generic))) (auth-source-search :max 1)) +;; (let ((auth-sources '(macos-keychain-generic))) (auth-source-search)) + +;; (let ((auth-sources '("macos-keychain-internet:/Users/tzz/Library/Keychains/login.keychain"))) (auth-source-search :max 1)) +;; (let ((auth-sources '("macos-keychain-generic:Login"))) (auth-source-search :max 1 :host "git.gnus.org")) + +(defun* auth-source-macos-keychain-search (&rest + spec + &key backend create delete label + type max host user port + &allow-other-keys) + "Search the MacOS Keychain; spec is like `auth-source'. + +All search keys must match exactly. If you need substring +matching, do a wider search and narrow it down yourself. + +You'll get back all the properties of the token as a plist. + +The :type key is either 'macos-keychain-internet or +'macos-keychain-generic. + +For the internet keychain type, the :label key searches the +item's labels (\"-l LABEL\" passed to \"/usr/bin/security\"). +Similarly, :host maps to \"-s HOST\", :user maps to \"-a USER\", +and :port maps to \"-P PORT\" or \"-r PROT\" +(note PROT has to be a 4-character string). + +For the generic keychain type, the :label key searches the item's +labels (\"-l LABEL\" passed to \"/usr/bin/security\"). +Similarly, :host maps to \"-c HOST\" (the \"creator\" keychain +field), :user maps to \"-a USER\", and :port maps to \"-s PORT\". + +Here's an example that looks for the first item in the default +generic MacOS Keychain: + + \(let ((auth-sources '(macos-keychain-generic))) + (auth-source-search :max 1) + +Here's another that looks for the first item in the internet +MacOS Keychain collection whose label is 'gnus': + + \(let ((auth-sources '(macos-keychain-internet))) + (auth-source-search :max 1 :label \"gnus\") + +And this one looks for the first item in the internet keychain +entries for git.gnus.org: + + \(let ((auth-sources '(macos-keychain-internet\"))) + (auth-source-search :max 1 :host \"git.gnus.org\")) +" + ;; TODO + (assert (not create) nil + "The MacOS Keychain auth-source backend doesn't support creation yet") + ;; TODO + ;; (macos-keychain-delete-item coll elt) + (assert (not delete) nil + "The MacOS Keychain auth-source backend doesn't support deletion yet") + + (let* ((coll (oref backend source)) + (max (or max 5000)) ; sanity check: default to stop at 5K + (ignored-keys '(:create :delete :max :backend :label)) + (search-keys (loop for i below (length spec) by 2 + unless (memq (nth i spec) ignored-keys) + collect (nth i spec))) + ;; build a search spec without the ignored keys + ;; if a search key is nil or t (match anything), we skip it + (search-spec (apply 'append (mapcar + (lambda (k) + (if (or (null (plist-get spec k)) + (eq t (plist-get spec k))) + nil + (list k (plist-get spec k)))) + search-keys))) + ;; needed keys (always including host, login, port, and secret) + (returned-keys (mm-delete-duplicates (append + '(:host :login :port :secret) + search-keys))) + (items (apply 'auth-source-macos-keychain-search-items + coll + type + max + search-spec)) + + ;; ensure each item has each key in `returned-keys' + (items (mapcar (lambda (plist) + (append + (apply 'append + (mapcar (lambda (req) + (if (plist-get plist req) + nil + (list req nil))) + returned-keys)) + plist)) + items))) + items)) + +(defun* auth-source-macos-keychain-search-items (coll type max + &rest spec + &key label type + host user port + &allow-other-keys) + + (let* ((keychain-generic (eq type 'macos-keychain-generic)) + (args `(,(if keychain-generic + "find-generic-password" + "find-internet-password") + "-g")) + (ret (list :type type))) + (when label + (setq args (append args (list "-l" label)))) + (when host + (setq args (append args (list (if keychain-generic "-c" "-s") host)))) + (when user + (setq args (append args (list "-a" user)))) + + (when port + (if keychain-generic + (setq args (append args (list "-s" port))) + (setq args (append args (list + (if (string-match "[0-9]+" port) "-P" "-r") + port))))) + + (unless (equal coll "default") + (setq args (append args (list coll)))) + + (with-temp-buffer + (apply 'call-process "/usr/bin/security" nil t nil args) + (goto-char (point-min)) + (while (not (eobp)) + (cond + ((looking-at "^password: \"\\(.+\\)\"$") + (auth-source-macos-keychain-result-append + ret + keychain-generic + "secret" + (lexical-let ((v (match-string 1))) + (lambda () v)))) + ;; TODO: check if this is really the label + ;; match 0x00000007 ="AppleID" + ((looking-at "^[ ]+0x00000007 =\"\\(.+\\)\"") + (auth-source-macos-keychain-result-append + ret + keychain-generic + "label" + (match-string 1))) + ;; match "crtr"="aapl" + ;; match "svce"="AppleID" + ((looking-at "^[ ]+\"\\([a-z]+\\)\"[^=]+=\"\\(.+\\)\"") + (auth-source-macos-keychain-result-append + ret + keychain-generic + (match-string 1) + (match-string 2)))) + (forward-line))) + ;; return `ret' iff it has the :secret key + (and (plist-get ret :secret) (list ret)))) + +(defun auth-source-macos-keychain-result-append (result generic k v) + (push v ret) + (setq k (cond + ((equal k "acct") "user") + ;; for generic keychains, creator is host, service is port + ((and generic (equal k "crtr")) "host") + ((and generic (equal k "svce")) "port") + ;; for internet keychains, protocol is port, server is host + ((and (not generic) (equal k "ptcl")) "port") + ((and (not generic) (equal k "srvr")) "host") + (t k))) + + (push (intern (format ":%s" k)) ret)) + +(defun* auth-source-macos-keychain-create (&rest + spec + &key backend type max host user port + &allow-other-keys) + ;; TODO + (debug spec)) + ;;; Backend specific parsing: PLSTORE backend (defun* auth-source-plstore-search (&rest ------------------------------------------------------------ revno: 109275 committer: David Engster branch nick: trunk timestamp: Sun 2012-07-29 21:57:28 +0200 message: New tests for XML name expansion. * automated/xml-parse-tests.el (xml-parse-tests--qnames): New variable to hold test data for name expansion. (xml-parse-tests): Test the two different types of name expansion. diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2012-07-29 00:12:13 +0000 +++ test/ChangeLog 2012-07-29 19:57:28 +0000 @@ -1,3 +1,9 @@ +2012-07-29 David Engster + + * automated/xml-parse-tests.el (xml-parse-tests--qnames): New + variable to hold test data for name expansion. + (xml-parse-tests): Test the two different types of name expansion. + 2012-07-29 Juri Linkov * automated/occur-tests.el (occur-test-case): Use predefined === modified file 'test/automated/xml-parse-tests.el' --- test/automated/xml-parse-tests.el 2012-07-04 16:14:05 +0000 +++ test/automated/xml-parse-tests.el 2012-07-29 19:57:28 +0000 @@ -74,6 +74,25 @@ "abc") "List of XML strings that should signal an error in the parser") +(defvar xml-parse-tests--qnames + '( ;; Test data for name expansion + ("/calendar/events/HTTP/1.1 200 OK" + ;; Result with qnames as cons + ((("DAV:" . "multistatus") + ((("http://www.w3.org/2000/xmlns/" . "D") . "DAV:")) + (("DAV:" . "response") nil (("DAV:" . "href") nil "/calendar/events/") + (("DAV:" . "propstat") nil (("DAV:" . "status") nil "HTTP/1.1 200 OK"))))) + ;; Result with qnames as symbols + ((DAV:multistatus + ((("http://www.w3.org/2000/xmlns/" . "D") . "DAV:")) + (DAV:response nil (DAV:href nil "/calendar/events/") + (DAV:propstat nil (DAV:status nil "HTTP/1.1 200 OK")))))) + ("hi there" + ((("FOOBAR:" . "something") nil "hi there")) + ((FOOBAR:something nil "hi there")))) + "List of strings which are parsed using namespace expansion. +Parser is called with and without 'symbol-qnames argument.") + (ert-deftest xml-parse-tests () "Test XML parsing." (with-temp-buffer @@ -85,7 +104,29 @@ (dolist (test xml-parse-tests--bad-data) (erase-buffer) (insert test) - (should-error (xml-parse-region)))))) + (should-error (xml-parse-region)))) + (let ((testdata (car xml-parse-tests--qnames))) + (erase-buffer) + (insert (car testdata)) + (should (equal (nth 1 testdata) + (xml-parse-region nil nil nil nil t))) + (should (equal (nth 2 testdata) + (xml-parse-region nil nil nil nil 'symbol-qnames)))) + (let ((testdata (nth 1 xml-parse-tests--qnames))) + (erase-buffer) + (insert (car testdata)) + ;; Provide additional namespace-URI mapping + (should (equal (nth 1 testdata) + (xml-parse-region + nil nil nil nil + (append xml-default-ns + '(("F" . "FOOBAR:")))))) + (should (equal (nth 2 testdata) + (xml-parse-region + nil nil nil nil + (cons 'symbol-qnames + (append xml-default-ns + '(("F" . "FOOBAR:")))))))))) ;; Local Variables: ;; no-byte-compile: t ------------------------------------------------------------ revno: 109274 committer: Jay Belanger branch nick: trunk timestamp: Sun 2012-07-29 13:51:16 -0500 message: calc/calc.el (math-normalize-error): New variable. (math-normalize): Set `math-normalize-error' to t when there's an error. calc/calc-alg.el (math-simplify): Don't simplify when `math-normalize' returns an error. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-29 18:27:35 +0000 +++ lisp/ChangeLog 2012-07-29 18:51:16 +0000 @@ -1,3 +1,12 @@ +2012-07-29 Jay Belanger + + * calc/calc.el (math-normalize-error): New variable. + (math-normalize): Set `math-normalize-error' to t + when there's an error. + + * calc/calc-alg.el (math-simplify): Don't simplify when + `math-normalize' returns an error. + 2012-07-29 Eli Zaretskii * international/mule-cmds.el (set-locale-environment): Revert last === modified file 'lisp/calc/calc-alg.el' --- lisp/calc/calc-alg.el 2012-07-25 02:38:36 +0000 +++ lisp/calc/calc-alg.el 2012-07-29 18:51:16 +0000 @@ -356,6 +356,8 @@ ;; math-simplify-step, which is called by math-simplify. (defvar math-top-only) +;; math-normalize-error is declared in calc.el. +(defvar math-normalize-error) (defun math-simplify (top-expr) (let ((math-simplifying t) (math-top-only (consp calc-simplify-mode)) @@ -383,10 +385,12 @@ (calc-with-default-simplification (while (let ((r simp-rules)) (setq res (math-normalize top-expr)) - (while r - (setq res (math-rewrite res (car r)) - r (cdr r))) - (not (equal top-expr (setq res (math-simplify-step res))))) + (if (not math-normalize-error) + (progn + (while r + (setq res (math-rewrite res (car r)) + r (cdr r))) + (not (equal top-expr (setq res (math-simplify-step res))))))) (setq top-expr res))))) top-expr) === modified file 'lisp/calc/calc.el' --- lisp/calc/calc.el 2012-07-26 01:27:33 +0000 +++ lisp/calc/calc.el 2012-07-29 18:51:16 +0000 @@ -2583,7 +2583,11 @@ ;;; Reduce an object to canonical (normalized) form. [O o; Z Z] [Public] (defvar math-normalize-a) +(defvar math-normalize-error nil + "Non-nil if the last call the `math-normalize' returned an error.") + (defun math-normalize (math-normalize-a) + (setq math-normalize-error nil) (cond ((not (consp math-normalize-a)) (if (integerp math-normalize-a) @@ -2672,31 +2676,38 @@ (fboundp (car math-normalize-a)))) (apply (car math-normalize-a) args))))) (wrong-number-of-arguments + (setq math-normalize-error t) (calc-record-why "*Wrong number of arguments" (cons (car math-normalize-a) args)) nil) (wrong-type-argument + (setq math-normalize-error t) (or calc-next-why (calc-record-why "Wrong type of argument" (cons (car math-normalize-a) args))) nil) (args-out-of-range + (setq math-normalize-error t) (calc-record-why "*Argument out of range" (cons (car math-normalize-a) args)) nil) (inexact-result + (setq math-normalize-error t) (calc-record-why "No exact representation for result" (cons (car math-normalize-a) args)) nil) (math-overflow + (setq math-normalize-error t) (calc-record-why "*Floating-point overflow occurred" (cons (car math-normalize-a) args)) nil) (math-underflow + (setq math-normalize-error t) (calc-record-why "*Floating-point underflow occurred" (cons (car math-normalize-a) args)) nil) (void-variable + (setq math-normalize-error t) (if (eq (nth 1 err) 'var-EvalRules) (progn (setq var-EvalRules nil) ------------------------------------------------------------ revno: 109273 committer: Eli Zaretskii branch nick: trunk timestamp: Sun 2012-07-29 21:33:47 +0300 message: Remove obsolete comment in mule-cmds.el. diff: === modified file 'lisp/international/mule-cmds.el' --- lisp/international/mule-cmds.el 2012-07-29 18:27:35 +0000 +++ lisp/international/mule-cmds.el 2012-07-29 18:33:47 +0000 @@ -2673,15 +2673,6 @@ (unless frame (setq locale-coding-system code-page-coding)) (set-keyboard-coding-system code-page-coding frame) (set-terminal-coding-system code-page-coding frame) - ;; Set default-file-name-coding-system last, so that Emacs - ;; doesn't try to use cpNNNN when it defines keyboard and - ;; terminal encoding. That's because the above two lines - ;; will want to load code-pages.el, where cpNNNN are - ;; defined; if default-file-name-coding-system were set to - ;; cpNNNN while these two lines run, Emacs will want to use - ;; it for encoding the file name it wants to load. And that - ;; will fail, since cpNNNN is not yet usable until - ;; code-pages.el finishes loading. (setq default-file-name-coding-system code-page-coding)))) (when (eq system-type 'darwin) ------------------------------------------------------------ revno: 109272 fixes bug(s): http://debbugs.gnu.org/12082 committer: Eli Zaretskii branch nick: trunk timestamp: Sun 2012-07-29 21:27:35 +0300 message: Fix bug #12082 with non-ASCII output in Windows GUI sessions. lisp/international/mule-cmds.el (set-locale-environment): Revert last change, since display-graphic-p returns nil when this function is called during startup. Instead... lisp/term/w32console.el (terminal-init-w32console): ...setup the keyboard and terminal encoding for TTY sessions here. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-29 18:11:42 +0000 +++ lisp/ChangeLog 2012-07-29 18:27:35 +0000 @@ -1,3 +1,12 @@ +2012-07-29 Eli Zaretskii + + * international/mule-cmds.el (set-locale-environment): Revert last + change, since display-graphic-p returns nil when this function is + called during startup. Instead... + + * term/w32console.el (terminal-init-w32console): ...setup the + keyboard and terminal encoding for TTY sessions here. (Bug#12082) + 2012-07-29 Juri Linkov * simple.el (goto-line): Don't display default line number in the === modified file 'lisp/international/mule-cmds.el' --- lisp/international/mule-cmds.el 2012-07-29 16:29:23 +0000 +++ lisp/international/mule-cmds.el 2012-07-29 18:27:35 +0000 @@ -2666,32 +2666,23 @@ ;; On Windows, override locale-coding-system, ;; default-file-name-coding-system, keyboard-coding-system, - ;; terminal-coding-system with the appropriate codepages. + ;; terminal-coding-system with system codepage. (when (boundp 'w32-ansi-code-page) - (let ((ansi-code-page-coding (intern (format "cp%d" w32-ansi-code-page))) - (oem-code-page-coding - (intern (format "cp%d" (w32-get-console-codepage)))) - (oem-code-page-output-coding - (intern (format "cp%d" (w32-get-console-output-codepage)))) - ansi-cs-p oem-cs-p oem-o-cs-p) - (setq ansi-cs-p (coding-system-p ansi-code-page-coding)) - (setq oem-cs-p (coding-system-p oem-code-page-coding)) - (setq oem-o-cs-p (coding-system-p oem-code-page-output-coding)) - ;; Set the keyboard and display encoding to either the current - ;; ANSI codepage of the OEM codepage, depending on whether - ;; this is a GUI or a TTY frame. - (when ansi-cs-p - (unless frame (setq locale-coding-system ansi-code-page-coding)) - (when (display-graphic-p frame) - (set-keyboard-coding-system ansi-code-page-coding frame) - (set-terminal-coding-system ansi-code-page-coding frame)) - (setq default-file-name-coding-system ansi-code-page-coding)) - (when oem-cs-p - (unless (display-graphic-p frame) - (set-keyboard-coding-system oem-code-page-coding frame) - (set-terminal-coding-system - (if oem-o-cs-p oem-code-page-output-coding oem-code-page-coding) - frame))))) + (let ((code-page-coding (intern (format "cp%d" w32-ansi-code-page)))) + (when (coding-system-p code-page-coding) + (unless frame (setq locale-coding-system code-page-coding)) + (set-keyboard-coding-system code-page-coding frame) + (set-terminal-coding-system code-page-coding frame) + ;; Set default-file-name-coding-system last, so that Emacs + ;; doesn't try to use cpNNNN when it defines keyboard and + ;; terminal encoding. That's because the above two lines + ;; will want to load code-pages.el, where cpNNNN are + ;; defined; if default-file-name-coding-system were set to + ;; cpNNNN while these two lines run, Emacs will want to use + ;; it for encoding the file name it wants to load. And that + ;; will fail, since cpNNNN is not yet usable until + ;; code-pages.el finishes loading. + (setq default-file-name-coding-system code-page-coding)))) (when (eq system-type 'darwin) ;; On Darwin, file names are always encoded in utf-8, no matter === modified file 'lisp/term/w32console.el' --- lisp/term/w32console.el 2012-01-19 07:21:25 +0000 +++ lisp/term/w32console.el 2012-07-29 18:27:35 +0000 @@ -52,6 +52,18 @@ "Terminal initialization function for w32 console." ;; Share function key initialization with w32 gui frames (x-setup-function-keys (selected-frame)) + ;; Set terminal and keyboard encodings to the current OEM codepage. + (let ((oem-code-page-coding + (intern (format "cp%d" (w32-get-console-codepage)))) + (oem-code-page-output-coding + (intern (format "cp%d" (w32-get-console-output-codepage)))) + oem-cs-p oem-o-cs-p) + (setq oem-cs-p (coding-system-p oem-code-page-coding)) + (setq oem-o-cs-p (coding-system-p oem-code-page-output-coding)) + (when oem-cs-p + (set-keyboard-coding-system oem-code-page-coding) + (set-terminal-coding-system + (if oem-o-cs-p oem-code-page-output-coding oem-code-page-coding)))) (let* ((colors w32-tty-standard-colors) (color (car colors))) (tty-color-clear) ------------------------------------------------------------ revno: 109271 fixes bug(s): http://debbugs.gnu.org/9952 committer: Juri Linkov branch nick: trunk timestamp: Sun 2012-07-29 21:11:42 +0300 message: * lisp/simple.el (goto-line): Don't display default line number in the prompt because it should be displayed by `read-number' (bug#9952). Add the current line number to the defaults of `goto-line' to allow its easier modification by users with `M-n' (bug#9201). * lisp/subr.el (read-number): Support multiple default values like in other minibuffer reading functions. Replace `read' with `string-to-number' for consistency with `number-to-string'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-29 16:29:23 +0000 +++ lisp/ChangeLog 2012-07-29 18:11:42 +0000 @@ -1,3 +1,14 @@ +2012-07-29 Juri Linkov + + * simple.el (goto-line): Don't display default line number in the + prompt because it should be displayed by `read-number' (bug#9952). + Add the current line number to the defaults of `goto-line' to + allow its easier modification by users with `M-n' (bug#9201). + + * subr.el (read-number): Support multiple default values like in + other minibuffer reading functions. Replace `read' with + `string-to-number' for consistency with `number-to-string'. + 2012-07-29 Paul Eggert deactive->inactive, inactivate->deactivate spelling fixes (Bug#10150) === modified file 'lisp/simple.el' --- lisp/simple.el 2012-07-29 04:45:48 +0000 +++ lisp/simple.el 2012-07-29 18:11:42 +0000 @@ -948,11 +948,8 @@ (concat " in " (buffer-name buffer)) ""))) ;; Read the argument, offering that number (if any) as default. - (list (read-number (format (if default "Goto line%s (%s): " - "Goto line%s: ") - buffer-prompt - default) - default) + (list (read-number (format "Goto line%s: " buffer-prompt) + (list default (line-number-at-pos))) buffer)))) ;; Switch to the desired buffer, one way or another. (if buffer === modified file 'lisp/subr.el' --- lisp/subr.el 2012-07-26 01:27:33 +0000 +++ lisp/subr.el 2012-07-29 18:11:42 +0000 @@ -2188,23 +2188,27 @@ "Read a numeric value in the minibuffer, prompting with PROMPT. DEFAULT specifies a default value to return if the user just types RET. The value of DEFAULT is inserted into PROMPT." - (let ((n nil)) - (when default + (let ((n nil) + (default1 (if (consp default) (car default) default))) + (when default1 (setq prompt (if (string-match "\\(\\):[ \t]*\\'" prompt) - (replace-match (format " (default %s)" default) t t prompt 1) + (replace-match (format " (default %s)" default1) t t prompt 1) (replace-regexp-in-string "[ \t]*\\'" - (format " (default %s) " default) + (format " (default %s) " default1) prompt t t)))) (while (progn - (let ((str (read-from-minibuffer prompt nil nil nil nil - (and default - (number-to-string default))))) + (let ((str (read-from-minibuffer + prompt nil nil nil nil + (when default + (if (consp default) + (mapcar 'number-to-string (delq nil default)) + (number-to-string default)))))) (condition-case nil (setq n (cond - ((zerop (length str)) default) - ((stringp str) (read str)))) + ((zerop (length str)) default1) + ((stringp str) (string-to-number str)))) (error nil))) (unless (numberp n) (message "Please enter a number.") ------------------------------------------------------------ revno: 109270 committer: Juanma Barranquero branch nick: trunk timestamp: Sun 2012-07-29 19:20:16 +0200 message: src/makefile.w32-in: Update dependencies. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-29 17:14:51 +0000 +++ src/ChangeLog 2012-07-29 17:20:16 +0000 @@ -1,3 +1,8 @@ +2012-07-29 Juanma Barranquero + + * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O)) + ($(BLD)/w32console.$(O)): Update dependencies. + 2012-07-29 Dmitry Antipov Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check. === modified file 'src/makefile.w32-in' --- src/makefile.w32-in 2012-07-29 15:43:09 +0000 +++ src/makefile.w32-in 2012-07-29 17:20:16 +0000 @@ -438,8 +438,8 @@ LISP_H = $(SRC)/lisp.h \ $(SRC)/globals.h \ $(GNU_LIB)/intprops.h \ - $(NT_INC)/stdalign.h \ - $(INTTYPES_H) + $(INTTYPES_H) \ + $(NT_INC)/stdalign.h MD5_H = $(GNU_LIB)/md5.h \ $(NT_INC)/stdint.h MENU_H = $(SRC)/menu.h \ @@ -784,7 +784,6 @@ $(SRC)/w32heap.h \ $(NT_INC)/sys/file.h \ $(NT_INC)/unistd.h \ - $(GNU_LIB)/verify.h \ $(BLOCKINPUT_H) \ $(BUFFER_H) \ $(CHARACTER_H) \ @@ -1165,6 +1164,7 @@ $(SRC)/w32inevt.c \ $(SRC)/termchar.h \ $(SRC)/w32heap.h \ + $(SRC)/w32inevt.h \ $(BLOCKINPUT_H) \ $(CONFIG_H) \ $(DISPEXTERN_H) \ @@ -1196,6 +1196,7 @@ $(SRC)/w32console.c \ $(SRC)/disptab.h \ $(SRC)/termchar.h \ + $(SRC)/w32heap.h \ $(SRC)/w32inevt.h \ $(CHARACTER_H) \ $(CODING_H) \ ------------------------------------------------------------ revno: 109269 committer: Dmitry Antipov branch nick: trunk timestamp: Sun 2012-07-29 21:14:51 +0400 message: Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check. * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long time. Adjust users. (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-29 16:55:02 +0000 +++ src/ChangeLog 2012-07-29 17:14:51 +0000 @@ -1,3 +1,10 @@ +2012-07-29 Dmitry Antipov + + Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check. + * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long + time. Adjust users. + (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list. + 2012-07-29 Jan Djärv * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before === modified file 'src/alloc.c' --- src/alloc.c 2012-07-29 16:00:35 +0000 +++ src/alloc.c 2012-07-29 17:14:51 +0000 @@ -29,11 +29,6 @@ #include #endif -/* This file is part of the core Lisp implementation, and thus must - deal with the real data structures. If the Lisp implementation is - replaced, this file likely will not be used. */ - -#undef HIDE_LISP_IMPLEMENTATION #include "lisp.h" #include "process.h" #include "intervals.h" @@ -5447,7 +5442,7 @@ if (pure_bytes_used_before_overflow) return Qnil; - CHECK_CONS_LIST (); + check_cons_list (); /* Don't keep undo information around forever. Do this early on, so it is no problem if the user quits. */ @@ -5615,7 +5610,7 @@ UNBLOCK_INPUT; - CHECK_CONS_LIST (); + check_cons_list (); gc_in_progress = 0; === modified file 'src/eval.c' --- src/eval.c 2012-07-26 01:27:33 +0000 +++ src/eval.c 2012-07-29 17:14:51 +0000 @@ -2094,7 +2094,7 @@ args_left = original_args; numargs = Flength (args_left); - CHECK_CONS_LIST (); + check_cons_list (); if (XINT (numargs) < XSUBR (fun)->min_args || (XSUBR (fun)->max_args >= 0 @@ -2222,7 +2222,7 @@ else xsignal1 (Qinvalid_function, original_fun); } - CHECK_CONS_LIST (); + check_cons_list (); lisp_eval_depth--; if (backtrace.debug_on_exit) @@ -2762,7 +2762,7 @@ if (debug_on_next_call) do_debug_on_call (Qlambda); - CHECK_CONS_LIST (); + check_cons_list (); original_fun = args[0]; @@ -2871,13 +2871,13 @@ else if (EQ (funcar, Qautoload)) { Fautoload_do_load (fun, original_fun, Qnil); - CHECK_CONS_LIST (); + check_cons_list (); goto retry; } else xsignal1 (Qinvalid_function, original_fun); } - CHECK_CONS_LIST (); + check_cons_list (); lisp_eval_depth--; if (backtrace.debug_on_exit) val = call_debugger (Fcons (Qexit, Fcons (val, Qnil))); === modified file 'src/lisp.h' --- src/lisp.h 2012-07-28 23:05:32 +0000 +++ src/lisp.h 2012-07-29 17:14:51 +0000 @@ -28,20 +28,6 @@ #include -/* Use the configure flag --enable-checking[=LIST] to enable various - types of run time checks for Lisp objects. */ - -#ifdef GC_CHECK_CONS_LIST -extern void check_cons_list (void); -#define CHECK_CONS_LIST() check_cons_list () -#else -#define CHECK_CONS_LIST() ((void) 0) -#endif - -/* Temporarily disable wider-than-pointer integers until they're tested more. - Build with CFLAGS='-DWIDE_EMACS_INT' to try them out. */ -/* #undef WIDE_EMACS_INT */ - /* EMACS_INT - signed integer wide enough to hold an Emacs value EMACS_INT_MAX - maximum value of EMACS_INT; can be used in #if pI - printf length modifier for EMACS_INT @@ -642,21 +628,12 @@ { /* Please do not use the names of these elements in code other than the core lisp implementation. Use XCAR and XCDR below. */ -#ifdef HIDE_LISP_IMPLEMENTATION - Lisp_Object car_; - union - { - Lisp_Object cdr_; - struct Lisp_Cons *chain; - } u; -#else Lisp_Object car; union { Lisp_Object cdr; struct Lisp_Cons *chain; } u; -#endif }; /* Take the car or cdr of something known to be a cons cell. */ @@ -666,13 +643,8 @@ fields are not accessible as lvalues. (What if we want to switch to a copying collector someday? Cached cons cell field addresses may be invalidated at arbitrary points.) */ -#ifdef HIDE_LISP_IMPLEMENTATION -#define XCAR_AS_LVALUE(c) (XCONS ((c))->car_) -#define XCDR_AS_LVALUE(c) (XCONS ((c))->u.cdr_) -#else #define XCAR_AS_LVALUE(c) (XCONS ((c))->car) #define XCDR_AS_LVALUE(c) (XCONS ((c))->u.cdr) -#endif /* Use these from normal code. */ #define XCAR(c) LISP_MAKE_RVALUE (XCAR_AS_LVALUE (c)) @@ -1485,23 +1457,13 @@ { union { -#ifdef HIDE_LISP_IMPLEMENTATION - double data_; -#else double data; -#endif struct Lisp_Float *chain; } u; }; -#ifdef HIDE_LISP_IMPLEMENTATION -#define XFLOAT_DATA(f) (0 ? XFLOAT (f)->u.data_ : XFLOAT (f)->u.data_) -#else -#define XFLOAT_DATA(f) (0 ? XFLOAT (f)->u.data : XFLOAT (f)->u.data) -/* This should be used only in alloc.c, which always disables - HIDE_LISP_IMPLEMENTATION. */ -#define XFLOAT_INIT(f,n) (XFLOAT (f)->u.data = (n)) -#endif +#define XFLOAT_DATA(f) (0 ? XFLOAT (f)->u.data : XFLOAT (f)->u.data) +#define XFLOAT_INIT(f, n) (XFLOAT (f)->u.data = (n)) /* A character, declared with the following typedef, is a member of some character set associated with the current buffer. */ @@ -2702,6 +2664,11 @@ extern void syms_of_alloc (void); extern struct buffer * allocate_buffer (void); extern int valid_lisp_object_p (Lisp_Object); +#ifdef GC_CHECK_CONS_LIST +extern void check_cons_list (void); +#else +#define check_cons_list() ((void) 0) +#endif #ifdef REL_ALLOC /* Defined in ralloc.c */ ------------------------------------------------------------ revno: 109268 committer: Juanma Barranquero branch nick: trunk timestamp: Sun 2012-07-29 18:56:18 +0200 message: nt/config.nt: Sync with autogen/config.in. (HAVE_ENVIRON_DECL): New macro. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-07-29 15:43:09 +0000 +++ nt/ChangeLog 2012-07-29 16:56:18 +0000 @@ -1,3 +1,8 @@ +2012-07-29 Juanma Barranquero + + * config.nt: Sync with autogen/config.in. + (HAVE_ENVIRON_DECL): New macro. + 2012-07-29 Eli Zaretskii * inc/stdalign.h (_Alignas, alignas): Define. === modified file 'nt/config.nt' --- nt/config.nt 2012-07-28 23:05:32 +0000 +++ nt/config.nt 2012-07-29 16:56:18 +0000 @@ -339,6 +339,9 @@ /* Define to 1 if you have the `endpwent' function. */ #undef HAVE_ENDPWENT +/* Define if you have the declaration of environ. */ +#undef HAVE_ENVIRON_DECL + /* Define to 1 if you have the `euidaccess' function. */ #undef HAVE_EUIDACCESS ------------------------------------------------------------ revno: 109267 fixes bug(s): http://debbugs.gnu.org/12010 committer: Jan D. branch nick: trunk timestamp: Sun 2012-07-29 18:55:02 +0200 message: * Makefile.in (install-arch-indep): Handle space in locallisppath. * src/lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before setting sitelisp. diff: === modified file 'ChangeLog' --- ChangeLog 2012-07-28 23:05:32 +0000 +++ ChangeLog 2012-07-29 16:55:02 +0000 @@ -1,3 +1,7 @@ +2012-07-29 Jan Djärv + + * Makefile.in (install-arch-indep): Handle space in locallisppath. + 2012-07-28 Paul Eggert Use Gnulib environ module (Bug#9772). === modified file 'Makefile.in' --- Makefile.in 2012-07-09 04:52:49 +0000 +++ Makefile.in 2012-07-29 16:55:02 +0000 @@ -285,9 +285,9 @@ # to just letting configure generate epaths.h from epaths.in in a # similar way to how Makefile is made from Makefile.in. epaths-force: FRC - @(standardlisppath=`echo ${standardlisppath} | ${removenullpaths}` ; \ - locallisppath=`echo ${locallisppath} | ${removenullpaths}` ; \ - buildlisppath=`echo ${buildlisppath} | ${removenullpaths}` ; \ + @(standardlisppath=`echo "${standardlisppath}" | ${removenullpaths}` ; \ + locallisppath=`echo "${locallisppath}" | ${removenullpaths}` ; \ + buildlisppath=`echo "${buildlisppath}" | ${removenullpaths}` ; \ x_default_search_path=`echo ${x_default_search_path}`; \ gamedir=`echo ${gamedir}`; \ sed < ${srcdir}/src/epaths.in > epaths.h.$$$$ \ @@ -489,7 +489,8 @@ ## http://lists.gnu.org/archive/html/autoconf-patches/2004-11/msg00005.html install-arch-indep: install-info install-man ${INSTALL_ARCH_INDEP_EXTRA} umask 022 ; \ - $(MKDIR_P) $(DESTDIR)`echo ${locallisppath} | sed 's,:, $(DESTDIR),g'` + eval sh -x $(MKDIR_P) \ + "'$(DESTDIR)`echo ${locallisppath}|sed \"s,:,' '$(DESTDIR),g\"`'" -set ${COPYDESTS} ; \ unset CDPATH; \ $(set_installuser); \ === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-29 16:22:27 +0000 +++ src/ChangeLog 2012-07-29 16:55:02 +0000 @@ -1,3 +1,8 @@ +2012-07-29 Jan Djärv + + * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before + setting sitelisp (Bug#12010). + 2012-07-29 Eli Zaretskii * w32heap.h (OS_9X): Renamed from OS_WINDOWS_95. === modified file 'src/lread.c' --- src/lread.c 2012-07-12 03:45:46 +0000 +++ src/lread.c 2012-07-29 16:55:02 +0000 @@ -4121,12 +4121,7 @@ difference between initialized and !initialized in this case, so we'll have to do it unconditionally when Vinstallation_directory is non-nil. */ -#ifdef HAVE_NS - /* loadpath already includes the app-bundle's site-lisp. */ - if (!no_site_lisp && !egetenv ("EMACSLOADPATH") && !loadpath) -#else if (!no_site_lisp && !egetenv ("EMACSLOADPATH")) -#endif { Lisp_Object sitelisp; sitelisp = decode_env_path (0, PATH_SITELOADSEARCH); @@ -4270,12 +4265,7 @@ load_path_check (); /* Add the site-lisp directories at the front. */ -#ifdef HAVE_NS - /* loadpath already includes the app-bundle's site-lisp. */ - if (!no_site_lisp && !loadpath) -#else if (!no_site_lisp) -#endif { Lisp_Object sitelisp; sitelisp = decode_env_path (0, PATH_SITELOADSEARCH); ------------------------------------------------------------ revno: 109266 committer: Paul Eggert branch nick: trunk timestamp: Sun 2012-07-29 09:29:23 -0700 message: * international/mule-cmds.el (inactivate-input-method): Mark obsolete. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-29 08:18:29 +0000 +++ lisp/ChangeLog 2012-07-29 16:29:23 +0000 @@ -13,6 +13,8 @@ Rename from inactivate-current-input-method-function. (input-method-deactivate-hook): New hook. (input-method-inactivate-hook): Mark obsolete. + (inactivate-input-method): Mark obsolete. + * international/quail.el (quail-activate): Also run quail-deactivate-hook. (quail-deactivate): Rename from quail-inactivate. === modified file 'lisp/international/mule-cmds.el' --- lisp/international/mule-cmds.el 2012-07-29 07:16:45 +0000 +++ lisp/international/mule-cmds.el 2012-07-29 16:29:23 +0000 @@ -1468,6 +1468,10 @@ (setq current-input-method nil) (force-mode-line-update))))) +(define-obsolete-function-alias + 'inactivate-input-method + 'deactivate-input-method "24.2") + (defun set-input-method (input-method &optional interactive) "Select and activate input method INPUT-METHOD for the current buffer. This also sets the default input method to the one you specify. ------------------------------------------------------------ revno: 109265 committer: Eli Zaretskii branch nick: trunk timestamp: Sun 2012-07-29 19:22:27 +0300 message: Rename OS_WINDOWS_95 to OS_9X. src/w32heap.h (OS_9X): Renamed from OS_WINDOWS_95. src/w32heap.c (cache_system_info): src/w32.c (sys_rename): src/w32proc.c (find_child_console, sys_kill): All users changed. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-29 16:00:35 +0000 +++ src/ChangeLog 2012-07-29 16:22:27 +0000 @@ -1,3 +1,11 @@ +2012-07-29 Eli Zaretskii + + * w32heap.h (OS_9X): Renamed from OS_WINDOWS_95. + + * w32heap.c (cache_system_info): + * w32.c (sys_rename): + * w32proc.c (find_child_console, sys_kill): All users changed. + 2012-07-29 Paul Eggert * alloc.c (Fgarbage_collect): Indent as per usual Emacs style. === modified file 'src/w32.c' --- src/w32.c 2012-07-29 08:18:29 +0000 +++ src/w32.c 2012-07-29 16:22:27 +0000 @@ -2929,7 +2929,7 @@ /* volume_info is set indirectly by map_w32_filename. */ oldname_dev = volume_info.serialnum; - if (os_subtype == OS_WINDOWS_95) + if (os_subtype == OS_9X) { char * o; char * p; === modified file 'src/w32heap.c' --- src/w32heap.c 2012-07-29 08:18:29 +0000 +++ src/w32heap.c 2012-07-29 16:22:27 +0000 @@ -66,7 +66,7 @@ w32_minor_version = version.info.minor; if (version.info.platform & 0x8000) - os_subtype = OS_WINDOWS_95; + os_subtype = OS_9X; else os_subtype = OS_NT; @@ -79,7 +79,7 @@ GetVersionEx (&osinfo_cache); w32_build_number = osinfo_cache.dwBuildNumber; - if (os_subtype == OS_WINDOWS_95) + if (os_subtype == OS_9X) w32_build_number &= 0xffff; } === modified file 'src/w32heap.h' --- src/w32heap.h 2012-07-29 08:18:29 +0000 +++ src/w32heap.h 2012-07-29 16:22:27 +0000 @@ -51,7 +51,7 @@ extern int w32_build_number; enum { - OS_WINDOWS_95 = 1, + OS_9X = 1, OS_NT }; === modified file 'src/w32proc.c' --- src/w32proc.c 2012-07-29 08:18:29 +0000 +++ src/w32proc.c 2012-07-29 16:22:27 +0000 @@ -1386,7 +1386,7 @@ GetClassName (hwnd, window_class, sizeof (window_class)); if (strcmp (window_class, - (os_subtype == OS_WINDOWS_95) + (os_subtype == OS_9X) ? "tty" : "ConsoleWindowClass") == 0) { @@ -1517,7 +1517,7 @@ if (NILP (Vw32_start_process_share_console) && cp && cp->hwnd) { #if 1 - if (os_subtype == OS_WINDOWS_95) + if (os_subtype == OS_9X) { /* Another possibility is to try terminating the VDM out-right by ------------------------------------------------------------ revno: 109264 committer: Paul Eggert branch nick: trunk timestamp: Sun 2012-07-29 09:00:35 -0700 message: * alloc.c (Fgarbage_collect): Indent as per usual Emacs style. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-29 15:43:09 +0000 +++ src/ChangeLog 2012-07-29 16:00:35 +0000 @@ -1,3 +1,7 @@ +2012-07-29 Paul Eggert + + * alloc.c (Fgarbage_collect): Indent as per usual Emacs style. + 2012-07-29 Eli Zaretskii * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h. === modified file 'src/alloc.c' --- src/alloc.c 2012-07-29 13:51:45 +0000 +++ src/alloc.c 2012-07-29 16:00:35 +0000 @@ -5706,9 +5706,9 @@ #if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES { /* Compute average percentage of zombies. */ - double nlive = - total_conses + total_symbols + total_markers + total_strings - + total_vectors + total_floats + total_intervals + total_buffers; + double nlive = + (total_conses + total_symbols + total_markers + total_strings + + total_vectors + total_floats + total_intervals + total_buffers); avg_live = (avg_live * ngcs + nlive) / (ngcs + 1); max_live = max (nlive, max_live); @@ -5727,9 +5727,11 @@ /* Accumulate statistics. */ if (FLOATP (Vgc_elapsed)) - Vgc_elapsed = make_float - (XFLOAT_DATA (Vgc_elapsed) + EMACS_TIME_TO_DOUBLE - (sub_emacs_time (current_emacs_time (), start))); + { + EMACS_TIME since_start = sub_emacs_time (current_emacs_time (), start); + Vgc_elapsed = make_float (XFLOAT_DATA (Vgc_elapsed) + + EMACS_TIME_TO_DOUBLE (since_start)); + } gcs_done++; ------------------------------------------------------------ revno: 109263 committer: Eli Zaretskii branch nick: trunk timestamp: Sun 2012-07-29 18:53:31 +0300 message: Fix parallel builds on Windows in lib-src. lib-src/makefile.w32-in ($(BLD)/profile.$(O)): Depend on stamp_BLD. diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2012-07-12 15:20:39 +0000 +++ lib-src/ChangeLog 2012-07-29 15:53:31 +0000 @@ -1,3 +1,7 @@ +2012-07-29 Eli Zaretskii + + * makefile.w32-in ($(BLD)/profile.$(O)): Depend on stamp_BLD. + 2012-07-12 Paul Eggert * movemail.c: Add missing 'defined'. === modified file 'lib-src/makefile.w32-in' --- lib-src/makefile.w32-in 2012-07-29 08:18:29 +0000 +++ lib-src/makefile.w32-in 2012-07-29 15:53:31 +0000 @@ -467,4 +467,4 @@ $(BLD)/emacsclient.$(O) $(BLD)/etags.$(O) $(BLD)/regex.$(O): stamp_BLD -$(BLD)/ebrowse.$(O) $(BLD)/ctags.$(O): stamp_BLD +$(BLD)/ebrowse.$(O) $(BLD)/ctags.$(O) $(BLD)/profile.$(O): stamp_BLD ------------------------------------------------------------ revno: 109262 fixes bug(s): http://debbugs.gnu.org/9772 committer: Eli Zaretskii branch nick: trunk timestamp: Sun 2012-07-29 18:43:09 +0300 message: MS-Windows followup for revision 109252. nt/inc/stdalign.h (_Alignas, alignas): Define. src/makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-07-29 08:18:29 +0000 +++ nt/ChangeLog 2012-07-29 15:43:09 +0000 @@ -1,3 +1,7 @@ +2012-07-29 Eli Zaretskii + + * inc/stdalign.h (_Alignas, alignas): Define. + 2012-07-28 Paul Eggert Use Gnulib stdalign module (Bug#9772, Bug#9960). === modified file 'nt/inc/stdalign.h' --- nt/inc/stdalign.h 2012-05-27 12:11:23 +0000 +++ nt/inc/stdalign.h 2012-07-29 15:43:09 +0000 @@ -13,4 +13,13 @@ #endif #define alignof _Alignof +#if __GNUC__ +# define _Alignas(a) __attribute__ ((__aligned__ (a))) +#elif 1300 <= _MSC_VER +# define _Alignas(a) __declspec (align (a)) +#endif +#ifdef _Alignas +# define alignas _Alignas +#endif + #endif /* _NT_STDALIGN_H_ */ === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-29 13:51:45 +0000 +++ src/ChangeLog 2012-07-29 15:43:09 +0000 @@ -1,3 +1,7 @@ +2012-07-29 Eli Zaretskii + + * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h. + 2012-07-29 Dmitry Antipov Cleanup statistics calculation in Fgarbage_collect. === modified file 'src/makefile.w32-in' --- src/makefile.w32-in 2012-07-29 08:18:29 +0000 +++ src/makefile.w32-in 2012-07-29 15:43:09 +0000 @@ -438,6 +438,7 @@ LISP_H = $(SRC)/lisp.h \ $(SRC)/globals.h \ $(GNU_LIB)/intprops.h \ + $(NT_INC)/stdalign.h \ $(INTTYPES_H) MD5_H = $(GNU_LIB)/md5.h \ $(NT_INC)/stdint.h ------------------------------------------------------------ revno: 109261 committer: Dmitry Antipov branch nick: trunk timestamp: Sun 2012-07-29 17:51:45 +0400 message: Cleanup statistics calculation in Fgarbage_collect. * alloc.c (Fgarbage_collect): Rename t1 to meaningful start. Fix zombies percentage calculation. Simplify elapsed time calculation. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-29 11:20:43 +0000 +++ src/ChangeLog 2012-07-29 13:51:45 +0000 @@ -1,5 +1,11 @@ 2012-07-29 Dmitry Antipov + Cleanup statistics calculation in Fgarbage_collect. + * alloc.c (Fgarbage_collect): Rename t1 to meaningful start. Fix + zombies percentage calculation. Simplify elapsed time calculation. + +2012-07-29 Dmitry Antipov + Generalize marker debugging code under MARKER_DEBUG and use eassert. * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove. (gap_left, gap_right, adjust_markers_for_delete, insert_1_both) === modified file 'src/alloc.c' --- src/alloc.c 2012-07-28 23:05:32 +0000 +++ src/alloc.c 2012-07-29 13:51:45 +0000 @@ -5437,7 +5437,7 @@ int message_p; Lisp_Object total[11]; ptrdiff_t count = SPECPDL_INDEX (); - EMACS_TIME t1; + EMACS_TIME start; if (abort_on_gc) abort (); @@ -5454,7 +5454,7 @@ FOR_EACH_BUFFER (nextb) compact_buffer (nextb); - t1 = current_emacs_time (); + start = current_emacs_time (); /* In case user calls debug_print during GC, don't let that cause a recursive GC. */ @@ -5706,18 +5706,16 @@ #if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES { /* Compute average percentage of zombies. */ - double nlive = 0; - - for (i = 0; i < 7; ++i) - if (CONSP (total[i])) - nlive += XFASTINT (XCAR (total[i])); + double nlive = + total_conses + total_symbols + total_markers + total_strings + + total_vectors + total_floats + total_intervals + total_buffers; avg_live = (avg_live * ngcs + nlive) / (ngcs + 1); max_live = max (nlive, max_live); avg_zombies = (avg_zombies * ngcs + nzombies) / (ngcs + 1); max_zombies = max (nzombies, max_zombies); ++ngcs; - } + } #endif if (!NILP (Vpost_gc_hook)) @@ -5729,12 +5727,9 @@ /* Accumulate statistics. */ if (FLOATP (Vgc_elapsed)) - { - EMACS_TIME t2 = current_emacs_time (); - EMACS_TIME t3 = sub_emacs_time (t2, t1); - Vgc_elapsed = make_float (XFLOAT_DATA (Vgc_elapsed) - + EMACS_TIME_TO_DOUBLE (t3)); - } + Vgc_elapsed = make_float + (XFLOAT_DATA (Vgc_elapsed) + EMACS_TIME_TO_DOUBLE + (sub_emacs_time (current_emacs_time (), start))); gcs_done++; ------------------------------------------------------------ revno: 109260 committer: Dmitry Antipov branch nick: trunk timestamp: Sun 2012-07-29 15:20:43 +0400 message: Generalize marker debugging code under MARKER_DEBUG and use eassert. * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove. (gap_left, gap_right, adjust_markers_for_delete, insert_1_both) (insert_from_string_1, insert_from_gap, insert_from_buffer_1) (replace_range, replace_range_2, del_range_2): Change to eassert. * marker.c (byte_char_debug_check): Adjust style. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-29 08:18:29 +0000 +++ src/ChangeLog 2012-07-29 11:20:43 +0000 @@ -1,3 +1,12 @@ +2012-07-29 Dmitry Antipov + + Generalize marker debugging code under MARKER_DEBUG and use eassert. + * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove. + (gap_left, gap_right, adjust_markers_for_delete, insert_1_both) + (insert_from_string_1, insert_from_gap, insert_from_buffer_1) + (replace_range, replace_range_2, del_range_2): Change to eassert. + * marker.c (byte_char_debug_check): Adjust style. + 2012-07-29 Paul Eggert Don't use the abbreviation "win" to refer to Windows (Bug#10421). === modified file 'src/insdel.c' --- src/insdel.c 2012-07-03 18:24:42 +0000 +++ src/insdel.c 2012-07-29 11:20:43 +0000 @@ -59,14 +59,10 @@ Lisp_Object Qinhibit_modification_hooks; static void signal_before_change (ptrdiff_t, ptrdiff_t, ptrdiff_t *); - -#define CHECK_MARKERS() \ - do \ - { \ - if (check_markers_debug_flag) \ - check_markers (); \ - } \ - while (0) + +/* Also used in marker.c to enable expensive marker checks. */ + +#ifdef MARKER_DEBUG static void check_markers (void) @@ -86,7 +82,13 @@ abort (); } } - + +#else /* not MARKER_DEBUG */ + +#define check_markers() do { } while (0) + +#endif /* MARKER_DEBUG */ + /* Move gap to position CHARPOS. Note that this can quit! */ @@ -158,8 +160,7 @@ was specified or may be where a quit was detected. */ GPT_BYTE = bytepos; GPT = charpos; - if (bytepos < charpos) - abort (); + eassert (charpos <= bytepos); if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */ QUIT; } @@ -209,8 +210,7 @@ GPT = charpos; GPT_BYTE = bytepos; - if (bytepos < charpos) - abort (); + eassert (charpos <= bytepos); if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */ QUIT; } @@ -233,9 +233,7 @@ for (m = BUF_MARKERS (current_buffer); m; m = m->next) { charpos = m->charpos; - - if (charpos > Z) - abort (); + eassert (charpos <= Z); /* If the marker is after the deletion, relocate by number of chars / bytes deleted. */ @@ -375,7 +373,7 @@ } } - CHECK_MARKERS (); + check_markers (); } @@ -835,8 +833,7 @@ Z_BYTE += nbytes; if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */ - if (GPT_BYTE < GPT) - abort (); + eassert (GPT <= GPT_BYTE); /* The insert may have been in the unchanged region, so check again. */ if (Z - GPT < END_UNCHANGED) @@ -856,7 +853,7 @@ adjust_point (nchars, nbytes); - CHECK_MARKERS (); + check_markers (); } /* Insert the part of the text of STRING, a Lisp object assumed to be @@ -966,8 +963,7 @@ Z_BYTE += outgoing_nbytes; if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */ - if (GPT_BYTE < GPT) - abort (); + eassert (GPT <= GPT_BYTE); /* The insert may have been in the unchanged region, so check again. */ if (Z - GPT < END_UNCHANGED) @@ -991,7 +987,7 @@ adjust_point (nchars, outgoing_nbytes); - CHECK_MARKERS (); + check_markers (); } /* Insert a sequence of NCHARS chars which occupy NBYTES bytes @@ -1015,8 +1011,7 @@ Z_BYTE += nbytes; if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */ - if (GPT_BYTE < GPT) - abort (); + eassert (GPT <= GPT_BYTE); adjust_overlays_for_insert (GPT - nchars, nchars); adjust_markers_for_insert (GPT - nchars, GPT_BYTE - nbytes, @@ -1032,7 +1027,7 @@ if (GPT - nchars < PT) adjust_point (nchars, nbytes); - CHECK_MARKERS (); + check_markers (); } /* Insert text from BUF, NCHARS characters starting at CHARPOS, into the @@ -1151,8 +1146,7 @@ Z_BYTE += outgoing_nbytes; if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */ - if (GPT_BYTE < GPT) - abort (); + eassert (GPT <= GPT_BYTE); /* The insert may have been in the unchanged region, so check again. */ if (Z - GPT < END_UNCHANGED) @@ -1243,7 +1237,7 @@ if (Z - GPT < END_UNCHANGED) END_UNCHANGED = Z - GPT; - CHECK_MARKERS (); + check_markers (); if (len == 0) evaporate_overlays (from); @@ -1296,7 +1290,7 @@ ptrdiff_t outgoing_insbytes = insbytes; Lisp_Object deletion; - CHECK_MARKERS (); + check_markers (); GCPRO1 (new); deletion = Qnil; @@ -1357,8 +1351,7 @@ GPT_BYTE = from_byte; if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */ - if (GPT_BYTE < GPT) - abort (); + eassert (GPT <= GPT_BYTE); if (GPT - BEG < BEG_UNCHANGED) BEG_UNCHANGED = GPT - BEG; @@ -1404,8 +1397,7 @@ Z_BYTE += outgoing_insbytes; if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */ - if (GPT_BYTE < GPT) - abort (); + eassert (GPT <= GPT_BYTE); /* Adjust the overlay center as needed. This must be done after adjusting the markers that bound the overlays. */ @@ -1435,7 +1427,7 @@ if (outgoing_insbytes == 0) evaporate_overlays (from); - CHECK_MARKERS (); + check_markers (); MODIFF++; CHARS_MODIFF = MODIFF; @@ -1465,7 +1457,7 @@ { ptrdiff_t nbytes_del, nchars_del; - CHECK_MARKERS (); + check_markers (); nchars_del = to - from; nbytes_del = to_byte - from_byte; @@ -1488,8 +1480,7 @@ GPT_BYTE = from_byte; if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */ - if (GPT_BYTE < GPT) - abort (); + eassert (GPT <= GPT_BYTE); if (GPT - BEG < BEG_UNCHANGED) BEG_UNCHANGED = GPT - BEG; @@ -1522,8 +1513,7 @@ Z_BYTE += insbytes; if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */ - if (GPT_BYTE < GPT) - abort (); + eassert (GPT <= GPT_BYTE); /* Adjust the overlay center as needed. This must be done after adjusting the markers that bound the overlays. */ @@ -1554,7 +1544,7 @@ if (insbytes == 0) evaporate_overlays (from); - CHECK_MARKERS (); + check_markers (); MODIFF++; CHARS_MODIFF = MODIFF; @@ -1705,7 +1695,7 @@ register ptrdiff_t nbytes_del, nchars_del; Lisp_Object deletion; - CHECK_MARKERS (); + check_markers (); nchars_del = to - from; nbytes_del = to_byte - from_byte; @@ -1761,15 +1751,14 @@ needs to access the previous gap contents. */ *(GPT_ADDR) = 0; - if (GPT_BYTE < GPT) - abort (); + eassert (GPT <= GPT_BYTE); if (GPT - BEG < BEG_UNCHANGED) BEG_UNCHANGED = GPT - BEG; if (Z - GPT < END_UNCHANGED) END_UNCHANGED = Z - GPT; - CHECK_MARKERS (); + check_markers (); evaporate_overlays (from); @@ -2201,9 +2190,6 @@ combine_after_change_list = Qnil; combine_after_change_buffer = Qnil; - DEFVAR_BOOL ("check-markers-debug-flag", check_markers_debug_flag, - doc: /* Non-nil means enable debugging checks for invalid marker positions. */); - check_markers_debug_flag = 0; DEFVAR_LISP ("combine-after-change-calls", Vcombine_after_change_calls, doc: /* Used internally by the `combine-after-change-calls' macro. */); Vcombine_after_change_calls = Qnil; === modified file 'src/marker.c' --- src/marker.c 2012-07-27 07:51:52 +0000 +++ src/marker.c 2012-07-29 11:20:43 +0000 @@ -64,7 +64,7 @@ #else /* not MARKER_DEBUG */ -#define byte_char_debug_check(b,charpos,bytepos) do { } while (0) +#define byte_char_debug_check(b, charpos, bytepos) do { } while (0) #endif /* MARKER_DEBUG */ ------------------------------------------------------------ revno: 109259 committer: Glenn Morris branch nick: trunk timestamp: Sun 2012-07-29 06:19:06 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/Makefile.in' --- autogen/Makefile.in 2012-07-09 10:17:37 +0000 +++ autogen/Makefile.in 2012-07-29 10:19:06 +0000 @@ -36,7 +36,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=errno --avoid=fcntl --avoid=fcntl-h --avoid=fstat --avoid=msvc-inval --avoid=msvc-nothrow --avoid=raise --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-strcase careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink socklen stat-time stdarg stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timespec-add timespec-sub utimens warnings +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=errno --avoid=fcntl --avoid=fcntl-h --avoid=fstat --avoid=msvc-inval --avoid=msvc-nothrow --avoid=raise --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-strcase careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink socklen stat-time stdalign stdarg stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timespec-add timespec-sub utimens warnings VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ @@ -65,9 +65,10 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/c-strtod.m4 \ $(top_srcdir)/m4/clock_time.m4 $(top_srcdir)/m4/dup2.m4 \ - $(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/filemode.m4 \ - $(top_srcdir)/m4/getloadavg.m4 $(top_srcdir)/m4/getopt.m4 \ - $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \ + $(top_srcdir)/m4/environ.m4 $(top_srcdir)/m4/extensions.m4 \ + $(top_srcdir)/m4/filemode.m4 $(top_srcdir)/m4/getloadavg.m4 \ + $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettime.m4 \ + $(top_srcdir)/m4/gettimeofday.m4 \ $(top_srcdir)/m4/gnulib-common.m4 \ $(top_srcdir)/m4/gnulib-comp.m4 \ $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inttypes.m4 \ === modified file 'autogen/aclocal.m4' --- autogen/aclocal.m4 2012-06-23 10:17:30 +0000 +++ autogen/aclocal.m4 2012-07-29 10:19:06 +0000 @@ -989,6 +989,7 @@ m4_include([m4/c-strtod.m4]) m4_include([m4/clock_time.m4]) m4_include([m4/dup2.m4]) +m4_include([m4/environ.m4]) m4_include([m4/extensions.m4]) m4_include([m4/filemode.m4]) m4_include([m4/getloadavg.m4]) === modified file 'autogen/config.in' --- autogen/config.in 2012-07-14 00:06:05 +0000 +++ autogen/config.in 2012-07-29 10:19:06 +0000 @@ -220,9 +220,6 @@ /* Define to 1 if ALSA is available. */ #undef HAVE_ALSA -/* Define to 1 if GCC-style __attribute__ ((__aligned__ (expr))) works. */ -#undef HAVE_ATTRIBUTE_ALIGNED - /* Define to 1 if strtold conforms to C99. */ #undef HAVE_C99_STRTOLD @@ -335,6 +332,9 @@ /* Define to 1 if you have the `endpwent' function. */ #undef HAVE_ENDPWENT +/* Define if you have the declaration of environ. */ +#undef HAVE_ENVIRON_DECL + /* Define to 1 if you have the `euidaccess' function. */ #undef HAVE_EUIDACCESS === modified file 'autogen/configure' --- autogen/configure 2012-07-17 10:17:29 +0000 +++ autogen/configure 2012-07-29 10:19:06 +0000 @@ -6948,6 +6948,7 @@ # Code from module dtoastr: # Code from module dtotimespec: # Code from module dup2: + # Code from module environ: # Code from module extensions: # Code from module filemode: @@ -8947,37 +8948,6 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __attribute__ ((__aligned__ (expr)))" >&5 -$as_echo_n "checking for __attribute__ ((__aligned__ (expr)))... " >&6; } -if test "${emacs_cv_attribute_aligned+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -char __attribute__ ((__aligned__ (1 << 3))) c; -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - emacs_cv_attribute_aligned=yes -else - emacs_cv_attribute_aligned=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_attribute_aligned" >&5 -$as_echo "$emacs_cv_attribute_aligned" >&6; } -if test $emacs_cv_attribute_aligned = yes; then - -$as_echo "#define HAVE_ATTRIBUTE_ALIGNED 1" >>confdefs.h - -fi - DEPFLAGS= MKDEPDIR=":" @@ -16268,6 +16238,57 @@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0; + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5 +$as_echo_n "checking if environ is properly declared... " >&6; } + if test "${gt_cv_var_environ_declaration+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if HAVE_UNISTD_H + #include + #endif + /* mingw, BeOS, Haiku declare environ in , not in . */ + #include + + extern struct { int foo; } environ; +int +main () +{ +environ.foo = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gt_cv_var_environ_declaration=no +else + gt_cv_var_environ_declaration=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5 +$as_echo "$gt_cv_var_environ_declaration" >&6; } + if test $gt_cv_var_environ_declaration = yes; then + +$as_echo "#define HAVE_ENVIRON_DECL 1" >>confdefs.h + + fi + + + if test $gt_cv_var_environ_declaration != yes; then + HAVE_DECL_ENVIRON=0 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for st_dm_mode in struct stat" >&5 $as_echo_n "checking for st_dm_mode in struct stat... " >&6; } if test "${ac_cv_struct_st_dm_mode+set}" = set; then : @@ -19897,6 +19918,18 @@ + GNULIB_ENVIRON=1 + + + + + + + + + + + # Persuade glibc to declare getloadavg(). ------------------------------------------------------------ revno: 109258 fixes bug(s): http://debbugs.gnu.org/10052 committer: Paul Eggert branch nick: trunk timestamp: Sun 2012-07-29 02:57:40 -0700 message: inaccessable -> inaccessible spelling fix * semantic/wisent/comp.el (wisent-inaccessible-symbols): Rename from wisent-inaccessable-symbols, fixing a misspelling. Caller changed. diff: === modified file 'lisp/cedet/ChangeLog' --- lisp/cedet/ChangeLog 2012-07-14 02:08:32 +0000 +++ lisp/cedet/ChangeLog 2012-07-29 09:57:40 +0000 @@ -1,3 +1,10 @@ +2012-07-29 Paul Eggert + + inaccessable -> inaccessible spelling fix (Bug#10052) + * semantic/wisent/comp.el (wisent-inaccessible-symbols): + Rename from wisent-inaccessable-symbols, fixing a misspelling. + Caller changed. + 2012-07-09 Andreas Schwab * ede/project-am.el: Fix typo. === modified file 'lisp/cedet/semantic/wisent/comp.el' --- lisp/cedet/semantic/wisent/comp.el 2012-01-19 07:21:25 +0000 +++ lisp/cedet/semantic/wisent/comp.el 2012-07-29 09:57:40 +0000 @@ -550,7 +550,7 @@ N Ns))) (setq N Np))) -(defun wisent-inaccessable-symbols () +(defun wisent-inaccessible-symbols () "Find out which productions are reachable and which symbols are used." ;; Starting with an empty set of productions and a set of symbols ;; which only has the start symbol in it, iterate over all @@ -709,7 +709,7 @@ nuseless-productions 0) (wisent-useless-nonterminals) - (wisent-inaccessable-symbols) + (wisent-inaccessible-symbols) (when (> (+ nuseless-nonterminals nuseless-productions) 0) (wisent-total-useless) ------------------------------------------------------------ revno: 109257 fixes bug(s): http://debbugs.gnu.org/10421 committer: Paul Eggert branch nick: trunk timestamp: Sun 2012-07-29 01:18:29 -0700 message: Don't use the abbreviation "win" to refer to Windows (Bug#10421). * lisp/org/ob-lilypond.el (ly-w32-ly-path): Rename from ly-win32-ly-path. (ly-w32-pdf-path): Rename from ly-win32-pdf-path. (ly-w32-midi-path): Rename from ly-win32-midi-path. (ly-determine-ly-path, ly-determine-pdf-path, ly-determine-midi-path): Check for "windows-nt", not "win32", in system-type. * src/regex.c (MAX_BUF_SIZE): Remove some incorrect and long-ago-commented-out code that talks about "WIN32". * src/w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95. All uses changed. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2012-07-28 15:12:12 +0000 +++ doc/misc/ChangeLog 2012-07-29 08:18:29 +0000 @@ -4719,7 +4719,7 @@ 2007-11-07 Michael Albinus * tramp.texi (Overview): Mention also the PuTTY integration under - Win32. Remove paragraphs about Tramp's experimental status. + w32. Remove paragraphs about Tramp's experimental status. (Frequently Asked Questions): Add code example for highlighting the mode line. === modified file 'doc/misc/gnus-faq.texi' --- doc/misc/gnus-faq.texi 2012-04-04 07:54:02 +0000 +++ doc/misc/gnus-faq.texi 2012-07-29 08:18:29 +0000 @@ -407,7 +407,7 @@ The first thing you've got to do is to create a suitable directory (no blanks in directory name please) e.g. c:\myhome. Then you must set the environment -variable HOME to this directory. To do this under Win9x +variable HOME to this directory. To do this under Windows 9x or Me include the line @example === modified file 'doc/misc/gnus.texi' --- doc/misc/gnus.texi 2012-06-26 22:52:31 +0000 +++ doc/misc/gnus.texi 2012-07-29 08:18:29 +0000 @@ -29959,7 +29959,7 @@ @lisp (("summary" - ("win95" -10000 nil s) + ("Windows 95" -10000 nil s) ("Gnus")) ("from" ("Lars" -1000)) === modified file 'doc/misc/idlwave.texi' --- doc/misc/idlwave.texi 2012-07-25 05:48:19 +0000 +++ doc/misc/idlwave.texi 2012-07-29 08:18:29 +0000 @@ -4020,7 +4020,7 @@ @end example @html - + @end html @node Windows and MacOS, Troubleshooting, Configuration Examples, Top @appendix Windows and MacOS === modified file 'doc/misc/mh-e.texi' --- doc/misc/mh-e.texi 2012-01-19 07:21:25 +0000 +++ doc/misc/mh-e.texi 2012-07-29 08:18:29 +0000 @@ -7901,7 +7901,7 @@ MAILDIR=$HOME/`mhparam Path` # -# Filter messages with win32 executables/virii. +# Filter messages with w32 executables/virii. # # These attachments are base64 and have a TVqQAAMAAAAEAAAA//8AALg # pattern. The string "this program cannot be run in MS-DOS mode" @@ -9060,5 +9060,3 @@ @c Local Variables: @c sentence-end-double-space: nil @c End: - - === modified file 'leim/makefile.w32-in' --- leim/makefile.w32-in 2012-03-25 18:17:46 +0000 +++ leim/makefile.w32-in 2012-07-29 08:18:29 +0000 @@ -1,4 +1,4 @@ -# -*- Makefile -*- for leim subdirectory in GNU Emacs on the Microsoft W32 API. +# -*- Makefile -*- for leim subdirectory in GNU Emacs on the Microsoft Windows API. # Copyright (C) 2000-2012 Free Software Foundation, Inc. # Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, === modified file 'lib-src/makefile.w32-in' --- lib-src/makefile.w32-in 2012-07-09 04:21:55 +0000 +++ lib-src/makefile.w32-in 2012-07-29 08:18:29 +0000 @@ -1,4 +1,4 @@ -# -*- Makefile -*- for GNU Emacs on the Microsoft W32 API. +# -*- Makefile -*- for GNU Emacs on the Microsoft Windows API. # Copyright (C) 2000-2012 Free Software Foundation, Inc. # This file is part of GNU Emacs. === modified file 'lib/makefile.w32-in' --- lib/makefile.w32-in 2012-07-09 15:37:43 +0000 +++ lib/makefile.w32-in 2012-07-29 08:18:29 +0000 @@ -1,4 +1,4 @@ -# -*- Makefile -*- for GNU Emacs on the Microsoft W32 API. +# -*- Makefile -*- for GNU Emacs on the Microsoft Windows API. # Copyright (C) 2011 Free Software Foundation, Inc. # This file is part of GNU Emacs. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-29 07:16:45 +0000 +++ lisp/ChangeLog 2012-07-29 08:18:29 +0000 @@ -10434,7 +10434,7 @@ (tramp-completion-file-name-regexp-unified) (tramp-completion-file-name-regexp-separate) (tramp-completion-file-name-regexp-url): Don't use leading volume - letter on win32 systems. (Bug#5303, Bug#9311) + letter on w32 systems. (Bug#5303, Bug#9311) (tramp-drop-volume-letter): Simplify definition. Suggested by Stefan Monnier . === modified file 'lisp/ChangeLog.8' --- lisp/ChangeLog.8 2012-02-24 19:32:46 +0000 +++ lisp/ChangeLog.8 2012-07-29 08:18:29 +0000 @@ -6906,7 +6906,7 @@ standard `print' and `nprint' programs, as well as `lpr' and similar programs. Only write directly to the printer port if no print program is specified. Work around a bug in Windows 9x - affecting Win32 version of Emacs by invoking command.com to write + affecting the w32 version of Emacs by invoking command.com to write to the printer port instead of writing directly. (direct-print-region-function): Use direct-print-region-helper to do most of the work. === modified file 'lisp/dos-w32.el' --- lisp/dos-w32.el 2012-05-04 05:14:14 +0000 +++ lisp/dos-w32.el 2012-07-29 08:18:29 +0000 @@ -361,7 +361,7 @@ (apply 'call-process lpr-prog nil errbuf nil rest)) ;; Run command.com to access printer port on Windows 9x, unless ;; we are supposed to append to an existing (non-empty) file, - ;; to work around a bug in Windows 9x that prevents Win32 + ;; to work around a bug in Windows 9x that prevents Windows ;; programs from accessing LPT ports reliably. ((and (eq system-type 'windows-nt) (getenv "winbootdir") === modified file 'lisp/mail/feedmail.el' --- lisp/mail/feedmail.el 2012-07-11 23:13:41 +0000 +++ lisp/mail/feedmail.el 2012-07-29 08:18:29 +0000 @@ -2334,7 +2334,7 @@ (if (and is-fqm is-in-this-dir) (setq filename buffer-file-name) (setq filename (feedmail-create-queue-filename queue-directory))) - ;; make binary file on DOS/Win95/WinNT, etc + ;; make binary file on DOS/Windows 95/Windows NT, etc (let ((buffer-file-type feedmail-force-binary-write)) (write-file filename)) ;; convenient for moving from draft to q, for example === modified file 'lisp/makefile.w32-in' --- lisp/makefile.w32-in 2012-07-28 11:21:43 +0000 +++ lisp/makefile.w32-in 2012-07-29 08:18:29 +0000 @@ -1,4 +1,4 @@ -# -*- Makefile -*- for GNU Emacs on the Microsoft W32 API. +# -*- Makefile -*- for GNU Emacs on the Microsoft Windows API. # Copyright (C) 2000-2012 Free Software Foundation, Inc. # This file is part of GNU Emacs. === modified file 'lisp/mh-e/ChangeLog.1' --- lisp/mh-e/ChangeLog.1 2012-01-19 07:21:25 +0000 +++ lisp/mh-e/ChangeLog.1 2012-07-29 08:18:29 +0000 @@ -9493,9 +9493,9 @@ * mh-utils.el (mh-find-progs): Run PATH search only when mh-progs, mh-lib and mh-lib-progs are not all already set. This allows the user to set them using a simple setq prior to loading mh-e. This - is useful for implementation of mh-e on win32. Note that many + is useful for implementation of mh-e on w32. Note that many commands still call mh-find-path which also parses the mh_profile - file (that may still fail on win32), so this is still done often. + file (that may still fail on w32), so this is still done often. But it lets us change the mh_profile file and have mh-e see the changed file without exiting emacs and starting over so I left that in. === modified file 'lisp/net/ange-ftp.el' --- lisp/net/ange-ftp.el 2012-07-11 12:03:19 +0000 +++ lisp/net/ange-ftp.el 2012-07-29 08:18:29 +0000 @@ -2618,7 +2618,7 @@ (format "list data file %s not readable" temp)))) - ;; remove ^M inserted by the win32 ftp client + ;; remove ^M inserted by the w32 ftp client (while (re-search-forward "\r$" nil t) (replace-match "")) (goto-char 1) === modified file 'lisp/org/ChangeLog' --- lisp/org/ChangeLog 2012-07-14 02:08:32 +0000 +++ lisp/org/ChangeLog 2012-07-29 08:18:29 +0000 @@ -1,3 +1,12 @@ +2012-07-29 Paul Eggert + + Don't use the abbreviation "win" to refer to Windows (Bug#10421). + * ob-lilypond.el (ly-w32-ly-path): Rename from ly-win32-ly-path. + (ly-w32-pdf-path): Rename from ly-win32-pdf-path. + (ly-w32-midi-path): Rename from ly-win32-midi-path. + (ly-determine-ly-path, ly-determine-pdf-path, ly-determine-midi-path): + Check for "windows-nt", not "win32", in system-type. + 2012-06-02 Chong Yidong * org-clock.el (org-clock-string-limit) === modified file 'lisp/org/ob-lilypond.el' --- lisp/org/ob-lilypond.el 2012-04-01 09:49:25 +0000 +++ lisp/org/ob-lilypond.el 2012-07-29 08:18:29 +0000 @@ -66,9 +66,9 @@ (defvar ly-nix-pdf-path "evince") (defvar ly-nix-midi-path "timidity") -(defvar ly-win32-ly-path "lilypond") -(defvar ly-win32-pdf-path "") -(defvar ly-win32-midi-path "") +(defvar ly-w32-ly-path "lilypond") +(defvar ly-w32-pdf-path "") +(defvar ly-w32-midi-path "") (defvar ly-gen-png nil "Image generation (png) can be turned on by default by setting @@ -329,8 +329,8 @@ (or test system-type))) (cond ((string= sys-type "darwin") ly-OSX-ly-path) - ((string= sys-type "win32") - ly-win32-ly-path) + ((string= sys-type "windows-nt") + ly-w32-ly-path) (t ly-nix-ly-path)))) (defun ly-determine-pdf-path (&optional test) @@ -341,8 +341,8 @@ (or test system-type))) (cond ((string= sys-type "darwin") ly-OSX-pdf-path) - ((string= sys-type "win32") - ly-win32-pdf-path) + ((string= sys-type "windows-nt") + ly-w32-pdf-path) (t ly-nix-pdf-path)))) (defun ly-determine-midi-path (&optional test) @@ -353,8 +353,8 @@ (or test test system-type))) (cond ((string= sys-type "darwin") ly-OSX-midi-path) - ((string= sys-type "win32") - ly-win32-midi-path) + ((string= sys-type "windows-nt") + ly-w32-midi-path) (t ly-nix-midi-path)))) (defun ly-toggle-midi-play () === modified file 'lisp/printing.el' --- lisp/printing.el 2012-01-19 07:21:25 +0000 +++ lisp/printing.el 2012-07-29 08:18:29 +0000 @@ -2141,7 +2141,7 @@ `http://bama.ua.edu/cgi-bin/man-cgi?lp' `http://www.mediacollege.com/cgi-bin/man/page.cgi?section=all&topic=lp' -* GNU utilities for Win32 (cp.exe) +* GNU utilities for w32 (cp.exe) `http://unxutils.sourceforge.net/' " :type '(repeat === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-07-28 23:05:32 +0000 +++ nt/ChangeLog 2012-07-29 08:18:29 +0000 @@ -905,7 +905,7 @@ 2008-04-04 Jason Rumney - * INSTALL: Update W32 API requirements. + * INSTALL: Update Windows API requirements. 2008-04-03 Jason Rumney @@ -2322,7 +2322,7 @@ * makefile.def (CP_DIR): Use platform independent switches for xcopy. * makefile.nt (install, fast_install, real_install, clean): - Don't use switches to del not supported by Win95. + Don't use switches to del not supported by Windows 95. 1995-11-07 Kevin Gallo @@ -2376,7 +2376,7 @@ 1995-05-27 Geoff Voelker * ebuild.bat, emacs.bat, fast-install.bat, install.bat: - Add carriage returns; necessary for batch files on Win95. + Add carriage returns; necessary for batch files on Windows 95. 1995-05-25 Geoff Voelker === modified file 'nt/INSTALL' --- nt/INSTALL 2012-04-07 13:57:36 +0000 +++ nt/INSTALL 2012-07-29 08:18:29 +0000 @@ -121,7 +121,7 @@ To compile Emacs, you will need either Microsoft Visual C++ 2.0, or later and nmake, or a Windows port of GCC 2.95 or later with MinGW - and W32 API support and a port of GNU Make. You can use the Cygwin + and Windows API support and a port of GNU Make. You can use the Cygwin ports of GCC, but Emacs requires the MinGW headers and libraries to build (latest versions of the Cygwin toolkit, at least since v1.3.3, include the MinGW headers and libraries as an integral part). @@ -591,7 +591,7 @@ * Trouble-shooting The main problems that are likely to be encountered when building - Emacs stem from using an old version of GCC, or old MinGW or W32 API + Emacs stem from using an old version of GCC, or old MinGW or Windows API headers. Additionally, Cygwin ports of GNU make may require the Emacs source tree to be mounted with text!=binary, because the makefiles generated by configure.bat necessarily use DOS line endings. Also, @@ -603,7 +603,7 @@ 2.95 or later is needed, because that is when the Windows port gained sufficient support for anonymous structs and unions to cope with some definitions from winnt.h that are used by addsection.c. - Older versions of the W32 API headers that come with Cygwin and MinGW + Older versions of the Windows API headers that come with Cygwin and MinGW may be missing some definitions required by Emacs, or broken in other ways. In particular, uniscribe APIs were added to MinGW CVS only on 2006-03-26, so releases from before then cannot be used. === modified file 'nt/configure.bat' --- nt/configure.bat 2012-07-04 17:17:19 +0000 +++ nt/configure.bat 2012-07-29 08:18:29 +0000 @@ -23,7 +23,7 @@ rem rem + MS Windows 95, NT or later rem + either MSVC 2.x or later, or gcc-2.95 or later (with GNU make 3.75 -rem or later) and the Mingw32 and W32 API headers and libraries. +rem or later) and the Mingw32 and Windows API headers and libraries. rem + Visual Studio 2005 is not supported at this time. rem rem For reference, here is a list of which builds of GNU make are known to @@ -426,7 +426,7 @@ rem of w32api-xxx.zip from Anders Norlander since 1999-11-18 at least. rem Beginning with Emacs 23, we need usp10.h. rem -echo Checking whether W32 API headers are too old... +echo Checking whether Windows API headers are too old... echo #include "windows.h" >junk.c echo #include "usp10.h" >>junk.c echo test(PIMAGE_NT_HEADERS pHeader) >>junk.c @@ -469,7 +469,7 @@ echo. echo Configure failed. echo To configure Emacs for Windows, you need to have either -echo gcc-2.95 or later with Mingw32 and the W32 API headers, +echo gcc-2.95 or later with Mingw32 and the Windows API headers, echo or MSVC 2.x or later. del junk.c goto end === modified file 'nt/makefile.w32-in' --- nt/makefile.w32-in 2012-06-16 13:17:14 +0000 +++ nt/makefile.w32-in 2012-07-29 08:18:29 +0000 @@ -1,4 +1,4 @@ -# -*- Makefile -*- for GNU Emacs on the Microsoft W32 API. +# -*- Makefile -*- for GNU Emacs on the Microsoft Windows API. # Copyright (C) 2000-2012 Free Software Foundation, Inc. # # Top level makefile for building GNU Emacs on Windows NT === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-28 23:05:32 +0000 +++ src/ChangeLog 2012-07-29 08:18:29 +0000 @@ -1,3 +1,11 @@ +2012-07-29 Paul Eggert + + Don't use the abbreviation "win" to refer to Windows (Bug#10421). + * regex.c (MAX_BUF_SIZE): Remove some incorrect and + long-ago-commented-out code that talks about "WIN32". + * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95. + All uses changed. + 2012-07-28 Paul Eggert Use Gnulib stdalign module (Bug#9772, Bug#9960). === modified file 'src/ChangeLog.10' --- src/ChangeLog.10 2012-04-15 02:59:30 +0000 +++ src/ChangeLog.10 2012-07-29 08:18:29 +0000 @@ -15825,7 +15825,7 @@ * w32term.c (w32_draw_fringe_bitmap): Copy unadapted code from xterm.c to handle overlaid fringe bitmaps and to use cursor color for displaying cursor in fringe. - (w32_define_fringe_bitmap, w32_destroy_fringe_bitmap): New W32 + (w32_define_fringe_bitmap, w32_destroy_fringe_bitmap): New Windows specific functions to define and destroy fringe bitmaps in fringe_bmp. (w32_redisplay_interface): Add them to redisplay_interface. (w32_term_init): Call w32_init_fringe instead of explicitly @@ -21476,7 +21476,7 @@ "Emacs built on Windows 9x/ME crashes at startup on Windows XP, or Emacs builtpart of on XP crashes at startup on Windows 9x/ME." - * w32.c: Added wrapper functions around the win32 API functions + * w32.c: Added wrapper functions around the Windows API functions OpenProcessToken, GetTokenInformation, LookupAccountSid, and GetSidIdentifierAuthority. These wrapper functions serve two purposes: @@ -21490,7 +21490,7 @@ the version of advapi32.dll that is found in the 9x branch of Microsoft Windows. - * w32.c (init_user_info): Replace the calls to the win32 API + * w32.c (init_user_info): Replace the calls to the Windows API functions OpenProcessToken, GetTokenInformation, LookupAccountSid, and GetSidIdentifierAuthority with calls to the newly added wrapper functions. === modified file 'src/ChangeLog.11' --- src/ChangeLog.11 2012-04-15 02:59:30 +0000 +++ src/ChangeLog.11 2012-07-29 08:18:29 +0000 @@ -3994,7 +3994,8 @@ 2010-09-24 Juanma Barranquero - Remove W32 API function pointer unused since 2005-02-15 (revno 60055). + Remove Windows API function pointer unused since 2005-02-15 (revno + 60055). * w32fns.c (clipboard_sequence_fn): Don't declare. (globals_of_w32fns): Don't initialize it. === modified file 'src/ChangeLog.6' --- src/ChangeLog.6 2012-04-15 02:59:30 +0000 +++ src/ChangeLog.6 2012-07-29 08:18:29 +0000 @@ -1269,7 +1269,7 @@ "light", "extralight", and "thin" fonts. (x_to_win32_charset, win32_to_x_charset): New functions. (win32_to_x_font): Use new height units. Use win32_to_x_charset. - (x_to_win32_font): Use x_to_win32_charset. Support Win32 font names + (x_to_win32_font): Use x_to_win32_charset. Support w32 font names in addition to X font names. (win32_load_font, Fx_list_fonts, Fx_display_color_cells) @@ -3625,11 +3625,11 @@ * xdisp.c [HAVE_NTGUI] (set_menu_framebar): Declare external. [HAVE_NTGUI] (frame_title_buf, frame_title_ptr): Include variables - for Win32 window system. + for w32 window system. [HAVE_NTGUI] (store_frame_title, x_consider_frame_title): Include - procedures for Win32 window system. - [HAVE_NTGUI] (x_consider_frame_title): Test for Win32 frame. - [HAVE_NTGUI] (display_text_line): Test for Win32 frame on face change. + procedures for w32 window system. + [HAVE_NTGUI] (x_consider_frame_title): Test for w32 frame. + [HAVE_NTGUI] (display_text_line): Test for w32 frame on face change. [HAVE_NTGUI] (display_menu_bar): Perform no-op for NT window system. * window.c [HAVE_NTGUI] (Fset_window_configuration): Set menu @@ -3659,7 +3659,7 @@ (make_lispy_event): Use FUNCTION_KEY_OFFSET to modify event codes before applying modifiers. - * frame.c [HAVE_NTGUI]: Test for a Win32 frame in procedures + * frame.c [HAVE_NTGUI]: Test for a w32 frame in procedures that test for an X frame. * frame.h (output_method): New method: output_win32. @@ -3673,13 +3673,13 @@ * emacs.c [HAVE_NTGUI]: Declare Vwindow_system. [HAVE_NTGUI] (main): Enable inhibit_window_system. Initialize environment from registry. - Declare syms of Win32 windowing modules. + Declare syms of w32 windowing modules. * dispnew.c [HAVE_NTGUI]: Include w32term.h. Include dispextern.h before cm.h since dispextern.h includes windows.h. [HAVE_NTGUI] (make_frame_glyphs, free_frame_glyphs, scroll_frame_lines) - (update_frame, update_line): Test for WIN32 frame. - [HAVE_NTGUI] (init_display): Initialize WIN32 window system. + (update_frame, update_line): Test for w32 frame. + [HAVE_NTGUI] (init_display): Initialize w32 window system. * dispextern.h [HAVE_NTGUI]: Include win32.h. [HAVE_NTGUI] (struct frame_glyphs): Include pixel fields. === modified file 'src/ChangeLog.7' --- src/ChangeLog.7 2012-02-24 19:47:53 +0000 +++ src/ChangeLog.7 2012-07-29 08:18:29 +0000 @@ -2070,7 +2070,7 @@ (sys_select): Ignore children dead children with pending input. Delay sending SIGCHLD until all output has been read. (sys_kill): Sleep to allow focus change events to propagate. - Use TerminateProcess on Win95. + Use TerminateProcess on Windows 95. (int_from_hex, enum_locale_fn, Fw32_get_valid_locale_ids): New functions. (Vw32_valid_locale_ids): New variable. @@ -5719,13 +5719,13 @@ Loop over handles round robin to ensure fairness. (sys_kill): Send ctrl-break and ctrl-c keystrokes to subprocesses on SIGINT if not sharing consoles, otherwise generate ctrl-break event. - On other termination signals, send WM_QUIT message to Win95 apps + On other termination signals, send WM_QUIT message to Windows 95 apps and WM_CLOSE to NT apps. (syms_of_ntproc): Intern new symbols. defsubr new functions. DEFVAR new variables. - * w32term.c (SIF_*): Win95 macros defined for NT. - (struct tagSCROLLINFO): Win95 struct defined for NT. + * w32term.c (SIF_*): Windows 95 macros defined for NT. + (struct tagSCROLLINFO): Windows 95 struct defined for NT. (vertical_scroll_bar_min_handle, vertical_scroll_bar_top_border) (vertical_scroll_bar_bottom_border, last_scroll_bar_drag_pos) (Vw32_gab_focus_on_raise, Vw32_capslock_is_shiftlock): === modified file 'src/ChangeLog.8' --- src/ChangeLog.8 2012-01-19 07:21:25 +0000 +++ src/ChangeLog.8 2012-07-29 08:18:29 +0000 @@ -13203,7 +13203,7 @@ * w32.c (stat): GetFileInformationByHandle can legitimately fail, so don't rely on it succeeding. - * w32fns.c (x_to_w32_font): Specify DEFAULT_CHARSET in the w32 + * w32fns.c (x_to_w32_font): Specify DEFAULT_CHARSET in the Windows LOGFONT struct if x font doesn't specify the charset. (x_to_w32_charset): Change >= to == when testing results of stricmp. === modified file 'src/dbusbind.c' --- src/dbusbind.c 2012-07-27 11:36:36 +0000 +++ src/dbusbind.c 2012-07-29 08:18:29 +0000 @@ -986,7 +986,7 @@ xd_find_watch_fd (DBusWatch *watch) { #if HAVE_DBUS_WATCH_GET_UNIX_FD - /* TODO: Reverse these on Win32, which prefers the opposite. */ + /* TODO: Reverse these on w32, which prefers the opposite. */ int fd = dbus_watch_get_unix_fd (watch); if (fd == -1) fd = dbus_watch_get_socket (watch); === modified file 'src/makefile.w32-in' --- src/makefile.w32-in 2012-07-26 13:59:01 +0000 +++ src/makefile.w32-in 2012-07-29 08:18:29 +0000 @@ -1,4 +1,4 @@ -# -*- Makefile -*- for GNU Emacs on the Microsoft W32 API. +# -*- Makefile -*- for GNU Emacs on the Microsoft Windows API. # Copyright (C) 2000-2012 Free Software Foundation, Inc. # This file is part of GNU Emacs. === modified file 'src/regex.c' --- src/regex.c 2012-07-10 21:48:34 +0000 +++ src/regex.c 2012-07-29 08:18:29 +0000 @@ -1739,20 +1739,6 @@ be too small, many things would have to change. */ # define MAX_BUF_SIZE (1L << 15) -#if 0 /* This is when we thought it could be 2^16 bytes. */ -/* Any other compiler which, like MSC, has allocation limit below 2^16 - bytes will have to use approach similar to what was done below for - MSC and drop MAX_BUF_SIZE a bit. Otherwise you may end up - reallocating to 0 bytes. Such thing is not going to work too well. - You have been warned!! */ -#if defined _MSC_VER && !defined WIN32 -/* Microsoft C 16-bit versions limit malloc to approx 65512 bytes. */ -# define MAX_BUF_SIZE 65500L -#else -# define MAX_BUF_SIZE (1L << 16) -#endif -#endif /* 0 */ - /* Extend the buffer by twice its current size via realloc and reset the pointers that pointed into the old block to point to the correct places in the new one. If extending the buffer results in it === modified file 'src/sound.c' --- src/sound.c 2012-07-16 04:47:31 +0000 +++ src/sound.c 2012-07-29 08:18:29 +0000 @@ -31,7 +31,7 @@ cause an error to be generated. The Windows implementation of play-sound is implemented via the - Win32 API functions mciSendString, waveOutGetVolume, and + Windows API functions mciSendString, waveOutGetVolume, and waveOutSetVolume which are exported by Winmm.dll. */ === modified file 'src/w32.c' --- src/w32.c 2012-07-27 09:24:34 +0000 +++ src/w32.c 2012-07-29 08:18:29 +0000 @@ -1,4 +1,4 @@ -/* Utility and Unix shadow routines for GNU Emacs on the Microsoft W32 API. +/* Utility and Unix shadow routines for GNU Emacs on the Microsoft Windows API. Copyright (C) 1994-1995, 2000-2012 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -2011,7 +2011,7 @@ /* ------------------------------------------------------------------------- */ -/* IO support and wrapper functions for W32 API. */ +/* IO support and wrapper functions for the Windows API. */ /* ------------------------------------------------------------------------- */ /* Place a wrapper around the MSVC version of ctime. It returns NULL @@ -2929,7 +2929,7 @@ /* volume_info is set indirectly by map_w32_filename. */ oldname_dev = volume_info.serialnum; - if (os_subtype == OS_WIN95) + if (os_subtype == OS_WINDOWS_95) { char * o; char * p; === modified file 'src/w32console.c' --- src/w32console.c 2012-07-28 16:57:57 +0000 +++ src/w32console.c 2012-07-29 08:18:29 +0000 @@ -1,4 +1,4 @@ -/* Terminal hooks for GNU Emacs on the Microsoft W32 API. +/* Terminal hooks for GNU Emacs on the Microsoft Windows API. Copyright (C) 1992, 1999, 2001-2012 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -515,7 +515,7 @@ { CONSOLE_CURSOR_INFO cci; - /* make cursor big and visible (100 on Win95 makes it disappear) */ + /* make cursor big and visible (100 on Windows 95 makes it disappear) */ cci.dwSize = 99; cci.bVisible = TRUE; (void) SetConsoleCursorInfo (cur_screen, &cci); === modified file 'src/w32fns.c' --- src/w32fns.c 2012-07-27 09:24:34 +0000 +++ src/w32fns.c 2012-07-29 08:18:29 +0000 @@ -1,4 +1,4 @@ -/* Graphical user interface functions for the Microsoft W32 API. +/* Graphical user interface functions for the Microsoft Windows API. Copyright (C) 1989, 1992-2012 Free Software Foundation, Inc. @@ -6575,7 +6575,7 @@ value = Qnil; /* Determining the required information on Windows turns out, sadly, - to be more involved than one would hope. The original Win32 api + to be more involved than one would hope. The original Windows API call for this will return bogus information on some systems, but we must dynamically probe for the replacement api, since that was added rather late on. */ === modified file 'src/w32font.c' --- src/w32font.c 2012-07-18 10:12:43 +0000 +++ src/w32font.c 2012-07-29 08:18:29 +0000 @@ -1,4 +1,4 @@ -/* Font backend for the Microsoft W32 API. +/* Font backend for the Microsoft Windows API. Copyright (C) 2007-2012 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -292,7 +292,7 @@ Lisp_Object str = DECODE_SYSTEM (build_string (string)); int len = SCHARS (str); Lisp_Object obarray = check_obarray (Vobarray); - Lisp_Object tem = oblookup (obarray, SDATA (str), len, len); + Lisp_Object tem = oblookup (obarray, SDATA (str), len, len); /* This code is similar to intern function from lread.c. */ return SYMBOLP (tem) ? tem : Fintern (str, obarray); } @@ -1394,7 +1394,7 @@ currently appear in fontset.el, so it isn't worth creating a mapping table of codepages/scripts to languages or opening the font to see if there are any language tags - in it that the W32 API does not expose. Fontset + in it that the Windows API does not expose. Fontset spec should have a fallback, as some backends do not recognize language at all. */ return 0; === modified file 'src/w32font.h' --- src/w32font.h 2012-01-19 07:21:25 +0000 +++ src/w32font.h 2012-07-29 08:18:29 +0000 @@ -1,4 +1,4 @@ -/* Shared GDI and Uniscribe Font backend declarations for the W32 API. +/* Shared GDI and Uniscribe Font backend declarations for the Windows API. Copyright (C) 2007-2012 Free Software Foundation, Inc. This file is part of GNU Emacs. === modified file 'src/w32gui.h' --- src/w32gui.h 2012-01-19 07:21:25 +0000 +++ src/w32gui.h 2012-07-29 08:18:29 +0000 @@ -1,4 +1,4 @@ -/* Definitions and headers for communication on the Microsoft W32 API. +/* Definitions and headers for communication on the Microsoft Windows API. Copyright (C) 1995, 2001-2012 Free Software Foundation, Inc. This file is part of GNU Emacs. === modified file 'src/w32heap.c' --- src/w32heap.c 2012-06-13 13:40:48 +0000 +++ src/w32heap.c 2012-07-29 08:18:29 +0000 @@ -1,4 +1,4 @@ -/* Heap management routines for GNU Emacs on the Microsoft W32 API. +/* Heap management routines for GNU Emacs on the Microsoft Windows API. Copyright (C) 1994, 2001-2012 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -66,7 +66,7 @@ w32_minor_version = version.info.minor; if (version.info.platform & 0x8000) - os_subtype = OS_WIN95; + os_subtype = OS_WINDOWS_95; else os_subtype = OS_NT; @@ -79,7 +79,7 @@ GetVersionEx (&osinfo_cache); w32_build_number = osinfo_cache.dwBuildNumber; - if (os_subtype == OS_WIN95) + if (os_subtype == OS_WINDOWS_95) w32_build_number &= 0xffff; } === modified file 'src/w32heap.h' --- src/w32heap.h 2012-01-19 07:21:25 +0000 +++ src/w32heap.h 2012-07-29 08:18:29 +0000 @@ -51,7 +51,7 @@ extern int w32_build_number; enum { - OS_WIN95 = 1, + OS_WINDOWS_95 = 1, OS_NT }; @@ -92,4 +92,3 @@ IMAGE_SECTION_HEADER * rva_to_section (DWORD rva, IMAGE_NT_HEADERS * nt_header); #endif /* NTHEAP_H_ */ - === modified file 'src/w32inevt.c' --- src/w32inevt.c 2012-07-28 16:57:57 +0000 +++ src/w32inevt.c 2012-07-29 08:18:29 +0000 @@ -1,4 +1,4 @@ -/* Input event support for Emacs on the Microsoft W32 API. +/* Input event support for Emacs on the Microsoft Windows API. Copyright (C) 1992-1993, 1995, 2001-2012 Free Software Foundation, Inc. This file is part of GNU Emacs. === modified file 'src/w32inevt.h' --- src/w32inevt.h 2012-07-28 16:57:57 +0000 +++ src/w32inevt.h 2012-07-29 08:18:29 +0000 @@ -1,4 +1,4 @@ -/* Input routines for GNU Emacs on the Microsoft W32 API. +/* Input routines for GNU Emacs on the Microsoft Windows API. Copyright (C) 1995, 2001-2012 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -30,4 +30,3 @@ unsigned long *time); #endif /* EMACS_W32INEVT_H */ - === modified file 'src/w32menu.c' --- src/w32menu.c 2012-07-21 19:26:25 +0000 +++ src/w32menu.c 2012-07-29 08:18:29 +0000 @@ -1,4 +1,4 @@ -/* Menu support for GNU Emacs on the Microsoft W32 API. +/* Menu support for GNU Emacs on the Microsoft Windows API. Copyright (C) 1986, 1988, 1993-1994, 1996, 1998-1999, 2001-2012 Free Software Foundation, Inc. === modified file 'src/w32proc.c' --- src/w32proc.c 2012-06-30 15:55:27 +0000 +++ src/w32proc.c 2012-07-29 08:18:29 +0000 @@ -1,4 +1,4 @@ -/* Process support for GNU Emacs on the Microsoft W32 API. +/* Process support for GNU Emacs on the Microsoft Windows API. Copyright (C) 1992, 1995, 1999-2012 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -799,7 +799,7 @@ unixtodos_filename (cmdname); argv[0] = cmdname; - /* Determine whether program is a 16-bit DOS executable, or a w32 + /* Determine whether program is a 16-bit DOS executable, or a 32-bit Windows executable that is implicitly linked to the Cygnus dll (implying it was compiled with the Cygnus GNU toolchain and hence relies on cygwin.dll to parse the command line - we use this to decide how to @@ -1386,7 +1386,7 @@ GetClassName (hwnd, window_class, sizeof (window_class)); if (strcmp (window_class, - (os_subtype == OS_WIN95) + (os_subtype == OS_WINDOWS_95) ? "tty" : "ConsoleWindowClass") == 0) { @@ -1517,7 +1517,7 @@ if (NILP (Vw32_start_process_share_console) && cp && cp->hwnd) { #if 1 - if (os_subtype == OS_WIN95) + if (os_subtype == OS_WINDOWS_95) { /* Another possibility is to try terminating the VDM out-right by @@ -1536,7 +1536,7 @@ */ #if 0 - /* On Win95, posting WM_QUIT causes the 16-bit subsystem + /* On Windows 95, posting WM_QUIT causes the 16-bit subsystem to hang when cmdproxy is used in conjunction with command.com for an interactive shell. Posting WM_CLOSE pops up a dialog that, when Yes is selected, @@ -1810,7 +1810,7 @@ CHECK_NUMBER (process); /* Allow pid to be an internally generated one, or one obtained - externally. This is necessary because real pids on Win95 are + externally. This is necessary because real pids on Windows 95 are negative. */ pid = XINT (process); === modified file 'src/w32select.c' --- src/w32select.c 2012-07-05 06:32:41 +0000 +++ src/w32select.c 2012-07-29 08:18:29 +0000 @@ -1,4 +1,4 @@ -/* Selection processing for Emacs on the Microsoft W32 API. +/* Selection processing for Emacs on the Microsoft Windows API. Copyright (C) 1993-1994, 2001-2012 Free Software Foundation, Inc. === modified file 'src/w32term.c' --- src/w32term.c 2012-07-05 06:32:41 +0000 +++ src/w32term.c 2012-07-29 08:18:29 +0000 @@ -1,4 +1,4 @@ -/* Implementation of GUI terminal on the Microsoft W32 API. +/* Implementation of GUI terminal on the Microsoft Windows API. Copyright (C) 1989, 1993-2012 Free Software Foundation, Inc. === modified file 'src/w32term.h' --- src/w32term.h 2012-07-03 18:24:42 +0000 +++ src/w32term.h 2012-07-29 08:18:29 +0000 @@ -1,4 +1,4 @@ -/* Definitions and headers for communication on the Microsoft W32 API. +/* Definitions and headers for communication on the Microsoft Windows API. Copyright (C) 1995, 2001-2012 Free Software Foundation, Inc. This file is part of GNU Emacs. === modified file 'src/w32xfns.c' --- src/w32xfns.c 2012-01-19 07:21:25 +0000 +++ src/w32xfns.c 2012-07-29 08:18:29 +0000 @@ -1,4 +1,4 @@ -/* Functions taken directly from X sources for use with the Microsoft W32 API. +/* Functions taken directly from X sources for use with the Microsoft Windows API. Copyright (C) 1989, 1992-1995, 1999, 2001-2012 Free Software Foundation, Inc. This file is part of GNU Emacs. ------------------------------------------------------------ revno: 109256 fixes bug(s): http://debbugs.gnu.org/10150 committer: Paul Eggert branch nick: trunk timestamp: Sun 2012-07-29 00:16:45 -0700 message: deactive->inactive, inactivate->deactivate spelling fixes (Bug#10150) * NEWS: Document these changes. * leim/quail/uni-input.el (ucs-input-deactivate): Rename from ucs-input-inactivate. * leim/quail/hangul.el (hangul-input-method-deactivate): Rename from hangul-input-method-inactivate. * emulation/viper-init.el (viper-deactivate-input-method-action): Rename from viper-inactivate-input-method-action. (viper-deactivate-input-method): Rename from viper-inactivate-input-method. * lisp/follow.el (follow-inactive-menu): Rename from follow-deactive-menu. * lisp/international/mule-cmds.el (deactivate-input-method): Rename from inactivate-input-method. Also run input-method-deactivate-hook. (deactivate-current-input-method-function): Rename from inactivate-current-input-method-function. (input-method-deactivate-hook): New hook. (input-method-inactivate-hook): Mark obsolete. * lisp/international/quail.el (quail-activate): Also run quail-deactivate-hook. (quail-deactivate): Rename from quail-inactivate. * lisp/international/robin.el (robin-activate): Also run robin-deactivate-hook. (robin-deactivate): Rename from robin-inactivate. diff: === modified file 'doc/lispref/hooks.texi' --- doc/lispref/hooks.texi 2012-05-27 01:34:14 +0000 +++ doc/lispref/hooks.texi 2012-07-29 07:16:45 +0000 @@ -243,10 +243,10 @@ completion-at-point-functions completion-in-region-functions completion-list-insert-choice-function +deactivate-current-input-method-function describe-current-input-method-function filter-buffer-substring-functions font-lock-function -inactivate-current-input-method-function menu-bar-select-buffer-function read-file-name-function replace-re-search-function === modified file 'etc/ChangeLog' --- etc/ChangeLog 2012-07-28 16:35:52 +0000 +++ etc/ChangeLog 2012-07-29 07:16:45 +0000 @@ -1,3 +1,8 @@ +2012-07-29 Paul Eggert + + deactive->inactive, inactivate->deactivate spelling fixes (Bug#10150) + * NEWS: Document these changes. + 2012-07-28 Juanma Barranquero * NEWS: Fix typo. === modified file 'etc/NEWS' --- etc/NEWS 2012-07-29 00:03:26 +0000 +++ etc/NEWS 2012-07-29 07:16:45 +0000 @@ -499,6 +499,35 @@ but keywords or keyword-string pairs. The old argument list will still be supported for Emacs 24.x. +** Spelling changes. +Some Lisp symbols have been renamed to avoid problems with spelling +that is incorrect or inconsistent with how Emacs normally spells a word. + +*** Renamed functions + +**** hangul-input-method-inactivate -> hangul-input-method-deactivate +**** inactivate-input-method -> deactivate-input-method +**** quail-inactivate -> quail-deactivate +**** robin-inactivate -> robin-deactivate +**** viper-inactivate-input-method -> viper-deactivate-input-method +**** viper-inactivate-input-method-action -> + viper-deactivate-input-method-action +**** ucs-input-inactivate -> ucs-input-deactivate + +*** Renamed hooks +The old hooks are still supported for backward compatibility, but they +are deprecated and will be removed eventually. + +**** input-method-inactivate-hook -> input-method-deactivate-hook +**** robin-inactivate-hook -> robin-deactivate-hook +**** quail-inactivate-hook -> quail-deactivate-hook + +*** Renamed Lisp variables + +**** follow-deactive-menu -> follow-inactive-menu +**** inactivate-current-input-method-function -> + deactivate-current-input-method-function + ** The following obsolete variables and varaliases have been removed: *** `facemenu-unlisted-faces' === modified file 'leim/ChangeLog' --- leim/ChangeLog 2012-07-10 11:51:54 +0000 +++ leim/ChangeLog 2012-07-29 07:16:45 +0000 @@ -1,3 +1,11 @@ +2012-07-29 Paul Eggert + + deactive->inactive, inactivate->deactivate spelling fixes (Bug#10150) + * quail/uni-input.el (ucs-input-deactivate): + Rename from ucs-input-inactivate. + * quail/hangul.el (hangul-input-method-deactivate): + Rename from hangul-input-method-inactivate. + 2012-07-10 Stefan Monnier * quail/ipa.el: Use cl-lib. === modified file 'leim/quail/hangul.el' --- leim/quail/hangul.el 2012-07-10 11:51:54 +0000 +++ leim/quail/hangul.el 2012-07-29 07:16:45 +0000 @@ -512,7 +512,7 @@ "Activate Hangul input method INPUT-METHOD. FUNC is a function to handle input key. HELP-TEXT is a text set in `hangul-input-method-help-text'." - (setq inactivate-current-input-method-function 'hangul-input-method-inactivate + (setq deactivate-current-input-method-function 'hangul-input-method-deactivate describe-current-input-method-function 'hangul-input-method-help hangul-input-method-help-text help-text) (quail-delete-overlays) @@ -520,8 +520,8 @@ (add-hook 'minibuffer-exit-hook 'quail-exit-from-minibuffer)) (set (make-local-variable 'input-method-function) func)) -(defun hangul-input-method-inactivate () - "Inactivate the current Hangul input method." +(defun hangul-input-method-deactivate () + "Deactivate the current Hangul input method." (interactive) (unwind-protect (progn @@ -530,6 +530,10 @@ (setq describe-current-input-method-function nil)) (kill-local-variable 'input-method-function))) +(define-obsolete-function-alias + 'hangul-input-method-inactivate + 'hangul-input-method-deactivate "24.2") + (defun hangul-input-method-help () "Describe the current Hangul input method." (interactive) === modified file 'leim/quail/uni-input.el' --- leim/quail/uni-input.el 2012-01-19 07:21:25 +0000 +++ leim/quail/uni-input.el 2012-07-29 07:16:45 +0000 @@ -99,7 +99,7 @@ (quail-delete-overlays) (setq describe-current-input-method-function nil)) (kill-local-variable 'input-method-function)) - (setq inactivate-current-input-method-function 'ucs-input-inactivate) + (setq deactivate-current-input-method-function 'ucs-input-deactivate) (setq describe-current-input-method-function 'ucs-input-help) (quail-delete-overlays) (if (eq (selected-window) (minibuffer-window)) @@ -107,11 +107,15 @@ (set (make-local-variable 'input-method-function) 'ucs-input-method))) -(defun ucs-input-inactivate () - "Inactivate UCS input method." +(defun ucs-input-deactivate () + "Deactivate UCS input method." (interactive) (ucs-input-activate -1)) +(define-obsolete-function-alias + 'ucs-input-inactivate + 'ucs-input-deactivate "24.2") + (defun ucs-input-help () (interactive) (with-output-to-temp-buffer "*Help*" === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-29 04:45:48 +0000 +++ lisp/ChangeLog 2012-07-29 07:16:45 +0000 @@ -1,3 +1,25 @@ +2012-07-29 Paul Eggert + + deactive->inactive, inactivate->deactivate spelling fixes (Bug#10150) + * emulation/viper-init.el (viper-deactivate-input-method-action): + Rename from viper-inactivate-input-method-action. + (viper-deactivate-input-method): + Rename from viper-inactivate-input-method. + * follow.el (follow-inactive-menu): Rename from follow-deactive-menu. + * international/mule-cmds.el (deactivate-input-method): + Rename from inactivate-input-method. + Also run input-method-deactivate-hook. + (deactivate-current-input-method-function): + Rename from inactivate-current-input-method-function. + (input-method-deactivate-hook): New hook. + (input-method-inactivate-hook): Mark obsolete. + * international/quail.el (quail-activate): + Also run quail-deactivate-hook. + (quail-deactivate): Rename from quail-inactivate. + * international/robin.el (robin-activate): + Also run robin-deactivate-hook. + (robin-deactivate): Rename from robin-inactivate. + 2012-07-29 Chong Yidong * simple.el (indicate-copied-region): New function. === modified file 'lisp/emulation/viper-init.el' --- lisp/emulation/viper-init.el 2012-04-09 13:05:48 +0000 +++ lisp/emulation/viper-init.el 2012-07-29 07:16:45 +0000 @@ -316,7 +316,7 @@ )) ;; viper hook to run on input-method deactivation -(defun viper-inactivate-input-method-action () +(defun viper-deactivate-input-method-action () (if (null viper-mule-hook-flag) () (setq viper-special-input-method nil) @@ -328,9 +328,9 @@ (or current-input-method default-input-method)) ""))))) -(defun viper-inactivate-input-method () - (cond ((and (featurep 'emacs) (fboundp 'inactivate-input-method)) - (inactivate-input-method)) +(defun viper-deactivate-input-method () + (cond ((and (featurep 'emacs) (fboundp 'deactivate-input-method)) + (deactivate-input-method)) ((and (featurep 'xemacs) (boundp 'current-input-method)) ;; XEmacs had broken quail-mode for some time, so we are working around ;; it here @@ -339,7 +339,9 @@ (quail-delete-overlays)) (setq describe-current-input-method-function nil) (setq current-input-method nil) - (run-hooks 'input-method-inactivate-hook) + (run-hooks + 'input-method-inactivate-hook ; for backward compatibility + 'input-method-deactivate-hook) (force-mode-line-update)) )) (defun viper-activate-input-method () @@ -356,7 +358,7 @@ ;; activate input method (viper-activate-input-method)) (t ; deactivate input method - (viper-inactivate-input-method))) + (viper-deactivate-input-method))) )) === modified file 'lisp/emulation/viper.el' --- lisp/emulation/viper.el 2012-07-25 05:48:19 +0000 +++ lisp/emulation/viper.el 2012-07-29 07:16:45 +0000 @@ -971,9 +971,9 @@ (if (featurep 'emacs) (eval-after-load "mule-cmds" '(progn - (defadvice inactivate-input-method (after viper-mule-advice activate) + (defadvice deactivate-input-method (after viper-mule-advice activate) "Set viper-special-input-method to disable intl. input methods." - (viper-inactivate-input-method-action)) + (viper-deactivate-input-method-action)) (defadvice activate-input-method (after viper-mule-advice activate) "Set viper-special-input-method to enable intl. input methods." (viper-activate-input-method-action)) @@ -985,14 +985,14 @@ '(progn (add-hook 'input-method-activate-hook 'viper-activate-input-method-action t) - (add-hook 'input-method-inactivate-hook - 'viper-inactivate-input-method-action t))) + (add-hook 'input-method-deactivate-hook + 'viper-deactivate-input-method-action t))) ) (eval-after-load "mule-cmds" '(defadvice toggle-input-method (around viper-mule-advice activate) "Adjust input-method toggling in vi-state." (if (and viper-special-input-method (eq viper-current-state 'vi-state)) - (viper-inactivate-input-method) + (viper-deactivate-input-method) ad-do-it))) ) ; viper-set-hooks === modified file 'lisp/follow.el' --- lisp/follow.el 2012-05-04 05:14:14 +0000 +++ lisp/follow.el 2012-07-29 07:16:45 +0000 @@ -334,8 +334,8 @@ (defvar follow-active-menu nil "The menu visible when Follow mode is active.") -(defvar follow-deactive-menu nil - "The menu visible when Follow mode is deactivated.") +(defvar follow-inactive-menu nil + "The menu visible when Follow mode is inactive.") (defvar follow-inside-post-command-hook nil "Non-nil when inside Follow modes `post-command-hook'. === modified file 'lisp/international/mule-cmds.el' --- lisp/international/mule-cmds.el 2012-07-28 16:57:57 +0000 +++ lisp/international/mule-cmds.el 2012-07-29 07:16:45 +0000 @@ -92,7 +92,7 @@ (bindings--define-key map [set-keyboard-coding-system] '(menu-item "For Keyboard" set-keyboard-coding-system :help "How to decode keyboard input")) - + (bindings--define-key map [separator-2] menu-bar-separator) (bindings--define-key map [set-file-name-coding-system] '(menu-item "For File Name" set-file-name-coding-system @@ -128,7 +128,7 @@ `(menu-item "Describe Language Environment" ,describe-language-environment-map :help "Show multilingual settings for a specific language")) - + (bindings--define-key map [separator-coding-system] menu-bar-separator) (bindings--define-key map [view-hello-file] '(menu-item "Show Multilingual Sample Text" view-hello-file @@ -1331,15 +1331,15 @@ (make-variable-buffer-local 'input-method-history) (put 'input-method-history 'permanent-local t) -(defvar inactivate-current-input-method-function nil - "Function to call for inactivating the current input method. +(defvar deactivate-current-input-method-function nil + "Function to call for deactivating the current input method. Every input method should set this to an appropriate value when activated. This function is called with no argument. This function should never change the value of `current-input-method'. -It is set to nil by the function `inactivate-input-method'.") -(make-variable-buffer-local 'inactivate-current-input-method-function) -(put 'inactivate-current-input-method-function 'permanent-local t) +It is set to nil by the function `deactivate-input-method'.") +(make-variable-buffer-local 'deactivate-current-input-method-function) +(put 'deactivate-current-input-method-function 'permanent-local t) (defvar describe-current-input-method-function nil "Function to call for describing the current input method. @@ -1426,7 +1426,7 @@ (setq input-method (symbol-name input-method))) (if (and current-input-method (not (string= current-input-method input-method))) - (inactivate-input-method)) + (deactivate-input-method)) (unless (or current-input-method (null input-method)) (let ((slot (assoc input-method input-method-alist))) (if (null slot) @@ -1447,7 +1447,7 @@ (run-hooks 'input-method-activate-hook) (force-mode-line-update))))) -(defun inactivate-input-method () +(defun deactivate-input-method () "Turn off the current input method." (when current-input-method (if input-method-history @@ -1460,9 +1460,11 @@ (progn (setq input-method-function nil current-input-method-title nil) - (funcall inactivate-current-input-method-function)) + (funcall deactivate-current-input-method-function)) (unwind-protect - (run-hooks 'input-method-inactivate-hook) + (run-hooks + 'input-method-inactivate-hook ; for backward compatibility + 'input-method-deactivate-hook) (setq current-input-method nil) (force-mode-line-update))))) @@ -1476,7 +1478,7 @@ which marks the variable `default-input-method' as set for Custom buffers. To deactivate the input method interactively, use \\[toggle-input-method]. -To deactivate it programmatically, use `inactivate-input-method'." +To deactivate it programmatically, use `deactivate-input-method'." (interactive (let* ((default (or (car input-method-history) default-input-method))) (list (read-input-method-name @@ -1513,7 +1515,7 @@ (if toggle-input-method-active (error "Recursive use of `toggle-input-method'")) (if (and current-input-method (not arg)) - (inactivate-input-method) + (deactivate-input-method) (let ((toggle-input-method-active t) (default (or (car input-method-history) default-input-method))) (if (and arg default (equal current-input-method default) @@ -1640,13 +1642,18 @@ :type 'hook :group 'mule) -(defcustom input-method-inactivate-hook nil - "Normal hook run just after an input method is inactivated. +(define-obsolete-variable-alias + 'input-method-inactivate-hook + 'input-method-deactivate-hook "24.2") + +(defcustom input-method-deactivate-hook nil + "Normal hook run just after an input method is deactivated. The variable `current-input-method' still keeps the input method name -just inactivated." +just deactivated." :type 'hook - :group 'mule) + :group 'mule + :version "24.2") (defcustom input-method-after-insert-chunk-hook nil "Normal hook run just after an input method insert some chunk of text." === modified file 'lisp/international/quail.el' --- lisp/international/quail.el 2012-07-10 11:51:54 +0000 +++ lisp/international/quail.el 2012-07-29 07:16:45 +0000 @@ -540,32 +540,36 @@ (if (and (overlayp quail-conv-overlay) (overlay-start quail-conv-overlay)) (delete-overlay quail-conv-overlay))) -(defun quail-inactivate () - "Inactivate Quail input method. +(defun quail-deactivate () + "Deactivate Quail input method. -This function runs the normal hook `quail-inactivate-hook'." +This function runs the normal hook `quail-deactivate-hook'." (interactive) (quail-activate -1)) +(define-obsolete-function-alias 'quail-inactivate 'quail-deactivate "24.2") + (defun quail-activate (&optional arg) "Activate Quail input method. With ARG, activate Quail input method if and only if arg is positive. This function runs `quail-activate-hook' if it activates the input -method, `quail-inactivate-hook' if it deactivates it. +method, `quail-deactivate-hook' if it deactivates it. While this input method is active, the variable `input-method-function' is bound to the function `quail-input-method'." (if (and arg (< (prefix-numeric-value arg) 0)) - ;; Let's inactivate Quail input method. + ;; Let's deactivate Quail input method. (unwind-protect (progn (quail-delete-overlays) (setq describe-current-input-method-function nil) (quail-hide-guidance) (remove-hook 'post-command-hook 'quail-show-guidance t) - (run-hooks 'quail-inactivate-hook)) + (run-hooks + 'quail-inactivate-hook ; for backward compatibility + 'quail-deactivate-hook)) (kill-local-variable 'input-method-function)) ;; Let's activate Quail input method. (if (null quail-current-package) @@ -575,7 +579,7 @@ (setq name (car (car quail-package-alist))) (error "No Quail package loaded")) (quail-select-package name))) - (setq inactivate-current-input-method-function 'quail-inactivate) + (setq deactivate-current-input-method-function 'quail-deactivate) (setq describe-current-input-method-function 'quail-help) (quail-delete-overlays) (setq quail-guidance-str "") @@ -589,8 +593,12 @@ (make-local-variable 'input-method-function) (setq input-method-function 'quail-input-method))) +(define-obsolete-variable-alias + 'quail-inactivate-hook + 'quail-deactivate-hook "24.2") + (defun quail-exit-from-minibuffer () - (inactivate-input-method) + (deactivate-input-method) (if (<= (minibuffer-depth) 1) (remove-hook 'minibuffer-exit-hook 'quail-exit-from-minibuffer))) === modified file 'lisp/international/robin.el' --- lisp/international/robin.el 2012-06-02 10:56:09 +0000 +++ lisp/international/robin.el 2012-07-29 07:16:45 +0000 @@ -390,12 +390,14 @@ (setq robin-current-package-name name) (robin-activate))) -(defun robin-inactivate () - "Inactivate robin input method." +(defun robin-deactivate () + "Deactivate robin input method." (interactive) (robin-activate -1)) +(define-obsolete-function-alias 'robin-inactivate 'robin-deactivate "24.2") + (defun robin-activate (&optional arg) "Activate robin input method. @@ -406,18 +408,20 @@ (if (and arg (< (prefix-numeric-value arg) 0)) - ;; inactivate robin input method. + ;; deactivate robin input method. (unwind-protect (progn (setq robin-mode nil) (setq describe-current-input-method-function nil) - (run-hooks 'robin-inactivate-hook)) + (run-hooks + 'robin-inactivate-hook ; for backward compatibility + 'robin-deactivate-hook)) (kill-local-variable 'input-method-function)) ;; activate robin input method. (setq robin-mode t describe-current-input-method-function 'robin-help - inactivate-current-input-method-function 'robin-inactivate) + deactivate-current-input-method-function 'robin-deactivate) (if (eq (selected-window) (minibuffer-window)) (add-hook 'minibuffer-exit-hook 'robin-exit-from-minibuffer)) (run-hooks 'input-method-activate-hook @@ -425,8 +429,12 @@ (set (make-local-variable 'input-method-function) 'robin-input-method))) +(define-obsolete-variable-alias + 'robin-inactivate-hook + 'robin-deactivate-hook "24.2") + (defun robin-exit-from-minibuffer () - (inactivate-input-method) + (deactivate-input-method) (if (<= (minibuffer-depth) 1) (remove-hook 'minibuffer-exit-hook 'robin-exit-from-minibuffer))) === modified file 'lisp/language/korea-util.el' --- lisp/language/korea-util.el 2012-04-09 13:05:48 +0000 +++ lisp/language/korea-util.el 2012-07-29 07:16:45 +0000 @@ -41,7 +41,7 @@ "Turn on or off a Korean text input method for the current buffer." (interactive) (if current-input-method - (inactivate-input-method) + (deactivate-input-method) (activate-input-method (concat "korean-hangul" default-korean-keyboard)))) === modified file 'lisp/mail/sendmail.el' --- lisp/mail/sendmail.el 2012-05-27 01:06:44 +0000 +++ lisp/mail/sendmail.el 2012-07-29 07:16:45 +0000 @@ -616,7 +616,7 @@ ;; (kill-local-variable 'enable-multibyte-characters) (set-buffer-multibyte (default-value 'enable-multibyte-characters)) (if current-input-method - (inactivate-input-method)) + (deactivate-input-method)) ;; Local variables for Mail mode. (setq mail-send-actions actions) ------------------------------------------------------------ revno: 109255 fixes bug(s): http://debbugs.gnu.org/10056 committer: Chong Yidong branch nick: trunk timestamp: Sun 2012-07-29 12:45:48 +0800 message: Deactivate the mark on more copy operations, and indicate the copied region. * lisp/simple.el (indicate-copied-region): New function. (kill-ring-save): Split off from here. * lisp/rect.el (copy-rectangle-as-kill): Call indicate-copied-region. (kill-rectangle): Set deactivate-mark to t on read-only error. * lisp/register.el (copy-to-register, copy-rectangle-to-register): Deactivate the mark, and use indicate-copied-region. (append-to-register, prepend-to-register): Call diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-29 00:03:26 +0000 +++ lisp/ChangeLog 2012-07-29 04:45:48 +0000 @@ -1,3 +1,15 @@ +2012-07-29 Chong Yidong + + * simple.el (indicate-copied-region): New function. + (kill-ring-save): Split off from here. + + * rect.el (copy-rectangle-as-kill): Call indicate-copied-region. + (kill-rectangle): Set deactivate-mark to t on read-only error. + + * register.el (copy-to-register, copy-rectangle-to-register): + Deactivate the mark, and use indicate-copied-region (Bug#10056). + (append-to-register, prepend-to-register): Call + 2012-07-29 Juri Linkov * simple.el (async-shell-command-buffer): New defcustom. === modified file 'lisp/rect.el' --- lisp/rect.el 2012-07-14 02:19:07 +0000 +++ lisp/rect.el 2012-07-29 04:45:48 +0000 @@ -219,6 +219,7 @@ (condition-case nil (setq killed-rectangle (delete-extract-rectangle start end fill)) ((buffer-read-only text-read-only) + (setq deactivate-mark t) (setq killed-rectangle (extract-rectangle start end)) (if kill-read-only-ok (progn (message "Read only text copied to kill ring") nil) @@ -230,7 +231,9 @@ "Copy the region-rectangle and save it as the last killed one." (interactive "r") (setq killed-rectangle (extract-rectangle start end)) - (setq deactivate-mark t)) + (setq deactivate-mark t) + (if (called-interactively-p 'interactive) + (indicate-copied-region (length (car killed-rectangle))))) ;;;###autoload (defun yank-rectangle () === modified file 'lisp/register.el' --- lisp/register.el 2012-07-14 02:19:07 +0000 +++ lisp/register.el 2012-07-29 04:45:48 +0000 @@ -336,7 +336,11 @@ START and END are buffer positions indicating what to copy." (interactive "cCopy to register: \nr\nP") (set-register register (filter-buffer-substring start end)) - (if delete-flag (delete-region start end))) + (setq deactivate-mark t) + (cond (delete-flag + (delete-region start end)) + ((called-interactively-p 'interactive) + (indicate-copied-region)))) (defun append-to-register (register start end &optional delete-flag) "Append region to text in register REGISTER. @@ -350,7 +354,10 @@ register (cond ((not reg) text) ((stringp reg) (concat reg text)) (t (error "Register does not contain text"))))) - (if delete-flag (delete-region start end))) + (cond (delete-flag + (delete-region start end)) + ((called-interactively-p 'interactive) + (indicate-copied-region)))) (defun prepend-to-register (register start end &optional delete-flag) "Prepend region to text in register REGISTER. @@ -364,7 +371,10 @@ register (cond ((not reg) text) ((stringp reg) (concat text reg)) (t (error "Register does not contain text"))))) - (if delete-flag (delete-region start end))) + (cond (delete-flag + (delete-region start end)) + ((called-interactively-p 'interactive) + (indicate-copied-region)))) (defun copy-rectangle-to-register (register start end &optional delete-flag) "Copy rectangular region into register REGISTER. @@ -374,10 +384,15 @@ Called from a program, takes four args: REGISTER, START, END and DELETE-FLAG. START and END are buffer positions giving two corners of rectangle." (interactive "cCopy rectangle to register: \nr\nP") - (set-register register - (if delete-flag - (delete-extract-rectangle start end) - (extract-rectangle start end)))) + (let ((rectangle (if delete-flag + (delete-extract-rectangle start end) + (extract-rectangle start end)))) + (set-register register rectangle) + (when (and (null delete-flag) + (called-interactively-p 'interactive)) + (setq deactivate-mark t) + (indicate-copied-region (length (car rectangle)))))) + (provide 'register) ;;; register.el ends here === modified file 'lisp/simple.el' --- lisp/simple.el 2012-07-29 00:03:26 +0000 +++ lisp/simple.el 2012-07-29 04:45:48 +0000 @@ -3408,38 +3408,50 @@ visual feedback indicating the extent of the region being copied." (interactive "r") (copy-region-as-kill beg end) - ;; This use of called-interactively-p is correct - ;; because the code it controls just gives the user visual feedback. + ;; This use of called-interactively-p is correct because the code it + ;; controls just gives the user visual feedback. (if (called-interactively-p 'interactive) - (let ((other-end (if (= (point) beg) end beg)) - (opoint (point)) - ;; Inhibit quitting so we can make a quit here - ;; look like a C-g typed as a command. - (inhibit-quit t)) - (if (pos-visible-in-window-p other-end (selected-window)) - ;; Swap point-and-mark quickly so as to show the region that - ;; was selected. Don't do it if the region is highlighted. - (unless (and (region-active-p) - (face-background 'region)) - ;; Swap point and mark. - (set-marker (mark-marker) (point) (current-buffer)) - (goto-char other-end) - (sit-for blink-matching-delay) - ;; Swap back. - (set-marker (mark-marker) other-end (current-buffer)) - (goto-char opoint) - ;; If user quit, deactivate the mark - ;; as C-g would as a command. - (and quit-flag mark-active - (deactivate-mark))) - (let* ((killed-text (current-kill 0)) - (message-len (min (length killed-text) 40))) - (if (= (point) beg) - ;; Don't say "killed"; that is misleading. - (message "Saved text until \"%s\"" - (substring killed-text (- message-len))) - (message "Saved text from \"%s\"" - (substring killed-text 0 message-len)))))))) + (indicate-copied-region))) + +(defun indicate-copied-region (&optional message-len) + "Indicate that the region text has been copied interactively. +If the mark is visible in the selected window, blink the cursor +between point and mark if there is currently no active region +highlighting. + +If the mark lies outside the selected window, display an +informative message containing a sample of the copied text. The +optional argument MESSAGE-LEN, if non-nil, specifies the length +of this sample text; it defaults to 40." + (let ((mark (mark t)) + (point (point)) + ;; Inhibit quitting so we can make a quit here + ;; look like a C-g typed as a command. + (inhibit-quit t)) + (if (pos-visible-in-window-p mark (selected-window)) + ;; Swap point-and-mark quickly so as to show the region that + ;; was selected. Don't do it if the region is highlighted. + (unless (and (region-active-p) + (face-background 'region)) + ;; Swap point and mark. + (set-marker (mark-marker) (point) (current-buffer)) + (goto-char mark) + (sit-for blink-matching-delay) + ;; Swap back. + (set-marker (mark-marker) mark (current-buffer)) + (goto-char point) + ;; If user quit, deactivate the mark + ;; as C-g would as a command. + (and quit-flag mark-active + (deactivate-mark))) + (let ((len (min (abs (- mark point)) + (or message-len 40)))) + (if (< point mark) + ;; Don't say "killed"; that is misleading. + (message "Saved text until \"%s\"" + (buffer-substring-no-properties (- mark len) mark)) + (message "Saved text from \"%s\"" + (buffer-substring-no-properties mark (+ mark len)))))))) (defun append-next-kill (&optional interactive) "Cause following command, if it kills, to append to previous kill.