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 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Emacs is distributed in the hope that it will be useful,
DEFUN ("goto-char", Fgoto_char, Sgoto_char, 1, 1, "NGoto char: ",
doc: /* Set point to POSITION, a number or marker.
-Beginning of buffer is position (point-min), end is (point-max). */)
+Beginning of buffer is position (point-min), end is (point-max).
+
+The return value is POSITION. */)
(position)
register Lisp_Object position;
{
Value is an integer or float, depending on the value. */)
()
{
- return make_fixnum_or_float (geteuid ());
+ /* Assignment to EMACS_INT stops GCC whining about limited range of
+ data type. */
+ EMACS_INT euid = geteuid ();
+ return make_fixnum_or_float (euid);
}
DEFUN ("user-real-uid", Fuser_real_uid, Suser_real_uid, 0, 0, 0,
Value is an integer or float, depending on the value. */)
()
{
- return make_fixnum_or_float (getuid ());
+ /* Assignment to EMACS_INT stops GCC whining about limited range of
+ data type. */
+ EMACS_INT uid = getuid ();
+ return make_fixnum_or_float (uid);
}
DEFUN ("user-full-name", Fuser_full_name, Suser_full_name, 0, 1, 0,
least significant 16 bits. The third integer gives the microsecond
count.
-On systems that can't determine the run time, get-internal-run-time
-does the same thing as current-time. The microsecond count is zero on
-systems that do not provide resolution finer than a second. */)
+On systems that can't determine the run time, `get-internal-run-time'
+does the same thing as `current-time'. The microsecond count is zero
+on systems that do not provide resolution finer than a second. */)
()
{
#ifdef HAVE_GETRUSAGE
DEFUN ("decode-time", Fdecode_time, Sdecode_time, 0, 1, 0,
doc: /* Decode a time value as (SEC MINUTE HOUR DAY MONTH YEAR DOW DST ZONE).
The optional SPECIFIED-TIME should be a list of (HIGH LOW . IGNORED),
-as from `current-time' and `file-attributes', or `nil' to use the
+as from `current-time' and `file-attributes', or nil to use the
current time. The obsolete form (HIGH . LOW) is also still accepted.
The list has the following nine members: SEC is an integer between 0
and 60; SEC is 60 for a leap second, which only some operating systems
between 0 and 23. DAY is an integer between 1 and 31. MONTH is an
integer between 1 and 12. YEAR is an integer indicating the
four-digit year. DOW is the day of week, an integer between 0 and 6,
-where 0 is Sunday. DST is t if daylight savings time is effect,
+where 0 is Sunday. DST is t if daylight saving time is in effect,
otherwise nil. ZONE is an integer indicating the number of seconds
east of Greenwich. (Note that Common Lisp has different meanings for
DOW and ZONE.) */)
ZONE defaults to the current time zone rule. This can
be a string or t (as from `set-time-zone-rule'), or it can be a list
\(as from `current-time-zone') or an integer (as from `decode-time')
-applied without consideration for daylight savings time.
+applied without consideration for daylight saving time.
You can pass more than 7 arguments; then the first six arguments
are used as SECOND through YEAR, and the *last* argument is used as ZONE.
}
\f
DEFUN ("insert-char", Finsert_char, Sinsert_char, 2, 3, 0,
- doc: /* Insert COUNT (second arg) copies of CHARACTER (first arg).
-Both arguments are required.
+ doc: /* Insert COUNT copies of CHARACTER.
Point, and before-insertion markers, are relocated as in the function `insert'.
The optional third arg INHERIT, if non-nil, says to inherit text properties
from adjoining text, if those properties are sticky. */)
DEFUN ("save-restriction", Fsave_restriction, Ssave_restriction, 0, UNEVALLED, 0,
doc: /* Execute BODY, saving and restoring current buffer's restrictions.
The buffer's restrictions make parts of the beginning and end invisible.
-(They are set up with `narrow-to-region' and eliminated with `widen'.)
+\(They are set up with `narrow-to-region' and eliminated with `widen'.)
This special form, `save-restriction', saves the current buffer's restrictions
when it is entered, and restores them when it is exited.
So any `narrow-to-region' within BODY lasts only until the end of the form.
The basic structure of a %-sequence is
% <flags> <width> <precision> character
-where flags is [- #0]+, width is [0-9]+, and precision is .[0-9]+
+where flags is [-+ #0]+, width is [0-9]+, and precision is .[0-9]+
usage: (format STRING &rest OBJECTS) */)
(nargs, args)
where
- flags ::= [- #0]+
+ flags ::= [-+ #0]+
field-width ::= [0-9]+
precision ::= '.' [0-9]*
If a field-width is specified, it specifies to which width
- the output should be padded with blanks, iff the output
+ the output should be padded with blanks, if the output
string is shorter than field-width.
If precision is specified, it specifies the number of
while (format != end
&& (*format == '-' || *format == '0' || *format == '#'
- || * format == ' '))
+ || * format == ' ' || *format == '+'))
++format;
if (*format >= '0' && *format <= '9')
discarded[format - format_start] = 1;
format++;
- while (index("-0# ", *format))
+ while (index("-+0# ", *format))
{
if (*format == '-')
{
int gap, len1, len_mid, len2;
unsigned char *start1_addr, *start2_addr, *temp;
- INTERVAL cur_intv, tmp_interval1, tmp_interval_mid, tmp_interval2;
+ INTERVAL cur_intv, tmp_interval1, tmp_interval_mid, tmp_interval2, tmp_interval3;
+ Lisp_Object buf;
+
+ XSETBUFFER (buf, current_buffer);
cur_intv = BUF_INTERVALS (current_buffer);
validate_region (&startr1, &endr1);
tmp_interval1 = copy_intervals (cur_intv, start1, len1);
tmp_interval2 = copy_intervals (cur_intv, start2, len2);
- Fset_text_properties (make_number (start1), make_number (end2),
- Qnil, Qnil);
+ /* Don't use Fset_text_properties: that can cause GC, which can
+ clobber objects stored in the tmp_intervals. */
+ tmp_interval3 = validate_interval_range (buf, &startr1, &endr2, 0);
+ if (!NULL_INTERVAL_P (tmp_interval3))
+ set_text_properties_1 (startr1, endr2, Qnil, buf, tmp_interval3);
/* First region smaller than second. */
if (len1_byte < len2_byte)
record_change (start2, len2);
tmp_interval1 = copy_intervals (cur_intv, start1, len1);
tmp_interval2 = copy_intervals (cur_intv, start2, len2);
- Fset_text_properties (make_number (start1), make_number (end1),
- Qnil, Qnil);
- Fset_text_properties (make_number (start2), make_number (end2),
- Qnil, Qnil);
+
+ tmp_interval3 = validate_interval_range (buf, &startr1, &endr1, 0);
+ if (!NULL_INTERVAL_P (tmp_interval3))
+ set_text_properties_1 (startr1, endr1, Qnil, buf, tmp_interval3);
+
+ tmp_interval3 = validate_interval_range (buf, &startr2, &endr2, 0);
+ if (!NULL_INTERVAL_P (tmp_interval3))
+ set_text_properties_1 (startr2, endr2, Qnil, buf, tmp_interval3);
SAFE_ALLOCA (temp, unsigned char *, len1_byte);
start1_addr = BYTE_POS_ADDR (start1_byte);
tmp_interval1 = copy_intervals (cur_intv, start1, len1);
tmp_interval_mid = copy_intervals (cur_intv, end1, len_mid);
tmp_interval2 = copy_intervals (cur_intv, start2, len2);
- Fset_text_properties (make_number (start1), make_number (end2),
- Qnil, Qnil);
+
+ tmp_interval3 = validate_interval_range (buf, &startr1, &endr2, 0);
+ if (!NULL_INTERVAL_P (tmp_interval3))
+ set_text_properties_1 (startr1, endr2, Qnil, buf, tmp_interval3);
/* holds region 2 */
SAFE_ALLOCA (temp, unsigned char *, len2_byte);
tmp_interval1 = copy_intervals (cur_intv, start1, len1);
tmp_interval_mid = copy_intervals (cur_intv, end1, len_mid);
tmp_interval2 = copy_intervals (cur_intv, start2, len2);
- Fset_text_properties (make_number (start1), make_number (end2),
- Qnil, Qnil);
+
+ tmp_interval3 = validate_interval_range (buf, &startr1, &endr2, 0);
+ if (!NULL_INTERVAL_P (tmp_interval3))
+ set_text_properties_1 (startr1, endr2, Qnil, buf, tmp_interval3);
/* holds region 1 */
SAFE_ALLOCA (temp, unsigned char *, len1_byte);
fix_start_end_in_overlays (start1, end2);
}
+ signal_after_change (start1, end2 - start1, end2 - start1);
return Qnil;
}