return (region_limit (0));
}
-#if 0 /* now in lisp code */
-DEFUN ("mark", Fmark, Smark, 0, 0, 0,
- "Return this buffer's mark value as integer, or nil if no mark.\n\
-If you are using this in an editing command, you are most likely making\n\
-a mistake; see the documentation of `set-mark'.")
- ()
-{
- return Fmarker_position (current_buffer->mark);
-}
-#endif /* commented out code */
-
DEFUN ("mark-marker", Fmark_marker, Smark_marker, 0, 0, 0,
"Return this buffer's mark, as a marker object.\n\
Watch out! Moving this marker changes the mark position.\n\
return current_buffer->mark;
}
-#if 0 /* this is now in lisp code */
-DEFUN ("set-mark", Fset_mark, Sset_mark, 1, 1, 0,
- "Set this buffer's mark to POS. Don't use this function!\n\
-That is to say, don't use this function unless you want\n\
-the user to see that the mark has moved, and you want the previous\n\
-mark position to be lost.\n\
-\n\
-Normally, when a new mark is set, the old one should go on the stack.\n\
-This is why most applications should use push-mark, not set-mark.\n\
-\n\
-Novice programmers often try to use the mark for the wrong purposes.\n\
-The mark saves a location for the user's convenience.\n\
-Most editing commands should not alter the mark.\n\
-To remember a location for internal use in the Lisp program,\n\
-store it in a Lisp variable. Example:\n\
-\n\
- (let ((beg (point))) (forward-line 1) (delete-region beg (point))).")
- (pos)
- Lisp_Object pos;
-{
- if (NILP (pos))
- {
- current_buffer->mark = Qnil;
- return Qnil;
- }
- CHECK_NUMBER_COERCE_MARKER (pos, 0);
-
- if (NILP (current_buffer->mark))
- current_buffer->mark = Fmake_marker ();
-
- Fset_marker (current_buffer->mark, pos, Qnil);
- return pos;
-}
-#endif /* commented-out code */
-
Lisp_Object
save_excursion_save ()
{
== current_buffer);
return Fcons (Fpoint_marker (),
- Fcons (Fcopy_marker (current_buffer->mark),
+ Fcons (Fcopy_marker (current_buffer->mark, Qnil),
Fcons (visible ? Qt : Qnil,
current_buffer->mark_active)));
}
The optional SPECIFIED-TIME should be a list of (HIGH LOW . IGNORED)\n\
or (HIGH . LOW), as from `current-time' and `file-attributes', or `nil'\n\
to use the current time. The list has the following nine members:\n\
-SEC is an integer between 0 and 59. MINUTE is an integer between 0 and 59.\n\
+SEC is an integer between 0 and 60; SEC is 60 for a leap second, which\n\
+only some operating systems support. MINUTE is an integer between 0 and 59.\n\
HOUR is an integer between 0 and 23. DAY is an integer between 1 and 31.\n\
MONTH is an integer between 1 and 12. YEAR is an integer indicating the\n\
four-digit year. DOW is the day of week, an integer between 0 and 6, where\n\
0 is Sunday. DST is t if daylight savings time is effect, otherwise nil.\n\
ZONE is an integer indicating the number of seconds east of Greenwich.\n\
-(Note that Common Lisp has different meanings for DOW and ZONE.)")
+\(Note that Common Lisp has different meanings for DOW and ZONE.)")
(specified_time)
Lisp_Object specified_time;
{
return current_buffer->undo_list = arg;
}
+static Lisp_Object
+subst_char_in_region_unwind_1 (arg)
+ Lisp_Object arg;
+{
+ return current_buffer->filename = arg;
+}
+
DEFUN ("subst-char-in-region", Fsubst_char_in_region,
Ssubst_char_in_region, 4, 5, 0,
"From START to END, replace FROMCHAR with TOCHAR each time it occurs.\n\
/* If we don't want undo, turn off putting stuff on the list.
That's faster than getting rid of things,
- and it prevents even the entry for a first change. */
+ and it prevents even the entry for a first change.
+ Also inhibit locking the file. */
if (!NILP (noundo))
{
record_unwind_protect (subst_char_in_region_unwind,
current_buffer->undo_list);
current_buffer->undo_list = Qt;
+ /* Don't do file-locking. */
+ record_unwind_protect (subst_char_in_region_unwind_1,
+ current_buffer->filename);
+ current_buffer->filename = Qnil;
}
while (pos < stop)
{
BEGV = BEG;
SET_BUF_ZV (current_buffer, Z);
- clip_changed = 1;
+ current_buffer->clip_changed = 1;
/* Changing the buffer bounds invalidates any recorded current column. */
invalidate_current_column ();
return Qnil;
SET_PT (XFASTINT (b));
if (point > XFASTINT (e))
SET_PT (XFASTINT (e));
- clip_changed = 1;
+ current_buffer->clip_changed = 1;
/* Changing the buffer bounds invalidates any recorded current column. */
invalidate_current_column ();
return Qnil;
}
BUF_BEGV (buf) = BUF_BEG (buf) + newhead;
SET_BUF_ZV (buf, BUF_Z (buf) - newtail);
- clip_changed = 1;
+ current_buffer->clip_changed = 1;
/* If point is outside the new visible range, move it inside. */
SET_BUF_PT (buf,
DEFUN ("message", Fmessage, Smessage, 1, MANY, 0,
"Print a one-line message at the bottom of the screen.\n\
-The first argument is a control string.\n\
-It may contain %s or %d or %c to print successive following arguments.\n\
-%s means print an argument as a string, %d means print as number in decimal,\n\
-%c means print a number as a single character.\n\
-The argument used by %s must be a string or a symbol;\n\
-the argument used by %d or %c must be a number.\n\
+The first argument is a format control string, and the rest are data\n\
+to be formatted under control of the string. See `format' for details.\n\
+\n\
If the first argument is nil, clear any existing message; let the\n\
minibuffer contents show.")
(nargs, args)
It may contain %-sequences meaning to substitute the next argument.\n\
%s means print a string argument. Actually, prints any object, with `princ'.\n\
%d means print as number in decimal (%o octal, %x hex).\n\
+%e means print a number in exponential notation.\n\
+%f means print a number in decimal-point notation.\n\
+%g means print a number in exponential notation\n\
+ or decimal-point notation, whichever uses fewer characters.\n\
%c means print a number as a single character.\n\
%S means print any object as an s-expression (using prin1).\n\
- The argument used for %d, %o, %x or %c must be a number.\n\
+ The argument used for %d, %o, %x, %e, %f, %g or %c must be a number.\n\
Use %% to put a single % into the output.")
(nargs, args)
int nargs;
/* Process a numeric arg and skip it. */
minlen = atoi (format);
- if (minlen > 0)
- total += minlen;
- else
- total -= minlen;
+ if (minlen < 0)
+ minlen = - minlen;
+
while ((*format >= '0' && *format <= '9')
|| *format == '-' || *format == ' ' || *format == '.')
format++;
if (*format == '%')
format++;
else if (++n >= nargs)
- error ("not enough arguments for format string");
+ error ("Not enough arguments for format string");
else if (*format == 'S')
{
/* For `S', prin1 the argument and then treat like a string. */
if (*format != 's' && *format != 'S')
error ("format specifier doesn't match argument type");
total += XSTRING (args[n])->size;
+ /* We have to put an arbitrary limit on minlen
+ since otherwise it could make alloca fail. */
+ if (minlen < XSTRING (args[n])->size + 1000)
+ total += minlen;
}
/* Would get MPV otherwise, since Lisp_Int's `point' to low memory. */
else if (INTEGERP (args[n]) && *format != 's')
args[n] = Ffloat (args[n]);
#endif
total += 30;
+ /* We have to put an arbitrary limit on minlen
+ since otherwise it could make alloca fail. */
+ if (minlen < 1000)
+ total += minlen;
}
#ifdef LISP_FLOAT_TYPE
else if (FLOATP (args[n]) && *format != 's')
if (! (*format == 'e' || *format == 'f' || *format == 'g'))
args[n] = Ftruncate (args[n]);
total += 30;
+ /* We have to put an arbitrary limit on minlen
+ since otherwise it could make alloca fail. */
+ if (minlen < 1000)
+ total += minlen;
}
#endif
else
strings[i++] = XSTRING (args[n])->data;
}
+ /* Make room in result for all the non-%-codes in the control string. */
+ total += XSTRING (args[0])->size;
+
/* Format it in bigger and bigger buf's until it all fits. */
while (1)
{