X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/87795686a9e8ea51ec492d01d7dce4698b14f3af..c4e8cde8c6cea5ab85abbac10626bd5c1fe5a6af:/src/editfns.c diff --git a/src/editfns.c b/src/editfns.c index 59e57565d4..2fa6ffcca5 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -1,6 +1,7 @@ /* Lisp functions pertaining to editing. - Copyright (C) 1985,86,87,89,93,94,95,96,97,98,1999,2000,01,02,03,2004 - Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1989, 1993, 1994, 1995, 1996, + 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -16,17 +17,15 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #include #include #include -#ifdef VMS -#include "vms-pwd.h" -#else +#ifdef HAVE_PWD_H #include #endif @@ -2683,7 +2682,7 @@ Both characters must have the same length of multi-byte form. */) { len = CHAR_STRING (XFASTINT (fromchar), fromstr); if (CHAR_STRING (XFASTINT (tochar), tostr) != len) - error ("Characters in subst-char-in-region have different byte-lengths"); + error ("Characters in `subst-char-in-region' have different byte-lengths"); if (!ASCII_BYTE_P (*tostr)) { /* If *TOSTR is in the range 0x80..0x9F and TOCHAR is not a @@ -2944,6 +2943,8 @@ It returns the number of characters changed. */) { if (tt) { + /* Reload as signal_after_change in last iteration may GC. */ + tt = SDATA (table); if (string_multibyte) { str = tt + string_char_to_byte (table, oc); @@ -3251,10 +3252,11 @@ The message also goes into the `*Messages*' buffer. The first argument is a format control string, and the rest are data to be formatted under control of the string. See `format' for details. -If the first argument is nil, the function clears any existing message; -this lets the minibuffer contents show. See also `current-message'. +If the first argument is nil or the empty string, the function clears +any existing message; this lets the minibuffer contents show. See +also `current-message'. -usage: (message STRING &rest ARGS) */) +usage: (message FORMAT-STRING &rest ARGS) */) (nargs, args) int nargs; Lisp_Object *args; @@ -3281,10 +3283,10 @@ If a dialog box is not available, use the echo area. The first argument is a format control string, and the rest are data to be formatted under control of the string. See `format' for details. -If the first argument is nil, clear any existing message; let the -minibuffer contents show. +If the first argument is nil or the empty string, clear any existing +message; let the minibuffer contents show. -usage: (message-box STRING &rest ARGS) */) +usage: (message-box FORMAT-STRING &rest ARGS) */) (nargs, args) int nargs; Lisp_Object *args; @@ -3309,7 +3311,7 @@ usage: (message-box STRING &rest ARGS) */) pane = Fcons (Fcons (build_string ("OK"), Qt), Qnil); GCPRO1 (pane); menu = Fcons (val, pane); - obj = Fx_popup_dialog (Qt, menu); + obj = Fx_popup_dialog (Qt, menu, Qt); UNGCPRO; return val; } @@ -3343,10 +3345,10 @@ Otherwise, use the echo area. The first argument is a format control string, and the rest are data to be formatted under control of the string. See `format' for details. -If the first argument is nil, clear any existing message; let the -minibuffer contents show. +If the first argument is nil or the empty string, clear any existing +message; let the minibuffer contents show. -usage: (message-or-box STRING &rest ARGS) */) +usage: (message-or-box FORMAT-STRING &rest ARGS) */) (nargs, args) int nargs; Lisp_Object *args; @@ -3393,10 +3395,7 @@ usage: (propertize STRING &rest PROPERTIES) */) string = Fcopy_sequence (args[0]); for (i = 1; i < nargs; i += 2) - { - CHECK_SYMBOL (args[i]); - properties = Fcons (args[i], Fcons (args[i + 1], properties)); - } + properties = Fcons (args[i], Fcons (args[i + 1], properties)); Fadd_text_properties (make_number (0), make_number (SCHARS (string)), @@ -3414,8 +3413,8 @@ usage: (propertize STRING &rest PROPERTIES) */) : SBYTES (STRING)) DEFUN ("format", Fformat, Sformat, 1, MANY, 0, - doc: /* Format a string out of a control-string and arguments. -The first argument is a control string. + doc: /* Format a string out of a format-string and arguments. +The first argument is a format control string. The other arguments are substituted into it to make the result, a string. It may contain %-sequences meaning to substitute the next argument. %s means print a string argument. Actually, prints any object, with `princ'. @@ -3557,7 +3556,9 @@ usage: (format STRING &rest OBJECTS) */) digits to print after the '.' for floats, or the max. number of chars to print from a string. */ - while (index ("-0# ", *format)) + while (format != end + && (*format == '-' || *format == '0' || *format == '#' + || * format == ' ')) ++format; if (*format >= '0' && *format <= '9')